@rjsf/utils 6.0.0-beta.19 → 6.0.0-beta.20
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/dist/index.cjs +32 -112
- package/dist/index.cjs.map +4 -4
- package/dist/utils.esm.js +32 -112
- package/dist/utils.esm.js.map +4 -4
- package/dist/utils.umd.js +14 -91
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +2 -0
- package/lib/constants.js.map +1 -1
- package/lib/createSchemaUtils.js +1 -13
- package/lib/createSchemaUtils.js.map +1 -1
- package/lib/enums.d.ts +3 -3
- package/lib/enums.js +3 -3
- package/lib/idGenerators.d.ts +15 -15
- package/lib/idGenerators.js +8 -8
- package/lib/idGenerators.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/schema/index.d.ts +1 -2
- package/lib/schema/index.js +1 -2
- package/lib/schema/index.js.map +1 -1
- package/lib/toFieldPathId.d.ts +12 -0
- package/lib/toFieldPathId.js +19 -0
- package/lib/toFieldPathId.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +42 -41
- package/package.json +1 -1
- package/src/constants.ts +2 -0
- package/src/createSchemaUtils.ts +0 -24
- package/src/enums.ts +3 -3
- package/src/idGenerators.ts +25 -25
- package/src/index.ts +2 -0
- package/src/schema/index.ts +0 -2
- package/src/toFieldPathId.ts +24 -0
- package/src/types.ts +43 -45
- package/lib/schema/toIdSchema.d.ts +0 -14
- package/lib/schema/toIdSchema.js +0 -62
- package/lib/schema/toIdSchema.js.map +0 -1
- package/src/schema/toIdSchema.ts +0 -131
package/dist/utils.umd.js
CHANGED
|
@@ -72,6 +72,8 @@
|
|
|
72
72
|
var SUBMIT_BTN_OPTIONS_KEY = "submitButtonOptions";
|
|
73
73
|
var REF_KEY = "$ref";
|
|
74
74
|
var SCHEMA_KEY = "$schema";
|
|
75
|
+
var DEFAULT_ID_PREFIX = "root";
|
|
76
|
+
var DEFAULT_ID_SEPARATOR = "_";
|
|
75
77
|
var DISCRIMINATOR_PATH = ["discriminator", "propertyName"];
|
|
76
78
|
var FORM_CONTEXT_NAME = "formContext";
|
|
77
79
|
var LOOKUP_MAP_NAME = "layoutGridLookupMap";
|
|
@@ -1945,75 +1947,6 @@
|
|
|
1945
1947
|
}
|
|
1946
1948
|
return newFormData;
|
|
1947
1949
|
}
|
|
1948
|
-
function toIdSchemaInternal(validator, schema, idPrefix, idSeparator, id, rootSchema, formData, _recurseList = [], experimental_customMergeAllOf) {
|
|
1949
|
-
const $id = id || idPrefix;
|
|
1950
|
-
const idSchema = { $id };
|
|
1951
|
-
if (typeof schema === "object") {
|
|
1952
|
-
if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {
|
|
1953
|
-
const _schema = retrieveSchema(validator, schema, rootSchema, formData, experimental_customMergeAllOf);
|
|
1954
|
-
const sameSchemaIndex = _recurseList.findIndex((item) => deepEquals(item, _schema));
|
|
1955
|
-
if (sameSchemaIndex === -1) {
|
|
1956
|
-
return toIdSchemaInternal(
|
|
1957
|
-
validator,
|
|
1958
|
-
_schema,
|
|
1959
|
-
idPrefix,
|
|
1960
|
-
idSeparator,
|
|
1961
|
-
id,
|
|
1962
|
-
rootSchema,
|
|
1963
|
-
formData,
|
|
1964
|
-
_recurseList.concat(_schema),
|
|
1965
|
-
experimental_customMergeAllOf
|
|
1966
|
-
);
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
if (ITEMS_KEY in schema && !get13(schema, [ITEMS_KEY, REF_KEY])) {
|
|
1970
|
-
return toIdSchemaInternal(
|
|
1971
|
-
validator,
|
|
1972
|
-
get13(schema, ITEMS_KEY),
|
|
1973
|
-
idPrefix,
|
|
1974
|
-
idSeparator,
|
|
1975
|
-
id,
|
|
1976
|
-
rootSchema,
|
|
1977
|
-
formData,
|
|
1978
|
-
_recurseList,
|
|
1979
|
-
experimental_customMergeAllOf
|
|
1980
|
-
);
|
|
1981
|
-
}
|
|
1982
|
-
if (getSchemaType(schema) === "object" && PROPERTIES_KEY in schema) {
|
|
1983
|
-
for (const name in schema.properties) {
|
|
1984
|
-
const field = schema[PROPERTIES_KEY][name];
|
|
1985
|
-
const fieldId = idSchema[ID_KEY] + idSeparator + name;
|
|
1986
|
-
idSchema[name] = toIdSchemaInternal(
|
|
1987
|
-
validator,
|
|
1988
|
-
field,
|
|
1989
|
-
idPrefix,
|
|
1990
|
-
idSeparator,
|
|
1991
|
-
fieldId,
|
|
1992
|
-
rootSchema,
|
|
1993
|
-
// It's possible that formData is not an object -- this can happen if an
|
|
1994
|
-
// array item has just been added, but not populated with data yet
|
|
1995
|
-
get13(formData, [name]),
|
|
1996
|
-
_recurseList,
|
|
1997
|
-
experimental_customMergeAllOf
|
|
1998
|
-
);
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
}
|
|
2002
|
-
return idSchema;
|
|
2003
|
-
}
|
|
2004
|
-
function toIdSchema(validator, schema, id, rootSchema, formData, idPrefix = "root", idSeparator = "_", experimental_customMergeAllOf) {
|
|
2005
|
-
return toIdSchemaInternal(
|
|
2006
|
-
validator,
|
|
2007
|
-
schema,
|
|
2008
|
-
idPrefix,
|
|
2009
|
-
idSeparator,
|
|
2010
|
-
id,
|
|
2011
|
-
rootSchema,
|
|
2012
|
-
formData,
|
|
2013
|
-
void 0,
|
|
2014
|
-
experimental_customMergeAllOf
|
|
2015
|
-
);
|
|
2016
|
-
}
|
|
2017
1950
|
function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _recurseList = [], experimental_customMergeAllOf) {
|
|
2018
1951
|
if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {
|
|
2019
1952
|
const _schema = retrieveSchema(validator, schema, rootSchema, formData, experimental_customMergeAllOf);
|
|
@@ -2362,27 +2295,6 @@
|
|
|
2362
2295
|
this.experimental_customMergeAllOf
|
|
2363
2296
|
);
|
|
2364
2297
|
}
|
|
2365
|
-
/** Generates an `IdSchema` object for the `schema`, recursively
|
|
2366
|
-
*
|
|
2367
|
-
* @param schema - The schema for which the display label flag is desired
|
|
2368
|
-
* @param [id] - The base id for the schema
|
|
2369
|
-
* @param [formData] - The current formData, if any, onto which to provide any missing defaults
|
|
2370
|
-
* @param [idPrefix='root'] - The prefix to use for the id
|
|
2371
|
-
* @param [idSeparator='_'] - The separator to use for the path segments in the id
|
|
2372
|
-
* @returns - The `IdSchema` object for the `schema`
|
|
2373
|
-
*/
|
|
2374
|
-
toIdSchema(schema, id, formData, idPrefix = "root", idSeparator = "_") {
|
|
2375
|
-
return toIdSchema(
|
|
2376
|
-
this.validator,
|
|
2377
|
-
schema,
|
|
2378
|
-
id,
|
|
2379
|
-
this.rootSchema,
|
|
2380
|
-
formData,
|
|
2381
|
-
idPrefix,
|
|
2382
|
-
idSeparator,
|
|
2383
|
-
this.experimental_customMergeAllOf
|
|
2384
|
-
);
|
|
2385
|
-
}
|
|
2386
2298
|
/** Generates an `PathSchema` object for the `schema`, recursively
|
|
2387
2299
|
*
|
|
2388
2300
|
* @param schema - The schema for which the display label flag is desired
|
|
@@ -3083,6 +2995,15 @@
|
|
|
3083
2995
|
}
|
|
3084
2996
|
return builder.ErrorSchema;
|
|
3085
2997
|
}
|
|
2998
|
+
|
|
2999
|
+
// src/toFieldPathId.ts
|
|
3000
|
+
function toFieldPathId(fieldPath, globalFormOptions, parentPath) {
|
|
3001
|
+
const basePath = Array.isArray(parentPath) ? parentPath : parentPath?.path;
|
|
3002
|
+
const childPath = fieldPath === "" ? [] : [fieldPath];
|
|
3003
|
+
const path = basePath ? basePath.concat(...childPath) : childPath;
|
|
3004
|
+
const id = [globalFormOptions.idPrefix, ...path].join(globalFormOptions.idSeparator);
|
|
3005
|
+
return { path, [ID_KEY]: id };
|
|
3006
|
+
}
|
|
3086
3007
|
function unwrapErrorHandler(errorHandler) {
|
|
3087
3008
|
return Object.keys(errorHandler).reduce((acc, key) => {
|
|
3088
3009
|
if (key === "addError") {
|
|
@@ -3327,6 +3248,8 @@
|
|
|
3327
3248
|
exports.ALL_OF_KEY = ALL_OF_KEY;
|
|
3328
3249
|
exports.ANY_OF_KEY = ANY_OF_KEY;
|
|
3329
3250
|
exports.CONST_KEY = CONST_KEY;
|
|
3251
|
+
exports.DEFAULT_ID_PREFIX = DEFAULT_ID_PREFIX;
|
|
3252
|
+
exports.DEFAULT_ID_SEPARATOR = DEFAULT_ID_SEPARATOR;
|
|
3330
3253
|
exports.DEFAULT_KEY = DEFAULT_KEY;
|
|
3331
3254
|
exports.DEFINITIONS_KEY = DEFINITIONS_KEY;
|
|
3332
3255
|
exports.DEPENDENCIES_KEY = DEPENDENCIES_KEY;
|
|
@@ -3434,7 +3357,7 @@
|
|
|
3434
3357
|
exports.toDateString = toDateString;
|
|
3435
3358
|
exports.toErrorList = toErrorList;
|
|
3436
3359
|
exports.toErrorSchema = toErrorSchema;
|
|
3437
|
-
exports.
|
|
3360
|
+
exports.toFieldPathId = toFieldPathId;
|
|
3438
3361
|
exports.toPathSchema = toPathSchema;
|
|
3439
3362
|
exports.unwrapErrorHandler = unwrapErrorHandler;
|
|
3440
3363
|
exports.utcToLocal = utcToLocal;
|
package/lib/constants.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare const REQUIRED_KEY = "required";
|
|
|
26
26
|
export declare const SUBMIT_BTN_OPTIONS_KEY = "submitButtonOptions";
|
|
27
27
|
export declare const REF_KEY = "$ref";
|
|
28
28
|
export declare const SCHEMA_KEY = "$schema";
|
|
29
|
+
export declare const DEFAULT_ID_PREFIX = "root";
|
|
30
|
+
export declare const DEFAULT_ID_SEPARATOR = "_";
|
|
29
31
|
/** The path of the discriminator value returned by the schema endpoint.
|
|
30
32
|
* The discriminator is the value in a `oneOf` that determines which option is selected.
|
|
31
33
|
*/
|
package/lib/constants.js
CHANGED
|
@@ -26,6 +26,8 @@ export const REQUIRED_KEY = 'required';
|
|
|
26
26
|
export const SUBMIT_BTN_OPTIONS_KEY = 'submitButtonOptions';
|
|
27
27
|
export const REF_KEY = '$ref';
|
|
28
28
|
export const SCHEMA_KEY = '$schema';
|
|
29
|
+
export const DEFAULT_ID_PREFIX = 'root';
|
|
30
|
+
export const DEFAULT_ID_SEPARATOR = '_';
|
|
29
31
|
/** The path of the discriminator value returned by the schema endpoint.
|
|
30
32
|
* The discriminator is the value in a `oneOf` that determines which option is selected.
|
|
31
33
|
*/
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;AACrC,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC;AAC5B,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC;AAChC,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,sBAAsB,G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AAe,GAAG,qBAAqB,CAAC;AACrD,MAAM,CAAC,MAAM,+BAA+B,GAAG,6BAA6B,CAAC;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD;GACG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8CAA8C,CAAC;AACxF,MAAM,CAAC,MAAM,yBAAyB,GAAG,8CAA8C,CAAC"}
|
package/lib/createSchemaUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import deepEquals from './deepEquals.js';
|
|
2
|
-
import { findFieldInSchema, findSelectedOptionInXxxOf, getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getFromSchema, isFilesArray, isMultiSelect, isSelect, retrieveSchema, sanitizeDataForNewSchema,
|
|
2
|
+
import { findFieldInSchema, findSelectedOptionInXxxOf, getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getFromSchema, isFilesArray, isMultiSelect, isSelect, retrieveSchema, sanitizeDataForNewSchema, toPathSchema, } from './schema/index.js';
|
|
3
3
|
import { makeAllReferencesAbsolute } from './findSchemaDefinition.js';
|
|
4
4
|
import { ID_KEY, JSON_SCHEMA_DRAFT_2020_12, SCHEMA_KEY } from './constants.js';
|
|
5
5
|
import get from 'lodash-es/get.js';
|
|
@@ -196,18 +196,6 @@ class SchemaUtils {
|
|
|
196
196
|
sanitizeDataForNewSchema(newSchema, oldSchema, data) {
|
|
197
197
|
return sanitizeDataForNewSchema(this.validator, this.rootSchema, newSchema, oldSchema, data, this.experimental_customMergeAllOf);
|
|
198
198
|
}
|
|
199
|
-
/** Generates an `IdSchema` object for the `schema`, recursively
|
|
200
|
-
*
|
|
201
|
-
* @param schema - The schema for which the display label flag is desired
|
|
202
|
-
* @param [id] - The base id for the schema
|
|
203
|
-
* @param [formData] - The current formData, if any, onto which to provide any missing defaults
|
|
204
|
-
* @param [idPrefix='root'] - The prefix to use for the id
|
|
205
|
-
* @param [idSeparator='_'] - The separator to use for the path segments in the id
|
|
206
|
-
* @returns - The `IdSchema` object for the `schema`
|
|
207
|
-
*/
|
|
208
|
-
toIdSchema(schema, id, formData, idPrefix = 'root', idSeparator = '_') {
|
|
209
|
-
return toIdSchema(this.validator, schema, id, this.rootSchema, formData, idPrefix, idSeparator, this.experimental_customMergeAllOf);
|
|
210
|
-
}
|
|
211
199
|
/** Generates an `PathSchema` object for the `schema`, recursively
|
|
212
200
|
*
|
|
213
201
|
* @param schema - The schema for which the display label flag is desired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSchemaUtils.js","sourceRoot":"","sources":["../src/createSchemaUtils.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"createSchemaUtils.js","sourceRoot":"","sources":["../src/createSchemaUtils.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AActC,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,wBAAwB,EACxB,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW;IAQf;;;;;;OAMG;IACH,YACE,SAAiC,EACjC,UAAa,EACb,qCAA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C,SAAS,EACd,MAAM,EACN,IAAI,EACJ,IAAI,CAAC,UAAU,EACf,QAAQ,EACR,IAAI,CAAC,6BAA6B,CACnC,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAKvC,SAAiC,EACjC,UAAa,EACb,qCAAqC,GAAG,EAAE,EAC1C,6BAAgE;IAEhE,OAAO,IAAI,WAAW,CACpB,SAAS,EACT,UAAU,EACV,qCAAqC,EACrC,6BAA6B,CAC9B,CAAC;AACJ,CAAC"}
|
package/lib/enums.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare enum TranslatableString {
|
|
|
61
61
|
InvalidObjectField = "Invalid \"%1\" object field configuration: _%2_.",
|
|
62
62
|
/** Unsupported field schema, used by UnsupportedField */
|
|
63
63
|
UnsupportedField = "Unsupported field schema.",
|
|
64
|
-
/** Unsupported field schema, where %1 will be replaced by the
|
|
64
|
+
/** Unsupported field schema, where %1 will be replaced by the FieldPathId.$id as provided by UnsupportedField.
|
|
65
65
|
* NOTE: Use markdown notation rather than html tags.
|
|
66
66
|
*/
|
|
67
67
|
UnsupportedFieldWithId = "Unsupported field schema for field `%1`.",
|
|
@@ -69,8 +69,8 @@ export declare enum TranslatableString {
|
|
|
69
69
|
* NOTE: Use markdown notation rather than html tags.
|
|
70
70
|
*/
|
|
71
71
|
UnsupportedFieldWithReason = "Unsupported field schema: _%1_.",
|
|
72
|
-
/** Unsupported field schema, where %1 and %2 will be replaced by the
|
|
73
|
-
* as provided by UnsupportedField.
|
|
72
|
+
/** Unsupported field schema, where %1 and %2 will be replaced by the FieldPathId.$id and reason strings,
|
|
73
|
+
* respectively, as provided by UnsupportedField.
|
|
74
74
|
* NOTE: Use markdown notation rather than html tags.
|
|
75
75
|
*/
|
|
76
76
|
UnsupportedFieldWithIdAndReason = "Unsupported field schema for field `%1`: _%2_.",
|
package/lib/enums.js
CHANGED
|
@@ -64,7 +64,7 @@ export var TranslatableString;
|
|
|
64
64
|
TranslatableString["InvalidObjectField"] = "Invalid \"%1\" object field configuration: _%2_.";
|
|
65
65
|
/** Unsupported field schema, used by UnsupportedField */
|
|
66
66
|
TranslatableString["UnsupportedField"] = "Unsupported field schema.";
|
|
67
|
-
/** Unsupported field schema, where %1 will be replaced by the
|
|
67
|
+
/** Unsupported field schema, where %1 will be replaced by the FieldPathId.$id as provided by UnsupportedField.
|
|
68
68
|
* NOTE: Use markdown notation rather than html tags.
|
|
69
69
|
*/
|
|
70
70
|
TranslatableString["UnsupportedFieldWithId"] = "Unsupported field schema for field `%1`.";
|
|
@@ -72,8 +72,8 @@ export var TranslatableString;
|
|
|
72
72
|
* NOTE: Use markdown notation rather than html tags.
|
|
73
73
|
*/
|
|
74
74
|
TranslatableString["UnsupportedFieldWithReason"] = "Unsupported field schema: _%1_.";
|
|
75
|
-
/** Unsupported field schema, where %1 and %2 will be replaced by the
|
|
76
|
-
* as provided by UnsupportedField.
|
|
75
|
+
/** Unsupported field schema, where %1 and %2 will be replaced by the FieldPathId.$id and reason strings,
|
|
76
|
+
* respectively, as provided by UnsupportedField.
|
|
77
77
|
* NOTE: Use markdown notation rather than html tags.
|
|
78
78
|
*/
|
|
79
79
|
TranslatableString["UnsupportedFieldWithIdAndReason"] = "Unsupported field schema for field `%1`: _%2_.";
|
package/lib/idGenerators.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldPathId } from './types.js';
|
|
2
2
|
/** Return a consistent `id` for the field description element
|
|
3
3
|
*
|
|
4
|
-
* @param id - Either simple string id or an
|
|
4
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
5
5
|
* @returns - The consistent id for the field description element from the given `id`
|
|
6
6
|
*/
|
|
7
|
-
export declare function descriptionId
|
|
7
|
+
export declare function descriptionId(id: FieldPathId | string): string;
|
|
8
8
|
/** Return a consistent `id` for the field error element
|
|
9
9
|
*
|
|
10
|
-
* @param id - Either simple string id or an
|
|
10
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
11
11
|
* @returns - The consistent id for the field error element from the given `id`
|
|
12
12
|
*/
|
|
13
|
-
export declare function errorId
|
|
13
|
+
export declare function errorId(id: FieldPathId | string): string;
|
|
14
14
|
/** Return a consistent `id` for the field examples element
|
|
15
15
|
*
|
|
16
|
-
* @param id - Either simple string id or an
|
|
16
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
17
17
|
* @returns - The consistent id for the field examples element from the given `id`
|
|
18
18
|
*/
|
|
19
|
-
export declare function examplesId
|
|
19
|
+
export declare function examplesId(id: FieldPathId | string): string;
|
|
20
20
|
/** Return a consistent `id` for the field help element
|
|
21
21
|
*
|
|
22
|
-
* @param id - Either simple string id or an
|
|
22
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
23
23
|
* @returns - The consistent id for the field help element from the given `id`
|
|
24
24
|
*/
|
|
25
|
-
export declare function helpId
|
|
25
|
+
export declare function helpId(id: FieldPathId | string): string;
|
|
26
26
|
/** Return a consistent `id` for the field title element
|
|
27
27
|
*
|
|
28
|
-
* @param id - Either simple string id or an
|
|
28
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
29
29
|
* @returns - The consistent id for the field title element from the given `id`
|
|
30
30
|
*/
|
|
31
|
-
export declare function titleId
|
|
31
|
+
export declare function titleId(id: FieldPathId | string): string;
|
|
32
32
|
/** Return a list of element ids that contain additional information about the field that can be used to as the aria
|
|
33
33
|
* description of the field. This is correctly omitting `titleId` which would be "labeling" rather than "describing" the
|
|
34
34
|
* element.
|
|
35
35
|
*
|
|
36
|
-
* @param id - Either simple string id or an
|
|
36
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
37
37
|
* @param [includeExamples=false] - Optional flag, if true, will add the `examplesId` into the list
|
|
38
38
|
* @returns - The string containing the list of ids for use in an `aria-describedBy` attribute
|
|
39
39
|
*/
|
|
40
|
-
export declare function ariaDescribedByIds
|
|
40
|
+
export declare function ariaDescribedByIds(id: FieldPathId | string, includeExamples?: boolean): string;
|
|
41
41
|
/** Return a consistent `id` for the `optionIndex`s of a `Radio` or `Checkboxes` widget
|
|
42
42
|
*
|
|
43
43
|
* @param id - The id of the parent component for the option
|
|
@@ -47,8 +47,8 @@ export declare function ariaDescribedByIds<T = any>(id: IdSchema<T> | string, in
|
|
|
47
47
|
export declare function optionId(id: string, optionIndex: number): string;
|
|
48
48
|
/** Return a consistent `id` for the `btn` button element
|
|
49
49
|
*
|
|
50
|
-
* @param id - Either simple string id or an
|
|
50
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
51
51
|
* @param btn - The button type for which to generate the id
|
|
52
52
|
* @returns - The consistent id for the button from the given `id` and `btn` type
|
|
53
53
|
*/
|
|
54
|
-
export declare function buttonId
|
|
54
|
+
export declare function buttonId(id: FieldPathId | string, btn: 'add' | 'copy' | 'moveDown' | 'moveUp' | 'remove'): string;
|
package/lib/idGenerators.js
CHANGED
|
@@ -2,7 +2,7 @@ import isString from 'lodash-es/isString.js';
|
|
|
2
2
|
import { ID_KEY } from './constants.js';
|
|
3
3
|
/** Generates a consistent `id` pattern for a given `id` and a `suffix`
|
|
4
4
|
*
|
|
5
|
-
* @param id - Either simple string id or an
|
|
5
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
6
6
|
* @param suffix - The suffix to append to the id
|
|
7
7
|
*/
|
|
8
8
|
function idGenerator(id, suffix) {
|
|
@@ -11,7 +11,7 @@ function idGenerator(id, suffix) {
|
|
|
11
11
|
}
|
|
12
12
|
/** Return a consistent `id` for the field description element
|
|
13
13
|
*
|
|
14
|
-
* @param id - Either simple string id or an
|
|
14
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
15
15
|
* @returns - The consistent id for the field description element from the given `id`
|
|
16
16
|
*/
|
|
17
17
|
export function descriptionId(id) {
|
|
@@ -19,7 +19,7 @@ export function descriptionId(id) {
|
|
|
19
19
|
}
|
|
20
20
|
/** Return a consistent `id` for the field error element
|
|
21
21
|
*
|
|
22
|
-
* @param id - Either simple string id or an
|
|
22
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
23
23
|
* @returns - The consistent id for the field error element from the given `id`
|
|
24
24
|
*/
|
|
25
25
|
export function errorId(id) {
|
|
@@ -27,7 +27,7 @@ export function errorId(id) {
|
|
|
27
27
|
}
|
|
28
28
|
/** Return a consistent `id` for the field examples element
|
|
29
29
|
*
|
|
30
|
-
* @param id - Either simple string id or an
|
|
30
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
31
31
|
* @returns - The consistent id for the field examples element from the given `id`
|
|
32
32
|
*/
|
|
33
33
|
export function examplesId(id) {
|
|
@@ -35,7 +35,7 @@ export function examplesId(id) {
|
|
|
35
35
|
}
|
|
36
36
|
/** Return a consistent `id` for the field help element
|
|
37
37
|
*
|
|
38
|
-
* @param id - Either simple string id or an
|
|
38
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
39
39
|
* @returns - The consistent id for the field help element from the given `id`
|
|
40
40
|
*/
|
|
41
41
|
export function helpId(id) {
|
|
@@ -43,7 +43,7 @@ export function helpId(id) {
|
|
|
43
43
|
}
|
|
44
44
|
/** Return a consistent `id` for the field title element
|
|
45
45
|
*
|
|
46
|
-
* @param id - Either simple string id or an
|
|
46
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
47
47
|
* @returns - The consistent id for the field title element from the given `id`
|
|
48
48
|
*/
|
|
49
49
|
export function titleId(id) {
|
|
@@ -53,7 +53,7 @@ export function titleId(id) {
|
|
|
53
53
|
* description of the field. This is correctly omitting `titleId` which would be "labeling" rather than "describing" the
|
|
54
54
|
* element.
|
|
55
55
|
*
|
|
56
|
-
* @param id - Either simple string id or an
|
|
56
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
57
57
|
* @param [includeExamples=false] - Optional flag, if true, will add the `examplesId` into the list
|
|
58
58
|
* @returns - The string containing the list of ids for use in an `aria-describedBy` attribute
|
|
59
59
|
*/
|
|
@@ -72,7 +72,7 @@ export function optionId(id, optionIndex) {
|
|
|
72
72
|
}
|
|
73
73
|
/** Return a consistent `id` for the `btn` button element
|
|
74
74
|
*
|
|
75
|
-
* @param id - Either simple string id or an
|
|
75
|
+
* @param id - Either simple string id or an FieldPathId from which to extract it
|
|
76
76
|
* @param btn - The button type for which to generate the id
|
|
77
77
|
* @returns - The consistent id for the button from the given `id` and `btn` type
|
|
78
78
|
*/
|
package/lib/idGenerators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idGenerators.js","sourceRoot":"","sources":["../src/idGenerators.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;GAIG;AACH,SAAS,WAAW,
|
|
1
|
+
{"version":3,"file":"idGenerators.js","sourceRoot":"","sources":["../src/idGenerators.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;GAIG;AACH,SAAS,WAAW,CAAC,EAAwB,EAAE,MAAc;IAC3D,MAAM,KAAK,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,GAAG,KAAK,KAAK,MAAM,EAAE,CAAC;AAC/B,CAAC;AACD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAAwB;IACpD,OAAO,WAAW,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EAAwB;IAC9C,OAAO,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAwB;IACjD,OAAO,WAAW,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,EAAwB;IAC7C,OAAO,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EAAwB;IAC9C,OAAO,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAwB,EAAE,eAAe,GAAG,KAAK;IAClF,MAAM,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,IAAI,aAAa,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC;AACxE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAU,EAAE,WAAmB;IACtD,OAAO,GAAG,EAAE,IAAI,WAAW,EAAE,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAwB,EAAE,GAAsD;IACvG,OAAO,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ import toConstant from './toConstant.js';
|
|
|
50
50
|
import toDateString from './toDateString.js';
|
|
51
51
|
import toErrorList from './toErrorList.js';
|
|
52
52
|
import toErrorSchema from './toErrorSchema.js';
|
|
53
|
+
import toFieldPathId from './toFieldPathId.js';
|
|
53
54
|
import unwrapErrorHandler from './unwrapErrorHandler.js';
|
|
54
55
|
import utcToLocal from './utcToLocal.js';
|
|
55
56
|
import validationDataMerge from './validationDataMerge.js';
|
|
@@ -61,5 +62,5 @@ export * from './enums.js';
|
|
|
61
62
|
export * from './constants.js';
|
|
62
63
|
export * from './parser/index.js';
|
|
63
64
|
export * from './schema/index.js';
|
|
64
|
-
export { allowAdditionalItems, ariaDescribedByIds, asNumber, buttonId, canExpand, createErrorHandler, createSchemaUtils, DateElementFormat, dataURItoBlob, dateRangeOptions, deepEquals, descriptionId, englishStringTranslator, enumOptionsDeselectValue, enumOptionsIndexForValue, enumOptionsIsSelected, enumOptionsSelectValue, enumOptionsValueForIndex, errorId, examplesId, ErrorSchemaBuilder, findSchemaDefinition, getChangedFields, getDateElementProps, getDiscriminatorFieldFromSchema, getInputProps, getOptionMatchingSimpleDiscriminator, getSchemaType, getSubmitButtonOptions, getTemplate, getTestIds, getUiOptions, getWidget, guessType, hasWidget, hashForSchema, hashObject, hashString, helpId, isConstant, isCustomWidget, isFixedItems, isObject, labelValue, localToUTC, lookupFromFormContext, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, optionId, optionsList, orderProperties, pad, parseDateString, rangeSpec, replaceStringParameters, schemaRequiresTrueValue, shallowEquals, shouldRender, sortedJSONStringify, titleId, toConstant, toDateString, toErrorList, toErrorSchema, unwrapErrorHandler, utcToLocal, validationDataMerge, withIdRefPrefix, };
|
|
65
|
+
export { allowAdditionalItems, ariaDescribedByIds, asNumber, buttonId, canExpand, createErrorHandler, createSchemaUtils, DateElementFormat, dataURItoBlob, dateRangeOptions, deepEquals, descriptionId, englishStringTranslator, enumOptionsDeselectValue, enumOptionsIndexForValue, enumOptionsIsSelected, enumOptionsSelectValue, enumOptionsValueForIndex, errorId, examplesId, ErrorSchemaBuilder, findSchemaDefinition, getChangedFields, getDateElementProps, getDiscriminatorFieldFromSchema, getInputProps, getOptionMatchingSimpleDiscriminator, getSchemaType, getSubmitButtonOptions, getTemplate, getTestIds, getUiOptions, getWidget, guessType, hasWidget, hashForSchema, hashObject, hashString, helpId, isConstant, isCustomWidget, isFixedItems, isObject, labelValue, localToUTC, lookupFromFormContext, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, optionId, optionsList, orderProperties, pad, parseDateString, rangeSpec, replaceStringParameters, schemaRequiresTrueValue, shallowEquals, shouldRender, sortedJSONStringify, titleId, toConstant, toDateString, toErrorList, toErrorSchema, toFieldPathId, unwrapErrorHandler, utcToLocal, validationDataMerge, withIdRefPrefix, };
|
|
65
66
|
export type { ComponentUpdateStrategy } from './shouldRender.js';
|
package/lib/index.js
CHANGED
|
@@ -50,6 +50,7 @@ import toConstant from './toConstant.js';
|
|
|
50
50
|
import toDateString from './toDateString.js';
|
|
51
51
|
import toErrorList from './toErrorList.js';
|
|
52
52
|
import toErrorSchema from './toErrorSchema.js';
|
|
53
|
+
import toFieldPathId from './toFieldPathId.js';
|
|
53
54
|
import unwrapErrorHandler from './unwrapErrorHandler.js';
|
|
54
55
|
import utcToLocal from './utcToLocal.js';
|
|
55
56
|
import validationDataMerge from './validationDataMerge.js';
|
|
@@ -61,5 +62,5 @@ export * from './enums.js';
|
|
|
61
62
|
export * from './constants.js';
|
|
62
63
|
export * from './parser/index.js';
|
|
63
64
|
export * from './schema/index.js';
|
|
64
|
-
export { allowAdditionalItems, ariaDescribedByIds, asNumber, buttonId, canExpand, createErrorHandler, createSchemaUtils, dataURItoBlob, dateRangeOptions, deepEquals, descriptionId, englishStringTranslator, enumOptionsDeselectValue, enumOptionsIndexForValue, enumOptionsIsSelected, enumOptionsSelectValue, enumOptionsValueForIndex, errorId, examplesId, ErrorSchemaBuilder, findSchemaDefinition, getChangedFields, getDateElementProps, getDiscriminatorFieldFromSchema, getInputProps, getOptionMatchingSimpleDiscriminator, getSchemaType, getSubmitButtonOptions, getTemplate, getTestIds, getUiOptions, getWidget, guessType, hasWidget, hashForSchema, hashObject, hashString, helpId, isConstant, isCustomWidget, isFixedItems, isObject, labelValue, localToUTC, lookupFromFormContext, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, optionId, optionsList, orderProperties, pad, parseDateString, rangeSpec, replaceStringParameters, schemaRequiresTrueValue, shallowEquals, shouldRender, sortedJSONStringify, titleId, toConstant, toDateString, toErrorList, toErrorSchema, unwrapErrorHandler, utcToLocal, validationDataMerge, withIdRefPrefix, };
|
|
65
|
+
export { allowAdditionalItems, ariaDescribedByIds, asNumber, buttonId, canExpand, createErrorHandler, createSchemaUtils, dataURItoBlob, dateRangeOptions, deepEquals, descriptionId, englishStringTranslator, enumOptionsDeselectValue, enumOptionsIndexForValue, enumOptionsIsSelected, enumOptionsSelectValue, enumOptionsValueForIndex, errorId, examplesId, ErrorSchemaBuilder, findSchemaDefinition, getChangedFields, getDateElementProps, getDiscriminatorFieldFromSchema, getInputProps, getOptionMatchingSimpleDiscriminator, getSchemaType, getSubmitButtonOptions, getTemplate, getTestIds, getUiOptions, getWidget, guessType, hasWidget, hashForSchema, hashObject, hashString, helpId, isConstant, isCustomWidget, isFixedItems, isObject, labelValue, localToUTC, lookupFromFormContext, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, optionId, optionsList, orderProperties, pad, parseDateString, rangeSpec, replaceStringParameters, schemaRequiresTrueValue, shallowEquals, shouldRender, sortedJSONStringify, titleId, toConstant, toDateString, toErrorList, toErrorSchema, toFieldPathId, unwrapErrorHandler, utcToLocal, validationDataMerge, withIdRefPrefix, };
|
|
65
66
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAAU,MAAM,cAAc,CAAC;AACt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AAO,EACP,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,+BAA+B,EAC/B,aAAa,EACb,oCAAoC,EACpC,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,eAAe,EACf,GAAG,EACH,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,eAAe,GAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,sBAAsB,MA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EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,UAAU,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,eAAe,EACf,GAAG,EACH,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,OAAO,EACP,UAAU,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,eAAe,GAChB,CAAC"}
|
package/lib/schema/index.d.ts
CHANGED
|
@@ -10,6 +10,5 @@ import isMultiSelect from './isMultiSelect.js';
|
|
|
10
10
|
import isSelect from './isSelect.js';
|
|
11
11
|
import retrieveSchema from './retrieveSchema.js';
|
|
12
12
|
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema.js';
|
|
13
|
-
import toIdSchema from './toIdSchema.js';
|
|
14
13
|
import toPathSchema from './toPathSchema.js';
|
|
15
|
-
export { findFieldInSchema, findSelectedOptionInXxxOf, getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getFromSchema, isFilesArray, isMultiSelect, isSelect, retrieveSchema, sanitizeDataForNewSchema,
|
|
14
|
+
export { findFieldInSchema, findSelectedOptionInXxxOf, getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getFromSchema, isFilesArray, isMultiSelect, isSelect, retrieveSchema, sanitizeDataForNewSchema, toPathSchema, };
|
package/lib/schema/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import isMultiSelect from './isMultiSelect.js';
|
|
|
10
10
|
import isSelect from './isSelect.js';
|
|
11
11
|
import retrieveSchema from './retrieveSchema.js';
|
|
12
12
|
import sanitizeDataForNewSchema from './sanitizeDataForNewSchema.js';
|
|
13
|
-
import toIdSchema from './toIdSchema.js';
|
|
14
13
|
import toPathSchema from './toPathSchema.js';
|
|
15
|
-
export { findFieldInSchema, findSelectedOptionInXxxOf, getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getFromSchema, isFilesArray, isMultiSelect, isSelect, retrieveSchema, sanitizeDataForNewSchema,
|
|
14
|
+
export { findFieldInSchema, findSelectedOptionInXxxOf, getDefaultFormState, getDisplayLabel, getClosestMatchingOption, getFirstMatchingOption, getFromSchema, isFilesArray, isMultiSelect, isSelect, retrieveSchema, sanitizeDataForNewSchema, toPathSchema, };
|
|
16
15
|
//# sourceMappingURL=index.js.map
|
package/lib/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,wBAAwB,EACxB,YAAY,GACb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FieldPathId, FieldPathList, GlobalFormOptions } from './types.js';
|
|
2
|
+
/** Constructs the `FieldPathId` for `fieldPath`. If `parentPathId` is provided, the `fieldPath` is appended to the end
|
|
3
|
+
* of the parent path. Then the `ID_KEY` of the resulting `FieldPathId` is constructed from the `idPrefix` and
|
|
4
|
+
* `idSeparator` contained within the `globalFormOptions`. If `fieldPath` is passed as an empty string, it will simply
|
|
5
|
+
* generate the path from the `parentPath` (if provided) and the `idPrefix` and `idSeparator`
|
|
6
|
+
*
|
|
7
|
+
* @param fieldPath - The property name or array index of the current field element
|
|
8
|
+
* @param globalFormOptions - The `GlobalFormOptions` used to get the `idPrefix` and `idSeparator`
|
|
9
|
+
* @param [parentPath] - The optional `FieldPathId` or `FieldPathList` of the parent element for this field element
|
|
10
|
+
* @returns - The `FieldPathId` for the given `fieldPath` and the optional `parentPathId`
|
|
11
|
+
*/
|
|
12
|
+
export default function toFieldPathId(fieldPath: string | number, globalFormOptions: GlobalFormOptions, parentPath?: FieldPathId | FieldPathList): FieldPathId;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ID_KEY } from './constants.js';
|
|
2
|
+
/** Constructs the `FieldPathId` for `fieldPath`. If `parentPathId` is provided, the `fieldPath` is appended to the end
|
|
3
|
+
* of the parent path. Then the `ID_KEY` of the resulting `FieldPathId` is constructed from the `idPrefix` and
|
|
4
|
+
* `idSeparator` contained within the `globalFormOptions`. If `fieldPath` is passed as an empty string, it will simply
|
|
5
|
+
* generate the path from the `parentPath` (if provided) and the `idPrefix` and `idSeparator`
|
|
6
|
+
*
|
|
7
|
+
* @param fieldPath - The property name or array index of the current field element
|
|
8
|
+
* @param globalFormOptions - The `GlobalFormOptions` used to get the `idPrefix` and `idSeparator`
|
|
9
|
+
* @param [parentPath] - The optional `FieldPathId` or `FieldPathList` of the parent element for this field element
|
|
10
|
+
* @returns - The `FieldPathId` for the given `fieldPath` and the optional `parentPathId`
|
|
11
|
+
*/
|
|
12
|
+
export default function toFieldPathId(fieldPath, globalFormOptions, parentPath) {
|
|
13
|
+
const basePath = Array.isArray(parentPath) ? parentPath : parentPath === null || parentPath === void 0 ? void 0 : parentPath.path;
|
|
14
|
+
const childPath = fieldPath === '' ? [] : [fieldPath];
|
|
15
|
+
const path = basePath ? basePath.concat(...childPath) : childPath;
|
|
16
|
+
const id = [globalFormOptions.idPrefix, ...path].join(globalFormOptions.idSeparator);
|
|
17
|
+
return { path, [ID_KEY]: id };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=toFieldPathId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toFieldPathId.js","sourceRoot":"","sources":["../src/toFieldPathId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,SAA0B,EAC1B,iBAAoC,EACpC,UAAwC;IAExC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAC;IAC3E,MAAM,SAAS,GAAG,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,MAAM,EAAE,GAAG,CAAC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACrF,OAAO,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;AAChC,CAAC"}
|