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 CHANGED
@@ -1087,7 +1087,10 @@ var DropDown = function DropDown(props) {
1087
1087
  _props$predictive = props.predictive,
1088
1088
  predictive = _props$predictive === void 0 ? false : _props$predictive,
1089
1089
  _props$readOnly3 = props.readOnly,
1090
- readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3;
1090
+ readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3,
1091
+ _props$verbose = props.verbose,
1092
+ verbose = _props$verbose === void 0 ? true : _props$verbose,
1093
+ onBlur = props.onBlur;
1091
1094
 
1092
1095
  var _useState = React.useState(false),
1093
1096
  open = _useState[0],
@@ -1098,6 +1101,8 @@ var DropDown = function DropDown(props) {
1098
1101
  setLabel = _useState2[1];
1099
1102
 
1100
1103
  React.useEffect(function () {
1104
+ console.log('DD change value', label);
1105
+
1101
1106
  if (Array.isArray(options)) {
1102
1107
  var option = options.find(function (option) {
1103
1108
  return option.value === value;
@@ -1134,14 +1139,14 @@ var DropDown = function DropDown(props) {
1134
1139
  var option = options.find(function (option) {
1135
1140
  return option.value === next;
1136
1141
  });
1137
- if (onChange) onChange(id, next);
1138
- setLabel(option.label);
1139
1142
  setOpen(false);
1143
+ var label = verbose ? option.label : "";
1144
+ setLabel(label);
1145
+ if (onChange) onChange(id, next);
1140
1146
  }
1141
1147
 
1142
1148
  function blur() {
1143
- console.log("BLUR DD");
1144
- site.clearFocus();
1149
+ if (onBlur) onBlur();
1145
1150
  }
1146
1151
 
1147
1152
  function renderOptions() {
@@ -1888,6 +1893,7 @@ var TokenField = function TokenField(_ref) {
1888
1893
  _ref$init = _ref.init,
1889
1894
  init = _ref$init === void 0 ? [] : _ref$init,
1890
1895
  readOnly = _ref.readOnly,
1896
+ options = _ref.options,
1891
1897
  onChange = _ref.onChange;
1892
1898
  var mounted = React.useRef(false);
1893
1899
 
@@ -1899,6 +1905,8 @@ var TokenField = function TokenField(_ref) {
1899
1905
  tokens = _useState2[0],
1900
1906
  setTokens = _useState2[1];
1901
1907
 
1908
+ React.useState(false);
1909
+
1902
1910
  React.useEffect(function () {
1903
1911
  if (mounted.current) {
1904
1912
  if (onChange) {
@@ -1920,6 +1928,12 @@ var TokenField = function TokenField(_ref) {
1920
1928
  setValue(value);
1921
1929
  }
1922
1930
 
1931
+ function changeDropDown(id, value) {
1932
+ var next = tokens.concat(value);
1933
+ setTokens(next);
1934
+ setValue('xxx');
1935
+ }
1936
+
1923
1937
  function onEnter(event) {
1924
1938
  if (event.key === 'Enter') {
1925
1939
  event.preventDefault();
@@ -1946,7 +1960,12 @@ var TokenField = function TokenField(_ref) {
1946
1960
  return remove(index);
1947
1961
  }
1948
1962
  });
1949
- }), /*#__PURE__*/React__default["default"].createElement("input", {
1963
+ }), options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
1964
+ onChange: changeDropDown,
1965
+ options: options,
1966
+ predictive: true,
1967
+ verbose: false
1968
+ }) : /*#__PURE__*/React__default["default"].createElement("input", {
1950
1969
  type: "text",
1951
1970
  value: value,
1952
1971
  onChange: change,
@@ -4104,7 +4123,8 @@ var StringEditor = function StringEditor(_ref6) {
4104
4123
  case FORMATS.COLOR:
4105
4124
  return /*#__PURE__*/React__default["default"].createElement(ColorField, {
4106
4125
  id: id,
4107
- onChange: change
4126
+ onChange: change,
4127
+ value: value
4108
4128
  });
4109
4129
 
4110
4130
  case FORMATS.HTML: