@nutui/taro-biz 0.0.1-alpha.26 → 0.0.1-alpha.28
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-MYbvbmZA.mjs → jdmaterialsblurtarget.taro-CUiGBz7C.mjs} +13 -12
- package/dist/es/jdmaterialview/index.js +2 -2
- package/dist/es/{jdmaterialview.taro-KasOg_jj.mjs → jdmaterialview.taro-ipbj5Ixj.mjs} +62 -61
- package/package.json +2 -2
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-ipbj5Ixj.mjs";
|
|
2
|
+
import { J as o } from "../jdmaterialsblurtarget.taro-CUiGBz7C.mjs";
|
|
3
3
|
export {
|
|
4
4
|
e as JDMaterialView,
|
|
5
5
|
o as JDMaterialsBlurTarget
|
package/dist/es/{jdmaterialsblurtarget.taro-MYbvbmZA.mjs → jdmaterialsblurtarget.taro-CUiGBz7C.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, Fragment as i } from "react/jsx-runtime";
|
|
2
2
|
import m from "classnames";
|
|
3
3
|
import c from "@tarojs/taro";
|
|
4
4
|
import { View as f } from "@jdtaro/ui";
|
|
5
|
-
import { C as
|
|
6
|
-
const
|
|
7
|
-
...
|
|
5
|
+
import { C as p } from "./typings-CdeuPEKG.mjs";
|
|
6
|
+
const u = {
|
|
7
|
+
...p
|
|
8
8
|
};
|
|
9
9
|
function d() {
|
|
10
10
|
var r;
|
|
@@ -16,21 +16,22 @@ function d() {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
const g = (r) => {
|
|
19
|
-
const { className: t, style:
|
|
20
|
-
...
|
|
19
|
+
const { className: t, style: o, children: s, blurId: e, id: y, ...l } = {
|
|
20
|
+
...u,
|
|
21
21
|
...r
|
|
22
22
|
};
|
|
23
23
|
if (!d())
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ a(i, { children: s });
|
|
25
|
+
const n = m("nut-jdmaterialsblurtarget", t);
|
|
26
|
+
return /* @__PURE__ */ a(
|
|
27
27
|
f,
|
|
28
28
|
{
|
|
29
|
-
className:
|
|
30
|
-
style:
|
|
29
|
+
className: n,
|
|
30
|
+
style: o,
|
|
31
31
|
id: e,
|
|
32
32
|
blurId: e,
|
|
33
|
-
|
|
33
|
+
collapsable: !1,
|
|
34
|
+
...l,
|
|
34
35
|
children: s
|
|
35
36
|
}
|
|
36
37
|
);
|
|
@@ -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-ipbj5Ixj.mjs";
|
|
2
|
+
import { g as s, a as o, b as g } from "../jdmaterialview.taro-ipbj5Ixj.mjs";
|
|
3
3
|
export {
|
|
4
4
|
r as default,
|
|
5
5
|
s as getCornerRadius,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as B } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as j, useState as J, useCallback as V, useEffect as E } from "react";
|
|
3
3
|
import Z from "classnames";
|
|
4
4
|
import p, { getEnv as rr } from "@tarojs/taro";
|
|
5
|
-
import { JDIOSMaterialView as or, View as
|
|
5
|
+
import { JDIOSMaterialView as or, View as K } from "@jdtaro/ui";
|
|
6
6
|
import { C as tr } from "./typings-CdeuPEKG.mjs";
|
|
7
|
-
const
|
|
7
|
+
const Y = 26, F = "0 4px 2px 0 rgba(0, 0, 0, 0.05)", W = "0 4px 8px 0 rgba(0, 0, 0, 0.05)", er = "0 -8px 4px 0 rgba(0, 0, 0, 0.12)", ar = "0 -8px 4px 0 rgba(31, 34, 38, 0.5)";
|
|
8
8
|
function sr(t, r, o) {
|
|
9
|
-
const e = o >=
|
|
9
|
+
const e = o >= Y;
|
|
10
10
|
switch (t) {
|
|
11
11
|
case "top-solid":
|
|
12
12
|
return e ? {
|
|
@@ -40,13 +40,13 @@ function sr(t, r, o) {
|
|
|
40
40
|
liquidGlass: { style: "clear", interactive: !1 },
|
|
41
41
|
frostedGlass: { style: "thick-light", alpha: 1 },
|
|
42
42
|
// 阴影仅玻璃态显示(对齐 ObjC shadowAlpha=0.05 / fallbackShadowAlpha=0)
|
|
43
|
-
...e ? { boxShadow:
|
|
43
|
+
...e ? { boxShadow: W } : {}
|
|
44
44
|
};
|
|
45
45
|
case "promotion-deep":
|
|
46
46
|
return {
|
|
47
47
|
liquidGlass: { style: "clear", interactive: !1 },
|
|
48
48
|
frostedGlass: { style: "ultra-thin-light", alpha: 1 },
|
|
49
|
-
...e ? { boxShadow:
|
|
49
|
+
...e ? { boxShadow: W } : {}
|
|
50
50
|
};
|
|
51
51
|
case "immersive":
|
|
52
52
|
return e ? {
|
|
@@ -74,7 +74,7 @@ function sr(t, r, o) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
function nr(t, r) {
|
|
77
|
-
const o = r >=
|
|
77
|
+
const o = r >= Y;
|
|
78
78
|
switch (t) {
|
|
79
79
|
case "top-bar":
|
|
80
80
|
case "bottom-bar":
|
|
@@ -90,7 +90,7 @@ function nr(t, r) {
|
|
|
90
90
|
return 0;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Q(t) {
|
|
94
94
|
switch (t) {
|
|
95
95
|
case "top-bar":
|
|
96
96
|
case "bottom-bar":
|
|
@@ -105,9 +105,9 @@ function W(t) {
|
|
|
105
105
|
return 0;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const T = "255, 255, 255", D = "31, 34, 38";
|
|
109
109
|
function ir(t, r) {
|
|
110
|
-
const o =
|
|
110
|
+
const o = Q(t);
|
|
111
111
|
switch (t) {
|
|
112
112
|
case "top-solid":
|
|
113
113
|
return {
|
|
@@ -121,19 +121,19 @@ function ir(t, r) {
|
|
|
121
121
|
return {
|
|
122
122
|
blurRadius: 40,
|
|
123
123
|
borderRadius: o,
|
|
124
|
-
tintColor: r ? `rgba(${D}, 0.9)` : `rgba(${
|
|
124
|
+
tintColor: r ? `rgba(${D}, 0.9)` : `rgba(${T}, 0.9)`
|
|
125
125
|
};
|
|
126
126
|
case "promotion-fair":
|
|
127
|
-
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${
|
|
127
|
+
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${T}, 0.85)` };
|
|
128
128
|
case "promotion-deep":
|
|
129
|
-
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${
|
|
129
|
+
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${T}, 0.2)` };
|
|
130
130
|
case "immersive":
|
|
131
131
|
return { blurRadius: 40, borderRadius: o, tintColor: `rgba(${D}, 0.4)` };
|
|
132
132
|
case "bottom-bar":
|
|
133
133
|
return {
|
|
134
134
|
blurRadius: 50,
|
|
135
135
|
borderRadius: o,
|
|
136
|
-
tintColor: r ? `rgba(${D}, 0.8)` : `rgba(${
|
|
136
|
+
tintColor: r ? `rgba(${D}, 0.8)` : `rgba(${T}, 0.8)`
|
|
137
137
|
};
|
|
138
138
|
default:
|
|
139
139
|
return { blurRadius: 40, borderRadius: o };
|
|
@@ -144,7 +144,7 @@ function lr(t) {
|
|
|
144
144
|
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%)`;
|
|
145
145
|
}
|
|
146
146
|
function cr(t, r) {
|
|
147
|
-
const o = r ? "dark" : "light", e =
|
|
147
|
+
const o = r ? "dark" : "light", e = Q(t);
|
|
148
148
|
switch (t) {
|
|
149
149
|
case "top-solid":
|
|
150
150
|
return {
|
|
@@ -183,8 +183,8 @@ function cr(t, r) {
|
|
|
183
183
|
function ur(t, r) {
|
|
184
184
|
const o = /^#?([0-9a-fA-F]{6})$/.exec(t.trim());
|
|
185
185
|
if (!o) return t;
|
|
186
|
-
const e = parseInt(o[1], 16), a = e >> 16 & 255, i = e >> 8 & 255,
|
|
187
|
-
return `rgba(${a}, ${i}, ${
|
|
186
|
+
const e = parseInt(o[1], 16), a = e >> 16 & 255, i = e >> 8 & 255, b = e & 255, f = Math.max(0, Math.min(1, r));
|
|
187
|
+
return `rgba(${a}, ${i}, ${b}, ${f})`;
|
|
188
188
|
}
|
|
189
189
|
const dr = {
|
|
190
190
|
...tr
|
|
@@ -197,8 +197,8 @@ function br() {
|
|
|
197
197
|
function gr() {
|
|
198
198
|
var t;
|
|
199
199
|
try {
|
|
200
|
-
const r = p.getSystemInfoSync(), o = String((r == null ? void 0 : r.platform) || "").toLowerCase(), e = String((r == null ? void 0 : r.system) || ""), a = o === "ios", i = a ? parseInt(((t = e.match(/\d+/)) == null ? void 0 : t[0]) || "0", 10) : 0,
|
|
201
|
-
return { isIOS: a, iosMajor: i, dark:
|
|
200
|
+
const r = p.getSystemInfoSync(), o = String((r == null ? void 0 : r.platform) || "").toLowerCase(), e = String((r == null ? void 0 : r.system) || ""), a = o === "ios", i = a ? parseInt(((t = e.match(/\d+/)) == null ? void 0 : t[0]) || "0", 10) : 0, b = String((r == null ? void 0 : r.theme) || "").toLowerCase() === "dark";
|
|
201
|
+
return { isIOS: a, iosMajor: i, dark: b };
|
|
202
202
|
} catch {
|
|
203
203
|
return { isIOS: !1, iosMajor: 0, dark: !1 };
|
|
204
204
|
}
|
|
@@ -212,18 +212,18 @@ function mr() {
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
function fr(t) {
|
|
215
|
-
const { scene: r, dark: o, overlayColor: e, cls: a, style: i, children:
|
|
215
|
+
const { scene: r, dark: o, overlayColor: e, cls: a, style: i, children: b, rest: f } = t, s = r ? cr(r, o) : void 0, c = {};
|
|
216
216
|
s ? (c.blurScale = s.blurScale, c.colorMode = s.colorMode) : c.colorMode = o ? "dark" : "light";
|
|
217
217
|
const u = { ...i };
|
|
218
218
|
(i == null ? void 0 : i.borderRadius) === void 0 && s && (u.borderRadius = `${s.borderRadius}px`);
|
|
219
|
-
const
|
|
220
|
-
return
|
|
219
|
+
const m = e ?? (s == null ? void 0 : s.overlayColor);
|
|
220
|
+
return m && u.backgroundColor === void 0 && (u.backgroundColor = m), s != null && s.backgroundGradient && u.background === void 0 && (u.background = s.backgroundGradient), s != null && s.boxShadow && u.boxShadow === void 0 && (u.boxShadow = s.boxShadow), /* @__PURE__ */ B(K, { className: a, style: u, ...c, ...f, children: b });
|
|
221
221
|
}
|
|
222
222
|
function hr(t) {
|
|
223
|
-
const { scene: r, dark: o, targetId: e, overlayColor: a, cls: i, style:
|
|
223
|
+
const { scene: r, dark: o, targetId: e, overlayColor: a, cls: i, style: b, children: f, rest: s } = t, c = r ? ir(r, o) : void 0, u = { ...b };
|
|
224
224
|
c && c.blurRadius > 0 && (u.backdropFilter = `blur(${c.blurRadius}px)`), c && u.borderRadius === void 0 && (u.borderRadius = `${c.borderRadius}px`);
|
|
225
|
-
const
|
|
226
|
-
return e && (y.targetId = e), r && (y.scene = r),
|
|
225
|
+
const m = a ?? (c == null ? void 0 : c.tintColor), y = {};
|
|
226
|
+
return e && (y.targetId = e), r && (y.scene = r), m && (y.overlayColor = m), /* @__PURE__ */ B(K, { className: i, style: u, ...y, ...s, children: f });
|
|
227
227
|
}
|
|
228
228
|
const pr = (t) => {
|
|
229
229
|
const {
|
|
@@ -232,82 +232,83 @@ const pr = (t) => {
|
|
|
232
232
|
children: e,
|
|
233
233
|
scene: a,
|
|
234
234
|
targetId: i,
|
|
235
|
-
theme:
|
|
236
|
-
extractTint:
|
|
235
|
+
theme: b = "auto",
|
|
236
|
+
extractTint: f,
|
|
237
237
|
liquidGlass: s,
|
|
238
238
|
frostedGlass: c,
|
|
239
239
|
gradientBlur: u,
|
|
240
|
-
overlayColor:
|
|
240
|
+
overlayColor: m,
|
|
241
241
|
id: y,
|
|
242
|
-
...
|
|
243
|
-
} = { ...dr, ...t },
|
|
242
|
+
...M
|
|
243
|
+
} = { ...dr, ...t }, I = Z("nut-jdmaterialview", r), { isIOS: S, iosMajor: x } = j(() => gr(), []), $ = b === "auto", [U, z] = J(() => mr()), A = V(
|
|
244
244
|
(n) => {
|
|
245
245
|
const g = typeof n == "string" ? n : String((n == null ? void 0 : n.theme) || "");
|
|
246
|
-
|
|
246
|
+
z(g.toLowerCase() === "dark");
|
|
247
247
|
},
|
|
248
248
|
[]
|
|
249
249
|
);
|
|
250
|
-
|
|
250
|
+
E(() => {
|
|
251
251
|
var n, g;
|
|
252
252
|
if ($) {
|
|
253
253
|
try {
|
|
254
|
-
(g = (n = p).onThemeChange) == null || g.call(n,
|
|
254
|
+
(g = (n = p).onThemeChange) == null || g.call(n, A);
|
|
255
255
|
} catch {
|
|
256
256
|
}
|
|
257
257
|
return () => {
|
|
258
|
-
var
|
|
258
|
+
var d, C;
|
|
259
259
|
try {
|
|
260
|
-
(C = (
|
|
260
|
+
(C = (d = p).offThemeChange) == null || C.call(d, A);
|
|
261
261
|
} catch {
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
}, [$,
|
|
266
|
-
const v = $ ?
|
|
267
|
-
() => a ? sr(a, v,
|
|
268
|
-
[a, v,
|
|
269
|
-
),
|
|
265
|
+
}, [$, A]);
|
|
266
|
+
const v = $ ? U : b === "dark", l = j(
|
|
267
|
+
() => a ? sr(a, v, x) : void 0,
|
|
268
|
+
[a, v, x]
|
|
269
|
+
), O = s ?? (l == null ? void 0 : l.liquidGlass), w = !!f && (a === "promotion-fair" || a === "promotion-deep"), G = i ? `taro_material_${i}` : void 0, [_, X] = J(void 0), q = V(() => {
|
|
270
270
|
var C;
|
|
271
|
-
if (!S || !
|
|
271
|
+
if (!S || !w || !G || !i) return;
|
|
272
272
|
const n = p;
|
|
273
273
|
if (typeof n.getTagById != "function" || !((C = n.JDTheme) != null && C.getGlassTintConfig)) return;
|
|
274
|
-
const g = n.getTagById(
|
|
275
|
-
g == null ||
|
|
276
|
-
const h = (
|
|
277
|
-
!
|
|
274
|
+
const g = n.getTagById(G), d = n.getTagById(i);
|
|
275
|
+
g == null || d == null || g < 0 || d < 0 || n.JDTheme.getGlassTintConfig({ materialTag: g, blurTag: d }).then((R) => {
|
|
276
|
+
const h = (R == null ? void 0 : R.data) ?? R, H = h == null ? void 0 : h.tintColor, k = h == null ? void 0 : h.tintAlpha;
|
|
277
|
+
!H || !k || k <= 0 || X(ur(H, k));
|
|
278
278
|
}).catch(() => {
|
|
279
279
|
});
|
|
280
|
-
}, [S,
|
|
281
|
-
|
|
282
|
-
!S || !
|
|
283
|
-
}, [S,
|
|
284
|
-
const
|
|
280
|
+
}, [S, w, a, G, i]);
|
|
281
|
+
E(() => {
|
|
282
|
+
!S || !w || p.nextTick(() => q());
|
|
283
|
+
}, [S, w, v, q, a, i]);
|
|
284
|
+
const L = O && _ ? { ...O, tintColor: _ } : O, N = c ?? (l == null ? void 0 : l.frostedGlass), P = u ?? (l == null ? void 0 : l.gradientBlur);
|
|
285
285
|
if (S) {
|
|
286
286
|
const n = { ...l == null ? void 0 : l.fallbackStyle, ...o };
|
|
287
|
-
|
|
287
|
+
a && n.borderRadius === void 0 && (n.borderRadius = `${nr(a, x)}px`), l != null && l.boxShadow && n.boxShadow === void 0 && (n.boxShadow = l.boxShadow);
|
|
288
|
+
const g = x >= 26;
|
|
289
|
+
let d;
|
|
290
|
+
return g && L ? d = { liquidGlass: L } : N ? d = { frostedGlass: N } : P && (d = { gradientBlur: P }), /* @__PURE__ */ B(
|
|
288
291
|
or,
|
|
289
292
|
{
|
|
290
|
-
id:
|
|
291
|
-
className:
|
|
293
|
+
id: G,
|
|
294
|
+
className: I,
|
|
292
295
|
style: n,
|
|
293
296
|
targetId: i,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
gradientBlur: X,
|
|
297
|
-
...T,
|
|
297
|
+
materialConfig: d,
|
|
298
|
+
...M,
|
|
298
299
|
children: e
|
|
299
300
|
}
|
|
300
301
|
);
|
|
301
302
|
}
|
|
302
|
-
return br() ? fr({ scene: a, dark: v, overlayColor:
|
|
303
|
+
return br() ? fr({ scene: a, dark: v, overlayColor: m, cls: I, style: o, children: e, rest: M }) : hr({
|
|
303
304
|
scene: a,
|
|
304
305
|
dark: v,
|
|
305
306
|
targetId: i,
|
|
306
|
-
overlayColor:
|
|
307
|
-
cls:
|
|
307
|
+
overlayColor: m,
|
|
308
|
+
cls: I,
|
|
308
309
|
style: o,
|
|
309
310
|
children: e,
|
|
310
|
-
rest:
|
|
311
|
+
rest: M
|
|
311
312
|
});
|
|
312
313
|
};
|
|
313
314
|
pr.displayName = "NutJDMaterialView";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nutui/taro-biz",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.28",
|
|
4
4
|
"main": "dist/es/index/index.js",
|
|
5
5
|
"module": "dist/es/index/index.js",
|
|
6
6
|
"types": "dist/es/index/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"add": "node scripts/create-component.js"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@jdtaro/ui": ">=4.1.1-beta.
|
|
43
|
+
"@jdtaro/ui": ">=4.1.1-beta.10",
|
|
44
44
|
"@tarojs/components": ">=4.0.0",
|
|
45
45
|
"@tarojs/taro": ">=4.0.0",
|
|
46
46
|
"react": ">=16.8.0",
|