@ghentcdh/crouton-core 0.0.1-alpha.78 → 0.0.1-alpha.79

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.
Files changed (35) hide show
  1. package/dist/field-input-schemas/array.field-input.schema.json +43 -3
  2. package/dist/field-input-schemas/array.field-input.schema.v1.json +43 -3
  3. package/dist/field-input-schemas/autocomplete.field-input.schema.json +214 -14
  4. package/dist/field-input-schemas/autocomplete.field-input.schema.v1.json +214 -14
  5. package/dist/field-input-schemas/boolean.field-input.schema.json +32 -3
  6. package/dist/field-input-schemas/boolean.field-input.schema.v1.json +32 -3
  7. package/dist/field-input-schemas/custom.field-input.schema.json +32 -3
  8. package/dist/field-input-schemas/custom.field-input.schema.v1.json +32 -3
  9. package/dist/field-input-schemas/date-range.field-input.schema.json +56 -7
  10. package/dist/field-input-schemas/date-range.field-input.schema.v1.json +56 -7
  11. package/dist/field-input-schemas/date.field-input.schema.json +50 -7
  12. package/dist/field-input-schemas/date.field-input.schema.v1.json +50 -7
  13. package/dist/field-input-schemas/markdown.field-input.schema.json +37 -4
  14. package/dist/field-input-schemas/markdown.field-input.schema.v1.json +37 -4
  15. package/dist/field-input-schemas/number.field-input.schema.json +32 -3
  16. package/dist/field-input-schemas/number.field-input.schema.v1.json +32 -3
  17. package/dist/field-input-schemas/relation.field-input.schema.json +55 -6
  18. package/dist/field-input-schemas/relation.field-input.schema.v1.json +55 -6
  19. package/dist/field-input-schemas/select.field-input.schema.json +67 -6
  20. package/dist/field-input-schemas/select.field-input.schema.v1.json +67 -6
  21. package/dist/field-input-schemas/string.field-input.schema.json +56 -3
  22. package/dist/field-input-schemas/string.field-input.schema.v1.json +56 -3
  23. package/dist/field-input-schemas/textarea.field-input.schema.json +32 -3
  24. package/dist/field-input-schemas/textarea.field-input.schema.v1.json +32 -3
  25. package/dist/field-input-schemas/toggle.field-input.schema.json +68 -7
  26. package/dist/field-input-schemas/toggle.field-input.schema.v1.json +68 -7
  27. package/dist/index.cjs +655 -400
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +740 -644
  30. package/dist/index.d.ts +740 -644
  31. package/dist/index.js +643 -392
  32. package/dist/index.js.map +1 -1
  33. package/dist/resource.schema.json +246 -22
  34. package/dist/resource.schema.v1.json +246 -22
  35. package/package.json +1 -1
@@ -4,25 +4,49 @@
4
4
  "properties": {
5
5
  "label": {
6
6
  "description": "Override the field label",
7
+ "examples": [
8
+ "My label"
9
+ ],
7
10
  "type": "string"
8
11
  },
9
12
  "hideLabel": {
10
- "description": "Hide the label",
13
+ "description": "Hide the field label",
11
14
  "type": "boolean"
12
15
  },
13
16
  "placeholder": {
17
+ "description": "Placeholder text shown inside the input when empty",
18
+ "examples": [
19
+ "Search..."
20
+ ],
14
21
  "type": "string"
15
22
  },
16
23
  "readonly": {
24
+ "description": "Render the field in read-only mode",
17
25
  "type": "boolean"
18
26
  },
19
27
  "colspan": {
28
+ "description": "Grid column span (1–12)",
29
+ "examples": [
30
+ 6,
31
+ 12
32
+ ],
20
33
  "type": "number"
21
34
  },
22
35
  "width": {
36
+ "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
37
+ "examples": [
38
+ "md",
39
+ "240px"
40
+ ],
23
41
  "type": "string"
24
42
  },
25
43
  "styles": {
44
+ "description": "Inline CSS style object applied to the field wrapper",
45
+ "examples": [
46
+ {
47
+ "color": "red"
48
+ }
49
+ ],
26
50
  "type": "object",
27
51
  "propertyNames": {
28
52
  "type": "string"
@@ -30,9 +54,18 @@
30
54
  "additionalProperties": {}
31
55
  },
32
56
  "customRender": {
57
+ "description": "Name of a globally registered Vue component to render instead of the default input",
58
+ "examples": [
59
+ "MyCustomInput"
60
+ ],
33
61
  "type": "string"
34
62
  },
35
63
  "layout": {
64
+ "description": "Direction in which array items are stacked",
65
+ "examples": [
66
+ "row",
67
+ "column"
68
+ ],
36
69
  "type": "string",
37
70
  "enum": [
38
71
  "row",
@@ -40,13 +73,20 @@
40
73
  ]
41
74
  },
42
75
  "elementLabelProp": {
76
+ "description": "Property of each array item used as its label in the UI",
77
+ "examples": [
78
+ "name",
79
+ "title"
80
+ ],
43
81
  "type": "string"
44
82
  },
45
83
  "hideActions": {
84
+ "description": "Hide the add/remove action buttons",
46
85
  "type": "boolean"
47
86
  }
48
87
  },
49
88
  "additionalProperties": {},
50
- "$id": "https://ghentcdh.github.io/crouton/schema/v1/array.field-input.schema.json",
51
- "title": "Crouton fieldInput options: array"
89
+ "title": "Crouton fieldInput options: array",
90
+ "description": "Options for the detail/array layout control",
91
+ "$id": "https://ghentcdh.github.io/crouton/schema/v1/array.field-input.schema.json"
52
92
  }
