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
|
@@ -1,2 +1,768 @@
|
|
|
1
|
-
/*! Buefy v0.
|
|
2
|
-
!(function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("vue"));else if("function"==typeof define&&define.amd)define(["vue"],e);else{var n=e("object"==typeof exports?require("vue"):t.Vue);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}})("undefined"!=typeof self?self:this,(function(t){return (function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=275)})({0:function(t,e){t.exports=function(t,e,n,o,i){var r,c=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(r=t,c=t.default);var u="function"==typeof c?c.options:c;e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns),o&&(u._scopeId=o);var s;if(i?(s=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=s):n&&(s=n),s){var l=u.functional,f=l?u.render:u.beforeCreate;l?u.render=function(t,e){return s.call(e),f(t,e)}:u.beforeCreate=f?[].concat(f,s):[s]}return{esModule:r,exports:c,options:u}}},1:function(t,e,n){t.exports=!n(7)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},10:function(t,e,n){var o=n(5);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},108:function(t,e,n){var o=n(0)(n(120),n(121),null,null,null);t.exports=o.exports},11:function(t,e,n){var o=n(36),i=n(28);t.exports=function(t){return o(i(t))}},12:function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));var o=function(t){"undefined"!=typeof window&&window.Vue&&window.Vue.use(t)},i=function(t,e){t.component(e.name,e)},r=function(t,e,n){t.prototype[e]=n}},120:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(51),i=n(8);e.default={name:"BModal",props:{active:Boolean,component:[Object,Function],content:String,programmatic:Boolean,props:Object,events:Object,width:{type:[String,Number],default:960},hasModalCard:Boolean,animation:{type:String,default:"zoom-out"},canCancel:{type:[Array,Boolean],default:function(){return i.a.defaultModalCanCancel}},onCancel:{type:Function,default:function(){}},scroll:{type:String,default:function(){return i.a.defaultModalScroll?i.a.defaultModalScroll:"clip"},validator:function(t){return["clip","keep"].indexOf(t)>=0}},fullScreen:Boolean,customClass:String},data:function(){return{isActive:this.active||!1,savedScrollTop:null,newWidth:"number"==typeof this.width?this.width+"px":this.width}},computed:{cancelOptions:function(){return"boolean"==typeof this.canCancel?this.canCancel?i.a.defaultModalCanCancel:[]:this.canCancel},showX:function(){return this.cancelOptions.indexOf("x")>=0},customStyle:function(){return this.fullScreen?null:{maxWidth:this.newWidth}}},watch:{active:function(t){this.isActive=t},isActive:function(){this.handleScroll()}},methods:{handleScroll:function(){if("undefined"!=typeof window){if("clip"===this.scroll)return void(this.isActive?document.documentElement.classList.add("is-clipped"):document.documentElement.classList.remove("is-clipped"));if(this.savedScrollTop=this.savedScrollTop?this.savedScrollTop:document.documentElement.scrollTop,this.isActive?document.body.classList.add("is-noscroll"):document.body.classList.remove("is-noscroll"),this.isActive)return void(document.body.style.top="-"+this.savedScrollTop+"px");document.documentElement.scrollTop=this.savedScrollTop,document.body.style.top=null,this.savedScrollTop=null}},cancel:function(t){this.cancelOptions.indexOf(t)<0||(this.onCancel.apply(null,arguments),this.close())},close:function(){var t=this;this.$emit("close"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout((function(){t.$destroy(),Object(o.d)(t.$el)}),150))},keyPress:function(t){this.isActive&&27===t.keyCode&&this.cancel("escape")}},created:function(){"undefined"!=typeof window&&document.addEventListener("keyup",this.keyPress)},beforeMount:function(){this.programmatic&&document.body.appendChild(this.$el)},mounted:function(){this.programmatic?this.isActive=!0:this.isActive&&this.handleScroll()},beforeDestroy:function(){if("undefined"!=typeof window){document.removeEventListener("keyup",this.keyPress),document.documentElement.classList.remove("is-clipped");var t=this.savedScrollTop?this.savedScrollTop:document.documentElement.scrollTop;document.body.classList.remove("is-noscroll"),document.documentElement.scrollTop=t,document.body.style.top=null}}}},121:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:t.animation}},[t.isActive?n("div",{staticClass:"modal is-active",class:[{"is-full-screen":t.fullScreen},t.customClass]},[n("div",{staticClass:"modal-background",on:{click:function(e){t.cancel("outside")}}}),t._v(" "),n("div",{staticClass:"animation-content",class:{"modal-content":!t.hasModalCard},style:t.customStyle},[t.component?n(t.component,t._g(t._b({tag:"component",on:{close:t.close}},"component",t.props,!1),t.events)):t.content?n("div",{domProps:{innerHTML:t._s(t.content)}}):t._t("default")],2),t._v(" "),t.showX?n("button",{staticClass:"modal-close is-large",attrs:{type:"button"},on:{click:function(e){t.cancel("x")}}}):t._e()]):t._e()])},staticRenderFns:[]}},14:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},15:function(t,e,n){var o=n(5);t.exports=function(t,e){if(!o(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!o(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!o(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!o(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},16:function(t,e,n){var o=n(2),i=n(3),r=n(29),c=n(9),a=n(6),u=function(t,e,n){var s,l,f,d=t&u.F,p=t&u.G,m=t&u.S,v=t&u.P,h=t&u.B,y=t&u.W,g=p?i:i[e]||(i[e]={}),b=g.prototype,w=p?o:m?o[e]:(o[e]||{}).prototype;p&&(n=e);for(s in n)(l=!d&&w&&void 0!==w[s])&&a(g,s)||(f=l?w[s]:n[s],g[s]=p&&"function"!=typeof w[s]?n[s]:h&&l?r(f,o):y&&w[s]==f?(function(t){var e=function(e,n,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,o)}return t.apply(this,arguments)};return e.prototype=t.prototype,e})(f):v&&"function"==typeof f?r(Function.call,f):f,v&&((g.virtual||(g.virtual={}))[s]=f,t&u.R&&b&&!b[s]&&c(b,s,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},160:function(t,e,n){"use strict";function o(t){return new(("undefined"!=typeof window&&window.Vue?window.Vue:a.a).extend(s.a))({el:document.createElement("div"),propsData:t})}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"Dialog",(function(){return f}));var i=n(70),r=n.n(i),c=n(71),a=n.n(c),u=n(161),s=n.n(u),l=n(12),f={alert:function(t){var e=void 0;"string"==typeof t&&(e=t);var n={canCancel:!1,message:e};return o(r()(n,t))},confirm:function(t){var e={};return o(r()(e,t))},prompt:function(t){var e={hasInput:!0,confirmText:"Done"};return o(r()(e,t))}},d={install:function(t){Object(l.a)(t,s.a),Object(l.b)(t,"$dialog",f)}};Object(l.c)(d),e.default=d},161:function(t,e,n){var o=n(0)(n(162),n(163),null,null,null);t.exports=o.exports},162:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),i=n.n(o),r=n(23),c=n.n(r),a=n(108),u=n.n(a),s=n(8),l=n(51);e.default={name:"BDialog",components:i()({},c.a.name,c.a),extends:u.a,props:{title:String,message:String,icon:String,iconPack:String,hasIcon:Boolean,type:{type:String,default:"is-primary"},size:String,confirmText:{type:String,default:function(){return s.a.defaultDialogConfirmText?s.a.defaultDialogConfirmText:"OK"}},cancelText:{type:String,default:function(){return s.a.defaultDialogCancelText?s.a.defaultDialogCancelText:"Cancel"}},hasInput:Boolean,inputAttrs:{type:Object,default:function(){return{}}},onConfirm:{type:Function,default:function(){}},focusOn:{type:String,default:"confirm"}},data:function(){return{prompt:this.hasInput?this.inputAttrs.value||"":"",isActive:!1,validationMessage:""}},computed:{iconByType:function(){switch(this.type){case"is-info":return"information";case"is-success":return"check-circle";case"is-warning":return"alert";case"is-danger":return"alert-circle";default:return null}},showCancel:function(){return this.cancelOptions.indexOf("button")>=0}},methods:{confirm:function(){var t=this;if(void 0!==this.$refs.input&&!this.$refs.input.checkValidity())return this.validationMessage=this.$refs.input.validationMessage,void this.$nextTick((function(){return t.$refs.input.select()}));this.onConfirm(this.prompt),this.close()},close:function(){var t=this;this.isActive=!1,setTimeout((function(){t.$destroy(),Object(l.d)(t.$el)}),150)}},beforeMount:function(){var t=this;this.$nextTick((function(){document.body.appendChild(t.$el)}))},mounted:function(){var t=this;this.isActive=!0,void 0===this.inputAttrs.required&&this.$set(this.inputAttrs,"required",!0),this.$nextTick((function(){t.hasInput?t.$refs.input.focus():"cancel"===t.focusOn&&t.showCancel?t.$refs.cancelButton.focus():t.$refs.confirmButton.focus()}))}}},163:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:t.animation}},[t.isActive?n("div",{staticClass:"dialog modal is-active",class:t.size},[n("div",{staticClass:"modal-background",on:{click:function(e){t.cancel("outside")}}}),t._v(" "),n("div",{staticClass:"modal-card animation-content"},[t.title?n("header",{staticClass:"modal-card-head"},[n("p",{staticClass:"modal-card-title"},[t._v(t._s(t.title))])]):t._e(),t._v(" "),n("section",{staticClass:"modal-card-body",class:{"is-titleless":!t.title,"is-flex":t.hasIcon}},[n("div",{staticClass:"media"},[t.hasIcon?n("div",{staticClass:"media-left"},[n("b-icon",{attrs:{icon:t.icon?t.icon:t.iconByType,pack:t.iconPack,type:t.type,both:!t.icon,size:"is-large"}})],1):t._e(),t._v(" "),n("div",{staticClass:"media-content"},[n("p",{domProps:{innerHTML:t._s(t.message)}}),t._v(" "),t.hasInput?n("div",{staticClass:"field"},[n("div",{staticClass:"control"},[n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.prompt,expression:"prompt"}],ref:"input",staticClass:"input",class:{"is-danger":t.validationMessage},domProps:{value:t.prompt},on:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key))return null;t.confirm(e)},input:function(e){e.target.composing||(t.prompt=e.target.value)}}},"input",t.inputAttrs,!1))]),t._v(" "),n("p",{staticClass:"help is-danger"},[t._v(t._s(t.validationMessage))])]):t._e()])])]),t._v(" "),n("footer",{staticClass:"modal-card-foot"},[t.showCancel?n("button",{ref:"cancelButton",staticClass:"button",on:{click:function(e){t.cancel("button")}}},[t._v("\n "+t._s(t.cancelText)+"\n ")]):t._e(),t._v(" "),n("button",{ref:"confirmButton",staticClass:"button",class:t.type,on:{click:t.confirm}},[t._v("\n "+t._s(t.confirmText)+"\n ")])])])]):t._e()])},staticRenderFns:[]}},17:function(t,e){var n=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+o).toString(36))}},18:function(t,e,n){"use strict";e.__esModule=!0;var o=n(42),i=(function(t){return t&&t.__esModule?t:{default:t}})(o);e.default=function(t,e,n){return e in t?(0,i.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},19:function(t,e){t.exports=!0},2:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},20:function(t,e,n){t.exports=!n(1)&&!n(7)((function(){return 7!=Object.defineProperty(n(21)("div"),"a",{get:function(){return 7}}).a}))},21:function(t,e,n){var o=n(5),i=n(2).document,r=o(i)&&o(i.createElement);t.exports=function(t){return r?i.createElement(t):{}}},22:function(t,e){var n=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:n)(t)}},23:function(t,e,n){var o=n(0)(n(46),n(47),null,null,null);t.exports=o.exports},24:function(t,e,n){var o=n(34),i=n(27);t.exports=Object.keys||function(t){return o(t,i)}},25:function(t,e){e.f={}.propertyIsEnumerable},26:function(t,e,n){var o=n(3),i=n(2),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:n(19)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},27:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},275:function(t,e,n){t.exports=n(160)},28:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},29:function(t,e,n){var o=n(32);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,i){return t.call(e,n,o,i)}}return function(){return t.apply(e,arguments)}}},3:function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},30:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},31:function(t,e,n){var o=n(26)("keys"),i=n(17);t.exports=function(t){return o[t]||(o[t]=i(t))}},32:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},33:function(t,e){e.f=Object.getOwnPropertySymbols},34:function(t,e,n){var o=n(6),i=n(11),r=n(48)(!1),c=n(31)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,s=[];for(n in a)n!=c&&o(a,n)&&s.push(n);for(;e.length>u;)o(a,n=e[u++])&&(~r(s,n)||s.push(n));return s}},36:function(t,e,n){var o=n(30);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},4:function(t,e,n){var o=n(10),i=n(20),r=n(15),c=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(o(t),e=r(e,!0),o(n),i)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},41:function(t,e,n){var o=n(22),i=Math.min;t.exports=function(t){return t>0?i(o(t),9007199254740991):0}},42:function(t,e,n){t.exports={default:n(43),__esModule:!0}},43:function(t,e,n){n(44);var o=n(3).Object;t.exports=function(t,e,n){return o.defineProperty(t,e,n)}},44:function(t,e,n){var o=n(16);o(o.S+o.F*!n(1),"Object",{defineProperty:n(4).f})},46:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);e.default={name:"BIcon",props:{type:[String,Object],pack:String,icon:String,size:String,customSize:String,customClass:String,both:Boolean},computed:{newIcon:function(){return"mdi"===this.newPack?this.newPack+"-"+this.icon:this.addFAPrefix(this.getEquivalentIconOf(this.icon))},newPack:function(){return this.pack||o.a.defaultIconPack},newType:function(){if(this.type){var t=[];if("string"==typeof this.type)t=this.type.split("-");else for(var e in this.type)if(this.type[e]){t=e.split("-");break}if(!(t.length<=1))return"has-text-"+t[1]}},newCustomSize:function(){return this.customSize||this.customSizeByPack},customSizeByPack:function(){var t="mdi"===this.newPack?"mdi-24px":this.addFAPrefix("lg"),e="mdi"===this.newPack?"mdi-36px":this.addFAPrefix("2x"),n="mdi"===this.newPack?"mdi-48px":this.addFAPrefix("3x");switch(this.size){case"is-small":return;case"is-medium":return e;case"is-large":return n;default:return t}},useIconComponent:function(){return o.a.defaultIconComponent}},methods:{addFAPrefix:function(t){return this.useIconComponent?t:"fa-"+t},getEquivalentIconOf:function(t){if(!this.both)return t;switch(t){case"check":return"check";case"information":return"info-circle";case"check-circle":return"check-circle";case"alert":return"exclamation-triangle";case"alert-circle":return"exclamation-circle";case"arrow-up":return"arrow-up";case"chevron-right":return"angle-right";case"chevron-left":return"angle-left";case"chevron-down":return"angle-down";case"eye":return"eye";case"eye-off":return"eye-slash";case"menu-down":return"caret-down";case"menu-up":return"caret-up";default:return t}}}}},47:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"icon",class:[t.newType,t.size]},[t.useIconComponent?n(t.useIconComponent,{tag:"component",class:[t.customClass],attrs:{icon:[t.newPack,t.newIcon],size:t.newCustomSize}}):n("i",{class:[t.newPack,t.newIcon,t.newCustomSize,t.customClass]})],1)},staticRenderFns:[]}},48:function(t,e,n){var o=n(11),i=n(41),r=n(49);t.exports=function(t){return function(e,n,c){var a,u=o(e),s=i(u.length),l=r(c,s);if(t&&n!=n){for(;s>l;)if((a=u[l++])!=a)return!0}else for(;s>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},49:function(t,e,n){var o=n(22),i=Math.max,r=Math.min;t.exports=function(t,e){return t=o(t),t<0?i(t+e,0):r(t,e)}},5:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},51:function(t,e,n){"use strict";function o(t,e){return e.split(".").reduce((function(t,e){return t[e]}),t)}function i(t,e,n){if(!t)return-1;if(!n||"function"!=typeof n)return t.indexOf(e);for(var o=0;o<t.length;o++)if(n(t[o],e))return o;return-1}function r(t){void 0!==t.remove?t.remove():void 0!==t.parentNode&&t.parentNode.removeChild(t)}e.a=o,e.b=i,n.d(e,"c",(function(){return c})),e.d=r;var c={Android:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/Android/i)},BlackBerry:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return"undefined"!=typeof window&&window.navigator.userAgent.match(/IEMobile/i)},any:function(){return c.Android()||c.BlackBerry()||c.iOS()||c.Opera()||c.Windows()}}},54:function(t,e,n){var o=n(28);t.exports=function(t){return Object(o(t))}},6:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},7:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},70:function(t,e,n){t.exports={default:n(86),__esModule:!0}},71:function(e,n){e.exports=t},8:function(t,e,n){"use strict";var o={defaultContainerElement:null,defaultIconPack:"mdi",defaultIconComponent:null,defaultDialogConfirmText:null,defaultDialogCancelText:null,defaultSnackbarDuration:3500,defaultSnackbarPosition:null,defaultToastDuration:2e3,defaultToastPosition:null,defaultNotificationDuration:2e3,defaultNotificationPosition:null,defaultTooltipType:"is-primary",defaultTooltipAnimated:!1,defaultInputAutocomplete:"on",defaultDateFormatter:null,defaultDateParser:null,defaultDateCreator:null,defaultDayNames:null,defaultMonthNames:null,defaultFirstDayOfWeek:null,defaultUnselectableDaysOfWeek:null,defaultTimeFormatter:null,defaultTimeParser:null,defaultModalCanCancel:["escape","x","outside","button"],defaultModalScroll:null,defaultDatepickerMobileNative:!0,defaultTimepickerMobileNative:!0,defaultNoticeQueue:!0,defaultInputHasCounter:!0,defaultUseHtml5Validation:!0,defaultDropdownMobileModal:!0,defaultFieldLabelPosition:null,defaultDatepickerYearsRange:[-100,3],defaultDatepickerNearbyMonthDays:!0,defaultDatepickerNearbySelectableMonthDays:!1};e.a=o},86:function(t,e,n){n(87),t.exports=n(3).Object.assign},87:function(t,e,n){var o=n(16);o(o.S+o.F,"Object",{assign:n(88)})},88:function(t,e,n){"use strict";var o=n(24),i=n(33),r=n(25),c=n(54),a=n(36),u=Object.assign;t.exports=!u||n(7)((function(){var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=o}))?function(t,e){for(var n=c(t),u=arguments.length,s=1,l=i.f,f=r.f;u>s;)for(var d,p=a(arguments[s++]),m=l?o(p).concat(l(p)):o(p),v=m.length,h=0;v>h;)f.call(p,d=m[h++])&&(n[d]=p[d]);return n}:u},9:function(t,e,n){var o=n(4),i=n(14);t.exports=n(1)?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}}})}));
|
|
1
|
+
/*! Buefy v0.8.2 | MIT License | github.com/buefy/buefy */
|
|
2
|
+
(function (global, factory) {
|
|
3
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
4
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
|
|
5
|
+
(global = global || self, factory(global.Dialog = {}, global.Vue));
|
|
6
|
+
}(this, function (exports, Vue) { 'use strict';
|
|
7
|
+
|
|
8
|
+
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
|
|
9
|
+
|
|
10
|
+
function _defineProperty(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var config = {
|
|
26
|
+
defaultContainerElement: null,
|
|
27
|
+
defaultIconPack: 'mdi',
|
|
28
|
+
defaultIconComponent: null,
|
|
29
|
+
defaultDialogConfirmText: null,
|
|
30
|
+
defaultDialogCancelText: null,
|
|
31
|
+
defaultSnackbarDuration: 3500,
|
|
32
|
+
defaultSnackbarPosition: null,
|
|
33
|
+
defaultToastDuration: 2000,
|
|
34
|
+
defaultToastPosition: null,
|
|
35
|
+
defaultNotificationDuration: 2000,
|
|
36
|
+
defaultNotificationPosition: null,
|
|
37
|
+
defaultTooltipType: 'is-primary',
|
|
38
|
+
defaultTooltipAnimated: false,
|
|
39
|
+
defaultTooltipDelay: 0,
|
|
40
|
+
defaultInputAutocomplete: 'on',
|
|
41
|
+
defaultDateFormatter: null,
|
|
42
|
+
defaultDateParser: null,
|
|
43
|
+
defaultDateCreator: null,
|
|
44
|
+
defaultDayNames: null,
|
|
45
|
+
defaultMonthNames: null,
|
|
46
|
+
defaultFirstDayOfWeek: null,
|
|
47
|
+
defaultUnselectableDaysOfWeek: null,
|
|
48
|
+
defaultTimeFormatter: null,
|
|
49
|
+
defaultTimeParser: null,
|
|
50
|
+
defaultModalCanCancel: ['escape', 'x', 'outside', 'button'],
|
|
51
|
+
defaultModalScroll: null,
|
|
52
|
+
defaultDatepickerMobileNative: true,
|
|
53
|
+
defaultTimepickerMobileNative: true,
|
|
54
|
+
defaultNoticeQueue: true,
|
|
55
|
+
defaultInputHasCounter: true,
|
|
56
|
+
defaultTaginputHasCounter: true,
|
|
57
|
+
defaultUseHtml5Validation: true,
|
|
58
|
+
defaultDropdownMobileModal: true,
|
|
59
|
+
defaultFieldLabelPosition: null,
|
|
60
|
+
defaultDatepickerYearsRange: [-100, 3],
|
|
61
|
+
defaultDatepickerNearbyMonthDays: true,
|
|
62
|
+
defaultDatepickerNearbySelectableMonthDays: false,
|
|
63
|
+
defaultDatepickerShowWeekNumber: false
|
|
64
|
+
};
|
|
65
|
+
var config$1 = config;
|
|
66
|
+
|
|
67
|
+
//
|
|
68
|
+
var script = {
|
|
69
|
+
name: 'BIcon',
|
|
70
|
+
props: {
|
|
71
|
+
type: [String, Object],
|
|
72
|
+
pack: String,
|
|
73
|
+
icon: String,
|
|
74
|
+
size: String,
|
|
75
|
+
customSize: String,
|
|
76
|
+
customClass: String,
|
|
77
|
+
both: Boolean // This is used internally to show both MDI and FA icon
|
|
78
|
+
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
/**
|
|
82
|
+
* Internal icon name based on the pack.
|
|
83
|
+
* If pack is 'fa', gets the equivalent FA icon name of the MDI,
|
|
84
|
+
* internal icons are always MDI.
|
|
85
|
+
*/
|
|
86
|
+
newIcon: function newIcon() {
|
|
87
|
+
return this.newPack === 'mdi' ? "".concat(this.newPack, "-").concat(this.icon) : this.addFAPrefix(this.getEquivalentIconOf(this.icon));
|
|
88
|
+
},
|
|
89
|
+
newPack: function newPack() {
|
|
90
|
+
return this.pack || config$1.defaultIconPack;
|
|
91
|
+
},
|
|
92
|
+
newType: function newType() {
|
|
93
|
+
if (!this.type) return;
|
|
94
|
+
var splitType = [];
|
|
95
|
+
|
|
96
|
+
if (typeof this.type === 'string') {
|
|
97
|
+
splitType = this.type.split('-');
|
|
98
|
+
} else {
|
|
99
|
+
for (var key in this.type) {
|
|
100
|
+
if (this.type[key]) {
|
|
101
|
+
splitType = key.split('-');
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (splitType.length <= 1) return;
|
|
108
|
+
return "has-text-".concat(splitType[1]);
|
|
109
|
+
},
|
|
110
|
+
newCustomSize: function newCustomSize() {
|
|
111
|
+
return this.customSize || this.customSizeByPack;
|
|
112
|
+
},
|
|
113
|
+
customSizeByPack: function customSizeByPack() {
|
|
114
|
+
var defaultSize = this.newPack === 'mdi' ? 'mdi-24px' : this.addFAPrefix('lg');
|
|
115
|
+
var mediumSize = this.newPack === 'mdi' ? 'mdi-36px' : this.addFAPrefix('2x');
|
|
116
|
+
var largeSize = this.newPack === 'mdi' ? 'mdi-48px' : this.addFAPrefix('3x');
|
|
117
|
+
|
|
118
|
+
switch (this.size) {
|
|
119
|
+
case 'is-small':
|
|
120
|
+
return;
|
|
121
|
+
|
|
122
|
+
case 'is-medium':
|
|
123
|
+
return mediumSize;
|
|
124
|
+
|
|
125
|
+
case 'is-large':
|
|
126
|
+
return largeSize;
|
|
127
|
+
|
|
128
|
+
default:
|
|
129
|
+
return defaultSize;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
useIconComponent: function useIconComponent() {
|
|
133
|
+
return config$1.defaultIconComponent;
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
addFAPrefix: function addFAPrefix(value) {
|
|
138
|
+
if (this.useIconComponent) {
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return "fa-".concat(value);
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Equivalent FA icon name of the MDI.
|
|
147
|
+
*/
|
|
148
|
+
getEquivalentIconOf: function getEquivalentIconOf(value) {
|
|
149
|
+
// Only transform the class if the both prop is set to true
|
|
150
|
+
if (!this.both) {
|
|
151
|
+
return value;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
switch (value) {
|
|
155
|
+
case 'check':
|
|
156
|
+
return 'check';
|
|
157
|
+
|
|
158
|
+
case 'information':
|
|
159
|
+
return 'info-circle';
|
|
160
|
+
|
|
161
|
+
case 'check-circle':
|
|
162
|
+
return 'check-circle';
|
|
163
|
+
|
|
164
|
+
case 'alert':
|
|
165
|
+
return 'exclamation-triangle';
|
|
166
|
+
|
|
167
|
+
case 'alert-circle':
|
|
168
|
+
return 'exclamation-circle';
|
|
169
|
+
|
|
170
|
+
case 'arrow-up':
|
|
171
|
+
return 'arrow-up';
|
|
172
|
+
|
|
173
|
+
case 'chevron-right':
|
|
174
|
+
return 'angle-right';
|
|
175
|
+
|
|
176
|
+
case 'chevron-left':
|
|
177
|
+
return 'angle-left';
|
|
178
|
+
|
|
179
|
+
case 'chevron-down':
|
|
180
|
+
return 'angle-down';
|
|
181
|
+
|
|
182
|
+
case 'eye':
|
|
183
|
+
return 'eye';
|
|
184
|
+
|
|
185
|
+
case 'eye-off':
|
|
186
|
+
return 'eye-slash';
|
|
187
|
+
|
|
188
|
+
case 'menu-down':
|
|
189
|
+
return 'caret-down';
|
|
190
|
+
|
|
191
|
+
case 'menu-up':
|
|
192
|
+
return 'caret-up';
|
|
193
|
+
|
|
194
|
+
default:
|
|
195
|
+
return value;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
|
202
|
+
/* server only */
|
|
203
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
204
|
+
if (typeof shadowMode !== 'boolean') {
|
|
205
|
+
createInjectorSSR = createInjector;
|
|
206
|
+
createInjector = shadowMode;
|
|
207
|
+
shadowMode = false;
|
|
208
|
+
} // Vue.extend constructor export interop.
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
var options = typeof script === 'function' ? script.options : script; // render functions
|
|
212
|
+
|
|
213
|
+
if (template && template.render) {
|
|
214
|
+
options.render = template.render;
|
|
215
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
216
|
+
options._compiled = true; // functional template
|
|
217
|
+
|
|
218
|
+
if (isFunctionalTemplate) {
|
|
219
|
+
options.functional = true;
|
|
220
|
+
}
|
|
221
|
+
} // scopedId
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
if (scopeId) {
|
|
225
|
+
options._scopeId = scopeId;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
var hook;
|
|
229
|
+
|
|
230
|
+
if (moduleIdentifier) {
|
|
231
|
+
// server build
|
|
232
|
+
hook = function hook(context) {
|
|
233
|
+
// 2.3 injection
|
|
234
|
+
context = context || // cached call
|
|
235
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
236
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
|
|
237
|
+
// 2.2 with runInNewContext: true
|
|
238
|
+
|
|
239
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
240
|
+
context = __VUE_SSR_CONTEXT__;
|
|
241
|
+
} // inject component styles
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
if (style) {
|
|
245
|
+
style.call(this, createInjectorSSR(context));
|
|
246
|
+
} // register component module identifier for async chunk inference
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
if (context && context._registeredComponents) {
|
|
250
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
251
|
+
}
|
|
252
|
+
}; // used by ssr in case component is cached and beforeCreate
|
|
253
|
+
// never gets called
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
options._ssrRegister = hook;
|
|
257
|
+
} else if (style) {
|
|
258
|
+
hook = shadowMode ? function () {
|
|
259
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
260
|
+
} : function (context) {
|
|
261
|
+
style.call(this, createInjector(context));
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (hook) {
|
|
266
|
+
if (options.functional) {
|
|
267
|
+
// register for functional component in vue file
|
|
268
|
+
var originalRender = options.render;
|
|
269
|
+
|
|
270
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
271
|
+
hook.call(context);
|
|
272
|
+
return originalRender(h, context);
|
|
273
|
+
};
|
|
274
|
+
} else {
|
|
275
|
+
// inject component registration as beforeCreate hook
|
|
276
|
+
var existing = options.beforeCreate;
|
|
277
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return script;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
var normalizeComponent_1 = normalizeComponent;
|
|
285
|
+
|
|
286
|
+
/* script */
|
|
287
|
+
const __vue_script__ = script;
|
|
288
|
+
|
|
289
|
+
/* template */
|
|
290
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"icon",class:[_vm.newType, _vm.size]},[(!_vm.useIconComponent)?_c('i',{class:[_vm.newPack, _vm.newIcon, _vm.newCustomSize, _vm.customClass]}):_c(_vm.useIconComponent,{tag:"component",class:[_vm.customClass],attrs:{"icon":[_vm.newPack, _vm.newIcon],"size":_vm.newCustomSize}})],1)};
|
|
291
|
+
var __vue_staticRenderFns__ = [];
|
|
292
|
+
|
|
293
|
+
/* style */
|
|
294
|
+
const __vue_inject_styles__ = undefined;
|
|
295
|
+
/* scoped */
|
|
296
|
+
const __vue_scope_id__ = undefined;
|
|
297
|
+
/* module identifier */
|
|
298
|
+
const __vue_module_identifier__ = undefined;
|
|
299
|
+
/* functional template */
|
|
300
|
+
const __vue_is_functional_template__ = false;
|
|
301
|
+
/* style inject */
|
|
302
|
+
|
|
303
|
+
/* style inject SSR */
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
var Icon = normalizeComponent_1(
|
|
308
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
309
|
+
__vue_inject_styles__,
|
|
310
|
+
__vue_script__,
|
|
311
|
+
__vue_scope_id__,
|
|
312
|
+
__vue_is_functional_template__,
|
|
313
|
+
__vue_module_identifier__,
|
|
314
|
+
undefined,
|
|
315
|
+
undefined
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Get value of an object property/path even if it's nested
|
|
320
|
+
*/
|
|
321
|
+
function removeElement(el) {
|
|
322
|
+
if (typeof el.remove !== 'undefined') {
|
|
323
|
+
el.remove();
|
|
324
|
+
} else if (typeof el.parentNode !== 'undefined') {
|
|
325
|
+
el.parentNode.removeChild(el);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
//
|
|
330
|
+
var script$1 = {
|
|
331
|
+
name: 'BModal',
|
|
332
|
+
props: {
|
|
333
|
+
active: Boolean,
|
|
334
|
+
component: [Object, Function],
|
|
335
|
+
content: String,
|
|
336
|
+
programmatic: Boolean,
|
|
337
|
+
props: Object,
|
|
338
|
+
events: Object,
|
|
339
|
+
width: {
|
|
340
|
+
type: [String, Number],
|
|
341
|
+
default: 960
|
|
342
|
+
},
|
|
343
|
+
hasModalCard: Boolean,
|
|
344
|
+
animation: {
|
|
345
|
+
type: String,
|
|
346
|
+
default: 'zoom-out'
|
|
347
|
+
},
|
|
348
|
+
canCancel: {
|
|
349
|
+
type: [Array, Boolean],
|
|
350
|
+
default: function _default() {
|
|
351
|
+
return config$1.defaultModalCanCancel;
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
onCancel: {
|
|
355
|
+
type: Function,
|
|
356
|
+
default: function _default() {}
|
|
357
|
+
},
|
|
358
|
+
scroll: {
|
|
359
|
+
type: String,
|
|
360
|
+
default: function _default() {
|
|
361
|
+
return config$1.defaultModalScroll ? config$1.defaultModalScroll : 'clip';
|
|
362
|
+
},
|
|
363
|
+
validator: function validator(value) {
|
|
364
|
+
return ['clip', 'keep'].indexOf(value) >= 0;
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
fullScreen: Boolean,
|
|
368
|
+
customClass: String
|
|
369
|
+
},
|
|
370
|
+
data: function data() {
|
|
371
|
+
return {
|
|
372
|
+
isActive: this.active || false,
|
|
373
|
+
savedScrollTop: null,
|
|
374
|
+
newWidth: typeof this.width === 'number' ? this.width + 'px' : this.width
|
|
375
|
+
};
|
|
376
|
+
},
|
|
377
|
+
computed: {
|
|
378
|
+
cancelOptions: function cancelOptions() {
|
|
379
|
+
return typeof this.canCancel === 'boolean' ? this.canCancel ? config$1.defaultModalCanCancel : [] : this.canCancel;
|
|
380
|
+
},
|
|
381
|
+
showX: function showX() {
|
|
382
|
+
return this.cancelOptions.indexOf('x') >= 0;
|
|
383
|
+
},
|
|
384
|
+
customStyle: function customStyle() {
|
|
385
|
+
if (!this.fullScreen) {
|
|
386
|
+
return {
|
|
387
|
+
maxWidth: this.newWidth
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return null;
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
watch: {
|
|
395
|
+
active: function active(value) {
|
|
396
|
+
this.isActive = value;
|
|
397
|
+
},
|
|
398
|
+
isActive: function isActive() {
|
|
399
|
+
this.handleScroll();
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
methods: {
|
|
403
|
+
handleScroll: function handleScroll() {
|
|
404
|
+
if (typeof window === 'undefined') return;
|
|
405
|
+
|
|
406
|
+
if (this.scroll === 'clip') {
|
|
407
|
+
if (this.isActive) {
|
|
408
|
+
document.documentElement.classList.add('is-clipped');
|
|
409
|
+
} else {
|
|
410
|
+
document.documentElement.classList.remove('is-clipped');
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
this.savedScrollTop = !this.savedScrollTop ? document.documentElement.scrollTop : this.savedScrollTop;
|
|
417
|
+
|
|
418
|
+
if (this.isActive) {
|
|
419
|
+
document.body.classList.add('is-noscroll');
|
|
420
|
+
} else {
|
|
421
|
+
document.body.classList.remove('is-noscroll');
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (this.isActive) {
|
|
425
|
+
document.body.style.top = "-".concat(this.savedScrollTop, "px");
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
document.documentElement.scrollTop = this.savedScrollTop;
|
|
430
|
+
document.body.style.top = null;
|
|
431
|
+
this.savedScrollTop = null;
|
|
432
|
+
},
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Close the Modal if canCancel and call the onCancel prop (function).
|
|
436
|
+
*/
|
|
437
|
+
cancel: function cancel(method) {
|
|
438
|
+
if (this.cancelOptions.indexOf(method) < 0) return;
|
|
439
|
+
this.onCancel.apply(null, arguments);
|
|
440
|
+
this.close();
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Call the onCancel prop (function).
|
|
445
|
+
* Emit events, and destroy modal if it's programmatic.
|
|
446
|
+
*/
|
|
447
|
+
close: function close() {
|
|
448
|
+
var _this = this;
|
|
449
|
+
|
|
450
|
+
this.$emit('close');
|
|
451
|
+
this.$emit('update:active', false); // Timeout for the animation complete before destroying
|
|
452
|
+
|
|
453
|
+
if (this.programmatic) {
|
|
454
|
+
this.isActive = false;
|
|
455
|
+
setTimeout(function () {
|
|
456
|
+
_this.$destroy();
|
|
457
|
+
|
|
458
|
+
removeElement(_this.$el);
|
|
459
|
+
}, 150);
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Keypress event that is bound to the document.
|
|
465
|
+
*/
|
|
466
|
+
keyPress: function keyPress(event) {
|
|
467
|
+
// Esc key
|
|
468
|
+
if (this.isActive && event.keyCode === 27) this.cancel('escape');
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
created: function created() {
|
|
472
|
+
if (typeof window !== 'undefined') {
|
|
473
|
+
document.addEventListener('keyup', this.keyPress);
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
beforeMount: function beforeMount() {
|
|
477
|
+
// Insert the Modal component in body tag
|
|
478
|
+
// only if it's programmatic
|
|
479
|
+
this.programmatic && document.body.appendChild(this.$el);
|
|
480
|
+
},
|
|
481
|
+
mounted: function mounted() {
|
|
482
|
+
if (this.programmatic) this.isActive = true;else if (this.isActive) this.handleScroll();
|
|
483
|
+
},
|
|
484
|
+
beforeDestroy: function beforeDestroy() {
|
|
485
|
+
if (typeof window !== 'undefined') {
|
|
486
|
+
document.removeEventListener('keyup', this.keyPress); // reset scroll
|
|
487
|
+
|
|
488
|
+
document.documentElement.classList.remove('is-clipped');
|
|
489
|
+
var savedScrollTop = !this.savedScrollTop ? document.documentElement.scrollTop : this.savedScrollTop;
|
|
490
|
+
document.body.classList.remove('is-noscroll');
|
|
491
|
+
document.documentElement.scrollTop = savedScrollTop;
|
|
492
|
+
document.body.style.top = null;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
/* script */
|
|
498
|
+
const __vue_script__$1 = script$1;
|
|
499
|
+
|
|
500
|
+
/* template */
|
|
501
|
+
var __vue_render__$1 = 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()])};
|
|
502
|
+
var __vue_staticRenderFns__$1 = [];
|
|
503
|
+
|
|
504
|
+
/* style */
|
|
505
|
+
const __vue_inject_styles__$1 = undefined;
|
|
506
|
+
/* scoped */
|
|
507
|
+
const __vue_scope_id__$1 = undefined;
|
|
508
|
+
/* module identifier */
|
|
509
|
+
const __vue_module_identifier__$1 = undefined;
|
|
510
|
+
/* functional template */
|
|
511
|
+
const __vue_is_functional_template__$1 = false;
|
|
512
|
+
/* style inject */
|
|
513
|
+
|
|
514
|
+
/* style inject SSR */
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
var Modal = normalizeComponent_1(
|
|
519
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
520
|
+
__vue_inject_styles__$1,
|
|
521
|
+
__vue_script__$1,
|
|
522
|
+
__vue_scope_id__$1,
|
|
523
|
+
__vue_is_functional_template__$1,
|
|
524
|
+
__vue_module_identifier__$1,
|
|
525
|
+
undefined,
|
|
526
|
+
undefined
|
|
527
|
+
);
|
|
528
|
+
|
|
529
|
+
var script$2 = {
|
|
530
|
+
name: 'BDialog',
|
|
531
|
+
components: _defineProperty({}, Icon.name, Icon),
|
|
532
|
+
extends: Modal,
|
|
533
|
+
props: {
|
|
534
|
+
title: String,
|
|
535
|
+
message: String,
|
|
536
|
+
icon: String,
|
|
537
|
+
iconPack: String,
|
|
538
|
+
hasIcon: Boolean,
|
|
539
|
+
type: {
|
|
540
|
+
type: String,
|
|
541
|
+
default: 'is-primary'
|
|
542
|
+
},
|
|
543
|
+
size: String,
|
|
544
|
+
confirmText: {
|
|
545
|
+
type: String,
|
|
546
|
+
default: function _default() {
|
|
547
|
+
return config$1.defaultDialogConfirmText ? config$1.defaultDialogConfirmText : 'OK';
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
cancelText: {
|
|
551
|
+
type: String,
|
|
552
|
+
default: function _default() {
|
|
553
|
+
return config$1.defaultDialogCancelText ? config$1.defaultDialogCancelText : 'Cancel';
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
hasInput: Boolean,
|
|
557
|
+
// Used internally to know if it's prompt
|
|
558
|
+
inputAttrs: {
|
|
559
|
+
type: Object,
|
|
560
|
+
default: function _default() {
|
|
561
|
+
return {};
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
onConfirm: {
|
|
565
|
+
type: Function,
|
|
566
|
+
default: function _default() {}
|
|
567
|
+
},
|
|
568
|
+
focusOn: {
|
|
569
|
+
type: String,
|
|
570
|
+
default: 'confirm'
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
data: function data() {
|
|
574
|
+
var prompt = this.hasInput ? this.inputAttrs.value || '' : '';
|
|
575
|
+
return {
|
|
576
|
+
prompt: prompt,
|
|
577
|
+
isActive: false,
|
|
578
|
+
validationMessage: ''
|
|
579
|
+
};
|
|
580
|
+
},
|
|
581
|
+
computed: {
|
|
582
|
+
/**
|
|
583
|
+
* Icon name (MDI) based on the type.
|
|
584
|
+
*/
|
|
585
|
+
iconByType: function iconByType() {
|
|
586
|
+
switch (this.type) {
|
|
587
|
+
case 'is-info':
|
|
588
|
+
return 'information';
|
|
589
|
+
|
|
590
|
+
case 'is-success':
|
|
591
|
+
return 'check-circle';
|
|
592
|
+
|
|
593
|
+
case 'is-warning':
|
|
594
|
+
return 'alert';
|
|
595
|
+
|
|
596
|
+
case 'is-danger':
|
|
597
|
+
return 'alert-circle';
|
|
598
|
+
|
|
599
|
+
default:
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
showCancel: function showCancel() {
|
|
604
|
+
return this.cancelOptions.indexOf('button') >= 0;
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
methods: {
|
|
608
|
+
/**
|
|
609
|
+
* If it's a prompt Dialog, validate the input.
|
|
610
|
+
* Call the onConfirm prop (function) and close the Dialog.
|
|
611
|
+
*/
|
|
612
|
+
confirm: function confirm() {
|
|
613
|
+
var _this = this;
|
|
614
|
+
|
|
615
|
+
if (this.$refs.input !== undefined) {
|
|
616
|
+
if (!this.$refs.input.checkValidity()) {
|
|
617
|
+
this.validationMessage = this.$refs.input.validationMessage;
|
|
618
|
+
this.$nextTick(function () {
|
|
619
|
+
return _this.$refs.input.select();
|
|
620
|
+
});
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
this.onConfirm(this.prompt);
|
|
626
|
+
this.close();
|
|
627
|
+
},
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Close the Dialog.
|
|
631
|
+
*/
|
|
632
|
+
close: function close() {
|
|
633
|
+
var _this2 = this;
|
|
634
|
+
|
|
635
|
+
this.isActive = false; // Timeout for the animation complete before destroying
|
|
636
|
+
|
|
637
|
+
setTimeout(function () {
|
|
638
|
+
_this2.$destroy();
|
|
639
|
+
|
|
640
|
+
removeElement(_this2.$el);
|
|
641
|
+
}, 150);
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
beforeMount: function beforeMount() {
|
|
645
|
+
var _this3 = this;
|
|
646
|
+
|
|
647
|
+
// Insert the Dialog component in body tag
|
|
648
|
+
if (typeof window !== 'undefined') {
|
|
649
|
+
this.$nextTick(function () {
|
|
650
|
+
document.body.appendChild(_this3.$el);
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
mounted: function mounted() {
|
|
655
|
+
var _this4 = this;
|
|
656
|
+
|
|
657
|
+
this.isActive = true;
|
|
658
|
+
|
|
659
|
+
if (typeof this.inputAttrs.required === 'undefined') {
|
|
660
|
+
this.$set(this.inputAttrs, 'required', true);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
this.$nextTick(function () {
|
|
664
|
+
// Handle which element receives focus
|
|
665
|
+
if (_this4.hasInput) {
|
|
666
|
+
_this4.$refs.input.focus();
|
|
667
|
+
} else if (_this4.focusOn === 'cancel' && _this4.showCancel) {
|
|
668
|
+
_this4.$refs.cancelButton.focus();
|
|
669
|
+
} else {
|
|
670
|
+
_this4.$refs.confirmButton.focus();
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
/* script */
|
|
677
|
+
const __vue_script__$2 = script$2;
|
|
678
|
+
|
|
679
|
+
/* template */
|
|
680
|
+
var __vue_render__$2 = 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:"dialog modal is-active",class:_vm.size},[_c('div',{staticClass:"modal-background",on:{"click":function($event){_vm.cancel('outside');}}}),_vm._v(" "),_c('div',{staticClass:"modal-card animation-content"},[(_vm.title)?_c('header',{staticClass:"modal-card-head"},[_c('p',{staticClass:"modal-card-title"},[_vm._v(_vm._s(_vm.title))])]):_vm._e(),_vm._v(" "),_c('section',{staticClass:"modal-card-body",class:{ 'is-titleless': !_vm.title, 'is-flex': _vm.hasIcon }},[_c('div',{staticClass:"media"},[(_vm.hasIcon)?_c('div',{staticClass:"media-left"},[_c('b-icon',{attrs:{"icon":_vm.icon ? _vm.icon : _vm.iconByType,"pack":_vm.iconPack,"type":_vm.type,"both":!_vm.icon,"size":"is-large"}})],1):_vm._e(),_vm._v(" "),_c('div',{staticClass:"media-content"},[_c('p',{domProps:{"innerHTML":_vm._s(_vm.message)}}),_vm._v(" "),(_vm.hasInput)?_c('div',{staticClass:"field"},[_c('div',{staticClass:"control"},[_c('input',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.prompt),expression:"prompt"}],ref:"input",staticClass:"input",class:{ 'is-danger': _vm.validationMessage },domProps:{"value":(_vm.prompt)},on:{"keyup":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.confirm($event);},"input":function($event){if($event.target.composing){ return; }_vm.prompt=$event.target.value;}}},'input',_vm.inputAttrs,false))]),_vm._v(" "),_c('p',{staticClass:"help is-danger"},[_vm._v(_vm._s(_vm.validationMessage))])]):_vm._e()])])]),_vm._v(" "),_c('footer',{staticClass:"modal-card-foot"},[(_vm.showCancel)?_c('button',{ref:"cancelButton",staticClass:"button",on:{"click":function($event){_vm.cancel('button');}}},[_vm._v("\n "+_vm._s(_vm.cancelText)+"\n ")]):_vm._e(),_vm._v(" "),_c('button',{ref:"confirmButton",staticClass:"button",class:_vm.type,on:{"click":_vm.confirm}},[_vm._v("\n "+_vm._s(_vm.confirmText)+"\n ")])])])]):_vm._e()])};
|
|
681
|
+
var __vue_staticRenderFns__$2 = [];
|
|
682
|
+
|
|
683
|
+
/* style */
|
|
684
|
+
const __vue_inject_styles__$2 = undefined;
|
|
685
|
+
/* scoped */
|
|
686
|
+
const __vue_scope_id__$2 = undefined;
|
|
687
|
+
/* module identifier */
|
|
688
|
+
const __vue_module_identifier__$2 = undefined;
|
|
689
|
+
/* functional template */
|
|
690
|
+
const __vue_is_functional_template__$2 = false;
|
|
691
|
+
/* style inject */
|
|
692
|
+
|
|
693
|
+
/* style inject SSR */
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
var Dialog = normalizeComponent_1(
|
|
698
|
+
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
|
|
699
|
+
__vue_inject_styles__$2,
|
|
700
|
+
__vue_script__$2,
|
|
701
|
+
__vue_scope_id__$2,
|
|
702
|
+
__vue_is_functional_template__$2,
|
|
703
|
+
__vue_module_identifier__$2,
|
|
704
|
+
undefined,
|
|
705
|
+
undefined
|
|
706
|
+
);
|
|
707
|
+
|
|
708
|
+
var use = function use(plugin) {
|
|
709
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
710
|
+
window.Vue.use(plugin);
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
var registerComponent = function registerComponent(Vue, component) {
|
|
714
|
+
Vue.component(component.name, component);
|
|
715
|
+
};
|
|
716
|
+
var registerComponentProgrammatic = function registerComponentProgrammatic(Vue, property, component) {
|
|
717
|
+
if (!Vue.prototype.$buefy) Vue.prototype.$buefy = {};
|
|
718
|
+
Vue.prototype.$buefy[property] = component;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
function open(propsData) {
|
|
722
|
+
var vm = typeof window !== 'undefined' && window.Vue ? window.Vue : Vue;
|
|
723
|
+
var DialogComponent = vm.extend(Dialog);
|
|
724
|
+
return new DialogComponent({
|
|
725
|
+
el: document.createElement('div'),
|
|
726
|
+
propsData: propsData
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
var DialogProgrammatic = {
|
|
731
|
+
alert: function alert(params) {
|
|
732
|
+
var message;
|
|
733
|
+
if (typeof params === 'string') message = params;
|
|
734
|
+
var defaultParam = {
|
|
735
|
+
canCancel: false,
|
|
736
|
+
message: message
|
|
737
|
+
};
|
|
738
|
+
var propsData = Object.assign(defaultParam, params);
|
|
739
|
+
return open(propsData);
|
|
740
|
+
},
|
|
741
|
+
confirm: function confirm(params) {
|
|
742
|
+
var defaultParam = {};
|
|
743
|
+
var propsData = Object.assign(defaultParam, params);
|
|
744
|
+
return open(propsData);
|
|
745
|
+
},
|
|
746
|
+
prompt: function prompt(params) {
|
|
747
|
+
var defaultParam = {
|
|
748
|
+
hasInput: true,
|
|
749
|
+
confirmText: 'Done'
|
|
750
|
+
};
|
|
751
|
+
var propsData = Object.assign(defaultParam, params);
|
|
752
|
+
return open(propsData);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
var Plugin = {
|
|
756
|
+
install: function install(Vue) {
|
|
757
|
+
registerComponent(Vue, Dialog);
|
|
758
|
+
registerComponentProgrammatic(Vue, 'dialog', DialogProgrammatic);
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
use(Plugin);
|
|
762
|
+
|
|
763
|
+
exports.DialogProgrammatic = DialogProgrammatic;
|
|
764
|
+
exports.default = Plugin;
|
|
765
|
+
|
|
766
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
767
|
+
|
|
768
|
+
}));
|