datastake-daf 0.6.769 → 0.6.770

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.
@@ -9600,27 +9600,25 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
9600
9600
  }
9601
9601
  };
9602
9602
 
9603
- const renderValue = _ref => {
9604
- let {
9605
- value,
9606
- hasChildren,
9607
- config,
9608
- user,
9609
- getApiBaseUrl = () => {},
9610
- getAppHeader = () => {},
9611
- app,
9612
- allData = {}
9613
- } = _ref;
9614
- if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9615
- if (!(config !== null && config !== void 0 && config.inputs)) return null;
9603
+ const renderValue = ({
9604
+ value,
9605
+ hasChildren,
9606
+ config,
9607
+ user,
9608
+ getApiBaseUrl = () => {},
9609
+ getAppHeader = () => {},
9610
+ app,
9611
+ allData = {}
9612
+ }) => {
9613
+ if (config?.type === 'groupInputs') {
9614
+ if (!config?.inputs) return null;
9616
9615
  const inputKeys = Object.keys(config.inputs).sort((a, b) => {
9617
- var _config$inputs$a, _config$inputs$b;
9618
- const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
9619
- const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
9616
+ const positionA = config.inputs[a]?.position || 0;
9617
+ const positionB = config.inputs[b]?.position || 0;
9620
9618
  return positionA - positionB;
9621
9619
  });
9622
9620
  const values = inputKeys.map(inputKey => {
9623
- let inputValue = value === null || value === void 0 ? void 0 : value[inputKey];
9621
+ let inputValue = value?.[inputKey];
9624
9622
  if (inputValue === null || inputValue === undefined || inputValue === '') {
9625
9623
  return '';
9626
9624
  } else if (typeof inputValue === 'object' && inputValue !== null) {
@@ -9661,8 +9659,8 @@ const renderValue = _ref => {
9661
9659
  } else {
9662
9660
  displayValue = String(value);
9663
9661
  }
9664
- const fieldType = (config === null || config === void 0 ? void 0 : config.type) || 'text';
9665
- let cssClass = "tree-value ".concat(fieldType, "-type");
9662
+ const fieldType = config?.type || 'text';
9663
+ let cssClass = `tree-value ${fieldType}-type`;
9666
9664
  if (displayValue === '-') {
9667
9665
  cssClass += ' empty';
9668
9666
  }
@@ -9672,21 +9670,19 @@ const renderValue = _ref => {
9672
9670
  children: displayValue
9673
9671
  });
9674
9672
  };
9675
- const determineHasChildren = _ref2 => {
9676
- var _config$meta;
9677
- let {
9678
- config,
9679
- level
9680
- } = _ref2;
9681
- if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
9673
+ const determineHasChildren = ({
9674
+ config,
9675
+ level
9676
+ }) => {
9677
+ if (config?.type === 'groupInputs') {
9682
9678
  return false;
9683
9679
  }
9684
- if ((config === null || config === void 0 ? void 0 : config.type) === 'header' && config !== null && config !== void 0 && config.inputs && Object.keys(config.inputs).length > 0) {
9680
+ if (config?.type === 'header' && config?.inputs && Object.keys(config.inputs).length > 0) {
9685
9681
  return true;
9686
9682
  }
9687
- return (config === null || config === void 0 ? void 0 : config.inputs) || (config === null || config === void 0 ? void 0 : config.type) === 'group' || (config === null || config === void 0 ? void 0 : config.type) === 'dataLinkGroup' || (config === null || config === void 0 ? void 0 : config.type) === 'section' || (config === null || config === void 0 ? void 0 : config.type) === 'ajaxSubGroup' ||
9683
+ return config?.inputs || config?.type === 'group' || config?.type === 'dataLinkGroup' || config?.type === 'section' || config?.type === 'ajaxSubGroup' ||
9688
9684
  // Add this line
9689
- (config === null || config === void 0 ? void 0 : config.type) === 'dataLink' && (config === null || config === void 0 || (_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.tableKeys) || level === 0 && config && typeof config === 'object' && Object.keys(config).some(key => key !== 'id' && key !== 'label' && key !== 'position' && key !== 'subTitle' && typeof config[key] === 'object' && config[key] !== null);
9685
+ config?.type === 'dataLink' && config?.meta?.tableKeys || level === 0 && config && typeof config === 'object' && Object.keys(config).some(key => key !== 'id' && key !== 'label' && key !== 'position' && key !== 'subTitle' && typeof config[key] === 'object' && config[key] !== null);
9690
9686
  };
9691
9687
 
9692
9688
  const sortByPosition = (items, getConfig) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.769",
3
+ "version": "0.6.770",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",