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.
Files changed (72) hide show
  1. package/README.md +218 -37
  2. package/dist/AxisSharedComponents-BbsKw1BT.js +3 -0
  3. package/dist/AxisSharedComponents-xLtpOLH_.mjs +605 -0
  4. package/dist/ChartsAxis-CANvBdY9.mjs +47 -0
  5. package/dist/ChartsAxis-EZ7m_KrU.js +1 -0
  6. package/dist/ChartsGrid-BCRTvNTr.js +3 -0
  7. package/dist/ChartsGrid-C_HT7qpL.mjs +381 -0
  8. package/dist/ChartsWrapper-CM7EDyAK.js +5 -0
  9. package/dist/ChartsWrapper-CO5_Z6BD.mjs +1878 -0
  10. package/dist/ChartsXAxis-CPmuCRhq.mjs +487 -0
  11. package/dist/ChartsXAxis-DFFY1sPg.js +3 -0
  12. package/dist/ChartsYAxis-DLUMr9vG.mjs +392 -0
  13. package/dist/ChartsYAxis-fpevi1sP.js +1 -0
  14. package/dist/clampAngle-BvZjnf53.mjs +11 -0
  15. package/dist/clampAngle-DpAsDoeT.js +1 -0
  16. package/dist/components/FormGenerator.d.ts +33 -1
  17. package/dist/components/controls/AsyncAutocomplete/asyncautocomplete.d.ts +9 -0
  18. package/dist/components/controls/CheckBox/checkbox.d.ts +1 -1
  19. package/dist/components/controls/ChipSelect/chipselect.d.ts +1 -1
  20. package/dist/components/controls/EditableTable/editabletable.d.ts +2 -0
  21. package/dist/components/controls/IntlPhone/intlphone.d.ts +2 -0
  22. package/dist/components/controls/LocationField/locationfield.d.ts +1 -1
  23. package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -1
  24. package/dist/components/controls/NpsScale/npsscale.d.ts +3 -0
  25. package/dist/components/controls/NumberField/numberfield.d.ts +1 -1
  26. package/dist/components/controls/PasswordField/passwordfield.d.ts +1 -1
  27. package/dist/components/controls/Radio/radio.d.ts +1 -1
  28. package/dist/components/controls/RichTextEditor/richtexteditor.d.ts +3 -0
  29. package/dist/components/controls/Select/select.d.ts +1 -1
  30. package/dist/components/controls/Switch/switch.d.ts +1 -1
  31. package/dist/components/controls/TextField/textfield.d.ts +1 -1
  32. package/dist/components/controls/index.d.ts +10 -0
  33. package/dist/createSelector-B-9FwV16.mjs +430 -0
  34. package/dist/createSelector-f0oqn8Lr.js +7 -0
  35. package/dist/dynamic-mui.cjs.js +1 -469
  36. package/dist/dynamic-mui.es.js +20 -102548
  37. package/dist/index--8Zky9Oh.js +299 -0
  38. package/dist/index-6WTs1Xy_.js +1 -0
  39. package/dist/index-B1R1akM2.js +1 -0
  40. package/dist/index-B_KNUTjy.js +1 -0
  41. package/dist/index-BhaKvHkU.mjs +62051 -0
  42. package/dist/index-Bif92ima.js +1 -0
  43. package/dist/index-BnZOu8CL.js +1 -0
  44. package/dist/index-CDxpgRlR.mjs +7 -0
  45. package/dist/index-CThMfvtJ.mjs +2555 -0
  46. package/dist/index-CodJBIn6.mjs +1665 -0
  47. package/dist/index-CslPwsrf.mjs +4 -0
  48. package/dist/index-CuV0MQzZ.mjs +1173 -0
  49. package/dist/index-DSkYYZuW.mjs +4 -0
  50. package/dist/index-DU78_FiA.js +1 -0
  51. package/dist/index-D_mYhgJ0.js +10 -0
  52. package/dist/index-Dlimbnxj.mjs +2965 -0
  53. package/dist/index-in5z9hUb.js +133 -0
  54. package/dist/index-qUW7FnZ-.mjs +20540 -0
  55. package/dist/index.d.ts +3 -1
  56. package/dist/isDeepEqual-BHfPvf9U.mjs +393 -0
  57. package/dist/isDeepEqual-CqxZGVRk.js +1 -0
  58. package/dist/playground/DemoGallery.d.ts +6 -0
  59. package/dist/playground/Sidebar.d.ts +9 -1
  60. package/dist/playground/demoForms.d.ts +3 -0
  61. package/dist/playground/demoRecipes.d.ts +15 -0
  62. package/dist/playground/demoVariants.d.ts +11 -0
  63. package/dist/schema.d.ts +404 -0
  64. package/dist/theme/theme.d.ts +5 -0
  65. package/dist/types.d.ts +16 -0
  66. package/dist/useAxis-DSbfEtO7.js +3 -0
  67. package/dist/useAxis-SiNBMMWq.mjs +3010 -0
  68. package/dist/useChartContainerProps-Bl3hO-r1.mjs +5418 -0
  69. package/dist/useChartContainerProps-C_C_PZoi.js +12 -0
  70. package/dist/useItemHighlightedGetter-9CIwqsGj.js +1 -0
  71. package/dist/useItemHighlightedGetter-CTISrNdV.mjs +88 -0
  72. package/package.json +1 -1
