trimble-terra 1.1.6 → 1.1.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpecialButton.d.ts","sourceRoot":"","sources":["../../../../src/component/SpecialButton/SpecialButton.tsx"],"names":[],"mappings":"AACA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SpecialButton.d.ts","sourceRoot":"","sources":["../../../../src/component/SpecialButton/SpecialButton.tsx"],"names":[],"mappings":"AACA,OAAO,sBAAsB,CAAC;AAS9B,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,6EAQ3B,aAAa,4CAgIf,CAAC"}
|
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useEffect as B } from "react";
|
|
3
3
|
import './SpecialButton.css';/* empty css */
|
|
4
|
-
import { Icon as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { Icon as j } from "@trimble-creative-strategy/trimble-mxp-icons";
|
|
5
|
+
import D from "../../utils/isExternalLink.js";
|
|
6
|
+
import { getAppleAppStoreBtn as E, getGooglePlayStoreBtn as C } from "../../utils/imageAssets.js";
|
|
7
|
+
const O = ({
|
|
8
|
+
primary: v = !0,
|
|
8
9
|
size: s = "medium",
|
|
9
|
-
label:
|
|
10
|
-
destination:
|
|
11
|
-
iconColor:
|
|
12
|
-
utmParams:
|
|
13
|
-
LinkComponent:
|
|
10
|
+
label: u,
|
|
11
|
+
destination: r,
|
|
12
|
+
iconColor: p,
|
|
13
|
+
utmParams: x,
|
|
14
|
+
LinkComponent: f
|
|
14
15
|
}) => {
|
|
15
|
-
const [e,
|
|
16
|
-
|
|
16
|
+
const [e, m] = N(null), [I, g] = N(!0), o = !!(typeof r == "string" && r?.includes("apps.apple.com")), n = !!(typeof r == "string" && r?.includes("play.google.com"));
|
|
17
|
+
B(() => {
|
|
17
18
|
(async () => {
|
|
18
|
-
if (
|
|
19
|
+
if (g(!0), !o && !n)
|
|
19
20
|
return null;
|
|
20
|
-
|
|
21
|
+
o ? m(await E()) : n && m(await C()), g(!1);
|
|
21
22
|
})();
|
|
22
|
-
}, [
|
|
23
|
-
const h =
|
|
24
|
-
let
|
|
25
|
-
s == "small" ?
|
|
26
|
-
const S = (l,
|
|
23
|
+
}, [o, n]);
|
|
24
|
+
const h = v ? "t2-spbutton--primary" : "t2-spbutton--secondary";
|
|
25
|
+
let i = 12;
|
|
26
|
+
s == "small" ? i = 12 : s == "medium" ? i = 18 : s == "large" && (i = 20);
|
|
27
|
+
const S = (l, b) => {
|
|
27
28
|
if (!l) return "";
|
|
28
29
|
try {
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
}),
|
|
30
|
+
const _ = new URL(l);
|
|
31
|
+
return b && Object.entries(b).forEach(([$, w]) => {
|
|
32
|
+
_.searchParams.set($, w);
|
|
33
|
+
}), _.toString();
|
|
33
34
|
} catch {
|
|
34
35
|
return l;
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
-
if (
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
37
|
+
}, d = (s == "large", "t2u-chevron-right"), c = D(r);
|
|
38
|
+
if (f && !c)
|
|
39
|
+
return /* @__PURE__ */ a(
|
|
40
|
+
f,
|
|
40
41
|
{
|
|
41
42
|
className: ["t2-spbutton__wrap", `${h}`].join(" "),
|
|
42
|
-
href:
|
|
43
|
+
href: r || "#default",
|
|
43
44
|
tabIndex: 0,
|
|
44
45
|
children: [
|
|
45
|
-
r && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
|
|
46
46
|
o && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
n && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
|
|
48
|
+
!o && !n ? /* @__PURE__ */ a(y, { children: [
|
|
49
|
+
/* @__PURE__ */ t("div", { className: "t2-spbutton__field", children: u }),
|
|
49
50
|
/* @__PURE__ */ t(
|
|
50
51
|
"div",
|
|
51
52
|
{
|
|
52
53
|
className: [
|
|
53
54
|
"t2-spbutton",
|
|
54
|
-
`t2-spbutton-${
|
|
55
|
+
`t2-spbutton-${p}`,
|
|
55
56
|
`t2-spbutton--${s}`
|
|
56
57
|
].join(" "),
|
|
57
58
|
children: /* @__PURE__ */ t(
|
|
58
|
-
|
|
59
|
+
j,
|
|
59
60
|
{
|
|
60
61
|
className: "t2-spbutton__submit-icon",
|
|
61
|
-
type:
|
|
62
|
-
size:
|
|
62
|
+
type: d,
|
|
63
|
+
size: i,
|
|
63
64
|
fillColor: "currentColor"
|
|
64
65
|
}
|
|
65
66
|
)
|
|
@@ -70,32 +71,34 @@ const L = ({
|
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
73
|
{
|
|
73
|
-
const l = S(
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
const l = S(r, x);
|
|
75
|
+
return /* @__PURE__ */ a(
|
|
75
76
|
"a",
|
|
76
77
|
{
|
|
77
78
|
className: ["t2-spbutton__wrap", `${h}`].join(" "),
|
|
78
79
|
href: l,
|
|
79
80
|
tabIndex: 0,
|
|
81
|
+
target: c ? "_blank" : "_self",
|
|
82
|
+
rel: c ? "noopener noreferrer" : void 0,
|
|
80
83
|
children: [
|
|
81
|
-
r && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
|
|
82
84
|
o && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
n && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
|
|
86
|
+
!o && !n ? /* @__PURE__ */ a(y, { children: [
|
|
87
|
+
/* @__PURE__ */ t("div", { className: "t2-spbutton__field", children: u }),
|
|
85
88
|
/* @__PURE__ */ t(
|
|
86
89
|
"div",
|
|
87
90
|
{
|
|
88
91
|
className: [
|
|
89
92
|
"t2-spbutton",
|
|
90
|
-
`t2-spbutton-${
|
|
93
|
+
`t2-spbutton-${p}`,
|
|
91
94
|
`t2-spbutton--${s}`
|
|
92
95
|
].join(" "),
|
|
93
96
|
children: /* @__PURE__ */ t(
|
|
94
|
-
|
|
97
|
+
j,
|
|
95
98
|
{
|
|
96
99
|
className: "t2-spbutton__submit-icon",
|
|
97
|
-
type:
|
|
98
|
-
size:
|
|
100
|
+
type: d,
|
|
101
|
+
size: i,
|
|
99
102
|
fillColor: "currentColor"
|
|
100
103
|
}
|
|
101
104
|
)
|
|
@@ -108,5 +111,5 @@ const L = ({
|
|
|
108
111
|
}
|
|
109
112
|
};
|
|
110
113
|
export {
|
|
111
|
-
|
|
114
|
+
O as SpecialButton
|
|
112
115
|
};
|