@wikicasa-dev/components 2.0.43 → 2.0.45

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.
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.DI5YPfeQ.js";
1
+ import { _ as f } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CThPNixl.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.BscSQ5bW.js";
1
+ import { _ as f } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BasePagination.vue_vue_type_script_setup_true_lang.C_KW3jtP.js";
1
+ import { _ as f } from "./chunks/BasePagination.vue_vue_type_script_setup_true_lang.Cb6fEMc-.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,5 @@
1
- import { ClassType } from '@wikicasa-dev/types';
1
+ import { Nullable } from '@wikicasa-dev/types';
2
+ import { ClassType } from './types';
2
3
  declare function __VLS_template(): {
3
4
  slots: {
4
5
  btn_slot?(_: {
@@ -10,6 +11,8 @@ declare function __VLS_template(): {
10
11
  toggleDropdown: () => void;
11
12
  activeIdx: number;
12
13
  selectedIdx: number;
14
+ setActiveIdx: (idx?: Nullable<number>) => void;
15
+ setSelectedIdx: (idx?: Nullable<number>) => void;
13
16
  }): any;
14
17
  };
15
18
  refs: {
@@ -60,8 +63,8 @@ declare const __VLS_component: import('vue').DefineComponent<{
60
63
  dataCy: string;
61
64
  arrowWidth: number;
62
65
  btnClasses: string;
63
- labelClasses: ClassType;
64
- dropdownClasses: ClassType;
66
+ labelClasses: string | Record<string, boolean> | ClassType[] | null;
67
+ dropdownClasses: string | Record<string, boolean> | ClassType[] | null;
65
68
  withArrowIcon: boolean;
66
69
  btnLabel: string;
67
70
  direction: "up" | "down";
@@ -8,6 +8,8 @@ declare let __VLS_typeProps: {
8
8
  small?: boolean;
9
9
  prevLabel?: string;
10
10
  nextLabel?: string;
11
+ prevDataCy?: string;
12
+ nextDataCy?: string;
11
13
  };
12
14
  type __VLS_PublicProps = {
13
15
  "pageNumber"?: Optional<number>;
@@ -16,14 +18,5 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
16
18
  "update:pageNumber": (pageNumber: Optional<number>) => any;
17
19
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
20
  "onUpdate:pageNumber"?: ((pageNumber: Optional<number>) => any) | undefined;
19
- }>, {
20
- arrowColor: string;
21
- small: boolean;
22
- count: number;
23
- limit: number;
24
- siblings: number;
25
- additionalCount: number;
26
- prevLabel: string;
27
- nextLabel: string;
28
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
22
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as T, mergeModels as $, useModel as L, ref as r, computed as k, onBeforeMount as F, watch as f, openBlock as C, createBlock as S, normalizeClass as H, withCtx as s, createVNode as z, renderSlot as V, createElementBlock as A, Fragment as K, renderList as N, unref as U, createElementVNode as W } from "vue";
2
2
  import j from "../BaseInput.js";
3
- import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.BscSQ5bW.js";
3
+ import { _ as q } from "./BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
4
4
  import "./types-B0dZ7OiV.D29wNgoj.js";
5
5
  import { _ as G } from "./SelectItem.vue_vue_type_script_setup_true_lang.GPFf7fjA.js";
6
6
  import { A as J } from "./useKeyboardController.CutKeclN.js";
@@ -1,9 +1,9 @@
1
- import { defineComponent as D, useId as S, ref as m, computed as L, useTemplateRef as E, watch as r, onBeforeMount as I, onMounted as A, onUnmounted as O, openBlock as s, createElementBlock as W, normalizeClass as i, withModifiers as w, renderSlot as v, createVNode as $, unref as a, withCtx as b, createElementVNode as M, createBlock as h, createCommentVNode as H, resolveDynamicComponent as N } from "vue";
2
- import { _ as T } from "./BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
3
- import { a as V } from "./ArrowIcon.CCFMdsq6.js";
1
+ import { defineComponent as I, useId as L, ref as w, computed as A, useTemplateRef as E, watch as s, onBeforeMount as O, onMounted as W, onUnmounted as $, openBlock as u, createElementBlock as M, normalizeClass as i, withModifiers as v, renderSlot as b, createVNode as H, unref as a, withCtx as h, createElementVNode as N, createBlock as C, createCommentVNode as T, resolveDynamicComponent as V } from "vue";
2
+ import { _ as K } from "./BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
3
+ import { a as q } from "./ArrowIcon.CCFMdsq6.js";
4
4
  import "./PharmacyIcon.56ql_DYl.js";
5
- import { A as K } from "./useKeyboardController.CutKeclN.js";
6
- const q = ["innerHTML"], G = /* @__PURE__ */ D({
5
+ import { A as z } from "./useKeyboardController.CutKeclN.js";
6
+ const R = ["innerHTML"], Q = /* @__PURE__ */ I({
7
7
  inheritAttrs: !1,
8
8
  __name: "BaseDropDown",
9
9
  props: {
@@ -24,13 +24,13 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
24
24
  dataCy: { default: "" }
25
25
  },
26
26
  emits: ["click", "update:dropdownState"],
27
- setup(C, { emit: y }) {
28
- const o = C, u = S(), p = y, t = m(!1), n = m([]), g = L(() => n.value.length), c = E("dropdown"), { activeIdx: B, selectedIdx: k } = K({
29
- optionsLength: g,
27
+ setup(y, { emit: g }) {
28
+ const o = y, c = L(), p = g, t = w(!1), n = w([]), B = A(() => n.value.length), k = E("dropdown"), { activeIdx: f, selectedIdx: d } = z({
29
+ optionsLength: B,
30
30
  isDropdownOpen: t,
31
31
  activate: o.activateKeyboardController
32
32
  });
33
- r(
33
+ s(
34
34
  () => o.openDropdown,
35
35
  (e) => {
36
36
  t.value = e;
@@ -38,34 +38,38 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
38
38
  {
39
39
  immediate: !0
40
40
  }
41
- ), r(t, (e) => {
41
+ ), s(t, (e) => {
42
42
  p("update:dropdownState", e);
43
- }), r(k, (e) => {
43
+ }), s(d, (e) => {
44
44
  e !== -1 && n.value[e].querySelector("a")?.click();
45
45
  });
46
- const f = () => {
46
+ const m = () => {
47
47
  t.value = !1;
48
- }, d = () => {
48
+ }, r = () => {
49
49
  o.keepState === "closed" && !t.value || o.keepState === "opened" && t.value || (t.value = !t.value);
50
+ }, S = (e) => {
51
+ e != null && (f.value = e);
52
+ }, D = (e) => {
53
+ e != null && (d.value = e);
50
54
  };
51
- return I(() => {
52
- o.closeWhenClickedOutside && document.body.addEventListener("click", f);
53
- }), A(() => {
54
- c.value && (n.value = c.value.children || []);
55
- }), O(() => {
56
- o.closeWhenClickedOutside && document.body.removeEventListener("click", f);
57
- }), (e, l) => (s(), W("div", {
55
+ return O(() => {
56
+ o.closeWhenClickedOutside && document.body.addEventListener("click", m);
57
+ }), W(() => {
58
+ k.value && (n.value = k.value.children || []);
59
+ }), $(() => {
60
+ o.closeWhenClickedOutside && document.body.removeEventListener("click", m);
61
+ }), (e, l) => (u(), M("div", {
58
62
  class: i(["uikit-relative uikit-block", e.$attrs.class]),
59
- onClick: l[1] || (l[1] = w((z) => {
60
- p("click"), d();
63
+ onClick: l[1] || (l[1] = v((U) => {
64
+ p("click"), r();
61
65
  }, ["stop"]))
62
66
  }, [
63
- v(e.$slots, "btn_slot", {
64
- toggleDropdown: d,
67
+ b(e.$slots, "btn_slot", {
68
+ toggleDropdown: r,
65
69
  isOpen: t.value
66
70
  }, () => [
67
- $(T, {
68
- id: a(u),
71
+ H(K, {
72
+ id: a(c),
69
73
  type: "button",
70
74
  "data-cy": e.dataCy,
71
75
  class: i([
@@ -75,24 +79,24 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
75
79
  "aria-expanded": t.value,
76
80
  "btn-class": "uikit-btn-single-selection"
77
81
  }, {
78
- default: b(() => [
79
- M("span", {
82
+ default: h(() => [
83
+ N("span", {
80
84
  class: i(["uikit-mr-5px", e.labelClasses]),
81
85
  innerHTML: e.btnLabel
82
- }, null, 10, q),
83
- e.withArrowIcon ? (s(), h(a(V), {
86
+ }, null, 10, R),
87
+ e.withArrowIcon ? (u(), C(a(q), {
84
88
  key: 0,
85
89
  class: i(["uikit-shrink-0 uikit-transition-transform motion-reduce:uikit-transition-none", t.value ? "uikit-rotate-180" : ""]),
86
90
  width: e.arrowWidth,
87
91
  height: e.arrowWidth,
88
92
  "stroke-color": e.arrowStrokeColor
89
- }, null, 8, ["class", "width", "height", "stroke-color"])) : H("", !0)
93
+ }, null, 8, ["class", "width", "height", "stroke-color"])) : T("", !0)
90
94
  ]),
91
95
  _: 1
92
96
  }, 8, ["id", "data-cy", "class", "aria-expanded"])
93
97
  ]),
94
- (s(), h(N(e.dropdownElement), {
95
- id: "dropdown_" + a(u),
98
+ (u(), C(V(e.dropdownElement), {
99
+ id: "dropdown_" + a(c),
96
100
  ref: "dropdown",
97
101
  "data-cy": e.dataCy && `${e.dataCy}_dropdown`,
98
102
  class: i(["uikit-max-h-[220px] uikit-w-full uikit-min-w-[90px] uikit-flex-col uikit-overflow-y-auto uikit-border uikit-border-solid uikit-border-w-lavender uikit-bg-white uikit-pl-0 uikit-opacity-100 uikit-shadow uikit-no-scrollbar", [
@@ -103,15 +107,17 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
103
107
  { "uikit-absolute": e.isAbsolute }
104
108
  ]]),
105
109
  "aria-hidden": !t.value,
106
- onClick: l[0] || (l[0] = w(() => {
110
+ onClick: l[0] || (l[0] = v(() => {
107
111
  }, ["stop"]))
108
112
  }, {
109
- default: b(() => [
110
- v(e.$slots, "default", {
113
+ default: h(() => [
114
+ b(e.$slots, "default", {
111
115
  isOpen: t.value,
112
- toggleDropdown: d,
113
- activeIdx: a(B),
114
- selectedIdx: a(k)
116
+ toggleDropdown: r,
117
+ activeIdx: a(f),
118
+ selectedIdx: a(d),
119
+ setActiveIdx: S,
120
+ setSelectedIdx: D
115
121
  })
116
122
  ]),
117
123
  _: 3
@@ -120,5 +126,5 @@ const q = ["innerHTML"], G = /* @__PURE__ */ D({
120
126
  }
121
127
  });
122
128
  export {
123
- G as _
129
+ Q as _
124
130
  };
@@ -0,0 +1,163 @@
1
+ import { defineComponent as j, mergeModels as P, useModel as D, computed as s, openBlock as n, createElementBlock as r, createElementVNode as p, normalizeClass as h, createVNode as y, unref as v, toDisplayString as c, createCommentVNode as o, Fragment as m, renderList as x } from "vue";
2
+ import "./types-B0dZ7OiV.D29wNgoj.js";
3
+ import { a as C } from "./ArrowIcon.CCFMdsq6.js";
4
+ import "./PharmacyIcon.56ql_DYl.js";
5
+ function d(l, t = !1) {
6
+ return l == null ? "" : S(t ? Math.round(l) : Math.floor(l), 0);
7
+ }
8
+ function S(l, t) {
9
+ return !l && l !== 0 ? "" : l.toLocaleString(
10
+ "it-IT",
11
+ // usare una stringa tipo 'en-US' per sovrascrivere la lingua del browser
12
+ {
13
+ minimumFractionDigits: t,
14
+ maximumFractionDigits: t
15
+ }
16
+ );
17
+ }
18
+ const $ = {
19
+ "aria-label": "Page navigation",
20
+ class: "uikit-overflow-auto"
21
+ }, B = {
22
+ key: 0,
23
+ class: "uikit-text-14 uikit-m-0 uikit-flex uikit-list-none uikit-content-center uikit-gap-4 uikit-p-0 uikit-pl-0 uikit-font-semibold sm:uikit-gap-5"
24
+ }, F = ["data-cy"], O = {
25
+ key: 0,
26
+ class: "uikit-mx-10px uikit-select-none"
27
+ }, V = {
28
+ key: 1,
29
+ class: "font-weight-bold uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white"
30
+ }, A = ["onClick"], E = ["onClick"], z = {
31
+ key: 0,
32
+ class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white"
33
+ }, T = ["data-cy"], q = {
34
+ key: 0,
35
+ class: "uikit-mx-10px uikit-select-none"
36
+ }, Q = /* @__PURE__ */ j({
37
+ __name: "BasePagination",
38
+ props: /* @__PURE__ */ P({
39
+ count: { default: 0 },
40
+ limit: { default: 25 },
41
+ siblings: { default: 3 },
42
+ additionalCount: { default: 0 },
43
+ arrowColor: { default: "#2B5DFF" },
44
+ small: { type: Boolean, default: !1 },
45
+ prevLabel: { default: "" },
46
+ nextLabel: { default: "" },
47
+ prevDataCy: {},
48
+ nextDataCy: {}
49
+ }, {
50
+ pageNumber: { default: 1 },
51
+ pageNumberModifiers: {}
52
+ }),
53
+ emits: ["update:pageNumber"],
54
+ setup(l) {
55
+ const t = D(l, "pageNumber"), a = s(() => Math.ceil((l.count + l.additionalCount) / l.limit)), g = s(() => (t.value || 0) > l.siblings + 2), f = s(
56
+ () => (t.value || 0) < a.value - l.siblings - 1
57
+ ), b = s(() => {
58
+ let e = t.value || 0, u = 0;
59
+ for (; e > 2 && u < l.siblings; )
60
+ e--, u++;
61
+ return u;
62
+ }), w = s(() => {
63
+ let e = t.value || 0, u = 0;
64
+ for (; e < a.value - 1 && u < l.siblings; )
65
+ e++, u++;
66
+ return u;
67
+ }), N = s(() => {
68
+ const i = b.value + /* Filling with the remaining right siblings */
69
+ Math.abs(w.value - l.siblings) + /* If there is no suspension points on the right, let's fill it */
70
+ new Number(!f.value).valueOf() + /* If the pageNumber is the same of the last, let's fill it */
71
+ new Number(t.value === a.value).valueOf();
72
+ let e = Math.max((t.value || 0) - i, 2);
73
+ const u = [];
74
+ for (e; e < (t.value || 0); e++) u.push(e);
75
+ return u;
76
+ }), M = s(() => {
77
+ const i = w.value + /* Filling with the remaining left siblings */
78
+ Math.abs(b.value - l.siblings) + /* If there is no suspension points on the left, let's fill it */
79
+ new Number(!g.value).valueOf() + /* If the pageNumber is the same of the firstPage, let's fill it */
80
+ new Number(t.value === 1).valueOf();
81
+ let e = Math.min(t.value || 0, a.value - 1);
82
+ const u = [];
83
+ for (e; e < Math.min((t.value || 0) + i, a.value - 1); e++)
84
+ u.push(e + 1);
85
+ return u;
86
+ }), k = (i) => {
87
+ let e = i;
88
+ i < 1 ? e = 1 : i > a.value && (e = a.value), t.value = e;
89
+ };
90
+ return (i, e) => (n(), r("nav", $, [
91
+ i.count > 0 ? (n(), r("ul", B, [
92
+ p("li", {
93
+ class: h(["arrow-button prev-page uikit-h-30x uikit-flex uikit-min-w-[30px] uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
94
+ "uikit-cursor-pointer hover:uikit-bg-w-primary [&_>_svg]:hover:uikit-brightness-0 [&_>_svg]:hover:uikit-invert": t.value !== 1,
95
+ "hover:uikit-text-white": i.small && t.value !== 1,
96
+ "uikit-rounded-xs": i.small && i.prevLabel
97
+ }]),
98
+ "data-cy": i.prevDataCy,
99
+ onClick: e[0] || (e[0] = (u) => k((t.value || 0) - 1))
100
+ }, [
101
+ y(v(C), {
102
+ width: 20,
103
+ height: 11,
104
+ "stroke-color": t.value === 1 ? "#8996A9" : i.arrowColor,
105
+ class: "uikit-inline-block uikit-rotate-90"
106
+ }, null, 8, ["stroke-color"]),
107
+ i.small && i.prevLabel ? (n(), r("span", O, c(i.prevLabel), 1)) : o("", !0)
108
+ ], 10, F),
109
+ i.small ? o("", !0) : (n(), r(m, { key: 0 }, [
110
+ (t.value || 0) > 1 ? (n(), r("li", {
111
+ key: 0,
112
+ class: "page uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
113
+ onClick: e[1] || (e[1] = (u) => k(0))
114
+ }, " 1 ")) : o("", !0),
115
+ g.value ? (n(), r("li", V, " ... ")) : o("", !0),
116
+ (n(!0), r(m, null, x(N.value, (u) => (n(), r("li", {
117
+ key: u,
118
+ class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
119
+ onClick: (L) => k(u)
120
+ }, c(v(d)(u)), 9, A))), 128))
121
+ ], 64)),
122
+ p("li", {
123
+ class: h(["selected uikit-pointer-events-none uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
124
+ "uikit-bg-w-primary uikit-text-white hover:uikit-bg-w-primary hover:uikit-text-white": !i.small
125
+ }])
126
+ }, c(t.value || 0), 3),
127
+ i.small ? o("", !0) : (n(), r(m, { key: 1 }, [
128
+ (n(!0), r(m, null, x(M.value, (u) => (n(), r("li", {
129
+ key: u,
130
+ class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
131
+ onClick: (L) => k(u)
132
+ }, c(v(d)(u)), 9, E))), 128)),
133
+ f.value ? (n(), r("li", z, " ... ")) : o("", !0),
134
+ (t.value || 0) < a.value ? (n(), r("li", {
135
+ key: 1,
136
+ class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
137
+ onClick: e[2] || (e[2] = (u) => k(a.value))
138
+ }, c(v(d)(a.value)), 1)) : o("", !0)
139
+ ], 64)),
140
+ p("li", {
141
+ class: h(["arrow-button next-page uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
142
+ "uikit-cursor-pointer hover:uikit-bg-w-primary [&_>_svg]:hover:uikit-brightness-0 [&_>_svg]:hover:uikit-invert": (t.value || 0) < a.value,
143
+ "hover:uikit-text-white": i.small && (t.value || 0) < a.value,
144
+ "uikit-rounded-xs": i.small && i.nextLabel
145
+ }]),
146
+ "data-cy": i.nextDataCy,
147
+ onClick: e[3] || (e[3] = (u) => k((t.value || 0) + 1))
148
+ }, [
149
+ i.small && i.nextLabel ? (n(), r("span", q, c(i.nextLabel), 1)) : o("", !0),
150
+ y(v(C), {
151
+ "stroke-color": (t.value || 0) === a.value ? "#8996A9" : i.arrowColor,
152
+ width: 20,
153
+ height: 11,
154
+ class: "uikit-inline-block -uikit-rotate-90"
155
+ }, null, 8, ["stroke-color"])
156
+ ], 10, T)
157
+ ])) : o("", !0)
158
+ ]));
159
+ }
160
+ });
161
+ export {
162
+ Q as _
163
+ };
package/dist/index.js CHANGED
@@ -11,16 +11,16 @@ import { _ as g } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang
11
11
  import { _ as h } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DdmSUyxZ.js";
12
12
  import { _ as I } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.ClV6kObA.js";
13
13
  import { _ as w } from "./chunks/BaseAlert.vue_vue_type_style_index_0_lang.BtqP_iYL.js";
14
- import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.DI5YPfeQ.js";
14
+ import { _ as k } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.CThPNixl.js";
15
15
  import { _ as v } from "./chunks/BaseBadge.vue_vue_type_style_index_0_lang.BOA1gBKu.js";
16
16
  import { _ as G } from "./chunks/BaseButton.vue_vue_type_script_setup_true_lang.BWZPE2Gf.js";
17
17
  import { default as O } from "./BaseCard.js";
18
18
  import { default as R } from "./BaseComplexToggle.js";
19
- import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.BscSQ5bW.js";
19
+ import { _ as V } from "./chunks/BaseDropDown.vue_vue_type_script_setup_true_lang.CDb77c8J.js";
20
20
  import { default as q } from "./BaseFloatingLabel.js";
21
21
  import { default as z } from "./BaseIcon.js";
22
22
  import { default as H } from "./BaseInput.js";
23
- import { _ as K } from "./chunks/BasePagination.vue_vue_type_script_setup_true_lang.C_KW3jtP.js";
23
+ import { _ as K } from "./chunks/BasePagination.vue_vue_type_script_setup_true_lang.Cb6fEMc-.js";
24
24
  import { default as Q } from "./BasePaper.js";
25
25
  import { default as X } from "./BaseSlider.js";
26
26
  import { default as Z } from "./BaseTextarea.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,163 +0,0 @@
1
- import { defineComponent as P, mergeModels as S, useModel as $, computed as k, openBlock as r, createElementBlock as n, createElementVNode as h, normalizeClass as g, createVNode as y, unref as p, toDisplayString as v, createCommentVNode as a, Fragment as m, renderList as C } from "vue";
2
- import "./types-B0dZ7OiV.D29wNgoj.js";
3
- import { a as N } from "./ArrowIcon.CCFMdsq6.js";
4
- import "./PharmacyIcon.56ql_DYl.js";
5
- function d(s, l = !1) {
6
- return s == null ? "" : B(l ? Math.round(s) : Math.floor(s), 0);
7
- }
8
- function B(s, l) {
9
- return !s && s !== 0 ? "" : s.toLocaleString(
10
- "it-IT",
11
- // usare una stringa tipo 'en-US' per sovrascrivere la lingua del browser
12
- {
13
- minimumFractionDigits: l,
14
- maximumFractionDigits: l
15
- }
16
- );
17
- }
18
- const F = {
19
- "aria-label": "Page navigation",
20
- class: "uikit-overflow-auto"
21
- }, _ = {
22
- key: 0,
23
- class: "uikit-text-14 uikit-m-0 uikit-flex uikit-list-none uikit-content-center uikit-gap-4 uikit-p-0 uikit-pl-0 uikit-font-semibold sm:uikit-gap-5"
24
- }, D = {
25
- key: 0,
26
- class: "uikit-mx-10px uikit-select-none"
27
- }, O = {
28
- key: 1,
29
- class: "font-weight-bold uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white"
30
- }, V = ["onClick"], A = ["onClick"], E = {
31
- key: 0,
32
- class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white"
33
- }, z = {
34
- key: 0,
35
- class: "uikit-mx-10px uikit-select-none"
36
- }, J = /* @__PURE__ */ P({
37
- __name: "BasePagination",
38
- props: /* @__PURE__ */ S({
39
- count: { default: 0 },
40
- limit: { default: 25 },
41
- siblings: { default: 3 },
42
- additionalCount: { default: 0 },
43
- arrowColor: { default: "#2B5DFF" },
44
- small: { type: Boolean, default: !1 },
45
- prevLabel: { default: "" },
46
- nextLabel: { default: "" }
47
- }, {
48
- pageNumber: { default: 1 },
49
- pageNumberModifiers: {}
50
- }),
51
- emits: ["update:pageNumber"],
52
- setup(s) {
53
- const l = s, u = $(s, "pageNumber"), o = k(
54
- () => Math.ceil((l.count + l.additionalCount) / l.limit)
55
- ), f = k(
56
- () => (u.value || 0) > l.siblings + 2
57
- ), b = k(
58
- () => (u.value || 0) < o.value - l.siblings - 1
59
- ), w = k(() => {
60
- let i = u.value || 0, t = 0;
61
- for (; i > 2 && t < l.siblings; )
62
- i--, t++;
63
- return t;
64
- }), x = k(() => {
65
- let i = u.value || 0, t = 0;
66
- for (; i < o.value - 1 && t < l.siblings; )
67
- i++, t++;
68
- return t;
69
- }), M = k(() => {
70
- const e = w.value + /* Filling with the remaining right siblings */
71
- Math.abs(x.value - l.siblings) + /* If there is no suspension points on the right, let's fill it */
72
- new Number(!b.value).valueOf() + /* If the pageNumber is the same of the last, let's fill it */
73
- new Number(u.value === o.value).valueOf();
74
- let i = Math.max((u.value || 0) - e, 2);
75
- const t = [];
76
- for (i; i < (u.value || 0); i++) t.push(i);
77
- return t;
78
- }), L = k(() => {
79
- const e = x.value + /* Filling with the remaining left siblings */
80
- Math.abs(w.value - l.siblings) + /* If there is no suspension points on the left, let's fill it */
81
- new Number(!f.value).valueOf() + /* If the pageNumber is the same of the firstPage, let's fill it */
82
- new Number(u.value === 1).valueOf();
83
- let i = Math.min(u.value || 0, o.value - 1);
84
- const t = [];
85
- for (i; i < Math.min((u.value || 0) + e, o.value - 1); i++)
86
- t.push(i + 1);
87
- return t;
88
- }), c = (e) => {
89
- let i = e;
90
- e < 1 ? i = 1 : e > o.value && (i = o.value), u.value = i;
91
- };
92
- return (e, i) => (r(), n("nav", F, [
93
- l.count > 0 ? (r(), n("ul", _, [
94
- h("li", {
95
- class: g(["arrow-button prev-page uikit-h-30x uikit-flex uikit-min-w-[30px] uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
96
- "uikit-cursor-pointer hover:uikit-bg-w-primary [&_>_svg]:hover:uikit-brightness-0 [&_>_svg]:hover:uikit-invert": u.value !== 1,
97
- "hover:uikit-text-white": e.small && u.value !== 1,
98
- "uikit-rounded-xs": e.small && e.prevLabel
99
- }]),
100
- onClick: i[0] || (i[0] = (t) => c((u.value || 0) - 1))
101
- }, [
102
- y(p(N), {
103
- width: 20,
104
- height: 11,
105
- "stroke-color": u.value === 1 ? "#8996A9" : e.arrowColor,
106
- class: "uikit-inline-block uikit-rotate-90"
107
- }, null, 8, ["stroke-color"]),
108
- e.small && e.prevLabel ? (r(), n("span", D, v(e.prevLabel), 1)) : a("", !0)
109
- ], 2),
110
- e.small ? a("", !0) : (r(), n(m, { key: 0 }, [
111
- (u.value || 0) > 1 ? (r(), n("li", {
112
- key: 0,
113
- class: "page uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
114
- onClick: i[1] || (i[1] = (t) => c(0))
115
- }, " 1 ")) : a("", !0),
116
- f.value ? (r(), n("li", O, " ... ")) : a("", !0),
117
- (r(!0), n(m, null, C(M.value, (t) => (r(), n("li", {
118
- key: t,
119
- class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
120
- onClick: (j) => c(t)
121
- }, v(p(d)(t)), 9, V))), 128))
122
- ], 64)),
123
- h("li", {
124
- class: g(["selected uikit-pointer-events-none uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
125
- "uikit-bg-w-primary uikit-text-white hover:uikit-bg-w-primary hover:uikit-text-white": !e.small
126
- }])
127
- }, v(u.value || 0), 3),
128
- e.small ? a("", !0) : (r(), n(m, { key: 1 }, [
129
- (r(!0), n(m, null, C(L.value, (t) => (r(), n("li", {
130
- key: t,
131
- class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
132
- onClick: (j) => c(t)
133
- }, v(p(d)(t)), 9, A))), 128)),
134
- b.value ? (r(), n("li", E, " ... ")) : a("", !0),
135
- (u.value || 0) < o.value ? (r(), n("li", {
136
- key: 1,
137
- class: "uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-cursor-pointer uikit-select-none uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px hover:uikit-bg-w-primary hover:uikit-text-white",
138
- onClick: i[2] || (i[2] = (t) => c(o.value))
139
- }, v(p(d)(o.value)), 1)) : a("", !0)
140
- ], 64)),
141
- h("li", {
142
- class: g(["arrow-button next-page uikit-flex uikit-h-30px uikit-min-w-[30px] uikit-items-center uikit-justify-center uikit-rounded-circle uikit-p-5px", {
143
- "uikit-cursor-pointer hover:uikit-bg-w-primary [&_>_svg]:hover:uikit-brightness-0 [&_>_svg]:hover:uikit-invert": (u.value || 0) < o.value,
144
- "hover:uikit-text-white": e.small && (u.value || 0) < o.value,
145
- "uikit-rounded-xs": e.small && e.nextLabel
146
- }]),
147
- onClick: i[3] || (i[3] = (t) => c((u.value || 0) + 1))
148
- }, [
149
- e.small && e.nextLabel ? (r(), n("span", z, v(e.nextLabel), 1)) : a("", !0),
150
- y(p(N), {
151
- "stroke-color": (u.value || 0) === o.value ? "#8996A9" : e.arrowColor,
152
- width: 20,
153
- height: 11,
154
- class: "uikit-inline-block -uikit-rotate-90"
155
- }, null, 8, ["stroke-color"])
156
- ], 2)
157
- ])) : a("", !0)
158
- ]));
159
- }
160
- });
161
- export {
162
- J as _
163
- };