ywana-core8 0.0.243 → 0.0.247

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.
@@ -205,13 +205,25 @@ var Button$1 = function Button(_ref) {
205
205
 
206
206
  var SiteContext = React.createContext({});
207
207
 
208
+ var FORMATS$1 = {
209
+ NONE: '',
210
+ NUMERIC: 'numeric',
211
+ DATE: 'date',
212
+ TIME: 'time',
213
+ EMAIL: 'email',
214
+ HTML: 'HTML',
215
+ URL: 'URL'
216
+ };
208
217
  /**
209
218
  * Text
210
219
  */
211
220
 
212
221
  var Text$1 = function Text(_ref) {
213
- var children = _ref.children;
222
+ var format = _ref.format,
223
+ children = _ref.children;
214
224
  var site = useContext(SiteContext);
225
+ console.log('xxx', format, site);
226
+ var value = children;
215
227
 
216
228
  if (site) {
217
229
  var lang = site.lang,
@@ -219,10 +231,18 @@ var Text$1 = function Text(_ref) {
219
231
  dictionary = _site$dictionary === void 0 ? {} : _site$dictionary;
220
232
  var term = dictionary[children];
221
233
  var text = term ? term[lang] : children;
222
- return text ? /*#__PURE__*/React.createElement("span", null, text) : '';
234
+ if (text) value = text;
223
235
  }
224
236
 
225
- return children ? /*#__PURE__*/React.createElement("span", null, children) : '';
237
+ var formatter = Intl.NumberFormat();
238
+
239
+ switch (format) {
240
+ case FORMATS$1.NUMERIC:
241
+ value = formatter.format(children);
242
+ break;
243
+ }
244
+
245
+ return children ? /*#__PURE__*/React.createElement("span", null, value) : '';
226
246
  };
227
247
 
228
248
  /**
@@ -717,7 +737,7 @@ var Property = function Property(props) {
717
737
  }
718
738
 
719
739
  function clear() {
720
- if (onChange) onChange("");
740
+ if (onChange) onChange(id, "");
721
741
  }
722
742
 
723
743
  return /*#__PURE__*/React.createElement("div", {
@@ -1031,8 +1051,8 @@ var DropDown = function DropDown(props) {
1031
1051
  options = _props$options === void 0 ? [] : _props$options,
1032
1052
  value = props.value,
1033
1053
  onChange = props.onChange,
1034
- _props$canFilter = props.canFilter,
1035
- canFilter = _props$canFilter === void 0 ? false : _props$canFilter,
1054
+ _props$predictive = props.predictive,
1055
+ predictive = _props$predictive === void 0 ? false : _props$predictive,
1036
1056
  _props$readOnly3 = props.readOnly,
1037
1057
  readOnly = _props$readOnly3 === void 0 ? false : _props$readOnly3;
1038
1058
 
@@ -1057,7 +1077,7 @@ var DropDown = function DropDown(props) {
1057
1077
  }, [value]);
1058
1078
 
1059
1079
  function change(id, value) {
1060
- if (canFilter) {
1080
+ if (predictive) {
1061
1081
  setLabel(value);
1062
1082
  } else {
1063
1083
  if (onChange) onChange(id, value);
@@ -1090,7 +1110,7 @@ var DropDown = function DropDown(props) {
1090
1110
  var canShow = open == true && Array.isArray(options);
1091
1111
 
1092
1112
  if (canShow) {
1093
- var filterActive = canFilter === true && label && label.length > 0;
1113
+ var filterActive = predictive === true && label && label.length > 0;
1094
1114
  var items = filterActive ? options.filter(function (option) {
1095
1115
  return option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0;
1096
1116
  }) : options;
@@ -1108,6 +1128,7 @@ var DropDown = function DropDown(props) {
1108
1128
  }
1109
1129
  }
1110
1130
 
1131
+ console.log('dropdown', id, 'predictive', predictive);
1111
1132
  return /*#__PURE__*/React.createElement("div", {
1112
1133
  className: "dropdown"
1113
1134
  }, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
@@ -3472,7 +3493,7 @@ var StringEditor = function StringEditor(_ref6) {
3472
3493
  onChange: change,
3473
3494
  options: buildOptions(),
3474
3495
  readOnly: !editable,
3475
- canFilter: predictive
3496
+ predictive: predictive
3476
3497
  }) : /*#__PURE__*/React.createElement(TextField, {
3477
3498
  outlined: outlined,
3478
3499
  id: id,