@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 @@
|
|
|
1
|
+
{"version":3,"file":"SortableFilterListItem.js","names":["useSortable","CSS","classnames","React","useMemo","FilterListItem","styles","SortableFilterListItem","id","objectType","objectSet","definition","filterKey","filterState","onFilterStateChanged","whereClause","attributes","listeners","setNodeRef","transform","transition","isDragging","style","Transform","toString","undefined","createElement","ref","className","dragging","dragHandleAttributes","dragHandleListeners"],"sources":["SortableFilterListItem.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 { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport type { ObjectSet, ObjectTypeDefinition, WhereClause } from \"@osdk/api\";\nimport classnames from \"classnames\";\nimport React, { useMemo } from \"react\";\nimport type { FilterDefinitionUnion } from \"../FilterListApi.js\";\nimport type { FilterState } from \"../FilterListItemApi.js\";\nimport { FilterListItem } from \"./FilterListItem.js\";\nimport styles from \"./FilterListItem.module.css\";\n\ninterface SortableFilterListItemProps<Q extends ObjectTypeDefinition> {\n id: string;\n objectType: Q;\n objectSet: ObjectSet<Q>;\n definition: FilterDefinitionUnion<Q>;\n filterKey: string;\n filterState: FilterState | undefined;\n onFilterStateChanged: (\n filterKey: string,\n state: FilterState,\n ) => void;\n whereClause: WhereClause<Q>;\n}\n\nexport function SortableFilterListItem<Q extends ObjectTypeDefinition>({\n id,\n objectType,\n objectSet,\n definition,\n filterKey,\n filterState,\n onFilterStateChanged,\n whereClause,\n}: SortableFilterListItemProps<Q>): React.ReactElement {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id });\n\n const style = useMemo<React.CSSProperties>(() => ({\n transform: CSS.Transform.toString(transform),\n transition: transition ?? undefined,\n }), [transform, transition]);\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className={classnames(isDragging && styles.dragging)}\n >\n <FilterListItem\n objectType={objectType}\n objectSet={objectSet}\n definition={definition}\n filterKey={filterKey}\n filterState={filterState}\n onFilterStateChanged={onFilterStateChanged}\n whereClause={whereClause}\n dragHandleAttributes={attributes}\n dragHandleListeners={listeners}\n />\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,GAAG,QAAQ,oBAAoB;AAExC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAGtC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,OAAOC,MAAM,MAAM,6BAA6B;AAgBhD,OAAO,SAASC,sBAAsBA,CAAiC;EACrEC,EAAE;EACFC,UAAU;EACVC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,oBAAoB;EACpBC;AAC8B,CAAC,EAAsB;EACrD,MAAM;IACJC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC;EACF,CAAC,GAAGrB,WAAW,CAAC;IAAEQ;EAAG,CAAC,CAAC;EAEvB,MAAMc,KAAK,GAAGlB,OAAO,CAAsB,OAAO;IAChDe,SAAS,EAAElB,GAAG,CAACsB,SAAS,CAACC,QAAQ,CAACL,SAAS,CAAC;IAC5CC,UAAU,EAAEA,UAAU,IAAIK;EAC5B,CAAC,CAAC,EAAE,CAACN,SAAS,EAAEC,UAAU,CAAC,CAAC;EAE5B,oBACEjB,KAAA,CAAAuB,aAAA;IACEC,GAAG,EAAET,UAAW;IAChBI,KAAK,EAAEA,KAAM;IACbM,SAAS,EAAE1B,UAAU,CAACmB,UAAU,IAAIf,MAAM,CAACuB,QAAQ;EAAE,gBAErD1B,KAAA,CAAAuB,aAAA,CAACrB,cAAc;IACbI,UAAU,EAAEA,UAAW;IACvBC,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBC,SAAS,EAAEA,SAAU;IACrBC,WAAW,EAAEA,WAAY;IACzBC,oBAAoB,EAAEA,oBAAqB;IAC3CC,WAAW,EAAEA,WAAY;IACzBe,oBAAoB,EAAEd,UAAW;IACjCe,mBAAmB,EAAEd;EAAU,CAChC,CACE,CAAC;AAEV","ignoreList":[]}
|
|
@@ -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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,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.js";
|
|
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":[]}
|
package/build/browser/styles.css
CHANGED
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
|
|
483
483
|
.DraggableList-module__dragHandle___Ds-CeRi4 {
|
|
484
484
|
display: flex;
|
|
485
|
-
cursor:
|
|
485
|
+
cursor: var(--osdk-drag-handle-cursor);
|
|
486
486
|
color: var(--osdk-draggable-item-drag-icon-color);
|
|
487
487
|
|
|
488
488
|
&:hover {
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
}
|
|
491
491
|
|
|
492
492
|
&:active {
|
|
493
|
-
cursor:
|
|
493
|
+
cursor: var(--osdk-drag-handle-cursor-active);
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
&:focus {
|
|
@@ -940,6 +940,12 @@
|
|
|
940
940
|
font-size: var(--osdk-filter-list-empty-font-size);
|
|
941
941
|
}
|
|
942
942
|
|
|
943
|
+
.FilterListContent-module__dragOverlay___Tjd1YpmI {
|
|
944
|
+
box-shadow: var(--osdk-filter-item-drag-overlay-shadow);
|
|
945
|
+
border-radius: var(--osdk-filter-item-drag-overlay-border-radius);
|
|
946
|
+
background: var(--osdk-filter-item-drag-overlay-bg);
|
|
947
|
+
}
|
|
948
|
+
|
|
943
949
|
|
|
944
950
|
/* filter-list/base/FilterListHeader.module.css */
|
|
945
951
|
/*
|
|
@@ -1111,6 +1117,38 @@
|
|
|
1111
1117
|
flex-direction: column;
|
|
1112
1118
|
}
|
|
1113
1119
|
|
|
1120
|
+
.FilterListItem-module__dragHandle___BwFrILWs {
|
|
1121
|
+
display: flex;
|
|
1122
|
+
align-items: center;
|
|
1123
|
+
justify-content: center;
|
|
1124
|
+
padding: var(--osdk-filter-item-drag-handle-padding);
|
|
1125
|
+
margin-right: var(--osdk-surface-spacing);
|
|
1126
|
+
border: none;
|
|
1127
|
+
background: var(--osdk-filter-item-drag-handle-bg);
|
|
1128
|
+
cursor: var(--osdk-drag-handle-cursor);
|
|
1129
|
+
border-radius: var(--osdk-filter-item-drag-handle-border-radius);
|
|
1130
|
+
color: var(--osdk-filter-item-drag-handle-color);
|
|
1131
|
+
touch-action: none;
|
|
1132
|
+
|
|
1133
|
+
&:hover {
|
|
1134
|
+
color: var(--osdk-filter-item-drag-handle-color-hover);
|
|
1135
|
+
background: var(--osdk-filter-item-drag-handle-bg-hover);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
&:active {
|
|
1139
|
+
cursor: var(--osdk-drag-handle-cursor-active);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
&:focus-visible {
|
|
1143
|
+
outline: 2px solid var(--osdk-filter-item-drag-handle-focus-outline-color);
|
|
1144
|
+
outline-offset: 2px;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
.FilterListItem-module__dragging___S5-LGyfS {
|
|
1149
|
+
opacity: var(--osdk-filter-item-dragging-opacity);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1114
1152
|
|
|
1115
1153
|
/* filter-list/base/inputs/CheckboxListInput.module.css */
|
|
1116
1154
|
/*
|