@juicemantics/veloiq-ui 0.2.1 → 0.2.2

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/index.mjs CHANGED
@@ -7711,6 +7711,7 @@ var renderInput = (field, allModels, model, currentId) => {
7711
7711
  };
7712
7712
  var _23 = window._ || ((text) => text);
7713
7713
  var { Title: Title2 } = Typography;
7714
+ var requiredMark = (field) => field.required ? /* @__PURE__ */ jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
7714
7715
  var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedValues }) => {
7715
7716
  const model = useRoleFilteredModel(modelProp);
7716
7717
  applyI18nLabelsToModel(model);
@@ -7966,7 +7967,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
7966
7967
  return /* @__PURE__ */ jsx(Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: renderInput(field, allModels, model) }, `${field.key}-${index}`);
7967
7968
  }
7968
7969
  return /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: showLabel ? "200px 1fr" : "1fr", alignItems: "start", columnGap: 6 }, children: [
7969
- showLabel && /* @__PURE__ */ jsx("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: field.label }),
7970
+ showLabel && /* @__PURE__ */ jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
7971
+ field.label,
7972
+ requiredMark(field)
7973
+ ] }),
7970
7974
  /* @__PURE__ */ jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, background: valueBackground, borderRadius: 6, border: `1px solid ${token.colorBorder}`, maxWidth: "100%", overflowWrap: "anywhere", ...parseInlineStyle(item.html_format) }, children: /* @__PURE__ */ jsx(
7971
7975
  Form.Item,
7972
7976
  {
@@ -8035,7 +8039,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
8035
8039
  ...parseInlineStyle(item.html_format)
8036
8040
  };
8037
8041
  return /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: showLabel ? "200px 1fr" : "1fr", alignItems: "start", columnGap: 6 }, children: [
8038
- showLabel && /* @__PURE__ */ jsx("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: field.label }),
8042
+ showLabel && /* @__PURE__ */ jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
8043
+ field.label,
8044
+ requiredMark(field)
8045
+ ] }),
8039
8046
  /* @__PURE__ */ jsx("div", { style: readonlyValueStyle, children: renderFieldValue(field, createdRecord, allModels) })
8040
8047
  ] }) }, `${field.key}-${index}`);
8041
8048
  };
@@ -8064,7 +8071,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
8064
8071
  return /* @__PURE__ */ jsx(Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: renderInput(field, allModels, model) }, field.key);
8065
8072
  }
8066
8073
  return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
8067
- /* @__PURE__ */ jsx("span", { style: labelStyle, children: field.label }),
8074
+ /* @__PURE__ */ jsxs("span", { style: labelStyle, children: [
8075
+ field.label,
8076
+ requiredMark(field)
8077
+ ] }),
8068
8078
  /* @__PURE__ */ jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, maxWidth: "100%", overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsx(Form.Item, { name: field.key, rules: field.required ? [{ required: true }] : [], valuePropName: field.type === "boolean" ? "checked" : void 0, getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8(val) } : field.type === "time" && val ? { value: dayjs8("1970-01-01T" + val) } : { value: val }, style: { margin: 0 }, children: renderInput(field, allModels, model) }) })
8069
8079
  ] }, field.key);
8070
8080
  }) }) })
@@ -8199,7 +8209,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
8199
8209
  return /* @__PURE__ */ jsx(Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: isOtherKey && field.reference && hasReferenceModel(field.reference, allModels) ? /* @__PURE__ */ jsx(RelationSelect, { field, allModels, multiple: true }) : renderInput(field, allModels, model) }, field.key);
8200
8210
  }
8201
8211
  return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
8202
- /* @__PURE__ */ jsx("span", { style: labelStyle, children: field.label }),
8212
+ /* @__PURE__ */ jsxs("span", { style: labelStyle, children: [
8213
+ field.label,
8214
+ requiredMark(field)
8215
+ ] }),
8203
8216
  /* @__PURE__ */ jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, maxWidth: "100%", overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsx(Form.Item, { name: field.key, rules: field.required ? [{ required: true }] : [], style: { margin: 0 }, children: isOtherKey && field.reference && hasReferenceModel(field.reference, allModels) ? /* @__PURE__ */ jsx(RelationSelect, { field, allModels, multiple: true }) : renderInput(field, allModels, model) }) })
8204
8217
  ] }, field.key);
8205
8218
  }) })
@@ -8295,6 +8308,7 @@ var NLSentenceBlock = ({ eid, title: titleProp, showLabel }) => {
8295
8308
  };
8296
8309
  var _24 = window._ || ((text) => text);
8297
8310
  var { Title: Title3 } = Typography;
8311
+ var requiredMark2 = (field) => field.required ? /* @__PURE__ */ jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
8298
8312
  var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons, journeyCallbacks, idOverride }) => {
8299
8313
  const model = useRoleFilteredModel(modelProp);
8300
8314
  applyI18nLabelsToModel(model);
@@ -8617,7 +8631,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
8617
8631
  gap: "4px 6px"
8618
8632
  },
