ywana-core8 0.0.246 → 0.0.250

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,24 @@ var Button$1 = function Button(_ref) {
205
205
 
206
206
  var SiteContext = React.createContext({});
207
207
 
208
+ var TEXTFORMATS = {
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
+ var value = children;
215
226
 
216
227
  if (site) {
217
228
  var lang = site.lang,
@@ -219,10 +230,18 @@ var Text$1 = function Text(_ref) {
219
230
  dictionary = _site$dictionary === void 0 ? {} : _site$dictionary;
220
231
  var term = dictionary[children];
221
232
  var text = term ? term[lang] : children;
222
- return text ? /*#__PURE__*/React.createElement("span", null, text) : '';
233
+ if (text) value = text;
234
+ }
235
+
236
+ var formatter = Intl.NumberFormat();
237
+
238
+ switch (format) {
239
+ case TEXTFORMATS.NUMERIC:
240
+ value = formatter.format(children);
241
+ break;
223
242
  }
224
243
 
225
- return children ? /*#__PURE__*/React.createElement("span", null, children) : '';
244
+ return children ? /*#__PURE__*/React.createElement("span", null, value) : '';
226
245
  };
227
246
 
228
247
  /**
@@ -5769,5 +5788,5 @@ var isFunction = function isFunction(value) {
5769
5788
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
5770
5789
  };
5771
5790
 
5772
- export { Avatar, Button$1 as Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, Content, ContentEditor, ContentForm, CreateContentDialog$1 as CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, Form, HTTPClient, Header, Icon, Kanban, KanbanCard, KanbanColumn, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, Page, PageContext, PageProvider, Planner, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, TYPES, Tab, TabbedContentEditor, TablePage, Tabs, Text$1 as Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadButton, UploadDialog, UploadFile, Uploader, Viewer, WaitScreen, isFunction };
5791
+ export { Avatar, Button$1 as Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, Content, ContentEditor, ContentForm, CreateContentDialog$1 as CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, Form, HTTPClient, Header, Icon, Kanban, KanbanCard, KanbanColumn, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, Page, PageContext, PageProvider, Planner, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, TEXTFORMATS, TYPES, Tab, TabbedContentEditor, TablePage, Tabs, Text$1 as Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadButton, UploadDialog, UploadFile, Uploader, Viewer, WaitScreen, isFunction };
5773
5792
  //# sourceMappingURL=index.modern.js.map