@dfsj/components 3.2.1 → 3.4.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 CHANGED
@@ -3,6 +3,47 @@
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.4.0](http://10.10.12.18/dfsj/dfsj/compare/@dfsj/components@3.1.3...@dfsj/components@3.4.0) (2024-08-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * (components) UnifyChart.vue ([9a5d4db](http://10.10.12.18/dfsj/dfsj/commits/9a5d4dbe80b10bf9de80718e0b6e18c22cbd0205))
12
+ * **components:** 时间轴主题可配置 ([4bdca6e](http://10.10.12.18/dfsj/dfsj/commits/4bdca6eb7a944bf25c999600cf556146e698eee4))
13
+
14
+
15
+ ### Features
16
+
17
+ * (components) BasicModal支持vh、vw、px、rem ([866c6d2](http://10.10.12.18/dfsj/dfsj/commits/866c6d2447a203329ba3783f6a3edababf91a50c))
18
+ * (components) Descriptions ([5873c14](http://10.10.12.18/dfsj/dfsj/commits/5873c14bc746596c536b203551147de8d2c097c0))
19
+ * (components) UnifyChart.vue 导出方法 ([d4065b9](http://10.10.12.18/dfsj/dfsj/commits/d4065b984d4f97dad21bb55474bb616f2149a16e))
20
+ * **components:** 导出组件 ([d6e313e](http://10.10.12.18/dfsj/dfsj/commits/d6e313e53f09a3a6895f1a212d8341fc5a196cbf))
21
+ * **components:** 新增clickOutSide组件 ([e663b5d](http://10.10.12.18/dfsj/dfsj/commits/e663b5db93844d2052f07861739534956f2f908a))
22
+
23
+
24
+
25
+
26
+
27
+ # [3.3.0](http://10.10.12.18/dfsj/dfsj/compare/@dfsj/components@3.1.3...@dfsj/components@3.3.0) (2024-08-12)
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * (components) UnifyChart.vue ([9a5d4db](http://10.10.12.18/dfsj/dfsj/commits/9a5d4dbe80b10bf9de80718e0b6e18c22cbd0205))
33
+
34
+
35
+ ### Features
36
+
37
+ * (components) BasicModal支持vh、vw、px、rem ([866c6d2](http://10.10.12.18/dfsj/dfsj/commits/866c6d2447a203329ba3783f6a3edababf91a50c))
38
+ * (components) Descriptions ([5873c14](http://10.10.12.18/dfsj/dfsj/commits/5873c14bc746596c536b203551147de8d2c097c0))
39
+ * (components) UnifyChart.vue 导出方法 ([d4065b9](http://10.10.12.18/dfsj/dfsj/commits/d4065b984d4f97dad21bb55474bb616f2149a16e))
40
+ * **components:** 导出组件 ([d6e313e](http://10.10.12.18/dfsj/dfsj/commits/d6e313e53f09a3a6895f1a212d8341fc5a196cbf))
41
+ * **components:** 新增clickOutSide组件 ([e663b5d](http://10.10.12.18/dfsj/dfsj/commits/e663b5db93844d2052f07861739534956f2f908a))
42
+
43
+
44
+
45
+
46
+
6
47
  # [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
48
 
8
49
 
@@ -0,0 +1,2 @@
1
+ import clickOutSide from './src/ClickOutSide.vue';
2
+ export { clickOutSide };
@@ -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,5 @@
1
+ import script from './ClickOutSide.vue2.js';
2
+
3
+ script.__file = "src/components/ClickOutSide/src/ClickOutSide.vue";
4
+
5
+ export { script as 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 };
@@ -320,7 +320,7 @@ var CanvasNodeRender = /*#__PURE__*/function (_NodeRender) {
320
320
  r: o.node.size / 2
321
321
  },
322
322
  style: {
323
- fill: '#fff',
323
+ fill: (e === index ? indexColor : provider.color(e)) || o.node.color,
324
324
  stroke: o.node.outlineColor,
325
325
  lineWidth: o.node.outlineWidth
326
326
  }
@@ -350,11 +350,24 @@ var CanvasNodeRender = /*#__PURE__*/function (_NodeRender) {
350
350
  textVerticalAlign: 'middle',
351
351
  fontFamily: 'Lato',
352
352
  fontWeight: 'bolder',
353
- textFill: '#0ff',
353
+ fill: o.label.color,
354
354
  blend: 'lighten'
355
355
  },
356
356
  position: [x, b.label]
357
357
  });
358
+ t1.onmouseover = function (ev) {
359
+ _this3.onMouseMove(ev);
360
+ };
361
+ t1.onmouseout = function (ev) {
362
+ _this3.onMouseLeave(ev);
363
+ };
364
+ t1.onclick = function (ev) {
365
+ _this3.onMouseDown(ev);
366
+ };
367
+ t1.oncontextmenu = function (ev) {
368
+ ev === null || ev === void 0 || ev.event.preventDefault();
369
+ ev === null || ev === void 0 || ev.event.stopImmediatePropagation();
370
+ };
358
371
  (_this3$zrender3 = _this3.zrender) === null || _this3$zrender3 === void 0 || _this3$zrender3.add(t1);
359
372
  }
360
373
  });
@@ -31,6 +31,7 @@ var script = defineComponent({
31
31
  var props = __props;
32
32
  var emits = __emit;
33
33
  var model = new NodeModel(_objectSpread(_objectSpread({}, def), props.config));
34
+ console.log('model', model);
34
35
  var renderer = new CanvasNodeRender(model);
35
36
  var player = new TimerNodePlayer(model, renderer);
36
37
  var container = ref();
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';
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  @dfsj/components:通用的vue组件;包括专业组件、原子级组件
3
- 版本: 3.2.0
3
+ 版本: 3.3.0
4
4
  作者:yangbo <1747837358@qq.com>
5
- 日期:2024-07-23 09:56:13
5
+ 日期:2024-08-14 15:35:32
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, noop, isObject, notNullish, isClient } from '../../../../@vueuse_shared@10.11.0_vue@3.4.31_typescript@5.2.2_/node_modules/@vueuse/shared/index.js';
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,69 +1,69 @@
1
- {
2
- "name": "@dfsj/components",
3
- "version": "3.2.1",
4
- "description": "通用的vue组件;包括专业组件、原子级组件",
5
- "type": "module",
6
- "keywords": [
7
- "vue3",
8
- "component"
9
- ],
10
- "author": "yangbo <1747837358@qq.com>",
11
- "homepage": "",
12
- "license": "MIT",
13
- "main": "dist/index.js",
14
- "directories": {
15
- "lib": "lib",
16
- "test": "__tests__"
17
- },
18
- "files": [
19
- "dist",
20
- "README.md",
21
- "LICENSE",
22
- "CHANGELOG.md"
23
- ],
24
- "scripts": {
25
- "test": "node ./__tests__/component.test.js",
26
- "watch": "rollup --config ./rollup.config.ts --configPlugin typescript -w",
27
- "build": "rollup --config ./rollup.config.ts --configPlugin typescript"
28
- },
29
- "devDependencies": {
30
- "@dfsj/rollup": "workspace:^",
31
- "@dfsj/echarts": "workspace:^3.2.0",
32
- "@dfsj/utils": "workspace:^3.2.0",
33
- "@types/lodash-es": "^4.17.12",
34
- "@types/node": "^20.11.3",
35
- "@unocss/transformer-variant-group": "^0.58.6",
36
- "@vue/compiler-sfc": "^3.2.47",
37
- "@vueuse/core": "^10.5.0",
38
- "element-plus": "2.7.6",
39
- "unocss": "^0.58.6",
40
- "vue": "^3.4.21"
41
- },
42
- "peerDependencies": {
43
- "element-plus": "2.7.6",
44
- "vue": "^3.4.21",
45
- "@dfsj/echarts": "^3.2.0",
46
- "@dfsj/utils": "^3.2.0"
47
- },
48
- "dependencies": {
49
- "@babel/runtime": "^7.24.0",
50
- "@element-plus/icons-vue": "^2.3.1",
51
- "@iconify/iconify": "^3.1.1",
52
- "@wangeditor/editor": "^5.1.23",
53
- "@wangeditor/editor-for-vue": "^5.1.10",
54
- "@zxcvbn-ts/core": "^3.0.4",
55
- "dayjs": "^1.11.7",
56
- "lodash-es": "^4.17.21",
57
- "luxon": "^3.4.4",
58
- "vue-draggable-plus": "^0.3.5",
59
- "vue-types": "^5.0.2",
60
- "zrender": "^5.5.0"
61
- },
62
- "gitHead": "0b570d86e0ba05e19a5713e24c05b2f0d5aaeb73",
63
- "module": "dist/index.js",
64
- "browser": "dist/index.js",
65
- "types": "dist/index.d.ts",
66
- "publishConfig": {
67
- "access": "public"
68
- }
69
- }
1
+ {
2
+ "name": "@dfsj/components",
3
+ "version": "3.4.0",
4
+ "description": "通用的vue组件;包括专业组件、原子级组件",
5
+ "type": "module",
6
+ "keywords": [
7
+ "vue3",
8
+ "component"
9
+ ],
10
+ "author": "yangbo <1747837358@qq.com>",
11
+ "homepage": "",
12
+ "license": "MIT",
13
+ "main": "dist/index.js",
14
+ "directories": {
15
+ "lib": "lib",
16
+ "test": "__tests__"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "LICENSE",
22
+ "CHANGELOG.md"
23
+ ],
24
+ "scripts": {
25
+ "test": "node ./__tests__/component.test.js",
26
+ "watch": "rollup --config ./rollup.config.ts --configPlugin typescript -w",
27
+ "build": "rollup --config ./rollup.config.ts --configPlugin typescript"
28
+ },
29
+ "devDependencies": {
30
+ "@dfsj/echarts": "^3.4.0",
31
+ "@dfsj/rollup": "workspace:^",
32
+ "@dfsj/utils": "^3.4.0",
33
+ "@types/lodash-es": "^4.17.12",
34
+ "@types/node": "^20.11.3",
35
+ "@unocss/transformer-variant-group": "^0.58.6",
36
+ "@vue/compiler-sfc": "^3.2.47",
37
+ "@vueuse/core": "^10.5.0",
38
+ "element-plus": "2.7.6",
39
+ "unocss": "^0.58.6",
40
+ "vue": "^3.4.21"
41
+ },
42
+ "peerDependencies": {
43
+ "@dfsj/echarts": "^3.2.0",
44
+ "@dfsj/utils": "^3.2.0",
45
+ "element-plus": "2.7.6",
46
+ "vue": "^3.4.21"
47
+ },
48
+ "dependencies": {
49
+ "@babel/runtime": "^7.24.0",
50
+ "@element-plus/icons-vue": "^2.3.1",
51
+ "@iconify/iconify": "^3.1.1",
52
+ "@wangeditor/editor": "^5.1.23",
53
+ "@wangeditor/editor-for-vue": "^5.1.10",
54
+ "@zxcvbn-ts/core": "^3.0.4",
55
+ "dayjs": "^1.11.7",
56
+ "lodash-es": "^4.17.21",
57
+ "luxon": "^3.4.4",
58
+ "vue-draggable-plus": "^0.3.5",
59
+ "vue-types": "^5.0.2",
60
+ "zrender": "^5.5.0"
61
+ },
62
+ "gitHead": "38289d6663ef6984c76b6016d24823e6f427d21a",
63
+ "module": "dist/index.js",
64
+ "browser": "dist/index.js",
65
+ "types": "dist/index.d.ts",
66
+ "publishConfig": {
67
+ "access": "public"
68
+ }
69
+ }