@copart/ops-tool-kit 1.13.0-beta.5 → 1.13.0-beta.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.
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
47
47
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
48
48
 
49
49
  const name$1 = "@copart/ops-tool-kit";
50
- const version$3 = "1.13.0-beta.5";
50
+ const version$3 = "1.13.0-beta.7";
51
51
  const main$1 = "dist/ops-tool-kit.js";
52
52
  const style = "dist/ops-tool-kit.css";
53
53
  const files = [
@@ -63683,7 +63683,8 @@ var NavigationBar = function NavigationBar(_ref2) {
63683
63683
  showNavIconInHeader = _ref2.showNavIconInHeader,
63684
63684
  isNavBarOpen = _ref2.isNavBarOpen,
63685
63685
  _ref2$showLevel3Navig = _ref2.showLevel3Navigation,
63686
- showLevel3Navigation = _ref2$showLevel3Navig === void 0 ? false : _ref2$showLevel3Navig;
63686
+ showLevel3Navigation = _ref2$showLevel3Navig === void 0 ? false : _ref2$showLevel3Navig,
63687
+ basePath = _ref2.basePath;
63687
63688
  // const withCounts = getCounts && typeof getCounts === 'function'
63688
63689
  var navigateFunction = navigateTo || (history === null || history === void 0 ? void 0 : history.push) || defaultRedirect;
63689
63690
  var _useState = React.useState(null),
@@ -63765,7 +63766,8 @@ var NavigationBar = function NavigationBar(_ref2) {
63765
63766
  countsRef: countsRef,
63766
63767
  countAutoReloadDisabled: countAutoReloadDisabled,
63767
63768
  onNavSectionToggle: onNavSectionToggle,
63768
- showLevel3Navigation: showLevel3Navigation
63769
+ showLevel3Navigation: showLevel3Navigation,
63770
+ basePath: basePath
63769
63771
  }) : null, isConfigValid === false ? /*#__PURE__*/React__default["default"].createElement("div", null, "Please check your navigation config") : null);
63770
63772
  };
