@wix/bex-core 2.383.0 → 2.384.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/state/CustomFieldModalBiReporter.js +3 -1
- package/dist/cjs/state/CustomFieldModalBiReporter.js.map +1 -1
- package/dist/cjs/state/CustomFieldModalState.js +41 -18
- package/dist/cjs/state/CustomFieldModalState.js.map +1 -1
- package/dist/cjs/state/ImportState/ImportState.js +29 -3
- package/dist/cjs/state/ImportState/ImportState.js.map +1 -1
- package/dist/cjs/state/ImportState/__tests__/ImportState.engine.spec.js +67 -0
- package/dist/cjs/state/ImportState/__tests__/ImportState.engine.spec.js.map +1 -1
- package/dist/cjs/state/ImportState/__tests__/buildImportConfig.spec.js +13 -0
- package/dist/cjs/state/ImportState/__tests__/buildImportConfig.spec.js.map +1 -1
- package/dist/cjs/types/FieldTypeDefinition.js.map +1 -1
- package/dist/cjs/types/FieldsSource.js.map +1 -1
- package/dist/cjs/types/Schema.js.map +1 -1
- package/dist/cjs/types/SchemaSource.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/state/CustomFieldModalBiReporter.js +3 -1
- package/dist/esm/state/CustomFieldModalBiReporter.js.map +1 -1
- package/dist/esm/state/CustomFieldModalState.js +37 -8
- package/dist/esm/state/CustomFieldModalState.js.map +1 -1
- package/dist/esm/state/ImportState/ImportState.js +21 -1
- package/dist/esm/state/ImportState/ImportState.js.map +1 -1
- package/dist/esm/state/ImportState/__tests__/ImportState.engine.spec.js +41 -0
- package/dist/esm/state/ImportState/__tests__/ImportState.engine.spec.js.map +1 -1
- package/dist/esm/state/ImportState/__tests__/buildImportConfig.spec.js +13 -0
- package/dist/esm/state/ImportState/__tests__/buildImportConfig.spec.js.map +1 -1
- package/dist/esm/types/FieldTypeDefinition.js.map +1 -1
- package/dist/esm/types/SchemaSource.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/state/CustomFieldModalBiReporter.d.ts.map +1 -1
- package/dist/types/state/CustomFieldModalState.d.ts +3 -0
- package/dist/types/state/CustomFieldModalState.d.ts.map +1 -1
- package/dist/types/state/ImportState/ImportState.d.ts +7 -1
- package/dist/types/state/ImportState/ImportState.d.ts.map +1 -1
- package/dist/types/types/FieldTypeDefinition.d.ts +3 -0
- package/dist/types/types/FieldTypeDefinition.d.ts.map +1 -1
- package/dist/types/types/FieldsSource.d.ts +5 -0
- package/dist/types/types/FieldsSource.d.ts.map +1 -1
- package/dist/types/types/Schema.d.ts +7 -4
- package/dist/types/types/Schema.d.ts.map +1 -1
- package/dist/types/types/SchemaSource.d.ts +3 -0
- package/dist/types/types/SchemaSource.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isFilterTypeConfig","filter","defineFieldType","definition","resolveFieldTypeDefinition","source","field","_source$fieldTypes","type","customType","undefined","fieldTypes","find","def"],"sources":["../../../src/types/FieldTypeDefinition.ts"],"sourcesContent":["import type {\n ComponentType,\n MutableRefObject,\n ReactElement,\n ReactNode,\n} from 'react';\nimport type { Field } from './Field';\nimport type { Filter } from '../model/filter';\nimport type {\n FieldModalCollectionInput,\n FieldPiiWarning,\n FieldSettingsSection,\n FieldsSource,\n} from './FieldsSource';\n\nexport type ValidationRule =\n | { type: 'required'; message: string }\n | { type: 'min' | 'max'; value: number; message: string }\n | { type: 'minLength' | 'maxLength'; value: number; message: string }\n | { type: 'pattern'; value: RegExp; message: string }\n | { type: 'custom'; validate: (value: unknown) => boolean; message: string }\n | {\n type: 'specificValues';\n values: { id: string; value: string }[];\n message: string;\n };\n\nexport interface Focusable {\n focus: () => void;\n}\n\nexport type EditTrigger =\n | { kind: 'type'; key: string }\n | 'enter'\n | 'click'\n | 'doubleClick';\n\nexport interface CellViewProps<V> {\n value: V;\n typeConfig?: unknown;\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n /** Whether the cell is editable. Used to conditionally render placeholders (don't show them for read-only cells). */\n isEditable?: boolean;\n}\n\nexport interface CellEditProps<V> {\n value: V;\n // Method syntax keeps CellEditProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n onCommit: () => void;\n onCancel: () => void;\n /**\n * Signals that the cell is starting an editing operation that will move focus\n * outside the table (e.g., opening a media manager or a modal). Calling this\n * sets isEditing=true so the table does not clear cell focus while the\n * external UI is open. Pair with onCommit (after the operation succeeds)\n * or onCancel (if the user dismisses without a value change).\n */\n onStartEdit?: () => void;\n /** Ref to the focusable input element. Used for type-to-edit (focusing the input when user starts typing on a focused cell). */\n inputRef?: MutableRefObject<Focusable | undefined | null>;\n typeConfig?: unknown;\n /** How edit mode was triggered. Edit components can use this to customize behavior (e.g., date picker auto-opens on 'type'). */\n editTrigger?: EditTrigger | null;\n /** Column-level validation rules. Edit components can derive UI behavior (e.g., maxLength blocking/tooltip) from these. */\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n}\n\n/**\n * Props passed to a cell type's optional `EditWrapper`. The table mounts the\n * wrapper around the cell content and keeps it mounted across the edit↔view\n * transition, so the wrapper can own behavior that must outlive the inline\n * editor (e.g. a reference cell navigating to an overlay and refreshing on\n * return). The wrapper hands anything the editor needs down via its own context.\n */\nexport interface CellEditWrapperProps {\n /** The column's typeConfig (same value handed to the cell's Edit/View). */\n typeConfig?: unknown;\n /** Stable id of the column. */\n columnId: string;\n /** Stable key of the row. */\n rowKey: string;\n /** The cell content (the Edit or View component) to render inside the wrapper. */\n children: ReactNode;\n}\n\nexport type EditableCellContextMenuAction = 'copy' | 'cut' | 'paste' | 'clear';\n\nexport interface EditableCellContextMenuActionContext<V> {\n /** Current cell value, including pending or draft edits. */\n value: V;\n /** Field metadata associated with the column, when available. */\n field?: Field;\n /** Stable key of the row. */\n rowKey: string;\n /** Stable id of the column. */\n columnId: string;\n}\n\nexport interface EditableCellContextMenuActionConfig<V> {\n /** Returning a non-empty string disables the action and shows the tooltip. */\n disabledTooltip(\n context: EditableCellContextMenuActionContext<V>,\n ): string | undefined;\n}\n\n/**\n * The editable-cell slot of a field type definition: how a cell of that type\n * renders, edits, and moves through the clipboard. The definition's key\n * identifies the type and the definition's `value` owns validation, so the\n * slot carries neither.\n *\n * Members that take `V` use method syntax so a definition typed with a\n * concrete value type stays assignable where a loosely typed definition is\n * expected (see `FieldTypeDefinition`).\n */\nexport interface EditableCellConfig<V> {\n /** Render cell in view mode (read-only display). */\n ViewComponent(props: CellViewProps<V>): ReactElement | null;\n /** Render cell in edit mode (inline editor). Optional — omit for view-only cells. */\n EditComponent?(props: CellEditProps<V>): ReactElement | null;\n /** Serialize value to clipboard string. */\n serialize?(value: V): string;\n /** Deserialize clipboard string to value. */\n deserialize?(raw: string): V;\n /** Can this cell type be edited? (default: true) */\n editable?: boolean;\n /** Availability of Cairo's built-in cell context-menu actions. */\n contextMenu?: Partial<\n Record<\n EditableCellContextMenuAction,\n EditableCellContextMenuActionConfig<V>\n >\n >;\n /** Toggle value on single click (e.g., boolean checkbox). Skips focus→edit flow. */\n toggleValue?(value: V): V;\n /** Enter edit mode on single click (e.g., image cell with no value). */\n editOnClick?(value: V): boolean;\n /** Show the EditComponent when the cell is focused, without entering edit mode.\n * Keyboard navigation remains active. Similar to toggleValue but without toggling. */\n showEditWhenFocused?: boolean;\n /** Optional wrapper component the cell type defines to own behavior that must\n * outlive the inline editor. Mounted around the cell content and kept mounted\n * across the edit↔view transition. */\n EditWrapper?: ComponentType<CellEditWrapperProps>;\n /** Cell content can grow past row height when focused. Only applies to\n * showEditWhenFocused cells. */\n growable?: boolean;\n /** Called on type-to-edit. Return object with cleared value and/or prevent flag.\n * Return undefined to block the key. Return {} to enter edit mode without changing the value. */\n onTypeToEdit?(params: {\n key: string;\n validation?: ValidationRule[];\n }): { value?: V } | undefined;\n /** Optional hook to normalize the committed value (e.g. auto-prepend https://).\n * Called before the edit commits; the value is written back before committing. */\n normalizeOnCommit?(value: V): V;\n /** When true, type-to-edit flushes the edit-mode render synchronously and\n * focuses the input within the same keydown event, then lets the browser's\n * default action deliver the keystroke to the now-focused input naturally.\n * Use for cells that wrap a controlled input whose value can't be seeded via props. */\n nativeTypeToEdit?: boolean;\n}\n\n/** The props the filter builder passes to a definition's toolbar filter\n * component — the same contract the built-in filter elements receive. */\nexport interface FilterTypeComponentProps<V = any> {\n filter: Filter<V>;\n toolbarItemProps?: { label?: ReactNode };\n toolbarTagProps?: { label?: string };\n accordionItemProps?: { label?: string };\n}\n\n/** The filter slot of a field type definition: the filter state registered on\n * the collection query and the toolbar element that renders it. */\nexport interface FilterTypeConfig {\n createFilter: (field: Field) => Filter<any>;\n Component: ComponentType<FilterTypeComponentProps>;\n}\n\n/** Narrows a definition's filter slot to an active filter config. */\nexport function isFilterTypeConfig(\n filter: FieldTypeDefinition['filter'],\n): filter is FilterTypeConfig {\n return 'createFilter' in filter;\n}\n\n/**\n * The read-only table slot of a field type definition: how a cell of that\n * type renders in the table, and the column's layout. Independent of\n * `editableTable` — neither slot falls back to the other.\n */\n/** What a read-only table cell is told about itself. */\nexport interface TableCellProps<V> {\n value: V;\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** The row this cell belongs to, so a cell can act on its item and not just\n * display it. Typed loosely for the same reason as `FieldsSource.getCellValue`:\n * the row shape belongs to the source, not to Cairo. */\n row: unknown;\n}\n\nexport interface TableCellConfig<V> {\n /** Render the cell. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n CellComponent(props: TableCellProps<V>): ReactElement | null;\n /** Column width. Required — custom types get no built-in layout default. */\n width: string;\n /** Default: 'start'. */\n align?: 'start' | 'center' | 'end';\n}\n\n/** An extra menu item a field type definition adds to a field's actions menu. */\nexport interface FieldTypeActionItem {\n key: string;\n label: string;\n icon?: ReactNode;\n skin?: 'destructive';\n onClick: (field: Field) => void;\n /** Default: visible. */\n visible?: (field: Field) => boolean;\n /** Returning a string disables the item and shows the tooltip. */\n disabledTooltip?: (field: Field) => string | undefined;\n}\n\n/** The actions slot of a field type definition: extra items for the field's \"more actions\" menu. */\nexport interface FieldActionsConfig {\n items?: FieldTypeActionItem[];\n}\n\n/** Display metadata for a field type: menu label and type icons. */\nexport interface FieldTypeDisplay {\n label: string;\n icons: {\n Small: ComponentType;\n Medium: ComponentType;\n };\n}\n\n/** Value semantics of a field type, independent of any rendering surface.\n * Members use method syntax so a definition typed with a concrete value type\n * stays assignable where a loosely typed definition is expected. */\nexport interface FieldValueBehavior<V> {\n defaultValue?: V;\n isEmpty?(value: V): boolean;\n /** Returns an error message, or null when the value is valid. Every surface\n * that validates a field of this type runs this. */\n validate?(value: V, rules?: ValidationRule[]): string | null;\n}\n\nexport interface FieldCapabilities {\n sortable: boolean;\n}\n\n/** The field-modal slot of a field type definition: opts the type into the\n * add/edit-field modal's type picker and describes its entry there. */\nexport interface FieldModalConfig {\n /** True ⇒ the add-field modal offers this type. */\n creatable: boolean;\n /** Placeholder for the name input. Absent ⇒ the modal's generic placeholder. */\n namePlaceholder?: string;\n /** One-line description under the type in the picker. */\n subtitle?: string;\n /** Group heading this type is listed under in the picker. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide setting. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's collapsible settings section — the same contract a\n * source-declared type option carries (see `FieldSettingsSection`). */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown in the main add/edit field form. */\n collectionInput?: FieldModalCollectionInput;\n}\n\n/**\n * Props the entity-page form dispatcher passes to a field type's form\n * component. The dispatcher owns the form wiring (registration, validation\n * from the definition's `value.validate`) and the field UI (label, required\n * marker, error message); the component renders the input: read `value`,\n * report edits through `onChange`, and hand back the focusable control\n * through `inputRef` so a blocked save can reach it.\n */\nexport interface FormFieldComponentProps<V> {\n field: Field;\n value: V;\n // Method syntax keeps FormFieldComponentProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n /** Call when the input loses focus — marks the field touched, so error\n * timing matches the built-in renderers. */\n onBlur: () => void;\n /** Ref to the focusable input element. Used to focus the field when a\n * blocked save reports an error on it. Absent ⇒ the entity page brings the\n * field into view and focuses the first control it finds inside. */\n inputRef?: MutableRefObject<Focusable | undefined | null>;\n dataHook?: string;\n}\n\n/** The entity-page form slot of a field type definition. */\nexport interface FormTypeConfig<V = unknown> {\n /** Renders the input. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n Component(props: FormFieldComponentProps<V>): ReactElement | null;\n}\n\n/**\n * A consumer-defined field type. Defined once on the fields source; every\n * entry point that renders the field resolves its slot from here. `V` is the\n * field's value type — `defineFieldType` infers it, and it keeps all the\n * slots consistent with each other.\n *\n * Sources hold definitions of mixed value types in one\n * `FieldTypeDefinition[]` (= `FieldTypeDefinition<unknown>[]`) array. That\n * works because every member that takes `V` is declared with method syntax,\n * which TypeScript checks bivariantly — so `FieldTypeDefinition<number>` is\n * assignable to `FieldTypeDefinition<unknown>` without casts.\n */\nexport interface FieldTypeDefinition<V = unknown> {\n /** Unique key for the type. A built-in type uses its `PatternsFieldType`; a\n * consumer-defined type uses the string its fields reference via `customType`. */\n type: string;\n display: FieldTypeDisplay;\n /** Filter behavior, or an explicit opt-out — never silently absent. */\n filter: FilterTypeConfig | { filterable: false };\n value?: FieldValueBehavior<V>;\n capabilities?: FieldCapabilities;\n /** Absent ⇒ the field renders with the default cell in the read-only table. */\n table?: TableCellConfig<V>;\n /** Absent ⇒ the field renders as a read-only cell in editable surfaces. */\n editableTable?: EditableCellConfig<V>;\n /** Required once a field of this type renders on an entity page:\n * development throws without it; production skips the field. */\n form?: FormTypeConfig<V>;\n /** Extra items for the field's \"more actions\" menu. */\n actions?: FieldActionsConfig;\n /** Absent ⇒ the add/edit field modal never offers this type. Fields of the\n * type created elsewhere still open in the modal for name/PII edits. */\n fieldModal?: FieldModalConfig;\n}\n\n/** Identity factory: infers `V` and keeps the definition's slots type-checked. */\nexport function defineFieldType<V>(\n definition: FieldTypeDefinition<V>,\n): FieldTypeDefinition<V> {\n return definition;\n}\n\n/** Resolves the definition a CUSTOM field references on its source. */\nexport function resolveFieldTypeDefinition(\n source: Pick<FieldsSource, 'fieldTypes'>,\n field: Field,\n) {\n if (field.type !== 'CUSTOM' || !field.customType) {\n return undefined;\n }\n return source.fieldTypes?.find((def) => def.type === field.customType);\n}\n"],"mappings":";;;;;;AA4EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiDA;AACA;;AAQA;AACA;;AAMA;AACO,SAASA,kBAAkBA,CAChCC,MAAqC,EACT;EAC5B,OAAO,cAAc,IAAIA,MAAM;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAqBA;;AAaA;;AAKA;;AASA;AACA;AACA;;AAaA;AACA;;AAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACO,SAASC,eAAeA,CAC7BC,UAAkC,EACV;EACxB,OAAOA,UAAU;AACnB;;AAEA;AACO,SAASC,0BAA0BA,CACxCC,MAAwC,EACxCC,KAAY,EACZ;EAAA,IAAAC,kBAAA;EACA,IAAID,KAAK,CAACE,IAAI,KAAK,QAAQ,IAAI,CAACF,KAAK,CAACG,UAAU,EAAE;IAChD,OAAOC,SAAS;EAClB;EACA,QAAAH,kBAAA,GAAOF,MAAM,CAACM,UAAU,qBAAjBJ,kBAAA,CAAmBK,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACL,IAAI,KAAKF,KAAK,CAACG,UAAU,CAAC;AACxE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isFilterTypeConfig","filter","defineFieldType","definition","resolveFieldTypeDefinition","source","field","_source$fieldTypes","type","customType","undefined","fieldTypes","find","def"],"sources":["../../../src/types/FieldTypeDefinition.ts"],"sourcesContent":["import type {\n ComponentType,\n MutableRefObject,\n ReactElement,\n ReactNode,\n} from 'react';\nimport type { Field } from './Field';\nimport type { Filter } from '../model/filter';\nimport type {\n FieldModalCollectionInput,\n FieldPiiWarning,\n FieldSettingsSection,\n FieldsSource,\n} from './FieldsSource';\n\nexport type ValidationRule =\n | { type: 'required'; message: string }\n | { type: 'min' | 'max'; value: number; message: string }\n | { type: 'minLength' | 'maxLength'; value: number; message: string }\n | { type: 'pattern'; value: RegExp; message: string }\n | { type: 'custom'; validate: (value: unknown) => boolean; message: string }\n | {\n type: 'specificValues';\n values: { id: string; value: string }[];\n message: string;\n };\n\nexport interface Focusable {\n focus: () => void;\n}\n\nexport type EditTrigger =\n | { kind: 'type'; key: string }\n | 'enter'\n | 'click'\n | 'doubleClick';\n\nexport interface CellViewProps<V> {\n value: V;\n typeConfig?: unknown;\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n /** Whether the cell is editable. Used to conditionally render placeholders (don't show them for read-only cells). */\n isEditable?: boolean;\n}\n\nexport interface CellEditProps<V> {\n value: V;\n // Method syntax keeps CellEditProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n onCommit: () => void;\n onCancel: () => void;\n /**\n * Signals that the cell is starting an editing operation that will move focus\n * outside the table (e.g., opening a media manager or a modal). Calling this\n * sets isEditing=true so the table does not clear cell focus while the\n * external UI is open. Pair with onCommit (after the operation succeeds)\n * or onCancel (if the user dismisses without a value change).\n */\n onStartEdit?: () => void;\n /** Ref to the focusable input element. Used for type-to-edit (focusing the input when user starts typing on a focused cell). */\n inputRef?: MutableRefObject<Focusable | undefined | null>;\n typeConfig?: unknown;\n /** How edit mode was triggered. Edit components can use this to customize behavior (e.g., date picker auto-opens on 'type'). */\n editTrigger?: EditTrigger | null;\n /** Column-level validation rules. Edit components can derive UI behavior (e.g., maxLength blocking/tooltip) from these. */\n validation?: ValidationRule[];\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** Stable key of the row. Cell components can use it to derive unique DOM ids. */\n rowKey: string;\n}\n\n/**\n * Props passed to a cell type's optional `EditWrapper`. The table mounts the\n * wrapper around the cell content and keeps it mounted across the edit↔view\n * transition, so the wrapper can own behavior that must outlive the inline\n * editor (e.g. a reference cell navigating to an overlay and refreshing on\n * return). The wrapper hands anything the editor needs down via its own context.\n */\nexport interface CellEditWrapperProps {\n /** The column's typeConfig (same value handed to the cell's Edit/View). */\n typeConfig?: unknown;\n /** Stable id of the column. */\n columnId: string;\n /** Stable key of the row. */\n rowKey: string;\n /** The cell content (the Edit or View component) to render inside the wrapper. */\n children: ReactNode;\n}\n\nexport type EditableCellContextMenuAction = 'copy' | 'cut' | 'paste' | 'clear';\n\nexport interface EditableCellContextMenuActionContext<V> {\n /** Current cell value, including pending or draft edits. */\n value: V;\n /** Field metadata associated with the column, when available. */\n field?: Field;\n /** Stable key of the row. */\n rowKey: string;\n /** Stable id of the column. */\n columnId: string;\n}\n\nexport interface EditableCellContextMenuActionConfig<V> {\n /** Returning a non-empty string disables the action and shows the tooltip. */\n disabledTooltip(\n context: EditableCellContextMenuActionContext<V>,\n ): string | undefined;\n}\n\n/**\n * The editable-cell slot of a field type definition: how a cell of that type\n * renders, edits, and moves through the clipboard. The definition's key\n * identifies the type and the definition's `value` owns validation, so the\n * slot carries neither.\n *\n * Members that take `V` use method syntax so a definition typed with a\n * concrete value type stays assignable where a loosely typed definition is\n * expected (see `FieldTypeDefinition`).\n */\nexport interface EditableCellConfig<V> {\n /** Render cell in view mode (read-only display). */\n ViewComponent(props: CellViewProps<V>): ReactElement | null;\n /** Render cell in edit mode (inline editor). Optional — omit for view-only cells. */\n EditComponent?(props: CellEditProps<V>): ReactElement | null;\n /** Serialize value to clipboard string. */\n serialize?(value: V): string;\n /** Deserialize clipboard string to value. */\n deserialize?(raw: string): V;\n /** Can this cell type be edited? (default: true) */\n editable?: boolean;\n /** Availability of Cairo's built-in cell context-menu actions. */\n contextMenu?: Partial<\n Record<\n EditableCellContextMenuAction,\n EditableCellContextMenuActionConfig<V>\n >\n >;\n /** Toggle value on single click (e.g., boolean checkbox). Skips focus→edit flow. */\n toggleValue?(value: V): V;\n /** Enter edit mode on single click (e.g., image cell with no value). */\n editOnClick?(value: V): boolean;\n /** Show the EditComponent when the cell is focused, without entering edit mode.\n * Keyboard navigation remains active. Similar to toggleValue but without toggling. */\n showEditWhenFocused?: boolean;\n /** Optional wrapper component the cell type defines to own behavior that must\n * outlive the inline editor. Mounted around the cell content and kept mounted\n * across the edit↔view transition. */\n EditWrapper?: ComponentType<CellEditWrapperProps>;\n /** Cell content can grow past row height when focused. Only applies to\n * showEditWhenFocused cells. */\n growable?: boolean;\n /** Called on type-to-edit. Return object with cleared value and/or prevent flag.\n * Return undefined to block the key. Return {} to enter edit mode without changing the value. */\n onTypeToEdit?(params: {\n key: string;\n validation?: ValidationRule[];\n }): { value?: V } | undefined;\n /** Optional hook to normalize the committed value (e.g. auto-prepend https://).\n * Called before the edit commits; the value is written back before committing. */\n normalizeOnCommit?(value: V): V;\n /** When true, type-to-edit flushes the edit-mode render synchronously and\n * focuses the input within the same keydown event, then lets the browser's\n * default action deliver the keystroke to the now-focused input naturally.\n * Use for cells that wrap a controlled input whose value can't be seeded via props. */\n nativeTypeToEdit?: boolean;\n}\n\n/** The props the filter builder passes to a definition's toolbar filter\n * component — the same contract the built-in filter elements receive. */\nexport interface FilterTypeComponentProps<V = any> {\n filter: Filter<V>;\n toolbarItemProps?: { label?: ReactNode };\n toolbarTagProps?: { label?: string };\n accordionItemProps?: { label?: string };\n}\n\n/** The filter slot of a field type definition: the filter state registered on\n * the collection query and the toolbar element that renders it. */\nexport interface FilterTypeConfig {\n createFilter: (field: Field) => Filter<any>;\n Component: ComponentType<FilterTypeComponentProps>;\n}\n\n/** Narrows a definition's filter slot to an active filter config. */\nexport function isFilterTypeConfig(\n filter: FieldTypeDefinition['filter'],\n): filter is FilterTypeConfig {\n return 'createFilter' in filter;\n}\n\n/**\n * The read-only table slot of a field type definition: how a cell of that\n * type renders in the table, and the column's layout. Independent of\n * `editableTable` — neither slot falls back to the other.\n */\n/** What a read-only table cell is told about itself. */\nexport interface TableCellProps<V> {\n value: V;\n /** Stable id of the column. Cell components can use it to derive unique DOM ids. */\n columnId: string;\n /** The row this cell belongs to, so a cell can act on its item and not just\n * display it. Typed loosely for the same reason as `FieldsSource.getCellValue`:\n * the row shape belongs to the source, not to Cairo. */\n row: unknown;\n}\n\nexport interface TableCellConfig<V> {\n /** Render the cell. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n CellComponent(props: TableCellProps<V>): ReactElement | null;\n /** Column width. Required — custom types get no built-in layout default. */\n width: string;\n /** Default: 'start'. */\n align?: 'start' | 'center' | 'end';\n}\n\n/** An extra menu item a field type definition adds to a field's actions menu. */\nexport interface FieldTypeActionItem {\n key: string;\n label: string;\n icon?: ReactNode;\n skin?: 'destructive';\n onClick: (field: Field) => void;\n /** Default: visible. */\n visible?: (field: Field) => boolean;\n /** Returning a string disables the item and shows the tooltip. */\n disabledTooltip?: (field: Field) => string | undefined;\n}\n\n/** The actions slot of a field type definition: extra items for the field's \"more actions\" menu. */\nexport interface FieldActionsConfig {\n items?: FieldTypeActionItem[];\n}\n\n/** Display metadata for a field type: menu label and type icons. */\nexport interface FieldTypeDisplay {\n label: string;\n icons: {\n Small: ComponentType;\n Medium: ComponentType;\n };\n}\n\n/** Value semantics of a field type, independent of any rendering surface.\n * Members use method syntax so a definition typed with a concrete value type\n * stays assignable where a loosely typed definition is expected. */\nexport interface FieldValueBehavior<V> {\n defaultValue?: V;\n isEmpty?(value: V): boolean;\n /** Returns an error message, or null when the value is valid. Every surface\n * that validates a field of this type runs this. */\n validate?(value: V, rules?: ValidationRule[]): string | null;\n}\n\nexport interface FieldCapabilities {\n sortable: boolean;\n}\n\n/** The field-modal slot of a field type definition: opts the type into the\n * add/edit-field modal's type picker and describes its entry there. */\nexport interface FieldModalConfig {\n /** True ⇒ the add-field modal offers this type. */\n creatable: boolean;\n /** Placeholder for the name input. Absent ⇒ the modal's generic placeholder. */\n namePlaceholder?: string;\n /** Optional valid field ID base. Default: the normalized uppercase type ID.\n * Numeric suffixes are added only on collision. */\n keyBase?: string;\n /** One-line description under the type in the picker. */\n subtitle?: string;\n /** Group heading this type is listed under in the picker. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide setting. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's collapsible settings section — the same contract a\n * source-declared type option carries (see `FieldSettingsSection`). */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown in the main add/edit field form. */\n collectionInput?: FieldModalCollectionInput;\n}\n\n/**\n * Props the entity-page form dispatcher passes to a field type's form\n * component. The dispatcher owns the form wiring (registration, validation\n * from the definition's `value.validate`) and the field UI (label, required\n * marker, error message); the component renders the input: read `value`,\n * report edits through `onChange`, and hand back the focusable control\n * through `inputRef` so a blocked save can reach it.\n */\nexport interface FormFieldComponentProps<V> {\n field: Field;\n value: V;\n // Method syntax keeps FormFieldComponentProps covariant in V (see FieldTypeDefinition).\n onChange(value: V): void;\n /** Call when the input loses focus — marks the field touched, so error\n * timing matches the built-in renderers. */\n onBlur: () => void;\n /** Ref to the focusable input element. Used to focus the field when a\n * blocked save reports an error on it. Absent ⇒ the entity page brings the\n * field into view and focuses the first control it finds inside. */\n inputRef?: MutableRefObject<Focusable | undefined | null>;\n dataHook?: string;\n}\n\n/** The entity-page form slot of a field type definition. */\nexport interface FormTypeConfig<V = unknown> {\n /** Renders the input. Method syntax keeps the definition assignable to\n * `FieldTypeDefinition<unknown>` (see FieldTypeDefinition). */\n Component(props: FormFieldComponentProps<V>): ReactElement | null;\n}\n\n/**\n * A consumer-defined field type. Defined once on the fields source; every\n * entry point that renders the field resolves its slot from here. `V` is the\n * field's value type — `defineFieldType` infers it, and it keeps all the\n * slots consistent with each other.\n *\n * Sources hold definitions of mixed value types in one\n * `FieldTypeDefinition[]` (= `FieldTypeDefinition<unknown>[]`) array. That\n * works because every member that takes `V` is declared with method syntax,\n * which TypeScript checks bivariantly — so `FieldTypeDefinition<number>` is\n * assignable to `FieldTypeDefinition<unknown>` without casts.\n */\nexport interface FieldTypeDefinition<V = unknown> {\n /** Unique key for the type. A built-in type uses its `PatternsFieldType`; a\n * consumer-defined type uses the string its fields reference via `customType`. */\n type: string;\n display: FieldTypeDisplay;\n /** Filter behavior, or an explicit opt-out — never silently absent. */\n filter: FilterTypeConfig | { filterable: false };\n value?: FieldValueBehavior<V>;\n capabilities?: FieldCapabilities;\n /** Absent ⇒ the field renders with the default cell in the read-only table. */\n table?: TableCellConfig<V>;\n /** Absent ⇒ the field renders as a read-only cell in editable surfaces. */\n editableTable?: EditableCellConfig<V>;\n /** Required once a field of this type renders on an entity page:\n * development throws without it; production skips the field. */\n form?: FormTypeConfig<V>;\n /** Extra items for the field's \"more actions\" menu. */\n actions?: FieldActionsConfig;\n /** Absent ⇒ the add/edit field modal never offers this type. Fields of the\n * type created elsewhere still open in the modal for name/PII edits. */\n fieldModal?: FieldModalConfig;\n}\n\n/** Identity factory: infers `V` and keeps the definition's slots type-checked. */\nexport function defineFieldType<V>(\n definition: FieldTypeDefinition<V>,\n): FieldTypeDefinition<V> {\n return definition;\n}\n\n/** Resolves the definition a CUSTOM field references on its source. */\nexport function resolveFieldTypeDefinition(\n source: Pick<FieldsSource, 'fieldTypes'>,\n field: Field,\n) {\n if (field.type !== 'CUSTOM' || !field.customType) {\n return undefined;\n }\n return source.fieldTypes?.find((def) => def.type === field.customType);\n}\n"],"mappings":";;;;;;AA4EA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiDA;AACA;;AAQA;AACA;;AAMA;AACO,SAASA,kBAAkBA,CAChCC,MAAqC,EACT;EAC5B,OAAO,cAAc,IAAIA,MAAM;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAqBA;;AAaA;;AAKA;;AASA;AACA;AACA;;AAaA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACO,SAASC,eAAeA,CAC7BC,UAAkC,EACV;EACxB,OAAOA,UAAU;AACnB;;AAEA;AACO,SAASC,0BAA0BA,CACxCC,MAAwC,EACxCC,KAAY,EACZ;EAAA,IAAAC,kBAAA;EACA,IAAID,KAAK,CAACE,IAAI,KAAK,QAAQ,IAAI,CAACF,KAAK,CAACG,UAAU,EAAE;IAChD,OAAOC,SAAS;EAClB;EACA,QAAAH,kBAAA,GAAOF,MAAM,CAACM,UAAU,qBAAjBJ,kBAAA,CAAmBK,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACL,IAAI,KAAKF,KAAK,CAACG,UAAU,CAAC;AACxE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/FieldsSource.ts"],"sourcesContent":["import type { ComponentType } from 'react';\nimport type { Field, PatternsFieldType } from './Field';\nimport type { FieldActions, FieldSettings, Schema } from './Schema';\nimport type {\n FieldTypeDefinition,\n FieldTypeDisplay,\n} from './FieldTypeDefinition';\nimport type { CustomFieldOrigin } from '../services';\n\n/** Presentation for one existing field, without changing its type or behavior. */\nexport interface FieldPresentation {\n typeDisplay?: Partial<FieldTypeDisplay>;\n collectionInputLabel?: string;\n}\n\n/** A field the source has archived. Sources without archiving omit `archive`. */\nexport interface ArchivedFieldItem {\n id: string;\n label: string;\n isPii?: boolean;\n}\n\n/** A `FieldTypeOption` the modal can render: the id and label a source left to\n * the defaults are filled in. */\nexport interface ResolvedFieldTypeOption {\n /** Stored on the draft; the source maps it back to its native type. */\n id: string;\n label: string;\n namePlaceholder?: string;\n subtitle?: string;\n /** Group heading in the type list; types sharing a heading form one group. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide `supportsPii`. */\n supportsPii?: boolean;\n /** Warning to show while the PII toggle is on. Called on every render.\n * Absent ⇒ none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section below the main fields.\n * Absent ⇒ the section holds only what the modal itself puts there. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown below the type picker. For built-in reference\n * types, absent copy can use the source's referenceable collection loader. */\n collectionInput?: FieldModalCollectionInput;\n /** Drives the type icon in the modal. */\n patternsType: PatternsFieldType;\n /** Type icons for the picker. Absent ⇒ the icon derives from `patternsType`. */\n icons?: { Small: ComponentType; Medium: ComponentType };\n}\n\n/** Read/write permission defaults a source supports, per audience. */\nexport interface FieldPermissions {\n installedApps?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n siteVisitors?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n}\n\n/** The values the add/edit field modal collects, source-neutral. */\nexport interface FieldDraft {\n type?: string;\n key: string;\n name: string;\n readApps: boolean;\n readUsers: boolean;\n writeApps: boolean;\n writeUsers: boolean;\n containsPii: boolean;\n /** Collection selected by the modal's collection picker, when a type has one. */\n referencedCollectionId?: string;\n /** The field this draft was built from, for the source's settings section to\n * read its own values off. Absent for a new field. */\n field?: Field;\n /** What the source's settings section collected, on its way to that source's\n * `addField`/`editField`. */\n settings?: FieldSettings;\n}\n\n/** The add-modal subtitle: a line of text, an optional second note line, and an\n * optional \"learn more\" link. */\nexport interface FieldModalSubtitle {\n text: string;\n note?: string;\n learnMore?: { label: string; href: string };\n}\n\n/** The text a source supplies for the add/edit field modal. */\nexport interface FieldModalText {\n addTitle: string;\n editTitle: string;\n /** Subtitle for the add modal; omit for none. */\n addSubtitle?: FieldModalSubtitle;\n /** Label of the collapsible section below the main fields. */\n settingsLabel?: string;\n}\n\n/** A warning shown under the PII toggle, with an optional action button. */\nexport interface FieldPiiWarning {\n text: string;\n action?: { label: string; onClick: () => void };\n}\n\nexport interface FieldModalCollectionOption {\n id: string;\n label: string;\n}\n\nexport type FieldModalCollectionOptionsLoader = () => Promise<\n FieldModalCollectionOption[]\n>;\n\nexport interface FieldModalCollectionAction {\n label: string;\n icon?: ComponentType;\n disabled?: boolean;\n /** Return an option to select, or undefined on cancellation. The option may\n * be pending creation; persistence remains the source's responsibility. */\n onClick: () => Promise<FieldModalCollectionOption | undefined>;\n}\n\n/** Extra collection picker a field type can add to the main modal body. */\nexport interface FieldModalCollectionInput {\n label?: string;\n placeholder?: string;\n emptyStateMessage?: string;\n errorMessage?: string;\n required?: boolean;\n loadOptions?: FieldModalCollectionOptionsLoader;\n /** An action below the options, also shown when no options match. */\n dropdownAction?: FieldModalCollectionAction;\n /** Restores the picker value from an existing field. */\n getValue?: (field: Field) => string | undefined;\n /** Adds picker-derived values to the source-owned settings payload. */\n getSettings?: (collectionId: string) => FieldSettings;\n}\n\nexport interface FieldSettingsProps {\n /** The picked field type, or absent before one is picked. */\n fieldType?: string;\n /** Validation rules the section should render as fixed, not user-editable.\n * A section ignores any entry it doesn't recognize. */\n lockedRules?: readonly string[];\n}\n\n/**\n * The collapsible section below the main add/edit field inputs, supplied by the\n * source. The modal renders it, blocks confirm while it has an error, and hands\n * its values to the source's own `addField`/`editField` — it never looks inside.\n */\nexport interface FieldSettingsSection {\n Component: ComponentType<FieldSettingsProps>;\n /** True keeps the modal open on confirm. The section shows the error itself. */\n hasError(fieldType?: string): boolean;\n /** Passed to `FieldActions.addField`/`editField` as-is. */\n getValues(fieldType?: string): FieldSettings;\n /**\n * Fills the inputs when the modal opens: the field being edited, or nothing\n * for a new field. Pushed in rather than read from a prop, so the values are\n * there whether or not the section has been rendered yet.\n */\n setValues(field?: Field): void;\n /**\n * Prefills a new field's rules from the caller's requested initial values —\n * there is no backing `Field` yet, so this is separate from `setValues`.\n * Absent ⇒ the section doesn't support prefilling any rule this way, and\n * the modal drops that rule from `lockedProperties` rather than locking a\n * control at a value it could never actually apply.\n */\n setInitialValues?(initial: { required?: boolean }): void;\n}\n\n/** Add/edit/delete capability a source exposes. Present ⇒ field management UI shows. */\nexport interface FieldManagement {\n /** False ⇒ the add-field CTA is hidden entirely. */\n canAddFields: boolean;\n /** True ⇒ the add-field CTA renders but is disabled. */\n addFieldDisabled: boolean;\n /** Hint text shown beneath the add-field CTA while it is disabled. */\n addFieldDisabledHint?: string;\n canEditField(field: Field): boolean;\n /** `origin` is the UI surface the delete was triggered from; used for BI. */\n deleteField(fieldId: string, origin: string): Promise<void>;\n\n /** Everything the add/edit field modal shows: its titles, and the field types\n * it offers with what each one brings to it. */\n fieldModal: {\n text: FieldModalText;\n /** Default option loader for built-in reference and multi-reference types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: ResolvedFieldTypeOption[];\n /** Defaults for the read/write permissions per audience. Absent ⇒ the modal\n * shows no permissions section. */\n permissions?: FieldPermissions;\n /** Whether a field can be marked PII. A field type option overrides it with\n * its own `supportsPii`. */\n supportsPii?: boolean;\n };\n /** Existing field keys, used by the add modal to reject duplicates. */\n existingFieldKeys: string[];\n /** True when no more fields can be added because a limit is reached. */\n maxReached?: boolean;\n /** Returns the created field's id when the source can identify it, so the\n * modal can report it back to the caller. Absent ⇒ the caller isn't told\n * which field was created. */\n addField(draft: FieldDraft): Promise<string | void>;\n editField(fieldId: string, draft: FieldDraft): Promise<void>;\n /** Current values for an existing field, to prefill the edit modal. */\n getFieldDraft(fieldId: string): FieldDraft | undefined;\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n}\n\n/** A new-field property `OpenFieldModalOptions` can lock from editing. */\nexport type LockableFieldProperty = 'type' | 'name' | 'required';\n\n/** Options for opening the add/edit field modal. */\nexport interface OpenFieldModalOptions {\n fieldId?: string;\n origin?: CustomFieldOrigin;\n customOrigin?: string;\n /** Fired with the field's id after it's successfully created or edited.\n * Not called for a create when the source can't report which field it\n * created. */\n onSave?: (fieldId: string) => void;\n /** Prefills a new field. Ignored when `fieldId` is set — edit mode prefills\n * from the existing field instead. */\n initialField?: {\n /** Prefilled; locked when included in `lockedProperties`. */\n type?: string;\n /** Prefilled; locked when included in `lockedProperties`. */\n name?: string;\n /** Prefilled; locked when included in `lockedProperties`. Support depends\n * on the picked type's settings section — see `FieldSettingsSection.setInitialValues`. */\n required?: boolean;\n };\n /** Properties the user can't change, on top of being prefilled. A property\n * with no matching `initialField` value is never locked — there is nothing\n * to lock it to. */\n lockedProperties?: readonly LockableFieldProperty[];\n}\n\n/** Archiving capability a source exposes. Present ⇒ archive/restore UI shows. */\nexport interface FieldArchive {\n items: ArchivedFieldItem[];\n shouldDisplay: boolean;\n /** Whether the archived-items panel is currently open. */\n isOpen: boolean;\n openPanel(): void;\n closePanel(): void;\n /** `origin` is the UI surface the action was triggered from; used for BI. */\n archiveField(fieldId: string, origin: string): Promise<void>;\n restoreField(fieldId: string, origin: string): Promise<void>;\n /** Display name for a field, for the confirm-dialog copy. */\n fieldName(fieldId: string): string;\n}\n\n/**\n * The source-neutral fields data a collection reads, implemented by each source\n * adapter. Rendering — field modals, filter elements — is not here; it lives in\n * the collection-page layer.\n */\nexport interface FieldsSource {\n /** Loads the fields (schema/data). The collection runs this once, tracks its\n * status, and shows a retry toast on failure. */\n load(): Promise<void>;\n\n fields: Field[];\n filterableFields: Field[];\n /** The fields the manage-fields panel lists — the source's editable fields. */\n manageableFields: Field[];\n /** Column id for a field. Sources that group fields prefix the group; flat sources use the field key. */\n columnIdForField(field: Field): string;\n /** WQL field path for a filter. Sources that group fields prefix the group; flat sources use the field key. */\n queryFieldId(field: Field): string;\n /** The value to display for a field on a row. */\n getCellValue(row: unknown, field: Field): unknown;\n /** Writes a new value for a field on a row, returning the updated row. Present when cells can be edited in place. */\n setCellValue?(row: unknown, field: Field, value: unknown): unknown;\n\n /** Replaces the source's fields with a freshly-returned map, updating the\n * columns with no refetch. Present when the source holds its fields in a\n * mergeable state (e.g. a loaded schema); used after an import creates fields. */\n mergeFields?(fields: Schema['fields']): void;\n\n /** Field-type definitions the source supports: how a field of that type\n * renders, filters and validates. Built-in types are keyed by their\n * `PatternsFieldType`; consumer-defined types are keyed by the string a field\n * references via `customType`. The add/edit field modal never reads this —\n * see `FieldManagement.fieldModal`. */\n fieldTypes?: FieldTypeDefinition[];\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n\n /** Present when fields can be added/edited/deleted. */\n fieldManagement?: FieldManagement;\n\n /** The collection's field-mutation actions (delete/makePrimary/duplicate/…),\n * driving the shared FieldActions menu. Absent ⇒ no per-field action menu. */\n fieldActions?: FieldActions;\n\n /** Present when the source supports archiving fields. */\n archive?: FieldArchive;\n\n /** Present when fields are grouped. Absent ⇒ flat list. */\n groups?: {\n all: string[];\n fieldsForGroup(group: string): Field[];\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/FieldsSource.ts"],"sourcesContent":["import type { ComponentType } from 'react';\nimport type { Field, PatternsFieldType } from './Field';\nimport type { FieldActions, FieldSettings, Schema } from './Schema';\nimport type {\n FieldTypeDefinition,\n FieldTypeDisplay,\n} from './FieldTypeDefinition';\nimport type { CustomFieldOrigin } from '../services';\n\n/** Presentation for one existing field, without changing its type or behavior. */\nexport interface FieldPresentation {\n typeDisplay?: Partial<FieldTypeDisplay>;\n collectionInputLabel?: string;\n}\n\n/** A field the source has archived. Sources without archiving omit `archive`. */\nexport interface ArchivedFieldItem {\n id: string;\n label: string;\n isPii?: boolean;\n}\n\n/** A `FieldTypeOption` the modal can render: the id and label a source left to\n * the defaults are filled in. */\nexport interface ResolvedFieldTypeOption {\n /** Stored on the draft; the source maps it back to its native type. */\n id: string;\n label: string;\n namePlaceholder?: string;\n /** Optional valid field ID base. Default: the normalized uppercase type ID.\n * Numeric suffixes are added only on collision. */\n keyBase?: string;\n subtitle?: string;\n /** Group heading in the type list; types sharing a heading form one group. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide `supportsPii`. */\n supportsPii?: boolean;\n /** Warning to show while the PII toggle is on. Called on every render.\n * Absent ⇒ none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section below the main fields.\n * Absent ⇒ the section holds only what the modal itself puts there. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown below the type picker. For built-in reference\n * types, absent copy can use the source's referenceable collection loader. */\n collectionInput?: FieldModalCollectionInput;\n /** Drives the type icon in the modal. */\n patternsType: PatternsFieldType;\n /** Type icons for the picker. Absent ⇒ the icon derives from `patternsType`. */\n icons?: { Small: ComponentType; Medium: ComponentType };\n}\n\n/** Read/write permission defaults a source supports, per audience. */\nexport interface FieldPermissions {\n installedApps?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n siteVisitors?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n}\n\n/** The values the add/edit field modal collects, source-neutral. */\nexport interface FieldDraft {\n type?: string;\n key: string;\n name: string;\n readApps: boolean;\n readUsers: boolean;\n writeApps: boolean;\n writeUsers: boolean;\n containsPii: boolean;\n /** Collection selected by the modal's collection picker, when a type has one. */\n referencedCollectionId?: string;\n /** The field this draft was built from, for the source's settings section to\n * read its own values off. Absent for a new field. */\n field?: Field;\n /** What the source's settings section collected, on its way to that source's\n * `addField`/`editField`. */\n settings?: FieldSettings;\n}\n\n/** The add-modal subtitle: a line of text, an optional second note line, and an\n * optional \"learn more\" link. */\nexport interface FieldModalSubtitle {\n text: string;\n note?: string;\n learnMore?: { label: string; href: string };\n}\n\n/** The text a source supplies for the add/edit field modal. */\nexport interface FieldModalText {\n addTitle: string;\n editTitle: string;\n /** Subtitle for the add modal; omit for none. */\n addSubtitle?: FieldModalSubtitle;\n /** Label of the collapsible section below the main fields. */\n settingsLabel?: string;\n /** Label of the field ID input. Absent ⇒ the standard key label. */\n keyLabel?: string;\n}\n\n/** A warning shown under the PII toggle, with an optional action button. */\nexport interface FieldPiiWarning {\n text: string;\n action?: { label: string; onClick: () => void };\n}\n\nexport interface FieldModalCollectionOption {\n id: string;\n label: string;\n}\n\nexport type FieldModalCollectionOptionsLoader = () => Promise<\n FieldModalCollectionOption[]\n>;\n\nexport interface FieldModalCollectionAction {\n label: string;\n icon?: ComponentType;\n disabled?: boolean;\n /** Return an option to select, or undefined on cancellation. The option may\n * be pending creation; persistence remains the source's responsibility. */\n onClick: () => Promise<FieldModalCollectionOption | undefined>;\n}\n\n/** Extra collection picker a field type can add to the main modal body. */\nexport interface FieldModalCollectionInput {\n label?: string;\n placeholder?: string;\n emptyStateMessage?: string;\n errorMessage?: string;\n required?: boolean;\n loadOptions?: FieldModalCollectionOptionsLoader;\n /** An action below the options, also shown when no options match. */\n dropdownAction?: FieldModalCollectionAction;\n /** Restores the picker value from an existing field. */\n getValue?: (field: Field) => string | undefined;\n /** Adds picker-derived values to the source-owned settings payload. */\n getSettings?: (collectionId: string) => FieldSettings;\n}\n\nexport interface FieldSettingsProps {\n /** The picked field type, or absent before one is picked. */\n fieldType?: string;\n /** Validation rules the section should render as fixed, not user-editable.\n * A section ignores any entry it doesn't recognize. */\n lockedRules?: readonly string[];\n}\n\n/**\n * The collapsible section below the main add/edit field inputs, supplied by the\n * source. The modal renders it, blocks confirm while it has an error, and hands\n * its values to the source's own `addField`/`editField` — it never looks inside.\n */\nexport interface FieldSettingsSection {\n Component: ComponentType<FieldSettingsProps>;\n /** True keeps the modal open on confirm. The section shows the error itself. */\n hasError(fieldType?: string): boolean;\n /** Passed to `FieldActions.addField`/`editField` as-is. */\n getValues(fieldType?: string): FieldSettings;\n /**\n * Fills the inputs when the modal opens: the field being edited, or nothing\n * for a new field. Pushed in rather than read from a prop, so the values are\n * there whether or not the section has been rendered yet.\n */\n setValues(field?: Field): void;\n /**\n * Prefills a new field's rules from the caller's requested initial values —\n * there is no backing `Field` yet, so this is separate from `setValues`.\n * Absent ⇒ the section doesn't support prefilling any rule this way, and\n * the modal drops that rule from `lockedProperties` rather than locking a\n * control at a value it could never actually apply.\n */\n setInitialValues?(initial: { required?: boolean }): void;\n}\n\n/** Add/edit/delete capability a source exposes. Present ⇒ field management UI shows. */\nexport interface FieldManagement {\n /** False ⇒ the add-field CTA is hidden entirely. */\n canAddFields: boolean;\n /** True ⇒ the add-field CTA renders but is disabled. */\n addFieldDisabled: boolean;\n /** Hint text shown beneath the add-field CTA while it is disabled. */\n addFieldDisabledHint?: string;\n canEditField(field: Field): boolean;\n /** `origin` is the UI surface the delete was triggered from; used for BI. */\n deleteField(fieldId: string, origin: string): Promise<void>;\n\n /** Everything the add/edit field modal shows: its titles, and the field types\n * it offers with what each one brings to it. */\n fieldModal: {\n text: FieldModalText;\n /** Default option loader for built-in reference and multi-reference types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: ResolvedFieldTypeOption[];\n /** Defaults for the read/write permissions per audience. Absent ⇒ the modal\n * shows no permissions section. */\n permissions?: FieldPermissions;\n /** Whether a field can be marked PII. A field type option overrides it with\n * its own `supportsPii`. */\n supportsPii?: boolean;\n };\n /** Existing field keys, used by the add modal to reject duplicates. */\n existingFieldKeys: string[];\n /** True when no more fields can be added because a limit is reached. */\n maxReached?: boolean;\n /** Returns the created field's id when the source can identify it, so the\n * modal can report it back to the caller. Absent ⇒ the caller isn't told\n * which field was created. */\n addField(draft: FieldDraft): Promise<string | void>;\n editField(fieldId: string, draft: FieldDraft): Promise<void>;\n /** Current values for an existing field, to prefill the edit modal. */\n getFieldDraft(fieldId: string): FieldDraft | undefined;\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n}\n\n/** A new-field property `OpenFieldModalOptions` can lock from editing. */\nexport type LockableFieldProperty = 'type' | 'name' | 'required';\n\n/** Options for opening the add/edit field modal. */\nexport interface OpenFieldModalOptions {\n fieldId?: string;\n origin?: CustomFieldOrigin;\n customOrigin?: string;\n /** Fired with the field's id after it's successfully created or edited.\n * Not called for a create when the source can't report which field it\n * created. */\n onSave?: (fieldId: string) => void;\n /** Prefills a new field. Ignored when `fieldId` is set — edit mode prefills\n * from the existing field instead. */\n initialField?: {\n /** Prefilled; locked when included in `lockedProperties`. */\n type?: string;\n /** Prefilled; locked when included in `lockedProperties`. */\n name?: string;\n /** Prefilled; locked when included in `lockedProperties`. Support depends\n * on the picked type's settings section — see `FieldSettingsSection.setInitialValues`. */\n required?: boolean;\n };\n /** Properties the user can't change, on top of being prefilled. A property\n * with no matching `initialField` value is never locked — there is nothing\n * to lock it to. */\n lockedProperties?: readonly LockableFieldProperty[];\n}\n\n/** Archiving capability a source exposes. Present ⇒ archive/restore UI shows. */\nexport interface FieldArchive {\n items: ArchivedFieldItem[];\n shouldDisplay: boolean;\n /** Whether the archived-items panel is currently open. */\n isOpen: boolean;\n openPanel(): void;\n closePanel(): void;\n /** `origin` is the UI surface the action was triggered from; used for BI. */\n archiveField(fieldId: string, origin: string): Promise<void>;\n restoreField(fieldId: string, origin: string): Promise<void>;\n /** Display name for a field, for the confirm-dialog copy. */\n fieldName(fieldId: string): string;\n}\n\n/**\n * The source-neutral fields data a collection reads, implemented by each source\n * adapter. Rendering — field modals, filter elements — is not here; it lives in\n * the collection-page layer.\n */\nexport interface FieldsSource {\n /** Loads the fields (schema/data). The collection runs this once, tracks its\n * status, and shows a retry toast on failure. */\n load(): Promise<void>;\n\n fields: Field[];\n filterableFields: Field[];\n /** The fields the manage-fields panel lists — the source's editable fields. */\n manageableFields: Field[];\n /** Column id for a field. Sources that group fields prefix the group; flat sources use the field key. */\n columnIdForField(field: Field): string;\n /** WQL field path for a filter. Sources that group fields prefix the group; flat sources use the field key. */\n queryFieldId(field: Field): string;\n /** The value to display for a field on a row. */\n getCellValue(row: unknown, field: Field): unknown;\n /** Writes a new value for a field on a row, returning the updated row. Present when cells can be edited in place. */\n setCellValue?(row: unknown, field: Field, value: unknown): unknown;\n\n /** Replaces the source's fields with a freshly-returned map, updating the\n * columns with no refetch. Present when the source holds its fields in a\n * mergeable state (e.g. a loaded schema); used after an import creates fields. */\n mergeFields?(fields: Schema['fields']): void;\n\n /** Field-type definitions the source supports: how a field of that type\n * renders, filters and validates. Built-in types are keyed by their\n * `PatternsFieldType`; consumer-defined types are keyed by the string a field\n * references via `customType`. The add/edit field modal never reads this —\n * see `FieldManagement.fieldModal`. */\n fieldTypes?: FieldTypeDefinition[];\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n\n /** Present when fields can be added/edited/deleted. */\n fieldManagement?: FieldManagement;\n\n /** The collection's field-mutation actions (delete/makePrimary/duplicate/…),\n * driving the shared FieldActions menu. Absent ⇒ no per-field action menu. */\n fieldActions?: FieldActions;\n\n /** Present when the source supports archiving fields. */\n archive?: FieldArchive;\n\n /** Present when fields are grouped. Absent ⇒ flat list. */\n groups?: {\n all: string[];\n fieldsForGroup(group: string): Field[];\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/Schema.ts"],"sourcesContent":["import type { Field } from './Field';\nimport type { FiltersMap, OptionalFiltersMap } from '../model';\nimport type {\n OffsetQuery,\n OffsetQueryResult,\n CursorQuery,\n CursorQueryResult,\n FetchTotalFn,\n} from '../hooks/paginationModeConfig';\n\n/** Field-management permissions. Absent when the schema's fields cannot be edited. */\nexport interface SchemaPermissions {\n createField: boolean;\n updateField: boolean;\n deleteField: boolean;\n}\n\
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/Schema.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Field } from './Field';\nimport type { FiltersMap, OptionalFiltersMap } from '../model';\nimport type {\n OffsetQuery,\n OffsetQueryResult,\n CursorQuery,\n CursorQueryResult,\n FetchTotalFn,\n} from '../hooks/paginationModeConfig';\n\n/** Field-management permissions. Absent when the schema's fields cannot be edited. */\nexport interface SchemaPermissions {\n createField: boolean;\n updateField: boolean;\n deleteField: boolean;\n}\n\nexport interface ItemDisabledResult<R = string> {\n disabled: boolean;\n // Why the action is disabled, surfaced to the user by consumers.\n reason?: R;\n}\n\n/** The per-item delete verdict. */\nexport type RemoveItemDisabledResult = ItemDisabledResult;\n\nexport type CreateItemDisabledResult = ItemDisabledResult<ReactNode>;\n\n/** Item-level CRUD permissions. */\nexport interface ItemPermissions<T = Record<string, unknown>> {\n createItem: boolean;\n updateItem: boolean;\n deleteItem: boolean;\n /** Deleting several items in one operation. Absent = follows `deleteItem`. */\n bulkDeleteItems?: boolean;\n /** Per-item refinement of `deleteItem`: disables deleting an item even\n * though `deleteItem` is true, optionally with a reason. Must be pure and\n * synchronous. Absent = all items deletable. */\n isRemoveItemDisabled?: (item: T) => RemoveItemDisabledResult;\n // Refines `createItem` at call time; observables it reads are tracked.\n isCreateItemDisabled?: () => CreateItemDisabledResult;\n}\n\n/**\n * A source-neutral description of a collection — data only, no behavior.\n * Item access is in `CollectionBackend`, field mutations in `FieldActions`.\n */\nexport interface Schema {\n id: string;\n fields: Record<string, Field | undefined>;\n /** Human-readable label, when the source has one. Reported to BI. */\n name?: string;\n /** The kind of data set, when the source distinguishes kinds. Reported to BI. */\n type?: string;\n /** The field that best represents the entity (titles/selections). */\n displayField: string;\n /** The identifier field. */\n idField: string;\n /** Group display order, present when fields carry a `group`. */\n groups?: string[];\n /** Absent when the schema's fields cannot be edited. */\n schemaPermissions?: SchemaPermissions;\n itemPermissions?: ItemPermissions;\n}\n\nexport interface BackupConfig {\n create: () => Promise<{ backupId: string }>;\n waitForCompletion: (\n backupId: string,\n options?: { signal?: AbortSignal },\n ) => Promise<void>;\n cancel?: (backupId: string) => Promise<void>;\n restore?: (backupId: string) => Promise<{ restorationId: string }>;\n waitForRestoration?: (\n restorationId: string,\n options?: { signal?: AbortSignal },\n ) => Promise<void>;\n}\n\nexport interface BulkInsertError {\n rowIndex: number;\n message?: string;\n code?: string;\n}\n\nexport interface BulkInsertResult {\n succeeded?: number;\n failed?: number;\n errors?: BulkInsertError[];\n}\n\n/**\n * Metadata for an item update. `changedFieldIds` narrows follow-up comparison\n * work to fields the UI already knows were edited, which avoids diffing every\n * value when some fields are large or expensive to compare.\n */\nexport interface CollectionUpdateContext<T = Record<string, unknown>> {\n previousItem: T;\n changedFieldIds: string[];\n}\n\n/** Item data access shared by both pagination modes. `find` (on\n * `CollectionBackend`) is the only required call — the rest are capabilities\n * a source provides when it (or its consumer) supports them. */\nexport interface CollectionBackendBase<T = Record<string, unknown>> {\n get?: (entityId: string) => Promise<T>;\n create?: (entity: Partial<T>) => Promise<T>;\n update?: (entity: T, context?: CollectionUpdateContext<T>) => Promise<T>;\n delete?: (entityId: string) => Promise<void>;\n bulkDelete?: (entityIds: string[]) => Promise<void>;\n move?: (\n id: string,\n params: { moveAfterId: string | null | undefined },\n ) => Promise<void>;\n backup?: BackupConfig;\n bulkInsert?: (entities: Partial<T>[]) => Promise<BulkInsertResult>;\n}\n\n/** Per-call search scope the query layer passes to a backend's `find`. */\nexport interface FindOptions {\n searchableFieldIds?: string[];\n}\n\n/**\n * The query-layer fetch-data fns plus the optional `find` options the runtime\n * already accepts. Kept separate so the shared `OffsetFetchDataFn`/\n * `CursorFetchDataFn` used by `fetchData` stay unchanged.\n */\ntype OffsetFindFn<T, F extends FiltersMap> = (\n query: OffsetQuery<F>,\n options?: FindOptions,\n) => Promise<OffsetQueryResult<T>>;\ntype CursorFindFn<T, F extends FiltersMap> = (\n query: CursorQuery<F>,\n options?: FindOptions,\n) => Promise<CursorQueryResult<T>>;\n\n/**\n * A source's item data access. The source declares its `paginationMode`\n * (offset by default) together with the matching `find`, same as core's\n * `PaginationModeConfig`.\n */\nexport type CollectionBackend<\n T = Record<string, unknown>,\n F extends FiltersMap = OptionalFiltersMap,\n> = CollectionBackendBase<T> &\n (\n | { paginationMode?: 'offset'; find: OffsetFindFn<T, F> }\n | {\n paginationMode: 'cursor';\n find: CursorFindFn<T, F>;\n fetchTotal?: FetchTotalFn;\n }\n );\n\n/**\n * Whatever the source's settings section collected in the add/edit field modal.\n * The modal and the collection layer only carry it; the source that produced it\n * is the only one that looks inside, so it declares its own shape on `addField`\n * and `editField` (both are methods, so a narrower parameter type is allowed).\n */\nexport type FieldSettings = unknown;\n\n/** Field-management actions. All optional — a read-only source provides none. */\nexport interface FieldActions {\n /**\n * Field-mutating actions return the collection's updated fields map so the\n * caller can merge its local state from the response, without reloading the\n * schema. (`renameField` is the exception — nothing consumes its result yet.)\n */\n addField?(field: Field, settings?: FieldSettings): Promise<Schema['fields']>;\n /**\n * Adds several fields in a single mutation, each under its `field.id` key\n * (callers decide the keys up front — e.g. CSV import uploads values under\n * them), unlike `addField`, which derives a fresh key from the display name.\n */\n addFields?: (fields: Field[]) => Promise<Schema['fields']>;\n editField?(\n fieldId: string,\n updates: Partial<Field>,\n settings?: FieldSettings,\n ): Promise<Schema['fields']>;\n deleteField?: (fieldId: string) => Promise<Schema['fields']>;\n renameField?: (fieldId: string, newName: string) => Promise<void>;\n makePrimary?: (fieldId: string) => Promise<Schema['fields']>;\n duplicateField?: (fieldId: string) => Promise<Schema['fields']>;\n duplicateFieldWithContent?: (fieldId: string) => Promise<Schema['fields']>;\n}\n\n/** Everything a source provides for a collection. */\nexport interface LoadedSchema<T = Record<string, unknown>> {\n schema: Schema;\n backend: CollectionBackend<T>;\n fieldActions?: FieldActions;\n}\n\n/**\n * Loads a collection's `LoadedSchema`. Sources that need dependencies expose a\n * factory that returns this type.\n */\nexport type SchemaLoader<\n T extends Record<string, unknown> = Record<string, unknown>,\n> = (collectionId: string) => Promise<LoadedSchema<T>>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sourceFetchData","source","query","backend","schema","loadSchema","visibleColumns","columns","find","searchableFieldIds","length","defineSchemaSource","input","collectionId","paginationMode","fieldModal","fieldTypes","fieldPermissions","supportsPii","references","getReferencedCollectionSource","loaded","resolved","then","result","catch","error","undefined","setLoadedSchema","Promise","resolve","s","displayField","itemKey","item","_resolved","String","idField","itemName","_resolved2","canAddFields","_s$schemaPermissions","schemaPermissions","createField","isLockedField","field","isSystem","id","canEditField","_s$schemaPermissions2","updateField","canDeleteField","_s$schemaPermissions3","deleteField","getFieldValue","setFieldValue","value","schemaParams","_resolved3","_resolved4","_resolved5","tableId","tableName","name","tableType","type","text","loadReferenceableCollectionOptions","types","getFieldPresentation","getDeleteFieldConfirmation"],"sources":["../../../src/types/SchemaSource.ts"],"sourcesContent":["import type { Field, PatternsFieldType } from './Field';\nimport type { FieldTypeDefinition } from './FieldTypeDefinition';\nimport type { Schema, LoadedSchema, FindOptions } from './Schema';\nimport type {\n FieldPresentation,\n FieldModalText,\n FieldModalCollectionInput,\n FieldModalCollectionOptionsLoader,\n FieldPermissions,\n FieldPiiWarning,\n FieldSettingsSection,\n} from './FieldsSource';\nimport type {\n OffsetQuery,\n OffsetQueryResult,\n} from '../hooks/paginationModeConfig';\n\n/** A field type the add/edit field modal offers, with everything that type\n * brings to it. Declare one entry per `patternsType` — the type is the entry's\n * identity. Nothing here reaches the table or the filters; that is `fieldTypes`\n * (`FieldTypeDefinition[]`). */\nexport interface FieldTypeOption {\n patternsType: PatternsFieldType;\n /** Custom display name. Absent ⇒ the UI's standard name for this type. */\n label?: string;\n /** Custom name-input placeholder. Absent ⇒ the UI's standard placeholder. */\n namePlaceholder?: string;\n /** A one-line description shown under the type in the add-field menu. */\n subtitle?: string;\n /** The group heading this type is listed under in the add-field menu, in\n * first-seen order. Types sharing a heading form one group. Absent ⇒\n * ungrouped. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source's `supportsPii`. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section in the add/edit field\n * modal. Default: none. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown in the main add/edit field form. */\n collectionInput?: FieldModalCollectionInput;\n}\n\n/** Everything the add/edit field modal shows for this source. */\nexport interface FieldModalInput {\n /** Title and subtitle. Default: generic titles. */\n text?: FieldModalText;\n /** Default option loader for reference-like built-in field types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n /** The types the modal offers, in display order. Default: none. */\n types?: FieldTypeOption[];\n}\n\n/** Copy shown before deleting a field. Strings are translated by the caller. */\nexport interface DeleteFieldConfirmation {\n title: string;\n description: string;\n /** When provided, confirmation requires this checkbox to be checked. */\n confirmationCheckboxLabel?: string;\n}\n\n/** Identifies the collection behind a table on BI events. */\nexport interface SchemaBiParams {\n tableId?: string;\n tableName?: string;\n tableType?: string;\n}\n\n/** What a caller passes. Only `collectionId` and `loadSchema` are required. */\nexport interface SchemaSourceInput<T> {\n collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n /** Sources for collections this one references, keyed by the referenced\n * collection id. A renderer resolves a reference field through the matching\n * entry — its `loadSchema` gives the referenced schema and `sourceFetchData`\n * queries the referenced items. Default: none. */\n references?: Record<string, SchemaSource<any>>;\n /** Lazy source lookup for a referenced collection that is not in `references`.\n * Is used when a reference field is created in the add field modal.\n * The returned source owns its own async schema/item loading. */\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n paginationMode?: 'offset';\n /** Stable row identity. Default: `row[idField]`. */\n itemKey?: (item: T) => string;\n /** Row display label. Default: `row[displayField]`. */\n itemName?: (item: T) => string;\n /** Fields free-text search runs against. Default: `[displayField]`. */\n searchableFieldIds?: (schema: Schema) => string[];\n /** What the add/edit field modal shows. Default: no types, generic titles. */\n fieldModal?: FieldModalInput;\n /** Consumer-defined field types: how a field of that type renders, filters and\n * validates wherever it appears. A field with `type: 'CUSTOM'` resolves its\n * definition here by `customType`. The add/edit field modal never reads this\n * — see `fieldModal`. Default: none. */\n fieldTypes?: FieldTypeDefinition[];\n /** Overrides one existing field's type label, icons and collection-picker\n * label. Does not change its type, values or add-field options. */\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n /** Default: `schemaPermissions.createField`. */\n canAddFields?: (schema: Schema) => boolean;\n /** Default: `schemaPermissions.updateField`, except for system fields and\n * the id field. */\n canEditField?: (field: Field, schema: Schema) => boolean;\n /** Default: `schemaPermissions.deleteField`, except for system fields and\n * the id field. */\n canDeleteField?: (field: Field, schema: Schema) => boolean;\n /** Resolved when deletion is requested. Undefined keeps the default dialog. */\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n /** Permission defaults shown in the modal. Absent ⇒ no permissions section. */\n fieldPermissions?: FieldPermissions;\n /** Default: `false`. */\n supportsPii?: boolean;\n /** The value of a field on an item. Default: `item[field.id]`. */\n getFieldValue?: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item.\n * Default: `{ ...item, [field.id]: value }`. */\n setFieldValue?: (item: T, field: Field, value: unknown) => T;\n}\n\n/** The resolved source: defaults filled, `loadSchema` memoized. */\nexport interface SchemaSource<T> {\n readonly collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n readonly paginationMode: 'offset';\n /** Stable row identity. */\n itemKey: (item: T) => string;\n /** Row display label. */\n itemName: (item: T) => string;\n /** Sources for referenced collections, keyed by referenced collection id. */\n readonly references: Record<string, SchemaSource<any>>;\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n readonly fieldModal: {\n text?: FieldModalText;\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: FieldTypeOption[];\n };\n readonly fieldTypes: FieldTypeDefinition[];\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n searchableFieldIds: (schema: Schema) => string[];\n canAddFields: (schema: Schema) => boolean;\n canEditField: (field: Field, schema: Schema) => boolean;\n canDeleteField: (field: Field, schema: Schema) => boolean;\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n readonly fieldPermissions?: FieldPermissions;\n readonly supportsPii: boolean;\n /** The value of a field on an item. */\n getFieldValue: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item. */\n setFieldValue: (item: T, field: Field, value: unknown) => T;\n schemaParams: () => SchemaBiParams;\n /** Replaces the memoized schema returned by later `loadSchema()` calls.\n * No-op before the first successful load. */\n setLoadedSchema?: (schema: Schema) => void;\n}\n\ntype OffsetFind<T> = (\n query: OffsetQuery,\n options?: FindOptions,\n) => Promise<OffsetQueryResult<T>>;\n\n/** The collection fetch derived from a source: loads once, then queries the\n * backend's `find`.\n *\n * Free-text search covers the columns the page is showing: the table keeps\n * `query.columns` in sync with them, so the scope comes off the query rather\n * than being threaded in. Falls back to the source's own `searchableFieldIds`\n * before any columns are known (or with no table attached). */\nexport function sourceFetchData<T>(\n source: SchemaSource<T>,\n): (query: OffsetQuery) => Promise<OffsetQueryResult<T>> {\n return async (query) => {\n const { backend, schema } = await source.loadSchema();\n // `columns` is the visible-column list; `fields` is the projection, which a\n // source-driven table doesn't set.\n const visibleColumns = query.columns;\n return (backend.find as OffsetFind<T>)(query, {\n searchableFieldIds: visibleColumns?.length\n ? visibleColumns\n : source.searchableFieldIds(schema),\n });\n };\n}\n\n/** Fills source-neutral defaults over `input` and memoizes the load so the collection\n * query and the table columns share a single fetch. */\nexport function defineSchemaSource<T>(\n input: SchemaSourceInput<T>,\n): SchemaSource<T> {\n const {\n collectionId,\n paginationMode = 'offset',\n fieldModal = {},\n fieldTypes = [],\n fieldPermissions,\n supportsPii = false,\n references = {},\n getReferencedCollectionSource,\n } = input;\n\n let loaded: Promise<LoadedSchema<T>> | undefined;\n let resolved: LoadedSchema<T> | undefined;\n\n const loadSchema = () =>\n (loaded ??= input\n .loadSchema()\n .then((result) => {\n resolved = result;\n return result;\n })\n .catch((error) => {\n loaded = undefined;\n throw error;\n }));\n\n const setLoadedSchema = (schema: Schema) => {\n if (!resolved) {\n return;\n }\n resolved = { ...resolved, schema };\n loaded = Promise.resolve(resolved);\n };\n\n const searchableFieldIds =\n input.searchableFieldIds ?? ((s) => [s.displayField]);\n\n const itemKey =\n input.itemKey ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[resolved?.schema.idField ?? '_id'] ??\n '',\n ));\n const itemName =\n input.itemName ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[\n resolved?.schema.displayField ?? '_id'\n ] ?? '',\n ));\n const canAddFields =\n input.canAddFields ?? ((s) => s.schemaPermissions?.createField ?? false);\n const isLockedField = (field: Field, s: Schema) =>\n field.isSystem === true || field.id === s.idField;\n const canEditField =\n input.canEditField ??\n ((field, s) =>\n (s.schemaPermissions?.updateField ?? false) && !isLockedField(field, s));\n const canDeleteField =\n input.canDeleteField ??\n ((field, s) =>\n (s.schemaPermissions?.deleteField ?? false) && !isLockedField(field, s));\n const getFieldValue =\n input.getFieldValue ??\n ((item, field) => (item as Record<string, unknown>)[field.id]);\n const setFieldValue =\n input.setFieldValue ??\n ((item, field, value) => ({ ...item, [field.id]: value } as T));\n\n const schemaParams = (): SchemaBiParams => ({\n tableId: resolved?.schema.id ?? collectionId,\n tableName: resolved?.schema.name,\n tableType: resolved?.schema.type,\n });\n\n return {\n collectionId,\n loadSchema,\n paginationMode,\n itemKey,\n itemName,\n references,\n ...(getReferencedCollectionSource && { getReferencedCollectionSource }),\n fieldModal: {\n text: fieldModal.text,\n loadReferenceableCollectionOptions:\n fieldModal.loadReferenceableCollectionOptions,\n types: fieldModal.types ?? [],\n },\n fieldTypes,\n getFieldPresentation: input.getFieldPresentation,\n searchableFieldIds,\n canAddFields,\n canEditField,\n canDeleteField,\n getDeleteFieldConfirmation: input.getDeleteFieldConfirmation,\n fieldPermissions,\n supportsPii,\n getFieldValue,\n setFieldValue,\n schemaParams,\n setLoadedSchema,\n };\n}\n"],"mappings":";;;;;AAiBA;AACA;AACA;AACA;;AA0BA;;AAUA;;AAQA;;AAOA;;AAwDA;;AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAC7BC,MAAuB,EACgC;EACvD,OAAO,MAAOC,KAAK,IAAK;IACtB,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAG,MAAMH,MAAM,CAACI,UAAU,CAAC,CAAC;IACrD;IACA;IACA,MAAMC,cAAc,GAAGJ,KAAK,CAACK,OAAO;IACpC,OAAQJ,OAAO,CAACK,IAAI,CAAmBN,KAAK,EAAE;MAC5CO,kBAAkB,EAAEH,cAAc,YAAdA,cAAc,CAAEI,MAAM,GACtCJ,cAAc,GACdL,MAAM,CAACQ,kBAAkB,CAACL,MAAM;IACtC,CAAC,CAAC;EACJ,CAAC;AACH;;AAEA;AACA;AACO,SAASO,kBAAkBA,CAChCC,KAA2B,EACV;EACjB,MAAM;IACJC,YAAY;IACZC,cAAc,GAAG,QAAQ;IACzBC,UAAU,GAAG,CAAC,CAAC;IACfC,UAAU,GAAG,EAAE;IACfC,gBAAgB;IAChBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,CAAC,CAAC;IACfC;EACF,CAAC,GAAGR,KAAK;EAET,IAAIS,MAA4C;EAChD,IAAIC,QAAqC;EAEzC,MAAMjB,UAAU,GAAGA,CAAA,KAChBgB,MAAM,KAANA,MAAM,GAAKT,KAAK,CACdP,UAAU,CAAC,CAAC,CACZkB,IAAI,CAAEC,MAAM,IAAK;IAChBF,QAAQ,GAAGE,MAAM;IACjB,OAAOA,MAAM;EACf,CAAC,CAAC,CACDC,KAAK,CAAEC,KAAK,IAAK;IAChBL,MAAM,GAAGM,SAAS;IAClB,MAAMD,KAAK;EACb,CAAC,CAAC,CAAC;EAEP,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IAAI;MAAEA;IAA8B,CAAC,CAAC;IACvEL,UAAU,EAAE;MACVmD,IAAI,EAAEnD,UAAU,CAACmD,IAAI;MACrBC,kCAAkC,EAChCpD,UAAU,CAACoD,kCAAkC;MAC/CC,KAAK,EAAErD,UAAU,CAACqD,KAAK,IAAI;IAC7B,CAAC;IACDpD,UAAU;IACVqD,oBAAoB,EAAEzD,KAAK,CAACyD,oBAAoB;IAChD5D,kBAAkB;IAClB+B,YAAY;IACZQ,YAAY;IACZG,cAAc;IACdmB,0BAA0B,EAAE1D,KAAK,CAAC0D,0BAA0B;IAC5DrD,gBAAgB;IAChBC,WAAW;IACXoC,aAAa;IACbC,aAAa;IACbE,YAAY;IACZ7B;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["sourceFetchData","source","query","backend","schema","loadSchema","visibleColumns","columns","find","searchableFieldIds","length","defineSchemaSource","input","collectionId","paginationMode","fieldModal","fieldTypes","fieldPermissions","supportsPii","references","getReferencedCollectionSource","loaded","resolved","then","result","catch","error","undefined","setLoadedSchema","Promise","resolve","s","displayField","itemKey","item","_resolved","String","idField","itemName","_resolved2","canAddFields","_s$schemaPermissions","schemaPermissions","createField","isLockedField","field","isSystem","id","canEditField","_s$schemaPermissions2","updateField","canDeleteField","_s$schemaPermissions3","deleteField","getFieldValue","setFieldValue","value","schemaParams","_resolved3","_resolved4","_resolved5","tableId","tableName","name","tableType","type","text","loadReferenceableCollectionOptions","types","getFieldPresentation","getDeleteFieldConfirmation"],"sources":["../../../src/types/SchemaSource.ts"],"sourcesContent":["import type { Field, PatternsFieldType } from './Field';\nimport type { FieldTypeDefinition } from './FieldTypeDefinition';\nimport type { Schema, LoadedSchema, FindOptions } from './Schema';\nimport type {\n FieldPresentation,\n FieldModalText,\n FieldModalCollectionInput,\n FieldModalCollectionOptionsLoader,\n FieldPermissions,\n FieldPiiWarning,\n FieldSettingsSection,\n} from './FieldsSource';\nimport type {\n OffsetQuery,\n OffsetQueryResult,\n} from '../hooks/paginationModeConfig';\n\n/** A field type the add/edit field modal offers, with everything that type\n * brings to it. Declare one entry per `patternsType` — the type is the entry's\n * identity. Nothing here reaches the table or the filters; that is `fieldTypes`\n * (`FieldTypeDefinition[]`). */\nexport interface FieldTypeOption {\n patternsType: PatternsFieldType;\n /** Custom display name. Absent ⇒ the UI's standard name for this type. */\n label?: string;\n /** Custom name-input placeholder. Absent ⇒ the UI's standard placeholder. */\n namePlaceholder?: string;\n /** Optional valid field ID base. Default: the normalized uppercase type ID.\n * Numeric suffixes are added only on collision. */\n keyBase?: string;\n /** A one-line description shown under the type in the add-field menu. */\n subtitle?: string;\n /** The group heading this type is listed under in the add-field menu, in\n * first-seen order. Types sharing a heading form one group. Absent ⇒\n * ungrouped. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source's `supportsPii`. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section in the add/edit field\n * modal. Default: none. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown in the main add/edit field form. */\n collectionInput?: FieldModalCollectionInput;\n}\n\n/** Everything the add/edit field modal shows for this source. */\nexport interface FieldModalInput {\n /** Title and subtitle. Default: generic titles. */\n text?: FieldModalText;\n /** Default option loader for reference-like built-in field types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n /** The types the modal offers, in display order. Default: none. */\n types?: FieldTypeOption[];\n}\n\n/** Copy shown before deleting a field. Strings are translated by the caller. */\nexport interface DeleteFieldConfirmation {\n title: string;\n description: string;\n /** When provided, confirmation requires this checkbox to be checked. */\n confirmationCheckboxLabel?: string;\n}\n\n/** Identifies the collection behind a table on BI events. */\nexport interface SchemaBiParams {\n tableId?: string;\n tableName?: string;\n tableType?: string;\n}\n\n/** What a caller passes. Only `collectionId` and `loadSchema` are required. */\nexport interface SchemaSourceInput<T> {\n collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n /** Sources for collections this one references, keyed by the referenced\n * collection id. A renderer resolves a reference field through the matching\n * entry — its `loadSchema` gives the referenced schema and `sourceFetchData`\n * queries the referenced items. Default: none. */\n references?: Record<string, SchemaSource<any>>;\n /** Lazy source lookup for a referenced collection that is not in `references`.\n * Is used when a reference field is created in the add field modal.\n * The returned source owns its own async schema/item loading. */\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n paginationMode?: 'offset';\n /** Stable row identity. Default: `row[idField]`. */\n itemKey?: (item: T) => string;\n /** Row display label. Default: `row[displayField]`. */\n itemName?: (item: T) => string;\n /** Fields free-text search runs against. Default: `[displayField]`. */\n searchableFieldIds?: (schema: Schema) => string[];\n /** What the add/edit field modal shows. Default: no types, generic titles. */\n fieldModal?: FieldModalInput;\n /** Consumer-defined field types: how a field of that type renders, filters and\n * validates wherever it appears. A field with `type: 'CUSTOM'` resolves its\n * definition here by `customType`. The add/edit field modal never reads this\n * — see `fieldModal`. Default: none. */\n fieldTypes?: FieldTypeDefinition[];\n /** Overrides one existing field's type label, icons and collection-picker\n * label. Does not change its type, values or add-field options. */\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n /** Default: `schemaPermissions.createField`. */\n canAddFields?: (schema: Schema) => boolean;\n /** Default: `schemaPermissions.updateField`, except for system fields and\n * the id field. */\n canEditField?: (field: Field, schema: Schema) => boolean;\n /** Default: `schemaPermissions.deleteField`, except for system fields and\n * the id field. */\n canDeleteField?: (field: Field, schema: Schema) => boolean;\n /** Resolved when deletion is requested. Undefined keeps the default dialog. */\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n /** Permission defaults shown in the modal. Absent ⇒ no permissions section. */\n fieldPermissions?: FieldPermissions;\n /** Default: `false`. */\n supportsPii?: boolean;\n /** The value of a field on an item. Default: `item[field.id]`. */\n getFieldValue?: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item.\n * Default: `{ ...item, [field.id]: value }`. */\n setFieldValue?: (item: T, field: Field, value: unknown) => T;\n}\n\n/** The resolved source: defaults filled, `loadSchema` memoized. */\nexport interface SchemaSource<T> {\n readonly collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n readonly paginationMode: 'offset';\n /** Stable row identity. */\n itemKey: (item: T) => string;\n /** Row display label. */\n itemName: (item: T) => string;\n /** Sources for referenced collections, keyed by referenced collection id. */\n readonly references: Record<string, SchemaSource<any>>;\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n readonly fieldModal: {\n text?: FieldModalText;\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: FieldTypeOption[];\n };\n readonly fieldTypes: FieldTypeDefinition[];\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n searchableFieldIds: (schema: Schema) => string[];\n canAddFields: (schema: Schema) => boolean;\n canEditField: (field: Field, schema: Schema) => boolean;\n canDeleteField: (field: Field, schema: Schema) => boolean;\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n readonly fieldPermissions?: FieldPermissions;\n readonly supportsPii: boolean;\n /** The value of a field on an item. */\n getFieldValue: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item. */\n setFieldValue: (item: T, field: Field, value: unknown) => T;\n schemaParams: () => SchemaBiParams;\n /** Replaces the memoized schema returned by later `loadSchema()` calls.\n * No-op before the first successful load. */\n setLoadedSchema?: (schema: Schema) => void;\n}\n\ntype OffsetFind<T> = (\n query: OffsetQuery,\n options?: FindOptions,\n) => Promise<OffsetQueryResult<T>>;\n\n/** The collection fetch derived from a source: loads once, then queries the\n * backend's `find`.\n *\n * Free-text search covers the columns the page is showing: the table keeps\n * `query.columns` in sync with them, so the scope comes off the query rather\n * than being threaded in. Falls back to the source's own `searchableFieldIds`\n * before any columns are known (or with no table attached). */\nexport function sourceFetchData<T>(\n source: SchemaSource<T>,\n): (query: OffsetQuery) => Promise<OffsetQueryResult<T>> {\n return async (query) => {\n const { backend, schema } = await source.loadSchema();\n // `columns` is the visible-column list; `fields` is the projection, which a\n // source-driven table doesn't set.\n const visibleColumns = query.columns;\n return (backend.find as OffsetFind<T>)(query, {\n searchableFieldIds: visibleColumns?.length\n ? visibleColumns\n : source.searchableFieldIds(schema),\n });\n };\n}\n\n/** Fills source-neutral defaults over `input` and memoizes the load so the collection\n * query and the table columns share a single fetch. */\nexport function defineSchemaSource<T>(\n input: SchemaSourceInput<T>,\n): SchemaSource<T> {\n const {\n collectionId,\n paginationMode = 'offset',\n fieldModal = {},\n fieldTypes = [],\n fieldPermissions,\n supportsPii = false,\n references = {},\n getReferencedCollectionSource,\n } = input;\n\n let loaded: Promise<LoadedSchema<T>> | undefined;\n let resolved: LoadedSchema<T> | undefined;\n\n const loadSchema = () =>\n (loaded ??= input\n .loadSchema()\n .then((result) => {\n resolved = result;\n return result;\n })\n .catch((error) => {\n loaded = undefined;\n throw error;\n }));\n\n const setLoadedSchema = (schema: Schema) => {\n if (!resolved) {\n return;\n }\n resolved = { ...resolved, schema };\n loaded = Promise.resolve(resolved);\n };\n\n const searchableFieldIds =\n input.searchableFieldIds ?? ((s) => [s.displayField]);\n\n const itemKey =\n input.itemKey ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[resolved?.schema.idField ?? '_id'] ??\n '',\n ));\n const itemName =\n input.itemName ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[\n resolved?.schema.displayField ?? '_id'\n ] ?? '',\n ));\n const canAddFields =\n input.canAddFields ?? ((s) => s.schemaPermissions?.createField ?? false);\n const isLockedField = (field: Field, s: Schema) =>\n field.isSystem === true || field.id === s.idField;\n const canEditField =\n input.canEditField ??\n ((field, s) =>\n (s.schemaPermissions?.updateField ?? false) && !isLockedField(field, s));\n const canDeleteField =\n input.canDeleteField ??\n ((field, s) =>\n (s.schemaPermissions?.deleteField ?? false) && !isLockedField(field, s));\n const getFieldValue =\n input.getFieldValue ??\n ((item, field) => (item as Record<string, unknown>)[field.id]);\n const setFieldValue =\n input.setFieldValue ??\n ((item, field, value) => ({ ...item, [field.id]: value } as T));\n\n const schemaParams = (): SchemaBiParams => ({\n tableId: resolved?.schema.id ?? collectionId,\n tableName: resolved?.schema.name,\n tableType: resolved?.schema.type,\n });\n\n return {\n collectionId,\n loadSchema,\n paginationMode,\n itemKey,\n itemName,\n references,\n ...(getReferencedCollectionSource && { getReferencedCollectionSource }),\n fieldModal: {\n text: fieldModal.text,\n loadReferenceableCollectionOptions:\n fieldModal.loadReferenceableCollectionOptions,\n types: fieldModal.types ?? [],\n },\n fieldTypes,\n getFieldPresentation: input.getFieldPresentation,\n searchableFieldIds,\n canAddFields,\n canEditField,\n canDeleteField,\n getDeleteFieldConfirmation: input.getDeleteFieldConfirmation,\n fieldPermissions,\n supportsPii,\n getFieldValue,\n setFieldValue,\n schemaParams,\n setLoadedSchema,\n };\n}\n"],"mappings":";;;;;AAiBA;AACA;AACA;AACA;;AA6BA;;AAUA;;AAQA;;AAOA;;AAwDA;;AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAC7BC,MAAuB,EACgC;EACvD,OAAO,MAAOC,KAAK,IAAK;IACtB,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAG,MAAMH,MAAM,CAACI,UAAU,CAAC,CAAC;IACrD;IACA;IACA,MAAMC,cAAc,GAAGJ,KAAK,CAACK,OAAO;IACpC,OAAQJ,OAAO,CAACK,IAAI,CAAmBN,KAAK,EAAE;MAC5CO,kBAAkB,EAAEH,cAAc,YAAdA,cAAc,CAAEI,MAAM,GACtCJ,cAAc,GACdL,MAAM,CAACQ,kBAAkB,CAACL,MAAM;IACtC,CAAC,CAAC;EACJ,CAAC;AACH;;AAEA;AACA;AACO,SAASO,kBAAkBA,CAChCC,KAA2B,EACV;EACjB,MAAM;IACJC,YAAY;IACZC,cAAc,GAAG,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AC;EAEjE,MAAMC,YAAY,GAAGA,CAAA;IAAA,IAAAC,UAAA,EAAAC,UAAA,EAAAC,UAAA;IAAA,OAAuB;MAC1CC,OAAO,EAAE,EAAAH,UAAA,GAAApC,QAAQ,qBAARoC,UAAA,CAAUtD,MAAM,CAAC2C,EAAE,KAAIlC,YAAY;MAC5CiD,SAAS,GAAAH,UAAA,GAAErC,QAAQ,qBAARqC,UAAA,CAAUvD,MAAM,CAAC2D,IAAI;MAChCC,SAAS,GAAAJ,UAAA,GAAEtC,QAAQ,qBAARsC,UAAA,CAAUxD,MAAM,CAAC6D;IAC9B,CAAC;EAAA,CAAC;EAEF,OAAO;IACLpD,YAAY;IACZR,UAAU;IACVS,cAAc;IACdmB,OAAO;IACPK,QAAQ;IACRnB,UAAU;IACV,IAAIC,6BAA6B,IAAI;MAAEA;IAA8B,CAAC,CAAC;IACvEL,UAAU,EAAE;MACVmD,IAAI,EAAEnD,UAAU,CAACmD,IAAI;MACrBC,kCAAkC,EAChCpD,UAAU,CAACoD,kCAAkC;MAC/CC,KAAK,EAAErD,UAAU,CAACqD,KAAK,IAAI;IAC7B,CAAC;IACDpD,UAAU;IACVqD,oBAAoB,EAAEzD,KAAK,CAACyD,oBAAoB;IAChD5D,kBAAkB;IAClB+B,YAAY;IACZQ,YAAY;IACZG,cAAc;IACdmB,0BAA0B,EAAE1D,KAAK,CAAC0D,0BAA0B;IAC5DrD,gBAAgB;IAChBC,WAAW;IACXoC,aAAa;IACbC,aAAa;IACbE,YAAY;IACZ7B;EACF,CAAC;AACH","ignoreList":[]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAGL,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAGL,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAuD9C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAS3E,cAAc,6BAA6B,CAAC"}
|
|
@@ -121,7 +121,9 @@ export class CustomFieldModalBiReporter {
|
|
|
121
121
|
const { customFieldModalState: { form }, } = this;
|
|
122
122
|
const disposes = [
|
|
123
123
|
reaction(() => form.$.name.value, () => {
|
|
124
|
-
|
|
124
|
+
if (form.$.name.dirty) {
|
|
125
|
+
this.reportNameFormFieldChange();
|
|
126
|
+
}
|
|
125
127
|
}),
|
|
126
128
|
reaction(() => form.$.type.value, () => {
|
|
127
129
|
this.reportTypeFormFieldChange();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFieldModalBiReporter.js","sourceRoot":"","sources":["../../../src/state/CustomFieldModalBiReporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,sCAAsC,EACtC,gCAAgC,EAChC,4CAA4C,EAC5C,cAAc,GACf,MAA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C,CAAC,CAAC,IAAI,CAAC,KAAK,EACvB,GAAG,EAAE;gBACH,IAAI,CAAC,yBAAyB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomFieldModalBiReporter.js","sourceRoot":"","sources":["../../../src/state/CustomFieldModalBiReporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,sCAAsC,EACtC,gCAAgC,EAChC,4CAA4C,EAC5C,cAAc,GACf,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAOlE,MAAM,OAAO,0BAA0B;IASrC,YAAY,MAAwC;QAPpD,iBAAY,GAAsB,IAAI,CAAC;QA4EvC,yBAAoB,GAAG,CAAC,EACtB,MAAM,EACN,YAAY,GAIb,EAAE,EAAE;YACH,IAAI,CAAC,QAAQ,CACX,eAAe,CAAC,yBAAyB,CAAC,CAAC;gBACzC,MAAM;gBACN,YAAY;aACb,CAAC,CACH,CAAC;QACJ,CAAC,CAAC;QAEF,gCAA2B,GAAG,CAAC,UAA4B,EAAE,EAAE;YAC7D,IAAI,CAAC,QAAQ,CACX,eAAe,CAAC,sCAAsC,CAAC,CAAC;gBACtD,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,UAAU;aACX,CAAC,CACH,CAAC;QACJ,CAAC,CAAC;QAEF,yBAAoB,GAAG,GAAG,EAAE;YAC1B,IAAI,CAAC,QAAQ,CACX,eAAe,CAAC,cAAc,CAAC,CAAC;gBAC9B,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CACH,CAAC;QACJ,CAAC,CAAC;QAEF,0BAAqB,GAAG,CAAC,MAA2C,EAAE,EAAE;YACtE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAC3B,MAAM,EACJ,CAA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ACF"}
|
|
@@ -22,6 +22,8 @@ export class CustomFieldModalState {
|
|
|
22
22
|
this.collectionActionVersion = 0;
|
|
23
23
|
this.collectionActionOptions = [];
|
|
24
24
|
this.collectionOptionsState = new CustomFieldCollectionOptionsState();
|
|
25
|
+
this.hasInitialName = false;
|
|
26
|
+
this.generatedName = undefined;
|
|
25
27
|
this.modalState = new ConditionalModalState({
|
|
26
28
|
onConfirm: async () => {
|
|
27
29
|
if (this.isCollectionActionPending) {
|
|
@@ -190,6 +192,7 @@ export class CustomFieldModalState {
|
|
|
190
192
|
loadCollectionOptions: action.bound,
|
|
191
193
|
setFormValues: action,
|
|
192
194
|
generateUniqueKey: action.bound,
|
|
195
|
+
applyFieldTypeDefaults: action.bound,
|
|
193
196
|
setKeyFieldIfNotDirty: action.bound,
|
|
194
197
|
setDefaultPermissions: action,
|
|
195
198
|
});
|
|
@@ -262,6 +265,8 @@ export class CustomFieldModalState {
|
|
|
262
265
|
reset() {
|
|
263
266
|
const { form, settings, disabledFields: { permissions }, } = this;
|
|
264
267
|
form.reset();
|
|
268
|
+
this.hasInitialName = false;
|
|
269
|
+
this.generatedName = undefined;
|
|
265
270
|
settings.setOff();
|
|
266
271
|
this.resetSettingsValues();
|
|
267
272
|
this.resetCollectionInput();
|
|
@@ -382,12 +387,14 @@ export class CustomFieldModalState {
|
|
|
382
387
|
this.reapplyPendingRequired();
|
|
383
388
|
}
|
|
384
389
|
if (initialField.name !== undefined) {
|
|
390
|
+
this.hasInitialName = true;
|
|
385
391
|
// Independent of `type` — a caller may want to suggest a name without
|
|
386
392
|
// constraining which type the user picks.
|
|
387
393
|
$.name.value = initialField.name.slice(0, CUSTOM_FIELD_NAME_MAX_LENGTH);
|
|
388
394
|
provided.push('name');
|
|
389
395
|
this.setKeyFieldIfNotDirty(this.generateUniqueKey($.name.value));
|
|
390
396
|
}
|
|
397
|
+
this.applyFieldTypeDefaults();
|
|
391
398
|
this.lockedProperties = this.lockedProperties.filter((property) => provided.includes(property));
|
|
392
399
|
}
|
|
393
400
|
setDefaultPermissions() {
|
|
@@ -402,6 +409,19 @@ export class CustomFieldModalState {
|
|
|
402
409
|
$.writeUsers.value = !!permissions?.siteVisitors?.defaultWrite;
|
|
403
410
|
}
|
|
404
411
|
}
|
|
412
|
+
applyFieldTypeDefaults() {
|
|
413
|
+
if (this.mode !== 'new') {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
const { name } = this.form.$;
|
|
417
|
+
if (!name.dirty &&
|
|
418
|
+
!this.hasInitialName &&
|
|
419
|
+
(!name.value || name.value === this.generatedName)) {
|
|
420
|
+
this.generatedName = this.selectedFieldType?.label.slice(0, CUSTOM_FIELD_NAME_MAX_LENGTH);
|
|
421
|
+
name.value = this.generatedName ?? '';
|
|
422
|
+
}
|
|
423
|
+
this.setKeyFieldIfNotDirty(this.generateUniqueKey(name.value));
|
|
424
|
+
}
|
|
405
425
|
resetCollectionAction() {
|
|
406
426
|
this.collectionActionVersion += 1;
|
|
407
427
|
this.collectionActionOptions = [];
|
|
@@ -465,19 +485,28 @@ export class CustomFieldModalState {
|
|
|
465
485
|
return this.fieldManagement.existingFieldKeys.includes(key);
|
|
466
486
|
}
|
|
467
487
|
generateUniqueKey(name) {
|
|
468
|
-
const slug = slugify(name);
|
|
469
488
|
const type = this.form.$.type.value;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
489
|
+
const isDefaultName = !this.hasInitialName &&
|
|
490
|
+
!this.form.$.name.dirty &&
|
|
491
|
+
name === this.generatedName;
|
|
492
|
+
const slug = slugify(name).replace(/^[^a-z]+/, '');
|
|
493
|
+
const typeKey = type
|
|
494
|
+
? this.selectedFieldType?.keyBase ??
|
|
495
|
+
(slugify(type)
|
|
496
|
+
.replace(/^[^a-z]+/, '')
|
|
497
|
+
.toUpperCase() ||
|
|
498
|
+
'FIELD')
|
|
499
|
+
: '';
|
|
500
|
+
const base = isDefaultName || !slug ? typeKey : slug;
|
|
501
|
+
if (!base) {
|
|
474
502
|
return '';
|
|
475
503
|
}
|
|
504
|
+
let key = base;
|
|
476
505
|
let index = 1;
|
|
477
|
-
while (this.containsKey(
|
|
478
|
-
|
|
506
|
+
while (this.containsKey(key)) {
|
|
507
|
+
key = `${base}_${index++}`;
|
|
479
508
|
}
|
|
480
|
-
return
|
|
509
|
+
return key;
|
|
481
510
|
}
|
|
482
511
|
get t() {
|
|
483
512
|
return this.container.translate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFieldModalState.js","sourceRoot":"","sources":["../../../src/state/CustomFieldModalState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAaxC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGxE;;kBAEkB;AAClB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AA2C/C,MAAM,OAAO,qBAAqB;IAiLhC,YAAY,MAA8B;QA5K1C,aAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;QAC7B,qBAAgB,GAA4B,SAAS,CAAC;QACtD,SAAI,GAAmB,KAAK,CAAC;QAC7B,WAAM,GAAsB,sBAAsB,CAAC;QAEnD,qBAAgB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;IACzE,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,MAAM,oBAAoB,GAAG,CAC3B,eAA0C,EAC1C,kBAA6C,EAClB,EAAE;IAC7B,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,IAAI,QAAQ,CAAC,eAAe,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC9D,OAAO,EAAE,GAAG,eAAe,EAAE,GAAG,kBAAkB,EAAE,CAAC;IACvD,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC5B,CAAC,CAAC"}
|
|
@@ -34,8 +34,11 @@ const toField = (def) => ({
|
|
|
34
34
|
* Exported for tests.
|
|
35
35
|
*/
|
|
36
36
|
export const buildImportConfig = (fieldsSource, collection, inputs = {}) => {
|
|
37
|
-
const { destination, fields = [], backup, idFieldKey, jobApplicationErrorMap, } = inputs;
|
|
37
|
+
const { destination, fields = [], backup, idFieldKey, jobApplicationErrorMap, onImportCompleted, getItemsLimit, onItemsLimitExceeded, } = inputs;
|
|
38
38
|
return {
|
|
39
|
+
onImportCompleted,
|
|
40
|
+
getItemsLimit,
|
|
41
|
+
onItemsLimitExceeded,
|
|
39
42
|
get fields() {
|
|
40
43
|
const seen = new Set(fields.map((f) => f.id));
|
|
41
44
|
const live = (fieldsSource?.fields ?? [])
|
|
@@ -964,6 +967,18 @@ export class ImportState {
|
|
|
964
967
|
// merge".
|
|
965
968
|
return updated && Object.keys(updated).length > 0 ? updated : undefined;
|
|
966
969
|
}
|
|
970
|
+
_exceedsItemsLimit() {
|
|
971
|
+
const { getItemsLimit } = this.config;
|
|
972
|
+
return !!getItemsLimit && this.csvRows.length > getItemsLimit();
|
|
973
|
+
}
|
|
974
|
+
_notifyImportCompleted() {
|
|
975
|
+
try {
|
|
976
|
+
this.config.onImportCompleted?.();
|
|
977
|
+
}
|
|
978
|
+
catch (error) {
|
|
979
|
+
console.error('ImportState config.onImportCompleted failed', error);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
967
982
|
async startImport() {
|
|
968
983
|
if (!this.hasMappings) {
|
|
969
984
|
return;
|
|
@@ -980,6 +995,10 @@ export class ImportState {
|
|
|
980
995
|
});
|
|
981
996
|
return;
|
|
982
997
|
}
|
|
998
|
+
if (this._exceedsItemsLimit()) {
|
|
999
|
+
this.config.onItemsLimitExceeded?.();
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
983
1002
|
this._cancelled = false;
|
|
984
1003
|
this._abortController = new AbortController();
|
|
985
1004
|
// One uploaded row per CSV row (the rewrite drops columns, not rows), so the
|
|
@@ -1056,6 +1075,7 @@ export class ImportState {
|
|
|
1056
1075
|
// the import reach completion.
|
|
1057
1076
|
this.processedCount = this.totalCount;
|
|
1058
1077
|
});
|
|
1078
|
+
this._notifyImportCompleted();
|
|
1059
1079
|
// Keep the completed bar on screen briefly before moving on. `importStatus`
|
|
1060
1080
|
// is already success, so a close during this window just dismisses the
|
|
1061
1081
|
// modal (the `close()` guard doesn't treat it as a cancel).
|