iryx-ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -27
- package/dist/component-names.d.ts +1 -1
- package/dist/components/App.vue.d.ts +1 -1
- package/dist/components/Combobox.vue.d.ts +112 -0
- package/dist/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/components/FormField.vue.d.ts +0 -9
- package/dist/components/Label.vue.d.ts +0 -6
- package/dist/components/NumberInput.vue.d.ts +63 -0
- package/dist/components/Select.vue.d.ts +13 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/composables/decimal.d.ts +53 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +49 -44
- package/dist/nuxt.d.ts +1 -1
- package/dist/packages/iryx-ui/src/component-names.js +1 -1
- package/dist/packages/iryx-ui/src/components/Combobox.js +5 -0
- package/dist/packages/iryx-ui/src/components/Combobox.vue_vue_type_script_setup_true_lang.js +284 -0
- package/dist/packages/iryx-ui/src/components/FormField.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/packages/iryx-ui/src/components/Label.vue_vue_type_script_setup_true_lang.js +0 -2
- package/dist/packages/iryx-ui/src/components/NumberInput.js +5 -0
- package/dist/packages/iryx-ui/src/components/NumberInput.vue_vue_type_script_setup_true_lang.js +136 -0
- package/dist/packages/iryx-ui/src/components/Select.vue_vue_type_script_setup_true_lang.js +72 -27
- package/dist/packages/iryx-ui/src/components/index.js +48 -44
- package/dist/packages/iryx-ui/src/composables/decimal.js +79 -0
- package/dist/packages/iryx-ui/src/theme/alert.js +2 -2
- package/dist/packages/iryx-ui/src/theme/button.js +2 -2
- package/dist/packages/iryx-ui/src/theme/card.js +1 -1
- package/dist/packages/iryx-ui/src/theme/checkbox.js +1 -1
- package/dist/packages/iryx-ui/src/theme/combobox.js +29 -0
- package/dist/packages/iryx-ui/src/theme/dialog.js +2 -2
- package/dist/packages/iryx-ui/src/theme/dropdown-menu.js +4 -4
- package/dist/packages/iryx-ui/src/theme/form.js +10 -34
- package/dist/packages/iryx-ui/src/theme/input.js +1 -1
- package/dist/packages/iryx-ui/src/theme/label.js +1 -10
- package/dist/packages/iryx-ui/src/theme/number-input.js +49 -0
- package/dist/packages/iryx-ui/src/theme/pagination.js +1 -1
- package/dist/packages/iryx-ui/src/theme/presets.js +0 -42
- package/dist/packages/iryx-ui/src/theme/radio-group.js +1 -1
- package/dist/packages/iryx-ui/src/theme/select.js +5 -3
- package/dist/packages/iryx-ui/src/theme/skeleton.js +1 -1
- package/dist/packages/iryx-ui/src/theme/stepper.js +1 -1
- package/dist/packages/iryx-ui/src/theme/switch.js +1 -1
- package/dist/packages/iryx-ui/src/theme/tabs.js +3 -3
- package/dist/packages/iryx-ui/src/theme/toast.js +3 -3
- package/dist/packages/iryx-ui/src/theme/tooltip.js +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/theme/button.d.ts +2 -2
- package/dist/theme/combobox.d.ts +101 -0
- package/dist/theme/form.d.ts +35 -62
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/input.d.ts +5 -5
- package/dist/theme/label.d.ts +0 -18
- package/dist/theme/number-input.d.ts +92 -0
- package/dist/theme/presets.d.ts +0 -42
- package/dist/theme/select.d.ts +6 -0
- package/package.json +1 -1
- package/theme.css +14 -0
package/dist/index.js
CHANGED
|
@@ -18,47 +18,52 @@ import { cardTheme as S } from "./packages/iryx-ui/src/theme/card.js";
|
|
|
18
18
|
import C from "./packages/iryx-ui/src/components/Card.js";
|
|
19
19
|
import { checkboxTheme as w } from "./packages/iryx-ui/src/theme/checkbox.js";
|
|
20
20
|
import T from "./packages/iryx-ui/src/components/Checkbox.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import {
|
|
36
|
-
import Q from "./packages/iryx-ui/src/components/
|
|
37
|
-
import
|
|
38
|
-
import ee from "./packages/iryx-ui/src/components/
|
|
39
|
-
import {
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import {
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import {
|
|
64
|
-
|
|
21
|
+
import { formContextKey as E, formFieldContextKey as D, getByPath as O, isStandardSchema as k, issuePath as A, useForm as j, useFormField as M } from "./packages/iryx-ui/src/composables/form.js";
|
|
22
|
+
import { fieldBase as N, inputTheme as P, textareaTheme as F } from "./packages/iryx-ui/src/theme/input.js";
|
|
23
|
+
import { comboboxTheme as I } from "./packages/iryx-ui/src/theme/combobox.js";
|
|
24
|
+
import L from "./packages/iryx-ui/src/components/Combobox.js";
|
|
25
|
+
import { resolveConfirm as R, useConfirm as z, useConfirmState as B } from "./packages/iryx-ui/src/composables/confirm.js";
|
|
26
|
+
import { dialogTheme as V } from "./packages/iryx-ui/src/theme/dialog.js";
|
|
27
|
+
import H from "./packages/iryx-ui/src/components/Dialog.js";
|
|
28
|
+
import U from "./packages/iryx-ui/src/components/ConfirmDialog.js";
|
|
29
|
+
import { dropdownMenuTheme as W } from "./packages/iryx-ui/src/theme/dropdown-menu.js";
|
|
30
|
+
import { isSeparator as G, isSubmenu as K } from "./packages/iryx-ui/src/composables/dropdown-menu.js";
|
|
31
|
+
import q from "./packages/iryx-ui/src/components/DropdownMenu.js";
|
|
32
|
+
import { emptyStateTheme as J } from "./packages/iryx-ui/src/theme/empty-state.js";
|
|
33
|
+
import Y from "./packages/iryx-ui/src/components/EmptyState.js";
|
|
34
|
+
import X from "./packages/iryx-ui/src/components/Form.js";
|
|
35
|
+
import { labelTheme as Z } from "./packages/iryx-ui/src/theme/label.js";
|
|
36
|
+
import Q from "./packages/iryx-ui/src/components/Label.js";
|
|
37
|
+
import $ from "./packages/iryx-ui/src/components/FormField.js";
|
|
38
|
+
import ee from "./packages/iryx-ui/src/components/Input.js";
|
|
39
|
+
import { addDecimals as te, clampDecimal as ne, compareDecimals as re, formatDecimal as ie, formatForLocale as ae, isDecimal as oe, localeSeparators as se, parseDecimal as ce, parseFromLocale as le, roundDecimal as ue, toEditable as de } from "./packages/iryx-ui/src/composables/decimal.js";
|
|
40
|
+
import { numberInputTheme as fe } from "./packages/iryx-ui/src/theme/number-input.js";
|
|
41
|
+
import pe from "./packages/iryx-ui/src/components/NumberInput.js";
|
|
42
|
+
import { paginationTheme as me } from "./packages/iryx-ui/src/theme/pagination.js";
|
|
43
|
+
import he from "./packages/iryx-ui/src/components/Pagination.js";
|
|
44
|
+
import { progressTheme as ge } from "./packages/iryx-ui/src/theme/progress.js";
|
|
45
|
+
import _e from "./packages/iryx-ui/src/components/Progress.js";
|
|
46
|
+
import { radioGroupTheme as ve } from "./packages/iryx-ui/src/theme/radio-group.js";
|
|
47
|
+
import ye from "./packages/iryx-ui/src/components/RadioGroup.js";
|
|
48
|
+
import { selectTheme as be } from "./packages/iryx-ui/src/theme/select.js";
|
|
49
|
+
import xe from "./packages/iryx-ui/src/components/Select.js";
|
|
50
|
+
import { separatorTheme as Se } from "./packages/iryx-ui/src/theme/separator.js";
|
|
51
|
+
import Ce from "./packages/iryx-ui/src/components/Separator.js";
|
|
52
|
+
import { skeletonTheme as we } from "./packages/iryx-ui/src/theme/skeleton.js";
|
|
53
|
+
import Te from "./packages/iryx-ui/src/components/Skeleton.js";
|
|
54
|
+
import { statTheme as Ee } from "./packages/iryx-ui/src/theme/stat.js";
|
|
55
|
+
import De from "./packages/iryx-ui/src/components/Stat.js";
|
|
56
|
+
import { stepperTheme as Oe } from "./packages/iryx-ui/src/theme/stepper.js";
|
|
57
|
+
import ke from "./packages/iryx-ui/src/components/Stepper.js";
|
|
58
|
+
import { switchTheme as Ae } from "./packages/iryx-ui/src/theme/switch.js";
|
|
59
|
+
import je from "./packages/iryx-ui/src/components/Switch.js";
|
|
60
|
+
import { tabsTheme as Me } from "./packages/iryx-ui/src/theme/tabs.js";
|
|
61
|
+
import Ne from "./packages/iryx-ui/src/components/Tabs.js";
|
|
62
|
+
import Pe from "./packages/iryx-ui/src/components/Textarea.js";
|
|
63
|
+
import { useToast as Fe, useToastState as Ie } from "./packages/iryx-ui/src/composables/toast.js";
|
|
64
|
+
import { toastTheme as Le } from "./packages/iryx-ui/src/theme/toast.js";
|
|
65
|
+
import Re from "./packages/iryx-ui/src/components/Toaster.js";
|
|
66
|
+
import { tooltipTheme as ze } from "./packages/iryx-ui/src/theme/tooltip.js";
|
|
67
|
+
import Be from "./packages/iryx-ui/src/components/Tooltip.js";
|
|
68
|
+
import { IryxUi as Ve, createIryxUi as He } from "./packages/iryx-ui/src/plugin.js";
|
|
69
|
+
export { a as Alert, d as App, p as Badge, h as Breadcrumb, y as Button, x as ButtonGroup, C as Card, T as Checkbox, L as Combobox, U as ConfirmDialog, H as Dialog, q as DropdownMenu, Y as EmptyState, X as Form, $ as FormField, ee as Input, Ve as IryxUi, Q as Label, pe as NumberInput, he as Pagination, _e as Progress, ye as RadioGroup, xe as Select, Ce as Separator, Te as Skeleton, De as Stat, ke as Stepper, je as Switch, Ne as Tabs, Pe as Textarea, Re as Toaster, Be as Tooltip, te as addDecimals, i as alertTheme, c as applyTheme, f as badgeTheme, m as breadcrumbTheme, g as buttonGroupContextKey, b as buttonGroupTheme, v as buttonTheme, S as cardTheme, w as checkboxTheme, ne as clampDecimal, l as clearTheme, I as comboboxTheme, re as compareDecimals, e as componentNames, He as createIryxUi, t as defaultConfig, V as dialogTheme, W as dropdownMenuTheme, J as emptyStateTheme, N as fieldBase, E as formContextKey, D as formFieldContextKey, ie as formatDecimal, ae as formatForLocale, O as getByPath, o as initAppearance, P as inputTheme, n as iryxUiConfigKey, oe as isDecimal, G as isSeparator, k as isStandardSchema, K as isSubmenu, A as issuePath, Z as labelTheme, se as localeSeparators, fe as numberInputTheme, me as paginationTheme, ce as parseDecimal, le as parseFromLocale, ge as progressTheme, ve as radioGroupTheme, R as resolveConfirm, ue as roundDecimal, be as selectTheme, Se as separatorTheme, we as skeletonTheme, Ee as statTheme, Oe as stepperTheme, Ae as switchTheme, Me as tabsTheme, F as textareaTheme, u as themes, de as toEditable, Le as toastTheme, ze as tooltipTheme, s as useAppearance, _ as useButtonGroup, z as useConfirm, B as useConfirmState, j as useForm, M as useFormField, r as useIryxUiConfig, Fe as useToast, Ie as useToastState };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface ModuleOptions {
|
|
|
7
7
|
unstyled: boolean;
|
|
8
8
|
/** Startup appearance. A preference the user already stored wins over this. */
|
|
9
9
|
appearance?: Appearance;
|
|
10
|
-
/** Color theme: a preset name (`'
|
|
10
|
+
/** Color theme: a preset name (`'violet'`, `'rose'`) or a custom theme. */
|
|
11
11
|
theme?: Theme | ThemePresetName;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: NuxtModule<TOptions, TOptions, false>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/component-names.ts
|
|
2
|
-
var e = /* @__PURE__ */ "Alert.App.Badge.Breadcrumb.Button.ButtonGroup.Card.Checkbox.ConfirmDialog.Dialog.DropdownMenu.EmptyState.Form.FormField.Input.Label.Pagination.Progress.RadioGroup.Select.Separator.Skeleton.Stat.Stepper.Switch.Tabs.Textarea.Toaster.Tooltip".split(".");
|
|
2
|
+
var e = /* @__PURE__ */ "Alert.App.Badge.Breadcrumb.Button.ButtonGroup.Card.Checkbox.Combobox.ConfirmDialog.Dialog.DropdownMenu.EmptyState.Form.FormField.Input.Label.NumberInput.Pagination.Progress.RadioGroup.Select.Separator.Skeleton.Stat.Stepper.Switch.Tabs.Textarea.Toaster.Tooltip".split(".");
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as componentNames };
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { ArrowDown01Icon as e, Tick02Icon 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 { useFormField as i } from "../composables/form.js";
|
|
5
|
+
import { comboboxTheme as ee } from "../theme/combobox.js";
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, normalizeClass as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, vShow as x, withCtx as S, withDirectives as te } from "vue";
|
|
7
|
+
import { ComboboxAnchor as ne, ComboboxContent as re, ComboboxEmpty as ie, ComboboxGroup as ae, ComboboxInput as oe, ComboboxItem as C, ComboboxItemIndicator as w, ComboboxLabel as T, ComboboxPortal as se, ComboboxRoot as E, ComboboxTrigger as D, ComboboxViewport as O, ComboboxVirtualizer as k, useFilter as A, useForwardPropsEmits as j } from "reka-ui";
|
|
8
|
+
//#region src/components/Combobox.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var M = /*@__PURE__*/ f({
|
|
10
|
+
__name: "Combobox",
|
|
11
|
+
props: {
|
|
12
|
+
items: {},
|
|
13
|
+
placeholder: {},
|
|
14
|
+
size: {},
|
|
15
|
+
invalid: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: void 0
|
|
18
|
+
},
|
|
19
|
+
id: {},
|
|
20
|
+
emptyText: { default: "No results found." },
|
|
21
|
+
create: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
createLabel: {
|
|
26
|
+
type: Function,
|
|
27
|
+
default: (e) => `Create "${e}"`
|
|
28
|
+
},
|
|
29
|
+
virtual: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
estimateSize: { default: 32 },
|
|
34
|
+
overscan: { default: 12 },
|
|
35
|
+
unstyled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
class: {},
|
|
40
|
+
ui: {},
|
|
41
|
+
open: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
45
|
+
defaultOpen: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: void 0
|
|
48
|
+
},
|
|
49
|
+
resetSearchTermOnBlur: { type: Boolean },
|
|
50
|
+
resetSearchTermOnSelect: { type: Boolean },
|
|
51
|
+
openOnFocus: { type: Boolean },
|
|
52
|
+
openOnClick: { type: Boolean },
|
|
53
|
+
ignoreFilter: { type: Boolean },
|
|
54
|
+
resetModelValueOnClear: { type: Boolean },
|
|
55
|
+
modelValue: {},
|
|
56
|
+
defaultValue: {},
|
|
57
|
+
multiple: { type: Boolean },
|
|
58
|
+
dir: {},
|
|
59
|
+
disabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
highlightOnHover: { type: Boolean },
|
|
64
|
+
by: {},
|
|
65
|
+
asChild: { type: Boolean },
|
|
66
|
+
as: {},
|
|
67
|
+
name: {},
|
|
68
|
+
required: { type: Boolean }
|
|
69
|
+
},
|
|
70
|
+
emits: [
|
|
71
|
+
"update:modelValue",
|
|
72
|
+
"highlight",
|
|
73
|
+
"update:open",
|
|
74
|
+
"create"
|
|
75
|
+
],
|
|
76
|
+
setup(f, { emit: M }) {
|
|
77
|
+
let N = f, P = M, F = j(o(() => {
|
|
78
|
+
let { items: e, placeholder: t, size: n, invalid: r, id: i, emptyText: ee, create: a, createLabel: o, virtual: s, estimateSize: c, overscan: l, unstyled: u, class: d, ui: f, ...p } = N;
|
|
79
|
+
return p;
|
|
80
|
+
}), P);
|
|
81
|
+
function I(e) {
|
|
82
|
+
return typeof e == "string" ? {
|
|
83
|
+
label: e,
|
|
84
|
+
value: e
|
|
85
|
+
} : e;
|
|
86
|
+
}
|
|
87
|
+
function L(e) {
|
|
88
|
+
return typeof e != "string" && "items" in e;
|
|
89
|
+
}
|
|
90
|
+
let R = o(() => {
|
|
91
|
+
let e = N.items ?? [];
|
|
92
|
+
return e.some(L) ? e.map((e) => L(e) ? e : {
|
|
93
|
+
label: "",
|
|
94
|
+
items: [e]
|
|
95
|
+
}) : void 0;
|
|
96
|
+
}), z = o(() => (N.items ?? []).flatMap((e) => L(e) ? e.items.map(I) : [I(e)])), B = o(() => !!N.virtual), V = g(""), H = g("");
|
|
97
|
+
function U(e) {
|
|
98
|
+
H.value = e.target.value;
|
|
99
|
+
}
|
|
100
|
+
let { contains: W } = A({ sensitivity: "base" }), G = o(() => {
|
|
101
|
+
let e = H.value.trim();
|
|
102
|
+
return e ? z.value.filter((t) => W(t.label, e)) : z.value;
|
|
103
|
+
});
|
|
104
|
+
function ce(e) {
|
|
105
|
+
let t = (e) => z.value.find((t) => t.value === e)?.label ?? String(e ?? "");
|
|
106
|
+
return Array.isArray(e) ? e.map(t).join(", ") : e == null || e === "" ? "" : t(e);
|
|
107
|
+
}
|
|
108
|
+
function le(e) {
|
|
109
|
+
let t = e.target;
|
|
110
|
+
requestAnimationFrame(() => {
|
|
111
|
+
document.activeElement === t && t.select();
|
|
112
|
+
}), H.value = "";
|
|
113
|
+
}
|
|
114
|
+
let K = o(() => {
|
|
115
|
+
let e = H.value.trim();
|
|
116
|
+
return !!N.create && e.length > 0 && !z.value.some((t) => t.label.toLowerCase() === e.toLowerCase());
|
|
117
|
+
});
|
|
118
|
+
function q(e) {
|
|
119
|
+
e.preventDefault(), P("create", H.value.trim()), e.target?.dispatchEvent(new KeyboardEvent("keydown", {
|
|
120
|
+
key: "Escape",
|
|
121
|
+
bubbles: !0
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
let J = i(), ue = o(() => N.id ?? J?.id.value), Y = o(() => N.invalid ?? J?.invalid.value ?? !1), de = n(), X = o(() => N.unstyled ?? de.unstyled), Z = o(() => ee({
|
|
125
|
+
size: N.size,
|
|
126
|
+
invalid: Y.value,
|
|
127
|
+
disabled: N.disabled
|
|
128
|
+
}));
|
|
129
|
+
function Q(e, t) {
|
|
130
|
+
let n = N.ui?.[e];
|
|
131
|
+
return X.value ? [n, t] : Z.value[e]({ class: [n, t] });
|
|
132
|
+
}
|
|
133
|
+
let $ = o(() => X.value ? void 0 : Z.value.itemIndicator());
|
|
134
|
+
return (n, i) => (h(), s(b(E), p(b(F), {
|
|
135
|
+
"open-on-click": "",
|
|
136
|
+
class: "contents"
|
|
137
|
+
}), {
|
|
138
|
+
default: S(() => [d(b(ne), { class: m(Q("anchor", N.class)) }, {
|
|
139
|
+
default: S(() => [d(b(oe), {
|
|
140
|
+
id: ue.value,
|
|
141
|
+
modelValue: V.value,
|
|
142
|
+
"onUpdate:modelValue": i[0] ||= (e) => V.value = e,
|
|
143
|
+
placeholder: N.placeholder,
|
|
144
|
+
"display-value": ce,
|
|
145
|
+
"aria-invalid": Y.value || void 0,
|
|
146
|
+
"aria-describedby": b(J)?.describedBy.value,
|
|
147
|
+
class: m(Q("input")),
|
|
148
|
+
onFocus: le,
|
|
149
|
+
onInput: U
|
|
150
|
+
}, null, 8, [
|
|
151
|
+
"id",
|
|
152
|
+
"modelValue",
|
|
153
|
+
"placeholder",
|
|
154
|
+
"aria-invalid",
|
|
155
|
+
"aria-describedby",
|
|
156
|
+
"class"
|
|
157
|
+
]), d(b(D), { class: m(Q("trigger")) }, {
|
|
158
|
+
default: S(() => [d(r, { icon: b(e) }, null, 8, ["icon"])]),
|
|
159
|
+
_: 1
|
|
160
|
+
}, 8, ["class"])]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["class"]), d(b(se), null, {
|
|
163
|
+
default: S(() => [d(b(re), {
|
|
164
|
+
class: m(Q("content")),
|
|
165
|
+
position: "popper",
|
|
166
|
+
"side-offset": 4
|
|
167
|
+
}, {
|
|
168
|
+
default: S(() => [d(b(O), { class: m(Q("viewport")) }, {
|
|
169
|
+
default: S(() => [
|
|
170
|
+
B.value ? te((h(), l("div", {
|
|
171
|
+
key: 0,
|
|
172
|
+
class: m(Q("empty"))
|
|
173
|
+
}, [v(n.$slots, "empty", { query: H.value }, () => [u(y(N.emptyText), 1)])], 2)), [[x, !K.value && G.value.length === 0]]) : K.value ? c("", !0) : (h(), s(b(ie), {
|
|
174
|
+
key: 1,
|
|
175
|
+
class: m(Q("empty"))
|
|
176
|
+
}, {
|
|
177
|
+
default: S(() => [v(n.$slots, "empty", { query: H.value }, () => [u(y(N.emptyText), 1)])]),
|
|
178
|
+
_: 3
|
|
179
|
+
}, 8, ["class"])),
|
|
180
|
+
v(n.$slots, "default", {}, () => [B.value ? (h(), s(b(k), {
|
|
181
|
+
key: 0,
|
|
182
|
+
options: G.value,
|
|
183
|
+
"estimate-size": N.estimateSize,
|
|
184
|
+
overscan: N.overscan,
|
|
185
|
+
"text-content": (e) => e.label
|
|
186
|
+
}, {
|
|
187
|
+
default: S(({ option: e }) => [d(b(C), {
|
|
188
|
+
value: e.value,
|
|
189
|
+
"text-value": e.label,
|
|
190
|
+
disabled: e.disabled,
|
|
191
|
+
class: m(Q("item"))
|
|
192
|
+
}, {
|
|
193
|
+
default: S(() => [d(b(w), { class: m($.value) }, {
|
|
194
|
+
default: S(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
195
|
+
_: 1
|
|
196
|
+
}, 8, ["class"]), u(" " + y(e.label), 1)]),
|
|
197
|
+
_: 2
|
|
198
|
+
}, 1032, [
|
|
199
|
+
"value",
|
|
200
|
+
"text-value",
|
|
201
|
+
"disabled",
|
|
202
|
+
"class"
|
|
203
|
+
])]),
|
|
204
|
+
_: 1
|
|
205
|
+
}, 8, [
|
|
206
|
+
"options",
|
|
207
|
+
"estimate-size",
|
|
208
|
+
"overscan",
|
|
209
|
+
"text-content"
|
|
210
|
+
])) : R.value ? (h(!0), l(a, { key: 1 }, _(R.value, (e, n) => (h(), s(b(ae), {
|
|
211
|
+
key: e.label || n,
|
|
212
|
+
class: m(Q("group"))
|
|
213
|
+
}, {
|
|
214
|
+
default: S(() => [e.label ? (h(), s(b(T), {
|
|
215
|
+
key: 0,
|
|
216
|
+
class: m(Q("groupLabel"))
|
|
217
|
+
}, {
|
|
218
|
+
default: S(() => [u(y(e.label), 1)]),
|
|
219
|
+
_: 2
|
|
220
|
+
}, 1032, ["class"])) : c("", !0), (h(!0), l(a, null, _(e.items, (e) => (h(), s(b(C), {
|
|
221
|
+
key: typeof e == "string" ? e : e.value,
|
|
222
|
+
value: typeof e == "string" ? e : e.value,
|
|
223
|
+
"text-value": typeof e == "string" ? e : e.label,
|
|
224
|
+
disabled: typeof e == "string" ? void 0 : e.disabled,
|
|
225
|
+
class: m(Q("item"))
|
|
226
|
+
}, {
|
|
227
|
+
default: S(() => [d(b(w), { class: m($.value) }, {
|
|
228
|
+
default: S(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
229
|
+
_: 1
|
|
230
|
+
}, 8, ["class"]), u(" " + y(typeof e == "string" ? e : e.label), 1)]),
|
|
231
|
+
_: 2
|
|
232
|
+
}, 1032, [
|
|
233
|
+
"value",
|
|
234
|
+
"text-value",
|
|
235
|
+
"disabled",
|
|
236
|
+
"class"
|
|
237
|
+
]))), 128))]),
|
|
238
|
+
_: 2
|
|
239
|
+
}, 1032, ["class"]))), 128)) : (h(!0), l(a, { key: 2 }, _(z.value, (e) => (h(), s(b(C), {
|
|
240
|
+
key: e.value,
|
|
241
|
+
value: e.value,
|
|
242
|
+
"text-value": e.label,
|
|
243
|
+
disabled: e.disabled,
|
|
244
|
+
class: m(Q("item"))
|
|
245
|
+
}, {
|
|
246
|
+
default: S(() => [d(b(w), { class: m($.value) }, {
|
|
247
|
+
default: S(() => [d(r, { icon: b(t) }, null, 8, ["icon"])]),
|
|
248
|
+
_: 1
|
|
249
|
+
}, 8, ["class"]), u(" " + y(e.label), 1)]),
|
|
250
|
+
_: 2
|
|
251
|
+
}, 1032, [
|
|
252
|
+
"value",
|
|
253
|
+
"text-value",
|
|
254
|
+
"disabled",
|
|
255
|
+
"class"
|
|
256
|
+
]))), 128))]),
|
|
257
|
+
K.value ? (h(), s(b(C), {
|
|
258
|
+
key: H.value,
|
|
259
|
+
value: H.value,
|
|
260
|
+
"data-create": "",
|
|
261
|
+
"text-value": H.value,
|
|
262
|
+
class: m(Q("item")),
|
|
263
|
+
onSelect: q
|
|
264
|
+
}, {
|
|
265
|
+
default: S(() => [v(n.$slots, "create", { query: H.value }, () => [u(y(N.createLabel(H.value.trim())), 1)])]),
|
|
266
|
+
_: 3
|
|
267
|
+
}, 8, [
|
|
268
|
+
"value",
|
|
269
|
+
"text-value",
|
|
270
|
+
"class"
|
|
271
|
+
])) : c("", !0)
|
|
272
|
+
]),
|
|
273
|
+
_: 3
|
|
274
|
+
}, 8, ["class"])]),
|
|
275
|
+
_: 3
|
|
276
|
+
}, 8, ["class"])]),
|
|
277
|
+
_: 3
|
|
278
|
+
})]),
|
|
279
|
+
_: 3
|
|
280
|
+
}, 16));
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
//#endregion
|
|
284
|
+
export { M as default };
|
package/dist/packages/iryx-ui/src/components/FormField.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -15,7 +15,6 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
|
|
|
15
15
|
help: {},
|
|
16
16
|
required: { type: Boolean },
|
|
17
17
|
error: {},
|
|
18
|
-
indent: {},
|
|
19
18
|
unstyled: {
|
|
20
19
|
type: Boolean,
|
|
21
20
|
default: void 0
|
|
@@ -36,9 +35,9 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
|
|
|
36
35
|
function A() {
|
|
37
36
|
!T.name || !E || E.validateOn.value.includes("blur") && E.validateField(T.name);
|
|
38
37
|
}
|
|
39
|
-
let j = e(), M = o(() => T.unstyled ?? j.unstyled), N =
|
|
38
|
+
let j = e(), M = o(() => T.unstyled ?? j.unstyled), N = i();
|
|
40
39
|
function P(e, t) {
|
|
41
|
-
return M.value ? t : N
|
|
40
|
+
return M.value ? t : N[e]({ class: t });
|
|
42
41
|
}
|
|
43
42
|
return m(t, {
|
|
44
43
|
id: o(() => D),
|
|
@@ -47,7 +46,7 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
|
|
|
47
46
|
describedBy: k
|
|
48
47
|
}), (e, t) => (p(), l("div", {
|
|
49
48
|
"data-iryx-field": T.name,
|
|
50
|
-
class: f(M.value ? T.class : N.
|
|
49
|
+
class: f(M.value ? T.class : _(N).root({ class: [T.ui?.root, T.class] })),
|
|
51
50
|
onFocusout: A
|
|
52
51
|
}, [
|
|
53
52
|
T.label || T.hint || e.$slots.hint ? (p(), l("div", {
|
|
@@ -57,7 +56,6 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
|
|
|
57
56
|
key: 0,
|
|
58
57
|
for: _(D),
|
|
59
58
|
required: T.required,
|
|
60
|
-
indent: "none",
|
|
61
59
|
class: f(T.ui?.label)
|
|
62
60
|
}, {
|
|
63
61
|
default: y(() => [u(g(T.label), 1)]),
|
|
@@ -7,7 +7,6 @@ var d = /*@__PURE__*/ i({
|
|
|
7
7
|
__name: "Label",
|
|
8
8
|
props: {
|
|
9
9
|
required: { type: Boolean },
|
|
10
|
-
indent: {},
|
|
11
10
|
unstyled: {
|
|
12
11
|
type: Boolean,
|
|
13
12
|
default: void 0
|
|
@@ -20,7 +19,6 @@ var d = /*@__PURE__*/ i({
|
|
|
20
19
|
setup(i) {
|
|
21
20
|
let d = i, f = e(), p = n(() => d.unstyled ?? f.unstyled), m = n(() => p.value ? d.class : t({
|
|
22
21
|
required: d.required,
|
|
23
|
-
indent: d.indent,
|
|
24
22
|
class: d.class
|
|
25
23
|
}));
|
|
26
24
|
return (e, t) => (o(), r(c(u), {
|
package/dist/packages/iryx-ui/src/components/NumberInput.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { ArrowDown01Icon as e, ArrowUp01Icon 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 { useFormField as i } from "../composables/form.js";
|
|
5
|
+
import { addDecimals as a, clampDecimal as o, compareDecimals as s, formatForLocale as c, isDecimal as l, parseFromLocale as u, roundDecimal as d, toEditable as f } from "../composables/decimal.js";
|
|
6
|
+
import { numberInputTheme as p } from "../theme/number-input.js";
|
|
7
|
+
import { computed as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createVNode as v, defineComponent as y, mergeModels as b, normalizeClass as x, openBlock as S, ref as C, unref as w, useModel as T, vModelText as E, watch as D, withDirectives as O, withKeys as k, withModifiers as A } from "vue";
|
|
8
|
+
//#region src/components/NumberInput.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var j = [
|
|
10
|
+
"id",
|
|
11
|
+
"aria-valuenow",
|
|
12
|
+
"aria-valuemin",
|
|
13
|
+
"aria-valuemax",
|
|
14
|
+
"placeholder",
|
|
15
|
+
"disabled",
|
|
16
|
+
"required",
|
|
17
|
+
"aria-invalid",
|
|
18
|
+
"aria-describedby"
|
|
19
|
+
], M = ["aria-label", "disabled"], N = ["aria-label", "disabled"], P = /*@__PURE__*/ y({
|
|
20
|
+
__name: "NumberInput",
|
|
21
|
+
props: /*@__PURE__*/ b({
|
|
22
|
+
min: {},
|
|
23
|
+
max: {},
|
|
24
|
+
step: { default: "1" },
|
|
25
|
+
precision: {},
|
|
26
|
+
locale: {},
|
|
27
|
+
stepper: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
size: {},
|
|
32
|
+
placeholder: {},
|
|
33
|
+
disabled: { type: Boolean },
|
|
34
|
+
required: { type: Boolean },
|
|
35
|
+
invalid: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
id: {},
|
|
40
|
+
incrementLabel: { default: "Increment" },
|
|
41
|
+
decrementLabel: { default: "Decrement" },
|
|
42
|
+
unstyled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: void 0
|
|
45
|
+
},
|
|
46
|
+
class: {},
|
|
47
|
+
ui: {}
|
|
48
|
+
}, {
|
|
49
|
+
modelValue: { default: "" },
|
|
50
|
+
modelModifiers: {}
|
|
51
|
+
}),
|
|
52
|
+
emits: ["update:modelValue"],
|
|
53
|
+
setup(y) {
|
|
54
|
+
let b = y, P = T(y, "modelValue"), F = i(), I = m(() => b.id ?? F?.id.value), L = m(() => b.invalid ?? F?.invalid.value ?? !1), R = n(), z = m(() => b.unstyled ?? R.unstyled), B = C(""), V = C(!1);
|
|
55
|
+
function H(e) {
|
|
56
|
+
return e ? b.locale ? c(e, b.locale, b.precision) : b.precision == null ? e : d(e, b.precision) ?? e : "";
|
|
57
|
+
}
|
|
58
|
+
D(() => P.value, (e) => {
|
|
59
|
+
V.value || (B.value = H(e));
|
|
60
|
+
}, { immediate: !0 });
|
|
61
|
+
function U(e) {
|
|
62
|
+
let t = e.trim();
|
|
63
|
+
if (!t) {
|
|
64
|
+
P.value = "", B.value = "";
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
let n = b.locale ? u(t, b.locale) : l(t) ? t : void 0;
|
|
68
|
+
if (n == null) {
|
|
69
|
+
B.value = H(P.value);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let r = o(n, b.min, b.max), i = b.precision == null ? r : d(r, b.precision) ?? r;
|
|
73
|
+
P.value = i, B.value = H(i);
|
|
74
|
+
}
|
|
75
|
+
function W() {
|
|
76
|
+
V.value = !0, B.value = f(P.value, b.locale);
|
|
77
|
+
}
|
|
78
|
+
function G() {
|
|
79
|
+
V.value = !1, U(B.value);
|
|
80
|
+
}
|
|
81
|
+
function K(e) {
|
|
82
|
+
let t = a(P.value || "0", e === 1 ? b.step : `-${b.step}`);
|
|
83
|
+
if (t == null) return;
|
|
84
|
+
let n = o(t, b.min, b.max), r = b.precision == null ? n : d(n, b.precision) ?? n;
|
|
85
|
+
P.value = r, B.value = V.value ? f(r, b.locale) : H(r);
|
|
86
|
+
}
|
|
87
|
+
let q = m(() => b.min != null && P.value !== "" && s(P.value, b.min) <= 0), J = m(() => b.max != null && P.value !== "" && s(P.value, b.max) >= 0), Y = m(() => p({
|
|
88
|
+
size: b.size,
|
|
89
|
+
invalid: L.value,
|
|
90
|
+
withStepper: b.stepper
|
|
91
|
+
}));
|
|
92
|
+
function X(e, t) {
|
|
93
|
+
let n = b.ui?.[e];
|
|
94
|
+
return z.value ? [n, t] : Y.value[e]({ class: [n, t] });
|
|
95
|
+
}
|
|
96
|
+
return (n, i) => (S(), g("div", { class: x(X("root")) }, [O(_("input", {
|
|
97
|
+
id: I.value,
|
|
98
|
+
"onUpdate:modelValue": i[0] ||= (e) => B.value = e,
|
|
99
|
+
type: "text",
|
|
100
|
+
inputmode: "decimal",
|
|
101
|
+
autocomplete: "off",
|
|
102
|
+
role: "spinbutton",
|
|
103
|
+
"aria-valuenow": P.value || void 0,
|
|
104
|
+
"aria-valuemin": b.min,
|
|
105
|
+
"aria-valuemax": b.max,
|
|
106
|
+
placeholder: b.placeholder,
|
|
107
|
+
disabled: b.disabled,
|
|
108
|
+
required: b.required,
|
|
109
|
+
"aria-invalid": L.value || void 0,
|
|
110
|
+
"aria-describedby": w(F)?.describedBy.value,
|
|
111
|
+
class: x(z.value ? [b.ui?.input, b.class] : Y.value.input({ class: [b.ui?.input, b.class] })),
|
|
112
|
+
onFocus: W,
|
|
113
|
+
onBlur: G,
|
|
114
|
+
onKeydown: [i[1] ||= k(A((e) => K(1), ["prevent"]), ["up"]), i[2] ||= k(A((e) => K(-1), ["prevent"]), ["down"])]
|
|
115
|
+
}, null, 42, j), [[E, B.value]]), b.stepper ? (S(), g("div", {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: x(X("stepper"))
|
|
118
|
+
}, [_("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
tabindex: "-1",
|
|
121
|
+
"aria-label": b.incrementLabel,
|
|
122
|
+
disabled: b.disabled || J.value,
|
|
123
|
+
class: x(X("step")),
|
|
124
|
+
onClick: i[3] ||= (e) => K(1)
|
|
125
|
+
}, [v(r, { icon: w(t) }, null, 8, ["icon"])], 10, M), _("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
tabindex: "-1",
|
|
128
|
+
"aria-label": b.decrementLabel,
|
|
129
|
+
disabled: b.disabled || q.value,
|
|
130
|
+
class: x(X("step")),
|
|
131
|
+
onClick: i[4] ||= (e) => K(-1)
|
|
132
|
+
}, [v(r, { icon: w(e) }, null, 8, ["icon"])], 10, N)], 2)) : h("", !0)], 2));
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
//#endregion
|
|
136
|
+
export { P as default };
|