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.cjs
CHANGED
@@ -707,16 +707,45 @@ var LinearProgress = function LinearProgress(props) {
|
|
707
707
|
*/
|
708
708
|
|
709
709
|
var Property = function Property(props) {
|
710
|
-
var
|
710
|
+
var id = props.id,
|
711
|
+
className = props.className,
|
712
|
+
label = props.label,
|
711
713
|
name = props.name,
|
712
|
-
|
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(id, "");
|
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", {
|
736
|
+
className: "property-value"
|
737
|
+
}, initial) : null, /*#__PURE__*/React__default["default"].createElement("div", {
|
718
738
|
className: "property-value"
|
719
|
-
},
|
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
|
/**
|
@@ -1010,8 +1039,8 @@ var DropDown = function DropDown(props) {
|
|
1010
1039
|
options = _props$options === void 0 ? [] : _props$options,
|
1011
1040
|
value = props.value,
|
1012
1041
|
onChange = props.onChange,
|
1013
|
-
_props$
|
1014
|
-
|
1042
|
+
_props$predictive = props.predictive,
|
1043
|
+
predictive = _props$predictive === void 0 ? false : _props$predictive,
|
1015
1044
|
_props$readOnly3 = props.readOnly,
|
1016
1045
|
readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3;
|
1017
1046
|
|
@@ -1036,7 +1065,7 @@ var DropDown = function DropDown(props) {
|
|
1036
1065
|
}, [value]);
|
1037
1066
|
|
1038
1067
|
function change(id, value) {
|
1039
|
-
if (
|
1068
|
+
if (predictive) {
|
1040
1069
|
setLabel(value);
|
1041
1070
|
} else {
|
1042
1071
|
if (onChange) onChange(id, value);
|
@@ -1069,7 +1098,7 @@ var DropDown = function DropDown(props) {
|
|
1069
1098
|
var canShow = open == true && Array.isArray(options);
|
1070
1099
|
|
1071
1100
|
if (canShow) {
|
1072
|
-
var filterActive =
|
1101
|
+
var filterActive = predictive === true && label && label.length > 0;
|
1073
1102
|
var items = filterActive ? options.filter(function (option) {
|
1074
1103
|
return option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0;
|
1075
1104
|
}) : options;
|
@@ -1087,6 +1116,7 @@ var DropDown = function DropDown(props) {
|
|
1087
1116
|
}
|
1088
1117
|
}
|
1089
1118
|
|
1119
|
+
console.log('dropdown', id, 'predictive', predictive);
|
1090
1120
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
1091
1121
|
className: "dropdown"
|
1092
1122
|
}, /*#__PURE__*/React__default["default"].createElement(TextField, _extends({}, props, {
|
@@ -3451,7 +3481,7 @@ var StringEditor = function StringEditor(_ref6) {
|
|
3451
3481
|
onChange: change,
|
3452
3482
|
options: buildOptions(),
|
3453
3483
|
readOnly: !editable,
|
3454
|
-
|
3484
|
+
predictive: predictive
|
3455
3485
|
}) : /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3456
3486
|
outlined: outlined,
|
3457
3487
|
id: id,
|