@dao-style/biz 0.5.0 → 0.6.0
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/components/access-type/src/AccessType.vue.d.ts +4 -0
- package/dist/components/iframe/src/Iframe.vue.d.ts +1 -1
- package/dist/components/instance-cluster/src/InstanceCluster.vue.d.ts +9 -9
- package/dist/components/instance-namespace/src/InstanceNamespace.vue.d.ts +9 -9
- package/dist/components/instance-storage-class/src/InstanceStorageClass.vue.d.ts +9 -9
- package/dist/components/parameter-list/src/ParameterList.vue.d.ts +1 -1
- package/dist/components/parameter-template-list/src/ParameterTemplateList.vue.d.ts +2 -2
- package/dist/components/port-config/props.d.ts +4 -0
- package/dist/components/port-config/props.js +4 -0
- package/dist/components/port-config/props.mjs +4 -0
- package/dist/components/port-config/src/PortConfig.vue.d.ts +9 -0
- package/dist/components/port-config/src/PortConfig.vue.js +4 -2
- package/dist/components/port-config/src/PortConfig.vue.mjs +4 -2
- package/dist/components/remote-component/src/RemoteComponent.vue.d.ts +2 -1
- package/dist/components/remote-component/src/RemoteComponent.vue.js +4 -3
- package/dist/components/remote-component/src/RemoteComponent.vue.mjs +5 -4
- package/dist/components/remote-component/src/RemoteComponent.vue2.js +3 -2
- package/dist/components/remote-component/src/RemoteComponent.vue2.mjs +3 -2
- package/dist/components/time-picker/src/TimePicker.vue.d.ts +1 -1
- package/dist/forms/import-parameter-template/props.d.ts +11 -11
- package/dist/forms/import-parameter-template/src/ImportParameterTemplate.vue.d.ts +33 -33
- package/dist/group-mapping.json +1 -1
- package/dist/index.js +27 -24
- package/dist/index.mjs +4 -2
- package/dist/locales/en-US/workloads/ContainerImage.json.js +2 -1
- package/dist/locales/en-US/workloads/ContainerImage.json.mjs +2 -1
- package/dist/locales/en-US/workloads/WorkloadLogs.json.js +4 -1
- package/dist/locales/en-US/workloads/WorkloadLogs.json.mjs +4 -1
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/ja/common.json.js +39 -0
- package/dist/locales/ja/common.json.mjs +39 -0
- package/dist/locales/ja/components/AccessType.json.js +29 -0
- package/dist/locales/ja/components/AccessType.json.mjs +29 -0
- package/dist/locales/ja/components/ArrayEditor.json.js +11 -0
- package/dist/locales/ja/components/ArrayEditor.json.mjs +11 -0
- package/dist/locales/ja/components/CloudShellGroup.json.js +20 -0
- package/dist/locales/ja/components/CloudShellGroup.json.mjs +20 -0
- package/dist/locales/ja/components/ClusterUnknownMessage.json.js +11 -0
- package/dist/locales/ja/components/ClusterUnknownMessage.json.mjs +11 -0
- package/dist/locales/ja/components/FormBlock.json.js +8 -0
- package/dist/locales/ja/components/FormBlock.json.mjs +8 -0
- package/dist/locales/ja/components/Gpu.json.js +109 -0
- package/dist/locales/ja/components/Gpu.json.mjs +109 -0
- package/dist/locales/ja/components/InstanceCluster.json.js +8 -0
- package/dist/locales/ja/components/InstanceCluster.json.mjs +8 -0
- package/dist/locales/ja/components/InstanceDescription.json.js +14 -0
- package/dist/locales/ja/components/InstanceDescription.json.mjs +14 -0
- package/dist/locales/ja/components/InstanceInstallationEnv.json.js +38 -0
- package/dist/locales/ja/components/InstanceInstallationEnv.json.mjs +38 -0
- package/dist/locales/ja/components/InstanceLoadBalancer.json.js +32 -0
- package/dist/locales/ja/components/InstanceLoadBalancer.json.mjs +32 -0
- package/dist/locales/ja/components/InstanceMonitorInterval.json.js +14 -0
- package/dist/locales/ja/components/InstanceMonitorInterval.json.mjs +14 -0
- package/dist/locales/ja/components/InstanceName.json.js +11 -0
- package/dist/locales/ja/components/InstanceName.json.mjs +11 -0
- package/dist/locales/ja/components/InstanceNamespace.json.js +11 -0
- package/dist/locales/ja/components/InstanceNamespace.json.mjs +11 -0
- package/dist/locales/ja/components/InstancePassword.json.js +17 -0
- package/dist/locales/ja/components/InstancePassword.json.mjs +17 -0
- package/dist/locales/ja/components/InstanceStorageCapacity.json.js +8 -0
- package/dist/locales/ja/components/InstanceStorageCapacity.json.mjs +8 -0
- package/dist/locales/ja/components/InstanceStorageClass.json.js +11 -0
- package/dist/locales/ja/components/InstanceStorageClass.json.mjs +11 -0
- package/dist/locales/ja/components/InstanceUsername.json.js +14 -0
- package/dist/locales/ja/components/InstanceUsername.json.mjs +14 -0
- package/dist/locales/ja/components/MatchExpressionsEditor.json.js +24 -0
- package/dist/locales/ja/components/MatchExpressionsEditor.json.mjs +24 -0
- package/dist/locales/ja/components/NetworkConfig.json.js +14 -0
- package/dist/locales/ja/components/NetworkConfig.json.mjs +14 -0
- package/dist/locales/ja/components/NodeAffinity.json.js +35 -0
- package/dist/locales/ja/components/NodeAffinity.json.mjs +35 -0
- package/dist/locales/ja/components/NodeSelector.json.js +17 -0
- package/dist/locales/ja/components/NodeSelector.json.mjs +17 -0
- package/dist/locales/ja/components/ObjectEditor.json.js +17 -0
- package/dist/locales/ja/components/ObjectEditor.json.mjs +17 -0
- package/dist/locales/ja/components/ParameterConfiguration.json.js +28 -0
- package/dist/locales/ja/components/ParameterConfiguration.json.mjs +28 -0
- package/dist/locales/ja/components/ParameterList.json.js +27 -0
- package/dist/locales/ja/components/ParameterList.json.mjs +27 -0
- package/dist/locales/ja/components/ParameterTemplateList.json.js +29 -0
- package/dist/locales/ja/components/ParameterTemplateList.json.mjs +29 -0
- package/dist/locales/ja/components/PodAffinity.json.js +53 -0
- package/dist/locales/ja/components/PodAffinity.json.mjs +53 -0
- package/dist/locales/ja/components/PortConfig.json.js +32 -0
- package/dist/locales/ja/components/PortConfig.json.mjs +32 -0
- package/dist/locales/ja/components/PreviewNodeAffinity.json.js +35 -0
- package/dist/locales/ja/components/PreviewNodeAffinity.json.mjs +35 -0
- package/dist/locales/ja/components/PreviewPodAffinity.json.js +38 -0
- package/dist/locales/ja/components/PreviewPodAffinity.json.mjs +38 -0
- package/dist/locales/ja/components/PreviewPorts.json.js +17 -0
- package/dist/locales/ja/components/PreviewPorts.json.mjs +17 -0
- package/dist/locales/ja/components/PreviewTolerations.json.js +20 -0
- package/dist/locales/ja/components/PreviewTolerations.json.mjs +20 -0
- package/dist/locales/ja/components/ResourceConfig.json.js +32 -0
- package/dist/locales/ja/components/ResourceConfig.json.mjs +32 -0
- package/dist/locales/ja/components/TimePicker.json.js +43 -0
- package/dist/locales/ja/components/TimePicker.json.mjs +43 -0
- package/dist/locales/ja/components/Tolerations.json.js +20 -0
- package/dist/locales/ja/components/Tolerations.json.mjs +20 -0
- package/dist/locales/ja/dialogs/ClusterUnknownDialog.json.js +11 -0
- package/dist/locales/ja/dialogs/ClusterUnknownDialog.json.mjs +11 -0
- package/dist/locales/ja/dialogs/CreateNetworkConfigDialog.json.js +8 -0
- package/dist/locales/ja/dialogs/CreateNetworkConfigDialog.json.mjs +8 -0
- package/dist/locales/ja/dialogs/DeleteBackupDialog.json.js +22 -0
- package/dist/locales/ja/dialogs/DeleteBackupDialog.json.mjs +22 -0
- package/dist/locales/ja/dialogs/SelectLabelsDialog.json.js +11 -0
- package/dist/locales/ja/dialogs/SelectLabelsDialog.json.mjs +11 -0
- package/dist/locales/ja/dialogs/SelectTaintsDialog.json.js +20 -0
- package/dist/locales/ja/dialogs/SelectTaintsDialog.json.mjs +20 -0
- package/dist/locales/ja/dialogs/SwitchMasterNodeDialog.json.js +35 -0
- package/dist/locales/ja/dialogs/SwitchMasterNodeDialog.json.mjs +35 -0
- package/dist/locales/ja/dialogs/SwitchWorkspaceDialog.json.js +15 -0
- package/dist/locales/ja/dialogs/SwitchWorkspaceDialog.json.mjs +15 -0
- package/dist/locales/ja/dialogs/UpdateNetworkConfigDialog.json.js +8 -0
- package/dist/locales/ja/dialogs/UpdateNetworkConfigDialog.json.mjs +8 -0
- package/dist/locales/ja/forms/BackupRestore.json.js +55 -0
- package/dist/locales/ja/forms/BackupRestore.json.mjs +55 -0
- package/dist/locales/ja/forms/BackupSetting.json.js +56 -0
- package/dist/locales/ja/forms/BackupSetting.json.mjs +56 -0
- package/dist/locales/ja/forms/ImportParameterTemplate.json.js +29 -0
- package/dist/locales/ja/forms/ImportParameterTemplate.json.mjs +29 -0
- package/dist/locales/ja/index.d.ts +4 -0
- package/dist/locales/ja/index.js +150 -0
- package/dist/locales/ja/index.mjs +149 -0
- package/dist/locales/ja/utils/multiRowEditorValidate.json.js +8 -0
- package/dist/locales/ja/utils/multiRowEditorValidate.json.mjs +8 -0
- package/dist/locales/ja/validate.json.js +32 -0
- package/dist/locales/ja/validate.json.mjs +32 -0
- package/dist/locales/ja/workloads/ContainerBasicInfo.json.js +35 -0
- package/dist/locales/ja/workloads/ContainerBasicInfo.json.mjs +35 -0
- package/dist/locales/ja/workloads/ContainerCustomResource.json.js +17 -0
- package/dist/locales/ja/workloads/ContainerCustomResource.json.mjs +17 -0
- package/dist/locales/ja/workloads/ContainerEnv.json.js +56 -0
- package/dist/locales/ja/workloads/ContainerEnv.json.mjs +56 -0
- package/dist/locales/ja/workloads/ContainerImage.json.js +44 -0
- package/dist/locales/ja/workloads/ContainerImage.json.mjs +44 -0
- package/dist/locales/ja/workloads/ContainerNetwork.json.js +52 -0
- package/dist/locales/ja/workloads/ContainerNetwork.json.mjs +52 -0
- package/dist/locales/ja/workloads/ContainerSecurity.json.js +14 -0
- package/dist/locales/ja/workloads/ContainerSecurity.json.mjs +14 -0
- package/dist/locales/ja/workloads/ContainerStorage.json.js +154 -0
- package/dist/locales/ja/workloads/ContainerStorage.json.mjs +154 -0
- package/dist/locales/ja/workloads/Containers.json.js +27 -0
- package/dist/locales/ja/workloads/Containers.json.mjs +27 -0
- package/dist/locales/ja/workloads/DnsConfig.json.js +50 -0
- package/dist/locales/ja/workloads/DnsConfig.json.mjs +50 -0
- package/dist/locales/ja/workloads/HealthCheck.json.js +49 -0
- package/dist/locales/ja/workloads/HealthCheck.json.mjs +49 -0
- package/dist/locales/ja/workloads/HttpGetAction.json.js +20 -0
- package/dist/locales/ja/workloads/HttpGetAction.json.mjs +20 -0
- package/dist/locales/ja/workloads/JobConfig.json.js +36 -0
- package/dist/locales/ja/workloads/JobConfig.json.mjs +36 -0
- package/dist/locales/ja/workloads/LifeCycle.json.js +44 -0
- package/dist/locales/ja/workloads/LifeCycle.json.mjs +44 -0
- package/dist/locales/ja/workloads/ScheduleConfig.json.js +23 -0
- package/dist/locales/ja/workloads/ScheduleConfig.json.mjs +23 -0
- package/dist/locales/ja/workloads/UpgradeStrategy.json.js +62 -0
- package/dist/locales/ja/workloads/UpgradeStrategy.json.mjs +62 -0
- package/dist/locales/ja/workloads/WorkloadAdvanced.json.js +23 -0
- package/dist/locales/ja/workloads/WorkloadAdvanced.json.mjs +23 -0
- package/dist/locales/ja/workloads/WorkloadAnnotationInput.json.js +8 -0
- package/dist/locales/ja/workloads/WorkloadAnnotationInput.json.mjs +8 -0
- package/dist/locales/ja/workloads/WorkloadAnnotations.json.js +14 -0
- package/dist/locales/ja/workloads/WorkloadAnnotations.json.mjs +14 -0
- package/dist/locales/ja/workloads/WorkloadLabels.json.js +14 -0
- package/dist/locales/ja/workloads/WorkloadLabels.json.mjs +14 -0
- package/dist/locales/ja/workloads/WorkloadLogs.json.js +41 -0
- package/dist/locales/ja/workloads/WorkloadLogs.json.mjs +41 -0
- package/dist/locales/ja/workloads/workload-advanced/JobConfig.json.js +3 -0
- package/dist/locales/ja/workloads/workload-advanced/JobConfig.json.mjs +4 -0
- package/dist/locales/ja/workloads/workload-advanced/NetworkConfig.json.js +20 -0
- package/dist/locales/ja/workloads/workload-advanced/NetworkConfig.json.mjs +20 -0
- package/dist/locales/ja/workloads/workload-advanced/PodManagement.json.js +20 -0
- package/dist/locales/ja/workloads/workload-advanced/PodManagement.json.mjs +20 -0
- package/dist/locales/zh-CN/workloads/ContainerImage.json.js +2 -1
- package/dist/locales/zh-CN/workloads/ContainerImage.json.mjs +2 -1
- package/dist/node_modules/@vueuse/core/index.js +90 -56
- package/dist/node_modules/@vueuse/core/index.mjs +92 -58
- package/dist/node_modules/@vueuse/shared/index.js +82 -1
- package/dist/node_modules/@vueuse/shared/index.mjs +83 -2
- package/dist/style.css +608 -592
- package/dist/styles/dialogs/switch-workspace-dialog/switch-workspace-dialog.css +3 -0
- package/dist/styles/workloads/container-image/select-image-dialog.css +13 -0
- package/dist/utils/loadRemoteComponent.d.ts +1 -0
- package/dist/utils/loadRemoteComponent.js +80 -15
- package/dist/utils/loadRemoteComponent.mjs +80 -16
- package/dist/utils/useSubForm.js +1 -1
- package/dist/utils/useSubForm.mjs +1 -1
- package/dist/workloads/container-custom-resource/src/ContainerCustomResource.vue2.js +1 -1
- package/dist/workloads/container-custom-resource/src/ContainerCustomResource.vue2.mjs +1 -1
- package/dist/workloads/container-image/props.d.ts +8 -0
- package/dist/workloads/container-image/props.js +4 -0
- package/dist/workloads/container-image/props.mjs +4 -0
- package/dist/workloads/container-image/src/ContainerImage.vue.d.ts +9 -0
- package/dist/workloads/container-image/src/ContainerImage.vue2.js +112 -26
- package/dist/workloads/container-image/src/ContainerImage.vue2.mjs +114 -28
- package/dist/workloads/container-image/src/dialogs/SelectImageDialog.vue.d.ts +4 -4
- package/dist/workloads/container-image/src/dialogs/SelectImageDialog.vue.js +25 -5
- package/dist/workloads/container-image/src/dialogs/SelectImageDialog.vue.mjs +26 -6
- package/dist/workloads/container-image/src/dialogs/SelectImageDialog.vue2.js +12 -5
- package/dist/workloads/container-image/src/dialogs/SelectImageDialog.vue2.mjs +13 -6
- package/dist/workloads/container-storage/src/components/PvcNodePath.vue.d.ts +5 -22
- package/dist/workloads/container-storage/src/components/PvcNodePath.vue2.js +123 -60
- package/dist/workloads/container-storage/src/components/PvcNodePath.vue2.mjs +124 -61
- package/dist/workloads/container-storage/src/components/PvcNodePathItem.vue.d.ts +1 -2
- package/dist/workloads/container-storage/src/components/PvcNodePathItem.vue.js +4 -5
- package/dist/workloads/container-storage/src/components/PvcNodePathItem.vue.mjs +4 -5
- package/dist/workloads/container-storage/src/components/PvcNodePathItem.vue2.js +12 -7
- package/dist/workloads/container-storage/src/components/PvcNodePathItem.vue2.mjs +12 -7
- package/dist/workloads/containers/demo/data.d.ts +10 -2
- package/dist/workloads/containers/src/ContainerItem.vue.d.ts +1 -0
- package/dist/workloads/containers/src/ContainerItem.vue2.js +1 -1
- package/dist/workloads/containers/src/ContainerItem.vue2.mjs +1 -1
- package/dist/workloads/containers/src/Containers.vue.d.ts +1 -0
- package/dist/workloads/containers/src/Containers.vue2.js +3 -1
- package/dist/workloads/containers/src/Containers.vue2.mjs +3 -1
- package/dist/workloads/containers/src/dialogs/ConfirmDialog.vue.d.ts +3 -3
- package/dist/workloads/containers/src/patch-form-item-validate/form-item-validate.d.ts +30 -30
- package/dist/workloads/containers/src/patch-form-item-validate/form-item-validate.vue.d.ts +13 -13
- package/dist/workloads/containers/src/patch-form-item-validate/props.d.ts +5 -5
- package/dist/workloads/health-check/src/AdvancedContainer.vue.d.ts +3 -3
- package/package.json +3 -3
- package/dist/node_modules/@vueuse/core/node_modules/@vueuse/shared/index.js +0 -136
- package/dist/node_modules/@vueuse/core/node_modules/@vueuse/shared/index.mjs +0 -136
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isClient, isString,
|
|
2
|
-
import { bypassFilter, createFilterWrapper, pausableFilter, pausableWatch, pausableWatch as pausableWatch2, watchWithFilter } from "
|
|
3
|
-
import {
|
|
1
|
+
import { isIOS, noop, isClient, isString, resolveUnref, tryOnScopeDispose, identity, isFunction, isDef, tryOnMounted } from "../shared/index.mjs";
|
|
2
|
+
import { bypassFilter, createFilterWrapper, debounceFilter, pausableFilter, pausableWatch, tryOnBeforeUnmount, useDebounceFn, pausableWatch as pausableWatch2, watchWithFilter } from "../shared/index.mjs";
|
|
3
|
+
import { getCurrentInstance, ref, watch, computed, shallowRef } from "vue";
|
|
4
4
|
function unrefElement(elRef) {
|
|
5
5
|
var _a;
|
|
6
6
|
const plain = resolveUnref(elRef);
|
|
@@ -9,27 +9,37 @@ function unrefElement(elRef) {
|
|
|
9
9
|
const defaultWindow = isClient ? window : void 0;
|
|
10
10
|
function useEventListener(...args) {
|
|
11
11
|
let target;
|
|
12
|
-
let
|
|
13
|
-
let
|
|
12
|
+
let events;
|
|
13
|
+
let listeners;
|
|
14
14
|
let options;
|
|
15
|
-
if (isString(args[0])) {
|
|
16
|
-
[
|
|
15
|
+
if (isString(args[0]) || Array.isArray(args[0])) {
|
|
16
|
+
[events, listeners, options] = args;
|
|
17
17
|
target = defaultWindow;
|
|
18
18
|
} else {
|
|
19
|
-
[target,
|
|
19
|
+
[target, events, listeners, options] = args;
|
|
20
20
|
}
|
|
21
21
|
if (!target)
|
|
22
22
|
return noop;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (!Array.isArray(events))
|
|
24
|
+
events = [events];
|
|
25
|
+
if (!Array.isArray(listeners))
|
|
26
|
+
listeners = [listeners];
|
|
27
|
+
const cleanups = [];
|
|
28
|
+
const cleanup = () => {
|
|
29
|
+
cleanups.forEach((fn) => fn());
|
|
30
|
+
cleanups.length = 0;
|
|
31
|
+
};
|
|
32
|
+
const register = (el, event, listener, options2) => {
|
|
33
|
+
el.addEventListener(event, listener, options2);
|
|
34
|
+
return () => el.removeEventListener(event, listener, options2);
|
|
35
|
+
};
|
|
36
|
+
const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
|
|
25
37
|
cleanup();
|
|
26
38
|
if (!el)
|
|
27
39
|
return;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
cleanup = noop;
|
|
32
|
-
};
|
|
40
|
+
cleanups.push(...events.flatMap((event) => {
|
|
41
|
+
return listeners.map((listener) => register(el, event, listener, options2));
|
|
42
|
+
}));
|
|
33
43
|
}, { immediate: true, flush: "post" });
|
|
34
44
|
const stop = () => {
|
|
35
45
|
stopWatch();
|
|
@@ -38,42 +48,49 @@ function useEventListener(...args) {
|
|
|
38
48
|
tryOnScopeDispose(stop);
|
|
39
49
|
return stop;
|
|
40
50
|
}
|
|
51
|
+
let _iOSWorkaround = false;
|
|
41
52
|
function onClickOutside(target, handler, options = {}) {
|
|
42
|
-
const { window: window2 = defaultWindow, ignore, capture = true, detectIframe = false } = options;
|
|
53
|
+
const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
|
|
43
54
|
if (!window2)
|
|
44
55
|
return;
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
if (isIOS && !_iOSWorkaround) {
|
|
57
|
+
_iOSWorkaround = true;
|
|
58
|
+
Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop));
|
|
59
|
+
}
|
|
60
|
+
let shouldListen = true;
|
|
61
|
+
const shouldIgnore = (event) => {
|
|
62
|
+
return ignore.some((target2) => {
|
|
63
|
+
if (typeof target2 === "string") {
|
|
64
|
+
return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
|
|
65
|
+
} else {
|
|
66
|
+
const el = unrefElement(target2);
|
|
67
|
+
return el && (event.target === el || event.composedPath().includes(el));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
47
71
|
const listener = (event) => {
|
|
48
|
-
window2.clearTimeout(fallback);
|
|
49
72
|
const el = unrefElement(target);
|
|
50
|
-
if (!el || el === event.target || event.composedPath().includes(el)
|
|
73
|
+
if (!el || el === event.target || event.composedPath().includes(el))
|
|
74
|
+
return;
|
|
75
|
+
if (event.detail === 0)
|
|
76
|
+
shouldListen = !shouldIgnore(event);
|
|
77
|
+
if (!shouldListen) {
|
|
78
|
+
shouldListen = true;
|
|
51
79
|
return;
|
|
80
|
+
}
|
|
52
81
|
handler(event);
|
|
53
82
|
};
|
|
54
|
-
const shouldIgnore = (event) => {
|
|
55
|
-
return ignore && ignore.some((target2) => {
|
|
56
|
-
const el = unrefElement(target2);
|
|
57
|
-
return el && (event.target === el || event.composedPath().includes(el));
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
83
|
const cleanup = [
|
|
61
84
|
useEventListener(window2, "click", listener, { passive: true, capture }),
|
|
62
85
|
useEventListener(window2, "pointerdown", (e) => {
|
|
63
86
|
const el = unrefElement(target);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
useEventListener(window2, "pointerup", (e) => {
|
|
67
|
-
if (e.button === 0) {
|
|
68
|
-
const path = e.composedPath();
|
|
69
|
-
e.composedPath = () => path;
|
|
70
|
-
fallback = window2.setTimeout(() => listener(e), 50);
|
|
71
|
-
}
|
|
87
|
+
if (el)
|
|
88
|
+
shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
|
|
72
89
|
}, { passive: true }),
|
|
73
90
|
detectIframe && useEventListener(window2, "blur", (event) => {
|
|
74
91
|
var _a;
|
|
75
92
|
const el = unrefElement(target);
|
|
76
|
-
if (((_a = document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(document.activeElement)))
|
|
93
|
+
if (((_a = window2.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
|
|
77
94
|
handler(event);
|
|
78
95
|
})
|
|
79
96
|
].filter(Boolean);
|
|
@@ -93,17 +110,17 @@ function cloneFnJSON(source) {
|
|
|
93
110
|
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
94
111
|
const globalKey = "__vueuse_ssr_handlers__";
|
|
95
112
|
_global[globalKey] = _global[globalKey] || {};
|
|
96
|
-
var __getOwnPropSymbols$
|
|
97
|
-
var __hasOwnProp$
|
|
98
|
-
var __propIsEnum$
|
|
113
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
114
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
115
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
99
116
|
var __objRest$2 = (source, exclude) => {
|
|
100
117
|
var target = {};
|
|
101
118
|
for (var prop in source)
|
|
102
|
-
if (__hasOwnProp$
|
|
119
|
+
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
103
120
|
target[prop] = source[prop];
|
|
104
|
-
if (source != null && __getOwnPropSymbols$
|
|
105
|
-
for (var prop of __getOwnPropSymbols$
|
|
106
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
121
|
+
if (source != null && __getOwnPropSymbols$g)
|
|
122
|
+
for (var prop of __getOwnPropSymbols$g(source)) {
|
|
123
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
|
107
124
|
target[prop] = source[prop];
|
|
108
125
|
}
|
|
109
126
|
return target;
|
|
@@ -136,17 +153,31 @@ function useResizeObserver(target, callback, options = {}) {
|
|
|
136
153
|
};
|
|
137
154
|
}
|
|
138
155
|
function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
|
|
139
|
-
const { box = "content-box" } = options;
|
|
156
|
+
const { window: window2 = defaultWindow, box = "content-box" } = options;
|
|
157
|
+
const isSVG = computed(() => {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
|
|
160
|
+
});
|
|
140
161
|
const width = ref(initialSize.width);
|
|
141
162
|
const height = ref(initialSize.height);
|
|
142
163
|
useResizeObserver(target, ([entry]) => {
|
|
143
164
|
const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
165
|
+
if (window2 && isSVG.value) {
|
|
166
|
+
const $elem = unrefElement(target);
|
|
167
|
+
if ($elem) {
|
|
168
|
+
const styles = window2.getComputedStyle($elem);
|
|
169
|
+
width.value = parseFloat(styles.width);
|
|
170
|
+
height.value = parseFloat(styles.height);
|
|
171
|
+
}
|
|
147
172
|
} else {
|
|
148
|
-
|
|
149
|
-
|
|
173
|
+
if (boxSize) {
|
|
174
|
+
const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
|
|
175
|
+
width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
|
|
176
|
+
height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
|
|
177
|
+
} else {
|
|
178
|
+
width.value = entry.contentRect.width;
|
|
179
|
+
height.value = entry.contentRect.height;
|
|
180
|
+
}
|
|
150
181
|
}
|
|
151
182
|
}, options);
|
|
152
183
|
watch(() => unrefElement(target), (ele) => {
|
|
@@ -266,7 +297,7 @@ function useVirtualList(list, options) {
|
|
|
266
297
|
wrapperProps
|
|
267
298
|
};
|
|
268
299
|
}
|
|
269
|
-
function
|
|
300
|
+
function useVirtualListResources(list) {
|
|
270
301
|
const containerRef = ref(null);
|
|
271
302
|
const size = useElementSize(containerRef);
|
|
272
303
|
const currentList = ref([]);
|
|
@@ -275,19 +306,18 @@ function useVirtualListResourses(list) {
|
|
|
275
306
|
return { state, source, currentList, size, containerRef };
|
|
276
307
|
}
|
|
277
308
|
function createGetViewCapacity(state, source, itemSize) {
|
|
278
|
-
return (
|
|
309
|
+
return (containerSize) => {
|
|
279
310
|
if (typeof itemSize === "number")
|
|
280
|
-
return Math.ceil(
|
|
311
|
+
return Math.ceil(containerSize / itemSize);
|
|
281
312
|
const { start = 0 } = state.value;
|
|
282
313
|
let sum = 0;
|
|
283
314
|
let capacity = 0;
|
|
284
315
|
for (let i = start; i < source.value.length; i++) {
|
|
285
|
-
const
|
|
286
|
-
sum +=
|
|
287
|
-
|
|
288
|
-
|
|
316
|
+
const size = itemSize(i);
|
|
317
|
+
sum += size;
|
|
318
|
+
capacity = i;
|
|
319
|
+
if (sum > containerSize)
|
|
289
320
|
break;
|
|
290
|
-
}
|
|
291
321
|
}
|
|
292
322
|
return capacity - start;
|
|
293
323
|
};
|
|
@@ -363,7 +393,7 @@ function createScrollTo(type, calculateRange, getDistance, containerRef) {
|
|
|
363
393
|
};
|
|
364
394
|
}
|
|
365
395
|
function useHorizontalVirtualList(options, list) {
|
|
366
|
-
const resources =
|
|
396
|
+
const resources = useVirtualListResources(list);
|
|
367
397
|
const { state, source, currentList, size, containerRef } = resources;
|
|
368
398
|
const containerStyle = { overflowX: "auto" };
|
|
369
399
|
const { itemWidth, overscan = 5 } = options;
|
|
@@ -395,7 +425,7 @@ function useHorizontalVirtualList(options, list) {
|
|
|
395
425
|
};
|
|
396
426
|
}
|
|
397
427
|
function useVerticalVirtualList(options, list) {
|
|
398
|
-
const resources =
|
|
428
|
+
const resources = useVirtualListResources(list);
|
|
399
429
|
const { state, source, currentList, size, containerRef } = resources;
|
|
400
430
|
const containerStyle = { overflowY: "auto" };
|
|
401
431
|
const { itemHeight, overscan = 5 } = options;
|
|
@@ -430,20 +460,24 @@ export {
|
|
|
430
460
|
bypassFilter,
|
|
431
461
|
cloneFnJSON,
|
|
432
462
|
createFilterWrapper,
|
|
463
|
+
debounceFilter,
|
|
433
464
|
defaultWindow,
|
|
434
465
|
identity,
|
|
435
466
|
isClient,
|
|
436
467
|
isDef,
|
|
437
468
|
isFunction,
|
|
469
|
+
isIOS,
|
|
438
470
|
isString,
|
|
439
471
|
noop,
|
|
440
472
|
onClickOutside,
|
|
441
473
|
pausableFilter,
|
|
442
474
|
pausableWatch,
|
|
443
475
|
resolveUnref,
|
|
476
|
+
tryOnBeforeUnmount,
|
|
444
477
|
tryOnMounted,
|
|
445
478
|
tryOnScopeDispose,
|
|
446
479
|
unrefElement,
|
|
480
|
+
useDebounceFn,
|
|
447
481
|
useElementSize,
|
|
448
482
|
useEventListener,
|
|
449
483
|
useResizeObserver,
|
|
@@ -3,7 +3,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
var _a;
|
|
5
5
|
const isClient = typeof window !== "undefined";
|
|
6
|
-
|
|
6
|
+
const isDef = (val) => typeof val !== "undefined";
|
|
7
|
+
const isFunction = (val) => typeof val === "function";
|
|
8
|
+
const isString = (val) => typeof val === "string";
|
|
9
|
+
const noop = () => {
|
|
10
|
+
};
|
|
11
|
+
const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
12
|
+
function resolveUnref(r) {
|
|
13
|
+
return typeof r === "function" ? r() : vue.unref(r);
|
|
14
|
+
}
|
|
7
15
|
function createFilterWrapper(filter, fn) {
|
|
8
16
|
function wrapper(...args) {
|
|
9
17
|
return new Promise((resolve, reject) => {
|
|
@@ -15,6 +23,47 @@ function createFilterWrapper(filter, fn) {
|
|
|
15
23
|
const bypassFilter = (invoke) => {
|
|
16
24
|
return invoke();
|
|
17
25
|
};
|
|
26
|
+
function debounceFilter(ms, options = {}) {
|
|
27
|
+
let timer;
|
|
28
|
+
let maxTimer;
|
|
29
|
+
let lastRejector = noop;
|
|
30
|
+
const _clearTimeout = (timer2) => {
|
|
31
|
+
clearTimeout(timer2);
|
|
32
|
+
lastRejector();
|
|
33
|
+
lastRejector = noop;
|
|
34
|
+
};
|
|
35
|
+
const filter = (invoke) => {
|
|
36
|
+
const duration = resolveUnref(ms);
|
|
37
|
+
const maxDuration = resolveUnref(options.maxWait);
|
|
38
|
+
if (timer)
|
|
39
|
+
_clearTimeout(timer);
|
|
40
|
+
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
41
|
+
if (maxTimer) {
|
|
42
|
+
_clearTimeout(maxTimer);
|
|
43
|
+
maxTimer = null;
|
|
44
|
+
}
|
|
45
|
+
return Promise.resolve(invoke());
|
|
46
|
+
}
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
lastRejector = options.rejectOnCancel ? reject : resolve;
|
|
49
|
+
if (maxDuration && !maxTimer) {
|
|
50
|
+
maxTimer = setTimeout(() => {
|
|
51
|
+
if (timer)
|
|
52
|
+
_clearTimeout(timer);
|
|
53
|
+
maxTimer = null;
|
|
54
|
+
resolve(invoke());
|
|
55
|
+
}, maxDuration);
|
|
56
|
+
}
|
|
57
|
+
timer = setTimeout(() => {
|
|
58
|
+
if (maxTimer)
|
|
59
|
+
_clearTimeout(maxTimer);
|
|
60
|
+
maxTimer = null;
|
|
61
|
+
resolve(invoke());
|
|
62
|
+
}, duration);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
return filter;
|
|
66
|
+
}
|
|
18
67
|
function pausableFilter(extendFilter = bypassFilter) {
|
|
19
68
|
const isActive = vue.ref(true);
|
|
20
69
|
function pause() {
|
|
@@ -29,10 +78,31 @@ function pausableFilter(extendFilter = bypassFilter) {
|
|
|
29
78
|
};
|
|
30
79
|
return { isActive: vue.readonly(isActive), pause, resume, eventFilter };
|
|
31
80
|
}
|
|
81
|
+
function identity(arg) {
|
|
82
|
+
return arg;
|
|
83
|
+
}
|
|
84
|
+
function tryOnScopeDispose(fn) {
|
|
85
|
+
if (vue.getCurrentScope()) {
|
|
86
|
+
vue.onScopeDispose(fn);
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
92
|
+
return createFilterWrapper(debounceFilter(ms, options), fn);
|
|
93
|
+
}
|
|
32
94
|
function tryOnBeforeUnmount(fn) {
|
|
33
95
|
if (vue.getCurrentInstance())
|
|
34
96
|
vue.onBeforeUnmount(fn);
|
|
35
97
|
}
|
|
98
|
+
function tryOnMounted(fn, sync = true) {
|
|
99
|
+
if (vue.getCurrentInstance())
|
|
100
|
+
vue.onMounted(fn);
|
|
101
|
+
else if (sync)
|
|
102
|
+
fn();
|
|
103
|
+
else
|
|
104
|
+
vue.nextTick(fn);
|
|
105
|
+
}
|
|
36
106
|
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
37
107
|
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
38
108
|
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
@@ -101,9 +171,20 @@ function watchPausable(source, cb, options = {}) {
|
|
|
101
171
|
}
|
|
102
172
|
exports.bypassFilter = bypassFilter;
|
|
103
173
|
exports.createFilterWrapper = createFilterWrapper;
|
|
174
|
+
exports.debounceFilter = debounceFilter;
|
|
175
|
+
exports.identity = identity;
|
|
104
176
|
exports.isClient = isClient;
|
|
177
|
+
exports.isDef = isDef;
|
|
178
|
+
exports.isFunction = isFunction;
|
|
179
|
+
exports.isIOS = isIOS;
|
|
180
|
+
exports.isString = isString;
|
|
181
|
+
exports.noop = noop;
|
|
105
182
|
exports.pausableFilter = pausableFilter;
|
|
106
183
|
exports.pausableWatch = watchPausable;
|
|
184
|
+
exports.resolveUnref = resolveUnref;
|
|
107
185
|
exports.tryOnBeforeUnmount = tryOnBeforeUnmount;
|
|
186
|
+
exports.tryOnMounted = tryOnMounted;
|
|
187
|
+
exports.tryOnScopeDispose = tryOnScopeDispose;
|
|
188
|
+
exports.useDebounceFn = useDebounceFn;
|
|
108
189
|
exports.watchPausable = watchPausable;
|
|
109
190
|
exports.watchWithFilter = watchWithFilter;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { ref, readonly, getCurrentInstance, onBeforeUnmount, watch } from "vue";
|
|
1
|
+
import { ref, readonly, getCurrentInstance, onBeforeUnmount, watch, unref, getCurrentScope, onScopeDispose, onMounted, nextTick } from "vue";
|
|
2
2
|
var _a;
|
|
3
3
|
const isClient = typeof window !== "undefined";
|
|
4
|
-
|
|
4
|
+
const isDef = (val) => typeof val !== "undefined";
|
|
5
|
+
const isFunction = (val) => typeof val === "function";
|
|
6
|
+
const isString = (val) => typeof val === "string";
|
|
7
|
+
const noop = () => {
|
|
8
|
+
};
|
|
9
|
+
const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
10
|
+
function resolveUnref(r) {
|
|
11
|
+
return typeof r === "function" ? r() : unref(r);
|
|
12
|
+
}
|
|
5
13
|
function createFilterWrapper(filter, fn) {
|
|
6
14
|
function wrapper(...args) {
|
|
7
15
|
return new Promise((resolve, reject) => {
|
|
@@ -13,6 +21,47 @@ function createFilterWrapper(filter, fn) {
|
|
|
13
21
|
const bypassFilter = (invoke) => {
|
|
14
22
|
return invoke();
|
|
15
23
|
};
|
|
24
|
+
function debounceFilter(ms, options = {}) {
|
|
25
|
+
let timer;
|
|
26
|
+
let maxTimer;
|
|
27
|
+
let lastRejector = noop;
|
|
28
|
+
const _clearTimeout = (timer2) => {
|
|
29
|
+
clearTimeout(timer2);
|
|
30
|
+
lastRejector();
|
|
31
|
+
lastRejector = noop;
|
|
32
|
+
};
|
|
33
|
+
const filter = (invoke) => {
|
|
34
|
+
const duration = resolveUnref(ms);
|
|
35
|
+
const maxDuration = resolveUnref(options.maxWait);
|
|
36
|
+
if (timer)
|
|
37
|
+
_clearTimeout(timer);
|
|
38
|
+
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
39
|
+
if (maxTimer) {
|
|
40
|
+
_clearTimeout(maxTimer);
|
|
41
|
+
maxTimer = null;
|
|
42
|
+
}
|
|
43
|
+
return Promise.resolve(invoke());
|
|
44
|
+
}
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
lastRejector = options.rejectOnCancel ? reject : resolve;
|
|
47
|
+
if (maxDuration && !maxTimer) {
|
|
48
|
+
maxTimer = setTimeout(() => {
|
|
49
|
+
if (timer)
|
|
50
|
+
_clearTimeout(timer);
|
|
51
|
+
maxTimer = null;
|
|
52
|
+
resolve(invoke());
|
|
53
|
+
}, maxDuration);
|
|
54
|
+
}
|
|
55
|
+
timer = setTimeout(() => {
|
|
56
|
+
if (maxTimer)
|
|
57
|
+
_clearTimeout(maxTimer);
|
|
58
|
+
maxTimer = null;
|
|
59
|
+
resolve(invoke());
|
|
60
|
+
}, duration);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
return filter;
|
|
64
|
+
}
|
|
16
65
|
function pausableFilter(extendFilter = bypassFilter) {
|
|
17
66
|
const isActive = ref(true);
|
|
18
67
|
function pause() {
|
|
@@ -27,10 +76,31 @@ function pausableFilter(extendFilter = bypassFilter) {
|
|
|
27
76
|
};
|
|
28
77
|
return { isActive: readonly(isActive), pause, resume, eventFilter };
|
|
29
78
|
}
|
|
79
|
+
function identity(arg) {
|
|
80
|
+
return arg;
|
|
81
|
+
}
|
|
82
|
+
function tryOnScopeDispose(fn) {
|
|
83
|
+
if (getCurrentScope()) {
|
|
84
|
+
onScopeDispose(fn);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
90
|
+
return createFilterWrapper(debounceFilter(ms, options), fn);
|
|
91
|
+
}
|
|
30
92
|
function tryOnBeforeUnmount(fn) {
|
|
31
93
|
if (getCurrentInstance())
|
|
32
94
|
onBeforeUnmount(fn);
|
|
33
95
|
}
|
|
96
|
+
function tryOnMounted(fn, sync = true) {
|
|
97
|
+
if (getCurrentInstance())
|
|
98
|
+
onMounted(fn);
|
|
99
|
+
else if (sync)
|
|
100
|
+
fn();
|
|
101
|
+
else
|
|
102
|
+
nextTick(fn);
|
|
103
|
+
}
|
|
34
104
|
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
35
105
|
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
36
106
|
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
@@ -100,10 +170,21 @@ function watchPausable(source, cb, options = {}) {
|
|
|
100
170
|
export {
|
|
101
171
|
bypassFilter,
|
|
102
172
|
createFilterWrapper,
|
|
173
|
+
debounceFilter,
|
|
174
|
+
identity,
|
|
103
175
|
isClient,
|
|
176
|
+
isDef,
|
|
177
|
+
isFunction,
|
|
178
|
+
isIOS,
|
|
179
|
+
isString,
|
|
180
|
+
noop,
|
|
104
181
|
pausableFilter,
|
|
105
182
|
watchPausable as pausableWatch,
|
|
183
|
+
resolveUnref,
|
|
106
184
|
tryOnBeforeUnmount,
|
|
185
|
+
tryOnMounted,
|
|
186
|
+
tryOnScopeDispose,
|
|
187
|
+
useDebounceFn,
|
|
107
188
|
watchPausable,
|
|
108
189
|
watchWithFilter
|
|
109
190
|
};
|