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

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,486 @@
1
1
  # @effect-app/vue
2
2
 
3
+ ## 0.87.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 640d24a: reference schema2
8
+ - 640d24a: update packages
9
+
10
+ ### Patch Changes
11
+
12
+ - 640d24a: fix exclusive min/max
13
+ - 640d24a: update
14
+ - 640d24a: cleanup schema ext
15
+ - 640d24a: updates
16
+ - 640d24a: update vue
17
+ - 640d24a: f
18
+ - 640d24a: fix error message
19
+ - 640d24a: S
20
+ - 640d24a: mini form
21
+ - 640d24a: update schema
22
+ - 640d24a: improve error
23
+ - 640d24a: form and client fixes
24
+ - 640d24a: update packages
25
+ - 640d24a: reimplement vue form
26
+ - 640d24a: upd
27
+ - 640d24a: use schema fork
28
+ - 640d24a: update packages
29
+ - 640d24a: cleanup errors and use decodeSyc over parseSync
30
+ - 640d24a: d
31
+ - 640d24a: update packages
32
+ - 640d24a: update packages
33
+ - Updated dependencies [640d24a]
34
+ - Updated dependencies [640d24a]
35
+ - Updated dependencies [640d24a]
36
+ - Updated dependencies [640d24a]
37
+ - Updated dependencies [640d24a]
38
+ - Updated dependencies [640d24a]
39
+ - Updated dependencies [640d24a]
40
+ - Updated dependencies [640d24a]
41
+ - Updated dependencies [640d24a]
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
+ - @effect-app/schema@0.150.0
91
+ - @effect-app/vue@0.87.0
92
+ - @effect-app/prelude@0.107.0
93
+ - @effect-app/core@0.97.0
94
+
95
+ ## 0.87.0-next.52
96
+
97
+ ### Patch Changes
98
+
99
+ - d2bc3ac: update schema
100
+ - Updated dependencies [d2bc3ac]
101
+ - @effect-app/prelude@0.107.0-next.45
102
+ - @effect-app/schema@0.150.0-next.30
103
+ - @effect-app/vue@0.87.0-next.52
104
+
105
+ ## 0.87.0-next.51
106
+
107
+ ### Patch Changes
108
+
109
+ - update packages
110
+ - Updated dependencies
111
+ - @effect-app/prelude@0.107.0-next.44
112
+ - @effect-app/schema@0.150.0-next.29
113
+ - @effect-app/core@0.97.0-next.8
114
+ - @effect-app/vue@0.87.0-next.51
115
+
116
+ ## 0.87.0-next.50
117
+
118
+ ### Patch Changes
119
+
120
+ - Updated dependencies [19dc3b1]
121
+ - @effect-app/prelude@0.107.0-next.43
122
+ - @effect-app/schema@0.150.0-next.28
123
+ - @effect-app/vue@0.87.0-next.50
124
+
125
+ ## 0.87.0-next.49
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [09ed839]
130
+ - @effect-app/prelude@0.107.0-next.42
131
+ - @effect-app/vue@0.87.0-next.49
132
+
133
+ ## 0.87.0-next.48
134
+
135
+ ### Patch Changes
136
+
137
+ - b6d4272: update packages
138
+ - Updated dependencies [0bc4207]
139
+ - Updated dependencies [b6d4272]
140
+ - @effect-app/schema@0.150.0-next.27
141
+ - @effect-app/prelude@0.107.0-next.41
142
+ - @effect-app/core@0.97.0-next.7
143
+ - @effect-app/vue@0.87.0-next.48
144
+
145
+ ## 0.87.0-next.47
146
+
147
+ ### Patch Changes
148
+
149
+ - 8a75cac: update vue
150
+ - Updated dependencies [8a75cac]
151
+ - @effect-app/vue@0.87.0-next.47
152
+
153
+ ## 0.87.0-next.46
154
+
155
+ ### Patch Changes
156
+
157
+ - 14b33a9: cleanup errors and use decodeSyc over parseSync
158
+ - Updated dependencies [14b33a9]
159
+ - @effect-app/prelude@0.107.0-next.40
160
+ - @effect-app/schema@0.150.0-next.26
161
+ - @effect-app/vue@0.87.0-next.46
162
+
163
+ ## 0.87.0-next.45
164
+
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies [aa1b654]
168
+ - @effect-app/schema@0.150.0-next.25
169
+ - @effect-app/prelude@0.107.0-next.39
170
+ - @effect-app/vue@0.87.0-next.45
171
+
172
+ ## 0.87.0-next.44
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies [64793a8]
177
+ - @effect-app/prelude@0.107.0-next.38
178
+ - @effect-app/vue@0.87.0-next.44
179
+
180
+ ## 0.87.0-next.43
181
+
182
+ ### Patch Changes
183
+
184
+ - 9e151ed: update packages
185
+ - Updated dependencies [9e151ed]
186
+ - @effect-app/prelude@0.107.0-next.37
187
+ - @effect-app/schema@0.150.0-next.24
188
+ - @effect-app/core@0.97.0-next.6
189
+ - @effect-app/vue@0.87.0-next.43
190
+
191
+ ## 0.87.0-next.42
192
+
193
+ ### Patch Changes
194
+
195
+ - Updated dependencies [6b89c27]
196
+ - @effect-app/core@0.97.0-next.5
197
+ - @effect-app/prelude@0.107.0-next.36
198
+ - @effect-app/schema@0.150.0-next.23
199
+ - @effect-app/vue@0.87.0-next.42
200
+
201
+ ## 0.87.0-next.41
202
+
203
+ ### Patch Changes
204
+
205
+ - Updated dependencies [169c159]
206
+ - @effect-app/prelude@0.107.0-next.35
207
+ - @effect-app/schema@0.150.0-next.22
208
+ - @effect-app/vue@0.87.0-next.41
209
+
210
+ ## 0.87.0-next.40
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [b46e30d]
215
+ - @effect-app/prelude@0.107.0-next.34
216
+ - @effect-app/vue@0.87.0-next.40
217
+
218
+ ## 0.87.0-next.39
219
+
220
+ ### Patch Changes
221
+
222
+ - Updated dependencies [c57bb66]
223
+ - @effect-app/schema@0.150.0-next.21
224
+ - @effect-app/prelude@0.107.0-next.33
225
+ - @effect-app/vue@0.87.0-next.39
226
+
227
+ ## 0.87.0-next.38
228
+
229
+ ### Patch Changes
230
+
231
+ - ce46673: update packages
232
+ - Updated dependencies [735dea9]
233
+ - Updated dependencies [ce46673]
234
+ - @effect-app/prelude@0.107.0-next.32
235
+ - @effect-app/vue@0.87.0-next.38
236
+
237
+ ## 0.87.0-next.37
238
+
239
+ ### Patch Changes
240
+
241
+ - Updated dependencies [21482c6]
242
+ - @effect-app/prelude@0.107.0-next.31
243
+ - @effect-app/vue@0.87.0-next.37
244
+
245
+ ## 0.87.0-next.36
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [eab24be]
250
+ - @effect-app/prelude@0.107.0-next.30
251
+ - @effect-app/vue@0.87.0-next.36
252
+
253
+ ## 0.87.0-next.35
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies [def06a7]
258
+ - @effect-app/prelude@0.107.0-next.29
259
+ - @effect-app/vue@0.87.0-next.35
260
+
261
+ ## 0.87.0-next.34
262
+
263
+ ### Patch Changes
264
+
265
+ - Updated dependencies [eb31797]
266
+ - @effect-app/prelude@0.107.0-next.28
267
+ - @effect-app/vue@0.87.0-next.34
268
+
269
+ ## 0.87.0-next.33
270
+
271
+ ### Patch Changes
272
+
273
+ - Updated dependencies [65696a6]
274
+ - @effect-app/prelude@0.107.0-next.27
275
+ - @effect-app/vue@0.87.0-next.33
276
+
277
+ ## 0.87.0-next.32
278
+
279
+ ### Patch Changes
280
+
281
+ - Updated dependencies [777162f]
282
+ - @effect-app/prelude@0.107.0-next.26
283
+ - @effect-app/schema@0.150.0-next.20
284
+ - @effect-app/vue@0.87.0-next.32
285
+
286
+ ## 0.87.0-next.31
287
+
288
+ ### Patch Changes
289
+
290
+ - Updated dependencies [0776693]
291
+ - @effect-app/prelude@0.107.0-next.25
292
+ - @effect-app/vue@0.87.0-next.31
293
+
294
+ ## 0.87.0-next.30
295
+
296
+ ### Patch Changes
297
+
298
+ - c96bc2f: f
299
+ - Updated dependencies [c96bc2f]
300
+ - @effect-app/vue@0.87.0-next.30
301
+
302
+ ## 0.87.0-next.29
303
+
304
+ ### Patch Changes
305
+
306
+ - 68eaf52: form and client fixes
307
+ - Updated dependencies [68eaf52]
308
+ - @effect-app/prelude@0.107.0-next.24
309
+ - @effect-app/vue@0.87.0-next.29
310
+
311
+ ## 0.87.0-next.28
312
+
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies [ca927a5]
316
+ - @effect-app/schema@0.150.0-next.19
317
+ - @effect-app/prelude@0.107.0-next.23
318
+ - @effect-app/vue@0.87.0-next.28
319
+
320
+ ## 0.87.0-next.27
321
+
322
+ ### Patch Changes
323
+
324
+ - Updated dependencies [5f62f5a]
325
+ - @effect-app/prelude@0.107.0-next.22
326
+ - @effect-app/schema@0.150.0-next.18
327
+ - @effect-app/vue@0.87.0-next.27
328
+
329
+ ## 0.87.0-next.26
330
+
331
+ ### Patch Changes
332
+
333
+ - Updated dependencies [53d4b3e]
334
+ - @effect-app/schema@0.150.0-next.17
335
+ - @effect-app/prelude@0.107.0-next.21
336
+ - @effect-app/vue@0.87.0-next.26
337
+
338
+ ## 0.87.0-next.25
339
+
340
+ ### Patch Changes
341
+
342
+ - Updated dependencies [63d4549]
343
+ - @effect-app/schema@0.150.0-next.16
344
+ - @effect-app/prelude@0.107.0-next.20
345
+ - @effect-app/vue@0.87.0-next.25
346
+
347
+ ## 0.87.0-next.24
348
+
349
+ ### Patch Changes
350
+
351
+ - b19ce70: S
352
+ - Updated dependencies [b19ce70]
353
+ - @effect-app/prelude@0.107.0-next.19
354
+ - @effect-app/vue@0.87.0-next.24
355
+
356
+ ## 0.87.0-next.23
357
+
358
+ ### Patch Changes
359
+
360
+ - Updated dependencies [92ff6b9]
361
+ - @effect-app/prelude@0.107.0-next.18
362
+ - @effect-app/schema@0.150.0-next.15
363
+ - @effect-app/vue@0.87.0-next.23
364
+
365
+ ## 0.87.0-next.22
366
+
367
+ ### Patch Changes
368
+
369
+ - 15e7b7a: d
370
+ - Updated dependencies [15e7b7a]
371
+ - @effect-app/vue@0.87.0-next.22
372
+
373
+ ## 0.87.0-next.21
374
+
375
+ ### Patch Changes
376
+
377
+ - Updated dependencies [c234016]
378
+ - @effect-app/schema@0.150.0-next.14
379
+ - @effect-app/prelude@0.107.0-next.17
380
+ - @effect-app/vue@0.87.0-next.21
381
+
382
+ ## 0.87.0-next.20
383
+
384
+ ### Patch Changes
385
+
386
+ - 5d53b26: fix exclusive min/max
387
+ - Updated dependencies [5d53b26]
388
+ - @effect-app/schema@0.150.0-next.13
389
+ - @effect-app/vue@0.87.0-next.20
390
+ - @effect-app/prelude@0.107.0-next.16
391
+
392
+ ## 0.87.0-next.19
393
+
394
+ ### Patch Changes
395
+
396
+ - fd785c2: improve error
397
+ - Updated dependencies [fd785c2]
398
+ - @effect-app/vue@0.87.0-next.19
399
+
400
+ ## 0.87.0-next.18
401
+
402
+ ### Patch Changes
403
+
404
+ - 99310c3: fix error message
405
+ - Updated dependencies [99310c3]
406
+ - @effect-app/vue@0.87.0-next.18
407
+
408
+ ## 0.87.0-next.17
409
+
410
+ ### Patch Changes
411
+
412
+ - Updated dependencies [147bc14]
413
+ - @effect-app/schema@0.150.0-next.12
414
+ - @effect-app/prelude@0.107.0-next.15
415
+ - @effect-app/vue@0.87.0-next.17
416
+
417
+ ## 0.87.0-next.16
418
+
419
+ ### Patch Changes
420
+
421
+ - 660d57a: upd
422
+ - Updated dependencies [660d57a]
423
+ - @effect-app/schema@0.150.0-next.11
424
+ - @effect-app/vue@0.87.0-next.16
425
+ - @effect-app/prelude@0.107.0-next.14
426
+
427
+ ## 0.87.0-next.15
428
+
429
+ ### Patch Changes
430
+
431
+ - 5f76678: reimplement vue form
432
+ - Updated dependencies [5f76678]
433
+ - @effect-app/vue@0.87.0-next.15
434
+
435
+ ## 0.87.0-next.14
436
+
437
+ ### Patch Changes
438
+
439
+ - 20076e0: update
440
+ - Updated dependencies [20076e0]
441
+ - @effect-app/prelude@0.107.0-next.13
442
+ - @effect-app/schema@0.150.0-next.10
443
+ - @effect-app/vue@0.87.0-next.14
444
+
445
+ ## 0.87.0-next.13
446
+
447
+ ### Patch Changes
448
+
449
+ - Updated dependencies
450
+ - @effect-app/core@0.97.0-next.4
451
+ - @effect-app/prelude@0.107.0-next.12
452
+ - @effect-app/schema@0.150.0-next.9
453
+ - @effect-app/vue@0.87.0-next.13
454
+
455
+ ## 0.87.0-next.12
456
+
457
+ ### Patch Changes
458
+
459
+ - ac35466: use schema fork
460
+ - Updated dependencies [ac35466]
461
+ - @effect-app/prelude@0.107.0-next.11
462
+ - @effect-app/schema@0.150.0-next.8
463
+ - @effect-app/vue@0.87.0-next.12
464
+
465
+ ## 0.87.0-next.11
466
+
467
+ ### Patch Changes
468
+
469
+ - Updated dependencies [4f8ade3]
470
+ - @effect-app/core@0.97.0-next.3
471
+ - @effect-app/prelude@0.107.0-next.10
472
+ - @effect-app/schema@0.150.0-next.7
473
+ - @effect-app/vue@0.87.0-next.11
474
+
475
+ ## 0.87.0-next.10
476
+
477
+ ### Patch Changes
478
+
479
+ - Updated dependencies [8897586]
480
+ - @effect-app/schema@0.150.0-next.6
481
+ - @effect-app/prelude@0.107.0-next.9
482
+ - @effect-app/vue@0.87.0-next.10
483
+
3
484
  ## 0.87.0-next.9
4
485
 
5
486
  ### 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","isInt"],"sources":["../_src/form.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,I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