@dfsj/components 3.6.0 → 3.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Boards/index.d.ts +2 -2
- package/dist/components/Boards/src/Boards.vue.d.ts +77 -6
- package/dist/components/Boards/src/Boards.vue2.js +34 -99
- package/dist/components/Boards/src/hooKs/useStyle.d.ts +9 -0
- package/dist/components/Boards/src/hooKs/useStyle.js +100 -0
- package/dist/components/Boards/src/props.d.ts +38 -4
- package/dist/components/Boards/src/props.js +20 -1
- package/dist/components/Editor/src/Editor.vue2.js +1 -2
- package/dist/components/Form/src/Form.vue2.js +2 -3
- package/dist/components/Form/src/helper/index.js +1 -1
- package/dist/components/Form/src/useForm.js +2 -2
- package/dist/components/Highlight/src/Highlight.vue2.js +1 -1
- package/dist/components/Icon/src/Icon.vue2.js +1 -2
- package/dist/components/InputPassword/src/InputPassword.vue2.js +1 -1
- package/dist/components/Modal/src/BasicModal.vue.d.ts +49 -7
- package/dist/components/Modal/src/BasicModal.vue2.js +8 -6
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +42 -5
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +16 -5
- package/dist/components/Modal/src/config.d.ts +5 -1
- package/dist/components/Modal/src/config.js +5 -1
- package/dist/components/Modal/src/props.d.ts +19 -2
- package/dist/components/Modal/src/props.js +17 -5
- package/dist/components/Stateful/src/Stateful.vue2.js +1 -1
- package/dist/components/Stateful/src/props.js +1 -1
- package/dist/components/Table/src/Table.vue2.js +2 -3
- package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +1 -1
- package/dist/components/UnifyChart/src/props.js +1 -1
- package/dist/components/Video/src/VideoPlayer.vue2.js +1 -1
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +1 -1
- package/dist/components/Windows/index.d.ts +3 -2
- package/dist/components/Windows/src/ModalWrap.vue.d.ts +3 -3
- package/dist/components/Windows/src/ModalWrap.vue2.js +0 -1
- package/dist/components/Windows/src/Windows.vue.d.ts +3 -2
- package/dist/components/Windows/src/Windows.vue2.js +8 -3
- package/dist/components/Windows/src/Windows.vue3.js +4 -1
- package/dist/components/Windows/src/props.d.ts +2 -2
- package/dist/directives/clickOutside.js +71 -0
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/repeatClick.js +29 -0
- package/dist/directives/resizable.d.ts +7 -0
- package/dist/directives/resizable.js +196 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/index.min.css +3 -3
- package/dist/node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.6.2_/node_modules/@vueuse/core/index.js +4 -182
- package/dist/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.12_typescript@5.6.2_/node_modules/@vueuse/shared/index.js +2 -11
- package/package.json +4 -4
- package/dist/node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.11_typescript@5.6.2_/node_modules/@vueuse/core/index.js +0 -513
- package/dist/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.11_typescript@5.6.2_/node_modules/@vueuse/shared/index.js +0 -49
- package/dist/utils/is.d.ts +0 -25
- package/dist/utils/is.js +0 -36
- package/dist/utils/propTypes.js +0 -34
- package/dist/utils/tsxHelper.d.ts +0 -5
- package/dist/utils/tsxHelper.js +0 -18
|
@@ -1,513 +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 { noop, isIOS, tryOnMounted, tryOnScopeDispose, toValue, isObject, notNullish, isClient } from '../../../../@vueuse_shared@10.11.1_vue@3.5.11_typescript@5.6.2_/node_modules/@vueuse/shared/index.js';
|
|
9
|
-
export { getLifeCycleTarget, tryOnUnmounted } from '../../../../@vueuse_shared@10.11.1_vue@3.5.11_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 };
|
|
@@ -1,49 +0,0 @@
|
|
|
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/dist/utils/is.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const is: (val: unknown, type: string) => boolean;
|
|
2
|
-
export declare const isDef: <T = unknown>(val?: T) => val is T;
|
|
3
|
-
export declare const isUnDef: <T = unknown>(val?: T) => val is T;
|
|
4
|
-
export declare const isObject: (val: any) => val is Record<any, any>;
|
|
5
|
-
export declare const isEmpty: <T = unknown>(val: T) => val is T;
|
|
6
|
-
export declare const isDate: (val: unknown) => val is Date;
|
|
7
|
-
export declare const isNull: (val: unknown) => val is null;
|
|
8
|
-
export declare const isNullAndUnDef: (val: unknown) => val is null | undefined;
|
|
9
|
-
export declare const isNullOrUnDef: (val: unknown) => val is null | undefined;
|
|
10
|
-
export declare const isNumber: (val: unknown) => val is number;
|
|
11
|
-
export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
|
12
|
-
export declare const isString: (val: unknown) => val is string;
|
|
13
|
-
export declare const isFunction: (val: unknown) => val is Function;
|
|
14
|
-
export declare const isBoolean: (val: unknown) => val is boolean;
|
|
15
|
-
export declare const isRegExp: (val: unknown) => val is RegExp;
|
|
16
|
-
export declare const isArray: (val: any) => val is Array<any>;
|
|
17
|
-
export declare const isWindow: (val: any) => val is Window;
|
|
18
|
-
export declare const isElement: (val: unknown) => val is Element;
|
|
19
|
-
export declare const isMap: (val: unknown) => val is Map<any, any>;
|
|
20
|
-
export declare const isServer: boolean;
|
|
21
|
-
export declare const isClient: boolean;
|
|
22
|
-
export declare const isUrl: (path: string) => boolean;
|
|
23
|
-
export declare const isDark: () => boolean;
|
|
24
|
-
export declare const isImgPath: (path: string) => boolean;
|
|
25
|
-
export declare const isEmptyVal: (val: any) => boolean;
|
package/dist/utils/is.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var toString = Object.prototype.toString;
|
|
2
|
-
var is = function is(val, type) {
|
|
3
|
-
return toString.call(val) === "[object ".concat(type, "]");
|
|
4
|
-
};
|
|
5
|
-
var isObject = function isObject(val) {
|
|
6
|
-
return val !== null && is(val, 'Object');
|
|
7
|
-
};
|
|
8
|
-
var isEmpty = function isEmpty(val) {
|
|
9
|
-
if (isArray(val) || isString(val)) {
|
|
10
|
-
return val.length === 0;
|
|
11
|
-
}
|
|
12
|
-
if (val instanceof Map || val instanceof Set) {
|
|
13
|
-
return val.size === 0;
|
|
14
|
-
}
|
|
15
|
-
if (isObject(val)) {
|
|
16
|
-
return Object.keys(val).length === 0;
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
};
|
|
20
|
-
var isNumber = function isNumber(val) {
|
|
21
|
-
return is(val, 'Number');
|
|
22
|
-
};
|
|
23
|
-
var isString = function isString(val) {
|
|
24
|
-
return is(val, 'String');
|
|
25
|
-
};
|
|
26
|
-
var isFunction = function isFunction(val) {
|
|
27
|
-
return typeof val === 'function';
|
|
28
|
-
};
|
|
29
|
-
var isArray = function isArray(val) {
|
|
30
|
-
return val && Array.isArray(val);
|
|
31
|
-
};
|
|
32
|
-
var isEmptyVal = function isEmptyVal(val) {
|
|
33
|
-
return val === '' || val === null || val === undefined;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export { is, isArray, isEmpty, isEmptyVal, isFunction, isNumber, isObject, isString };
|
package/dist/utils/propTypes.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
-
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
4
|
-
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
5
|
-
import _inherits from '@babel/runtime/helpers/inherits';
|
|
6
|
-
import { createTypes, toValidableType } from 'vue-types';
|
|
7
|
-
|
|
8
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
-
var newPropTypes = createTypes({
|
|
11
|
-
func: undefined,
|
|
12
|
-
bool: undefined,
|
|
13
|
-
string: undefined,
|
|
14
|
-
number: undefined,
|
|
15
|
-
object: undefined,
|
|
16
|
-
integer: undefined
|
|
17
|
-
});
|
|
18
|
-
var propTypes = /*#__PURE__*/function (_newPropTypes) {
|
|
19
|
-
function propTypes() {
|
|
20
|
-
_classCallCheck(this, propTypes);
|
|
21
|
-
return _callSuper(this, propTypes, arguments);
|
|
22
|
-
}
|
|
23
|
-
_inherits(propTypes, _newPropTypes);
|
|
24
|
-
return _createClass(propTypes, null, [{
|
|
25
|
-
key: "style",
|
|
26
|
-
get: function get() {
|
|
27
|
-
return toValidableType('style', {
|
|
28
|
-
type: [String, Object]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}]);
|
|
32
|
-
}(newPropTypes);
|
|
33
|
-
|
|
34
|
-
export { propTypes as default };
|
package/dist/utils/tsxHelper.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { isFunction } from './is.js';
|
|
2
|
-
|
|
3
|
-
var getSlot = function getSlot(slots) {
|
|
4
|
-
var slot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
5
|
-
var data = arguments.length > 2 ? arguments[2] : undefined;
|
|
6
|
-
if (!slots || !Reflect.has(slots, slot)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
if (!isFunction(slots[slot])) {
|
|
10
|
-
console.error("".concat(slot, " is not a function!"));
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
var slotFn = slots[slot];
|
|
14
|
-
if (!slotFn) return null;
|
|
15
|
-
return slotFn(data);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { getSlot };
|