@robuust-digital/vue-components 2.1.0 → 2.2.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/CHANGELOG.md +6 -0
- package/dist/_shared/ButtonBase.vue_vue_type_script_setup_true_lang-DeflHqux.js +60 -0
- package/dist/_shared/ChevronDownIcon-DaaXfD3C.js +41 -0
- package/dist/_shared/Combobox.vue_vue_type_script_setup_true_lang-CP3x2DUA.js +266 -0
- package/dist/_shared/Drawer.vue_vue_type_script_setup_true_lang-CD5914Fk.js +185 -0
- package/dist/_shared/Dropdown.vue_vue_type_script_setup_true_lang-CmYj-7WQ.js +115 -0
- package/dist/_shared/FormInput.vue_vue_type_script_setup_true_lang-BhJpG-Fw.js +75 -0
- package/dist/_shared/Lightswitch.vue_vue_type_script_setup_true_lang-DX23lEFd.js +43 -0
- package/dist/_shared/Modal.vue_vue_type_script_setup_true_lang-CoHkAJj3.js +186 -0
- package/dist/_shared/RichTextEditor.vue_vue_type_script_setup_true_lang-CIVhqJtE.js +274 -0
- package/dist/_shared/Tabs.vue_vue_type_script_setup_true_lang-BgOTdYXd.js +676 -0
- package/dist/_shared/Toast.vue_vue_type_script_setup_true_lang-Be3i_0zE.js +78 -0
- package/dist/_shared/Tooltip.vue_vue_type_script_setup_true_lang-CoydN9sS.js +96 -0
- package/dist/_shared/{icon-spinner-CmxIOqaK.js → icon-spinner-CP0VP_YM.js} +2 -2
- package/dist/combobox/index.js +3 -347
- package/dist/combobox.d.ts +132 -0
- package/dist/core/index.js +17 -826
- package/dist/core.d.ts +669 -0
- package/dist/dialogs/index.js +4 -216
- package/dist/dialogs.d.ts +226 -0
- package/dist/dropdown/index.js +3 -131
- package/dist/dropdown.d.ts +145 -0
- package/dist/index/index.js +35 -0
- package/dist/index.d.ts +1343 -0
- package/dist/lightswitch/index.js +3 -47
- package/dist/lightswitch.d.ts +39 -0
- package/dist/rich-text-editor/index.js +3 -261
- package/dist/rich-text-editor.d.ts +89 -0
- package/dist/toast/index.js +3 -99
- package/dist/toast.d.ts +66 -0
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip.d.ts +61 -0
- package/package.json +69 -38
- package/dist/_shared/ButtonBase-DfkwHIhN.js +0 -87
- package/dist/_shared/ChevronDownIcon-z-5U4fIb.js +0 -55
- package/dist/_shared/FormInput-B-SQTZTA.js +0 -92
- package/dist/_shared/Modal-Bw2sID1x.js +0 -213
- package/dist/_shared/Tooltip-B93ZF7IF.js +0 -126
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robuust-digital/vue-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,26 +22,54 @@
|
|
|
22
22
|
"README.md",
|
|
23
23
|
"CHANGELOG.md"
|
|
24
24
|
],
|
|
25
|
-
"main": "./dist/
|
|
26
|
-
"module": "./dist/
|
|
25
|
+
"main": "./dist/index/index.js",
|
|
26
|
+
"module": "./dist/index/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
27
28
|
"exports": {
|
|
28
|
-
".":
|
|
29
|
-
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./core": {
|
|
34
|
+
"import": "./dist/core/index.js",
|
|
35
|
+
"types": "./dist/core.d.ts"
|
|
36
|
+
},
|
|
30
37
|
"./core/css": "./dist/core/styles.css",
|
|
31
38
|
"./core/theme": "./dist/core/theme.css",
|
|
32
|
-
"./combobox":
|
|
39
|
+
"./combobox": {
|
|
40
|
+
"import": "./dist/combobox/index.js",
|
|
41
|
+
"types": "./dist/combobox.d.ts"
|
|
42
|
+
},
|
|
33
43
|
"./combobox/css": "./dist/combobox/styles.css",
|
|
34
|
-
"./dialogs":
|
|
44
|
+
"./dialogs": {
|
|
45
|
+
"import": "./dist/dialogs/index.js",
|
|
46
|
+
"types": "./dist/dialogs.d.ts"
|
|
47
|
+
},
|
|
35
48
|
"./dialogs/css": "./dist/dialogs/styles.css",
|
|
36
|
-
"./dropdown":
|
|
49
|
+
"./dropdown": {
|
|
50
|
+
"import": "./dist/dropdown/index.js",
|
|
51
|
+
"types": "./dist/dropdown.d.ts"
|
|
52
|
+
},
|
|
37
53
|
"./dropdown/css": "./dist/dropdown/styles.css",
|
|
38
|
-
"./lightswitch":
|
|
54
|
+
"./lightswitch": {
|
|
55
|
+
"import": "./dist/lightswitch/index.js",
|
|
56
|
+
"types": "./dist/lightswitch.d.ts"
|
|
57
|
+
},
|
|
39
58
|
"./lightswitch/css": "./dist/lightswitch/styles.css",
|
|
40
|
-
"./rich-text-editor":
|
|
59
|
+
"./rich-text-editor": {
|
|
60
|
+
"import": "./dist/rich-text-editor/index.js",
|
|
61
|
+
"types": "./dist/rich-text-editor.d.ts"
|
|
62
|
+
},
|
|
41
63
|
"./rich-text-editor/css": "./dist/rich-text-editor/styles.css",
|
|
42
|
-
"./toast":
|
|
64
|
+
"./toast": {
|
|
65
|
+
"import": "./dist/toast/index.js",
|
|
66
|
+
"types": "./dist/toast.d.ts"
|
|
67
|
+
},
|
|
43
68
|
"./toast/css": "./dist/toast/styles.css",
|
|
44
|
-
"./tooltip":
|
|
69
|
+
"./tooltip": {
|
|
70
|
+
"import": "./dist/tooltip/index.js",
|
|
71
|
+
"types": "./dist/tooltip.d.ts"
|
|
72
|
+
},
|
|
45
73
|
"./tooltip/css": "./dist/tooltip/styles.css"
|
|
46
74
|
},
|
|
47
75
|
"scripts": {
|
|
@@ -52,44 +80,47 @@
|
|
|
52
80
|
"docs:preview": "vitepress preview docs",
|
|
53
81
|
"test:unit": "vitest run",
|
|
54
82
|
"lint": "eslint .",
|
|
55
|
-
"lint:style": "stylelint 'src/**/*.{vue,css}'"
|
|
83
|
+
"lint:style": "stylelint 'src/**/*.{vue,css}'",
|
|
84
|
+
"type-check": "npx vue-tsc --noEmit --project tsconfig.json --project tests/tsconfig.json"
|
|
56
85
|
},
|
|
57
86
|
"dependencies": {
|
|
58
|
-
"@floating-ui/vue": "^1.1.
|
|
87
|
+
"@floating-ui/vue": "^1.1.9",
|
|
59
88
|
"@headlessui/vue": "^1.7.23",
|
|
60
89
|
"@heroicons/vue": "^2.2.0",
|
|
61
|
-
"@tiptap/starter-kit": "^3.0
|
|
62
|
-
"@tiptap/vue-3": "^3.0
|
|
63
|
-
"@vueuse/core": "^13.
|
|
64
|
-
"vue": "^3.5.
|
|
90
|
+
"@tiptap/starter-kit": "^3.5.0",
|
|
91
|
+
"@tiptap/vue-3": "^3.5.0",
|
|
92
|
+
"@vueuse/core": "^13.9.0",
|
|
93
|
+
"vue": "^3.5.21"
|
|
65
94
|
},
|
|
66
95
|
"devDependencies": {
|
|
67
|
-
"@rushstack/eslint-patch": "^1.
|
|
68
|
-
"@tailwindcss/postcss": "^4.
|
|
69
|
-
"@tailwindcss/vite": "^4.
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
96
|
+
"@rushstack/eslint-patch": "^1.12.0",
|
|
97
|
+
"@tailwindcss/postcss": "^4.1.13",
|
|
98
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
99
|
+
"@types/node": "^24.5.2",
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
101
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
102
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
103
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
104
|
+
"@vue/eslint-config-airbnb-with-typescript": "^8.0.0",
|
|
73
105
|
"@vue/test-utils": "^2.4.6",
|
|
74
106
|
"eslint": "^8.57.1",
|
|
75
|
-
"eslint-plugin-vue": "^9.
|
|
76
|
-
"jsdom": "^
|
|
77
|
-
"postcss": "^8.5.
|
|
107
|
+
"eslint-plugin-vue": "^9.33.0",
|
|
108
|
+
"jsdom": "^27.0.0",
|
|
109
|
+
"postcss": "^8.5.6",
|
|
78
110
|
"postcss-html": "^1.8.0",
|
|
79
111
|
"postcss-scss": "^4.0.9",
|
|
80
|
-
"stylelint": "^16.
|
|
112
|
+
"stylelint": "^16.24.0",
|
|
81
113
|
"stylelint-config-property-sort-order-smacss": "^10.0.0",
|
|
82
114
|
"stylelint-config-standard": "^39.0.0",
|
|
83
|
-
"tailwindcss": "^4.
|
|
84
|
-
"
|
|
85
|
-
"vite
|
|
86
|
-
"vite-plugin-
|
|
115
|
+
"tailwindcss": "^4.1.13",
|
|
116
|
+
"typescript": "^5.9.2",
|
|
117
|
+
"vite": "^6.3.6",
|
|
118
|
+
"vite-plugin-dts": "^4.5.4",
|
|
119
|
+
"vite-plugin-static-copy": "^3.1.2",
|
|
120
|
+
"vite-plugin-vue-devtools": "^8.0.2",
|
|
87
121
|
"vite-svg-loader": "^5.1.0",
|
|
88
|
-
"vitepress": "^2.0.0-alpha.
|
|
89
|
-
"vitest": "^3.
|
|
122
|
+
"vitepress": "^2.0.0-alpha.12",
|
|
123
|
+
"vitest": "^3.2.4"
|
|
90
124
|
},
|
|
91
|
-
"
|
|
92
|
-
"@vueuse/core": "^13.0.0"
|
|
93
|
-
},
|
|
94
|
-
"packageManager": "yarn@4.9.1"
|
|
125
|
+
"packageManager": "yarn@4.9.2"
|
|
95
126
|
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { watchEffect as u, createBlock as i, openBlock as t, resolveDynamicComponent as c, mergeProps as b, withCtx as d, createElementBlock as y, renderSlot as l, createCommentVNode as a, createTextVNode as r, toDisplayString as s, unref as f } from "vue";
|
|
2
|
-
import { S as g } from "./icon-spinner-CmxIOqaK.js";
|
|
3
|
-
const m = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "rvc-button-label"
|
|
6
|
-
}, O = {
|
|
7
|
-
__name: "ButtonBase",
|
|
8
|
-
props: {
|
|
9
|
-
as: {
|
|
10
|
-
type: [String, Object, Function],
|
|
11
|
-
default: "button"
|
|
12
|
-
},
|
|
13
|
-
bindAs: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: void 0
|
|
16
|
-
},
|
|
17
|
-
label: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: ""
|
|
20
|
-
},
|
|
21
|
-
icon: {
|
|
22
|
-
type: [Object, Function],
|
|
23
|
-
default: null
|
|
24
|
-
},
|
|
25
|
-
iconOnly: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
29
|
-
iconLeft: {
|
|
30
|
-
type: Boolean
|
|
31
|
-
},
|
|
32
|
-
size: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: "base",
|
|
35
|
-
validator: (n) => ["sm", "base"].includes(n)
|
|
36
|
-
},
|
|
37
|
-
spinning: {
|
|
38
|
-
type: Boolean
|
|
39
|
-
},
|
|
40
|
-
color: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: "primary",
|
|
43
|
-
validator: (n) => typeof n != "string" ? !1 : /^(primary|secondary|tertiary|light|dark|green|red|yellow|blue|green-soft|red-soft|yellow-soft|blue-soft)?$/.test(n) || n.startsWith("custom-") || n === "clear"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
setup(n) {
|
|
47
|
-
const o = n;
|
|
48
|
-
return u(() => {
|
|
49
|
-
o.iconOnly && !o.icon && console.warn("[ButtonBase] Using iconOnly prop without providing an icon may result in an empty button.");
|
|
50
|
-
}), (e, v) => (t(), i(c(n.as), b(n.bindAs ? { as: n.bindAs } : {}, {
|
|
51
|
-
class: ["rvc-button", `rvc-button-${n.color}`, `rvc-button-${n.size}`, { "rvc-button-reverse": n.iconLeft }, { "rvc-button-icon-only": n.iconOnly }],
|
|
52
|
-
"aria-label": n.iconOnly ? n.label : null,
|
|
53
|
-
"aria-busy": n.spinning
|
|
54
|
-
}), {
|
|
55
|
-
default: d(() => [
|
|
56
|
-
n.iconOnly && n.label ? (t(), y("span", m, [
|
|
57
|
-
l(e.$slots, "default", { label: n.label }, () => [
|
|
58
|
-
r(s(n.label), 1)
|
|
59
|
-
])
|
|
60
|
-
])) : n.label ? l(e.$slots, "default", {
|
|
61
|
-
key: 1,
|
|
62
|
-
label: n.label
|
|
63
|
-
}, () => [
|
|
64
|
-
r(s(n.label), 1)
|
|
65
|
-
]) : a("", !0),
|
|
66
|
-
l(e.$slots, "icon", { icon: n.icon }, () => [
|
|
67
|
-
n.icon && !n.spinning ? (t(), i(c(n.icon), {
|
|
68
|
-
key: 0,
|
|
69
|
-
class: "rvc-button-icon",
|
|
70
|
-
"aria-hidden": !n.iconOnly
|
|
71
|
-
}, null, 8, ["aria-hidden"])) : a("", !0)
|
|
72
|
-
]),
|
|
73
|
-
l(e.$slots, "spinner", { spinning: n.spinning }, () => [
|
|
74
|
-
n.spinning ? (t(), i(f(g), {
|
|
75
|
-
key: 0,
|
|
76
|
-
class: "rvc-button-icon rvc-button-icon-loading",
|
|
77
|
-
"aria-hidden": "true"
|
|
78
|
-
})) : a("", !0)
|
|
79
|
-
])
|
|
80
|
-
]),
|
|
81
|
-
_: 3
|
|
82
|
-
}, 16, ["class", "aria-label", "aria-busy"]));
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
export {
|
|
86
|
-
O as _
|
|
87
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createBlock as l, openBlock as a, resolveDynamicComponent as r, normalizeClass as n, withCtx as o, renderSlot as s, createTextVNode as i, toDisplayString as c, createElementBlock as d, createElementVNode as u } from "vue";
|
|
2
|
-
const m = {
|
|
3
|
-
__name: "Badge",
|
|
4
|
-
props: {
|
|
5
|
-
as: {
|
|
6
|
-
type: String,
|
|
7
|
-
default: "span"
|
|
8
|
-
},
|
|
9
|
-
label: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: ""
|
|
12
|
-
},
|
|
13
|
-
size: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: "base",
|
|
16
|
-
validator: (e) => ["sm", "base"].includes(e)
|
|
17
|
-
},
|
|
18
|
-
color: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "default",
|
|
21
|
-
validator: (e) => typeof e != "string" ? !1 : /^(default|gray|red|yellow|green|blue|violet|purple|pink)?$/.test(e) || e.startsWith("custom-")
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
setup(e) {
|
|
25
|
-
return (t, f) => (a(), l(r(e.as), {
|
|
26
|
-
class: n(["rvc-badge", `rvc-badge-${e.color}`, `rvc-badge-${e.size}`])
|
|
27
|
-
}, {
|
|
28
|
-
default: o(() => [
|
|
29
|
-
s(t.$slots, "default", { label: e.label }, () => [
|
|
30
|
-
i(c(e.label), 1)
|
|
31
|
-
])
|
|
32
|
-
]),
|
|
33
|
-
_: 3
|
|
34
|
-
}, 8, ["class"]));
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
function p(e, t) {
|
|
38
|
-
return a(), d("svg", {
|
|
39
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
-
viewBox: "0 0 20 20",
|
|
41
|
-
fill: "currentColor",
|
|
42
|
-
"aria-hidden": "true",
|
|
43
|
-
"data-slot": "icon"
|
|
44
|
-
}, [
|
|
45
|
-
u("path", {
|
|
46
|
-
"fill-rule": "evenodd",
|
|
47
|
-
d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",
|
|
48
|
-
"clip-rule": "evenodd"
|
|
49
|
-
})
|
|
50
|
-
]);
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
m as _,
|
|
54
|
-
p as r
|
|
55
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { computed as v, getCurrentInstance as $, useSlots as I, ref as b, createElementBlock as s, openBlock as n, normalizeClass as x, createCommentVNode as u, renderSlot as i, unref as r, createBlock as f, resolveDynamicComponent as m, normalizeProps as V, guardReactiveProps as B, withDirectives as C, mergeProps as y, vModelDynamic as O } from "vue";
|
|
2
|
-
const S = () => ({ hasModelBinding: v(() => {
|
|
3
|
-
var l;
|
|
4
|
-
const o = $();
|
|
5
|
-
return ((l = o == null ? void 0 : o.vnode) == null ? void 0 : l.props) && Object.prototype.hasOwnProperty.call(o.vnode.props, "onUpdate:modelValue");
|
|
6
|
-
}) }), j = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "rvc-input-prefix"
|
|
9
|
-
}, z = ["type"], F = ["type"], M = {
|
|
10
|
-
key: 1,
|
|
11
|
-
class: "rvc-input-suffix"
|
|
12
|
-
}, D = /* @__PURE__ */ Object.assign({
|
|
13
|
-
inheritAttrs: !1
|
|
14
|
-
}, {
|
|
15
|
-
__name: "FormInput",
|
|
16
|
-
props: {
|
|
17
|
-
modelValue: {
|
|
18
|
-
type: [String, Number],
|
|
19
|
-
default: void 0
|
|
20
|
-
},
|
|
21
|
-
rootClass: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ""
|
|
24
|
-
},
|
|
25
|
-
prefixIcon: {
|
|
26
|
-
type: [Object, Function],
|
|
27
|
-
default: null
|
|
28
|
-
},
|
|
29
|
-
icon: {
|
|
30
|
-
type: [Object, Function],
|
|
31
|
-
default: null
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: "base",
|
|
36
|
-
validator: (e) => ["sm", "base"].includes(e)
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
emits: ["update:modelValue"],
|
|
40
|
-
setup(e, { emit: o }) {
|
|
41
|
-
const l = e, g = o, { hasModelBinding: h } = S(), a = I(), c = b(null), d = v({
|
|
42
|
-
get: () => l.modelValue,
|
|
43
|
-
set: (t) => g("update:modelValue", t)
|
|
44
|
-
});
|
|
45
|
-
return (t, p) => (n(), s("div", {
|
|
46
|
-
class: x([
|
|
47
|
-
"rvc-input",
|
|
48
|
-
`rvc-input-${e.size}`,
|
|
49
|
-
e.rootClass
|
|
50
|
-
])
|
|
51
|
-
}, [
|
|
52
|
-
r(a).prefix || r(a).prefixIcon || e.prefixIcon ? (n(), s("span", j, [
|
|
53
|
-
i(t.$slots, "prefix", {}, () => [
|
|
54
|
-
i(t.$slots, "prefixIcon", { icon: e.prefixIcon }, () => [
|
|
55
|
-
e.prefixIcon ? (n(), f(m(e.prefixIcon), {
|
|
56
|
-
key: 0,
|
|
57
|
-
"aria-hidden": "true"
|
|
58
|
-
})) : u("", !0)
|
|
59
|
-
])
|
|
60
|
-
])
|
|
61
|
-
])) : u("", !0),
|
|
62
|
-
i(t.$slots, "input", V(B(t.$attrs)), () => [
|
|
63
|
-
r(h) ? C((n(), s("input", y({ key: 0 }, t.$attrs, {
|
|
64
|
-
ref_key: "input",
|
|
65
|
-
ref: c,
|
|
66
|
-
"onUpdate:modelValue": p[0] || (p[0] = (k) => d.value = k),
|
|
67
|
-
type: t.$attrs.type || "text"
|
|
68
|
-
}), null, 16, z)), [
|
|
69
|
-
[O, d.value]
|
|
70
|
-
]) : (n(), s("input", y({ key: 1 }, t.$attrs, {
|
|
71
|
-
ref_key: "input",
|
|
72
|
-
ref: c,
|
|
73
|
-
type: t.$attrs.type || "text"
|
|
74
|
-
}), null, 16, F))
|
|
75
|
-
]),
|
|
76
|
-
r(a).suffix || r(a).icon || e.icon ? (n(), s("span", M, [
|
|
77
|
-
i(t.$slots, "suffix", {}, () => [
|
|
78
|
-
i(t.$slots, "icon", { icon: e.icon }, () => [
|
|
79
|
-
e.icon ? (n(), f(m(e.icon), {
|
|
80
|
-
key: 0,
|
|
81
|
-
"aria-hidden": "true"
|
|
82
|
-
})) : u("", !0)
|
|
83
|
-
])
|
|
84
|
-
])
|
|
85
|
-
])) : u("", !0)
|
|
86
|
-
], 2));
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
export {
|
|
90
|
-
D as _,
|
|
91
|
-
S as u
|
|
92
|
-
};
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { ref as $, computed as f, createBlock as F, openBlock as p, unref as o, withCtx as m, createVNode as i, withModifiers as D, createElementVNode as r, normalizeClass as L, createElementBlock as k, renderSlot as s, createCommentVNode as T, createTextVNode as I, toDisplayString as N } from "vue";
|
|
2
|
-
import { TransitionRoot as R, Dialog as V, TransitionChild as C, DialogPanel as h, DialogTitle as S } from "@headlessui/vue";
|
|
3
|
-
import { _ as B } from "./ButtonBase-DfkwHIhN.js";
|
|
4
|
-
import { r as w } from "./XMarkIcon-90mcPzBs.js";
|
|
5
|
-
function q(t) {
|
|
6
|
-
const v = $(null), n = $(!1), b = f(() => t.as === "form"), y = f(() => `${t.id}-title`), c = f(() => `${t.id}-content`), u = f(() => {
|
|
7
|
-
var d;
|
|
8
|
-
return (d = v.value) == null ? void 0 : d.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
9
|
-
});
|
|
10
|
-
return {
|
|
11
|
-
contentRef: v,
|
|
12
|
-
ready: n,
|
|
13
|
-
isForm: b,
|
|
14
|
-
titleId: y,
|
|
15
|
-
descriptionId: c,
|
|
16
|
-
initialFocusElement: u
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const A = {
|
|
20
|
-
role: "presentation",
|
|
21
|
-
class: "rvc-modal-presentation"
|
|
22
|
-
}, H = { class: "rvc-modal-container" }, M = {
|
|
23
|
-
key: 0,
|
|
24
|
-
class: "rvc-modal-header"
|
|
25
|
-
}, z = { class: "rvc-modal-header-inner" }, P = { class: "rvc-modal-close-wrapper" }, j = ["id"], G = {
|
|
26
|
-
key: 2,
|
|
27
|
-
class: "rvc-modal-footer"
|
|
28
|
-
}, U = {
|
|
29
|
-
__name: "Modal",
|
|
30
|
-
props: {
|
|
31
|
-
as: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "div"
|
|
34
|
-
},
|
|
35
|
-
id: {
|
|
36
|
-
type: String,
|
|
37
|
-
required: !0
|
|
38
|
-
},
|
|
39
|
-
title: {
|
|
40
|
-
type: String,
|
|
41
|
-
required: !0
|
|
42
|
-
},
|
|
43
|
-
showClose: {
|
|
44
|
-
type: Boolean
|
|
45
|
-
},
|
|
46
|
-
spinning: {
|
|
47
|
-
type: Boolean
|
|
48
|
-
},
|
|
49
|
-
submitLabel: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "Confirm"
|
|
52
|
-
},
|
|
53
|
-
cancelLabel: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "Cancel"
|
|
56
|
-
},
|
|
57
|
-
panelClass: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: "rvc-modal-panel-max-width"
|
|
60
|
-
},
|
|
61
|
-
resetHeader: {
|
|
62
|
-
type: Boolean
|
|
63
|
-
},
|
|
64
|
-
resetFooter: {
|
|
65
|
-
type: Boolean
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
emits: ["modal:open", "modal:opened", "modal:close", "modal:save", "modal:closed"],
|
|
69
|
-
setup(t, { emit: v }) {
|
|
70
|
-
const n = v, b = t, {
|
|
71
|
-
contentRef: y,
|
|
72
|
-
ready: c,
|
|
73
|
-
isForm: u,
|
|
74
|
-
titleId: d,
|
|
75
|
-
descriptionId: g,
|
|
76
|
-
initialFocusElement: E
|
|
77
|
-
} = q(b);
|
|
78
|
-
return (l, e) => (p(), F(o(R), { as: "template" }, {
|
|
79
|
-
default: m(() => [
|
|
80
|
-
i(o(V), {
|
|
81
|
-
as: t.as,
|
|
82
|
-
class: "rvc-modal",
|
|
83
|
-
static: "",
|
|
84
|
-
"aria-modal": "true",
|
|
85
|
-
role: "dialog",
|
|
86
|
-
"initial-focus": o(E),
|
|
87
|
-
"aria-labelledby": o(d),
|
|
88
|
-
onClose: e[7] || (e[7] = (a) => l.$emit("modal:close")),
|
|
89
|
-
onSubmit: e[8] || (e[8] = D((a) => n("modal:save", a), ["prevent"]))
|
|
90
|
-
}, {
|
|
91
|
-
default: m(() => [
|
|
92
|
-
i(o(C), {
|
|
93
|
-
as: "template",
|
|
94
|
-
enter: "rvc-modal-backdrop-transition-enter",
|
|
95
|
-
"enter-from": "rvc-modal-backdrop-transition-enter-from",
|
|
96
|
-
"enter-to": "rvc-modal-backdrop-transition-enter-to",
|
|
97
|
-
leave: "rvc-modal-backdrop-transition-leave",
|
|
98
|
-
"leave-from": "rvc-modal-backdrop-transition-leave-from",
|
|
99
|
-
"leave-to": "rvc-modal-backdrop-transition-leave-to",
|
|
100
|
-
onBeforeEnter: e[0] || (e[0] = (a) => n("modal:open")),
|
|
101
|
-
onAfterEnter: e[1] || (e[1] = (a) => n("modal:opened"))
|
|
102
|
-
}, {
|
|
103
|
-
default: m(() => e[9] || (e[9] = [
|
|
104
|
-
r("div", {
|
|
105
|
-
"aria-hidden": "true",
|
|
106
|
-
class: "rvc-modal-backdrop"
|
|
107
|
-
}, null, -1)
|
|
108
|
-
])),
|
|
109
|
-
_: 1,
|
|
110
|
-
__: [9]
|
|
111
|
-
}),
|
|
112
|
-
r("div", A, [
|
|
113
|
-
r("div", H, [
|
|
114
|
-
i(o(C), {
|
|
115
|
-
as: "template",
|
|
116
|
-
enter: "rvc-modal-transition-enter",
|
|
117
|
-
"enter-from": "rvc-modal-transition-enter-from",
|
|
118
|
-
"enter-to": "rvc-modal-transition-enter-to",
|
|
119
|
-
leave: "rvc-modal-transition-leave",
|
|
120
|
-
"leave-from": "rvc-modal-transition-leave-from",
|
|
121
|
-
"leave-to": "rvc-modal-transition-leave-to",
|
|
122
|
-
onBeforeEnter: e[5] || (e[5] = (a) => c.value = !0),
|
|
123
|
-
onAfterLeave: e[6] || (e[6] = (a) => (c.value = !1, n("modal:closed")))
|
|
124
|
-
}, {
|
|
125
|
-
default: m(() => [
|
|
126
|
-
i(o(h), {
|
|
127
|
-
class: L(["rvc-modal-panel", t.panelClass]),
|
|
128
|
-
"aria-busy": t.spinning,
|
|
129
|
-
"aria-describedby": o(g)
|
|
130
|
-
}, {
|
|
131
|
-
default: m(() => [
|
|
132
|
-
t.resetHeader ? s(l.$slots, "header", { key: 1 }) : (p(), k("header", M, [
|
|
133
|
-
s(l.$slots, "header", { title: t.title }, () => [
|
|
134
|
-
r("div", z, [
|
|
135
|
-
s(l.$slots, "title", {
|
|
136
|
-
id: o(d),
|
|
137
|
-
dialogTitle: o(S),
|
|
138
|
-
title: t.title
|
|
139
|
-
}, () => [
|
|
140
|
-
i(o(S), {
|
|
141
|
-
id: o(d),
|
|
142
|
-
class: "rvc-modal-title"
|
|
143
|
-
}, {
|
|
144
|
-
default: m(() => [
|
|
145
|
-
I(N(t.title), 1)
|
|
146
|
-
]),
|
|
147
|
-
_: 1
|
|
148
|
-
}, 8, ["id"])
|
|
149
|
-
]),
|
|
150
|
-
t.showClose ? s(l.$slots, "close", {
|
|
151
|
-
key: 0,
|
|
152
|
-
icon: o(w),
|
|
153
|
-
emitClose: () => n("drawer:close")
|
|
154
|
-
}, () => [
|
|
155
|
-
r("div", P, [
|
|
156
|
-
r("button", {
|
|
157
|
-
type: "button",
|
|
158
|
-
class: "rvc-modal-close",
|
|
159
|
-
"aria-label": "Close panel",
|
|
160
|
-
onClick: e[2] || (e[2] = (a) => n("modal:close"))
|
|
161
|
-
}, [
|
|
162
|
-
i(o(w), { "aria-hidden": "true" })
|
|
163
|
-
])
|
|
164
|
-
])
|
|
165
|
-
]) : T("", !0)
|
|
166
|
-
])
|
|
167
|
-
])
|
|
168
|
-
])),
|
|
169
|
-
r("div", {
|
|
170
|
-
id: o(g),
|
|
171
|
-
ref_key: "contentRef",
|
|
172
|
-
ref: y,
|
|
173
|
-
class: "rvc-modal-content"
|
|
174
|
-
}, [
|
|
175
|
-
s(l.$slots, "default", { ready: o(c) })
|
|
176
|
-
], 8, j),
|
|
177
|
-
t.resetFooter ? s(l.$slots, "footer", { key: 3 }) : (p(), k("footer", G, [
|
|
178
|
-
s(l.$slots, "footer", { loading: t.spinning }, () => [
|
|
179
|
-
i(B, {
|
|
180
|
-
type: o(u) ? "submit" : "button",
|
|
181
|
-
label: t.submitLabel,
|
|
182
|
-
spinning: t.spinning,
|
|
183
|
-
disabled: t.spinning,
|
|
184
|
-
onClick: e[3] || (e[3] = (a) => !o(u) && l.$emit("modal:save"))
|
|
185
|
-
}, null, 8, ["type", "label", "spinning", "disabled"]),
|
|
186
|
-
i(B, {
|
|
187
|
-
type: "button",
|
|
188
|
-
color: "light",
|
|
189
|
-
label: t.cancelLabel,
|
|
190
|
-
onClick: e[4] || (e[4] = (a) => l.$emit("modal:close"))
|
|
191
|
-
}, null, 8, ["label"])
|
|
192
|
-
])
|
|
193
|
-
]))
|
|
194
|
-
]),
|
|
195
|
-
_: 3
|
|
196
|
-
}, 8, ["class", "aria-busy", "aria-describedby"])
|
|
197
|
-
]),
|
|
198
|
-
_: 3
|
|
199
|
-
})
|
|
200
|
-
])
|
|
201
|
-
])
|
|
202
|
-
]),
|
|
203
|
-
_: 3
|
|
204
|
-
}, 8, ["as", "initial-focus", "aria-labelledby"])
|
|
205
|
-
]),
|
|
206
|
-
_: 3
|
|
207
|
-
}));
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
export {
|
|
211
|
-
U as _,
|
|
212
|
-
q as u
|
|
213
|
-
};
|