@pequity/squirrel 10.0.3 → 11.0.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.
Files changed (76) hide show
  1. package/README.md +20 -1
  2. package/dist/cjs/chunks/p-action-bar.js +17 -14
  3. package/dist/cjs/chunks/p-dropdown-select.js +27 -26
  4. package/dist/cjs/chunks/p-inline-date-picker.js +53 -84
  5. package/dist/cjs/chunks/p-pagination-info.js +2 -2
  6. package/dist/cjs/chunks/p-pagination.js +13 -11
  7. package/dist/cjs/chunks/p-tabs-pills.js +8 -8
  8. package/dist/cjs/dateLocale.js +886 -0
  9. package/dist/cjs/index.js +103 -50
  10. package/dist/cjs/p-date-picker.js +146 -2
  11. package/dist/cjs/p-drawer.js +4 -4
  12. package/dist/cjs/p-input-search.js +5 -4
  13. package/dist/cjs/p-modal.js +3 -3
  14. package/dist/cjs/p-select-pill.js +1 -1
  15. package/dist/es/chunks/p-action-bar.js +18 -15
  16. package/dist/es/chunks/p-dropdown-select.js +27 -26
  17. package/dist/es/chunks/p-inline-date-picker.js +52 -83
  18. package/dist/es/chunks/p-pagination-info.js +2 -2
  19. package/dist/es/chunks/p-pagination.js +13 -11
  20. package/dist/es/chunks/p-tabs-pills.js +8 -8
  21. package/dist/es/dateLocale.js +886 -0
  22. package/dist/es/index.js +152 -99
  23. package/dist/es/p-date-picker.js +146 -2
  24. package/dist/es/p-drawer.js +4 -4
  25. package/dist/es/p-input-search.js +5 -4
  26. package/dist/es/p-modal.js +3 -3
  27. package/dist/es/p-select-pill.js +1 -1
  28. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +19 -23
  29. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +2 -2
  30. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +12 -13
  31. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +2 -2
  32. package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +1 -1
  33. package/dist/squirrel/index.d.ts +1 -0
  34. package/dist/squirrel/plugin/index.d.ts +11 -0
  35. package/dist/squirrel/utils/dateLocale.d.ts +2 -0
  36. package/dist/squirrel.css +73 -40
  37. package/package.json +33 -29
  38. package/squirrel/components/p-action-bar/p-action-bar.vue +4 -1
  39. package/squirrel/components/p-btn/p-btn.spec.js +0 -1
  40. package/squirrel/components/p-checkbox/p-checkbox.stories.js +2 -2
  41. package/squirrel/components/p-date-picker/p-date-picker.spec.js +49 -4
  42. package/squirrel/components/p-date-picker/p-date-picker.vue +85 -12
  43. package/squirrel/components/p-drawer/p-drawer.spec.js +364 -0
  44. package/squirrel/components/p-drawer/p-drawer.vue +8 -2
  45. package/squirrel/components/p-dropdown/p-dropdown.spec.js +252 -55
  46. package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +16 -12
  47. package/squirrel/components/p-file-upload/p-file-upload.spec.js +0 -1
  48. package/squirrel/components/p-file-upload/p-file-upload.vue +26 -9
  49. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +33 -18
  50. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +23 -10
  51. package/squirrel/components/p-input-search/p-input-search.vue +2 -2
  52. package/squirrel/components/p-modal/p-modal.vue +1 -1
  53. package/squirrel/components/p-pagination/p-pagination.vue +3 -3
  54. package/squirrel/components/p-pagination-info/p-pagination-info.vue +2 -2
  55. package/squirrel/components/p-progress-bar/{p-progess-bar.spec.js → p-progress-bar.spec.js} +7 -5
  56. package/squirrel/components/p-select-btn/p-select-btn.spec.js +104 -0
  57. package/squirrel/components/p-select-list/p-select-list.vue +7 -5
  58. package/squirrel/components/p-select-pill/p-select-pill.spec.js +114 -0
  59. package/squirrel/components/p-select-pill/p-select-pill.vue +1 -1
  60. package/squirrel/components/p-table/usePTableColResize.spec.js +123 -11
  61. package/squirrel/components/p-table/usePTableHeaderWrap.spec.js +1 -1
  62. package/squirrel/components/p-table/usePTableRowVirtualizer.spec.js +207 -0
  63. package/squirrel/components/p-table-header-cell/p-table-header-cell.stories.js +3 -0
  64. package/squirrel/components/p-table-sort/p-table-sort.vue +4 -4
  65. package/squirrel/components/p-tabs-pills/p-tabs-pills.vue +1 -1
  66. package/squirrel/index.spec.js +5 -0
  67. package/squirrel/index.ts +1 -0
  68. package/squirrel/locales/en-US.json +47 -0
  69. package/squirrel/locales/fr-CA.json +47 -0
  70. package/squirrel/plugin/index.spec.ts +140 -0
  71. package/squirrel/plugin/index.ts +54 -0
  72. package/squirrel/utils/dateLocale.spec.ts +20 -0
  73. package/squirrel/utils/dateLocale.ts +19 -0
  74. package/squirrel/utils/listKeyboardNavigation.spec.js +58 -0
  75. package/dist/cjs/chunks/p-date-picker.js +0 -169
  76. package/dist/es/chunks/p-date-picker.js +0 -170
