|
@@ -1,47 +1,12 @@
|
|
|
/* eslint-disable no-unused-vars */
|
|
/* eslint-disable no-unused-vars */
|
|
|
-const VERSION = '1.19.1'
|
|
|
|
|
-
|
|
|
|
|
-let bootstrapVersion = 4
|
|
|
|
|
-
|
|
|
|
|
-try {
|
|
|
|
|
- const rawVersion = $.fn.dropdown.Constructor.VERSION
|
|
|
|
|
-
|
|
|
|
|
- // Only try to parse VERSION if it is defined.
|
|
|
|
|
- // It is undefined in older versions of Bootstrap (tested with 3.1.1).
|
|
|
|
|
- if (rawVersion !== undefined) {
|
|
|
|
|
- bootstrapVersion = parseInt(rawVersion, 10)
|
|
|
|
|
- }
|
|
|
|
|
-} catch (e) {
|
|
|
|
|
- // ignore
|
|
|
|
|
-}
|
|
|
|
|
|
|
+import Utils from '../utils/index.js'
|
|
|
|
|
|
|
|
-try {
|
|
|
|
|
- // eslint-disable-next-line no-undef
|
|
|
|
|
- const rawVersion = bootstrap.Tooltip.VERSION
|
|
|
|
|
|
|
+const VERSION = '1.19.1'
|
|
|
|
|
|
|
|
- if (rawVersion !== undefined) {
|
|
|
|
|
- bootstrapVersion = parseInt(rawVersion, 10)
|
|
|
|
|
- }
|
|
|
|
|
-} catch (e) {
|
|
|
|
|
- // ignore
|
|
|
|
|
-}
|
|
|
|
|
|
|
+const bootstrapVersion = Utils.getBootstrapVersion()
|
|
|
|
|
|
|
|
const CONSTANTS = {
|
|
const CONSTANTS = {
|
|
|
3: {
|
|
3: {
|
|
|
- iconsPrefix: 'glyphicon',
|
|
|
|
|
- icons: {
|
|
|
|
|
- paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
|
|
|
|
|
- paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
|
|
|
|
|
- refresh: 'glyphicon-refresh icon-refresh',
|
|
|
|
|
- toggleOff: 'glyphicon-list-alt icon-list-alt',
|
|
|
|
|
- toggleOn: 'glyphicon-list-alt icon-list-alt',
|
|
|
|
|
- columns: 'glyphicon-th icon-th',
|
|
|
|
|
- detailOpen: 'glyphicon-plus icon-plus',
|
|
|
|
|
- detailClose: 'glyphicon-minus icon-minus',
|
|
|
|
|
- fullscreen: 'glyphicon-fullscreen',
|
|
|
|
|
- search: 'glyphicon-search',
|
|
|
|
|
- clearSearch: 'glyphicon-trash'
|
|
|
|
|
- },
|
|
|
|
|
classes: {
|
|
classes: {
|
|
|
buttonsPrefix: 'btn',
|
|
buttonsPrefix: 'btn',
|
|
|
buttons: 'default',
|
|
buttons: 'default',
|
|
@@ -74,20 +39,6 @@ const CONSTANTS = {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
4: {
|
|
4: {
|
|
|
- iconsPrefix: 'fa',
|
|
|
|
|
- icons: {
|
|
|
|
|
- paginationSwitchDown: 'fa-caret-square-down',
|
|
|
|
|
- paginationSwitchUp: 'fa-caret-square-up',
|
|
|
|
|
- refresh: 'fa-sync',
|
|
|
|
|
- toggleOff: 'fa-toggle-off',
|
|
|
|
|
- toggleOn: 'fa-toggle-on',
|
|
|
|
|
- columns: 'fa-th-list',
|
|
|
|
|
- detailOpen: 'fa-plus',
|
|
|
|
|
- detailClose: 'fa-minus',
|
|
|
|
|
- fullscreen: 'fa-arrows-alt',
|
|
|
|
|
- search: 'fa-search',
|
|
|
|
|
- clearSearch: 'fa-trash'
|
|
|
|
|
- },
|
|
|
|
|
classes: {
|
|
classes: {
|
|
|
buttonsPrefix: 'btn',
|
|
buttonsPrefix: 'btn',
|
|
|
buttons: 'secondary',
|
|
buttons: 'secondary',
|
|
@@ -120,20 +71,6 @@ const CONSTANTS = {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
5: {
|
|
5: {
|
|
|
- iconsPrefix: 'bi',
|
|
|
|
|
- icons: {
|
|
|
|
|
- paginationSwitchDown: 'bi-caret-down-square',
|
|
|
|
|
- paginationSwitchUp: 'bi-caret-up-square',
|
|
|
|
|
- refresh: 'bi-arrow-clockwise',
|
|
|
|
|
- toggleOff: 'bi-toggle-off',
|
|
|
|
|
- toggleOn: 'bi-toggle-on',
|
|
|
|
|
- columns: 'bi-list-ul',
|
|
|
|
|
- detailOpen: 'bi-plus',
|
|
|
|
|
- detailClose: 'bi-dash',
|
|
|
|
|
- fullscreen: 'bi-arrows-move',
|
|
|
|
|
- search: 'bi-search',
|
|
|
|
|
- clearSearch: 'bi-trash'
|
|
|
|
|
- },
|
|
|
|
|
classes: {
|
|
classes: {
|
|
|
buttonsPrefix: 'btn',
|
|
buttonsPrefix: 'btn',
|
|
|
buttons: 'secondary',
|
|
buttons: 'secondary',
|
|
@@ -300,9 +237,9 @@ const DEFAULTS = {
|
|
|
buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
|
|
buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
|
|
|
buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
|
|
buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
|
|
|
buttonsClass: CONSTANTS.classes.buttons,
|
|
buttonsClass: CONSTANTS.classes.buttons,
|
|
|
- icons: CONSTANTS.icons,
|
|
|
|
|
|
|
+ iconsPrefix: undefined, // init in initConstants
|
|
|
|
|
+ icons: {}, // init in initConstants
|
|
|
iconSize: undefined,
|
|
iconSize: undefined,
|
|
|
- iconsPrefix: CONSTANTS.iconsPrefix, // glyphicon or fa(font-awesome)
|
|
|
|
|
loadingFontSize: 'auto',
|
|
loadingFontSize: 'auto',
|
|
|
loadingTemplate (loadingMessage) {
|
|
loadingTemplate (loadingMessage) {
|
|
|
return `<span class="loading-wrap">
|
|
return `<span class="loading-wrap">
|