unifyedx-storybook-new 0.1.80 → 0.1.82

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.
@@ -75965,6 +75965,39 @@ function DataTableRenderer({ item, data: initialData, updateHandler, validationE
75965
75965
  ),
75966
75966
  renderError(rowIndex)
75967
75967
  ] });
75968
+ case "selectDynamic":
75969
+ return (props, rowIndex) => {
75970
+ const getDynamicOptions = () => {
75971
+ if (field.optionsFrom && initialData) {
75972
+ const { config, valueField, labelField } = field.optionsFrom;
75973
+ const configData = initialData[config] || [];
75974
+ if (Array.isArray(configData)) {
75975
+ return configData.map((item2) => ({
75976
+ id: item2[valueField] || "",
75977
+ value: item2[valueField] || "",
75978
+ label: item2[labelField] || ""
75979
+ }));
75980
+ }
75981
+ }
75982
+ return field.options || [];
75983
+ };
75984
+ return /* @__PURE__ */ jsxs("div", { children: [
75985
+ /* @__PURE__ */ jsx(
75986
+ Select,
75987
+ {
75988
+ index: rowIndex,
75989
+ value: props[field.key] || "",
75990
+ onChange: (value) => updateFieldValue(rowIndex, value),
75991
+ options: getDynamicOptions(),
75992
+ placeholder: field.placeholder || `Select ${field.label}`,
75993
+ required: field.required,
75994
+ className: `w-full ${getFieldError(rowIndex) ? "border-red-500" : ""}`
75995
+ },
75996
+ Math.random()
75997
+ ),
75998
+ renderError(rowIndex)
75999
+ ] });
76000
+ };
75968
76001
  case "multiselect":
75969
76002
  return (props, rowIndex) => {
75970
76003
  const currentValue = props[field.key] || [];
@@ -77153,6 +77186,47 @@ const FullConfigPage = ({
77153
77186
  overview = {},
77154
77187
  configuration = []
77155
77188
  } = config;
77189
+ const processedConfiguration = configuration.map((section) => {
77190
+ if (section.type === "section" && section.fields) {
77191
+ const processedFields = [...section.fields];
77192
+ const appkeyFieldIndex = processedFields.findIndex((field) => field.key === "appkey");
77193
+ if (appkeyFieldIndex !== -1) {
77194
+ const appkeyField = processedFields[appkeyFieldIndex];
77195
+ processedFields[appkeyFieldIndex] = {
77196
+ ...appkeyField,
77197
+ default: appid,
77198
+ value: appid,
77199
+ disabled: true,
77200
+ placeholder: appid
77201
+ };
77202
+ const displaynameFieldExists = processedFields.some((field) => field.key === "displayname");
77203
+ if (!displaynameFieldExists) {
77204
+ const displaynameField = {
77205
+ key: "displayname",
77206
+ label: "Display Name",
77207
+ fieldtype: "text",
77208
+ default: appid,
77209
+ value: appid,
77210
+ placeholder: "Enter display name",
77211
+ required: false
77212
+ };
77213
+ processedFields.splice(appkeyFieldIndex + 1, 0, displaynameField);
77214
+ } else {
77215
+ const displaynameFieldIndex = processedFields.findIndex((field) => field.key === "displayname");
77216
+ processedFields[displaynameFieldIndex] = {
77217
+ ...processedFields[displaynameFieldIndex],
77218
+ default: appid,
77219
+ value: appid
77220
+ };
77221
+ }
77222
+ }
77223
+ return {
77224
+ ...section,
77225
+ fields: processedFields
77226
+ };
77227
+ }
77228
+ return section;
77229
+ });
77156
77230
  const defaultPageHeader = {
77157
77231
  heading: "App Details",
77158
77232
  subHeading: "View app details and customize configurations to align with institutional requirements.",
@@ -77177,8 +77251,19 @@ const FullConfigPage = ({
77177
77251
  console.log("User cancelled the cancel action - modal closed, data preserved");
77178
77252
  }
77179
77253
  }, []);
77254
+ const getDisplayName = () => {
77255
+ for (const section of processedConfiguration) {
77256
+ if (section.type === "section" && section.fields) {
77257
+ const displaynameField = section.fields.find((field) => field.key === "displayname");
77258
+ if (displaynameField) {
77259
+ return displaynameField.default || displaynameField.value || appid;
77260
+ }
77261
+ }
77262
+ }
77263
+ return appid;
77264
+ };
77180
77265
  const defaultAppletHeader = {
77181
- heading: "Application",
77266
+ heading: getDisplayName(),
77182
77267
  subHeading: "Application configuration and details",
77183
77268
  tags: [],
77184
77269
  ...appletHeader
@@ -77204,7 +77289,7 @@ const FullConfigPage = ({
77204
77289
  };
77205
77290
  const tabs = [
77206
77291
  { label: "Overview", content: renderOverview(defaultOverview) },
77207
- { label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration }, disableApi, onCancel: handleCancelRequest }) }
77292
+ { label: "Configuration", content: /* @__PURE__ */ jsx(DynamicConfig, { appid, configdata: { configuration: processedConfiguration }, disableApi, onCancel: handleCancelRequest }) }
77208
77293
  ];
77209
77294
  function renderIcon(icon) {
77210
77295
  if (!icon) {