package/README.md CHANGED
@@ -10,7 +10,26 @@ The library is built using [Vue 3](https://vuejs.org/) and [Tailwind CSS](https:
10
10
  Install the package and its dependencies using `pnpm`:
11
11
 
12
12
  ```bash
13
- pnpm i vue vue-router @pequity/squirrel @tanstack/vue-virtual @vuepic/vue-datepicker floating-vue iconify-icon lodash-es vue-currency-input vue-toastification@2.0.0-rc.5
13
+ pnpm i vue vue-i18n vue-router @pequity/squirrel @tanstack/vue-virtual @vuepic/vue-datepicker floating-vue iconify-icon lodash-es vue-currency-input vue-toastification@2.0.0-rc.5
14
+ ```
15
+
16
+ ### Internationalization (i18n) Setup
17
+
18
+ Squirrel requires vue-i18n (already included in the dependency list above). You'll need to install the Squirrel plugin to integrate Squirrel's translations with your i18n instance:
19
+
20
+ ```js
21
+ import { createApp } from 'vue';
22
+ import { SquirrelPlugin } from '@pequity/squirrel';
23
+
24
+ const app = createApp(App);
25
+
26
+ // Install your i18n instance
27
+ app.use(i18n);
28
+
29
+ // Install Squirrel plugin with your i18n instance
30
+ app.use(SquirrelPlugin, i18n);
31
+
32
+ app.mount('#app');
14
33
  ```
15
34
 
16
35
  Install Tailwind CSS:
@@ -6,13 +6,15 @@ const pDropdown = require("../p-dropdown.js");
6
6
  const pIcon_vue_vue_type_script_setup_true_lang = require("./p-icon.js");
7
7
  const component = require("../component.js");
8
8
  const string = require("../string.js");
9
+ const vueI18n = require("vue-i18n");
9
10
  const _hoisted_1 = { class: "flex h-12 w-max select-none items-center rounded-lg bg-p-purple-60 px-2 text-sm font-medium text-white" };
10
- const _hoisted_2 = { class: "mx-4 whitespace-nowrap" };
11
- const _hoisted_3 = { class: "flex" };
12
- const _hoisted_4 = { class: "flex items-center gap-2 px-1" };
11
+ const _hoisted_2 = { class: "text-xs" };
12
+ const _hoisted_3 = { class: "mx-4 whitespace-nowrap" };
13
+ const _hoisted_4 = { class: "flex" };
13
14
  const _hoisted_5 = { class: "flex items-center gap-2 px-1" };
14
- const _hoisted_6 = { class: "bg-p-purple-60 py-2" };
15
- const _hoisted_7 = { class: "flex items-center gap-2 px-1" };
15
+ const _hoisted_6 = { class: "flex items-center gap-2 px-1" };
16
+ const _hoisted_7 = { class: "bg-p-purple-60 py-2" };
17
+ const _hoisted_8 = { class: "flex items-center gap-2 px-1" };
16
18
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
19
  ...{
18
20
  name: "PActionBar",
@@ -26,6 +28,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
26
28
  },
27
29
  emits: ["click:dismiss", "click:action"],
28
30
  setup(__props) {
31
+ const { t } = vueI18n.useI18n();
29
32
  return (_ctx, _cache) => {
30
33
  return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
31
34
  __props.show ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
@@ -42,12 +45,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
42
45
  variant: "dark",
43
46
  class: "-mr-1"
44
47
  }),
45
- _cache[1] || (_cache[1] = vue.createElementVNode("div", { class: "text-xs" }, "Clear All", -1))
48
+ vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(vue.unref(t)("squirrel.action_bar_clear_all")), 1)
46
49
  ]),
