@caipira/tamandua 0.0.65 → 0.0.67

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 (53) hide show
  1. package/dist/Avatar.js +2 -2
  2. package/dist/{Avatar.vue_vue_type_script_setup_true_lang-BbcM5CB3.js → Avatar.vue_vue_type_script_setup_true_lang-D7NdR9hu.js} +1 -1
  3. package/dist/Button.js +2 -2
  4. package/dist/Button.vue_vue_type_script_setup_true_lang-DW0Q2Ut2.js +164 -0
  5. package/dist/Dropdown.js +2 -2
  6. package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DeY4vid5.js → Dropdown.vue_vue_type_script_setup_true_lang-CUPNdEz7.js} +1 -1
  7. package/dist/GraphyPrice.js +2 -2
  8. package/dist/{GraphyPrice.vue_vue_type_script_setup_true_lang-DI2x-MAS.js → GraphyPrice.vue_vue_type_script_setup_true_lang-BDYxfzF6.js} +1 -1
  9. package/dist/Icon.js +2 -2
  10. package/dist/{Icon.vue_vue_type_script_setup_true_lang-CDJweTzy.js → Icon.vue_vue_type_script_setup_true_lang-C2QvF2xM.js} +1 -1
  11. package/dist/InputSelect.js +2 -2
  12. package/dist/InputSelect.vue_vue_type_script_setup_true_lang-CGlaDHiJ.js +229 -0
  13. package/dist/Link.js +2 -2
  14. package/dist/{Link.vue_vue_type_script_setup_true_lang-DIzaFPvW.js → Link.vue_vue_type_script_setup_true_lang-BE-Gh_jJ.js} +1 -1
  15. package/dist/Pagination.js +2 -2
  16. package/dist/Pagination.vue_vue_type_script_setup_true_lang-BCQUrEVO.js +110 -0
  17. package/dist/Popconfirm.js +2 -2
  18. package/dist/{Popconfirm.vue_vue_type_script_setup_true_lang-CgWeJEGu.js → Popconfirm.vue_vue_type_script_setup_true_lang-C37pLEUq.js} +1 -1
  19. package/dist/Popover.js +2 -2
  20. package/dist/{Popover.vue_vue_type_script_setup_true_lang-MaJDdAe0.js → Popover.vue_vue_type_script_setup_true_lang-DoSN5ymu.js} +6 -6
  21. package/dist/Tag.js +2 -2
  22. package/dist/{Tag.vue_vue_type_script_setup_true_lang-CkDz2_qz.js → Tag.vue_vue_type_script_setup_true_lang-CKzb-As0.js} +1 -1
  23. package/dist/Toast.js +2 -2
  24. package/dist/{Toast.vue_vue_type_script_setup_true_lang-Lw1lJoH3.js → Toast.vue_vue_type_script_setup_true_lang-DcVS4Iyg.js} +1 -1
  25. package/dist/components.js +17 -17
  26. package/dist/enums.js +1 -1
  27. package/dist/{plugin-BU44OLnf.js → plugin-2Cr_XUjp.js} +1 -1
  28. package/dist/{plugin-6ziw5jJj.js → plugin-BShPzL82.js} +1 -1
  29. package/dist/{plugin-BOewyU0C.js → plugin-BdTrCTL4.js} +1 -1
  30. package/dist/{plugin-Bw-AW29_.js → plugin-CEByTREY.js} +1 -1
  31. package/dist/{plugin-aR9suX-A.js → plugin-CGE6W117.js} +1 -1
  32. package/dist/plugin-CV_fI920.js +10 -0
  33. package/dist/{plugin-hcORPz_I.js → plugin-ColpxTKB.js} +1 -1
  34. package/dist/{plugin-B5vbbM7n.js → plugin-DJlVAL-g.js} +1 -1
  35. package/dist/{plugin-DqD4mnko.js → plugin-DNwjBl_u.js} +1 -1
  36. package/dist/{plugin-CZiSoM73.js → plugin-DxUJiAk-.js} +1 -1
  37. package/dist/{plugin-DPcsc5tO.js → plugin-jyvJNavM.js} +1 -1
  38. package/dist/{plugin-DrKx8l8j.js → plugin-x-Y35fqX.js} +1 -1
  39. package/dist/{plugins-cn0dSxZb.js → plugins-3Yf4y3PS.js} +21 -21
  40. package/dist/plugins.js +21 -21
  41. package/dist/tamandua.js +1 -1
  42. package/dist/types/components/Button/Button.vue.d.ts +23 -17
  43. package/dist/types/components/Button/types.d.ts +15 -13
  44. package/dist/types/components/InputSelect/InputSelect.vue.d.ts +6 -6
  45. package/dist/types/components/Pagination/Pagination.vue.d.ts +9 -0
  46. package/dist/types/components/Pagination/types.d.ts +1 -0
  47. package/dist/{ui-BSiRZzeZ.js → ui-J-lhC9qd.js} +2 -2
  48. package/package.json +1 -1
  49. package/dist/Button-BThdMs5-.js +0 -162
  50. package/dist/Button.css +0 -1
  51. package/dist/InputSelect.vue_vue_type_script_setup_true_lang-W2S_TcOu.js +0 -227
  52. package/dist/Pagination.vue_vue_type_script_setup_true_lang-BNeFZWgA.js +0 -108
  53. package/dist/plugin-BoP2-VzO.js +0 -10
