@zac-apps/commons 1.3.5 → 1.3.7
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.js +42 -17
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ import ManageSearchIcon from '@mui/icons-material/ManageSearch';
|
|
|
48
48
|
import CloseIcon from '@mui/icons-material/Close';
|
|
49
49
|
|
|
50
50
|
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; }
|
|
51
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t),
|
|
51
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).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; }
|
|
52
52
|
var Alert = /*#__PURE__*/React__default.forwardRef(function Alert(props, ref) {
|
|
53
53
|
return /*#__PURE__*/jsx(MuiAlert, _objectSpread({
|
|
54
54
|
elevation: 6,
|
|
@@ -439,34 +439,59 @@ function PublicFetch(_ref) {
|
|
|
439
439
|
SetMetaData = _ref.SetMetaData,
|
|
440
440
|
reload = _ref.reload,
|
|
441
441
|
SetReload = _ref.SetReload;
|
|
442
|
+
_ref.error;
|
|
443
|
+
var SetError = _ref.SetError;
|
|
442
444
|
var _useState = useState(),
|
|
443
445
|
_useState2 = _slicedToArray(_useState, 2),
|
|
444
446
|
internal = _useState2[0],
|
|
445
447
|
SetInternal = _useState2[1];
|
|
448
|
+
var _useState3 = useState(),
|
|
449
|
+
_useState4 = _slicedToArray(_useState3, 2);
|
|
450
|
+
_useState4[0];
|
|
451
|
+
var SetInternalError = _useState4[1];
|
|
446
452
|
var state = null;
|
|
447
453
|
if (!SetState) {
|
|
448
454
|
SetState = SetInternal;
|
|
449
455
|
state = internal;
|
|
450
456
|
}
|
|
457
|
+
if (!SetError) {
|
|
458
|
+
SetError = SetInternalError;
|
|
459
|
+
}
|
|
451
460
|
if (!reload) {
|
|
452
461
|
reload = false;
|
|
453
462
|
}
|
|
454
463
|
useEffect(function () {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
SetMetaData
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
464
|
+
try {
|
|
465
|
+
fetch(url, {
|
|
466
|
+
headers: {
|
|
467
|
+
"Content-Type": "application/json",
|
|
468
|
+
Accept: "application/json"
|
|
469
|
+
}
|
|
470
|
+
}).then(function (response) {
|
|
471
|
+
if (SetMetaData) {
|
|
472
|
+
SetMetaData(response.headers);
|
|
473
|
+
}
|
|
474
|
+
console.log(response);
|
|
475
|
+
if (!response.ok) {
|
|
476
|
+
SetError({
|
|
477
|
+
error: response.statusText
|
|
478
|
+
});
|
|
479
|
+
return {
|
|
480
|
+
error: response.statusText
|
|
481
|
+
};
|
|
482
|
+
} else {
|
|
483
|
+
return response.json();
|
|
484
|
+
}
|
|
485
|
+
}).then(function (json) {
|
|
486
|
+
console.log(json);
|
|
487
|
+
SetState(json);
|
|
488
|
+
});
|
|
489
|
+
} catch (e) {
|
|
490
|
+
console.log(e);
|
|
491
|
+
SetError({
|
|
492
|
+
error: e
|
|
493
|
+
});
|
|
494
|
+
}
|
|
470
495
|
if (SetReload) {
|
|
471
496
|
SetReload(false);
|
|
472
497
|
}
|
|
@@ -580,7 +605,7 @@ function Start(_ref) {
|
|
|
580
605
|
var TableHeadCell = styled(TableCell)(function (_ref) {
|
|
581
606
|
var theme = _ref.theme;
|
|
582
607
|
return _defineProperty(_defineProperty({}, "&.".concat(tableCellClasses.head), {
|
|
583
|
-
backgroundColor: theme.palette.
|
|
608
|
+
backgroundColor: theme.palette.grey[300]
|
|
584
609
|
}), "&.".concat(tableCellClasses.body), {
|
|
585
610
|
fontSize: 14
|
|
586
611
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zac-apps/commons",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"rollup": "node_modules/rollup/dist/rollup.js",
|
|
6
6
|
"dev": "next dev",
|
|
@@ -42,21 +42,21 @@
|
|
|
42
42
|
"@semantic-release/git": "^10.0.1",
|
|
43
43
|
"@semantic-release/gitlab": "^13.0.3",
|
|
44
44
|
"@semantic-release/npm": "^12.0.0",
|
|
45
|
-
"@storybook/addon-essentials": "^8.0.
|
|
46
|
-
"@storybook/addon-interactions": "^8.0.
|
|
47
|
-
"@storybook/addon-links": "^8.0.
|
|
48
|
-
"@storybook/addon-onboarding": "^8.0.
|
|
49
|
-
"@storybook/blocks": "^8.0.
|
|
50
|
-
"@storybook/nextjs": "^8.0.
|
|
51
|
-
"@storybook/react": "^8.0.
|
|
52
|
-
"@storybook/test": "^8.0.
|
|
45
|
+
"@storybook/addon-essentials": "^8.0.5",
|
|
46
|
+
"@storybook/addon-interactions": "^8.0.5",
|
|
47
|
+
"@storybook/addon-links": "^8.0.5",
|
|
48
|
+
"@storybook/addon-onboarding": "^8.0.5",
|
|
49
|
+
"@storybook/blocks": "^8.0.5",
|
|
50
|
+
"@storybook/nextjs": "^8.0.5",
|
|
51
|
+
"@storybook/react": "^8.0.5",
|
|
52
|
+
"@storybook/test": "^8.0.5",
|
|
53
53
|
"babel-loader": "^9.1.3",
|
|
54
54
|
"eslint": "^8",
|
|
55
55
|
"eslint-config-next": "14.1.4",
|
|
56
56
|
"eslint-plugin-storybook": "^0.8.0",
|
|
57
|
-
"rollup": "^4.13.
|
|
57
|
+
"rollup": "^4.13.1",
|
|
58
58
|
"semantic-release": "^23.0.6",
|
|
59
|
-
"storybook": "^8.0.
|
|
59
|
+
"storybook": "^8.0.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"next": "^14.0.4",
|