47
- _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "h-9 w-0.5 shrink-0 rounded bg-p-purple-50" }, null, -1)),
48
- vue.createElementVNode("p", _hoisted_2, vue.toDisplayString(__props.label), 1),
49
- _cache[3] || (_cache[3] = vue.createElementVNode("div", { class: "mr-2 h-9 w-0.5 shrink-0 rounded bg-p-purple-50" }, null, -1)),
50
- vue.createElementVNode("div", _hoisted_3, [
50
+ _cache[1] || (_cache[1] = vue.createElementVNode("div", { class: "h-9 w-0.5 shrink-0 rounded bg-p-purple-50" }, null, -1)),
51
+ vue.createElementVNode("p", _hoisted_3, vue.toDisplayString(__props.label), 1),
52
+ _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "mr-2 h-9 w-0.5 shrink-0 rounded bg-p-purple-50" }, null, -1)),
53
+ vue.createElementVNode("div", _hoisted_4, [
51
54
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, (actionOrMenu) => {
52
55
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
53
56
  key: `action-${actionOrMenu.label}`
@@ -59,7 +62,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
59
62
  onClick: ($event) => _ctx.$emit("click:action", actionOrMenu.name)
60
63
  }, {
61
64
  default: vue.withCtx(() => [
62
- vue.createElementVNode("div", _hoisted_4, [
65
+ vue.createElementVNode("div", _hoisted_5, [
63
66
  vue.unref(component.isComponent)(actionOrMenu.icon) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(actionOrMenu.icon), {
64
67
  key: 0,
65
68
  class: "h-4 w-4"
@@ -79,7 +82,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
79
82
  strategy: "fixed"
80
83
  }, {
81
84
  popper: vue.withCtx(({ hide }) => [
82
- vue.createElementVNode("ul", _hoisted_6, [
85
+ vue.createElementVNode("ul", _hoisted_7, [
83
86
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(actionOrMenu.subActions, (subaction) => {
84
87
  return vue.openBlock(), vue.createElementBlock("li", {
85
88
  key: `subaction-${subaction.name}`
@@ -91,7 +94,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
91
94
  onClick: ($event) => (_ctx.$emit("click:action", subaction.name), hide())
92
95
  }, {
93
96
  default: vue.withCtx(() => [
94
- vue.createElementVNode("div", _hoisted_7, [
97
+ vue.createElementVNode("div", _hoisted_8, [
95
98
  vue.unref(component.isComponent)(subaction.icon) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(subaction.icon), {
96
99
  key: 0,
97
100
  class: "h-4 w-4"
@@ -116,7 +119,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
116
119
  type: "secondary-ghost-dark"
117
120
  }, {
118
121
  default: vue.withCtx(() => [
119
- vue.createElementVNode("div", _hoisted_5, [
122
+ vue.createElementVNode("div", _hoisted_6, [
120
123
  vue.unref(component.isComponent)(actionOrMenu.icon) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(actionOrMenu.icon), {
121
124
  key: 0,
122
125
  class: "h-4 w-4"
@@ -10,7 +10,7 @@ const string = require("../string.js");
10
10
  const text = require("../text.js");
11
11
  const lodashEs = require("lodash-es");
12
12
  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";
13
- const _hoisted_1 = ["data-has-error"];
13
+ const _hoisted_1 = ["data-has-error", "aria-label"];
14
14
  const _hoisted_2 = { class: "truncate text-left text-p-gray-40" };
15
15
  const _hoisted_3 = {
16
16
  key: 0,
@@ -20,25 +20,26 @@ const _hoisted_4 = {
20
20
  class: "max-w-[200px] truncate",
21
21
  "data-test": "pill-text"
22
22
  };
23
- const _hoisted_5 = ["onClick"];
23
+ const _hoisted_5 = ["aria-label", "onClick"];
24
24
  const _hoisted_6 = {
25
25
  key: 1,
26
26
  class: "truncate text-left"
27
27
  };
28
- const _hoisted_7 = {
28
+ const _hoisted_7 = ["aria-label"];
29
+ const _hoisted_8 = {
29
30
  key: 0,
30
31
  class: "mt-3 px-3"
31
32
  };
32
- const _hoisted_8 = { class: "text-p-purple-60" };
33
- const _hoisted_9 = { class: "flex flex-row" };
34
- const _hoisted_10 = ["onClick"];
35
- const _hoisted_11 = ["title"];
36
- const _hoisted_12 = {
33
+ const _hoisted_9 = { class: "text-p-purple-60" };
34
+ const _hoisted_10 = { class: "flex flex-row" };
35
+ const _hoisted_11 = ["onClick"];
36
+ const _hoisted_12 = ["title"];
37
+ const _hoisted_13 = {
37
38
  key: 0,
38
39
  class: "ml-auto fill-p-purple-60 pl-2",
39
40
  src: _imports_0
40
41
  };
41
- const _hoisted_13 = {
42
+ const _hoisted_14 = {
42
43
  key: 1,
43
44
  class: "ml-auto h-4 w-[26px] pl-2"
44
45
  };
@@ -348,7 +349,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
348
349
  class: vue.normalizeClass([{ hidden: vue.unref($attrs).hidden }, vue.unref($attrs).class]),
349
350
  "data-has-error": !!__props.errorMsg,
350
351
  style: vue.normalizeStyle(style.value),
351
- "aria-label": "Dropdown select"
352
+ "aria-label": _ctx.$t("squirrel.dropdown_select_aria_label")
352
353
  }, [
353
354
  __props.label ? (vue.openBlock(), vue.createElementBlock("label", {
354
355
  key: 0,
@@ -366,15 +367,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
366
367
  "p-select-list": "",
367
368
  role: "listbox"
368
369
  }), [
369
- __props.multiple || __props.searchable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
370
+ __props.multiple || __props.searchable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
370
371
  __props.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
371
372
  key: 0,
372
373
  ref_key: "actionsContainer",
373
374
  ref: actionsContainer,
374
375
  class: "flex flex-row justify-between text-xs font-semibold text-primary"
375
376
  }, [
376
- vue.createElementVNode("p", _hoisted_8, vue.toDisplayString(vue.unref(computedItems).length) + " items", 1),
377
- vue.createElementVNode("div", _hoisted_9, [
377
+ vue.createElementVNode("p", _hoisted_9, vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_items", vue.unref(computedItems).length)), 1),
378
+ vue.createElementVNode("div", _hoisted_10, [
378
379
  vue.unref(computedItems).length === vue.unref(internalItems).length ? (vue.openBlock(), vue.createElementBlock("a", {
379
380
  key: 0,
380
381
  class: vue.normalizeClass([
@@ -382,18 +383,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
382
383
  ]),
383
384
  onClick: _cache[2] || (_cache[2] = //@ts-ignore
384
385
  (...args) => vue.unref(selectAll) && vue.unref(selectAll)(...args))
385
- }, " Select all ", 2)) : (vue.openBlock(), vue.createElementBlock("a", {
386
+ }, vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_select_all")), 3)) : (vue.openBlock(), vue.createElementBlock("a", {
386
387
  key: 1,
387
388
  class: vue.normalizeClass([vue.unref(computedInsideSelected) ? "pointer-events-none opacity-50" : "cursor-pointer"]),
388
389
  onClick: _cache[3] || (_cache[3] = //@ts-ignore
389
390
  (...args) => vue.unref(selectAll) && vue.unref(selectAll)(...args))
390
- }, " Select all filtered ", 2)),
391
+ }, vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_select_all_filtered")), 3)),
391
392
  _cache[7] || (_cache[7] = vue.createElementVNode("span", { class: "px-1 leading-none" }, ".", -1)),
392
393
  vue.createElementVNode("a", {
393
394
  class: vue.normalizeClass([vue.unref(selectedItems).length ? "cursor-pointer" : "pointer-events-none opacity-50"]),
394
395
  onClick: _cache[4] || (_cache[4] = //@ts-ignore
395
396
  (...args) => vue.unref(clearAll) && vue.unref(clearAll)(...args))
396
- }, " Clear all ", 2)
397
+ }, vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_clear_all")), 3)
397
398
  ])
398
399
  ], 512)) : vue.createCommentVNode("", true),
399
400
  __props.searchable ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -461,11 +462,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
461
462
  class: vue.normalizeClass({ "bg-p-blue-20": index === 1 })
462
463
  }, vue.toDisplayString(str), 3);
463
464
  }), 128))
464
- ], 8, _hoisted_11)
465
+ ], 8, _hoisted_12)
465
466
  ]),
466
- vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_12)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13))
467
+ vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_13)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_14))
467
468
  ], 2)
468
- ], 14, _hoisted_10)), [
469
+ ], 14, _hoisted_11)), [
469
470
  [_directive_close_popper, !__props.multiple]
470
471
  ])
471
472
  ], 4);
@@ -481,11 +482,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
481
482
  onClick: handleCreate
482
483
  }, [
483
484
  vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, { icon: "fe:plus-circle" }),
484
- vue.createTextVNode(" Add '" + vue.toDisplayString(vue.unref(search)) + "' ", 1)
485
+ vue.createTextVNode(" " + vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_add")) + " '" + vue.toDisplayString(vue.unref(search)) + "' ", 1)
485
486
  ])) : __props.creatable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
486
- vue.createTextVNode("No items found. Type to add")
487
+ vue.createTextVNode(vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_no_items_found_type_to_add")), 1)
487
488
  ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
488
- vue.createTextVNode("No items found")
489
+ vue.createTextVNode(vue.toDisplayString(_ctx.$t("squirrel.dropdown_select_no_items_found")), 1)
489
490
  ], 64))
490
491
  ], 2)
491
492
  ]) : vue.createCommentVNode("", true)
