datastake-daf 0.6.791 → 0.6.793

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.
@@ -7193,7 +7193,8 @@ MoreOptions.propTypes = {
7193
7193
  const NavigationAction = _ref => {
7194
7194
  let {
7195
7195
  onClick,
7196
- theme
7196
+ theme,
7197
+ disabled = false
7197
7198
  } = _ref;
7198
7199
  return /*#__PURE__*/jsxRuntime.jsx("div", {
7199
7200
  style: {
@@ -7202,13 +7203,15 @@ const NavigationAction = _ref => {
7202
7203
  },
7203
7204
  children: /*#__PURE__*/jsxRuntime.jsx("button", {
7204
7205
  onClick: onClick,
7206
+ disabled: disabled,
7205
7207
  style: {
7206
- cursor: 'pointer',
7207
7208
  border: 'none',
7208
7209
  background: 'transparent',
7209
7210
  padding: 0,
7210
7211
  display: 'flex',
7211
- alignItems: 'center'
7212
+ alignItems: 'center',
7213
+ opacity: disabled ? 0.5 : 1,
7214
+ cursor: disabled ? 'not-allowed' : 'pointer'
7212
7215
  },
7213
7216
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
7214
7217
  name: "Link",
@@ -9558,29 +9561,24 @@ const processConditionalTableKeys = (tableKeys, item) => {
9558
9561
  });
9559
9562
  return processedKeys;
9560
9563
  };
9561
- const renderFieldData = function (type, value, user, config) {
9562
- let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
9563
- let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
9564
- let app = arguments.length > 6 ? arguments[6] : undefined;
9565
- let allValues = arguments.length > 7 ? arguments[7] : undefined;
9566
- let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
9564
+ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, getAppHeader = () => {}, app, allValues, formValues = {}) => {
9567
9565
  switch (type) {
9568
9566
  case 'year':
9569
9567
  return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
9570
9568
  case 'date':
9571
9569
  {
9572
- const language = user !== null && user !== void 0 && user.language && (user === null || user === void 0 ? void 0 : user.language) === 'sp' ? 'es' : user === null || user === void 0 ? void 0 : user.language;
9570
+ const language = user?.language && user?.language === 'sp' ? 'es' : user?.language;
9573
9571
  return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
9574
9572
  }
9575
9573
  case 'select':
9576
9574
  {
9577
- const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9575
+ const options = config?.options || [];
9578
9576
  const option = findOptions(value, options);
9579
9577
  return option;
9580
9578
  }
9581
9579
  case 'multiselect':
9582
9580
  {
9583
- const options = (config === null || config === void 0 ? void 0 : config.options) || [];
9581
+ const options = config?.options || [];
9584
9582
  const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
9585
9583
  const option = findOptions(_val, options);
9586
9584
  return option.join(', ');
@@ -9595,7 +9593,7 @@ const renderFieldData = function (type, value, user, config) {
9595
9593
  formValues: formValues
9596
9594
  });
9597
9595
  case 'percentage':
9598
- return value === '-' || value === null || value === undefined ? '-' : "".concat(value, " %");
9596
+ return value === '-' || value === null || value === undefined ? '-' : `${value} %`;
9599
9597
  case 'geolocation':
9600
9598
  {
9601
9599
  const val = JSON.parse(value) || {};
@@ -9609,7 +9607,7 @@ const renderFieldData = function (type, value, user, config) {
9609
9607
  case 'upload':
9610
9608
  case 'videoUpload':
9611
9609
  {
9612
- const documentName = allValues === null || allValues === void 0 ? void 0 : allValues.map(item => item === null || item === void 0 ? void 0 : item.name).join(', ');
9610
+ const documentName = allValues?.map(item => item?.name).join(', ');
9613
9611
  return documentName;
9614
9612
  }
9615
9613
  default:
@@ -9737,19 +9735,18 @@ const resolveDynamicLabel = (labelConfig, item, defaultLabel) => {
9737
9735
  return labelConfig || defaultLabel;
9738
9736
  };
9739
9737
 
9740
- const handleSectionChildren = _ref => {
9741
- let {
9742
- config,
9743
- allData,
9744
- level,
9745
- t,
9746
- rootForm,
9747
- user,
9748
- getApiBaseUrl = () => {},
9749
- getAppHeader = () => {},
9750
- app,
9751
- TreeNodeComponent
9752
- } = _ref;
9738
+ const handleSectionChildren = ({
9739
+ config,
9740
+ allData,
9741
+ level,
9742
+ t,
9743
+ rootForm,
9744
+ user,
9745
+ getApiBaseUrl = () => {},
9746
+ getAppHeader = () => {},
9747
+ app,
9748
+ TreeNodeComponent
9749
+ }) => {
9753
9750
  if (!(level === 0 && config && typeof config === 'object')) {
9754
9751
  return null;
9755
9752
  }
@@ -9763,14 +9760,14 @@ const handleSectionChildren = _ref => {
9763
9760
  let fieldValue;
9764
9761
 
9765
9762
  // Determine field value based on type
9766
- if (fieldConfig.type === 'dataLinkGroup' && Array.isArray(allData === null || allData === void 0 ? void 0 : allData[fieldKey])) {
9763
+ if (fieldConfig.type === 'dataLinkGroup' && Array.isArray(allData?.[fieldKey])) {
9767
9764
  fieldValue = allData[fieldKey];
9768
- } else if (fieldConfig.type === 'dataLinkGroup' && allData !== null && allData !== void 0 && allData[fieldKey]) {
9765
+ } else if (fieldConfig.type === 'dataLinkGroup' && allData?.[fieldKey]) {
9769
9766
  fieldValue = allData[fieldKey];
9770
9767
  } else if (fieldConfig.type === 'group') {
9771
9768
  fieldValue = {};
9772
9769
  } else {
9773
- fieldValue = allData === null || allData === void 0 ? void 0 : allData[fieldKey];
9770
+ fieldValue = allData?.[fieldKey];
9774
9771
  }
9775
9772
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
9776
9773
  nodeKey: fieldKey,
@@ -42107,17 +42104,20 @@ function AuthForm(_ref) {
42107
42104
  case "number":
42108
42105
  inputNode = /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2({
42109
42106
  type: field.type,
42110
- placeholder: field.placeholder
42107
+ placeholder: field.placeholder,
42108
+ disabled: field.disabled
42111
42109
  }, field.props));
42112
42110
  break;
42113
42111
  case "password":
42114
42112
  inputNode = /*#__PURE__*/jsxRuntime.jsx(antd.Input.Password, _objectSpread2({
42115
- placeholder: field.placeholder
42113
+ placeholder: field.placeholder,
42114
+ disabled: field.disabled
42116
42115
  }, field.props));
42117
42116
  break;
42118
42117
  case "textarea":
42119
42118
  inputNode = /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2({
42120
- placeholder: field.placeholder
42119
+ placeholder: field.placeholder,
42120
+ disabled: field.disabled
42121
42121
  }, field.props));
42122
42122
  break;
42123
42123
  case "select":
@@ -42126,7 +42126,8 @@ function AuthForm(_ref) {
42126
42126
  const _ref3 = field.props || {},
42127
42127
  restSelectProps = _objectWithoutProperties(_ref3, _excluded$d);
42128
42128
  inputNode = /*#__PURE__*/jsxRuntime.jsx(StyledSelect, _objectSpread2(_objectSpread2({
42129
- placeholder: field.placeholder
42129
+ placeholder: field.placeholder,
42130
+ disabled: field.disabled
42130
42131
  }, restSelectProps), {}, {
42131
42132
  children: (_field$options = field.options) === null || _field$options === void 0 ? void 0 : _field$options.map(opt => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
42132
42133
  value: opt.value,
@@ -42140,7 +42141,8 @@ function AuthForm(_ref) {
42140
42141
  break;
42141
42142
  default:
42142
42143
  inputNode = /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2({
42143
- placeholder: field.placeholder
42144
+ placeholder: field.placeholder,
42145
+ disabled: field.disabled
42144
42146
  }, field.props));
42145
42147
  }
42146
42148
  const formItemProps = {
@@ -42347,6 +42349,34 @@ const SideIcon = _ref3 => {
42347
42349
  });
42348
42350
  };
42349
42351
 
42352
+ function ProgressBarWithIcon(_ref) {
42353
+ let {
42354
+ published,
42355
+ data,
42356
+ t
42357
+ } = _ref;
42358
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
42359
+ style: {
42360
+ display: "flex",
42361
+ alignItems: "center",
42362
+ gap: "5px"
42363
+ },
42364
+ children: [/*#__PURE__*/jsxRuntime.jsx(ProgressBar, {
42365
+ style: {
42366
+ width: "100%"
42367
+ },
42368
+ tooltipTitle: published && t("Submitted"),
42369
+ percentage: parseInt((data === null || data === void 0 ? void 0 : data.completion) || 0),
42370
+ isSubmitted: published
42371
+ }), published ? /*#__PURE__*/jsxRuntime.jsx(SideIcon, {
42372
+ size: 16,
42373
+ iconSize: 10
42374
+ }) : /*#__PURE__*/jsxRuntime.jsxs("span", {
42375
+ children: [parseInt((data === null || data === void 0 ? void 0 : data.completion) || 0), "%"]
42376
+ })]
42377
+ });
42378
+ }
42379
+
42350
42380
  const _excluded$b = ["value", "options", "onChange", "className", "width"];
42351
42381
  const ProgressTabs = _ref => {
42352
42382
  let {
@@ -62595,6 +62625,7 @@ exports.PieChart = Chart;
62595
62625
  exports.PieChartTooltip = Tooltip;
62596
62626
  exports.ProgressBar = ProgressBar;
62597
62627
  exports.ProgressBarSideIcon = SideIcon;
62628
+ exports.ProgressBarWithIcon = ProgressBarWithIcon;
62598
62629
  exports.ProgressTabs = ProgressTabs;
62599
62630
  exports.ProjectVisualisationAlert = Alert;
62600
62631
  exports.ProjectVisualisationFooter = Footer;