@crystaldesign/diva-archive 24.15.0-beta.9 → 24.16.0-beta.1

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.
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
2
  import React, { useState, useMemo, createElement } from 'react';
3
3
  import { HelpButton, getLogger, useDivaCore, useTranslation, DivaUtils, DivaError } from '@crystaldesign/diva-core';
4
- import Grid from '@crystaldesign/grid';
4
+ import Grid, { Loading, cellStyleHelper } from '@crystaldesign/grid';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import { Typography } from '@mui/material';
7
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -13,7 +13,6 @@ import createStyles from '@mui/styles/createStyles';
13
13
  import makeStyles from '@mui/styles/makeStyles';
14
14
  import TableRow from '@mui/material/TableRow';
15
15
  import TableCell from '@mui/material/TableCell';
16
- import Skeleton from '@mui/material/Skeleton';
17
16
  import { Histogram } from '@crystaldesign/analytics';
18
17
 
19
18
  (function() {
@@ -381,6 +380,7 @@ function openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t,
381
380
  autoHideDuration: 1000 * 60 * 2,
382
381
  clickable: true,
383
382
  message: t('basket.checkout.pdfqr'),
383
+ qrCodeSize: 312,
384
384
  qrCode: url
385
385
  }) : openComponent({
386
386
  url: url,
@@ -401,7 +401,8 @@ function openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t,
401
401
  autoHideDuration: 1000 * 60 * 2,
402
402
  clickable: true,
403
403
  message: t('basket.checkout.pdfqr'),
404
- qrCode: url
404
+ qrCode: url,
405
+ qrCodeSize: 312
405
406
  }) : openComponent({
406
407
  url: url,
407
408
  openInNewTab: (_action$openInNewTab2 = action.openInNewTab) !== null && _action$openInNewTab2 !== void 0 ? _action$openInNewTab2 : true
@@ -1164,86 +1165,49 @@ function SubRow$1 (_ref) {
1164
1165
  return /*#__PURE__*/jsx(Fragment, {});
1165
1166
  }
1166
1167
  if (loading) {
1167
- return /*#__PURE__*/jsxs(Fragment, {
1168
- children: [/*#__PURE__*/createElement(TableRow, _objectSpread(_objectSpread({}, row.getRowProps()), {}, {
1169
- key: "".concat(row.getRowProps().key, "-expanded-loading")
1170
- }), row.cells.map(function (cell) {
1171
- return /*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
1172
- children: /*#__PURE__*/jsx(Skeleton, {})
1173
- }));
1174
- })), /*#__PURE__*/createElement(TableRow, _objectSpread(_objectSpread({}, row.getRowProps()), {}, {
1175
- key: "".concat(row.getRowProps().key, "-expanded-loading1")
1176
- }), row.cells.map(function (cell) {
1177
- return /*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
1178
- children: /*#__PURE__*/jsx(Skeleton, {})
1179
- }));
1180
- })), /*#__PURE__*/createElement(TableRow, _objectSpread(_objectSpread({}, row.getRowProps()), {}, {
1181
- key: "".concat(row.getRowProps().key, "-expanded-loading2")
1182
- }), row.cells.map(function (cell) {
1183
- return /*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
1184
- children: /*#__PURE__*/jsx(Skeleton, {})
1185
- }));
1186
- }))]
1168
+ return /*#__PURE__*/jsx(Loading, {
1169
+ parentRow: _objectSpread(_objectSpread({}, row), {}, {
1170
+ depth: row.depth + 1
1171
+ })
1187
1172
  });
1188
1173
  }