@@ -524,7 +525,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
524
525
  vue.createElementVNode("button", {
525
526
  type: "button",
526
527
  class: "flex items-center justify-center text-p-gray-40 hover:text-p-gray-60",
527
- "aria-label": "Remove item",
528
+ "aria-label": _ctx.$t("squirrel.dropdown_select_remove_item"),
528
529
  "data-test": "pill-remove",
529
530
  onClick: vue.withModifiers(($event) => vue.unref(select)($event, item[__props.itemValue]), ["stop"])
530
531
  }, [
@@ -535,12 +536,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
535
536
  ], 8, _hoisted_5)
536
537
  ], 2);
537
538
  }), 128))
538
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(__props.multiple ? vue.unref(selectedItems).length === vue.unref(computedItems).length ? "All options selected" : `${vue.unref(selectedItems).length} option${vue.unref(selectedItems).length > 1 ? "s" : ""} selected` : vue.unref(selectedItems)[0][__props.itemText]), 1))
539
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(__props.multiple ? vue.unref(selectedItems).length === vue.unref(computedItems).length ? _ctx.$t("squirrel.dropdown_select_all_options_selected") : `${vue.unref(selectedItems).length} ${_ctx.$t("squirrel.dropdown_select_options", vue.unref(selectedItems).length)} ${_ctx.$t("squirrel.dropdown_select_selected")}` : vue.unref(selectedItems)[0][__props.itemText]), 1))
539
540
  ]),
