@entifix/react-controls 0.22.2 → 0.22.4
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/i18n/catalog/en.d.ts.map +1 -1
- package/dist/i18n/catalog/en.js +2 -1
- package/dist/i18n/catalog/en.js.map +1 -1
- package/dist/i18n/catalog/es.d.ts +1 -0
- package/dist/i18n/catalog/es.d.ts.map +1 -1
- package/dist/i18n/catalog/es.js +2 -1
- package/dist/i18n/catalog/es.js.map +1 -1
- package/dist/i18n/catalog/index.d.ts +2 -0
- package/dist/i18n/catalog/index.d.ts.map +1 -1
- package/dist/ui/molecules/summary-tile/summary-tile.d.ts +18 -1
- package/dist/ui/molecules/summary-tile/summary-tile.d.ts.map +1 -1
- package/dist/ui/molecules/summary-tile/summary-tile.js +83 -24
- package/dist/ui/molecules/summary-tile/summary-tile.js.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table-slots.d.ts +6 -1
- package/dist/ui/organisms/entity-table/entity-table-slots.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table-slots.js.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.d.ts +1 -1
- package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.js +73 -37
- package/dist/ui/organisms/entity-table/entity-table.js.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts +7 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -1
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +4 -3
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -1
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js +15 -5
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.types.ts"],"sourcesContent":["import type {\n BulkOutcome,\n EntifixFailure,\n Entity,\n EntityConstructor,\n EntityFacetCounts,\n EntityFieldDescriptor,\n EntityId,\n EntityMetadataDocument,\n EntitySelection,\n EntitySorting,\n FilterGroup,\n} from '@entifix/core';\nimport type { ReactNode } from 'react';\n\nimport type { RenderLink } from '../../actions/index.js';\n\n/**\n * A column as the table finally renders it: the metadata descriptor plus the\n * per-column overrides a caller supplied through an `<EntityColumn>` slot.\n */\nexport interface EntityTableColumn<\n TEntity extends Entity,\n> extends EntityFieldDescriptor {\n /** Replaces the default header text. */\n header?: ReactNode;\n /** Replaces the default `CellValue` rendering for this column. */\n render?: (item: TEntity) => ReactNode;\n /** True when the column has no backing entity member (slot-only column). */\n virtual?: boolean;\n}\n\n/**\n * A fixed width, read against the table's own container, at and above which\n * it renders as a grid rather than as cards: `sm` 40rem, `md` 48rem, `lg` 64rem.\n */\nexport type EntityTablePivotBreakpoint = 'sm' | 'md' | 'lg';\n\nexport interface EntityTableProps<TEntity extends Entity> {\n /** Metadata source. Columns, labels, types and the filter/sort controls all\n * derive from this constructor's accessors. */\n entityConstructor: EntityConstructor<TEntity>;\n\n isLoading: boolean;\n /**\n * What holds the table's shape during the first load.\n *\n * `true` (the default) renders the built-in placeholder, which is derived from\n * the table's own resolved geometry — one shimmer cell per visible column, so\n * the swap to real rows shifts nothing. A node replaces that default; `false`\n * renders no placeholder at all.\n *\n * Only the *first* load is held this way. A refetch that already has rows\n * keeps them and marks the region busy instead — replacing populated rows with\n * shimmer on every pagination click is a grey flash, not a loading state.\n */\n skeleton?: boolean | ReactNode;\n /**\n * The failure of the last load, if it failed.\n *\n * A listing that renders an empty table when the service is unreachable tells\n * the user their catalog is empty — the one thing they must not conclude. So\n * this is rendered as an alert, and it also changes the empty message.\n *\n * It arrives for free from `useDataLoading`, whose whole state is spread into\n * this component.\n */\n error?: EntifixFailure;\n items: ReadonlyArray<TEntity>;\n totalItems: number;\n currentPage: number;\n pageSize: number;\n onPageChange: (newPage: number) => void;\n onPageSizeChange?: (newPageSize: number) => void;\n\n /**\n * Builds the link to a row's record. Supplied as a function rather than the\n * table routing by itself: this package must not depend on a router, so the\n * caller (a shell page, which does know one) owns the URL shape.\n *\n * Omit it and the actions column is not rendered at all.\n */\n hrefFor?: (id: EntityId) => string;\n /** Link to the create form. Omit and no `New` action is rendered. */\n newHref?: string;\n /**\n * Renders the `Open` and `New` links. Defaults to a plain anchor, which a\n * client-routed host experiences as a full document load — pass one built on\n * the host's own link component. See {@link RenderLink}.\n */\n renderLink?: RenderLink;\n\n /**\n * Picks a row instead of navigating to it — how a link picker reuses this\n * table as its browse dialog.\n *\n * Takes precedence over {@link hrefFor}: inside a picker the user is choosing\n * a value, and offering to navigate away from the form they are editing is the\n * wrong affordance. Either one renders the actions column.\n */\n onSelect?: (item: TEntity) => void;\n\n /** Scope for persisted personalization. Defaults to the entity's key. */\n preferencesKey?: string;\n /**\n * Columns this reader does not get — a member that is always the reader\n * themselves, say. Unlike a column the reader hides from the settings, it is\n * gone from the settings, the filters, the sort choices and the cards, and\n * the reader cannot bring it back. A name that is not a column throws.\n */\n hiddenColumns?: readonly string[];\n /** Hide the toolbar (columns, filters, sorting) — a bare listing. */\n showControls?: boolean;\n /**\n * Overrides where rows stop pivoting into cards. By default that is where\n * the visible columns fit side by side in the table's own container — the\n * sum of each member's `minWidth`, or its type's — so a table in a split\n * view, a drawer or a wizard step switches by the room it actually has.\n */\n pivotBreakpoint?: EntityTablePivotBreakpoint;\n\n /** The filtering currently applied, seeding the filter panel so it shows\n * what is in effect rather than an empty form. */\n filtering?: FilterGroup<TEntity>;\n /** The sorting currently applied, seeding the sort panel. */\n sorting?: EntitySorting<TEntity>;\n\n /** Notified when the filter panel is **applied** — not while it is edited, so\n * the value can feed a load request directly. */\n onFilteringChange?: (filtering: FilterGroup<TEntity>) => void;\n /** Loads the page again — what a failed load offers as Retry. */\n onRetry?: () => void;\n /** Notified when the sort panel is applied, or a column header is clicked. */\n\n onSortingChange?: (sorting: EntitySorting<TEntity>) => void;\n /**\n * How many records hold each value, by member, for the filter panel to show\n * beside an enum's or a boolean's choices.\n */\n facets?: EntityFacetCounts;\n\n /**\n * The rows a collection-bound action would act on.\n *\n * **Controlled from above the table**, exactly as `filtering` and `sorting`\n * are, and for the same reason plus one more: a selection has to survive\n * pagination, and the page owns the pager. A selection held inside the table\n * would be reset by the very navigation the user performs to add to it.\n *\n * Omit it and no selection column is rendered — a listing that is only read\n * gains nothing from a column of empty boxes.\n */\n selection?: EntitySelection<TEntity>;\n onSelectionChange?: (selection: EntitySelection<TEntity>) => void;\n\n /**\n * What this caller may do with the entity, as the service decided it.\n *\n * The same document `EntityForm` takes. The table reads only the\n * `collection`-bound half of `useCases` — the entity-bound verbs belong to a\n * record, and a row's own overflow menu is fed from the\n * `context-dependent` ones.\n *\n * Absent keeps the pre-ADR-0026 behaviour: no bulk bar and no row menu, which\n * is what every un-migrated call site renders today.\n */\n metadata?: EntityMetadataDocument;\n isMetadataLoading?: boolean;\n\n /** Runs a `collection`-bound verb over {@link selection}. */\n onBulkUseCase?: (key: string, selection: EntitySelection<TEntity>) => void;\n /** Runs an `entity`-bound, `context-dependent` verb on one row. */\n onUseCase?: (key: string, item: TEntity) => void;\n\n /** The outcome of the last bulk run, rendered per row until dismissed. */\n bulkOutcomes?: readonly BulkOutcome[];\n onBulkDismiss?: () => void;\n onBulkRetry?: (ids: EntityId[]) => void;\n /** A bulk run is in flight — every verb is disabled while it is. */\n isBulkRunning?: boolean;\n\n /** Customization slots — see `entity-table-slots`. */\n children?: ReactNode;\n}\n"],"names":[],"mappings":"AAsCA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table.types.ts"],"sourcesContent":["import type {\n BulkOutcome,\n EntifixFailure,\n Entity,\n EntityConstructor,\n EntityFacetCounts,\n EntityFieldDescriptor,\n EntityId,\n EntityMetadataDocument,\n EntitySelection,\n EntitySorting,\n FilterGroup,\n} from '@entifix/core';\nimport type { ReactNode } from 'react';\n\nimport type { RenderLink } from '../../actions/index.js';\n\n/**\n * A column as the table finally renders it: the metadata descriptor plus the\n * per-column overrides a caller supplied through an `<EntityColumn>` slot.\n */\nexport interface EntityTableColumn<\n TEntity extends Entity,\n> extends EntityFieldDescriptor {\n /** Replaces the default header text. */\n header?: ReactNode;\n /** Replaces the default `CellValue` rendering for this column. */\n render?: (item: TEntity) => ReactNode;\n /** True when the column has no backing entity member (slot-only column). */\n virtual?: boolean;\n}\n\n/**\n * A fixed width, read against the table's own container, at and above which\n * it renders as a grid rather than as cards: `sm` 40rem, `md` 48rem, `lg` 64rem.\n */\nexport type EntityTablePivotBreakpoint = 'sm' | 'md' | 'lg';\n\nexport interface EntityTableProps<TEntity extends Entity> {\n /** Metadata source. Columns, labels, types and the filter/sort controls all\n * derive from this constructor's accessors. */\n entityConstructor: EntityConstructor<TEntity>;\n\n isLoading: boolean;\n /**\n * What holds the table's shape during the first load.\n *\n * `true` (the default) renders the built-in placeholder, which is derived from\n * the table's own resolved geometry — one shimmer cell per visible column, so\n * the swap to real rows shifts nothing. A node replaces that default; `false`\n * renders no placeholder at all.\n *\n * Only the *first* load is held this way. A refetch that already has rows\n * keeps them and marks the region busy instead — replacing populated rows with\n * shimmer on every pagination click is a grey flash, not a loading state.\n */\n skeleton?: boolean | ReactNode;\n /**\n * The failure of the last load, if it failed.\n *\n * A listing that renders an empty table when the service is unreachable tells\n * the user their catalog is empty — the one thing they must not conclude. So\n * this is rendered as an alert, and it also changes the empty message.\n *\n * It arrives for free from `useDataLoading`, whose whole state is spread into\n * this component.\n */\n error?: EntifixFailure;\n items: ReadonlyArray<TEntity>;\n totalItems: number;\n currentPage: number;\n pageSize: number;\n onPageChange: (newPage: number) => void;\n onPageSizeChange?: (newPageSize: number) => void;\n\n /**\n * Builds the link to a row's record. Supplied as a function rather than the\n * table routing by itself: this package must not depend on a router, so the\n * caller (a shell page, which does know one) owns the URL shape.\n *\n * Omit it and the actions column is not rendered at all.\n */\n hrefFor?: (id: EntityId) => string;\n /** Link to the create form. Omit and no `New` action is rendered. */\n newHref?: string;\n /**\n * Renders the `Open` and `New` links. Defaults to a plain anchor, which a\n * client-routed host experiences as a full document load — pass one built on\n * the host's own link component. See {@link RenderLink}.\n */\n renderLink?: RenderLink;\n\n /**\n * Picks a row instead of navigating to it — how a link picker reuses this\n * table as its browse dialog.\n *\n * Takes precedence over {@link hrefFor}: inside a picker the user is choosing\n * a value, and offering to navigate away from the form they are editing is the\n * wrong affordance. Either one renders the actions column.\n */\n onSelect?: (item: TEntity) => void;\n\n /** Scope for persisted personalization. Defaults to the entity's key. */\n preferencesKey?: string;\n /**\n * Columns this reader does not get — a member that is always the reader\n * themselves, say. Unlike a column the reader hides from the settings, it is\n * gone from the settings, the filters, the sort choices and the cards, and\n * the reader cannot bring it back. A name that is not a column throws.\n */\n hiddenColumns?: readonly string[];\n /**\n * Shows the record's own key (its `id`) as a column. Off by default: an id\n * is how a record is addressed, never how a person reads it, and a row\n * already opens by its name — or by its noun and short id when it has none.\n * A reference's id is unaffected, and `id=in=` still queries.\n */\n showKey?: boolean;\n /** Hide the toolbar (columns, filters, sorting) — a bare listing. */\n showControls?: boolean;\n /**\n * Overrides where rows stop pivoting into cards. By default that is where\n * the visible columns fit side by side in the table's own container — the\n * sum of each member's `minWidth`, or its type's — so a table in a split\n * view, a drawer or a wizard step switches by the room it actually has.\n */\n pivotBreakpoint?: EntityTablePivotBreakpoint;\n\n /** The filtering currently applied, seeding the filter panel so it shows\n * what is in effect rather than an empty form. */\n filtering?: FilterGroup<TEntity>;\n /** The sorting currently applied, seeding the sort panel. */\n sorting?: EntitySorting<TEntity>;\n\n /** Notified when the filter panel is **applied** — not while it is edited, so\n * the value can feed a load request directly. */\n onFilteringChange?: (filtering: FilterGroup<TEntity>) => void;\n /** Loads the page again — what a failed load offers as Retry. */\n onRetry?: () => void;\n /** Notified when the sort panel is applied, or a column header is clicked. */\n\n onSortingChange?: (sorting: EntitySorting<TEntity>) => void;\n /**\n * How many records hold each value, by member, for the filter panel to show\n * beside an enum's or a boolean's choices.\n */\n facets?: EntityFacetCounts;\n\n /**\n * The rows a collection-bound action would act on.\n *\n * **Controlled from above the table**, exactly as `filtering` and `sorting`\n * are, and for the same reason plus one more: a selection has to survive\n * pagination, and the page owns the pager. A selection held inside the table\n * would be reset by the very navigation the user performs to add to it.\n *\n * Omit it and no selection column is rendered — a listing that is only read\n * gains nothing from a column of empty boxes.\n */\n selection?: EntitySelection<TEntity>;\n onSelectionChange?: (selection: EntitySelection<TEntity>) => void;\n\n /**\n * What this caller may do with the entity, as the service decided it.\n *\n * The same document `EntityForm` takes. The table reads only the\n * `collection`-bound half of `useCases` — the entity-bound verbs belong to a\n * record, and a row's own overflow menu is fed from the\n * `context-dependent` ones.\n *\n * Absent keeps the pre-ADR-0026 behaviour: no bulk bar and no row menu, which\n * is what every un-migrated call site renders today.\n */\n metadata?: EntityMetadataDocument;\n isMetadataLoading?: boolean;\n\n /** Runs a `collection`-bound verb over {@link selection}. */\n onBulkUseCase?: (key: string, selection: EntitySelection<TEntity>) => void;\n /** Runs an `entity`-bound, `context-dependent` verb on one row. */\n onUseCase?: (key: string, item: TEntity) => void;\n\n /** The outcome of the last bulk run, rendered per row until dismissed. */\n bulkOutcomes?: readonly BulkOutcome[];\n onBulkDismiss?: () => void;\n onBulkRetry?: (ids: EntityId[]) => void;\n /** A bulk run is in flight — every verb is disabled while it is. */\n isBulkRunning?: boolean;\n\n /** Customization slots — see `entity-table-slots`. */\n children?: ReactNode;\n}\n"],"names":[],"mappings":"AAsCA,WAwJC"}
|
|
@@ -4,11 +4,12 @@ import type { EntityTableColumn } from './entity-table.types.js';
|
|
|
4
4
|
import type { EntityColumnProps } from './entity-table-slots.js';
|
|
5
5
|
/**
|
|
6
6
|
* The whole column pipeline as a pure function — metadata descriptors, then
|
|
7
|
-
* slot overrides, then what the host withholds
|
|
7
|
+
* slot overrides, then what the host withholds and the record's own key
|
|
8
|
+
* (unless `showKey`), then the user's stored layout.
|
|
8
9
|
* Kept separate from the hook so the resolution rules can be reasoned about
|
|
9
10
|
* (and tested) without React.
|
|
10
11
|
*/
|
|
11
|
-
export declare function resolveEntityTableColumns<TEntity extends Entity>(described: Array<EntityTableColumn<TEntity>>, slotColumns: Array<EntityColumnProps<TEntity>>, personalization: ColumnPersonalization, withheld?: readonly string[]): {
|
|
12
|
+
export declare function resolveEntityTableColumns<TEntity extends Entity>(described: Array<EntityTableColumn<TEntity>>, slotColumns: Array<EntityColumnProps<TEntity>>, personalization: ColumnPersonalization, withheld?: readonly string[], showKey?: boolean): {
|
|
12
13
|
columns: Array<EntityTableColumn<TEntity>>;
|
|
13
14
|
visibleColumns: Array<EntityTableColumn<TEntity>>;
|
|
14
15
|
hidden: string[];
|
|
@@ -26,5 +27,5 @@ export interface UseEntityTableColumnsResult<TEntity extends Entity> {
|
|
|
26
27
|
* Resolves the columns a table renders: entity metadata, then slot overrides,
|
|
27
28
|
* then the user's persisted layout.
|
|
28
29
|
*/
|
|
29
|
-
export declare function useEntityTableColumns<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, slotColumns: Array<EntityColumnProps<TEntity>>, sample: TEntity | undefined, preferenceKey: string, withheld?: readonly string[]): UseEntityTableColumnsResult<TEntity>;
|
|
30
|
+
export declare function useEntityTableColumns<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, slotColumns: Array<EntityColumnProps<TEntity>>, sample: TEntity | undefined, preferenceKey: string, withheld?: readonly string[], showKey?: boolean): UseEntityTableColumnsResult<TEntity>;
|
|
30
31
|
//# sourceMappingURL=use-entity-table-columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-entity-table-columns.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-entity-table-columns.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA2GjE;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,MAAM,EAC9D,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC5C,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC9C,eAAe,EAAE,qBAAqB,EACtC,QAAQ,GAAE,SAAS,MAAM,EAAkB,EAC3C,OAAO,UAAQ,GACd;IACD,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAaA;AAED,MAAM,WAAW,2BAA2B,CAAC,OAAO,SAAS,MAAM;IACjE,2EAA2E;IAC3E,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,oCAAoC;IACpC,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,qBAAqB,CAAC;IACvC,kBAAkB,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAC3D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAC7C,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC9C,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,aAAa,EAAE,MAAM,EACrB,QAAQ,GAAE,SAAS,MAAM,EAAkB,EAC3C,OAAO,UAAQ,GACd,2BAA2B,CAAC,OAAO,CAAC,CAqCtC"}
|
|
@@ -40,6 +40,8 @@ const NONE_WITHHELD = [];
|
|
|
40
40
|
resetOnClone: false
|
|
41
41
|
}, slot.minWidth === undefined ? {} : {
|
|
42
42
|
minWidth: slot.minWidth
|
|
43
|
+
}, slot.money === undefined ? {} : {
|
|
44
|
+
money: slot.money
|
|
43
45
|
}, {
|
|
44
46
|
header: slot.header,
|
|
45
47
|
render: slot.render,
|
|
@@ -78,14 +80,22 @@ const NONE_WITHHELD = [];
|
|
|
78
80
|
}
|
|
79
81
|
return columns.filter((column)=>!withheld.includes(column.name));
|
|
80
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Whether a column is the record's own key — the entity's `id`, not a
|
|
85
|
+
* reference to another record's.
|
|
86
|
+
*/ function isOwnKey(column) {
|
|
87
|
+
return column.type === 'id' && column.references === undefined;
|
|
88
|
+
}
|
|
81
89
|
/**
|
|
82
90
|
* The whole column pipeline as a pure function — metadata descriptors, then
|
|
83
|
-
* slot overrides, then what the host withholds
|
|
91
|
+
* slot overrides, then what the host withholds and the record's own key
|
|
92
|
+
* (unless `showKey`), then the user's stored layout.
|
|
84
93
|
* Kept separate from the hook so the resolution rules can be reasoned about
|
|
85
94
|
* (and tested) without React.
|
|
86
|
-
*/ export function resolveEntityTableColumns(described, slotColumns, personalization, withheld = NONE_WITHHELD) {
|
|
95
|
+
*/ export function resolveEntityTableColumns(described, slotColumns, personalization, withheld = NONE_WITHHELD, showKey = false) {
|
|
87
96
|
var _personalization_hidden;
|
|
88
|
-
const
|
|
97
|
+
const kept = withhold(mergeSlots(described, slotColumns), withheld);
|
|
98
|
+
const columns = applyOrder(showKey ? kept : kept.filter((column)=>!isOwnKey(column)), personalization.order);
|
|
89
99
|
const hidden = (_personalization_hidden = personalization.hidden) != null ? _personalization_hidden : [];
|
|
90
100
|
return {
|
|
91
101
|
columns,
|
|
@@ -96,7 +106,7 @@ const NONE_WITHHELD = [];
|
|
|
96
106
|
/**
|
|
97
107
|
* Resolves the columns a table renders: entity metadata, then slot overrides,
|
|
98
108
|
* then the user's persisted layout.
|
|
99
|
-
*/ export function useEntityTableColumns(entityConstructor, slotColumns, sample, preferenceKey, withheld = NONE_WITHHELD) {
|
|
109
|
+
*/ export function useEntityTableColumns(entityConstructor, slotColumns, sample, preferenceKey, withheld = NONE_WITHHELD, showKey = false) {
|
|
100
110
|
const { value: personalization, setValue: setPersonalization } = useUiPreference(preferenceKey, EMPTY_PERSONALIZATION);
|
|
101
111
|
const metadata = useMemo(()=>describeEntityColumns(entityConstructor, sample), [
|
|
102
112
|
entityConstructor,
|
|
@@ -108,7 +118,7 @@ const NONE_WITHHELD = [];
|
|
|
108
118
|
// Not memoized: `slotColumns` is rebuilt from `children` on every render, so
|
|
109
119
|
// any dependency list would miss every time. The work is a few array passes
|
|
110
120
|
// over a handful of columns — cheaper than the comparison would be.
|
|
111
|
-
const { columns, visibleColumns, hidden } = resolveEntityTableColumns(described, slotColumns, personalization, withheld);
|
|
121
|
+
const { columns, visibleColumns, hidden } = resolveEntityTableColumns(described, slotColumns, personalization, withheld, showKey);
|
|
112
122
|
return {
|
|
113
123
|
columns,
|
|
114
124
|
visibleColumns,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"sourcesContent":["'use client';\n\nimport {\n describeEntityColumns,\n type Entity,\n type EntityConstructor,\n} from '@entifix/core';\nimport { useMemo } from 'react';\n\nimport { useLocalizedDescriptors } from '../../../i18n/index.js';\nimport { useUiPreference } from '../../../preferences/index.js';\nimport type { ColumnPersonalization } from '../../molecules/column-settings/index.js';\nimport type { EntityTableColumn } from './entity-table.types.js';\nimport type { EntityColumnProps } from './entity-table-slots.js';\n\nconst EMPTY_PERSONALIZATION: ColumnPersonalization = {};\nconst NONE_WITHHELD: readonly string[] = [];\n\n/**\n * Applies `<EntityColumn>` overrides on top of the metadata descriptors, and\n * appends a virtual column for any slot naming a member the entity does not\n * have (a computed column).\n */\nfunction mergeSlots<TEntity extends Entity>(\n descriptors: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n): Array<EntityTableColumn<TEntity>> {\n const merged = descriptors.map(descriptor => {\n const slot = slotColumns.find(entry => entry.field === descriptor.name);\n if (!slot) return descriptor;\n const { field: _field, ...overrides } = slot;\n return {\n ...descriptor,\n ...Object.fromEntries(\n Object.entries(overrides).filter(([, value]) => value !== undefined),\n ),\n } as EntityTableColumn<TEntity>;\n });\n\n const virtual = slotColumns\n .filter(slot => !descriptors.some(entry => entry.name === slot.field))\n .map<EntityTableColumn<TEntity>>((slot, index) => ({\n name: slot.field,\n key: slot.field,\n label: slot.label ?? slot.field,\n type: slot.type ?? 'string',\n sortable: slot.sortable ?? false,\n filterable: slot.filterable ?? false,\n order: slot.order ?? descriptors.length + index,\n readonly: false,\n required: false,\n linkLabelProperty: 'name',\n linkSearchProperty: 'name',\n linkSerialization: 'id',\n // A slot-only column has no accessor, so there is nothing for a copy to\n // reset — the value is computed from members that are cloned themselves.\n resetOnClone: false,\n ...(slot.minWidth === undefined ? {} : { minWidth: slot.minWidth }),\n header: slot.header,\n render: slot.render,\n virtual: true,\n }));\n\n return [...merged, ...virtual].sort(\n (left, right) => left.order - right.order,\n );\n}\n\n/**\n * Reorders columns per the stored personalization. Names the user never saw\n * (added to the entity after the layout was saved) keep their default position\n * at the end instead of vanishing, and stale names in the stored order are\n * dropped — so a saved layout degrades rather than breaks.\n */\nfunction applyOrder<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n order: string[] | undefined,\n): Array<EntityTableColumn<TEntity>> {\n if (!order || order.length === 0) return columns;\n\n const ranked = order\n .map(name => columns.find(column => column.name === name))\n .filter((column): column is EntityTableColumn<TEntity> => !!column);\n const remaining = columns.filter(column => !order.includes(column.name));\n\n return [...ranked, ...remaining];\n}\n\n/**\n * Drops the columns the host withholds from this reader. Not a hidden column\n * the reader can bring back: it is gone from the settings, the filters, the\n * sort choices and the cards. A name that is no column throws, because a\n * withheld column that is still on screen is the failure nobody would notice.\n */\nfunction withhold<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n withheld: readonly string[],\n): Array<EntityTableColumn<TEntity>> {\n for (const name of withheld) {\n if (!columns.some(column => column.name === name)) {\n throw new Error(\n `EntityTable was asked to hide \"${name}\", which is not one of its columns. ` +\n 'Name a member the entity declares, or a column a slot adds.',\n );\n }\n }\n return columns.filter(column => !withheld.includes(column.name));\n}\n\n/**\n * The whole column pipeline as a pure function — metadata descriptors, then\n * slot overrides, then what the host withholds, then the user's stored layout.\n * Kept separate from the hook so the resolution rules can be reasoned about\n * (and tested) without React.\n */\nexport function resolveEntityTableColumns<TEntity extends Entity>(\n described: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n personalization: ColumnPersonalization,\n withheld: readonly string[] = NONE_WITHHELD,\n): {\n columns: Array<EntityTableColumn<TEntity>>;\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n} {\n const columns = applyOrder(\n withhold(mergeSlots(described, slotColumns), withheld),\n personalization.order,\n );\n const hidden = personalization.hidden ?? [];\n\n return {\n columns,\n visibleColumns: columns.filter(column => !hidden.includes(column.name)),\n hidden,\n };\n}\n\nexport interface UseEntityTableColumnsResult<TEntity extends Entity> {\n /** Every column, in the user's order — what the settings popover lists. */\n columns: Array<EntityTableColumn<TEntity>>;\n /** The subset actually rendered. */\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n personalization: ColumnPersonalization;\n setPersonalization: (next: ColumnPersonalization) => void;\n}\n\n/**\n * Resolves the columns a table renders: entity metadata, then slot overrides,\n * then the user's persisted layout.\n */\nexport function useEntityTableColumns<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n sample: TEntity | undefined,\n preferenceKey: string,\n withheld: readonly string[] = NONE_WITHHELD,\n): UseEntityTableColumnsResult<TEntity> {\n const { value: personalization, setValue: setPersonalization } =\n useUiPreference<ColumnPersonalization>(\n preferenceKey,\n EMPTY_PERSONALIZATION,\n );\n\n const metadata = useMemo(\n () =>\n describeEntityColumns(entityConstructor, sample) as Array<\n EntityTableColumn<TEntity>\n >,\n [entityConstructor, sample],\n );\n\n // Before slots merge, so an `<EntityColumn label>` override still wins over\n // the entity's own translated label.\n const described = useLocalizedDescriptors(metadata);\n\n // Not memoized: `slotColumns` is rebuilt from `children` on every render, so\n // any dependency list would miss every time. The work is a few array passes\n // over a handful of columns — cheaper than the comparison would be.\n const { columns, visibleColumns, hidden } = resolveEntityTableColumns(\n described,\n slotColumns,\n personalization,\n withheld,\n );\n\n return {\n columns,\n visibleColumns,\n hidden,\n personalization,\n setPersonalization,\n };\n}\n"],"names":["describeEntityColumns","useMemo","useLocalizedDescriptors","useUiPreference","EMPTY_PERSONALIZATION","NONE_WITHHELD","mergeSlots","descriptors","slotColumns","merged","map","descriptor","slot","find","entry","field","name","_field","overrides","Object","fromEntries","entries","filter","value","undefined","virtual","some","index","key","label","type","sortable","filterable","order","length","readonly","required","linkLabelProperty","linkSearchProperty","linkSerialization","resetOnClone","minWidth","header","render","sort","left","right","applyOrder","columns","ranked","column","remaining","includes","withhold","withheld","Error","resolveEntityTableColumns","described","personalization","hidden","visibleColumns","useEntityTableColumns","entityConstructor","sample","preferenceKey","setValue","setPersonalization","metadata"],"mappings":"AAAA;;;AAEA,SACEA,qBAAqB,QAGhB,gBAAgB;AACvB,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,eAAe,QAAQ,gCAAgC;AAKhE,MAAMC,wBAA+C,CAAC;AACtD,MAAMC,gBAAmC,EAAE;AAE3C;;;;CAIC,GACD,SAASC,WACPC,WAA8C,EAC9CC,WAA8C;IAE9C,MAAMC,SAASF,YAAYG,GAAG,CAACC,CAAAA;QAC7B,MAAMC,OAAOJ,YAAYK,IAAI,CAACC,CAAAA,QAASA,MAAMC,KAAK,KAAKJ,WAAWK,IAAI;QACtE,IAAI,CAACJ,MAAM,OAAOD;QAClB,MAAM,EAAEI,OAAOE,MAAM,EAAgB,GAAGL,MAAdM,6CAAcN;;;QACxC,OAAO,aACFD,YACAQ,OAAOC,WAAW,CACnBD,OAAOE,OAAO,CAACH,WAAWI,MAAM,CAAC,CAAC,GAAGC,MAAM,GAAKA,UAAUC;IAGhE;IAEA,MAAMC,UAAUjB,YACbc,MAAM,CAACV,CAAAA,OAAQ,CAACL,YAAYmB,IAAI,CAACZ,CAAAA,QAASA,MAAME,IAAI,KAAKJ,KAAKG,KAAK,GACnEL,GAAG,CAA6B,CAACE,MAAMe;YAG/Bf,aACDA,YACIA,gBACEA,kBACLA;eAP0C;YACjDI,MAAMJ,KAAKG,KAAK;YAChBa,KAAKhB,KAAKG,KAAK;YACfc,KAAK,GAAEjB,cAAAA,KAAKiB,KAAK,YAAVjB,cAAcA,KAAKG,KAAK;YAC/Be,IAAI,GAAElB,aAAAA,KAAKkB,IAAI,YAATlB,aAAa;YACnBmB,QAAQ,GAAEnB,iBAAAA,KAAKmB,QAAQ,YAAbnB,iBAAiB;YAC3BoB,UAAU,GAAEpB,mBAAAA,KAAKoB,UAAU,YAAfpB,mBAAmB;YAC/Bq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,OAAOlC,IAAI;AAChE;AAEA;;;;;CAKC,GACD,OAAO,SAASwC,0BACdC,SAA4C,EAC5CjD,WAA8C,EAC9CkD,eAAsC,EACtCJ,WAA8BjD,aAAa;QAU5BqD;IAJf,MAAMV,UAAUD,WACdM,SAAS/C,WAAWmD,WAAWjD,cAAc8C,WAC7CI,gBAAgBzB,KAAK;IAEvB,MAAM0B,UAASD,0BAAAA,gBAAgBC,MAAM,YAAtBD,0BAA0B,EAAE;IAE3C,OAAO;QACLV;QACAY,gBAAgBZ,QAAQ1B,MAAM,CAAC4B,CAAAA,SAAU,CAACS,OAAOP,QAAQ,CAACF,OAAOlC,IAAI;QACrE2C;IACF;AACF;AAYA;;;CAGC,GACD,OAAO,SAASE,sBACdC,iBAA6C,EAC7CtD,WAA8C,EAC9CuD,MAA2B,EAC3BC,aAAqB,EACrBV,WAA8BjD,aAAa;IAE3C,MAAM,EAAEkB,OAAOmC,eAAe,EAAEO,UAAUC,kBAAkB,EAAE,GAC5D/D,gBACE6D,eACA5D;IAGJ,MAAM+D,WAAWlE,QACf,IACED,sBAAsB8D,mBAAmBC,SAG3C;QAACD;QAAmBC;KAAO;IAG7B,4EAA4E;IAC5E,qCAAqC;IACrC,MAAMN,YAAYvD,wBAAwBiE;IAE1C,6EAA6E;IAC7E,4EAA4E;IAC5E,oEAAoE;IACpE,MAAM,EAAEnB,OAAO,EAAEY,cAAc,EAAED,MAAM,EAAE,GAAGH,0BAC1CC,WACAjD,aACAkD,iBACAJ;IAGF,OAAO;QACLN;QACAY;QACAD;QACAD;QACAQ;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/use-entity-table-columns.ts"],"sourcesContent":["'use client';\n\nimport {\n describeEntityColumns,\n type Entity,\n type EntityConstructor,\n} from '@entifix/core';\nimport { useMemo } from 'react';\n\nimport { useLocalizedDescriptors } from '../../../i18n/index.js';\nimport { useUiPreference } from '../../../preferences/index.js';\nimport type { ColumnPersonalization } from '../../molecules/column-settings/index.js';\nimport type { EntityTableColumn } from './entity-table.types.js';\nimport type { EntityColumnProps } from './entity-table-slots.js';\n\nconst EMPTY_PERSONALIZATION: ColumnPersonalization = {};\nconst NONE_WITHHELD: readonly string[] = [];\n\n/**\n * Applies `<EntityColumn>` overrides on top of the metadata descriptors, and\n * appends a virtual column for any slot naming a member the entity does not\n * have (a computed column).\n */\nfunction mergeSlots<TEntity extends Entity>(\n descriptors: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n): Array<EntityTableColumn<TEntity>> {\n const merged = descriptors.map(descriptor => {\n const slot = slotColumns.find(entry => entry.field === descriptor.name);\n if (!slot) return descriptor;\n const { field: _field, ...overrides } = slot;\n return {\n ...descriptor,\n ...Object.fromEntries(\n Object.entries(overrides).filter(([, value]) => value !== undefined),\n ),\n } as EntityTableColumn<TEntity>;\n });\n\n const virtual = slotColumns\n .filter(slot => !descriptors.some(entry => entry.name === slot.field))\n .map<EntityTableColumn<TEntity>>((slot, index) => ({\n name: slot.field,\n key: slot.field,\n label: slot.label ?? slot.field,\n type: slot.type ?? 'string',\n sortable: slot.sortable ?? false,\n filterable: slot.filterable ?? false,\n order: slot.order ?? descriptors.length + index,\n readonly: false,\n required: false,\n linkLabelProperty: 'name',\n linkSearchProperty: 'name',\n linkSerialization: 'id',\n // A slot-only column has no accessor, so there is nothing for a copy to\n // reset — the value is computed from members that are cloned themselves.\n resetOnClone: false,\n ...(slot.minWidth === undefined ? {} : { minWidth: slot.minWidth }),\n ...(slot.money === undefined ? {} : { money: slot.money }),\n header: slot.header,\n render: slot.render,\n virtual: true,\n }));\n\n return [...merged, ...virtual].sort(\n (left, right) => left.order - right.order,\n );\n}\n\n/**\n * Reorders columns per the stored personalization. Names the user never saw\n * (added to the entity after the layout was saved) keep their default position\n * at the end instead of vanishing, and stale names in the stored order are\n * dropped — so a saved layout degrades rather than breaks.\n */\nfunction applyOrder<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n order: string[] | undefined,\n): Array<EntityTableColumn<TEntity>> {\n if (!order || order.length === 0) return columns;\n\n const ranked = order\n .map(name => columns.find(column => column.name === name))\n .filter((column): column is EntityTableColumn<TEntity> => !!column);\n const remaining = columns.filter(column => !order.includes(column.name));\n\n return [...ranked, ...remaining];\n}\n\n/**\n * Drops the columns the host withholds from this reader. Not a hidden column\n * the reader can bring back: it is gone from the settings, the filters, the\n * sort choices and the cards. A name that is no column throws, because a\n * withheld column that is still on screen is the failure nobody would notice.\n */\nfunction withhold<TEntity extends Entity>(\n columns: Array<EntityTableColumn<TEntity>>,\n withheld: readonly string[],\n): Array<EntityTableColumn<TEntity>> {\n for (const name of withheld) {\n if (!columns.some(column => column.name === name)) {\n throw new Error(\n `EntityTable was asked to hide \"${name}\", which is not one of its columns. ` +\n 'Name a member the entity declares, or a column a slot adds.',\n );\n }\n }\n return columns.filter(column => !withheld.includes(column.name));\n}\n\n/**\n * Whether a column is the record's own key — the entity's `id`, not a\n * reference to another record's.\n */\nfunction isOwnKey<TEntity extends Entity>(\n column: EntityTableColumn<TEntity>,\n): boolean {\n return column.type === 'id' && column.references === undefined;\n}\n\n/**\n * The whole column pipeline as a pure function — metadata descriptors, then\n * slot overrides, then what the host withholds and the record's own key\n * (unless `showKey`), then the user's stored layout.\n * Kept separate from the hook so the resolution rules can be reasoned about\n * (and tested) without React.\n */\nexport function resolveEntityTableColumns<TEntity extends Entity>(\n described: Array<EntityTableColumn<TEntity>>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n personalization: ColumnPersonalization,\n withheld: readonly string[] = NONE_WITHHELD,\n showKey = false,\n): {\n columns: Array<EntityTableColumn<TEntity>>;\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n} {\n const kept = withhold(mergeSlots(described, slotColumns), withheld);\n const columns = applyOrder(\n showKey ? kept : kept.filter(column => !isOwnKey(column)),\n personalization.order,\n );\n const hidden = personalization.hidden ?? [];\n\n return {\n columns,\n visibleColumns: columns.filter(column => !hidden.includes(column.name)),\n hidden,\n };\n}\n\nexport interface UseEntityTableColumnsResult<TEntity extends Entity> {\n /** Every column, in the user's order — what the settings popover lists. */\n columns: Array<EntityTableColumn<TEntity>>;\n /** The subset actually rendered. */\n visibleColumns: Array<EntityTableColumn<TEntity>>;\n hidden: string[];\n personalization: ColumnPersonalization;\n setPersonalization: (next: ColumnPersonalization) => void;\n}\n\n/**\n * Resolves the columns a table renders: entity metadata, then slot overrides,\n * then the user's persisted layout.\n */\nexport function useEntityTableColumns<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n slotColumns: Array<EntityColumnProps<TEntity>>,\n sample: TEntity | undefined,\n preferenceKey: string,\n withheld: readonly string[] = NONE_WITHHELD,\n showKey = false,\n): UseEntityTableColumnsResult<TEntity> {\n const { value: personalization, setValue: setPersonalization } =\n useUiPreference<ColumnPersonalization>(\n preferenceKey,\n EMPTY_PERSONALIZATION,\n );\n\n const metadata = useMemo(\n () =>\n describeEntityColumns(entityConstructor, sample) as Array<\n EntityTableColumn<TEntity>\n >,\n [entityConstructor, sample],\n );\n\n // Before slots merge, so an `<EntityColumn label>` override still wins over\n // the entity's own translated label.\n const described = useLocalizedDescriptors(metadata);\n\n // Not memoized: `slotColumns` is rebuilt from `children` on every render, so\n // any dependency list would miss every time. The work is a few array passes\n // over a handful of columns — cheaper than the comparison would be.\n const { columns, visibleColumns, hidden } = resolveEntityTableColumns(\n described,\n slotColumns,\n personalization,\n withheld,\n showKey,\n );\n\n return {\n columns,\n visibleColumns,\n hidden,\n personalization,\n setPersonalization,\n };\n}\n"],"names":["describeEntityColumns","useMemo","useLocalizedDescriptors","useUiPreference","EMPTY_PERSONALIZATION","NONE_WITHHELD","mergeSlots","descriptors","slotColumns","merged","map","descriptor","slot","find","entry","field","name","_field","overrides","Object","fromEntries","entries","filter","value","undefined","virtual","some","index","key","label","type","sortable","filterable","order","length","readonly","required","linkLabelProperty","linkSearchProperty","linkSerialization","resetOnClone","minWidth","money","header","render","sort","left","right","applyOrder","columns","ranked","column","remaining","includes","withhold","withheld","Error","isOwnKey","references","resolveEntityTableColumns","described","personalization","showKey","kept","hidden","visibleColumns","useEntityTableColumns","entityConstructor","sample","preferenceKey","setValue","setPersonalization","metadata"],"mappings":"AAAA;;;AAEA,SACEA,qBAAqB,QAGhB,gBAAgB;AACvB,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,eAAe,QAAQ,gCAAgC;AAKhE,MAAMC,wBAA+C,CAAC;AACtD,MAAMC,gBAAmC,EAAE;AAE3C;;;;CAIC,GACD,SAASC,WACPC,WAA8C,EAC9CC,WAA8C;IAE9C,MAAMC,SAASF,YAAYG,GAAG,CAACC,CAAAA;QAC7B,MAAMC,OAAOJ,YAAYK,IAAI,CAACC,CAAAA,QAASA,MAAMC,KAAK,KAAKJ,WAAWK,IAAI;QACtE,IAAI,CAACJ,MAAM,OAAOD;QAClB,MAAM,EAAEI,OAAOE,MAAM,EAAgB,GAAGL,MAAdM,6CAAcN;;;QACxC,OAAO,aACFD,YACAQ,OAAOC,WAAW,CACnBD,OAAOE,OAAO,CAACH,WAAWI,MAAM,CAAC,CAAC,GAAGC,MAAM,GAAKA,UAAUC;IAGhE;IAEA,MAAMC,UAAUjB,YACbc,MAAM,CAACV,CAAAA,OAAQ,CAACL,YAAYmB,IAAI,CAACZ,CAAAA,QAASA,MAAME,IAAI,KAAKJ,KAAKG,KAAK,GACnEL,GAAG,CAA6B,CAACE,MAAMe;YAG/Bf,aACDA,YACIA,gBACEA,kBACLA;eAP0C;YACjDI,MAAMJ,KAAKG,KAAK;YAChBa,KAAKhB,KAAKG,KAAK;YACfc,KAAK,GAAEjB,cAAAA,KAAKiB,KAAK,YAAVjB,cAAcA,KAAKG,KAAK;YAC/Be,IAAI,GAAElB,aAAAA,KAAKkB,IAAI,YAATlB,aAAa;YACnBmB,QAAQ,GAAEnB,iBAAAA,KAAKmB,QAAQ,YAAbn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M,EAAEvB,OAAO,EAAEgB,cAAc,EAAED,MAAM,EAAE,GAAGL,0BAC1CC,WACApD,aACAqD,iBACAN,UACAO;IAGF,OAAO;QACLb;QACAgB;QACAD;QACAH;QACAU;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/react-controls",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.4",
|
|
4
4
|
"description": "Entity-agnostic React UI — table, form, filters, wizard, command palette — rendered from entity metadata, plus layout primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@headlessui/react": "^2.2.10",
|
|
20
20
|
"class-variance-authority": "^0.7.1",
|
|
21
21
|
"idb": "^8.0.4",
|
|
22
|
-
"@entifix/core": "0.22.
|
|
22
|
+
"@entifix/core": "0.22.4"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"react": "19.3.1",
|
|
56
56
|
"react-i18next": "17.1.10",
|
|
57
57
|
"storybook": "^10.6.6",
|
|
58
|
-
"@entifix/i18n": "0.22.
|
|
59
|
-
"@entifix/style": "0.22.
|
|
58
|
+
"@entifix/i18n": "0.22.4",
|
|
59
|
+
"@entifix/style": "0.22.4"
|
|
60
60
|
},
|
|
61
61
|
"nx": {
|
|
62
62
|
"tags": [
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"i18next": ">=26 <27",
|
|
112
112
|
"react": ">=19 <20",
|
|
113
113
|
"react-i18next": ">=17 <18",
|
|
114
|
-
"@entifix/i18n": "0.22.
|
|
114
|
+
"@entifix/i18n": "0.22.4"
|
|
115
115
|
},
|
|
116
116
|
"peerDependenciesMeta": {
|
|
117
117
|
"@entifix/i18n": {
|