@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,151 @@
|
|
|
1
|
+
import type { EntifixError, Entity, EntityConstructor, EntityDraft, EntityDraftValue, EntityFieldDescriptor, EntityLinkSource, EntityMetadataDocument } from '@entifix/core';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/** Whether the form shows values as text (`read`) or as inputs (`edit`). */
|
|
4
|
+
export type EntityFormMode = 'read' | 'edit';
|
|
5
|
+
/** What a custom edit control for one field is handed. */
|
|
6
|
+
export interface EntityFieldRenderContext {
|
|
7
|
+
draft: EntityDraft;
|
|
8
|
+
value: string;
|
|
9
|
+
setField: (name: string, value: EntityDraftValue) => void;
|
|
10
|
+
/** The id the field's label points at — put it on your control. */
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A field as the form finally renders it: the metadata descriptor plus the
|
|
15
|
+
* per-field overrides a caller supplied through an `<EntityField>` slot.
|
|
16
|
+
*/
|
|
17
|
+
export interface EntityFormField<TEntity extends Entity> extends EntityFieldDescriptor {
|
|
18
|
+
/** Replaces the default edit control. */
|
|
19
|
+
render?: (context: EntityFieldRenderContext) => ReactNode;
|
|
20
|
+
/** Replaces the default read display. */
|
|
21
|
+
readRender?: (entity: TEntity | undefined) => ReactNode;
|
|
22
|
+
/** True when the field has no backing entity member (slot-only field). */
|
|
23
|
+
virtual?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface EntityFormProps<TEntity extends Entity> {
|
|
26
|
+
/** Metadata source. Fields, labels and types derive from its accessors. */
|
|
27
|
+
entityConstructor: EntityConstructor<TEntity>;
|
|
28
|
+
/** The record being viewed/edited. The read display and, in a wrapper, the
|
|
29
|
+
* initial draft both come from it; omit for a create form. */
|
|
30
|
+
entity?: TEntity;
|
|
31
|
+
/** The current draft. The form is controlled — a host (the `useEntityForm`
|
|
32
|
+
* hook or a `useState`) owns this and updates it via `onFieldChange`. */
|
|
33
|
+
values?: EntityDraft;
|
|
34
|
+
/**
|
|
35
|
+
* Called when one field changes.
|
|
36
|
+
*
|
|
37
|
+
* The value is a union rather than a string because a `composition`
|
|
38
|
+
* member's is its list of rows — the one member with no lossless string form.
|
|
39
|
+
* Every scalar editor still writes a string, so a host that only edits
|
|
40
|
+
* scalars is unaffected.
|
|
41
|
+
*/
|
|
42
|
+
onFieldChange?: (name: string, value: EntityDraftValue) => void;
|
|
43
|
+
/**
|
|
44
|
+
* A search/browse source per reference, keyed by accessor name. A `link` field
|
|
45
|
+
* with a source gets the full editor; one without keeps its read-only display,
|
|
46
|
+
* which is what a form that only shows a relation still wants.
|
|
47
|
+
*
|
|
48
|
+
* A **`string`** field with a source gets the same editor, because a foreign
|
|
49
|
+
* key whose target lives in another slice's store cannot be a typed `link` at
|
|
50
|
+
* all and is a plain id member (ADR 0022). The editor does not know the
|
|
51
|
+
* difference — it writes the target's id into the draft either way.
|
|
52
|
+
*
|
|
53
|
+
* A key naming any other member throws: `linkCollection` has no editor
|
|
54
|
+
* anywhere yet, and a `boolean`/`enum`/`number`/`date` can never name another
|
|
55
|
+
* record, so the entry could only be dropped — and a dropped source looks
|
|
56
|
+
* exactly like a member the entity declared read-only.
|
|
57
|
+
*
|
|
58
|
+
* A registry rather than a slot per relation: the whole point is that an entity
|
|
59
|
+
* declaring a reference needs no bespoke control. The sources are built by the
|
|
60
|
+
* caller because fetching them is the integration layer's job, and this package
|
|
61
|
+
* cannot reach it.
|
|
62
|
+
*/
|
|
63
|
+
linkSources?: Record<string, EntityLinkSource<any>>;
|
|
64
|
+
/**
|
|
65
|
+
* A relation was set or cleared. The instance travels alongside the id the
|
|
66
|
+
* draft holds, so a host can remember it — an id alone cannot be written as an
|
|
67
|
+
* embedded relation.
|
|
68
|
+
*/
|
|
69
|
+
onLinkChange?: (name: string, entity: Entity | undefined) => void;
|
|
70
|
+
/** Force a mode. Omit to let the form own it (with the built-in toggle). */
|
|
71
|
+
mode?: EntityFormMode;
|
|
72
|
+
/** Initial mode when uncontrolled. Defaults to `read` with an `entity`, else
|
|
73
|
+
* `edit` (a create form opens ready to type). */
|
|
74
|
+
defaultMode?: EntityFormMode;
|
|
75
|
+
onModeChange?: (mode: EntityFormMode) => void;
|
|
76
|
+
/** Per-field validation messages, keyed by field name. */
|
|
77
|
+
errors?: Record<string, string>;
|
|
78
|
+
/**
|
|
79
|
+
* A validation message that belongs to no single field — a rule spanning two
|
|
80
|
+
* of them. Rendered above the actions, since no row can host it.
|
|
81
|
+
*/
|
|
82
|
+
formError?: string;
|
|
83
|
+
onSubmit?: (draft: EntityDraft) => void;
|
|
84
|
+
onDelete?: () => void;
|
|
85
|
+
/**
|
|
86
|
+
* What this caller may do with the entity, as served by
|
|
87
|
+
* `GET /api/<entity>/$metadata` and already filtered against the verified
|
|
88
|
+
* principal (ADR 0026).
|
|
89
|
+
*
|
|
90
|
+
* **Optional, and absent means "as before".** Without it the form renders Save
|
|
91
|
+
* and Delete exactly as it always has, so a call site that has not migrated is
|
|
92
|
+
* unaffected. This is not a security control — hiding a button protects
|
|
93
|
+
* nothing; the route guard does. It is what stops a screen offering an action
|
|
94
|
+
* the service will refuse.
|
|
95
|
+
*/
|
|
96
|
+
metadata?: EntityMetadataDocument;
|
|
97
|
+
/** The document is still in flight; the action row renders as a skeleton. */
|
|
98
|
+
isMetadataLoading?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* A declared use case was invoked, by its `key`. The form renders the button
|
|
101
|
+
* and asks for confirmation where the descriptor says to; performing the act
|
|
102
|
+
* is the caller's — the browser must never import a use-case class.
|
|
103
|
+
*/
|
|
104
|
+
onUseCase?: (key: string) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Copies the record into a new draft, dropping the members declared
|
|
107
|
+
* `@accessor({ resetOnClone: true })` and always the id.
|
|
108
|
+
*
|
|
109
|
+
* A prop rather than something the form does by itself, because the *result*
|
|
110
|
+
* of a clone is a navigation — a create form holding the copy — and this
|
|
111
|
+
* package knows no router. The form supplies the cleaned draft
|
|
112
|
+
* (`cloneEntityDraft`); where it lands is the caller's.
|
|
113
|
+
*
|
|
114
|
+
* Absent renders no Clone action.
|
|
115
|
+
*/
|
|
116
|
+
onClone?: (draft: EntityDraft) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Render the **fields and nothing else** — no heading, no action row.
|
|
119
|
+
*
|
|
120
|
+
* For a form hosted inside something that already owns those controls: a
|
|
121
|
+
* wizard step sits under the wizard's own heading and advances with the
|
|
122
|
+
* wizard's own footer, so a second heading and a Save button beside Siguiente
|
|
123
|
+
* would be two controls for one job, and the Save would commit a partial
|
|
124
|
+
* record mid-flow.
|
|
125
|
+
*
|
|
126
|
+
* Opt-in and defaulted off, so every existing form is untouched.
|
|
127
|
+
*/
|
|
128
|
+
embedded?: boolean;
|
|
129
|
+
isLoading?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* What holds the form's shape while the record is in flight.
|
|
132
|
+
*
|
|
133
|
+
* `true` (the default) renders the built-in placeholder — one label+control
|
|
134
|
+
* pair per resolved field, so the swap to the real rows shifts nothing. A node
|
|
135
|
+
* replaces that default; `false` renders no placeholder at all.
|
|
136
|
+
*
|
|
137
|
+
* The placeholder *replaces* the field rows; it never stacks above them.
|
|
138
|
+
*/
|
|
139
|
+
skeleton?: boolean | ReactNode;
|
|
140
|
+
isSaving?: boolean;
|
|
141
|
+
isDeleting?: boolean;
|
|
142
|
+
/** The failure of the last load/save, shown as an alert. */
|
|
143
|
+
error?: EntifixError;
|
|
144
|
+
/** Link to return to, rendered as a `Back` action. Omit to hide it. */
|
|
145
|
+
backHref?: string;
|
|
146
|
+
/** Heading for the card. Defaults to a generic label. */
|
|
147
|
+
title?: ReactNode;
|
|
148
|
+
/** Customization slots — see `entity-form-slots`. */
|
|
149
|
+
children?: ReactNode;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=entity-form.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-form.types.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-form/entity-form.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,0DAA0D;AAC1D,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC1D,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe,CAC9B,OAAO,SAAS,MAAM,CACtB,SAAQ,qBAAqB;IAC7B,yCAAyC;IACzC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,SAAS,CAAC;IAC1D,yCAAyC;IACzC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,KAAK,SAAS,CAAC;IACxD,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,MAAM;IACrD,2EAA2E;IAC3E,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC9C;mEAC+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;8EAC0E;IAC1E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAEhE;;;;;;;;;;;;;;;;;;;OAmBG;IAIH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAElE,4EAA4E;IAC5E,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;sDACkD;IAClD,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAEvC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-form/entity-form.types.ts"],"sourcesContent":["import type {\n EntifixError,\n Entity,\n EntityConstructor,\n EntityDraft,\n EntityDraftValue,\n EntityFieldDescriptor,\n EntityLinkSource,\n EntityMetadataDocument,\n} from '@entifix/core';\nimport type { ReactNode } from 'react';\n\n/** Whether the form shows values as text (`read`) or as inputs (`edit`). */\nexport type EntityFormMode = 'read' | 'edit';\n\n/** What a custom edit control for one field is handed. */\nexport interface EntityFieldRenderContext {\n draft: EntityDraft;\n value: string;\n setField: (name: string, value: EntityDraftValue) => void;\n /** The id the field's label points at — put it on your control. */\n id: string;\n}\n\n/**\n * A field as the form finally renders it: the metadata descriptor plus the\n * per-field overrides a caller supplied through an `<EntityField>` slot.\n */\nexport interface EntityFormField<\n TEntity extends Entity,\n> extends EntityFieldDescriptor {\n /** Replaces the default edit control. */\n render?: (context: EntityFieldRenderContext) => ReactNode;\n /** Replaces the default read display. */\n readRender?: (entity: TEntity | undefined) => ReactNode;\n /** True when the field has no backing entity member (slot-only field). */\n virtual?: boolean;\n}\n\nexport interface EntityFormProps<TEntity extends Entity> {\n /** Metadata source. Fields, labels and types derive from its accessors. */\n entityConstructor: EntityConstructor<TEntity>;\n /** The record being viewed/edited. The read display and, in a wrapper, the\n * initial draft both come from it; omit for a create form. */\n entity?: TEntity;\n\n /** The current draft. The form is controlled — a host (the `useEntityForm`\n * hook or a `useState`) owns this and updates it via `onFieldChange`. */\n values?: EntityDraft;\n /**\n * Called when one field changes.\n *\n * The value is a union rather than a string because a `composition`\n * member's is its list of rows — the one member with no lossless string form.\n * Every scalar editor still writes a string, so a host that only edits\n * scalars is unaffected.\n */\n onFieldChange?: (name: string, value: EntityDraftValue) => void;\n\n /**\n * A search/browse source per reference, keyed by accessor name. A `link` field\n * with a source gets the full editor; one without keeps its read-only display,\n * which is what a form that only shows a relation still wants.\n *\n * A **`string`** field with a source gets the same editor, because a foreign\n * key whose target lives in another slice's store cannot be a typed `link` at\n * all and is a plain id member (ADR 0022). The editor does not know the\n * difference — it writes the target's id into the draft either way.\n *\n * A key naming any other member throws: `linkCollection` has no editor\n * anywhere yet, and a `boolean`/`enum`/`number`/`date` can never name another\n * record, so the entry could only be dropped — and a dropped source looks\n * exactly like a member the entity declared read-only.\n *\n * A registry rather than a slot per relation: the whole point is that an entity\n * declaring a reference needs no bespoke control. The sources are built by the\n * caller because fetching them is the integration layer's job, and this package\n * cannot reach it.\n */\n // A source's target is another entity entirely, so it cannot be expressed in\n // terms of `TEntity`; the input it feeds is instantiated per field anyway.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n linkSources?: Record<string, EntityLinkSource<any>>;\n /**\n * A relation was set or cleared. The instance travels alongside the id the\n * draft holds, so a host can remember it — an id alone cannot be written as an\n * embedded relation.\n */\n onLinkChange?: (name: string, entity: Entity | undefined) => void;\n\n /** Force a mode. Omit to let the form own it (with the built-in toggle). */\n mode?: EntityFormMode;\n /** Initial mode when uncontrolled. Defaults to `read` with an `entity`, else\n * `edit` (a create form opens ready to type). */\n defaultMode?: EntityFormMode;\n onModeChange?: (mode: EntityFormMode) => void;\n\n /** Per-field validation messages, keyed by field name. */\n errors?: Record<string, string>;\n /**\n * A validation message that belongs to no single field — a rule spanning two\n * of them. Rendered above the actions, since no row can host it.\n */\n formError?: string;\n\n onSubmit?: (draft: EntityDraft) => void;\n onDelete?: () => void;\n\n /**\n * What this caller may do with the entity, as served by\n * `GET /api/<entity>/$metadata` and already filtered against the verified\n * principal (ADR 0026).\n *\n * **Optional, and absent means \"as before\".** Without it the form renders Save\n * and Delete exactly as it always has, so a call site that has not migrated is\n * unaffected. This is not a security control — hiding a button protects\n * nothing; the route guard does. It is what stops a screen offering an action\n * the service will refuse.\n */\n metadata?: EntityMetadataDocument;\n /** The document is still in flight; the action row renders as a skeleton. */\n isMetadataLoading?: boolean;\n /**\n * A declared use case was invoked, by its `key`. The form renders the button\n * and asks for confirmation where the descriptor says to; performing the act\n * is the caller's — the browser must never import a use-case class.\n */\n onUseCase?: (key: string) => void;\n\n /**\n * Copies the record into a new draft, dropping the members declared\n * `@accessor({ resetOnClone: true })` and always the id.\n *\n * A prop rather than something the form does by itself, because the *result*\n * of a clone is a navigation — a create form holding the copy — and this\n * package knows no router. The form supplies the cleaned draft\n * (`cloneEntityDraft`); where it lands is the caller's.\n *\n * Absent renders no Clone action.\n */\n onClone?: (draft: EntityDraft) => void;\n\n /**\n * Render the **fields and nothing else** — no heading, no action row.\n *\n * For a form hosted inside something that already owns those controls: a\n * wizard step sits under the wizard's own heading and advances with the\n * wizard's own footer, so a second heading and a Save button beside Siguiente\n * would be two controls for one job, and the Save would commit a partial\n * record mid-flow.\n *\n * Opt-in and defaulted off, so every existing form is untouched.\n */\n embedded?: boolean;\n isLoading?: boolean;\n /**\n * What holds the form's shape while the record is in flight.\n *\n * `true` (the default) renders the built-in placeholder — one label+control\n * pair per resolved field, so the swap to the real rows shifts nothing. A node\n * replaces that default; `false` renders no placeholder at all.\n *\n * The placeholder *replaces* the field rows; it never stacks above them.\n */\n skeleton?: boolean | ReactNode;\n isSaving?: boolean;\n isDeleting?: boolean;\n /** The failure of the last load/save, shown as an alert. */\n error?: EntifixError;\n\n /** Link to return to, rendered as a `Back` action. Omit to hide it. */\n backHref?: string;\n /** Heading for the card. Defaults to a generic label. */\n title?: ReactNode;\n\n /** Customization slots — see `entity-form-slots`. */\n children?: ReactNode;\n}\n"],"names":[],"mappings":"AAuCA,WA0IC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-form/index.ts"],"sourcesContent":["export * from './entity-form.js';\nexport * from './entity-form.types.js';\nexport * from './entity-form-slots.js';\nexport * from './use-entity-form-fields.js';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,8BAA8B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Entity } from '@entifix/core';
|
|
2
|
+
import type { EntityFormField } from './entity-form.types.js';
|
|
3
|
+
import type { EntityFieldSlotProps } from './entity-form-slots.js';
|
|
4
|
+
/**
|
|
5
|
+
* The field pipeline as a pure function — metadata descriptors, then
|
|
6
|
+
* `<EntityField>` overrides, then declared order. Kept separate from the
|
|
7
|
+
* component so the resolution rules can be tested without React.
|
|
8
|
+
*
|
|
9
|
+
* A slot naming a member the entity does not have becomes a virtual field (a
|
|
10
|
+
* computed one); a slot with `hidden` drops its field.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveEntityFormFields<TEntity extends Entity>(described: Array<EntityFormField<TEntity>>, slotFields: Array<EntityFieldSlotProps<TEntity>>): Array<EntityFormField<TEntity>>;
|
|
13
|
+
//# sourceMappingURL=use-entity-form-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-entity-form-fields.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-form/use-entity-form-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,SAAS,MAAM,EAC5D,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAC1C,UAAU,EAAE,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,GAC/C,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAgDjC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
|
+
/**
|
|
4
|
+
* The field pipeline as a pure function — metadata descriptors, then
|
|
5
|
+
* `<EntityField>` overrides, then declared order. Kept separate from the
|
|
6
|
+
* component so the resolution rules can be tested without React.
|
|
7
|
+
*
|
|
8
|
+
* A slot naming a member the entity does not have becomes a virtual field (a
|
|
9
|
+
* computed one); a slot with `hidden` drops its field.
|
|
10
|
+
*/ export function resolveEntityFormFields(described, slotFields) {
|
|
11
|
+
const hidden = new Set(slotFields.filter((slot)=>slot.hidden).map((slot)=>slot.field));
|
|
12
|
+
const merged = described.filter((field)=>!hidden.has(field.name)).map((field)=>{
|
|
13
|
+
const slot = slotFields.find((entry)=>entry.field === field.name);
|
|
14
|
+
if (!slot) return field;
|
|
15
|
+
const { field: _field, hidden: _hidden } = slot, overrides = _object_without_properties_loose(slot, [
|
|
16
|
+
"field",
|
|
17
|
+
"hidden"
|
|
18
|
+
]);
|
|
19
|
+
return _extends({}, field, Object.fromEntries(Object.entries(overrides).filter(([, value])=>value !== undefined)));
|
|
20
|
+
});
|
|
21
|
+
const virtual = slotFields.filter((slot)=>!slot.hidden && !described.some((field)=>field.name === slot.field)).map((slot, index)=>{
|
|
22
|
+
var _slot_label, _slot_order;
|
|
23
|
+
return {
|
|
24
|
+
name: slot.field,
|
|
25
|
+
key: slot.field,
|
|
26
|
+
label: (_slot_label = slot.label) != null ? _slot_label : slot.field,
|
|
27
|
+
type: 'string',
|
|
28
|
+
sortable: false,
|
|
29
|
+
filterable: false,
|
|
30
|
+
order: (_slot_order = slot.order) != null ? _slot_order : described.length + index,
|
|
31
|
+
readonly: false,
|
|
32
|
+
required: false,
|
|
33
|
+
linkLabelProperty: 'name',
|
|
34
|
+
linkSearchProperty: 'name',
|
|
35
|
+
linkSerialization: 'id',
|
|
36
|
+
// A slot-only column has no accessor, so there is nothing for a copy to
|
|
37
|
+
// reset — the value is computed from members that are cloned themselves.
|
|
38
|
+
resetOnClone: false,
|
|
39
|
+
render: slot.render,
|
|
40
|
+
readRender: slot.readRender,
|
|
41
|
+
virtual: true
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
return [
|
|
45
|
+
...merged,
|
|
46
|
+
...virtual
|
|
47
|
+
].sort((left, right)=>left.order - right.order);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=use-entity-form-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-form/use-entity-form-fields.ts"],"sourcesContent":["import type { Entity } from '@entifix/core';\n\nimport type { EntityFormField } from './entity-form.types.js';\nimport type { EntityFieldSlotProps } from './entity-form-slots.js';\n\n/**\n * The field pipeline as a pure function — metadata descriptors, then\n * `<EntityField>` overrides, then declared order. Kept separate from the\n * component so the resolution rules can be tested without React.\n *\n * A slot naming a member the entity does not have becomes a virtual field (a\n * computed one); a slot with `hidden` drops its field.\n */\nexport function resolveEntityFormFields<TEntity extends Entity>(\n described: Array<EntityFormField<TEntity>>,\n slotFields: Array<EntityFieldSlotProps<TEntity>>,\n): Array<EntityFormField<TEntity>> {\n const hidden = new Set(\n slotFields.filter(slot => slot.hidden).map(slot => slot.field),\n );\n\n const merged = described\n .filter(field => !hidden.has(field.name))\n .map(field => {\n const slot = slotFields.find(entry => entry.field === field.name);\n if (!slot) return field;\n const { field: _field, hidden: _hidden, ...overrides } = slot;\n return {\n ...field,\n ...Object.fromEntries(\n Object.entries(overrides).filter(([, value]) => value !== undefined),\n ),\n } as EntityFormField<TEntity>;\n });\n\n const virtual = slotFields\n .filter(\n slot =>\n !slot.hidden && !described.some(field => field.name === slot.field),\n )\n .map<EntityFormField<TEntity>>((slot, index) => ({\n name: slot.field,\n key: slot.field,\n label: slot.label ?? slot.field,\n type: 'string',\n sortable: false,\n filterable: false,\n order: slot.order ?? described.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 render: slot.render,\n readRender: slot.readRender,\n virtual: true,\n }));\n\n return [...merged, ...virtual].sort(\n (left, right) => left.order - right.order,\n );\n}\n"],"names":["resolveEntityFormFields","described","slotFields","hidden","Set","filter","slot","map","field","merged","has","name","find","entry","_field","_hidden","overrides","Object","fromEntries","entries","value","undefined","virtual","some","index","key","label","type","sortable","filterable","order","length","readonly","required","linkLabelProperty","linkSearchProperty","linkSerialization","resetOnClone","render","readRender","sort","left","right"],"mappings":";;AAKA;;;;;;;CAOC,GACD,OAAO,SAASA,wBACdC,SAA0C,EAC1CC,UAAgD;IAEhD,MAAMC,SAAS,IAAIC,IACjBF,WAAWG,MAAM,CAACC,CAAAA,OAAQA,KAAKH,MAAM,EAAEI,GAAG,CAACD,CAAAA,OAAQA,KAAKE,KAAK;IAG/D,MAAMC,SAASR,UACZI,MAAM,CAACG,CAAAA,QAAS,CAACL,OAAOO,GAAG,CAACF,MAAMG,IAAI,GACtCJ,GAAG,CAACC,CAAAA;QACH,MAAMF,OAAOJ,WAAWU,IAAI,CAACC,CAAAA,QAASA,MAAML,KAAK,KAAKA,MAAMG,IAAI;QAChE,IAAI,CAACL,MAAM,OAAOE;QAClB,MAAM,EAAEA,OAAOM,MAAM,EAAEX,QAAQY,OAAO,EAAgB,GAAGT,MAAdU,6CAAcV;;;;QACzD,OAAO,aACFE,OACAS,OAAOC,WAAW,CACnBD,OAAOE,OAAO,CAACH,WAAWX,MAAM,CAAC,CAAC,GAAGe,MAAM,GAAKA,UAAUC;IAGhE;IAEF,MAAMC,UAAUpB,WACbG,MAAM,CACLC,CAAAA,OACE,CAACA,KAAKH,MAAM,IAAI,CAACF,UAAUsB,IAAI,CAACf,CAAAA,QAASA,MAAMG,IAAI,KAAKL,KAAKE,KAAK,GAErED,GAAG,CAA2B,CAACD,MAAMkB;YAG7BlB,aAIAA;eAPwC;YAC/CK,MAAML,KAAKE,KAAK;YAChBiB,KAAKnB,KAAKE,KAAK;YACfkB,KAAK,GAAEpB,cAAAA,KAAKoB,KAAK,YAAVpB,cAAcA,KAAKE,KAAK;YAC/BmB,MAAM;YACNC,UAAU;YACVC,YAAY;YACZC,KAAK,GAAExB,cAAAA,KAAKwB,KAAK,YAAVxB,cAAcL,UAAU8B,MAAM,GAAGP;YACxCQ,UAAU;YACVC,UAAU;YACVC,mBAAmB;YACnBC,oBAAoB;YACpBC,mBAAmB;YACnB,wEAAwE;YACxE,yEAAyE;YACzEC,cAAc;YACdC,QAAQhC,KAAKgC,MAAM;YACnBC,YAAYjC,KAAKiC,UAAU;YAC3BjB,SAAS;QACX;;IAEF,OAAO;WAAIb;WAAWa;KAAQ,CAACkB,IAAI,CACjC,CAACC,MAAMC,QAAUD,KAAKX,KAAK,GAAGY,MAAMZ,KAAK;AAE7C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Entity, MetaAccessorType } from '@entifix/core';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { EntityTableColumn } from './entity-table.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The declarative customization API. Slots are configuration expressed as JSX:
|
|
6
|
+
* they never render themselves — `EntityTable` reads their props and decides
|
|
7
|
+
* where the configuration applies. That keeps simple tables to a single
|
|
8
|
+
* self-closing tag while complex ones stay declarative instead of drowning in
|
|
9
|
+
* option objects.
|
|
10
|
+
*/
|
|
11
|
+
export interface EntityColumnProps<TEntity extends Entity = Entity> {
|
|
12
|
+
/** Accessor name. Unknown names create an extra, entity-less column. */
|
|
13
|
+
field: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
header?: ReactNode;
|
|
16
|
+
type?: MetaAccessorType;
|
|
17
|
+
order?: number;
|
|
18
|
+
sortable?: boolean;
|
|
19
|
+
filterable?: boolean;
|
|
20
|
+
render?: (item: TEntity) => ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/** Overrides one metadata-derived column, or adds a computed one. */
|
|
23
|
+
export declare function EntityColumn<TEntity extends Entity = Entity>(_props: EntityColumnProps<TEntity>): ReactNode;
|
|
24
|
+
export interface EntityTableHeaderProps<TEntity extends Entity = Entity> {
|
|
25
|
+
/** Replaces the whole header row. Receives the resolved visible columns. */
|
|
26
|
+
render: (columns: Array<EntityTableColumn<TEntity>>) => ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare function EntityTableHeader<TEntity extends Entity = Entity>(_props: EntityTableHeaderProps<TEntity>): ReactNode;
|
|
29
|
+
export interface EntityTableRowProps<TEntity extends Entity = Entity> {
|
|
30
|
+
/** Replaces the whole body row for every item. */
|
|
31
|
+
render: (item: TEntity, columns: Array<EntityTableColumn<TEntity>>) => ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function EntityTableRow<TEntity extends Entity = Entity>(_props: EntityTableRowProps<TEntity>): ReactNode;
|
|
34
|
+
export interface EntityTableToolbarProps {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/** Extra actions placed alongside the built-in toolbar controls. */
|
|
38
|
+
export declare function EntityTableToolbar(_props: EntityTableToolbarProps): ReactNode;
|
|
39
|
+
export interface EntityTableSlots<TEntity extends Entity> {
|
|
40
|
+
columns: Array<EntityColumnProps<TEntity>>;
|
|
41
|
+
header?: EntityTableHeaderProps<TEntity>;
|
|
42
|
+
row?: EntityTableRowProps<TEntity>;
|
|
43
|
+
toolbar?: ReactNode;
|
|
44
|
+
/** Children that matched no slot — rendered below the table untouched. */
|
|
45
|
+
rest: ReactNode[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Sorts children into slots.
|
|
49
|
+
*
|
|
50
|
+
* Matching is by component identity rather than by `displayName`: identity
|
|
51
|
+
* survives minification and cannot collide with an unrelated component that
|
|
52
|
+
* happens to share a name.
|
|
53
|
+
*/
|
|
54
|
+
export declare function readEntityTableSlots<TEntity extends Entity>(children: ReactNode): EntityTableSlots<TEntity>;
|
|
55
|
+
//# sourceMappingURL=entity-table-slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-table-slots.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table-slots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;;GAMG;AAEH,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAChE,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC;CACvC;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC1D,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GACjC,SAAS,CAEX;AAED,MAAM,WAAW,sBAAsB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACrE,4EAA4E;IAC5E,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,KAAK,SAAS,CAAC;CACnE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/D,MAAM,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACtC,SAAS,CAEX;AAED,MAAM,WAAW,mBAAmB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAClE,kDAAkD;IAClD,MAAM,EAAE,CACN,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,KACvC,SAAS,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC5D,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,GACnC,SAAS,CAEX;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,uBAAuB,GAAG,SAAS,CAE7E;AAED,MAAM,WAAW,gBAAgB,CAAC,OAAO,SAAS,MAAM;IACtD,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,0EAA0E;IAC1E,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,MAAM,EACzD,QAAQ,EAAE,SAAS,GAClB,gBAAgB,CAAC,OAAO,CAAC,CA4B3B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Children, isValidElement } from 'react';
|
|
2
|
+
/** Overrides one metadata-derived column, or adds a computed one. */ export function EntityColumn(_props) {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
export function EntityTableHeader(_props) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
export function EntityTableRow(_props) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
/** Extra actions placed alongside the built-in toolbar controls. */ export function EntityTableToolbar(_props) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Sorts children into slots.
|
|
16
|
+
*
|
|
17
|
+
* Matching is by component identity rather than by `displayName`: identity
|
|
18
|
+
* survives minification and cannot collide with an unrelated component that
|
|
19
|
+
* happens to share a name.
|
|
20
|
+
*/ export function readEntityTableSlots(children) {
|
|
21
|
+
const slots = {
|
|
22
|
+
columns: [],
|
|
23
|
+
rest: []
|
|
24
|
+
};
|
|
25
|
+
Children.toArray(children).forEach((child)=>{
|
|
26
|
+
if (!/*#__PURE__*/ isValidElement(child)) {
|
|
27
|
+
slots.rest.push(child);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
switch(child.type){
|
|
31
|
+
case EntityColumn:
|
|
32
|
+
slots.columns.push(child.props);
|
|
33
|
+
break;
|
|
34
|
+
case EntityTableHeader:
|
|
35
|
+
slots.header = child.props;
|
|
36
|
+
break;
|
|
37
|
+
case EntityTableRow:
|
|
38
|
+
slots.row = child.props;
|
|
39
|
+
break;
|
|
40
|
+
case EntityTableToolbar:
|
|
41
|
+
slots.toolbar = child.props.children;
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
slots.rest.push(child);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return slots;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=entity-table-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/ui/organisms/entity-table/entity-table-slots.tsx"],"sourcesContent":["import type { Entity, MetaAccessorType } from '@entifix/core';\nimport { Children, isValidElement, type ReactNode } from 'react';\n\nimport type { EntityTableColumn } from './entity-table.types.js';\n\n/**\n * The declarative customization API. Slots are configuration expressed as JSX:\n * they never render themselves — `EntityTable` reads their props and decides\n * where the configuration applies. That keeps simple tables to a single\n * self-closing tag while complex ones stay declarative instead of drowning in\n * option objects.\n */\n\nexport interface EntityColumnProps<TEntity extends Entity = Entity> {\n /** Accessor name. Unknown names create an extra, entity-less column. */\n field: string;\n label?: string;\n header?: ReactNode;\n type?: MetaAccessorType;\n order?: number;\n sortable?: boolean;\n filterable?: boolean;\n render?: (item: TEntity) => ReactNode;\n}\n\n/** Overrides one metadata-derived column, or adds a computed one. */\nexport function EntityColumn<TEntity extends Entity = Entity>(\n _props: EntityColumnProps<TEntity>,\n): ReactNode {\n return null;\n}\n\nexport interface EntityTableHeaderProps<TEntity extends Entity = Entity> {\n /** Replaces the whole header row. Receives the resolved visible columns. */\n render: (columns: Array<EntityTableColumn<TEntity>>) => ReactNode;\n}\n\nexport function EntityTableHeader<TEntity extends Entity = Entity>(\n _props: EntityTableHeaderProps<TEntity>,\n): ReactNode {\n return null;\n}\n\nexport interface EntityTableRowProps<TEntity extends Entity = Entity> {\n /** Replaces the whole body row for every item. */\n render: (\n item: TEntity,\n columns: Array<EntityTableColumn<TEntity>>,\n ) => ReactNode;\n}\n\nexport function EntityTableRow<TEntity extends Entity = Entity>(\n _props: EntityTableRowProps<TEntity>,\n): ReactNode {\n return null;\n}\n\nexport interface EntityTableToolbarProps {\n children?: ReactNode;\n}\n\n/** Extra actions placed alongside the built-in toolbar controls. */\nexport function EntityTableToolbar(_props: EntityTableToolbarProps): ReactNode {\n return null;\n}\n\nexport interface EntityTableSlots<TEntity extends Entity> {\n columns: Array<EntityColumnProps<TEntity>>;\n header?: EntityTableHeaderProps<TEntity>;\n row?: EntityTableRowProps<TEntity>;\n toolbar?: ReactNode;\n /** Children that matched no slot — rendered below the table untouched. */\n rest: ReactNode[];\n}\n\n/**\n * Sorts children into slots.\n *\n * Matching is by component identity rather than by `displayName`: identity\n * survives minification and cannot collide with an unrelated component that\n * happens to share a name.\n */\nexport function readEntityTableSlots<TEntity extends Entity>(\n children: ReactNode,\n): EntityTableSlots<TEntity> {\n const slots: EntityTableSlots<TEntity> = { columns: [], rest: [] };\n\n Children.toArray(children).forEach(child => {\n if (!isValidElement(child)) {\n slots.rest.push(child);\n return;\n }\n\n switch (child.type) {\n case EntityColumn:\n slots.columns.push(child.props as EntityColumnProps<TEntity>);\n break;\n case EntityTableHeader:\n slots.header = child.props as EntityTableHeaderProps<TEntity>;\n break;\n case EntityTableRow:\n slots.row = child.props as EntityTableRowProps<TEntity>;\n break;\n case EntityTableToolbar:\n slots.toolbar = (child.props as EntityTableToolbarProps).children;\n break;\n default:\n slots.rest.push(child);\n }\n });\n\n return slots;\n}\n"],"names":["Children","isValidElement","EntityColumn","_props","EntityTableHeader","EntityTableRow","EntityTableToolbar","readEntityTableSlots","children","slots","columns","rest","toArray","forEach","child","push","type","props","header","row","toolbar"],"mappings":"AACA,SAASA,QAAQ,EAAEC,cAAc,QAAwB,QAAQ;AAwBjE,mEAAmE,GACnE,OAAO,SAASC,aACdC,MAAkC;IAElC,OAAO;AACT;AAOA,OAAO,SAASC,kBACdD,MAAuC;IAEvC,OAAO;AACT;AAUA,OAAO,SAASE,eACdF,MAAoC;IAEpC,OAAO;AACT;AAMA,kEAAkE,GAClE,OAAO,SAASG,mBAAmBH,MAA+B;IAChE,OAAO;AACT;AAWA;;;;;;CAMC,GACD,OAAO,SAASI,qBACdC,QAAmB;IAEnB,MAAMC,QAAmC;QAAEC,SAAS,EAAE;QAAEC,MAAM,EAAE;IAAC;IAEjEX,SAASY,OAAO,CAACJ,UAAUK,OAAO,CAACC,CAAAA;QACjC,IAAI,eAACb,eAAea,QAAQ;YAC1BL,MAAME,IAAI,CAACI,IAAI,CAACD;YAChB;QACF;QAEA,OAAQA,MAAME,IAAI;YAChB,KAAKd;gBACHO,MAAMC,OAAO,CAACK,IAAI,CAACD,MAAMG,KAAK;gBAC9B;YACF,KAAKb;gBACHK,MAAMS,MAAM,GAAGJ,MAAMG,KAAK;gBAC1B;YACF,KAAKZ;gBACHI,MAAMU,GAAG,GAAGL,MAAMG,KAAK;gBACvB;YACF,KAAKX;gBACHG,MAAMW,OAAO,GAAG,AAACN,MAAMG,KAAK,CAA6BT,QAAQ;gBACjE;YACF;gBACEC,MAAME,IAAI,CAACI,IAAI,CAACD;QACpB;IACF;IAEA,OAAOL;AACT"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Entity } from '@entifix/core';
|
|
2
|
+
import type { EntityTableProps } from './entity-table.types.js';
|
|
3
|
+
export declare function EntityTable<TEntity extends Entity>({ entityConstructor, isLoading, skeleton, error, items, totalItems, currentPage, pageSize, onPageChange, onPageSizeChange, hrefFor, newHref, onSelect, preferencesKey, showControls, pivotBreakpoint, filtering, sorting, onFilteringChange, onSortingChange, selection, onSelectionChange, metadata, isMetadataLoading, onBulkUseCase, onUseCase, bulkOutcomes, onBulkDismiss, onBulkRetry, isBulkRunning, children, }: EntityTableProps<TEntity>): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=entity-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-table.d.ts","sourceRoot":"","sources":["../../../../src/ui/organisms/entity-table/entity-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EAUZ,MAAM,eAAe,CAAC;AA8BvB,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAwDjC,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,EAAE,EAClD,iBAAiB,EACjB,SAAS,EACT,QAAe,EACf,KAAK,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,QAAQ,EACR,cAAc,EACd,YAAmB,EACnB,eAAsB,EACtB,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,iBAAyB,EACzB,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAqB,EACrB,QAAQ,GACT,EAAE,gBAAgB,CAAC,OAAO,CAAC,+BAopB3B"}
|