540
541
  __props.clearable && vue.unref(selectedItems).length ? (vue.openBlock(), vue.createElementBlock("button", {
541
542
  key: 2,
542
543
  class: vue.normalizeClass(["absolute right-9 flex h-6 items-center justify-center text-base text-p-gray-40 hover:text-p-gray-60", [CLEAR_BUTTON_SPACING[__props.size]]]),
543
- "aria-label": "Clear selection",
544
+ "aria-label": _ctx.$t("squirrel.dropdown_select_clear_selection"),
544
545
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(
545
546
  //@ts-ignore
546
547
  (...args) => vue.unref(clearAll) && vue.unref(clearAll)(...args),
@@ -548,7 +549,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
548
549
  ))
549
550
  }, [
550
551
  vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, { icon: "fe:close" })
551
- ], 2)) : vue.createCommentVNode("", true)
552
+ ], 10, _hoisted_7)) : vue.createCommentVNode("", true)
552
553
  ], 16)
553
554
  ]),
554
555
  _: 3
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
3
  const useInputClasses = require("../useInputClasses.js");
4
- const VueDatePicker = require("@vuepic/vue-datepicker");
4
+ const dateLocale = require("../dateLocale.js");
5
+ const vueDatepicker = require("@vuepic/vue-datepicker");
6
+ const vueI18n = require("vue-i18n");
5
7
  const _hoisted_1 = ["data-has-error"];
6
8
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7
9
  ...{
@@ -10,124 +12,91 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
12
  },
11
13
  __name: "p-inline-date-picker",
