ywana-core8 0.0.246 → 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;
235
+ }
236
+
237
+ var formatter = Intl.NumberFormat();
238
+
239
+ switch (format) {
240
+ case FORMATS$1.NUMERIC:
241
+ value = formatter.format(children);
242
+ break;
223
243
  }
224
244
 
225
- return children ? /*#__PURE__*/React.createElement("span", null, children) : '';
245
+ return children ? /*#__PURE__*/React.createElement("span", null, value) : '';
226
246
  };
227
247
 
228
248
  /**