@uxf/data-grid 11.88.0 → 11.88.2

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/data-grid-v2.js CHANGED
@@ -27,7 +27,7 @@ function DataGridV2(props) {
27
27
  return (react_1.default.createElement(react_1.default.Fragment, null,
28
28
  react_1.default.createElement(root_1.DataGridRoot, { className: props.className },
29
29
  react_1.default.createElement(toolbar_1.DataGridToolbar, null,
30
- react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { actions: props.actions, changeTabFilterBehavior: props.changeTabFilterBehavior, schema: props.schema, state: props.state }),
30
+ react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { actions: props.actions, changeTabFilterBehavior: props.changeTabFilterBehavior, schema: props.schema, state: props.state, variant: props.tabsVariant }),
31
31
  react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: props.actions, filterHandlers: (_a = props.filterHandlers) !== null && _a !== void 0 ? _a : filter_handler_1.defaultFilterHandlers, getCsvDownloadUrl: props.getCsvDownloadUrl, schema: props.schema, state: props.state }),
32
32
  react_1.default.createElement(toolbar_customs_1.DataGridToolbarCustoms, { buttons: props.customActions })),
33
33
  react_1.default.createElement(linear_progress_1.DataGridLinearProgress, { isLoading: props.isLoading }),
@@ -104,6 +104,6 @@ function Default() {
104
104
  });
105
105
  return (react_1.default.createElement("div", { className: "p-10" },
106
106
  react_1.default.createElement(radio_group_1.RadioGroup, { label: "Chov\u00E1n\u00ED p\u0159ep\u00EDn\u00E1n\u00ED tab\u016F", name: "filterBehavior", onChange: (value) => setFilterBehavior(value), options: FILTER_BEHAVIOR_OPTIONS, value: filterBehavior, variant: "row" }),
107
- react_1.default.createElement(data_grid_v2_1.DataGridV2, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: filterBehavior !== null && filterBehavior !== void 0 ? filterBehavior : "filtersPerTab", data: data, error: error, getCsvDownloadUrl: () => ``, isLoading: isLoading, isRowSelectDisabled: (row) => row.id === 6, isRowsSelectable: true, reload: reload, rowAccent: (row) => (row.id === 2 ? "success" : undefined), rowClassName: (row) => (row.id === 3 ? "some-custom-classname" : undefined), rowHeight: "auto", schema: schemaWithFrontendConfig, state: state }),
107
+ react_1.default.createElement(data_grid_v2_1.DataGridV2, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: filterBehavior !== null && filterBehavior !== void 0 ? filterBehavior : "filtersPerTab", data: data, error: error, getCsvDownloadUrl: () => ``, isLoading: isLoading, isRowSelectDisabled: (row) => row.id === 6, isRowsSelectable: true, reload: reload, rowAccent: (row) => (row.id === 2 ? "success" : undefined), rowClassName: (row) => (row.id === 3 ? "some-custom-classname" : undefined), rowHeight: "auto", schema: schemaWithFrontendConfig, state: state, tabsVariant: "segmented" }),
108
108
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
109
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/data-grid",
3
- "version": "11.88.0",
3
+ "version": "11.88.2",
4
4
  "description": "UXF DataGrid",
5
5
  "homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
6
6
  "main": "index.js",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@uxf/core": "11.88.0",
35
35
  "@uxf/core-react": "11.88.0",
36
- "@uxf/ui": "11.88.0",
36
+ "@uxf/ui": "11.88.2",
37
37
  "dayjs": "1.11.19",
38
38
  "deepmerge": "4.3.1",
39
39
  "fast-glob": "3.3.3",
package/styles.css CHANGED
@@ -376,6 +376,34 @@ o
376
376
  display: flex;
377
377
  flex: 1;
378
378
 
379
+ &--variant-segmented {
380
+ .uxf-data-grid__toolbar-tabs {
381
+ &-nav {
382
+ background-color: theme("colors.neutral.100");
383
+ gap: 4px;
384
+ margin-block: 4px;
385
+ padding: 2px;
386
+
387
+ :root .dark & {
388
+ background-color: theme("colors.neutral.900");
389
+ }
390
+ }
391
+ }
392
+
393
+ .uxf-data-grid__toolbar-tab {
394
+ border-bottom-style: none;
395
+ padding: 8px 16px;
396
+
397
+ &.is-active {
398
+ background-color: theme("colors.white");
399
+
400
+ :root .dark & {
401
+ background-color: theme("colors.black");
402
+ }
403
+ }
404
+ }
405
+ }
406
+
379
407
  &-nav {
380
408
  &--desktop {
381
409
  display: none;
@@ -7,5 +7,6 @@ export interface DataGridToolbarTabsProps extends DataGridControl {
7
7
  changeTabFilterBehavior?: ChangeTabFilterBehavior;
8
8
  schema: Schema<any>;
9
9
  tabCounts?: Record<string, number> | Nullish;
10
+ variant?: "default" | "segmented";
10
11
  }
11
12
  export declare function DataGridToolbarTabs(props: DataGridToolbarTabsProps): React.JSX.Element;
@@ -18,10 +18,10 @@ function Tab(props) {
18
18
  props.tabCount ? " (" + props.tabCount + ")" : ""));
19
19
  }
