@indielayer/ui 1.8.4 → 1.9.1

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 (119) hide show
  1. package/docs/pages/component/select/usage.vue +17 -5
  2. package/docs/pages/component/table/index.vue +7 -0
  3. package/docs/pages/component/table/usage.vue +5 -1
  4. package/docs/pages/component/table/virtual.vue +53 -0
  5. package/docs/pages/typography.vue +14 -12
  6. package/lib/components/accordion/Accordion.vue.d.ts +4 -4
  7. package/lib/components/accordion/AccordionItem.vue.d.ts +6 -6
  8. package/lib/components/accordion/AccordionItem.vue.js +51 -51
  9. package/lib/components/alert/Alert.vue.d.ts +8 -8
  10. package/lib/components/alert/Alert.vue2.js +20 -20
  11. package/lib/components/avatar/Avatar.vue.d.ts +4 -4
  12. package/lib/components/badge/Badge.vue.d.ts +4 -4
  13. package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +4 -4
  14. package/lib/components/button/Button.vue.d.ts +5 -5
  15. package/lib/components/button/ButtonGroup.vue.d.ts +4 -4
  16. package/lib/components/card/Card.vue.d.ts +4 -4
  17. package/lib/components/carousel/Carousel.vue.d.ts +7 -7
  18. package/lib/components/carousel/CarouselSlide.vue.d.ts +4 -4
  19. package/lib/components/checkbox/Checkbox.vue.d.ts +6 -6
  20. package/lib/components/checkbox/Checkbox.vue2.js +60 -60
  21. package/lib/components/container/Container.vue.d.ts +4 -4
  22. package/lib/components/datepicker/Datepicker.vue.d.ts +6 -6
  23. package/lib/components/datepicker/Datepicker.vue.js +3 -3
  24. package/lib/components/divider/Divider.vue.d.ts +4 -4
  25. package/lib/components/drawer/Drawer.vue.d.ts +6 -6
  26. package/lib/components/drawer/Drawer.vue.js +1 -1
  27. package/lib/components/form/Form.vue.d.ts +5 -5
  28. package/lib/components/formGroup/FormGroup.vue.d.ts +6 -6
  29. package/lib/components/formGroup/FormGroup.vue.js +7 -7
  30. package/lib/components/icon/Icon.vue.d.ts +4 -4
  31. package/lib/components/image/Image.vue.d.ts +3 -3
  32. package/lib/components/input/Input.vue.d.ts +6 -6
  33. package/lib/components/inputFooter/InputFooter.vue.d.ts +3 -3
  34. package/lib/components/label/Label.vue.d.ts +4 -4
  35. package/lib/components/link/Link.vue.d.ts +4 -4
  36. package/lib/components/loader/Loader.vue.d.ts +4 -4
  37. package/lib/components/menu/Menu.vue.d.ts +5 -5
  38. package/lib/components/menu/MenuItem.vue.d.ts +5 -5
  39. package/lib/components/menu/MenuItem.vue2.js +1 -1
  40. package/lib/components/modal/Modal.vue.d.ts +6 -6
  41. package/lib/components/modal/Modal.vue.js +1 -1
  42. package/lib/components/notifications/Notifications.vue.d.ts +5 -5
  43. package/lib/components/pagination/Pagination.vue.d.ts +5 -5
  44. package/lib/components/pagination/Pagination.vue.js +41 -41
  45. package/lib/components/pagination/PaginationItem.vue.d.ts +6 -6
  46. package/lib/components/popover/Popover.vue.d.ts +8 -8
  47. package/lib/components/popover/Popover.vue.js +1 -1
  48. package/lib/components/popover/PopoverContainer.vue.d.ts +4 -4
  49. package/lib/components/progress/Progress.vue.d.ts +4 -4
  50. package/lib/components/qrCode/QrCode.vue.d.ts +4 -4
  51. package/lib/components/radio/Radio.vue.d.ts +6 -6
  52. package/lib/components/radio/Radio.vue2.js +63 -63
  53. package/lib/components/scroll/Scroll.vue.d.ts +6 -6
  54. package/lib/components/scroll/Scroll.vue2.js +1 -1
  55. package/lib/components/select/Select.vue.d.ts +42 -6
  56. package/lib/components/select/Select.vue.js +224 -201
  57. package/lib/components/select/theme/Select.base.theme.js +1 -1
  58. package/lib/components/skeleton/Skeleton.vue.d.ts +4 -4
  59. package/lib/components/skeleton/Skeleton.vue.js +17 -17
  60. package/lib/components/slider/Slider.vue.d.ts +6 -6
  61. package/lib/components/spacer/Spacer.d.ts +1 -1
  62. package/lib/components/spinner/Spinner.vue.d.ts +4 -4
  63. package/lib/components/stepper/Stepper.vue.d.ts +5 -5
  64. package/lib/components/tab/Tab.vue.d.ts +5 -5
  65. package/lib/components/tab/Tab.vue.js +1 -1
  66. package/lib/components/tab/TabGroup.vue.d.ts +5 -5
  67. package/lib/components/tab/TabGroup.vue.js +2 -2
  68. package/lib/components/table/Table.vue.d.ts +119 -24
  69. package/lib/components/table/Table.vue.js +226 -188
  70. package/lib/components/table/TableBody.d.ts +1 -1
  71. package/lib/components/table/TableCell.vue.d.ts +4 -4
  72. package/lib/components/table/TableHead.vue.d.ts +10 -2
  73. package/lib/components/table/TableHead.vue.js +16 -13
  74. package/lib/components/table/TableHeader.vue.d.ts +4 -8
  75. package/lib/components/table/TableHeader.vue.js +40 -41
  76. package/lib/components/table/TableRow.vue.d.ts +8 -4
  77. package/lib/components/table/TableRow.vue.js +3 -2
  78. package/lib/components/table/theme/TableHead.base.theme.js +7 -4
  79. package/lib/components/table/theme/TableHead.carbon.theme.js +7 -4
  80. package/lib/components/table/theme/TableHeader.base.theme.js +3 -3
  81. package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
  82. package/lib/components/table/theme/TableRow.base.theme.js +1 -1
  83. package/lib/components/tag/Tag.vue.d.ts +5 -5
  84. package/lib/components/textarea/Textarea.vue.d.ts +6 -6
  85. package/lib/components/textarea/Textarea.vue.js +6 -6
  86. package/lib/components/themeProvider/ThemeProvider.vue.d.ts +3 -3
  87. package/lib/components/toggle/Toggle.vue.d.ts +6 -6
  88. package/lib/components/tooltip/ToggleTip.vue.d.ts +3 -3
  89. package/lib/components/tooltip/Tooltip.vue.d.ts +4 -4
  90. package/lib/components/tooltip/Tooltip.vue.js +1 -1
  91. package/lib/composables/index.d.ts +1 -0
  92. package/lib/composables/useInputtable.d.ts +26 -6
  93. package/lib/composables/useVirtualList.d.ts +48 -0
  94. package/lib/composables/useVirtualList.js +123 -0
  95. package/lib/index.js +35 -33
  96. package/lib/index.umd.js +4 -4
  97. package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js +412 -0
  98. package/lib/version.d.ts +1 -1
  99. package/lib/version.js +1 -1
  100. package/package.json +3 -3
  101. package/src/components/select/Select.vue +56 -26
  102. package/src/components/select/theme/Select.base.theme.ts +1 -1
  103. package/src/components/table/Table.vue +158 -114
  104. package/src/components/table/TableHead.vue +6 -2
  105. package/src/components/table/TableHeader.vue +0 -1
  106. package/src/components/table/TableRow.vue +1 -0
  107. package/src/components/table/theme/TableHead.base.theme.ts +7 -1
  108. package/src/components/table/theme/TableHead.carbon.theme.ts +7 -1
  109. package/src/components/table/theme/TableHeader.base.theme.ts +0 -2
  110. package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -2
  111. package/src/components/table/theme/TableRow.base.theme.ts +4 -0
  112. package/src/composables/index.ts +1 -0
  113. package/src/composables/useVirtualList.ts +286 -0
  114. package/src/version.ts +1 -1
  115. package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9_typescript@5.2.2_/node_modules/@vueuse/core/index.js +0 -379
  116. /package/lib/node_modules/.pnpm/{@vuepic_vue-datepicker@8.3.2_vue@3.3.9_typescript@5.2.2_ → @vuepic_vue-datepicker@8.3.2_vue@3.5.10_typescript@5.2.2_}/node_modules/@vuepic/vue-datepicker/dist/main.css.js +0 -0
  117. /package/lib/node_modules/.pnpm/{@vuepic_vue-datepicker@8.3.2_vue@3.3.9_typescript@5.2.2_ → @vuepic_vue-datepicker@8.3.2_vue@3.5.10_typescript@5.2.2_}/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +0 -0
  118. /package/lib/node_modules/.pnpm/{@vueuse_shared@10.2.0_vue@3.3.9_typescript@5.2.2_ → @vueuse_shared@10.2.0_vue@3.5.10_typescript@5.2.2_}/node_modules/@vueuse/shared/index.js +0 -0
  119. /package/lib/node_modules/.pnpm/{floating-vue@5.2.2_@nuxt_kit@3.10.1_rollup@3.29.4__vue@3.3.9_typescript@5.2.2_ → floating-vue@5.2.2_@nuxt_kit@3.10.1_rollup@3.29.4__vue@3.5.10_typescript@5.2.2_}/node_modules/floating-vue/dist/floating-vue.js +0 -0