@@ -4,25 +4,49 @@
4
4
  "properties": {
5
5
  "label": {
6
6
  "description": "Override the field label",
7
+ "examples": [
8
+ "My label"
9
+ ],
7
10
  "type": "string"
8
11
  },
9
12
  "hideLabel": {
10
- "description": "Hide the label",
13
+ "description": "Hide the field label",
11
14
  "type": "boolean"
12
15
  },
13
16
  "placeholder": {
17
+ "description": "Placeholder text shown inside the input when empty",
18
+ "examples": [
19
+ "Search..."
20
+ ],
14
21
  "type": "string"
15
22
  },
16
23
  "readonly": {
24
+ "description": "Render the field in read-only mode",
17
25
  "type": "boolean"
18
26
  },
19
27
  "colspan": {
28
+ "description": "Grid column span (1–12)",
29
+ "examples": [
30
+ 6,
31
+ 12
32
+ ],
20
33
  "type": "number"
21
34
  },
22
35
  "width": {
36
+ "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
37
+ "examples": [
38
+ "md",
39
+ "240px"
40
+ ],
23
41
  "type": "string"
24
42
  },
25
43
  "styles": {
44
+ "description": "Inline CSS style object applied to the field wrapper",
45
+ "examples": [
46
+ {
47
+ "color": "red"
48
+ }
49
+ ],
26
50
  "type": "object",
27
51
  "propertyNames": {
28
52
  "type": "string"
@@ -30,9 +54,18 @@
30
54
  "additionalProperties": {}
31
55
  },
32
56
  "customRender": {
57
+ "description": "Name of a globally registered Vue component to render instead of the default input",
58
+ "examples": [
59
+ "MyCustomInput"
60
+ ],
33
61
  "type": "string"
34
62
  },
35
63
  "layout": {
64
+ "description": "Direction in which array items are stacked",
65
+ "examples": [
66
+ "row",
67
+ "column"
68
+ ],
36
69
  "type": "string",
37
70
  "enum": [
38
71
  "row",
@@ -40,13 +73,20 @@
40
73
  ]
41
74
  },
42
75
  "elementLabelProp": {
76
+ "description": "Property of each array item used as its label in the UI",
77
+ "examples": [
78
+ "name",
79
+ "title"
80
+ ],
43
81
  "type": "string"
44
82
  },
45
83
  "hideActions": {
84
+ "description": "Hide the add/remove action buttons",
46
85
  "type": "boolean"
47
86
  }
48
87
  },
49
88
  "additionalProperties": {},
50
- "$id": "https://ghentcdh.github.io/crouton/schema/v1/array.field-input.schema.json",
51
- "title": "Crouton fieldInput options: array"
89
+ "title": "Crouton fieldInput options: array",
90
+ "description": "Options for the detail/array layout control",
91
+ "$id": "https://ghentcdh.github.io/crouton/schema/v1/array.field-input.schema.json"
52
92
  }