12
14
  props: /* @__PURE__ */ vue.mergeModels({
13
- label: { default: "" },
14
- errorMsg: { default: "" },
15
- required: { type: Boolean, default: false },
16
- uid: {},
17
- name: {},
18
- is24: { type: Boolean },
19
- enableTimePicker: { type: Boolean, default: false },
20
- range: { type: [Boolean, Object] },
21
15
  multiCalendars: { type: [Boolean, Number, String, Object] },
22
- modelValue: {},
23
- locale: {},
24
- position: {},
16
+ modelType: { default: "yyyy-MM-dd" },
25
17
  dark: { type: Boolean },
26
- placeholder: {},
27
- weekNumbers: {},
28
- hoursIncrement: {},
29
- hoursGridIncrement: {},
30
- secondsGridIncrement: {},
31
- minutesGridIncrement: {},
32
- minutesIncrement: {},
33
- secondsIncrement: {},
34
- minDate: {},
35
- maxDate: {},
36
- minTime: {},
37
- maxTime: {},
38
- weekStart: { default: 0 },
39
- disabled: { type: Boolean },
40
- readonly: { type: Boolean },
41
- format: {},
42
- previewFormat: {},
43
- hideInputIcon: { type: Boolean },
44
- state: { type: Boolean },
45
- clearable: { type: Boolean },
46
- alwaysClearable: { type: Boolean },
47
- autoApply: { type: Boolean, default: true },
48
- filters: {},
49
- disableMonthYearSelect: { type: Boolean },
18
+ transitions: { type: [Boolean, Object] },
19
+ ariaLabels: {},
20
+ hideNavigation: {},
21
+ timezone: {},
22
+ vertical: { type: Boolean },
23
+ hideMonthYearSelect: { type: Boolean },
24
+ disableYearSelect: { type: Boolean },
50
25
  yearRange: {},
26
+ autoApply: { type: Boolean, default: true },
51
27
  disabledDates: {},
52
- inline: { type: [Boolean, Object], default: true },
53
- selectText: {},
54
- cancelText: {},
55
- weekNumName: {},
56
- autoPosition: { type: [Boolean, String] },
57
- monthPicker: { type: Boolean },
58
- timePicker: { type: Boolean },
59
- textInput: { type: [Boolean, Object] },
60
- monthNameFormat: {},
61
28
  startDate: {},
62
- startTime: {},
63
29
  hideOffsetDates: { type: Boolean, default: true },
64
30
  noToday: { type: Boolean },
65
- noHoursOverlay: { type: Boolean },
66
- noMinutesOverlay: { type: Boolean },
67
- noSecondsOverlay: { type: Boolean },
68
- altPosition: {},
69
- disabledWeekDays: {},
70
31
  allowedDates: {},
71
- nowButtonLabel: {},
72
- monthChangeOnScroll: { type: [Boolean, String] },
73
32
  markers: {},
74
- transitions: { type: [Boolean, Object] },
75
- enableSeconds: { type: Boolean },
76
- escClose: { type: Boolean },
77
- spaceConfirm: { type: Boolean },
78
- monthChangeOnArrows: { type: Boolean },
79
- formatLocale: {},
80
- autocomplete: {},
81
- multiDates: { type: [Boolean, Object] },
82
33
  presetDates: {},
83
34
  flow: {},
84
- partialFlow: { type: Boolean },
85
35
  preventMinMaxNavigation: { type: Boolean },
86
- utc: { type: [Boolean, String] },
87
36
  reverseYears: { type: Boolean },
88
37
  weekPicker: { type: Boolean },
89
- vertical: { type: Boolean },
90
- ariaLabels: {},
38
+ filters: {},
91
39
  arrowNavigation: { type: Boolean },
92
- yearPicker: { type: Boolean },
40
+ highlight: {},
41
+ teleport: { type: [String, Boolean] },
42
+ centered: { type: Boolean },
43
+ locale: {},
44
+ weekStart: { default: 0 },
45
+ weekNumbers: { type: [Boolean, Object] },
93
46
  dayNames: {},
94
- modelType: { default: "yyyy-MM-dd" },
47
+ monthPicker: { type: Boolean },
48
+ yearPicker: { type: Boolean },
95
49
  modelAuto: { type: Boolean },
96
- highlight: {},
97
- offset: {},
98
- teleportCenter: { type: Boolean },
99
- teleport: { type: [Boolean, String] },
100
- ignoreTimeValidation: { type: Boolean },
101
- dayClass: {},
102
- hideNavigation: {},
50
+ formats: {},
51
+ multiDates: { type: [Boolean, Object] },
52
+ minDate: {},
53
+ maxDate: {},
54
+ minTime: {},
55
+ maxTime: {},
56
+ inputAttrs: {},
57
+ timeConfig: { default: () => ({ enableTimePicker: false }) },
58
+ placeholder: { default: "" },
59
+ timePicker: { type: Boolean },
60
+ range: { type: [Boolean, Object] },
61
+ menuId: {},
62
+ disabled: { type: Boolean },
63
+ readonly: { type: Boolean },
64
+ inline: { type: [Boolean, Object] },
65
+ textInput: { type: [Boolean, Object], default: false },
103
66
  sixWeeks: { type: [Boolean, String] },
104
- timezone: {},
105
- disableYearSelect: { type: Boolean },
67
+ actionRow: {},
106
68
  focusStartDate: { type: Boolean },
107
69
  disabledTimes: {},
108
- timePickerInline: { type: Boolean },
109
70
  calendar: {},
110
71
  config: {},
111
72
  quarterPicker: { type: Boolean },
112
73
  yearFirst: { type: Boolean },
113
74
  loading: { type: Boolean },
114
- onInternalModelChange: {},
115
- enableMinutes: { type: Boolean },
116
- ui: {}
75
+ ui: {},
76
+ floating: {},
77
+ label: { default: "" },
78
+ errorMsg: { default: "" },
79
+ required: { type: Boolean, default: false }
117
80
  }, {
118
- "modelValue": { default: "" },
81
+ "modelValue": {},
119
82
  "modelModifiers": {}
120
83
  }),
