@atscript/ui 0.1.168 → 0.1.170

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/form/create-form-def.cjs +8 -2
  2. package/dist/form/create-form-def.mjs +8 -2
  3. package/dist/form/labels.cjs +4 -4
  4. package/dist/form/labels.d.cts +3 -2
  5. package/dist/form/labels.d.mts +3 -2
  6. package/dist/form/labels.mjs +4 -4
  7. package/dist/form/types.d.cts +12 -0
  8. package/dist/form/types.d.mts +12 -0
  9. package/dist/form/validate.cjs +18 -4
  10. package/dist/form/validate.d.cts +11 -1
  11. package/dist/form/validate.d.mts +11 -1
  12. package/dist/form/validate.mjs +18 -5
  13. package/dist/i18n/model-texts.cjs +50 -0
  14. package/dist/i18n/model-texts.d.cts +42 -0
  15. package/dist/i18n/model-texts.d.mts +42 -0
  16. package/dist/i18n/model-texts.mjs +46 -0
  17. package/dist/i18n/ui-texts.d.cts +5 -1
  18. package/dist/i18n/ui-texts.d.mts +5 -1
  19. package/dist/index.cjs +7 -0
  20. package/dist/index.d.cts +3 -2
  21. package/dist/index.d.mts +3 -2
  22. package/dist/index.mjs +3 -2
  23. package/dist/nav/model-routes.cjs +9 -3
  24. package/dist/nav/model-routes.d.cts +8 -1
  25. package/dist/nav/model-routes.d.mts +8 -1
  26. package/dist/nav/model-routes.mjs +9 -3
  27. package/dist/shared/field-resolver.cjs +3 -2
  28. package/dist/shared/field-resolver.d.cts +6 -0
  29. package/dist/shared/field-resolver.d.mts +6 -0
  30. package/dist/shared/field-resolver.mjs +3 -2
  31. package/dist/shared/meta-cache.cjs +3 -3
  32. package/dist/shared/meta-cache.d.cts +1 -1
  33. package/dist/shared/meta-cache.d.mts +1 -1
  34. package/dist/shared/meta-cache.mjs +3 -3
  35. package/dist/table/create-table-def.cjs +2 -1
  36. package/dist/table/create-table-def.mjs +2 -1
  37. package/dist/value-help/extract-literals.cjs +8 -5
  38. package/dist/value-help/extract-literals.d.cts +5 -2
  39. package/dist/value-help/extract-literals.d.mts +5 -2
  40. package/dist/value-help/extract-literals.mjs +8 -5
  41. package/dist/value-help/resolve-options.cjs +17 -8
  42. package/dist/value-help/resolve-options.d.cts +7 -3
  43. package/dist/value-help/resolve-options.d.mts +7 -3
  44. package/dist/value-help/resolve-options.mjs +17 -8
  45. package/package.json +10 -10
package/dist/index.d.cts CHANGED
@@ -3,6 +3,7 @@ import { TFormEntryOptions, ValueHelpInfo } from "./value-help/types.cjs";
3
3
  import { FormArrayFieldDef, FormDef, FormFieldDef, FormObjectFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, TFormAction, isArrayField, isObjectField, isTupleField, isUnionField } from "./form/types.cjs";
4
4
  import { CreateFormDefOptions, buildUnionVariants, createFormDef } from "./form/create-form-def.cjs";
5
5
  import { FormActionInfo, getDeclaredFormActions } from "./form/form-actions.cjs";
6
+ import { UserTextT, deserializeServedType, fieldText, isServedType, markServedType, userText } from "./i18n/model-texts.cjs";
6
7
  import { FieldResolver, StaticFieldResolver, TResolveOptions, asArray, defaultResolver, getFieldMeta, getResolver, hasComputedAnnotations, hasFieldMeta, isFieldHidden, parseStaticAttrs, resolveAttrs, resolveFieldProp, resolveFormProp, resolveStatic, setResolver } from "./shared/field-resolver.cjs";
