ywana-core8 0.0.43 → 0.0.47
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 +39 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -1
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +39 -40
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +39 -40
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +17 -9
- package/src/html/button.css +1 -1
- package/src/html/textfield.css +3 -0
package/dist/index.umd.js
CHANGED
@@ -4007,7 +4007,8 @@
|
|
4007
4007
|
groupBy = props.groupBy,
|
4008
4008
|
validator = props.validator,
|
4009
4009
|
scenario = props.scenario,
|
4010
|
-
formFilter = props.formFilter
|
4010
|
+
formFilter = props.formFilter,
|
4011
|
+
tableFilter = props.tableFilter;
|
4011
4012
|
|
4012
4013
|
var _useContext = React.useContext(PageContext),
|
4013
4014
|
pageContext = _useContext[0],
|
@@ -4124,7 +4125,8 @@
|
|
4124
4125
|
schema: schema,
|
4125
4126
|
delay: delay,
|
4126
4127
|
editable: editable,
|
4127
|
-
groupBy: groupBy
|
4128
|
+
groupBy: groupBy,
|
4129
|
+
filter: tableFilter
|
4128
4130
|
})), renderAside());
|
4129
4131
|
};
|
4130
4132
|
/**
|
@@ -4155,9 +4157,12 @@
|
|
4155
4157
|
|
4156
4158
|
var filterSchema = React.useMemo(function () {
|
4157
4159
|
var filterSchema = Object.assign({}, schema);
|
4158
|
-
|
4159
|
-
|
4160
|
-
|
4160
|
+
|
4161
|
+
for (var key in filterSchema) {
|
4162
|
+
if (filterSchema[key].filter === false) delete filterSchema[key];
|
4163
|
+
}
|
4164
|
+
|
4165
|
+
Object.values(filterSchema).forEach(function (field) {
|
4161
4166
|
return field.section = null;
|
4162
4167
|
});
|
4163
4168
|
delete filterSchema.flows;
|
@@ -4169,7 +4174,6 @@
|
|
4169
4174
|
}
|
4170
4175
|
|
4171
4176
|
var content = new Content(filterSchema, form);
|
4172
|
-
console.log(filterSchema, content);
|
4173
4177
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement(Header, {
|
4174
4178
|
title: /*#__PURE__*/React__default["default"].createElement(Text, null, "Filtros")
|
4175
4179
|
}, /*#__PURE__*/React__default["default"].createElement(Button$1, {
|
@@ -4218,7 +4222,8 @@
|
|
4218
4222
|
var icon = props.icon,
|
4219
4223
|
title = props.title,
|
4220
4224
|
schema = props.schema,
|
4221
|
-
editable = props.editable
|
4225
|
+
editable = props.editable,
|
4226
|
+
filter = props.filter;
|
4222
4227
|
|
4223
4228
|
var _useState3 = React.useState(props.groupBy),
|
4224
4229
|
groupBy = _useState3[0],
|
@@ -4246,7 +4251,8 @@
|
|
4246
4251
|
}
|
4247
4252
|
|
4248
4253
|
function renderGroups() {
|
4249
|
-
var
|
4254
|
+
var items = filter ? filter(all) : all;
|
4255
|
+
var groups = items.reduce(function (groups, filter) {
|
4250
4256
|
var groupName = filter[groupBy];
|
4251
4257
|
var group = groups[groupName];
|
4252
4258
|
if (!group) groups[groupName] = [];
|
@@ -4297,40 +4303,33 @@
|
|
4297
4303
|
})));
|
4298
4304
|
});
|
4299
4305
|
}
|
4300
|
-
|
4301
|
-
|
4302
|
-
|
4303
|
-
|
4304
|
-
|
4305
|
-
|
4306
|
-
|
4307
|
-
|
4308
|
-
|
4306
|
+
/* DUPLIDCADO
|
4307
|
+
const table = {
|
4308
|
+
columns: Object.values(schema)
|
4309
|
+
.filter(field => field.column === true)
|
4310
|
+
.map(field => {
|
4311
|
+
let options = field.options;
|
4312
|
+
if (options && typeof (options) == 'function') {
|
4313
|
+
options = options()
|
4314
|
+
}
|
4315
|
+
return {
|
4316
|
+
id: field.id,
|
4317
|
+
label: field.label,
|
4318
|
+
type: field.type,
|
4319
|
+
onChange: field.editable ? change : null,
|
4320
|
+
options
|
4321
|
+
}
|
4322
|
+
}),
|
4323
|
+
rows: all
|
4324
|
+
.map(item => {
|
4325
|
+
item.actions = [<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />]
|
4326
|
+
return item
|
4327
|
+
})
|
4309
4328
|
}
|
4329
|
+
|
4330
|
+
table.columns.push({ id: "actions" })
|
4331
|
+
*/
|
4310
4332
|
|
4311
|
-
return {
|
4312
|
-
id: field.id,
|
4313
|
-
label: field.label,
|
4314
|
-
type: field.type,
|
4315
|
-
onChange: field.editable ? change : null,
|
4316
|
-
options: options
|
4317
|
-
};
|
4318
|
-
}),
|
4319
|
-
rows: all.map(function (item) {
|
4320
|
-
item.actions = [/*#__PURE__*/React__default["default"].createElement(Icon, {
|
4321
|
-
icon: "delete",
|
4322
|
-
size: "small",
|
4323
|
-
clickable: true,
|
4324
|
-
action: function action() {
|
4325
|
-
return remove(item.id);
|
4326
|
-
}
|
4327
|
-
})];
|
4328
|
-
return item;
|
4329
|
-
})
|
4330
|
-
};
|
4331
|
-
table.columns.push({
|
4332
|
-
id: "actions"
|
4333
|
-
});
|
4334
4333
|
|
4335
4334
|
function buildGroupOptions(schema) {
|
4336
4335
|
return Object.values(schema).filter(function (field) {
|