@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.12
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/esm/{ByeL_BZuJ2kl8gtf.mjs → 0IBZhOJaVmzJxuTv.mjs} +1 -1
- package/browser/esm/2nRxqrNYbmEn8fS8.mjs +386 -0
- package/browser/esm/{fb126BNj3F8URR19.mjs → 7fVZXXuonYb6Z7FU.mjs} +3 -3
- package/browser/esm/BAzhmMX4Fk_qnUTp.mjs +414 -0
- package/browser/esm/BGL3x0W74D7qZXlf.mjs +318 -0
- package/browser/esm/BHGr2gsFofTdAFxq.mjs +515 -0
- package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BKhcJI-G15D3kGap.mjs} +4 -4
- package/browser/esm/BNbub9weuqm3mcoF.mjs +335 -0
- package/browser/esm/BSv9MVJaz1DVEffm.mjs +975 -0
- package/browser/esm/BWfLpYmd3cSgJ0C6.mjs +141 -0
- package/browser/esm/BZqwbIE8qzjSOYcJ.mjs +582 -0
- package/browser/esm/BZy9xUrYpAtnKeji.mjs +1288 -0
- package/browser/esm/{CIu1bjPJe_x31Oww.mjs → BnkwC5rsg9LZyhoP.mjs} +3 -3
- package/browser/esm/BpJsBv413cNQpyg0.mjs +319 -0
- package/browser/esm/BpVrgbVISiTDyFR3.mjs +197 -0
- package/browser/esm/BsngRDhvVYGVBJeK.mjs +1546 -0
- package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → C29TKq47CbXs652l.mjs} +2 -2
- package/browser/esm/{CEvZe2cZK-voZTif.mjs → C8p2iMad_NNCwGI_.mjs} +5 -5
- package/browser/esm/CBzXksWnb-1gGEWZ.mjs +212 -0
- package/browser/esm/{IQLeaAbtGTipUsOD.mjs → CFIAWgpU3UyepLBn.mjs} +25 -24
- package/browser/esm/CJD4jF4m9cBGHzr_.mjs +31 -0
- package/browser/esm/{CjznclrKqJRi7u9O.mjs → CMc7G7cevxzPGxr9.mjs} +2 -2
- package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → CYtULLhY9M2m3DeH.mjs} +1 -1
- package/browser/esm/CeF35ZeFP28Do5Zx.mjs +1379 -0
- package/browser/esm/{xKiLJKiLxto8SayF.mjs → CjYKDxU4EP2Kf_vo.mjs} +2 -2
- package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → Cq82lvdjyBvlJ8xJ.mjs} +19 -17
- package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → CuRxFAO42JkQvMEx.mjs} +1 -1
- package/browser/esm/Cvk2yY90hpgXWMAt.mjs +103 -0
- package/browser/esm/D0slJycx3nq53qmf.mjs +14 -0
- package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → D2jzliMwAo2ENpfi.mjs} +1 -1
- package/browser/esm/D5Fn0Hqllwv5HY6i.mjs +7581 -0
- package/browser/esm/D5N4nGaZsXtrHAOh.mjs +831 -0
- package/browser/esm/D7AqPfyhMiuda5l5.mjs +412 -0
- package/browser/esm/DHZA48ZMCETvHmeP.mjs +161 -0
- package/browser/esm/DX2_vf7WX6uRLaOZ.mjs +94 -0
- package/browser/esm/DaxpbAF1ShkT7hNU.mjs +490 -0
- package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → Db3oHfXiRtcH015t.mjs} +162 -156
- package/browser/esm/Dt47Huh1l3C4_5_w.mjs +87 -0
- package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → DtPt0phL7m56YfHZ.mjs} +1 -1
- package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → DtTDaXmnWUoG4VBO.mjs} +2 -2
- package/browser/esm/{DHY19rkSiiRZxShC.mjs → DuuyN4-7K6_io2Py.mjs} +3 -3
- package/browser/esm/{yZxC4qUENOlMhVUH.mjs → NeGeLF3gbGMZyV6E.mjs} +1 -1
- package/browser/esm/PY3Br5Bo_TxcCnCU.mjs +252 -0
- package/browser/esm/WIhvQtBkGiw-oFUs.mjs +2566 -0
- package/browser/esm/WgIvwAENeO8LANax.mjs +437 -0
- package/browser/esm/{DBtc4lku0uHVcqWn.mjs → Yjq3p_7eVGFw2Jod.mjs} +3 -3
- package/browser/esm/index.mjs +1053 -192
- package/browser/esm/jFRFCWlkD7Dsrhkh.mjs +236 -0
- package/browser/esm/lKXEDVt2ow1NlWJj.mjs +392 -0
- package/browser/esm/{Blaj2R5hYxtLAW__.mjs → oC0OwOddhOD0OoCJ.mjs} +6 -6
- package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → tIKqpsA0vNXH9EgU.mjs} +1 -1
- package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → u84rSnESjxqB6gay.mjs} +1 -1
- package/licenses/dependencies.txt +94 -94
- package/node/esm/{BcwMb6CyVfvEwbHn.mjs → B8Ls4Eh1k8-Yiry_.mjs} +1 -1
- package/node/esm/{CKu1AtRgyltyEdEN.mjs → B9X3n8MglL4OitAV.mjs} +1 -1
- package/node/esm/{ETK6T6G0SIcFXDe5.mjs → BBGoyqs2L_ccSH1e.mjs} +40 -40
- package/node/esm/BLv99aovW4R3C5PE.mjs +515 -0
- package/node/esm/BUGU_5lUtnCRlp3n.mjs +519 -0
- package/node/esm/BalROFG_oa9PFs9Q.mjs +141 -0
- package/node/esm/{ah3CUg4-VmNstGk_.mjs → BqVxnA1mo52ubjdf.mjs} +2 -2
- package/node/esm/C3FCh9xju2SccUIE.mjs +1283 -0
- package/node/esm/{Bb1sLMqXWKjdve23.mjs → C4F6WY8M4nkLyxdb.mjs} +2 -2
- package/node/esm/CKWeipCqqpLnLE5e.mjs +391 -0
- package/node/esm/CTnVNfz4eqFnM92M.mjs +212 -0
- package/node/esm/Cfi_ly8fBDZZdiZT.mjs +72 -0
- package/node/esm/CgKa6JuyJ1tTodev.mjs +1703 -0
- package/node/esm/{cqzp431iNSLWictb.mjs → Cq53M7bAUSXMNq1f.mjs} +22 -22
- package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → Cr8AYWUoU-XVt0hu.mjs} +1 -1
- package/node/esm/CyuOE595I2e-U4cG.mjs +236 -0
- package/node/esm/D72CupF9mfy2D1Xa.mjs +94 -0
- package/node/esm/{DNSjK5DAH3M14Qbc.mjs → DGDHFK8okuVbRCe5.mjs} +1 -1
- package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DJFkALt4XrwkMbnU.mjs} +163 -157
- package/node/esm/DJpwI8PlKBI2rk0r.mjs +319 -0
- package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DQaGPUYbgL4Y5YZW.mjs} +32 -30
- package/node/esm/{D9rzScOA9pEYFrtz.mjs → DsNYnq4NtYBxPmeA.mjs} +20 -20
- package/node/esm/DygDgOpa9sJ6YFVS.mjs +385 -0
- package/node/esm/Dz0Hg87UcJ-awwiI.mjs +489 -0
- package/node/esm/M7YxvRPGCuxuk9aK.mjs +142 -0
- package/node/esm/QNjtpX8rIpqGGLEJ.mjs +1379 -0
- package/node/esm/{B_jRGdwGFkudwmL-.mjs → ZzvsynJTCSuChYS-.mjs} +1 -1
- package/node/esm/{ci8d-mF1H9wnYzix.mjs → di_8-pXh90j4BO4j.mjs} +1 -1
- package/node/esm/dm8dmEaTIqfmgyeL.mjs +412 -0
- package/node/esm/{D6oQL8knsPpgdXuk.mjs → fmya3XQnTGyQisvT.mjs} +2 -2
- package/node/esm/gPYAb_A0T5ZwcQ1E.mjs +318 -0
- package/node/esm/index.mjs +8915 -13417
- package/node/esm/wB8xMpyJ_NvE16yG.mjs +975 -0
- package/node/esm/zGAcd4Jr7wkvXDBS.mjs +197 -0
- package/package.json +9 -9
- package/resources/locales/de/groups.cmd.json +4 -0
- package/resources/locales/de/ui.msg.json +100 -1
- package/resources/locales/en/groups.cmd.json +4 -0
- package/resources/locales/en/ui.msg.json +100 -1
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
- package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
- package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
- package/types/src/anomalies/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +1 -1
- package/types/src/border/BorderTemplateIcon.d.ts +6 -1
- package/types/src/chart/ChartFormatPanel.d.ts +20 -0
- package/types/src/chart/ChartPlugin.d.ts +6 -0
- package/types/src/chart/index.d.ts +3 -0
- package/types/src/color/ColorPopupButton.d.ts +1 -1
- package/types/src/command/AccountingStyleCommandButton.d.ts +1 -1
- package/types/src/command/DocThemeCommandButton.d.ts +1 -1
- package/types/src/command/FontFamilyCommandButton.d.ts +1 -1
- package/types/src/command/FontSizeCommandButton.d.ts +1 -1
- package/types/src/command/InsertCellControlCommandButton.d.ts +17 -0
- package/types/src/command/LanguageCommandButton.d.ts +1 -1
- package/types/src/command/LocaleCommandButton.d.ts +1 -1
- package/types/src/command/index.d.ts +1 -0
- package/types/src/comments/CommentCard.d.ts +2 -2
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +1 -1
- package/types/src/conditions/ConditionEditor.d.ts +1 -1
- package/types/src/conditions/OperatorAndParamEditor.d.ts +1 -1
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +2 -2
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
- package/types/src/fill/PatternPopupButton.d.ts +1 -1
- package/types/src/format/BorderPreview.d.ts +11 -4
- package/types/src/format/useFormatSelection.d.ts +4 -4
- package/types/src/formulaBar/IFormulaBar.d.ts +4 -2
- package/types/src/formulaBar/MobileFormulaBar.d.ts +18 -6
- package/types/src/formulaBar/MobileInputToolbar.d.ts +9 -3
- package/types/src/formulaBar/useFormulaBarSession.d.ts +6 -3
- package/types/src/index.d.ts +15 -6
- package/types/src/itemsPanel/ItemsPanel.d.ts +5 -0
- package/types/src/named/NamedDetailsPanel.d.ts +2 -2
- package/types/src/protection/ProtectedCellsPanel.d.ts +2 -2
- package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
- package/types/src/protection/index.d.ts +1 -1
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +2 -2
- package/types/src/statusBar/PendingStatus.d.ts +19 -0
- package/types/src/statusBar/index.d.ts +1 -0
- package/types/src/studio/StudioProps.d.ts +10 -10
- package/types/src/template/TemplatePanel.d.ts +5 -1
- package/types/src/theme/ThemeSelectPopupButton.d.ts +1 -1
- package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
- package/types/src/workbook/DefaultRenderers.d.ts +31 -19
- package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
- package/types/src/workbook/WorkbookElement.d.ts +5 -4
- package/types/src/workbook/WorkbookStrip.d.ts +8 -7
- package/types/src/workbook/index.d.ts +1 -1
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
- package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
- package/browser/esm/CtEFHbzYNvYjDYvi.mjs +0 -236
- package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
- package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
- package/node/esm/BYVLi0md4AYuDsB_.mjs +0 -236
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { t as e } from "./
|
|
7
|
+
import { t as e } from "./u84rSnESjxqB6gay.mjs";
|
|
8
8
|
import { Color as t, VERSION as n } from "@sheetxl/sdk";
|
|
9
9
|
import { useGridColorScheme as r } from "@sheetxl/react";
|
|
10
|
-
import { DynamicIcon as i, ReactUtils as a,
|
|
11
|
-
import { forwardRef as
|
|
12
|
-
import { ExhibitIconButton as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { Box as
|
|
15
|
-
import { listResources as
|
|
16
|
-
var
|
|
10
|
+
import { DynamicIcon as i, ReactUtils as a, RenderSlot as o, useTranslator as s } from "@sheetxl/utils-react";
|
|
11
|
+
import { forwardRef as c, memo as l, useCallback as u, useEffect as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
12
|
+
import { ExhibitIconButton as g } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { Box as b, Button as x, ButtonBase as S, Chip as C, Divider as w, InputAdornment as T, ListItemIcon as E, ListItemText as D, Menu as O, MenuItem as k, Skeleton as A, TextField as j, Typography as M } from "@mui/material";
|
|
15
|
+
import { listResources as N, releaseChannel as P } from "@sheetxl/utils";
|
|
16
|
+
var F = (e, n) => {
|
|
17
17
|
if (!e?.color) return null;
|
|
18
18
|
try {
|
|
19
19
|
let r = new t(e.color).toCSS(n.palette.mode === "dark");
|
|
@@ -24,20 +24,20 @@ var N = (e, n) => {
|
|
|
24
24
|
} catch {
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, I = "8 / 5", L = (e) => {
|
|
28
28
|
let { entry: t, category: n } = e, i = (r() === "dark" ? t.thumbnailDarkUrl : void 0) ?? t.thumbnailUrl;
|
|
29
|
-
return
|
|
29
|
+
return v(R, {
|
|
30
30
|
src: i,
|
|
31
31
|
category: n
|
|
32
32
|
}, i);
|
|
33
|
-
},
|
|
34
|
-
let { src: t, category: n } = e, [r, a] =
|
|
35
|
-
return
|
|
33
|
+
}, R = (e) => {
|
|
34
|
+
let { src: t, category: n } = e, [r, a] = h(t ? "loading" : "failed");
|
|
35
|
+
return y(b, {
|
|
36
36
|
className: "template-thumbnail",
|
|
37
37
|
sx: {
|
|
38
38
|
position: "relative",
|
|
39
39
|
width: "100%",
|
|
40
|
-
aspectRatio:
|
|
40
|
+
aspectRatio: I,
|
|
41
41
|
overflow: "hidden",
|
|
42
42
|
borderRadius: 1,
|
|
43
43
|
border: (e) => `1px solid ${e.palette.divider}`,
|
|
@@ -47,13 +47,13 @@ var N = (e, n) => {
|
|
|
47
47
|
alignItems: "center",
|
|
48
48
|
justifyContent: "center"
|
|
49
49
|
},
|
|
50
|
-
children: [r === "failed" ?
|
|
50
|
+
children: [r === "failed" ? v(i, {
|
|
51
51
|
iconKey: "FileNew",
|
|
52
52
|
style: {
|
|
53
53
|
fontSize: "2.5rem",
|
|
54
54
|
opacity: .4
|
|
55
55
|
}
|
|
56
|
-
}) :
|
|
56
|
+
}) : v("img", {
|
|
57
57
|
src: t,
|
|
58
58
|
alt: "",
|
|
59
59
|
loading: "lazy",
|
|
@@ -68,18 +68,18 @@ var N = (e, n) => {
|
|
|
68
68
|
opacity: +(r === "loaded"),
|
|
69
69
|
transition: "opacity 150ms ease-out"
|
|
70
70
|
}
|
|
71
|
-
}), n?.color ?
|
|
71
|
+
}), n?.color ? v(b, { sx: (e) => ({
|
|
72
72
|
position: "absolute",
|
|
73
73
|
top: 0,
|
|
74
74
|
left: 0,
|
|
75
75
|
right: 0,
|
|
76
76
|
height: "3px",
|
|
77
|
-
backgroundColor:
|
|
77
|
+
backgroundColor: F(n, e)?.fill
|
|
78
78
|
}) }) : null]
|
|
79
79
|
});
|
|
80
|
-
},
|
|
80
|
+
}, z = (e) => {
|
|
81
81
|
let { entry: t, category: n, onSelect: r } = e;
|
|
82
|
-
return
|
|
82
|
+
return y(S, {
|
|
83
83
|
className: "template-tile",
|
|
84
84
|
disableRipple: !0,
|
|
85
85
|
onClick: r,
|
|
@@ -102,17 +102,17 @@ var N = (e, n) => {
|
|
|
102
102
|
outlineOffset: "-2px"
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
-
children: [
|
|
105
|
+
children: [v(L, {
|
|
106
106
|
entry: t,
|
|
107
107
|
category: n
|
|
108
|
-
}),
|
|
108
|
+
}), y(b, {
|
|
109
109
|
sx: { minWidth: 0 },
|
|
110
|
-
children: [
|
|
110
|
+
children: [v(M, {
|
|
111
111
|
variant: "subtitle2",
|
|
112
112
|
component: "div",
|
|
113
113
|
noWrap: !0,
|
|
114
114
|
children: t.title
|
|
115
|
-
}), n ?
|
|
115
|
+
}), n ? y(M, {
|
|
116
116
|
variant: "caption",
|
|
117
117
|
component: "div",
|
|
118
118
|
noWrap: !0,
|
|
@@ -122,16 +122,16 @@ var N = (e, n) => {
|
|
|
122
122
|
alignItems: "center",
|
|
123
123
|
gap: .75
|
|
124
124
|
},
|
|
125
|
-
children: [n.color ?
|
|
125
|
+
children: [n.color ? v(b, {
|
|
126
126
|
component: "span",
|
|
127
127
|
sx: (e) => ({
|
|
128
128
|
width: "8px",
|
|
129
129
|
height: "8px",
|
|
130
130
|
borderRadius: "50%",
|
|
131
131
|
flex: "none",
|
|
132
|
-
backgroundColor:
|
|
132
|
+
backgroundColor: F(n, e)?.fill
|
|
133
133
|
})
|
|
134
|
-
}) : null,
|
|
134
|
+
}) : null, v(b, {
|
|
135
135
|
component: "span",
|
|
136
136
|
sx: {
|
|
137
137
|
overflow: "hidden",
|
|
@@ -142,7 +142,7 @@ var N = (e, n) => {
|
|
|
142
142
|
}) : null]
|
|
143
143
|
})]
|
|
144
144
|
});
|
|
145
|
-
},
|
|
145
|
+
}, B = () => y(b, {
|
|
146
146
|
sx: {
|
|
147
147
|
padding: 1,
|
|
148
148
|
display: "flex",
|
|
@@ -150,72 +150,72 @@ var N = (e, n) => {
|
|
|
150
150
|
gap: .75
|
|
151
151
|
},
|
|
152
152
|
children: [
|
|
153
|
-
|
|
153
|
+
v(A, {
|
|
154
154
|
variant: "rectangular",
|
|
155
155
|
sx: {
|
|
156
156
|
width: "100%",
|
|
157
157
|
height: "auto",
|
|
158
|
-
aspectRatio:
|
|
158
|
+
aspectRatio: I,
|
|
159
159
|
borderRadius: 1
|
|
160
160
|
}
|
|
161
161
|
}),
|
|
162
|
-
|
|
162
|
+
v(A, {
|
|
163
163
|
variant: "text",
|
|
164
164
|
width: "60%"
|
|
165
165
|
}),
|
|
166
|
-
|
|
166
|
+
v(A, {
|
|
167
167
|
variant: "text",
|
|
168
168
|
width: "35%"
|
|
169
169
|
})
|
|
170
170
|
]
|
|
171
|
-
}),
|
|
172
|
-
let { catalog: r, onSelect: i, filter:
|
|
173
|
-
|
|
174
|
-
let e =
|
|
175
|
-
t &&
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
}),
|
|
179
|
-
let e =
|
|
180
|
-
if (!
|
|
181
|
-
let t = new ResizeObserver(() =>
|
|
171
|
+
}), V = l(c((t, n) => {
|
|
172
|
+
let { catalog: r, onSelect: i, filter: c, groupBy: l, renderTile: u, tileMinWidth: g = 180, emptyLabel: _, visibleRows: S, sx: C = a.EmptyCssProperties, style: w, className: T, onKeyDown: E, ...D } = t, O = s(), k = m(null), [A, j] = h(0), N = m(null);
|
|
173
|
+
N.current = () => {
|
|
174
|
+
let e = k.current?.querySelector(".template-grid")?.firstElementChild, t = (e?.offsetHeight ? e : e?.firstElementChild)?.getBoundingClientRect().height;
|
|
175
|
+
t && j(t);
|
|
176
|
+
}, f(() => {
|
|
177
|
+
S && N.current?.();
|
|
178
|
+
}), d(() => {
|
|
179
|
+
let e = k.current;
|
|
180
|
+
if (!S || !e) return;
|
|
181
|
+
let t = new ResizeObserver(() => N.current?.());
|
|
182
182
|
return t.observe(e), () => t.disconnect();
|
|
183
|
-
}, [
|
|
184
|
-
let
|
|
185
|
-
let e =
|
|
186
|
-
if (!
|
|
183
|
+
}, [S]);
|
|
184
|
+
let P = p(() => new Map(r.categories.map((e) => [e.id, e])), [r.categories]), F = p(() => {
|
|
185
|
+
let e = c ? r.entries.filter(c) : r.entries;
|
|
186
|
+
if (!l) return [{
|
|
187
187
|
key: null,
|
|
188
188
|
entries: e
|
|
189
189
|
}];
|
|
190
190
|
let t = /* @__PURE__ */ new Map();
|
|
191
191
|
for (let e of r.categories) t.set(e.id, []);
|
|
192
192
|
for (let n of e) {
|
|
193
|
-
let e =
|
|
193
|
+
let e = l(n), r = t.get(e);
|
|
194
194
|
r || t.set(e, r = []), r.push(n);
|
|
195
195
|
}
|
|
196
196
|
return [...t].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
197
197
|
key: e,
|
|
198
|
-
title:
|
|
198
|
+
title: P.get(e)?.title ?? e,
|
|
199
199
|
entries: t
|
|
200
200
|
}));
|
|
201
201
|
}, [
|
|
202
202
|
r.entries,
|
|
203
203
|
r.categories,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
]),
|
|
204
|
+
P,
|
|
205
|
+
c,
|
|
206
|
+
l
|
|
207
|
+
]), I = {
|
|
208
208
|
display: "grid",
|
|
209
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${
|
|
209
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${g}px, 1fr))`,
|
|
210
210
|
gap: "8px"
|
|
211
|
-
},
|
|
212
|
-
return
|
|
211
|
+
}, L;
|
|
212
|
+
return L = r.status === "loading" ? v(b, {
|
|
213
213
|
className: "template-grid",
|
|
214
|
-
sx:
|
|
214
|
+
sx: I,
|
|
215
215
|
"aria-busy": "true",
|
|
216
|
-
"aria-label":
|
|
217
|
-
children: Array.from({ length: 6 }, (e, t) =>
|
|
218
|
-
}) : r.status === "error" ?
|
|
216
|
+
"aria-label": O("template.loading"),
|
|
217
|
+
children: Array.from({ length: 6 }, (e, t) => v(B, {}, t))
|
|
218
|
+
}) : r.status === "error" ? y(b, {
|
|
219
219
|
sx: {
|
|
220
220
|
display: "flex",
|
|
221
221
|
flexDirection: "column",
|
|
@@ -224,28 +224,28 @@ var N = (e, n) => {
|
|
|
224
224
|
padding: 4,
|
|
225
225
|
textAlign: "center"
|
|
226
226
|
},
|
|
227
|
-
children: [
|
|
227
|
+
children: [v(M, {
|
|
228
228
|
variant: "body2",
|
|
229
229
|
sx: { color: "text.secondary" },
|
|
230
|
-
children:
|
|
231
|
-
}),
|
|
230
|
+
children: O("template.loadFailed")
|
|
231
|
+
}), v(x, {
|
|
232
232
|
variant: "outlined",
|
|
233
233
|
size: "small",
|
|
234
234
|
onClick: r.retry,
|
|
235
|
-
children:
|
|
235
|
+
children: O("template.retry")
|
|
236
236
|
})]
|
|
237
|
-
}) :
|
|
237
|
+
}) : F.every((e) => e.entries.length === 0) ? v(M, {
|
|
238
238
|
variant: "body2",
|
|
239
239
|
sx: {
|
|
240
240
|
color: "text.secondary",
|
|
241
241
|
padding: 4,
|
|
242
242
|
textAlign: "center"
|
|
243
243
|
},
|
|
244
|
-
children:
|
|
245
|
-
}) :
|
|
244
|
+
children: _ ?? O("template.empty")
|
|
245
|
+
}) : F.map((e) => y(b, {
|
|
246
246
|
role: "group",
|
|
247
247
|
"aria-label": e.title,
|
|
248
|
-
children: [e.title ?
|
|
248
|
+
children: [e.title ? v(M, {
|
|
249
249
|
variant: "overline",
|
|
250
250
|
component: "div",
|
|
251
251
|
sx: {
|
|
@@ -253,40 +253,46 @@ var N = (e, n) => {
|
|
|
253
253
|
paddingX: 1
|
|
254
254
|
},
|
|
255
255
|
children: e.title
|
|
256
|
-
}) : null,
|
|
256
|
+
}) : null, v(b, {
|
|
257
257
|
className: "template-grid",
|
|
258
|
-
sx:
|
|
258
|
+
sx: I,
|
|
259
259
|
children: e.entries.map((e) => {
|
|
260
260
|
let t = {
|
|
261
|
-
category:
|
|
261
|
+
category: P.get(e.category),
|
|
262
262
|
onSelect: () => i?.(e)
|
|
263
263
|
};
|
|
264
|
-
return
|
|
264
|
+
return u ? v(b, {
|
|
265
265
|
sx: { display: "contents" },
|
|
266
|
-
children:
|
|
267
|
-
|
|
266
|
+
children: v(o, {
|
|
267
|
+
render: u,
|
|
268
|
+
props: {
|
|
269
|
+
entry: e,
|
|
270
|
+
...t
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
}, e.id) : v(z, {
|
|
268
274
|
entry: e,
|
|
269
275
|
...t
|
|
270
276
|
}, e.id);
|
|
271
277
|
})
|
|
272
278
|
})]
|
|
273
|
-
}, e.key ?? "")),
|
|
279
|
+
}, e.key ?? "")), v(b, {
|
|
274
280
|
ref: n,
|
|
275
|
-
className: e(
|
|
276
|
-
sx:
|
|
277
|
-
style:
|
|
281
|
+
className: e(T, "template-panel"),
|
|
282
|
+
sx: C,
|
|
283
|
+
style: S && A ? {
|
|
278
284
|
boxSizing: "content-box",
|
|
279
285
|
scrollbarGutter: "stable",
|
|
280
|
-
height: `${Math.ceil(
|
|
281
|
-
minHeight: `${Math.ceil(
|
|
282
|
-
...
|
|
283
|
-
} :
|
|
284
|
-
...
|
|
285
|
-
children:
|
|
286
|
-
ref:
|
|
286
|
+
height: `${Math.ceil(S * A + 8 * (S - 1))}px`,
|
|
287
|
+
minHeight: `${Math.ceil(A)}px`,
|
|
288
|
+
...w
|
|
289
|
+
} : w,
|
|
290
|
+
...D,
|
|
291
|
+
children: v(b, {
|
|
292
|
+
ref: k,
|
|
287
293
|
onKeyDown: (e) => {
|
|
288
|
-
if (
|
|
289
|
-
let t =
|
|
294
|
+
if (E?.(e), e.defaultPrevented) return;
|
|
295
|
+
let t = k.current;
|
|
290
296
|
if (!t) return;
|
|
291
297
|
let n = Array.from(t.querySelectorAll(".template-tile")), r = n.indexOf(document.activeElement);
|
|
292
298
|
if (r < 0) return;
|
|
@@ -316,12 +322,12 @@ var N = (e, n) => {
|
|
|
316
322
|
}
|
|
317
323
|
s = Math.max(0, Math.min(n.length - 1, s)), e.preventDefault(), n[s].focus();
|
|
318
324
|
},
|
|
319
|
-
children:
|
|
325
|
+
children: L
|
|
320
326
|
})
|
|
321
327
|
});
|
|
322
328
|
}));
|
|
323
|
-
|
|
324
|
-
var
|
|
329
|
+
V.displayName = "TemplatePanel";
|
|
330
|
+
var H = (e, t, n) => p(() => {
|
|
325
331
|
if (!t.trim() && n.length === 0) return;
|
|
326
332
|
let r = new Map(e.map((e) => [e.id, e])), i = n.length > 0 ? new Set(n) : null;
|
|
327
333
|
return (e) => !(i && !i.has(e.category)) && ((e, t, n) => {
|
|
@@ -337,9 +343,9 @@ var B = (e, t, n) => f(() => {
|
|
|
337
343
|
e,
|
|
338
344
|
t,
|
|
339
345
|
n
|
|
340
|
-
]),
|
|
346
|
+
]), U = [], W = (e) => {
|
|
341
347
|
let { category: t } = e;
|
|
342
|
-
return
|
|
348
|
+
return v(b, {
|
|
343
349
|
component: "span",
|
|
344
350
|
sx: (e) => ({
|
|
345
351
|
display: "inline-block",
|
|
@@ -347,18 +353,18 @@ var B = (e, t, n) => f(() => {
|
|
|
347
353
|
height: "10px",
|
|
348
354
|
borderRadius: "50%",
|
|
349
355
|
flex: "none",
|
|
350
|
-
backgroundColor:
|
|
356
|
+
backgroundColor: F(t, e)?.fill ?? e.palette.action.selected
|
|
351
357
|
})
|
|
352
358
|
});
|
|
353
|
-
},
|
|
359
|
+
}, G = (e) => {
|
|
354
360
|
let { category: t, onDelete: n } = e;
|
|
355
|
-
return
|
|
361
|
+
return v(C, {
|
|
356
362
|
size: "small",
|
|
357
363
|
label: t.title,
|
|
358
364
|
title: t.description,
|
|
359
365
|
onDelete: n,
|
|
360
366
|
sx: (e) => {
|
|
361
|
-
let n =
|
|
367
|
+
let n = F(t, e);
|
|
362
368
|
return {
|
|
363
369
|
marginY: .25,
|
|
364
370
|
marginRight: .5,
|
|
@@ -383,8 +389,8 @@ var B = (e, t, n) => f(() => {
|
|
|
383
389
|
};
|
|
384
390
|
}
|
|
385
391
|
});
|
|
386
|
-
},
|
|
387
|
-
let { value: t, onChange: n, categories: r, categoryIds: a =
|
|
392
|
+
}, ee = (e) => {
|
|
393
|
+
let { value: t, onChange: n, categories: r, categoryIds: a = U, onCategoryIdsChange: o, sx: c } = e, l = s(), u = m(null), [d, f] = h(null), b = !!o && (r?.length ?? 0) > 1, x = p(() => {
|
|
388
394
|
if (!b || a.length === 0) return [];
|
|
389
395
|
let e = new Map(r.map((e) => [e.id, e]));
|
|
390
396
|
return a.map((t) => e.get(t)).filter((e) => !!e);
|
|
@@ -392,20 +398,20 @@ var B = (e, t, n) => f(() => {
|
|
|
392
398
|
b,
|
|
393
399
|
r,
|
|
394
400
|
a
|
|
395
|
-
]),
|
|
396
|
-
|
|
397
|
-
},
|
|
398
|
-
|
|
399
|
-
}, M =
|
|
401
|
+
]), C = (e) => {
|
|
402
|
+
o?.(e), u.current?.focus();
|
|
403
|
+
}, A = () => {
|
|
404
|
+
f(null), u.current?.focus();
|
|
405
|
+
}, M = v(i, { iconKey: "Find" }), N = v(T, {
|
|
400
406
|
position: "start",
|
|
401
407
|
children: M
|
|
402
408
|
});
|
|
403
409
|
if (b) {
|
|
404
410
|
let e = l("template.filterByCategory");
|
|
405
|
-
N =
|
|
411
|
+
N = y(_, { children: [v(T, {
|
|
406
412
|
position: "start",
|
|
407
413
|
sx: { marginRight: .5 },
|
|
408
|
-
children:
|
|
414
|
+
children: y(S, {
|
|
409
415
|
"aria-label": e,
|
|
410
416
|
title: e,
|
|
411
417
|
"aria-haspopup": "menu",
|
|
@@ -413,7 +419,7 @@ var B = (e, t, n) => f(() => {
|
|
|
413
419
|
onMouseDown: (e) => {
|
|
414
420
|
e.button === 0 && e.preventDefault();
|
|
415
421
|
},
|
|
416
|
-
onClick: (e) =>
|
|
422
|
+
onClick: (e) => f(e.currentTarget),
|
|
417
423
|
sx: {
|
|
418
424
|
display: "flex",
|
|
419
425
|
alignItems: "center",
|
|
@@ -424,7 +430,7 @@ var B = (e, t, n) => f(() => {
|
|
|
424
430
|
color: "inherit",
|
|
425
431
|
"&:hover, &.Mui-focusVisible": { backgroundColor: "action.hover" }
|
|
426
432
|
},
|
|
427
|
-
children: [M,
|
|
433
|
+
children: [M, v(i, {
|
|
428
434
|
iconKey: "ExpandMore",
|
|
429
435
|
style: {
|
|
430
436
|
fontSize: "1rem",
|
|
@@ -432,23 +438,23 @@ var B = (e, t, n) => f(() => {
|
|
|
432
438
|
}
|
|
433
439
|
})]
|
|
434
440
|
})
|
|
435
|
-
}),
|
|
441
|
+
}), x.map((e) => v(G, {
|
|
436
442
|
category: e,
|
|
437
|
-
onDelete: () =>
|
|
443
|
+
onDelete: () => C(a.filter((t) => t !== e.id))
|
|
438
444
|
}, e.id))] });
|
|
439
445
|
}
|
|
440
|
-
let P = !!t ||
|
|
441
|
-
return
|
|
446
|
+
let P = !!t || x.length > 0;
|
|
447
|
+
return y(_, { children: [v(j, {
|
|
442
448
|
size: "small",
|
|
443
449
|
value: t,
|
|
444
|
-
placeholder:
|
|
450
|
+
placeholder: x.length > 0 ? void 0 : l("template.search"),
|
|
445
451
|
inputRef: u,
|
|
446
452
|
onChange: (e) => n(e.target.value),
|
|
447
453
|
onKeyDown: (e) => {
|
|
448
|
-
if (e.key === "Escape" && P) e.stopPropagation(), t ? n("") :
|
|
449
|
-
else if (e.key === "Backspace" &&
|
|
454
|
+
if (e.key === "Escape" && P) e.stopPropagation(), t ? n("") : C([]);
|
|
455
|
+
else if (e.key === "Backspace" && x.length > 0) {
|
|
450
456
|
let t = u.current;
|
|
451
|
-
e.target === t && t.selectionStart === 0 && t.selectionEnd === 0 && (e.preventDefault(),
|
|
457
|
+
e.target === t && t.selectionStart === 0 && t.selectionEnd === 0 && (e.preventDefault(), C(a.slice(0, -1)));
|
|
452
458
|
}
|
|
453
459
|
},
|
|
454
460
|
sx: c,
|
|
@@ -480,18 +486,18 @@ var B = (e, t, n) => f(() => {
|
|
|
480
486
|
}
|
|
481
487
|
},
|
|
482
488
|
startAdornment: N,
|
|
483
|
-
endAdornment: P ?
|
|
489
|
+
endAdornment: P ? v(T, {
|
|
484
490
|
position: "end",
|
|
485
|
-
children:
|
|
491
|
+
children: v(g, {
|
|
486
492
|
"aria-label": l("template.clearSearch"),
|
|
487
493
|
propsTooltip: { label: l("template.clearSearch") },
|
|
488
494
|
onMouseDown: (e) => {
|
|
489
495
|
e.button === 0 && e.preventDefault();
|
|
490
496
|
},
|
|
491
497
|
onClick: () => {
|
|
492
|
-
n(""),
|
|
498
|
+
n(""), C([]);
|
|
493
499
|
},
|
|
494
|
-
icon:
|
|
500
|
+
icon: v(i, { iconKey: "Close" }),
|
|
495
501
|
size: "small"
|
|
496
502
|
})
|
|
497
503
|
}) : void 0
|
|
@@ -502,10 +508,10 @@ var B = (e, t, n) => f(() => {
|
|
|
502
508
|
"aria-label": l("template.search")
|
|
503
509
|
}
|
|
504
510
|
}
|
|
505
|
-
}), b ?
|
|
511
|
+
}), b ? y(O, {
|
|
506
512
|
anchorEl: d,
|
|
507
513
|
open: !!d,
|
|
508
|
-
onClose:
|
|
514
|
+
onClose: A,
|
|
509
515
|
disableRestoreFocus: !0,
|
|
510
516
|
slotProps: { list: {
|
|
511
517
|
dense: !0,
|
|
@@ -513,16 +519,16 @@ var B = (e, t, n) => f(() => {
|
|
|
513
519
|
} },
|
|
514
520
|
children: [r.map((e) => {
|
|
515
521
|
let t = a.includes(e.id);
|
|
516
|
-
return
|
|
522
|
+
return y(k, {
|
|
517
523
|
selected: t,
|
|
518
524
|
title: e.description,
|
|
519
525
|
onClick: () => {
|
|
520
|
-
|
|
526
|
+
o(t ? a.filter((t) => t !== e.id) : [...a, e.id]), A();
|
|
521
527
|
},
|
|
522
528
|
children: [
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
t ?
|
|
529
|
+
v(E, { children: v(W, { category: e }) }),
|
|
530
|
+
v(D, { children: e.title }),
|
|
531
|
+
t ? v(i, {
|
|
526
532
|
iconKey: "Check",
|
|
527
533
|
style: {
|
|
528
534
|
fontSize: "1rem",
|
|
@@ -531,52 +537,52 @@ var B = (e, t, n) => f(() => {
|
|
|
531
537
|
}) : null
|
|
532
538
|
]
|
|
533
539
|
}, e.id);
|
|
534
|
-
}),
|
|
540
|
+
}), x.length > 0 ? [v(w, {}, "divider"), y(k, {
|
|
535
541
|
onClick: () => {
|
|
536
|
-
|
|
542
|
+
o([]), A();
|
|
537
543
|
},
|
|
538
|
-
children: [
|
|
544
|
+
children: [v(E, {}), v(D, { children: l("template.allCategories") })]
|
|
539
545
|
}, "all")] : null]
|
|
540
546
|
}) : null] });
|
|
541
|
-
},
|
|
542
|
-
let n = `${e}${e.endsWith("/") ? "" : "/"}${
|
|
547
|
+
}, K = P(n), q = `https://unpkg.com/@sheetxl/templates-workbook${K ? `@${K}` : ""}/dist`, J = "templates-workbook", Y = (e) => e.replace(/\.[^/.]+$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), X = (e, t) => {
|
|
548
|
+
let n = `${e}${e.endsWith("/") ? "" : "/"}${J}/${t}`;
|
|
543
549
|
return typeof document > "u" ? n : new URL(n, document.baseURI).href;
|
|
544
|
-
},
|
|
545
|
-
let t =
|
|
550
|
+
}, Z = (e) => typeof e == "string" && e ? e : void 0, Q = /* @__PURE__ */ new Map(), $ = (e = q) => {
|
|
551
|
+
let t = Q.get(e);
|
|
546
552
|
return t || (t = (async () => {
|
|
547
|
-
let t = (await
|
|
553
|
+
let t = (await N("templates", J, e)).find((e) => e.meta?.schema !== void 0);
|
|
548
554
|
if (!t) throw Error(`No template catalog found at '${e}'.`);
|
|
549
555
|
return Math.floor(Number(t.meta?.schema)) === 1 ? ((e, t) => {
|
|
550
556
|
let n = Array.isArray(e.meta?.categories) ? e.meta.categories : [], r = [], i = /* @__PURE__ */ new Set();
|
|
551
557
|
for (let e of n) {
|
|
552
|
-
let t =
|
|
558
|
+
let t = Z(e?.id);
|
|
553
559
|
t && !i.has(t) && (i.add(t), r.push({
|
|
554
560
|
id: t,
|
|
555
|
-
title:
|
|
556
|
-
description:
|
|
557
|
-
icon:
|
|
558
|
-
color:
|
|
561
|
+
title: Z(e.title) ?? Y(t),
|
|
562
|
+
description: Z(e.description),
|
|
563
|
+
icon: Z(e.icon),
|
|
564
|
+
color: Z(e.color)
|
|
559
565
|
}));
|
|
560
566
|
}
|
|
561
567
|
let a = [];
|
|
562
568
|
for (let n of e.entries) {
|
|
563
569
|
let e = n.path, o = e.split("/");
|
|
564
570
|
if (o.length !== 2 || !/\.(?:xlsx|sxl|csv)$/i.test(e)) continue;
|
|
565
|
-
let s =
|
|
571
|
+
let s = Z(n.category) ?? o[0];
|
|
566
572
|
i.has(s) || (i.add(s), r.push({
|
|
567
573
|
id: s,
|
|
568
|
-
title:
|
|
574
|
+
title: Y(s)
|
|
569
575
|
}));
|
|
570
|
-
let c =
|
|
576
|
+
let c = Z(n.thumbnail), l = Z(n.thumbnailDark);
|
|
571
577
|
a.push({
|
|
572
578
|
id: e,
|
|
573
|
-
title:
|
|
579
|
+
title: Z(n.title) ?? Y(o[1]),
|
|
574
580
|
category: s,
|
|
575
|
-
description:
|
|
581
|
+
description: Z(n.description),
|
|
576
582
|
tags: Array.isArray(n.tags) ? n.tags.filter((e) => typeof e == "string") : void 0,
|
|
577
|
-
thumbnailUrl: c ?
|
|
578
|
-
thumbnailDarkUrl: l ?
|
|
579
|
-
sourceUrl:
|
|
583
|
+
thumbnailUrl: c ? X(t, c) : void 0,
|
|
584
|
+
thumbnailDarkUrl: l ? X(t, l) : void 0,
|
|
585
|
+
sourceUrl: X(t, e)
|
|
580
586
|
});
|
|
581
587
|
}
|
|
582
588
|
return {
|
|
@@ -587,22 +593,22 @@ var B = (e, t, n) => f(() => {
|
|
|
587
593
|
categories: [],
|
|
588
594
|
entries: []
|
|
589
595
|
});
|
|
590
|
-
})(),
|
|
591
|
-
|
|
596
|
+
})(), Q.set(e, t), t.catch(() => {
|
|
597
|
+
Q.delete(e);
|
|
592
598
|
})), t;
|
|
593
|
-
},
|
|
594
|
-
let { path: t =
|
|
599
|
+
}, te = (e = {}) => {
|
|
600
|
+
let { path: t = q } = e, [n, r] = h(0), [i, a] = h({
|
|
595
601
|
status: "loading",
|
|
596
602
|
categories: [],
|
|
597
603
|
entries: []
|
|
598
604
|
});
|
|
599
|
-
return
|
|
605
|
+
return d(() => {
|
|
600
606
|
let e = !1;
|
|
601
607
|
return a((e) => e.status === "loading" ? e : {
|
|
602
608
|
status: "loading",
|
|
603
609
|
categories: [],
|
|
604
610
|
entries: []
|
|
605
|
-
}),
|
|
611
|
+
}), $(t).then((t) => {
|
|
606
612
|
e || a({
|
|
607
613
|
status: "ready",
|
|
608
614
|
...t
|
|
@@ -619,9 +625,9 @@ var B = (e, t, n) => f(() => {
|
|
|
619
625
|
};
|
|
620
626
|
}, [t, n]), {
|
|
621
627
|
...i,
|
|
622
|
-
retry:
|
|
628
|
+
retry: u(() => {
|
|
623
629
|
r((e) => e + 1);
|
|
624
630
|
}, [])
|
|
625
631
|
};
|
|
626
632
|
};
|
|
627
|
-
export {
|
|
633
|
+
export { V as a, H as i, te as n, ee as r, $ as t };
|