@osdk/react-components 0.2.0-beta.12 → 0.2.0-beta.13
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 +14 -0
- package/build/browser/base-components/draggable-list/DraggableList.module.css +2 -2
- package/build/browser/filter-list/FilterListApi.js.map +1 -1
- package/build/browser/filter-list/base/DragHandleIcon.js +51 -0
- package/build/browser/filter-list/base/DragHandleIcon.js.map +1 -0
- package/build/browser/filter-list/base/FilterList.js +3 -1
- package/build/browser/filter-list/base/FilterList.js.map +1 -1
- package/build/browser/filter-list/base/FilterListContent.js +143 -3
- package/build/browser/filter-list/base/FilterListContent.js.map +1 -1
- package/build/browser/filter-list/base/FilterListContent.module.css +6 -0
- package/build/browser/filter-list/base/FilterListContent.module.css.js +2 -1
- package/build/browser/filter-list/base/FilterListItem.js +11 -18
- package/build/browser/filter-list/base/FilterListItem.js.map +1 -1
- package/build/browser/filter-list/base/FilterListItem.module.css +32 -0
- package/build/browser/filter-list/base/FilterListItem.module.css.js +3 -1
- package/build/browser/filter-list/base/SortableFilterListItem.js +63 -0
- package/build/browser/filter-list/base/SortableFilterListItem.js.map +1 -0
- package/build/browser/filter-list/utils/getFilterLabel.js +36 -0
- package/build/browser/filter-list/utils/getFilterLabel.js.map +1 -0
- package/build/browser/object-table/EditableCell.js +1 -2
- package/build/browser/object-table/EditableCell.js.map +1 -1
- package/build/browser/object-table/TableRow.js +1 -2
- package/build/browser/object-table/TableRow.js.map +1 -1
- package/build/browser/styles.css +40 -2
- package/build/cjs/public/experimental.cjs +905 -677
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +34 -2
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +7 -0
- package/build/esm/base-components/draggable-list/DraggableList.module.css +2 -2
- package/build/esm/filter-list/FilterListApi.js.map +1 -1
- package/build/esm/filter-list/base/DragHandleIcon.js +51 -0
- package/build/esm/filter-list/base/DragHandleIcon.js.map +1 -0
- package/build/esm/filter-list/base/FilterList.js +3 -1
- package/build/esm/filter-list/base/FilterList.js.map +1 -1
- package/build/esm/filter-list/base/FilterListContent.js +143 -3
- package/build/esm/filter-list/base/FilterListContent.js.map +1 -1
- package/build/esm/filter-list/base/FilterListContent.module.css +6 -0
- package/build/esm/filter-list/base/FilterListItem.js +11 -18
- package/build/esm/filter-list/base/FilterListItem.js.map +1 -1
- package/build/esm/filter-list/base/FilterListItem.module.css +32 -0
- package/build/esm/filter-list/base/SortableFilterListItem.js +63 -0
- package/build/esm/filter-list/base/SortableFilterListItem.js.map +1 -0
- package/build/esm/filter-list/utils/getFilterLabel.js +36 -0
- package/build/esm/filter-list/utils/getFilterLabel.js.map +1 -0
- package/build/esm/object-table/EditableCell.js +1 -2
- package/build/esm/object-table/EditableCell.js.map +1 -1
- package/build/esm/object-table/TableRow.js +1 -2
- package/build/esm/object-table/TableRow.js.map +1 -1
- package/build/types/filter-list/FilterListApi.d.ts +7 -0
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/base/DragHandleIcon.d.ts +2 -0
- package/build/types/filter-list/base/DragHandleIcon.d.ts.map +1 -0
- package/build/types/filter-list/base/FilterListContent.d.ts +2 -1
- package/build/types/filter-list/base/FilterListContent.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListItem.d.ts +4 -1
- package/build/types/filter-list/base/FilterListItem.d.ts.map +1 -1
- package/build/types/filter-list/base/SortableFilterListItem.d.ts +16 -0
- package/build/types/filter-list/base/SortableFilterListItem.d.ts.map +1 -0
- package/build/types/filter-list/utils/getFilterLabel.d.ts +3 -0
- package/build/types/filter-list/utils/getFilterLabel.d.ts.map +1 -0
- package/build/types/object-table/EditableCell.d.ts +1 -3
- package/build/types/object-table/EditableCell.d.ts.map +1 -1
- package/build/types/object-table/TableRow.d.ts +1 -2
- package/build/types/object-table/TableRow.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { assertUnreachable } from "./assertUnreachable.js";
|
|
18
|
+
export function getFilterLabel(definition) {
|
|
19
|
+
if ("label" in definition && definition.label) {
|
|
20
|
+
return definition.label;
|
|
21
|
+
}
|
|
22
|
+
switch (definition.type) {
|
|
23
|
+
case "PROPERTY":
|
|
24
|
+
return definition.key;
|
|
25
|
+
case "HAS_LINK":
|
|
26
|
+
case "LINKED_PROPERTY":
|
|
27
|
+
return definition.linkName;
|
|
28
|
+
case "KEYWORD_SEARCH":
|
|
29
|
+
return "Search";
|
|
30
|
+
case "CUSTOM":
|
|
31
|
+
return definition.key;
|
|
32
|
+
default:
|
|
33
|
+
return assertUnreachable(definition);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=getFilterLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFilterLabel.js","names":["assertUnreachable","getFilterLabel","definition","label","type","key","linkName"],"sources":["getFilterLabel.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 { ObjectTypeDefinition } from \"@osdk/api\";\nimport type { FilterDefinitionUnion } from \"../FilterListApi.js\";\nimport { assertUnreachable } from \"./assertUnreachable.js\";\n\nexport function getFilterLabel<Q extends ObjectTypeDefinition>(\n definition: FilterDefinitionUnion<Q>,\n): string {\n if (\"label\" in definition && definition.label) {\n return definition.label;\n }\n\n switch (definition.type) {\n case \"PROPERTY\":\n return definition.key;\n case \"HAS_LINK\":\n case \"LINKED_PROPERTY\":\n return definition.linkName;\n case \"KEYWORD_SEARCH\":\n return \"Search\";\n case \"CUSTOM\":\n return definition.key;\n default:\n return assertUnreachable(definition);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,wBAAwB;AAE1D,OAAO,SAASC,cAAcA,CAC5BC,UAAoC,EAC5B;EACR,IAAI,OAAO,IAAIA,UAAU,IAAIA,UAAU,CAACC,KAAK,EAAE;IAC7C,OAAOD,UAAU,CAACC,KAAK;EACzB;EAEA,QAAQD,UAAU,CAACE,IAAI;IACrB,KAAK,UAAU;MACb,OAAOF,UAAU,CAACG,GAAG;IACvB,KAAK,UAAU;IACf,KAAK,iBAAiB;MACpB,OAAOH,UAAU,CAACI,QAAQ;IAC5B,KAAK,gBAAgB;MACnB,OAAO,QAAQ;IACjB,KAAK,QAAQ;MACX,OAAOJ,UAAU,CAACG,GAAG;IACvB;MACE,OAAOL,iBAAiB,CAACE,UAAU,CAAC;EACxC;AACF","ignoreList":[]}
|
|
@@ -42,7 +42,7 @@ function parseValueByType(value, dataType) {
|
|
|
42
42
|
}
|
|
43
43
|
return parsedNumber;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
export function EditableCell({
|
|
46
46
|
initialValue,
|
|
47
47
|
currentValue,
|
|
48
48
|
cellId,
|
|
@@ -97,5 +97,4 @@ function EditableCellInner({
|
|
|
97
97
|
onKeyDown: handleKeyDown
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
export const EditableCell = /*#__PURE__*/React.memo(EditableCellInner);
|
|
101
100
|
//# sourceMappingURL=EditableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableCell.js","names":["Input","classNames","React","useCallback","useEffect","useRef","useState","styles","NUMBER_TYPES","valueToString","value","JSON","stringify","String","parseValueByType","dataType","includes","parsedNumber","Number","isNaN","
|
|
1
|
+
{"version":3,"file":"EditableCell.js","names":["Input","classNames","React","useCallback","useEffect","useRef","useState","styles","NUMBER_TYPES","valueToString","value","JSON","stringify","String","parseValueByType","dataType","includes","parsedNumber","Number","isNaN","EditableCell","initialValue","currentValue","cellId","onCellEdit","originalRowData","rowId","columnId","inputValue","setInputValue","isCancelled","handleBlur","current","parsedValue","newValue","oldValue","handleChange","handleKeyDown","e","key","currentTarget","blur","inputType","createElement","className","osdkEditableInput","osdkEditedInput","type","onValueChange","onBlur","onKeyDown"],"sources":["EditableCell.tsx"],"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 { Input } from \"@base-ui/react/input\";\nimport type { RowData } from \"@tanstack/react-table\";\nimport classNames from \"classnames\";\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport styles from \"./EditableCell.module.css\";\nimport type { CellEditInfo } from \"./utils/types.js\";\n\nexport interface EditableCellProps<TData extends RowData, CellValue = unknown> {\n initialValue: CellValue;\n currentValue: CellValue;\n cellId: string;\n dataType?: string;\n onCellEdit: (cellId: string, info: CellEditInfo<TData, CellValue>) => void;\n originalRowData: TData;\n rowId: string;\n columnId: string;\n}\n\nconst NUMBER_TYPES: string[] = [\n \"double\",\n \"integer\",\n \"long\",\n \"float\",\n \"decimal\",\n \"byte\",\n \"short\",\n];\n\nfunction valueToString(value: unknown): string {\n if (value == null) {\n return \"\";\n }\n if (typeof value === \"object\") {\n return JSON.stringify(value);\n }\n // At this point, value is a primitive (string, number, boolean, symbol, bigint)\n return String(value as string | number | boolean | symbol | bigint);\n}\n\nfunction parseValueByType(\n value: string,\n dataType?: string,\n): unknown {\n if (!dataType || !NUMBER_TYPES.includes(dataType)) {\n return value;\n }\n\n if (value === \"\") {\n return null;\n }\n\n const parsedNumber = Number(value);\n\n if (isNaN(parsedNumber)) {\n return value;\n }\n\n return parsedNumber;\n}\n\nexport function EditableCell<TData extends RowData, CellValue = unknown>({\n initialValue,\n currentValue,\n cellId,\n dataType,\n onCellEdit,\n originalRowData,\n rowId,\n columnId,\n}: EditableCellProps<TData, CellValue>): React.ReactElement {\n const [inputValue, setInputValue] = useState<string>(\n valueToString(currentValue),\n );\n const isCancelled = useRef(false);\n\n useEffect(() => {\n setInputValue(valueToString(currentValue));\n }, [currentValue]);\n\n const handleBlur = useCallback(() => {\n // Do not commit the edit if it was cancelled with Escape key\n if (isCancelled.current) {\n isCancelled.current = false;\n return;\n }\n const parsedValue = parseValueByType(inputValue, dataType);\n onCellEdit(cellId, {\n rowId,\n columnId,\n newValue: parsedValue as CellValue,\n oldValue: initialValue,\n originalRowData,\n });\n }, [\n inputValue,\n initialValue,\n onCellEdit,\n cellId,\n dataType,\n rowId,\n columnId,\n originalRowData,\n ]);\n\n const handleChange = useCallback((value: string) => {\n setInputValue(value);\n }, []);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.currentTarget.blur();\n }\n if (e.key === \"Escape\") {\n isCancelled.current = true;\n setInputValue(valueToString(currentValue));\n e.currentTarget.blur();\n }\n },\n [currentValue],\n );\n\n const inputType = dataType && NUMBER_TYPES.includes(dataType)\n ? \"number\"\n : \"text\";\n\n const isEdited = currentValue !== initialValue;\n\n return (\n <Input\n className={classNames(styles.osdkEditableInput, {\n [styles.osdkEditedInput]: isEdited,\n })}\n type={inputType}\n value={inputValue}\n onValueChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAE5C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACvE,OAAOC,MAAM,MAAM,2BAA2B;AAc9C,MAAMC,YAAsB,GAAG,CAC7B,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,CACR;AAED,SAASC,aAAaA,CAACC,KAAc,EAAU;EAC7C,IAAIA,KAAK,IAAI,IAAI,EAAE;IACjB,OAAO,EAAE;EACX;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;EAC9B;EACA;EACA,OAAOG,MAAM,CAACH,KAAoD,CAAC;AACrE;AAEA,SAASI,gBAAgBA,CACvBJ,KAAa,EACbK,QAAiB,EACR;EACT,IAAI,CAACA,QAAQ,IAAI,CAACP,YAAY,CAACQ,QAAQ,CAACD,QAAQ,CAAC,EAAE;IACjD,OAAOL,KAAK;EACd;EAEA,IAAIA,KAAK,KAAK,EAAE,EAA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AC5C,IAAIA,CAAC,CAACC,GAAG,KAAK,OAAO,EAAE;MACrBD,CAAC,CAACE,aAAa,CAACC,IAAI,CAAC,CAAC;IACxB;IACA,IAAIH,CAAC,CAACC,GAAG,KAAK,QAAQ,EAAE;MACtBT,WAAW,CAACE,OAAO,GAAG,IAAI;MAC1BH,aAAa,CAACpB,aAAa,CAACa,YAAY,CAAC,CAAC;MAC1CgB,CAAC,CAACE,aAAa,CAACC,IAAI,CAAC,CAAC;IACxB;EACF,CAAC,EACD,CAACnB,YAAY,CACf,CAAC;EAED,MAAMoB,SAAS,GAAG3B,QAAQ,IAAIP,YAAY,CAACQ,QAAQ,CAACD,QAAQ,CAAC,GACzD,QAAQ,GACR,MAAM;EAIV,oBACEb,KAAA,CAAAyC,aAAA,CAAC3C,KAAK;IACJ4C,SAAS,EAAE3C,UAAU,CAACM,MAAM,CAACsC,iBAAiB,EAAE;MAC9C,CAACtC,MAAM,CAACuC,eAAe,GALZxB,YAAY,KAAKD;IAM9B,CAAC,CAAE;IACH0B,IAAI,EAAEL,SAAU;IAChBhC,KAAK,EAAEkB,UAAW;IAClBoB,aAAa,EAAEZ,YAAa;IAC5Ba,MAAM,EAAElB,UAAW;IACnBmB,SAAS,EAAEb;EAAc,CAC1B,CAAC;AAEN","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import React, { useCallback } from "react";
|
|
18
18
|
import { TableCell } from "./TableCell.js";
|
|
19
19
|
import styles from "./TableRow.module.css";
|
|
20
|
-
function
|
|
20
|
+
export function TableRow({
|
|
21
21
|
row,
|
|
22
22
|
virtualRow,
|
|
23
23
|
onRowClick,
|
|
@@ -47,5 +47,4 @@ function TableRowInner({
|
|
|
47
47
|
renderCellContextMenu: renderCellContextMenu
|
|
48
48
|
})));
|
|
49
49
|
}
|
|
50
|
-
export const TableRow = /*#__PURE__*/React.memo(TableRowInner);
|
|
51
50
|
//# sourceMappingURL=TableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.js","names":["React","useCallback","TableCell","styles","
|
|
1
|
+
{"version":3,"file":"TableRow.js","names":["React","useCallback","TableCell","styles","TableRow","row","virtualRow","onRowClick","renderCellContextMenu","focusedRowId","setFocusedRowId","isInEditMode","handleClick","id","original","createElement","getIsSelected","className","osdkTableRow","style","height","size","transform","start","onClick","getVisibleCells","map","cell","key"],"sources":["TableRow.tsx"],"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 { Cell, Row, RowData } from \"@tanstack/react-table\";\nimport type { VirtualItem } from \"@tanstack/react-virtual\";\nimport React, { useCallback } from \"react\";\nimport { TableCell } from \"./TableCell.js\";\nimport styles from \"./TableRow.module.css\";\n\ninterface TableRowProps<TData extends RowData> {\n row: Row<TData>;\n virtualRow: VirtualItem;\n onRowClick?: (row: TData) => void;\n renderCellContextMenu?: (\n row: TData,\n cell: Cell<TData, unknown>,\n ) => React.ReactNode;\n focusedRowId?: string | null;\n setFocusedRowId?: (rowId: string | null) => void;\n isInEditMode?: boolean;\n}\n\nexport function TableRow<TData extends RowData>({\n row,\n virtualRow,\n onRowClick,\n renderCellContextMenu,\n focusedRowId,\n setFocusedRowId,\n isInEditMode,\n}: TableRowProps<TData>): React.ReactElement {\n const handleClick = useCallback(() => {\n setFocusedRowId?.(row.id);\n\n if (!isInEditMode) {\n onRowClick?.(row.original);\n }\n }, [isInEditMode, onRowClick, row.original, row.id, setFocusedRowId]);\n\n return (\n <tr\n data-selected={row.getIsSelected()}\n data-focused={focusedRowId === row.id}\n className={styles.osdkTableRow}\n style={{\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }}\n onClick={handleClick}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell\n key={cell.id}\n cell={cell}\n renderCellContextMenu={renderCellContextMenu}\n />\n ))}\n </tr>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,KAAK,IAAIC,WAAW,QAAQ,OAAO;AAC1C,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,MAAM,MAAM,uBAAuB;AAe1C,OAAO,SAASC,QAAQA,CAAwB;EAC9CC,GAAG;EACHC,UAAU;EACVC,UAAU;EACVC,qBAAqB;EACrBC,YAAY;EACZC,eAAe;EACfC;AACoB,CAAC,EAAsB;EAC3C,MAAMC,WAAW,GAAGX,WAAW,CAAC,MAAM;IACpCS,eAAe,GAAGL,GAAG,CAACQ,EAAE,CAAC;IAEzB,IAAI,CAACF,YAAY,EAAE;MACjBJ,UAAU,GAAGF,GAAG,CAACS,QAAQ,CAAC;IAC5B;EACF,CAAC,EAAE,CAACH,YAAY,EAAEJ,UAAU,EAAEF,GAAG,CAACS,QAAQ,EAAET,GAAG,CAACQ,EAAE,EAAEH,eAAe,CAAC,CAAC;EAErE,oBACEV,KAAA,CAAAe,aAAA;IACE,iBAAeV,GAAG,CAACW,aAAa,CAAC,CAAE;IACnC,gBAAcP,YAAY,KAAKJ,GAAG,CAACQ,EAAG;IACtCI,SAAS,EAAEd,MAAM,CAACe,YAAa;IAC/BC,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGd,UAAU,CAACe,IAAI,IAAI;MAC9BC,SAAS,EAAE,cAAchB,UAAU,CAACiB,KAAK;IAC3C,CAAE;IACFC,OAAO,EAAEZ;EAAY,GAEpBP,GAAG,CAACoB,eAAe,CAAC,CAAC,CAACC,GAAG,CAAEC,IAAI,iBAC9B3B,KAAA,CAAAe,aAAA,CAACb,SAAS;IACR0B,GAAG,EAAED,IAAI,CAACd,EAAG;IACbc,IAAI,EAAEA,IAAK;IACXnB,qBAAqB,EAAEA;EAAsB,CAC9C,CACF,CACC,CAAC;AAET","ignoreList":[]}
|
|
@@ -87,6 +87,13 @@ export interface FilterListProps<Q extends ObjectTypeDefinition> {
|
|
|
87
87
|
*/
|
|
88
88
|
onFilterRemoved?: (filterKey: FilterKey<Q>) => void;
|
|
89
89
|
/**
|
|
90
|
+
* Enable drag-and-drop reordering of filters.
|
|
91
|
+
* When true, drag handles are rendered and filters can be reordered.
|
|
92
|
+
* Reorder state is managed internally; consumers who need to track order
|
|
93
|
+
* should use controlled filterDefinitions.
|
|
94
|
+
*/
|
|
95
|
+
enableSorting?: boolean;
|
|
96
|
+
/**
|
|
90
97
|
* Show reset filters button in header
|
|
91
98
|
*/
|
|
92
99
|
showResetButton?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,WACA,WACA,sBACA,mBACK,WAAY;AACnB,YAAY,WAAW,OAAQ;AAC/B,cACE,eAAe,iBACf,gCACK,wBAAyB;AAChC,cAAc,8BAA8B,gCAAiC;AAC7E,cAAc,qCAAqC,+BAAgC;AACnF,cACE,yBACA,sCACK,8BAA+B;;;;AAKtC,YAAY,sBAAsB,UAAU,wBACxC,yBAAyB,KACzB,wBAAwB,KACxB,+BAA+B,GAAG,UAAU,MAC5C,8BAA8B,KAC9B,uBAAuB;;;;AAK3B,YAAY,UAAU,UAAU,wBAC9B,sBAAsB,iBAAiB,IAAI,UAAU;CAAE,WAAW;AAAG,IAAG,IACpE,UAAU;CAAE,gBAAgB;AAAG,IAAG;;;;AAOxC,YAAY,YAAY,UAAU,wBAChC,sBAAsB,iBAAiB,IACnC,UAAU;CAAE,mBAAmB;AAAG,IAAG;;;;;AAQ3C,YAAY,gBAAgB,UAAU,wBAAwB,IAC5D,sBAAsB,IACtB;AAGF,iBAAiB,gBAAgB,UAAU,sBAAsB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UZ,iBACEC,WAAW,UAAU,IACrBC,gBAAgB,MAAM,sBAAsB;;;;;;;CAS9C,mBAAmBD,WAAW,UAAU;;;;;;;CAQxC;;;;CAKA;;;;CAKA;;;;CAKA;;;;CAKA;;;;;CAMA,8BAA8B,MAAM;AACrC","names":["newClause: WhereClause<Q>","definition: FilterDefinitionUnion<Q>","newState: FilterStateType","filterKey: FilterKey<Q>","newDefinitions: Array<FilterDefinitionUnion<Q>>"],"sources":["../../../src/filter-list/FilterListApi.ts"],"version":3,"file":"FilterListApi.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,OAAO,WAAW,OAAQ;AAE1B,OAAO,iBAAS,kBAAkB,MAAM","names":[],"sources":["../../../../src/filter-list/base/DragHandleIcon.tsx"],"version":3,"file":"DragHandleIcon.d.ts"}
|
|
@@ -9,8 +9,9 @@ interface FilterListContentProps<Q extends ObjectTypeDefinition> {
|
|
|
9
9
|
filterStates: Map<string, FilterState>;
|
|
10
10
|
onFilterStateChanged: (filterKey: string, state: FilterState) => void;
|
|
11
11
|
whereClause: WhereClause<Q>;
|
|
12
|
+
enableSorting?: boolean;
|
|
12
13
|
className?: string;
|
|
13
14
|
style?: React.CSSProperties;
|
|
14
15
|
}
|
|
15
|
-
export declare function FilterListContent<Q extends ObjectTypeDefinition>({ objectType, objectSet, filterDefinitions, filterStates, onFilterStateChanged, whereClause, className, style }: FilterListContentProps<Q>): React.ReactElement;
|
|
16
|
+
export declare function FilterListContent<Q extends ObjectTypeDefinition>({ objectType, objectSet, filterDefinitions, filterStates, onFilterStateChanged, whereClause, enableSorting, className, style }: FilterListContentProps<Q>): React.ReactElement;
|
|
16
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AAsCA,cAAc,WAAW,sBAAsB,mBAAmB,WAAY;AAE9E,OAAO,WAA0D,OAAQ;AACzE,cAAc,6BAA6B,qBAAsB;AACjE,cAAc,mBAAmB,yBAA0B;UAejD,uBAAuB,UAAU,sBAAsB;CAC/D,YAAY;CACZ,WAAW,UAAU;CACrB,oBAAoB,MAAM,sBAAsB;CAChD,cAAc,YAAY;CAC1B,uBACEA,mBACAC,OAAO;CAET,aAAa,YAAY;CACzB;CACA;CACA,QAAQ,MAAM;AACf;AAED,OAAO,iBAAS,kBAAkB,UAAU,sBAAsB,EAChE,YACA,WACA,mBACA,cACA,sBACA,aACA,eACA,WACA,OAC0B,EAAzB,uBAAuB,KAAK,MAAM","names":["filterKey: string","state: FilterState"],"sources":["../../../../src/filter-list/base/FilterListContent.tsx"],"version":3,"file":"FilterListContent.d.ts"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DraggableAttributes, DraggableSyntheticListeners } from "@dnd-kit/core";
|
|
1
2
|
import type { ObjectSet, ObjectTypeDefinition, WhereClause } from "@osdk/api";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import type { FilterDefinitionUnion } from "../FilterListApi.js";
|
|
@@ -10,9 +11,11 @@ interface FilterListItemProps<Q extends ObjectTypeDefinition> {
|
|
|
10
11
|
filterState: FilterState | undefined;
|
|
11
12
|
onFilterStateChanged: (filterKey: string, state: FilterState) => void;
|
|
12
13
|
whereClause: WhereClause<Q>;
|
|
14
|
+
dragHandleAttributes?: DraggableAttributes;
|
|
15
|
+
dragHandleListeners?: DraggableSyntheticListeners;
|
|
13
16
|
className?: string;
|
|
14
17
|
style?: React.CSSProperties;
|
|
15
18
|
}
|
|
16
|
-
declare function FilterListItemInner<Q extends ObjectTypeDefinition>({ objectType, objectSet, definition, filterKey, filterState, onFilterStateChanged, whereClause, className, style }: FilterListItemProps<Q>): React.ReactElement;
|
|
19
|
+
declare function FilterListItemInner<Q extends ObjectTypeDefinition>({ objectType, objectSet, definition, filterKey, filterState, onFilterStateChanged, whereClause, dragHandleAttributes, dragHandleListeners, className, style }: FilterListItemProps<Q>): React.ReactElement;
|
|
17
20
|
export declare const FilterListItem: typeof FilterListItemInner;
|
|
18
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,WAAW,sBAAsB,mBAAmB,WAAY;AAE9E,OAAO,WAAkC,OAAQ;AAEjD,cAAc,6BAA6B,qBAAsB;AACjE,cAAc,mBAAmB,yBAA0B;
|
|
1
|
+
{"mappings":"AAgBA,cACE,qBACA,mCACK,eAAgB;AACvB,cAAc,WAAW,sBAAsB,mBAAmB,WAAY;AAE9E,OAAO,WAAkC,OAAQ;AAEjD,cAAc,6BAA6B,qBAAsB;AACjE,cAAc,mBAAmB,yBAA0B;UAMjD,oBAAoB,UAAU,sBAAsB;CAC5D,YAAY;CACZ,WAAW,UAAU;CACrB,YAAY,sBAAsB;CAClC;CACA,aAAa;CACb,uBACEA,mBACAC,OAAO;CAET,aAAa,YAAY;CACzB,uBAAuB;CACvB,sBAAsB;CACtB;CACA,QAAQ,MAAM;AACf;AAED,iBAAS,oBAAoB,UAAU,sBAAsB,EAC3D,YACA,WACA,YACA,WACA,aACA,sBACA,aACA,sBACA,qBACA,WACA,OACuB,EAAtB,oBAAoB,KAAK,MAAM;AA+ClC,OAAO,cAAM,uBAED","names":["filterKey: string","state: FilterState"],"sources":["../../../../src/filter-list/base/FilterListItem.tsx"],"version":3,"file":"FilterListItem.d.ts"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ObjectSet, ObjectTypeDefinition, WhereClause } from "@osdk/api";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { FilterDefinitionUnion } from "../FilterListApi.js";
|
|
4
|
+
import type { FilterState } from "../FilterListItemApi.js";
|
|
5
|
+
interface SortableFilterListItemProps<Q extends ObjectTypeDefinition> {
|
|
6
|
+
id: string;
|
|
7
|
+
objectType: Q;
|
|
8
|
+
objectSet: ObjectSet<Q>;
|
|
9
|
+
definition: FilterDefinitionUnion<Q>;
|
|
10
|
+
filterKey: string;
|
|
11
|
+
filterState: FilterState | undefined;
|
|
12
|
+
onFilterStateChanged: (filterKey: string, state: FilterState) => void;
|
|
13
|
+
whereClause: WhereClause<Q>;
|
|
14
|
+
}
|
|
15
|
+
export declare function SortableFilterListItem<Q extends ObjectTypeDefinition>({ id, objectType, objectSet, definition, filterKey, filterState, onFilterStateChanged, whereClause }: SortableFilterListItemProps<Q>): React.ReactElement;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAkBA,cAAc,WAAW,sBAAsB,mBAAmB,WAAY;AAE9E,OAAO,WAAwB,OAAQ;AACvC,cAAc,6BAA6B,qBAAsB;AACjE,cAAc,mBAAmB,yBAA0B;UAIjD,4BAA4B,UAAU,sBAAsB;CACpE;CACA,YAAY;CACZ,WAAW,UAAU;CACrB,YAAY,sBAAsB;CAClC;CACA,aAAa;CACb,uBACEA,mBACAC,OAAO;CAET,aAAa,YAAY;AAC1B;AAED,OAAO,iBAAS,uBAAuB,UAAU,sBAAsB,EACrE,IACA,YACA,WACA,YACA,WACA,aACA,sBACA,aAC+B,EAA9B,4BAA4B,KAAK,MAAM","names":["filterKey: string","state: FilterState"],"sources":["../../../../src/filter-list/base/SortableFilterListItem.tsx"],"version":3,"file":"SortableFilterListItem.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,4BAA4B,WAAY;AACtD,cAAc,6BAA6B,qBAAsB;AAGjE,OAAO,iBAAS,eAAe,UAAU,sBACvCA,YAAY,sBAAsB","names":["definition: FilterDefinitionUnion<Q>"],"sources":["../../../../src/filter-list/utils/getFilterLabel.ts"],"version":3,"file":"getFilterLabel.d.ts"}
|
|
@@ -14,9 +14,7 @@ export interface EditableCellProps<
|
|
|
14
14
|
rowId: string;
|
|
15
15
|
columnId: string;
|
|
16
16
|
}
|
|
17
|
-
declare function
|
|
17
|
+
export declare function EditableCell<
|
|
18
18
|
TData extends RowData,
|
|
19
19
|
CellValue = unknown
|
|
20
20
|
>({ initialValue, currentValue, cellId, dataType, onCellEdit, originalRowData, rowId, columnId }: EditableCellProps<TData, CellValue>): React.ReactElement;
|
|
21
|
-
export declare const EditableCell: typeof EditableCellInner;
|
|
22
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAiBA,cAAc,eAAe,uBAAwB;AAErD,OAAO,WAAyD,OAAQ;AAExE,cAAc,oBAAoB,kBAAmB;AAErD,iBAAiB;CAAkB,cAAc;CAAS;EAAqB;CAC7E,cAAc;CACd,cAAc;CACd;CACA;CACA,aAAaA,gBAAgBC,MAAM,aAAa,OAAO;CACvD,iBAAiB;CACjB;CACA;AACD;AA4CD,iBAAS;
|
|
1
|
+
{"mappings":"AAiBA,cAAc,eAAe,uBAAwB;AAErD,OAAO,WAAyD,OAAQ;AAExE,cAAc,oBAAoB,kBAAmB;AAErD,iBAAiB;CAAkB,cAAc;CAAS;EAAqB;CAC7E,cAAc;CACd,cAAc;CACd;CACA;CACA,aAAaA,gBAAgBC,MAAM,aAAa,OAAO;CACvD,iBAAiB;CACjB;CACA;AACD;AA4CD,OAAO,iBAAS;CAAa,cAAc;CAAS;EAAqB,EACvE,cACA,cACA,QACA,UACA,YACA,iBACA,OACA,UACoC,EAAnC,kBAAkB,OAAO,aAAa,MAAM","names":["cellId: string","info: CellEditInfo<TData, CellValue>"],"sources":["../../../src/object-table/EditableCell.tsx"],"version":3,"file":"EditableCell.d.ts"}
|
|
@@ -10,6 +10,5 @@ interface TableRowProps<TData extends RowData> {
|
|
|
10
10
|
setFocusedRowId?: (rowId: string | null) => void;
|
|
11
11
|
isInEditMode?: boolean;
|
|
12
12
|
}
|
|
13
|
-
declare function
|
|
14
|
-
export declare const TableRow: typeof TableRowInner;
|
|
13
|
+
export declare function TableRow<TData extends RowData>({ row, virtualRow, onRowClick, renderCellContextMenu, focusedRowId, setFocusedRowId, isInEditMode }: TableRowProps<TData>): React.ReactElement;
|
|
15
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,MAAM,KAAK,eAAe,uBAAwB;AAChE,cAAc,mBAAmB,yBAA0B;AAC3D,OAAO,WAA4B,OAAQ;UAIjC,cAAc,cAAc,SAAS;CAC7C,KAAK,IAAI;CACT,YAAY;CACZ,cAAcA,KAAK;CACnB,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;CACX;CACA,mBAAmBC;CACnB;AACD;AAED,iBAAS,
|
|
1
|
+
{"mappings":"AAgBA,cAAc,MAAM,KAAK,eAAe,uBAAwB;AAChE,cAAc,mBAAmB,yBAA0B;AAC3D,OAAO,WAA4B,OAAQ;UAIjC,cAAc,cAAc,SAAS;CAC7C,KAAK,IAAI;CACT,YAAY;CACZ,cAAcA,KAAK;CACnB,yBACEA,KAAK,OACLC,MAAM,KAAK,oBACR,MAAM;CACX;CACA,mBAAmBC;CACnB;AACD;AAED,OAAO,iBAAS,SAAS,cAAc,SAAS,EAC9C,KACA,YACA,YACA,uBACA,cACA,iBACA,cACqB,EAApB,cAAc,SAAS,MAAM","names":["row: TData","cell: Cell<TData, unknown>","rowId: string | null"],"sources":["../../../src/object-table/TableRow.tsx"],"version":3,"file":"TableRow.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react-components",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.13",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"react": "^18.3.1",
|
|
67
67
|
"react-dom": "^18.3.1",
|
|
68
68
|
"typescript": "~5.5.4",
|
|
69
|
-
"@osdk/
|
|
70
|
-
"@osdk/
|
|
69
|
+
"@osdk/client": "2.8.0-beta.17",
|
|
70
|
+
"@osdk/monorepo.api-extractor": "~0.7.0-beta.1",
|
|
71
|
+
"@osdk/api": "2.8.0-beta.17",
|
|
71
72
|
"@osdk/monorepo.tsconfig": "~0.7.0-beta.1",
|
|
72
|
-
"@osdk/react": "0.10.0-beta.8"
|
|
73
|
-
"@osdk/monorepo.api-extractor": "~0.7.0-beta.1"
|
|
73
|
+
"@osdk/react": "0.10.0-beta.8"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|