@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
|
@@ -10,6 +10,7 @@ declare const labelProps: {
|
|
|
10
10
|
type: StringConstructor;
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
|
+
tooltip: StringConstructor;
|
|
13
14
|
size: {
|
|
14
15
|
readonly type: import("vue").PropType<import("../../composables/useCommon").Size>;
|
|
15
16
|
readonly default: "md";
|
|
@@ -30,6 +31,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
30
31
|
type: StringConstructor;
|
|
31
32
|
default: string;
|
|
32
33
|
};
|
|
34
|
+
tooltip: StringConstructor;
|
|
33
35
|
size: {
|
|
34
36
|
readonly type: import("vue").PropType<import("../../composables/useCommon").Size>;
|
|
35
37
|
readonly default: "md";
|
|
@@ -45,6 +47,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
45
47
|
type: StringConstructor;
|
|
46
48
|
default: string;
|
|
47
49
|
};
|
|
50
|
+
tooltip: StringConstructor;
|
|
48
51
|
size: {
|
|
49
52
|
readonly type: import("vue").PropType<import("../../composables/useCommon").Size>;
|
|
50
53
|
readonly default: "md";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as f, openBlock as o, createBlock as t, resolveDynamicComponent as s, normalizeStyle as b, unref as l, normalizeClass as n, withCtx as r, createElementVNode as y, toDisplayString as g, createCommentVNode as i, renderSlot as B } from "vue";
|
|
2
2
|
import { useTheme as C } from "../../composables/useTheme.js";
|
|
3
|
-
import { useCommon as
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { useCommon as p } from "../../composables/useCommon.js";
|
|
4
|
+
import S from "../tooltip/ToggleTip.vue.js";
|
|
5
|
+
const k = {
|
|
6
|
+
...p.props(),
|
|
6
7
|
label: String,
|
|
7
8
|
disabled: Boolean,
|
|
8
9
|
required: Boolean,
|
|
@@ -11,32 +12,37 @@ const S = {
|
|
|
11
12
|
tag: {
|
|
12
13
|
type: String,
|
|
13
14
|
default: "label"
|
|
14
|
-
}
|
|
15
|
-
|
|
15
|
+
},
|
|
16
|
+
tooltip: String
|
|
17
|
+
}, _ = {
|
|
16
18
|
name: "XLabel",
|
|
17
19
|
validators: {
|
|
18
|
-
...
|
|
20
|
+
...p.validators()
|
|
19
21
|
}
|
|
20
|
-
},
|
|
21
|
-
...
|
|
22
|
-
props:
|
|
22
|
+
}, D = /* @__PURE__ */ f({
|
|
23
|
+
..._,
|
|
24
|
+
props: k,
|
|
23
25
|
setup(m) {
|
|
24
|
-
const
|
|
25
|
-
return (e,
|
|
26
|
-
style:
|
|
27
|
-
class:
|
|
26
|
+
const d = m, { styles: c, classes: a, className: u } = C("Label", {}, d);
|
|
27
|
+
return (e, h) => (o(), t(s(e.tag), {
|
|
28
|
+
style: b(l(c)),
|
|
29
|
+
class: n([l(u), l(a).wrapper])
|
|
28
30
|
}, {
|
|
29
|
-
default:
|
|
31
|
+
default: r(() => [
|
|
30
32
|
e.label ? (o(), t(s(e.tag === "fieldset" ? "legend" : "p"), {
|
|
31
33
|
key: 0,
|
|
32
34
|
title: e.label,
|
|
33
|
-
class:
|
|
35
|
+
class: n(l(a).label)
|
|
34
36
|
}, {
|
|
35
|
-
default:
|
|
36
|
-
|
|
37
|
+
default: r(() => [
|
|
38
|
+
y("span", null, g(e.label), 1),
|
|
39
|
+
e.tooltip ? (o(), t(S, {
|
|
40
|
+
key: 0,
|
|
41
|
+
content: e.tooltip
|
|
42
|
+
}, null, 8, ["content"])) : i("", !0)
|
|
37
43
|
]),
|
|
38
44
|
_: 1
|
|
39
|
-
}, 8, ["title", "class"])) :
|
|
45
|
+
}, 8, ["title", "class"])) : i("", !0),
|
|
40
46
|
B(e.$slots, "default")
|
|
41
47
|
]),
|
|
42
48
|
_: 3
|
|
@@ -44,5 +50,5 @@ const S = {
|
|
|
44
50
|
}
|
|
45
51
|
});
|
|
46
52
|
export {
|
|
47
|
-
|
|
53
|
+
D as default
|
|
48
54
|
};
|
|
@@ -5,7 +5,7 @@ const s = {
|
|
|
5
5
|
return t.isInsideForm && e.push("mb-3"), t.block && e.push("w-full"), e;
|
|
6
6
|
},
|
|
7
7
|
label: ({ props: t }) => {
|
|
8
|
-
const e = "font-medium text-
|
|
8
|
+
const e = "flex items-center gap-2 font-medium text-secondary-800 dark:text-secondary-200 mb-1";
|
|
9
9
|
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;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -4,9 +4,9 @@ const s = {
|
|
|
4
4
|
const e = ["block relative align-bottom focus:outline-none"];
|
|
5
5
|
return t.isInsideForm && e.push("mb-8"), t.block && e.push("w-full"), e;
|
|
6
6
|
},
|
|
7
|
-
label: "text-xs text-
|
|
7
|
+
label: "text-xs text-secondary-500 dark:text-secondary-200 mb-2"
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, o = s;
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
o as default
|
|
12
12
|
};
|
|
@@ -3,7 +3,7 @@ import o from "./Link.vue3.js";
|
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const e = {
|
|
5
5
|
$style: o
|
|
6
|
-
},
|
|
6
|
+
}, m = /* @__PURE__ */ t(s, [["__cssModules", e], ["__scopeId", "data-v-81a39d2b"]]);
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
m as default
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as m, openBlock as n, createBlock as p, resolveDynamicComponent as
|
|
1
|
+
import { defineComponent as m, openBlock as n, createBlock as p, resolveDynamicComponent as d, normalizeStyle as u, unref as o, normalizeClass as c, withCtx as f, createElementBlock as k, renderSlot as t, createVNode as y } from "vue";
|
|
2
2
|
import { useColors as h } from "../../composables/useColors.js";
|
|
3
3
|
import { useTheme as g } from "../../composables/useTheme.js";
|
|
4
4
|
import { externalIcon as B } from "../../common/icons.js";
|
|
@@ -7,7 +7,7 @@ const C = {
|
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "inline-flex items-center"
|
|
9
9
|
}, $ = {
|
|
10
|
-
...h.props("
|
|
10
|
+
...h.props("secondary"),
|
|
11
11
|
tag: {
|
|
12
12
|
type: String,
|
|
13
13
|
default: "a"
|
|
@@ -21,9 +21,9 @@ const C = {
|
|
|
21
21
|
props: $,
|
|
22
22
|
setup(s) {
|
|
23
23
|
const l = s, { styles: r, classes: a, className: i } = g("Link", {}, l);
|
|
24
|
-
return (e, v) => (n(), p(
|
|
24
|
+
return (e, v) => (n(), p(d(e.to ? e.tag !== "a" ? e.tag : "router-link" : e.tag), {
|
|
25
25
|
to: e.to,
|
|
26
|
-
style:
|
|
26
|
+
style: u(o(r)),
|
|
27
27
|
class: c([
|
|
28
28
|
o(i),
|
|
29
29
|
e.$style.link,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as C, resolveComponent as B, openBlock as d, createElementBlock as n, normalizeStyle as
|
|
1
|
+
import { defineComponent as C, resolveComponent as B, openBlock as d, createElementBlock as n, normalizeStyle as E, unref as p, normalizeClass as i, Fragment as a, renderList as w, createBlock as u, withCtx as b, createVNode as r, createCommentVNode as M } from "vue";
|
|
2
2
|
import { useCommon as m } from "../../composables/useCommon.js";
|
|
3
|
-
import { useColors as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import
|
|
3
|
+
import { useColors as N } from "../../composables/useColors.js";
|
|
4
|
+
import { useTheme as g } from "../../composables/useTheme.js";
|
|
5
|
+
import c from "./MenuItem.vue.js";
|
|
6
6
|
import A from "../accordion/AccordionItem.vue.js";
|
|
7
7
|
import S from "../divider/Divider.vue.js";
|
|
8
8
|
const V = {
|
|
9
9
|
...m.props(),
|
|
10
|
-
...
|
|
10
|
+
...N.props("secondary"),
|
|
11
11
|
items: Array,
|
|
12
12
|
collapsible: {
|
|
13
13
|
type: Boolean,
|
|
@@ -34,19 +34,19 @@ const V = {
|
|
|
34
34
|
props: V,
|
|
35
35
|
emits: ["expand", "item-click"],
|
|
36
36
|
setup(y) {
|
|
37
|
-
const z = y, { styles: k, classes: v, className: $ } =
|
|
37
|
+
const z = y, { styles: k, classes: v, className: $ } = g("Menu", {}, z);
|
|
38
38
|
return (e, o) => {
|
|
39
|
-
const
|
|
39
|
+
const f = B("x-menu");
|
|
40
40
|
return e.items ? (d(), n("div", {
|
|
41
41
|
key: 0,
|
|
42
|
-
style:
|
|
42
|
+
style: E(p(k)),
|
|
43
43
|
class: i([
|
|
44
44
|
"space-y-1",
|
|
45
45
|
p($),
|
|
46
46
|
p(v).wrapper
|
|
47
47
|
])
|
|
48
48
|
}, [
|
|
49
|
-
(d(!0), n(a, null,
|
|
49
|
+
(d(!0), n(a, null, w(e.items, (l, t) => (d(), n(a, { key: t }, [
|
|
50
50
|
l.items ? (d(), n(a, { key: 0 }, [
|
|
51
51
|
l.collapsible !== !1 ? (d(), u(A, {
|
|
52
52
|
key: 0,
|
|
@@ -57,8 +57,8 @@ const V = {
|
|
|
57
57
|
class: "x-menu-inner space-y-1",
|
|
58
58
|
onExpand: o[1] || (o[1] = (s) => e.$emit("expand"))
|
|
59
59
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
r(
|
|
60
|
+
default: b(({}) => [
|
|
61
|
+
r(c, {
|
|
62
62
|
item: l,
|
|
63
63
|
rounded: e.rounded,
|
|
64
64
|
color: l.color || e.color,
|
|
@@ -68,9 +68,9 @@ const V = {
|
|
|
68
68
|
class: "font-medium"
|
|
69
69
|
}, null, 8, ["item", "rounded", "color", "filled", "size", "disabled"])
|
|
70
70
|
]),
|
|
71
|
-
content:
|
|
72
|
-
r(
|
|
73
|
-
class: i(["border-l ml-4 border-
|
|
71
|
+
content: b(({ expand: s }) => [
|
|
72
|
+
r(f, {
|
|
73
|
+
class: i(["border-l ml-4 border-secondary-100 dark:border-secondary-700", { "pl-1": e.filled }]),
|
|
74
74
|
items: l.items,
|
|
75
75
|
color: l.color || e.color,
|
|
76
76
|
size: l.size || e.size,
|
|
@@ -86,7 +86,7 @@ const V = {
|
|
|
86
86
|
]),
|
|
87
87
|
_: 2
|
|
88
88
|
}, 1032, ["icon", "expanded", "disabled", "show-icon"])) : (d(), n(a, { key: 1 }, [
|
|
89
|
-
r(
|
|
89
|
+
r(c, {
|
|
90
90
|
item: l,
|
|
91
91
|
rounded: e.rounded,
|
|
92
92
|
color: l.color || e.color,
|
|
@@ -97,8 +97,8 @@ const V = {
|
|
|
97
97
|
inactive: "",
|
|
98
98
|
onClick: o[2] || (o[2] = (s) => e.$emit("item-click"))
|
|
99
99
|
}, null, 8, ["item", "rounded", "color", "filled", "size", "disabled"]),
|
|
100
|
-
r(
|
|
101
|
-
class: i(["x-menu-inner space-y-1 ml-4 border-l border-
|
|
100
|
+
r(f, {
|
|
101
|
+
class: i(["x-menu-inner space-y-1 ml-4 border-l border-secondary-100 dark:border-secondary-700", { "pl-1": e.filled }]),
|
|
102
102
|
items: l.items,
|
|
103
103
|
color: l.color || e.color,
|
|
104
104
|
size: l.size || e.size,
|
|
@@ -112,7 +112,7 @@ const V = {
|
|
|
112
112
|
}, null, 8, ["class", "items", "color", "size", "collapsible", "collapse-icon", "expanded", "disabled", "rounded", "filled"])
|
|
113
113
|
], 64))
|
|
114
114
|
], 64)) : (d(), n(a, { key: 1 }, [
|
|
115
|
-
l.divider ? (d(), u(S, { key: 0 })) : (d(), u(
|
|
115
|
+
l.divider ? (d(), u(S, { key: 0 })) : (d(), u(c, {
|
|
116
116
|
key: 1,
|
|
117
117
|
item: l,
|
|
118
118
|
rounded: e.rounded,
|
|
@@ -126,7 +126,7 @@ const V = {
|
|
|
126
126
|
}, null, 8, ["item", "rounded", "color", "filled", "size", "disabled", "class"]))
|
|
127
127
|
], 64))
|
|
128
128
|
], 64))), 128))
|
|
129
|
-
], 6)) :
|
|
129
|
+
], 6)) : M("", !0);
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
});
|
|
@@ -1,58 +1,48 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = {
|
|
2
2
|
classes: {
|
|
3
|
-
wrapper: ({ props:
|
|
4
|
-
const
|
|
5
|
-
return i.push(
|
|
6
|
-
"font-medium": a.isActive,
|
|
7
|
-
"cursor-pointer": !r.disabled,
|
|
8
|
-
// size
|
|
9
|
-
"py-1 text-xs": r.size === "xs",
|
|
10
|
-
"py-2 text-sm": r.size === "sm",
|
|
11
|
-
"py-1.5": !r.size || !["xs", "sm", "lg", "xl"].includes(r.size),
|
|
12
|
-
"py-3": r.size === "lg",
|
|
13
|
-
"py-4 text-lg": r.size === "xl",
|
|
14
|
-
rounded: r.rounded
|
|
15
|
-
}), i;
|
|
3
|
+
wrapper: ({ props: i, data: s }) => {
|
|
4
|
+
const r = ["relative !flex items-center whitespace-nowrap px-3"];
|
|
5
|
+
return i.disabled || r.push("cursor-pointer"), s.isActive && r.push("font-medium"), i.rounded && r.push("rounded"), i.size === "xs" ? r.push("py-1 text-xs") : i.size === "sm" ? r.push("py-1.5 text-sm") : i.size === "lg" ? r.push("py-3") : i.size === "xl" ? r.push("py-4 text-lg") : r.push("py-1.5"), r;
|
|
16
6
|
}
|
|
17
7
|
},
|
|
18
|
-
styles: ({ colors:
|
|
19
|
-
const e =
|
|
20
|
-
return
|
|
8
|
+
styles: ({ colors: i, props: s, css: r, data: a }) => {
|
|
9
|
+
const e = i.getPalette(s.color || "gray"), t = i.getPalette("secondary");
|
|
10
|
+
return s.disabled ? r.variables({
|
|
21
11
|
text: t[300],
|
|
22
12
|
dark: {
|
|
23
13
|
text: t[600]
|
|
24
14
|
}
|
|
25
|
-
}) :
|
|
26
|
-
bg:
|
|
27
|
-
text: e[
|
|
15
|
+
}) : s.filled ? a.isActive ? r.variables({
|
|
16
|
+
bg: s.selected ? e[100] : e[200],
|
|
17
|
+
text: e[800],
|
|
28
18
|
hover: {
|
|
29
|
-
bg:
|
|
30
|
-
text: e[
|
|
19
|
+
bg: (s.selected, e[200]),
|
|
20
|
+
text: e[800]
|
|
31
21
|
},
|
|
32
22
|
dark: {
|
|
33
|
-
bg: (
|
|
23
|
+
bg: (s.selected, e[700]),
|
|
34
24
|
text: e[100],
|
|
35
25
|
hover: {
|
|
36
|
-
bg: (
|
|
26
|
+
bg: (s.selected, e[700]),
|
|
37
27
|
text: e[100]
|
|
38
28
|
}
|
|
39
29
|
}
|
|
40
|
-
}) :
|
|
41
|
-
bg:
|
|
30
|
+
}) : r.variables({
|
|
31
|
+
bg: s.selected ? t[100] : "transparent",
|
|
42
32
|
text: t[800],
|
|
43
33
|
hover: {
|
|
44
|
-
bg: t[
|
|
34
|
+
bg: t[100],
|
|
45
35
|
text: t[900]
|
|
46
36
|
},
|
|
47
37
|
dark: {
|
|
48
|
-
bg:
|
|
38
|
+
bg: s.selected ? t[800] : "transparent",
|
|
49
39
|
text: t[200],
|
|
50
40
|
hover: {
|
|
51
41
|
bg: t[600],
|
|
52
42
|
text: t[100]
|
|
53
43
|
}
|
|
54
44
|
}
|
|
55
|
-
}) :
|
|
45
|
+
}) : a.isActive ? r.variables({
|
|
56
46
|
text: e[500],
|
|
57
47
|
hover: {
|
|
58
48
|
text: e[500],
|
|
@@ -65,7 +55,7 @@ const x = {
|
|
|
65
55
|
border: e[500]
|
|
66
56
|
}
|
|
67
57
|
}
|
|
68
|
-
}) :
|
|
58
|
+
}) : r.variables({
|
|
69
59
|
text: t[800],
|
|
70
60
|
hover: {
|
|
71
61
|
text: t[900],
|
|
@@ -80,7 +70,7 @@ const x = {
|
|
|
80
70
|
}
|
|
81
71
|
});
|
|
82
72
|
}
|
|
83
|
-
}, d =
|
|
73
|
+
}, d = l;
|
|
84
74
|
export {
|
|
85
75
|
d as default
|
|
86
76
|
};
|
|
@@ -36,6 +36,7 @@ declare const modalProps: {
|
|
|
36
36
|
type: PropType<[FormError[], FormError]>;
|
|
37
37
|
default: () => never[];
|
|
38
38
|
};
|
|
39
|
+
persistent: BooleanConstructor;
|
|
39
40
|
};
|
|
40
41
|
export type ModalSize = typeof modalSize[number];
|
|
41
42
|
export type ModalProps = ExtractPublicPropTypes<typeof modalProps>;
|
|
@@ -79,6 +80,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
79
80
|
type: PropType<[FormError[], FormError]>;
|
|
80
81
|
default: () => never[];
|
|
81
82
|
};
|
|
83
|
+
persistent: BooleanConstructor;
|
|
82
84
|
}, {
|
|
83
85
|
open: () => void;
|
|
84
86
|
close: () => void;
|
|
@@ -116,6 +118,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
116
118
|
type: PropType<[FormError[], FormError]>;
|
|
117
119
|
default: () => never[];
|
|
118
120
|
};
|
|
121
|
+
persistent: BooleanConstructor;
|
|
119
122
|
}>> & {
|
|
120
123
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
121
124
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -132,6 +135,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
132
135
|
formDisabled: boolean;
|
|
133
136
|
formAutoValidate: boolean;
|
|
134
137
|
formErrors: [FormError[], FormError];
|
|
138
|
+
persistent: boolean;
|
|
135
139
|
}, {}>, {
|
|
136
140
|
image?(_: {}): any;
|
|
137
141
|
header?(_: {}): any;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { onClickOutside as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { closeIcon as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as j, ref as f, watch as B, nextTick as g, useSlots as H, computed as I, openBlock as t, createBlock as p, Teleport as M, createElementBlock as i, normalizeStyle as P, unref as o, normalizeClass as s, createCommentVNode as a, createElementVNode as S, resolveDynamicComponent as W, withCtx as w, renderSlot as r, toDisplayString as v } from "vue";
|
|
2
|
+
import { onClickOutside as K, useEventListener as L } from "../../node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import { useTheme as q } from "../../composables/useTheme.js";
|
|
4
|
+
import { useFocusTrap as G } from "../../composables/useFocusTrap.js";
|
|
5
|
+
import { closeIcon as J } from "../../common/icons.js";
|
|
6
|
+
import Q from "../button/Button.vue.js";
|
|
7
|
+
import U from "../scroll/Scroll.vue.js";
|
|
8
|
+
import Y from "../form/Form.vue.js";
|
|
9
|
+
const Z = { class: "flex items-end sm:items-center justify-center p-4 sm:p-6 h-screen" }, _ = { key: 0 }, x = ["xs", "sm", "md", "lg", "xl", "full"], ee = {
|
|
10
10
|
size: {
|
|
11
11
|
type: String,
|
|
12
12
|
default: "xl"
|
|
@@ -40,61 +40,65 @@ const Y = { class: "flex items-end sm:items-center justify-center p-4 sm:p-6 h-s
|
|
|
40
40
|
formErrors: {
|
|
41
41
|
type: [Array, Object],
|
|
42
42
|
default: () => []
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
},
|
|
44
|
+
persistent: Boolean
|
|
45
|
+
}, oe = {
|
|
45
46
|
name: "XModal",
|
|
46
47
|
validators: {
|
|
47
|
-
size:
|
|
48
|
+
size: x
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
-
...
|
|
51
|
-
props:
|
|
50
|
+
}, ce = /* @__PURE__ */ j({
|
|
51
|
+
...oe,
|
|
52
|
+
props: ee,
|
|
52
53
|
emits: ["update:modelValue", "submit"],
|
|
53
|
-
setup(V, { expose: $, emit:
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
setup(V, { expose: $, emit: C }) {
|
|
55
|
+
const n = V, b = C, u = f(n.modelValue), d = f(!1), y = f(null), T = f(null), { initFocusTrap: D, clearFocusTrap: z } = G();
|
|
56
|
+
let c;
|
|
57
|
+
B(u, (e) => {
|
|
58
|
+
c && (c(), c = void 0), e && setTimeout(() => {
|
|
59
|
+
c = K(y, F);
|
|
59
60
|
});
|
|
60
|
-
}),
|
|
61
|
+
}), B(() => n.modelValue, E, { immediate: !0 });
|
|
61
62
|
async function E() {
|
|
62
|
-
const e =
|
|
63
|
-
e ? (
|
|
63
|
+
const e = n.modelValue;
|
|
64
|
+
e ? (u.value = e, await g(), d.value = e, await g(), D(y), document.body.style.overflow = "hidden") : (d.value = e, u.value = e, z(), document.body.style.overflow = "auto");
|
|
64
65
|
}
|
|
65
|
-
typeof window < "u" &&
|
|
66
|
+
typeof window < "u" && L(document, "keydown", A);
|
|
66
67
|
function A(e) {
|
|
67
|
-
e.key === "Escape" &&
|
|
68
|
+
e.key === "Escape" && u.value && !n.persistent && m();
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
n.
|
|
70
|
+
function F() {
|
|
71
|
+
n.persistent || m();
|
|
72
|
+
}
|
|
73
|
+
function m() {
|
|
74
|
+
d.value = !1, setTimeout(() => {
|
|
71
75
|
b("update:modelValue", !1);
|
|
72
76
|
}, 150);
|
|
73
77
|
}
|
|
74
|
-
function
|
|
75
|
-
b("update:modelValue", !0),
|
|
78
|
+
function O() {
|
|
79
|
+
b("update:modelValue", !0), d.value = !0;
|
|
76
80
|
}
|
|
77
|
-
const k =
|
|
78
|
-
visible:
|
|
81
|
+
const k = H(), R = I(() => !!(k["tertiary-action"] || k["cancel-action"])), { styles: N, classes: l, className: X } = q("Modal", {}, n, {
|
|
82
|
+
visible: d
|
|
79
83
|
});
|
|
80
|
-
return $({ open:
|
|
81
|
-
|
|
84
|
+
return $({ open: O, close: m }), (e, h) => (t(), p(M, { to: "body" }, [
|
|
85
|
+
u.value ? (t(), i("div", {
|
|
82
86
|
key: 0,
|
|
83
87
|
ref_key: "modalWrapperRef",
|
|
84
|
-
ref:
|
|
85
|
-
style:
|
|
86
|
-
class:
|
|
87
|
-
o(
|
|
88
|
-
o(
|
|
89
|
-
|
|
88
|
+
ref: T,
|
|
89
|
+
style: P(o(N)),
|
|
90
|
+
class: s([
|
|
91
|
+
o(X),
|
|
92
|
+
o(l).wrapper,
|
|
93
|
+
d.value ? "visible" : "invisible ease-in duration-100"
|
|
90
94
|
])
|
|
91
95
|
}, [
|
|
92
|
-
e.backdrop ? (
|
|
96
|
+
e.backdrop ? (t(), i("div", {
|
|
93
97
|
key: 0,
|
|
94
|
-
class:
|
|
95
|
-
}, null, 2)) :
|
|
96
|
-
S("div",
|
|
97
|
-
(
|
|
98
|
+
class: s(o(l).backdrop)
|
|
99
|
+
}, null, 2)) : a("", !0),
|
|
100
|
+
S("div", Z, [
|
|
101
|
+
(t(), p(W(e.isForm ? Y : "div"), {
|
|
98
102
|
ref_key: "modalRef",
|
|
99
103
|
ref: y,
|
|
100
104
|
disabled: e.formDisabled,
|
|
@@ -102,78 +106,78 @@ const Y = { class: "flex items-end sm:items-center justify-center p-4 sm:p-6 h-s
|
|
|
102
106
|
title: e.formTitle,
|
|
103
107
|
description: e.formDescription,
|
|
104
108
|
errors: e.formErrors,
|
|
105
|
-
class:
|
|
109
|
+
class: s(o(l).modal),
|
|
106
110
|
"auto-focus": "",
|
|
107
111
|
"has-footer": !1,
|
|
108
112
|
role: "dialog",
|
|
109
113
|
"aria-modal": "true",
|
|
110
114
|
"aria-labelledby": "modal-headline",
|
|
111
|
-
onSubmit: h[0] || (h[0] = (
|
|
115
|
+
onSubmit: h[0] || (h[0] = (te) => e.$emit("submit"))
|
|
112
116
|
}, {
|
|
113
117
|
default: w(() => [
|
|
114
118
|
r(e.$slots, "image"),
|
|
115
|
-
e.hasHeader ? (
|
|
119
|
+
e.hasHeader ? (t(), i("div", {
|
|
116
120
|
key: 0,
|
|
117
|
-
class:
|
|
121
|
+
class: s(o(l).header)
|
|
118
122
|
}, [
|
|
119
123
|
r(e.$slots, "header", {}, () => [
|
|
120
|
-
e.label ? (
|
|
124
|
+
e.label ? (t(), i("div", {
|
|
121
125
|
key: 0,
|
|
122
|
-
class:
|
|
123
|
-
}, v(e.label), 3)) :
|
|
124
|
-
e.title ? (
|
|
126
|
+
class: s(o(l).label)
|
|
127
|
+
}, v(e.label), 3)) : a("", !0),
|
|
128
|
+
e.title ? (t(), i("div", {
|
|
125
129
|
key: 1,
|
|
126
|
-
class:
|
|
127
|
-
}, v(e.title), 3)) :
|
|
130
|
+
class: s(o(l).title)
|
|
131
|
+
}, v(e.title), 3)) : a("", !0)
|
|
128
132
|
])
|
|
129
|
-
], 2)) :
|
|
130
|
-
e.$slots.default ? (
|
|
133
|
+
], 2)) : a("", !0),
|
|
134
|
+
e.$slots.default ? (t(), p(U, {
|
|
131
135
|
key: 1,
|
|
132
136
|
scrollbar: !1,
|
|
133
137
|
vertical: ""
|
|
134
138
|
}, {
|
|
135
139
|
default: w(() => [
|
|
136
140
|
S("div", {
|
|
137
|
-
class:
|
|
141
|
+
class: s(o(l).content)
|
|
138
142
|
}, [
|
|
139
|
-
e.description ? (
|
|
143
|
+
e.description ? (t(), i("div", {
|
|
140
144
|
key: 0,
|
|
141
|
-
class:
|
|
142
|
-
}, v(e.description), 3)) :
|
|
145
|
+
class: s(o(l).description)
|
|
146
|
+
}, v(e.description), 3)) : a("", !0),
|
|
143
147
|
r(e.$slots, "default")
|
|
144
148
|
], 2)
|
|
145
149
|
]),
|
|
146
150
|
_: 3
|
|
147
|
-
})) :
|
|
148
|
-
e.showClose ? (
|
|
151
|
+
})) : a("", !0),
|
|
152
|
+
e.showClose ? (t(), p(Q, {
|
|
149
153
|
key: 2,
|
|
150
154
|
ghost: "",
|
|
151
|
-
size: "
|
|
155
|
+
size: "sm",
|
|
152
156
|
tabindex: "-1",
|
|
153
|
-
icon: o(
|
|
154
|
-
class:
|
|
155
|
-
onClick:
|
|
156
|
-
}, null, 8, ["icon", "class"])) :
|
|
157
|
-
e.hasActions ? (
|
|
157
|
+
icon: o(J),
|
|
158
|
+
class: s(o(l).closeIcon),
|
|
159
|
+
onClick: m
|
|
160
|
+
}, null, 8, ["icon", "class"])) : a("", !0),
|
|
161
|
+
e.hasActions ? (t(), i("div", {
|
|
158
162
|
key: 3,
|
|
159
|
-
class:
|
|
163
|
+
class: s(o(l).actions)
|
|
160
164
|
}, [
|
|
161
165
|
r(e.$slots, "actions", {}, () => [
|
|
162
166
|
r(e.$slots, "cancel-action"),
|
|
163
|
-
R.value ? (
|
|
167
|
+
R.value ? (t(), i("div", _)) : a("", !0),
|
|
164
168
|
r(e.$slots, "tertiary-action"),
|
|
165
169
|
r(e.$slots, "secondary-action"),
|
|
166
170
|
r(e.$slots, "primary-action")
|
|
167
171
|
])
|
|
168
|
-
], 2)) :
|
|
172
|
+
], 2)) : a("", !0)
|
|
169
173
|
]),
|
|
170
174
|
_: 3
|
|
171
175
|
}, 40, ["disabled", "auto-validate", "title", "description", "errors", "class"]))
|
|
172
176
|
])
|
|
173
|
-
], 6)) :
|
|
177
|
+
], 6)) : a("", !0)
|
|
174
178
|
]));
|
|
175
179
|
}
|
|
176
180
|
});
|
|
177
181
|
export {
|
|
178
|
-
|
|
182
|
+
ce as default
|
|
179
183
|
};
|