@realtek/core-theme 0.0.123 → 0.0.124

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
@@ -2287,6 +2287,10 @@ var Fi = "/admin/field-config", Ii = [
2287
2287
  {
2288
2288
  key: "submissions",
2289
2289
  apiModule: "submissions"
2290
+ },
2291
+ {
2292
+ key: "onboarding",
2293
+ apiModule: "onboarding"
2290
2294
  }
2291
2295
  ];
2292
2296
  function Li(...e) {
@@ -2369,6 +2373,11 @@ function Bi(e, t) {
2369
2373
  ...e.lookup,
2370
2374
  projectFields: Array.isArray(e.lookup.projectFields) ? e.lookup.projectFields : []
2371
2375
  } : null,
2376
+ derived: e.derived ?? null,
2377
+ computed: e.computed ? {
2378
+ ...e.computed,
2379
+ operands: Array.isArray(e.computed.operands) ? e.computed.operands : []
2380
+ } : null,
2372
2381
  actionButtons: Array.isArray(e.actionButtons) ? e.actionButtons : [],
2373
2382
  renderType: e.renderType ?? "",
2374
2383
  renderConfig: e.renderConfig ?? null,
@@ -2652,6 +2661,8 @@ function wa(e, t) {
2652
2661
  secondarySeparator: e.secondarySeparator ?? "",
2653
2662
  lookup: e.lookup ?? null,
2654
2663
  actionButtons: e.actionButtons ?? [],
2664
+ derived: e.derived ?? null,
2665
+ computed: e.computed ?? null,
2655
2666
  renderType: e.renderType ?? "",
2656
2667
  renderConfig: e.renderConfig ?? null,
2657
2668
  valueStyles: Array.isArray(e.valueStyles) ? e.valueStyles : [],
@@ -17045,56 +17056,194 @@ function Hy({ field: e, collections: t, collFields: n, subfields: r, onCollectio
17045
17056
  })]
17046
17057
  }), e.lookup && /* @__PURE__ */ Z("div", {
17047
17058
  className: "uss-lookup-grid",
17048
- children: [/* @__PURE__ */ Z("div", {
17049
- className: "uss-lookup-row",
17050
- children: [/* @__PURE__ */ X("span", {
17051
- className: "uss-lookup-label",
17052
- children: "Collection"
17053
- }), /* @__PURE__ */ X(U, {
17054
- size: "small",
17055
- value: e.lookup?.collection ?? "",
17056
- onChange: i,
17057
- showSearch: !0,
17058
- placeholder: "Select collection",
17059
- style: { flex: 1 },
17060
- children: t.map((e) => /* @__PURE__ */ X(Py, {
17061
- value: e,
17062
- children: e
17063
- }, e))
17064
- })]
17065
- }), n.length > 0 && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ Z("div", {
17066
- className: "uss-lookup-row",
17067
- children: [/* @__PURE__ */ X("span", {
17068
- className: "uss-lookup-label",
17069
- children: "Value Field"
17070
- }), /* @__PURE__ */ X(U, {
17071
- size: "small",
17072
- value: e.lookup?.valueField ?? "",
17073
- onChange: (t) => a(e.fieldKey, { valueField: t }),
17074
- placeholder: "ID field",
17075
- style: { flex: 1 },
17076
- children: n.map((e) => /* @__PURE__ */ X(Py, {
17077
- value: e,
17078
- children: e
17079
- }, e))
17080
- })]
17081
- }), /* @__PURE__ */ Z("div", {
17059
+ children: [
17060
+ /* @__PURE__ */ Z("div", {
17061
+ className: "uss-lookup-row",
17062
+ children: [/* @__PURE__ */ X("span", {
17063
+ className: "uss-lookup-label",
17064
+ children: "Collection"
17065
+ }), /* @__PURE__ */ X(U, {
17066
+ size: "small",
17067
+ value: e.lookup?.collection ?? "",
17068
+ onChange: i,
17069
+ showSearch: !0,
17070
+ placeholder: "Select collection",
17071
+ style: { flex: 1 },
17072
+ children: t.map((e) => /* @__PURE__ */ X(Py, {
17073
+ value: e,
17074
+ children: e
17075
+ }, e))
17076
+ })]
17077
+ }),
17078
+ /* @__PURE__ */ Z("div", {
17079
+ className: "uss-lookup-row",
17080
+ children: [/* @__PURE__ */ X("span", {
17081
+ className: "uss-lookup-label",
17082
+ children: "Tenant scoped"
17083
+ }), /* @__PURE__ */ X(G, {
17084
+ size: "small",
17085
+ checked: !!e.lookup?.tenantScoped,
17086
+ onChange: (t) => a(e.fieldKey, { tenantScoped: t })
17087
+ })]
17088
+ }),
17089
+ n.length > 0 && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ Z("div", {
17090
+ className: "uss-lookup-row",
17091
+ children: [/* @__PURE__ */ X("span", {
17092
+ className: "uss-lookup-label",
17093
+ children: "Value Field"
17094
+ }), /* @__PURE__ */ X(U, {
17095
+ size: "small",
17096
+ value: e.lookup?.valueField ?? "",
17097
+ onChange: (t) => a(e.fieldKey, { valueField: t }),
17098
+ placeholder: "ID field",
17099
+ style: { flex: 1 },
17100
+ children: n.map((e) => /* @__PURE__ */ X(Py, {
17101
+ value: e,
17102
+ children: e
17103
+ }, e))
17104
+ })]
17105
+ }), /* @__PURE__ */ Z("div", {
17106
+ className: "uss-lookup-row",
17107
+ children: [/* @__PURE__ */ X("span", {
17108
+ className: "uss-lookup-label",
17109
+ children: "Display Field"
17110
+ }), /* @__PURE__ */ X(U, {
17111
+ size: "small",
17112
+ value: e.lookup?.displayField ?? "",
17113
+ onChange: (t) => a(e.fieldKey, { displayField: t }),
17114
+ placeholder: "Label field",
17115
+ style: { flex: 1 },
17116
+ children: [...n, ...r].map((e) => /* @__PURE__ */ X(Py, {
17117
+ value: e,
17118
+ children: e
17119
+ }, e))
17120
+ })]
17121
+ })] })
17122
+ ]
17123
+ })]
17124
+ }),
17125
+ /* @__PURE__ */ Z("div", {
17126
+ className: "uss-detail-section",
17127
+ children: [/* @__PURE__ */ Z("div", {
17128
+ className: "uss-detail-label",
17129
+ children: ["Derived Array Value", /* @__PURE__ */ X(G, {
17130
+ size: "small",
17131
+ style: { marginLeft: 8 },
17132
+ checked: !!e.derived,
17133
+ onChange: (e) => p({ derived: e ? {
17134
+ type: "arrayField",
17135
+ source: "",
17136
+ matchField: "",
17137
+ matchValue: "",
17138
+ valueField: "",
17139
+ default: null
17140
+ } : null })
17141
+ })]
17142
+ }), e.derived && /* @__PURE__ */ X("div", {
17143
+ className: "uss-lookup-grid",
17144
+ children: [
17145
+ [
17146
+ "Source array",
17147
+ "source",
17148
+ "e.g. stages"
17149
+ ],
17150
+ [
17151
+ "Match field",
17152
+ "matchField",
17153
+ "e.g. stageCode"
17154
+ ],
17155
+ [
17156
+ "Match value",
17157
+ "matchValue",
17158
+ "e.g. PO_MSA"
17159
+ ],
17160
+ [
17161
+ "Value field",
17162
+ "valueField",
17163
+ "e.g. status"
17164
+ ]
17165
+ ].map(([t, n, r]) => /* @__PURE__ */ Z("div", {
17082
17166
  className: "uss-lookup-row",
17083
17167
  children: [/* @__PURE__ */ X("span", {
17084
17168
  className: "uss-lookup-label",
17085
- children: "Display Field"
17086
- }), /* @__PURE__ */ X(U, {
17169
+ children: t
17170
+ }), /* @__PURE__ */ X(B, {
17087
17171
  size: "small",
17088
- value: e.lookup?.displayField ?? "",
17089
- onChange: (t) => a(e.fieldKey, { displayField: t }),
17090
- placeholder: "Label field",
17091
- style: { flex: 1 },
17092
- children: [...n, ...r].map((e) => /* @__PURE__ */ X(Py, {
17093
- value: e,
17094
- children: e
17095
- }, e))
17172
+ value: e.derived?.[n] ?? "",
17173
+ placeholder: r,
17174
+ onChange: (t) => p({ derived: {
17175
+ ...e.derived,
17176
+ [n]: t.target.value
17177
+ } })
17096
17178
  })]
17097
- })] })]
17179
+ }, n))
17180
+ })]
17181
+ }),
17182
+ /* @__PURE__ */ Z("div", {
17183
+ className: "uss-detail-section",
17184
+ children: [/* @__PURE__ */ Z("div", {
17185
+ className: "uss-detail-label",
17186
+ children: ["Computed Value", /* @__PURE__ */ X(G, {
17187
+ size: "small",
17188
+ style: { marginLeft: 8 },
17189
+ checked: !!e.computed,
17190
+ onChange: (e) => p({ computed: e ? {
17191
+ operator: "subtract",
17192
+ operands: [],
17193
+ default: 0
17194
+ } : null })
17195
+ })]
17196
+ }), e.computed && /* @__PURE__ */ Z("div", {
17197
+ className: "uss-lookup-grid",
17198
+ children: [
17199
+ /* @__PURE__ */ Z("div", {
17200
+ className: "uss-lookup-row",
17201
+ children: [/* @__PURE__ */ X("span", {
17202
+ className: "uss-lookup-label",
17203
+ children: "Operator"
17204
+ }), /* @__PURE__ */ X(U, {
17205
+ size: "small",
17206
+ value: e.computed?.operator ?? "subtract",
17207
+ style: { flex: 1 },
17208
+ options: [
17209
+ "add",
17210
+ "subtract",
17211
+ "multiply",
17212
+ "divide",
17213
+ "percentage",
17214
+ "ifNull"
17215
+ ].map((e) => ({
17216
+ value: e,
17217
+ label: e
17218
+ })),
17219
+ onChange: (t) => p({ computed: {
17220
+ ...e.computed,
17221
+ operator: t
17222
+ } })
17223
+ })]
17224
+ }),
17225
+ /* @__PURE__ */ X(Ny, {
17226
+ style: { fontSize: 11 },
17227
+ children: "Operands JSON (field or value entries)"
17228
+ }),
17229
+ /* @__PURE__ */ X(B.TextArea, {
17230
+ rows: 3,
17231
+ defaultValue: JSON.stringify(e.computed?.operands ?? [], null, 2),
17232
+ placeholder: "[{\"field\":\"billRate\"},{\"field\":\"payRate\"}]",
17233
+ onBlur: (t) => {
17234
+ try {
17235
+ let n = JSON.parse(t.target.value || "[]");
17236
+ if (!Array.isArray(n)) throw Error("Operands must be an array");
17237
+ p({ computed: {
17238
+ ...e.computed,
17239
+ operands: n
17240
+ } });
17241
+ } catch (e) {
17242
+ J.error(e.message || "Invalid operands JSON");
17243
+ }
17244
+ }
17245
+ }, JSON.stringify(e.computed?.operands ?? []))
17246
+ ]
17098
17247
  })]
17099
17248
  }),
17100
17249
  /* @__PURE__ */ Z("div", {