@pequity/squirrel 1.0.20-beta.2 → 1.0.20-beta.3

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 (144) hide show
  1. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -1
  2. package/dist/cjs/chunks/p-action-bar.js +60 -1
  3. package/dist/cjs/chunks/p-card.js +28 -1
  4. package/dist/cjs/chunks/p-checkbox.js +24 -1
  5. package/dist/cjs/chunks/p-dropdown-select.js +414 -1
  6. package/dist/cjs/chunks/p-input-percent.js +53 -1
  7. package/dist/cjs/chunks/p-pagination-info.js +66 -1
  8. package/dist/cjs/chunks/p-pagination.js +122 -1
  9. package/dist/cjs/chunks/p-ring-loader.js +81 -1
  10. package/dist/cjs/chunks/p-select-btn.js +97 -1
  11. package/dist/cjs/chunks/p-select.js +123 -1
  12. package/dist/cjs/chunks/p-table-loader.js +70 -1
  13. package/dist/cjs/chunks/p-tabs.js +52 -1
  14. package/dist/cjs/config.js +105 -1
  15. package/dist/cjs/currency.js +9 -1
  16. package/dist/cjs/dom.js +27 -1
  17. package/dist/cjs/index.js +976 -1
  18. package/dist/cjs/inputClassesMixin.js +50 -1
  19. package/dist/cjs/inputClassesShared.js +76 -1
  20. package/dist/cjs/listKeyboardNavigation.js +110 -1
  21. package/dist/cjs/number.js +9 -1
  22. package/dist/cjs/object.js +4 -1
  23. package/dist/cjs/p-action-bar.js +3 -1
  24. package/dist/cjs/p-alert.js +65 -1
  25. package/dist/cjs/p-avatar.js +71 -1
  26. package/dist/cjs/p-btn.js +358 -2
  27. package/dist/cjs/p-card.js +3 -1
  28. package/dist/cjs/p-checkbox.js +3 -1
  29. package/dist/cjs/p-chips.js +110 -1
  30. package/dist/cjs/p-close-btn.js +36 -1
  31. package/dist/cjs/p-date-picker.js +139 -1
  32. package/dist/cjs/p-drawer.js +253 -1
  33. package/dist/cjs/p-dropdown-select.js +3 -1
  34. package/dist/cjs/p-dropdown.js +138 -1
  35. package/dist/cjs/p-file-upload.js +21 -1
  36. package/dist/cjs/p-info-icon.js +35 -1
  37. package/dist/cjs/p-inline-date-picker.js +142 -1
  38. package/dist/cjs/p-input-number.js +146 -1
  39. package/dist/cjs/p-input-percent.js +3 -1
  40. package/dist/cjs/p-input-search.js +110 -1
  41. package/dist/cjs/p-input.js +89 -1
  42. package/dist/cjs/p-loading.js +38 -1
  43. package/dist/cjs/p-modal.js +369 -1
  44. package/dist/cjs/p-pagination-info.js +3 -1
  45. package/dist/cjs/p-pagination.js +3 -1
  46. package/dist/cjs/p-progress-bar.js +41 -1
  47. package/dist/cjs/p-ring-loader.js +3 -1
  48. package/dist/cjs/p-select-btn.js +3 -1
  49. package/dist/cjs/p-select-list.js +4 -1
  50. package/dist/cjs/p-select-pill.js +111 -1
  51. package/dist/cjs/p-select.js +3 -1
  52. package/dist/cjs/p-skeleton-loader.js +73 -1
  53. package/dist/cjs/p-table-filter-icon.js +20 -1
  54. package/dist/cjs/p-table-header-cell.js +75 -1
  55. package/dist/cjs/p-table-loader.js +3 -1
  56. package/dist/cjs/p-table-sort.js +8 -1
  57. package/dist/cjs/p-table-td.js +88 -1
  58. package/dist/cjs/p-table.js +12 -1
  59. package/dist/cjs/p-tabs.js +3 -1
  60. package/dist/cjs/p-textarea.js +73 -1
  61. package/dist/cjs/p-toggle.js +114 -1
  62. package/dist/cjs/pagination.js +29 -1
  63. package/dist/cjs/string.js +12 -1
  64. package/dist/cjs/tailwind.js +4353 -1
  65. package/dist/cjs/text.js +16 -1
  66. package/dist/cjs/useInputClasses.js +44 -1
  67. package/dist/cjs/usePLoading.js +35 -1
  68. package/dist/cjs/usePModal.js +21 -1
  69. package/dist/cjs/usePTableColResize.js +81 -1
  70. package/dist/cjs/usePTableRowVirtualizer.js +31 -1
  71. package/dist/cjs/useSelectList.js +256 -1
  72. package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
  73. package/dist/es/chunks/p-action-bar.js +45 -36
  74. package/dist/es/chunks/p-card.js +18 -14
  75. package/dist/es/chunks/p-checkbox.js +14 -11
  76. package/dist/es/chunks/p-dropdown-select.js +232 -183
  77. package/dist/es/chunks/p-input-percent.js +34 -25
  78. package/dist/es/chunks/p-pagination-info.js +30 -24
  79. package/dist/es/chunks/p-pagination.js +78 -48
  80. package/dist/es/chunks/p-ring-loader.js +63 -40
  81. package/dist/es/chunks/p-select-btn.js +80 -59
  82. package/dist/es/chunks/p-select.js +81 -54
  83. package/dist/es/chunks/p-table-loader.js +46 -32
  84. package/dist/es/chunks/p-tabs.js +35 -29
  85. package/dist/es/config.js +2 -2
  86. package/dist/es/currency.js +3 -3
  87. package/dist/es/dom.js +24 -12
  88. package/dist/es/index.js +703 -561
  89. package/dist/es/inputClassesMixin.js +20 -14
  90. package/dist/es/inputClassesShared.js +60 -45
  91. package/dist/es/listKeyboardNavigation.js +86 -36
  92. package/dist/es/number.js +7 -2
  93. package/dist/es/object.js +2 -2
  94. package/dist/es/p-action-bar.js +2 -2
  95. package/dist/es/p-alert.js +35 -30
  96. package/dist/es/p-avatar.js +30 -27
  97. package/dist/es/p-btn.js +209 -164
  98. package/dist/es/p-card.js +2 -2
  99. package/dist/es/p-checkbox.js +2 -2
  100. package/dist/es/p-chips.js +60 -40
  101. package/dist/es/p-close-btn.js +20 -16
  102. package/dist/es/p-date-picker.js +66 -58
  103. package/dist/es/p-drawer.js +108 -89
  104. package/dist/es/p-dropdown-select.js +2 -2
  105. package/dist/es/p-dropdown.js +52 -33
  106. package/dist/es/p-file-upload.js +17 -9
  107. package/dist/es/p-info-icon.js +21 -16
  108. package/dist/es/p-inline-date-picker.js +64 -53
  109. package/dist/es/p-input-number.js +84 -66
  110. package/dist/es/p-input-percent.js +2 -2
  111. package/dist/es/p-input-search.js +43 -41
  112. package/dist/es/p-input.js +51 -45
  113. package/dist/es/p-loading.js +31 -22
  114. package/dist/es/p-modal.js +261 -174
  115. package/dist/es/p-pagination-info.js +2 -2
  116. package/dist/es/p-pagination.js +2 -2
  117. package/dist/es/p-progress-bar.js +26 -23
  118. package/dist/es/p-ring-loader.js +2 -2
  119. package/dist/es/p-select-btn.js +2 -2
  120. package/dist/es/p-select-list.js +2 -2
  121. package/dist/es/p-select-pill.js +58 -41
  122. package/dist/es/p-select.js +2 -2
  123. package/dist/es/p-skeleton-loader.js +34 -29
  124. package/dist/es/p-table-filter-icon.js +11 -11
  125. package/dist/es/p-table-header-cell.js +38 -33
  126. package/dist/es/p-table-loader.js +2 -2
  127. package/dist/es/p-table-sort.js +2 -2
  128. package/dist/es/p-table-td.js +76 -29
  129. package/dist/es/p-table.js +10 -6
  130. package/dist/es/p-tabs.js +2 -2
  131. package/dist/es/p-textarea.js +36 -34
  132. package/dist/es/p-toggle.js +53 -48
  133. package/dist/es/pagination.js +25 -8
  134. package/dist/es/string.js +10 -2
  135. package/dist/es/tailwind.js +1660 -1101
  136. package/dist/es/text.js +13 -8
  137. package/dist/es/useInputClasses.js +38 -22
  138. package/dist/es/usePLoading.js +31 -15
  139. package/dist/es/usePModal.js +15 -12
  140. package/dist/es/usePTableColResize.js +71 -39
  141. package/dist/es/usePTableRowVirtualizer.js +24 -15
  142. package/dist/es/useSelectList.js +234 -121
  143. package/dist/style.css +2124 -1
  144. package/package.json +1 -1
