@crystaldesign/diva-backoffice 26.8.0-beta.53 → 26.8.0-beta.54

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.
@@ -44424,6 +44424,17 @@ function useModule (currentModules) {
44424
44424
  children: t('backoffice.menu.items.label.IDMCatalogEditorTableFeatureClasses')
44425
44425
  }),
44426
44426
  title: t('backoffice.menu.items.label.IDMCatalogEditorTableFeatureClasses')
44427
+ }, {
44428
+ key: 'formulas',
44429
+ style: {
44430
+ margin: 0
44431
+ },
44432
+ icon: /*#__PURE__*/jsx(ApartmentOutlined, {}),
44433
+ label: /*#__PURE__*/jsx(Link, {
44434
+ to: 'catalogs/idmeditor/catalogs/' + catalogId + '/formulas' + (searchParams ? '?' + searchParams.toString() : ''),
44435
+ children: t('backoffice.menu.items.label.IDMCatalogEditorTableFormulas')
44436
+ }),
44437
+ title: t('backoffice.menu.items.label.IDMCatalogEditorTableFormulas')
44427
44438
  }, {
44428
44439
  key: 'items',
44429
44440
  style: {
@@ -46988,8 +46999,7 @@ function parsedFromFormFields(raw) {
46988
46999
  var _v = toLookupScalar(raw.optionRefNo);
46989
47000
  if (_v) base.optionRefNo = _v;
46990
47001
  } else if (raw.referenceType === REFERENCE_TYPES.FORMULA_REF) {
46991
- var _raw$formula;
46992
- var f = (_raw$formula = raw.formula) === null || _raw$formula === void 0 ? void 0 : _raw$formula.trim();
47002
+ var f = toLookupScalar(raw.formula);
46993
47003
  if (f) base.formula = f;
46994
47004
  }
46995
47005
  }
@@ -47008,8 +47018,7 @@ function parsedFromFormFields(raw) {
47008
47018
  var _v3 = toLookupScalar(raw.optionRefNo);
47009
47019
  if (_v3) base.optionRefNo = _v3;
47010
47020
  } else if (raw.referenceType === REFERENCE_TYPES.FORMULA_REF) {
47011
- var _raw$formula2;
47012
- var _f = (_raw$formula2 = raw.formula) === null || _raw$formula2 === void 0 ? void 0 : _raw$formula2.trim();
47021
+ var _f = toLookupScalar(raw.formula);
47013
47022
  if (_f) base.formula = _f;
47014
47023
  }
47015
47024
  }
@@ -47125,6 +47134,24 @@ function ActionsForm(_ref) {
47125
47134
  }]
47126
47135
  };
47127
47136
  }, [langU]);
