ywana-core8 0.0.488 → 0.0.489
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 +472 -401
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +25 -18
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +475 -405
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +472 -401
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +41 -5
- package/src/domain/index.js +1 -1
- package/src/html/table.css +7 -0
- package/src/html/table.js +19 -7
- package/src/html/table.test.js +13 -12
- package/src/site/site.test.js +36 -2
package/dist/index.modern.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
2
|
-
import React, { useContext, useState, useEffect, Fragment, useMemo, useRef, Children } from 'react';
|
2
|
+
import React, { useContext, useState, useEffect, Fragment, useMemo as useMemo$1, useRef, Children } from 'react';
|
3
3
|
import RSwitch from 'react-switch';
|
4
4
|
import moment from 'moment';
|
5
5
|
import { extendMoment } from 'moment-range';
|
@@ -918,6 +918,242 @@ var Stack = function Stack(props) {
|
|
918
918
|
return /*#__PURE__*/React.createElement(Fragment, null, child);
|
919
919
|
};
|
920
920
|
|
921
|
+
/**
|
922
|
+
* TYPES
|
923
|
+
*/
|
924
|
+
var TYPES$1 = {
|
925
|
+
STRING: 'String',
|
926
|
+
NUMBER: 'Number',
|
927
|
+
BOOLEAN: 'Boolean',
|
928
|
+
ARRAY: 'Array',
|
929
|
+
ENTITY: 'Object',
|
930
|
+
FUNCTION: 'Function'
|
931
|
+
};
|
932
|
+
/**
|
933
|
+
* FORMATS
|
934
|
+
*/
|
935
|
+
|
936
|
+
var FORMATS = {
|
937
|
+
NONE: '',
|
938
|
+
DATE: 'date',
|
939
|
+
DATERANGE: 'DATERANGE',
|
940
|
+
TIME: 'time',
|
941
|
+
EMAIL: 'email',
|
942
|
+
HTML: 'HTML',
|
943
|
+
URL: 'URL',
|
944
|
+
IMG: 'IMG',
|
945
|
+
COLOR: 'COLOR',
|
946
|
+
TOKENS: 'TOKENS'
|
947
|
+
};
|
948
|
+
/**
|
949
|
+
* CHECK
|
950
|
+
*/
|
951
|
+
|
952
|
+
var CHECK = Object.values(TYPES$1).reduce(function (obj, name) {
|
953
|
+
obj['is' + name] = function (x) {
|
954
|
+
return toString.call(x) == '[object ' + name + ']';
|
955
|
+
};
|
956
|
+
|
957
|
+
return obj;
|
958
|
+
}, {});
|
959
|
+
/**
|
960
|
+
* Content Type
|
961
|
+
*/
|
962
|
+
|
963
|
+
var ContentType = /*#__PURE__*/function () {
|
964
|
+
function ContentType(schema) {
|
965
|
+
this._schema = schema;
|
966
|
+
}
|
967
|
+
|
968
|
+
var _proto = ContentType.prototype;
|
969
|
+
|
970
|
+
_proto.checkType = function checkType(_ref, data) {
|
971
|
+
var type = _ref.type,
|
972
|
+
item = _ref.item;
|
973
|
+
var valid = true;
|
974
|
+
var validChildren = true;
|
975
|
+
|
976
|
+
if (item) {
|
977
|
+
var child = new ContentType(item);
|
978
|
+
|
979
|
+
switch (type) {
|
980
|
+
case TYPES$1.ARRAY:
|
981
|
+
valid = CHECK['is' + type](data);
|
982
|
+
validChildren = data.every(function (element) {
|
983
|
+
return child.validate(element);
|
984
|
+
});
|
985
|
+
break;
|
986
|
+
|
987
|
+
case TYPES$1.ENTITY:
|
988
|
+
valid = CHECK['is' + type](data);
|
989
|
+
validChildren = child.validate(data);
|
990
|
+
break;
|
991
|
+
|
992
|
+
case TYPES$1.NUMBER:
|
993
|
+
valid = CHECK['is' + type](data.value);
|
994
|
+
validChildren = true;
|
995
|
+
break;
|
996
|
+
|
997
|
+
default:
|
998
|
+
valid = true;
|
999
|
+
validChildren = true;
|
1000
|
+
}
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
return valid && validChildren;
|
1004
|
+
}
|
1005
|
+
/**
|
1006
|
+
* Validate entity data
|
1007
|
+
* - Inspect required attributes only
|
1008
|
+
* - Check attributes type
|
1009
|
+
*/
|
1010
|
+
;
|
1011
|
+
|
1012
|
+
_proto.validate = function validate(data) {
|
1013
|
+
var _this = this;
|
1014
|
+
|
1015
|
+
var attributes = Object.entries(this._schema);
|
1016
|
+
return attributes.filter(function (_ref2) {
|
1017
|
+
var attr = _ref2[1];
|
1018
|
+
return attr.required === true;
|
1019
|
+
}).every(function (_ref3) {
|
1020
|
+
var name = _ref3[0],
|
1021
|
+
attr = _ref3[1];
|
1022
|
+
return data[name] !== undefined ? _this.checkType(attr, data[name]) : false;
|
1023
|
+
});
|
1024
|
+
}
|
1025
|
+
/**
|
1026
|
+
* Content Type Form
|
1027
|
+
*/
|
1028
|
+
;
|
1029
|
+
|
1030
|
+
_proto.form = function form(data) {
|
1031
|
+
var entries = Object.entries(this._schema);
|
1032
|
+
var form = entries.reduce(function (form, _ref4) {
|
1033
|
+
var id = _ref4[0],
|
1034
|
+
field = _ref4[1];
|
1035
|
+
form[id] = Object.assign({}, field, {
|
1036
|
+
value: data[id] || field.defValue
|
1037
|
+
});
|
1038
|
+
return form;
|
1039
|
+
}, {});
|
1040
|
+
return form;
|
1041
|
+
}
|
1042
|
+
/**
|
1043
|
+
* Content Type Sections
|
1044
|
+
*/
|
1045
|
+
;
|
1046
|
+
|
1047
|
+
_proto.sections = function sections(data) {
|
1048
|
+
var form = this.form(data);
|
1049
|
+
var fields = Object.values(form);
|
1050
|
+
var sections = fields.reduce(function (sections, field) {
|
1051
|
+
var section = field.section;
|
1052
|
+
var title = section ? section : '';
|
1053
|
+
if (!sections.hasOwnProperty(title)) sections[title] = {
|
1054
|
+
title: title,
|
1055
|
+
fields: []
|
1056
|
+
};
|
1057
|
+
sections[title].fields.push(field);
|
1058
|
+
return sections;
|
1059
|
+
}, {});
|
1060
|
+
return Object.values(sections);
|
1061
|
+
}
|
1062
|
+
/**
|
1063
|
+
* value
|
1064
|
+
*/
|
1065
|
+
;
|
1066
|
+
|
1067
|
+
_proto.value = function value(data) {
|
1068
|
+
var fields = Object.entries(this._schema);
|
1069
|
+
var next = fields.reduce(function (next, _ref5) {
|
1070
|
+
var name = _ref5[0],
|
1071
|
+
field = _ref5[1];
|
1072
|
+
var type = field.type,
|
1073
|
+
item = field.item,
|
1074
|
+
optional = field.optional;
|
1075
|
+
var entryData = data ? data[name] : null;
|
1076
|
+
|
1077
|
+
switch (type) {
|
1078
|
+
case TYPES$1.STRING:
|
1079
|
+
next[name] = entryData || field["default"];
|
1080
|
+
break;
|
1081
|
+
|
1082
|
+
case TYPES$1.NUMBER:
|
1083
|
+
next[name] = entryData || field["default"];
|
1084
|
+
break;
|
1085
|
+
|
1086
|
+
case TYPES$1.BOOLEAN:
|
1087
|
+
next[name] = entryData || field["default"];
|
1088
|
+
break;
|
1089
|
+
|
1090
|
+
case TYPES$1.ENTITY:
|
1091
|
+
if (optional === true) console.log('OPTIONAL', field, !entryData);
|
1092
|
+
if (optional === true && !entryData) break;
|
1093
|
+
var child1 = new ContentType(item);
|
1094
|
+
next[name] = child1.value(entryData);
|
1095
|
+
break;
|
1096
|
+
|
1097
|
+
case TYPES$1.ARRAY:
|
1098
|
+
if (item === TYPES$1.STRING) {
|
1099
|
+
next[name] = entryData ? entryData : [];
|
1100
|
+
} else {
|
1101
|
+
var child2 = new ContentType(item);
|
1102
|
+
next[name] = entryData ? entryData.map(function (data2) {
|
1103
|
+
return child2.value(data2);
|
1104
|
+
}) : [];
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
break;
|
1108
|
+
|
1109
|
+
default:
|
1110
|
+
next[name] = field;
|
1111
|
+
break;
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
return next;
|
1115
|
+
}, {});
|
1116
|
+
return next;
|
1117
|
+
};
|
1118
|
+
|
1119
|
+
return ContentType;
|
1120
|
+
}();
|
1121
|
+
/**
|
1122
|
+
* Content
|
1123
|
+
*/
|
1124
|
+
|
1125
|
+
var Content = /*#__PURE__*/function () {
|
1126
|
+
function Content(type, value) {
|
1127
|
+
this.type = type;
|
1128
|
+
this._type = new ContentType(type);
|
1129
|
+
this._value = value;
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
var _proto2 = Content.prototype;
|
1133
|
+
|
1134
|
+
_proto2.isValid = function isValid() {
|
1135
|
+
return this._type.validate(this._value);
|
1136
|
+
};
|
1137
|
+
|
1138
|
+
_proto2.value = function value() {
|
1139
|
+
return this._type.value(this._value);
|
1140
|
+
};
|
1141
|
+
|
1142
|
+
_proto2.form = function form() {
|
1143
|
+
return this._type.form(this._value);
|
1144
|
+
};
|
1145
|
+
|
1146
|
+
_proto2.sections = function sections() {
|
1147
|
+
return this._type.sections(this._value);
|
1148
|
+
};
|
1149
|
+
|
1150
|
+
_proto2.update = function update(value) {
|
1151
|
+
this._value = value;
|
1152
|
+
};
|
1153
|
+
|
1154
|
+
return Content;
|
1155
|
+
}();
|
1156
|
+
|
921
1157
|
/**
|
922
1158
|
* Text Field
|
923
1159
|
*/
|
@@ -1095,387 +1331,127 @@ var DropDown = function DropDown(props) {
|
|
1095
1331
|
setOpen = _useState[1];
|
1096
1332
|
|
1097
1333
|
var _useState2 = useState(),
|
1098
|
-
label = _useState2[0],
|
1099
|
-
setLabel = _useState2[1];
|
1100
|
-
|
1101
|
-
useEffect(function () {
|
1102
|
-
if (Array.isArray(options)) {
|
1103
|
-
var option = options.find(function (option) {
|
1104
|
-
return option.value === value;
|
1105
|
-
});
|
1106
|
-
|
1107
|
-
var _label = option ? option.label : "";
|
1108
|
-
|
1109
|
-
setLabel(_label);
|
1110
|
-
}
|
1111
|
-
}, [value]);
|
1112
|
-
|
1113
|
-
function change(id, value) {
|
1114
|
-
if (predictive) {
|
1115
|
-
setLabel(value);
|
1116
|
-
} else {
|
1117
|
-
if (onChange) onChange(id, value);
|
1118
|
-
}
|
1119
|
-
}
|
1120
|
-
|
1121
|
-
function toggle() {
|
1122
|
-
if (site && site.changeFocus) {
|
1123
|
-
site.changeFocus({
|
1124
|
-
lose: function lose() {
|
1125
|
-
setOpen(false);
|
1126
|
-
}
|
1127
|
-
});
|
1128
|
-
}
|
1129
|
-
|
1130
|
-
if (!readOnly) setOpen(!open);
|
1131
|
-
}
|
1132
|
-
|
1133
|
-
function select(event) {
|
1134
|
-
var next = event.target.getAttribute("value");
|
1135
|
-
var option = options.find(function (option) {
|
1136
|
-
return option.value === next;
|
1137
|
-
});
|
1138
|
-
setOpen(false);
|
1139
|
-
var label = verbose ? option.label : "";
|
1140
|
-
setLabel(label);
|
1141
|
-
if (onChange) onChange(id, next);
|
1142
|
-
}
|
1143
|
-
|
1144
|
-
function blur() {
|
1145
|
-
if (onBlur) onBlur();
|
1146
|
-
}
|
1147
|
-
|
1148
|
-
function renderOptions() {
|
1149
|
-
var canShow = open == true && Array.isArray(options);
|
1150
|
-
|
1151
|
-
if (canShow) {
|
1152
|
-
var filterActive = predictive === true && label && label.length > 0;
|
1153
|
-
var items = filterActive ? options.filter(function (option) {
|
1154
|
-
return option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0;
|
1155
|
-
}) : options;
|
1156
|
-
var lis = items.map(function (option) {
|
1157
|
-
return /*#__PURE__*/React.createElement("li", {
|
1158
|
-
key: option.value,
|
1159
|
-
value: option.value
|
1160
|
-
}, option.label);
|
1161
|
-
});
|
1162
|
-
return /*#__PURE__*/React.createElement("menu", null, /*#__PURE__*/React.createElement("ul", {
|
1163
|
-
onMouseDown: select
|
1164
|
-
}, lis));
|
1165
|
-
} else {
|
1166
|
-
return null;
|
1167
|
-
}
|
1168
|
-
}
|
1169
|
-
|
1170
|
-
return /*#__PURE__*/React.createElement("div", {
|
1171
|
-
className: "dropdown"
|
1172
|
-
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
1173
|
-
onClick: toggle,
|
1174
|
-
value: label,
|
1175
|
-
onChange: change,
|
1176
|
-
onBlur: blur,
|
1177
|
-
readOnly: !predictive
|
1178
|
-
})), !readOnly ? /*#__PURE__*/React.createElement(Icon, {
|
1179
|
-
icon: "expand_more",
|
1180
|
-
clickable: true,
|
1181
|
-
size: "small",
|
1182
|
-
action: toggle
|
1183
|
-
}) : null, renderOptions());
|
1184
|
-
};
|
1185
|
-
var DateRange = function DateRange(props) {
|
1186
|
-
var id = props.id,
|
1187
|
-
label = props.label,
|
1188
|
-
onChange = props.onChange;
|
1189
|
-
|
1190
|
-
var _useState3 = useState({}),
|
1191
|
-
form = _useState3[0],
|
1192
|
-
setForm = _useState3[1];
|
1193
|
-
|
1194
|
-
useEffect(function () {
|
1195
|
-
if (onChange) onChange(id, form);
|
1196
|
-
}, [form]);
|
1197
|
-
|
1198
|
-
function change(id, value) {
|
1199
|
-
var _Object$assign;
|
1200
|
-
|
1201
|
-
var next = Object.assign({}, form, (_Object$assign = {}, _Object$assign[id] = value, _Object$assign));
|
1202
|
-
setForm(next);
|
1203
|
-
}
|
1204
|
-
|
1205
|
-
return /*#__PURE__*/React.createElement("div", {
|
1206
|
-
className: "date-range"
|
1207
|
-
}, label ? /*#__PURE__*/React.createElement("label", null, label) : null, /*#__PURE__*/React.createElement(TextField, {
|
1208
|
-
id: "from",
|
1209
|
-
type: "date",
|
1210
|
-
label: "From",
|
1211
|
-
value: form.from,
|
1212
|
-
onChange: change
|
1213
|
-
}), /*#__PURE__*/React.createElement(TextField, {
|
1214
|
-
id: "to",
|
1215
|
-
type: "date",
|
1216
|
-
label: "To",
|
1217
|
-
value: form.to,
|
1218
|
-
onChange: change
|
1219
|
-
}));
|
1220
|
-
};
|
1221
|
-
|
1222
|
-
/**
|
1223
|
-
* TYPES
|
1224
|
-
*/
|
1225
|
-
var TYPES = {
|
1226
|
-
STRING: 'String',
|
1227
|
-
NUMBER: 'Number',
|
1228
|
-
BOOLEAN: 'Boolean',
|
1229
|
-
ARRAY: 'Array',
|
1230
|
-
ENTITY: 'Object',
|
1231
|
-
FUNCTION: 'Function'
|
1232
|
-
};
|
1233
|
-
/**
|
1234
|
-
* FORMATS
|
1235
|
-
*/
|
1236
|
-
|
1237
|
-
var FORMATS = {
|
1238
|
-
NONE: '',
|
1239
|
-
DATE: 'date',
|
1240
|
-
DATERANGE: 'DATERANGE',
|
1241
|
-
TIME: 'time',
|
1242
|
-
EMAIL: 'email',
|
1243
|
-
HTML: 'HTML',
|
1244
|
-
URL: 'URL',
|
1245
|
-
IMG: 'IMG',
|
1246
|
-
COLOR: 'COLOR',
|
1247
|
-
TOKENS: 'TOKENS'
|
1248
|
-
};
|
1249
|
-
/**
|
1250
|
-
* CHECK
|
1251
|
-
*/
|
1252
|
-
|
1253
|
-
var CHECK = Object.values(TYPES).reduce(function (obj, name) {
|
1254
|
-
obj['is' + name] = function (x) {
|
1255
|
-
return toString.call(x) == '[object ' + name + ']';
|
1256
|
-
};
|
1257
|
-
|
1258
|
-
return obj;
|
1259
|
-
}, {});
|
1260
|
-
/**
|
1261
|
-
* Content Type
|
1262
|
-
*/
|
1263
|
-
|
1264
|
-
var ContentType = /*#__PURE__*/function () {
|
1265
|
-
function ContentType(schema) {
|
1266
|
-
this._schema = schema;
|
1267
|
-
}
|
1268
|
-
|
1269
|
-
var _proto = ContentType.prototype;
|
1270
|
-
|
1271
|
-
_proto.checkType = function checkType(_ref, data) {
|
1272
|
-
var type = _ref.type,
|
1273
|
-
item = _ref.item;
|
1274
|
-
var valid = true;
|
1275
|
-
var validChildren = true;
|
1276
|
-
|
1277
|
-
if (item) {
|
1278
|
-
var child = new ContentType(item);
|
1279
|
-
|
1280
|
-
switch (type) {
|
1281
|
-
case TYPES.ARRAY:
|
1282
|
-
valid = CHECK['is' + type](data);
|
1283
|
-
validChildren = data.every(function (element) {
|
1284
|
-
return child.validate(element);
|
1285
|
-
});
|
1286
|
-
break;
|
1287
|
-
|
1288
|
-
case TYPES.ENTITY:
|
1289
|
-
valid = CHECK['is' + type](data);
|
1290
|
-
validChildren = child.validate(data);
|
1291
|
-
break;
|
1292
|
-
|
1293
|
-
case TYPES.NUMBER:
|
1294
|
-
valid = CHECK['is' + type](data.value);
|
1295
|
-
validChildren = true;
|
1296
|
-
break;
|
1297
|
-
|
1298
|
-
default:
|
1299
|
-
valid = true;
|
1300
|
-
validChildren = true;
|
1301
|
-
}
|
1302
|
-
}
|
1303
|
-
|
1304
|
-
return valid && validChildren;
|
1305
|
-
}
|
1306
|
-
/**
|
1307
|
-
* Validate entity data
|
1308
|
-
* - Inspect required attributes only
|
1309
|
-
* - Check attributes type
|
1310
|
-
*/
|
1311
|
-
;
|
1312
|
-
|
1313
|
-
_proto.validate = function validate(data) {
|
1314
|
-
var _this = this;
|
1315
|
-
|
1316
|
-
var attributes = Object.entries(this._schema);
|
1317
|
-
return attributes.filter(function (_ref2) {
|
1318
|
-
var attr = _ref2[1];
|
1319
|
-
return attr.required === true;
|
1320
|
-
}).every(function (_ref3) {
|
1321
|
-
var name = _ref3[0],
|
1322
|
-
attr = _ref3[1];
|
1323
|
-
return data[name] !== undefined ? _this.checkType(attr, data[name]) : false;
|
1324
|
-
});
|
1325
|
-
}
|
1326
|
-
/**
|
1327
|
-
* Content Type Form
|
1328
|
-
*/
|
1329
|
-
;
|
1330
|
-
|
1331
|
-
_proto.form = function form(data) {
|
1332
|
-
var entries = Object.entries(this._schema);
|
1333
|
-
var form = entries.reduce(function (form, _ref4) {
|
1334
|
-
var id = _ref4[0],
|
1335
|
-
field = _ref4[1];
|
1336
|
-
form[id] = Object.assign({}, field, {
|
1337
|
-
value: data[id] || field.defValue
|
1338
|
-
});
|
1339
|
-
return form;
|
1340
|
-
}, {});
|
1341
|
-
return form;
|
1342
|
-
}
|
1343
|
-
/**
|
1344
|
-
* Content Type Sections
|
1345
|
-
*/
|
1346
|
-
;
|
1347
|
-
|
1348
|
-
_proto.sections = function sections(data) {
|
1349
|
-
var form = this.form(data);
|
1350
|
-
var fields = Object.values(form);
|
1351
|
-
var sections = fields.reduce(function (sections, field) {
|
1352
|
-
var section = field.section;
|
1353
|
-
var title = section ? section : '';
|
1354
|
-
if (!sections.hasOwnProperty(title)) sections[title] = {
|
1355
|
-
title: title,
|
1356
|
-
fields: []
|
1357
|
-
};
|
1358
|
-
sections[title].fields.push(field);
|
1359
|
-
return sections;
|
1360
|
-
}, {});
|
1361
|
-
return Object.values(sections);
|
1362
|
-
}
|
1363
|
-
/**
|
1364
|
-
* value
|
1365
|
-
*/
|
1366
|
-
;
|
1367
|
-
|
1368
|
-
_proto.value = function value(data) {
|
1369
|
-
var fields = Object.entries(this._schema);
|
1370
|
-
var next = fields.reduce(function (next, _ref5) {
|
1371
|
-
var name = _ref5[0],
|
1372
|
-
field = _ref5[1];
|
1373
|
-
var type = field.type,
|
1374
|
-
item = field.item,
|
1375
|
-
optional = field.optional;
|
1376
|
-
var entryData = data ? data[name] : null;
|
1377
|
-
|
1378
|
-
switch (type) {
|
1379
|
-
case TYPES.STRING:
|
1380
|
-
next[name] = entryData || field["default"];
|
1381
|
-
break;
|
1382
|
-
|
1383
|
-
case TYPES.NUMBER:
|
1384
|
-
next[name] = entryData || field["default"];
|
1385
|
-
break;
|
1386
|
-
|
1387
|
-
case TYPES.BOOLEAN:
|
1388
|
-
next[name] = entryData || field["default"];
|
1389
|
-
break;
|
1390
|
-
|
1391
|
-
case TYPES.ENTITY:
|
1392
|
-
if (optional === true) console.log('OPTIONAL', field, !entryData);
|
1393
|
-
if (optional === true && !entryData) break;
|
1394
|
-
var child1 = new ContentType(item);
|
1395
|
-
next[name] = child1.value(entryData);
|
1396
|
-
break;
|
1397
|
-
|
1398
|
-
case TYPES.ARRAY:
|
1399
|
-
if (item === TYPES.STRING) {
|
1400
|
-
next[name] = entryData ? entryData : [];
|
1401
|
-
} else {
|
1402
|
-
var child2 = new ContentType(item);
|
1403
|
-
next[name] = entryData ? entryData.map(function (data2) {
|
1404
|
-
return child2.value(data2);
|
1405
|
-
}) : [];
|
1406
|
-
}
|
1407
|
-
|
1408
|
-
break;
|
1334
|
+
label = _useState2[0],
|
1335
|
+
setLabel = _useState2[1];
|
1409
1336
|
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1337
|
+
useEffect(function () {
|
1338
|
+
if (Array.isArray(options)) {
|
1339
|
+
var option = options.find(function (option) {
|
1340
|
+
return option.value === value;
|
1341
|
+
});
|
1414
1342
|
|
1415
|
-
|
1416
|
-
}, {});
|
1417
|
-
return next;
|
1418
|
-
};
|
1343
|
+
var _label = option ? option.label : "";
|
1419
1344
|
|
1420
|
-
|
1421
|
-
}
|
1422
|
-
|
1423
|
-
* Content
|
1424
|
-
*/
|
1345
|
+
setLabel(_label);
|
1346
|
+
}
|
1347
|
+
}, [value]);
|
1425
1348
|
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1349
|
+
function change(id, value) {
|
1350
|
+
if (predictive) {
|
1351
|
+
setLabel(value);
|
1352
|
+
} else {
|
1353
|
+
if (onChange) onChange(id, value);
|
1354
|
+
}
|
1431
1355
|
}
|
1432
1356
|
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1357
|
+
function toggle() {
|
1358
|
+
if (site && site.changeFocus) {
|
1359
|
+
site.changeFocus({
|
1360
|
+
lose: function lose() {
|
1361
|
+
setOpen(false);
|
1362
|
+
}
|
1363
|
+
});
|
1364
|
+
}
|
1438
1365
|
|
1439
|
-
|
1440
|
-
|
1441
|
-
};
|
1366
|
+
if (!readOnly) setOpen(!open);
|
1367
|
+
}
|
1442
1368
|
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1369
|
+
function select(event) {
|
1370
|
+
var next = event.target.getAttribute("value");
|
1371
|
+
var option = options.find(function (option) {
|
1372
|
+
return option.value === next;
|
1373
|
+
});
|
1374
|
+
setOpen(false);
|
1375
|
+
var label = verbose ? option.label : "";
|
1376
|
+
setLabel(label);
|
1377
|
+
if (onChange) onChange(id, next);
|
1378
|
+
}
|
1446
1379
|
|
1447
|
-
|
1448
|
-
|
1449
|
-
}
|
1380
|
+
function blur() {
|
1381
|
+
if (onBlur) onBlur();
|
1382
|
+
}
|
1450
1383
|
|
1451
|
-
|
1452
|
-
|
1453
|
-
};
|
1384
|
+
function renderOptions() {
|
1385
|
+
var canShow = open == true && Array.isArray(options);
|
1454
1386
|
|
1455
|
-
|
1456
|
-
|
1387
|
+
if (canShow) {
|
1388
|
+
var filterActive = predictive === true && label && label.length > 0;
|
1389
|
+
var items = filterActive ? options.filter(function (option) {
|
1390
|
+
return option.label.toUpperCase().indexOf(label.toUpperCase()) >= 0;
|
1391
|
+
}) : options;
|
1392
|
+
var lis = items.map(function (option) {
|
1393
|
+
return /*#__PURE__*/React.createElement("li", {
|
1394
|
+
key: option.value,
|
1395
|
+
value: option.value
|
1396
|
+
}, option.label);
|
1397
|
+
});
|
1398
|
+
return /*#__PURE__*/React.createElement("menu", null, /*#__PURE__*/React.createElement("ul", {
|
1399
|
+
onMouseDown: select
|
1400
|
+
}, lis));
|
1401
|
+
} else {
|
1402
|
+
return null;
|
1403
|
+
}
|
1404
|
+
}
|
1457
1405
|
|
1458
|
-
|
1406
|
+
return /*#__PURE__*/React.createElement("div", {
|
1407
|
+
className: "dropdown"
|
1408
|
+
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
1409
|
+
onClick: toggle,
|
1410
|
+
value: label,
|
1411
|
+
onChange: change,
|
1412
|
+
onBlur: blur,
|
1413
|
+
readOnly: !predictive
|
1414
|
+
})), !readOnly ? /*#__PURE__*/React.createElement(Icon, {
|
1415
|
+
icon: "expand_more",
|
1416
|
+
clickable: true,
|
1417
|
+
size: "small",
|
1418
|
+
action: toggle
|
1419
|
+
}) : null, renderOptions());
|
1420
|
+
};
|
1421
|
+
var DateRange = function DateRange(props) {
|
1459
1422
|
var id = props.id,
|
1460
|
-
|
1461
|
-
label = _props$label === void 0 ? "Color" : _props$label,
|
1462
|
-
value = props.value,
|
1423
|
+
label = props.label,
|
1463
1424
|
onChange = props.onChange;
|
1464
1425
|
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1426
|
+
var _useState3 = useState({}),
|
1427
|
+
form = _useState3[0],
|
1428
|
+
setForm = _useState3[1];
|
1429
|
+
|
1430
|
+
useEffect(function () {
|
1431
|
+
if (onChange) onChange(id, form);
|
1432
|
+
}, [form]);
|
1433
|
+
|
1434
|
+
function change(id, value) {
|
1435
|
+
var _Object$assign;
|
1436
|
+
|
1437
|
+
var next = Object.assign({}, form, (_Object$assign = {}, _Object$assign[id] = value, _Object$assign));
|
1438
|
+
setForm(next);
|
1468
1439
|
}
|
1469
1440
|
|
1470
1441
|
return /*#__PURE__*/React.createElement("div", {
|
1471
|
-
className: "
|
1472
|
-
}, /*#__PURE__*/React.createElement("label", {
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
onChange: change
|
1478
|
-
|
1442
|
+
className: "date-range"
|
1443
|
+
}, label ? /*#__PURE__*/React.createElement("label", null, label) : null, /*#__PURE__*/React.createElement(TextField, {
|
1444
|
+
id: "from",
|
1445
|
+
type: "date",
|
1446
|
+
label: "From",
|
1447
|
+
value: form.from,
|
1448
|
+
onChange: change
|
1449
|
+
}), /*#__PURE__*/React.createElement(TextField, {
|
1450
|
+
id: "to",
|
1451
|
+
type: "date",
|
1452
|
+
label: "To",
|
1453
|
+
value: form.to,
|
1454
|
+
onChange: change
|
1479
1455
|
}));
|
1480
1456
|
};
|
1481
1457
|
|
@@ -1502,17 +1478,31 @@ var DataTable = function DataTable(props) {
|
|
1502
1478
|
className = props.className;
|
1503
1479
|
|
1504
1480
|
var _useState = useState({}),
|
1505
|
-
sortDir = _useState[0]
|
1481
|
+
sortDir = _useState[0],
|
1482
|
+
setSortDir = _useState[1];
|
1506
1483
|
|
1507
1484
|
var _useState2 = useState(false),
|
1508
1485
|
allChecked = _useState2[0],
|
1509
1486
|
setAllChecked = _useState2[1];
|
1510
1487
|
|
1488
|
+
useEffect(function () {
|
1489
|
+
console.log(sortDir);
|
1490
|
+
}, [sortDir]);
|
1491
|
+
|
1492
|
+
function changeSort(id) {
|
1493
|
+
var _Object$assign;
|
1494
|
+
|
1495
|
+
var nextDir = sortDir[id] ? sortDir[id] * -1 : 1;
|
1496
|
+
var next = Object.assign({}, sortDir, (_Object$assign = {}, _Object$assign[id] = nextDir, _Object$assign));
|
1497
|
+
setSortDir(next);
|
1498
|
+
}
|
1499
|
+
|
1511
1500
|
function multiSort(array, sortObject) {
|
1512
1501
|
if (sortObject === void 0) {
|
1513
1502
|
sortObject = {};
|
1514
1503
|
}
|
1515
1504
|
|
1505
|
+
console.log('multisort', sortObject);
|
1516
1506
|
var sortKeys = Object.keys(sortObject);
|
1517
1507
|
|
1518
1508
|
if (!sortKeys.length) {
|
@@ -1555,7 +1545,7 @@ var DataTable = function DataTable(props) {
|
|
1555
1545
|
}
|
1556
1546
|
}
|
1557
1547
|
|
1558
|
-
function
|
1548
|
+
function moveRow(dragged, dropped) {
|
1559
1549
|
if (onSort) onSort(dragged, dropped);
|
1560
1550
|
}
|
1561
1551
|
|
@@ -1577,7 +1567,7 @@ var DataTable = function DataTable(props) {
|
|
1577
1567
|
item = _ref.item,
|
1578
1568
|
sortable = _ref.sortable;
|
1579
1569
|
|
1580
|
-
var _ref2 = type === TYPES.ENTITY ? [1, Object.values(item).filter(function (v) {
|
1570
|
+
var _ref2 = type === TYPES$1.ENTITY ? [1, Object.values(item).filter(function (v) {
|
1581
1571
|
return v.column === true;
|
1582
1572
|
}).length] : [2, 1],
|
1583
1573
|
rowspan = _ref2[0],
|
@@ -1587,22 +1577,25 @@ var DataTable = function DataTable(props) {
|
|
1587
1577
|
key: id,
|
1588
1578
|
rowSpan: rowspan,
|
1589
1579
|
colSpan: colspan
|
1590
|
-
}, id === "checked" ? /*#__PURE__*/React.createElement(CheckBox, {
|
1580
|
+
}, /*#__PURE__*/React.createElement("div", null, id === "checked" ? /*#__PURE__*/React.createElement(CheckBox, {
|
1591
1581
|
onChange: checkAll,
|
1592
1582
|
value: allChecked
|
1593
1583
|
}) : /*#__PURE__*/React.createElement(Text, {
|
1594
1584
|
key: "th_" + id
|
1595
1585
|
}, label), sortable ? /*#__PURE__*/React.createElement(Icon, {
|
1596
|
-
icon: "
|
1586
|
+
icon: "expand_less",
|
1597
1587
|
size: "small",
|
1598
|
-
clickable: true
|
1599
|
-
|
1588
|
+
clickable: true,
|
1589
|
+
action: function action() {
|
1590
|
+
return changeSort(id);
|
1591
|
+
}
|
1592
|
+
}) : null));
|
1600
1593
|
}), /*#__PURE__*/React.createElement("th", {
|
1601
1594
|
rowSpan: 2,
|
1602
1595
|
colSpan: 1
|
1603
1596
|
})), /*#__PURE__*/React.createElement("tr", null, columns.filter(function (_ref3) {
|
1604
1597
|
var type = _ref3.type;
|
1605
|
-
return type === TYPES.ENTITY;
|
1598
|
+
return type === TYPES$1.ENTITY;
|
1606
1599
|
}).map(function (column) {
|
1607
1600
|
var item = column.item;
|
1608
1601
|
var fields = item ? Object.values(item) : [];
|
@@ -1617,7 +1610,7 @@ var DataTable = function DataTable(props) {
|
|
1617
1610
|
row: row,
|
1618
1611
|
columns: columns,
|
1619
1612
|
onSelect: select,
|
1620
|
-
onDrop:
|
1613
|
+
onDrop: moveRow,
|
1621
1614
|
editable: editable,
|
1622
1615
|
expanded: expanded
|
1623
1616
|
});
|
@@ -1815,7 +1808,7 @@ var DataTableCell = function DataTableCell(_ref4) {
|
|
1815
1808
|
}
|
1816
1809
|
};
|
1817
1810
|
|
1818
|
-
return column.type === TYPES.ENTITY ? /*#__PURE__*/React.createElement(EntityCellViewer, {
|
1811
|
+
return column.type === TYPES$1.ENTITY ? /*#__PURE__*/React.createElement(EntityCellViewer, {
|
1819
1812
|
id: column.id,
|
1820
1813
|
item: column.item,
|
1821
1814
|
value: cell
|
@@ -2620,7 +2613,7 @@ var Planner = function Planner(_ref) {
|
|
2620
2613
|
if (onSelectCell) onSelectCell(lane, date);
|
2621
2614
|
}
|
2622
2615
|
|
2623
|
-
var period = useMemo(function () {
|
2616
|
+
var period = useMemo$1(function () {
|
2624
2617
|
var start = ranges(from, "YYYY-MM-DD");
|
2625
2618
|
var end = ranges(to, "YYYY-MM-DD");
|
2626
2619
|
var range = ranges.range(start, end);
|
@@ -2971,7 +2964,7 @@ var Uploader = function Uploader(_ref) {
|
|
2971
2964
|
onSuccess = _ref.onSuccess,
|
2972
2965
|
onError = _ref.onError,
|
2973
2966
|
onComplete = _ref.onComplete;
|
2974
|
-
var resumable = useMemo(function () {
|
2967
|
+
var resumable = useMemo$1(function () {
|
2975
2968
|
var config = {
|
2976
2969
|
target: target,
|
2977
2970
|
chunkSize: 1 * 1024 * 1024,
|
@@ -3713,12 +3706,12 @@ var ContentFormField = function ContentFormField(props) {
|
|
3713
3706
|
var type = props.type;
|
3714
3707
|
|
3715
3708
|
switch (type) {
|
3716
|
-
case TYPES.BOOLEAN:
|
3709
|
+
case TYPES$1.BOOLEAN:
|
3717
3710
|
return /*#__PURE__*/React.createElement(CheckBox, _extends({
|
3718
3711
|
key: props.id
|
3719
3712
|
}, props));
|
3720
3713
|
|
3721
|
-
case TYPES.NUMBER:
|
3714
|
+
case TYPES$1.NUMBER:
|
3722
3715
|
return /*#__PURE__*/React.createElement(NumberField, _extends({
|
3723
3716
|
key: props.id
|
3724
3717
|
}, props));
|
@@ -3747,7 +3740,7 @@ var StringField = function StringField(_ref2) {
|
|
3747
3740
|
value = _ref2.value,
|
3748
3741
|
onChange = _ref2.onChange,
|
3749
3742
|
outlined = _ref2.outlined;
|
3750
|
-
var fieldTypes = (_fieldTypes = {}, _fieldTypes[TYPES.NUMBER] = 'number', _fieldTypes[TYPES.DATE] = 'date', _fieldTypes);
|
3743
|
+
var fieldTypes = (_fieldTypes = {}, _fieldTypes[TYPES$1.NUMBER] = 'number', _fieldTypes[TYPES$1.DATE] = 'date', _fieldTypes);
|
3751
3744
|
|
3752
3745
|
function buildOptions() {
|
3753
3746
|
var opts = typeof options === 'function' ? options() : options;
|
@@ -3816,6 +3809,30 @@ var NumberField = function NumberField(_ref3) {
|
|
3816
3809
|
});
|
3817
3810
|
};
|
3818
3811
|
|
3812
|
+
var ColorField = function ColorField(props) {
|
3813
|
+
var id = props.id,
|
3814
|
+
_props$label = props.label,
|
3815
|
+
label = _props$label === void 0 ? "Color" : _props$label,
|
3816
|
+
value = props.value,
|
3817
|
+
onChange = props.onChange;
|
3818
|
+
|
3819
|
+
function change(event) {
|
3820
|
+
var color = event.target.value;
|
3821
|
+
if (onChange) onChange(id, color);
|
3822
|
+
}
|
3823
|
+
|
3824
|
+
return /*#__PURE__*/React.createElement("div", {
|
3825
|
+
className: "color-field"
|
3826
|
+
}, /*#__PURE__*/React.createElement("label", {
|
3827
|
+
htmlFor: id
|
3828
|
+
}, label), /*#__PURE__*/React.createElement("input", {
|
3829
|
+
id: id,
|
3830
|
+
type: "color",
|
3831
|
+
onChange: change,
|
3832
|
+
value: value
|
3833
|
+
}));
|
3834
|
+
};
|
3835
|
+
|
3819
3836
|
/**
|
3820
3837
|
* Content Editor
|
3821
3838
|
*/
|
@@ -3956,7 +3973,7 @@ var TreededContentEditor = function TreededContentEditor(_ref3) {
|
|
3956
3973
|
onChange = _ref3.onChange;
|
3957
3974
|
var value = content.value();
|
3958
3975
|
var nodes = Object.values(content.type).filter(function (field) {
|
3959
|
-
return field.type === TYPES.ARRAY;
|
3976
|
+
return field.type === TYPES$1.ARRAY;
|
3960
3977
|
});
|
3961
3978
|
|
3962
3979
|
var _useState2 = useState(),
|
@@ -4043,14 +4060,14 @@ var FieldEditor = function FieldEditor(_ref4) {
|
|
4043
4060
|
return null;
|
4044
4061
|
} else {
|
4045
4062
|
switch (type) {
|
4046
|
-
case TYPES.ENTITY:
|
4063
|
+
case TYPES$1.ENTITY:
|
4047
4064
|
return /*#__PURE__*/React.createElement(EntityEditor, {
|
4048
4065
|
field: field,
|
4049
4066
|
value: value1,
|
4050
4067
|
onChange: change
|
4051
4068
|
});
|
4052
4069
|
|
4053
|
-
case TYPES.STRING:
|
4070
|
+
case TYPES$1.STRING:
|
4054
4071
|
return /*#__PURE__*/React.createElement(StringEditor, {
|
4055
4072
|
outlined: outlined,
|
4056
4073
|
field: field,
|
@@ -4059,7 +4076,7 @@ var FieldEditor = function FieldEditor(_ref4) {
|
|
4059
4076
|
content: content
|
4060
4077
|
});
|
4061
4078
|
|
4062
|
-
case TYPES.BOOLEAN:
|
4079
|
+
case TYPES$1.BOOLEAN:
|
4063
4080
|
return /*#__PURE__*/React.createElement(CheckBox, {
|
4064
4081
|
outlined: true,
|
4065
4082
|
id: id,
|
@@ -4068,7 +4085,7 @@ var FieldEditor = function FieldEditor(_ref4) {
|
|
4068
4085
|
onChange: change
|
4069
4086
|
});
|
4070
4087
|
|
4071
|
-
case TYPES.NUMBER:
|
4088
|
+
case TYPES$1.NUMBER:
|
4072
4089
|
return /*#__PURE__*/React.createElement(NumberEditor, {
|
4073
4090
|
outlined: outlined,
|
4074
4091
|
field: field,
|
@@ -4076,8 +4093,8 @@ var FieldEditor = function FieldEditor(_ref4) {
|
|
4076
4093
|
onChange: change
|
4077
4094
|
});
|
4078
4095
|
|
4079
|
-
case TYPES.ARRAY:
|
4080
|
-
return item === TYPES.STRING ? options ? /*#__PURE__*/React.createElement(MultiSelectionEditor, {
|
4096
|
+
case TYPES$1.ARRAY:
|
4097
|
+
return item === TYPES$1.STRING ? options ? /*#__PURE__*/React.createElement(MultiSelectionEditor, {
|
4081
4098
|
content: content,
|
4082
4099
|
field: field,
|
4083
4100
|
value: value1,
|
@@ -4864,17 +4881,70 @@ var CollectionPage = function CollectionPage(props) {
|
|
4864
4881
|
delay: delay
|
4865
4882
|
}), children ? /*#__PURE__*/React.createElement("article", null, children) : null));
|
4866
4883
|
};
|
4867
|
-
|
4868
4884
|
var CollectionFilters = function CollectionFilters(props) {
|
4869
|
-
|
4870
|
-
|
4871
|
-
|
4885
|
+
var change = function change(next) {
|
4886
|
+
try {
|
4887
|
+
setForm(next);
|
4888
|
+
return Promise.resolve();
|
4889
|
+
} catch (e) {
|
4890
|
+
return Promise.reject(e);
|
4891
|
+
}
|
4892
|
+
};
|
4893
|
+
|
4894
|
+
var schema = props.schema,
|
4895
|
+
onChange = props.onChange;
|
4896
|
+
|
4897
|
+
var _useState = useState({}),
|
4898
|
+
form = _useState[0],
|
4899
|
+
setForm = _useState[1];
|
4900
|
+
|
4901
|
+
var filterSchema = useMemo(function () {
|
4902
|
+
var filterSchema = Object.assign({}, schema);
|
4903
|
+
|
4904
|
+
for (var key in filterSchema) {
|
4905
|
+
if (filterSchema[key].filter === false) {
|
4906
|
+
delete filterSchema[key];
|
4907
|
+
} else {
|
4908
|
+
if (filterSchema[key].type === TYPES.ENTITY) {
|
4909
|
+
var fs = filterSchema[key].item;
|
4910
|
+
|
4911
|
+
for (var key in fs) {
|
4912
|
+
if (fs[key].filter === false) delete fs[key];
|
4913
|
+
}
|
4914
|
+
}
|
4915
|
+
}
|
4916
|
+
}
|
4917
|
+
|
4918
|
+
return filterSchema;
|
4919
|
+
}, [schema]);
|
4920
|
+
useEffect(function () {
|
4921
|
+
if (onChange) onChange(form);
|
4922
|
+
}, [form]);
|
4923
|
+
|
4924
|
+
function clear() {
|
4925
|
+
change({});
|
4926
|
+
}
|
4927
|
+
|
4928
|
+
var content = new Content(filterSchema, form);
|
4929
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
4930
|
+
className: "table-filters",
|
4931
|
+
title: /*#__PURE__*/React.createElement(Text, null, "Filters")
|
4932
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
4933
|
+
icon: "filter_list_off",
|
4934
|
+
size: "small",
|
4935
|
+
clickable: true,
|
4936
|
+
action: clear
|
4937
|
+
})), /*#__PURE__*/React.createElement("main", {
|
4938
|
+
className: "table-filters"
|
4939
|
+
}, /*#__PURE__*/React.createElement(ContentEditor, {
|
4940
|
+
content: content,
|
4941
|
+
onChange: change
|
4942
|
+
})));
|
4872
4943
|
};
|
4873
4944
|
/**
|
4874
4945
|
* Collection List
|
4875
4946
|
*/
|
4876
4947
|
|
4877
|
-
|
4878
4948
|
var CollectionList = function CollectionList(props) {
|
4879
4949
|
var select = function select(id) {
|
4880
4950
|
try {
|
@@ -5044,9 +5114,9 @@ var CollectionEditor = function CollectionEditor(props) {
|
|
5044
5114
|
delay = _props$delay2 === void 0 ? 1000 : _props$delay2;
|
5045
5115
|
var timer = useRef(null);
|
5046
5116
|
|
5047
|
-
var
|
5048
|
-
form =
|
5049
|
-
setForm =
|
5117
|
+
var _useState2 = useState(selected),
|
5118
|
+
form = _useState2[0],
|
5119
|
+
setForm = _useState2[1];
|
5050
5120
|
|
5051
5121
|
useEffect(function () {
|
5052
5122
|
setForm(selected);
|
@@ -5374,19 +5444,19 @@ var FieldViewer = function FieldViewer(props) {
|
|
5374
5444
|
if (optional && value === undefined) return null;
|
5375
5445
|
|
5376
5446
|
switch (type) {
|
5377
|
-
case TYPES.STRING:
|
5447
|
+
case TYPES$1.STRING:
|
5378
5448
|
return /*#__PURE__*/React.createElement(Property, {
|
5379
5449
|
label: label,
|
5380
5450
|
value: value
|
5381
5451
|
});
|
5382
5452
|
|
5383
|
-
case TYPES.ENTITY:
|
5453
|
+
case TYPES$1.ENTITY:
|
5384
5454
|
return /*#__PURE__*/React.createElement(EntityViewer, {
|
5385
5455
|
field: field,
|
5386
5456
|
value: value
|
5387
5457
|
});
|
5388
5458
|
|
5389
|
-
case TYPES.ARRAY:
|
5459
|
+
case TYPES$1.ARRAY:
|
5390
5460
|
return /*#__PURE__*/React.createElement(ArrayViewer, {
|
5391
5461
|
label: label,
|
5392
5462
|
item: item,
|
@@ -5451,12 +5521,12 @@ var ArrayViewer = function ArrayViewer(props) {
|
|
5451
5521
|
var QUERY = {
|
5452
5522
|
id: {
|
5453
5523
|
id: "id",
|
5454
|
-
type: TYPES.STRING,
|
5524
|
+
type: TYPES$1.STRING,
|
5455
5525
|
editable: false
|
5456
5526
|
},
|
5457
5527
|
name: {
|
5458
5528
|
id: "name",
|
5459
|
-
type: TYPES.STRING,
|
5529
|
+
type: TYPES$1.STRING,
|
5460
5530
|
required: true,
|
5461
5531
|
label: "Name"
|
5462
5532
|
}
|
@@ -5949,14 +6019,14 @@ var TableFilters$1 = function TableFilters(props) {
|
|
5949
6019
|
form = _useState3[0],
|
5950
6020
|
setForm = _useState3[1];
|
5951
6021
|
|
5952
|
-
var filterSchema = useMemo(function () {
|
6022
|
+
var filterSchema = useMemo$1(function () {
|
5953
6023
|
var filterSchema = Object.assign({}, schema);
|
5954
6024
|
|
5955
6025
|
for (var key in filterSchema) {
|
5956
6026
|
if (filterSchema[key].filter === false) {
|
5957
6027
|
delete filterSchema[key];
|
5958
6028
|
} else {
|
5959
|
-
if (filterSchema[key].type === TYPES.ENTITY) {
|
6029
|
+
if (filterSchema[key].type === TYPES$1.ENTITY) {
|
5960
6030
|
var fs = filterSchema[key].item;
|
5961
6031
|
|
5962
6032
|
for (var key in fs) {
|
@@ -7017,14 +7087,14 @@ var TableFilters = function TableFilters(props) {
|
|
7017
7087
|
form = _useState4[0],
|
7018
7088
|
setForm = _useState4[1];
|
7019
7089
|
|
7020
|
-
var filterSchema = useMemo(function () {
|
7090
|
+
var filterSchema = useMemo$1(function () {
|
7021
7091
|
var filterSchema = Object.assign({}, schema);
|
7022
7092
|
|
7023
7093
|
for (var key in filterSchema) {
|
7024
7094
|
if (filterSchema[key].filter === false) {
|
7025
7095
|
delete filterSchema[key];
|
7026
7096
|
} else {
|
7027
|
-
if (filterSchema[key].type === TYPES.ENTITY) {
|
7097
|
+
if (filterSchema[key].type === TYPES$1.ENTITY) {
|
7028
7098
|
var fs = filterSchema[key].item;
|
7029
7099
|
|
7030
7100
|
for (var key in fs) {
|
@@ -7038,7 +7108,7 @@ var TableFilters = function TableFilters(props) {
|
|
7038
7108
|
delete filterSchema.flows;
|
7039
7109
|
return filterSchema;
|
7040
7110
|
}, [schema]);
|
7041
|
-
var likes = useMemo(function () {
|
7111
|
+
var likes = useMemo$1(function () {
|
7042
7112
|
var fields = Object.values(schema);
|
7043
7113
|
return fields.reduce(function (likes, field) {
|
7044
7114
|
if (field.like === true) likes.push(field.id);
|
@@ -7575,5 +7645,5 @@ var isFunction = function isFunction(value) {
|
|
7575
7645
|
return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
7576
7646
|
};
|
7577
7647
|
|
7578
|
-
export { Avatar, Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, CollectionTree, Content, ContentEditor, ContentForm, CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, FileExplorer, FileIconsView, 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, TabbedTablePage, TableEditor$1 as TableEditor, TablePage, Tabs, Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile, UploadIcon, Uploader, View, Viewer, WaitScreen, isFunction };
|
7648
|
+
export { Avatar, Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionFilters, CollectionPage, CollectionTree, Content, ContentEditor, ContentForm, CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, FileExplorer, FileIconsView, 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$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TableEditor$1 as TableEditor, TablePage, Tabs, Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile, UploadIcon, Uploader, View, Viewer, WaitScreen, isFunction };
|
7579
7649
|
//# sourceMappingURL=index.modern.js.map
|