@effect-app/vue 0.87.0-next.9 → 0.87.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,495 @@
1
1
  # @effect-app/vue
2
2
 
3
+ ## 0.87.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [fd520f7]
8
+ - @effect-app/prelude@0.107.1
9
+ - @effect-app/schema@0.150.1
10
+ - @effect-app/vue@0.87.1
11
+
12
+ ## 0.87.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 640d24a: reference schema2
17
+ - 640d24a: update packages
18
+
19
+ ### Patch Changes
20
+
21
+ - 640d24a: fix exclusive min/max
22
+ - 640d24a: update
23
+ - 640d24a: cleanup schema ext
24
+ - 640d24a: updates
25
+ - 640d24a: update vue
26
+ - 640d24a: f
27
+ - 640d24a: fix error message
28
+ - 640d24a: S
29
+ - 640d24a: mini form
30
+ - 640d24a: update schema
31
+ - 640d24a: improve error
32
+ - 640d24a: form and client fixes
33
+ - 640d24a: update packages
34
+ - 640d24a: reimplement vue form
35
+ - 640d24a: upd
36
+ - 640d24a: use schema fork
37
+ - 640d24a: update packages
38
+ - 640d24a: cleanup errors and use decodeSyc over parseSync
39
+ - 640d24a: d
40
+ - 640d24a: update packages
41
+ - 640d24a: update packages
42
+ - Updated dependencies [640d24a]
43
+ - Updated dependencies [640d24a]
44
+ - Updated dependencies [640d24a]
45
+ - Updated dependencies [640d24a]
46
+ - Updated dependencies [640d24a]
47
+ - Updated dependencies [640d24a]
48
+ - Updated dependencies [640d24a]
49
+ - Updated dependencies [640d24a]
50
+ - Updated dependencies [640d24a]
51
+ - Updated dependencies [640d24a]
52
+ - Updated dependencies [640d24a]
53
+ - Updated dependencies [640d24a]
54
+ - Updated dependencies [640d24a]
55
+ - Updated dependencies [640d24a]
56
+ - Updated dependencies [640d24a]
57
+ - Updated dependencies [640d24a]
58
+ - Updated dependencies [640d24a]
59
+ - Updated dependencies [640d24a]
60
+ - Updated dependencies [640d24a]
61
+ - Updated dependencies [640d24a]
62
+ - Updated dependencies [640d24a]
63
+ - Updated dependencies [640d24a]
64
+ - Updated dependencies [640d24a]
65
+ - Updated dependencies [640d24a]
66
+ - Updated dependencies [640d24a]
67
+ - Updated dependencies [640d24a]
68
+ - Updated dependencies [640d24a]
69
+ - Updated dependencies [640d24a]
70
+ - Updated dependencies [640d24a]
71
+ - Updated dependencies [640d24a]
72
+ - Updated dependencies [640d24a]
73
+ - Updated dependencies [640d24a]
74
+ - Updated dependencies [640d24a]
75
+ - Updated dependencies [640d24a]
76
+ - Updated dependencies [640d24a]
77
+ - Updated dependencies [640d24a]
78
+ - Updated dependencies [640d24a]
79
+ - Updated dependencies [640d24a]
80
+ - Updated dependencies [640d24a]
81
+ - Updated dependencies [640d24a]
82
+ - Updated dependencies [640d24a]
83
+ - Updated dependencies [640d24a]
84
+ - Updated dependencies [640d24a]
85
+ - Updated dependencies [640d24a]
86
+ - Updated dependencies [640d24a]
87
+ - Updated dependencies [640d24a]
88
+ - Updated dependencies [640d24a]
89
+ - Updated dependencies [640d24a]
90
+ - Updated dependencies [640d24a]
91
+ - Updated dependencies [640d24a]
92
+ - Updated dependencies [640d24a]
93
+ - Updated dependencies [640d24a]
94
+ - Updated dependencies [640d24a]
95
+ - Updated dependencies [640d24a]
96
+ - Updated dependencies [640d24a]
97
+ - Updated dependencies [640d24a]
98
+ - Updated dependencies [640d24a]
99
+ - @effect-app/schema@0.150.0
100
+ - @effect-app/vue@0.87.0
101
+ - @effect-app/prelude@0.107.0
102
+ - @effect-app/core@0.97.0
103
+
104
+ ## 0.87.0-next.52
105
+
106
+ ### Patch Changes
107
+
108
+ - d2bc3ac: update schema
109
+ - Updated dependencies [d2bc3ac]
110
+ - @effect-app/prelude@0.107.0-next.45
111
+ - @effect-app/schema@0.150.0-next.30
112
+ - @effect-app/vue@0.87.0-next.52
113
+
114
+ ## 0.87.0-next.51
115
+
116
+ ### Patch Changes
117
+
118
+ - update packages
119
+ - Updated dependencies
120
+ - @effect-app/prelude@0.107.0-next.44
121
+ - @effect-app/schema@0.150.0-next.29
122
+ - @effect-app/core@0.97.0-next.8
123
+ - @effect-app/vue@0.87.0-next.51
124
+
125
+ ## 0.87.0-next.50
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [19dc3b1]
130
+ - @effect-app/prelude@0.107.0-next.43
131
+ - @effect-app/schema@0.150.0-next.28
132
+ - @effect-app/vue@0.87.0-next.50
133
+
134
+ ## 0.87.0-next.49
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [09ed839]
139
+ - @effect-app/prelude@0.107.0-next.42
140
+ - @effect-app/vue@0.87.0-next.49
141
+
142
+ ## 0.87.0-next.48
143
+
144
+ ### Patch Changes
145
+
146
+ - b6d4272: update packages
147
+ - Updated dependencies [0bc4207]
148
+ - Updated dependencies [b6d4272]
149
+ - @effect-app/schema@0.150.0-next.27
150
+ - @effect-app/prelude@0.107.0-next.41
151
+ - @effect-app/core@0.97.0-next.7
152
+ - @effect-app/vue@0.87.0-next.48
153
+
154
+ ## 0.87.0-next.47
155
+
156
+ ### Patch Changes
157
+
158
+ - 8a75cac: update vue
159
+ - Updated dependencies [8a75cac]
160
+ - @effect-app/vue@0.87.0-next.47
161
+
162
+ ## 0.87.0-next.46
163
+
164
+ ### Patch Changes
165
+
166
+ - 14b33a9: cleanup errors and use decodeSyc over parseSync
167
+ - Updated dependencies [14b33a9]
168
+ - @effect-app/prelude@0.107.0-next.40
169
+ - @effect-app/schema@0.150.0-next.26
170
+ - @effect-app/vue@0.87.0-next.46
171
+
172
+ ## 0.87.0-next.45
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies [aa1b654]
177
+ - @effect-app/schema@0.150.0-next.25
178
+ - @effect-app/prelude@0.107.0-next.39
179
+ - @effect-app/vue@0.87.0-next.45
180
+
181
+ ## 0.87.0-next.44
182
+
183
+ ### Patch Changes
184
+
185
+ - Updated dependencies [64793a8]
186
+ - @effect-app/prelude@0.107.0-next.38
187
+ - @effect-app/vue@0.87.0-next.44
188
+
189
+ ## 0.87.0-next.43
190
+
191
+ ### Patch Changes
192
+
193
+ - 9e151ed: update packages
194
+ - Updated dependencies [9e151ed]
195
+ - @effect-app/prelude@0.107.0-next.37
196
+ - @effect-app/schema@0.150.0-next.24
197
+ - @effect-app/core@0.97.0-next.6
198
+ - @effect-app/vue@0.87.0-next.43
199
+
200
+ ## 0.87.0-next.42
201
+
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies [6b89c27]
205
+ - @effect-app/core@0.97.0-next.5
206
+ - @effect-app/prelude@0.107.0-next.36
207
+ - @effect-app/schema@0.150.0-next.23
208
+ - @effect-app/vue@0.87.0-next.42
209
+
210
+ ## 0.87.0-next.41
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [169c159]
215
+ - @effect-app/prelude@0.107.0-next.35
216
+ - @effect-app/schema@0.150.0-next.22
217
+ - @effect-app/vue@0.87.0-next.41
218
+
219
+ ## 0.87.0-next.40
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [b46e30d]
224
+ - @effect-app/prelude@0.107.0-next.34
225
+ - @effect-app/vue@0.87.0-next.40
226
+
227
+ ## 0.87.0-next.39
228
+
229
+ ### Patch Changes
230
+
231
+ - Updated dependencies [c57bb66]
232
+ - @effect-app/schema@0.150.0-next.21
233
+ - @effect-app/prelude@0.107.0-next.33
234
+ - @effect-app/vue@0.87.0-next.39
235
+
236
+ ## 0.87.0-next.38
237
+
238
+ ### Patch Changes
239
+
240
+ - ce46673: update packages
241
+ - Updated dependencies [735dea9]
242
+ - Updated dependencies [ce46673]
243
+ - @effect-app/prelude@0.107.0-next.32
244
+ - @effect-app/vue@0.87.0-next.38
245
+
246
+ ## 0.87.0-next.37
247
+
248
+ ### Patch Changes
249
+
250
+ - Updated dependencies [21482c6]
251
+ - @effect-app/prelude@0.107.0-next.31
252
+ - @effect-app/vue@0.87.0-next.37
253
+
254
+ ## 0.87.0-next.36
255
+
256
+ ### Patch Changes
257
+
258
+ - Updated dependencies [eab24be]
259
+ - @effect-app/prelude@0.107.0-next.30
260
+ - @effect-app/vue@0.87.0-next.36
261
+
262
+ ## 0.87.0-next.35
263
+
264
+ ### Patch Changes
265
+
266
+ - Updated dependencies [def06a7]
267
+ - @effect-app/prelude@0.107.0-next.29
268
+ - @effect-app/vue@0.87.0-next.35
269
+
270
+ ## 0.87.0-next.34
271
+
272
+ ### Patch Changes
273
+
274
+ - Updated dependencies [eb31797]
275
+ - @effect-app/prelude@0.107.0-next.28
276
+ - @effect-app/vue@0.87.0-next.34
277
+
278
+ ## 0.87.0-next.33
279
+
280
+ ### Patch Changes
281
+
282
+ - Updated dependencies [65696a6]
283
+ - @effect-app/prelude@0.107.0-next.27
284
+ - @effect-app/vue@0.87.0-next.33
285
+
286
+ ## 0.87.0-next.32
287
+
288
+ ### Patch Changes
289
+
290
+ - Updated dependencies [777162f]
291
+ - @effect-app/prelude@0.107.0-next.26
292
+ - @effect-app/schema@0.150.0-next.20
293
+ - @effect-app/vue@0.87.0-next.32
294
+
295
+ ## 0.87.0-next.31
296
+
297
+ ### Patch Changes
298
+
299
+ - Updated dependencies [0776693]
300
+ - @effect-app/prelude@0.107.0-next.25
301
+ - @effect-app/vue@0.87.0-next.31
302
+
303
+ ## 0.87.0-next.30
304
+
305
+ ### Patch Changes
306
+
307
+ - c96bc2f: f
308
+ - Updated dependencies [c96bc2f]
309
+ - @effect-app/vue@0.87.0-next.30
310
+
311
+ ## 0.87.0-next.29
312
+
313
+ ### Patch Changes
314
+
315
+ - 68eaf52: form and client fixes
316
+ - Updated dependencies [68eaf52]
317
+ - @effect-app/prelude@0.107.0-next.24
318
+ - @effect-app/vue@0.87.0-next.29
319
+
320
+ ## 0.87.0-next.28
321
+
322
+ ### Patch Changes
323
+
324
+ - Updated dependencies [ca927a5]
325
+ - @effect-app/schema@0.150.0-next.19
326
+ - @effect-app/prelude@0.107.0-next.23
327
+ - @effect-app/vue@0.87.0-next.28
328
+
329
+ ## 0.87.0-next.27
330
+
331
+ ### Patch Changes
332
+
333
+ - Updated dependencies [5f62f5a]
334
+ - @effect-app/prelude@0.107.0-next.22
335
+ - @effect-app/schema@0.150.0-next.18
336
+ - @effect-app/vue@0.87.0-next.27
337
+
338
+ ## 0.87.0-next.26
339
+
340
+ ### Patch Changes
341
+
342
+ - Updated dependencies [53d4b3e]
343
+ - @effect-app/schema@0.150.0-next.17
344
+ - @effect-app/prelude@0.107.0-next.21
345
+ - @effect-app/vue@0.87.0-next.26
346
+
347
+ ## 0.87.0-next.25
348
+
349
+ ### Patch Changes
350
+
351
+ - Updated dependencies [63d4549]
352
+ - @effect-app/schema@0.150.0-next.16
353
+ - @effect-app/prelude@0.107.0-next.20
354
+ - @effect-app/vue@0.87.0-next.25
355
+
356
+ ## 0.87.0-next.24
357
+
358
+ ### Patch Changes
359
+
360
+ - b19ce70: S
361
+ - Updated dependencies [b19ce70]
362
+ - @effect-app/prelude@0.107.0-next.19
363
+ - @effect-app/vue@0.87.0-next.24
364
+
365
+ ## 0.87.0-next.23
366
+
367
+ ### Patch Changes
368
+
369
+ - Updated dependencies [92ff6b9]
370
+ - @effect-app/prelude@0.107.0-next.18
371
+ - @effect-app/schema@0.150.0-next.15
372
+ - @effect-app/vue@0.87.0-next.23
373
+
374
+ ## 0.87.0-next.22
375
+
376
+ ### Patch Changes
377
+
378
+ - 15e7b7a: d
379
+ - Updated dependencies [15e7b7a]
380
+ - @effect-app/vue@0.87.0-next.22
381
+
382
+ ## 0.87.0-next.21
383
+
384
+ ### Patch Changes
385
+
386
+ - Updated dependencies [c234016]
387
+ - @effect-app/schema@0.150.0-next.14
388
+ - @effect-app/prelude@0.107.0-next.17
389
+ - @effect-app/vue@0.87.0-next.21
390
+
391
+ ## 0.87.0-next.20
392
+
393
+ ### Patch Changes
394
+
395
+ - 5d53b26: fix exclusive min/max
396
+ - Updated dependencies [5d53b26]
397
+ - @effect-app/schema@0.150.0-next.13
398
+ - @effect-app/vue@0.87.0-next.20
399
+ - @effect-app/prelude@0.107.0-next.16
400
+
401
+ ## 0.87.0-next.19
402
+
403
+ ### Patch Changes
404
+
405
+ - fd785c2: improve error
406
+ - Updated dependencies [fd785c2]
407
+ - @effect-app/vue@0.87.0-next.19
408
+
409
+ ## 0.87.0-next.18
410
+
411
+ ### Patch Changes
412
+
413
+ - 99310c3: fix error message
414
+ - Updated dependencies [99310c3]
415
+ - @effect-app/vue@0.87.0-next.18
416
+
417
+ ## 0.87.0-next.17
418
+
419
+ ### Patch Changes
420
+
421
+ - Updated dependencies [147bc14]
422
+ - @effect-app/schema@0.150.0-next.12
423
+ - @effect-app/prelude@0.107.0-next.15
424
+ - @effect-app/vue@0.87.0-next.17
425
+
426
+ ## 0.87.0-next.16
427
+
428
+ ### Patch Changes
429
+
430
+ - 660d57a: upd
431
+ - Updated dependencies [660d57a]
432
+ - @effect-app/schema@0.150.0-next.11
433
+ - @effect-app/vue@0.87.0-next.16
434
+ - @effect-app/prelude@0.107.0-next.14
435
+
436
+ ## 0.87.0-next.15
437
+
438
+ ### Patch Changes
439
+
440
+ - 5f76678: reimplement vue form
441
+ - Updated dependencies [5f76678]
442
+ - @effect-app/vue@0.87.0-next.15
443
+
444
+ ## 0.87.0-next.14
445
+
446
+ ### Patch Changes
447
+
448
+ - 20076e0: update
449
+ - Updated dependencies [20076e0]
450
+ - @effect-app/prelude@0.107.0-next.13
451
+ - @effect-app/schema@0.150.0-next.10
452
+ - @effect-app/vue@0.87.0-next.14
453
+
454
+ ## 0.87.0-next.13
455
+
456
+ ### Patch Changes
457
+
458
+ - Updated dependencies
459
+ - @effect-app/core@0.97.0-next.4
460
+ - @effect-app/prelude@0.107.0-next.12
461
+ - @effect-app/schema@0.150.0-next.9
462
+ - @effect-app/vue@0.87.0-next.13
463
+
464
+ ## 0.87.0-next.12
465
+
466
+ ### Patch Changes
467
+
468
+ - ac35466: use schema fork
469
+ - Updated dependencies [ac35466]
470
+ - @effect-app/prelude@0.107.0-next.11
471
+ - @effect-app/schema@0.150.0-next.8
472
+ - @effect-app/vue@0.87.0-next.12
473
+
474
+ ## 0.87.0-next.11
475
+
476
+ ### Patch Changes
477
+
478
+ - Updated dependencies [4f8ade3]
479
+ - @effect-app/core@0.97.0-next.3
480
+ - @effect-app/prelude@0.107.0-next.10
481
+ - @effect-app/schema@0.150.0-next.7
482
+ - @effect-app/vue@0.87.0-next.11
483
+
484
+ ## 0.87.0-next.10
485
+
486
+ ### Patch Changes
487
+
488
+ - Updated dependencies [8897586]
489
+ - @effect-app/schema@0.150.0-next.6
490
+ - @effect-app/prelude@0.107.0-next.9
491
+ - @effect-app/vue@0.87.0-next.10
492
+
3
493
  ## 0.87.0-next.9
