@limetech/lime-elements 38.32.0 → 38.33.1

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.
@@ -42531,6 +42531,24 @@ class RowLayout extends react.Component {
42531
42531
  }
42532
42532
  }
42533
42533
 
42534
+ /**
42535
+ *
42536
+ * @param schema
42537
+ * @param extraProps - additional props to pass to the limel-help element
42538
+ */
42539
+ function getHelpComponent(schema, extraProps) {
42540
+ var _a;
42541
+ const help = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.help;
42542
+ if (!help) {
42543
+ return;
42544
+ }
42545
+ if (typeof help === 'string') {
42546
+ return react.createElement('limel-help', Object.assign({ value: help }, extraProps));
42547
+ }
42548
+ const helpProps = help;
42549
+ return react.createElement('limel-help', Object.assign(Object.assign({}, helpProps), extraProps));
42550
+ }
42551
+
42534
42552
  const ObjectFieldTemplate = (props) => {
42535
42553
  const id = props.idSchema.$id;
42536
42554
  if (id === 'root' || !isCollapsible(props.schema)) {
@@ -42542,15 +42560,25 @@ const ObjectFieldTemplate = (props) => {
42542
42560
  return renderProperties(props.properties, props.schema);
42543
42561
  };
42544
42562
  function renderFieldWithTitle(props) {
42545
- return react.createElement(react.Fragment, {}, renderTitle(props.title), renderDescription(props.description), renderProperties(props.properties, props.schema));
42563
+ return react.createElement(react.Fragment, {}, renderSectionHeader(props), renderDescription(props.description), renderProperties(props.properties, props.schema));
42564
+ }
42565
+ function renderSectionHeader(props) {
42566
+ const help = getHelpComponent(props.schema);
42567
+ if (!help) {
42568
+ return renderTitle(props.title);
42569
+ }
42570
+ return react.createElement(react.Fragment, {}, renderTitle(props.title), help);
42546
42571
  }
42547
42572
  function renderCollapsibleField(props) {
42548
42573
  const defaultOpen = !isCollapsed(props.schema);
42574
+ const helpElement = getHelpComponent(props.schema, {
42575
+ slot: 'header',
42576
+ });
42549
42577
  return react.createElement('limel-collapsible-section', {
42550
42578
  header: props.title,
42551
42579
  id: getSchemaObjectPropertyPath(props.formContext.schema, props.idSchema),
42552
42580
  'is-open': defaultOpen,
42553
- }, renderDescription(props.description), renderProperties(props.properties, props.schema));
42581
+ }, helpElement, renderDescription(props.description), renderProperties(props.properties, props.schema));
42554
42582
  }
42555
42583
  function getSchemaObjectPropertyPath(schema, subSchema) {
42556
42584
  var _a, _b;
@@ -47063,23 +47091,6 @@ function isAdditionalProperty(schema) {
47063
47091
  return schema[ADDITIONAL_PROPERTY_FLAG] === true;
47064
47092
  }
47065
47093
 
47066
- /**
47067
- *
47068
- * @param schema
47069
- */
47070
- function getHelpComponent(schema) {
47071
- var _a;
47072
- const help = (_a = schema.lime) === null || _a === void 0 ? void 0 : _a.help;
47073
- if (!help) {
47074
- return;
47075
- }
47076
- if (typeof help === 'string') {
47077
- return react.createElement('limel-help', { value: help });
47078
- }
47079
- const helpProps = help;
47080
- return react.createElement('limel-help', helpProps);
47081
- }
47082
-
47083
47094
  /**
47084
47095
  * A widget is a concept in react-jsonschema-form (rjsf).
47085
47096
  * It represents a HTML tag for the user to enter data, eg. input, select, etc.