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,283 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __chunk_1 = require('./chunk-9f6a8079.js');
|
|
4
|
+
var __chunk_3 = require('./chunk-545f01b1.js');
|
|
5
|
+
var __chunk_6 = require('./chunk-13e039f5.js');
|
|
6
|
+
|
|
7
|
+
var script = {
|
|
8
|
+
name: 'BFieldBody',
|
|
9
|
+
props: {
|
|
10
|
+
message: {
|
|
11
|
+
type: String
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
type: [String, Object]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
render: function render(createElement) {
|
|
18
|
+
var _this = this;
|
|
19
|
+
|
|
20
|
+
return createElement('div', {
|
|
21
|
+
attrs: {
|
|
22
|
+
'class': 'field-body'
|
|
23
|
+
}
|
|
24
|
+
}, this.$slots.default.map(function (element) {
|
|
25
|
+
// skip returns and comments
|
|
26
|
+
if (!element.tag) {
|
|
27
|
+
return element;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (_this.message) {
|
|
31
|
+
return createElement('b-field', {
|
|
32
|
+
attrs: {
|
|
33
|
+
message: _this.message,
|
|
34
|
+
'type': _this.type
|
|
35
|
+
}
|
|
36
|
+
}, [element]);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return createElement('b-field', {
|
|
40
|
+
attrs: {
|
|
41
|
+
'type': _this.type
|
|
42
|
+
}
|
|
43
|
+
}, [element]);
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/* script */
|
|
49
|
+
const __vue_script__ = script;
|
|
50
|
+
|
|
51
|
+
/* template */
|
|
52
|
+
|
|
53
|
+
/* style */
|
|
54
|
+
const __vue_inject_styles__ = undefined;
|
|
55
|
+
/* scoped */
|
|
56
|
+
const __vue_scope_id__ = undefined;
|
|
57
|
+
/* module identifier */
|
|
58
|
+
const __vue_module_identifier__ = undefined;
|
|
59
|
+
/* functional template */
|
|
60
|
+
const __vue_is_functional_template__ = undefined;
|
|
61
|
+
/* style inject */
|
|
62
|
+
|
|
63
|
+
/* style inject SSR */
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
var FieldBody = __chunk_6.__vue_normalize__(
|
|
68
|
+
{},
|
|
69
|
+
__vue_inject_styles__,
|
|
70
|
+
__vue_script__,
|
|
71
|
+
__vue_scope_id__,
|
|
72
|
+
__vue_is_functional_template__,
|
|
73
|
+
__vue_module_identifier__,
|
|
74
|
+
undefined,
|
|
75
|
+
undefined
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
var script$1 = {
|
|
79
|
+
name: 'BField',
|
|
80
|
+
components: __chunk_1._defineProperty({}, FieldBody.name, FieldBody),
|
|
81
|
+
props: {
|
|
82
|
+
type: [String, Object],
|
|
83
|
+
label: String,
|
|
84
|
+
labelFor: String,
|
|
85
|
+
message: [String, Array, Object],
|
|
86
|
+
grouped: Boolean,
|
|
87
|
+
groupMultiline: Boolean,
|
|
88
|
+
position: String,
|
|
89
|
+
expanded: Boolean,
|
|
90
|
+
horizontal: Boolean,
|
|
91
|
+
addons: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: true
|
|
94
|
+
},
|
|
95
|
+
customClass: String,
|
|
96
|
+
labelPosition: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: function _default() {
|
|
99
|
+
return __chunk_3.config.defaultFieldLabelPosition;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
data: function data() {
|
|
104
|
+
return {
|
|
105
|
+
newType: this.type,
|
|
106
|
+
newMessage: this.message,
|
|
107
|
+
fieldLabelSize: null,
|
|
108
|
+
_isField: true // Used internally by Input and Select
|
|
109
|
+
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
computed: {
|
|
113
|
+
rootClasses: function rootClasses() {
|
|
114
|
+
return [this.newPosition, {
|
|
115
|
+
'is-expanded': this.expanded,
|
|
116
|
+
'is-grouped-multiline': this.groupMultiline,
|
|
117
|
+
'is-horizontal': this.horizontal,
|
|
118
|
+
'is-floating-in-label': this.hasLabel && !this.horizontal && this.labelPosition === 'inside',
|
|
119
|
+
'is-floating-label': this.hasLabel && !this.horizontal && this.labelPosition === 'on-border'
|
|
120
|
+
}, this.numberInputClasses];
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Correct Bulma class for the side of the addon or group.
|
|
125
|
+
*
|
|
126
|
+
* This is not kept like the others (is-small, etc.),
|
|
127
|
+
* because since 'has-addons' is set automatically it
|
|
128
|
+
* doesn't make sense to teach users what addons are exactly.
|
|
129
|
+
*/
|
|
130
|
+
newPosition: function newPosition() {
|
|
131
|
+
if (this.position === undefined) return;
|
|
132
|
+
var position = this.position.split('-');
|
|
133
|
+
if (position.length < 1) return;
|
|
134
|
+
var prefix = this.grouped ? 'is-grouped-' : 'has-addons-';
|
|
135
|
+
if (this.position) return prefix + position[1];
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Formatted message in case it's an array
|
|
140
|
+
* (each element is separated by <br> tag)
|
|
141
|
+
*/
|
|
142
|
+
formattedMessage: function formattedMessage() {
|
|
143
|
+
if (typeof this.newMessage === 'string') {
|
|
144
|
+
return this.newMessage;
|
|
145
|
+
} else {
|
|
146
|
+
var messages = [];
|
|
147
|
+
|
|
148
|
+
if (Array.isArray(this.newMessage)) {
|
|
149
|
+
this.newMessage.forEach(function (message) {
|
|
150
|
+
if (typeof message === 'string') {
|
|
151
|
+
messages.push(message);
|
|
152
|
+
} else {
|
|
153
|
+
for (var key in message) {
|
|
154
|
+
if (message[key]) {
|
|
155
|
+
messages.push(key);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
} else {
|
|
161
|
+
for (var key in this.newMessage) {
|
|
162
|
+
if (this.newMessage[key]) {
|
|
163
|
+
messages.push(key);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return messages.filter(function (m) {
|
|
169
|
+
if (m) return m;
|
|
170
|
+
}).join(' <br> ');
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
hasLabel: function hasLabel() {
|
|
174
|
+
return this.label || this.$slots.label;
|
|
175
|
+
},
|
|
176
|
+
numberInputClasses: function numberInputClasses() {
|
|
177
|
+
if (this.$slots.default) {
|
|
178
|
+
var numberinput = this.$slots.default.filter(function (node) {
|
|
179
|
+
return node.tag && node.tag.toLowerCase().indexOf('numberinput') >= 0;
|
|
180
|
+
})[0];
|
|
181
|
+
|
|
182
|
+
if (numberinput) {
|
|
183
|
+
var classes = ['has-numberinput'];
|
|
184
|
+
var controlsPosition = numberinput.componentOptions.propsData.controlsPosition;
|
|
185
|
+
var size = numberinput.componentOptions.propsData.size;
|
|
186
|
+
|
|
187
|
+
if (controlsPosition) {
|
|
188
|
+
classes.push("has-numberinput-".concat(controlsPosition));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (size) {
|
|
192
|
+
classes.push("has-numberinput-".concat(size));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return classes;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
watch: {
|
|
203
|
+
/**
|
|
204
|
+
* Set internal type when prop change.
|
|
205
|
+
*/
|
|
206
|
+
type: function type(value) {
|
|
207
|
+
this.newType = value;
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Set internal message when prop change.
|
|
212
|
+
*/
|
|
213
|
+
message: function message(value) {
|
|
214
|
+
this.newMessage = value;
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
methods: {
|
|
218
|
+
/**
|
|
219
|
+
* Field has addons if there are more than one slot
|
|
220
|
+
* (element / component) in the Field.
|
|
221
|
+
* Or is grouped when prop is set.
|
|
222
|
+
* Is a method to be called when component re-render.
|
|
223
|
+
*/
|
|
224
|
+
fieldType: function fieldType() {
|
|
225
|
+
if (this.grouped) return 'is-grouped';
|
|
226
|
+
var renderedNode = 0;
|
|
227
|
+
|
|
228
|
+
if (this.$slots.default) {
|
|
229
|
+
renderedNode = this.$slots.default.reduce(function (i, node) {
|
|
230
|
+
return node.tag ? i + 1 : i;
|
|
231
|
+
}, 0);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (renderedNode > 1 && this.addons && !this.horizontal) {
|
|
235
|
+
return 'has-addons';
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
mounted: function mounted() {
|
|
240
|
+
if (this.horizontal) {
|
|
241
|
+
// Bulma docs: .is-normal for any .input or .button
|
|
242
|
+
var elements = this.$el.querySelectorAll('.input, .select, .button, .textarea, .b-slider');
|
|
243
|
+
|
|
244
|
+
if (elements.length > 0) {
|
|
245
|
+
this.fieldLabelSize = 'is-normal';
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/* script */
|
|
252
|
+
const __vue_script__$1 = script$1;
|
|
253
|
+
|
|
254
|
+
/* template */
|
|
255
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"field",class:[_vm.rootClasses, _vm.fieldType()]},[(_vm.horizontal)?_c('div',{staticClass:"field-label",class:[_vm.customClass, _vm.fieldLabelSize]},[(_vm.hasLabel)?_c('label',{staticClass:"label",class:_vm.customClass,attrs:{"for":_vm.labelFor}},[(_vm.$slots.label)?_vm._t("label"):[_vm._v(_vm._s(_vm.label))]],2):_vm._e()]):[(_vm.hasLabel)?_c('label',{staticClass:"label",class:_vm.customClass,attrs:{"for":_vm.labelFor}},[(_vm.$slots.label)?_vm._t("label"):[_vm._v(_vm._s(_vm.label))]],2):_vm._e()],_vm._v(" "),(_vm.horizontal)?_c('b-field-body',{attrs:{"message":_vm.newMessage ? _vm.formattedMessage : '',"type":_vm.newType}},[_vm._t("default")],2):[_vm._t("default")],_vm._v(" "),(_vm.newMessage && !_vm.horizontal)?_c('p',{staticClass:"help",class:_vm.newType,domProps:{"innerHTML":_vm._s(_vm.formattedMessage)}}):_vm._e()],2)};
|
|
256
|
+
var __vue_staticRenderFns__ = [];
|
|
257
|
+
|
|
258
|
+
/* style */
|
|
259
|
+
const __vue_inject_styles__$1 = undefined;
|
|
260
|
+
/* scoped */
|
|
261
|
+
const __vue_scope_id__$1 = undefined;
|
|
262
|
+
/* module identifier */
|
|
263
|
+
const __vue_module_identifier__$1 = undefined;
|
|
264
|
+
/* functional template */
|
|
265
|
+
const __vue_is_functional_template__$1 = false;
|
|
266
|
+
/* style inject */
|
|
267
|
+
|
|
268
|
+
/* style inject SSR */
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
var Field = __chunk_6.__vue_normalize__(
|
|
273
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
274
|
+
__vue_inject_styles__$1,
|
|
275
|
+
__vue_script__$1,
|
|
276
|
+
__vue_scope_id__$1,
|
|
277
|
+
__vue_is_functional_template__$1,
|
|
278
|
+
__vue_module_identifier__$1,
|
|
279
|
+
undefined,
|
|
280
|
+
undefined
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
exports.Field = Field;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __chunk_1 = require('./chunk-9f6a8079.js');
|
|
4
|
+
var __chunk_3 = require('./chunk-545f01b1.js');
|
|
5
|
+
var __chunk_4 = require('./chunk-c146745e.js');
|
|
6
|
+
var __chunk_5 = require('./chunk-60061aa8.js');
|
|
7
|
+
var __chunk_6 = require('./chunk-13e039f5.js');
|
|
8
|
+
|
|
9
|
+
var script = {
|
|
10
|
+
name: 'BInput',
|
|
11
|
+
components: __chunk_1._defineProperty({}, __chunk_5.Icon.name, __chunk_5.Icon),
|
|
12
|
+
mixins: [__chunk_4.FormElementMixin],
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
props: {
|
|
15
|
+
value: [Number, String],
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'text'
|
|
19
|
+
},
|
|
20
|
+
passwordReveal: Boolean,
|
|
21
|
+
hasCounter: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: function _default() {
|
|
24
|
+
return __chunk_3.config.defaultInputHasCounter;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
customClass: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
data: function data() {
|
|
33
|
+
return {
|
|
34
|
+
newValue: this.value,
|
|
35
|
+
newType: this.type,
|
|
36
|
+
newAutocomplete: this.autocomplete || __chunk_3.config.defaultInputAutocomplete,
|
|
37
|
+
isPasswordVisible: false,
|
|
38
|
+
_elementRef: this.type === 'textarea' ? 'textarea' : 'input'
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
computedValue: {
|
|
43
|
+
get: function get() {
|
|
44
|
+
return this.newValue;
|
|
45
|
+
},
|
|
46
|
+
set: function set(value) {
|
|
47
|
+
this.newValue = value;
|
|
48
|
+
this.$emit('input', value);
|
|
49
|
+
!this.isValid && this.checkHtml5Validity();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
rootClasses: function rootClasses() {
|
|
53
|
+
return [this.iconPosition, this.size, {
|
|
54
|
+
'is-expanded': this.expanded,
|
|
55
|
+
'is-loading': this.loading,
|
|
56
|
+
'is-clearfix': !this.hasMessage
|
|
57
|
+
}];
|
|
58
|
+
},
|
|
59
|
+
inputClasses: function inputClasses() {
|
|
60
|
+
return [this.statusType, this.size, {
|
|
61
|
+
'is-rounded': this.rounded
|
|
62
|
+
}];
|
|
63
|
+
},
|
|
64
|
+
hasIconRight: function hasIconRight() {
|
|
65
|
+
return this.passwordReveal || this.loading || this.statusTypeIcon;
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Position of the icon or if it's both sides.
|
|
70
|
+
*/
|
|
71
|
+
iconPosition: function iconPosition() {
|
|
72
|
+
if (this.icon && this.hasIconRight) {
|
|
73
|
+
return 'has-icons-left has-icons-right';
|
|
74
|
+
} else if (!this.icon && this.hasIconRight) {
|
|
75
|
+
return 'has-icons-right';
|
|
76
|
+
} else if (this.icon) {
|
|
77
|
+
return 'has-icons-left';
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Icon name (MDI) based on the type.
|
|
83
|
+
*/
|
|
84
|
+
statusTypeIcon: function statusTypeIcon() {
|
|
85
|
+
switch (this.statusType) {
|
|
86
|
+
case 'is-success':
|
|
87
|
+
return 'check';
|
|
88
|
+
|
|
89
|
+
case 'is-danger':
|
|
90
|
+
return 'alert-circle';
|
|
91
|
+
|
|
92
|
+
case 'is-info':
|
|
93
|
+
return 'information';
|
|
94
|
+
|
|
95
|
+
case 'is-warning':
|
|
96
|
+
return 'alert';
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Check if have any message prop from parent if it's a Field.
|
|
102
|
+
*/
|
|
103
|
+
hasMessage: function hasMessage() {
|
|
104
|
+
return !!this.statusMessage;
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Current password-reveal icon name.
|
|
109
|
+
*/
|
|
110
|
+
passwordVisibleIcon: function passwordVisibleIcon() {
|
|
111
|
+
return !this.isPasswordVisible ? 'eye' : 'eye-off';
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Get value length
|
|
116
|
+
*/
|
|
117
|
+
valueLength: function valueLength() {
|
|
118
|
+
if (typeof this.computedValue === 'string') {
|
|
119
|
+
return this.computedValue.length;
|
|
120
|
+
} else if (typeof this.computedValue === 'number') {
|
|
121
|
+
return this.computedValue.toString().length;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
watch: {
|
|
128
|
+
/**
|
|
129
|
+
* When v-model is changed:
|
|
130
|
+
* 1. Set internal value.
|
|
131
|
+
*/
|
|
132
|
+
value: function value(_value) {
|
|
133
|
+
this.newValue = _value;
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
/**
|
|
138
|
+
* Toggle the visibility of a password-reveal input
|
|
139
|
+
* by changing the type and focus the input right away.
|
|
140
|
+
*/
|
|
141
|
+
togglePasswordVisibility: function togglePasswordVisibility() {
|
|
142
|
+
var _this = this;
|
|
143
|
+
|
|
144
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
145
|
+
this.newType = this.isPasswordVisible ? 'text' : 'password';
|
|
146
|
+
this.$nextTick(function () {
|
|
147
|
+
_this.$refs.input.focus();
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Input's 'input' event listener, 'nextTick' is used to prevent event firing
|
|
153
|
+
* before ui update, helps when using masks (Cleavejs and potentially others).
|
|
154
|
+
*/
|
|
155
|
+
onInput: function onInput(event) {
|
|
156
|
+
var _this2 = this;
|
|
157
|
+
|
|
158
|
+
this.$nextTick(function () {
|
|
159
|
+
if (event.target) {
|
|
160
|
+
_this2.computedValue = event.target.value;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/* script */
|
|
168
|
+
const __vue_script__ = script;
|
|
169
|
+
|
|
170
|
+
/* template */
|
|
171
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"control",class:_vm.rootClasses},[(_vm.type !== 'textarea')?_c('input',_vm._b({ref:"input",staticClass:"input",class:[_vm.inputClasses, _vm.customClass],attrs:{"type":_vm.newType,"autocomplete":_vm.newAutocomplete,"maxlength":_vm.maxlength},domProps:{"value":_vm.computedValue},on:{"input":_vm.onInput,"blur":_vm.onBlur,"focus":_vm.onFocus}},'input',_vm.$attrs,false)):_c('textarea',_vm._b({ref:"textarea",staticClass:"textarea",class:[_vm.inputClasses, _vm.customClass],attrs:{"maxlength":_vm.maxlength},domProps:{"value":_vm.computedValue},on:{"input":_vm.onInput,"blur":_vm.onBlur,"focus":_vm.onFocus}},'textarea',_vm.$attrs,false)),_vm._v(" "),(_vm.icon)?_c('b-icon',{staticClass:"is-left",attrs:{"icon":_vm.icon,"pack":_vm.iconPack,"size":_vm.iconSize}}):_vm._e(),_vm._v(" "),(!_vm.loading && (_vm.passwordReveal || _vm.statusTypeIcon))?_c('b-icon',{staticClass:"is-right",class:{ 'is-clickable': _vm.passwordReveal },attrs:{"icon":_vm.passwordReveal ? _vm.passwordVisibleIcon : _vm.statusTypeIcon,"pack":_vm.iconPack,"size":_vm.iconSize,"type":!_vm.passwordReveal ? _vm.statusType : 'is-primary',"both":""},nativeOn:{"click":function($event){_vm.togglePasswordVisibility($event);}}}):_vm._e(),_vm._v(" "),(_vm.maxlength && _vm.hasCounter && _vm.type !== 'number')?_c('small',{staticClass:"help counter",class:{ 'is-invisible': !_vm.isFocused }},[_vm._v("\n "+_vm._s(_vm.valueLength)+" / "+_vm._s(_vm.maxlength)+"\n ")]):_vm._e()],1)};
|
|
172
|
+
var __vue_staticRenderFns__ = [];
|
|
173
|
+
|
|
174
|
+
/* style */
|
|
175
|
+
const __vue_inject_styles__ = undefined;
|
|
176
|
+
/* scoped */
|
|
177
|
+
const __vue_scope_id__ = undefined;
|
|
178
|
+
/* module identifier */
|
|
179
|
+
const __vue_module_identifier__ = undefined;
|
|
180
|
+
/* functional template */
|
|
181
|
+
const __vue_is_functional_template__ = false;
|
|
182
|
+
/* style inject */
|
|
183
|
+
|
|
184
|
+
/* style inject SSR */
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
var Input = __chunk_6.__vue_normalize__(
|
|
189
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
190
|
+
__vue_inject_styles__,
|
|
191
|
+
__vue_script__,
|
|
192
|
+
__vue_scope_id__,
|
|
193
|
+
__vue_is_functional_template__,
|
|
194
|
+
__vue_module_identifier__,
|
|
195
|
+
undefined,
|
|
196
|
+
undefined
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
exports.Input = Input;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __chunk_2 = require('./chunk-59b91990.js');
|
|
4
|
+
var __chunk_3 = require('./chunk-e45e0329.js');
|
|
5
|
+
var __chunk_6 = require('./chunk-3b066933.js');
|
|
6
|
+
|
|
7
|
+
//
|
|
8
|
+
var script = {
|
|
9
|
+
name: 'BModal',
|
|
10
|
+
props: {
|
|
11
|
+
active: Boolean,
|
|
12
|
+
component: [Object, Function],
|
|
13
|
+
content: String,
|
|
14
|
+
programmatic: Boolean,
|
|
15
|
+
props: Object,
|
|
16
|
+
events: Object,
|
|
17
|
+
width: {
|
|
18
|
+
type: [String, Number],
|
|
19
|
+
default: 960
|
|
20
|
+
},
|
|
21
|
+
hasModalCard: Boolean,
|
|
22
|
+
animation: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'zoom-out'
|
|
25
|
+
},
|
|
26
|
+
canCancel: {
|
|
27
|
+
type: [Array, Boolean],
|
|
28
|
+
default: function _default() {
|
|
29
|
+
return __chunk_3.config.defaultModalCanCancel;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
onCancel: {
|
|
33
|
+
type: Function,
|
|
34
|
+
default: function _default() {}
|
|
35
|
+
},
|
|
36
|
+
scroll: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: function _default() {
|
|
39
|
+
return __chunk_3.config.defaultModalScroll ? __chunk_3.config.defaultModalScroll : 'clip';
|
|
40
|
+
},
|
|
41
|
+
validator: function validator(value) {
|
|
42
|
+
return ['clip', 'keep'].indexOf(value) >= 0;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
fullScreen: Boolean,
|
|
46
|
+
customClass: String
|
|
47
|
+
},
|
|
48
|
+
data: function data() {
|
|
49
|
+
return {
|
|
50
|
+
isActive: this.active || false,
|
|
51
|
+
savedScrollTop: null,
|
|
52
|
+
newWidth: typeof this.width === 'number' ? this.width + 'px' : this.width
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
cancelOptions: function cancelOptions() {
|
|
57
|
+
return typeof this.canCancel === 'boolean' ? this.canCancel ? __chunk_3.config.defaultModalCanCancel : [] : this.canCancel;
|
|
58
|
+
},
|
|
59
|
+
showX: function showX() {
|
|
60
|
+
return this.cancelOptions.indexOf('x') >= 0;
|
|
61
|
+
},
|
|
62
|
+
customStyle: function customStyle() {
|
|
63
|
+
if (!this.fullScreen) {
|
|
64
|
+
return {
|
|
65
|
+
maxWidth: this.newWidth
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
watch: {
|
|
73
|
+
active: function active(value) {
|
|
74
|
+
this.isActive = value;
|
|
75
|
+
},
|
|
76
|
+
isActive: function isActive() {
|
|
77
|
+
this.handleScroll();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
handleScroll: function handleScroll() {
|
|
82
|
+
if (typeof window === 'undefined') return;
|
|
83
|
+
|
|
84
|
+
if (this.scroll === 'clip') {
|
|
85
|
+
if (this.isActive) {
|
|
86
|
+
document.documentElement.classList.add('is-clipped');
|
|
87
|
+
} else {
|
|
88
|
+
document.documentElement.classList.remove('is-clipped');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
this.savedScrollTop = !this.savedScrollTop ? document.documentElement.scrollTop : this.savedScrollTop;
|
|
95
|
+
|
|
96
|
+
if (this.isActive) {
|
|
97
|
+
document.body.classList.add('is-noscroll');
|
|
98
|
+
} else {
|
|
99
|
+
document.body.classList.remove('is-noscroll');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (this.isActive) {
|
|
103
|
+
document.body.style.top = "-".concat(this.savedScrollTop, "px");
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
document.documentElement.scrollTop = this.savedScrollTop;
|
|
108
|
+
document.body.style.top = null;
|
|
109
|
+
this.savedScrollTop = null;
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Close the Modal if canCancel and call the onCancel prop (function).
|
|
114
|
+
*/
|
|
115
|
+
cancel: function cancel(method) {
|
|
116
|
+
if (this.cancelOptions.indexOf(method) < 0) return;
|
|
117
|
+
this.onCancel.apply(null, arguments);
|
|
118
|
+
this.close();
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Call the onCancel prop (function).
|
|
123
|
+
* Emit events, and destroy modal if it's programmatic.
|
|
124
|
+
*/
|
|
125
|
+
close: function close() {
|
|
126
|
+
var _this = this;
|
|
127
|
+
|
|
128
|
+
this.$emit('close');
|
|
129
|
+
this.$emit('update:active', false); // Timeout for the animation complete before destroying
|
|
130
|
+
|
|
131
|
+
if (this.programmatic) {
|
|
132
|
+
this.isActive = false;
|
|
133
|
+
setTimeout(function () {
|
|
134
|
+
_this.$destroy();
|
|
135
|
+
|
|
136
|
+
__chunk_2.removeElement(_this.$el);
|
|
137
|
+
}, 150);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Keypress event that is bound to the document.
|
|
143
|
+
*/
|
|
144
|
+
keyPress: function keyPress(event) {
|
|
145
|
+
// Esc key
|
|
146
|
+
if (this.isActive && event.keyCode === 27) this.cancel('escape');
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
created: function created() {
|
|
150
|
+
if (typeof window !== 'undefined') {
|
|
151
|
+
document.addEventListener('keyup', this.keyPress);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
beforeMount: function beforeMount() {
|
|
155
|
+
// Insert the Modal component in body tag
|
|
156
|
+
// only if it's programmatic
|
|
157
|
+
this.programmatic && document.body.appendChild(this.$el);
|
|
158
|
+
},
|
|
159
|
+
mounted: function mounted() {
|
|
160
|
+
if (this.programmatic) this.isActive = true;else if (this.isActive) this.handleScroll();
|
|
161
|
+
},
|
|
162
|
+
beforeDestroy: function beforeDestroy() {
|
|
163
|
+
if (typeof window !== 'undefined') {
|
|
164
|
+
document.removeEventListener('keyup', this.keyPress); // reset scroll
|
|
165
|
+
|
|
166
|
+
document.documentElement.classList.remove('is-clipped');
|
|
167
|
+
var savedScrollTop = !this.savedScrollTop ? document.documentElement.scrollTop : this.savedScrollTop;
|
|
168
|
+
document.body.classList.remove('is-noscroll');
|
|
169
|
+
document.documentElement.scrollTop = savedScrollTop;
|
|
170
|
+
document.body.style.top = null;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/* script */
|
|
176
|
+
const __vue_script__ = script;
|
|
177
|
+
|
|
178
|
+
/* template */
|
|
179
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":_vm.animation}},[(_vm.isActive)?_c('div',{staticClass:"modal is-active",class:[{'is-full-screen': _vm.fullScreen}, _vm.customClass]},[_c('div',{staticClass:"modal-background",on:{"click":function($event){_vm.cancel('outside');}}}),_vm._v(" "),_c('div',{staticClass:"animation-content",class:{ 'modal-content': !_vm.hasModalCard },style:(_vm.customStyle)},[(_vm.component)?_c(_vm.component,_vm._g(_vm._b({tag:"component",on:{"close":_vm.close}},'component',_vm.props,false),_vm.events)):(_vm.content)?_c('div',{domProps:{"innerHTML":_vm._s(_vm.content)}}):_vm._t("default")],2),_vm._v(" "),(_vm.showX)?_c('button',{staticClass:"modal-close is-large",attrs:{"type":"button"},on:{"click":function($event){_vm.cancel('x');}}}):_vm._e()]):_vm._e()])};
|
|
180
|
+
var __vue_staticRenderFns__ = [];
|
|
181
|
+
|
|
182
|
+
/* style */
|
|
183
|
+
const __vue_inject_styles__ = undefined;
|
|
184
|
+
/* scoped */
|
|
185
|
+
const __vue_scope_id__ = undefined;
|
|
186
|
+
/* module identifier */
|
|
187
|
+
const __vue_module_identifier__ = undefined;
|
|
188
|
+
/* functional template */
|
|
189
|
+
const __vue_is_functional_template__ = false;
|
|
190
|
+
/* style inject */
|
|
191
|
+
|
|
192
|
+
/* style inject SSR */
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
var Modal = __chunk_6.__vue_normalize__(
|
|
197
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
198
|
+
__vue_inject_styles__,
|
|
199
|
+
__vue_script__,
|
|
200
|
+
__vue_scope_id__,
|
|
201
|
+
__vue_is_functional_template__,
|
|
202
|
+
__vue_module_identifier__,
|
|
203
|
+
undefined,
|
|
204
|
+
undefined
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
exports.Modal = Modal;
|