ywana-core8 0.0.393 → 0.0.396

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.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
- console.log("BLUR DD");
1139
- site.clearFocus();
1144
+ if (onBlur) onBlur();
1140
1145
  }
1141
1146
 
1142
1147
  function renderOptions() {
@@ -1200,7 +1205,8 @@
1200
1205
  HTML: 'HTML',
1201
1206
  URL: 'URL',
1202
1207
  IMG: 'IMG',
1203
- COLOR: 'COLOR'
1208
+ COLOR: 'COLOR',
1209
+ TOKENS: 'TOKENS'
1204
1210
  };
1205
1211
  /**
1206
1212
  * CHECK
@@ -1883,6 +1889,7 @@
1883
1889
  _ref$init = _ref.init,
1884
1890
  init = _ref$init === void 0 ? [] : _ref$init,
1885
1891
  readOnly = _ref.readOnly,
1892
+ options = _ref.options,
1886
1893
  onChange = _ref.onChange;
1887
1894
  var mounted = React.useRef(false);
1888
1895
 
@@ -1894,6 +1901,8 @@
1894
1901
  tokens = _useState2[0],
1895
1902
  setTokens = _useState2[1];
1896
1903
 
1904
+ React.useState(false);
1905
+
1897
1906
  React.useEffect(function () {
1898
1907
  if (mounted.current) {
1899
1908
  if (onChange) {
@@ -1915,6 +1924,12 @@
1915
1924
  setValue(value);
1916
1925
  }
1917
1926
 
1927
+ function changeDropDown(id, value) {
1928
+ var next = tokens.concat(value);
1929
+ setTokens(next);
1930
+ setValue('xxx');
1931
+ }
1932
+
1918
1933
  function onEnter(event) {
1919
1934
  if (event.key === 'Enter') {
1920
1935
  event.preventDefault();
@@ -1941,7 +1956,12 @@
1941
1956
  return remove(index);
1942
1957
  }
1943
1958
  });
1944
- }), /*#__PURE__*/React__default["default"].createElement("input", {
1959
+ }), options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
1960
+ onChange: changeDropDown,
1961
+ options: options,
1962
+ predictive: true,
1963
+ verbose: false
1964
+ }) : /*#__PURE__*/React__default["default"].createElement("input", {
1945
1965
  type: "text",
1946
1966
  value: value,
1947
1967
  onChange: change,
@@ -4099,7 +4119,8 @@
4099
4119
  case FORMATS.COLOR:
4100
4120
  return /*#__PURE__*/React__default["default"].createElement(ColorField, {
4101
4121
  id: id,
4102
- onChange: change
4122
+ onChange: change,
4123
+ value: value
4103
4124
  });
4104
4125
 
4105
4126
  case FORMATS.HTML:
@@ -4121,6 +4142,15 @@
4121
4142
  readOnly: !editable
4122
4143
  });
4123
4144
 
4145
+ case FORMATS.TOKENS:
4146
+ return /*#__PURE__*/React__default["default"].createElement(TokenField, {
4147
+ id: id,
4148
+ label: label,
4149
+ onChange: change,
4150
+ readOnly: !editable,
4151
+ options: options
4152
+ });
4153
+
4124
4154
  default:
4125
4155
  return options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
4126
4156
  outlined: outlined,