47137
+ var formulasRead = useMemo(function () {
47138
+ return {
47139
+ read: "".concat(idmService, "/catalogs/").concat(catalogId, "/formulas")
47140
+ };
47141
+ }, [catalogId, idmService]);
47142
+ var formulaSelectMapping = useMemo(function () {
47143
+ return {
47144
+ label: '${formulaKey} - ${formulaString}',
47145
+ value: 'formulaKey',
47146
+ searchField: [{
47147
+ field: 'formulaKey',
47148
+ filter: 'contains'
47149
+ }, {
47150
+ field: 'formulaString',
47151
+ filter: 'contains'
47152
+ }]
47153
+ };
47154
+ }, []);
47128
47155
  var actionTypeSelectOptions = useMemo(function () {
47129
47156
  return Object.entries(ACTION_TYPES).map(function (_ref2) {
47130
47157
  var _ref3 = _slicedToArray(_ref2, 2),
@@ -47359,8 +47386,20 @@ function ActionsForm(_ref) {
47359
47386
  return /*#__PURE__*/jsx(Form$2.Item, {
47360
47387
  name: field.name,
47361
47388
  label: label,
47362
- rules: requiredRules.input(field.labelKey),
47363
- children: /*#__PURE__*/jsx(Input$1, {})
47389
+ rules: requiredRules.select(field.labelKey),
47390
+ children: /*#__PURE__*/jsx(Selector, {
47391
+ mode: "single",
47392
+ search: true,
47393
+ minWidth: "100%",
47394
+ apiInterface: formulasRead,
47395
+ selectMapping: formulaSelectMapping,
47396
+ useValueAsData: true,
47397
+ classNames: {
47398
+ popup: {
47399
+ root: 'ag-custom-component-popup'
47400
+ }
47401
+ }
47402
+ })
47364
47403
  });
47365
47404
  }
47366
47405
  var optionRefNeedsFeature = refType === REFERENCE_TYPES.OPTION_REF && (watchedActionType === null || watchedActionType === void 0 ? void 0 : watchedActionType.startsWith('SET_FEATURE')) && !toLookupScalar(watchedFeatureNo);
@@ -47384,7 +47423,7 @@ function ActionsForm(_ref) {
47384
47423
  }
47385
47424
  }, refType === REFERENCE_TYPES.OPTION_REF ? "option-ref-".concat((_toLookupScalar = toLookupScalar(watchedFeatureNo)) !== null && _toLookupScalar !== void 0 ? _toLookupScalar : '') : undefined)
47386
47425
  });
47387
- }, [allFeaturesRead, fieldLabel, optionRefNeedsFeatureHint, optionSelectMapping, optionsReadForOptionRef, featureSelectMapping, requiredRules, watchedActionType, watchedFeatureNo]);
47426
+ }, [allFeaturesRead, fieldLabel, formulaSelectMapping, formulasRead, optionRefNeedsFeatureHint, optionSelectMapping, optionsReadForOptionRef, featureSelectMapping, requiredRules, watchedActionType, watchedFeatureNo]);
47388
47427
  var editingLegacySetMessage = (value === null || value === void 0 ? void 0 : value.actionType) === ACTION_TYPES.SET_MESSAGE;
47389
47428
  return /*#__PURE__*/jsxs("div", {
47390
47429
  className: formContainer,
@@ -51003,6 +51042,116 @@ var TableOptionGroups = observer(function () {
51003
51042
  });
51004
51043
  });
51005
51044
 
