@sheetxl/studio-mui 0.8.0-beta.1 → 0.8.0-beta.3
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/3k_KqDFr-AybPztc.cjs +5 -0
- package/browser/cjs/{zQsyZpeXAvcVXJMs.cjs → 3uprnzi2l0iT17Dg.cjs} +1 -1
- package/browser/cjs/B9GcCj7sj8XdjPZF.cjs +1 -0
- package/browser/cjs/{CJLwX_A3y3TQUmzj.cjs → BGvoJjUs21bbuE1i.cjs} +1 -1
- package/browser/cjs/{CYxc8vnRi8dNpDPk.cjs → BHb7TnK1NmimV4OX.cjs} +1 -1
- package/browser/cjs/BJ-wdkCaXqJaejKf.cjs +1 -0
- package/browser/cjs/BQMCM3iFn4MNWAkB.cjs +1 -0
- package/browser/cjs/BXkdjAb4jpTr412c.cjs +1 -0
- package/browser/cjs/Bc-YisjBtD56vBAW.cjs +1 -0
- package/browser/cjs/Bi26L7L89ZK_y5Pk.cjs +1 -0
- package/browser/cjs/CucKgy044KxMHXrx.cjs +13 -0
- package/browser/cjs/Cy_XmYq6BsWmCXkk.cjs +3 -0
- package/browser/cjs/Dq9lIOzvxW3EKYkD.cjs +8 -0
- package/browser/cjs/M0_dvdYwhikqP9kg.cjs +2 -0
- package/browser/cjs/QI6GKw7uo1f8gY8C.cjs +1 -0
- package/browser/cjs/eCw4rAEIYE3BftpG.cjs +1 -0
- package/browser/cjs/iFPhqab5w95hHEsT.cjs +1 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{zWTZ8BvT4hjgC2ua.mjs → 5g7MBAjbFzuopMX2.mjs} +2 -2
- package/browser/esm/B1W2xsRdzsYUrUHN.mjs +12903 -0
- package/browser/esm/{UJOXCQv6KrG1gY3l.mjs → B4D1LSp8TE_B0AMm.mjs} +8 -16
- package/browser/esm/{Bz5LiUe3SZ8g42Ia.mjs → B52mSQ33rrDgVfpp.mjs} +1 -1
- package/browser/esm/{DNDrQKMTzKzNMjl-.mjs → BPrlXHjf0rCkbBBI.mjs} +1 -1
- package/browser/esm/BZd916TsMZ7YvxWP.mjs +293 -0
- package/browser/esm/{Cd6n1XUgF0VItpkH.mjs → BaEXUwMO4qxI8cAG.mjs} +1 -1
- package/browser/esm/{CDU0rqpLNVtMLI-f.mjs → BbIR6fcRDFkeZXY0.mjs} +1 -1
- package/browser/esm/{CVBub6pgTsJzCc5m.mjs → BmThVkDnqURs7csb.mjs} +2100 -2214
- package/browser/esm/{CVfuCNRpODUw04IH.mjs → Bz1JPslneg_PywLn.mjs} +1 -1
- package/browser/esm/{rU8xNPVQtDSnujM-.mjs → CBtvZnCU5MNRuW6b.mjs} +3 -3
- package/browser/esm/CWSv0l0QyooaSl9L.mjs +268 -0
- package/browser/esm/{BUGepznywvV0tUjW.mjs → Cq9FaaUpYJPogPlO.mjs} +2 -2
- package/browser/esm/{3ydDykDMtDYbfVVn.mjs → D0TdGLsNoKJ8y8nS.mjs} +113 -111
- package/browser/esm/{CBU3LgLYmqtQjJbu.mjs → D5VhIdFEqZBP23Ch.mjs} +1 -1
- package/browser/esm/{BoLxSRdEWt-Yg2RI.mjs → DAmyMhko6L63rwJo.mjs} +130 -103
- package/browser/esm/{Cj2pgCNqBCGl4rTX.mjs → DKyW2a-ZhqkFjZvH.mjs} +569 -540
- package/browser/esm/DSAOtFgAoMMKXSJb.mjs +152 -0
- package/browser/esm/De_bbgjFGMBk8KXa.mjs +117 -0
- package/browser/esm/Dkw9Yr0Bp5RI5pRw.mjs +222 -0
- package/browser/esm/MplcRTnOYfsuQGe3.mjs +410 -0
- package/browser/esm/{DMLXV4EKl1NCp_jk.mjs → U9pABiBV0P__iZJE.mjs} +3 -3
- package/browser/esm/{ChwS_ougBsogOEsP.mjs → _7FBRywOYc4gCFK2.mjs} +2 -2
- package/browser/esm/cLX3kRi9vDkGiZwr.mjs +115 -0
- package/browser/esm/index.mjs +466 -135
- package/browser/esm/{BZBJG2tDdD3-VujP.mjs → krJU2tCMk9QwcRcw.mjs} +195 -174
- package/licenses/dependencies.txt +73 -73
- package/node/esm/BSj2vMFtYCJk4miD.mjs +4462 -0
- package/node/esm/{BwZcoHDBmLPIVOT5.mjs → Byoa9Sx18Y73xJBM.mjs} +1 -1
- package/node/esm/{C-boHCnJditFzng3.mjs → C0yEFO9L8odxQW-z.mjs} +32 -40
- package/node/esm/{CHi3AuWEwEPOg9IZ.mjs → C6ookLy8qjozoGUP.mjs} +1 -1
- package/node/esm/{DXZrzWee8K5FPOW1.mjs → CF-mBw8E2TnnbVJp.mjs} +2 -2
- package/node/esm/CQtseVjtpzUKq41p.mjs +294 -0
- package/node/esm/{BhqI3pQFkV8K_612.mjs → C_xnlCmxuBdmK2nV.mjs} +1 -1
- package/node/esm/CvZ05tWUwCH6MJas.mjs +268 -0
- package/node/esm/{yCHAZKxJR7qY_ySy.mjs → D1uCpJvXqZ16A3-X.mjs} +143 -141
- package/node/esm/{DM7K7-284z-PczVz.mjs → DbzH9CwsCrtCs4Ug.mjs} +1 -1
- package/node/esm/{Qpuqm6xBr_da38Ht.mjs → DdBJbvx8UwH8CmkE.mjs} +163 -135
- package/node/esm/DlNtuQ_K-rgj0iJU.mjs +116 -0
- package/node/esm/Dsc5FSbIPxmlRzwV.mjs +414 -0
- package/node/esm/index.mjs +7716 -4114
- package/node/esm/k8Q5jiL-22BAHe4i.mjs +115 -0
- package/node/esm/{CUMKTjYv6VTkcWYi.mjs → oLdQArapyVclkMMy.mjs} +1 -1
- package/node/esm/{BA7VzUQ2sKRLTZ5c.mjs → pZBq3MVKHmZiBS8U.mjs} +1 -1
- package/package.json +9 -9
- package/resources/locales/de/groups.cmd.json +24 -6
- package/resources/locales/de/studio.cmd.json +18 -1
- package/resources/locales/de/ui.msg.json +251 -30
- package/resources/locales/en/groups.cmd.json +24 -6
- package/resources/locales/en/studio.cmd.json +18 -1
- package/resources/locales/en/ui.msg.json +202 -30
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +11 -1
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +14 -0
- package/types/src/anchorItems/AnchoredRangeField.d.ts +40 -0
- package/types/src/anchorItems/index.d.ts +1 -0
- package/types/src/border/BorderPopupButton.d.ts +6 -6
- package/types/src/border/BorderStylePopupButton.d.ts +3 -3
- package/types/src/border/BorderTemplateIcon.d.ts +24 -0
- package/types/src/border/index.d.ts +1 -0
- package/types/src/color/ColorPanel.d.ts +8 -2
- package/types/src/color/ColorPopupButton.d.ts +2 -1
- package/types/src/command/NumberFormatQuickButtons.d.ts +32 -0
- package/types/src/conditions/BetweenOption.d.ts +1 -1
- package/types/src/conditions/ConditionEditor.d.ts +6 -1
- package/types/src/conditions/ConditionUtils.d.ts +31 -0
- package/types/src/conditions/DateTimeOption.d.ts +4 -4
- package/types/src/conditions/ExpressionOption.d.ts +6 -6
- package/types/src/conditions/ListSourceOption.d.ts +31 -0
- package/types/src/conditions/ScalarOption.d.ts +6 -6
- package/types/src/conditions/index.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +54 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +7 -1
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -2
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +9 -2
- package/types/src/dataValidation/DataValidationIcon.d.ts +22 -0
- package/types/src/dataValidation/DataValidationTitle.d.ts +13 -0
- package/types/src/dialog/FillSeriesDialog.d.ts +16 -0
- package/types/src/dialog/TableNewDialog.d.ts +1 -4
- package/types/src/dialog/index.d.ts +0 -1
- package/types/src/externalLink/ExternalLinkCardBody.d.ts +9 -0
- package/types/src/externalLink/ExternalLinkChip.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkLocation.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +18 -0
- package/types/src/externalLink/ExternalLinksPanel.d.ts +11 -0
- package/types/src/externalLink/ExternalLinksPlugin.d.ts +5 -0
- package/types/src/externalLink/ExternalLinksTaskPane.d.ts +19 -0
- package/types/src/externalLink/index.d.ts +8 -0
- package/types/src/fill/GradientEditor.d.ts +39 -0
- package/types/src/fill/PatternPopupButton.d.ts +26 -0
- package/types/src/fill/PatternSwatch.d.ts +53 -0
- package/types/src/fill/index.d.ts +4 -0
- package/types/src/filter/FilterList.d.ts +9 -6
- package/types/src/form/FormulaField.d.ts +25 -2
- package/types/src/form/InputField.d.ts +30 -0
- package/types/src/format/AlignmentPanel.d.ts +14 -0
- package/types/src/format/BorderPanel.d.ts +22 -0
- package/types/src/format/BorderPreview.d.ts +84 -0
- package/types/src/format/FillPanel.d.ts +25 -0
- package/types/src/format/FontPanel.d.ts +12 -0
- package/types/src/format/FormatCellPreview.d.ts +35 -0
- package/types/src/format/FormatPanelParts.d.ts +83 -0
- package/types/src/format/FormatPlugin.d.ts +11 -0
- package/types/src/format/FormatTaskPane.d.ts +39 -0
- package/types/src/format/NumberFormatOption.d.ts +43 -0
- package/types/src/{numberFormat → format}/NumberFormatPanel.d.ts +20 -0
- package/types/src/format/index.d.ts +13 -0
- package/types/src/format/useFormatSelection.d.ts +92 -0
- package/types/src/index.d.ts +3 -1
- package/types/src/itemsPanel/EditorPanel.d.ts +5 -1
- package/types/src/itemsPanel/ItemCard.d.ts +10 -1
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +55 -19
- package/types/src/itemsPanel/ItemsPanel.d.ts +9 -0
- package/types/src/named/NamedDetailsPanel.d.ts +9 -2
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -2
- package/types/src/named/NamedEditorPanel.d.ts +1 -1
- package/types/src/named/NamedExpressionField.d.ts +32 -0
- package/types/src/named/NamedKindChip.d.ts +38 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +6 -0
- package/types/src/protectedRange/ProtectedRangeDraft.d.ts +22 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +0 -14
- package/types/src/protectedRange/index.d.ts +2 -1
- package/types/src/protection/ManageProtectionTaskPane.d.ts +29 -0
- package/types/src/protection/PasswordDialog.d.ts +32 -0
- package/types/src/protection/PasswordField.d.ts +35 -0
- package/types/src/protection/ProtectedCellsPanel.d.ts +20 -0
- package/types/src/protection/ProtectionPlugin.d.ts +11 -0
- package/types/src/protection/SheetProtectionPanel.d.ts +35 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +34 -15
- package/types/src/protection/WorkbookProtectionTab.d.ts +22 -0
- package/types/src/protection/index.d.ts +7 -1
- package/types/src/studio/CommandsWrapper.d.ts +3 -0
- package/types/src/studio/EagerStudio.d.ts +14 -1
- package/types/src/studio/StudioCommandProvider.d.ts +3 -0
- package/types/src/studio/StudioCommands.d.ts +38 -2
- package/types/src/studio/StudioProps.d.ts +41 -0
- package/types/src/studio/splitStudioProps.d.ts +7 -0
- package/types/src/studio/useStudioApp.d.ts +20 -1
- package/types/src/template/TemplateCommands.d.ts +29 -0
- package/types/src/template/TemplateDialog.d.ts +19 -0
- package/types/src/template/TemplatePanel.d.ts +50 -0
- package/types/src/template/TemplateSearchField.d.ts +13 -0
- package/types/src/template/WelcomeDialog.d.ts +29 -0
- package/types/src/template/index.d.ts +3 -0
- package/types/src/template/useTemplateCatalog.d.ts +69 -0
- package/types/src/workbook/DefaultRenderers.d.ts +2 -0
- package/types/src/workbook/FillMenu.d.ts +21 -0
- package/types/src/workbook/index.d.ts +1 -0
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +0 -1
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +0 -2
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +0 -2
- package/browser/cjs/Bte6P3MhSjajJmmY.cjs +0 -7
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +0 -1
- package/browser/cjs/Cm1APq2MraYNNhyI.cjs +0 -1
- package/browser/cjs/DO8V31Z1ewgMA1di.cjs +0 -5
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +0 -1
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +0 -1
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +0 -1
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +0 -1
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +0 -1
- package/browser/cjs/z0rB4fK6X1M6PpVD.cjs +0 -11
- package/browser/esm/BuY3uV47Bwbqpasq.mjs +0 -219
- package/browser/esm/CAs1MWvJTcRfJy26.mjs +0 -217
- package/browser/esm/C_XvSsQ9BVdHffCO.mjs +0 -47
- package/browser/esm/FT29q8yNwsEpVZjt.mjs +0 -9257
- package/browser/esm/Hb1rlHT4tE5hLcjM.mjs +0 -82
- package/browser/esm/s46El7mT6oKLSnYB.mjs +0 -411
- package/node/esm/9FY82fj1R1c-AczW.mjs +0 -47
- package/node/esm/DxXM8qHi0Oz4Zovl.mjs +0 -4575
- package/node/esm/sQt2wWGTRLzqeJdG.mjs +0 -82
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +0 -32
- package/types/src/conditions/InSetOption.d.ts +0 -37
- package/types/src/dialog/NumberFormatDialog.d.ts +0 -12
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +0 -12
- package/types/src/numberFormat/index.d.ts +0 -8
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +0 -3
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +0 -2
- package/types/src/protection/WorkbookProtectionDialog.d.ts +0 -23
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.3
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { t as e } from "./BaEXUwMO4qxI8cAG.mjs";
|
|
8
|
+
import { useGridColorScheme as t } from "@sheetxl/react";
|
|
9
|
+
import { DynamicIcon as n, ReactUtils as r, useTranslator as i } from "@sheetxl/utils-react";
|
|
10
|
+
import { forwardRef as a, memo as o, useCallback as s, useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import { ExhibitIconButton as p } from "@sheetxl/utils-mui";
|
|
12
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
|
+
import { Box as g, Button as _, ButtonBase as v, InputAdornment as y, Skeleton as b, TextField as x, Typography as S } from "@mui/material";
|
|
14
|
+
import { listResources as C } from "@sheetxl/utils";
|
|
15
|
+
var w = "8 / 5", T = (e) => {
|
|
16
|
+
let { entry: n } = e, r = (t() === "dark" ? n.thumbnailDarkUrl : void 0) ?? n.thumbnailUrl;
|
|
17
|
+
return m(E, { src: r }, r);
|
|
18
|
+
}, E = (e) => {
|
|
19
|
+
let { src: t } = e, [r, i] = f(t ? "loading" : "failed");
|
|
20
|
+
return m(g, {
|
|
21
|
+
className: "template-thumbnail",
|
|
22
|
+
sx: {
|
|
23
|
+
position: "relative",
|
|
24
|
+
width: "100%",
|
|
25
|
+
aspectRatio: w,
|
|
26
|
+
overflow: "hidden",
|
|
27
|
+
borderRadius: 1,
|
|
28
|
+
border: (e) => `1px solid ${e.palette.divider}`,
|
|
29
|
+
background: (e) => e.palette.background.paper,
|
|
30
|
+
transition: "border-color 150ms, box-shadow 150ms",
|
|
31
|
+
display: "flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "center"
|
|
34
|
+
},
|
|
35
|
+
children: r === "failed" ? m(n, {
|
|
36
|
+
iconKey: "FileNew",
|
|
37
|
+
style: {
|
|
38
|
+
fontSize: "2.5rem",
|
|
39
|
+
opacity: .4
|
|
40
|
+
}
|
|
41
|
+
}) : m("img", {
|
|
42
|
+
src: t,
|
|
43
|
+
alt: "",
|
|
44
|
+
loading: "lazy",
|
|
45
|
+
draggable: !1,
|
|
46
|
+
onLoad: () => i("loaded"),
|
|
47
|
+
onError: () => i("failed"),
|
|
48
|
+
style: {
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%",
|
|
51
|
+
objectFit: "cover",
|
|
52
|
+
objectPosition: "top left",
|
|
53
|
+
opacity: +(r === "loaded"),
|
|
54
|
+
transition: "opacity 150ms ease-out"
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}, D = (e) => {
|
|
59
|
+
let { entry: t, category: n, onSelect: r } = e;
|
|
60
|
+
return h(v, {
|
|
61
|
+
className: "template-tile",
|
|
62
|
+
disableRipple: !0,
|
|
63
|
+
onClick: r,
|
|
64
|
+
"aria-label": n ? `${t.title}, ${n.title}` : t.title,
|
|
65
|
+
title: t.description,
|
|
66
|
+
sx: {
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "column",
|
|
69
|
+
alignItems: "stretch",
|
|
70
|
+
textAlign: "left",
|
|
71
|
+
gap: .75,
|
|
72
|
+
padding: 1,
|
|
73
|
+
borderRadius: 1,
|
|
74
|
+
"&:hover .template-thumbnail, &.Mui-focusVisible .template-thumbnail": {
|
|
75
|
+
borderColor: (e) => e.palette.primary.main,
|
|
76
|
+
boxShadow: 3
|
|
77
|
+
},
|
|
78
|
+
"&.Mui-focusVisible": {
|
|
79
|
+
outline: (e) => `2px solid ${e.palette.primary.main}`,
|
|
80
|
+
outlineOffset: "-2px"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
children: [m(T, { entry: t }), h(g, {
|
|
84
|
+
sx: { minWidth: 0 },
|
|
85
|
+
children: [m(S, {
|
|
86
|
+
variant: "subtitle2",
|
|
87
|
+
component: "div",
|
|
88
|
+
noWrap: !0,
|
|
89
|
+
children: t.title
|
|
90
|
+
}), n ? m(S, {
|
|
91
|
+
variant: "caption",
|
|
92
|
+
component: "div",
|
|
93
|
+
noWrap: !0,
|
|
94
|
+
sx: { color: "text.secondary" },
|
|
95
|
+
children: n.title
|
|
96
|
+
}) : null]
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
}, O = () => h(g, {
|
|
100
|
+
sx: {
|
|
101
|
+
padding: 1,
|
|
102
|
+
display: "flex",
|
|
103
|
+
flexDirection: "column",
|
|
104
|
+
gap: .75
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
m(b, {
|
|
108
|
+
variant: "rectangular",
|
|
109
|
+
sx: {
|
|
110
|
+
width: "100%",
|
|
111
|
+
height: "auto",
|
|
112
|
+
aspectRatio: w,
|
|
113
|
+
borderRadius: 1
|
|
114
|
+
}
|
|
115
|
+
}),
|
|
116
|
+
m(b, {
|
|
117
|
+
variant: "text",
|
|
118
|
+
width: "60%"
|
|
119
|
+
}),
|
|
120
|
+
m(b, {
|
|
121
|
+
variant: "text",
|
|
122
|
+
width: "35%"
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}), k = o(a((t, n) => {
|
|
126
|
+
let { catalog: a, onSelect: o, filter: s, groupBy: p, renderTile: v, tileMinWidth: y = 180, emptyLabel: b, visibleRows: x, sx: C = r.EmptyCssProperties, style: w, className: T, onKeyDown: E, ...k } = t, A = i(), j = d(null), [M, N] = f(0), P = d(null);
|
|
127
|
+
P.current = () => {
|
|
128
|
+
let e = j.current?.querySelector(".template-grid")?.firstElementChild, t = (e?.offsetHeight ? e : e?.firstElementChild)?.getBoundingClientRect().height;
|
|
129
|
+
t && N(t);
|
|
130
|
+
}, l(() => {
|
|
131
|
+
x && P.current?.();
|
|
132
|
+
}), c(() => {
|
|
133
|
+
let e = j.current;
|
|
134
|
+
if (!x || !e) return;
|
|
135
|
+
let t = new ResizeObserver(() => P.current?.());
|
|
136
|
+
return t.observe(e), () => t.disconnect();
|
|
137
|
+
}, [x]);
|
|
138
|
+
let F = u(() => new Map(a.categories.map((e) => [e.id, e])), [a.categories]), I = u(() => {
|
|
139
|
+
let e = s ? a.entries.filter(s) : a.entries;
|
|
140
|
+
if (!p) return [{
|
|
141
|
+
key: null,
|
|
142
|
+
entries: e
|
|
143
|
+
}];
|
|
144
|
+
let t = /* @__PURE__ */ new Map();
|
|
145
|
+
for (let e of a.categories) t.set(e.id, []);
|
|
146
|
+
for (let n of e) {
|
|
147
|
+
let e = p(n), r = t.get(e);
|
|
148
|
+
r || t.set(e, r = []), r.push(n);
|
|
149
|
+
}
|
|
150
|
+
return [...t].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
151
|
+
key: e,
|
|
152
|
+
title: F.get(e)?.title ?? e,
|
|
153
|
+
entries: t
|
|
154
|
+
}));
|
|
155
|
+
}, [
|
|
156
|
+
a.entries,
|
|
157
|
+
a.categories,
|
|
158
|
+
F,
|
|
159
|
+
s,
|
|
160
|
+
p
|
|
161
|
+
]), L = {
|
|
162
|
+
display: "grid",
|
|
163
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${y}px, 1fr))`,
|
|
164
|
+
gap: "8px"
|
|
165
|
+
}, R;
|
|
166
|
+
return R = a.status === "loading" ? m(g, {
|
|
167
|
+
className: "template-grid",
|
|
168
|
+
sx: L,
|
|
169
|
+
"aria-busy": "true",
|
|
170
|
+
"aria-label": A("template.loading"),
|
|
171
|
+
children: Array.from({ length: 6 }, (e, t) => m(O, {}, t))
|
|
172
|
+
}) : a.status === "error" ? h(g, {
|
|
173
|
+
sx: {
|
|
174
|
+
display: "flex",
|
|
175
|
+
flexDirection: "column",
|
|
176
|
+
alignItems: "center",
|
|
177
|
+
gap: 1,
|
|
178
|
+
padding: 4,
|
|
179
|
+
textAlign: "center"
|
|
180
|
+
},
|
|
181
|
+
children: [m(S, {
|
|
182
|
+
variant: "body2",
|
|
183
|
+
sx: { color: "text.secondary" },
|
|
184
|
+
children: A("template.loadFailed")
|
|
185
|
+
}), m(_, {
|
|
186
|
+
variant: "outlined",
|
|
187
|
+
size: "small",
|
|
188
|
+
onClick: a.retry,
|
|
189
|
+
children: A("template.retry")
|
|
190
|
+
})]
|
|
191
|
+
}) : I.every((e) => e.entries.length === 0) ? m(S, {
|
|
192
|
+
variant: "body2",
|
|
193
|
+
sx: {
|
|
194
|
+
color: "text.secondary",
|
|
195
|
+
padding: 4,
|
|
196
|
+
textAlign: "center"
|
|
197
|
+
},
|
|
198
|
+
children: b ?? A("template.empty")
|
|
199
|
+
}) : I.map((e) => h(g, {
|
|
200
|
+
role: "group",
|
|
201
|
+
"aria-label": e.title,
|
|
202
|
+
children: [e.title ? m(S, {
|
|
203
|
+
variant: "overline",
|
|
204
|
+
component: "div",
|
|
205
|
+
sx: {
|
|
206
|
+
color: "text.secondary",
|
|
207
|
+
paddingX: 1
|
|
208
|
+
},
|
|
209
|
+
children: e.title
|
|
210
|
+
}) : null, m(g, {
|
|
211
|
+
className: "template-grid",
|
|
212
|
+
sx: L,
|
|
213
|
+
children: e.entries.map((e) => {
|
|
214
|
+
let t = {
|
|
215
|
+
category: F.get(e.category),
|
|
216
|
+
onSelect: () => o?.(e)
|
|
217
|
+
};
|
|
218
|
+
return v ? m(g, {
|
|
219
|
+
sx: { display: "contents" },
|
|
220
|
+
children: v(e, t)
|
|
221
|
+
}, e.id) : m(D, {
|
|
222
|
+
entry: e,
|
|
223
|
+
...t
|
|
224
|
+
}, e.id);
|
|
225
|
+
})
|
|
226
|
+
})]
|
|
227
|
+
}, e.key ?? "")), m(g, {
|
|
228
|
+
ref: n,
|
|
229
|
+
className: e(T, "template-panel"),
|
|
230
|
+
sx: C,
|
|
231
|
+
style: x && M ? {
|
|
232
|
+
boxSizing: "content-box",
|
|
233
|
+
scrollbarGutter: "stable",
|
|
234
|
+
height: `${Math.ceil(x * M + 8 * (x - 1))}px`,
|
|
235
|
+
minHeight: `${Math.ceil(M)}px`,
|
|
236
|
+
...w
|
|
237
|
+
} : w,
|
|
238
|
+
...k,
|
|
239
|
+
children: m(g, {
|
|
240
|
+
ref: j,
|
|
241
|
+
onKeyDown: (e) => {
|
|
242
|
+
if (E?.(e), e.defaultPrevented) return;
|
|
243
|
+
let t = j.current;
|
|
244
|
+
if (!t) return;
|
|
245
|
+
let n = Array.from(t.querySelectorAll(".template-tile")), r = n.indexOf(document.activeElement);
|
|
246
|
+
if (r < 0) return;
|
|
247
|
+
let i = n[r].offsetTop, a = n.findIndex((e) => e.offsetTop === i && e.parentElement === n[r].parentElement), o = 0;
|
|
248
|
+
for (; n[a + o]?.offsetTop === i;) o++;
|
|
249
|
+
let s = r;
|
|
250
|
+
switch (e.key) {
|
|
251
|
+
case "ArrowRight":
|
|
252
|
+
s = r + 1;
|
|
253
|
+
break;
|
|
254
|
+
case "ArrowLeft":
|
|
255
|
+
s = r - 1;
|
|
256
|
+
break;
|
|
257
|
+
case "ArrowDown":
|
|
258
|
+
s = r + Math.max(1, o);
|
|
259
|
+
break;
|
|
260
|
+
case "ArrowUp":
|
|
261
|
+
s = r - Math.max(1, o);
|
|
262
|
+
break;
|
|
263
|
+
case "Home":
|
|
264
|
+
s = 0;
|
|
265
|
+
break;
|
|
266
|
+
case "End":
|
|
267
|
+
s = n.length - 1;
|
|
268
|
+
break;
|
|
269
|
+
default: return;
|
|
270
|
+
}
|
|
271
|
+
s = Math.max(0, Math.min(n.length - 1, s)), e.preventDefault(), n[s].focus();
|
|
272
|
+
},
|
|
273
|
+
children: R
|
|
274
|
+
})
|
|
275
|
+
});
|
|
276
|
+
}));
|
|
277
|
+
k.displayName = "TemplatePanel";
|
|
278
|
+
var A = (e, t, n) => {
|
|
279
|
+
let r = t.trim().toLowerCase();
|
|
280
|
+
return !r || [
|
|
281
|
+
e.title,
|
|
282
|
+
e.description,
|
|
283
|
+
n?.title,
|
|
284
|
+
...e.tags ?? []
|
|
285
|
+
].some((e) => e?.toLowerCase().includes(r));
|
|
286
|
+
}, j = (e) => {
|
|
287
|
+
let { value: t, onChange: r, sx: a } = e, o = i();
|
|
288
|
+
return m(x, {
|
|
289
|
+
size: "small",
|
|
290
|
+
value: t,
|
|
291
|
+
placeholder: o("template.search"),
|
|
292
|
+
onChange: (e) => r(e.target.value),
|
|
293
|
+
onKeyDown: (e) => {
|
|
294
|
+
e.key === "Escape" && t && (e.stopPropagation(), r(""));
|
|
295
|
+
},
|
|
296
|
+
sx: a,
|
|
297
|
+
slotProps: {
|
|
298
|
+
input: {
|
|
299
|
+
sx: { backgroundColor: "background.paper" },
|
|
300
|
+
startAdornment: m(y, {
|
|
301
|
+
position: "start",
|
|
302
|
+
children: m(n, { iconKey: "Find" })
|
|
303
|
+
}),
|
|
304
|
+
endAdornment: t ? m(y, {
|
|
305
|
+
position: "end",
|
|
306
|
+
children: m(p, {
|
|
307
|
+
"aria-label": o("template.clearSearch"),
|
|
308
|
+
propsTooltip: { label: o("template.clearSearch") },
|
|
309
|
+
onMouseDown: (e) => {
|
|
310
|
+
e.button === 0 && e.preventDefault();
|
|
311
|
+
},
|
|
312
|
+
onClick: () => r(""),
|
|
313
|
+
icon: m(n, { iconKey: "Close" }),
|
|
314
|
+
size: "small"
|
|
315
|
+
})
|
|
316
|
+
}) : void 0
|
|
317
|
+
},
|
|
318
|
+
htmlInput: {
|
|
319
|
+
spellCheck: !1,
|
|
320
|
+
autoComplete: "off",
|
|
321
|
+
"aria-label": o("template.search")
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}, M = "https://unpkg.com/@sheetxl/workbook-templates/dist", N = "workbook-templates", P = (e) => e.replace(/\.[^/.]+$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), F = (e, t) => {
|
|
326
|
+
let n = `${e}${e.endsWith("/") ? "" : "/"}${N}/${t}`;
|
|
327
|
+
return typeof document > "u" ? n : new URL(n, document.baseURI).href;
|
|
328
|
+
}, I = (e) => typeof e == "string" && e ? e : void 0, L = /* @__PURE__ */ new Map(), R = (e = M) => {
|
|
329
|
+
let t = L.get(e);
|
|
330
|
+
return t || (t = (async () => {
|
|
331
|
+
let t = (await C("templates", N, e)).find((e) => e.meta?.schema !== void 0);
|
|
332
|
+
if (!t) throw Error(`No template catalog found at '${e}'.`);
|
|
333
|
+
return Math.floor(Number(t.meta?.schema)) === 1 ? ((e, t) => {
|
|
334
|
+
let n = Array.isArray(e.meta?.categories) ? e.meta.categories : [], r = [], i = /* @__PURE__ */ new Set();
|
|
335
|
+
for (let e of n) {
|
|
336
|
+
let t = I(e?.id);
|
|
337
|
+
t && !i.has(t) && (i.add(t), r.push({
|
|
338
|
+
id: t,
|
|
339
|
+
title: I(e.title) ?? P(t),
|
|
340
|
+
description: I(e.description),
|
|
341
|
+
icon: I(e.icon)
|
|
342
|
+
}));
|
|
343
|
+
}
|
|
344
|
+
let a = [];
|
|
345
|
+
for (let n of e.entries) {
|
|
346
|
+
let e = n.path, o = e.split("/");
|
|
347
|
+
if (o.length !== 2 || !/\.(?:xlsx|sxl|csv)$/i.test(e)) continue;
|
|
348
|
+
let s = I(n.category) ?? o[0];
|
|
349
|
+
i.has(s) || (i.add(s), r.push({
|
|
350
|
+
id: s,
|
|
351
|
+
title: P(s)
|
|
352
|
+
}));
|
|
353
|
+
let c = I(n.thumbnail), l = I(n.thumbnailDark);
|
|
354
|
+
a.push({
|
|
355
|
+
id: e,
|
|
356
|
+
title: I(n.title) ?? P(o[1]),
|
|
357
|
+
category: s,
|
|
358
|
+
description: I(n.description),
|
|
359
|
+
tags: Array.isArray(n.tags) ? n.tags.filter((e) => typeof e == "string") : void 0,
|
|
360
|
+
thumbnailUrl: c ? F(t, c) : void 0,
|
|
361
|
+
thumbnailDarkUrl: l ? F(t, l) : void 0,
|
|
362
|
+
sourceUrl: F(t, e)
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
categories: r,
|
|
367
|
+
entries: a
|
|
368
|
+
};
|
|
369
|
+
})(t, e) : (console.warn(`Template catalog at '${e}' has schema ${t.meta?.schema}; expected 1.`), {
|
|
370
|
+
categories: [],
|
|
371
|
+
entries: []
|
|
372
|
+
});
|
|
373
|
+
})(), L.set(e, t), t.catch(() => {
|
|
374
|
+
L.delete(e);
|
|
375
|
+
})), t;
|
|
376
|
+
}, z = (e = {}) => {
|
|
377
|
+
let { path: t = M } = e, [n, r] = f(0), [i, a] = f({
|
|
378
|
+
status: "loading",
|
|
379
|
+
categories: [],
|
|
380
|
+
entries: []
|
|
381
|
+
});
|
|
382
|
+
return c(() => {
|
|
383
|
+
let e = !1;
|
|
384
|
+
return a((e) => e.status === "loading" ? e : {
|
|
385
|
+
status: "loading",
|
|
386
|
+
categories: [],
|
|
387
|
+
entries: []
|
|
388
|
+
}), R(t).then((t) => {
|
|
389
|
+
e || a({
|
|
390
|
+
status: "ready",
|
|
391
|
+
...t
|
|
392
|
+
});
|
|
393
|
+
}, (t) => {
|
|
394
|
+
e || a({
|
|
395
|
+
status: "error",
|
|
396
|
+
categories: [],
|
|
397
|
+
entries: [],
|
|
398
|
+
error: t
|
|
399
|
+
});
|
|
400
|
+
}), () => {
|
|
401
|
+
e = !0;
|
|
402
|
+
};
|
|
403
|
+
}, [t, n]), {
|
|
404
|
+
...i,
|
|
405
|
+
retry: s(() => {
|
|
406
|
+
r((e) => e + 1);
|
|
407
|
+
}, [])
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
export { k as a, A as i, z as n, j as r, R as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
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.3
|
|
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 { n as e } from "./
|
|
8
|
-
import {
|
|
7
|
+
import { n as e } from "./Dkw9Yr0Bp5RI5pRw.mjs";
|
|
8
|
+
import { t } from "./DSAOtFgAoMMKXSJb.mjs";
|
|
9
9
|
import { useReferenceMode as n } from "@sheetxl/react";
|
|
10
10
|
import { useCallbackRef as r, useTranslator as i } from "@sheetxl/utils-react";
|
|
11
11
|
import { memo as a, useCallback as o, useMemo as s, useState as c } from "react";
|
|
@@ -1,10 +1,10 @@
|
|
|
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.3
|
|
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 "./BbIR6fcRDFkeZXY0.mjs";
|
|
8
8
|
import { ICell as t, IRange as n } from "@sheetxl/sdk";
|
|
9
9
|
import { CommandContext as r } from "@sheetxl/react";
|
|
10
10
|
import { DynamicIcon as i, KeyCodes as a, KeyModifiers as o, useCallbackRef as s, useTranslator as c } from "@sheetxl/utils-react";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.3
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { a as e, i as t, n, r } from "./MplcRTnOYfsuQGe3.mjs";
|
|
8
|
+
import { useTranslator as i } from "@sheetxl/utils-react";
|
|
9
|
+
import { useCallback as a, useMemo as o, useState as s } from "react";
|
|
10
|
+
import { InternalWindow as c } from "@sheetxl/utils-mui";
|
|
11
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
12
|
+
import { Box as d, Checkbox as f, Chip as p, DialogActions as m, DialogContent as h, FormControlLabel as g, Typography as _ } from "@mui/material";
|
|
13
|
+
var v = (v) => {
|
|
14
|
+
let { title: y, templatePath: b, onSelectTemplate: x, showAtStartup: S, onShowAtStartupChange: C, sx: w, ...T } = v, E = i(), D = n({ path: b }), [O, k] = s(null), [A, j] = s(""), M = !!A.trim(), N = o(() => {
|
|
15
|
+
if (!O && !M) return;
|
|
16
|
+
let e = new Map(D.categories.map((e) => [e.id, e]));
|
|
17
|
+
return (n) => (!O || n.category === O) && t(n, A, e.get(n.category));
|
|
18
|
+
}, [
|
|
19
|
+
O,
|
|
20
|
+
A,
|
|
21
|
+
M,
|
|
22
|
+
D.categories
|
|
23
|
+
]), [P, F] = s(S), I = a((e) => {
|
|
24
|
+
F(e), C?.(e);
|
|
25
|
+
}, [C]), L = a((e) => {
|
|
26
|
+
x?.(e);
|
|
27
|
+
}, [x]);
|
|
28
|
+
return u(c, {
|
|
29
|
+
isModal: !0,
|
|
30
|
+
sx: {
|
|
31
|
+
width: "860px",
|
|
32
|
+
...w
|
|
33
|
+
},
|
|
34
|
+
title: y ?? E("dialog.template.title"),
|
|
35
|
+
autoFocusSel: ".template-tile",
|
|
36
|
+
...T,
|
|
37
|
+
children: [u(h, {
|
|
38
|
+
dividers: !0,
|
|
39
|
+
sx: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "column",
|
|
42
|
+
gap: 1.5,
|
|
43
|
+
maxHeight: "calc(100vh - 160px)"
|
|
44
|
+
},
|
|
45
|
+
children: [u(d, {
|
|
46
|
+
sx: {
|
|
47
|
+
display: "flex",
|
|
48
|
+
flexWrap: "wrap",
|
|
49
|
+
alignItems: "flex-start",
|
|
50
|
+
columnGap: 2,
|
|
51
|
+
rowGap: 1
|
|
52
|
+
},
|
|
53
|
+
children: [D.categories.length > 1 ? u(d, {
|
|
54
|
+
role: "toolbar",
|
|
55
|
+
"aria-label": E("dialog.template.categories"),
|
|
56
|
+
sx: {
|
|
57
|
+
display: "flex",
|
|
58
|
+
flexWrap: "wrap",
|
|
59
|
+
gap: 1,
|
|
60
|
+
flex: "1 1 0",
|
|
61
|
+
minWidth: "200px"
|
|
62
|
+
},
|
|
63
|
+
children: [l(p, {
|
|
64
|
+
label: E("dialog.template.all"),
|
|
65
|
+
color: O === null ? "primary" : "default",
|
|
66
|
+
variant: O === null ? "filled" : "outlined",
|
|
67
|
+
onClick: () => k(null)
|
|
68
|
+
}), D.categories.map((e) => l(p, {
|
|
69
|
+
label: e.title,
|
|
70
|
+
title: e.description,
|
|
71
|
+
color: O === e.id ? "primary" : "default",
|
|
72
|
+
variant: O === e.id ? "filled" : "outlined",
|
|
73
|
+
onClick: () => k(e.id)
|
|
74
|
+
}, e.id))]
|
|
75
|
+
}) : null, l(r, {
|
|
76
|
+
value: A,
|
|
77
|
+
onChange: j,
|
|
78
|
+
sx: {
|
|
79
|
+
flex: "0 1 220px",
|
|
80
|
+
minWidth: "180px",
|
|
81
|
+
marginLeft: "auto"
|
|
82
|
+
}
|
|
83
|
+
})]
|
|
84
|
+
}), l(e, {
|
|
85
|
+
catalog: D,
|
|
86
|
+
filter: N,
|
|
87
|
+
emptyLabel: M ? E("template.noMatches") : void 0,
|
|
88
|
+
visibleRows: 2,
|
|
89
|
+
onSelect: L,
|
|
90
|
+
sx: {
|
|
91
|
+
flex: "1 1 auto",
|
|
92
|
+
overflow: "auto"
|
|
93
|
+
}
|
|
94
|
+
})]
|
|
95
|
+
}), P === void 0 ? null : l(m, {
|
|
96
|
+
sx: {
|
|
97
|
+
justifyContent: "flex-start",
|
|
98
|
+
paddingX: 3,
|
|
99
|
+
paddingY: .5
|
|
100
|
+
},
|
|
101
|
+
children: l(g, {
|
|
102
|
+
control: l(f, {
|
|
103
|
+
size: "small",
|
|
104
|
+
checked: P,
|
|
105
|
+
onChange: (e) => I(e.target.checked)
|
|
106
|
+
}),
|
|
107
|
+
label: l(_, {
|
|
108
|
+
variant: "body2",
|
|
109
|
+
children: E("template.showAtStartup")
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
export { v as default };
|