wimui 0.19.0 → 0.21.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/components/charts/AreaChart/AreaChart.cjs +1 -1
- package/dist/components/charts/AreaChart/AreaChart.d.ts +9 -2
- package/dist/components/charts/AreaChart/AreaChart.js +13 -29
- package/dist/components/charts/AreaChart/area-chart.module.cjs +1 -1
- package/dist/components/charts/AreaChart/area-chart.module.js +1 -1
- package/dist/components/charts/BarChart/BarChart.cjs +1 -1
- package/dist/components/charts/BarChart/BarChart.d.ts +9 -2
- package/dist/components/charts/BarChart/BarChart.js +12 -7
- package/dist/components/charts/BarChart/bar-chart.module.cjs +1 -1
- package/dist/components/charts/BarChart/bar-chart.module.js +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.cjs +1 -1
- package/dist/components/charts/FunnelChart/FunnelChart.js +36 -28
- package/dist/components/charts/FunnelChart/funnel-chart.module.cjs +1 -1
- package/dist/components/charts/FunnelChart/funnel-chart.module.js +1 -1
- package/dist/components/charts/GaugeChart/gauge-chart.module.cjs +1 -1
- package/dist/components/charts/GaugeChart/gauge-chart.module.js +1 -1
- package/dist/components/charts/Heatmap/Heatmap.cjs +1 -1
- package/dist/components/charts/Heatmap/Heatmap.js +11 -4
- package/dist/components/charts/Heatmap/heatmap.module.cjs +1 -1
- package/dist/components/charts/Heatmap/heatmap.module.js +1 -1
- package/dist/components/charts/LineChart/LineChart.cjs +1 -1
- package/dist/components/charts/LineChart/LineChart.d.ts +9 -2
- package/dist/components/charts/LineChart/LineChart.js +5 -3
- package/dist/components/charts/LineChart/line-chart.module.cjs +1 -1
- package/dist/components/charts/LineChart/line-chart.module.js +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.js +3 -2
- package/dist/components/charts/PieChart/pie-chart.module.cjs +1 -1
- package/dist/components/charts/PieChart/pie-chart.module.js +1 -1
- package/dist/components/charts/RadarChart/RadarChart.cjs +1 -1
- package/dist/components/charts/RadarChart/RadarChart.js +6 -2
- package/dist/components/charts/RadarChart/radar-chart.module.cjs +1 -1
- package/dist/components/charts/RadarChart/radar-chart.module.js +1 -1
- package/dist/components/charts/ScatterChart/ScatterChart.cjs +1 -1
- package/dist/components/charts/ScatterChart/ScatterChart.d.ts +12 -1
- package/dist/components/charts/ScatterChart/ScatterChart.js +10 -7
- package/dist/components/charts/ScatterChart/scatter-chart.module.cjs +1 -1
- package/dist/components/charts/ScatterChart/scatter-chart.module.js +1 -1
- package/dist/components/charts/Sparkline/Sparkline.cjs +1 -1
- package/dist/components/charts/Sparkline/Sparkline.js +62 -80
- package/dist/components/charts/Sparkline/sparkline.module.cjs +1 -1
- package/dist/components/charts/Sparkline/sparkline.module.js +1 -1
- package/dist/components/charts/Treemap/Treemap.cjs +1 -1
- package/dist/components/charts/Treemap/Treemap.js +87 -59
- package/dist/components/form/Button/button.module.cjs +1 -1
- package/dist/components/form/Button/button.module.js +2 -2
- package/dist/components/form/ColorInput/ColorInput.cjs +1 -1
- package/dist/components/form/ColorInput/ColorInput.d.ts +9 -1
- package/dist/components/form/ColorInput/ColorInput.js +36 -46
- package/dist/components/form/ColorInput/color-input.module.cjs +1 -1
- package/dist/components/form/ColorInput/color-input.module.js +4 -7
- package/dist/components/form/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/form/DateRangePicker/DateRangePicker.js +36 -37
- package/dist/components/form/InputBase/input-base.module.cjs +1 -1
- package/dist/components/form/InputBase/input-base.module.js +1 -1
- package/dist/components/form/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/form/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.d.ts +124 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +87 -84
- package/dist/components/form/QueryBuilder/querybuilder.module.cjs +1 -1
- package/dist/components/form/QueryBuilder/querybuilder.module.js +1 -1
- package/dist/components/form/QueryBuilder/warn-unknown-operator.cjs +2 -0
- package/dist/components/form/QueryBuilder/warn-unknown-operator.d.ts +3 -0
- package/dist/components/form/QueryBuilder/warn-unknown-operator.js +4 -0
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +4 -0
- package/dist/components/form/SmartSearchInput/smart-search-input.module.cjs +1 -1
- package/dist/components/form/SmartSearchInput/smart-search-input.module.js +5 -3
- package/dist/components/form/TagInput/TagInput.cjs +1 -1
- package/dist/components/form/TagInput/TagInput.js +1 -1
- package/dist/components/helpers.cjs +1 -1
- package/dist/components/helpers.d.ts +9 -0
- package/dist/components/helpers.js +2 -11
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.d.ts +8 -0
- package/dist/components/layout/Dashboard/Dashboard.js +47 -42
- package/dist/components/layout/Dashboard/dashboard.module.cjs +1 -1
- package/dist/components/layout/Dashboard/dashboard.module.js +13 -13
- package/dist/components/layout/Header/header.module.cjs +1 -1
- package/dist/components/layout/Header/header.module.js +4 -4
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/i18n/generated/resources.cjs +1 -1
- package/dist/i18n/generated/resources.js +18 -3
- package/dist/llms-full.txt +22 -3
- package/dist/llms.txt +1 -1
- package/dist/locales/en/components.json +19 -2
- package/dist/locales/ja/components.json +19 -2
- package/dist/locales/pt/components.json +19 -2
- package/dist/reset.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/generated-tokens.d.ts +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +6 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { ChartAxisDomain } from '../../helpers';
|
|
2
3
|
export type ScatterChartProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Points to plot. `z` optionally controls the point size.
|
|
@@ -19,6 +20,16 @@ export type ScatterChartProps = {
|
|
|
19
20
|
* @default "Y"
|
|
20
21
|
*/
|
|
21
22
|
yAxisName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Range of the X axis.
|
|
25
|
+
* @default ["auto", "auto"]
|
|
26
|
+
*/
|
|
27
|
+
xDomain?: ChartAxisDomain;
|
|
28
|
+
/**
|
|
29
|
+
* Range of the Y axis.
|
|
30
|
+
* @default ["auto", "auto"]
|
|
31
|
+
*/
|
|
32
|
+
yDomain?: ChartAxisDomain;
|
|
22
33
|
/**
|
|
23
34
|
* The height of the chart in pixels.
|
|
24
35
|
* @default 300
|
|
@@ -39,4 +50,4 @@ export type ScatterChartProps = {
|
|
|
39
50
|
*/
|
|
40
51
|
animated?: boolean;
|
|
41
52
|
};
|
|
42
|
-
export declare const ScatterChart: ({ data, xAxisName, yAxisName, height, width, title, animated, }: ScatterChartProps) => React.JSX.Element;
|
|
53
|
+
export declare const ScatterChart: ({ data, xAxisName, yAxisName, xDomain, yDomain, height, width, title, animated, }: ScatterChartProps) => React.JSX.Element;
|
|
@@ -6,17 +6,17 @@ import "react";
|
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { CartesianGrid as o, Legend as s, ResponsiveContainer as c, Scatter as l, ScatterChart as u, Tooltip as d, XAxis as f, YAxis as p, ZAxis as m } from "recharts";
|
|
8
8
|
//#region src/components/charts/ScatterChart/ScatterChart.tsx
|
|
9
|
-
var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y",
|
|
9
|
+
var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", xDomain: v = ["auto", "auto"], yDomain: y = ["auto", "auto"], height: b = 300, width: x = "100%", title: S, animated: C = !1 }) => /* @__PURE__ */ a("div", {
|
|
10
10
|
className: `wim-scatter-chart ${r.root}`,
|
|
11
|
-
style: { width:
|
|
12
|
-
children: [
|
|
11
|
+
style: { width: x },
|
|
12
|
+
children: [S && /* @__PURE__ */ i(e, {
|
|
13
13
|
tag: "h3",
|
|
14
14
|
size: "md",
|
|
15
15
|
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
16
|
-
children:
|
|
16
|
+
children: S
|
|
17
17
|
}), /* @__PURE__ */ i("div", {
|
|
18
18
|
className: r.container,
|
|
19
|
-
style: { height:
|
|
19
|
+
style: { height: b },
|
|
20
20
|
children: /* @__PURE__ */ i(c, {
|
|
21
21
|
width: "100%",
|
|
22
22
|
height: "100%",
|
|
@@ -25,7 +25,7 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
25
25
|
top: 20,
|
|
26
26
|
right: 20,
|
|
27
27
|
bottom: 20,
|
|
28
|
-
left:
|
|
28
|
+
left: 0
|
|
29
29
|
},
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ i(o, { ...n.grid }),
|
|
@@ -34,6 +34,7 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
34
34
|
dataKey: "x",
|
|
35
35
|
name: g,
|
|
36
36
|
unit: "",
|
|
37
|
+
domain: v,
|
|
37
38
|
...n.axis
|
|
38
39
|
}),
|
|
39
40
|
/* @__PURE__ */ i(p, {
|
|
@@ -41,6 +42,8 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
41
42
|
dataKey: "y",
|
|
42
43
|
name: _,
|
|
43
44
|
unit: "",
|
|
45
|
+
domain: y,
|
|
46
|
+
width: 44,
|
|
44
47
|
...n.axis
|
|
45
48
|
}),
|
|
46
49
|
/* @__PURE__ */ i(m, {
|
|
@@ -60,7 +63,7 @@ var h = ({ data: h, xAxisName: g = "X", yAxisName: _ = "Y", height: v = 300, wid
|
|
|
60
63
|
name: "Data Points",
|
|
61
64
|
data: h,
|
|
62
65
|
fill: t[0],
|
|
63
|
-
isAnimationActive:
|
|
66
|
+
isAnimationActive: C
|
|
64
67
|
})
|
|
65
68
|
]
|
|
66
69
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_pxnwr_4`,t=`_container_pxnwr_9`,n={root:e,container:t};exports.container=t,exports.default=n,exports.root=e;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./sparkline.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("recharts");var o=`var(--wim-color-chart-primary)`,s=({data:e,type:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./sparkline.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("recharts");var o=`var(--wim-color-chart-primary)`,s=({data:e,type:n=`line`,width:s=`100%`,height:c=24,color:l=o,strokeWidth:u=2,showLastDot:d=!1,min:f,max:p,ariaLabel:m,className:h})=>{let g=e.map((e,t)=>({index:t,value:e})),_=[f??`auto`,p??`auto`],v=e.length-1,y=typeof window<`u`&&!!window.__VRT__,b=typeof s==`number`?s:null,x=c??24,S=e=>{let{cx:t,cy:n,index:r}=e;return!d||r!==v||t==null||n==null?(0,i.jsx)(`g`,{},r):(0,i.jsx)(`circle`,{cx:t,cy:n,r:u+1,fill:l},r)},C=y&&b!==null?{width:b,height:x}:{},w={accessibilityLayer:!1,tabIndex:-1},T=()=>n===`bar`?(0,i.jsxs)(a.BarChart,{...C,...w,data:g,margin:{top:2,right:2,bottom:2,left:2},children:[(0,i.jsx)(a.YAxis,{hide:!0,domain:_}),(0,i.jsx)(a.Bar,{dataKey:`value`,fill:l,radius:[2,2,0,0],isAnimationActive:!1})]}):n===`area`?(0,i.jsxs)(a.AreaChart,{...C,...w,data:g,margin:{top:2,right:2,bottom:2,left:2},children:[(0,i.jsx)(a.YAxis,{hide:!0,domain:_}),(0,i.jsx)(a.Area,{type:`monotone`,dataKey:`value`,stroke:l,strokeWidth:u,fill:l,fillOpacity:.15,dot:d?S:!1,isAnimationActive:!1})]}):(0,i.jsxs)(a.LineChart,{...C,...w,data:g,margin:{top:2,right:2,bottom:2,left:2},children:[(0,i.jsx)(a.YAxis,{hide:!0,domain:_}),(0,i.jsx)(a.Line,{type:`monotone`,dataKey:`value`,stroke:l,strokeWidth:u,dot:d?S:!1,isAnimationActive:!1})]});return(0,i.jsx)(`div`,{className:(0,r.default)(`wim-sparkline`,t.default.root,h),style:{width:s,height:c},role:m?`img`:void 0,"aria-label":m,"aria-hidden":m?void 0:!0,children:y&&b!==null?T():(0,i.jsx)(a.ResponsiveContainer,{width:`100%`,height:`100%`,children:T()})})};s.displayName=`Sparkline`,exports.Sparkline=s;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import e from "./sparkline.module.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { Area as
|
|
3
|
+
import "react";
|
|
4
|
+
import t from "classnames";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
import { Area as i, AreaChart as a, Bar as o, BarChart as s, Line as c, LineChart as l, ResponsiveContainer as u, YAxis as d } from "recharts";
|
|
7
7
|
//#region src/components/charts/Sparkline/Sparkline.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
8
|
+
var f = "var(--wim-color-chart-primary)", p = ({ data: p, type: m = "line", width: h = "100%", height: g = 24, color: _ = f, strokeWidth: v = 2, showLastDot: y = !1, min: b, max: x, ariaLabel: S, className: C }) => {
|
|
9
|
+
let w = p.map((e, t) => ({
|
|
10
10
|
index: t,
|
|
11
11
|
value: e
|
|
12
|
-
})),
|
|
13
|
-
let { cx: t, cy:
|
|
14
|
-
return !
|
|
12
|
+
})), T = [b ?? "auto", x ?? "auto"], E = p.length - 1, D = typeof window < "u" && !!window.__VRT__, O = typeof h == "number" ? h : null, k = g ?? 24, A = (e) => {
|
|
13
|
+
let { cx: t, cy: r, index: i } = e;
|
|
14
|
+
return !y || i !== E || t == null || r == null ? /* @__PURE__ */ n("g", {}, i) : /* @__PURE__ */ n("circle", {
|
|
15
15
|
cx: t,
|
|
16
|
-
cy:
|
|
17
|
-
r:
|
|
18
|
-
fill:
|
|
16
|
+
cy: r,
|
|
17
|
+
r: v + 1,
|
|
18
|
+
fill: _
|
|
19
19
|
}, i);
|
|
20
|
-
},
|
|
21
|
-
width:
|
|
22
|
-
height:
|
|
23
|
-
} : {},
|
|
20
|
+
}, j = D && O !== null ? {
|
|
21
|
+
width: O,
|
|
22
|
+
height: k
|
|
23
|
+
} : {}, M = {
|
|
24
24
|
accessibilityLayer: !1,
|
|
25
25
|
tabIndex: -1
|
|
26
|
-
},
|
|
27
|
-
...
|
|
28
|
-
...
|
|
29
|
-
data:
|
|
26
|
+
}, N = () => m === "bar" ? /* @__PURE__ */ r(s, {
|
|
27
|
+
...j,
|
|
28
|
+
...M,
|
|
29
|
+
data: w,
|
|
30
30
|
margin: {
|
|
31
31
|
top: 2,
|
|
32
32
|
right: 2,
|
|
33
33
|
bottom: 2,
|
|
34
34
|
left: 2
|
|
35
35
|
},
|
|
36
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ n(d, {
|
|
37
37
|
hide: !0,
|
|
38
|
-
domain:
|
|
39
|
-
}), /* @__PURE__ */
|
|
38
|
+
domain: T
|
|
39
|
+
}), /* @__PURE__ */ n(o, {
|
|
40
40
|
dataKey: "value",
|
|
41
|
-
fill:
|
|
41
|
+
fill: _,
|
|
42
42
|
radius: [
|
|
43
43
|
2,
|
|
44
44
|
2,
|
|
@@ -47,85 +47,67 @@ var p = "var(--wim-color-chart-primary)", m = ({ data: m, type: h = "line", widt
|
|
|
47
47
|
],
|
|
48
48
|
isAnimationActive: !1
|
|
49
49
|
})]
|
|
50
|
-
}) :
|
|
51
|
-
...
|
|
52
|
-
...
|
|
53
|
-
data:
|
|
50
|
+
}) : m === "area" ? /* @__PURE__ */ r(a, {
|
|
51
|
+
...j,
|
|
52
|
+
...M,
|
|
53
|
+
data: w,
|
|
54
54
|
margin: {
|
|
55
55
|
top: 2,
|
|
56
56
|
right: 2,
|
|
57
57
|
bottom: 2,
|
|
58
58
|
left: 2
|
|
59
59
|
},
|
|
60
|
-
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */ r(f, {
|
|
78
|
-
hide: !0,
|
|
79
|
-
domain: D
|
|
80
|
-
}),
|
|
81
|
-
/* @__PURE__ */ r(a, {
|
|
82
|
-
type: "monotone",
|
|
83
|
-
dataKey: "value",
|
|
84
|
-
stroke: v,
|
|
85
|
-
strokeWidth: y,
|
|
86
|
-
fill: `url(#${T})`,
|
|
87
|
-
dot: b ? M : !1,
|
|
88
|
-
isAnimationActive: !1
|
|
89
|
-
})
|
|
90
|
-
]
|
|
91
|
-
}) : /* @__PURE__ */ i(u, {
|
|
92
|
-
...N,
|
|
93
|
-
...P,
|
|
94
|
-
data: E,
|
|
60
|
+
children: [/* @__PURE__ */ n(d, {
|
|
61
|
+
hide: !0,
|
|
62
|
+
domain: T
|
|
63
|
+
}), /* @__PURE__ */ n(i, {
|
|
64
|
+
type: "monotone",
|
|
65
|
+
dataKey: "value",
|
|
66
|
+
stroke: _,
|
|
67
|
+
strokeWidth: v,
|
|
68
|
+
fill: _,
|
|
69
|
+
fillOpacity: .15,
|
|
70
|
+
dot: y ? A : !1,
|
|
71
|
+
isAnimationActive: !1
|
|
72
|
+
})]
|
|
73
|
+
}) : /* @__PURE__ */ r(l, {
|
|
74
|
+
...j,
|
|
75
|
+
...M,
|
|
76
|
+
data: w,
|
|
95
77
|
margin: {
|
|
96
78
|
top: 2,
|
|
97
79
|
right: 2,
|
|
98
80
|
bottom: 2,
|
|
99
81
|
left: 2
|
|
100
82
|
},
|
|
101
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ n(d, {
|
|
102
84
|
hide: !0,
|
|
103
|
-
domain:
|
|
104
|
-
}), /* @__PURE__ */
|
|
85
|
+
domain: T
|
|
86
|
+
}), /* @__PURE__ */ n(c, {
|
|
105
87
|
type: "monotone",
|
|
106
88
|
dataKey: "value",
|
|
107
|
-
stroke:
|
|
108
|
-
strokeWidth:
|
|
109
|
-
dot:
|
|
89
|
+
stroke: _,
|
|
90
|
+
strokeWidth: v,
|
|
91
|
+
dot: y ? A : !1,
|
|
110
92
|
isAnimationActive: !1
|
|
111
93
|
})]
|
|
112
94
|
});
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
className:
|
|
95
|
+
return /* @__PURE__ */ n("div", {
|
|
96
|
+
className: t("wim-sparkline", e.root, C),
|
|
115
97
|
style: {
|
|
116
|
-
width:
|
|
117
|
-
height:
|
|
98
|
+
width: h,
|
|
99
|
+
height: g
|
|
118
100
|
},
|
|
119
|
-
role:
|
|
120
|
-
"aria-label":
|
|
121
|
-
"aria-hidden":
|
|
122
|
-
children:
|
|
101
|
+
role: S ? "img" : void 0,
|
|
102
|
+
"aria-label": S,
|
|
103
|
+
"aria-hidden": S ? void 0 : !0,
|
|
104
|
+
children: D && O !== null ? N() : /* @__PURE__ */ n(u, {
|
|
123
105
|
width: "100%",
|
|
124
106
|
height: "100%",
|
|
125
|
-
children:
|
|
107
|
+
children: N()
|
|
126
108
|
})
|
|
127
109
|
});
|
|
128
110
|
};
|
|
129
|
-
|
|
111
|
+
p.displayName = "Sparkline";
|
|
130
112
|
//#endregion
|
|
131
|
-
export {
|
|
113
|
+
export { p as Sparkline };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1p9uf_4`,t={root:e};exports.default=t,exports.root=e;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./treemap.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=({x:e,y:t,width:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../typography/Title/Title.cjs"),n=require("../../helpers.cjs"),r=require("./treemap.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime"),o=require("recharts");var s=2,c=8,l=(e,t,n)=>{let r=n-t,i=r===0?1:Math.min(1,Math.max(0,(e-t)/r));return`color-mix(in oklch, var(--wim-color-chart-primary) ${20+Math.round(i*40)}%, var(--wim-color-surface))`},u=(0,i.createContext)({min:0,max:1}),d=({x:e,y:t,width:n,height:r,name:o,value:d,depth:f,children:p})=>{let{min:m,max:h}=(0,i.useContext)(u),[g,_]=(0,i.useState)(!0),v=(0,i.useCallback)(e=>{e&&_(e.getComputedTextLength()+c*2<=n)},[n]);return f===0||Array.isArray(p)&&p.length>0?(0,a.jsx)(`g`,{}):(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:e+s/2,y:t+s/2,width:Math.max(0,n-s),height:Math.max(0,r-s),style:{fill:l(d,m,h),stroke:`none`}}),n>30&&r>20&&(0,a.jsx)(`text`,{ref:v,x:e+n/2,y:t+r/2,textAnchor:`middle`,dominantBaseline:`central`,style:{fill:`var(--wim-color-text-primary)`,fontSize:`var(--wim-font-size-lg)`,fontWeight:`var(--wim-font-weight-bold)`,stroke:`none`,strokeWidth:0,pointerEvents:`none`,userSelect:`none`,visibility:g?void 0:`hidden`},children:o})]})},f=({data:e,dataKey:s,aspectRatio:c=4/3,height:l=300,width:f=`100%`,title:p})=>{let m=(0,i.useMemo)(()=>{let t=e=>e.flatMap(e=>Array.isArray(e.children)?t(e.children):[e]),n=t(e??[]).map(e=>Number(e[s])||0);return n.length?{min:Math.min(...n),max:Math.max(...n)}:{min:0,max:1}},[e,s]);return!e||e.length===0?null:(0,a.jsx)(u.Provider,{value:m,children:(0,a.jsxs)(`div`,{className:`wim-treemap ${r.default.root} wim-treemap__root`,style:{width:f},children:[p&&(0,a.jsx)(t.Title,{tag:`h3`,size:`md`,style:{marginBottom:`var(--wim-spacing-md)`},children:p}),(0,a.jsx)(`div`,{className:`${r.default.container} wim-treemap__container`,style:{height:l,minWidth:0,minHeight:0},children:(0,a.jsx)(o.ResponsiveContainer,{width:`100%`,height:`100%`,children:(0,a.jsx)(o.Treemap,{data:e,dataKey:s,aspectRatio:c,stroke:`none`,content:d,isAnimationActive:!1,children:(0,a.jsx)(o.Tooltip,{contentStyle:n.CHART_THEME.tooltip.contentStyle,formatter:(e,t)=>[e,t]})})})})]})})};exports.Treemap=f;
|
|
@@ -1,67 +1,95 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Title as e } from "../../typography/Title/Title.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { ResponsiveContainer as
|
|
3
|
+
import { CHART_THEME as t } from "../../helpers.js";
|
|
4
|
+
import n from "./treemap.module.js";
|
|
5
|
+
import { createContext as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import { ResponsiveContainer as u, Tooltip as d, Treemap as f } from "recharts";
|
|
8
8
|
//#region src/components/charts/Treemap/Treemap.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fill: n[c % n.length],
|
|
25
|
-
fontSize: "var(--wim-font-size-lg)",
|
|
26
|
-
fontWeight: "var(--wim-font-weight-bold)",
|
|
27
|
-
stroke: "none",
|
|
28
|
-
strokeWidth: 0,
|
|
29
|
-
pointerEvents: "none",
|
|
30
|
-
userSelect: "none"
|
|
31
|
-
},
|
|
32
|
-
children: l
|
|
33
|
-
})] }), d = ({ data: t, dataKey: n, aspectRatio: d = 4 / 3, height: f = 300, width: p = "100%", title: m }) => !t || t.length === 0 ? null : /* @__PURE__ */ o("div", {
|
|
34
|
-
className: `wim-treemap ${i.root} wim-treemap__root`,
|
|
35
|
-
style: { width: p },
|
|
36
|
-
children: [m && /* @__PURE__ */ a(e, {
|
|
37
|
-
tag: "h3",
|
|
38
|
-
size: "md",
|
|
39
|
-
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
40
|
-
children: m
|
|
41
|
-
}), /* @__PURE__ */ a("div", {
|
|
42
|
-
className: `${i.container} wim-treemap__container`,
|
|
9
|
+
var p = 2, m = 8, h = (e, t, n) => {
|
|
10
|
+
let r = n - t, i = r === 0 ? 1 : Math.min(1, Math.max(0, (e - t) / r));
|
|
11
|
+
return `color-mix(in oklch, var(--wim-color-chart-primary) ${20 + Math.round(i * 40)}%, var(--wim-color-surface))`;
|
|
12
|
+
}, g = r({
|
|
13
|
+
min: 0,
|
|
14
|
+
max: 1
|
|
15
|
+
}), _ = ({ x: e, y: t, width: n, height: r, name: o, value: u, depth: d, children: f }) => {
|
|
16
|
+
let { min: _, max: v } = a(g), [y, b] = s(!0), x = i((e) => {
|
|
17
|
+
e && b(e.getComputedTextLength() + m * 2 <= n);
|
|
18
|
+
}, [n]);
|
|
19
|
+
return d === 0 || Array.isArray(f) && f.length > 0 ? /* @__PURE__ */ c("g", {}) : /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("rect", {
|
|
20
|
+
x: e + p / 2,
|
|
21
|
+
y: t + p / 2,
|
|
22
|
+
width: Math.max(0, n - p),
|
|
23
|
+
height: Math.max(0, r - p),
|
|
43
24
|
style: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
fill: h(u, _, v),
|
|
26
|
+
stroke: "none"
|
|
27
|
+
}
|
|
28
|
+
}), n > 30 && r > 20 && /* @__PURE__ */ c("text", {
|
|
29
|
+
ref: x,
|
|
30
|
+
x: e + n / 2,
|
|
31
|
+
y: t + r / 2,
|
|
32
|
+
textAnchor: "middle",
|
|
33
|
+
dominantBaseline: "central",
|
|
34
|
+
style: {
|
|
35
|
+
fill: "var(--wim-color-text-primary)",
|
|
36
|
+
fontSize: "var(--wim-font-size-lg)",
|
|
37
|
+
fontWeight: "var(--wim-font-weight-bold)",
|
|
38
|
+
stroke: "none",
|
|
39
|
+
strokeWidth: 0,
|
|
40
|
+
pointerEvents: "none",
|
|
41
|
+
userSelect: "none",
|
|
42
|
+
visibility: y ? void 0 : "hidden"
|
|
47
43
|
},
|
|
48
|
-
children:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
children: o
|
|
45
|
+
})] });
|
|
46
|
+
}, v = ({ data: r, dataKey: i, aspectRatio: a = 4 / 3, height: s = 300, width: p = "100%", title: m }) => {
|
|
47
|
+
let h = o(() => {
|
|
48
|
+
let e = (t) => t.flatMap((t) => Array.isArray(t.children) ? e(t.children) : [t]), t = e(r ?? []).map((e) => Number(e[i]) || 0);
|
|
49
|
+
return t.length ? {
|
|
50
|
+
min: Math.min(...t),
|
|
51
|
+
max: Math.max(...t)
|
|
52
|
+
} : {
|
|
53
|
+
min: 0,
|
|
54
|
+
max: 1
|
|
55
|
+
};
|
|
56
|
+
}, [r, i]);
|
|
57
|
+
return !r || r.length === 0 ? null : /* @__PURE__ */ c(g.Provider, {
|
|
58
|
+
value: h,
|
|
59
|
+
children: /* @__PURE__ */ l("div", {
|
|
60
|
+
className: `wim-treemap ${n.root} wim-treemap__root`,
|
|
61
|
+
style: { width: p },
|
|
62
|
+
children: [m && /* @__PURE__ */ c(e, {
|
|
63
|
+
tag: "h3",
|
|
64
|
+
size: "md",
|
|
65
|
+
style: { marginBottom: "var(--wim-spacing-md)" },
|
|
66
|
+
children: m
|
|
67
|
+
}), /* @__PURE__ */ c("div", {
|
|
68
|
+
className: `${n.container} wim-treemap__container`,
|
|
69
|
+
style: {
|
|
70
|
+
height: s,
|
|
71
|
+
minWidth: 0,
|
|
72
|
+
minHeight: 0
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ c(u, {
|
|
75
|
+
width: "100%",
|
|
76
|
+
height: "100%",
|
|
77
|
+
children: /* @__PURE__ */ c(f, {
|
|
78
|
+
data: r,
|
|
79
|
+
dataKey: i,
|
|
80
|
+
aspectRatio: a,
|
|
81
|
+
stroke: "none",
|
|
82
|
+
content: _,
|
|
83
|
+
isAnimationActive: !1,
|
|
84
|
+
children: /* @__PURE__ */ c(d, {
|
|
85
|
+
contentStyle: t.tooltip.contentStyle,
|
|
86
|
+
formatter: (e, t) => [e, t]
|
|
87
|
+
})
|
|
88
|
+
})
|
|
61
89
|
})
|
|
62
|
-
})
|
|
90
|
+
})]
|
|
63
91
|
})
|
|
64
|
-
})
|
|
65
|
-
}
|
|
92
|
+
});
|
|
93
|
+
};
|
|
66
94
|
//#endregion
|
|
67
|
-
export {
|
|
95
|
+
export { v as Treemap };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_11ol0_3`,t=`_fullWidth_11ol0_30`,n=`_inner_11ol0_38`,r=`_loader_11ol0_41`,i=`_label_11ol0_48`,a=`_lg_11ol0_58`,o=`_md_11ol0_67`,s=`_sm_11ol0_76`,c=`_solid_11ol0_86`,l=`_danger_11ol0_96`,u=`_success_11ol0_101`,d=`_outline_11ol0_125`,f=`_ghost_11ol0_162`,p=`_iconOnly_11ol0_213`,m=`_content_11ol0_223`,h=`_loading_11ol0_233`,g=`_animatedWidth_11ol0_242`,_={root:e,fullWidth:t,inner:n,loader:r,label:i,lg:a,md:o,sm:s,solid:c,default:`_default_11ol0_91`,danger:l,success:u,outline:d,ghost:f,iconOnly:p,content:m,loading:h,animatedWidth:g};exports.animatedWidth=g,exports.content=m,exports.danger=l,exports.default=_,exports.fullWidth=t,exports.ghost=f,exports.iconOnly=p,exports.inner=n,exports.label=i,exports.lg=a,exports.loader=r,exports.loading=h,exports.md=o,exports.outline=d,exports.root=e,exports.sm=s,exports.solid=c,exports.success=u;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/Button/button.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_11ol0_3", t = "_fullWidth_11ol0_30", n = "_inner_11ol0_38", r = "_loader_11ol0_41", i = "_label_11ol0_48", a = "_lg_11ol0_58", o = "_md_11ol0_67", s = "_sm_11ol0_76", c = "_solid_11ol0_86", l = "_danger_11ol0_96", u = "_success_11ol0_101", d = "_outline_11ol0_125", f = "_ghost_11ol0_162", p = "_iconOnly_11ol0_213", m = "_content_11ol0_223", h = "_loading_11ol0_233", g = "_animatedWidth_11ol0_242", _ = {
|
|
4
4
|
root: e,
|
|
5
5
|
fullWidth: t,
|
|
6
6
|
inner: n,
|
|
@@ -10,7 +10,7 @@ var e = "_root_perg7_3", t = "_fullWidth_perg7_30", n = "_inner_perg7_38", r = "
|
|
|
10
10
|
md: o,
|
|
11
11
|
sm: s,
|
|
12
12
|
solid: c,
|
|
13
|
-
default: "
|
|
13
|
+
default: "_default_11ol0_91",
|
|
14
14
|
danger: l,
|
|
15
15
|
success: u,
|
|
16
16
|
outline: d,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../Input/Input.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../Input/Input.cjs"),r=require("./color-input.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i,c=e=>e.length===4?`#${e.slice(1).split(``).map(e=>e+e).join(``)}`:e,l=({className:e,value:l,defaultValue:u,onChange:d,style:f,...p})=>{let{t:m}=t.useWimTranslation(`components`),[h,g]=(0,i.useState)(()=>u??`#000000`),_=l!==void 0,v=_?l:h,[y,b]=(0,i.useState)(v),[x,S]=(0,i.useState)(v);v!==x&&(S(v),b(v));let C=(0,i.useCallback)((e,t)=>{_||g(e),d?.(t)},[_,d]),w=(0,i.useCallback)(e=>{let t=e.target.value;b(t),s.test(t.trim())&&C(t.trim(),e)},[C]),T=(0,i.useCallback)(e=>{b(e.target.value),C(e.target.value,e)},[C]),E=s.test(v)?c(v).toLowerCase():`#000000`;return(0,o.jsx)(n.Input,{type:`text`,className:(0,a.default)(`wim-color-input`,r.default.root,e),value:y,onChange:w,style:f,spellCheck:!1,autoCapitalize:`none`,autoCorrect:`off`,inputClassName:r.default.input,suffix:(0,o.jsx)(`input`,{type:`color`,className:r.default.swatch,value:E,onChange:T,disabled:p.disabled,"aria-label":m(`colorinput.swatch`),tabIndex:-1}),...p})};exports.ColorInput=l;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Input } from '../../form/Input/Input';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 色を**文字で入れる**ための入力。`#f3ece1` のような値をそのまま打てて、
|
|
5
|
+
* 右の見本から選ぶこともできる。
|
|
6
|
+
*
|
|
7
|
+
* **以前は `<Input type="color">` を出すだけ**で、テキスト欄が無かった。
|
|
8
|
+
* `ColorPicker` と同じ見た目・同じ操作で、docs が言う「正確な値を文字で入れる」
|
|
9
|
+
* ができない状態だった(T122)。役割分担はこう:
|
|
10
|
+
*
|
|
11
|
+
* - `ColorInput` — 値が決まっている(ブランド色・デザイン指定)ときに**打ち込む**
|
|
12
|
+
* - `ColorPicker` — 値が決まっていないときに**見て選ぶ**
|
|
5
13
|
*/
|
|
6
14
|
export declare const ColorInput: ({ className, value, defaultValue, onChange, style, ...props }: React.ComponentProps<typeof Input>) => React.JSX.Element;
|
|
@@ -1,53 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import t from "
|
|
4
|
-
import
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import { Input as t } from "../Input/Input.js";
|
|
4
|
+
import n from "./color-input.module.js";
|
|
5
|
+
import { useCallback as r, useState as i } from "react";
|
|
5
6
|
import a from "classnames";
|
|
6
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/form/ColorInput/ColorInput.tsx
|
|
8
|
-
|
|
9
|
-
let t = e
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className: a("wim-color-input", t.root, y && t.dark, s),
|
|
40
|
-
value: _,
|
|
41
|
-
onChange: v,
|
|
42
|
-
style: f,
|
|
43
|
-
styles: {
|
|
44
|
-
root: t.inputBase,
|
|
45
|
-
icon: t.inputIcon,
|
|
46
|
-
icons: t.inputIcons
|
|
47
|
-
},
|
|
48
|
-
inputClassName: t.input,
|
|
49
|
-
...p
|
|
9
|
+
var s = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i, c = (e) => e.length === 4 ? `#${e.slice(1).split("").map((e) => e + e).join("")}` : e, l = ({ className: l, value: u, defaultValue: d, onChange: f, style: p, ...m }) => {
|
|
10
|
+
let { t: h } = e("components"), [g, _] = i(() => d ?? "#000000"), v = u !== void 0, y = v ? u : g, [b, x] = i(y), [S, C] = i(y);
|
|
11
|
+
y !== S && (C(y), x(y));
|
|
12
|
+
let w = r((e, t) => {
|
|
13
|
+
v || _(e), f?.(t);
|
|
14
|
+
}, [v, f]), T = r((e) => {
|
|
15
|
+
let t = e.target.value;
|
|
16
|
+
x(t), s.test(t.trim()) && w(t.trim(), e);
|
|
17
|
+
}, [w]), E = r((e) => {
|
|
18
|
+
x(e.target.value), w(e.target.value, e);
|
|
19
|
+
}, [w]), D = s.test(y) ? c(y).toLowerCase() : "#000000";
|
|
20
|
+
return /* @__PURE__ */ o(t, {
|
|
21
|
+
type: "text",
|
|
22
|
+
className: a("wim-color-input", n.root, l),
|
|
23
|
+
value: b,
|
|
24
|
+
onChange: T,
|
|
25
|
+
style: p,
|
|
26
|
+
spellCheck: !1,
|
|
27
|
+
autoCapitalize: "none",
|
|
28
|
+
autoCorrect: "off",
|
|
29
|
+
inputClassName: n.input,
|
|
30
|
+
suffix: /* @__PURE__ */ o("input", {
|
|
31
|
+
type: "color",
|
|
32
|
+
className: n.swatch,
|
|
33
|
+
value: D,
|
|
34
|
+
onChange: E,
|
|
35
|
+
disabled: m.disabled,
|
|
36
|
+
"aria-label": h("colorinput.swatch"),
|
|
37
|
+
tabIndex: -1
|
|
38
|
+
}),
|
|
39
|
+
...m
|
|
50
40
|
});
|
|
51
41
|
};
|
|
52
42
|
//#endregion
|
|
53
|
-
export {
|
|
43
|
+
export { l as ColorInput };
|