20
20
  function DataGridToolbarTabs(props) {
21
- var _a, _b, _c, _d;
21
+ var _a, _b, _c, _d, _e;
22
22
  return (react_1.default.createElement(show_1.Show, { when: Boolean((_a = props.schema.tabs) === null || _a === void 0 ? void 0 : _a.length) },
23
- react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-tabs" },
24
- react_1.default.createElement("nav", { "aria-label": "Tabs", className: "uxf-data-grid__toolbar-tabs-nav uxf-data-grid__toolbar-tabs-nav--desktop" }, (_b = props.schema.tabs) === null || _b === void 0 ? void 0 : _b.map((tab) => (react_1.default.createElement(Tab, { isActive: props.state.request.tab === tab.name, key: tab.name, onClick: () => { var _a; return props.actions.changeTab(tab, (_a = props.changeTabFilterBehavior) !== null && _a !== void 0 ? _a : "filtersPerTab"); }, tabCount: props.tabCounts ? props.tabCounts[tab.name] : undefined, title: tab.label })))),
23
+ react_1.default.createElement("div", { className: `uxf-data-grid__toolbar-tabs uxf-data-grid__toolbar-tabs--variant-${(_b = props.variant) !== null && _b !== void 0 ? _b : "default"}` },
24
+ react_1.default.createElement("nav", { "aria-label": "Tabs", className: "uxf-data-grid__toolbar-tabs-nav uxf-data-grid__toolbar-tabs-nav--desktop" }, (_c = props.schema.tabs) === null || _c === void 0 ? void 0 : _c.map((tab) => (react_1.default.createElement(Tab, { isActive: props.state.request.tab === tab.name, key: tab.name, onClick: () => { var _a; return props.actions.changeTab(tab, (_a = props.changeTabFilterBehavior) !== null && _a !== void 0 ? _a : "filtersPerTab"); }, tabCount: props.tabCounts ? props.tabCounts[tab.name] : undefined, title: tab.label })))),
25
25
  react_1.default.createElement("nav", { className: "uxf-data-grid__toolbar-tabs-nav uxf-data-grid__toolbar-tabs-nav--mobile" },
26
26
  react_1.default.createElement(button_1.Button, { className: "uxf-data-grid__toolbar-tabs-button", onClick: () => {
27
27
  var _a;
@@ -36,6 +36,6 @@ function DataGridToolbarTabs(props) {
36
36
  react_1.default.createElement("span", { className: "uxf-data-grid__toolbar-tabs-modal-button-text" }, tab.label))))))),
37
37
  });
38
38
  }, size: "sm", variant: "text" },
39
- react_1.default.createElement("span", { className: "uxf-data-grid__toolbar-tabs-nav-text" }, (_d = (_c = props.schema.tabs) === null || _c === void 0 ? void 0 : _c.find((t) => t.name === props.state.request.tab)) === null || _d === void 0 ? void 0 : _d.label),
39
+ react_1.default.createElement("span", { className: "uxf-data-grid__toolbar-tabs-nav-text" }, (_e = (_d = props.schema.tabs) === null || _d === void 0 ? void 0 : _d.find((t) => t.name === props.state.request.tab)) === null || _e === void 0 ? void 0 : _e.label),
40
40
  react_1.default.createElement(icon_1.Icon, { className: "uxf-data-grid__toolbar-tabs-button-icon", name: "caretDown", size: 16 }))))));
41
41
  }
@@ -12,24 +12,25 @@ import { BaseGridType, Schema } from "./schema";
12
12
  export type DataGridControlProps = DataGridControl;
13
13
  export type DataGridDataProps<Row> = DataGridFetchingResult<Row>;
14
14
  export type DataGridBaseProps<GridType extends BaseGridType, Row> = {
15
- schema: Schema<GridType>;
16
- gridName?: string;
17
- keyExtractor?: KeyExtractor;
18
- getCsvDownloadUrl?: CsvDownloadGetUrl;
19
- rowHeight?: number | ((row: Row) => number) | "auto";
20
- headerRowHeight?: number;
21
- rowAccent?: (row: Row) => RowAccent;
22
- rowClassName?: (row: Row) => string | Nullish;
23
- className?: string;
24
- customActions?: DataGridToolbarCustomsProps["buttons"];
15
+ NoRowsFallback?: NoRowsFallbackComponent;
16
+ SelectedRowsToolbarActions?: SelectedRowsToolbarActionsComponent;
25
17
  actionCell?: DataGridTableProps<Row>["actionCell"];
26
18
  bodyCells?: BodyCellComponents;
19
+ changeTabFilterBehavior?: ChangeTabFilterBehavior;
20
+ className?: string;
21
+ customActions?: DataGridToolbarCustomsProps["buttons"];
27
22
  filterHandlers?: FilterHandlers;
28
- NoRowsFallback?: NoRowsFallbackComponent;
29
- SelectedRowsToolbarActions?: SelectedRowsToolbarActionsComponent;
30
- isRowsSelectable?: boolean;
31
- isRowSelectDisabled?: (row: Row) => boolean;
23
+ getCsvDownloadUrl?: CsvDownloadGetUrl;
24
+ gridName?: string;
25
+ headerRowHeight?: number;
32
26
  isDebug?: boolean;
33
- changeTabFilterBehavior?: ChangeTabFilterBehavior;
27
+ isRowSelectDisabled?: (row: Row) => boolean;
28
+ isRowsSelectable?: boolean;
29
+ keyExtractor?: KeyExtractor;
30
+ rowAccent?: (row: Row) => RowAccent;
31
+ rowClassName?: (row: Row) => string | Nullish;
32
+ rowHeight?: number | ((row: Row) => number) | "auto";
33
+ schema: Schema<GridType>;
34
+ tabsVariant?: "default" | "segmented";
34
35
  };
35
36
  export type DataGridProps<GridType extends BaseGridType, Row> = DataGridBaseProps<GridType, Row> & DataGridDataProps<Row> & DataGridControlProps;