ywana-core8 0.0.245 → 0.0.249
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 +25 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +25 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +25 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +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/src/html/textfield.js +2 -0
package/dist/index.cjs
CHANGED
@@ -213,13 +213,24 @@ var Button$1 = function Button(_ref) {
|
|
213
213
|
|
214
214
|
var SiteContext = React__default["default"].createContext({});
|
215
215
|
|
216
|
+
var TEXTFORMATS = {
|
217
|
+
NONE: '',
|
218
|
+
NUMERIC: 'numeric',
|
219
|
+
DATE: 'date',
|
220
|
+
TIME: 'time',
|
221
|
+
EMAIL: 'email',
|
222
|
+
HTML: 'HTML',
|
223
|
+
URL: 'URL'
|
224
|
+
};
|
216
225
|
/**
|
217
226
|
* Text
|
218
227
|
*/
|
219
228
|
|
220
229
|
var Text$1 = function Text(_ref) {
|
221
|
-
var
|
230
|
+
var format = _ref.format,
|
231
|
+
children = _ref.children;
|
222
232
|
var site = React.useContext(SiteContext);
|
233
|
+
var value = children;
|
223
234
|
|
224
235
|
if (site) {
|
225
236
|
var lang = site.lang,
|
@@ -227,10 +238,18 @@ var Text$1 = function Text(_ref) {
|
|
227
238
|
dictionary = _site$dictionary === void 0 ? {} : _site$dictionary;
|
228
239
|
var term = dictionary[children];
|
229
240
|
var text = term ? term[lang] : children;
|
230
|
-
|
241
|
+
if (text) value = text;
|
242
|
+
}
|
243
|
+
|
244
|
+
var formatter = Intl.NumberFormat();
|
245
|
+
|
246
|
+
switch (format) {
|
247
|
+
case TEXTFORMATS.NUMERIC:
|
248
|
+
value = formatter.format(children);
|
249
|
+
break;
|
231
250
|
}
|
232
251
|
|
233
|
-
return children ? /*#__PURE__*/React__default["default"].createElement("span", null,
|
252
|
+
return children ? /*#__PURE__*/React__default["default"].createElement("span", null, value) : '';
|
234
253
|
};
|
235
254
|
|
236
255
|
/**
|
@@ -1116,6 +1135,7 @@ var DropDown = function DropDown(props) {
|
|
1116
1135
|
}
|
1117
1136
|
}
|
1118
1137
|
|
1138
|
+
console.log('dropdown', id, 'predictive', predictive);
|
1119
1139
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
1120
1140
|
className: "dropdown"
|
1121
1141
|
}, /*#__PURE__*/React__default["default"].createElement(TextField, _extends({}, props, {
|
@@ -3480,7 +3500,7 @@ var StringEditor = function StringEditor(_ref6) {
|
|
3480
3500
|
onChange: change,
|
3481
3501
|
options: buildOptions(),
|
3482
3502
|
readOnly: !editable,
|
3483
|
-
|
3503
|
+
predictive: predictive
|
3484
3504
|
}) : /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3485
3505
|
outlined: outlined,
|
3486
3506
|
id: id,
|
@@ -5824,6 +5844,7 @@ exports.SiteContext = SiteContext;
|
|
5824
5844
|
exports.SiteProvider = SiteProvider;
|
5825
5845
|
exports.Stack = Stack;
|
5826
5846
|
exports.Switch = Switch;
|
5847
|
+
exports.TEXTFORMATS = TEXTFORMATS;
|
5827
5848
|
exports.TYPES = TYPES;
|
5828
5849
|
exports.Tab = Tab;
|
5829
5850
|
exports.TabbedContentEditor = TabbedContentEditor;
|