@realtek/core-theme 0.0.138 → 0.0.139

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.
package/dist-lib/index.js CHANGED
@@ -11202,7 +11202,7 @@ function Uh(e = []) {
11202
11202
  return null;
11203
11203
  }
11204
11204
  function Wh(e = []) {
11205
- return [...e].filter((e) => !Vh(e.hideGroup)).sort((e, t) => Number(e.order ?? 0) - Number(t.order ?? 0)).map((e) => ({
11205
+ return [...e].filter((e) => !Vh(e.hideGroup) && !Vh(e.hideGroupInDetail)).sort((e, t) => Number(e.order ?? 0) - Number(t.order ?? 0)).map((e) => ({
11206
11206
  ...e,
11207
11207
  fields: [...e.fields ?? []].filter((e) => String(e.field ?? "").trim() !== "" && (e.show === void 0 || Vh(e.show))).sort((e, t) => Number(e.order ?? 0) - Number(t.order ?? 0))
11208
11208
  })).filter((e) => e.fields.length);
@@ -20168,7 +20168,7 @@ function Lx(e = []) {
20168
20168
  return r;
20169
20169
  });
20170
20170
  }
20171
- var Rx = new Set(/* @__PURE__ */ "label.field.type.show.req.edit.order.formatter.validations.showOnAdd.addRow.minRows.maxRows.initialRows.addLabel.subFields.placeholder.hidePlaceholder.combineKey.combineLabel.combineRole.combineToggleLabel.combineToggleTarget.combineWidth.combineWrap.combineSpan.defaultOnEdit.emptyValues.valuePaths.clientScope.clientGateMessage.clientGateResetOnChange.visiblePermission.editablePermission.infoEnabled.infoText.helpText.payloadKey.prefillFrom.prefillFromModule.dataType.elementType.payloadMode.valueKey.displayKey.defaultValue.richValue.omitEmpty.payloadTemplate.transformRule.multiple.maxCount.fileKey.fileNameKey.fileUrlKey.accept.showIf.labelWhen.verifyAction.verifyResultField.verifyTimestampField.verifyIdleLabel.verifyRetryLabel.verifySuccessLabel.disabledByField.linkedClearField.autofillFrom.aiActions.validator.dataSource.masterName.groupName.options.multiSelect.lookupCollection.displayField.displayField2.valueField.lookupFilterField.lookupFilterValueFrom.value.documentPreview.displayAs.renderType.renderOptions".split(".")), zx = new Set(/* @__PURE__ */ "module.name.label.addRow.order.fields.hideGroup.moduleName.writeRefs.dependsOn.optionalWrite.appendHistory.historyField.historyTimestampField.minRows.maxRows.initialRows.requireOne.requireValidatedField.linkGroup.infoEnabled.infoText.toggleEnabled.toggleLabel.toggleField.afterSubmit.afterSubmitMode.afterSubmitTarget.submitMessages.submitMsgAddSuccess.submitMsgEditSuccess.submitMsgAddError.submitMsgEditError.submitMsgSuppress.id._id.rows.toggleValue".split("."));
20171
+ var Rx = new Set(/* @__PURE__ */ "label.field.type.show.req.edit.order.formatter.validations.showOnAdd.addRow.minRows.maxRows.initialRows.addLabel.subFields.placeholder.hidePlaceholder.combineKey.combineLabel.combineRole.combineToggleLabel.combineToggleTarget.combineWidth.combineWrap.combineSpan.defaultOnEdit.emptyValues.valuePaths.clientScope.clientGateMessage.clientGateResetOnChange.visiblePermission.editablePermission.infoEnabled.infoText.helpText.payloadKey.prefillFrom.prefillFromModule.dataType.elementType.payloadMode.valueKey.displayKey.defaultValue.richValue.omitEmpty.payloadTemplate.transformRule.multiple.maxCount.fileKey.fileNameKey.fileUrlKey.accept.showIf.labelWhen.verifyAction.verifyResultField.verifyTimestampField.verifyIdleLabel.verifyRetryLabel.verifySuccessLabel.disabledByField.linkedClearField.autofillFrom.aiActions.validator.dataSource.masterName.groupName.options.multiSelect.lookupCollection.displayField.displayField2.valueField.lookupFilterField.lookupFilterValueFrom.value.documentPreview.displayAs.renderType.renderOptions".split(".")), zx = new Set(/* @__PURE__ */ "module.name.label.addRow.order.fields.hideGroup.moduleName.writeRefs.dependsOn.optionalWrite.appendHistory.historyField.historyFields.historyTimestampField.minRows.maxRows.initialRows.requireOne.requireValidatedField.linkGroup.infoEnabled.infoText.toggleEnabled.toggleLabel.toggleField.afterSubmit.afterSubmitMode.afterSubmitTarget.submitMessages.submitMsgAddSuccess.submitMsgEditSuccess.submitMsgAddError.submitMsgEditError.submitMsgSuppress.id._id.rows.toggleValue".split("."));
20172
20172
  function Bx(e) {
20173
20173
  return {
20174
20174
  ...e,
@@ -22719,7 +22719,7 @@ function Hx({ open: e, editingGroup: t, defaultModule: n, moduleOptions: r, allG
22719
22719
  dependsOn: t.dependsOn ?? [],
22720
22720
  optionalWrite: t.optionalWrite ?? !1,
22721
22721
  appendHistory: t.appendHistory ?? !1,
22722
- historyField: t.historyField ?? "",
22722
+ historyField: [t.historyField, ...t.historyFields ?? []].filter(Boolean).filter((e, t, n) => n.indexOf(e) === t).join(", "),
22723
22723
  historyTimestampField: t.historyTimestampField ?? "",
22724
22724
  minRows: t.minRows ?? "",
22725
22725
  maxRows: t.maxRows ?? "",
@@ -22846,9 +22846,10 @@ function Hx({ open: e, editingGroup: t, defaultModule: n, moduleOptions: r, allG
22846
22846
  let t = (n.dependsOn ?? []).map((e) => String(e).trim()).filter(Boolean);
22847
22847
  t.length && (r.dependsOn = t), n.optionalWrite && (r.optionalWrite = !0);
22848
22848
  }
22849
- n.appendHistory && String(n.historyField ?? "").trim() && (r.appendHistory = !0, r.historyField = n.historyField.trim(), String(n.historyTimestampField ?? "").trim() && (r.historyTimestampField = n.historyTimestampField.trim())), n.addRow && n.minRows !== void 0 && n.minRows !== "" && (r.minRows = Number(n.minRows)), n.addRow && n.initialRows !== void 0 && n.initialRows !== "" && (r.initialRows = Number(n.initialRows)), n.addRow && n.maxRows !== void 0 && n.maxRows !== "" && (r.maxRows = Number(n.maxRows)), n.addRow && String(n.requireValidatedField ?? "").trim() && (r.requireValidatedField = n.requireValidatedField.trim()), n.addRow && n.requireOne && (r.requireOne = !0), n.addRow && n.linkGroup && (r.linkGroup = n.linkGroup.trim()), n.infoEnabled && n.infoText && (r.infoEnabled = !0, r.infoText = n.infoText), n.toggleEnabled && n.toggleField && (r.toggleEnabled = !0, r.toggleLabel = n.toggleLabel || "Toggle", r.toggleField = n.toggleField), n.afterSubmitMode && (r.afterSubmit = { mode: n.afterSubmitMode }, (n.afterSubmitMode === "route" || n.afterSubmitMode === "detail") && (r.afterSubmit.target = (n.afterSubmitTarget || "").trim()));
22850
- let i = {};
22851
- if ((n.submitMsgAddSuccess || "").trim() && (i.addSuccess = n.submitMsgAddSuccess.trim()), (n.submitMsgEditSuccess || "").trim() && (i.editSuccess = n.submitMsgEditSuccess.trim()), (n.submitMsgAddError || "").trim() && (i.addError = n.submitMsgAddError.trim()), (n.submitMsgEditError || "").trim() && (i.editError = n.submitMsgEditError.trim()), n.submitMsgSuppress && (i.suppress = !0), Object.keys(i).length && (r.submitMessages = i), t) for (let [e, n] of Object.entries(t)) n == null || n === "" || e in r || zx.has(e) || (r[e] = n);
22849
+ let i = String(n.historyField ?? "").split(",").map((e) => e.trim()).filter(Boolean).filter((e, t, n) => n.indexOf(e) === t);
22850
+ n.appendHistory && i.length && (r.appendHistory = !0, r.historyField = i[0], i.length > 1 && (r.historyFields = i.slice(1)), String(n.historyTimestampField ?? "").trim() && (r.historyTimestampField = n.historyTimestampField.trim())), n.addRow && n.minRows !== void 0 && n.minRows !== "" && (r.minRows = Number(n.minRows)), n.addRow && n.initialRows !== void 0 && n.initialRows !== "" && (r.initialRows = Number(n.initialRows)), n.addRow && n.maxRows !== void 0 && n.maxRows !== "" && (r.maxRows = Number(n.maxRows)), n.addRow && String(n.requireValidatedField ?? "").trim() && (r.requireValidatedField = n.requireValidatedField.trim()), n.addRow && n.requireOne && (r.requireOne = !0), n.addRow && n.linkGroup && (r.linkGroup = n.linkGroup.trim()), n.infoEnabled && n.infoText && (r.infoEnabled = !0, r.infoText = n.infoText), n.toggleEnabled && n.toggleField && (r.toggleEnabled = !0, r.toggleLabel = n.toggleLabel || "Toggle", r.toggleField = n.toggleField), n.afterSubmitMode && (r.afterSubmit = { mode: n.afterSubmitMode }, (n.afterSubmitMode === "route" || n.afterSubmitMode === "detail") && (r.afterSubmit.target = (n.afterSubmitTarget || "").trim()));
22851
+ let a = {};
22852
+ if ((n.submitMsgAddSuccess || "").trim() && (a.addSuccess = n.submitMsgAddSuccess.trim()), (n.submitMsgEditSuccess || "").trim() && (a.editSuccess = n.submitMsgEditSuccess.trim()), (n.submitMsgAddError || "").trim() && (a.addError = n.submitMsgAddError.trim()), (n.submitMsgEditError || "").trim() && (a.editError = n.submitMsgEditError.trim()), n.submitMsgSuppress && (a.suppress = !0), Object.keys(a).length && (r.submitMessages = a), t) for (let [e, n] of Object.entries(t)) n == null || n === "" || e in r || zx.has(e) || (r[e] = n);
22852
22853
  s ? (await s(r, t), Y.success(t ? "Group updated" : "Group created")) : t ? (await sa(t.id, r), Y.success("Group updated")) : (await oa(r), Y.success("Group created")), S(/* @__PURE__ */ new Set()), w("settings"), E(!1), o();
22853
22854
  } catch (e) {
22854
22855
  if (e?.errorFields) return;
@@ -23128,12 +23129,12 @@ function Hx({ open: e, editingGroup: t, defaultModule: n, moduleOptions: r, allG
23128
23129
  required: !0,
23129
23130
  message: "Required"
23130
23131
  }],
23131
- tooltip: "The record key holding the array — usually the shared prefix this group's own fields already write through (e.g. this group's fields are proposedRate.candidateProposedRate, array field is proposedRate).",
23132
+ tooltip: "The record key(s) holding the append-only array(s) — usually the prefix(es) this group's own fields already write through. Comma-separate to keep an independent history per prefix, e.g. candidateBudget, proposedRate, referralRate.",
23132
23133
  style: { marginBottom: 0 },
23133
23134
  children: /* @__PURE__ */ Z(V, {
23134
23135
  size: "small",
23135
- placeholder: "e.g. proposedRate",
23136
- style: { width: 200 },
23136
+ placeholder: "e.g. proposedRate, candidateBudget",
23137
+ style: { width: 240 },
23137
23138
  className: "fg-mono-input"
23138
23139
  })
23139
23140
  }), /* @__PURE__ */ Z(B.Item, {
@@ -26084,30 +26085,37 @@ function gS() {
26084
26085
  function oe(e) {
26085
26086
  I(Qx[e]);
26086
26087
  }
26087
- async function B(e, t) {
26088
- let n = o;
26089
- s((n) => n.map((n) => n.id === e.id ? {
26088
+ async function B(e, t, n, r) {
26089
+ let i = o;
26090
+ s((r) => r.map((r) => r.id === e.id ? {
26091
+ ...r,
26092
+ [t]: n
26093
+ } : r)), R((n) => ({
26090
26094
  ...n,
26091
- hideGroup: t
26092
- } : n)), R((t) => ({
26093
- ...t,
26094
- [e.id]: !0
26095
+ [`${e.id}:${t}`]: !0
26095
26096
  }));
26096
26097
  try {
26097
26098
  await sa(e.id, {
26098
26099
  ...e,
26099
- hideGroup: t
26100
- }), Y.success(t ? "Group hidden from add/edit forms and the detail view" : "Group is visible again");
26100
+ [t]: n
26101
+ }), Y.success(n ? r.on : r.off);
26101
26102
  } catch (e) {
26102
- s(n), Y.error(e?.message || "Could not update group visibility");
26103
+ s(i), Y.error(e?.message || "Could not update group visibility");
26103
26104
  } finally {
26104
- R((t) => {
26105
- let n = { ...t };
26106
- return delete n[e.id], n;
26105
+ R((n) => {
26106
+ let r = { ...n };
26107
+ return delete r[`${e.id}:${t}`], r;
26107
26108
  });
26108
26109
  }
26109
26110
  }
26110
- function se() {
26111
+ let se = (e, t) => B(e, "hideGroup", t, {
26112
+ on: "Group hidden from add/edit forms and the detail view",
26113
+ off: "Group is visible again"
26114
+ }), ce = (e, t) => B(e, "hideGroupInDetail", t, {
26115
+ on: "Group hidden from the detail view only — add/edit forms keep it",
26116
+ off: "Group is visible in the detail view again"
26117
+ });
26118
+ function le() {
26111
26119
  I(null), L((e) => e + 1);
26112
26120
  }
26113
26121
  D(() => {
@@ -26143,11 +26151,11 @@ function gS() {
26143
26151
  e = !0;
26144
26152
  };
26145
26153
  }, [i, te]);
26146
- let ce = O(() => c.map((e) => ({
26154
+ let ue = O(() => c.map((e) => ({
26147
26155
  value: e.key,
26148
26156
  label: `${e.label} (${e.key})`
26149
26157
  })), [c]);
26150
- async function le() {
26158
+ async function H() {
26151
26159
  x(!0);
26152
26160
  try {
26153
26161
  let e = Object.entries(f).map(([e, t]) => iS(e, t)).filter(Boolean), { nextGroups: t, changed: n } = sS(o, f);
@@ -26165,7 +26173,7 @@ function gS() {
26165
26173
  x(!1);
26166
26174
  }
26167
26175
  }
26168
- function ue(e) {
26176
+ function de(e) {
26169
26177
  p((t) => ({
26170
26178
  ...t,
26171
26179
  [S.key]: {
@@ -26174,19 +26182,19 @@ function gS() {
26174
26182
  }
26175
26183
  })), C(null);
26176
26184
  }
26177
- function H(e) {
26185
+ function fe(e) {
26178
26186
  p((t) => {
26179
26187
  let n = { ...t };
26180
26188
  return delete n[e], n;
26181
26189
  });
26182
26190
  }
26183
- function de(e) {
26191
+ function pe(e) {
26184
26192
  h((t) => {
26185
26193
  let n = [...t];
26186
26194
  return w.index === null ? n.push(e) : n[w.index] = e, n;
26187
26195
  }), T(null);
26188
26196
  }
26189
- function fe(e, t) {
26197
+ function me(e, t) {
26190
26198
  p((n) => {
26191
26199
  let r = n[e] ?? { field: e };
26192
26200
  return {
@@ -26198,7 +26206,7 @@ function gS() {
26198
26206
  };
26199
26207
  });
26200
26208
  }
26201
- let pe = (e) => {
26209
+ let he = (e) => {
26202
26210
  if (!e) return null;
26203
26211
  let t = [];
26204
26212
  e.label && t.push(/* @__PURE__ */ Z(q, {
@@ -26229,7 +26237,7 @@ function gS() {
26229
26237
  style: { fontSize: 12 },
26230
26238
  children: "—"
26231
26239
  });
26232
- }, me = [
26240
+ }, ge = [
26233
26241
  {
26234
26242
  title: "Group",
26235
26243
  dataIndex: "label",
@@ -26302,12 +26310,29 @@ function gS() {
26302
26310
  checkedChildren: "Hide",
26303
26311
  unCheckedChildren: "Show",
26304
26312
  checked: nS(t.hideGroup),
26305
- loading: !!ie[t.id],
26306
- onChange: (e) => B(t, e)
26313
+ loading: !!ie[`${t.id}:hideGroup`],
26314
+ onChange: (e) => se(t, e)
26315
+ })
26316
+ })
26317
+ },
26318
+ {
26319
+ title: "Hide in Detail",
26320
+ key: "hideGroupInDetail",
26321
+ width: 120,
26322
+ align: "center",
26323
+ render: (e, t) => /* @__PURE__ */ Z(J, {
26324
+ title: nS(t.hideGroupInDetail) ? "Hidden from the DETAIL VIEW only — the add/edit forms still show this group" : "Shown in the detail view. Hide here to remove it from the detail view without touching the forms",
26325
+ children: /* @__PURE__ */ Z(K, {
26326
+ size: "small",
26327
+ checkedChildren: "Hide",
26328
+ unCheckedChildren: "Show",
26329
+ checked: nS(t.hideGroupInDetail),
26330
+ loading: !!ie[`${t.id}:hideGroupInDetail`],
26331
+ onChange: (e) => ce(t, e)
26307
26332
  })
26308
26333
  })
26309
26334
  }
26310
- ], he = (e) => {
26335
+ ], U = (e) => {
26311
26336
  let t = e.fields ?? [];
26312
26337
  return t.length ? /* @__PURE__ */ Z("div", {
26313
26338
  className: "fg-expanded-fields",
@@ -26350,7 +26375,7 @@ function gS() {
26350
26375
  }),
26351
26376
  /* @__PURE__ */ Z("div", {
26352
26377
  className: "fg-field-row-flags",
26353
- children: pe(n)
26378
+ children: he(n)
26354
26379
  }),
26355
26380
  /* @__PURE__ */ Q(G, {
26356
26381
  size: 4,
@@ -26363,7 +26388,7 @@ function gS() {
26363
26388
  checkedChildren: "Hide",
26364
26389
  unCheckedChildren: "Show",
26365
26390
  checked: r,
26366
- onChange: (e) => fe(t.field, e)
26391
+ onChange: (e) => me(t.field, e)
26367
26392
  })
26368
26393
  }),
26369
26394
  /* @__PURE__ */ Z(J, {
@@ -26382,7 +26407,7 @@ function gS() {
26382
26407
  size: "small",
26383
26408
  danger: !0,
26384
26409
  icon: /* @__PURE__ */ Z(At, {}),
26385
- onClick: () => H(t.field)
26410
+ onClick: () => fe(t.field)
26386
26411
  })
26387
26412
  })
26388
26413
  ]
@@ -26395,7 +26420,7 @@ function gS() {
26395
26420
  style: { fontSize: 12 },
26396
26421
  children: "No fields in this group."
26397
26422
  });
26398
- }, ge = O(() => {
26423
+ }, W = O(() => {
26399
26424
  let e = ne.trim().toLowerCase();
26400
26425
  return [...o].filter((t) => !e || [
26401
26426
  t.label,
@@ -26406,7 +26431,7 @@ function gS() {
26406
26431
  e.type
26407
26432
  ])
26408
26433
  ].some((t) => String(t ?? "").toLowerCase().includes(e))).sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
26409
- }, [o, ne]), U = [
26434
+ }, [o, ne]), ve = [
26410
26435
  {
26411
26436
  title: "Label",
26412
26437
  dataIndex: "label",
@@ -26468,7 +26493,7 @@ function gS() {
26468
26493
  })]
26469
26494
  })
26470
26495
  }
26471
- ], W = e.map((e) => ({
26496
+ ], ye = e.map((e) => ({
26472
26497
  key: e.key,
26473
26498
  label: e.label
26474
26499
  }));
@@ -26531,7 +26556,7 @@ function gS() {
26531
26556
  icon: /* @__PURE__ */ Z(Pt, {}),
26532
26557
  loading: b,
26533
26558
  disabled: !i,
26534
- onClick: le,
26559
+ onClick: H,
26535
26560
  children: "Save Configuration"
26536
26561
  })
26537
26562
  ]
@@ -26539,7 +26564,7 @@ function gS() {
26539
26564
  children: [/* @__PURE__ */ Z("div", { className: "admin-accent-bar" }), /* @__PURE__ */ Z(qx, {
26540
26565
  type: "secondary",
26541
26566
  style: { fontSize: 13 },
26542
- children: "Customize how each module's detail view renders: per-field label, prefix/suffix, colour, capitalization, hide, reference lookups (id → name), and merged display fields. These overrides are applied on top of Form Groups and the add/edit forms are unaffected — except \"Hide Group\", which is the same flag Form Groups uses, so hiding a group here (or there) hides it in both places."
26567
+ children: "Customize how each module's detail view renders: per-field label, prefix/suffix, colour, capitalization, hide, reference lookups (id → name), and merged display fields. These overrides are applied on top of Form Groups and the add/edit forms are unaffected — except \"Hide Group\", which is the same flag Form Groups uses, so hiding a group here (or there) hides it in both places. \"Hide in Detail\" hides the group from the detail view only, leaving the forms untouched."
26543
26568
  })]
26544
26569
  }),
26545
26570
  /* @__PURE__ */ Z(zb, {
@@ -26550,7 +26575,7 @@ function gS() {
26550
26575
  /* @__PURE__ */ Z(xe, {
26551
26576
  activeKey: i,
26552
26577
  onChange: a,
26553
- items: W.map((e) => ({
26578
+ items: ye.map((e) => ({
26554
26579
  ...e,
26555
26580
  children: null
26556
26581
  })),
@@ -26586,13 +26611,13 @@ function gS() {
26586
26611
  }),
26587
26612
  /* @__PURE__ */ Z(be, {
26588
26613
  rowKey: (e) => e.id ?? e.name,
26589
- dataSource: ge,
26590
- columns: me,
26614
+ dataSource: W,
26615
+ columns: ge,
26591
26616
  pagination: !1,
26592
26617
  size: "small",
26593
26618
  className: "fg-table",
26594
26619
  expandable: {
26595
- expandedRowRender: he,
26620
+ expandedRowRender: U,
26596
26621
  rowExpandable: () => !0
26597
26622
  },
26598
26623
  locale: { emptyText: /* @__PURE__ */ Z(z, {
@@ -26625,7 +26650,7 @@ function gS() {
26625
26650
  /* @__PURE__ */ Z(be, {
26626
26651
  rowKey: "key",
26627
26652
  dataSource: m,
26628
- columns: U,
26653
+ columns: ve,
26629
26654
  pagination: !1,
26630
26655
  size: "small",
26631
26656
  className: "fg-table",
@@ -26647,15 +26672,15 @@ function gS() {
26647
26672
  ...f[S.key] ?? {}
26648
26673
  } : null,
26649
26674
  onClose: () => C(null),
26650
- onSave: ue
26675
+ onSave: de
26651
26676
  }, S?.key ?? "field-closed"),
26652
26677
  /* @__PURE__ */ Z(fS, {
26653
26678
  open: !!w,
26654
26679
  merge: w?.merge,
26655
- fieldOptions: ce,
26680
+ fieldOptions: ue,
26656
26681
  groupOptions: u,
26657
26682
  onClose: () => T(null),
26658
- onSave: de
26683
+ onSave: pe
26659
26684
  }, w ? `merge-${w.index ?? "new"}` : "merge-closed"),
26660
26685
  /* @__PURE__ */ Z(hS, {
26661
26686
  open: M,
@@ -26675,7 +26700,7 @@ function gS() {
26675
26700
  confirmLabel: P?.confirmLabel,
26676
26701
  danger: P?.danger,
26677
26702
  onCancel: () => I(null),
26678
- onVerified: se
26703
+ onVerified: le
26679
26704
  })
26680
26705
  ]
26681
26706
  });