@indielayer/ui 1.4.0 → 1.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/docs/components/common/CodePreview.vue +1 -1
- package/docs/components/common/CodeSnippet.vue +5 -7
- package/docs/components/common/DocumentPage.vue +89 -93
- package/docs/components/menu/DocsMenu.vue +75 -122
- package/docs/components/toolbar/PreToolbar.vue +10 -12
- package/docs/components/toolbar/Toolbar.vue +21 -8
- package/docs/layouts/default.vue +7 -3
- package/docs/pages/colors.vue +49 -54
- package/docs/pages/component/button/button-group.vue +6 -2
- package/docs/pages/component/button/size.vue +1 -1
- package/docs/pages/component/carousel/usage.vue +2 -2
- package/docs/pages/component/form/usage.vue +3 -3
- package/docs/pages/component/formGroup/usage.vue +1 -0
- package/docs/pages/component/input/usage.vue +8 -9
- package/docs/pages/component/modal/composed.vue +3 -2
- package/docs/pages/component/modal/usage.vue +11 -6
- package/docs/pages/component/popover/usage.vue +3 -3
- package/docs/pages/component/select/usage.vue +1 -0
- package/docs/pages/component/tabs/usage.vue +6 -1
- package/docs/pages/component/textarea/usage.vue +10 -13
- package/docs/pages/component/toggle/usage.vue +9 -11
- package/docs/pages/component/tooltip/index.vue +2 -2
- package/docs/pages/component/tooltip/usage.vue +4 -8
- package/docs/pages/icons.vue +54 -58
- package/docs/pages/index.vue +73 -77
- package/docs/pages/play.vue +2 -14
- package/docs/pages/typography.vue +26 -30
- package/docs/router/index.ts +2 -0
- package/exports/tailwind.preset.js +0 -1
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +7 -7
- package/lib/components/badge/Badge.vue.js +7 -7
- package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.js +1 -1
- package/lib/components/button/theme/Button.base.theme.js +7 -7
- package/lib/components/card/theme/Card.base.theme.js +1 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +3 -0
- package/lib/components/checkbox/Checkbox.vue2.js +23 -23
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +6 -6
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +2 -2
- package/lib/components/container/theme/Container.base.theme.js +2 -2
- package/lib/components/divider/Divider.vue.js +14 -14
- package/lib/components/divider/theme/Divider.base.theme.js +2 -2
- package/lib/components/drawer/Drawer.vue.js +2 -2
- package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
- package/lib/components/form/Form.vue.js +1 -1
- package/lib/components/form/theme/Form.base.theme.js +4 -4
- package/lib/components/form/theme/Form.carbon.theme.js +4 -4
- package/lib/components/formGroup/FormGroup.vue.d.ts +3 -0
- package/lib/components/formGroup/FormGroup.vue.js +16 -15
- package/lib/components/formGroup/theme/FormGroup.base.theme.js +1 -1
- package/lib/components/icon/theme/Icon.base.theme.js +1 -1
- package/lib/components/index.js +108 -107
- package/lib/components/input/Input.vue.d.ts +3 -0
- package/lib/components/input/Input.vue.js +4 -3
- package/lib/components/input/theme/Input.base.theme.js +10 -10
- package/lib/components/input/theme/Input.carbon.theme.js +10 -10
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -3
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +2 -2
- package/lib/components/label/Label.vue.d.ts +3 -0
- package/lib/components/label/Label.vue.js +26 -20
- package/lib/components/label/theme/Label.base.theme.js +1 -1
- package/lib/components/label/theme/Label.carbon.theme.js +3 -3
- package/lib/components/link/Link.vue.js +2 -2
- package/lib/components/link/Link.vue2.js +4 -4
- package/lib/components/loader/theme/Loader.base.theme.js +1 -1
- package/lib/components/loader/theme/Loader.carbon.theme.js +1 -1
- package/lib/components/menu/Menu.vue.js +19 -19
- package/lib/components/menu/theme/MenuItem.base.theme.js +21 -31
- package/lib/components/modal/Modal.vue.d.ts +4 -0
- package/lib/components/modal/Modal.vue.js +78 -74
- package/lib/components/modal/theme/Modal.base.theme.js +10 -10
- package/lib/components/modal/theme/Modal.carbon.theme.js +3 -3
- package/lib/components/notifications/Notifications.vue.js +1 -1
- package/lib/components/notifications/theme/Notifications.base.theme.js +1 -1
- package/lib/components/notifications/theme/Notifications.carbon.theme.js +3 -3
- package/lib/components/pagination/Pagination.vue.js +27 -27
- package/lib/components/popover/Popover.vue.d.ts +13 -0
- package/lib/components/popover/Popover.vue.js +13 -8
- package/lib/components/popover/Popover.vue2.js +3 -2
- package/lib/components/popover/Popover.vue3.js +2 -3
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +4 -4
- package/lib/components/popover/theme/PopoverContainer.carbon.theme.js +4 -4
- package/lib/components/progress/Progress.vue.js +11 -11
- package/lib/components/progress/theme/Progress.base.theme.js +10 -10
- package/lib/components/radio/Radio.vue.d.ts +3 -0
- package/lib/components/radio/theme/Radio.base.theme.js +28 -28
- package/lib/components/radio/theme/Radio.carbon.theme.js +8 -8
- package/lib/components/select/Select.vue.d.ts +16 -0
- package/lib/components/select/Select.vue.js +95 -92
- package/lib/components/select/theme/Select.base.theme.js +11 -11
- package/lib/components/select/theme/Select.carbon.theme.js +10 -10
- package/lib/components/skeleton/theme/Skeleton.base.theme.js +1 -1
- package/lib/components/slider/Slider.vue.d.ts +3 -0
- package/lib/components/slider/Slider.vue.js +1 -1
- package/lib/components/slider/theme/Slider.carbon.theme.js +6 -6
- package/lib/components/stepper/Stepper.vue.js +14 -14
- package/lib/components/tab/Tab.vue.js +55 -54
- package/lib/components/tab/theme/TabGroup.base.theme.js +15 -15
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +8 -8
- package/lib/components/table/Table.vue.js +192 -194
- package/lib/components/table/theme/Table.base.theme.js +3 -3
- package/lib/components/table/theme/Table.carbon.theme.js +7 -7
- package/lib/components/table/theme/TableHead.base.theme.js +1 -1
- package/lib/components/table/theme/TableHead.carbon.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.base.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.carbon.theme.js +2 -2
- package/lib/components/table/theme/TableRow.base.theme.js +3 -3
- package/lib/components/table/theme/TableRow.carbon.theme.js +3 -3
- package/lib/components/tag/Tag.vue.js +4 -4
- package/lib/components/textarea/Textarea.vue.d.ts +7 -0
- package/lib/components/textarea/Textarea.vue.js +23 -21
- package/lib/components/textarea/theme/Textarea.base.theme.js +6 -6
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +6 -6
- package/lib/components/toggle/Toggle.vue.d.ts +3 -0
- package/lib/components/toggle/Toggle.vue.js +26 -26
- package/lib/components/toggle/theme/Toggle.base.theme.js +1 -1
- package/lib/components/tooltip/ToggleTip.vue.d.ts +14 -0
- package/lib/components/tooltip/ToggleTip.vue.js +29 -0
- package/lib/components/tooltip/ToggleTip.vue2.js +4 -0
- package/lib/components/tooltip/Tooltip.vue.d.ts +22 -3
- package/lib/components/tooltip/Tooltip.vue.js +26 -17
- package/lib/components/tooltip/__tests__/ToggleTip.spec.d.ts +1 -0
- package/lib/components/tooltip/index.d.ts +2 -0
- package/lib/composables/useColors.js +9 -9
- package/lib/composables/useInputtable.d.ts +1 -0
- package/lib/composables/useInputtable.js +20 -19
- package/lib/index.js +37 -35
- package/lib/index.umd.js +7 -3
- package/lib/tailwind.preset.js +0 -1
- package/lib/themes/base/index.js +3 -6
- package/lib/themes/base/styles.css.js +4 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -1
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +2 -2
- package/src/components/badge/Badge.vue +1 -1
- package/src/components/breadcrumbs/theme/Breadcrumbs.base.theme.ts +1 -1
- package/src/components/button/theme/Button.base.theme.ts +2 -2
- package/src/components/card/theme/Card.base.theme.ts +1 -1
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +8 -8
- package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +2 -2
- package/src/components/container/theme/Container.base.theme.ts +2 -2
- package/src/components/divider/Divider.vue +1 -1
- package/src/components/divider/theme/Divider.base.theme.ts +2 -2
- package/src/components/drawer/Drawer.vue +2 -2
- package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
- package/src/components/form/Form.vue +1 -1
- package/src/components/form/theme/Form.base.theme.ts +1 -1
- package/src/components/form/theme/Form.carbon.theme.ts +1 -1
- package/src/components/formGroup/FormGroup.vue +1 -0
- package/src/components/formGroup/theme/FormGroup.base.theme.ts +1 -1
- package/src/components/icon/theme/Icon.base.theme.ts +2 -2
- package/src/components/input/Input.vue +2 -1
- package/src/components/input/theme/Input.base.theme.ts +5 -5
- package/src/components/input/theme/Input.carbon.theme.ts +6 -6
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +3 -3
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +2 -2
- package/src/components/label/Label.vue +4 -1
- package/src/components/label/theme/Label.base.theme.ts +1 -1
- package/src/components/label/theme/Label.carbon.theme.ts +1 -1
- package/src/components/link/Link.vue +1 -1
- package/src/components/loader/theme/Loader.base.theme.ts +1 -1
- package/src/components/loader/theme/Loader.carbon.theme.ts +1 -1
- package/src/components/menu/Menu.vue +3 -3
- package/src/components/menu/theme/MenuItem.base.theme.ts +30 -34
- package/src/components/modal/Modal.vue +8 -3
- package/src/components/modal/theme/Modal.base.theme.ts +9 -6
- package/src/components/modal/theme/Modal.carbon.theme.ts +3 -3
- package/src/components/notifications/Notifications.vue +1 -1
- package/src/components/notifications/theme/Notifications.base.theme.ts +1 -1
- package/src/components/notifications/theme/Notifications.carbon.theme.ts +1 -1
- package/src/components/pagination/Pagination.vue +3 -3
- package/src/components/popover/Popover.vue +77 -2
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
- package/src/components/popover/theme/PopoverContainer.carbon.theme.ts +1 -1
- package/src/components/progress/Progress.vue +1 -1
- package/src/components/progress/theme/Progress.base.theme.ts +2 -2
- package/src/components/radio/theme/Radio.base.theme.ts +8 -8
- package/src/components/radio/theme/Radio.carbon.theme.ts +1 -1
- package/src/components/select/Select.vue +7 -4
- package/src/components/select/theme/Select.base.theme.ts +8 -8
- package/src/components/select/theme/Select.carbon.theme.ts +8 -8
- package/src/components/skeleton/theme/Skeleton.base.theme.ts +1 -1
- package/src/components/slider/Slider.vue +1 -1
- package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
- package/src/components/stepper/Stepper.vue +3 -3
- package/src/components/tab/Tab.vue +3 -3
- package/src/components/tab/theme/TabGroup.base.theme.ts +4 -4
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +3 -3
- package/src/components/table/Table.vue +2 -0
- package/src/components/table/theme/Table.base.theme.ts +1 -1
- package/src/components/table/theme/Table.carbon.theme.ts +2 -2
- package/src/components/table/theme/TableHead.base.theme.ts +1 -1
- package/src/components/table/theme/TableHead.carbon.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.carbon.theme.ts +2 -2
- package/src/components/table/theme/TableRow.base.theme.ts +3 -3
- package/src/components/table/theme/TableRow.carbon.theme.ts +3 -3
- package/src/components/tag/Tag.vue +1 -1
- package/src/components/textarea/Textarea.vue +3 -1
- package/src/components/textarea/theme/Textarea.base.theme.ts +5 -4
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +5 -5
- package/src/components/toggle/Toggle.vue +3 -3
- package/src/components/toggle/theme/Toggle.base.theme.ts +1 -1
- package/src/components/tooltip/ToggleTip.vue +31 -0
- package/src/components/tooltip/Tooltip.vue +14 -4
- package/src/components/tooltip/__tests__/ToggleTip.spec.ts +11 -0
- package/src/components/tooltip/index.ts +3 -0
- package/src/composables/useColors.ts +1 -1
- package/src/composables/useInputtable.ts +1 -0
- package/src/themes/base/index.ts +0 -3
- package/src/themes/base/styles.css +4 -0
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, ref as P, watch as q, openBlock as m, createBlock as d, normalizeStyle as K, unref as r, normalizeClass as R, withCtx as j, createElementVNode as F, mergeProps as H, toHandlers as L, withKeys as $, createCommentVNode as D } from "vue";
|
|
2
2
|
import { useResizeObserver as O, useEventListener as X } from "../../node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9/node_modules/@vueuse/core/index.js";
|
|
3
3
|
import { useCSS as A } from "../../composables/useCSS.js";
|
|
4
4
|
import { useTheme as G } from "../../composables/useTheme.js";
|
|
@@ -27,51 +27,53 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
|
|
|
27
27
|
placeholder: String,
|
|
28
28
|
adjustToText: Boolean,
|
|
29
29
|
preventEnter: Boolean,
|
|
30
|
-
block: Boolean
|
|
30
|
+
block: Boolean,
|
|
31
|
+
resizable: Boolean
|
|
31
32
|
}, Y = {
|
|
32
33
|
name: "XTextarea",
|
|
33
34
|
validators: {
|
|
34
35
|
...u.validators()
|
|
35
36
|
}
|
|
36
|
-
}, de = /* @__PURE__ */
|
|
37
|
+
}, de = /* @__PURE__ */ x({
|
|
37
38
|
...Y,
|
|
38
39
|
props: W,
|
|
39
40
|
emits: s.emits(),
|
|
40
41
|
setup(f, { expose: c, emit: h }) {
|
|
41
42
|
const t = f, b = h, o = P(null);
|
|
42
|
-
O(o,
|
|
43
|
-
setTimeout(
|
|
43
|
+
O(o, l), typeof window < "u" && X(window, "resize", l), q([() => t.modelValue, () => t.size], () => {
|
|
44
|
+
setTimeout(l);
|
|
44
45
|
});
|
|
45
46
|
const g = A("textarea"), y = J().getPalette("primary"), v = g.get("border", y[400]);
|
|
46
47
|
function w() {
|
|
47
|
-
|
|
48
|
+
l();
|
|
48
49
|
}
|
|
49
50
|
function S(e) {
|
|
50
51
|
t.preventEnter && e.preventDefault(), e.stopPropagation();
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
+
function l() {
|
|
53
54
|
t.adjustToText && o.value && (o.value.style.height = "1px", o.value.style.height = 2 + o.value.scrollHeight + "px");
|
|
54
55
|
}
|
|
55
56
|
const { focus: a, blur: k } = p(o), {
|
|
56
|
-
errorInternal:
|
|
57
|
+
errorInternal: n,
|
|
57
58
|
hideFooterInternal: N,
|
|
58
59
|
isInsideForm: T,
|
|
59
|
-
inputListeners:
|
|
60
|
-
reset:
|
|
61
|
-
validate:
|
|
62
|
-
setError:
|
|
63
|
-
} = s(t, { focus: a, emit: b }), { styles:
|
|
64
|
-
return c({ focus: a, blur: k, reset:
|
|
65
|
-
style: K(r(
|
|
60
|
+
inputListeners: z,
|
|
61
|
+
reset: C,
|
|
62
|
+
validate: B,
|
|
63
|
+
setError: E
|
|
64
|
+
} = s(t, { focus: a, emit: b }), { styles: I, classes: i, className: V } = G("Textarea", {}, t, { errorInternal: n });
|
|
65
|
+
return c({ focus: a, blur: k, reset: C, validate: B, setError: E }), (e, _) => (m(), d(M, {
|
|
66
|
+
style: K(r(I)),
|
|
66
67
|
block: e.block,
|
|
67
68
|
disabled: e.disabled,
|
|
68
69
|
required: e.required,
|
|
69
70
|
"is-inside-form": r(T),
|
|
70
71
|
label: e.label,
|
|
71
72
|
class: R([
|
|
72
|
-
r(
|
|
73
|
+
r(V),
|
|
73
74
|
r(i).wrapper
|
|
74
|
-
])
|
|
75
|
+
]),
|
|
76
|
+
tooltip: e.tooltip
|
|
75
77
|
}, {
|
|
76
78
|
default: j(() => [
|
|
77
79
|
F("textarea", H({
|
|
@@ -80,7 +82,7 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
|
|
|
80
82
|
ref: o,
|
|
81
83
|
class: ["", [
|
|
82
84
|
r(i).input,
|
|
83
|
-
r(
|
|
85
|
+
r(n) ? "border-error-500 dark:border-error-400 focus:outline-error-500" : "focus:outline-[color:var(--x-textarea-border)]"
|
|
84
86
|
]],
|
|
85
87
|
style: r(v),
|
|
86
88
|
disabled: e.disabled,
|
|
@@ -94,18 +96,18 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
|
|
|
94
96
|
placeholder: e.placeholder,
|
|
95
97
|
readonly: e.readonly,
|
|
96
98
|
value: e.modelValue ? String(e.modelValue) : ""
|
|
97
|
-
}, L(r(
|
|
99
|
+
}, L(r(z), !0), {
|
|
98
100
|
onKeydown: $(S, ["enter"]),
|
|
99
101
|
onInput: w
|
|
100
102
|
}), null, 16, U),
|
|
101
103
|
r(N) ? D("", !0) : (m(), d(Q, {
|
|
102
104
|
key: 0,
|
|
103
|
-
error: r(
|
|
105
|
+
error: r(n),
|
|
104
106
|
helper: e.helper
|
|
105
107
|
}, null, 8, ["error", "helper"]))
|
|
106
108
|
]),
|
|
107
109
|
_: 1
|
|
108
|
-
}, 8, ["style", "block", "disabled", "required", "is-inside-form", "label", "class"]));
|
|
110
|
+
}, 8, ["style", "block", "disabled", "required", "is-inside-form", "label", "class", "tooltip"]));
|
|
109
111
|
}
|
|
110
112
|
});
|
|
111
113
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = {
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "",
|
|
4
|
-
input: ({ props:
|
|
5
|
-
const e = ["
|
|
6
|
-
return !
|
|
4
|
+
input: ({ props: s, data: r }) => {
|
|
5
|
+
const e = ["appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border shadow-sm rounded-md"];
|
|
6
|
+
return s.resizable || e.push("resize-none"), !r.errorInternal && !s.disabled && e.push("hover:border-secondary-400 dark:hover:border-secondary-500"), s.size === "xs" ? e.push("px-2 py-1 text-xs") : s.size === "sm" ? e.push("px-2 py-2 text-sm") : s.size === "lg" ? e.push("px-4 py-3 text-lg") : s.size === "xl" ? e.push("px-5 py-4 text-xl") : e.push("px-3 py-2"), e.push(s.disabled ? "bg-secondary-100 dark:bg-secondary-700 text-secondary-400 dark:text-secondary-600 cursor-not-allowed" : "bg-white dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), e;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, t = a;
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
t as default
|
|
12
12
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a = {
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "",
|
|
4
|
-
input: ({ props: r, data:
|
|
5
|
-
const e = ["resize-none appearance-none block w-full placeholder-
|
|
6
|
-
return !
|
|
4
|
+
input: ({ props: r, data: s }) => {
|
|
5
|
+
const e = ["resize-none appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border-b text-sm px-4"];
|
|
6
|
+
return !s.errorInternal && !r.disabled && e.push("hover:border-secondary-400 dark:hover:border-secondary-500"), r.size === "xs" || r.size === "sm" ? e.push("py-1.5") : r.size === "lg" || r.size === "xl" ? e.push("py-3.5") : e.push("py-2.5"), r.disabled ? e.push("bg-secondary-100 dark:bg-secondary-900 text-secondary-300 cursor-not-allowed") : r.readonly ? e.push("bg-white dark:bg-secondary-900 text-secondary-700") : e.push("bg-secondary-50 dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), e;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, n = a;
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
n as default
|
|
12
12
|
};
|
|
@@ -19,6 +19,7 @@ declare const toggleProps: {
|
|
|
19
19
|
readonly type: ArrayConstructor;
|
|
20
20
|
readonly default: () => never[];
|
|
21
21
|
};
|
|
22
|
+
tooltip: StringConstructor;
|
|
22
23
|
disabled: BooleanConstructor;
|
|
23
24
|
loading: BooleanConstructor;
|
|
24
25
|
loadingLabel: StringConstructor;
|
|
@@ -59,6 +60,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
60
|
readonly type: ArrayConstructor;
|
|
60
61
|
readonly default: () => never[];
|
|
61
62
|
};
|
|
63
|
+
tooltip: StringConstructor;
|
|
62
64
|
disabled: BooleanConstructor;
|
|
63
65
|
loading: BooleanConstructor;
|
|
64
66
|
loadingLabel: StringConstructor;
|
|
@@ -100,6 +102,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
102
|
readonly type: ArrayConstructor;
|
|
101
103
|
readonly default: () => never[];
|
|
102
104
|
};
|
|
105
|
+
tooltip: StringConstructor;
|
|
103
106
|
disabled: BooleanConstructor;
|
|
104
107
|
loading: BooleanConstructor;
|
|
105
108
|
loadingLabel: StringConstructor;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as T, ref as $, computed as D, openBlock as
|
|
1
|
+
import { defineComponent as T, ref as $, computed as D, openBlock as d, createElementBlock as b, normalizeClass as l, unref as r, createElementVNode as a, normalizeStyle as R, withDirectives as S, vModelCheckbox as F, toDisplayString as L, createCommentVNode as t, createBlock as g } from "vue";
|
|
2
2
|
import { useTheme as M } from "../../composables/useTheme.js";
|
|
3
3
|
import { useCommon as f } from "../../composables/useCommon.js";
|
|
4
4
|
import { useColors as P } from "../../composables/useColors.js";
|
|
5
|
-
import { useInputtable as
|
|
5
|
+
import { useInputtable as i } from "../../composables/useInputtable.js";
|
|
6
6
|
import { useInteractive as v } from "../../composables/useInteractive.js";
|
|
7
7
|
import U from "../spinner/Spinner.vue.js";
|
|
8
8
|
import W from "../inputFooter/InputFooter.vue.js";
|
|
@@ -10,7 +10,7 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
|
|
|
10
10
|
...f.props(),
|
|
11
11
|
...P.props("primary"),
|
|
12
12
|
...v.props(),
|
|
13
|
-
...
|
|
13
|
+
...i.props(),
|
|
14
14
|
glow: Boolean
|
|
15
15
|
}, H = {
|
|
16
16
|
name: "XToggle",
|
|
@@ -20,11 +20,11 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
|
|
|
20
20
|
}, ee = /* @__PURE__ */ T({
|
|
21
21
|
...H,
|
|
22
22
|
props: G,
|
|
23
|
-
emits:
|
|
23
|
+
emits: i.emits(!1),
|
|
24
24
|
setup(h, { expose: k, emit: y }) {
|
|
25
|
-
const
|
|
25
|
+
const n = h, u = y, m = $(null), o = D({
|
|
26
26
|
get() {
|
|
27
|
-
return !!
|
|
27
|
+
return !!n.modelValue;
|
|
28
28
|
},
|
|
29
29
|
set(e) {
|
|
30
30
|
u("update:modelValue", e);
|
|
@@ -35,9 +35,9 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
|
|
|
35
35
|
reset: z,
|
|
36
36
|
validate: B,
|
|
37
37
|
setError: I
|
|
38
|
-
} = n
|
|
39
|
-
return k({ focus: p, blur: w, reset: z, validate: B, setError: I }), (e,
|
|
40
|
-
class:
|
|
38
|
+
} = i(n, { focus: p, emit: u, withListeners: !1 }), { styles: q, classes: s, className: E } = M("Toggle", {}, n);
|
|
39
|
+
return k({ focus: p, blur: w, reset: z, validate: B, setError: I }), (e, c) => (d(), b("label", {
|
|
40
|
+
class: l(["inline-block", [
|
|
41
41
|
r(E),
|
|
42
42
|
r(s).wrapper,
|
|
43
43
|
e.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
@@ -45,23 +45,23 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
|
|
|
45
45
|
}, [
|
|
46
46
|
a("div", X, [
|
|
47
47
|
a("div", {
|
|
48
|
-
class:
|
|
48
|
+
class: l(["flex items-center rounded-full transition-colors duration-300 border-[3px] shrink-0 !border-transparent", {
|
|
49
49
|
[`shadow-lg shadow-${e.color}-500/50`]: e.glow && e.modelValue,
|
|
50
|
-
"bg-
|
|
51
|
-
"bg-
|
|
52
|
-
"bg-[color:var(--x-toggle-bg)] dark:bg-[color:var(--x-toggle-dark-bg)]": !e.disabled &&
|
|
50
|
+
"bg-secondary-300 dark:bg-secondary-500": !e.disabled && !o.value && !e.loading,
|
|
51
|
+
"bg-secondary-100 dark:bg-secondary-700": e.disabled || e.loading,
|
|
52
|
+
"bg-[color:var(--x-toggle-bg)] dark:bg-[color:var(--x-toggle-dark-bg)]": !e.disabled && o.value
|
|
53
53
|
}]),
|
|
54
54
|
style: R(r(q))
|
|
55
55
|
}, [
|
|
56
56
|
a("div", {
|
|
57
|
-
class:
|
|
57
|
+
class: l(r(s).buttonWrapper)
|
|
58
58
|
}, [
|
|
59
59
|
S(a("input", {
|
|
60
60
|
id: e.id,
|
|
61
61
|
ref_key: "elRef",
|
|
62
62
|
ref: m,
|
|
63
|
-
"onUpdate:modelValue":
|
|
64
|
-
"aria-checked":
|
|
63
|
+
"onUpdate:modelValue": c[0] || (c[0] = (N) => o.value = N),
|
|
64
|
+
"aria-checked": o.value ? "true" : "false",
|
|
65
65
|
"aria-disabled": e.disabled ? "true" : void 0,
|
|
66
66
|
type: "checkbox",
|
|
67
67
|
class: "hidden",
|
|
@@ -70,32 +70,32 @@ const X = { class: "flex items-center" }, j = ["id", "aria-checked", "aria-disab
|
|
|
70
70
|
required: e.required,
|
|
71
71
|
value: e.modelValue
|
|
72
72
|
}, null, 8, j), [
|
|
73
|
-
[F,
|
|
73
|
+
[F, o.value]
|
|
74
74
|
]),
|
|
75
75
|
a("div", {
|
|
76
|
-
class:
|
|
76
|
+
class: l([
|
|
77
77
|
r(s).button,
|
|
78
78
|
{
|
|
79
|
-
"translate-x-full":
|
|
79
|
+
"translate-x-full": o.value,
|
|
80
80
|
shadow: !e.disabled
|
|
81
81
|
},
|
|
82
|
-
e.disabled ? "bg-
|
|
82
|
+
e.disabled ? "bg-secondary-50 dark:bg-secondary-800" : "bg-white dark:bg-secondary-800"
|
|
83
83
|
])
|
|
84
84
|
}, null, 2)
|
|
85
85
|
], 2)
|
|
86
86
|
], 6),
|
|
87
|
-
e.label ? (
|
|
87
|
+
e.label ? (d(), b("span", {
|
|
88
88
|
key: 0,
|
|
89
|
-
class:
|
|
89
|
+
class: l(["ml-2", r(s).label]),
|
|
90
90
|
textContent: L(e.label)
|
|
91
|
-
}, null, 10, A)) :
|
|
92
|
-
e.loading ? (
|
|
91
|
+
}, null, 10, A)) : t("", !0),
|
|
92
|
+
e.loading ? (d(), g(U, {
|
|
93
93
|
key: 1,
|
|
94
94
|
size: e.size,
|
|
95
95
|
class: "ml-1"
|
|
96
|
-
}, null, 8, ["size"])) :
|
|
96
|
+
}, null, 8, ["size"])) : t("", !0)
|
|
97
97
|
]),
|
|
98
|
-
r(V) ?
|
|
98
|
+
r(V) ? t("", !0) : (d(), g(W, {
|
|
99
99
|
key: 0,
|
|
100
100
|
error: r(C),
|
|
101
101
|
helper: e.helper
|
|
@@ -2,7 +2,7 @@ const i = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper: "",
|
|
4
4
|
label: ({ props: t }) => {
|
|
5
|
-
const e = "font-medium text-
|
|
5
|
+
const e = "font-medium text-secondary-800 dark:text-secondary-200";
|
|
6
6
|
return t.size === "xs" ? e + " text-xs" : t.size === "sm" ? e + " text-sm" : t.size === "lg" ? e + " text-lg" : t.size === "xl" ? e + " text-xl" : e + " text-sm";
|
|
7
7
|
},
|
|
8
8
|
buttonWrapper: ({ props: t }) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
declare const toggleTipProps: {
|
|
3
|
+
content: StringConstructor;
|
|
4
|
+
icon: StringConstructor;
|
|
5
|
+
};
|
|
6
|
+
export type ToggleTipProps = ExtractPublicPropTypes<typeof toggleTipProps>;
|
|
7
|
+
declare const _default: import("vue").DefineComponent<{
|
|
8
|
+
content: StringConstructor;
|
|
9
|
+
icon: StringConstructor;
|
|
10
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
content: StringConstructor;
|
|
12
|
+
icon: StringConstructor;
|
|
13
|
+
}>>, {}, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as r, computed as i, openBlock as p, createBlock as s, withCtx as o, createElementVNode as a, createVNode as m } from "vue";
|
|
2
|
+
import l from "./Tooltip.vue.js";
|
|
3
|
+
import _ from "../icon/Icon.vue.js";
|
|
4
|
+
import { infoIcon as d } from "../../common/icons.js";
|
|
5
|
+
const u = ["innerHTML"], f = {
|
|
6
|
+
content: String,
|
|
7
|
+
icon: String
|
|
8
|
+
}, g = { name: "XToggleTip" }, y = /* @__PURE__ */ r({
|
|
9
|
+
...g,
|
|
10
|
+
props: f,
|
|
11
|
+
setup(t) {
|
|
12
|
+
const e = t, n = i(() => e.icon || d);
|
|
13
|
+
return (c, T) => (p(), s(l, { placement: "auto" }, {
|
|
14
|
+
tooltip: o(() => [
|
|
15
|
+
a("div", { innerHTML: c.content }, null, 8, u)
|
|
16
|
+
]),
|
|
17
|
+
default: o(() => [
|
|
18
|
+
m(_, {
|
|
19
|
+
icon: n.value,
|
|
20
|
+
class: "text-secondary-500 dark:text-secondary-300 cursor-pointer"
|
|
21
|
+
}, null, 8, ["icon"])
|
|
22
|
+
]),
|
|
23
|
+
_: 1
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
y as default
|
|
29
|
+
};
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
-
|
|
1
|
+
import type { ExtractPublicPropTypes, PropType } from 'vue';
|
|
2
|
+
import { type Placement } from 'floating-vue';
|
|
3
|
+
declare const tooltipProps: {
|
|
4
|
+
placement: {
|
|
5
|
+
type: PropType<Placement>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type PopoverPlacement = Placement;
|
|
3
10
|
export type TooltipProps = ExtractPublicPropTypes<typeof tooltipProps>;
|
|
4
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
12
|
+
placement: {
|
|
13
|
+
type: PropType<Placement>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
placement: {
|
|
18
|
+
type: PropType<Placement>;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
}>>, {
|
|
22
|
+
placement: Placement;
|
|
23
|
+
}, {}>, {
|
|
5
24
|
default?(_: {}): any;
|
|
6
25
|
tooltip?(_: {}): any;
|
|
7
26
|
}>;
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as r, openBlock as a, createBlock as s, withCtx as e, createElementVNode as l, createVNode as n, renderSlot as o } from "vue";
|
|
2
2
|
import c from "../popover/Popover.vue.js";
|
|
3
|
-
import "../popover/Popover.
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import "../popover/Popover.vue3.js";
|
|
4
|
+
import p from "../popover/PopoverContainer.vue.js";
|
|
5
|
+
import "../../node_modules/.pnpm/floating-vue@5.2.0_vue@3.3.9/node_modules/floating-vue/dist/floating-vue.js";
|
|
6
|
+
const i = { class: "dark" }, m = {
|
|
7
|
+
placement: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "bottom"
|
|
10
|
+
}
|
|
11
|
+
}, _ = { name: "XTooltip" }, $ = /* @__PURE__ */ r({
|
|
6
12
|
..._,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
props: m,
|
|
14
|
+
setup(d) {
|
|
15
|
+
return (t, f) => (a(), s(c, {
|
|
16
|
+
triggers: ["hover", "click"],
|
|
17
|
+
class: "inline-block",
|
|
18
|
+
"hide-arrow": !1,
|
|
19
|
+
placement: t.placement
|
|
11
20
|
}, {
|
|
12
|
-
content:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
o(
|
|
21
|
+
content: e(() => [
|
|
22
|
+
l("div", i, [
|
|
23
|
+
n(p, { class: "p-2 text-white text-xs w-max max-w-xs" }, {
|
|
24
|
+
default: e(() => [
|
|
25
|
+
o(t.$slots, "tooltip")
|
|
17
26
|
]),
|
|
18
27
|
_: 3
|
|
19
28
|
})
|
|
20
29
|
])
|
|
21
30
|
]),
|
|
22
|
-
default:
|
|
23
|
-
o(
|
|
31
|
+
default: e(() => [
|
|
32
|
+
o(t.$slots, "default")
|
|
24
33
|
]),
|
|
25
34
|
_: 3
|
|
26
|
-
}));
|
|
35
|
+
}, 8, ["placement"]));
|
|
27
36
|
}
|
|
28
37
|
});
|
|
29
38
|
export {
|
|
30
|
-
|
|
39
|
+
$ as default
|
|
31
40
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,27 +2,27 @@ import { inject as m, computed as p, unref as f } from "vue";
|
|
|
2
2
|
import { injectThemeKey as g } from "./keys.js";
|
|
3
3
|
import { tailwindColors as n, setOpacity as l, isValidColor as d, colorShade as t } from "../common/colors.js";
|
|
4
4
|
import { mergeRightDeep as y } from "../common/utils.js";
|
|
5
|
-
const
|
|
6
|
-
primary: n.
|
|
5
|
+
const a = {}, C = {
|
|
6
|
+
primary: n.emerald,
|
|
7
7
|
secondary: n.slate,
|
|
8
8
|
success: n.green,
|
|
9
9
|
warning: n.yellow,
|
|
10
10
|
error: n.red
|
|
11
|
-
},
|
|
11
|
+
}, i = (r) => n[r], c = (r, s) => l(r, s), w = () => {
|
|
12
12
|
const r = m(g, {}), s = p(() => y(C, f(r).colors || {}));
|
|
13
13
|
return {
|
|
14
14
|
getPalette: (e) => {
|
|
15
15
|
if (!e)
|
|
16
|
-
return
|
|
17
|
-
const o =
|
|
16
|
+
return i("gray");
|
|
17
|
+
const o = i(e);
|
|
18
18
|
if (o)
|
|
19
19
|
return o;
|
|
20
|
-
if (
|
|
21
|
-
return
|
|
20
|
+
if (a[e])
|
|
21
|
+
return a[e];
|
|
22
22
|
if (s.value[e])
|
|
23
23
|
return s.value[e];
|
|
24
24
|
if (!d(e))
|
|
25
|
-
return console.warn(`Invalid color: ${e}`),
|
|
25
|
+
return console.warn(`Invalid color: ${e}`), i("gray");
|
|
26
26
|
const u = {
|
|
27
27
|
50: t(e, 0.9),
|
|
28
28
|
100: t(e, 0.8),
|
|
@@ -36,7 +36,7 @@ const i = {}, C = {
|
|
|
36
36
|
900: t(e, -0.7),
|
|
37
37
|
950: t(e, -0.8)
|
|
38
38
|
};
|
|
39
|
-
return
|
|
39
|
+
return a[e] = u, u;
|
|
40
40
|
},
|
|
41
41
|
getColorOpacity: c
|
|
42
42
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as a, watch as h, inject as G, computed as j, onMounted as A, onUnmounted as O } from "vue";
|
|
2
2
|
import { injectFormGroupKey as K, injectFormKey as M } from "./keys.js";
|
|
3
3
|
const y = (r, { focus: I, emit: o, withListeners: b = !0 }) => {
|
|
4
|
-
const s =
|
|
4
|
+
const s = a(!0), u = a(r.error), v = a(r.hideFooter), V = r.name ? r.name : (Math.random() + 1).toString(36).substring(7), i = a(V);
|
|
5
5
|
h(() => r.error, (e) => {
|
|
6
|
-
|
|
6
|
+
u.value = e;
|
|
7
7
|
}), h(() => r.name, (e) => {
|
|
8
|
-
e && (
|
|
8
|
+
e && (i.value = e);
|
|
9
9
|
});
|
|
10
10
|
const t = G(K, {
|
|
11
11
|
registerInputGroup: () => {
|
|
@@ -25,28 +25,28 @@ const y = (r, { focus: I, emit: o, withListeners: b = !0 }) => {
|
|
|
25
25
|
},
|
|
26
26
|
isInsideForm: !1
|
|
27
27
|
}), S = () => {
|
|
28
|
-
|
|
28
|
+
u.value = "", s.value = !0, o("update:modelValue", "");
|
|
29
29
|
}, F = (e) => {
|
|
30
|
-
|
|
30
|
+
u.value = e;
|
|
31
31
|
}, m = (e) => {
|
|
32
32
|
e = e || r.modelValue, s.value = !1;
|
|
33
33
|
for (let p = 0; p < r.rules.length; p++) {
|
|
34
|
-
const
|
|
34
|
+
const n = r.rules[p];
|
|
35
35
|
let l = !0;
|
|
36
|
-
if (typeof
|
|
37
|
-
l =
|
|
38
|
-
else if (Array.isArray(
|
|
39
|
-
const { 0: d, 1: g } =
|
|
36
|
+
if (typeof n == "function")
|
|
37
|
+
l = n(e);
|
|
38
|
+
else if (Array.isArray(n) && n.length === 2) {
|
|
39
|
+
const { 0: d, 1: g } = n;
|
|
40
40
|
l = d(e, g);
|
|
41
41
|
} else {
|
|
42
|
-
const d =
|
|
42
|
+
const d = n.fn, { options: g } = n;
|
|
43
43
|
l = d(e, g);
|
|
44
44
|
}
|
|
45
45
|
if (l !== !0)
|
|
46
|
-
return
|
|
46
|
+
return u.value = l, !1;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
49
|
-
}, f =
|
|
48
|
+
return u.value = "", !0;
|
|
49
|
+
}, f = a(!1), B = b ? j(() => ({
|
|
50
50
|
focus: (e) => {
|
|
51
51
|
f.value = !0, o("focus", e);
|
|
52
52
|
},
|
|
@@ -68,12 +68,12 @@ const y = (r, { focus: I, emit: o, withListeners: b = !0 }) => {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
return A(() => {
|
|
71
|
-
t.isInsideFormGroup ? t.registerInputGroup(
|
|
71
|
+
t.isInsideFormGroup ? t.registerInputGroup(i.value, I) : c.registerInput(i.value, I, m, F);
|
|
72
72
|
}), O(() => {
|
|
73
|
-
t.isInsideFormGroup ? t.unregisterInputGroup(
|
|
73
|
+
t.isInsideFormGroup ? t.unregisterInputGroup(i.value) : c.unregisterInput(i.value);
|
|
74
74
|
}), {
|
|
75
75
|
isFirstValidation: s,
|
|
76
|
-
errorInternal:
|
|
76
|
+
errorInternal: u,
|
|
77
77
|
hideFooterInternal: v,
|
|
78
78
|
isFocused: f,
|
|
79
79
|
isInsideForm: c.isInsideForm,
|
|
@@ -103,7 +103,8 @@ y.props = () => ({
|
|
|
103
103
|
rules: {
|
|
104
104
|
type: Array,
|
|
105
105
|
default: () => []
|
|
106
|
-
}
|
|
106
|
+
},
|
|
107
|
+
tooltip: String
|
|
107
108
|
});
|
|
108
109
|
export {
|
|
109
110
|
y as useInputtable
|