@atscript/ui 0.1.113 → 0.1.114
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 +24 -0
- package/dist/index.d.cts +15 -1
- package/dist/index.d.mts +15 -1
- package/dist/index.mjs +22 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -144,9 +144,21 @@ function resolveFormProp(type, fnKey, staticKey, scope, opts) {
|
|
|
144
144
|
function hasComputedAnnotations(prop) {
|
|
145
145
|
return activeResolver.hasComputedAnnotations(prop);
|
|
146
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* SSOT for field hidden resolution — resolves `@ui.form.fn.hidden`
|
|
149
|
+
* (dynamic, via the active resolver) with static `@ui.form.hidden`
|
|
150
|
+
* presence as the fallback. Absent both → `false` (visible).
|
|
151
|
+
*/
|
|
152
|
+
function isFieldHidden(prop, scope) {
|
|
153
|
+
return resolveFieldProp(prop, "ui.form.fn.hidden", "ui.form.hidden", scope, { staticAsBoolean: true }) ?? false;
|
|
154
|
+
}
|
|
147
155
|
function getFieldMeta(prop, key) {
|
|
148
156
|
return prop.metadata.get(key);
|
|
149
157
|
}
|
|
158
|
+
/** Checks whether a metadata key is present on an ATScript prop. */
|
|
159
|
+
function hasFieldMeta(prop, key) {
|
|
160
|
+
return prop.metadata.has(key);
|
|
161
|
+
}
|
|
150
162
|
/** Ensures a value is an array — returns as-is if already one, wraps in `[x]` otherwise. */
|
|
151
163
|
function asArray(x) {
|
|
152
164
|
return Array.isArray(x) ? x : [x];
|
|
@@ -775,6 +787,15 @@ function buildResolved(url, meta, targetType) {
|
|
|
775
787
|
//#endregion
|
|
776
788
|
//#region src/form/path-utils.ts
|
|
777
789
|
/**
|
|
790
|
+
* Joins a dot-separated path prefix with a segment. Empty-safe on both
|
|
791
|
+
* sides: an empty segment returns the prefix as-is, an empty prefix
|
|
792
|
+
* returns the segment as-is (no leading/trailing dots).
|
|
793
|
+
*/
|
|
794
|
+
function joinPath(prefix, segment) {
|
|
795
|
+
if (!segment) return prefix;
|
|
796
|
+
return prefix ? `${prefix}.${segment}` : segment;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
778
799
|
* Gets a nested value by dot-separated path.
|
|
779
800
|
* Always dereferences `obj.value` first (form data is wrapped in `{ value: domainData }`).
|
|
780
801
|
* When `path` is empty, returns the root domain data (`obj.value`).
|
|
@@ -2415,7 +2436,9 @@ exports.getSortableColumns = getSortableColumns;
|
|
|
2415
2436
|
exports.getThousandsSeparator = getThousandsSeparator;
|
|
2416
2437
|
exports.groupInteger = groupInteger;
|
|
2417
2438
|
exports.hasComputedAnnotations = hasComputedAnnotations;
|
|
2439
|
+
exports.hasFieldMeta = hasFieldMeta;
|
|
2418
2440
|
exports.isArrayField = isArrayField;
|
|
2441
|
+
exports.isFieldHidden = isFieldHidden;
|
|
2419
2442
|
exports.isObjectField = isObjectField;
|
|
2420
2443
|
exports.isPathDirty = isPathDirty;
|
|
2421
2444
|
exports.isPureLiteralUnion = isPureLiteralUnion;
|
|
@@ -2423,6 +2446,7 @@ exports.isTupleField = isTupleField;
|
|
|
2423
2446
|
exports.isUnionField = isUnionField;
|
|
2424
2447
|
exports.iteratePathAncestors = iteratePathAncestors;
|
|
2425
2448
|
exports.joinDecimalString = joinDecimalString;
|
|
2449
|
+
exports.joinPath = joinPath;
|
|
2426
2450
|
exports.mergeErrorMaps = mergeErrorMaps;
|
|
2427
2451
|
exports.navigateHrefFor = navigateHrefFor;
|
|
2428
2452
|
exports.optKey = optKey;
|
package/dist/index.d.cts
CHANGED
|
@@ -289,12 +289,20 @@ declare function resolveFieldProp<T>(prop: TAtscriptAnnotatedType, fnKey: string
|
|
|
289
289
|
declare function resolveFormProp<T>(type: TAtscriptAnnotatedType, fnKey: string, staticKey: string | undefined, scope: Record<string, unknown>, opts?: TResolveOptions<T>): T | undefined;
|
|
290
290
|
/** Check if a prop has dynamic annotations via the active resolver. */
|
|
291
291
|
declare function hasComputedAnnotations(prop: TAtscriptAnnotatedType): boolean;
|
|
292
|
+
/**
|
|
293
|
+
* SSOT for field hidden resolution — resolves `@ui.form.fn.hidden`
|
|
294
|
+
* (dynamic, via the active resolver) with static `@ui.form.hidden`
|
|
295
|
+
* presence as the fallback. Absent both → `false` (visible).
|
|
296
|
+
*/
|
|
297
|
+
declare function isFieldHidden(prop: TAtscriptAnnotatedType, scope: Record<string, unknown>): boolean;
|
|
292
298
|
/**
|
|
293
299
|
* Reads a static metadata value from an ATScript prop.
|
|
294
300
|
* Typed overload for known AtscriptMetadata keys; falls back to `unknown` for other keys.
|
|
295
301
|
*/
|
|
296
302
|
declare function getFieldMeta<K extends keyof AtscriptMetadata>(prop: TAtscriptAnnotatedType, key: K): AtscriptMetadata[K] | undefined;
|
|
297
303
|
declare function getFieldMeta(prop: TAtscriptAnnotatedType, key: string): unknown;
|
|
304
|
+
/** Checks whether a metadata key is present on an ATScript prop. */
|
|
305
|
+
declare function hasFieldMeta(prop: TAtscriptAnnotatedType, key: string): boolean;
|
|
298
306
|
/** Ensures a value is an array — returns as-is if already one, wraps in `[x]` otherwise. */
|
|
299
307
|
declare function asArray<T>(x: T | T[]): T[];
|
|
300
308
|
/**
|
|
@@ -429,6 +437,12 @@ declare function parseStaticOptions(raw: unknown): TFormEntryOptions[];
|
|
|
429
437
|
declare function resolveOptions(prop: TAtscriptAnnotatedType, scope: Record<string, unknown>): TFormEntryOptions[] | undefined;
|
|
430
438
|
//#endregion
|
|
431
439
|
//#region src/form/path-utils.d.ts
|
|
440
|
+
/**
|
|
441
|
+
* Joins a dot-separated path prefix with a segment. Empty-safe on both
|
|
442
|
+
* sides: an empty segment returns the prefix as-is, an empty prefix
|
|
443
|
+
* returns the segment as-is (no leading/trailing dots).
|
|
444
|
+
*/
|
|
445
|
+
declare function joinPath(prefix: string, segment: string): string;
|
|
432
446
|
/**
|
|
433
447
|
* Gets a nested value by dot-separated path.
|
|
434
448
|
* Always dereferences `obj.value` first (form data is wrapped in `{ value: domainData }`).
|
|
@@ -1205,4 +1219,4 @@ declare function getColumn(def: TableDef, path: string): ColumnDef | undefined;
|
|
|
1205
1219
|
*/
|
|
1206
1220
|
declare function navigateHrefFor(action: TDbActionInfo$1, id: Record<string, unknown> | undefined, preferredId: readonly string[]): string | undefined;
|
|
1207
1221
|
//#endregion
|
|
1208
|
-
export { type ClientFactory, type CloneUnwrap, type ColumnDef, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, type FieldMeta, type FieldResolver, type FormActionInfo, type FormArrayFieldDef, type FormDef, type FormDiffOptions, type FormDiffResult, type FormFieldChange, type FormFieldDef, type FormObjectFieldDef, type FormRebaseOptions, type FormRebaseResult, type FormTupleFieldDef, type FormUnionFieldDef, type FormUnionVariant, type FormatDecimalOptions, type GridSpanArgs, type GridSpec, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, type MeasurementInfo, type MetaCacheEntry, type MetaResponse, type PaginationControl, type RelationInfo, type ResolvedValueHelp, type SearchIndexInfo, type SortControl, StaticFieldResolver, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TFieldValidatorOptions, type TFormAction, type TFormEntryOptions, type TFormValidatorCallOptions, type TFormValueResolver, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createTableDef, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, extractLiteralOptions, extractMeasurement, extractValueHelp, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaEntry, getResolver, getSortableColumns, getThousandsSeparator, groupInteger, hasComputedAnnotations, isArrayField, isObjectField, isPathDirty, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, mergeErrorMaps, navigateHrefFor, optKey, optLabel, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setResolver, splitDecimalString, str, unionVariantChanged, valueHelpDictPaths };
|
|
1222
|
+
export { type ClientFactory, type CloneUnwrap, type ColumnDef, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, type FieldMeta, type FieldResolver, type FormActionInfo, type FormArrayFieldDef, type FormDef, type FormDiffOptions, type FormDiffResult, type FormFieldChange, type FormFieldDef, type FormObjectFieldDef, type FormRebaseOptions, type FormRebaseResult, type FormTupleFieldDef, type FormUnionFieldDef, type FormUnionVariant, type FormatDecimalOptions, type GridSpanArgs, type GridSpec, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, type MeasurementInfo, type MetaCacheEntry, type MetaResponse, type PaginationControl, type RelationInfo, type ResolvedValueHelp, type SearchIndexInfo, type SortControl, StaticFieldResolver, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TFieldValidatorOptions, type TFormAction, type TFormEntryOptions, type TFormValidatorCallOptions, type TFormValueResolver, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createTableDef, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, extractLiteralOptions, extractMeasurement, extractValueHelp, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaEntry, getResolver, getSortableColumns, getThousandsSeparator, groupInteger, hasComputedAnnotations, hasFieldMeta, isArrayField, isFieldHidden, isObjectField, isPathDirty, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, mergeErrorMaps, navigateHrefFor, optKey, optLabel, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setResolver, splitDecimalString, str, unionVariantChanged, valueHelpDictPaths };
|
package/dist/index.d.mts
CHANGED
|
@@ -289,12 +289,20 @@ declare function resolveFieldProp<T>(prop: TAtscriptAnnotatedType, fnKey: string
|
|
|
289
289
|
declare function resolveFormProp<T>(type: TAtscriptAnnotatedType, fnKey: string, staticKey: string | undefined, scope: Record<string, unknown>, opts?: TResolveOptions<T>): T | undefined;
|
|
290
290
|
/** Check if a prop has dynamic annotations via the active resolver. */
|
|
291
291
|
declare function hasComputedAnnotations(prop: TAtscriptAnnotatedType): boolean;
|
|
292
|
+
/**
|
|
293
|
+
* SSOT for field hidden resolution — resolves `@ui.form.fn.hidden`
|
|
294
|
+
* (dynamic, via the active resolver) with static `@ui.form.hidden`
|
|
295
|
+
* presence as the fallback. Absent both → `false` (visible).
|
|
296
|
+
*/
|
|
297
|
+
declare function isFieldHidden(prop: TAtscriptAnnotatedType, scope: Record<string, unknown>): boolean;
|
|
292
298
|
/**
|
|
293
299
|
* Reads a static metadata value from an ATScript prop.
|
|
294
300
|
* Typed overload for known AtscriptMetadata keys; falls back to `unknown` for other keys.
|
|
295
301
|
*/
|
|
296
302
|
declare function getFieldMeta<K extends keyof AtscriptMetadata>(prop: TAtscriptAnnotatedType, key: K): AtscriptMetadata[K] | undefined;
|
|
297
303
|
declare function getFieldMeta(prop: TAtscriptAnnotatedType, key: string): unknown;
|
|
304
|
+
/** Checks whether a metadata key is present on an ATScript prop. */
|
|
305
|
+
declare function hasFieldMeta(prop: TAtscriptAnnotatedType, key: string): boolean;
|
|
298
306
|
/** Ensures a value is an array — returns as-is if already one, wraps in `[x]` otherwise. */
|
|
299
307
|
declare function asArray<T>(x: T | T[]): T[];
|
|
300
308
|
/**
|
|
@@ -429,6 +437,12 @@ declare function parseStaticOptions(raw: unknown): TFormEntryOptions[];
|
|
|
429
437
|
declare function resolveOptions(prop: TAtscriptAnnotatedType, scope: Record<string, unknown>): TFormEntryOptions[] | undefined;
|
|
430
438
|
//#endregion
|
|
431
439
|
//#region src/form/path-utils.d.ts
|
|
440
|
+
/**
|
|
441
|
+
* Joins a dot-separated path prefix with a segment. Empty-safe on both
|
|
442
|
+
* sides: an empty segment returns the prefix as-is, an empty prefix
|
|
443
|
+
* returns the segment as-is (no leading/trailing dots).
|
|
444
|
+
*/
|
|
445
|
+
declare function joinPath(prefix: string, segment: string): string;
|
|
432
446
|
/**
|
|
433
447
|
* Gets a nested value by dot-separated path.
|
|
434
448
|
* Always dereferences `obj.value` first (form data is wrapped in `{ value: domainData }`).
|
|
@@ -1205,4 +1219,4 @@ declare function getColumn(def: TableDef, path: string): ColumnDef | undefined;
|
|
|
1205
1219
|
*/
|
|
1206
1220
|
declare function navigateHrefFor(action: TDbActionInfo$1, id: Record<string, unknown> | undefined, preferredId: readonly string[]): string | undefined;
|
|
1207
1221
|
//#endregion
|
|
1208
|
-
export { type ClientFactory, type CloneUnwrap, type ColumnDef, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, type FieldMeta, type FieldResolver, type FormActionInfo, type FormArrayFieldDef, type FormDef, type FormDiffOptions, type FormDiffResult, type FormFieldChange, type FormFieldDef, type FormObjectFieldDef, type FormRebaseOptions, type FormRebaseResult, type FormTupleFieldDef, type FormUnionFieldDef, type FormUnionVariant, type FormatDecimalOptions, type GridSpanArgs, type GridSpec, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, type MeasurementInfo, type MetaCacheEntry, type MetaResponse, type PaginationControl, type RelationInfo, type ResolvedValueHelp, type SearchIndexInfo, type SortControl, StaticFieldResolver, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TFieldValidatorOptions, type TFormAction, type TFormEntryOptions, type TFormValidatorCallOptions, type TFormValueResolver, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createTableDef, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, extractLiteralOptions, extractMeasurement, extractValueHelp, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaEntry, getResolver, getSortableColumns, getThousandsSeparator, groupInteger, hasComputedAnnotations, isArrayField, isObjectField, isPathDirty, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, mergeErrorMaps, navigateHrefFor, optKey, optLabel, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setResolver, splitDecimalString, str, unionVariantChanged, valueHelpDictPaths };
|
|
1222
|
+
export { type ClientFactory, type CloneUnwrap, type ColumnDef, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, type FieldMeta, type FieldResolver, type FormActionInfo, type FormArrayFieldDef, type FormDef, type FormDiffOptions, type FormDiffResult, type FormFieldChange, type FormFieldDef, type FormObjectFieldDef, type FormRebaseOptions, type FormRebaseResult, type FormTupleFieldDef, type FormUnionFieldDef, type FormUnionVariant, type FormatDecimalOptions, type GridSpanArgs, type GridSpec, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, type MeasurementInfo, type MetaCacheEntry, type MetaResponse, type PaginationControl, type RelationInfo, type ResolvedValueHelp, type SearchIndexInfo, type SortControl, StaticFieldResolver, type TCrudOp, type TCrudPermissions, type TDbActionInfo, type TDbActionIntent, type TDbActionLevel, type TDbActionProcessor, type TFieldValidatorOptions, type TFormAction, type TFormEntryOptions, type TFormValidatorCallOptions, type TFormValueResolver, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createTableDef, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, extractLiteralOptions, extractMeasurement, extractValueHelp, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaEntry, getResolver, getSortableColumns, getThousandsSeparator, groupInteger, hasComputedAnnotations, hasFieldMeta, isArrayField, isFieldHidden, isObjectField, isPathDirty, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, mergeErrorMaps, navigateHrefFor, optKey, optLabel, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setResolver, splitDecimalString, str, unionVariantChanged, valueHelpDictPaths };
|
package/dist/index.mjs
CHANGED
|
@@ -143,9 +143,21 @@ function resolveFormProp(type, fnKey, staticKey, scope, opts) {
|
|
|
143
143
|
function hasComputedAnnotations(prop) {
|
|
144
144
|
return activeResolver.hasComputedAnnotations(prop);
|
|
145
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* SSOT for field hidden resolution — resolves `@ui.form.fn.hidden`
|
|
148
|
+
* (dynamic, via the active resolver) with static `@ui.form.hidden`
|
|
149
|
+
* presence as the fallback. Absent both → `false` (visible).
|
|
150
|
+
*/
|
|
151
|
+
function isFieldHidden(prop, scope) {
|
|
152
|
+
return resolveFieldProp(prop, "ui.form.fn.hidden", "ui.form.hidden", scope, { staticAsBoolean: true }) ?? false;
|
|
153
|
+
}
|
|
146
154
|
function getFieldMeta(prop, key) {
|
|
147
155
|
return prop.metadata.get(key);
|
|
148
156
|
}
|
|
157
|
+
/** Checks whether a metadata key is present on an ATScript prop. */
|
|
158
|
+
function hasFieldMeta(prop, key) {
|
|
159
|
+
return prop.metadata.has(key);
|
|
160
|
+
}
|
|
149
161
|
/** Ensures a value is an array — returns as-is if already one, wraps in `[x]` otherwise. */
|
|
150
162
|
function asArray(x) {
|
|
151
163
|
return Array.isArray(x) ? x : [x];
|
|
@@ -774,6 +786,15 @@ function buildResolved(url, meta, targetType) {
|
|
|
774
786
|
//#endregion
|
|
775
787
|
//#region src/form/path-utils.ts
|
|
776
788
|
/**
|
|
789
|
+
* Joins a dot-separated path prefix with a segment. Empty-safe on both
|
|
790
|
+
* sides: an empty segment returns the prefix as-is, an empty prefix
|
|
791
|
+
* returns the segment as-is (no leading/trailing dots).
|
|
792
|
+
*/
|
|
793
|
+
function joinPath(prefix, segment) {
|
|
794
|
+
if (!segment) return prefix;
|
|
795
|
+
return prefix ? `${prefix}.${segment}` : segment;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
777
798
|
* Gets a nested value by dot-separated path.
|
|
778
799
|
* Always dereferences `obj.value` first (form data is wrapped in `{ value: domainData }`).
|
|
779
800
|
* When `path` is empty, returns the root domain data (`obj.value`).
|
|
@@ -2294,4 +2315,4 @@ function navigateHrefFor(action, id, preferredId) {
|
|
|
2294
2315
|
return action.value.replace(/\$1/g, encodeNavigateId(id, preferredId));
|
|
2295
2316
|
}
|
|
2296
2317
|
//#endregion
|
|
2297
|
-
export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, StaticFieldResolver, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, ValueHelpClient, WF_ACTION_WITH_DATA, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createTableDef, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, extractLiteralOptions, extractMeasurement, extractValueHelp, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaEntry, getResolver, getSortableColumns, getThousandsSeparator, groupInteger, hasComputedAnnotations, isArrayField, isObjectField, isPathDirty, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, mergeErrorMaps, navigateHrefFor, optKey, optLabel, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setResolver, splitDecimalString, str, unionVariantChanged, valueHelpDictPaths };
|
|
2318
|
+
export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, StaticFieldResolver, UI_DICT_ATTR, UI_DICT_DESCR, UI_DICT_FILTERABLE, UI_DICT_LABEL, UI_DICT_SEARCHABLE, UI_DICT_SORTABLE, UI_FORM_ACTION, UI_FORM_ATTR, UI_FORM_AUTOCOMPLETE, UI_FORM_CLASSES, UI_FORM_COMPONENT, UI_FORM_DISABLED, UI_FORM_FN_ATTR, UI_FORM_FN_CLASSES, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_DISABLED, UI_FORM_FN_HIDDEN, UI_FORM_FN_HINT, UI_FORM_FN_LABEL, UI_FORM_FN_OPTIONS, UI_FORM_FN_PLACEHOLDER, UI_FORM_FN_PREFIX, UI_FORM_FN_READONLY, UI_FORM_FN_STYLES, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_FN_VALUE, UI_FORM_GRID_COL_SPAN, UI_FORM_GRID_ROW_SPAN, UI_FORM_HIDDEN, UI_FORM_HINT, UI_FORM_LABEL_SINGULAR, UI_FORM_OPTIONS, UI_FORM_ORDER, UI_FORM_PLACEHOLDER, UI_FORM_PREFIX, UI_FORM_PREFIX_ICON, UI_FORM_PREFIX_REF, UI_FORM_STYLES, UI_FORM_SUBMIT_TEXT, UI_FORM_SUFFIX, UI_FORM_SUFFIX_ICON, UI_FORM_SUFFIX_REF, UI_FORM_TYPE, UI_FORM_VALIDATE, UI_TABLE_ATTR, UI_TABLE_CLASSES, UI_TABLE_COMPONENT, UI_TABLE_EXCLUDE, UI_TABLE_FN_ATTR, UI_TABLE_FN_CLASSES, UI_TABLE_FN_PREFIX, UI_TABLE_FN_STYLES, UI_TABLE_ORDER, UI_TABLE_SELECT_WITH, UI_TABLE_STYLES, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE, ValueHelpClient, WF_ACTION_WITH_DATA, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createTableDef, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, extractLiteralOptions, extractMeasurement, extractValueHelp, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaEntry, getResolver, getSortableColumns, getThousandsSeparator, groupInteger, hasComputedAnnotations, hasFieldMeta, isArrayField, isFieldHidden, isObjectField, isPathDirty, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, mergeErrorMaps, navigateHrefFor, optKey, optLabel, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setResolver, splitDecimalString, str, unionVariantChanged, valueHelpDictPaths };
|