@aintela/bi 0.2.0 → 0.2.1
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/GridCardPlaceHolder-DVVT3pqn.js +25 -0
- package/dist/GridCardPlaceHolder-DVVT3pqn.js.map +1 -0
- package/dist/GridLayout-BgPzzPiP.js +349 -0
- package/dist/GridLayout-BgPzzPiP.js.map +1 -0
- package/dist/ScriptDashboardViewerVertical-DKaHcL1o.js +713 -0
- package/dist/ScriptDashboardViewerVertical-DKaHcL1o.js.map +1 -0
- package/dist/biModuleSurface-dtnpBMtT.js +34 -0
- package/dist/biModuleSurface-dtnpBMtT.js.map +1 -0
- package/dist/cards.js +13 -12
- package/dist/cards.js.map +1 -1
- package/dist/composer.js +37 -37
- package/dist/filterFactory-Ysv0FOQ2.js +285 -0
- package/dist/filterFactory-Ysv0FOQ2.js.map +1 -0
- package/dist/filters.js +11 -10
- package/dist/filters.js.map +1 -1
- package/dist/grid.js +19 -16
- package/dist/grid.js.map +1 -1
- package/dist/index-7p-ogAPK.js +3631 -0
- package/dist/index-7p-ogAPK.js.map +1 -0
- package/dist/index-BRx4bRbe.js +73 -0
- package/dist/index-BRx4bRbe.js.map +1 -0
- package/dist/index-CPHaT2or.js +13 -0
- package/dist/index-CPHaT2or.js.map +1 -0
- package/dist/{index-wtSLspPh.js → index-DeiweWw8.js} +348 -368
- package/dist/index-DeiweWw8.js.map +1 -0
- package/dist/index-Dz2ulBiy.js +137 -0
- package/dist/index-Dz2ulBiy.js.map +1 -0
- package/dist/index.js +225 -218
- package/dist/index.js.map +1 -1
- package/dist/runtime/version.d.ts +1 -1
- package/dist/runtime.js +14 -13
- package/dist/runtime.js.map +1 -1
- package/dist/useContainerRectangle-D464wPFX.js +27 -0
- package/dist/useContainerRectangle-D464wPFX.js.map +1 -0
- package/dist/{version-DnqajORq.js → version-BgIpi4UM.js} +20 -19
- package/dist/{version-DnqajORq.js.map → version-BgIpi4UM.js.map} +1 -1
- package/dist/viewer.js +1 -1
- package/package.json +1 -1
- package/dist/index-C6JQ6770.js +0 -4545
- package/dist/index-C6JQ6770.js.map +0 -1
- package/dist/index-D7tVPX8d.js +0 -347
- package/dist/index-D7tVPX8d.js.map +0 -1
- package/dist/index-DGyvUtY3.js +0 -494
- package/dist/index-DGyvUtY3.js.map +0 -1
- package/dist/index-wtSLspPh.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var V = Object.defineProperty;
|
|
2
|
+
var r = (e, l) => V(e, "name", { value: l, configurable: !0 });
|
|
3
|
+
import { n as x, g as h, A as C, D as N, a as y, V as P, b as v, c as E, d as T } from "./filterFactory-Ysv0FOQ2.js";
|
|
4
|
+
import { jsx as n, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import b, { useState as d, useMemo as D, useEffect as F } from "react";
|
|
6
|
+
import { MenuItem as z, FormControl as I, InputLabel as _, Select as k, TextField as j, Button as A, Stack as L, Typography as R, CircularProgress as B, Tooltip as M } from "@mui/material";
|
|
7
|
+
import { u as S } from "./DashboardParametersContext-Clv--79U.js";
|
|
8
|
+
import { SaveAlt as O, ErrorOutline as W } from "@mui/icons-material";
|
|
9
|
+
const $ = /* @__PURE__ */ r((e) => {
|
|
10
|
+
const [l, i] = d(""), t = S(), o = D(() => e.id ?? x(), [e.id]);
|
|
11
|
+
if (F(() => {
|
|
12
|
+
const a = t == null ? void 0 : t.getParameter(e.parameterName);
|
|
13
|
+
i((typeof a == "string" ? a : void 0) ?? e.initialValue ?? "");
|
|
14
|
+
}, [e.parameterName]), !t && !e.onChange) return null;
|
|
15
|
+
const m = /* @__PURE__ */ r((a) => {
|
|
16
|
+
var s;
|
|
17
|
+
i(a), (s = e.onChange) == null || s.call(e, e.parameterName, a), t == null || t.setParameter(e.parameterName, a);
|
|
18
|
+
}, "onChange"), c = b.Children.map(e.children, (a, s) => {
|
|
19
|
+
if (b.isValidElement(a) && a.type === "option") {
|
|
20
|
+
const f = a.props;
|
|
21
|
+
return /* @__PURE__ */ n(z, { value: f.value ?? "", children: f.children }, f.value ?? s);
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
}), u = h(e.parameterName);
|
|
25
|
+
return /* @__PURE__ */ g(I, { size: "small", sx: { minWidth: 160 }, children: [
|
|
26
|
+
/* @__PURE__ */ n(_, { id: `${o}-label`, children: u }),
|
|
27
|
+
/* @__PURE__ */ g(k, { labelId: `${o}-label`, id: o, label: u, value: l, onChange: /* @__PURE__ */ r((a) => m(String(a.target.value)), "onChange"), children: [
|
|
28
|
+
/* @__PURE__ */ n(z, { value: "None", children: u }),
|
|
29
|
+
c
|
|
30
|
+
] })
|
|
31
|
+
] });
|
|
32
|
+
}, "VizSelect"), w = /* @__PURE__ */ r((e) => {
|
|
33
|
+
const [l, i] = d(null), t = S();
|
|
34
|
+
if (F(() => {
|
|
35
|
+
i(e.initialValue);
|
|
36
|
+
}, [e.parameterName]), !t && !e.onChange || l == null) return null;
|
|
37
|
+
const o = /* @__PURE__ */ r((m) => {
|
|
38
|
+
var c;
|
|
39
|
+
i(m), (c = e.onChange) == null || c.call(e, e.parameterName, m), t == null || t.setParameter(e.parameterName, m);
|
|
40
|
+
}, "onChange");
|
|
41
|
+
return /* @__PURE__ */ n(j, { label: h(e.parameterName), size: "small", value: l, onChange: /* @__PURE__ */ r((m) => o(m.target.value), "onChange") });
|
|
42
|
+
}, "VizTextField"), q = /* @__PURE__ */ r((e) => {
|
|
43
|
+
const [l, i] = d(!1), [t, o] = d(null);
|
|
44
|
+
return /* @__PURE__ */ n(A, { onClick: /* @__PURE__ */ r(() => {
|
|
45
|
+
o(null);
|
|
46
|
+
const c = e.onTrigger();
|
|
47
|
+
c && typeof c.then == "function" && (i(!0), c.catch((u) => o("Exception: " + String(u))).finally(() => i(!1)));
|
|
48
|
+
}, "onClick"), size: "small", fullWidth: !1, disabled: l, sx: { maxWidth: "200px" }, children: /* @__PURE__ */ g(L, { direction: "row", gap: 0.5, children: [
|
|
49
|
+
/* @__PURE__ */ n(R, { children: l ? "Loading" : e.text ?? "Filtrar" }),
|
|
50
|
+
l ? /* @__PURE__ */ n(B, { size: "1.5rem", color: "primary" }) : /* @__PURE__ */ n(O, { sx: { ml: 1 }, fontSize: "small" }),
|
|
51
|
+
!!t && /* @__PURE__ */ n(M, { title: t, children: /* @__PURE__ */ n(W, { sx: { ml: 1, color: "error.main" }, fontSize: "small" }) })
|
|
52
|
+
] }) });
|
|
53
|
+
}, "VizTriggerButton"), Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
54
|
+
__proto__: null,
|
|
55
|
+
AutoCompleteInstructions: C,
|
|
56
|
+
DateRangeFilterBeginSuffix: N,
|
|
57
|
+
DateRangeFilterEndSuffix: y,
|
|
58
|
+
VizAutoComplete: P,
|
|
59
|
+
VizDatePicker: v,
|
|
60
|
+
VizDateRangePicker: E,
|
|
61
|
+
VizSelect: $,
|
|
62
|
+
VizTextField: w,
|
|
63
|
+
VizTriggerButton: q,
|
|
64
|
+
createFilterComponent: T,
|
|
65
|
+
getFriendlyName: h
|
|
66
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
67
|
+
export {
|
|
68
|
+
Y as F,
|
|
69
|
+
$ as V,
|
|
70
|
+
w as a,
|
|
71
|
+
q as b
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=index-BRx4bRbe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BRx4bRbe.js","sources":["../src/filters/VizSelect.tsx","../src/filters/VizTextField.tsx","../src/filters/VizTriggerButton.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\nimport { useDashboardParameters } from '../hooks/DashboardParametersContext';\nimport { getFriendlyName, nextFilterId } from './friendlyName';\n\nexport interface VizSelectProps {\n id?: string;\n initialValue: string;\n parameterName: string;\n /** `<option>` elements (legacy) or `<MenuItem>` elements. `<option>`s are converted. */\n children: React.ReactNode;\n onChange?: (parameterName: string, value: string) => void;\n}\n\n/** Single-value select filter, rendered with MUI so it follows the theme. */\nexport const VizSelect: React.FC<VizSelectProps> = (props) => {\n const [value, setValue] = useState<string>('');\n const dashContext = useDashboardParameters();\n const calcId = useMemo(() => props.id ?? nextFilterId(), [props.id]);\n\n useEffect(() => {\n const current = dashContext?.getParameter(props.parameterName);\n setValue((typeof current === 'string' ? current : undefined) ?? props.initialValue ?? '');\n }, [props.parameterName]);\n\n if (!dashContext && !props.onChange) return null;\n\n const onChange = (v: string) => {\n setValue(v);\n props.onChange?.(props.parameterName, v);\n dashContext?.setParameter(props.parameterName, v);\n };\n\n // Accept legacy `<option value=\"x\">Label</option>` children.\n const items = React.Children.map(props.children, (child, i) => {\n if (React.isValidElement(child) && child.type === 'option') {\n const p = child.props as { value?: string; children?: React.ReactNode };\n return (\n <MenuItem key={p.value ?? i} value={p.value ?? ''}>\n {p.children}\n </MenuItem>\n );\n }\n return child;\n });\n\n const label = getFriendlyName(props.parameterName);\n return (\n <FormControl size=\"small\" sx={{ minWidth: 160 }}>\n <InputLabel id={`${calcId}-label`}>{label}</InputLabel>\n <Select labelId={`${calcId}-label`} id={calcId} label={label} value={value} onChange={(e) => onChange(String(e.target.value))}>\n <MenuItem value=\"None\">{label}</MenuItem>\n {items}\n </Select>\n </FormControl>\n );\n};\n\nexport default VizSelect;\n","import React, { useEffect, useState } from 'react';\nimport { TextField } from '@mui/material';\nimport { useDashboardParameters } from '../hooks/DashboardParametersContext';\nimport { getFriendlyName } from './friendlyName';\n\nexport interface VizTextFieldProps {\n initialValue: string;\n parameterName: string;\n onChange?: (parameterName: string, value: string) => void;\n}\n\nexport const VizTextField: React.FC<VizTextFieldProps> = (props) => {\n const [value, setValue] = useState<string | null>(null);\n const dashContext = useDashboardParameters();\n\n useEffect(() => {\n setValue(props.initialValue);\n }, [props.parameterName]);\n\n if (!dashContext && !props.onChange) return null;\n if (value == null) return null;\n\n const onChange = (v: string) => {\n setValue(v);\n props.onChange?.(props.parameterName, v);\n dashContext?.setParameter(props.parameterName, v);\n };\n\n return <TextField label={getFriendlyName(props.parameterName)} size=\"small\" value={value} onChange={(event) => onChange(event.target.value)} />;\n};\n\nexport default VizTextField;\n","import React, { useState } from 'react';\nimport { ErrorOutline, SaveAlt } from '@mui/icons-material';\nimport { Button, CircularProgress, Stack, Tooltip, Typography } from '@mui/material';\n\nexport interface VizTriggerButtonProps {\n text?: string;\n /** Runs the filter. May return a promise; a rejection is shown as an error tooltip. */\n onTrigger: () => void | Promise<unknown>;\n}\n\n/** \"Filtrar\" button — the legacy `executeFilter` context is gone; the host passes `onTrigger`. */\nexport const VizTriggerButton: React.FC<VizTriggerButtonProps> = (props) => {\n const [filterLoading, setFilterLoading] = useState(false);\n const [filterError, setFilterError] = useState<string | null>(null);\n\n const onClick = () => {\n setFilterError(null);\n const result = props.onTrigger();\n if (result && typeof (result as Promise<unknown>).then === 'function') {\n setFilterLoading(true);\n (result as Promise<unknown>)\n .catch((error: unknown) => setFilterError('Exception: ' + String(error)))\n .finally(() => setFilterLoading(false));\n }\n };\n\n return (\n <Button onClick={onClick} size=\"small\" fullWidth={false} disabled={filterLoading} sx={{ maxWidth: '200px' }}>\n <Stack direction=\"row\" gap={0.5}>\n <Typography>{filterLoading ? 'Loading' : (props.text ?? 'Filtrar')}</Typography>\n {filterLoading ? <CircularProgress size=\"1.5rem\" color=\"primary\" /> : <SaveAlt sx={{ ml: 1 }} fontSize=\"small\" />}\n {!!filterError && (\n <Tooltip title={filterError}>\n <ErrorOutline sx={{ ml: 1, color: 'error.main' }} fontSize=\"small\" />\n </Tooltip>\n )}\n </Stack>\n </Button>\n );\n};\n\nexport default VizTriggerButton;\n"],"names":["VizSelect","__name","props","value","setValue","useState","dashContext","useDashboardParameters","calcId","useMemo","nextFilterId","useEffect","current","onChange","v","_a","items","React","child","i","p","jsx","MenuItem","label","getFriendlyName","jsxs","FormControl","InputLabel","Select","e","VizTextField","TextField","event","VizTriggerButton","filterLoading","setFilterLoading","filterError","setFilterError","Button","result","error","Stack","Typography","CircularProgress","SaveAlt","Tooltip","ErrorOutline"],"mappings":";;;;;;;;AAeO,MAAMA,IAAsC,gBAAAC,EAAA,CAACC,MAAU;AAC1D,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAiB,EAAE,GACvCC,IAAcC,EAAA,GACdC,IAASC,EAAQ,MAAMP,EAAM,MAAMQ,KAAgB,CAACR,EAAM,EAAE,CAAC;AAOnE,MALAS,EAAU,MAAM;AACZ,UAAMC,IAAUN,KAAA,gBAAAA,EAAa,aAAaJ,EAAM;AAChD,IAAAE,GAAU,OAAOQ,KAAY,WAAWA,IAAU,WAAcV,EAAM,gBAAgB,EAAE;AAAA,EAC5F,GAAG,CAACA,EAAM,aAAa,CAAC,GAEpB,CAACI,KAAe,CAACJ,EAAM,SAAU,QAAO;AAE5C,QAAMW,IAAW,gBAAAZ,EAAA,CAACa,MAAc;;AAC5B,IAAAV,EAASU,CAAC,IACVC,IAAAb,EAAM,aAAN,QAAAa,EAAA,KAAAb,GAAiBA,EAAM,eAAeY,IACtCR,KAAA,QAAAA,EAAa,aAAaJ,EAAM,eAAeY;AAAA,EACnD,GAJiB,aAOXE,IAAQC,EAAM,SAAS,IAAIf,EAAM,UAAU,CAACgB,GAAOC,MAAM;AAC3D,QAAIF,EAAM,eAAeC,CAAK,KAAKA,EAAM,SAAS,UAAU;AACxD,YAAME,IAAIF,EAAM;AAChB,aACI,gBAAAG,EAACC,GAAA,EAA4B,OAAOF,EAAE,SAAS,IAC1C,UAAAA,EAAE,SAAA,GADQA,EAAE,SAASD,CAE1B;AAAA,IAER;AACA,WAAOD;AAAA,EACX,CAAC,GAEKK,IAAQC,EAAgBtB,EAAM,aAAa;AACjD,SACI,gBAAAuB,EAACC,KAAY,MAAK,SAAQ,IAAI,EAAE,UAAU,OACtC,UAAA;AAAA,IAAA,gBAAAL,EAACM,GAAA,EAAW,IAAI,GAAGnB,CAAM,UAAW,UAA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UAAME,IAASrC,EAAM,UAAA;AACrB,IAAIqC,KAAU,OAAQA,EAA4B,QAAS,eACvDJ,EAAiB,EAAI,GACpBI,EACI,MAAM,CAACC,MAAmBH,EAAe,gBAAgB,OAAOG,CAAK,CAAC,CAAC,EACvE,QAAQ,MAAML,EAAiB,EAAK,CAAC;AAAA,EAElD,GATgB,YAYc,MAAK,SAAQ,WAAW,IAAO,UAAUD,GAAe,IAAI,EAAE,UAAU,WAC9F,UAAA,gBAAAT,EAACgB,KAAM,WAAU,OAAM,KAAK,KACxB,UAAA;AAAA,IAAA,gBAAApB,EAACqB,GAAA,EAAY,UAAAR,IAAgB,YAAahC,EAAM,QAAQ,WAAW;AAAA,IAClEgC,IAAgB,gBAAAb,EAACsB,GAAA,EAAiB,MAAK,UAAS,OAAM,WAAU,IAAK,gBAAAtB,EAACuB,GAAA,EAAQ,IAAI,EAAE,IAAI,KAAK,UAAS,SAAQ;AAAA,IAC9G,CAAC,CAACR,uBACES,GAAA,EAAQ,OAAOT,GACZ,UAAA,gBAAAf,EAACyB,GAAA,EAAa,IAAI,EAAE,IAAI,GAAG,OAAO,gBAAgB,UAAS,SAAQ,EAAA,CACvE;AAAA,EAAA,EAAA,CAER,EAAA,CACJ;AAER,GA5BiE;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { C as e, S as a, a as r, r as o, u as t } from "./ScriptDashboardViewerVertical-DKaHcL1o.js";
|
|
2
|
+
const i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
CATEGORY_PREFIXES: e,
|
|
5
|
+
ScriptDashboardViewer: a,
|
|
6
|
+
ScriptDashboardViewerVertical: r,
|
|
7
|
+
resolveCardMetadata: o,
|
|
8
|
+
useDashboardBundle: t
|
|
9
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10
|
+
export {
|
|
11
|
+
i as V
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index-CPHaT2or.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CPHaT2or.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|