ywana-core8 0.0.242 → 0.0.243

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.cjs CHANGED
@@ -707,16 +707,45 @@ var LinearProgress = function LinearProgress(props) {
707
707
  */
708
708
 
709
709
  var Property = function Property(props) {
710
- var label = props.label,
710
+ var id = props.id,
711
+ className = props.className,
712
+ label = props.label,
711
713
  name = props.name,
712
- value = props.value;
714
+ initial = props.initial,
715
+ value = props.value,
716
+ _props$editable = props.editable,
717
+ editable = _props$editable === void 0 ? false : _props$editable,
718
+ onChange = props.onChange;
719
+
720
+ function change(event) {
721
+ if (onChange) {
722
+ var _value = event.target.value;
723
+ onChange(id, _value);
724
+ }
725
+ }
726
+
727
+ function clear() {
728
+ if (onChange) onChange("");
729
+ }
730
+
713
731
  return /*#__PURE__*/React__default["default"].createElement("div", {
714
- className: "property"
732
+ className: "property property-" + id + " " + className
715
733
  }, /*#__PURE__*/React__default["default"].createElement("div", {
716
734
  className: "property-name"
717
- }, name || label), /*#__PURE__*/React__default["default"].createElement("div", {
735
+ }, name || label), initial ? /*#__PURE__*/React__default["default"].createElement("div", {
718
736
  className: "property-value"
719
- }, value));
737
+ }, initial) : null, /*#__PURE__*/React__default["default"].createElement("div", {
738
+ className: "property-value"
739
+ }, editable ? /*#__PURE__*/React__default["default"].createElement("input", {
740
+ type: "text",
741
+ value: value,
742
+ onChange: change
743
+ }) : value, editable && value.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
744
+ icon: "close",
745
+ size: "small",
746
+ clickable: true,
747
+ action: clear
748
+ }) : null));
720
749
  };
721
750
 
722
751
  /**