ywana-core8 0.0.285 → 0.0.288
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 +8 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -99
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -99
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +1 -1
- package/src/html/checkbox.js +2 -0
- package/src/html/table.js +3 -1
- package/src/html/table.test.js +31 -0
package/dist/index.modern.js
CHANGED
@@ -259,6 +259,8 @@ var CheckBox = function CheckBox(props) {
|
|
259
259
|
onChange = props.onChange;
|
260
260
|
|
261
261
|
function change(event) {
|
262
|
+
event.stopPropagation();
|
263
|
+
event.preventDefault();
|
262
264
|
var value = event.target.checked;
|
263
265
|
if (onChange) onChange(id, value);
|
264
266
|
}
|
@@ -1439,7 +1441,9 @@ var DataTable = function DataTable(props) {
|
|
1439
1441
|
}
|
1440
1442
|
|
1441
1443
|
function select(row, event) {
|
1442
|
-
if (
|
1444
|
+
if (event.target.id !== "checked") {
|
1445
|
+
if (onRowSelection) onRowSelection(row, event);
|
1446
|
+
}
|
1443
1447
|
}
|
1444
1448
|
|
1445
1449
|
function sort(dragged, dropped) {
|
@@ -4169,7 +4173,7 @@ var CollectionAdder = function CollectionAdder(_ref11) {
|
|
4169
4173
|
* Create Content Dialog
|
4170
4174
|
*/
|
4171
4175
|
|
4172
|
-
var CreateContentDialog
|
4176
|
+
var CreateContentDialog = function CreateContentDialog(_ref) {
|
4173
4177
|
var label = _ref.label,
|
4174
4178
|
type = _ref.type,
|
4175
4179
|
_ref$value = _ref.value,
|
@@ -4343,101 +4347,6 @@ var EditContentDialog = function EditContentDialog(_ref) {
|
|
4343
4347
|
}));
|
4344
4348
|
};
|
4345
4349
|
|
4346
|
-
/**
|
4347
|
-
* Create Content Dialog
|
4348
|
-
*/
|
4349
|
-
|
4350
|
-
var CreateContentDialog = function CreateContentDialog(_ref) {
|
4351
|
-
var label = _ref.label,
|
4352
|
-
type = _ref.type,
|
4353
|
-
validator = _ref.validator,
|
4354
|
-
onOK = _ref.onOK,
|
4355
|
-
_ref$onActionClose = _ref.onActionClose,
|
4356
|
-
onActionClose = _ref$onActionClose === void 0 ? true : _ref$onActionClose;
|
4357
|
-
var site = useContext(SiteContext);
|
4358
|
-
|
4359
|
-
var _useState = useState({}),
|
4360
|
-
form = _useState[0],
|
4361
|
-
setForm = _useState[1];
|
4362
|
-
|
4363
|
-
var _useState2 = useState(false),
|
4364
|
-
isValid = _useState2[0],
|
4365
|
-
setValid = _useState2[1];
|
4366
|
-
|
4367
|
-
var _useState3 = useState([]),
|
4368
|
-
errors = _useState3[0],
|
4369
|
-
setErrors = _useState3[1];
|
4370
|
-
|
4371
|
-
function change(form, validForm) {
|
4372
|
-
setForm(form);
|
4373
|
-
|
4374
|
-
if (validator) {
|
4375
|
-
var _validator = validator(form),
|
4376
|
-
validation = _validator.validation,
|
4377
|
-
_validator$errors = _validator.errors,
|
4378
|
-
_errors = _validator$errors === void 0 ? [] : _validator$errors;
|
4379
|
-
|
4380
|
-
setValid(validForm && validation);
|
4381
|
-
setErrors(_errors);
|
4382
|
-
} else {
|
4383
|
-
setValid(validForm);
|
4384
|
-
}
|
4385
|
-
}
|
4386
|
-
|
4387
|
-
function onAction(action) {
|
4388
|
-
if (action === 'OK' && onOK) onOK(form);
|
4389
|
-
if (action === 'CLOSE' || onActionClose === true) site.closeDialog();
|
4390
|
-
}
|
4391
|
-
|
4392
|
-
function isRequired(field) {
|
4393
|
-
var _field$required = field.required,
|
4394
|
-
required = _field$required === void 0 ? false : _field$required;
|
4395
|
-
return required;
|
4396
|
-
}
|
4397
|
-
|
4398
|
-
function isOptional(field) {
|
4399
|
-
var _field$creation = field.creation,
|
4400
|
-
creation = _field$creation === void 0 ? false : _field$creation;
|
4401
|
-
return creation;
|
4402
|
-
}
|
4403
|
-
|
4404
|
-
var actions = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
4405
|
-
label: "CLOSE",
|
4406
|
-
action: function action() {
|
4407
|
-
return onAction("CLOSE");
|
4408
|
-
}
|
4409
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
4410
|
-
label: "OK",
|
4411
|
-
action: function action() {
|
4412
|
-
return onAction("OK");
|
4413
|
-
},
|
4414
|
-
disabled: !isValid,
|
4415
|
-
raised: true
|
4416
|
-
}));
|
4417
|
-
var title = /*#__PURE__*/React.createElement(Text, {
|
4418
|
-
use: "headline6"
|
4419
|
-
}, label);
|
4420
|
-
var content = new Content(type, form);
|
4421
|
-
return /*#__PURE__*/React.createElement(Dialog, {
|
4422
|
-
title: title,
|
4423
|
-
open: true,
|
4424
|
-
onAction: onAction,
|
4425
|
-
actions: actions
|
4426
|
-
}, /*#__PURE__*/React.createElement(ContentForm, {
|
4427
|
-
content: content,
|
4428
|
-
filter: function filter(field) {
|
4429
|
-
return isRequired(field) || isOptional(field);
|
4430
|
-
},
|
4431
|
-
onChange: change
|
4432
|
-
}), errors.map(function (error) {
|
4433
|
-
return /*#__PURE__*/React.createElement(Text, {
|
4434
|
-
use: "overline",
|
4435
|
-
tag: "div",
|
4436
|
-
className: "error"
|
4437
|
-
}, error);
|
4438
|
-
}));
|
4439
|
-
};
|
4440
|
-
|
4441
4350
|
/**
|
4442
4351
|
* Collection Page
|
4443
4352
|
*/
|
@@ -5233,7 +5142,7 @@ var TablePage = function TablePage(props) {
|
|
5233
5142
|
}
|
5234
5143
|
};
|
5235
5144
|
|
5236
|
-
site.openDialog( /*#__PURE__*/React.createElement(CreateContentDialog
|
5145
|
+
site.openDialog( /*#__PURE__*/React.createElement(CreateContentDialog, {
|
5237
5146
|
label: "Crear " + name,
|
5238
5147
|
type: schema,
|
5239
5148
|
onOK: onOK,
|
@@ -5870,5 +5779,5 @@ var isFunction = function isFunction(value) {
|
|
5870
5779
|
return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
5871
5780
|
};
|
5872
5781
|
|
5873
|
-
export { Avatar, Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, Content, ContentEditor, ContentForm, CreateContentDialog
|
5782
|
+
export { Avatar, Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, Content, ContentEditor, ContentForm, CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, 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, TableEditor, TablePage, Tabs, Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile, Uploader, View, Viewer, WaitScreen, isFunction };
|
5874
5783
|
//# sourceMappingURL=index.modern.js.map
|