iryx-ui 0.11.0 → 0.13.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 +35 -1235
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/Accordion.js +5 -0
- package/dist/components/Accordion.vue.d.ts +80 -0
- package/dist/components/Accordion.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/components/Alert.vue.d.ts +1 -1
- package/dist/components/Alert.vue_vue_type_script_setup_true_lang.js +43 -43
- package/dist/components/App.vue.d.ts +1 -1
- package/dist/components/AppShell.js +5 -0
- package/dist/components/AppShell.vue.d.ts +46 -0
- package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/AspectRatio.js +5 -0
- package/dist/components/AspectRatio.vue.d.ts +26 -0
- package/dist/components/AspectRatio.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/Avatar.js +5 -0
- package/dist/components/Avatar.vue.d.ts +52 -0
- package/dist/components/Avatar.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/AvatarGroup.js +5 -0
- package/dist/components/AvatarGroup.vue.d.ts +39 -0
- package/dist/components/AvatarGroup.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/Badge.vue.d.ts +1 -1
- package/dist/components/Banner.vue.d.ts +2 -2
- package/dist/components/Banner.vue_vue_type_script_setup_true_lang.js +40 -40
- package/dist/components/BarChart.vue.d.ts +1 -1
- package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/components/Button.vue.d.ts +2 -2
- package/dist/components/Button.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/components/Card.vue.d.ts +1 -1
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +37 -30
- package/dist/components/Collapsible.js +5 -0
- package/dist/components/Collapsible.vue.d.ts +58 -0
- package/dist/components/Collapsible.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/components/ColorPicker.js +5 -0
- package/dist/components/ColorPicker.vue.d.ts +49 -0
- package/dist/components/ColorPicker.vue_vue_type_script_setup_true_lang.js +172 -0
- package/dist/components/Combobox.vue.d.ts +6 -6
- package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +62 -60
- package/dist/components/CommandPalette.js +5 -0
- package/dist/components/CommandPalette.vue.d.ts +63 -0
- package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +185 -0
- package/dist/components/Container.js +5 -0
- package/dist/components/Container.vue.d.ts +33 -0
- package/dist/components/Container.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/ContextMenu.js +5 -0
- package/dist/components/ContextMenu.vue.d.ts +42 -0
- package/dist/components/ContextMenu.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/DatePicker.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/components/DateRangePicker.vue.d.ts +1 -1
- package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +74 -74
- package/dist/components/Dialog.vue.d.ts +1 -1
- package/dist/components/Dialog.vue_vue_type_script_setup_true_lang.js +34 -34
- package/dist/components/Drawer.js +5 -0
- package/dist/components/Drawer.vue.d.ts +94 -0
- package/dist/components/Drawer.vue_vue_type_script_setup_true_lang.js +144 -0
- package/dist/components/DropdownMenuItems.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/components/EmptyState.vue.d.ts +1 -1
- package/dist/components/FileUpload.vue_vue_type_script_setup_true_lang.js +77 -77
- package/dist/components/Icon.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/Input.vue.d.ts +1 -1
- package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +33 -33
- package/dist/components/Kbd.js +5 -0
- package/dist/components/Kbd.vue.d.ts +46 -0
- package/dist/components/Kbd.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/components/Menubar.js +5 -0
- package/dist/components/Menubar.vue.d.ts +62 -0
- package/dist/components/Menubar.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/NavigationMenu.js +5 -0
- package/dist/components/NavigationMenu.vue.d.ts +75 -0
- package/dist/components/NavigationMenu.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/NumberInput.vue_vue_type_script_setup_true_lang.js +68 -66
- package/dist/components/PageHeader.js +5 -0
- package/dist/components/PageHeader.vue.d.ts +52 -0
- package/dist/components/PageHeader.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/Pagination.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/components/PinInput.js +5 -0
- package/dist/components/PinInput.vue.d.ts +65 -0
- package/dist/components/PinInput.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/Popover.js +5 -0
- package/dist/components/Popover.vue.d.ts +75 -0
- package/dist/components/Popover.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/components/Progress.vue.d.ts +20 -1
- package/dist/components/Progress.vue_vue_type_script_setup_true_lang.js +85 -42
- package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/ScrollArea.js +5 -0
- package/dist/components/ScrollArea.vue.d.ts +41 -0
- package/dist/components/ScrollArea.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/ScrollFade.js +5 -0
- package/dist/components/ScrollFade.vue.d.ts +36 -0
- package/dist/components/ScrollFade.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/Select.vue.d.ts +2 -2
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +47 -45
- package/dist/components/Sidebar.js +5 -0
- package/dist/components/Sidebar.vue.d.ts +72 -0
- package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +183 -0
- package/dist/components/SignaturePad.js +5 -0
- package/dist/components/SignaturePad.vue.d.ts +60 -0
- package/dist/components/SignaturePad.vue_vue_type_script_setup_true_lang.js +158 -0
- package/dist/components/Skeleton.vue.d.ts +1 -1
- package/dist/components/Skeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/components/Slider.js +5 -0
- package/dist/components/Slider.vue.d.ts +80 -0
- package/dist/components/Slider.vue_vue_type_script_setup_true_lang.js +115 -0
- package/dist/components/Splitter.js +5 -0
- package/dist/components/Splitter.vue.d.ts +59 -0
- package/dist/components/Splitter.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/Stat.vue.d.ts +1 -1
- package/dist/components/Stat.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/components/Stepper.vue_vue_type_script_setup_true_lang.js +38 -38
- package/dist/components/Switch.vue.d.ts +1 -0
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +16 -5
- package/dist/components/Table.vue.d.ts +7 -1
- package/dist/components/Table.vue_vue_type_script_setup_true_lang.js +120 -105
- package/dist/components/TagsInput.js +5 -0
- package/dist/components/TagsInput.vue.d.ts +71 -0
- package/dist/components/TagsInput.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/TimeField.js +5 -0
- package/dist/components/TimeField.vue.d.ts +50 -0
- package/dist/components/TimeField.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/components/Timeline.js +5 -0
- package/dist/components/Timeline.vue.d.ts +61 -0
- package/dist/components/Timeline.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/Toaster.vue.d.ts +1 -1
- package/dist/components/Toaster.vue_vue_type_script_setup_true_lang.js +41 -41
- package/dist/components/Toggle.js +5 -0
- package/dist/components/Toggle.vue.d.ts +42 -0
- package/dist/components/Toggle.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/ToggleGroup.js +5 -0
- package/dist/components/ToggleGroup.vue.d.ts +64 -0
- package/dist/components/ToggleGroup.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/Toolbar.js +5 -0
- package/dist/components/Toolbar.vue.d.ts +52 -0
- package/dist/components/Toolbar.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/components/Tree.js +5 -0
- package/dist/components/Tree.vue.d.ts +70 -0
- package/dist/components/Tree.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/index.d.ts +30 -0
- package/dist/components/index.js +144 -84
- package/dist/composables/appearance.js +5 -1
- package/dist/composables/cartesian.d.ts +11 -0
- package/dist/composables/cartesian.js +18 -19
- package/dist/composables/command-palette.d.ts +42 -0
- package/dist/composables/command-palette.js +32 -0
- package/dist/composables/date.d.ts +18 -2
- package/dist/composables/date.js +23 -15
- package/dist/composables/kbd.d.ts +26 -0
- package/dist/composables/kbd.js +161 -0
- package/dist/composables/navigation-menu.d.ts +29 -0
- package/dist/composables/navigation-menu.js +6 -0
- package/dist/composables/scroll-fade.d.ts +35 -0
- package/dist/composables/scroll-fade.js +36 -0
- package/dist/composables/sidebar.d.ts +35 -0
- package/dist/composables/sidebar.js +23 -0
- package/dist/composables/signature.d.ts +22 -0
- package/dist/composables/signature.js +13 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +153 -92
- package/dist/theme/accordion.d.ts +68 -0
- package/dist/theme/accordion.js +24 -0
- package/dist/theme/alert.d.ts +0 -3
- package/dist/theme/app-shell.d.ts +77 -0
- package/dist/theme/app-shell.js +35 -0
- package/dist/theme/avatar.d.ts +253 -0
- package/dist/theme/avatar.js +84 -0
- package/dist/theme/banner.d.ts +0 -9
- package/dist/theme/bar-chart.d.ts +0 -16
- package/dist/theme/breadcrumb.d.ts +3 -3
- package/dist/theme/button-group.d.ts +0 -3
- package/dist/theme/button.d.ts +0 -3
- package/dist/theme/card.js +2 -2
- package/dist/theme/chart-legend.d.ts +3 -11
- package/dist/theme/collapsible.d.ts +44 -0
- package/dist/theme/collapsible.js +17 -0
- package/dist/theme/color-picker.d.ts +98 -0
- package/dist/theme/color-picker.js +19 -0
- package/dist/theme/command-palette.d.ts +122 -0
- package/dist/theme/command-palette.js +22 -0
- package/dist/theme/container.d.ts +101 -0
- package/dist/theme/container.js +26 -0
- package/dist/theme/date-picker.d.ts +12 -0
- package/dist/theme/date-picker.js +1 -1
- package/dist/theme/drawer.d.ts +110 -0
- package/dist/theme/drawer.js +100 -0
- package/dist/theme/dropdown-menu.d.ts +0 -9
- package/dist/theme/file-upload.d.ts +0 -3
- package/dist/theme/form.d.ts +12 -12
- package/dist/theme/index.d.ts +26 -0
- package/dist/theme/kbd.d.ts +71 -0
- package/dist/theme/kbd.js +29 -0
- package/dist/theme/line-chart.d.ts +0 -9
- package/dist/theme/menubar.d.ts +29 -0
- package/dist/theme/menubar.js +11 -0
- package/dist/theme/navigation-menu.d.ts +161 -0
- package/dist/theme/navigation-menu.js +43 -0
- package/dist/theme/number-input.d.ts +0 -3
- package/dist/theme/page-header.d.ts +47 -0
- package/dist/theme/page-header.js +17 -0
- package/dist/theme/pagination.d.ts +0 -3
- package/dist/theme/pin-input.d.ts +86 -0
- package/dist/theme/pin-input.js +32 -0
- package/dist/theme/popover.d.ts +119 -0
- package/dist/theme/popover.js +31 -0
- package/dist/theme/presets.d.ts +0 -2
- package/dist/theme/progress.d.ts +93 -0
- package/dist/theme/progress.js +37 -7
- package/dist/theme/radio-group.d.ts +24 -0
- package/dist/theme/radio-group.js +23 -14
- package/dist/theme/scroll-area.d.ts +65 -0
- package/dist/theme/scroll-area.js +57 -0
- package/dist/theme/scroll-fade.d.ts +35 -0
- package/dist/theme/scroll-fade.js +12 -0
- package/dist/theme/sidebar.d.ts +167 -0
- package/dist/theme/sidebar.js +43 -0
- package/dist/theme/signature-pad.d.ts +50 -0
- package/dist/theme/signature-pad.js +17 -0
- package/dist/theme/slider.d.ts +128 -0
- package/dist/theme/slider.js +49 -0
- package/dist/theme/sparkline.d.ts +0 -6
- package/dist/theme/splitter.d.ts +59 -0
- package/dist/theme/splitter.js +25 -0
- package/dist/theme/stat.d.ts +0 -3
- package/dist/theme/stepper.js +2 -2
- package/dist/theme/switch.d.ts +53 -29
- package/dist/theme/switch.js +33 -8
- package/dist/theme/table.d.ts +51 -3
- package/dist/theme/table.js +8 -3
- package/dist/theme/tabs.d.ts +0 -3
- package/dist/theme/tags-input.d.ts +110 -0
- package/dist/theme/tags-input.js +42 -0
- package/dist/theme/time-field.d.ts +68 -0
- package/dist/theme/time-field.js +21 -0
- package/dist/theme/timeline.d.ts +182 -0
- package/dist/theme/timeline.js +83 -0
- package/dist/theme/toggle.d.ts +145 -0
- package/dist/theme/toggle.js +84 -0
- package/dist/theme/toolbar.d.ts +56 -0
- package/dist/theme/toolbar.js +21 -0
- package/dist/theme/tree.d.ts +68 -0
- package/dist/theme/tree.js +28 -0
- package/package.json +4 -3
- package/theme.css +335 -0
- package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +0 -377
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/_virtual/_plugin-vue_export-helper.js +0 -8
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/components/HugeiconsIcon.vue.js +0 -25
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/components/HugeiconsIcon.vue2.js +0 -63
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js +0 -122
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/DateFormatter.js +0 -84
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +0 -91
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js +0 -107
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js +0 -159
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js +0 -29
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js +0 -37
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js +0 -6
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { useAppearance as n } from "../composables/appearance.js";
|
|
4
|
+
import { useFormField as r } from "../composables/form.js";
|
|
5
|
+
import { hasInk as i, strokeWidth as a } from "../composables/signature.js";
|
|
6
|
+
import { signaturePadTheme as o } from "../theme/signature-pad.js";
|
|
7
|
+
import { computed as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, unref as v, watch as ee } from "vue";
|
|
8
|
+
import { ArrowTurnBackwardIcon as y, Delete02Icon as b } from "@hugeicons/core-free-icons";
|
|
9
|
+
//#region src/components/SignaturePad.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var x = [
|
|
11
|
+
"id",
|
|
12
|
+
"aria-label",
|
|
13
|
+
"aria-describedby"
|
|
14
|
+
], S = [
|
|
15
|
+
"aria-label",
|
|
16
|
+
"title",
|
|
17
|
+
"disabled"
|
|
18
|
+
], C = [
|
|
19
|
+
"aria-label",
|
|
20
|
+
"title",
|
|
21
|
+
"disabled"
|
|
22
|
+
], w = /*@__PURE__*/ d({
|
|
23
|
+
__name: "SignaturePad",
|
|
24
|
+
props: {
|
|
25
|
+
modelValue: {},
|
|
26
|
+
height: { default: 160 },
|
|
27
|
+
penColor: { default: "currentColor" },
|
|
28
|
+
penWidth: { default: 2 },
|
|
29
|
+
undoLabel: { default: "Undo last stroke" },
|
|
30
|
+
clearLabel: { default: "Clear signature" },
|
|
31
|
+
ariaLabel: { default: "Signature" },
|
|
32
|
+
disabled: { type: Boolean },
|
|
33
|
+
invalid: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
id: {},
|
|
38
|
+
unstyled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
class: {},
|
|
43
|
+
ui: {}
|
|
44
|
+
},
|
|
45
|
+
emits: [
|
|
46
|
+
"update:modelValue",
|
|
47
|
+
"start",
|
|
48
|
+
"end",
|
|
49
|
+
"clear"
|
|
50
|
+
],
|
|
51
|
+
setup(d, { expose: w, emit: T }) {
|
|
52
|
+
let E = d, D = T, O = _(), k = _([]), A = !1, j = 0, M = () => k.value.at(-1), N = r(), P = s(() => E.id ?? N?.id.value), F = s(() => E.invalid ?? N?.invalid.value ?? !1), I = s(() => !i(k.value));
|
|
53
|
+
function L() {
|
|
54
|
+
if (E.penColor !== "currentColor") return E.penColor;
|
|
55
|
+
let e = O.value;
|
|
56
|
+
return e ? getComputedStyle(e).color : "#000000";
|
|
57
|
+
}
|
|
58
|
+
function R() {
|
|
59
|
+
let e = O.value;
|
|
60
|
+
if (!e) return;
|
|
61
|
+
let t = window.devicePixelRatio || 1, n = e.clientWidth;
|
|
62
|
+
if (!n) return;
|
|
63
|
+
e.width = Math.round(n * t), e.height = Math.round(E.height * t);
|
|
64
|
+
let r = e.getContext("2d");
|
|
65
|
+
r && (r.scale(t, t), z());
|
|
66
|
+
}
|
|
67
|
+
function z() {
|
|
68
|
+
let e = O.value, t = e?.getContext("2d");
|
|
69
|
+
if (!e || !t) return;
|
|
70
|
+
let n = window.devicePixelRatio || 1;
|
|
71
|
+
t.clearRect(0, 0, e.width / n, e.height / n), t.strokeStyle = L(), t.lineCap = "round", t.lineJoin = "round";
|
|
72
|
+
for (let e of k.value) for (let n = 1; n < e.length; n++) {
|
|
73
|
+
let r = e[n - 1], i = e[n];
|
|
74
|
+
t.beginPath(), t.lineWidth = a(E.penWidth, r, i), t.moveTo(r.x, r.y), t.lineTo(i.x, i.y), t.stroke();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function B() {
|
|
78
|
+
return I.value ? null : O.value?.toDataURL("image/png") ?? null;
|
|
79
|
+
}
|
|
80
|
+
function V() {
|
|
81
|
+
let e = B();
|
|
82
|
+
D("update:modelValue", e), D("end", e);
|
|
83
|
+
}
|
|
84
|
+
function H(e) {
|
|
85
|
+
let t = O.value.getBoundingClientRect();
|
|
86
|
+
return {
|
|
87
|
+
x: e.clientX - t.left,
|
|
88
|
+
y: e.clientY - t.top,
|
|
89
|
+
t: performance.now() - j,
|
|
90
|
+
pressure: e.pressure > 0 ? e.pressure : .5
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function U(e) {
|
|
94
|
+
E.disabled || (O.value?.setPointerCapture(e.pointerId), j = performance.now(), A = !0, k.value = [...k.value, [H(e)]], D("start"));
|
|
95
|
+
}
|
|
96
|
+
function W(e) {
|
|
97
|
+
A && (M()?.push(H(e)), z());
|
|
98
|
+
}
|
|
99
|
+
function G(e) {
|
|
100
|
+
A && (O.value?.releasePointerCapture(e.pointerId), A = !1, z(), V());
|
|
101
|
+
}
|
|
102
|
+
function K() {
|
|
103
|
+
k.value.length && (k.value = k.value.slice(0, -1), z(), V());
|
|
104
|
+
}
|
|
105
|
+
function q() {
|
|
106
|
+
k.value = [], z(), D("update:modelValue", null), D("clear");
|
|
107
|
+
}
|
|
108
|
+
let { isDark: J } = n();
|
|
109
|
+
ee(J, z);
|
|
110
|
+
let Y;
|
|
111
|
+
h(() => {
|
|
112
|
+
R(), Y = new ResizeObserver(R), O.value && Y.observe(O.value);
|
|
113
|
+
}), m(() => Y?.disconnect()), w({
|
|
114
|
+
clear: q,
|
|
115
|
+
undo: K,
|
|
116
|
+
isEmpty: I,
|
|
117
|
+
toDataUrl: B
|
|
118
|
+
});
|
|
119
|
+
let X = e(), Z = s(() => E.unstyled ?? X.unstyled), Q = s(() => o({
|
|
120
|
+
invalid: F.value,
|
|
121
|
+
disabled: E.disabled
|
|
122
|
+
}));
|
|
123
|
+
function $(e, t) {
|
|
124
|
+
let n = [E.ui?.[e], t].filter(Boolean).join(" ");
|
|
125
|
+
return Z.value ? n : Q.value[e]({ class: n });
|
|
126
|
+
}
|
|
127
|
+
return (e, n) => (g(), c("div", { class: f($("root", E.class)) }, [l("canvas", {
|
|
128
|
+
id: P.value,
|
|
129
|
+
ref_key: "canvas",
|
|
130
|
+
ref: O,
|
|
131
|
+
role: "img",
|
|
132
|
+
"aria-label": E.ariaLabel,
|
|
133
|
+
"aria-describedby": v(N)?.describedBy.value,
|
|
134
|
+
style: p({ height: `${E.height}px` }),
|
|
135
|
+
class: f($("canvas")),
|
|
136
|
+
onPointerdown: U,
|
|
137
|
+
onPointermove: W,
|
|
138
|
+
onPointerup: G,
|
|
139
|
+
onPointercancel: G
|
|
140
|
+
}, null, 46, x), l("div", { class: f($("actions")) }, [l("button", {
|
|
141
|
+
type: "button",
|
|
142
|
+
"aria-label": E.undoLabel,
|
|
143
|
+
title: E.undoLabel,
|
|
144
|
+
disabled: E.disabled || !k.value.length,
|
|
145
|
+
class: f($("action")),
|
|
146
|
+
onClick: K
|
|
147
|
+
}, [u(t, { icon: v(y) }, null, 8, ["icon"])], 10, S), l("button", {
|
|
148
|
+
type: "button",
|
|
149
|
+
"aria-label": E.clearLabel,
|
|
150
|
+
title: E.clearLabel,
|
|
151
|
+
disabled: E.disabled || I.value,
|
|
152
|
+
class: f($("action")),
|
|
153
|
+
onClick: q
|
|
154
|
+
}, [u(t, { icon: v(b) }, null, 8, ["icon"])], 10, C)], 2)], 2));
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
//#endregion
|
|
158
|
+
export { w as default };
|
|
@@ -11,8 +11,8 @@ export interface SkeletonProps {
|
|
|
11
11
|
class?: string;
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<SkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
|
|
14
|
-
as: string;
|
|
15
14
|
unstyled: boolean;
|
|
15
|
+
as: string;
|
|
16
16
|
label: string;
|
|
17
17
|
lines: number;
|
|
18
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -17,26 +17,26 @@ var f = ["aria-label"], p = /*@__PURE__*/ o({
|
|
|
17
17
|
class: {}
|
|
18
18
|
},
|
|
19
19
|
setup(o) {
|
|
20
|
-
let p = o, m = e(), h = r(() => p.unstyled ?? m.unstyled), g = r(() => h.value ? p.class : t({
|
|
20
|
+
let p = o, m = e(), h = r(() => p.unstyled ?? m.unstyled), g = r(() => Math.max(1, p.lines)), _ = r(() => h.value ? void 0 : t({ variant: p.variant })), v = r(() => h.value || g.value > 1 ? p.class : t({
|
|
21
21
|
variant: p.variant,
|
|
22
22
|
class: p.class
|
|
23
|
-
}))
|
|
24
|
-
return (e, t) =>
|
|
23
|
+
}));
|
|
24
|
+
return (e, t) => g.value > 1 ? (c(), a("div", {
|
|
25
25
|
key: 0,
|
|
26
26
|
role: "status",
|
|
27
27
|
"aria-label": p.label,
|
|
28
|
-
class: "flex w-full flex-col gap-2"
|
|
29
|
-
}, [(c(!0), a(n, null, l(
|
|
28
|
+
class: s([h.value ? void 0 : "flex w-full flex-col gap-2", v.value])
|
|
29
|
+
}, [(c(!0), a(n, null, l(g.value, (e) => (c(), i(u(d), {
|
|
30
30
|
key: e,
|
|
31
31
|
as: p.as,
|
|
32
|
-
class: s(
|
|
32
|
+
class: s(_.value),
|
|
33
33
|
"aria-hidden": "true"
|
|
34
|
-
}, null, 8, ["as", "class"]))), 128))],
|
|
34
|
+
}, null, 8, ["as", "class"]))), 128))], 10, f)) : (c(), i(u(d), {
|
|
35
35
|
key: 1,
|
|
36
36
|
as: p.as,
|
|
37
37
|
role: "status",
|
|
38
38
|
"aria-label": p.label,
|
|
39
|
-
class: s(
|
|
39
|
+
class: s(v.value)
|
|
40
40
|
}, null, 8, [
|
|
41
41
|
"as",
|
|
42
42
|
"aria-label",
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { SliderRootProps } from 'reka-ui';
|
|
2
|
+
export interface SliderProps extends /* @vue-ignore */ Omit<SliderRootProps, 'modelValue' | 'defaultValue'> {
|
|
3
|
+
/**
|
|
4
|
+
* A single number for one thumb, an array for a range. Whichever shape you
|
|
5
|
+
* pass back is the shape you get out, so `v-model` on a plain `ref(50)`
|
|
6
|
+
* stays a number instead of silently becoming `[50]`.
|
|
7
|
+
*/
|
|
8
|
+
modelValue?: number | number[] | null;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
inverted?: boolean;
|
|
15
|
+
/** Keeps range thumbs from crossing or stacking. */
|
|
16
|
+
minStepsBetweenThumbs?: number;
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
/** Text shown above the track. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Show the current value beside the label. */
|
|
21
|
+
showValue?: boolean;
|
|
22
|
+
/** Show `min` and `max` captions under the track. Horizontal only. */
|
|
23
|
+
showScale?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Format the displayed value, the scale captions and each thumb's
|
|
26
|
+
* accessible label. Override for units or non-English locales.
|
|
27
|
+
*/
|
|
28
|
+
formatValue?: (value: number) => string;
|
|
29
|
+
/**
|
|
30
|
+
* How each thumb of a range is named after the label — "Price minimum",
|
|
31
|
+
* "Price maximum". Override for non-English locales.
|
|
32
|
+
*/
|
|
33
|
+
rangeLabels?: [string, string];
|
|
34
|
+
id?: string;
|
|
35
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
36
|
+
unstyled?: boolean;
|
|
37
|
+
class?: string;
|
|
38
|
+
/** Override classes per slot, e.g. `{ thumb: 'size-6' }`. */
|
|
39
|
+
ui?: {
|
|
40
|
+
root?: string;
|
|
41
|
+
header?: string;
|
|
42
|
+
label?: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
slider?: string;
|
|
45
|
+
track?: string;
|
|
46
|
+
range?: string;
|
|
47
|
+
thumb?: string;
|
|
48
|
+
scale?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
declare var __VLS_1: {}, __VLS_3: {
|
|
52
|
+
values: number[];
|
|
53
|
+
text: string;
|
|
54
|
+
};
|
|
55
|
+
type __VLS_Slots = {} & {
|
|
56
|
+
label?: (props: typeof __VLS_1) => any;
|
|
57
|
+
} & {
|
|
58
|
+
value?: (props: typeof __VLS_3) => any;
|
|
59
|
+
};
|
|
60
|
+
declare const __VLS_base: import("vue").DefineComponent<SliderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
+
"update:modelValue": (value: number | number[]) => any;
|
|
62
|
+
valueCommit: (value: number | number[]) => any;
|
|
63
|
+
}, string, import("vue").PublicProps, Readonly<SliderProps> & Readonly<{
|
|
64
|
+
"onUpdate:modelValue"?: ((value: number | number[]) => any) | undefined;
|
|
65
|
+
onValueCommit?: ((value: number | number[]) => any) | undefined;
|
|
66
|
+
}>, {
|
|
67
|
+
unstyled: boolean;
|
|
68
|
+
max: number;
|
|
69
|
+
step: number;
|
|
70
|
+
min: number;
|
|
71
|
+
rangeLabels: [string, string];
|
|
72
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
73
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
74
|
+
declare const _default: typeof __VLS_export;
|
|
75
|
+
export default _default;
|
|
76
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
77
|
+
new (): {
|
|
78
|
+
$slots: S;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import { sliderTheme as t } from "../theme/slider.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, openBlock as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
|
|
4
|
+
import { SliderRange as y, SliderRoot as b, SliderThumb as x, SliderTrack as S, useId as C } from "reka-ui";
|
|
5
|
+
//#region src/components/Slider.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var w = ["id"], T = /*@__PURE__*/ u({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "Slider",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {},
|
|
11
|
+
min: { default: 0 },
|
|
12
|
+
max: { default: 100 },
|
|
13
|
+
step: { default: 1 },
|
|
14
|
+
disabled: { type: Boolean },
|
|
15
|
+
orientation: {},
|
|
16
|
+
inverted: { type: Boolean },
|
|
17
|
+
minStepsBetweenThumbs: {},
|
|
18
|
+
size: {},
|
|
19
|
+
label: {},
|
|
20
|
+
showValue: { type: Boolean },
|
|
21
|
+
showScale: { type: Boolean },
|
|
22
|
+
formatValue: {},
|
|
23
|
+
rangeLabels: { default: () => ["minimum", "maximum"] },
|
|
24
|
+
id: {},
|
|
25
|
+
unstyled: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: void 0
|
|
28
|
+
},
|
|
29
|
+
class: {},
|
|
30
|
+
ui: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["update:modelValue", "valueCommit"],
|
|
33
|
+
setup(u, { emit: T }) {
|
|
34
|
+
let E = u, D = T, O = r(() => typeof E.modelValue == "number"), k = r(() => Array.isArray(E.modelValue) ? E.modelValue : typeof E.modelValue == "number" ? [E.modelValue] : [E.min]);
|
|
35
|
+
function A(e) {
|
|
36
|
+
return O.value ? e[0] ?? E.min : e;
|
|
37
|
+
}
|
|
38
|
+
let j = r(() => E.formatValue ?? ((e) => String(e))), M = r(() => k.value.map((e) => j.value(e)).join(" – "));
|
|
39
|
+
function N(e, t) {
|
|
40
|
+
return E.label ? k.value.length > 1 ? `${E.label} ${E.rangeLabels[e] ?? ""}`.trim() : E.label : k.value.length > 1 ? E.rangeLabels[e] ?? void 0 : j.value(t);
|
|
41
|
+
}
|
|
42
|
+
let P = C(), F = r(() => `${E.id ?? P}-label`), I = r(() => !!(E.label || E.showValue)), L = e(), R = r(() => E.unstyled ?? L.unstyled), z = r(() => t({
|
|
43
|
+
orientation: E.orientation,
|
|
44
|
+
size: E.size,
|
|
45
|
+
disabled: E.disabled ?? !1
|
|
46
|
+
}));
|
|
47
|
+
function B(e, t) {
|
|
48
|
+
let n = [E.ui?.[e], t];
|
|
49
|
+
return R.value ? n : z.value[e]({ class: n });
|
|
50
|
+
}
|
|
51
|
+
return (e, t) => (p(), o("div", { class: f(B("root", E.class)) }, [
|
|
52
|
+
I.value ? (p(), o("div", {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: f(B("header"))
|
|
55
|
+
}, [E.label || e.$slots.label ? (p(), o("span", {
|
|
56
|
+
key: 0,
|
|
57
|
+
id: F.value,
|
|
58
|
+
class: f(B("label"))
|
|
59
|
+
}, [h(e.$slots, "label", {}, () => [c(g(E.label), 1)])], 10, w)) : a("", !0), E.showValue ? (p(), o("span", {
|
|
60
|
+
key: 1,
|
|
61
|
+
class: f(B("value"))
|
|
62
|
+
}, [h(e.$slots, "value", {
|
|
63
|
+
values: k.value,
|
|
64
|
+
text: M.value
|
|
65
|
+
}, () => [c(g(M.value), 1)])], 2)) : a("", !0)], 2)) : a("", !0),
|
|
66
|
+
l(_(b), d({
|
|
67
|
+
"model-value": k.value,
|
|
68
|
+
min: E.min,
|
|
69
|
+
max: E.max,
|
|
70
|
+
step: E.step,
|
|
71
|
+
disabled: E.disabled,
|
|
72
|
+
orientation: E.orientation,
|
|
73
|
+
inverted: E.inverted,
|
|
74
|
+
"min-steps-between-thumbs": E.minStepsBetweenThumbs,
|
|
75
|
+
"aria-labelledby": E.label ? F.value : void 0
|
|
76
|
+
}, e.$attrs, {
|
|
77
|
+
class: B("slider"),
|
|
78
|
+
"onUpdate:modelValue": t[0] ||= (e) => e && D("update:modelValue", A(e)),
|
|
79
|
+
onValueCommit: t[1] ||= (e) => D("valueCommit", A(e))
|
|
80
|
+
}), {
|
|
81
|
+
default: v(() => [l(_(S), { class: f(B("track")) }, {
|
|
82
|
+
default: v(() => [l(_(y), { class: f(B("range")) }, null, 8, ["class"])]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["class"]), (p(!0), o(n, null, m(k.value, (e, t) => (p(), i(_(x), {
|
|
85
|
+
key: t,
|
|
86
|
+
"aria-label": N(t, e),
|
|
87
|
+
"aria-valuetext": j.value(e),
|
|
88
|
+
class: f(B("thumb"))
|
|
89
|
+
}, null, 8, [
|
|
90
|
+
"aria-label",
|
|
91
|
+
"aria-valuetext",
|
|
92
|
+
"class"
|
|
93
|
+
]))), 128))]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 16, [
|
|
96
|
+
"model-value",
|
|
97
|
+
"min",
|
|
98
|
+
"max",
|
|
99
|
+
"step",
|
|
100
|
+
"disabled",
|
|
101
|
+
"orientation",
|
|
102
|
+
"inverted",
|
|
103
|
+
"min-steps-between-thumbs",
|
|
104
|
+
"aria-labelledby",
|
|
105
|
+
"class"
|
|
106
|
+
]),
|
|
107
|
+
E.showScale && E.orientation !== "vertical" ? (p(), o("div", {
|
|
108
|
+
key: 1,
|
|
109
|
+
class: f(B("scale"))
|
|
110
|
+
}, [s("span", null, g(j.value(E.min)), 1), s("span", null, g(j.value(E.max)), 1)], 2)) : a("", !0)
|
|
111
|
+
], 2));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
//#endregion
|
|
115
|
+
export { T as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface SplitterPanelOption {
|
|
2
|
+
/** Starting size, as a percentage of the group. */
|
|
3
|
+
size?: number;
|
|
4
|
+
minSize?: number;
|
|
5
|
+
maxSize?: number;
|
|
6
|
+
/** Allow dragging past `minSize` to collapse the panel entirely. */
|
|
7
|
+
collapsible?: boolean;
|
|
8
|
+
/** What "collapsed" means, as a percentage. `0` hides the panel. */
|
|
9
|
+
collapsedSize?: number;
|
|
10
|
+
/** Identifies the panel; needed when panels are conditionally rendered. */
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SplitterProps {
|
|
14
|
+
/** One entry per panel. Two by default, split evenly. */
|
|
15
|
+
panels?: SplitterPanelOption[];
|
|
16
|
+
direction?: 'horizontal' | 'vertical';
|
|
17
|
+
/**
|
|
18
|
+
* Remember the arrangement under this key, so a reader's layout survives a
|
|
19
|
+
* reload. Stored in `localStorage`.
|
|
20
|
+
*/
|
|
21
|
+
autoSaveId?: string;
|
|
22
|
+
/** How far each arrow key press moves the handle, as a percentage. */
|
|
23
|
+
keyboardResizeBy?: number;
|
|
24
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
25
|
+
unstyled?: boolean;
|
|
26
|
+
class?: string;
|
|
27
|
+
/** Override classes per slot, e.g. `{ rule: 'bg-primary' }`. */
|
|
28
|
+
ui?: {
|
|
29
|
+
root?: string;
|
|
30
|
+
panel?: string;
|
|
31
|
+
handle?: string;
|
|
32
|
+
rule?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
declare var __VLS_16: {}, __VLS_25: `panel-${number}`, __VLS_26: {
|
|
36
|
+
panel: SplitterPanelOption;
|
|
37
|
+
index: number;
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Slots = {} & {
|
|
40
|
+
[K in NonNullable<typeof __VLS_25>]?: (props: typeof __VLS_26) => any;
|
|
41
|
+
} & {
|
|
42
|
+
handle?: (props: typeof __VLS_16) => any;
|
|
43
|
+
};
|
|
44
|
+
declare const __VLS_base: import("vue").DefineComponent<SplitterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
+
layout: (sizes: number[]) => any;
|
|
46
|
+
}, string, import("vue").PublicProps, Readonly<SplitterProps> & Readonly<{
|
|
47
|
+
onLayout?: ((sizes: number[]) => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
unstyled: boolean;
|
|
50
|
+
direction: "horizontal" | "vertical";
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
52
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import { splitterTheme as t } from "../theme/splitter.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, unref as m, withCtx as h } from "vue";
|
|
4
|
+
import { SplitterGroup as g, SplitterPanel as _, SplitterResizeHandle as v } from "reka-ui";
|
|
5
|
+
//#region src/components/Splitter.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var y = /*@__PURE__*/ l({
|
|
7
|
+
__name: "Splitter",
|
|
8
|
+
props: {
|
|
9
|
+
panels: {},
|
|
10
|
+
direction: { default: "horizontal" },
|
|
11
|
+
autoSaveId: {},
|
|
12
|
+
keyboardResizeBy: {},
|
|
13
|
+
unstyled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: void 0
|
|
16
|
+
},
|
|
17
|
+
class: {},
|
|
18
|
+
ui: {}
|
|
19
|
+
},
|
|
20
|
+
emits: ["layout"],
|
|
21
|
+
setup(l, { emit: y }) {
|
|
22
|
+
let b = l, x = y, S = r(() => b.panels?.length ? b.panels : [{}, {}]), C = e(), w = r(() => b.unstyled ?? C.unstyled), T = r(() => t({ direction: b.direction })), E = r(() => w.value ? [b.ui?.root, b.class] : T.value.root({ class: [b.ui?.root, b.class] })), D = r(() => w.value ? b.ui?.panel : T.value.panel({ class: b.ui?.panel })), O = r(() => w.value ? b.ui?.handle : T.value.handle({ class: b.ui?.handle })), k = r(() => w.value ? b.ui?.rule : T.value.rule({ class: b.ui?.rule }));
|
|
23
|
+
return (e, t) => (d(), i(m(g), {
|
|
24
|
+
direction: b.direction,
|
|
25
|
+
"auto-save-id": b.autoSaveId,
|
|
26
|
+
"keyboard-resize-by": b.keyboardResizeBy,
|
|
27
|
+
class: u(E.value),
|
|
28
|
+
onLayout: t[0] ||= (e) => x("layout", e)
|
|
29
|
+
}, {
|
|
30
|
+
default: h(() => [(d(!0), o(n, null, f(S.value, (t, r) => (d(), o(n, { key: t.id ?? r }, [r > 0 ? (d(), i(m(v), {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: u(O.value)
|
|
33
|
+
}, {
|
|
34
|
+
default: h(() => [p(e.$slots, "handle", {}, () => [s("span", { class: u(k.value) }, null, 2)])]),
|
|
35
|
+
_: 3
|
|
36
|
+
}, 8, ["class"])) : a("", !0), c(m(_), {
|
|
37
|
+
id: t.id,
|
|
38
|
+
"default-size": t.size,
|
|
39
|
+
"min-size": t.minSize,
|
|
40
|
+
"max-size": t.maxSize,
|
|
41
|
+
collapsible: t.collapsible,
|
|
42
|
+
"collapsed-size": t.collapsedSize,
|
|
43
|
+
class: u(D.value)
|
|
44
|
+
}, {
|
|
45
|
+
default: h(() => [p(e.$slots, `panel-${r}`, {
|
|
46
|
+
panel: t,
|
|
47
|
+
index: r
|
|
48
|
+
})]),
|
|
49
|
+
_: 2
|
|
50
|
+
}, 1032, [
|
|
51
|
+
"id",
|
|
52
|
+
"default-size",
|
|
53
|
+
"min-size",
|
|
54
|
+
"max-size",
|
|
55
|
+
"collapsible",
|
|
56
|
+
"collapsed-size",
|
|
57
|
+
"class"
|
|
58
|
+
])], 64))), 128))]),
|
|
59
|
+
_: 3
|
|
60
|
+
}, 8, [
|
|
61
|
+
"direction",
|
|
62
|
+
"auto-save-id",
|
|
63
|
+
"keyboard-resize-by",
|
|
64
|
+
"class"
|
|
65
|
+
]));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
//#endregion
|
|
69
|
+
export { y as default };
|
|
@@ -44,8 +44,8 @@ type __VLS_Slots = {} & {
|
|
|
44
44
|
hint?: (props: typeof __VLS_19) => any;
|
|
45
45
|
};
|
|
46
46
|
declare const __VLS_base: import("vue").DefineComponent<StatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<StatProps> & Readonly<{}>, {
|
|
47
|
-
as: string;
|
|
48
47
|
unstyled: boolean;
|
|
48
|
+
as: string;
|
|
49
49
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
50
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
51
51
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { statTheme as n } from "../theme/stat.js";
|
|
4
|
+
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
|
|
5
|
+
import { ArrowDown01Icon as _, ArrowRight01Icon as v, ArrowUp01Icon as y } from "@hugeicons/core-free-icons";
|
|
6
6
|
import { Primitive as b } from "reka-ui";
|
|
7
7
|
//#region src/components/Stat.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var x = /*@__PURE__*/
|
|
8
|
+
var x = /*@__PURE__*/ u({
|
|
9
9
|
__name: "Stat",
|
|
10
10
|
props: {
|
|
11
11
|
as: { default: "div" },
|
|
@@ -23,37 +23,37 @@ var x = /*@__PURE__*/ p({
|
|
|
23
23
|
class: {},
|
|
24
24
|
ui: {}
|
|
25
25
|
},
|
|
26
|
-
setup(
|
|
27
|
-
let x =
|
|
28
|
-
up:
|
|
29
|
-
down:
|
|
30
|
-
neutral:
|
|
31
|
-
})[S.value]), w =
|
|
26
|
+
setup(u) {
|
|
27
|
+
let x = u, S = r(() => x.trend ? x.trend : x.delta == null || x.delta === 0 ? "neutral" : x.delta > 0 ? "up" : "down"), C = r(() => ({
|
|
28
|
+
up: y,
|
|
29
|
+
down: _,
|
|
30
|
+
neutral: v
|
|
31
|
+
})[S.value]), w = r(() => {
|
|
32
32
|
if (x.delta != null) return x.formatDelta ? x.formatDelta(x.delta) : `${x.delta > 0 ? "+" : ""}${x.delta}%`;
|
|
33
|
-
}), T =
|
|
33
|
+
}), T = e(), E = r(() => x.unstyled ?? T.unstyled), D = r(() => n({
|
|
34
34
|
size: x.size,
|
|
35
35
|
trend: S.value
|
|
36
|
-
})), O =
|
|
37
|
-
return (e,
|
|
36
|
+
})), O = r(() => E.value ? [x.ui?.root, x.class] : D.value.root({ class: [x.ui?.root, x.class] })), k = r(() => E.value ? x.ui?.label : D.value.label({ class: x.ui?.label })), A = r(() => E.value ? x.ui?.value : D.value.value({ class: x.ui?.value })), j = r(() => E.value ? x.ui?.delta : D.value.delta({ class: x.ui?.delta })), M = r(() => E.value ? x.ui?.hint : D.value.hint({ class: x.ui?.hint })), N = r(() => E.value ? x.ui?.row : D.value.row({ class: x.ui?.row }));
|
|
37
|
+
return (e, n) => (f(), i(h(b), {
|
|
38
38
|
as: x.as,
|
|
39
|
-
class:
|
|
39
|
+
class: d(O.value)
|
|
40
40
|
}, {
|
|
41
|
-
default:
|
|
42
|
-
x.label || e.$slots.label ? (
|
|
41
|
+
default: g(() => [
|
|
42
|
+
x.label || e.$slots.label ? (f(), o("span", {
|
|
43
43
|
key: 0,
|
|
44
|
-
class:
|
|
45
|
-
}, [
|
|
46
|
-
|
|
44
|
+
class: d(k.value)
|
|
45
|
+
}, [p(e.$slots, "label", {}, () => [c(m(x.label), 1)])], 2)) : a("", !0),
|
|
46
|
+
s("span", { class: d(N.value) }, [s("span", { class: d(A.value) }, [p(e.$slots, "default", {}, () => [c(m(x.value), 1)])], 2), w.value || e.$slots.delta ? (f(), o("span", {
|
|
47
47
|
key: 0,
|
|
48
|
-
class:
|
|
49
|
-
}, [
|
|
48
|
+
class: d(j.value)
|
|
49
|
+
}, [p(e.$slots, "delta", { trend: S.value }, () => [l(t, {
|
|
50
50
|
icon: C.value,
|
|
51
51
|
"data-icon": "inline-start"
|
|
52
|
-
}, null, 8, ["icon"]),
|
|
53
|
-
x.hint || e.$slots.hint ? (
|
|
52
|
+
}, null, 8, ["icon"]), c(" " + m(w.value), 1)])], 2)) : a("", !0)], 2),
|
|
53
|
+
x.hint || e.$slots.hint ? (f(), o("span", {
|
|
54
54
|
key: 1,
|
|
55
|
-
class:
|
|
56
|
-
}, [
|
|
55
|
+
class: d(M.value)
|
|
56
|
+
}, [p(e.$slots, "hint", {}, () => [c(m(x.hint), 1)])], 2)) : a("", !0)
|
|
57
57
|
]),
|
|
58
58
|
_: 3
|
|
59
59
|
}, 8, ["as", "class"]));
|