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,245 @@
|
|
|
1
|
+
import { _ as _defineProperty } from './chunk-d6200087.js';
|
|
2
|
+
import { I as Icon } from './chunk-e84b4047.js';
|
|
3
|
+
import { _ as __vue_normalize__ } from './chunk-cca88db8.js';
|
|
4
|
+
|
|
5
|
+
var script = {
|
|
6
|
+
name: 'BPagination',
|
|
7
|
+
components: _defineProperty({}, Icon.name, Icon),
|
|
8
|
+
props: {
|
|
9
|
+
total: [Number, String],
|
|
10
|
+
perPage: {
|
|
11
|
+
type: [Number, String],
|
|
12
|
+
default: 20
|
|
13
|
+
},
|
|
14
|
+
current: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: 1
|
|
17
|
+
},
|
|
18
|
+
rangeBefore: {
|
|
19
|
+
type: [Number, String],
|
|
20
|
+
default: 1
|
|
21
|
+
},
|
|
22
|
+
rangeAfter: {
|
|
23
|
+
type: [Number, String],
|
|
24
|
+
default: 1
|
|
25
|
+
},
|
|
26
|
+
size: String,
|
|
27
|
+
simple: Boolean,
|
|
28
|
+
rounded: Boolean,
|
|
29
|
+
order: String,
|
|
30
|
+
iconPack: String,
|
|
31
|
+
ariaNextLabel: String,
|
|
32
|
+
ariaPreviousLabel: String,
|
|
33
|
+
ariaPageLabel: String,
|
|
34
|
+
ariaCurrentLabel: String
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
rootClasses: function rootClasses() {
|
|
38
|
+
return [this.order, this.size, {
|
|
39
|
+
'is-simple': this.simple,
|
|
40
|
+
'is-rounded': this.rounded
|
|
41
|
+
}];
|
|
42
|
+
},
|
|
43
|
+
beforeCurrent: function beforeCurrent() {
|
|
44
|
+
return parseInt(this.rangeBefore);
|
|
45
|
+
},
|
|
46
|
+
afterCurrent: function afterCurrent() {
|
|
47
|
+
return parseInt(this.rangeAfter);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Total page size (count).
|
|
52
|
+
*/
|
|
53
|
+
pageCount: function pageCount() {
|
|
54
|
+
return Math.ceil(this.total / this.perPage);
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* First item of the page (count).
|
|
59
|
+
*/
|
|
60
|
+
firstItem: function firstItem() {
|
|
61
|
+
var firstItem = this.current * this.perPage - this.perPage + 1;
|
|
62
|
+
return firstItem >= 0 ? firstItem : 0;
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Check if previous button is available.
|
|
67
|
+
*/
|
|
68
|
+
hasPrev: function hasPrev() {
|
|
69
|
+
return this.current > 1;
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Check if first page button should be visible.
|
|
74
|
+
*/
|
|
75
|
+
hasFirst: function hasFirst() {
|
|
76
|
+
return this.current >= 2 + this.beforeCurrent;
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Check if first ellipsis should be visible.
|
|
81
|
+
*/
|
|
82
|
+
hasFirstEllipsis: function hasFirstEllipsis() {
|
|
83
|
+
return this.current >= this.beforeCurrent + 4;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Check if last page button should be visible.
|
|
88
|
+
*/
|
|
89
|
+
hasLast: function hasLast() {
|
|
90
|
+
return this.current <= this.pageCount - (1 + this.afterCurrent);
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Check if last ellipsis should be visible.
|
|
95
|
+
*/
|
|
96
|
+
hasLastEllipsis: function hasLastEllipsis() {
|
|
97
|
+
return this.current < this.pageCount - (2 + this.afterCurrent);
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Check if next button is available.
|
|
102
|
+
*/
|
|
103
|
+
hasNext: function hasNext() {
|
|
104
|
+
return this.current < this.pageCount;
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get near pages, 1 before and 1 after the current.
|
|
109
|
+
* Also add the click event to the array.
|
|
110
|
+
*/
|
|
111
|
+
pagesInRange: function pagesInRange() {
|
|
112
|
+
var _this = this;
|
|
113
|
+
|
|
114
|
+
if (this.simple) return;
|
|
115
|
+
var left = Math.max(1, this.current - this.beforeCurrent);
|
|
116
|
+
|
|
117
|
+
if (left - 1 === 2) {
|
|
118
|
+
left--; // Do not show the ellipsis if there is only one to hide
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var right = Math.min(this.current + this.afterCurrent, this.pageCount);
|
|
122
|
+
|
|
123
|
+
if (this.pageCount - right === 2) {
|
|
124
|
+
right++; // Do not show the ellipsis if there is only one to hide
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var pages = [];
|
|
128
|
+
|
|
129
|
+
var _loop = function _loop(i) {
|
|
130
|
+
pages.push({
|
|
131
|
+
number: i,
|
|
132
|
+
isCurrent: _this.current === i,
|
|
133
|
+
click: function click(event) {
|
|
134
|
+
if (_this.current === i) return;
|
|
135
|
+
|
|
136
|
+
_this.$emit('change', i);
|
|
137
|
+
|
|
138
|
+
_this.$emit('update:current', i); // Set focus on element to keep tab order
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
_this.$nextTick(function () {
|
|
142
|
+
return event.target.focus();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
for (var i = left; i <= right; i++) {
|
|
149
|
+
_loop(i);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return pages;
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
watch: {
|
|
156
|
+
/**
|
|
157
|
+
* If current page is trying to be greater than page count, set to last.
|
|
158
|
+
*/
|
|
159
|
+
pageCount: function pageCount(value) {
|
|
160
|
+
if (this.current > value) this.last();
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
methods: {
|
|
164
|
+
/**
|
|
165
|
+
* Previous button click listener.
|
|
166
|
+
*/
|
|
167
|
+
prev: function prev() {
|
|
168
|
+
if (!this.hasPrev) return;
|
|
169
|
+
this.$emit('change', this.current - 1);
|
|
170
|
+
this.$emit('update:current', this.current - 1);
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* First button click listener.
|
|
175
|
+
*/
|
|
176
|
+
first: function first() {
|
|
177
|
+
this.$emit('change', 1);
|
|
178
|
+
this.$emit('update:current', 1);
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Last button click listener.
|
|
183
|
+
*/
|
|
184
|
+
last: function last() {
|
|
185
|
+
this.$emit('change', this.pageCount);
|
|
186
|
+
this.$emit('update:current', this.pageCount);
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Next button click listener.
|
|
191
|
+
*/
|
|
192
|
+
next: function next() {
|
|
193
|
+
if (!this.hasNext) return;
|
|
194
|
+
this.$emit('change', this.current + 1);
|
|
195
|
+
this.$emit('update:current', this.current + 1);
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get text for aria-label according to page number.
|
|
200
|
+
*/
|
|
201
|
+
getAriaPageLabel: function getAriaPageLabel(pageNumber, isCurrent) {
|
|
202
|
+
if (this.ariaPageLabel && (!isCurrent || !this.ariaCurrentLabel)) {
|
|
203
|
+
return this.ariaPageLabel + ' ' + pageNumber + '.';
|
|
204
|
+
} else if (this.ariaPageLabel && isCurrent && this.ariaCurrentLabel) {
|
|
205
|
+
return this.ariaCurrentLabel + ', ' + this.ariaPageLabel + ' ' + pageNumber + '.';
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/* script */
|
|
214
|
+
const __vue_script__ = script;
|
|
215
|
+
|
|
216
|
+
/* template */
|
|
217
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',{staticClass:"pagination",class:_vm.rootClasses},[_c('a',{staticClass:"pagination-previous",attrs:{"role":"button","href":"#","disabled":!_vm.hasPrev,"aria-label":_vm.ariaPreviousLabel},on:{"click":function($event){$event.preventDefault();_vm.prev($event);}}},[_c('b-icon',{attrs:{"icon":"chevron-left","pack":_vm.iconPack,"both":"","aria-hidden":"true"}})],1),_vm._v(" "),_c('a',{staticClass:"pagination-next",attrs:{"role":"button","href":"#","disabled":!_vm.hasNext,"aria-label":_vm.ariaNextLabel},on:{"click":function($event){$event.preventDefault();_vm.next($event);}}},[_c('b-icon',{attrs:{"icon":"chevron-right","pack":_vm.iconPack,"both":"","aria-hidden":"true"}})],1),_vm._v(" "),(!_vm.simple)?_c('ul',{staticClass:"pagination-list"},[(_vm.hasFirst)?_c('li',[_c('a',{staticClass:"pagination-link",attrs:{"role":"button","href":"#","aria-label":_vm.getAriaPageLabel(1, false)},on:{"click":function($event){$event.preventDefault();_vm.first($event);}}},[_vm._v("\n 1\n ")])]):_vm._e(),_vm._v(" "),(_vm.hasFirstEllipsis)?_c('li',[_c('span',{staticClass:"pagination-ellipsis"},[_vm._v("…")])]):_vm._e(),_vm._v(" "),_vm._l((_vm.pagesInRange),function(page){return _c('li',{key:page.number},[_c('a',{staticClass:"pagination-link",class:{ 'is-current': page.isCurrent },attrs:{"role":"button","href":"#","aria-label":_vm.getAriaPageLabel(page.number, page.isCurrent),"aria-current":page.isCurrent},on:{"click":function($event){$event.preventDefault();page.click($event);}}},[_vm._v("\n "+_vm._s(page.number)+"\n ")])])}),_vm._v(" "),(_vm.hasLastEllipsis)?_c('li',[_c('span',{staticClass:"pagination-ellipsis"},[_vm._v("…")])]):_vm._e(),_vm._v(" "),(_vm.hasLast)?_c('li',[_c('a',{staticClass:"pagination-link",attrs:{"role":"button","href":"#","aria-label":_vm.getAriaPageLabel(_vm.pageCount, false)},on:{"click":function($event){$event.preventDefault();_vm.last($event);}}},[_vm._v("\n "+_vm._s(_vm.pageCount)+"\n ")])]):_vm._e()],2):_vm._e(),_vm._v(" "),(_vm.simple)?_c('small',{staticClass:"info"},[(_vm.perPage == 1)?[_vm._v("\n "+_vm._s(_vm.firstItem)+" / "+_vm._s(_vm.total)+"\n ")]:[_vm._v("\n "+_vm._s(_vm.firstItem)+"-"+_vm._s(Math.min(_vm.current * _vm.perPage, _vm.total))+" / "+_vm._s(_vm.total)+"\n ")]],2):_vm._e()])};
|
|
218
|
+
var __vue_staticRenderFns__ = [];
|
|
219
|
+
|
|
220
|
+
/* style */
|
|
221
|
+
const __vue_inject_styles__ = undefined;
|
|
222
|
+
/* scoped */
|
|
223
|
+
const __vue_scope_id__ = undefined;
|
|
224
|
+
/* module identifier */
|
|
225
|
+
const __vue_module_identifier__ = undefined;
|
|
226
|
+
/* functional template */
|
|
227
|
+
const __vue_is_functional_template__ = false;
|
|
228
|
+
/* style inject */
|
|
229
|
+
|
|
230
|
+
/* style inject SSR */
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
var Pagination = __vue_normalize__(
|
|
235
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
236
|
+
__vue_inject_styles__,
|
|
237
|
+
__vue_script__,
|
|
238
|
+
__vue_scope_id__,
|
|
239
|
+
__vue_is_functional_template__,
|
|
240
|
+
__vue_module_identifier__,
|
|
241
|
+
undefined,
|
|
242
|
+
undefined
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
export { Pagination as P };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
|
|
2
|
+
/* server only */
|
|
3
|
+
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
|
4
|
+
if (typeof shadowMode !== 'boolean') {
|
|
5
|
+
createInjectorSSR = createInjector;
|
|
6
|
+
createInjector = shadowMode;
|
|
7
|
+
shadowMode = false;
|
|
8
|
+
} // Vue.extend constructor export interop.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var options = typeof script === 'function' ? script.options : script; // render functions
|
|
12
|
+
|
|
13
|
+
if (template && template.render) {
|
|
14
|
+
options.render = template.render;
|
|
15
|
+
options.staticRenderFns = template.staticRenderFns;
|
|
16
|
+
options._compiled = true; // functional template
|
|
17
|
+
|
|
18
|
+
if (isFunctionalTemplate) {
|
|
19
|
+
options.functional = true;
|
|
20
|
+
}
|
|
21
|
+
} // scopedId
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if (scopeId) {
|
|
25
|
+
options._scopeId = scopeId;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var hook;
|
|
29
|
+
|
|
30
|
+
if (moduleIdentifier) {
|
|
31
|
+
// server build
|
|
32
|
+
hook = function hook(context) {
|
|
33
|
+
// 2.3 injection
|
|
34
|
+
context = context || // cached call
|
|
35
|
+
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
36
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
|
|
37
|
+
// 2.2 with runInNewContext: true
|
|
38
|
+
|
|
39
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
40
|
+
context = __VUE_SSR_CONTEXT__;
|
|
41
|
+
} // inject component styles
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if (style) {
|
|
45
|
+
style.call(this, createInjectorSSR(context));
|
|
46
|
+
} // register component module identifier for async chunk inference
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if (context && context._registeredComponents) {
|
|
50
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
51
|
+
}
|
|
52
|
+
}; // used by ssr in case component is cached and beforeCreate
|
|
53
|
+
// never gets called
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
options._ssrRegister = hook;
|
|
57
|
+
} else if (style) {
|
|
58
|
+
hook = shadowMode ? function () {
|
|
59
|
+
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
|
|
60
|
+
} : function (context) {
|
|
61
|
+
style.call(this, createInjector(context));
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (hook) {
|
|
66
|
+
if (options.functional) {
|
|
67
|
+
// register for functional component in vue file
|
|
68
|
+
var originalRender = options.render;
|
|
69
|
+
|
|
70
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
71
|
+
hook.call(context);
|
|
72
|
+
return originalRender(h, context);
|
|
73
|
+
};
|
|
74
|
+
} else {
|
|
75
|
+
// inject component registration as beforeCreate hook
|
|
76
|
+
var existing = options.beforeCreate;
|
|
77
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return script;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var normalizeComponent_1 = normalizeComponent;
|
|
85
|
+
|
|
86
|
+
var use = function use(plugin) {
|
|
87
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
88
|
+
window.Vue.use(plugin);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var registerComponent = function registerComponent(Vue, component) {
|
|
92
|
+
Vue.component(component.name, component);
|
|
93
|
+
};
|
|
94
|
+
var registerComponentProgrammatic = function registerComponentProgrammatic(Vue, property, component) {
|
|
95
|
+
if (!Vue.prototype.$buefy) Vue.prototype.$buefy = {};
|
|
96
|
+
Vue.prototype.$buefy[property] = component;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export { normalizeComponent_1 as _, registerComponentProgrammatic as a, registerComponent as r, use as u };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function _typeof(obj) {
|
|
2
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
3
|
+
_typeof = function (obj) {
|
|
4
|
+
return typeof obj;
|
|
5
|
+
};
|
|
6
|
+
} else {
|
|
7
|
+
_typeof = function (obj) {
|
|
8
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return _typeof(obj);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function _defineProperty(obj, key, value) {
|
|
16
|
+
if (key in obj) {
|
|
17
|
+
Object.defineProperty(obj, key, {
|
|
18
|
+
value: value,
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true
|
|
22
|
+
});
|
|
23
|
+
} else {
|
|
24
|
+
obj[key] = value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function _toConsumableArray(arr) {
|
|
31
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _arrayWithoutHoles(arr) {
|
|
35
|
+
if (Array.isArray(arr)) {
|
|
36
|
+
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
37
|
+
|
|
38
|
+
return arr2;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _iterableToArray(iter) {
|
|
43
|
+
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _nonIterableSpread() {
|
|
47
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { _defineProperty as _, _typeof as a, _toConsumableArray as b };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { r as removeElement } from './chunk-e5fce48f.js';
|
|
2
|
+
import { c as config } from './chunk-9e3207cc.js';
|
|
3
|
+
|
|
4
|
+
var NoticeMixin = {
|
|
5
|
+
props: {
|
|
6
|
+
type: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'is-dark'
|
|
9
|
+
},
|
|
10
|
+
message: String,
|
|
11
|
+
duration: Number,
|
|
12
|
+
queue: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: undefined
|
|
15
|
+
},
|
|
16
|
+
position: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'is-top',
|
|
19
|
+
validator: function validator(value) {
|
|
20
|
+
return ['is-top-right', 'is-top', 'is-top-left', 'is-bottom-right', 'is-bottom', 'is-bottom-left'].indexOf(value) > -1;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
container: String
|
|
24
|
+
},
|
|
25
|
+
data: function data() {
|
|
26
|
+
return {
|
|
27
|
+
isActive: false,
|
|
28
|
+
parentTop: null,
|
|
29
|
+
parentBottom: null,
|
|
30
|
+
newContainer: this.container || config.defaultContainerElement
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
computed: {
|
|
34
|
+
correctParent: function correctParent() {
|
|
35
|
+
switch (this.position) {
|
|
36
|
+
case 'is-top-right':
|
|
37
|
+
case 'is-top':
|
|
38
|
+
case 'is-top-left':
|
|
39
|
+
return this.parentTop;
|
|
40
|
+
|
|
41
|
+
case 'is-bottom-right':
|
|
42
|
+
case 'is-bottom':
|
|
43
|
+
case 'is-bottom-left':
|
|
44
|
+
return this.parentBottom;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
transition: function transition() {
|
|
48
|
+
switch (this.position) {
|
|
49
|
+
case 'is-top-right':
|
|
50
|
+
case 'is-top':
|
|
51
|
+
case 'is-top-left':
|
|
52
|
+
return {
|
|
53
|
+
enter: 'fadeInDown',
|
|
54
|
+
leave: 'fadeOut'
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
case 'is-bottom-right':
|
|
58
|
+
case 'is-bottom':
|
|
59
|
+
case 'is-bottom-left':
|
|
60
|
+
return {
|
|
61
|
+
enter: 'fadeInUp',
|
|
62
|
+
leave: 'fadeOut'
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
shouldQueue: function shouldQueue() {
|
|
69
|
+
var queue = this.queue !== undefined ? this.queue : config.defaultNoticeQueue;
|
|
70
|
+
if (!queue) return false;
|
|
71
|
+
return this.parentTop.childElementCount > 0 || this.parentBottom.childElementCount > 0;
|
|
72
|
+
},
|
|
73
|
+
close: function close() {
|
|
74
|
+
var _this = this;
|
|
75
|
+
|
|
76
|
+
clearTimeout(this.timer);
|
|
77
|
+
this.isActive = false; // Timeout for the animation complete before destroying
|
|
78
|
+
|
|
79
|
+
setTimeout(function () {
|
|
80
|
+
_this.$destroy();
|
|
81
|
+
|
|
82
|
+
removeElement(_this.$el);
|
|
83
|
+
}, 150);
|
|
84
|
+
},
|
|
85
|
+
showNotice: function showNotice() {
|
|
86
|
+
var _this2 = this;
|
|
87
|
+
|
|
88
|
+
if (this.shouldQueue()) {
|
|
89
|
+
// Call recursively if should queue
|
|
90
|
+
setTimeout(function () {
|
|
91
|
+
return _this2.showNotice();
|
|
92
|
+
}, 250);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.correctParent.insertAdjacentElement('afterbegin', this.$el);
|
|
97
|
+
this.isActive = true;
|
|
98
|
+
|
|
99
|
+
if (!this.indefinite) {
|
|
100
|
+
this.timer = setTimeout(function () {
|
|
101
|
+
return _this2.close();
|
|
102
|
+
}, this.newDuration);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
setupContainer: function setupContainer() {
|
|
106
|
+
this.parentTop = document.querySelector('.notices.is-top');
|
|
107
|
+
this.parentBottom = document.querySelector('.notices.is-bottom');
|
|
108
|
+
if (this.parentTop && this.parentBottom) return;
|
|
109
|
+
|
|
110
|
+
if (!this.parentTop) {
|
|
111
|
+
this.parentTop = document.createElement('div');
|
|
112
|
+
this.parentTop.className = 'notices is-top';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!this.parentBottom) {
|
|
116
|
+
this.parentBottom = document.createElement('div');
|
|
117
|
+
this.parentBottom.className = 'notices is-bottom';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var container = document.querySelector(this.newContainer) || document.body;
|
|
121
|
+
container.appendChild(this.parentTop);
|
|
122
|
+
container.appendChild(this.parentBottom);
|
|
123
|
+
|
|
124
|
+
if (this.newContainer) {
|
|
125
|
+
this.parentTop.classList.add('has-custom-container');
|
|
126
|
+
this.parentBottom.classList.add('has-custom-container');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
beforeMount: function beforeMount() {
|
|
131
|
+
this.setupContainer();
|
|
132
|
+
},
|
|
133
|
+
mounted: function mounted() {
|
|
134
|
+
this.showNotice();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export { NoticeMixin as N };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { _ as _defineProperty } from './chunk-d6200087.js';
|
|
2
|
+
import { I as Icon } from './chunk-4d393f09.js';
|
|
3
|
+
|
|
4
|
+
var MessageMixin = {
|
|
5
|
+
components: _defineProperty({}, Icon.name, Icon),
|
|
6
|
+
props: {
|
|
7
|
+
active: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: true
|
|
10
|
+
},
|
|
11
|
+
title: String,
|
|
12
|
+
closable: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: true
|
|
15
|
+
},
|
|
16
|
+
message: String,
|
|
17
|
+
type: String,
|
|
18
|
+
hasIcon: Boolean,
|
|
19
|
+
size: String,
|
|
20
|
+
iconPack: String,
|
|
21
|
+
iconSize: String,
|
|
22
|
+
autoClose: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
duration: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 2000
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
data: function data() {
|
|
32
|
+
return {
|
|
33
|
+
isActive: this.active
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
watch: {
|
|
37
|
+
active: function active(value) {
|
|
38
|
+
this.isActive = value;
|
|
39
|
+
},
|
|
40
|
+
isActive: function isActive(value) {
|
|
41
|
+
if (value) {
|
|
42
|
+
this.setAutoClose();
|
|
43
|
+
} else {
|
|
44
|
+
if (this.timer) {
|
|
45
|
+
clearTimeout(this.timer);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
/**
|
|
52
|
+
* Icon name (MDI) based on type.
|
|
53
|
+
*/
|
|
54
|
+
icon: function icon() {
|
|
55
|
+
switch (this.type) {
|
|
56
|
+
case 'is-info':
|
|
57
|
+
return 'information';
|
|
58
|
+
|
|
59
|
+
case 'is-success':
|
|
60
|
+
return 'check-circle';
|
|
61
|
+
|
|
62
|
+
case 'is-warning':
|
|
63
|
+
return 'alert';
|
|
64
|
+
|
|
65
|
+
case 'is-danger':
|
|
66
|
+
return 'alert-circle';
|
|
67
|
+
|
|
68
|
+
default:
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
/**
|
|
75
|
+
* Close the Message and emit events.
|
|
76
|
+
*/
|
|
77
|
+
close: function close() {
|
|
78
|
+
this.isActive = false;
|
|
79
|
+
this.$emit('close');
|
|
80
|
+
this.$emit('update:active', false);
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Set timer to auto close message
|
|
85
|
+
*/
|
|
86
|
+
setAutoClose: function setAutoClose() {
|
|
87
|
+
var _this = this;
|
|
88
|
+
|
|
89
|
+
if (this.autoClose) {
|
|
90
|
+
this.timer = setTimeout(function () {
|
|
91
|
+
if (_this.isActive) {
|
|
92
|
+
_this.close();
|
|
93
|
+
}
|
|
94
|
+
}, this.duration);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
mounted: function mounted() {
|
|
99
|
+
this.setAutoClose();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { MessageMixin as M };
|