@@ -1,162 +0,0 @@
1
- import './Button.css';
2
- import { defineComponent as _, useSlots as z, ref as v, computed as c, resolveComponent as A, openBlock as s, createBlock as y, resolveDynamicComponent as U, normalizeClass as D, unref as a, withCtx as L, renderSlot as k, mergeProps as F, createCommentVNode as m, createElementBlock as h, Fragment as P, createTextVNode as M, toDisplayString as G } from "vue";
3
- import { d as i, a as t, b as d, B as r } from "./ui-BSiRZzeZ.js";
4
- import { g as b } from "./index-CVD_wAsU.js";
5
- import "./Icon.vue_vue_type_script_setup_true_lang-CDJweTzy.js";
6
- import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const W = ["multiple"], V = /* @__PURE__ */ _({
8
- name: "TButton",
9
- __name: "Button",
10
- props: {
11
- icon: {},
12
- type: { default: i.BUTTON },
13
- size: { default: t.Default },
14
- label: { default: "" },
15
- shape: { default: d.Rounded },
16
- hover: { type: Boolean, default: !0 },
17
- variant: { default: r.DEFAULT },
18
- outline: { type: Boolean, default: !1 },
19
- multiple: { type: Boolean, default: !1 },
20
- disabled: { type: Boolean, default: !1 },
21
- iconProps: { default: () => ({}) },
22
- animate: {}
23
- },
24
- emits: ["upload"],
25
- setup(g, { expose: S, emit: x }) {
26
- const e = g, E = x, T = z(), f = v(), u = v(null), B = c(() => {
27
- switch (e.type) {
28
- case i.SUBMIT:
29
- return "submit";
30
- case i.BUTTON:
31
- case i.FILE:
32
- default:
33
- return "button";
34
- }
35
- }), R = c(() => e.type === i.SUBMIT ? e.label : void 0), w = c(() => {
36
- switch (e.type) {
37
- case i.SUBMIT:
38
- return "input";
39
- case i.BUTTON:
40
- case i.FILE:
41
- default:
42
- return "button";
43
- }
44
- }), C = (l) => {
45
- if (e.type === i.SUBMIT && l.preventDefault(), e.type === i.FILE && f.value?.click(), e.animate) {
46
- let o = null;
47
- e.animate.target === "icon" && (o = u.value?.reference), o && b.to(o, {
48
- duration: 0.2,
49
- ...e.animate.animation,
50
- ease: "power3.easeInOut",
51
- onComplete: () => {
52
- b.set(o, e.animate?.reset);
53
- }
54
- });
55
- }
56
- }, I = (l) => {
57
- l.stopPropagation();
58
- const p = l.target.files;
59
- !p || !p.length || E("upload", p);
60
- }, N = c(() => {
61
- switch (e.size) {
62
- case t.ExtraSmall:
63
- return 12;
64
- case t.Small:
65
- return 16;
66
- case t.Default:
67
- return 20;
68
- case t.Large:
69
- return 24;
70
- case t.ExtraLarge:
71
- return 28;
72
- default:
73
- return 20;
74
- }
75
- }), n = c(() => !!e.label || !!T.default);
76
- return S({ iconReference: u }), (l, o) => {
77
- const p = A("t-icon");
78
- return s(), y(U(w.value), {
79
- type: B.value,
80
- value: R.value,
81
- disabled: e.disabled,
82
- class: D([{
83
- // Size
84
- "text-xs px-1 h-4": e.size === a(t).ExtraSmall,
85
- "text-sm px-2 h-7": e.size === a(t).Small,
86
- "text-base px-3 h-9": e.size === a(t).Default,
87
- "text-lg px-3.5 h-12": e.size === a(t).Large,
88
- "text-xl px-4 h-14": e.size === a(t).ExtraLarge,
89
- // Border
90
- border: e.outline,
91
- // Shape
92
- "rounded-full": e.shape === a(d).Circle,
93
- "input-roundness": e.shape === a(d).Rounded,
94
- // Enabled/Disabled
95
- "cursor-not-allowed opacity-50": e.disabled,
96
- "cursor-pointer": !e.disabled,
97
- // Default color
98
- "border-caipira-primary-inverted fill-caipira-primary-inverted": e.variant === a(r).DEFAULT,
99
- "bg-transparent color-caipira-primary-inverted hover:bg-caipira-primary-inverted hover:color-caipira-primary hover:fill-white": e.variant === a(r).DEFAULT && e.outline,
100
- "bg-caipira-primary-inverted color-caipira-primary": e.variant === a(r).DEFAULT && !e.outline,
101
- // Primary color
102
- "fill-caipira-primary": e.variant === a(r).PRIMARY,
103
- "bg-transparent border-caipira-blue color-caipira-blue hover:bg-caipira-blue hover:color-caipira-primary hover:fill-white": e.variant === a(r).PRIMARY && e.outline,
104
- "bg-caipira-blue color-caipira-primary": e.variant === a(r).PRIMARY && !e.outline,
105
- // Success color
106
- "fill-caipira-green": e.variant === a(r).SUCCESS,
107
- "bg-transparent border-caipira-green color-caipira-green hover:bg-caipira-green hover:color-caipira-primary hover:fill-white": e.variant === a(r).SUCCESS && e.outline,
108
- "bg-caipira-green color-caipira-primary": e.variant === a(r).SUCCESS && !e.outline,
109
- // Warning color
110
- "fill-caipira-yellow": e.variant === a(r).WARNING,
111
- "bg-transparent border-caipira-yellow color-caipira-yellow hover:bg-caipira-yellow hover:color-caipira-primary hover:fill-white": e.variant === a(r).WARNING && e.outline,
112
- "bg-caipira-yellow color-caipira-primary": e.variant === a(r).WARNING && !e.outline,
113
- // Danger color
114
- "fill-caipira-red": e.variant === a(r).DANGER,
115
- "bg-transparent border-caipira-red color-caipira-red hover:bg-caipira-red hover:color-caipira-primary hover:fill-white": e.variant === a(r).DANGER && e.outline,
116
- "bg-caipira-red color-caipira-primary": e.variant === a(r).DANGER && !e.outline,
117
- // Link
118
- "color-caipira-primary-inverted underline font-bold": e.variant === a(r).LINK,
119
- // Transparent
120
- "transparent-button": e.variant === a(r).TRANSPARENT,
121
- "transparent-hover": e.variant === a(r).TRANSPARENT && e.hover
122
- }, "input-outline flex items-center select-none whitespace-nowrap"]),
123
- role: "button",
124
- onClick: C
125
- }, {
126
- default: L(() => [
127
- k(l.$slots, "default", {}, void 0, !0),
128
- e.icon ? (s(), y(p, F({
129
- key: 0,
130
- ref_key: "iconReference",
131
- ref: u,
132
- size: N.value,
133
- icon: e.icon,
134
- class: {
135
- "mr-1": n.value && e.size === a(t).ExtraSmall,
136
- "mr-1.5": n.value && e.size === a(t).Small,
137
- "mr-2": n.value && e.size === a(t).Default,
138
- "mr-2.5": n.value && e.size === a(t).Large,
139
- "mr-3": n.value && e.size === a(t).ExtraLarge
140
- }
141
- }, e.iconProps), null, 16, ["size", "icon", "class"])) : m("", !0),
142
- e.label && e.type !== a(i).SUBMIT ? (s(), h(P, { key: 1 }, [
143
- M(G(e.label), 1)
144
- ], 64)) : m("", !0),
145
- e.type === "file" ? (s(), h("input", {
146
- key: 2,
147
- multiple: e.multiple,
148
- type: "file",
149
- ref_key: "fileInput",
150
- ref: f,
151
- class: "hidden",
152
- onChange: I
153
- }, null, 40, W)) : m("", !0)
154
- ]),
155
- _: 3
156
- }, 8, ["type", "value", "disabled", "class"]);
157
- };
158
- }
159
- }), H = /* @__PURE__ */ O(V, [["__scopeId", "data-v-ad1f5bfc"]]);
160
- export {
161
- H as B
162
- };
package/dist/Button.css DELETED
@@ -1 +0,0 @@
1
- .transparent-hover[data-v-ad1f5bfc]:hover{background-color:rgb(from var(--caipira-primary) r g b / 45%)}
@@ -1,227 +0,0 @@
1
- import { defineComponent as ue, mergeModels as O, useModel as ne, ref as d, computed as I, onBeforeMount as oe, watch as D, resolveComponent as k, openBlock as o, createBlock as z, normalizeClass as x, withCtx as R, createElementVNode as se, createVNode as K, createElementBlock as p, renderSlot as g, normalizeProps as _, mergeProps as M, Fragment as V, renderList as N, guardReactiveProps as U, toDisplayString as q, createCommentVNode as T, withDirectives as ie, vModelText as re, createSlots as ce, createTextVNode as pe, nextTick as de } from "vue";
2
- import { a as fe, E as ve } from "./ui-BSiRZzeZ.js";
3
- const me = { key: 1 }, ye = ["placeholder", "disabled", "readonly"], he = {
4
- key: 0,
5
- class: "inline-flex w-full justify-between items-center"
6
- }, be = {
7
- key: 1,
8
- class: "inline-flex items-center"
9
- }, ge = /* @__PURE__ */ ue({
10
- name: "TInputSelect",
11
- __name: "InputSelect",
12
- props: /* @__PURE__ */ O({
13
- size: { default: fe.Default },
14
- options: { default: () => [] },
15
- mapper: { type: Function, default: (f) => ({
16
- value: f.id ?? f.uuid,
17
- label: f
18
- }) },
19
- filter: { type: Function, default: (f, B) => B.label.toLowerCase().indexOf(f.toLowerCase()) >= 0 },
20
- tooltip: { default: "" },
21
- disabled: { type: Boolean },
22
- resource: {},
23
- multiple: { type: Boolean, default: !1 },
24
- placeholder: { default: "" },
25
- initialValue: {},
26
- isSearchable: { type: Boolean, default: !1 },
27
- dropdownPlacement: { default: ve.BOTTOM_START },
28
- widthClass: { default: "w-full" },
29
- borderClass: { default: "border input-border" },
30
- roundnessClass: { default: "input-roundness" }
31
- }, {
32
- modelValue: {},
33
- modelModifiers: {}
34
- }),
35
- emits: /* @__PURE__ */ O(["update:model-value"], ["update:modelValue"]),
36
- setup(f, { emit: B }) {
37
- const l = f;
38
- let $ = !1, C, j = "";
39
- const G = B, s = ne(f, "modelValue"), u = d([]), c = d(""), P = d(null), F = d(), i = d(!1), L = d(null), a = d([]), A = d(!1), v = d(null), h = I(() => a.value.length > 0), m = I(() => l.isSearchable && i.value), b = I(() => typeof l.resource == "function"), H = (e) => !l.multiple || !s.value || !Array.isArray(s.value) ? !1 : s.value.includes(e.value), J = (e = s.value) => !(e === void 0 || e === "" || Array.isArray(e) && e.length === 0), Q = (e) => {
40
- G("update:model-value", e);
41
- }, y = (e = s.value) => {
42
- if (J(e))
43
- if (l.multiple)
44
- Array.isArray(e) && (a.value = e.map(
45
- (t) => E(t)
46
- ).filter((t) => t > -1));
47
- else {
48
- const t = E(e);
49
- ~t && (a.value = [t]);
50
- }
51
- }, W = (e) => {
52
- i.value = !i.value, i.value && m.value && de(() => {
53
- P.value?.focus();
54
- });
55
- }, E = (e) => u.value.findIndex(
56
- (t) => t.value === e
57
- ), S = async (e = !1) => {
58
- if (!l.resource)
59
- return;
60
- A.value = !0;
61
- const t = {
62
- t: c.value,
63
- r: "option"
64
- };
65
- e && v.value && v.value.pages > v.value.page ? t.page = v.value.page + 1 : e = !1, !c.value && s.value && (t.i = s.value);
66
- const r = await l.resource(t);
67
- e ? u.value.push(...r.items.map(l.mapper)) : u.value = r.items.map(l.mapper), v.value = r.pagination, !b.value && c.value && y(c.value), A.value = !1;
68
- }, X = () => {
69
- !c.value || j === c.value || (C && (clearTimeout(C), C = null), C = setTimeout(() => {
70
- j = c.value, b.value ? (i.value || (i.value = !0), S()) : l.isSearchable && (u.value = l.options.filter(
71
- (e) => l.filter(c.value, e)
72
- ));
73
- }, 500));
74
- }, Y = ({
75
- index: e,
76
- hold: t
77
- }) => {
78
- if ($ = !0, l.multiple) {
79
- const r = a.value.findIndex(
80
- (w) => w === e
81
- );
82
- ~r ? a.value.splice(r, 1) : a.value.push(e);
83
- } else
84
- a.value = [e];
85
- (!l.multiple || !t) && (i.value = !1);
86
- }, Z = () => {
87
- b.value && v.value && v.value.pages > v.value.page && S(!0);
88
- }, ee = async (e) => {
89
- switch (e.key) {
90
- case "ArrowDown":
91
- L.value?.move(e);
92
- break;
93
- case "Escape":
94
- i.value = !1;
95
- break;
96
- }
97
- };
98
- return oe(async () => {
99
- b.value ? (await S(), y()) : l.options.length > 0 && (u.value = l.options), !s.value && l.initialValue ? y(l.initialValue) : y(s.value);
100
- }), D(
101
- () => s.value,
102
- async (e) => {
103
- e && (E(e) < 0 && b.value && await S(), y(e));
104
- }
105
- ), D(
106
- a,
107
- (e) => {
108
- const t = l.multiple ? u.value.filter(
109
- (r, w) => a.value.includes(w)
110
- ).map((r) => r.value) : u.value[a.value[0]].value;
111
- $ && ($ = !1, Q(t));
112
- },
113
- { deep: !0 }
114
- ), D(
115
- () => l.options,
116
- (e) => {
117
- e.length > 0 && (u.value = e, s.value && a.value.length === 0 && y(s.value));
118
- }
119
- ), (e, t) => {
120
- const r = k("t-tag"), w = k("t-button"), le = k("t-icon"), te = k("t-dropdown"), ae = k("t-popover");
121
- return o(), z(ae, {
122
- open: i.value,
123
- "onUpdate:open": t[1] || (t[1] = (n) => i.value = n),
124
- placement: l.dropdownPlacement,
125
- class: x([l.widthClass]),
126
- ref_key: "popoverRef",
127
- ref: F
128
- }, {
129
- default: R(() => [
130
- se("div", {
131
- class: x([{
132
- "h-9": !l.multiple,
133
- "h-full *:min-h-9": l.multiple,
134
- [l.borderClass]: !0,
135
- [l.roundnessClass]: !0
136
- }, "flex justify-between items-center w-full max-w-96 input-text-color select-none input-bg-color"])
137
- }, [
138
- K(w, {
139
- variant: "transparent",
140
- size: "",
141
- class: x(["h-full", {
142
- "w-full justify-end pr-2": !m.value && !h.value,
143
- "w-full justify-between pr-2": !m.value && h.value,
144
- "w-10 justify-center": m.value
145
- }]),
146
- "aria-describedby": F.value?.name,
147
- icon: i.value === !0 ? "chevron-up" : "chevron-down",
148
- onClick: W
149
- }, {
150
- default: R(() => [
151
- m.value ? T("", !0) : (o(), p("div", {
152
- key: 0,
153
- class: x(["inline-flex items-center ml-2 max-w-[calc(100%-2.5rem)]", {
154
- "overflow-hidden whitespace-nowrap": !l.multiple,
155
- "flex-wrap gap-2 py-1": l.multiple
156
- }])
157
- }, [
158
- e.$slots.selection && h.value ? g(e.$slots, "selection", _(M({ key: 0 }, u.value[a.value[0]]))) : e.$slots.default && h.value ? (o(), p(V, { key: 1 }, [
159
- l.multiple ? (o(!0), p(V, { key: 0 }, N(a.value, (n) => g(e.$slots, "default", _(U(u.value[n])))), 256)) : g(e.$slots, "default", _(M({ key: 1 }, u.value[a.value[0]])))
160
- ], 64)) : h.value ? (o(), p(V, { key: 2 }, [
161
- l.multiple ? (o(!0), p(V, { key: 0 }, N(a.value, (n) => (o(), z(r, {
162
- key: n,
163
- text: u.value[n].label,
164
- color: "#6e6e6e"
165
- }, null, 8, ["text"]))), 128)) : (o(), p("span", me, q(u.value[a.value[0]]?.label), 1))
166
- ], 64)) : T("", !0)
167
- ], 2))
168
- ]),
169
- _: 3
170
- }, 8, ["aria-describedby", "class", "icon"]),
171
- m.value ? ie((o(), p("input", {
172
- key: 0,
173
- "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value = n),
174
- type: "text",
175
- ref_key: "inputRef",
176
- ref: P,
177
- placeholder: l.placeholder,
178
- disabled: l.disabled,
179
- readonly: !l.isSearchable,
180
- class: "h-9 bg-transparent input-padding input-roundness input-outline w-full",
181
- onInput: X,
182
- onKeydown: ee
183
- }, null, 40, ye)), [
184
- [re, c.value]
185
- ]) : T("", !0)
186
- ], 2)
187
- ]),
188
- content: R(() => [
189
- K(te, {
190
- ref_key: "dropdownRef",
191
- ref: L,
192
- items: u.value,
193
- "is-visible": i.value,
194
- multiple: l.multiple,
195
- loading: A.value,
196
- onChange: Y,
197
- onEndReached: Z
198
- }, ce({ _: 2 }, [
199
- e.$slots.default || l.multiple ? {
200
- name: "default",
201
- fn: R((n) => [
202
- l.multiple ? (o(), p("div", he, [
203
- e.$slots.default ? g(e.$slots, "default", _(M({ key: 0 }, n))) : (o(), p(V, { key: 1 }, [
204
- pe(q(n.label), 1)
205
- ], 64)),
206
- H(n) ? (o(), z(le, {
207
- key: 2,
208
- icon: "check",
209
- size: "sm",
210
- class: "float-right ml-2"
211
- })) : T("", !0)
212
- ])) : (o(), p("div", be, [
213
- g(e.$slots, "default", _(U(n)))
214
- ]))
215
- ]),
216
- key: "0"
217
- } : void 0
218
- ]), 1032, ["items", "is-visible", "multiple", "loading"])
219
- ]),
220
- _: 3
221
- }, 8, ["open", "placement", "class"]);
222
- };
223
- }
224
- });
225
- export {
226
- ge as _
227
- };
@@ -1,108 +0,0 @@
1
- import { defineComponent as C, mergeModels as V, useModel as x, ref as z, computed as o, resolveComponent as h, openBlock as i, createElementBlock as d, toDisplayString as B, createCommentVNode as b, createElementVNode as L, createVNode as y, normalizeClass as p, Fragment as M, renderList as S, createBlock as P } from "vue";
2
- const D = { class: "flex gap-2 items-center flex-wrap select-none" }, N = {
3
- key: 0,
4
- class: "md:block hidden"
5
- }, E = { class: "h-9 flex" }, T = /* @__PURE__ */ C({
6
- name: "TPagination",
7
- __name: "Pagination",
8
- props: /* @__PURE__ */ V({
9
- disabled: { type: Boolean, default: !1 },
10
- hasPageSize: { type: Boolean, default: !0 },
11
- pageLengths: { default: () => [12, 18, 24, 30, 36, 42] },
12
- showDescription: { type: Boolean, default: !1 }
13
- }, {
14
- modelValue: {
15
- default: {
16
- page: 1,
17
- pages: 1,
18
- perPage: 12
19
- }
20
- },
21
- modelModifiers: {}
22
- }),
23
- emits: ["update:modelValue"],
24
- setup(c) {
25
- const v = c, e = x(c, "modelValue"), m = z(e.value.perPage ?? 12), g = o(() => e.value.page === 1), f = o(
26
- () => e.value.page === e.value.pages
27
- ), k = o(() => {
28
- const a = e.value.pages || 1, t = e.value.page || 1, l = [], u = Math.max(2, t - 2), s = Math.min(a - 1, t + 2);
29
- a > 1 && l.push(1);
30
- for (let n = u; n <= s; n++)
31
- n > 1 && n < a && l.push(n);
32
- return a > 1 && l.push(a), l;
33
- }), w = o(() => v.pageLengths.map((a) => ({
34
- label: `${a} / page`,
35
- value: a
36
- }))), _ = o(() => {
37
- if ("items" in e.value && "skip" in e.value && "items" in e.value) {
38
- const a = e.value.skip + 1, t = e.value.skip + e.value.items, l = e.value.totalItems;
39
- return `Showing ${a} to ${t} of ${l} entries`;
40
- }
41
- return `Page ${e.value.page} of ${e.value.pages}`;
42
- }), r = (a) => {
43
- a === e.value.page || a < 1 || a > e.value.pages || (e.value = {
44
- ...e.value,
45
- page: a
46
- });
47
- }, $ = (a) => {
48
- a !== e.value.perPage && (e.value = {
49
- ...e.value,
50
- perPage: a,
51
- page: 1
52
- });
53
- };
54
- return (a, t) => {
55
- const l = h("t-button"), u = h("t-input-select");
56
- return i(), d("div", D, [
57
- a.showDescription ? (i(), d("div", N, B(_.value), 1)) : b("", !0),
58
- L("div", E, [
59
- y(l, {
60
- size: "sm",
61
- variant: "primary",
62
- "disable-style": !0,
63
- class: p(["h-9 px-2 input-roundness rounded-r-none", { "opacity-50 cursor-not-allowed": g.value }]),
64
- icon: "chevron-left",
65
- disabled: g.value,
66
- onClick: t[0] || (t[0] = (s) => r(e.value.page - 1))
67
- }, null, 8, ["class", "disabled"]),
68
- (i(!0), d(M, null, S(k.value, (s) => (i(), P(l, {
69
- "disable-style": !0,
70
- label: `${s}`,
71
- disabled: s === e.value.page,
72
- class: p([{
73
- "opacity-50 cursor-not-allowed": s === e.value.page
74
- }, "h-9 px-2 rounded-none"]),
75
- size: "sm",
76
- variant: "primary",
77
- onClick: (n) => r(s)
78
- }, null, 8, ["label", "disabled", "class", "onClick"]))), 256)),
79
- y(l, {
80
- size: "sm",
81
- variant: "primary",
82
- "disable-style": !0,
83
- class: p(["h-9 px-2 input-roundness rounded-l-none", { "opacity-50 cursor-not-allowed": f.value }]),
84
- icon: "chevron-right",
85
- disabled: f.value,
86
- onClick: t[1] || (t[1] = (s) => r(e.value.page + 1))
87
- }, null, 8, ["class", "disabled"])
88
- ]),
89
- v.hasPageSize ? (i(), P(u, {
90
- key: 1,
91
- modelValue: m.value,
92
- "onUpdate:modelValue": [
93
- t[2] || (t[2] = (s) => m.value = s),
94
- $
95
- ],
96
- "width-class": "",
97
- class: "w-fit min-w-32",
98
- "dropdown-placement": "top",
99
- disabled: a.disabled,
100
- options: w.value
101
- }, null, 8, ["modelValue", "disabled", "options"])) : b("", !0)
102
- ]);
103
- };
104
- }
105
- });
106
- export {
107
- T as _
108
- };
@@ -1,10 +0,0 @@
1
- import { r as t } from "./register-component-B-fdqewb.js";
2
- import { B as r } from "./Button-BThdMs5-.js";
3
- const s = {
4
- install(o) {
5
- t(o, r);
6
- }
7
- };
8
- export {
9
- s as p
10
- };