@maltjoy/core-vue 1.0.0-alpha.6 → 1.0.0-alpha.7
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.vue.d.ts +3 -3
- package/dist/components/JoyCheckbox/JoyCheckbox.vue.d.ts +15 -14
- package/dist/components/JoyCounter/JoyCounter.vue.d.ts +36 -7
- package/dist/components/JoyFormError/JoyFormError.vue.d.ts +4 -0
- package/dist/components/JoyHighlight/JoyHighlight.types.d.ts +1 -1
- package/dist/components/JoyHighlight/JoyHighlight.vue.d.ts +3 -3
- package/dist/components/JoyInput/JoyInput.vue.d.ts +20 -4
- package/dist/components/JoyMultiCheckbox/JoyMultiCheckbox.vue.d.ts +84 -0
- package/dist/components/JoyRadio/JoyRadio.vue.d.ts +1 -1
- package/dist/components/JoySelect/JoySelect.vue.d.ts +2 -2
- package/dist/components/JoySelectableItem/JoySelectableItem.types.d.ts +2 -0
- package/dist/components/JoySelectableItem/JoySelectableItem.vue.d.ts +80 -0
- package/dist/components/JoySelectableItemGroup/JoySelectableItemGroup.vue.d.ts +93 -0
- package/dist/components/JoyTextarea/JoyTextarea.vue.d.ts +2 -2
- package/dist/components/JoyToggle/JoyToggle.vue.d.ts +2 -2
- package/dist/components/JoyWrapper/JoyWrapper.vue.d.ts +9 -9
- package/dist/components/index.d.ts +4 -1
- package/dist/joy-vue.js +722 -413
- package/dist/joy-vue.umd.cjs +1 -1
- package/dist/stories/fixtures/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tests/composables/test-components/CheckboxFormProps.vue.d.ts +2 -2
- package/dist/tests/composables/test-components/GenericFormProps.vue.d.ts +1 -1
- package/dist/tests/composables/test-components/GenericFormPropsWithLabel.vue.d.ts +1 -1
- package/joy-components.d.ts +4 -1
- package/package.json +5 -3
- package/dist/components/JoyButton/tests/JoyButton.spec.d.ts +0 -1
- package/dist/components/JoyCheckbox/tests/JoyCheckbox.spec.d.ts +0 -1
- package/dist/components/JoyFormError/tests/JoyFormError.spec.d.ts +0 -1
- package/dist/components/JoyHighlight/tests/JoyHighlight.spec.d.ts +0 -1
- package/dist/components/JoyLabel/tests/JoyLabel.spec.d.ts +0 -1
- package/dist/components/JoyRadio/tests/JoyRadio.spec.d.ts +0 -1
- package/dist/components/JoySelect/tests/JoySelect.spec.d.ts +0 -1
- package/dist/components/JoyToggle/tests/JoyToggle.spec.d.ts +0 -1
- package/dist/tests/composables/prop.spec.d.ts +0 -1
- package/dist/tests/helpers.spec.d.ts +0 -1
package/dist/joy-vue.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as S, openBlock as i, createElementBlock as r, normalizeClass as v, useAttrs as O, computed as J, createBlock as V, resolveDynamicComponent as z, unref as b, withCtx as q, createCommentVNode as f, createElementVNode as d, renderSlot as m, ref as _, createTextVNode as B, toDisplayString as $, mergeProps as w, createVNode as R, pushScopeId as M, popScopeId as T, useSlots as L, onBeforeMount as P, Fragment as F, renderList as A, onMounted as E, watch as D, createSlots as K } from "vue";
|
|
2
|
+
const Z = ["teal", "white"], Q = /* @__PURE__ */ S({
|
|
3
3
|
__name: "JoySpinner",
|
|
4
4
|
props: {
|
|
5
5
|
color: {
|
|
6
6
|
type: String,
|
|
7
7
|
validator(e) {
|
|
8
|
-
return
|
|
8
|
+
return Z.includes(e);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
setup(e) {
|
|
13
|
-
return (
|
|
14
|
-
class:
|
|
13
|
+
return (n, a) => (i(), r("div", {
|
|
14
|
+
class: v(["joy-spinner", `joy-spinner_${e.color}`])
|
|
15
15
|
}, null, 2));
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
for (const [
|
|
21
|
-
t
|
|
22
|
-
return
|
|
23
|
-
},
|
|
18
|
+
const j = (e, n) => {
|
|
19
|
+
const a = e.__vccOpts || e;
|
|
20
|
+
for (const [t, o] of n)
|
|
21
|
+
a[t] = o;
|
|
22
|
+
return a;
|
|
23
|
+
}, H = /* @__PURE__ */ j(Q, [["__scopeId", "data-v-b633f633"]]), X = ["primary", "secondary"], Y = ["neutral", "success", "info", "warning", "error"], ee = ["main", "admin", "ghost"], te = [...X, ...ee], ae = ["large", "medium", "small", "xsmall", "xxsmall"], le = ["xxsmall", "xsmall", "small"], ne = ["name", "size"], ie = { class: "joy-button--slot" }, oe = /* @__PURE__ */ S({
|
|
24
24
|
__name: "JoyButton",
|
|
25
25
|
props: {
|
|
26
26
|
/**
|
|
@@ -43,7 +43,7 @@ const p = (e, l) => {
|
|
|
43
43
|
type: String,
|
|
44
44
|
default: "primary",
|
|
45
45
|
validator(e) {
|
|
46
|
-
return
|
|
46
|
+
return te.includes(e);
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
/** Button or Link size */
|
|
@@ -51,7 +51,7 @@ const p = (e, l) => {
|
|
|
51
51
|
type: String,
|
|
52
52
|
default: "medium",
|
|
53
53
|
validator(e) {
|
|
54
|
-
return
|
|
54
|
+
return ae.includes(e);
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
/** Override the icon size. Default to xsmall */
|
|
@@ -59,15 +59,15 @@ const p = (e, l) => {
|
|
|
59
59
|
type: String,
|
|
60
60
|
default: "xsmall",
|
|
61
61
|
validator(e) {
|
|
62
|
-
return
|
|
62
|
+
return le.includes(e);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
setup(e) {
|
|
67
|
-
const
|
|
68
|
-
return (o,
|
|
69
|
-
disabled: e.loading ||
|
|
70
|
-
class:
|
|
67
|
+
const n = e, a = O(), t = J(() => ["white", "ghost", "secondary"].includes(n.variant) ? "teal" : "white");
|
|
68
|
+
return (o, s) => (i(), V(z(b(a).href ? "a" : "button"), {
|
|
69
|
+
disabled: e.loading || b(a).disabled,
|
|
70
|
+
class: v([
|
|
71
71
|
"joy-button",
|
|
72
72
|
`joy-button_${e.variant}`,
|
|
73
73
|
`joy-button_${e.size}`,
|
|
@@ -78,25 +78,25 @@ const p = (e, l) => {
|
|
|
78
78
|
])
|
|
79
79
|
}, {
|
|
80
80
|
default: q(() => [
|
|
81
|
-
e.icon ? (i(),
|
|
81
|
+
e.icon ? (i(), r("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 ? (i(),
|
|
86
|
+
}, null, 8, ne)) : f("", !0),
|
|
87
|
+
e.loading ? (i(), V(H, {
|
|
88
88
|
key: 1,
|
|
89
|
-
color:
|
|
90
|
-
}, null, 8, ["color"])) :
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
color: b(t)
|
|
90
|
+
}, null, 8, ["color"])) : f("", !0),
|
|
91
|
+
d("span", ie, [
|
|
92
|
+
m(o.$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 de = /* @__PURE__ */ j(oe, [["__scopeId", "data-v-958cc680"]]), ue = ["aria-checked", "aria-hidden"], re = ["id", "name", "disabled", "checked", "required", "aria-checked", "value", "indeterminate"], se = { class: "joy-checkbox__content-wrapper" }, ce = { class: "joy-checkbox__content" }, ye = /* @__PURE__ */ S({
|
|
100
100
|
__name: "JoyCheckbox",
|
|
101
101
|
props: {
|
|
102
102
|
/** 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 */
|
|
@@ -104,17 +104,21 @@ const ae = /* @__PURE__ */ p(te, [["__scopeId", "data-v-958cc680"]]), le = ["ari
|
|
|
104
104
|
type: Boolean,
|
|
105
105
|
default: !1
|
|
106
106
|
},
|
|
107
|
+
/** Use it to replace the default slot */
|
|
107
108
|
label: {
|
|
108
109
|
type: String
|
|
109
110
|
},
|
|
110
|
-
|
|
111
|
+
/** Checked state of the component */
|
|
112
|
+
checked: {
|
|
111
113
|
type: Boolean,
|
|
112
114
|
default: !1
|
|
113
115
|
},
|
|
116
|
+
/** The value is used in multiselection context in order to build array of values. */
|
|
114
117
|
value: {
|
|
115
118
|
type: String,
|
|
116
119
|
default: "on"
|
|
117
120
|
},
|
|
121
|
+
/** Removes any interactivity if disabled */
|
|
118
122
|
disabled: {
|
|
119
123
|
type: Boolean,
|
|
120
124
|
default: !1
|
|
@@ -122,10 +126,6 @@ const ae = /* @__PURE__ */ p(te, [["__scopeId", "data-v-958cc680"]]), le = ["ari
|
|
|
122
126
|
id: {
|
|
123
127
|
type: String
|
|
124
128
|
},
|
|
125
|
-
invalid: {
|
|
126
|
-
type: Boolean,
|
|
127
|
-
default: !1
|
|
128
|
-
},
|
|
129
129
|
name: {
|
|
130
130
|
type: String
|
|
131
131
|
},
|
|
@@ -133,32 +133,32 @@ const ae = /* @__PURE__ */ p(te, [["__scopeId", "data-v-958cc680"]]), le = ["ari
|
|
|
133
133
|
type: Boolean,
|
|
134
134
|
default: !1
|
|
135
135
|
}
|
|
136
|
-
// ...CHECKBOX_BASED_PROPS,
|
|
137
136
|
},
|
|
138
|
-
emits: ["update:
|
|
139
|
-
setup(e, { expose:
|
|
140
|
-
const
|
|
141
|
-
onChange: (
|
|
142
|
-
const
|
|
143
|
-
|
|
137
|
+
emits: ["update:checked"],
|
|
138
|
+
setup(e, { expose: n, emit: a }) {
|
|
139
|
+
const t = e, o = _(), s = _(t.indeterminate), c = {
|
|
140
|
+
onChange: (l) => {
|
|
141
|
+
const u = l.target.checked;
|
|
142
|
+
s.value = !1, a("update:checked", u);
|
|
144
143
|
}
|
|
145
144
|
};
|
|
146
|
-
return
|
|
147
|
-
isIndeterminate:
|
|
148
|
-
}), (
|
|
149
|
-
"aria-checked": e.
|
|
145
|
+
return n({
|
|
146
|
+
isIndeterminate: s
|
|
147
|
+
}), (l, u) => (i(), r("div", {
|
|
148
|
+
"aria-checked": e.checked,
|
|
150
149
|
"aria-hidden": e.disabled
|
|
151
150
|
}, [
|
|
152
|
-
|
|
153
|
-
class:
|
|
151
|
+
d("label", {
|
|
152
|
+
class: v([
|
|
154
153
|
"joy-checkbox",
|
|
155
154
|
{
|
|
156
|
-
"joy-checkbox__checked": e.
|
|
157
|
-
"joy-checkbox__indeterminate":
|
|
155
|
+
"joy-checkbox__checked": e.checked,
|
|
156
|
+
"joy-checkbox__indeterminate": s.value
|
|
158
157
|
}
|
|
159
158
|
])
|
|
160
159
|
}, [
|
|
161
|
-
|
|
160
|
+
d("input", {
|
|
161
|
+
id: e.id,
|
|
162
162
|
ref_key: "input",
|
|
163
163
|
ref: o,
|
|
164
164
|
type: "checkbox",
|
|
@@ -166,45 +166,45 @@ const ae = /* @__PURE__ */ p(te, [["__scopeId", "data-v-958cc680"]]), le = ["ari
|
|
|
166
166
|
role: "checkbox",
|
|
167
167
|
name: e.name,
|
|
168
168
|
disabled: e.disabled,
|
|
169
|
-
checked: e.
|
|
169
|
+
checked: e.checked,
|
|
170
170
|
required: e.required,
|
|
171
|
-
"aria-checked": e.
|
|
171
|
+
"aria-checked": e.checked,
|
|
172
172
|
value: e.value,
|
|
173
|
-
indeterminate:
|
|
174
|
-
onChange:
|
|
175
|
-
(...
|
|
176
|
-
}, null, 40,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
B(
|
|
173
|
+
indeterminate: s.value,
|
|
174
|
+
onChange: u[0] || (u[0] = //@ts-ignore
|
|
175
|
+
(...g) => c.onChange && c.onChange(...g))
|
|
176
|
+
}, null, 40, re),
|
|
177
|
+
d("div", se, [
|
|
178
|
+
m(l.$slots, "default", {}, () => [
|
|
179
|
+
B($(e.label), 1)
|
|
180
180
|
], !0),
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
d("div", ce, [
|
|
182
|
+
m(l.$slots, "checkbox-content", {}, void 0, !0)
|
|
183
183
|
])
|
|
184
184
|
])
|
|
185
185
|
], 2)
|
|
186
|
-
], 8,
|
|
186
|
+
], 8, ue));
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
|
-
const
|
|
189
|
+
const N = /* @__PURE__ */ j(ye, [["__scopeId", "data-v-7251a11b"]]), G = (e) => (M("data-v-47a76942"), e = e(), T(), e), me = { class: "joy-counter" }, fe = { class: "joy-counter__wrapper" }, be = ["aria-label", "disabled"], ve = /* @__PURE__ */ G(() => /* @__PURE__ */ d("joy-icon", {
|
|
190
190
|
name: "minus",
|
|
191
191
|
color: "teal",
|
|
192
192
|
lazy: !1
|
|
193
|
-
}, null, -1)),
|
|
194
|
-
|
|
195
|
-
],
|
|
193
|
+
}, null, -1)), ge = [
|
|
194
|
+
ve
|
|
195
|
+
], he = ["id", "min", "max", "aria-invalid", "name", "required", "value"], pe = ["aria-label", "disabled"], ke = /* @__PURE__ */ G(() => /* @__PURE__ */ d("joy-icon", {
|
|
196
196
|
name: "add",
|
|
197
197
|
lazy: !1,
|
|
198
198
|
color: "teal"
|
|
199
|
-
}, null, -1)),
|
|
200
|
-
|
|
201
|
-
],
|
|
199
|
+
}, null, -1)), Se = [
|
|
200
|
+
ke
|
|
201
|
+
], je = {
|
|
202
202
|
key: 0,
|
|
203
203
|
class: "joy-counter_error"
|
|
204
|
-
},
|
|
204
|
+
}, _e = /* @__PURE__ */ S({
|
|
205
205
|
__name: "JoyCounter",
|
|
206
206
|
props: {
|
|
207
|
-
|
|
207
|
+
/** Removes any interactivity */
|
|
208
208
|
disabled: {
|
|
209
209
|
type: Boolean,
|
|
210
210
|
default: !1
|
|
@@ -223,20 +223,25 @@ const re = /* @__PURE__ */ p(de, [["__scopeId", "data-v-cd187cef"]]), H = (e) =>
|
|
|
223
223
|
type: Boolean,
|
|
224
224
|
default: !1
|
|
225
225
|
},
|
|
226
|
+
/** Display a label on top of the element. */
|
|
226
227
|
label: String,
|
|
228
|
+
/** Overrides the default label size. See JoyLabel stories */
|
|
227
229
|
labelSize: {
|
|
228
230
|
type: String,
|
|
229
231
|
default: "medium"
|
|
230
232
|
},
|
|
233
|
+
/** If your component is not required, we can add a label to explicitely tell that it's not mandatory */
|
|
231
234
|
optionalLabel: String,
|
|
235
|
+
/** Depending on context, we can add a "*" after the label to specify it's mandatory. */
|
|
232
236
|
requiredMark: {
|
|
233
237
|
type: Boolean,
|
|
234
238
|
default: !1
|
|
235
239
|
},
|
|
236
|
-
|
|
240
|
+
/** Used for aria-label. */
|
|
237
241
|
labelDecrement: {
|
|
238
242
|
type: String
|
|
239
243
|
},
|
|
244
|
+
/** Used for aria-label. */
|
|
240
245
|
labelIncrement: {
|
|
241
246
|
type: String
|
|
242
247
|
},
|
|
@@ -251,53 +256,55 @@ const re = /* @__PURE__ */ p(de, [["__scopeId", "data-v-cd187cef"]]), H = (e) =>
|
|
|
251
256
|
type: Number,
|
|
252
257
|
default: 0
|
|
253
258
|
},
|
|
259
|
+
/** In order to increment or decrement by given steps. For non-integer values, don't use comma */
|
|
254
260
|
step: {
|
|
255
261
|
type: Number,
|
|
256
262
|
default: 1
|
|
257
263
|
},
|
|
258
|
-
|
|
264
|
+
/** When given, it renders a JoyFormError element */
|
|
265
|
+
errorMessage: {
|
|
259
266
|
type: String
|
|
260
267
|
}
|
|
261
268
|
},
|
|
262
269
|
emits: ["update:modelValue"],
|
|
263
|
-
setup(e, { expose:
|
|
264
|
-
const
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
|
|
270
|
+
setup(e, { expose: n, emit: a }) {
|
|
271
|
+
const t = e, o = _(!1);
|
|
272
|
+
function s() {
|
|
273
|
+
const y = u(!1);
|
|
274
|
+
y >= 0 ? a("update:modelValue", y <= t.min ? t.min : y) : a("update:modelValue", 0), l();
|
|
268
275
|
}
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
|
|
276
|
+
function c() {
|
|
277
|
+
const y = u();
|
|
278
|
+
t.max && y <= t.max ? a("update:modelValue", y >= t.max ? t.max : y) : t.max && y > t.max ? a("update:modelValue", t.max) : a("update:modelValue", y), l();
|
|
272
279
|
}
|
|
273
|
-
function
|
|
274
|
-
o.value = !
|
|
280
|
+
function l() {
|
|
281
|
+
o.value = !g();
|
|
275
282
|
}
|
|
276
|
-
function
|
|
277
|
-
const
|
|
278
|
-
return parseFloat(
|
|
283
|
+
function u(y = !0) {
|
|
284
|
+
const h = t.step.toString().split("."), x = h.length === 2 ? h[1].length : 0;
|
|
285
|
+
return parseFloat(y ? (t.modelValue + t.step).toFixed(x) : (t.modelValue - t.step).toFixed(x));
|
|
279
286
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
287
|
+
function g() {
|
|
288
|
+
return p() && I();
|
|
282
289
|
}
|
|
283
|
-
function
|
|
284
|
-
return !
|
|
290
|
+
function p() {
|
|
291
|
+
return !t.max || t.modelValue <= t.max;
|
|
285
292
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
293
|
+
function I() {
|
|
294
|
+
return t.min <= t.modelValue;
|
|
288
295
|
}
|
|
289
|
-
const
|
|
290
|
-
onInput: (
|
|
291
|
-
|
|
296
|
+
const k = {
|
|
297
|
+
onInput: (y) => {
|
|
298
|
+
a("update:modelValue", +y.target.value || 0), o.value = !1;
|
|
292
299
|
},
|
|
293
300
|
onBlur: () => {
|
|
294
|
-
|
|
301
|
+
l();
|
|
295
302
|
}
|
|
296
303
|
};
|
|
297
|
-
return
|
|
298
|
-
props:
|
|
299
|
-
}), (
|
|
300
|
-
e.label ? (i(),
|
|
304
|
+
return n({
|
|
305
|
+
props: t
|
|
306
|
+
}), (y, h) => (i(), r("div", me, [
|
|
307
|
+
e.label ? (i(), V(b(C), {
|
|
301
308
|
key: 0,
|
|
302
309
|
for: e.id,
|
|
303
310
|
required: e.required && e.requiredMark,
|
|
@@ -305,21 +312,21 @@ const re = /* @__PURE__ */ p(de, [["__scopeId", "data-v-cd187cef"]]), H = (e) =>
|
|
|
305
312
|
size: e.labelSize
|
|
306
313
|
}, {
|
|
307
314
|
default: q(() => [
|
|
308
|
-
|
|
309
|
-
B(
|
|
315
|
+
m(y.$slots, "default", {}, () => [
|
|
316
|
+
B($(e.label), 1)
|
|
310
317
|
], !0)
|
|
311
318
|
]),
|
|
312
319
|
_: 3
|
|
313
|
-
}, 8, ["for", "required", "optional-label", "size"])) :
|
|
314
|
-
|
|
315
|
-
|
|
320
|
+
}, 8, ["for", "required", "optional-label", "size"])) : f("", !0),
|
|
321
|
+
d("div", fe, [
|
|
322
|
+
d("button", {
|
|
316
323
|
class: "joy-counter__decrement",
|
|
317
324
|
type: "button",
|
|
318
325
|
"aria-label": e.labelDecrement,
|
|
319
326
|
disabled: e.modelValue <= e.min,
|
|
320
|
-
onClick:
|
|
321
|
-
},
|
|
322
|
-
|
|
327
|
+
onClick: s
|
|
328
|
+
}, ge, 8, be),
|
|
329
|
+
d("input", w({
|
|
323
330
|
id: e.id,
|
|
324
331
|
ref: "input",
|
|
325
332
|
type: "number",
|
|
@@ -331,69 +338,71 @@ const re = /* @__PURE__ */ p(de, [["__scopeId", "data-v-cd187cef"]]), H = (e) =>
|
|
|
331
338
|
required: e.required,
|
|
332
339
|
step: "any",
|
|
333
340
|
value: e.modelValue
|
|
334
|
-
},
|
|
335
|
-
onInput:
|
|
336
|
-
(
|
|
337
|
-
onBlur:
|
|
338
|
-
(
|
|
339
|
-
}), null, 16,
|
|
340
|
-
|
|
341
|
+
}, y.$attrs, {
|
|
342
|
+
onInput: h[0] || (h[0] = //@ts-ignore
|
|
343
|
+
(...x) => k.onInput && k.onInput(...x)),
|
|
344
|
+
onBlur: h[1] || (h[1] = //@ts-ignore
|
|
345
|
+
(...x) => k.onBlur && k.onBlur(...x))
|
|
346
|
+
}), null, 16, he),
|
|
347
|
+
d("button", {
|
|
341
348
|
class: "joy-counter__increment",
|
|
342
349
|
type: "button",
|
|
343
350
|
"aria-label": e.labelIncrement,
|
|
344
351
|
disabled: e.max ? e.modelValue >= e.max : !1,
|
|
345
|
-
onClick:
|
|
346
|
-
},
|
|
347
|
-
e.invalid && e.
|
|
348
|
-
R(
|
|
349
|
-
])) :
|
|
352
|
+
onClick: c
|
|
353
|
+
}, Se, 8, pe),
|
|
354
|
+
e.invalid && e.errorMessage ? (i(), r("div", je, [
|
|
355
|
+
R(b(U), { "no-html-error-text": e.errorMessage }, null, 8, ["no-html-error-text"])
|
|
356
|
+
])) : f("", !0)
|
|
350
357
|
])
|
|
351
358
|
]));
|
|
352
359
|
}
|
|
353
360
|
});
|
|
354
|
-
const
|
|
361
|
+
const $e = /* @__PURE__ */ j(_e, [["__scopeId", "data-v-47a76942"]]), xe = (e) => (M("data-v-d693f93c"), e = e(), T(), e), Ie = ["aria-hidden"], qe = /* @__PURE__ */ xe(() => /* @__PURE__ */ d("joy-icon", {
|
|
355
362
|
"custom-class": "joy-icon-error",
|
|
356
363
|
name: "warning-triangle"
|
|
357
|
-
}, null, -1)),
|
|
364
|
+
}, null, -1)), Be = /* @__PURE__ */ S({
|
|
358
365
|
__name: "JoyFormError",
|
|
359
366
|
props: {
|
|
367
|
+
/** In some cases you'll need to inject the error in the DOM but hide it. Visible by default */
|
|
360
368
|
visible: {
|
|
361
369
|
type: Boolean,
|
|
362
370
|
default: !0
|
|
363
371
|
},
|
|
372
|
+
/** Error message to display. If you need a list of errors, use the slot instead */
|
|
364
373
|
noHtmlErrorText: String
|
|
365
374
|
},
|
|
366
375
|
setup(e) {
|
|
367
|
-
return (
|
|
376
|
+
return (n, a) => (i(), r("div", {
|
|
368
377
|
"aria-hidden": e.visible,
|
|
369
|
-
class:
|
|
378
|
+
class: v(["joy-form-error", { "joy-has-error": e.visible }]),
|
|
370
379
|
role: "alert"
|
|
371
380
|
}, [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
B(
|
|
381
|
+
qe,
|
|
382
|
+
d("div", null, [
|
|
383
|
+
m(n.$slots, "default", {}, () => [
|
|
384
|
+
B($(e.noHtmlErrorText), 1)
|
|
376
385
|
], !0)
|
|
377
386
|
])
|
|
378
|
-
], 10,
|
|
387
|
+
], 10, Ie));
|
|
379
388
|
}
|
|
380
389
|
});
|
|
381
|
-
const
|
|
382
|
-
function
|
|
383
|
-
let
|
|
390
|
+
const U = /* @__PURE__ */ j(Be, [["__scopeId", "data-v-d693f93c"]]);
|
|
391
|
+
function Ve(e) {
|
|
392
|
+
let n;
|
|
384
393
|
switch (e) {
|
|
385
394
|
case "error":
|
|
386
|
-
|
|
395
|
+
n = "warning-triangle";
|
|
387
396
|
break;
|
|
388
397
|
case "success":
|
|
389
|
-
|
|
398
|
+
n = "check";
|
|
390
399
|
break;
|
|
391
400
|
default:
|
|
392
|
-
|
|
401
|
+
n = "info-circle";
|
|
393
402
|
}
|
|
394
|
-
return
|
|
403
|
+
return n;
|
|
395
404
|
}
|
|
396
|
-
const
|
|
405
|
+
const Je = [...Y], Ce = ["name"], we = { class: "joy-highlight--text" }, Le = /* @__PURE__ */ S({
|
|
397
406
|
__name: "JoyHighlight",
|
|
398
407
|
props: {
|
|
399
408
|
accent: {
|
|
@@ -409,16 +418,16 @@ const Ve = [...U], Ie = ["name"], Be = { class: "joy-highlight--text" }, Je = /*
|
|
|
409
418
|
type: String,
|
|
410
419
|
default: "neutral",
|
|
411
420
|
validator(e) {
|
|
412
|
-
return
|
|
421
|
+
return Je.includes(e);
|
|
413
422
|
}
|
|
414
423
|
}
|
|
415
424
|
},
|
|
416
|
-
setup(e, { expose:
|
|
417
|
-
const
|
|
418
|
-
return
|
|
419
|
-
getRelevantIcon:
|
|
420
|
-
}), (o,
|
|
421
|
-
class:
|
|
425
|
+
setup(e, { expose: n }) {
|
|
426
|
+
const a = e, t = J(() => a.icon ? a.icon : Ve(a.level));
|
|
427
|
+
return n({
|
|
428
|
+
getRelevantIcon: t
|
|
429
|
+
}), (o, s) => (i(), r("div", {
|
|
430
|
+
class: v([
|
|
422
431
|
"joy-highlight",
|
|
423
432
|
`joy-highlight_${e.level}`,
|
|
424
433
|
{
|
|
@@ -427,33 +436,33 @@ const Ve = [...U], Ie = ["name"], Be = { class: "joy-highlight--text" }, Je = /*
|
|
|
427
436
|
}
|
|
428
437
|
])
|
|
429
438
|
}, [
|
|
430
|
-
e.displayIcon ? (i(),
|
|
439
|
+
e.displayIcon ? (i(), r("joy-icon", {
|
|
431
440
|
key: 0,
|
|
432
|
-
name:
|
|
433
|
-
}, null, 8,
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
441
|
+
name: b(t)
|
|
442
|
+
}, null, 8, Ce)) : f("", !0),
|
|
443
|
+
d("div", we, [
|
|
444
|
+
d("strong", null, [
|
|
445
|
+
m(o.$slots, "highlight-title", {}, void 0, !0)
|
|
437
446
|
]),
|
|
438
|
-
|
|
447
|
+
m(o.$slots, "default", {}, void 0, !0)
|
|
439
448
|
])
|
|
440
449
|
], 2));
|
|
441
450
|
}
|
|
442
451
|
});
|
|
443
|
-
const
|
|
452
|
+
const ze = /* @__PURE__ */ j(Le, [["__scopeId", "data-v-15d3fa11"]]), Me = ["small", "medium", "large"], Te = {
|
|
444
453
|
key: 0,
|
|
445
454
|
class: "joy-label-required"
|
|
446
|
-
},
|
|
455
|
+
}, Ee = {
|
|
447
456
|
key: 1,
|
|
448
457
|
class: "joy-label-optional"
|
|
449
|
-
},
|
|
458
|
+
}, Ne = /* @__PURE__ */ S({
|
|
450
459
|
__name: "JoyLabel",
|
|
451
460
|
props: {
|
|
452
461
|
size: {
|
|
453
462
|
type: String,
|
|
454
463
|
default: "medium",
|
|
455
464
|
validator(e) {
|
|
456
|
-
return
|
|
465
|
+
return Me.includes(e);
|
|
457
466
|
}
|
|
458
467
|
},
|
|
459
468
|
tagName: {
|
|
@@ -469,22 +478,21 @@ const qe = /* @__PURE__ */ p(Je, [["__scopeId", "data-v-15d3fa11"]]), we = ["sma
|
|
|
469
478
|
}
|
|
470
479
|
},
|
|
471
480
|
setup(e) {
|
|
472
|
-
return (
|
|
481
|
+
return (n, a) => (i(), V(z(e.tagName), w({
|
|
473
482
|
class: ["joy-label", `joy-label--${e.size}`]
|
|
474
|
-
},
|
|
483
|
+
}, n.$attrs), {
|
|
475
484
|
default: q(() => [
|
|
476
|
-
|
|
477
|
-
e.required ? (i(),
|
|
478
|
-
e.optionalLabel ? (i(),
|
|
485
|
+
m(n.$slots, "default", {}, void 0, !0),
|
|
486
|
+
e.required ? (i(), r("span", Te, "*")) : f("", !0),
|
|
487
|
+
e.optionalLabel ? (i(), r("span", Ee, "- " + $(e.optionalLabel), 1)) : f("", !0)
|
|
479
488
|
]),
|
|
480
489
|
_: 3
|
|
481
490
|
}, 16, ["class"]));
|
|
482
491
|
}
|
|
483
492
|
});
|
|
484
|
-
const C = /* @__PURE__ */
|
|
493
|
+
const C = /* @__PURE__ */ j(Ne, [["__scopeId", "data-v-e3232407"]]), Oe = ["large", "medium", "small"], Re = ["id", "disabled", "type", "value"], Fe = ["data-unit"], Ae = /* @__PURE__ */ S({
|
|
485
494
|
__name: "JoyInput",
|
|
486
495
|
props: {
|
|
487
|
-
// ...FORM_BASED_PROPS,
|
|
488
496
|
disabled: {
|
|
489
497
|
type: Boolean,
|
|
490
498
|
default: !1
|
|
@@ -503,78 +511,83 @@ const C = /* @__PURE__ */ p(ze, [["__scopeId", "data-v-e3232407"]]), Ee = ["larg
|
|
|
503
511
|
type: Boolean,
|
|
504
512
|
default: !1
|
|
505
513
|
},
|
|
514
|
+
/** Display a label on top of the element. */
|
|
506
515
|
label: String,
|
|
516
|
+
/** Overrides the default label size. See JoyLabel stories */
|
|
507
517
|
labelSize: {
|
|
508
518
|
type: String,
|
|
509
519
|
default: "medium"
|
|
510
520
|
},
|
|
521
|
+
/** If your component is not required, we can add a label to explicitely tell that it's not mandatory */
|
|
511
522
|
optionalLabel: String,
|
|
523
|
+
/** Depending on context, we can add a "*" after the label to specify it's mandatory. */
|
|
512
524
|
requiredMark: {
|
|
513
525
|
type: Boolean,
|
|
514
526
|
default: !1
|
|
515
527
|
},
|
|
516
|
-
// ...LABEL_BASED_PROPS,
|
|
517
528
|
modelValue: {
|
|
518
529
|
type: String,
|
|
519
530
|
default: ""
|
|
520
531
|
},
|
|
521
|
-
|
|
532
|
+
/** Display a cross icon on the right that enables to clear the field */
|
|
522
533
|
clearable: {
|
|
523
534
|
type: Boolean,
|
|
524
535
|
default: !1
|
|
525
536
|
},
|
|
537
|
+
/** Add a JoyIcon / joy-icon with given name on left-side. */
|
|
526
538
|
icon: String,
|
|
527
539
|
size: {
|
|
528
540
|
type: String,
|
|
529
541
|
default: "medium",
|
|
530
542
|
validator(e) {
|
|
531
|
-
return
|
|
543
|
+
return Oe.includes(e);
|
|
532
544
|
}
|
|
533
545
|
},
|
|
534
546
|
type: String,
|
|
547
|
+
/** Adds a legend like symbol on the right of the component. Made for number based values */
|
|
535
548
|
unit: String
|
|
536
549
|
},
|
|
537
550
|
emits: ["update:modelValue"],
|
|
538
|
-
setup(e, { emit:
|
|
539
|
-
const
|
|
540
|
-
var
|
|
541
|
-
return !!((
|
|
542
|
-
}),
|
|
543
|
-
|
|
544
|
-
|
|
551
|
+
setup(e, { emit: n }) {
|
|
552
|
+
const a = e, t = _(), o = _(), s = O(), c = L(), l = _(!1), u = J(() => a.clearable && a.modelValue.length > 0 && !a.unit), g = J(() => c.default && c.default()), p = J(() => {
|
|
553
|
+
var y, h;
|
|
554
|
+
return !!((y = o.value) != null && y.closest("joy-wrapper")) || !!((h = o.value) != null && h.closest(".joy-wrapper"));
|
|
555
|
+
}), I = _(a.type);
|
|
556
|
+
P(() => {
|
|
557
|
+
I.value = a.unit ? "number" : a.unit || "text";
|
|
545
558
|
});
|
|
546
|
-
const
|
|
559
|
+
const k = {
|
|
547
560
|
onFocus: () => {
|
|
548
|
-
|
|
561
|
+
l.value = !0;
|
|
549
562
|
},
|
|
550
563
|
onBlur: () => {
|
|
551
|
-
|
|
564
|
+
l.value = !1;
|
|
552
565
|
},
|
|
553
|
-
onInput: (
|
|
554
|
-
let
|
|
555
|
-
|
|
566
|
+
onInput: (y) => {
|
|
567
|
+
let h = y.target.value;
|
|
568
|
+
n("update:modelValue", h);
|
|
556
569
|
},
|
|
557
570
|
clearValue: () => {
|
|
558
|
-
|
|
571
|
+
a.disabled || n("update:modelValue", "");
|
|
559
572
|
}
|
|
560
573
|
};
|
|
561
|
-
return (
|
|
574
|
+
return (y, h) => (i(), r("div", {
|
|
562
575
|
ref_key: "root",
|
|
563
576
|
ref: o,
|
|
564
|
-
class:
|
|
577
|
+
class: v([`joy-input--${a.size}`])
|
|
565
578
|
}, [
|
|
566
|
-
|
|
567
|
-
class:
|
|
579
|
+
d("div", {
|
|
580
|
+
class: v([
|
|
568
581
|
"joy-input",
|
|
569
582
|
{
|
|
570
|
-
"joy-input--focusing":
|
|
583
|
+
"joy-input--focusing": l.value,
|
|
571
584
|
"joy-input--disabled": e.disabled,
|
|
572
585
|
"joy-input--invalid": e.invalid,
|
|
573
|
-
"joy-input--valid": !e.invalid && !
|
|
586
|
+
"joy-input--valid": !e.invalid && !b(s).disabled
|
|
574
587
|
}
|
|
575
588
|
])
|
|
576
589
|
}, [
|
|
577
|
-
g
|
|
590
|
+
b(g) || e.label ? (i(), V(C, {
|
|
578
591
|
key: 0,
|
|
579
592
|
for: e.name,
|
|
580
593
|
required: e.required && e.requiredMark,
|
|
@@ -582,27 +595,27 @@ const C = /* @__PURE__ */ p(ze, [["__scopeId", "data-v-e3232407"]]), Ee = ["larg
|
|
|
582
595
|
size: e.labelSize
|
|
583
596
|
}, {
|
|
584
597
|
default: q(() => [
|
|
585
|
-
|
|
586
|
-
B(
|
|
598
|
+
m(y.$slots, "default", {}, () => [
|
|
599
|
+
B($(e.label), 1)
|
|
587
600
|
], !0)
|
|
588
601
|
]),
|
|
589
602
|
_: 3
|
|
590
|
-
}, 8, ["for", "required", "optional-label", "size"])) :
|
|
591
|
-
|
|
592
|
-
class:
|
|
603
|
+
}, 8, ["for", "required", "optional-label", "size"])) : f("", !0),
|
|
604
|
+
d("div", {
|
|
605
|
+
class: v([
|
|
593
606
|
"joy-input--wrapper",
|
|
594
607
|
{
|
|
595
608
|
"joy-input--wrapper-has-icon": !!e.icon,
|
|
596
609
|
"joy-input--wrapper---clearable": e.clearable,
|
|
597
610
|
"joy-input--wrapper-unit": !!e.unit,
|
|
598
|
-
"joy-input--wrapper-margin": !
|
|
611
|
+
"joy-input--wrapper-margin": !b(p)
|
|
599
612
|
}
|
|
600
613
|
])
|
|
601
614
|
}, [
|
|
602
|
-
|
|
603
|
-
id:
|
|
615
|
+
d("input", w(y.$attrs, {
|
|
616
|
+
id: a.name,
|
|
604
617
|
ref_key: "input",
|
|
605
|
-
ref:
|
|
618
|
+
ref: t,
|
|
606
619
|
disabled: e.disabled,
|
|
607
620
|
class: [
|
|
608
621
|
{
|
|
@@ -610,34 +623,34 @@ const C = /* @__PURE__ */ p(ze, [["__scopeId", "data-v-e3232407"]]), Ee = ["larg
|
|
|
610
623
|
"joy-input--field-invalid": e.invalid
|
|
611
624
|
}
|
|
612
625
|
],
|
|
613
|
-
type:
|
|
626
|
+
type: I.value,
|
|
614
627
|
value: e.modelValue,
|
|
615
|
-
onFocus:
|
|
616
|
-
(
|
|
617
|
-
onBlur:
|
|
618
|
-
(
|
|
619
|
-
onInput:
|
|
620
|
-
(
|
|
621
|
-
}), null, 16,
|
|
622
|
-
|
|
628
|
+
onFocus: h[0] || (h[0] = //@ts-ignore
|
|
629
|
+
(...x) => k.onFocus && k.onFocus(...x)),
|
|
630
|
+
onBlur: h[1] || (h[1] = //@ts-ignore
|
|
631
|
+
(...x) => k.onBlur && k.onBlur(...x)),
|
|
632
|
+
onInput: h[2] || (h[2] = //@ts-ignore
|
|
633
|
+
(...x) => k.onInput && k.onInput(...x))
|
|
634
|
+
}), null, 16, Re),
|
|
635
|
+
b(u) ? (i(), r("joy-icon", {
|
|
623
636
|
key: 0,
|
|
624
637
|
size: "xxsmall",
|
|
625
638
|
name: "cross",
|
|
626
639
|
class: "joy-input--clear",
|
|
627
|
-
onClick:
|
|
628
|
-
(
|
|
629
|
-
})) :
|
|
630
|
-
e.unit ? (i(),
|
|
640
|
+
onClick: h[3] || (h[3] = //@ts-ignore
|
|
641
|
+
(...x) => k.clearValue && k.clearValue(...x))
|
|
642
|
+
})) : f("", !0),
|
|
643
|
+
e.unit ? (i(), r("div", {
|
|
631
644
|
key: 1,
|
|
632
645
|
"data-unit": e.unit,
|
|
633
646
|
class: "joy-input--unit"
|
|
634
|
-
}, null, 8,
|
|
647
|
+
}, null, 8, Fe)) : f("", !0)
|
|
635
648
|
], 2)
|
|
636
649
|
], 2)
|
|
637
650
|
], 2));
|
|
638
651
|
}
|
|
639
652
|
});
|
|
640
|
-
const
|
|
653
|
+
const He = /* @__PURE__ */ j(Ae, [["__scopeId", "data-v-f264c5ef"]]), Ge = ["teal", "white"], Ue = ["href"], We = ["color", "name"], Pe = /* @__PURE__ */ S({
|
|
641
654
|
__name: "JoyLink",
|
|
642
655
|
props: {
|
|
643
656
|
href: {
|
|
@@ -648,26 +661,109 @@ const Re = /* @__PURE__ */ p(Me, [["__scopeId", "data-v-3da79efb"]]), Fe = ["tea
|
|
|
648
661
|
type: String,
|
|
649
662
|
default: "teal",
|
|
650
663
|
validator(e) {
|
|
651
|
-
return
|
|
664
|
+
return Ge.includes(e);
|
|
652
665
|
}
|
|
653
666
|
},
|
|
654
667
|
icon: String
|
|
655
668
|
},
|
|
656
669
|
setup(e) {
|
|
657
|
-
const
|
|
658
|
-
return (
|
|
670
|
+
const n = e, a = J(() => n.color === "white" ? "white" : "teal");
|
|
671
|
+
return (t, o) => (i(), r("a", w({ href: e.href }, t.$attrs, {
|
|
659
672
|
class: ["joy-link", `joy-link_${e.color}`]
|
|
660
673
|
}), [
|
|
661
|
-
e.icon ? (i(),
|
|
674
|
+
e.icon ? (i(), r("joy-icon", {
|
|
662
675
|
key: 0,
|
|
663
|
-
color:
|
|
676
|
+
color: b(a),
|
|
664
677
|
name: e.icon
|
|
665
|
-
}, null, 8,
|
|
666
|
-
|
|
667
|
-
], 16,
|
|
678
|
+
}, null, 8, We)) : f("", !0),
|
|
679
|
+
m(t.$slots, "default", {}, void 0, !0)
|
|
680
|
+
], 16, Ue));
|
|
668
681
|
}
|
|
669
682
|
});
|
|
670
|
-
const
|
|
683
|
+
const De = /* @__PURE__ */ j(Pe, [["__scopeId", "data-v-640ee9a6"]]), Ke = ["id"], Ze = {
|
|
684
|
+
class: /* @__PURE__ */ v(["joy-multi-checkbox"])
|
|
685
|
+
}, Qe = /* @__PURE__ */ S({
|
|
686
|
+
__name: "JoyMultiCheckbox",
|
|
687
|
+
props: {
|
|
688
|
+
options: {
|
|
689
|
+
type: Array,
|
|
690
|
+
required: !0,
|
|
691
|
+
validator(e) {
|
|
692
|
+
const n = e.every((t) => Object.keys(t).includes("value")), a = e.every((t) => Object.keys(t).includes("label"));
|
|
693
|
+
return n && a;
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
id: String,
|
|
697
|
+
value: {
|
|
698
|
+
type: Object,
|
|
699
|
+
default() {
|
|
700
|
+
return [];
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
fullWidth: {
|
|
704
|
+
type: Boolean,
|
|
705
|
+
default: !1
|
|
706
|
+
},
|
|
707
|
+
required: {
|
|
708
|
+
type: Boolean,
|
|
709
|
+
default: !1
|
|
710
|
+
},
|
|
711
|
+
label: String,
|
|
712
|
+
labelSize: {
|
|
713
|
+
type: String,
|
|
714
|
+
default: "medium"
|
|
715
|
+
},
|
|
716
|
+
optionalLabel: String,
|
|
717
|
+
requiredMark: {
|
|
718
|
+
type: Boolean,
|
|
719
|
+
default: !1
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
emits: ["update:value"],
|
|
723
|
+
setup(e, { emit: n }) {
|
|
724
|
+
const a = e;
|
|
725
|
+
function t(s) {
|
|
726
|
+
return a.value.includes(s.value);
|
|
727
|
+
}
|
|
728
|
+
function o(s, c) {
|
|
729
|
+
let l = [...a.value || []];
|
|
730
|
+
c ? l.push(s) : l.splice(l.indexOf(s), 1), n("update:value", l);
|
|
731
|
+
}
|
|
732
|
+
return (s, c) => (i(), r("fieldset", {
|
|
733
|
+
id: e.id,
|
|
734
|
+
class: "joy-multi-checkbox__wrapper"
|
|
735
|
+
}, [
|
|
736
|
+
e.label ? (i(), V(b(C), {
|
|
737
|
+
key: 0,
|
|
738
|
+
"tag-name": "legend",
|
|
739
|
+
required: e.required && e.requiredMark,
|
|
740
|
+
"optional-label": e.optionalLabel,
|
|
741
|
+
size: e.labelSize
|
|
742
|
+
}, {
|
|
743
|
+
default: q(() => [
|
|
744
|
+
B($(e.label), 1)
|
|
745
|
+
]),
|
|
746
|
+
_: 1
|
|
747
|
+
}, 8, ["required", "optional-label", "size"])) : f("", !0),
|
|
748
|
+
d("div", Ze, [
|
|
749
|
+
(i(!0), r(F, null, A(e.options, (l) => (i(), V(b(N), {
|
|
750
|
+
id: l.id,
|
|
751
|
+
key: l.id,
|
|
752
|
+
name: l.name,
|
|
753
|
+
value: l.value,
|
|
754
|
+
checked: t(l),
|
|
755
|
+
"onUpdate:checked": (u) => o(l.value, u)
|
|
756
|
+
}, {
|
|
757
|
+
default: q(() => [
|
|
758
|
+
B($(l.label), 1)
|
|
759
|
+
]),
|
|
760
|
+
_: 2
|
|
761
|
+
}, 1032, ["id", "name", "value", "checked", "onUpdate:checked"]))), 128))
|
|
762
|
+
])
|
|
763
|
+
], 8, Ke));
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
const Xe = /* @__PURE__ */ j(Qe, [["__scopeId", "data-v-ac218b17"]]), Ye = ["id", "value", "checked", "disabled", "required", "name"], et = { class: "joy-radio-label" }, tt = { class: "joy-radio-content__wrapper" }, at = { class: "joy-radio-content" }, lt = /* @__PURE__ */ S({
|
|
671
767
|
__name: "JoyRadio",
|
|
672
768
|
props: {
|
|
673
769
|
disabled: {
|
|
@@ -701,66 +797,66 @@ const Ge = /* @__PURE__ */ p(Ae, [["__scopeId", "data-v-640ee9a6"]]), De = ["id"
|
|
|
701
797
|
}
|
|
702
798
|
},
|
|
703
799
|
emits: ["update:modelValue"],
|
|
704
|
-
setup(e, { expose:
|
|
705
|
-
const
|
|
706
|
-
function
|
|
707
|
-
o.value = !!
|
|
800
|
+
setup(e, { expose: n, emit: a }) {
|
|
801
|
+
const t = e, o = _(!1), s = _(null), c = _(null), l = L(), u = J(() => !t.modelValue || !t.value ? !1 : t.modelValue === t.value);
|
|
802
|
+
function g() {
|
|
803
|
+
o.value = !!l["expandable-content"] && u.value;
|
|
708
804
|
}
|
|
709
|
-
function
|
|
710
|
-
|
|
805
|
+
function p() {
|
|
806
|
+
a("update:modelValue", t.value), g();
|
|
711
807
|
}
|
|
712
|
-
return
|
|
713
|
-
|
|
714
|
-
}),
|
|
715
|
-
() =>
|
|
808
|
+
return E(() => {
|
|
809
|
+
t.theme === "outline" && g();
|
|
810
|
+
}), D(
|
|
811
|
+
() => t.modelValue,
|
|
716
812
|
() => {
|
|
717
|
-
|
|
813
|
+
g();
|
|
718
814
|
}
|
|
719
|
-
),
|
|
720
|
-
checked:
|
|
815
|
+
), n({
|
|
816
|
+
checked: u,
|
|
721
817
|
isExpanded: o
|
|
722
|
-
}), (
|
|
818
|
+
}), (I, k) => (i(), r("label", {
|
|
723
819
|
ref_key: "root",
|
|
724
|
-
ref:
|
|
725
|
-
class:
|
|
820
|
+
ref: s,
|
|
821
|
+
class: v([
|
|
726
822
|
"joy-radio",
|
|
727
823
|
`joy-radio--${e.theme}`,
|
|
728
824
|
{
|
|
729
|
-
"joy-radio--checked":
|
|
825
|
+
"joy-radio--checked": b(u),
|
|
730
826
|
"joy-radio--disabled": e.disabled,
|
|
731
827
|
"joy-radio--invalid": e.invalid
|
|
732
828
|
}
|
|
733
829
|
])
|
|
734
830
|
}, [
|
|
735
|
-
|
|
736
|
-
id: e.
|
|
831
|
+
d("input", {
|
|
832
|
+
id: e.id,
|
|
737
833
|
type: "radio",
|
|
738
834
|
value: e.value,
|
|
739
|
-
checked:
|
|
835
|
+
checked: b(u),
|
|
740
836
|
disabled: e.disabled,
|
|
741
837
|
required: e.required,
|
|
742
838
|
name: e.name,
|
|
743
|
-
onChange:
|
|
744
|
-
}, null, 40,
|
|
745
|
-
|
|
746
|
-
|
|
839
|
+
onChange: p
|
|
840
|
+
}, null, 40, Ye),
|
|
841
|
+
d("span", et, [
|
|
842
|
+
m(I.$slots, "default", {}, void 0, !0)
|
|
747
843
|
]),
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
844
|
+
d("div", tt, [
|
|
845
|
+
d("div", at, [
|
|
846
|
+
m(I.$slots, "radio-content", {}, void 0, !0)
|
|
751
847
|
]),
|
|
752
|
-
|
|
848
|
+
d("div", {
|
|
753
849
|
ref_key: "expandableElement",
|
|
754
|
-
ref:
|
|
755
|
-
class:
|
|
850
|
+
ref: c,
|
|
851
|
+
class: v(["joy-radio-expandable", { "joy-radio-expandable--expanded": o.value }])
|
|
756
852
|
}, [
|
|
757
|
-
|
|
853
|
+
m(I.$slots, "expandable-content", {}, void 0, !0)
|
|
758
854
|
], 2)
|
|
759
855
|
])
|
|
760
856
|
], 2));
|
|
761
857
|
}
|
|
762
858
|
});
|
|
763
|
-
const
|
|
859
|
+
const nt = /* @__PURE__ */ j(lt, [["__scopeId", "data-v-8882dc58"]]), it = ["form", "name"], ot = /* @__PURE__ */ S({
|
|
764
860
|
__name: "JoyRadioGroup",
|
|
765
861
|
props: {
|
|
766
862
|
direction: {
|
|
@@ -775,26 +871,26 @@ const Ke = /* @__PURE__ */ p(Ze, [["__scopeId", "data-v-0a0dcfe7"]]), Qe = ["for
|
|
|
775
871
|
}
|
|
776
872
|
},
|
|
777
873
|
setup(e) {
|
|
778
|
-
return (
|
|
874
|
+
return (n, a) => (i(), r("fieldset", {
|
|
779
875
|
ref: "root",
|
|
780
876
|
class: "joy-radio-group-fieldset",
|
|
781
877
|
role: "radiogroup",
|
|
782
878
|
form: e.form,
|
|
783
879
|
name: e.name
|
|
784
880
|
}, [
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
class:
|
|
881
|
+
m(n.$slots, "radio-group-legend", {}, void 0, !0),
|
|
882
|
+
d("div", {
|
|
883
|
+
class: v(["joy-radio-group-container", `joy-radio-group-${e.direction}`])
|
|
788
884
|
}, [
|
|
789
|
-
|
|
885
|
+
m(n.$slots, "default", {}, void 0, !0)
|
|
790
886
|
], 2)
|
|
791
|
-
], 8,
|
|
887
|
+
], 8, it));
|
|
792
888
|
}
|
|
793
889
|
});
|
|
794
|
-
const
|
|
890
|
+
const dt = /* @__PURE__ */ j(ot, [["__scopeId", "data-v-d75cd96a"]]), ut = (e) => (M("data-v-f9015b7b"), e = e(), T(), e), rt = ["id", "name", "aria-invalid", "required", "disabled", "value"], st = /* @__PURE__ */ ut(() => /* @__PURE__ */ d("joy-icon", {
|
|
795
891
|
class: "joy-select__chevron",
|
|
796
892
|
name: "chevron-down"
|
|
797
|
-
}, null, -1)),
|
|
893
|
+
}, null, -1)), ct = /* @__PURE__ */ S({
|
|
798
894
|
__name: "JoySelect",
|
|
799
895
|
props: {
|
|
800
896
|
disabled: {
|
|
@@ -834,33 +930,33 @@ const Ye = /* @__PURE__ */ p(Xe, [["__scopeId", "data-v-d75cd96a"]]), et = (e) =
|
|
|
834
930
|
// ...TEXT_BASED_PROPS,
|
|
835
931
|
},
|
|
836
932
|
emits: ["update:modelValue"],
|
|
837
|
-
setup(e, { emit:
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
var
|
|
841
|
-
const
|
|
842
|
-
if (!
|
|
933
|
+
setup(e, { emit: n }) {
|
|
934
|
+
const a = e, t = _(), o = _(), s = L();
|
|
935
|
+
E(() => {
|
|
936
|
+
var g;
|
|
937
|
+
const l = s.label && s.label();
|
|
938
|
+
if (!l || !l.length)
|
|
843
939
|
return;
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
846
|
-
const
|
|
847
|
-
if (!
|
|
940
|
+
const u = l[0];
|
|
941
|
+
if (u.type === "JoyLabel") {
|
|
942
|
+
const p = (g = u.props) == null ? void 0 : g.for;
|
|
943
|
+
if (!p) {
|
|
848
944
|
console.warn("JoyLabel for attribute is missing");
|
|
849
945
|
return;
|
|
850
946
|
}
|
|
851
|
-
|
|
947
|
+
p !== a.id && console.warn("JoyLabel for attribute does not match with JoySelect id");
|
|
852
948
|
}
|
|
853
949
|
});
|
|
854
|
-
function
|
|
855
|
-
const
|
|
856
|
-
|
|
950
|
+
function c(l) {
|
|
951
|
+
const u = l.target.value;
|
|
952
|
+
n("update:modelValue", u);
|
|
857
953
|
}
|
|
858
|
-
return (
|
|
954
|
+
return (l, u) => (i(), r("div", {
|
|
859
955
|
ref_key: "root",
|
|
860
|
-
ref:
|
|
956
|
+
ref: t
|
|
861
957
|
}, [
|
|
862
|
-
|
|
863
|
-
e.label ? (i(),
|
|
958
|
+
m(l.$slots, "label", {}, () => [
|
|
959
|
+
e.label ? (i(), V(C, {
|
|
864
960
|
key: 0,
|
|
865
961
|
required: e.required && e.requiredMark,
|
|
866
962
|
"optional-label": e.optionalLabel,
|
|
@@ -868,19 +964,19 @@ const Ye = /* @__PURE__ */ p(Xe, [["__scopeId", "data-v-d75cd96a"]]), et = (e) =
|
|
|
868
964
|
size: e.labelSize
|
|
869
965
|
}, {
|
|
870
966
|
default: q(() => [
|
|
871
|
-
B(
|
|
967
|
+
B($(e.label), 1)
|
|
872
968
|
]),
|
|
873
969
|
_: 1
|
|
874
|
-
}, 8, ["required", "optional-label", "for", "size"])) :
|
|
970
|
+
}, 8, ["required", "optional-label", "for", "size"])) : f("", !0)
|
|
875
971
|
], !0),
|
|
876
|
-
|
|
877
|
-
class:
|
|
972
|
+
d("div", {
|
|
973
|
+
class: v({
|
|
878
974
|
"joy-select__wrapper": !0,
|
|
879
975
|
"joy-select--invalid": e.invalid,
|
|
880
976
|
"joy-select--disabled": e.disabled
|
|
881
977
|
})
|
|
882
978
|
}, [
|
|
883
|
-
|
|
979
|
+
d("select", {
|
|
884
980
|
id: e.id || e.name,
|
|
885
981
|
ref_key: "select",
|
|
886
982
|
ref: o,
|
|
@@ -890,16 +986,233 @@ const Ye = /* @__PURE__ */ p(Xe, [["__scopeId", "data-v-d75cd96a"]]), et = (e) =
|
|
|
890
986
|
required: e.required,
|
|
891
987
|
disabled: e.disabled,
|
|
892
988
|
value: e.modelValue,
|
|
893
|
-
onInput:
|
|
989
|
+
onInput: c
|
|
894
990
|
}, [
|
|
895
|
-
|
|
896
|
-
], 40,
|
|
897
|
-
|
|
991
|
+
m(l.$slots, "default", {}, void 0, !0)
|
|
992
|
+
], 40, rt),
|
|
993
|
+
st
|
|
898
994
|
], 2)
|
|
899
995
|
], 512));
|
|
900
996
|
}
|
|
901
997
|
});
|
|
902
|
-
const
|
|
998
|
+
const yt = /* @__PURE__ */ j(ct, [["__scopeId", "data-v-f9015b7b"]]), mt = ["aria-disabled"], ft = ["id", "value", "checked", "disabled", "required", "name"], bt = /* @__PURE__ */ S({
|
|
999
|
+
__name: "JoySelectableItem",
|
|
1000
|
+
props: {
|
|
1001
|
+
disabled: {
|
|
1002
|
+
type: Boolean,
|
|
1003
|
+
default: !1
|
|
1004
|
+
},
|
|
1005
|
+
/** Mandatory in order to link the label and the actual input */
|
|
1006
|
+
id: {
|
|
1007
|
+
type: String,
|
|
1008
|
+
required: !0
|
|
1009
|
+
},
|
|
1010
|
+
invalid: {
|
|
1011
|
+
type: Boolean,
|
|
1012
|
+
default: !1
|
|
1013
|
+
},
|
|
1014
|
+
multiple: {
|
|
1015
|
+
type: Boolean,
|
|
1016
|
+
default: !1
|
|
1017
|
+
},
|
|
1018
|
+
name: {
|
|
1019
|
+
type: String
|
|
1020
|
+
},
|
|
1021
|
+
required: {
|
|
1022
|
+
type: Boolean,
|
|
1023
|
+
default: !1
|
|
1024
|
+
},
|
|
1025
|
+
checked: {
|
|
1026
|
+
type: Boolean
|
|
1027
|
+
},
|
|
1028
|
+
value: {
|
|
1029
|
+
type: String
|
|
1030
|
+
}
|
|
1031
|
+
},
|
|
1032
|
+
emits: ["update:checked"],
|
|
1033
|
+
setup(e, { emit: n }) {
|
|
1034
|
+
const a = e, t = _(a.checked), o = _(), s = a.multiple ? "div" : "label", c = {
|
|
1035
|
+
onRadioChange: () => {
|
|
1036
|
+
n("update:checked", a.value);
|
|
1037
|
+
},
|
|
1038
|
+
onClick: () => {
|
|
1039
|
+
a.checked && !a.multiple && n("update:checked", "");
|
|
1040
|
+
},
|
|
1041
|
+
onLabelClick: (u) => {
|
|
1042
|
+
a.multiple || u.stopPropagation();
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
function l(u) {
|
|
1046
|
+
n("update:checked", u);
|
|
1047
|
+
}
|
|
1048
|
+
return (u, g) => (i(), r("div", {
|
|
1049
|
+
class: "joy-selectable-item__wrapper",
|
|
1050
|
+
"aria-disabled": e.disabled,
|
|
1051
|
+
onClick: g[2] || (g[2] = //@ts-ignore
|
|
1052
|
+
(...p) => c.onClick && c.onClick(...p))
|
|
1053
|
+
}, [
|
|
1054
|
+
e.multiple ? f("", !0) : (i(), r("input", {
|
|
1055
|
+
key: 0,
|
|
1056
|
+
id: e.id,
|
|
1057
|
+
ref_key: "inputRadio",
|
|
1058
|
+
ref: o,
|
|
1059
|
+
type: "radio",
|
|
1060
|
+
value: e.value,
|
|
1061
|
+
checked: e.checked,
|
|
1062
|
+
disabled: e.disabled,
|
|
1063
|
+
required: e.required,
|
|
1064
|
+
name: e.name,
|
|
1065
|
+
onChange: g[0] || (g[0] = //@ts-ignore
|
|
1066
|
+
(...p) => c.onRadioChange && c.onRadioChange(...p))
|
|
1067
|
+
}, null, 40, ft)),
|
|
1068
|
+
(i(), V(z(b(s)), {
|
|
1069
|
+
for: e.id,
|
|
1070
|
+
class: v([
|
|
1071
|
+
"joy-selectable-item",
|
|
1072
|
+
{
|
|
1073
|
+
"joy-selectable-item--disabled": e.disabled,
|
|
1074
|
+
"joy-selectable-item--checked": e.checked,
|
|
1075
|
+
"joy-selectable-item--multiple": e.multiple,
|
|
1076
|
+
"joy-selectable-item--single": !e.multiple
|
|
1077
|
+
}
|
|
1078
|
+
]),
|
|
1079
|
+
onClick: c.onLabelClick
|
|
1080
|
+
}, {
|
|
1081
|
+
default: q(() => [
|
|
1082
|
+
e.multiple ? (i(), V(b(N), {
|
|
1083
|
+
key: 0,
|
|
1084
|
+
id: e.id,
|
|
1085
|
+
checked: t.value,
|
|
1086
|
+
"onUpdate:checked": [
|
|
1087
|
+
g[1] || (g[1] = (p) => t.value = p),
|
|
1088
|
+
l
|
|
1089
|
+
],
|
|
1090
|
+
disabled: e.disabled,
|
|
1091
|
+
value: e.value,
|
|
1092
|
+
name: e.name,
|
|
1093
|
+
required: e.required
|
|
1094
|
+
}, {
|
|
1095
|
+
default: q(() => [
|
|
1096
|
+
m(u.$slots, "default", {}, void 0, !0)
|
|
1097
|
+
]),
|
|
1098
|
+
_: 3
|
|
1099
|
+
}, 8, ["id", "checked", "disabled", "value", "name", "required"])) : f("", !0),
|
|
1100
|
+
e.multiple ? f("", !0) : m(u.$slots, "default", { key: 1 }, void 0, !0),
|
|
1101
|
+
d("div", {
|
|
1102
|
+
class: v([{ "joy-selectable-item__sublabel": u.$slots["selectable-item-sublabel"] }])
|
|
1103
|
+
}, [
|
|
1104
|
+
m(u.$slots, "selectable-item-sublabel", {}, void 0, !0)
|
|
1105
|
+
], 2)
|
|
1106
|
+
]),
|
|
1107
|
+
_: 3
|
|
1108
|
+
}, 8, ["for", "class", "onClick"]))
|
|
1109
|
+
], 8, mt));
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
const W = /* @__PURE__ */ j(bt, [["__scopeId", "data-v-6fdac15a"]]), vt = ["id"], gt = /* @__PURE__ */ S({
|
|
1113
|
+
__name: "JoySelectableItemGroup",
|
|
1114
|
+
props: {
|
|
1115
|
+
options: {
|
|
1116
|
+
type: Array,
|
|
1117
|
+
required: !0,
|
|
1118
|
+
validator(e) {
|
|
1119
|
+
const n = e.every((t) => Object.keys(t).includes("value")), a = e.every((t) => Object.keys(t).includes("label"));
|
|
1120
|
+
return n && a;
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
id: String,
|
|
1124
|
+
value: {
|
|
1125
|
+
type: [String, Array],
|
|
1126
|
+
default: null
|
|
1127
|
+
},
|
|
1128
|
+
multiple: {
|
|
1129
|
+
type: Boolean,
|
|
1130
|
+
default: !1
|
|
1131
|
+
},
|
|
1132
|
+
fullWidth: {
|
|
1133
|
+
type: Boolean,
|
|
1134
|
+
default: !1
|
|
1135
|
+
},
|
|
1136
|
+
required: {
|
|
1137
|
+
type: Boolean,
|
|
1138
|
+
default: !1
|
|
1139
|
+
},
|
|
1140
|
+
label: String,
|
|
1141
|
+
labelSize: {
|
|
1142
|
+
type: String,
|
|
1143
|
+
default: "medium"
|
|
1144
|
+
},
|
|
1145
|
+
optionalLabel: String,
|
|
1146
|
+
requiredMark: {
|
|
1147
|
+
type: Boolean,
|
|
1148
|
+
default: !1
|
|
1149
|
+
}
|
|
1150
|
+
},
|
|
1151
|
+
emits: ["update:value"],
|
|
1152
|
+
setup(e, { emit: n }) {
|
|
1153
|
+
const a = e;
|
|
1154
|
+
function t(s) {
|
|
1155
|
+
return typeof a.value == "string" ? a.value === s.value : (a.value || []).includes(s.value);
|
|
1156
|
+
}
|
|
1157
|
+
function o(s, c) {
|
|
1158
|
+
if (!a.multiple)
|
|
1159
|
+
return n("update:value", c);
|
|
1160
|
+
let l = [...a.value || []];
|
|
1161
|
+
c && typeof c == "boolean" ? l.push(s) : l.splice(l.indexOf(s), 1), n("update:value", l);
|
|
1162
|
+
}
|
|
1163
|
+
return (s, c) => (i(), r("fieldset", {
|
|
1164
|
+
id: e.id,
|
|
1165
|
+
class: "joy-selectable-item-group__wrapper"
|
|
1166
|
+
}, [
|
|
1167
|
+
e.label ? (i(), V(b(C), {
|
|
1168
|
+
key: 0,
|
|
1169
|
+
"tag-name": "legend",
|
|
1170
|
+
required: e.required && e.requiredMark,
|
|
1171
|
+
"optional-label": e.optionalLabel,
|
|
1172
|
+
size: e.labelSize
|
|
1173
|
+
}, {
|
|
1174
|
+
default: q(() => [
|
|
1175
|
+
B($(e.label), 1)
|
|
1176
|
+
]),
|
|
1177
|
+
_: 1
|
|
1178
|
+
}, 8, ["required", "optional-label", "size"])) : f("", !0),
|
|
1179
|
+
d("div", {
|
|
1180
|
+
class: v([
|
|
1181
|
+
"joy-selectable-item-group",
|
|
1182
|
+
{
|
|
1183
|
+
"joy-selectable-item-group--multiple": e.multiple,
|
|
1184
|
+
"joy-selectable-item-group--single": !e.multiple,
|
|
1185
|
+
"joy-selectable-item-group--full": e.fullWidth
|
|
1186
|
+
}
|
|
1187
|
+
])
|
|
1188
|
+
}, [
|
|
1189
|
+
(i(!0), r(F, null, A(e.options, (l) => (i(), V(b(W), {
|
|
1190
|
+
id: l.id,
|
|
1191
|
+
key: l.id,
|
|
1192
|
+
name: l.name,
|
|
1193
|
+
value: l.value,
|
|
1194
|
+
multiple: e.multiple,
|
|
1195
|
+
checked: t(l),
|
|
1196
|
+
"onUpdate:checked": (u) => o(l.value, u)
|
|
1197
|
+
}, K({
|
|
1198
|
+
default: q(() => [
|
|
1199
|
+
B($(l.label) + " ", 1)
|
|
1200
|
+
]),
|
|
1201
|
+
_: 2
|
|
1202
|
+
}, [
|
|
1203
|
+
l.subLabel ? {
|
|
1204
|
+
name: "selectable-item-sublabel",
|
|
1205
|
+
fn: q(() => [
|
|
1206
|
+
B($(l.subLabel), 1)
|
|
1207
|
+
]),
|
|
1208
|
+
key: "0"
|
|
1209
|
+
} : void 0
|
|
1210
|
+
]), 1032, ["id", "name", "value", "multiple", "checked", "onUpdate:checked"]))), 128))
|
|
1211
|
+
], 2)
|
|
1212
|
+
], 8, vt));
|
|
1213
|
+
}
|
|
1214
|
+
});
|
|
1215
|
+
const ht = /* @__PURE__ */ j(gt, [["__scopeId", "data-v-93c88f70"]]), pt = /* @__PURE__ */ S({
|
|
903
1216
|
__name: "JoyWrapper",
|
|
904
1217
|
props: {
|
|
905
1218
|
justify: {
|
|
@@ -920,74 +1233,64 @@ const nt = /* @__PURE__ */ p(lt, [["__scopeId", "data-v-f9015b7b"]]), ot = /* @_
|
|
|
920
1233
|
}
|
|
921
1234
|
},
|
|
922
1235
|
setup(e) {
|
|
923
|
-
return (
|
|
924
|
-
class:
|
|
1236
|
+
return (n, a) => (i(), r("div", {
|
|
1237
|
+
class: v(["joy-wrapper", `joy-wrapper--justify-${e.justify}`, `joy-wrapper--align-${e.align}`, `joy-wrapper--direction-${e.direction}`, `joy-wrapper--wrap-${e.wrap}`])
|
|
925
1238
|
}, [
|
|
926
|
-
|
|
1239
|
+
m(n.$slots, "default", {}, void 0, !0)
|
|
927
1240
|
], 2));
|
|
928
1241
|
}
|
|
929
1242
|
});
|
|
930
|
-
const
|
|
1243
|
+
const kt = /* @__PURE__ */ j(pt, [["__scopeId", "data-v-ce0e1214"]]), St = { class: "joy-template__heading" }, jt = { key: 0 }, _t = { class: "joy-template__heading___headings" }, $t = { key: 0 }, xt = { key: 1 }, It = { key: 0 }, qt = { key: 1 }, Bt = /* @__PURE__ */ S({
|
|
931
1244
|
__name: "JoyTemplate",
|
|
932
1245
|
props: {
|
|
933
1246
|
full: { type: Boolean, default: !1 },
|
|
934
1247
|
sidebar: { type: String, default: "right" }
|
|
935
1248
|
},
|
|
936
1249
|
setup(e) {
|
|
937
|
-
const
|
|
938
|
-
return (t,
|
|
939
|
-
class:
|
|
1250
|
+
const n = e, a = L();
|
|
1251
|
+
return (t, o) => (i(), r("main", {
|
|
1252
|
+
class: v(["joy-template", { "joy-template--full": n.full }])
|
|
940
1253
|
}, [
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
], 2),
|
|
953
|
-
n("div", {
|
|
954
|
-
class: y({ "joy-template-slot-subtitle": t.$slots["template-subtitle"] })
|
|
955
|
-
}, [
|
|
956
|
-
s(t.$slots, "template-subtitle", {}, void 0, !0)
|
|
957
|
-
], 2)
|
|
1254
|
+
d("div", St, [
|
|
1255
|
+
b(a)["template-back"] ? (i(), r("div", jt, [
|
|
1256
|
+
m(t.$slots, "template-back", {}, void 0, !0)
|
|
1257
|
+
])) : f("", !0),
|
|
1258
|
+
d("div", _t, [
|
|
1259
|
+
b(a)["template-title"] ? (i(), r("div", $t, [
|
|
1260
|
+
m(t.$slots, "template-title", {}, void 0, !0)
|
|
1261
|
+
])) : f("", !0),
|
|
1262
|
+
b(a)["template-subtitle"] ? (i(), r("div", xt, [
|
|
1263
|
+
m(t.$slots, "template-subtitle", {}, void 0, !0)
|
|
1264
|
+
])) : f("", !0)
|
|
958
1265
|
])
|
|
959
1266
|
]),
|
|
960
|
-
|
|
961
|
-
class:
|
|
1267
|
+
d("div", {
|
|
1268
|
+
class: v([
|
|
962
1269
|
"joy-template__content",
|
|
963
1270
|
{
|
|
964
|
-
"joy-template__content--reverse":
|
|
1271
|
+
"joy-template__content--reverse": n.sidebar === "left"
|
|
965
1272
|
}
|
|
966
1273
|
])
|
|
967
1274
|
}, [
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
class: y({ "joy-template-slot-sidebar": t.$slots["template-sidebar"] })
|
|
975
|
-
}, [
|
|
976
|
-
s(t.$slots, "template-sidebar", {}, void 0, !0)
|
|
977
|
-
], 2)
|
|
1275
|
+
t.$slots["template-main"] ? (i(), r("div", It, [
|
|
1276
|
+
m(t.$slots, "template-main", {}, void 0, !0)
|
|
1277
|
+
])) : f("", !0),
|
|
1278
|
+
t.$slots["template-sidebar"] ? (i(), r("div", qt, [
|
|
1279
|
+
m(t.$slots, "template-sidebar", {}, void 0, !0)
|
|
1280
|
+
])) : f("", !0)
|
|
978
1281
|
], 2)
|
|
979
1282
|
], 2));
|
|
980
1283
|
}
|
|
981
1284
|
});
|
|
982
|
-
const
|
|
1285
|
+
const Vt = /* @__PURE__ */ j(Bt, [["__scopeId", "data-v-ba1a4be0"]]), Jt = ["aria-disabled"], Ct = ["id", "disabled", "name", "required", "minlength", "value"], wt = {
|
|
983
1286
|
key: 0,
|
|
984
1287
|
class: "joy-textarea_helpers"
|
|
985
|
-
},
|
|
1288
|
+
}, Lt = {
|
|
986
1289
|
key: 0,
|
|
987
1290
|
name: "check",
|
|
988
1291
|
color: "grey",
|
|
989
1292
|
size: "xxsmall"
|
|
990
|
-
},
|
|
1293
|
+
}, zt = /* @__PURE__ */ S({
|
|
991
1294
|
__name: "JoyTextarea",
|
|
992
1295
|
props: {
|
|
993
1296
|
disabled: {
|
|
@@ -1038,56 +1341,56 @@ const st = /* @__PURE__ */ p(ut, [["__scopeId", "data-v-2333416c"]]), ct = ["ari
|
|
|
1038
1341
|
}
|
|
1039
1342
|
},
|
|
1040
1343
|
emits: ["update:modelValue"],
|
|
1041
|
-
setup(e, { expose:
|
|
1042
|
-
const
|
|
1043
|
-
function
|
|
1044
|
-
o.value &&
|
|
1344
|
+
setup(e, { expose: n, emit: a }) {
|
|
1345
|
+
const t = e, o = _(), s = _(), c = _(!1), l = J(() => t.maxlength ? t.modelValue.length > t.maxlength : !1), u = J(() => t.minlength ? t.modelValue.length < t.minlength : !1);
|
|
1346
|
+
function g() {
|
|
1347
|
+
o.value && t.autogrow && (o.value.style.height = "auto", o.value.style.height = o.value.scrollHeight + "px", s.value && (s.value.style.height = o.value.scrollHeight + "px"));
|
|
1045
1348
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1349
|
+
E(() => {
|
|
1350
|
+
g();
|
|
1048
1351
|
});
|
|
1049
|
-
const
|
|
1050
|
-
onInput: (
|
|
1051
|
-
|
|
1352
|
+
const p = {
|
|
1353
|
+
onInput: (I) => {
|
|
1354
|
+
a("update:modelValue", I.target.value), g();
|
|
1052
1355
|
},
|
|
1053
1356
|
onBlur: () => {
|
|
1054
|
-
|
|
1357
|
+
c.value = l.value || u.value;
|
|
1055
1358
|
}
|
|
1056
1359
|
};
|
|
1057
|
-
return
|
|
1058
|
-
isInvalid:
|
|
1059
|
-
valueOverMaxlength:
|
|
1060
|
-
valueUnderMinlength:
|
|
1061
|
-
}), (
|
|
1360
|
+
return n({
|
|
1361
|
+
isInvalid: c,
|
|
1362
|
+
valueOverMaxlength: l,
|
|
1363
|
+
valueUnderMinlength: u
|
|
1364
|
+
}), (I, k) => (i(), r("div", {
|
|
1062
1365
|
"aria-disabled": e.disabled,
|
|
1063
|
-
class:
|
|
1366
|
+
class: v([
|
|
1064
1367
|
"joy-textarea",
|
|
1065
1368
|
{
|
|
1066
|
-
"joy-textarea_invalid":
|
|
1369
|
+
"joy-textarea_invalid": c.value || e.invalid,
|
|
1067
1370
|
"joy-textarea_disabled": e.disabled,
|
|
1068
1371
|
"joy-textarea_autogrow": e.autogrow
|
|
1069
1372
|
}
|
|
1070
1373
|
])
|
|
1071
1374
|
}, [
|
|
1072
|
-
R(
|
|
1375
|
+
R(b(C), {
|
|
1073
1376
|
for: e.id,
|
|
1074
1377
|
required: e.required && e.requiredMark,
|
|
1075
1378
|
"optional-label": e.optionalLabel,
|
|
1076
1379
|
size: e.labelSize
|
|
1077
1380
|
}, {
|
|
1078
1381
|
default: q(() => [
|
|
1079
|
-
|
|
1080
|
-
B(
|
|
1382
|
+
m(I.$slots, "default", {}, () => [
|
|
1383
|
+
B($(e.label), 1)
|
|
1081
1384
|
], !0)
|
|
1082
1385
|
]),
|
|
1083
1386
|
_: 3
|
|
1084
1387
|
}, 8, ["for", "required", "optional-label", "size"]),
|
|
1085
|
-
|
|
1388
|
+
d("div", {
|
|
1086
1389
|
ref_key: "textareaWrapper",
|
|
1087
|
-
ref:
|
|
1390
|
+
ref: s,
|
|
1088
1391
|
class: "joy-textarea_wrapper"
|
|
1089
1392
|
}, [
|
|
1090
|
-
|
|
1393
|
+
d("textarea", w(I.$attrs, {
|
|
1091
1394
|
id: e.id,
|
|
1092
1395
|
ref_key: "textarea",
|
|
1093
1396
|
ref: o,
|
|
@@ -1097,29 +1400,29 @@ const st = /* @__PURE__ */ p(ut, [["__scopeId", "data-v-2333416c"]]), ct = ["ari
|
|
|
1097
1400
|
required: e.required,
|
|
1098
1401
|
minlength: e.minlength,
|
|
1099
1402
|
value: e.modelValue,
|
|
1100
|
-
onInput:
|
|
1101
|
-
(...
|
|
1102
|
-
onBlur:
|
|
1103
|
-
(...
|
|
1104
|
-
}), null, 16,
|
|
1403
|
+
onInput: k[0] || (k[0] = //@ts-ignore
|
|
1404
|
+
(...y) => p.onInput && p.onInput(...y)),
|
|
1405
|
+
onBlur: k[1] || (k[1] = //@ts-ignore
|
|
1406
|
+
(...y) => p.onBlur && p.onBlur(...y))
|
|
1407
|
+
}), null, 16, Ct)
|
|
1105
1408
|
], 512),
|
|
1106
|
-
e.minlength || e.maxlength ? (i(),
|
|
1107
|
-
e.minlength ? (i(),
|
|
1409
|
+
e.minlength || e.maxlength ? (i(), r("div", wt, [
|
|
1410
|
+
e.minlength ? (i(), r("p", {
|
|
1108
1411
|
key: 0,
|
|
1109
|
-
class:
|
|
1412
|
+
class: v(["joy-textarea-min", { "joy-textarea-min-invalid": e.invalid }])
|
|
1110
1413
|
}, [
|
|
1111
|
-
|
|
1112
|
-
B(" " +
|
|
1113
|
-
], 2)) :
|
|
1114
|
-
e.maxlength ? (i(),
|
|
1414
|
+
b(u) ? f("", !0) : (i(), r("joy-icon", Lt)),
|
|
1415
|
+
B(" " + $(e.minlengthLabel || `Minimum ${e.minlength} characters`), 1)
|
|
1416
|
+
], 2)) : f("", !0),
|
|
1417
|
+
e.maxlength ? (i(), r("p", {
|
|
1115
1418
|
key: 1,
|
|
1116
|
-
class:
|
|
1117
|
-
},
|
|
1118
|
-
])) :
|
|
1119
|
-
], 10,
|
|
1419
|
+
class: v(["joy-textarea-count", { "joy-textarea-count-invalid": b(l) }])
|
|
1420
|
+
}, $(e.modelValue.length + "/" + e.maxlength), 3)) : f("", !0)
|
|
1421
|
+
])) : f("", !0)
|
|
1422
|
+
], 10, Jt));
|
|
1120
1423
|
}
|
|
1121
1424
|
});
|
|
1122
|
-
const
|
|
1425
|
+
const Mt = /* @__PURE__ */ j(zt, [["__scopeId", "data-v-d68ef0dd"]]), Tt = ["name", "disabled", "checked", "required", "aria-checked", "value"], Et = { class: "joy-toggle__content" }, Nt = /* @__PURE__ */ S({
|
|
1123
1426
|
__name: "JoyToggle",
|
|
1124
1427
|
props: {
|
|
1125
1428
|
modelValue: {
|
|
@@ -1152,16 +1455,16 @@ const gt = /* @__PURE__ */ p(vt, [["__scopeId", "data-v-d68ef0dd"]]), bt = ["nam
|
|
|
1152
1455
|
label: String
|
|
1153
1456
|
},
|
|
1154
1457
|
emits: ["update:modelValue"],
|
|
1155
|
-
setup(e, { emit:
|
|
1156
|
-
const
|
|
1157
|
-
onChange: (
|
|
1158
|
-
const o =
|
|
1159
|
-
|
|
1458
|
+
setup(e, { emit: n }) {
|
|
1459
|
+
const a = {
|
|
1460
|
+
onChange: (t) => {
|
|
1461
|
+
const o = t.target.checked;
|
|
1462
|
+
n("update:modelValue", o);
|
|
1160
1463
|
}
|
|
1161
1464
|
};
|
|
1162
|
-
return (
|
|
1163
|
-
|
|
1164
|
-
class:
|
|
1465
|
+
return (t, o) => (i(), r("div", null, [
|
|
1466
|
+
d("label", {
|
|
1467
|
+
class: v([
|
|
1165
1468
|
"joy-toggle",
|
|
1166
1469
|
{
|
|
1167
1470
|
"joy-toggle__checked": e.modelValue,
|
|
@@ -1169,7 +1472,7 @@ const gt = /* @__PURE__ */ p(vt, [["__scopeId", "data-v-d68ef0dd"]]), bt = ["nam
|
|
|
1169
1472
|
}
|
|
1170
1473
|
])
|
|
1171
1474
|
}, [
|
|
1172
|
-
|
|
1475
|
+
d("input", {
|
|
1173
1476
|
ref: "input",
|
|
1174
1477
|
type: "checkbox",
|
|
1175
1478
|
class: "joy-toggle__input",
|
|
@@ -1181,58 +1484,64 @@ const gt = /* @__PURE__ */ p(vt, [["__scopeId", "data-v-d68ef0dd"]]), bt = ["nam
|
|
|
1181
1484
|
"aria-checked": e.modelValue,
|
|
1182
1485
|
value: e.value,
|
|
1183
1486
|
onChange: o[0] || (o[0] = //@ts-ignore
|
|
1184
|
-
(...
|
|
1185
|
-
}, null, 40,
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
B(
|
|
1487
|
+
(...s) => a.onChange && a.onChange(...s))
|
|
1488
|
+
}, null, 40, Tt),
|
|
1489
|
+
d("p", Et, [
|
|
1490
|
+
m(t.$slots, "default", {}, () => [
|
|
1491
|
+
B($(e.label), 1)
|
|
1189
1492
|
], !0)
|
|
1190
1493
|
])
|
|
1191
1494
|
], 2)
|
|
1192
1495
|
]));
|
|
1193
1496
|
}
|
|
1194
1497
|
});
|
|
1195
|
-
const
|
|
1498
|
+
const Ot = /* @__PURE__ */ j(Nt, [["__scopeId", "data-v-e31a6b5e"]]), Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1196
1499
|
__proto__: null,
|
|
1197
|
-
JoyButton:
|
|
1198
|
-
JoyCheckbox:
|
|
1199
|
-
JoyCounter:
|
|
1200
|
-
JoyFormError:
|
|
1201
|
-
JoyHighlight:
|
|
1202
|
-
JoyInput:
|
|
1500
|
+
JoyButton: de,
|
|
1501
|
+
JoyCheckbox: N,
|
|
1502
|
+
JoyCounter: $e,
|
|
1503
|
+
JoyFormError: U,
|
|
1504
|
+
JoyHighlight: ze,
|
|
1505
|
+
JoyInput: He,
|
|
1203
1506
|
JoyLabel: C,
|
|
1204
|
-
JoyLink:
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1507
|
+
JoyLink: De,
|
|
1508
|
+
JoyMultiCheckbox: Xe,
|
|
1509
|
+
JoyRadio: nt,
|
|
1510
|
+
JoyRadioGroup: dt,
|
|
1511
|
+
JoySelect: yt,
|
|
1512
|
+
JoySelectableItem: W,
|
|
1513
|
+
JoySelectableItemGroup: ht,
|
|
1514
|
+
JoySpinner: H,
|
|
1515
|
+
JoyTemplate: Vt,
|
|
1516
|
+
JoyTextarea: Mt,
|
|
1517
|
+
JoyToggle: Ot,
|
|
1518
|
+
JoyWrapper: kt
|
|
1519
|
+
}, Symbol.toStringTag, { value: "Module" })), At = {
|
|
1214
1520
|
install: (e) => {
|
|
1215
|
-
Object.entries(
|
|
1216
|
-
e.component(
|
|
1521
|
+
Object.entries(Rt).forEach(([n, a]) => {
|
|
1522
|
+
e.component(n, a);
|
|
1217
1523
|
});
|
|
1218
1524
|
}
|
|
1219
1525
|
};
|
|
1220
1526
|
export {
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1527
|
+
de as JoyButton,
|
|
1528
|
+
N as JoyCheckbox,
|
|
1529
|
+
$e as JoyCounter,
|
|
1530
|
+
U as JoyFormError,
|
|
1531
|
+
ze as JoyHighlight,
|
|
1532
|
+
He as JoyInput,
|
|
1227
1533
|
C as JoyLabel,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1534
|
+
De as JoyLink,
|
|
1535
|
+
Xe as JoyMultiCheckbox,
|
|
1536
|
+
nt as JoyRadio,
|
|
1537
|
+
dt as JoyRadioGroup,
|
|
1538
|
+
yt as JoySelect,
|
|
1539
|
+
W as JoySelectableItem,
|
|
1540
|
+
ht as JoySelectableItemGroup,
|
|
1541
|
+
H as JoySpinner,
|
|
1542
|
+
Vt as JoyTemplate,
|
|
1543
|
+
Mt as JoyTextarea,
|
|
1544
|
+
Ot as JoyToggle,
|
|
1545
|
+
At as JoyVuePlugin,
|
|
1546
|
+
kt as JoyWrapper
|
|
1238
1547
|
};
|