@maltjoy/core-vue 1.0.0-alpha.4 → 1.0.0-alpha.5
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/dist/components/JoyButton/JoyButton.types.d.ts +3 -3
- package/dist/components/JoyButton/JoyButton.vue.d.ts +6 -6
- package/dist/components/JoyCheckbox/JoyCheckbox.vue.d.ts +6 -0
- package/dist/components/JoyInput/JoyInput.types.d.ts +3 -0
- package/dist/components/JoyInput/JoyInput.vue.d.ts +28 -24
- package/dist/components/JoyRadio/JoyRadio.types.d.ts +2 -0
- package/dist/components/JoyRadioGroup/JoyRadioGroup.vue.d.ts +0 -15
- package/dist/components/JoySelect/JoySelect.vue.d.ts +11 -15
- package/dist/components/JoyTemplate/JoyTemplate.types.d.ts +2 -0
- package/dist/components/JoyTextarea/JoyTextarea.vue.d.ts +111 -0
- package/dist/components/JoyToggle/JoyToggle.vue.d.ts +2 -0
- package/dist/components/JoyWrapper/JoyWrapper.types.d.ts +8 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/composables/props.d.ts +11 -0
- package/dist/joy-vue.js +454 -343
- package/dist/joy-vue.umd.cjs +1 -1
- package/dist/stories/fixtures/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/tests/composables/test-components/GenericFormPropsWithLabel.vue.d.ts +11 -0
- package/package.json +69 -50
package/dist/joy-vue.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as _, openBlock as r, createElementBlock as c, normalizeClass as u, useAttrs as R, computed as I, createBlock as B, resolveDynamicComponent as A, unref as g, withCtx as q, createCommentVNode as h, createElementVNode as n, renderSlot as y, ref as b, createTextVNode as V, toDisplayString as J, pushScopeId as P, popScopeId as H, mergeProps as E, useSlots as T, onBeforeMount as D, onMounted as z, watch as G, createVNode as W } from "vue";
|
|
2
|
+
const U = ["teal", "white"], Z = /* @__PURE__ */ _({
|
|
3
3
|
__name: "JoySpinner",
|
|
4
4
|
props: {
|
|
5
5
|
color: {
|
|
6
6
|
type: String,
|
|
7
7
|
validator(e) {
|
|
8
|
-
return
|
|
8
|
+
return U.includes(e);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
setup(e) {
|
|
13
|
-
return (
|
|
14
|
-
class:
|
|
13
|
+
return (l, t) => (r(), c("div", {
|
|
14
|
+
class: u(["joy-spinner", `joy-spinner_${e.color}`])
|
|
15
15
|
}, null, 2));
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
const
|
|
18
|
+
const v = (e, l) => {
|
|
19
19
|
const t = e.__vccOpts || e;
|
|
20
|
-
for (const [
|
|
21
|
-
t[
|
|
20
|
+
for (const [o, s] of l)
|
|
21
|
+
t[o] = s;
|
|
22
22
|
return t;
|
|
23
|
-
},
|
|
23
|
+
}, M = /* @__PURE__ */ v(Z, [["__scopeId", "data-v-b633f633"]]), K = ["primary", "secondary"], X = ["neutral", "success", "info", "warning", "error"], Q = ["main", "admin", "ghost"], Y = [...K, ...Q], x = ["large", "medium", "small", "xsmall", "xxsmall"], ee = ["xxsmall", "xsmall", "small"], te = ["name", "size"], ae = { class: "joy-button--slot" }, oe = /* @__PURE__ */ _({
|
|
24
24
|
__name: "JoyButton",
|
|
25
25
|
props: {
|
|
26
26
|
/**
|
|
@@ -43,7 +43,7 @@ const _ = (e, a) => {
|
|
|
43
43
|
type: String,
|
|
44
44
|
default: "primary",
|
|
45
45
|
validator(e) {
|
|
46
|
-
return
|
|
46
|
+
return Y.includes(e);
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
/** Button or Link size */
|
|
@@ -51,7 +51,7 @@ const _ = (e, a) => {
|
|
|
51
51
|
type: String,
|
|
52
52
|
default: "medium",
|
|
53
53
|
validator(e) {
|
|
54
|
-
return
|
|
54
|
+
return x.includes(e);
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
/** Override the icon size. Default to xsmall */
|
|
@@ -59,15 +59,15 @@ const _ = (e, a) => {
|
|
|
59
59
|
type: String,
|
|
60
60
|
default: "xsmall",
|
|
61
61
|
validator(e) {
|
|
62
|
-
return
|
|
62
|
+
return ee.includes(e);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
setup(e) {
|
|
67
|
-
const
|
|
68
|
-
return (
|
|
69
|
-
disabled: e.loading ||
|
|
70
|
-
class:
|
|
67
|
+
const l = e, t = R(), o = I(() => ["white", "ghost", "secondary"].includes(l.variant) ? "teal" : "white");
|
|
68
|
+
return (s, m) => (r(), B(A(g(t).href ? "a" : "button"), {
|
|
69
|
+
disabled: e.loading || g(t).disabled,
|
|
70
|
+
class: u([
|
|
71
71
|
"joy-button",
|
|
72
72
|
`joy-button_${e.variant}`,
|
|
73
73
|
`joy-button_${e.size}`,
|
|
@@ -77,26 +77,26 @@ const _ = (e, a) => {
|
|
|
77
77
|
}
|
|
78
78
|
])
|
|
79
79
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
e.icon ? (
|
|
80
|
+
default: q(() => [
|
|
81
|
+
e.icon ? (r(), c("joy-icon", {
|
|
82
82
|
key: 0,
|
|
83
83
|
name: e.icon,
|
|
84
84
|
size: e.iconSize,
|
|
85
85
|
lazy: !1
|
|
86
|
-
}, null, 8,
|
|
87
|
-
e.loading ? (
|
|
86
|
+
}, null, 8, te)) : h("", !0),
|
|
87
|
+
e.loading ? (r(), B(M, {
|
|
88
88
|
key: 1,
|
|
89
|
-
color:
|
|
90
|
-
}, null, 8, ["color"])) :
|
|
91
|
-
n("span",
|
|
92
|
-
|
|
89
|
+
color: g(o)
|
|
90
|
+
}, null, 8, ["color"])) : h("", !0),
|
|
91
|
+
n("span", ae, [
|
|
92
|
+
y(s.$slots, "default", {}, void 0, !0)
|
|
93
93
|
])
|
|
94
94
|
]),
|
|
95
95
|
_: 3
|
|
96
96
|
}, 8, ["disabled", "class"]));
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
|
-
const
|
|
99
|
+
const le = /* @__PURE__ */ v(oe, [["__scopeId", "data-v-958cc680"]]), L = {
|
|
100
100
|
disabled: {
|
|
101
101
|
type: Boolean,
|
|
102
102
|
default: !1
|
|
@@ -115,6 +115,11 @@ const ae = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-08c3c0a6"]]), B = {
|
|
|
115
115
|
type: Boolean,
|
|
116
116
|
default: !1
|
|
117
117
|
}
|
|
118
|
+
}, N = {
|
|
119
|
+
modelValue: {
|
|
120
|
+
type: String,
|
|
121
|
+
default: ""
|
|
122
|
+
}
|
|
118
123
|
}, F = {
|
|
119
124
|
modelValue: {
|
|
120
125
|
type: Boolean,
|
|
@@ -124,14 +129,19 @@ const ae = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-08c3c0a6"]]), B = {
|
|
|
124
129
|
type: String,
|
|
125
130
|
default: "on"
|
|
126
131
|
},
|
|
127
|
-
...
|
|
128
|
-
},
|
|
132
|
+
...L
|
|
133
|
+
}, O = {
|
|
129
134
|
label: String,
|
|
130
135
|
labelSize: {
|
|
131
136
|
type: String,
|
|
132
137
|
default: "medium"
|
|
138
|
+
},
|
|
139
|
+
optionalLabel: String,
|
|
140
|
+
requiredMark: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: !1
|
|
133
143
|
}
|
|
134
|
-
},
|
|
144
|
+
}, ne = ["aria-checked", "aria-hidden"], ie = ["name", "disabled", "checked", "required", "aria-checked", "value", "indeterminate"], se = { class: "joy-checkbox__content-wrapper" }, re = { class: "joy-checkbox__content" }, de = /* @__PURE__ */ _({
|
|
135
145
|
__name: "JoyCheckbox",
|
|
136
146
|
props: {
|
|
137
147
|
/** Can't be used in addition of v-model. See usage : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes */
|
|
@@ -139,61 +149,66 @@ const ae = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-08c3c0a6"]]), B = {
|
|
|
139
149
|
type: Boolean,
|
|
140
150
|
default: !1
|
|
141
151
|
},
|
|
152
|
+
label: {
|
|
153
|
+
type: String
|
|
154
|
+
},
|
|
142
155
|
...F
|
|
143
156
|
},
|
|
144
157
|
emits: ["update:modelValue"],
|
|
145
|
-
setup(e, { expose:
|
|
146
|
-
const
|
|
147
|
-
onChange: (
|
|
148
|
-
const p =
|
|
149
|
-
|
|
158
|
+
setup(e, { expose: l, emit: t }) {
|
|
159
|
+
const o = e, s = b(), m = b(o.indeterminate), j = {
|
|
160
|
+
onChange: (a) => {
|
|
161
|
+
const p = a.target.checked;
|
|
162
|
+
m.value = !1, t("update:modelValue", p);
|
|
150
163
|
}
|
|
151
164
|
};
|
|
152
|
-
return
|
|
153
|
-
isIndeterminate:
|
|
154
|
-
}), (
|
|
155
|
-
"aria-checked":
|
|
156
|
-
"aria-hidden":
|
|
165
|
+
return l({
|
|
166
|
+
isIndeterminate: m
|
|
167
|
+
}), (a, p) => (r(), c("div", {
|
|
168
|
+
"aria-checked": a.modelValue,
|
|
169
|
+
"aria-hidden": a.disabled
|
|
157
170
|
}, [
|
|
158
171
|
n("label", {
|
|
159
|
-
class:
|
|
172
|
+
class: u([
|
|
160
173
|
"joy-checkbox",
|
|
161
174
|
{
|
|
162
|
-
"joy-checkbox__checked":
|
|
163
|
-
"joy-checkbox__indeterminate":
|
|
175
|
+
"joy-checkbox__checked": a.modelValue,
|
|
176
|
+
"joy-checkbox__indeterminate": m.value
|
|
164
177
|
}
|
|
165
178
|
])
|
|
166
179
|
}, [
|
|
167
180
|
n("input", {
|
|
168
181
|
ref_key: "input",
|
|
169
|
-
ref:
|
|
182
|
+
ref: s,
|
|
170
183
|
type: "checkbox",
|
|
171
184
|
class: "joy-checkbox__input",
|
|
172
185
|
role: "checkbox",
|
|
173
|
-
name:
|
|
174
|
-
disabled:
|
|
175
|
-
checked:
|
|
176
|
-
required:
|
|
177
|
-
"aria-checked":
|
|
178
|
-
value:
|
|
179
|
-
indeterminate:
|
|
186
|
+
name: a.name,
|
|
187
|
+
disabled: a.disabled,
|
|
188
|
+
checked: a.modelValue,
|
|
189
|
+
required: a.required,
|
|
190
|
+
"aria-checked": a.modelValue,
|
|
191
|
+
value: a.value,
|
|
192
|
+
indeterminate: m.value,
|
|
180
193
|
onChange: p[0] || (p[0] = //@ts-ignore
|
|
181
|
-
(...
|
|
182
|
-
}, null, 40,
|
|
183
|
-
n("div",
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
194
|
+
(...S) => j.onChange && j.onChange(...S))
|
|
195
|
+
}, null, 40, ie),
|
|
196
|
+
n("div", se, [
|
|
197
|
+
y(a.$slots, "default", {}, () => [
|
|
198
|
+
V(J(e.label), 1)
|
|
199
|
+
], !0),
|
|
200
|
+
n("div", re, [
|
|
201
|
+
y(a.$slots, "checkbox-content", {}, void 0, !0)
|
|
187
202
|
])
|
|
188
203
|
])
|
|
189
204
|
], 2)
|
|
190
|
-
], 8,
|
|
205
|
+
], 8, ne));
|
|
191
206
|
}
|
|
192
207
|
});
|
|
193
|
-
const
|
|
208
|
+
const ue = /* @__PURE__ */ v(de, [["__scopeId", "data-v-36f44295"]]), ce = (e) => (P("data-v-eba58103"), e = e(), H(), e), ye = ["aria-hidden"], pe = /* @__PURE__ */ ce(() => /* @__PURE__ */ n("joy-icon", {
|
|
194
209
|
"custom-class": "joy-icon-error",
|
|
195
210
|
name: "warning-triangle"
|
|
196
|
-
}, null, -1)),
|
|
211
|
+
}, null, -1)), me = /* @__PURE__ */ _({
|
|
197
212
|
__name: "JoyFormError",
|
|
198
213
|
props: {
|
|
199
214
|
visible: {
|
|
@@ -203,36 +218,36 @@ const de = /* @__PURE__ */ _(re, [["__scopeId", "data-v-61d9cccf"]]), ue = (e) =
|
|
|
203
218
|
noHtmlErrorText: String
|
|
204
219
|
},
|
|
205
220
|
setup(e) {
|
|
206
|
-
return (
|
|
221
|
+
return (l, t) => (r(), c("div", {
|
|
207
222
|
"aria-hidden": e.visible,
|
|
208
|
-
class:
|
|
223
|
+
class: u(["joy-form-error", { "joy-has-error": e.visible }]),
|
|
209
224
|
role: "alert"
|
|
210
225
|
}, [
|
|
211
226
|
pe,
|
|
212
227
|
n("div", null, [
|
|
213
|
-
|
|
214
|
-
|
|
228
|
+
y(l.$slots, "default", {}, () => [
|
|
229
|
+
V(J(e.noHtmlErrorText), 1)
|
|
215
230
|
], !0)
|
|
216
231
|
])
|
|
217
|
-
], 10,
|
|
232
|
+
], 10, ye));
|
|
218
233
|
}
|
|
219
234
|
});
|
|
220
|
-
const _e = /* @__PURE__ */
|
|
221
|
-
function
|
|
222
|
-
let
|
|
235
|
+
const _e = /* @__PURE__ */ v(me, [["__scopeId", "data-v-eba58103"]]);
|
|
236
|
+
function ve(e) {
|
|
237
|
+
let l;
|
|
223
238
|
switch (e) {
|
|
224
239
|
case "error":
|
|
225
|
-
|
|
240
|
+
l = "warning-triangle";
|
|
226
241
|
break;
|
|
227
242
|
case "success":
|
|
228
|
-
|
|
243
|
+
l = "check";
|
|
229
244
|
break;
|
|
230
245
|
default:
|
|
231
|
-
|
|
246
|
+
l = "info-circle";
|
|
232
247
|
}
|
|
233
|
-
return
|
|
248
|
+
return l;
|
|
234
249
|
}
|
|
235
|
-
const
|
|
250
|
+
const fe = [...X], ge = ["name"], he = { class: "joy-highlight--text" }, be = /* @__PURE__ */ _({
|
|
236
251
|
__name: "JoyHighlight",
|
|
237
252
|
props: {
|
|
238
253
|
accent: {
|
|
@@ -248,51 +263,51 @@ const ve = [...K], fe = ["name"], ge = { class: "joy-highlight--text" }, he = /*
|
|
|
248
263
|
type: String,
|
|
249
264
|
default: "neutral",
|
|
250
265
|
validator(e) {
|
|
251
|
-
return
|
|
266
|
+
return fe.includes(e);
|
|
252
267
|
}
|
|
253
268
|
}
|
|
254
269
|
},
|
|
255
|
-
setup(e, { expose:
|
|
256
|
-
const t = e,
|
|
257
|
-
return
|
|
258
|
-
getRelevantIcon:
|
|
259
|
-
}), (
|
|
260
|
-
class:
|
|
270
|
+
setup(e, { expose: l }) {
|
|
271
|
+
const t = e, o = I(() => t.icon ? t.icon : ve(t.level));
|
|
272
|
+
return l({
|
|
273
|
+
getRelevantIcon: o
|
|
274
|
+
}), (s, m) => (r(), c("div", {
|
|
275
|
+
class: u([
|
|
261
276
|
"joy-highlight",
|
|
262
277
|
`joy-highlight_${e.level}`,
|
|
263
278
|
{
|
|
264
279
|
"joy-highlight__accent": e.accent,
|
|
265
|
-
"joy-highlight__titled":
|
|
280
|
+
"joy-highlight__titled": s.$slots["highlight-title"]
|
|
266
281
|
}
|
|
267
282
|
])
|
|
268
283
|
}, [
|
|
269
|
-
e.displayIcon ? (
|
|
284
|
+
e.displayIcon ? (r(), c("joy-icon", {
|
|
270
285
|
key: 0,
|
|
271
|
-
name:
|
|
272
|
-
}, null, 8,
|
|
273
|
-
n("div",
|
|
286
|
+
name: g(o)
|
|
287
|
+
}, null, 8, ge)) : h("", !0),
|
|
288
|
+
n("div", he, [
|
|
274
289
|
n("strong", null, [
|
|
275
|
-
|
|
290
|
+
y(s.$slots, "highlight-title", {}, void 0, !0)
|
|
276
291
|
]),
|
|
277
|
-
|
|
292
|
+
y(s.$slots, "default", {}, void 0, !0)
|
|
278
293
|
])
|
|
279
294
|
], 2));
|
|
280
295
|
}
|
|
281
296
|
});
|
|
282
|
-
const
|
|
297
|
+
const je = /* @__PURE__ */ v(be, [["__scopeId", "data-v-15d3fa11"]]), Se = ["small", "medium", "large"], $e = {
|
|
283
298
|
key: 0,
|
|
284
299
|
class: "joy-label-required"
|
|
285
|
-
},
|
|
300
|
+
}, ke = {
|
|
286
301
|
key: 1,
|
|
287
302
|
class: "joy-label-optional"
|
|
288
|
-
},
|
|
303
|
+
}, Ie = /* @__PURE__ */ _({
|
|
289
304
|
__name: "JoyLabel",
|
|
290
305
|
props: {
|
|
291
306
|
size: {
|
|
292
307
|
type: String,
|
|
293
308
|
default: "medium",
|
|
294
309
|
validator(e) {
|
|
295
|
-
return
|
|
310
|
+
return Se.includes(e);
|
|
296
311
|
}
|
|
297
312
|
},
|
|
298
313
|
tagName: {
|
|
@@ -308,145 +323,143 @@ const be = /* @__PURE__ */ _(he, [["__scopeId", "data-v-15d3fa11"]]), je = ["sma
|
|
|
308
323
|
}
|
|
309
324
|
},
|
|
310
325
|
setup(e) {
|
|
311
|
-
return (
|
|
326
|
+
return (l, t) => (r(), B(A(e.tagName), E({
|
|
312
327
|
class: ["joy-label", `joy-label--${e.size}`]
|
|
313
|
-
},
|
|
314
|
-
default:
|
|
315
|
-
|
|
316
|
-
e.required ? (
|
|
317
|
-
e.optionalLabel ? (
|
|
328
|
+
}, l.$attrs), {
|
|
329
|
+
default: q(() => [
|
|
330
|
+
y(l.$slots, "default", {}, void 0, !0),
|
|
331
|
+
e.required ? (r(), c("span", $e, "*")) : h("", !0),
|
|
332
|
+
e.optionalLabel ? (r(), c("span", ke, "- " + J(e.optionalLabel), 1)) : h("", !0)
|
|
318
333
|
]),
|
|
319
334
|
_: 3
|
|
320
335
|
}, 16, ["class"]));
|
|
321
336
|
}
|
|
322
337
|
});
|
|
323
|
-
const
|
|
338
|
+
const C = /* @__PURE__ */ v(Ie, [["__scopeId", "data-v-e3232407"]]), Je = ["large", "medium", "small"], we = ["id", "disabled", "type", "value"], Ve = ["data-unit"], Be = /* @__PURE__ */ _({
|
|
324
339
|
__name: "JoyInput",
|
|
325
340
|
props: {
|
|
326
|
-
...
|
|
327
|
-
...
|
|
341
|
+
...L,
|
|
342
|
+
...O,
|
|
343
|
+
...N,
|
|
328
344
|
clearable: {
|
|
329
345
|
type: Boolean,
|
|
330
346
|
default: !1
|
|
331
347
|
},
|
|
332
348
|
icon: String,
|
|
333
|
-
modelValue: {
|
|
334
|
-
type: String,
|
|
335
|
-
default: ""
|
|
336
|
-
},
|
|
337
|
-
optionalLabel: String,
|
|
338
|
-
requiredMark: {
|
|
339
|
-
type: Boolean,
|
|
340
|
-
default: !1
|
|
341
|
-
},
|
|
342
349
|
size: {
|
|
343
350
|
type: String,
|
|
344
|
-
default: "medium"
|
|
351
|
+
default: "medium",
|
|
352
|
+
validator(e) {
|
|
353
|
+
return Je.includes(e);
|
|
354
|
+
}
|
|
345
355
|
},
|
|
346
356
|
type: String,
|
|
347
357
|
unit: String
|
|
348
358
|
},
|
|
349
359
|
emits: ["update:modelValue"],
|
|
350
|
-
setup(e, { emit:
|
|
351
|
-
const t = e,
|
|
352
|
-
var
|
|
353
|
-
return !!((
|
|
354
|
-
}),
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
setup(e, { emit: l }) {
|
|
361
|
+
const t = e, o = b(), s = b(), m = R(), j = T(), a = b(!1), p = I(() => t.clearable && t.modelValue.length > 0 && !t.unit), S = I(() => j.default && j.default()), k = I(() => {
|
|
362
|
+
var d, $;
|
|
363
|
+
return !!((d = s.value) != null && d.closest("joy-wrapper")) || !!(($ = s.value) != null && $.closest(".joy-wrapper"));
|
|
364
|
+
}), i = b(t.type);
|
|
365
|
+
D(() => {
|
|
366
|
+
i.value = t.unit ? "number" : t.unit || "text";
|
|
357
367
|
});
|
|
358
|
-
const
|
|
368
|
+
const f = {
|
|
359
369
|
onFocus: () => {
|
|
360
|
-
|
|
370
|
+
a.value = !0;
|
|
361
371
|
},
|
|
362
372
|
onBlur: () => {
|
|
363
|
-
|
|
373
|
+
a.value = !1;
|
|
364
374
|
},
|
|
365
|
-
onInput: (
|
|
366
|
-
let
|
|
367
|
-
|
|
375
|
+
onInput: (d) => {
|
|
376
|
+
let $ = d.target.value;
|
|
377
|
+
l("update:modelValue", $);
|
|
368
378
|
},
|
|
369
379
|
clearValue: () => {
|
|
370
|
-
|
|
380
|
+
t.disabled || l("update:modelValue", "");
|
|
371
381
|
}
|
|
372
382
|
};
|
|
373
|
-
return (
|
|
383
|
+
return (d, $) => (r(), c("div", {
|
|
374
384
|
ref_key: "root",
|
|
375
|
-
ref:
|
|
376
|
-
class:
|
|
385
|
+
ref: s,
|
|
386
|
+
class: u([`joy-input--${t.size}`])
|
|
377
387
|
}, [
|
|
378
388
|
n("div", {
|
|
379
|
-
class:
|
|
389
|
+
class: u([
|
|
380
390
|
"joy-input",
|
|
381
391
|
{
|
|
382
|
-
"joy-input--focusing":
|
|
383
|
-
"joy-input--disabled":
|
|
384
|
-
"joy-input--invalid":
|
|
385
|
-
"joy-input--valid": !
|
|
392
|
+
"joy-input--focusing": a.value,
|
|
393
|
+
"joy-input--disabled": d.disabled,
|
|
394
|
+
"joy-input--invalid": d.invalid,
|
|
395
|
+
"joy-input--valid": !d.invalid && !g(m).disabled
|
|
386
396
|
}
|
|
387
397
|
])
|
|
388
398
|
}, [
|
|
389
|
-
|
|
399
|
+
g(S) || d.label ? (r(), B(C, {
|
|
390
400
|
key: 0,
|
|
391
|
-
for:
|
|
392
|
-
required:
|
|
393
|
-
"optional-label":
|
|
394
|
-
size:
|
|
401
|
+
for: d.name,
|
|
402
|
+
required: d.required && d.requiredMark,
|
|
403
|
+
"optional-label": d.optionalLabel,
|
|
404
|
+
size: d.labelSize
|
|
395
405
|
}, {
|
|
396
|
-
default:
|
|
397
|
-
|
|
406
|
+
default: q(() => [
|
|
407
|
+
y(d.$slots, "default", {}, () => [
|
|
408
|
+
V(J(d.label), 1)
|
|
409
|
+
], !0)
|
|
398
410
|
]),
|
|
399
411
|
_: 3
|
|
400
|
-
}, 8, ["for", "required", "optional-label", "size"])) :
|
|
412
|
+
}, 8, ["for", "required", "optional-label", "size"])) : h("", !0),
|
|
401
413
|
n("div", {
|
|
402
|
-
class:
|
|
414
|
+
class: u([
|
|
403
415
|
"joy-input--wrapper",
|
|
404
416
|
{
|
|
405
417
|
"joy-input--wrapper-has-icon": !!e.icon,
|
|
406
418
|
"joy-input--wrapper---clearable": e.clearable,
|
|
407
419
|
"joy-input--wrapper-unit": !!e.unit,
|
|
408
|
-
"joy-input--wrapper-margin": !
|
|
420
|
+
"joy-input--wrapper-margin": !g(k)
|
|
409
421
|
}
|
|
410
422
|
])
|
|
411
423
|
}, [
|
|
412
|
-
n("input",
|
|
424
|
+
n("input", E(d.$attrs, {
|
|
413
425
|
id: t.name,
|
|
414
426
|
ref_key: "input",
|
|
415
|
-
ref:
|
|
427
|
+
ref: o,
|
|
428
|
+
disabled: d.disabled,
|
|
416
429
|
class: [
|
|
417
430
|
{
|
|
418
|
-
"joy-input--field-disabled":
|
|
419
|
-
"joy-input--field-invalid":
|
|
431
|
+
"joy-input--field-disabled": d.disabled,
|
|
432
|
+
"joy-input--field-invalid": d.invalid
|
|
420
433
|
}
|
|
421
434
|
],
|
|
422
|
-
type:
|
|
423
|
-
value:
|
|
424
|
-
onFocus:
|
|
425
|
-
(...
|
|
426
|
-
onBlur:
|
|
427
|
-
(...
|
|
428
|
-
onInput:
|
|
429
|
-
(...
|
|
430
|
-
}), null, 16,
|
|
431
|
-
|
|
435
|
+
type: i.value,
|
|
436
|
+
value: d.modelValue,
|
|
437
|
+
onFocus: $[0] || ($[0] = //@ts-ignore
|
|
438
|
+
(...w) => f.onFocus && f.onFocus(...w)),
|
|
439
|
+
onBlur: $[1] || ($[1] = //@ts-ignore
|
|
440
|
+
(...w) => f.onBlur && f.onBlur(...w)),
|
|
441
|
+
onInput: $[2] || ($[2] = //@ts-ignore
|
|
442
|
+
(...w) => f.onInput && f.onInput(...w))
|
|
443
|
+
}), null, 16, we),
|
|
444
|
+
g(p) ? (r(), c("joy-icon", {
|
|
432
445
|
key: 0,
|
|
433
446
|
size: "xxsmall",
|
|
434
447
|
name: "cross",
|
|
435
448
|
class: "joy-input--clear",
|
|
436
|
-
onClick:
|
|
437
|
-
(...
|
|
438
|
-
})) :
|
|
439
|
-
e.unit ? (
|
|
449
|
+
onClick: $[3] || ($[3] = //@ts-ignore
|
|
450
|
+
(...w) => f.clearValue && f.clearValue(...w))
|
|
451
|
+
})) : h("", !0),
|
|
452
|
+
e.unit ? (r(), c("div", {
|
|
440
453
|
key: 1,
|
|
441
454
|
"data-unit": e.unit,
|
|
442
455
|
class: "joy-input--unit"
|
|
443
|
-
}, null, 8,
|
|
456
|
+
}, null, 8, Ve)) : h("", !0)
|
|
444
457
|
], 2)
|
|
445
458
|
], 2)
|
|
446
459
|
], 2));
|
|
447
460
|
}
|
|
448
461
|
});
|
|
449
|
-
const
|
|
462
|
+
const qe = /* @__PURE__ */ v(Be, [["__scopeId", "data-v-3e0a5c90"]]), Le = ["teal", "white"], Ee = ["href"], Ce = ["color", "name"], Te = /* @__PURE__ */ _({
|
|
450
463
|
__name: "JoyLink",
|
|
451
464
|
props: {
|
|
452
465
|
href: {
|
|
@@ -457,29 +470,29 @@ const Ve = /* @__PURE__ */ _(we, [["__scopeId", "data-v-6eb67b7e"]]), Be = ["tea
|
|
|
457
470
|
type: String,
|
|
458
471
|
default: "teal",
|
|
459
472
|
validator(e) {
|
|
460
|
-
return
|
|
473
|
+
return Le.includes(e);
|
|
461
474
|
}
|
|
462
475
|
},
|
|
463
476
|
icon: String
|
|
464
477
|
},
|
|
465
478
|
setup(e) {
|
|
466
|
-
const
|
|
467
|
-
return (
|
|
479
|
+
const l = e, t = I(() => l.color === "white" ? "white" : "teal");
|
|
480
|
+
return (o, s) => (r(), c("a", E({ href: e.href }, o.$attrs, {
|
|
468
481
|
class: ["joy-link", `joy-link_${e.color}`]
|
|
469
482
|
}), [
|
|
470
|
-
e.icon ? (
|
|
483
|
+
e.icon ? (r(), c("joy-icon", {
|
|
471
484
|
key: 0,
|
|
472
|
-
color:
|
|
485
|
+
color: g(t),
|
|
473
486
|
name: e.icon
|
|
474
|
-
}, null, 8, Ce)) :
|
|
475
|
-
|
|
476
|
-
], 16,
|
|
487
|
+
}, null, 8, Ce)) : h("", !0),
|
|
488
|
+
y(o.$slots, "default", {}, void 0, !0)
|
|
489
|
+
], 16, Ee));
|
|
477
490
|
}
|
|
478
491
|
});
|
|
479
|
-
const
|
|
492
|
+
const ze = /* @__PURE__ */ v(Te, [["__scopeId", "data-v-640ee9a6"]]), Ne = ["id", "value", "checked", "disabled", "required", "name"], Oe = { class: "joy-radio-label" }, Re = { class: "joy-radio-content__wrapper" }, Ae = { class: "joy-radio-content" }, Pe = /* @__PURE__ */ _({
|
|
480
493
|
__name: "JoyRadio",
|
|
481
494
|
props: {
|
|
482
|
-
...
|
|
495
|
+
...L,
|
|
483
496
|
modelValue: {
|
|
484
497
|
type: String
|
|
485
498
|
},
|
|
@@ -492,66 +505,66 @@ const qe = /* @__PURE__ */ _(Ee, [["__scopeId", "data-v-640ee9a6"]]), ze = ["id"
|
|
|
492
505
|
}
|
|
493
506
|
},
|
|
494
507
|
emits: ["update:modelValue"],
|
|
495
|
-
setup(e, { expose:
|
|
496
|
-
const
|
|
497
|
-
function
|
|
498
|
-
|
|
508
|
+
setup(e, { expose: l, emit: t }) {
|
|
509
|
+
const o = e, s = b(!1), m = b(null), j = b(null), a = T(), p = I(() => !o.modelValue || !o.value ? !1 : o.modelValue === o.value);
|
|
510
|
+
function S() {
|
|
511
|
+
s.value = !!a["expandable-content"] && p.value;
|
|
499
512
|
}
|
|
500
|
-
function
|
|
501
|
-
t("update:modelValue",
|
|
513
|
+
function k() {
|
|
514
|
+
t("update:modelValue", o.value), S();
|
|
502
515
|
}
|
|
503
|
-
return
|
|
504
|
-
|
|
505
|
-
}),
|
|
506
|
-
() =>
|
|
516
|
+
return z(() => {
|
|
517
|
+
o.theme === "outline" && S();
|
|
518
|
+
}), G(
|
|
519
|
+
() => o.modelValue,
|
|
507
520
|
() => {
|
|
508
|
-
|
|
521
|
+
S();
|
|
509
522
|
}
|
|
510
|
-
),
|
|
523
|
+
), l({
|
|
511
524
|
checked: p,
|
|
512
|
-
isExpanded:
|
|
513
|
-
}), (
|
|
525
|
+
isExpanded: s
|
|
526
|
+
}), (i, f) => (r(), c("label", {
|
|
514
527
|
ref_key: "root",
|
|
515
|
-
ref:
|
|
516
|
-
class:
|
|
528
|
+
ref: m,
|
|
529
|
+
class: u([
|
|
517
530
|
"joy-radio",
|
|
518
531
|
`joy-radio--${e.theme}`,
|
|
519
532
|
{
|
|
520
|
-
"joy-radio--checked":
|
|
521
|
-
"joy-radio--disabled":
|
|
522
|
-
"joy-radio--invalid":
|
|
533
|
+
"joy-radio--checked": g(p),
|
|
534
|
+
"joy-radio--disabled": i.disabled,
|
|
535
|
+
"joy-radio--invalid": i.invalid
|
|
523
536
|
}
|
|
524
537
|
])
|
|
525
538
|
}, [
|
|
526
539
|
n("input", {
|
|
527
|
-
id:
|
|
540
|
+
id: i.name,
|
|
528
541
|
type: "radio",
|
|
529
542
|
value: e.value,
|
|
530
|
-
checked:
|
|
531
|
-
disabled:
|
|
532
|
-
required:
|
|
533
|
-
name:
|
|
534
|
-
onChange:
|
|
535
|
-
}, null, 40,
|
|
536
|
-
n("span",
|
|
537
|
-
|
|
543
|
+
checked: g(p),
|
|
544
|
+
disabled: i.disabled,
|
|
545
|
+
required: i.required,
|
|
546
|
+
name: i.name,
|
|
547
|
+
onChange: k
|
|
548
|
+
}, null, 40, Ne),
|
|
549
|
+
n("span", Oe, [
|
|
550
|
+
y(i.$slots, "default", {}, void 0, !0)
|
|
538
551
|
]),
|
|
539
552
|
n("div", Re, [
|
|
540
|
-
n("div",
|
|
541
|
-
|
|
553
|
+
n("div", Ae, [
|
|
554
|
+
y(i.$slots, "radio-content", {}, void 0, !0)
|
|
542
555
|
]),
|
|
543
556
|
n("div", {
|
|
544
557
|
ref_key: "expandableElement",
|
|
545
|
-
ref:
|
|
546
|
-
class:
|
|
558
|
+
ref: j,
|
|
559
|
+
class: u(["joy-radio-expandable", { "joy-radio-expandable--expanded": s.value }])
|
|
547
560
|
}, [
|
|
548
|
-
|
|
561
|
+
y(i.$slots, "expandable-content", {}, void 0, !0)
|
|
549
562
|
], 2)
|
|
550
563
|
])
|
|
551
564
|
], 2));
|
|
552
565
|
}
|
|
553
566
|
});
|
|
554
|
-
const
|
|
567
|
+
const He = /* @__PURE__ */ v(Pe, [["__scopeId", "data-v-acb7c63c"]]), Me = ["form", "name"], Fe = /* @__PURE__ */ _({
|
|
555
568
|
__name: "JoyRadioGroup",
|
|
556
569
|
props: {
|
|
557
570
|
direction: {
|
|
@@ -561,121 +574,104 @@ const Ae = /* @__PURE__ */ _(Ne, [["__scopeId", "data-v-822f5782"]]), Pe = ["for
|
|
|
561
574
|
form: {
|
|
562
575
|
type: String
|
|
563
576
|
},
|
|
564
|
-
modelValue: {
|
|
565
|
-
type: String
|
|
566
|
-
},
|
|
567
577
|
name: {
|
|
568
578
|
type: String
|
|
569
|
-
},
|
|
570
|
-
invalid: Boolean,
|
|
571
|
-
invalidText: {
|
|
572
|
-
type: String
|
|
573
579
|
}
|
|
574
580
|
},
|
|
575
581
|
setup(e) {
|
|
576
|
-
return (
|
|
582
|
+
return (l, t) => (r(), c("fieldset", {
|
|
577
583
|
ref: "root",
|
|
578
584
|
class: "joy-radio-group-fieldset",
|
|
579
585
|
role: "radiogroup",
|
|
580
586
|
form: e.form,
|
|
581
587
|
name: e.name
|
|
582
588
|
}, [
|
|
583
|
-
|
|
589
|
+
y(l.$slots, "radio-group-legend", {}, void 0, !0),
|
|
584
590
|
n("div", {
|
|
585
|
-
class:
|
|
591
|
+
class: u(["joy-radio-group-container", `joy-radio-group-${e.direction}`])
|
|
586
592
|
}, [
|
|
587
|
-
|
|
593
|
+
y(l.$slots, "default", {}, void 0, !0)
|
|
588
594
|
], 2)
|
|
589
|
-
], 8,
|
|
595
|
+
], 8, Me));
|
|
590
596
|
}
|
|
591
597
|
});
|
|
592
|
-
const
|
|
598
|
+
const De = /* @__PURE__ */ v(Fe, [["__scopeId", "data-v-d75cd96a"]]), Ge = (e) => (P("data-v-48f25207"), e = e(), H(), e), We = ["id", "name", "aria-invalid", "required", "disabled", "value"], Ue = /* @__PURE__ */ Ge(() => /* @__PURE__ */ n("joy-icon", {
|
|
593
599
|
class: "joy-select__chevron",
|
|
594
600
|
name: "chevron-down"
|
|
595
|
-
}, null, -1)),
|
|
601
|
+
}, null, -1)), Ze = /* @__PURE__ */ _({
|
|
596
602
|
__name: "JoySelect",
|
|
597
603
|
props: {
|
|
598
|
-
...
|
|
599
|
-
...
|
|
600
|
-
|
|
601
|
-
type: String,
|
|
602
|
-
default: ""
|
|
603
|
-
},
|
|
604
|
-
optionalLabel: {
|
|
605
|
-
type: String
|
|
606
|
-
},
|
|
607
|
-
requiredMark: {
|
|
608
|
-
type: Boolean,
|
|
609
|
-
default: !1
|
|
610
|
-
}
|
|
604
|
+
...L,
|
|
605
|
+
...O,
|
|
606
|
+
...N
|
|
611
607
|
},
|
|
612
608
|
emits: ["update:modelValue"],
|
|
613
|
-
setup(e, { emit:
|
|
614
|
-
const t = e,
|
|
615
|
-
|
|
616
|
-
var
|
|
617
|
-
const
|
|
618
|
-
if (!
|
|
609
|
+
setup(e, { emit: l }) {
|
|
610
|
+
const t = e, o = b(), s = b(), m = T();
|
|
611
|
+
z(() => {
|
|
612
|
+
var S;
|
|
613
|
+
const a = m.label && m.label();
|
|
614
|
+
if (!a || !a.length)
|
|
619
615
|
return;
|
|
620
|
-
const p =
|
|
616
|
+
const p = a[0];
|
|
621
617
|
if (p.type === "JoyLabel") {
|
|
622
|
-
const
|
|
623
|
-
if (!
|
|
618
|
+
const k = (S = p.props) == null ? void 0 : S.for;
|
|
619
|
+
if (!k) {
|
|
624
620
|
console.warn("JoyLabel for attribute is missing");
|
|
625
621
|
return;
|
|
626
622
|
}
|
|
627
|
-
|
|
623
|
+
k !== t.id && console.warn("JoyLabel for attribute does not match with JoySelect id");
|
|
628
624
|
}
|
|
629
625
|
});
|
|
630
|
-
function
|
|
631
|
-
const p =
|
|
632
|
-
|
|
626
|
+
function j(a) {
|
|
627
|
+
const p = a.target.value;
|
|
628
|
+
l("update:modelValue", p);
|
|
633
629
|
}
|
|
634
|
-
return (
|
|
630
|
+
return (a, p) => (r(), c("div", {
|
|
635
631
|
ref_key: "root",
|
|
636
|
-
ref:
|
|
632
|
+
ref: o
|
|
637
633
|
}, [
|
|
638
|
-
|
|
639
|
-
|
|
634
|
+
y(a.$slots, "label", {}, () => [
|
|
635
|
+
a.label ? (r(), B(C, {
|
|
640
636
|
key: 0,
|
|
641
|
-
required:
|
|
642
|
-
"optional-label":
|
|
643
|
-
for:
|
|
644
|
-
size:
|
|
637
|
+
required: a.required && a.requiredMark,
|
|
638
|
+
"optional-label": a.optionalLabel,
|
|
639
|
+
for: a.id || a.name,
|
|
640
|
+
size: a.labelSize
|
|
645
641
|
}, {
|
|
646
|
-
default:
|
|
647
|
-
|
|
642
|
+
default: q(() => [
|
|
643
|
+
V(J(a.label), 1)
|
|
648
644
|
]),
|
|
649
645
|
_: 1
|
|
650
|
-
}, 8, ["required", "optional-label", "for", "size"])) :
|
|
646
|
+
}, 8, ["required", "optional-label", "for", "size"])) : h("", !0)
|
|
651
647
|
], !0),
|
|
652
648
|
n("div", {
|
|
653
|
-
class:
|
|
649
|
+
class: u({
|
|
654
650
|
"joy-select__wrapper": !0,
|
|
655
|
-
"joy-select--invalid":
|
|
656
|
-
"joy-select--disabled":
|
|
651
|
+
"joy-select--invalid": a.invalid,
|
|
652
|
+
"joy-select--disabled": a.disabled
|
|
657
653
|
})
|
|
658
654
|
}, [
|
|
659
655
|
n("select", {
|
|
660
|
-
id:
|
|
656
|
+
id: a.id || a.name,
|
|
661
657
|
ref_key: "select",
|
|
662
|
-
ref:
|
|
658
|
+
ref: s,
|
|
663
659
|
class: "joy-select",
|
|
664
|
-
name:
|
|
665
|
-
"aria-invalid":
|
|
666
|
-
required:
|
|
667
|
-
disabled:
|
|
668
|
-
value:
|
|
669
|
-
onInput:
|
|
660
|
+
name: a.name,
|
|
661
|
+
"aria-invalid": a.invalid,
|
|
662
|
+
required: a.required,
|
|
663
|
+
disabled: a.disabled,
|
|
664
|
+
value: a.modelValue,
|
|
665
|
+
onInput: j
|
|
670
666
|
}, [
|
|
671
|
-
|
|
672
|
-
], 40,
|
|
673
|
-
|
|
667
|
+
y(a.$slots, "default", {}, void 0, !0)
|
|
668
|
+
], 40, We),
|
|
669
|
+
Ue
|
|
674
670
|
], 2)
|
|
675
671
|
], 512));
|
|
676
672
|
}
|
|
677
673
|
});
|
|
678
|
-
const
|
|
674
|
+
const Ke = /* @__PURE__ */ v(Ze, [["__scopeId", "data-v-48f25207"]]), Xe = /* @__PURE__ */ _({
|
|
679
675
|
__name: "JoyWrapper",
|
|
680
676
|
props: {
|
|
681
677
|
justify: {
|
|
@@ -696,83 +692,194 @@ const Ze = /* @__PURE__ */ _(We, [["__scopeId", "data-v-7733736c"]]), Ue = /* @_
|
|
|
696
692
|
}
|
|
697
693
|
},
|
|
698
694
|
setup(e) {
|
|
699
|
-
return (
|
|
700
|
-
class:
|
|
695
|
+
return (l, t) => (r(), c("div", {
|
|
696
|
+
class: u(["joy-wrapper", `joy-wrapper--justify-${e.justify}`, `joy-wrapper--align-${e.align}`, `joy-wrapper--direction-${e.direction}`, `joy-wrapper--wrap-${e.wrap}`])
|
|
701
697
|
}, [
|
|
702
|
-
|
|
698
|
+
y(l.$slots, "default", {}, void 0, !0)
|
|
703
699
|
], 2));
|
|
704
700
|
}
|
|
705
701
|
});
|
|
706
|
-
const
|
|
702
|
+
const Qe = /* @__PURE__ */ v(Xe, [["__scopeId", "data-v-ce0e1214"]]), Ye = { class: "joy-template__heading" }, xe = { class: "joy-template__heading___headings" }, et = /* @__PURE__ */ _({
|
|
707
703
|
__name: "JoyTemplate",
|
|
708
704
|
props: {
|
|
709
705
|
full: { type: Boolean, default: !1 },
|
|
710
706
|
sidebar: { type: String, default: "right" }
|
|
711
707
|
},
|
|
712
708
|
setup(e) {
|
|
713
|
-
const
|
|
714
|
-
return (t,
|
|
715
|
-
class:
|
|
709
|
+
const l = e;
|
|
710
|
+
return (t, o) => (r(), c("main", {
|
|
711
|
+
class: u(["joy-template", { "joy-template--full": l.full }])
|
|
716
712
|
}, [
|
|
717
|
-
n("div",
|
|
713
|
+
n("div", Ye, [
|
|
718
714
|
n("div", {
|
|
719
|
-
class:
|
|
715
|
+
class: u({ "joy-template-slot-back": t.$slots["template-back"] })
|
|
720
716
|
}, [
|
|
721
|
-
|
|
717
|
+
y(t.$slots, "template-back", {}, void 0, !0)
|
|
722
718
|
], 2),
|
|
723
|
-
n("div",
|
|
719
|
+
n("div", xe, [
|
|
724
720
|
n("div", {
|
|
725
|
-
class:
|
|
721
|
+
class: u({ "joy-template-slot-title": t.$slots["template-title"] })
|
|
726
722
|
}, [
|
|
727
|
-
|
|
723
|
+
y(t.$slots, "template-title", {}, void 0, !0)
|
|
728
724
|
], 2),
|
|
729
725
|
n("div", {
|
|
730
|
-
class:
|
|
726
|
+
class: u({ "joy-template-slot-subtitle": t.$slots["template-subtitle"] })
|
|
731
727
|
}, [
|
|
732
|
-
|
|
728
|
+
y(t.$slots, "template-subtitle", {}, void 0, !0)
|
|
733
729
|
], 2)
|
|
734
730
|
])
|
|
735
731
|
]),
|
|
736
732
|
n("div", {
|
|
737
|
-
class:
|
|
733
|
+
class: u([
|
|
738
734
|
"joy-template__content",
|
|
739
735
|
{
|
|
740
|
-
"joy-template__content--reverse":
|
|
736
|
+
"joy-template__content--reverse": l.sidebar === "left"
|
|
741
737
|
}
|
|
742
738
|
])
|
|
743
739
|
}, [
|
|
744
740
|
n("div", {
|
|
745
|
-
class:
|
|
741
|
+
class: u({ "joy-template-slot-main": t.$slots["template-main"] })
|
|
746
742
|
}, [
|
|
747
|
-
|
|
743
|
+
y(t.$slots, "template-main", {}, void 0, !0)
|
|
748
744
|
], 2),
|
|
749
745
|
n("div", {
|
|
750
|
-
class:
|
|
746
|
+
class: u({ "joy-template-slot-sidebar": t.$slots["template-sidebar"] })
|
|
751
747
|
}, [
|
|
752
|
-
|
|
748
|
+
y(t.$slots, "template-sidebar", {}, void 0, !0)
|
|
753
749
|
], 2)
|
|
754
750
|
], 2)
|
|
755
751
|
], 2));
|
|
756
752
|
}
|
|
757
753
|
});
|
|
758
|
-
const
|
|
754
|
+
const tt = /* @__PURE__ */ v(et, [["__scopeId", "data-v-2333416c"]]), at = ["aria-disabled"], ot = ["id", "disabled", "name", "required", "minlength", "value"], lt = {
|
|
755
|
+
key: 0,
|
|
756
|
+
class: "joy-textarea_helpers"
|
|
757
|
+
}, nt = {
|
|
758
|
+
key: 0,
|
|
759
|
+
name: "check",
|
|
760
|
+
color: "grey",
|
|
761
|
+
size: "xxsmall"
|
|
762
|
+
}, it = /* @__PURE__ */ _({
|
|
763
|
+
__name: "JoyTextarea",
|
|
764
|
+
props: {
|
|
765
|
+
...L,
|
|
766
|
+
...O,
|
|
767
|
+
...N,
|
|
768
|
+
autogrow: {
|
|
769
|
+
type: Boolean,
|
|
770
|
+
default: !1
|
|
771
|
+
},
|
|
772
|
+
minlength: {
|
|
773
|
+
type: Number
|
|
774
|
+
},
|
|
775
|
+
minlengthLabel: String,
|
|
776
|
+
maxlength: {
|
|
777
|
+
type: Number
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
emits: ["update:modelValue"],
|
|
781
|
+
setup(e, { expose: l, emit: t }) {
|
|
782
|
+
const o = e, s = b(), m = b(), j = b(!1), a = I(() => o.maxlength ? o.modelValue.length > o.maxlength : !1), p = I(() => o.minlength ? o.modelValue.length < o.minlength : !1);
|
|
783
|
+
function S() {
|
|
784
|
+
s.value && o.autogrow && (s.value.style.height = "auto", s.value.style.height = s.value.scrollHeight + "px", m.value && (m.value.style.height = s.value.scrollHeight + "px"));
|
|
785
|
+
}
|
|
786
|
+
z(() => {
|
|
787
|
+
S();
|
|
788
|
+
});
|
|
789
|
+
const k = {
|
|
790
|
+
onInput: (i) => {
|
|
791
|
+
t("update:modelValue", i.target.value), S();
|
|
792
|
+
},
|
|
793
|
+
onBlur: () => {
|
|
794
|
+
j.value = a.value || p.value;
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
return l({
|
|
798
|
+
isInvalid: j,
|
|
799
|
+
valueOverMaxlength: a,
|
|
800
|
+
valueUnderMinlength: p
|
|
801
|
+
}), (i, f) => (r(), c("div", {
|
|
802
|
+
"aria-disabled": i.disabled,
|
|
803
|
+
class: u([
|
|
804
|
+
"joy-textarea",
|
|
805
|
+
{
|
|
806
|
+
"joy-textarea_invalid": j.value || i.invalid,
|
|
807
|
+
"joy-textarea_disabled": i.disabled,
|
|
808
|
+
"joy-textarea_autogrow": e.autogrow
|
|
809
|
+
}
|
|
810
|
+
])
|
|
811
|
+
}, [
|
|
812
|
+
W(g(C), {
|
|
813
|
+
for: i.id,
|
|
814
|
+
required: i.required && i.requiredMark,
|
|
815
|
+
"optional-label": i.optionalLabel,
|
|
816
|
+
size: i.labelSize
|
|
817
|
+
}, {
|
|
818
|
+
default: q(() => [
|
|
819
|
+
y(i.$slots, "default", {}, () => [
|
|
820
|
+
V(J(i.label), 1)
|
|
821
|
+
], !0)
|
|
822
|
+
]),
|
|
823
|
+
_: 3
|
|
824
|
+
}, 8, ["for", "required", "optional-label", "size"]),
|
|
825
|
+
n("div", {
|
|
826
|
+
ref_key: "textareaWrapper",
|
|
827
|
+
ref: m,
|
|
828
|
+
class: "joy-textarea_wrapper"
|
|
829
|
+
}, [
|
|
830
|
+
n("textarea", E(i.$attrs, {
|
|
831
|
+
id: i.id,
|
|
832
|
+
ref_key: "textarea",
|
|
833
|
+
ref: s,
|
|
834
|
+
class: "joy-native-textarea",
|
|
835
|
+
disabled: i.disabled,
|
|
836
|
+
name: i.name,
|
|
837
|
+
required: i.required,
|
|
838
|
+
minlength: e.minlength,
|
|
839
|
+
value: i.modelValue,
|
|
840
|
+
onInput: f[0] || (f[0] = //@ts-ignore
|
|
841
|
+
(...d) => k.onInput && k.onInput(...d)),
|
|
842
|
+
onBlur: f[1] || (f[1] = //@ts-ignore
|
|
843
|
+
(...d) => k.onBlur && k.onBlur(...d))
|
|
844
|
+
}), null, 16, ot)
|
|
845
|
+
], 512),
|
|
846
|
+
e.minlength || e.maxlength ? (r(), c("div", lt, [
|
|
847
|
+
e.minlength ? (r(), c("p", {
|
|
848
|
+
key: 0,
|
|
849
|
+
class: u(["joy-textarea-min", { "joy-textarea-min-invalid": i.invalid }])
|
|
850
|
+
}, [
|
|
851
|
+
g(p) ? h("", !0) : (r(), c("joy-icon", nt)),
|
|
852
|
+
V(" " + J(e.minlengthLabel || `Minimum ${e.minlength} characters`), 1)
|
|
853
|
+
], 2)) : h("", !0),
|
|
854
|
+
e.maxlength ? (r(), c("p", {
|
|
855
|
+
key: 1,
|
|
856
|
+
class: u(["joy-textarea-count", { "joy-textarea-count-invalid": g(a) }])
|
|
857
|
+
}, J(i.modelValue.length + "/" + e.maxlength), 3)) : h("", !0)
|
|
858
|
+
])) : h("", !0)
|
|
859
|
+
], 10, at));
|
|
860
|
+
}
|
|
861
|
+
});
|
|
862
|
+
const st = /* @__PURE__ */ v(it, [["__scopeId", "data-v-c8303ed3"]]), rt = ["name", "disabled", "checked", "required", "aria-checked", "value"], dt = { class: "joy-toggle__content" }, ut = /* @__PURE__ */ _({
|
|
759
863
|
__name: "JoyToggle",
|
|
760
|
-
props:
|
|
864
|
+
props: {
|
|
865
|
+
...F,
|
|
866
|
+
label: String
|
|
867
|
+
},
|
|
761
868
|
emits: ["update:modelValue"],
|
|
762
|
-
setup(e, { emit:
|
|
869
|
+
setup(e, { emit: l }) {
|
|
763
870
|
const t = {
|
|
764
|
-
onChange: (
|
|
765
|
-
const
|
|
766
|
-
|
|
871
|
+
onChange: (o) => {
|
|
872
|
+
const s = o.target.checked;
|
|
873
|
+
l("update:modelValue", s);
|
|
767
874
|
}
|
|
768
875
|
};
|
|
769
|
-
return (
|
|
876
|
+
return (o, s) => (r(), c("div", null, [
|
|
770
877
|
n("label", {
|
|
771
|
-
class:
|
|
878
|
+
class: u([
|
|
772
879
|
"joy-toggle",
|
|
773
880
|
{
|
|
774
|
-
"joy-toggle__checked":
|
|
775
|
-
"joy-toggle__disabled":
|
|
881
|
+
"joy-toggle__checked": o.modelValue,
|
|
882
|
+
"joy-toggle__disabled": o.disabled
|
|
776
883
|
}
|
|
777
884
|
])
|
|
778
885
|
}, [
|
|
@@ -781,59 +888,63 @@ const xe = /* @__PURE__ */ _(Ye, [["__scopeId", "data-v-d8b3fcfa"]]), et = ["nam
|
|
|
781
888
|
type: "checkbox",
|
|
782
889
|
class: "joy-toggle__input",
|
|
783
890
|
role: "checkbox",
|
|
784
|
-
name:
|
|
785
|
-
disabled:
|
|
786
|
-
checked:
|
|
787
|
-
required:
|
|
788
|
-
"aria-checked":
|
|
789
|
-
value:
|
|
790
|
-
onChange:
|
|
791
|
-
(...
|
|
792
|
-
}, null, 40,
|
|
793
|
-
n("p",
|
|
794
|
-
|
|
891
|
+
name: o.name,
|
|
892
|
+
disabled: o.disabled,
|
|
893
|
+
checked: o.modelValue,
|
|
894
|
+
required: o.required,
|
|
895
|
+
"aria-checked": o.modelValue,
|
|
896
|
+
value: o.value,
|
|
897
|
+
onChange: s[0] || (s[0] = //@ts-ignore
|
|
898
|
+
(...m) => t.onChange && t.onChange(...m))
|
|
899
|
+
}, null, 40, rt),
|
|
900
|
+
n("p", dt, [
|
|
901
|
+
y(o.$slots, "default", {}, () => [
|
|
902
|
+
V(J(e.label), 1)
|
|
903
|
+
], !0)
|
|
795
904
|
])
|
|
796
905
|
], 2)
|
|
797
906
|
]));
|
|
798
907
|
}
|
|
799
908
|
});
|
|
800
|
-
const
|
|
909
|
+
const ct = /* @__PURE__ */ v(ut, [["__scopeId", "data-v-99d60249"]]), yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
801
910
|
__proto__: null,
|
|
802
|
-
JoyButton:
|
|
803
|
-
JoyCheckbox:
|
|
911
|
+
JoyButton: le,
|
|
912
|
+
JoyCheckbox: ue,
|
|
804
913
|
JoyFormError: _e,
|
|
805
|
-
JoyHighlight:
|
|
806
|
-
JoyInput:
|
|
807
|
-
JoyLabel:
|
|
808
|
-
JoyLink:
|
|
809
|
-
JoyRadio:
|
|
810
|
-
JoyRadioGroup:
|
|
811
|
-
JoySelect:
|
|
812
|
-
JoySpinner:
|
|
813
|
-
JoyTemplate:
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
914
|
+
JoyHighlight: je,
|
|
915
|
+
JoyInput: qe,
|
|
916
|
+
JoyLabel: C,
|
|
917
|
+
JoyLink: ze,
|
|
918
|
+
JoyRadio: He,
|
|
919
|
+
JoyRadioGroup: De,
|
|
920
|
+
JoySelect: Ke,
|
|
921
|
+
JoySpinner: M,
|
|
922
|
+
JoyTemplate: tt,
|
|
923
|
+
JoyTextarea: st,
|
|
924
|
+
JoyToggle: ct,
|
|
925
|
+
JoyWrapper: Qe
|
|
926
|
+
}, Symbol.toStringTag, { value: "Module" })), mt = {
|
|
817
927
|
install: (e) => {
|
|
818
|
-
Object.entries(
|
|
819
|
-
e.component(
|
|
928
|
+
Object.entries(yt).forEach(([l, t]) => {
|
|
929
|
+
e.component(l, t);
|
|
820
930
|
});
|
|
821
931
|
}
|
|
822
932
|
};
|
|
823
933
|
export {
|
|
824
|
-
|
|
825
|
-
|
|
934
|
+
le as JoyButton,
|
|
935
|
+
ue as JoyCheckbox,
|
|
826
936
|
_e as JoyFormError,
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
937
|
+
je as JoyHighlight,
|
|
938
|
+
qe as JoyInput,
|
|
939
|
+
C as JoyLabel,
|
|
940
|
+
ze as JoyLink,
|
|
941
|
+
He as JoyRadio,
|
|
942
|
+
De as JoyRadioGroup,
|
|
943
|
+
Ke as JoySelect,
|
|
944
|
+
M as JoySpinner,
|
|
945
|
+
tt as JoyTemplate,
|
|
946
|
+
st as JoyTextarea,
|
|
947
|
+
ct as JoyToggle,
|
|
948
|
+
mt as JoyVuePlugin,
|
|
949
|
+
Qe as JoyWrapper
|
|
839
950
|
};
|