4
494
 
5
495
  ### Patch Changes
package/_cjs/form.cjs CHANGED
@@ -3,12 +3,23 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.buildFieldInfoFromFields = buildFieldInfoFromFields;
7
+ exports.buildFormFromSchema = void 0;
6
8
  exports.convertIn = convertIn;
7
9
  exports.convertOut = convertOut;
8
10
  exports.convertOutInt = convertOutInt;
9
- exports.translate = exports.customSchemaErrors = void 0;
11
+ exports.customSchemaErrors = void 0;
12
+ exports.getMetadataFromSchema = getMetadataFromSchema;
13
+ exports.translate = void 0;
14
+ var tsplus_module_1 = _interopRequireWildcard(require("@effect/schema/Parser"));
15
+ var tsplus_module_2 = _interopRequireWildcard(require("effect/Either"));
16
+ var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Function"));
17
+ var _schema = require("@effect-app/schema");
10
18
  var _intl = require("@formatjs/intl");
11
19
  var _vue = require("vue");
20
+ var JSONSchema = _interopRequireWildcard(require("@effect/schema/JSONSchema"));
21
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
23
  function convertIn(v, type) {
13
24
  return v === null ? "" : type === "text" ? v : `${v}`;
14
25
  }
@@ -20,6 +31,21 @@ function convertOutInt(v, type) {
20
31
  function convertOut(v, set, type) {
21
32
  return set(convertOutInt(v, type));
22
33
  }
34
+ function buildFieldInfoFromFields(fields) {
35
+ let ast = fields.ast;
36
+ // todo: or look at from?
37
+ if (_schema.AST.isTransform(ast)) {
38
+ if (_schema.AST.isDeclaration(ast.to)) {
39
+ ast = ast.to.type;
40
+ }
41
+ }
42
+ if (!_schema.AST.isTypeLiteral(ast)) throw new Error("not a struct type");
43
+ return ast.propertySignatures.reduce((prev, cur) => {
44
+ ;
45
+ prev[cur.name] = buildFieldInfo(cur);
46
+ return prev;
47
+ }, {});
48
+ }
23
49
  const f = Symbol();
24
50
  class PhantomTypeParameter {}
25
51
  // type GetSchemaFromProp<T> = T extends Field<infer S, any, any, any> ? S
@@ -29,4 +55,126 @@ const defaultIntl = (0, _intl.createIntl)({
29
55
  });
30
56
  const translate = exports.translate = (0, _vue.ref)(defaultIntl.formatMessage.bind(defaultIntl));
31
57
  const customSchemaErrors = exports.customSchemaErrors = (0, _vue.ref)(new Map());
58
+ function buildFieldInfo(property) {
59
+ const propertyKey = property.name;
60
+ const schema = _schema.S.make(property.type);
61
+ const metadata = getMetadataFromSchema(property.type); // TODO
62
+ const parse = tsplus_module_1.parseEither(schema);
63
+ const nullable = _schema.AST.isUnion(property.type) && property.type.types.includes(_schema.S.null.ast);
64
+ const realSelf = nullable && _schema.AST.isUnion(property.type) ? property.type.types.filter(_ => _ !== _schema.S.null.ast)[0] : property.type;
65
+ function renderError(e, v) {
66
+ const err = e.toString();
67
+ const custom = customSchemaErrors.value.get(realSelf);
68
+ return custom ? custom(err, e, v) : translate.value({
69
+ defaultMessage: "The entered value is not a valid {type}: {message}",
70
+ id: "validation.not_a_valid"
71
+ }, {
72
+ type: translate.value({
73
+ defaultMessage: (0, _vue.capitalize)(propertyKey.toString()),
74
+ id: `fieldNames.${String(propertyKey)}`
75
+ }),
76
+ message: metadata.description ? "expected " + metadata.description : err.slice(err.indexOf("Expected")) // TODO: this is not translated.
77
+ });
78
+ }
79
+ const stringRules = [v => v === null || metadata.minLength === undefined || v.length >= metadata.minLength || translate.value({
80
+ defaultMessage: "The field requires at least {minLength} characters",
81
+ id: "validation.string.minLength"
82
+ }, {
83
+ minLength: metadata.minLength
84
+ }), v => v === null || metadata.maxLength === undefined || v.length <= metadata.maxLength || translate.value({
85
+ defaultMessage: "The field cannot have more than {maxLength} characters",
86
+ id: "validation.string.maxLength"
87
+ }, {
88
+ maxLength: metadata.maxLength
89
+ })];
90
+ const numberRules = [v => v === null || metadata.minimum === undefined && metadata.exclusiveMinimum === undefined || metadata.exclusiveMinimum !== undefined && v > metadata.exclusiveMinimum || metadata.minimum !== undefined && v >= metadata.minimum || translate.value({
91
+ defaultMessage: "The value should be {isExclusive, select, true {larger than} other {at least}} {minimum}",
92
+ id: "validation.number.min"
93
+ }, {
94
+ isExclusive: metadata.exclusiveMinimum !== undefined,
95
+ minimum: metadata.exclusiveMinimum ?? metadata.minimum
96
+ }), v => v === null || metadata.maximum === undefined && metadata.exclusiveMaximum === undefined || metadata.exclusiveMaximum !== undefined && v < metadata.exclusiveMaximum || metadata.maximum !== undefined && v <= metadata.maximum || translate.value({
97
+ defaultMessage: "The value should be {isExclusive, select, true {smaller than} other {at most}} {maximum}",
98
+ id: "validation.number.max"
99
+ }, {
100
+ isExclusive: metadata.exclusiveMaximum !== undefined,
101
+ maximum: metadata.exclusiveMaximum ?? metadata.maximum
102
+ })];
103
+ const parseRule = v => tsplus_module_3.pipe(parse(v), _ => tsplus_module_2.match(_, {
104
+ onLeft: _ => renderError(_, v),
105
+ onRight: () => true
106
+ }));
107
+ const rules = [...(metadata.type === "text" ? stringRules : numberRules), parseRule];
108
+ const info = {
109
+ type: metadata.type,
110
+ rules: [v => !metadata.required || v !== "" || translate.value({
111
+ defaultMessage: "The field cannot be empty",
112
+ id: "validation.empty"
113
+ }), v => {
114
+ const converted = convertOutInt(v, metadata.type);
115
+ for (const r of rules) {
116
+ const res = r(converted);
117
+ if (res !== true) {
118
+ return res;
119
+ }
120
+ }
121
+ return true;
122
+ }],
123
+ metadata
124
+ };
125
+ return info;
126
+ }
127
+ const buildFormFromSchema = (s, state, onSubmit) => {
128
+ const fields = buildFieldInfoFromFields(s);
129
+ const parse = tsplus_module_1.decodeSync(s);
130
+ const isDirty = (0, _vue.ref)(false);
131
+ const isValid = (0, _vue.ref)(true);
132
+ const submit1 = onSubmit => async e => {
133
+ const r = await e;
134
+ if (!r.valid) return;
135
+ return onSubmit(parse(state.value));
136
+ };
137
+ const submit = submit1(onSubmit);
138
+ (0, _vue.watch)(state, v => {
139
+ // TODO: do better
140
+ isDirty.value = JSON.stringify(v) !== JSON.stringify(state.value);
141
+ }, {
142
+ deep: true
143
+ });
144
+ const submitFromState = () => submit(Promise.resolve({
145
+ valid: isValid.value
146
+ }));
147
+ return {
148
+ fields,
149
+ submit,
150
+ submitFromState,
151
+ isDirty,
152
+ isValid
153
+ };
154
+ };
155
+ exports.buildFormFromSchema = buildFormFromSchema;
156
+ function getMetadataFromSchema(ast) {
157
+ const nullable = _schema.AST.isUnion(ast) && ast.types.includes(_schema.S.null.ast);
158
+ const realSelf = nullable && _schema.AST.isUnion(ast) ? ast.types.filter(_ => _ !== _schema.S.null.ast)[0] : ast;
159
+ let jschema;
160
+ try {
161
+ jschema = JSONSchema.to(_schema.S.make(realSelf));
162
+ } catch (err) {
163
+ jschema = {};
164
+ console.warn("error getting jsonschema from ", err, ast);
165
+ }
166
+ const isNumber = jschema.type === "number" || jschema.type === "integer";
167
+ const isInt = jschema.type === "integer";
168
+ return {
169
+ type: isInt ? "int" : isNumber ? "float" : "text",
170
+ minimum: jschema.minimum,
171
+ exclusiveMinimum: jschema.exclusiveMinimum,
172
+ maximum: jschema.maximum,
173
+ exclusiveMaximum: jschema.exclusiveMaximum,
174
+ minLength: jschema.minLength,
175
+ maxLength: jschema.maxLength,
176
+ description: jschema.description,
177
+ required: !nullable
178
+ };
179
+ }
32
180
  //# sourceMappingURL=form.cjs.map
package/_cjs/form.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"form.cjs","names":["_intl","require","_vue","convertIn","v","type","convertOutInt","trim","c","parseFloat","parseInt","convertOut","set","f","Symbol","PhantomTypeParameter","defaultIntl","createIntl","locale","translate","exports","ref","formatMessage","bind","customSchemaErrors","Map"],"sources":["../_src/form.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEM,SAAUE,SAASA,CAACC,CAAgB,EAAEC,IAA+B;EACzE,OAAOD,CAAC,KAAK,IAAI,GAAG,EAAE,GAAGC,IAAI,KAAK,MAAM,GAAGD,CAAC,GAAG,GAAGA,CAAC,EAAE;AACvD;AAEM,SAAUE,aAAaA,CAACF,CAAS,EAAEC,IAA+B;EACtED,CAAC,GAAGA,CAAC,IAAI,IAAI,GAAGA,CAAC,GAAGA,CAAC,CAACG,IAAI,EAAE;EAC5B,MAAMC,CAAC,GAAGJ,CAAC,KAAK,EAAE,GAAG,IAAI,GAAGC,IAAI,KAAK,OAAO,GAAGI,UAAU,CAACL,CAAC,CAAC,GAAGC,IAAI,KAAK,KAAK,GAAGK,QAAQ,CAACN,CAAC,CAAC,GAAGA,CAAC;EAC/F,OAAOI,CAAC;AACV;AAEM,SAAUG,UAAUA,CAACP,CAAS,EAAEQ,GAAgC,EAAEP,IAA+B;EACrG,OAAOO,GAAG,CAACN,aAAa,CAACF,CAAC,EAAEC,IAAI,CAAC,CAAC;AACpC;AAyBA,MAAMQ,CAAC,GAAGC,MAAM,EAAE;AAClB,MAAeC,oBAAoB;AAcnC;AACA;AAEA,MAAMC,WAAW,GAAG,IAAAC,gBAAU,EAAC;EAAEC,MAAM,EAAE;AAAI,CAAE,CAAC;AACzC,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,QAAG,EAAkCL,WAAW,CAACM,aAAa,CAACC,IAAI,CAACP,WAAW,CAAC,CAAC;AACnG,MAAMQ,kBAAkB,GAAAJ,OAAA,CAAAI,kBAAA,GAAG,IAAAH,QAAG,EACnC,IAAII,GAAG,EAAE,CACV"}
1
+ {"version":3,"file":"form.cjs","names":["_schema","require","_intl","_vue","JSONSchema","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","convertIn","v","type","convertOutInt","trim","c","parseFloat","parseInt","convertOut","buildFieldInfoFromFields","fields","ast","AST","isTransform","isDeclaration","to","isTypeLiteral","Error","propertySignatures","reduce","prev","cur","name","buildFieldInfo","f","Symbol","PhantomTypeParameter","defaultIntl","createIntl","locale","translate","exports","ref","formatMessage","bind","customSchemaErrors","Map","property","propertyKey","schema","S","make","metadata","getMetadataFromSchema","parse","tsplus_module_1","parseEither","nullable","isUnion","types","includes","null","realSelf","filter","_","renderError","err","toString","custom","value","defaultMessage","id","capitalize","String","message","description","slice","indexOf","stringRules","minLength","undefined","length","maxLength","numberRules","minimum","exclusiveMinimum","isExclusive","maximum","exclusiveMaximum","parseRule","tsplus_module_3","pipe","tsplus_module_2","match","onLeft","onRight","rules","info","required","converted","res","buildFormFromSchema","s","state","onSubmit","decodeSync","isDirty","isValid","submit1","valid","submit","watch","JSON","stringify","deep","submitFromState","Promise","resolve","jschema","console","warn","isNumber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