@@ -0,0 +1,412 @@
1
+ import { noop as I, toValue as A, tryOnScopeDispose as W, isIOS as G, useThrottleFn as N, isClient as Q, increaseWithUnit as U, toRef as J, useDebounceFn as K } from "../../../../@vueuse_shared@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
2
+ import { createFilterWrapper as Se, debounceFilter as Oe, throttleFilter as xe } from "../../../../@vueuse_shared@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
3
+ import { watch as D, computed as O, ref as _, reactive as C, watchEffect as Z, getCurrentInstance as ee, onMounted as te } from "vue";
4
+ function S(e) {
5
+ var s;
6
+ const o = A(e);
7
+ return (s = o == null ? void 0 : o.$el) != null ? s : o;
8
+ }
9
+ const $ = Q ? window : void 0;
10
+ function x(...e) {
11
+ let s, o, n, i;
12
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, n, i] = e, s = $) : [s, o, n, i] = e, !s)
13
+ return I;
14
+ Array.isArray(o) || (o = [o]), Array.isArray(n) || (n = [n]);
15
+ const m = [], u = () => {
16
+ m.forEach((c) => c()), m.length = 0;
17
+ }, t = (c, p, l, d) => (c.addEventListener(p, l, d), () => c.removeEventListener(p, l, d)), r = D(
18
+ () => [S(s), A(i)],
19
+ ([c, p]) => {
20
+ u(), c && m.push(
21
+ ...o.flatMap((l) => n.map((d) => t(c, l, d, p)))
22
+ );
23
+ },
24
+ { immediate: !0, flush: "post" }
25
+ ), a = () => {
26
+ r(), u();
27
+ };
28
+ return W(a), a;
29
+ }
30
+ let H = !1;
31
+ function ve(e, s, o = {}) {
32
+ const { window: n = $, ignore: i = [], capture: m = !0, detectIframe: u = !1 } = o;
33
+ if (!n)
34
+ return;
35
+ G && !H && (H = !0, Array.from(n.document.body.children).forEach((l) => l.addEventListener("click", I)));
36
+ let t = !0;
37
+ const r = (l) => i.some((d) => {
38
+ if (typeof d == "string")
39
+ return Array.from(n.document.querySelectorAll(d)).some((h) => h === l.target || l.composedPath().includes(h));
40
+ {
41
+ const h = S(d);
42
+ return h && (l.target === h || l.composedPath().includes(h));
43
+ }
44
+ }), c = [
45
+ x(n, "click", (l) => {
46
+ const d = S(e);
47
+ if (!(!d || d === l.target || l.composedPath().includes(d))) {
48
+ if (l.detail === 0 && (t = !r(l)), !t) {
49
+ t = !0;
50
+ return;
51
+ }
52
+ s(l);
53
+ }
54
+ }, { passive: !0, capture: m }),
55
+ x(n, "pointerdown", (l) => {
56
+ const d = S(e);
57
+ d && (t = !l.composedPath().includes(d) && !r(l));
58
+ }, { passive: !0 }),
59
+ u && x(n, "blur", (l) => {
60
+ setTimeout(() => {
61
+ var d;
62
+ const h = S(e);
63
+ ((d = n.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(h != null && h.contains(n.document.activeElement)) && s(l);
64
+ }, 0);
65
+ })
66
+ ].filter(Boolean);
67
+ return () => c.forEach((l) => l());
68
+ }
69
+ function ne() {
70
+ const e = _(!1);
71
+ return ee() && te(() => {
72
+ e.value = !0;
73
+ }), e;
74
+ }
75
+ function k(e) {
76
+ const s = ne();
77
+ return O(() => (s.value, !!e()));
78
+ }
79
+ function B(e, s = {}) {
80
+ const { window: o = $ } = s, n = k(() => o && "matchMedia" in o && typeof o.matchMedia == "function");
81
+ let i;
82
+ const m = _(!1), u = () => {
83
+ i && ("removeEventListener" in i ? i.removeEventListener("change", t) : i.removeListener(t));
84
+ }, t = () => {
85
+ n.value && (u(), i = o.matchMedia(J(e).value), m.value = !!(i != null && i.matches), i && ("addEventListener" in i ? i.addEventListener("change", t) : i.addListener(t)));
86
+ };
87
+ return Z(t), W(() => u()), m;
88
+ }
89
+ const pe = {
90
+ sm: 640,
91
+ md: 768,
92
+ lg: 1024,
93
+ xl: 1280,
94
+ "2xl": 1536
95
+ };
96
+ function me(e, s = {}) {
97
+ function o(t, r) {
98
+ let a = e[t];
99
+ return r != null && (a = U(a, r)), typeof a == "number" && (a = `${a}px`), a;
100
+ }
101
+ const { window: n = $ } = s;
102
+ function i(t) {
103
+ return n ? n.matchMedia(t).matches : !1;
104
+ }
105
+ const m = (t) => B(`(min-width: ${o(t)})`, s), u = Object.keys(e).reduce((t, r) => (Object.defineProperty(t, r, {
106
+ get: () => m(r),
107
+ enumerable: !0,
108
+ configurable: !0
109
+ }), t), {});
110
+ return Object.assign(u, {
111
+ greater(t) {
112
+ return B(`(min-width: ${o(t, 0.1)})`, s);
113
+ },
114
+ greaterOrEqual: m,
115
+ smaller(t) {
116
+ return B(`(max-width: ${o(t, -0.1)})`, s);
117
+ },
118
+ smallerOrEqual(t) {
119
+ return B(`(max-width: ${o(t)})`, s);
120
+ },
121
+ between(t, r) {
122
+ return B(`(min-width: ${o(t)}) and (max-width: ${o(r, -0.1)})`, s);
123
+ },
124
+ isGreater(t) {
125
+ return i(`(min-width: ${o(t, 0.1)})`);
126
+ },
127
+ isGreaterOrEqual(t) {
128
+ return i(`(min-width: ${o(t)})`);
129
+ },
130
+ isSmaller(t) {
131
+ return i(`(max-width: ${o(t, -0.1)})`);
132
+ },
133
+ isSmallerOrEqual(t) {
134
+ return i(`(max-width: ${o(t)})`);
135
+ },
136
+ isInBetween(t, r) {
137
+ return i(`(min-width: ${o(t)}) and (max-width: ${o(r, -0.1)})`);
138
+ },
139
+ current() {
140
+ const t = Object.keys(e).map((r) => [r, m(r)]);
141
+ return O(() => t.filter(([, r]) => r.value).map(([r]) => r));
142
+ }
143
+ });
144
+ }
145
+ var X = Object.getOwnPropertySymbols, oe = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable, se = (e, s) => {
146
+ var o = {};
147
+ for (var n in e)
148
+ oe.call(e, n) && s.indexOf(n) < 0 && (o[n] = e[n]);
149
+ if (e != null && X)
150
+ for (var n of X(e))
151
+ s.indexOf(n) < 0 && re.call(e, n) && (o[n] = e[n]);
152
+ return o;
153
+ };
154
+ function he(e, s, o = {}) {
155
+ const n = o, { window: i = $ } = n, m = se(n, ["window"]);
156
+ let u;
157
+ const t = k(() => i && "MutationObserver" in i), r = () => {
158
+ u && (u.disconnect(), u = void 0);
159
+ }, a = D(
160
+ () => S(e),
161
+ (p) => {
162
+ r(), t.value && i && p && (u = new MutationObserver(s), u.observe(p, m));
163
+ },
164
+ { immediate: !0 }
165
+ ), c = () => {
166
+ r(), a();
167
+ };
168
+ return W(c), {
169
+ isSupported: t,
170
+ stop: c
171
+ };
172
+ }
173
+ var V = Object.getOwnPropertySymbols, ie = Object.prototype.hasOwnProperty, le = Object.prototype.propertyIsEnumerable, ue = (e, s) => {
174
+ var o = {};
175
+ for (var n in e)
176
+ ie.call(e, n) && s.indexOf(n) < 0 && (o[n] = e[n]);
177
+ if (e != null && V)
178
+ for (var n of V(e))
179
+ s.indexOf(n) < 0 && le.call(e, n) && (o[n] = e[n]);
180
+ return o;
181
+ };
182
+ function ae(e, s, o = {}) {
183
+ const n = o, { window: i = $ } = n, m = ue(n, ["window"]);
184
+ let u;
185
+ const t = k(() => i && "ResizeObserver" in i), r = () => {
186
+ u && (u.disconnect(), u = void 0);
187
+ }, a = O(
188
+ () => Array.isArray(e) ? e.map((l) => S(l)) : [S(e)]
189
+ ), c = D(
190
+ a,
191
+ (l) => {
192
+ if (r(), t.value && i) {
193
+ u = new ResizeObserver(s);
194
+ for (const d of l)
195
+ d && u.observe(d, m);
196
+ }
197
+ },
198
+ { immediate: !0, flush: "post", deep: !0 }
199
+ ), p = () => {
200
+ r(), c();
201
+ };
202
+ return W(p), {
203
+ isSupported: t,
204
+ stop: p
205
+ };
206
+ }
207
+ function be(e, s = { width: 0, height: 0 }, o = {}) {
208
+ const { window: n = $, box: i = "content-box" } = o, m = O(() => {
209
+ var r, a;
210
+ return (a = (r = S(e)) == null ? void 0 : r.namespaceURI) == null ? void 0 : a.includes("svg");
211
+ }), u = _(s.width), t = _(s.height);
212
+ return ae(
213
+ e,
214
+ ([r]) => {
215
+ const a = i === "border-box" ? r.borderBoxSize : i === "content-box" ? r.contentBoxSize : r.devicePixelContentBoxSize;
216
+ if (n && m.value) {
217
+ const c = S(e);
218
+ if (c) {
219
+ const p = n.getComputedStyle(c);
220
+ u.value = Number.parseFloat(p.width), t.value = Number.parseFloat(p.height);
221
+ }
222
+ } else if (a) {
223
+ const c = Array.isArray(a) ? a : [a];
224
+ u.value = c.reduce((p, { inlineSize: l }) => p + l, 0), t.value = c.reduce((p, { blockSize: l }) => p + l, 0);
225
+ } else
226
+ u.value = r.contentRect.width, t.value = r.contentRect.height;
227
+ },
228
+ o
229
+ ), D(
230
+ () => S(e),
231
+ (r) => {
232
+ u.value = r ? s.width : 0, t.value = r ? s.height : 0;
233
+ }
234
+ ), {
235
+ width: u,
236
+ height: t
237
+ };
238
+ }
239
+ const Y = 1;
240
+ function we(e, s = {}) {
241
+ const {
242
+ throttle: o = 0,
243
+ idle: n = 200,
244
+ onStop: i = I,
245
+ onScroll: m = I,
246
+ offset: u = {
247
+ left: 0,
248
+ right: 0,
249
+ top: 0,
250
+ bottom: 0
251
+ },
252
+ eventListenerOptions: t = {
253
+ capture: !1,
254
+ passive: !0
255
+ },
256
+ behavior: r = "auto"
257
+ } = s, a = _(0), c = _(0), p = O({
258
+ get() {
259
+ return a.value;
260
+ },
261
+ set(v) {
262
+ d(v, void 0);
263
+ }
264
+ }), l = O({
265
+ get() {
266
+ return c.value;
267
+ },
268
+ set(v) {
269
+ d(void 0, v);
270
+ }
271
+ });
272
+ function d(v, y) {
273
+ var M, T, f;
274
+ const w = A(e);
275
+ w && ((f = w instanceof Document ? document.body : w) == null || f.scrollTo({
276
+ top: (M = A(y)) != null ? M : l.value,
277
+ left: (T = A(v)) != null ? T : p.value,
278
+ behavior: A(r)
279
+ }));
280
+ }
281
+ const h = _(!1), b = C({
282
+ left: !0,
283
+ right: !1,
284
+ top: !0,
285
+ bottom: !1
286
+ }), E = C({
287
+ left: !1,
288
+ right: !1,
289
+ top: !1,
290
+ bottom: !1
291
+ }), R = (v) => {
292
+ h.value && (h.value = !1, E.left = !1, E.right = !1, E.top = !1, E.bottom = !1, i(v));
293
+ }, F = K(R, o + n), j = (v) => {
294
+ const y = v === window ? v.document.documentElement : v === document ? v.documentElement : v, { display: M, flexDirection: T } = getComputedStyle(y), f = y.scrollLeft;
295
+ E.left = f < a.value, E.right = f > a.value;
296
+ const w = Math.abs(f) <= 0 + (u.left || 0), L = Math.abs(f) + y.clientWidth >= y.scrollWidth - (u.right || 0) - Y;
297
+ M === "flex" && T === "row-reverse" ? (b.left = L, b.right = w) : (b.left = w, b.right = L), a.value = f;
298
+ let P = y.scrollTop;
299
+ v === document && !P && (P = document.body.scrollTop), E.top = P < c.value, E.bottom = P > c.value;
300
+ const z = Math.abs(P) <= 0 + (u.top || 0), q = Math.abs(P) + y.clientHeight >= y.scrollHeight - (u.bottom || 0) - Y;
301
+ M === "flex" && T === "column-reverse" ? (b.top = q, b.bottom = z) : (b.top = z, b.bottom = q), c.value = P;
302
+ }, g = (v) => {
303
+ const y = v.target === document ? v.target.documentElement : v.target;
304
+ j(y), h.value = !0, F(v), m(v);
305
+ };
306
+ return x(
307
+ e,
308
+ "scroll",
309
+ o ? N(g, o, !0, !1) : g,
310
+ t
311
+ ), x(
312
+ e,
313
+ "scrollend",
314
+ R,
315
+ t
316
+ ), {
317
+ x: p,
318
+ y: l,
319
+ isScrolling: h,
320
+ arrivedState: b,
321
+ directions: E,
322
+ measure() {
323
+ const v = A(e);
324
+ v && j(v);
325
+ }
326
+ };
327
+ }
328
+ function ye(e, s = {}) {
329
+ const {
330
+ threshold: o = 50,
331
+ onSwipe: n,
332
+ onSwipeEnd: i,
333
+ onSwipeStart: m,
334
+ passive: u = !0,
335
+ window: t = $
336
+ } = s, r = C({ x: 0, y: 0 }), a = C({ x: 0, y: 0 }), c = O(() => r.x - a.x), p = O(() => r.y - a.y), { max: l, abs: d } = Math, h = O(() => l(d(c.value), d(p.value)) >= o), b = _(!1), E = O(() => h.value ? d(c.value) > d(p.value) ? c.value > 0 ? "left" : "right" : p.value > 0 ? "up" : "down" : "none"), R = (f) => [f.touches[0].clientX, f.touches[0].clientY], F = (f, w) => {
337
+ r.x = f, r.y = w;
338
+ }, j = (f, w) => {
339
+ a.x = f, a.y = w;
340
+ };
341
+ let g;
342
+ const v = ce(t == null ? void 0 : t.document);
343
+ u ? g = v ? { passive: !0 } : { capture: !1 } : g = v ? { passive: !1, capture: !0 } : { capture: !0 };
344
+ const y = (f) => {
345
+ b.value && (i == null || i(f, E.value)), b.value = !1;
346
+ }, M = [
347
+ x(e, "touchstart", (f) => {
348
+ if (f.touches.length !== 1)
349
+ return;
350
+ g.capture && !g.passive && f.preventDefault();
351
+ const [w, L] = R(f);
352
+ F(w, L), j(w, L), m == null || m(f);
353
+ }, g),
354
+ x(e, "touchmove", (f) => {
355
+ if (f.touches.length !== 1)
356
+ return;
357
+ const [w, L] = R(f);
358
+ j(w, L), !b.value && h.value && (b.value = !0), b.value && (n == null || n(f));
359
+ }, g),
360
+ x(e, "touchend", y, g),
361
+ x(e, "touchcancel", y, g)
362
+ ];
363
+ return {
364
+ isPassiveEventSupported: v,
365
+ isSwiping: b,
366
+ direction: E,
367
+ coordsStart: r,
368
+ coordsEnd: a,
369
+ lengthX: c,
370
+ lengthY: p,
371
+ stop: () => M.forEach((f) => f())
372
+ };
373
+ }
374
+ function ce(e) {
375
+ if (!e)
376
+ return !1;
377
+ let s = !1;
378
+ const o = {
379
+ get passive() {
380
+ return s = !0, !1;
381
+ }
382
+ };
383
+ return e.addEventListener("x", I, o), e.removeEventListener("x", I), s;
384
+ }
385
+ export {
386
+ pe as breakpointsTailwind,
387
+ Se as createFilterWrapper,
388
+ Oe as debounceFilter,
389
+ $ as defaultWindow,
390
+ U as increaseWithUnit,
391
+ Q as isClient,
392
+ G as isIOS,
393
+ I as noop,
394
+ ve as onClickOutside,
395
+ xe as throttleFilter,
396
+ J as toRef,
397
+ A as toValue,
398
+ W as tryOnScopeDispose,
399
+ S as unrefElement,
400
+ me as useBreakpoints,
401
+ K as useDebounceFn,
402
+ be as useElementSize,
403
+ x as useEventListener,
404
+ B as useMediaQuery,
405
+ ne as useMounted,
406
+ he as useMutationObserver,
407
+ ae as useResizeObserver,
408
+ we as useScroll,
409
+ k as useSupported,
410
+ ye as useSwipe,
411
+ N as useThrottleFn
412
+ };
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.8.4";
1
+ declare const _default: "1.9.1";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const e = "1.8.4";
1
+ const e = "1.9.1";
2
2
  export {
3
3
  e as default
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indielayer/ui",
3
- "version": "1.8.4",
3
+ "version": "1.9.1",
4
4
  "description": "Indielayer UI Components with Tailwind CSS build for Vue 3",
5
5
  "author": {
6
6
  "name": "João Teixeira",
@@ -45,7 +45,7 @@
45
45
  "sideEffects": false,
46
46
  "peerDependencies": {
47
47
  "tailwindcss": "^3.0.0",
48
- "vue": "^3.0.0"
48
+ "vue": "^3.4.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@indielayer/stylelint-config": "^1.0.0",
@@ -74,7 +74,7 @@
74
74
  "typescript": "^5.2.2",
75
75
  "vite": "^4.4.11",
76
76
  "vitest": "^0.32.2",
77
- "vue": "^3.3.9",
77
+ "vue": "^3.5.0",
78
78
  "vue-router": "^4.2.2",
79
79
  "vue-tsc": "^1.8.2"
80
80
  },
@@ -14,6 +14,17 @@ const selectProps = {
14
14
  type: String,
15
15
  default: 'Filter by...',
16
16
  },
17
+ virtualList: Boolean,
18
+ virtualListOffsetTop: Number,
19
+ virtualListOffsetBottom: Number,
20
+ virtualListItemHeight: {
21
+ type: Number,
22
+ default: 33,
23
+ },
24
+ virtualListOverscan: {
25
+ type: Number,
26
+ default: 5,
27
+ },
17
28
  }
18
29
 
19
30
  export type SelectOption = {
@@ -44,6 +55,7 @@ import { useCommon } from '../../composables/useCommon'
44
55
  import { useInputtable } from '../../composables/useInputtable'
45
56
  import { useInteractive } from '../../composables/useInteractive'
46
57
  import { useTheme, type ThemeComponent } from '../../composables/useTheme'
58
+ import { useVirtualList } from '../../composables/useVirtualList'
47
59
  import { checkIcon, selectIcon } from '../../common/icons'
48
60
 
49
61
  import XLabel from '../label/Label.vue'
@@ -113,6 +125,17 @@ const internalOptions = computed(() => {
113
125
 
114
126
  const availableOptions = computed(() => internalOptions.value.filter((option) => !option.disabled))
115
127
 
128
+ const { list, scrollTo: scrollToVirtualList, containerProps, wrapperProps } = useVirtualList(
129
+ internalOptions,
130
+ {
131
+ disabled: !props.virtualList,
132
+ itemHeight: props.virtualListItemHeight,
133
+ topOffset: props.virtualListOffsetTop || 0,
134
+ bottomOffset: props.virtualListOffsetBottom || 0,
135
+ overscan: props.virtualListOverscan,
136
+ },
137
+ )
138
+
116
139
  const isOpen = computed(() => popoverRef.value?.isOpen)
117
140
 
118
141
  watch(filter, (val) => {
@@ -158,7 +181,8 @@ function findSelectedIndex() {
158
181
  }
159
182
 
160
183
  function scrollToIndex(index: number) {
161
- if (itemsRef.value) itemsRef.value[index]?.$el.scrollIntoView({ block: 'nearest', inline: 'nearest' })
184
+ if (props.virtualList) scrollToVirtualList(index)
185
+ else if (itemsRef.value) itemsRef.value[index]?.$el.scrollIntoView({ block: 'nearest', inline: 'nearest' })
162
186
  }
163
187
 
164
188
  watch(selectedIndex, (index) => {
@@ -419,7 +443,9 @@ defineExpose({ focus, blur, reset, validate, setError })
419
443
  </div>
420
444
 
421
445
  <template #content>
422
- <x-popover-container :class="classes.content">
446
+ <x-popover-container
447
+ :class="classes.content"
448
+ >
423
449
  <slot name="content-header">
424
450
  <div v-if="filterable" :class="classes.search">
425
451
  <x-input
@@ -431,22 +457,24 @@ defineExpose({ focus, blur, reset, validate, setError })
431
457
  />
432
458
  </div>
433
459
  </slot>
434
- <div v-if="internalOptions.length > 0" :class="classes.contentBody">
435
- <x-menu-item
436
- v-for="(item, index) in internalOptions"
437
- :key="index"
438
- ref="itemsRef"
439
- :item="item"
440
- :size="size"
441
- :disabled="item.disabled"
442
- :selected="index === selectedIndex"
443
- :color="color"
444
- filled
445
- @click="() => !multiple && popoverRef?.hide()"
446
- />
447
- </div>
448
- <div v-else class="px-2 text-center text-secondary-400">
449
- No options
460
+ <div v-bind="containerProps" :class="classes.contentBody">
461
+ <div v-bind="wrapperProps">
462
+ <x-menu-item
463
+ v-for="item in list"
464
+ :key="item.index"
465
+ ref="itemsRef"
466
+ :item="item.data"
467
+ :size="size"
468
+ :disabled="item.data.disabled"
469
+ :selected="item.index === selectedIndex"
470
+ :color="color"
471
+ filled
472
+ @click="() => !multiple && popoverRef?.hide()"
473
+ />
474
+ </div>
475
+ <div v-if="list.length === 0" class="p-2 text-center text-secondary-400">
476
+ No options
477
+ </div>
450
478
  </div>
451
479
  <slot name="content-footer"></slot>
452
480
  </x-popover-container>
@@ -465,14 +493,16 @@ defineExpose({ focus, blur, reset, validate, setError })
465
493
  :readonly="readonly"
466
494
  v-on="inputListeners"
467
495
  >
468
- <option
469
- v-for="(option, index) in options"
470
- :key="index"
471
- :value="option.value"
472
- :disabled="option.disabled"
473
- >
474
- {{ option.label }}
475
- </option>
496
+ <template v-if="native">
497
+ <option
498
+ v-for="(option, index) in options"
499
+ :key="index"
500
+ :value="option.value"
501
+ :disabled="option.disabled"
502
+ >
503
+ {{ option.label }}
504
+ </option>
505
+ </template>
476
506
  </select>
477
507
 
478
508
  <div :class="classes.iconWrapper">
@@ -31,7 +31,7 @@ const theme: SelectTheme = {
31
31
 
32
32
  search: 'p-1 mb-0.5',
33
33
 
34
- contentBody: 'overflow-y-auto max-h-64',
34
+ contentBody: 'overflow-y-auto max-h-64 min-w-[280px]',
35
35
 
36
36
  iconWrapper: 'pointer-events-none absolute inset-y-0 right-0 flex items-center px-2',
37
37