straw-ui-vue 0.1.59 → 0.1.60

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.
@@ -0,0 +1,111 @@
1
+ import { effectScope as e, getCurrentInstance as t, getCurrentScope as n, hasInjectionContext as r, inject as i, onScopeDispose as a, provide as o, shallowReadonly as s, shallowRef as c, toValue as l, watch as u } from "vue";
2
+ //#region node_modules/@vueuse/shared/dist/index.js
3
+ function d(e, t) {
4
+ return n() ? (a(e, t), !0) : !1;
5
+ }
6
+ function f(t) {
7
+ let n = !1, r, i = e(!0);
8
+ return ((...e) => (n ||= (r = i.run(() => t(...e)), !0), r));
9
+ }
10
+ var p = /* @__PURE__ */ new WeakMap(), m = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
11
+ let a = e[0], o = t()?.proxy ?? n();
12
+ if (o == null && !r()) throw Error("injectLocal must be called in setup");
13
+ return o && p.has(o) && a in p.get(o) ? p.get(o)[a] : i(...e);
14
+ };
15
+ function h(e, r) {
16
+ let i = t()?.proxy ?? n();
17
+ if (i == null) throw Error("provideLocal must be called in setup");
18
+ p.has(i) || p.set(i, Object.create(null));
19
+ let a = p.get(i);
20
+ return a[e] = r, o(e, r);
21
+ }
22
+ /* @__NO_SIDE_EFFECTS__ */
23
+ function g(e, t) {
24
+ let n = t?.injectionKey || Symbol(e.name || "InjectionState"), r = t?.defaultValue;
25
+ return [(...t) => {
26
+ let r = e(...t);
27
+ return h(n, r), r;
28
+ }, () => /* @__PURE__ */ m(n, r)];
29
+ }
30
+ var _ = typeof window < "u" && typeof document < "u";
31
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
32
+ var v = (e) => e != null, y = Object.prototype.toString, b = (e) => y.call(e) === "[object Object]", x = (e, t, n) => Math.min(n, Math.max(t, e)), S = () => {};
33
+ function C(e, t) {
34
+ function n(...n) {
35
+ return new Promise((r, i) => {
36
+ Promise.resolve(e(() => t.apply(this, n), {
37
+ fn: t,
38
+ thisArg: this,
39
+ args: n
40
+ })).then(r).catch(i);
41
+ });
42
+ }
43
+ return "cancel" in e && Object.assign(n, {
44
+ cancel: e.cancel,
45
+ flush: e.flush,
46
+ isPending: e.isPending
47
+ }), n;
48
+ }
49
+ function w(e, t = {}) {
50
+ let n, r, i = S, a = S, o = c(!1), u = (e) => {
51
+ clearTimeout(e), i(), i = S;
52
+ }, d;
53
+ return Object.assign((s) => {
54
+ let c = l(e), f = l(t.maxWait);
55
+ return n && u(n), c <= 0 || f !== void 0 && f <= 0 ? (r &&= (u(r), void 0), o.value = !1, Promise.resolve(s())) : (o.value = !0, new Promise((e, l) => {
56
+ i = t.rejectOnCancel ? l : e, a = e, d = s, f && !r && (r = setTimeout(() => {
57
+ n && u(n), r = void 0, o.value = !1, e(d());
58
+ }, f)), n = setTimeout(() => {
59
+ r && u(r), r = void 0, o.value = !1, e(s());
60
+ }, c);
61
+ }));
62
+ }, {
63
+ cancel: () => {
64
+ n &&= (u(n), void 0), r &&= (u(r), void 0), o.value = !1, a = S;
65
+ },
66
+ flush: () => {
67
+ if (o.value) {
68
+ n &&= (clearTimeout(n), void 0), r &&= (clearTimeout(r), void 0), o.value = !1;
69
+ let e = a;
70
+ i = S, a = S, e(d());
71
+ }
72
+ },
73
+ isPending: s(o)
74
+ });
75
+ }
76
+ function T(e) {
77
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
78
+ }
79
+ function E(e) {
80
+ return Array.isArray(e) ? e : [e];
81
+ }
82
+ function D(e, t = 200, n = {}) {
83
+ return C(w(t, n), e);
84
+ }
85
+ function O(e, t, n = {}) {
86
+ let { immediate: r = !0, immediateCallback: i = !1 } = n, a = c(!1), o;
87
+ function u() {
88
+ o &&= (clearTimeout(o), void 0);
89
+ }
90
+ function f() {
91
+ a.value = !1, u();
92
+ }
93
+ function p(...n) {
94
+ i && e(), u(), a.value = !0, o = setTimeout(() => {
95
+ a.value = !1, o = void 0, e(...n);
96
+ }, l(t));
97
+ }
98
+ return r && (a.value = !0, _ && p()), d(f), {
99
+ isPending: s(a),
100
+ start: p,
101
+ stop: f
102
+ };
103
+ }
104
+ function k(e, t, n) {
105
+ return u(e, t, {
106
+ ...n,
107
+ immediate: !0
108
+ });
109
+ }
110
+ //#endregion
111
+ export { _ as a, T as c, D as d, O as f, m as i, E as l, f as n, b as o, k as p, g as r, v as s, x as t, d as u };