@dfsj/components 3.2.0 → 3.3.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/CHANGELOG.md +20 -0
- package/dist/components/ClickOutSide/index.d.ts +2 -0
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.d.ts +7 -0
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.js +5 -0
- package/dist/components/ClickOutSide/src/ClickOutSide.vue2.js +26 -0
- package/dist/components/Table/src/Table.vue2.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.min.css +2 -2
- package/dist/node_modules/.pnpm/@vueuse_core@10.11.0_vue@3.4.31_typescript@5.2.2_/node_modules/@vueuse/core/index.js +68 -2
- package/dist/node_modules/.pnpm/@vueuse_shared@10.11.0_vue@3.4.31_typescript@5.2.2_/node_modules/@vueuse/shared/index.js +6 -1
- package/package.json +4 -4
- package/dist/node_modules/.pnpm/@vueuse_core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.js +0 -439
- package/dist/node_modules/.pnpm/@vueuse_shared@10.7.2_vue@3.4.21/node_modules/@vueuse/shared/index.js +0 -40
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.3.0](http://10.10.12.18/dfsj/dfsj/compare/@dfsj/components@3.1.3...@dfsj/components@3.3.0) (2024-08-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* (components) UnifyChart.vue ([9a5d4db](http://10.10.12.18/dfsj/dfsj/commits/9a5d4dbe80b10bf9de80718e0b6e18c22cbd0205))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* (components) BasicModal支持vh、vw、px、rem ([866c6d2](http://10.10.12.18/dfsj/dfsj/commits/866c6d2447a203329ba3783f6a3edababf91a50c))
|
|
17
|
+
* (components) Descriptions ([5873c14](http://10.10.12.18/dfsj/dfsj/commits/5873c14bc746596c536b203551147de8d2c097c0))
|
|
18
|
+
* (components) UnifyChart.vue 导出方法 ([d4065b9](http://10.10.12.18/dfsj/dfsj/commits/d4065b984d4f97dad21bb55474bb616f2149a16e))
|
|
19
|
+
* **components:** 导出组件 ([d6e313e](http://10.10.12.18/dfsj/dfsj/commits/d6e313e53f09a3a6895f1a212d8341fc5a196cbf))
|
|
20
|
+
* **components:** 新增clickOutSide组件 ([e663b5d](http://10.10.12.18/dfsj/dfsj/commits/e663b5db93844d2052f07861739534956f2f908a))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
# [3.2.0](http://10.10.12.18/dfsj/dfsj/compare/@dfsj/components@3.1.3...@dfsj/components@3.2.0) (2024-07-16)
|
|
7
27
|
|
|
8
28
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mounted" | "clickOutside")[], "mounted" | "clickOutside", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
4
|
+
onMounted?: (...args: any[]) => any;
|
|
5
|
+
onClickOutside?: (...args: any[]) => any;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, openBlock, createElementBlock, renderSlot } from 'vue';
|
|
2
|
+
import { onClickOutside } from '../../../node_modules/.pnpm/@vueuse_core@10.11.0_vue@3.4.31_typescript@5.2.2_/node_modules/@vueuse/core/index.js';
|
|
3
|
+
|
|
4
|
+
var script = defineComponent({
|
|
5
|
+
__name: 'ClickOutSide',
|
|
6
|
+
emits: ['mounted', 'clickOutside'],
|
|
7
|
+
setup: function setup(__props, _ref) {
|
|
8
|
+
var __emit = _ref.emit;
|
|
9
|
+
var emit = __emit;
|
|
10
|
+
var wrap = ref(null);
|
|
11
|
+
onClickOutside(wrap, function () {
|
|
12
|
+
emit('clickOutside');
|
|
13
|
+
});
|
|
14
|
+
onMounted(function () {
|
|
15
|
+
emit('mounted');
|
|
16
|
+
});
|
|
17
|
+
return function (_ctx, _cache) {
|
|
18
|
+
return openBlock(), createElementBlock("div", {
|
|
19
|
+
ref_key: "wrap",
|
|
20
|
+
ref: wrap
|
|
21
|
+
}, [renderSlot(_ctx.$slots, "default")], 512);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { script as default };
|
|
@@ -513,7 +513,9 @@ var script = defineComponent({
|
|
|
513
513
|
return getSlot(slots, 'append', args);
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
return withDirectives(createVNode("div",
|
|
516
|
+
return withDirectives(createVNode("div", {
|
|
517
|
+
"class": "h-full w-full overflow-hidden flex flex-col box-border"
|
|
518
|
+
}, [unref(getProps).customContent ? createVNode("div", {
|
|
517
519
|
"class": "flex flex-wrap"
|
|
518
520
|
}, [(_unref6 = unref(getProps)) !== null && _unref6 !== void 0 && (_unref6 = _unref6.data) !== null && _unref6 !== void 0 && _unref6.length ? (_unref7 = unref(getProps)) === null || _unref7 === void 0 ? void 0 : _unref7.data.map(function (item) {
|
|
519
521
|
var cardSlots = {
|
package/dist/index.d.ts
CHANGED
|
@@ -12,5 +12,6 @@ export * from "./components/UnifyChart";
|
|
|
12
12
|
export * from "./components/Highlight";
|
|
13
13
|
export * from "./components/InputPassword";
|
|
14
14
|
export * from "./components/Descriptions";
|
|
15
|
+
export * from "./components/ClickOutSide";
|
|
15
16
|
export * from "./components/NodeAxis";
|
|
16
17
|
export * from "./components/Visual";
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export { useRender } from './components/UnifyChart/src/hooks/useRender.js';
|
|
|
23
23
|
import './components/Highlight/src/Highlight.vue.js';
|
|
24
24
|
import './components/InputPassword/src/InputPassword.vue.js';
|
|
25
25
|
import './components/Descriptions/src/Descriptions.vue.js';
|
|
26
|
+
import './components/ClickOutSide/src/ClickOutSide.vue.js';
|
|
26
27
|
export { default as AbstractNodeProvider } from './components/NodeAxis/src/AbstractNodeProvider.js';
|
|
27
28
|
export { default as CanvasNodeRender } from './components/NodeAxis/src/CanvasNodeRender.js';
|
|
28
29
|
import './components/NodeAxis/src/NodeAxis.vue.js';
|
|
@@ -40,6 +41,7 @@ export { default as UnifyChart } from './components/UnifyChart/src/UnifyChart.vu
|
|
|
40
41
|
export { default as Highlight } from './components/Highlight/src/Highlight.vue2.js';
|
|
41
42
|
export { default as InputPassword } from './components/InputPassword/src/InputPassword.vue2.js';
|
|
42
43
|
export { default as Descriptions } from './components/Descriptions/src/Descriptions.vue2.js';
|
|
44
|
+
export { default as clickOutSide } from './components/ClickOutSide/src/ClickOutSide.vue2.js';
|
|
43
45
|
export { default as NodeAxis } from './components/NodeAxis/src/NodeAxis.vue2.js';
|
|
44
46
|
export { default as Icon } from './components/Icon/src/Icon.vue2.js';
|
|
45
47
|
export { default as SvgIcon } from './components/Icon/src/SvgIcon.vue2.js';
|
package/dist/index.min.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@dfsj/components:通用的vue组件;包括专业组件、原子级组件
|
|
3
|
-
版本: 3.1
|
|
3
|
+
版本: 3.2.1
|
|
4
4
|
作者:yangbo <1747837358@qq.com>
|
|
5
|
-
日期:2024-
|
|
5
|
+
日期:2024-08-12 16:39:07
|
|
6
6
|
*/.ec-component-board-container-page-wrap{position:fixed;z-index:100;background:#fff;transition:transform 200ms ease-in-out}.ec-component-board-container-page-wrap .board--wing{position:absolute !important;z-index:1;width:18px;height:80px;border-radius:2px;background:rgba(3,19,78,.12);backdrop-filter:blur(2px);box-shadow:2px 1px 1px 0px rgba(0,0,0,.3),-2px -2px 2px 0px #fff;cursor:pointer}.ec-component-board-container-page-wrap .board--wing .app-iconify{position:absolute;top:50%;right:0;font-weight:bolder;color:#fff;transform-origin:50% 50%;max-width:fit-content;max-height:fit-content}.ec-component-board-container-page-wrap .multiple-toggle-tab .el-tabs__nav-wrap::after{display:none}.ec-component-board-container-page-wrap .multiple-toggle-tab .el-tabs__nav-scroll .el-tabs__active-bar{display:none;width:0;height:0}.ec-component-board-container-page-wrap .multiple-toggle-tab .el-tabs__nav-scroll .el-tabs__item{height:auto;padding:10px;color:var(--board-tab-color);background:#eee}.ec-component-board-container-page-wrap .multiple-toggle-tab .el-tabs__nav-scroll .el-tabs__item.is-active{color:#fff;background:var(--board-tab-color)}.ec-component-board-container-page-wrap .multiple-toggle-tab .el-tabs__nav-scroll .el-tabs__nav{gap:10px}.ec-component-board-container-page-wrap.east .custom-label,.ec-component-board-container-page-wrap.west .custom-label{display:flex;width:100%;min-height:0;letter-spacing:5px;writing-mode:vertical-lr}.ec-component-board-container-page-wrap.east{flex-direction:row-reverse;right:0;box-shadow:-0.1rem 0 .7rem .1rem rgba(64,72,191,.3);border-radius:2px 0 0}.ec-component-board-container-page-wrap.east .ec-component-board-container-page-wrap__layout{display:flex;flex-direction:row-reverse;align-items:flex-start}.ec-component-board-container-page-wrap.east .board--wing{z-index:1;box-shadow:-8px 0 10px 0 rgba(64,72,191,.2);transform:translate(-100%, -50%);top:50%;left:0;clip-path:polygon(0 18%, 100% 0, 100% 100%, 0 82%)}.ec-component-board-container-page-wrap.east .board--wing .app-iconify{transform:translateY(-50%) rotate(0deg);top:50%;right:-2px}.ec-component-board-container-page-wrap.east.minify .board--wing .app-iconify{transform:rotate(180deg) translateY(50%)}.ec-component-board-container-page-wrap.west{flex-direction:row-reverse;left:0;box-shadow:-0.1rem 0 .7rem .1rem rgba(64,72,191,.3);border-radius:0 2px 0 0}.ec-component-board-container-page-wrap.west .board--wing{z-index:1;box-shadow:-8px 0 10px 0 rgba(64,72,191,.2);transform:translate(100%, -50%);top:50%;right:0;clip-path:polygon(0 0, 100% 18%, 100% 82%, 0% 100%)}.ec-component-board-container-page-wrap.west .board--wing .app-iconify{transform:translateY(-50%) rotate(180deg);top:50%;left:-2px}.ec-component-board-container-page-wrap.west.minify .board--wing .app-iconify{transform:translateY(-50%) rotate(0deg)}.ec-component-board-container-page-wrap.full{flex-direction:row-reverse;right:0;left:0;box-shadow:-0.1rem 0 .7rem .1rem rgba(64,72,191,.3)}.ec-component-board-container-page-wrap.full .board--wing{display:none;top:-30px;left:calc(50% - 70px);z-index:1;width:140px;height:30px;box-shadow:0 -8px 10px 0 rgba(64,72,191,.2);border-radius:10px 10px 0 0}.ec-component-board-container-page-wrap.full.minify{transform:translateY(100%)}.ec-component-board-container-page-wrap.top{top:0px;box-shadow:-0.1rem 0 .7rem .1rem rgba(64,72,191,.3)}.ec-component-board-container-page-wrap.top .ec-component-board-container-page-wrap__layout{display:flex;flex-direction:column}.ec-component-board-container-page-wrap.top .board--wing{height:18px;width:80px;z-index:1;box-shadow:-8px 0 10px 0 rgba(64,72,191,.2);transform:translate(50%, 100%);right:50%;bottom:0px;clip-path:polygon(0% 18%, 100% 18%, 82% 100%, 18% 100%)}.ec-component-board-container-page-wrap.top .board--wing .app-iconify{transform:translateX(-50%) rotate(270deg);left:50%;top:-2px}.ec-component-board-container-page-wrap.top.minify .board--wing .app-iconify{transform:translateX(-50%) rotate(90deg)}.ec-component-board-container-page-wrap.south{bottom:0px;box-shadow:-0.1rem 0 .7rem .1rem rgba(64,72,191,.3)}.ec-component-board-container-page-wrap.south .ec-component-board-container-page-wrap__layout{display:flex;flex-direction:column}.ec-component-board-container-page-wrap.south .board--panels .board--panel-container{position:inherit;padding:0}.ec-component-board-container-page-wrap.south .board--wing{height:18px;width:80px;z-index:1;box-shadow:-8px 0 10px 0 rgba(64,72,191,.2);transform:translate(50%, -100%);right:50%;top:0px;clip-path:polygon(18% 18%, 82% 18%, 100% 100%, 0% 100%)}.ec-component-board-container-page-wrap.south .board--wing .app-iconify{transform:translateX(-50%) rotate(90deg);left:50%;top:-2px}.ec-component-board-container-page-wrap.south.minify .board--wing .app-iconify{transform:translateX(-50%) rotate(270deg)}.custom-month-range .el-month-table .current .cell{background-color:var(--el-color-primary);color:#fff !important}.ec-component-svg-icon{display:inline-block;overflow:hidden;vertical-align:-0.15em;fill:currentColor}.svg-icon-spin{animation:loadingCircle 1s infinite linear}.app-iconify{display:inline-block;vertical-align:middle}.app-iconify-spin svg{animation:loadingCircle 1s infinite linear}span.iconify{display:block;min-width:1em;min-height:1em;background-color:rgba(225,223,223,.55);border-radius:100%}.ec-component-input-password :deep(.el-input__clear){margin-left:5px}.ec-component-input-password__bar{background-color:var(--el-text-color-disabled);border-radius:var(--el-border-radius-base)}.ec-component-input-password__bar::before,.ec-component-input-password__bar::after{position:absolute;z-index:10;display:block;width:20%;height:inherit;background-color:rgba(0,0,0,0);border-color:var(--el-color-white);border-style:solid;border-width:0 5px;content:""}.ec-component-input-password__bar::before{left:20%}.ec-component-input-password__bar::after{right:20%}.ec-component-input-password__bar--fill{position:absolute;width:0;height:inherit;background-color:rgba(0,0,0,0);border-radius:inherit;transition:width .5s ease-in-out,background .25s}.ec-component-input-password__bar--fill[data-score="0"]{width:20%;background-color:var(--el-color-danger)}.ec-component-input-password__bar--fill[data-score="1"]{width:40%;background-color:var(--el-color-danger)}.ec-component-input-password__bar--fill[data-score="2"]{width:60%;background-color:var(--el-color-warning)}.ec-component-input-password__bar--fill[data-score="3"]{width:80%;background-color:var(--el-color-success)}.ec-component-input-password__bar--fill[data-score="4"]{width:100%;background-color:var(--el-color-success)}.ec-component-input-password--mini>.ec-component-input-password__bar{border-radius:var(--el-border-radius-small)}.component.modal{position:fixed}.component.modal.maximum .modal--body,.component.modal.maximum,.component.modal.modally,.component.modal.modally.maximum .modal--body{top:0 !important;left:0 !important;width:100% !important;height:100% !important}.component.modal.modally:before{content:"";display:block;position:absolute;width:100%;height:100%;background:rgba(0,0,0,.5);z-index:-1}.component.modal .modal--body{display:flex;flex:1;border-radius:.3rem;background:rgba(0,0,0,0);box-shadow:.1rem .1rem 1.5rem .1rem rgba(64,72,191,.3)}.component.modal.modally .modal--body{position:absolute}.component.modal .modal--content{position:relative;flex:1;display:flex;background:#fff;flex-direction:column}.component-modal-page-wrap{display:flex;flex-direction:column;min-height:0}.component-modal-page-wrap .component-modal-body{height:100%;width:100%;display:flex;flex-direction:column;min-height:0}.component-modal-page-wrap .component-modal-body .component-modal-header{position:relative;width:100%;height:40px;min-height:40px}.component-modal-page-wrap .component-modal-body .component-modal-header .modal-header-main-container-wrap{width:100%;height:100%;overflow:hidden;display:flex;align-items:center}.component-modal-page-wrap .component-modal-body .component-modal-header .modal-header-right-control-wrap{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;justify-content:flex-end;align-items:center;gap:10px;padding-right:10px}.component-modal-page-wrap .component-modal-body .component-modal-content{flex:1;height:100%}.component-modal-page-wrap .component-modal-body .component-modal-footer{display:flex;justify-content:center;padding:10px 0}.window--enter-active{animation:animate-window-enter-active 200ms cubic-bezier(0.39, 0.575, 0.565, 1) both}.window--leave-active{animation:animate-window-leave-active 200ms cubic-bezier(0.39, 0.575, 0.565, 1) both}@keyframes animate-window-enter-active{0%{transform:scale(0.5);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes animate-window-leave-active{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}.component.stateful{position:relative;flex:1}.component.stateful .stateful--content{display:flex;position:absolute;width:100%;height:100%;left:0;top:0}.component.stateful .stateful--content.cover{filter:blur(1.25px)}.component.stateful .stateful--cover{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;align-items:center;justify-content:center}.component.stateful .stateful--cover .cover--icon{margin-right:10px}.component.stateful .stateful--cover .cover--box{display:flex;align-items:center;justify-content:center;padding:50px 70px;border-radius:.8rem;box-shadow:.1rem .1rem 1.5rem .1rem rgba(64,72,191,.15);position:relative;overflow:hidden;width:auto;height:auto}.component.stateful .stateful--cover .cover--text{font-size:20px;margin-bottom:2px;font-weight:400;text-shadow:0 0 rgba(64,72,191,.3)}.ec-chart-toolbox-wrap{height:100%;width:100%;min-height:0;min-width:0}.ec-chart-toolbox-wrap .tools-container{min-height:0;display:flex;justify-content:flex-end;cursor:pointer;right:0px;top:0px;gap:10px;z-index:9999}.ec-chart-toolbox-wrap .tools-container .app-iconify{cursor:pointer !important;transition:all .5s ease}.ec-chart-toolbox-wrap .tools-container .app-iconify:hover{transition:all .5s ease;box-shadow:0px 1px 10px 0px rgba(0,0,0,.05),0px 4px 5px 0px rgba(0,0,0,.08),0px 2px 4px -1px rgba(0,0,0,.12)}.wrap-el{position:relative;float:left;width:100%;height:100%;overflow:hidden}.video-player-toolbar{color:#fff;position:absolute;left:0;right:0;bottom:0;height:30px;background:rgba(0,0,0,.5);display:flex;align-items:center;gap:10px;justify-content:flex-end;padding:0px 12px;z-index:1000}.video-player-toolbar .app-iconify{cursor:pointer}.component.node-axis{position:relative}.component.node-axis .node-axis--overlay{top:0;left:0;position:absolute;background:rgba(0,0,0,.7);backdrop-filter:blur(10px);box-shadow:0 0 5px 1px rgba(0,0,0,.5);color:#fff;padding:5px;font-size:14px;letter-spacing:1px;display:flex;align-items:center;justify-content:center;border-radius:3px;word-break:keep-all;white-space:nowrap;transition:all 80ms linear;opacity:0}:deep(.el-descriptions__header){display:none !important}:deep(.ec-descriptions-component-label){width:150px !important}.ec-descriptions-component__default .item{padding:8px 11px;font-size:14px}.ec-descriptions-component__default .ec-descriptions-component-content{padding:8px 1px}.ec-descriptions-component__small .item{padding:4px 7px;font-size:12px}.ec-descriptions-component__small .ec-descriptions-component-content{padding:5px 1px}.ec-descriptions-component__large .item{padding:12px 15px;font-size:16px}.ec-descriptions-component__large .ec-descriptions-component-content{padding:10px 1px}.ec-descriptions-component-header__default{font-size:16px;height:32px}.ec-descriptions-component-header__small{font-size:14px;height:32px}.ec-descriptions-component-header__large{font-size:18px;height:40px}.ec-descriptions-component-header__title::after{position:absolute;top:3px;left:-10px;width:4px;height:70%;background:var(--el-color-primary);content:""}
|
|
@@ -5,7 +5,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
6
6
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
7
7
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
8
|
-
import { tryOnMounted, tryOnScopeDispose, toValue,
|
|
8
|
+
import { noop, isIOS, tryOnMounted, tryOnScopeDispose, toValue, isObject, notNullish, isClient } from '../../../../@vueuse_shared@10.11.0_vue@3.4.31_typescript@5.2.2_/node_modules/@vueuse/shared/index.js';
|
|
9
9
|
export { getLifeCycleTarget, tryOnUnmounted } from '../../../../@vueuse_shared@10.11.0_vue@3.4.31_typescript@5.2.2_/node_modules/@vueuse/shared/index.js';
|
|
10
10
|
import { ref, watch, computed, getCurrentInstance, onMounted } from 'vue';
|
|
11
11
|
|
|
@@ -83,6 +83,72 @@ function useEventListener() {
|
|
|
83
83
|
tryOnScopeDispose(stop);
|
|
84
84
|
return stop;
|
|
85
85
|
}
|
|
86
|
+
var _iOSWorkaround = false;
|
|
87
|
+
function onClickOutside(target, handler) {
|
|
88
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
89
|
+
var _options$window = options.window,
|
|
90
|
+
window = _options$window === void 0 ? defaultWindow : _options$window,
|
|
91
|
+
_options$ignore = options.ignore,
|
|
92
|
+
ignore = _options$ignore === void 0 ? [] : _options$ignore,
|
|
93
|
+
_options$capture = options.capture,
|
|
94
|
+
capture = _options$capture === void 0 ? true : _options$capture,
|
|
95
|
+
_options$detectIframe = options.detectIframe,
|
|
96
|
+
detectIframe = _options$detectIframe === void 0 ? false : _options$detectIframe;
|
|
97
|
+
if (!window) return noop;
|
|
98
|
+
if (isIOS && !_iOSWorkaround) {
|
|
99
|
+
_iOSWorkaround = true;
|
|
100
|
+
Array.from(window.document.body.children).forEach(function (el) {
|
|
101
|
+
return el.addEventListener("click", noop);
|
|
102
|
+
});
|
|
103
|
+
window.document.documentElement.addEventListener("click", noop);
|
|
104
|
+
}
|
|
105
|
+
var shouldListen = true;
|
|
106
|
+
var shouldIgnore = function shouldIgnore(event) {
|
|
107
|
+
return ignore.some(function (target2) {
|
|
108
|
+
if (typeof target2 === "string") {
|
|
109
|
+
return Array.from(window.document.querySelectorAll(target2)).some(function (el) {
|
|
110
|
+
return el === event.target || event.composedPath().includes(el);
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
var el = unrefElement(target2);
|
|
114
|
+
return el && (event.target === el || event.composedPath().includes(el));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
var listener = function listener(event) {
|
|
119
|
+
var el = unrefElement(target);
|
|
120
|
+
if (!el || el === event.target || event.composedPath().includes(el)) return;
|
|
121
|
+
if (event.detail === 0) shouldListen = !shouldIgnore(event);
|
|
122
|
+
if (!shouldListen) {
|
|
123
|
+
shouldListen = true;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
handler(event);
|
|
127
|
+
};
|
|
128
|
+
var cleanup = [useEventListener(window, "click", listener, {
|
|
129
|
+
passive: true,
|
|
130
|
+
capture: capture
|
|
131
|
+
}), useEventListener(window, "pointerdown", function (e) {
|
|
132
|
+
var el = unrefElement(target);
|
|
133
|
+
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
|
|
134
|
+
}, {
|
|
135
|
+
passive: true
|
|
136
|
+
}), detectIframe && useEventListener(window, "blur", function (event) {
|
|
137
|
+
setTimeout(function () {
|
|
138
|
+
var _a;
|
|
139
|
+
var el = unrefElement(target);
|
|
140
|
+
if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window.document.activeElement))) {
|
|
141
|
+
handler(event);
|
|
142
|
+
}
|
|
143
|
+
}, 0);
|
|
144
|
+
})].filter(Boolean);
|
|
145
|
+
var stop = function stop() {
|
|
146
|
+
return cleanup.forEach(function (fn) {
|
|
147
|
+
return fn();
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
return stop;
|
|
151
|
+
}
|
|
86
152
|
function useMounted() {
|
|
87
153
|
var isMounted = ref(false);
|
|
88
154
|
var instance = getCurrentInstance();
|
|
@@ -444,4 +510,4 @@ function useFullscreen(target) {
|
|
|
444
510
|
};
|
|
445
511
|
}
|
|
446
512
|
|
|
447
|
-
export { defaultDocument, defaultWindow, isClient, isObject, noop, notNullish, toValue, tryOnMounted, tryOnScopeDispose, unrefElement, useElementBounding, useEventListener, useFullscreen, useMounted, useMutationObserver, useResizeObserver, useSupported };
|
|
513
|
+
export { defaultDocument, defaultWindow, isClient, isIOS, isObject, noop, notNullish, onClickOutside, toValue, tryOnMounted, tryOnScopeDispose, unrefElement, useElementBounding, useEventListener, useFullscreen, useMounted, useMutationObserver, useResizeObserver, useSupported };
|
|
@@ -27,6 +27,11 @@ var isObject = function isObject(val) {
|
|
|
27
27
|
return toString.call(val) === "[object Object]";
|
|
28
28
|
};
|
|
29
29
|
var noop = function noop() {};
|
|
30
|
+
var isIOS = /* @__PURE__ */getIsIOS();
|
|
31
|
+
function getIsIOS() {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
34
|
+
}
|
|
30
35
|
function getLifeCycleTarget(target) {
|
|
31
36
|
return getCurrentInstance();
|
|
32
37
|
}
|
|
@@ -41,4 +46,4 @@ function tryOnUnmounted(fn, target) {
|
|
|
41
46
|
if (instance) onUnmounted(fn, target);
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
export { getLifeCycleTarget, isClient, isObject, noop, notNullish, toValue, tryOnMounted, tryOnScopeDispose, tryOnUnmounted };
|
|
49
|
+
export { getLifeCycleTarget, isClient, isIOS, isObject, noop, notNullish, toValue, tryOnMounted, tryOnScopeDispose, tryOnUnmounted };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfsj/components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "通用的vue组件;包括专业组件、原子级组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"build": "rollup --config ./rollup.config.ts --configPlugin typescript"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@dfsj/echarts": "^3.
|
|
30
|
+
"@dfsj/echarts": "^3.3.0",
|
|
31
31
|
"@dfsj/rollup": "workspace:^",
|
|
32
|
-
"@dfsj/utils": "^3.
|
|
32
|
+
"@dfsj/utils": "^3.3.0",
|
|
33
33
|
"@types/lodash-es": "^4.17.12",
|
|
34
34
|
"@types/node": "^20.11.3",
|
|
35
35
|
"@unocss/transformer-variant-group": "^0.58.6",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"vue-types": "^5.0.2",
|
|
60
60
|
"zrender": "^5.5.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "803bdfb4b6eef1c41687a2bbae3f98a0216a4205",
|
|
63
63
|
"module": "dist/index.js",
|
|
64
64
|
"browser": "dist/index.js",
|
|
65
65
|
"types": "dist/index.d.ts",
|
package/dist/node_modules/.pnpm/@vueuse_core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.js
DELETED
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
-
import '@babel/runtime/helpers/typeof';
|
|
3
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
4
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
6
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
7
|
-
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
8
|
-
import { tryOnMounted, tryOnScopeDispose, toValue, noop, isObject, isClient } from '../../../../@vueuse_shared@10.7.2_vue@3.4.21/node_modules/@vueuse/shared/index.js';
|
|
9
|
-
export { getLifeCycleTarget, tryOnUnmounted } from '../../../../@vueuse_shared@10.7.2_vue@3.4.21/node_modules/@vueuse/shared/index.js';
|
|
10
|
-
import { ref, watch, computed, getCurrentInstance, onMounted } from 'vue';
|
|
11
|
-
|
|
12
|
-
var _excluded = ["window"],
|
|
13
|
-
_excluded2 = ["window"];
|
|
14
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
-
function unrefElement(elRef) {
|
|
20
|
-
var _a;
|
|
21
|
-
var plain = toValue(elRef);
|
|
22
|
-
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
23
|
-
}
|
|
24
|
-
var defaultWindow = isClient ? window : void 0;
|
|
25
|
-
var defaultDocument = isClient ? window.document : void 0;
|
|
26
|
-
function useEventListener() {
|
|
27
|
-
var target;
|
|
28
|
-
var events;
|
|
29
|
-
var listeners;
|
|
30
|
-
var options;
|
|
31
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
32
|
-
args[_key3] = arguments[_key3];
|
|
33
|
-
}
|
|
34
|
-
if (typeof args[0] === "string" || Array.isArray(args[0])) {
|
|
35
|
-
events = args[0];
|
|
36
|
-
listeners = args[1];
|
|
37
|
-
options = args[2];
|
|
38
|
-
target = defaultWindow;
|
|
39
|
-
} else {
|
|
40
|
-
target = args[0];
|
|
41
|
-
events = args[1];
|
|
42
|
-
listeners = args[2];
|
|
43
|
-
options = args[3];
|
|
44
|
-
}
|
|
45
|
-
if (!target) return noop;
|
|
46
|
-
if (!Array.isArray(events)) events = [events];
|
|
47
|
-
if (!Array.isArray(listeners)) listeners = [listeners];
|
|
48
|
-
var cleanups = [];
|
|
49
|
-
var cleanup = function cleanup() {
|
|
50
|
-
cleanups.forEach(function (fn) {
|
|
51
|
-
return fn();
|
|
52
|
-
});
|
|
53
|
-
cleanups.length = 0;
|
|
54
|
-
};
|
|
55
|
-
var register = function register(el, event, listener, options2) {
|
|
56
|
-
el.addEventListener(event, listener, options2);
|
|
57
|
-
return function () {
|
|
58
|
-
return el.removeEventListener(event, listener, options2);
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
var stopWatch = watch(function () {
|
|
62
|
-
return [unrefElement(target), toValue(options)];
|
|
63
|
-
}, function (_ref5) {
|
|
64
|
-
var _ref6 = _slicedToArray(_ref5, 2),
|
|
65
|
-
el = _ref6[0],
|
|
66
|
-
options2 = _ref6[1];
|
|
67
|
-
cleanup();
|
|
68
|
-
if (!el) return;
|
|
69
|
-
var optionsClone = isObject(options2) ? _objectSpread({}, options2) : options2;
|
|
70
|
-
cleanups.push.apply(cleanups, _toConsumableArray(events.flatMap(function (event) {
|
|
71
|
-
return listeners.map(function (listener) {
|
|
72
|
-
return register(el, event, listener, optionsClone);
|
|
73
|
-
});
|
|
74
|
-
})));
|
|
75
|
-
}, {
|
|
76
|
-
immediate: true,
|
|
77
|
-
flush: "post"
|
|
78
|
-
});
|
|
79
|
-
var stop = function stop() {
|
|
80
|
-
stopWatch();
|
|
81
|
-
cleanup();
|
|
82
|
-
};
|
|
83
|
-
tryOnScopeDispose(stop);
|
|
84
|
-
return stop;
|
|
85
|
-
}
|
|
86
|
-
function useMounted() {
|
|
87
|
-
var isMounted = ref(false);
|
|
88
|
-
if (getCurrentInstance()) {
|
|
89
|
-
onMounted(function () {
|
|
90
|
-
isMounted.value = true;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return isMounted;
|
|
94
|
-
}
|
|
95
|
-
function useSupported(callback) {
|
|
96
|
-
var isMounted = useMounted();
|
|
97
|
-
return computed(function () {
|
|
98
|
-
isMounted.value;
|
|
99
|
-
return Boolean(callback());
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function useMutationObserver(target, callback) {
|
|
103
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
104
|
-
var _options$window10 = options.window,
|
|
105
|
-
window = _options$window10 === void 0 ? defaultWindow : _options$window10,
|
|
106
|
-
mutationOptions = _objectWithoutProperties(options, _excluded);
|
|
107
|
-
var observer;
|
|
108
|
-
var isSupported = useSupported(function () {
|
|
109
|
-
return window && "MutationObserver" in window;
|
|
110
|
-
});
|
|
111
|
-
var cleanup = function cleanup() {
|
|
112
|
-
if (observer) {
|
|
113
|
-
observer.disconnect();
|
|
114
|
-
observer = void 0;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
var stopWatch = watch(function () {
|
|
118
|
-
return unrefElement(target);
|
|
119
|
-
}, function (el) {
|
|
120
|
-
cleanup();
|
|
121
|
-
if (isSupported.value && window && el) {
|
|
122
|
-
observer = new MutationObserver(callback);
|
|
123
|
-
observer.observe(el, mutationOptions);
|
|
124
|
-
}
|
|
125
|
-
}, {
|
|
126
|
-
immediate: true
|
|
127
|
-
});
|
|
128
|
-
var takeRecords = function takeRecords() {
|
|
129
|
-
return observer == null ? void 0 : observer.takeRecords();
|
|
130
|
-
};
|
|
131
|
-
var stop = function stop() {
|
|
132
|
-
cleanup();
|
|
133
|
-
stopWatch();
|
|
134
|
-
};
|
|
135
|
-
tryOnScopeDispose(stop);
|
|
136
|
-
return {
|
|
137
|
-
isSupported: isSupported,
|
|
138
|
-
stop: stop,
|
|
139
|
-
takeRecords: takeRecords
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function useResizeObserver(target, callback) {
|
|
143
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
144
|
-
var _options$window16 = options.window,
|
|
145
|
-
window = _options$window16 === void 0 ? defaultWindow : _options$window16,
|
|
146
|
-
observerOptions = _objectWithoutProperties(options, _excluded2);
|
|
147
|
-
var observer;
|
|
148
|
-
var isSupported = useSupported(function () {
|
|
149
|
-
return window && "ResizeObserver" in window;
|
|
150
|
-
});
|
|
151
|
-
var cleanup = function cleanup() {
|
|
152
|
-
if (observer) {
|
|
153
|
-
observer.disconnect();
|
|
154
|
-
observer = void 0;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
var targets = computed(function () {
|
|
158
|
-
return Array.isArray(target) ? target.map(function (el) {
|
|
159
|
-
return unrefElement(el);
|
|
160
|
-
}) : [unrefElement(target)];
|
|
161
|
-
});
|
|
162
|
-
var stopWatch = watch(targets, function (els) {
|
|
163
|
-
cleanup();
|
|
164
|
-
if (isSupported.value && window) {
|
|
165
|
-
observer = new ResizeObserver(callback);
|
|
166
|
-
var _iterator3 = _createForOfIteratorHelper(els),
|
|
167
|
-
_step3;
|
|
168
|
-
try {
|
|
169
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
170
|
-
var _el = _step3.value;
|
|
171
|
-
_el && observer.observe(_el, observerOptions);
|
|
172
|
-
}
|
|
173
|
-
} catch (err) {
|
|
174
|
-
_iterator3.e(err);
|
|
175
|
-
} finally {
|
|
176
|
-
_iterator3.f();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}, {
|
|
180
|
-
immediate: true,
|
|
181
|
-
flush: "post",
|
|
182
|
-
deep: true
|
|
183
|
-
});
|
|
184
|
-
var stop = function stop() {
|
|
185
|
-
cleanup();
|
|
186
|
-
stopWatch();
|
|
187
|
-
};
|
|
188
|
-
tryOnScopeDispose(stop);
|
|
189
|
-
return {
|
|
190
|
-
isSupported: isSupported,
|
|
191
|
-
stop: stop
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function useElementBounding(target) {
|
|
195
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
196
|
-
var _options$reset = options.reset,
|
|
197
|
-
reset = _options$reset === void 0 ? true : _options$reset,
|
|
198
|
-
_options$windowResize = options.windowResize,
|
|
199
|
-
windowResize = _options$windowResize === void 0 ? true : _options$windowResize,
|
|
200
|
-
_options$windowScroll = options.windowScroll,
|
|
201
|
-
windowScroll = _options$windowScroll === void 0 ? true : _options$windowScroll,
|
|
202
|
-
_options$immediate3 = options.immediate,
|
|
203
|
-
immediate = _options$immediate3 === void 0 ? true : _options$immediate3;
|
|
204
|
-
var height = ref(0);
|
|
205
|
-
var bottom = ref(0);
|
|
206
|
-
var left = ref(0);
|
|
207
|
-
var right = ref(0);
|
|
208
|
-
var top = ref(0);
|
|
209
|
-
var width = ref(0);
|
|
210
|
-
var x = ref(0);
|
|
211
|
-
var y = ref(0);
|
|
212
|
-
function update() {
|
|
213
|
-
var el = unrefElement(target);
|
|
214
|
-
if (!el) {
|
|
215
|
-
if (reset) {
|
|
216
|
-
height.value = 0;
|
|
217
|
-
bottom.value = 0;
|
|
218
|
-
left.value = 0;
|
|
219
|
-
right.value = 0;
|
|
220
|
-
top.value = 0;
|
|
221
|
-
width.value = 0;
|
|
222
|
-
x.value = 0;
|
|
223
|
-
y.value = 0;
|
|
224
|
-
}
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
var rect = el.getBoundingClientRect();
|
|
228
|
-
height.value = rect.height;
|
|
229
|
-
bottom.value = rect.bottom;
|
|
230
|
-
left.value = rect.left;
|
|
231
|
-
right.value = rect.right;
|
|
232
|
-
top.value = rect.top;
|
|
233
|
-
width.value = rect.width;
|
|
234
|
-
x.value = rect.x;
|
|
235
|
-
y.value = rect.y;
|
|
236
|
-
}
|
|
237
|
-
useResizeObserver(target, update);
|
|
238
|
-
watch(function () {
|
|
239
|
-
return unrefElement(target);
|
|
240
|
-
}, function (ele) {
|
|
241
|
-
return !ele && update();
|
|
242
|
-
});
|
|
243
|
-
useMutationObserver(target, update, {
|
|
244
|
-
attributeFilter: ["style", "class"]
|
|
245
|
-
});
|
|
246
|
-
if (windowScroll) useEventListener("scroll", update, {
|
|
247
|
-
capture: true,
|
|
248
|
-
passive: true
|
|
249
|
-
});
|
|
250
|
-
if (windowResize) useEventListener("resize", update, {
|
|
251
|
-
passive: true
|
|
252
|
-
});
|
|
253
|
-
tryOnMounted(function () {
|
|
254
|
-
if (immediate) update();
|
|
255
|
-
});
|
|
256
|
-
return {
|
|
257
|
-
height: height,
|
|
258
|
-
bottom: bottom,
|
|
259
|
-
left: left,
|
|
260
|
-
right: right,
|
|
261
|
-
top: top,
|
|
262
|
-
width: width,
|
|
263
|
-
x: x,
|
|
264
|
-
y: y,
|
|
265
|
-
update: update
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
var eventHandlers = ["fullscreenchange", "webkitfullscreenchange", "webkitendfullscreen", "mozfullscreenchange", "MSFullscreenChange"];
|
|
269
|
-
function useFullscreen(target) {
|
|
270
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
271
|
-
var _options$document6 = options.document,
|
|
272
|
-
document = _options$document6 === void 0 ? defaultDocument : _options$document6,
|
|
273
|
-
_options$autoExit = options.autoExit,
|
|
274
|
-
autoExit = _options$autoExit === void 0 ? false : _options$autoExit;
|
|
275
|
-
var targetRef = computed(function () {
|
|
276
|
-
var _a;
|
|
277
|
-
return (_a = unrefElement(target)) != null ? _a : document == null ? void 0 : document.querySelector("html");
|
|
278
|
-
});
|
|
279
|
-
var isFullscreen = ref(false);
|
|
280
|
-
var requestMethod = computed(function () {
|
|
281
|
-
return ["requestFullscreen", "webkitRequestFullscreen", "webkitEnterFullscreen", "webkitEnterFullScreen", "webkitRequestFullScreen", "mozRequestFullScreen", "msRequestFullscreen"].find(function (m) {
|
|
282
|
-
return document && m in document || targetRef.value && m in targetRef.value;
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
var exitMethod = computed(function () {
|
|
286
|
-
return ["exitFullscreen", "webkitExitFullscreen", "webkitExitFullScreen", "webkitCancelFullScreen", "mozCancelFullScreen", "msExitFullscreen"].find(function (m) {
|
|
287
|
-
return document && m in document || targetRef.value && m in targetRef.value;
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
var fullscreenEnabled = computed(function () {
|
|
291
|
-
return ["fullScreen", "webkitIsFullScreen", "webkitDisplayingFullscreen", "mozFullScreen", "msFullscreenElement"].find(function (m) {
|
|
292
|
-
return document && m in document || targetRef.value && m in targetRef.value;
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
var fullscreenElementMethod = ["fullscreenElement", "webkitFullscreenElement", "mozFullScreenElement", "msFullscreenElement"].find(function (m) {
|
|
296
|
-
return document && m in document;
|
|
297
|
-
});
|
|
298
|
-
var isSupported = useSupported(function () {
|
|
299
|
-
return targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0;
|
|
300
|
-
});
|
|
301
|
-
var isCurrentElementFullScreen = function isCurrentElementFullScreen() {
|
|
302
|
-
if (fullscreenElementMethod) return (document == null ? void 0 : document[fullscreenElementMethod]) === targetRef.value;
|
|
303
|
-
return false;
|
|
304
|
-
};
|
|
305
|
-
var isElementFullScreen = function isElementFullScreen() {
|
|
306
|
-
if (fullscreenEnabled.value) {
|
|
307
|
-
if (document && document[fullscreenEnabled.value] != null) {
|
|
308
|
-
return document[fullscreenEnabled.value];
|
|
309
|
-
} else {
|
|
310
|
-
var target2 = targetRef.value;
|
|
311
|
-
if ((target2 == null ? void 0 : target2[fullscreenEnabled.value]) != null) {
|
|
312
|
-
return Boolean(target2[fullscreenEnabled.value]);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
return false;
|
|
317
|
-
};
|
|
318
|
-
function exit() {
|
|
319
|
-
return _exit.apply(this, arguments);
|
|
320
|
-
}
|
|
321
|
-
function _exit() {
|
|
322
|
-
_exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
323
|
-
var target2;
|
|
324
|
-
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
325
|
-
while (1) switch (_context25.prev = _context25.next) {
|
|
326
|
-
case 0:
|
|
327
|
-
if (!(!isSupported.value || !isFullscreen.value)) {
|
|
328
|
-
_context25.next = 2;
|
|
329
|
-
break;
|
|
330
|
-
}
|
|
331
|
-
return _context25.abrupt("return");
|
|
332
|
-
case 2:
|
|
333
|
-
if (!exitMethod.value) {
|
|
334
|
-
_context25.next = 12;
|
|
335
|
-
break;
|
|
336
|
-
}
|
|
337
|
-
if (!((document == null ? void 0 : document[exitMethod.value]) != null)) {
|
|
338
|
-
_context25.next = 8;
|
|
339
|
-
break;
|
|
340
|
-
}
|
|
341
|
-
_context25.next = 6;
|
|
342
|
-
return document[exitMethod.value]();
|
|
343
|
-
case 6:
|
|
344
|
-
_context25.next = 12;
|
|
345
|
-
break;
|
|
346
|
-
case 8:
|
|
347
|
-
target2 = targetRef.value;
|
|
348
|
-
if (!((target2 == null ? void 0 : target2[exitMethod.value]) != null)) {
|
|
349
|
-
_context25.next = 12;
|
|
350
|
-
break;
|
|
351
|
-
}
|
|
352
|
-
_context25.next = 12;
|
|
353
|
-
return target2[exitMethod.value]();
|
|
354
|
-
case 12:
|
|
355
|
-
isFullscreen.value = false;
|
|
356
|
-
case 13:
|
|
357
|
-
case "end":
|
|
358
|
-
return _context25.stop();
|
|
359
|
-
}
|
|
360
|
-
}, _callee25);
|
|
361
|
-
}));
|
|
362
|
-
return _exit.apply(this, arguments);
|
|
363
|
-
}
|
|
364
|
-
function enter() {
|
|
365
|
-
return _enter.apply(this, arguments);
|
|
366
|
-
}
|
|
367
|
-
function _enter() {
|
|
368
|
-
_enter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
369
|
-
var target2;
|
|
370
|
-
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
371
|
-
while (1) switch (_context26.prev = _context26.next) {
|
|
372
|
-
case 0:
|
|
373
|
-
if (!(!isSupported.value || isFullscreen.value)) {
|
|
374
|
-
_context26.next = 2;
|
|
375
|
-
break;
|
|
376
|
-
}
|
|
377
|
-
return _context26.abrupt("return");
|
|
378
|
-
case 2:
|
|
379
|
-
if (!isElementFullScreen()) {
|
|
380
|
-
_context26.next = 5;
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
_context26.next = 5;
|
|
384
|
-
return exit();
|
|
385
|
-
case 5:
|
|
386
|
-
target2 = targetRef.value;
|
|
387
|
-
if (!(requestMethod.value && (target2 == null ? void 0 : target2[requestMethod.value]) != null)) {
|
|
388
|
-
_context26.next = 10;
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
_context26.next = 9;
|
|
392
|
-
return target2[requestMethod.value]();
|
|
393
|
-
case 9:
|
|
394
|
-
isFullscreen.value = true;
|
|
395
|
-
case 10:
|
|
396
|
-
case "end":
|
|
397
|
-
return _context26.stop();
|
|
398
|
-
}
|
|
399
|
-
}, _callee26);
|
|
400
|
-
}));
|
|
401
|
-
return _enter.apply(this, arguments);
|
|
402
|
-
}
|
|
403
|
-
function toggle() {
|
|
404
|
-
return _toggle.apply(this, arguments);
|
|
405
|
-
}
|
|
406
|
-
function _toggle() {
|
|
407
|
-
_toggle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
408
|
-
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
409
|
-
while (1) switch (_context27.prev = _context27.next) {
|
|
410
|
-
case 0:
|
|
411
|
-
_context27.next = 2;
|
|
412
|
-
return isFullscreen.value ? exit() : enter();
|
|
413
|
-
case 2:
|
|
414
|
-
case "end":
|
|
415
|
-
return _context27.stop();
|
|
416
|
-
}
|
|
417
|
-
}, _callee27);
|
|
418
|
-
}));
|
|
419
|
-
return _toggle.apply(this, arguments);
|
|
420
|
-
}
|
|
421
|
-
var handlerCallback = function handlerCallback() {
|
|
422
|
-
var isElementFullScreenValue = isElementFullScreen();
|
|
423
|
-
if (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;
|
|
424
|
-
};
|
|
425
|
-
useEventListener(document, eventHandlers, handlerCallback, false);
|
|
426
|
-
useEventListener(function () {
|
|
427
|
-
return unrefElement(targetRef);
|
|
428
|
-
}, eventHandlers, handlerCallback, false);
|
|
429
|
-
if (autoExit) tryOnScopeDispose(exit);
|
|
430
|
-
return {
|
|
431
|
-
isSupported: isSupported,
|
|
432
|
-
isFullscreen: isFullscreen,
|
|
433
|
-
enter: enter,
|
|
434
|
-
exit: exit,
|
|
435
|
-
toggle: toggle
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
export { defaultDocument, defaultWindow, isClient, isObject, noop, toValue, tryOnMounted, tryOnScopeDispose, unrefElement, useElementBounding, useEventListener, useFullscreen, useMounted, useMutationObserver, useResizeObserver, useSupported };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
-
import '@babel/runtime/helpers/asyncToGenerator';
|
|
3
|
-
import '@babel/runtime/helpers/toConsumableArray';
|
|
4
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
6
|
-
import '@babel/runtime/regenerator';
|
|
7
|
-
import { getCurrentScope, onScopeDispose, onMounted, nextTick, unref, getCurrentInstance, onUnmounted } from 'vue';
|
|
8
|
-
|
|
9
|
-
function tryOnScopeDispose(fn) {
|
|
10
|
-
if (getCurrentScope()) {
|
|
11
|
-
onScopeDispose(fn);
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
function toValue(r) {
|
|
17
|
-
return typeof r === "function" ? r() : unref(r);
|
|
18
|
-
}
|
|
19
|
-
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
20
|
-
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
21
|
-
var toString = Object.prototype.toString;
|
|
22
|
-
var isObject = function isObject(val) {
|
|
23
|
-
return toString.call(val) === "[object Object]";
|
|
24
|
-
};
|
|
25
|
-
var noop = function noop() {};
|
|
26
|
-
function getLifeCycleTarget(target) {
|
|
27
|
-
return target || getCurrentInstance();
|
|
28
|
-
}
|
|
29
|
-
function tryOnMounted(fn) {
|
|
30
|
-
var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
31
|
-
var target = arguments.length > 2 ? arguments[2] : undefined;
|
|
32
|
-
var instance = getLifeCycleTarget();
|
|
33
|
-
if (instance) onMounted(fn, target);else if (sync) fn();else nextTick(fn);
|
|
34
|
-
}
|
|
35
|
-
function tryOnUnmounted(fn, target) {
|
|
36
|
-
var instance = getLifeCycleTarget(target);
|
|
37
|
-
if (instance) onUnmounted(fn, target);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { getLifeCycleTarget, isClient, isObject, noop, toValue, tryOnMounted, tryOnScopeDispose, tryOnUnmounted };
|