buefy 0.7.9 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/dist/buefy.css +13759 -8263
- package/dist/buefy.js +9073 -14866
- package/dist/buefy.min.css +1 -5
- package/dist/buefy.min.js +2 -2
- package/dist/cjs/autocomplete.js +22 -0
- package/dist/cjs/button.js +106 -0
- package/dist/cjs/checkbox.js +135 -0
- package/dist/cjs/chunk-07fe6fc0.js +247 -0
- package/dist/cjs/chunk-0af453a7.js +105 -0
- package/dist/cjs/chunk-0e89e51b.js +394 -0
- package/dist/cjs/chunk-13e039f5.js +104 -0
- package/dist/cjs/chunk-143d9e6d.js +404 -0
- package/dist/cjs/chunk-19ebd649.js +114 -0
- package/dist/cjs/chunk-1b1231ce.js +94 -0
- package/dist/cjs/chunk-1e6abfcf.js +94 -0
- package/dist/cjs/chunk-28d164b1.js +172 -0
- package/dist/cjs/chunk-3396605d.js +394 -0
- package/dist/cjs/chunk-364a37a0.js +404 -0
- package/dist/cjs/chunk-3b066933.js +103 -0
- package/dist/cjs/chunk-3dffe6e7.js +54 -0
- package/dist/cjs/chunk-4a03b064.js +199 -0
- package/dist/cjs/chunk-50b06939.js +153 -0
- package/dist/cjs/chunk-52623128.js +105 -0
- package/dist/cjs/chunk-53d4f332.js +94 -0
- package/dist/cjs/chunk-544a95da.js +404 -0
- package/dist/cjs/chunk-545f01b1.js +49 -0
- package/dist/cjs/chunk-59b91990.js +64 -0
- package/dist/cjs/chunk-5b2a3329.js +394 -0
- package/dist/cjs/chunk-60061aa8.js +172 -0
- package/dist/cjs/chunk-67658e54.js +404 -0
- package/dist/cjs/chunk-6963026a.js +86 -0
- package/dist/cjs/chunk-6cece6b7.js +140 -0
- package/dist/cjs/chunk-6d6465c1.js +140 -0
- package/dist/cjs/chunk-6e9c0aca.js +94 -0
- package/dist/cjs/chunk-77f69fca.js +106 -0
- package/dist/cjs/chunk-7a25d736.js +114 -0
- package/dist/cjs/chunk-876befa8.js +247 -0
- package/dist/cjs/chunk-8985ffff.js +105 -0
- package/dist/cjs/chunk-8a05c8c9.js +207 -0
- package/dist/cjs/chunk-90407463.js +258 -0
- package/dist/cjs/chunk-956525c9.js +106 -0
- package/dist/cjs/chunk-96ce35a2.js +114 -0
- package/dist/cjs/chunk-9da1d120.js +86 -0
- package/dist/cjs/chunk-9f6a8079.js +54 -0
- package/dist/cjs/chunk-a60dc21d.js +281 -0
- package/dist/cjs/chunk-b628277d.js +199 -0
- package/dist/cjs/chunk-c146745e.js +153 -0
- package/dist/cjs/chunk-c2aec7a9.js +547 -0
- package/dist/cjs/chunk-c9641331.js +86 -0
- package/dist/cjs/chunk-d492406b.js +172 -0
- package/dist/cjs/chunk-e0aa62a0.js +404 -0
- package/dist/cjs/chunk-e45e0329.js +48 -0
- package/dist/cjs/chunk-e5de6583.js +207 -0
- package/dist/cjs/chunk-e85cceb6.js +258 -0
- package/dist/cjs/chunk-ed5addd6.js +547 -0
- package/dist/cjs/chunk-ef4753d5.js +283 -0
- package/dist/cjs/chunk-f0c597f9.js +199 -0
- package/dist/cjs/chunk-f1df1c63.js +9 -0
- package/dist/cjs/chunk-f1ee2f5c.js +207 -0
- package/dist/cjs/chunk-fbd4d545.js +247 -0
- package/dist/cjs/clockpicker.js +447 -0
- package/dist/cjs/collapse.js +102 -0
- package/dist/cjs/datepicker.js +1281 -0
- package/dist/cjs/dialog.js +237 -0
- package/dist/cjs/dropdown.js +19 -0
- package/dist/cjs/field.js +18 -0
- package/dist/cjs/icon.js +17 -0
- package/dist/cjs/index.js +164 -0
- package/dist/cjs/input.js +20 -0
- package/dist/cjs/loading.js +166 -0
- package/dist/cjs/menu.js +231 -0
- package/dist/cjs/message.js +65 -0
- package/dist/cjs/modal.js +48 -0
- package/dist/cjs/navbar.js +258 -0
- package/dist/cjs/notification.js +142 -0
- package/dist/cjs/numberinput.js +191 -0
- package/dist/cjs/pagination.js +19 -0
- package/dist/cjs/progress.js +151 -0
- package/dist/cjs/radio.js +224 -0
- package/dist/cjs/select.js +20 -0
- package/dist/cjs/slider.js +511 -0
- package/dist/cjs/snackbar.js +114 -0
- package/dist/cjs/steps.js +352 -0
- package/dist/cjs/switch.js +144 -0
- package/dist/cjs/table.js +877 -0
- package/dist/cjs/tabs.js +258 -0
- package/dist/cjs/tag.js +63 -0
- package/dist/cjs/taginput.js +297 -0
- package/dist/cjs/timepicker.js +75 -0
- package/dist/cjs/toast.js +89 -0
- package/dist/cjs/tooltip.js +17 -0
- package/dist/cjs/upload.js +210 -0
- package/dist/components/autocomplete/index.js +1084 -2
- package/dist/components/autocomplete/index.min.js +2 -0
- package/dist/components/button/index.js +425 -2
- package/dist/components/button/index.min.js +2 -0
- package/dist/components/checkbox/index.js +342 -2
- package/dist/components/checkbox/index.min.js +2 -0
- package/dist/components/clockpicker/index.js +2340 -2
- package/dist/components/clockpicker/index.min.js +2 -0
- package/dist/components/collapse/index.js +201 -2
- package/dist/components/collapse/index.min.js +2 -0
- package/dist/components/datepicker/index.js +2720 -2
- package/dist/components/datepicker/index.min.js +2 -0
- package/dist/components/dialog/index.js +768 -2
- package/dist/components/dialog/index.min.js +2 -0
- package/dist/components/dropdown/index.js +555 -2
- package/dist/components/dropdown/index.min.js +2 -0
- package/dist/components/field/index.js +447 -2
- package/dist/components/field/index.min.js +2 -0
- package/dist/components/icon/index.js +322 -2
- package/dist/components/icon/index.min.js +2 -0
- package/dist/components/input/index.js +675 -2
- package/dist/components/input/index.min.js +2 -0
- package/dist/components/loading/index.js +282 -2
- package/dist/components/loading/index.min.js +2 -0
- package/dist/components/menu/index.js +550 -2
- package/dist/components/menu/index.min.js +2 -0
- package/dist/components/message/index.js +482 -2
- package/dist/components/message/index.min.js +2 -0
- package/dist/components/modal/index.js +400 -2
- package/dist/components/modal/index.min.js +2 -0
- package/dist/components/navbar/index.js +371 -0
- package/dist/components/navbar/index.min.js +2 -0
- package/dist/components/notification/index.js +705 -2
- package/dist/components/notification/index.min.js +2 -0
- package/dist/components/numberinput/index.js +846 -2
- package/dist/components/numberinput/index.min.js +2 -0
- package/dist/components/pagination/index.js +577 -2
- package/dist/components/pagination/index.min.js +2 -0
- package/dist/components/progress/index.js +250 -0
- package/dist/components/progress/index.min.js +2 -0
- package/dist/components/radio/index.js +323 -2
- package/dist/components/radio/index.min.js +2 -0
- package/dist/components/select/index.js +571 -2
- package/dist/components/select/index.min.js +2 -0
- package/dist/components/slider/index.js +764 -0
- package/dist/components/slider/index.min.js +2 -0
- package/dist/components/snackbar/index.js +397 -2
- package/dist/components/snackbar/index.min.js +2 -0
- package/dist/components/steps/index.js +721 -2
- package/dist/components/steps/index.min.js +2 -0
- package/dist/components/switch/index.js +243 -2
- package/dist/components/switch/index.min.js +2 -0
- package/dist/components/table/index.js +1870 -2
- package/dist/components/table/index.min.js +2 -0
- package/dist/components/tabs/index.js +627 -2
- package/dist/components/tabs/index.min.js +2 -0
- package/dist/components/tag/index.js +262 -2
- package/dist/components/tag/index.min.js +2 -0
- package/dist/components/taginput/index.js +1459 -2
- package/dist/components/taginput/index.min.js +2 -0
- package/dist/components/timepicker/index.js +2053 -2
- package/dist/components/timepicker/index.min.js +2 -0
- package/dist/components/toast/index.js +372 -2
- package/dist/components/toast/index.min.js +2 -0
- package/dist/components/tooltip/index.js +236 -2
- package/dist/components/tooltip/index.min.js +2 -0
- package/dist/components/upload/index.js +501 -2
- package/dist/components/upload/index.min.js +2 -0
- package/dist/esm/autocomplete.js +18 -0
- package/dist/esm/button.js +102 -0
- package/dist/esm/checkbox.js +131 -0
- package/dist/esm/chunk-00e3e67f.js +401 -0
- package/dist/esm/chunk-051f8b06.js +105 -0
- package/dist/esm/chunk-0566c90d.js +152 -0
- package/dist/esm/chunk-07e19446.js +545 -0
- package/dist/esm/chunk-085a700d.js +7 -0
- package/dist/esm/chunk-0ad6938a.js +53 -0
- package/dist/esm/chunk-0e3f4fb5.js +52 -0
- package/dist/esm/chunk-10c85529.js +151 -0
- package/dist/esm/chunk-121b1efa.js +197 -0
- package/dist/esm/chunk-19dad95e.js +256 -0
- package/dist/esm/chunk-231b6066.js +113 -0
- package/dist/esm/chunk-24d1a01f.js +279 -0
- package/dist/esm/chunk-297bff6b.js +393 -0
- package/dist/esm/chunk-2b2ae5c6.js +245 -0
- package/dist/esm/chunk-2cb6f867.js +46 -0
- package/dist/esm/chunk-33717194.js +392 -0
- package/dist/esm/chunk-3b811b77.js +139 -0
- package/dist/esm/chunk-3e47308f.js +104 -0
- package/dist/esm/chunk-411d6eea.js +84 -0
- package/dist/esm/chunk-4535dec5.js +92 -0
- package/dist/esm/chunk-47a5f3a1.js +103 -0
- package/dist/esm/chunk-4a5384da.js +205 -0
- package/dist/esm/chunk-4b663574.js +112 -0
- package/dist/esm/chunk-4d393f09.js +170 -0
- package/dist/esm/chunk-4d695899.js +257 -0
- package/dist/esm/chunk-4f508891.js +171 -0
- package/dist/esm/chunk-531b8274.js +281 -0
- package/dist/esm/chunk-591ee4a2.js +151 -0
- package/dist/esm/chunk-5d3bf82e.js +170 -0
- package/dist/esm/chunk-5e0b0665.js +104 -0
- package/dist/esm/chunk-648b9aa4.js +45 -0
- package/dist/esm/chunk-666940cf.js +546 -0
- package/dist/esm/chunk-67c97e13.js +246 -0
- package/dist/esm/chunk-6844653e.js +401 -0
- package/dist/esm/chunk-699b7cb4.js +245 -0
- package/dist/esm/chunk-6f881e7d.js +51 -0
- package/dist/esm/chunk-7123d158.js +256 -0
- package/dist/esm/chunk-7cf87590.js +60 -0
- package/dist/esm/chunk-823177ac.js +545 -0
- package/dist/esm/chunk-8838757a.js +401 -0
- package/dist/esm/chunk-8ca878c0.js +198 -0
- package/dist/esm/chunk-8fc2e874.js +85 -0
- package/dist/esm/chunk-912ed715.js +92 -0
- package/dist/esm/chunk-92acc21f.js +392 -0
- package/dist/esm/chunk-98e86f40.js +197 -0
- package/dist/esm/chunk-99a1f9df.js +92 -0
- package/dist/esm/chunk-9a776697.js +112 -0
- package/dist/esm/chunk-9e3207cc.js +46 -0
- package/dist/esm/chunk-9ec14e09.js +112 -0
- package/dist/esm/chunk-a5ea70d0.js +205 -0
- package/dist/esm/chunk-ac3f4847.js +138 -0
- package/dist/esm/chunk-b5376f3e.js +92 -0
- package/dist/esm/chunk-b56eb2c8.js +197 -0
- package/dist/esm/chunk-b796d1b2.js +392 -0
- package/dist/esm/chunk-b822a5db.js +205 -0
- package/dist/esm/chunk-b9bdb0e4.js +6 -0
- package/dist/esm/chunk-bfe15983.js +401 -0
- package/dist/esm/chunk-c9039f68.js +104 -0
- package/dist/esm/chunk-cc718c15.js +245 -0
- package/dist/esm/chunk-cca88db8.js +99 -0
- package/dist/esm/chunk-d6200087.js +50 -0
- package/dist/esm/chunk-daeac852.js +138 -0
- package/dist/esm/chunk-db31c548.js +103 -0
- package/dist/esm/chunk-e5568f45.js +84 -0
- package/dist/esm/chunk-e5fce48f.js +59 -0
- package/dist/esm/chunk-e84b4047.js +170 -0
- package/dist/esm/chunk-e8d90b72.js +98 -0
- package/dist/esm/chunk-e932bb68.js +206 -0
- package/dist/esm/chunk-edd8ff91.js +103 -0
- package/dist/esm/chunk-f0465d8d.js +84 -0
- package/dist/esm/chunk-f743d154.js +93 -0
- package/dist/esm/chunk-f8036b32.js +402 -0
- package/dist/esm/chunk-f984748f.js +401 -0
- package/dist/esm/chunk-fd5b0e1e.js +99 -0
- package/dist/esm/clockpicker.js +443 -0
- package/dist/esm/collapse.js +98 -0
- package/dist/esm/datepicker.js +1277 -0
- package/dist/esm/dialog.js +231 -0
- package/dist/esm/dropdown.js +14 -0
- package/dist/esm/field.js +14 -0
- package/dist/esm/icon.js +13 -0
- package/dist/esm/index.js +154 -0
- package/dist/esm/input.js +16 -0
- package/dist/esm/loading.js +159 -0
- package/dist/esm/menu.js +225 -0
- package/dist/esm/message.js +61 -0
- package/dist/esm/modal.js +42 -0
- package/dist/esm/navbar.js +253 -0
- package/dist/esm/notification.js +135 -0
- package/dist/esm/numberinput.js +187 -0
- package/dist/esm/pagination.js +15 -0
- package/dist/esm/progress.js +147 -0
- package/dist/esm/radio.js +219 -0
- package/dist/esm/select.js +16 -0
- package/dist/esm/slider.js +506 -0
- package/dist/esm/snackbar.js +108 -0
- package/dist/esm/steps.js +347 -0
- package/dist/esm/switch.js +140 -0
- package/dist/esm/table.js +872 -0
- package/dist/esm/tabs.js +253 -0
- package/dist/esm/tag.js +59 -0
- package/dist/esm/taginput.js +293 -0
- package/dist/esm/timepicker.js +71 -0
- package/dist/esm/toast.js +83 -0
- package/dist/esm/tooltip.js +13 -0
- package/dist/esm/upload.js +206 -0
- package/package.json +26 -4
- package/src/components/checkbox/Checkbox.vue +12 -4
- package/src/components/checkbox/CheckboxButton.vue +10 -2
- package/src/components/clockpicker/Clockpicker.vue +0 -5
- package/src/components/datepicker/Datepicker.spec.js +60 -0
- package/src/components/datepicker/Datepicker.vue +46 -19
- package/src/components/datepicker/DatepickerTable.spec.js +107 -2
- package/src/components/datepicker/DatepickerTable.vue +73 -4
- package/src/components/datepicker/DatepickerTableRow.spec.js +127 -17
- package/src/components/datepicker/DatepickerTableRow.vue +103 -4
- package/src/components/dialog/Dialog.vue +5 -3
- package/src/components/dialog/index.js +2 -2
- package/src/components/dropdown/Dropdown.vue +1 -4
- package/src/components/dropdown/DropdownItem.vue +7 -3
- package/src/components/field/Field.spec.js +18 -0
- package/src/components/field/Field.vue +21 -2
- package/src/components/index.js +6 -0
- package/src/components/input/Input.vue +2 -2
- package/src/components/loading/index.js +1 -1
- package/src/components/modal/index.js +1 -1
- package/src/components/navbar/NavBar.spec.js +76 -0
- package/src/components/navbar/Navbar.vue +127 -0
- package/src/components/navbar/NavbarBurger.vue +25 -0
- package/src/components/navbar/NavbarItem.vue +21 -0
- package/src/components/navbar/index.js +20 -0
- package/src/components/notification/index.js +1 -1
- package/src/components/pagination/Pagination.vue +28 -6
- package/src/components/progress/Progress.spec.js +77 -0
- package/src/components/progress/Progress.vue +108 -0
- package/src/components/progress/__snapshots__/Progress.spec.js.snap +7 -0
- package/src/components/progress/index.js +17 -0
- package/src/components/radio/Radio.spec.js +18 -1
- package/src/components/radio/Radio.vue +11 -5
- package/src/components/radio/RadioButton.spec.js +18 -1
- package/src/components/radio/RadioButton.vue +20 -8
- package/src/components/select/Select.spec.js +22 -1
- package/src/components/select/Select.vue +2 -1
- package/src/components/select/__snapshots__/Select.spec.js.snap +7 -0
- package/src/components/slider/Slider.spec.js +10 -0
- package/src/components/slider/Slider.vue +240 -0
- package/src/components/slider/SliderThumb.vue +188 -0
- package/src/components/slider/SliderTick.vue +43 -0
- package/src/components/slider/index.js +20 -0
- package/src/components/snackbar/index.js +2 -2
- package/src/components/steps/StepItem.vue +2 -3
- package/src/components/steps/Steps.vue +7 -5
- package/src/components/switch/Switch.spec.js +29 -0
- package/src/components/switch/Switch.vue +29 -5
- package/src/components/switch/__snapshots__/Switch.spec.js.snap +3 -0
- package/src/components/table/Table.vue +30 -8
- package/src/components/table/TableColumn.vue +2 -2
- package/src/components/tag/Tag.vue +4 -1
- package/src/components/taginput/Taginput.spec.js +10 -0
- package/src/components/taginput/Taginput.vue +8 -3
- package/src/components/toast/index.js +2 -2
- package/src/components/tooltip/Tooltip.vue +5 -5
- package/src/components/upload/Upload.vue +15 -8
- package/src/index.js +11 -4
- package/src/scss/buefy-build.scss +3 -3
- package/src/scss/buefy.scss +4 -0
- package/src/scss/components/_datepicker.scss +40 -1
- package/src/scss/components/_form.scss +52 -1
- package/src/scss/components/_progress.scss +45 -0
- package/src/scss/components/_radio.scss +14 -14
- package/src/scss/components/_slider.scss +138 -0
- package/src/scss/components/_steps.scss +4 -4
- package/src/scss/components/_switch.scss +54 -2
- package/src/scss/components/_taginput.scss +3 -0
- package/src/scss/components/_upload.scss +1 -3
- package/src/utils/SlotComponent.js +9 -2
- package/src/utils/TimepickerMixin.js +17 -6
- package/src/utils/config.js +4 -1
- package/src/utils/helpers.spec.js +67 -0
- package/src/utils/plugins.js +2 -1
- package/types/components.d.ts +3 -3
- package/types/index.d.ts +24 -11
- package/dist/components/index.js +0 -2
|
@@ -0,0 +1,764 @@
|
|
|
1
|
+
/*! Buefy v0.8.2 | MIT License | github.com/buefy/buefy */
|
|
2
|
+
(function (global, factory) {
|
|
3
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
5
|
+
(global = global || self, factory(global.Slider = {}));
|
|
6
|
+
}(this, function (exports) { 'use strict';
|
|
7
|
+
|
|
8
|
+
function _defineProperty(obj, key, value) {
|
|
9
|
+
if (key in obj) {
|
|
10
|
+
Object.defineProperty(obj, key, {
|
|
11
|
+
value: value,
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true
|
|
15
|
+
});
|
|
16
|
+
} else {
|
|
17
|
+
obj[key] = value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _toConsumableArray(arr) {
|
|
24
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _arrayWithoutHoles(arr) {
|
|
28
|
+
if (Array.isArray(arr)) {
|
|
29
|
+
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
30
|
+
|
|
31
|
+
return arr2;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _iterableToArray(iter) {
|
|
36
|
+
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function _nonIterableSpread() {
|
|
40
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var config = {
|
|
44
|
+
defaultContainerElement: null,
|
|
45
|
+
defaultIconPack: 'mdi',
|
|
46
|
+
defaultIconComponent: null,
|
|
47
|
+
defaultDialogConfirmText: null,
|
|
48
|
+
defaultDialogCancelText: null,
|
|
49
|
+
defaultSnackbarDuration: 3500,
|
|
50
|
+
defaultSnackbarPosition: null,
|
|
51
|
+
defaultToastDuration: 2000,
|
|
52
|
+
defaultToastPosition: null,
|
|
53
|
+
defaultNotificationDuration: 2000,
|
|
54
|
+
defaultNotificationPosition: null,
|
|
55
|
+
defaultTooltipType: 'is-primary',
|
|
56
|
+
defaultTooltipAnimated: false,
|
|
57
|
+
defaultTooltipDelay: 0,
|
|
58
|
+
defaultInputAutocomplete: 'on',
|
|
59
|
+
defaultDateFormatter: null,
|
|
60
|
+
defaultDateParser: null,
|
|
61
|
+
defaultDateCreator: null,
|
|
62
|
+
defaultDayNames: null,
|
|
63
|
+
defaultMonthNames: null,
|
|
64
|
+
defaultFirstDayOfWeek: null,
|
|
65
|
+
defaultUnselectableDaysOfWeek: null,
|
|
66
|
+
defaultTimeFormatter: null,
|
|
67
|
+
defaultTimeParser: null,
|
|
68
|
+
defaultModalCanCancel: ['escape', 'x', 'outside', 'button'],
|
|
69
|
+
defaultModalScroll: null,
|
|
70
|
+
defaultDatepickerMobileNative: true,
|
|
71
|
+
defaultTimepickerMobileNative: true,
|
|
72
|
+
defaultNoticeQueue: true,
|
|
73
|
+
defaultInputHasCounter: true,
|
|
74
|
+
defaultTaginputHasCounter: true,
|
|
75
|
+
defaultUseHtml5Validation: true,
|
|
76
|
+
defaultDropdownMobileModal: true,
|
|
77
|
+
defaultFieldLabelPosition: null,
|
|
78
|
+
defaultDatepickerYearsRange: [-100, 3],
|
|
79
|
+
defaultDatepickerNearbyMonthDays: true,
|
|
80
|
+
defaultDatepickerNearbySelectableMonthDays: false,
|
|
81
|
+
defaultDatepickerShowWeekNumber: false
|
|
82
|
+
};
|
|
83
|
+
var config$1 = config;
|
|
84
|
+
|
|
85
|
+
//
|
|
86
|
+
var script = {
|
|
87
|
+
name: 'BTooltip',
|
|
88
|
+
props: {
|
|
89
|
+
active: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: true
|
|
92
|
+
},
|
|
93
|
+
type: String,
|
|
94
|
+
label: String,
|
|
95
|
+
position: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'is-top',
|
|
98
|
+
validator: function validator(value) {
|
|
99
|
+
return ['is-top', 'is-bottom', 'is-left', 'is-right'].indexOf(value) > -1;
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
always: Boolean,
|
|
103
|
+
animated: Boolean,
|
|
104
|
+
square: Boolean,
|
|
105
|
+
dashed: Boolean,
|
|
106
|
+
multilined: Boolean,
|
|
107
|
+
size: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: 'is-medium'
|
|
110
|
+
},
|
|
111
|
+
delay: Number
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
newType: function newType() {
|
|
115
|
+
return this.type || config$1.defaultTooltipType;
|
|
116
|
+
},
|
|
117
|
+
newAnimated: function newAnimated() {
|
|
118
|
+
return this.animated || config$1.defaultTooltipAnimated;
|
|
119
|
+
},
|
|
120
|
+
newDelay: function newDelay() {
|
|
121
|
+
return this.delay || config$1.defaultTooltipDelay;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
|
127
|
+
/* server only */
|
|
128
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
129
|
+
if (typeof shadowMode !== 'boolean') {
|
|
130
|
+
createInjectorSSR = createInjector;
|
|
131
|
+
createInjector = shadowMode;
|
|
132
|
+
shadowMode = false;
|
|
133
|
+
} // Vue.extend constructor export interop.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
var options = typeof script === 'function' ? script.options : script; // render functions
|
|
137
|
+
|
|
138
|
+
if (template && template.render) {
|
|
139
|
+
options.render = template.render;
|
|
140
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
141
|
+
options._compiled = true; // functional template
|
|
142
|
+
|
|
143
|
+
if (isFunctionalTemplate) {
|
|
144
|
+
options.functional = true;
|
|
145
|
+
}
|
|
146
|
+
} // scopedId
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if (scopeId) {
|
|
150
|
+
options._scopeId = scopeId;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var hook;
|
|
154
|
+
|
|
155
|
+
if (moduleIdentifier) {
|
|
156
|
+
// server build
|
|
157
|
+
hook = function hook(context) {
|
|
158
|
+
// 2.3 injection
|
|
159
|
+
context = context || // cached call
|
|
160
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
161
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
|
|
162
|
+
// 2.2 with runInNewContext: true
|
|
163
|
+
|
|
164
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
165
|
+
context = __VUE_SSR_CONTEXT__;
|
|
166
|
+
} // inject component styles
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
if (style) {
|
|
170
|
+
style.call(this, createInjectorSSR(context));
|
|
171
|
+
} // register component module identifier for async chunk inference
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
if (context && context._registeredComponents) {
|
|
175
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
176
|
+
}
|
|
177
|
+
}; // used by ssr in case component is cached and beforeCreate
|
|
178
|
+
// never gets called
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
options._ssrRegister = hook;
|
|
182
|
+
} else if (style) {
|
|
183
|
+
hook = shadowMode ? function () {
|
|
184
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
185
|
+
} : function (context) {
|
|
186
|
+
style.call(this, createInjector(context));
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (hook) {
|
|
191
|
+
if (options.functional) {
|
|
192
|
+
// register for functional component in vue file
|
|
193
|
+
var originalRender = options.render;
|
|
194
|
+
|
|
195
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
196
|
+
hook.call(context);
|
|
197
|
+
return originalRender(h, context);
|
|
198
|
+
};
|
|
199
|
+
} else {
|
|
200
|
+
// inject component registration as beforeCreate hook
|
|
201
|
+
var existing = options.beforeCreate;
|
|
202
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return script;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var normalizeComponent_1 = normalizeComponent;
|
|
210
|
+
|
|
211
|
+
/* script */
|
|
212
|
+
const __vue_script__ = script;
|
|
213
|
+
|
|
214
|
+
/* template */
|
|
215
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{class:[_vm.newType, _vm.position, _vm.size, {
|
|
216
|
+
'b-tooltip': _vm.active,
|
|
217
|
+
'is-square': _vm.square,
|
|
218
|
+
'is-animated': _vm.newAnimated,
|
|
219
|
+
'is-always': _vm.always,
|
|
220
|
+
'is-multiline': _vm.multilined,
|
|
221
|
+
'is-dashed': _vm.dashed
|
|
222
|
+
}],style:({'transition-delay': (_vm.newDelay + "ms")}),attrs:{"data-label":_vm.label}},[_vm._t("default")],2)};
|
|
223
|
+
var __vue_staticRenderFns__ = [];
|
|
224
|
+
|
|
225
|
+
/* style */
|
|
226
|
+
const __vue_inject_styles__ = undefined;
|
|
227
|
+
/* scoped */
|
|
228
|
+
const __vue_scope_id__ = undefined;
|
|
229
|
+
/* module identifier */
|
|
230
|
+
const __vue_module_identifier__ = undefined;
|
|
231
|
+
/* functional template */
|
|
232
|
+
const __vue_is_functional_template__ = false;
|
|
233
|
+
/* style inject */
|
|
234
|
+
|
|
235
|
+
/* style inject SSR */
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
var Tooltip = normalizeComponent_1(
|
|
240
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
241
|
+
__vue_inject_styles__,
|
|
242
|
+
__vue_script__,
|
|
243
|
+
__vue_scope_id__,
|
|
244
|
+
__vue_is_functional_template__,
|
|
245
|
+
__vue_module_identifier__,
|
|
246
|
+
undefined,
|
|
247
|
+
undefined
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
var script$1 = {
|
|
251
|
+
name: 'BSliderThumb',
|
|
252
|
+
components: _defineProperty({}, Tooltip.name, Tooltip),
|
|
253
|
+
inheritAttrs: false,
|
|
254
|
+
props: {
|
|
255
|
+
value: {
|
|
256
|
+
type: Number,
|
|
257
|
+
default: 0
|
|
258
|
+
},
|
|
259
|
+
type: {
|
|
260
|
+
type: String,
|
|
261
|
+
default: ''
|
|
262
|
+
},
|
|
263
|
+
tooltip: {
|
|
264
|
+
type: Boolean,
|
|
265
|
+
default: true
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
data: function data() {
|
|
269
|
+
return {
|
|
270
|
+
isFocused: false,
|
|
271
|
+
dragging: false,
|
|
272
|
+
startX: 0,
|
|
273
|
+
startPosition: 0,
|
|
274
|
+
newPosition: null,
|
|
275
|
+
oldValue: this.value
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
computed: {
|
|
279
|
+
disabled: function disabled() {
|
|
280
|
+
return this.$parent.disabled;
|
|
281
|
+
},
|
|
282
|
+
max: function max() {
|
|
283
|
+
return this.$parent.max;
|
|
284
|
+
},
|
|
285
|
+
min: function min() {
|
|
286
|
+
return this.$parent.min;
|
|
287
|
+
},
|
|
288
|
+
step: function step() {
|
|
289
|
+
return this.$parent.step;
|
|
290
|
+
},
|
|
291
|
+
precision: function precision() {
|
|
292
|
+
return this.$parent.precision;
|
|
293
|
+
},
|
|
294
|
+
currentPosition: function currentPosition() {
|
|
295
|
+
return "".concat((this.value - this.min) / (this.max - this.min) * 100, "%");
|
|
296
|
+
},
|
|
297
|
+
wrapperStyle: function wrapperStyle() {
|
|
298
|
+
return {
|
|
299
|
+
left: this.currentPosition
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
watch: {
|
|
304
|
+
dragging: function dragging(val) {
|
|
305
|
+
this.$parent.dragging = val;
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
methods: {
|
|
309
|
+
onFocus: function onFocus() {
|
|
310
|
+
this.isFocused = true;
|
|
311
|
+
},
|
|
312
|
+
onBlur: function onBlur() {
|
|
313
|
+
this.isFocused = false;
|
|
314
|
+
},
|
|
315
|
+
onButtonDown: function onButtonDown(event) {
|
|
316
|
+
if (this.disabled) return;
|
|
317
|
+
event.preventDefault();
|
|
318
|
+
this.onDragStart(event);
|
|
319
|
+
|
|
320
|
+
if (typeof window !== 'undefined') {
|
|
321
|
+
document.addEventListener('mousemove', this.onDragging);
|
|
322
|
+
document.addEventListener('touchmove', this.onDragging);
|
|
323
|
+
document.addEventListener('mouseup', this.onDragEnd);
|
|
324
|
+
document.addEventListener('touchend', this.onDragEnd);
|
|
325
|
+
document.addEventListener('contextmenu', this.onDragEnd);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
onLeftKeyDown: function onLeftKeyDown() {
|
|
329
|
+
if (this.disabled || this.value === this.min) return;
|
|
330
|
+
this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
|
|
331
|
+
this.setPosition(this.newPosition);
|
|
332
|
+
this.$parent.emitChange();
|
|
333
|
+
},
|
|
334
|
+
onRightKeyDown: function onRightKeyDown() {
|
|
335
|
+
if (this.disabled || this.value === this.max) return;
|
|
336
|
+
this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
|
|
337
|
+
this.setPosition(this.newPosition);
|
|
338
|
+
this.$parent.emitChange();
|
|
339
|
+
},
|
|
340
|
+
onHomeKeyDown: function onHomeKeyDown() {
|
|
341
|
+
if (this.disabled || this.value === this.min) return;
|
|
342
|
+
this.newPosition = 0;
|
|
343
|
+
this.setPosition(this.newPosition);
|
|
344
|
+
this.$parent.emitChange();
|
|
345
|
+
},
|
|
346
|
+
onEndKeyDown: function onEndKeyDown() {
|
|
347
|
+
if (this.disabled || this.value === this.max) return;
|
|
348
|
+
this.newPosition = 100;
|
|
349
|
+
this.setPosition(this.newPosition);
|
|
350
|
+
this.$parent.emitChange();
|
|
351
|
+
},
|
|
352
|
+
onDragStart: function onDragStart(event) {
|
|
353
|
+
this.dragging = true;
|
|
354
|
+
|
|
355
|
+
if (event.type === 'touchstart') {
|
|
356
|
+
event.clientX = event.touches[0].clientX;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
this.startX = event.clientX;
|
|
360
|
+
this.startPosition = parseFloat(this.currentPosition);
|
|
361
|
+
this.newPosition = this.startPosition;
|
|
362
|
+
},
|
|
363
|
+
onDragging: function onDragging(event) {
|
|
364
|
+
if (this.dragging) {
|
|
365
|
+
if (event.type === 'touchmove') {
|
|
366
|
+
event.clientX = event.touches[0].clientX;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
var diff = (event.clientX - this.startX) / this.$parent.sliderSize * 100;
|
|
370
|
+
this.newPosition = this.startPosition + diff;
|
|
371
|
+
this.setPosition(this.newPosition);
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
onDragEnd: function onDragEnd() {
|
|
375
|
+
var _this = this;
|
|
376
|
+
|
|
377
|
+
if (this.value !== this.oldValue) {
|
|
378
|
+
this.$parent.emitChange();
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
setTimeout(function () {
|
|
382
|
+
// defer to prevent triggering click on the track
|
|
383
|
+
_this.dragging = false;
|
|
384
|
+
|
|
385
|
+
_this.setPosition(_this.newPosition);
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
if (typeof window !== 'undefined') {
|
|
389
|
+
document.removeEventListener('mousemove', this.onDragging);
|
|
390
|
+
document.removeEventListener('touchmove', this.onDragging);
|
|
391
|
+
document.removeEventListener('mouseup', this.onDragEnd);
|
|
392
|
+
document.removeEventListener('touchend', this.onDragEnd);
|
|
393
|
+
document.removeEventListener('contextmenu', this.onDragEnd);
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
setPosition: function setPosition(percent) {
|
|
397
|
+
if (percent === null || isNaN(percent)) return;
|
|
398
|
+
|
|
399
|
+
if (percent < 0) {
|
|
400
|
+
percent = 0;
|
|
401
|
+
} else if (percent > 100) {
|
|
402
|
+
percent = 100;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
var stepLength = 100 / ((this.max - this.min) / this.step);
|
|
406
|
+
var steps = Math.round(percent / stepLength);
|
|
407
|
+
var value = steps * stepLength / 100 * (this.max - this.min) + this.min;
|
|
408
|
+
value = parseFloat(value.toFixed(this.precision));
|
|
409
|
+
this.$emit('input', value);
|
|
410
|
+
|
|
411
|
+
if (!this.dragging && value !== this.oldValue) {
|
|
412
|
+
this.oldValue = value;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
/* script */
|
|
419
|
+
const __vue_script__$1 = script$1;
|
|
420
|
+
|
|
421
|
+
/* template */
|
|
422
|
+
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-slider-thumb-wrapper",class:{ 'is-dragging': _vm.dragging },style:(_vm.wrapperStyle)},[_c('b-tooltip',{attrs:{"label":_vm.value.toString(),"type":_vm.type,"always":_vm.dragging || _vm.isFocused,"active":!_vm.disabled && _vm.tooltip}},[_c('div',_vm._b({staticClass:"b-slider-thumb",attrs:{"tabindex":_vm.disabled ? false : 0},on:{"mousedown":_vm.onButtonDown,"touchstart":_vm.onButtonDown,"focus":_vm.onFocus,"blur":_vm.onBlur,"keydown":[function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"left",37,$event.key)){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();_vm.onLeftKeyDown($event);},function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"right",39,$event.key)){ return null; }if('button' in $event && $event.button !== 2){ return null; }$event.preventDefault();_vm.onRightKeyDown($event);},function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"down",40,$event.key)){ return null; }$event.preventDefault();_vm.onLeftKeyDown($event);},function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"up",38,$event.key)){ return null; }$event.preventDefault();_vm.onRightKeyDown($event);},function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"home",undefined,$event.key)){ return null; }$event.preventDefault();_vm.onHomeKeyDown($event);},function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"end",undefined,$event.key)){ return null; }$event.preventDefault();_vm.onEndKeyDown($event);}]}},'div',_vm.$attrs,false))])],1)};
|
|
423
|
+
var __vue_staticRenderFns__$1 = [];
|
|
424
|
+
|
|
425
|
+
/* style */
|
|
426
|
+
const __vue_inject_styles__$1 = undefined;
|
|
427
|
+
/* scoped */
|
|
428
|
+
const __vue_scope_id__$1 = undefined;
|
|
429
|
+
/* module identifier */
|
|
430
|
+
const __vue_module_identifier__$1 = undefined;
|
|
431
|
+
/* functional template */
|
|
432
|
+
const __vue_is_functional_template__$1 = false;
|
|
433
|
+
/* style inject */
|
|
434
|
+
|
|
435
|
+
/* style inject SSR */
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
var SliderThumb = normalizeComponent_1(
|
|
440
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
441
|
+
__vue_inject_styles__$1,
|
|
442
|
+
__vue_script__$1,
|
|
443
|
+
__vue_scope_id__$1,
|
|
444
|
+
__vue_is_functional_template__$1,
|
|
445
|
+
__vue_module_identifier__$1,
|
|
446
|
+
undefined,
|
|
447
|
+
undefined
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
//
|
|
451
|
+
//
|
|
452
|
+
//
|
|
453
|
+
//
|
|
454
|
+
//
|
|
455
|
+
//
|
|
456
|
+
//
|
|
457
|
+
//
|
|
458
|
+
//
|
|
459
|
+
//
|
|
460
|
+
//
|
|
461
|
+
var script$2 = {
|
|
462
|
+
name: 'BSliderTick',
|
|
463
|
+
props: {
|
|
464
|
+
value: {
|
|
465
|
+
type: Number,
|
|
466
|
+
default: 0
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
computed: {
|
|
470
|
+
position: function position() {
|
|
471
|
+
var pos = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
|
|
472
|
+
return pos >= 0 && pos <= 100 ? pos : 0;
|
|
473
|
+
},
|
|
474
|
+
hidden: function hidden() {
|
|
475
|
+
return this.value === this.$parent.min || this.value === this.$parent.max;
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
methods: {
|
|
479
|
+
getTickStyle: function getTickStyle(position) {
|
|
480
|
+
return {
|
|
481
|
+
'left': position + '%'
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
created: function created() {
|
|
486
|
+
if (!this.$parent.$data._isSlider) {
|
|
487
|
+
this.$destroy();
|
|
488
|
+
throw new Error('You should wrap bSliderTick on a bSlider');
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
/* script */
|
|
494
|
+
const __vue_script__$2 = script$2;
|
|
495
|
+
|
|
496
|
+
/* template */
|
|
497
|
+
var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-slider-tick",class:{ 'is-tick-hidden': _vm.hidden },style:(_vm.getTickStyle(_vm.position))},[(_vm.$slots.default)?_c('span',{staticClass:"b-slider-tick-label"},[_vm._t("default")],2):_vm._e()])};
|
|
498
|
+
var __vue_staticRenderFns__$2 = [];
|
|
499
|
+
|
|
500
|
+
/* style */
|
|
501
|
+
const __vue_inject_styles__$2 = undefined;
|
|
502
|
+
/* scoped */
|
|
503
|
+
const __vue_scope_id__$2 = undefined;
|
|
504
|
+
/* module identifier */
|
|
505
|
+
const __vue_module_identifier__$2 = undefined;
|
|
506
|
+
/* functional template */
|
|
507
|
+
const __vue_is_functional_template__$2 = false;
|
|
508
|
+
/* style inject */
|
|
509
|
+
|
|
510
|
+
/* style inject SSR */
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
var SliderTick = normalizeComponent_1(
|
|
515
|
+
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
|
|
516
|
+
__vue_inject_styles__$2,
|
|
517
|
+
__vue_script__$2,
|
|
518
|
+
__vue_scope_id__$2,
|
|
519
|
+
__vue_is_functional_template__$2,
|
|
520
|
+
__vue_module_identifier__$2,
|
|
521
|
+
undefined,
|
|
522
|
+
undefined
|
|
523
|
+
);
|
|
524
|
+
|
|
525
|
+
var _components;
|
|
526
|
+
var script$3 = {
|
|
527
|
+
name: 'BSlider',
|
|
528
|
+
components: (_components = {}, _defineProperty(_components, SliderThumb.name, SliderThumb), _defineProperty(_components, SliderTick.name, SliderTick), _components),
|
|
529
|
+
props: {
|
|
530
|
+
value: {
|
|
531
|
+
type: [Number, Array],
|
|
532
|
+
default: 0
|
|
533
|
+
},
|
|
534
|
+
min: {
|
|
535
|
+
type: Number,
|
|
536
|
+
default: 0
|
|
537
|
+
},
|
|
538
|
+
max: {
|
|
539
|
+
type: Number,
|
|
540
|
+
default: 100
|
|
541
|
+
},
|
|
542
|
+
step: {
|
|
543
|
+
type: Number,
|
|
544
|
+
default: 1
|
|
545
|
+
},
|
|
546
|
+
type: {
|
|
547
|
+
type: String,
|
|
548
|
+
default: 'is-primary'
|
|
549
|
+
},
|
|
550
|
+
size: String,
|
|
551
|
+
ticks: {
|
|
552
|
+
type: Boolean,
|
|
553
|
+
default: false
|
|
554
|
+
},
|
|
555
|
+
tooltip: {
|
|
556
|
+
type: Boolean,
|
|
557
|
+
default: true
|
|
558
|
+
},
|
|
559
|
+
tooltipType: String,
|
|
560
|
+
rounded: {
|
|
561
|
+
type: Boolean,
|
|
562
|
+
default: false
|
|
563
|
+
},
|
|
564
|
+
disabled: {
|
|
565
|
+
type: Boolean,
|
|
566
|
+
default: false
|
|
567
|
+
},
|
|
568
|
+
ariaLabel: [String, Array]
|
|
569
|
+
},
|
|
570
|
+
data: function data() {
|
|
571
|
+
return {
|
|
572
|
+
value1: null,
|
|
573
|
+
value2: null,
|
|
574
|
+
dragging: false,
|
|
575
|
+
isRange: false,
|
|
576
|
+
newTooltipType: this.tooltipType ? this.tooltipType : this.type,
|
|
577
|
+
_isSlider: true // Used by Thumb and Tick
|
|
578
|
+
|
|
579
|
+
};
|
|
580
|
+
},
|
|
581
|
+
computed: {
|
|
582
|
+
tickValues: function tickValues() {
|
|
583
|
+
if (!this.ticks || this.min > this.max || this.step === 0) return [];
|
|
584
|
+
var result = [];
|
|
585
|
+
|
|
586
|
+
for (var i = this.min + this.step; i < this.max; i = i + this.step) {
|
|
587
|
+
result.push(i);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
return result;
|
|
591
|
+
},
|
|
592
|
+
minValue: function minValue() {
|
|
593
|
+
return Math.min(this.value1, this.value2);
|
|
594
|
+
},
|
|
595
|
+
maxValue: function maxValue() {
|
|
596
|
+
return Math.max(this.value1, this.value2);
|
|
597
|
+
},
|
|
598
|
+
barSize: function barSize() {
|
|
599
|
+
return this.isRange ? "".concat(100 * (this.maxValue - this.minValue) / (this.max - this.min), "%") : "".concat(100 * (this.value1 - this.min) / (this.max - this.min), "%");
|
|
600
|
+
},
|
|
601
|
+
barStart: function barStart() {
|
|
602
|
+
return this.isRange ? "".concat(100 * (this.minValue - this.min) / (this.max - this.min), "%") : '0%';
|
|
603
|
+
},
|
|
604
|
+
precision: function precision() {
|
|
605
|
+
var precisions = [this.min, this.max, this.step].map(function (item) {
|
|
606
|
+
var decimal = ('' + item).split('.')[1];
|
|
607
|
+
return decimal ? decimal.length : 0;
|
|
608
|
+
});
|
|
609
|
+
return Math.max.apply(Math, _toConsumableArray(precisions));
|
|
610
|
+
},
|
|
611
|
+
barStyle: function barStyle() {
|
|
612
|
+
return {
|
|
613
|
+
width: this.barSize,
|
|
614
|
+
left: this.barStart
|
|
615
|
+
};
|
|
616
|
+
},
|
|
617
|
+
sliderSize: function sliderSize() {
|
|
618
|
+
return this.$refs.slider['clientWidth'];
|
|
619
|
+
},
|
|
620
|
+
rootClasses: function rootClasses() {
|
|
621
|
+
return {
|
|
622
|
+
'is-rounded': this.rounded,
|
|
623
|
+
'is-dragging': this.dragging,
|
|
624
|
+
'is-disabled': this.disabled
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
watch: {
|
|
629
|
+
/**
|
|
630
|
+
* When v-model is changed set the new active step.
|
|
631
|
+
*/
|
|
632
|
+
value: function value(_value) {
|
|
633
|
+
this.setValues(_value);
|
|
634
|
+
},
|
|
635
|
+
value1: function value1(val) {
|
|
636
|
+
this.isThumbReversed = this.value1 > this.value2;
|
|
637
|
+
|
|
638
|
+
if (this.isRange) {
|
|
639
|
+
this.$emit('input', [this.minValue, this.maxValue]);
|
|
640
|
+
} else {
|
|
641
|
+
this.$emit('input', val);
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
value2: function value2(val) {
|
|
645
|
+
this.isThumbReversed = this.value1 > this.value2;
|
|
646
|
+
|
|
647
|
+
if (this.isRange) {
|
|
648
|
+
this.$emit('input', [this.minValue, this.maxValue]);
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
min: function min() {
|
|
652
|
+
this.setValues();
|
|
653
|
+
},
|
|
654
|
+
max: function max() {
|
|
655
|
+
this.setValues();
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
methods: {
|
|
659
|
+
setValues: function setValues(newValue) {
|
|
660
|
+
if (this.min > this.max) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (Array.isArray(newValue)) {
|
|
665
|
+
this.isRange = true;
|
|
666
|
+
var smallValue = typeof newValue[0] !== 'number' || isNaN(newValue[0]) ? this.min : Math.min(Math.max(this.min, newValue[0]), this.max);
|
|
667
|
+
var largeValue = typeof newValue[1] !== 'number' || isNaN(newValue[1]) ? this.max : Math.max(Math.min(this.max, newValue[1]), this.min);
|
|
668
|
+
this.value1 = this.isThumbReversed ? largeValue : smallValue;
|
|
669
|
+
this.value2 = this.isThumbReversed ? smallValue : largeValue;
|
|
670
|
+
} else {
|
|
671
|
+
this.isRange = false;
|
|
672
|
+
this.value1 = isNaN(newValue) ? this.min : Math.min(this.max, Math.max(this.min, newValue));
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
onSliderClick: function onSliderClick(event) {
|
|
676
|
+
if (this.disabled || this.dragging) return;
|
|
677
|
+
var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
|
|
678
|
+
var percent = (event.clientX - sliderOffsetLeft) / this.sliderSize * 100;
|
|
679
|
+
var targetValue = this.min + percent * (this.max - this.min) / 100;
|
|
680
|
+
var diffFirst = Math.abs(targetValue - this.value1);
|
|
681
|
+
|
|
682
|
+
if (!this.isRange) {
|
|
683
|
+
if (diffFirst < this.step / 2) return;
|
|
684
|
+
this.$refs.button1.setPosition(percent);
|
|
685
|
+
} else {
|
|
686
|
+
var diffSecond = Math.abs(targetValue - this.value2);
|
|
687
|
+
|
|
688
|
+
if (diffFirst <= diffSecond) {
|
|
689
|
+
if (diffFirst < this.step / 2) return;
|
|
690
|
+
this.$refs['button1'].setPosition(percent);
|
|
691
|
+
} else {
|
|
692
|
+
if (diffSecond < this.step / 2) return;
|
|
693
|
+
this.$refs['button2'].setPosition(percent);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
this.emitChange();
|
|
698
|
+
},
|
|
699
|
+
emitChange: function emitChange() {
|
|
700
|
+
this.$emit('change', this.isRange ? [this.minValue, this.maxValue] : this.value1);
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
created: function created() {
|
|
704
|
+
this.setValues(this.value);
|
|
705
|
+
this.isThumbReversed = false;
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
/* script */
|
|
710
|
+
const __vue_script__$3 = script$3;
|
|
711
|
+
|
|
712
|
+
/* template */
|
|
713
|
+
var __vue_render__$3 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-slider",class:[_vm.size, _vm.type, _vm.rootClasses]},[_c('div',{ref:"slider",staticClass:"b-slider-track",on:{"click":_vm.onSliderClick}},[_c('div',{staticClass:"b-slider-fill",style:(_vm.barStyle)}),_vm._v(" "),(_vm.ticks)?_vm._l((_vm.tickValues),function(val,key){return _c('b-slider-tick',{key:key,attrs:{"value":val}})}):_vm._e(),_vm._v(" "),_vm._t("default"),_vm._v(" "),_c('b-slider-thumb',{ref:"button1",attrs:{"type":_vm.newTooltipType,"tooltip":_vm.tooltip,"role":"slider","aria-valuenow":_vm.value1,"aria-valuemin":_vm.min,"aria-valuemax":_vm.max,"aria-orientation":"horizontal","aria-label":Array.isArray(_vm.ariaLabel) ? _vm.ariaLabel[0] : _vm.ariaLabel,"aria-disabled":_vm.disabled},model:{value:(_vm.value1),callback:function ($$v) {_vm.value1=$$v;},expression:"value1"}}),_vm._v(" "),(_vm.isRange)?_c('b-slider-thumb',{ref:"button2",attrs:{"type":_vm.newTooltipType,"tooltip":_vm.tooltip,"role":"slider","aria-valuenow":_vm.value2,"aria-valuemin":_vm.min,"aria-valuemax":_vm.max,"aria-orientation":"horizontal","aria-label":Array.isArray(_vm.ariaLabel) ? _vm.ariaLabel[1] : '',"aria-disabled":_vm.disabled},model:{value:(_vm.value2),callback:function ($$v) {_vm.value2=$$v;},expression:"value2"}}):_vm._e()],2)])};
|
|
714
|
+
var __vue_staticRenderFns__$3 = [];
|
|
715
|
+
|
|
716
|
+
/* style */
|
|
717
|
+
const __vue_inject_styles__$3 = undefined;
|
|
718
|
+
/* scoped */
|
|
719
|
+
const __vue_scope_id__$3 = undefined;
|
|
720
|
+
/* module identifier */
|
|
721
|
+
const __vue_module_identifier__$3 = undefined;
|
|
722
|
+
/* functional template */
|
|
723
|
+
const __vue_is_functional_template__$3 = false;
|
|
724
|
+
/* style inject */
|
|
725
|
+
|
|
726
|
+
/* style inject SSR */
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
var Slider = normalizeComponent_1(
|
|
731
|
+
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
|
|
732
|
+
__vue_inject_styles__$3,
|
|
733
|
+
__vue_script__$3,
|
|
734
|
+
__vue_scope_id__$3,
|
|
735
|
+
__vue_is_functional_template__$3,
|
|
736
|
+
__vue_module_identifier__$3,
|
|
737
|
+
undefined,
|
|
738
|
+
undefined
|
|
739
|
+
);
|
|
740
|
+
|
|
741
|
+
var use = function use(plugin) {
|
|
742
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
743
|
+
window.Vue.use(plugin);
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
var registerComponent = function registerComponent(Vue, component) {
|
|
747
|
+
Vue.component(component.name, component);
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
var Plugin = {
|
|
751
|
+
install: function install(Vue) {
|
|
752
|
+
registerComponent(Vue, Slider);
|
|
753
|
+
registerComponent(Vue, SliderTick);
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
use(Plugin);
|
|
757
|
+
|
|
758
|
+
exports.Slider = Slider;
|
|
759
|
+
exports.SliderTick = SliderTick;
|
|
760
|
+
exports.default = Plugin;
|
|
761
|
+
|
|
762
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
763
|
+
|
|
764
|
+
}));
|