mirror of
https://github.com/flarum/core.git
synced 2025-10-11 06:54:26 +02:00
12
js/admin/dist/app.js
vendored
12
js/admin/dist/app.js
vendored
@@ -17830,8 +17830,8 @@ System.register('flarum/components/BasicsPage', ['flarum/components/Page', 'flar
|
|||||||
});;
|
});;
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers/icon', 'flarum/utils/extract', 'flarum/components/LoadingIndicator'], function (_export, _context) {
|
System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers/icon', 'flarum/utils/extract', 'flarum/utils/extractText', 'flarum/components/LoadingIndicator'], function (_export, _context) {
|
||||||
var Component, icon, extract, LoadingIndicator, Button;
|
var Component, icon, extract, extractText, LoadingIndicator, Button;
|
||||||
return {
|
return {
|
||||||
setters: [function (_flarumComponent) {
|
setters: [function (_flarumComponent) {
|
||||||
Component = _flarumComponent.default;
|
Component = _flarumComponent.default;
|
||||||
@@ -17839,6 +17839,8 @@ System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers
|
|||||||
icon = _flarumHelpersIcon.default;
|
icon = _flarumHelpersIcon.default;
|
||||||
}, function (_flarumUtilsExtract) {
|
}, function (_flarumUtilsExtract) {
|
||||||
extract = _flarumUtilsExtract.default;
|
extract = _flarumUtilsExtract.default;
|
||||||
|
}, function (_flarumUtilsExtractText) {
|
||||||
|
extractText = _flarumUtilsExtractText.default;
|
||||||
}, function (_flarumComponentsLoadingIndicator) {
|
}, function (_flarumComponentsLoadingIndicator) {
|
||||||
LoadingIndicator = _flarumComponentsLoadingIndicator.default;
|
LoadingIndicator = _flarumComponentsLoadingIndicator.default;
|
||||||
}],
|
}],
|
||||||
@@ -17860,6 +17862,7 @@ System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers
|
|||||||
|
|
||||||
attrs.className = attrs.className || '';
|
attrs.className = attrs.className || '';
|
||||||
attrs.type = attrs.type || 'button';
|
attrs.type = attrs.type || 'button';
|
||||||
|
attrs.title = attrs.title || this.getDefaultTitle();
|
||||||
|
|
||||||
var iconName = extract(attrs, 'icon');
|
var iconName = extract(attrs, 'icon');
|
||||||
if (iconName) attrs.className += ' hasIcon';
|
if (iconName) attrs.className += ' hasIcon';
|
||||||
@@ -17876,6 +17879,11 @@ System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers
|
|||||||
this.getButtonContent()
|
this.getButtonContent()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: 'getDefaultTitle',
|
||||||
|
value: function getDefaultTitle() {
|
||||||
|
return extractText(this.props.children);
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'getButtonContent',
|
key: 'getButtonContent',
|
||||||
value: function getButtonContent() {
|
value: function getButtonContent() {
|
||||||
|
12
js/forum/dist/app.js
vendored
12
js/forum/dist/app.js
vendored
@@ -19153,8 +19153,8 @@ System.register('flarum/components/Badge', ['flarum/Component', 'flarum/helpers/
|
|||||||
});;
|
});;
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers/icon', 'flarum/utils/extract', 'flarum/components/LoadingIndicator'], function (_export, _context) {
|
System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers/icon', 'flarum/utils/extract', 'flarum/utils/extractText', 'flarum/components/LoadingIndicator'], function (_export, _context) {
|
||||||
var Component, icon, extract, LoadingIndicator, Button;
|
var Component, icon, extract, extractText, LoadingIndicator, Button;
|
||||||
return {
|
return {
|
||||||
setters: [function (_flarumComponent) {
|
setters: [function (_flarumComponent) {
|
||||||
Component = _flarumComponent.default;
|
Component = _flarumComponent.default;
|
||||||
@@ -19162,6 +19162,8 @@ System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers
|
|||||||
icon = _flarumHelpersIcon.default;
|
icon = _flarumHelpersIcon.default;
|
||||||
}, function (_flarumUtilsExtract) {
|
}, function (_flarumUtilsExtract) {
|
||||||
extract = _flarumUtilsExtract.default;
|
extract = _flarumUtilsExtract.default;
|
||||||
|
}, function (_flarumUtilsExtractText) {
|
||||||
|
extractText = _flarumUtilsExtractText.default;
|
||||||
}, function (_flarumComponentsLoadingIndicator) {
|
}, function (_flarumComponentsLoadingIndicator) {
|
||||||
LoadingIndicator = _flarumComponentsLoadingIndicator.default;
|
LoadingIndicator = _flarumComponentsLoadingIndicator.default;
|
||||||
}],
|
}],
|
||||||
@@ -19183,6 +19185,7 @@ System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers
|
|||||||
|
|
||||||
attrs.className = attrs.className || '';
|
attrs.className = attrs.className || '';
|
||||||
attrs.type = attrs.type || 'button';
|
attrs.type = attrs.type || 'button';
|
||||||
|
attrs.title = attrs.title || this.getDefaultTitle();
|
||||||
|
|
||||||
var iconName = extract(attrs, 'icon');
|
var iconName = extract(attrs, 'icon');
|
||||||
if (iconName) attrs.className += ' hasIcon';
|
if (iconName) attrs.className += ' hasIcon';
|
||||||
@@ -19199,6 +19202,11 @@ System.register('flarum/components/Button', ['flarum/Component', 'flarum/helpers
|
|||||||
this.getButtonContent()
|
this.getButtonContent()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: 'getDefaultTitle',
|
||||||
|
value: function getDefaultTitle() {
|
||||||
|
return extractText(this.props.children);
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'getButtonContent',
|
key: 'getButtonContent',
|
||||||
value: function getButtonContent() {
|
value: function getButtonContent() {
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import Component from 'flarum/Component';
|
import Component from 'flarum/Component';
|
||||||
import icon from 'flarum/helpers/icon';
|
import icon from 'flarum/helpers/icon';
|
||||||
import extract from 'flarum/utils/extract';
|
import extract from 'flarum/utils/extract';
|
||||||
|
import extractText from 'flarum/utils/extractText';
|
||||||
import LoadingIndicator from 'flarum/components/LoadingIndicator';
|
import LoadingIndicator from 'flarum/components/LoadingIndicator';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,6 +28,7 @@ export default class Button extends Component {
|
|||||||
|
|
||||||
attrs.className = attrs.className || '';
|
attrs.className = attrs.className || '';
|
||||||
attrs.type = attrs.type || 'button';
|
attrs.type = attrs.type || 'button';
|
||||||
|
attrs.title = attrs.title || this.getDefaultTitle();
|
||||||
|
|
||||||
const iconName = extract(attrs, 'icon');
|
const iconName = extract(attrs, 'icon');
|
||||||
if (iconName) attrs.className += ' hasIcon';
|
if (iconName) attrs.className += ' hasIcon';
|
||||||
@@ -40,6 +42,16 @@ export default class Button extends Component {
|
|||||||
return <button {...attrs}>{this.getButtonContent()}</button>;
|
return <button {...attrs}>{this.getButtonContent()}</button>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default value for the title attribute.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @protected
|
||||||
|
*/
|
||||||
|
getDefaultTitle() {
|
||||||
|
return extractText(this.props.children);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the template for the button's content.
|
* Get the template for the button's content.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user