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.
- package/dist/index.cjs +23 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +23 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +23 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/index.js +1 -1
- package/src/html/label.css +0 -0
- package/src/html/label.js +29 -0
- package/src/html/label.test.js +0 -0
- package/src/html/property.test.js +0 -1
- package/src/html/text.js +25 -9
- package/src/html/text.test.js +11 -0
package/dist/index.modern.js
CHANGED
@@ -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
|
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
|
-
|
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,
|
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
|