How to use react-addons-create-fragment - 10 common examples

To help you get started, we’ve selected a few react-addons-create-fragment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github carteb / react-pure-ui / src / components / playground / renderControls.js View on Github external
};
      return cloneElement(ElementOrObject, props);
    }

    // render nested object
    return (
      <div>
        <div style="{{">{key}: {'{'}</div>
          <div style="{{">
            {renderControls(ElementOrObject, componentProperties, setComponentProperties, newKeyPath)}
          </div>
        <div>{'}'}</div>
      </div>
    );
  });
  return createFragment(controls);
};
github aces / Loris / jsx / DataTable.js View on Github external
.forEach((field, k) =&gt; row[field.label] = rowData[k]);

            // Get custom cell formatting if available
            if (this.props.getFormattedCell) {
                cell = this.props.getFormattedCell(
                    this.props.fields[j].label,
                    celldata,
                    row
                );
            } else {
                cell = {celldata};
            }
            if (cell !== null) {
                curRow.push(React.cloneElement(cell, {key: 'td_col_' + j}));
            } else {
                curRow.push(createFragment({celldata}));
            }
        }

        const rowIndexDisplay = index[i].Content;
        rows.push(
            
              {rowIndexDisplay}
              {curRow}
            
        );
    }

    let rowsPerPageDropdown = (
github alexkirsz / react-list-view / src / index.js View on Github external
// the user should define their own containing block.
          // See https://github.com/Morhaus/react-list-view/issues/2
          ...(this._isControlled ? {} : translate(0, 0, 0)),
          ...style,
        }}
        onScroll={!this._isControlled &amp;&amp; this._handleScroll}
      &gt;
        <div style="{{">
          {createFragment(items)}
        </div>
      
    );
  }
github alfa-laboratory / arui-feather / src / card-number / card-number.jsx View on Github external
// to short for card number
                return number;
            }

            // masked value
            if (splittedValue[0]) {
                splittedValue[0] = splittedValue[0].trim().substring(0, 4);
            }

            if (splittedValue[1]) {
                splittedValue[1] = splittedValue[1].trim().substring(0, 4);
            }

            let dot = this.renderDot(cn);
            return createFragment({
                cardNumberStart: <span>{ splittedValue[0] }</span>,
                dot1: dot,
                dot2: dot,
                dot3: dot,
                dot4: dot,
                cardNumberEnd: <span>{ splittedValue[1] }</span>
            });
        }

        return undefined;
    }
github storybookjs / storybook / addons / info / src / components / PropVal.js View on Github external
maxPropStringLength={maxPropStringLength}
          maxPropsIntoLine={maxPropsIntoLine}
        /&gt;
      
    );
    items[`c${i}`] = ',';
  });
  if (val.length &gt; maxPropArrayLength) {
    items.last = <span>{indent(breakIntoNewLines, level)}…</span>;
  } else {
    delete items[`c${val.length - 1}`];
  }

  return (
    <span style="{valueStyles.array}">
      [{createFragment(items)}
      {indent(breakIntoNewLines, level, true)}]
    </span>
  );
}
github felixgirault / rea11y / src / Field.js View on Github external
className: 'rea11y-Field-input',
		'aria-labelledby': labels.join(' ')
	};

	if (required) {
		inputProps.required = true;
		inputProps['aria-required'] = true;
	}

	if (error) {
		inputProps['aria-invalid'] = true;
	}

	components[Field.INPUT] = cloneElement(input, inputProps);

	const fragment = createFragment(
		sortObject(components, order)
	);

	const className = classNames(
		'rea11y-Field',
		`rea11y-Field--${name}`
	);

	return (
		<div>
			{fragment}
		</div>
	);
};
github hipstersmoothie / storybook-addon-react-docgen / src / Components / PropVal.js View on Github external
items[`c${i}`] = ',';
  });
  if (val.length &gt; maxPropArrayLength) {
    items.last = (
      <span>
        {indent(breakIntoNewLines, level)}
        {'…'}
      </span>
    );
  } else {
    delete items[`c${val.length - 1}`];
  }

  return (
    <span style="{styles.default}">
      [{createFragment(items)}
      {indent(breakIntoNewLines, level, true)}]
    </span>
  );
}
github carteb / carte-blanche / plugins / react / frontend / utils / renderControls.js View on Github external
const values = set(globalComponentProps, path, value);
    setGlobalComponentProps(values);
  };

  const controls = mapValues(metadataWithControls, (prop, keyPath) => {
    const props = {
      label: keyPath,
      secondaryLabel: prop.controlType ? `${prop.controlType} (${prop.name})` : prop.name,
      value: get(globalComponentProps, keyPath),
      onUpdate: ({ value }) => updatePropertyValues(keyPath, value),
      nestedLevel,
      customMetaData: prop.customMetaData,
    };
    return cloneElement(prop.control, props);
  });
  return createFragment(controls);
};
github alfa-laboratory / arui-feather / src / radio-group / radio-group.jsx View on Github external
...props
                    })} control-group${this.props.error ? ' control-group_invalid' : ''}`
                }
                role='group'
                tabIndex='-1'
                onFocus={ this.handleFocus }
                onBlur={ this.handleBlur }
                data-test-id={ this.props['data-test-id'] }
            &gt;
                <div>
                    {
                        !!this.props.label &amp;&amp;
                        <div>{ this.props.label }</div>
                    }
                    <div>
                        { createFragment(radioGroupParts) }
                    </div>
                    {
                        (this.props.error || this.props.hint) &amp;&amp;
                        <span>
                            { this.props.error || this.props.hint }
                        </span>
                    }
                </div>
            
        );
    }
github trabe / react-conduit / src / registry.js View on Github external
mergeChildrenForLabel = label =>
    createFragment(
      this.findInletsByLabel(label)
        .sort((i1, i2) => i1.props.index - i2.props.index)
        .map(inlet => [inlet.getId(), inlet.getChildren()])
        .reduce((acc, [id, children]) => ({ ...acc, [id]: children }), {}),
    );

react-addons-create-fragment

MIT
Latest version published 7 years ago

Package Health Score

74 / 100
Full package analysis

Popular react-addons-create-fragment functions