@dovetail-v2/refine 0.0.1 → 0.0.3
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.
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
import React, { useCallback, useContext, createContext, useState, useRef, useEffect, useMemo, forwardRef, useImperativeHandle, Suspense, useLayoutEffect } from "react";
|
|
8
8
|
import { ResourceContext, matchResourceFromRoute, useResource, useForm as useForm$1, pickNotDeprecated, useWarnAboutChange, useList, useDelete, useParsed, useGo, useTable, useNavigation, useDeleteMany, useShow, useMenu, Refine } from "@refinedev/core";
|
|
9
9
|
import { parse, stringify } from "qs";
|
|
10
|
-
import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink,
|
|
10
|
+
import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router, Switch } from "react-router-dom";
|
|
11
11
|
import { useUIKit, Typo, Icon, kitContext } from "@cloudtower/eagle";
|
|
12
12
|
import yaml from "js-yaml";
|
|
13
13
|
import { isObject, merge, get } from "lodash-es";
|
|
@@ -701,7 +701,7 @@ const convertToNumberIfPossible = (value) => {
|
|
|
701
701
|
const routerProvider = {
|
|
702
702
|
go: () => {
|
|
703
703
|
const { search: existingSearch, hash: existingHash } = useLocation();
|
|
704
|
-
const
|
|
704
|
+
const history2 = useHistory();
|
|
705
705
|
const fn = useCallback(
|
|
706
706
|
({ to, type, query, hash, options: { keepQuery, keepHash } = {} }) => {
|
|
707
707
|
const urlQuery = {
|
|
@@ -722,17 +722,17 @@ const routerProvider = {
|
|
|
722
722
|
if (type === "path") {
|
|
723
723
|
return fullPath;
|
|
724
724
|
}
|
|
725
|
-
return
|
|
725
|
+
return history2[type || "push"](fullPath);
|
|
726
726
|
},
|
|
727
|
-
[existingHash, existingSearch,
|
|
727
|
+
[existingHash, existingSearch, history2]
|
|
728
728
|
);
|
|
729
729
|
return fn;
|
|
730
730
|
},
|
|
731
731
|
back: () => {
|
|
732
|
-
const
|
|
732
|
+
const history2 = useHistory();
|
|
733
733
|
const fn = useCallback(() => {
|
|
734
|
-
|
|
735
|
-
}, [
|
|
734
|
+
history2.go(-1);
|
|
735
|
+
}, [history2]);
|
|
736
736
|
return fn;
|
|
737
737
|
},
|
|
738
738
|
parse: () => {
|
|
@@ -772,6 +772,20 @@ const routerProvider = {
|
|
|
772
772
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(Link, { ...props, ref });
|
|
773
773
|
})
|
|
774
774
|
};
|
|
775
|
+
function _extends() {
|
|
776
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
777
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
778
|
+
var source = arguments[i];
|
|
779
|
+
for (var key in source) {
|
|
780
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
781
|
+
target[key] = source[key];
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return target;
|
|
786
|
+
};
|
|
787
|
+
return _extends.apply(this, arguments);
|
|
788
|
+
}
|
|
775
789
|
function warn() {
|
|
776
790
|
if (console && console.warn) {
|
|
777
791
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -5956,9 +5970,9 @@ var lodash = { exports: {} };
|
|
|
5956
5970
|
}
|
|
5957
5971
|
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
|
5958
5972
|
}
|
|
5959
|
-
function uniqueId(
|
|
5973
|
+
function uniqueId(prefix2) {
|
|
5960
5974
|
var id = ++idCounter;
|
|
5961
|
-
return toString(
|
|
5975
|
+
return toString(prefix2) + id;
|
|
5962
5976
|
}
|
|
5963
5977
|
var add = createMathOperation(function(augend, addend) {
|
|
5964
5978
|
return augend + addend;
|
|
@@ -7274,7 +7288,7 @@ const ErrorMsgStyle = "eh2qjnl";
|
|
|
7274
7288
|
const ErrorWrapperStyle = "e19q2bnp";
|
|
7275
7289
|
const YamlEditorStyle = "y16u5v3w";
|
|
7276
7290
|
const MonacoYamlEditor$2 = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$1));
|
|
7277
|
-
const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.
|
|
7291
|
+
const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.a9bce0ec.js"));
|
|
7278
7292
|
const YamlEditorComponent = forwardRef(
|
|
7279
7293
|
function YamlEditorComponent2(props, ref) {
|
|
7280
7294
|
const {
|
|
@@ -9098,7 +9112,7 @@ const ResourceCRUD = (props) => {
|
|
|
9098
9112
|
var _a, _b;
|
|
9099
9113
|
const formatter = config.formatter || ((v2) => new ResourceModel(v2));
|
|
9100
9114
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [
|
|
9101
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path:
|
|
9115
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path: `${urlPrefix}/${config.name}`, exact: true, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9102
9116
|
ResourceList,
|
|
9103
9117
|
{
|
|
9104
9118
|
name: config.kind,
|
|
@@ -9107,7 +9121,7 @@ const ResourceCRUD = (props) => {
|
|
|
9107
9121
|
Dropdown: config.Dropdown
|
|
9108
9122
|
}
|
|
9109
9123
|
) }),
|
|
9110
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path:
|
|
9124
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path: `${urlPrefix}/${config.name}/show`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9111
9125
|
ResourceShow,
|
|
9112
9126
|
{
|
|
9113
9127
|
formatter,
|
|
@@ -9115,8 +9129,8 @@ const ResourceCRUD = (props) => {
|
|
|
9115
9129
|
Dropdown: config.Dropdown
|
|
9116
9130
|
}
|
|
9117
9131
|
) }),
|
|
9118
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path:
|
|
9119
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path:
|
|
9132
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path: `${urlPrefix}/${config.name}/create`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceForm, { config }) }),
|
|
9133
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path: `${urlPrefix}/${config.name}/edit`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceForm, { config }) })
|
|
9120
9134
|
] });
|
|
9121
9135
|
}) });
|
|
9122
9136
|
};
|
|
@@ -9684,6 +9698,480 @@ lib.informerLog = R;
|
|
|
9684
9698
|
var liveProvider = lib.liveProvider = It;
|
|
9685
9699
|
lib.mapOperator = nt;
|
|
9686
9700
|
lib.sortData = M;
|
|
9701
|
+
function isAbsolute(pathname) {
|
|
9702
|
+
return pathname.charAt(0) === "/";
|
|
9703
|
+
}
|
|
9704
|
+
function spliceOne(list, index) {
|
|
9705
|
+
for (var i = index, k2 = i + 1, n = list.length; k2 < n; i += 1, k2 += 1) {
|
|
9706
|
+
list[i] = list[k2];
|
|
9707
|
+
}
|
|
9708
|
+
list.pop();
|
|
9709
|
+
}
|
|
9710
|
+
function resolvePathname(to, from) {
|
|
9711
|
+
if (from === void 0)
|
|
9712
|
+
from = "";
|
|
9713
|
+
var toParts = to && to.split("/") || [];
|
|
9714
|
+
var fromParts = from && from.split("/") || [];
|
|
9715
|
+
var isToAbs = to && isAbsolute(to);
|
|
9716
|
+
var isFromAbs = from && isAbsolute(from);
|
|
9717
|
+
var mustEndAbs = isToAbs || isFromAbs;
|
|
9718
|
+
if (to && isAbsolute(to)) {
|
|
9719
|
+
fromParts = toParts;
|
|
9720
|
+
} else if (toParts.length) {
|
|
9721
|
+
fromParts.pop();
|
|
9722
|
+
fromParts = fromParts.concat(toParts);
|
|
9723
|
+
}
|
|
9724
|
+
if (!fromParts.length)
|
|
9725
|
+
return "/";
|
|
9726
|
+
var hasTrailingSlash;
|
|
9727
|
+
if (fromParts.length) {
|
|
9728
|
+
var last = fromParts[fromParts.length - 1];
|
|
9729
|
+
hasTrailingSlash = last === "." || last === ".." || last === "";
|
|
9730
|
+
} else {
|
|
9731
|
+
hasTrailingSlash = false;
|
|
9732
|
+
}
|
|
9733
|
+
var up = 0;
|
|
9734
|
+
for (var i = fromParts.length; i >= 0; i--) {
|
|
9735
|
+
var part = fromParts[i];
|
|
9736
|
+
if (part === ".") {
|
|
9737
|
+
spliceOne(fromParts, i);
|
|
9738
|
+
} else if (part === "..") {
|
|
9739
|
+
spliceOne(fromParts, i);
|
|
9740
|
+
up++;
|
|
9741
|
+
} else if (up) {
|
|
9742
|
+
spliceOne(fromParts, i);
|
|
9743
|
+
up--;
|
|
9744
|
+
}
|
|
9745
|
+
}
|
|
9746
|
+
if (!mustEndAbs)
|
|
9747
|
+
for (; up--; up)
|
|
9748
|
+
fromParts.unshift("..");
|
|
9749
|
+
if (mustEndAbs && fromParts[0] !== "" && (!fromParts[0] || !isAbsolute(fromParts[0])))
|
|
9750
|
+
fromParts.unshift("");
|
|
9751
|
+
var result = fromParts.join("/");
|
|
9752
|
+
if (hasTrailingSlash && result.substr(-1) !== "/")
|
|
9753
|
+
result += "/";
|
|
9754
|
+
return result;
|
|
9755
|
+
}
|
|
9756
|
+
var isProduction$1 = process.env.NODE_ENV === "production";
|
|
9757
|
+
function warning(condition, message) {
|
|
9758
|
+
if (!isProduction$1) {
|
|
9759
|
+
if (condition) {
|
|
9760
|
+
return;
|
|
9761
|
+
}
|
|
9762
|
+
var text = "Warning: " + message;
|
|
9763
|
+
if (typeof console !== "undefined") {
|
|
9764
|
+
console.warn(text);
|
|
9765
|
+
}
|
|
9766
|
+
try {
|
|
9767
|
+
throw Error(text);
|
|
9768
|
+
} catch (x2) {
|
|
9769
|
+
}
|
|
9770
|
+
}
|
|
9771
|
+
}
|
|
9772
|
+
var isProduction = process.env.NODE_ENV === "production";
|
|
9773
|
+
var prefix = "Invariant failed";
|
|
9774
|
+
function invariant(condition, message) {
|
|
9775
|
+
if (condition) {
|
|
9776
|
+
return;
|
|
9777
|
+
}
|
|
9778
|
+
if (isProduction) {
|
|
9779
|
+
throw new Error(prefix);
|
|
9780
|
+
}
|
|
9781
|
+
var provided = typeof message === "function" ? message() : message;
|
|
9782
|
+
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
9783
|
+
throw new Error(value);
|
|
9784
|
+
}
|
|
9785
|
+
function addLeadingSlash(path) {
|
|
9786
|
+
return path.charAt(0) === "/" ? path : "/" + path;
|
|
9787
|
+
}
|
|
9788
|
+
function stripLeadingSlash(path) {
|
|
9789
|
+
return path.charAt(0) === "/" ? path.substr(1) : path;
|
|
9790
|
+
}
|
|
9791
|
+
function hasBasename(path, prefix2) {
|
|
9792
|
+
return path.toLowerCase().indexOf(prefix2.toLowerCase()) === 0 && "/?#".indexOf(path.charAt(prefix2.length)) !== -1;
|
|
9793
|
+
}
|
|
9794
|
+
function stripBasename(path, prefix2) {
|
|
9795
|
+
return hasBasename(path, prefix2) ? path.substr(prefix2.length) : path;
|
|
9796
|
+
}
|
|
9797
|
+
function stripTrailingSlash(path) {
|
|
9798
|
+
return path.charAt(path.length - 1) === "/" ? path.slice(0, -1) : path;
|
|
9799
|
+
}
|
|
9800
|
+
function parsePath(path) {
|
|
9801
|
+
var pathname = path || "/";
|
|
9802
|
+
var search = "";
|
|
9803
|
+
var hash = "";
|
|
9804
|
+
var hashIndex = pathname.indexOf("#");
|
|
9805
|
+
if (hashIndex !== -1) {
|
|
9806
|
+
hash = pathname.substr(hashIndex);
|
|
9807
|
+
pathname = pathname.substr(0, hashIndex);
|
|
9808
|
+
}
|
|
9809
|
+
var searchIndex = pathname.indexOf("?");
|
|
9810
|
+
if (searchIndex !== -1) {
|
|
9811
|
+
search = pathname.substr(searchIndex);
|
|
9812
|
+
pathname = pathname.substr(0, searchIndex);
|
|
9813
|
+
}
|
|
9814
|
+
return {
|
|
9815
|
+
pathname,
|
|
9816
|
+
search: search === "?" ? "" : search,
|
|
9817
|
+
hash: hash === "#" ? "" : hash
|
|
9818
|
+
};
|
|
9819
|
+
}
|
|
9820
|
+
function createPath(location2) {
|
|
9821
|
+
var pathname = location2.pathname, search = location2.search, hash = location2.hash;
|
|
9822
|
+
var path = pathname || "/";
|
|
9823
|
+
if (search && search !== "?")
|
|
9824
|
+
path += search.charAt(0) === "?" ? search : "?" + search;
|
|
9825
|
+
if (hash && hash !== "#")
|
|
9826
|
+
path += hash.charAt(0) === "#" ? hash : "#" + hash;
|
|
9827
|
+
return path;
|
|
9828
|
+
}
|
|
9829
|
+
function createLocation(path, state, key, currentLocation) {
|
|
9830
|
+
var location2;
|
|
9831
|
+
if (typeof path === "string") {
|
|
9832
|
+
location2 = parsePath(path);
|
|
9833
|
+
location2.state = state;
|
|
9834
|
+
} else {
|
|
9835
|
+
location2 = _extends({}, path);
|
|
9836
|
+
if (location2.pathname === void 0)
|
|
9837
|
+
location2.pathname = "";
|
|
9838
|
+
if (location2.search) {
|
|
9839
|
+
if (location2.search.charAt(0) !== "?")
|
|
9840
|
+
location2.search = "?" + location2.search;
|
|
9841
|
+
} else {
|
|
9842
|
+
location2.search = "";
|
|
9843
|
+
}
|
|
9844
|
+
if (location2.hash) {
|
|
9845
|
+
if (location2.hash.charAt(0) !== "#")
|
|
9846
|
+
location2.hash = "#" + location2.hash;
|
|
9847
|
+
} else {
|
|
9848
|
+
location2.hash = "";
|
|
9849
|
+
}
|
|
9850
|
+
if (state !== void 0 && location2.state === void 0)
|
|
9851
|
+
location2.state = state;
|
|
9852
|
+
}
|
|
9853
|
+
try {
|
|
9854
|
+
location2.pathname = decodeURI(location2.pathname);
|
|
9855
|
+
} catch (e) {
|
|
9856
|
+
if (e instanceof URIError) {
|
|
9857
|
+
throw new URIError('Pathname "' + location2.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.');
|
|
9858
|
+
} else {
|
|
9859
|
+
throw e;
|
|
9860
|
+
}
|
|
9861
|
+
}
|
|
9862
|
+
if (key)
|
|
9863
|
+
location2.key = key;
|
|
9864
|
+
if (currentLocation) {
|
|
9865
|
+
if (!location2.pathname) {
|
|
9866
|
+
location2.pathname = currentLocation.pathname;
|
|
9867
|
+
} else if (location2.pathname.charAt(0) !== "/") {
|
|
9868
|
+
location2.pathname = resolvePathname(location2.pathname, currentLocation.pathname);
|
|
9869
|
+
}
|
|
9870
|
+
} else {
|
|
9871
|
+
if (!location2.pathname) {
|
|
9872
|
+
location2.pathname = "/";
|
|
9873
|
+
}
|
|
9874
|
+
}
|
|
9875
|
+
return location2;
|
|
9876
|
+
}
|
|
9877
|
+
function createTransitionManager() {
|
|
9878
|
+
var prompt = null;
|
|
9879
|
+
function setPrompt(nextPrompt) {
|
|
9880
|
+
process.env.NODE_ENV !== "production" ? warning(prompt == null, "A history supports only one prompt at a time") : void 0;
|
|
9881
|
+
prompt = nextPrompt;
|
|
9882
|
+
return function() {
|
|
9883
|
+
if (prompt === nextPrompt)
|
|
9884
|
+
prompt = null;
|
|
9885
|
+
};
|
|
9886
|
+
}
|
|
9887
|
+
function confirmTransitionTo(location2, action, getUserConfirmation, callback) {
|
|
9888
|
+
if (prompt != null) {
|
|
9889
|
+
var result = typeof prompt === "function" ? prompt(location2, action) : prompt;
|
|
9890
|
+
if (typeof result === "string") {
|
|
9891
|
+
if (typeof getUserConfirmation === "function") {
|
|
9892
|
+
getUserConfirmation(result, callback);
|
|
9893
|
+
} else {
|
|
9894
|
+
process.env.NODE_ENV !== "production" ? warning(false, "A history needs a getUserConfirmation function in order to use a prompt message") : void 0;
|
|
9895
|
+
callback(true);
|
|
9896
|
+
}
|
|
9897
|
+
} else {
|
|
9898
|
+
callback(result !== false);
|
|
9899
|
+
}
|
|
9900
|
+
} else {
|
|
9901
|
+
callback(true);
|
|
9902
|
+
}
|
|
9903
|
+
}
|
|
9904
|
+
var listeners = [];
|
|
9905
|
+
function appendListener(fn) {
|
|
9906
|
+
var isActive = true;
|
|
9907
|
+
function listener() {
|
|
9908
|
+
if (isActive)
|
|
9909
|
+
fn.apply(void 0, arguments);
|
|
9910
|
+
}
|
|
9911
|
+
listeners.push(listener);
|
|
9912
|
+
return function() {
|
|
9913
|
+
isActive = false;
|
|
9914
|
+
listeners = listeners.filter(function(item) {
|
|
9915
|
+
return item !== listener;
|
|
9916
|
+
});
|
|
9917
|
+
};
|
|
9918
|
+
}
|
|
9919
|
+
function notifyListeners() {
|
|
9920
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9921
|
+
args[_key] = arguments[_key];
|
|
9922
|
+
}
|
|
9923
|
+
listeners.forEach(function(listener) {
|
|
9924
|
+
return listener.apply(void 0, args);
|
|
9925
|
+
});
|
|
9926
|
+
}
|
|
9927
|
+
return {
|
|
9928
|
+
setPrompt,
|
|
9929
|
+
confirmTransitionTo,
|
|
9930
|
+
appendListener,
|
|
9931
|
+
notifyListeners
|
|
9932
|
+
};
|
|
9933
|
+
}
|
|
9934
|
+
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
9935
|
+
function getConfirmation(message, callback) {
|
|
9936
|
+
callback(window.confirm(message));
|
|
9937
|
+
}
|
|
9938
|
+
function supportsGoWithoutReloadUsingHash() {
|
|
9939
|
+
return window.navigator.userAgent.indexOf("Firefox") === -1;
|
|
9940
|
+
}
|
|
9941
|
+
var HashChangeEvent$1 = "hashchange";
|
|
9942
|
+
var HashPathCoders = {
|
|
9943
|
+
hashbang: {
|
|
9944
|
+
encodePath: function encodePath(path) {
|
|
9945
|
+
return path.charAt(0) === "!" ? path : "!/" + stripLeadingSlash(path);
|
|
9946
|
+
},
|
|
9947
|
+
decodePath: function decodePath(path) {
|
|
9948
|
+
return path.charAt(0) === "!" ? path.substr(1) : path;
|
|
9949
|
+
}
|
|
9950
|
+
},
|
|
9951
|
+
noslash: {
|
|
9952
|
+
encodePath: stripLeadingSlash,
|
|
9953
|
+
decodePath: addLeadingSlash
|
|
9954
|
+
},
|
|
9955
|
+
slash: {
|
|
9956
|
+
encodePath: addLeadingSlash,
|
|
9957
|
+
decodePath: addLeadingSlash
|
|
9958
|
+
}
|
|
9959
|
+
};
|
|
9960
|
+
function stripHash(url) {
|
|
9961
|
+
var hashIndex = url.indexOf("#");
|
|
9962
|
+
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
9963
|
+
}
|
|
9964
|
+
function getHashPath() {
|
|
9965
|
+
var href = window.location.href;
|
|
9966
|
+
var hashIndex = href.indexOf("#");
|
|
9967
|
+
return hashIndex === -1 ? "" : href.substring(hashIndex + 1);
|
|
9968
|
+
}
|
|
9969
|
+
function pushHashPath(path) {
|
|
9970
|
+
window.location.hash = path;
|
|
9971
|
+
}
|
|
9972
|
+
function replaceHashPath(path) {
|
|
9973
|
+
window.location.replace(stripHash(window.location.href) + "#" + path);
|
|
9974
|
+
}
|
|
9975
|
+
function createHashHistory(props) {
|
|
9976
|
+
if (props === void 0) {
|
|
9977
|
+
props = {};
|
|
9978
|
+
}
|
|
9979
|
+
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, "Hash history needs a DOM") : invariant(false) : void 0;
|
|
9980
|
+
var globalHistory = window.history;
|
|
9981
|
+
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
|
9982
|
+
var _props = props, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$hashType = _props.hashType, hashType = _props$hashType === void 0 ? "slash" : _props$hashType;
|
|
9983
|
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : "";
|
|
9984
|
+
var _HashPathCoders$hashT = HashPathCoders[hashType], encodePath2 = _HashPathCoders$hashT.encodePath, decodePath2 = _HashPathCoders$hashT.decodePath;
|
|
9985
|
+
function getDOMLocation() {
|
|
9986
|
+
var path2 = decodePath2(getHashPath());
|
|
9987
|
+
process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path2, basename), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + path2 + '" to begin with "' + basename + '".') : void 0;
|
|
9988
|
+
if (basename)
|
|
9989
|
+
path2 = stripBasename(path2, basename);
|
|
9990
|
+
return createLocation(path2);
|
|
9991
|
+
}
|
|
9992
|
+
var transitionManager = createTransitionManager();
|
|
9993
|
+
function setState(nextState) {
|
|
9994
|
+
_extends(history2, nextState);
|
|
9995
|
+
history2.length = globalHistory.length;
|
|
9996
|
+
transitionManager.notifyListeners(history2.location, history2.action);
|
|
9997
|
+
}
|
|
9998
|
+
var forceNextPop = false;
|
|
9999
|
+
var ignorePath = null;
|
|
10000
|
+
function locationsAreEqual$$1(a, b2) {
|
|
10001
|
+
return a.pathname === b2.pathname && a.search === b2.search && a.hash === b2.hash;
|
|
10002
|
+
}
|
|
10003
|
+
function handleHashChange() {
|
|
10004
|
+
var path2 = getHashPath();
|
|
10005
|
+
var encodedPath2 = encodePath2(path2);
|
|
10006
|
+
if (path2 !== encodedPath2) {
|
|
10007
|
+
replaceHashPath(encodedPath2);
|
|
10008
|
+
} else {
|
|
10009
|
+
var location2 = getDOMLocation();
|
|
10010
|
+
var prevLocation = history2.location;
|
|
10011
|
+
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location2))
|
|
10012
|
+
return;
|
|
10013
|
+
if (ignorePath === createPath(location2))
|
|
10014
|
+
return;
|
|
10015
|
+
ignorePath = null;
|
|
10016
|
+
handlePop(location2);
|
|
10017
|
+
}
|
|
10018
|
+
}
|
|
10019
|
+
function handlePop(location2) {
|
|
10020
|
+
if (forceNextPop) {
|
|
10021
|
+
forceNextPop = false;
|
|
10022
|
+
setState();
|
|
10023
|
+
} else {
|
|
10024
|
+
var action = "POP";
|
|
10025
|
+
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10026
|
+
if (ok) {
|
|
10027
|
+
setState({
|
|
10028
|
+
action,
|
|
10029
|
+
location: location2
|
|
10030
|
+
});
|
|
10031
|
+
} else {
|
|
10032
|
+
revertPop(location2);
|
|
10033
|
+
}
|
|
10034
|
+
});
|
|
10035
|
+
}
|
|
10036
|
+
}
|
|
10037
|
+
function revertPop(fromLocation) {
|
|
10038
|
+
var toLocation = history2.location;
|
|
10039
|
+
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
|
10040
|
+
if (toIndex === -1)
|
|
10041
|
+
toIndex = 0;
|
|
10042
|
+
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
|
10043
|
+
if (fromIndex === -1)
|
|
10044
|
+
fromIndex = 0;
|
|
10045
|
+
var delta = toIndex - fromIndex;
|
|
10046
|
+
if (delta) {
|
|
10047
|
+
forceNextPop = true;
|
|
10048
|
+
go(delta);
|
|
10049
|
+
}
|
|
10050
|
+
}
|
|
10051
|
+
var path = getHashPath();
|
|
10052
|
+
var encodedPath = encodePath2(path);
|
|
10053
|
+
if (path !== encodedPath)
|
|
10054
|
+
replaceHashPath(encodedPath);
|
|
10055
|
+
var initialLocation = getDOMLocation();
|
|
10056
|
+
var allPaths = [createPath(initialLocation)];
|
|
10057
|
+
function createHref(location2) {
|
|
10058
|
+
var baseTag = document.querySelector("base");
|
|
10059
|
+
var href = "";
|
|
10060
|
+
if (baseTag && baseTag.getAttribute("href")) {
|
|
10061
|
+
href = stripHash(window.location.href);
|
|
10062
|
+
}
|
|
10063
|
+
return href + "#" + encodePath2(basename + createPath(location2));
|
|
10064
|
+
}
|
|
10065
|
+
function push(path2, state) {
|
|
10066
|
+
process.env.NODE_ENV !== "production" ? warning(state === void 0, "Hash history cannot push state; it is ignored") : void 0;
|
|
10067
|
+
var action = "PUSH";
|
|
10068
|
+
var location2 = createLocation(path2, void 0, void 0, history2.location);
|
|
10069
|
+
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10070
|
+
if (!ok)
|
|
10071
|
+
return;
|
|
10072
|
+
var path3 = createPath(location2);
|
|
10073
|
+
var encodedPath2 = encodePath2(basename + path3);
|
|
10074
|
+
var hashChanged = getHashPath() !== encodedPath2;
|
|
10075
|
+
if (hashChanged) {
|
|
10076
|
+
ignorePath = path3;
|
|
10077
|
+
pushHashPath(encodedPath2);
|
|
10078
|
+
var prevIndex = allPaths.lastIndexOf(createPath(history2.location));
|
|
10079
|
+
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
|
10080
|
+
nextPaths.push(path3);
|
|
10081
|
+
allPaths = nextPaths;
|
|
10082
|
+
setState({
|
|
10083
|
+
action,
|
|
10084
|
+
location: location2
|
|
10085
|
+
});
|
|
10086
|
+
} else {
|
|
10087
|
+
process.env.NODE_ENV !== "production" ? warning(false, "Hash history cannot PUSH the same path; a new entry will not be added to the history stack") : void 0;
|
|
10088
|
+
setState();
|
|
10089
|
+
}
|
|
10090
|
+
});
|
|
10091
|
+
}
|
|
10092
|
+
function replace(path2, state) {
|
|
10093
|
+
process.env.NODE_ENV !== "production" ? warning(state === void 0, "Hash history cannot replace state; it is ignored") : void 0;
|
|
10094
|
+
var action = "REPLACE";
|
|
10095
|
+
var location2 = createLocation(path2, void 0, void 0, history2.location);
|
|
10096
|
+
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10097
|
+
if (!ok)
|
|
10098
|
+
return;
|
|
10099
|
+
var path3 = createPath(location2);
|
|
10100
|
+
var encodedPath2 = encodePath2(basename + path3);
|
|
10101
|
+
var hashChanged = getHashPath() !== encodedPath2;
|
|
10102
|
+
if (hashChanged) {
|
|
10103
|
+
ignorePath = path3;
|
|
10104
|
+
replaceHashPath(encodedPath2);
|
|
10105
|
+
}
|
|
10106
|
+
var prevIndex = allPaths.indexOf(createPath(history2.location));
|
|
10107
|
+
if (prevIndex !== -1)
|
|
10108
|
+
allPaths[prevIndex] = path3;
|
|
10109
|
+
setState({
|
|
10110
|
+
action,
|
|
10111
|
+
location: location2
|
|
10112
|
+
});
|
|
10113
|
+
});
|
|
10114
|
+
}
|
|
10115
|
+
function go(n) {
|
|
10116
|
+
process.env.NODE_ENV !== "production" ? warning(canGoWithoutReload, "Hash history go(n) causes a full page reload in this browser") : void 0;
|
|
10117
|
+
globalHistory.go(n);
|
|
10118
|
+
}
|
|
10119
|
+
function goBack() {
|
|
10120
|
+
go(-1);
|
|
10121
|
+
}
|
|
10122
|
+
function goForward() {
|
|
10123
|
+
go(1);
|
|
10124
|
+
}
|
|
10125
|
+
var listenerCount = 0;
|
|
10126
|
+
function checkDOMListeners(delta) {
|
|
10127
|
+
listenerCount += delta;
|
|
10128
|
+
if (listenerCount === 1 && delta === 1) {
|
|
10129
|
+
window.addEventListener(HashChangeEvent$1, handleHashChange);
|
|
10130
|
+
} else if (listenerCount === 0) {
|
|
10131
|
+
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
|
10132
|
+
}
|
|
10133
|
+
}
|
|
10134
|
+
var isBlocked = false;
|
|
10135
|
+
function block(prompt) {
|
|
10136
|
+
if (prompt === void 0) {
|
|
10137
|
+
prompt = false;
|
|
10138
|
+
}
|
|
10139
|
+
var unblock = transitionManager.setPrompt(prompt);
|
|
10140
|
+
if (!isBlocked) {
|
|
10141
|
+
checkDOMListeners(1);
|
|
10142
|
+
isBlocked = true;
|
|
10143
|
+
}
|
|
10144
|
+
return function() {
|
|
10145
|
+
if (isBlocked) {
|
|
10146
|
+
isBlocked = false;
|
|
10147
|
+
checkDOMListeners(-1);
|
|
10148
|
+
}
|
|
10149
|
+
return unblock();
|
|
10150
|
+
};
|
|
10151
|
+
}
|
|
10152
|
+
function listen(listener) {
|
|
10153
|
+
var unlisten = transitionManager.appendListener(listener);
|
|
10154
|
+
checkDOMListeners(1);
|
|
10155
|
+
return function() {
|
|
10156
|
+
checkDOMListeners(-1);
|
|
10157
|
+
unlisten();
|
|
10158
|
+
};
|
|
10159
|
+
}
|
|
10160
|
+
var history2 = {
|
|
10161
|
+
length: globalHistory.length,
|
|
10162
|
+
action: "POP",
|
|
10163
|
+
location: initialLocation,
|
|
10164
|
+
createHref,
|
|
10165
|
+
push,
|
|
10166
|
+
replace,
|
|
10167
|
+
go,
|
|
10168
|
+
goBack,
|
|
10169
|
+
goForward,
|
|
10170
|
+
block,
|
|
10171
|
+
listen
|
|
10172
|
+
};
|
|
10173
|
+
return history2;
|
|
10174
|
+
}
|
|
9687
10175
|
const index_1wt5px2 = "";
|
|
9688
10176
|
const MenuStyle = "mdppgn0";
|
|
9689
10177
|
const Menu = () => {
|
|
@@ -9761,9 +10249,10 @@ const globalStore = new GlobalStore({
|
|
|
9761
10249
|
watchWsApiUrl: "api/sks-ws/k8s",
|
|
9762
10250
|
prefix: "default"
|
|
9763
10251
|
});
|
|
10252
|
+
const history = createHashHistory();
|
|
9764
10253
|
const Dovetail = (props) => {
|
|
9765
10254
|
const { resourcesConfig, urlPrefix } = props;
|
|
9766
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
10255
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(Router, { history, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9767
10256
|
Refine,
|
|
9768
10257
|
{
|
|
9769
10258
|
dataProvider: {
|
|
@@ -9784,10 +10273,10 @@ const Dovetail = (props) => {
|
|
|
9784
10273
|
parent: c.parent,
|
|
9785
10274
|
label: `${c.kind}s`
|
|
9786
10275
|
},
|
|
9787
|
-
list:
|
|
9788
|
-
show:
|
|
9789
|
-
create:
|
|
9790
|
-
edit:
|
|
10276
|
+
list: `${urlPrefix}/${c.name}`,
|
|
10277
|
+
show: `${urlPrefix}/${c.name}/show`,
|
|
10278
|
+
create: `${urlPrefix}/${c.name}/create`,
|
|
10279
|
+
edit: `${urlPrefix}/${c.name}/edit`
|
|
9791
10280
|
};
|
|
9792
10281
|
}),
|
|
9793
10282
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Layout, { children: /* @__PURE__ */ jsxRuntime.exports.jsxs(Switch, { children: [
|
package/dist/refine.js
CHANGED
package/dist/refine.umd.cjs
CHANGED
|
@@ -716,7 +716,7 @@ var __publicField = (obj, key, value) => {
|
|
|
716
716
|
const routerProvider = {
|
|
717
717
|
go: () => {
|
|
718
718
|
const { search: existingSearch, hash: existingHash } = reactRouterDom.useLocation();
|
|
719
|
-
const
|
|
719
|
+
const history2 = reactRouterDom.useHistory();
|
|
720
720
|
const fn = React.useCallback(
|
|
721
721
|
({ to, type, query, hash, options: { keepQuery, keepHash } = {} }) => {
|
|
722
722
|
const urlQuery = {
|
|
@@ -737,17 +737,17 @@ var __publicField = (obj, key, value) => {
|
|
|
737
737
|
if (type === "path") {
|
|
738
738
|
return fullPath;
|
|
739
739
|
}
|
|
740
|
-
return
|
|
740
|
+
return history2[type || "push"](fullPath);
|
|
741
741
|
},
|
|
742
|
-
[existingHash, existingSearch,
|
|
742
|
+
[existingHash, existingSearch, history2]
|
|
743
743
|
);
|
|
744
744
|
return fn;
|
|
745
745
|
},
|
|
746
746
|
back: () => {
|
|
747
|
-
const
|
|
747
|
+
const history2 = reactRouterDom.useHistory();
|
|
748
748
|
const fn = React.useCallback(() => {
|
|
749
|
-
|
|
750
|
-
}, [
|
|
749
|
+
history2.go(-1);
|
|
750
|
+
}, [history2]);
|
|
751
751
|
return fn;
|
|
752
752
|
},
|
|
753
753
|
parse: () => {
|
|
@@ -787,6 +787,20 @@ var __publicField = (obj, key, value) => {
|
|
|
787
787
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Link, { ...props, ref });
|
|
788
788
|
})
|
|
789
789
|
};
|
|
790
|
+
function _extends() {
|
|
791
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
792
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
793
|
+
var source = arguments[i];
|
|
794
|
+
for (var key in source) {
|
|
795
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
796
|
+
target[key] = source[key];
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
return target;
|
|
801
|
+
};
|
|
802
|
+
return _extends.apply(this, arguments);
|
|
803
|
+
}
|
|
790
804
|
function warn() {
|
|
791
805
|
if (console && console.warn) {
|
|
792
806
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -5971,9 +5985,9 @@ var __publicField = (obj, key, value) => {
|
|
|
5971
5985
|
}
|
|
5972
5986
|
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
|
5973
5987
|
}
|
|
5974
|
-
function uniqueId(
|
|
5988
|
+
function uniqueId(prefix2) {
|
|
5975
5989
|
var id = ++idCounter;
|
|
5976
|
-
return toString(
|
|
5990
|
+
return toString(prefix2) + id;
|
|
5977
5991
|
}
|
|
5978
5992
|
var add = createMathOperation(function(augend, addend) {
|
|
5979
5993
|
return augend + addend;
|
|
@@ -9113,7 +9127,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9113
9127
|
var _a, _b;
|
|
9114
9128
|
const formatter = config.formatter || ((v2) => new ResourceModel(v2));
|
|
9115
9129
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [
|
|
9116
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path:
|
|
9130
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}`, exact: true, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9117
9131
|
ResourceList,
|
|
9118
9132
|
{
|
|
9119
9133
|
name: config.kind,
|
|
@@ -9122,7 +9136,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9122
9136
|
Dropdown: config.Dropdown
|
|
9123
9137
|
}
|
|
9124
9138
|
) }),
|
|
9125
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path:
|
|
9139
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}/show`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9126
9140
|
ResourceShow,
|
|
9127
9141
|
{
|
|
9128
9142
|
formatter,
|
|
@@ -9130,8 +9144,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9130
9144
|
Dropdown: config.Dropdown
|
|
9131
9145
|
}
|
|
9132
9146
|
) }),
|
|
9133
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path:
|
|
9134
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path:
|
|
9147
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}/create`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceForm, { config }) }),
|
|
9148
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}/edit`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(ResourceForm, { config }) })
|
|
9135
9149
|
] });
|
|
9136
9150
|
}) });
|
|
9137
9151
|
};
|
|
@@ -9699,6 +9713,480 @@ var __publicField = (obj, key, value) => {
|
|
|
9699
9713
|
var liveProvider = lib.liveProvider = It;
|
|
9700
9714
|
lib.mapOperator = nt;
|
|
9701
9715
|
lib.sortData = M;
|
|
9716
|
+
function isAbsolute(pathname) {
|
|
9717
|
+
return pathname.charAt(0) === "/";
|
|
9718
|
+
}
|
|
9719
|
+
function spliceOne(list, index) {
|
|
9720
|
+
for (var i = index, k2 = i + 1, n = list.length; k2 < n; i += 1, k2 += 1) {
|
|
9721
|
+
list[i] = list[k2];
|
|
9722
|
+
}
|
|
9723
|
+
list.pop();
|
|
9724
|
+
}
|
|
9725
|
+
function resolvePathname(to, from) {
|
|
9726
|
+
if (from === void 0)
|
|
9727
|
+
from = "";
|
|
9728
|
+
var toParts = to && to.split("/") || [];
|
|
9729
|
+
var fromParts = from && from.split("/") || [];
|
|
9730
|
+
var isToAbs = to && isAbsolute(to);
|
|
9731
|
+
var isFromAbs = from && isAbsolute(from);
|
|
9732
|
+
var mustEndAbs = isToAbs || isFromAbs;
|
|
9733
|
+
if (to && isAbsolute(to)) {
|
|
9734
|
+
fromParts = toParts;
|
|
9735
|
+
} else if (toParts.length) {
|
|
9736
|
+
fromParts.pop();
|
|
9737
|
+
fromParts = fromParts.concat(toParts);
|
|
9738
|
+
}
|
|
9739
|
+
if (!fromParts.length)
|
|
9740
|
+
return "/";
|
|
9741
|
+
var hasTrailingSlash;
|
|
9742
|
+
if (fromParts.length) {
|
|
9743
|
+
var last = fromParts[fromParts.length - 1];
|
|
9744
|
+
hasTrailingSlash = last === "." || last === ".." || last === "";
|
|
9745
|
+
} else {
|
|
9746
|
+
hasTrailingSlash = false;
|
|
9747
|
+
}
|
|
9748
|
+
var up = 0;
|
|
9749
|
+
for (var i = fromParts.length; i >= 0; i--) {
|
|
9750
|
+
var part = fromParts[i];
|
|
9751
|
+
if (part === ".") {
|
|
9752
|
+
spliceOne(fromParts, i);
|
|
9753
|
+
} else if (part === "..") {
|
|
9754
|
+
spliceOne(fromParts, i);
|
|
9755
|
+
up++;
|
|
9756
|
+
} else if (up) {
|
|
9757
|
+
spliceOne(fromParts, i);
|
|
9758
|
+
up--;
|
|
9759
|
+
}
|
|
9760
|
+
}
|
|
9761
|
+
if (!mustEndAbs)
|
|
9762
|
+
for (; up--; up)
|
|
9763
|
+
fromParts.unshift("..");
|
|
9764
|
+
if (mustEndAbs && fromParts[0] !== "" && (!fromParts[0] || !isAbsolute(fromParts[0])))
|
|
9765
|
+
fromParts.unshift("");
|
|
9766
|
+
var result = fromParts.join("/");
|
|
9767
|
+
if (hasTrailingSlash && result.substr(-1) !== "/")
|
|
9768
|
+
result += "/";
|
|
9769
|
+
return result;
|
|
9770
|
+
}
|
|
9771
|
+
var isProduction$1 = process.env.NODE_ENV === "production";
|
|
9772
|
+
function warning(condition, message) {
|
|
9773
|
+
if (!isProduction$1) {
|
|
9774
|
+
if (condition) {
|
|
9775
|
+
return;
|
|
9776
|
+
}
|
|
9777
|
+
var text = "Warning: " + message;
|
|
9778
|
+
if (typeof console !== "undefined") {
|
|
9779
|
+
console.warn(text);
|
|
9780
|
+
}
|
|
9781
|
+
try {
|
|
9782
|
+
throw Error(text);
|
|
9783
|
+
} catch (x2) {
|
|
9784
|
+
}
|
|
9785
|
+
}
|
|
9786
|
+
}
|
|
9787
|
+
var isProduction = process.env.NODE_ENV === "production";
|
|
9788
|
+
var prefix = "Invariant failed";
|
|
9789
|
+
function invariant(condition, message) {
|
|
9790
|
+
if (condition) {
|
|
9791
|
+
return;
|
|
9792
|
+
}
|
|
9793
|
+
if (isProduction) {
|
|
9794
|
+
throw new Error(prefix);
|
|
9795
|
+
}
|
|
9796
|
+
var provided = typeof message === "function" ? message() : message;
|
|
9797
|
+
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
9798
|
+
throw new Error(value);
|
|
9799
|
+
}
|
|
9800
|
+
function addLeadingSlash(path) {
|
|
9801
|
+
return path.charAt(0) === "/" ? path : "/" + path;
|
|
9802
|
+
}
|
|
9803
|
+
function stripLeadingSlash(path) {
|
|
9804
|
+
return path.charAt(0) === "/" ? path.substr(1) : path;
|
|
9805
|
+
}
|
|
9806
|
+
function hasBasename(path, prefix2) {
|
|
9807
|
+
return path.toLowerCase().indexOf(prefix2.toLowerCase()) === 0 && "/?#".indexOf(path.charAt(prefix2.length)) !== -1;
|
|
9808
|
+
}
|
|
9809
|
+
function stripBasename(path, prefix2) {
|
|
9810
|
+
return hasBasename(path, prefix2) ? path.substr(prefix2.length) : path;
|
|
9811
|
+
}
|
|
9812
|
+
function stripTrailingSlash(path) {
|
|
9813
|
+
return path.charAt(path.length - 1) === "/" ? path.slice(0, -1) : path;
|
|
9814
|
+
}
|
|
9815
|
+
function parsePath(path) {
|
|
9816
|
+
var pathname = path || "/";
|
|
9817
|
+
var search = "";
|
|
9818
|
+
var hash = "";
|
|
9819
|
+
var hashIndex = pathname.indexOf("#");
|
|
9820
|
+
if (hashIndex !== -1) {
|
|
9821
|
+
hash = pathname.substr(hashIndex);
|
|
9822
|
+
pathname = pathname.substr(0, hashIndex);
|
|
9823
|
+
}
|
|
9824
|
+
var searchIndex = pathname.indexOf("?");
|
|
9825
|
+
if (searchIndex !== -1) {
|
|
9826
|
+
search = pathname.substr(searchIndex);
|
|
9827
|
+
pathname = pathname.substr(0, searchIndex);
|
|
9828
|
+
}
|
|
9829
|
+
return {
|
|
9830
|
+
pathname,
|
|
9831
|
+
search: search === "?" ? "" : search,
|
|
9832
|
+
hash: hash === "#" ? "" : hash
|
|
9833
|
+
};
|
|
9834
|
+
}
|
|
9835
|
+
function createPath(location2) {
|
|
9836
|
+
var pathname = location2.pathname, search = location2.search, hash = location2.hash;
|
|
9837
|
+
var path = pathname || "/";
|
|
9838
|
+
if (search && search !== "?")
|
|
9839
|
+
path += search.charAt(0) === "?" ? search : "?" + search;
|
|
9840
|
+
if (hash && hash !== "#")
|
|
9841
|
+
path += hash.charAt(0) === "#" ? hash : "#" + hash;
|
|
9842
|
+
return path;
|
|
9843
|
+
}
|
|
9844
|
+
function createLocation(path, state, key, currentLocation) {
|
|
9845
|
+
var location2;
|
|
9846
|
+
if (typeof path === "string") {
|
|
9847
|
+
location2 = parsePath(path);
|
|
9848
|
+
location2.state = state;
|
|
9849
|
+
} else {
|
|
9850
|
+
location2 = _extends({}, path);
|
|
9851
|
+
if (location2.pathname === void 0)
|
|
9852
|
+
location2.pathname = "";
|
|
9853
|
+
if (location2.search) {
|
|
9854
|
+
if (location2.search.charAt(0) !== "?")
|
|
9855
|
+
location2.search = "?" + location2.search;
|
|
9856
|
+
} else {
|
|
9857
|
+
location2.search = "";
|
|
9858
|
+
}
|
|
9859
|
+
if (location2.hash) {
|
|
9860
|
+
if (location2.hash.charAt(0) !== "#")
|
|
9861
|
+
location2.hash = "#" + location2.hash;
|
|
9862
|
+
} else {
|
|
9863
|
+
location2.hash = "";
|
|
9864
|
+
}
|
|
9865
|
+
if (state !== void 0 && location2.state === void 0)
|
|
9866
|
+
location2.state = state;
|
|
9867
|
+
}
|
|
9868
|
+
try {
|
|
9869
|
+
location2.pathname = decodeURI(location2.pathname);
|
|
9870
|
+
} catch (e) {
|
|
9871
|
+
if (e instanceof URIError) {
|
|
9872
|
+
throw new URIError('Pathname "' + location2.pathname + '" could not be decoded. This is likely caused by an invalid percent-encoding.');
|
|
9873
|
+
} else {
|
|
9874
|
+
throw e;
|
|
9875
|
+
}
|
|
9876
|
+
}
|
|
9877
|
+
if (key)
|
|
9878
|
+
location2.key = key;
|
|
9879
|
+
if (currentLocation) {
|
|
9880
|
+
if (!location2.pathname) {
|
|
9881
|
+
location2.pathname = currentLocation.pathname;
|
|
9882
|
+
} else if (location2.pathname.charAt(0) !== "/") {
|
|
9883
|
+
location2.pathname = resolvePathname(location2.pathname, currentLocation.pathname);
|
|
9884
|
+
}
|
|
9885
|
+
} else {
|
|
9886
|
+
if (!location2.pathname) {
|
|
9887
|
+
location2.pathname = "/";
|
|
9888
|
+
}
|
|
9889
|
+
}
|
|
9890
|
+
return location2;
|
|
9891
|
+
}
|
|
9892
|
+
function createTransitionManager() {
|
|
9893
|
+
var prompt = null;
|
|
9894
|
+
function setPrompt(nextPrompt) {
|
|
9895
|
+
process.env.NODE_ENV !== "production" ? warning(prompt == null, "A history supports only one prompt at a time") : void 0;
|
|
9896
|
+
prompt = nextPrompt;
|
|
9897
|
+
return function() {
|
|
9898
|
+
if (prompt === nextPrompt)
|
|
9899
|
+
prompt = null;
|
|
9900
|
+
};
|
|
9901
|
+
}
|
|
9902
|
+
function confirmTransitionTo(location2, action, getUserConfirmation, callback) {
|
|
9903
|
+
if (prompt != null) {
|
|
9904
|
+
var result = typeof prompt === "function" ? prompt(location2, action) : prompt;
|
|
9905
|
+
if (typeof result === "string") {
|
|
9906
|
+
if (typeof getUserConfirmation === "function") {
|
|
9907
|
+
getUserConfirmation(result, callback);
|
|
9908
|
+
} else {
|
|
9909
|
+
process.env.NODE_ENV !== "production" ? warning(false, "A history needs a getUserConfirmation function in order to use a prompt message") : void 0;
|
|
9910
|
+
callback(true);
|
|
9911
|
+
}
|
|
9912
|
+
} else {
|
|
9913
|
+
callback(result !== false);
|
|
9914
|
+
}
|
|
9915
|
+
} else {
|
|
9916
|
+
callback(true);
|
|
9917
|
+
}
|
|
9918
|
+
}
|
|
9919
|
+
var listeners = [];
|
|
9920
|
+
function appendListener(fn) {
|
|
9921
|
+
var isActive = true;
|
|
9922
|
+
function listener() {
|
|
9923
|
+
if (isActive)
|
|
9924
|
+
fn.apply(void 0, arguments);
|
|
9925
|
+
}
|
|
9926
|
+
listeners.push(listener);
|
|
9927
|
+
return function() {
|
|
9928
|
+
isActive = false;
|
|
9929
|
+
listeners = listeners.filter(function(item) {
|
|
9930
|
+
return item !== listener;
|
|
9931
|
+
});
|
|
9932
|
+
};
|
|
9933
|
+
}
|
|
9934
|
+
function notifyListeners() {
|
|
9935
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9936
|
+
args[_key] = arguments[_key];
|
|
9937
|
+
}
|
|
9938
|
+
listeners.forEach(function(listener) {
|
|
9939
|
+
return listener.apply(void 0, args);
|
|
9940
|
+
});
|
|
9941
|
+
}
|
|
9942
|
+
return {
|
|
9943
|
+
setPrompt,
|
|
9944
|
+
confirmTransitionTo,
|
|
9945
|
+
appendListener,
|
|
9946
|
+
notifyListeners
|
|
9947
|
+
};
|
|
9948
|
+
}
|
|
9949
|
+
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
9950
|
+
function getConfirmation(message, callback) {
|
|
9951
|
+
callback(window.confirm(message));
|
|
9952
|
+
}
|
|
9953
|
+
function supportsGoWithoutReloadUsingHash() {
|
|
9954
|
+
return window.navigator.userAgent.indexOf("Firefox") === -1;
|
|
9955
|
+
}
|
|
9956
|
+
var HashChangeEvent$1 = "hashchange";
|
|
9957
|
+
var HashPathCoders = {
|
|
9958
|
+
hashbang: {
|
|
9959
|
+
encodePath: function encodePath(path) {
|
|
9960
|
+
return path.charAt(0) === "!" ? path : "!/" + stripLeadingSlash(path);
|
|
9961
|
+
},
|
|
9962
|
+
decodePath: function decodePath(path) {
|
|
9963
|
+
return path.charAt(0) === "!" ? path.substr(1) : path;
|
|
9964
|
+
}
|
|
9965
|
+
},
|
|
9966
|
+
noslash: {
|
|
9967
|
+
encodePath: stripLeadingSlash,
|
|
9968
|
+
decodePath: addLeadingSlash
|
|
9969
|
+
},
|
|
9970
|
+
slash: {
|
|
9971
|
+
encodePath: addLeadingSlash,
|
|
9972
|
+
decodePath: addLeadingSlash
|
|
9973
|
+
}
|
|
9974
|
+
};
|
|
9975
|
+
function stripHash(url) {
|
|
9976
|
+
var hashIndex = url.indexOf("#");
|
|
9977
|
+
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
9978
|
+
}
|
|
9979
|
+
function getHashPath() {
|
|
9980
|
+
var href = window.location.href;
|
|
9981
|
+
var hashIndex = href.indexOf("#");
|
|
9982
|
+
return hashIndex === -1 ? "" : href.substring(hashIndex + 1);
|
|
9983
|
+
}
|
|
9984
|
+
function pushHashPath(path) {
|
|
9985
|
+
window.location.hash = path;
|
|
9986
|
+
}
|
|
9987
|
+
function replaceHashPath(path) {
|
|
9988
|
+
window.location.replace(stripHash(window.location.href) + "#" + path);
|
|
9989
|
+
}
|
|
9990
|
+
function createHashHistory(props) {
|
|
9991
|
+
if (props === void 0) {
|
|
9992
|
+
props = {};
|
|
9993
|
+
}
|
|
9994
|
+
!canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, "Hash history needs a DOM") : invariant(false) : void 0;
|
|
9995
|
+
var globalHistory = window.history;
|
|
9996
|
+
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
|
9997
|
+
var _props = props, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$hashType = _props.hashType, hashType = _props$hashType === void 0 ? "slash" : _props$hashType;
|
|
9998
|
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : "";
|
|
9999
|
+
var _HashPathCoders$hashT = HashPathCoders[hashType], encodePath = _HashPathCoders$hashT.encodePath, decodePath = _HashPathCoders$hashT.decodePath;
|
|
10000
|
+
function getDOMLocation() {
|
|
10001
|
+
var path2 = decodePath(getHashPath());
|
|
10002
|
+
process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path2, basename), 'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "' + path2 + '" to begin with "' + basename + '".') : void 0;
|
|
10003
|
+
if (basename)
|
|
10004
|
+
path2 = stripBasename(path2, basename);
|
|
10005
|
+
return createLocation(path2);
|
|
10006
|
+
}
|
|
10007
|
+
var transitionManager = createTransitionManager();
|
|
10008
|
+
function setState(nextState) {
|
|
10009
|
+
_extends(history2, nextState);
|
|
10010
|
+
history2.length = globalHistory.length;
|
|
10011
|
+
transitionManager.notifyListeners(history2.location, history2.action);
|
|
10012
|
+
}
|
|
10013
|
+
var forceNextPop = false;
|
|
10014
|
+
var ignorePath = null;
|
|
10015
|
+
function locationsAreEqual$$1(a, b2) {
|
|
10016
|
+
return a.pathname === b2.pathname && a.search === b2.search && a.hash === b2.hash;
|
|
10017
|
+
}
|
|
10018
|
+
function handleHashChange() {
|
|
10019
|
+
var path2 = getHashPath();
|
|
10020
|
+
var encodedPath2 = encodePath(path2);
|
|
10021
|
+
if (path2 !== encodedPath2) {
|
|
10022
|
+
replaceHashPath(encodedPath2);
|
|
10023
|
+
} else {
|
|
10024
|
+
var location2 = getDOMLocation();
|
|
10025
|
+
var prevLocation = history2.location;
|
|
10026
|
+
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location2))
|
|
10027
|
+
return;
|
|
10028
|
+
if (ignorePath === createPath(location2))
|
|
10029
|
+
return;
|
|
10030
|
+
ignorePath = null;
|
|
10031
|
+
handlePop(location2);
|
|
10032
|
+
}
|
|
10033
|
+
}
|
|
10034
|
+
function handlePop(location2) {
|
|
10035
|
+
if (forceNextPop) {
|
|
10036
|
+
forceNextPop = false;
|
|
10037
|
+
setState();
|
|
10038
|
+
} else {
|
|
10039
|
+
var action = "POP";
|
|
10040
|
+
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10041
|
+
if (ok) {
|
|
10042
|
+
setState({
|
|
10043
|
+
action,
|
|
10044
|
+
location: location2
|
|
10045
|
+
});
|
|
10046
|
+
} else {
|
|
10047
|
+
revertPop(location2);
|
|
10048
|
+
}
|
|
10049
|
+
});
|
|
10050
|
+
}
|
|
10051
|
+
}
|
|
10052
|
+
function revertPop(fromLocation) {
|
|
10053
|
+
var toLocation = history2.location;
|
|
10054
|
+
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
|
10055
|
+
if (toIndex === -1)
|
|
10056
|
+
toIndex = 0;
|
|
10057
|
+
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
|
10058
|
+
if (fromIndex === -1)
|
|
10059
|
+
fromIndex = 0;
|
|
10060
|
+
var delta = toIndex - fromIndex;
|
|
10061
|
+
if (delta) {
|
|
10062
|
+
forceNextPop = true;
|
|
10063
|
+
go(delta);
|
|
10064
|
+
}
|
|
10065
|
+
}
|
|
10066
|
+
var path = getHashPath();
|
|
10067
|
+
var encodedPath = encodePath(path);
|
|
10068
|
+
if (path !== encodedPath)
|
|
10069
|
+
replaceHashPath(encodedPath);
|
|
10070
|
+
var initialLocation = getDOMLocation();
|
|
10071
|
+
var allPaths = [createPath(initialLocation)];
|
|
10072
|
+
function createHref(location2) {
|
|
10073
|
+
var baseTag = document.querySelector("base");
|
|
10074
|
+
var href = "";
|
|
10075
|
+
if (baseTag && baseTag.getAttribute("href")) {
|
|
10076
|
+
href = stripHash(window.location.href);
|
|
10077
|
+
}
|
|
10078
|
+
return href + "#" + encodePath(basename + createPath(location2));
|
|
10079
|
+
}
|
|
10080
|
+
function push(path2, state) {
|
|
10081
|
+
process.env.NODE_ENV !== "production" ? warning(state === void 0, "Hash history cannot push state; it is ignored") : void 0;
|
|
10082
|
+
var action = "PUSH";
|
|
10083
|
+
var location2 = createLocation(path2, void 0, void 0, history2.location);
|
|
10084
|
+
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10085
|
+
if (!ok)
|
|
10086
|
+
return;
|
|
10087
|
+
var path3 = createPath(location2);
|
|
10088
|
+
var encodedPath2 = encodePath(basename + path3);
|
|
10089
|
+
var hashChanged = getHashPath() !== encodedPath2;
|
|
10090
|
+
if (hashChanged) {
|
|
10091
|
+
ignorePath = path3;
|
|
10092
|
+
pushHashPath(encodedPath2);
|
|
10093
|
+
var prevIndex = allPaths.lastIndexOf(createPath(history2.location));
|
|
10094
|
+
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
|
10095
|
+
nextPaths.push(path3);
|
|
10096
|
+
allPaths = nextPaths;
|
|
10097
|
+
setState({
|
|
10098
|
+
action,
|
|
10099
|
+
location: location2
|
|
10100
|
+
});
|
|
10101
|
+
} else {
|
|
10102
|
+
process.env.NODE_ENV !== "production" ? warning(false, "Hash history cannot PUSH the same path; a new entry will not be added to the history stack") : void 0;
|
|
10103
|
+
setState();
|
|
10104
|
+
}
|
|
10105
|
+
});
|
|
10106
|
+
}
|
|
10107
|
+
function replace(path2, state) {
|
|
10108
|
+
process.env.NODE_ENV !== "production" ? warning(state === void 0, "Hash history cannot replace state; it is ignored") : void 0;
|
|
10109
|
+
var action = "REPLACE";
|
|
10110
|
+
var location2 = createLocation(path2, void 0, void 0, history2.location);
|
|
10111
|
+
transitionManager.confirmTransitionTo(location2, action, getUserConfirmation, function(ok) {
|
|
10112
|
+
if (!ok)
|
|
10113
|
+
return;
|
|
10114
|
+
var path3 = createPath(location2);
|
|
10115
|
+
var encodedPath2 = encodePath(basename + path3);
|
|
10116
|
+
var hashChanged = getHashPath() !== encodedPath2;
|
|
10117
|
+
if (hashChanged) {
|
|
10118
|
+
ignorePath = path3;
|
|
10119
|
+
replaceHashPath(encodedPath2);
|
|
10120
|
+
}
|
|
10121
|
+
var prevIndex = allPaths.indexOf(createPath(history2.location));
|
|
10122
|
+
if (prevIndex !== -1)
|
|
10123
|
+
allPaths[prevIndex] = path3;
|
|
10124
|
+
setState({
|
|
10125
|
+
action,
|
|
10126
|
+
location: location2
|
|
10127
|
+
});
|
|
10128
|
+
});
|
|
10129
|
+
}
|
|
10130
|
+
function go(n) {
|
|
10131
|
+
process.env.NODE_ENV !== "production" ? warning(canGoWithoutReload, "Hash history go(n) causes a full page reload in this browser") : void 0;
|
|
10132
|
+
globalHistory.go(n);
|
|
10133
|
+
}
|
|
10134
|
+
function goBack() {
|
|
10135
|
+
go(-1);
|
|
10136
|
+
}
|
|
10137
|
+
function goForward() {
|
|
10138
|
+
go(1);
|
|
10139
|
+
}
|
|
10140
|
+
var listenerCount = 0;
|
|
10141
|
+
function checkDOMListeners(delta) {
|
|
10142
|
+
listenerCount += delta;
|
|
10143
|
+
if (listenerCount === 1 && delta === 1) {
|
|
10144
|
+
window.addEventListener(HashChangeEvent$1, handleHashChange);
|
|
10145
|
+
} else if (listenerCount === 0) {
|
|
10146
|
+
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
|
10147
|
+
}
|
|
10148
|
+
}
|
|
10149
|
+
var isBlocked = false;
|
|
10150
|
+
function block(prompt) {
|
|
10151
|
+
if (prompt === void 0) {
|
|
10152
|
+
prompt = false;
|
|
10153
|
+
}
|
|
10154
|
+
var unblock = transitionManager.setPrompt(prompt);
|
|
10155
|
+
if (!isBlocked) {
|
|
10156
|
+
checkDOMListeners(1);
|
|
10157
|
+
isBlocked = true;
|
|
10158
|
+
}
|
|
10159
|
+
return function() {
|
|
10160
|
+
if (isBlocked) {
|
|
10161
|
+
isBlocked = false;
|
|
10162
|
+
checkDOMListeners(-1);
|
|
10163
|
+
}
|
|
10164
|
+
return unblock();
|
|
10165
|
+
};
|
|
10166
|
+
}
|
|
10167
|
+
function listen(listener) {
|
|
10168
|
+
var unlisten = transitionManager.appendListener(listener);
|
|
10169
|
+
checkDOMListeners(1);
|
|
10170
|
+
return function() {
|
|
10171
|
+
checkDOMListeners(-1);
|
|
10172
|
+
unlisten();
|
|
10173
|
+
};
|
|
10174
|
+
}
|
|
10175
|
+
var history2 = {
|
|
10176
|
+
length: globalHistory.length,
|
|
10177
|
+
action: "POP",
|
|
10178
|
+
location: initialLocation,
|
|
10179
|
+
createHref,
|
|
10180
|
+
push,
|
|
10181
|
+
replace,
|
|
10182
|
+
go,
|
|
10183
|
+
goBack,
|
|
10184
|
+
goForward,
|
|
10185
|
+
block,
|
|
10186
|
+
listen
|
|
10187
|
+
};
|
|
10188
|
+
return history2;
|
|
10189
|
+
}
|
|
9702
10190
|
const index_1wt5px2 = "";
|
|
9703
10191
|
const MenuStyle = "mdppgn0";
|
|
9704
10192
|
const Menu = () => {
|
|
@@ -9776,9 +10264,10 @@ var __publicField = (obj, key, value) => {
|
|
|
9776
10264
|
watchWsApiUrl: "api/sks-ws/k8s",
|
|
9777
10265
|
prefix: "default"
|
|
9778
10266
|
});
|
|
10267
|
+
const history = createHashHistory();
|
|
9779
10268
|
const Dovetail = (props) => {
|
|
9780
10269
|
const { resourcesConfig, urlPrefix } = props;
|
|
9781
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.
|
|
10270
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(reactRouterDom.Router, { history, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9782
10271
|
core.Refine,
|
|
9783
10272
|
{
|
|
9784
10273
|
dataProvider: {
|
|
@@ -9799,10 +10288,10 @@ var __publicField = (obj, key, value) => {
|
|
|
9799
10288
|
parent: c.parent,
|
|
9800
10289
|
label: `${c.kind}s`
|
|
9801
10290
|
},
|
|
9802
|
-
list:
|
|
9803
|
-
show:
|
|
9804
|
-
create:
|
|
9805
|
-
edit:
|
|
10291
|
+
list: `${urlPrefix}/${c.name}`,
|
|
10292
|
+
show: `${urlPrefix}/${c.name}/show`,
|
|
10293
|
+
create: `${urlPrefix}/${c.name}/create`,
|
|
10294
|
+
edit: `${urlPrefix}/${c.name}/edit`
|
|
9806
10295
|
};
|
|
9807
10296
|
}),
|
|
9808
10297
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Layout, { children: /* @__PURE__ */ jsxRuntime.exports.jsxs(reactRouterDom.Switch, { children: [
|