gdx-ui 1.1.0
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/base.css +1 -0
- package/components/autocomplete/Autocomplete.js +128 -0
- package/components/autocomplete/index.js +16 -0
- package/components/badge/Badge.js +33 -0
- package/components/badge/index.js +16 -0
- package/components/box/Box.js +137 -0
- package/components/box/index.js +16 -0
- package/components/button/Button.js +41 -0
- package/components/button/CircleButton.js +33 -0
- package/components/button/index.js +27 -0
- package/components/cards/Card.js +22 -0
- package/components/cards/CardScroller.js +114 -0
- package/components/dialog/ConfirmationDialog.js +43 -0
- package/components/dialog/Dialog.js +141 -0
- package/components/dialog/index.js +27 -0
- package/components/editable/Editable.js +113 -0
- package/components/editable/EditableArea.js +94 -0
- package/components/editable/index.js +27 -0
- package/components/expandable/Expandable.js +73 -0
- package/components/expandable/index.js +16 -0
- package/components/forms/Autocomplete.js +126 -0
- package/components/forms/Form.js +46 -0
- package/components/forms/Input copy.js +133 -0
- package/components/forms/Input.js +108 -0
- package/components/forms/Select.js +54 -0
- package/components/forms/SelectInput.js +74 -0
- package/components/forms/Switch.js +32 -0
- package/components/forms/index.js +71 -0
- package/components/images/Picture.js +61 -0
- package/components/images/Thumb.js +55 -0
- package/components/images/index.js +27 -0
- package/components/index.js +192 -0
- package/components/navbar/Navbar.js +127 -0
- package/components/navbar/index.js +16 -0
- package/components/pagination/Pagination.js +96 -0
- package/components/pagination/index.js +16 -0
- package/components/row/Row.js +77 -0
- package/components/row/index.js +16 -0
- package/components/snackbar/Snackbar.js +35 -0
- package/components/snackbar/index.js +16 -0
- package/components/table/Table.js +132 -0
- package/components/table/index.js +16 -0
- package/components/tabs/Tabs.js +82 -0
- package/components/tabs/index.js +16 -0
- package/components/tree/Tree.js +64 -0
- package/components/util/Alert.js +35 -0
- package/components/util/List.js +28 -0
- package/components/util/Loader.js +13 -0
- package/components/util/Locker.js +13 -0
- package/components/util/Note.js +20 -0
- package/components/util/Separator.js +17 -0
- package/components/util/Skeleton.js +26 -0
- package/components/util/Text.js +28 -0
- package/components/util/Title.js +19 -0
- package/components/util/index.js +104 -0
- package/components/widget/Widget.js +23 -0
- package/components/widget/index.js +16 -0
- package/hooks/index.js +16 -0
- package/hooks/useForm.js +145 -0
- package/hooks/useOutsideClick.js +28 -0
- package/hooks/useScreenDimentions.js +41 -0
- package/index.js +38 -0
- package/layout/AppLayout.js +43 -0
- package/layout/Layout.js +28 -0
- package/layout/Wrapper.js +23 -0
- package/layout/index.js +27 -0
- package/package.json +29 -0
- package/utils/utils.js +69 -0
- package/utils/validations.js +86 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validationsMessages = exports.keyUTF8 = exports.keySizes = exports.keyPhone = exports.keyNumber = exports.keyFloat = exports.keyAlpha = exports.isUTF8 = exports.isSizes = exports.isPhone = exports.isNumber = exports.isFloat = exports.isEmail = exports.isDate = exports.isAreaCode = exports.isAlpha = void 0;
|
|
7
|
+
var _this = void 0;
|
|
8
|
+
var isEmail = exports.isEmail = function isEmail(v) {
|
|
9
|
+
return v == '' || /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
|
|
10
|
+
};
|
|
11
|
+
var isPhone = exports.isPhone = function isPhone(v) {
|
|
12
|
+
return v == '' || /^\(?([0-9]{2})\)?[- ]?([0-9]{4})[- ]?([0-9]{4})$/.test(v);
|
|
13
|
+
};
|
|
14
|
+
var isAreaCode = exports.isAreaCode = function isAreaCode(v) {
|
|
15
|
+
return v == '' || /^\+([0-9]{1,3})$/.test(v);
|
|
16
|
+
};
|
|
17
|
+
var isNumber = exports.isNumber = function isNumber(v) {
|
|
18
|
+
return v == '' || /^\(?([0-9]*)$/.test(v);
|
|
19
|
+
};
|
|
20
|
+
var isFloat = exports.isFloat = function isFloat(v) {
|
|
21
|
+
return v == '' || /^\(?([0-9.]*)$/.test(v);
|
|
22
|
+
};
|
|
23
|
+
var isDate = exports.isDate = function isDate(v) {
|
|
24
|
+
return v == '' || /^\d{1,2}\/\d{1,2}\/\d{4}$/.test(v);
|
|
25
|
+
};
|
|
26
|
+
var isSizes = exports.isSizes = function isSizes(v) {
|
|
27
|
+
return v == '' || /^([0-9]{1,3})x([0-9]{1,3})x([0-9]{1,3})$/.test(v);
|
|
28
|
+
};
|
|
29
|
+
var isAlpha = exports.isAlpha = function isAlpha(v) {
|
|
30
|
+
return v == '' || /^\(?([a-zA-Z0-9 \-#&_%+/|:]*)$/.test(v);
|
|
31
|
+
};
|
|
32
|
+
var isUTF8 = exports.isUTF8 = function isUTF8(v) {
|
|
33
|
+
return v == '' || /^\(?([a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ().\-#&_%+/|:]*)$/.test(v);
|
|
34
|
+
};
|
|
35
|
+
var keyPhone = exports.keyPhone = function keyPhone(_ref) {
|
|
36
|
+
var keyCode = _ref.keyCode;
|
|
37
|
+
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) return false;
|
|
38
|
+
if (_this.value.length == 2 || _this.value.length == 7) _this.value += "-";
|
|
39
|
+
if (_this.value.length > 11) return false;
|
|
40
|
+
};
|
|
41
|
+
function keyAreaCode(_ref2) {
|
|
42
|
+
var which = _ref2.which;
|
|
43
|
+
// +123
|
|
44
|
+
if (this.value.length > 3) return false;
|
|
45
|
+
if (this.value.length == 0 && which == 43) return true;
|
|
46
|
+
if (this.value.length == 0 && which != 43) this.value = "+";
|
|
47
|
+
if (which != 8 && which != 0 && which != 45 && which != 32 && (which < 48 || which > 57)) return false;
|
|
48
|
+
}
|
|
49
|
+
var keySizes = exports.keySizes = function keySizes(_ref3) {
|
|
50
|
+
var which = _ref3.which;
|
|
51
|
+
return !(which != 13 && which != 8 && which != 120 && which != 0 && which != 46 && (which < 48 || which > 57));
|
|
52
|
+
};
|
|
53
|
+
var keyFloat = exports.keyFloat = function keyFloat(_ref4) {
|
|
54
|
+
var which = _ref4.which;
|
|
55
|
+
// keypress
|
|
56
|
+
if (which == 46 && this.value.indexOf(".") >= 0) return false;
|
|
57
|
+
if (which != 13 && which != 8 && which != 0 && which != 46 && (which < 48 || which > 57)) return false;
|
|
58
|
+
return true;
|
|
59
|
+
};
|
|
60
|
+
var keyNumber = exports.keyNumber = function keyNumber(_ref5) {
|
|
61
|
+
var which = _ref5.which;
|
|
62
|
+
// keypress
|
|
63
|
+
if (which != 13 && which != 8 && which != 0 && (which < 48 || which > 57)) return false;
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
var keyAlpha = exports.keyAlpha = function keyAlpha(_ref6) {
|
|
67
|
+
var which = _ref6.which;
|
|
68
|
+
if (which != 8 && which != 0 && which != 32 && which != 35 && which != 37 && which != 38 && which != 43 && which != 45 && which != 47 && which != 58 && which != 95 && which != 124 && (which < 48 || which > 57) && (which < 65 || which > 90) && (which < 97 || which > 122)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return true;
|
|
72
|
+
};
|
|
73
|
+
var keyUTF8 = exports.keyUTF8 = function keyUTF8(_ref7) {
|
|
74
|
+
var which = _ref7.which;
|
|
75
|
+
if (which != 8 && which != 0 && which != 32 && which != 35
|
|
76
|
+
//&& which != 37
|
|
77
|
+
&& which != 40 && which != 41 && which != 43 && which != 45 && which != 46 && which != 47 && which != 95 && which != 58 && which != 38 && which != 124 && which != 209 && which != 241 && (which < 48 || which > 57) && (which < 65 || which > 90) && (which < 97 || which > 122)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
};
|
|
82
|
+
var validationsMessages = exports.validationsMessages = {
|
|
83
|
+
// 'required': [(isEmail), 'El email no es valido'],
|
|
84
|
+
'email': [isEmail, 'El email no es valido'],
|
|
85
|
+
'number': [isNumber, 'El valor debe ser numerico']
|
|
86
|
+
};
|