ywana-core8 0.0.134 → 0.0.138
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 +46 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +12 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +46 -17
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +46 -17
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/TablePage.js +6 -6
- package/src/html/textfield-outlined.css +6 -0
- package/src/html/textfield.css +6 -0
- package/src/html/textfield.js +31 -13
package/dist/index.umd.js
CHANGED
@@ -921,7 +921,9 @@
|
|
921
921
|
_props$options = props.options,
|
922
922
|
options = _props$options === void 0 ? [] : _props$options,
|
923
923
|
value = props.value,
|
924
|
-
onChange = props.onChange
|
924
|
+
onChange = props.onChange,
|
925
|
+
_props$canFilter = props.canFilter,
|
926
|
+
canFilter = _props$canFilter === void 0 ? false : _props$canFilter;
|
925
927
|
|
926
928
|
var _useState = React.useState(false),
|
927
929
|
open = _useState[0],
|
@@ -931,6 +933,9 @@
|
|
931
933
|
label = _useState2[0],
|
932
934
|
setLabel = _useState2[1];
|
933
935
|
|
936
|
+
var _useState3 = React.useState(),
|
937
|
+
filter = _useState3[0];
|
938
|
+
|
934
939
|
React.useEffect(function () {
|
935
940
|
if (Array.isArray(options)) {
|
936
941
|
var option = options.find(function (option) {
|
@@ -940,6 +945,14 @@
|
|
940
945
|
}
|
941
946
|
}, [value]);
|
942
947
|
|
948
|
+
function change(id, value) {
|
949
|
+
if (canFilter) {
|
950
|
+
setFilter(value);
|
951
|
+
} else {
|
952
|
+
if (onChange) onChange(id, value);
|
953
|
+
}
|
954
|
+
}
|
955
|
+
|
943
956
|
function toggle() {
|
944
957
|
if (site) {
|
945
958
|
site.changeFocus({
|
@@ -962,11 +975,20 @@
|
|
962
975
|
setOpen(false);
|
963
976
|
}
|
964
977
|
|
978
|
+
var items = open == true && Array.isArray(options) ? options.filter(function (option) {
|
979
|
+
return canFilter === false || filter.toUpperCase().indexOf(option.label.toUpperCase()) >= 0;
|
980
|
+
}).map(function (option) {
|
981
|
+
return /*#__PURE__*/React__default["default"].createElement("li", {
|
982
|
+
key: option.value,
|
983
|
+
value: option.value
|
984
|
+
}, option.label);
|
985
|
+
}) : null;
|
965
986
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
966
987
|
className: "dropdown"
|
967
988
|
}, /*#__PURE__*/React__default["default"].createElement(TextField, _extends({}, props, {
|
968
989
|
onClick: toggle,
|
969
|
-
value: label
|
990
|
+
value: label,
|
991
|
+
onChange: change
|
970
992
|
})), /*#__PURE__*/React__default["default"].createElement(Icon, {
|
971
993
|
icon: "expand_more",
|
972
994
|
clickable: true,
|
@@ -974,12 +996,7 @@
|
|
974
996
|
action: toggle
|
975
997
|
}), open == true ? /*#__PURE__*/React__default["default"].createElement("menu", null, /*#__PURE__*/React__default["default"].createElement("ul", {
|
976
998
|
onClick: select
|
977
|
-
},
|
978
|
-
return /*#__PURE__*/React__default["default"].createElement("li", {
|
979
|
-
key: option.value,
|
980
|
-
value: option.value
|
981
|
-
}, option.label);
|
982
|
-
}) : null)) : null);
|
999
|
+
}, items)) : null);
|
983
1000
|
};
|
984
1001
|
|
985
1002
|
var isFunction$1 = function isFunction(value) {
|
@@ -4083,6 +4100,8 @@
|
|
4083
4100
|
_props$dev = props.dev,
|
4084
4101
|
dev = _props$dev === void 0 ? false : _props$dev,
|
4085
4102
|
tableActions = props.tableActions,
|
4103
|
+
_props$selectionActio = props.selectionActions,
|
4104
|
+
selectionActions = _props$selectionActio === void 0 ? [] : _props$selectionActio,
|
4086
4105
|
editable = props.editable,
|
4087
4106
|
_props$canFilter = props.canFilter,
|
4088
4107
|
canFilter = _props$canFilter === void 0 ? false : _props$canFilter,
|
@@ -4184,7 +4203,7 @@
|
|
4184
4203
|
onClose: closeAside
|
4185
4204
|
}) : null, rowChecked ? /*#__PURE__*/React__default["default"].createElement(TableSelector, {
|
4186
4205
|
schema: schema,
|
4187
|
-
|
4206
|
+
actions: selectionActions
|
4188
4207
|
}) : null);
|
4189
4208
|
}
|
4190
4209
|
|
@@ -4268,7 +4287,6 @@
|
|
4268
4287
|
var rows = all.filter(function (item) {
|
4269
4288
|
return checked.has(item.id);
|
4270
4289
|
});
|
4271
|
-
console.log(count, rows);
|
4272
4290
|
var table = {
|
4273
4291
|
columns: [{
|
4274
4292
|
id: "idMatricula",
|
@@ -4276,11 +4294,22 @@
|
|
4276
4294
|
}],
|
4277
4295
|
rows: rows || []
|
4278
4296
|
};
|
4297
|
+
var buttons = actions.map(function (_ref) {
|
4298
|
+
var label = _ref.label,
|
4299
|
+
_action = _ref.action;
|
4300
|
+
return /*#__PURE__*/React__default["default"].createElement(Button$1, {
|
4301
|
+
label: label,
|
4302
|
+
raised: true,
|
4303
|
+
action: function action() {
|
4304
|
+
return _action(rows);
|
4305
|
+
}
|
4306
|
+
});
|
4307
|
+
});
|
4279
4308
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
4280
4309
|
className: "table-selector"
|
4281
4310
|
}, /*#__PURE__*/React__default["default"].createElement(Header, {
|
4282
4311
|
title: "Selection"
|
4283
|
-
}, count), /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(DataTable, table)), /*#__PURE__*/React__default["default"].createElement("footer", null,
|
4312
|
+
}, count), /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(DataTable, table)), /*#__PURE__*/React__default["default"].createElement("footer", null, buttons));
|
4284
4313
|
};
|
4285
4314
|
/**
|
4286
4315
|
* Table Queries
|
@@ -4481,20 +4510,20 @@
|
|
4481
4510
|
}),
|
4482
4511
|
rows: groups[groupName].map(function (item) {
|
4483
4512
|
item.checked = pageContext.checked ? pageContext.checked.has(item.id) : false;
|
4484
|
-
item.actions = actions ? actions.map(function (
|
4485
|
-
return
|
4486
|
-
icon:
|
4513
|
+
item.actions = actions ? actions.map(function (_action2) {
|
4514
|
+
return _action2.filter ? _action2.filter(item) ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
4515
|
+
icon: _action2.icon,
|
4487
4516
|
clickable: true,
|
4488
4517
|
size: "small",
|
4489
4518
|
action: function action() {
|
4490
|
-
return run(
|
4519
|
+
return run(_action2, item);
|
4491
4520
|
}
|
4492
4521
|
}) : null : /*#__PURE__*/React__default["default"].createElement(Icon, {
|
4493
|
-
icon:
|
4522
|
+
icon: _action2.icon,
|
4494
4523
|
clickable: true,
|
4495
4524
|
size: "small",
|
4496
4525
|
action: function action() {
|
4497
|
-
return run(
|
4526
|
+
return run(_action2, item);
|
4498
4527
|
}
|
4499
4528
|
});
|
4500
4529
|
}) : [];
|