@@ -1,6 +1,8 @@
1
- import { defineComponent as s, openBlock as r, createElementBlock as o, renderSlot as l, normalizeClass as a, toDisplayString as i, createCommentVNode as d } from "vue";
2
- const p = { class: "border border-p-gray-30 bg-surface px-6 pt-6" }, n = "text-xl font-medium leading-none text-p-purple-60", u = /* @__PURE__ */ s({
3
- name: "PCard",
1
+ import { defineComponent, openBlock, createElementBlock, renderSlot, normalizeClass, toDisplayString, createCommentVNode } from "vue";
2
+ const _hoisted_1 = { class: "border border-p-gray-30 bg-surface px-6 pt-6" };
3
+ const titleClass = "text-xl font-medium leading-none text-p-purple-60";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ ...{ name: "PCard" },
4
6
  __name: "p-card",
5
7
  props: {
6
8
  title: {
@@ -8,18 +10,20 @@ const p = { class: "border border-p-gray-30 bg-surface px-6 pt-6" }, n = "text-x
8
10
  default: ""
9
11
  }
10
12
  },
11
- setup(e) {
12
- return (t, c) => (r(), o("div", p, [
13
- l(t.$slots, "title", { titleClass: n }, () => [
14
- e.title ? (r(), o("div", {
15
- key: 0,
16
- class: a(n)
17
- }, i(e.title), 1)) : d("", !0)
18
- ]),
19
- l(t.$slots, "default")
20
- ]));
13
+ setup(__props) {
14
+ return (_ctx, _cache) => {
15
+ return openBlock(), createElementBlock("div", _hoisted_1, [
16
+ renderSlot(_ctx.$slots, "title", { titleClass }, () => [
17
+ __props.title ? (openBlock(), createElementBlock("div", {
18
+ key: 0,
19
+ class: normalizeClass(titleClass)
20
+ }, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
21
+ ]),
22
+ renderSlot(_ctx.$slots, "default")
23
+ ]);
24
+ };
21
25
  }
22
26
  });
23
27
  export {
24
- u as _
28
+ _sfc_main as _
25
29
  };
@@ -1,22 +1,25 @@
1
- import { defineComponent as l, openBlock as n, createElementBlock as a } from "vue";
2
- const p = ["checked"], r = /* @__PURE__ */ l({
1
+ import { defineComponent, openBlock, createElementBlock } from "vue";
2
+ const _hoisted_1 = ["checked"];
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3
4
  __name: "p-checkbox",
4
5
  props: {
5
6
  modelValue: {
6
7
  type: Boolean,
7
- default: !1
8
+ default: false
8
9
  }
9
10
  },
10
11
  emits: ["update:modelValue"],
11
- setup(o) {
12
- return (t, e) => (n(), a("input", {
13
- type: "checkbox",
14
- class: "cursor-pointer accent-p-blue-50",
15
- checked: o.modelValue,
16
- onChange: e[0] || (e[0] = (c) => t.$emit("update:modelValue", c.target.checked))
17
- }, null, 40, p));
12
+ setup(__props) {
13
+ return (_ctx, _cache) => {
14
+ return openBlock(), createElementBlock("input", {
15
+ type: "checkbox",
16
+ class: "cursor-pointer accent-p-blue-50",
17
+ checked: __props.modelValue,
18
+ onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event.target.checked))
19
+ }, null, 40, _hoisted_1);
20
+ };
18
21
  }
19
22
  });
20
23
  export {
21
- r as _
24
+ _sfc_main as _
22
25
  };
@@ -1,25 +1,38 @@
1
- import { defineComponent as Se, ref as d, useAttrs as xe, computed as k, watch as be, onMounted as we, onUnmounted as Ce, resolveDirective as ke, openBlock as n, createElementBlock as i, normalizeClass as r, unref as e, normalizeStyle as S, toDisplayString as y, createCommentVNode as v, createVNode as R, mergeProps as T, withCtx as q, createElementVNode as a, isRef as Ae, Fragment as U, renderList as Z, withDirectives as W, renderSlot as V, vShow as Ie } from "vue";
2
- import ze from "../p-dropdown.js";
3
- import Me from "../p-input-search.js";
4
- import { SIZES as L } from "../p-select-list.js";
5
- import { omit as Te } from "lodash-es";
6
- import { splitStringForHighlight as Y } from "../text.js";
7
- import { toString as $ } from "../string.js";
8
- import { useInputClasses as Ve } from "../useInputClasses.js";
9
- import { useSelectList as Le } from "../useSelectList.js";
10
- const $e = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%200%2018%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.1383%200.166992L6.30411%209.83366L1.69828%205.27533L0.526611%206.46033L5.71578%2011.597C5.87174%2011.7509%206.08205%2011.8372%206.3012%2011.8372C6.52034%2011.8372%206.73065%2011.7509%206.88661%2011.597L17.3033%201.35366L16.1383%200.166992Z'%20fill='%231A123B'%20/%3e%3c/svg%3e", Ne = ["data-has-error"], Be = {
1
+ import { defineComponent, ref, useAttrs, computed, watch, onMounted, onUnmounted, resolveDirective, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, toDisplayString, createCommentVNode, createVNode, mergeProps, withCtx, createElementVNode, isRef, Fragment, renderList, withDirectives, renderSlot, vShow } from "vue";
2
+ import PDropdown from "../p-dropdown.js";
3
+ import PInputSearch from "../p-input-search.js";
4
+ import { SIZES } from "../p-select-list.js";
5
+ import { omit } from "lodash-es";
6
+ import { splitStringForHighlight } from "../text.js";
7
+ import { toString } from "../string.js";
8
+ import { useInputClasses } from "../useInputClasses.js";
9
+ import { useSelectList } from "../useSelectList.js";
10
+ const _imports_0 = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%200%2018%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.1383%200.166992L6.30411%209.83366L1.69828%205.27533L0.526611%206.46033L5.71578%2011.597C5.87174%2011.7509%206.08205%2011.8372%206.3012%2011.8372C6.52034%2011.8372%206.73065%2011.7509%206.88661%2011.597L17.3033%201.35366L16.1383%200.166992Z'%20fill='%231A123B'%20/%3e%3c/svg%3e";
11
+ const _hoisted_1 = ["data-has-error"];
12
+ const _hoisted_2 = {
11
13
  key: 0,
12
14
  class: "truncate text-left text-p-gray-40"
13
- }, De = { class: "truncate text-left" }, Oe = {
15
+ };
16
+ const _hoisted_3 = { class: "truncate text-left" };
17
+ const _hoisted_4 = {
14
18
  key: 0,
15
19
  class: "mt-3 px-3"
16
- }, Pe = { class: "text-p-purple-60" }, je = { class: "flex flex-row" }, Ee = /* @__PURE__ */ a("span", { class: "px-1 leading-none" }, ".", -1), Fe = ["onClick"], He = ["title"], Re = {
20
+ };
21
+ const _hoisted_5 = { class: "text-p-purple-60" };
22
+ const _hoisted_6 = { class: "flex flex-row" };
23
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", { class: "px-1 leading-none" }, ".", -1);
24
+ const _hoisted_8 = ["onClick"];
25
+ const _hoisted_9 = ["title"];
26
+ const _hoisted_10 = {
17
27
  key: 0,
18
28
  class: "ml-auto fill-p-purple-60 pl-2",
19
- src: $e
20
- }, Xe = /* @__PURE__ */ Se({
21
- name: "PDropdownSelect",
22
- inheritAttrs: !1,
29
+ src: _imports_0
30
+ };
31
+ const _sfc_main = /* @__PURE__ */ defineComponent({
32
+ ...{
33
+ name: "PDropdownSelect",
34
+ inheritAttrs: false
35
+ },
23
36
  __name: "p-dropdown-select",
24
37
  props: {
25
38
  modelValue: {
@@ -33,7 +46,7 @@ const $e = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%20
33
46
  */
34
47
  valueIsObject: {
35
48
  type: Boolean,
36
- default: !1
49
+ default: false
37
50
  },
38
51
  /**
39
52
  * Can be an array of objects or array of strings. When using objects, will look for a text - value pair.
@@ -53,13 +66,13 @@ const $e = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%20
53
66
  },
54
67
  required: {
55
68
  type: Boolean,
56
- default: !1
69
+ default: false
57
70
  },
58
71
  size: {
59
72
  type: String,
60
73
  default: "md",
61
- validator(t) {
62
- return Object.keys(L).includes(t);
74
+ validator(value) {
75
+ return Object.keys(SIZES).includes(value);
63
76
  }
64
77
  },
65
78
  /**
@@ -109,14 +122,14 @@ const $e = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%20
109
122
  },
110
123
  searchable: {
111
124
  type: Boolean,
112
- default: !1
125
+ default: false
113
126
  },
114
127
  /**
115
128
  * Enables multiple selection
116
129
  */
117
130
  multiple: {
118
131
  type: Boolean,
119
- default: !1
132
+ default: false
120
133
  },
121
134
  /**
122
135
  * Dropdown button text
@@ -137,230 +150,266 @@ const $e = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%20
137
150
  */
138
151
  selectedTopShown: {
139
152
  type: Boolean,
140
- default: !1
153
+ default: false
141
154
  }
142
155
  },
143
156
  emits: ["update:modelValue", "select"],
144
- setup(t, { emit: G }) {
145
- const J = G, m = t, K = () => new Promise((o) => requestAnimationFrame(() => requestAnimationFrame(o))), Q = (o) => new Promise((s) => setTimeout(s, o || 0)), X = {
157
+ setup(__props, { emit: __emit }) {
158
+ const emit = __emit;
159
+ const props = __props;
160
+ const nextFrame = () => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
161
+ const nextLoop = (ms) => new Promise((resolve) => setTimeout(resolve, ms || 0));
162
+ const P_DROPDOWN_DEFAULTS = {
146
163
  triggerStyle: { display: "block" },
147
164
  triggers: [],
148
165
  distance: 2,
149
166
  placement: "bottom-end",
150
- noAutoFocus: !0,
151
- enableArrowNavigation: !1
152
- }, N = d("auto"), _ = d({ paddingTop: 0, paddingBottom: 0 }), p = d(!1);
153
- let x = null;
154
- const B = d({ maxHeight: "none" }), h = d(null), A = d(null), D = d(null), b = xe(), O = d(null), { labelClasses: ee, selectClasses: te, errorMsgClasses: le } = Ve(m), {
155
- LIST_ITEM_CLASS: se,
156
- LIST_ITEM_ACTIVE_CLASS: oe,
157
- selectedItems: u,
158
- computedItems: w,
159
- computedItemSize: ne,
160
- computedInsideSelected: ie,
161
- internalItems: P,
162
- internalValue: ae,
163
- search: f,
164
- rowVirtualizer: j,
165
- getValue: g,
166
- getText: I,
167
- isSelected: z,
168
- setupNavigationSvc: re,
169
- destroyNavigationSvc: ue,
170
- select: ce,
171
- onMousemove: E,
172
- scrollToActiveItem: de,
173
- putSelectedItemsOnTop: me,
174
- selectAll: C,
175
- clearAll: F
176
- } = Le(m, A, O, J), pe = k(() => Te(m.dropdownMenuAttrs, ["class", "style"])), fe = k(() => ({ ...m.dropdownMenuStyle, width: N.value })), ye = k(() => {
177
- const { class: o, style: s, ...c } = b;
178
- return c;
179
- }), ve = k(() => b.style);
180
- be(
181
- p,
182
- (o) => {
183
- o && me();
167
+ noAutoFocus: true,
168
+ enableArrowNavigation: false
169
+ };
170
+ const width = ref("auto");
171
+ const listItemStyle = ref({ paddingTop: 0, paddingBottom: 0 });
172
+ const dropdownShow = ref(false);
173
+ let observer = null;
174
+ const scrollerStyle = ref({ maxHeight: "none" });
175
+ const formControl = ref(null);
176
+ const inputSearch = ref(null);
177
+ const actionsContainer = ref(null);
178
+ const $attrs = useAttrs();
179
+ const virtualizerRef = ref(null);
180
+ const { labelClasses, selectClasses, errorMsgClasses } = useInputClasses(props);
181
+ const {
182
+ LIST_ITEM_CLASS,
183
+ LIST_ITEM_ACTIVE_CLASS,
184
+ selectedItems,
185
+ computedItems,
186
+ computedItemSize,
187
+ computedInsideSelected,
188
+ internalItems,
189
+ internalValue,
190
+ search,
191
+ rowVirtualizer,
192
+ getValue,
193
+ getText,
194
+ isSelected,
195
+ setupNavigationSvc,
196
+ destroyNavigationSvc,
197
+ select,
198
+ onMousemove,
199
+ scrollToActiveItem,
200
+ putSelectedItemsOnTop,
201
+ selectAll,
202
+ clearAll
203
+ } = useSelectList(props, inputSearch, virtualizerRef, emit);
204
+ const menuAttrs = computed(() => omit(props.dropdownMenuAttrs, ["class", "style"]));
205
+ const menuStyle = computed(() => ({ ...props.dropdownMenuStyle, width: width.value }));
206
+ const attrs = computed(() => {
207
+ const { class: classes, style: style2, ...rest } = $attrs;
208
+ return rest;
209
+ });
210
+ const style = computed(() => $attrs.style);
211
+ watch(
212
+ dropdownShow,
213
+ (nV) => {
214
+ nV && putSelectedItemsOnTop();
184
215
  },
185
216
  {
186
- immediate: !0
217
+ immediate: true
187
218
  }
188
- ), we(() => {
189
- x = new ResizeObserver((o) => {
190
- o.forEach((s) => {
191
- const c = s.contentRect;
192
- N.value = c.width + "px" || "auto";
219
+ );
220
+ onMounted(() => {
221
+ observer = new ResizeObserver((entries) => {
222
+ entries.forEach((entry) => {
223
+ const rect = entry.contentRect;
224
+ width.value = rect.width + "px" || "auto";
193
225
  });
194
- }), x.observe(h.value);
195
- }), Ce(() => {
196
- h.value && x && x.unobserve(h.value);
226
+ });
227
+ observer.observe(formControl.value);
228
+ });
229
+ onUnmounted(() => {
230
+ formControl.value && observer && observer.unobserve(formControl.value);
197
231
  });
198
- const he = async () => {
199
- var s, c;
200
- const o = ((s = D.value) == null ? void 0 : s.clientHeight) || 0;
201
- B.value = { maxHeight: `${ne.value * m.itemsVisible - o}px` }, f.value = "", re(), m.searchable && (await Q(), await K(), (c = A.value) == null || c.$el.querySelector("input").focus()), de();
202
- }, ge = () => {
203
- var o;
204
- p.value = !1, ue(), ((o = h.value) == null ? void 0 : o.querySelector("button")).focus();
232
+ const onShow = async () => {
233
+ var _a, _b;
234
+ const actionsContainerHeight = ((_a = actionsContainer.value) == null ? void 0 : _a.clientHeight) || 0;
235
+ scrollerStyle.value = { maxHeight: `${computedItemSize.value * props.itemsVisible - actionsContainerHeight}px` };
236
+ search.value = "";
237
+ setupNavigationSvc();
238
+ if (props.searchable) {
239
+ await nextLoop();
240
+ await nextFrame();
241
+ (_b = inputSearch.value) == null ? void 0 : _b.$el.querySelector("input").focus();
242
+ }
243
+ scrollToActiveItem();
244
+ };
245
+ const onHide = () => {
246
+ var _a;
247
+ dropdownShow.value = false;
248
+ destroyNavigationSvc();
249
+ ((_a = formControl.value) == null ? void 0 : _a.querySelector("button")).focus();
205
250
  };
206
- return (o, s) => {
207
- const c = ke("close-popper");
208
- return n(), i("div", {
251
+ return (_ctx, _cache) => {
252
+ const _directive_close_popper = resolveDirective("close-popper");
253
+ return openBlock(), createElementBlock("div", {
209
254
  ref_key: "formControl",
210
- ref: h,
211
- class: r([{ hidden: e(b).hidden }, e(b).class]),
212
- "data-has-error": !!t.errorMsg,
213
- style: S(ve.value),
255
+ ref: formControl,
256
+ class: normalizeClass([{ hidden: unref($attrs).hidden }, unref($attrs).class]),
257
+ "data-has-error": !!__props.errorMsg,
258
+ style: normalizeStyle(style.value),
214
259
  "aria-label": "Dropdown select"
215
260
  }, [
216
- t.label ? (n(), i("label", {
261
+ __props.label ? (openBlock(), createElementBlock("label", {
217
262
  key: 0,
218
- class: r(e(ee))
219
- }, y(t.label), 3)) : v("", !0),
220
- R(ze, T({ shown: p.value }, { ...X, ...t.pDropdownProps }, {
263
+ class: normalizeClass(unref(labelClasses))
264
+ }, toDisplayString(__props.label), 3)) : createCommentVNode("", true),
265
+ createVNode(PDropdown, mergeProps({ shown: dropdownShow.value }, { ...P_DROPDOWN_DEFAULTS, ...__props.pDropdownProps }, {
221
266
  class: "relative flex w-full items-center justify-center",
222
- onApplyShow: he,
223
- onApplyHide: ge
267
+ onApplyShow: onShow,
268
+ onApplyHide: onHide
224
269
  }), {
225
- popper: q(() => [
226
- a("div", T(pe.value, {
227
- class: t.dropdownMenuClass,
228
- style: fe.value,
270
+ popper: withCtx(() => [
271
+ createElementVNode("div", mergeProps(menuAttrs.value, {
272
+ class: __props.dropdownMenuClass,
273
+ style: menuStyle.value,
229
274
  "p-select-list": "",
230
275
  role: "listbox"
231
276
  }), [
232
- t.multiple || t.searchable ? (n(), i("div", Oe, [
233
- t.multiple ? (n(), i("div", {
277
+ __props.multiple || __props.searchable ? (openBlock(), createElementBlock("div", _hoisted_4, [
278
+ __props.multiple ? (openBlock(), createElementBlock("div", {
234
279
  key: 0,
235
280
  ref_key: "actionsContainer",
236
- ref: D,
281
+ ref: actionsContainer,
237
282
  class: "flex flex-row justify-between text-xs font-semibold text-primary"
238
283
  }, [
239
- a("p", Pe, y(e(w).length) + " items", 1),
240
- a("div", je, [
241
- e(w).length === e(P).length ? (n(), i("a", {
284
+ createElementVNode("p", _hoisted_5, toDisplayString(unref(computedItems).length) + " items", 1),
285
+ createElementVNode("div", _hoisted_6, [
286
+ unref(computedItems).length === unref(internalItems).length ? (openBlock(), createElementBlock("a", {
242
287
  key: 0,
243
- class: r([
244
- e(u).length !== e(P).length ? "cursor-pointer" : "pointer-events-none opacity-50"
288
+ class: normalizeClass([
289
+ unref(selectedItems).length !== unref(internalItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"
245
290
  ]),
246
- onClick: s[1] || (s[1] = //@ts-ignore
247
- (...l) => e(C) && e(C)(...l))
248
- }, " Select all ", 2)) : (n(), i("a", {
291
+ onClick: _cache[1] || (_cache[1] = //@ts-ignore
292
+ (...args) => unref(selectAll) && unref(selectAll)(...args))
293
+ }, " Select all ", 2)) : (openBlock(), createElementBlock("a", {
249
294
  key: 1,
250
- class: r([e(ie) ? "pointer-events-none opacity-50" : "cursor-pointer"]),
251
- onClick: s[2] || (s[2] = //@ts-ignore
252
- (...l) => e(C) && e(C)(...l))
295
+ class: normalizeClass([unref(computedInsideSelected) ? "pointer-events-none opacity-50" : "cursor-pointer"]),
296
+ onClick: _cache[2] || (_cache[2] = //@ts-ignore
297
+ (...args) => unref(selectAll) && unref(selectAll)(...args))
253
298
  }, " Select all filtered ", 2)),
254
- Ee,
255
- a("a", {
256
- class: r([e(u).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
257
- onClick: s[3] || (s[3] = //@ts-ignore
258
- (...l) => e(F) && e(F)(...l))
299
+ _hoisted_7,
300
+ createElementVNode("a", {
301
+ class: normalizeClass([unref(selectedItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
302
+ onClick: _cache[3] || (_cache[3] = //@ts-ignore
303
+ (...args) => unref(clearAll) && unref(clearAll)(...args))
259
304
  }, " Clear all ", 2)
260
305
  ])
261
- ], 512)) : v("", !0),
262
- t.searchable ? (n(), i("div", {
306
+ ], 512)) : createCommentVNode("", true),
307
+ __props.searchable ? (openBlock(), createElementBlock("div", {
263
308
  key: 1,
264
- class: r([{ "mt-3": t.multiple }])
309
+ class: normalizeClass([{ "mt-3": __props.multiple }])
265
310
  }, [
266
- R(Me, {
311
+ createVNode(PInputSearch, {
267
312
  ref_key: "inputSearch",
268
- ref: A,
269
- modelValue: e(f),
270
- "onUpdate:modelValue": s[4] || (s[4] = (l) => Ae(f) ? f.value = l : null),
271
- size: t.size,
272
- placeholder: t.placeholderSearch
313
+ ref: inputSearch,
314
+ modelValue: unref(search),
315
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isRef(search) ? search.value = $event : null),
316
+ size: __props.size,
317
+ placeholder: __props.placeholderSearch
273
318
  }, null, 8, ["modelValue", "size", "placeholder"])
274
- ], 2)) : v("", !0)
275
- ])) : v("", !0),
276
- a("div", {
319
+ ], 2)) : createCommentVNode("", true)
320
+ ])) : createCommentVNode("", true),
321
+ createElementVNode("div", {
277
322
  ref_key: "virtualizerRef",
278
- ref: O,
279
- style: S(B.value),
280
- class: r(["overflow-y-auto", { "mt-3": t.multiple || t.searchable }])
323
+ ref: virtualizerRef,
324
+ style: normalizeStyle(scrollerStyle.value),
325
+ class: normalizeClass(["overflow-y-auto", { "mt-3": __props.multiple || __props.searchable }])
281
326
  }, [
282
- a("div", {
327
+ createElementVNode("div", {
283
328
  class: "relative w-full",
284
329
  "p-select-list-options": "",
285
- style: S({ height: `${e(j).getTotalSize()}px` }),
286
- onMousemove: s[5] || (s[5] = //@ts-ignore
287
- (...l) => e(E) && e(E)(...l))
330
+ style: normalizeStyle({ height: `${unref(rowVirtualizer).getTotalSize()}px` }),
331
+ onMousemove: _cache[5] || (_cache[5] = //@ts-ignore
332
+ (...args) => unref(onMousemove) && unref(onMousemove)(...args))
288
333
  }, [
289
- (n(!0), i(U, null, Z(e(j).getVirtualItems(), (l) => (n(), i("div", {
290
- key: l.index,
291
- class: "absolute left-0 top-0 w-full",
292
- "p-select-list-option": "",
293
- role: "option",
294
- style: S({ height: `${l.size}px`, transform: `translateY(${l.start}px)` })
295
- }, [
296
- W((n(), i("div", {
297
- class: r([e(se), { [e(oe)]: e(z)(e(g)(l.index)) }]),
298
- "p-select-list-option-item": "",
299
- style: S(_.value),
300
- onClick: (M) => e(ce)(M, e(g)(l.index))
334
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rowVirtualizer).getVirtualItems(), (row) => {
335
+ return openBlock(), createElementBlock("div", {
336
+ key: row.index,
337
+ class: "absolute left-0 top-0 w-full",
338
+ "p-select-list-option": "",
339
+ role: "option",
340
+ style: normalizeStyle({ height: `${row.size}px`, transform: `translateY(${row.start}px)` })
301
341
  }, [
302
- a("div", {
303
- class: r(["flex items-center", { [e(L)[t.size]]: !t.itemSize }])
342
+ withDirectives((openBlock(), createElementBlock("div", {
343
+ class: normalizeClass([unref(LIST_ITEM_CLASS), { [unref(LIST_ITEM_ACTIVE_CLASS)]: unref(isSelected)(unref(getValue)(row.index)) }]),
344
+ "p-select-list-option-item": "",
345
+ style: normalizeStyle(listItemStyle.value),
346
+ onClick: ($event) => unref(select)($event, unref(getValue)(row.index))
304
347
  }, [
305
- V(o.$slots, "item", {
306
- item: e(w)[l.index],
307
- isItemSelected: e(z)(e(g)(l.index)),
308
- itemTextSplit: e(Y)(e($)(e(I)(l.index)), e(f))
309
- }, () => [
310
- a("div", {
311
- class: "truncate text-p-purple-60",
312
- title: e($)(e(I)(l.index))
313
- }, [
314
- (n(!0), i(U, null, Z(e(Y)(e($)(e(I)(l.index)), e(f)), (M, H) => (n(), i("span", {
315
- key: `${e(g)(l.index)}_${H}`,
316
- class: r({ "bg-p-blue-20": H === 1 })
317
- }, y(M), 3))), 128))
318
- ], 8, He)
319
- ]),
320
- e(z)(e(g)(l.index)) ? (n(), i("img", Re)) : v("", !0)
321
- ], 2)
322
- ], 14, Fe)), [
323
- [c, !t.multiple]
324
- ])
325
- ], 4))), 128))
348
+ createElementVNode("div", {
349
+ class: normalizeClass(["flex items-center", { [unref(SIZES)[__props.size]]: !__props.itemSize }])
350
+ }, [
351
+ renderSlot(_ctx.$slots, "item", {
352
+ item: unref(computedItems)[row.index],
353
+ isItemSelected: unref(isSelected)(unref(getValue)(row.index)),
354
+ itemTextSplit: unref(splitStringForHighlight)(unref(toString)(unref(getText)(row.index)), unref(search))
355
+ }, () => [
356
+ createElementVNode("div", {
357
+ class: "truncate text-p-purple-60",
358
+ title: unref(toString)(unref(getText)(row.index))
359
+ }, [
360
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(splitStringForHighlight)(unref(toString)(unref(getText)(row.index)), unref(search)), (str, index) => {
361
+ return openBlock(), createElementBlock("span", {
362
+ key: `${unref(getValue)(row.index)}_${index}`,
363
+ class: normalizeClass({ "bg-p-blue-20": index === 1 })
364
+ }, toDisplayString(str), 3);
365
+ }), 128))
366
+ ], 8, _hoisted_9)
367
+ ]),
368
+ unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_10)) : createCommentVNode("", true)
369
+ ], 2)
370
+ ], 14, _hoisted_8)), [
371
+ [_directive_close_popper, !__props.multiple]
372
+ ])
373
+ ], 4);
374
+ }), 128))
326
375
  ], 36),
327
- e(w).length ? v("", !0) : V(o.$slots, "no-items", { key: 0 }, () => [
328
- a("div", {
329
- class: r(["flex items-center justify-center", e(L)[t.size]])
376
+ !unref(computedItems).length ? renderSlot(_ctx.$slots, "no-items", { key: 0 }, () => [
377
+ createElementVNode("div", {
378
+ class: normalizeClass(["flex items-center justify-center", unref(SIZES)[__props.size]])
330
379
  }, "No items found", 2)
331
- ])
380
+ ]) : createCommentVNode("", true)
332
381
  ], 6)
333
382
  ], 16)
334
383
  ]),
335
- default: q(() => [
336
- a("button", T(ye.value, {
384
+ default: withCtx(() => [
385
+ createElementVNode("button", mergeProps(attrs.value, {
337
386
  ref: "button",
338
387
  type: "button",
339
- class: ["w-full", e(te), p.value ? "border-primary" : ""],
388
+ class: ["w-full", unref(selectClasses), dropdownShow.value ? "border-primary" : ""],
340
389
  role: "button",
341
390
  "aria-haspopup": "listbox",
342
- onClick: s[0] || (s[0] = (l) => p.value = !p.value)
391
+ onClick: _cache[0] || (_cache[0] = ($event) => dropdownShow.value = !dropdownShow.value)
343
392
  }), [
344
- !e(ae).length || !e(u).length ? (n(), i("div", Be, y(t.placeholder || " "), 1)) : V(o.$slots, "selected-item", {
393
+ !unref(internalValue).length || !unref(selectedItems).length ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.placeholder || " "), 1)) : renderSlot(_ctx.$slots, "selected-item", {
345
394
  key: 1,
346
- item: t.multiple ? e(u) : e(u)[0]
395
+ item: __props.multiple ? unref(selectedItems) : unref(selectedItems)[0]
347
396
  }, () => [
348
- a("div", De, y(t.multiple && e(u).length > 1 ? `${e(u).length} option${e(u).length > 1 ? "s" : ""} selected` : e(u)[0][t.itemText]), 1)
397
+ createElementVNode("div", _hoisted_3, toDisplayString(__props.multiple && unref(selectedItems).length > 1 ? `${unref(selectedItems).length} option${unref(selectedItems).length > 1 ? "s" : ""} selected` : unref(selectedItems)[0][__props.itemText]), 1)
349
398
  ])
350
399
  ], 16)
351
400
  ]),
352
401
  _: 3
353
402
  }, 16, ["shown"]),
354
- W(a("div", {
355
- class: r(e(le))
356
- }, y(t.errorMsg), 3), [
357
- [Ie, t.errorMsg]
403
+ withDirectives(createElementVNode("div", {
404
+ class: normalizeClass(unref(errorMsgClasses))
405
+ }, toDisplayString(__props.errorMsg), 3), [
406
+ [vShow, __props.errorMsg]
358
407
  ])
359
- ], 14, Ne);
408
+ ], 14, _hoisted_1);
360
409
  };
361
410
  }
362
411
  });
363
412
  export {
364
- $e as _,
365
- Xe as a
413
+ _imports_0 as _,
414
+ _sfc_main as a
366
415
  };