@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.
- package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -1
- package/dist/cjs/chunks/p-action-bar.js +60 -1
- package/dist/cjs/chunks/p-card.js +28 -1
- package/dist/cjs/chunks/p-checkbox.js +24 -1
- package/dist/cjs/chunks/p-dropdown-select.js +414 -1
- package/dist/cjs/chunks/p-input-percent.js +53 -1
- package/dist/cjs/chunks/p-pagination-info.js +66 -1
- package/dist/cjs/chunks/p-pagination.js +122 -1
- package/dist/cjs/chunks/p-ring-loader.js +81 -1
- package/dist/cjs/chunks/p-select-btn.js +97 -1
- package/dist/cjs/chunks/p-select.js +123 -1
- package/dist/cjs/chunks/p-table-loader.js +70 -1
- package/dist/cjs/chunks/p-tabs.js +52 -1
- package/dist/cjs/config.js +105 -1
- package/dist/cjs/currency.js +9 -1
- package/dist/cjs/dom.js +27 -1
- package/dist/cjs/index.js +976 -1
- package/dist/cjs/inputClassesMixin.js +50 -1
- package/dist/cjs/inputClassesShared.js +76 -1
- package/dist/cjs/listKeyboardNavigation.js +110 -1
- package/dist/cjs/number.js +9 -1
- package/dist/cjs/object.js +4 -1
- package/dist/cjs/p-action-bar.js +3 -1
- package/dist/cjs/p-alert.js +65 -1
- package/dist/cjs/p-avatar.js +71 -1
- package/dist/cjs/p-btn.js +358 -2
- package/dist/cjs/p-card.js +3 -1
- package/dist/cjs/p-checkbox.js +3 -1
- package/dist/cjs/p-chips.js +110 -1
- package/dist/cjs/p-close-btn.js +36 -1
- package/dist/cjs/p-date-picker.js +139 -1
- package/dist/cjs/p-drawer.js +253 -1
- package/dist/cjs/p-dropdown-select.js +3 -1
- package/dist/cjs/p-dropdown.js +138 -1
- package/dist/cjs/p-file-upload.js +21 -1
- package/dist/cjs/p-info-icon.js +35 -1
- package/dist/cjs/p-inline-date-picker.js +142 -1
- package/dist/cjs/p-input-number.js +146 -1
- package/dist/cjs/p-input-percent.js +3 -1
- package/dist/cjs/p-input-search.js +110 -1
- package/dist/cjs/p-input.js +89 -1
- package/dist/cjs/p-loading.js +38 -1
- package/dist/cjs/p-modal.js +369 -1
- package/dist/cjs/p-pagination-info.js +3 -1
- package/dist/cjs/p-pagination.js +3 -1
- package/dist/cjs/p-progress-bar.js +41 -1
- package/dist/cjs/p-ring-loader.js +3 -1
- package/dist/cjs/p-select-btn.js +3 -1
- package/dist/cjs/p-select-list.js +4 -1
- package/dist/cjs/p-select-pill.js +111 -1
- package/dist/cjs/p-select.js +3 -1
- package/dist/cjs/p-skeleton-loader.js +73 -1
- package/dist/cjs/p-table-filter-icon.js +20 -1
- package/dist/cjs/p-table-header-cell.js +75 -1
- package/dist/cjs/p-table-loader.js +3 -1
- package/dist/cjs/p-table-sort.js +8 -1
- package/dist/cjs/p-table-td.js +88 -1
- package/dist/cjs/p-table.js +12 -1
- package/dist/cjs/p-tabs.js +3 -1
- package/dist/cjs/p-textarea.js +73 -1
- package/dist/cjs/p-toggle.js +114 -1
- package/dist/cjs/pagination.js +29 -1
- package/dist/cjs/string.js +12 -1
- package/dist/cjs/tailwind.js +4353 -1
- package/dist/cjs/text.js +16 -1
- package/dist/cjs/useInputClasses.js +44 -1
- package/dist/cjs/usePLoading.js +35 -1
- package/dist/cjs/usePModal.js +21 -1
- package/dist/cjs/usePTableColResize.js +81 -1
- package/dist/cjs/usePTableRowVirtualizer.js +31 -1
- package/dist/cjs/useSelectList.js +256 -1
- package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
- package/dist/es/chunks/p-action-bar.js +45 -36
- package/dist/es/chunks/p-card.js +18 -14
- package/dist/es/chunks/p-checkbox.js +14 -11
- package/dist/es/chunks/p-dropdown-select.js +232 -183
- package/dist/es/chunks/p-input-percent.js +34 -25
- package/dist/es/chunks/p-pagination-info.js +30 -24
- package/dist/es/chunks/p-pagination.js +78 -48
- package/dist/es/chunks/p-ring-loader.js +63 -40
- package/dist/es/chunks/p-select-btn.js +80 -59
- package/dist/es/chunks/p-select.js +81 -54
- package/dist/es/chunks/p-table-loader.js +46 -32
- package/dist/es/chunks/p-tabs.js +35 -29
- package/dist/es/config.js +2 -2
- package/dist/es/currency.js +3 -3
- package/dist/es/dom.js +24 -12
- package/dist/es/index.js +703 -561
- package/dist/es/inputClassesMixin.js +20 -14
- package/dist/es/inputClassesShared.js +60 -45
- package/dist/es/listKeyboardNavigation.js +86 -36
- package/dist/es/number.js +7 -2
- package/dist/es/object.js +2 -2
- package/dist/es/p-action-bar.js +2 -2
- package/dist/es/p-alert.js +35 -30
- package/dist/es/p-avatar.js +30 -27
- package/dist/es/p-btn.js +209 -164
- package/dist/es/p-card.js +2 -2
- package/dist/es/p-checkbox.js +2 -2
- package/dist/es/p-chips.js +60 -40
- package/dist/es/p-close-btn.js +20 -16
- package/dist/es/p-date-picker.js +66 -58
- package/dist/es/p-drawer.js +108 -89
- package/dist/es/p-dropdown-select.js +2 -2
- package/dist/es/p-dropdown.js +52 -33
- package/dist/es/p-file-upload.js +17 -9
- package/dist/es/p-info-icon.js +21 -16
- package/dist/es/p-inline-date-picker.js +64 -53
- package/dist/es/p-input-number.js +84 -66
- package/dist/es/p-input-percent.js +2 -2
- package/dist/es/p-input-search.js +43 -41
- package/dist/es/p-input.js +51 -45
- package/dist/es/p-loading.js +31 -22
- package/dist/es/p-modal.js +261 -174
- package/dist/es/p-pagination-info.js +2 -2
- package/dist/es/p-pagination.js +2 -2
- package/dist/es/p-progress-bar.js +26 -23
- package/dist/es/p-ring-loader.js +2 -2
- package/dist/es/p-select-btn.js +2 -2
- package/dist/es/p-select-list.js +2 -2
- package/dist/es/p-select-pill.js +58 -41
- package/dist/es/p-select.js +2 -2
- package/dist/es/p-skeleton-loader.js +34 -29
- package/dist/es/p-table-filter-icon.js +11 -11
- package/dist/es/p-table-header-cell.js +38 -33
- package/dist/es/p-table-loader.js +2 -2
- package/dist/es/p-table-sort.js +2 -2
- package/dist/es/p-table-td.js +76 -29
- package/dist/es/p-table.js +10 -6
- package/dist/es/p-tabs.js +2 -2
- package/dist/es/p-textarea.js +36 -34
- package/dist/es/p-toggle.js +53 -48
- package/dist/es/pagination.js +25 -8
- package/dist/es/string.js +10 -2
- package/dist/es/tailwind.js +1660 -1101
- package/dist/es/text.js +13 -8
- package/dist/es/useInputClasses.js +38 -22
- package/dist/es/usePLoading.js +31 -15
- package/dist/es/usePModal.js +15 -12
- package/dist/es/usePTableColResize.js +71 -39
- package/dist/es/usePTableRowVirtualizer.js +24 -15
- package/dist/es/useSelectList.js +234 -121
- package/dist/style.css +2124 -1
- package/package.json +1 -1
package/dist/es/chunks/p-card.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
const
|
|
3
|
-
|
|
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(
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
28
|
+
_sfc_main as _
|
|
25
29
|
};
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
const
|
|
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:
|
|
8
|
+
default: false
|
|
8
9
|
}
|
|
9
10
|
},
|
|
10
11
|
emits: ["update:modelValue"],
|
|
11
|
-
setup(
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
24
|
+
_sfc_main as _
|
|
22
25
|
};
|
|
@@ -1,25 +1,38 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { SIZES
|
|
5
|
-
import { omit
|
|
6
|
-
import { splitStringForHighlight
|
|
7
|
-
import { toString
|
|
8
|
-
import { useInputClasses
|
|
9
|
-
import { useSelectList
|
|
10
|
-
const
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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:
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
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:
|
|
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:
|
|
69
|
+
default: false
|
|
57
70
|
},
|
|
58
71
|
size: {
|
|
59
72
|
type: String,
|
|
60
73
|
default: "md",
|
|
61
|
-
validator(
|
|
62
|
-
return Object.keys(
|
|
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:
|
|
125
|
+
default: false
|
|
113
126
|
},
|
|
114
127
|
/**
|
|
115
128
|
* Enables multiple selection
|
|
116
129
|
*/
|
|
117
130
|
multiple: {
|
|
118
131
|
type: Boolean,
|
|
119
|
-
default:
|
|
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:
|
|
153
|
+
default: false
|
|
141
154
|
}
|
|
142
155
|
},
|
|
143
156
|
emits: ["update:modelValue", "select"],
|
|
144
|
-
setup(
|
|
145
|
-
const
|
|
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:
|
|
151
|
-
enableArrowNavigation:
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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:
|
|
217
|
+
immediate: true
|
|
187
218
|
}
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
})
|
|
195
|
-
|
|
196
|
-
|
|
226
|
+
});
|
|
227
|
+
observer.observe(formControl.value);
|
|
228
|
+
});
|
|
229
|
+
onUnmounted(() => {
|
|
230
|
+
formControl.value && observer && observer.unobserve(formControl.value);
|
|
197
231
|
});
|
|
198
|
-
const
|
|
199
|
-
var
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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 (
|
|
207
|
-
const
|
|
208
|
-
return
|
|
251
|
+
return (_ctx, _cache) => {
|
|
252
|
+
const _directive_close_popper = resolveDirective("close-popper");
|
|
253
|
+
return openBlock(), createElementBlock("div", {
|
|
209
254
|
ref_key: "formControl",
|
|
210
|
-
ref:
|
|
211
|
-
class:
|
|
212
|
-
"data-has-error": !!
|
|
213
|
-
style:
|
|
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
|
-
|
|
261
|
+
__props.label ? (openBlock(), createElementBlock("label", {
|
|
217
262
|
key: 0,
|
|
218
|
-
class:
|
|
219
|
-
},
|
|
220
|
-
|
|
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:
|
|
223
|
-
onApplyHide:
|
|
267
|
+
onApplyShow: onShow,
|
|
268
|
+
onApplyHide: onHide
|
|
224
269
|
}), {
|
|
225
|
-
popper:
|
|
226
|
-
|
|
227
|
-
class:
|
|
228
|
-
style:
|
|
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
|
-
|
|
233
|
-
|
|
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:
|
|
281
|
+
ref: actionsContainer,
|
|
237
282
|
class: "flex flex-row justify-between text-xs font-semibold text-primary"
|
|
238
283
|
}, [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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:
|
|
244
|
-
|
|
288
|
+
class: normalizeClass([
|
|
289
|
+
unref(selectedItems).length !== unref(internalItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"
|
|
245
290
|
]),
|
|
246
|
-
onClick:
|
|
247
|
-
(...
|
|
248
|
-
}, " Select all ", 2)) : (
|
|
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:
|
|
251
|
-
onClick:
|
|
252
|
-
(...
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
class:
|
|
257
|
-
onClick:
|
|
258
|
-
(...
|
|
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)) :
|
|
262
|
-
|
|
306
|
+
], 512)) : createCommentVNode("", true),
|
|
307
|
+
__props.searchable ? (openBlock(), createElementBlock("div", {
|
|
263
308
|
key: 1,
|
|
264
|
-
class:
|
|
309
|
+
class: normalizeClass([{ "mt-3": __props.multiple }])
|
|
265
310
|
}, [
|
|
266
|
-
|
|
311
|
+
createVNode(PInputSearch, {
|
|
267
312
|
ref_key: "inputSearch",
|
|
268
|
-
ref:
|
|
269
|
-
modelValue:
|
|
270
|
-
"onUpdate:modelValue":
|
|
271
|
-
size:
|
|
272
|
-
placeholder:
|
|
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)) :
|
|
275
|
-
])) :
|
|
276
|
-
|
|
319
|
+
], 2)) : createCommentVNode("", true)
|
|
320
|
+
])) : createCommentVNode("", true),
|
|
321
|
+
createElementVNode("div", {
|
|
277
322
|
ref_key: "virtualizerRef",
|
|
278
|
-
ref:
|
|
279
|
-
style:
|
|
280
|
-
class:
|
|
323
|
+
ref: virtualizerRef,
|
|
324
|
+
style: normalizeStyle(scrollerStyle.value),
|
|
325
|
+
class: normalizeClass(["overflow-y-auto", { "mt-3": __props.multiple || __props.searchable }])
|
|
281
326
|
}, [
|
|
282
|
-
|
|
327
|
+
createElementVNode("div", {
|
|
283
328
|
class: "relative w-full",
|
|
284
329
|
"p-select-list-options": "",
|
|
285
|
-
style:
|
|
286
|
-
onMousemove:
|
|
287
|
-
(...
|
|
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
|
-
(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
303
|
-
class:
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
class:
|
|
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:
|
|
336
|
-
|
|
384
|
+
default: withCtx(() => [
|
|
385
|
+
createElementVNode("button", mergeProps(attrs.value, {
|
|
337
386
|
ref: "button",
|
|
338
387
|
type: "button",
|
|
339
|
-
class: ["w-full",
|
|
388
|
+
class: ["w-full", unref(selectClasses), dropdownShow.value ? "border-primary" : ""],
|
|
340
389
|
role: "button",
|
|
341
390
|
"aria-haspopup": "listbox",
|
|
342
|
-
onClick:
|
|
391
|
+
onClick: _cache[0] || (_cache[0] = ($event) => dropdownShow.value = !dropdownShow.value)
|
|
343
392
|
}), [
|
|
344
|
-
!
|
|
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:
|
|
395
|
+
item: __props.multiple ? unref(selectedItems) : unref(selectedItems)[0]
|
|
347
396
|
}, () => [
|
|
348
|
-
|
|
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
|
-
|
|
355
|
-
class:
|
|
356
|
-
},
|
|
357
|
-
[
|
|
403
|
+
withDirectives(createElementVNode("div", {
|
|
404
|
+
class: normalizeClass(unref(errorMsgClasses))
|
|
405
|
+
}, toDisplayString(__props.errorMsg), 3), [
|
|
406
|
+
[vShow, __props.errorMsg]
|
|
358
407
|
])
|
|
359
|
-
], 14,
|
|
408
|
+
], 14, _hoisted_1);
|
|
360
409
|
};
|
|
361
410
|
}
|
|
362
411
|
});
|
|
363
412
|
export {
|
|
364
|
-
|
|
365
|
-
|
|
413
|
+
_imports_0 as _,
|
|
414
|
+
_sfc_main as a
|
|
366
415
|
};
|