121
84
  emits: ["update:modelValue"],
122
85
  setup(__props) {
123
86
  const props = __props;
124
87
  const model = vue.useModel(__props, "modelValue");
88
+ const { locale } = vueI18n.useI18n();
125
89
  const attrs = vue.useAttrs();
126
90
  const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
127
91
  const datePickerProps = vue.computed(() => {
128
- const { modelValue: _, ...propsWithoutModelValue } = props;
92
+ const { label, errorMsg, required, ...vueDatePickerProps } = props;
129
93
  const { class: classes, style: style2, ...attrsWithoutClassAndStyle } = attrs;
130
- return { ...propsWithoutModelValue, ...attrsWithoutClassAndStyle };
94
+ return {
95
+ ...vueDatePickerProps,
96
+ ...attrsWithoutClassAndStyle,
97
+ locale: dateLocale.getDateFnsLocale(locale.value),
98
+ inline: true
99
+ };
131
100
  });
132
101
  const style = vue.computed(() => {
133
102
  return attrs.style;
@@ -147,7 +116,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
147
116
  class: vue.normalizeClass(vue.unref(labelClasses))
148
117
  }, vue.toDisplayString(__props.label), 3)) : vue.createCommentVNode("", true)
149
118
  ]),
150
- vue.createVNode(vue.unref(VueDatePicker), vue.mergeProps({
119
+ vue.createVNode(vue.unref(vueDatepicker.VueDatePicker), vue.mergeProps({
151
120
  modelValue: model.value,
152
121
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
153
122
  }, datePickerProps.value), null, 16, ["modelValue"]),
@@ -59,9 +59,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
59
59
  class: "h-6 w-56"
60
60
  })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
61
61
  __props.count ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
62
- vue.createTextVNode("Showing " + vue.toDisplayString(from.value) + " to " + vue.toDisplayString(to.value) + " of " + vue.toDisplayString(__props.count) + " results", 1)
62
+ vue.createTextVNode(vue.toDisplayString(_ctx.$t("squirrel.pagination_info_showing_results", { from: from.value, to: to.value, count: __props.count })), 1)
63
63
  ], 64)) : vue.renderSlot(_ctx.$slots, "no-results", { key: 1 }, () => [
64
- _cache[0] || (_cache[0] = vue.createTextVNode("No results found", -1))
64
+ vue.createTextVNode(vue.toDisplayString(_ctx.$t("squirrel.pagination_info_no_results_found")), 1)
65
65
  ])
66
66
  ]));
67
67
  };
@@ -7,9 +7,11 @@ const _hoisted_1 = {
7
7
  key: 1,
8
8
  class: "flex text-p-gray-40"
9
9
  };
10
- const _hoisted_2 = ["onClick"];
11
- const _hoisted_3 = { class: "flex" };
12
- const _hoisted_4 = ["aria-label"];
10
+ const _hoisted_2 = ["aria-label"];
11
+ const _hoisted_3 = ["onClick"];
12
+ const _hoisted_4 = { class: "flex" };
13
+ const _hoisted_5 = ["aria-label"];
14
+ const _hoisted_6 = ["aria-label"];
13
15
  const DOTS = "...";
14
16
  const BTN_CLASS = "w-6 h-6 flex justify-center items-center mx-1 font-semibold text-sm leading-none";
15
17
  const BTN_ACTIVE_CLASS = "text-p-purple-60 bg-p-gray-30 rounded-lg";
@@ -85,41 +87,41 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
85
87
  !__props.loading && pages.value.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