51045
+ var TableFormulas = observer(function () {
51046
+ var _useTranslation = useTranslation(),
51047
+ t = _useTranslation.t;
51048
+ var _useModule = useModule(['formulas']),
51049
+ selectedCatalog = _useModule.selectedCatalog,
51050
+ catalogId = _useModule.catalogId,
51051
+ organizationId = _useModule.organizationId,
51052
+ apiConfig = _useModule.apiConfig,
51053
+ setSelectedSerie = _useModule.setSelectedSerie,
51054
+ setSelectedItem = _useModule.setSelectedItem,
51055
+ selectedItem = _useModule.selectedItem,
51056
+ selectedSerie = _useModule.selectedSerie;
51057
+ useTools({
51058
+ mainInformationWindowCodex: 'IDM_FORMULAS_TABLE_INFO',
51059
+ catalog: selectedCatalog,
51060
+ setSerie: setSelectedSerie,
51061
+ setArticle: setSelectedItem,
51062
+ item: selectedItem,
51063
+ serie: selectedSerie
51064
+ });
51065
+ var applicationData = useMemo(function () {
51066
+ return {
51067
+ catalogId: catalogId,
51068
+ organizationId: organizationId
51069
+ };
51070
+ }, [catalogId, organizationId]);
51071
+ var configuration = useMemo(function () {
51072
+ return {
51073
+ type: 'dotnetSSM',
51074
+ apiInterface: {
51075
+ read: apiConfig.idmService + '/catalogs/${catalogId}/formulas',
51076
+ create: apiConfig.idmService + '/catalogs/${catalogId}/formulas',
51077
+ restore: apiConfig.idmService + '/catalogs/${catalogId}/formulas/${_id}',
51078
+ "delete": apiConfig.idmService + '/catalogs/${catalogId}/formulas/${_id}',
51079
+ update: apiConfig.idmService + '/catalogs/${catalogId}/formulas/${_id}',
51080
+ bulk: apiConfig.idmService + '/catalogs/${catalogId}/formulas/bulk'
51081
+ },
51082
+ dateFormat: 'DD.MM.YYYY, HH:mm:ss',
51083
+ colDef: [{
51084
+ field: 'formulaKey',
51085
+ headerName: 'backoffice.idmCatalog.formula.label.formulaKey',
51086
+ required: true,
51087
+ unique: true
51088
+ }, {
51089
+ field: 'formulaString',
51090
+ headerName: 'backoffice.idmCatalog.formula.label.formulaString'
51091
+ }, {
51092
+ headerName: 'backoffice.idmCatalog.general.label.lastUpdatedDate',
51093
+ field: 'lastUpdatedDate',
51094
+ cellDataType: 'dateString',
51095
+ editable: false
51096
+ }, {
51097
+ headerName: 'backoffice.idmCatalog.general.label.createdDate',
51098
+ field: 'createdDate',
51099
+ cellDataType: 'dateString',
51100
+ editable: false
51101
+ }, {
51102
+ headerName: 'backoffice.idmCatalog.general.label.createdByDisplayText',
51103
+ field: 'createdByDisplayText',
51104
+ editable: false
51105
+ }, {
51106
+ headerName: 'backoffice.idmCatalog.general.label.lastUpdatedByDisplayText',
51107
+ field: 'lastUpdatedByDisplayText',
51108
+ editable: false
51109
+ }, {
51110
+ headerName: 'backoffice.idmCatalog.general.label._id',
51111
+ field: '_id',
51112
+ editable: false,
51113
+ cellDataType: 'objectId'
51114
+ }, {
51115
+ field: 'organizationId',
51116
+ editable: false,
51117
+ hide: true,
51118
+ lockVisible: true,
51119
+ suppressColumnsToolPanel: true,
51120
+ defaultValue: '${organizationId}'
51121
+ }, {
51122
+ field: 'catalogId',
51123
+ editable: false,
51124
+ hide: true,
51125
+ lockVisible: true,
51126
+ suppressColumnsToolPanel: true,
51127
+ defaultValue: '${catalogId}'
51128
+ }]
51129
+ };
51130
+ }, [selectedCatalog === null || selectedCatalog === void 0 ? void 0 : selectedCatalog.isoLanguageIds]);
51131
+ return /*#__PURE__*/jsxs(Fragment, {
51132
+ children: [/*#__PURE__*/jsx(Descriptions$1, {
51133
+ title: /*#__PURE__*/jsxs("div", {
51134
+ children: [/*#__PURE__*/jsxs(Space$1, {
51135
+ children: [t('backoffice.menu.items.label.IDMCatalogEditorTableFormulas'), /*#__PURE__*/jsx(InformationButton, {
51136
+ codex: "IDM_FORMULAS_TABLE_INFO"
51137
+ })]
51138
+ }), /*#__PURE__*/jsx(Space$1, {
51139
+ style: {
51140
+ "float": 'right'
51141
+ },
51142
+ children: /*#__PURE__*/jsx(CatalogSelector$1, {
51143
+ modules: ['formulas']
51144
+ })
51145
+ })]
51146
+ })
51147
+ }), selectedCatalog && /*#__PURE__*/jsx(Spreadsheet, {
51148
+ gridId: 'crud-grid_formulas',
51149
+ applicationData: applicationData,
51150
+ configuration: configuration
51151
+ })]
51152
+ });
51153
+ });
51154
+
51006
51155
  function IDMCatalogEditor (_ref) {
51007
51156
  _objectDestructuringEmpty(_ref);
51008
51157
  return /*#__PURE__*/jsx("div", {
@@ -51045,6 +51194,9 @@ function Content$6() {
51045
51194
  }), /*#__PURE__*/jsx(Route, {
51046
51195
  path: ":catalogId/optiongroups",
51047
51196
  element: /*#__PURE__*/jsx(TableOptionGroups, {})
51197
+ }), /*#__PURE__*/jsx(Route, {
51198
+ path: ":catalogId/formulas",
51199
+ element: /*#__PURE__*/jsx(TableFormulas, {})
51048
51200
  }), /*#__PURE__*/jsx(Route, {
51049
51201
  path: ":catalogId/featureclasses",
51050
51202
  element: /*#__PURE__*/jsx(TableFeatureClasses, {})
@@ -1 +1 @@
1
- {"version":3,"file":"ActionsForm.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/Tables/OptionCombinations/ActionsForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,OAAO,EAOL,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAC;AA+DxB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,qBA6Z/F"}
1
+ {"version":3,"file":"ActionsForm.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/Tables/OptionCombinations/ActionsForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,OAAO,EAOL,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAC;AA+DxB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,qBA0b/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"useModule.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/hooks/useModule.tsx"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,WAAW,cAAc,EAAE,MAAM,EAAE;;;;;;;;;;;;EAoKhD"}
1
+ {"version":3,"file":"useModule.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/hooks/useModule.tsx"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,WAAW,cAAc,EAAE,MAAM,EAAE;;;;;;;;;;;;EA+KhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/IDMCatalogEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAcxD,UAAU,KAAK;IACb,aAAa,EAAE,6BAA6B,CAAC;IAC7C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,KAAK,qBAMjC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/IDMCatalogEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAexD,UAAU,KAAK;IACb,aAAa,EAAE,6BAA6B,CAAC;IAC7C,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,KAAK,qBAMjC"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const TableFormulas: (() => React.JSX.Element) & {
3
+ displayName: string;
4
+ };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableFormulas/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAYvC,eAAO,MAAM,aAAa;;CAgHxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "26.8.0-beta.53",
3
+ "version": "26.8.0-beta.54",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -15,13 +15,13 @@
15
15
  "dependencies": {
16
16
  "@ant-design/icons": "6.1.0",
17
17
  "@babel/runtime": "7.24.7",
18
- "@crystaldesign/content-box": "26.8.0-beta.53",
19
- "@crystaldesign/content-item": "26.8.0-beta.53",
20
- "@crystaldesign/diva-core": "26.8.0-beta.53",
21
- "@crystaldesign/diva-utils": "26.8.0-beta.53",
22
- "@crystaldesign/media-upload": "26.8.0-beta.53",
23
- "@crystaldesign/rtf-editor": "26.8.0-beta.53",
24
- "@crystaldesign/spreadsheet": "26.8.0-beta.53",
18
+ "@crystaldesign/content-box": "26.8.0-beta.54",
19
+ "@crystaldesign/content-item": "26.8.0-beta.54",
20
+ "@crystaldesign/diva-core": "26.8.0-beta.54",
21
+ "@crystaldesign/diva-utils": "26.8.0-beta.54",
22
+ "@crystaldesign/media-upload": "26.8.0-beta.54",
23
+ "@crystaldesign/rtf-editor": "26.8.0-beta.54",
24
+ "@crystaldesign/spreadsheet": "26.8.0-beta.54",
25
25
  "@dnd-kit/core": "^6.1.0",
26
26
  "@dnd-kit/sortable": "^8.0.0",
27
27
  "@dnd-kit/utilities": "^3.2.2",
@@ -56,5 +56,5 @@
56
56
  },
57
57
  "module": "build/esm/index.js",
58
58
  "types": "./build/types/backoffice/src/index.d.ts",
59
- "gitHead": "e948537e57bc413cab6c3e80125a18558ec8560b"
59
+ "gitHead": "b9594a753970e1ae96d9fcfc1141a702b396b59c"
60
60
  }