@@ -0,0 +1,605 @@
1
+ import * as D from "react";
2
+ import { d as Z, k as J, i as E } from "./useAxis-SiNBMMWq.mjs";
3
+ import { _ as $, g as Q, h as q, a as R, j as V, P as C, s as K } from "./index-BhaKvHkU.mjs";
4
+ import { c as B } from "./clampAngle-BvZjnf53.mjs";
5
+ function tt() {
6
+ const [e, t] = D.useState(!1);
7
+ return D.useEffect(() => {
8
+ t(!0);
9
+ }, []), e;
10
+ }
11
+ function et(e) {
12
+ return typeof e == "number" && !Number.isFinite(e);
13
+ }
14
+ function nt(e, t) {
15
+ return Math.abs(t.getFullYear() - e.getFullYear());
16
+ }
17
+ function j(e, t) {
18
+ return Math.abs(t.getFullYear() * 12 + t.getMonth() - 12 * e.getFullYear() - e.getMonth());
19
+ }
20
+ function S(e, t) {
21
+ return Math.abs(t.getTime() - e.getTime()) / (1e3 * 60 * 60 * 24);
22
+ }
23
+ function it(e, t) {
24
+ return Math.abs(t.getTime() - e.getTime()) / (1e3 * 60 * 60);
25
+ }
26
+ const rt = {
27
+ years: {
28
+ getTickNumber: nt,
29
+ isTick: (e, t) => t.getFullYear() !== e.getFullYear(),
30
+ format: (e) => e.getFullYear().toString()
31
+ },
32
+ quarterly: {
33
+ getTickNumber: (e, t) => Math.floor(j(e, t) / 3),
34
+ isTick: (e, t) => t.getMonth() !== e.getMonth() && t.getMonth() % 3 === 0,
35
+ format: new Intl.DateTimeFormat("default", {
36
+ month: "short"
37
+ }).format
38
+ },
39
+ months: {
40
+ getTickNumber: j,
41
+ isTick: (e, t) => t.getMonth() !== e.getMonth(),
42
+ format: new Intl.DateTimeFormat("default", {
43
+ month: "short"
44
+ }).format
45
+ },
46
+ biweekly: {
47
+ getTickNumber: (e, t) => S(e, t) / 14,
48
+ isTick: (e, t) => (t.getDay() < e.getDay() || S(t, e) > 7) && Math.floor(t.getDate() / 7) % 2 === 1,
49
+ format: new Intl.DateTimeFormat("default", {
50
+ day: "numeric"
51
+ }).format
52
+ },
53
+ weeks: {
54
+ getTickNumber: (e, t) => S(e, t) / 7,
55
+ isTick: (e, t) => t.getDay() < e.getDay() || S(t, e) >= 7,
56
+ format: new Intl.DateTimeFormat("default", {
57
+ day: "numeric"
58
+ }).format
59
+ },
60
+ days: {
61
+ getTickNumber: S,
62
+ isTick: (e, t) => t.getDate() !== e.getDate(),
63
+ format: new Intl.DateTimeFormat("default", {
64
+ day: "numeric"
65
+ }).format
66
+ },
67
+ hours: {
68
+ getTickNumber: it,
69
+ isTick: (e, t) => t.getHours() !== e.getHours(),
70
+ format: new Intl.DateTimeFormat("default", {
71
+ hour: "2-digit",
72
+ minute: "2-digit"
73
+ }).format
74
+ }
75
+ }, P = {
76
+ start: 0,
77
+ extremities: 0,
78
+ end: 1,
79
+ middle: 0.5
80
+ };
81
+ function M(e, t, n) {
82
+ return e(t) - (e.step() - e.bandwidth()) / 2 + P[n] * e.step();
83
+ }
84
+ function st(e, t, n) {
85
+ const s = Math.abs(t[1] - t[0]), i = Math.ceil(e.length / (s / n));
86
+ return Number.isNaN(i) || i <= 1 ? e : e.filter((o, c) => c % i === 0);
87
+ }
88
+ function ot(e, t, n, s, i) {
89
+ if (n.length === 0)
90
+ return [];
91
+ const o = s.range()[0] > s.range()[1], c = e.findIndex((l) => i(M(s, l, o ? "start" : "end"))), u = e.findLastIndex((l) => i(M(s, l, o ? "end" : "start"))), r = e[0], a = e[e.length - 1];
92
+ if (!(r instanceof Date) || !(a instanceof Date))
93
+ return [];
94
+ let d = 0;
95
+ for (let l = 0; l < n.length; l += 1)
96
+ if (n[l].getTickNumber(r, a) !== 0) {
97
+ d = l;
98
+ break;
99
+ }
100
+ let g = d;
101
+ for (let l = d; l < n.length; l += 1) {
102
+ if (l === n.length - 1) {
103
+ g = l;
104
+ break;
105
+ }
106
+ const b = n[l].getTickNumber(r, a), f = n[l + 1].getTickNumber(r, a);
107
+ if (f > t || t / b < f / t) {
108
+ g = l;
109
+ break;
110
+ }
111
+ }
112
+ const m = [];
113
+ for (let l = Math.max(1, c); l <= u; l += 1)
114
+ for (let b = d; b <= g; b += 1) {
115
+ const f = e[l - 1], k = e[l];
116
+ if (f instanceof Date && k instanceof Date && n[b].isTick(f, k)) {
117
+ m.push({
118
+ index: l,
119
+ formatter: n[b].format
120
+ });
121
+ break;
122
+ }
123
+ }
124
+ return m;
125
+ }
126
+ function at(e) {
127
+ const {
128
+ scale: t,
129
+ tickNumber: n,
130
+ valueFormatter: s,
131
+ tickInterval: i,
132
+ tickPlacement: o,
133
+ tickLabelPlacement: c,
134
+ tickSpacing: u,
135
+ isInside: r,
136
+ ordinalTimeTicks: a
137
+ } = e;
138
+ if (a !== void 0 && J(t.domain()) && E(t)) {
139
+ const f = t.domain();
140
+ if (f.length === 0 || f.length === 1)
141
+ return [];
142
+ const k = "middle";
143
+ return ot(f, n, a.map((p) => typeof p == "string" ? rt[p] : p), t, r).map(({
144
+ index: p,
145
+ formatter: w
146
+ }) => {
147
+ const I = f[p], y = w(I);
148
+ return {
149
+ value: I,
150
+ formattedValue: y,
151
+ offset: M(t, I, k),
152
+ labelOffset: 0
153
+ };
154
+ });
155
+ }
156
+ const d = o ?? "extremities";
157
+ if (E(t)) {
158
+ const f = t.domain(), k = c ?? "middle";
159
+ let h = f;
160
+ if (typeof i == "object" && i != null ? h = i : (typeof i == "function" && (h = h.filter(i)), u !== void 0 && u > 0 && (h = st(h, t.range(), u))), h.length === 0)
161
+ return [];
162
+ if (t.bandwidth() > 0) {
163
+ const p = t.range()[0] > t.range()[1], w = h.findIndex((y) => r(M(t, y, p ? "start" : "end"))), I = h.findLastIndex((y) => r(M(t, y, p ? "end" : "start")));
164
+ return [...h.slice(w, I + 1).map((y) => {
165
+ const v = `${y}`;
166
+ return {
167
+ value: y,
168
+ formattedValue: s?.(y, {
169
+ location: "tick",
170
+ scale: t,
171
+ tickNumber: n,
172
+ defaultTickLabel: v
173
+ }) ?? v,
174
+ offset: M(t, y, d),
175
+ labelOffset: k === "tick" ? 0 : t.step() * (P[k] - P[d])
176
+ };
177
+ }), ...d === "extremities" && I === f.length - 1 && r(t.range()[1]) ? [{
178
+ formattedValue: void 0,
179
+ offset: t.range()[1],
180
+ labelOffset: 0
181
+ }] : []];
182
+ }
183
+ return h.map((p) => {
184
+ const w = `${p}`;
185
+ return {
186
+ value: p,
187
+ formattedValue: s?.(p, {
188
+ location: "tick",
189
+ scale: t,
190
+ tickNumber: n,
191
+ defaultTickLabel: w
192
+ }) ?? w,
193
+ offset: t(p),
194
+ labelOffset: 0
195
+ };
196
+ });
197
+ }
198
+ if (t.domain().some(et))
199
+ return [];
200
+ const m = c, l = typeof i == "object" ? i : ct(t, n), b = [];
201
+ for (let f = 0; f < l.length; f += 1) {
202
+ const k = l[f], h = t(k);
203
+ if (r(h)) {
204
+ const p = t.tickFormat(n)(k);
205
+ b.push({
206
+ value: k,
207
+ formattedValue: s?.(k, {
208
+ location: "tick",
209
+ scale: t,
210
+ tickNumber: n,
211
+ defaultTickLabel: p
212
+ }) ?? p,
213
+ offset: h,
214
+ // Allowing the label to be placed in the middle of a continuous scale is weird.
215
+ // But it is useful in some cases, like funnel categories with a linear scale.
216
+ labelOffset: m === "middle" ? t(l[f - 1] ?? 0) - (h + t(l[f - 1] ?? 0)) / 2 : 0
217
+ });
218
+ }
219
+ }
220
+ return b;
221
+ }
222
+ function ct(e, t) {
223
+ const n = e.domain();
224
+ return n[0] === n[1] ? [n[0]] : e.ticks(t);
225
+ }
226
+ function St(e) {
227
+ const {
228
+ scale: t,
229
+ tickNumber: n,
230
+ valueFormatter: s,
231
+ tickInterval: i,
232
+ tickPlacement: o = "extremities",
233
+ tickLabelPlacement: c,
234
+ tickSpacing: u,
235
+ direction: r,
236
+ ordinalTimeTicks: a
237
+ } = e, {
238
+ instance: d
239
+ } = Z(), g = r === "x" ? d.isXInside : d.isYInside;
240
+ return D.useMemo(() => at({
241
+ scale: t,
242
+ tickNumber: n,
243
+ tickPlacement: o,
244
+ tickInterval: i,
245
+ tickLabelPlacement: c,
246
+ tickSpacing: u,
247
+ valueFormatter: s,
248
+ isInside: g,
249
+ ordinalTimeTicks: a
250
+ }), [t, n, o, i, c, u, s, g, a]);
251
+ }
252
+ const H = typeof window < "u" && "Intl" in window && "Segmenter" in Intl ? new Intl.Segmenter(void 0, {
253
+ granularity: "grapheme"
254
+ }) : null;
255
+ function lt(e) {
256
+ return e.length;
257
+ }
258
+ function ut(e) {
259
+ const t = H.segment(e);
260
+ let n = 0;
261
+ for (const s of t)
262
+ n += 1;
263
+ return n;
264
+ }
265
+ const dt = H ? ut : lt;
266
+ function ft(e) {
267
+ return e * (Math.PI / 180);
268
+ }
269
+ const Y = typeof window < "u" && "Intl" in window && "Segmenter" in Intl ? new Intl.Segmenter(void 0, {
270
+ granularity: "grapheme"
271
+ }) : null;
272
+ function gt(e, t) {
273
+ return e.slice(0, t);
274
+ }
275
+ function mt(e, t) {
276
+ const n = Y.segment(e);
277
+ let s = "", i = 0;
278
+ for (const o of n)
279
+ if (s += o.segment, i += 1, i >= t)
280
+ break;
281
+ return s;
282
+ }
283
+ const ht = Y ? mt : gt, F = "…";
284
+ function Nt(e, t) {
285
+ const {
286
+ width: n,
287
+ height: s,
288
+ measureText: i
289
+ } = t, o = ft(t.angle), c = i(e), u = Math.abs(c.width * Math.cos(o)) + Math.abs(c.height * Math.sin(o)), r = Math.abs(c.width * Math.sin(o)) + Math.abs(c.height * Math.cos(o));
290
+ return u <= n && r <= s;
291
+ }
292
+ function Dt(e, t) {
293
+ if (t(e))
294
+ return e;
295
+ let n = e, s = 1, i = 1 / 2;
296
+ const o = dt(e);
297
+ let c = o, u = o, r = null;
298
+ do {
299
+ if (u = c, c = Math.floor(o * i), c === 0)
300
+ break;
301
+ n = ht(e, c).trim();
302
+ const a = t(n + F);
303
+ s += 1, a ? (r = n, i += 1 / 2 ** s) : i -= 1 / 2 ** s;
304
+ } while (Math.abs(c - u) !== 1);
305
+ return r ? r + F : "";
306
+ }
307
+ function z() {
308
+ return typeof window > "u";
309
+ }
310
+ const T = /* @__PURE__ */ new Map(), U = 2e3, pt = /* @__PURE__ */ new Set(["minWidth", "maxWidth", "width", "minHeight", "maxHeight", "height", "top", "left", "fontSize", "padding", "margin", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom"]);
311
+ function A(e, t) {
312
+ return pt.has(e) && t === +t ? `${t}px` : t;
313
+ }
314
+ const bt = /([A-Z])/g;
315
+ function O(e) {
316
+ return String(e).replace(bt, (t) => `-${t.toLowerCase()}`);
317
+ }
318
+ function G(e) {
319
+ let t = "";
320
+ for (const n in e)
321
+ if (Object.hasOwn(e, n)) {
322
+ const s = n, i = e[s];
323
+ if (i === void 0)
324
+ continue;
325
+ t += `${O(s)}:${A(s, i)};`;
326
+ }
327
+ return t;
328
+ }
329
+ const kt = (e, t = {}) => {
330
+ if (e == null || z())
331
+ return {
332
+ width: 0,
333
+ height: 0
334
+ };
335
+ const n = String(e), s = G(t), i = `${n}-${s}`, o = T.get(i);
336
+ if (o)
337
+ return o;
338
+ try {
339
+ const c = X(), u = document.createElementNS("http://www.w3.org/2000/svg", "text");
340
+ Object.keys(t).map((a) => (u.style[O(a)] = A(a, t[a]), a)), u.textContent = n, c.replaceChildren(u);
341
+ const r = W(u);
342
+ return T.set(i, r), T.size + 1 > U && T.clear(), process.env.NODE_ENV === "test" && c.replaceChildren(), r;
343
+ } catch {
344
+ return {
345
+ width: 0,
346
+ height: 0
347
+ };
348
+ }
349
+ };
350
+ function Lt(e, t = {}) {
351
+ if (z())
352
+ return new Map(Array.from(e).map((r) => [r, {
353
+ width: 0,
354
+ height: 0
355
+ }]));
356
+ const n = /* @__PURE__ */ new Map(), s = [], i = G(t);
357
+ for (const r of e) {
358
+ const a = `${r}-${i}`, d = T.get(a);
359
+ d ? n.set(r, d) : s.push(r);
360
+ }
361
+ const o = X(), c = $({}, t);
362
+ Object.keys(c).map((r) => (o.style[O(r)] = A(r, c[r]), r));
363
+ const u = [];
364
+ for (const r of s) {
365
+ const a = document.createElementNS("http://www.w3.org/2000/svg", "text");
366
+ a.textContent = `${r}`, u.push(a);
367
+ }
368
+ o.replaceChildren(...u);
369
+ for (let r = 0; r < s.length; r += 1) {
370
+ const a = s[r], d = o.children[r], g = W(d), m = `${a}-${i}`;
371
+ T.set(m, g), n.set(a, g);
372
+ }
373
+ return T.size + 1 > U && T.clear(), process.env.NODE_ENV === "test" && o.replaceChildren(), n;
374
+ }
375
+ function W(e) {
376
+ try {
377
+ const t = e.getBBox();
378
+ return {
379
+ width: t.width,
380
+ height: t.height
381
+ };
382
+ } catch {
383
+ const t = e.getBoundingClientRect();
384
+ return {
385
+ width: t.width,
386
+ height: t.height
387
+ };
388
+ }
389
+ }
390
+ let x = null;
391
+ function X() {
392
+ return x === null && (x = document.createElementNS("http://www.w3.org/2000/svg", "svg"), x.setAttribute("aria-hidden", "true"), x.style.position = "absolute", x.style.top = "-20000px", x.style.left = "0", x.style.padding = "0", x.style.margin = "0", x.style.border = "none", x.style.pointerEvents = "none", x.style.visibility = "hidden", x.style.contain = "strict", document.body.appendChild(x)), x;
393
+ }
394
+ function $t(e) {
395
+ return Q("MuiChartsAxis", e);
396
+ }
397
+ const L = q("MuiChartsAxis", ["root", "line", "tickContainer", "tick", "tickLabel", "label", "directionX", "directionY", "top", "bottom", "left", "right", "id"]);
398
+ function xt({
399
+ style: e,
400
+ needsComputation: t,
401
+ text: n
402
+ }) {
403
+ return n.split(`
404
+ `).map((s) => $({
405
+ text: s
406
+ }, t ? kt(s, e) : {
407
+ width: 0,
408
+ height: 0
409
+ }));
410
+ }
411
+ const yt = ["x", "y", "style", "text", "ownerState"], Tt = ["angle", "textAnchor", "dominantBaseline"];
412
+ function wt(e) {
413
+ const {
414
+ x: t,
415
+ y: n,
416
+ style: s,
417
+ text: i
418
+ } = e, o = R(e, yt), c = s ?? {}, {
419
+ angle: u,
420
+ textAnchor: r,
421
+ dominantBaseline: a
422
+ } = c, d = R(c, Tt), g = tt(), m = D.useMemo(() => xt({
423
+ style: d,
424
+ needsComputation: g && i.includes(`
425
+ `),
426
+ text: i
427
+ }), [d, i, g]);
428
+ let l;
429
+ switch (a) {
430
+ case "hanging":
431
+ case "text-before-edge":
432
+ l = 0;
433
+ break;
434
+ case "central":
435
+ l = (m.length - 1) / 2 * -m[0].height;
436
+ break;
437
+ default:
438
+ l = (m.length - 1) * -m[0].height;
439
+ break;
440
+ }
441
+ return /* @__PURE__ */ V.jsx("text", $({}, o, {
442
+ transform: u ? `rotate(${u}, ${t}, ${n})` : void 0,
443
+ x: t,
444
+ y: n,
445
+ textAnchor: r,
446
+ dominantBaseline: a,
447
+ style: d,
448
+ children: m.map((b, f) => /* @__PURE__ */ V.jsx("tspan", {
449
+ x: t,
450
+ dy: `${f === 0 ? l : m[0].height}px`,
451
+ dominantBaseline: a,
452
+ children: b.text
453
+ }, f))
454
+ }));
455
+ }
456
+ process.env.NODE_ENV !== "production" && (wt.propTypes = {
457
+ // ----------------------------- Warning --------------------------------
458
+ // | These PropTypes are generated from the TypeScript type definitions |
459
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
460
+ // ----------------------------------------------------------------------
461
+ /**
462
+ * Height of a text line (in `em`).
463
+ */
464
+ lineHeight: C.number,
465
+ /**
466
+ * If `true`, the line width is computed.
467
+ * @default false
468
+ */
469
+ needsComputation: C.bool,
470
+ ownerState: C.any,
471
+ /**
472
+ * Style applied to text elements.
473
+ */
474
+ style: C.object,
475
+ /**
476
+ * Text displayed.
477
+ */
478
+ text: C.string.isRequired
479
+ });
480
+ function Et(e) {
481
+ const t = B(e);
482
+ return t <= 30 || t >= 330 || t <= 210 && t >= 150 ? "middle" : t <= 180 ? "end" : "start";
483
+ }
484
+ function Pt(e) {
485
+ const t = B(e);
486
+ return t <= 30 || t >= 330 ? "hanging" : t <= 210 && t >= 150 ? "auto" : "central";
487
+ }
488
+ function At(e) {
489
+ switch (e) {
490
+ case "start":
491
+ return "end";
492
+ case "end":
493
+ return "start";
494
+ default:
495
+ return e;
496
+ }
497
+ }
498
+ const N = {
499
+ start: 0,
500
+ extremities: 0,
501
+ end: 1,
502
+ middle: 0.5,
503
+ tick: 0
504
+ };
505
+ function Ot(e) {
506
+ const {
507
+ scale: t,
508
+ tickInterval: n,
509
+ tickLabelPlacement: s = "middle",
510
+ tickPlacement: i = "extremities",
511
+ groups: o
512
+ } = e;
513
+ return D.useMemo(() => {
514
+ const c = t.domain(), u = typeof n == "function" && c.filter(n) || typeof n == "object" && n || c;
515
+ if (t.bandwidth() > 0) {
516
+ const r = _(u, o, i, s, t);
517
+ return r[0] && (r[0].ignoreTick = !0), [
518
+ {
519
+ formattedValue: void 0,
520
+ offset: t.range()[0],
521
+ labelOffset: 0,
522
+ groupIndex: o.length - 1
523
+ },
524
+ ...r,
525
+ // Last tick
526
+ {
527
+ formattedValue: void 0,
528
+ offset: t.range()[1],
529
+ labelOffset: 0,
530
+ groupIndex: o.length - 1
531
+ }
532
+ ];
533
+ }
534
+ return _(u, o, i, s, t);
535
+ }, [t, n, o, i, s]);
536
+ }
537
+ function _(e, t, n, s, i) {
538
+ const o = [], c = /* @__PURE__ */ new Map();
539
+ let u = 0;
540
+ for (let r = 0; r < t.length; r += 1)
541
+ for (let a = 0; a < e.length; a += 1) {
542
+ const d = e[a], g = t[r].getValue(d, a), m = o[o.length - 1];
543
+ if (m?.value !== g || m?.groupIndex !== r) {
544
+ u = 1;
545
+ const b = E(i) ? i(d) - (i.step() - i.bandwidth()) / 2 + N[n] * i.step() : i(d), f = i.step() * u * (N[s] - N[n]);
546
+ o.push({
547
+ value: g,
548
+ formattedValue: `${g}`,
549
+ offset: b,
550
+ groupIndex: r,
551
+ dataIndex: a,
552
+ ignoreTick: !1,
553
+ labelOffset: f
554
+ }), c.has(a) || c.set(a, /* @__PURE__ */ new Set());
555
+ const k = c.get(a);
556
+ for (const h of k.values())
557
+ o[h].ignoreTick = !0;
558
+ k.add(o.length - 1);
559
+ } else {
560
+ u += 1;
561
+ const b = i.step() * u * (N[s] - N[n]);
562
+ m.labelOffset = b;
563
+ }
564
+ }
565
+ return o;
566
+ }
567
+ const vt = K("g", {
568
+ name: "MuiChartsAxis",
569
+ slot: "Root"
570
+ })(({
571
+ theme: e
572
+ }) => ({
573
+ [`& .${L.tickLabel}`]: $({}, e.typography.caption, {
574
+ fill: (e.vars || e).palette.text.primary
575
+ }),
576
+ [`& .${L.label}`]: {
577
+ fill: (e.vars || e).palette.text.primary
578
+ },
579
+ [`& .${L.line}`]: {
580
+ stroke: (e.vars || e).palette.text.primary,
581
+ shapeRendering: "crispEdges",
582
+ strokeWidth: 1
583
+ },
584
+ [`& .${L.tick}`]: {
585
+ stroke: (e.vars || e).palette.text.primary,
586
+ shapeRendering: "crispEdges"
587
+ }
588
+ }));
589
+ export {
590
+ vt as A,
591
+ wt as C,
592
+ L as a,
593
+ kt as b,
594
+ Et as c,
595
+ Nt as d,
596
+ Dt as e,
597
+ Pt as f,
598
+ $t as g,
599
+ St as h,
600
+ At as i,
601
+ Ot as j,
602
+ et as k,
603
+ Lt as l,
604
+ tt as u
605
+ };
@@ -0,0 +1,47 @@
1
+ import * as u from "react";
2
+ import { j as o, P as i } from "./index-BhaKvHkU.mjs";
3
+ import { C as x } from "./ChartsXAxis-CPmuCRhq.mjs";
4
+ import { C as a } from "./ChartsYAxis-DLUMr9vG.mjs";
5
+ import { u as c, a as A } from "./useAxis-SiNBMMWq.mjs";
6
+ function f(e) {
7
+ const {
8
+ slots: t,
9
+ slotProps: r
10
+ } = e, {
11
+ xAxisIds: m,
12
+ xAxis: n
13
+ } = c(), {
14
+ yAxisIds: l,
15
+ yAxis: p
16
+ } = A();
17
+ return /* @__PURE__ */ o.jsxs(u.Fragment, {
18
+ children: [m.map((s) => !n[s].position || n[s].position === "none" ? null : /* @__PURE__ */ o.jsx(x, {
19
+ slots: t,
20
+ slotProps: r,
21
+ axisId: s
22
+ }, s)), l.map((s) => !p[s].position || p[s].position === "none" ? null : /* @__PURE__ */ o.jsx(a, {
23
+ slots: t,
24
+ slotProps: r,
25
+ axisId: s
26
+ }, s))]
27
+ });
28
+ }
29
+ process.env.NODE_ENV !== "production" && (f.propTypes = {
30
+ // ----------------------------- Warning --------------------------------
31
+ // | These PropTypes are generated from the TypeScript type definitions |
32
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
33
+ // ----------------------------------------------------------------------
34
+ /**
35
+ * The props used for each component slot.
36
+ * @default {}
37
+ */
38
+ slotProps: i.object,
39
+ /**
40
+ * Overridable component slots.
41
+ * @default {}
42
+ */
43
+ slots: i.object
44
+ });
45
+ export {
46
+ f as C
47
+ };
@@ -0,0 +1 @@
1
+ "use strict";const x=require("react"),r=require("./index--8Zky9Oh.js"),a=require("./ChartsXAxis-DFFY1sPg.js"),A=require("./ChartsYAxis-fpevi1sP.js"),c=require("./useAxis-DSbfEtO7.js");function f(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const j=f(x);function p(t){const{slots:o,slotProps:e}=t,{xAxisIds:n,xAxis:i}=c.useXAxes(),{yAxisIds:l,yAxis:u}=c.useYAxes();return r.jsxRuntimeExports.jsxs(j.Fragment,{children:[n.map(s=>!i[s].position||i[s].position==="none"?null:r.jsxRuntimeExports.jsx(a.ChartsXAxis,{slots:o,slotProps:e,axisId:s},s)),l.map(s=>!u[s].position||u[s].position==="none"?null:r.jsxRuntimeExports.jsx(A.ChartsYAxis,{slots:o,slotProps:e,axisId:s},s))]})}process.env.NODE_ENV!=="production"&&(p.propTypes={slotProps:r.PropTypes.object,slots:r.PropTypes.object});exports.ChartsAxis=p;
@@ -0,0 +1,3 @@
1
+ "use strict";const a=require("./useAxis-DSbfEtO7.js"),N=require("react"),i=require("./index--8Zky9Oh.js"),d=require("./useChartContainerProps-C_C_PZoi.js"),f=require("./createSelector-f0oqn8Lr.js"),I=require("./AxisSharedComponents-BbsKw1BT.js");function L(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return s.default=t,Object.freeze(s)}const y=L(N);function b(t,s,e){if(t==="pointer"){if(s)return[s];if(e)return[e]}if(t==="keyboard"){if(e)return[e];if(s)return[s]}return[]}const C=t=>t.controlledCartesianAxisHighlight,E=(t,s,e,r,c,x)=>{if(x)return[];if(e!==void 0)return e.filter(h=>s.axis[h.axisId]!==void 0).map(h=>h);const u=t!==null&&{axisId:s.axisIds[0],dataIndex:t},l=r!=null&&r;return b(c,u,l)},M=f.createSelectorMemoized(d.selectorChartsInteractionXAxisIndex,a.selectorChartXAxis,C,d.selectorChartsKeyboardXAxisIndex,d.selectorChartsLastInteraction,d.selectorBrushShouldPreventAxisHighlight,E);f.createSelectorMemoized(d.selectorChartsInteractionYAxisIndex,a.selectorChartYAxis,C,d.selectorChartsKeyboardYAxisIndex,d.selectorChartsLastInteraction,d.selectorBrushShouldPreventAxisHighlight,E);const S=(t,s,e,r,c,x,u)=>{if(u)return[];if(r!==void 0)return r.map(p=>i._extends({},p,{value:e.axis[p.axisId]?.data?.[p.dataIndex]})).filter(({value:p})=>p!==void 0);const l=s!=null&&{axisId:e.axisIds[0],value:s};l&&t!=null&&(l.dataIndex=t);const h=c!=null&&e.axis[c.axisId]?.data?.[c.dataIndex],o=c!=null&&h!=null&&i._extends({},c,{value:h});return b(x,l,o)},X=f.createSelectorMemoized(d.selectorChartsInteractionXAxisIndex,d.selectorChartsInteractionXAxisValue,a.selectorChartXAxis,C,d.selectorChartsKeyboardXAxisIndex,d.selectorChartsLastInteraction,d.selectorBrushShouldPreventAxisHighlight,S),k=f.createSelectorMemoized(d.selectorChartsInteractionYAxisIndex,d.selectorChartsInteractionYAxisValue,a.selectorChartYAxis,C,d.selectorChartsKeyboardYAxisIndex,d.selectorChartsLastInteraction,d.selectorBrushShouldPreventAxisHighlight,S),H=(t,s)=>t===void 0?[s.axis[s.axisIds[0]]]:t.map(r=>s.axis[r.axisId]??null).filter(r=>r!==null);f.createSelector(C,a.selectorChartXAxis,H);f.createSelector(C,a.selectorChartYAxis,H);function j(t){if(a.isOrdinalScale(t))return e=>(t(e)??0)+t.bandwidth()/2;const s=t.domain();return s[0]===s[1]?e=>e===s[0]?t(e):NaN:e=>t(e)}function O(){return a.useStore().use(a.selectorChartZoomIsInteracting)}function z(t){return i.generateUtilityClass("MuiChartsAxisHighlight",t)}i.generateUtilityClasses("MuiChartsAxisHighlight",["root"]);const A=i.styled("path",{name:"MuiChartsAxisHighlight",slot:"Root"})(({theme:t})=>({pointerEvents:"none",variants:[{props:{axisHighlight:"band"},style:i._extends({fill:"white",fillOpacity:.1},t.applyStyles("light",{fill:"gray"}))},{props:{axisHighlight:"line"},style:i._extends({strokeDasharray:"5 2",stroke:"#ffffff"},t.applyStyles("light",{stroke:"#000000"}))}]}));function Y(t){const{type:s,classes:e}=t,{left:r,width:c}=a.useDrawingArea(),x=a.useStore(),u=x.use(k),l=x.use(a.selectorChartYAxis);return u.length===0?null:u.map(({axisId:h,value:o})=>{const n=l.axis[h].scale,g=j(n),m=s==="band"&&o!==null&&a.isOrdinalScale(n);return process.env.NODE_ENV!=="production"&&m&&n(o)===void 0&&console.error(["MUI X Charts: The position value provided for the axis is not valid for the current scale.","This probably means something is wrong with the data passed to the chart.","The ChartsAxisHighlight component will not be displayed."].join(`
2
+ `)),i.jsxRuntimeExports.jsxs(y.Fragment,{children:[m&&n(o)!==void 0&&i.jsxRuntimeExports.jsx(A,{d:`M ${r} ${n(o)-(n.step()-n.bandwidth())/2} l 0 ${n.step()} l ${c} 0 l 0 ${-n.step()} Z`,className:e.root,ownerState:{axisHighlight:"band"}}),s==="line"&&o!==null&&i.jsxRuntimeExports.jsx(A,{d:`M ${r} ${g(o)} L ${r+c} ${g(o)}`,className:e.root,ownerState:{axisHighlight:"line"}})]},`${h}-${o}`)})}function _(t){const{type:s,classes:e}=t,{top:r,height:c}=a.useDrawingArea(),x=a.useStore(),u=x.use(X),l=x.use(a.selectorChartXAxis);return u.length===0?null:u.map(({axisId:h,value:o})=>{const n=l.axis[h].scale,g=j(n),m=s==="band"&&o!==null&&a.isOrdinalScale(n);return process.env.NODE_ENV!=="production"&&m&&n(o)===void 0&&console.error(["MUI X Charts: The position value provided for the axis is not valid for the current scale.","This probably means something is wrong with the data passed to the chart.","The ChartsAxisHighlight component will not be displayed."].join(`
3
+ `)),i.jsxRuntimeExports.jsxs(y.Fragment,{children:[m&&n(o)!==void 0&&i.jsxRuntimeExports.jsx(A,{d:`M ${n(o)-(n.step()-n.bandwidth())/2} ${r} l ${n.step()} 0 l 0 ${c} l ${-n.step()} 0 Z`,className:e.root,ownerState:{axisHighlight:"band"}}),s==="line"&&o!==null&&i.jsxRuntimeExports.jsx(A,{d:`M ${g(o)} ${r} L ${g(o)} ${r+c}`,className:e.root,ownerState:{axisHighlight:"line"}})]},`${h}-${o}`)})}const V=()=>{const t={root:["root"]};return i.composeClasses(t,z)};function P(t){const{x:s,y:e}=t,r=V();return i.jsxRuntimeExports.jsxs(y.Fragment,{children:[s&&s!=="none"&&i.jsxRuntimeExports.jsx(_,{type:s,classes:r}),e&&e!=="none"&&i.jsxRuntimeExports.jsx(Y,{type:e,classes:r})]})}process.env.NODE_ENV!=="production"&&(P.propTypes={x:i.PropTypes.oneOf(["band","line","none"]),y:i.PropTypes.oneOf(["band","line","none"])});function $(t){const{id:s,offset:e}=t,{left:r,top:c,width:x,height:u}=a.useDrawingArea(),l=i._extends({top:0,right:0,bottom:0,left:0},e);return i.jsxRuntimeExports.jsx("clipPath",{id:s,children:i.jsxRuntimeExports.jsx("rect",{x:r-l.left,y:c-l.top,width:x+l.left+l.right,height:u+l.top+l.bottom})})}process.env.NODE_ENV!=="production"&&($.propTypes={id:i.PropTypes.string.isRequired,offset:i.PropTypes.shape({bottom:i.PropTypes.number,left:i.PropTypes.number,right:i.PropTypes.number,top:i.PropTypes.number})});function G(t){return i.generateUtilityClass("MuiChartsGrid",t)}const T=i.generateUtilityClasses("MuiChartsGrid",["root","line","horizontalLine","verticalLine"]),D=i.styled("g",{name:"MuiChartsGrid",slot:"Root",overridesResolver:(t,s)=>[{[`&.${T.verticalLine}`]:s.verticalLine},{[`&.${T.horizontalLine}`]:s.horizontalLine},s.root]})({}),R=i.styled("line",{name:"MuiChartsGrid",slot:"Line"})(({theme:t})=>({stroke:(t.vars||t).palette.divider,shapeRendering:"crispEdges",strokeWidth:1}));function U(t){const{instance:s}=a.useChartContext(),{axis:e,start:r,end:c,classes:x}=t,{scale:u,tickNumber:l,tickInterval:h,tickSpacing:o}=e,p=I.useTicks({scale:u,tickNumber:l,tickInterval:h,tickSpacing:o,direction:"x",ordinalTimeTicks:"ordinalTimeTicks"in e?e.ordinalTimeTicks:void 0});return i.jsxRuntimeExports.jsx(y.Fragment,{children:p.map(({value:n,offset:g})=>s.isXInside(g)?i.jsxRuntimeExports.jsx(R,{y1:r,y2:c,x1:g,x2:g,className:x.verticalLine},`vertical-${n?.getTime?.()??n}`):null)})}function q(t){const{instance:s}=a.useChartContext(),{axis:e,start:r,end:c,classes:x}=t,{scale:u,tickNumber:l,tickInterval:h,tickSpacing:o}=e,p=I.useTicks({scale:u,tickNumber:l,tickInterval:h,tickSpacing:o,direction:"y",ordinalTimeTicks:"ordinalTimeTicks"in e?e.ordinalTimeTicks:void 0});return i.jsxRuntimeExports.jsx(y.Fragment,{children:p.map(({value:n,offset:g})=>s.isYInside(g)?i.jsxRuntimeExports.jsx(R,{y1:g,y2:g,x1:r,x2:c,className:x.horizontalLine},`horizontal-${n?.getTime?.()??n}`):null)})}const F=["vertical","horizontal"],Z=({classes:t})=>{const s={root:["root"],verticalLine:["line","verticalLine"],horizontalLine:["line","horizontalLine"]};return i.composeClasses(s,G,t)};function v(t){const s=i.useThemeProps({props:t,name:"MuiChartsGrid"}),e=a.useDrawingArea(),{vertical:r,horizontal:c}=s,x=i._objectWithoutPropertiesLoose(s,F),{xAxis:u,xAxisIds:l}=a.useXAxes(),{yAxis:h,yAxisIds:o}=a.useYAxes(),p=Z(s),n=h[o[0]],g=u[l[0]];return i.jsxRuntimeExports.jsxs(D,i._extends({},x,{className:p.root,children:[r&&i.jsxRuntimeExports.jsx(U,{axis:g,start:e.top,end:e.height+e.top,classes:p}),c&&i.jsxRuntimeExports.jsx(q,{axis:n,start:e.left,end:e.width+e.left,classes:p})]}))}process.env.NODE_ENV!=="production"&&(v.propTypes={classes:i.PropTypes.object,horizontal:i.PropTypes.bool,vertical:i.PropTypes.bool});exports.ChartsAxisHighlight=P;exports.ChartsClipPath=$;exports.ChartsGrid=v;exports.getValueToPositionMapper=j;exports.selectorChartsHighlightXAxisIndex=M;exports.useInternalIsZoomInteracting=O;