buefy 1.0.1 → 1.0.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.
Files changed (108) hide show
  1. package/README.md +21 -11
  2. package/dist/buefy.css +1 -10
  3. package/dist/buefy.d.ts +11 -18
  4. package/dist/buefy.esm.js +137 -33
  5. package/dist/buefy.esm.min.js +2 -2
  6. package/dist/buefy.js +137 -33
  7. package/dist/buefy.min.css +1 -1
  8. package/dist/buefy.min.js +2 -2
  9. package/dist/cjs/{Autocomplete-bK5HLaUH.js → Autocomplete-BMmOsPiK.js} +120 -27
  10. package/dist/cjs/autocomplete.js +1 -1
  11. package/dist/cjs/clockpicker.js +16 -5
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/taginput.js +1 -1
  14. package/dist/components/autocomplete/index.js +121 -28
  15. package/dist/components/autocomplete/index.min.js +2 -2
  16. package/dist/components/breadcrumb/index.js +1 -1
  17. package/dist/components/breadcrumb/index.min.js +1 -1
  18. package/dist/components/button/index.js +1 -1
  19. package/dist/components/button/index.min.js +1 -1
  20. package/dist/components/carousel/index.js +1 -1
  21. package/dist/components/carousel/index.min.js +1 -1
  22. package/dist/components/checkbox/index.js +1 -1
  23. package/dist/components/checkbox/index.min.js +1 -1
  24. package/dist/components/clockpicker/index.js +17 -6
  25. package/dist/components/clockpicker/index.min.js +2 -2
  26. package/dist/components/collapse/index.js +1 -1
  27. package/dist/components/collapse/index.min.js +1 -1
  28. package/dist/components/colorpicker/index.js +1 -1
  29. package/dist/components/colorpicker/index.min.js +1 -1
  30. package/dist/components/datepicker/index.js +1 -1
  31. package/dist/components/datepicker/index.min.js +1 -1
  32. package/dist/components/datetimepicker/index.js +1 -1
  33. package/dist/components/datetimepicker/index.min.js +1 -1
  34. package/dist/components/dialog/index.js +1 -1
  35. package/dist/components/dialog/index.min.js +1 -1
  36. package/dist/components/dropdown/index.js +1 -1
  37. package/dist/components/dropdown/index.min.js +1 -1
  38. package/dist/components/field/index.js +1 -1
  39. package/dist/components/field/index.min.js +1 -1
  40. package/dist/components/icon/index.js +1 -1
  41. package/dist/components/icon/index.min.js +1 -1
  42. package/dist/components/image/index.js +1 -1
  43. package/dist/components/image/index.min.js +1 -1
  44. package/dist/components/input/index.js +1 -1
  45. package/dist/components/input/index.min.js +1 -1
  46. package/dist/components/loading/index.js +1 -1
  47. package/dist/components/loading/index.min.js +1 -1
  48. package/dist/components/menu/index.js +1 -1
  49. package/dist/components/menu/index.min.js +1 -1
  50. package/dist/components/message/index.js +1 -1
  51. package/dist/components/message/index.min.js +1 -1
  52. package/dist/components/modal/index.js +1 -1
  53. package/dist/components/modal/index.min.js +1 -1
  54. package/dist/components/navbar/index.js +1 -1
  55. package/dist/components/navbar/index.min.js +1 -1
  56. package/dist/components/notification/index.js +1 -1
  57. package/dist/components/notification/index.min.js +1 -1
  58. package/dist/components/numberinput/index.js +1 -1
  59. package/dist/components/numberinput/index.min.js +1 -1
  60. package/dist/components/pagination/index.js +1 -1
  61. package/dist/components/pagination/index.min.js +1 -1
  62. package/dist/components/progress/index.js +1 -1
  63. package/dist/components/progress/index.min.js +1 -1
  64. package/dist/components/radio/index.js +1 -1
  65. package/dist/components/radio/index.min.js +1 -1
  66. package/dist/components/rate/index.js +1 -1
  67. package/dist/components/rate/index.min.js +1 -1
  68. package/dist/components/select/index.js +1 -1
  69. package/dist/components/select/index.min.js +1 -1
  70. package/dist/components/sidebar/index.js +1 -1
  71. package/dist/components/sidebar/index.min.js +1 -1
  72. package/dist/components/skeleton/index.js +1 -1
  73. package/dist/components/skeleton/index.min.js +1 -1
  74. package/dist/components/slider/index.js +1 -1
  75. package/dist/components/slider/index.min.js +1 -1
  76. package/dist/components/snackbar/index.js +1 -1
  77. package/dist/components/snackbar/index.min.js +1 -1
  78. package/dist/components/steps/index.js +1 -1
  79. package/dist/components/steps/index.min.js +1 -1
  80. package/dist/components/switch/index.js +1 -1
  81. package/dist/components/switch/index.min.js +1 -1
  82. package/dist/components/table/index.js +1 -1
  83. package/dist/components/table/index.min.js +1 -1
  84. package/dist/components/tabs/index.js +1 -1
  85. package/dist/components/tabs/index.min.js +1 -1
  86. package/dist/components/tag/index.js +1 -1
  87. package/dist/components/tag/index.min.js +1 -1
  88. package/dist/components/taginput/index.js +121 -28
  89. package/dist/components/taginput/index.min.js +2 -2
  90. package/dist/components/timepicker/index.js +1 -1
  91. package/dist/components/timepicker/index.min.js +1 -1
  92. package/dist/components/toast/index.js +1 -1
  93. package/dist/components/toast/index.min.js +1 -1
  94. package/dist/components/tooltip/index.js +1 -1
  95. package/dist/components/tooltip/index.min.js +1 -1
  96. package/dist/components/upload/index.js +1 -1
  97. package/dist/components/upload/index.min.js +1 -1
  98. package/dist/esm/{Autocomplete-DyPAHhWD.js → Autocomplete-CjbTh9D8.js} +120 -27
  99. package/dist/esm/autocomplete.js +1 -1
  100. package/dist/esm/clockpicker.js +16 -5
  101. package/dist/esm/index.js +1 -1
  102. package/dist/esm/taginput.js +1 -1
  103. package/package.json +6 -3
  104. package/src/components/autocomplete/Autocomplete.spec.ts +349 -11
  105. package/src/components/autocomplete/Autocomplete.vue +232 -64
  106. package/src/components/clockpicker/Clockpicker.vue +18 -5
  107. package/src/components/snackbar/index.ts +1 -1
  108. package/src/scss/components/_upload.scss +0 -11
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <a href="https://www.npmjs.com/package/buefy"><img src="https://img.shields.io/npm/dt/buefy.svg" /></a>
8
8
  <a href="https://circleci.com/gh/buefy/buefy"><img src="https://img.shields.io/circleci/project/github/buefy/buefy.svg?style=flat-square" /></a>
