@unbxd-ui/unbxd-react-components 0.2.101-beta.3 → 0.2.101-beta.5
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/components/Accordian/Accordian.js +13 -45
- package/components/Accordian/Accordian.stories.js +6 -25
- package/components/Accordian/index.js +0 -3
- package/components/Button/Button.js +9 -26
- package/components/Button/Button.stories.js +1 -14
- package/components/Button/DropdownButton.js +9 -31
- package/components/Button/DropdownButton.stories.js +6 -23
- package/components/Button/index.js +1 -8
- package/components/DataLoader/DataLoader.js +10 -40
- package/components/DataLoader/DataLoader.stories.js +5 -30
- package/components/DataLoader/index.js +0 -3
- package/components/Form/Checkbox.js +14 -42
- package/components/Form/DragDropFileUploader.js +12 -42
- package/components/Form/Dropdown.js +77 -172
- package/components/Form/FileUploader.js +10 -32
- package/components/Form/Form.js +15 -45
- package/components/Form/FormElementWrapper.js +2 -7
- package/components/Form/Input.js +27 -72
- package/components/Form/RadioList.js +17 -48
- package/components/Form/RangeSlider.js +32 -72
- package/components/Form/ServerPaginatedDDList.js +74 -125
- package/components/Form/Textarea.js +18 -43
- package/components/Form/Toggle.js +16 -48
- package/components/Form/index.js +18 -30
- package/components/Form/stories/Checkbox.stories.js +1 -12
- package/components/Form/stories/DragDropFileUploader.stories.js +0 -8
- package/components/Form/stories/Dropdown.stories.js +6 -24
- package/components/Form/stories/FileUploader.stories.js +0 -8
- package/components/Form/stories/FormDefault.stories.js +1 -21
- package/components/Form/stories/RadioList.stories.js +1 -12
- package/components/Form/stories/RangeSlider.stories.js +1 -15
- package/components/Form/stories/TextInput.stories.js +3 -19
- package/components/Form/stories/Textarea.stories.js +1 -12
- package/components/Form/stories/Toggle.stories.js +0 -7
- package/components/Form/stories/form.stories.js +3 -40
- package/components/InlineModal/InlineModal.js +14 -51
- package/components/InlineModal/InlineModal.stories.js +2 -14
- package/components/InlineModal/index.js +1 -6
- package/components/List/List.js +9 -24
- package/components/List/index.js +0 -3
- package/components/List/list.stories.js +0 -10
- package/components/Modal/Modal.js +17 -49
- package/components/Modal/Modal.stories.js +1 -15
- package/components/Modal/index.js +0 -3
- package/components/NotificationComponent/NotificationComponent.js +11 -34
- package/components/NotificationComponent/NotificationComponent.stories.js +0 -6
- package/components/NotificationComponent/index.js +0 -3
- package/components/ProgressBar/ProgressBar.js +2 -11
- package/components/ProgressBar/ProgressBar.stories.js +0 -6
- package/components/ProgressBar/index.js +0 -3
- package/components/Table/BaseTable.js +69 -134
- package/components/Table/PaginationComponent.js +11 -23
- package/components/Table/Table.js +68 -149
- package/components/Table/Table.stories.js +22 -67
- package/components/Table/index.js +0 -4
- package/components/TabsComponent/TabsComponent.js +20 -57
- package/components/TabsComponent/TabsComponent.stories.js +0 -16
- package/components/TabsComponent/index.js +0 -3
- package/components/Tooltip/Tooltip.js +15 -46
- package/components/Tooltip/Tooltip.stories.js +0 -6
- package/components/Tooltip/index.js +0 -3
- package/components/core.css +0 -1
- package/components/index.js +1 -17
- package/components/theme.css +0 -1
- package/core/Validators.js +1 -5
- package/core/customHooks.js +4 -14
- package/core/dataLoader.js +28 -67
- package/core/dataLoader.stories.js +12 -42
- package/core/index.js +6 -10
- package/core/utils.js +10 -18
- package/index.js +0 -4
- package/package.json +1 -1
package/core/utils.js
CHANGED
|
@@ -4,17 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _Validators = _interopRequireDefault(require("./Validators"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
15
|
var uniqueCounter = 1;
|
|
19
16
|
var utils = {
|
|
20
17
|
configs: {},
|
|
@@ -40,7 +37,7 @@ var utils = {
|
|
|
40
37
|
},
|
|
41
38
|
getPagIndex: function getPagIndex(pageConfig) {
|
|
42
39
|
var perPageCount = pageConfig.perPageCount,
|
|
43
|
-
|
|
40
|
+
pageNo = pageConfig.pageNo;
|
|
44
41
|
var startIndex = (pageNo - 1) * perPageCount;
|
|
45
42
|
var endIndex = pageNo * perPageCount;
|
|
46
43
|
return {
|
|
@@ -52,13 +49,11 @@ var utils = {
|
|
|
52
49
|
var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
50
|
var omitKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
54
51
|
var newObject = {};
|
|
55
|
-
|
|
56
52
|
for (var key in object) {
|
|
57
53
|
if (omitKeys.indexOf(key) === -1) {
|
|
58
54
|
newObject[key] = object[key];
|
|
59
55
|
}
|
|
60
56
|
}
|
|
61
|
-
|
|
62
57
|
return newObject;
|
|
63
58
|
},
|
|
64
59
|
getUniqueId: function getUniqueId() {
|
|
@@ -71,7 +66,7 @@ var utils = {
|
|
|
71
66
|
var timeout;
|
|
72
67
|
return function () {
|
|
73
68
|
var context = this,
|
|
74
|
-
|
|
69
|
+
args = arguments;
|
|
75
70
|
clearTimeout(timeout);
|
|
76
71
|
timeout = setTimeout(function () {
|
|
77
72
|
timeout = null;
|
|
@@ -82,20 +77,17 @@ var utils = {
|
|
|
82
77
|
checkIfValid: function checkIfValid(value, validations) {
|
|
83
78
|
var isValidValue = true;
|
|
84
79
|
var errorMessage;
|
|
85
|
-
|
|
86
80
|
for (var i = 0; i < validations.length; i++) {
|
|
87
81
|
var validationObj = validations[i];
|
|
88
82
|
var type = validationObj.type,
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
_validationObj$messag = validationObj.message,
|
|
84
|
+
message = _validationObj$messag === void 0 ? "Invalid field value" : _validationObj$messag;
|
|
91
85
|
isValidValue = _Validators["default"][type](value, validationObj);
|
|
92
|
-
|
|
93
86
|
if (!isValidValue) {
|
|
94
87
|
errorMessage = message;
|
|
95
88
|
break;
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
|
-
|
|
99
91
|
return {
|
|
100
92
|
isValid: isValidValue,
|
|
101
93
|
error: errorMessage
|
package/index.js
CHANGED
|
@@ -183,11 +183,7 @@ Object.defineProperty(exports, "utils", {
|
|
|
183
183
|
return _core.utils;
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
|
-
|
|
187
186
|
var _components = require("./components");
|
|
188
|
-
|
|
189
187
|
var _core = require("./core");
|
|
190
|
-
|
|
191
188
|
var _Button = require("./components/Button");
|
|
192
|
-
|
|
193
189
|
var _InlineModal = require("./components/InlineModal");
|