@entifix/react-controls 0.1.0-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/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/i18n/catalog/en.d.ts +10 -0
- package/dist/i18n/catalog/en.d.ts.map +1 -0
- package/dist/i18n/catalog/en.js +211 -0
- package/dist/i18n/catalog/en.js.map +1 -0
- package/dist/i18n/catalog/es.d.ts +275 -0
- package/dist/i18n/catalog/es.d.ts.map +1 -0
- package/dist/i18n/catalog/es.js +261 -0
- package/dist/i18n/catalog/es.js.map +1 -0
- package/dist/i18n/catalog/index.d.ts +403 -0
- package/dist/i18n/catalog/index.d.ts.map +1 -0
- package/dist/i18n/catalog/index.js +23 -0
- package/dist/i18n/catalog/index.js.map +1 -0
- package/dist/i18n/entity-labels.d.ts +29 -0
- package/dist/i18n/entity-labels.d.ts.map +1 -0
- package/dist/i18n/entity-labels.js +49 -0
- package/dist/i18n/entity-labels.js.map +1 -0
- package/dist/i18n/fallback-catalogs.d.ts +5 -0
- package/dist/i18n/fallback-catalogs.d.ts.map +1 -0
- package/dist/i18n/fallback-catalogs.js +34 -0
- package/dist/i18n/fallback-catalogs.js.map +1 -0
- package/dist/i18n/i18n-context.d.ts +62 -0
- package/dist/i18n/i18n-context.d.ts.map +1 -0
- package/dist/i18n/i18n-context.js +128 -0
- package/dist/i18n/i18n-context.js.map +1 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/spec-support/catalogs.d.ts +2 -0
- package/dist/i18n/spec-support/catalogs.d.ts.map +1 -0
- package/dist/i18n/spec-support/catalogs.js +142 -0
- package/dist/i18n/spec-support/catalogs.js.map +1 -0
- package/dist/i18next/index.d.ts +20 -0
- package/dist/i18next/index.d.ts.map +1 -0
- package/dist/i18next/index.js +60 -0
- package/dist/i18next/index.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/preferences/index.d.ts +7 -0
- package/dist/preferences/index.d.ts.map +1 -0
- package/dist/preferences/index.js +8 -0
- package/dist/preferences/index.js.map +1 -0
- package/dist/preferences/indexeddb-ui-preferences-state.d.ts +16 -0
- package/dist/preferences/indexeddb-ui-preferences-state.d.ts.map +1 -0
- package/dist/preferences/indexeddb-ui-preferences-state.js +50 -0
- package/dist/preferences/indexeddb-ui-preferences-state.js.map +1 -0
- package/dist/preferences/local-storage-ui-preferences-state.d.ts +16 -0
- package/dist/preferences/local-storage-ui-preferences-state.d.ts.map +1 -0
- package/dist/preferences/local-storage-ui-preferences-state.js +51 -0
- package/dist/preferences/local-storage-ui-preferences-state.js.map +1 -0
- package/dist/preferences/ui-preferences-context.d.ts +16 -0
- package/dist/preferences/ui-preferences-context.d.ts.map +1 -0
- package/dist/preferences/ui-preferences-context.js +31 -0
- package/dist/preferences/ui-preferences-context.js.map +1 -0
- package/dist/preferences/ui-preferences-state.d.ts +23 -0
- package/dist/preferences/ui-preferences-state.d.ts.map +1 -0
- package/dist/preferences/ui-preferences-state.js +5 -0
- package/dist/preferences/ui-preferences-state.js.map +1 -0
- package/dist/preferences/use-ui-preference.d.ts +20 -0
- package/dist/preferences/use-ui-preference.d.ts.map +1 -0
- package/dist/preferences/use-ui-preference.js +72 -0
- package/dist/preferences/use-ui-preference.js.map +1 -0
- package/dist/preferences/use-viewport-mode.d.ts +33 -0
- package/dist/preferences/use-viewport-mode.d.ts.map +1 -0
- package/dist/preferences/use-viewport-mode.js +53 -0
- package/dist/preferences/use-viewport-mode.js.map +1 -0
- package/dist/primitives.d.ts +25 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +54 -0
- package/dist/primitives.js.map +1 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-context.d.ts +26 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +79 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/types.d.ts +22 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +6 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/ui/actions/action-surfaces.d.ts +59 -0
- package/dist/ui/actions/action-surfaces.d.ts.map +1 -0
- package/dist/ui/actions/action-surfaces.js +109 -0
- package/dist/ui/actions/action-surfaces.js.map +1 -0
- package/dist/ui/actions/index.d.ts +2 -0
- package/dist/ui/actions/index.d.ts.map +1 -0
- package/dist/ui/actions/index.js +3 -0
- package/dist/ui/actions/index.js.map +1 -0
- package/dist/ui/atoms/button/button-link.d.ts +27 -0
- package/dist/ui/atoms/button/button-link.d.ts.map +1 -0
- package/dist/ui/atoms/button/button-link.js +23 -0
- package/dist/ui/atoms/button/button-link.js.map +1 -0
- package/dist/ui/atoms/button/button-recipe.d.ts +19 -0
- package/dist/ui/atoms/button/button-recipe.d.ts.map +1 -0
- package/dist/ui/atoms/button/button-recipe.js +42 -0
- package/dist/ui/atoms/button/button-recipe.js.map +1 -0
- package/dist/ui/atoms/button/button.d.ts +7 -0
- package/dist/ui/atoms/button/button.d.ts.map +1 -0
- package/dist/ui/atoms/button/button.js +22 -0
- package/dist/ui/atoms/button/button.js.map +1 -0
- package/dist/ui/atoms/button/index.d.ts +4 -0
- package/dist/ui/atoms/button/index.d.ts.map +1 -0
- package/dist/ui/atoms/button/index.js +5 -0
- package/dist/ui/atoms/button/index.js.map +1 -0
- package/dist/ui/atoms/cell-value/cell-value.d.ts +12 -0
- package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -0
- package/dist/ui/atoms/cell-value/cell-value.js +101 -0
- package/dist/ui/atoms/cell-value/cell-value.js.map +1 -0
- package/dist/ui/atoms/cell-value/index.d.ts +2 -0
- package/dist/ui/atoms/cell-value/index.d.ts.map +1 -0
- package/dist/ui/atoms/cell-value/index.js +3 -0
- package/dist/ui/atoms/cell-value/index.js.map +1 -0
- package/dist/ui/atoms/field/checkbox.d.ts +35 -0
- package/dist/ui/atoms/field/checkbox.d.ts.map +1 -0
- package/dist/ui/atoms/field/checkbox.js +46 -0
- package/dist/ui/atoms/field/checkbox.js.map +1 -0
- package/dist/ui/atoms/field/field.d.ts +4 -0
- package/dist/ui/atoms/field/field.d.ts.map +1 -0
- package/dist/ui/atoms/field/field.js +29 -0
- package/dist/ui/atoms/field/field.js.map +1 -0
- package/dist/ui/atoms/field/index.d.ts +3 -0
- package/dist/ui/atoms/field/index.d.ts.map +1 -0
- package/dist/ui/atoms/field/index.js +4 -0
- package/dist/ui/atoms/field/index.js.map +1 -0
- package/dist/ui/atoms/field-control/field-control.d.ts +50 -0
- package/dist/ui/atoms/field-control/field-control.d.ts.map +1 -0
- package/dist/ui/atoms/field-control/field-control.js +82 -0
- package/dist/ui/atoms/field-control/field-control.js.map +1 -0
- package/dist/ui/atoms/field-control/index.d.ts +2 -0
- package/dist/ui/atoms/field-control/index.d.ts.map +1 -0
- package/dist/ui/atoms/field-control/index.js +3 -0
- package/dist/ui/atoms/field-control/index.js.map +1 -0
- package/dist/ui/atoms/skeleton/index.d.ts +2 -0
- package/dist/ui/atoms/skeleton/index.d.ts.map +1 -0
- package/dist/ui/atoms/skeleton/index.js +3 -0
- package/dist/ui/atoms/skeleton/index.js.map +1 -0
- package/dist/ui/atoms/skeleton/skeleton.d.ts +21 -0
- package/dist/ui/atoms/skeleton/skeleton.d.ts.map +1 -0
- package/dist/ui/atoms/skeleton/skeleton.js +33 -0
- package/dist/ui/atoms/skeleton/skeleton.js.map +1 -0
- package/dist/ui/atoms/table/index.d.ts +2 -0
- package/dist/ui/atoms/table/index.d.ts.map +1 -0
- package/dist/ui/atoms/table/index.js +3 -0
- package/dist/ui/atoms/table/index.js.map +1 -0
- package/dist/ui/atoms/table/table.d.ts +30 -0
- package/dist/ui/atoms/table/table.d.ts.map +1 -0
- package/dist/ui/atoms/table/table.js +84 -0
- package/dist/ui/atoms/table/table.js.map +1 -0
- package/dist/ui/atoms/text/index.d.ts +2 -0
- package/dist/ui/atoms/text/index.d.ts.map +1 -0
- package/dist/ui/atoms/text/index.js +3 -0
- package/dist/ui/atoms/text/index.js.map +1 -0
- package/dist/ui/atoms/text/text.d.ts +86 -0
- package/dist/ui/atoms/text/text.d.ts.map +1 -0
- package/dist/ui/atoms/text/text.js +221 -0
- package/dist/ui/atoms/text/text.js.map +1 -0
- package/dist/ui/layout/_demo.d.ts +6 -0
- package/dist/ui/layout/_demo.d.ts.map +1 -0
- package/dist/ui/layout/_demo.js +11 -0
- package/dist/ui/layout/_demo.js.map +1 -0
- package/dist/ui/layout/_shared.d.ts +9 -0
- package/dist/ui/layout/_shared.d.ts.map +1 -0
- package/dist/ui/layout/_shared.js +30 -0
- package/dist/ui/layout/_shared.js.map +1 -0
- package/dist/ui/layout/box/box.d.ts +10 -0
- package/dist/ui/layout/box/box.d.ts.map +1 -0
- package/dist/ui/layout/box/box.js +28 -0
- package/dist/ui/layout/box/box.js.map +1 -0
- package/dist/ui/layout/box/index.d.ts +2 -0
- package/dist/ui/layout/box/index.d.ts.map +1 -0
- package/dist/ui/layout/box/index.js +3 -0
- package/dist/ui/layout/box/index.js.map +1 -0
- package/dist/ui/layout/center/center.d.ts +13 -0
- package/dist/ui/layout/center/center.d.ts.map +1 -0
- package/dist/ui/layout/center/center.js +22 -0
- package/dist/ui/layout/center/center.js.map +1 -0
- package/dist/ui/layout/center/index.d.ts +2 -0
- package/dist/ui/layout/center/index.d.ts.map +1 -0
- package/dist/ui/layout/center/index.js +3 -0
- package/dist/ui/layout/center/index.js.map +1 -0
- package/dist/ui/layout/cluster/cluster.d.ts +11 -0
- package/dist/ui/layout/cluster/cluster.d.ts.map +1 -0
- package/dist/ui/layout/cluster/cluster.js +19 -0
- package/dist/ui/layout/cluster/cluster.js.map +1 -0
- package/dist/ui/layout/cluster/index.d.ts +2 -0
- package/dist/ui/layout/cluster/index.d.ts.map +1 -0
- package/dist/ui/layout/cluster/index.js +3 -0
- package/dist/ui/layout/cluster/index.js.map +1 -0
- package/dist/ui/layout/cover/cover.d.ts +26 -0
- package/dist/ui/layout/cover/cover.d.ts.map +1 -0
- package/dist/ui/layout/cover/cover.js +57 -0
- package/dist/ui/layout/cover/cover.js.map +1 -0
- package/dist/ui/layout/cover/index.d.ts +2 -0
- package/dist/ui/layout/cover/index.d.ts.map +1 -0
- package/dist/ui/layout/cover/index.js +3 -0
- package/dist/ui/layout/cover/index.js.map +1 -0
- package/dist/ui/layout/grid/grid.d.ts +14 -0
- package/dist/ui/layout/grid/grid.d.ts.map +1 -0
- package/dist/ui/layout/grid/grid.js +25 -0
- package/dist/ui/layout/grid/grid.js.map +1 -0
- package/dist/ui/layout/grid/index.d.ts +2 -0
- package/dist/ui/layout/grid/index.d.ts.map +1 -0
- package/dist/ui/layout/grid/index.js +3 -0
- package/dist/ui/layout/grid/index.js.map +1 -0
- package/dist/ui/layout/sidebar/index.d.ts +2 -0
- package/dist/ui/layout/sidebar/index.d.ts.map +1 -0
- package/dist/ui/layout/sidebar/index.js +3 -0
- package/dist/ui/layout/sidebar/index.js.map +1 -0
- package/dist/ui/layout/sidebar/sidebar.d.ts +33 -0
- package/dist/ui/layout/sidebar/sidebar.d.ts.map +1 -0
- package/dist/ui/layout/sidebar/sidebar.js +54 -0
- package/dist/ui/layout/sidebar/sidebar.js.map +1 -0
- package/dist/ui/layout/switcher/index.d.ts +2 -0
- package/dist/ui/layout/switcher/index.d.ts.map +1 -0
- package/dist/ui/layout/switcher/index.js +3 -0
- package/dist/ui/layout/switcher/index.js.map +1 -0
- package/dist/ui/layout/switcher/switcher.d.ts +15 -0
- package/dist/ui/layout/switcher/switcher.d.ts.map +1 -0
- package/dist/ui/layout/switcher/switcher.js +26 -0
- package/dist/ui/layout/switcher/switcher.js.map +1 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts +27 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.js +50 -0
- package/dist/ui/molecules/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/ui/molecules/breadcrumbs/index.d.ts +2 -0
- package/dist/ui/molecules/breadcrumbs/index.d.ts.map +1 -0
- package/dist/ui/molecules/breadcrumbs/index.js +3 -0
- package/dist/ui/molecules/breadcrumbs/index.js.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts +47 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js +63 -0
- package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/index.d.ts +2 -0
- package/dist/ui/molecules/bulk-action-bar/index.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-action-bar/index.js +3 -0
- package/dist/ui/molecules/bulk-action-bar/index.js.map +1 -0
- package/dist/ui/molecules/bulk-result/bulk-result.d.ts +31 -0
- package/dist/ui/molecules/bulk-result/bulk-result.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-result/bulk-result.js +86 -0
- package/dist/ui/molecules/bulk-result/bulk-result.js.map +1 -0
- package/dist/ui/molecules/bulk-result/index.d.ts +2 -0
- package/dist/ui/molecules/bulk-result/index.d.ts.map +1 -0
- package/dist/ui/molecules/bulk-result/index.js +3 -0
- package/dist/ui/molecules/bulk-result/index.js.map +1 -0
- package/dist/ui/molecules/card/card.d.ts +5 -0
- package/dist/ui/molecules/card/card.d.ts.map +1 -0
- package/dist/ui/molecules/card/card.js +14 -0
- package/dist/ui/molecules/card/card.js.map +1 -0
- package/dist/ui/molecules/card/index.d.ts +2 -0
- package/dist/ui/molecules/card/index.d.ts.map +1 -0
- package/dist/ui/molecules/card/index.js +3 -0
- package/dist/ui/molecules/card/index.js.map +1 -0
- package/dist/ui/molecules/column-settings/column-settings.d.ts +29 -0
- package/dist/ui/molecules/column-settings/column-settings.d.ts.map +1 -0
- package/dist/ui/molecules/column-settings/column-settings.js +117 -0
- package/dist/ui/molecules/column-settings/column-settings.js.map +1 -0
- package/dist/ui/molecules/column-settings/index.d.ts +2 -0
- package/dist/ui/molecules/column-settings/index.d.ts.map +1 -0
- package/dist/ui/molecules/column-settings/index.js +3 -0
- package/dist/ui/molecules/column-settings/index.js.map +1 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts +31 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts.map +1 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.js +68 -0
- package/dist/ui/molecules/confirm-dialog/confirm-dialog.js.map +1 -0
- package/dist/ui/molecules/confirm-dialog/index.d.ts +2 -0
- package/dist/ui/molecules/confirm-dialog/index.d.ts.map +1 -0
- package/dist/ui/molecules/confirm-dialog/index.js +3 -0
- package/dist/ui/molecules/confirm-dialog/index.js.map +1 -0
- package/dist/ui/molecules/drawer/drawer.d.ts +25 -0
- package/dist/ui/molecules/drawer/drawer.d.ts.map +1 -0
- package/dist/ui/molecules/drawer/drawer.js +60 -0
- package/dist/ui/molecules/drawer/drawer.js.map +1 -0
- package/dist/ui/molecules/drawer/index.d.ts +2 -0
- package/dist/ui/molecules/drawer/index.d.ts.map +1 -0
- package/dist/ui/molecules/drawer/index.js +3 -0
- package/dist/ui/molecules/drawer/index.js.map +1 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts +36 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.js +191 -0
- package/dist/ui/molecules/entity-link-input/entity-link-input.js.map +1 -0
- package/dist/ui/molecules/entity-link-input/index.d.ts +2 -0
- package/dist/ui/molecules/entity-link-input/index.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-input/index.js +3 -0
- package/dist/ui/molecules/entity-link-input/index.js.map +1 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts +19 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.js +78 -0
- package/dist/ui/molecules/entity-link-picker/entity-link-picker.js.map +1 -0
- package/dist/ui/molecules/entity-link-picker/index.d.ts +2 -0
- package/dist/ui/molecules/entity-link-picker/index.d.ts.map +1 -0
- package/dist/ui/molecules/entity-link-picker/index.js +3 -0
- package/dist/ui/molecules/entity-link-picker/index.js.map +1 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts +30 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts.map +1 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.js +39 -0
- package/dist/ui/molecules/entity-record-card/entity-record-card.js.map +1 -0
- package/dist/ui/molecules/entity-record-card/index.d.ts +2 -0
- package/dist/ui/molecules/entity-record-card/index.d.ts.map +1 -0
- package/dist/ui/molecules/entity-record-card/index.js +3 -0
- package/dist/ui/molecules/entity-record-card/index.js.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-builder.d.ts +19 -0
- package/dist/ui/molecules/filter-builder/filter-builder.d.ts.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-builder.js +333 -0
- package/dist/ui/molecules/filter-builder/filter-builder.js.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-operators.d.ts +20 -0
- package/dist/ui/molecules/filter-builder/filter-operators.d.ts.map +1 -0
- package/dist/ui/molecules/filter-builder/filter-operators.js +56 -0
- package/dist/ui/molecules/filter-builder/filter-operators.js.map +1 -0
- package/dist/ui/molecules/filter-builder/index.d.ts +3 -0
- package/dist/ui/molecules/filter-builder/index.d.ts.map +1 -0
- package/dist/ui/molecules/filter-builder/index.js +4 -0
- package/dist/ui/molecules/filter-builder/index.js.map +1 -0
- package/dist/ui/molecules/loading-boundary/index.d.ts +2 -0
- package/dist/ui/molecules/loading-boundary/index.d.ts.map +1 -0
- package/dist/ui/molecules/loading-boundary/index.js +3 -0
- package/dist/ui/molecules/loading-boundary/index.js.map +1 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts +27 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts.map +1 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.js +42 -0
- package/dist/ui/molecules/loading-boundary/loading-boundary.js.map +1 -0
- package/dist/ui/molecules/menu/index.d.ts +2 -0
- package/dist/ui/molecules/menu/index.d.ts.map +1 -0
- package/dist/ui/molecules/menu/index.js +3 -0
- package/dist/ui/molecules/menu/index.js.map +1 -0
- package/dist/ui/molecules/menu/menu.d.ts +37 -0
- package/dist/ui/molecules/menu/menu.d.ts.map +1 -0
- package/dist/ui/molecules/menu/menu.js +71 -0
- package/dist/ui/molecules/menu/menu.js.map +1 -0
- package/dist/ui/molecules/pagination/index.d.ts +2 -0
- package/dist/ui/molecules/pagination/index.d.ts.map +1 -0
- package/dist/ui/molecules/pagination/index.js +3 -0
- package/dist/ui/molecules/pagination/index.js.map +1 -0
- package/dist/ui/molecules/pagination/pagination.d.ts +13 -0
- package/dist/ui/molecules/pagination/pagination.d.ts.map +1 -0
- package/dist/ui/molecules/pagination/pagination.js +68 -0
- package/dist/ui/molecules/pagination/pagination.js.map +1 -0
- package/dist/ui/molecules/sort-builder/index.d.ts +2 -0
- package/dist/ui/molecules/sort-builder/index.d.ts.map +1 -0
- package/dist/ui/molecules/sort-builder/index.js +3 -0
- package/dist/ui/molecules/sort-builder/index.js.map +1 -0
- package/dist/ui/molecules/sort-builder/sort-builder.d.ts +18 -0
- package/dist/ui/molecules/sort-builder/sort-builder.d.ts.map +1 -0
- package/dist/ui/molecules/sort-builder/sort-builder.js +185 -0
- package/dist/ui/molecules/sort-builder/sort-builder.js.map +1 -0
- package/dist/ui/molecules/stack/index.d.ts +2 -0
- package/dist/ui/molecules/stack/index.d.ts.map +1 -0
- package/dist/ui/molecules/stack/index.js +3 -0
- package/dist/ui/molecules/stack/index.js.map +1 -0
- package/dist/ui/molecules/stack/stack.d.ts +12 -0
- package/dist/ui/molecules/stack/stack.d.ts.map +1 -0
- package/dist/ui/molecules/stack/stack.js +36 -0
- package/dist/ui/molecules/stack/stack.js.map +1 -0
- package/dist/ui/molecules/tab-strip/index.d.ts +2 -0
- package/dist/ui/molecules/tab-strip/index.d.ts.map +1 -0
- package/dist/ui/molecules/tab-strip/index.js +3 -0
- package/dist/ui/molecules/tab-strip/index.js.map +1 -0
- package/dist/ui/molecules/tab-strip/tab-strip.d.ts +29 -0
- package/dist/ui/molecules/tab-strip/tab-strip.d.ts.map +1 -0
- package/dist/ui/molecules/tab-strip/tab-strip.js +82 -0
- package/dist/ui/molecules/tab-strip/tab-strip.js.map +1 -0
- package/dist/ui/molecules/table-toolbar/index.d.ts +2 -0
- package/dist/ui/molecules/table-toolbar/index.d.ts.map +1 -0
- package/dist/ui/molecules/table-toolbar/index.js +3 -0
- package/dist/ui/molecules/table-toolbar/index.js.map +1 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts +13 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts.map +1 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.js +28 -0
- package/dist/ui/molecules/table-toolbar/table-toolbar.js.map +1 -0
- package/dist/ui/molecules/theme-switcher/index.d.ts +2 -0
- package/dist/ui/molecules/theme-switcher/index.d.ts.map +1 -0
- package/dist/ui/molecules/theme-switcher/index.js +3 -0
- package/dist/ui/molecules/theme-switcher/index.js.map +1 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts +6 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts.map +1 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.js +24 -0
- package/dist/ui/molecules/theme-switcher/theme-switcher.js.map +1 -0
- package/dist/ui/organisms/command-palette/command-palette.d.ts +67 -0
- package/dist/ui/organisms/command-palette/command-palette.d.ts.map +1 -0
- package/dist/ui/organisms/command-palette/command-palette.js +226 -0
- package/dist/ui/organisms/command-palette/command-palette.js.map +1 -0
- package/dist/ui/organisms/command-palette/index.d.ts +2 -0
- package/dist/ui/organisms/command-palette/index.d.ts.map +1 -0
- package/dist/ui/organisms/command-palette/index.js +3 -0
- package/dist/ui/organisms/command-palette/index.js.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts +43 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js +281 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts +49 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js +3 -0
- package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/index.d.ts +3 -0
- package/dist/ui/organisms/entity-detail-grid/index.d.ts.map +1 -0
- package/dist/ui/organisms/entity-detail-grid/index.js +4 -0
- package/dist/ui/organisms/entity-detail-grid/index.js.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.d.ts +53 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.js +44 -0
- package/dist/ui/organisms/entity-form/entity-form-slots.js.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.d.ts +4 -0
- package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.js +494 -0
- package/dist/ui/organisms/entity-form/entity-form.js.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.types.d.ts +151 -0
- package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/entity-form.types.js +3 -0
- package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -0
- package/dist/ui/organisms/entity-form/index.d.ts +5 -0
- package/dist/ui/organisms/entity-form/index.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/index.js +6 -0
- package/dist/ui/organisms/entity-form/index.js.map +1 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts +13 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts.map +1 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.js +50 -0
- package/dist/ui/organisms/entity-form/use-entity-form-fields.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.d.ts +55 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.js +50 -0
- package/dist/ui/organisms/entity-table/entity-table-slots.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.d.ts +4 -0
- package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.js +529 -0
- package/dist/ui/organisms/entity-table/entity-table.js.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts +126 -0
- package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/entity-table.types.js +3 -0
- package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -0
- package/dist/ui/organisms/entity-table/index.d.ts +5 -0
- package/dist/ui/organisms/entity-table/index.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/index.js +6 -0
- package/dist/ui/organisms/entity-table/index.js.map +1 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +29 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js +103 -0
- package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -0
- package/dist/ui/organisms/top-bar/index.d.ts +2 -0
- package/dist/ui/organisms/top-bar/index.d.ts.map +1 -0
- package/dist/ui/organisms/top-bar/index.js +3 -0
- package/dist/ui/organisms/top-bar/index.js.map +1 -0
- package/dist/ui/organisms/top-bar/top-bar.d.ts +20 -0
- package/dist/ui/organisms/top-bar/top-bar.d.ts.map +1 -0
- package/dist/ui/organisms/top-bar/top-bar.js +43 -0
- package/dist/ui/organisms/top-bar/top-bar.js.map +1 -0
- package/dist/ui/organisms/wizard/index.d.ts +3 -0
- package/dist/ui/organisms/wizard/index.d.ts.map +1 -0
- package/dist/ui/organisms/wizard/index.js +4 -0
- package/dist/ui/organisms/wizard/index.js.map +1 -0
- package/dist/ui/organisms/wizard/wizard.d.ts +21 -0
- package/dist/ui/organisms/wizard/wizard.d.ts.map +1 -0
- package/dist/ui/organisms/wizard/wizard.js +260 -0
- package/dist/ui/organisms/wizard/wizard.js.map +1 -0
- package/dist/ui/organisms/wizard/wizard.types.d.ts +83 -0
- package/dist/ui/organisms/wizard/wizard.types.d.ts.map +1 -0
- package/dist/ui/organisms/wizard/wizard.types.js +3 -0
- package/dist/ui/organisms/wizard/wizard.types.js.map +1 -0
- package/dist/ui/utils/cn.d.ts +4 -0
- package/dist/ui/utils/cn.d.ts.map +1 -0
- package/dist/ui/utils/cn.js +5 -0
- package/dist/ui/utils/cn.js.map +1 -0
- package/dist/ui/utils/use-hotkey.d.ts +31 -0
- package/dist/ui/utils/use-hotkey.d.ts.map +1 -0
- package/dist/ui/utils/use-hotkey.js +69 -0
- package/dist/ui/utils/use-hotkey.js.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { EntityDetailGridProps } from './entity-detail-grid.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The rows a record **owns**, edited in place.
|
|
4
|
+
*
|
|
5
|
+
* A `composition` — an order and its lines — where the rows have no life outside
|
|
6
|
+
* the master and go out in the same write
|
|
7
|
+
* ([ADR 0034](../../../../../../../docs/adr/0034-composition-metadata.md)). Not
|
|
8
|
+
* a `linkCollection`, which is association to records that exist on their own
|
|
9
|
+
* and save separately; that editor is still #26.
|
|
10
|
+
*
|
|
11
|
+
* ## Why this is not `EntityTable`
|
|
12
|
+
*
|
|
13
|
+
* `EntityTable` is a *server* listing: pages, RSQL filtering and sorting,
|
|
14
|
+
* column personalization, a selection model and a bulk bar. A detail grid has
|
|
15
|
+
* none of those and cannot have them — its rows are local, unsaved, and
|
|
16
|
+
* unqueryable by construction, since a collection member is never `filterable`.
|
|
17
|
+
* Sharing the organism would mean every one of those features growing a
|
|
18
|
+
* "detail" branch. It shares the `Table` **atoms** instead, which is the level
|
|
19
|
+
* the two actually have in common.
|
|
20
|
+
*
|
|
21
|
+
* ## Inline cells, and why Enter is free
|
|
22
|
+
*
|
|
23
|
+
* Each cell is a {@link FieldControl}, the same descriptor→input map the form
|
|
24
|
+
* uses, so a child's `enum` gets a select and its `date` a date input with no
|
|
25
|
+
* code here. `Tab` walks the row natively and crosses into the next; `Enter` on
|
|
26
|
+
* the last row appends and focuses the new row's first cell.
|
|
27
|
+
*
|
|
28
|
+
* That last binding is available only because `EntityForm` renders a `<Card>`
|
|
29
|
+
* with a `<button onClick>` Save rather than a `<form>` — inside a real form,
|
|
30
|
+
* `Enter` in a text input submits, and appending a row would fight the browser
|
|
31
|
+
* for it. Wrapping the form in a `<form>` element later would break this, which
|
|
32
|
+
* is the one thing worth knowing before doing it.
|
|
33
|
+
*
|
|
34
|
+
* ## Errors
|
|
35
|
+
*
|
|
36
|
+
* A cell carries `aria-invalid` and points at its own message; the grid carries
|
|
37
|
+
* **one** summary above it, which is the only `role="alert"` in the component.
|
|
38
|
+
* A live region per cell would announce the whole grid on every keystroke, and
|
|
39
|
+
* a message rendered only in the cell is unreachable when the failing row is
|
|
40
|
+
* scrolled out — which is the case #110 names.
|
|
41
|
+
*/
|
|
42
|
+
export declare function EntityDetailGrid({ descriptor, rows, onRowsChange, errors, editing, isLoading, skeleton, footer, className, }: EntityDetailGridProps): import("react").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=entity-detail-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-detail-grid.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-detail-grid/entity-detail-grid.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAK3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,OAAe,EACf,SAAiB,EACjB,QAAe,EACf,MAAM,EACN,SAAS,GACV,EAAE,qBAAqB,+BAyMvB"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
+
import { describeChildColumns, editableChildColumns, newRowKey, parseRowFieldPath, ROW_KEY, rowFieldPath } from '@entifix/core';
|
|
5
|
+
import { useId, useMemo } from 'react';
|
|
6
|
+
import { useLocalizedDescriptors, useT } from '../../../i18n/index.js';
|
|
7
|
+
import { Button } from '../../atoms/button/index.js';
|
|
8
|
+
import { FieldControl } from '../../atoms/field-control/index.js';
|
|
9
|
+
import { Skeleton } from '../../atoms/skeleton/index.js';
|
|
10
|
+
import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableMessageRow, TableRow } from '../../atoms/table/index.js';
|
|
11
|
+
import { Stack } from '../../molecules/stack/index.js';
|
|
12
|
+
import { cn } from '../../utils/cn.js';
|
|
13
|
+
/** Rows the placeholder stands in for. Enough to read as a grid, not a page. */ const SKELETON_ROW_COUNT = 3;
|
|
14
|
+
/**
|
|
15
|
+
* The rows a record **owns**, edited in place.
|
|
16
|
+
*
|
|
17
|
+
* A `composition` — an order and its lines — where the rows have no life outside
|
|
18
|
+
* the master and go out in the same write
|
|
19
|
+
* ([ADR 0034](../../../../../../../docs/adr/0034-composition-metadata.md)). Not
|
|
20
|
+
* a `linkCollection`, which is association to records that exist on their own
|
|
21
|
+
* and save separately; that editor is still #26.
|
|
22
|
+
*
|
|
23
|
+
* ## Why this is not `EntityTable`
|
|
24
|
+
*
|
|
25
|
+
* `EntityTable` is a *server* listing: pages, RSQL filtering and sorting,
|
|
26
|
+
* column personalization, a selection model and a bulk bar. A detail grid has
|
|
27
|
+
* none of those and cannot have them — its rows are local, unsaved, and
|
|
28
|
+
* unqueryable by construction, since a collection member is never `filterable`.
|
|
29
|
+
* Sharing the organism would mean every one of those features growing a
|
|
30
|
+
* "detail" branch. It shares the `Table` **atoms** instead, which is the level
|
|
31
|
+
* the two actually have in common.
|
|
32
|
+
*
|
|
33
|
+
* ## Inline cells, and why Enter is free
|
|
34
|
+
*
|
|
35
|
+
* Each cell is a {@link FieldControl}, the same descriptor→input map the form
|
|
36
|
+
* uses, so a child's `enum` gets a select and its `date` a date input with no
|
|
37
|
+
* code here. `Tab` walks the row natively and crosses into the next; `Enter` on
|
|
38
|
+
* the last row appends and focuses the new row's first cell.
|
|
39
|
+
*
|
|
40
|
+
* That last binding is available only because `EntityForm` renders a `<Card>`
|
|
41
|
+
* with a `<button onClick>` Save rather than a `<form>` — inside a real form,
|
|
42
|
+
* `Enter` in a text input submits, and appending a row would fight the browser
|
|
43
|
+
* for it. Wrapping the form in a `<form>` element later would break this, which
|
|
44
|
+
* is the one thing worth knowing before doing it.
|
|
45
|
+
*
|
|
46
|
+
* ## Errors
|
|
47
|
+
*
|
|
48
|
+
* A cell carries `aria-invalid` and points at its own message; the grid carries
|
|
49
|
+
* **one** summary above it, which is the only `role="alert"` in the component.
|
|
50
|
+
* A live region per cell would announce the whole grid on every keystroke, and
|
|
51
|
+
* a message rendered only in the cell is unreachable when the failing row is
|
|
52
|
+
* scrolled out — which is the case #110 names.
|
|
53
|
+
*/ export function EntityDetailGrid({ descriptor, rows, onRowsChange, errors, editing = false, isLoading = false, skeleton = true, footer, className }) {
|
|
54
|
+
var _columns_;
|
|
55
|
+
const t = useT();
|
|
56
|
+
const gridId = useId();
|
|
57
|
+
const described = useMemo(()=>descriptor.childType === undefined ? [] : editableChildColumns(describeChildColumns(descriptor.childType)), [
|
|
58
|
+
descriptor.childType
|
|
59
|
+
]);
|
|
60
|
+
const columns = useLocalizedDescriptors(described);
|
|
61
|
+
// Only the messages that name *this* member. The form hands over its whole
|
|
62
|
+
// error map so a record with two owned collections needs no bookkeeping at
|
|
63
|
+
// the call site, and a grid that filtered nothing would show the other's.
|
|
64
|
+
const rowErrors = useMemo(()=>readRowErrors(descriptor.name, errors), [
|
|
65
|
+
descriptor.name,
|
|
66
|
+
errors
|
|
67
|
+
]);
|
|
68
|
+
const showSkeleton = isLoading && skeleton !== false;
|
|
69
|
+
const customSkeleton = typeof skeleton === 'boolean' ? undefined : skeleton;
|
|
70
|
+
// One more than the columns: every row carries its remove control.
|
|
71
|
+
const columnCount = columns.length + (editing ? 1 : 0);
|
|
72
|
+
const setRow = (index, member, value)=>{
|
|
73
|
+
onRowsChange(rows.map((row, position)=>position === index ? _extends({}, row, {
|
|
74
|
+
[member]: value
|
|
75
|
+
}) : row));
|
|
76
|
+
};
|
|
77
|
+
const firstColumn = (_columns_ = columns[0]) == null ? void 0 : _columns_.name;
|
|
78
|
+
const appendRow = ()=>{
|
|
79
|
+
onRowsChange([
|
|
80
|
+
...rows,
|
|
81
|
+
seedEmptyRow(columns)
|
|
82
|
+
]);
|
|
83
|
+
focusCell(gridId, rows.length, firstColumn);
|
|
84
|
+
};
|
|
85
|
+
const removeRow = (index)=>{
|
|
86
|
+
onRowsChange(rows.filter((_row, position)=>position !== index));
|
|
87
|
+
// Focus the row that slid into this position, or the one above it when the
|
|
88
|
+
// removed row was last — never nothing, which drops the user to the page.
|
|
89
|
+
focusCell(gridId, Math.min(index, rows.length - 2), firstColumn);
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* `Enter` anywhere in the **last row** appends the next one.
|
|
93
|
+
*
|
|
94
|
+
* Bound to the row rather than to its final cell, which is what it looked
|
|
95
|
+
* like it should be: the last *column* is whatever the child declared last,
|
|
96
|
+
* and a read-only member there renders a disabled input that never receives a
|
|
97
|
+
* key at all — so the binding would exist and be unreachable, on exactly the
|
|
98
|
+
* entities that have a computed column. The row is the unit the user is
|
|
99
|
+
* finishing anyway.
|
|
100
|
+
*
|
|
101
|
+
* Only from a text input: a `<select>` opens on Enter and a checkbox toggles
|
|
102
|
+
* on Space, so taking the key from those would break a control's own
|
|
103
|
+
* behaviour to add a row the user did not ask for. A read-only column needs
|
|
104
|
+
* no test of its own — its input is `disabled`, so it never takes focus and
|
|
105
|
+
* never raises a key here at all.
|
|
106
|
+
*/ const onLastRowKeyDown = (event)=>{
|
|
107
|
+
if (event.key !== 'Enter') return;
|
|
108
|
+
if (!(event.target instanceof HTMLInputElement)) return;
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
appendRow();
|
|
111
|
+
};
|
|
112
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
113
|
+
gap: "2xs",
|
|
114
|
+
className: className,
|
|
115
|
+
children: [
|
|
116
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
117
|
+
className: "flex items-center justify-between gap-s",
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ _jsx("span", {
|
|
120
|
+
className: "text-step-sm font-medium text-content-muted",
|
|
121
|
+
children: descriptor.label
|
|
122
|
+
}),
|
|
123
|
+
editing && /*#__PURE__*/ _jsx(Button, {
|
|
124
|
+
type: "button",
|
|
125
|
+
variant: "secondary",
|
|
126
|
+
size: "sm",
|
|
127
|
+
onClick: appendRow,
|
|
128
|
+
disabled: isLoading,
|
|
129
|
+
children: t('detail.addRow')
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
}),
|
|
133
|
+
editing && rowErrors.size > 0 && /*#__PURE__*/ _jsx("div", {
|
|
134
|
+
role: "alert",
|
|
135
|
+
className: "text-step-sm text-danger",
|
|
136
|
+
children: t('detail.errorSummary', {
|
|
137
|
+
count: rowErrors.size
|
|
138
|
+
})
|
|
139
|
+
}),
|
|
140
|
+
/*#__PURE__*/ _jsxs(Table, {
|
|
141
|
+
"aria-label": descriptor.label,
|
|
142
|
+
"aria-busy": isLoading || undefined,
|
|
143
|
+
"aria-rowcount": rows.length,
|
|
144
|
+
children: [
|
|
145
|
+
/*#__PURE__*/ _jsx(TableHead, {
|
|
146
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
147
|
+
children: [
|
|
148
|
+
columns.map((column)=>/*#__PURE__*/ _jsx(TableHeaderCell, {
|
|
149
|
+
id: `${gridId}-${column.name}`,
|
|
150
|
+
children: column.label
|
|
151
|
+
}, column.name)),
|
|
152
|
+
editing && /*#__PURE__*/ _jsx(TableHeaderCell, {
|
|
153
|
+
align: "end",
|
|
154
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
155
|
+
className: "sr-only",
|
|
156
|
+
children: t('detail.rowActions')
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
})
|
|
161
|
+
}),
|
|
162
|
+
/*#__PURE__*/ _jsxs(TableBody, {
|
|
163
|
+
children: [
|
|
164
|
+
showSkeleton ? customSkeleton != null ? customSkeleton : /*#__PURE__*/ _jsx(SkeletonRows, {
|
|
165
|
+
columns: columns.length,
|
|
166
|
+
extra: editing ? 1 : 0
|
|
167
|
+
}) : rows.map((row, index)=>/*#__PURE__*/ _jsxs(TableRow, {
|
|
168
|
+
onKeyDown: editing && index === rows.length - 1 ? onLastRowKeyDown : undefined,
|
|
169
|
+
children: [
|
|
170
|
+
columns.map((column)=>{
|
|
171
|
+
var _row_column_name, _row_column_name1;
|
|
172
|
+
const error = rowErrors.get(rowFieldPath(descriptor.name, index, column.name));
|
|
173
|
+
const cellId = `${gridId}-${index}-${column.name}`;
|
|
174
|
+
return /*#__PURE__*/ _jsxs(TableCell, {
|
|
175
|
+
children: [
|
|
176
|
+
editing ? /*#__PURE__*/ _jsx(FieldControl, {
|
|
177
|
+
descriptor: column,
|
|
178
|
+
value: (_row_column_name = row[column.name]) != null ? _row_column_name : '',
|
|
179
|
+
id: cellId,
|
|
180
|
+
"aria-labelledby": `${gridId}-${column.name}`,
|
|
181
|
+
"aria-invalid": error !== undefined || undefined,
|
|
182
|
+
"aria-describedby": error === undefined ? undefined : `${cellId}-error`,
|
|
183
|
+
onChange: (next)=>setRow(index, column.name, next)
|
|
184
|
+
}) : /*#__PURE__*/ _jsx("span", {
|
|
185
|
+
children: (_row_column_name1 = row[column.name]) != null ? _row_column_name1 : ''
|
|
186
|
+
}),
|
|
187
|
+
editing && error !== undefined && /*#__PURE__*/ _jsx("span", {
|
|
188
|
+
id: `${cellId}-error`,
|
|
189
|
+
className: "mt-3xs block text-step-sm text-danger",
|
|
190
|
+
children: error
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
}, column.name);
|
|
194
|
+
}),
|
|
195
|
+
editing && /*#__PURE__*/ _jsx(TableCell, {
|
|
196
|
+
align: "end",
|
|
197
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
198
|
+
type: "button",
|
|
199
|
+
variant: "ghost",
|
|
200
|
+
size: "sm",
|
|
201
|
+
onClick: ()=>removeRow(index),
|
|
202
|
+
children: t('detail.removeRow', {
|
|
203
|
+
row: index + 1
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
}, row[ROW_KEY])),
|
|
209
|
+
!showSkeleton && rows.length === 0 && /*#__PURE__*/ _jsx(TableMessageRow, {
|
|
210
|
+
colSpan: Math.max(columnCount, 1),
|
|
211
|
+
children: t('detail.empty')
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
})
|
|
215
|
+
]
|
|
216
|
+
}),
|
|
217
|
+
footer !== undefined && !showSkeleton && /*#__PURE__*/ _jsx("div", {
|
|
218
|
+
className: cn('flex justify-end text-step-sm text-content'),
|
|
219
|
+
children: footer(rows)
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/** The placeholder, shaped like the grid it stands in for. */ function SkeletonRows({ columns, extra }) {
|
|
225
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
226
|
+
children: Array.from({
|
|
227
|
+
length: SKELETON_ROW_COUNT
|
|
228
|
+
}, (_row, index)=>/*#__PURE__*/ _jsx(TableRow, {
|
|
229
|
+
children: Array.from({
|
|
230
|
+
length: columns + extra
|
|
231
|
+
}, (_cell, cellIndex)=>/*#__PURE__*/ _jsx(TableCell, {
|
|
232
|
+
children: /*#__PURE__*/ _jsx(Skeleton, {
|
|
233
|
+
className: "h-8 w-full"
|
|
234
|
+
})
|
|
235
|
+
}, cellIndex))
|
|
236
|
+
}, index))
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* A blank row, seeded with every column the grid edits.
|
|
241
|
+
*
|
|
242
|
+
* Every member is present and empty rather than absent, for the reason a form's
|
|
243
|
+
* seed carries every key: a control handed `undefined` flips from controlled to
|
|
244
|
+
* uncontrolled the moment the user types into it.
|
|
245
|
+
*/ function seedEmptyRow(columns) {
|
|
246
|
+
const row = {
|
|
247
|
+
[ROW_KEY]: newRowKey()
|
|
248
|
+
};
|
|
249
|
+
for (const column of columns)row[column.name] = '';
|
|
250
|
+
return row;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Moves focus into a cell after the list changed.
|
|
254
|
+
*
|
|
255
|
+
* By element id rather than through a ref into the `<tbody>`, because the row
|
|
256
|
+
* being focused does not exist yet when this is called — it is the row the
|
|
257
|
+
* caller has just asked React to render. Deferring to a microtask lets that
|
|
258
|
+
* render commit first; `getElementById` then finds the input the same way the
|
|
259
|
+
* cell's own `aria-describedby` does.
|
|
260
|
+
*
|
|
261
|
+
* A row index that names nothing simply focuses nothing, which is the right
|
|
262
|
+
* outcome for removing the only row: there is no cell to land in, and stealing
|
|
263
|
+
* focus somewhere arbitrary is worse than leaving it where the user put it.
|
|
264
|
+
*/ function focusCell(gridId, index, column) {
|
|
265
|
+
if (column === undefined || index < 0) return;
|
|
266
|
+
queueMicrotask(()=>{
|
|
267
|
+
var _document_getElementById;
|
|
268
|
+
(_document_getElementById = document.getElementById(`${gridId}-${index}-${column}`)) == null ? void 0 : _document_getElementById.focus();
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
/** The messages naming a row of `member`, keyed by their full path. */ function readRowErrors(member, errors) {
|
|
272
|
+
const found = new Map();
|
|
273
|
+
if (errors === undefined) return found;
|
|
274
|
+
for (const [path, message] of Object.entries(errors)){
|
|
275
|
+
var _parseRowFieldPath;
|
|
276
|
+
if (((_parseRowFieldPath = parseRowFieldPath(path)) == null ? void 0 : _parseRowFieldPath.member) === member) found.set(path, message);
|
|
277
|
+
}
|
|
278
|
+
return found;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
//# sourceMappingURL=entity-detail-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-detail-grid/entity-detail-grid.tsx"],"sourcesContent":["'use client';\n\nimport {\n describeChildColumns,\n editableChildColumns,\n type EntityFieldDescriptor,\n type EntityRowDraft,\n newRowKey,\n parseRowFieldPath,\n ROW_KEY,\n rowFieldPath,\n} from '@entifix/core';\nimport { type KeyboardEvent, useId, useMemo } from 'react';\n\nimport { useLocalizedDescriptors, useT } from '../../../i18n/index.js';\nimport { Button } from '../../atoms/button/index.js';\nimport { FieldControl } from '../../atoms/field-control/index.js';\nimport { Skeleton } from '../../atoms/skeleton/index.js';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableMessageRow,\n TableRow,\n} from '../../atoms/table/index.js';\nimport { Stack } from '../../molecules/stack/index.js';\nimport { cn } from '../../utils/cn.js';\nimport type { EntityDetailGridProps } from './entity-detail-grid.types.js';\n\n/** Rows the placeholder stands in for. Enough to read as a grid, not a page. */\nconst SKELETON_ROW_COUNT = 3;\n\n/**\n * The rows a record **owns**, edited in place.\n *\n * A `composition` — an order and its lines — where the rows have no life outside\n * the master and go out in the same write\n * ([ADR 0034](../../../../../../../docs/adr/0034-composition-metadata.md)). Not\n * a `linkCollection`, which is association to records that exist on their own\n * and save separately; that editor is still #26.\n *\n * ## Why this is not `EntityTable`\n *\n * `EntityTable` is a *server* listing: pages, RSQL filtering and sorting,\n * column personalization, a selection model and a bulk bar. A detail grid has\n * none of those and cannot have them — its rows are local, unsaved, and\n * unqueryable by construction, since a collection member is never `filterable`.\n * Sharing the organism would mean every one of those features growing a\n * \"detail\" branch. It shares the `Table` **atoms** instead, which is the level\n * the two actually have in common.\n *\n * ## Inline cells, and why Enter is free\n *\n * Each cell is a {@link FieldControl}, the same descriptor→input map the form\n * uses, so a child's `enum` gets a select and its `date` a date input with no\n * code here. `Tab` walks the row natively and crosses into the next; `Enter` on\n * the last row appends and focuses the new row's first cell.\n *\n * That last binding is available only because `EntityForm` renders a `<Card>`\n * with a `<button onClick>` Save rather than a `<form>` — inside a real form,\n * `Enter` in a text input submits, and appending a row would fight the browser\n * for it. Wrapping the form in a `<form>` element later would break this, which\n * is the one thing worth knowing before doing it.\n *\n * ## Errors\n *\n * A cell carries `aria-invalid` and points at its own message; the grid carries\n * **one** summary above it, which is the only `role=\"alert\"` in the component.\n * A live region per cell would announce the whole grid on every keystroke, and\n * a message rendered only in the cell is unreachable when the failing row is\n * scrolled out — which is the case #110 names.\n */\nexport function EntityDetailGrid({\n descriptor,\n rows,\n onRowsChange,\n errors,\n editing = false,\n isLoading = false,\n skeleton = true,\n footer,\n className,\n}: EntityDetailGridProps) {\n const t = useT();\n const gridId = useId();\n\n const described = useMemo(\n () =>\n descriptor.childType === undefined\n ? []\n : editableChildColumns(describeChildColumns(descriptor.childType)),\n [descriptor.childType],\n );\n const columns = useLocalizedDescriptors(described);\n\n // Only the messages that name *this* member. The form hands over its whole\n // error map so a record with two owned collections needs no bookkeeping at\n // the call site, and a grid that filtered nothing would show the other's.\n const rowErrors = useMemo(\n () => readRowErrors(descriptor.name, errors),\n [descriptor.name, errors],\n );\n\n const showSkeleton = isLoading && skeleton !== false;\n const customSkeleton = typeof skeleton === 'boolean' ? undefined : skeleton;\n // One more than the columns: every row carries its remove control.\n const columnCount = columns.length + (editing ? 1 : 0);\n\n const setRow = (index: number, member: string, value: string) => {\n onRowsChange(\n rows.map((row, position) =>\n position === index ? { ...row, [member]: value } : row,\n ),\n );\n };\n\n const firstColumn = columns[0]?.name;\n\n const appendRow = () => {\n onRowsChange([...rows, seedEmptyRow(columns)]);\n focusCell(gridId, rows.length, firstColumn);\n };\n\n const removeRow = (index: number) => {\n onRowsChange(rows.filter((_row, position) => position !== index));\n // Focus the row that slid into this position, or the one above it when the\n // removed row was last — never nothing, which drops the user to the page.\n focusCell(gridId, Math.min(index, rows.length - 2), firstColumn);\n };\n\n /**\n * `Enter` anywhere in the **last row** appends the next one.\n *\n * Bound to the row rather than to its final cell, which is what it looked\n * like it should be: the last *column* is whatever the child declared last,\n * and a read-only member there renders a disabled input that never receives a\n * key at all — so the binding would exist and be unreachable, on exactly the\n * entities that have a computed column. The row is the unit the user is\n * finishing anyway.\n *\n * Only from a text input: a `<select>` opens on Enter and a checkbox toggles\n * on Space, so taking the key from those would break a control's own\n * behaviour to add a row the user did not ask for. A read-only column needs\n * no test of its own — its input is `disabled`, so it never takes focus and\n * never raises a key here at all.\n */\n const onLastRowKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (event.key !== 'Enter') return;\n if (!(event.target instanceof HTMLInputElement)) return;\n event.preventDefault();\n appendRow();\n };\n\n return (\n <Stack gap=\"2xs\" className={className}>\n <div className=\"flex items-center justify-between gap-s\">\n <span className=\"text-step-sm font-medium text-content-muted\">\n {descriptor.label}\n </span>\n {editing && (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={appendRow}\n disabled={isLoading}\n >\n {t('detail.addRow')}\n </Button>\n )}\n </div>\n\n {editing && rowErrors.size > 0 && (\n <div role=\"alert\" className=\"text-step-sm text-danger\">\n {t('detail.errorSummary', { count: rowErrors.size })}\n </div>\n )}\n\n <Table\n aria-label={descriptor.label}\n aria-busy={isLoading || undefined}\n aria-rowcount={rows.length}\n >\n <TableHead>\n <TableRow>\n {columns.map(column => (\n <TableHeaderCell\n key={column.name}\n id={`${gridId}-${column.name}`}\n >\n {column.label}\n </TableHeaderCell>\n ))}\n {editing && (\n <TableHeaderCell align=\"end\">\n <span className=\"sr-only\">{t('detail.rowActions')}</span>\n </TableHeaderCell>\n )}\n </TableRow>\n </TableHead>\n\n <TableBody>\n {showSkeleton\n ? (customSkeleton ?? (\n <SkeletonRows\n columns={columns.length}\n extra={editing ? 1 : 0}\n />\n ))\n : rows.map((row, index) => (\n <TableRow\n key={row[ROW_KEY]}\n onKeyDown={\n editing && index === rows.length - 1\n ? onLastRowKeyDown\n : undefined\n }\n >\n {columns.map(column => {\n const error = rowErrors.get(\n rowFieldPath(descriptor.name, index, column.name),\n );\n const cellId = `${gridId}-${index}-${column.name}`;\n return (\n <TableCell key={column.name}>\n {editing ? (\n <FieldControl\n descriptor={column}\n value={row[column.name] ?? ''}\n id={cellId}\n aria-labelledby={`${gridId}-${column.name}`}\n aria-invalid={error !== undefined || undefined}\n aria-describedby={\n error === undefined\n ? undefined\n : `${cellId}-error`\n }\n onChange={next => setRow(index, column.name, next)}\n />\n ) : (\n <span>{row[column.name] ?? ''}</span>\n )}\n {editing && error !== undefined && (\n <span\n id={`${cellId}-error`}\n className=\"mt-3xs block text-step-sm text-danger\"\n >\n {error}\n </span>\n )}\n </TableCell>\n );\n })}\n {editing && (\n <TableCell align=\"end\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => removeRow(index)}\n >\n {t('detail.removeRow', { row: index + 1 })}\n </Button>\n </TableCell>\n )}\n </TableRow>\n ))}\n\n {!showSkeleton && rows.length === 0 && (\n <TableMessageRow colSpan={Math.max(columnCount, 1)}>\n {t('detail.empty')}\n </TableMessageRow>\n )}\n </TableBody>\n </Table>\n\n {footer !== undefined && !showSkeleton && (\n <div className={cn('flex justify-end text-step-sm text-content')}>\n {footer(rows)}\n </div>\n )}\n </Stack>\n );\n}\n\n/** The placeholder, shaped like the grid it stands in for. */\nfunction SkeletonRows({ columns, extra }: { columns: number; extra: number }) {\n return (\n <>\n {Array.from({ length: SKELETON_ROW_COUNT }, (_row, index) => (\n <TableRow key={index}>\n {Array.from({ length: columns + extra }, (_cell, cellIndex) => (\n <TableCell key={cellIndex}>\n <Skeleton className=\"h-8 w-full\" />\n </TableCell>\n ))}\n </TableRow>\n ))}\n </>\n );\n}\n\n/**\n * A blank row, seeded with every column the grid edits.\n *\n * Every member is present and empty rather than absent, for the reason a form's\n * seed carries every key: a control handed `undefined` flips from controlled to\n * uncontrolled the moment the user types into it.\n */\nfunction seedEmptyRow(\n columns: readonly EntityFieldDescriptor[],\n): EntityRowDraft {\n const row: EntityRowDraft = { [ROW_KEY]: newRowKey() };\n for (const column of columns) row[column.name] = '';\n return row;\n}\n\n/**\n * Moves focus into a cell after the list changed.\n *\n * By element id rather than through a ref into the `<tbody>`, because the row\n * being focused does not exist yet when this is called — it is the row the\n * caller has just asked React to render. Deferring to a microtask lets that\n * render commit first; `getElementById` then finds the input the same way the\n * cell's own `aria-describedby` does.\n *\n * A row index that names nothing simply focuses nothing, which is the right\n * outcome for removing the only row: there is no cell to land in, and stealing\n * focus somewhere arbitrary is worse than leaving it where the user put it.\n */\nfunction focusCell(gridId: string, index: number, column?: string): void {\n if (column === undefined || index < 0) return;\n\n queueMicrotask(() => {\n document.getElementById(`${gridId}-${index}-${column}`)?.focus();\n });\n}\n\n/** The messages naming a row of `member`, keyed by their full path. */\nfunction readRowErrors(\n member: string,\n errors: Record<string, string> | undefined,\n): Map<string, string> {\n const found = new Map<string, string>();\n if (errors === undefined) return found;\n\n for (const [path, message] of Object.entries(errors)) {\n if (parseRowFieldPath(path)?.member === member) found.set(path, message);\n }\n return found;\n}\n"],"names":["describeChildColumns","editableChildColumns","newRowKey","parseRowFieldPath","ROW_KEY","rowFieldPath","useId","useMemo","useLocalizedDescriptors","useT","Button","FieldControl","Skeleton","Table","TableBody","TableCell","TableHead","TableHeaderCell","TableMessageRow","TableRow","Stack","cn","SKELETON_ROW_COUNT","EntityDetailGrid","descriptor","rows","onRowsChange","errors","editing","isLoading","skeleton","footer","className","columns","t","gridId","described","childType","undefined","rowErrors","readRowErrors","name","showSkeleton","customSkeleton","columnCount","length","setRow","index","member","value","map","row","position","firstColumn","appendRow","seedEmptyRow","focusCell","removeRow","filter","_row","Math","min","onLastRowKeyDown","event","key","target","HTMLInputElement","preventDefault","gap","div","span","label","type","variant","size","onClick","disabled","role","count","aria-label","aria-busy","aria-rowcount","column","id","align","SkeletonRows","extra","onKeyDown","error","get","cellId","aria-labelledby","aria-invalid","aria-describedby","onChange","next","colSpan","max","Array","from","_cell","cellIndex","queueMicrotask","document","getElementById","focus","found","Map","path","message","Object","entries","set"],"mappings":"AAAA;;;AAEA,SACEA,oBAAoB,EACpBC,oBAAoB,EAGpBC,SAAS,EACTC,iBAAiB,EACjBC,OAAO,EACPC,YAAY,QACP,gBAAgB;AACvB,SAA6BC,KAAK,EAAEC,OAAO,QAAQ,QAAQ;AAE3D,SAASC,uBAAuB,EAAEC,IAAI,QAAQ,yBAAyB;AACvE,SAASC,MAAM,QAAQ,8BAA8B;AACrD,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SACEC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,QAAQ,QACH,6BAA6B;AACpC,SAASC,KAAK,QAAQ,iCAAiC;AACvD,SAASC,EAAE,QAAQ,oBAAoB;AAGvC,8EAA8E,GAC9E,MAAMC,qBAAqB;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASC,iBAAiB,EAC/BC,UAAU,EACVC,IAAI,EACJC,YAAY,EACZC,MAAM,EACNC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,WAAW,IAAI,EACfC,MAAM,EACNC,SAAS,EACa;QAkCFC;IAjCpB,MAAMC,IAAIzB;IACV,MAAM0B,SAAS7B;IAEf,MAAM8B,YAAY7B,QAChB,IACEiB,WAAWa,SAAS,KAAKC,YACrB,EAAE,GACFrC,qBAAqBD,qBAAqBwB,WAAWa,SAAS,IACpE;QAACb,WAAWa,SAAS;KAAC;IAExB,MAAMJ,UAAUzB,wBAAwB4B;IAExC,2EAA2E;IAC3E,2EAA2E;IAC3E,0EAA0E;IAC1E,MAAMG,YAAYhC,QAChB,IAAMiC,cAAchB,WAAWiB,IAAI,EAAEd,SACrC;QAACH,WAAWiB,IAAI;QAAEd;KAAO;IAG3B,MAAMe,eAAeb,aAAaC,aAAa;IAC/C,MAAMa,iBAAiB,OAAOb,aAAa,YAAYQ,YAAYR;IACnE,mEAAmE;IACnE,MAAMc,cAAcX,QAAQY,MAAM,GAAIjB,CAAAA,UAAU,IAAI,CAAA;IAEpD,MAAMkB,SAAS,CAACC,OAAeC,QAAgBC;QAC7CvB,aACED,KAAKyB,GAAG,CAAC,CAACC,KAAKC,WACbA,aAAaL,QAAQ,aAAKI;gBAAK,CAACH,OAAO,EAAEC;iBAAUE;IAGzD;IAEA,MAAME,eAAcpB,YAAAA,OAAO,CAAC,EAAE,qBAAVA,UAAYQ,IAAI;IAEpC,MAAMa,YAAY;QAChB5B,aAAa;eAAID;YAAM8B,aAAatB;SAAS;QAC7CuB,UAAUrB,QAAQV,KAAKoB,MAAM,EAAEQ;IACjC;IAEA,MAAMI,YAAY,CAACV;QACjBrB,aAAaD,KAAKiC,MAAM,CAAC,CAACC,MAAMP,WAAaA,aAAaL;QAC1D,2EAA2E;QAC3E,0EAA0E;QAC1ES,UAAUrB,QAAQyB,KAAKC,GAAG,CAACd,OAAOtB,KAAKoB,MAAM,GAAG,IAAIQ;IACtD;IAEA;;;;;;;;;;;;;;;GAeC,GACD,MAAMS,mBAAmB,CAACC;QACxB,IAAIA,MAAMC,GAAG,KAAK,SAAS;QAC3B,IAAI,CAAED,CAAAA,MAAME,MAAM,YAAYC,gBAAe,GAAI;QACjDH,MAAMI,cAAc;QACpBb;IACF;IAEA,qBACE,MAAClC;QAAMgD,KAAI;QAAMpC,WAAWA;;0BAC1B,MAACqC;gBAAIrC,WAAU;;kCACb,KAACsC;wBAAKtC,WAAU;kCACbR,WAAW+C,KAAK;;oBAElB3C,yBACC,KAAClB;wBACC8D,MAAK;wBACLC,SAAQ;wBACRC,MAAK;wBACLC,SAASrB;wBACTsB,UAAU/C;kCAETK,EAAE;;;;YAKRN,WAAWW,UAAUmC,IAAI,GAAG,mBAC3B,KAACL;gBAAIQ,MAAK;gBAAQ7C,WAAU;0BACzBE,EAAE,uBAAuB;oBAAE4C,OAAOvC,UAAUmC,IAAI;gBAAC;;0BAItD,MAAC7D;gBACCkE,cAAYvD,WAAW+C,KAAK;gBAC5BS,aAAWnD,aAAaS;gBACxB2C,iBAAexD,KAAKoB,MAAM;;kCAE1B,KAAC7B;kCACC,cAAA,MAACG;;gCACEc,QAAQiB,GAAG,CAACgC,CAAAA,uBACX,KAACjE;wCAECkE,IAAI,GAAGhD,OAAO,CAAC,EAAE+C,OAAOzC,IAAI,EAAE;kDAE7ByC,OAAOX,KAAK;uCAHRW,OAAOzC,IAAI;gCAMnBb,yBACC,KAACX;oCAAgBmE,OAAM;8CACrB,cAAA,KAACd;wCAAKtC,WAAU;kDAAWE,EAAE;;;;;;kCAMrC,MAACpB;;4BACE4B,eACIC,yBAAAA,+BACC,KAAC0C;gCACCpD,SAASA,QAAQY,MAAM;gCACvByC,OAAO1D,UAAU,IAAI;iCAGzBH,KAAKyB,GAAG,CAAC,CAACC,KAAKJ,sBACb,MAAC5B;oCAECoE,WACE3D,WAAWmB,UAAUtB,KAAKoB,MAAM,GAAG,IAC/BiB,mBACAxB;;wCAGLL,QAAQiB,GAAG,CAACgC,CAAAA;gDAUI/B,kBAYFA;4CArBb,MAAMqC,QAAQjD,UAAUkD,GAAG,CACzBpF,aAAamB,WAAWiB,IAAI,EAAEM,OAAOmC,OAAOzC,IAAI;4CAElD,MAAMiD,SAAS,GAAGvD,OAAO,CAAC,EAAEY,MAAM,CAAC,EAAEmC,OAAOzC,IAAI,EAAE;4CAClD,qBACE,MAAC1B;;oDACEa,wBACC,KAACjB;wDACCa,YAAY0D;wDACZjC,KAAK,GAAEE,mBAAAA,GAAG,CAAC+B,OAAOzC,IAAI,CAAC,YAAhBU,mBAAoB;wDAC3BgC,IAAIO;wDACJC,mBAAiB,GAAGxD,OAAO,CAAC,EAAE+C,OAAOzC,IAAI,EAAE;wDAC3CmD,gBAAcJ,UAAUlD,aAAaA;wDACrCuD,oBACEL,UAAUlD,YACNA,YACA,GAAGoD,OAAO,MAAM,CAAC;wDAEvBI,UAAUC,CAAAA,OAAQjD,OAAOC,OAAOmC,OAAOzC,IAAI,EAAEsD;uEAG/C,KAACzB;mEAAMnB,oBAAAA,GAAG,CAAC+B,OAAOzC,IAAI,CAAC,YAAhBU,oBAAoB;;oDAE5BvB,WAAW4D,UAAUlD,2BACpB,KAACgC;wDACCa,IAAI,GAAGO,OAAO,MAAM,CAAC;wDACrB1D,WAAU;kEAETwD;;;+CAvBSN,OAAOzC,IAAI;wCA4B/B;wCACCb,yBACC,KAACb;4CAAUqE,OAAM;sDACf,cAAA,KAAC1E;gDACC8D,MAAK;gDACLC,SAAQ;gDACRC,MAAK;gDACLC,SAAS,IAAMlB,UAAUV;0DAExBb,EAAE,oBAAoB;oDAAEiB,KAAKJ,QAAQ;gDAAE;;;;mCAlDzCI,GAAG,CAAC/C,QAAQ;4BAyDxB,CAACsC,gBAAgBjB,KAAKoB,MAAM,KAAK,mBAChC,KAAC3B;gCAAgB8E,SAASpC,KAAKqC,GAAG,CAACrD,aAAa;0CAC7CV,EAAE;;;;;;YAMVH,WAAWO,aAAa,CAACI,8BACxB,KAAC2B;gBAAIrC,WAAWX,GAAG;0BAChBU,OAAON;;;;AAKlB;AAEA,4DAA4D,GAC5D,SAAS4D,aAAa,EAAEpD,OAAO,EAAEqD,KAAK,EAAsC;IAC1E,qBACE;kBACGY,MAAMC,IAAI,CAAC;YAAEtD,QAAQvB;QAAmB,GAAG,CAACqC,MAAMZ,sBACjD,KAAC5B;0BACE+E,MAAMC,IAAI,CAAC;oBAAEtD,QAAQZ,UAAUqD;gBAAM,GAAG,CAACc,OAAOC,0BAC/C,KAACtF;kCACC,cAAA,KAACH;4BAASoB,WAAU;;uBADNqE;eAFLtD;;AAUvB;AAEA;;;;;;CAMC,GACD,SAASQ,aACPtB,OAAyC;IAEzC,MAAMkB,MAAsB;QAAE,CAAC/C,QAAQ,EAAEF;IAAY;IACrD,KAAK,MAAMgF,UAAUjD,QAASkB,GAAG,CAAC+B,OAAOzC,IAAI,CAAC,GAAG;IACjD,OAAOU;AACT;AAEA;;;;;;;;;;;;CAYC,GACD,SAASK,UAAUrB,MAAc,EAAEY,KAAa,EAAEmC,MAAe;IAC/D,IAAIA,WAAW5C,aAAaS,QAAQ,GAAG;IAEvCuD,eAAe;YACbC;SAAAA,2BAAAA,SAASC,cAAc,CAAC,GAAGrE,OAAO,CAAC,EAAEY,MAAM,CAAC,EAAEmC,QAAQ,sBAAtDqB,yBAAyDE,KAAK;IAChE;AACF;AAEA,qEAAqE,GACrE,SAASjE,cACPQ,MAAc,EACdrB,MAA0C;IAE1C,MAAM+E,QAAQ,IAAIC;IAClB,IAAIhF,WAAWW,WAAW,OAAOoE;IAEjC,KAAK,MAAM,CAACE,MAAMC,QAAQ,IAAIC,OAAOC,OAAO,CAACpF,QAAS;YAChDxB;QAAJ,IAAIA,EAAAA,qBAAAA,kBAAkByG,0BAAlBzG,mBAAyB6C,MAAM,MAAKA,QAAQ0D,MAAMM,GAAG,CAACJ,MAAMC;IAClE;IACA,OAAOH;AACT"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EntityFieldDescriptor, EntityRowDraft } from '@entifix/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface EntityDetailGridProps {
|
|
4
|
+
/**
|
|
5
|
+
* The owning member's descriptor. Its `childType` supplies the columns and
|
|
6
|
+
* its `label` names the grid, so an entity that declares an owned collection
|
|
7
|
+
* needs no per-entity component.
|
|
8
|
+
*/
|
|
9
|
+
descriptor: EntityFieldDescriptor;
|
|
10
|
+
/** The rows, as the master's draft holds them. */
|
|
11
|
+
rows: readonly EntityRowDraft[];
|
|
12
|
+
/**
|
|
13
|
+
* The whole list changed. One callback rather than add/remove/change,
|
|
14
|
+
* because the master's draft holds the rows as a single `JsonValue` and the
|
|
15
|
+
* grid is controlled from above exactly as `EntityForm` is — the form owns
|
|
16
|
+
* the draft, the grid renders it.
|
|
17
|
+
*/
|
|
18
|
+
onRowsChange: (rows: readonly EntityRowDraft[]) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Per-cell messages, keyed by `rowFieldPath` — `items[2].quantity`.
|
|
21
|
+
*
|
|
22
|
+
* The same map `EntityForm` is handed, unfiltered: the grid picks out the
|
|
23
|
+
* keys that name its own member rather than the caller splitting them, so a
|
|
24
|
+
* form with two owned collections needs no bookkeeping.
|
|
25
|
+
*/
|
|
26
|
+
errors?: Record<string, string>;
|
|
27
|
+
/** Read mode shows values; edit mode shows inputs. */
|
|
28
|
+
editing?: boolean;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* What holds the grid's shape while the record is in flight.
|
|
32
|
+
*
|
|
33
|
+
* `true` (the default) renders the built-in placeholder, derived from the
|
|
34
|
+
* grid's own resolved column count so the swap to real rows shifts nothing. A
|
|
35
|
+
* node replaces that default; `false` renders no placeholder at all.
|
|
36
|
+
*/
|
|
37
|
+
skeleton?: boolean | ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* A derived row under the grid — an order's total, a count.
|
|
40
|
+
*
|
|
41
|
+
* A **slot**, because an aggregate cannot come from metadata: summing
|
|
42
|
+
* `OrderItem.amount` is wrong (minor units, and several currencies once a
|
|
43
|
+
* basket spans vendors) and summing `quantity` across offerings means
|
|
44
|
+
* nothing. The control renders what it is given and invents no arithmetic.
|
|
45
|
+
*/
|
|
46
|
+
footer?: (rows: readonly EntityRowDraft[]) => ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=entity-detail-grid.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-detail-grid.types.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-detail-grid/entity-detail-grid.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,UAAU,EAAE,qBAAqB,CAAC;IAClC,kDAAkD;IAClD,IAAI,EAAE,SAAS,cAAc,EAAE,CAAC;IAChC;;;;;OAKG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,KAAK,IAAI,CAAC;IAExD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,KAAK,SAAS,CAAC;IAExD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-detail-grid/entity-detail-grid.types.ts"],"sourcesContent":["import type { EntityFieldDescriptor, EntityRowDraft } from '@entifix/core';\nimport type { ReactNode } from 'react';\n\nexport interface EntityDetailGridProps {\n /**\n * The owning member's descriptor. Its `childType` supplies the columns and\n * its `label` names the grid, so an entity that declares an owned collection\n * needs no per-entity component.\n */\n descriptor: EntityFieldDescriptor;\n /** The rows, as the master's draft holds them. */\n rows: readonly EntityRowDraft[];\n /**\n * The whole list changed. One callback rather than add/remove/change,\n * because the master's draft holds the rows as a single `JsonValue` and the\n * grid is controlled from above exactly as `EntityForm` is — the form owns\n * the draft, the grid renders it.\n */\n onRowsChange: (rows: readonly EntityRowDraft[]) => void;\n\n /**\n * Per-cell messages, keyed by `rowFieldPath` — `items[2].quantity`.\n *\n * The same map `EntityForm` is handed, unfiltered: the grid picks out the\n * keys that name its own member rather than the caller splitting them, so a\n * form with two owned collections needs no bookkeeping.\n */\n errors?: Record<string, string>;\n\n /** Read mode shows values; edit mode shows inputs. */\n editing?: boolean;\n\n isLoading?: boolean;\n /**\n * What holds the grid's shape while the record is in flight.\n *\n * `true` (the default) renders the built-in placeholder, derived from the\n * grid's own resolved column count so the swap to real rows shifts nothing. A\n * node replaces that default; `false` renders no placeholder at all.\n */\n skeleton?: boolean | ReactNode;\n\n /**\n * A derived row under the grid — an order's total, a count.\n *\n * A **slot**, because an aggregate cannot come from metadata: summing\n * `OrderItem.amount` is wrong (minor units, and several currencies once a\n * basket spans vendors) and summing `quantity` across offerings means\n * nothing. The control renders what it is given and invents no arithmetic.\n */\n footer?: (rows: readonly EntityRowDraft[]) => ReactNode;\n\n className?: string;\n}\n"],"names":[],"mappings":"AAGA,WAkDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-detail-grid/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-detail-grid/index.ts"],"sourcesContent":["export * from './entity-detail-grid.js';\nexport * from './entity-detail-grid.types.js';\n"],"names":[],"mappings":"AAAA,cAAc,0BAA0B;AACxC,cAAc,gCAAgC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Entity } from '@entifix/core';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { EntityFieldRenderContext } from './entity-form.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The declarative customization API, mirroring `entity-table`'s slots: an
|
|
6
|
+
* `<EntityField>` is configuration expressed as JSX. It never renders itself —
|
|
7
|
+
* `EntityForm` reads its props and decides where the override applies — so a
|
|
8
|
+
* simple form stays a single self-closing tag while a complex one overrides one
|
|
9
|
+
* field's control (e.g. an entity-link picker) without an options object.
|
|
10
|
+
*/
|
|
11
|
+
export interface EntityFieldSlotProps<TEntity extends Entity = Entity> {
|
|
12
|
+
/** Accessor name. An unknown name adds a computed, entity-less field. */
|
|
13
|
+
field: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
order?: number;
|
|
16
|
+
/** Drop this field from the form entirely. */
|
|
17
|
+
hidden?: boolean;
|
|
18
|
+
/** Custom edit control. */
|
|
19
|
+
render?: (context: EntityFieldRenderContext) => ReactNode;
|
|
20
|
+
/** Custom read display. */
|
|
21
|
+
readRender?: (entity: TEntity | undefined) => ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** Overrides one metadata-derived field, or adds a computed one. */
|
|
24
|
+
export declare function EntityField<TEntity extends Entity = Entity>(_props: EntityFieldSlotProps<TEntity>): ReactNode;
|
|
25
|
+
export interface EntityActionsSlotProps {
|
|
26
|
+
/** Where the nodes go: beside the title, or beside Save. */
|
|
27
|
+
placement?: 'header' | 'footer';
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The genuinely bespoke action, so a page never has to render outside the card.
|
|
32
|
+
*
|
|
33
|
+
* Everything metadata can describe should be a `@useCase()` — that is what
|
|
34
|
+
* makes it permission-filtered, translatable and reachable from the command
|
|
35
|
+
* palette. This slot is for what metadata cannot: an action wired to something
|
|
36
|
+
* only this page knows, a link into another product, a one-off. It renders
|
|
37
|
+
* *after* the declared verbs so the derived actions keep a stable position.
|
|
38
|
+
*/
|
|
39
|
+
export declare function EntityActions(_props: EntityActionsSlotProps): ReactNode;
|
|
40
|
+
export interface EntityFormSlots<TEntity extends Entity> {
|
|
41
|
+
fields: Array<EntityFieldSlotProps<TEntity>>;
|
|
42
|
+
/** Bespoke actions, by placement. */
|
|
43
|
+
headerActions: ReactNode[];
|
|
44
|
+
footerActions: ReactNode[];
|
|
45
|
+
/** Children that matched no slot — rendered below the fields untouched. */
|
|
46
|
+
rest: ReactNode[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Sorts children into slots by component identity (survives minification and
|
|
50
|
+
* cannot collide with an unrelated component of the same name).
|
|
51
|
+
*/
|
|
52
|
+
export declare function readEntityFormFields<TEntity extends Entity>(children: ReactNode): EntityFormSlots<TEntity>;
|
|
53
|
+
//# sourceMappingURL=entity-form-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-form-slots.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-form/entity-form-slots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACnE,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,SAAS,CAAC;IAC1D,2BAA2B;IAC3B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,KAAK,SAAS,CAAC;CACzD;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EACzD,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,GACpC,SAAS,CAEX;AAED,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,SAAS,CAEvE;AAED,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,MAAM;IACrD,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7C,qCAAqC;IACrC,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,2EAA2E;IAC3E,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,MAAM,EACzD,QAAQ,EAAE,SAAS,GAClB,eAAe,CAAC,OAAO,CAAC,CA6B1B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Children, isValidElement } from 'react';
|
|
2
|
+
/** Overrides one metadata-derived field, or adds a computed one. */ export function EntityField(_props) {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The genuinely bespoke action, so a page never has to render outside the card.
|
|
7
|
+
*
|
|
8
|
+
* Everything metadata can describe should be a `@useCase()` — that is what
|
|
9
|
+
* makes it permission-filtered, translatable and reachable from the command
|
|
10
|
+
* palette. This slot is for what metadata cannot: an action wired to something
|
|
11
|
+
* only this page knows, a link into another product, a one-off. It renders
|
|
12
|
+
* *after* the declared verbs so the derived actions keep a stable position.
|
|
13
|
+
*/ export function EntityActions(_props) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sorts children into slots by component identity (survives minification and
|
|
18
|
+
* cannot collide with an unrelated component of the same name).
|
|
19
|
+
*/ export function readEntityFormFields(children) {
|
|
20
|
+
const slots = {
|
|
21
|
+
fields: [],
|
|
22
|
+
headerActions: [],
|
|
23
|
+
footerActions: [],
|
|
24
|
+
rest: []
|
|
25
|
+
};
|
|
26
|
+
Children.toArray(children).forEach((child)=>{
|
|
27
|
+
if (!/*#__PURE__*/ isValidElement(child)) {
|
|
28
|
+
slots.rest.push(child);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (child.type === EntityField) {
|
|
32
|
+
slots.fields.push(child.props);
|
|
33
|
+
} else if (child.type === EntityActions) {
|
|
34
|
+
const props = child.props;
|
|
35
|
+
const target = props.placement === 'header' ? slots.headerActions : slots.footerActions;
|
|
36
|
+
target.push(props.children);
|
|
37
|
+
} else {
|
|
38
|
+
slots.rest.push(child);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return slots;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=entity-form-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-form/entity-form-slots.tsx"],"sourcesContent":["import type { Entity } from '@entifix/core';\nimport { Children, isValidElement, type ReactNode } from 'react';\n\nimport type { EntityFieldRenderContext } from './entity-form.types.js';\n\n/**\n * The declarative customization API, mirroring `entity-table`'s slots: an\n * `<EntityField>` is configuration expressed as JSX. It never renders itself —\n * `EntityForm` reads its props and decides where the override applies — so a\n * simple form stays a single self-closing tag while a complex one overrides one\n * field's control (e.g. an entity-link picker) without an options object.\n */\nexport interface EntityFieldSlotProps<TEntity extends Entity = Entity> {\n /** Accessor name. An unknown name adds a computed, entity-less field. */\n field: string;\n label?: string;\n order?: number;\n /** Drop this field from the form entirely. */\n hidden?: boolean;\n /** Custom edit control. */\n render?: (context: EntityFieldRenderContext) => ReactNode;\n /** Custom read display. */\n readRender?: (entity: TEntity | undefined) => ReactNode;\n}\n\n/** Overrides one metadata-derived field, or adds a computed one. */\nexport function EntityField<TEntity extends Entity = Entity>(\n _props: EntityFieldSlotProps<TEntity>,\n): ReactNode {\n return null;\n}\n\nexport interface EntityActionsSlotProps {\n /** Where the nodes go: beside the title, or beside Save. */\n placement?: 'header' | 'footer';\n children?: ReactNode;\n}\n\n/**\n * The genuinely bespoke action, so a page never has to render outside the card.\n *\n * Everything metadata can describe should be a `@useCase()` — that is what\n * makes it permission-filtered, translatable and reachable from the command\n * palette. This slot is for what metadata cannot: an action wired to something\n * only this page knows, a link into another product, a one-off. It renders\n * *after* the declared verbs so the derived actions keep a stable position.\n */\nexport function EntityActions(_props: EntityActionsSlotProps): ReactNode {\n return null;\n}\n\nexport interface EntityFormSlots<TEntity extends Entity> {\n fields: Array<EntityFieldSlotProps<TEntity>>;\n /** Bespoke actions, by placement. */\n headerActions: ReactNode[];\n footerActions: ReactNode[];\n /** Children that matched no slot — rendered below the fields untouched. */\n rest: ReactNode[];\n}\n\n/**\n * Sorts children into slots by component identity (survives minification and\n * cannot collide with an unrelated component of the same name).\n */\nexport function readEntityFormFields<TEntity extends Entity>(\n children: ReactNode,\n): EntityFormSlots<TEntity> {\n const slots: EntityFormSlots<TEntity> = {\n fields: [],\n headerActions: [],\n footerActions: [],\n rest: [],\n };\n\n Children.toArray(children).forEach(child => {\n if (!isValidElement(child)) {\n slots.rest.push(child);\n return;\n }\n\n if (child.type === EntityField) {\n slots.fields.push(child.props as EntityFieldSlotProps<TEntity>);\n } else if (child.type === EntityActions) {\n const props = child.props as EntityActionsSlotProps;\n const target =\n props.placement === 'header'\n ? slots.headerActions\n : slots.footerActions;\n target.push(props.children);\n } else {\n slots.rest.push(child);\n }\n });\n\n return slots;\n}\n"],"names":["Children","isValidElement","EntityField","_props","EntityActions","readEntityFormFields","children","slots","fields","headerActions","footerActions","rest","toArray","forEach","child","push","type","props","target","placement"],"mappings":"AACA,SAASA,QAAQ,EAAEC,cAAc,QAAwB,QAAQ;AAwBjE,kEAAkE,GAClE,OAAO,SAASC,YACdC,MAAqC;IAErC,OAAO;AACT;AAQA;;;;;;;;CAQC,GACD,OAAO,SAASC,cAAcD,MAA8B;IAC1D,OAAO;AACT;AAWA;;;CAGC,GACD,OAAO,SAASE,qBACdC,QAAmB;IAEnB,MAAMC,QAAkC;QACtCC,QAAQ,EAAE;QACVC,eAAe,EAAE;QACjBC,eAAe,EAAE;QACjBC,MAAM,EAAE;IACV;IAEAX,SAASY,OAAO,CAACN,UAAUO,OAAO,CAACC,CAAAA;QACjC,IAAI,eAACb,eAAea,QAAQ;YAC1BP,MAAMI,IAAI,CAACI,IAAI,CAACD;YAChB;QACF;QAEA,IAAIA,MAAME,IAAI,KAAKd,aAAa;YAC9BK,MAAMC,MAAM,CAACO,IAAI,CAACD,MAAMG,KAAK;QAC/B,OAAO,IAAIH,MAAME,IAAI,KAAKZ,eAAe;YACvC,MAAMa,QAAQH,MAAMG,KAAK;YACzB,MAAMC,SACJD,MAAME,SAAS,KAAK,WAChBZ,MAAME,aAAa,GACnBF,MAAMG,aAAa;YACzBQ,OAAOH,IAAI,CAACE,MAAMX,QAAQ;QAC5B,OAAO;YACLC,MAAMI,IAAI,CAACI,IAAI,CAACD;QAClB;IACF;IAEA,OAAOP;AACT"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Entity } from '@entifix/core';
|
|
2
|
+
import type { EntityFormProps } from './entity-form.types.js';
|
|
3
|
+
export declare function EntityForm<TEntity extends Entity>({ entityConstructor, entity, values, onFieldChange, linkSources, onLinkChange, mode: modeProp, defaultMode, onModeChange, errors, formError, onSubmit, onDelete, embedded, isLoading, skeleton, isSaving, isDeleting, error, backHref, title, metadata, isMetadataLoading, onUseCase, onClone, children, }: EntityFormProps<TEntity>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=entity-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-form.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-form/entity-form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,MAAM,EASZ,MAAM,eAAe,CAAC;AAsBvB,OAAO,KAAK,EAGV,eAAe,EAChB,MAAM,wBAAwB,CAAC;AA6DhC,wBAAgB,UAAU,CAAC,OAAO,SAAS,MAAM,EAAE,EACjD,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,aAAa,EACb,WAAW,EACX,YAAY,EACZ,IAAI,EAAE,QAAQ,EACd,WAAW,EACX,YAAY,EACZ,MAAM,EACN,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,SAAiB,EACjB,QAAe,EACf,QAAgB,EAChB,UAAkB,EAClB,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,iBAAyB,EACzB,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,eAAe,CAAC,OAAO,CAAC,+BAuW1B"}
|