7
8
  import { ClientFactory, ClientFactoryOptions, TypedClientFactory, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "./client-factory.cjs";
8
9
  import { ColumnDef, ColumnValueKind, FieldMeta, MetaResponse, PaginationControl, RelationInfo, SearchIndexInfo, SortControl, TableActionsModel, TableDef, TableQueryState } from "./table/types.cjs";
@@ -17,7 +18,7 @@ import { optKey, optLabel, optionLabel, parseStaticOptions, resolveOptions } fro
17
18
  import { fetchDistinctValues, isPickerDeclined } from "./value-help/distinct-client.cjs";
18
19
  import { TFormValueResolver, createFormData, createFormValueResolver, deleteByPath, detectUnionVariant, getByPath, joinPath, setByPath } from "./form/path-utils.cjs";
19
20
  import { CloneUnwrap, deepClone } from "./form/clone.cjs";
20
- import { FormValidator, TFieldValidatorOptions, TFormValidatorCallOptions, createFieldValidator, getDefaultValidatorPlugins, getFormValidator, isContainerKind, setDefaultValidatorPlugins } from "./form/validate.cjs";
21
+ import { FormValidator, TFieldValidatorOptions, TFormValidatorCallOptions, UI_FORM_VALIDATE_ERROR_CODE, createFieldValidator, getDefaultValidatorPlugins, getFormValidator, isContainerKind, setDefaultValidatorPlugins } from "./form/validate.cjs";
21
22
  import { FormDiffOptions, FormDiffResult, FormFieldChange, buildFormDiff, deepEqual } from "./form/diff.cjs";
22
23
  import { omitSkippedNavFields } from "./form/skipped-nav.cjs";
23
24
  import { collectDirtyPaths, isPathDirty } from "./form/dirty.cjs";
@@ -36,4 +37,4 @@ import { getColumn, getFilterableColumns, getSortableColumns } from "./table/col
36
37
  import { navigateHrefFor } from "./table/navigate-href.cjs";
37
38
  import { TModelRoute, buildModelRoutes } from "./nav/model-routes.cjs";
38
39
  import { TCrudOp, TCrudPermissions, TDbActionInfo, TDbActionIntent, TDbActionLevel, TDbActionProcessor } from "@atscript/db-client";
39
- export { type ClientFactory, type ClientFactoryOptions, type CloneUnwrap, type ColumnDef, type ColumnValueKind, type CreateFormDefOptions, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_BOOLEAN_LABELS, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, FORM_ERROR_KEY, 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 FormValidator, 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 MetaEntryOptions, type MetaResponse, NUMERIC_VALUE_KINDS, 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 TModelRoute, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, type TypedClientFactory, 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_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, type UiT, type UiTextParams, type UiTexts, type UiTranslate, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, activateUiTexts, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildModelRoutes, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createMetaClient, createTableDef, createUiTexts, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, escapeRegex, extractFieldLiteralOptions, extractLiteralOptions, extractMeasurement, extractValueHelp, fetchDistinctValues, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, getResolver, getSortableColumns, getThousandsSeparator, getUiTexts, groupInteger, hasComputedAnnotations, hasFieldMeta, invalidateValueHelpCache, isArrayField, isContainerKind, isFieldHidden, isObjectField, isPathDirty, isPickerDeclined, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, mergeErrorMaps, navigateHrefFor, omitPaths, omitSkippedNavFields, onMetaCacheReset, onUiLocaleChange, optKey, optLabel, optionLabel, optionValue, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, retainMetaEntry, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setMetaCacheIdentity, setMetaCacheMaxEntries, setResolver, setUiLocale, setValueHelpCacheTtl, splitDecimalString, str, unionVariantChanged, validatorErrorsToMap, valueHelpDictPaths };
40
+ export { type ClientFactory, type ClientFactoryOptions, type CloneUnwrap, type ColumnDef, type ColumnValueKind, type CreateFormDefOptions, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_BOOLEAN_LABELS, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, FORM_ERROR_KEY, 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 FormValidator, 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 MetaEntryOptions, type MetaResponse, NUMERIC_VALUE_KINDS, 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 TModelRoute, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, type TypedClientFactory, 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_FORM_VALIDATE_ERROR_CODE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, type UiT, type UiTextParams, type UiTexts, type UiTranslate, type UserTextT, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, activateUiTexts, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildModelRoutes, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createMetaClient, createTableDef, createUiTexts, deepClone, deepEqual, defaultResolver, deleteByPath, deserializeServedType, detectUnionVariant, enforceScale, escapeRegex, extractFieldLiteralOptions, extractLiteralOptions, extractMeasurement, extractValueHelp, fetchDistinctValues, fieldText, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, getResolver, getSortableColumns, getThousandsSeparator, getUiTexts, groupInteger, hasComputedAnnotations, hasFieldMeta, invalidateValueHelpCache, isArrayField, isContainerKind, isFieldHidden, isObjectField, isPathDirty, isPickerDeclined, isPureLiteralUnion, isServedType, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, markServedType, mergeErrorMaps, navigateHrefFor, omitPaths, omitSkippedNavFields, onMetaCacheReset, onUiLocaleChange, optKey, optLabel, optionLabel, optionValue, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, retainMetaEntry, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setMetaCacheIdentity, setMetaCacheMaxEntries, setResolver, setUiLocale, setValueHelpCacheTtl, splitDecimalString, str, unionVariantChanged, userText, validatorErrorsToMap, valueHelpDictPaths };
package/dist/index.d.mts CHANGED
@@ -3,6 +3,7 @@ import { TFormEntryOptions, ValueHelpInfo } from "./value-help/types.mjs";
3
3
  import { FormArrayFieldDef, FormDef, FormFieldDef, FormObjectFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, TFormAction, isArrayField, isObjectField, isTupleField, isUnionField } from "./form/types.mjs";
4
4
  import { CreateFormDefOptions, buildUnionVariants, createFormDef } from "./form/create-form-def.mjs";
5
5
  import { FormActionInfo, getDeclaredFormActions } from "./form/form-actions.mjs";
6
+ import { UserTextT, deserializeServedType, fieldText, isServedType, markServedType, userText } from "./i18n/model-texts.mjs";
6
7
  import { FieldResolver, StaticFieldResolver, TResolveOptions, asArray, defaultResolver, getFieldMeta, getResolver, hasComputedAnnotations, hasFieldMeta, isFieldHidden, parseStaticAttrs, resolveAttrs, resolveFieldProp, resolveFormProp, resolveStatic, setResolver } from "./shared/field-resolver.mjs";
7
8
  import { ClientFactory, ClientFactoryOptions, TypedClientFactory, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "./client-factory.mjs";
8
9
  import { ColumnDef, ColumnValueKind, FieldMeta, MetaResponse, PaginationControl, RelationInfo, SearchIndexInfo, SortControl, TableActionsModel, TableDef, TableQueryState } from "./table/types.mjs";
@@ -17,7 +18,7 @@ import { optKey, optLabel, optionLabel, parseStaticOptions, resolveOptions } fro
17
18
  import { fetchDistinctValues, isPickerDeclined } from "./value-help/distinct-client.mjs";
18
19
  import { TFormValueResolver, createFormData, createFormValueResolver, deleteByPath, detectUnionVariant, getByPath, joinPath, setByPath } from "./form/path-utils.mjs";
19
20
  import { CloneUnwrap, deepClone } from "./form/clone.mjs";
20
- import { FormValidator, TFieldValidatorOptions, TFormValidatorCallOptions, createFieldValidator, getDefaultValidatorPlugins, getFormValidator, isContainerKind, setDefaultValidatorPlugins } from "./form/validate.mjs";
21
+ import { FormValidator, TFieldValidatorOptions, TFormValidatorCallOptions, UI_FORM_VALIDATE_ERROR_CODE, createFieldValidator, getDefaultValidatorPlugins, getFormValidator, isContainerKind, setDefaultValidatorPlugins } from "./form/validate.mjs";
21
22
  import { FormDiffOptions, FormDiffResult, FormFieldChange, buildFormDiff, deepEqual } from "./form/diff.mjs";
22
23
  import { omitSkippedNavFields } from "./form/skipped-nav.mjs";
23
24
  import { collectDirtyPaths, isPathDirty } from "./form/dirty.mjs";
@@ -36,4 +37,4 @@ import { getColumn, getFilterableColumns, getSortableColumns } from "./table/col
36
37
  import { navigateHrefFor } from "./table/navigate-href.mjs";
37
38
  import { TModelRoute, buildModelRoutes } from "./nav/model-routes.mjs";
38
39
  import { TCrudOp, TCrudPermissions, TDbActionInfo, TDbActionIntent, TDbActionLevel, TDbActionProcessor } from "@atscript/db-client";
39
- export { type ClientFactory, type ClientFactoryOptions, type CloneUnwrap, type ColumnDef, type ColumnValueKind, type CreateFormDefOptions, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_BOOLEAN_LABELS, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, FORM_ERROR_KEY, 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 FormValidator, 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 MetaEntryOptions, type MetaResponse, NUMERIC_VALUE_KINDS, 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 TModelRoute, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, type TypedClientFactory, 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_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, type UiT, type UiTextParams, type UiTexts, type UiTranslate, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, activateUiTexts, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildModelRoutes, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createMetaClient, createTableDef, createUiTexts, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, escapeRegex, extractFieldLiteralOptions, extractLiteralOptions, extractMeasurement, extractValueHelp, fetchDistinctValues, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, getResolver, getSortableColumns, getThousandsSeparator, getUiTexts, groupInteger, hasComputedAnnotations, hasFieldMeta, invalidateValueHelpCache, isArrayField, isContainerKind, isFieldHidden, isObjectField, isPathDirty, isPickerDeclined, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, mergeErrorMaps, navigateHrefFor, omitPaths, omitSkippedNavFields, onMetaCacheReset, onUiLocaleChange, optKey, optLabel, optionLabel, optionValue, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, retainMetaEntry, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setMetaCacheIdentity, setMetaCacheMaxEntries, setResolver, setUiLocale, setValueHelpCacheTtl, splitDecimalString, str, unionVariantChanged, validatorErrorsToMap, valueHelpDictPaths };
40
+ export { type ClientFactory, type ClientFactoryOptions, type CloneUnwrap, type ColumnDef, type ColumnValueKind, type CreateFormDefOptions, type CurrencyDisplay, DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_BOOLEAN_LABELS, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, type DecimalParts, EXPECT_MAX_LENGTH, FORM_ERROR_KEY, 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 FormValidator, 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 MetaEntryOptions, type MetaResponse, NUMERIC_VALUE_KINDS, 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 TModelRoute, type TResolveOptions, type TableActionsModel, type TableDef, type TableQueryState, type TypedClientFactory, 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_FORM_VALIDATE_ERROR_CODE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, type UiT, type UiTextParams, type UiTexts, type UiTranslate, type UserTextT, ValueHelpClient, type ValueHelpInfo, type ValueHelpResult, type ValueHelpSearchOptions, WF_ACTION_WITH_DATA, activateUiTexts, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildModelRoutes, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createMetaClient, createTableDef, createUiTexts, deepClone, deepEqual, defaultResolver, deleteByPath, deserializeServedType, detectUnionVariant, enforceScale, escapeRegex, extractFieldLiteralOptions, extractLiteralOptions, extractMeasurement, extractValueHelp, fetchDistinctValues, fieldText, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, getResolver, getSortableColumns, getThousandsSeparator, getUiTexts, groupInteger, hasComputedAnnotations, hasFieldMeta, invalidateValueHelpCache, isArrayField, isContainerKind, isFieldHidden, isObjectField, isPathDirty, isPickerDeclined, isPureLiteralUnion, isServedType, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, markServedType, mergeErrorMaps, navigateHrefFor, omitPaths, omitSkippedNavFields, onMetaCacheReset, onUiLocaleChange, optKey, optLabel, optionLabel, optionValue, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, retainMetaEntry, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setMetaCacheIdentity, setMetaCacheMaxEntries, setResolver, setUiLocale, setValueHelpCacheTtl, splitDecimalString, str, unionVariantChanged, userText, validatorErrorsToMap, valueHelpDictPaths };
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, EXPECT_MAX_LENGTH, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, 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_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, WF_ACTION_WITH_DATA } from "./shared/annotation-keys.mjs";
2
2
  import { isArrayField, isObjectField, isTupleField, isUnionField } from "./form/types.mjs";
3
+ import { deserializeServedType, fieldText, isServedType, markServedType, userText } from "./i18n/model-texts.mjs";
3
4
  import { StaticFieldResolver, asArray, defaultResolver, getFieldMeta, getResolver, hasComputedAnnotations, hasFieldMeta, isFieldHidden, parseStaticAttrs, resolveAttrs, resolveFieldProp, resolveFormProp, resolveStatic, setResolver } from "./shared/field-resolver.mjs";
4
5
  import { activateUiTexts, createUiTexts, getUiTexts, onUiLocaleChange, setUiLocale } from "./i18n/ui-texts.mjs";
5
6
  import { DEFAULT_BOOLEAN_LABELS, extractFieldLiteralOptions, extractLiteralOptions, isPureLiteralUnion } from "./value-help/extract-literals.mjs";
@@ -20,7 +21,7 @@ import { createTableDef } from "./table/create-table-def.mjs";
20
21
  import { createMetaClient, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, onMetaCacheReset, resetMetaCache, retainMetaEntry, setMetaCacheIdentity, setMetaCacheMaxEntries } from "./shared/meta-cache.mjs";
21
22
  import { resetValueHelpCache, resolveValueHelp } from "./value-help/resolve.mjs";
22
23
  import { FORM_ERROR_KEY, buildDescendantErrorCounts, iteratePathAncestors, mergeErrorMaps, omitPaths, validatorErrorsToMap } from "./form/error-utils.mjs";
23
- import { createFieldValidator, getDefaultValidatorPlugins, getFormValidator, isContainerKind, setDefaultValidatorPlugins } from "./form/validate.mjs";
24
+ import { UI_FORM_VALIDATE_ERROR_CODE, createFieldValidator, getDefaultValidatorPlugins, getFormValidator, isContainerKind, setDefaultValidatorPlugins } from "./form/validate.mjs";
24
25
  import { buildFormDiff, deepEqual } from "./form/diff.mjs";
25
26
  import { collectDirtyPaths, isPathDirty } from "./form/dirty.mjs";
26
27
  import { applyFormChanges } from "./form/apply.mjs";
@@ -33,4 +34,4 @@ import { NUMERIC_VALUE_KINDS, optionValue } from "./table/value-kind.mjs";
33
34
  import { getColumn, getFilterableColumns, getSortableColumns } from "./table/column-resolver.mjs";
34
35
  import { navigateHrefFor } from "./table/navigate-href.mjs";
35
36
  import { buildModelRoutes } from "./nav/model-routes.mjs";
36
- export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_BOOLEAN_LABELS, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, EXPECT_MAX_LENGTH, FORM_ERROR_KEY, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, NUMERIC_VALUE_KINDS, 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_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, activateUiTexts, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildModelRoutes, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createMetaClient, createTableDef, createUiTexts, deepClone, deepEqual, defaultResolver, deleteByPath, detectUnionVariant, enforceScale, escapeRegex, extractFieldLiteralOptions, extractLiteralOptions, extractMeasurement, extractValueHelp, fetchDistinctValues, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, getResolver, getSortableColumns, getThousandsSeparator, getUiTexts, groupInteger, hasComputedAnnotations, hasFieldMeta, invalidateValueHelpCache, isArrayField, isContainerKind, isFieldHidden, isObjectField, isPathDirty, isPickerDeclined, isPureLiteralUnion, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, mergeErrorMaps, navigateHrefFor, omitPaths, omitSkippedNavFields, onMetaCacheReset, onUiLocaleChange, optKey, optLabel, optionLabel, optionValue, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, retainMetaEntry, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setMetaCacheIdentity, setMetaCacheMaxEntries, setResolver, setUiLocale, setValueHelpCacheTtl, splitDecimalString, str, unionVariantChanged, validatorErrorsToMap, valueHelpDictPaths };
37
+ export { DB_AMOUNT_CURRENCY, DB_AMOUNT_CURRENCY_REF, DB_COLUMN_PRECISION, DB_HTTP_PATH, DB_REL_FK, DB_UNIT, DB_UNIT_REF, DEFAULT_BOOLEAN_LABELS, DEFAULT_COL_SPAN, DEFAULT_ROW_SPAN, EXPECT_MAX_LENGTH, FORM_ERROR_KEY, META_DEFAULT, META_DESCRIPTION, META_ID, META_LABEL, META_READONLY, META_REQUIRED, META_SENSITIVE, NUMERIC_VALUE_KINDS, 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_FORM_VALIDATE_ERROR_CODE, UI_NAV_GROUP, UI_NAV_HIDDEN, UI_NAV_ORDER, 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, activateUiTexts, applyFormChanges, asArray, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, buildGridClasses, buildModelRoutes, buildUnionVariants, collectDirtyPaths, createFieldValidator, createFormData, createFormDef, createFormValueResolver, createMetaClient, createTableDef, createUiTexts, deepClone, deepEqual, defaultResolver, deleteByPath, deserializeServedType, detectUnionVariant, enforceScale, escapeRegex, extractFieldLiteralOptions, extractLiteralOptions, extractMeasurement, extractValueHelp, fetchDistinctValues, fieldText, formatDecimalForDisplay, getByPath, getColumn, getCurrencyDecimals, getCurrencyDisplayParts, getDecimalSeparator, getDeclaredFormActions, getDefaultClientFactory, getDefaultValidatorPlugins, getFieldMeta, getFilterableColumns, getFormValidator, getMetaCacheIdentity, getMetaEntry, getMetaTableDef, getResolver, getSortableColumns, getThousandsSeparator, getUiTexts, groupInteger, hasComputedAnnotations, hasFieldMeta, invalidateValueHelpCache, isArrayField, isContainerKind, isFieldHidden, isObjectField, isPathDirty, isPickerDeclined, isPureLiteralUnion, isServedType, isTupleField, isUnionField, iteratePathAncestors, joinDecimalString, joinPath, markServedType, mergeErrorMaps, navigateHrefFor, omitPaths, omitSkippedNavFields, onMetaCacheReset, onUiLocaleChange, optKey, optLabel, optionLabel, optionValue, parseColSpan, parseDecimalInput, parseRowSpan, parseStaticAttrs, parseStaticOptions, resetDefaultClientFactory, resetMetaCache, resetValueHelpCache, resolveAttrs, resolveFieldProp, resolveFormProp, resolveGridSpec, resolveOptions, resolveSingularLabel, resolveStatic, resolveValueHelp, retainMetaEntry, setByPath, setDefaultClientFactory, setDefaultValidatorPlugins, setMetaCacheIdentity, setMetaCacheMaxEntries, setResolver, setUiLocale, setValueHelpCacheTtl, splitDecimalString, str, unionVariantChanged, userText, validatorErrorsToMap, valueHelpDictPaths };
@@ -1,4 +1,5 @@
1
1
  const require_annotation_keys = require("../shared/annotation-keys.cjs");
