@json-layout/core 0.1.0 → 0.3.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.
@@ -1,4 +1,4 @@
1
- import { isSwitchStruct, childIsCompObject, isCompositeLayout } from '@json-layout/vocabulary'
1
+ import { isSwitchStruct, childIsCompObject, isCompositeLayout, isFocusableLayout } from '@json-layout/vocabulary'
2
2
  import { produce } from 'immer'
3
3
  import { getChildDisplay } from './utils/display.js'
4
4
  import { shallowCompareArrays } from './utils/immutable.js'
@@ -10,18 +10,25 @@ import { shallowCompareArrays } from './utils/immutable.js'
10
10
  const isDataEmpty = (data) => {
11
11
  if (data === '' || data === undefined) return true
12
12
  if (Array.isArray(data) && !data.length) return true
13
- if (typeof data === 'object' && !Array.isArray(data) && !!data && Object.values(data).findIndex(prop => !isDataEmpty(prop)) === -1) return true
13
+ if (typeof data === 'object' && !Array.isArray(data) && !!data && Object.values(data).findIndex(prop => prop !== undefined) === -1) return true
14
14
  return false
15
15
  }
16
16
 
17
- // use Immer for efficient updating with immutability and no-op detection
18
- /** @type {(draft: import('./types.js').StateNode, key: string | number, fullKey: string, parentFullKey: string | null, dataPath: string, parentDataPath: string | null, skeleton: import('../index.js').SkeletonNode, layout: import('@json-layout/vocabulary').CompObject, cols: number, data: unknown, error: string | undefined, validated: boolean, options: import('./types.js').StatefulLayoutOptions, children: import('../index.js').StateNode[] | undefined) => import('../index.js').StateNode} */
19
- const produceStateNode = produce((draft, key, fullKey, parentFullKey, dataPath, parentDataPath, skeleton, layout, cols, data, error, validated, options, children) => {
20
- data = children && layout.comp !== 'list' ? produceStateNodeData(/** @type {Record<string, unknown>} */(data ?? {}), dataPath, children) : data
21
- // empty data is removed and replaced by the default data
22
- if (isDataEmpty(data) && skeleton.defaultData === undefined) data = undefined
23
- data = skeleton.const ?? data ?? skeleton.defaultData
17
+ /**
18
+ * @param {unknown} data
19
+ * @param {import('@json-layout/vocabulary').CompObject} layout
20
+ * @param {import('./types.js').StatefulLayoutOptions} options
21
+ * @returns {boolean}
22
+ */
23
+ const useDefaultData = (data, layout, options) => {
24
+ if (options.defaultOn === 'missing' && data === undefined) return true
25
+ if (options.defaultOn === 'empty' && isDataEmpty(data)) return true
26
+ return false
27
+ }
24
28
 
29
+ // use Immer for efficient updating with immutability and no-op detection
30
+ /** @type {(draft: import('./types.js').StateNode, key: string | number, fullKey: string, parentFullKey: string | null, dataPath: string, parentDataPath: string | null, skeleton: import('../index.js').SkeletonNode, layout: import('@json-layout/vocabulary').CompObject, cols: number, data: unknown, error: string | undefined, validated: boolean, options: import('./types.js').StatefulLayoutOptions, autofocus: boolean, children: import('../index.js').StateNode[] | undefined) => import('../index.js').StateNode} */
31
+ const produceStateNode = produce((draft, key, fullKey, parentFullKey, dataPath, parentDataPath, skeleton, layout, cols, data, error, validated, options, autofocus, children) => {
25
32
  draft.messages = layout.messages ? produceStateNodeMessages(draft.messages || {}, layout.messages, options) : options.messages
26
33
 
27
34
  draft.key = key
@@ -37,6 +44,16 @@ const produceStateNode = produce((draft, key, fullKey, parentFullKey, dataPath,
37
44
  draft.error = error
38
45
  draft.childError = children && (children.findIndex(c => c.error || c.childError) !== -1)
39
46
  draft.validated = validated
47
+ if (autofocus) {
48
+ draft.autofocus = true
49
+ delete draft.autofocusChild
50
+ } else {
51
+ delete draft.autofocus
52
+ const autofocusChild = children?.find(c => c.autofocus)
53
+ if (autofocusChild) draft.autofocusChild = autofocusChild.key
54
+ else delete draft.autofocusChild
55
+ }
56
+
40
57
  draft.children = children
41
58
  })
42
59
 
@@ -125,7 +142,7 @@ export function evalExpression (expressions, expression, data, options, display)
125
142
  if (expression.ref === undefined) throw new Error('expression was not compiled : ' + JSON.stringify(expression))
126
143
  const compiledExpression = expressions[expression.ref]
127
144
  // console.log(expression.expr, context, mode, display)
128
- return compiledExpression(data, options, display)
145
+ return compiledExpression(data, options, options.context, display)
129
146
  }
130
147
 
131
148
  /**
@@ -192,35 +209,47 @@ export function createStateNode (
192
209
  const options = produceNodeOptions(
193
210
  reusedNode?.options ?? /** @type {import('./types.js').StatefulLayoutOptions} */({}),
194
211
  parentOptions,
195
- layout.options, display.width
212
+ layout.options,
213
+ display.width
196
214
  )
197
215
 
216
+ if (context.initial && parentOptions.autofocus && layout.autofocus) {
217
+ context.autofocusTarget = fullKey
218
+ }
219
+
198
220
  /** @type {import('./types.js').StateNode[] | undefined} */
199
221
  let children
200
222
  if (isCompositeLayout(layout)) {
201
223
  // TODO: make this type casting safe using prior validation
202
224
  const objectData = /** @type {Record<string, unknown>} */(data ?? {})
203
225
  const childrenOptions = produceCompositeChildrenOptions(options, layout)
204
- children = layout.children.map((child, i) => {
205
- const childSkeleton = skeleton.children?.find(c => c.key === child.key) ?? skeleton
206
- const isSameData = typeof child.key === 'string' && child.key.startsWith('$')
207
- return createStateNode(
226
+ children = []
227
+ let focusChild = context.autofocusTarget === fullKey
228
+ for (let i = 0; i < layout.children.length; i++) {
229
+ const childLayout = layout.children[i]
230
+ const childSkeleton = skeleton.children?.find(c => c.key === childLayout.key) ?? skeleton
231
+ const isSameData = typeof childLayout.key === 'string' && childLayout.key.startsWith('$')
232
+ const childFullKey = `${fullKey}/${childLayout.key}`
233
+ if (focusChild) context.autofocusTarget = childFullKey
234
+ const child = createStateNode(
208
235
  context,
209
236
  childrenOptions,
210
237
  compiledLayout,
211
- child.key,
212
- `${fullKey}/${child.key}`,
238
+ childLayout.key,
239
+ childFullKey,
213
240
  fullKey,
214
- isSameData ? dataPath : `${dataPath}/${child.key}`,
241
+ isSameData ? dataPath : `${dataPath}/${childLayout.key}`,
215
242
  dataPath,
216
243
  childSkeleton,
217
- child,
244
+ childLayout,
218
245
  display,
219
- isSameData ? objectData : objectData[child.key],
246
+ isSameData ? objectData : objectData[childLayout.key],
220
247
  validationState,
221
248
  reusedNode?.children?.[i]
222
249
  )
223
- })
250
+ if (child.autofocus || child.autofocusChild !== undefined) focusChild = false
251
+ children.push(child)
252
+ }
224
253
  }
225
254
 
226
255
  if (key === '$oneOf' && skeleton.childrenTrees) {
@@ -229,6 +258,8 @@ export function createStateNode (
229
258
  const activeChildTreeIndex = fullKey in context.activeItems ? context.activeItems[fullKey] : skeleton.childrenTrees?.findIndex((childTree) => compiledLayout.validates[childTree.root.pointer](data))
230
259
  if (activeChildTreeIndex !== -1) {
231
260
  context.activeItems[fullKey] = activeChildTreeIndex
261
+ const activeChildKey = `${fullKey}/${activeChildTreeIndex}`
262
+ if (context.autofocusTarget === fullKey) context.autofocusTarget = activeChildKey
232
263
  const activeChildTree = skeleton.childrenTrees[activeChildTreeIndex]
233
264
  children = [
234
265
  createStateNode(
@@ -236,7 +267,7 @@ export function createStateNode (
236
267
  options,
237
268
  compiledLayout,
238
269
  activeChildTreeIndex,
239
- `${fullKey}/${activeChildTreeIndex}`,
270
+ activeChildKey,
240
271
  fullKey,
241
272
  dataPath,
242
273
  dataPath,
@@ -255,9 +286,13 @@ export function createStateNode (
255
286
  const arrayData = /** @type {unknown[]} */(data ?? [])
256
287
  const childSkeleton = /** @type {import('../index.js').SkeletonNode} */(skeleton?.childrenTrees?.[0]?.root)
257
288
  const listItemOptions = layout.listEditMode === 'inline' ? options : produceReadonlyArrayItemOptions(options)
258
- children = arrayData.map((itemData, i) => {
289
+ children = []
290
+ let focusChild = context.autofocusTarget === fullKey
291
+ for (let i = 0; i < arrayData.length; i++) {
292
+ const itemData = arrayData[i]
259
293
  const childFullKey = `${fullKey}/${i}`
260
- return createStateNode(
294
+ if (focusChild) context.autofocusTarget = childFullKey
295
+ const child = createStateNode(
261
296
  context,
262
297
  (layout.listEditMode === 'inline-single' && context.activeItems[fullKey] === i) ? options : listItemOptions,
263
298
  compiledLayout,
@@ -273,7 +308,9 @@ export function createStateNode (
273
308
  validationState,
274
309
  reusedNode?.children?.[0]
275
310
  )
276
- })
311
+ if (child.autofocus || child.autofocusChild !== undefined) focusChild = false
312
+ children.push(child)
313
+ }
277
314
  }
278
315
 
279
316
  const error = context.errors?.find(error => matchError(error, skeleton, dataPath, parentDataPath)) ?? context.errors?.find(error => matchChildError(error, skeleton, dataPath))
@@ -286,6 +323,29 @@ export function createStateNode (
286
323
  (validationState.initialized === false && options.initialValidation === 'always') ||
287
324
  (validationState.initialized === false && options.initialValidation === 'withData' && !isDataEmpty(data))
288
325
 
326
+ let nodeData = children ? produceStateNodeData(/** @type {Record<string, unknown>} */(data ?? {}), dataPath, children) : data
327
+ if (layout.constData) {
328
+ nodeData = evalExpression(compiledLayout.expressions, layout.constData, nodeData, options, display)
329
+ } else {
330
+ if (layout.defaultData && useDefaultData(nodeData, layout, options)) {
331
+ nodeData = evalExpression(compiledLayout.expressions, layout.defaultData, nodeData, options, display)
332
+ } else {
333
+ if (isDataEmpty(nodeData)) {
334
+ if (layout.nullable) {
335
+ // if a property is nullable empty values are converted to null
336
+ // except for undefined if we need to distinguish between empty and missing data
337
+ if (options.defaultOn !== 'missing' || nodeData !== undefined) {
338
+ nodeData = null
339
+ }
340
+ } else if (options.defaultOn !== 'missing') {
341
+ // remove empty data, except if we need to distinguish between empty and missing data
342
+ nodeData = undefined
343
+ }
344
+ }
345
+ }
346
+ }
347
+
348
+ const autofocus = isFocusableLayout(layout) && !options.readOnly && !options.summary && context.autofocusTarget === fullKey
289
349
  const node = produceStateNode(
290
350
  reusedNode ?? /** @type {import('./types.js').StateNode} */({}),
291
351
  key,
@@ -296,10 +356,11 @@ export function createStateNode (
296
356
  skeleton,
297
357
  layout,
298
358
  cols,
299
- data,
359
+ nodeData,
300
360
  error?.message,
301
361
  validated,
302
362
  options,
363
+ autofocus,
303
364
  children && shallowCompareArrays(reusedNode?.children, children)
304
365
  )
305
366
  context.nodes.push(node)
@@ -313,5 +374,4 @@ export const producePatchedData = produce((draft, node, data) => {
313
374
  } else {
314
375
  draft[node.key] = data
315
376
  }
316
- }
317
- )
377
+ })
@@ -15,7 +15,7 @@ const produceStateTree = produce(
15
15
  * @param {import('../index.js').CompiledLayout} compiledLayout
16
16
  * @param {import('../index.js').SkeletonTree} skeleton
17
17
  * @param {import('./utils/display.js').Display} display
18
- * @param {unknown} value
18
+ * @param {unknown} data
19
19
  * @param {import('./types.js').ValidationState} validationState
20
20
  * @param {import('./types.js').StateTree} [reusedStateTree]
21
21
  * @returns {import('./types.js').StateTree}
@@ -26,12 +26,12 @@ export function createStateTree (
26
26
  compiledLayout,
27
27
  skeleton,
28
28
  display,
29
- value,
29
+ data,
30
30
  validationState,
31
31
  reusedStateTree
32
32
  ) {
33
33
  const validate = compiledLayout.validates[skeleton.root.pointer]
34
- const valid = validate(value)
34
+ const valid = validate(data)
35
35
  if (validate.errors) {
36
36
  for (const error of validate.errors) {
37
37
  if (error.keyword !== 'errorMessage') compiledLayout.localizeErrors([error])
@@ -50,7 +50,7 @@ export function createStateTree (
50
50
  skeleton.root,
51
51
  null,
52
52
  display,
53
- value,
53
+ data,
54
54
  validationState,
55
55
  reusedStateTree?.root
56
56
  )
@@ -1,5 +1,29 @@
1
1
  import { type ErrorObject } from 'ajv'
2
- import { type CompObject, type Cols, type StateNodeOptions, type TextField, type Textarea, type NumberField, type Slider, type Checkbox, type Switch, type DatePicker, type DateTimePicker, type TimePicker, type ColorPicker, type Section, type OneOfSelect, type Select, type Tabs, type VerticalTabs, type ExpansionPanels, type List } from '@json-layout/vocabulary'
2
+ import {
3
+ type CompObject,
4
+ type Cols,
5
+ type StateNodeOptions,
6
+ type TextField,
7
+ type Textarea,
8
+ type NumberField,
9
+ type Slider,
10
+ type Checkbox,
11
+ type Switch,
12
+ type DatePicker,
13
+ type DateTimePicker,
14
+ type TimePicker,
15
+ type ColorPicker,
16
+ type Section,
17
+ type OneOfSelect,
18
+ type Select,
19
+ type Autocomplete,
20
+ type Tabs,
21
+ type VerticalTabs,
22
+ type ExpansionPanels,
23
+ type Stepper,
24
+ type List,
25
+ type Combobox
26
+ } from '@json-layout/vocabulary'
3
27
  import { type SkeletonTree, type SkeletonNode, type StatefulLayout } from '../index.js'
4
28
  import { type LocaleMessages } from '../i18n/types.js'
5
29
 
@@ -18,6 +42,8 @@ export interface StateNode {
18
42
  validated: boolean
19
43
  options: StatefulLayoutOptions
20
44
  messages: LocaleMessages
45
+ autofocus?: boolean
46
+ autofocusChild?: string | number
21
47
  children?: StateNode[]
22
48
  }
23
49
 
@@ -31,6 +57,8 @@ export interface CreateStateTreeContext {
31
57
  errors?: ErrorObject[]
32
58
  nodes: StateNode[]
33
59
  activeItems: Record<string, number>
60
+ autofocusTarget: string | null
61
+ initial: boolean
34
62
  }
35
63
 
36
64
  export interface ValidationState {
@@ -44,6 +72,7 @@ export type StatefulLayoutEvents = {
44
72
  // input: { value: unknown, child: { pointer: string, dataPointer: string, value: unknown } }
45
73
  input: unknown
46
74
  'update': StatefulLayout
75
+ autofocus: string
47
76
  }
48
77
 
49
78
  export type StatefulLayoutOptions = Required<StateNodeOptions> & {
@@ -51,7 +80,9 @@ export type StatefulLayoutOptions = Required<StateNodeOptions> & {
51
80
  width: number
52
81
  validateOn: 'input' | 'blur' | 'submit'
53
82
  initialValidation: 'never' | 'always' | 'withData'
83
+ defaultOn: 'missing' | 'empty' | 'never'
54
84
  messages: LocaleMessages
85
+ autofocus: boolean
55
86
  }
56
87
 
57
88
  export type TextFieldNode = Omit<StateNode, 'children'> & { layout: TextField, data: string | undefined | null }
@@ -80,10 +111,16 @@ export type OneOfSelectNode = StateNode & { layout: OneOfSelect, data: Record<st
80
111
 
81
112
  export type SelectNode = Omit<StateNode, 'children'> & { layout: Select, data: any }
82
113
 
114
+ export type AutocompleteNode = Omit<StateNode, 'children'> & { layout: Autocomplete, data: any }
115
+
83
116
  export type TabsNode = StateNode & { layout: Tabs, children: StateNode[] }
84
117
 
85
118
  export type VerticalTabsNode = StateNode & { layout: VerticalTabs, children: StateNode[] }
86
119
 
87
120
  export type ExpansionPanelsNode = StateNode & { layout: ExpansionPanels, children: StateNode[] }
88
121
 
122
+ export type StepperNode = StateNode & { layout: Stepper, children: StateNode[] }
123
+
89
124
  export type ListNode = StateNode & { layout: List, data: any[], children: StateNode[], childrenTrees: SkeletonTree[] }
125
+
126
+ export type ComboboxNode = Omit<StateNode, 'children'> & { layout: Combobox, data: any[] }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AAsEA;;;;GAIG;AACH,iCAJW,MAAM,4EAEJ,cAAc,CA8D1B;;2BAvHY,OAAO,YAAY,EAAE,YAAY;2BACjC,OAAO,YAAY,EAAE,YAAY;6BACjC,OAAO,YAAY,EAAE,cAAc;6BACnC,OAAO,YAAY,EAAE,cAAc;oCACnC,OAAO,YAAY,EAAE,qBAAqB;iCAC1C,OAAO,YAAY,EAAE,kBAAkB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AAsEA;;;;GAIG;AACH,iCAJW,MAAM,4EAEJ,cAAc,CA0E1B;;2BAnIY,OAAO,YAAY,EAAE,YAAY;2BACjC,OAAO,YAAY,EAAE,YAAY;6BACjC,OAAO,YAAY,EAAE,cAAc;6BACnC,OAAO,YAAY,EAAE,cAAc;oCACnC,OAAO,YAAY,EAAE,qBAAqB;iCAC1C,OAAO,YAAY,EAAE,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/compile/serialize.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,0CAHW,OAAO,YAAY,EAAE,cAAc,GACjC,MAAM,CAmElB"}
1
+ {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/compile/serialize.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,0CAHW,OAAO,YAAY,EAAE,cAAc,GACjC,MAAM,CAoElB"}
@@ -2,6 +2,7 @@
2
2
  * @param {any} schema
3
3
  * @param {import('./index.js').CompileOptions} options
4
4
  * @param {string[]} validates
5
+ * @param {Record<string, string[]>} validationErrors
5
6
  * @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
6
7
  * @param {import('@json-layout/vocabulary').Expression[]} expressions
7
8
  * @param {string | number} key
@@ -10,5 +11,5 @@
10
11
  * @param {boolean} required
11
12
  * @returns {import('./types.js').SkeletonNode}
12
13
  */
13
- export function makeSkeletonNode(schema: any, options: import('./index.js').CompileOptions, validates: string[], normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], key: string | number, pointer: string, parentPointer: string | null, required: boolean): import('./types.js').SkeletonNode;
14
+ export function makeSkeletonNode(schema: any, options: import('./index.js').CompileOptions, validates: string[], validationErrors: Record<string, string[]>, normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], key: string | number, pointer: string, parentPointer: string | null, required: boolean): import('./types.js').SkeletonNode;
14
15
  //# sourceMappingURL=skeleton-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton-node.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-node.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;GAWG;AACH,yCAXW,GAAG,WACH,OAAO,YAAY,EAAE,cAAc,aACnC,MAAM,EAAE,qBACR,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAC,eAClE,OAAO,yBAAyB,EAAE,UAAU,EAAE,OAC9C,MAAM,GAAG,MAAM,WACf,MAAM,iBACN,MAAM,GAAG,IAAI,YACb,OAAO,GACL,OAAO,YAAY,EAAE,YAAY,CAqI7C"}
1
+ {"version":3,"file":"skeleton-node.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-node.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,yCAZW,GAAG,WACH,OAAO,YAAY,EAAE,cAAc,aACnC,MAAM,EAAE,oBACR,OAAO,MAAM,EAAE,MAAM,EAAE,CAAC,qBACxB,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAC,eAClE,OAAO,yBAAyB,EAAE,UAAU,EAAE,OAC9C,MAAM,GAAG,MAAM,WACf,MAAM,iBACN,MAAM,GAAG,IAAI,YACb,OAAO,GACL,OAAO,YAAY,EAAE,YAAY,CAmK7C"}
@@ -2,11 +2,12 @@
2
2
  * @param {any} schema
3
3
  * @param {import('./index.js').CompileOptions} options
4
4
  * @param {string[]} validates
5
+ * @param {Record<string, string[]>} validationErrors
5
6
  * @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
6
7
  * @param {import('@json-layout/vocabulary').Expression[]} expressions
7
8
  * @param {string} pointer
8
9
  * @param {string} title
9
10
  * @returns {import('./types.js').SkeletonTree}
10
11
  */
11
- export function makeSkeletonTree(schema: any, options: import('./index.js').CompileOptions, validates: string[], normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], pointer: string, title: string): import('./types.js').SkeletonTree;
12
+ export function makeSkeletonTree(schema: any, options: import('./index.js').CompileOptions, validates: string[], validationErrors: Record<string, string[]>, normalizedLayouts: Record<string, import('@json-layout/vocabulary').NormalizedLayout>, expressions: import('@json-layout/vocabulary').Expression[], pointer: string, title: string): import('./types.js').SkeletonTree;
12
13
  //# sourceMappingURL=skeleton-tree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton-tree.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-tree.js"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,yCATW,GAAG,WACH,OAAO,YAAY,EAAE,cAAc,aACnC,MAAM,EAAE,qBACR,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAC,eAClE,OAAO,yBAAyB,EAAE,UAAU,EAAE,WAC9C,MAAM,SACN,MAAM,GACJ,OAAO,YAAY,EAAE,YAAY,CAc7C"}
1
+ {"version":3,"file":"skeleton-tree.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-tree.js"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,yCAVW,GAAG,WACH,OAAO,YAAY,EAAE,cAAc,aACnC,MAAM,EAAE,oBACR,OAAO,MAAM,EAAE,MAAM,EAAE,CAAC,qBACxB,OAAO,MAAM,EAAE,OAAO,yBAAyB,EAAE,gBAAgB,CAAC,eAClE,OAAO,yBAAyB,EAAE,UAAU,EAAE,WAC9C,MAAM,SACN,MAAM,GACJ,OAAO,YAAY,EAAE,YAAY,CAe7C"}
@@ -4,7 +4,7 @@ import { type NormalizedLayout, type StateNodeOptions } from '@json-layout/vocab
4
4
  import { type ValidateFunction, type SchemaObject } from 'ajv';
5
5
  import { type Display } from '../state/utils/display.js';
6
6
  import { type LocaleMessages } from '../i18n/types.js';
7
- export type CompiledExpression = (data: any, options: StateNodeOptions, display: Display) => any;
7
+ export type CompiledExpression = (data: any, options: StateNodeOptions, context: object, display: Display) => any;
8
8
  export interface CompileOptions {
9
9
  ajv: ajvModule.default;
10
10
  code: boolean;
@@ -21,6 +21,7 @@ export interface CompiledLayout {
21
21
  schema?: SchemaObject;
22
22
  skeletonTree: SkeletonTree;
23
23
  validates: Record<string, ValidateFunction>;
24
+ validationErrors: Record<string, string[]>;
24
25
  normalizedLayouts: Record<string, NormalizedLayout>;
25
26
  expressions: CompiledExpression[];
26
27
  locale: string;
@@ -35,8 +36,6 @@ export interface SkeletonNode {
35
36
  key: string | number;
36
37
  pointer: string;
37
38
  parentPointer: string | null;
38
- defaultData?: unknown;
39
- const?: unknown;
40
39
  children?: SkeletonNode[];
41
40
  childrenTrees?: SkeletonTree[];
42
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/compile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,KAAK,CAAA;AAChC,OAAO,KAAK,UAAU,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAA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AAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;CAAE,CAAA;AAEtH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAC3C,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC1C,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACnD,WAAW,EAAE,kBAAkB,EAAE,CAAA;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,cAAc,CAAA;IACxB,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,IAAI,CAAA;CAC1D;AAID,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,YAAY,CAAA;CACnB;AAID,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;CAC/B"}
@@ -8,6 +8,28 @@ export interface StateOptionsMessages {
8
8
  edit: string;
9
9
  duplicate: string;
10
10
  sort: string;
11
+ up: string;
12
+ down: string;
13
+ showHelp: string;
14
+ mdeLink1: string;
15
+ mdeLink2: string;
16
+ mdeImg1: string;
17
+ mdeImg2: string;
18
+ mdeTable1: string;
19
+ mdeTable2: string;
20
+ bold: string;
21
+ italic: string;
22
+ heading: string;
23
+ quote: string;
24
+ unorderedList: string;
25
+ orderedList: string;
26
+ createLink: string;
27
+ insertImage: string;
28
+ createTable: string;
29
+ preview: string;
30
+ mdeGuide: string;
31
+ undo: string;
32
+ redo: string;
11
33
  }
12
34
  export type LocaleMessages = CompileOptionsMessages & StateOptionsMessages;
13
35
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,oBAAoB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,oBAAoB,CAAA"}
@@ -11,6 +11,8 @@ export { Display } from "./utils/display.js";
11
11
  * @typedef {import('./types.js').SliderNode} SliderNode
12
12
  * @typedef {import('./types.js').SectionNode} SectionNode
13
13
  * @typedef {import('./types.js').SelectNode} SelectNode
14
+ * @typedef {import('./types.js').AutocompleteNode} AutocompleteNode
15
+ * @typedef {import('./types.js').ComboboxNode} ComboboxNode
14
16
  * @typedef {import('./types.js').CheckboxNode} CheckboxNode
15
17
  * @typedef {import('./types.js').SwitchNode} SwitchNode
16
18
  * @typedef {import('./types.js').ColorPickerNode} ColorPickerNode
@@ -20,19 +22,20 @@ export { Display } from "./utils/display.js";
20
22
  * @typedef {import('./types.js').ExpansionPanelsNode} ExpansionPanelsNode
21
23
  * @typedef {import('./types.js').TabsNode} TabsNode
22
24
  * @typedef {import('./types.js').VerticalTabsNode} VerticalTabsNode
25
+ * @typedef {import('./types.js').StepperNode} StepperNode
23
26
  * @typedef {import('./types.js').OneOfSelectNode} OneOfSelectNode
24
27
  * @typedef {import('./types.js').ListNode} ListNode
25
28
  */
26
29
  /** @type {(node: StateNode | undefined) => node is SectionNode} */
27
30
  export const isSection: (node: StateNode | undefined) => node is import("./types.js").SectionNode;
28
- /** @type {(node: StateNode | undefined) => node is SelectNode} */
29
- export const isSelect: (node: StateNode | undefined) => node is import("./types.js").SelectNode;
31
+ /** @type {(node: StateNode | undefined) => node is SelectNode | ComboboxNode | AutocompleteNode} */
32
+ export const isItemsNode: (node: StateNode | undefined) => node is import("./types.js").SelectNode | import("./types.js").AutocompleteNode | import("./types.js").ComboboxNode;
30
33
  export class StatefulLayout {
31
34
  /**
32
35
  * @param {import("../index.js").CompiledLayout} compiledLayout
33
36
  * @param {import("../index.js").SkeletonTree} skeletonTree
34
37
  * @param {Partial<StatefulLayoutOptions>} options
35
- * @param {unknown} data
38
+ * @param {unknown} [data]
36
39
  */
37
40
  constructor(compiledLayout: import("../index.js").CompiledLayout, skeletonTree: import("../index.js").SkeletonTree, options: Partial<StatefulLayoutOptions>, data?: unknown);
38
41
  /**
@@ -103,6 +106,16 @@ export class StatefulLayout {
103
106
  * @type {CreateStateTreeContext}
104
107
  */
105
108
  private _lastCreateStateTreeContext;
109
+ /**
110
+ * @private
111
+ * @type {string | null}
112
+ */
113
+ private _autofocusTarget;
114
+ /**
115
+ * @private
116
+ * @type {string | null}
117
+ */
118
+ private _previousAutofocusTarget;
106
119
  /**
107
120
  * @type {Record<string, number>}
108
121
  */
@@ -130,6 +143,10 @@ export class StatefulLayout {
130
143
  * @returns {boolean}
131
144
  */
132
145
  get valid(): boolean;
146
+ /**
147
+ * @returns {string[]}
148
+ */
149
+ get errors(): string[];
133
150
  /**
134
151
  * @returns {boolean}
135
152
  */
@@ -146,9 +163,21 @@ export class StatefulLayout {
146
163
  blur(node: StateNode): void;
147
164
  /**
148
165
  * @param {StateNode} node
166
+ */
167
+ validateNodeRecurse(node: StateNode): void;
168
+ /**
169
+ * @private
170
+ * @param {StateNode} node
171
+ * @param {string} q
172
+ * @returns {Promise<[import('@json-layout/vocabulary').SelectItems, boolean]>}
173
+ */
174
+ private getSourceItems;
175
+ /**
176
+ * @param {StateNode} node
177
+ * @param {string} q
149
178
  * @returns {Promise<import('@json-layout/vocabulary').SelectItems>}
150
179
  */
151
- getSelectItems(node: StateNode): Promise<import('@json-layout/vocabulary').SelectItems>;
180
+ getItems(node: StateNode, q?: string): Promise<import('@json-layout/vocabulary').SelectItems>;
152
181
  /**
153
182
  * @param {StateNode} node
154
183
  * @param {number} key
@@ -158,6 +187,7 @@ export class StatefulLayout {
158
187
  * @param {StateNode} node
159
188
  */
160
189
  deactivateItem(node: StateNode): void;
190
+ handleAutofocus(): void;
161
191
  }
162
192
  export type StateNode = import('./types.js').StateNode;
163
193
  export type StateTree = import('./types.js').StateTree;
@@ -170,6 +200,8 @@ export type NumberFieldNode = import('./types.js').NumberFieldNode;
170
200
  export type SliderNode = import('./types.js').SliderNode;
171
201
  export type SectionNode = import('./types.js').SectionNode;
172
202
  export type SelectNode = import('./types.js').SelectNode;
203
+ export type AutocompleteNode = import('./types.js').AutocompleteNode;
204
+ export type ComboboxNode = import('./types.js').ComboboxNode;
173
205
  export type CheckboxNode = import('./types.js').CheckboxNode;
174
206
  export type SwitchNode = import('./types.js').SwitchNode;
175
207
  export type ColorPickerNode = import('./types.js').ColorPickerNode;
@@ -179,6 +211,7 @@ export type TimePickerNode = import('./types.js').TimePickerNode;
179
211
  export type ExpansionPanelsNode = import('./types.js').ExpansionPanelsNode;
180
212
  export type TabsNode = import('./types.js').TabsNode;
181
213
  export type VerticalTabsNode = import('./types.js').VerticalTabsNode;
214
+ export type StepperNode = import('./types.js').StepperNode;
182
215
  export type OneOfSelectNode = import('./types.js').OneOfSelectNode;
183
216
  export type ListNode = import('./types.js').ListNode;
184
217
  import { Display } from './utils/display.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.js"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,mEAAmE;AACnE,+BADkB,SAAS,GAAG,SAAS,8CACoC;AAE3E,kEAAkE;AAClE,8BADkB,SAAS,GAAG,SAAS,6CACkC;AA6BzE;IAoGE;;;;;OAKG;IACH,4BALW,OAAO,aAAa,EAAE,cAAc,gBACpC,OAAO,aAAa,EAAE,YAAY,WAClC,QAAQ,q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,KAAK,GAAG,CAQlF"}
1
+ {"version":3,"file":"state-node.d.ts","sourceRoot":"","sources":["../../src/state/state-node.js"],"names":[],"mappings":"AAoIA;;;;;;;GAOG;AACH,4CAPW,OAAO,aAAa,EAAE,kBAAkB,EAAE,cAC1C,OAAO,yBAAyB,EAAE,UAAU,QAC5C,GAAG,WACH,OAAO,YAAY,EAAE,qBAAqB,WAC1C,OAAO,oBAAoB,EAAE,OAAO,GAClC,GAAG,CAOf;AAuBD;;;;;;;;;;;;;;;;;GAiBG;AACH,yCAhBW,OAAO,YAAY,EAAE,sBAAsB,iBAC3C,OAAO,YAAY,EAAE,qBAAqB,kBAC1C,OAAO,aAAa,EAAE,cAAc,OACpC,MAAM,GAAG,MAAM,WACf,MAAM,iBACN,MAAM,GAAG,IAAI,YACb,MAAM,kBACN,MAAM,GAAG,IAAI,YACb,OAAO,aAAa,EAAE,YAAY,mBAClC,OAAO,yBAAyB,EAAE,KAAK,GAAG,IAAI,iBAC9C,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,mBACP,OAAO,YAAY,EAAE,eAAe,4DAElC,OAAO,YAAY,EAAE,SAAS,CAuL1C;AAED,uFAAuF;AACvF,yCADmB,GAAG,QAAQ,OAAO,YAAY,EAAE,SAAS,QAAQ,OAAO,KAAK,GAAG,CAOjF"}
@@ -4,10 +4,10 @@
4
4
  * @param {import('../index.js').CompiledLayout} compiledLayout
5
5
  * @param {import('../index.js').SkeletonTree} skeleton
6
6
  * @param {import('./utils/display.js').Display} display
7
- * @param {unknown} value
7
+ * @param {unknown} data
8
8
  * @param {import('./types.js').ValidationState} validationState
9
9
  * @param {import('./types.js').StateTree} [reusedStateTree]
10
10
  * @returns {import('./types.js').StateTree}
11
11
  */
12
- export function createStateTree(context: import('./types.js').CreateStateTreeContext, options: import('./types.js').StatefulLayoutOptions, compiledLayout: import('../index.js').CompiledLayout, skeleton: import('../index.js').SkeletonTree, display: import('./utils/display.js').Display, value: unknown, validationState: import('./types.js').ValidationState, reusedStateTree?: import("./types.js").StateTree | undefined): import('./types.js').StateTree;
12
+ export function createStateTree(context: import('./types.js').CreateStateTreeContext, options: import('./types.js').StatefulLayoutOptions, compiledLayout: import('../index.js').CompiledLayout, skeleton: import('../index.js').SkeletonTree, display: import('./utils/display.js').Display, data: unknown, validationState: import('./types.js').ValidationState, reusedStateTree?: import("./types.js").StateTree | undefined): import('./types.js').StateTree;
13
13
  //# sourceMappingURL=state-tree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state-tree.d.ts","sourceRoot":"","sources":["../../src/state/state-tree.js"],"names":[],"mappings":"AAWA;;;;;;;;;;GAUG;AACH,yCAVW,OAAO,YAAY,EAAE,sBAAsB,WAC3C,OAAO,YAAY,EAAE,qBAAqB,kBAC1C,OAAO,aAAa,EAAE,cAAc,YACpC,OAAO,aAAa,EAAE,YAAY,WAClC,OAAO,oBAAoB,EAAE,OAAO,SACpC,OAAO,mBACP,OAAO,YAAY,EAAE,eAAe,iEAElC,OAAO,YAAY,EAAE,SAAS,CAsC1C"}
1
+ {"version":3,"file":"state-tree.d.ts","sourceRoot":"","sources":["../../src/state/state-tree.js"],"names":[],"mappings":"AAWA;;;;;;;;;;GAUG;AACH,yCAVW,OAAO,YAAY,EAAE,sBAAsB,WAC3C,OAAO,YAAY,EAAE,qBAAqB,kBAC1C,OAAO,aAAa,EAAE,cAAc,YACpC,OAAO,aAAa,EAAE,YAAY,WAClC,OAAO,oBAAoB,EAAE,OAAO,QACpC,OAAO,mBACP,OAAO,YAAY,EAAE,eAAe,iEAElC,OAAO,YAAY,EAAE,SAAS,CAsC1C"}