@json-layout/core 0.28.1 → 0.28.2
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/package.json +1 -1
- package/src/compile/skeleton-node.js +4 -2
- package/src/state/index.js +5 -0
- package/src/state/state-node.js +15 -4
- package/src/state/state-tree.js +1 -1
- package/src/state/types.ts +1 -0
- package/types/compile/index.d.ts +16 -0
- package/types/compile/index.d.ts.map +1 -0
- package/types/compile/serialize.d.ts +6 -0
- package/types/compile/serialize.d.ts.map +1 -0
- package/types/compile/skeleton-node.d.ts +21 -0
- package/types/compile/skeleton-node.d.ts.map +1 -0
- package/types/compile/skeleton-tree.d.ts +17 -0
- package/types/compile/skeleton-tree.d.ts.map +1 -0
- package/types/compile/types.d.ts +59 -0
- package/types/compile/types.d.ts.map +1 -0
- package/types/compile/utils/resolve-refs.d.ts +17 -0
- package/types/compile/utils/resolve-refs.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/state/index.d.ts +280 -0
- package/types/state/index.d.ts.map +1 -0
- package/types/state/state-node.d.ts +36 -0
- package/types/state/state-node.d.ts.map +1 -0
- package/types/state/state-tree.d.ts +13 -0
- package/types/state/state-tree.d.ts.map +1 -0
- package/types/state/types.d.ts +178 -0
- package/types/state/types.d.ts.map +1 -0
- package/types/state/utils/display.d.ts +51 -0
- package/types/state/utils/display.d.ts.map +1 -0
- package/types/state/utils/immutable.d.ts +21 -0
- package/types/state/utils/immutable.d.ts.map +1 -0
- package/types/utils/build.d.ts +5 -0
- package/types/utils/build.d.ts.map +1 -0
- package/types/utils/doc-options.d.ts +14 -0
- package/types/utils/doc-options.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -147,6 +147,10 @@ export function makeSkeletonNode (
|
|
|
147
147
|
pushExpression(expressions, node.condition)
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
if (schema.oneOf) {
|
|
151
|
+
rawSchema.errorMessage.oneOf = options.messages.errorOneOf
|
|
152
|
+
}
|
|
153
|
+
|
|
150
154
|
if (type === 'object') {
|
|
151
155
|
if (schema.properties) {
|
|
152
156
|
node.children = node.children ?? []
|
|
@@ -297,8 +301,6 @@ export function makeSkeletonNode (
|
|
|
297
301
|
}
|
|
298
302
|
node.children = node.children ?? []
|
|
299
303
|
node.children.push(oneOfPointer)
|
|
300
|
-
|
|
301
|
-
rawSchema.errorMessage.oneOf = options.messages.errorOneOf
|
|
302
304
|
}
|
|
303
305
|
if (schema.if) {
|
|
304
306
|
validates.push(`${pointer}/if`)
|
package/src/state/index.js
CHANGED
|
@@ -264,6 +264,11 @@ export class StatefulLayout {
|
|
|
264
264
|
this._autofocusTarget = this._lastCreateStateTreeContext.autofocusTarget
|
|
265
265
|
this.createStateTree(true)
|
|
266
266
|
}
|
|
267
|
+
|
|
268
|
+
if (!this._stateTree.valid && !this._stateTree.root.error && !this._stateTree.root.childError) {
|
|
269
|
+
console.error('JSON layout failed to assign validation error to a node', this._lastCreateStateTreeContext.allErrors)
|
|
270
|
+
}
|
|
271
|
+
|
|
267
272
|
logDataBinding('emit update event', this._data, this._stateTree)
|
|
268
273
|
this.options.onUpdate(this)
|
|
269
274
|
this.emitData()
|
package/src/state/state-node.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { isSwitchStruct, childIsCompObject, isCompositeLayout, isFocusableLayout, isItemsLayout, isGetItemsExpression, isGetItemsFetch } from '@json-layout/vocabulary'
|
|
2
2
|
import { produce } from 'immer'
|
|
3
|
+
import debug from 'debug'
|
|
3
4
|
import { getChildDisplay } from './utils/display.js'
|
|
4
5
|
import { shallowEqualArray, shallowProduceArray, shallowProduceObject } from './utils/immutable.js'
|
|
5
6
|
|
|
7
|
+
const logStateNode = debug('jl:state-node')
|
|
8
|
+
|
|
6
9
|
/**
|
|
7
10
|
* @param {unknown} data
|
|
8
11
|
* @returns {boolean}
|
|
@@ -265,6 +268,8 @@ export function createStateNode (
|
|
|
265
268
|
validationState,
|
|
266
269
|
reusedNode
|
|
267
270
|
) {
|
|
271
|
+
logStateNode('createStateNode', fullKey)
|
|
272
|
+
|
|
268
273
|
/** @type {import('./types.js').StateNodeCacheKey | null} */
|
|
269
274
|
let cacheKey = null
|
|
270
275
|
|
|
@@ -274,14 +279,17 @@ export function createStateNode (
|
|
|
274
279
|
const validatedCacheKey = validationState.validatedForm || validationState.validatedChildren.includes(fullKey)
|
|
275
280
|
cacheKey = [parentOptions, compiledLayout, fullKey, skeleton, childDefinition, parentDisplay.width, validatedCacheKey, context.activatedItems, context.initial, data]
|
|
276
281
|
if (reusedNode && context.cacheKeys[fullKey] && shallowEqualArray(context.cacheKeys[fullKey], cacheKey)) {
|
|
282
|
+
logStateNode('createStateNode cache hit', fullKey)
|
|
277
283
|
// @ts-ignore
|
|
278
284
|
if (context._debugCache) context._debugCache[fullKey] = (context._debugCache[fullKey] ?? []).concat(['hit'])
|
|
279
285
|
return reusedNode
|
|
280
286
|
} else {
|
|
287
|
+
logStateNode('createStateNode cache miss', fullKey)
|
|
281
288
|
// @ts-ignore
|
|
282
289
|
if (context._debugCache) context._debugCache[fullKey] = (context._debugCache[fullKey] ?? []).concat(['miss'])
|
|
283
290
|
}
|
|
284
291
|
} else {
|
|
292
|
+
logStateNode('createStateNode cache skip', fullKey)
|
|
285
293
|
// @ts-ignore
|
|
286
294
|
if (context._debugCache) context._debugCache[fullKey] = (context._debugCache[fullKey] ?? []).concat(['skip'])
|
|
287
295
|
}
|
|
@@ -360,10 +368,12 @@ export function createStateNode (
|
|
|
360
368
|
const originalError = error.params?.errors?.[0] ?? error
|
|
361
369
|
// console.log(originalError.schemaPath, skeleton.pointer, skeleton.refPointer)
|
|
362
370
|
// if an item was selected, remove the oneOf error
|
|
363
|
-
if ((
|
|
371
|
+
if (matchError(error, skeleton, dataPath, parentDataPath)) return false
|
|
364
372
|
// also remove the errors from other children of the oneOf
|
|
365
|
-
if (
|
|
366
|
-
|
|
373
|
+
if (matchChildError(error, skeleton, dataPath, parentDataPath)) {
|
|
374
|
+
if (originalError.schemaPath.startsWith(skeleton.pointer) && !originalError.schemaPath.startsWith(skeleton.pointer + '/' + activeChildTreeIndex)) return false
|
|
375
|
+
if (originalError.schemaPath.startsWith(skeleton.refPointer) && !originalError.schemaPath.startsWith(skeleton.refPointer + '/' + activeChildTreeIndex)) return false
|
|
376
|
+
}
|
|
367
377
|
return true
|
|
368
378
|
})
|
|
369
379
|
// console.log(context.errors?.map(error => error.params?.errors?.[0] ?? error))
|
|
@@ -426,7 +436,8 @@ export function createStateNode (
|
|
|
426
436
|
|
|
427
437
|
let error = context.errors?.find(error => matchError(error, skeleton, dataPath, parentDataPath))
|
|
428
438
|
if (!error) {
|
|
429
|
-
|
|
439
|
+
// findLast here is important because we want to keep the error of the highest child (deepest errors are listed first)
|
|
440
|
+
error = context.errors?.findLast(error => matchChildError(error, skeleton, dataPath, parentDataPath))
|
|
430
441
|
}
|
|
431
442
|
|
|
432
443
|
// capture errors so that they are not repeated in parent nodes
|
package/src/state/state-tree.js
CHANGED
|
@@ -51,7 +51,7 @@ export function createStateTree (
|
|
|
51
51
|
for (const error of validate.errors) {
|
|
52
52
|
if (error.keyword !== 'errorMessage') compiledLayout.localizeErrors([error])
|
|
53
53
|
}
|
|
54
|
-
context.errors = validate.errors
|
|
54
|
+
context.errors = context.allErrors = validate.errors
|
|
55
55
|
if (context.errors.length) {
|
|
56
56
|
for (const error of context.errors) {
|
|
57
57
|
const originalError = error.params?.errors?.[0] ?? error
|
package/src/state/types.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} _schema
|
|
3
|
+
* @param {PartialCompileOptions} [partialOptions]
|
|
4
|
+
* @returns {CompiledLayout}
|
|
5
|
+
*/
|
|
6
|
+
export function compile(_schema: object, partialOptions?: import("./types.js").PartialCompileOptions | undefined): CompiledLayout;
|
|
7
|
+
export { resolveLocaleRefs } from "./utils/resolve-refs.js";
|
|
8
|
+
/** @type {(draft: PartialCompileOptions, newOptions: PartialCompileOptions) => PartialCompileOptions} */
|
|
9
|
+
export const produceCompileOptions: (draft: PartialCompileOptions, newOptions: PartialCompileOptions) => PartialCompileOptions;
|
|
10
|
+
export type SkeletonTree = import('./types.js').SkeletonTree;
|
|
11
|
+
export type SkeletonNode = import('./types.js').SkeletonNode;
|
|
12
|
+
export type CompiledLayout = import('./types.js').CompiledLayout;
|
|
13
|
+
export type CompileOptions = import('./types.js').CompileOptions;
|
|
14
|
+
export type PartialCompileOptions = import('./types.js').PartialCompileOptions;
|
|
15
|
+
export type CompiledExpression = import('./types.js').CompiledExpression;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.js"],"names":[],"mappings":"AA0GA;;;;GAIG;AACH,iCAJW,MAAM,4EAEJ,cAAc,CA8F1B;;AAxKD,yGAAyG;AACzG,4CADmB,qBAAqB,cAAc,qBAAqB,KAAK,qBAAqB,CAiBnG;2BAjCW,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/compile/serialize.js"],"names":[],"mappings":"AAoBA;;;GAGG;AACH,0CAHW,OAAO,YAAY,EAAE,cAAc,GACjC,MAAM,CAoFlB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {any} rawSchema
|
|
3
|
+
* @param {string} sourceSchemaId
|
|
4
|
+
* @param {import('./index.js').CompileOptions} options
|
|
5
|
+
* @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef
|
|
6
|
+
* @param {Record<string, import('./types.js').SkeletonTree>} skeletonTrees
|
|
7
|
+
* @param {Record<string, import('./types.js').SkeletonNode>} skeletonNodes
|
|
8
|
+
* @param {string[]} validates
|
|
9
|
+
* @param {Record<string, string[]>} validationErrors
|
|
10
|
+
* @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
|
|
11
|
+
* @param {import('@json-layout/vocabulary').Expression[]} expressions
|
|
12
|
+
* @param {string | number} key
|
|
13
|
+
* @param {string} pointer
|
|
14
|
+
* @param {boolean} required
|
|
15
|
+
* @param {string} [condition]
|
|
16
|
+
* @param {boolean} [dependent]
|
|
17
|
+
* @param {string} [knownType]
|
|
18
|
+
* @returns {import('./types.js').SkeletonNode}
|
|
19
|
+
*/
|
|
20
|
+
export function makeSkeletonNode(rawSchema: any, sourceSchemaId: string, options: import('./index.js').CompileOptions, getJSONRef: (schemaId: string, ref: string) => [any, string, string], skeletonTrees: Record<string, import('./types.js').SkeletonTree>, skeletonNodes: Record<string, import('./types.js').SkeletonNode>, 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, required: boolean, condition?: string | undefined, dependent?: boolean | undefined, knownType?: string | undefined): import('./types.js').SkeletonNode;
|
|
21
|
+
//# sourceMappingURL=skeleton-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-node.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-node.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,4CAlBW,GAAG,kBACH,MAAM,WACN,OAAO,YAAY,EAAE,cAAc,yBACxB,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,iBACxD,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,iBACjD,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,aACjD,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,YACN,OAAO,oGAIL,OAAO,YAAY,EAAE,YAAY,CA4Z7C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {any} schema
|
|
3
|
+
* @param {string} schemaId
|
|
4
|
+
* @param {import('./index.js').CompileOptions} options
|
|
5
|
+
* @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef
|
|
6
|
+
* @param {Record<string, import('./types.js').SkeletonTree>} skeletonTrees
|
|
7
|
+
* @param {Record<string, import('./types.js').SkeletonNode>} skeletonNodes
|
|
8
|
+
* @param {string[]} validates
|
|
9
|
+
* @param {Record<string, string[]>} validationErrors
|
|
10
|
+
* @param {Record<string, import('@json-layout/vocabulary').NormalizedLayout>} normalizedLayouts
|
|
11
|
+
* @param {import('@json-layout/vocabulary').Expression[]} expressions
|
|
12
|
+
* @param {string} pointer
|
|
13
|
+
* @param {string} title
|
|
14
|
+
* @returns {import('./types.js').SkeletonTree}
|
|
15
|
+
*/
|
|
16
|
+
export function makeSkeletonTree(schema: any, schemaId: string, options: import('./index.js').CompileOptions, getJSONRef: (schemaId: string, ref: string) => [any, string, string], skeletonTrees: Record<string, import('./types.js').SkeletonTree>, skeletonNodes: Record<string, import('./types.js').SkeletonNode>, 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;
|
|
17
|
+
//# sourceMappingURL=skeleton-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-tree.d.ts","sourceRoot":"","sources":["../../src/compile/skeleton-tree.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,yCAdW,GAAG,YACH,MAAM,WACN,OAAO,YAAY,EAAE,cAAc,yBACxB,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,iBACxD,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,iBACjD,OAAO,MAAM,EAAE,OAAO,YAAY,EAAE,YAAY,CAAC,aACjD,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,CAqC7C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type ajvModule from 'ajv/dist/2019.js';
|
|
2
|
+
import type MarkdownIt from 'markdown-it';
|
|
3
|
+
import { type ComponentInfo, type BaseCompObject, type NormalizedLayout, type StateNodeOptionsBase, type Expression } from '@json-layout/vocabulary';
|
|
4
|
+
import { type ValidateFunction, type SchemaObject } from 'ajv/dist/2019.js';
|
|
5
|
+
import { type Display } from '../state/utils/display.js';
|
|
6
|
+
import { type LocaleMessages } from '../i18n/types.js';
|
|
7
|
+
export interface ParentContextExpression {
|
|
8
|
+
data: unknown;
|
|
9
|
+
parent: ParentContextExpression | undefined | null;
|
|
10
|
+
}
|
|
11
|
+
export type CompiledExpression = (data: any, options: StateNodeOptionsBase, context: object, display: Display, layout: BaseCompObject, validates: Record<string, ValidateFunction>, rootData?: unknown, parent?: ParentContextExpression | null) => any;
|
|
12
|
+
export interface CompileOptions {
|
|
13
|
+
ajv: ajvModule.default;
|
|
14
|
+
ajvOptions?: ajvModule.Options;
|
|
15
|
+
code: boolean;
|
|
16
|
+
markdown: (text: string) => string;
|
|
17
|
+
markdownItOptions?: MarkdownIt.Options;
|
|
18
|
+
locale: string;
|
|
19
|
+
messages: LocaleMessages;
|
|
20
|
+
optionsKeys: string[];
|
|
21
|
+
components: Record<string, ComponentInfo>;
|
|
22
|
+
}
|
|
23
|
+
export type PartialCompileOptions = Partial<Omit<CompileOptions, 'messages'>> & {
|
|
24
|
+
messages?: Partial<LocaleMessages>;
|
|
25
|
+
components?: Record<string, Omit<ComponentInfo, 'name'>>;
|
|
26
|
+
};
|
|
27
|
+
export interface CompiledLayout {
|
|
28
|
+
options?: CompileOptions;
|
|
29
|
+
schema?: SchemaObject;
|
|
30
|
+
mainTree: string;
|
|
31
|
+
skeletonTrees: Record<string, SkeletonTree>;
|
|
32
|
+
skeletonNodes: Record<string, SkeletonNode>;
|
|
33
|
+
validates: Record<string, ValidateFunction>;
|
|
34
|
+
validationErrors: Record<string, string[]>;
|
|
35
|
+
normalizedLayouts: Record<string, NormalizedLayout>;
|
|
36
|
+
expressions: CompiledExpression[];
|
|
37
|
+
locale: string;
|
|
38
|
+
messages: LocaleMessages;
|
|
39
|
+
components: Record<string, Omit<ComponentInfo, 'schema'>>;
|
|
40
|
+
localizeErrors: (errors: ajvModule.ErrorObject[]) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface SkeletonTree {
|
|
43
|
+
title: string;
|
|
44
|
+
root: string;
|
|
45
|
+
}
|
|
46
|
+
export interface SkeletonNode {
|
|
47
|
+
key: string | number;
|
|
48
|
+
pointer: string;
|
|
49
|
+
refPointer: string;
|
|
50
|
+
pure: boolean;
|
|
51
|
+
propertyKeys: string[];
|
|
52
|
+
roPropertyKeys: string[];
|
|
53
|
+
condition?: Expression;
|
|
54
|
+
children?: string[];
|
|
55
|
+
childrenTrees?: string[];
|
|
56
|
+
required?: boolean;
|
|
57
|
+
nullable?: boolean;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["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EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mutates a schema by replacing ~$locale~ in all refs
|
|
3
|
+
* @param {import('ajv').SchemaObject} schema
|
|
4
|
+
* @param {ajvModule.default} ajv
|
|
5
|
+
* @param {string} locale
|
|
6
|
+
* @returns {(schemaId: string, ref: string) => [any, string, string]}
|
|
7
|
+
*/
|
|
8
|
+
export function resolveLocaleRefs(schema: import('ajv').SchemaObject, ajv: ajvModule.default, locale?: string): (schemaId: string, ref: string) => [any, string, string];
|
|
9
|
+
/**
|
|
10
|
+
* partially resolve a schema but not recursively, used for layout normalization
|
|
11
|
+
* @param {import('ajv').SchemaObject} schema
|
|
12
|
+
* @param {string} schemaId
|
|
13
|
+
* @param {(schemaId: string, ref: string) => [any, string, string]} getJSONRef
|
|
14
|
+
*/
|
|
15
|
+
export function partialResolveRefs(schema: import('ajv').SchemaObject, schemaId: string, getJSONRef: (schemaId: string, ref: string) => [any, string, string]): any;
|
|
16
|
+
import ajvModule from 'ajv/dist/2019.js';
|
|
17
|
+
//# sourceMappingURL=resolve-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-refs.d.ts","sourceRoot":"","sources":["../../../src/compile/utils/resolve-refs.js"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,0CALW,OAAO,KAAK,EAAE,YAAY,OAC1B,UAAU,OAAO,WACjB,MAAM,cACO,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CASpE;AAsCD;;;;;GAKG;AACH,2CAJW,OAAO,KAAK,EAAE,YAAY,YAC1B,MAAM,yBACK,MAAM,OAAO,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,OA+ClE;sBAhIqB,kBAAkB"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
export { Display } from "./utils/display.js";
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import('./types.js').StateNode} StateNode
|
|
4
|
+
* @typedef {import('./types.js').StateTree} StateTree
|
|
5
|
+
* @typedef {import('./types.js').StatefulLayoutOptions} StatefulLayoutOptions
|
|
6
|
+
* @typedef {import('./types.js').CreateStateTreeContext} CreateStateTreeContext
|
|
7
|
+
* @typedef {import('./types.js').TextFieldNode} TextFieldNode
|
|
8
|
+
* @typedef {import('./types.js').TextareaNode} TextareaNode
|
|
9
|
+
* @typedef {import('./types.js').NumberFieldNode} NumberFieldNode
|
|
10
|
+
* @typedef {import('./types.js').SliderNode} SliderNode
|
|
11
|
+
* @typedef {import('./types.js').SectionNode} SectionNode
|
|
12
|
+
* @typedef {import('./types.js').SelectNode} SelectNode
|
|
13
|
+
* @typedef {import('./types.js').AutocompleteNode} AutocompleteNode
|
|
14
|
+
* @typedef {import('./types.js').RadioGroupNode} RadioGroupNode
|
|
15
|
+
* @typedef {import('./types.js').CheckboxGroupNode} CheckboxGroupNode
|
|
16
|
+
* @typedef {import('./types.js').SwitchGroupNode} SwitchGroupNode
|
|
17
|
+
* @typedef {import('./types.js').ComboboxNode} ComboboxNode
|
|
18
|
+
* @typedef {import('./types.js').CheckboxNode} CheckboxNode
|
|
19
|
+
* @typedef {import('./types.js').SwitchNode} SwitchNode
|
|
20
|
+
* @typedef {import('./types.js').ColorPickerNode} ColorPickerNode
|
|
21
|
+
* @typedef {import('./types.js').DatePickerNode} DatePickerNode
|
|
22
|
+
* @typedef {import('./types.js').DateTimePickerNode} DateTimePickerNode
|
|
23
|
+
* @typedef {import('./types.js').TimePickerNode} TimePickerNode
|
|
24
|
+
* @typedef {import('./types.js').ExpansionPanelsNode} ExpansionPanelsNode
|
|
25
|
+
* @typedef {import('./types.js').TabsNode} TabsNode
|
|
26
|
+
* @typedef {import('./types.js').VerticalTabsNode} VerticalTabsNode
|
|
27
|
+
* @typedef {import('./types.js').StepperNode} StepperNode
|
|
28
|
+
* @typedef {import('./types.js').OneOfSelectNode} OneOfSelectNode
|
|
29
|
+
* @typedef {import('./types.js').ListNode} ListNode
|
|
30
|
+
* @typedef {import('./types.js').FileInputNode} FileInputNode
|
|
31
|
+
* @typedef {import('./types.js').CardNode} CardNode
|
|
32
|
+
* @typedef {import('./types.js').FileRef} FileRef
|
|
33
|
+
*/
|
|
34
|
+
/** @type {(node: StateNode | undefined) => node is SectionNode} */
|
|
35
|
+
export const isSection: (node: StateNode | undefined) => node is import("./types.js").SectionNode;
|
|
36
|
+
/** @type {(node: StateNode | undefined, components: Record<string, import('@json-layout/vocabulary').ComponentInfo>) => node is SelectNode | ComboboxNode | AutocompleteNode} */
|
|
37
|
+
export const isItemsNode: (node: StateNode | undefined, components: Record<string, import('@json-layout/vocabulary').ComponentInfo>) => node is import("./types.js").SelectNode | import("./types.js").AutocompleteNode | import("./types.js").ComboboxNode;
|
|
38
|
+
export class StatefulLayout {
|
|
39
|
+
/**
|
|
40
|
+
* @param {import("../index.js").CompiledLayout} compiledLayout
|
|
41
|
+
* @param {import("../index.js").SkeletonTree} skeletonTree
|
|
42
|
+
* @param {Partial<StatefulLayoutOptions>} options
|
|
43
|
+
* @param {unknown} [data]
|
|
44
|
+
*/
|
|
45
|
+
constructor(compiledLayout: import("../index.js").CompiledLayout, skeletonTree: import("../index.js").SkeletonTree, options: Partial<StatefulLayoutOptions>, data?: unknown);
|
|
46
|
+
/**
|
|
47
|
+
* @private
|
|
48
|
+
* @readonly
|
|
49
|
+
* @type {import('../index.js').CompiledLayout}
|
|
50
|
+
*/
|
|
51
|
+
private readonly _compiledLayout;
|
|
52
|
+
get compiledLayout(): import("../compile/types.js").CompiledLayout;
|
|
53
|
+
/**
|
|
54
|
+
* @private
|
|
55
|
+
* @type {StateTree}
|
|
56
|
+
*/
|
|
57
|
+
private _stateTree;
|
|
58
|
+
get stateTree(): import("./types.js").StateTree;
|
|
59
|
+
/**
|
|
60
|
+
* @readonly
|
|
61
|
+
* @type {import('../index.js').SkeletonTree}
|
|
62
|
+
*/
|
|
63
|
+
readonly skeletonTree: import('../index.js').SkeletonTree;
|
|
64
|
+
/**
|
|
65
|
+
* @private
|
|
66
|
+
* @type {Display}
|
|
67
|
+
*/
|
|
68
|
+
private _display;
|
|
69
|
+
get display(): Display;
|
|
70
|
+
/**
|
|
71
|
+
* @private
|
|
72
|
+
* @type {import('./types.js').ValidationState}
|
|
73
|
+
*/
|
|
74
|
+
private _validationState;
|
|
75
|
+
/**
|
|
76
|
+
* @private
|
|
77
|
+
* @param {Partial<import('./types.js').ValidationState>} validationState
|
|
78
|
+
*/
|
|
79
|
+
set validationState(arg: import("./types.js").ValidationState);
|
|
80
|
+
/**
|
|
81
|
+
* @returns {import('./types.js').ValidationState}
|
|
82
|
+
*/
|
|
83
|
+
get validationState(): import("./types.js").ValidationState;
|
|
84
|
+
/**
|
|
85
|
+
* @private
|
|
86
|
+
* @type {StatefulLayoutOptions}
|
|
87
|
+
*/
|
|
88
|
+
private _options;
|
|
89
|
+
/**
|
|
90
|
+
* @param {Partial<StatefulLayoutOptions>} options
|
|
91
|
+
*/
|
|
92
|
+
set options(arg: import("./types.js").StatefulLayoutOptions);
|
|
93
|
+
/**
|
|
94
|
+
* @returns {StatefulLayoutOptions}
|
|
95
|
+
*/
|
|
96
|
+
get options(): import("./types.js").StatefulLayoutOptions;
|
|
97
|
+
/**
|
|
98
|
+
* @private
|
|
99
|
+
* @type {unknown}
|
|
100
|
+
*/
|
|
101
|
+
private _data;
|
|
102
|
+
set data(arg: unknown);
|
|
103
|
+
get data(): unknown;
|
|
104
|
+
/**
|
|
105
|
+
* @private
|
|
106
|
+
* @type {unknown}
|
|
107
|
+
*/
|
|
108
|
+
private _previousData;
|
|
109
|
+
/**
|
|
110
|
+
* @private
|
|
111
|
+
* @type {boolean}
|
|
112
|
+
*/
|
|
113
|
+
private _dataWaitingForBlur;
|
|
114
|
+
/**
|
|
115
|
+
* @private
|
|
116
|
+
* @type {CreateStateTreeContext}
|
|
117
|
+
*/
|
|
118
|
+
private _lastCreateStateTreeContext;
|
|
119
|
+
/**
|
|
120
|
+
* @private
|
|
121
|
+
* @type {string | null}
|
|
122
|
+
*/
|
|
123
|
+
private _autofocusTarget;
|
|
124
|
+
/**
|
|
125
|
+
* @private
|
|
126
|
+
* @type {string | null}
|
|
127
|
+
*/
|
|
128
|
+
private _previousAutofocusTarget;
|
|
129
|
+
/**
|
|
130
|
+
* @type {FileRef[]}
|
|
131
|
+
*/
|
|
132
|
+
files: FileRef[];
|
|
133
|
+
/**
|
|
134
|
+
* @type {Record<string, number>}
|
|
135
|
+
*/
|
|
136
|
+
activatedItems: Record<string, number>;
|
|
137
|
+
/**
|
|
138
|
+
* @private
|
|
139
|
+
* @param {Partial<StatefulLayoutOptions>} options
|
|
140
|
+
*/
|
|
141
|
+
private prepareOptions;
|
|
142
|
+
/**
|
|
143
|
+
* @private
|
|
144
|
+
*/
|
|
145
|
+
private initValidationState;
|
|
146
|
+
/**
|
|
147
|
+
* @private
|
|
148
|
+
*/
|
|
149
|
+
private updateState;
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
private emitData;
|
|
154
|
+
/**
|
|
155
|
+
* @private
|
|
156
|
+
* @param {boolean} rehydrate
|
|
157
|
+
*/
|
|
158
|
+
private createStateTree;
|
|
159
|
+
validate(): void;
|
|
160
|
+
resetValidation(): void;
|
|
161
|
+
/**
|
|
162
|
+
* @returns {boolean}
|
|
163
|
+
*/
|
|
164
|
+
get valid(): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* @returns {string[]}
|
|
167
|
+
*/
|
|
168
|
+
get errors(): string[];
|
|
169
|
+
/**
|
|
170
|
+
* @returns {boolean}
|
|
171
|
+
*/
|
|
172
|
+
get hasHiddenError(): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* @private
|
|
175
|
+
* @param {StateNode} node
|
|
176
|
+
* @returns {import('../compile/types.js').ParentContextExpression | null}
|
|
177
|
+
*/
|
|
178
|
+
private getParentContextExpression;
|
|
179
|
+
/**
|
|
180
|
+
* @param {StateNode} node
|
|
181
|
+
* @param {import('@json-layout/vocabulary').Expression} expression
|
|
182
|
+
* @param {any} data
|
|
183
|
+
* @returns {any}
|
|
184
|
+
*/
|
|
185
|
+
evalNodeExpression(node: StateNode, expression: import('@json-layout/vocabulary').Expression, data: any): any;
|
|
186
|
+
/**
|
|
187
|
+
* @private
|
|
188
|
+
* @param {StateNode} node
|
|
189
|
+
* @param {unknown} data
|
|
190
|
+
* @param {boolean} [validated]
|
|
191
|
+
* @param {number} [activateKey]
|
|
192
|
+
*/
|
|
193
|
+
private applyInput;
|
|
194
|
+
/**
|
|
195
|
+
* @private
|
|
196
|
+
* @type {null | [StateNode, unknown, boolean, number | undefined, ReturnType<typeof setTimeout>]}
|
|
197
|
+
*/
|
|
198
|
+
private debouncedInput;
|
|
199
|
+
applyDebouncedInput(): void;
|
|
200
|
+
/**
|
|
201
|
+
* @param {StateNode} node
|
|
202
|
+
* @param {unknown} data
|
|
203
|
+
* @param {number} [activateKey]
|
|
204
|
+
*/
|
|
205
|
+
input(node: StateNode, data: unknown, activateKey?: number | undefined): void;
|
|
206
|
+
/**
|
|
207
|
+
* @param {StateNode} node
|
|
208
|
+
*/
|
|
209
|
+
blur(node: StateNode): void;
|
|
210
|
+
/**
|
|
211
|
+
* @param {StateNode} node
|
|
212
|
+
*/
|
|
213
|
+
validateNodeRecurse(node: StateNode): void;
|
|
214
|
+
/**
|
|
215
|
+
* @private
|
|
216
|
+
* @type {Record<string, {key: any, appliedQ: boolean, items: import('@json-layout/vocabulary').SelectItems}>}
|
|
217
|
+
*/
|
|
218
|
+
private _itemsCache;
|
|
219
|
+
/**
|
|
220
|
+
* @private
|
|
221
|
+
* @param {StateNode} node
|
|
222
|
+
* @param {string} q
|
|
223
|
+
* @returns {Promise<{appliedQ: boolean, items: import('@json-layout/vocabulary').SelectItems}>}
|
|
224
|
+
*/
|
|
225
|
+
private getItemsWithoutCache;
|
|
226
|
+
/**
|
|
227
|
+
* @param {StateNode} node
|
|
228
|
+
* @param {string} q
|
|
229
|
+
* @returns {Promise<import('@json-layout/vocabulary').SelectItems>}
|
|
230
|
+
*/
|
|
231
|
+
getItems(node: StateNode, q?: string): Promise<import('@json-layout/vocabulary').SelectItems>;
|
|
232
|
+
/**
|
|
233
|
+
* @param {StateNode} node
|
|
234
|
+
* @param {any} rawItem
|
|
235
|
+
* @returns {import('@json-layout/vocabulary').SelectItem}
|
|
236
|
+
*/
|
|
237
|
+
prepareSelectItem(node: StateNode, rawItem: any): import('@json-layout/vocabulary').SelectItem;
|
|
238
|
+
/**
|
|
239
|
+
* @param {StateNode} node
|
|
240
|
+
* @param {number} key
|
|
241
|
+
*/
|
|
242
|
+
activateItem(node: StateNode, key: number): void;
|
|
243
|
+
/**
|
|
244
|
+
* @param {StateNode} node
|
|
245
|
+
*/
|
|
246
|
+
deactivateItem(node: StateNode): void;
|
|
247
|
+
handleAutofocus(): void;
|
|
248
|
+
}
|
|
249
|
+
export type StateNode = import('./types.js').StateNode;
|
|
250
|
+
export type StateTree = import('./types.js').StateTree;
|
|
251
|
+
export type StatefulLayoutOptions = import('./types.js').StatefulLayoutOptions;
|
|
252
|
+
export type CreateStateTreeContext = import('./types.js').CreateStateTreeContext;
|
|
253
|
+
export type TextFieldNode = import('./types.js').TextFieldNode;
|
|
254
|
+
export type TextareaNode = import('./types.js').TextareaNode;
|
|
255
|
+
export type NumberFieldNode = import('./types.js').NumberFieldNode;
|
|
256
|
+
export type SliderNode = import('./types.js').SliderNode;
|
|
257
|
+
export type SectionNode = import('./types.js').SectionNode;
|
|
258
|
+
export type SelectNode = import('./types.js').SelectNode;
|
|
259
|
+
export type AutocompleteNode = import('./types.js').AutocompleteNode;
|
|
260
|
+
export type RadioGroupNode = import('./types.js').RadioGroupNode;
|
|
261
|
+
export type CheckboxGroupNode = import('./types.js').CheckboxGroupNode;
|
|
262
|
+
export type SwitchGroupNode = import('./types.js').SwitchGroupNode;
|
|
263
|
+
export type ComboboxNode = import('./types.js').ComboboxNode;
|
|
264
|
+
export type CheckboxNode = import('./types.js').CheckboxNode;
|
|
265
|
+
export type SwitchNode = import('./types.js').SwitchNode;
|
|
266
|
+
export type ColorPickerNode = import('./types.js').ColorPickerNode;
|
|
267
|
+
export type DatePickerNode = import('./types.js').DatePickerNode;
|
|
268
|
+
export type DateTimePickerNode = import('./types.js').DateTimePickerNode;
|
|
269
|
+
export type TimePickerNode = import('./types.js').TimePickerNode;
|
|
270
|
+
export type ExpansionPanelsNode = import('./types.js').ExpansionPanelsNode;
|
|
271
|
+
export type TabsNode = import('./types.js').TabsNode;
|
|
272
|
+
export type VerticalTabsNode = import('./types.js').VerticalTabsNode;
|
|
273
|
+
export type StepperNode = import('./types.js').StepperNode;
|
|
274
|
+
export type OneOfSelectNode = import('./types.js').OneOfSelectNode;
|
|
275
|
+
export type ListNode = import('./types.js').ListNode;
|
|
276
|
+
export type FileInputNode = import('./types.js').FileInputNode;
|
|
277
|
+
export type CardNode = import('./types.js').CardNode;
|
|
278
|
+
export type FileRef = import('./types.js').FileRef;
|
|
279
|
+
import { Display } from './utils/display.js';
|
|
280
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.js"],"names":[],"mappings":";AAWA;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OAAO,YAAY,EAAE,cAAc;iCACnC,OAAO,YAAY,EAAE,kBAAkB;6BACvC,OAAO,YAAY,EAAE,cAAc;kCACnC,OAAO,YAAY,EAAE,mBAAmB;uBACxC,OAAO,YAAY,EAAE,QAAQ;+BAC7B,OAAO,YAAY,EAAE,gBAAgB;0BACrC,OAAO,YAAY,EAAE,WAAW;8BAChC,OAAO,YAAY,EAAE,eAAe;uBACpC,OAAO,YAAY,EAAE,QAAQ;4BAC7B,OAAO,YAAY,EAAE,aAAa;uBAClC,OAAO,YAAY,EAAE,QAAQ;sBAC7B,OAAO,YAAY,EAAE,OAAO;wBApCjB,oBAAoB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('../index.js').CompiledExpression[]} expressions
|
|
3
|
+
* @param {import('@json-layout/vocabulary').Expression} expression
|
|
4
|
+
* @param {any} data
|
|
5
|
+
* @param {import('./types.js').StateNodeOptions} options
|
|
6
|
+
* @param {import('./utils/display.js').Display} display
|
|
7
|
+
* @param {import('@json-layout/vocabulary').BaseCompObject} layout
|
|
8
|
+
* @param {Record<string, import('ajv').ValidateFunction>} validates
|
|
9
|
+
* @param {unknown} rootData
|
|
10
|
+
* @param {import('../compile/types.js').ParentContextExpression | null} parentContext
|
|
11
|
+
* @returns {any}
|
|
12
|
+
*/
|
|
13
|
+
export function evalExpression(expressions: import('../index.js').CompiledExpression[], expression: import('@json-layout/vocabulary').Expression, data: any, options: import('./types.js').StateNodeOptions, display: import('./utils/display.js').Display, layout: import('@json-layout/vocabulary').BaseCompObject, validates: Record<string, import('ajv').ValidateFunction>, rootData: unknown, parentContext: import('../compile/types.js').ParentContextExpression | null): any;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {import('./types.js').CreateStateTreeContext} context
|
|
17
|
+
* @param {import('./types.js').StateNodeOptions} parentOptions
|
|
18
|
+
* @param {import('../index.js').CompiledLayout} compiledLayout
|
|
19
|
+
* @param {string | number} key
|
|
20
|
+
* @param {string} fullKey
|
|
21
|
+
* @param {string | null} parentFullKey
|
|
22
|
+
* @param {string} dataPath
|
|
23
|
+
* @param {string | null} parentDataPath
|
|
24
|
+
* @param {import('../index.js').SkeletonNode} skeleton
|
|
25
|
+
* @param {import('@json-layout/vocabulary').Child | null} childDefinition
|
|
26
|
+
* @param {import('./utils/display.js').Display} parentDisplay
|
|
27
|
+
* @param {unknown} data
|
|
28
|
+
* @param {import('../compile/types.js').ParentContextExpression | null} parentContext
|
|
29
|
+
* @param {import('./types.js').ValidationState} validationState
|
|
30
|
+
* @param {import('./types.js').StateNode} [reusedNode]
|
|
31
|
+
* @returns {import('./types.js').StateNode}
|
|
32
|
+
*/
|
|
33
|
+
export function createStateNode(context: import('./types.js').CreateStateTreeContext, parentOptions: import('./types.js').StateNodeOptions, compiledLayout: import('../index.js').CompiledLayout, key: string | number, fullKey: string, parentFullKey: string | null, dataPath: string, parentDataPath: string | null, skeleton: import('../index.js').SkeletonNode, childDefinition: import('@json-layout/vocabulary').Child | null, parentDisplay: import('./utils/display.js').Display, data: unknown, parentContext: import('../compile/types.js').ParentContextExpression | null, validationState: import('./types.js').ValidationState, reusedNode?: import("./types.js").StateNode | undefined): import('./types.js').StateNode;
|
|
34
|
+
/** @type {(draft: any, node: import('./types.js').StateNode, data: unknown) => any} */
|
|
35
|
+
export const producePatchedData: (draft: any, node: import('./types.js').StateNode, data: unknown) => any;
|
|
36
|
+
//# sourceMappingURL=state-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-node.d.ts","sourceRoot":"","sources":["../../src/state/state-node.js"],"names":[],"mappings":"AAkLA;;;;;;;;;;;GAWG;AACH,4CAXW,OAAO,aAAa,EAAE,kBAAkB,EAAE,cAC1C,OAAO,yBAAyB,EAAE,UAAU,QAC5C,GAAG,WACH,OAAO,YAAY,EAAE,gBAAgB,WACrC,OAAO,oBAAoB,EAAE,OAAO,UACpC,OAAO,yBAAyB,EAAE,cAAc,aAChD,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,gBAAgB,CAAC,YAC9C,OAAO,iBACP,OAAO,qBAAqB,EAAE,uBAAuB,GAAG,IAAI,GAC1D,GAAG,CAef;AA+BD;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAjBW,OAAO,YAAY,EAAE,sBAAsB,iBAC3C,OAAO,YAAY,EAAE,gBAAgB,kBACrC,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,iBACP,OAAO,qBAAqB,EAAE,uBAAuB,GAAG,IAAI,mBAC5D,OAAO,YAAY,EAAE,eAAe,4DAElC,OAAO,YAAY,EAAE,SAAS,CAuT1C;AAED,uFAAuF;AACvF,yCADmB,GAAG,QAAQ,OAAO,YAAY,EAAE,SAAS,QAAQ,OAAO,KAAK,GAAG,CAOjF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('./types.js').CreateStateTreeContext} context
|
|
3
|
+
* @param {import('./types.js').StatefulLayoutOptions} options
|
|
4
|
+
* @param {import('../index.js').CompiledLayout} compiledLayout
|
|
5
|
+
* @param {import('../index.js').SkeletonTree} skeleton
|
|
6
|
+
* @param {import('./utils/display.js').Display} display
|
|
7
|
+
* @param {unknown} data
|
|
8
|
+
* @param {import('./types.js').ValidationState} validationState
|
|
9
|
+
* @param {import('./types.js').StateTree} [reusedStateTree]
|
|
10
|
+
* @returns {import('./types.js').StateTree}
|
|
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, data: unknown, validationState: import('./types.js').ValidationState, reusedStateTree?: import("./types.js").StateTree | undefined): import('./types.js').StateTree;
|
|
13
|
+
//# sourceMappingURL=state-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-tree.d.ts","sourceRoot":"","sources":["../../src/state/state-tree.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;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,CA6D1C"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { type ErrorObject } from 'ajv/dist/2019.js';
|
|
2
|
+
import { type BaseCompObject, type Cols, type StateNodeOptionsBase, 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 Autocomplete, type Tabs, type VerticalTabs, type ExpansionPanels, type Stepper, type List, type Combobox, type FileInput, type Card, type Child, type StateNodePropsLib } from '@json-layout/vocabulary';
|
|
3
|
+
import { type SkeletonTree, type SkeletonNode, type StatefulLayout, type CompiledLayout } from '../index.js';
|
|
4
|
+
import { type LocaleMessages } from '../i18n/types.js';
|
|
5
|
+
export interface StateNode {
|
|
6
|
+
key: string | number;
|
|
7
|
+
fullKey: string;
|
|
8
|
+
parentFullKey: string | null;
|
|
9
|
+
dataPath: string;
|
|
10
|
+
parentDataPath: string | null;
|
|
11
|
+
skeleton: SkeletonNode;
|
|
12
|
+
layout: BaseCompObject;
|
|
13
|
+
cols: Cols;
|
|
14
|
+
data: unknown;
|
|
15
|
+
error: string | undefined;
|
|
16
|
+
childError: boolean | undefined;
|
|
17
|
+
validated: boolean;
|
|
18
|
+
width: number;
|
|
19
|
+
options: StateNodeOptions;
|
|
20
|
+
messages: LocaleMessages;
|
|
21
|
+
autofocus?: boolean;
|
|
22
|
+
autofocusChild?: string | number;
|
|
23
|
+
props?: StateNodePropsLib;
|
|
24
|
+
itemsCacheKey: any;
|
|
25
|
+
children?: StateNode[];
|
|
26
|
+
}
|
|
27
|
+
export interface StateTree {
|
|
28
|
+
root: StateNode;
|
|
29
|
+
valid: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateStateTreeContext {
|
|
32
|
+
allErrors?: ErrorObject[];
|
|
33
|
+
errors?: ErrorObject[];
|
|
34
|
+
additionalPropertiesErrors?: ErrorObject[];
|
|
35
|
+
files: FileRef[];
|
|
36
|
+
activatedItems: Record<string, number>;
|
|
37
|
+
autofocusTarget: string | null;
|
|
38
|
+
initial: boolean;
|
|
39
|
+
rehydrate: boolean;
|
|
40
|
+
cacheKeys: Record<string, StateNodeCacheKey>;
|
|
41
|
+
rootData: unknown;
|
|
42
|
+
nodes: StateNode[];
|
|
43
|
+
}
|
|
44
|
+
export interface FileRef {
|
|
45
|
+
file: File;
|
|
46
|
+
dataPath: string;
|
|
47
|
+
}
|
|
48
|
+
export type StateNodeCacheKey = [
|
|
49
|
+
StateNodeOptions,
|
|
50
|
+
CompiledLayout,
|
|
51
|
+
string,
|
|
52
|
+
SkeletonNode,
|
|
53
|
+
Child | null,
|
|
54
|
+
number,
|
|
55
|
+
boolean,
|
|
56
|
+
Record<string, number>,
|
|
57
|
+
boolean,
|
|
58
|
+
unknown
|
|
59
|
+
];
|
|
60
|
+
export interface ValidationState {
|
|
61
|
+
initialized: boolean;
|
|
62
|
+
validatedForm: boolean;
|
|
63
|
+
validatedChildren: string[];
|
|
64
|
+
}
|
|
65
|
+
export type StateNodeOptions = Required<StateNodeOptionsBase & {
|
|
66
|
+
context: Record<string, any>;
|
|
67
|
+
messages: LocaleMessages;
|
|
68
|
+
onData: (data: any) => void;
|
|
69
|
+
onUpdate: (statefulLayout: StatefulLayout) => void;
|
|
70
|
+
onAutofocus: (key: string) => void;
|
|
71
|
+
}>;
|
|
72
|
+
export type StatefulLayoutOptions = StateNodeOptions & {
|
|
73
|
+
width: number;
|
|
74
|
+
};
|
|
75
|
+
export type TextFieldNode = Omit<StateNode, 'children'> & {
|
|
76
|
+
layout: TextField;
|
|
77
|
+
data: string | undefined | null;
|
|
78
|
+
};
|
|
79
|
+
export type TextareaNode = Omit<StateNode, 'children'> & {
|
|
80
|
+
layout: Textarea;
|
|
81
|
+
data: string | undefined | null;
|
|
82
|
+
};
|
|
83
|
+
export type NumberFieldNode = Omit<StateNode, 'children'> & {
|
|
84
|
+
layout: NumberField;
|
|
85
|
+
data: number | undefined | null;
|
|
86
|
+
};
|
|
87
|
+
export type SliderNode = Omit<StateNode, 'children'> & {
|
|
88
|
+
layout: Slider;
|
|
89
|
+
data: number | undefined | null;
|
|
90
|
+
};
|
|
91
|
+
export type CheckboxNode = Omit<StateNode, 'children'> & {
|
|
92
|
+
layout: Checkbox;
|
|
93
|
+
data: boolean | undefined | null;
|
|
94
|
+
};
|
|
95
|
+
export type SwitchNode = Omit<StateNode, 'children'> & {
|
|
96
|
+
layout: Switch;
|
|
97
|
+
data: boolean | undefined | null;
|
|
98
|
+
};
|
|
99
|
+
export type DatePickerNode = Omit<StateNode, 'children'> & {
|
|
100
|
+
layout: DatePicker;
|
|
101
|
+
data: string | undefined | null;
|
|
102
|
+
};
|
|
103
|
+
export type DateTimePickerNode = Omit<StateNode, 'children'> & {
|
|
104
|
+
layout: DateTimePicker;
|
|
105
|
+
data: string | undefined | null;
|
|
106
|
+
};
|
|
107
|
+
export type TimePickerNode = Omit<StateNode, 'children'> & {
|
|
108
|
+
layout: TimePicker;
|
|
109
|
+
data: string | undefined | null;
|
|
110
|
+
};
|
|
111
|
+
export type ColorPickerNode = Omit<StateNode, 'children'> & {
|
|
112
|
+
layout: ColorPicker;
|
|
113
|
+
data: string | undefined | null;
|
|
114
|
+
};
|
|
115
|
+
export type SectionNode = StateNode & {
|
|
116
|
+
layout: Section;
|
|
117
|
+
children: StateNode[];
|
|
118
|
+
};
|
|
119
|
+
export type OneOfSelectNode = StateNode & {
|
|
120
|
+
layout: OneOfSelect;
|
|
121
|
+
data: Record<string, unknown>;
|
|
122
|
+
childrenTrees: SkeletonTree[];
|
|
123
|
+
};
|
|
124
|
+
export type SelectNode = Omit<StateNode, 'children'> & {
|
|
125
|
+
layout: Select;
|
|
126
|
+
data: any;
|
|
127
|
+
};
|
|
128
|
+
export type AutocompleteNode = Omit<StateNode, 'children'> & {
|
|
129
|
+
layout: Autocomplete;
|
|
130
|
+
data: any;
|
|
131
|
+
};
|
|
132
|
+
export type RadioGroupNode = Omit<StateNode, 'children'> & {
|
|
133
|
+
layout: Select;
|
|
134
|
+
data: any;
|
|
135
|
+
};
|
|
136
|
+
export type CheckboxGroupNode = Omit<StateNode, 'children'> & {
|
|
137
|
+
layout: Select;
|
|
138
|
+
data: any;
|
|
139
|
+
};
|
|
140
|
+
export type SwitchGroupNode = Omit<StateNode, 'children'> & {
|
|
141
|
+
layout: Select;
|
|
142
|
+
data: any;
|
|
143
|
+
};
|
|
144
|
+
export type TabsNode = StateNode & {
|
|
145
|
+
layout: Tabs;
|
|
146
|
+
children: StateNode[];
|
|
147
|
+
};
|
|
148
|
+
export type VerticalTabsNode = StateNode & {
|
|
149
|
+
layout: VerticalTabs;
|
|
150
|
+
children: StateNode[];
|
|
151
|
+
};
|
|
152
|
+
export type ExpansionPanelsNode = StateNode & {
|
|
153
|
+
layout: ExpansionPanels;
|
|
154
|
+
children: StateNode[];
|
|
155
|
+
};
|
|
156
|
+
export type StepperNode = StateNode & {
|
|
157
|
+
layout: Stepper;
|
|
158
|
+
children: StateNode[];
|
|
159
|
+
};
|
|
160
|
+
export type ListNode = StateNode & {
|
|
161
|
+
layout: List;
|
|
162
|
+
data: any[];
|
|
163
|
+
children: StateNode[];
|
|
164
|
+
childrenTrees: SkeletonTree[];
|
|
165
|
+
};
|
|
166
|
+
export type ComboboxNode = Omit<StateNode, 'children'> & {
|
|
167
|
+
layout: Combobox;
|
|
168
|
+
data: any[];
|
|
169
|
+
};
|
|
170
|
+
export type FileInputNode = Omit<StateNode, 'children'> & {
|
|
171
|
+
layout: FileInput;
|
|
172
|
+
data: object | undefined | null;
|
|
173
|
+
};
|
|
174
|
+
export type CardNode = StateNode & {
|
|
175
|
+
layout: Card;
|
|
176
|
+
children: StateNode[];
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,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@json-layout/vocabulary").Cols]}
|
|
5
|
+
*/
|
|
6
|
+
export function getChildDisplay(parentDisplay: Display, colsObj: import("@json-layout/vocabulary").ColsObj | undefined): [Display, import("@json-layout/vocabulary").Cols];
|
|
7
|
+
export class Display {
|
|
8
|
+
/**
|
|
9
|
+
* @param {number} width
|
|
10
|
+
*/
|
|
11
|
+
constructor(width: number);
|
|
12
|
+
/**
|
|
13
|
+
* @readonly
|
|
14
|
+
* @type {number}
|
|
15
|
+
*/
|
|
16
|
+
readonly width: number;
|
|
17
|
+
/** @returns {BreakPointName} */
|
|
18
|
+
get name(): BreakPointName;
|
|
19
|
+
/** @returns {boolean} */
|
|
20
|
+
get xs(): boolean;
|
|
21
|
+
/** @returns {boolean} */
|
|
22
|
+
get sm(): boolean;
|
|
23
|
+
/** @returns {boolean} */
|
|
24
|
+
get smAndDown(): boolean;
|
|
25
|
+
/** @returns {boolean} */
|
|
26
|
+
get smAndUp(): boolean;
|
|
27
|
+
/** @returns {boolean} */
|
|
28
|
+
get md(): boolean;
|
|
29
|
+
/** @returns {boolean} */
|
|
30
|
+
get mdAndDown(): boolean;
|
|
31
|
+
/** @returns {boolean} */
|
|
32
|
+
get mobile(): boolean;
|
|
33
|
+
/** @returns {boolean} */
|
|
34
|
+
get mdAndUp(): boolean;
|
|
35
|
+
/** @returns {boolean} */
|
|
36
|
+
get lg(): boolean;
|
|
37
|
+
/** @returns {boolean} */
|
|
38
|
+
get lgAndDown(): boolean;
|
|
39
|
+
/** @returns {boolean} */
|
|
40
|
+
get lgAndUp(): boolean;
|
|
41
|
+
/** @returns {boolean} */
|
|
42
|
+
get xl(): boolean;
|
|
43
|
+
/** @returns {boolean} */
|
|
44
|
+
get xlAndDown(): boolean;
|
|
45
|
+
/** @returns {boolean} */
|
|
46
|
+
get xlAndUp(): boolean;
|
|
47
|
+
/** @returns {boolean} */
|
|
48
|
+
get xxl(): boolean;
|
|
49
|
+
}
|
|
50
|
+
export type BreakPointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
51
|
+
//# sourceMappingURL=display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../src/state/utils/display.js"],"names":[],"mappings":"AAoHA;;;;GAIG;AACH,+CAJW,OAAO,WACP,OAAO,yBAAyB,EAAE,OAAO,GAAG,SAAS,GACnD,CAAC,OAAO,EAAE,OAAO,yBAAyB,EAAE,IAAI,CAAC,CAY7D;AAjHD;IAOE;;OAEG;IACH,mBAFW,MAAM,EAIhB;IAXD;;;OAGG;IACH,gBAFU,MAAM,CAEX;IASL,gCAAgC;IAChC,2BAKC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,sBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,kBAEC;IAED,yBAAyB;IACzB,yBAEC;IAED,yBAAyB;IACzB,uBAEC;IAED,yBAAyB;IACzB,mBAEC;CACF;6BAhHa,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @template ItemType
|
|
3
|
+
* @param {ItemType[]} previousArray
|
|
4
|
+
* @param {ItemType[]} newArray
|
|
5
|
+
* @returns {ItemType[]}
|
|
6
|
+
*/
|
|
7
|
+
export function shallowProduceArray<ItemType>(previousArray?: ItemType[], newArray?: ItemType[]): ItemType[];
|
|
8
|
+
/**
|
|
9
|
+
* @param {Record<string, any>} previousObj
|
|
10
|
+
* @param {Record<string, any>} newObj
|
|
11
|
+
* @returns {Record<string, any>}
|
|
12
|
+
*/
|
|
13
|
+
export function shallowProduceObject(previousObj?: Record<string, any>, newObj?: Record<string, any>): Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* @template ItemType
|
|
16
|
+
* @param {any[] | null | undefined} a1
|
|
17
|
+
* @param {any[] | null | undefined} a2
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export function shallowEqualArray<ItemType>(a1?: any[] | null | undefined, a2?: any[] | null | undefined): boolean;
|
|
21
|
+
//# sourceMappingURL=immutable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutable.d.ts","sourceRoot":"","sources":["../../../src/state/utils/immutable.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,6GAIC;AAED;;;;GAIG;AACH,mDAJW,OAAO,MAAM,EAAE,GAAG,CAAC,WACnB,OAAO,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,MAAM,EAAE,GAAG,CAAC,CAW/B;AAED;;;;;GAKG;AACH,iDAJW,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,OACxB,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,GACtB,OAAO,CAOnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/utils/build.js"],"names":[],"mappings":"AAEA,uBAAuB;AACvB,2BADW,MAAM,EAAE,CAUlB;AAED,yBAAyB;AACzB,gCADW,MAAM,EAAE,EAAE,CAUpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{key: string, description: string, default?: any, values?: Record<string, any>}[]} DocOptions
|
|
3
|
+
*/
|
|
4
|
+
/** @type {DocOptions} */
|
|
5
|
+
export const compileOptions: DocOptions;
|
|
6
|
+
/** @type {DocOptions} */
|
|
7
|
+
export const runtimeOptions: DocOptions;
|
|
8
|
+
export type DocOptions = {
|
|
9
|
+
key: string;
|
|
10
|
+
description: string;
|
|
11
|
+
default?: any;
|
|
12
|
+
values?: Record<string, any>;
|
|
13
|
+
}[];
|
|
14
|
+
//# sourceMappingURL=doc-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-options.d.ts","sourceRoot":"","sources":["../../src/utils/doc-options.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH,yBAAyB;AACzB,wCA+BC;AAED,yBAAyB;AACzB,wCA8GC;yBApJY;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,CAAA;CAAC,EAAE"}
|