@luomus/laji-form 15.1.49 → 15.1.51

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.
@@ -67,9 +67,10 @@ let MultiAnyToBooleanField = class MultiAnyToBooleanField extends React.Componen
67
67
  }
68
68
  render() {
69
69
  const TitleFieldTemplate = utils_2.getTemplate("TitleFieldTemplate", this.props.registry, utils_1.getUiOptions(this.props.uiSchema));
70
+ const { "ui:title": _title } = this.props.uiSchema || {};
70
71
  let { groups } = utils_1.getUiOptions(this.props.uiSchema) || [];
71
72
  return (React.createElement(React.Fragment, null,
72
- React.createElement(TitleFieldTemplate, { title: this.props.schema.title, schema: this.props.schema, uiSchema: this.props.uiSchema, registry: this.props.registry }),
73
+ React.createElement(TitleFieldTemplate, { title: _title !== undefined ? _title : this.props.schema.title, schema: this.props.schema, uiSchema: this.props.uiSchema, registry: this.props.registry }),
73
74
  React.createElement("div", { className: "checkbox-row" }, groups.map((group, idx) => {
74
75
  const { "ui:help": help, "ui:helpHoverable": helpHoverable, helpPlacement } = group, _group = __rest(group, ["ui:help", "ui:helpHoverable", "helpPlacement"]);
75
76
  const groupProps = Object.assign(Object.assign({}, this.props), { schema: Object.assign(Object.assign({}, this.props.schema.items), { title: group.label }), uiSchema: Object.assign(Object.assign({}, this.props.uiSchema), { "ui:options": Object.assign({ falseValue: undefined }, _group), "ui:help": help, "ui:helpHoverable": helpHoverable, "ui:helpPlacement": helpPlacement }), formData: this.state.groupsFormData[idx], onChange: this.onChange(idx) });
@@ -62,7 +62,7 @@ function SearchableDrowndown(props) {
62
62
  const enumOptions = react_1.useMemo(() =>
63
63
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
64
64
  getEnumOptions(options.enumOptions, uiSchema, includeEmpty), [options.enumOptions, uiSchema, includeEmpty]);
65
- const getLabelFromValue = react_1.useCallback((value) => value !== undefined
65
+ const getLabelFromValue = react_1.useCallback((value) => value !== undefined && value !== ""
66
66
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
67
67
  ? enumOptions.find(item => item.value === value).label
68
68
  : "", [enumOptions]);
@@ -149,10 +149,6 @@ function SearchableDrowndown(props) {
149
149
  }
150
150
  function SearchableMultiDrowndown(props) {
151
151
  const { id, disabled, readonly, value, uiSchema, options, onChange, getEnumOptionsAsync } = props;
152
- // const enumOptions = React.useMemo(() =>
153
- // // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
154
- // getEnumOptions(options.enumOptions!, uiSchema, false),
155
- // [options.enumOptions, uiSchema]);
156
152
  const [enumOptions, setEnumOptions] = react_1.useState(getEnumOptionsAsync
157
153
  ? undefined
158
154
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luomus/laji-form",
3
- "version": "15.1.49",
3
+ "version": "15.1.51",
4
4
  "description": "React module capable of building dynamic forms from Laji form json schemas",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",