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 +34 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +21 -3
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +34 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +34 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/property.css +21 -3
- package/src/html/property.js +19 -3
- package/src/html/property.test.js +11 -0
package/dist/index.umd.js
CHANGED
@@ -702,16 +702,45 @@
|
|
702
702
|
*/
|
703
703
|
|
704
704
|
var Property = function Property(props) {
|
705
|
-
var
|
705
|
+
var id = props.id,
|
706
|
+
className = props.className,
|
707
|
+
label = props.label,
|
706
708
|
name = props.name,
|
707
|
-
|
709
|
+
initial = props.initial,
|
710
|
+
value = props.value,
|
711
|
+
_props$editable = props.editable,
|
712
|
+
editable = _props$editable === void 0 ? false : _props$editable,
|
713
|
+
onChange = props.onChange;
|
714
|
+
|
715
|
+
function change(event) {
|
716
|
+
if (onChange) {
|
717
|
+
var _value = event.target.value;
|
718
|
+
onChange(id, _value);
|
719
|
+
}
|
720
|
+
}
|
721
|
+
|
722
|
+
function clear() {
|
723
|
+
if (onChange) onChange("");
|
724
|
+
}
|
725
|
+
|
708
726
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
709
|
-
className: "property"
|
727
|
+
className: "property property-" + id + " " + className
|
710
728
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
711
729
|
className: "property-name"
|
712
|
-
}, name || label), /*#__PURE__*/React__default["default"].createElement("div", {
|
730
|
+
}, name || label), initial ? /*#__PURE__*/React__default["default"].createElement("div", {
|
713
731
|
className: "property-value"
|
714
|
-
},
|
732
|
+
}, initial) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
733
|
+
className: "property-value"
|
734
|
+
}, editable ? /*#__PURE__*/React__default["default"].createElement("input", {
|
735
|
+
type: "text",
|
736
|
+
value: value,
|
737
|
+
onChange: change
|
738
|
+
}) : value, editable && value.length > 0 ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
739
|
+
icon: "close",
|
740
|
+
size: "small",
|
741
|
+
clickable: true,
|
742
|
+
action: clear
|
743
|
+
}) : null));
|
715
744
|
};
|
716
745
|
|
717
746
|
/**
|