iryx-ui 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +355 -5
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/components/Alert.vue.d.ts +19 -4
  4. package/dist/components/Badge.vue.d.ts +4 -3
  5. package/dist/components/Banner.vue.d.ts +81 -0
  6. package/dist/components/Combobox.vue.d.ts +3 -3
  7. package/dist/components/DatePicker.vue.d.ts +52 -0
  8. package/dist/components/DateRangePicker.vue.d.ts +60 -0
  9. package/dist/components/DropdownMenu.vue.d.ts +1 -1
  10. package/dist/components/Input.vue.d.ts +39 -1
  11. package/dist/components/Pagination.vue.d.ts +3 -1
  12. package/dist/components/PasswordInput.vue.d.ts +54 -0
  13. package/dist/components/Select.vue.d.ts +2 -2
  14. package/dist/components/Table.vue.d.ts +131 -0
  15. package/dist/components/Textarea.vue.d.ts +16 -1
  16. package/dist/components/index.d.ts +5 -0
  17. package/dist/composables/data-table.d.ts +93 -0
  18. package/dist/composables/date.d.ts +21 -0
  19. package/dist/index.d.ts +7 -0
  20. package/dist/index.js +72 -60
  21. package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +104 -7
  22. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js +122 -0
  23. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/DateFormatter.js +84 -0
  24. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +91 -0
  25. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js +107 -0
  26. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js +159 -0
  27. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js +29 -0
  28. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js +37 -0
  29. package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js +6 -0
  30. package/dist/packages/iryx-ui/src/component-names.js +1 -1
  31. package/dist/packages/iryx-ui/src/components/Alert.vue_vue_type_script_setup_true_lang.js +51 -35
  32. package/dist/packages/iryx-ui/src/components/Badge.vue_vue_type_script_setup_true_lang.js +1 -2
  33. package/dist/packages/iryx-ui/src/components/Banner.js +5 -0
  34. package/dist/packages/iryx-ui/src/components/Banner.vue_vue_type_script_setup_true_lang.js +93 -0
  35. package/dist/packages/iryx-ui/src/components/DatePicker.js +5 -0
  36. package/dist/packages/iryx-ui/src/components/DatePicker.vue_vue_type_script_setup_true_lang.js +186 -0
  37. package/dist/packages/iryx-ui/src/components/DateRangePicker.js +5 -0
  38. package/dist/packages/iryx-ui/src/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +210 -0
  39. package/dist/packages/iryx-ui/src/components/Input.vue_vue_type_script_setup_true_lang.js +94 -25
  40. package/dist/packages/iryx-ui/src/components/Pagination.vue_vue_type_script_setup_true_lang.js +5 -1
  41. package/dist/packages/iryx-ui/src/components/PasswordInput.js +5 -0
  42. package/dist/packages/iryx-ui/src/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +113 -0
  43. package/dist/packages/iryx-ui/src/components/Table.js +5 -0
  44. package/dist/packages/iryx-ui/src/components/Table.vue_vue_type_script_setup_true_lang.js +217 -0
  45. package/dist/packages/iryx-ui/src/components/Textarea.vue_vue_type_script_setup_true_lang.js +47 -21
  46. package/dist/packages/iryx-ui/src/components/index.js +68 -58
  47. package/dist/packages/iryx-ui/src/composables/data-table.js +106 -0
  48. package/dist/packages/iryx-ui/src/composables/date.js +25 -0
  49. package/dist/packages/iryx-ui/src/theme/alert.js +10 -21
  50. package/dist/packages/iryx-ui/src/theme/badge.js +37 -37
  51. package/dist/packages/iryx-ui/src/theme/banner.js +62 -0
  52. package/dist/packages/iryx-ui/src/theme/date-picker.js +45 -0
  53. package/dist/packages/iryx-ui/src/theme/input.js +22 -6
  54. package/dist/packages/iryx-ui/src/theme/pagination.js +23 -13
  55. package/dist/packages/iryx-ui/src/theme/password-input.js +22 -0
  56. package/dist/packages/iryx-ui/src/theme/stat.js +4 -4
  57. package/dist/packages/iryx-ui/src/theme/table.js +62 -0
  58. package/dist/packages/iryx-ui/src/theme/toast.js +11 -26
  59. package/dist/theme/alert.d.ts +6 -12
  60. package/dist/theme/badge.d.ts +15 -12
  61. package/dist/theme/banner.d.ts +185 -0
  62. package/dist/theme/date-picker.d.ts +254 -0
  63. package/dist/theme/index.d.ts +4 -0
  64. package/dist/theme/input.d.ts +94 -15
  65. package/dist/theme/pagination.d.ts +33 -0
  66. package/dist/theme/password-input.d.ts +79 -0
  67. package/dist/theme/stat.d.ts +0 -3
  68. package/dist/theme/table.d.ts +230 -0
  69. package/dist/theme/toast.d.ts +0 -15
  70. package/package.json +2 -1
  71. package/theme.css +10 -0
