@apipass/design-system 5.9.0 → 6.1.0
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/lib/charts.index.cjs +1 -1
- package/dist/lib/charts.index.js +11 -8
- package/dist/lib/charts.index.js.map +1 -1
- package/dist/lib/embedded-styles.js +2 -2
- package/dist/lib/lib.index.cjs +1 -1
- package/dist/lib/lib.index.js +657 -657
- package/dist/lib/lib.index.js.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.cjs +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.cjs.map +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.js +217 -3
- package/dist/lib/ui/components/DataTable/DataTable.js.map +1 -1
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.cjs +1 -1
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.cjs.map +1 -1
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.js +75 -104
- package/dist/lib/ui/components/charts/BarChart/bar-chart-option.js.map +1 -1
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.cjs +1 -1
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.cjs.map +1 -1
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.js +27 -26
- package/dist/lib/ui/components/charts/ChartLegend/ChartLegend.js.map +1 -1
- package/dist/lib/ui/components/charts/PieChart/PieChart.cjs +2 -0
- package/dist/lib/ui/components/charts/PieChart/PieChart.cjs.map +1 -0
- package/dist/lib/ui/components/charts/PieChart/PieChart.js +177 -0
- package/dist/lib/ui/components/charts/PieChart/PieChart.js.map +1 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-option.cjs +2 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-option.cjs.map +1 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-option.js +124 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-option.js.map +1 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-slices.cjs +2 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-slices.cjs.map +1 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-slices.js +65 -0
- package/dist/lib/ui/components/charts/PieChart/pie-chart-slices.js.map +1 -0
- package/dist/lib/ui/components/charts/chart-color-tone.cjs +2 -0
- package/dist/lib/ui/components/charts/chart-color-tone.cjs.map +1 -0
- package/dist/lib/ui/components/charts/chart-color-tone.js +14 -0
- package/dist/lib/ui/components/charts/chart-color-tone.js.map +1 -0
- package/dist/lib/ui/components/charts/chart-label-color.cjs +2 -0
- package/dist/lib/ui/components/charts/chart-label-color.cjs.map +1 -0
- package/dist/lib/ui/components/charts/chart-label-color.js +35 -0
- package/dist/lib/ui/components/charts/chart-label-color.js.map +1 -0
- package/dist/lib/ui/components/charts/chart-palette.cjs +1 -1
- package/dist/lib/ui/components/charts/chart-palette.cjs.map +1 -1
- package/dist/lib/ui/components/charts/chart-palette.js +2 -1
- package/dist/lib/ui/components/charts/chart-palette.js.map +1 -1
- package/dist/lib/ui/components/charts/chart-theme.cjs +1 -1
- package/dist/lib/ui/components/charts/chart-theme.cjs.map +1 -1
- package/dist/lib/ui/components/charts/chart-theme.js +4 -3
- package/dist/lib/ui/components/charts/chart-theme.js.map +1 -1
- package/dist/lib/ui/components/charts/echarts-modules.cjs +1 -1
- package/dist/lib/ui/components/charts/echarts-modules.cjs.map +1 -1
- package/dist/lib/ui/components/charts/echarts-modules.js +11 -9
- package/dist/lib/ui/components/charts/echarts-modules.js.map +1 -1
- package/dist/lib/ui/primitives/Table/Table.cjs +1 -1
- package/dist/lib/ui/primitives/Table/Table.cjs.map +1 -1
- package/dist/lib/ui/primitives/Table/Table.js +123 -12
- package/dist/lib/ui/primitives/Table/Table.js.map +1 -1
- package/dist/types/charts.index.d.ts +1 -0
- package/dist/types/ui/components/DataTable/DataTable.d.ts +79 -11
- package/dist/types/ui/components/charts/ChartLegend/ChartLegend.d.ts +1 -0
- package/dist/types/ui/components/charts/PieChart/PieChart.d.ts +32 -0
- package/dist/types/ui/components/charts/PieChart/pie-chart-option.d.ts +13 -0
- package/dist/types/ui/components/charts/PieChart/pie-chart-slices.d.ts +30 -0
- package/dist/types/ui/components/charts/chart-color-tone.d.ts +1 -0
- package/dist/types/ui/components/charts/chart-label-color.d.ts +2 -0
- package/dist/types/ui/components/charts/chart-palette.d.ts +1 -0
- package/dist/types/ui/components/charts/chart-theme.d.ts +1 -0
- package/dist/types/ui/primitives/Table/Table.d.ts +32 -22
- package/package.json +1 -1
- package/dist/lib/ui/primitives/Table/DataDrivenTable.cjs +0 -2
- package/dist/lib/ui/primitives/Table/DataDrivenTable.cjs.map +0 -1
- package/dist/lib/ui/primitives/Table/DataDrivenTable.js +0 -196
- package/dist/lib/ui/primitives/Table/DataDrivenTable.js.map +0 -1
- package/dist/lib/ui/primitives/Table/TableBase.cjs +0 -2
- package/dist/lib/ui/primitives/Table/TableBase.cjs.map +0 -1
- package/dist/lib/ui/primitives/Table/TableBase.js +0 -127
- package/dist/lib/ui/primitives/Table/TableBase.js.map +0 -1
- package/dist/types/ui/primitives/Table/DataDrivenTable.d.ts +0 -68
- package/dist/types/ui/primitives/Table/TableBase.d.ts +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-palette.js","sources":["../../../../../src/ui/components/charts/chart-palette.ts"],"sourcesContent":["// Ordenada para afastar ao máximo os matizes de séries vizinhas: os cinco cromáticos do tema\n// no passo 500, e só depois os mesmos cinco no 700. As rampas neutras ficam de fora porque se\n// confundem com grade e eixo — a `brand-500` deste tema é cinza.\nexport const CHART_SERIES_COLOR_TOKENS: string[] = [\n \"--sds-color-blue-500\",\n \"--sds-color-green-500\",\n \"--sds-color-pink-500\",\n \"--sds-color-yellow-500\",\n \"--sds-color-red-500\",\n \"--sds-color-blue-700\",\n \"--sds-color-green-700\",\n \"--sds-color-pink-700\",\n \"--sds-color-yellow-700\",\n \"--sds-color-red-700\",\n];\n"],"names":["CHART_SERIES_COLOR_TOKENS"],"mappings":"AAGO,MAAMA,IAAsC;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
1
|
+
{"version":3,"file":"chart-palette.js","sources":["../../../../../src/ui/components/charts/chart-palette.ts"],"sourcesContent":["// Ordenada para afastar ao máximo os matizes de séries vizinhas: os cinco cromáticos do tema\n// no passo 500, e só depois os mesmos cinco no 700. As rampas neutras ficam de fora porque se\n// confundem com grade e eixo — a `brand-500` deste tema é cinza.\nexport const CHART_SERIES_COLOR_TOKENS: string[] = [\n \"--sds-color-blue-500\",\n \"--sds-color-green-500\",\n \"--sds-color-pink-500\",\n \"--sds-color-yellow-500\",\n \"--sds-color-red-500\",\n \"--sds-color-blue-700\",\n \"--sds-color-green-700\",\n \"--sds-color-pink-700\",\n \"--sds-color-yellow-700\",\n \"--sds-color-red-700\",\n];\n\nexport const CHART_NEUTRAL_COLOR_TOKEN: string = \"--sds-color-gray-400\";\n"],"names":["CHART_SERIES_COLOR_TOKENS","CHART_NEUTRAL_COLOR_TOKEN"],"mappings":"AAGO,MAAMA,IAAsC;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,IAAoC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chart-palette.cjs");function d(t,e){const r=window.getComputedStyle(t).getPropertyValue(e).trim();return r===""?void 0:r}function o(t,e,r){const l=t.getPropertyValue(e).trim();return l===""?r:l}function n(t){const e=window.getComputedStyle(t);return{seriesColors:a.CHART_SERIES_COLOR_TOKENS.map(r=>o(e,r,"#4b5563")),neutralColor:o(e,a.CHART_NEUTRAL_COLOR_TOKEN,"#9ca3af"),axisLineColor:o(e,"--sds-color-border-default-secondary","#9ca3af"),splitLineColor:o(e,"--sds-color-border-default-default","#e5e7eb"),labelColor:o(e,"--sds-color-text-default-secondary","#6b7280"),tooltipBackgroundColor:o(e,"--sds-color-background-default-default","#ffffff"),tooltipBorderColor:o(e,"--sds-color-border-default-default","#d1d5db"),fontFamily:o(e,"--sds-typography-body-font-family","inherit")}}exports.readChartTheme=n;exports.resolveColorToken=d;
|
|
2
2
|
//# sourceMappingURL=chart-theme.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-theme.cjs","sources":["../../../../../src/ui/components/charts/chart-theme.ts"],"sourcesContent":["import { CHART_SERIES_COLOR_TOKENS } from \"./chart-palette\";\n\nexport interface ChartTheme {\n seriesColors: string[];\n axisLineColor: string;\n splitLineColor: string;\n labelColor: string;\n tooltipBackgroundColor: string;\n tooltipBorderColor: string;\n fontFamily: string;\n}\n\n// O renderizador canvas não entende `var(--token)`, então a cor precisa chegar resolvida. A\n// resolução é contra o elemento hospedeiro para que tema aplicado em escopo menor que `:root`\n// continue valendo.\nexport function resolveColorToken(element: HTMLElement, token: string): string | undefined {\n const value: string = window.getComputedStyle(element).getPropertyValue(token).trim();\n return value === \"\" ? undefined : value;\n}\n\nfunction resolveToken(styles: CSSStyleDeclaration, token: string, fallback: string): string {\n const value: string = styles.getPropertyValue(token).trim();\n return value === \"\" ? fallback : value;\n}\n\nexport function readChartTheme(element: HTMLElement): ChartTheme {\n const styles: CSSStyleDeclaration = window.getComputedStyle(element);\n return {\n seriesColors: CHART_SERIES_COLOR_TOKENS.map((token: string) =>\n resolveToken(styles, token, \"#4b5563\"),\n ),\n // A escala de borda deste tema vai do claro para o escuro: `tertiary` é a mais escura,\n // não a mais suave. A grade fica na `default` para ficar atrás do dado, e o eixo na\n // `secondary` para se separar da grade sem competir com as linhas.\n axisLineColor: resolveToken(styles, \"--sds-color-border-default-secondary\", \"#9ca3af\"),\n splitLineColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#e5e7eb\"),\n labelColor: resolveToken(styles, \"--sds-color-text-default-secondary\", \"#6b7280\"),\n tooltipBackgroundColor: resolveToken(\n styles,\n \"--sds-color-background-default-default\",\n \"#ffffff\",\n ),\n tooltipBorderColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#d1d5db\"),\n fontFamily: resolveToken(styles, \"--sds-typography-body-font-family\", \"inherit\"),\n };\n}\n"],"names":["resolveColorToken","element","token","value","resolveToken","styles","fallback","readChartTheme","CHART_SERIES_COLOR_TOKENS"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chart-theme.cjs","sources":["../../../../../src/ui/components/charts/chart-theme.ts"],"sourcesContent":["import { CHART_SERIES_COLOR_TOKENS, CHART_NEUTRAL_COLOR_TOKEN as NEUTRAL_COLOR_TOKEN } from \"./chart-palette\";\n\nexport interface ChartTheme {\n seriesColors: string[];\n neutralColor: string;\n axisLineColor: string;\n splitLineColor: string;\n labelColor: string;\n tooltipBackgroundColor: string;\n tooltipBorderColor: string;\n fontFamily: string;\n}\n\n// O renderizador canvas não entende `var(--token)`, então a cor precisa chegar resolvida. A\n// resolução é contra o elemento hospedeiro para que tema aplicado em escopo menor que `:root`\n// continue valendo.\nexport function resolveColorToken(element: HTMLElement, token: string): string | undefined {\n const value: string = window.getComputedStyle(element).getPropertyValue(token).trim();\n return value === \"\" ? undefined : value;\n}\n\nfunction resolveToken(styles: CSSStyleDeclaration, token: string, fallback: string): string {\n const value: string = styles.getPropertyValue(token).trim();\n return value === \"\" ? fallback : value;\n}\n\nexport function readChartTheme(element: HTMLElement): ChartTheme {\n const styles: CSSStyleDeclaration = window.getComputedStyle(element);\n return {\n seriesColors: CHART_SERIES_COLOR_TOKENS.map((token: string) =>\n resolveToken(styles, token, \"#4b5563\"),\n ),\n neutralColor: resolveToken(styles, NEUTRAL_COLOR_TOKEN, \"#9ca3af\"),\n // A escala de borda deste tema vai do claro para o escuro: `tertiary` é a mais escura,\n // não a mais suave. A grade fica na `default` para ficar atrás do dado, e o eixo na\n // `secondary` para se separar da grade sem competir com as linhas.\n axisLineColor: resolveToken(styles, \"--sds-color-border-default-secondary\", \"#9ca3af\"),\n splitLineColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#e5e7eb\"),\n labelColor: resolveToken(styles, \"--sds-color-text-default-secondary\", \"#6b7280\"),\n tooltipBackgroundColor: resolveToken(\n styles,\n \"--sds-color-background-default-default\",\n \"#ffffff\",\n ),\n tooltipBorderColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#d1d5db\"),\n fontFamily: resolveToken(styles, \"--sds-typography-body-font-family\", \"inherit\"),\n };\n}\n"],"names":["resolveColorToken","element","token","value","resolveToken","styles","fallback","readChartTheme","CHART_SERIES_COLOR_TOKENS","NEUTRAL_COLOR_TOKEN"],"mappings":"uHAgBO,SAASA,EAAkBC,EAAsBC,EAAmC,CACzF,MAAMC,EAAgB,OAAO,iBAAiBF,CAAO,EAAE,iBAAiBC,CAAK,EAAE,KAAA,EAC/E,OAAOC,IAAU,GAAK,OAAYA,CACpC,CAEA,SAASC,EAAaC,EAA6BH,EAAeI,EAA0B,CAC1F,MAAMH,EAAgBE,EAAO,iBAAiBH,CAAK,EAAE,KAAA,EACrD,OAAOC,IAAU,GAAKG,EAAWH,CACnC,CAEO,SAASI,EAAeN,EAAkC,CAC/D,MAAMI,EAA8B,OAAO,iBAAiBJ,CAAO,EACnE,MAAO,CACL,aAAcO,EAAAA,0BAA0B,IAAKN,GAC3CE,EAAaC,EAAQH,EAAO,SAAS,CAAA,EAEvC,aAAcE,EAAaC,EAAQI,EAAAA,0BAAqB,SAAS,EAIjE,cAAeL,EAAaC,EAAQ,uCAAwC,SAAS,EACrF,eAAgBD,EAAaC,EAAQ,qCAAsC,SAAS,EACpF,WAAYD,EAAaC,EAAQ,qCAAsC,SAAS,EAChF,uBAAwBD,EACtBC,EACA,yCACA,SAAA,EAEF,mBAAoBD,EAAaC,EAAQ,qCAAsC,SAAS,EACxF,WAAYD,EAAaC,EAAQ,oCAAqC,SAAS,CAAA,CAEnF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CHART_SERIES_COLOR_TOKENS as d } from "./chart-palette.js";
|
|
1
|
+
import { CHART_SERIES_COLOR_TOKENS as d, CHART_NEUTRAL_COLOR_TOKEN as a } from "./chart-palette.js";
|
|
2
2
|
function s(t, o) {
|
|
3
3
|
const r = window.getComputedStyle(t).getPropertyValue(o).trim();
|
|
4
4
|
return r === "" ? void 0 : r;
|
|
@@ -7,12 +7,13 @@ function e(t, o, r) {
|
|
|
7
7
|
const l = t.getPropertyValue(o).trim();
|
|
8
8
|
return l === "" ? r : l;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function f(t) {
|
|
11
11
|
const o = window.getComputedStyle(t);
|
|
12
12
|
return {
|
|
13
13
|
seriesColors: d.map(
|
|
14
14
|
(r) => e(o, r, "#4b5563")
|
|
15
15
|
),
|
|
16
|
+
neutralColor: e(o, a, "#9ca3af"),
|
|
16
17
|
// A escala de borda deste tema vai do claro para o escuro: `tertiary` é a mais escura,
|
|
17
18
|
// não a mais suave. A grade fica na `default` para ficar atrás do dado, e o eixo na
|
|
18
19
|
// `secondary` para se separar da grade sem competir com as linhas.
|
|
@@ -29,7 +30,7 @@ function n(t) {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
f as readChartTheme,
|
|
33
34
|
s as resolveColorToken
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=chart-theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-theme.js","sources":["../../../../../src/ui/components/charts/chart-theme.ts"],"sourcesContent":["import { CHART_SERIES_COLOR_TOKENS } from \"./chart-palette\";\n\nexport interface ChartTheme {\n seriesColors: string[];\n axisLineColor: string;\n splitLineColor: string;\n labelColor: string;\n tooltipBackgroundColor: string;\n tooltipBorderColor: string;\n fontFamily: string;\n}\n\n// O renderizador canvas não entende `var(--token)`, então a cor precisa chegar resolvida. A\n// resolução é contra o elemento hospedeiro para que tema aplicado em escopo menor que `:root`\n// continue valendo.\nexport function resolveColorToken(element: HTMLElement, token: string): string | undefined {\n const value: string = window.getComputedStyle(element).getPropertyValue(token).trim();\n return value === \"\" ? undefined : value;\n}\n\nfunction resolveToken(styles: CSSStyleDeclaration, token: string, fallback: string): string {\n const value: string = styles.getPropertyValue(token).trim();\n return value === \"\" ? fallback : value;\n}\n\nexport function readChartTheme(element: HTMLElement): ChartTheme {\n const styles: CSSStyleDeclaration = window.getComputedStyle(element);\n return {\n seriesColors: CHART_SERIES_COLOR_TOKENS.map((token: string) =>\n resolveToken(styles, token, \"#4b5563\"),\n ),\n // A escala de borda deste tema vai do claro para o escuro: `tertiary` é a mais escura,\n // não a mais suave. A grade fica na `default` para ficar atrás do dado, e o eixo na\n // `secondary` para se separar da grade sem competir com as linhas.\n axisLineColor: resolveToken(styles, \"--sds-color-border-default-secondary\", \"#9ca3af\"),\n splitLineColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#e5e7eb\"),\n labelColor: resolveToken(styles, \"--sds-color-text-default-secondary\", \"#6b7280\"),\n tooltipBackgroundColor: resolveToken(\n styles,\n \"--sds-color-background-default-default\",\n \"#ffffff\",\n ),\n tooltipBorderColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#d1d5db\"),\n fontFamily: resolveToken(styles, \"--sds-typography-body-font-family\", \"inherit\"),\n };\n}\n"],"names":["resolveColorToken","element","token","value","resolveToken","styles","fallback","readChartTheme","CHART_SERIES_COLOR_TOKENS"],"mappings":";
|
|
1
|
+
{"version":3,"file":"chart-theme.js","sources":["../../../../../src/ui/components/charts/chart-theme.ts"],"sourcesContent":["import { CHART_SERIES_COLOR_TOKENS, CHART_NEUTRAL_COLOR_TOKEN as NEUTRAL_COLOR_TOKEN } from \"./chart-palette\";\n\nexport interface ChartTheme {\n seriesColors: string[];\n neutralColor: string;\n axisLineColor: string;\n splitLineColor: string;\n labelColor: string;\n tooltipBackgroundColor: string;\n tooltipBorderColor: string;\n fontFamily: string;\n}\n\n// O renderizador canvas não entende `var(--token)`, então a cor precisa chegar resolvida. A\n// resolução é contra o elemento hospedeiro para que tema aplicado em escopo menor que `:root`\n// continue valendo.\nexport function resolveColorToken(element: HTMLElement, token: string): string | undefined {\n const value: string = window.getComputedStyle(element).getPropertyValue(token).trim();\n return value === \"\" ? undefined : value;\n}\n\nfunction resolveToken(styles: CSSStyleDeclaration, token: string, fallback: string): string {\n const value: string = styles.getPropertyValue(token).trim();\n return value === \"\" ? fallback : value;\n}\n\nexport function readChartTheme(element: HTMLElement): ChartTheme {\n const styles: CSSStyleDeclaration = window.getComputedStyle(element);\n return {\n seriesColors: CHART_SERIES_COLOR_TOKENS.map((token: string) =>\n resolveToken(styles, token, \"#4b5563\"),\n ),\n neutralColor: resolveToken(styles, NEUTRAL_COLOR_TOKEN, \"#9ca3af\"),\n // A escala de borda deste tema vai do claro para o escuro: `tertiary` é a mais escura,\n // não a mais suave. A grade fica na `default` para ficar atrás do dado, e o eixo na\n // `secondary` para se separar da grade sem competir com as linhas.\n axisLineColor: resolveToken(styles, \"--sds-color-border-default-secondary\", \"#9ca3af\"),\n splitLineColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#e5e7eb\"),\n labelColor: resolveToken(styles, \"--sds-color-text-default-secondary\", \"#6b7280\"),\n tooltipBackgroundColor: resolveToken(\n styles,\n \"--sds-color-background-default-default\",\n \"#ffffff\",\n ),\n tooltipBorderColor: resolveToken(styles, \"--sds-color-border-default-default\", \"#d1d5db\"),\n fontFamily: resolveToken(styles, \"--sds-typography-body-font-family\", \"inherit\"),\n };\n}\n"],"names":["resolveColorToken","element","token","value","resolveToken","styles","fallback","readChartTheme","CHART_SERIES_COLOR_TOKENS","NEUTRAL_COLOR_TOKEN"],"mappings":";AAgBO,SAASA,EAAkBC,GAAsBC,GAAmC;AACzF,QAAMC,IAAgB,OAAO,iBAAiBF,CAAO,EAAE,iBAAiBC,CAAK,EAAE,KAAA;AAC/E,SAAOC,MAAU,KAAK,SAAYA;AACpC;AAEA,SAASC,EAAaC,GAA6BH,GAAeI,GAA0B;AAC1F,QAAMH,IAAgBE,EAAO,iBAAiBH,CAAK,EAAE,KAAA;AACrD,SAAOC,MAAU,KAAKG,IAAWH;AACnC;AAEO,SAASI,EAAeN,GAAkC;AAC/D,QAAMI,IAA8B,OAAO,iBAAiBJ,CAAO;AACnE,SAAO;AAAA,IACL,cAAcO,EAA0B;AAAA,MAAI,CAACN,MAC3CE,EAAaC,GAAQH,GAAO,SAAS;AAAA,IAAA;AAAA,IAEvC,cAAcE,EAAaC,GAAQI,GAAqB,SAAS;AAAA;AAAA;AAAA;AAAA,IAIjE,eAAeL,EAAaC,GAAQ,wCAAwC,SAAS;AAAA,IACrF,gBAAgBD,EAAaC,GAAQ,sCAAsC,SAAS;AAAA,IACpF,YAAYD,EAAaC,GAAQ,sCAAsC,SAAS;AAAA,IAChF,wBAAwBD;AAAA,MACtBC;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,oBAAoBD,EAAaC,GAAQ,sCAAsC,SAAS;AAAA,IACxF,YAAYD,EAAaC,GAAQ,qCAAqC,SAAS;AAAA,EAAA;AAEnF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("echarts/charts"),o=require("echarts/components"),a=require("echarts/core"),u=require("echarts/renderers");function i(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=i(a);function l(){c.use([r.LineChart,r.BarChart,r.PieChart,r.SunburstChart,o.GridComponent,o.TooltipComponent,o.LegendComponent,u.CanvasRenderer])}exports.echarts=c;exports.registerEchartsModules=l;
|
|
2
2
|
//# sourceMappingURL=echarts-modules.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-modules.cjs","sources":["../../../../../src/ui/components/charts/echarts-modules.ts"],"sourcesContent":["import { BarChart, LineChart } from \"echarts/charts\";\nimport { GridComponent, LegendComponent, TooltipComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { CanvasRenderer } from \"echarts/renderers\";\n\n// Precisa ser função, e não efeito de módulo: no topo do arquivo o rollup apaga a chamada ao\n// empacotar a lib (retorno não usado = código morto), e o consumidor recebe os imports sem\n// registro nenhum, quebrando em runtime com \"series.type: line not exists\".\nexport function registerEchartsModules(): void {\n echarts.use([\n LineChart,\n BarChart,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n ]);\n}\n\nexport { echarts };\n"],"names":["registerEchartsModules","echarts","LineChart","BarChart","GridComponent","TooltipComponent","LegendComponent","CanvasRenderer"],"mappings":"qeAQO,SAASA,GAA+B,CAC7CC,EAAQ,IAAI,CACVC,EAAAA,UACAC,EAAAA,SACAC,EAAAA,cACAC,EAAAA,iBACAC,EAAAA,gBACAC,EAAAA,cAAA,CACD,CACH"}
|
|
1
|
+
{"version":3,"file":"echarts-modules.cjs","sources":["../../../../../src/ui/components/charts/echarts-modules.ts"],"sourcesContent":["import { BarChart, LineChart, PieChart, SunburstChart } from \"echarts/charts\";\nimport { GridComponent, LegendComponent, TooltipComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { CanvasRenderer } from \"echarts/renderers\";\n\n// Precisa ser função, e não efeito de módulo: no topo do arquivo o rollup apaga a chamada ao\n// empacotar a lib (retorno não usado = código morto), e o consumidor recebe os imports sem\n// registro nenhum, quebrando em runtime com \"series.type: line not exists\".\nexport function registerEchartsModules(): void {\n echarts.use([\n LineChart,\n BarChart,\n PieChart,\n SunburstChart,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n ]);\n}\n\nexport { echarts };\n"],"names":["registerEchartsModules","echarts","LineChart","BarChart","PieChart","SunburstChart","GridComponent","TooltipComponent","LegendComponent","CanvasRenderer"],"mappings":"qeAQO,SAASA,GAA+B,CAC7CC,EAAQ,IAAI,CACVC,EAAAA,UACAC,EAAAA,SACAC,EAAAA,SACAC,EAAAA,cACAC,EAAAA,cACAC,EAAAA,iBACAC,EAAAA,gBACAC,EAAAA,cAAA,CACD,CACH"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { LineChart as
|
|
2
|
-
import { GridComponent as
|
|
3
|
-
import * as
|
|
1
|
+
import { LineChart as r, BarChart as o, PieChart as t, SunburstChart as e } from "echarts/charts";
|
|
2
|
+
import { GridComponent as n, TooltipComponent as m, LegendComponent as a } from "echarts/components";
|
|
3
|
+
import * as i from "echarts/core";
|
|
4
4
|
import { CanvasRenderer as p } from "echarts/renderers";
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
o,
|
|
5
|
+
function f() {
|
|
6
|
+
i.use([
|
|
8
7
|
r,
|
|
9
|
-
|
|
8
|
+
o,
|
|
10
9
|
t,
|
|
10
|
+
e,
|
|
11
11
|
n,
|
|
12
|
+
m,
|
|
13
|
+
a,
|
|
12
14
|
p
|
|
13
15
|
]);
|
|
14
16
|
}
|
|
15
17
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
i as echarts,
|
|
19
|
+
f as registerEchartsModules
|
|
18
20
|
};
|
|
19
21
|
//# sourceMappingURL=echarts-modules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-modules.js","sources":["../../../../../src/ui/components/charts/echarts-modules.ts"],"sourcesContent":["import { BarChart, LineChart } from \"echarts/charts\";\nimport { GridComponent, LegendComponent, TooltipComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { CanvasRenderer } from \"echarts/renderers\";\n\n// Precisa ser função, e não efeito de módulo: no topo do arquivo o rollup apaga a chamada ao\n// empacotar a lib (retorno não usado = código morto), e o consumidor recebe os imports sem\n// registro nenhum, quebrando em runtime com \"series.type: line not exists\".\nexport function registerEchartsModules(): void {\n echarts.use([\n LineChart,\n BarChart,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n ]);\n}\n\nexport { echarts };\n"],"names":["registerEchartsModules","echarts","LineChart","BarChart","GridComponent","TooltipComponent","LegendComponent","CanvasRenderer"],"mappings":";;;;AAQO,SAASA,IAA+B;AAC7C,EAAAC,EAAQ,IAAI;AAAA,IACVC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA,CACD;AACH;"}
|
|
1
|
+
{"version":3,"file":"echarts-modules.js","sources":["../../../../../src/ui/components/charts/echarts-modules.ts"],"sourcesContent":["import { BarChart, LineChart, PieChart, SunburstChart } from \"echarts/charts\";\nimport { GridComponent, LegendComponent, TooltipComponent } from \"echarts/components\";\nimport * as echarts from \"echarts/core\";\nimport { CanvasRenderer } from \"echarts/renderers\";\n\n// Precisa ser função, e não efeito de módulo: no topo do arquivo o rollup apaga a chamada ao\n// empacotar a lib (retorno não usado = código morto), e o consumidor recebe os imports sem\n// registro nenhum, quebrando em runtime com \"series.type: line not exists\".\nexport function registerEchartsModules(): void {\n echarts.use([\n LineChart,\n BarChart,\n PieChart,\n SunburstChart,\n GridComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n ]);\n}\n\nexport { echarts };\n"],"names":["registerEchartsModules","echarts","LineChart","BarChart","PieChart","SunburstChart","GridComponent","TooltipComponent","LegendComponent","CanvasRenderer"],"mappings":";;;;AAQO,SAASA,IAA+B;AAC7C,EAAAC,EAAQ,IAAI;AAAA,IACVC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../../vendor/clsx/dist/clsx.cjs"),m=require("react"),n=require("react-aria-components");;/* empty css */const g=require("../../icons/IconChevronDown.cjs"),f=require("../../icons/IconChevronUp.cjs"),j=require("../Checkbox/Checkbox.cjs"),p=require("../Radio/Radio.cjs"),h=m.createContext("checkbox");function v(s){const l=Number(s);return`${s}`.trim()!==""&&Number.isFinite(l)?`${l}px`:`${s}`}function y({bleed:s=!1,dense:l=!1,grid:t=!1,striped:o=!1,selectionType:i="checkbox",maxHeight:a,className:d,...r}){const b=a!==void 0,C=c.clsx(d,"table-container",s&&"table-container-bleed",b&&"table-container-scrollable"),N=b?{"--table-max-height":v(a)}:void 0,T=c.clsx("sds-table",s&&"table-bleed",l&&"table-dense",t&&"table-grid",o&&"sds-table-striped");return e.jsx("div",{className:C,style:N,children:e.jsx(h.Provider,{value:i,children:e.jsx(n.Table,{className:T,...r})})})}function x({align:s="start",className:l,...t}){const o=c.clsx(l,"table-column",`table-align-${s}`);return e.jsx(n.Column,{className:o,...t,children:({allowsSorting:i,sortDirection:a})=>e.jsx("div",{className:c.clsx("table-column-inner"),children:e.jsxs(e.Fragment,{children:[t.children,i&&e.jsx("span",{"aria-hidden":"true",className:c.clsx("sort-indicator",!a&&"sort-indicator-unsorted"),children:a==="descending"?e.jsx(g.IconChevronDown,{}):e.jsx(f.IconChevronUp,{})})]})})})}function k({className:s,...l}){return e.jsx(n.TableBody,{...l})}function q({className:s,columns:l,children:t,...o}){const{selectionBehavior:i,selectionMode:a,allowsDragging:d}=n.useTableOptions(),r=m.useContext(h),b=c.clsx(s,"table-head");return e.jsxs(n.TableHeader,{className:b,...o,children:[d&&e.jsx(x,{}),i==="toggle"&&e.jsx(x,{className:c.clsx("table-selection-col",r==="radio"&&"table-selection-col--radio"),children:a==="multiple"&&e.jsx(n.Checkbox,{slot:"selection",className:"table-selection-checkbox",children:e.jsx(j.Checkbox,{})})}),e.jsx(n.Collection,{items:l,children:t})]})}function w({id:s,columns:l,children:t,className:o,...i}){const{selectionBehavior:a,allowsDragging:d}=n.useTableOptions(),r=m.useContext(h),b=c.clsx(o,"table-row");return e.jsxs(n.Row,{id:s,...i,className:b,children:[d&&e.jsx(u,{children:e.jsx(n.Button,{slot:"drag",children:"≡"})}),a==="toggle"&&e.jsx(u,{className:c.clsx("table-selection-cell",r==="radio"&&"table-selection-cell--radio"),children:e.jsx(n.Checkbox,{slot:"selection",className:"table-selection-checkbox",children:r==="radio"?e.jsx(p.Radio,{}):e.jsx(j.Checkbox,{})})}),e.jsx(n.Collection,{items:l,children:t})]})}function u({align:s="start",className:l,...t}){const o=c.clsx(l,"table-cell",`table-align-${s}`);return e.jsx(n.Cell,{className:o,...t})}exports.Table=y;exports.TableBody=k;exports.TableCell=u;exports.TableColumn=x;exports.TableHead=q;exports.TableRow=w;
|
|
2
2
|
//# sourceMappingURL=Table.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.cjs","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { DataDrivenTable, type DataDrivenTableProps } from \"./DataDrivenTable\";\nimport { TableBase, type TableBaseProps } from \"./TableBase\";\n\nexport {\n TableBody,\n TableCell,\n TableColumn,\n TableHead,\n TableRow,\n type TableBodyProps,\n type TableCellProps,\n type TableColumnProps,\n type TableHeadProps,\n type TableRowProps,\n} from \"./TableBase\";\nexport type { Column, DataDrivenTableProps, RowActionDef } from \"./DataDrivenTable\";\n\n/**\n * Props do modo composição: o consumidor monta cabeçalho e linhas com `TableHead`,\n * `TableColumn`, `TableBody`, `TableRow` e `TableCell`. `columns` fica proibido aqui\n * porque é ele que ativa o modo data-driven.\n */\nexport type TableProps = TableBaseProps & { columns?: never };\n\n/**\n * Tabela em dois modos, decididos pela presença de `columns`:\n *\n * - **Data-driven** (`columns` + `data`): toolbar com busca, paginação, seleção,\n * ações por linha, estados de loading/vazio e linhas aninhadas. Substitui o antigo\n * `DataTable`.\n * - **Composição** (sem `columns`): primitivo sobre o `Table` do react-aria, com os\n * filhos montados pelo consumidor.\n */\nexport function Table<T extends { id: string }>(\n props: DataDrivenTableProps<T>,\n): ReturnType<typeof DataDrivenTable>;\nexport function Table(props: TableProps): ReturnType<typeof TableBase>;\nexport function Table<T extends { id: string }>(\n props: DataDrivenTableProps<T> | TableProps,\n) {\n if (\"columns\" in props && props.columns) {\n return <DataDrivenTable {...(props as DataDrivenTableProps<T>)} />;\n }\n return <TableBase {...(props as TableProps)} />;\n}\n"],"names":["Table","props","jsx","DataDrivenTable","TableBase"],"mappings":"qLAqCO,SAASA,EACdC,EACA,CACA,MAAI,YAAaA,GAASA,EAAM,QACvBC,MAACC,EAAAA,gBAAA,CAAiB,GAAIF,CAAA,CAAmC,EAE3DC,MAACE,EAAAA,UAAA,CAAW,GAAIH,CAAA,CAAsB,CAC/C"}
|
|
1
|
+
{"version":3,"file":"Table.cjs","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox, Radio } from \"primitives\";\nimport { createContext, useContext, type CSSProperties } from \"react\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\n/**\n * Visual style of the built-in selection control rendered in the selection\n * column (header \"select all\" + per-row toggle). \"radio\" is for\n * `selectionMode=\"single\"` tables where a round, single-choice control reads\n * better than a checkbox — the header never renders a control either way\n * (there is no \"select all\" for a single choice).\n */\ntype SelectionType = \"checkbox\" | \"radio\";\nconst SelectionTypeContext = createContext<SelectionType>(\"checkbox\");\n\nfunction toCssLength(value: number | string): string {\n const numericValue = Number(value);\n const isUnitlessNumber =\n `${value}`.trim() !== \"\" && Number.isFinite(numericValue);\n return isUnitlessNumber ? `${numericValue}px` : `${value}`;\n}\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n selectionType?: SelectionType;\n maxHeight?: number | string;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n selectionType = \"checkbox\",\n maxHeight,\n className,\n ...props\n}: TableProps) {\n const scrollsVertically = maxHeight !== undefined;\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n scrollsVertically && \"table-container-scrollable\",\n );\n const containerStyle = scrollsVertically\n ? ({ \"--table-max-height\": toCssLength(maxHeight) } as CSSProperties)\n : undefined;\n const tableClassNames = clsx(\n \"sds-table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"sds-table-striped\",\n );\n return (\n <div className={containerClassNames} style={containerStyle}>\n <SelectionTypeContext.Provider value={selectionType}>\n <RACTable className={tableClassNames} {...props} />\n </SelectionTypeContext.Provider>\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span\n aria-hidden=\"true\"\n className={clsx(\n \"sort-indicator\",\n !sortDirection && \"sort-indicator-unsorted\",\n )}\n >\n {sortDirection === \"descending\" ? (\n <IconChevronDown />\n ) : (\n <IconChevronUp />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const selectionType = useContext(SelectionTypeContext);\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn\n className={clsx(\n \"table-selection-col\",\n selectionType === \"radio\" && \"table-selection-col--radio\",\n )}\n >\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const selectionType = useContext(SelectionTypeContext);\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell\n className={clsx(\n \"table-selection-cell\",\n selectionType === \"radio\" && \"table-selection-cell--radio\",\n )}\n >\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n {selectionType === \"radio\" ? <Radio /> : <Checkbox />}\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["SelectionTypeContext","createContext","toCssLength","value","numericValue","Table","bleed","dense","grid","striped","selectionType","maxHeight","className","props","scrollsVertically","containerClassNames","clsx","containerStyle","tableClassNames","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsx","jsxs","Fragment","IconChevronDown","IconChevronUp","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","useContext","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","Radio","RACCell"],"mappings":"0ZAkCMA,EAAuBC,EAAAA,cAA6B,UAAU,EAEpE,SAASC,EAAYC,EAAgC,CACnD,MAAMC,EAAe,OAAOD,CAAK,EAGjC,MADE,GAAGA,CAAK,GAAG,SAAW,IAAM,OAAO,SAASC,CAAY,EAChC,GAAGA,CAAY,KAAO,GAAGD,CAAK,EAC1D,CAUO,SAASE,EAAM,CACpB,MAAAC,EAAQ,GACR,MAAAC,EAAQ,GACR,KAAAC,EAAO,GACP,QAAAC,EAAU,GACV,cAAAC,EAAgB,WAChB,UAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAe,CACb,MAAMC,EAAoBH,IAAc,OAClCI,EAAsBC,EAAAA,KAC1BJ,EACA,kBACAN,GAAS,wBACTQ,GAAqB,4BAAA,EAEjBG,EAAiBH,EAClB,CAAE,qBAAsBZ,EAAYS,CAAS,GAC9C,OACEO,EAAkBF,EAAAA,KACtB,YACAV,GAAS,cACTC,GAAS,cACTC,GAAQ,aACRC,GAAW,mBAAA,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,EAAaN,EAAAA,KAAKJ,EAAW,aAAc,eAAeS,CAAK,EAAE,EACvE,OAAOK,EAAAA,IAAC0B,EAAAA,KAAA,CAAQ,UAAW9B,EAAa,GAAGT,EAAO,CACpD"}
|
|
@@ -1,16 +1,127 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TableBody as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as e, jsxs as b, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as a } from "../../../vendor/clsx/dist/clsx.js";
|
|
3
|
+
import { createContext as $, useContext as N } from "react";
|
|
4
|
+
import { Table as k, Column as w, TableBody as B, useTableOptions as f, TableHeader as R, Checkbox as g, Collection as p, Row as U, Button as j, Cell as D } from "react-aria-components";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { IconChevronDown as F } from "../../icons/IconChevronDown.js";
|
|
7
|
+
import { IconChevronUp as I } from "../../icons/IconChevronUp.js";
|
|
8
|
+
import { Checkbox as C } from "../Checkbox/Checkbox.js";
|
|
9
|
+
import { Radio as S } from "../Radio/Radio.js";
|
|
10
|
+
const d = $("checkbox");
|
|
11
|
+
function V(l) {
|
|
12
|
+
const t = Number(l);
|
|
13
|
+
return `${l}`.trim() !== "" && Number.isFinite(t) ? `${t}px` : `${l}`;
|
|
14
|
+
}
|
|
15
|
+
function G({
|
|
16
|
+
bleed: l = !1,
|
|
17
|
+
dense: t = !1,
|
|
18
|
+
grid: s = !1,
|
|
19
|
+
striped: o = !1,
|
|
20
|
+
selectionType: c = "checkbox",
|
|
21
|
+
maxHeight: n,
|
|
22
|
+
className: m,
|
|
23
|
+
...i
|
|
24
|
+
}) {
|
|
25
|
+
const r = n !== void 0, x = a(
|
|
26
|
+
m,
|
|
27
|
+
"table-container",
|
|
28
|
+
l && "table-container-bleed",
|
|
29
|
+
r && "table-container-scrollable"
|
|
30
|
+
), T = r ? { "--table-max-height": V(n) } : void 0, y = a(
|
|
31
|
+
"sds-table",
|
|
32
|
+
l && "table-bleed",
|
|
33
|
+
t && "table-dense",
|
|
34
|
+
s && "table-grid",
|
|
35
|
+
o && "sds-table-striped"
|
|
36
|
+
);
|
|
37
|
+
return /* @__PURE__ */ e("div", { className: x, style: T, children: /* @__PURE__ */ e(d.Provider, { value: c, children: /* @__PURE__ */ e(k, { className: y, ...i }) }) });
|
|
38
|
+
}
|
|
39
|
+
function h({
|
|
40
|
+
align: l = "start",
|
|
41
|
+
className: t,
|
|
42
|
+
...s
|
|
43
|
+
}) {
|
|
44
|
+
const o = a(t, "table-column", `table-align-${l}`);
|
|
45
|
+
return /* @__PURE__ */ e(w, { className: o, ...s, children: ({ allowsSorting: c, sortDirection: n }) => /* @__PURE__ */ e("div", { className: a("table-column-inner"), children: /* @__PURE__ */ b(v, { children: [
|
|
46
|
+
s.children,
|
|
47
|
+
c && /* @__PURE__ */ e(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: a(
|
|
52
|
+
"sort-indicator",
|
|
53
|
+
!n && "sort-indicator-unsorted"
|
|
54
|
+
),
|
|
55
|
+
children: n === "descending" ? /* @__PURE__ */ e(F, {}) : /* @__PURE__ */ e(I, {})
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] }) }) });
|
|
59
|
+
}
|
|
60
|
+
function J({
|
|
61
|
+
className: l,
|
|
62
|
+
...t
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ e(B, { ...t });
|
|
65
|
+
}
|
|
66
|
+
function K({
|
|
67
|
+
className: l,
|
|
68
|
+
columns: t,
|
|
69
|
+
children: s,
|
|
70
|
+
...o
|
|
71
|
+
}) {
|
|
72
|
+
const { selectionBehavior: c, selectionMode: n, allowsDragging: m } = f(), i = N(d), r = a(l, "table-head");
|
|
73
|
+
return /* @__PURE__ */ b(R, { className: r, ...o, children: [
|
|
74
|
+
m && /* @__PURE__ */ e(h, {}),
|
|
75
|
+
c === "toggle" && /* @__PURE__ */ e(
|
|
76
|
+
h,
|
|
77
|
+
{
|
|
78
|
+
className: a(
|
|
79
|
+
"table-selection-col",
|
|
80
|
+
i === "radio" && "table-selection-col--radio"
|
|
81
|
+
),
|
|
82
|
+
children: n === "multiple" && /* @__PURE__ */ e(g, { slot: "selection", className: "table-selection-checkbox", children: /* @__PURE__ */ e(C, {}) })
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ e(p, { items: t, children: s })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
function Q({
|
|
89
|
+
id: l,
|
|
90
|
+
columns: t,
|
|
91
|
+
children: s,
|
|
92
|
+
className: o,
|
|
93
|
+
...c
|
|
94
|
+
}) {
|
|
95
|
+
const { selectionBehavior: n, allowsDragging: m } = f(), i = N(d), r = a(o, "table-row");
|
|
96
|
+
return /* @__PURE__ */ b(U, { id: l, ...c, className: r, children: [
|
|
97
|
+
m && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(j, { slot: "drag", children: "≡" }) }),
|
|
98
|
+
n === "toggle" && /* @__PURE__ */ e(
|
|
99
|
+
u,
|
|
100
|
+
{
|
|
101
|
+
className: a(
|
|
102
|
+
"table-selection-cell",
|
|
103
|
+
i === "radio" && "table-selection-cell--radio"
|
|
104
|
+
),
|
|
105
|
+
children: /* @__PURE__ */ e(g, { slot: "selection", className: "table-selection-checkbox", children: i === "radio" ? /* @__PURE__ */ e(S, {}) : /* @__PURE__ */ e(C, {}) })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ e(p, { items: t, children: s })
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
function u({
|
|
112
|
+
align: l = "start",
|
|
113
|
+
className: t,
|
|
114
|
+
...s
|
|
115
|
+
}) {
|
|
116
|
+
const o = a(t, "table-cell", `table-align-${l}`);
|
|
117
|
+
return /* @__PURE__ */ e(D, { className: o, ...s });
|
|
7
118
|
}
|
|
8
119
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
120
|
+
G as Table,
|
|
121
|
+
J as TableBody,
|
|
122
|
+
u as TableCell,
|
|
123
|
+
h as TableColumn,
|
|
124
|
+
K as TableHead,
|
|
125
|
+
Q as TableRow
|
|
15
126
|
};
|
|
16
127
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { DataDrivenTable, type DataDrivenTableProps } from \"./DataDrivenTable\";\nimport { TableBase, type TableBaseProps } from \"./TableBase\";\n\nexport {\n TableBody,\n TableCell,\n TableColumn,\n TableHead,\n TableRow,\n type TableBodyProps,\n type TableCellProps,\n type TableColumnProps,\n type TableHeadProps,\n type TableRowProps,\n} from \"./TableBase\";\nexport type { Column, DataDrivenTableProps, RowActionDef } from \"./DataDrivenTable\";\n\n/**\n * Props do modo composição: o consumidor monta cabeçalho e linhas com `TableHead`,\n * `TableColumn`, `TableBody`, `TableRow` e `TableCell`. `columns` fica proibido aqui\n * porque é ele que ativa o modo data-driven.\n */\nexport type TableProps = TableBaseProps & { columns?: never };\n\n/**\n * Tabela em dois modos, decididos pela presença de `columns`:\n *\n * - **Data-driven** (`columns` + `data`): toolbar com busca, paginação, seleção,\n * ações por linha, estados de loading/vazio e linhas aninhadas. Substitui o antigo\n * `DataTable`.\n * - **Composição** (sem `columns`): primitivo sobre o `Table` do react-aria, com os\n * filhos montados pelo consumidor.\n */\nexport function Table<T extends { id: string }>(\n props: DataDrivenTableProps<T>,\n): ReturnType<typeof DataDrivenTable>;\nexport function Table(props: TableProps): ReturnType<typeof TableBase>;\nexport function Table<T extends { id: string }>(\n props: DataDrivenTableProps<T> | TableProps,\n) {\n if (\"columns\" in props && props.columns) {\n return <DataDrivenTable {...(props as DataDrivenTableProps<T>)} />;\n }\n return <TableBase {...(props as TableProps)} />;\n}\n"],"names":["Table","props","jsx","DataDrivenTable","TableBase"],"mappings":";;;;AAqCO,SAASA,EACdC,GACA;AACA,SAAI,aAAaA,KAASA,EAAM,UACvB,gBAAAC,EAACC,GAAA,EAAiB,GAAIF,EAAA,CAAmC,IAE3D,gBAAAC,EAACE,GAAA,EAAW,GAAIH,EAAA,CAAsB;AAC/C;"}
|
|
1
|
+
{"version":3,"file":"Table.js","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox, Radio } from \"primitives\";\nimport { createContext, useContext, type CSSProperties } from \"react\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\n/**\n * Visual style of the built-in selection control rendered in the selection\n * column (header \"select all\" + per-row toggle). \"radio\" is for\n * `selectionMode=\"single\"` tables where a round, single-choice control reads\n * better than a checkbox — the header never renders a control either way\n * (there is no \"select all\" for a single choice).\n */\ntype SelectionType = \"checkbox\" | \"radio\";\nconst SelectionTypeContext = createContext<SelectionType>(\"checkbox\");\n\nfunction toCssLength(value: number | string): string {\n const numericValue = Number(value);\n const isUnitlessNumber =\n `${value}`.trim() !== \"\" && Number.isFinite(numericValue);\n return isUnitlessNumber ? `${numericValue}px` : `${value}`;\n}\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n selectionType?: SelectionType;\n maxHeight?: number | string;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n selectionType = \"checkbox\",\n maxHeight,\n className,\n ...props\n}: TableProps) {\n const scrollsVertically = maxHeight !== undefined;\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n scrollsVertically && \"table-container-scrollable\",\n );\n const containerStyle = scrollsVertically\n ? ({ \"--table-max-height\": toCssLength(maxHeight) } as CSSProperties)\n : undefined;\n const tableClassNames = clsx(\n \"sds-table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"sds-table-striped\",\n );\n return (\n <div className={containerClassNames} style={containerStyle}>\n <SelectionTypeContext.Provider value={selectionType}>\n <RACTable className={tableClassNames} {...props} />\n </SelectionTypeContext.Provider>\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span\n aria-hidden=\"true\"\n className={clsx(\n \"sort-indicator\",\n !sortDirection && \"sort-indicator-unsorted\",\n )}\n >\n {sortDirection === \"descending\" ? (\n <IconChevronDown />\n ) : (\n <IconChevronUp />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const selectionType = useContext(SelectionTypeContext);\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn\n className={clsx(\n \"table-selection-col\",\n selectionType === \"radio\" && \"table-selection-col--radio\",\n )}\n >\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const selectionType = useContext(SelectionTypeContext);\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell\n className={clsx(\n \"table-selection-cell\",\n selectionType === \"radio\" && \"table-selection-cell--radio\",\n )}\n >\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n {selectionType === \"radio\" ? <Radio /> : <Checkbox />}\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["SelectionTypeContext","createContext","toCssLength","value","numericValue","Table","bleed","dense","grid","striped","selectionType","maxHeight","className","props","scrollsVertically","containerClassNames","clsx","containerStyle","tableClassNames","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsx","jsxs","Fragment","IconChevronDown","IconChevronUp","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","useContext","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","Radio","RACCell"],"mappings":";;;;;;;;;AAkCA,MAAMA,IAAuBC,EAA6B,UAAU;AAEpE,SAASC,EAAYC,GAAgC;AACnD,QAAMC,IAAe,OAAOD,CAAK;AAGjC,SADE,GAAGA,CAAK,GAAG,WAAW,MAAM,OAAO,SAASC,CAAY,IAChC,GAAGA,CAAY,OAAO,GAAGD,CAAK;AAC1D;AAUO,SAASE,EAAM;AAAA,EACpB,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,eAAAC,IAAgB;AAAA,EAChB,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAe;AACb,QAAMC,IAAoBH,MAAc,QAClCI,IAAsBC;AAAA,IAC1BJ;AAAA,IACA;AAAA,IACAN,KAAS;AAAA,IACTQ,KAAqB;AAAA,EAAA,GAEjBG,IAAiBH,IAClB,EAAE,sBAAsBZ,EAAYS,CAAS,MAC9C,QACEO,IAAkBF;AAAA,IACtB;AAAA,IACAV,KAAS;AAAA,IACTC,KAAS;AAAA,IACTC,KAAQ;AAAA,IACRC,KAAW;AAAA,EAAA;AAEb,2BACG,OAAA,EAAI,WAAWM,GAAqB,OAAOE,GAC1C,4BAACjB,EAAqB,UAArB,EAA8B,OAAOU,GACpC,4BAACS,GAAA,EAAS,WAAWD,GAAkB,GAAGL,GAAO,GACnD,EAAA,CACF;AAEJ;AAKO,SAASO,EAAY;AAAA,EAC1B,OAAAC,IAAQ;AAAA,EACR,WAAAT;AAAA,EACA,GAAGC;AACL,GAAqB;AACnB,QAAMS,IAAaN,EAAKJ,GAAW,gBAAgB,eAAeS,CAAK,EAAE;AACzE,2BACGE,GAAA,EAAU,WAAWD,GAAa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 @@ export * from "./ui/components/charts/BarChart/BarChart";
|
|
|
2
2
|
export * from "./ui/components/charts/chart-palette";
|
|
3
3
|
export * from "./ui/components/charts/ChartColorPicker/ChartColorPicker";
|
|
4
4
|
export * from "./ui/components/charts/ChartLegend/ChartLegend";
|
|
5
|
+
export * from "./ui/components/charts/PieChart/PieChart";
|
|
5
6
|
export * from "./ui/components/charts/TimeSeriesChart/TimeSeriesChart";
|
|
@@ -1,14 +1,82 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Selection, SortDescriptor } from "react-aria-components";
|
|
2
3
|
import "./datatable.css";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export interface Column<T> {
|
|
5
|
+
key: keyof T | string;
|
|
6
|
+
label: string;
|
|
7
|
+
align?: "start" | "center" | "right";
|
|
8
|
+
render?: (item: T) => ReactNode;
|
|
9
|
+
/** When true, the header becomes clickable and the rows can be sorted by this column. */
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
/** Value used to sort this column. Defaults to `item[key]`. */
|
|
12
|
+
sortValue?: (item: T) => SortableValue;
|
|
13
|
+
}
|
|
14
|
+
type SortableValue = string | number | Date | null | undefined;
|
|
15
|
+
export interface RowActionDef<T> {
|
|
16
|
+
/** Unique key for this action. */
|
|
17
|
+
key: string;
|
|
18
|
+
/** aria-label for the button. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Icon element rendered inside the button. */
|
|
21
|
+
icon: ReactNode;
|
|
22
|
+
/** When false, button is disabled and a tooltip with `noAccessLabel` is shown. Default: true. */
|
|
23
|
+
isAllowed?: boolean;
|
|
24
|
+
/** Tooltip text shown when `isAllowed` is false. */
|
|
25
|
+
noAccessLabel?: string;
|
|
26
|
+
/** Called with the row item when the button is pressed. */
|
|
27
|
+
onPress: (item: T) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface DataTableProps<T extends {
|
|
9
30
|
id: string;
|
|
10
|
-
}>
|
|
11
|
-
|
|
12
|
-
|
|
31
|
+
}> {
|
|
32
|
+
columns: Column<T>[];
|
|
33
|
+
data: T[];
|
|
34
|
+
actions?: ReactNode;
|
|
35
|
+
/** Per-row action buttons rendered in a dedicated last column. */
|
|
36
|
+
rowActions?: RowActionDef<T>[] | ((item: T) => RowActionDef<T>[]);
|
|
37
|
+
/** Label for the row actions column header. Defaults to empty string. */
|
|
38
|
+
rowActionsLabel?: string;
|
|
39
|
+
/**
|
|
40
|
+
* When true, renders a selection column before the first data column — a per-row control on
|
|
41
|
+
* every row (see `selectionType`), plus a "select all" checkbox in the header when
|
|
42
|
+
* `selectionType` is "checkbox". Off by default.
|
|
43
|
+
*/
|
|
44
|
+
selectable?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Visual style of the built-in selection control. "checkbox" (default) allows selecting
|
|
47
|
+
* multiple rows and shows a "select all" in the header. "radio" restricts selection to a
|
|
48
|
+
* single row (no "select all" — there is nothing to select all *to* with one choice) and
|
|
49
|
+
* renders a round control instead of a checkbox.
|
|
50
|
+
*/
|
|
51
|
+
selectionType?: "checkbox" | "radio";
|
|
52
|
+
/** When true, draws vertical lines between columns. Off by default. */
|
|
53
|
+
grid?: boolean;
|
|
54
|
+
/** Controlled selection state. Omit to let the table manage its own selection internally. */
|
|
55
|
+
selectedKeys?: Selection;
|
|
56
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
57
|
+
/** Initial sort when the table manages its own sorting. Only columns with `sortable` can be sorted. */
|
|
58
|
+
defaultSortDescriptor?: SortDescriptor;
|
|
59
|
+
/** Controlled sort state. Omit to let the table manage its own sorting internally. */
|
|
60
|
+
sortDescriptor?: SortDescriptor;
|
|
61
|
+
onSortChange?: (descriptor: SortDescriptor) => void;
|
|
62
|
+
searchPlaceholder?: string;
|
|
63
|
+
searchKeys?: (keyof T)[];
|
|
64
|
+
isLoading?: boolean;
|
|
65
|
+
loadingMessage?: string;
|
|
66
|
+
emptyMessage?: string;
|
|
67
|
+
previousLabel?: string;
|
|
68
|
+
nextLabel?: string;
|
|
69
|
+
pageSize?: number;
|
|
70
|
+
nestedColumns?: Column<any>[];
|
|
71
|
+
getNestedData?: (item: T) => any[] | Promise<any[]>;
|
|
72
|
+
nestedLoadingMessage?: string;
|
|
73
|
+
nestedEmptyMessage?: string;
|
|
74
|
+
nestedSearchKeys?: (keyof any)[];
|
|
75
|
+
nestedSearchPlaceholder?: string;
|
|
76
|
+
nestedActions?: (item: T) => ReactNode;
|
|
77
|
+
nestedPageSize?: number;
|
|
78
|
+
}
|
|
79
|
+
export declare function DataTable<T extends {
|
|
13
80
|
id: string;
|
|
14
|
-
}>
|
|
81
|
+
}>({ columns, data, actions, rowActions, rowActionsLabel, selectable, selectionType, grid, selectedKeys, onSelectionChange, defaultSortDescriptor, sortDescriptor: controlledSortDescriptor, onSortChange, searchPlaceholder, searchKeys, isLoading, loadingMessage, emptyMessage, previousLabel, nextLabel, pageSize, nestedColumns, getNestedData, nestedLoadingMessage, nestedEmptyMessage, nestedSearchKeys, nestedSearchPlaceholder, nestedActions, nestedPageSize, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type ChartLegendLabels } from "../ChartLegend/ChartLegend";
|
|
3
|
+
import { type PieChartLabelContent, type PieChartShape } from "./pie-chart-option";
|
|
4
|
+
import { type PieChartNode } from "./pie-chart-slices";
|
|
5
|
+
import "./pie-chart.css";
|
|
6
|
+
export type { PieChartNode } from "./pie-chart-slices";
|
|
7
|
+
export type { PieChartLabelContent, PieChartShape } from "./pie-chart-option";
|
|
8
|
+
export type PieChartLegendMode = "inline" | "none";
|
|
9
|
+
export type PieChartLegendPosition = "bottom" | "right" | "top" | "left";
|
|
10
|
+
export type PieChartLegendValue = "percent" | "value";
|
|
11
|
+
export type PieChartShowTotal = "auto" | "on" | "off";
|
|
12
|
+
export interface PieChartLabels {
|
|
13
|
+
others: string;
|
|
14
|
+
total: string;
|
|
15
|
+
backToPrevious: (categoryName: string) => string;
|
|
16
|
+
}
|
|
17
|
+
export type PieChartProps = Omit<ComponentPropsWithoutRef<"div">, "children"> & {
|
|
18
|
+
data: PieChartNode[];
|
|
19
|
+
shape?: PieChartShape;
|
|
20
|
+
labelContent?: PieChartLabelContent[];
|
|
21
|
+
showTotal?: PieChartShowTotal;
|
|
22
|
+
total?: number;
|
|
23
|
+
valueFormatter?: (value: number) => string;
|
|
24
|
+
legend?: PieChartLegendMode;
|
|
25
|
+
legendPosition?: PieChartLegendPosition;
|
|
26
|
+
legendValues?: PieChartLegendValue[];
|
|
27
|
+
onSeriesColorChange?: (seriesId: string, colorToken: string | null) => void;
|
|
28
|
+
onFocusChange?: (focusedNodeId: string | null) => void;
|
|
29
|
+
legendLabels?: Partial<ChartLegendLabels>;
|
|
30
|
+
labels?: Partial<PieChartLabels>;
|
|
31
|
+
};
|
|
32
|
+
export declare function PieChart({ data, shape, labelContent, showTotal, total, valueFormatter, legend, legendPosition, legendValues, onSeriesColorChange, onFocusChange, legendLabels, labels, className, ...props }: PieChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChartTheme } from "../chart-theme";
|
|
2
|
+
import type { PieSlice } from "./pie-chart-slices";
|
|
3
|
+
export type PieChartLabelContent = "name" | "percent" | "value";
|
|
4
|
+
export type PieChartShape = "donut" | "pie";
|
|
5
|
+
export interface PieChartOptionInput {
|
|
6
|
+
slices: PieSlice[];
|
|
7
|
+
shape: PieChartShape;
|
|
8
|
+
labelContent: PieChartLabelContent[];
|
|
9
|
+
theme: ChartTheme;
|
|
10
|
+
valueFormatter?: (value: number) => string;
|
|
11
|
+
}
|
|
12
|
+
export declare function formatShare(share: number): string;
|
|
13
|
+
export declare function buildPieChartOption(input: PieChartOptionInput): Record<string, unknown>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface PieChartNode {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
value: number | null;
|
|
5
|
+
colorToken?: string;
|
|
6
|
+
isOthers?: boolean;
|
|
7
|
+
children?: PieChartNode[];
|
|
8
|
+
}
|
|
9
|
+
export interface PieSlice {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
value: number;
|
|
13
|
+
share: number;
|
|
14
|
+
path: string[];
|
|
15
|
+
color: string;
|
|
16
|
+
isOthers: boolean;
|
|
17
|
+
children: PieSlice[];
|
|
18
|
+
}
|
|
19
|
+
export interface BuildPieSlicesInput {
|
|
20
|
+
nodes: PieChartNode[];
|
|
21
|
+
colorsByRootId: Record<string, string>;
|
|
22
|
+
fallbackColor: string;
|
|
23
|
+
othersName: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function displayNameOf(node: PieChartNode, othersName: string): string;
|
|
26
|
+
export declare function buildPieSlices(input: BuildPieSlicesInput): PieSlice[];
|
|
27
|
+
export declare function findSlice(slices: PieSlice[], id: string): PieSlice | undefined;
|
|
28
|
+
export declare function findParentSlice(slices: PieSlice[], id: string): PieSlice | undefined;
|
|
29
|
+
export declare function sliceDepth(slices: PieSlice[]): number;
|
|
30
|
+
export declare function totalOf(slices: PieSlice[]): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lightenColor(color: string, amount: number): string;
|