@pequity/squirrel 10.0.3 → 10.1.0
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/README.md +20 -1
- package/dist/cjs/chunks/p-action-bar.js +17 -14
- package/dist/cjs/chunks/p-date-picker.js +3 -1
- package/dist/cjs/chunks/p-dropdown-select.js +27 -26
- package/dist/cjs/chunks/p-inline-date-picker.js +3 -1
- package/dist/cjs/chunks/p-pagination-info.js +2 -2
- package/dist/cjs/chunks/p-pagination.js +13 -11
- package/dist/cjs/chunks/p-tabs-pills.js +8 -8
- package/dist/cjs/index.js +101 -48
- package/dist/cjs/p-drawer.js +4 -4
- package/dist/cjs/p-input-search.js +5 -4
- package/dist/cjs/p-modal.js +3 -3
- package/dist/es/chunks/p-action-bar.js +18 -15
- package/dist/es/chunks/p-date-picker.js +3 -1
- package/dist/es/chunks/p-dropdown-select.js +27 -26
- package/dist/es/chunks/p-inline-date-picker.js +3 -1
- package/dist/es/chunks/p-pagination-info.js +2 -2
- package/dist/es/chunks/p-pagination.js +13 -11
- package/dist/es/chunks/p-tabs-pills.js +8 -8
- package/dist/es/index.js +102 -49
- package/dist/es/p-drawer.js +4 -4
- package/dist/es/p-input-search.js +5 -4
- package/dist/es/p-modal.js +3 -3
- package/dist/squirrel/index.d.ts +1 -0
- package/dist/squirrel/plugin/index.d.ts +11 -0
- package/dist/squirrel.css +40 -40
- package/package.json +28 -25
- package/squirrel/components/p-action-bar/p-action-bar.vue +4 -1
- package/squirrel/components/p-btn/p-btn.spec.js +0 -1
- package/squirrel/components/p-checkbox/p-checkbox.stories.js +2 -2
- package/squirrel/components/p-date-picker/p-date-picker.vue +3 -2
- package/squirrel/components/p-drawer/p-drawer.spec.js +364 -0
- package/squirrel/components/p-drawer/p-drawer.vue +8 -2
- package/squirrel/components/p-dropdown/p-dropdown.spec.js +252 -55
- package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +16 -12
- package/squirrel/components/p-file-upload/p-file-upload.spec.js +0 -1
- package/squirrel/components/p-file-upload/p-file-upload.vue +26 -9
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +3 -1
- package/squirrel/components/p-input-search/p-input-search.vue +2 -2
- package/squirrel/components/p-modal/p-modal.vue +1 -1
- package/squirrel/components/p-pagination/p-pagination.vue +3 -3
- package/squirrel/components/p-pagination-info/p-pagination-info.vue +2 -2
- package/squirrel/components/p-progress-bar/{p-progess-bar.spec.js → p-progress-bar.spec.js} +7 -5
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +104 -0
- package/squirrel/components/p-select-list/p-select-list.vue +7 -5
- package/squirrel/components/p-select-pill/p-select-pill.spec.js +114 -0
- package/squirrel/components/p-table/usePTableColResize.spec.js +123 -11
- package/squirrel/components/p-table/usePTableHeaderWrap.spec.js +1 -1
- package/squirrel/components/p-table/usePTableRowVirtualizer.spec.js +207 -0
- package/squirrel/components/p-table-header-cell/p-table-header-cell.stories.js +3 -0
- package/squirrel/components/p-table-sort/p-table-sort.vue +4 -4
- package/squirrel/components/p-tabs-pills/p-tabs-pills.vue +1 -1
- package/squirrel/index.spec.js +5 -0
- package/squirrel/index.ts +1 -0
- package/squirrel/locales/en-US.json +47 -0
- package/squirrel/locales/fr-CA.json +47 -0
- package/squirrel/plugin/index.spec.ts +140 -0
- package/squirrel/plugin/index.ts +54 -0
- package/squirrel/utils/listKeyboardNavigation.spec.js +58 -0
package/dist/es/index.js
CHANGED
|
@@ -11,11 +11,12 @@ import { default as default5 } from "./p-drawer.js";
|
|
|
11
11
|
import { default as default6 } from "./p-dropdown.js";
|
|
12
12
|
import { _ as _imports_0$1 } from "./chunks/p-dropdown-select.js";
|
|
13
13
|
import { a } from "./chunks/p-dropdown-select.js";
|
|
14
|
-
import { defineComponent, shallowRef, ref, computed, onMounted, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, withDirectives, unref, toDisplayString, withModifiers, createVNode,
|
|
14
|
+
import { defineComponent, shallowRef, ref, computed, onMounted, resolveComponent, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, withDirectives, unref, toDisplayString, withModifiers, createVNode, withCtx, Fragment, renderList, vShow, useAttrs, resolveDirective, normalizeStyle, isRef, renderSlot, provide, useTemplateRef, onBeforeUnmount, watch, mergeProps, toHandlers, createBlock, watchEffect, nextTick } from "vue";
|
|
15
15
|
import { formatBytes, getFileExtension } from "./p-file-upload.js";
|
|
16
16
|
import { _ as _sfc_main$4 } from "./chunks/p-icon.js";
|
|
17
17
|
import { useInputClasses } from "./useInputClasses.js";
|
|
18
18
|
import { uniq, kebabCase } from "lodash-es";
|
|
19
|
+
import { useI18n } from "vue-i18n";
|
|
19
20
|
import { useToast } from "vue-toastification";
|
|
20
21
|
import { P_ICON_ALIASES } from "./p-icon.js";
|
|
21
22
|
import { _ as _7 } from "./chunks/p-info-icon.js";
|
|
@@ -67,26 +68,27 @@ import { createPagingRange } from "./pagination.js";
|
|
|
67
68
|
import { sanitizeUrl } from "./sanitization.js";
|
|
68
69
|
import { i, u, C, Q, T } from "./chunks/index.js";
|
|
69
70
|
const _hoisted_1$3 = ["data-has-error"];
|
|
70
|
-
const _hoisted_2$3 =
|
|
71
|
+
const _hoisted_2$3 = ["aria-label"];
|
|
72
|
+
const _hoisted_3$3 = {
|
|
71
73
|
key: 0,
|
|
72
74
|
class: "flex h-28 flex-col items-center justify-center"
|
|
73
75
|
};
|
|
74
|
-
const
|
|
76
|
+
const _hoisted_4$3 = {
|
|
75
77
|
key: 0,
|
|
76
78
|
class: "flex flex-col items-center"
|
|
77
79
|
};
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const
|
|
80
|
+
const _hoisted_5$3 = { class: "mt-2 text-p-gray-50" };
|
|
81
|
+
const _hoisted_6$3 = { class: "text-p-blue-60" };
|
|
82
|
+
const _hoisted_7$2 = {
|
|
81
83
|
key: 1,
|
|
82
84
|
class: "flex flex-col items-center"
|
|
83
85
|
};
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
const
|
|
86
|
+
const _hoisted_8 = { class: "mt-2 text-p-purple-60" };
|
|
87
|
+
const _hoisted_9 = ["accept", "multiple", "disabled"];
|
|
88
|
+
const _hoisted_10 = { class: "max-h-48 overflow-y-auto overflow-x-hidden" };
|
|
89
|
+
const _hoisted_11 = ["title"];
|
|
90
|
+
const _hoisted_12 = ["onClick"];
|
|
91
|
+
const _hoisted_13 = { class: "mt-1 text-xs text-p-gray-40" };
|
|
90
92
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
91
93
|
...{
|
|
92
94
|
name: "PFileUpload"
|
|
@@ -174,8 +176,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
174
176
|
const fileInputRef = shallowRef();
|
|
175
177
|
const isDraggingOver = ref(false);
|
|
176
178
|
const toast = useToast();
|
|
179
|
+
const { t } = useI18n({ useScope: "global" });
|
|
177
180
|
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
178
|
-
const fileWord = computed(() => props.multiple ?
|
|
181
|
+
const fileWord = computed(() => t("squirrel.file_upload_files", props.multiple ? 2 : 1));
|
|
179
182
|
const files = computed({
|
|
180
183
|
get() {
|
|
181
184
|
return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
@@ -201,7 +204,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
201
204
|
const fileName = file.name || file.url;
|
|
202
205
|
if (res.length + files.value.length >= props.maxNumberOfFiles) {
|
|
203
206
|
if (!(props.multiple && props.maxNumberOfFiles === 1)) {
|
|
204
|
-
toast.error(
|
|
207
|
+
toast.error(
|
|
208
|
+
t("squirrel.file_upload_max_files_exceeded", { count: props.maxNumberOfFiles, fileWord: fileWord.value })
|
|
209
|
+
);
|
|
205
210
|
}
|
|
206
211
|
break;
|
|
207
212
|
}
|
|
@@ -217,12 +222,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
217
222
|
const extension = getFileExtension(fileName) ? `.${getFileExtension(fileName)}` : "";
|
|
218
223
|
const isValidExtension = extension ? props.fileTypes.includes(extension) : false;
|
|
219
224
|
if (!isValidExtension) {
|
|
220
|
-
toast.error(
|
|
225
|
+
toast.error(t("squirrel.file_upload_files_not_allowed", { extension }));
|
|
221
226
|
continue;
|
|
222
227
|
}
|
|
223
228
|
}
|
|
224
229
|
if ((file.size || 0) > props.maxSizeInBytes) {
|
|
225
|
-
toast.error(
|
|
230
|
+
toast.error(
|
|
231
|
+
t("squirrel.file_upload_file_size_exceeded", { fileName, maxSize: formatBytes(props.maxSizeInBytes) })
|
|
232
|
+
);
|
|
226
233
|
continue;
|
|
227
234
|
}
|
|
228
235
|
res.push(file);
|
|
@@ -266,6 +273,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
266
273
|
}
|
|
267
274
|
});
|
|
268
275
|
return (_ctx, _cache) => {
|
|
276
|
+
const _component_I18nT = resolveComponent("I18nT");
|
|
269
277
|
return openBlock(), createElementBlock("div", {
|
|
270
278
|
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }]),
|
|
271
279
|
"data-has-error": !!__props.errorMsg
|
|
@@ -282,30 +290,37 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
282
290
|
__props.errorMsg ? "border-on-error" : "border-p-gray-40 hover:border-primary",
|
|
283
291
|
{ "pointer-events-none opacity-50": __props.disabled }
|
|
284
292
|
]]),
|
|
285
|
-
"aria-label": "
|
|
293
|
+
"aria-label": _ctx.$t("squirrel.file_upload_dropzone"),
|
|
286
294
|
onDragover: _cache[1] || (_cache[1] = withModifiers(($event) => isDraggingOver.value = true, ["prevent", "stop"])),
|
|
287
295
|
onDragleave: _cache[2] || (_cache[2] = withModifiers(($event) => isDraggingOver.value = false, ["prevent", "stop"])),
|
|
288
296
|
onDrop: withModifiers(onDrop, ["prevent", "stop"]),
|
|
289
297
|
onClick: openFileDialog
|
|
290
298
|
}, [
|
|
291
|
-
!maxFilesReached.value ? (openBlock(), createElementBlock("div",
|
|
292
|
-
!isDraggingOver.value ? (openBlock(), createElementBlock("div",
|
|
299
|
+
!maxFilesReached.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
300
|
+
!isDraggingOver.value ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
293
301
|
createVNode(_sfc_main$4, {
|
|
294
302
|
icon: "upload",
|
|
295
303
|
width: "32",
|
|
296
304
|
class: "text-p-gray-50"
|
|
297
305
|
}),
|
|
298
|
-
createElementVNode("div",
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
createElementVNode("div", _hoisted_5$3, [
|
|
307
|
+
createVNode(_component_I18nT, {
|
|
308
|
+
keypath: "squirrel.file_upload_drag_or_select",
|
|
309
|
+
scope: "global"
|
|
310
|
+
}, {
|
|
311
|
+
select: withCtx(() => [
|
|
312
|
+
createElementVNode("span", _hoisted_6$3, toDisplayString(_ctx.$t("squirrel.file_upload_select", { fileWord: fileWord.value })), 1)
|
|
313
|
+
]),
|
|
314
|
+
_: 1
|
|
315
|
+
})
|
|
301
316
|
])
|
|
302
|
-
])) : (openBlock(), createElementBlock("div",
|
|
317
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
303
318
|
createVNode(_sfc_main$4, {
|
|
304
319
|
icon: "tdesign:drag-drop",
|
|
305
320
|
width: "32",
|
|
306
321
|
class: "text-primary"
|
|
307
322
|
}),
|
|
308
|
-
createElementVNode("div",
|
|
323
|
+
createElementVNode("div", _hoisted_8, toDisplayString(_ctx.$t("squirrel.file_upload_drop", { fileWord: fileWord.value })), 1)
|
|
309
324
|
])),
|
|
310
325
|
createElementVNode("input", {
|
|
311
326
|
ref_key: "fileInputRef",
|
|
@@ -318,9 +333,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
318
333
|
disabled: __props.disabled,
|
|
319
334
|
"aria-hidden": "true",
|
|
320
335
|
onChange: changeFieldValue
|
|
321
|
-
}, null, 40,
|
|
336
|
+
}, null, 40, _hoisted_9)
|
|
322
337
|
])) : createCommentVNode("", true),
|
|
323
|
-
createElementVNode("div",
|
|
338
|
+
createElementVNode("div", _hoisted_10, [
|
|
324
339
|
(openBlock(true), createElementBlock(Fragment, null, renderList(files.value, (file, index) => {
|
|
325
340
|
return openBlock(), createElementBlock("div", {
|
|
326
341
|
key: index,
|
|
@@ -335,7 +350,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
335
350
|
createElementVNode("div", {
|
|
336
351
|
class: "truncate",
|
|
337
352
|
title: file.name
|
|
338
|
-
}, toDisplayString(file.name), 9,
|
|
353
|
+
}, toDisplayString(file.name), 9, _hoisted_11),
|
|
339
354
|
createElementVNode("button", {
|
|
340
355
|
class: "h-5 shrink-0 cursor-pointer overflow-hidden",
|
|
341
356
|
onClick: withModifiers(($event) => removeFile(index), ["stop"])
|
|
@@ -345,17 +360,20 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
345
360
|
width: "20",
|
|
346
361
|
class: "text-p-gray-60 hover:text-on-error"
|
|
347
362
|
})
|
|
348
|
-
], 8,
|
|
363
|
+
], 8, _hoisted_12)
|
|
349
364
|
], 2);
|
|
350
365
|
}), 128))
|
|
351
366
|
])
|
|
352
|
-
],
|
|
367
|
+
], 42, _hoisted_2$3),
|
|
353
368
|
withDirectives(createElementVNode("div", {
|
|
354
369
|
class: normalizeClass(unref(errorMsgClasses))
|
|
355
370
|
}, toDisplayString(__props.errorMsg), 3), [
|
|
356
371
|
[vShow, __props.errorMsg]
|
|
357
372
|
]),
|
|
358
|
-
createElementVNode("div",
|
|
373
|
+
createElementVNode("div", _hoisted_13, toDisplayString(__props.multiple ? _ctx.$t("squirrel.file_upload_max", __props.maxNumberOfFiles) : _ctx.$t("squirrel.file_upload_one")) + " " + toDisplayString(acceptFileTypes.value) + " " + toDisplayString(_ctx.$t("squirrel.file_upload_files", __props.multiple ? 2 : 1)) + " " + toDisplayString(_ctx.$t("squirrel.file_upload_with_size_less_than", {
|
|
374
|
+
count: __props.multiple ? 2 : 1,
|
|
375
|
+
maxSize: unref(formatBytes)(__props.maxSizeInBytes)
|
|
376
|
+
})), 1)
|
|
359
377
|
], 10, _hoisted_1$3);
|
|
360
378
|
};
|
|
361
379
|
}
|
|
@@ -370,7 +388,7 @@ const _hoisted_6$2 = {
|
|
|
370
388
|
class: "ml-auto fill-p-purple-60 pl-2",
|
|
371
389
|
src: _imports_0$1
|
|
372
390
|
};
|
|
373
|
-
const _hoisted_7 = {
|
|
391
|
+
const _hoisted_7$1 = {
|
|
374
392
|
key: 1,
|
|
375
393
|
class: "ml-auto h-4 w-[26px] pl-2"
|
|
376
394
|
};
|
|
@@ -581,7 +599,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
581
599
|
ref: actionsContainer,
|
|
582
600
|
class: "flex flex-row justify-between text-xs font-semibold text-primary"
|
|
583
601
|
}, [
|
|
584
|
-
createElementVNode("p", _hoisted_2$2, toDisplayString(unref(computedItems).length)
|
|
602
|
+
createElementVNode("p", _hoisted_2$2, toDisplayString(_ctx.$t("squirrel.select_list_items", unref(computedItems).length)), 1),
|
|
585
603
|
createElementVNode("div", _hoisted_3$2, [
|
|
586
604
|
unref(computedItems).length === unref(internalItems).length ? (openBlock(), createElementBlock("a", {
|
|
587
605
|
key: 0,
|
|
@@ -590,18 +608,18 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
590
608
|
]),
|
|
591
609
|
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
592
610
|
(...args) => unref(selectAll) && unref(selectAll)(...args))
|
|
593
|
-
}, "
|
|
611
|
+
}, toDisplayString(_ctx.$t("squirrel.select_list_select_all")), 3)) : (openBlock(), createElementBlock("a", {
|
|
594
612
|
key: 1,
|
|
595
613
|
class: normalizeClass([unref(computedInsideSelected) ? "pointer-events-none opacity-50" : "cursor-pointer"]),
|
|
596
614
|
onClick: _cache[1] || (_cache[1] = //@ts-ignore
|
|
597
615
|
(...args) => unref(selectAll) && unref(selectAll)(...args))
|
|
598
|
-
}, "
|
|
616
|
+
}, toDisplayString(_ctx.$t("squirrel.select_list_select_all_filtered")), 3)),
|
|
599
617
|
_cache[6] || (_cache[6] = createElementVNode("span", { class: "px-1 leading-none" }, ".", -1)),
|
|
600
618
|
createElementVNode("a", {
|
|
601
619
|
class: normalizeClass([unref(selectedItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
|
|
602
620
|
onClick: _cache[2] || (_cache[2] = //@ts-ignore
|
|
603
621
|
(...args) => unref(clearAll) && unref(clearAll)(...args))
|
|
604
|
-
}, "
|
|
622
|
+
}, toDisplayString(_ctx.$t("squirrel.select_list_clear_all")), 3)
|
|
605
623
|
])
|
|
606
624
|
], 512)) : createCommentVNode("", true),
|
|
607
625
|
__props.searchable ? (openBlock(), createElementBlock("div", {
|
|
@@ -674,7 +692,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
674
692
|
}), 128))
|
|
675
693
|
], 8, _hoisted_5$2)
|
|
676
694
|
]),
|
|
677
|
-
unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_6$2)) : (openBlock(), createElementBlock("div", _hoisted_7))
|
|
695
|
+
unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_6$2)) : (openBlock(), createElementBlock("div", _hoisted_7$1))
|
|
678
696
|
], 2)
|
|
679
697
|
], 14, _hoisted_4$2)), [
|
|
680
698
|
[_directive_close_popper, __props.closePopperOnSelect && !__props.multiple]
|
|
@@ -685,7 +703,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
685
703
|
!unref(computedItems).length ? renderSlot(_ctx.$slots, "no-items", { key: 0 }, () => [
|
|
686
704
|
createElementVNode("div", {
|
|
687
705
|
class: normalizeClass(["flex items-center justify-center", unref(SIZES)[__props.size]])
|
|
688
|
-
}, "
|
|
706
|
+
}, toDisplayString(_ctx.$t("squirrel.select_list_no_items_found")), 3)
|
|
689
707
|
]) : createCommentVNode("", true)
|
|
690
708
|
], 6)
|
|
691
709
|
], 2),
|
|
@@ -958,20 +976,21 @@ const _imports_1 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewB
|
|
|
958
976
|
const _imports_2 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_75842)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_75842'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
959
977
|
const _imports_3 = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1019_80100)'%3e%3cpath%20d='M11.8%2011.8933C11.75%2011.7716%2011.665%2011.6674%2011.5559%2011.5938C11.4467%2011.5203%2011.3183%2011.4807%2011.1866%2011.48H9.18664C9.16473%2011.4828%209.14248%2011.4812%209.12119%2011.4753C9.0999%2011.4694%209.07999%2011.4594%209.06262%2011.4457C9.04525%2011.4321%209.03077%2011.4151%209.02001%2011.3958C9.00926%2011.3765%209.00245%2011.3553%208.99997%2011.3333V1C8.99997%200.734784%208.89462%200.48043%208.70708%200.292893C8.51954%200.105357%208.26519%200%207.99997%200C7.73476%200%207.4804%200.105357%207.29287%200.292893C7.10533%200.48043%206.99997%200.734784%206.99997%201V11.3333C6.99997%2011.3775%206.98241%2011.4199%206.95116%2011.4512C6.9199%2011.4824%206.87751%2011.5%206.83331%2011.5H4.83331C4.70146%2011.5006%204.57273%2011.5402%204.46341%2011.6139C4.35409%2011.6876%204.26908%2011.7921%204.21913%2011.9141C4.16918%2012.0361%204.15653%2012.1702%204.18279%2012.2994C4.20904%2012.4286%204.27302%2012.5472%204.36664%2012.64L7.54664%2015.8267C7.60861%2015.8892%207.68235%2015.9387%207.76359%2015.9726C7.84483%2016.0064%207.93196%2016.0239%208.01997%2016.0239C8.10798%2016.0239%208.19512%2016.0064%208.27636%2015.9726C8.3576%2015.9387%208.43133%2015.8892%208.49331%2015.8267L11.6733%2012.64C11.7677%2012.5431%2011.8303%2012.4198%2011.853%2012.2864C11.8756%2012.153%2011.8571%2012.0159%2011.8%2011.8933Z'%20fill='%23323CEB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1019_80100'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
|
|
960
978
|
const _hoisted_1 = { class: "flex items-center justify-between" };
|
|
961
|
-
const _hoisted_2 = { class: "
|
|
962
|
-
const _hoisted_3 = {
|
|
979
|
+
const _hoisted_2 = { class: "px-4 text-xs font-semibold text-p-gray-40" };
|
|
980
|
+
const _hoisted_3 = { class: "mt-2" };
|
|
981
|
+
const _hoisted_4 = {
|
|
963
982
|
key: 0,
|
|
964
983
|
src: _imports_0
|
|
965
984
|
};
|
|
966
|
-
const
|
|
985
|
+
const _hoisted_5 = {
|
|
967
986
|
key: 1,
|
|
968
987
|
src: _imports_1
|
|
969
988
|
};
|
|
970
|
-
const
|
|
989
|
+
const _hoisted_6 = {
|
|
971
990
|
key: 0,
|
|
972
991
|
src: _imports_2
|
|
973
992
|
};
|
|
974
|
-
const
|
|
993
|
+
const _hoisted_7 = {
|
|
975
994
|
key: 1,
|
|
976
995
|
src: _imports_3
|
|
977
996
|
};
|
|
@@ -999,25 +1018,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
999
1018
|
return (_ctx, _cache) => {
|
|
1000
1019
|
return openBlock(), createElementBlock("div", null, [
|
|
1001
1020
|
createElementVNode("div", _hoisted_1, [
|
|
1002
|
-
|
|
1021
|
+
createElementVNode("div", _hoisted_2, toDisplayString(_ctx.$t("squirrel.table_sort_sort")), 1),
|
|
1003
1022
|
createElementVNode("div", {
|
|
1004
1023
|
class: normalizeClass([
|
|
1005
1024
|
"px-4 text-xs font-semibold text-primary",
|
|
1006
1025
|
[unref(SORTING_TYPES).ASC, unref(SORTING_TYPES).DESC].includes(__props.modelValue) ? "cursor-pointer opacity-100" : "opacity-50"
|
|
1007
1026
|
]),
|
|
1008
1027
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", unref(SORTING_TYPES).NO_SORTING))
|
|
1009
|
-
}, "
|
|
1028
|
+
}, toDisplayString(_ctx.$t("squirrel.table_sort_clear")), 3)
|
|
1010
1029
|
]),
|
|
1011
|
-
createElementVNode("div",
|
|
1030
|
+
createElementVNode("div", _hoisted_3, [
|
|
1012
1031
|
createElementVNode("div", {
|
|
1013
1032
|
class: "flex cursor-pointer items-center justify-between px-4 py-1 hover:bg-p-blue-10",
|
|
1014
1033
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:modelValue", unref(SORTING_TYPES).ASC))
|
|
1015
1034
|
}, [
|
|
1016
1035
|
createElementVNode("div", {
|
|
1017
1036
|
class: normalizeClass(["text-sm font-semibold text-p-purple-60", { "text-primary": __props.modelValue === unref(SORTING_TYPES).ASC }])
|
|
1018
|
-
}, "
|
|
1037
|
+
}, toDisplayString(_ctx.$t("squirrel.table_sort_sort_ascending")), 3),
|
|
1019
1038
|
createElementVNode("div", null, [
|
|
1020
|
-
__props.modelValue === unref(SORTING_TYPES).NO_SORTING || __props.modelValue === unref(SORTING_TYPES).DESC ? (openBlock(), createElementBlock("img",
|
|
1039
|
+
__props.modelValue === unref(SORTING_TYPES).NO_SORTING || __props.modelValue === unref(SORTING_TYPES).DESC ? (openBlock(), createElementBlock("img", _hoisted_4)) : (openBlock(), createElementBlock("img", _hoisted_5))
|
|
1021
1040
|
])
|
|
1022
1041
|
]),
|
|
1023
1042
|
createElementVNode("div", {
|
|
@@ -1026,9 +1045,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1026
1045
|
}, [
|
|
1027
1046
|
createElementVNode("div", {
|
|
1028
1047
|
class: normalizeClass(["text-sm font-semibold text-p-purple-60", { "text-primary": __props.modelValue === unref(SORTING_TYPES).DESC }])
|
|
1029
|
-
}, "
|
|
1048
|
+
}, toDisplayString(_ctx.$t("squirrel.table_sort_sort_descending")), 3),
|
|
1030
1049
|
createElementVNode("div", null, [
|
|
1031
|
-
__props.modelValue === unref(SORTING_TYPES).NO_SORTING || __props.modelValue === unref(SORTING_TYPES).ASC ? (openBlock(), createElementBlock("img",
|
|
1050
|
+
__props.modelValue === unref(SORTING_TYPES).NO_SORTING || __props.modelValue === unref(SORTING_TYPES).ASC ? (openBlock(), createElementBlock("img", _hoisted_6)) : (openBlock(), createElementBlock("img", _hoisted_7))
|
|
1032
1051
|
])
|
|
1033
1052
|
])
|
|
1034
1053
|
])
|
|
@@ -1036,6 +1055,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1036
1055
|
};
|
|
1037
1056
|
}
|
|
1038
1057
|
});
|
|
1058
|
+
const squirrel$1 = { "close": "Close", "action_bar_clear_all": "Clear All", "select_list_items": "{count} item | {count} items", "select_list_select_all": "Select all", "select_list_select_all_filtered": "Select all filtered", "select_list_clear_all": "Clear all", "select_list_no_items_found": "No items found", "dropdown_select_aria_label": "Dropdown select", "dropdown_select_remove_item": "Remove item", "dropdown_select_clear_selection": "Clear selection", "dropdown_select_all_options_selected": "All options selected", "dropdown_select_options": "option | options", "dropdown_select_selected": "selected", "dropdown_select_items": "@:squirrel.select_list_items", "dropdown_select_select_all": "@:squirrel.select_list_select_all", "dropdown_select_select_all_filtered": "@:squirrel.select_list_select_all_filtered", "dropdown_select_clear_all": "@:squirrel.select_list_clear_all", "dropdown_select_add": "Add", "dropdown_select_no_items_found_type_to_add": "No items found. Type to add", "dropdown_select_no_items_found": "@:squirrel.select_list_no_items_found", "file_upload_dropzone": "dropzone", "file_upload_drag_or_select": "Drag or {select}", "file_upload_drop": "Drop {fileWord}", "file_upload_max": "Max {count}", "file_upload_one": "One", "file_upload_files": "file | files", "file_upload_select": "select {fileWord}", "file_upload_with_size_less_than": "with size less than {maxSize} | with size less than {maxSize} each", "file_upload_max_files_exceeded": "You can only upload a maximum of {count} {fileWord}.", "file_upload_files_not_allowed": "{extension} files are not allowed.", "file_upload_file_size_exceeded": "File size of {fileName} exceeds {maxSize}.", "input_search_press_enter_to_search": "Press enter to search", "input_search_clear_search_input": "Clear search input", "pagination_go_to_previous_page": "go to the previous page", "pagination_go_to_page": "go to page {page}", "pagination_go_to_next_page": "go to the next page", "pagination_info_showing_results": "Showing {from} to {to} of {count} results", "pagination_info_no_results_found": "No results found", "table_sort_sort": "SORT", "table_sort_clear": "Clear", "table_sort_sort_ascending": "Sort ascending", "table_sort_sort_descending": "Sort descending", "tabs_pills_aria_label": "Tabs Pills" };
|
|
1059
|
+
const enUS = {
|
|
1060
|
+
squirrel: squirrel$1
|
|
1061
|
+
};
|
|
1062
|
+
const squirrel = { "close": "Fermer", "action_bar_clear_all": "Effacer tout", "select_list_items": "{count} élément | {count} éléments", "select_list_select_all": "Tout sélectionner", "select_list_select_all_filtered": "Sélectionner tout (filtré)", "select_list_clear_all": "Effacer tout", "select_list_no_items_found": "Aucun élément trouvé", "dropdown_select_aria_label": "Liste déroulante", "dropdown_select_remove_item": "Supprimer l'élément", "dropdown_select_clear_selection": "Effacer la sélection", "dropdown_select_all_options_selected": "Toutes les options sélectionnées", "dropdown_select_options": "option | options", "dropdown_select_selected": "sélectionné", "dropdown_select_items": "@:squirrel.select_list_items", "dropdown_select_select_all": "@:squirrel.select_list_select_all", "dropdown_select_select_all_filtered": "@:squirrel.select_list_select_all_filtered", "dropdown_select_clear_all": "@:squirrel.select_list_clear_all", "dropdown_select_add": "Ajouter", "dropdown_select_no_items_found_type_to_add": "Aucun élément trouvé. Tapez pour ajouter", "dropdown_select_no_items_found": "@:squirrel.select_list_no_items_found", "file_upload_dropzone": "zone de dépôt", "file_upload_drag_or_select": "Glisser ou {select}", "file_upload_drop": "Déposer {fileWord}", "file_upload_max": "Max {count}", "file_upload_one": "Un", "file_upload_files": "fichier | fichiers", "file_upload_select": "sélectionner {fileWord}", "file_upload_with_size_less_than": "avec une taille inférieure à {maxSize} | avec une taille inférieure à {maxSize} chacun", "file_upload_max_files_exceeded": "Vous ne pouvez télécharger qu'un maximum de {count} {fileWord}.", "file_upload_files_not_allowed": "Les fichiers {extension} ne sont pas autorisés.", "file_upload_file_size_exceeded": "La taille du fichier {fileName} dépasse {maxSize}.", "input_search_press_enter_to_search": "Appuyez sur Entrée pour rechercher", "input_search_clear_search_input": "Effacer la saisie de recherche", "pagination_go_to_previous_page": "aller à la page précédente", "pagination_go_to_page": "aller à la page {page}", "pagination_go_to_next_page": "aller à la page suivante", "pagination_info_showing_results": "Affichage de {from} à {to} sur {count} résultats", "pagination_info_no_results_found": "Aucun résultat trouvé", "table_sort_sort": "TRIER", "table_sort_clear": "Effacer", "table_sort_sort_ascending": "Trier par ordre croissant", "table_sort_sort_descending": "Trier par ordre décroissant", "tabs_pills_aria_label": "Onglets pilules" };
|
|
1063
|
+
const frCA = {
|
|
1064
|
+
squirrel
|
|
1065
|
+
};
|
|
1066
|
+
const squirrelMessages = {
|
|
1067
|
+
"en-US": enUS,
|
|
1068
|
+
"fr-CA": frCA
|
|
1069
|
+
};
|
|
1070
|
+
const isSquirrelLocale = (locale) => {
|
|
1071
|
+
return locale in squirrelMessages;
|
|
1072
|
+
};
|
|
1073
|
+
const SquirrelPlugin = {
|
|
1074
|
+
install(app, i18n) {
|
|
1075
|
+
const unwatch = watchEffect(() => {
|
|
1076
|
+
const currentLocale = i18n.global.locale.value;
|
|
1077
|
+
if (isSquirrelLocale(currentLocale)) {
|
|
1078
|
+
const existingMessages = i18n.global.getLocaleMessage(currentLocale);
|
|
1079
|
+
if (!("squirrel" in existingMessages)) {
|
|
1080
|
+
i18n.global.mergeLocaleMessage(currentLocale, squirrelMessages[currentLocale]);
|
|
1081
|
+
}
|
|
1082
|
+
if (Object.keys(squirrelMessages).every((locale) => i18n.global.availableLocales.includes(locale))) {
|
|
1083
|
+
nextTick(() => {
|
|
1084
|
+
unwatch();
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1039
1091
|
export {
|
|
1040
1092
|
CURRENCY_INPUT_DEFAULTS,
|
|
1041
1093
|
MIN_WIDTH_COL_RESIZE,
|
|
@@ -1084,6 +1136,7 @@ export {
|
|
|
1084
1136
|
P_ICON_ALIASES,
|
|
1085
1137
|
S as SIZES,
|
|
1086
1138
|
SORTING_TYPES,
|
|
1139
|
+
SquirrelPlugin,
|
|
1087
1140
|
i as cn,
|
|
1088
1141
|
u as cnBase,
|
|
1089
1142
|
colsInjectionKey,
|
package/dist/es/p-drawer.js
CHANGED
|
@@ -112,7 +112,7 @@ const __default__ = defineComponent({
|
|
|
112
112
|
*/
|
|
113
113
|
closeLabel: {
|
|
114
114
|
type: String,
|
|
115
|
-
default: "
|
|
115
|
+
default: ""
|
|
116
116
|
},
|
|
117
117
|
/**
|
|
118
118
|
* Whether to show the backdrop behind the drawer.
|
|
@@ -236,7 +236,7 @@ const __default__ = defineComponent({
|
|
|
236
236
|
});
|
|
237
237
|
const __injectCSSVars__ = () => {
|
|
238
238
|
useCssVars((_ctx) => ({
|
|
239
|
-
"
|
|
239
|
+
"v485968ad": _ctx.width
|
|
240
240
|
}));
|
|
241
241
|
};
|
|
242
242
|
const __setup__ = __default__.setup;
|
|
@@ -308,7 +308,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
308
308
|
}, [
|
|
309
309
|
_ctx.enableClose ? (openBlock(), createBlock(_component_PCloseBtn, {
|
|
310
310
|
key: 0,
|
|
311
|
-
"aria-label": _ctx.closeLabel,
|
|
311
|
+
"aria-label": _ctx.closeLabel || _ctx.$t("squirrel.close"),
|
|
312
312
|
class: "flex-0",
|
|
313
313
|
disabled: _ctx.disabled,
|
|
314
314
|
onClick: _ctx.close
|
|
@@ -353,7 +353,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
353
353
|
}, 8, ["enter-active-class", "leave-active-class", "onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
|
|
354
354
|
], 8, ["to"])) : createCommentVNode("", true);
|
|
355
355
|
}
|
|
356
|
-
const pDrawer = /* @__PURE__ */ _export_sfc(__default__, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
356
|
+
const pDrawer = /* @__PURE__ */ _export_sfc(__default__, [["render", _sfc_render], ["__scopeId", "data-v-e3739b6f"]]);
|
|
357
357
|
export {
|
|
358
358
|
pDrawer as default
|
|
359
359
|
};
|
|
@@ -3,6 +3,7 @@ import { S as SIZES } from "./chunks/p-btn.types.js";
|
|
|
3
3
|
import { _ as _sfc_main$2 } from "./chunks/p-icon.js";
|
|
4
4
|
import { _ as _sfc_main$1 } from "./chunks/p-input.js";
|
|
5
5
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
|
+
const _hoisted_1 = ["aria-label"];
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
8
|
...{
|
|
8
9
|
name: "PInputSearch",
|
|
@@ -103,7 +104,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
104
|
}, null, 2)), [
|
|
104
105
|
[
|
|
105
106
|
_directive_tooltip,
|
|
106
|
-
{ content: "
|
|
107
|
+
{ content: _ctx.$t("squirrel.input_search_press_enter_to_search"), delay: { show: 100, hide: 0 } },
|
|
107
108
|
void 0,
|
|
108
109
|
{ bottom: true }
|
|
109
110
|
]
|
|
@@ -111,7 +112,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
112
|
query.value ? (openBlock(), createElementBlock("button", {
|
|
112
113
|
key: 1,
|
|
113
114
|
role: "button",
|
|
114
|
-
"aria-label": "
|
|
115
|
+
"aria-label": _ctx.$t("squirrel.input_search_clear_search_input"),
|
|
115
116
|
class: normalizeClass(["absolute cursor-pointer", clearIconClasses[__props.size]]),
|
|
116
117
|
onClick: clearSearch
|
|
117
118
|
}, [
|
|
@@ -119,14 +120,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
119
120
|
icon: "cancel-circle",
|
|
120
121
|
class: "text-p-gray-40 hover:text-p-gray-50"
|
|
121
122
|
})
|
|
122
|
-
],
|
|
123
|
+
], 10, _hoisted_1)) : createCommentVNode("", true)
|
|
123
124
|
]),
|
|
124
125
|
_: 1
|
|
125
126
|
}, 16, ["modelValue", "size"]);
|
|
126
127
|
};
|
|
127
128
|
}
|
|
128
129
|
});
|
|
129
|
-
const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
130
|
+
const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ed3f0628"]]);
|
|
130
131
|
export {
|
|
131
132
|
PInputSearch as default
|
|
132
133
|
};
|
package/dist/es/p-modal.js
CHANGED
|
@@ -189,7 +189,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
189
189
|
emits: ["before-open", "opening", "opened", "before-close", "closing", "closed", "update:modelValue", "click:overlay"],
|
|
190
190
|
setup(__props, { emit: __emit }) {
|
|
191
191
|
useCssVars((_ctx) => ({
|
|
192
|
-
"
|
|
192
|
+
"v19879df9": __props.maxWidth
|
|
193
193
|
}));
|
|
194
194
|
let animatingZIndex = 0;
|
|
195
195
|
const emit = __emit;
|
|
@@ -404,7 +404,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
404
404
|
createVNode(PCloseBtn, {
|
|
405
405
|
disabled: __props.disabled,
|
|
406
406
|
class: normalizeClass({ invisible: !__props.enableClose }),
|
|
407
|
-
"aria-label": __props.closeLabel,
|
|
407
|
+
"aria-label": __props.closeLabel || _ctx.$t("squirrel.close"),
|
|
408
408
|
onClick: withModifiers(close, ["prevent"])
|
|
409
409
|
}, null, 8, ["disabled", "class", "aria-label"])
|
|
410
410
|
])
|
|
@@ -446,7 +446,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
448
|
});
|
|
449
|
-
const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
449
|
+
const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f666f5ac"]]);
|
|
450
450
|
export {
|
|
451
451
|
pModal as default
|
|
452
452
|
};
|
package/dist/squirrel/index.d.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Plugin } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Squirrel Vue Plugin for i18n integration.
|
|
4
|
+
*
|
|
5
|
+
* This plugin merges Squirrel's translations with the consumer's existing i18n instance.
|
|
6
|
+
* This ensures there's only one i18n instance and no component/directive conflicts.
|
|
7
|
+
*
|
|
8
|
+
* @param app - Vue application instance
|
|
9
|
+
* @param i18n - The consumer's i18n instance with mergeLocaleMessage support
|
|
10
|
+
*/
|
|
11
|
+
export declare const SquirrelPlugin: Plugin;
|