ywana-core8 0.0.242 → 0.0.246
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 +40 -10
- 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 +40 -10
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +40 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +1 -1
- package/src/html/property.css +21 -3
- package/src/html/property.js +19 -3
- package/src/html/property.test.js +23 -0
- package/src/html/textfield.js +5 -3
- package/src/html/textfield.test.js +12 -4
- package/src/widgets/login/LoginBox.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(id, "");
|
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", {
|
731
|
+
className: "property-value"
|
732
|
+
}, initial) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
713
733
|
className: "property-value"
|
714
|
-
},
|
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
|
/**
|
@@ -1005,8 +1034,8 @@
|
|
1005
1034
|
options = _props$options === void 0 ? [] : _props$options,
|
1006
1035
|
value = props.value,
|
1007
1036
|
onChange = props.onChange,
|
1008
|
-
_props$
|
1009
|
-
|
1037
|
+
_props$predictive = props.predictive,
|
1038
|
+
predictive = _props$predictive === void 0 ? false : _props$predictive,
|
1010
1039
|
_props$readOnly3 = props.readOnly,
|
1011
1040
|
readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3;
|
1012
1041
|
|
@@ -1031,7 +1060,7 @@
|
|
1031
1060
|
}, [value]);
|
1032
1061
|
|
1033
1062
|
function change(id, value) {
|
1034
|
-
if (
|
1063
|
+
if (predictive) {
|
1035
1064
|
setLabel(value);
|
1036
1065
|
} else {
|
1037
1066
|
if (onChange) onChange(id, value);
|
@@ -1064,7 +1093,7 @@
|
|
1064
1093
|
var canShow = open == true && Array.isArray(options);
|
1065
1094
|
|
1066
1095
|
if (canShow) {
|
1067
|
-
var filterActive =
|
1096
|
+
var filterActive = predictive === true && label && label.length > 0;
|
1068
1097
|
var items = filterActive ? options.filter(function (option) {
|
1069
1098
|
return option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0;
|
1070
1099
|
}) : options;
|
@@ -1082,6 +1111,7 @@
|
|
1082
1111
|
}
|
1083
1112
|
}
|
1084
1113
|
|
1114
|
+
console.log('dropdown', id, 'predictive', predictive);
|
1085
1115
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
1086
1116
|
className: "dropdown"
|
1087
1117
|
}, /*#__PURE__*/React__default["default"].createElement(TextField, _extends({}, props, {
|
@@ -3446,7 +3476,7 @@
|
|
3446
3476
|
onChange: change,
|
3447
3477
|
options: buildOptions(),
|
3448
3478
|
readOnly: !editable,
|
3449
|
-
|
3479
|
+
predictive: predictive
|
3450
3480
|
}) : /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3451
3481
|
outlined: outlined,
|
3452
3482
|
id: id,
|