@caipira/tamandua 0.0.13 → 0.0.15

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 (121) hide show
  1. package/README.md +3 -1
  2. package/dist/Avatar.js +2 -2
  3. package/dist/{Avatar.vue_vue_type_script_setup_true_lang-DshMIzMM.js → Avatar.vue_vue_type_script_setup_true_lang-BZy_UetF.js} +1 -1
  4. package/dist/{Button-BVshp51o.js → Button-zA2axPFA.js} +3 -3
  5. package/dist/Button.css +1 -1
  6. package/dist/Button.js +2 -2
  7. package/dist/Button.vue_vue_type_style_index_0_scoped_39c3f26a_lang-tn6M5dNB.js +156 -0
  8. package/dist/ButtonCopy.js +2 -2
  9. package/dist/{ButtonCopy.vue_vue_type_script_setup_true_lang-CZsqPE-4.js → ButtonCopy.vue_vue_type_script_setup_true_lang-hBqHMiGU.js} +1 -1
  10. package/dist/ChartTreemap.js +2 -2
  11. package/dist/{ChartTreemap.vue_vue_type_script_setup_true_lang-BSKB-UTM.js → ChartTreemap.vue_vue_type_script_setup_true_lang-CG5aK3KH.js} +1 -1
  12. package/dist/Dropdown.js +2 -2
  13. package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DRsd_7yO.js +153 -0
  14. package/dist/Form.js +2 -2
  15. package/dist/{Form.vue_vue_type_script_setup_true_lang-DIh6jDi0.js → Form.vue_vue_type_script_setup_true_lang-GWUrHIHW.js} +10 -10
  16. package/dist/GraphyPrice.js +2 -2
  17. package/dist/{GraphyPrice.vue_vue_type_script_setup_true_lang-BxKdnVzF.js → GraphyPrice.vue_vue_type_script_setup_true_lang-GY5TUNz8.js} +1 -1
  18. package/dist/Icon.js +2 -2
  19. package/dist/{Icon.vue_vue_type_script_setup_true_lang-DiRGfOxc.js → Icon.vue_vue_type_script_setup_true_lang-CqJ-D4BM.js} +26 -23
  20. package/dist/IconButton.js +2 -2
  21. package/dist/IconButton.vue_vue_type_script_setup_true_lang-CfILJjtd.js +91 -0
  22. package/dist/InputPassword.js +2 -2
  23. package/dist/{InputPassword.vue_vue_type_script_setup_true_lang-kknXv5I-.js → InputPassword.vue_vue_type_script_setup_true_lang-DvHndXqE.js} +1 -1
  24. package/dist/InputSelect.js +2 -2
  25. package/dist/InputSelect.vue_vue_type_script_setup_true_lang-B93CKCR3.js +227 -0
  26. package/dist/Link.js +6 -0
  27. package/dist/Link.vue_vue_type_script_setup_true_lang-BJVsokc1.js +50 -0
  28. package/dist/ModalForm.js +2 -2
  29. package/dist/{ModalForm.vue_vue_type_script_setup_true_lang-CUk3DI3O.js → ModalForm.vue_vue_type_script_setup_true_lang-CZBGpJCs.js} +2 -2
  30. package/dist/Popconfirm.js +2 -2
  31. package/dist/Popconfirm.vue_vue_type_script_setup_true_lang-CGs37-Nn.js +63 -0
  32. package/dist/Popover.js +2 -2
  33. package/dist/{Popover.vue_vue_type_script_setup_true_lang-Dhcy-iL3.js → Popover.vue_vue_type_script_setup_true_lang-B1brEdFx.js} +319 -321
  34. package/dist/{ProgressLine-CfZKbUcx.js → ProgressLine-1ZHGvPsm.js} +16 -16
  35. package/dist/ProgressLine.css +1 -1
  36. package/dist/ProgressLine.js +2 -2
  37. package/dist/Tag.js +2 -2
  38. package/dist/Tag.vue_vue_type_script_setup_true_lang-BohgPbhp.js +70 -0
  39. package/dist/Toast.js +2 -2
  40. package/dist/{Toast.vue_vue_type_script_setup_true_lang-BAsJNxU_.js → Toast.vue_vue_type_script_setup_true_lang-a5tU5-sA.js} +1 -1
  41. package/dist/alert-octagon-BIUtdQBd.js +5 -0
  42. package/dist/close-circle-Bvyw4JKW.js +5 -0
  43. package/dist/components.js +41 -39
  44. package/dist/enums.js +7 -6
  45. package/dist/{plugin-DLUdf4JV.js → plugin-BAUSOmg1.js} +1 -1
  46. package/dist/{plugin-Cp-YlP7M.js → plugin-BJT9iz31.js} +1 -1
  47. package/dist/{plugin-DYnmuOWz.js → plugin-BRY5cGCc.js} +1 -1
  48. package/dist/{plugin-Bj5VaUuH.js → plugin-BibUAa04.js} +1 -1
  49. package/dist/{plugin-7M6YmkX3.js → plugin-BkWUeqrs.js} +1 -1
  50. package/dist/plugin-C8V0p_Rv.js +10 -0
  51. package/dist/{plugin-CIK2QwfI.js → plugin-CCH1Q2cN.js} +1 -1
  52. package/dist/{plugin-BLdCHEGS.js → plugin-CQQde2zY.js} +1 -1
  53. package/dist/{plugin-D9vhvf_z.js → plugin-CX1WsfRO.js} +1 -1
  54. package/dist/{plugin-DAoreRkB.js → plugin-CqcekUXz.js} +1 -1
  55. package/dist/{plugin-A7Ru6-Ae.js → plugin-D3RtcfcX.js} +1 -1
  56. package/dist/{plugin-Ce0OhiOa.js → plugin-D9DcbHK3.js} +1 -1
  57. package/dist/{plugin-DGx9kLvd.js → plugin-DXEt6BIK.js} +1 -1
  58. package/dist/{plugin-CNoSZVuJ.js → plugin-DmfiHplR.js} +1 -1
  59. package/dist/{plugin-BURDNZOq.js → plugin-Duvcbc38.js} +1 -1
  60. package/dist/{plugin-AFgt8nH4.js → plugin-DyiLV5Qf.js} +1 -1
  61. package/dist/{plugin-c1rFpmlH.js → plugin-JgFOdNjC.js} +1 -1
  62. package/dist/{plugin-DmkLbCIU.js → plugin-zLwlm_b-.js} +1 -1
  63. package/dist/plugins-DZGnWkJf.js +112 -0
  64. package/dist/plugins.js +100 -97
  65. package/dist/tamandua.js +1 -1
  66. package/dist/types/components/Avatar/Avatar.story.d.ts +18 -5
  67. package/dist/types/components/Button/Button.story.d.ts +15 -44
  68. package/dist/types/components/Button/Button.vue.d.ts +5 -5
  69. package/dist/types/components/Button/types.d.ts +2 -2
  70. package/dist/types/components/ChartLine/ChartLine.story.d.ts +18 -12
  71. package/dist/types/components/ChartTreemap/ChartTreemap.story.d.ts +16 -2
  72. package/dist/types/components/ChartTreemap/types.d.ts +8 -2
  73. package/dist/types/components/Dropdown/types.d.ts +1 -1
  74. package/dist/types/components/Form/Form.vue.d.ts +4 -4
  75. package/dist/types/components/Form/types.d.ts +2 -2
  76. package/dist/types/components/GraphyPrice/GraphyPrice.story.d.ts +24 -2
  77. package/dist/types/components/Icon/Icon.story.d.ts +26 -0
  78. package/dist/types/components/Icon/types.d.ts +1 -1
  79. package/dist/types/components/IconButton/IconButton.vue.d.ts +5 -45
  80. package/dist/types/components/IconButton/types.d.ts +1 -7
  81. package/dist/types/components/InputDate/InputDate.story.d.ts +9 -2
  82. package/dist/types/components/InputMultiplier/input-multiplier.story.d.ts +8 -3
  83. package/dist/types/components/InputRadio/InputRadioGroup.story.d.ts +6 -2
  84. package/dist/types/components/InputSelect/InputSelect.story.d.ts +37 -4
  85. package/dist/types/components/InputSelect/InputSelect.vue.d.ts +1 -1
  86. package/dist/types/components/InputSelect/types.d.ts +0 -1
  87. package/dist/types/components/InputSwitch/InputSwitch.story.d.ts +10 -18
  88. package/dist/types/components/Link/Link.story.d.ts +20 -0
  89. package/dist/types/components/Link/Link.vue.d.ts +46 -0
  90. package/dist/types/components/Link/index.d.ts +5 -0
  91. package/dist/types/components/Link/plugin.d.ts +4 -0
  92. package/dist/types/components/Link/types.d.ts +11 -0
  93. package/dist/types/components/Pagination/Pagination.story.d.ts +6 -1
  94. package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +1 -3
  95. package/dist/types/components/Popconfirm/types.d.ts +1 -1
  96. package/dist/types/components/Popover/Popover.vue.d.ts +0 -3
  97. package/dist/types/components/Popover/types.d.ts +0 -1
  98. package/dist/types/components/ProgressCircle/ProgressCircle.story.d.ts +13 -3
  99. package/dist/types/components/ProgressLine/ProgressLine.story.d.ts +12 -3
  100. package/dist/types/components/Table/Table.story.d.ts +16 -3
  101. package/dist/types/components/Tag/Tag.story.d.ts +29 -0
  102. package/dist/types/components/index.d.ts +3 -2
  103. package/dist/types/components/plugins.d.ts +2 -1
  104. package/dist/types/enums/index.d.ts +2 -2
  105. package/dist/types/enums/ui.d.ts +13 -4
  106. package/dist/types/i18n.d.ts +6 -0
  107. package/dist/types/types/form.d.ts +1 -1
  108. package/dist/types/types/ui.d.ts +2 -2
  109. package/dist/ui-D3dPdT4S.js +13 -0
  110. package/package.json +1 -2
  111. package/volar.d.ts +1 -0
  112. package/dist/Button.vue_vue_type_style_index_0_scoped_8639b950_lang-C9uKZk0F.js +0 -143
  113. package/dist/Dropdown.vue_vue_type_script_setup_true_lang-BUcFKrav.js +0 -135
  114. package/dist/IconButton.vue_vue_type_script_setup_true_lang-DEL6iIAu.js +0 -106
  115. package/dist/InputSelect.vue_vue_type_script_setup_true_lang-ByRPZrIg.js +0 -216
  116. package/dist/Popconfirm.vue_vue_type_script_setup_true_lang-DWMW-u7V.js +0 -65
  117. package/dist/Tag.vue_vue_type_script_setup_true_lang-vLIykMPS.js +0 -63
  118. package/dist/alert-octagon-D8wznooU.js +0 -4
  119. package/dist/close-circle-Bsf9_pUR.js +0 -4
  120. package/dist/plugins-DNNQp3qM.js +0 -109
  121. package/dist/ui-DtSy-y9T.js +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",
