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.umd.js CHANGED
@@ -262,6 +262,8 @@
262
262
  onChange = props.onChange;
263
263
 
264
264
  function change(event) {
265
+ event.stopPropagation();
266
+ event.preventDefault();
265
267
  var value = event.target.checked;
266
268
  if (onChange) onChange(id, value);
267
269
  }
@@ -1442,7 +1444,9 @@
1442
1444
  }
1443
1445
 
1444
1446
  function select(row, event) {
1445
- if (onRowSelection) onRowSelection(row, event);
1447
+ if (event.target.id !== "checked") {
1448
+ if (onRowSelection) onRowSelection(row, event);
1449
+ }
1446
1450
  }
1447
1451
 
1448
1452
  function sort(dragged, dropped) {
@@ -4172,7 +4176,7 @@
4172
4176
  * Create Content Dialog
4173
4177
  */
4174
4178
 
4175
- var CreateContentDialog$1 = function CreateContentDialog(_ref) {
4179
+ var CreateContentDialog = function CreateContentDialog(_ref) {
4176
4180
  var label = _ref.label,
4177
4181
  type = _ref.type,
4178
4182
  _ref$value = _ref.value,
@@ -4346,101 +4350,6 @@
4346
4350
  }));
4347
4351
  };
4348
4352
 
4349
- /**
4350
- * Create Content Dialog
4351
- */
4352
-
4353
- var CreateContentDialog = function CreateContentDialog(_ref) {
4354
- var label = _ref.label,
4355
- type = _ref.type,
4356
- validator = _ref.validator,
4357
- onOK = _ref.onOK,
4358
- _ref$onActionClose = _ref.onActionClose,
4359
- onActionClose = _ref$onActionClose === void 0 ? true : _ref$onActionClose;
4360
- var site = React.useContext(SiteContext);
4361
-
4362
- var _useState = React.useState({}),
4363
- form = _useState[0],
4364
- setForm = _useState[1];
4365
-
4366
- var _useState2 = React.useState(false),
4367
- isValid = _useState2[0],
4368
- setValid = _useState2[1];
4369
-
4370
- var _useState3 = React.useState([]),
4371
- errors = _useState3[0],
4372
- setErrors = _useState3[1];
4373
-
4374
- function change(form, validForm) {
4375
- setForm(form);
4376
-
4377
- if (validator) {
4378
- var _validator = validator(form),
4379
- validation = _validator.validation,
4380
- _validator$errors = _validator.errors,
4381
- _errors = _validator$errors === void 0 ? [] : _validator$errors;
4382
-
4383
- setValid(validForm && validation);
4384
- setErrors(_errors);
4385
- } else {
4386
- setValid(validForm);
4387
- }
4388
- }
4389
-
4390
- function onAction(action) {
4391
- if (action === 'OK' && onOK) onOK(form);
4392
- if (action === 'CLOSE' || onActionClose === true) site.closeDialog();
4393
- }
4394
-
4395
- function isRequired(field) {
4396
- var _field$required = field.required,
4397
- required = _field$required === void 0 ? false : _field$required;
4398
- return required;
4399
- }
4400
-
4401
- function isOptional(field) {
4402
- var _field$creation = field.creation,
4403
- creation = _field$creation === void 0 ? false : _field$creation;
4404
- return creation;
4405
- }
4406
-
4407
- var actions = /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement(Button, {
4408
- label: "CLOSE",
4409
- action: function action() {
4410
- return onAction("CLOSE");
4411
- }
4412
- }), /*#__PURE__*/React__default["default"].createElement(Button, {
4413
- label: "OK",
4414
- action: function action() {
4415
- return onAction("OK");
4416
- },
4417
- disabled: !isValid,
4418
- raised: true
4419
- }));
4420
- var title = /*#__PURE__*/React__default["default"].createElement(Text, {
4421
- use: "headline6"
4422
- }, label);
4423
- var content = new Content(type, form);
4424
- return /*#__PURE__*/React__default["default"].createElement(Dialog, {
4425
- title: title,
4426
- open: true,
4427
- onAction: onAction,
4428
- actions: actions
4429
- }, /*#__PURE__*/React__default["default"].createElement(ContentForm, {
4430
- content: content,
4431
- filter: function filter(field) {
4432
- return isRequired(field) || isOptional(field);
4433
- },
4434
- onChange: change
4435
- }), errors.map(function (error) {
4436
- return /*#__PURE__*/React__default["default"].createElement(Text, {
4437
- use: "overline",
4438
- tag: "div",
4439
- className: "error"
4440
- }, error);
4441
- }));
4442
- };
4443
-
4444
4353
  /**
4445
4354
  * Collection Page
4446
4355
  */
@@ -5236,7 +5145,7 @@
5236
5145
  }
5237
5146
  };
5238
5147
 
5239
- site.openDialog( /*#__PURE__*/React__default["default"].createElement(CreateContentDialog$1, {
5148
+ site.openDialog( /*#__PURE__*/React__default["default"].createElement(CreateContentDialog, {
5240
5149
  label: "Crear " + name,
5241
5150
  type: schema,
5242
5151
  onOK: onOK,
@@ -5885,7 +5794,7 @@
5885
5794
  exports.Content = Content;
5886
5795
  exports.ContentEditor = ContentEditor;
5887
5796
  exports.ContentForm = ContentForm;
5888
- exports.CreateContentDialog = CreateContentDialog$1;
5797
+ exports.CreateContentDialog = CreateContentDialog;
5889
5798
  exports.DataTable = DataTable;
5890
5799
  exports.Dialog = Dialog;
5891
5800
  exports.DropDown = DropDown;