@osdk/react-components 0.22.0 → 0.22.1-main-2e92b908fc461ab107d493cb0aa71a1be400ef2f
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/CHANGELOG.md +10 -0
- package/build/browser/object-table/hooks/useRowSelection.js +8 -3
- package/build/browser/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/chunk-23N6K2BP.cjs +11 -0
- package/build/cjs/{chunk-SBENFO5U.cjs.map → chunk-23N6K2BP.cjs.map} +1 -1
- package/build/cjs/{chunk-B6AIDSEZ.cjs → chunk-5263W3VC.cjs} +4 -4
- package/build/cjs/{chunk-B6AIDSEZ.cjs.map → chunk-5263W3VC.cjs.map} +1 -1
- package/build/cjs/{chunk-V3TF4PWW.cjs → chunk-7GZEFXBQ.cjs} +4 -4
- package/build/cjs/{chunk-V3TF4PWW.cjs.map → chunk-7GZEFXBQ.cjs.map} +1 -1
- package/build/cjs/{chunk-XUVWBVTL.cjs → chunk-CSSQ2OPC.cjs} +6 -6
- package/build/cjs/{chunk-XUVWBVTL.cjs.map → chunk-CSSQ2OPC.cjs.map} +1 -1
- package/build/cjs/{chunk-O3L7F3SI.cjs → chunk-DHQJOBAG.cjs} +3 -3
- package/build/cjs/chunk-DHQJOBAG.cjs.map +1 -0
- package/build/cjs/chunk-F2DOMIN5.cjs +11 -0
- package/build/cjs/{chunk-A3TEU5AA.cjs.map → chunk-F2DOMIN5.cjs.map} +1 -1
- package/build/cjs/{chunk-XZI3NYBD.cjs → chunk-LRP4RUF7.cjs} +4 -4
- package/build/cjs/{chunk-XZI3NYBD.cjs.map → chunk-LRP4RUF7.cjs.map} +1 -1
- package/build/cjs/chunk-ML5N3Z3U.cjs +11 -0
- package/build/cjs/{chunk-AJQTGMS6.cjs.map → chunk-ML5N3Z3U.cjs.map} +1 -1
- package/build/cjs/chunk-NMLJTXBP.cjs +11 -0
- package/build/cjs/{chunk-RVEV2776.cjs.map → chunk-NMLJTXBP.cjs.map} +1 -1
- package/build/cjs/{chunk-5OTHYCAN.cjs → chunk-UADOKJLS.cjs} +4 -4
- package/build/cjs/{chunk-5OTHYCAN.cjs.map → chunk-UADOKJLS.cjs.map} +1 -1
- package/build/cjs/{chunk-6JJVLART.cjs → chunk-UUXJXQCZ.cjs} +4 -4
- package/build/cjs/{chunk-6JJVLART.cjs.map → chunk-UUXJXQCZ.cjs.map} +1 -1
- package/build/cjs/{chunk-WWOD2EMG.cjs → chunk-WEET5XI2.cjs} +4 -4
- package/build/cjs/{chunk-WWOD2EMG.cjs.map → chunk-WEET5XI2.cjs.map} +1 -1
- package/build/cjs/chunk-WZFWCAWK.cjs +11 -0
- package/build/cjs/{chunk-QWVW5PEX.cjs.map → chunk-WZFWCAWK.cjs.map} +1 -1
- package/build/cjs/public/experimental/action-form.cjs +4 -4
- package/build/cjs/public/experimental/document-viewer.cjs +4 -4
- package/build/cjs/public/experimental/email-viewer.cjs +3 -3
- package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
- package/build/cjs/public/experimental/filter-list.cjs +14 -14
- package/build/cjs/public/experimental/image-viewer.cjs +3 -3
- package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
- package/build/cjs/public/experimental/object-table.cjs +8 -8
- package/build/cjs/public/experimental/pdf-viewer.cjs +7 -7
- package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
- package/build/cjs/public/experimental/video-viewer.cjs +3 -3
- package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
- package/build/cjs/public/experimental.cjs +47 -47
- package/build/esm/object-table/hooks/useRowSelection.js +8 -3
- package/build/esm/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-A3TEU5AA.cjs +0 -11
- package/build/cjs/chunk-AJQTGMS6.cjs +0 -11
- package/build/cjs/chunk-O3L7F3SI.cjs.map +0 -1
- package/build/cjs/chunk-QWVW5PEX.cjs +0 -11
- package/build/cjs/chunk-RVEV2776.cjs +0 -11
- package/build/cjs/chunk-SBENFO5U.cjs +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
## 0.22.1-main-2e92b908fc461ab107d493cb0aa71a1be400ef2f
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5b87e4a: ObjectTable: clicking the header select-all checkbox now deselects all rows whenever any rows are selected (including the indeterminate state). Previously a partial selection promoted to "select all" on click, requiring a second click to clear.
|
|
8
|
+
- Updated dependencies [90f7fb6]
|
|
9
|
+
- @osdk/react@2.25.1-main-2e92b908fc461ab107d493cb0aa71a1be400ef2f
|
|
10
|
+
- @osdk/api@2.25.1-main-2e92b908fc461ab107d493cb0aa71a1be400ef2f
|
|
11
|
+
- @osdk/client@2.25.1-main-2e92b908fc461ab107d493cb0aa71a1be400ef2f
|
|
12
|
+
|
|
3
13
|
## 0.22.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -54,6 +54,8 @@ export function useRowSelection({
|
|
|
54
54
|
const selectedCount = useMemo(() => Object.values(rowSelectionState).filter(Boolean).length, [rowSelectionState]);
|
|
55
55
|
const totalCount = data?.length ?? 0;
|
|
56
56
|
const isAllSelected = deriveIsAllSelected(isControlled, isAllSelectedProp, internalIsAllSelected, selectedCount, totalCount);
|
|
57
|
+
const hasSelection = isAllSelected || selectedCount > 0;
|
|
58
|
+
|
|
57
59
|
// Dedupes refires when "select all" is active and data grows.
|
|
58
60
|
const lastFiredAllSelectedIdsRef = useRef(null);
|
|
59
61
|
const fireSelectionCallbacks = useEventCallback((ids, isSelectAll) => {
|
|
@@ -69,7 +71,10 @@ export function useRowSelection({
|
|
|
69
71
|
});
|
|
70
72
|
const onToggleAll = useCallback(() => {
|
|
71
73
|
if (!enableRowSelection || !data) return;
|
|
72
|
-
|
|
74
|
+
|
|
75
|
+
// Any existing selection (full or partial/indeterminate) clears on click;
|
|
76
|
+
// only an empty selection promotes to "select all".
|
|
77
|
+
const newIsAllSelected = !hasSelection;
|
|
73
78
|
const newSelectedRows = newIsAllSelected ? data.map(item => item.$primaryKey) : [];
|
|
74
79
|
if (!isControlled) {
|
|
75
80
|
setInternalIsAllSelected(newIsAllSelected);
|
|
@@ -77,7 +82,7 @@ export function useRowSelection({
|
|
|
77
82
|
}
|
|
78
83
|
lastFiredAllSelectedIdsRef.current = newIsAllSelected ? JSON.stringify(newSelectedRows) : null;
|
|
79
84
|
fireSelectionCallbacks(newSelectedRows, newIsAllSelected);
|
|
80
|
-
}, [enableRowSelection, data,
|
|
85
|
+
}, [enableRowSelection, data, hasSelection, isControlled, fireSelectionCallbacks]);
|
|
81
86
|
const onToggleRow = useCallback((rowId, rowIndex, isShiftClick = false) => {
|
|
82
87
|
if (!enableRowSelection || !data) return;
|
|
83
88
|
let newSelectedRows;
|
|
@@ -140,7 +145,7 @@ export function useRowSelection({
|
|
|
140
145
|
rowSelection: rowSelectionState,
|
|
141
146
|
isAllSelected,
|
|
142
147
|
enableRowSelection,
|
|
143
|
-
hasSelection
|
|
148
|
+
hasSelection,
|
|
144
149
|
onToggleAll,
|
|
145
150
|
onToggleRow
|
|
146
151
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRowSelection.js","names":["useCallback","useEffect","useMemo","useRef","useState","useEventCallback","getRowId","getRowIdFromPrimaryKey","useRowSelection","selectionMode","selectedRows","isAllSelected","isAllSelectedProp","onRowSelection","onRowSelectionChanged","data","internalRowSelection","setInternalRowSelection","internalIsAllSelected","setInternalIsAllSelected","lastSelectedRowIndex","setLastSelectedRowIndex","isControlled","undefined","enableRowSelection","rowSelectionState","selectedRowIds","map","item","$primaryKey","getRowSelectionState","selectedCount","Object","values","filter","Boolean","length","totalCount","deriveIsAllSelected","lastFiredAllSelectedIdsRef","fireSelectionCallbacks","ids","isSelectAll","selectedKeySet","Set","id","String","instances","has","onToggleAll","newIsAllSelected","newSelectedRows","current","JSON","stringify","onToggleRow","rowId","rowIndex","isShiftClick","getSingleSelectionRows","getRangeSelectionRows","getMultipleSelectionRows","isCurrentlySelected","serializedIds","rowSelection","hasSelection","primaryKey","rowsInRange","getRowsInRange","primaryKeysInRange","currentlySelected","getSelectedPrimaryKeys","forEach","includes","push","i","startIndex","endIndex","start","Math","min","end","max","rows","primaryKeys","reduce","acc","selectionState"],"sources":["useRowSelection.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport type { RowSelectionState } from \"@tanstack/react-table\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useEventCallback } from \"../../shared/hooks/useEventCallback.js\";\nimport { getRowId, getRowIdFromPrimaryKey } from \"../utils/getRowId.js\";\n\n/**\n * Payload delivered by {@link UseRowSelectionProps.onRowSelectionChanged}.\n * Mirrors the OSDK-level `RowSelectionChange` but without the `objectSet`\n * field, which requires OSDK context and is composed in `ObjectTable`.\n */\nexport interface UseRowSelectionChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n selectedRows: Osdk.Instance<\n Q,\n \"$allBaseProperties\",\n PropertyKeys<Q>,\n RDPs\n >[];\n isSelectAll: boolean;\n}\n\nexport interface UseRowSelectionProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n selectedRows?: PrimaryKeyType<Q>[];\n isAllSelected?: boolean;\n /**\n * @deprecated Use {@link onRowSelectionChanged} instead.\n */\n onRowSelection?: (\n selectedRowIds: PrimaryKeyType<Q>[],\n isSelectAll: boolean,\n ) => void;\n onRowSelectionChanged?: (\n change: UseRowSelectionChange<Q, RDPs>,\n ) => void;\n data:\n | Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>\n | undefined;\n}\n\nexport interface UseRowSelectionResult {\n rowSelection: RowSelectionState;\n isAllSelected: boolean;\n hasSelection: boolean;\n enableRowSelection: boolean;\n onToggleAll: () => void;\n onToggleRow: (\n rowId: string,\n rowIndex: number,\n isShiftClick?: boolean,\n ) => void;\n}\n\nexport function useRowSelection<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>({\n selectionMode = \"none\",\n selectedRows,\n isAllSelected: isAllSelectedProp,\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- intentional pass-through to fire alongside onRowSelectionChanged for backwards compatibility\n onRowSelection,\n onRowSelectionChanged,\n data,\n}: UseRowSelectionProps<Q, RDPs>): UseRowSelectionResult {\n const [internalRowSelection, setInternalRowSelection] = useState<\n RowSelectionState\n >({});\n\n // When true, newly fetched rows are auto-selected (uncontrolled mode only).\n const [internalIsAllSelected, setInternalIsAllSelected] = useState(false);\n\n const [lastSelectedRowIndex, setLastSelectedRowIndex] = useState<\n number | null\n >(null);\n\n const isControlled = selectedRows !== undefined;\n const enableRowSelection = selectionMode !== \"none\";\n\n const rowSelectionState: RowSelectionState = useMemo(() => {\n if (!enableRowSelection) return {};\n if (isControlled) {\n const selectedRowIds = isAllSelectedProp\n ? (data ?? []).map(item => item.$primaryKey)\n : selectedRows;\n return getRowSelectionState(selectedRowIds);\n }\n if (internalIsAllSelected) {\n return getRowSelectionState(\n (data ?? []).map(item => item.$primaryKey),\n );\n }\n return internalRowSelection;\n }, [\n enableRowSelection,\n isControlled,\n selectedRows,\n isAllSelectedProp,\n internalIsAllSelected,\n internalRowSelection,\n data,\n ]);\n\n const selectedCount = useMemo(\n () => Object.values(rowSelectionState).filter(Boolean).length,\n [rowSelectionState],\n );\n const totalCount = data?.length ?? 0;\n const isAllSelected = deriveIsAllSelected(\n isControlled,\n isAllSelectedProp,\n internalIsAllSelected,\n selectedCount,\n totalCount,\n );\n const hasSelection = isAllSelected || selectedCount > 0;\n\n // Dedupes refires when \"select all\" is active and data grows.\n const lastFiredAllSelectedIdsRef = useRef<string | null>(null);\n\n const fireSelectionCallbacks = useEventCallback(\n (ids: PrimaryKeyType<Q>[], isSelectAll: boolean) => {\n onRowSelection?.(ids, isSelectAll);\n if (onRowSelectionChanged) {\n const currentData = data ?? [];\n const selectedKeySet = new Set(ids.map(id => String(id)));\n const instances = currentData.filter(item =>\n selectedKeySet.has(String(item.$primaryKey))\n );\n onRowSelectionChanged({\n selectedRows: instances,\n isSelectAll,\n });\n }\n },\n );\n\n const onToggleAll = useCallback(() => {\n if (!enableRowSelection || !data) return;\n\n const newIsAllSelected = !isAllSelected;\n const newSelectedRows: PrimaryKeyType<Q>[] = newIsAllSelected\n ? data.map(item => item.$primaryKey)\n : [];\n\n if (!isControlled) {\n setInternalIsAllSelected(newIsAllSelected);\n setInternalRowSelection(getRowSelectionState(newSelectedRows));\n }\n lastFiredAllSelectedIdsRef.current = newIsAllSelected\n ? JSON.stringify(newSelectedRows)\n : null;\n fireSelectionCallbacks(newSelectedRows, newIsAllSelected);\n }, [\n enableRowSelection,\n data,\n isAllSelected,\n isControlled,\n fireSelectionCallbacks,\n ]);\n\n const onToggleRow = useCallback(\n (rowId: string, rowIndex: number, isShiftClick: boolean = false) => {\n if (!enableRowSelection || !data) return;\n\n let newSelectedRows: PrimaryKeyType<Q>[];\n\n if (selectionMode === \"single\") {\n newSelectedRows = getSingleSelectionRows({\n rowId,\n rowIndex,\n data,\n rowSelectionState,\n });\n } else {\n if (isShiftClick && lastSelectedRowIndex != null) {\n newSelectedRows = getRangeSelectionRows(\n { rowId, rowIndex, data, lastSelectedRowIndex, rowSelectionState },\n );\n setLastSelectedRowIndex(rowIndex);\n } else {\n newSelectedRows = getMultipleSelectionRows(\n { rowId, rowIndex, data, rowSelectionState },\n );\n if (\n !isCurrentlySelected<Q, RDPs>({ rowIndex, data, rowSelectionState })\n ) {\n setLastSelectedRowIndex(rowIndex);\n }\n }\n }\n if (!isControlled) {\n setInternalIsAllSelected(false);\n setInternalRowSelection(getRowSelectionState(newSelectedRows));\n }\n lastFiredAllSelectedIdsRef.current = null;\n fireSelectionCallbacks(newSelectedRows, false);\n },\n [\n enableRowSelection,\n data,\n selectionMode,\n isControlled,\n fireSelectionCallbacks,\n rowSelectionState,\n lastSelectedRowIndex,\n ],\n );\n\n // Refire callbacks when uncontrolled \"select all\" is active and new rows arrive.\n useEffect(function syncSelectAllOnDataChange() {\n if (isControlled || !internalIsAllSelected || !data) {\n if (!internalIsAllSelected) {\n lastFiredAllSelectedIdsRef.current = null;\n }\n return;\n }\n const ids = data.map(item => item.$primaryKey);\n const serializedIds = JSON.stringify(ids);\n if (lastFiredAllSelectedIdsRef.current === serializedIds) return;\n lastFiredAllSelectedIdsRef.current = serializedIds;\n fireSelectionCallbacks(ids, true);\n }, [isControlled, internalIsAllSelected, data, fireSelectionCallbacks]);\n\n return {\n rowSelection: rowSelectionState,\n isAllSelected,\n enableRowSelection,\n hasSelection,\n onToggleAll,\n onToggleRow,\n };\n}\n\ninterface GetSelectedRowsProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n rowId: string;\n rowIndex: number;\n data: Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>;\n rowSelectionState: RowSelectionState;\n lastSelectedRowIndex?: number;\n}\n\nfunction getSingleSelectionRows<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { rowId, rowIndex, data, rowSelectionState }: GetSelectedRowsProps<Q, RDPs>,\n): PrimaryKeyType<Q>[] {\n const primaryKey = data[rowIndex].$primaryKey;\n return rowSelectionState[rowId] ? [] : [primaryKey];\n}\n\nfunction getRangeSelectionRows<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { lastSelectedRowIndex, rowIndex, data, rowSelectionState }:\n GetSelectedRowsProps<Q, RDPs>,\n): PrimaryKeyType<Q>[] {\n if (lastSelectedRowIndex != null) {\n const rowsInRange = getRowsInRange(data, lastSelectedRowIndex, rowIndex);\n const primaryKeysInRange = rowsInRange.map(item => item.$primaryKey);\n\n const currentlySelected = getSelectedPrimaryKeys(rowSelectionState, data);\n\n const newSelectedRows = [...currentlySelected];\n primaryKeysInRange.forEach(item => {\n if (!newSelectedRows.includes(item)) {\n newSelectedRows.push(item);\n }\n });\n return newSelectedRows;\n }\n return [];\n}\n\nfunction isCurrentlySelected<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { rowIndex, data, rowSelectionState }: Pick<\n GetSelectedRowsProps<Q, RDPs>,\n \"rowIndex\" | \"data\" | \"rowSelectionState\"\n >,\n): boolean {\n const primaryKey = data[rowIndex].$primaryKey;\n const currentlySelected = getSelectedPrimaryKeys(rowSelectionState, data);\n return currentlySelected.includes(primaryKey);\n}\n\nfunction getMultipleSelectionRows<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { rowIndex, data, rowSelectionState }: GetSelectedRowsProps<Q, RDPs>,\n): PrimaryKeyType<Q>[] {\n const primaryKey = data[rowIndex].$primaryKey;\n const currentlySelected = getSelectedPrimaryKeys(rowSelectionState, data);\n return isCurrentlySelected<Q, RDPs>({ rowIndex, data, rowSelectionState })\n ? currentlySelected.filter(i => i !== primaryKey)\n : [...currentlySelected, primaryKey];\n}\n\nfunction getRowsInRange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n data: Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>,\n startIndex: number,\n endIndex: number,\n): Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>> {\n const start = Math.min(startIndex, endIndex);\n const end = Math.max(startIndex, endIndex);\n const rows: Array<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n > = [];\n\n for (let i = start; i <= end; i++) {\n const item = data[i];\n if (item) {\n rows.push(item);\n }\n }\n\n return rows;\n}\n\nfunction deriveIsAllSelected(\n isControlled: boolean,\n isAllSelectedProp: boolean | undefined,\n internalIsAllSelected: boolean,\n selectedCount: number,\n totalCount: number,\n): boolean {\n if (isControlled && isAllSelectedProp !== undefined) return isAllSelectedProp;\n if (!isControlled && internalIsAllSelected) return true;\n return totalCount > 0 && selectedCount === totalCount;\n}\n\nfunction getRowSelectionState<Q extends ObjectOrInterfaceDefinition>(\n primaryKeys: PrimaryKeyType<Q>[],\n): RowSelectionState {\n return primaryKeys.reduce<RowSelectionState>(\n (acc, primaryKey) => {\n acc[getRowIdFromPrimaryKey(primaryKey)] = true;\n return acc;\n },\n {},\n );\n}\n\nfunction getSelectedPrimaryKeys<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n selectionState: RowSelectionState,\n data: Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>,\n): PrimaryKeyType<Q>[] {\n return data\n .filter(item => selectionState[getRowId(item)])\n .map(item => item.$primaryKey);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;A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AAM,CACvB,CAACC,GAAG,EAAEpB,UAAU,KAAK;IACnBoB,GAAG,CAAC/E,sBAAsB,CAAC2D,UAAU,CAAC,CAAC,GAAG,IAAI;IAC9C,OAAOoB,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AACH;AAEA,SAASf,sBAAsBA,CAI7BgB,cAAiC,EACjCxE,IAA0E,EACrD;EACrB,OAAOA,IAAI,CACRmB,MAAM,CAACN,IAAI,IAAI2D,cAAc,CAACjF,QAAQ,CAACsB,IAAI,CAAC,CAAC,CAAC,CAC9CD,GAAG,CAACC,IAAI,IAAIA,IAAI,CAACC,WAAW,CAAC;AAClC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useRowSelection.js","names":["useCallback","useEffect","useMemo","useRef","useState","useEventCallback","getRowId","getRowIdFromPrimaryKey","useRowSelection","selectionMode","selectedRows","isAllSelected","isAllSelectedProp","onRowSelection","onRowSelectionChanged","data","internalRowSelection","setInternalRowSelection","internalIsAllSelected","setInternalIsAllSelected","lastSelectedRowIndex","setLastSelectedRowIndex","isControlled","undefined","enableRowSelection","rowSelectionState","selectedRowIds","map","item","$primaryKey","getRowSelectionState","selectedCount","Object","values","filter","Boolean","length","totalCount","deriveIsAllSelected","hasSelection","lastFiredAllSelectedIdsRef","fireSelectionCallbacks","ids","isSelectAll","selectedKeySet","Set","id","String","instances","has","onToggleAll","newIsAllSelected","newSelectedRows","current","JSON","stringify","onToggleRow","rowId","rowIndex","isShiftClick","getSingleSelectionRows","getRangeSelectionRows","getMultipleSelectionRows","isCurrentlySelected","serializedIds","rowSelection","primaryKey","rowsInRange","getRowsInRange","primaryKeysInRange","currentlySelected","getSelectedPrimaryKeys","forEach","includes","push","i","startIndex","endIndex","start","Math","min","end","max","rows","primaryKeys","reduce","acc","selectionState"],"sources":["useRowSelection.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n SimplePropertyDef,\n} from \"@osdk/api\";\nimport type { RowSelectionState } from \"@tanstack/react-table\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useEventCallback } from \"../../shared/hooks/useEventCallback.js\";\nimport { getRowId, getRowIdFromPrimaryKey } from \"../utils/getRowId.js\";\n\n/**\n * Payload delivered by {@link UseRowSelectionProps.onRowSelectionChanged}.\n * Mirrors the OSDK-level `RowSelectionChange` but without the `objectSet`\n * field, which requires OSDK context and is composed in `ObjectTable`.\n */\nexport interface UseRowSelectionChange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n selectedRows: Osdk.Instance<\n Q,\n \"$allBaseProperties\",\n PropertyKeys<Q>,\n RDPs\n >[];\n isSelectAll: boolean;\n}\n\nexport interface UseRowSelectionProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n selectionMode?: \"single\" | \"multiple\" | \"none\";\n selectedRows?: PrimaryKeyType<Q>[];\n isAllSelected?: boolean;\n /**\n * @deprecated Use {@link onRowSelectionChanged} instead.\n */\n onRowSelection?: (\n selectedRowIds: PrimaryKeyType<Q>[],\n isSelectAll: boolean,\n ) => void;\n onRowSelectionChanged?: (\n change: UseRowSelectionChange<Q, RDPs>,\n ) => void;\n data:\n | Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>\n | undefined;\n}\n\nexport interface UseRowSelectionResult {\n rowSelection: RowSelectionState;\n isAllSelected: boolean;\n hasSelection: boolean;\n enableRowSelection: boolean;\n onToggleAll: () => void;\n onToggleRow: (\n rowId: string,\n rowIndex: number,\n isShiftClick?: boolean,\n ) => void;\n}\n\nexport function useRowSelection<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>({\n selectionMode = \"none\",\n selectedRows,\n isAllSelected: isAllSelectedProp,\n // eslint-disable-next-line @typescript-eslint/no-deprecated -- intentional pass-through to fire alongside onRowSelectionChanged for backwards compatibility\n onRowSelection,\n onRowSelectionChanged,\n data,\n}: UseRowSelectionProps<Q, RDPs>): UseRowSelectionResult {\n const [internalRowSelection, setInternalRowSelection] = useState<\n RowSelectionState\n >({});\n\n // When true, newly fetched rows are auto-selected (uncontrolled mode only).\n const [internalIsAllSelected, setInternalIsAllSelected] = useState(false);\n\n const [lastSelectedRowIndex, setLastSelectedRowIndex] = useState<\n number | null\n >(null);\n\n const isControlled = selectedRows !== undefined;\n const enableRowSelection = selectionMode !== \"none\";\n\n const rowSelectionState: RowSelectionState = useMemo(() => {\n if (!enableRowSelection) return {};\n if (isControlled) {\n const selectedRowIds = isAllSelectedProp\n ? (data ?? []).map(item => item.$primaryKey)\n : selectedRows;\n return getRowSelectionState(selectedRowIds);\n }\n if (internalIsAllSelected) {\n return getRowSelectionState(\n (data ?? []).map(item => item.$primaryKey),\n );\n }\n return internalRowSelection;\n }, [\n enableRowSelection,\n isControlled,\n selectedRows,\n isAllSelectedProp,\n internalIsAllSelected,\n internalRowSelection,\n data,\n ]);\n\n const selectedCount = useMemo(\n () => Object.values(rowSelectionState).filter(Boolean).length,\n [rowSelectionState],\n );\n const totalCount = data?.length ?? 0;\n const isAllSelected = deriveIsAllSelected(\n isControlled,\n isAllSelectedProp,\n internalIsAllSelected,\n selectedCount,\n totalCount,\n );\n const hasSelection = isAllSelected || selectedCount > 0;\n\n // Dedupes refires when \"select all\" is active and data grows.\n const lastFiredAllSelectedIdsRef = useRef<string | null>(null);\n\n const fireSelectionCallbacks = useEventCallback(\n (ids: PrimaryKeyType<Q>[], isSelectAll: boolean) => {\n onRowSelection?.(ids, isSelectAll);\n if (onRowSelectionChanged) {\n const currentData = data ?? [];\n const selectedKeySet = new Set(ids.map(id => String(id)));\n const instances = currentData.filter(item =>\n selectedKeySet.has(String(item.$primaryKey))\n );\n onRowSelectionChanged({\n selectedRows: instances,\n isSelectAll,\n });\n }\n },\n );\n\n const onToggleAll = useCallback(() => {\n if (!enableRowSelection || !data) return;\n\n // Any existing selection (full or partial/indeterminate) clears on click;\n // only an empty selection promotes to \"select all\".\n const newIsAllSelected = !hasSelection;\n const newSelectedRows: PrimaryKeyType<Q>[] = newIsAllSelected\n ? data.map(item => item.$primaryKey)\n : [];\n\n if (!isControlled) {\n setInternalIsAllSelected(newIsAllSelected);\n setInternalRowSelection(getRowSelectionState(newSelectedRows));\n }\n lastFiredAllSelectedIdsRef.current = newIsAllSelected\n ? JSON.stringify(newSelectedRows)\n : null;\n fireSelectionCallbacks(newSelectedRows, newIsAllSelected);\n }, [\n enableRowSelection,\n data,\n hasSelection,\n isControlled,\n fireSelectionCallbacks,\n ]);\n\n const onToggleRow = useCallback(\n (rowId: string, rowIndex: number, isShiftClick: boolean = false) => {\n if (!enableRowSelection || !data) return;\n\n let newSelectedRows: PrimaryKeyType<Q>[];\n\n if (selectionMode === \"single\") {\n newSelectedRows = getSingleSelectionRows({\n rowId,\n rowIndex,\n data,\n rowSelectionState,\n });\n } else {\n if (isShiftClick && lastSelectedRowIndex != null) {\n newSelectedRows = getRangeSelectionRows(\n { rowId, rowIndex, data, lastSelectedRowIndex, rowSelectionState },\n );\n setLastSelectedRowIndex(rowIndex);\n } else {\n newSelectedRows = getMultipleSelectionRows(\n { rowId, rowIndex, data, rowSelectionState },\n );\n if (\n !isCurrentlySelected<Q, RDPs>({ rowIndex, data, rowSelectionState })\n ) {\n setLastSelectedRowIndex(rowIndex);\n }\n }\n }\n if (!isControlled) {\n setInternalIsAllSelected(false);\n setInternalRowSelection(getRowSelectionState(newSelectedRows));\n }\n lastFiredAllSelectedIdsRef.current = null;\n fireSelectionCallbacks(newSelectedRows, false);\n },\n [\n enableRowSelection,\n data,\n selectionMode,\n isControlled,\n fireSelectionCallbacks,\n rowSelectionState,\n lastSelectedRowIndex,\n ],\n );\n\n // Refire callbacks when uncontrolled \"select all\" is active and new rows arrive.\n useEffect(function syncSelectAllOnDataChange() {\n if (isControlled || !internalIsAllSelected || !data) {\n if (!internalIsAllSelected) {\n lastFiredAllSelectedIdsRef.current = null;\n }\n return;\n }\n const ids = data.map(item => item.$primaryKey);\n const serializedIds = JSON.stringify(ids);\n if (lastFiredAllSelectedIdsRef.current === serializedIds) return;\n lastFiredAllSelectedIdsRef.current = serializedIds;\n fireSelectionCallbacks(ids, true);\n }, [isControlled, internalIsAllSelected, data, fireSelectionCallbacks]);\n\n return {\n rowSelection: rowSelectionState,\n isAllSelected,\n enableRowSelection,\n hasSelection,\n onToggleAll,\n onToggleRow,\n };\n}\n\ninterface GetSelectedRowsProps<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n> {\n rowId: string;\n rowIndex: number;\n data: Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>;\n rowSelectionState: RowSelectionState;\n lastSelectedRowIndex?: number;\n}\n\nfunction getSingleSelectionRows<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { rowId, rowIndex, data, rowSelectionState }: GetSelectedRowsProps<Q, RDPs>,\n): PrimaryKeyType<Q>[] {\n const primaryKey = data[rowIndex].$primaryKey;\n return rowSelectionState[rowId] ? [] : [primaryKey];\n}\n\nfunction getRangeSelectionRows<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { lastSelectedRowIndex, rowIndex, data, rowSelectionState }:\n GetSelectedRowsProps<Q, RDPs>,\n): PrimaryKeyType<Q>[] {\n if (lastSelectedRowIndex != null) {\n const rowsInRange = getRowsInRange(data, lastSelectedRowIndex, rowIndex);\n const primaryKeysInRange = rowsInRange.map(item => item.$primaryKey);\n\n const currentlySelected = getSelectedPrimaryKeys(rowSelectionState, data);\n\n const newSelectedRows = [...currentlySelected];\n primaryKeysInRange.forEach(item => {\n if (!newSelectedRows.includes(item)) {\n newSelectedRows.push(item);\n }\n });\n return newSelectedRows;\n }\n return [];\n}\n\nfunction isCurrentlySelected<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { rowIndex, data, rowSelectionState }: Pick<\n GetSelectedRowsProps<Q, RDPs>,\n \"rowIndex\" | \"data\" | \"rowSelectionState\"\n >,\n): boolean {\n const primaryKey = data[rowIndex].$primaryKey;\n const currentlySelected = getSelectedPrimaryKeys(rowSelectionState, data);\n return currentlySelected.includes(primaryKey);\n}\n\nfunction getMultipleSelectionRows<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n { rowIndex, data, rowSelectionState }: GetSelectedRowsProps<Q, RDPs>,\n): PrimaryKeyType<Q>[] {\n const primaryKey = data[rowIndex].$primaryKey;\n const currentlySelected = getSelectedPrimaryKeys(rowSelectionState, data);\n return isCurrentlySelected<Q, RDPs>({ rowIndex, data, rowSelectionState })\n ? currentlySelected.filter(i => i !== primaryKey)\n : [...currentlySelected, primaryKey];\n}\n\nfunction getRowsInRange<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n data: Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>,\n startIndex: number,\n endIndex: number,\n): Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>> {\n const start = Math.min(startIndex, endIndex);\n const end = Math.max(startIndex, endIndex);\n const rows: Array<\n Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>\n > = [];\n\n for (let i = start; i <= end; i++) {\n const item = data[i];\n if (item) {\n rows.push(item);\n }\n }\n\n return rows;\n}\n\nfunction deriveIsAllSelected(\n isControlled: boolean,\n isAllSelectedProp: boolean | undefined,\n internalIsAllSelected: boolean,\n selectedCount: number,\n totalCount: number,\n): boolean {\n if (isControlled && isAllSelectedProp !== undefined) return isAllSelectedProp;\n if (!isControlled && internalIsAllSelected) return true;\n return totalCount > 0 && selectedCount === totalCount;\n}\n\nfunction getRowSelectionState<Q extends ObjectOrInterfaceDefinition>(\n primaryKeys: PrimaryKeyType<Q>[],\n): RowSelectionState {\n return primaryKeys.reduce<RowSelectionState>(\n (acc, primaryKey) => {\n acc[getRowIdFromPrimaryKey(primaryKey)] = true;\n return acc;\n },\n {},\n );\n}\n\nfunction getSelectedPrimaryKeys<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = Record<string, never>,\n>(\n selectionState: RowSelectionState,\n data: Array<Osdk.Instance<Q, \"$allBaseProperties\", PropertyKeys<Q>, RDPs>>,\n): PrimaryKeyType<Q>[] {\n return data\n .filter(item => selectionState[getRowId(item)])\n .map(item => item.$primaryKey);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACzE,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SAASC,QAAQ,EAAEC,sBAAsB,QAAQ,sBAAsB;;AAEvE;AACA;AACA;AACA;AACA;;AAiDA,OAAO,SAASC,eAAeA,CAG7B;EACAC,aAAa,GAAG,MAAM;EACtBC,YAAY;EACZC,aAAa,EAAEC,iBAAiB;EAChC;EACAC,cAAc;EACdC,qBAAqB;EACrBC;AAC6B,CAAC,EAAyB;EACvD,MAAM,CAACC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AAC;AAClC","ignoreList":[]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const PACKAGE_USER_AGENT = `osdk-react-components/${"0.22.
|
|
17
|
+
const PACKAGE_USER_AGENT = `osdk-react-components/${"0.22.1-main-2e92b908fc461ab107d493cb0aa71a1be400ef2f"}`;
|
|
18
18
|
export function componentUserAgent(componentName) {
|
|
19
19
|
return `${PACKAGE_USER_AGENT}/${componentName}`;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,iFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkPKJFOG2Z_cjs = require('./chunk-PKJFOG2Z.cjs');
|
|
4
|
+
var chunkDHQJOBAG_cjs = require('./chunk-DHQJOBAG.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/experimental/email-viewer.ts
|
|
7
|
+
var EmailViewer2 = chunkDHQJOBAG_cjs.withOsdkMetrics(chunkPKJFOG2Z_cjs.EmailViewer, "EmailViewer");
|
|
8
|
+
|
|
9
|
+
exports.EmailViewer = EmailViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-23N6K2BP.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-23N6K2BP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-23N6K2BP.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// BaseEmailViewer\nexport { BaseEmailViewer } from \"../../email-viewer/BaseEmailViewer.js\";\n// EmailViewer (Media wrapper)\nimport { EmailViewer as _EmailViewer } from \"../../email-viewer/EmailViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const EmailViewer = withOsdkMetrics(_EmailViewer, \"EmailViewer\");"]}
|
|
@@ -6,7 +6,7 @@ var chunkE5OKIBYJ_cjs = require('./chunk-E5OKIBYJ.cjs');
|
|
|
6
6
|
var chunkNE7GRF7G_cjs = require('./chunk-NE7GRF7G.cjs');
|
|
7
7
|
var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
|
|
8
8
|
var chunkUCTQICPR_cjs = require('./chunk-UCTQICPR.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkDHQJOBAG_cjs = require('./chunk-DHQJOBAG.cjs');
|
|
10
10
|
var button = require('@base-ui/react/button');
|
|
11
11
|
var classnames3 = require('classnames');
|
|
12
12
|
var React13 = require('react');
|
|
@@ -5319,7 +5319,7 @@ function summarizeFilterValue(definition, state) {
|
|
|
5319
5319
|
}
|
|
5320
5320
|
|
|
5321
5321
|
// src/public/experimental/filter-list.ts
|
|
5322
|
-
var FilterList2 =
|
|
5322
|
+
var FilterList2 = chunkDHQJOBAG_cjs.withOsdkMetrics(FilterList, "FilterList");
|
|
5323
5323
|
|
|
5324
5324
|
exports.BaseFilterList = BaseFilterList;
|
|
5325
5325
|
exports.FilterInput = FilterInput;
|
|
@@ -5333,5 +5333,5 @@ exports.narrowObjectSet = narrowObjectSet;
|
|
|
5333
5333
|
exports.serializeFilterStates = serializeFilterStates;
|
|
5334
5334
|
exports.summarizeFilterValue = summarizeFilterValue;
|
|
5335
5335
|
exports.useFilterListState = useFilterListState;
|
|
5336
|
-
//# sourceMappingURL=chunk-
|
|
5337
|
-
//# sourceMappingURL=chunk-
|
|
5336
|
+
//# sourceMappingURL=chunk-5263W3VC.cjs.map
|
|
5337
|
+
//# sourceMappingURL=chunk-5263W3VC.cjs.map
|