@stemy/ngx-dynamic-form 19.8.17 → 19.8.18

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.
@@ -666,7 +666,7 @@ class DynamicFormBuilderService {
666
666
  fieldGroup,
667
667
  wrappers: ["form-fieldset"],
668
668
  props: {
669
- label: this.getLabel(fsName, null, parent, options, "title"),
669
+ label: this.getLabel(fsName, set?.label, set?.labelPrefix, parent, options, "title"),
670
670
  hidden: false,
671
671
  classes: set?.classes,
672
672
  layout: set?.layout,
@@ -687,7 +687,7 @@ class DynamicFormBuilderService {
687
687
  field.id = !parent?.path ? fsName : `${parent.path}.${fsName}`;
688
688
  field.wrappers = ["form-fieldset"];
689
689
  field.props = {
690
- label: this.getLabel(fsName, null, parent, options, "title"),
690
+ label: this.getLabel(fsName, set?.label, set?.labelPrefix, parent, options, "title"),
691
691
  hidden: false,
692
692
  classes: set?.classes,
693
693
  layout: set?.layout,
@@ -915,9 +915,9 @@ class DynamicFormBuilderService {
915
915
  isFieldset(field) {
916
916
  return Array.isArray(field.fieldGroup) && Array.isArray(field.wrappers) && field.wrappers[0] === "form-fieldset";
917
917
  }
918
- getLabel(key, label, parent, options, legacyPrefix = "") {
918
+ getLabel(key, label, labelPrefix, parent, options, legacyPrefix = "") {
919
919
  options = options || { labelPrefix: "" };
920
- const labelPrefix = !ObjectUtils.isString(options.labelPrefix) ? `` : options.labelPrefix;
920
+ labelPrefix = labelPrefix || (!ObjectUtils.isString(options.labelPrefix) ? `` : options.labelPrefix);
921
921
  if (ObjectUtils.isFunction(options.labelCustomizer)) {
922
922
  const customLabel = options.labelCustomizer(key, label, parent, labelPrefix);
923
923
  if (ObjectUtils.isString(customLabel))
@@ -943,9 +943,11 @@ class DynamicFormBuilderService {
943
943
  }
944
944
  const disabled = ReflectUtils.resolve(data.disabled, this.injector);
945
945
  const hidden = ReflectUtils.resolve(data.hidden, this.injector);
946
+ const prefix = String(data.labelPrefix || parent?.labelPrefix || "");
946
947
  const field = {
947
948
  ...this.createFormSerializer(key, data),
948
949
  fieldSet: String(data.fieldSet || ""),
950
+ labelPrefix: prefix,
949
951
  controlTemplateKey: String(data.controlTemplateKey || ""),
950
952
  labelTemplateKey: String(data.labelTemplateKey || ""),
951
953
  inputTemplateKey: String(data.inputTemplateKey || ""),
@@ -961,7 +963,7 @@ class DynamicFormBuilderService {
961
963
  props: {
962
964
  ...(data.props || {}),
963
965
  ...props,
964
- label: this.getLabel(key, data.label, parent, options),
966
+ label: this.getLabel(key, data.label, prefix, parent, options),
965
967
  labelAlign: data.labelAlign === "after" ? "after" : "before",
966
968
  description: data.description,
967
969
  hideLabel: data.hideLabel === true,
@@ -1158,6 +1160,7 @@ class DynamicFormSchemaService {
1158
1160
  layout: property.layout,
1159
1161
  serialize: property.serialize,
1160
1162
  fieldSet: property.fieldSet,
1163
+ labelPrefix: property.labelPrefix,
1161
1164
  purposes: property.purposes || property.purpose,
1162
1165
  priority: property.priority,
1163
1166
  componentType: property.componentType,