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.umd.js
CHANGED
@@ -208,13 +208,24 @@
|
|
208
208
|
|
209
209
|
var SiteContext = React__default["default"].createContext({});
|
210
210
|
|
211
|
+
var TEXTFORMATS = {
|
212
|
+
NONE: '',
|
213
|
+
NUMERIC: 'numeric',
|
214
|
+
DATE: 'date',
|
215
|
+
TIME: 'time',
|
216
|
+
EMAIL: 'email',
|
217
|
+
HTML: 'HTML',
|
218
|
+
URL: 'URL'
|
219
|
+
};
|
211
220
|
/**
|
212
221
|
* Text
|
213
222
|
*/
|
214
223
|
|
215
224
|
var Text$1 = function Text(_ref) {
|
216
|
-
var
|
225
|
+
var format = _ref.format,
|
226
|
+
children = _ref.children;
|
217
227
|
var site = React.useContext(SiteContext);
|
228
|
+
var value = children;
|
218
229
|
|
219
230
|
if (site) {
|
220
231
|
var lang = site.lang,
|
@@ -222,10 +233,18 @@
|
|
222
233
|
dictionary = _site$dictionary === void 0 ? {} : _site$dictionary;
|
223
234
|
var term = dictionary[children];
|
224
235
|
var text = term ? term[lang] : children;
|
225
|
-
|
236
|
+
if (text) value = text;
|
237
|
+
}
|
238
|
+
|
239
|
+
var formatter = Intl.NumberFormat();
|
240
|
+
|
241
|
+
switch (format) {
|
242
|
+
case TEXTFORMATS.NUMERIC:
|
243
|
+
value = formatter.format(children);
|
244
|
+
break;
|
226
245
|
}
|
227
246
|
|
228
|
-
return children ? /*#__PURE__*/React__default["default"].createElement("span", null,
|
247
|
+
return children ? /*#__PURE__*/React__default["default"].createElement("span", null, value) : '';
|
229
248
|
};
|
230
249
|
|
231
250
|
/**
|
@@ -5820,6 +5839,7 @@
|
|
5820
5839
|
exports.SiteProvider = SiteProvider;
|
5821
5840
|
exports.Stack = Stack;
|
5822
5841
|
exports.Switch = Switch;
|
5842
|
+
exports.TEXTFORMATS = TEXTFORMATS;
|
5823
5843
|
exports.TYPES = TYPES;
|
5824
5844
|
exports.Tab = Tab;
|
5825
5845
|
exports.TabbedContentEditor = TabbedContentEditor;
|