@maltjoy/core-vue 1.0.0-alpha.4 → 1.0.0-alpha.6

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/joy-vue.js CHANGED
@@ -1,26 +1,26 @@
1
- import { defineComponent as y, openBlock as s, createElementBlock as u, normalizeClass as d, useAttrs as z, computed as J, createBlock as w, resolveDynamicComponent as T, unref as f, withCtx as V, createCommentVNode as j, createElementVNode as n, renderSlot as r, ref as h, createTextVNode as R, toDisplayString as L, pushScopeId as O, popScopeId as N, mergeProps as C, useSlots as E, onBeforeMount as M, onMounted as A, watch as D } from "vue";
2
- const G = ["teal", "white"], W = /* @__PURE__ */ y({
1
+ import { defineComponent as h, openBlock as i, createElementBlock as u, normalizeClass as y, useAttrs as N, computed as I, createBlock as J, resolveDynamicComponent as M, unref as g, withCtx as q, createCommentVNode as b, createElementVNode as n, renderSlot as s, ref as S, createTextVNode as B, toDisplayString as V, mergeProps as w, createVNode as R, pushScopeId as L, popScopeId as z, useSlots as E, onBeforeMount as A, onMounted as T, watch as G } from "vue";
2
+ const D = ["teal", "white"], P = /* @__PURE__ */ h({
3
3
  __name: "JoySpinner",
4
4
  props: {
5
5
  color: {
6
6
  type: String,
7
7
  validator(e) {
8
- return G.includes(e);
8
+ return D.includes(e);
9
9
  }
10
10
  }
11
11
  },
12
12
  setup(e) {
13
- return (a, t) => (s(), u("div", {
14
- class: d(["joy-spinner", `joy-spinner_${e.color}`])
13
+ return (l, t) => (i(), u("div", {
14
+ class: y(["joy-spinner", `joy-spinner_${e.color}`])
15
15
  }, null, 2));
16
16
  }
17
17
  });
18
- const _ = (e, a) => {
18
+ const p = (e, l) => {
19
19
  const t = e.__vccOpts || e;
20
- for (const [l, i] of a)
21
- t[l] = i;
20
+ for (const [a, o] of l)
21
+ t[a] = o;
22
22
  return t;
23
- }, P = /* @__PURE__ */ _(W, [["__scopeId", "data-v-b633f633"]]), Z = ["primary", "secondary"], U = ["xlarge", "large", "medium", "small", "xsmall", "xxsmall"], K = ["neutral", "success", "info", "warning", "error"], X = ["main", "admin", "white", "ghost"], Q = [...Z, ...X], Y = [...U], x = ["xxsmall", "xsmall", "small"], ee = ["name", "size"], te = { class: "joy-button--slot" }, oe = /* @__PURE__ */ y({
23
+ }, F = /* @__PURE__ */ p(P, [["__scopeId", "data-v-b633f633"]]), W = ["primary", "secondary"], U = ["neutral", "success", "info", "warning", "error"], Z = ["main", "admin", "ghost"], K = [...W, ...Z], Q = ["large", "medium", "small", "xsmall", "xxsmall"], X = ["xxsmall", "xsmall", "small"], Y = ["name", "size"], ee = { class: "joy-button--slot" }, te = /* @__PURE__ */ h({
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 Q.includes(e);
46
+ return K.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 Y.includes(e);
54
+ return Q.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 x.includes(e);
62
+ return X.includes(e);
63
63
  }
64
64
  }
65
65
  },
66
66
  setup(e) {
67
- const a = e, t = z(), l = J(() => ["white", "ghost", "secondary"].includes(a.variant) ? "teal" : "white");
68
- return (i, c) => (s(), w(T(f(t).href ? "a" : "button"), {
69
- disabled: e.loading || f(t).disabled,
70
- class: d([
67
+ const l = e, t = N(), a = I(() => ["white", "ghost", "secondary"].includes(l.variant) ? "teal" : "white");
68
+ return (o, m) => (i(), J(M(g(t).href ? "a" : "button"), {
69
+ disabled: e.loading || g(t).disabled,
70
+ class: y([
71
71
  "joy-button",
72
72
  `joy-button_${e.variant}`,
73
73
  `joy-button_${e.size}`,
@@ -77,61 +77,26 @@ const _ = (e, a) => {
77
77
  }
78
78
  ])
79
79
  }, {
80
- default: V(() => [
81
- e.icon ? (s(), u("joy-icon", {
80
+ default: q(() => [
81
+ e.icon ? (i(), u("joy-icon", {
82
82
  key: 0,
83
83
  name: e.icon,
84
84
  size: e.iconSize,
85
85
  lazy: !1
86
- }, null, 8, ee)) : j("", !0),
87
- e.loading ? (s(), w(P, {
86
+ }, null, 8, Y)) : b("", !0),
87
+ e.loading ? (i(), J(F, {
88
88
  key: 1,
89
- color: f(l)
90
- }, null, 8, ["color"])) : j("", !0),
91
- n("span", te, [
92
- r(i.$slots, "default", {}, void 0, !0)
89
+ color: g(a)
90
+ }, null, 8, ["color"])) : b("", !0),
91
+ n("span", ee, [
92
+ s(o.$slots, "default", {}, void 0, !0)
93
93
  ])
94
94
  ]),
95
95
  _: 3
96
96
  }, 8, ["disabled", "class"]));
97
97
  }
98
98
  });
99
- const ae = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-08c3c0a6"]]), B = {
100
- disabled: {
101
- type: Boolean,
102
- default: !1
103
- },
104
- id: {
105
- type: String
106
- },
107
- invalid: {
108
- type: Boolean,
109
- default: !1
110
- },
111
- name: {
112
- type: String
113
- },
114
- required: {
115
- type: Boolean,
116
- default: !1
117
- }
118
- }, F = {
119
- modelValue: {
120
- type: Boolean,
121
- default: !1
122
- },
123
- value: {
124
- type: String,
125
- default: "on"
126
- },
127
- ...B
128
- }, H = {
129
- label: String,
130
- labelSize: {
131
- type: String,
132
- default: "medium"
133
- }
134
- }, le = ["aria-checked", "aria-hidden"], ne = ["name", "disabled", "checked", "required", "aria-checked", "value", "indeterminate"], ie = { class: "joy-checkbox__content-wrapper" }, se = { class: "joy-checkbox__content" }, re = /* @__PURE__ */ y({
99
+ const ae = /* @__PURE__ */ p(te, [["__scopeId", "data-v-958cc680"]]), le = ["aria-checked", "aria-hidden"], ne = ["name", "disabled", "checked", "required", "aria-checked", "value", "indeterminate"], oe = { class: "joy-checkbox__content-wrapper" }, ie = { class: "joy-checkbox__content" }, de = /* @__PURE__ */ h({
135
100
  __name: "JoyCheckbox",
136
101
  props: {
137
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 */
@@ -139,61 +104,257 @@ const ae = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-08c3c0a6"]]), B = {
139
104
  type: Boolean,
140
105
  default: !1
141
106
  },
142
- ...F
107
+ label: {
108
+ type: String
109
+ },
110
+ modelValue: {
111
+ type: Boolean,
112
+ default: !1
113
+ },
114
+ value: {
115
+ type: String,
116
+ default: "on"
117
+ },
118
+ disabled: {
119
+ type: Boolean,
120
+ default: !1
121
+ },
122
+ id: {
123
+ type: String
124
+ },
125
+ invalid: {
126
+ type: Boolean,
127
+ default: !1
128
+ },
129
+ name: {
130
+ type: String
131
+ },
132
+ required: {
133
+ type: Boolean,
134
+ default: !1
135
+ }
136
+ // ...CHECKBOX_BASED_PROPS,
143
137
  },
144
138
  emits: ["update:modelValue"],
145
- setup(e, { expose: a, emit: t }) {
146
- const l = e, i = h(), c = h(l.indeterminate), S = {
147
- onChange: (o) => {
148
- const p = o.target.checked;
149
- c.value = !1, t("update:modelValue", p);
139
+ setup(e, { expose: l, emit: t }) {
140
+ const a = e, o = S(), m = S(a.indeterminate), _ = {
141
+ onChange: (r) => {
142
+ const c = r.target.checked;
143
+ m.value = !1, t("update:modelValue", c);
150
144
  }
151
145
  };
152
- return a({
153
- isIndeterminate: c
154
- }), (o, p) => (s(), u("div", {
155
- "aria-checked": o.modelValue,
156
- "aria-hidden": o.disabled
146
+ return l({
147
+ isIndeterminate: m
148
+ }), (r, c) => (i(), u("div", {
149
+ "aria-checked": e.modelValue,
150
+ "aria-hidden": e.disabled
157
151
  }, [
158
152
  n("label", {
159
- class: d([
153
+ class: y([
160
154
  "joy-checkbox",
161
155
  {
162
- "joy-checkbox__checked": o.modelValue,
163
- "joy-checkbox__indeterminate": c.value
156
+ "joy-checkbox__checked": e.modelValue,
157
+ "joy-checkbox__indeterminate": m.value
164
158
  }
165
159
  ])
166
160
  }, [
167
161
  n("input", {
168
162
  ref_key: "input",
169
- ref: i,
163
+ ref: o,
170
164
  type: "checkbox",
171
165
  class: "joy-checkbox__input",
172
166
  role: "checkbox",
173
- name: o.name,
174
- disabled: o.disabled,
175
- checked: o.modelValue,
176
- required: o.required,
177
- "aria-checked": o.modelValue,
178
- value: o.value,
179
- indeterminate: c.value,
180
- onChange: p[0] || (p[0] = //@ts-ignore
181
- (...b) => S.onChange && S.onChange(...b))
167
+ name: e.name,
168
+ disabled: e.disabled,
169
+ checked: e.modelValue,
170
+ required: e.required,
171
+ "aria-checked": e.modelValue,
172
+ value: e.value,
173
+ indeterminate: m.value,
174
+ onChange: c[0] || (c[0] = //@ts-ignore
175
+ (...j) => _.onChange && _.onChange(...j))
182
176
  }, null, 40, ne),
183
- n("div", ie, [
184
- r(o.$slots, "default", {}, void 0, !0),
185
- n("div", se, [
186
- r(o.$slots, "checkbox-content", {}, void 0, !0)
177
+ n("div", oe, [
178
+ s(r.$slots, "default", {}, () => [
179
+ B(V(e.label), 1)
180
+ ], !0),
181
+ n("div", ie, [
182
+ s(r.$slots, "checkbox-content", {}, void 0, !0)
187
183
  ])
188
184
  ])
189
185
  ], 2)
190
186
  ], 8, le));
191
187
  }
192
188
  });
193
- const de = /* @__PURE__ */ _(re, [["__scopeId", "data-v-61d9cccf"]]), ue = (e) => (O("data-v-eba58103"), e = e(), N(), e), ce = ["aria-hidden"], pe = /* @__PURE__ */ ue(() => /* @__PURE__ */ n("joy-icon", {
189
+ const re = /* @__PURE__ */ p(de, [["__scopeId", "data-v-cd187cef"]]), H = (e) => (L("data-v-366cb712"), e = e(), z(), e), ue = { class: "joy-counter" }, se = { class: "joy-counter__wrapper" }, ce = ["aria-label", "disabled"], ye = /* @__PURE__ */ H(() => /* @__PURE__ */ n("joy-icon", {
190
+ name: "minus",
191
+ color: "teal",
192
+ lazy: !1
193
+ }, null, -1)), me = [
194
+ ye
195
+ ], fe = ["id", "min", "max", "aria-invalid", "name", "required", "value"], ve = ["aria-label", "disabled"], ge = /* @__PURE__ */ H(() => /* @__PURE__ */ n("joy-icon", {
196
+ name: "add",
197
+ lazy: !1,
198
+ color: "teal"
199
+ }, null, -1)), be = [
200
+ ge
201
+ ], he = {
202
+ key: 0,
203
+ class: "joy-counter_error"
204
+ }, pe = /* @__PURE__ */ h({
205
+ __name: "JoyCounter",
206
+ props: {
207
+ // ...FORM_BASED_PROPS,
208
+ disabled: {
209
+ type: Boolean,
210
+ default: !1
211
+ },
212
+ id: {
213
+ type: String
214
+ },
215
+ invalid: {
216
+ type: Boolean,
217
+ default: !1
218
+ },
219
+ name: {
220
+ type: String
221
+ },
222
+ required: {
223
+ type: Boolean,
224
+ default: !1
225
+ },
226
+ label: String,
227
+ labelSize: {
228
+ type: String,
229
+ default: "medium"
230
+ },
231
+ optionalLabel: String,
232
+ requiredMark: {
233
+ type: Boolean,
234
+ default: !1
235
+ },
236
+ // ...LABEL_BASED_PROPS,
237
+ labelDecrement: {
238
+ type: String
239
+ },
240
+ labelIncrement: {
241
+ type: String
242
+ },
243
+ max: {
244
+ type: Number
245
+ },
246
+ min: {
247
+ type: Number,
248
+ default: 0
249
+ },
250
+ modelValue: {
251
+ type: Number,
252
+ default: 0
253
+ },
254
+ step: {
255
+ type: Number,
256
+ default: 1
257
+ },
258
+ componentErrorMessage: {
259
+ type: String
260
+ }
261
+ },
262
+ emits: ["update:modelValue"],
263
+ setup(e, { expose: l, emit: t }) {
264
+ const a = e, o = S(!1);
265
+ function m() {
266
+ const d = c(!1);
267
+ d >= 0 ? t("update:modelValue", d <= a.min ? a.min : d) : t("update:modelValue", 0), r();
268
+ }
269
+ function _() {
270
+ const d = c();
271
+ a.max && d <= a.max ? t("update:modelValue", d >= a.max ? a.max : d) : a.max && d > a.max ? t("update:modelValue", a.max) : t("update:modelValue", d), r();
272
+ }
273
+ function r() {
274
+ o.value = !j();
275
+ }
276
+ function c(d = !0) {
277
+ const f = a.step.toString().split("."), $ = f.length === 2 ? f[1].length : 0;
278
+ return parseFloat(d ? (a.modelValue + a.step).toFixed($) : (a.modelValue - a.step).toFixed($));
279
+ }
280
+ function j() {
281
+ return x() && k();
282
+ }
283
+ function x() {
284
+ return !a.max || a.modelValue <= a.max;
285
+ }
286
+ function k() {
287
+ return a.min <= a.modelValue;
288
+ }
289
+ const v = {
290
+ onInput: (d) => {
291
+ t("update:modelValue", +d.target.value || 0), o.value = !1;
292
+ },
293
+ onBlur: () => {
294
+ r();
295
+ }
296
+ };
297
+ return l({
298
+ props: a
299
+ }), (d, f) => (i(), u("div", ue, [
300
+ e.label ? (i(), J(g(C), {
301
+ key: 0,
302
+ for: e.id,
303
+ required: e.required && e.requiredMark,
304
+ "optional-label": e.optionalLabel,
305
+ size: e.labelSize
306
+ }, {
307
+ default: q(() => [
308
+ s(d.$slots, "default", {}, () => [
309
+ B(V(e.label), 1)
310
+ ], !0)
311
+ ]),
312
+ _: 3
313
+ }, 8, ["for", "required", "optional-label", "size"])) : b("", !0),
314
+ n("div", se, [
315
+ n("button", {
316
+ class: "joy-counter__decrement",
317
+ type: "button",
318
+ "aria-label": e.labelDecrement,
319
+ disabled: e.modelValue <= e.min,
320
+ onClick: m
321
+ }, me, 8, ce),
322
+ n("input", w({
323
+ id: e.id,
324
+ ref: "input",
325
+ type: "number",
326
+ class: { "joy-counter__invalid": e.invalid || o.value },
327
+ min: e.min,
328
+ max: e.max,
329
+ "aria-invalid": e.invalid || o.value,
330
+ name: e.name,
331
+ required: e.required,
332
+ step: "any",
333
+ value: e.modelValue
334
+ }, d.$attrs, {
335
+ onInput: f[0] || (f[0] = //@ts-ignore
336
+ (...$) => v.onInput && v.onInput(...$)),
337
+ onBlur: f[1] || (f[1] = //@ts-ignore
338
+ (...$) => v.onBlur && v.onBlur(...$))
339
+ }), null, 16, fe),
340
+ n("button", {
341
+ class: "joy-counter__increment",
342
+ type: "button",
343
+ "aria-label": e.labelIncrement,
344
+ disabled: e.max ? e.modelValue >= e.max : !1,
345
+ onClick: _
346
+ }, be, 8, ve),
347
+ e.invalid && e.componentErrorMessage ? (i(), u("div", he, [
348
+ R(g(O), { "no-html-error-text": e.componentErrorMessage }, null, 8, ["no-html-error-text"])
349
+ ])) : b("", !0)
350
+ ])
351
+ ]));
352
+ }
353
+ });
354
+ const _e = /* @__PURE__ */ p(pe, [["__scopeId", "data-v-366cb712"]]), je = (e) => (L("data-v-eba58103"), e = e(), z(), e), Se = ["aria-hidden"], $e = /* @__PURE__ */ je(() => /* @__PURE__ */ n("joy-icon", {
194
355
  "custom-class": "joy-icon-error",
195
356
  name: "warning-triangle"
196
- }, null, -1)), ye = /* @__PURE__ */ y({
357
+ }, null, -1)), xe = /* @__PURE__ */ h({
197
358
  __name: "JoyFormError",
198
359
  props: {
199
360
  visible: {
@@ -203,36 +364,36 @@ const de = /* @__PURE__ */ _(re, [["__scopeId", "data-v-61d9cccf"]]), ue = (e) =
203
364
  noHtmlErrorText: String
204
365
  },
205
366
  setup(e) {
206
- return (a, t) => (s(), u("div", {
367
+ return (l, t) => (i(), u("div", {
207
368
  "aria-hidden": e.visible,
208
- class: d(["joy-form-error", { "joy-has-error": e.visible }]),
369
+ class: y(["joy-form-error", { "joy-has-error": e.visible }]),
209
370
  role: "alert"
210
371
  }, [
211
- pe,
372
+ $e,
212
373
  n("div", null, [
213
- r(a.$slots, "default", {}, () => [
214
- R(L(e.noHtmlErrorText), 1)
374
+ s(l.$slots, "default", {}, () => [
375
+ B(V(e.noHtmlErrorText), 1)
215
376
  ], !0)
216
377
  ])
217
- ], 10, ce));
378
+ ], 10, Se));
218
379
  }
219
380
  });
220
- const _e = /* @__PURE__ */ _(ye, [["__scopeId", "data-v-eba58103"]]);
221
- function me(e) {
222
- let a;
381
+ const O = /* @__PURE__ */ p(xe, [["__scopeId", "data-v-eba58103"]]);
382
+ function ke(e) {
383
+ let l;
223
384
  switch (e) {
224
385
  case "error":
225
- a = "warning-triangle";
386
+ l = "warning-triangle";
226
387
  break;
227
388
  case "success":
228
- a = "check";
389
+ l = "check";
229
390
  break;
230
391
  default:
231
- a = "info-circle";
392
+ l = "info-circle";
232
393
  }
233
- return a;
394
+ return l;
234
395
  }
235
- const ve = [...K], fe = ["name"], ge = { class: "joy-highlight--text" }, he = /* @__PURE__ */ y({
396
+ const Ve = [...U], Ie = ["name"], Be = { class: "joy-highlight--text" }, Je = /* @__PURE__ */ h({
236
397
  __name: "JoyHighlight",
237
398
  props: {
238
399
  accent: {
@@ -248,51 +409,51 @@ const ve = [...K], fe = ["name"], ge = { class: "joy-highlight--text" }, he = /*
248
409
  type: String,
249
410
  default: "neutral",
250
411
  validator(e) {
251
- return ve.includes(e);
412
+ return Ve.includes(e);
252
413
  }
253
414
  }
254
415
  },
255
- setup(e, { expose: a }) {
256
- const t = e, l = J(() => t.icon ? t.icon : me(t.level));
257
- return a({
258
- getRelevantIcon: l
259
- }), (i, c) => (s(), u("div", {
260
- class: d([
416
+ setup(e, { expose: l }) {
417
+ const t = e, a = I(() => t.icon ? t.icon : ke(t.level));
418
+ return l({
419
+ getRelevantIcon: a
420
+ }), (o, m) => (i(), u("div", {
421
+ class: y([
261
422
  "joy-highlight",
262
423
  `joy-highlight_${e.level}`,
263
424
  {
264
425
  "joy-highlight__accent": e.accent,
265
- "joy-highlight__titled": i.$slots["highlight-title"]
426
+ "joy-highlight__titled": o.$slots["highlight-title"]
266
427
  }
267
428
  ])
268
429
  }, [
269
- e.displayIcon ? (s(), u("joy-icon", {
430
+ e.displayIcon ? (i(), u("joy-icon", {
270
431
  key: 0,
271
- name: f(l)
272
- }, null, 8, fe)) : j("", !0),
273
- n("div", ge, [
432
+ name: g(a)
433
+ }, null, 8, Ie)) : b("", !0),
434
+ n("div", Be, [
274
435
  n("strong", null, [
275
- r(i.$slots, "highlight-title", {}, void 0, !0)
436
+ s(o.$slots, "highlight-title", {}, void 0, !0)
276
437
  ]),
277
- r(i.$slots, "default", {}, void 0, !0)
438
+ s(o.$slots, "default", {}, void 0, !0)
278
439
  ])
279
440
  ], 2));
280
441
  }
281
442
  });
282
- const be = /* @__PURE__ */ _(he, [["__scopeId", "data-v-15d3fa11"]]), je = ["small", "medium", "large"], Se = {
443
+ const qe = /* @__PURE__ */ p(Je, [["__scopeId", "data-v-15d3fa11"]]), we = ["small", "medium", "large"], Ce = {
283
444
  key: 0,
284
445
  class: "joy-label-required"
285
- }, $e = {
446
+ }, Le = {
286
447
  key: 1,
287
448
  class: "joy-label-optional"
288
- }, ke = /* @__PURE__ */ y({
449
+ }, ze = /* @__PURE__ */ h({
289
450
  __name: "JoyLabel",
290
451
  props: {
291
452
  size: {
292
453
  type: String,
293
454
  default: "medium",
294
455
  validator(e) {
295
- return je.includes(e);
456
+ return we.includes(e);
296
457
  }
297
458
  },
298
459
  tagName: {
@@ -308,145 +469,175 @@ const be = /* @__PURE__ */ _(he, [["__scopeId", "data-v-15d3fa11"]]), je = ["sma
308
469
  }
309
470
  },
310
471
  setup(e) {
311
- return (a, t) => (s(), w(T(e.tagName), C({
472
+ return (l, t) => (i(), J(M(e.tagName), w({
312
473
  class: ["joy-label", `joy-label--${e.size}`]
313
- }, a.$attrs), {
314
- default: V(() => [
315
- r(a.$slots, "default", {}, void 0, !0),
316
- e.required ? (s(), u("span", Se, "*")) : j("", !0),
317
- e.optionalLabel ? (s(), u("span", $e, "- " + L(e.optionalLabel), 1)) : j("", !0)
474
+ }, l.$attrs), {
475
+ default: q(() => [
476
+ s(l.$slots, "default", {}, void 0, !0),
477
+ e.required ? (i(), u("span", Ce, "*")) : b("", !0),
478
+ e.optionalLabel ? (i(), u("span", Le, "- " + V(e.optionalLabel), 1)) : b("", !0)
318
479
  ]),
319
480
  _: 3
320
481
  }, 16, ["class"]));
321
482
  }
322
483
  });
323
- const q = /* @__PURE__ */ _(ke, [["__scopeId", "data-v-e3232407"]]), Je = ["id", "type", "value"], Ie = ["data-unit"], we = /* @__PURE__ */ y({
484
+ const C = /* @__PURE__ */ p(ze, [["__scopeId", "data-v-e3232407"]]), Ee = ["large", "medium", "small"], Te = ["id", "disabled", "type", "value"], Ne = ["data-unit"], Me = /* @__PURE__ */ h({
324
485
  __name: "JoyInput",
325
486
  props: {
326
- ...B,
327
- ...H,
328
- clearable: {
487
+ // ...FORM_BASED_PROPS,
488
+ disabled: {
329
489
  type: Boolean,
330
490
  default: !1
331
491
  },
332
- icon: String,
333
- modelValue: {
492
+ id: {
493
+ type: String
494
+ },
495
+ invalid: {
496
+ type: Boolean,
497
+ default: !1
498
+ },
499
+ name: {
500
+ type: String
501
+ },
502
+ required: {
503
+ type: Boolean,
504
+ default: !1
505
+ },
506
+ label: String,
507
+ labelSize: {
334
508
  type: String,
335
- default: ""
509
+ default: "medium"
336
510
  },
337
511
  optionalLabel: String,
338
512
  requiredMark: {
339
513
  type: Boolean,
340
514
  default: !1
341
515
  },
516
+ // ...LABEL_BASED_PROPS,
517
+ modelValue: {
518
+ type: String,
519
+ default: ""
520
+ },
521
+ // ...TEXT_BASED_PROPS,
522
+ clearable: {
523
+ type: Boolean,
524
+ default: !1
525
+ },
526
+ icon: String,
342
527
  size: {
343
528
  type: String,
344
- default: "medium"
529
+ default: "medium",
530
+ validator(e) {
531
+ return Ee.includes(e);
532
+ }
345
533
  },
346
534
  type: String,
347
535
  unit: String
348
536
  },
349
537
  emits: ["update:modelValue"],
350
- setup(e, { emit: a }) {
351
- const t = e, l = h(), i = h(), c = z(), S = E(), o = h(!1), p = J(() => t.clearable && t.modelValue.length > 0 && !t.unit), b = J(() => S.default && S.default()), I = J(() => {
352
- var m, v;
353
- return !!((m = i.value) != null && m.closest("joy-wrapper")) || !!((v = i.value) != null && v.closest(".joy-wrapper"));
354
- }), g = h(t.type);
355
- M(() => {
356
- g.value = t.unit ? "number" : t.unit || "text";
538
+ setup(e, { emit: l }) {
539
+ const t = e, a = S(), o = S(), m = N(), _ = E(), r = S(!1), c = I(() => t.clearable && t.modelValue.length > 0 && !t.unit), j = I(() => _.default && _.default()), x = I(() => {
540
+ var d, f;
541
+ return !!((d = o.value) != null && d.closest("joy-wrapper")) || !!((f = o.value) != null && f.closest(".joy-wrapper"));
542
+ }), k = S(t.type);
543
+ A(() => {
544
+ k.value = t.unit ? "number" : t.unit || "text";
357
545
  });
358
- const $ = {
546
+ const v = {
359
547
  onFocus: () => {
360
- o.value = !0;
548
+ r.value = !0;
361
549
  },
362
550
  onBlur: () => {
363
- o.value = !1;
551
+ r.value = !1;
364
552
  },
365
- onInput: (m) => {
366
- let v = m.target.value;
367
- a("update:modelValue", v);
553
+ onInput: (d) => {
554
+ let f = d.target.value;
555
+ l("update:modelValue", f);
368
556
  },
369
557
  clearValue: () => {
370
- a("update:modelValue", "");
558
+ t.disabled || l("update:modelValue", "");
371
559
  }
372
560
  };
373
- return (m, v) => (s(), u("div", {
561
+ return (d, f) => (i(), u("div", {
374
562
  ref_key: "root",
375
- ref: i,
376
- class: d([`joy-input--${t.size}`])
563
+ ref: o,
564
+ class: y([`joy-input--${t.size}`])
377
565
  }, [
378
566
  n("div", {
379
- class: d([
567
+ class: y([
380
568
  "joy-input",
381
569
  {
382
- "joy-input--focusing": o.value,
383
- "joy-input--disabled": f(c).disabled,
384
- "joy-input--invalid": m.invalid,
385
- "joy-input--valid": !m.invalid && !f(c).disabled
570
+ "joy-input--focusing": r.value,
571
+ "joy-input--disabled": e.disabled,
572
+ "joy-input--invalid": e.invalid,
573
+ "joy-input--valid": !e.invalid && !g(m).disabled
386
574
  }
387
575
  ])
388
576
  }, [
389
- f(b) ? (s(), w(q, {
577
+ g(j) || e.label ? (i(), J(C, {
390
578
  key: 0,
391
- for: m.name,
392
- required: m.required && e.requiredMark,
579
+ for: e.name,
580
+ required: e.required && e.requiredMark,
393
581
  "optional-label": e.optionalLabel,
394
- size: m.labelSize
582
+ size: e.labelSize
395
583
  }, {
396
- default: V(() => [
397
- r(m.$slots, "default", {}, void 0, !0)
584
+ default: q(() => [
585
+ s(d.$slots, "default", {}, () => [
586
+ B(V(e.label), 1)
587
+ ], !0)
398
588
  ]),
399
589
  _: 3
400
- }, 8, ["for", "required", "optional-label", "size"])) : j("", !0),
590
+ }, 8, ["for", "required", "optional-label", "size"])) : b("", !0),
401
591
  n("div", {
402
- class: d([
592
+ class: y([
403
593
  "joy-input--wrapper",
404
594
  {
405
595
  "joy-input--wrapper-has-icon": !!e.icon,
406
596
  "joy-input--wrapper---clearable": e.clearable,
407
597
  "joy-input--wrapper-unit": !!e.unit,
408
- "joy-input--wrapper-margin": !f(I)
598
+ "joy-input--wrapper-margin": !g(x)
409
599
  }
410
600
  ])
411
601
  }, [
412
- n("input", C(m.$attrs, {
602
+ n("input", w(d.$attrs, {
413
603
  id: t.name,
414
604
  ref_key: "input",
415
- ref: l,
605
+ ref: a,
606
+ disabled: e.disabled,
416
607
  class: [
417
608
  {
418
- "joy-input--field-disabled": f(c).disabled,
419
- "joy-input--field-invalid": m.invalid
609
+ "joy-input--field-disabled": e.disabled,
610
+ "joy-input--field-invalid": e.invalid
420
611
  }
421
612
  ],
422
- type: g.value,
613
+ type: k.value,
423
614
  value: e.modelValue,
424
- onFocus: v[0] || (v[0] = //@ts-ignore
425
- (...k) => $.onFocus && $.onFocus(...k)),
426
- onBlur: v[1] || (v[1] = //@ts-ignore
427
- (...k) => $.onBlur && $.onBlur(...k)),
428
- onInput: v[2] || (v[2] = //@ts-ignore
429
- (...k) => $.onInput && $.onInput(...k))
430
- }), null, 16, Je),
431
- f(p) ? (s(), u("joy-icon", {
615
+ onFocus: f[0] || (f[0] = //@ts-ignore
616
+ (...$) => v.onFocus && v.onFocus(...$)),
617
+ onBlur: f[1] || (f[1] = //@ts-ignore
618
+ (...$) => v.onBlur && v.onBlur(...$)),
619
+ onInput: f[2] || (f[2] = //@ts-ignore
620
+ (...$) => v.onInput && v.onInput(...$))
621
+ }), null, 16, Te),
622
+ g(c) ? (i(), u("joy-icon", {
432
623
  key: 0,
433
624
  size: "xxsmall",
434
625
  name: "cross",
435
626
  class: "joy-input--clear",
436
- onClick: v[3] || (v[3] = //@ts-ignore
437
- (...k) => $.clearValue && $.clearValue(...k))
438
- })) : j("", !0),
439
- e.unit ? (s(), u("div", {
627
+ onClick: f[3] || (f[3] = //@ts-ignore
628
+ (...$) => v.clearValue && v.clearValue(...$))
629
+ })) : b("", !0),
630
+ e.unit ? (i(), u("div", {
440
631
  key: 1,
441
632
  "data-unit": e.unit,
442
633
  class: "joy-input--unit"
443
- }, null, 8, Ie)) : j("", !0)
634
+ }, null, 8, Ne)) : b("", !0)
444
635
  ], 2)
445
636
  ], 2)
446
637
  ], 2));
447
638
  }
448
639
  });
449
- const Ve = /* @__PURE__ */ _(we, [["__scopeId", "data-v-6eb67b7e"]]), Be = ["teal", "white"], Le = ["href"], Ce = ["color", "name"], Ee = /* @__PURE__ */ y({
640
+ const Re = /* @__PURE__ */ p(Me, [["__scopeId", "data-v-3da79efb"]]), Fe = ["teal", "white"], He = ["href"], Oe = ["color", "name"], Ae = /* @__PURE__ */ h({
450
641
  __name: "JoyLink",
451
642
  props: {
452
643
  href: {
@@ -457,29 +648,47 @@ const Ve = /* @__PURE__ */ _(we, [["__scopeId", "data-v-6eb67b7e"]]), Be = ["tea
457
648
  type: String,
458
649
  default: "teal",
459
650
  validator(e) {
460
- return Be.includes(e);
651
+ return Fe.includes(e);
461
652
  }
462
653
  },
463
654
  icon: String
464
655
  },
465
656
  setup(e) {
466
- const a = e, t = J(() => a.color === "white" ? "white" : "teal");
467
- return (l, i) => (s(), u("a", C({ href: e.href }, l.$attrs, {
657
+ const l = e, t = I(() => l.color === "white" ? "white" : "teal");
658
+ return (a, o) => (i(), u("a", w({ href: e.href }, a.$attrs, {
468
659
  class: ["joy-link", `joy-link_${e.color}`]
469
660
  }), [
470
- e.icon ? (s(), u("joy-icon", {
661
+ e.icon ? (i(), u("joy-icon", {
471
662
  key: 0,
472
- color: f(t),
663
+ color: g(t),
473
664
  name: e.icon
474
- }, null, 8, Ce)) : j("", !0),
475
- r(l.$slots, "default", {}, void 0, !0)
476
- ], 16, Le));
665
+ }, null, 8, Oe)) : b("", !0),
666
+ s(a.$slots, "default", {}, void 0, !0)
667
+ ], 16, He));
477
668
  }
478
669
  });
479
- const qe = /* @__PURE__ */ _(Ee, [["__scopeId", "data-v-640ee9a6"]]), ze = ["id", "value", "checked", "disabled", "required", "name"], Te = { class: "joy-radio-label" }, Re = { class: "joy-radio-content__wrapper" }, Oe = { class: "joy-radio-content" }, Ne = /* @__PURE__ */ y({
670
+ const Ge = /* @__PURE__ */ p(Ae, [["__scopeId", "data-v-640ee9a6"]]), De = ["id", "value", "checked", "disabled", "required", "name"], Pe = { class: "joy-radio-label" }, We = { class: "joy-radio-content__wrapper" }, Ue = { class: "joy-radio-content" }, Ze = /* @__PURE__ */ h({
480
671
  __name: "JoyRadio",
481
672
  props: {
482
- ...B,
673
+ disabled: {
674
+ type: Boolean,
675
+ default: !1
676
+ },
677
+ id: {
678
+ type: String
679
+ },
680
+ invalid: {
681
+ type: Boolean,
682
+ default: !1
683
+ },
684
+ name: {
685
+ type: String
686
+ },
687
+ required: {
688
+ type: Boolean,
689
+ default: !1
690
+ },
691
+ // ...FORM_BASED_PROPS,
483
692
  modelValue: {
484
693
  type: String
485
694
  },
@@ -492,66 +701,66 @@ const qe = /* @__PURE__ */ _(Ee, [["__scopeId", "data-v-640ee9a6"]]), ze = ["id"
492
701
  }
493
702
  },
494
703
  emits: ["update:modelValue"],
495
- setup(e, { expose: a, emit: t }) {
496
- const l = e, i = h(!1), c = h(null), S = h(null), o = E(), p = J(() => !l.modelValue || !l.value ? !1 : l.modelValue === l.value);
497
- function b() {
498
- i.value = !!o["expandable-content"] && p.value;
704
+ setup(e, { expose: l, emit: t }) {
705
+ const a = e, o = S(!1), m = S(null), _ = S(null), r = E(), c = I(() => !a.modelValue || !a.value ? !1 : a.modelValue === a.value);
706
+ function j() {
707
+ o.value = !!r["expandable-content"] && c.value;
499
708
  }
500
- function I() {
501
- t("update:modelValue", l.value), b();
709
+ function x() {
710
+ t("update:modelValue", a.value), j();
502
711
  }
503
- return A(() => {
504
- l.theme === "outline" && b();
505
- }), D(
506
- () => l.modelValue,
712
+ return T(() => {
713
+ a.theme === "outline" && j();
714
+ }), G(
715
+ () => a.modelValue,
507
716
  () => {
508
- b();
717
+ j();
509
718
  }
510
- ), a({
511
- checked: p,
512
- isExpanded: i
513
- }), (g, $) => (s(), u("label", {
719
+ ), l({
720
+ checked: c,
721
+ isExpanded: o
722
+ }), (k, v) => (i(), u("label", {
514
723
  ref_key: "root",
515
- ref: c,
516
- class: d([
724
+ ref: m,
725
+ class: y([
517
726
  "joy-radio",
518
727
  `joy-radio--${e.theme}`,
519
728
  {
520
- "joy-radio--checked": f(p),
521
- "joy-radio--disabled": g.disabled,
522
- "joy-radio--invalid": g.invalid
729
+ "joy-radio--checked": g(c),
730
+ "joy-radio--disabled": e.disabled,
731
+ "joy-radio--invalid": e.invalid
523
732
  }
524
733
  ])
525
734
  }, [
526
735
  n("input", {
527
- id: g.name,
736
+ id: e.name,
528
737
  type: "radio",
529
738
  value: e.value,
530
- checked: f(p),
531
- disabled: g.disabled,
532
- required: g.required,
533
- name: g.name,
534
- onChange: I
535
- }, null, 40, ze),
536
- n("span", Te, [
537
- r(g.$slots, "default", {}, void 0, !0)
739
+ checked: g(c),
740
+ disabled: e.disabled,
741
+ required: e.required,
742
+ name: e.name,
743
+ onChange: x
744
+ }, null, 40, De),
745
+ n("span", Pe, [
746
+ s(k.$slots, "default", {}, void 0, !0)
538
747
  ]),
539
- n("div", Re, [
540
- n("div", Oe, [
541
- r(g.$slots, "radio-content", {}, void 0, !0)
748
+ n("div", We, [
749
+ n("div", Ue, [
750
+ s(k.$slots, "radio-content", {}, void 0, !0)
542
751
  ]),
543
752
  n("div", {
544
753
  ref_key: "expandableElement",
545
- ref: S,
546
- class: d(["joy-radio-expandable", { "joy-radio-expandable--expanded": i.value }])
754
+ ref: _,
755
+ class: y(["joy-radio-expandable", { "joy-radio-expandable--expanded": o.value }])
547
756
  }, [
548
- r(g.$slots, "expandable-content", {}, void 0, !0)
757
+ s(k.$slots, "expandable-content", {}, void 0, !0)
549
758
  ], 2)
550
759
  ])
551
760
  ], 2));
552
761
  }
553
762
  });
554
- const Ae = /* @__PURE__ */ _(Ne, [["__scopeId", "data-v-822f5782"]]), Pe = ["form", "name"], Fe = /* @__PURE__ */ y({
763
+ const Ke = /* @__PURE__ */ p(Ze, [["__scopeId", "data-v-0a0dcfe7"]]), Qe = ["form", "name"], Xe = /* @__PURE__ */ h({
555
764
  __name: "JoyRadioGroup",
556
765
  props: {
557
766
  direction: {
@@ -561,121 +770,136 @@ const Ae = /* @__PURE__ */ _(Ne, [["__scopeId", "data-v-822f5782"]]), Pe = ["for
561
770
  form: {
562
771
  type: String
563
772
  },
564
- modelValue: {
565
- type: String
566
- },
567
773
  name: {
568
774
  type: String
569
- },
570
- invalid: Boolean,
571
- invalidText: {
572
- type: String
573
775
  }
574
776
  },
575
777
  setup(e) {
576
- return (a, t) => (s(), u("fieldset", {
778
+ return (l, t) => (i(), u("fieldset", {
577
779
  ref: "root",
578
780
  class: "joy-radio-group-fieldset",
579
781
  role: "radiogroup",
580
782
  form: e.form,
581
783
  name: e.name
582
784
  }, [
583
- r(a.$slots, "radio-group-legend", {}, void 0, !0),
785
+ s(l.$slots, "radio-group-legend", {}, void 0, !0),
584
786
  n("div", {
585
- class: d(["joy-radio-group-container", `joy-radio-group-${e.direction}`])
787
+ class: y(["joy-radio-group-container", `joy-radio-group-${e.direction}`])
586
788
  }, [
587
- r(a.$slots, "default", {}, void 0, !0)
789
+ s(l.$slots, "default", {}, void 0, !0)
588
790
  ], 2)
589
- ], 8, Pe));
791
+ ], 8, Qe));
590
792
  }
591
793
  });
592
- const He = /* @__PURE__ */ _(Fe, [["__scopeId", "data-v-09adf076"]]), Me = (e) => (O("data-v-7733736c"), e = e(), N(), e), De = ["id", "name", "aria-invalid", "required", "disabled", "value"], Ge = /* @__PURE__ */ Me(() => /* @__PURE__ */ n("joy-icon", {
794
+ const Ye = /* @__PURE__ */ p(Xe, [["__scopeId", "data-v-d75cd96a"]]), et = (e) => (L("data-v-f9015b7b"), e = e(), z(), e), tt = ["id", "name", "aria-invalid", "required", "disabled", "value"], at = /* @__PURE__ */ et(() => /* @__PURE__ */ n("joy-icon", {
593
795
  class: "joy-select__chevron",
594
796
  name: "chevron-down"
595
- }, null, -1)), We = /* @__PURE__ */ y({
797
+ }, null, -1)), lt = /* @__PURE__ */ h({
596
798
  __name: "JoySelect",
597
799
  props: {
598
- ...B,
599
- ...H,
600
- modelValue: {
601
- type: String,
602
- default: ""
800
+ disabled: {
801
+ type: Boolean,
802
+ default: !1
603
803
  },
604
- optionalLabel: {
804
+ id: {
805
+ type: String
806
+ },
807
+ invalid: {
808
+ type: Boolean,
809
+ default: !1
810
+ },
811
+ name: {
605
812
  type: String
606
813
  },
814
+ required: {
815
+ type: Boolean,
816
+ default: !1
817
+ },
818
+ // ...FORM_BASED_PROPS,
819
+ label: String,
820
+ labelSize: {
821
+ type: String,
822
+ default: "medium"
823
+ },
824
+ optionalLabel: String,
607
825
  requiredMark: {
608
826
  type: Boolean,
609
827
  default: !1
828
+ },
829
+ // ...LABEL_BASED_PROPS,
830
+ modelValue: {
831
+ type: String,
832
+ default: ""
610
833
  }
834
+ // ...TEXT_BASED_PROPS,
611
835
  },
612
836
  emits: ["update:modelValue"],
613
- setup(e, { emit: a }) {
614
- const t = e, l = h(), i = h(), c = E();
615
- A(() => {
616
- var b;
617
- const o = c.label && c.label();
618
- if (!o || !o.length)
837
+ setup(e, { emit: l }) {
838
+ const t = e, a = S(), o = S(), m = E();
839
+ T(() => {
840
+ var j;
841
+ const r = m.label && m.label();
842
+ if (!r || !r.length)
619
843
  return;
620
- const p = o[0];
621
- if (p.type === "JoyLabel") {
622
- const I = (b = p.props) == null ? void 0 : b.for;
623
- if (!I) {
844
+ const c = r[0];
845
+ if (c.type === "JoyLabel") {
846
+ const x = (j = c.props) == null ? void 0 : j.for;
847
+ if (!x) {
624
848
  console.warn("JoyLabel for attribute is missing");
625
849
  return;
626
850
  }
627
- I !== t.id && console.warn("JoyLabel for attribute does not match with JoySelect id");
851
+ x !== t.id && console.warn("JoyLabel for attribute does not match with JoySelect id");
628
852
  }
629
853
  });
630
- function S(o) {
631
- const p = o.target.value;
632
- a("update:modelValue", p);
854
+ function _(r) {
855
+ const c = r.target.value;
856
+ l("update:modelValue", c);
633
857
  }
634
- return (o, p) => (s(), u("div", {
858
+ return (r, c) => (i(), u("div", {
635
859
  ref_key: "root",
636
- ref: l
860
+ ref: a
637
861
  }, [
638
- r(o.$slots, "label", {}, () => [
639
- o.label ? (s(), w(q, {
862
+ s(r.$slots, "label", {}, () => [
863
+ e.label ? (i(), J(C, {
640
864
  key: 0,
641
- required: o.required && e.requiredMark,
865
+ required: e.required && e.requiredMark,
642
866
  "optional-label": e.optionalLabel,
643
- for: o.id || o.name,
644
- size: o.labelSize
867
+ for: e.id || e.name,
868
+ size: e.labelSize
645
869
  }, {
646
- default: V(() => [
647
- R(L(o.label), 1)
870
+ default: q(() => [
871
+ B(V(e.label), 1)
648
872
  ]),
649
873
  _: 1
650
- }, 8, ["required", "optional-label", "for", "size"])) : j("", !0)
874
+ }, 8, ["required", "optional-label", "for", "size"])) : b("", !0)
651
875
  ], !0),
652
876
  n("div", {
653
- class: d({
877
+ class: y({
654
878
  "joy-select__wrapper": !0,
655
- "joy-select--invalid": o.invalid,
656
- "joy-select--disabled": o.disabled
879
+ "joy-select--invalid": e.invalid,
880
+ "joy-select--disabled": e.disabled
657
881
  })
658
882
  }, [
659
883
  n("select", {
660
- id: o.id || o.name,
884
+ id: e.id || e.name,
661
885
  ref_key: "select",
662
- ref: i,
886
+ ref: o,
663
887
  class: "joy-select",
664
- name: o.name,
665
- "aria-invalid": o.invalid,
666
- required: o.required,
667
- disabled: o.disabled,
888
+ name: e.name,
889
+ "aria-invalid": e.invalid,
890
+ required: e.required,
891
+ disabled: e.disabled,
668
892
  value: e.modelValue,
669
- onInput: S
893
+ onInput: _
670
894
  }, [
671
- r(o.$slots, "default", {}, void 0, !0)
672
- ], 40, De),
673
- Ge
895
+ s(r.$slots, "default", {}, void 0, !0)
896
+ ], 40, tt),
897
+ at
674
898
  ], 2)
675
899
  ], 512));
676
900
  }
677
901
  });
678
- const Ze = /* @__PURE__ */ _(We, [["__scopeId", "data-v-7733736c"]]), Ue = /* @__PURE__ */ y({
902
+ const nt = /* @__PURE__ */ p(lt, [["__scopeId", "data-v-f9015b7b"]]), ot = /* @__PURE__ */ h({
679
903
  __name: "JoyWrapper",
680
904
  props: {
681
905
  justify: {
@@ -696,83 +920,252 @@ const Ze = /* @__PURE__ */ _(We, [["__scopeId", "data-v-7733736c"]]), Ue = /* @_
696
920
  }
697
921
  },
698
922
  setup(e) {
699
- return (a, t) => (s(), u("div", {
700
- class: d(["joy-wrapper", `joy-wrapper--justify-${e.justify}`, `joy-wrapper--align-${e.align}`, `joy-wrapper--direction-${e.direction}`, `joy-wrapper--wrap-${e.wrap}`])
923
+ return (l, t) => (i(), u("div", {
924
+ class: y(["joy-wrapper", `joy-wrapper--justify-${e.justify}`, `joy-wrapper--align-${e.align}`, `joy-wrapper--direction-${e.direction}`, `joy-wrapper--wrap-${e.wrap}`])
701
925
  }, [
702
- r(a.$slots, "default", {}, void 0, !0)
926
+ s(l.$slots, "default", {}, void 0, !0)
703
927
  ], 2));
704
928
  }
705
929
  });
706
- const Ke = /* @__PURE__ */ _(Ue, [["__scopeId", "data-v-dce6df77"]]), Xe = { class: "joy-template__heading" }, Qe = { class: "joy-template__heading___headings" }, Ye = /* @__PURE__ */ y({
930
+ const it = /* @__PURE__ */ p(ot, [["__scopeId", "data-v-ce0e1214"]]), dt = { class: "joy-template__heading" }, rt = { class: "joy-template__heading___headings" }, ut = /* @__PURE__ */ h({
707
931
  __name: "JoyTemplate",
708
932
  props: {
709
933
  full: { type: Boolean, default: !1 },
710
934
  sidebar: { type: String, default: "right" }
711
935
  },
712
936
  setup(e) {
713
- const a = e;
714
- return (t, l) => (s(), u("main", {
715
- class: d(["joy-template", { "joy-template--full": a.full }])
937
+ const l = e;
938
+ return (t, a) => (i(), u("main", {
939
+ class: y(["joy-template", { "joy-template--full": l.full }])
716
940
  }, [
717
- n("div", Xe, [
941
+ n("div", dt, [
718
942
  n("div", {
719
- class: d({ "joy-template-slot-back": t.$slots["template-back"] })
943
+ class: y({ "joy-template-slot-back": t.$slots["template-back"] })
720
944
  }, [
721
- r(t.$slots, "template-back", {}, void 0, !0)
945
+ s(t.$slots, "template-back", {}, void 0, !0)
722
946
  ], 2),
723
- n("div", Qe, [
947
+ n("div", rt, [
724
948
  n("div", {
725
- class: d({ "joy-template-slot-title": t.$slots["template-title"] })
949
+ class: y({ "joy-template-slot-title": t.$slots["template-title"] })
726
950
  }, [
727
- r(t.$slots, "template-title", {}, void 0, !0)
951
+ s(t.$slots, "template-title", {}, void 0, !0)
728
952
  ], 2),
729
953
  n("div", {
730
- class: d({ "joy-template-slot-subtitle": t.$slots["template-subtitle"] })
954
+ class: y({ "joy-template-slot-subtitle": t.$slots["template-subtitle"] })
731
955
  }, [
732
- r(t.$slots, "template-subtitle", {}, void 0, !0)
956
+ s(t.$slots, "template-subtitle", {}, void 0, !0)
733
957
  ], 2)
734
958
  ])
735
959
  ]),
736
960
  n("div", {
737
- class: d([
961
+ class: y([
738
962
  "joy-template__content",
739
963
  {
740
- "joy-template__content--reverse": a.sidebar === "left"
964
+ "joy-template__content--reverse": l.sidebar === "left"
741
965
  }
742
966
  ])
743
967
  }, [
744
968
  n("div", {
745
- class: d({ "joy-template-slot-main": t.$slots["template-main"] })
969
+ class: y({ "joy-template-slot-main": t.$slots["template-main"] })
746
970
  }, [
747
- r(t.$slots, "template-main", {}, void 0, !0)
971
+ s(t.$slots, "template-main", {}, void 0, !0)
748
972
  ], 2),
749
973
  n("div", {
750
- class: d({ "joy-template-slot-sidebar": t.$slots["template-sidebar"] })
974
+ class: y({ "joy-template-slot-sidebar": t.$slots["template-sidebar"] })
751
975
  }, [
752
- r(t.$slots, "template-sidebar", {}, void 0, !0)
976
+ s(t.$slots, "template-sidebar", {}, void 0, !0)
753
977
  ], 2)
754
978
  ], 2)
755
979
  ], 2));
756
980
  }
757
981
  });
758
- const xe = /* @__PURE__ */ _(Ye, [["__scopeId", "data-v-d8b3fcfa"]]), et = ["name", "disabled", "checked", "required", "aria-checked", "value"], tt = { class: "joy-toggle__content" }, ot = /* @__PURE__ */ y({
982
+ const st = /* @__PURE__ */ p(ut, [["__scopeId", "data-v-2333416c"]]), ct = ["aria-disabled"], yt = ["id", "disabled", "name", "required", "minlength", "value"], mt = {
983
+ key: 0,
984
+ class: "joy-textarea_helpers"
985
+ }, ft = {
986
+ key: 0,
987
+ name: "check",
988
+ color: "grey",
989
+ size: "xxsmall"
990
+ }, vt = /* @__PURE__ */ h({
991
+ __name: "JoyTextarea",
992
+ props: {
993
+ disabled: {
994
+ type: Boolean,
995
+ default: !1
996
+ },
997
+ id: {
998
+ type: String
999
+ },
1000
+ invalid: {
1001
+ type: Boolean,
1002
+ default: !1
1003
+ },
1004
+ name: {
1005
+ type: String
1006
+ },
1007
+ required: {
1008
+ type: Boolean,
1009
+ default: !1
1010
+ },
1011
+ // ...FORM_BASED_PROPS,
1012
+ label: String,
1013
+ labelSize: {
1014
+ type: String,
1015
+ default: "medium"
1016
+ },
1017
+ optionalLabel: String,
1018
+ requiredMark: {
1019
+ type: Boolean,
1020
+ default: !1
1021
+ },
1022
+ // ...LABEL_BASED_PROPS,
1023
+ modelValue: {
1024
+ type: String,
1025
+ default: ""
1026
+ },
1027
+ // ...TEXT_BASED_PROPS,
1028
+ autogrow: {
1029
+ type: Boolean,
1030
+ default: !1
1031
+ },
1032
+ minlength: {
1033
+ type: Number
1034
+ },
1035
+ minlengthLabel: String,
1036
+ maxlength: {
1037
+ type: Number
1038
+ }
1039
+ },
1040
+ emits: ["update:modelValue"],
1041
+ setup(e, { expose: l, emit: t }) {
1042
+ const a = e, o = S(), m = S(), _ = S(!1), r = I(() => a.maxlength ? a.modelValue.length > a.maxlength : !1), c = I(() => a.minlength ? a.modelValue.length < a.minlength : !1);
1043
+ function j() {
1044
+ o.value && a.autogrow && (o.value.style.height = "auto", o.value.style.height = o.value.scrollHeight + "px", m.value && (m.value.style.height = o.value.scrollHeight + "px"));
1045
+ }
1046
+ T(() => {
1047
+ j();
1048
+ });
1049
+ const x = {
1050
+ onInput: (k) => {
1051
+ t("update:modelValue", k.target.value), j();
1052
+ },
1053
+ onBlur: () => {
1054
+ _.value = r.value || c.value;
1055
+ }
1056
+ };
1057
+ return l({
1058
+ isInvalid: _,
1059
+ valueOverMaxlength: r,
1060
+ valueUnderMinlength: c
1061
+ }), (k, v) => (i(), u("div", {
1062
+ "aria-disabled": e.disabled,
1063
+ class: y([
1064
+ "joy-textarea",
1065
+ {
1066
+ "joy-textarea_invalid": _.value || e.invalid,
1067
+ "joy-textarea_disabled": e.disabled,
1068
+ "joy-textarea_autogrow": e.autogrow
1069
+ }
1070
+ ])
1071
+ }, [
1072
+ R(g(C), {
1073
+ for: e.id,
1074
+ required: e.required && e.requiredMark,
1075
+ "optional-label": e.optionalLabel,
1076
+ size: e.labelSize
1077
+ }, {
1078
+ default: q(() => [
1079
+ s(k.$slots, "default", {}, () => [
1080
+ B(V(e.label), 1)
1081
+ ], !0)
1082
+ ]),
1083
+ _: 3
1084
+ }, 8, ["for", "required", "optional-label", "size"]),
1085
+ n("div", {
1086
+ ref_key: "textareaWrapper",
1087
+ ref: m,
1088
+ class: "joy-textarea_wrapper"
1089
+ }, [
1090
+ n("textarea", w(k.$attrs, {
1091
+ id: e.id,
1092
+ ref_key: "textarea",
1093
+ ref: o,
1094
+ class: "joy-native-textarea",
1095
+ disabled: e.disabled,
1096
+ name: e.name,
1097
+ required: e.required,
1098
+ minlength: e.minlength,
1099
+ value: e.modelValue,
1100
+ onInput: v[0] || (v[0] = //@ts-ignore
1101
+ (...d) => x.onInput && x.onInput(...d)),
1102
+ onBlur: v[1] || (v[1] = //@ts-ignore
1103
+ (...d) => x.onBlur && x.onBlur(...d))
1104
+ }), null, 16, yt)
1105
+ ], 512),
1106
+ e.minlength || e.maxlength ? (i(), u("div", mt, [
1107
+ e.minlength ? (i(), u("p", {
1108
+ key: 0,
1109
+ class: y(["joy-textarea-min", { "joy-textarea-min-invalid": e.invalid }])
1110
+ }, [
1111
+ g(c) ? b("", !0) : (i(), u("joy-icon", ft)),
1112
+ B(" " + V(e.minlengthLabel || `Minimum ${e.minlength} characters`), 1)
1113
+ ], 2)) : b("", !0),
1114
+ e.maxlength ? (i(), u("p", {
1115
+ key: 1,
1116
+ class: y(["joy-textarea-count", { "joy-textarea-count-invalid": g(r) }])
1117
+ }, V(e.modelValue.length + "/" + e.maxlength), 3)) : b("", !0)
1118
+ ])) : b("", !0)
1119
+ ], 10, ct));
1120
+ }
1121
+ });
1122
+ const gt = /* @__PURE__ */ p(vt, [["__scopeId", "data-v-d68ef0dd"]]), bt = ["name", "disabled", "checked", "required", "aria-checked", "value"], ht = { class: "joy-toggle__content" }, pt = /* @__PURE__ */ h({
759
1123
  __name: "JoyToggle",
760
- props: F,
1124
+ props: {
1125
+ modelValue: {
1126
+ type: Boolean,
1127
+ default: !1
1128
+ },
1129
+ value: {
1130
+ type: String,
1131
+ default: "on"
1132
+ },
1133
+ disabled: {
1134
+ type: Boolean,
1135
+ default: !1
1136
+ },
1137
+ id: {
1138
+ type: String
1139
+ },
1140
+ invalid: {
1141
+ type: Boolean,
1142
+ default: !1
1143
+ },
1144
+ name: {
1145
+ type: String
1146
+ },
1147
+ required: {
1148
+ type: Boolean,
1149
+ default: !1
1150
+ },
1151
+ // ...CHECKBOX_BASED_PROPS,
1152
+ label: String
1153
+ },
761
1154
  emits: ["update:modelValue"],
762
- setup(e, { emit: a }) {
1155
+ setup(e, { emit: l }) {
763
1156
  const t = {
764
- onChange: (l) => {
765
- const i = l.target.checked;
766
- a("update:modelValue", i);
1157
+ onChange: (a) => {
1158
+ const o = a.target.checked;
1159
+ l("update:modelValue", o);
767
1160
  }
768
1161
  };
769
- return (l, i) => (s(), u("div", null, [
1162
+ return (a, o) => (i(), u("div", null, [
770
1163
  n("label", {
771
- class: d([
1164
+ class: y([
772
1165
  "joy-toggle",
773
1166
  {
774
- "joy-toggle__checked": l.modelValue,
775
- "joy-toggle__disabled": l.disabled
1167
+ "joy-toggle__checked": e.modelValue,
1168
+ "joy-toggle__disabled": e.disabled
776
1169
  }
777
1170
  ])
778
1171
  }, [
@@ -781,59 +1174,65 @@ const xe = /* @__PURE__ */ _(Ye, [["__scopeId", "data-v-d8b3fcfa"]]), et = ["nam
781
1174
  type: "checkbox",
782
1175
  class: "joy-toggle__input",
783
1176
  role: "checkbox",
784
- name: l.name,
785
- disabled: l.disabled,
786
- checked: l.modelValue,
787
- required: l.required,
788
- "aria-checked": l.modelValue,
789
- value: l.value,
790
- onChange: i[0] || (i[0] = //@ts-ignore
791
- (...c) => t.onChange && t.onChange(...c))
792
- }, null, 40, et),
793
- n("p", tt, [
794
- r(l.$slots, "default", {}, void 0, !0)
1177
+ name: e.name,
1178
+ disabled: e.disabled,
1179
+ checked: e.modelValue,
1180
+ required: e.required,
1181
+ "aria-checked": e.modelValue,
1182
+ value: e.value,
1183
+ onChange: o[0] || (o[0] = //@ts-ignore
1184
+ (...m) => t.onChange && t.onChange(...m))
1185
+ }, null, 40, bt),
1186
+ n("p", ht, [
1187
+ s(a.$slots, "default", {}, () => [
1188
+ B(V(e.label), 1)
1189
+ ], !0)
795
1190
  ])
796
1191
  ], 2)
797
1192
  ]));
798
1193
  }
799
1194
  });
800
- const at = /* @__PURE__ */ _(ot, [["__scopeId", "data-v-e617de9c"]]), lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1195
+ const _t = /* @__PURE__ */ p(pt, [["__scopeId", "data-v-e31a6b5e"]]), jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
801
1196
  __proto__: null,
802
1197
  JoyButton: ae,
803
- JoyCheckbox: de,
804
- JoyFormError: _e,
805
- JoyHighlight: be,
806
- JoyInput: Ve,
807
- JoyLabel: q,
808
- JoyLink: qe,
809
- JoyRadio: Ae,
810
- JoyRadioGroup: He,
811
- JoySelect: Ze,
812
- JoySpinner: P,
813
- JoyTemplate: xe,
814
- JoyToggle: at,
815
- JoyWrapper: Ke
816
- }, Symbol.toStringTag, { value: "Module" })), it = {
1198
+ JoyCheckbox: re,
1199
+ JoyCounter: _e,
1200
+ JoyFormError: O,
1201
+ JoyHighlight: qe,
1202
+ JoyInput: Re,
1203
+ JoyLabel: C,
1204
+ JoyLink: Ge,
1205
+ JoyRadio: Ke,
1206
+ JoyRadioGroup: Ye,
1207
+ JoySelect: nt,
1208
+ JoySpinner: F,
1209
+ JoyTemplate: st,
1210
+ JoyTextarea: gt,
1211
+ JoyToggle: _t,
1212
+ JoyWrapper: it
1213
+ }, Symbol.toStringTag, { value: "Module" })), $t = {
817
1214
  install: (e) => {
818
- Object.entries(lt).forEach(([a, t]) => {
819
- e.component(a, t);
1215
+ Object.entries(jt).forEach(([l, t]) => {
1216
+ e.component(l, t);
820
1217
  });
821
1218
  }
822
1219
  };
823
1220
  export {
824
1221
  ae as JoyButton,
825
- de as JoyCheckbox,
826
- _e as JoyFormError,
827
- be as JoyHighlight,
828
- Ve as JoyInput,
829
- q as JoyLabel,
830
- qe as JoyLink,
831
- Ae as JoyRadio,
832
- He as JoyRadioGroup,
833
- Ze as JoySelect,
834
- P as JoySpinner,
835
- xe as JoyTemplate,
836
- at as JoyToggle,
837
- it as JoyVuePlugin,
838
- Ke as JoyWrapper
1222
+ re as JoyCheckbox,
1223
+ _e as JoyCounter,
1224
+ O as JoyFormError,
1225
+ qe as JoyHighlight,
1226
+ Re as JoyInput,
1227
+ C as JoyLabel,
1228
+ Ge as JoyLink,
1229
+ Ke as JoyRadio,
1230
+ Ye as JoyRadioGroup,
1231
+ nt as JoySelect,
1232
+ F as JoySpinner,
1233
+ st as JoyTemplate,
1234
+ gt as JoyTextarea,
1235
+ _t as JoyToggle,
1236
+ $t as JoyVuePlugin,
1237
+ it as JoyWrapper
839
1238
  };