dynamic-mui 2.2.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +142 -5
  2. package/dist/accordion-Bf0VwGuE.js +1 -0
  3. package/dist/accordion-DEd2a2Ps.mjs +23 -0
  4. package/dist/addressfield-Dfd9ilpe.js +1 -0
  5. package/dist/addressfield-FjNJCCuC.mjs +152 -0
  6. package/dist/asyncautocomplete-9O6nwGP_.js +1 -0
  7. package/dist/asyncautocomplete-B8qI_lz9.mjs +89 -0
  8. package/dist/bar-BzO7tvYJ.mjs +20 -0
  9. package/dist/bar-DEVxyUVS.js +1 -0
  10. package/dist/cascadeselect-D8sVXV1g.mjs +64 -0
  11. package/dist/cascadeselect-DeoPn4_V.js +1 -0
  12. package/dist/colorpicker-BcnqB34i.js +1 -0
  13. package/dist/colorpicker-DcyceL6g.mjs +98 -0
  14. package/dist/components/DynamicComponent.d.ts +2 -0
  15. package/dist/components/FormGenerator.d.ts +99 -10
  16. package/dist/components/controls/index.d.ts +45 -79
  17. package/dist/consentfield-B_qBOIuX.mjs +78 -0
  18. package/dist/consentfield-CR69IP1l.js +1 -0
  19. package/dist/datatable-BIQznwQe.mjs +20 -0
  20. package/dist/datatable-BWlcUP0M.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -0
  22. package/dist/dynamic-mui.mjs +32 -0
  23. package/dist/editabletable-BdywdA42.js +1 -0
  24. package/dist/editabletable-D6_U9op8.mjs +126 -0
  25. package/dist/fileupload-CugTpR-B.mjs +172 -0
  26. package/dist/fileupload-YzpAUgok.js +1 -0
  27. package/dist/formrepeater-B_2UOIBm.js +1 -0
  28. package/dist/formrepeater-Cxawn2sQ.mjs +71 -0
  29. package/dist/formwizard-CCBY6s19.js +1 -0
  30. package/dist/formwizard-Cfd5IPkE.mjs +83 -0
  31. package/dist/geofield-CJm8hivf.js +1 -0
  32. package/dist/geofield-k2V0hglK.mjs +104 -0
  33. package/dist/group-D40b3E1V.mjs +23 -0
  34. package/dist/group-IFZTzo-g.js +1 -0
  35. package/dist/imagelist-Bn9QhIv7.js +1 -0
  36. package/dist/imagelist-rqmJajHt.mjs +18 -0
  37. package/dist/index-Bh6BLrzq.mjs +12226 -0
  38. package/dist/index-eJceCjKS.js +43 -0
  39. package/dist/index.d.ts +9 -1
  40. package/dist/intlphone-BbTprmmA.mjs +140 -0
  41. package/dist/intlphone-CmiRFHv-.js +1 -0
  42. package/dist/keyvaluefield-CoOmou7m.js +1 -0
  43. package/dist/keyvaluefield-zD6Kf4D0.mjs +125 -0
  44. package/dist/line-B-DwR1hm.mjs +20 -0
  45. package/dist/line-BkymZu31.js +1 -0
  46. package/dist/lineitemlist-BRsW0O7Z.js +1 -0
  47. package/dist/lineitemlist-BZbAId8H.mjs +166 -0
  48. package/dist/list-BhTzYFrR.mjs +20 -0
  49. package/dist/list-DWf2NWix.js +1 -0
  50. package/dist/locationfield-BZpGC10B.mjs +119 -0
  51. package/dist/locationfield-DC_2IN-B.js +1 -0
  52. package/dist/markdowneditor-B5F4okCW.mjs +90 -0
  53. package/dist/markdowneditor-Coi3sksx.js +2 -0
  54. package/dist/matrixfield-CUo7zFWC.mjs +117 -0
  55. package/dist/matrixfield-DAjfXU96.js +1 -0
  56. package/dist/mixChart-C3o184UT.js +1 -0
  57. package/dist/mixChart-ISf3Kbr-.mjs +75 -0
  58. package/dist/multitextbox-Cq7vt1-g.js +1 -0
  59. package/dist/multitextbox-CsNOrHZP.mjs +78 -0
  60. package/dist/npsscale-BWpMrK_O.js +1 -0
  61. package/dist/npsscale-Cb8NxADb.mjs +87 -0
  62. package/dist/numberstepper-BqQeBbR9.js +1 -0
  63. package/dist/numberstepper-DLk_r1HM.mjs +128 -0
  64. package/dist/pie-CJSL8Sv5.js +1 -0
  65. package/dist/pie-CL29dlh5.mjs +20 -0
  66. package/dist/richtexteditor-BUrvVR_T.js +1 -0
  67. package/dist/richtexteditor-pQIK2f-6.mjs +141 -0
  68. package/dist/s3Upload-B0JeoLkS.js +1 -0
  69. package/dist/s3Upload-dpioZ2c8.mjs +51 -0
  70. package/dist/signature-CFv0jhVN.mjs +1225 -0
  71. package/dist/signature-G-XCOszC.js +2 -0
  72. package/dist/stepper-Bc9NlbU7.js +1 -0
  73. package/dist/stepper-U0kv127E.mjs +140 -0
  74. package/dist/summaryfield-B_bePxLk.js +1 -0
  75. package/dist/summaryfield-QcpYr9Xt.mjs +96 -0
  76. package/dist/tabs-Cs9eNEbR.js +1 -0
  77. package/dist/tabs-DCLyTKVm.mjs +39 -0
  78. package/dist/tagsinput-D1VP8Bjq.mjs +58 -0
  79. package/dist/tagsinput-DlopThdw.js +1 -0
  80. package/dist/util/dayjsSetup.d.ts +2 -0
  81. package/dist/util/registry.d.ts +29 -0
  82. package/dist/util/resolvers.d.ts +45 -0
  83. package/dist/util/useFormEngine.d.ts +74 -0
  84. package/dist/util/validateSchema.d.ts +23 -0
  85. package/dist/v4-BysszJq8.mjs +30 -0
  86. package/dist/v4-CqdK_b8Y.js +1 -0
  87. package/package.json +38 -12
  88. package/dist/AxisSharedComponents-BbsKw1BT.js +0 -3
  89. package/dist/AxisSharedComponents-xLtpOLH_.mjs +0 -605
  90. package/dist/ChartsAxis-CANvBdY9.mjs +0 -47
  91. package/dist/ChartsAxis-EZ7m_KrU.js +0 -1
  92. package/dist/ChartsGrid-BCRTvNTr.js +0 -3
  93. package/dist/ChartsGrid-C_HT7qpL.mjs +0 -381
  94. package/dist/ChartsWrapper-CM7EDyAK.js +0 -5
  95. package/dist/ChartsWrapper-CO5_Z6BD.mjs +0 -1878
  96. package/dist/ChartsXAxis-CPmuCRhq.mjs +0 -487
  97. package/dist/ChartsXAxis-DFFY1sPg.js +0 -3
  98. package/dist/ChartsYAxis-DLUMr9vG.mjs +0 -392
  99. package/dist/ChartsYAxis-fpevi1sP.js +0 -1
  100. package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +0 -237
  101. package/dist/XmlShapeDeserializer-XKJAoqLc.js +0 -1
  102. package/dist/clampAngle-BvZjnf53.mjs +0 -11
  103. package/dist/clampAngle-DpAsDoeT.js +0 -1
  104. package/dist/createSelector-B-9FwV16.mjs +0 -430
  105. package/dist/createSelector-f0oqn8Lr.js +0 -7
  106. package/dist/date-utils-CFUUt6NL.js +0 -4
  107. package/dist/date-utils-pGzaKb0p.mjs +0 -477
  108. package/dist/dynamic-mui.cjs.js +0 -1
  109. package/dist/dynamic-mui.es.js +0 -22
  110. package/dist/index--8Zky9Oh.js +0 -299
  111. package/dist/index-6WTs1Xy_.js +0 -1
  112. package/dist/index-B1R1akM2.js +0 -1
  113. package/dist/index-BW8_rRff.js +0 -7
  114. package/dist/index-BXFVK_GX.js +0 -1
  115. package/dist/index-B_KNUTjy.js +0 -1
  116. package/dist/index-BhaKvHkU.mjs +0 -62051
  117. package/dist/index-Bif92ima.js +0 -1
  118. package/dist/index-BnZOu8CL.js +0 -1
  119. package/dist/index-CDxpgRlR.mjs +0 -7
  120. package/dist/index-CThMfvtJ.mjs +0 -2555
  121. package/dist/index-CVqLvm8B.js +0 -1
  122. package/dist/index-CodJBIn6.mjs +0 -1665
  123. package/dist/index-Cr6Wp_S-.mjs +0 -3141
  124. package/dist/index-CslPwsrf.mjs +0 -4
  125. package/dist/index-CuV0MQzZ.mjs +0 -1173
  126. package/dist/index-DA0XouZs.mjs +0 -153
  127. package/dist/index-DKS5Sz9e.js +0 -14
  128. package/dist/index-DSkYYZuW.mjs +0 -4
  129. package/dist/index-DU78_FiA.js +0 -1
  130. package/dist/index-D_mYhgJ0.js +0 -10
  131. package/dist/index-DcWfyXJp.mjs +0 -92
  132. package/dist/index-Dlimbnxj.mjs +0 -2965
  133. package/dist/index-MllWgTJ5.mjs +0 -9372
  134. package/dist/index-in5z9hUb.js +0 -133
  135. package/dist/index-qUW7FnZ-.mjs +0 -20540
  136. package/dist/index.browser-BSu11T_q.mjs +0 -363
  137. package/dist/index.browser-By7-GABP.js +0 -4
  138. package/dist/isDeepEqual-BHfPvf9U.mjs +0 -393
  139. package/dist/isDeepEqual-CqxZGVRk.js +0 -1
  140. package/dist/loadCognitoIdentity-DtYTy-DW.js +0 -1
  141. package/dist/loadCognitoIdentity-DzdR91GB.mjs +0 -872
  142. package/dist/loadSts-Cic6UToN.mjs +0 -593
  143. package/dist/loadSts-csbFP6zX.js +0 -1
  144. package/dist/main.d.ts +0 -1
  145. package/dist/noAuth-B8ui2kBg.mjs +0 -71
  146. package/dist/noAuth-JPA2o4dt.js +0 -1
  147. package/dist/playground/AIContext.d.ts +0 -18
  148. package/dist/playground/AIPanel.d.ts +0 -10
  149. package/dist/playground/Builder.d.ts +0 -1
  150. package/dist/playground/Canvas.d.ts +0 -9
  151. package/dist/playground/DemoGallery.d.ts +0 -6
  152. package/dist/playground/PropertiesEditor.d.ts +0 -10
  153. package/dist/playground/Sidebar.d.ts +0 -9
  154. package/dist/playground/demoForms.d.ts +0 -3
  155. package/dist/playground/demoRecipes.d.ts +0 -15
  156. package/dist/playground/demoVariants.d.ts +0 -11
  157. package/dist/playground/documentation.d.ts +0 -6
  158. package/dist/playground/templates.d.ts +0 -7
  159. package/dist/playground/testData.d.ts +0 -2
  160. package/dist/test/setup.d.ts +0 -0
  161. package/dist/theme/theme.d.ts +0 -6
  162. package/dist/useAxis-DSbfEtO7.js +0 -3
  163. package/dist/useAxis-SiNBMMWq.mjs +0 -3010
  164. package/dist/useChartContainerProps-Bl3hO-r1.mjs +0 -5418
  165. package/dist/useChartContainerProps-C_C_PZoi.js +0 -12
  166. package/dist/useItemHighlightedGetter-9CIwqsGj.js +0 -1
  167. package/dist/useItemHighlightedGetter-CTISrNdV.mjs +0 -88
