@ghentcdh/annotation-vue 0.0.1-alpha.22 → 0.0.1-alpha.24

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.
@@ -0,0 +1,150 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, toDisplayString as c } from "vue";
2
+ //#region ../../node_modules/.pnpm/@ghentcdh+ui@3.1.1_@playwright+test@1.63.0_@tiptap+pm@3.31.4_@tiptap+starter-kit@3.31.4_116ec0d791cbe8cbb9faefacd83bcfb3/node_modules/@ghentcdh/ui/ControlWrapper-8o-deDw7.js
3
+ var l = {
4
+ group: {
5
+ root: "group",
6
+ label: "text-primary text-lg font-bold",
7
+ item: "group-item"
8
+ },
9
+ verticalLayout: {
10
+ root: "flex flex-col gap-x-2",
11
+ item: "w-full"
12
+ },
13
+ horizontalLayout: {
14
+ root: "flex flex-row gap-x-2",
15
+ item: "w-full"
16
+ },
17
+ arrayList: {
18
+ root: "fieldset",
19
+ legend: "fieldset-legend text-xl capitalize"
20
+ },
21
+ control: {
22
+ root: "fieldset",
23
+ wrapper: "fieldset",
24
+ label: "fieldset-legend",
25
+ error: "",
26
+ input: "input",
27
+ textarea: "textarea h-32",
28
+ checkbox: "checkbox",
29
+ select: "input pr-14",
30
+ description: "form-control--description label text-xs text-gray-500"
31
+ },
32
+ fixedArrayList: {
33
+ root: "flex flex-row gap-x-2",
34
+ item: "w-full"
35
+ }
36
+ }, u = (e) => {
37
+ if (!e) return { ...l };
38
+ let t = { ...l };
39
+ for (let n of Object.keys(e)) {
40
+ let r = e[n];
41
+ r && typeof r == "object" && (t[n] = {
42
+ ...l[n],
43
+ ...r
44
+ });
45
+ }
46
+ return t;
47
+ }, d = {
48
+ id: {
49
+ type: String,
50
+ default: void 0
51
+ },
52
+ placeholder: {
53
+ type: String,
54
+ default: void 0
55
+ },
56
+ description: {
57
+ type: String,
58
+ default: void 0
59
+ },
60
+ errors: {
61
+ type: String,
62
+ default: void 0
63
+ },
64
+ label: {
65
+ type: String,
66
+ default: void 0
67
+ },
68
+ visible: {
69
+ type: Boolean,
70
+ default: !1
71
+ },
72
+ required: {
73
+ type: Boolean,
74
+ default: !1
75
+ },
76
+ enabled: {
77
+ type: Boolean,
78
+ default: !0
79
+ },
80
+ isFocused: {
81
+ type: Boolean,
82
+ default: !1
83
+ },
84
+ isTouched: {
85
+ type: Boolean,
86
+ default: !1
87
+ },
88
+ hideLabel: {
89
+ type: Boolean,
90
+ default: !1
91
+ },
92
+ styles: {
93
+ type: Object,
94
+ default: () => l
95
+ },
96
+ width: {
97
+ type: String,
98
+ default: "!w-48"
99
+ },
100
+ size: {
101
+ type: String,
102
+ default: void 0
103
+ },
104
+ hideErrors: {
105
+ type: Boolean,
106
+ default: !1
107
+ }
108
+ }, f = ["change"], p = {
109
+ ...d,
110
+ width: {
111
+ type: String,
112
+ default: "w-48"
113
+ },
114
+ minHeight: {
115
+ type: String,
116
+ default: "min-h-[50vh]"
117
+ },
118
+ actions: {
119
+ type: Object,
120
+ default: () => [{
121
+ label: "<strong>B</strong>",
122
+ name: "bold",
123
+ action: (e) => e?.chain().focus().toggleBold().run()
124
+ }, {
125
+ label: "<em>I</em>",
126
+ name: "italic",
127
+ action: (e) => e?.chain().focus().toggleItalic().run()
128
+ }]
129
+ }
130
+ }, m = ({ isTouched: e, errors: t }) => !!(e && t), h = (e, t, n, r) => t === void 0 || t !== void 0 && !e || !r && !n, g = {
131
+ key: 0,
132
+ class: "flex items-center justify-between mb-2"
133
+ }, _ = { key: 0 }, v = /* @__PURE__ */ i({
134
+ inheritAttrs: !1,
135
+ __name: "ControlWrapper",
136
+ props: d,
137
+ setup(i) {
138
+ let l = i, d = e(() => !h(l.visible, l.description, l.isFocused, !0)), f = e(() => l.required), p = e(() => m(l)), v = e(() => u(l.styles));
139
+ return (e, i) => (o(), n("fieldset", { class: a(["fieldset", [e.width, v.value.control.wrapper]]) }, [
140
+ r("legend", { class: a(["w-full inline-block", [v.value.control.label, { "p-0 h-0 leading-none": e.hideLabel }]]) }, [e.hideLabel ? t("", !0) : (o(), n("div", g, [r("div", null, [r("span", null, c(e.label), 1), f.value ? (o(), n("span", _, "*")) : t("", !0)]), s(e.$slots, "label-action")]))], 2),
141
+ s(e.$slots, "default"),
142
+ e.hideErrors ? t("", !0) : (o(), n("p", {
143
+ key: 0,
144
+ class: a(["fieldset-label h-4", { "text-error": p.value }])
145
+ }, c(p.value ? e.errors : d.value ? e.description : null), 3))
146
+ ], 2));
147
+ }
148
+ });
149
+ //#endregion
150
+ export { v as i, f as n, p as r, d as t };