@dfsj/components 3.5.1 → 3.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/CHANGELOG.md +27 -0
- package/dist/components/Boards/src/Boards.vue2.js +3 -3
- package/dist/components/ClickOutSide/src/ClickOutSide.vue2.js +1 -1
- package/dist/components/Descriptions/src/Descriptions.vue.d.ts +96 -1
- package/dist/components/Form/src/Form.vue.d.ts +803 -1
- package/dist/components/Form/src/Form.vue2.js +1 -1
- package/dist/components/Highlight/src/Highlight.vue.d.ts +40 -1
- package/dist/components/Modal/src/BasicModal.vue.d.ts +323 -1
- package/dist/components/Modal/src/hooks/useTimeout.js +1 -1
- package/dist/components/Table/src/Table.vue.d.ts +1489 -1
- package/dist/components/Table/src/Table.vue2.js +1 -1
- package/dist/components/Table/src/components/TableActions.vue.d.ts +95 -1
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +1 -1
- package/dist/index.min.css +2 -2
- package/dist/node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.11_typescript@5.6.2_/node_modules/@vueuse/core/index.js +1 -1
- package/dist/node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.2_/node_modules/@vueuse/core/index.js +513 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.12_typescript@5.6.2_/node_modules/@vueuse/shared/index.js +49 -0
- package/package.json +6 -6
|
@@ -0,0 +1,513 @@
|
|
|
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 { noop, isIOS, tryOnMounted, tryOnScopeDispose, toValue, isObject, notNullish, isClient } from '../../../../@vueuse_shared@10.11.1_vue@3.5.12_typescript@5.6.2_/node_modules/@vueuse/shared/index.js';
|
|
9
|
+
export { getLifeCycleTarget, tryOnUnmounted } from '../../../../@vueuse_shared@10.11.1_vue@3.5.12_typescript@5.6.2_/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(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
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
|
+
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
|
+
}
|
|
152
|
+
function useMounted() {
|
|
153
|
+
var isMounted = ref(false);
|
|
154
|
+
var instance = getCurrentInstance();
|
|
155
|
+
if (instance) {
|
|
156
|
+
onMounted(function () {
|
|
157
|
+
isMounted.value = true;
|
|
158
|
+
}, instance);
|
|
159
|
+
}
|
|
160
|
+
return isMounted;
|
|
161
|
+
}
|
|
162
|
+
function useSupported(callback) {
|
|
163
|
+
var isMounted = useMounted();
|
|
164
|
+
return computed(function () {
|
|
165
|
+
isMounted.value;
|
|
166
|
+
return Boolean(callback());
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function useMutationObserver(target, callback) {
|
|
170
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
171
|
+
var _options$window2 = options.window,
|
|
172
|
+
window = _options$window2 === void 0 ? defaultWindow : _options$window2,
|
|
173
|
+
mutationOptions = _objectWithoutProperties(options, _excluded);
|
|
174
|
+
var observer;
|
|
175
|
+
var isSupported = useSupported(function () {
|
|
176
|
+
return window && "MutationObserver" in window;
|
|
177
|
+
});
|
|
178
|
+
var cleanup = function cleanup() {
|
|
179
|
+
if (observer) {
|
|
180
|
+
observer.disconnect();
|
|
181
|
+
observer = void 0;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
var targets = computed(function () {
|
|
185
|
+
var value = toValue(target);
|
|
186
|
+
var items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);
|
|
187
|
+
return new Set(items);
|
|
188
|
+
});
|
|
189
|
+
var stopWatch = watch(function () {
|
|
190
|
+
return targets.value;
|
|
191
|
+
}, function (targets2) {
|
|
192
|
+
cleanup();
|
|
193
|
+
if (isSupported.value && targets2.size) {
|
|
194
|
+
observer = new MutationObserver(callback);
|
|
195
|
+
targets2.forEach(function (el) {
|
|
196
|
+
return observer.observe(el, mutationOptions);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}, {
|
|
200
|
+
immediate: true,
|
|
201
|
+
flush: "post"
|
|
202
|
+
});
|
|
203
|
+
var takeRecords = function takeRecords() {
|
|
204
|
+
return observer == null ? void 0 : observer.takeRecords();
|
|
205
|
+
};
|
|
206
|
+
var stop = function stop() {
|
|
207
|
+
cleanup();
|
|
208
|
+
stopWatch();
|
|
209
|
+
};
|
|
210
|
+
tryOnScopeDispose(stop);
|
|
211
|
+
return {
|
|
212
|
+
isSupported: isSupported,
|
|
213
|
+
stop: stop,
|
|
214
|
+
takeRecords: takeRecords
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function useResizeObserver(target, callback) {
|
|
218
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
219
|
+
var _options$window16 = options.window,
|
|
220
|
+
window = _options$window16 === void 0 ? defaultWindow : _options$window16,
|
|
221
|
+
observerOptions = _objectWithoutProperties(options, _excluded2);
|
|
222
|
+
var observer;
|
|
223
|
+
var isSupported = useSupported(function () {
|
|
224
|
+
return window && "ResizeObserver" in window;
|
|
225
|
+
});
|
|
226
|
+
var cleanup = function cleanup() {
|
|
227
|
+
if (observer) {
|
|
228
|
+
observer.disconnect();
|
|
229
|
+
observer = void 0;
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
var targets = computed(function () {
|
|
233
|
+
return Array.isArray(target) ? target.map(function (el) {
|
|
234
|
+
return unrefElement(el);
|
|
235
|
+
}) : [unrefElement(target)];
|
|
236
|
+
});
|
|
237
|
+
var stopWatch = watch(targets, function (els) {
|
|
238
|
+
cleanup();
|
|
239
|
+
if (isSupported.value && window) {
|
|
240
|
+
observer = new ResizeObserver(callback);
|
|
241
|
+
var _iterator3 = _createForOfIteratorHelper(els),
|
|
242
|
+
_step3;
|
|
243
|
+
try {
|
|
244
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
245
|
+
var _el = _step3.value;
|
|
246
|
+
_el && observer.observe(_el, observerOptions);
|
|
247
|
+
}
|
|
248
|
+
} catch (err) {
|
|
249
|
+
_iterator3.e(err);
|
|
250
|
+
} finally {
|
|
251
|
+
_iterator3.f();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
immediate: true,
|
|
256
|
+
flush: "post"
|
|
257
|
+
});
|
|
258
|
+
var stop = function stop() {
|
|
259
|
+
cleanup();
|
|
260
|
+
stopWatch();
|
|
261
|
+
};
|
|
262
|
+
tryOnScopeDispose(stop);
|
|
263
|
+
return {
|
|
264
|
+
isSupported: isSupported,
|
|
265
|
+
stop: stop
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function useElementBounding(target) {
|
|
269
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
270
|
+
var _options$reset = options.reset,
|
|
271
|
+
reset = _options$reset === void 0 ? true : _options$reset,
|
|
272
|
+
_options$windowResize = options.windowResize,
|
|
273
|
+
windowResize = _options$windowResize === void 0 ? true : _options$windowResize,
|
|
274
|
+
_options$windowScroll = options.windowScroll,
|
|
275
|
+
windowScroll = _options$windowScroll === void 0 ? true : _options$windowScroll,
|
|
276
|
+
_options$immediate3 = options.immediate,
|
|
277
|
+
immediate = _options$immediate3 === void 0 ? true : _options$immediate3;
|
|
278
|
+
var height = ref(0);
|
|
279
|
+
var bottom = ref(0);
|
|
280
|
+
var left = ref(0);
|
|
281
|
+
var right = ref(0);
|
|
282
|
+
var top = ref(0);
|
|
283
|
+
var width = ref(0);
|
|
284
|
+
var x = ref(0);
|
|
285
|
+
var y = ref(0);
|
|
286
|
+
function update() {
|
|
287
|
+
var el = unrefElement(target);
|
|
288
|
+
if (!el) {
|
|
289
|
+
if (reset) {
|
|
290
|
+
height.value = 0;
|
|
291
|
+
bottom.value = 0;
|
|
292
|
+
left.value = 0;
|
|
293
|
+
right.value = 0;
|
|
294
|
+
top.value = 0;
|
|
295
|
+
width.value = 0;
|
|
296
|
+
x.value = 0;
|
|
297
|
+
y.value = 0;
|
|
298
|
+
}
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
var rect = el.getBoundingClientRect();
|
|
302
|
+
height.value = rect.height;
|
|
303
|
+
bottom.value = rect.bottom;
|
|
304
|
+
left.value = rect.left;
|
|
305
|
+
right.value = rect.right;
|
|
306
|
+
top.value = rect.top;
|
|
307
|
+
width.value = rect.width;
|
|
308
|
+
x.value = rect.x;
|
|
309
|
+
y.value = rect.y;
|
|
310
|
+
}
|
|
311
|
+
useResizeObserver(target, update);
|
|
312
|
+
watch(function () {
|
|
313
|
+
return unrefElement(target);
|
|
314
|
+
}, function (ele) {
|
|
315
|
+
return !ele && update();
|
|
316
|
+
});
|
|
317
|
+
useMutationObserver(target, update, {
|
|
318
|
+
attributeFilter: ["style", "class"]
|
|
319
|
+
});
|
|
320
|
+
if (windowScroll) useEventListener("scroll", update, {
|
|
321
|
+
capture: true,
|
|
322
|
+
passive: true
|
|
323
|
+
});
|
|
324
|
+
if (windowResize) useEventListener("resize", update, {
|
|
325
|
+
passive: true
|
|
326
|
+
});
|
|
327
|
+
tryOnMounted(function () {
|
|
328
|
+
if (immediate) update();
|
|
329
|
+
});
|
|
330
|
+
return {
|
|
331
|
+
height: height,
|
|
332
|
+
bottom: bottom,
|
|
333
|
+
left: left,
|
|
334
|
+
right: right,
|
|
335
|
+
top: top,
|
|
336
|
+
width: width,
|
|
337
|
+
x: x,
|
|
338
|
+
y: y,
|
|
339
|
+
update: update
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
var eventHandlers = ["fullscreenchange", "webkitfullscreenchange", "webkitendfullscreen", "mozfullscreenchange", "MSFullscreenChange"];
|
|
343
|
+
function useFullscreen(target) {
|
|
344
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
345
|
+
var _options$document6 = options.document,
|
|
346
|
+
document = _options$document6 === void 0 ? defaultDocument : _options$document6,
|
|
347
|
+
_options$autoExit = options.autoExit,
|
|
348
|
+
autoExit = _options$autoExit === void 0 ? false : _options$autoExit;
|
|
349
|
+
var targetRef = computed(function () {
|
|
350
|
+
var _a;
|
|
351
|
+
return (_a = unrefElement(target)) != null ? _a : document == null ? void 0 : document.querySelector("html");
|
|
352
|
+
});
|
|
353
|
+
var isFullscreen = ref(false);
|
|
354
|
+
var requestMethod = computed(function () {
|
|
355
|
+
return ["requestFullscreen", "webkitRequestFullscreen", "webkitEnterFullscreen", "webkitEnterFullScreen", "webkitRequestFullScreen", "mozRequestFullScreen", "msRequestFullscreen"].find(function (m) {
|
|
356
|
+
return document && m in document || targetRef.value && m in targetRef.value;
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
var exitMethod = computed(function () {
|
|
360
|
+
return ["exitFullscreen", "webkitExitFullscreen", "webkitExitFullScreen", "webkitCancelFullScreen", "mozCancelFullScreen", "msExitFullscreen"].find(function (m) {
|
|
361
|
+
return document && m in document || targetRef.value && m in targetRef.value;
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
var fullscreenEnabled = computed(function () {
|
|
365
|
+
return ["fullScreen", "webkitIsFullScreen", "webkitDisplayingFullscreen", "mozFullScreen", "msFullscreenElement"].find(function (m) {
|
|
366
|
+
return document && m in document || targetRef.value && m in targetRef.value;
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
var fullscreenElementMethod = ["fullscreenElement", "webkitFullscreenElement", "mozFullScreenElement", "msFullscreenElement"].find(function (m) {
|
|
370
|
+
return document && m in document;
|
|
371
|
+
});
|
|
372
|
+
var isSupported = useSupported(function () {
|
|
373
|
+
return targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0;
|
|
374
|
+
});
|
|
375
|
+
var isCurrentElementFullScreen = function isCurrentElementFullScreen() {
|
|
376
|
+
if (fullscreenElementMethod) return (document == null ? void 0 : document[fullscreenElementMethod]) === targetRef.value;
|
|
377
|
+
return false;
|
|
378
|
+
};
|
|
379
|
+
var isElementFullScreen = function isElementFullScreen() {
|
|
380
|
+
if (fullscreenEnabled.value) {
|
|
381
|
+
if (document && document[fullscreenEnabled.value] != null) {
|
|
382
|
+
return document[fullscreenEnabled.value];
|
|
383
|
+
} else {
|
|
384
|
+
var target2 = targetRef.value;
|
|
385
|
+
if ((target2 == null ? void 0 : target2[fullscreenEnabled.value]) != null) {
|
|
386
|
+
return Boolean(target2[fullscreenEnabled.value]);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return false;
|
|
391
|
+
};
|
|
392
|
+
function exit() {
|
|
393
|
+
return _exit.apply(this, arguments);
|
|
394
|
+
}
|
|
395
|
+
function _exit() {
|
|
396
|
+
_exit = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
397
|
+
var target2;
|
|
398
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
399
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
400
|
+
case 0:
|
|
401
|
+
if (!(!isSupported.value || !isFullscreen.value)) {
|
|
402
|
+
_context25.next = 2;
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
return _context25.abrupt("return");
|
|
406
|
+
case 2:
|
|
407
|
+
if (!exitMethod.value) {
|
|
408
|
+
_context25.next = 12;
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
if (!((document == null ? void 0 : document[exitMethod.value]) != null)) {
|
|
412
|
+
_context25.next = 8;
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
_context25.next = 6;
|
|
416
|
+
return document[exitMethod.value]();
|
|
417
|
+
case 6:
|
|
418
|
+
_context25.next = 12;
|
|
419
|
+
break;
|
|
420
|
+
case 8:
|
|
421
|
+
target2 = targetRef.value;
|
|
422
|
+
if (!((target2 == null ? void 0 : target2[exitMethod.value]) != null)) {
|
|
423
|
+
_context25.next = 12;
|
|
424
|
+
break;
|
|
425
|
+
}
|
|
426
|
+
_context25.next = 12;
|
|
427
|
+
return target2[exitMethod.value]();
|
|
428
|
+
case 12:
|
|
429
|
+
isFullscreen.value = false;
|
|
430
|
+
case 13:
|
|
431
|
+
case "end":
|
|
432
|
+
return _context25.stop();
|
|
433
|
+
}
|
|
434
|
+
}, _callee25);
|
|
435
|
+
}));
|
|
436
|
+
return _exit.apply(this, arguments);
|
|
437
|
+
}
|
|
438
|
+
function enter() {
|
|
439
|
+
return _enter.apply(this, arguments);
|
|
440
|
+
}
|
|
441
|
+
function _enter() {
|
|
442
|
+
_enter = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
443
|
+
var target2;
|
|
444
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
445
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
446
|
+
case 0:
|
|
447
|
+
if (!(!isSupported.value || isFullscreen.value)) {
|
|
448
|
+
_context26.next = 2;
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
return _context26.abrupt("return");
|
|
452
|
+
case 2:
|
|
453
|
+
if (!isElementFullScreen()) {
|
|
454
|
+
_context26.next = 5;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
_context26.next = 5;
|
|
458
|
+
return exit();
|
|
459
|
+
case 5:
|
|
460
|
+
target2 = targetRef.value;
|
|
461
|
+
if (!(requestMethod.value && (target2 == null ? void 0 : target2[requestMethod.value]) != null)) {
|
|
462
|
+
_context26.next = 10;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
_context26.next = 9;
|
|
466
|
+
return target2[requestMethod.value]();
|
|
467
|
+
case 9:
|
|
468
|
+
isFullscreen.value = true;
|
|
469
|
+
case 10:
|
|
470
|
+
case "end":
|
|
471
|
+
return _context26.stop();
|
|
472
|
+
}
|
|
473
|
+
}, _callee26);
|
|
474
|
+
}));
|
|
475
|
+
return _enter.apply(this, arguments);
|
|
476
|
+
}
|
|
477
|
+
function toggle() {
|
|
478
|
+
return _toggle.apply(this, arguments);
|
|
479
|
+
}
|
|
480
|
+
function _toggle() {
|
|
481
|
+
_toggle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
482
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
483
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
484
|
+
case 0:
|
|
485
|
+
_context27.next = 2;
|
|
486
|
+
return isFullscreen.value ? exit() : enter();
|
|
487
|
+
case 2:
|
|
488
|
+
case "end":
|
|
489
|
+
return _context27.stop();
|
|
490
|
+
}
|
|
491
|
+
}, _callee27);
|
|
492
|
+
}));
|
|
493
|
+
return _toggle.apply(this, arguments);
|
|
494
|
+
}
|
|
495
|
+
var handlerCallback = function handlerCallback() {
|
|
496
|
+
var isElementFullScreenValue = isElementFullScreen();
|
|
497
|
+
if (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;
|
|
498
|
+
};
|
|
499
|
+
useEventListener(document, eventHandlers, handlerCallback, false);
|
|
500
|
+
useEventListener(function () {
|
|
501
|
+
return unrefElement(targetRef);
|
|
502
|
+
}, eventHandlers, handlerCallback, false);
|
|
503
|
+
if (autoExit) tryOnScopeDispose(exit);
|
|
504
|
+
return {
|
|
505
|
+
isSupported: isSupported,
|
|
506
|
+
isFullscreen: isFullscreen,
|
|
507
|
+
enter: enter,
|
|
508
|
+
exit: exit,
|
|
509
|
+
toggle: toggle
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export { defaultDocument, defaultWindow, isClient, isIOS, isObject, noop, notNullish, onClickOutside, toValue, tryOnMounted, tryOnScopeDispose, unrefElement, useElementBounding, useEventListener, useFullscreen, useMounted, useMutationObserver, useResizeObserver, useSupported };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
3
|
+
import '@babel/runtime/helpers/typeof';
|
|
4
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
5
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
6
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
7
|
+
import '@babel/runtime/regenerator';
|
|
8
|
+
import { getCurrentScope, onScopeDispose, onMounted, nextTick, unref, getCurrentInstance, onUnmounted } from 'vue';
|
|
9
|
+
|
|
10
|
+
function tryOnScopeDispose(fn) {
|
|
11
|
+
if (getCurrentScope()) {
|
|
12
|
+
onScopeDispose(fn);
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
function toValue(r) {
|
|
18
|
+
return typeof r === "function" ? r() : unref(r);
|
|
19
|
+
}
|
|
20
|
+
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
21
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
22
|
+
var notNullish = function notNullish(val) {
|
|
23
|
+
return val != null;
|
|
24
|
+
};
|
|
25
|
+
var toString = Object.prototype.toString;
|
|
26
|
+
var isObject = function isObject(val) {
|
|
27
|
+
return toString.call(val) === "[object Object]";
|
|
28
|
+
};
|
|
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
|
+
}
|
|
35
|
+
function getLifeCycleTarget(target) {
|
|
36
|
+
return getCurrentInstance();
|
|
37
|
+
}
|
|
38
|
+
function tryOnMounted(fn) {
|
|
39
|
+
var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
40
|
+
var target = arguments.length > 2 ? arguments[2] : undefined;
|
|
41
|
+
var instance = getLifeCycleTarget();
|
|
42
|
+
if (instance) onMounted(fn, target);else if (sync) fn();else nextTick(fn);
|
|
43
|
+
}
|
|
44
|
+
function tryOnUnmounted(fn, target) {
|
|
45
|
+
var instance = getLifeCycleTarget();
|
|
46
|
+
if (instance) onUnmounted(fn, target);
|
|
47
|
+
}
|
|
48
|
+
|
|
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.6.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.6.0",
|
|
31
31
|
"@dfsj/rollup": "workspace:^",
|
|
32
|
-
"@dfsj/utils": "^3.
|
|
32
|
+
"@dfsj/utils": "^3.6.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",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"vue": "^3.4.21"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@dfsj/echarts": "^3.
|
|
44
|
-
"@dfsj/utils": "^3.
|
|
43
|
+
"@dfsj/echarts": "^3.6.0",
|
|
44
|
+
"@dfsj/utils": "^3.6.0",
|
|
45
45
|
"element-plus": "^2.8.4",
|
|
46
46
|
"vue": "^3.4.21"
|
|
47
47
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"vue-types": "^5.0.2",
|
|
60
60
|
"zrender": "^5.5.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "546649711e5f511b6efc6e684f20b267d5ca290d",
|
|
63
63
|
"module": "dist/index.js",
|
|
64
64
|
"browser": "dist/index.js",
|
|
65
65
|
"types": "dist/index.d.ts",
|