8619
8633
  children: [
8620
- /* @__PURE__ */ jsx("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: field.label }),
8634
+ /* @__PURE__ */ jsxs("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: [
8635
+ field.label,
8636
+ requiredMark2(field)
8637
+ ] }),
8621
8638
  /* @__PURE__ */ jsx("div", { style: { flex: "1 0 200px", padding: "2px 4px", lineHeight: 1.15, overflowWrap: "anywhere", background: valueBackground, borderRadius: 6 }, children: /* @__PURE__ */ jsx(
8622
8639
  Form.Item,
8623
8640
  {
@@ -8762,7 +8779,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
8762
8779
  gap: 2
8763
8780
  },
8764
8781
  children: [
8765
- showLabel && /* @__PURE__ */ jsx(
8782
+ showLabel && /* @__PURE__ */ jsxs(
8766
8783
  "div",
8767
8784
  {
8768
8785
  style: {
@@ -8771,7 +8788,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
8771
8788
  padding: "2px 4px",
8772
8789
  borderRadius: 4
8773
8790
  },
8774
- children: field.label
8791
+ children: [
8792
+ field.label,
8793
+ requiredMark2(field)
8794
+ ]
8775
8795
  }
8776
8796
  ),
8777
8797
  /* @__PURE__ */ jsx("div", { style: readonlyValueStyle, children: renderFieldValue(field, record, allModels) })
@@ -8788,7 +8808,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
8788
8808
  gap: 2
8789
8809
  },
8790
8810
  children: [
8791
- showLabel && /* @__PURE__ */ jsx(
8811
+ showLabel && /* @__PURE__ */ jsxs(
8792
8812
  "div",
8793
8813
  {
8794
8814
  style: {
@@ -8797,7 +8817,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
8797
8817
  padding: "2px 4px",
8798
8818
  borderRadius: 4
8799
8819
  },
8800
- children: field.label
8820
+ children: [
8821
+ field.label,
8822
+ requiredMark2(field)
8823
+ ]
8801
8824
  }
8802
8825
  ),
8803
8826
  /* @__PURE__ */ jsx("div", { style: {
@@ -8922,7 +8945,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
8922
8945
  const showLabel = item.show_label !== false;
8923
8946
  const editable = isAttributeValueEditable(item, "edit");
8924
8947
  return /* @__PURE__ */ jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
8925
- showLabel && /* @__PURE__ */ jsx("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: field.label }),
8948
+ showLabel && /* @__PURE__ */ jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
8949
+ field.label,
8950
+ requiredMark2(field)
8951
+ ] }),
8926
8952
  /* @__PURE__ */ jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, background: valueBackground, borderRadius: 6, border: `1px solid ${token.colorBorder}`, maxWidth: "100%", overflowWrap: "anywhere", ...parseInlineStyle(item.html_format) }, children: editable ? /* @__PURE__ */ jsx(
8927
8953
  Form.Item,
8928
8954
  {
@@ -9072,6 +9098,7 @@ var ReadAndEditReference = ({ value, onChange, field, allModels, model, currentI
9072
9098
  };
9073
9099
  var _26 = window._ || ((text) => text);
9074
9100
  var { Title: Title4 } = Typography;
9101
+ var requiredMark3 = (field) => field.required ? /* @__PURE__ */ jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
9075
9102
  function coerce(v) {
9076
9103
  if (v && typeof v === "object" && typeof v.valueOf === "function") return v.valueOf();
9077
9104
  return v;
@@ -9223,7 +9250,10 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
9223
9250
  gap: "4px 6px"
9224
9251
  },
9225
9252
  children: [
9226
- /* @__PURE__ */ jsx("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: field.label }),
9253
+ /* @__PURE__ */ jsxs("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: [
9254
+ field.label,
9255
+ requiredMark3(field)
9256
+ ] }),
9227
9257
  /* @__PURE__ */ jsx(
9228
9258
  "div",
9229
9259
  {
@@ -9361,7 +9391,7 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
9361
9391
  gap: 2
9362
9392
  },
9363
9393
  children: [
9364
- showLabel && /* @__PURE__ */ jsx(
9394
+ showLabel && /* @__PURE__ */ jsxs(
9365
9395
  "div",
9366
9396
  {
9367
9397
  style: {
@@ -9370,7 +9400,10 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
9370
9400
  padding: "2px 4px",
9371
9401
  borderRadius: 4
9372
9402
  },
9373
- children: field.label
9403
+ children: [
9404
+ field.label,
9405
+ requiredMark3(field)
9406
+ ]
9374
9407
  }
9375
9408
  ),
9376
9409
  /* @__PURE__ */ jsx("div", { style: { ...valueStyle, border: `1px solid ${token.colorBorder}` }, children: editable || forceReadOnly ? renderShowEditableInput(field, forceReadOnly) : renderFieldValue(field, record, allModels) })