@nutui/taro-biz 0.0.1-alpha.17 → 0.0.1-alpha.18
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/es/index/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
2
|
+
import { useMemo as M, useState as O, useCallback as B, useEffect as N } from "react";
|
|
3
|
+
import D from "classnames";
|
|
4
4
|
import h, { getEnv as P } from "@tarojs/taro";
|
|
5
|
-
import { View as
|
|
5
|
+
import { View as w } from "@tarojs/components";
|
|
6
6
|
import { JDIOSMaterialView as j } from "@jdtaro/ui";
|
|
7
7
|
import { C as V } from "./typings-CdeuPEKG.mjs";
|
|
8
8
|
const F = 26;
|
|
@@ -14,6 +14,7 @@ function T(e, r, o) {
|
|
|
14
14
|
liquidGlass: {
|
|
15
15
|
style: "regular",
|
|
16
16
|
interactive: !0,
|
|
17
|
+
darkMode: r,
|
|
17
18
|
...r ? {} : { tintColor: "rgba(255, 255, 255, 0.45)" }
|
|
18
19
|
}
|
|
19
20
|
} : { fallbackStyle: { backgroundColor: r ? "#2A2F36" : "#FFFFFF" } };
|
|
@@ -22,6 +23,7 @@ function T(e, r, o) {
|
|
|
22
23
|
liquidGlass: {
|
|
23
24
|
style: "regular",
|
|
24
25
|
interactive: !0,
|
|
26
|
+
darkMode: r,
|
|
25
27
|
...r ? {} : { tintColor: "rgba(255, 255, 255, 0.45)" }
|
|
26
28
|
}
|
|
27
29
|
} : {};
|
|
@@ -41,7 +43,7 @@ function T(e, r, o) {
|
|
|
41
43
|
return t ? {
|
|
42
44
|
liquidGlass: {
|
|
43
45
|
style: "regular",
|
|
44
|
-
|
|
46
|
+
darkMode: !0,
|
|
45
47
|
interactive: !0,
|
|
46
48
|
tintColor: "rgba(0, 0, 0, 0.75)"
|
|
47
49
|
}
|
|
@@ -195,13 +197,13 @@ function z(e) {
|
|
|
195
197
|
const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: g } = e, a = r ? J(r, o) : void 0, s = {};
|
|
196
198
|
a ? (s.blurScale = a.blurScale, s.borderRadius = a.borderRadius, s.colorMode = a.colorMode) : s.colorMode = o ? "dark" : "light", (u == null ? void 0 : u.borderRadius) !== void 0 && (s.borderRadius = parseFloat(String(u.borderRadius)));
|
|
197
199
|
const l = { ...u }, m = t ?? (a == null ? void 0 : a.overlayColor);
|
|
198
|
-
return m && l.backgroundColor === void 0 && (l.backgroundColor = m), a != null && a.backgroundGradient && l.background === void 0 && (l.background = a.backgroundGradient), a != null && a.boxShadow && l.boxShadow === void 0 && (l.boxShadow = a.boxShadow), /* @__PURE__ */ R(
|
|
200
|
+
return m && l.backgroundColor === void 0 && (l.backgroundColor = m), a != null && a.backgroundGradient && l.background === void 0 && (l.background = a.backgroundGradient), a != null && a.boxShadow && l.boxShadow === void 0 && (l.boxShadow = a.boxShadow), /* @__PURE__ */ R(w, { className: i, style: l, ...s, ...g, children: b });
|
|
199
201
|
}
|
|
200
202
|
function W(e) {
|
|
201
203
|
const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: g, rest: a } = e, s = r ? E(r, o) : void 0, l = { ...b };
|
|
202
204
|
s && s.blurRadius > 0 && (l.backdropFilter = `blur(${s.blurRadius}px)`), s && l.borderRadius === void 0 && (l.borderRadius = `${s.borderRadius}px`);
|
|
203
205
|
const m = i ?? (s == null ? void 0 : s.tintColor), d = {};
|
|
204
|
-
return t && (d.targetId = t), r && (d.scene = r), m && (d.overlayColor = m), /* @__PURE__ */ R(
|
|
206
|
+
return t && (d.targetId = t), r && (d.scene = r), m && (d.overlayColor = m), /* @__PURE__ */ R(w, { className: u, style: l, ...d, ...a, children: g });
|
|
205
207
|
}
|
|
206
208
|
const X = (e) => {
|
|
207
209
|
const {
|
|
@@ -215,14 +217,14 @@ const X = (e) => {
|
|
|
215
217
|
gradientBlur: a,
|
|
216
218
|
overlayColor: s,
|
|
217
219
|
...l
|
|
218
|
-
} = { ...Y, ...e }, d =
|
|
220
|
+
} = { ...Y, ...e }, d = D("nut-jdmaterialview", r), { isIOS: $, iosMajor: S } = M(() => Q(), []), [f, x] = O(() => U()), v = B(
|
|
219
221
|
(c) => {
|
|
220
222
|
const p = typeof c == "string" ? c : String((c == null ? void 0 : c.theme) || "");
|
|
221
223
|
x(p.toLowerCase() === "dark");
|
|
222
224
|
},
|
|
223
225
|
[]
|
|
224
226
|
);
|
|
225
|
-
|
|
227
|
+
N(() => {
|
|
226
228
|
var c, p;
|
|
227
229
|
try {
|
|
228
230
|
(p = (c = h).onThemeChange) == null || p.call(c, v);
|
|
@@ -236,7 +238,7 @@ const X = (e) => {
|
|
|
236
238
|
}
|
|
237
239
|
};
|
|
238
240
|
}, [v]);
|
|
239
|
-
const n =
|
|
241
|
+
const n = M(
|
|
240
242
|
() => i ? T(i, f, S) : void 0,
|
|
241
243
|
[i, f, S]
|
|
242
244
|
), q = b ?? (n == null ? void 0 : n.liquidGlass), L = g ?? (n == null ? void 0 : n.frostedGlass), A = a ?? (n == null ? void 0 : n.gradientBlur);
|