@open-mercato/ui 0.6.7-develop.6758.1.697eade236 → 0.6.7-develop.6766.1.40c9011995
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/CrudForm.js +4 -3
- package/dist/backend/CrudForm.js.map +2 -2
- package/dist/backend/DataTable.js +10 -9
- package/dist/backend/DataTable.js.map +2 -2
- package/dist/backend/injection/spotIds.js +23 -18
- package/dist/backend/injection/spotIds.js.map +2 -2
- package/package.json +3 -3
- package/src/backend/CrudForm.tsx +8 -3
- package/src/backend/DataTable.tsx +11 -10
- package/src/backend/injection/__tests__/spotIds.extension-points.test.ts +38 -0
- package/src/backend/injection/spotIds.ts +23 -18
|
@@ -46,6 +46,7 @@ import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
|
46
46
|
import { flash } from "./FlashMessages.js";
|
|
47
47
|
import { useConfirmDialog } from "./confirm-dialog/index.js";
|
|
48
48
|
import { ComponentReplacementHandles } from "@open-mercato/shared/modules/widgets/component-registry";
|
|
49
|
+
import { dataTableExtensionSpotId, extensionSpotChildId } from "@open-mercato/shared/modules/widgets/extension-points";
|
|
49
50
|
import { insertByInjectionPlacement } from "@open-mercato/shared/modules/widgets/injection-position";
|
|
50
51
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
51
52
|
import { getDefaultOperator, isAdvancedFilterState, flatToTree } from "@open-mercato/shared/lib/query/advanced-filter";
|
|
@@ -932,7 +933,7 @@ function DataTable({
|
|
|
932
933
|
if (injectionSpotId?.startsWith("data-table:")) return injectionSpotId.slice("data-table:".length);
|
|
933
934
|
return null;
|
|
934
935
|
}, [injectionSpotId, perspective?.tableId, extensionTableIdProp]);
|
|
935
|
-
const resolvedInjectionSpotId = injectionSpotId ?? (perspective?.tableId ?
|
|
936
|
+
const resolvedInjectionSpotId = injectionSpotId ?? (perspective?.tableId ? dataTableExtensionSpotId(perspective.tableId) : null) ?? (extensionTableIdProp ? dataTableExtensionSpotId(extensionTableIdProp) : null);
|
|
936
937
|
const resolvedReplacementHandle = replacementHandle ?? ComponentReplacementHandles.dataTable(extensionTableId ?? "unknown");
|
|
937
938
|
const baseInjectionContext = React.useMemo(
|
|
938
939
|
() => {
|
|
@@ -944,32 +945,32 @@ function DataTable({
|
|
|
944
945
|
[injectionContext, perspective?.tableId, extensionTableId, title]
|
|
945
946
|
);
|
|
946
947
|
const headerInjectionSpotId = React.useMemo(
|
|
947
|
-
() => resolvedInjectionSpotId ?
|
|
948
|
+
() => resolvedInjectionSpotId ? extensionSpotChildId(resolvedInjectionSpotId, "header") : null,
|
|
948
949
|
[resolvedInjectionSpotId]
|
|
949
950
|
);
|
|
950
951
|
const toolbarInjectionSpotId = React.useMemo(
|
|
951
|
-
() => resolvedInjectionSpotId ?
|
|
952
|
+
() => resolvedInjectionSpotId ? extensionSpotChildId(resolvedInjectionSpotId, "toolbar") : null,
|
|
952
953
|
[resolvedInjectionSpotId]
|
|
953
954
|
);
|
|
954
955
|
const searchTrailingInjectionSpotId = React.useMemo(
|
|
955
|
-
() => resolvedInjectionSpotId ?
|
|
956
|
+
() => resolvedInjectionSpotId ? extensionSpotChildId(resolvedInjectionSpotId, "search-trailing") : null,
|
|
956
957
|
[resolvedInjectionSpotId]
|
|
957
958
|
);
|
|
958
959
|
const footerInjectionSpotId = React.useMemo(
|
|
959
|
-
() => resolvedInjectionSpotId ?
|
|
960
|
+
() => resolvedInjectionSpotId ? extensionSpotChildId(resolvedInjectionSpotId, "footer") : null,
|
|
960
961
|
[resolvedInjectionSpotId]
|
|
961
962
|
);
|
|
962
963
|
const { widgets: columnWidgets } = useInjectionDataWidgets(
|
|
963
|
-
extensionTableId ?
|
|
964
|
+
extensionTableId ? dataTableExtensionSpotId(extensionTableId, "columns") : "__disabled__:columns"
|
|
964
965
|
);
|
|
965
966
|
const { widgets: rowActionWidgets } = useInjectionDataWidgets(
|
|
966
|
-
extensionTableId ?
|
|
967
|
+
extensionTableId ? dataTableExtensionSpotId(extensionTableId, "row-actions") : "__disabled__:row-actions"
|
|
967
968
|
);
|
|
968
969
|
const { widgets: bulkActionWidgets } = useInjectionDataWidgets(
|
|
969
|
-
extensionTableId ?
|
|
970
|
+
extensionTableId ? dataTableExtensionSpotId(extensionTableId, "bulk-actions") : "__disabled__:bulk-actions"
|
|
970
971
|
);
|
|
971
972
|
const { widgets: filterWidgets } = useInjectionDataWidgets(
|
|
972
|
-
extensionTableId ?
|
|
973
|
+
extensionTableId ? dataTableExtensionSpotId(extensionTableId, "filters") : "__disabled__:filters"
|
|
973
974
|
);
|
|
974
975
|
const injectedColumnDefs = React.useMemo(() => {
|
|
975
976
|
const entries = [];
|