@nutui/taro-biz 0.0.1-alpha.19 → 0.0.1-alpha.21
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 +2 -2
- package/dist/es/jdmaterialsblurtarget/index.js +1 -1
- package/dist/es/{jdmaterialsblurtarget.taro-DCTEjmIC.mjs → jdmaterialsblurtarget.taro-CuU6ZagQ.mjs} +1 -1
- package/dist/es/jdmaterialview/index.js +2 -2
- package/dist/es/{jdmaterialview.taro-BOujNGjv.mjs → jdmaterialview.taro-CGPzrol_.mjs} +32 -31
- package/package.json +1 -1
package/dist/es/index/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as e } from "../jdmaterialview.taro-
|
|
2
|
-
import { J as o } from "../jdmaterialsblurtarget.taro-
|
|
1
|
+
import { J as e } from "../jdmaterialview.taro-CGPzrol_.mjs";
|
|
2
|
+
import { J as o } from "../jdmaterialsblurtarget.taro-CuU6ZagQ.mjs";
|
|
3
3
|
export {
|
|
4
4
|
e as JDMaterialView,
|
|
5
5
|
o as JDMaterialsBlurTarget
|
package/dist/es/{jdmaterialsblurtarget.taro-DCTEjmIC.mjs → jdmaterialsblurtarget.taro-CuU6ZagQ.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, Fragment as i } from "react/jsx-runtime";
|
|
2
2
|
import m from "classnames";
|
|
3
3
|
import c from "@tarojs/taro";
|
|
4
|
-
import { View as f } from "@
|
|
4
|
+
import { View as f } from "@jdtaro/ui";
|
|
5
5
|
import { C as u } from "./typings-CdeuPEKG.mjs";
|
|
6
6
|
const p = {
|
|
7
7
|
...u
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as r } from "../jdmaterialview.taro-
|
|
2
|
-
import { g as s, a as o, b as g } from "../jdmaterialview.taro-
|
|
1
|
+
import { J as r } from "../jdmaterialview.taro-CGPzrol_.mjs";
|
|
2
|
+
import { g as s, a as o, b as g } from "../jdmaterialview.taro-CGPzrol_.mjs";
|
|
3
3
|
export {
|
|
4
4
|
r as default,
|
|
5
5
|
s as getCornerRadius,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as k } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as $, useState as N, useCallback as P, useEffect as j } from "react";
|
|
3
3
|
import V from "classnames";
|
|
4
4
|
import h, { getEnv as T } from "@tarojs/taro";
|
|
5
|
-
import { View as
|
|
6
|
-
import { JDIOSMaterialView as _ } from "@jdtaro/ui";
|
|
5
|
+
import { JDIOSMaterialView as _, View as x } from "@jdtaro/ui";
|
|
7
6
|
import { C as E } from "./typings-CdeuPEKG.mjs";
|
|
8
|
-
const
|
|
7
|
+
const F = 26;
|
|
9
8
|
function H(e, r, o) {
|
|
10
|
-
const t = o >=
|
|
9
|
+
const t = o >= F;
|
|
11
10
|
switch (e) {
|
|
12
11
|
case "top-solid":
|
|
13
12
|
return t ? {
|
|
@@ -62,7 +61,7 @@ function H(e, r, o) {
|
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
function J(e, r) {
|
|
65
|
-
const o = r >=
|
|
64
|
+
const o = r >= F;
|
|
66
65
|
switch (e) {
|
|
67
66
|
case "top-bar":
|
|
68
67
|
case "bottom-bar":
|
|
@@ -78,7 +77,7 @@ function J(e, r) {
|
|
|
78
77
|
return 0;
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
function
|
|
80
|
+
function I(e) {
|
|
82
81
|
switch (e) {
|
|
83
82
|
case "top-bar":
|
|
84
83
|
case "bottom-bar":
|
|
@@ -93,9 +92,9 @@ function x(e) {
|
|
|
93
92
|
return 0;
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
|
-
const p = "255, 255, 255",
|
|
95
|
+
const p = "255, 255, 255", R = "31, 34, 38";
|
|
97
96
|
function Y(e, r) {
|
|
98
|
-
const o =
|
|
97
|
+
const o = I(e);
|
|
99
98
|
switch (e) {
|
|
100
99
|
case "top-solid":
|
|
101
100
|
return {
|
|
@@ -109,19 +108,19 @@ function Y(e, r) {
|
|
|
109
108
|
return {
|
|
110
109
|
blurRadius: 40,
|
|
111
110
|
borderRadius: o,
|
|
112
|
-
tintColor: r ? `rgba(${
|
|
111
|
+
tintColor: r ? `rgba(${R}, 0.9)` : `rgba(${p}, 0.9)`
|
|
113
112
|
};
|
|
114
113
|
case "promotion-fair":
|
|
115
114
|
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.85)` };
|
|
116
115
|
case "promotion-deep":
|
|
117
116
|
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${p}, 0.2)` };
|
|
118
117
|
case "immersive":
|
|
119
|
-
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${
|
|
118
|
+
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${R}, 0.4)` };
|
|
120
119
|
case "bottom-bar":
|
|
121
120
|
return {
|
|
122
121
|
blurRadius: 50,
|
|
123
122
|
borderRadius: o,
|
|
124
|
-
tintColor: r ? `rgba(${
|
|
123
|
+
tintColor: r ? `rgba(${R}, 0.8)` : `rgba(${p}, 0.8)`
|
|
125
124
|
};
|
|
126
125
|
default:
|
|
127
126
|
return { blurRadius: 40, borderRadius: o };
|
|
@@ -132,7 +131,7 @@ function K(e) {
|
|
|
132
131
|
return `linear-gradient(to bottom, rgba(${r}, 0.8) 0%, rgba(${r}, 0.8) 56%, rgba(${r}, 0.78) 66%, rgba(${r}, 0.72) 76%, rgba(${r}, 0.62) 86%, rgba(${r}, 0.49) 94%, rgba(${r}, 0.3) 100%)`;
|
|
133
132
|
}
|
|
134
133
|
function Q(e, r) {
|
|
135
|
-
const o = r ? "dark" : "light", t =
|
|
134
|
+
const o = r ? "dark" : "light", t = I(e);
|
|
136
135
|
switch (e) {
|
|
137
136
|
case "top-solid":
|
|
138
137
|
return {
|
|
@@ -194,16 +193,18 @@ function X() {
|
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
195
|
function Z(e) {
|
|
197
|
-
const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: m } = e, a = r ? Q(r, o) : void 0,
|
|
198
|
-
a ? (
|
|
199
|
-
const
|
|
200
|
-
|
|
196
|
+
const { scene: r, dark: o, overlayColor: t, cls: i, style: u, children: b, rest: m } = e, a = r ? Q(r, o) : void 0, l = {};
|
|
197
|
+
a ? (l.blurScale = a.blurScale, l.colorMode = a.colorMode) : l.colorMode = o ? "dark" : "light";
|
|
198
|
+
const s = { ...u };
|
|
199
|
+
(u == null ? void 0 : u.borderRadius) === void 0 && a && (s.borderRadius = `${a.borderRadius}px`);
|
|
200
|
+
const d = t ?? (a == null ? void 0 : a.overlayColor);
|
|
201
|
+
return d && s.backgroundColor === void 0 && (s.backgroundColor = d), a != null && a.backgroundGradient && s.background === void 0 && (s.background = a.backgroundGradient), a != null && a.boxShadow && s.boxShadow === void 0 && (s.boxShadow = a.boxShadow), /* @__PURE__ */ k(x, { className: i, style: s, ...l, ...m, children: b });
|
|
201
202
|
}
|
|
202
203
|
function rr(e) {
|
|
203
|
-
const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: m, rest: a } = e,
|
|
204
|
-
|
|
205
|
-
const d = i ?? (
|
|
206
|
-
return t && (g.targetId = t), r && (g.scene = r), d && (g.overlayColor = d), /* @__PURE__ */ k(
|
|
204
|
+
const { scene: r, dark: o, targetId: t, overlayColor: i, cls: u, style: b, children: m, rest: a } = e, l = r ? Y(r, o) : void 0, s = { ...b };
|
|
205
|
+
l && l.blurRadius > 0 && (s.backdropFilter = `blur(${l.blurRadius}px)`), l && s.borderRadius === void 0 && (s.borderRadius = `${l.borderRadius}px`);
|
|
206
|
+
const d = i ?? (l == null ? void 0 : l.tintColor), g = {};
|
|
207
|
+
return t && (g.targetId = t), r && (g.scene = r), d && (g.overlayColor = d), /* @__PURE__ */ k(x, { className: u, style: s, ...g, ...a, children: m });
|
|
207
208
|
}
|
|
208
209
|
const or = (e) => {
|
|
209
210
|
const {
|
|
@@ -215,10 +216,10 @@ const or = (e) => {
|
|
|
215
216
|
theme: b = "auto",
|
|
216
217
|
liquidGlass: m,
|
|
217
218
|
frostedGlass: a,
|
|
218
|
-
gradientBlur:
|
|
219
|
-
overlayColor:
|
|
219
|
+
gradientBlur: l,
|
|
220
|
+
overlayColor: s,
|
|
220
221
|
...d
|
|
221
|
-
} = { ...U, ...e }, S = V("nut-jdmaterialview", r), { isIOS: q, iosMajor: v } =
|
|
222
|
+
} = { ...U, ...e }, S = V("nut-jdmaterialview", r), { isIOS: q, iosMajor: v } = $(() => W(), []), C = b === "auto", [L, A] = N(() => X()), G = P(
|
|
222
223
|
(c) => {
|
|
223
224
|
const y = typeof c == "string" ? c : String((c == null ? void 0 : c.theme) || "");
|
|
224
225
|
A(y.toLowerCase() === "dark");
|
|
@@ -229,22 +230,22 @@ const or = (e) => {
|
|
|
229
230
|
var c, y;
|
|
230
231
|
if (C) {
|
|
231
232
|
try {
|
|
232
|
-
(y = (c = h).onThemeChange) == null || y.call(c,
|
|
233
|
+
(y = (c = h).onThemeChange) == null || y.call(c, G);
|
|
233
234
|
} catch {
|
|
234
235
|
}
|
|
235
236
|
return () => {
|
|
236
237
|
var w, M;
|
|
237
238
|
try {
|
|
238
|
-
(M = (w = h).offThemeChange) == null || M.call(w,
|
|
239
|
+
(M = (w = h).offThemeChange) == null || M.call(w, G);
|
|
239
240
|
} catch {
|
|
240
241
|
}
|
|
241
242
|
};
|
|
242
243
|
}
|
|
243
|
-
}, [C,
|
|
244
|
-
const f = C ? L : b === "dark", n =
|
|
244
|
+
}, [C, G]);
|
|
245
|
+
const f = C ? L : b === "dark", n = $(
|
|
245
246
|
() => i ? H(i, f, v) : void 0,
|
|
246
247
|
[i, f, v]
|
|
247
|
-
), O = m ?? (n == null ? void 0 : n.liquidGlass), B = a ?? (n == null ? void 0 : n.frostedGlass), D =
|
|
248
|
+
), O = m ?? (n == null ? void 0 : n.liquidGlass), B = a ?? (n == null ? void 0 : n.frostedGlass), D = l ?? (n == null ? void 0 : n.gradientBlur);
|
|
248
249
|
if (q) {
|
|
249
250
|
const c = { ...n == null ? void 0 : n.fallbackStyle, ...o };
|
|
250
251
|
return i && c.borderRadius === void 0 && (c.borderRadius = `${J(i, v)}px`), /* @__PURE__ */ k(
|
|
@@ -260,11 +261,11 @@ const or = (e) => {
|
|
|
260
261
|
}
|
|
261
262
|
);
|
|
262
263
|
}
|
|
263
|
-
return z() ? Z({ scene: i, dark: f, overlayColor:
|
|
264
|
+
return z() ? Z({ scene: i, dark: f, overlayColor: s, cls: S, style: o, children: t, rest: d }) : rr({
|
|
264
265
|
scene: i,
|
|
265
266
|
dark: f,
|
|
266
267
|
targetId: u,
|
|
267
|
-
overlayColor:
|
|
268
|
+
overlayColor: s,
|
|
268
269
|
cls: S,
|
|
269
270
|
style: o,
|
|
270
271
|
children: t,
|