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,247 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __chunk_1 = require('./chunk-9f6a8079.js');
|
|
4
|
+
var __chunk_5 = require('./chunk-28d164b1.js');
|
|
5
|
+
var __chunk_6 = require('./chunk-3b066933.js');
|
|
6
|
+
|
|
7
|
+
var script = {
|
|
8
|
+
name: 'BPagination',
|
|
9
|
+
components: __chunk_1._defineProperty({}, __chunk_5.Icon.name, __chunk_5.Icon),
|
|
10
|
+
props: {
|
|
11
|
+
total: [Number, String],
|
|
12
|
+
perPage: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
default: 20
|
|
15
|
+
},
|
|
16
|
+
current: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: 1
|
|
19
|
+
},
|
|
20
|
+
rangeBefore: {
|
|
21
|
+
type: [Number, String],
|
|
22
|
+
default: 1
|
|
23
|
+
},
|
|
24
|
+
rangeAfter: {
|
|
25
|
+
type: [Number, String],
|
|
26
|
+
default: 1
|
|
27
|
+
},
|
|
28
|
+
size: String,
|
|
29
|
+
simple: Boolean,
|
|
30
|
+
rounded: Boolean,
|
|
31
|
+
order: String,
|
|
32
|
+
iconPack: String,
|
|
33
|
+
ariaNextLabel: String,
|
|
34
|
+
ariaPreviousLabel: String,
|
|
35
|
+
ariaPageLabel: String,
|
|
36
|
+
ariaCurrentLabel: String
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
rootClasses: function rootClasses() {
|
|
40
|
+
return [this.order, this.size, {
|
|
41
|
+
'is-simple': this.simple,
|
|
42
|
+
'is-rounded': this.rounded
|
|
43
|
+
}];
|
|
44
|
+
},
|
|
45
|
+
beforeCurrent: function beforeCurrent() {
|
|
46
|
+
return parseInt(this.rangeBefore);
|
|
47
|
+
},
|
|
48
|
+
afterCurrent: function afterCurrent() {
|
|
49
|
+
return parseInt(this.rangeAfter);
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Total page size (count).
|
|
54
|
+
*/
|
|
55
|
+
pageCount: function pageCount() {
|
|
56
|
+
return Math.ceil(this.total / this.perPage);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* First item of the page (count).
|
|
61
|
+
*/
|
|
62
|
+
firstItem: function firstItem() {
|
|
63
|
+
var firstItem = this.current * this.perPage - this.perPage + 1;
|
|
64
|
+
return firstItem >= 0 ? firstItem : 0;
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Check if previous button is available.
|
|
69
|
+
*/
|
|
70
|
+
hasPrev: function hasPrev() {
|
|
71
|
+
return this.current > 1;
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Check if first page button should be visible.
|
|
76
|
+
*/
|
|
77
|
+
hasFirst: function hasFirst() {
|
|
78
|
+
return this.current >= 2 + this.beforeCurrent;
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Check if first ellipsis should be visible.
|
|
83
|
+
*/
|
|
84
|
+
hasFirstEllipsis: function hasFirstEllipsis() {
|
|
85
|
+
return this.current >= this.beforeCurrent + 4;
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Check if last page button should be visible.
|
|
90
|
+
*/
|
|
91
|
+
hasLast: function hasLast() {
|
|
92
|
+
return this.current <= this.pageCount - (1 + this.afterCurrent);
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if last ellipsis should be visible.
|
|
97
|
+
*/
|
|
98
|
+
hasLastEllipsis: function hasLastEllipsis() {
|
|
99
|
+
return this.current < this.pageCount - (2 + this.afterCurrent);
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Check if next button is available.
|
|
104
|
+
*/
|
|
105
|
+
hasNext: function hasNext() {
|
|
106
|
+
return this.current < this.pageCount;
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get near pages, 1 before and 1 after the current.
|
|
111
|
+
* Also add the click event to the array.
|
|
112
|
+
*/
|
|
113
|
+
pagesInRange: function pagesInRange() {
|
|
114
|
+
var _this = this;
|
|
115
|
+
|
|
116
|
+
if (this.simple) return;
|
|
117
|
+
var left = Math.max(1, this.current - this.beforeCurrent);
|
|
118
|
+
|
|
119
|
+
if (left - 1 === 2) {
|
|
120
|
+
left--; // Do not show the ellipsis if there is only one to hide
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var right = Math.min(this.current + this.afterCurrent, this.pageCount);
|
|
124
|
+
|
|
125
|
+
if (this.pageCount - right === 2) {
|
|
126
|
+
right++; // Do not show the ellipsis if there is only one to hide
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var pages = [];
|
|
130
|
+
|
|
131
|
+
var _loop = function _loop(i) {
|
|
132
|
+
pages.push({
|
|
133
|
+
number: i,
|
|
134
|
+
isCurrent: _this.current === i,
|
|
135
|
+
click: function click(event) {
|
|
136
|
+
if (_this.current === i) return;
|
|
137
|
+
|
|
138
|
+
_this.$emit('change', i);
|
|
139
|
+
|
|
140
|
+
_this.$emit('update:current', i); // Set focus on element to keep tab order
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
_this.$nextTick(function () {
|
|
144
|
+
return event.target.focus();
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
for (var i = left; i <= right; i++) {
|
|
151
|
+
_loop(i);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return pages;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
watch: {
|
|
158
|
+
/**
|
|
159
|
+
* If current page is trying to be greater than page count, set to last.
|
|
160
|
+
*/
|
|
161
|
+
pageCount: function pageCount(value) {
|
|
162
|
+
if (this.current > value) this.last();
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
methods: {
|
|
166
|
+
/**
|
|
167
|
+
* Previous button click listener.
|
|
168
|
+
*/
|
|
169
|
+
prev: function prev() {
|
|
170
|
+
if (!this.hasPrev) return;
|
|
171
|
+
this.$emit('change', this.current - 1);
|
|
172
|
+
this.$emit('update:current', this.current - 1);
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* First button click listener.
|
|
177
|
+
*/
|
|
178
|
+
first: function first() {
|
|
179
|
+
this.$emit('change', 1);
|
|
180
|
+
this.$emit('update:current', 1);
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Last button click listener.
|
|
185
|
+
*/
|
|
186
|
+
last: function last() {
|
|
187
|
+
this.$emit('change', this.pageCount);
|
|
188
|
+
this.$emit('update:current', this.pageCount);
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Next button click listener.
|
|
193
|
+
*/
|
|
194
|
+
next: function next() {
|
|
195
|
+
if (!this.hasNext) return;
|
|
196
|
+
this.$emit('change', this.current + 1);
|
|
197
|
+
this.$emit('update:current', this.current + 1);
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get text for aria-label according to page number.
|
|
202
|
+
*/
|
|
203
|
+
getAriaPageLabel: function getAriaPageLabel(pageNumber, isCurrent) {
|
|
204
|
+
if (this.ariaPageLabel && (!isCurrent || !this.ariaCurrentLabel)) {
|
|
205
|
+
return this.ariaPageLabel + ' ' + pageNumber + '.';
|
|
206
|
+
} else if (this.ariaPageLabel && isCurrent && this.ariaCurrentLabel) {
|
|
207
|
+
return this.ariaCurrentLabel + ', ' + this.ariaPageLabel + ' ' + pageNumber + '.';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
/* script */
|
|
216
|
+
const __vue_script__ = script;
|
|
217
|
+
|
|
218
|
+
/* template */
|
|
219
|
+
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()])};
|
|
220
|
+
var __vue_staticRenderFns__ = [];
|
|
221
|
+
|
|
222
|
+
/* style */
|
|
223
|
+
const __vue_inject_styles__ = undefined;
|
|
224
|
+
/* scoped */
|
|
225
|
+
const __vue_scope_id__ = undefined;
|
|
226
|
+
/* module identifier */
|
|
227
|
+
const __vue_module_identifier__ = undefined;
|
|
228
|
+
/* functional template */
|
|
229
|
+
const __vue_is_functional_template__ = false;
|
|
230
|
+
/* style inject */
|
|
231
|
+
|
|
232
|
+
/* style inject SSR */
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
var Pagination = __chunk_6.__vue_normalize__(
|
|
237
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
238
|
+
__vue_inject_styles__,
|
|
239
|
+
__vue_script__,
|
|
240
|
+
__vue_scope_id__,
|
|
241
|
+
__vue_is_functional_template__,
|
|
242
|
+
__vue_module_identifier__,
|
|
243
|
+
undefined,
|
|
244
|
+
undefined
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
exports.Pagination = Pagination;
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var __chunk_1 = require('./chunk-9f6a8079.js');
|
|
6
|
+
require('./chunk-59b91990.js');
|
|
7
|
+
require('./chunk-545f01b1.js');
|
|
8
|
+
require('./chunk-c146745e.js');
|
|
9
|
+
var __chunk_5 = require('./chunk-60061aa8.js');
|
|
10
|
+
var __chunk_6 = require('./chunk-13e039f5.js');
|
|
11
|
+
var __chunk_7 = require('./chunk-f0c597f9.js');
|
|
12
|
+
var __chunk_10 = require('./chunk-c2aec7a9.js');
|
|
13
|
+
var __chunk_11 = require('./chunk-544a95da.js');
|
|
14
|
+
var __chunk_12 = require('./chunk-ef4753d5.js');
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
//
|
|
26
|
+
//
|
|
27
|
+
//
|
|
28
|
+
//
|
|
29
|
+
//
|
|
30
|
+
//
|
|
31
|
+
//
|
|
32
|
+
//
|
|
33
|
+
//
|
|
34
|
+
//
|
|
35
|
+
//
|
|
36
|
+
//
|
|
37
|
+
//
|
|
38
|
+
//
|
|
39
|
+
//
|
|
40
|
+
//
|
|
41
|
+
//
|
|
42
|
+
//
|
|
43
|
+
// These should match the variables in clockpicker.scss
|
|
44
|
+
var indicatorSize = 40;
|
|
45
|
+
var paddingInner = 5;
|
|
46
|
+
var script = {
|
|
47
|
+
name: 'BClockpickerFace',
|
|
48
|
+
props: {
|
|
49
|
+
pickerSize: Number,
|
|
50
|
+
min: Number,
|
|
51
|
+
max: Number,
|
|
52
|
+
double: Boolean,
|
|
53
|
+
value: Number,
|
|
54
|
+
faceNumbers: Array,
|
|
55
|
+
disabledValues: Function
|
|
56
|
+
},
|
|
57
|
+
data: function data() {
|
|
58
|
+
return {
|
|
59
|
+
isDragging: false,
|
|
60
|
+
inputValue: this.value,
|
|
61
|
+
prevAngle: 720
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
computed: {
|
|
65
|
+
/**
|
|
66
|
+
* How many number indicators are shown on the face
|
|
67
|
+
*/
|
|
68
|
+
count: function count() {
|
|
69
|
+
return this.max - this.min + 1;
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* How many number indicators are shown per ring on the face
|
|
74
|
+
*/
|
|
75
|
+
countPerRing: function countPerRing() {
|
|
76
|
+
return this.double ? this.count / 2 : this.count;
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Radius of the clock face
|
|
81
|
+
*/
|
|
82
|
+
radius: function radius() {
|
|
83
|
+
return this.pickerSize / 2;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Radius of the outer ring of number indicators
|
|
88
|
+
*/
|
|
89
|
+
outerRadius: function outerRadius() {
|
|
90
|
+
return this.radius - paddingInner - indicatorSize / 2;
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Radius of the inner ring of number indicators
|
|
95
|
+
*/
|
|
96
|
+
innerRadius: function innerRadius() {
|
|
97
|
+
return Math.max(this.outerRadius * 0.6, this.outerRadius - paddingInner - indicatorSize); // 48px gives enough room for the outer ring of numbers
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The angle for each selectable value
|
|
102
|
+
* For hours this ends up being 30 degrees, for minutes 6 degrees
|
|
103
|
+
*/
|
|
104
|
+
degreesPerUnit: function degreesPerUnit() {
|
|
105
|
+
return 360 / this.countPerRing;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Used for calculating x/y grid location based on degrees
|
|
110
|
+
*/
|
|
111
|
+
degrees: function degrees() {
|
|
112
|
+
return this.degreesPerUnit * Math.PI / 180;
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Calculates the angle the clock hand should be rotated for the
|
|
117
|
+
* selected value
|
|
118
|
+
*/
|
|
119
|
+
handRotateAngle: function handRotateAngle() {
|
|
120
|
+
var currentAngle = this.prevAngle;
|
|
121
|
+
|
|
122
|
+
while (currentAngle < 0) {
|
|
123
|
+
currentAngle += 360;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var targetAngle = this.calcHandAngle(this.displayedValue);
|
|
127
|
+
var degreesDiff = this.shortestDistanceDegrees(currentAngle, targetAngle);
|
|
128
|
+
var angle = this.prevAngle + degreesDiff;
|
|
129
|
+
return angle;
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Determines how long the selector hand is based on if the
|
|
134
|
+
* selected value is located along the outer or inner ring
|
|
135
|
+
*/
|
|
136
|
+
handScale: function handScale() {
|
|
137
|
+
return this.calcHandScale(this.displayedValue);
|
|
138
|
+
},
|
|
139
|
+
handStyle: function handStyle() {
|
|
140
|
+
return {
|
|
141
|
+
transform: "rotate(".concat(this.handRotateAngle, "deg) scaleY(").concat(this.handScale, ")"),
|
|
142
|
+
transition: '.3s cubic-bezier(.25,.8,.50,1)'
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The value the hand should be pointing at
|
|
148
|
+
*/
|
|
149
|
+
displayedValue: function displayedValue() {
|
|
150
|
+
return this.inputValue == null ? this.min : this.inputValue;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
watch: {
|
|
154
|
+
value: function value(_value) {
|
|
155
|
+
if (_value !== this.inputValue) {
|
|
156
|
+
this.prevAngle = this.handRotateAngle;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
this.inputValue = _value;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
methods: {
|
|
163
|
+
isDisabled: function isDisabled(value) {
|
|
164
|
+
return this.disabledValues && this.disabledValues(value);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Calculates the distance between two points
|
|
169
|
+
*/
|
|
170
|
+
euclidean: function euclidean(p0, p1) {
|
|
171
|
+
var dx = p1.x - p0.x;
|
|
172
|
+
var dy = p1.y - p0.y;
|
|
173
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
174
|
+
},
|
|
175
|
+
shortestDistanceDegrees: function shortestDistanceDegrees(start, stop) {
|
|
176
|
+
var modDiff = (stop - start) % 360;
|
|
177
|
+
var shortestDistance = 180 - Math.abs(Math.abs(modDiff) - 180);
|
|
178
|
+
return (modDiff + 360) % 360 < 180 ? shortestDistance * 1 : shortestDistance * -1;
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Calculates the angle of the line from the center point
|
|
183
|
+
* to the given point.
|
|
184
|
+
*/
|
|
185
|
+
coordToAngle: function coordToAngle(center, p1) {
|
|
186
|
+
var value = 2 * Math.atan2(p1.y - center.y - this.euclidean(center, p1), p1.x - center.x);
|
|
187
|
+
return Math.abs(value * 180 / Math.PI);
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Generates the inline style translate() property for a
|
|
192
|
+
* number indicator, which determines it's location on the
|
|
193
|
+
* clock face
|
|
194
|
+
*/
|
|
195
|
+
getNumberTranslate: function getNumberTranslate(value) {
|
|
196
|
+
var _this$getNumberCoords = this.getNumberCoords(value),
|
|
197
|
+
x = _this$getNumberCoords.x,
|
|
198
|
+
y = _this$getNumberCoords.y;
|
|
199
|
+
|
|
200
|
+
return "translate(".concat(x, "px, ").concat(y, "px)");
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
/***
|
|
204
|
+
* Calculates the coordinates on the clock face for a number
|
|
205
|
+
* indicator value
|
|
206
|
+
*/
|
|
207
|
+
getNumberCoords: function getNumberCoords(value) {
|
|
208
|
+
var radius = this.isInnerRing(value) ? this.innerRadius : this.outerRadius;
|
|
209
|
+
return {
|
|
210
|
+
x: Math.round(radius * Math.sin((value - this.min) * this.degrees)),
|
|
211
|
+
y: Math.round(-radius * Math.cos((value - this.min) * this.degrees))
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
getFaceNumberClasses: function getFaceNumberClasses(num) {
|
|
215
|
+
return {
|
|
216
|
+
'active': num.value === this.displayedValue,
|
|
217
|
+
'disabled': this.isDisabled(num.value)
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Determines if a value resides on the inner ring
|
|
223
|
+
*/
|
|
224
|
+
isInnerRing: function isInnerRing(value) {
|
|
225
|
+
return this.double && value - this.min >= this.countPerRing;
|
|
226
|
+
},
|
|
227
|
+
calcHandAngle: function calcHandAngle(value) {
|
|
228
|
+
var angle = this.degreesPerUnit * (value - this.min);
|
|
229
|
+
if (this.isInnerRing(value)) angle -= 360;
|
|
230
|
+
return angle;
|
|
231
|
+
},
|
|
232
|
+
calcHandScale: function calcHandScale(value) {
|
|
233
|
+
return this.isInnerRing(value) ? this.innerRadius / this.outerRadius : 1;
|
|
234
|
+
},
|
|
235
|
+
onMouseDown: function onMouseDown(e) {
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
this.isDragging = true;
|
|
238
|
+
this.onDragMove(e);
|
|
239
|
+
},
|
|
240
|
+
onMouseUp: function onMouseUp() {
|
|
241
|
+
this.isDragging = false;
|
|
242
|
+
|
|
243
|
+
if (!this.isDisabled(this.inputValue)) {
|
|
244
|
+
this.$emit('change', this.inputValue);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
onDragMove: function onDragMove(e) {
|
|
248
|
+
e.preventDefault();
|
|
249
|
+
if (!this.isDragging && e.type !== 'click') return;
|
|
250
|
+
|
|
251
|
+
var _this$$refs$clock$get = this.$refs.clock.getBoundingClientRect(),
|
|
252
|
+
width = _this$$refs$clock$get.width,
|
|
253
|
+
top = _this$$refs$clock$get.top,
|
|
254
|
+
left = _this$$refs$clock$get.left;
|
|
255
|
+
|
|
256
|
+
var _ref = 'touches' in e ? e.touches[0] : e,
|
|
257
|
+
clientX = _ref.clientX,
|
|
258
|
+
clientY = _ref.clientY;
|
|
259
|
+
|
|
260
|
+
var center = {
|
|
261
|
+
x: width / 2,
|
|
262
|
+
y: -width / 2
|
|
263
|
+
};
|
|
264
|
+
var coords = {
|
|
265
|
+
x: clientX - left,
|
|
266
|
+
y: top - clientY
|
|
267
|
+
};
|
|
268
|
+
var handAngle = Math.round(this.coordToAngle(center, coords) + 360) % 360;
|
|
269
|
+
var insideClick = this.double && this.euclidean(center, coords) < (this.outerRadius + this.innerRadius) / 2 - 16;
|
|
270
|
+
var value = Math.round(handAngle / this.degreesPerUnit) + this.min + (insideClick ? this.countPerRing : 0); // Necessary to fix edge case when selecting left part of max value
|
|
271
|
+
|
|
272
|
+
if (handAngle >= 360 - this.degreesPerUnit / 2) {
|
|
273
|
+
value = insideClick ? this.max : this.min;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
this.update(value);
|
|
277
|
+
},
|
|
278
|
+
update: function update(value) {
|
|
279
|
+
if (this.inputValue !== value && !this.isDisabled(value)) {
|
|
280
|
+
this.prevAngle = this.handRotateAngle;
|
|
281
|
+
this.inputValue = value;
|
|
282
|
+
this.$emit('input', value);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/* script */
|
|
289
|
+
const __vue_script__ = script;
|
|
290
|
+
|
|
291
|
+
/* template */
|
|
292
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-clockpicker-face",on:{"mousedown":_vm.onMouseDown,"mouseup":_vm.onMouseUp,"mousemove":_vm.onDragMove,"touchstart":_vm.onMouseDown,"touchend":_vm.onMouseUp,"touchmove":_vm.onDragMove}},[_c('div',{ref:"clock",staticClass:"b-clockpicker-face-outer-ring"},[_c('div',{staticClass:"b-clockpicker-face-hand",style:(_vm.handStyle)}),_vm._v(" "),_vm._l((_vm.faceNumbers),function(num,index){return _c('span',{key:index,staticClass:"b-clockpicker-face-number",class:_vm.getFaceNumberClasses(num),style:({ transform: _vm.getNumberTranslate(num.value) })},[_c('span',[_vm._v(_vm._s(num.label))])])})],2)])};
|
|
293
|
+
var __vue_staticRenderFns__ = [];
|
|
294
|
+
|
|
295
|
+
/* style */
|
|
296
|
+
const __vue_inject_styles__ = undefined;
|
|
297
|
+
/* scoped */
|
|
298
|
+
const __vue_scope_id__ = undefined;
|
|
299
|
+
/* module identifier */
|
|
300
|
+
const __vue_module_identifier__ = undefined;
|
|
301
|
+
/* functional template */
|
|
302
|
+
const __vue_is_functional_template__ = false;
|
|
303
|
+
/* style inject */
|
|
304
|
+
|
|
305
|
+
/* style inject SSR */
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
var ClockpickerFace = __chunk_6.__vue_normalize__(
|
|
310
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
311
|
+
__vue_inject_styles__,
|
|
312
|
+
__vue_script__,
|
|
313
|
+
__vue_scope_id__,
|
|
314
|
+
__vue_is_functional_template__,
|
|
315
|
+
__vue_module_identifier__,
|
|
316
|
+
undefined,
|
|
317
|
+
undefined
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
var _components;
|
|
321
|
+
var outerPadding = 12;
|
|
322
|
+
var script$1 = {
|
|
323
|
+
name: 'BClockpicker',
|
|
324
|
+
components: (_components = {}, __chunk_1._defineProperty(_components, ClockpickerFace.name, ClockpickerFace), __chunk_1._defineProperty(_components, __chunk_7.Input.name, __chunk_7.Input), __chunk_1._defineProperty(_components, __chunk_12.Field.name, __chunk_12.Field), __chunk_1._defineProperty(_components, __chunk_5.Icon.name, __chunk_5.Icon), __chunk_1._defineProperty(_components, __chunk_11.Dropdown.name, __chunk_11.Dropdown), __chunk_1._defineProperty(_components, __chunk_11.DropdownItem.name, __chunk_11.DropdownItem), _components),
|
|
325
|
+
mixins: [__chunk_10.TimepickerMixin],
|
|
326
|
+
props: {
|
|
327
|
+
pickerSize: {
|
|
328
|
+
type: Number,
|
|
329
|
+
default: 290
|
|
330
|
+
},
|
|
331
|
+
hourFormat: {
|
|
332
|
+
type: String,
|
|
333
|
+
default: '12',
|
|
334
|
+
validator: function validator(value) {
|
|
335
|
+
return value === '24' || value === '12';
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
incrementMinutes: {
|
|
339
|
+
type: Number,
|
|
340
|
+
default: 5
|
|
341
|
+
},
|
|
342
|
+
autoSwitch: {
|
|
343
|
+
type: Boolean,
|
|
344
|
+
default: true
|
|
345
|
+
},
|
|
346
|
+
type: {
|
|
347
|
+
type: String,
|
|
348
|
+
default: 'is-primary'
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
data: function data() {
|
|
352
|
+
return {
|
|
353
|
+
isSelectingHour: true,
|
|
354
|
+
isDragging: false,
|
|
355
|
+
_isClockpicker: true
|
|
356
|
+
};
|
|
357
|
+
},
|
|
358
|
+
computed: {
|
|
359
|
+
hoursDisplay: function hoursDisplay() {
|
|
360
|
+
if (this.hoursSelected == null) return '--';
|
|
361
|
+
if (this.isHourFormat24) return this.pad(this.hoursSelected);
|
|
362
|
+
var display = this.hoursSelected;
|
|
363
|
+
if (this.meridienSelected === this.PM) display -= 12;
|
|
364
|
+
if (display === 0) display = 12;
|
|
365
|
+
return display;
|
|
366
|
+
},
|
|
367
|
+
minutesDisplay: function minutesDisplay() {
|
|
368
|
+
return this.minutesSelected == null ? '--' : this.pad(this.minutesSelected);
|
|
369
|
+
},
|
|
370
|
+
minFaceValue: function minFaceValue() {
|
|
371
|
+
return this.isSelectingHour && !this.isHourFormat24 && this.meridienSelected === this.PM ? 12 : 0;
|
|
372
|
+
},
|
|
373
|
+
maxFaceValue: function maxFaceValue() {
|
|
374
|
+
return this.isSelectingHour ? !this.isHourFormat24 && this.meridienSelected === this.AM ? 11 : 23 : 59;
|
|
375
|
+
},
|
|
376
|
+
faceSize: function faceSize() {
|
|
377
|
+
return this.pickerSize - outerPadding * 2;
|
|
378
|
+
},
|
|
379
|
+
faceDisabledValues: function faceDisabledValues() {
|
|
380
|
+
return this.isSelectingHour ? this.isHourDisabled : this.isMinuteDisabled;
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
methods: {
|
|
384
|
+
onClockInput: function onClockInput(value) {
|
|
385
|
+
if (this.isSelectingHour) {
|
|
386
|
+
this.hoursSelected = value;
|
|
387
|
+
this.onHoursChange(value);
|
|
388
|
+
} else {
|
|
389
|
+
this.minutesSelected = value;
|
|
390
|
+
this.onMinutesChange(value);
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
onClockChange: function onClockChange(value) {
|
|
394
|
+
if (this.autoSwitch && this.isSelectingHour) {
|
|
395
|
+
this.isSelectingHour = !this.isSelectingHour;
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
onMeridienClick: function onMeridienClick(value) {
|
|
399
|
+
if (this.meridienSelected !== value) {
|
|
400
|
+
this.meridienSelected = value;
|
|
401
|
+
this.onMeridienChange(value);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
/* script */
|
|
408
|
+
const __vue_script__$1 = script$1;
|
|
409
|
+
|
|
410
|
+
/* template */
|
|
411
|
+
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-clockpicker control",class:[_vm.size, _vm.type, {'is-expanded': _vm.expanded}]},[(!_vm.isMobile || _vm.inline)?_c('b-dropdown',{ref:"dropdown",attrs:{"position":_vm.position,"disabled":_vm.disabled,"inline":_vm.inline}},[(!_vm.inline)?_c('b-input',_vm._b({ref:"input",attrs:{"slot":"trigger","autocomplete":"off","value":_vm.formatValue(_vm.computedValue),"placeholder":_vm.placeholder,"size":_vm.size,"icon":_vm.icon,"icon-pack":_vm.iconPack,"loading":_vm.loading,"disabled":_vm.disabled,"readonly":!_vm.editable,"rounded":_vm.rounded,"use-html5-validation":_vm.useHtml5Validation},on:{"focus":_vm.handleOnFocus,"blur":function($event){_vm.onBlur() && _vm.checkHtml5Validity();}},nativeOn:{"click":function($event){$event.stopPropagation();_vm.toggle(true);},"keyup":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.toggle(true);},"change":function($event){_vm.onChangeNativePicker($event);}},slot:"trigger"},'b-input',_vm.$attrs,false)):_vm._e(),_vm._v(" "),_c('div',{staticClass:"card",attrs:{"disabled":_vm.disabled,"custom":""}},[(_vm.inline)?_c('header',{staticClass:"card-header"},[_c('div',{staticClass:"b-clockpicker-header card-header-title"},[_c('div',{staticClass:"b-clockpicker-time"},[_c('span',{staticClass:"b-clockpicker-btn",class:{ active: _vm.isSelectingHour },on:{"click":function($event){_vm.isSelectingHour = true;}}},[_vm._v(_vm._s(_vm.hoursDisplay))]),_vm._v(" "),_c('span',[_vm._v(":")]),_vm._v(" "),_c('span',{staticClass:"b-clockpicker-btn",class:{ active: !_vm.isSelectingHour },on:{"click":function($event){_vm.isSelectingHour = false;}}},[_vm._v(_vm._s(_vm.minutesDisplay))])]),_vm._v(" "),(!_vm.isHourFormat24)?_c('div',{staticClass:"b-clockpicker-period"},[_c('div',{staticClass:"b-clockpicker-btn",class:{ active: _vm.meridienSelected == _vm.AM },on:{"click":function($event){_vm.onMeridienClick(_vm.AM);}}},[_vm._v("am")]),_vm._v(" "),_c('div',{staticClass:"b-clockpicker-btn",class:{ active: _vm.meridienSelected == _vm.PM },on:{"click":function($event){_vm.onMeridienClick(_vm.PM);}}},[_vm._v("pm")])]):_vm._e()])]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"card-content"},[_c('div',{staticClass:"b-clockpicker-body",style:({ width: _vm.faceSize + 'px', height: _vm.faceSize + 'px' })},[(!_vm.inline)?_c('div',{staticClass:"b-clockpicker-time"},[_c('div',{staticClass:"b-clockpicker-btn",class:{ active: _vm.isSelectingHour },on:{"click":function($event){_vm.isSelectingHour = true;}}},[_vm._v("Hours")]),_vm._v(" "),_c('span',{staticClass:"b-clockpicker-btn",class:{ active: !_vm.isSelectingHour },on:{"click":function($event){_vm.isSelectingHour = false;}}},[_vm._v("Min")])]):_vm._e(),_vm._v(" "),(!_vm.isHourFormat24 && !_vm.inline)?_c('div',{staticClass:"b-clockpicker-period"},[_c('div',{staticClass:"b-clockpicker-btn",class:{ active: _vm.meridienSelected == _vm.AM },on:{"click":function($event){_vm.onMeridienClick(_vm.AM);}}},[_vm._v(_vm._s(_vm.AM))]),_vm._v(" "),_c('div',{staticClass:"b-clockpicker-btn",class:{ active: _vm.meridienSelected == _vm.PM },on:{"click":function($event){_vm.onMeridienClick(_vm.PM);}}},[_vm._v(_vm._s(_vm.PM))])]):_vm._e(),_vm._v(" "),_c('b-clockpicker-face',{attrs:{"picker-size":_vm.faceSize,"min":_vm.minFaceValue,"max":_vm.maxFaceValue,"face-numbers":_vm.isSelectingHour ? _vm.hours : _vm.minutes,"disabled-values":_vm.faceDisabledValues,"double":_vm.isSelectingHour && _vm.isHourFormat24,"value":_vm.isSelectingHour ? _vm.hoursSelected : _vm.minutesSelected},on:{"input":_vm.onClockInput,"change":_vm.onClockChange}})],1)]),_vm._v(" "),(_vm.$slots.default !== undefined && _vm.$slots.default.length)?_c('footer',{staticClass:"b-clockpicker-footer card-footer"},[_vm._t("default")],2):_vm._e()])],1):_c('b-input',_vm._b({ref:"input",attrs:{"type":"time","autocomplete":"off","value":_vm.formatHHMMSS(_vm.computedValue),"placeholder":_vm.placeholder,"size":_vm.size,"icon":_vm.icon,"icon-pack":_vm.iconPack,"loading":_vm.loading,"max":_vm.formatHHMMSS(_vm.maxTime),"min":_vm.formatHHMMSS(_vm.minTime),"disabled":_vm.disabled,"readonly":false,"use-html5-validation":_vm.useHtml5Validation},on:{"focus":_vm.handleOnFocus,"blur":function($event){_vm.onBlur() && _vm.checkHtml5Validity();}},nativeOn:{"click":function($event){$event.stopPropagation();_vm.toggle(true);},"keyup":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,"enter",13,$event.key)){ return null; }_vm.toggle(true);},"change":function($event){_vm.onChangeNativePicker($event);}}},'b-input',_vm.$attrs,false))],1)};
|
|
412
|
+
var __vue_staticRenderFns__$1 = [];
|
|
413
|
+
|
|
414
|
+
/* style */
|
|
415
|
+
const __vue_inject_styles__$1 = undefined;
|
|
416
|
+
/* scoped */
|
|
417
|
+
const __vue_scope_id__$1 = undefined;
|
|
418
|
+
/* module identifier */
|
|
419
|
+
const __vue_module_identifier__$1 = undefined;
|
|
420
|
+
/* functional template */
|
|
421
|
+
const __vue_is_functional_template__$1 = false;
|
|
422
|
+
/* style inject */
|
|
423
|
+
|
|
424
|
+
/* style inject SSR */
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
var Clockpicker = __chunk_6.__vue_normalize__(
|
|
429
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
430
|
+
__vue_inject_styles__$1,
|
|
431
|
+
__vue_script__$1,
|
|
432
|
+
__vue_scope_id__$1,
|
|
433
|
+
__vue_is_functional_template__$1,
|
|
434
|
+
__vue_module_identifier__$1,
|
|
435
|
+
undefined,
|
|
436
|
+
undefined
|
|
437
|
+
);
|
|
438
|
+
|
|
439
|
+
var Plugin = {
|
|
440
|
+
install: function install(Vue) {
|
|
441
|
+
__chunk_6.registerComponent(Vue, Clockpicker);
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
__chunk_6.use(Plugin);
|
|
445
|
+
|
|
446
|
+
exports.Clockpicker = Clockpicker;
|
|
447
|
+
exports.default = Plugin;
|