@sheetxl/studio-vanilla 0.3.18 → 0.3.19
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/browser/cjs/{_ziVh-PPWxWmEGfz.cjs → 2FwFu5228wr-ARkA.cjs} +3 -3
- package/browser/cjs/B32tWc1qRv4tY12p.cjs +6 -0
- package/browser/cjs/{DvjIxJUC4K8kmZsN.cjs → BA4eX47IpP00-8so.cjs} +2 -2
- package/browser/cjs/{DRPysX3BgTyOtc_X.cjs → BKPCa_z6dnIQn-0l.cjs} +1 -1
- package/browser/cjs/{D_yi3Bmt7QylbNjX.cjs → BWs24EHW-tVFgT-x.cjs} +2 -2
- package/browser/cjs/{hRorav-Vugk2j14d.cjs → BdvCvAgiry0f4S23.cjs} +1 -1
- package/browser/cjs/{DcKGSA3SMuEvjd87.cjs → CDKv578p0EwvHjZp.cjs} +1 -1
- package/browser/cjs/{DtIlU_avOLio9EiE.cjs → CIo606dkZ8lkuDJ3.cjs} +1 -1
- package/browser/cjs/{DWRHniG382TBBpFz.cjs → CY7-VXmdgBslTVMX.cjs} +3 -3
- package/browser/cjs/{BQDBBqqYeHWRLSmz.cjs → Ce6oHmr7gMYWd8Yd.cjs} +5 -5
- package/browser/cjs/{BYKCnVVe-UC0DLAg.cjs → Cfdd6ktavWDYX9ND.cjs} +1 -1
- package/browser/cjs/{DAGAHrQyWku5BzOx.cjs → Cjh4Y6CzIKElfhND.cjs} +2 -2
- package/browser/cjs/{asqh4V32TzlgSg5e.cjs → Cnk7ISRHexlfGYia.cjs} +1 -1
- package/browser/cjs/{C7S-2ysc4XzmIGIC.cjs → D0TmTI_7aDwkiyE4.cjs} +2 -2
- package/browser/cjs/{M2DWfdK0ctQctT7T.cjs → DJC4cn9wXv_q5aHy.cjs} +2 -2
- package/browser/cjs/{CfnTR1Qy-WVFzRhw.cjs → DPk0an7l4dAKSvt4.cjs} +6 -6
- package/browser/cjs/{S1ymoLlv7Uf-qfRz.cjs → DQu9kotW1g223yHH.cjs} +45 -45
- package/browser/cjs/{BqsLsLOIcCoQLkFG.cjs → Do4JoiMPrmr8e_3I.cjs} +2 -2
- package/browser/cjs/DtwZ1dCv4IJK54Md.cjs +6 -0
- package/browser/cjs/{DWmar9vh-C0GMWUE.cjs → MSGlzfMbdkBj2ODr.cjs} +1 -1
- package/browser/cjs/{Da9leDv0BrMDcAmM.cjs → USAsNV7756AJ-v-3.cjs} +1 -1
- package/browser/cjs/{Cyis9v9OePqed0Dh.cjs → bLAfby6zV0qLxdQi.cjs} +2 -2
- package/browser/cjs/{DqW0_yEVBgywVFtY.cjs → gPTujfwB4RqxIcij.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{DU5bkZX7g1nGYiyr.cjs → lObc2MW6JiaOpm-q.cjs} +2 -2
- package/browser/cjs/{DvCk-FEyF55Ifc2r.cjs → mSxg83umiyMZNf9-.cjs} +2 -2
- package/browser/cjs/{fkUUKUigUVeizJCn.cjs → vWIDSfediysRj8eo.cjs} +6 -6
- package/{cdn/assets/DT7M18T3_fx1cPVf.js → browser/esm/4b-cAFWAwXYZkw0D.mjs} +1 -1
- package/browser/esm/{DscLpbq31HrJWVSt.mjs → B8OZHivNmO5OFLTi.mjs} +17 -17
- package/browser/esm/BGvOrkSiilN4Dt_5.mjs +46 -0
- package/browser/esm/{DXfVp9l0_p8tTvaN.mjs → BjXzbYB0kCMhwN3Y.mjs} +2621 -2534
- package/browser/esm/{Dmp9Rj_xUISYWU8A.mjs → BlxEnptsgkGA0_21.mjs} +9 -9
- package/{cdn/assets/Dctd5ghWrESGG3Co.js → browser/esm/Bm440-d54x4naZeO.mjs} +1 -1
- package/{cdn/assets/Bwmetegu2MJ05lq3.js → browser/esm/BnmsWZ7pB-RvN8Ce.mjs} +8 -8
- package/{cdn/assets/B048AhsMgarmATbo.js → browser/esm/BorGhlvsrSc8KIw4.mjs} +9 -9
- package/{cdn/assets/B8PLUmI-u31BZVd6.js → browser/esm/Brg-pw5qowVCqKUF.mjs} +1 -1
- package/browser/esm/{Dao0wUfvplQebarN.mjs → C2UMejLEXH1i7UT_.mjs} +3 -3
- package/{cdn/assets/Cx5_1Ld9VgK4afkO.js → browser/esm/C6ty7TIqMKf0jms4.mjs} +1 -1
- package/browser/esm/{Ds9ulL0El--2XZxz.mjs → CDha50D0Zqdh75RO.mjs} +47 -47
- package/browser/esm/{CEM1UbNtZh6zUcI4.mjs → CHNBfqp5n8JaC7UU.mjs} +3 -3
- package/{cdn/assets/D0Cgu7sUw30-mnqB.js → browser/esm/CkOpEOqipQhoCXbp.mjs} +7 -7
- package/browser/esm/{DyhSx6j-hlOPAYJZ.mjs → CxJ9wqppH10FCE7E.mjs} +2 -2
- package/browser/esm/{yBjDi6dOfUg5E0mg.mjs → D8V8o3E9AIpGCaJ0.mjs} +5 -5
- package/browser/esm/{vsshjgK_uLUMXLx1.mjs → DGbBeyHSDhhZ67G7.mjs} +91 -91
- package/browser/esm/{DmdaLSunj1pIaeEo.mjs → DHtJbuH4VrIp2owl.mjs} +4 -4
- package/browser/esm/{CxpsUomBmsPdQKN7.mjs → DNEd6u6uOJT1ngWx.mjs} +7 -7
- package/browser/esm/{B_lXgGve4BaGb9VP.mjs → DTW0B_xW-HuS3NuK.mjs} +5 -5
- package/browser/esm/{vO-cPppKuuwM-ZbD.mjs → DzowkvQRyggO7Ijl.mjs} +1 -1
- package/browser/esm/{Z1hTdWF7Gnd7lwEi.mjs → FNXLcvV7DgUq6zwL.mjs} +1 -1
- package/{cdn/assets/CMIrbndkU0UVjjQ_.js → browser/esm/SWAv_VgEKg95ORt5.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/{cdn/assets/Dp2nf7t-XHCeT9z1.js → browser/esm/vYT-yKp90JOPBqDa.mjs} +2 -2
- package/browser/esm/{Bu74cvcXGNxQ6eQO.mjs → vsx7PlJlMQvNPm_L.mjs} +1 -1
- package/browser/esm/{CCGl8RxWO4yKms9p.mjs → zovGkWpLePhgQd_n.mjs} +1 -1
- package/{browser/esm/DT7M18T3_fx1cPVf.mjs → cdn/assets/4b-cAFWAwXYZkw0D.js} +1 -1
- package/cdn/assets/{DpXpV2Nd-U9CeW99.js → 8QCrFIzHmtIoeBJm.js} +4 -4
- package/{browser/esm/5KE3eJeALYas2fJL.mjs → cdn/assets/8xNW6edqjY-klal3.js} +9 -9
- package/cdn/assets/{IXjjn0b7hP-r-rz5.js → BJlG0NMA-JM_rPkc.js} +91 -91
- package/cdn/assets/{BfCDUWippQ188QJ_.js → BNcPMWtsY8_g-EN4.js} +5 -5
- package/cdn/assets/BhwpQU1T51VKYXPZ.js +46 -0
- package/{browser/esm/Dctd5ghWrESGG3Co.mjs → cdn/assets/Bm440-d54x4naZeO.js} +1 -1
- package/{browser/esm/B8PLUmI-u31BZVd6.mjs → cdn/assets/Brg-pw5qowVCqKUF.js} +1 -1
- package/{browser/esm/xCvG1lefZTf09iDX.mjs → cdn/assets/BrkvsmfqGj5-gULd.js} +2 -2
- package/cdn/assets/{JWXHlKikGyP_aFCO.js → BtcEbQwXXgpwi-Wc.js} +17 -17
- package/cdn/assets/{BKj70d8kss8lWQ5j.js → C4-fZEqFmgf4Ryrf.js} +5 -5
- package/{browser/esm/Cx5_1Ld9VgK4afkO.mjs → cdn/assets/C6ty7TIqMKf0jms4.js} +1 -1
- package/cdn/assets/{DXkBcCCoCQhFBFpQ.js → CD48E90J73F2rFJF.js} +3 -3
- package/{browser/esm/BElryNS11jWM5tq7.mjs → cdn/assets/D3-MLKMldcoobrMe.js} +8 -8
- package/cdn/assets/{CXyKsX-Rk4hkAgns.js → DVoDFCX7Bv_zFVVi.js} +4599 -4512
- package/cdn/assets/{DcwFhmc6DauSay_m.js → DkRkxpsLaXOm1dGc.js} +7 -7
- package/cdn/assets/{b5siqWNPQWp_hlIg.js → DoNQnutyjVRliOV0.js} +2 -2
- package/cdn/assets/{DBZHYaXm5oENOlcW.js → DzXbXyuxyjtFLOXt.js} +9 -9
- package/cdn/assets/{vO-cPppKuuwM-ZbD.js → DzowkvQRyggO7Ijl.js} +1 -1
- package/cdn/assets/{Z1hTdWF7Gnd7lwEi.js → FNXLcvV7DgUq6zwL.js} +1 -1
- package/{browser/esm/CMIrbndkU0UVjjQ_.mjs → cdn/assets/SWAv_VgEKg95ORt5.js} +1 -1
- package/cdn/assets/{B5Xa0YYj-Y9Ob5he.js → TXu1jpI8ASN4INNu.js} +47 -47
- package/cdn/assets/{DXZHEN_G41ARU9aP.js → aAVhloO6mFh8WJzi.js} +3 -3
- package/cdn/assets/{Bu74cvcXGNxQ6eQO.js → vsx7PlJlMQvNPm_L.js} +1 -1
- package/{browser/esm/xQa55VzyxKLtju1P.mjs → cdn/assets/yLoKmwpXykv9-Elu.js} +7 -7
- package/cdn/assets/{CCGl8RxWO4yKms9p.js → zovGkWpLePhgQd_n.js} +1 -1
- package/cdn/index.js +2 -2
- package/cdn/loader.js +1 -1
- package/package.json +3 -3
- package/browser/cjs/BYQV2q8HPKlf74j3.cjs +0 -6
- package/browser/cjs/ClYi27L-BwfwOane.cjs +0 -6
- package/browser/esm/CATPGvRDTTOuHtl8.mjs +0 -46
- package/cdn/assets/c46EuNJ8AHDaEf22.js +0 -46
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { memo as oe, useRef as C, useState as b, useEffect as L, useLayoutEffect as pe, useMemo as de } from "react";
|
|
3
3
|
import { ICell as c, IRange as R } from "@sheetxl/sdk";
|
|
4
|
-
import { t as D,
|
|
5
|
-
import { C as ee } from "./
|
|
4
|
+
import { t as D, v as H, av as ue, V as fe, aA as ge, aB as me, B as O, aC as m, ah as x, aD as xe, a8 as y, aE as he, T as _, a as k, aF as Oe, aG as Ce, aH as ye, aI as be, ay as w, aJ as ve, aK as Te, ak as Re, az as ke, F as we, aw as Ee, ax as Fe } from "./BjXzbYB0kCMhwN3Y.mjs";
|
|
5
|
+
import { C as ee } from "./DGbBeyHSDhhZ67G7.mjs";
|
|
6
6
|
/**
|
|
7
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.3.
|
|
7
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.3.19
|
|
8
8
|
*
|
|
9
9
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
10
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -27,23 +27,23 @@ const Ae = { "By Rows": !0, "By Columns": !1 }, ie = (E, h) => {
|
|
|
27
27
|
if (h[d] === E) return d;
|
|
28
28
|
}
|
|
29
29
|
}, ze = oe((E) => {
|
|
30
|
-
const { replace: h = !1, findText: r, replaceText: a, findOptions: d, replaceOptions: v, title: A, onHide: K, onFindOrReplace: T, ...P } = E, s = C(null), u = C(null),
|
|
30
|
+
const { replace: h = !1, findText: r, replaceText: a, findOptions: d, replaceOptions: v, title: A, onHide: K, onFindOrReplace: T, ...P } = E, s = C(null), u = C(null), $ = C(null), W = C(null), j = C(null), N = C(null), G = (e, t) => {
|
|
31
31
|
t && (t.start(e, { center: !1 }), setTimeout(() => t.stop(e), 180));
|
|
32
|
-
}, [J, I] = b(!1), [
|
|
32
|
+
}, [J, I] = b(!1), [V, le] = b(!1), [f, B] = b(h), [U, M] = b(!1), [X, q] = b(!1), [o, l] = b({ findText: null, replaceText: null, replace: h, replaceOptions: {}, findOptions: { matchCase: !1, matchEntireCell: !1, useRegex: !1, orientation: R.Orientation.Row, fields: [c.Content.Formulas] }, scope: te.Sheet }), F = H(async (e, t, n, S) => {
|
|
33
33
|
if (!T) return;
|
|
34
34
|
const g = { ...o };
|
|
35
35
|
g.replaceOptions = { ...g.replaceOptions }, g.findOptions = { ...g.findOptions }, g.replaceOptions.maxCount = n ? void 0 : 1, g.replace = t, t && o.findOptions.fields?.[0] === c.Content.Values && (g.findOptions.fields = [c.Content.Formulas]), g.findOptions.reverse = !e;
|
|
36
36
|
const ce = await T({ autoFocus: S, ...g });
|
|
37
|
-
|
|
37
|
+
M(ce === 0);
|
|
38
38
|
}, [o, T]);
|
|
39
39
|
L(() => {
|
|
40
|
-
|
|
41
|
-
}, [o,
|
|
40
|
+
M(!1);
|
|
41
|
+
}, [o, V, f]);
|
|
42
42
|
const Q = H((e, t) => {
|
|
43
43
|
if (e.keyCode === ue.Enter) {
|
|
44
44
|
if (!o.findText) return;
|
|
45
45
|
let n = !0, S = !1;
|
|
46
|
-
e.shiftKey && (n = !1), t ? (e.ctrlKey && e.altKey && (S = !0), G(e, S ? N.current : j.current)) : G(e, n ?
|
|
46
|
+
e.shiftKey && (n = !1), t ? (e.ctrlKey && e.altKey && (S = !0), G(e, S ? N.current : j.current)) : G(e, n ? W.current : $.current), F(n, t, S, !1);
|
|
47
47
|
}
|
|
48
48
|
}, [o]), Y = C(null);
|
|
49
49
|
pe(() => {
|
|
@@ -51,7 +51,7 @@ const Ae = { "By Rows": !0, "By Columns": !1 }, ie = (E, h) => {
|
|
|
51
51
|
const t = { ...e };
|
|
52
52
|
t.findText = r && r.length > 0 ? r : e.findText ?? "", I(!0), a !== void 0 && (t.replaceText = a), d && (t.findOptions = { ...t.findOptions, ...d }), t.replaceText || (t.replaceText = ""), t.replaceOptions && (t.replaceOptions = { ...t.replaceOptions }), v && (t.replaceOptions = { ...t.replaceOptions, ...v }), o.findOptions.fields?.[0] || (o.findOptions.fields = [c.Content.Formulas]);
|
|
53
53
|
const n = !(!v && a === void 0);
|
|
54
|
-
return n &&
|
|
54
|
+
return n && B(n), t;
|
|
55
55
|
}), X || Y.current?.focus();
|
|
56
56
|
}, [r, a, d, v]), L(() => {
|
|
57
57
|
f ? (o.findOptions.fields[0], c.Content.Values) : I(!0);
|
|
@@ -62,9 +62,9 @@ const Ae = { "By Rows": !0, "By Columns": !1 }, ie = (E, h) => {
|
|
|
62
62
|
}, [J, o]);
|
|
63
63
|
const [re, { width: Z }] = fe();
|
|
64
64
|
return i(ge, { title: A ?? (f ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", refWindow: Y, onHide: K, onFocus: () => q(!0), onBlur: () => {
|
|
65
|
-
q(!1),
|
|
65
|
+
q(!1), M(!1);
|
|
66
66
|
}, PaperProps: { elevation: X ? 3 : 1 }, ...P, children: p(me, { dividers: !0, ref: re, sx: { display: "flex", flexDirection: "column", paddingLeft: (e) => e.spacing(1.5), paddingRight: (e) => e.spacing(1.5) }, onKeyDown: (e) => {
|
|
67
|
-
if (e.key === "h" && e.ctrlKey)
|
|
67
|
+
if (e.key === "h" && e.ctrlKey) B(!0), s.current?.contains(document.activeElement) && u.current?.focus();
|
|
68
68
|
else if (e.key === "f" && e.ctrlKey) s.current?.focus();
|
|
69
69
|
else if (e.key === "c" && e.altKey) l((t) => {
|
|
70
70
|
const n = { ...t };
|
|
@@ -82,10 +82,10 @@ const Ae = { "By Rows": !0, "By Columns": !1 }, ie = (E, h) => {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
e.preventDefault();
|
|
85
|
-
}, children: [p(O, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e) => e.spacing(0.25), paddingTop: "3px" }, children: [i(m, { selected:
|
|
85
|
+
}, children: [p(O, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e) => e.spacing(0.25), paddingTop: "3px" }, children: [i(m, { selected: V, onSelectToggle: (e) => {
|
|
86
86
|
le(e);
|
|
87
87
|
}, preventFocus: !0, label: "Toggle Additional Options", icon: x(i(xe, {})) }), i(m, { selected: f, onSelectToggle: (e) => {
|
|
88
|
-
|
|
88
|
+
B(e);
|
|
89
89
|
}, preventFocus: !0, label: "Toggle Replace", icon: x(i(he, {})), shortcut: { key: f ? "F" : "H", modifiers: [y.Ctrl] } })] }), p(O, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [i(_, { label: "Find", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), minWidth: Z > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${k("#fff", w(5))}, ${k("#fff", w(5))})` }, inputProps: { draggable: !1, ref: s, className: "input", autoFocus: !0, spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75) } }, endAdornment: i(Oe, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: p(O, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [i(m, { selected: o.findOptions.matchCase, onSelectToggle: (e) => {
|
|
90
90
|
l((t) => {
|
|
91
91
|
const n = { ...t };
|
|
@@ -110,9 +110,9 @@ const Ae = { "By Rows": !0, "By Columns": !1 }, ie = (E, h) => {
|
|
|
110
110
|
e.stopPropagation();
|
|
111
111
|
} }), i(m, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
|
|
112
112
|
F(!1, !1);
|
|
113
|
-
}, touchRippleRef:
|
|
113
|
+
}, touchRippleRef: $, label: "", shortcut: { key: "Enter", modifiers: [y.Shift] }, icon: x(o.findOptions.orientation !== R.Orientation.Column ? i(Se, {}) : i(De, {})), disabled: !o.findText }), i(m, { selected: !o.findOptions.reverse, onSelectToggle: (e) => {
|
|
114
114
|
F(!0, !1);
|
|
115
|
-
}, touchRippleRef:
|
|
115
|
+
}, touchRippleRef: W, label: "Next Match", shortcut: { key: "Enter" }, icon: x(o.findOptions.orientation !== R.Orientation.Column ? i(Le, {}) : i(Ie, {})), disabled: !o.findText })] }), i(ee, { in: f, timeout: ne, onExit: () => {
|
|
116
116
|
s.current?.focus();
|
|
117
117
|
}, children: p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(_, { label: "Replace", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), backgroundImage: `linear-gradient(${k("#fff", w(5))}, ${k("#fff", w(5))})` }, inputProps: { ref: u, className: "input", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e) => e.spacing(1) }, value: o.replaceText ?? "", onChange: (e) => {
|
|
118
118
|
l((t) => {
|
|
@@ -125,7 +125,7 @@ const Ae = { "By Rows": !0, "By Columns": !1 }, ie = (E, h) => {
|
|
|
125
125
|
F(!0, !0);
|
|
126
126
|
}, touchRippleRef: j, label: "Replace", shortcut: { key: "Enter" }, icon: x(i(ve, {})), disabled: !o.findText }), i(m, { onSelectToggle: (e) => {
|
|
127
127
|
F(!0, !0, !0);
|
|
128
|
-
}, touchRippleRef: N, label: "Replace All", shortcut: { key: "Enter", modifiers: [y.Ctrl, y.Alt] }, icon: x(i(Te, {})), disabled: !o.findText })] }) })] })] }), i(ee, { in:
|
|
128
|
+
}, touchRippleRef: N, label: "Replace All", shortcut: { key: "Enter", modifiers: [y.Ctrl, y.Alt] }, icon: x(i(Te, {})), disabled: !o.findText })] }) })] })] }), i(ee, { in: V, timeout: ne, onExit: () => {
|
|
129
129
|
s.current?.focus();
|
|
130
130
|
}, children: p(O, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(0.5), marginTop: (e) => e.spacing(1) }, children: [i(Re, { orientation: "horizontal", sx: { marginBottom: (e) => e.spacing(1.5) } }), p(O, { sx: { display: "flex", flexDirection: Z >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e) => e.spacing(2) }, tabIndex: -1, children: [i(z, { label: "Within", value: o.scope, options: te, onSelect: (e) => {
|
|
131
131
|
l((t) => {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as o, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useMemo as b, useState as g, useCallback as O } from "react";
|
|
3
|
+
import { v as f, b as S, B as U, F as P, T as D, a as l, ay as p } from "./BjXzbYB0kCMhwN3Y.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.3.19
|
|
6
|
+
*
|
|
7
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
8
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
9
|
+
*/
|
|
10
|
+
const V = ["Ok", "Cancel"], J = E((F) => {
|
|
11
|
+
const { initialHyperlink: n = null, initialDisplay: v = null, onUpdateHyperlink: m, context: s, onOption: x, onValidateOption: r, onDone: d, options: h = V, defaultOption: c = h?.[0], cancelOption: i = "Cancel", sx: H, ...I } = F, w = b(() => (n ?? s?.()?.getHyperlink()) !== null, []), y = b(() => {
|
|
12
|
+
let a = null, t = null;
|
|
13
|
+
n && (typeof n == "string" ? t = n : a = n);
|
|
14
|
+
const C = a ?? s?.()?.getHyperlink();
|
|
15
|
+
return { address: t ?? C?.getAddress() ?? "", textToDisplay: C?.getDisplayText() ?? "" };
|
|
16
|
+
}, [n, s]), [e, M] = g(y.address), [u, B] = g(() => {
|
|
17
|
+
const a = s?.().toTextUnformatted() ?? v;
|
|
18
|
+
return a === y.address ? "" : a;
|
|
19
|
+
}), [$, k] = g(!1), L = O((a) => {
|
|
20
|
+
B(a.target.value);
|
|
21
|
+
}, []), T = O(async (a, t) => null, []), W = f(async (a) => {
|
|
22
|
+
a !== i && m?.(e === "" ? null : { address: e }, u), x?.(a, a === i, a === c), d?.();
|
|
23
|
+
}, [e, u, m, d, x, c, i]), j = f((a) => {
|
|
24
|
+
M(a.target.value), T(a.target.value, null);
|
|
25
|
+
}, [r]), z = f(async (a) => {
|
|
26
|
+
let t = await Promise.resolve(r?.(a));
|
|
27
|
+
try {
|
|
28
|
+
t !== !1 && (t = await T(e, a));
|
|
29
|
+
} catch {
|
|
30
|
+
}
|
|
31
|
+
return t ?? !0;
|
|
32
|
+
}, [r]);
|
|
33
|
+
return o(S, { title: (w ? "Edit" : "Insert") + " Link", options: h, onDone: d, onOption: (a) => W(a), onValidateOption: z, defaultOption: c, cancelOption: i, autoFocusSel: ".autoFocus", sx: { width: "480px", ...H }, ...I, children: A(U, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0), rowGap: (a) => a.spacing(1), display: "flex", flexDirection: "column" }, children: [o(P, { sx: { paddingTop: (a) => a.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(D, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (a) => {
|
|
34
|
+
$ || a.target?.select(), k(!0);
|
|
35
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", p(5))}, ${l("#fff", p(5))})` } } }, value: e, onChange: j, onContextMenu: (a) => {
|
|
36
|
+
a.stopPropagation();
|
|
37
|
+
} }) }), o(P, { sx: { paddingTop: (a) => a.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(D, { label: "Display Text", placeholder: e?.startsWith("#") ? e.substring(1) : e, onFocus: () => {
|
|
38
|
+
k(!0);
|
|
39
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { spellCheck: !1, autoComplete: "off", sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", p(5))}, ${l("#fff", p(5))})` } } }, value: u, onChange: L, onContextMenu: (a) => {
|
|
40
|
+
a.stopPropagation();
|
|
41
|
+
} }) })] }) });
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
J as HyperlinkDialog,
|
|
45
|
+
J as default
|
|
46
|
+
};
|