ywana-core8 0.0.745 → 0.0.747
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 +50 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +50 -29
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +50 -29
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +11 -7
- package/src/widgets/login/ResetPasswordBox.js +20 -13
package/dist/index.cjs
CHANGED
@@ -2654,6 +2654,10 @@ var LoginBox = function LoginBox(_ref) {
|
|
2654
2654
|
var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
2655
2655
|
var logo = _ref.logo,
|
2656
2656
|
title = _ref.title,
|
2657
|
+
_ref$userRequired = _ref.userRequired,
|
2658
|
+
userRequired = _ref$userRequired === void 0 ? true : _ref$userRequired,
|
2659
|
+
_ref$lang = _ref.lang,
|
2660
|
+
lang = _ref$lang === void 0 ? "EN" : _ref$lang,
|
2657
2661
|
children = _ref.children,
|
2658
2662
|
onOK = _ref.onOK,
|
2659
2663
|
onClose = _ref.onClose;
|
@@ -2692,6 +2696,12 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
2692
2696
|
if (onClose) onClose();
|
2693
2697
|
}
|
2694
2698
|
|
2699
|
+
var text = lang === "EN" ? "CHANGE PASSWORD" : "CAMBIO DE CLAVE";
|
2700
|
+
var userLabel = lang === "EN" ? "User" : "Usuario";
|
2701
|
+
var passwordLabel = lang === "EN" ? "New Password" : "Nueva Clave";
|
2702
|
+
var password2Label = lang === "EN" ? "Confirm New Password" : "Confirmar Nueva Clave";
|
2703
|
+
var okLabel = lang === "EN" ? "OK" : "Aceptar";
|
2704
|
+
var cancelLabel = lang === "EN" ? "Cancel" : "Cancelar";
|
2695
2705
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
2696
2706
|
className: "reset-password-box"
|
2697
2707
|
}, /*#__PURE__*/React__default["default"].createElement("header", null, logo ? /*#__PURE__*/React__default["default"].createElement("img", {
|
@@ -2700,20 +2710,20 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
2700
2710
|
className: "title"
|
2701
2711
|
}, /*#__PURE__*/React__default["default"].createElement(Text, null, title)) : null, children), /*#__PURE__*/React__default["default"].createElement("main", null, /*#__PURE__*/React__default["default"].createElement(Text, {
|
2702
2712
|
use: "headline6"
|
2703
|
-
},
|
2713
|
+
}, text), userRequired ? /*#__PURE__*/React__default["default"].createElement(TextField, {
|
2704
2714
|
id: "user",
|
2705
2715
|
outlined: true,
|
2706
2716
|
icon: "person",
|
2707
|
-
label:
|
2717
|
+
label: userLabel,
|
2708
2718
|
lapse: 100,
|
2709
2719
|
onChange: changeField,
|
2710
2720
|
onEnter: ok
|
2711
|
-
}), /*#__PURE__*/React__default["default"].createElement(TextField, {
|
2721
|
+
}) : null, /*#__PURE__*/React__default["default"].createElement(TextField, {
|
2712
2722
|
id: "password1",
|
2713
2723
|
outlined: true,
|
2714
2724
|
icon: "lock",
|
2715
2725
|
type: "password",
|
2716
|
-
label:
|
2726
|
+
label: passwordLabel,
|
2717
2727
|
lapse: 100,
|
2718
2728
|
onChange: changeField,
|
2719
2729
|
onEnter: ok
|
@@ -2722,17 +2732,17 @@ var ResetPasswordBox = function ResetPasswordBox(_ref) {
|
|
2722
2732
|
outlined: true,
|
2723
2733
|
icon: "lock",
|
2724
2734
|
type: "password",
|
2725
|
-
label:
|
2735
|
+
label: password2Label,
|
2726
2736
|
lapse: 100,
|
2727
2737
|
onChange: changeField,
|
2728
2738
|
onEnter: ok
|
2729
2739
|
}), error ? /*#__PURE__*/React__default["default"].createElement("div", {
|
2730
2740
|
className: "error"
|
2731
2741
|
}, error) : null), /*#__PURE__*/React__default["default"].createElement("footer", null, /*#__PURE__*/React__default["default"].createElement(Button, {
|
2732
|
-
label:
|
2742
|
+
label: cancelLabel,
|
2733
2743
|
action: close
|
2734
2744
|
}), /*#__PURE__*/React__default["default"].createElement(Button, {
|
2735
|
-
label:
|
2745
|
+
label: okLabel,
|
2736
2746
|
raised: true,
|
2737
2747
|
disabled: !canOK(),
|
2738
2748
|
action: ok
|
@@ -5976,7 +5986,8 @@ var CollectionPage$1 = function CollectionPage(props) {
|
|
5976
5986
|
groupBy: groupBy,
|
5977
5987
|
onSelect: onSelect,
|
5978
5988
|
searchBy: searchBy,
|
5979
|
-
itemRenderer: listItemRenderer
|
5989
|
+
itemRenderer: listItemRenderer,
|
5990
|
+
sorter: sorter
|
5980
5991
|
})), /*#__PURE__*/React__default["default"].createElement("main", {
|
5981
5992
|
key: id,
|
5982
5993
|
className: "collection-page " + className
|
@@ -6126,7 +6137,8 @@ var CollectionList$1 = function CollectionList(props) {
|
|
6126
6137
|
onSelect = props.onSelect,
|
6127
6138
|
_props$searchBy = props.searchBy,
|
6128
6139
|
searchBy = _props$searchBy === void 0 ? [] : _props$searchBy,
|
6129
|
-
itemRenderer = props.itemRenderer
|
6140
|
+
itemRenderer = props.itemRenderer,
|
6141
|
+
sorter = props.sorter;
|
6130
6142
|
|
6131
6143
|
var _useContext3 = React.useContext(PageContext),
|
6132
6144
|
pageContext = _useContext3[0],
|
@@ -6159,8 +6171,9 @@ var CollectionList$1 = function CollectionList(props) {
|
|
6159
6171
|
return items;
|
6160
6172
|
}
|
6161
6173
|
|
6162
|
-
var
|
6163
|
-
var
|
6174
|
+
var searched = search();
|
6175
|
+
var sorted = sorter ? sorter(searched) : searched;
|
6176
|
+
var items2 = sorted.map(function (content) {
|
6164
6177
|
if (itemRenderer) return itemRenderer(content);
|
6165
6178
|
return {
|
6166
6179
|
id: content.id,
|
@@ -6352,10 +6365,18 @@ var CollectionEditor$1 = function CollectionEditor(props) {
|
|
6352
6365
|
|
6353
6366
|
var remove = function remove() {
|
6354
6367
|
try {
|
6355
|
-
|
6356
|
-
|
6357
|
-
|
6358
|
-
|
6368
|
+
var accept = site.confirm("¿ Esta seguro ?");
|
6369
|
+
|
6370
|
+
var _temp6 = function () {
|
6371
|
+
if (accept === true) {
|
6372
|
+
return Promise.resolve(pageContext.remove(selected.id)).then(function () {
|
6373
|
+
pageContext.clear();
|
6374
|
+
setPageContext(Object.assign({}, pageContext));
|
6375
|
+
});
|
6376
|
+
}
|
6377
|
+
}();
|
6378
|
+
|
6379
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
6359
6380
|
} catch (e) {
|
6360
6381
|
return Promise.reject(e);
|
6361
6382
|
}
|
@@ -6505,7 +6526,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6505
6526
|
try {
|
6506
6527
|
var _this2 = this;
|
6507
6528
|
|
6508
|
-
var
|
6529
|
+
var _temp8 = _catch$5(function () {
|
6509
6530
|
return Promise.resolve(API.all(null, page)).then(function (data) {
|
6510
6531
|
_this2.all = field ? data[field] : data;
|
6511
6532
|
});
|
@@ -6513,7 +6534,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6513
6534
|
console.log(error);
|
6514
6535
|
});
|
6515
6536
|
|
6516
|
-
return Promise.resolve(
|
6537
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
|
6517
6538
|
} catch (e) {
|
6518
6539
|
return Promise.reject(e);
|
6519
6540
|
}
|
@@ -6522,7 +6543,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6522
6543
|
try {
|
6523
6544
|
var _this4 = this;
|
6524
6545
|
|
6525
|
-
var
|
6546
|
+
var _temp10 = function () {
|
6526
6547
|
if (fetching) {
|
6527
6548
|
return Promise.resolve(_this4.fetch(id)).then(function (result) {
|
6528
6549
|
_this4.selected = result;
|
@@ -6536,7 +6557,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6536
6557
|
}
|
6537
6558
|
}();
|
6538
6559
|
|
6539
|
-
return Promise.resolve(
|
6560
|
+
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
|
6540
6561
|
} catch (e) {
|
6541
6562
|
return Promise.reject(e);
|
6542
6563
|
}
|
@@ -6570,7 +6591,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6570
6591
|
try {
|
6571
6592
|
var _this8 = this;
|
6572
6593
|
|
6573
|
-
var
|
6594
|
+
var _temp12 = _catch$5(function () {
|
6574
6595
|
if (versioning) form.version = 1;
|
6575
6596
|
return Promise.resolve(API.create(form)).then(function () {
|
6576
6597
|
return Promise.resolve(_this8.load()).then(function () {});
|
@@ -6579,7 +6600,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6579
6600
|
console.log(error);
|
6580
6601
|
});
|
6581
6602
|
|
6582
|
-
return Promise.resolve(
|
6603
|
+
return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
|
6583
6604
|
} catch (e) {
|
6584
6605
|
return Promise.reject(e);
|
6585
6606
|
}
|
@@ -6588,7 +6609,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6588
6609
|
try {
|
6589
6610
|
var _this10 = this;
|
6590
6611
|
|
6591
|
-
var
|
6612
|
+
var _temp14 = _catch$5(function () {
|
6592
6613
|
if (versioning) form.version = form.version ? form.version + 1 : 1;
|
6593
6614
|
return Promise.resolve(API.update(form)).then(function () {
|
6594
6615
|
return Promise.resolve(_this10.load()).then(function () {});
|
@@ -6597,7 +6618,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6597
6618
|
console.log(error);
|
6598
6619
|
});
|
6599
6620
|
|
6600
|
-
return Promise.resolve(
|
6621
|
+
return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(function () {}) : void 0);
|
6601
6622
|
} catch (e) {
|
6602
6623
|
return Promise.reject(e);
|
6603
6624
|
}
|
@@ -6606,7 +6627,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6606
6627
|
try {
|
6607
6628
|
var _this12 = this;
|
6608
6629
|
|
6609
|
-
var
|
6630
|
+
var _temp16 = _catch$5(function () {
|
6610
6631
|
if (versioning) form.version = form.version ? form.version + 1 : 1;
|
6611
6632
|
return Promise.resolve(API.patch(id, form)).then(function () {
|
6612
6633
|
return Promise.resolve(_this12.load()).then(function () {});
|
@@ -6615,7 +6636,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6615
6636
|
console.log(error);
|
6616
6637
|
});
|
6617
6638
|
|
6618
|
-
return Promise.resolve(
|
6639
|
+
return Promise.resolve(_temp16 && _temp16.then ? _temp16.then(function () {}) : void 0);
|
6619
6640
|
} catch (e) {
|
6620
6641
|
return Promise.reject(e);
|
6621
6642
|
}
|
@@ -6624,7 +6645,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6624
6645
|
try {
|
6625
6646
|
var _this14 = this;
|
6626
6647
|
|
6627
|
-
var
|
6648
|
+
var _temp18 = _catch$5(function () {
|
6628
6649
|
return Promise.resolve(API.updateProperty(id, propertyName, form)).then(function () {
|
6629
6650
|
return Promise.resolve(_this14.load()).then(function () {});
|
6630
6651
|
});
|
@@ -6632,7 +6653,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6632
6653
|
console.log(error);
|
6633
6654
|
});
|
6634
6655
|
|
6635
|
-
return Promise.resolve(
|
6656
|
+
return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(function () {}) : void 0);
|
6636
6657
|
} catch (e) {
|
6637
6658
|
return Promise.reject(e);
|
6638
6659
|
}
|
@@ -6641,7 +6662,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6641
6662
|
try {
|
6642
6663
|
var _this16 = this;
|
6643
6664
|
|
6644
|
-
var
|
6665
|
+
var _temp20 = _catch$5(function () {
|
6645
6666
|
return Promise.resolve(API.remove(id)).then(function () {
|
6646
6667
|
return Promise.resolve(_this16.load()).then(function () {});
|
6647
6668
|
});
|
@@ -6649,7 +6670,7 @@ var CollectionContext$1 = function CollectionContext(url, field, host, page, fet
|
|
6649
6670
|
console.log(error);
|
6650
6671
|
});
|
6651
6672
|
|
6652
|
-
return Promise.resolve(
|
6673
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(function () {}) : void 0);
|
6653
6674
|
} catch (e) {
|
6654
6675
|
return Promise.reject(e);
|
6655
6676
|
}
|