ywana-core8 0.0.393 → 0.0.394
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 +27 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -5
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +27 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +27 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +1 -1
- package/src/html/color.test.js +0 -1
- package/src/html/textfield.js +11 -10
- package/src/html/textfield.test.js +2 -2
- package/src/html/tokenfield.css +6 -5
- package/src/html/tokenfield.js +19 -7
package/dist/index.umd.js
CHANGED
@@ -1082,7 +1082,10 @@
|
|
1082
1082
|
_props$predictive = props.predictive,
|
1083
1083
|
predictive = _props$predictive === void 0 ? false : _props$predictive,
|
1084
1084
|
_props$readOnly3 = props.readOnly,
|
1085
|
-
readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3
|
1085
|
+
readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3,
|
1086
|
+
_props$verbose = props.verbose,
|
1087
|
+
verbose = _props$verbose === void 0 ? true : _props$verbose,
|
1088
|
+
onBlur = props.onBlur;
|
1086
1089
|
|
1087
1090
|
var _useState = React.useState(false),
|
1088
1091
|
open = _useState[0],
|
@@ -1093,6 +1096,8 @@
|
|
1093
1096
|
setLabel = _useState2[1];
|
1094
1097
|
|
1095
1098
|
React.useEffect(function () {
|
1099
|
+
console.log('DD change value', label);
|
1100
|
+
|
1096
1101
|
if (Array.isArray(options)) {
|
1097
1102
|
var option = options.find(function (option) {
|
1098
1103
|
return option.value === value;
|
@@ -1129,14 +1134,14 @@
|
|
1129
1134
|
var option = options.find(function (option) {
|
1130
1135
|
return option.value === next;
|
1131
1136
|
});
|
1132
|
-
if (onChange) onChange(id, next);
|
1133
|
-
setLabel(option.label);
|
1134
1137
|
setOpen(false);
|
1138
|
+
var label = verbose ? option.label : "";
|
1139
|
+
setLabel(label);
|
1140
|
+
if (onChange) onChange(id, next);
|
1135
1141
|
}
|
1136
1142
|
|
1137
1143
|
function blur() {
|
1138
|
-
|
1139
|
-
site.clearFocus();
|
1144
|
+
if (onBlur) onBlur();
|
1140
1145
|
}
|
1141
1146
|
|
1142
1147
|
function renderOptions() {
|
@@ -1883,6 +1888,7 @@
|
|
1883
1888
|
_ref$init = _ref.init,
|
1884
1889
|
init = _ref$init === void 0 ? [] : _ref$init,
|
1885
1890
|
readOnly = _ref.readOnly,
|
1891
|
+
options = _ref.options,
|
1886
1892
|
onChange = _ref.onChange;
|
1887
1893
|
var mounted = React.useRef(false);
|
1888
1894
|
|
@@ -1894,6 +1900,8 @@
|
|
1894
1900
|
tokens = _useState2[0],
|
1895
1901
|
setTokens = _useState2[1];
|
1896
1902
|
|
1903
|
+
React.useState(false);
|
1904
|
+
|
1897
1905
|
React.useEffect(function () {
|
1898
1906
|
if (mounted.current) {
|
1899
1907
|
if (onChange) {
|
@@ -1915,6 +1923,12 @@
|
|
1915
1923
|
setValue(value);
|
1916
1924
|
}
|
1917
1925
|
|
1926
|
+
function changeDropDown(id, value) {
|
1927
|
+
var next = tokens.concat(value);
|
1928
|
+
setTokens(next);
|
1929
|
+
setValue('xxx');
|
1930
|
+
}
|
1931
|
+
|
1918
1932
|
function onEnter(event) {
|
1919
1933
|
if (event.key === 'Enter') {
|
1920
1934
|
event.preventDefault();
|
@@ -1941,7 +1955,12 @@
|
|
1941
1955
|
return remove(index);
|
1942
1956
|
}
|
1943
1957
|
});
|
1944
|
-
}), /*#__PURE__*/React__default["default"].createElement(
|
1958
|
+
}), options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
|
1959
|
+
onChange: changeDropDown,
|
1960
|
+
options: options,
|
1961
|
+
predictive: true,
|
1962
|
+
verbose: false
|
1963
|
+
}) : /*#__PURE__*/React__default["default"].createElement("input", {
|
1945
1964
|
type: "text",
|
1946
1965
|
value: value,
|
1947
1966
|
onChange: change,
|
@@ -4099,7 +4118,8 @@
|
|
4099
4118
|
case FORMATS.COLOR:
|
4100
4119
|
return /*#__PURE__*/React__default["default"].createElement(ColorField, {
|
4101
4120
|
id: id,
|
4102
|
-
onChange: change
|
4121
|
+
onChange: change,
|
4122
|
+
value: value
|
4103
4123
|
});
|
4104
4124
|
|
4105
4125
|
case FORMATS.HTML:
|