@carto/ps-react-ui 4.3.0-widgets.0 → 5.0.0-widgets.2
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/components.js +25 -23
- package/dist/components.js.map +1 -1
- package/dist/error-zHOU_QIB.js +38 -0
- package/dist/error-zHOU_QIB.js.map +1 -0
- package/dist/exports-Cr43OCul.js +51 -0
- package/dist/exports-Cr43OCul.js.map +1 -0
- package/dist/{lasso-tool-BC-rsMMW.js → lasso-tool-CYn3ivf-.js} +165 -183
- package/dist/lasso-tool-CYn3ivf-.js.map +1 -0
- package/dist/no-data-Cz80hEWj.js +61 -0
- package/dist/no-data-Cz80hEWj.js.map +1 -0
- package/dist/options-D9wflre6.js +49 -0
- package/dist/options-D9wflre6.js.map +1 -0
- package/dist/row-C_m1ovHv.js +35 -0
- package/dist/row-C_m1ovHv.js.map +1 -0
- package/dist/series-6xp-KQ0S.js +91 -0
- package/dist/series-6xp-KQ0S.js.map +1 -0
- package/dist/{smart-tooltip-BSlcAkBM.js → smart-tooltip-BEtBaIdz.js} +2 -2
- package/dist/{smart-tooltip-BSlcAkBM.js.map → smart-tooltip-BEtBaIdz.js.map} +1 -1
- package/dist/styles-dOu_pRNb.js +77 -0
- package/dist/styles-dOu_pRNb.js.map +1 -0
- package/dist/tooltip-BDnrRKrp.js +25 -0
- package/dist/tooltip-BDnrRKrp.js.map +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/use-debounce.d.ts +19 -0
- package/dist/types/hooks/use-widget-ref.d.ts +17 -0
- package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +5 -11
- package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +3 -8
- package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
- package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
- package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
- package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
- package/dist/types/widgets/actions/download/download.d.ts +1 -1
- package/dist/types/widgets/actions/download/exports.d.ts +1 -1
- package/dist/types/widgets/actions/download/types.d.ts +3 -11
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
- package/dist/types/widgets/actions/fullscreen/styles.d.ts +6 -0
- package/dist/types/widgets/actions/fullscreen/types.d.ts +8 -9
- package/dist/types/widgets/actions/index.d.ts +14 -1
- package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
- package/dist/types/widgets/actions/lock-selection/types.d.ts +38 -0
- package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
- package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
- package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
- package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
- package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
- package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
- package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
- package/dist/types/widgets/actions/searcher/types.d.ts +64 -0
- package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
- package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
- package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
- package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
- package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
- package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
- package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
- package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
- package/dist/types/widgets/bar/config.d.ts +5 -4
- package/dist/types/widgets/bar/index.d.ts +2 -2
- package/dist/types/widgets/bar/types.d.ts +6 -12
- package/dist/types/widgets/category/category-ui.d.ts +2 -0
- package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
- package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
- package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
- package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
- package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
- package/dist/types/widgets/category/components/index.d.ts +10 -0
- package/dist/types/widgets/category/config.d.ts +15 -0
- package/dist/types/widgets/category/index.d.ts +6 -0
- package/dist/types/widgets/category/skeleton.d.ts +1 -0
- package/dist/types/widgets/category/style.d.ts +121 -0
- package/dist/types/widgets/category/types.d.ts +33 -0
- package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
- package/dist/types/widgets/echart/index.d.ts +2 -2
- package/dist/types/widgets/echart/options.d.ts +2 -3
- package/dist/types/widgets/echart/types.d.ts +11 -10
- package/dist/types/widgets/echart/utils.d.ts +22 -16
- package/dist/types/widgets/error/error.d.ts +2 -0
- package/dist/types/widgets/error/index.d.ts +2 -0
- package/dist/types/widgets/error/types.d.ts +12 -0
- package/dist/types/widgets/formula/components/row.d.ts +1 -1
- package/dist/types/widgets/formula/config.d.ts +4 -2
- package/dist/types/widgets/formula/index.d.ts +2 -1
- package/dist/types/widgets/formula/types.d.ts +6 -18
- package/dist/types/widgets/histogram/config.d.ts +5 -4
- package/dist/types/widgets/histogram/index.d.ts +2 -2
- package/dist/types/widgets/histogram/types.d.ts +6 -12
- package/dist/types/widgets/index.d.ts +6 -4
- package/dist/types/widgets/markdown/config.d.ts +4 -2
- package/dist/types/widgets/markdown/index.d.ts +2 -2
- package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
- package/dist/types/widgets/markdown/types.d.ts +6 -16
- package/dist/types/widgets/no-data/index.d.ts +2 -0
- package/dist/types/widgets/no-data/no-data.d.ts +35 -0
- package/dist/types/widgets/no-data/style.d.ts +6 -0
- package/dist/types/widgets/no-data/types.d.ts +67 -0
- package/dist/types/widgets/note/note.d.ts +1 -1
- package/dist/types/widgets/note/style.d.ts +12 -1
- package/dist/types/widgets/note/types.d.ts +4 -3
- package/dist/types/widgets/pie/config.d.ts +5 -4
- package/dist/types/widgets/pie/index.d.ts +2 -2
- package/dist/types/widgets/pie/types.d.ts +6 -12
- package/dist/types/widgets/range/config.d.ts +6 -2
- package/dist/types/widgets/range/index.d.ts +2 -1
- package/dist/types/widgets/range/types.d.ts +6 -17
- package/dist/types/widgets/root/index.d.ts +2 -1
- package/dist/types/widgets/root/root.d.ts +1 -1
- package/dist/types/widgets/root/types.d.ts +6 -12
- package/dist/types/widgets/root/utils.d.ts +1 -0
- package/dist/types/widgets/scatterplot/config.d.ts +5 -4
- package/dist/types/widgets/scatterplot/index.d.ts +2 -2
- package/dist/types/widgets/scatterplot/types.d.ts +6 -12
- package/dist/types/widgets/selection-summary/index.d.ts +2 -0
- package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
- package/dist/types/widgets/selection-summary/style.d.ts +9 -0
- package/dist/types/widgets/selection-summary/types.d.ts +13 -0
- package/dist/types/widgets/spread/config.d.ts +10 -2
- package/dist/types/widgets/spread/index.d.ts +2 -1
- package/dist/types/widgets/spread/types.d.ts +6 -18
- package/dist/types/widgets/stores/index.d.ts +2 -0
- package/dist/types/widgets/stores/types.d.ts +179 -12
- package/dist/types/widgets/stores/widget-store.d.ts +2 -27
- package/dist/types/widgets/subheader/index.d.ts +2 -0
- package/dist/types/widgets/subheader/style.d.ts +19 -0
- package/dist/types/widgets/subheader/subheader.d.ts +2 -0
- package/dist/types/widgets/subheader/types.d.ts +10 -0
- package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
- package/dist/types/widgets/table/components/cell.d.ts +16 -0
- package/dist/types/widgets/table/components/index.d.ts +4 -0
- package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
- package/dist/types/widgets/table/components/pagination.d.ts +5 -0
- package/dist/types/widgets/table/components/row.d.ts +5 -0
- package/dist/types/widgets/table/config.d.ts +11 -0
- package/dist/types/widgets/table/helpers.d.ts +38 -0
- package/dist/types/widgets/table/helpers.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/index.d.ts +6 -0
- package/dist/types/widgets/table/hooks/use-pagination.d.ts +45 -0
- package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-selection.d.ts +32 -0
- package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-sort.d.ts +29 -0
- package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
- package/dist/types/widgets/table/index.d.ts +13 -0
- package/dist/types/widgets/table/serializer.d.ts +16 -0
- package/dist/types/widgets/table/skeleton.d.ts +10 -0
- package/dist/types/widgets/table/style.d.ts +33 -0
- package/dist/types/widgets/table/table-ui.d.ts +32 -0
- package/dist/types/widgets/table/types.d.ts +201 -0
- package/dist/types/widgets/timeseries/config.d.ts +5 -4
- package/dist/types/widgets/timeseries/index.d.ts +2 -2
- package/dist/types/widgets/timeseries/types.d.ts +6 -12
- package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
- package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
- package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
- package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
- package/dist/types/widgets/wrapper/index.d.ts +2 -2
- package/dist/types/widgets/wrapper/styles.d.ts +6 -0
- package/dist/types/widgets/wrapper/types.d.ts +7 -5
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
- package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
- package/dist/utils-Dv5Z47UQ.js +144 -0
- package/dist/utils-Dv5Z47UQ.js.map +1 -0
- package/dist/widget-store-DNyVElxd.js +190 -0
- package/dist/widget-store-DNyVElxd.js.map +1 -0
- package/dist/widgets/actions.js +826 -6
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +189 -4
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +460 -0
- package/dist/widgets/category.js.map +1 -0
- package/dist/widgets/echart.js +120 -8
- package/dist/widgets/echart.js.map +1 -1
- package/dist/widgets/error.js +5 -0
- package/dist/widgets/error.js.map +1 -0
- package/dist/widgets/formula.js +117 -20
- package/dist/widgets/formula.js.map +1 -1
- package/dist/widgets/histogram.js +172 -4
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +127 -0
- package/dist/widgets/markdown.js.map +1 -0
- package/dist/widgets/no-data.js +5 -0
- package/dist/widgets/no-data.js.map +1 -0
- package/dist/widgets/note.js +121 -2
- package/dist/widgets/note.js.map +1 -1
- package/dist/widgets/pie.js +213 -4
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +210 -12
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/root.js +65 -2
- package/dist/widgets/root.js.map +1 -1
- package/dist/widgets/scatterplot.js +219 -4
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/selection-summary.js +40 -0
- package/dist/widgets/selection-summary.js.map +1 -0
- package/dist/widgets/skeleton-loader.js +21 -2
- package/dist/widgets/skeleton-loader.js.map +1 -1
- package/dist/widgets/spread.js +162 -17
- package/dist/widgets/spread.js.map +1 -1
- package/dist/widgets/stores.js +5 -0
- package/dist/widgets/stores.js.map +1 -0
- package/dist/widgets/subheader.js +52 -0
- package/dist/widgets/subheader.js.map +1 -0
- package/dist/widgets/table.js +691 -0
- package/dist/widgets/table.js.map +1 -0
- package/dist/widgets/timeseries.js +171 -4
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +6106 -0
- package/dist/widgets/toolbar-actions.js.map +1 -0
- package/dist/widgets/wrapper.js +292 -6
- package/dist/widgets/wrapper.js.map +1 -1
- package/dist/widgets.js +6 -83
- package/dist/widgets.js.map +1 -1
- package/package.json +46 -6
- package/dist/const-BLV7Tvte.js +0 -758
- package/dist/const-BLV7Tvte.js.map +0 -1
- package/dist/download-KroQ0SWg.js +0 -195
- package/dist/download-KroQ0SWg.js.map +0 -1
- package/dist/echart-CqfROFu3.js +0 -214
- package/dist/echart-CqfROFu3.js.map +0 -1
- package/dist/formula-ui-ChzvMEOG.js +0 -52
- package/dist/formula-ui-ChzvMEOG.js.map +0 -1
- package/dist/lasso-tool-BC-rsMMW.js.map +0 -1
- package/dist/markdown-n_tOtoiT.js +0 -27
- package/dist/markdown-n_tOtoiT.js.map +0 -1
- package/dist/markdown-ui-BBrzzd7Y.js +0 -62
- package/dist/markdown-ui-BBrzzd7Y.js.map +0 -1
- package/dist/note-DF-n70TX.js +0 -101
- package/dist/note-DF-n70TX.js.map +0 -1
- package/dist/range-ui-CtUX11Xm.js +0 -146
- package/dist/range-ui-CtUX11Xm.js.map +0 -1
- package/dist/root-L_WZnJY5.js +0 -46
- package/dist/root-L_WZnJY5.js.map +0 -1
- package/dist/row-DQaSxmDV.js +0 -18
- package/dist/row-DQaSxmDV.js.map +0 -1
- package/dist/series-CsyEPq-X.js +0 -83
- package/dist/series-CsyEPq-X.js.map +0 -1
- package/dist/skeleton-BSPcEvfq.js +0 -27
- package/dist/skeleton-BSPcEvfq.js.map +0 -1
- package/dist/skeleton-C4rOYTy-.js +0 -78
- package/dist/skeleton-C4rOYTy-.js.map +0 -1
- package/dist/skeleton-C9Jqc241.js +0 -82
- package/dist/skeleton-C9Jqc241.js.map +0 -1
- package/dist/skeleton-D-zHBBIw.js +0 -64
- package/dist/skeleton-D-zHBBIw.js.map +0 -1
- package/dist/skeleton-DMP-IwaJ.js +0 -109
- package/dist/skeleton-DMP-IwaJ.js.map +0 -1
- package/dist/skeleton-DRorqowB.js +0 -22
- package/dist/skeleton-DRorqowB.js.map +0 -1
- package/dist/skeleton-DsZhv-AH.js +0 -89
- package/dist/skeleton-DsZhv-AH.js.map +0 -1
- package/dist/skeleton-Dx3FCer0.js +0 -13
- package/dist/skeleton-Dx3FCer0.js.map +0 -1
- package/dist/skeleton-QVDdb1c2.js +0 -21
- package/dist/skeleton-QVDdb1c2.js.map +0 -1
- package/dist/skeleton-loader-DWC1-EAx.js +0 -23
- package/dist/skeleton-loader-DWC1-EAx.js.map +0 -1
- package/dist/spread-ui-BjzH190y.js +0 -82
- package/dist/spread-ui-BjzH190y.js.map +0 -1
- package/dist/style-BGeCtQkP.js +0 -19
- package/dist/style-BGeCtQkP.js.map +0 -1
- package/dist/style-C7v1iwqD.js +0 -34
- package/dist/style-C7v1iwqD.js.map +0 -1
- package/dist/styles-cohnxh9F.js +0 -23
- package/dist/styles-cohnxh9F.js.map +0 -1
- package/dist/types/widgets/config-loader/index.d.ts +0 -2
- package/dist/types/widgets/config-loader/types.d.ts +0 -12
- package/dist/types/widgets/config-loader/use-config.d.ts +0 -5
- package/dist/types/widgets/widget/const.d.ts +0 -2
- package/dist/types/widgets/widget/types.d.ts +0 -47
- package/dist/types/widgets/widget/widget.d.ts +0 -2
- package/dist/use-config-BYEOiIcu.js +0 -43
- package/dist/use-config-BYEOiIcu.js.map +0 -1
- package/dist/widget-store-yDO2ul8g.js +0 -44
- package/dist/widget-store-yDO2ul8g.js.map +0 -1
- package/dist/widgets/config-loader.js +0 -5
- package/dist/widgets/config-loader.js.map +0 -1
- package/dist/wrapper-57csMybC.js +0 -265
- package/dist/wrapper-57csMybC.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import a from "html2canvas";
|
|
3
|
+
import { ImageOutlined as l } from "@mui/icons-material";
|
|
4
|
+
import { SvgIcon as s } from "@mui/material";
|
|
5
|
+
function d(e) {
|
|
6
|
+
const t = e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
7
|
+
return /[",\n]/.test(t) ? `"${t.replace(/"/g, '""')}"` : t;
|
|
8
|
+
}
|
|
9
|
+
async function h(e) {
|
|
10
|
+
const t = e.map((n) => n.map(d).join(",")).join(`
|
|
11
|
+
`), o = new Blob([t], {
|
|
12
|
+
type: "text/csv;charset=utf-8;"
|
|
13
|
+
});
|
|
14
|
+
return Promise.resolve(URL.createObjectURL(o));
|
|
15
|
+
}
|
|
16
|
+
const g = {
|
|
17
|
+
id: "csv",
|
|
18
|
+
label: "CSV",
|
|
19
|
+
icon: /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", fill: "none", viewBox: "0 0 18 18", children: /* @__PURE__ */ c("path", { fill: "currentColor", d: "M4.313 11.25h2.25v-1.125H4.688v-2.25h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v3c0 .213.072.39.216.534a.726.726 0 0 0 .534.216Zm2.925 0h2.25c.212 0 .39-.072.534-.216a.726.726 0 0 0 .216-.534V9.375a.931.931 0 0 0-.216-.59.658.658 0 0 0-.534-.273H8.363v-.637h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v1.125c0 .213.072.403.216.572a.675.675 0 0 0 .534.253h1.126v.675H7.238v1.125Zm4.95 0h1.124l1.313-4.5H13.5l-.75 2.588L12 6.75h-1.125l1.313 4.5ZM3 15c-.413 0-.766-.147-1.06-.44a1.445 1.445 0 0 1-.44-1.06v-9c0-.412.147-.766.44-1.06C2.235 3.148 2.588 3 3 3h12c.412 0 .766.147 1.06.44.293.294.44.648.44 1.06v9c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44H3Zm0-1.5h12v-9H3v9Z" }) }) }),
|
|
20
|
+
modifier: h,
|
|
21
|
+
callback: (e) => {
|
|
22
|
+
URL.revokeObjectURL(e);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
async function m(e) {
|
|
26
|
+
if (!e || typeof e == "function" || !e.current) {
|
|
27
|
+
console.warn("[CARTO downloadFileToPNG] Invalid ref passed to downloadFileToPNG. Expected a React ref object with a .current property pointing to an HTMLElement. Download aborted.");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const o = e.current.cloneNode(!0);
|
|
31
|
+
o.querySelector(".widget-toolbar-container")?.remove(), o.querySelector(".widget-wrapper-actions")?.remove(), document.body.appendChild(o);
|
|
32
|
+
const n = o.getBoundingClientRect(), r = {
|
|
33
|
+
useCORS: !0,
|
|
34
|
+
scale: 2,
|
|
35
|
+
backgroundColor: "#fff",
|
|
36
|
+
width: n.width,
|
|
37
|
+
height: n.height
|
|
38
|
+
}, i = (await a(o, r)).toDataURL("image/png");
|
|
39
|
+
return document.body.removeChild(o), Promise.resolve(i);
|
|
40
|
+
}
|
|
41
|
+
const b = {
|
|
42
|
+
id: "png",
|
|
43
|
+
label: "PNG",
|
|
44
|
+
icon: /* @__PURE__ */ c(l, {}),
|
|
45
|
+
modifier: m
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
g as a,
|
|
49
|
+
b as d
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=exports-Cr43OCul.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports-Cr43OCul.js","sources":["../src/widgets/actions/download/exports.tsx"],"sourcesContent":["import type { Ref } from 'react'\nimport type { DownloadItem } from './types'\nimport html2canvas from 'html2canvas'\nimport { ImageOutlined } from '@mui/icons-material'\nimport { SvgIcon } from '@mui/material'\n\n// Helper to escape CSV cell values\nfunction escapeCSVCell<D>(value: D): string {\n const str =\n value == null\n ? ''\n : typeof value === 'object'\n ? JSON.stringify(value)\n : String(value)\n\n // If the value contains a comma, quote, or newline, wrap in quotes and escape quotes\n if (/[\",\\n]/.test(str)) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`\n }\n return str\n}\n\nasync function downloadFileToCSV<D>(data: D[][]) {\n const csvContent = data\n .map((row) => row.map(escapeCSVCell<D>).join(','))\n .join('\\n')\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' })\n return Promise.resolve(URL.createObjectURL(blob))\n}\n\nexport const downloadToCSV: DownloadItem<unknown[][]> = {\n id: 'csv',\n label: 'CSV',\n icon: (\n <SvgIcon>\n <svg\n xmlns='http://www.w3.org/2000/svg'\n width='18'\n height='18'\n fill='none'\n viewBox='0 0 18 18'\n >\n <path\n fill='currentColor'\n d='M4.313 11.25h2.25v-1.125H4.688v-2.25h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v3c0 .213.072.39.216.534a.726.726 0 0 0 .534.216Zm2.925 0h2.25c.212 0 .39-.072.534-.216a.726.726 0 0 0 .216-.534V9.375a.931.931 0 0 0-.216-.59.658.658 0 0 0-.534-.273H8.363v-.637h1.875V6.75h-2.25a.726.726 0 0 0-.535.216.726.726 0 0 0-.216.534v1.125c0 .213.072.403.216.572a.675.675 0 0 0 .534.253h1.126v.675H7.238v1.125Zm4.95 0h1.124l1.313-4.5H13.5l-.75 2.588L12 6.75h-1.125l1.313 4.5ZM3 15c-.413 0-.766-.147-1.06-.44a1.445 1.445 0 0 1-.44-1.06v-9c0-.412.147-.766.44-1.06C2.235 3.148 2.588 3 3 3h12c.412 0 .766.147 1.06.44.293.294.44.648.44 1.06v9c0 .412-.147.766-.44 1.06-.294.293-.647.44-1.06.44H3Zm0-1.5h12v-9H3v9Z'\n />\n </svg>\n </SvgIcon>\n ),\n modifier: downloadFileToCSV,\n callback: (data) => {\n URL.revokeObjectURL(data)\n },\n}\n\nasync function downloadFileToPNG(ref: Ref<HTMLElement | null> | undefined) {\n if (!ref || typeof ref === 'function' || !ref.current) {\n // eslint-disable-next-line no-console\n console.warn(\n '[CARTO downloadFileToPNG] Invalid ref passed to downloadFileToPNG. ' +\n 'Expected a React ref object with a .current property pointing to an HTMLElement. ' +\n 'Download aborted.',\n )\n return\n }\n\n const element = ref.current\n const clone = element.cloneNode(true) as HTMLElement\n\n clone.querySelector('.widget-toolbar-container')?.remove()\n clone.querySelector('.widget-wrapper-actions')?.remove()\n\n document.body.appendChild(clone)\n\n const rect = clone.getBoundingClientRect()\n\n const opts = {\n useCORS: true,\n scale: 2,\n backgroundColor: '#fff',\n width: rect.width,\n height: rect.height,\n }\n\n const canvasResult: HTMLCanvasElement = await html2canvas(clone, opts)\n\n const result = canvasResult.toDataURL('image/png')\n\n document.body.removeChild(clone)\n\n return Promise.resolve(result)\n}\n\nexport const downloadToPNG: Omit<DownloadItem, 'modifier'> & {\n modifier: (\n ref: Ref<HTMLElement | null> | undefined,\n ) => Promise<string | undefined>\n} = {\n id: 'png',\n label: 'PNG',\n icon: <ImageOutlined />,\n modifier: downloadFileToPNG,\n}\n"],"names":["escapeCSVCell","value","str","JSON","stringify","String","test","replace","downloadFileToCSV","data","csvContent","map","row","join","blob","Blob","type","Promise","resolve","URL","createObjectURL","downloadToCSV","id","label","icon","SvgIcon","jsx","modifier","callback","revokeObjectURL","downloadFileToPNG","ref","current","console","warn","clone","cloneNode","querySelector","remove","document","body","appendChild","rect","getBoundingClientRect","opts","useCORS","scale","backgroundColor","width","height","result","html2canvas","toDataURL","removeChild","downloadToPNG","ImageOutlined"],"mappings":";;;;AAOA,SAASA,EAAiBC,GAAkB;AAC1C,QAAMC,IACJD,KAAS,OACL,KACA,OAAOA,KAAU,WACfE,KAAKC,UAAUH,CAAK,IACpBI,OAAOJ,CAAK;AAGpB,SAAI,SAASK,KAAKJ,CAAG,IACZ,IAAIA,EAAIK,QAAQ,MAAM,IAAI,CAAC,MAE7BL;AACT;AAEA,eAAeM,EAAqBC,GAAa;AAC/C,QAAMC,IAAaD,EAChBE,IAAKC,CAAAA,MAAQA,EAAID,IAAIX,CAAgB,EAAEa,KAAK,GAAG,CAAC,EAChDA,KAAK;AAAA,CAAI,GACNC,IAAO,IAAIC,KAAK,CAACL,CAAU,GAAG;AAAA,IAAEM,MAAM;AAAA,EAAA,CAA2B;AACvE,SAAOC,QAAQC,QAAQC,IAAIC,gBAAgBN,CAAI,CAAC;AAClD;AAEO,MAAMO,IAA2C;AAAA,EACtDC,IAAI;AAAA,EACJC,OAAO;AAAA,EACPC,wBACGC,GAAA,EACC,UAAA,gBAAAC,EAAC,SACC,OAAM,8BACN,OAAM,MACN,QAAO,MACP,MAAK,QACL,SAAQ,aAER,UAAA,gBAAAA,EAAC,QAAA,EACC,MAAK,gBACL,GAAE,+sBAAA,CAA8sB,EAAA,CAEptB,EAAA,CACF;AAAA,EAEFC,UAAUnB;AAAAA,EACVoB,UAAWnB,CAAAA,MAAS;AAClBU,QAAIU,gBAAgBpB,CAAI;AAAA,EAC1B;AACF;AAEA,eAAeqB,EAAkBC,GAA0C;AACzE,MAAI,CAACA,KAAO,OAAOA,KAAQ,cAAc,CAACA,EAAIC,SAAS;AAErDC,YAAQC,KACN,uKAGF;AACA;AAAA,EACF;AAGA,QAAMC,IADUJ,EAAIC,QACEI,UAAU,EAAI;AAEpCD,EAAAA,EAAME,cAAc,2BAA2B,GAAGC,OAAAA,GAClDH,EAAME,cAAc,yBAAyB,GAAGC,OAAAA,GAEhDC,SAASC,KAAKC,YAAYN,CAAK;AAE/B,QAAMO,IAAOP,EAAMQ,sBAAAA,GAEbC,IAAO;AAAA,IACXC,SAAS;AAAA,IACTC,OAAO;AAAA,IACPC,iBAAiB;AAAA,IACjBC,OAAON,EAAKM;AAAAA,IACZC,QAAQP,EAAKO;AAAAA,EAAAA,GAKTC,KAFkC,MAAMC,EAAYhB,GAAOS,CAAI,GAEzCQ,UAAU,WAAW;AAEjDb,kBAASC,KAAKa,YAAYlB,CAAK,GAExBlB,QAAQC,QAAQgC,CAAM;AAC/B;AAEO,MAAMI,IAIT;AAAA,EACFhC,IAAI;AAAA,EACJC,OAAO;AAAA,EACPC,wBAAO+B,GAAA,EAAa;AAAA,EACpB5B,UAAUG;AACZ;"}
|
|
@@ -1,62 +1,46 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { ArrowDropDown as
|
|
4
|
-
import {
|
|
5
|
-
import { d as
|
|
6
|
-
import { useState as
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
const e =
|
|
10
|
-
let l, o, n, a;
|
|
11
|
-
e[0] !== t ? ({
|
|
12
|
-
children: l,
|
|
13
|
-
title: a,
|
|
14
|
-
enterNextDelay: n,
|
|
15
|
-
...o
|
|
16
|
-
} = t, e[0] = t, e[1] = l, e[2] = o, e[3] = n, e[4] = a) : (l = e[1], o = e[2], n = e[3], a = e[4]);
|
|
17
|
-
const r = n === void 0 ? K : n;
|
|
18
|
-
let c;
|
|
19
|
-
return e[5] !== l || e[6] !== r || e[7] !== o || e[8] !== a ? (c = /* @__PURE__ */ i(le, { title: a, enterNextDelay: r, ...o, children: l }), e[5] = l, e[6] = r, e[7] = o, e[8] = a, e[9] = c) : c = e[9], c;
|
|
20
|
-
}
|
|
21
|
-
function Le(t) {
|
|
22
|
-
K = t;
|
|
23
|
-
}
|
|
24
|
-
function he(t) {
|
|
25
|
-
const e = v(3);
|
|
1
|
+
import { jsx as i, jsxs as T, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "react/compiler-runtime";
|
|
3
|
+
import { ArrowDropDown as ee, MoreVertOutlined as te } from "@mui/icons-material";
|
|
4
|
+
import { Chip as oe, Paper as le, IconButton as ie, Menu as ne, Box as re, Divider as H, MenuItem as z, ListItemIcon as ae, SvgIcon as ce, ListItemText as se, ToggleButton as de, Typography as q } from "@mui/material";
|
|
5
|
+
import { d as N } from "./cjs-D9ro6BXv.js";
|
|
6
|
+
import { useState as ue, useMemo as J } from "react";
|
|
7
|
+
import { T as K } from "./tooltip-BDnrRKrp.js";
|
|
8
|
+
function ge(t) {
|
|
9
|
+
const e = b(3);
|
|
26
10
|
let l;
|
|
27
11
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm16 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm-2.829 1a2.996 2.996 0 0 0 0 2H6.829a2.995 2.995 0 0 0 0-2h10.342Zm-2.463-5.707 3.998 4a3.013 3.013 0 0 0-1.414 1.414l-4-3.999a3.014 3.014 0 0 0 1.31-1.214l.106-.201ZM2.998 6.829a2.995 2.995 0 0 0 2.002 0v10.342a2.993 2.993 0 0 0-2.002 0V6.83ZM12 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm1.84-3.919c.464.483 1.09.81 1.79.896l-1.47 2.94a2.992 2.992 0 0 0-1.79-.894l1.47-2.942ZM16 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4ZM4 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm9.171.998a2.994 2.994 0 0 0 0 2.002H6.829a2.995 2.995 0 0 0 0-2.002h6.342Z", fill: "currentColor" }), e[0] = l) : l = e[0];
|
|
28
12
|
let o;
|
|
29
13
|
return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
|
|
30
14
|
}
|
|
31
|
-
function
|
|
32
|
-
const e =
|
|
15
|
+
function pe(t) {
|
|
16
|
+
const e = b(3);
|
|
33
17
|
let l;
|
|
34
18
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm16 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm-2.829 1a2.993 2.993 0 0 0-.17.974l-.001.052.007.183a3 3 0 0 0 .164.79H6.829a2.995 2.995 0 0 0 0-2h10.342ZM2.998 6.828a2.995 2.995 0 0 0 2.002 0V17.17a2.993 2.993 0 0 0-2.002 0V6.83Zm16.001 0a2.995 2.995 0 0 0 2 0V17.17a2.993 2.993 0 0 0-2 0V6.829ZM20 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4ZM4 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm13.171.998a2.991 2.991 0 0 0-.17.976L17 4.026l.007.183a3 3 0 0 0 .164.79H6.829a2.995 2.995 0 0 0 0-2H17.17Z", fill: "currentColor" }), e[0] = l) : l = e[0];
|
|
35
19
|
let o;
|
|
36
20
|
return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
|
|
37
21
|
}
|
|
38
|
-
function
|
|
39
|
-
const e =
|
|
22
|
+
function he(t) {
|
|
23
|
+
const e = b(3);
|
|
40
24
|
let l;
|
|
41
25
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 6a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z", fill: "currentColor" }), e[0] = l) : l = e[0];
|
|
42
26
|
let o;
|
|
43
27
|
return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
|
|
44
28
|
}
|
|
45
|
-
function
|
|
46
|
-
const e =
|
|
29
|
+
function fe(t) {
|
|
30
|
+
const e = b(3);
|
|
47
31
|
let l;
|
|
48
32
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 3c4.935 0 9 3.736 9 9l-.002.343-.012.668c-.012.438-.033.86-.062 1.266l-.05.597C20.498 18.767 19.267 21 17 21c-1.192 0-1.971-.341-2.988-1.122l-.472-.375c-.401-.319-.64-.473-.888-.566a4.938 4.938 0 0 0-.415-.13l-.34-.085-.398-.086-.456-.086-.66-.111-1.708-.273a9.112 9.112 0 0 1-.952-.206C5.46 17.301 3 14.954 3 12.015c0-1.508.485-2.995 1.436-4.458.355.585.906 1.04 1.562 1.272C5.328 9.916 5 10.977 5 12.015c0 1.889 1.78 3.588 3.282 4.025l.085.023.345.076.517.092 1.619.257.583.1.518.098.237.05.433.103c.272.07.512.143.73.224.434.161.783.373 1.235.718l.457.362c.806.646 1.24.857 1.959.857.893 0 1.63-1.518 1.895-4.45l.045-.585c.013-.2.024-.407.033-.62l.02-.655c.005-.224.007-.454.007-.69 0-4.12-3.133-7-7-7a1 1 0 1 1 0-2ZM7 4a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z", fill: "currentColor" }), e[0] = l) : l = e[0];
|
|
49
33
|
let o;
|
|
50
34
|
return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
|
|
51
35
|
}
|
|
52
|
-
function
|
|
53
|
-
const e =
|
|
36
|
+
function me(t) {
|
|
37
|
+
const e = b(3);
|
|
54
38
|
let l;
|
|
55
39
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i("path", { fillRule: "evenodd", clipRule: "evenodd", d: "m10.083 19.394.057.113a1 1 0 0 0 1.72.007l2.869-4.786 4.786-2.87a1 1 0 0 0-.121-1.777l-14-6c-.83-.356-1.669.483-1.313 1.313l6.002 14ZM6.905 6.904l9.903 4.244-3.322 1.995-.102.069a1 1 0 0 0-.242.274l-1.992 3.321-4.245-9.903Z", fill: "currentColor" }), e[0] = l) : l = e[0];
|
|
56
40
|
let o;
|
|
57
41
|
return e[1] !== t ? (o = /* @__PURE__ */ i("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...t, children: l }), e[1] = t, e[2] = o) : o = e[2], o;
|
|
58
42
|
}
|
|
59
|
-
const
|
|
43
|
+
const x = {
|
|
60
44
|
action: {
|
|
61
45
|
tooltip: {
|
|
62
46
|
active: "Click on the map to draw your spatial filter",
|
|
@@ -92,21 +76,21 @@ const S = {
|
|
|
92
76
|
},
|
|
93
77
|
deleteAll: "Remove all"
|
|
94
78
|
}
|
|
95
|
-
},
|
|
79
|
+
}, Be = {
|
|
96
80
|
polygon: {
|
|
97
|
-
icon:
|
|
81
|
+
icon: ge
|
|
98
82
|
},
|
|
99
83
|
rectangle: {
|
|
100
|
-
icon:
|
|
84
|
+
icon: pe
|
|
101
85
|
},
|
|
102
86
|
circle: {
|
|
103
|
-
icon:
|
|
87
|
+
icon: he
|
|
104
88
|
},
|
|
105
89
|
lasso: {
|
|
106
|
-
icon:
|
|
90
|
+
icon: fe
|
|
107
91
|
},
|
|
108
92
|
edit: {
|
|
109
|
-
icon:
|
|
93
|
+
icon: me
|
|
110
94
|
}
|
|
111
95
|
}, M = {
|
|
112
96
|
container: {
|
|
@@ -272,46 +256,46 @@ const S = {
|
|
|
272
256
|
}
|
|
273
257
|
}
|
|
274
258
|
};
|
|
275
|
-
function
|
|
276
|
-
const e =
|
|
259
|
+
function ve(t) {
|
|
260
|
+
const e = b(18), {
|
|
277
261
|
chipProps: l,
|
|
278
262
|
value: o,
|
|
279
|
-
labels:
|
|
280
|
-
onChipToggle:
|
|
281
|
-
onDelete:
|
|
282
|
-
} = t,
|
|
263
|
+
labels: r,
|
|
264
|
+
onChipToggle: c,
|
|
265
|
+
onDelete: n
|
|
266
|
+
} = t, s = o.visible ? "active" : "inactive", a = r?.tooltip?.[s] ?? x.chip.tooltip[s], d = l?.TooltipProps;
|
|
283
267
|
let u;
|
|
284
268
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
285
269
|
...M.chip.chip
|
|
286
270
|
}, e[0] = u) : u = e[0];
|
|
287
|
-
const
|
|
288
|
-
let
|
|
289
|
-
e[1] !==
|
|
271
|
+
const p = o.visible ? "secondary" : "default";
|
|
272
|
+
let g;
|
|
273
|
+
e[1] !== n || e[2] !== o.id ? (g = () => n(o.id), e[1] = n, e[2] = o.id, e[3] = g) : g = e[3];
|
|
290
274
|
let h;
|
|
291
|
-
e[4] !==
|
|
292
|
-
const
|
|
275
|
+
e[4] !== c || e[5] !== o.id || e[6] !== o.visible ? (h = () => c(o.id, !o.visible), e[4] = c, e[5] = o.id, e[6] = o.visible, e[7] = h) : h = e[7];
|
|
276
|
+
const v = l?.ChipsProps;
|
|
293
277
|
let f;
|
|
294
|
-
e[8] !==
|
|
295
|
-
let
|
|
296
|
-
return e[14] !==
|
|
278
|
+
e[8] !== p || e[9] !== g || e[10] !== h || e[11] !== v || e[12] !== o.label ? (f = /* @__PURE__ */ i(oe, { sx: u, color: p, size: "small", onDelete: g, label: o.label, onClick: h, ...v }), e[8] = p, e[9] = g, e[10] = h, e[11] = v, e[12] = o.label, e[13] = f) : f = e[13];
|
|
279
|
+
let C;
|
|
280
|
+
return e[14] !== a || e[15] !== d || e[16] !== f ? (C = /* @__PURE__ */ i(K, { title: a, placement: "bottom", ...d, children: f }), e[14] = a, e[15] = d, e[16] = f, e[17] = C) : C = e[17], C;
|
|
297
281
|
}
|
|
298
|
-
function
|
|
299
|
-
const e =
|
|
282
|
+
function S(t) {
|
|
283
|
+
const e = b(44), {
|
|
300
284
|
enabled: l,
|
|
301
285
|
values: o,
|
|
302
|
-
actionProps:
|
|
303
|
-
chipProps:
|
|
304
|
-
labels:
|
|
305
|
-
modes:
|
|
306
|
-
modesMapping:
|
|
286
|
+
actionProps: r,
|
|
287
|
+
chipProps: c,
|
|
288
|
+
labels: n,
|
|
289
|
+
modes: s,
|
|
290
|
+
modesMapping: a,
|
|
307
291
|
modeSelected: d,
|
|
308
292
|
PaperProps: u,
|
|
309
|
-
onActionToggle:
|
|
310
|
-
onChipToggle:
|
|
293
|
+
onActionToggle: p,
|
|
294
|
+
onChipToggle: g,
|
|
311
295
|
onDelete: h,
|
|
312
|
-
onChangeMode:
|
|
296
|
+
onChangeMode: v,
|
|
313
297
|
onAllChipToggle: f,
|
|
314
|
-
onAllDelete:
|
|
298
|
+
onAllDelete: C,
|
|
315
299
|
ChipsSlot: j,
|
|
316
300
|
ActionSlot: W,
|
|
317
301
|
SecondaryActionsSlot: X,
|
|
@@ -319,7 +303,7 @@ function C(t) {
|
|
|
319
303
|
} = t;
|
|
320
304
|
let I;
|
|
321
305
|
e[0] !== o ? (I = o === void 0 ? [] : o, e[0] = o, e[1] = I) : I = e[1];
|
|
322
|
-
const
|
|
306
|
+
const E = I;
|
|
323
307
|
let y;
|
|
324
308
|
e[2] !== u ? (y = u === void 0 ? {} : u, e[2] = u, e[3] = y) : y = e[3];
|
|
325
309
|
let w, A;
|
|
@@ -327,26 +311,26 @@ function C(t) {
|
|
|
327
311
|
sx: A,
|
|
328
312
|
...w
|
|
329
313
|
} = y, e[4] = y, e[5] = w, e[6] = A) : (w = e[5], A = e[6]);
|
|
330
|
-
const O = j === void 0 ?
|
|
331
|
-
let
|
|
332
|
-
e[7] !== w || e[8] !==
|
|
314
|
+
const O = j === void 0 ? S.Chips : j, P = W === void 0 ? S.Action : W, k = X === void 0 ? S.SecondaryActions : X, V = U === void 0 ? S.Options : U;
|
|
315
|
+
let G;
|
|
316
|
+
e[7] !== w || e[8] !== r || e[9] !== c || e[10] !== l || e[11] !== n || e[12] !== d || e[13] !== s || e[14] !== a || e[15] !== p || e[16] !== f || e[17] !== C || e[18] !== v || e[19] !== g || e[20] !== h || e[21] !== E ? (G = {
|
|
333
317
|
enabled: l,
|
|
334
|
-
values:
|
|
335
|
-
actionProps:
|
|
336
|
-
chipProps:
|
|
337
|
-
labels:
|
|
338
|
-
modes:
|
|
339
|
-
modesMapping:
|
|
318
|
+
values: E,
|
|
319
|
+
actionProps: r,
|
|
320
|
+
chipProps: c,
|
|
321
|
+
labels: n,
|
|
322
|
+
modes: s,
|
|
323
|
+
modesMapping: a,
|
|
340
324
|
modeSelected: d,
|
|
341
325
|
PaperProps: w,
|
|
342
|
-
onActionToggle:
|
|
343
|
-
onChipToggle:
|
|
326
|
+
onActionToggle: p,
|
|
327
|
+
onChipToggle: g,
|
|
344
328
|
onDelete: h,
|
|
345
|
-
onChangeMode:
|
|
329
|
+
onChangeMode: v,
|
|
346
330
|
onAllChipToggle: f,
|
|
347
|
-
onAllDelete:
|
|
348
|
-
}, e[7] = w, e[8] =
|
|
349
|
-
const m =
|
|
331
|
+
onAllDelete: C
|
|
332
|
+
}, e[7] = w, e[8] = r, e[9] = c, e[10] = l, e[11] = n, e[12] = d, e[13] = s, e[14] = a, e[15] = p, e[16] = f, e[17] = C, e[18] = v, e[19] = g, e[20] = h, e[21] = E, e[22] = G) : G = e[22];
|
|
333
|
+
const m = G;
|
|
350
334
|
let D;
|
|
351
335
|
e[23] !== A ? (D = {
|
|
352
336
|
...M.container,
|
|
@@ -355,112 +339,112 @@ function C(t) {
|
|
|
355
339
|
let Z;
|
|
356
340
|
e[25] !== P || e[26] !== m ? (Z = !!P && /* @__PURE__ */ i(P, { ...m }), e[25] = P, e[26] = m, e[27] = Z) : Z = e[27];
|
|
357
341
|
let B;
|
|
358
|
-
e[28] !==
|
|
342
|
+
e[28] !== V || e[29] !== m ? (B = !!V && /* @__PURE__ */ i(Q, { children: (Y) => /* @__PURE__ */ i(V, { ...m, ...Y }) }), e[28] = V, e[29] = m, e[30] = B) : B = e[30];
|
|
359
343
|
let L;
|
|
360
344
|
e[31] !== O || e[32] !== m ? (L = !!O && /* @__PURE__ */ i(O, { ...m }), e[31] = O, e[32] = m, e[33] = L) : L = e[33];
|
|
361
345
|
let _;
|
|
362
346
|
e[34] !== k || e[35] !== m ? (_ = !!k && /* @__PURE__ */ i(k, { ...m }), e[34] = k, e[35] = m, e[36] = _) : _ = e[36];
|
|
363
|
-
let
|
|
364
|
-
return e[37] !== w || e[38] !== D || e[39] !== Z || e[40] !== B || e[41] !== L || e[42] !== _ ? (
|
|
347
|
+
let $;
|
|
348
|
+
return e[37] !== w || e[38] !== D || e[39] !== Z || e[40] !== B || e[41] !== L || e[42] !== _ ? ($ = /* @__PURE__ */ T(le, { sx: D, ...w, children: [
|
|
365
349
|
Z,
|
|
366
350
|
B,
|
|
367
351
|
L,
|
|
368
352
|
_
|
|
369
|
-
] }), e[37] = w, e[38] = D, e[39] = Z, e[40] = B, e[41] = L, e[42] = _, e[43] =
|
|
353
|
+
] }), e[37] = w, e[38] = D, e[39] = Z, e[40] = B, e[41] = L, e[42] = _, e[43] = $) : $ = e[43], $;
|
|
370
354
|
}
|
|
371
|
-
function
|
|
372
|
-
const e =
|
|
355
|
+
function be(t) {
|
|
356
|
+
const e = b(12), {
|
|
373
357
|
actionProps: l,
|
|
374
358
|
labels: o,
|
|
375
|
-
enabled:
|
|
376
|
-
children:
|
|
377
|
-
onActionToggle:
|
|
378
|
-
} = t,
|
|
359
|
+
enabled: r,
|
|
360
|
+
children: c,
|
|
361
|
+
onActionToggle: n
|
|
362
|
+
} = t, s = r ? "active" : "inactive", a = o?.tooltip?.[s] ?? x.action.tooltip[s], d = l?.TooltipProps;
|
|
379
363
|
let u;
|
|
380
|
-
e[0] !==
|
|
381
|
-
let g;
|
|
382
|
-
e[3] !== s || e[4] !== a || e[5] !== n || e[6] !== u ? (g = /* @__PURE__ */ i(pe, { value: "toggle", sx: M.actions.icon, onClick: u, "aria-label": s, selected: n, children: a }), e[3] = s, e[4] = a, e[5] = n, e[6] = u, e[7] = g) : g = e[7];
|
|
364
|
+
e[0] !== r || e[1] !== n ? (u = () => n(!r), e[0] = r, e[1] = n, e[2] = u) : u = e[2];
|
|
383
365
|
let p;
|
|
384
|
-
|
|
366
|
+
e[3] !== a || e[4] !== c || e[5] !== r || e[6] !== u ? (p = /* @__PURE__ */ i(de, { value: "toggle", sx: M.actions.icon, onClick: u, "aria-label": a, selected: r, children: c }), e[3] = a, e[4] = c, e[5] = r, e[6] = u, e[7] = p) : p = e[7];
|
|
367
|
+
let g;
|
|
368
|
+
return e[8] !== a || e[9] !== d || e[10] !== p ? (g = /* @__PURE__ */ i(K, { title: a, placement: "right", ...d, children: p }), e[8] = a, e[9] = d, e[10] = p, e[11] = g) : g = e[11], g;
|
|
385
369
|
}
|
|
386
|
-
function
|
|
370
|
+
function Q({
|
|
387
371
|
TriggerProps: {
|
|
388
|
-
Icon: t = /* @__PURE__ */ i(
|
|
372
|
+
Icon: t = /* @__PURE__ */ i(ee, {}),
|
|
389
373
|
sx: e
|
|
390
374
|
} = {},
|
|
391
375
|
MenuProps: l,
|
|
392
376
|
children: o
|
|
393
377
|
}) {
|
|
394
|
-
const [
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
|
|
378
|
+
const [r, c] = ue(null), n = !!r, s = (d) => {
|
|
379
|
+
c(d.currentTarget);
|
|
380
|
+
}, a = () => {
|
|
381
|
+
c(null);
|
|
398
382
|
};
|
|
399
|
-
return /* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */ i(
|
|
383
|
+
return /* @__PURE__ */ T(R, { children: [
|
|
384
|
+
/* @__PURE__ */ i(ie, { sx: {
|
|
401
385
|
...M.options.icon,
|
|
402
386
|
...e
|
|
403
|
-
}, onClick:
|
|
404
|
-
/* @__PURE__ */ i(
|
|
387
|
+
}, onClick: s, children: t }),
|
|
388
|
+
/* @__PURE__ */ i(ne, { id: "lasso-menu", anchorEl: r, open: n, onClose: a, MenuListProps: {
|
|
405
389
|
"aria-labelledby": "lasso-button",
|
|
406
390
|
sx: M.options.menu
|
|
407
391
|
}, ...l, children: /* @__PURE__ */ i("div", { children: o({
|
|
408
|
-
onClose:
|
|
392
|
+
onClose: a
|
|
409
393
|
}) }) })
|
|
410
394
|
] });
|
|
411
395
|
}
|
|
412
|
-
function
|
|
413
|
-
const e =
|
|
396
|
+
function we(t) {
|
|
397
|
+
const e = b(5), {
|
|
414
398
|
data: l,
|
|
415
399
|
labels: o,
|
|
416
|
-
children:
|
|
400
|
+
children: r
|
|
417
401
|
} = t;
|
|
418
402
|
if (l.length <= 1)
|
|
419
403
|
return null;
|
|
420
|
-
const
|
|
421
|
-
let
|
|
422
|
-
e[0] !==
|
|
423
|
-
let
|
|
424
|
-
return e[2] !==
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
] }), e[2] =
|
|
404
|
+
const c = o?.mode?.title ?? x.options.mode.title;
|
|
405
|
+
let n;
|
|
406
|
+
e[0] !== c ? (n = /* @__PURE__ */ i(q, { variant: "subtitle2", color: "text.secondary", sx: M.options.title, children: c }), e[0] = c, e[1] = n) : n = e[1];
|
|
407
|
+
let s;
|
|
408
|
+
return e[2] !== r || e[3] !== n ? (s = /* @__PURE__ */ T(R, { children: [
|
|
409
|
+
n,
|
|
410
|
+
r
|
|
411
|
+
] }), e[2] = r, e[3] = n, e[4] = s) : s = e[4], s;
|
|
428
412
|
}
|
|
429
|
-
function
|
|
413
|
+
function F({
|
|
430
414
|
data: t,
|
|
431
415
|
modeSelected: e,
|
|
432
416
|
labels: l,
|
|
433
417
|
onChangeMode: o,
|
|
434
|
-
onClose:
|
|
418
|
+
onClose: r
|
|
435
419
|
}) {
|
|
436
|
-
const
|
|
437
|
-
|
|
420
|
+
const c = (n, s) => {
|
|
421
|
+
n.preventDefault(), o?.(s), r();
|
|
438
422
|
};
|
|
439
|
-
return t.map((
|
|
440
|
-
const
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */ i(
|
|
443
|
-
/* @__PURE__ */ i(
|
|
444
|
-
] },
|
|
423
|
+
return t.map((n) => {
|
|
424
|
+
const a = (l?.mode?.options ?? x.options.mode.options)[n.value];
|
|
425
|
+
return /* @__PURE__ */ T(z, { disabled: !!n.disabled, onClick: (d) => c(d, n.value), selected: n.value === e, children: [
|
|
426
|
+
/* @__PURE__ */ i(ae, { sx: M.options.icons, children: /* @__PURE__ */ i(ce, { children: /* @__PURE__ */ i(n.icon, {}) }) }),
|
|
427
|
+
/* @__PURE__ */ i(se, { children: a })
|
|
428
|
+
] }, n.value);
|
|
445
429
|
});
|
|
446
430
|
}
|
|
447
|
-
function
|
|
448
|
-
const e =
|
|
431
|
+
function Me(t) {
|
|
432
|
+
const e = b(8), {
|
|
449
433
|
values: l,
|
|
450
434
|
labels: o,
|
|
451
|
-
onAllChipToggle:
|
|
452
|
-
onAllDelete:
|
|
435
|
+
onAllChipToggle: r,
|
|
436
|
+
onAllDelete: c
|
|
453
437
|
} = t;
|
|
454
438
|
if (!l?.length || l.length <= 1)
|
|
455
439
|
return null;
|
|
456
|
-
const
|
|
440
|
+
const s = l?.some(Ce) ? o?.actions?.toggleAll?.active ?? x.actions.toggleAll.active : o?.actions?.toggleAll?.inactive ?? x.actions.toggleAll.inactive, a = o?.actions?.deleteAll ?? x.actions.deleteAll;
|
|
457
441
|
let d;
|
|
458
442
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(H, { orientation: "vertical", flexItem: !0 }), e[0] = d) : d = e[0];
|
|
459
|
-
let u,
|
|
443
|
+
let u, p;
|
|
460
444
|
e[1] === Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
461
|
-
Icon: /* @__PURE__ */ i(
|
|
445
|
+
Icon: /* @__PURE__ */ i(te, {}),
|
|
462
446
|
sx: M.options.more
|
|
463
|
-
},
|
|
447
|
+
}, p = {
|
|
464
448
|
anchorOrigin: {
|
|
465
449
|
vertical: "bottom",
|
|
466
450
|
horizontal: "right"
|
|
@@ -469,84 +453,82 @@ function Ce(t) {
|
|
|
469
453
|
vertical: "top",
|
|
470
454
|
horizontal: "right"
|
|
471
455
|
}
|
|
472
|
-
}, e[1] = u, e[2] =
|
|
473
|
-
let
|
|
474
|
-
return e[3] !==
|
|
456
|
+
}, e[1] = u, e[2] = p) : (u = e[1], p = e[2]);
|
|
457
|
+
let g;
|
|
458
|
+
return e[3] !== a || e[4] !== r || e[5] !== c || e[6] !== s ? (g = /* @__PURE__ */ T(R, { children: [
|
|
475
459
|
d,
|
|
476
|
-
/* @__PURE__ */ i(
|
|
460
|
+
/* @__PURE__ */ i(Q, { TriggerProps: u, MenuProps: p, children: (h) => /* @__PURE__ */ T(R, { children: [
|
|
477
461
|
/* @__PURE__ */ i(z, { color: "inherit", onClick: () => {
|
|
478
|
-
|
|
479
|
-
}, children:
|
|
462
|
+
r?.(), h.onClose();
|
|
463
|
+
}, children: s }),
|
|
480
464
|
/* @__PURE__ */ i(H, {}),
|
|
481
465
|
/* @__PURE__ */ i(z, { color: "error", onClick: () => {
|
|
482
|
-
|
|
483
|
-
}, children: /* @__PURE__ */ i(
|
|
466
|
+
c?.(), h.onClose();
|
|
467
|
+
}, children: /* @__PURE__ */ i(q, { variant: "body2", color: "error", children: a }) })
|
|
484
468
|
] }) })
|
|
485
|
-
] }), e[3] =
|
|
469
|
+
] }), e[3] = a, e[4] = r, e[5] = c, e[6] = s, e[7] = g) : g = e[7], g;
|
|
486
470
|
}
|
|
487
|
-
function
|
|
471
|
+
function Ce(t) {
|
|
488
472
|
return t.visible;
|
|
489
473
|
}
|
|
490
|
-
|
|
474
|
+
S.Action = function({
|
|
491
475
|
modes: e,
|
|
492
476
|
modesMapping: l,
|
|
493
477
|
modeSelected: o,
|
|
494
|
-
actionProps:
|
|
495
|
-
enabled:
|
|
496
|
-
labels:
|
|
497
|
-
onActionToggle:
|
|
478
|
+
actionProps: r,
|
|
479
|
+
enabled: c,
|
|
480
|
+
labels: n,
|
|
481
|
+
onActionToggle: s
|
|
498
482
|
}) {
|
|
499
|
-
const
|
|
500
|
-
return /* @__PURE__ */ i(
|
|
483
|
+
const a = J(() => N(e ?? {}, l ?? {}), [e, l]), d = (h) => s?.(h), p = (o ? o in (e ?? {}) : !1) ? o : Object.keys(a)[0], g = a[p];
|
|
484
|
+
return /* @__PURE__ */ i(be, { actionProps: r, labels: n?.action, enabled: c ?? !1, onActionToggle: d, children: g?.icon && /* @__PURE__ */ i(g.icon, {}) });
|
|
501
485
|
};
|
|
502
|
-
|
|
486
|
+
S.Chips = function({
|
|
503
487
|
values: e,
|
|
504
488
|
labels: l,
|
|
505
489
|
chipProps: o,
|
|
506
|
-
onDelete:
|
|
507
|
-
onChipToggle:
|
|
508
|
-
onActionToggle:
|
|
490
|
+
onDelete: r,
|
|
491
|
+
onChipToggle: c,
|
|
492
|
+
onActionToggle: n
|
|
509
493
|
}) {
|
|
510
|
-
const
|
|
511
|
-
return !!e?.length && /* @__PURE__ */ i(
|
|
494
|
+
const s = (a) => (n?.(!1), r?.(a));
|
|
495
|
+
return !!e?.length && /* @__PURE__ */ i(re, { sx: M.chip.container, children: e?.map((a) => /* @__PURE__ */ i(ve, { value: a, labels: l?.chip, chipProps: o, onDelete: s, onChipToggle: (d, u) => c?.(d, u) }, a.id)) });
|
|
512
496
|
};
|
|
513
|
-
|
|
514
|
-
|
|
497
|
+
S.SecondaryActions = Me;
|
|
498
|
+
S.Options = function({
|
|
515
499
|
values: e,
|
|
516
500
|
modes: l,
|
|
517
501
|
modesMapping: o,
|
|
518
|
-
modeSelected:
|
|
519
|
-
labels:
|
|
520
|
-
onChangeMode:
|
|
521
|
-
...
|
|
502
|
+
modeSelected: r,
|
|
503
|
+
labels: c,
|
|
504
|
+
onChangeMode: n,
|
|
505
|
+
...s
|
|
522
506
|
}) {
|
|
523
|
-
const
|
|
507
|
+
const a = J(() => N(l ?? {}, o ?? {}), [l, o]), {
|
|
524
508
|
edit: d,
|
|
525
509
|
...u
|
|
526
|
-
} =
|
|
527
|
-
return /* @__PURE__ */
|
|
528
|
-
/* @__PURE__ */ i(
|
|
529
|
-
!!d && /* @__PURE__ */
|
|
510
|
+
} = a, g = (r ? r in (l ?? {}) : !1) ? r : Object.keys(a)[0], h = Object.values(u), v = (f) => n?.(f);
|
|
511
|
+
return /* @__PURE__ */ T(R, { children: [
|
|
512
|
+
/* @__PURE__ */ i(we, { data: h, labels: c?.options, children: /* @__PURE__ */ i(F, { ...s, labels: c?.options, data: h, modeSelected: g, onChangeMode: v }) }),
|
|
513
|
+
!!d && /* @__PURE__ */ T(R, { children: [
|
|
530
514
|
/* @__PURE__ */ i(H, {}),
|
|
531
|
-
/* @__PURE__ */ i(
|
|
515
|
+
/* @__PURE__ */ i(F, { ...s, labels: c?.options, data: [{
|
|
532
516
|
...d,
|
|
533
517
|
disabled: !e?.length
|
|
534
|
-
}], modeSelected:
|
|
518
|
+
}], modeSelected: g, onChangeMode: v })
|
|
535
519
|
] })
|
|
536
520
|
] });
|
|
537
521
|
};
|
|
538
522
|
export {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
S as
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
fe as f,
|
|
549
|
-
Le as g,
|
|
523
|
+
Be as D,
|
|
524
|
+
ve as L,
|
|
525
|
+
me as S,
|
|
526
|
+
x as a,
|
|
527
|
+
S as b,
|
|
528
|
+
he as c,
|
|
529
|
+
fe as d,
|
|
530
|
+
ge as e,
|
|
531
|
+
pe as f,
|
|
550
532
|
M as s
|
|
551
533
|
};
|
|
552
|
-
//# sourceMappingURL=lasso-tool-
|
|
534
|
+
//# sourceMappingURL=lasso-tool-CYn3ivf-.js.map
|