@karta.io/utils 1.0.0-beta.37 → 1.0.0-beta.39
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.cjs +39 -13
- package/dist/index.d.cts +24 -2
- package/dist/index.d.mts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.mjs +39 -13
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1010,9 +1010,20 @@ function useGlobalScroll() {
|
|
|
1010
1010
|
|
|
1011
1011
|
const CONFIRM_TEXT = "Are you sure you want to close? \nAll changes will be lost.";
|
|
1012
1012
|
let dialogs = [];
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
const HASH_PREFIX = "#ud_";
|
|
1014
|
+
function useDialog(options) {
|
|
1015
1015
|
const logger = useLogger("use-dialog");
|
|
1016
|
+
let hashPrefix = HASH_PREFIX;
|
|
1017
|
+
if (options?.hashPrefix) {
|
|
1018
|
+
if (options.hashPrefix.charAt(0) === "#") {
|
|
1019
|
+
hashPrefix = options?.hashPrefix;
|
|
1020
|
+
} else {
|
|
1021
|
+
logger.warn(
|
|
1022
|
+
`*hashPrefix* must start with "#". The default prefix "${HASH_PREFIX}" will be used`
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
let appContext;
|
|
1016
1027
|
const {
|
|
1017
1028
|
isLocked: isGlobalScrollLocked,
|
|
1018
1029
|
lock: lockGlobalScroll,
|
|
@@ -1020,15 +1031,26 @@ function useDialog() {
|
|
|
1020
1031
|
} = useGlobalScroll();
|
|
1021
1032
|
const route = vueRouter.useRoute();
|
|
1022
1033
|
const router = vueRouter.useRouter();
|
|
1023
|
-
const
|
|
1034
|
+
const genHash = ({
|
|
1035
|
+
layer = 0,
|
|
1036
|
+
componentName,
|
|
1037
|
+
props
|
|
1038
|
+
}) => {
|
|
1039
|
+
const data = {
|
|
1040
|
+
name: componentName,
|
|
1041
|
+
layer,
|
|
1042
|
+
props
|
|
1043
|
+
};
|
|
1044
|
+
return `${hashPrefix}${window.btoa(JSON.stringify(data))}`;
|
|
1045
|
+
};
|
|
1024
1046
|
const parseHash = (hash, componentName) => {
|
|
1025
1047
|
if (!hash)
|
|
1026
1048
|
return void 0;
|
|
1027
|
-
if (!hash.includes(
|
|
1049
|
+
if (!hash.includes(hashPrefix))
|
|
1028
1050
|
return void 0;
|
|
1029
1051
|
let dataFromHash;
|
|
1030
1052
|
try {
|
|
1031
|
-
dataFromHash = JSON.parse(window.atob(hash.slice(
|
|
1053
|
+
dataFromHash = JSON.parse(window.atob(hash.slice(hashPrefix.length)));
|
|
1032
1054
|
} catch (_error) {
|
|
1033
1055
|
logger.warn("*parseHash* cant parse hash");
|
|
1034
1056
|
}
|
|
@@ -1076,7 +1098,7 @@ function useDialog() {
|
|
|
1076
1098
|
vnode2.component.props.modelValue = value;
|
|
1077
1099
|
if (!value && route?.hash) {
|
|
1078
1100
|
const dataFromHash = parseHash(route.hash, component.name);
|
|
1079
|
-
if (dataFromHash)
|
|
1101
|
+
if (dataFromHash?.layer === layer)
|
|
1080
1102
|
clearHash();
|
|
1081
1103
|
}
|
|
1082
1104
|
if (!value && (dialogs.length === 1 || layer === 0) && isGlobalScrollLocked.value) {
|
|
@@ -1092,7 +1114,7 @@ function useDialog() {
|
|
|
1092
1114
|
if (!route?.hash)
|
|
1093
1115
|
return;
|
|
1094
1116
|
const dataFromHash = parseHash(route.hash, component.name);
|
|
1095
|
-
if (dataFromHash)
|
|
1117
|
+
if (dataFromHash?.layer === layer)
|
|
1096
1118
|
clearHash();
|
|
1097
1119
|
};
|
|
1098
1120
|
vnode2.props.onDestroy = () => {
|
|
@@ -1166,6 +1188,11 @@ function useDialog() {
|
|
|
1166
1188
|
const getInstance = (uuid) => {
|
|
1167
1189
|
return dialogs.find((item) => item.uuid === uuid)?.vnode;
|
|
1168
1190
|
};
|
|
1191
|
+
const getLayer = (uuid) => {
|
|
1192
|
+
if (!dialogs.length)
|
|
1193
|
+
return 0;
|
|
1194
|
+
return dialogs.find((dialog) => dialog.uuid === uuid)?.layer || 0;
|
|
1195
|
+
};
|
|
1169
1196
|
const isOnTop = (uuid) => {
|
|
1170
1197
|
if (!dialogs.length)
|
|
1171
1198
|
return false;
|
|
@@ -1180,15 +1207,10 @@ function useDialog() {
|
|
|
1180
1207
|
component,
|
|
1181
1208
|
props
|
|
1182
1209
|
}) => {
|
|
1183
|
-
const data = {
|
|
1184
|
-
name: component.name,
|
|
1185
|
-
layer,
|
|
1186
|
-
props
|
|
1187
|
-
};
|
|
1188
1210
|
router.push({
|
|
1189
1211
|
name: route.name || void 0,
|
|
1190
1212
|
query: route.query,
|
|
1191
|
-
hash:
|
|
1213
|
+
hash: genHash({ layer, props, componentName: component.name })
|
|
1192
1214
|
});
|
|
1193
1215
|
};
|
|
1194
1216
|
const watchHash = ({
|
|
@@ -1233,10 +1255,14 @@ function useDialog() {
|
|
|
1233
1255
|
return {
|
|
1234
1256
|
open,
|
|
1235
1257
|
getInstance,
|
|
1258
|
+
getLayer,
|
|
1236
1259
|
close,
|
|
1237
1260
|
closeAll,
|
|
1238
1261
|
showConfirm,
|
|
1239
1262
|
isOnTop,
|
|
1263
|
+
genHash,
|
|
1264
|
+
parseHash,
|
|
1265
|
+
clearHash,
|
|
1240
1266
|
openByHash,
|
|
1241
1267
|
watchHash
|
|
1242
1268
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -269,17 +269,39 @@ declare function useDetectBrowser(versions: VersionsList, userAgent?: any): Brow
|
|
|
269
269
|
interface VNodeCustom$1 extends VNode {
|
|
270
270
|
close: () => void;
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
interface Dialog {
|
|
273
|
+
uuid: string;
|
|
274
|
+
name?: string;
|
|
275
|
+
vnode: VNodeCustom$1;
|
|
276
|
+
layer: number;
|
|
277
|
+
}
|
|
278
|
+
interface DialogOptions {
|
|
279
|
+
hashPrefix?: string;
|
|
280
|
+
}
|
|
281
|
+
interface DialogParseHashResult {
|
|
282
|
+
name: string;
|
|
283
|
+
layer: number;
|
|
284
|
+
[key: string]: any;
|
|
285
|
+
}
|
|
286
|
+
declare function useDialog(options?: DialogOptions): {
|
|
273
287
|
open: ({ layer, component, props, }: {
|
|
274
288
|
component: Component;
|
|
275
289
|
props?: any;
|
|
276
290
|
layer?: number;
|
|
277
291
|
}) => string;
|
|
278
292
|
getInstance: (uuid: string) => VNodeCustom$1;
|
|
293
|
+
getLayer: (uuid: string) => number;
|
|
279
294
|
close: (uuid: string) => void;
|
|
280
295
|
closeAll: () => void;
|
|
281
296
|
showConfirm: (text?: string) => boolean;
|
|
282
297
|
isOnTop: (uuid: string) => boolean;
|
|
298
|
+
genHash: ({ layer, componentName, props, }: {
|
|
299
|
+
componentName: string;
|
|
300
|
+
props?: any;
|
|
301
|
+
layer?: number;
|
|
302
|
+
}) => string;
|
|
303
|
+
parseHash: (hash: string, componentName: string) => DialogParseHashResult | undefined;
|
|
304
|
+
clearHash: () => void;
|
|
283
305
|
openByHash: ({ layer, component, props, }: {
|
|
284
306
|
component: Component;
|
|
285
307
|
props?: any;
|
|
@@ -368,4 +390,4 @@ declare function isTypeUrl(message?: string): RuleItem;
|
|
|
368
390
|
declare function isTypeNumber(value?: number, message?: string): RuleItem;
|
|
369
391
|
declare function isStrictLength(value?: number, message?: string): RuleItem;
|
|
370
392
|
|
|
371
|
-
export { AppComponentsResolver, type BrowserInfo, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|
|
393
|
+
export { AppComponentsResolver, type BrowserInfo, type Dialog, type DialogOptions, type DialogParseHashResult, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|
package/dist/index.d.mts
CHANGED
|
@@ -269,17 +269,39 @@ declare function useDetectBrowser(versions: VersionsList, userAgent?: any): Brow
|
|
|
269
269
|
interface VNodeCustom$1 extends VNode {
|
|
270
270
|
close: () => void;
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
interface Dialog {
|
|
273
|
+
uuid: string;
|
|
274
|
+
name?: string;
|
|
275
|
+
vnode: VNodeCustom$1;
|
|
276
|
+
layer: number;
|
|
277
|
+
}
|
|
278
|
+
interface DialogOptions {
|
|
279
|
+
hashPrefix?: string;
|
|
280
|
+
}
|
|
281
|
+
interface DialogParseHashResult {
|
|
282
|
+
name: string;
|
|
283
|
+
layer: number;
|
|
284
|
+
[key: string]: any;
|
|
285
|
+
}
|
|
286
|
+
declare function useDialog(options?: DialogOptions): {
|
|
273
287
|
open: ({ layer, component, props, }: {
|
|
274
288
|
component: Component;
|
|
275
289
|
props?: any;
|
|
276
290
|
layer?: number;
|
|
277
291
|
}) => string;
|
|
278
292
|
getInstance: (uuid: string) => VNodeCustom$1;
|
|
293
|
+
getLayer: (uuid: string) => number;
|
|
279
294
|
close: (uuid: string) => void;
|
|
280
295
|
closeAll: () => void;
|
|
281
296
|
showConfirm: (text?: string) => boolean;
|
|
282
297
|
isOnTop: (uuid: string) => boolean;
|
|
298
|
+
genHash: ({ layer, componentName, props, }: {
|
|
299
|
+
componentName: string;
|
|
300
|
+
props?: any;
|
|
301
|
+
layer?: number;
|
|
302
|
+
}) => string;
|
|
303
|
+
parseHash: (hash: string, componentName: string) => DialogParseHashResult | undefined;
|
|
304
|
+
clearHash: () => void;
|
|
283
305
|
openByHash: ({ layer, component, props, }: {
|
|
284
306
|
component: Component;
|
|
285
307
|
props?: any;
|
|
@@ -368,4 +390,4 @@ declare function isTypeUrl(message?: string): RuleItem;
|
|
|
368
390
|
declare function isTypeNumber(value?: number, message?: string): RuleItem;
|
|
369
391
|
declare function isStrictLength(value?: number, message?: string): RuleItem;
|
|
370
392
|
|
|
371
|
-
export { AppComponentsResolver, type BrowserInfo, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|
|
393
|
+
export { AppComponentsResolver, type BrowserInfo, type Dialog, type DialogOptions, type DialogParseHashResult, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|
package/dist/index.d.ts
CHANGED
|
@@ -269,17 +269,39 @@ declare function useDetectBrowser(versions: VersionsList, userAgent?: any): Brow
|
|
|
269
269
|
interface VNodeCustom$1 extends VNode {
|
|
270
270
|
close: () => void;
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
interface Dialog {
|
|
273
|
+
uuid: string;
|
|
274
|
+
name?: string;
|
|
275
|
+
vnode: VNodeCustom$1;
|
|
276
|
+
layer: number;
|
|
277
|
+
}
|
|
278
|
+
interface DialogOptions {
|
|
279
|
+
hashPrefix?: string;
|
|
280
|
+
}
|
|
281
|
+
interface DialogParseHashResult {
|
|
282
|
+
name: string;
|
|
283
|
+
layer: number;
|
|
284
|
+
[key: string]: any;
|
|
285
|
+
}
|
|
286
|
+
declare function useDialog(options?: DialogOptions): {
|
|
273
287
|
open: ({ layer, component, props, }: {
|
|
274
288
|
component: Component;
|
|
275
289
|
props?: any;
|
|
276
290
|
layer?: number;
|
|
277
291
|
}) => string;
|
|
278
292
|
getInstance: (uuid: string) => VNodeCustom$1;
|
|
293
|
+
getLayer: (uuid: string) => number;
|
|
279
294
|
close: (uuid: string) => void;
|
|
280
295
|
closeAll: () => void;
|
|
281
296
|
showConfirm: (text?: string) => boolean;
|
|
282
297
|
isOnTop: (uuid: string) => boolean;
|
|
298
|
+
genHash: ({ layer, componentName, props, }: {
|
|
299
|
+
componentName: string;
|
|
300
|
+
props?: any;
|
|
301
|
+
layer?: number;
|
|
302
|
+
}) => string;
|
|
303
|
+
parseHash: (hash: string, componentName: string) => DialogParseHashResult | undefined;
|
|
304
|
+
clearHash: () => void;
|
|
283
305
|
openByHash: ({ layer, component, props, }: {
|
|
284
306
|
component: Component;
|
|
285
307
|
props?: any;
|
|
@@ -368,4 +390,4 @@ declare function isTypeUrl(message?: string): RuleItem;
|
|
|
368
390
|
declare function isTypeNumber(value?: number, message?: string): RuleItem;
|
|
369
391
|
declare function isStrictLength(value?: number, message?: string): RuleItem;
|
|
370
392
|
|
|
371
|
-
export { AppComponentsResolver, type BrowserInfo, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|
|
393
|
+
export { AppComponentsResolver, type BrowserInfo, type Dialog, type DialogOptions, type DialogParseHashResult, type Dictionary, EnrichError, type ResponseError, UiComponentsResolver, type VersionsList, camelizeKeys, convertEnumToOptions, formatErrorDataMessage, formatErrorForNotify, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, getStatusMessage, isElementIgnored, isEmptyObject, isHtml, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|
package/dist/index.mjs
CHANGED
|
@@ -991,9 +991,20 @@ function useGlobalScroll() {
|
|
|
991
991
|
|
|
992
992
|
const CONFIRM_TEXT = "Are you sure you want to close? \nAll changes will be lost.";
|
|
993
993
|
let dialogs = [];
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
const HASH_PREFIX = "#ud_";
|
|
995
|
+
function useDialog(options) {
|
|
996
996
|
const logger = useLogger("use-dialog");
|
|
997
|
+
let hashPrefix = HASH_PREFIX;
|
|
998
|
+
if (options?.hashPrefix) {
|
|
999
|
+
if (options.hashPrefix.charAt(0) === "#") {
|
|
1000
|
+
hashPrefix = options?.hashPrefix;
|
|
1001
|
+
} else {
|
|
1002
|
+
logger.warn(
|
|
1003
|
+
`*hashPrefix* must start with "#". The default prefix "${HASH_PREFIX}" will be used`
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
let appContext;
|
|
997
1008
|
const {
|
|
998
1009
|
isLocked: isGlobalScrollLocked,
|
|
999
1010
|
lock: lockGlobalScroll,
|
|
@@ -1001,15 +1012,26 @@ function useDialog() {
|
|
|
1001
1012
|
} = useGlobalScroll();
|
|
1002
1013
|
const route = useRoute();
|
|
1003
1014
|
const router = useRouter();
|
|
1004
|
-
const
|
|
1015
|
+
const genHash = ({
|
|
1016
|
+
layer = 0,
|
|
1017
|
+
componentName,
|
|
1018
|
+
props
|
|
1019
|
+
}) => {
|
|
1020
|
+
const data = {
|
|
1021
|
+
name: componentName,
|
|
1022
|
+
layer,
|
|
1023
|
+
props
|
|
1024
|
+
};
|
|
1025
|
+
return `${hashPrefix}${window.btoa(JSON.stringify(data))}`;
|
|
1026
|
+
};
|
|
1005
1027
|
const parseHash = (hash, componentName) => {
|
|
1006
1028
|
if (!hash)
|
|
1007
1029
|
return void 0;
|
|
1008
|
-
if (!hash.includes(
|
|
1030
|
+
if (!hash.includes(hashPrefix))
|
|
1009
1031
|
return void 0;
|
|
1010
1032
|
let dataFromHash;
|
|
1011
1033
|
try {
|
|
1012
|
-
dataFromHash = JSON.parse(window.atob(hash.slice(
|
|
1034
|
+
dataFromHash = JSON.parse(window.atob(hash.slice(hashPrefix.length)));
|
|
1013
1035
|
} catch (_error) {
|
|
1014
1036
|
logger.warn("*parseHash* cant parse hash");
|
|
1015
1037
|
}
|
|
@@ -1057,7 +1079,7 @@ function useDialog() {
|
|
|
1057
1079
|
vnode2.component.props.modelValue = value;
|
|
1058
1080
|
if (!value && route?.hash) {
|
|
1059
1081
|
const dataFromHash = parseHash(route.hash, component.name);
|
|
1060
|
-
if (dataFromHash)
|
|
1082
|
+
if (dataFromHash?.layer === layer)
|
|
1061
1083
|
clearHash();
|
|
1062
1084
|
}
|
|
1063
1085
|
if (!value && (dialogs.length === 1 || layer === 0) && isGlobalScrollLocked.value) {
|
|
@@ -1073,7 +1095,7 @@ function useDialog() {
|
|
|
1073
1095
|
if (!route?.hash)
|
|
1074
1096
|
return;
|
|
1075
1097
|
const dataFromHash = parseHash(route.hash, component.name);
|
|
1076
|
-
if (dataFromHash)
|
|
1098
|
+
if (dataFromHash?.layer === layer)
|
|
1077
1099
|
clearHash();
|
|
1078
1100
|
};
|
|
1079
1101
|
vnode2.props.onDestroy = () => {
|
|
@@ -1147,6 +1169,11 @@ function useDialog() {
|
|
|
1147
1169
|
const getInstance = (uuid) => {
|
|
1148
1170
|
return dialogs.find((item) => item.uuid === uuid)?.vnode;
|
|
1149
1171
|
};
|
|
1172
|
+
const getLayer = (uuid) => {
|
|
1173
|
+
if (!dialogs.length)
|
|
1174
|
+
return 0;
|
|
1175
|
+
return dialogs.find((dialog) => dialog.uuid === uuid)?.layer || 0;
|
|
1176
|
+
};
|
|
1150
1177
|
const isOnTop = (uuid) => {
|
|
1151
1178
|
if (!dialogs.length)
|
|
1152
1179
|
return false;
|
|
@@ -1161,15 +1188,10 @@ function useDialog() {
|
|
|
1161
1188
|
component,
|
|
1162
1189
|
props
|
|
1163
1190
|
}) => {
|
|
1164
|
-
const data = {
|
|
1165
|
-
name: component.name,
|
|
1166
|
-
layer,
|
|
1167
|
-
props
|
|
1168
|
-
};
|
|
1169
1191
|
router.push({
|
|
1170
1192
|
name: route.name || void 0,
|
|
1171
1193
|
query: route.query,
|
|
1172
|
-
hash:
|
|
1194
|
+
hash: genHash({ layer, props, componentName: component.name })
|
|
1173
1195
|
});
|
|
1174
1196
|
};
|
|
1175
1197
|
const watchHash = ({
|
|
@@ -1214,10 +1236,14 @@ function useDialog() {
|
|
|
1214
1236
|
return {
|
|
1215
1237
|
open,
|
|
1216
1238
|
getInstance,
|
|
1239
|
+
getLayer,
|
|
1217
1240
|
close,
|
|
1218
1241
|
closeAll,
|
|
1219
1242
|
showConfirm,
|
|
1220
1243
|
isOnTop,
|
|
1244
|
+
genHash,
|
|
1245
|
+
parseHash,
|
|
1246
|
+
clearHash,
|
|
1221
1247
|
openByHash,
|
|
1222
1248
|
watchHash
|
|
1223
1249
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karta.io/utils",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.39",
|
|
4
4
|
"description": "karta.io utils for admin and application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"vue": "3.x"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@karta.io/common-data": "^1.0.0-beta.
|
|
28
|
+
"@karta.io/common-data": "^1.0.0-beta.39",
|
|
29
29
|
"@tanstack/vue-query": "5.52.3",
|
|
30
30
|
"@vueuse/core": "11.0.3",
|
|
31
31
|
"async-validator": "4.2.5",
|