@uxf/data-grid 11.106.0 → 11.108.0

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/_api/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dataGridGetResult = dataGridGetResult;
4
4
  exports.dataGridAutocomplete = dataGridAutocomplete;
5
- const qs_1 = require("qs");
5
+ const qs_1 = require("@uxf/core/utils/qs");
6
6
  function dataGridGetResult(gridName, request) {
7
7
  return fetch(`/api/cms/datagrid/${gridName}?${(0, qs_1.stringify)(request)}`).then((response) => response.json());
8
8
  }
package/_store/reducer.js CHANGED
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.reducer = void 0;
7
4
  exports.getInitialState = getInitialState;
8
5
  const empty_array_1 = require("@uxf/core/constants/empty-array");
9
6
  const empty_object_1 = require("@uxf/core/constants/empty-object");
7
+ const deepmerge_1 = require("@uxf/core/utils/deepmerge");
10
8
  const is_nil_1 = require("@uxf/core/utils/is-nil");
11
- const deepmerge_1 = __importDefault(require("deepmerge"));
12
9
  const utils_1 = require("../utils");
13
10
  function getInitialState(schema, init, initialUserConfig) {
14
11
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
@@ -90,7 +87,7 @@ const reducer = (state, action) => {
90
87
  };
91
88
  case "SORT":
92
89
  if (((_a = state.request.s) === null || _a === void 0 ? void 0 : _a.name) === action.columnName) {
93
- return (0, deepmerge_1.default)(state, {
90
+ return (0, deepmerge_1.deepmerge)(state, {
94
91
  request: {
95
92
  s: {
96
93
  dir: ((_b = state.request.s) === null || _b === void 0 ? void 0 : _b.dir) === "asc" ? "desc" : "asc",
@@ -98,7 +95,7 @@ const reducer = (state, action) => {
98
95
  },
99
96
  });
100
97
  }
101
- return (0, deepmerge_1.default)(state, {
98
+ return (0, deepmerge_1.deepmerge)(state, {
102
99
  request: {
103
100
  s: { name: action.columnName, dir: (_c = action.direction) !== null && _c !== void 0 ? _c : "asc" },
104
101
  },
@@ -197,7 +194,7 @@ const reducer = (state, action) => {
197
194
  case "UPDATE_USER_CONFIG":
198
195
  return {
199
196
  ...state,
200
- userConfig: (0, deepmerge_1.default)(state.userConfig, action.userConfig),
197
+ userConfig: (0, deepmerge_1.deepmerge)(state.userConfig, action.userConfig),
201
198
  };
202
199
  case "REINITIALIZE_USER_CONFIG":
203
200
  return {
@@ -49,7 +49,6 @@ const text_link_1 = require("@uxf/ui/text-link");
49
49
  const react_1 = __importStar(require("react"));
50
50
  const column_item_1 = require("./column-item");
51
51
  const drop_placeholder_1 = require("./drop-placeholder");
52
- const types_1 = require("./types");
53
52
  function DataGridHiddenColumnsSortable(props) {
54
53
  const t = (0, translations_1.useUxfTranslation)();
55
54
  const columnsWithId = (0, react_1.useMemo)(() => props.schema.columns.filter((c) => !c.hidden).map((c) => ({ ...c, id: c.name })), [props.schema.columns]);
@@ -160,11 +159,11 @@ function DataGridHiddenColumnsSortable(props) {
160
159
  react_1.default.createElement("div", { className: "uxf-data-grid__hidden-columns-empty-box" },
161
160
  react_1.default.createElement(icon_1.Icon, { name: "triangle-exclamation-solid", size: 20 }),
162
161
  t("uxf-data-grid-hidden-columns:empty-message"))),
163
- react_1.default.createElement(sortable_1.SortableContext, { items: getSectionItemsIds("visible"), strategy: sortable_1.verticalListSortingStrategy }, (0, is_empty_1.isEmpty)(sections.visible) ? (react_1.default.createElement(drop_placeholder_1.DropPlaceholder, { id: types_1.EMPTY_VISIBLE_COLUMNS_PLACEHOLDER_ID, type: "visible" })) : (sections.visible.map((column) => (react_1.default.createElement(column_item_1.ColumnItem, { column: column, id: column.id, isChecked: true, key: `visible-${column.id}`, onToggle: handleToggle }))))),
162
+ react_1.default.createElement(sortable_1.SortableContext, { items: getSectionItemsIds("visible"), strategy: sortable_1.verticalListSortingStrategy }, (0, is_empty_1.isEmpty)(sections.visible) ? (react_1.default.createElement(drop_placeholder_1.DropPlaceholder, { id: use_sortable_multi_1.EMPTY_VISIBLE_COLUMNS_PLACEHOLDER_ID, type: "visible" })) : (sections.visible.map((column) => (react_1.default.createElement(column_item_1.ColumnItem, { column: column, id: column.id, isChecked: true, key: `visible-${column.id}`, onToggle: handleToggle }))))),
164
163
  react_1.default.createElement(show_1.Show, { when: (0, is_not_empty_1.isNotEmpty)(sections.hidden) || (0, is_not_nil_1.isNotNil)(activeItem) },
165
164
  react_1.default.createElement("div", { className: "uxf-data-grid__hidden-columns-title" },
166
165
  react_1.default.createElement("div", { className: "uxf-data-grid__hidden-columns-title-text" }, t("uxf-data-grid-hidden-columns:hidden-columns")),
167
166
  ((0, is_nil_1.isNil)(activeItem) || (0, is_not_empty_1.isNotEmpty)(sections.hidden)) && (react_1.default.createElement(text_link_1.TextLink, { onClick: onChangeAll(true), variant: "text" }, t("uxf-data-grid-hidden-columns:show-all")))),
168
- (0, is_empty_1.isEmpty)(sections.hidden) ? (react_1.default.createElement(drop_placeholder_1.DropPlaceholder, { id: types_1.EMPTY_HIDDEN_COLUMNS_PLACEHOLDER_ID, type: "hidden" })) : (sections.hidden.map((column) => (react_1.default.createElement(column_item_1.ColumnItem, { column: column, id: column.id, isChecked: false, key: `hidden-${column.id}`, onToggle: handleToggle }))))),
167
+ (0, is_empty_1.isEmpty)(sections.hidden) ? (react_1.default.createElement(drop_placeholder_1.DropPlaceholder, { id: use_sortable_multi_1.EMPTY_HIDDEN_COLUMNS_PLACEHOLDER_ID, type: "hidden" })) : (sections.hidden.map((column) => (react_1.default.createElement(column_item_1.ColumnItem, { column: column, id: column.id, isChecked: false, key: `hidden-${column.id}`, onToggle: handleToggle }))))),
169
168
  react_1.default.createElement(core_1.DragOverlay, { dropAnimation: dropAnimationConfig }, (0, is_not_nil_1.isNotNil)(activeItem) ? (react_1.default.createElement(column_item_1.ColumnItem, { column: activeItem, id: activeItem.id, isChecked: Boolean(sections.visible.find((c) => c.name === activeItem.name)), onToggle: () => void null })) : null))));
170
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/data-grid",
3
- "version": "11.106.0",
3
+ "version": "11.108.0",
4
4
  "description": "UXF DataGrid",
5
5
  "homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
6
6
  "main": "index.js",
@@ -34,25 +34,34 @@
34
34
  "typecheck": "tsc --noEmit --skipLibCheck"
35
35
  },
36
36
  "dependencies": {
37
- "@dnd-kit/core": "6.3.1",
38
- "@dnd-kit/sortable": "10.0.0",
39
- "@uxf/core": "11.106.0",
40
- "@uxf/core-react": "11.106.0",
41
- "@uxf/ui": "11.106.0",
42
- "dayjs": "1.11.19",
43
- "deepmerge": "4.3.1",
44
37
  "fast-glob": "3.3.3",
45
- "qs": "6.14.1",
46
38
  "yargs": "18.0.0"
47
39
  },
48
40
  "peerDependencies": {
41
+ "@dnd-kit/core": "^6.3.1",
42
+ "@dnd-kit/sortable": "^10.0.0",
43
+ "@dnd-kit/utilities": "^3.2.2",
44
+ "@uxf/core": "11.108.0",
45
+ "@uxf/core-react": "11.108.0",
46
+ "@uxf/localize": "11.108.0",
47
+ "@uxf/styles": "11.108.0",
48
+ "@uxf/ui": "11.108.0",
49
+ "dayjs": "^1.11.19",
49
50
  "react": ">=18.2.0",
50
51
  "react-dom": ">=18.2.0"
51
52
  },
52
53
  "devDependencies": {
54
+ "@dnd-kit/core": "^6.3.1",
55
+ "@dnd-kit/sortable": "^10.0.0",
56
+ "@dnd-kit/utilities": "^3.2.2",
53
57
  "@types/react": "18.3.27",
54
58
  "@types/react-dom": "18.3.7",
55
- "@types/qs": "6.14.0",
59
+ "@uxf/core": "11.108.0",
60
+ "@uxf/core-react": "11.108.0",
61
+ "@uxf/localize": "11.108.0",
62
+ "@uxf/styles": "11.108.0",
63
+ "@uxf/ui": "11.108.0",
64
+ "dayjs": "^1.11.19",
56
65
  "react": "18.3.1",
57
66
  "react-dom": "18.3.1"
58
67
  },
package/styles.css CHANGED
@@ -233,30 +233,6 @@ o
233
233
  padding-left: theme("spacing.4");
234
234
  }
235
235
 
236
- &__table {
237
- border: 1px solid var(--rdg-border-color);
238
- margin-top: 1px;
239
-
240
- &::-webkit-scrollbar {
241
- height: 8px;
242
- width: 8px;
243
- }
244
-
245
- &::-webkit-scrollbar-track {
246
- background-color: transparent;
247
- }
248
-
249
- &::-webkit-scrollbar-thumb,
250
- &::-webkit-scrollbar-thumb:hover {
251
- background-color: theme("colors.lightLow");
252
- border-radius: 999px;
253
-
254
- :root .dark & {
255
- background-color: theme("colors.darkLow");
256
- }
257
- }
258
- }
259
-
260
236
  &__toolbar {
261
237
  align-items: center;
262
238
  display: flex;
@@ -486,10 +462,10 @@ o
486
462
 
487
463
  &__hidden-columns-drop-placeholder {
488
464
  align-items: center;
489
- background-color: var(--gray-50);
490
- border: 1px dashed var(--gray-300);
465
+ background-color: theme("colors.gray.50");
466
+ border: 1px dashed theme("colors.gray.300");
491
467
  border-radius: 4px;
492
- color: var(--gray-500);
468
+ color: theme("colors.gray.500");
493
469
  display: grid;
494
470
  justify-content: center;
495
471
  min-height: 64px;
@@ -497,7 +473,7 @@ o
497
473
  padding: 16px;
498
474
 
499
475
  &--over {
500
- background-color: var(--gray-100);
476
+ background-color: theme("colors.gray.100");
501
477
  }
502
478
  }
503
479
 
@@ -539,42 +515,6 @@ o
539
515
  --panel-max-w: 400px;
540
516
  }
541
517
 
542
- .rdg-header-row {
543
- color: theme("colors.lightLow");
544
- font-weight: theme("fontWeight.normal");
545
-
546
- :root .dark & {
547
- color: theme("colors.darkLow");
548
- }
549
-
550
- .rdg-cell {
551
- background-color: var(--rdg-header-background-color);
552
-
553
- :root .dark & {
554
- color: theme("colors.darkMedium");
555
- }
556
-
557
- &:not(:first-child) {
558
- border-inline-start: 1px solid var(--rdg-border-color);
559
- }
560
- }
561
- }
562
-
563
- .rdg-header-sort-name + span {
564
- align-items: center;
565
- display: flex;
566
- }
567
-
568
- .rdg-cell {
569
- border-block-end-width: 1px;
570
- border-color: var(--rdg-border-color);
571
- border-inline-end: none;
572
-
573
- &.rdg-cell-frozen {
574
- box-shadow: none;
575
- }
576
- }
577
-
578
518
  @keyframes datagridlineanim {
579
519
  0% {
580
520
  left: -40%;