@@ -1,487 +0,0 @@
1
- import { f as fe, w as D, c as ue, a as R, u as U, _ as x, b as $, d as K, e as Y, j as h, s as de, P as i } from "./index-BhaKvHkU.mjs";
2
- import { e as xe, u as W, c as q, d as J, i as Q } from "./useAxis-SiNBMMWq.mjs";
3
- import * as _ from "react";
4
- import { e as pe, d as be, b as Z, l as he, g as ke, C as ee, c as me, f as ge, i as Te, u as Le, h as Se, j as ye, k as Ae, A as Pe } from "./AxisSharedComponents-xLtpOLH_.mjs";
5
- import { c as Ie } from "./clampAngle-BvZjnf53.mjs";
6
- function Me(t = !1) {
7
- const [e, s] = _.useState(!1);
8
- return fe(() => {
9
- t || s(!0);
10
- }, [t]), _.useEffect(() => {
11
- t && s(!0);
12
- }, [t]), e;
13
- }
14
- function Ce(t, e, s, n, a) {
15
- const l = /* @__PURE__ */ new Map(), k = Ie(a?.angle ?? 0);
16
- let c = 1, o = 1;
17
- a?.textAnchor === "start" ? (c = 1 / 0, o = 1) : a?.textAnchor === "end" ? (c = 1, o = 1 / 0) : (c = 2, o = 2), k > 90 && k < 270 && ([c, o] = [o, c]), n && ([c, o] = [o, c]);
18
- for (const r of t)
19
- if (r.formattedValue) {
20
- const p = Math.min((r.offset + r.labelOffset) * c, (e.left + e.width + e.right - r.offset - r.labelOffset) * o), f = (u) => be(u, {
21
- width: p,
22
- height: s,
23
- angle: k,
24
- measureText: (m) => Z(m, a)
25
- });
26
- l.set(r, pe(r.formattedValue.toString(), f));
27
- }
28
- return l;
29
- }
30
- const H = 5;
31
- function Oe(t, e, s = 0) {
32
- process.env.NODE_ENV !== "production" && s > 90 && s < -90 && D(["MUI X Charts: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.", "This could cause some text overlapping.", "If you encounter a use case where it's needed, please open an issue."]);
33
- const n = Math.min(Math.abs(s) % 180, Math.abs(Math.abs(s) % 180 - 180) % 180);
34
- if (n < H)
35
- return t;
36
- if (n > 90 - H)
37
- return e;
38
- const a = xe(n), l = Math.atan2(e, t);
39
- return a < l ? t / Math.cos(a) : e / Math.sin(a);
40
- }
41
- function je(t, {
42
- tickLabelStyle: e,
43
- tickLabelInterval: s,
44
- tickLabelMinGap: n,
45
- reverse: a,
46
- isMounted: l,
47
- isXInside: k
48
- }) {
49
- if (typeof s == "function")
50
- return new Set(t.filter((f, u) => s(f.value, u)));
51
- let c = 0;
52
- const o = a ? -1 : 1, r = t.filter((f) => {
53
- const {
54
- offset: u,
55
- labelOffset: m,
56
- formattedValue: g
57
- } = f;
58
- if (g === "")
59
- return !1;
60
- const d = u + m;
61
- return k(d);
62
- }), p = we(r, e);
63
- return new Set(r.filter((f, u) => {
64
- const {
65
- offset: m,
66
- labelOffset: g
67
- } = f, d = m + g;
68
- if (u > 0 && o * d < o * (c + n))
69
- return !1;
70
- const {
71
- width: L,
72
- height: y
73
- } = l ? ze(p, f) : {
74
- width: 0,
75
- height: 0
76
- }, b = Oe(L, y, e?.angle), T = d - o * b / 2;
77
- return u > 0 && o * T < o * (c + n) ? !1 : (c = d + o * b / 2, !0);
78
- }));
79
- }
80
- function ze(t, e) {
81
- if (e.formattedValue === void 0)
82
- return {
83
- width: 0,
84
- height: 0
85
- };
86
- let s = 0, n = 0;
87
- for (const a of e.formattedValue.split(`
88
- `)) {
89
- const l = t.get(a);
90
- l && (s = Math.max(s, l.width), n += l.height);
91
- }
92
- return {
93
- width: s,
94
- height: n
95
- };
96
- }
97
- function we(t, e) {
98
- const s = /* @__PURE__ */ new Set();
99
- for (const n of t)
100
- n.formattedValue && n.formattedValue.split(`
101
- `).forEach((a) => s.add(a));
102
- return he(s, e);
103
- }
104
- const te = (t) => {
105
- const {
106
- classes: e,
107
- position: s,
108
- id: n
109
- } = t, a = {
110
- root: ["root", "directionX", s, `id-${n}`],
111
- line: ["line"],
112
- tickContainer: ["tickContainer"],
113
- tick: ["tick"],
114
- tickLabel: ["tickLabel"],
115
- label: ["label"]
116
- };
117
- return ue(a, ke, e);
118
- }, G = 3, Ne = 4, se = {
119
- disableLine: !1,
120
- disableTicks: !1,
121
- tickSize: 6,
122
- tickLabelMinGap: 4
123
- }, Xe = ["scale", "tickNumber", "reverse"];
124
- function ie(t) {
125
- const {
126
- xAxis: e,
127
- xAxisIds: s
128
- } = W(), n = e[t.axisId ?? s[0]], {
129
- scale: a,
130
- tickNumber: l,
131
- reverse: k
132
- } = n, c = R(n, Xe), o = U({
133
- props: x({}, c, t),
134
- name: "MuiChartsXAxis"
135
- }), r = x({}, se, o), {
136
- position: p,
137
- tickLabelStyle: f,
138
- slots: u,
139
- slotProps: m
140
- } = r, g = $(), d = K(), L = te(r), y = p === "bottom" ? 1 : -1, b = u?.axisTick ?? "line", T = u?.axisTickLabel ?? ee, S = me((p === "bottom" ? 0 : 180) - (f?.angle ?? 0)), A = ge((p === "bottom" ? 0 : 180) - (f?.angle ?? 0)), M = Y({
141
- elementType: T,
142
- // @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
143
- externalSlotProps: m?.axisTickLabel,
144
- // @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
145
- additionalProps: {
146
- style: x({}, g.typography.caption, {
147
- fontSize: 12,
148
- lineHeight: 1.25,
149
- textAnchor: d ? Te(S) : S,
150
- dominantBaseline: A
151
- }, f)
152
- },
153
- className: L.tickLabel,
154
- ownerState: {}
155
- });
156
- return {
157
- xScale: a,
158
- defaultizedProps: r,
159
- tickNumber: l,
160
- positionSign: y,
161
- classes: L,
162
- Tick: b,
163
- TickLabel: T,
164
- axisTickLabelProps: M,
165
- reverse: k
166
- };
167
- }
168
- function ve(t) {
169
- const {
170
- axisLabelHeight: e,
171
- ordinalTimeTicks: s
172
- } = t, {
173
- xScale: n,
174
- defaultizedProps: a,
175
- tickNumber: l,
176
- positionSign: k,
177
- classes: c,
178
- Tick: o,
179
- TickLabel: r,
180
- axisTickLabelProps: p,
181
- reverse: f
182
- } = ie(t), u = K(), m = Me(), {
183
- disableTicks: g,
184
- tickSize: d,
185
- valueFormatter: L,
186
- slotProps: y,
187
- tickInterval: b,
188
- tickLabelInterval: T,
189
- tickPlacement: S,
190
- tickLabelPlacement: A,
191
- tickLabelMinGap: M,
192
- tickSpacing: w,
193
- height: O
194
- } = a, j = q(), {
195
- instance: P
196
- } = J(), C = Le(), I = g ? 4 : d, N = Se({
197
- scale: n,
198
- tickNumber: l,
199
- valueFormatter: L,
200
- tickInterval: b,
201
- tickPlacement: S,
202
- tickLabelPlacement: A,
203
- tickSpacing: w,
204
- direction: "x",
205
- ordinalTimeTicks: s
206
- }), X = je(N, {
207
- tickLabelStyle: p.style,
208
- tickLabelInterval: T,
209
- tickLabelMinGap: M,
210
- reverse: f,
211
- isMounted: m,
212
- isXInside: P.isXInside
213
- }), v = Math.max(0, O - (e > 0 ? e + Ne : 0) - I - G), E = C ? Ce(X, j, v, u, p.style) : new Map(Array.from(X).map((z) => [z, z.formattedValue]));
214
- return /* @__PURE__ */ h.jsx(_.Fragment, {
215
- children: N.map((z, ne) => {
216
- const {
217
- offset: V,
218
- labelOffset: ae
219
- } = z, oe = ae ?? 0, ce = k * (I + G), le = P.isXInside(V), F = E.get(z), re = X.has(z);
220
- return /* @__PURE__ */ h.jsxs("g", {
221
- transform: `translate(${V}, 0)`,
222
- className: c.tickContainer,
223
- children: [!g && le && /* @__PURE__ */ h.jsx(o, x({
224
- y2: k * I,
225
- className: c.tick
226
- }, y?.axisTick)), F !== void 0 && re && /* @__PURE__ */ h.jsx(r, x({
227
- x: oe,
228
- y: ce
229
- }, p, {
230
- text: F
231
- }))]
232
- }, ne);
233
- })
234
- });
235
- }
236
- const B = {
237
- tickSize: 6
238
- }, _e = (t, e, s) => {
239
- const n = t[e] ?? {}, a = s ?? B.tickSize, l = a * e * 2 + a;
240
- return x({}, B, n, {
241
- tickSize: n.tickSize ?? l
242
- });
243
- };
244
- function Ee(t) {
245
- const {
246
- xScale: e,
247
- defaultizedProps: s,
248
- positionSign: n,
249
- classes: a,
250
- Tick: l,
251
- TickLabel: k,
252
- axisTickLabelProps: c
253
- } = ie(t);
254
- if (!Q(e))
255
- throw new Error("MUI X Charts: ChartsGroupedXAxis only supports the `band` and `point` scale types.");
256
- const {
257
- disableTicks: o,
258
- tickSize: r,
259
- valueFormatter: p,
260
- slotProps: f,
261
- tickInterval: u,
262
- tickPlacement: m,
263
- tickLabelPlacement: g
264
- } = s, d = s.groups, {
265
- instance: L
266
- } = J(), y = ye({
267
- scale: e,
268
- tickInterval: u,
269
- tickPlacement: m,
270
- tickLabelPlacement: g,
271
- groups: d
272
- });
273
- return /* @__PURE__ */ h.jsx(_.Fragment, {
274
- children: y.map((b, T) => {
275
- const {
276
- offset: S,
277
- labelOffset: A
278
- } = b, M = A ?? 0, w = L.isXInside(S), O = b.formattedValue, j = b.ignoreTick ?? !1, P = b.groupIndex ?? 0, C = _e(d, P, r), I = n * C.tickSize, N = n * (C.tickSize + G);
279
- return /* @__PURE__ */ h.jsxs("g", {
280
- transform: `translate(${S}, 0)`,
281
- className: a.tickContainer,
282
- "data-group-index": P,
283
- children: [!o && !j && w && /* @__PURE__ */ h.jsx(l, x({
284
- y2: I,
285
- className: a.tick
286
- }, f?.axisTick)), O !== void 0 && /* @__PURE__ */ h.jsx(k, x({
287
- x: M,
288
- y: N
289
- }, c, {
290
- style: x({}, c.style, C.tickLabelStyle),
291
- text: O
292
- }))]
293
- }, T);
294
- })
295
- });
296
- }
297
- const Re = ["axis"], Ge = ["scale", "tickNumber", "reverse", "ordinalTimeTicks"], Ve = de(Pe, {
298
- name: "MuiChartsXAxis",
299
- slot: "Root"
300
- })({});
301
- function Fe(t) {
302
- let {
303
- axis: e
304
- } = t, s = R(t, Re);
305
- const {
306
- scale: n,
307
- ordinalTimeTicks: a
308
- } = e, l = R(e, Ge), k = U({
309
- props: x({}, l, s),
310
- name: "MuiChartsXAxis"
311
- }), c = x({}, se, k), {
312
- position: o,
313
- labelStyle: r,
314
- offset: p,
315
- slots: f,
316
- slotProps: u,
317
- sx: m,
318
- disableLine: g,
319
- label: d,
320
- height: L
321
- } = c, y = $(), b = te(c), {
322
- left: T,
323
- top: S,
324
- width: A,
325
- height: M
326
- } = q(), w = o === "bottom" ? 1 : -1, O = f?.axisLine ?? "line", j = f?.axisLabel ?? ee, P = Y({
327
- elementType: j,
328
- // @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
329
- externalSlotProps: u?.axisLabel,
330
- // @ts-expect-error `useSlotProps` applies `WithCommonProps` with adds a `style: React.CSSProperties` prop automatically.
331
- additionalProps: {
332
- style: x({}, y.typography.body1, {
333
- lineHeight: 1,
334
- fontSize: 14,
335
- textAnchor: "middle",
336
- dominantBaseline: o === "bottom" ? "text-after-edge" : "text-before-edge"
337
- }, r)
338
- },
339
- ownerState: {}
340
- });
341
- if (o === "none")
342
- return null;
343
- const C = d ? Z(d, P.style).height : 0, I = n.domain(), X = Q(n) ? I.length === 0 : I.some(Ae);
344
- let v = null;
345
- X || (v = "groups" in e && Array.isArray(e.groups) ? /* @__PURE__ */ h.jsx(Ee, x({}, s)) : /* @__PURE__ */ h.jsx(ve, x({}, s, {
346
- axisLabelHeight: C,
347
- ordinalTimeTicks: a
348
- })));
349
- const E = {
350
- x: T + A / 2,
351
- y: w * L
352
- };
353
- return /* @__PURE__ */ h.jsxs(Ve, {
354
- transform: `translate(0, ${o === "bottom" ? S + M + p : S - p})`,
355
- className: b.root,
356
- "data-axis-id": c.id,
357
- sx: m,
358
- children: [!g && /* @__PURE__ */ h.jsx(O, x({
359
- x1: T,
360
- x2: T + A,
361
- className: b.line
362
- }, u?.axisLine)), v, d && /* @__PURE__ */ h.jsx("g", {
363
- className: b.label,
364
- children: /* @__PURE__ */ h.jsx(j, x({}, E, P, {
365
- text: d
366
- }))
367
- })]
368
- });
369
- }
370
- function He(t) {
371
- const {
372
- xAxis: e,
373
- xAxisIds: s
374
- } = W(), n = e[t.axisId ?? s[0]];
375
- return n ? /* @__PURE__ */ h.jsx(Fe, x({}, t, {
376
- axis: n
377
- })) : (D(`MUI X Charts: No axis found. The axisId "${t.axisId}" is probably invalid.`), null);
378
- }
379
- process.env.NODE_ENV !== "production" && (He.propTypes = {
380
- // ----------------------------- Warning --------------------------------
381
- // | These PropTypes are generated from the TypeScript type definitions |
382
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
383
- // ----------------------------------------------------------------------
384
- axis: i.oneOf(["x"]),
385
- /**
386
- * The id of the axis to render.
387
- * If undefined, it will be the first defined axis.
388
- */
389
- axisId: i.oneOfType([i.number, i.string]),
390
- /**
391
- * Override or extend the styles applied to the component.
392
- */
393
- classes: i.object,
394
- /**
395
- * If true, the axis line is disabled.
396
- * @default false
397
- */
398
- disableLine: i.bool,
399
- /**
400
- * If true, the ticks are disabled.
401
- * @default false
402
- */
403
- disableTicks: i.bool,
404
- /**
405
- * The label of the axis.
406
- */
407
- label: i.string,
408
- /**
409
- * The style applied to the axis label.
410
- */
411
- labelStyle: i.object,
412
- /**
413
- * The props used for each component slot.
414
- * @default {}
415
- */
416
- slotProps: i.object,
417
- /**
418
- * Overridable component slots.
419
- * @default {}
420
- */
421
- slots: i.object,
422
- sx: i.oneOfType([i.arrayOf(i.oneOfType([i.func, i.object, i.bool])), i.func, i.object]),
423
- /**
424
- * Defines which ticks are displayed.
425
- * Its value can be:
426
- * - 'auto' In such case the ticks are computed based on axis scale and other parameters.
427
- * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
428
- * - an array containing the values where ticks should be displayed.
429
- * @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
430
- * @default 'auto'
431
- */
432
- tickInterval: i.oneOfType([i.oneOf(["auto"]), i.array, i.func]),
433
- /**
434
- * Defines which ticks get its label displayed. Its value can be:
435
- * - 'auto' In such case, labels are displayed if they do not overlap with the previous one.
436
- * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones.
437
- * @default 'auto'
438
- */
439
- tickLabelInterval: i.oneOfType([i.oneOf(["auto"]), i.func]),
440
- /**
441
- * The minimum gap in pixels between two tick labels.
442
- * If two tick labels are closer than this minimum gap, one of them will be hidden.
443
- * @default 4
444
- */
445
- tickLabelMinGap: i.number,
446
- /**
447
- * The placement of ticks label. Can be the middle of the band, or the tick position.
448
- * Only used if scale is 'band'.
449
- * @default 'middle'
450
- */
451
- tickLabelPlacement: i.oneOf(["middle", "tick"]),
452
- /**
453
- * The style applied to ticks text.
454
- */
455
- tickLabelStyle: i.object,
456
- /**
457
- * Maximal step between two ticks.
458
- * When using time data, the value is assumed to be in ms.
459
- * Not supported by categorical axis (band, points).
460
- */
461
- tickMaxStep: i.number,
462
- /**
463
- * Minimal step between two ticks.
464
- * When using time data, the value is assumed to be in ms.
465
- * Not supported by categorical axis (band, points).
466
- */
467
- tickMinStep: i.number,
468
- /**
469
- * The number of ticks. This number is not guaranteed.
470
- * Not supported by categorical axis (band, points).
471
- */
472
- tickNumber: i.number,
473
- /**
474
- * The placement of ticks in regard to the band interval.
475
- * Only used if scale is 'band'.
476
- * @default 'extremities'
477
- */
478
- tickPlacement: i.oneOf(["end", "extremities", "middle", "start"]),
479
- /**
480
- * The size of the ticks.
481
- * @default 6
482
- */
483
- tickSize: i.number
484
- });
485
- export {
486
- He as C
487
- };
@@ -1,3 +0,0 @@
1
- "use strict";const e=require("./index--8Zky9Oh.js"),S=require("./useAxis-DSbfEtO7.js"),Z=require("react"),d=require("./AxisSharedComponents-BbsKw1BT.js"),ee=require("./clampAngle-DpAsDoeT.js");function te(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(s,i,n.get?n:{enumerable:!0,get:()=>t[i]})}}return s.default=t,Object.freeze(s)}const X=te(Z);function se(t=!1){const[s,i]=X.useState(!1);return e.useEnhancedEffect(()=>{t||i(!0)},[t]),X.useEffect(()=>{t&&i(!0)},[t]),s}function ie(t,s,i,n,o){const c=new Map,T=ee.clampAngle(o?.angle??0);let r=1,a=1;o?.textAnchor==="start"?(r=1/0,a=1):o?.textAnchor==="end"?(r=1,a=1/0):(r=2,a=2),T>90&&T<270&&([r,a]=[a,r]),n&&([r,a]=[a,r]);for(const l of t)if(l.formattedValue){const f=Math.min((l.offset+l.labelOffset)*r,(s.left+s.width+s.right-l.offset-l.labelOffset)*a),p=u=>d.doesTextFitInRect(u,{width:f,height:i,angle:T,measureText:m=>d.getStringSize(m,o)});c.set(l,d.ellipsize(l.formattedValue.toString(),p))}return c}const D=5;function ne(t,s,i=0){process.env.NODE_ENV!=="production"&&i>90&&i<-90&&e.warnOnce(["MUI X Charts: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.","This could cause some text overlapping.","If you encounter a use case where it's needed, please open an issue."]);const n=Math.min(Math.abs(i)%180,Math.abs(Math.abs(i)%180-180)%180);if(n<D)return t;if(n>90-D)return s;const o=S.deg2rad(n),c=Math.atan2(s,t);return o<c?t/Math.cos(o):s/Math.sin(o)}function oe(t,{tickLabelStyle:s,tickLabelInterval:i,tickLabelMinGap:n,reverse:o,isMounted:c,isXInside:T}){if(typeof i=="function")return new Set(t.filter((p,u)=>i(p.value,u)));let r=0;const a=o?-1:1,l=t.filter(p=>{const{offset:u,labelOffset:m,formattedValue:h}=p;if(h==="")return!1;const x=u+m;return T(x)}),f=re(l,s);return new Set(l.filter((p,u)=>{const{offset:m,labelOffset:h}=p,x=m+h;if(u>0&&a*x<a*(r+n))return!1;const{width:g,height:P}=c?ae(f,p):{width:0,height:0},b=ne(g,P,s?.angle),k=x-a*b/2;return u>0&&a*k<a*(r+n)?!1:(r=x+a*b/2,!0)}))}function ae(t,s){if(s.formattedValue===void 0)return{width:0,height:0};let i=0,n=0;for(const o of s.formattedValue.split(`
2
- `)){const c=t.get(o);c&&(i=Math.max(i,c.width),n+=c.height)}return{width:i,height:n}}function re(t,s){const i=new Set;for(const n of t)n.formattedValue&&n.formattedValue.split(`
3
- `).forEach(o=>i.add(o));return d.batchMeasureStrings(i,s)}const H=t=>{const{classes:s,position:i,id:n}=t,o={root:["root","directionX",i,`id-${n}`],line:["line"],tickContainer:["tickContainer"],tick:["tick"],tickLabel:["tickLabel"],label:["label"]};return e.composeClasses(o,d.getAxisUtilityClass,s)},v=3,ce=4,B={disableLine:!1,disableTicks:!1,tickSize:6,tickLabelMinGap:4},le=["scale","tickNumber","reverse"];function U(t){const{xAxis:s,xAxisIds:i}=S.useXAxes(),n=s[t.axisId??i[0]],{scale:o,tickNumber:c,reverse:T}=n,r=e._objectWithoutPropertiesLoose(n,le),a=e.useThemeProps({props:e._extends({},r,t),name:"MuiChartsXAxis"}),l=e._extends({},B,a),{position:f,tickLabelStyle:p,slots:u,slotProps:m}=l,h=e.useTheme(),x=e.useRtl(),g=H(l),P=f==="bottom"?1:-1,b=u?.axisTick??"line",k=u?.axisTickLabel??d.ChartsText,y=d.getDefaultTextAnchor((f==="bottom"?0:180)-(p?.angle??0)),L=d.getDefaultBaseline((f==="bottom"?0:180)-(p?.angle??0)),_=e.useSlotProps({elementType:k,externalSlotProps:m?.axisTickLabel,additionalProps:{style:e._extends({},h.typography.caption,{fontSize:12,lineHeight:1.25,textAnchor:x?d.invertTextAnchor(y):y,dominantBaseline:L},p)},className:g.tickLabel,ownerState:{}});return{xScale:o,defaultizedProps:l,tickNumber:c,positionSign:P,classes:g,Tick:b,TickLabel:k,axisTickLabelProps:_,reverse:T}}function pe(t){const{axisLabelHeight:s,ordinalTimeTicks:i}=t,{xScale:n,defaultizedProps:o,tickNumber:c,positionSign:T,classes:r,Tick:a,TickLabel:l,axisTickLabelProps:f,reverse:p}=U(t),u=e.useRtl(),m=se(),{disableTicks:h,tickSize:x,valueFormatter:g,slotProps:P,tickInterval:b,tickLabelInterval:k,tickPlacement:y,tickLabelPlacement:L,tickLabelMinGap:_,tickSpacing:E,height:C}=o,I=S.useDrawingArea(),{instance:A}=S.useChartContext(),O=d.useIsHydrated(),j=h?4:x,R=d.useTicks({scale:n,tickNumber:c,valueFormatter:g,tickInterval:b,tickPlacement:y,tickLabelPlacement:L,tickSpacing:E,direction:"x",ordinalTimeTicks:i}),z=oe(R,{tickLabelStyle:f.style,tickLabelInterval:k,tickLabelMinGap:_,reverse:p,isMounted:m,isXInside:A.isXInside}),w=Math.max(0,C-(s>0?s+ce:0)-j-v),N=O?ie(z,I,w,u,f.style):new Map(Array.from(z).map(M=>[M,M.formattedValue]));return e.jsxRuntimeExports.jsx(X.Fragment,{children:R.map((M,q)=>{const{offset:G,labelOffset:W}=M,K=W??0,Y=T*(j+v),J=A.isXInside(G),V=N.get(M),Q=z.has(M);return e.jsxRuntimeExports.jsxs("g",{transform:`translate(${G}, 0)`,className:r.tickContainer,children:[!h&&J&&e.jsxRuntimeExports.jsx(a,e._extends({y2:T*j,className:r.tick},P?.axisTick)),V!==void 0&&Q&&e.jsxRuntimeExports.jsx(l,e._extends({x:K,y:Y},f,{text:V}))]},q)})})}const F={tickSize:6},ue=(t,s,i)=>{const n=t[s]??{},o=i??F.tickSize,c=o*s*2+o;return e._extends({},F,n,{tickSize:n.tickSize??c})};function xe(t){const{xScale:s,defaultizedProps:i,positionSign:n,classes:o,Tick:c,TickLabel:T,axisTickLabelProps:r}=U(t);if(!S.isOrdinalScale(s))throw new Error("MUI X Charts: ChartsGroupedXAxis only supports the `band` and `point` scale types.");const{disableTicks:a,tickSize:l,valueFormatter:f,slotProps:p,tickInterval:u,tickPlacement:m,tickLabelPlacement:h}=i,x=i.groups,{instance:g}=S.useChartContext(),P=d.useTicksGrouped({scale:s,tickInterval:u,tickPlacement:m,tickLabelPlacement:h,groups:x});return e.jsxRuntimeExports.jsx(X.Fragment,{children:P.map((b,k)=>{const{offset:y,labelOffset:L}=b,_=L??0,E=g.isXInside(y),C=b.formattedValue,I=b.ignoreTick??!1,A=b.groupIndex??0,O=ue(x,A,l),j=n*O.tickSize,R=n*(O.tickSize+v);return e.jsxRuntimeExports.jsxs("g",{transform:`translate(${y}, 0)`,className:o.tickContainer,"data-group-index":A,children:[!a&&!I&&E&&e.jsxRuntimeExports.jsx(c,e._extends({y2:j,className:o.tick},p?.axisTick)),C!==void 0&&e.jsxRuntimeExports.jsx(T,e._extends({x:_,y:R},r,{style:e._extends({},r.style,O.tickLabelStyle),text:C}))]},k)})})}const de=["axis"],fe=["scale","tickNumber","reverse","ordinalTimeTicks"],be=e.styled(d.AxisRoot,{name:"MuiChartsXAxis",slot:"Root"})({});function Te(t){let{axis:s}=t,i=e._objectWithoutPropertiesLoose(t,de);const{scale:n,ordinalTimeTicks:o}=s,c=e._objectWithoutPropertiesLoose(s,fe),T=e.useThemeProps({props:e._extends({},c,i),name:"MuiChartsXAxis"}),r=e._extends({},B,T),{position:a,labelStyle:l,offset:f,slots:p,slotProps:u,sx:m,disableLine:h,label:x,height:g}=r,P=e.useTheme(),b=H(r),{left:k,top:y,width:L,height:_}=S.useDrawingArea(),E=a==="bottom"?1:-1,C=p?.axisLine??"line",I=p?.axisLabel??d.ChartsText,A=e.useSlotProps({elementType:I,externalSlotProps:u?.axisLabel,additionalProps:{style:e._extends({},P.typography.body1,{lineHeight:1,fontSize:14,textAnchor:"middle",dominantBaseline:a==="bottom"?"text-after-edge":"text-before-edge"},l)},ownerState:{}});if(a==="none")return null;const O=x?d.getStringSize(x,A.style).height:0,j=n.domain(),z=S.isOrdinalScale(n)?j.length===0:j.some(d.isInfinity);let w=null;z||(w="groups"in s&&Array.isArray(s.groups)?e.jsxRuntimeExports.jsx(xe,e._extends({},i)):e.jsxRuntimeExports.jsx(pe,e._extends({},i,{axisLabelHeight:O,ordinalTimeTicks:o})));const N={x:k+L/2,y:E*g};return e.jsxRuntimeExports.jsxs(be,{transform:`translate(0, ${a==="bottom"?y+_+f:y-f})`,className:b.root,"data-axis-id":r.id,sx:m,children:[!h&&e.jsxRuntimeExports.jsx(C,e._extends({x1:k,x2:k+L,className:b.line},u?.axisLine)),w,x&&e.jsxRuntimeExports.jsx("g",{className:b.label,children:e.jsxRuntimeExports.jsx(I,e._extends({},N,A,{text:x}))})]})}function $(t){const{xAxis:s,xAxisIds:i}=S.useXAxes(),n=s[t.axisId??i[0]];return n?e.jsxRuntimeExports.jsx(Te,e._extends({},t,{axis:n})):(e.warnOnce(`MUI X Charts: No axis found. The axisId "${t.axisId}" is probably invalid.`),null)}process.env.NODE_ENV!=="production"&&($.propTypes={axis:e.PropTypes.oneOf(["x"]),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]),tickLabelMinGap:e.PropTypes.number,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.ChartsXAxis=$;