86
88
  vue.createElementVNode("div", {
87
89
  class: vue.normalizeClass([BTN_CLASS, Number(__props.modelValue) <= 1 ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
88
- "aria-label": "go to the previous page",
90
+ "aria-label": _ctx.$t("squirrel.pagination_go_to_previous_page"),
89
91
  onClick: _cache[0] || (_cache[0] = ($event) => setPage(Number(__props.modelValue) - 1))
90
92
  }, [
91
93
  vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
92
94
  icon: "chevron-left",
93
95
  width: "24px"
94
96
  })
95
- ], 2),
97
+ ], 10, _hoisted_2),
96
98
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(pages.value, (page, index) => {
97
99
  return vue.openBlock(), vue.createElementBlock("div", {
98
100
  key: index,
99
101
  onClick: ($event) => setPage(Number(page))
100
102
  }, [
101
- vue.createElementVNode("div", _hoisted_3, [
103
+ vue.createElementVNode("div", _hoisted_4, [
102
104
  page !== DOTS ? (vue.openBlock(), vue.createElementBlock("div", {
103
105
  key: 0,
104
106
  class: vue.normalizeClass([BTN_CLASS, page === __props.modelValue ? BTN_ACTIVE_CLASS : BTN_INACTIVE_CLASS]),
105
- "aria-label": `go to page ${page}`
106
- }, vue.toDisplayString(page), 11, _hoisted_4)) : (vue.openBlock(), vue.createElementBlock("div", {
107
+ "aria-label": _ctx.$t("squirrel.pagination_go_to_page", { page })
108
+ }, vue.toDisplayString(page), 11, _hoisted_5)) : (vue.openBlock(), vue.createElementBlock("div", {
107
109
  key: 1,
108
110
  class: vue.normalizeClass(BTN_CLASS)
109
111
  }, vue.toDisplayString(DOTS)))
110
112
  ])
111
- ], 8, _hoisted_2);
113
+ ], 8, _hoisted_3);
112
114
  }), 128)),
113
115
  vue.createElementVNode("div", {
114
116
  class: vue.normalizeClass([BTN_CLASS, __props.modelValue === pageCount.value ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
115
- "aria-label": "go to the next page",
117
+ "aria-label": _ctx.$t("squirrel.pagination_go_to_next_page"),
116
118
  onClick: _cache[1] || (_cache[1] = ($event) => setPage(Number(__props.modelValue) + 1))
117
119
  }, [
118
120
  vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
119
121
  icon: "chevron-right",
120
122
  width: "24px"
121
123
  })
122
- ], 2)
124
+ ], 10, _hoisted_6)
123
125
  ])) : vue.createCommentVNode("", true)
124
126
  ], 64);
125
127
  };
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const _hoisted_1 = {
4
- class: "flex h-6 w-fit flex-row space-x-1 overflow-x-auto rounded bg-p-gray-10 p-1 text-sm font-medium text-p-gray-50",
5
- "aria-label": "Tabs Pills",
6
- role: "tablist",
7
- "aria-orientation": "horizontal"
8
- };
3
+ const _hoisted_1 = ["aria-label"];
9
4
  const _hoisted_2 = ["disabled", "aria-selected", "data-tab", "aria-controls", "onClick"];
10
5
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
11
6
  ...{
@@ -21,7 +16,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
16
  emits: ["update:modelValue"],
22
17
  setup(__props) {
23
18
  return (_ctx, _cache) => {
24
- return vue.openBlock(), vue.createElementBlock("nav", _hoisted_1, [
19
+ return vue.openBlock(), vue.createElementBlock("nav", {
20
+ class: "flex h-6 w-fit flex-row space-x-1 overflow-x-auto rounded bg-p-gray-10 p-1 text-sm font-medium text-p-gray-50",
21
+ "aria-label": _ctx.$t("squirrel.tabs_pills_aria_label"),
22
+ role: "tablist",
23
+ "aria-orientation": "horizontal"
24
+ }, [
25
25
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.items, (tab) => {
26
26
  return vue.openBlock(), vue.createElementBlock("button", {
27
27
  key: String(tab[__props.itemValue]),
@@ -37,7 +37,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
37
37
  onClick: ($event) => _ctx.$emit("update:modelValue", tab[__props.itemValue])
38
38
  }, vue.toDisplayString(tab[__props.itemText]), 11, _hoisted_2);
39
39
  }), 128))
40
- ]);
40
+ ], 8, _hoisted_1);
41
41
  };
42
42
  }
43
43
  });