63771
63773
  var NavigationMenu = function NavigationMenu(_ref3) {
@@ -63786,8 +63788,10 @@ var NavigationMenu = function NavigationMenu(_ref3) {
63786
63788
  countAutoReloadDisabled = _ref3.countAutoReloadDisabled,
63787
63789
  onNavSectionToggle = _ref3.onNavSectionToggle,
63788
63790
  _ref3$showLevel3Navig = _ref3.showLevel3Navigation,
63789
- showLevel3Navigation = _ref3$showLevel3Navig === void 0 ? false : _ref3$showLevel3Navig;
63790
- var redirectUrl = window.location.pathname;
63791
+ showLevel3Navigation = _ref3$showLevel3Navig === void 0 ? false : _ref3$showLevel3Navig,
63792
+ basePath = _ref3.basePath;
63793
+ var rawUrl = window.location.pathname;
63794
+ var redirectUrl = basePath && rawUrl.startsWith(basePath) ? rawUrl.slice(basePath.length) || '/' : rawUrl;
63791
63795
  var _useState11 = React.useState(null),
63792
63796
  _useState12 = _slicedToArray(_useState11, 2),
63793
63797
  counts = _useState12[0],
@@ -63796,7 +63800,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
63796
63800
  React.useEffect(function () {
63797
63801
  if (redirectUrl != '/') {
63798
63802
  var splitUrl = redirectUrl.split('/');
63799
- if (!process.env.IS_CORE_APP) {
63803
+ if (!process.env.IS_CORE_APP && !basePath) {
63800
63804
  splitUrl.shift();
63801
63805
  }
63802
63806
  // if (splitUrl.length - 1 === configDepth) {
@@ -64588,7 +64592,8 @@ var AppFrame = function AppFrame(props) {
64588
64592
  onNavSectionToggle: props.onNavSectionToggle,
64589
64593
  showNavIconInHeader: props === null || props === void 0 ? void 0 : props.showNavIconInHeader,
64590
64594
  isNavBarOpen: isNavBarOpen,
64591
- showLevel3Navigation: props.showLevel3Navigation
64595
+ showLevel3Navigation: props.showLevel3Navigation,
64596
+ basePath: props.navBasePath
64592
64597
  }) : null, /*#__PURE__*/React__default["default"].createElement("div", {
64593
64598
  style: {
64594
64599
  marginLeft: props.showNavigation && !(props !== null && props !== void 0 && props.showNavIconInHeader) ? navigationWidth : '0px',
@@ -68653,64 +68658,82 @@ function hydrateTiles() {
68653
68658
  });
68654
68659
  });
68655
68660
  }
68656
- var fetcher = {
68657
- request: request,
68658
- get: function get(url) {
68659
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
68660
- return request(_objectSpread2(_objectSpread2({}, config), {}, {
68661
- method: 'get',
68662
- url: url
68663
- }));
68664
- },
68665
- post: function post(url, data) {
68666
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68667
- return request(_objectSpread2(_objectSpread2({}, config), {}, {
68668
- method: 'post',
68669
- url: url,
68670
- data: data
68671
- }));
68672
- },
68673
- put: function put(url, data) {
68674
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68675
- return request(_objectSpread2(_objectSpread2({}, config), {}, {
68676
- method: 'put',
68677
- url: url,
68678
- data: data
68679
- }));
68661
+ function fetcher(config) {
68662
+ return request(config);
68663
+ }
68664
+ fetcher.defaults = {
68665
+ headers: {
68666
+ common: {},
68667
+ get: {},
68668
+ post: {},
68669
+ put: {},
68670
+ patch: {},
68671
+ delete: {}
68680
68672
  },
68681
- delete: function _delete(url) {
68682
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
68683
- return request(_objectSpread2(_objectSpread2({}, config), {}, {
68684
- method: 'delete',
68685
- url: url
68686
- }));
68687
- },
68688
- patch: function patch(url, data) {
68689
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68690
- return request(_objectSpread2(_objectSpread2({}, config), {}, {
68691
- method: 'patch',
68692
- url: url,
68693
- data: data
68694
- }));
68695
- },
68696
- interceptors: {
68697
- request: {
68698
- use: function use(fulfilled, rejected) {
68699
- requestInterceptors.push({
68700
- fulfilled: fulfilled,
68701
- rejected: rejected
68702
- });
68703
- }
68704
- },
68705
- response: {
68706
- use: function use(fulfilled, rejected) {
68707
- responseInterceptors.push({
68708
- fulfilled: fulfilled,
68709
- rejected: rejected
68710
- });
68711
- }
68673
+ baseURL: '',
68674
+ timeout: 0
68675
+ };
68676
+ fetcher.create = function (instanceConfig) {
68677
+ return fetcher;
68678
+ };
68679
+ fetcher.request = request;
68680
+ fetcher.get = function (url) {
68681
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
68682
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68683
+ method: 'get',
68684
+ url: url
68685
+ }));
68686
+ };
68687
+ fetcher.post = function (url, data) {
68688
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68689
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68690
+ method: 'post',
68691
+ url: url,
68692
+ data: data
68693
+ }));
68694
+ };
68695
+ fetcher.put = function (url, data) {
68696
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68697
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68698
+ method: 'put',
68699
+ url: url,
68700
+ data: data
68701
+ }));
68702
+ };
68703
+ fetcher.delete = function (url) {
68704
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
68705
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68706
+ method: 'delete',
68707
+ url: url
68708
+ }));
68709
+ };
68710
+ fetcher.patch = function (url, data) {
68711
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68712
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68713
+ method: 'patch',
68714
+ url: url,
68715
+ data: data
68716
+ }));
68717
+ };
68718
+ fetcher.interceptors = {
68719
+ request: {
68720
+ use: function use(fulfilled, rejected) {
68721
+ requestInterceptors.push({
68722
+ fulfilled: fulfilled,
68723
+ rejected: rejected
68724
+ });
68712
68725
  }
68713
68726
  },
68727
+ response: {
68728
+ use: function use(fulfilled, rejected) {
68729
+ responseInterceptors.push({
68730
+ fulfilled: fulfilled,
68731
+ rejected: rejected
68732
+ });
68733
+ }
68734
+ }
68735
+ };
68736
+ Object.assign(fetcher, {
68714
68737
  getConfig: function () {
68715
68738
  var _getConfig = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(endpoint) {
68716
68739
  var response, config;
@@ -69077,7 +69100,7 @@ var fetcher = {
69077
69100
  }
69078
69101
  return getCobaltUserRoles;
69079
69102
  }()
69080
- };
69103
+ });
69081
69104
 
69082
69105
  var isEmpty = function isEmpty(arr) {
69083
69106
  return !arr || arr.length === 0;