1189
1174
  return /*#__PURE__*/jsx(Fragment, {
1190
1175
  children: data.map(function (x, i) {
1191
1176
  return /*#__PURE__*/createElement(TableRow, _objectSpread(_objectSpread({}, row.getRowProps()), {}, {
1177
+ className: "childRow",
1192
1178
  key: "".concat(row.getRowProps().key, "-expanded-").concat(i)
1193
- }), row.cells.flatMap(function (cell) {
1194
- var cells = [];
1195
- if (cell.column.fixed) {
1196
- cells.push(/*#__PURE__*/jsx(TableCell, _objectSpread({}, cell.getCellProps({
1197
- style: {
1198
- width: 1,
1199
- padding: 0,
1200
- position: 'relative',
1201
- backgroundColor: 'white',
1202
- zIndex: 4
1203
- }
1204
- }))));
1179
+ }), function () {
1180
+ var cellSettings = row.cells.flat();
1181
+ return cellSettings.map(function (cell, i) {
1182
+ var _cellSettings;
1183
+ var lastFlexible = ((_cellSettings = cellSettings[i + 1]) === null || _cellSettings === void 0 ? void 0 : _cellSettings.column.fixed) === true;
1184
+ var cells = [];
1185
+ if (cell.column.fixed) {
1186
+ cells.push(/*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
1187
+ className: "fixed-spacer1"
1188
+ })));
1189
+ cells.push(/*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps()), {}, {
1190
+ className: "fixed-spacer2",
1191
+ children: /*#__PURE__*/jsx("div", {})
1192
+ })));
1193
+ }
1205
1194
  cells.push(/*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps({
1206
- style: {
1207
- width: 1,
1208
- padding: 0,
1209
- position: 'sticky',
1210
- backgroundColor: 'white',
1211
- zIndex: 3,
1212
- right: 242
1213
- }
1195
+ style: _objectSpread(_objectSpread({}, cellStyleHelper(cell)), {}, {
1196
+ width: lastFlexible ? undefined : cell.column.width
1197
+ })
1214
1198
  })), {}, {
1215
- children: /*#__PURE__*/jsx("div", {
1216
- style: {
1217
- position: 'absolute',
1218
- top: 0,
1219
- left: 0,
1220
- bottom: 0,
1221
- width: 1,
1222
- boxShadow: '-1px 0px 0px 0px rgba(224, 224, 224, 1)'
1223
- }
1199
+ className: cell.column.fixed ? 'fixed' : '',
1200
+ children: cell.render('Cell', {
1201
+ value: cell.column.id != 'DivaNr' ? x[cell.column.id.replaceAll(/\[/g, '.').replaceAll(/\]/g, '')] : undefined,
1202
+ row: _objectSpread(_objectSpread({}, row), {}, {
1203
+ original: x,
1204
+ canExpand: false
1205
+ })
1224
1206
  })
1225
1207
  })));
1226
- }
1227
- cells.push(/*#__PURE__*/jsx(TableCell, _objectSpread(_objectSpread({}, cell.getCellProps({
1228
- style: {
1229
- width: cell.column.width,
1230
- padding: cell.column.padding,
1231
- position: cell.column.fixed ? 'sticky' : 'relative',
1232
- right: cell.column.fixed ? 0 : undefined,
1233
- backgroundColor: cell.column.fixed ? 'white' : undefined,
1234
- zIndex: cell.column.fixed ? 4 : 3
1235
- }
1236
- })), {}, {
1237
- children: cell.render('Cell', {
1238
- value: cell.column.id != 'DivaNr' ? x[cell.column.id.replaceAll(/\[/g, '.').replaceAll(/\]/g, '')] : undefined,
1239
- row: _objectSpread(_objectSpread({}, row), {}, {
1240
- original: x,
1241
- canExpand: false
1242
- })
1243
- })
1244
- })));
1245
- return cells;
1246
- }));
1208
+ return cells;
1209
+ });
1210
+ }());
1247
1211
  })
1248
1212
  });
1249
1213
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SubRow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/SubRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,CAAC,OAAO,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,qBAuGjG"}
1
+ {"version":3,"file":"SubRow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/SubRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAA4B,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,qBAmDjG"}
@@ -1,11 +1,10 @@
1
1
  import { ArchiveItem, Configuration } from './types';
2
- import { GridColumnActions } from '@crystaldesign/grid';
3
2
  interface Props {
4
3
  config: Configuration;
5
4
  trashed: boolean;
6
5
  showTrash: boolean;
7
6
  setReloadPage: React.Dispatch<React.SetStateAction<number>>;
8
7
  }
9
- export default function useActions({ config, trashed, showTrash, setReloadPage }: Props): GridColumnActions<ArchiveItem>[];
8
+ export default function useActions({ config, trashed, showTrash, setReloadPage }: Props): import("@crystaldesign/grid").GridColumnAction<ArchiveItem>[];
10
9
  export {};
11
10
  //# sourceMappingURL=useActions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useActions.d.ts","sourceRoot":"","sources":["../../../../src/useActions.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAiB,WAAW,EAAE,aAAa,EAA0B,MAAM,SAAS,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,UAAU,KAAK;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAC7D;AAID,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,KAAK,oCAmEtF"}
1
+ {"version":3,"file":"useActions.d.ts","sourceRoot":"","sources":["../../../../src/useActions.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAiB,WAAW,EAAE,aAAa,EAA0B,MAAM,SAAS,CAAC;AAI5F,UAAU,KAAK;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAC7D;AAID,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,KAAK,iEAmEtF"}
@@ -8,6 +8,6 @@ export default function useArchive({ config, trashed, hirarchy }: {
8
8
  options: GridOptions<ArchiveItem>;
9
9
  fetchHistory: (divaNr: string, version: string) => Promise<any>;
10
10
  prepareRow: (row: any) => void;
11
- actions: import("@crystaldesign/grid").GridColumnActions<ArchiveItem>[];
11
+ actions: import("@crystaldesign/grid").GridColumnAction<ArchiveItem>[];
12
12
  };
13
13
  //# sourceMappingURL=useArchive.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-archive",
3
- "version": "24.15.0-beta.9",
3
+ "version": "24.16.0-beta.1",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -15,10 +15,10 @@
15
15
  "react-dom": "^18.3.1"
16
16
  },
17
17
  "dependencies": {
18
- "@crystaldesign/grid": "24.15.0-beta.9",
18
+ "@crystaldesign/grid": "24.16.0-beta.1",
19
19
  "flat": "^5.0.2"
20
20
  },
21
21
  "module": "build/esm/index.js",
22
22
  "types": "./build/types/archive/src/index.d.ts",
23
- "gitHead": "62950297c7203e7029bcaa3e78e77e484a24c326"
23
+ "gitHead": "066575e4e585a2fdab50f620f6178aca744d0625"
24
24
  }