@pequity/squirrel 10.0.2 → 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-icon.js +1 -0
- 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-icon.js +1 -0
- package/dist/es/p-input-search.js +5 -4
- package/dist/es/p-modal.js +3 -3
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +2 -2
- package/dist/squirrel/components/p-icon/p-icon.types.d.ts +1 -0
- 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-icon/p-icon.types.ts +1 -0
- 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-features.spec.js +10 -10
- 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/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: "
|
|
11
|
-
const _hoisted_3 = { class: "
|
|
12
|
-
const _hoisted_4 = { class: "flex
|
|
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: "
|
|
15
|
-
const _hoisted_7 = { class: "
|
|
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
|
-
|
|
48
|
+
vue.createElementVNode("div", _hoisted_2, vue.toDisplayString(vue.unref(t)("squirrel.action_bar_clear_all")), 1)
|
|
46
49
|
]),
|
|
47
|
-
_cache[
|
|
48
|
-
vue.createElementVNode("p",
|
|
49
|
-
_cache[
|
|
50
|
-
vue.createElementVNode("div",
|
|
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",
|
|
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",
|
|
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",
|
|
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",
|
|
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"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const vue = require("vue");
|
|
3
3
|
const pInput_vue_vue_type_script_setup_true_lang = require("./p-input.js");
|
|
4
4
|
const VueDatePicker = require("@vuepic/vue-datepicker");
|
|
5
|
+
const vueI18n = require("vue-i18n");
|
|
5
6
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
6
7
|
...{
|
|
7
8
|
name: "PDatePicker",
|
|
@@ -121,10 +122,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
121
122
|
setup(__props) {
|
|
122
123
|
const props = __props;
|
|
123
124
|
const model = vue.useModel(__props, "modelValue");
|
|
125
|
+
const { locale } = vueI18n.useI18n();
|
|
124
126
|
const attrs = vue.useAttrs();
|
|
125
127
|
const datePickerProps = vue.computed(() => {
|
|
126
128
|
const { modelValue: _, ...propsWithoutModelValue } = props;
|
|
127
|
-
return propsWithoutModelValue;
|
|
129
|
+
return { ...propsWithoutModelValue, locale: locale.value };
|
|
128
130
|
});
|
|
129
131
|
const inputPropsAndAttrs = vue.computed(() => {
|
|
130
132
|
const { class: classes, style, ...res } = attrs;
|
|
@@ -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
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
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
|
|
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": "
|
|
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",
|
|
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",
|
|
377
|
-
vue.createElementVNode("div",
|
|
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
|
-
}, "
|
|
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
|
-
}, "
|
|
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
|
-
}, "
|
|
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,
|
|
465
|
+
], 8, _hoisted_12)
|
|
465
466
|
]),
|
|
466
|
-
vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img",
|
|
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,
|
|
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("
|
|
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("
|
|
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("
|
|
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": "
|
|
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 ? "
|
|
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": "
|
|
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
|
-
],
|
|
552
|
+
], 10, _hoisted_7)) : vue.createCommentVNode("", true)
|
|
552
553
|
], 16)
|
|
553
554
|
]),
|
|
554
555
|
_: 3
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const vue = require("vue");
|
|
3
3
|
const useInputClasses = require("../useInputClasses.js");
|
|
4
4
|
const VueDatePicker = require("@vuepic/vue-datepicker");
|
|
5
|
+
const vueI18n = require("vue-i18n");
|
|
5
6
|
const _hoisted_1 = ["data-has-error"];
|
|
6
7
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
7
8
|
...{
|
|
@@ -122,12 +123,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
122
123
|
setup(__props) {
|
|
123
124
|
const props = __props;
|
|
124
125
|
const model = vue.useModel(__props, "modelValue");
|
|
126
|
+
const { locale } = vueI18n.useI18n();
|
|
125
127
|
const attrs = vue.useAttrs();
|
|
126
128
|
const { labelClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
|
|
127
129
|
const datePickerProps = vue.computed(() => {
|
|
128
130
|
const { modelValue: _, ...propsWithoutModelValue } = props;
|
|
129
131
|
const { class: classes, style: style2, ...attrsWithoutClassAndStyle } = attrs;
|
|
130
|
-
return { ...propsWithoutModelValue, ...attrsWithoutClassAndStyle };
|
|
132
|
+
return { ...propsWithoutModelValue, ...attrsWithoutClassAndStyle, locale: locale.value };
|
|
131
133
|
});
|
|
132
134
|
const style = vue.computed(() => {
|
|
133
135
|
return attrs.style;
|
|
@@ -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(
|
|
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
|
-
|
|
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 = ["
|
|
11
|
-
const _hoisted_3 =
|
|
12
|
-
const _hoisted_4 =
|
|
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": "
|
|
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
|
-
],
|
|
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",
|
|
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":
|
|
106
|
-
}, vue.toDisplayString(page), 11,
|
|
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,
|
|
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": "
|
|
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
|
-
],
|
|
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",
|
|
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
|
});
|