tenjin-ui-kit 0.3.67 → 0.3.69
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/.dockerignore +6 -0
- package/.storybook/main.js +16 -0
- package/.storybook/preview.js +11 -0
- package/Dockerfile +17 -0
- package/Jenkinsfile +66 -0
- package/build/asset-manifest.json +16 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/css/main.e7366529.css +2 -0
- package/build/static/css/main.e7366529.css.map +1 -0
- package/build/static/js/453.900c81c3.chunk.js +2 -0
- package/build/static/js/453.900c81c3.chunk.js.map +1 -0
- package/build/static/js/main.8abb72fa.js +3 -0
- package/build/static/js/main.8abb72fa.js.LICENSE.txt +61 -0
- package/build/static/js/main.8abb72fa.js.map +1 -0
- package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +1 -0
- package/build/tenjinLogo.png +0 -0
- package/dist/README.md +13 -0
- package/dist/common/hooks/apiHooks.js +155 -0
- package/dist/common/hooks/newApiHook.js +188 -0
- package/{common → dist/common}/utils/security/index.js +2 -2
- package/{common → dist/common}/utils/security/securityConfig.js +1 -2
- package/dist/components/Canvas.js +330 -0
- package/dist/components/DragBox/index.js +40 -0
- package/dist/components/InputWithChip/index.js +294 -0
- package/{components → dist/components}/RightContext/index.js +19 -28
- package/dist/components/WorkFlow.js +42 -0
- package/dist/components/WorkFlowBuilder.js +115 -0
- package/dist/components/alert/Style.js +20 -0
- package/dist/components/alert/index.js +67 -0
- package/{components → dist/components}/attachment/index.js +21 -28
- package/{components → dist/components}/authenticationProvider/AuthError.js +3 -4
- package/{components → dist/components}/authenticationProvider/AuthLoader.js +3 -4
- package/dist/components/authenticationProvider/index.js +110 -0
- package/{components → dist/components}/avatar/index.js +13 -14
- package/dist/components/avatar/styles.js +91 -0
- package/dist/components/breadCrumbs/index.js +169 -0
- package/{components → dist/components}/breadCrumbs/style.js +1 -4
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
- package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
- package/{components → dist/components}/browsingTestCaseLayout/index.js +25 -30
- package/dist/components/button/index.js +133 -0
- package/{components → dist/components}/chatBotModal/index.js +36 -45
- package/dist/components/checkBox/index.js +29 -0
- package/{components → dist/components}/combobox/index.js +51 -72
- package/dist/components/divider/index.js +37 -0
- package/{components → dist/components}/editableField/index.js +19 -28
- package/{components → dist/components}/error/index.js +6 -12
- package/dist/components/errorBoundary/index.js +140 -0
- package/dist/components/fileUploader/index.js +151 -0
- package/dist/components/fileUploader/style.js +57 -0
- package/dist/components/filter/ValueSelector.js +333 -0
- package/{components → dist/components}/filter/index.js +31 -36
- package/{components → dist/components}/iconButton/index.js +3 -4
- package/dist/components/input/index.js +167 -0
- package/dist/components/layout/index.js +94 -0
- package/dist/components/layout/main/index.js +24 -0
- package/dist/components/layout/main/style.js +19 -0
- package/{components → dist/components}/layout/pageContent/index.js +6 -7
- package/dist/components/layout/sidebar/FlatMenu.js +64 -0
- package/dist/components/layout/sidebar/GroupedIconMenu.js +233 -0
- package/dist/components/layout/sidebar/GroupedMenu.js +57 -0
- package/dist/components/layout/sidebar/ProjectMenu.js +223 -0
- package/dist/components/layout/sidebar/index.js +88 -0
- package/dist/components/layout/sidebar/style.js +149 -0
- package/{components → dist/components}/layout/topBar/ProjectTopbar.js +81 -98
- package/dist/components/layout/topBar/UserAvatar.js +138 -0
- package/dist/components/layout/topBar/index.js +121 -0
- package/{components → dist/components}/loader/index.js +9 -12
- package/dist/components/menu/index.js +71 -0
- package/{components → dist/components}/modal/Modal.js +5 -6
- package/dist/components/modal/index.js +88 -0
- package/dist/components/modal/style.js +65 -0
- package/dist/components/optionMenu/index.js +105 -0
- package/dist/components/pagination/index.js +114 -0
- package/dist/components/pagination/style.js +33 -0
- package/dist/components/paginationUpdated/index.js +73 -0
- package/dist/components/paper/index.js +43 -0
- package/dist/components/paper/style.js +31 -0
- package/dist/components/reactSelect/index.js +195 -0
- package/dist/components/reactSelect/style.js +130 -0
- package/dist/components/richTextEditor/index.js +64 -0
- package/dist/components/select/GroupedSelect.js +167 -0
- package/dist/components/select/SimpleSelect.js +184 -0
- package/{components → dist/components}/select/index.js +38 -54
- package/dist/components/simpleSelect/index.js +53 -0
- package/{components → dist/components}/sort/index.js +19 -22
- package/{components → dist/components}/switch/index.js +10 -11
- package/dist/components/switch/style.js +39 -0
- package/{components → dist/components}/switch/switch.js +17 -23
- package/dist/components/table/ReactTable.js +101 -0
- package/dist/components/table/SimpleTable.js +117 -0
- package/dist/components/table/index.js +381 -0
- package/dist/components/text/index.js +65 -0
- package/{components → dist/components}/timeStamp/index.js +4 -6
- package/dist/components/timeStamp/style.js +20 -0
- package/dist/components/topBar/index.js +169 -0
- package/{components → dist/components}/tree/index.js +29 -47
- package/dist/components/tree/style.js +29 -0
- package/dist/components/valuePicker/ValueSelector.js +205 -0
- package/{components → dist/components}/valuePicker/index.js +19 -26
- package/{components → dist/components}/wrapperLayout/layout/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/pageContainer/index.js +4 -5
- package/dist/components/wrapperLayout/main/sideBar/index.js +272 -0
- package/dist/components/wrapperLayout/main/sideBar/style.js +190 -0
- package/{components → dist/components}/wrapperLayout/topBar/UserAvatar.js +4 -5
- package/dist/components/wrapperLayout/topBar/avatar.js +55 -0
- package/dist/components/wrapperLayout/topBar/index.js +196 -0
- package/{components → dist/components}/wrapperLayout/topBar/menuIcon.js +4 -5
- package/dist/components/wrapperLayout/topBar/style.js +74 -0
- package/dist/http/index.js +133 -0
- package/{index.js → dist/index.js} +53 -55
- package/dist/package.json +127 -0
- package/{templates → dist/templates}/listPage/index.js +36 -57
- package/{themes → dist/themes}/default.js +5 -7
- package/{themes → dist/themes}/defaultSmall.js +2 -3
- package/{themes → dist/themes}/responsiveTheme.js +6 -8
- package/package.json +4 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/tenjinLogo.png +0 -0
- package/common/hooks/apiHooks.js +0 -223
- package/common/hooks/newApiHook.js +0 -270
- package/components/Canvas.js +0 -254
- package/components/DragBox/index.js +0 -45
- package/components/InputWithChip/index.js +0 -187
- package/components/WorkFlow.js +0 -47
- package/components/WorkFlowBuilder.js +0 -130
- package/components/alert/Style.js +0 -23
- package/components/alert/index.js +0 -69
- package/components/authenticationProvider/index.js +0 -166
- package/components/avatar/styles.js +0 -94
- package/components/breadCrumbs/index.js +0 -180
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
- package/components/button/index.js +0 -135
- package/components/checkBox/index.js +0 -30
- package/components/divider/index.js +0 -41
- package/components/errorBoundary/index.js +0 -160
- package/components/fileUploader/index.js +0 -156
- package/components/fileUploader/style.js +0 -60
- package/components/filter/ValueSelector.js +0 -350
- package/components/input/index.js +0 -174
- package/components/layout/index.js +0 -98
- package/components/layout/main/index.js +0 -27
- package/components/layout/main/style.js +0 -22
- package/components/layout/sidebar/FlatMenu.js +0 -64
- package/components/layout/sidebar/GroupedIconMenu.js +0 -246
- package/components/layout/sidebar/GroupedMenu.js +0 -67
- package/components/layout/sidebar/ProjectMenu.js +0 -230
- package/components/layout/sidebar/index.js +0 -91
- package/components/layout/sidebar/style.js +0 -154
- package/components/layout/topBar/UserAvatar.js +0 -145
- package/components/layout/topBar/index.js +0 -132
- package/components/menu/index.js +0 -80
- package/components/modal/index.js +0 -91
- package/components/modal/style.js +0 -68
- package/components/optionMenu/index.js +0 -112
- package/components/pagination/index.js +0 -129
- package/components/pagination/style.js +0 -36
- package/components/paginationUpdated/index.js +0 -75
- package/components/paper/index.js +0 -44
- package/components/paper/style.js +0 -34
- package/components/reactSelect/index.js +0 -212
- package/components/reactSelect/style.js +0 -163
- package/components/richTextEditor/index.js +0 -83
- package/components/select/GroupedSelect.js +0 -183
- package/components/select/SimpleSelect.js +0 -212
- package/components/simpleSelect/index.js +0 -56
- package/components/switch/style.js +0 -42
- package/components/table/ReactTable.js +0 -118
- package/components/table/SimpleTable.js +0 -136
- package/components/table/index.js +0 -256
- package/components/text/index.js +0 -67
- package/components/timeStamp/style.js +0 -23
- package/components/topBar/index.js +0 -176
- package/components/tree/style.js +0 -32
- package/components/valuePicker/ValueSelector.js +0 -273
- package/components/wrapperLayout/main/sideBar/index.js +0 -262
- package/components/wrapperLayout/main/sideBar/style.js +0 -196
- package/components/wrapperLayout/topBar/avatar.js +0 -57
- package/components/wrapperLayout/topBar/index.js +0 -182
- package/components/wrapperLayout/topBar/style.js +0 -77
- package/http/index.js +0 -226
- /package/{assets → dist/assets}/images/MicrosoftTeams-image (1).png +0 -0
- /package/{assets → dist/assets}/images/tenjin-4.0-logo.png +0 -0
- /package/{components → dist/components}/RightContext/index.css +0 -0
- /package/{components → dist/components}/browsingTestCaseLayout/style.css +0 -0
- /package/{components → dist/components}/errorBoundary/Error.jpg +0 -0
- /package/{components → dist/components}/iconButton/style.js +0 -0
- /package/{components → dist/components}/richTextEditor/style.js +0 -0
- /package/{components → dist/components}/wrapperLayout/layout/style.js +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -10,25 +9,20 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
9
|
var _fi = require("react-icons/fi");
|
|
11
10
|
var _button = _interopRequireDefault(require("../../components/button"));
|
|
12
11
|
var _input = _interopRequireDefault(require("../../components/input"));
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
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; }
|
|
22
|
-
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; }
|
|
23
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
-
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); }
|
|
25
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
26
20
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
27
|
-
function _unsupportedIterableToArray(
|
|
28
|
-
function _arrayLikeToArray(
|
|
29
|
-
function _iterableToArrayLimit(
|
|
30
|
-
function _arrayWithHoles(
|
|
31
|
-
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
|
+
const columns = [{
|
|
32
26
|
name: "id",
|
|
33
27
|
displayName: "User ID"
|
|
34
28
|
}, {
|
|
@@ -40,15 +34,11 @@ var columns = [{
|
|
|
40
34
|
}, {
|
|
41
35
|
name: "address.city",
|
|
42
36
|
displayName: "City",
|
|
43
|
-
render:
|
|
44
|
-
return d.address.city;
|
|
45
|
-
}
|
|
37
|
+
render: d => d.address.city
|
|
46
38
|
}, {
|
|
47
39
|
name: "address.zipcode",
|
|
48
40
|
displayName: "Zip Code",
|
|
49
|
-
render:
|
|
50
|
-
return d.address.zipcode;
|
|
51
|
-
}
|
|
41
|
+
render: d => d.address.zipcode
|
|
52
42
|
}, {
|
|
53
43
|
name: "phone",
|
|
54
44
|
displayName: "Phone"
|
|
@@ -58,13 +48,11 @@ var columns = [{
|
|
|
58
48
|
}, {
|
|
59
49
|
name: "company.name",
|
|
60
50
|
displayName: "Company",
|
|
61
|
-
render:
|
|
62
|
-
return d.company.name;
|
|
63
|
-
}
|
|
51
|
+
render: d => d.company.name
|
|
64
52
|
}];
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
const ListPage = _ref => {
|
|
54
|
+
let pageTitle = _ref.pageTitle;
|
|
55
|
+
const _useState = (0, _react.useState)({
|
|
68
56
|
filtered: [],
|
|
69
57
|
filter: null,
|
|
70
58
|
unfiltered: [{
|
|
@@ -204,16 +192,16 @@ var ListPage = function ListPage(_ref) {
|
|
|
204
192
|
_useState2 = _slicedToArray(_useState, 2),
|
|
205
193
|
data = _useState2[0],
|
|
206
194
|
setData = _useState2[1];
|
|
207
|
-
(0, _react.useEffect)(
|
|
195
|
+
(0, _react.useEffect)(() => {
|
|
208
196
|
search();
|
|
209
197
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
210
198
|
}, [data.unfiltered, data.filter]);
|
|
211
|
-
|
|
199
|
+
const search = () => {
|
|
212
200
|
if (data.filter) {
|
|
213
|
-
|
|
201
|
+
const filter = data.filter,
|
|
214
202
|
unfiltered = data.unfiltered;
|
|
215
|
-
|
|
216
|
-
|
|
203
|
+
let newFiltered = unfiltered.filter(u => {
|
|
204
|
+
let mergedData = "".concat(u.id).concat(u.username.toLowerCase()).concat(u.email.toLowerCase());
|
|
217
205
|
return mergedData.includes(filter.toLowerCase());
|
|
218
206
|
});
|
|
219
207
|
setData(_objectSpread(_objectSpread({}, data), {}, {
|
|
@@ -221,7 +209,7 @@ var ListPage = function ListPage(_ref) {
|
|
|
221
209
|
}));
|
|
222
210
|
} else {
|
|
223
211
|
setData(_objectSpread(_objectSpread({}, data), {}, {
|
|
224
|
-
filtered:
|
|
212
|
+
filtered: [...data.unfiltered]
|
|
225
213
|
}));
|
|
226
214
|
}
|
|
227
215
|
};
|
|
@@ -268,11 +256,9 @@ var ListPage = function ListPage(_ref) {
|
|
|
268
256
|
}, /*#__PURE__*/_react.default.createElement(_input.default, {
|
|
269
257
|
fullWidth: true,
|
|
270
258
|
placeholder: "Search by ID, name or Email",
|
|
271
|
-
onChange:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}));
|
|
275
|
-
},
|
|
259
|
+
onChange: e => setData(_objectSpread(_objectSpread({}, data), {}, {
|
|
260
|
+
filter: e.target.value
|
|
261
|
+
})),
|
|
276
262
|
value: data.filter,
|
|
277
263
|
disableAutocomplete: true,
|
|
278
264
|
startIcon: /*#__PURE__*/_react.default.createElement(_fi.FiSearch, null)
|
|
@@ -283,19 +269,12 @@ var ListPage = function ListPage(_ref) {
|
|
|
283
269
|
xs: 12
|
|
284
270
|
}, /*#__PURE__*/_react.default.createElement(_material.TableContainer, null, /*#__PURE__*/_react.default.createElement(_material.Table, {
|
|
285
271
|
"aria-label": pageTitle
|
|
286
|
-
}, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, null, columns.map(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}, columns.map(function (c) {
|
|
294
|
-
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
295
|
-
key: u[c.name]
|
|
296
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, c.render ? c.render(u) : u[c.name]));
|
|
297
|
-
}));
|
|
298
|
-
}))))));
|
|
272
|
+
}, /*#__PURE__*/_react.default.createElement(_material.TableHead, null, /*#__PURE__*/_react.default.createElement(_material.TableRow, null, columns.map(c => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
273
|
+
key: c.name
|
|
274
|
+
}, c.displayName)))), /*#__PURE__*/_react.default.createElement(_material.TableBody, null, data.filtered.map(u => /*#__PURE__*/_react.default.createElement(_material.TableRow, {
|
|
275
|
+
key: u.id
|
|
276
|
+
}, columns.map(c => /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
|
277
|
+
key: u[c.name]
|
|
278
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, c.render ? c.render(u) : u[c.name]))))))))));
|
|
299
279
|
};
|
|
300
|
-
var _default = ListPage;
|
|
301
|
-
exports.default = _default;
|
|
280
|
+
var _default = exports.default = ListPage;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const getFontSize = () => {
|
|
9
|
+
const devicePixelRatio = window.devicePixelRatio;
|
|
10
10
|
if (devicePixelRatio >= 1 && devicePixelRatio < 1.25) {
|
|
11
11
|
return 16;
|
|
12
12
|
} else if (devicePixelRatio >= 1.25 && devicePixelRatio < 1.5) {
|
|
@@ -17,7 +17,7 @@ var getFontSize = function getFontSize() {
|
|
|
17
17
|
return 40;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
const getSpacing = () => {
|
|
21
21
|
if (devicePixelRatio >= 1 && devicePixelRatio < 1.25) {
|
|
22
22
|
return 8;
|
|
23
23
|
} else if (devicePixelRatio >= 1.25 && devicePixelRatio < 1.5) {
|
|
@@ -28,7 +28,7 @@ var getSpacing = function getSpacing() {
|
|
|
28
28
|
return 8;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
var _default = (0, _material.createTheme)({
|
|
31
|
+
var _default = exports.default = (0, _material.createTheme)({
|
|
32
32
|
spacing: getSpacing(),
|
|
33
33
|
components: {
|
|
34
34
|
MuiButton: {
|
|
@@ -70,7 +70,6 @@ var _default = (0, _material.createTheme)({
|
|
|
70
70
|
// },
|
|
71
71
|
// },
|
|
72
72
|
},
|
|
73
|
-
|
|
74
73
|
MuiAutocomplete: {
|
|
75
74
|
styleOverrides: {
|
|
76
75
|
root: {
|
|
@@ -249,5 +248,4 @@ var _default = (0, _material.createTheme)({
|
|
|
249
248
|
fontFamily: ["-apple-system", "BlinkMacSystemFont", '"Segoe UI"', "Roboto", '"Helvetica Neue"', "Arial", "sans-serif", '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(",")
|
|
250
249
|
// fontSize: getFontSize(),
|
|
251
250
|
}
|
|
252
|
-
});
|
|
253
|
-
exports.default = _default;
|
|
251
|
+
});
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
|
-
var _default = (0, _material.createTheme)({
|
|
8
|
+
var _default = exports.default = (0, _material.createTheme)({
|
|
9
9
|
// spacing: 4,
|
|
10
10
|
|
|
11
11
|
overrides: {
|
|
@@ -82,5 +82,4 @@ var _default = (0, _material.createTheme)({
|
|
|
82
82
|
fontFamily: ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(','),
|
|
83
83
|
fontSize: 10
|
|
84
84
|
}
|
|
85
|
-
});
|
|
86
|
-
exports.default = _default;
|
|
85
|
+
});
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const getFontSize = () => {
|
|
9
|
+
const devicePixelRatio = window.devicePixelRatio;
|
|
10
10
|
if (devicePixelRatio >= 1 && devicePixelRatio < 1.25) {
|
|
11
11
|
return 14;
|
|
12
12
|
} else if (devicePixelRatio >= 1.25 && devicePixelRatio < 1.5) {
|
|
@@ -17,8 +17,8 @@ var getFontSize = function getFontSize() {
|
|
|
17
17
|
return 40;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const getSpacing = () => {
|
|
21
|
+
const devicePixelRatio = window.devicePixelRatio;
|
|
22
22
|
if (devicePixelRatio >= 1 && devicePixelRatio < 1.25) {
|
|
23
23
|
return 8;
|
|
24
24
|
} else if (devicePixelRatio >= 1.25 && devicePixelRatio < 1.5) {
|
|
@@ -29,7 +29,7 @@ var getSpacing = function getSpacing() {
|
|
|
29
29
|
return 8;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
var _default = (0, _material.createTheme)({
|
|
32
|
+
var _default = exports.default = (0, _material.createTheme)({
|
|
33
33
|
spacing: getSpacing(),
|
|
34
34
|
components: {
|
|
35
35
|
MuiButton: {
|
|
@@ -71,7 +71,6 @@ var _default = (0, _material.createTheme)({
|
|
|
71
71
|
// },
|
|
72
72
|
// },
|
|
73
73
|
},
|
|
74
|
-
|
|
75
74
|
MuiAutocomplete: {
|
|
76
75
|
styleOverrides: {
|
|
77
76
|
root: {
|
|
@@ -246,5 +245,4 @@ var _default = (0, _material.createTheme)({
|
|
|
246
245
|
fontFamily: ["-apple-system", "BlinkMacSystemFont", '"Segoe UI"', "Roboto", '"Helvetica Neue"', "Arial", "sans-serif", '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(","),
|
|
247
246
|
fontSize: getFontSize()
|
|
248
247
|
}
|
|
249
|
-
});
|
|
250
|
-
exports.default = _default;
|
|
248
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tenjin-ui-kit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.69",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://gitlab.com/yethi/react/tenjin-ui-kit.git"
|
|
6
6
|
},
|
|
@@ -100,8 +100,11 @@
|
|
|
100
100
|
"@storybook/preset-create-react-app": "^4.1.2",
|
|
101
101
|
"@storybook/react": "^6.5.15",
|
|
102
102
|
"@storybook/testing-library": "^0.0.13",
|
|
103
|
+
"ajv": "^8.20.0",
|
|
104
|
+
"ajv-keywords": "^5.1.0",
|
|
103
105
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
104
106
|
"cross-env": "^7.0.3",
|
|
107
|
+
"postcss": "^8.5.15",
|
|
105
108
|
"prop-types": "^15.8.1",
|
|
106
109
|
"react": "^18.2.0",
|
|
107
110
|
"react-dom": "^18.2.0",
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<meta name="theme-color" content="#000000" />
|
|
8
|
+
<meta
|
|
9
|
+
name="description"
|
|
10
|
+
content="Web site created using create-react-app"
|
|
11
|
+
/>
|
|
12
|
+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
+
<!--
|
|
14
|
+
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
+
-->
|
|
17
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
+
<!--
|
|
19
|
+
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
+
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
+
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
+
|
|
23
|
+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
+
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
+
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
+
-->
|
|
27
|
+
<title>React App</title>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
+
<div id="root"></div>
|
|
32
|
+
<!--
|
|
33
|
+
This HTML file is a template.
|
|
34
|
+
If you open it directly in the browser, you will see an empty page.
|
|
35
|
+
|
|
36
|
+
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
+
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
+
|
|
39
|
+
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
+
-->
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"short_name": "React App",
|
|
3
|
+
"name": "Create React App Sample",
|
|
4
|
+
"icons": [
|
|
5
|
+
{
|
|
6
|
+
"src": "favicon.ico",
|
|
7
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
+
"type": "image/x-icon"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"src": "logo192.png",
|
|
12
|
+
"type": "image/png",
|
|
13
|
+
"sizes": "192x192"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"src": "logo512.png",
|
|
17
|
+
"type": "image/png",
|
|
18
|
+
"sizes": "512x512"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"start_url": ".",
|
|
22
|
+
"display": "standalone",
|
|
23
|
+
"theme_color": "#000000",
|
|
24
|
+
"background_color": "#ffffff"
|
|
25
|
+
}
|
|
Binary file
|
package/common/hooks/apiHooks.js
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.usePut = exports.usePost = exports.useFetch = exports.useDelete = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _http = require("../../http");
|
|
10
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
11
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
var useFetch = function useFetch(url, clean, dependency) {
|
|
20
|
-
var _useState = (0, _react.useState)(null),
|
|
21
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
-
data = _useState2[0],
|
|
23
|
-
setData = _useState2[1];
|
|
24
|
-
var _useState3 = (0, _react.useState)(false),
|
|
25
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
-
loading = _useState4[0],
|
|
27
|
-
setLoading = _useState4[1];
|
|
28
|
-
var _useState5 = (0, _react.useState)(null),
|
|
29
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
30
|
-
error = _useState6[0],
|
|
31
|
-
setError = _useState6[1];
|
|
32
|
-
(0, _react.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
33
|
-
var res, parsedError;
|
|
34
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
35
|
-
while (1) switch (_context.prev = _context.next) {
|
|
36
|
-
case 0:
|
|
37
|
-
setLoading(true);
|
|
38
|
-
setError(null);
|
|
39
|
-
_context.prev = 2;
|
|
40
|
-
_context.next = 5;
|
|
41
|
-
return (0, _http.get)(url);
|
|
42
|
-
case 5:
|
|
43
|
-
res = _context.sent;
|
|
44
|
-
setData(res);
|
|
45
|
-
setLoading(false);
|
|
46
|
-
_context.next = 15;
|
|
47
|
-
break;
|
|
48
|
-
case 10:
|
|
49
|
-
_context.prev = 10;
|
|
50
|
-
_context.t0 = _context["catch"](2);
|
|
51
|
-
setLoading(false);
|
|
52
|
-
parsedError = (0, _http.parseAxiosError)(_context.t0);
|
|
53
|
-
setError(parsedError.message);
|
|
54
|
-
case 15:
|
|
55
|
-
return _context.abrupt("return", function () {
|
|
56
|
-
clean();
|
|
57
|
-
});
|
|
58
|
-
case 16:
|
|
59
|
-
case "end":
|
|
60
|
-
return _context.stop();
|
|
61
|
-
}
|
|
62
|
-
}, _callee, null, [[2, 10]]);
|
|
63
|
-
})), [dependency]);
|
|
64
|
-
return {
|
|
65
|
-
data: data,
|
|
66
|
-
loading: loading,
|
|
67
|
-
error: error
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
exports.useFetch = useFetch;
|
|
71
|
-
var usePost = function usePost(url, body, clean, dependency) {
|
|
72
|
-
var _useState7 = (0, _react.useState)(null),
|
|
73
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
74
|
-
data = _useState8[0],
|
|
75
|
-
setData = _useState8[1];
|
|
76
|
-
var _useState9 = (0, _react.useState)(false),
|
|
77
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
78
|
-
loading = _useState10[0],
|
|
79
|
-
setLoading = _useState10[1];
|
|
80
|
-
var _useState11 = (0, _react.useState)(null),
|
|
81
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
82
|
-
error = _useState12[0],
|
|
83
|
-
setError = _useState12[1];
|
|
84
|
-
(0, _react.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
85
|
-
var _data;
|
|
86
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
87
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
88
|
-
case 0:
|
|
89
|
-
setLoading(true);
|
|
90
|
-
setError(null);
|
|
91
|
-
_context2.prev = 2;
|
|
92
|
-
_context2.next = 5;
|
|
93
|
-
return (0, _http.post)(url, body);
|
|
94
|
-
case 5:
|
|
95
|
-
_data = _context2.sent;
|
|
96
|
-
setData(_data);
|
|
97
|
-
setLoading(false);
|
|
98
|
-
_context2.next = 14;
|
|
99
|
-
break;
|
|
100
|
-
case 10:
|
|
101
|
-
_context2.prev = 10;
|
|
102
|
-
_context2.t0 = _context2["catch"](2);
|
|
103
|
-
setError(_context2.t0);
|
|
104
|
-
setLoading(false);
|
|
105
|
-
case 14:
|
|
106
|
-
return _context2.abrupt("return", function () {
|
|
107
|
-
clean();
|
|
108
|
-
});
|
|
109
|
-
case 15:
|
|
110
|
-
case "end":
|
|
111
|
-
return _context2.stop();
|
|
112
|
-
}
|
|
113
|
-
}, _callee2, null, [[2, 10]]);
|
|
114
|
-
})), [dependency]);
|
|
115
|
-
return {
|
|
116
|
-
data: data,
|
|
117
|
-
loading: loading,
|
|
118
|
-
error: error
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
exports.usePost = usePost;
|
|
122
|
-
var usePut = function usePut(url, body, clean, dependency) {
|
|
123
|
-
var _useState13 = (0, _react.useState)(null),
|
|
124
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
125
|
-
data = _useState14[0],
|
|
126
|
-
setData = _useState14[1];
|
|
127
|
-
var _useState15 = (0, _react.useState)(false),
|
|
128
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
129
|
-
loading = _useState16[0],
|
|
130
|
-
setLoading = _useState16[1];
|
|
131
|
-
var _useState17 = (0, _react.useState)(null),
|
|
132
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
133
|
-
error = _useState18[0],
|
|
134
|
-
setError = _useState18[1];
|
|
135
|
-
(0, _react.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
136
|
-
var _data2;
|
|
137
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
138
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
139
|
-
case 0:
|
|
140
|
-
setLoading(true);
|
|
141
|
-
setError(null);
|
|
142
|
-
_context3.prev = 2;
|
|
143
|
-
_context3.next = 5;
|
|
144
|
-
return (0, _http.put)(url, body);
|
|
145
|
-
case 5:
|
|
146
|
-
_data2 = _context3.sent;
|
|
147
|
-
setData(_data2);
|
|
148
|
-
setLoading(false);
|
|
149
|
-
_context3.next = 14;
|
|
150
|
-
break;
|
|
151
|
-
case 10:
|
|
152
|
-
_context3.prev = 10;
|
|
153
|
-
_context3.t0 = _context3["catch"](2);
|
|
154
|
-
setError(_context3.t0);
|
|
155
|
-
setLoading(false);
|
|
156
|
-
case 14:
|
|
157
|
-
return _context3.abrupt("return", function () {
|
|
158
|
-
clean();
|
|
159
|
-
});
|
|
160
|
-
case 15:
|
|
161
|
-
case "end":
|
|
162
|
-
return _context3.stop();
|
|
163
|
-
}
|
|
164
|
-
}, _callee3, null, [[2, 10]]);
|
|
165
|
-
})), [dependency]);
|
|
166
|
-
return {
|
|
167
|
-
data: data,
|
|
168
|
-
loading: loading,
|
|
169
|
-
error: error
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
exports.usePut = usePut;
|
|
173
|
-
var useDelete = function useDelete(url, body, clean, dependency) {
|
|
174
|
-
var _useState19 = (0, _react.useState)(null),
|
|
175
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
176
|
-
data = _useState20[0],
|
|
177
|
-
setData = _useState20[1];
|
|
178
|
-
var _useState21 = (0, _react.useState)(false),
|
|
179
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
180
|
-
loading = _useState22[0],
|
|
181
|
-
setLoading = _useState22[1];
|
|
182
|
-
var _useState23 = (0, _react.useState)(null),
|
|
183
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
184
|
-
error = _useState24[0],
|
|
185
|
-
setError = _useState24[1];
|
|
186
|
-
(0, _react.useEffect)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
187
|
-
var _data3;
|
|
188
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
189
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
190
|
-
case 0:
|
|
191
|
-
setLoading(true);
|
|
192
|
-
setError(null);
|
|
193
|
-
_context4.prev = 2;
|
|
194
|
-
_context4.next = 5;
|
|
195
|
-
return (0, _http.doDelete)(url);
|
|
196
|
-
case 5:
|
|
197
|
-
_data3 = _context4.sent;
|
|
198
|
-
setData(_data3);
|
|
199
|
-
setLoading(false);
|
|
200
|
-
_context4.next = 14;
|
|
201
|
-
break;
|
|
202
|
-
case 10:
|
|
203
|
-
_context4.prev = 10;
|
|
204
|
-
_context4.t0 = _context4["catch"](2);
|
|
205
|
-
setError(_context4.t0);
|
|
206
|
-
setLoading(false);
|
|
207
|
-
case 14:
|
|
208
|
-
return _context4.abrupt("return", function () {
|
|
209
|
-
clean();
|
|
210
|
-
});
|
|
211
|
-
case 15:
|
|
212
|
-
case "end":
|
|
213
|
-
return _context4.stop();
|
|
214
|
-
}
|
|
215
|
-
}, _callee4, null, [[2, 10]]);
|
|
216
|
-
})), [dependency]);
|
|
217
|
-
return {
|
|
218
|
-
data: data,
|
|
219
|
-
loading: loading,
|
|
220
|
-
error: error
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
exports.useDelete = useDelete;
|