@@ -0,0 +1,113 @@
1
+ import { ViewIcon as e, ViewOffIcon as t } from "../../../../node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js";
2
+ import { useIryxUiConfig as n } from "../config.js";
3
+ import r from "./Icon.js";
4
+ import i from "./Input.js";
5
+ import { passwordInputTheme as a } from "../theme/password-input.js";
6
+ import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createVNode as f, defineComponent as p, mergeModels as m, mergeProps as h, normalizeClass as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, useModel as S, withCtx as C } from "vue";
7
+ //#region src/components/PasswordInput.vue?vue&type=script&setup=true&lang.ts
8
+ var w = [
9
+ "aria-label",
10
+ "aria-pressed",
11
+ "disabled"
12
+ ], T = ["data-filled"], E = /*@__PURE__*/ p({
13
+ inheritAttrs: !1,
14
+ __name: "PasswordInput",
15
+ props: /*@__PURE__*/ m({
16
+ size: {},
17
+ placeholder: {},
18
+ disabled: { type: Boolean },
19
+ required: { type: Boolean },
20
+ invalid: {
21
+ type: Boolean,
22
+ default: void 0
23
+ },
24
+ id: {},
25
+ toggle: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ strength: { type: Boolean },
30
+ showLabel: { default: "Show password" },
31
+ hideLabel: { default: "Hide password" },
32
+ strengthLabels: { default: () => [
33
+ "Weak",
34
+ "Fair",
35
+ "Good",
36
+ "Strong"
37
+ ] },
38
+ unstyled: {
39
+ type: Boolean,
40
+ default: void 0
41
+ },
42
+ class: {},
43
+ ui: {}
44
+ }, {
45
+ modelValue: { default: "" },
46
+ modelModifiers: {}
47
+ }),
48
+ emits: ["update:modelValue"],
49
+ setup(p) {
50
+ let m = p, E = S(p, "modelValue"), D = n(), O = s(() => m.unstyled ?? D.unstyled), k = v(!1), A = s(() => {
51
+ let e = E.value;
52
+ if (!e) return 0;
53
+ let t = 0;
54
+ return e.length >= 8 && t++, e.length >= 12 && t++, /[a-z]/.test(e) && /[A-Z]/.test(e) && t++, /\d/.test(e) && t++, /[^\w\s]/.test(e) && t++, Math.max(1, Math.min(t, 4));
55
+ }), j = s(() => m.strength && E.value.length > 0), M = s(() => a({ score: A.value }));
56
+ function N(e, t) {
57
+ let n = m.ui?.[e];
58
+ return O.value ? [n, t] : M.value[e]({ class: [n, t] });
59
+ }
60
+ return (n, a) => (_(), l("div", { class: g(N("root", m.class)) }, [f(i, h({
61
+ id: m.id,
62
+ modelValue: E.value,
63
+ "onUpdate:modelValue": a[1] ||= (e) => E.value = e,
64
+ type: k.value ? "text" : "password",
65
+ size: m.size,
66
+ placeholder: m.placeholder,
67
+ disabled: m.disabled,
68
+ required: m.required,
69
+ invalid: m.invalid,
70
+ unstyled: m.unstyled,
71
+ ui: { input: m.ui?.input },
72
+ autocomplete: "current-password"
73
+ }, n.$attrs), d({ _: 2 }, [m.toggle ? {
74
+ name: "trailing",
75
+ fn: C(() => [u("button", {
76
+ type: "button",
77
+ tabindex: "-1",
78
+ "aria-label": k.value ? m.hideLabel : m.showLabel,
79
+ "aria-pressed": k.value,
80
+ disabled: m.disabled,
81
+ class: g(N("toggle")),
82
+ onClick: a[0] ||= (e) => k.value = !k.value
83
+ }, [f(r, { icon: k.value ? x(t) : x(e) }, null, 8, ["icon"])], 10, w)]),
84
+ key: "0"
85
+ } : void 0]), 1040, [
86
+ "id",
87
+ "modelValue",
88
+ "type",
89
+ "size",
90
+ "placeholder",
91
+ "disabled",
92
+ "required",
93
+ "invalid",
94
+ "unstyled",
95
+ "ui"
96
+ ]), j.value ? (_(), l("div", {
97
+ key: 0,
98
+ class: g(N("meter"))
99
+ }, [u("div", {
100
+ class: g(N("track")),
101
+ "aria-hidden": "true"
102
+ }, [(_(), l(o, null, y(4, (e) => u("span", {
103
+ key: e,
104
+ "data-filled": e <= A.value ? "" : void 0,
105
+ class: g(N("segment"))
106
+ }, null, 10, T)), 64))], 2), u("span", {
107
+ class: g(N("label")),
108
+ role: "status"
109
+ }, b(m.strengthLabels[A.value - 1]), 3)], 2)) : c("", !0)], 2));
110
+ }
111
+ });
112
+ //#endregion
113
+ export { E as default };
@@ -0,0 +1,5 @@
1
+ import e from "./Table.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/components/Table.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,217 @@
1
+ import { ArrowDown01Icon as e, ArrowRight01Icon as t, ArrowUp01Icon as n, UnfoldMoreIcon as r } from "../../../../node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js";
2
+ import { useIryxUiConfig as i } from "../config.js";
3
+ import a from "./Icon.js";
4
+ import o from "./Checkbox.js";
5
+ import s from "./Skeleton.js";
6
+ import { useDataTable as c } from "../composables/data-table.js";
7
+ import { tableTheme as l } from "../theme/table.js";
8
+ import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, mergeModels as y, normalizeClass as b, normalizeStyle as x, openBlock as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useModel as D, withModifiers as O } from "vue";
9
+ //#region src/components/Table.vue?vue&type=script&setup=true&lang.ts
10
+ var k = ["aria-label", "aria-busy"], A = ["aria-sort"], j = ["onClick"], M = { key: 1 }, N = ["colspan"], ee = ["data-selected", "onClick"], P = ["aria-expanded", "onClick"], F = ["colspan"], I = /*@__PURE__*/ v({
11
+ __name: "Table",
12
+ props: /*@__PURE__*/ y({
13
+ rows: { default: () => [] },
14
+ columns: { default: () => [] },
15
+ total: { default: void 0 },
16
+ rowKey: { default: "id" },
17
+ loading: { type: Boolean },
18
+ loadingRows: { default: 5 },
19
+ selectable: { type: Boolean },
20
+ isRowSelectable: {},
21
+ expandable: { type: Boolean },
22
+ canExpandRow: {},
23
+ clickableRows: { type: Boolean },
24
+ striped: { type: Boolean },
25
+ hoverable: {
26
+ type: Boolean,
27
+ default: void 0
28
+ },
29
+ stickyHeader: { type: Boolean },
30
+ size: {},
31
+ emptyText: { default: "No results." },
32
+ label: {},
33
+ caption: {},
34
+ unstyled: {
35
+ type: Boolean,
36
+ default: void 0
37
+ },
38
+ class: {},
39
+ ui: {}
40
+ }, {
41
+ sort: { default: null },
42
+ sortModifiers: {},
43
+ page: { default: 1 },
44
+ pageModifiers: {},
45
+ perPage: { default: 10 },
46
+ perPageModifiers: {},
47
+ selection: { default: () => [] },
48
+ selectionModifiers: {},
49
+ expanded: { default: () => [] },
50
+ expandedModifiers: {}
51
+ }),
52
+ emits: /*@__PURE__*/ y(["rowClick"], [
53
+ "update:sort",
54
+ "update:page",
55
+ "update:perPage",
56
+ "update:selection",
57
+ "update:expanded"
58
+ ]),
59
+ setup(v, { expose: y, emit: I }) {
60
+ let L = v, R = I, z = D(v, "sort"), B = D(v, "page"), V = D(v, "perPage"), H = D(v, "selection"), U = D(v, "expanded"), W = c({
61
+ rows: () => L.rows,
62
+ columns: () => L.columns,
63
+ total: () => L.total,
64
+ rowKey: () => L.rowKey,
65
+ isRowSelectable: L.isRowSelectable,
66
+ sort: z,
67
+ page: B,
68
+ perPage: V,
69
+ selection: H,
70
+ expanded: U
71
+ }), G = i(), K = d(() => L.unstyled ?? G.unstyled), q = d(() => l({
72
+ size: L.size,
73
+ striped: L.striped,
74
+ hoverable: L.hoverable ?? !0,
75
+ stickyHeader: L.stickyHeader,
76
+ clickable: L.clickableRows
77
+ }));
78
+ function J(e, t) {
79
+ let n = L.ui?.[e];
80
+ return K.value ? [n, t] : q.value[e]({ class: [n, t] });
81
+ }
82
+ function Y(e) {
83
+ return K.value ? void 0 : q.value[e]();
84
+ }
85
+ let X = d(() => K.value ? [L.ui?.root, L.class] : q.value.root({ class: [L.ui?.root, L.class] }));
86
+ function Z(e) {
87
+ if (K.value) return;
88
+ let t = e.align ?? (e.numeric ? "end" : "start");
89
+ if (t !== "start") return t === "end" ? "text-end" : "text-center";
90
+ }
91
+ function Q(e) {
92
+ return !K.value && e.numeric ? "tabular-nums" : void 0;
93
+ }
94
+ function te(e, t) {
95
+ return typeof t.class == "function" ? t.class(e) : t.class;
96
+ }
97
+ function ne(e, t) {
98
+ return typeof t.hidden == "function" ? t.hidden(e) : !1;
99
+ }
100
+ let $ = d(() => W.visibleColumns.value.length + +!!L.selectable + +!!L.expandable), re = d(() => L.loading && W.pageRows.value.length === 0), ie = d(() => !L.loading && W.pageRows.value.length === 0);
101
+ function ae(e) {
102
+ if (!e.sortable) return;
103
+ let t = W.sortOrderFor(e);
104
+ return t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
105
+ }
106
+ function oe(e) {
107
+ L.clickableRows && R("rowClick", e);
108
+ }
109
+ return y({ table: W }), (i, c) => (S(), m("div", { class: b(X.value) }, [h("table", {
110
+ class: b(J("table")),
111
+ "aria-label": L.label,
112
+ "aria-busy": L.loading || void 0
113
+ }, [
114
+ L.caption || i.$slots.caption ? (S(), m("caption", {
115
+ key: 0,
116
+ class: b(J("caption"))
117
+ }, [w(i.$slots, "caption", {}, () => [g(T(L.caption), 1)])], 2)) : p("", !0),
118
+ h("thead", { class: b(J("thead")) }, [h("tr", null, [
119
+ L.expandable ? (S(), m("th", {
120
+ key: 0,
121
+ class: b(Y("headGutter"))
122
+ }, null, 2)) : p("", !0),
123
+ L.selectable ? (S(), m("th", {
124
+ key: 1,
125
+ class: b(Y("headGutter"))
126
+ }, [_(o, {
127
+ "model-value": E(W).headerSelection.value,
128
+ "aria-label": "Select all rows on this page",
129
+ "onUpdate:modelValue": E(W).toggleAll
130
+ }, null, 8, ["model-value", "onUpdate:modelValue"])], 2)) : p("", !0),
131
+ (S(!0), m(u, null, C(E(W).visibleColumns.value, (t) => (S(), m("th", {
132
+ key: t.key,
133
+ class: b(J("th", Z(t))),
134
+ style: x(t.width ? { width: t.width } : void 0),
135
+ "aria-sort": ae(t),
136
+ scope: "col"
137
+ }, [w(i.$slots, `header-${t.key}`, { column: t }, () => [t.sortable ? (S(), m("button", {
138
+ key: 0,
139
+ type: "button",
140
+ class: b(Y("sortButton")),
141
+ onClick: (e) => E(W).toggleSort(t)
142
+ }, [g(T(t.label ?? t.key) + " ", 1), _(a, {
143
+ icon: E(W).sortOrderFor(t) === "asc" ? E(n) : E(W).sortOrderFor(t) === "desc" ? E(e) : E(r),
144
+ class: b(Y("sortIcon"))
145
+ }, null, 8, ["icon", "class"])], 10, j)) : (S(), m(u, { key: 1 }, [g(T(t.label ?? t.key), 1)], 64))])], 14, A))), 128))
146
+ ])], 2),
147
+ h("tbody", { class: b(J("tbody")) }, [re.value ? (S(!0), m(u, { key: 0 }, C(L.loadingRows, (e) => (S(), m("tr", {
148
+ key: `skeleton-${e}`,
149
+ class: b(J("tr"))
150
+ }, [
151
+ L.expandable ? (S(), m("td", {
152
+ key: 0,
153
+ class: b(Y("gutter"))
154
+ }, [_(s, { class: "size-4" })], 2)) : p("", !0),
155
+ L.selectable ? (S(), m("td", {
156
+ key: 1,
157
+ class: b(Y("gutter"))
158
+ }, [_(s, { class: "size-4" })], 2)) : p("", !0),
159
+ (S(!0), m(u, null, C(E(W).visibleColumns.value, (e) => (S(), m("td", {
160
+ key: e.key,
161
+ class: b(J("td"))
162
+ }, [_(s, { class: "h-4 w-24" })], 2))), 128))
163
+ ], 2))), 128)) : ie.value ? (S(), m("tr", M, [h("td", {
164
+ colspan: $.value,
165
+ class: b(J("empty"))
166
+ }, [w(i.$slots, "empty", {}, () => [g(T(L.emptyText), 1)])], 10, N)])) : (S(!0), m(u, { key: 2 }, C(E(W).pageRows.value, (e) => (S(), m(u, { key: E(W).keyOf(e) }, [h("tr", {
167
+ class: b([J("tr"), !K.value && E(W).isSelected(e) ? "bg-primary/5" : void 0]),
168
+ "data-selected": E(W).isSelected(e) || void 0,
169
+ onClick: (t) => oe(e)
170
+ }, [
171
+ L.expandable ? (S(), m("td", {
172
+ key: 0,
173
+ class: b(Y("gutter")),
174
+ onClick: c[0] ||= O(() => {}, ["stop"])
175
+ }, [!L.canExpandRow || L.canExpandRow(e) ? (S(), m("button", {
176
+ key: 0,
177
+ type: "button",
178
+ class: b([Y("expandButton"), E(W).isExpanded(e) && !K.value ? "rotate-90" : void 0]),
179
+ "aria-expanded": E(W).isExpanded(e),
180
+ "aria-label": "Toggle row details",
181
+ onClick: (t) => E(W).toggleExpanded(e)
182
+ }, [_(a, { icon: E(t) }, null, 8, ["icon"])], 10, P)) : p("", !0)], 2)) : p("", !0),
183
+ L.selectable ? (S(), m("td", {
184
+ key: 1,
185
+ class: b(Y("gutter")),
186
+ onClick: c[1] ||= O(() => {}, ["stop"])
187
+ }, [!L.isRowSelectable || L.isRowSelectable(e) ? (S(), f(o, {
188
+ key: 0,
189
+ "model-value": E(W).isSelected(e),
190
+ "aria-label": "Select row",
191
+ "onUpdate:modelValue": (t) => E(W).toggleRow(e)
192
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : p("", !0)], 2)) : p("", !0),
193
+ (S(!0), m(u, null, C(E(W).visibleColumns.value, (t) => (S(), m("td", {
194
+ key: t.key,
195
+ class: b(J("td", [
196
+ Z(t),
197
+ Q(t),
198
+ te(e, t)
199
+ ].filter(Boolean).join(" ") || void 0))
200
+ }, [ne(e, t) ? p("", !0) : w(i.$slots, `cell-${t.key}`, {
201
+ key: 0,
202
+ row: e,
203
+ column: t,
204
+ value: E(W).getRowValue(e, t.key)
205
+ }, () => [g(T(E(W).getRowValue(e, t.key)), 1)])], 2))), 128))
206
+ ], 10, ee), L.expandable && E(W).isExpanded(e) ? (S(), m("tr", {
207
+ key: 0,
208
+ class: b([J("tr"), Y("expandedRow")])
209
+ }, [h("td", {
210
+ colspan: $.value,
211
+ class: b(Y("expandedCell"))
212
+ }, [w(i.$slots, "expanded", { row: e })], 10, F)], 2)) : p("", !0)], 64))), 128))], 2)
213
+ ], 10, k)], 2));
214
+ }
215
+ });
216
+ //#endregion
217
+ export { I as default };
@@ -1,9 +1,9 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import { useFormField as t } from "../composables/form.js";
3
3
  import { textareaTheme as n } from "../theme/input.js";
4
- import { computed as r, createElementBlock as i, defineComponent as a, mergeModels as o, normalizeClass as s, openBlock as c, unref as l, useModel as u, vModelText as d, withDirectives as f } from "vue";
4
+ import { computed as r, createElementBlock as i, defineComponent as a, mergeModels as o, nextTick as s, normalizeClass as c, onMounted as l, openBlock as u, ref as d, unref as f, useModel as p, vModelText as m, watch as h, withDirectives as g } from "vue";
5
5
  //#region src/components/Textarea.vue?vue&type=script&setup=true&lang.ts
6
- var p = [
6
+ var _ = [
7
7
  "id",
8
8
  "rows",
9
9
  "placeholder",
@@ -11,11 +11,12 @@ var p = [
11
11
  "required",
12
12
  "aria-invalid",
13
13
  "aria-describedby"
14
- ], m = /*@__PURE__*/ a({
14
+ ], v = /*@__PURE__*/ a({
15
15
  __name: "Textarea",
16
16
  props: /*@__PURE__*/ o({
17
17
  size: {},
18
18
  rows: {},
19
+ autosize: { type: [Boolean, Object] },
19
20
  placeholder: {},
20
21
  disabled: { type: Boolean },
21
22
  required: { type: Boolean },
@@ -34,24 +35,49 @@ var p = [
34
35
  modelModifiers: {}
35
36
  }),
36
37
  emits: ["update:modelValue"],
37
- setup(a) {
38
- let o = a, m = u(a, "modelValue"), h = t(), g = r(() => o.id ?? h?.id.value), _ = r(() => o.invalid ?? h?.invalid.value ?? !1), v = e(), y = r(() => o.unstyled ?? v.unstyled), b = r(() => y.value ? o.class : n({
39
- size: o.size,
40
- invalid: _.value,
41
- class: o.class
42
- }));
43
- return (e, t) => f((c(), i("textarea", {
44
- id: g.value,
45
- "onUpdate:modelValue": t[0] ||= (e) => m.value = e,
46
- rows: o.rows,
47
- placeholder: o.placeholder,
48
- disabled: o.disabled,
49
- required: o.required,
50
- "aria-invalid": _.value || void 0,
51
- "aria-describedby": l(h)?.describedBy.value,
52
- class: s(b.value)
53
- }, null, 10, p)), [[d, m.value]]);
38
+ setup(a, { expose: o }) {
39
+ let v = a, y = p(a, "modelValue"), b = t(), x = r(() => v.id ?? b?.id.value), S = r(() => v.invalid ?? b?.invalid.value ?? !1), C = e(), w = r(() => v.unstyled ?? C.unstyled), T = r(() => w.value ? v.class : n({
40
+ size: v.size,
41
+ invalid: S.value,
42
+ autosize: !!v.autosize,
43
+ class: v.class
44
+ })), E = d();
45
+ o({ textarea: E });
46
+ let D = r(() => typeof v.autosize == "object" ? v.autosize : {});
47
+ function O(e) {
48
+ return Number.parseFloat(e) || 0;
49
+ }
50
+ function k() {
51
+ let e = E.value;
52
+ if (!e || !v.autosize) return;
53
+ e.style.height = "auto";
54
+ let t = window.getComputedStyle(e), n = O(t.lineHeight), r = O(t.paddingTop) + O(t.paddingBottom), i = O(t.borderTopWidth) + O(t.borderBottomWidth), a = e.scrollHeight;
55
+ if (n) {
56
+ let { min: e, max: t } = D.value;
57
+ e != null && (a = Math.max(a, e * n + r)), t != null && (a = Math.min(a, t * n + r));
58
+ }
59
+ e.style.height = `${a + i}px`, e.style.overflowY = D.value.max != null && e.scrollHeight > a ? "auto" : "hidden";
60
+ }
61
+ return l(() => {
62
+ v.autosize && s(k);
63
+ }), h(() => [
64
+ y.value,
65
+ v.autosize,
66
+ v.size
67
+ ], () => void s(k)), (e, t) => g((u(), i("textarea", {
68
+ id: x.value,
69
+ ref_key: "el",
70
+ ref: E,
71
+ "onUpdate:modelValue": t[0] ||= (e) => y.value = e,
72
+ rows: v.autosize ? D.value.min : v.rows,
73
+ placeholder: v.placeholder,
74
+ disabled: v.disabled,
75
+ required: v.required,
76
+ "aria-invalid": S.value || void 0,
77
+ "aria-describedby": f(b)?.describedBy.value,
78
+ class: c(T.value)
79
+ }, null, 10, _)), [[m, y.value]]);
54
80
  }
55
81
  });
56
82
  //#endregion
57
- export { m as default };
83
+ export { v as default };
@@ -2,67 +2,77 @@ import { __exportAll as e } from "../../../../_virtual/_rolldown/runtime.js";
2
2
  import t from "./Alert.js";
3
3
  import n from "./App.js";
4
4
  import r from "./Badge.js";
5
- import i from "./Breadcrumb.js";
6
- import a from "./Button.js";
7
- import o from "./ButtonGroup.js";
8
- import s from "./Card.js";
9
- import c from "./Checkbox.js";
10
- import l from "./Combobox.js";
11
- import u from "./Dialog.js";
12
- import d from "./ConfirmDialog.js";
13
- import f from "./DropdownMenu.js";
14
- import p from "./EmptyState.js";
15
- import m from "./Form.js";
16
- import h from "./Label.js";
17
- import g from "./FormField.js";
18
- import _ from "./Input.js";
19
- import v from "./NumberInput.js";
20
- import y from "./Pagination.js";
21
- import b from "./Progress.js";
22
- import x from "./RadioGroup.js";
23
- import S from "./Select.js";
24
- import C from "./Separator.js";
25
- import w from "./Skeleton.js";
26
- import T from "./Stat.js";
27
- import E from "./Stepper.js";
28
- import D from "./Switch.js";
29
- import O from "./Tabs.js";
30
- import k from "./Textarea.js";
31
- import A from "./Toaster.js";
32
- import j from "./Tooltip.js";
5
+ import i from "./Banner.js";
6
+ import a from "./Breadcrumb.js";
7
+ import o from "./Button.js";
8
+ import s from "./ButtonGroup.js";
9
+ import c from "./Card.js";
10
+ import l from "./Checkbox.js";
11
+ import u from "./Combobox.js";
12
+ import d from "./Dialog.js";
13
+ import f from "./ConfirmDialog.js";
14
+ import p from "./DatePicker.js";
15
+ import m from "./DateRangePicker.js";
16
+ import h from "./DropdownMenu.js";
17
+ import g from "./EmptyState.js";
18
+ import _ from "./Form.js";
19
+ import v from "./Label.js";
20
+ import y from "./FormField.js";
21
+ import b from "./Input.js";
22
+ import x from "./NumberInput.js";
23
+ import S from "./Pagination.js";
24
+ import C from "./PasswordInput.js";
25
+ import w from "./Progress.js";
26
+ import T from "./RadioGroup.js";
27
+ import E from "./Select.js";
28
+ import D from "./Separator.js";
29
+ import O from "./Skeleton.js";
30
+ import k from "./Stat.js";
31
+ import A from "./Stepper.js";
32
+ import j from "./Switch.js";
33
+ import M from "./Table.js";
34
+ import N from "./Tabs.js";
35
+ import P from "./Textarea.js";
36
+ import F from "./Toaster.js";
37
+ import I from "./Tooltip.js";
33
38
  //#region src/components/index.ts
34
- var M = /* @__PURE__ */ e({
39
+ var L = /* @__PURE__ */ e({
35
40
  Alert: () => t,
36
41
  App: () => n,
37
42
  Badge: () => r,
38
- Breadcrumb: () => i,
39
- Button: () => a,
40
- ButtonGroup: () => o,
41
- Card: () => s,
42
- Checkbox: () => c,
43
- Combobox: () => l,
44
- ConfirmDialog: () => d,
45
- Dialog: () => u,
46
- DropdownMenu: () => f,
47
- EmptyState: () => p,
48
- Form: () => m,
49
- FormField: () => g,
50
- Input: () => _,
51
- Label: () => h,
52
- NumberInput: () => v,
53
- Pagination: () => y,
54
- Progress: () => b,
55
- RadioGroup: () => x,
56
- Select: () => S,
57
- Separator: () => C,
58
- Skeleton: () => w,
59
- Stat: () => T,
60
- Stepper: () => E,
61
- Switch: () => D,
62
- Tabs: () => O,
63
- Textarea: () => k,
64
- Toaster: () => A,
65
- Tooltip: () => j
43
+ Banner: () => i,
44
+ Breadcrumb: () => a,
45
+ Button: () => o,
46
+ ButtonGroup: () => s,
47
+ Card: () => c,
48
+ Checkbox: () => l,
49
+ Combobox: () => u,
50
+ ConfirmDialog: () => f,
51
+ DatePicker: () => p,
52
+ DateRangePicker: () => m,
53
+ Dialog: () => d,
54
+ DropdownMenu: () => h,
55
+ EmptyState: () => g,
56
+ Form: () => _,
57
+ FormField: () => y,
58
+ Input: () => b,
59
+ Label: () => v,
60
+ NumberInput: () => x,
61
+ Pagination: () => S,
62
+ PasswordInput: () => C,
63
+ Progress: () => w,
64
+ RadioGroup: () => T,
65
+ Select: () => E,
66
+ Separator: () => D,
67
+ Skeleton: () => O,
68
+ Stat: () => k,
69
+ Stepper: () => A,
70
+ Switch: () => j,
71
+ Table: () => M,
72
+ Tabs: () => N,
73
+ Textarea: () => P,
74
+ Toaster: () => F,
75
+ Tooltip: () => I
66
76
  });
67
77
  //#endregion
68
- export { M as components_exports };
78
+ export { L as components_exports };
@@ -0,0 +1,106 @@
1
+ import { computed as e, ref as t } from "vue";
2
+ //#region src/composables/data-table.ts
3
+ function n(e, n) {
4
+ return e || t(n);
5
+ }
6
+ function r(e) {
7
+ return e == null || e === "";
8
+ }
9
+ function i(e, t) {
10
+ return t.split(".").reduce((e, t) => e?.[t], e);
11
+ }
12
+ function a(e, t) {
13
+ return typeof e == "number" && typeof t == "number" ? e - t : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : String(e).localeCompare(String(t), void 0, {
14
+ numeric: !0,
15
+ sensitivity: "base"
16
+ });
17
+ }
18
+ function o(t) {
19
+ let o = n(t.sort, null), s = n(t.page, 1), c = n(t.perPage, 10), l = n(t.selection, []), u = n(t.expanded, []), d = e(() => t.total?.() !== void 0), f = e(() => t.rowKey?.() ?? "id"), p = e(() => t.columns().filter((e) => e.hidden !== !0)), m = e(() => {
20
+ let e = t.rows(), n = o.value;
21
+ if (d.value || !n) return e;
22
+ let s = t.columns().find((e) => (e.sortKey ?? e.key) === n.key)?.key ?? n.key, c = n.order === "asc" ? 1 : -1;
23
+ return [...e].sort((e, t) => {
24
+ let n = i(e, s), o = i(t, s);
25
+ return r(n) || r(o) ? r(n) && r(o) ? 0 : r(n) ? 1 : -1 : a(n, o) * c;
26
+ });
27
+ }), h = e(() => t.total?.() ?? m.value.length), g = e(() => Math.max(1, Math.ceil(h.value / Math.max(1, c.value)))), _ = e(() => {
28
+ if (d.value) return m.value;
29
+ let e = (s.value - 1) * c.value;
30
+ return m.value.slice(e, e + c.value);
31
+ });
32
+ function v(e) {
33
+ return i(e, f.value);
34
+ }
35
+ function y(e) {
36
+ if (!e.sortable) return;
37
+ let t = e.sortKey ?? e.key, n = o.value;
38
+ n?.key === t ? n.order === "asc" ? o.value = {
39
+ key: t,
40
+ order: "desc"
41
+ } : o.value = null : o.value = {
42
+ key: t,
43
+ order: "asc"
44
+ }, s.value = 1;
45
+ }
46
+ function b(e) {
47
+ let t = e.sortKey ?? e.key;
48
+ return o.value?.key === t ? o.value.order : null;
49
+ }
50
+ let x = e(() => _.value.filter((e) => !t.isRowSelectable || t.isRowSelectable(e)));
51
+ function S(e) {
52
+ return l.value.includes(v(e));
53
+ }
54
+ function C(e) {
55
+ if (t.isRowSelectable && !t.isRowSelectable(e)) return;
56
+ let n = v(e);
57
+ l.value = S(e) ? l.value.filter((e) => e !== n) : [...l.value, n];
58
+ }
59
+ let w = e(() => {
60
+ let e = x.value;
61
+ if (e.length === 0) return !1;
62
+ let t = e.filter(S).length;
63
+ return t === 0 ? !1 : t === e.length ? !0 : "indeterminate";
64
+ });
65
+ function T(e) {
66
+ let t = x.value.map(v);
67
+ if (e === !0) {
68
+ let e = new Set(l.value);
69
+ t.forEach((t) => e.add(t)), l.value = [...e];
70
+ } else {
71
+ let e = new Set(t);
72
+ l.value = l.value.filter((t) => !e.has(t));
73
+ }
74
+ }
75
+ function E(e) {
76
+ return u.value.includes(v(e));
77
+ }
78
+ function D(e) {
79
+ let t = v(e);
80
+ u.value = E(e) ? u.value.filter((e) => e !== t) : [...u.value, t];
81
+ }
82
+ return {
83
+ sort: o,
84
+ page: s,
85
+ perPage: c,
86
+ selection: l,
87
+ expanded: u,
88
+ isServerMode: d,
89
+ visibleColumns: p,
90
+ pageRows: _,
91
+ total: h,
92
+ pageCount: g,
93
+ keyOf: v,
94
+ toggleSort: y,
95
+ sortOrderFor: b,
96
+ headerSelection: w,
97
+ isSelected: S,
98
+ toggleRow: C,
99
+ toggleAll: T,
100
+ isExpanded: E,
101
+ toggleExpanded: D,
102
+ getRowValue: i
103
+ };
104
+ }
105
+ //#endregion
106
+ export { i as getRowValue, o as useDataTable };