ywana-core8 0.0.230 → 0.0.234
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 +76 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +76 -35
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +76 -35
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +16 -10
- package/src/domain/ContentType.js +1 -0
- package/src/domain/TablePage.js +16 -4
- package/src/html/table.js +11 -1
package/dist/index.cjs
CHANGED
@@ -1043,6 +1043,7 @@ var TYPES = {
|
|
1043
1043
|
var FORMATS = {
|
1044
1044
|
NONE: '',
|
1045
1045
|
DATE: 'date',
|
1046
|
+
TIME: 'time',
|
1046
1047
|
EMAIL: 'email',
|
1047
1048
|
HTML: 'HTML',
|
1048
1049
|
URL: 'URL'
|
@@ -1629,10 +1630,23 @@ var StringCellViewer = function StringCellViewer(_ref7) {
|
|
1629
1630
|
return o.value === value;
|
1630
1631
|
}) : null;
|
1631
1632
|
var text = option ? option.label : value;
|
1633
|
+
var locale = window.navigator.userLanguage || window.navigator.language;
|
1632
1634
|
|
1633
1635
|
switch (format) {
|
1634
1636
|
case FORMATS.DATE:
|
1635
|
-
text = new Date(text).toLocaleString(
|
1637
|
+
text = new Date(text).toLocaleString(locale, {
|
1638
|
+
year: 'numeric',
|
1639
|
+
month: 'numeric',
|
1640
|
+
day: 'numeric'
|
1641
|
+
});
|
1642
|
+
break;
|
1643
|
+
|
1644
|
+
case FORMATS.TIME:
|
1645
|
+
text = new Date(text).toLocaleString(locale, {
|
1646
|
+
year: 'hour',
|
1647
|
+
month: 'minute',
|
1648
|
+
day: 'second'
|
1649
|
+
});
|
1636
1650
|
break;
|
1637
1651
|
}
|
1638
1652
|
|
@@ -3095,38 +3109,51 @@ var StringEditor = function StringEditor(_ref6) {
|
|
3095
3109
|
return opts;
|
3096
3110
|
}
|
3097
3111
|
|
3112
|
+
function renderFormat(format, options) {
|
3113
|
+
switch (format) {
|
3114
|
+
case FORMATS.HTML:
|
3115
|
+
return /*#__PURE__*/React__default["default"].createElement(Editor, {
|
3116
|
+
id: id,
|
3117
|
+
value: value,
|
3118
|
+
onChange: change,
|
3119
|
+
content: content
|
3120
|
+
});
|
3121
|
+
|
3122
|
+
case FORMATS.DATE:
|
3123
|
+
return /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3124
|
+
outlined: outlined,
|
3125
|
+
id: id,
|
3126
|
+
type: "date",
|
3127
|
+
label: label,
|
3128
|
+
value: value,
|
3129
|
+
onChange: change,
|
3130
|
+
readOnly: !editable
|
3131
|
+
});
|
3132
|
+
|
3133
|
+
default:
|
3134
|
+
return options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
|
3135
|
+
outlined: outlined,
|
3136
|
+
id: id,
|
3137
|
+
label: label,
|
3138
|
+
value: value,
|
3139
|
+
onChange: change,
|
3140
|
+
options: buildOptions(),
|
3141
|
+
readOnly: !editable,
|
3142
|
+
canFilter: predictive
|
3143
|
+
}) : /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3144
|
+
outlined: outlined,
|
3145
|
+
id: id,
|
3146
|
+
label: label,
|
3147
|
+
value: value,
|
3148
|
+
onChange: change,
|
3149
|
+
readOnly: !editable
|
3150
|
+
});
|
3151
|
+
}
|
3152
|
+
}
|
3153
|
+
|
3098
3154
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
3099
3155
|
className: "field-editor string-editor"
|
3100
|
-
}, format
|
3101
|
-
id: id,
|
3102
|
-
value: value,
|
3103
|
-
onChange: change,
|
3104
|
-
content: content
|
3105
|
-
}) : null, format === FORMATS.DATE ? /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3106
|
-
outlined: outlined,
|
3107
|
-
id: id,
|
3108
|
-
type: "date",
|
3109
|
-
label: label,
|
3110
|
-
value: value,
|
3111
|
-
onChange: change,
|
3112
|
-
readOnly: !editable
|
3113
|
-
}) : options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
|
3114
|
-
outlined: outlined,
|
3115
|
-
id: id,
|
3116
|
-
label: label,
|
3117
|
-
value: value,
|
3118
|
-
onChange: change,
|
3119
|
-
options: buildOptions(),
|
3120
|
-
readOnly: !editable,
|
3121
|
-
canFilter: predictive
|
3122
|
-
}) : /*#__PURE__*/React__default["default"].createElement(TextField, {
|
3123
|
-
outlined: outlined,
|
3124
|
-
id: id,
|
3125
|
-
label: label,
|
3126
|
-
value: value,
|
3127
|
-
onChange: change,
|
3128
|
-
readOnly: !editable
|
3129
|
-
}));
|
3156
|
+
}, renderFormat(format, options));
|
3130
3157
|
};
|
3131
3158
|
/**
|
3132
3159
|
* Number Editor
|
@@ -4804,13 +4831,27 @@ var TableEditor = function TableEditor(props) {
|
|
4804
4831
|
});
|
4805
4832
|
}
|
4806
4833
|
|
4834
|
+
function renderGroupLabel(groupName) {
|
4835
|
+
var grouper = schema[groupBy];
|
4836
|
+
|
4837
|
+
if (grouper.options) {
|
4838
|
+
var options = CHECK['isFunction'](grouper.options) ? grouper.options() : grouper.options;
|
4839
|
+
var option = options.find(function (option) {
|
4840
|
+
return option.value === groupName;
|
4841
|
+
});
|
4842
|
+
return option.label;
|
4843
|
+
} else {
|
4844
|
+
return groupName;
|
4845
|
+
}
|
4846
|
+
}
|
4847
|
+
|
4807
4848
|
function renderGroups() {
|
4808
4849
|
var items = filter ? filter(all) : all;
|
4809
|
-
var groups = items.reduce(function (groups,
|
4810
|
-
var groupName =
|
4850
|
+
var groups = items.reduce(function (groups, item) {
|
4851
|
+
var groupName = item[groupBy];
|
4811
4852
|
var group = groups[groupName];
|
4812
4853
|
if (!group) groups[groupName] = [];
|
4813
|
-
groups[groupName].push(
|
4854
|
+
groups[groupName].push(item);
|
4814
4855
|
return groups;
|
4815
4856
|
}, {});
|
4816
4857
|
return Object.keys(groups).map(function (groupName) {
|
@@ -4874,7 +4915,7 @@ var TableEditor = function TableEditor(props) {
|
|
4874
4915
|
key: groupName
|
4875
4916
|
}, /*#__PURE__*/React__default["default"].createElement(Header, {
|
4876
4917
|
title: groupName
|
4877
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
4918
|
+
}, renderGroupLabel(groupName), /*#__PURE__*/React__default["default"].createElement("span", {
|
4878
4919
|
className: "size"
|
4879
4920
|
}, groupSize)), /*#__PURE__*/React__default["default"].createElement(DataTable, _extends({}, table, {
|
4880
4921
|
onRowSelection: select,
|