@@ -6,25 +6,49 @@
6
6
  "properties": {
7
7
  "label": {
8
8
  "description": "Override the field label",
9
+ "examples": [
10
+ "My label"
11
+ ],
9
12
  "type": "string"
10
13
  },
11
14
  "hideLabel": {
12
- "description": "Hide the label",
15
+ "description": "Hide the field label",
13
16
  "type": "boolean"
14
17
  },
15
18
  "placeholder": {
19
+ "description": "Placeholder text shown inside the input when empty",
20
+ "examples": [
21
+ "Search..."
22
+ ],
16
23
  "type": "string"
17
24
  },
18
25
  "readonly": {
26
+ "description": "Render the field in read-only mode",
19
27
  "type": "boolean"
20
28
  },
21
29
  "colspan": {
30
+ "description": "Grid column span (1–12)",
31
+ "examples": [
32
+ 6,
33
+ 12
34
+ ],
22
35
  "type": "number"
23
36
  },
24
37
  "width": {
38
+ "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
39
+ "examples": [
40
+ "md",
41
+ "240px"
42
+ ],
25
43
  "type": "string"
26
44
  },
27
45
  "styles": {
46
+ "description": "Inline CSS style object applied to the field wrapper",
47
+ "examples": [
48
+ {
49
+ "color": "red"
50
+ }
51
+ ],
28
52
  "type": "object",
29
53
  "propertyNames": {
30
54
  "type": "string"
@@ -32,28 +56,56 @@
32
56
  "additionalProperties": {}
33
57
  },
34
58
  "customRender": {
59
+ "description": "Name of a globally registered Vue component to render instead of the default input",
60
+ "examples": [
61
+ "MyCustomInput"
62
+ ],
35
63
  "type": "string"
36
64
  },
37
65
  "labelKey": {
66
+ "description": "Object key used as the display label in the dropdown",
67
+ "examples": [
68
+ "label",
69
+ "name"
70
+ ],
38
71
  "type": "string"
39
72
  },
40
73
  "valueKey": {
74
+ "description": "Object key used as the stored value",
75
+ "examples": [
76
+ "value",
77
+ "id"
78
+ ],
41
79
  "type": "string"
42
80
  },
43
81
  "freeText": {
82
+ "description": "Allow the user to type a value not in the options list",
44
83
  "type": "boolean"
45
84
  },
46
85
  "enableCreate": {
86
+ "description": "Show a \"create\" action when no matching option is found",
47
87
  "type": "boolean"
48
88
  },
49
89
  "storeValue": {
90
+ "description": "Store option[valueKey] instead of the whole option object",
50
91
  "type": "boolean"
51
92
  },
52
93
  "options": {
53
94
  "type": "array",
54
- "items": {}
95
+ "items": {},
96
+ "description": "Inline array of option items",
97
+ "examples": [
98
+ [
99
+ {
100
+ "label": "Active",
101
+ "value": "active"
102
+ }
103
+ ]
104
+ ]
55
105
  },
56
106
  "values": {
107
+ "description": "Alias for options (deprecated — prefer options)",
108
+ "deprecated": true,
57
109
  "type": "array",
58
110
  "items": {}
59
111
  }
@@ -61,32 +113,58 @@
61
113
  "required": [
62
114
  "options"
63
115
  ],
64
- "additionalProperties": {}
116
+ "additionalProperties": {},
117
+ "title": "Inline autocomplete",
118
+ "description": "Options provided as an inline array"
65
119
  },
66
120
  {
67
121
  "type": "object",
68
122
  "properties": {
69
123
  "label": {
70
124
  "description": "Override the field label",
125
+ "examples": [
126
+ "My label"
127
+ ],
71
128
  "type": "string"
72
129
  },
73
130
  "hideLabel": {
74
- "description": "Hide the label",
131
+ "description": "Hide the field label",
75
132
  "type": "boolean"
76
133
  },
77
134
  "placeholder": {
135
+ "description": "Placeholder text shown inside the input when empty",
136
+ "examples": [
137
+ "Search..."
138
+ ],
78
139
  "type": "string"
79
140
  },
80
141
  "readonly": {
142
+ "description": "Render the field in read-only mode",
81
143
  "type": "boolean"
82
144
  },
83
145
  "colspan": {
146
+ "description": "Grid column span (1–12)",
147
+ "examples": [
148
+ 6,
149
+ 12
150
+ ],
84
151
  "type": "number"
85
152
  },
86
153
  "width": {
154
+ "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
155
+ "examples": [
156
+ "md",
157
+ "240px"
158
+ ],
87
159
  "type": "string"
88
160
  },
89
161
  "styles": {
162
+ "description": "Inline CSS style object applied to the field wrapper",
163
+ "examples": [
164
+ {
165
+ "color": "red"
166
+ }
167
+ ],
90
168
  "type": "object",
91
169
  "propertyNames": {
92
170
  "type": "string"
@@ -94,64 +172,115 @@
94
172
  "additionalProperties": {}
95
173
  },
96
174
  "customRender": {
175
+ "description": "Name of a globally registered Vue component to render instead of the default input",
176
+ "examples": [
177
+ "MyCustomInput"
178
+ ],
97
179
  "type": "string"
98
180
  },
99
181
  "labelKey": {
182
+ "description": "Object key used as the display label in the dropdown",
183
+ "examples": [
184
+ "label",
185
+ "name"
186
+ ],
100
187
  "type": "string"
101
188
  },
102
189
  "valueKey": {
190
+ "description": "Object key used as the stored value",
191
+ "examples": [
192
+ "value",
193
+ "id"
194
+ ],
103
195
  "type": "string"
104
196
  },
105
197
  "freeText": {
198
+ "description": "Allow the user to type a value not in the options list",
106
199
  "type": "boolean"
107
200
  },
108
201
  "enableCreate": {
202
+ "description": "Show a \"create\" action when no matching option is found",
109
203
  "type": "boolean"
110
204
  },
111
205
  "storeValue": {
206
+ "description": "Store option[valueKey] instead of the whole option object",
112
207
  "type": "boolean"
113
208
  },
114
209
  "uri": {
115
210
  "type": "string",
116
- "description": "Remote endpoint URL"
211
+ "description": "Remote endpoint URL that returns option items",
212
+ "examples": [
213
+ "/api/authors"
214
+ ]
117
215
  },
118
216
  "dataField": {
119
- "description": "Field in response containing the data array",
217
+ "description": "Field in the API response containing the data array",
218
+ "examples": [
219
+ "data",
220
+ "results"
221
+ ],
120
222
  "type": "string"
121
223
  },
122
224
  "skipAuth": {
225
+ "description": "Send the request without authentication headers",
123
226
  "type": "boolean"
124
227
  }
125
228
  },
126
229
  "required": [
127
230
  "uri"
128
231
  ],
129
- "additionalProperties": {}
232
+ "additionalProperties": {},
233
+ "title": "Remote autocomplete",
234
+ "description": "Options fetched from a remote endpoint"
130
235
  },
131
236
  {
132
237
  "type": "object",
133
238
  "properties": {
134
239
  "label": {
135
240
  "description": "Override the field label",
241
+ "examples": [
242
+ "My label"
243
+ ],
136
244
  "type": "string"
137
245
  },
138
246
  "hideLabel": {
139
- "description": "Hide the label",
247
+ "description": "Hide the field label",
140
248
  "type": "boolean"
141
249
  },
142
250
  "placeholder": {
251
+ "description": "Placeholder text shown inside the input when empty",
252
+ "examples": [
253
+ "Search..."
254
+ ],
143
255
  "type": "string"
144
256
  },
145
257
  "readonly": {
258
+ "description": "Render the field in read-only mode",
146
259
  "type": "boolean"
147
260
  },
148
261
  "colspan": {
262
+ "description": "Grid column span (1–12)",
263
+ "examples": [
264
+ 6,
265
+ 12
266
+ ],
149
267
  "type": "number"
150
268
  },
151
269
  "width": {
270
+ "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
271
+ "examples": [
272
+ "md",
273
+ "240px"
274
+ ],
152
275
  "type": "string"
153
276
  },
154
277
  "styles": {
278
+ "description": "Inline CSS style object applied to the field wrapper",
279
+ "examples": [
280
+ {
281
+ "color": "red"
282
+ }
283
+ ],
155
284
  "type": "object",
156
285
  "propertyNames": {
157
286
  "type": "string"
@@ -159,63 +288,115 @@
159
288
  "additionalProperties": {}
160
289
  },
161
290
  "customRender": {
291
+ "description": "Name of a globally registered Vue component to render instead of the default input",
292
+ "examples": [
293
+ "MyCustomInput"
294
+ ],
162
295
  "type": "string"
163
296
  },
164
297
  "labelKey": {
298
+ "description": "Object key used as the display label in the dropdown",
299
+ "examples": [
300
+ "label",
301
+ "name"
302
+ ],
165
303
  "type": "string"
166
304
  },
167
305
  "valueKey": {
306
+ "description": "Object key used as the stored value",
307
+ "examples": [
308
+ "value",
309
+ "id"
310
+ ],
168
311
  "type": "string"
169
312
  },
170
313
  "freeText": {
314
+ "description": "Allow the user to type a value not in the options list",
171
315
  "type": "boolean"
172
316
  },
173
317
  "enableCreate": {
318
+ "description": "Show a \"create\" action when no matching option is found",
174
319
  "type": "boolean"
175
320
  },
176
321
  "storeValue": {
322
+ "description": "Store option[valueKey] instead of the whole option object",
177
323
  "type": "boolean"
178
324
  },
179
325
  "resource": {
180
326
  "type": "string",
181
- "description": "Relative path to a resource.json"
327
+ "description": "Relative path to a resource.json used to populate the options",
328
+ "examples": [
329
+ "./author.resource.json"
330
+ ]
182
331
  },
183
332
  "skipAuth": {
333
+ "description": "Send the request without authentication headers",
184
334
  "type": "boolean"
185
335
  },
186
336
  "dataField": {
337
+ "description": "Field in the API response containing the data array",
338
+ "examples": [
339
+ "data",
340
+ "results"
341
+ ],
187
342
  "type": "string"
188
343
  }
189
344
  },
190
345
  "required": [
191
346
  "resource"
192
347
  ],
193
- "additionalProperties": {}
348
+ "additionalProperties": {},
349
+ "title": "Resource autocomplete",
350
+ "description": "Options populated from a crouton resource"
194
351
  },
195
352
  {
196
353
  "type": "object",
197
354
  "properties": {
198
355
  "label": {
199
356
  "description": "Override the field label",
357
+ "examples": [
358
+ "My label"
359
+ ],
200
360
  "type": "string"
201
361
  },
202
362
  "hideLabel": {
203
- "description": "Hide the label",
363
+ "description": "Hide the field label",
204
364
  "type": "boolean"
205
365
  },
206
366
  "placeholder": {
367
+ "description": "Placeholder text shown inside the input when empty",
368
+ "examples": [
369
+ "Search..."
370
+ ],
207
371
  "type": "string"
208
372
  },
209
373
  "readonly": {
374
+ "description": "Render the field in read-only mode",
210
375
  "type": "boolean"
211
376
  },
212
377
  "colspan": {
378
+ "description": "Grid column span (1–12)",
379
+ "examples": [
380
+ 6,
381
+ 12
382
+ ],
213
383
  "type": "number"
214
384
  },
215
385
  "width": {
386
+ "description": "Named width (xs, sm, md, lg, xl, full) or any CSS value",
387
+ "examples": [
388
+ "md",
389
+ "240px"
390
+ ],
216
391
  "type": "string"
217
392
  },
218
393
  "styles": {
394
+ "description": "Inline CSS style object applied to the field wrapper",
395
+ "examples": [
396
+ {
397
+ "color": "red"
398
+ }
399
+ ],
219
400
  "type": "object",
220
401
  "propertyNames": {
221
402
  "type": "string"
@@ -223,28 +404,47 @@
223
404
  "additionalProperties": {}
224
405
  },
225
406
  "customRender": {
407
+ "description": "Name of a globally registered Vue component to render instead of the default input",
408
+ "examples": [
409
+ "MyCustomInput"
410
+ ],
226
411
  "type": "string"
227
412
  },
228
413
  "labelKey": {
414
+ "description": "Object key used as the display label in the dropdown",
415
+ "examples": [
416
+ "label",
417
+ "name"
418
+ ],
229
419
  "type": "string"
230
420
  },
231
421
  "valueKey": {
422
+ "description": "Object key used as the stored value",
423
+ "examples": [
424
+ "value",
425
+ "id"
426
+ ],
232
427
  "type": "string"
233
428
  },
234
429
  "freeText": {
430
+ "description": "Allow the user to type a value not in the options list",
235
431
  "type": "boolean"
236
432
  },
237
433
  "enableCreate": {
434
+ "description": "Show a \"create\" action when no matching option is found",
238
435
  "type": "boolean"
239
436
  },
240
437
  "storeValue": {
438
+ "description": "Store option[valueKey] instead of the whole option object",
241
439
  "type": "boolean"
242
440
  }
243
441
  },
244
- "additionalProperties": {}
442
+ "additionalProperties": {},
443
+ "title": "Common autocomplete options",
444
+ "description": "Shared options available on all autocomplete variants"
245
445
  }
246
446
  ],
447
+ "title": "Crouton fieldInput options: autocomplete",
247
448
  "description": "Autocomplete options: inline array, remote URI, or resource reference",
248
- "$id": "https://ghentcdh.github.io/crouton/schema/v1/autocomplete.field-input.schema.json",
249
- "title": "Crouton fieldInput options: autocomplete"
449
+ "$id": "https://ghentcdh.github.io/crouton/schema/v1/autocomplete.field-input.schema.json"
250
450
  }