ywana-core8 0.0.44 → 0.0.48
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 +34 -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 +34 -40
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +34 -40
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +9 -6
- package/src/html/button.css +1 -1
- package/src/html/section.js +1 -1
- package/src/html/textfield.css +3 -0
package/dist/index.umd.js
CHANGED
@@ -772,9 +772,7 @@
|
|
772
772
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
773
773
|
className: "section2 " + className
|
774
774
|
}, /*#__PURE__*/React__default["default"].createElement(Header, {
|
775
|
-
icon:
|
776
|
-
icon: icon
|
777
|
-
},
|
775
|
+
icon: icon,
|
778
776
|
title: title
|
779
777
|
}, actions, canCollapse ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
780
778
|
icon: "expand_more",
|
@@ -4007,7 +4005,8 @@
|
|
4007
4005
|
groupBy = props.groupBy,
|
4008
4006
|
validator = props.validator,
|
4009
4007
|
scenario = props.scenario,
|
4010
|
-
formFilter = props.formFilter
|
4008
|
+
formFilter = props.formFilter,
|
4009
|
+
tableFilter = props.tableFilter;
|
4011
4010
|
|
4012
4011
|
var _useContext = React.useContext(PageContext),
|
4013
4012
|
pageContext = _useContext[0],
|
@@ -4124,7 +4123,8 @@
|
|
4124
4123
|
schema: schema,
|
4125
4124
|
delay: delay,
|
4126
4125
|
editable: editable,
|
4127
|
-
groupBy: groupBy
|
4126
|
+
groupBy: groupBy,
|
4127
|
+
filter: tableFilter
|
4128
4128
|
})), renderAside());
|
4129
4129
|
};
|
4130
4130
|
/**
|
@@ -4172,7 +4172,6 @@
|
|
4172
4172
|
}
|
4173
4173
|
|
4174
4174
|
var content = new Content(filterSchema, form);
|
4175
|
-
console.log(filterSchema, content);
|
4176
4175
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement(Header, {
|
4177
4176
|
title: /*#__PURE__*/React__default["default"].createElement(Text, null, "Filtros")
|
4178
4177
|
}, /*#__PURE__*/React__default["default"].createElement(Button$1, {
|
@@ -4221,7 +4220,8 @@
|
|
4221
4220
|
var icon = props.icon,
|
4222
4221
|
title = props.title,
|
4223
4222
|
schema = props.schema,
|
4224
|
-
editable = props.editable
|
4223
|
+
editable = props.editable,
|
4224
|
+
filter = props.filter;
|
4225
4225
|
|
4226
4226
|
var _useState3 = React.useState(props.groupBy),
|
4227
4227
|
groupBy = _useState3[0],
|
@@ -4249,7 +4249,8 @@
|
|
4249
4249
|
}
|
4250
4250
|
|
4251
4251
|
function renderGroups() {
|
4252
|
-
var
|
4252
|
+
var items = filter ? filter(all) : all;
|
4253
|
+
var groups = items.reduce(function (groups, filter) {
|
4253
4254
|
var groupName = filter[groupBy];
|
4254
4255
|
var group = groups[groupName];
|
4255
4256
|
if (!group) groups[groupName] = [];
|
@@ -4300,40 +4301,33 @@
|
|
4300
4301
|
})));
|
4301
4302
|
});
|
4302
4303
|
}
|
4303
|
-
|
4304
|
-
|
4305
|
-
|
4306
|
-
|
4307
|
-
|
4308
|
-
|
4309
|
-
|
4310
|
-
|
4311
|
-
|
4304
|
+
/* DUPLIDCADO
|
4305
|
+
const table = {
|
4306
|
+
columns: Object.values(schema)
|
4307
|
+
.filter(field => field.column === true)
|
4308
|
+
.map(field => {
|
4309
|
+
let options = field.options;
|
4310
|
+
if (options && typeof (options) == 'function') {
|
4311
|
+
options = options()
|
4312
|
+
}
|
4313
|
+
return {
|
4314
|
+
id: field.id,
|
4315
|
+
label: field.label,
|
4316
|
+
type: field.type,
|
4317
|
+
onChange: field.editable ? change : null,
|
4318
|
+
options
|
4319
|
+
}
|
4320
|
+
}),
|
4321
|
+
rows: all
|
4322
|
+
.map(item => {
|
4323
|
+
item.actions = [<Icon icon="delete" size="small" clickable action={() => remove(item.id)} />]
|
4324
|
+
return item
|
4325
|
+
})
|
4312
4326
|
}
|
4327
|
+
|
4328
|
+
table.columns.push({ id: "actions" })
|
4329
|
+
*/
|
4313
4330
|
|
4314
|
-
return {
|
4315
|
-
id: field.id,
|
4316
|
-
label: field.label,
|
4317
|
-
type: field.type,
|
4318
|
-
onChange: field.editable ? change : null,
|
4319
|
-
options: options
|
4320
|
-
};
|
4321
|
-
}),
|
4322
|
-
rows: all.map(function (item) {
|
4323
|
-
item.actions = [/*#__PURE__*/React__default["default"].createElement(Icon, {
|
4324
|
-
icon: "delete",
|
4325
|
-
size: "small",
|
4326
|
-
clickable: true,
|
4327
|
-
action: function action() {
|
4328
|
-
return remove(item.id);
|
4329
|
-
}
|
4330
|
-
})];
|
4331
|
-
return item;
|
4332
|
-
})
|
4333
|
-
};
|
4334
|
-
table.columns.push({
|
4335
|
-
id: "actions"
|
4336
|
-
});
|
4337
4331
|
|
4338
4332
|
function buildGroupOptions(schema) {
|
4339
4333
|
return Object.values(schema).filter(function (field) {
|