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,404 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __chunk_3 = require('./chunk-e45e0329.js');
|
|
4
|
+
var __chunk_6 = require('./chunk-13e039f5.js');
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
var script = {
|
|
8
|
+
name: 'BDropdown',
|
|
9
|
+
props: {
|
|
10
|
+
value: {
|
|
11
|
+
type: [String, Number, Boolean, Object, Array, Function],
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
disabled: Boolean,
|
|
15
|
+
hoverable: Boolean,
|
|
16
|
+
inline: Boolean,
|
|
17
|
+
position: {
|
|
18
|
+
type: String,
|
|
19
|
+
validator: function validator(value) {
|
|
20
|
+
return ['is-top-right', 'is-top-left', 'is-bottom-left'].indexOf(value) > -1;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
mobileModal: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: function _default() {
|
|
26
|
+
return __chunk_3.config.defaultDropdownMobileModal;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
ariaRole: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
animation: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'fade'
|
|
36
|
+
},
|
|
37
|
+
multiple: Boolean,
|
|
38
|
+
closeOnClick: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
data: function data() {
|
|
44
|
+
return {
|
|
45
|
+
selected: this.value,
|
|
46
|
+
isActive: false,
|
|
47
|
+
isHoverable: this.hoverable,
|
|
48
|
+
_isDropdown: true // Used internally by DropdownItem
|
|
49
|
+
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
computed: {
|
|
53
|
+
rootClasses: function rootClasses() {
|
|
54
|
+
return [this.position, {
|
|
55
|
+
'is-disabled': this.disabled,
|
|
56
|
+
'is-hoverable': this.hoverable,
|
|
57
|
+
'is-inline': this.inline,
|
|
58
|
+
'is-active': this.isActive || this.inline,
|
|
59
|
+
'is-mobile-modal': this.isMobileModal
|
|
60
|
+
}];
|
|
61
|
+
},
|
|
62
|
+
isMobileModal: function isMobileModal() {
|
|
63
|
+
return this.mobileModal && !this.inline && !this.hoverable;
|
|
64
|
+
},
|
|
65
|
+
ariaRoleMenu: function ariaRoleMenu() {
|
|
66
|
+
return this.ariaRole === 'menu' || this.ariaRole === 'list' ? this.ariaRole : null;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
watch: {
|
|
70
|
+
/**
|
|
71
|
+
* When v-model is changed set the new selected item.
|
|
72
|
+
*/
|
|
73
|
+
value: function value(_value) {
|
|
74
|
+
this.selected = _value;
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Emit event when isActive value is changed.
|
|
79
|
+
*/
|
|
80
|
+
isActive: function isActive(value) {
|
|
81
|
+
this.$emit('active-change', value);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
/**
|
|
86
|
+
* Click listener from DropdownItem.
|
|
87
|
+
* 1. Set new selected item.
|
|
88
|
+
* 2. Emit input event to update the user v-model.
|
|
89
|
+
* 3. Close the dropdown.
|
|
90
|
+
*/
|
|
91
|
+
selectItem: function selectItem(value) {
|
|
92
|
+
var _this = this;
|
|
93
|
+
|
|
94
|
+
if (this.multiple) {
|
|
95
|
+
if (this.selected) {
|
|
96
|
+
var index = this.selected.indexOf(value);
|
|
97
|
+
|
|
98
|
+
if (index === -1) {
|
|
99
|
+
this.selected.push(value);
|
|
100
|
+
} else {
|
|
101
|
+
this.selected.splice(index, 1);
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
this.selected = [value];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
this.$emit('change', this.selected);
|
|
108
|
+
} else {
|
|
109
|
+
if (this.selected !== value) {
|
|
110
|
+
this.selected = value;
|
|
111
|
+
this.$emit('change', this.selected);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this.$emit('input', this.selected);
|
|
116
|
+
|
|
117
|
+
if (!this.multiple) {
|
|
118
|
+
this.isActive = !this.closeOnClick;
|
|
119
|
+
|
|
120
|
+
if (this.hoverable && this.closeOnClick) {
|
|
121
|
+
this.isHoverable = false; // Timeout for the animation complete before destroying
|
|
122
|
+
|
|
123
|
+
setTimeout(function () {
|
|
124
|
+
_this.isHoverable = true;
|
|
125
|
+
}, 250);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* White-listed items to not close when clicked.
|
|
132
|
+
*/
|
|
133
|
+
isInWhiteList: function isInWhiteList(el) {
|
|
134
|
+
if (el === this.$refs.dropdownMenu) return true;
|
|
135
|
+
if (el === this.$refs.trigger) return true; // All chidren from dropdown
|
|
136
|
+
|
|
137
|
+
if (this.$refs.dropdownMenu !== undefined) {
|
|
138
|
+
var children = this.$refs.dropdownMenu.querySelectorAll('*');
|
|
139
|
+
var _iteratorNormalCompletion = true;
|
|
140
|
+
var _didIteratorError = false;
|
|
141
|
+
var _iteratorError = undefined;
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
145
|
+
var child = _step.value;
|
|
146
|
+
|
|
147
|
+
if (el === child) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
} catch (err) {
|
|
152
|
+
_didIteratorError = true;
|
|
153
|
+
_iteratorError = err;
|
|
154
|
+
} finally {
|
|
155
|
+
try {
|
|
156
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
157
|
+
_iterator.return();
|
|
158
|
+
}
|
|
159
|
+
} finally {
|
|
160
|
+
if (_didIteratorError) {
|
|
161
|
+
throw _iteratorError;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
} // All children from trigger
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
if (this.$refs.trigger !== undefined) {
|
|
169
|
+
var _children = this.$refs.trigger.querySelectorAll('*');
|
|
170
|
+
|
|
171
|
+
var _iteratorNormalCompletion2 = true;
|
|
172
|
+
var _didIteratorError2 = false;
|
|
173
|
+
var _iteratorError2 = undefined;
|
|
174
|
+
|
|
175
|
+
try {
|
|
176
|
+
for (var _iterator2 = _children[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
177
|
+
var _child = _step2.value;
|
|
178
|
+
|
|
179
|
+
if (el === _child) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
} catch (err) {
|
|
184
|
+
_didIteratorError2 = true;
|
|
185
|
+
_iteratorError2 = err;
|
|
186
|
+
} finally {
|
|
187
|
+
try {
|
|
188
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
189
|
+
_iterator2.return();
|
|
190
|
+
}
|
|
191
|
+
} finally {
|
|
192
|
+
if (_didIteratorError2) {
|
|
193
|
+
throw _iteratorError2;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return false;
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Close dropdown if clicked outside.
|
|
204
|
+
*/
|
|
205
|
+
clickedOutside: function clickedOutside(event) {
|
|
206
|
+
if (this.inline) return;
|
|
207
|
+
if (!this.isInWhiteList(event.target)) this.isActive = false;
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Toggle dropdown if it's not disabled.
|
|
212
|
+
*/
|
|
213
|
+
toggle: function toggle() {
|
|
214
|
+
var _this2 = this;
|
|
215
|
+
|
|
216
|
+
if (this.disabled) return;
|
|
217
|
+
|
|
218
|
+
if (!this.isActive) {
|
|
219
|
+
// if not active, toggle after clickOutside event
|
|
220
|
+
// this fixes toggling programmatic
|
|
221
|
+
this.$nextTick(function () {
|
|
222
|
+
var value = !_this2.isActive;
|
|
223
|
+
_this2.isActive = value; // Vue 2.6.x ???
|
|
224
|
+
|
|
225
|
+
setTimeout(function () {
|
|
226
|
+
return _this2.isActive = value;
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
} else {
|
|
230
|
+
this.isActive = !this.isActive;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
created: function created() {
|
|
235
|
+
if (typeof window !== 'undefined') {
|
|
236
|
+
document.addEventListener('click', this.clickedOutside);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
beforeDestroy: function beforeDestroy() {
|
|
240
|
+
if (typeof window !== 'undefined') {
|
|
241
|
+
document.removeEventListener('click', this.clickedOutside);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/* script */
|
|
247
|
+
const __vue_script__ = script;
|
|
248
|
+
|
|
249
|
+
/* template */
|
|
250
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"dropdown",class:_vm.rootClasses},[(!_vm.inline)?_c('div',{ref:"trigger",staticClass:"dropdown-trigger",attrs:{"role":"button","aria-haspopup":"true"},on:{"click":_vm.toggle}},[_vm._t("trigger")],2):_vm._e(),_vm._v(" "),_c('transition',{attrs:{"name":_vm.animation}},[(_vm.isMobileModal)?_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isActive),expression:"isActive"}],staticClass:"background",attrs:{"aria-hidden":!_vm.isActive}}):_vm._e()]),_vm._v(" "),_c('transition',{attrs:{"name":_vm.animation}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:((!_vm.disabled && (_vm.isActive || _vm.isHoverable)) || _vm.inline),expression:"(!disabled && (isActive || isHoverable)) || inline"}],ref:"dropdownMenu",staticClass:"dropdown-menu",attrs:{"aria-hidden":!_vm.isActive}},[_c('div',{staticClass:"dropdown-content",attrs:{"role":_vm.ariaRoleMenu}},[_vm._t("default")],2)])])],1)};
|
|
251
|
+
var __vue_staticRenderFns__ = [];
|
|
252
|
+
|
|
253
|
+
/* style */
|
|
254
|
+
const __vue_inject_styles__ = undefined;
|
|
255
|
+
/* scoped */
|
|
256
|
+
const __vue_scope_id__ = undefined;
|
|
257
|
+
/* module identifier */
|
|
258
|
+
const __vue_module_identifier__ = undefined;
|
|
259
|
+
/* functional template */
|
|
260
|
+
const __vue_is_functional_template__ = false;
|
|
261
|
+
/* style inject */
|
|
262
|
+
|
|
263
|
+
/* style inject SSR */
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
var Dropdown = __chunk_6.__vue_normalize__(
|
|
268
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
269
|
+
__vue_inject_styles__,
|
|
270
|
+
__vue_script__,
|
|
271
|
+
__vue_scope_id__,
|
|
272
|
+
__vue_is_functional_template__,
|
|
273
|
+
__vue_module_identifier__,
|
|
274
|
+
undefined,
|
|
275
|
+
undefined
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
//
|
|
279
|
+
//
|
|
280
|
+
//
|
|
281
|
+
//
|
|
282
|
+
//
|
|
283
|
+
//
|
|
284
|
+
//
|
|
285
|
+
//
|
|
286
|
+
//
|
|
287
|
+
//
|
|
288
|
+
//
|
|
289
|
+
//
|
|
290
|
+
//
|
|
291
|
+
//
|
|
292
|
+
//
|
|
293
|
+
//
|
|
294
|
+
//
|
|
295
|
+
//
|
|
296
|
+
//
|
|
297
|
+
//
|
|
298
|
+
//
|
|
299
|
+
var script$1 = {
|
|
300
|
+
name: 'BDropdownItem',
|
|
301
|
+
props: {
|
|
302
|
+
value: {
|
|
303
|
+
type: [String, Number, Boolean, Object, Array, Function],
|
|
304
|
+
default: null
|
|
305
|
+
},
|
|
306
|
+
separator: Boolean,
|
|
307
|
+
disabled: Boolean,
|
|
308
|
+
custom: Boolean,
|
|
309
|
+
focusable: {
|
|
310
|
+
type: Boolean,
|
|
311
|
+
default: true
|
|
312
|
+
},
|
|
313
|
+
paddingless: Boolean,
|
|
314
|
+
hasLink: Boolean,
|
|
315
|
+
ariaRole: {
|
|
316
|
+
type: String,
|
|
317
|
+
default: ''
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
computed: {
|
|
321
|
+
anchorClasses: function anchorClasses() {
|
|
322
|
+
return {
|
|
323
|
+
'is-disabled': this.$parent.disabled || this.disabled,
|
|
324
|
+
'is-paddingless': this.paddingless,
|
|
325
|
+
'is-active': this.isActive
|
|
326
|
+
};
|
|
327
|
+
},
|
|
328
|
+
itemClasses: function itemClasses() {
|
|
329
|
+
return {
|
|
330
|
+
'dropdown-item': !this.hasLink,
|
|
331
|
+
'is-disabled': this.disabled,
|
|
332
|
+
'is-paddingless': this.paddingless,
|
|
333
|
+
'is-active': this.isActive,
|
|
334
|
+
'has-link': this.hasLink
|
|
335
|
+
};
|
|
336
|
+
},
|
|
337
|
+
ariaRoleItem: function ariaRoleItem() {
|
|
338
|
+
return this.ariaRole === 'menuitem' || this.ariaRole === 'listitem' ? this.ariaRole : null;
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Check if item can be clickable.
|
|
343
|
+
*/
|
|
344
|
+
isClickable: function isClickable() {
|
|
345
|
+
return !this.$parent.disabled && !this.separator && !this.disabled && !this.custom;
|
|
346
|
+
},
|
|
347
|
+
isActive: function isActive() {
|
|
348
|
+
if (this.$parent.selected === null) return false;
|
|
349
|
+
if (this.$parent.multiple) return this.$parent.selected.indexOf(this.value) >= 0;
|
|
350
|
+
return this.value === this.$parent.selected;
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
methods: {
|
|
354
|
+
/**
|
|
355
|
+
* Click listener, select the item.
|
|
356
|
+
*/
|
|
357
|
+
selectItem: function selectItem() {
|
|
358
|
+
if (!this.isClickable) return;
|
|
359
|
+
this.$parent.selectItem(this.value);
|
|
360
|
+
this.$emit('click');
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
created: function created() {
|
|
364
|
+
if (!this.$parent.$data._isDropdown) {
|
|
365
|
+
this.$destroy();
|
|
366
|
+
throw new Error('You should wrap bDropdownItem on a bDropdown');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
/* script */
|
|
372
|
+
const __vue_script__$1 = script$1;
|
|
373
|
+
|
|
374
|
+
/* template */
|
|
375
|
+
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.separator)?_c('hr',{staticClass:"dropdown-divider"}):(!_vm.custom && !_vm.hasLink)?_c('a',{staticClass:"dropdown-item",class:_vm.anchorClasses,attrs:{"role":_vm.ariaRoleItem,"tabindex":_vm.focusable ? 0 : null},on:{"click":_vm.selectItem}},[_vm._t("default")],2):_c('div',{class:_vm.itemClasses,attrs:{"role":_vm.ariaRoleItem,"tabindex":_vm.focusable ? 0 : null},on:{"click":_vm.selectItem}},[_vm._t("default")],2)};
|
|
376
|
+
var __vue_staticRenderFns__$1 = [];
|
|
377
|
+
|
|
378
|
+
/* style */
|
|
379
|
+
const __vue_inject_styles__$1 = undefined;
|
|
380
|
+
/* scoped */
|
|
381
|
+
const __vue_scope_id__$1 = undefined;
|
|
382
|
+
/* module identifier */
|
|
383
|
+
const __vue_module_identifier__$1 = undefined;
|
|
384
|
+
/* functional template */
|
|
385
|
+
const __vue_is_functional_template__$1 = false;
|
|
386
|
+
/* style inject */
|
|
387
|
+
|
|
388
|
+
/* style inject SSR */
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
var DropdownItem = __chunk_6.__vue_normalize__(
|
|
393
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
394
|
+
__vue_inject_styles__$1,
|
|
395
|
+
__vue_script__$1,
|
|
396
|
+
__vue_scope_id__$1,
|
|
397
|
+
__vue_is_functional_template__$1,
|
|
398
|
+
__vue_module_identifier__$1,
|
|
399
|
+
undefined,
|
|
400
|
+
undefined
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
exports.Dropdown = Dropdown;
|
|
404
|
+
exports.DropdownItem = DropdownItem;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
|
4
|
+
/* server only */
|
|
5
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
6
|
+
if (typeof shadowMode !== 'boolean') {
|
|
7
|
+
createInjectorSSR = createInjector;
|
|
8
|
+
createInjector = shadowMode;
|
|
9
|
+
shadowMode = false;
|
|
10
|
+
} // Vue.extend constructor export interop.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var options = typeof script === 'function' ? script.options : script; // render functions
|
|
14
|
+
|
|
15
|
+
if (template && template.render) {
|
|
16
|
+
options.render = template.render;
|
|
17
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
18
|
+
options._compiled = true; // functional template
|
|
19
|
+
|
|
20
|
+
if (isFunctionalTemplate) {
|
|
21
|
+
options.functional = true;
|
|
22
|
+
}
|
|
23
|
+
} // scopedId
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
if (scopeId) {
|
|
27
|
+
options._scopeId = scopeId;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var hook;
|
|
31
|
+
|
|
32
|
+
if (moduleIdentifier) {
|
|
33
|
+
// server build
|
|
34
|
+
hook = function hook(context) {
|
|
35
|
+
// 2.3 injection
|
|
36
|
+
context = context || // cached call
|
|
37
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
38
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
|
|
39
|
+
// 2.2 with runInNewContext: true
|
|
40
|
+
|
|
41
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
42
|
+
context = __VUE_SSR_CONTEXT__;
|
|
43
|
+
} // inject component styles
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if (style) {
|
|
47
|
+
style.call(this, createInjectorSSR(context));
|
|
48
|
+
} // register component module identifier for async chunk inference
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
if (context && context._registeredComponents) {
|
|
52
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
53
|
+
}
|
|
54
|
+
}; // used by ssr in case component is cached and beforeCreate
|
|
55
|
+
// never gets called
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
options._ssrRegister = hook;
|
|
59
|
+
} else if (style) {
|
|
60
|
+
hook = shadowMode ? function () {
|
|
61
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
62
|
+
} : function (context) {
|
|
63
|
+
style.call(this, createInjector(context));
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (hook) {
|
|
68
|
+
if (options.functional) {
|
|
69
|
+
// register for functional component in vue file
|
|
70
|
+
var originalRender = options.render;
|
|
71
|
+
|
|
72
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
73
|
+
hook.call(context);
|
|
74
|
+
return originalRender(h, context);
|
|
75
|
+
};
|
|
76
|
+
} else {
|
|
77
|
+
// inject component registration as beforeCreate hook
|
|
78
|
+
var existing = options.beforeCreate;
|
|
79
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return script;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var normalizeComponent_1 = normalizeComponent;
|
|
87
|
+
|
|
88
|
+
var use = function use(plugin) {
|
|
89
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
90
|
+
window.Vue.use(plugin);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var registerComponent = function registerComponent(Vue, component) {
|
|
94
|
+
Vue.component(component.name, component);
|
|
95
|
+
};
|
|
96
|
+
var registerComponentProgrammatic = function registerComponentProgrammatic(Vue, property, component) {
|
|
97
|
+
Vue.prototype[property] = component;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
exports.__vue_normalize__ = normalizeComponent_1;
|
|
101
|
+
exports.registerComponent = registerComponent;
|
|
102
|
+
exports.registerComponentProgrammatic = registerComponentProgrammatic;
|
|
103
|
+
exports.use = use;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var SlotComponent = {
|
|
4
|
+
name: 'BSlotComponent',
|
|
5
|
+
props: {
|
|
6
|
+
component: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'default'
|
|
13
|
+
},
|
|
14
|
+
scoped: {
|
|
15
|
+
type: Boolean
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
type: Object
|
|
19
|
+
},
|
|
20
|
+
tag: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'div'
|
|
23
|
+
},
|
|
24
|
+
event: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'hook:updated'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
refresh: function refresh() {
|
|
31
|
+
this.$forceUpdate();
|
|
32
|
+
},
|
|
33
|
+
isVueComponent: function isVueComponent() {
|
|
34
|
+
return this.component && this.component._isVue;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
created: function created() {
|
|
38
|
+
if (this.isVueComponent()) {
|
|
39
|
+
this.component.$on(this.event, this.refresh);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
beforeDestroy: function beforeDestroy() {
|
|
43
|
+
if (this.isVueComponent()) {
|
|
44
|
+
this.component.$off(this.event, this.refresh);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
render: function render(createElement) {
|
|
48
|
+
if (this.isVueComponent()) {
|
|
49
|
+
return createElement(this.tag, {}, this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.SlotComponent = SlotComponent;
|