@@ -82,7 +82,6 @@
82
82
  "vue-i18n": "9"
83
83
  },
84
84
  "devDependencies": {
85
- "@chromatic-com/storybook": "^1.3.3",
86
85
  "@faker-js/faker": "^8.4.1",
87
86
  "@storybook/addon-actions": "^8.0.8",
88
87
  "@storybook/addon-essentials": "^8.0.8",
package/volar.d.ts CHANGED
@@ -31,6 +31,7 @@ declare module "vue" {
31
31
  TInputSwitch: (typeof import("@caipira/tamandua/dist/types/components/InputSwitch"))["InputSwitch"];
32
32
  TInputText: (typeof import("@caipira/tamandua/dist/types/components/InputText"))["InputText"];
33
33
  TInputTextarea: (typeof import("@caipira/tamandua/dist/types/components/InputTextarea"))["InputTextarea"];
34
+ TLink: (typeof import("@caipira/tamandua/dist/types/components/Link"))["Link"];
34
35
  TModal: (typeof import("@caipira/tamandua/dist/types/components/Modal"))["Modal"];
35
36
  TModalForm: (typeof import("@caipira/tamandua/dist/types/components/ModalForm"))["ModalForm"];
36
37
  TPagination: (typeof import("@caipira/tamandua/dist/types/components/Pagination"))["Pagination"];
@@ -1,143 +0,0 @@
1
- import './Button.css';
2
- import { defineComponent as O, getCurrentInstance as U, ref as y, computed as o, resolveComponent as _, openBlock as s, createBlock as m, resolveDynamicComponent as B, normalizeClass as c, unref as i, withCtx as k, renderSlot as z, createCommentVNode as u, createElementBlock as b, toDisplayString as x } from "vue";
3
- import { u as M } from "./useDomHelpers-5CFMo6bx.js";
4
- import { B as a, b as l, c as d, a as r } from "./ui-DtSy-y9T.js";
5
- import "./Icon.vue_vue_type_script_setup_true_lang-DiRGfOxc.js";
6
- const F = ["multiple"], Y = /* @__PURE__ */ O({
7
- name: "TButton",
8
- __name: "Button",
9
- props: {
10
- to: {},
11
- icon: {},
12
- href: { default: "" },
13
- type: { default: a.BUTTON },
14
- size: { default: l.DEFAULT },
15
- label: { default: "" },
16
- shape: { default: d.ROUNDED },
17
- target: { default: void 0 },
18
- variant: { default: r.DEFAULT },
19
- multiple: { type: Boolean, default: !1 },
20
- isOutline: { type: Boolean, default: !1 },
21
- isDisabled: { type: Boolean, default: !1 },
22
- injectStyle: { default: () => ({ icon: "" }) },
23
- disableStyle: { type: Boolean, default: !1 }
24
- },
25
- emits: ["upload"],
26
- setup(h, { expose: g, emit: S }) {
27
- const e = h, A = S, p = U(), f = y(), v = y(null), { isPopoverActivator: E, onPopoverActivatorClick: R } = M(), D = o(() => e.href ? e.href : void 0), L = o(() => {
28
- switch (e.type) {
29
- case a.LINK:
30
- return;
31
- case a.FILE:
32
- return "button";
33
- default:
34
- return e.type;
35
- }
36
- }), T = o(() => e.type === a.SUBMIT ? e.label : void 0), C = o(() => {
37
- switch (e.type) {
38
- case a.SUBMIT:
39
- return "input";
40
- case a.LINK:
41
- return "a";
42
- case a.ROUTER_LINK:
43
- return "router-link";
44
- default:
45
- return "button";
46
- }
47
- }), I = (t) => {
48
- p && E(p) && R(t, p), e.type === a.SUBMIT && t.preventDefault(), e.type === a.FILE && f.value?.click();
49
- }, N = (t) => {
50
- t.stopPropagation();
51
- const n = t.target.files;
52
- !n || !n.length || A("upload", n);
53
- };
54
- return g({ iconReference: v }), (t, w) => {
55
- const n = _("t-icon");
56
- return s(), m(B(C.value), {
57
- type: L.value,
58
- href: D.value,
59
- value: T.value,
60
- to: e.to,
61
- disabled: e.isDisabled,
62
- target: e.target,
63
- class: c([{
64
- "font-bold": !e.disableStyle,
65
- "opacity-50": e.isDisabled,
66
- // Padding
67
- "px-1 py-0": !e.disableStyle && e.size === i(l).EXTRA_SMALL,
68
- "px-4 h-9": !e.disableStyle && e.size === i(l).SMALL,
69
- "px-4 py-2 h-10": !e.disableStyle && e.size === i(l).DEFAULT,
70
- // Border
71
- border: e.isOutline,
72
- // Shape
73
- "rounded-full": e.shape === i(d).CIRCLE,
74
- "input-roundness": e.shape === i(d).ROUNDED,
75
- // Cursor
76
- "cursor-pointer": !e.isDisabled,
77
- "cursor-not-allowed": e.isDisabled,
78
- // Default color
79
- "border-caipira-primary-inverted fill-caipira-primary-inverted": e.variant === i(r).DEFAULT,
80
- "bg-transparent color-caipira-primary-inverted hover:bg-caipira-primary-inverted hover:color-caipira-primary hover:fill-white": e.variant === i(r).DEFAULT && e.isOutline,
81
- "bg-caipira-primary-inverted color-caipira-primary": e.variant === i(r).DEFAULT && !e.isOutline,
82
- // Primary color
83
- "fill-caipira-primary": e.variant === i(r).PRIMARY,
84
- "bg-transparent border-caipira-blue color-caipira-blue hover:bg-caipira-blue hover:color-caipira-primary hover:fill-white": e.variant === i(r).PRIMARY && e.isOutline,
85
- "bg-caipira-blue color-caipira-primary": e.variant === i(r).PRIMARY && !e.isOutline,
86
- // Success color
87
- "fill-caipira-green": e.variant === i(r).SUCCESS,
88
- "bg-transparent border-caipira-green color-caipira-green hover:bg-caipira-green hover:color-caipira-primary hover:fill-white": e.variant === i(r).SUCCESS && e.isOutline,
89
- "bg-caipira-green color-caipira-primary": e.variant === i(r).SUCCESS && !e.isOutline,
90
- // Warning color
91
- "fill-caipira-yellow": e.variant === i(r).WARNING,
92
- "bg-transparent border-caipira-yellow color-caipira-yellow hover:bg-caipira-yellow hover:color-caipira-primary hover:fill-white": e.variant === i(r).WARNING && e.isOutline,
93
- "bg-caipira-yellow color-caipira-primary": e.variant === i(r).WARNING && !e.isOutline,
94
- // Danger color
95
- "fill-caipira-red": e.variant === i(r).DANGER,
96
- "bg-transparent border-caipira-red color-caipira-red hover:bg-caipira-red hover:color-caipira-primary hover:fill-white": e.variant === i(r).DANGER && e.isOutline,
97
- "bg-caipira-red color-caipira-primary": e.variant === i(r).DANGER && !e.isOutline,
98
- // Transparent color
99
- "transparent-button": e.variant === i(r).TRANSPARENT
100
- }, "input-outline inline-flex items-center"]),
101
- role: "button",
102
- onClick: I
103
- }, {
104
- default: k(() => [
105
- z(t.$slots, "default", {}, void 0, !0),
106
- e.icon ? (s(), m(n, {
107
- key: 0,
108
- ref_key: "iconReference",
109
- ref: v,
110
- size: e.size,
111
- icon: e.icon,
112
- "is-outline": e.isOutline,
113
- class: c({
114
- [e.injectStyle.icon]: !0
115
- })
116
- }, null, 8, ["size", "icon", "is-outline", "class"])) : u("", !0),
117
- e.label && e.type !== i(a).SUBMIT ? (s(), b("span", {
118
- key: 1,
119
- class: c([{
120
- "ml-2": !!e.icon,
121
- "text-lg": e.size === i(l).LARGE,
122
- "text-sm": e.size === i(l).SMALL,
123
- "text-xs": e.size === i(l).EXTRA_SMALL
124
- }, "whitespace-nowrap"])
125
- }, x(e.label), 3)) : u("", !0),
126
- e.type === "file" ? (s(), b("input", {
127
- key: 2,
128
- multiple: e.multiple,
129
- onChange: N,
130
- type: "file",
131
- ref_key: "fileInput",
132
- ref: f,
133
- class: "hidden"
134
- }, null, 40, F)) : u("", !0)
135
- ]),
136
- _: 3
137
- }, 8, ["type", "href", "value", "to", "disabled", "target", "class"]);
138
- };
139
- }
140
- });
141
- export {
142
- Y as _
143
- };
@@ -1,135 +0,0 @@
1
- import { defineComponent as T, ref as h, resolveComponent as z, openBlock as r, createElementBlock as a, normalizeClass as w, Fragment as R, renderList as A, toDisplayString as P, withKeys as L, renderSlot as N, normalizeProps as V, mergeProps as E, createBlock as G, createCommentVNode as $, createTextVNode as I } from "vue";
2
- const O = ["aria-selected", "onKeydown", "onClick"], F = {
3
- key: 1,
4
- class: "inline-flex items-center input-label"
5
- }, j = /* @__PURE__ */ T({
6
- name: "TDropdown",
7
- __name: "Dropdown",
8
- props: {
9
- items: { default: () => [] },
10
- owner: {},
11
- multiple: { type: Boolean, default: !1 },
12
- isVisible: { type: Boolean, default: !1 },
13
- optionMarginClass: { default: "" },
14
- optionPaddingClass: { default: "py-2 px-2" },
15
- wrapperPaddingClass: { default: "" },
16
- optionRoundnessClass: { default: "" },
17
- wrapperRoundnessClass: { default: "rounded-md" }
18
- },
19
- emits: ["change", "end-reached", "created"],
20
- setup(H, { expose: D, emit: S }) {
21
- const s = H, C = S, i = h(-1), b = h(null), u = h([]), d = h("keyboard"), y = (o = i.value, t = s.items[o], n = void 0) => {
22
- n?.stopPropagation(), C("change", {
23
- index: o,
24
- option: t,
25
- hold: n?.ctrlKey ?? !1
26
- }), t.action && t.action();
27
- }, B = (o) => {
28
- if (!s.isVisible)
29
- return !1;
30
- switch (o.preventDefault(), d.value = "keyboard", o.key) {
31
- case "ArrowUp":
32
- case "ArrowDown":
33
- return x(o);
34
- case "Enter":
35
- return y();
36
- }
37
- }, x = (o) => {
38
- const t = o.key === "ArrowDown", n = s.items.length;
39
- let e = i.value;
40
- const l = () => s.items[e] ? "isGroupLabel" in s.items[e] && s.items[e].isGroupLabel : !1, f = () => {
41
- e === n - 1 ? e = 0 : e++;
42
- }, M = () => {
43
- e === 0 ? e = n - 1 : e--;
44
- };
45
- if (t)
46
- do
47
- f();
48
- while (l());
49
- else
50
- do
51
- M();
52
- while (l());
53
- e > -1 && e < n && (i.value = e);
54
- const v = b.value, k = u.value[i.value], p = k.offsetTop, m = k.offsetHeight, _ = v.offsetHeight, c = v.scrollTop;
55
- let g = 0;
56
- if (k.focus(), p === 0 || c === 0)
57
- g = p - _ + m;
58
- else if (t && p + m > _ + c)
59
- g = c + m;
60
- else if (!t && p < c)
61
- g = c - m;
62
- else
63
- return !0;
64
- return v.scroll({ top: g }), !0;
65
- }, K = (o) => {
66
- const t = o.target, n = u.value[0];
67
- !t || !n || t.scrollTop + t.clientHeight + n.offsetHeight >= t.scrollHeight && C("end-reached");
68
- };
69
- return D({ move: x }), (o, t) => {
70
- const n = z("t-icon");
71
- return r(), a("ul", {
72
- ref_key: "listRef",
73
- ref: b,
74
- role: "listbox",
75
- class: w(["text-left max-h-60 min-w-[12rem] z-10 overflow-y-auto scrollbar select-none floatable", [s.wrapperRoundnessClass, s.wrapperPaddingClass]]),
76
- onScrollend: K,
77
- onMousemove: t[0] || (t[0] = () => d.value = "mouse"),
78
- onKeydown: B
79
- }, [
80
- o.items.length === 0 ? (r(), a("li", {
81
- key: 0,
82
- role: "option",
83
- "aria-disabled": "true",
84
- class: w(["whitespace-nowrap text-gray-400", [
85
- s.optionPaddingClass,
86
- s.optionMarginClass,
87
- s.optionRoundnessClass
88
- ]])
89
- }, " Nothing here ", 2)) : (r(!0), a(R, { key: 1 }, A(o.items, (e, l) => (r(), a(R, { key: l }, [
90
- e.isGroupLabel ? (r(), a("li", {
91
- key: 0,
92
- class: w(["text-xs font-bold tracking-wider text-neutral-600", [
93
- s.optionPaddingClass,
94
- s.optionMarginClass,
95
- s.optionRoundnessClass
96
- ]]),
97
- ref_for: !0,
98
- ref_key: "itemRefs",
99
- ref: u
100
- }, P(e.label), 3)) : (r(), a("li", {
101
- key: 1,
102
- class: w([{
103
- "bg-hover": l === i.value && d.value === "keyboard",
104
- "hover:bg-hover": d.value === "mouse",
105
- [s.optionMarginClass]: !0,
106
- [s.optionPaddingClass]: !0,
107
- [s.optionRoundnessClass]: !0
108
- }, "flex text-base cursor-pointer whitespace-nowrap items-center focus-visible:outline-none"]),
109
- role: "option",
110
- ref_for: !0,
111
- ref_key: "itemRefs",
112
- ref: u,
113
- tabindex: 0,
114
- "aria-selected": l === i.value,
115
- onKeydown: L((f) => y(l, e), ["enter"]),
116
- onClick: (f) => y(l, e, f)
117
- }, [
118
- o.$slots.default ? N(o.$slots, "default", V(E({ key: 0 }, e))) : (r(), a("div", F, [
119
- e.icon ? (r(), G(n, {
120
- key: 0,
121
- icon: e.icon,
122
- class: "mr-2",
123
- size: "xs"
124
- }, null, 8, ["icon"])) : $("", !0),
125
- I(" " + P(e.label), 1)
126
- ]))
127
- ], 42, O))
128
- ], 64))), 128))
129
- ], 34);
130
- };
131
- }
132
- });
133
- export {
134
- j as _
135
- };
@@ -1,106 +0,0 @@
1
- import { defineComponent as T, getCurrentInstance as k, ref as p, computed as a, resolveComponent as g, openBlock as f, createBlock as U, resolveDynamicComponent as z, normalizeClass as d, unref as o, withCtx as A, renderSlot as N, createVNode as R, createElementBlock as x, createCommentVNode as F } from "vue";
2
- import { u as w } from "./useDomHelpers-5CFMo6bx.js";
3
- import { B as t, b as s, c as r, a as M } from "./ui-DtSy-y9T.js";
4
- import "./Icon.vue_vue_type_script_setup_true_lang-DiRGfOxc.js";
5
- const O = ["multiple"], H = /* @__PURE__ */ T({
6
- name: "TIconButton",
7
- __name: "IconButton",
8
- props: {
9
- to: {},
10
- icon: {},
11
- href: { default: "" },
12
- type: { default: t.BUTTON },
13
- size: { default: s.DEFAULT },
14
- label: { default: "" },
15
- shape: { default: r.ROUNDED },
16
- target: { default: void 0 },
17
- variant: { default: M.DEFAULT },
18
- multiple: { type: Boolean, default: !1 },
19
- isOutline: { type: Boolean, default: !1 },
20
- isDisabled: { type: Boolean, default: !1 },
21
- injectStyle: { default: () => ({ icon: "" }) },
22
- disableStyle: { type: Boolean, default: !1 }
23
- },
24
- emits: ["upload"],
25
- setup(m, { expose: y, emit: h }) {
26
- const e = m, v = h, i = k(), u = p(), c = p(null), { isPopoverActivator: b, onPopoverActivatorClick: _ } = w(), B = a(() => e.href ? e.href : void 0), D = a(() => {
27
- switch (e.type) {
28
- case t.LINK:
29
- return;
30
- case t.FILE:
31
- return "button";
32
- default:
33
- return e.type;
34
- }
35
- }), E = a(() => e.type === t.SUBMIT ? e.label : void 0), I = a(() => {
36
- switch (e.type) {
37
- case t.SUBMIT:
38
- return "input";
39
- case t.LINK:
40
- return "a";
41
- case t.ROUTER_LINK:
42
- return "router-link";
43
- default:
44
- return "button";
45
- }
46
- }), S = (n) => {
47
- i && b(i) && _(n, i), e.type === t.SUBMIT && n.preventDefault(), e.type === t.FILE && u.value?.click();
48
- }, C = (n) => {
49
- n.stopPropagation();
50
- const l = n.target.files;
51
- !l || !l.length || v("upload", l);
52
- };
53
- return y({ iconReference: c }), (n, L) => {
54
- const l = g("t-icon");
55
- return f(), U(z(I.value), {
56
- type: D.value,
57
- href: B.value,
58
- value: E.value,
59
- to: e.to,
60
- disabled: e.isDisabled,
61
- target: e.target,
62
- class: d([{
63
- "opacity-50": e.isDisabled,
64
- // Padding
65
- "px-1 py-0": !e.disableStyle && e.size === o(s).EXTRA_SMALL,
66
- "px-1": !e.disableStyle && e.size === o(s).SMALL,
67
- "px-4 py-2 h-10": !e.disableStyle && e.size === o(s).DEFAULT,
68
- // Shape
69
- "rounded-full": e.shape === o(r).CIRCLE,
70
- "input-roundness": e.shape === o(r).ROUNDED,
71
- // Cursor
72
- "cursor-pointer": !e.isDisabled,
73
- "cursor-not-allowed": e.isDisabled
74
- }, "input-outline inline-flex items-center justify-center"]),
75
- role: "button",
76
- onClick: S
77
- }, {
78
- default: A(() => [
79
- N(n.$slots, "default"),
80
- R(l, {
81
- ref_key: "iconReference",
82
- ref: c,
83
- size: e.size,
84
- icon: e.icon,
85
- class: d({
86
- [e.injectStyle.icon]: !0
87
- })
88
- }, null, 8, ["size", "icon", "class"]),
89
- e.type === "file" ? (f(), x("input", {
90
- key: 0,
91
- multiple: e.multiple,
92
- onChange: C,
93
- type: "file",
94
- ref_key: "fileInput",
95
- ref: u,
96
- class: "hidden"
97
- }, null, 40, O)) : F("", !0)
98
- ]),
99
- _: 3
100
- }, 8, ["type", "href", "value", "to", "disabled", "target", "class"]);
101
- };
102
- }
103
- });
104
- export {
105
- H as _
106
- };
@@ -1,216 +0,0 @@
1
- import { defineComponent as ue, ref as p, inject as re, computed as R, onBeforeMount as ce, onBeforeUnmount as pe, watch as A, resolveComponent as b, openBlock as u, createElementBlock as d, normalizeClass as k, unref as K, createElementVNode as I, withKeys as de, renderSlot as g, normalizeProps as V, mergeProps as j, Fragment as _, renderList as M, guardReactiveProps as U, createBlock as H, toDisplayString as fe, createCommentVNode as N, withDirectives as me, vModelText as ve, createVNode as P, withCtx as q, createSlots as ye, nextTick as be } from "vue";
2
- import { u as he } from "./useDomHelpers-5CFMo6bx.js";
3
- import { b as we, E as ke } from "./ui-DtSy-y9T.js";
4
- const ge = { key: 1 }, Ve = ["placeholder", "disabled", "readonly"], _e = { class: "flex w-full justify-between items-center" }, Se = { class: "flex items-center" };
5
- let xe = 0;
6
- const Re = /* @__PURE__ */ ue({
7
- name: "TInputSelect",
8
- __name: "InputSelect",
9
- props: {
10
- size: { default: we.DEFAULT },
11
- options: { default: () => [] },
12
- mapper: { type: Function, default: (f) => ({ value: f.id ?? f.uuid, label: f }) },
13
- filter: { type: Function, default: (f, S) => S.label.toLowerCase().indexOf(f.toLowerCase()) >= 0 },
14
- tooltip: { default: "" },
15
- disabled: { type: Boolean },
16
- resource: {},
17
- multiple: { type: Boolean, default: !1 },
18
- identifier: { default: "id" },
19
- modelValue: {},
20
- placeholder: { default: "" },
21
- initialValue: {},
22
- disableStyle: { type: Boolean, default: !1 },
23
- isSearchable: { type: Boolean, default: !1 },
24
- dropdownPlacement: { default: ke.BOTTOM }
25
- },
26
- emits: ["update:model-value"],
27
- setup(f, { emit: S }) {
28
- const l = f;
29
- let x = !1, h, T = "";
30
- const G = S, J = `checkbox_${++xe}`, r = p(""), a = p([]), $ = p(null), D = re("formStyle", { label: "", input: "" }), C = p(null), n = p(!1), L = p(null), o = p([]), { wasClickOutsideOfContainer: Q } = he(), c = p(null), B = R(() => o.value.length > 0), O = R(() => l.isSearchable && n.value), v = R(() => typeof l.resource == "function"), W = (e) => !l.multiple || !l.modelValue || !Array.isArray(l.modelValue) ? !1 : l.modelValue.includes(e.option[l.identifier]), X = (e = l.modelValue) => !(e === void 0 || e === "" || Array.isArray(e) && e.length === 0), Y = (e) => {
31
- G("update:model-value", e);
32
- }, m = (e = l.modelValue) => {
33
- if (X(e))
34
- if (l.multiple)
35
- Array.isArray(e) && (o.value = e.map(
36
- (t) => E(t)
37
- ).filter((t) => t > -1));
38
- else {
39
- const t = E(e);
40
- ~t && (o.value = [t]);
41
- }
42
- }, z = (e) => {
43
- n.value = !n.value, n.value && O.value && be(() => {
44
- $.value?.focus();
45
- }), e.stopPropagation();
46
- }, E = (e) => a.value.findIndex(
47
- (t) => t.value === e
48
- ), F = (e) => {
49
- C.value && Q(e, C.value) && (n.value = !1);
50
- }, w = async (e = !1) => {
51
- if (!l.resource)
52
- return;
53
- const t = {
54
- t: r.value,
55
- r: "option"
56
- };
57
- e && c.value && c.value.pages > c.value.page ? t.page = c.value.page + 1 : e = !1, !r.value && l.modelValue && (t.i = l.modelValue);
58
- const i = await l.resource(t);
59
- e ? a.value.push(...i.items.map(l.mapper)) : a.value = i.items.map(l.mapper), c.value = i.pagination, !v.value && r.value && m(r.value);
60
- }, Z = () => {
61
- T !== r.value && (h && (clearTimeout(h), h = null), h = setTimeout(() => {
62
- T = r.value, v.value ? (n.value || (n.value = !0), w()) : l.isSearchable && (a.value = l.options.filter(
63
- (e) => l.filter(r.value, e)
64
- ));
65
- }, 500));
66
- }, ee = () => {
67
- n.value = !1;
68
- }, le = (e) => {
69
- n.value = !1, e.stopPropagation();
70
- }, te = ({
71
- index: e,
72
- hold: t
73
- }) => {
74
- if (x = !0, l.multiple) {
75
- const i = o.value.findIndex(
76
- (y) => y === e
77
- );
78
- ~i ? o.value.splice(i, 1) : o.value.push(e);
79
- } else
80
- o.value = [e];
81
- (!l.multiple || !t) && (n.value = !1);
82
- }, oe = () => {
83
- v.value && c.value && c.value.pages > c.value.page && w(!0);
84
- }, ae = async (e) => {
85
- switch (e.key) {
86
- case "ArrowDown":
87
- L.value?.move(e);
88
- break;
89
- }
90
- };
91
- return ce(async () => {
92
- v.value ? (await w(), m()) : l.options.length > 0 && (a.value = l.options), !l.modelValue && l.initialValue ? m(l.initialValue) : m(l.modelValue), document.addEventListener("click", F);
93
- }), pe(() => {
94
- document.removeEventListener("click", F);
95
- }), A(
96
- () => l.modelValue,
97
- async (e) => {
98
- e && (E(e) < 0 && v.value && await w(), m(e));
99
- }
100
- ), A(
101
- o,
102
- (e) => {
103
- const t = l.multiple ? a.value.filter(
104
- (i, y) => o.value.includes(y)
105
- ).map((i) => i.value) : a.value[o.value[0]].value;
106
- x && (x = !1, Y(t));
107
- },
108
- { deep: !0 }
109
- ), A(
110
- () => l.options,
111
- (e) => {
112
- e.length > 0 && (a.value = e, l.modelValue && o.value.length === 0 && m(l.modelValue));
113
- }
114
- ), (e, t) => {
115
- const i = b("t-tag"), y = b("t-icon-button"), ne = b("t-icon"), ie = b("t-dropdown"), se = b("t-popover");
116
- return u(), d("div", {
117
- class: k({ [K(D).input]: !l.disableStyle })
118
- }, [
119
- I("div", {
120
- ref_key: "wrapperRef",
121
- ref: C,
122
- class: k([{
123
- "h-9": !l.disableStyle && !l.multiple,
124
- "min-h-9": !l.disableStyle && l.multiple,
125
- "text-left select-none input-bg-color input-text-color border input-border input-roundness": !l.disableStyle,
126
- [K(D).input]: !l.disableStyle
127
- }, "inline-flex justify-between items-center w-full text-left"]),
128
- role: "button",
129
- onClick: z,
130
- onBlur: ee,
131
- onKeyup: de(le, ["esc"])
132
- }, [
133
- O.value ? me((u(), d("input", {
134
- key: 1,
135
- "onUpdate:modelValue": t[0] || (t[0] = (s) => r.value = s),
136
- type: "text",
137
- ref_key: "inputRef",
138
- ref: $,
139
- placeholder: l.placeholder,
140
- disabled: l.disabled,
141
- readonly: !l.isSearchable,
142
- class: k([{ "cursor-pointer": !l.isSearchable }, "w-full h-9 bg-transparent input-padding input-roundness input-outline"]),
143
- onClick: t[1] || (t[1] = (s) => s.stopPropagation()),
144
- onInput: Z,
145
- onKeydown: ae
146
- }, null, 42, Ve)), [
147
- [ve, r.value]
148
- ]) : (u(), d("div", {
149
- key: 0,
150
- class: k(["flex items-center ml-2", {
151
- "overflow-hidden whitespace-nowrap": !l.multiple,
152
- "flex-wrap": l.multiple
153
- }])
154
- }, [
155
- e.$slots.selection && B.value ? g(e.$slots, "selection", V(j({ key: 0 }, a.value[o.value[0]].label))) : e.$slots.default && B.value ? (u(), d(_, { key: 1 }, [
156
- l.multiple ? (u(!0), d(_, { key: 0 }, M(o.value, (s) => g(e.$slots, "default", V(U(a.value[s].label)))), 256)) : g(e.$slots, "default", V(j({ key: 1 }, a.value[o.value[0]].label)))
157
- ], 64)) : B.value ? (u(), d(_, { key: 2 }, [
158
- l.multiple ? (u(!0), d(_, { key: 0 }, M(o.value, (s) => (u(), H(i, {
159
- key: s,
160
- text: a.value[s].label,
161
- color: "#6e6e6e"
162
- }, null, 8, ["text"]))), 128)) : (u(), d("span", ge, fe(a.value[o.value[0]]?.label), 1))
163
- ], 64)) : N("", !0)
164
- ], 2)),
165
- P(y, {
166
- "disable-style": !0,
167
- class: "h-9",
168
- icon: n.value === !0 ? "chevron-up" : "chevron-down",
169
- onClick: z
170
- }, null, 8, ["icon"])
171
- ], 34),
172
- P(se, {
173
- placement: l.dropdownPlacement,
174
- "is-visible": n.value
175
- }, {
176
- content: q(() => [
177
- P(ie, {
178
- ref_key: "dropdownRef",
179
- ref: L,
180
- owner: J,
181
- items: a.value,
182
- "is-visible": n.value,
183
- multiple: l.multiple,
184
- class: "fixed",
185
- "aria-describedby": "tooltip",
186
- onChange: te,
187
- onEndReached: oe
188
- }, ye({ _: 2 }, [
189
- e.$slots.default ? {
190
- name: "default",
191
- fn: q((s) => [
192
- I("div", _e, [
193
- I("div", Se, [
194
- g(e.$slots, "default", V(U(s.label)))
195
- ]),
196
- W(s) ? (u(), H(ne, {
197
- key: 0,
198
- icon: "check",
199
- size: "sm",
200
- class: "float-right ml-2"
201
- })) : N("", !0)
202
- ])
203
- ]),
204
- key: "0"
205
- } : void 0
206
- ]), 1032, ["items", "is-visible", "multiple"])
207
- ]),
208
- _: 3
209
- }, 8, ["placement", "is-visible"])
210
- ], 2);
211
- };
212
- }
213
- });
214
- export {
215
- Re as _
216
- };