9
9
  <a href="https://codecov.io/gh/buefy/buefy"><img src="https://img.shields.io/codecov/c/github/buefy/buefy.svg?style=flat-square" /></a>
10
- <a href="https://discordapp.com/invite/ZkdFJMr"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg?logo=discord" /></a>
10
+ <a href="https://discord.buefy.org/"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg?logo=discord" /></a>
11
11
  <a href="https://buefy.org"><img src="https://img.shields.io/badge/code_style-buefy-7957d5.svg?style=flat-square" /></a>
12
12
  </p>
13
13
 
@@ -21,8 +21,6 @@ The biggest breaking change is obviously, **buefy does not work with Vue 2**.
21
21
 
22
22
  ### How to install
23
23
 
24
- To install this fork, please run the following command,
25
-
26
24
  ```sh
27
25
  npm install buefy
28
26
  ```
@@ -101,12 +99,21 @@ If you want to customize the icons or the theme, refer to the [customization sec
101
99
  <script src="https://unpkg.com/buefy/dist/buefy.min.js"></script>
102
100
  ```
103
101
 
104
- **Currently, including `buefy-next` via `<script>` is not working.**
102
+ **Currently, including `buefy` via `<script>` is not working.**
105
103
  Please see the issue [#221](https://github.com/ntohq/buefy-next/issues/221).
106
104
 
105
+ As a temporary workaround, add the following snippet before initializing Buefy:
106
+
107
+ ```html
108
+ <script>
109
+ // we need this tweak because Buefy is not built for browsers
110
+ window.process = { env: { NODE_ENV: 'production' } };
111
+ </script>
112
+ ```
113
+
107
114
  ### Installing Developer Release(s) from GitHub npm Registry to Access the Latest Features
108
115
 
109
- To incorporate the latest changes from the development branch of buefy-next, you can install developer releases from the GitHub npm registry. However, proceed with caution as these packages may be deleted or retracted without notice.
116
+ To incorporate the latest changes from the development branch, you can install developer releases from the GitHub npm registry. However, proceed with caution as these packages may be deleted or retracted without notice.
110
117
 
111
118
  Steps:
112
119
 
@@ -140,30 +147,32 @@ Steps:
140
147
  Buefy developer releases follow a specific naming format:
141
148
 
142
149
  ```
143
- buefy@<package version>-<dev commit hash>
150
+ @buefy/buefy@<package version>-<dev commit hash>
144
151
  ```
145
152
 
146
153
  `<package version>`: This represents the intended stable release version that the developer release will eventually be included in.
147
154
 
148
155
  `<dev commit hash>`: This part indicates that it's a developer release and includes a unique commit hash that identifies the specific code changes in that release.
149
156
 
157
+ **Due to the GitHub npm registry's requirements, the package name must be scoped; i.e., prefixed with `@buefy/`.**
158
+
150
159
  4. Install the Package:
151
160
 
152
161
  Copy the provided command from GitHub, which will resemble this:
153
162
 
154
163
  ```bash
155
- npm install buefy@<package version>-<dev commit hash>
164
+ npm install buefy@npm:@buefy/buefy@<package version>-<dev commit hash>
156
165
  ```
157
166
 
158
- Alternatively, to fetch the latest release from the developer snapshot registry, run:
167
+ Alternatively, to fetch the latest release from the developer release registry, run:
159
168
 
160
169
  ```bash
161
- npm install buefy@latest
170
+ npm install buefy@npm:@buefy/buefy@latest
162
171
  ```
163
172
 
164
- **However, note it is not recommended to use the latest version of our developer snapshot, as its stability fluctuates.**
173
+ **However, note it is not recommended to use the latest version of our developer release, as its stability fluctuates.**
165
174
 
166
- Congratulations! You've successfully installed a Buefy-next developer package.
175
+ Congratulations! You've successfully installed a Buefy developer release.
167
176
 
168
177
  For further details on the GitHub npm registry refer to the [official GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package)
169
178
 
@@ -230,3 +239,4 @@ This project follows the [all-contributors](https://github.com/all-contributors/
230
239
  ## License <a href="https://github.com/buefy/buefy/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/buefy.svg?logo=github" /></a>
231
240
 
232
241
  Code released under [MIT](https://github.com/buefy/buefy/blob/master/LICENSE) license.
242
+
package/dist/buefy.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- /*! Buefy v1.0.1 | MIT License | github.com/buefy/buefy */
2
+ /*! Buefy v1.0.2 | MIT License | github.com/buefy/buefy */
3
3
  .is-noscroll {
4
4
  position: fixed;
5
5
  overflow-y: hidden;
@@ -15893,12 +15893,3 @@ MIT (https://github.com/Wikiki/bulma-steps/blob/master/LICENSE)
15893
15893
  border-top-right-radius: 9999px;
15894
15894
  border-bottom-right-radius: 9999px;
15895
15895
  }
15896
-
15897
- @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
15898
- .upload input[type=file] {
15899
- z-index: auto;
15900
- }
15901
- .upload .upload-draggable + input[type=file] {
15902
- z-index: -1;
15903
- }
15904
- }
package/dist/buefy.d.ts CHANGED
@@ -120,6 +120,7 @@ maxHeight: string | undefined;
120
120
  setHovered(option: any): void;
121
121
  setSelected(option: any, closeDropdown?: boolean, event?: Event): void;
122
122
  selectFirstOption(computedData: DataItem[]): void;
123
+ findHoveredIndex(data: any[]): number;
123
124
  keydown(event: KeyboardEvent): void;
124
125
  selectHeaderOrFoterByClick(event: MouseEvent, origin: "header" | "footer"): void;
125
126
  checkIfHeaderOrFooterSelected(event: Event, triggerClick: {
@@ -488,13 +489,13 @@ type: string;
488
489
  iconRightClickable: boolean;
489
490
  checkInfiniteScroll: boolean;
490
491
  keepFirst: boolean;
492
+ appendToBody: boolean;
491
493
  clearOnSelect: boolean;
492
494
  openOnFocus: boolean;
493
495
  keepOpen: boolean;
494
496
  selectOnClickOutside: boolean;
495
497
  clearable: boolean;
496
498
  dropdownPosition: string;
497
- appendToBody: boolean;
498
499
  confirmKeys: unknown[];
499
500
  selectableHeader: boolean;
500
501
  selectableFooter: boolean;
@@ -1231,10 +1232,6 @@ incrementMinutes: {
1231
1232
  type: NumberConstructor;
1232
1233
  default: number;
1233
1234
  };
1234
- autoSwitch: {
1235
- type: BooleanConstructor;
1236
- default: boolean;
1237
- };
1238
1235
  type: {
1239
1236
  type: StringConstructor;
1240
1237
  default: string;
@@ -1261,6 +1258,7 @@ faceDisabledValues(): (hour: number) => boolean;
1261
1258
  }, {
1262
1259
  onClockInput(value: number): void;
1263
1260
  onClockChange(): void;
1261
+ toggle(active: boolean): void;
1264
1262
  onMeridienClick(value: string): void;
1265
1263
  onInputClick(event: MouseEvent): void;
1266
1264
  }, DefineComponent< {
@@ -1830,8 +1828,8 @@ default: boolean;
1830
1828
  "onUpdate:modelValue"?: ((_value: Date | null) => any) | undefined;
1831
1829
  }, {
1832
1830
  disabled: boolean;
1833
- openOnFocus: boolean;
1834
1831
  appendToBody: boolean;
1832
+ openOnFocus: boolean;
1835
1833
  inline: boolean;
1836
1834
  mobileModal: boolean;
1837
1835
  focusable: boolean;
@@ -1855,10 +1853,6 @@ incrementMinutes: {
1855
1853
  type: NumberConstructor;
1856
1854
  default: number;
1857
1855
  };
1858
- autoSwitch: {
1859
- type: BooleanConstructor;
1860
- default: boolean;
1861
- };
1862
1856
  type: {
1863
1857
  type: StringConstructor;
1864
1858
  default: string;
@@ -1875,7 +1869,6 @@ default: () => string;
1875
1869
  type: string;
1876
1870
  incrementMinutes: number;
1877
1871
  pickerSize: number;
1878
- autoSwitch: boolean;
1879
1872
  hoursLabel: string;
1880
1873
  minutesLabel: string;
1881
1874
  }, {}>;
@@ -2328,8 +2321,8 @@ appendToBody: BooleanConstructor;
2328
2321
  trapFocus: boolean;
2329
2322
  expanded: boolean;
2330
2323
  disabled: boolean;
2331
- openOnFocus: boolean;
2332
2324
  appendToBody: boolean;
2325
+ openOnFocus: boolean;
2333
2326
  inline: boolean;
2334
2327
  mobileModal: boolean;
2335
2328
  closeOnClick: boolean;
@@ -3101,8 +3094,8 @@ trapFocus: boolean;
3101
3094
  disabled: boolean;
3102
3095
  iconRightClickable: boolean;
3103
3096
  range: boolean;
3104
- openOnFocus: boolean;
3105
3097
  appendToBody: boolean;
3098
+ openOnFocus: boolean;
3106
3099
  iconPrev: string;
3107
3100
  iconNext: string;
3108
3101
  inline: boolean;
@@ -3546,8 +3539,8 @@ appendToBody: BooleanConstructor;
3546
3539
  }, {
3547
3540
  disabled: boolean;
3548
3541
  iconRightClickable: boolean;
3549
- openOnFocus: boolean;
3550
3542
  appendToBody: boolean;
3543
+ openOnFocus: boolean;
3551
3544
  inline: boolean;
3552
3545
  focusable: boolean;
3553
3546
  editable: boolean;
@@ -4034,8 +4027,8 @@ animation: string;
4034
4027
  ariaRole: string;
4035
4028
  expanded: boolean;
4036
4029
  disabled: boolean;
4037
- maxHeight: string | number;
4038
4030
  appendToBody: boolean;
4031
+ maxHeight: string | number;
4039
4032
  inline: boolean;
4040
4033
  scrollable: boolean;
4041
4034
  triggers: ("click" | "contextmenu" | "focus" | "hover")[];
@@ -9506,9 +9499,9 @@ hasCounter: boolean;
9506
9499
  autocomplete: boolean;
9507
9500
  checkInfiniteScroll: boolean;
9508
9501
  keepFirst: boolean;
9502
+ appendToBody: boolean;
9509
9503
  openOnFocus: boolean;
9510
9504
  keepOpen: boolean;
9511
- appendToBody: boolean;
9512
9505
  confirmKeys: string[];
9513
9506
  attached: boolean;
9514
9507
  ellipsis: boolean;
@@ -10099,8 +10092,8 @@ default: boolean;
10099
10092
  "onUpdate:modelValue"?: ((_value: Date | null) => any) | undefined;
10100
10093
  }, {
10101
10094
  disabled: boolean;
10102
- openOnFocus: boolean;
10103
10095
  appendToBody: boolean;
10096
+ openOnFocus: boolean;
10104
10097
  inline: boolean;
10105
10098
  mobileModal: boolean;
10106
10099
  focusable: boolean;
@@ -11523,7 +11516,7 @@ export declare const Snackbar: {
11523
11516
  install(Vue: App): void;
11524
11517
  };
11525
11518
 
11526
- declare type SnackbarOpenParams = Omit<SnackbarProps, 'message'> & {
11519
+ export declare type SnackbarOpenParams = Omit<SnackbarProps, 'message'> & {
11527
11520
  message?: string | VNode | (string | VNode)[];
11528
11521
  onClose?: () => void;
11529
11522
  };
package/dist/buefy.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Buefy v1.0.1 | MIT License | github.com/buefy/buefy */
1
+ /*! Buefy v1.0.2 | MIT License | github.com/buefy/buefy */
2
2
  import { Fragment, Comment, Text, Static, defineComponent, h, resolveComponent, createElementBlock, openBlock, normalizeClass, createBlock, renderSlot, createCommentVNode, createTextVNode, toDisplayString, withCtx, createVNode, renderList, resolveDynamicComponent, mergeProps, withDirectives, vModelDynamic, vModelText, withKeys, withModifiers, Transition, createElementVNode, normalizeStyle, vShow, normalizeProps, guardReactiveProps, vModelCheckbox, resolveDirective, createSlots, vModelSelect, toHandlers, createApp, vModelRadio, toRaw, toHandlerKey } from 'vue';
3
3
 
4
4
  var __defProp$d = Object.defineProperty;
@@ -2003,7 +2003,9 @@ var _sfc_main$P = defineComponent({
2003
2003
  },
2004
2004
  isEmpty() {
2005
2005
  if (!this.computedData) return true;
2006
- return !this.computedData.some((element) => element.items && element.items.length);
2006
+ return !this.computedData.some(
2007
+ (element) => element.items && element.items.length
2008
+ );
2007
2009
  },
2008
2010
  /*
2009
2011
  * White-listed items to not close when clicked.
@@ -2011,6 +2013,7 @@ var _sfc_main$P = defineComponent({
2011
2013
  */
2012
2014
  whiteList() {
2013
2015
  var _a;
2016
+ this.computedData;
2014
2017
  const whiteList = [];
2015
2018
  whiteList.push(this.$refs.input.$el.querySelector("input"));
2016
2019
  whiteList.push(this.$refs.dropdown);
@@ -2106,13 +2109,22 @@ var _sfc_main$P = defineComponent({
2106
2109
  * When checkInfiniteScroll property changes scroll event should be removed or added
2107
2110
  */
2108
2111
  checkInfiniteScroll(checkInfiniteScroll) {
2109
- if ((this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) === false) return;
2110
- const list = this.$refs.dropdown.querySelector(".dropdown-content");
2112
+ if (!this.$refs.dropdown) return;
2113
+ const list = this.$refs.dropdown.querySelector(
2114
+ ".dropdown-content"
2115
+ );
2116
+ if (!list) return;
2111
2117
  if (checkInfiniteScroll === true) {
2112
- list.addEventListener("scroll", this.checkIfReachedTheEndOfScroll);
2118
+ list.addEventListener(
2119
+ "scroll",
2120
+ this.checkIfReachedTheEndOfScroll
2121
+ );
2113
2122
  return;
2114
2123
  }
2115
- list.removeEventListener("scroll", this.checkIfReachedTheEndOfScroll);
2124
+ list.removeEventListener(
2125
+ "scroll",
2126
+ this.checkIfReachedTheEndOfScroll
2127
+ );
2116
2128
  },
2117
2129
  /*
2118
2130
  * When updating input's value
@@ -2123,11 +2135,11 @@ var _sfc_main$P = defineComponent({
2123
2135
  newValue(value) {
2124
2136
  this.$emit("update:modelValue", value);
2125
2137
  const currentValue = this.getValue(this.selected);
2126
- if (currentValue && currentValue !== value) {
2138
+ if (currentValue !== void 0 && currentValue !== null && currentValue !== value) {
2127
2139
  this.setSelected(null, false);
2128
2140
  }
2129
- if (this.hasFocus && (!this.openOnFocus || value)) {
2130
- this.isActive = !!value;
2141
+ if (this.hasFocus && (!this.openOnFocus || value !== "")) {
2142
+ this.isActive = value !== "" && value !== void 0 && value !== null;
2131
2143
  }
2132
2144
  },
2133
2145
  /*
@@ -2138,6 +2150,9 @@ var _sfc_main$P = defineComponent({
2138
2150
  modelValue(value) {
2139
2151
  this.newValue = value;
2140
2152
  },
2153
+ keepFirst(value) {
2154
+ this.ariaAutocomplete = value ? "both" : "list";
2155
+ },
2141
2156
  /*
2142
2157
  * Select first option if "keep-first
2143
2158
  */
@@ -2159,6 +2174,24 @@ var _sfc_main$P = defineComponent({
2159
2174
  }
2160
2175
  }
2161
2176
  }
2177
+ },
2178
+ /*
2179
+ * When appendToBody property changes, handle the transition properly
2180
+ */
2181
+ appendToBody(newValue, oldValue) {
2182
+ if (newValue && !oldValue) {
2183
+ if (this.isActive && this.$refs.dropdown && !this.$data._bodyEl) {
2184
+ this.$data._bodyEl = createAbsoluteElement(
2185
+ this.$refs.dropdown
2186
+ );
2187
+ this.updateAppendToBody();
2188
+ }
2189
+ } else if (!newValue && oldValue) {
2190
+ if (this.$data._bodyEl) {
2191
+ removeElement(this.$data._bodyEl);
2192
+ this.$data._bodyEl = void 0;
2193
+ }
2194
+ }
2162
2195
  }
2163
2196
  },
2164
2197
  methods: {
@@ -2181,10 +2214,7 @@ var _sfc_main$P = defineComponent({
2181
2214
  this.$emit("select", this.selected, event);
2182
2215
  if (this.selected !== null) {
2183
2216
  if (this.clearOnSelect) {
2184
- const input = this.$refs.input;
2185
- input.newValue = "";
2186
- const innerInput = input.$refs.input;
2187
- innerInput.value = "";
2217
+ this.newValue = "";
2188
2218
  } else {
2189
2219
  this.newValue = this.getValue(this.selected);
2190
2220
  }
@@ -2211,6 +2241,31 @@ var _sfc_main$P = defineComponent({
2211
2241
  }
2212
2242
  });
2213
2243
  },
2244
+ /*
2245
+ * Find index of hovered item in data array by comparing display values
2246
+ * instead of object references. This fixes the bug with computed data
2247
+ * where proxy objects cause indexOf to fail.
2248
+ */
2249
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2250
+ findHoveredIndex(data) {
2251
+ if (this.hovered === null || this.hovered === void 0) {
2252
+ return -1;
2253
+ }
2254
+ const exactIndex = data.indexOf(this.hovered);
2255
+ if (exactIndex !== -1) {
2256
+ return exactIndex;
2257
+ }
2258
+ const hoveredValue = this.getValue(this.hovered);
2259
+ if (hoveredValue === null || hoveredValue === void 0) {
2260
+ return -1;
2261
+ }
2262
+ return data.findIndex((item) => {
2263
+ if (item === null || item === void 0) {
2264
+ return hoveredValue === null || hoveredValue === void 0;
2265
+ }
2266
+ return this.getValue(item) === hoveredValue;
2267
+ });
2268
+ },
2214
2269
  keydown(event) {
2215
2270
  const { key } = event;
2216
2271
  if (key === "Enter") event.preventDefault();
@@ -2221,7 +2276,11 @@ var _sfc_main$P = defineComponent({
2221
2276
  if (key === ",") event.preventDefault();
2222
2277
  const closeDropdown = !this.keepOpen || key === "Tab";
2223
2278
  if (this.hovered === null) {
2224
- this.checkIfHeaderOrFooterSelected(event, null, closeDropdown);
2279
+ this.checkIfHeaderOrFooterSelected(
2280
+ event,
2281
+ null,
2282
+ closeDropdown
2283
+ );
2225
2284
  return;
2226
2285
  }
2227
2286
  this.setSelected(this.hovered, closeDropdown, event);
@@ -2277,7 +2336,9 @@ var _sfc_main$P = defineComponent({
2277
2336
  * reached it's end.
2278
2337
  */
2279
2338
  checkIfReachedTheEndOfScroll() {
2280
- const list = this.$refs.dropdown.querySelector(".dropdown-content");
2339
+ const list = this.$refs.dropdown.querySelector(
2340
+ ".dropdown-content"
2341
+ );
2281
2342
  const footerHeight = this.hasFooterSlot ? list.querySelectorAll("div.dropdown-footer")[0].clientHeight : 0;
2282
2343
  if (list.clientHeight !== list.scrollHeight && list.scrollTop + list.parentElement.clientHeight + footerHeight >= list.scrollHeight) {
2283
2344
  this.$emit("infinite-scroll");
@@ -2305,9 +2366,7 @@ var _sfc_main$P = defineComponent({
2305
2366
  keyArrows(direction) {
2306
2367
  const sum = direction === "down" ? 1 : -1;
2307
2368
  if (this.isActive) {
2308
- const data = this.computedData.map(
2309
- (d) => d.items
2310
- ).reduce((a, b) => [...a, ...b], []);
2369
+ const data = this.computedData.map((d) => d.items).reduce((a, b) => [...a, ...b], []);
2311
2370
  if (this.hasHeaderSlot && this.selectableHeader) {
2312
2371
  data.unshift(void 0);
2313
2372
  }
@@ -2320,7 +2379,7 @@ var _sfc_main$P = defineComponent({
2320
2379
  } else if (this.footerHovered) {
2321
2380
  index = data.length - 1 + sum;
2322
2381
  } else {
2323
- index = data.indexOf(this.hovered) + sum;
2382
+ index = this.findHoveredIndex(data) + sum;
2324
2383
  }
2325
2384
  index = index > data.length - 1 ? data.length - 1 : index;
2326
2385
  index = index < 0 ? 0 : index;
@@ -2333,7 +2392,9 @@ var _sfc_main$P = defineComponent({
2333
2392
  if (this.hasHeaderSlot && this.selectableHeader && index === 0) {
2334
2393
  this.headerHovered = true;
2335
2394
  }
2336
- const list = this.$refs.dropdown.querySelector(".dropdown-content");
2395
+ const list = this.$refs.dropdown.querySelector(
2396
+ ".dropdown-content"
2397
+ );
2337
2398
  let querySelectorText = "a.dropdown-item:not(.is-disabled)";
2338
2399
  if (this.hasHeaderSlot && this.selectableHeader) {
2339
2400
  querySelectorText += ",div.dropdown-header";
@@ -2380,7 +2441,9 @@ var _sfc_main$P = defineComponent({
2380
2441
  },
2381
2442
  onInput() {
2382
2443
  const currentValue = this.getValue(this.selected);
2383
- if (currentValue && currentValue === this.newValue) return;
2444
+ if (currentValue !== void 0 && currentValue !== null && currentValue === this.newValue) {
2445
+ return;
2446
+ }
2384
2447
  this.$emit("typing", this.newValue);
2385
2448
  this.checkValidity();
2386
2449
  },
@@ -2406,6 +2469,9 @@ var _sfc_main$P = defineComponent({
2406
2469
  const dropdownMenu = this.$refs.dropdown;
2407
2470
  const trigger = this.$parent.$data._isTaginput ? this.$parent.$el : this.$refs.input.$el;
2408
2471
  if (dropdownMenu && trigger) {
2472
+ if (!this.$data._bodyEl) {
2473
+ this.$data._bodyEl = createAbsoluteElement(dropdownMenu);
2474
+ }
2409
2475
  const root = this.$data._bodyEl;
2410
2476
  root.classList.forEach((item) => root.classList.remove(item));
2411
2477
  root.classList.add("autocomplete");
@@ -2436,17 +2502,30 @@ var _sfc_main$P = defineComponent({
2436
2502
  if (typeof window !== "undefined") {
2437
2503
  document.addEventListener("click", this.clickedOutside);
2438
2504
  if (this.dropdownPosition === "auto") {
2439
- window.addEventListener("resize", this.calcDropdownInViewportVertical);
2505
+ window.addEventListener(
2506
+ "resize",
2507
+ this.calcDropdownInViewportVertical
2508
+ );
2509
+ }
2510
+ if (this.appendToBody) {
2511
+ window.addEventListener(
2512
+ "scroll",
2513
+ this.calcDropdownInViewportVertical
2514
+ );
2440
2515
  }
2441
2516
  }
2442
2517
  },
2443
2518
  mounted() {
2444
2519
  if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
2445
- const list = this.$refs.dropdown.querySelector(".dropdown-content");
2520
+ const list = this.$refs.dropdown.querySelector(
2521
+ ".dropdown-content"
2522
+ );
2446
2523
  list.addEventListener("scroll", this.checkIfReachedTheEndOfScroll);
2447
2524
  }
2448
2525
  if (this.appendToBody) {
2449
- this.$data._bodyEl = createAbsoluteElement(this.$refs.dropdown);
2526
+ this.$data._bodyEl = createAbsoluteElement(
2527
+ this.$refs.dropdown
2528
+ );
2450
2529
  this.updateAppendToBody();
2451
2530
  }
2452
2531
  },
@@ -2454,14 +2533,28 @@ var _sfc_main$P = defineComponent({
2454
2533
  if (typeof window !== "undefined") {
2455
2534
  document.removeEventListener("click", this.clickedOutside);
2456
2535
  if (this.dropdownPosition === "auto") {
2457
- window.removeEventListener("resize", this.calcDropdownInViewportVertical);
2536
+ window.removeEventListener(
2537
+ "resize",
2538
+ this.calcDropdownInViewportVertical
2539
+ );
2540
+ }
2541
+ if (this.appendToBody) {
2542
+ window.removeEventListener(
2543
+ "scroll",
2544
+ this.calcDropdownInViewportVertical
2545
+ );
2458
2546
  }
2459
2547
  }
2460
2548
  if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
2461
- const list = this.$refs.dropdown.querySelector(".dropdown-content");
2462
- list.removeEventListener("scroll", this.checkIfReachedTheEndOfScroll);
2549
+ const list = this.$refs.dropdown.querySelector(
2550
+ ".dropdown-content"
2551
+ );
2552
+ list.removeEventListener(
2553
+ "scroll",
2554
+ this.checkIfReachedTheEndOfScroll
2555
+ );
2463
2556
  }
2464
- if (this.appendToBody) {
2557
+ if (this.appendToBody && this.$data._bodyEl) {
2465
2558
  removeElement(this.$data._bodyEl);
2466
2559
  }
2467
2560
  clearTimeout(this.timeOutID);
@@ -6055,10 +6148,6 @@ var _sfc_main$B = defineComponent({
6055
6148
  type: Number,
6056
6149
  default: 5
6057
6150
  },
6058
- autoSwitch: {
6059
- type: Boolean,
6060
- default: true
6061
- },
6062
6151
  type: {
6063
6152
  type: String,
6064
6153
  default: "is-primary"
@@ -6117,8 +6206,22 @@ var _sfc_main$B = defineComponent({
6117
6206
  }
6118
6207
  },
6119
6208
  onClockChange() {
6120
- if (this.autoSwitch && this.isSelectingHour) {
6209
+ if (this.isSelectingHour) {
6121
6210
  this.isSelectingHour = !this.isSelectingHour;
6211
+ } else {
6212
+ this.toggle(false);
6213
+ }
6214
+ },
6215
+ /*
6216
+ * Toggle clockpicker
6217
+ */
6218
+ toggle(active) {
6219
+ if (this.$refs.dropdown) {
6220
+ const dropdown = this.$refs.dropdown;
6221
+ dropdown.isActive = active != null ? active : !dropdown.isActive;
6222
+ if (dropdown.isActive) {
6223
+ this.isSelectingHour = true;
6224
+ }
6122
6225
  }
6123
6226
  },
6124
6227
  onMeridienClick(value) {
@@ -6305,6 +6408,7 @@ function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
6305
6408
  )
6306
6409
  ])) : createCommentVNode("v-if", true),
6307
6410
  createVNode(_component_b_clockpicker_face, {
6411
+ ref: "clockpickerFace",
6308
6412
  "picker-size": _ctx.faceSize,
6309
6413
  min: _ctx.minFaceValue,
6310
6414
  max: _ctx.maxFaceValue,