@useinsider/guido 3.28.1-beta.70df1f2 → 3.28.1-beta.7539890
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/README.md +3 -0
- package/dist/@types/display-condition.js +45 -21
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +25 -19
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +72 -53
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +1 -1
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +60 -42
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue.js +18 -0
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue2.js +25 -0
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue2.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue.js +30 -0
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue2.js +32 -0
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue2.js +60 -0
- package/dist/composables/useDisplayConditionAttributes.js +20 -0
- package/dist/composables/useDisplayConditions.js +83 -68
- package/dist/composables/useScrollToInvalid.js +15 -0
- package/dist/enums/display-condition.js +15 -6
- package/dist/enums/html-validator.js +1 -1
- package/dist/extensions/DisplayConditions/constants.js +19 -10
- package/dist/extensions/DisplayConditions/control.js +84 -64
- package/dist/extensions/DisplayConditions/display-conditions.css.js +58 -6
- package/dist/extensions/DisplayConditions/extension.js +18 -14
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +118 -102
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +18 -19
- package/dist/src/@types/display-condition.d.ts +67 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderConnector.vue.d.ts +19 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderField.vue.d.ts +22 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderGroup.vue.d.ts +24 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderRow.vue.d.ts +25 -0
- package/dist/src/composables/useDisplayConditionAttributes.d.ts +4 -0
- package/dist/src/composables/useDisplayConditions.d.ts +1 -1
- package/dist/src/composables/useScrollToInvalid.d.ts +6 -0
- package/dist/src/enums/display-condition.d.ts +22 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +1 -0
- package/dist/src/utils/displayConditionAttributes.d.ts +7 -0
- package/dist/src/utils/displayConditionBuilder.d.ts +29 -0
- package/dist/src/utils/displayConditionRules.d.ts +12 -0
- package/dist/src/utils/displayConditionSummary.d.ts +11 -0
- package/dist/src/utils/genericUtil.d.ts +5 -3
- package/dist/utils/displayConditionAttributes.js +22 -0
- package/dist/utils/displayConditionBuilder.js +50 -0
- package/dist/utils/displayConditionRules.js +91 -0
- package/dist/utils/displayConditionSummary.js +28 -0
- package/dist/utils/genericUtil.js +41 -40
- package/package.json +2 -2
|
@@ -31,21 +31,21 @@ function w(n) {
|
|
|
31
31
|
return r === "string" ? `"${n}"` : r === "number" || r === "bigint" || r === "boolean" ? `${n}` : r === "object" || r === "function" ? (n && ((s = (e = Object.getPrototypeOf(n)) == null ? void 0 : e.constructor) == null ? void 0 : s.name)) ?? "null" : r;
|
|
32
32
|
}
|
|
33
33
|
function f(n, r, e, s, t) {
|
|
34
|
-
const l = t && "input" in t ? t.input : e.value, u = (t == null ? void 0 : t.expected) ?? n.expects ?? null,
|
|
34
|
+
const l = t && "input" in t ? t.input : e.value, u = (t == null ? void 0 : t.expected) ?? n.expects ?? null, p = (t == null ? void 0 : t.received) ?? /* @__PURE__ */ w(l), i = {
|
|
35
35
|
kind: n.kind,
|
|
36
36
|
type: n.type,
|
|
37
37
|
input: l,
|
|
38
38
|
expected: u,
|
|
39
|
-
received:
|
|
40
|
-
message: `Invalid ${r}: ${u ? `Expected ${u} but r` : "R"}eceived ${
|
|
39
|
+
received: p,
|
|
40
|
+
message: `Invalid ${r}: ${u ? `Expected ${u} but r` : "R"}eceived ${p}`,
|
|
41
41
|
requirement: n.requirement,
|
|
42
42
|
path: t == null ? void 0 : t.path,
|
|
43
43
|
issues: t == null ? void 0 : t.issues,
|
|
44
44
|
lang: s.lang,
|
|
45
45
|
abortEarly: s.abortEarly,
|
|
46
46
|
abortPipeEarly: s.abortPipeEarly
|
|
47
|
-
},
|
|
48
|
-
c !== void 0 && (i.message = typeof c == "function" ? c(i) : c),
|
|
47
|
+
}, a = n.kind === "schema", c = (t == null ? void 0 : t.message) ?? n.message ?? /* @__PURE__ */ q(n.reference, i.lang) ?? (a ? /* @__PURE__ */ V(i.lang) : null) ?? s.message ?? /* @__PURE__ */ A(i.lang);
|
|
48
|
+
c !== void 0 && (i.message = typeof c == "function" ? c(i) : c), a && (e.typed = !1), e.issues ? e.issues.push(i) : e.issues = [i];
|
|
49
49
|
}
|
|
50
50
|
// @__NO_SIDE_EFFECTS__
|
|
51
51
|
function o(n) {
|
|
@@ -136,11 +136,26 @@ function L(n) {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
// @__NO_SIDE_EFFECTS__
|
|
139
|
-
function N(n) {
|
|
139
|
+
function N(n, r) {
|
|
140
|
+
return {
|
|
141
|
+
kind: "validation",
|
|
142
|
+
type: "regex",
|
|
143
|
+
reference: N,
|
|
144
|
+
async: !1,
|
|
145
|
+
expects: `${n}`,
|
|
146
|
+
requirement: n,
|
|
147
|
+
message: r,
|
|
148
|
+
"~run"(e, s) {
|
|
149
|
+
return e.typed && !this.requirement.test(e.value) && f(this, "format", e, s), e;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
// @__NO_SIDE_EFFECTS__
|
|
154
|
+
function C(n) {
|
|
140
155
|
return {
|
|
141
156
|
kind: "transformation",
|
|
142
157
|
type: "transform",
|
|
143
|
-
reference:
|
|
158
|
+
reference: C,
|
|
144
159
|
async: !1,
|
|
145
160
|
operation: n,
|
|
146
161
|
"~run"(r) {
|
|
@@ -149,11 +164,11 @@ function N(n) {
|
|
|
149
164
|
};
|
|
150
165
|
}
|
|
151
166
|
// @__NO_SIDE_EFFECTS__
|
|
152
|
-
function
|
|
167
|
+
function F() {
|
|
153
168
|
return {
|
|
154
169
|
kind: "transformation",
|
|
155
170
|
type: "trim",
|
|
156
|
-
reference:
|
|
171
|
+
reference: F,
|
|
157
172
|
async: !1,
|
|
158
173
|
"~run"(n) {
|
|
159
174
|
return n.value = n.value.trim(), n;
|
|
@@ -165,7 +180,7 @@ function P(n, r, e) {
|
|
|
165
180
|
return typeof n.fallback == "function" ? n.fallback(r, e) : n.fallback;
|
|
166
181
|
}
|
|
167
182
|
// @__NO_SIDE_EFFECTS__
|
|
168
|
-
function
|
|
183
|
+
function te(n, r) {
|
|
169
184
|
return {
|
|
170
185
|
...n,
|
|
171
186
|
fallback: r,
|
|
@@ -186,11 +201,11 @@ function x(n, r, e) {
|
|
|
186
201
|
return typeof n.default == "function" ? n.default(r, e) : n.default;
|
|
187
202
|
}
|
|
188
203
|
// @__NO_SIDE_EFFECTS__
|
|
189
|
-
function
|
|
204
|
+
function R(n, r) {
|
|
190
205
|
return {
|
|
191
206
|
kind: "schema",
|
|
192
207
|
type: "array",
|
|
193
|
-
reference:
|
|
208
|
+
reference: R,
|
|
194
209
|
expects: "Array",
|
|
195
210
|
async: !1,
|
|
196
211
|
item: n,
|
|
@@ -204,17 +219,17 @@ function F(n, r) {
|
|
|
204
219
|
if (Array.isArray(t)) {
|
|
205
220
|
e.typed = !0, e.value = [];
|
|
206
221
|
for (let u = 0; u < t.length; u++) {
|
|
207
|
-
const
|
|
222
|
+
const p = t[u], i = this.item["~run"]({ value: p }, s);
|
|
208
223
|
if (i.issues) {
|
|
209
|
-
const
|
|
224
|
+
const a = {
|
|
210
225
|
type: "array",
|
|
211
226
|
origin: "value",
|
|
212
227
|
input: t,
|
|
213
228
|
key: u,
|
|
214
|
-
value:
|
|
229
|
+
value: p
|
|
215
230
|
};
|
|
216
231
|
for (const c of i.issues)
|
|
217
|
-
c.path ? c.path.unshift(
|
|
232
|
+
c.path ? c.path.unshift(a) : c.path = [a], (l = e.issues) == null || l.push(c);
|
|
218
233
|
if (e.issues || (e.issues = i.issues), s.abortEarly) {
|
|
219
234
|
e.typed = !1;
|
|
220
235
|
break;
|
|
@@ -228,11 +243,11 @@ function F(n, r) {
|
|
|
228
243
|
};
|
|
229
244
|
}
|
|
230
245
|
// @__NO_SIDE_EFFECTS__
|
|
231
|
-
function
|
|
246
|
+
function B(n) {
|
|
232
247
|
return {
|
|
233
248
|
kind: "schema",
|
|
234
249
|
type: "boolean",
|
|
235
|
-
reference:
|
|
250
|
+
reference: B,
|
|
236
251
|
expects: "boolean",
|
|
237
252
|
async: !1,
|
|
238
253
|
message: n,
|
|
@@ -245,11 +260,11 @@ function R(n) {
|
|
|
245
260
|
};
|
|
246
261
|
}
|
|
247
262
|
// @__NO_SIDE_EFFECTS__
|
|
248
|
-
function
|
|
263
|
+
function H(n, r) {
|
|
249
264
|
return {
|
|
250
265
|
kind: "schema",
|
|
251
266
|
type: "custom",
|
|
252
|
-
reference:
|
|
267
|
+
reference: H,
|
|
253
268
|
expects: "unknown",
|
|
254
269
|
async: !1,
|
|
255
270
|
check: n,
|
|
@@ -263,11 +278,11 @@ function B(n, r) {
|
|
|
263
278
|
};
|
|
264
279
|
}
|
|
265
280
|
// @__NO_SIDE_EFFECTS__
|
|
266
|
-
function
|
|
281
|
+
function J(n) {
|
|
267
282
|
return {
|
|
268
283
|
kind: "schema",
|
|
269
284
|
type: "lazy",
|
|
270
|
-
reference:
|
|
285
|
+
reference: J,
|
|
271
286
|
expects: "unknown",
|
|
272
287
|
async: !1,
|
|
273
288
|
getter: n,
|
|
@@ -280,11 +295,11 @@ function H(n) {
|
|
|
280
295
|
};
|
|
281
296
|
}
|
|
282
297
|
// @__NO_SIDE_EFFECTS__
|
|
283
|
-
function
|
|
298
|
+
function Q(n, r) {
|
|
284
299
|
return {
|
|
285
300
|
kind: "schema",
|
|
286
301
|
type: "literal",
|
|
287
|
-
reference:
|
|
302
|
+
reference: Q,
|
|
288
303
|
expects: /* @__PURE__ */ w(n),
|
|
289
304
|
async: !1,
|
|
290
305
|
literal: n,
|
|
@@ -298,11 +313,11 @@ function J(n, r) {
|
|
|
298
313
|
};
|
|
299
314
|
}
|
|
300
315
|
// @__NO_SIDE_EFFECTS__
|
|
301
|
-
function
|
|
316
|
+
function T(n, r) {
|
|
302
317
|
return {
|
|
303
318
|
kind: "schema",
|
|
304
319
|
type: "loose_object",
|
|
305
|
-
reference:
|
|
320
|
+
reference: T,
|
|
306
321
|
expects: "Object",
|
|
307
322
|
async: !1,
|
|
308
323
|
entries: n,
|
|
@@ -316,10 +331,10 @@ function Q(n, r) {
|
|
|
316
331
|
if (t && typeof t == "object") {
|
|
317
332
|
e.typed = !0, e.value = {};
|
|
318
333
|
for (const u in this.entries) {
|
|
319
|
-
const
|
|
320
|
-
if (u in t || (
|
|
321
|
-
const i = u in t ? t[u] : /* @__PURE__ */ x(
|
|
322
|
-
if (
|
|
334
|
+
const p = this.entries[u];
|
|
335
|
+
if (u in t || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
|
|
336
|
+
const i = u in t ? t[u] : /* @__PURE__ */ x(p), a = p["~run"]({ value: i }, s);
|
|
337
|
+
if (a.issues) {
|
|
323
338
|
const c = {
|
|
324
339
|
type: "object",
|
|
325
340
|
origin: "value",
|
|
@@ -327,16 +342,16 @@ function Q(n, r) {
|
|
|
327
342
|
key: u,
|
|
328
343
|
value: i
|
|
329
344
|
};
|
|
330
|
-
for (const y of
|
|
345
|
+
for (const y of a.issues)
|
|
331
346
|
y.path ? y.path.unshift(c) : y.path = [c], (l = e.issues) == null || l.push(y);
|
|
332
|
-
if (e.issues || (e.issues =
|
|
347
|
+
if (e.issues || (e.issues = a.issues), s.abortEarly) {
|
|
333
348
|
e.typed = !1;
|
|
334
349
|
break;
|
|
335
350
|
}
|
|
336
351
|
}
|
|
337
|
-
|
|
338
|
-
} else if (
|
|
339
|
-
else if (
|
|
352
|
+
a.typed || (e.typed = !1), e.value[u] = a.value;
|
|
353
|
+
} else if (p.fallback !== void 0) e.value[u] = /* @__PURE__ */ P(p);
|
|
354
|
+
else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (f(this, "key", e, s, {
|
|
340
355
|
input: void 0,
|
|
341
356
|
expected: `"${u}"`,
|
|
342
357
|
path: [{
|
|
@@ -357,11 +372,11 @@ function Q(n, r) {
|
|
|
357
372
|
};
|
|
358
373
|
}
|
|
359
374
|
// @__NO_SIDE_EFFECTS__
|
|
360
|
-
function
|
|
375
|
+
function U(n, r) {
|
|
361
376
|
return {
|
|
362
377
|
kind: "schema",
|
|
363
378
|
type: "nullish",
|
|
364
|
-
reference:
|
|
379
|
+
reference: U,
|
|
365
380
|
expects: `(${n.expects} | null | undefined)`,
|
|
366
381
|
async: !1,
|
|
367
382
|
wrapped: n,
|
|
@@ -375,11 +390,11 @@ function T(n, r) {
|
|
|
375
390
|
};
|
|
376
391
|
}
|
|
377
392
|
// @__NO_SIDE_EFFECTS__
|
|
378
|
-
function
|
|
393
|
+
function W(n) {
|
|
379
394
|
return {
|
|
380
395
|
kind: "schema",
|
|
381
396
|
type: "number",
|
|
382
|
-
reference:
|
|
397
|
+
reference: W,
|
|
383
398
|
expects: "number",
|
|
384
399
|
async: !1,
|
|
385
400
|
message: n,
|
|
@@ -392,11 +407,11 @@ function U(n) {
|
|
|
392
407
|
};
|
|
393
408
|
}
|
|
394
409
|
// @__NO_SIDE_EFFECTS__
|
|
395
|
-
function
|
|
410
|
+
function X(n, r) {
|
|
396
411
|
return {
|
|
397
412
|
kind: "schema",
|
|
398
413
|
type: "object",
|
|
399
|
-
reference:
|
|
414
|
+
reference: X,
|
|
400
415
|
expects: "Object",
|
|
401
416
|
async: !1,
|
|
402
417
|
entries: n,
|
|
@@ -410,10 +425,10 @@ function W(n, r) {
|
|
|
410
425
|
if (t && typeof t == "object") {
|
|
411
426
|
e.typed = !0, e.value = {};
|
|
412
427
|
for (const u in this.entries) {
|
|
413
|
-
const
|
|
414
|
-
if (u in t || (
|
|
415
|
-
const i = u in t ? t[u] : /* @__PURE__ */ x(
|
|
416
|
-
if (
|
|
428
|
+
const p = this.entries[u];
|
|
429
|
+
if (u in t || (p.type === "exact_optional" || p.type === "optional" || p.type === "nullish") && p.default !== void 0) {
|
|
430
|
+
const i = u in t ? t[u] : /* @__PURE__ */ x(p), a = p["~run"]({ value: i }, s);
|
|
431
|
+
if (a.issues) {
|
|
417
432
|
const c = {
|
|
418
433
|
type: "object",
|
|
419
434
|
origin: "value",
|
|
@@ -421,16 +436,16 @@ function W(n, r) {
|
|
|
421
436
|
key: u,
|
|
422
437
|
value: i
|
|
423
438
|
};
|
|
424
|
-
for (const y of
|
|
439
|
+
for (const y of a.issues)
|
|
425
440
|
y.path ? y.path.unshift(c) : y.path = [c], (l = e.issues) == null || l.push(y);
|
|
426
|
-
if (e.issues || (e.issues =
|
|
441
|
+
if (e.issues || (e.issues = a.issues), s.abortEarly) {
|
|
427
442
|
e.typed = !1;
|
|
428
443
|
break;
|
|
429
444
|
}
|
|
430
445
|
}
|
|
431
|
-
|
|
432
|
-
} else if (
|
|
433
|
-
else if (
|
|
446
|
+
a.typed || (e.typed = !1), e.value[u] = a.value;
|
|
447
|
+
} else if (p.fallback !== void 0) e.value[u] = /* @__PURE__ */ P(p);
|
|
448
|
+
else if (p.type !== "exact_optional" && p.type !== "optional" && p.type !== "nullish" && (f(this, "key", e, s, {
|
|
434
449
|
input: void 0,
|
|
435
450
|
expected: `"${u}"`,
|
|
436
451
|
path: [{
|
|
@@ -449,11 +464,11 @@ function W(n, r) {
|
|
|
449
464
|
};
|
|
450
465
|
}
|
|
451
466
|
// @__NO_SIDE_EFFECTS__
|
|
452
|
-
function
|
|
467
|
+
function Y(n, r) {
|
|
453
468
|
return {
|
|
454
469
|
kind: "schema",
|
|
455
470
|
type: "optional",
|
|
456
|
-
reference:
|
|
471
|
+
reference: Y,
|
|
457
472
|
expects: `(${n.expects} | undefined)`,
|
|
458
473
|
async: !1,
|
|
459
474
|
wrapped: n,
|
|
@@ -467,11 +482,11 @@ function X(n, r) {
|
|
|
467
482
|
};
|
|
468
483
|
}
|
|
469
484
|
// @__NO_SIDE_EFFECTS__
|
|
470
|
-
function
|
|
485
|
+
function Z(n, r) {
|
|
471
486
|
return {
|
|
472
487
|
kind: "schema",
|
|
473
488
|
type: "picklist",
|
|
474
|
-
reference:
|
|
489
|
+
reference: Z,
|
|
475
490
|
expects: /* @__PURE__ */ D(n.map(w), "|"),
|
|
476
491
|
async: !1,
|
|
477
492
|
options: n,
|
|
@@ -485,11 +500,11 @@ function Y(n, r) {
|
|
|
485
500
|
};
|
|
486
501
|
}
|
|
487
502
|
// @__NO_SIDE_EFFECTS__
|
|
488
|
-
function
|
|
503
|
+
function $(n, r, e) {
|
|
489
504
|
return {
|
|
490
505
|
kind: "schema",
|
|
491
506
|
type: "record",
|
|
492
|
-
reference:
|
|
507
|
+
reference: $,
|
|
493
508
|
expects: "Object",
|
|
494
509
|
async: !1,
|
|
495
510
|
key: n,
|
|
@@ -499,19 +514,19 @@ function Z(n, r, e) {
|
|
|
499
514
|
return /* @__PURE__ */ o(this);
|
|
500
515
|
},
|
|
501
516
|
"~run"(s, t) {
|
|
502
|
-
var u,
|
|
517
|
+
var u, p;
|
|
503
518
|
const l = s.value;
|
|
504
519
|
if (l && typeof l == "object") {
|
|
505
520
|
s.typed = !0, s.value = {};
|
|
506
521
|
for (const i in l) if (/* @__PURE__ */ I(l, i)) {
|
|
507
|
-
const
|
|
522
|
+
const a = l[i], c = this.key["~run"]({ value: i }, t);
|
|
508
523
|
if (c.issues) {
|
|
509
524
|
const b = {
|
|
510
525
|
type: "object",
|
|
511
526
|
origin: "key",
|
|
512
527
|
input: l,
|
|
513
528
|
key: i,
|
|
514
|
-
value:
|
|
529
|
+
value: a
|
|
515
530
|
};
|
|
516
531
|
for (const h of c.issues)
|
|
517
532
|
h.path = [b], (u = s.issues) == null || u.push(h);
|
|
@@ -520,17 +535,17 @@ function Z(n, r, e) {
|
|
|
520
535
|
break;
|
|
521
536
|
}
|
|
522
537
|
}
|
|
523
|
-
const y = this.value["~run"]({ value:
|
|
538
|
+
const y = this.value["~run"]({ value: a }, t);
|
|
524
539
|
if (y.issues) {
|
|
525
540
|
const b = {
|
|
526
541
|
type: "object",
|
|
527
542
|
origin: "value",
|
|
528
543
|
input: l,
|
|
529
544
|
key: i,
|
|
530
|
-
value:
|
|
545
|
+
value: a
|
|
531
546
|
};
|
|
532
547
|
for (const h of y.issues)
|
|
533
|
-
h.path ? h.path.unshift(b) : h.path = [b], (
|
|
548
|
+
h.path ? h.path.unshift(b) : h.path = [b], (p = s.issues) == null || p.push(h);
|
|
534
549
|
if (s.issues || (s.issues = y.issues), t.abortEarly) {
|
|
535
550
|
s.typed = !1;
|
|
536
551
|
break;
|
|
@@ -544,11 +559,11 @@ function Z(n, r, e) {
|
|
|
544
559
|
};
|
|
545
560
|
}
|
|
546
561
|
// @__NO_SIDE_EFFECTS__
|
|
547
|
-
function
|
|
562
|
+
function ee(n) {
|
|
548
563
|
return {
|
|
549
564
|
kind: "schema",
|
|
550
565
|
type: "string",
|
|
551
|
-
reference:
|
|
566
|
+
reference: ee,
|
|
552
567
|
expects: "string",
|
|
553
568
|
async: !1,
|
|
554
569
|
message: n,
|
|
@@ -567,11 +582,11 @@ function S(n) {
|
|
|
567
582
|
return r;
|
|
568
583
|
}
|
|
569
584
|
// @__NO_SIDE_EFFECTS__
|
|
570
|
-
function
|
|
585
|
+
function ne(n, r) {
|
|
571
586
|
return {
|
|
572
587
|
kind: "schema",
|
|
573
588
|
type: "union",
|
|
574
|
-
reference:
|
|
589
|
+
reference: ne,
|
|
575
590
|
expects: /* @__PURE__ */ D(n.map((e) => e.expects), "|"),
|
|
576
591
|
async: !1,
|
|
577
592
|
options: n,
|
|
@@ -581,8 +596,8 @@ function ee(n, r) {
|
|
|
581
596
|
},
|
|
582
597
|
"~run"(e, s) {
|
|
583
598
|
let t, l, u;
|
|
584
|
-
for (const
|
|
585
|
-
const i =
|
|
599
|
+
for (const p of this.options) {
|
|
600
|
+
const i = p["~run"]({ value: e.value }, s);
|
|
586
601
|
if (i.typed) if (i.issues) l ? l.push(i) : l = [i];
|
|
587
602
|
else {
|
|
588
603
|
t = i;
|
|
@@ -603,11 +618,11 @@ function ee(n, r) {
|
|
|
603
618
|
};
|
|
604
619
|
}
|
|
605
620
|
// @__NO_SIDE_EFFECTS__
|
|
606
|
-
function
|
|
621
|
+
function re() {
|
|
607
622
|
return {
|
|
608
623
|
kind: "schema",
|
|
609
624
|
type: "unknown",
|
|
610
|
-
reference:
|
|
625
|
+
reference: re,
|
|
611
626
|
expects: "unknown",
|
|
612
627
|
async: !1,
|
|
613
628
|
get "~standard"() {
|
|
@@ -619,11 +634,11 @@ function ne() {
|
|
|
619
634
|
};
|
|
620
635
|
}
|
|
621
636
|
// @__NO_SIDE_EFFECTS__
|
|
622
|
-
function
|
|
637
|
+
function se(n, r, e) {
|
|
623
638
|
return {
|
|
624
639
|
kind: "schema",
|
|
625
640
|
type: "variant",
|
|
626
|
-
reference:
|
|
641
|
+
reference: se,
|
|
627
642
|
expects: "Object",
|
|
628
643
|
async: !1,
|
|
629
644
|
key: n,
|
|
@@ -635,7 +650,7 @@ function re(n, r, e) {
|
|
|
635
650
|
"~run"(s, t) {
|
|
636
651
|
const l = s.value;
|
|
637
652
|
if (l && typeof l == "object") {
|
|
638
|
-
let u,
|
|
653
|
+
let u, p = 0, i = this.key, a = [];
|
|
639
654
|
const c = (y, b) => {
|
|
640
655
|
for (const h of y.options) {
|
|
641
656
|
if (h.type === "variant") c(h, new Set(b).add(h.key));
|
|
@@ -647,7 +662,7 @@ function re(n, r, e) {
|
|
|
647
662
|
typed: !1,
|
|
648
663
|
value: l[v]
|
|
649
664
|
}, { abortEarly: !0 }).issues : d.type !== "exact_optional" && d.type !== "optional" && d.type !== "nullish") {
|
|
650
|
-
O = !1, i !== v && (
|
|
665
|
+
O = !1, i !== v && (p < k || p === k && v in l && !(i in l)) && (p = k, i = v, a = []), i === v && a.push(h.entries[v].expects);
|
|
651
666
|
break;
|
|
652
667
|
}
|
|
653
668
|
k++;
|
|
@@ -663,7 +678,7 @@ function re(n, r, e) {
|
|
|
663
678
|
if (c(this, /* @__PURE__ */ new Set([this.key])), u) return u;
|
|
664
679
|
f(this, "type", s, t, {
|
|
665
680
|
input: l[i],
|
|
666
|
-
expected: /* @__PURE__ */ D(
|
|
681
|
+
expected: /* @__PURE__ */ D(a, "|"),
|
|
667
682
|
path: [{
|
|
668
683
|
type: "object",
|
|
669
684
|
origin: "value",
|
|
@@ -677,13 +692,13 @@ function re(n, r, e) {
|
|
|
677
692
|
}
|
|
678
693
|
};
|
|
679
694
|
}
|
|
680
|
-
function
|
|
695
|
+
function ue(n, r, e) {
|
|
681
696
|
const s = n["~run"]({ value: r }, /* @__PURE__ */ g(e));
|
|
682
697
|
if (s.issues) throw new K(s.issues);
|
|
683
698
|
return s.value;
|
|
684
699
|
}
|
|
685
700
|
// @__NO_SIDE_EFFECTS__
|
|
686
|
-
function
|
|
701
|
+
function ie(...n) {
|
|
687
702
|
return {
|
|
688
703
|
...n[0],
|
|
689
704
|
pipe: n,
|
|
@@ -703,7 +718,7 @@ function ue(...n) {
|
|
|
703
718
|
};
|
|
704
719
|
}
|
|
705
720
|
// @__NO_SIDE_EFFECTS__
|
|
706
|
-
function
|
|
721
|
+
function le(...n) {
|
|
707
722
|
return {
|
|
708
723
|
...n[0],
|
|
709
724
|
pipe: n,
|
|
@@ -724,7 +739,7 @@ function ie(...n) {
|
|
|
724
739
|
};
|
|
725
740
|
}
|
|
726
741
|
// @__NO_SIDE_EFFECTS__
|
|
727
|
-
function
|
|
742
|
+
function pe(n, r, e) {
|
|
728
743
|
const s = n["~run"]({ value: r }, /* @__PURE__ */ g(e));
|
|
729
744
|
return {
|
|
730
745
|
typed: s.typed,
|
|
@@ -750,38 +765,39 @@ export {
|
|
|
750
765
|
I as _isValidObjectKey,
|
|
751
766
|
D as _joinExpects,
|
|
752
767
|
w as _stringify,
|
|
753
|
-
|
|
754
|
-
|
|
768
|
+
R as array,
|
|
769
|
+
B as boolean,
|
|
755
770
|
M as checkAsync,
|
|
756
|
-
|
|
757
|
-
|
|
771
|
+
H as custom,
|
|
772
|
+
te as fallback,
|
|
758
773
|
x as getDefault,
|
|
759
774
|
P as getFallback,
|
|
760
775
|
g as getGlobalConfig,
|
|
761
776
|
A as getGlobalMessage,
|
|
762
777
|
V as getSchemaMessage,
|
|
763
778
|
q as getSpecificMessage,
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
779
|
+
J as lazy,
|
|
780
|
+
Q as literal,
|
|
781
|
+
T as looseObject,
|
|
767
782
|
z as maxLength,
|
|
768
783
|
G as minLength,
|
|
769
784
|
L as nonEmpty,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
785
|
+
U as nullish,
|
|
786
|
+
W as number,
|
|
787
|
+
X as object,
|
|
788
|
+
Y as optional,
|
|
789
|
+
ue as parse,
|
|
790
|
+
Z as picklist,
|
|
791
|
+
ie as pipe,
|
|
792
|
+
le as pipeAsync,
|
|
793
|
+
$ as record,
|
|
794
|
+
N as regex,
|
|
795
|
+
pe as safeParse,
|
|
780
796
|
ae as safeParseAsync,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
797
|
+
ee as string,
|
|
798
|
+
C as transform,
|
|
799
|
+
F as trim,
|
|
800
|
+
ne as union,
|
|
801
|
+
re as unknown,
|
|
802
|
+
se as variant
|
|
787
803
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
import { useHttp as p } from "../composables/useHttp.js";
|
|
2
|
-
import { SavedDisplayConditionSchema as
|
|
2
|
+
import { SavedDisplayConditionSchema as u, DisplayConditionListResponseSchema as y } from "../@types/display-condition.js";
|
|
3
3
|
import { parse as r } from "../node_modules/valibot/dist/index.js";
|
|
4
|
-
const
|
|
5
|
-
const { get: c, post: m, delete: l } = p(),
|
|
4
|
+
const a = "/email-proxy/v1/display-conditions", S = 100, A = () => {
|
|
5
|
+
const { get: c, post: m, delete: l } = p(), n = async (t, e) => {
|
|
6
6
|
const o = new URLSearchParams({
|
|
7
7
|
page: String(e),
|
|
8
|
-
limit: String(
|
|
8
|
+
limit: String(S),
|
|
9
9
|
sortColumn: "id",
|
|
10
10
|
sortDirection: "desc",
|
|
11
11
|
"filter[syntax]": t
|
|
12
|
-
}), { data:
|
|
13
|
-
return r(
|
|
12
|
+
}), { data: i } = await c(`${a}?${o.toString()}`);
|
|
13
|
+
return r(y, i);
|
|
14
14
|
};
|
|
15
15
|
return { list: async (t) => {
|
|
16
|
-
const e = await
|
|
16
|
+
const e = await n(t, 1), o = await Promise.all(Array.from(
|
|
17
17
|
{ length: Math.max(e.meta.lastPage - 1, 0) },
|
|
18
|
-
(
|
|
19
|
-
)),
|
|
20
|
-
return [...new Map(
|
|
18
|
+
(s, d) => n(t, d + 2)
|
|
19
|
+
)), i = [e, ...o].flatMap((s) => s.data);
|
|
20
|
+
return [...new Map(i.map((s) => [s.id, s])).values()];
|
|
21
21
|
}, create: async (t, e) => {
|
|
22
|
-
const { data:
|
|
22
|
+
const o = t.method === "logicBuilder" ? { codeBefore: JSON.stringify(t.rules) } : { codeBefore: t.codeBefore, codeAfter: t.codeAfter }, { data: i } = await m(a, {
|
|
23
23
|
name: t.name.trim(),
|
|
24
24
|
description: t.description.trim() || null,
|
|
25
25
|
syntax: e,
|
|
26
|
-
method:
|
|
27
|
-
|
|
28
|
-
codeAfter: t.codeAfter
|
|
26
|
+
method: t.method,
|
|
27
|
+
...o
|
|
29
28
|
});
|
|
30
|
-
return r(
|
|
29
|
+
return r(u, i.data);
|
|
31
30
|
}, remove: async (t) => {
|
|
32
|
-
await l(`${
|
|
31
|
+
await l(`${a}/${t}`);
|
|
33
32
|
} };
|
|
34
33
|
};
|
|
35
34
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
S as DISPLAY_CONDITIONS_PAGE_LIMIT,
|
|
36
|
+
a as DISPLAY_CONDITIONS_URL,
|
|
37
|
+
A as useDisplayConditionApi
|
|
39
38
|
};
|