@pequity/squirrel 11.0.1 → 11.0.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/index.js +374 -216
- package/dist/cjs/chunks/p-btn.js +1 -1
- package/dist/cjs/dateLocale.js +1221 -280
- package/dist/cjs/index.js +19 -8
- package/dist/cjs/inputClasses.js +3 -3
- package/dist/es/chunks/index.js +374 -216
- package/dist/es/chunks/p-btn.js +2 -2
- package/dist/es/dateLocale.js +1221 -280
- package/dist/es/index.js +48 -37
- package/dist/es/inputClasses.js +4 -4
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -2
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -2
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -1
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +2 -2
- package/package.json +31 -31
- package/squirrel/components/p-btn/p-btn.spec.js +15 -5
- package/squirrel/components/p-drawer/p-drawer.spec.js +16 -11
- package/squirrel/components/p-dropdown/p-dropdown.spec.js +15 -10
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +44 -27
- package/squirrel/components/p-pagination/p-pagination.spec.js +22 -30
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +35 -27
- package/squirrel/components/p-select-list/p-select-list.spec.js +44 -27
- package/squirrel/components/p-select-pill/p-select-pill.spec.js +7 -6
- package/squirrel/components/p-table/p-table.spec.js +50 -43
- package/squirrel/components/p-tabs-pills/p-tabs-pills.spec.js +10 -8
- package/squirrel/locales/de-DE.json +47 -0
- package/squirrel/locales/es-ES.json +47 -0
- package/squirrel/plugin/index.spec.ts +32 -12
- package/squirrel/plugin/index.ts +6 -2
- package/squirrel/utils/dateLocale.spec.ts +9 -5
- package/squirrel/utils/dateLocale.ts +7 -3
- /package/squirrel/locales/{fr-CA.json → fr-FR.json} +0 -0
package/dist/es/index.js
CHANGED
|
@@ -66,7 +66,7 @@ import { toNumberOrNull } from "./number.js";
|
|
|
66
66
|
import { isObject } from "./object.js";
|
|
67
67
|
import { createPagingRange } from "./pagination.js";
|
|
68
68
|
import { sanitizeUrl } from "./sanitization.js";
|
|
69
|
-
import {
|
|
69
|
+
import { c, a as a2, b, e, d, t } from "./chunks/index.js";
|
|
70
70
|
const _hoisted_1$3 = ["data-has-error"];
|
|
71
71
|
const _hoisted_2$3 = ["aria-label"];
|
|
72
72
|
const _hoisted_3$3 = {
|
|
@@ -176,9 +176,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
176
176
|
const fileInputRef = shallowRef();
|
|
177
177
|
const isDraggingOver = ref(false);
|
|
178
178
|
const toast = useToast();
|
|
179
|
-
const { t } = useI18n({ useScope: "global" });
|
|
179
|
+
const { t: t2 } = useI18n({ useScope: "global" });
|
|
180
180
|
const { labelClasses, errorMsgClasses } = useInputClasses(props);
|
|
181
|
-
const fileWord = computed(() =>
|
|
181
|
+
const fileWord = computed(() => t2("squirrel.file_upload_files", props.multiple ? 2 : 1));
|
|
182
182
|
const files = computed({
|
|
183
183
|
get() {
|
|
184
184
|
return Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
@@ -199,13 +199,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
199
199
|
});
|
|
200
200
|
const validateFiles = (filesToUpload) => {
|
|
201
201
|
const res = [];
|
|
202
|
-
for (let
|
|
203
|
-
const file = filesToUpload[
|
|
202
|
+
for (let i = 0; i < filesToUpload.length; i++) {
|
|
203
|
+
const file = filesToUpload[i];
|
|
204
204
|
const fileName = file.name || file.url;
|
|
205
205
|
if (res.length + files.value.length >= props.maxNumberOfFiles) {
|
|
206
206
|
if (!(props.multiple && props.maxNumberOfFiles === 1)) {
|
|
207
207
|
toast.error(
|
|
208
|
-
|
|
208
|
+
t2("squirrel.file_upload_max_files_exceeded", { count: props.maxNumberOfFiles, fileWord: fileWord.value })
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
211
|
break;
|
|
@@ -222,13 +222,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
222
222
|
const extension = getFileExtension(fileName) ? `.${getFileExtension(fileName)}` : "";
|
|
223
223
|
const isValidExtension = extension ? props.fileTypes.includes(extension) : false;
|
|
224
224
|
if (!isValidExtension) {
|
|
225
|
-
toast.error(
|
|
225
|
+
toast.error(t2("squirrel.file_upload_files_not_allowed", { extension }));
|
|
226
226
|
continue;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
if ((file.size || 0) > props.maxSizeInBytes) {
|
|
230
230
|
toast.error(
|
|
231
|
-
|
|
231
|
+
t2("squirrel.file_upload_file_size_exceeded", { fileName, maxSize: formatBytes(props.maxSizeInBytes) })
|
|
232
232
|
);
|
|
233
233
|
continue;
|
|
234
234
|
}
|
|
@@ -236,8 +236,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
236
236
|
}
|
|
237
237
|
return res;
|
|
238
238
|
};
|
|
239
|
-
const uploadFile = (
|
|
240
|
-
const f =
|
|
239
|
+
const uploadFile = (e2) => {
|
|
240
|
+
const f = e2.target?.files || e2.dataTransfer?.files;
|
|
241
241
|
if (!f) {
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
@@ -245,8 +245,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
245
245
|
files.value = props.multiple ? [...files.value, ...validatedFiles] : validatedFiles;
|
|
246
246
|
emit("file-added", validatedFiles);
|
|
247
247
|
};
|
|
248
|
-
const changeFieldValue = (
|
|
249
|
-
uploadFile(
|
|
248
|
+
const changeFieldValue = (e2) => {
|
|
249
|
+
uploadFile(e2);
|
|
250
250
|
if (fileInputRef.value) {
|
|
251
251
|
fileInputRef.value.value = "";
|
|
252
252
|
}
|
|
@@ -258,9 +258,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
258
258
|
emit("file-removed", removedFile);
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
const onDrop = (
|
|
261
|
+
const onDrop = (e2) => {
|
|
262
262
|
isDraggingOver.value = false;
|
|
263
|
-
changeFieldValue(
|
|
263
|
+
changeFieldValue(e2);
|
|
264
264
|
};
|
|
265
265
|
const openFileDialog = () => {
|
|
266
266
|
if (fileInputRef.value) {
|
|
@@ -783,20 +783,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
783
783
|
ths.value[index] = el;
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
|
-
const emitScroll = (
|
|
787
|
-
emit("scroll",
|
|
786
|
+
const emitScroll = (e2) => {
|
|
787
|
+
emit("scroll", e2);
|
|
788
788
|
};
|
|
789
|
-
const thDivClasses = (
|
|
789
|
+
const thDivClasses = (i) => {
|
|
790
790
|
const res = ["relative", "py-2"];
|
|
791
791
|
res.push("border-b border-p-gray-30");
|
|
792
|
-
if (
|
|
792
|
+
if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
|
|
793
793
|
res.push("th-shadow px-4");
|
|
794
794
|
} else {
|
|
795
795
|
!props.colsResizable ? res.push("px-2") : res.push("pl-2 pr-4");
|
|
796
796
|
}
|
|
797
797
|
return res;
|
|
798
798
|
};
|
|
799
|
-
const thSubheaderClasses = (
|
|
799
|
+
const thSubheaderClasses = (i) => {
|
|
800
800
|
const res = [
|
|
801
801
|
"flex",
|
|
802
802
|
"h-6",
|
|
@@ -809,7 +809,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
809
809
|
"font-medium",
|
|
810
810
|
"text-p-gray-40"
|
|
811
811
|
];
|
|
812
|
-
if (
|
|
812
|
+
if (i === 0 && props.isFirstColFixed || i === props.cols.length - 1 && props.isLastColFixed) {
|
|
813
813
|
res.push("th-shadow");
|
|
814
814
|
}
|
|
815
815
|
return res;
|
|
@@ -868,10 +868,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
868
868
|
ref: theadRef
|
|
869
869
|
}, [
|
|
870
870
|
createElementVNode("tr", null, [
|
|
871
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.cols, (col,
|
|
871
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.cols, (col, i) => {
|
|
872
872
|
return openBlock(), createElementBlock("th", mergeProps({
|
|
873
873
|
ref_for: true,
|
|
874
|
-
ref: (el) => updateThsRefs(el,
|
|
874
|
+
ref: (el) => updateThsRefs(el, i),
|
|
875
875
|
key: col.id,
|
|
876
876
|
"data-col-id": col.id
|
|
877
877
|
}, { ref_for: true }, col.thAttrs, {
|
|
@@ -879,7 +879,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
879
879
|
class: "bg-surface"
|
|
880
880
|
}), [
|
|
881
881
|
createElementVNode("div", {
|
|
882
|
-
class: normalizeClass(thDivClasses(
|
|
882
|
+
class: normalizeClass(thDivClasses(i)),
|
|
883
883
|
style: normalizeStyle(bgColorStyle(col))
|
|
884
884
|
}, [
|
|
885
885
|
createElementVNode("div", {
|
|
@@ -893,7 +893,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
893
893
|
"tooltip-text": col.tooltip,
|
|
894
894
|
class: [
|
|
895
895
|
unref(hasWrap) ? "leading-4" : "leading-5",
|
|
896
|
-
{ "pl-2":
|
|
896
|
+
{ "pl-2": i === 1 && __props.isFirstColFixed, "pr-2": i === __props.cols.length && __props.isLastColFixed },
|
|
897
897
|
"grow"
|
|
898
898
|
],
|
|
899
899
|
"text-color": headerCellTextColor(col)
|
|
@@ -906,17 +906,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
906
906
|
_: 2
|
|
907
907
|
}, 1040, ["text", "filter-active", "show-filter-icon", "tooltip-text", "class", "text-color", "onClickFilterIcon"])
|
|
908
908
|
], 2),
|
|
909
|
-
__props.colsResizable &&
|
|
909
|
+
__props.colsResizable && i !== 0 && !(i === __props.cols.length - 1 && __props.isLastColFixed) ? (openBlock(), createElementBlock("div", {
|
|
910
910
|
key: 0,
|
|
911
|
-
class: normalizeClass(["absolute right-0 top-1/2 z-110 h-5 w-2 -translate-y-1/2 cursor-col-resize after:absolute after:bottom-0 after:z-110 after:block after:h-full after:w-2 after:cursor-col-resize after:border-r-2 after:border-dashed after:border-p-gray-30",
|
|
911
|
+
class: normalizeClass(["absolute right-0 top-1/2 z-110 h-5 w-2 -translate-y-1/2 cursor-col-resize after:absolute after:bottom-0 after:z-110 after:block after:h-full after:w-2 after:cursor-col-resize after:border-r-2 after:border-dashed after:border-p-gray-30", i === __props.cols.length - 1 ? "after:right-0.5" : "after:right-0"]),
|
|
912
912
|
"data-resize-handle": "",
|
|
913
|
-
onMousedown: ($event) => unref(colResizeStart)($event,
|
|
914
|
-
onDblclick: ($event) => unref(colResizeFitToData)(
|
|
913
|
+
onMousedown: ($event) => unref(colResizeStart)($event, i),
|
|
914
|
+
onDblclick: ($event) => unref(colResizeFitToData)(i)
|
|
915
915
|
}, null, 42, _hoisted_2$1)) : createCommentVNode("", true)
|
|
916
916
|
], 6),
|
|
917
917
|
__props.subheader ? (openBlock(), createElementBlock("div", {
|
|
918
918
|
key: 0,
|
|
919
|
-
class: normalizeClass(thSubheaderClasses(
|
|
919
|
+
class: normalizeClass(thSubheaderClasses(i))
|
|
920
920
|
}, [
|
|
921
921
|
renderSlot(_ctx.$slots, `subheader-cell-${unref(kebabCase)(col.name)}`, {}, void 0, true)
|
|
922
922
|
], 2)) : createCommentVNode("", true)
|
|
@@ -1055,17 +1055,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
1057
|
});
|
|
1058
|
-
const squirrel$
|
|
1058
|
+
const squirrel$3 = { "close": "Schließen", "action_bar_clear_all": "Alle löschen", "select_list_items": "{count} Element | {count} Elemente", "select_list_select_all": "Alle auswählen", "select_list_select_all_filtered": "Alle gefilterten auswählen", "select_list_clear_all": "Alle löschen", "select_list_no_items_found": "Keine Elemente gefunden", "dropdown_select_aria_label": "Dropdown-Auswahl", "dropdown_select_remove_item": "Element entfernen", "dropdown_select_clear_selection": "Auswahl löschen", "dropdown_select_all_options_selected": "Alle Optionen ausgewählt", "dropdown_select_options": "Option | Optionen", "dropdown_select_selected": "ausgewählt", "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": "Hinzufügen", "dropdown_select_no_items_found_type_to_add": "Keine Elemente gefunden. Tippen Sie zum Hinzufügen", "dropdown_select_no_items_found": "@:squirrel.select_list_no_items_found", "file_upload_dropzone": "Ablagebereich", "file_upload_drag_or_select": "Ziehen oder {select}", "file_upload_drop": "{fileWord} ablegen", "file_upload_max": "Max. {count}", "file_upload_one": "Eine", "file_upload_files": "Datei | Dateien", "file_upload_select": "{fileWord} auswählen", "file_upload_with_size_less_than": "mit einer Größe unter {maxSize} | mit einer Größe unter {maxSize} jeweils", "file_upload_max_files_exceeded": "Sie können maximal {count} {fileWord} hochladen.", "file_upload_files_not_allowed": "{extension}-Dateien sind nicht erlaubt.", "file_upload_file_size_exceeded": "Die Dateigröße von {fileName} überschreitet {maxSize}.", "input_search_press_enter_to_search": "Drücken Sie die Eingabetaste zum Suchen", "input_search_clear_search_input": "Sucheingabe löschen", "pagination_go_to_previous_page": "zur vorherigen Seite gehen", "pagination_go_to_page": "zu Seite {page} gehen", "pagination_go_to_next_page": "zur nächsten Seite gehen", "pagination_info_showing_results": "Zeige {from} bis {to} von {count} Ergebnissen", "pagination_info_no_results_found": "Keine Ergebnisse gefunden", "table_sort_sort": "SORTIEREN", "table_sort_clear": "Löschen", "table_sort_sort_ascending": "Aufsteigend sortieren", "table_sort_sort_descending": "Absteigend sortieren", "tabs_pills_aria_label": "Tab-Pillen" };
|
|
1059
|
+
const deDE = {
|
|
1060
|
+
squirrel: squirrel$3
|
|
1061
|
+
};
|
|
1062
|
+
const squirrel$2 = { "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
1063
|
const enUS = {
|
|
1064
|
+
squirrel: squirrel$2
|
|
1065
|
+
};
|
|
1066
|
+
const squirrel$1 = { "close": "Cerrar", "action_bar_clear_all": "Borrar todo", "select_list_items": "{count} elemento | {count} elementos", "select_list_select_all": "Seleccionar todo", "select_list_select_all_filtered": "Seleccionar todo (filtrado)", "select_list_clear_all": "Borrar todo", "select_list_no_items_found": "No se encontraron elementos", "dropdown_select_aria_label": "Selección desplegable", "dropdown_select_remove_item": "Eliminar elemento", "dropdown_select_clear_selection": "Borrar selección", "dropdown_select_all_options_selected": "Todas las opciones seleccionadas", "dropdown_select_options": "opción | opciones", "dropdown_select_selected": "seleccionado", "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": "Agregar", "dropdown_select_no_items_found_type_to_add": "No se encontraron elementos. Escriba para agregar", "dropdown_select_no_items_found": "@:squirrel.select_list_no_items_found", "file_upload_dropzone": "zona de carga", "file_upload_drag_or_select": "Arrastre o {select}", "file_upload_drop": "Soltar {fileWord}", "file_upload_max": "Máx. {count}", "file_upload_one": "Uno", "file_upload_files": "archivo | archivos", "file_upload_select": "seleccionar {fileWord}", "file_upload_with_size_less_than": "con tamaño menor que {maxSize} | con tamaño menor que {maxSize} cada uno", "file_upload_max_files_exceeded": "Solo puede cargar un máximo de {count} {fileWord}.", "file_upload_files_not_allowed": "Los archivos {extension} no están permitidos.", "file_upload_file_size_exceeded": "El tamaño del archivo {fileName} excede {maxSize}.", "input_search_press_enter_to_search": "Presione Enter para buscar", "input_search_clear_search_input": "Borrar entrada de búsqueda", "pagination_go_to_previous_page": "ir a la página anterior", "pagination_go_to_page": "ir a la página {page}", "pagination_go_to_next_page": "ir a la página siguiente", "pagination_info_showing_results": "Mostrando {from} a {to} de {count} resultados", "pagination_info_no_results_found": "No se encontraron resultados", "table_sort_sort": "ORDENAR", "table_sort_clear": "Borrar", "table_sort_sort_ascending": "Ordenar ascendente", "table_sort_sort_descending": "Ordenar descendente", "tabs_pills_aria_label": "Pestañas de píldoras" };
|
|
1067
|
+
const esES = {
|
|
1060
1068
|
squirrel: squirrel$1
|
|
1061
1069
|
};
|
|
1062
1070
|
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
|
|
1071
|
+
const frFR = {
|
|
1064
1072
|
squirrel
|
|
1065
1073
|
};
|
|
1066
1074
|
const squirrelMessages = {
|
|
1075
|
+
"de-DE": deDE,
|
|
1067
1076
|
"en-US": enUS,
|
|
1068
|
-
"
|
|
1077
|
+
"es-ES": esES,
|
|
1078
|
+
"fr-FR": frFR
|
|
1069
1079
|
};
|
|
1070
1080
|
const isSquirrelLocale = (locale) => {
|
|
1071
1081
|
return locale in squirrelMessages;
|
|
@@ -1137,12 +1147,13 @@ export {
|
|
|
1137
1147
|
S as SIZES,
|
|
1138
1148
|
SORTING_TYPES,
|
|
1139
1149
|
SquirrelPlugin,
|
|
1140
|
-
|
|
1141
|
-
|
|
1150
|
+
c as cn,
|
|
1151
|
+
a2 as cnMerge,
|
|
1142
1152
|
colsInjectionKey,
|
|
1143
1153
|
createPagingRange,
|
|
1144
|
-
|
|
1145
|
-
|
|
1154
|
+
b as createTV,
|
|
1155
|
+
e as cx,
|
|
1156
|
+
d as defaultConfig,
|
|
1146
1157
|
getNextActiveElement,
|
|
1147
1158
|
isColsResizableInjectionKey,
|
|
1148
1159
|
isElement,
|
|
@@ -1156,7 +1167,7 @@ export {
|
|
|
1156
1167
|
squirrelTailwindConfig,
|
|
1157
1168
|
toNumberOrNull,
|
|
1158
1169
|
toString,
|
|
1159
|
-
|
|
1170
|
+
t as tv,
|
|
1160
1171
|
useInputClasses,
|
|
1161
1172
|
usePLoading,
|
|
1162
1173
|
usePModal,
|
package/dist/es/inputClasses.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const inputClasses =
|
|
1
|
+
import { t as tv } from "./chunks/index.js";
|
|
2
|
+
const inputClasses = tv({
|
|
3
3
|
slots: {
|
|
4
4
|
input: "w-full rounded border-0 bg-surface text-night ring-1 ring-inset ring-p-gray-30 placeholder:text-p-gray-40 hover:ring-primary focus:outline-none focus:ring-2 focus:ring-primary disabled:cursor-default disabled:bg-p-blue-10 disabled:ring-p-gray-30 disabled:hover:ring-p-gray-30",
|
|
5
5
|
label: "mb-1 block font-medium",
|
|
@@ -90,7 +90,7 @@ const inputClasses = T({
|
|
|
90
90
|
size: "md"
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
const textareaClasses =
|
|
93
|
+
const textareaClasses = tv({
|
|
94
94
|
extend: inputClasses,
|
|
95
95
|
slots: {
|
|
96
96
|
input: "resize-y overflow-auto"
|
|
@@ -109,7 +109,7 @@ const textareaClasses = T({
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
const selectClasses =
|
|
112
|
+
const selectClasses = tv({
|
|
113
113
|
extend: inputClasses,
|
|
114
114
|
slots: {
|
|
115
115
|
input: "squirrel-bg-chevron-down appearance-none truncate bg-no-repeat"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type RouterLinkProps } from 'vue-router';
|
|
2
|
-
declare var __VLS_1: {},
|
|
2
|
+
declare var __VLS_1: {}, __VLS_10: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_10) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<RouterLinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouterLinkProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_7: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
'no-results'?: (props: typeof
|
|
3
|
+
'no-results'?: (props: typeof __VLS_7) => any;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
6
|
/**
|
|
@@ -48,7 +48,9 @@ declare const __VLS_export: <T extends Record<string, unknown>>(__VLS_props: Non
|
|
|
48
48
|
onScroll?: ((val: Event) => any) | undefined;
|
|
49
49
|
"onCol-resize"?: ((colIndex: number, width: number) => any) | undefined;
|
|
50
50
|
"onClick-filter-icon"?: ((val: Event, col: any) => any) | undefined;
|
|
51
|
-
}> & import("vue").PublicProps
|
|
51
|
+
}> & import("vue").PublicProps & (typeof globalThis extends {
|
|
52
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
53
|
+
} ? P : {});
|
|
52
54
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
53
55
|
tbodyElement: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
54
56
|
}>) => void;
|
|
@@ -6,9 +6,9 @@ type Props = {
|
|
|
6
6
|
tooltipText?: string;
|
|
7
7
|
textColor?: string;
|
|
8
8
|
};
|
|
9
|
-
declare var
|
|
9
|
+
declare var __VLS_6: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
|
-
icon?: (props: typeof
|
|
11
|
+
icon?: (props: typeof __VLS_6) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
14
|
"click-filter-icon": (event: Event, filterActive: boolean) => any;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pequity/squirrel",
|
|
3
3
|
"description": "Squirrel component library",
|
|
4
|
-
"version": "11.0.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "11.0.3",
|
|
5
|
+
"packageManager": "pnpm@10.24.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -50,63 +50,63 @@
|
|
|
50
50
|
"vue-toastification": "^2.0.0-rc.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@commitlint/cli": "^20.
|
|
54
|
-
"@commitlint/config-conventional": "^20.
|
|
53
|
+
"@commitlint/cli": "^20.2.0",
|
|
54
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
55
55
|
"@pequity/eslint-config": "^2.0.5",
|
|
56
|
-
"@playwright/test": "^1.
|
|
56
|
+
"@playwright/test": "^1.57.0",
|
|
57
57
|
"@semantic-release/changelog": "^6.0.3",
|
|
58
58
|
"@semantic-release/git": "^10.0.1",
|
|
59
|
-
"@storybook/addon-a11y": "^10.
|
|
60
|
-
"@storybook/addon-docs": "^10.
|
|
61
|
-
"@storybook/addon-links": "^10.
|
|
62
|
-
"@storybook/addon-vitest": "^10.
|
|
63
|
-
"@storybook/vue3-vite": "^10.
|
|
59
|
+
"@storybook/addon-a11y": "^10.1.4",
|
|
60
|
+
"@storybook/addon-docs": "^10.1.4",
|
|
61
|
+
"@storybook/addon-links": "^10.1.4",
|
|
62
|
+
"@storybook/addon-vitest": "^10.1.4",
|
|
63
|
+
"@storybook/vue3-vite": "^10.1.4",
|
|
64
64
|
"@tanstack/vue-virtual": "3.13.12",
|
|
65
65
|
"@types/jsdom": "^27.0.0",
|
|
66
66
|
"@types/lodash-es": "^4.17.12",
|
|
67
67
|
"@types/node": "^24.10.1",
|
|
68
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
69
|
-
"@vitest/browser": "4.0.
|
|
70
|
-
"@vitest/browser-playwright": "^4.0.
|
|
71
|
-
"@vitest/coverage-v8": "^4.0.
|
|
72
|
-
"@vue/compiler-sfc": "3.5.
|
|
68
|
+
"@vitejs/plugin-vue": "^6.0.2",
|
|
69
|
+
"@vitest/browser": "4.0.15",
|
|
70
|
+
"@vitest/browser-playwright": "^4.0.15",
|
|
71
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
72
|
+
"@vue/compiler-sfc": "3.5.25",
|
|
73
73
|
"@vue/test-utils": "^2.4.6",
|
|
74
|
-
"@vuepic/vue-datepicker": "12.0.
|
|
74
|
+
"@vuepic/vue-datepicker": "12.0.5",
|
|
75
75
|
"autoprefixer": "^10.4.22",
|
|
76
76
|
"eslint": "^9.39.1",
|
|
77
|
-
"eslint-plugin-storybook": "^10.
|
|
77
|
+
"eslint-plugin-storybook": "^10.1.4",
|
|
78
78
|
"floating-vue": "5.2.2",
|
|
79
|
-
"glob": "^
|
|
79
|
+
"glob": "^13.0.0",
|
|
80
80
|
"husky": "^9.1.7",
|
|
81
81
|
"iconify-icon": "^3.0.2",
|
|
82
82
|
"jsdom": "^27.2.0",
|
|
83
|
-
"lint-staged": "^16.2.
|
|
83
|
+
"lint-staged": "^16.2.7",
|
|
84
84
|
"lodash-es": "4.17.21",
|
|
85
85
|
"make-coverage-badge": "^1.2.0",
|
|
86
|
-
"playwright": "^1.
|
|
86
|
+
"playwright": "^1.57.0",
|
|
87
87
|
"postcss": "^8.5.6",
|
|
88
|
-
"prettier": "^3.
|
|
89
|
-
"prettier-plugin-tailwindcss": "^0.7.
|
|
88
|
+
"prettier": "^3.7.4",
|
|
89
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
90
90
|
"resolve-tspaths": "^0.8.23",
|
|
91
|
-
"rimraf": "^6.1.
|
|
92
|
-
"sass": "^1.94.
|
|
91
|
+
"rimraf": "^6.1.2",
|
|
92
|
+
"sass": "^1.94.2",
|
|
93
93
|
"semantic-release": "^25.0.2",
|
|
94
|
-
"storybook": "^10.
|
|
94
|
+
"storybook": "^10.1.4",
|
|
95
95
|
"svgo": "^4.0.0",
|
|
96
96
|
"tailwindcss": "^3.4.17",
|
|
97
97
|
"typescript": "5.9.3",
|
|
98
|
-
"vite": "^7.2.
|
|
99
|
-
"vitest": "^4.0.
|
|
100
|
-
"vue": "3.5.
|
|
98
|
+
"vite": "^7.2.6",
|
|
99
|
+
"vitest": "^4.0.15",
|
|
100
|
+
"vue": "3.5.25",
|
|
101
101
|
"vue-currency-input": "3.2.1",
|
|
102
|
-
"vue-i18n": "^11.
|
|
102
|
+
"vue-i18n": "^11.2.2",
|
|
103
103
|
"vue-router": "4.6.3",
|
|
104
104
|
"vue-toastification": "2.0.0-rc.5",
|
|
105
|
-
"vue-tsc": "3.1.
|
|
105
|
+
"vue-tsc": "3.1.5"
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
108
|
"date-fns": "^4.1.0",
|
|
109
109
|
"tailwind-merge": "^3.4.0",
|
|
110
|
-
"tailwind-variants": "^3.
|
|
110
|
+
"tailwind-variants": "^3.2.2"
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -97,14 +97,24 @@ describe('PBtn.vue', () => {
|
|
|
97
97
|
|
|
98
98
|
const element = wrapper.find(el);
|
|
99
99
|
|
|
100
|
-
if (el !== 'a') {
|
|
101
|
-
const slotWrapper = wrapper.find('.slot-wrapper');
|
|
102
|
-
expect(slotWrapper.classes()).toEqual(['slot-wrapper', 'empty:hidden']);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
100
|
expect(classes.every((c) => element.classes().includes(c))).toBe(true);
|
|
106
101
|
expect(DEFAULT_CLASSES_ARRAY.every((c) => element.classes().includes(c))).toBe(true);
|
|
107
102
|
});
|
|
103
|
+
|
|
104
|
+
// Test slot-wrapper separately for non-anchor elements to avoid conditional expects
|
|
105
|
+
if (el !== 'a') {
|
|
106
|
+
it(`renders a ${el} with slot-wrapper having correct classes`, async () => {
|
|
107
|
+
const wrapper = createWrapperFor(PBtn, {
|
|
108
|
+
attrs: { to },
|
|
109
|
+
global: {
|
|
110
|
+
stubs: { RouterLink: { template: '<section class="router-link-stub"><slot /></section>' } },
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const slotWrapper = wrapper.find('.slot-wrapper');
|
|
115
|
+
expect(slotWrapper.classes()).toEqual(['slot-wrapper', 'empty:hidden']);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
108
118
|
});
|
|
109
119
|
|
|
110
120
|
it.each([
|
|
@@ -174,22 +174,27 @@ describe('PDrawer basic functionality', () => {
|
|
|
174
174
|
wrapper.unmount();
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
-
it
|
|
178
|
-
|
|
179
|
-
[false, 'does not render', false, null],
|
|
180
|
-
])('%s backdrop when showBackdrop is %s', async (showBackdrop, description, shouldExist, expectedClass) => {
|
|
181
|
-
const wrapper = createWrapperContainer({ showBackdrop });
|
|
177
|
+
it('renders backdrop when showBackdrop is true', async () => {
|
|
178
|
+
const wrapper = createWrapperContainer({ showBackdrop: true });
|
|
182
179
|
|
|
183
180
|
await wrapper.setData({ showDrawer: true });
|
|
184
181
|
|
|
185
182
|
const backdrop = wrapper.find('.fixed.bottom-0.left-0.right-0.top-0');
|
|
186
183
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
184
|
+
expect(backdrop.exists()).toBe(true);
|
|
185
|
+
expect(backdrop.classes()).toContain('bg-black/20');
|
|
186
|
+
|
|
187
|
+
wrapper.unmount();
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('does not render backdrop when showBackdrop is false', async () => {
|
|
191
|
+
const wrapper = createWrapperContainer({ showBackdrop: false });
|
|
192
|
+
|
|
193
|
+
await wrapper.setData({ showDrawer: true });
|
|
194
|
+
|
|
195
|
+
const backdrop = wrapper.find('.fixed.bottom-0.left-0.right-0.top-0');
|
|
196
|
+
|
|
197
|
+
expect(backdrop.isVisible()).toBe(false);
|
|
193
198
|
|
|
194
199
|
wrapper.unmount();
|
|
195
200
|
});
|
|
@@ -149,23 +149,28 @@ describe('PDropdown.vue', () => {
|
|
|
149
149
|
expect(destroyFn).toHaveBeenCalled();
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
it
|
|
153
|
-
[true, 'enables'],
|
|
154
|
-
[false, 'disables'],
|
|
155
|
-
])('%s arrow navigation when enableArrowNavigation is %s', async (enableArrowNavigation, description) => {
|
|
152
|
+
it('enables arrow navigation when enableArrowNavigation is true', async () => {
|
|
156
153
|
setupListKeyboardNavigation.mockImplementation(() => createMockedKbdNavigationSvc());
|
|
157
154
|
|
|
158
155
|
createWrapper({
|
|
159
156
|
props: {
|
|
160
|
-
enableArrowNavigation,
|
|
157
|
+
enableArrowNavigation: true,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
expect(setupListKeyboardNavigation).toHaveBeenCalledTimes(1);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('disables arrow navigation when enableArrowNavigation is false', async () => {
|
|
165
|
+
setupListKeyboardNavigation.mockImplementation(() => createMockedKbdNavigationSvc());
|
|
166
|
+
|
|
167
|
+
createWrapper({
|
|
168
|
+
props: {
|
|
169
|
+
enableArrowNavigation: false,
|
|
161
170
|
},
|
|
162
171
|
});
|
|
163
172
|
|
|
164
|
-
|
|
165
|
-
expect(setupListKeyboardNavigation).toHaveBeenCalledTimes(1);
|
|
166
|
-
} else {
|
|
167
|
-
expect(setupListKeyboardNavigation).not.toHaveBeenCalled();
|
|
168
|
-
}
|
|
173
|
+
expect(setupListKeyboardNavigation).not.toHaveBeenCalled();
|
|
169
174
|
});
|
|
170
175
|
|
|
171
176
|
it('handles escape key when enableCloseOnEsc is true', async () => {
|