2
+ const require_model_texts = require("../i18n/model-texts.cjs");
2
3
  const require_field_resolver = require("../shared/field-resolver.cjs");
3
4
  const require_str = require("../shared/str.cjs");
4
5
  //#region src/nav/model-routes.ts
@@ -13,10 +14,15 @@ const require_str = require("../shared/str.cjs");
13
14
  * Routes are sorted by `order` ascending (undefined last, ties keep input
14
15
  * order). Hidden models are returned with `hidden: true` — filtering and
15
16
  * grouping are left to the consumer.
17
+ *
18
+ * `t` translates the label and the group of a model compiled into the client
19
+ * (the app's `t`; the keys are the source texts, as on the server). A served
20
+ * model (`deserializeServedType`) is translated already.
16
21
  */
17
- function buildModelRoutes(models) {
22
+ function buildModelRoutes(models, opts = {}) {
18
23
  const routes = [];
19
24
  for (const model of models) {
25
+ const t = require_model_texts.isServedType(model) ? void 0 : opts.t;
20
26
  const table = require_field_resolver.getFieldMeta(model, require_annotation_keys.DB_TABLE);
21
27
  const view = require_field_resolver.getFieldMeta(model, require_annotation_keys.DB_VIEW);
22
28
  const isView = view !== void 0 || require_field_resolver.hasFieldMeta(model, "db.view.for");
@@ -26,10 +32,10 @@ function buildModelRoutes(models) {
26
32
  const route = {
27
33
  model,
28
34
  path,
29
- label: require_field_resolver.getFieldMeta(model, "meta.label") ?? require_str.humanizePath(path.slice(path.lastIndexOf("/") + 1)),
35
+ label: require_model_texts.fieldText(model, "meta.label", t) ?? require_str.humanizePath(path.slice(path.lastIndexOf("/") + 1)),
30
36
  kind: isView ? "view" : "table"
31
37
  };
32
- const group = require_field_resolver.getFieldMeta(model, require_annotation_keys.UI_NAV_GROUP);
38
+ const group = require_model_texts.fieldText(model, require_annotation_keys.UI_NAV_GROUP, t);
33
39
  if (typeof group === "string") route.group = group;
34
40
  const order = require_field_resolver.getFieldMeta(model, require_annotation_keys.UI_NAV_ORDER);
35
41
  if (typeof order === "number") route.order = order;
@@ -1,3 +1,4 @@
1
+ import { UserTextT } from "../i18n/model-texts.cjs";
1
2
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
2
3
 
3
4
  //#region src/nav/model-routes.d.ts
@@ -27,7 +28,13 @@ interface TModelRoute {
27
28
  * Routes are sorted by `order` ascending (undefined last, ties keep input
28
29
  * order). Hidden models are returned with `hidden: true` — filtering and
29
30
  * grouping are left to the consumer.
31
+ *
32
+ * `t` translates the label and the group of a model compiled into the client
33
+ * (the app's `t`; the keys are the source texts, as on the server). A served
34
+ * model (`deserializeServedType`) is translated already.
30
35
  */
31
- declare function buildModelRoutes(models: readonly TAtscriptAnnotatedType[]): TModelRoute[];
36
+ declare function buildModelRoutes(models: readonly TAtscriptAnnotatedType[], opts?: {
37
+ t?: UserTextT;
38
+ }): TModelRoute[];
32
39
  //#endregion
33
40
  export { TModelRoute, buildModelRoutes };
@@ -1,3 +1,4 @@
1
+ import { UserTextT } from "../i18n/model-texts.mjs";
1
2
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
2
3
 
3
4
  //#region src/nav/model-routes.d.ts
@@ -27,7 +28,13 @@ interface TModelRoute {
27
28
  * Routes are sorted by `order` ascending (undefined last, ties keep input
28
29
  * order). Hidden models are returned with `hidden: true` — filtering and
29
30
  * grouping are left to the consumer.
31
+ *
32
+ * `t` translates the label and the group of a model compiled into the client
33
+ * (the app's `t`; the keys are the source texts, as on the server). A served
34
+ * model (`deserializeServedType`) is translated already.
30
35
  */
31
- declare function buildModelRoutes(models: readonly TAtscriptAnnotatedType[]): TModelRoute[];
36
+ declare function buildModelRoutes(models: readonly TAtscriptAnnotatedType[], opts?: {
37
+ t?: UserTextT;
38
+ }): TModelRoute[];
32
39
  //#endregion
33
40
  export { TModelRoute, buildModelRoutes };
@@ -1,4 +1,5 @@
1
1
  import { DB_HTTP_PATH, DB_TABLE, DB_VIEW, UI_NAV_GROUP, UI_NAV_ORDER } from "../shared/annotation-keys.mjs";
2
+ import { fieldText, isServedType } from "../i18n/model-texts.mjs";
2
3
  import { getFieldMeta, hasFieldMeta } from "../shared/field-resolver.mjs";
3
4
  import { humanizePath } from "../shared/str.mjs";
4
5
  //#region src/nav/model-routes.ts
@@ -13,10 +14,15 @@ import { humanizePath } from "../shared/str.mjs";
13
14
  * Routes are sorted by `order` ascending (undefined last, ties keep input
14
15
  * order). Hidden models are returned with `hidden: true` — filtering and
15
16
  * grouping are left to the consumer.
17
+ *
18
+ * `t` translates the label and the group of a model compiled into the client
19
+ * (the app's `t`; the keys are the source texts, as on the server). A served
20
+ * model (`deserializeServedType`) is translated already.
16
21
  */
17
- function buildModelRoutes(models) {
22
+ function buildModelRoutes(models, opts = {}) {
18
23
  const routes = [];
19
24
  for (const model of models) {
25
+ const t = isServedType(model) ? void 0 : opts.t;
20
26
  const table = getFieldMeta(model, DB_TABLE);
21
27
  const view = getFieldMeta(model, DB_VIEW);
22
28
  const isView = view !== void 0 || hasFieldMeta(model, "db.view.for");
@@ -26,10 +32,10 @@ function buildModelRoutes(models) {
26
32
  const route = {
27
33
  model,
28
34
  path,
29
- label: getFieldMeta(model, "meta.label") ?? humanizePath(path.slice(path.lastIndexOf("/") + 1)),
35
+ label: fieldText(model, "meta.label", t) ?? humanizePath(path.slice(path.lastIndexOf("/") + 1)),
30
36
  kind: isView ? "view" : "table"
31
37
  };
32
- const group = getFieldMeta(model, UI_NAV_GROUP);
38
+ const group = fieldText(model, UI_NAV_GROUP, t);
33
39
  if (typeof group === "string") route.group = group;
34
40
  const order = getFieldMeta(model, UI_NAV_ORDER);
35
41
  if (typeof order === "number") route.order = order;
@@ -1,4 +1,5 @@
1
1
  require("./annotation-keys.cjs");
2
+ const require_model_texts = require("../i18n/model-texts.cjs");
2
3
  //#region src/shared/field-resolver.ts
3
4
  /** Static resolver — ignores fn keys, reads only static metadata. */
4
5
  var StaticFieldResolver = class {
@@ -18,8 +19,8 @@ function resolveStatic(metadata, staticKey, opts) {
18
19
  const staticVal = metadata.get(staticKey);
19
20
  if (staticVal !== void 0) {
20
21
  if (opts?.staticAsBoolean) return true;
21
- if (opts?.transform) return opts.transform(staticVal);
22
- return staticVal;
22
+ const value = require_model_texts.userText(staticKey, staticVal, opts?.t);
23
+ return opts?.transform ? opts.transform(value) : value;
23
24
  }
24
25
  }
25
26
  /** Default static resolver instance. */
@@ -1,3 +1,4 @@
1
+ import { UserTextT } from "../i18n/model-texts.cjs";
1
2
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
2
3
 
3
4
  //#region src/shared/field-resolver.d.ts
@@ -5,6 +6,11 @@ import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
5
6
  interface TResolveOptions<T> {
6
7
  /** When true, any non-undefined static value is returned as `true` (for boolean flags like ui.disabled). */
7
8
  staticAsBoolean?: boolean;
9
+ /**
10
+ * Translates a static text of the model (`meta.label`, `ui.form.hint`, …) before it is returned
11
+ * (and transformed). A dynamic result is the resolver's own to translate. Omit for the source text.
12
+ */
13
+ t?: UserTextT;
8
14
  /** Transform the raw static value before returning. */
9
15
  transform?: (raw: unknown) => T;
10
16
  }
@@ -1,3 +1,4 @@
1
+ import { UserTextT } from "../i18n/model-texts.mjs";
1
2
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
2
3
 
3
4
  //#region src/shared/field-resolver.d.ts
@@ -5,6 +6,11 @@ import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
5
6
  interface TResolveOptions<T> {
6
7
  /** When true, any non-undefined static value is returned as `true` (for boolean flags like ui.disabled). */
7
8
  staticAsBoolean?: boolean;
9
+ /**
10
+ * Translates a static text of the model (`meta.label`, `ui.form.hint`, …) before it is returned
11
+ * (and transformed). A dynamic result is the resolver's own to translate. Omit for the source text.
12
+ */
13
+ t?: UserTextT;
8
14
  /** Transform the raw static value before returning. */
9
15
  transform?: (raw: unknown) => T;
10
16
  }
@@ -1,4 +1,5 @@
1
1
  import "./annotation-keys.mjs";
2
+ import { userText } from "../i18n/model-texts.mjs";
2
3
  //#region src/shared/field-resolver.ts
3
4
  /** Static resolver — ignores fn keys, reads only static metadata. */
4
5
  var StaticFieldResolver = class {
@@ -18,8 +19,8 @@ function resolveStatic(metadata, staticKey, opts) {
18
19
  const staticVal = metadata.get(staticKey);
19
20
  if (staticVal !== void 0) {
20
21
  if (opts?.staticAsBoolean) return true;
21
- if (opts?.transform) return opts.transform(staticVal);
22
- return staticVal;
22
+ const value = userText(staticKey, staticVal, opts?.t);
23
+ return opts?.transform ? opts.transform(value) : value;
23
24
  }
24
25
  }
25
26
  /** Default static resolver instance. */
@@ -1,8 +1,8 @@
1
+ const require_model_texts = require("../i18n/model-texts.cjs");
1
2
  const require_ui_texts = require("../i18n/ui-texts.cjs");
2
3
  const require_value_help_client = require("../value-help/value-help-client.cjs");
3
4
  const require_client_factory = require("../client-factory.cjs");
4
5
  const require_create_table_def = require("../table/create-table-def.cjs");
5
- let _atscript_typescript_utils = require("@atscript/typescript/utils");
6
6
  let _atscript_db_client = require("@atscript/db-client");
7
7
  //#region src/shared/meta-cache.ts
8
8
  /**
@@ -203,12 +203,12 @@ function getMetaTableDef(entry, texts = require_ui_texts.getUiTexts()) {
203
203
  function derive(entry, client, meta) {
204
204
  const slot = slots.get(entry);
205
205
  const etag = cache.get(slot.key) === entry ? client.metaEtag?.() : void 0;
206
- if (etag === void 0) return { type: (0, _atscript_typescript_utils.deserializeAnnotatedType)(meta.type) };
206
+ if (etag === void 0) return { type: require_model_texts.deserializeServedType(meta.type) };
207
207
  let shared = derivedByEtag.get(etag);
208
208
  if (shared) shared.refs++;
209
209
  else {
210
210
  shared = {
211
- derived: { type: (0, _atscript_typescript_utils.deserializeAnnotatedType)(meta.type) },
211
+ derived: { type: require_model_texts.deserializeServedType(meta.type) },
212
212
  refs: 1
213
213
  };
214
214
  derivedByEtag.set(etag, shared);
@@ -11,7 +11,7 @@ import { Client } from "@atscript/db-client";
11
11
  * the raw `/meta` promise, the deserialized type, and lazily-populated derived
12
12
  * shapes (`ResolvedValueHelp` for value-help, `TableDef` for tables). Both
13
13
  * `resolveValueHelp` and `useTable` route through it so a given URL triggers
14
- * at most one network round-trip and one `deserializeAnnotatedType` per UI
14
+ * at most one network round-trip and one `deserializeServedType` per UI
15
15
  * locale.
16
16
  *
17
17
  * Each entry belongs to one UI locale (see {@link MetaEntryOptions.texts}):
@@ -11,7 +11,7 @@ import { Client } from "@atscript/db-client";
11
11
  * the raw `/meta` promise, the deserialized type, and lazily-populated derived
12
12
  * shapes (`ResolvedValueHelp` for value-help, `TableDef` for tables). Both
13
13
  * `resolveValueHelp` and `useTable` route through it so a given URL triggers
14
- * at most one network round-trip and one `deserializeAnnotatedType` per UI
14
+ * at most one network round-trip and one `deserializeServedType` per UI
15
15
  * locale.
16
16
  *
17
17
  * Each entry belongs to one UI locale (see {@link MetaEntryOptions.texts}):
@@ -1,8 +1,8 @@
1
+ import { deserializeServedType } from "../i18n/model-texts.mjs";
1
2
  import { getUiTexts } from "../i18n/ui-texts.mjs";
2
3
  import { invalidateValueHelpCache } from "../value-help/value-help-client.mjs";
3
4
  import { getDefaultClientFactory } from "../client-factory.mjs";
4
5
  import { createTableDef } from "../table/create-table-def.mjs";
5
- import { deserializeAnnotatedType } from "@atscript/typescript/utils";
6
6
  import { clearMetaStore, defaultMetaStore } from "@atscript/db-client";
7
7
  //#region src/shared/meta-cache.ts
8
8
  /**
@@ -203,12 +203,12 @@ function getMetaTableDef(entry, texts = getUiTexts()) {
203
203
  function derive(entry, client, meta) {
204
204
  const slot = slots.get(entry);
205
205
  const etag = cache.get(slot.key) === entry ? client.metaEtag?.() : void 0;
206
- if (etag === void 0) return { type: deserializeAnnotatedType(meta.type) };
206
+ if (etag === void 0) return { type: deserializeServedType(meta.type) };
207
207
  let shared = derivedByEtag.get(etag);
208
208
  if (shared) shared.refs++;
209
209
  else {
210
210
  shared = {
211
- derived: { type: deserializeAnnotatedType(meta.type) },
211
+ derived: { type: deserializeServedType(meta.type) },
212
212
  refs: 1
213
213
  };
214
214
  derivedByEtag.set(etag, shared);
@@ -1,4 +1,5 @@
1
1
  const require_annotation_keys = require("../shared/annotation-keys.cjs");
2
+ const require_model_texts = require("../i18n/model-texts.cjs");
2
3
  const require_field_resolver = require("../shared/field-resolver.cjs");
3
4
  const require_extract_literals = require("../value-help/extract-literals.cjs");
4
5
  const require_extract_ref = require("../value-help/extract-ref.cjs");
@@ -18,7 +19,7 @@ let _atscript_typescript_utils = require("@atscript/typescript/utils");
18
19
  * active UI texts when omitted.
19
20
  */
20
21
  function createTableDef(meta, preDeserializedType, t) {
21
- const type = preDeserializedType ?? (0, _atscript_typescript_utils.deserializeAnnotatedType)(meta.type);
22
+ const type = preDeserializedType ?? require_model_texts.deserializeServedType(meta.type);
22
23
  const flatMap = type.type.kind === "object" ? (0, _atscript_typescript_utils.flattenAnnotatedType)(type, { excludePhantomTypes: true }) : /* @__PURE__ */ new Map();
23
24
  const columns = [];
24
25
  for (const [path, prop] of flatMap.entries()) {
@@ -1,4 +1,5 @@
1
1
  import { DB_HTTP_PATH, EXPECT_MAX_LENGTH, UI_TABLE_COMPONENT, UI_TABLE_SELECT_WITH, UI_TABLE_TYPE, UI_TABLE_WIDTH, UI_TYPE } from "../shared/annotation-keys.mjs";
2
+ import { deserializeServedType } from "../i18n/model-texts.mjs";
2
3
  import { getFieldMeta } from "../shared/field-resolver.mjs";
3
4
  import { extractFieldLiteralOptions, isEmptyMember } from "../value-help/extract-literals.mjs";
4
5
  import { extractValueHelp } from "../value-help/extract-ref.mjs";
@@ -18,7 +19,7 @@ import { deserializeAnnotatedType, flattenAnnotatedType } from "@atscript/typesc
18
19
  * active UI texts when omitted.
19
20
  */
20
21
  function createTableDef(meta, preDeserializedType, t) {
21
- const type = preDeserializedType ?? deserializeAnnotatedType(meta.type);
22
+ const type = preDeserializedType ?? deserializeServedType(meta.type);
22
23
  const flatMap = type.type.kind === "object" ? flattenAnnotatedType(type, { excludePhantomTypes: true }) : /* @__PURE__ */ new Map();
23
24
  const columns = [];
24
25
  for (const [path, prop] of flatMap.entries()) {
@@ -1,4 +1,5 @@
1
1
  require("../shared/annotation-keys.cjs");
2
+ const require_model_texts = require("../i18n/model-texts.cjs");
2
3
  const require_messages = require("../messages.cjs");
3
4
  const require_ui_texts = require("../i18n/ui-texts.cjs");
4
5
  //#region src/value-help/extract-literals.ts
@@ -22,12 +23,14 @@ const DEFAULT_BOOLEAN_LABELS = Object.freeze({
22
23
  * Handles nested unions created by flattenAnnotatedType, which recurses
23
24
  * into union items and produces synthetic unions containing both individual
24
25
  * literals and the original union type as nested items.
26
+ *
27
+ * `text` translates the `@ui.literalLabel` labels (the literals themselves are data).
25
28
  */
26
- function extractLiteralOptions(prop, outer, t = require_ui_texts.getUiTexts().t) {
29
+ function extractLiteralOptions(prop, outer, t = require_ui_texts.getUiTexts().t, text) {
27
30
  const items = prop.type.kind === "union" ? prop.type.items : isBooleanPrimitive(prop) ? [prop] : void 0;
28
31
  const result = items && collectLiterals(items, /* @__PURE__ */ new Set(), t);
29
32
  if (!result || result.length === 0) return void 0;
30
- const labels = [prop, outer].flatMap((node) => node?.metadata.get("ui.literalLabel") ?? []);
33
+ const labels = [prop, outer].flatMap((node) => require_model_texts.userText("ui.literalLabel", node?.metadata.get("ui.literalLabel"), text) ?? []);
31
34
  if (labels.length) {
32
35
  const byValue = new Map(labels.map((l) => [l.value, l.label]));
33
36
  for (const option of result) option.label = byValue.get(option.key) ?? option.label;
@@ -40,9 +43,9 @@ function extractLiteralOptions(prop, outer, t = require_ui_texts.getUiTexts().t)
40
43
  * prop's own `@ui.literalLabel` labels win over the element type's. `undefined` when
41
44
  * the field is neither. Since 0.1.148.
42
45
  */
43
- function extractFieldLiteralOptions(prop, t = require_ui_texts.getUiTexts().t) {
44
- if (prop.type.kind === "array") return extractLiteralOptions(prop.type.of, prop, t);
45
- return extractLiteralOptions(prop, void 0, t);
46
+ function extractFieldLiteralOptions(prop, t = require_ui_texts.getUiTexts().t, text) {
47
+ if (prop.type.kind === "array") return extractLiteralOptions(prop.type.of, prop, t, text);
48
+ return extractLiteralOptions(prop, void 0, t, text);
46
49
  }
47
50
  /** A `null` / `undefined` member of a union (`T | null`): no value of its own. */
48
51
  function isEmptyMember(item) {
@@ -1,3 +1,4 @@
1
+ import { UserTextT } from "../i18n/model-texts.cjs";
1
2
  import { UiT } from "../i18n/ui-texts.cjs";
2
3
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
3
4
 
@@ -29,15 +30,17 @@ declare const DEFAULT_BOOLEAN_LABELS: Readonly<Record<"true" | "false", string>>
29
30
  * Handles nested unions created by flattenAnnotatedType, which recurses
30
31
  * into union items and produces synthetic unions containing both individual
31
32
  * literals and the original union type as nested items.
33
+ *
34
+ * `text` translates the `@ui.literalLabel` labels (the literals themselves are data).
32
35
  */
33
- declare function extractLiteralOptions(prop: TAtscriptAnnotatedType, outer?: TAtscriptAnnotatedType, t?: UiT): LiteralOption[] | undefined;
36
+ declare function extractLiteralOptions(prop: TAtscriptAnnotatedType, outer?: TAtscriptAnnotatedType, t?: UiT, text?: UserTextT): LiteralOption[] | undefined;
34
37
  /**
35
38
  * The literal options of a field: a literal union's or a boolean's (since 0.1.165),
36
39
  * or those of an array of one (`tags: Tag[]`, `flags: boolean[]`), where the array
37
40
  * prop's own `@ui.literalLabel` labels win over the element type's. `undefined` when
38
41
  * the field is neither. Since 0.1.148.
39
42
  */
40
- declare function extractFieldLiteralOptions(prop: TAtscriptAnnotatedType, t?: UiT): LiteralOption[] | undefined;
43
+ declare function extractFieldLiteralOptions(prop: TAtscriptAnnotatedType, t?: UiT, text?: UserTextT): LiteralOption[] | undefined;
41
44
  /** Returns true when the annotated type is a union composed entirely of literal values. */
42
45
  declare function isPureLiteralUnion(prop: TAtscriptAnnotatedType): boolean;
43
46
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { UserTextT } from "../i18n/model-texts.mjs";
1
2
  import { UiT } from "../i18n/ui-texts.mjs";
2
3
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
3
4
 
@@ -29,15 +30,17 @@ declare const DEFAULT_BOOLEAN_LABELS: Readonly<Record<"true" | "false", string>>
29
30
  * Handles nested unions created by flattenAnnotatedType, which recurses
30
31
  * into union items and produces synthetic unions containing both individual
31
32
  * literals and the original union type as nested items.
33
+ *
34
+ * `text` translates the `@ui.literalLabel` labels (the literals themselves are data).
32
35
  */
33
- declare function extractLiteralOptions(prop: TAtscriptAnnotatedType, outer?: TAtscriptAnnotatedType, t?: UiT): LiteralOption[] | undefined;
36
+ declare function extractLiteralOptions(prop: TAtscriptAnnotatedType, outer?: TAtscriptAnnotatedType, t?: UiT, text?: UserTextT): LiteralOption[] | undefined;
34
37
  /**
35
38
  * The literal options of a field: a literal union's or a boolean's (since 0.1.165),
36
39
  * or those of an array of one (`tags: Tag[]`, `flags: boolean[]`), where the array
37
40
  * prop's own `@ui.literalLabel` labels win over the element type's. `undefined` when
38
41
  * the field is neither. Since 0.1.148.
39
42
  */
40
- declare function extractFieldLiteralOptions(prop: TAtscriptAnnotatedType, t?: UiT): LiteralOption[] | undefined;
43
+ declare function extractFieldLiteralOptions(prop: TAtscriptAnnotatedType, t?: UiT, text?: UserTextT): LiteralOption[] | undefined;
41
44
  /** Returns true when the annotated type is a union composed entirely of literal values. */
42
45
  declare function isPureLiteralUnion(prop: TAtscriptAnnotatedType): boolean;
43
46
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import "../shared/annotation-keys.mjs";
2
+ import { userText } from "../i18n/model-texts.mjs";
2
3
  import { AS_UI_MESSAGES } from "../messages.mjs";
3
4
  import { getUiTexts } from "../i18n/ui-texts.mjs";
4
5
  //#region src/value-help/extract-literals.ts
@@ -22,12 +23,14 @@ const DEFAULT_BOOLEAN_LABELS = Object.freeze({
22
23
  * Handles nested unions created by flattenAnnotatedType, which recurses
23
24
  * into union items and produces synthetic unions containing both individual
24
25
  * literals and the original union type as nested items.
26
+ *
27
+ * `text` translates the `@ui.literalLabel` labels (the literals themselves are data).
25
28
  */
26
- function extractLiteralOptions(prop, outer, t = getUiTexts().t) {
29
+ function extractLiteralOptions(prop, outer, t = getUiTexts().t, text) {
27
30
  const items = prop.type.kind === "union" ? prop.type.items : isBooleanPrimitive(prop) ? [prop] : void 0;
28
31
  const result = items && collectLiterals(items, /* @__PURE__ */ new Set(), t);
29
32
  if (!result || result.length === 0) return void 0;
30
- const labels = [prop, outer].flatMap((node) => node?.metadata.get("ui.literalLabel") ?? []);
33
+ const labels = [prop, outer].flatMap((node) => userText("ui.literalLabel", node?.metadata.get("ui.literalLabel"), text) ?? []);
31
34
  if (labels.length) {
32
35
  const byValue = new Map(labels.map((l) => [l.value, l.label]));
33
36
  for (const option of result) option.label = byValue.get(option.key) ?? option.label;
@@ -40,9 +43,9 @@ function extractLiteralOptions(prop, outer, t = getUiTexts().t) {
40
43
  * prop's own `@ui.literalLabel` labels win over the element type's. `undefined` when
41
44
  * the field is neither. Since 0.1.148.
42
45
  */
43
- function extractFieldLiteralOptions(prop, t = getUiTexts().t) {
44
- if (prop.type.kind === "array") return extractLiteralOptions(prop.type.of, prop, t);
45
- return extractLiteralOptions(prop, void 0, t);
46
+ function extractFieldLiteralOptions(prop, t = getUiTexts().t, text) {
47
+ if (prop.type.kind === "array") return extractLiteralOptions(prop.type.of, prop, t, text);
48
+ return extractLiteralOptions(prop, void 0, t, text);
46
49
  }
47
50
  /** A `null` / `undefined` member of a union (`T | null`): no value of its own. */
48
51
  function isEmptyMember(item) {
@@ -1,4 +1,5 @@
1
1
  const require_annotation_keys = require("../shared/annotation-keys.cjs");
2
+ const require_model_texts = require("../i18n/model-texts.cjs");
2
3
  const require_field_resolver = require("../shared/field-resolver.cjs");
3
4
  const require_extract_literals = require("./extract-literals.cjs");
4
5
  //#region src/value-help/resolve-options.ts
@@ -30,16 +31,22 @@ function optionLabel(column, value) {
30
31
  return labels.get(String(value));
31
32
  }
32
33
  /**
33
- * Converts raw option annotation value to a normalized array.
34
+ * Converts raw option annotation value to a normalized array. `t` translates
35
+ * the labels (never the keys: an option without a value is its own key).
34
36
  */
35
- function parseStaticOptions(raw) {
37
+ function parseStaticOptions(raw, t) {
36
38
  return require_field_resolver.asArray(raw).map((item) => {
37
39
  if (typeof item === "object" && item !== null && "label" in item) {
38
40
  const { label, value } = item;
39
- return value !== void 0 ? {
41
+ const shown = require_model_texts.userText(require_annotation_keys.UI_FORM_OPTIONS, { label }, t).label;
42
+ if (value !== void 0) return {
40
43
  key: value,
41
- label
42
- } : label;
44
+ label: shown
45
+ };
46
+ return shown === label ? label : {
47
+ key: label,
48
+ label: shown
49
+ };
43
50
  }
44
51
  return String(item);
45
52
  });
@@ -54,11 +61,13 @@ function parseStaticOptions(raw) {
54
61
  *
55
62
  * `t` words the default boolean labels (`UI_YES` / `UI_NO`); the active UI
56
63
  * texts when omitted — a component passes its app's (`useAsLocale().t`).
64
+ * `text` translates the labels the model declares (`@ui.form.options`,
65
+ * `@ui.literalLabel`); a computed option list is the fn's own to translate.
57
66
  */
58
- function resolveOptions(prop, scope, labelsFrom, t) {
59
- const resolved = require_field_resolver.resolveFieldProp(prop, require_annotation_keys.UI_FORM_FN_OPTIONS, require_annotation_keys.UI_FORM_OPTIONS, scope, { transform: parseStaticOptions });
67
+ function resolveOptions(prop, scope, labelsFrom, t, text) {
68
+ const resolved = require_field_resolver.resolveFieldProp(prop, require_annotation_keys.UI_FORM_FN_OPTIONS, require_annotation_keys.UI_FORM_OPTIONS, scope, { transform: (raw) => parseStaticOptions(raw, text) });
60
69
  if (resolved !== void 0) return resolved;
61
- return labelsFrom ? require_extract_literals.extractLiteralOptions(prop, labelsFrom, t) : require_extract_literals.extractFieldLiteralOptions(prop, t);
70
+ return labelsFrom ? require_extract_literals.extractLiteralOptions(prop, labelsFrom, t, text) : require_extract_literals.extractFieldLiteralOptions(prop, t, text);
62
71
  }
63
72
  //#endregion
64
73
  exports.optKey = optKey;