dynamic-mui 2.1.0 → 2.2.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/README.md +218 -37
- package/dist/AxisSharedComponents-BbsKw1BT.js +3 -0
- package/dist/AxisSharedComponents-xLtpOLH_.mjs +605 -0
- package/dist/ChartsAxis-CANvBdY9.mjs +47 -0
- package/dist/ChartsAxis-EZ7m_KrU.js +1 -0
- package/dist/ChartsGrid-BCRTvNTr.js +3 -0
- package/dist/ChartsGrid-C_HT7qpL.mjs +381 -0
- package/dist/ChartsWrapper-CM7EDyAK.js +5 -0
- package/dist/ChartsWrapper-CO5_Z6BD.mjs +1878 -0
- package/dist/ChartsXAxis-CPmuCRhq.mjs +487 -0
- package/dist/ChartsXAxis-DFFY1sPg.js +3 -0
- package/dist/ChartsYAxis-DLUMr9vG.mjs +392 -0
- package/dist/ChartsYAxis-fpevi1sP.js +1 -0
- package/dist/clampAngle-BvZjnf53.mjs +11 -0
- package/dist/clampAngle-DpAsDoeT.js +1 -0
- package/dist/components/FormGenerator.d.ts +33 -1
- package/dist/components/controls/AsyncAutocomplete/asyncautocomplete.d.ts +9 -0
- package/dist/components/controls/CheckBox/checkbox.d.ts +1 -1
- package/dist/components/controls/ChipSelect/chipselect.d.ts +1 -1
- package/dist/components/controls/EditableTable/editabletable.d.ts +2 -0
- package/dist/components/controls/IntlPhone/intlphone.d.ts +2 -0
- package/dist/components/controls/LocationField/locationfield.d.ts +1 -1
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -1
- package/dist/components/controls/NpsScale/npsscale.d.ts +3 -0
- package/dist/components/controls/NumberField/numberfield.d.ts +1 -1
- package/dist/components/controls/PasswordField/passwordfield.d.ts +1 -1
- package/dist/components/controls/Radio/radio.d.ts +1 -1
- package/dist/components/controls/RichTextEditor/richtexteditor.d.ts +3 -0
- package/dist/components/controls/Select/select.d.ts +1 -1
- package/dist/components/controls/Switch/switch.d.ts +1 -1
- package/dist/components/controls/TextField/textfield.d.ts +1 -1
- package/dist/components/controls/index.d.ts +10 -0
- package/dist/createSelector-B-9FwV16.mjs +430 -0
- package/dist/createSelector-f0oqn8Lr.js +7 -0
- package/dist/dynamic-mui.cjs.js +1 -469
- package/dist/dynamic-mui.es.js +20 -102548
- package/dist/index--8Zky9Oh.js +299 -0
- package/dist/index-6WTs1Xy_.js +1 -0
- package/dist/index-B1R1akM2.js +1 -0
- package/dist/index-B_KNUTjy.js +1 -0
- package/dist/index-BhaKvHkU.mjs +62051 -0
- package/dist/index-Bif92ima.js +1 -0
- package/dist/index-BnZOu8CL.js +1 -0
- package/dist/index-CDxpgRlR.mjs +7 -0
- package/dist/index-CThMfvtJ.mjs +2555 -0
- package/dist/index-CodJBIn6.mjs +1665 -0
- package/dist/index-CslPwsrf.mjs +4 -0
- package/dist/index-CuV0MQzZ.mjs +1173 -0
- package/dist/index-DSkYYZuW.mjs +4 -0
- package/dist/index-DU78_FiA.js +1 -0
- package/dist/index-D_mYhgJ0.js +10 -0
- package/dist/index-Dlimbnxj.mjs +2965 -0
- package/dist/index-in5z9hUb.js +133 -0
- package/dist/index-qUW7FnZ-.mjs +20540 -0
- package/dist/index.d.ts +3 -1
- package/dist/isDeepEqual-BHfPvf9U.mjs +393 -0
- package/dist/isDeepEqual-CqxZGVRk.js +1 -0
- package/dist/playground/DemoGallery.d.ts +6 -0
- package/dist/playground/Sidebar.d.ts +9 -1
- package/dist/playground/demoForms.d.ts +3 -0
- package/dist/playground/demoRecipes.d.ts +15 -0
- package/dist/playground/demoVariants.d.ts +11 -0
- package/dist/schema.d.ts +404 -0
- package/dist/theme/theme.d.ts +5 -0
- package/dist/types.d.ts +16 -0
- package/dist/useAxis-DSbfEtO7.js +3 -0
- package/dist/useAxis-SiNBMMWq.mjs +3010 -0
- package/dist/useChartContainerProps-Bl3hO-r1.mjs +5418 -0
- package/dist/useChartContainerProps-C_C_PZoi.js +12 -0
- package/dist/useItemHighlightedGetter-9CIwqsGj.js +1 -0
- package/dist/useItemHighlightedGetter-CTISrNdV.mjs +88 -0
- package/package.json +1 -1
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { c as ae, a as R, u as D, _ as r, b as U, d as $, e as F, j as d, s as ce, w as le, P as e } from "./index-BhaKvHkU.mjs";
|
|
2
|
+
import * as V from "react";
|
|
3
|
+
import { e as re, d as de, b as X, g as xe, C as W, c as ue, f as fe, i as pe, u as K, h as ke, j as be, k as me, A as he } from "./AxisSharedComponents-xLtpOLH_.mjs";
|
|
4
|
+
import { a as q, c as J, d as Q, i as Z } from "./useAxis-SiNBMMWq.mjs";
|
|
5
|
+
import { c as Te } from "./clampAngle-BvZjnf53.mjs";
|
|
6
|
+
function ye(s, t, a, i, c) {
|
|
7
|
+
const f = /* @__PURE__ */ new Map(), p = Te(c?.angle ?? 0);
|
|
8
|
+
let l = 1, o = 1;
|
|
9
|
+
c?.textAnchor === "start" ? (l = 1 / 0, o = 1) : c?.textAnchor === "end" ? (l = 1, o = 1 / 0) : (l = 2, o = 2), p > 180 && ([l, o] = [o, l]), i && ([l, o] = [o, l]);
|
|
10
|
+
for (const n of s)
|
|
11
|
+
if (n.formattedValue) {
|
|
12
|
+
const x = Math.min((n.offset + n.labelOffset) * l, (t.top + t.height + t.bottom - n.offset - n.labelOffset) * o), u = (b) => de(b, {
|
|
13
|
+
width: a,
|
|
14
|
+
height: x,
|
|
15
|
+
angle: p,
|
|
16
|
+
measureText: (m) => X(m, c)
|
|
17
|
+
});
|
|
18
|
+
f.set(n, re(n.formattedValue.toString(), u));
|
|
19
|
+
}
|
|
20
|
+
return f;
|
|
21
|
+
}
|
|
22
|
+
const ee = (s) => {
|
|
23
|
+
const {
|
|
24
|
+
classes: t,
|
|
25
|
+
position: a,
|
|
26
|
+
id: i
|
|
27
|
+
} = s, c = {
|
|
28
|
+
root: ["root", "directionY", a, `id-${i}`],
|
|
29
|
+
line: ["line"],
|
|
30
|
+
tickContainer: ["tickContainer"],
|
|
31
|
+
tick: ["tick"],
|
|
32
|
+
tickLabel: ["tickLabel"],
|
|
33
|
+
label: ["label"]
|
|
34
|
+
};
|
|
35
|
+
return ae(c, xe, t);
|
|
36
|
+
}, B = 2, ge = 2, te = {
|
|
37
|
+
disableLine: !1,
|
|
38
|
+
disableTicks: !1,
|
|
39
|
+
tickSize: 6
|
|
40
|
+
}, Le = ["scale", "tickNumber", "reverse"];
|
|
41
|
+
function se(s) {
|
|
42
|
+
const {
|
|
43
|
+
yAxis: t,
|
|
44
|
+
yAxisIds: a
|
|
45
|
+
} = q(), i = t[s.axisId ?? a[0]], {
|
|
46
|
+
scale: c,
|
|
47
|
+
tickNumber: f
|
|
48
|
+
} = i, p = R(i, Le), l = D({
|
|
49
|
+
props: r({}, p, s),
|
|
50
|
+
name: "MuiChartsYAxis"
|
|
51
|
+
}), o = r({}, te, l), {
|
|
52
|
+
position: n,
|
|
53
|
+
tickLabelStyle: x,
|
|
54
|
+
slots: u,
|
|
55
|
+
slotProps: b
|
|
56
|
+
} = o, m = U(), C = $(), y = ee(o), P = n === "right" ? 1 : -1, A = typeof x?.fontSize == "number" ? x.fontSize : 12, h = u?.axisTick ?? "line", k = u?.axisTickLabel ?? W, T = ue((n === "right" ? -90 : 90) - (x?.angle ?? 0)), g = fe((n === "right" ? -90 : 90) - (x?.angle ?? 0)), j = F({
|
|
57
|
+
elementType: k,
|
|
58
|
+
// @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
|
|
59
|
+
externalSlotProps: b?.axisTickLabel,
|
|
60
|
+
// @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
|
|
61
|
+
additionalProps: {
|
|
62
|
+
style: r({}, m.typography.caption, {
|
|
63
|
+
fontSize: A,
|
|
64
|
+
textAnchor: C ? pe(T) : T,
|
|
65
|
+
dominantBaseline: g
|
|
66
|
+
}, x)
|
|
67
|
+
},
|
|
68
|
+
className: y.tickLabel,
|
|
69
|
+
ownerState: {}
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
yScale: c,
|
|
73
|
+
defaultizedProps: o,
|
|
74
|
+
tickNumber: f,
|
|
75
|
+
positionSign: P,
|
|
76
|
+
classes: y,
|
|
77
|
+
Tick: h,
|
|
78
|
+
TickLabel: k,
|
|
79
|
+
axisTickLabelProps: j
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function Se(s) {
|
|
83
|
+
const {
|
|
84
|
+
axisLabelHeight: t,
|
|
85
|
+
ordinalTimeTicks: a
|
|
86
|
+
} = s, {
|
|
87
|
+
yScale: i,
|
|
88
|
+
defaultizedProps: c,
|
|
89
|
+
tickNumber: f,
|
|
90
|
+
positionSign: p,
|
|
91
|
+
classes: l,
|
|
92
|
+
Tick: o,
|
|
93
|
+
TickLabel: n,
|
|
94
|
+
axisTickLabelProps: x
|
|
95
|
+
} = se(s), u = $(), {
|
|
96
|
+
disableTicks: b,
|
|
97
|
+
tickSize: m,
|
|
98
|
+
valueFormatter: C,
|
|
99
|
+
slotProps: y,
|
|
100
|
+
tickPlacement: P,
|
|
101
|
+
tickLabelPlacement: A,
|
|
102
|
+
tickInterval: h,
|
|
103
|
+
tickLabelInterval: k,
|
|
104
|
+
tickSpacing: T,
|
|
105
|
+
width: g
|
|
106
|
+
} = c, j = J(), {
|
|
107
|
+
instance: N
|
|
108
|
+
} = Q(), z = K(), I = b ? 4 : m, L = ke({
|
|
109
|
+
scale: i,
|
|
110
|
+
tickNumber: f,
|
|
111
|
+
valueFormatter: C,
|
|
112
|
+
tickPlacement: P,
|
|
113
|
+
tickLabelPlacement: A,
|
|
114
|
+
tickInterval: h,
|
|
115
|
+
tickSpacing: T,
|
|
116
|
+
direction: "y",
|
|
117
|
+
ordinalTimeTicks: a
|
|
118
|
+
}), O = Math.max(0, g - (t > 0 ? t + ge : 0) - I - B), w = z ? ye(L, j, O, u, x.style) : new Map(Array.from(L).map((S) => [S, S.formattedValue]));
|
|
119
|
+
return /* @__PURE__ */ d.jsx(V.Fragment, {
|
|
120
|
+
children: L.map((S, v) => {
|
|
121
|
+
const {
|
|
122
|
+
offset: _,
|
|
123
|
+
labelOffset: G,
|
|
124
|
+
value: M
|
|
125
|
+
} = S, Y = p * (I + B), ie = G, oe = typeof k == "function" && !k?.(M, v), ne = N.isYInside(_), E = w.get(S);
|
|
126
|
+
return ne ? /* @__PURE__ */ d.jsxs("g", {
|
|
127
|
+
transform: `translate(0, ${_})`,
|
|
128
|
+
className: l.tickContainer,
|
|
129
|
+
children: [!b && /* @__PURE__ */ d.jsx(o, r({
|
|
130
|
+
x2: p * I,
|
|
131
|
+
className: l.tick
|
|
132
|
+
}, y?.axisTick)), E !== void 0 && !oe && /* @__PURE__ */ d.jsx(n, r({
|
|
133
|
+
x: Y,
|
|
134
|
+
y: ie,
|
|
135
|
+
text: E
|
|
136
|
+
}, x))]
|
|
137
|
+
}, v) : null;
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const H = {
|
|
142
|
+
tickSize: 6
|
|
143
|
+
}, Pe = (s, t, a) => {
|
|
144
|
+
const i = s[t] ?? {}, c = a ?? H.tickSize, f = c * t * 2 + c;
|
|
145
|
+
return r({}, H, i, {
|
|
146
|
+
tickSize: i.tickSize ?? f
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
function Ae(s) {
|
|
150
|
+
const {
|
|
151
|
+
yScale: t,
|
|
152
|
+
defaultizedProps: a,
|
|
153
|
+
positionSign: i,
|
|
154
|
+
classes: c,
|
|
155
|
+
Tick: f,
|
|
156
|
+
TickLabel: p,
|
|
157
|
+
axisTickLabelProps: l
|
|
158
|
+
} = se(s);
|
|
159
|
+
if (!Z(t))
|
|
160
|
+
throw new Error("MUI X Charts: ChartsGroupedYAxis only supports the `band` and `point` scale types.");
|
|
161
|
+
const {
|
|
162
|
+
disableTicks: o,
|
|
163
|
+
tickSize: n,
|
|
164
|
+
valueFormatter: x,
|
|
165
|
+
slotProps: u,
|
|
166
|
+
tickInterval: b,
|
|
167
|
+
tickPlacement: m,
|
|
168
|
+
tickLabelPlacement: C
|
|
169
|
+
} = a, y = a.groups, {
|
|
170
|
+
instance: P
|
|
171
|
+
} = Q(), A = be({
|
|
172
|
+
scale: t,
|
|
173
|
+
tickInterval: b,
|
|
174
|
+
tickPlacement: m,
|
|
175
|
+
tickLabelPlacement: C,
|
|
176
|
+
groups: y
|
|
177
|
+
});
|
|
178
|
+
return /* @__PURE__ */ d.jsx(V.Fragment, {
|
|
179
|
+
children: A.map((h, k) => {
|
|
180
|
+
const {
|
|
181
|
+
offset: T,
|
|
182
|
+
labelOffset: g
|
|
183
|
+
} = h, j = g ?? 0, N = P.isYInside(T), z = h.formattedValue, I = h.ignoreTick ?? !1, L = h.groupIndex ?? 0, O = Pe(y, L, n), w = i * O.tickSize, S = i * (O.tickSize + B);
|
|
184
|
+
return /* @__PURE__ */ d.jsxs("g", {
|
|
185
|
+
transform: `translate(0, ${T})`,
|
|
186
|
+
className: c.tickContainer,
|
|
187
|
+
"data-group-index": L,
|
|
188
|
+
children: [!o && !I && N && /* @__PURE__ */ d.jsx(f, r({
|
|
189
|
+
x2: w,
|
|
190
|
+
className: c.tick
|
|
191
|
+
}, u?.axisTick)), z !== void 0 && /* @__PURE__ */ d.jsx(p, r({
|
|
192
|
+
x: S,
|
|
193
|
+
y: j
|
|
194
|
+
}, l, {
|
|
195
|
+
style: r({}, l.style, O.tickLabelStyle),
|
|
196
|
+
text: z
|
|
197
|
+
}))]
|
|
198
|
+
}, k);
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
const Ie = ["axis"], Ce = ["scale", "tickNumber", "reverse", "ordinalTimeTicks"], je = ce(he, {
|
|
203
|
+
name: "MuiChartsYAxis",
|
|
204
|
+
slot: "Root"
|
|
205
|
+
})({});
|
|
206
|
+
function ze(s) {
|
|
207
|
+
let {
|
|
208
|
+
axis: t
|
|
209
|
+
} = s, a = R(s, Ie);
|
|
210
|
+
const {
|
|
211
|
+
scale: i,
|
|
212
|
+
ordinalTimeTicks: c
|
|
213
|
+
} = t, f = R(t, Ce), p = K(), l = D({
|
|
214
|
+
props: r({}, f, a),
|
|
215
|
+
name: "MuiChartsYAxis"
|
|
216
|
+
}), o = r({}, te, l), {
|
|
217
|
+
position: n,
|
|
218
|
+
disableLine: x,
|
|
219
|
+
label: u,
|
|
220
|
+
labelStyle: b,
|
|
221
|
+
offset: m,
|
|
222
|
+
width: C,
|
|
223
|
+
sx: y,
|
|
224
|
+
slots: P,
|
|
225
|
+
slotProps: A
|
|
226
|
+
} = o, h = U(), k = ee(o), {
|
|
227
|
+
left: T,
|
|
228
|
+
top: g,
|
|
229
|
+
width: j,
|
|
230
|
+
height: N
|
|
231
|
+
} = J(), z = n === "right" ? 1 : -1, I = P?.axisLine ?? "line", L = P?.axisLabel ?? W, O = F({
|
|
232
|
+
elementType: I,
|
|
233
|
+
externalSlotProps: A?.axisLine,
|
|
234
|
+
additionalProps: {
|
|
235
|
+
strokeLinecap: "square"
|
|
236
|
+
},
|
|
237
|
+
ownerState: {}
|
|
238
|
+
}), w = F({
|
|
239
|
+
elementType: L,
|
|
240
|
+
// @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
|
|
241
|
+
externalSlotProps: A?.axisLabel,
|
|
242
|
+
// @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
|
|
243
|
+
additionalProps: {
|
|
244
|
+
style: r({}, h.typography.body1, {
|
|
245
|
+
lineHeight: 1,
|
|
246
|
+
fontSize: 14,
|
|
247
|
+
angle: z * 90,
|
|
248
|
+
textAnchor: "middle",
|
|
249
|
+
dominantBaseline: "text-before-edge"
|
|
250
|
+
}, b)
|
|
251
|
+
},
|
|
252
|
+
ownerState: {}
|
|
253
|
+
});
|
|
254
|
+
if (n === "none")
|
|
255
|
+
return null;
|
|
256
|
+
const S = {
|
|
257
|
+
x: z * C,
|
|
258
|
+
y: g + N / 2
|
|
259
|
+
}, v = u == null ? 0 : X(u, w.style).height, _ = i.domain(), M = Z(i) ? _.length === 0 : _.some(me);
|
|
260
|
+
let Y = null;
|
|
261
|
+
return M || (Y = "groups" in t && Array.isArray(t.groups) ? /* @__PURE__ */ d.jsx(Ae, r({}, a)) : /* @__PURE__ */ d.jsx(Se, r({}, a, {
|
|
262
|
+
axisLabelHeight: v,
|
|
263
|
+
ordinalTimeTicks: c
|
|
264
|
+
}))), /* @__PURE__ */ d.jsxs(je, {
|
|
265
|
+
transform: `translate(${n === "right" ? T + j + m : T - m}, 0)`,
|
|
266
|
+
className: k.root,
|
|
267
|
+
"data-axis-id": o.id,
|
|
268
|
+
sx: y,
|
|
269
|
+
children: [!x && /* @__PURE__ */ d.jsx(I, r({
|
|
270
|
+
y1: g,
|
|
271
|
+
y2: g + N,
|
|
272
|
+
className: k.line
|
|
273
|
+
}, O)), Y, u && p && /* @__PURE__ */ d.jsx("g", {
|
|
274
|
+
className: k.label,
|
|
275
|
+
children: /* @__PURE__ */ d.jsx(L, r({}, S, w, {
|
|
276
|
+
text: u
|
|
277
|
+
}))
|
|
278
|
+
})]
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
function Oe(s) {
|
|
282
|
+
const {
|
|
283
|
+
yAxis: t,
|
|
284
|
+
yAxisIds: a
|
|
285
|
+
} = q(), i = t[s.axisId ?? a[0]];
|
|
286
|
+
return i ? /* @__PURE__ */ d.jsx(ze, r({}, s, {
|
|
287
|
+
axis: i
|
|
288
|
+
})) : (le(`MUI X Charts: No axis found. The axisId "${s.axisId}" is probably invalid.`), null);
|
|
289
|
+
}
|
|
290
|
+
process.env.NODE_ENV !== "production" && (Oe.propTypes = {
|
|
291
|
+
// ----------------------------- Warning --------------------------------
|
|
292
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
293
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
294
|
+
// ----------------------------------------------------------------------
|
|
295
|
+
axis: e.oneOf(["y"]),
|
|
296
|
+
/**
|
|
297
|
+
* The id of the axis to render.
|
|
298
|
+
* If undefined, it will be the first defined axis.
|
|
299
|
+
*/
|
|
300
|
+
axisId: e.oneOfType([e.number, e.string]),
|
|
301
|
+
/**
|
|
302
|
+
* Override or extend the styles applied to the component.
|
|
303
|
+
*/
|
|
304
|
+
classes: e.object,
|
|
305
|
+
/**
|
|
306
|
+
* If true, the axis line is disabled.
|
|
307
|
+
* @default false
|
|
308
|
+
*/
|
|
309
|
+
disableLine: e.bool,
|
|
310
|
+
/**
|
|
311
|
+
* If true, the ticks are disabled.
|
|
312
|
+
* @default false
|
|
313
|
+
*/
|
|
314
|
+
disableTicks: e.bool,
|
|
315
|
+
/**
|
|
316
|
+
* The label of the axis.
|
|
317
|
+
*/
|
|
318
|
+
label: e.string,
|
|
319
|
+
/**
|
|
320
|
+
* The style applied to the axis label.
|
|
321
|
+
*/
|
|
322
|
+
labelStyle: e.object,
|
|
323
|
+
/**
|
|
324
|
+
* The props used for each component slot.
|
|
325
|
+
* @default {}
|
|
326
|
+
*/
|
|
327
|
+
slotProps: e.object,
|
|
328
|
+
/**
|
|
329
|
+
* Overridable component slots.
|
|
330
|
+
* @default {}
|
|
331
|
+
*/
|
|
332
|
+
slots: e.object,
|
|
333
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
334
|
+
/**
|
|
335
|
+
* Defines which ticks are displayed.
|
|
336
|
+
* Its value can be:
|
|
337
|
+
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
|
|
338
|
+
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
|
|
339
|
+
* - an array containing the values where ticks should be displayed.
|
|
340
|
+
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
|
|
341
|
+
* @default 'auto'
|
|
342
|
+
*/
|
|
343
|
+
tickInterval: e.oneOfType([e.oneOf(["auto"]), e.array, e.func]),
|
|
344
|
+
/**
|
|
345
|
+
* Defines which ticks get its label displayed. Its value can be:
|
|
346
|
+
* - 'auto' In such case, labels are displayed if they do not overlap with the previous one.
|
|
347
|
+
* - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones.
|
|
348
|
+
* @default 'auto'
|
|
349
|
+
*/
|
|
350
|
+
tickLabelInterval: e.oneOfType([e.oneOf(["auto"]), e.func]),
|
|
351
|
+
/**
|
|
352
|
+
* The placement of ticks label. Can be the middle of the band, or the tick position.
|
|
353
|
+
* Only used if scale is 'band'.
|
|
354
|
+
* @default 'middle'
|
|
355
|
+
*/
|
|
356
|
+
tickLabelPlacement: e.oneOf(["middle", "tick"]),
|
|
357
|
+
/**
|
|
358
|
+
* The style applied to ticks text.
|
|
359
|
+
*/
|
|
360
|
+
tickLabelStyle: e.object,
|
|
361
|
+
/**
|
|
362
|
+
* Maximal step between two ticks.
|
|
363
|
+
* When using time data, the value is assumed to be in ms.
|
|
364
|
+
* Not supported by categorical axis (band, points).
|
|
365
|
+
*/
|
|
366
|
+
tickMaxStep: e.number,
|
|
367
|
+
/**
|
|
368
|
+
* Minimal step between two ticks.
|
|
369
|
+
* When using time data, the value is assumed to be in ms.
|
|
370
|
+
* Not supported by categorical axis (band, points).
|
|
371
|
+
*/
|
|
372
|
+
tickMinStep: e.number,
|
|
373
|
+
/**
|
|
374
|
+
* The number of ticks. This number is not guaranteed.
|
|
375
|
+
* Not supported by categorical axis (band, points).
|
|
376
|
+
*/
|
|
377
|
+
tickNumber: e.number,
|
|
378
|
+
/**
|
|
379
|
+
* The placement of ticks in regard to the band interval.
|
|
380
|
+
* Only used if scale is 'band'.
|
|
381
|
+
* @default 'extremities'
|
|
382
|
+
*/
|
|
383
|
+
tickPlacement: e.oneOf(["end", "extremities", "middle", "start"]),
|
|
384
|
+
/**
|
|
385
|
+
* The size of the ticks.
|
|
386
|
+
* @default 6
|
|
387
|
+
*/
|
|
388
|
+
tickSize: e.number
|
|
389
|
+
});
|
|
390
|
+
export {
|
|
391
|
+
Oe as C
|
|
392
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./index--8Zky9Oh.js"),$=require("react"),l=require("./AxisSharedComponents-BbsKw1BT.js"),A=require("./useAxis-DSbfEtO7.js"),K=require("./clampAngle-DpAsDoeT.js");function J(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>s[i]})}}return t.default=s,Object.freeze(t)}const D=J($);function Q(s,t,i,o,r){const d=new Map,u=K.clampAngle(r?.angle??0);let c=1,n=1;r?.textAnchor==="start"?(c=1/0,n=1):r?.textAnchor==="end"?(c=1,n=1/0):(c=2,n=2),u>180&&([c,n]=[n,c]),o&&([c,n]=[n,c]);for(const a of s)if(a.formattedValue){const p=Math.min((a.offset+a.labelOffset)*c,(t.top+t.height+t.bottom-a.offset-a.labelOffset)*n),x=T=>l.doesTextFitInRect(T,{width:i,height:p,angle:u,measureText:y=>l.getStringSize(y,r)});d.set(a,l.ellipsize(a.formattedValue.toString(),x))}return d}const G=s=>{const{classes:t,position:i,id:o}=s,r={root:["root","directionY",i,`id-${o}`],line:["line"],tickContainer:["tickContainer"],tick:["tick"],tickLabel:["tickLabel"],label:["label"]};return e.composeClasses(r,l.getAxisUtilityClass,t)},Y=2,Z=2,H={disableLine:!1,disableTicks:!1,tickSize:6},ee=["scale","tickNumber","reverse"];function q(s){const{yAxis:t,yAxisIds:i}=A.useYAxes(),o=t[s.axisId??i[0]],{scale:r,tickNumber:d}=o,u=e._objectWithoutPropertiesLoose(o,ee),c=e.useThemeProps({props:e._extends({},u,s),name:"MuiChartsYAxis"}),n=e._extends({},H,c),{position:a,tickLabelStyle:p,slots:x,slotProps:T}=n,y=e.useTheme(),_=e.useRtl(),b=G(n),S=a==="right"?1:-1,L=typeof p?.fontSize=="number"?p.fontSize:12,k=x?.axisTick??"line",f=x?.axisTickLabel??l.ChartsText,m=l.getDefaultTextAnchor((a==="right"?-90:90)-(p?.angle??0)),h=l.getDefaultBaseline((a==="right"?-90:90)-(p?.angle??0)),C=e.useSlotProps({elementType:f,externalSlotProps:T?.axisTickLabel,additionalProps:{style:e._extends({},y.typography.caption,{fontSize:L,textAnchor:_?l.invertTextAnchor(m):m,dominantBaseline:h},p)},className:b.tickLabel,ownerState:{}});return{yScale:r,defaultizedProps:n,tickNumber:d,positionSign:S,classes:b,Tick:k,TickLabel:f,axisTickLabelProps:C}}function te(s){const{axisLabelHeight:t,ordinalTimeTicks:i}=s,{yScale:o,defaultizedProps:r,tickNumber:d,positionSign:u,classes:c,Tick:n,TickLabel:a,axisTickLabelProps:p}=q(s),x=e.useRtl(),{disableTicks:T,tickSize:y,valueFormatter:_,slotProps:b,tickPlacement:S,tickLabelPlacement:L,tickInterval:k,tickLabelInterval:f,tickSpacing:m,width:h}=r,C=A.useDrawingArea(),{instance:z}=A.useChartContext(),O=l.useIsHydrated(),j=T?4:y,P=l.useTicks({scale:o,tickNumber:d,valueFormatter:_,tickPlacement:S,tickLabelPlacement:L,tickInterval:k,tickSpacing:m,direction:"y",ordinalTimeTicks:i}),I=Math.max(0,h-(t>0?t+Z:0)-j-Y),R=O?Q(P,C,I,x,p.style):new Map(Array.from(P).map(g=>[g,g.formattedValue]));return e.jsxRuntimeExports.jsx(D.Fragment,{children:P.map((g,N)=>{const{offset:E,labelOffset:M,value:v}=g,w=u*(j+Y),W=M,V=typeof f=="function"&&!f?.(v,N),X=z.isYInside(E),F=R.get(g);return X?e.jsxRuntimeExports.jsxs("g",{transform:`translate(0, ${E})`,className:c.tickContainer,children:[!T&&e.jsxRuntimeExports.jsx(n,e._extends({x2:u*j,className:c.tick},b?.axisTick)),F!==void 0&&!V&&e.jsxRuntimeExports.jsx(a,e._extends({x:w,y:W,text:F},p))]},N):null})})}const B={tickSize:6},se=(s,t,i)=>{const o=s[t]??{},r=i??B.tickSize,d=r*t*2+r;return e._extends({},B,o,{tickSize:o.tickSize??d})};function ie(s){const{yScale:t,defaultizedProps:i,positionSign:o,classes:r,Tick:d,TickLabel:u,axisTickLabelProps:c}=q(s);if(!A.isOrdinalScale(t))throw new Error("MUI X Charts: ChartsGroupedYAxis only supports the `band` and `point` scale types.");const{disableTicks:n,tickSize:a,valueFormatter:p,slotProps:x,tickInterval:T,tickPlacement:y,tickLabelPlacement:_}=i,b=i.groups,{instance:S}=A.useChartContext(),L=l.useTicksGrouped({scale:t,tickInterval:T,tickPlacement:y,tickLabelPlacement:_,groups:b});return e.jsxRuntimeExports.jsx(D.Fragment,{children:L.map((k,f)=>{const{offset:m,labelOffset:h}=k,C=h??0,z=S.isYInside(m),O=k.formattedValue,j=k.ignoreTick??!1,P=k.groupIndex??0,I=se(b,P,a),R=o*I.tickSize,g=o*(I.tickSize+Y);return e.jsxRuntimeExports.jsxs("g",{transform:`translate(0, ${m})`,className:r.tickContainer,"data-group-index":P,children:[!n&&!j&&z&&e.jsxRuntimeExports.jsx(d,e._extends({x2:R,className:r.tick},x?.axisTick)),O!==void 0&&e.jsxRuntimeExports.jsx(u,e._extends({x:g,y:C},c,{style:e._extends({},c.style,I.tickLabelStyle),text:O}))]},f)})})}const oe=["axis"],ne=["scale","tickNumber","reverse","ordinalTimeTicks"],ae=e.styled(l.AxisRoot,{name:"MuiChartsYAxis",slot:"Root"})({});function re(s){let{axis:t}=s,i=e._objectWithoutPropertiesLoose(s,oe);const{scale:o,ordinalTimeTicks:r}=t,d=e._objectWithoutPropertiesLoose(t,ne),u=l.useIsHydrated(),c=e.useThemeProps({props:e._extends({},d,i),name:"MuiChartsYAxis"}),n=e._extends({},H,c),{position:a,disableLine:p,label:x,labelStyle:T,offset:y,width:_,sx:b,slots:S,slotProps:L}=n,k=e.useTheme(),f=G(n),{left:m,top:h,width:C,height:z}=A.useDrawingArea(),O=a==="right"?1:-1,j=S?.axisLine??"line",P=S?.axisLabel??l.ChartsText,I=e.useSlotProps({elementType:j,externalSlotProps:L?.axisLine,additionalProps:{strokeLinecap:"square"},ownerState:{}}),R=e.useSlotProps({elementType:P,externalSlotProps:L?.axisLabel,additionalProps:{style:e._extends({},k.typography.body1,{lineHeight:1,fontSize:14,angle:O*90,textAnchor:"middle",dominantBaseline:"text-before-edge"},T)},ownerState:{}});if(a==="none")return null;const g={x:O*_,y:h+z/2},N=x==null?0:l.getStringSize(x,R.style).height,E=o.domain(),v=A.isOrdinalScale(o)?E.length===0:E.some(l.isInfinity);let w=null;return v||(w="groups"in t&&Array.isArray(t.groups)?e.jsxRuntimeExports.jsx(ie,e._extends({},i)):e.jsxRuntimeExports.jsx(te,e._extends({},i,{axisLabelHeight:N,ordinalTimeTicks:r}))),e.jsxRuntimeExports.jsxs(ae,{transform:`translate(${a==="right"?m+C+y:m-y}, 0)`,className:f.root,"data-axis-id":n.id,sx:b,children:[!p&&e.jsxRuntimeExports.jsx(j,e._extends({y1:h,y2:h+z,className:f.line},I)),w,x&&u&&e.jsxRuntimeExports.jsx("g",{className:f.label,children:e.jsxRuntimeExports.jsx(P,e._extends({},g,R,{text:x}))})]})}function U(s){const{yAxis:t,yAxisIds:i}=A.useYAxes(),o=t[s.axisId??i[0]];return o?e.jsxRuntimeExports.jsx(re,e._extends({},s,{axis:o})):(e.warnOnce(`MUI X Charts: No axis found. The axisId "${s.axisId}" is probably invalid.`),null)}process.env.NODE_ENV!=="production"&&(U.propTypes={axis:e.PropTypes.oneOf(["y"]),axisId:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]),classes:e.PropTypes.object,disableLine:e.PropTypes.bool,disableTicks:e.PropTypes.bool,label:e.PropTypes.string,labelStyle:e.PropTypes.object,slotProps:e.PropTypes.object,slots:e.PropTypes.object,sx:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.oneOfType([e.PropTypes.func,e.PropTypes.object,e.PropTypes.bool])),e.PropTypes.func,e.PropTypes.object]),tickInterval:e.PropTypes.oneOfType([e.PropTypes.oneOf(["auto"]),e.PropTypes.array,e.PropTypes.func]),tickLabelInterval:e.PropTypes.oneOfType([e.PropTypes.oneOf(["auto"]),e.PropTypes.func]),tickLabelPlacement:e.PropTypes.oneOf(["middle","tick"]),tickLabelStyle:e.PropTypes.object,tickMaxStep:e.PropTypes.number,tickMinStep:e.PropTypes.number,tickNumber:e.PropTypes.number,tickPlacement:e.PropTypes.oneOf(["end","extremities","middle","start"]),tickSize:e.PropTypes.number});exports.ChartsYAxis=U;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function l(n){return(n%360+360)%360}const c=2*Math.PI;function t(n){return(n%c+c)%c}exports.clampAngle=l;exports.clampAngleRad=t;
|
|
@@ -3,6 +3,11 @@ import { GridProps } from '@mui/material';
|
|
|
3
3
|
import { FormField } from '../util/helper';
|
|
4
4
|
export declare const FormData: (id?: string) => any;
|
|
5
5
|
export declare const ClearFormData: (id?: string) => void;
|
|
6
|
+
/** Convenience accessor for a form's stored values (imperative; pairs with `guid`). */
|
|
7
|
+
export declare const useForm: (guid: string) => {
|
|
8
|
+
getValues: () => any;
|
|
9
|
+
clear: () => void;
|
|
10
|
+
};
|
|
6
11
|
export interface FormGeneratorProps {
|
|
7
12
|
/** Component unique identifier */
|
|
8
13
|
guid: string;
|
|
@@ -46,5 +51,32 @@ export interface FormGeneratorProps {
|
|
|
46
51
|
autoSaveKey?: string;
|
|
47
52
|
/** Which browser storage to use for auto-save (default 'local'). */
|
|
48
53
|
autoSaveStorage?: 'local' | 'session';
|
|
54
|
+
/** Imperative API — getValues/getErrors/validate/reset/setValues/submit. */
|
|
55
|
+
apiRef?: React.Ref<FormApi>;
|
|
56
|
+
/** Localizable default messages (e.g. { required: 'Champ obligatoire' }). */
|
|
57
|
+
messages?: FormMessages;
|
|
58
|
+
/** Show a visible validation summary above the form after a failed submit. */
|
|
59
|
+
validationSummary?: boolean;
|
|
49
60
|
}
|
|
50
|
-
|
|
61
|
+
/** Localizable built-in strings. */
|
|
62
|
+
export interface FormMessages {
|
|
63
|
+
required?: string;
|
|
64
|
+
/** "{n} error(s) found" summary prefix; `{n}` is replaced with the count. */
|
|
65
|
+
errorSummary?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Imperative handle exposed via `apiRef`. */
|
|
68
|
+
export interface FormApi {
|
|
69
|
+
/** Current values for this form. */
|
|
70
|
+
getValues: () => Record<string, any>;
|
|
71
|
+
/** Run validation now and return the errors (also displays them). */
|
|
72
|
+
getErrors: () => any[];
|
|
73
|
+
/** Alias of getErrors that returns whether the form is valid. */
|
|
74
|
+
validate: () => boolean;
|
|
75
|
+
/** Merge values into the form and re-render. */
|
|
76
|
+
setValues: (values: Record<string, any>) => void;
|
|
77
|
+
/** Clear this form's stored values. */
|
|
78
|
+
reset: () => void;
|
|
79
|
+
/** Programmatically submit (runs the same flow as the submit button). */
|
|
80
|
+
submit: () => void;
|
|
81
|
+
}
|
|
82
|
+
export declare function FormGenerator({ data, patch, guid, formRef, onSubmit, onChange, onStepChange, MuiGridAttributes, activeStep, onFieldClick, onFieldDoubleClick, onFieldContextMenu, persistOnUnmount, autoSave, autoSaveKey, autoSaveStorage, apiRef, messages, validationSummary, }: FormGeneratorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ControlProps } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* AsyncAutocomplete — an MUI `Autocomplete` whose options are loaded
|
|
4
|
+
* asynchronously as the user types (server-side search). Client-side filtering
|
|
5
|
+
* is disabled; options come from `loadOptions(query)` or by fetching
|
|
6
|
+
* `optionsUrl` with a `q` query param. Requests are debounced and guarded
|
|
7
|
+
* against out-of-order responses.
|
|
8
|
+
*/
|
|
9
|
+
export default function AsyncAutocomplete({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
2
|
/** Playground Component */
|
|
3
|
-
export default function CheckBox({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function CheckBox({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
2
|
/** Premium selectable-chip control supporting single and multi select. */
|
|
3
|
-
export default function ChipSelect({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function ChipSelect({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
export default function LocationField({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function LocationField({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
export default function MultiTextbox({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function MultiTextbox({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ControlProps } from '../../../types';
|
|
2
|
+
/** NpsScale Component — a horizontal 0..N rating scale (Net Promoter Score style). */
|
|
3
|
+
export default function NpsScale({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
export default function NumberField({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function NumberField({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
export default function PasswordField({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function PasswordField({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
2
|
/** Radio Component */
|
|
3
|
-
export default function Radio({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function Radio({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
export default function Select({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Select({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
2
|
/** Switch Component */
|
|
3
|
-
export default function Switch({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function Switch({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlProps } from '../../../types';
|
|
2
|
-
export default function TextField({ attributes, rules, onChange }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function TextField({ attributes, rules, onChange, submitTick, messages }: ControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -40,6 +40,11 @@ import { default as CascadeSelect } from './CascadeSelect/cascadeselect';
|
|
|
40
40
|
import { default as FormWizard } from './FormWizard/formwizard';
|
|
41
41
|
import { default as SummaryField } from './SummaryField/summaryfield';
|
|
42
42
|
import { default as GeoField } from './GeoField/geofield';
|
|
43
|
+
import { default as RichTextEditor } from './RichTextEditor/richtexteditor';
|
|
44
|
+
import { default as NpsScale } from './NpsScale/npsscale';
|
|
45
|
+
import { default as EditableTable } from './EditableTable/editabletable';
|
|
46
|
+
import { default as IntlPhone } from './IntlPhone/intlphone';
|
|
47
|
+
import { default as AsyncAutocomplete } from './AsyncAutocomplete/asyncautocomplete';
|
|
43
48
|
import { default as List } from './List/list';
|
|
44
49
|
import { default as NumberField } from './NumberField/numberfield';
|
|
45
50
|
import { default as MultiTextbox } from './MultiTextbox/multitextbox';
|
|
@@ -96,6 +101,11 @@ declare const Controls: {
|
|
|
96
101
|
FormWizard: typeof FormWizard;
|
|
97
102
|
SummaryField: typeof SummaryField;
|
|
98
103
|
GeoField: typeof GeoField;
|
|
104
|
+
RichTextEditor: typeof RichTextEditor;
|
|
105
|
+
NpsScale: typeof NpsScale;
|
|
106
|
+
EditableTable: typeof EditableTable;
|
|
107
|
+
IntlPhone: typeof IntlPhone;
|
|
108
|
+
AsyncAutocomplete: typeof AsyncAutocomplete;
|
|
99
109
|
List: typeof List;
|
|
100
110
|
NumberField: typeof NumberField;
|
|
101
111
|
MultiTextbox: typeof MultiTextbox;
|