@m4l/components 9.22.0 → 9.22.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Popover/Popover.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,SAAS,CAAC;AA8MjB;;GAEG;AACH,eAAO,MAAM,OAAO,sHA+QnB,CAAC"}
1
+ {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Popover/Popover.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,SAAS,CAAC;AA8MjB;;GAEG;AACH,eAAO,MAAM,OAAO,sHAqRnB,CAAC"}
@@ -1,14 +1,14 @@
1
- import { jsx as H } from "@emotion/react/jsx-runtime";
2
- import { Paper as ne } from "@mui/material";
3
- import { useForkRef as re } from "@mui/material/utils";
4
- import W from "clsx";
5
- import { createPortal as ie } from "react-dom";
6
- import { forwardRef as se, useRef as $, useState as ae, useLayoutEffect as ce, useEffect as j } from "react";
7
- import { getPropDataTestId as le } from "../../../../test/getNameDataTestId.js";
8
- import { POPOVER_CLASS_NAME_SPECIFY as fe, POPOVER_PREFIX as pe } from "./constants.js";
9
- import { PopoverRootStyled as ue } from "./slots/PopoverSlots.js";
10
- import { PopoverSlots as de } from "./slots/PopoverEnum.js";
11
- const U = {
1
+ import { jsx as W } from "@emotion/react/jsx-runtime";
2
+ import { Paper as re } from "@mui/material";
3
+ import { useForkRef as ie } from "@mui/material/utils";
4
+ import $ from "clsx";
5
+ import { createPortal as se } from "react-dom";
6
+ import { forwardRef as ce, useRef as j, useState as ae, useLayoutEffect as le, useEffect as U } from "react";
7
+ import { getPropDataTestId as fe } from "../../../../test/getNameDataTestId.js";
8
+ import { POPOVER_CLASS_NAME_SPECIFY as pe, POPOVER_PREFIX as ue } from "./constants.js";
9
+ import { PopoverRootStyled as de } from "./slots/PopoverSlots.js";
10
+ import { PopoverSlots as me } from "./slots/PopoverEnum.js";
11
+ const X = {
12
12
  left: "0px",
13
13
  top: "0px",
14
14
  transformOrigin: "top left",
@@ -24,16 +24,16 @@ function k(t) {
24
24
  function F(t, e) {
25
25
  return typeof document > "u" ? null : t ? typeof t == "function" ? t() : t ?? null : k(e)?.ownerDocument.body ?? document.body;
26
26
  }
27
- function X(t, e) {
27
+ function Y(t, e) {
28
28
  return typeof e == "number" ? e : e === "center" ? t.height / 2 : e === "bottom" ? t.height : 0;
29
29
  }
30
- function Y(t, e) {
30
+ function q(t, e) {
31
31
  return typeof e == "number" ? e : e === "center" ? t.width / 2 : e === "right" ? t.width : 0;
32
32
  }
33
- function q(t) {
33
+ function G(t) {
34
34
  return [t.horizontal, t.vertical].map((e) => typeof e == "number" ? `${e}px` : e).join(" ");
35
35
  }
36
- function me(t) {
36
+ function he(t) {
37
37
  const {
38
38
  anchorEl: e,
39
39
  anchorOrigin: y,
@@ -45,15 +45,15 @@ function me(t) {
45
45
  } = t, g = {
46
46
  height: P.offsetHeight,
47
47
  width: P.offsetWidth
48
- }, a = {
49
- horizontal: Y(g, b.horizontal),
50
- vertical: X(g, b.vertical)
48
+ }, c = {
49
+ horizontal: q(g, b.horizontal),
50
+ vertical: Y(g, b.vertical)
51
51
  };
52
52
  if (r === "none")
53
53
  return {
54
54
  left: "0px",
55
55
  top: "0px",
56
- transformOrigin: q(a),
56
+ transformOrigin: G(c),
57
57
  visibility: "visible"
58
58
  };
59
59
  const R = k(e), E = r === "anchorPosition" ? {
@@ -69,33 +69,33 @@ function me(t) {
69
69
  top: 0,
70
70
  width: 0
71
71
  }, T = {
72
- left: E.left + Y(E, y.horizontal),
73
- top: E.top + X(E, y.vertical)
72
+ left: E.left + q(E, y.horizontal),
73
+ top: E.top + Y(E, y.vertical)
74
74
  };
75
- let m = T.top - a.vertical, h = T.left - a.horizontal;
76
- const D = m + g.height, L = h + g.width, p = R?.ownerDocument.defaultView ?? window, S = p.innerHeight - (n ?? 0), A = p.innerWidth - (n ?? 0);
75
+ let m = T.top - c.vertical, h = T.left - c.horizontal;
76
+ const D = m + g.height, L = h + g.width, p = R?.ownerDocument.defaultView ?? window, A = p.innerHeight - (n ?? 0), S = p.innerWidth - (n ?? 0);
77
77
  if (n !== null && m < n) {
78
78
  const i = m - n;
79
- m -= i, a.vertical += i;
80
- } else if (n !== null && D > S) {
81
- const i = D - S;
82
- m -= i, a.vertical += i;
79
+ m -= i, c.vertical += i;
80
+ } else if (n !== null && D > A) {
81
+ const i = D - A;
82
+ m -= i, c.vertical += i;
83
83
  }
84
84
  if (n !== null && h < n) {
85
85
  const i = h - n;
86
- h -= i, a.horizontal += i;
87
- } else if (n !== null && L > A) {
88
- const i = L - A;
89
- h -= i, a.horizontal += i;
86
+ h -= i, c.horizontal += i;
87
+ } else if (n !== null && L > S) {
88
+ const i = L - S;
89
+ h -= i, c.horizontal += i;
90
90
  }
91
91
  return {
92
92
  left: `${Math.round(h)}px`,
93
93
  top: `${Math.round(m)}px`,
94
- transformOrigin: q(a),
94
+ transformOrigin: G(c),
95
95
  visibility: "visible"
96
96
  };
97
97
  }
98
- const Ne = se(
98
+ const Ne = ce(
99
99
  function(e, y) {
100
100
  const {
101
101
  action: w,
@@ -104,7 +104,7 @@ const Ne = se(
104
104
  anchorPosition: P,
105
105
  anchorReference: b = "anchorEl",
106
106
  arrowType: g = "no-arrow",
107
- BackdropComponent: a,
107
+ BackdropComponent: c,
108
108
  BackdropProps: R,
109
109
  children: E,
110
110
  className: T,
@@ -113,63 +113,63 @@ const Ne = se(
113
113
  components: D,
114
114
  componentsProps: L,
115
115
  container: p,
116
- disableAutoFocus: S,
117
- disableEnforceFocus: A,
116
+ disableAutoFocus: A,
117
+ disableEnforceFocus: S,
118
118
  disableEscapeKeyDown: i,
119
- disablePortal: he,
119
+ disablePortal: ve,
120
120
  disableRestoreFocus: M = !1,
121
- disableScrollLock: ve,
122
- elevation: G = 8,
123
- hideBackdrop: Ee,
124
- instaceDataTestId: J,
125
- keepMounted: we,
121
+ disableScrollLock: Ee,
122
+ elevation: J = 8,
123
+ hideBackdrop: we,
124
+ instaceDataTestId: Q,
125
+ keepMounted: Pe,
126
126
  marginThreshold: B = 16,
127
- onBackdropClick: Pe,
127
+ onBackdropClick: be,
128
128
  onClose: O,
129
- onTransitionEnter: be,
130
- onTransitionExited: ge,
129
+ onTransitionEnter: ge,
130
+ onTransitionExited: _e,
131
131
  open: u = !1,
132
- ownerState: _e,
132
+ ownerState: ye,
133
133
  PaperProps: I = {},
134
- size: ye,
134
+ size: Te,
135
135
  slotProps: x,
136
- slots: Te,
137
- sx: Q,
136
+ slots: Oe,
137
+ sx: Z,
138
138
  transformOrigin: N = { horizontal: "right", vertical: "top" },
139
- TransitionComponent: Oe,
140
- transitionDuration: xe,
141
- TransitionProps: ke,
142
- ...Z
143
- } = e, c = $(null), ee = re(
144
- c,
139
+ TransitionComponent: xe,
140
+ transitionDuration: ke,
141
+ TransitionProps: Re,
142
+ ...ee
143
+ } = e, a = j(null), te = ie(
144
+ a,
145
145
  ((typeof x?.paper == "function" ? void 0 : x?.paper) ?? I)?.ref
146
- ), [te, V] = ae(
147
- U
148
- ), z = $(null), K = u ? F(p, r) : null, d = (typeof x?.paper == "function" ? void 0 : x?.paper) ?? I, oe = Array.isArray(
146
+ ), [oe, V] = ae(
147
+ X
148
+ ), z = j(null), K = u ? F(p, r) : null, d = (typeof x?.paper == "function" ? void 0 : x?.paper) ?? I, ne = Array.isArray(
149
149
  d?.sx
150
150
  ) ? [C, ...d.sx] : d?.sx ? [C, d.sx] : C;
151
- return ce(() => {
152
- if (!u || !c.current) {
153
- V(U);
151
+ return le(() => {
152
+ if (!u || !a.current) {
153
+ V(X);
154
154
  return;
155
155
  }
156
156
  const o = () => {
157
- if (!c.current)
157
+ if (!a.current)
158
158
  return;
159
- const s = me({
159
+ const s = he({
160
160
  anchorEl: r,
161
161
  anchorOrigin: n,
162
162
  anchorPosition: P,
163
163
  anchorReference: b,
164
164
  marginThreshold: B,
165
- paperElement: c.current,
165
+ paperElement: a.current,
166
166
  transformOrigin: N
167
167
  });
168
168
  V((v) => v.left === s.left && v.top === s.top && v.transformOrigin === s.transformOrigin && v.visibility === s.visibility ? v : s);
169
- }, l = c.current.ownerDocument, _ = k(r), f = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
169
+ }, l = a.current.ownerDocument, _ = k(r), f = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
170
170
  o();
171
171
  });
172
- return o(), l.defaultView?.addEventListener("resize", o), l.addEventListener("scroll", o, !0), f?.observe(c.current), _ && f?.observe(_), () => {
172
+ return o(), l.defaultView?.addEventListener("resize", o), l.addEventListener("scroll", o, !0), f?.observe(a.current), _ && f?.observe(_), () => {
173
173
  l.defaultView?.removeEventListener("resize", o), l.removeEventListener("scroll", o, !0), f?.disconnect();
174
174
  };
175
175
  }, [
@@ -180,19 +180,22 @@ const Ne = se(
180
180
  B,
181
181
  u,
182
182
  N
183
- ]), j(() => {
183
+ ]), U(() => {
184
184
  if (!u)
185
185
  return;
186
- const o = c.current?.ownerDocument ?? F(p, r)?.ownerDocument ?? document;
186
+ const o = a.current?.ownerDocument ?? F(p, r)?.ownerDocument ?? document;
187
187
  return z.current = o.activeElement instanceof HTMLElement ? o.activeElement : null, () => {
188
188
  M || z.current?.focus?.(), z.current = null;
189
189
  };
190
- }, [r, p, M, u]), j(() => {
190
+ }, [r, p, M, u]), U(() => {
191
191
  if (!u || !O)
192
192
  return;
193
- const o = c.current?.ownerDocument ?? F(p, r)?.ownerDocument ?? document, l = (f) => {
193
+ const o = a.current?.ownerDocument ?? F(p, r)?.ownerDocument ?? document, l = (f) => {
194
194
  const s = f.target, v = k(r);
195
- !s || c.current?.contains(s) || v?.contains(s) || (s instanceof Element ? s : s.parentElement)?.closest(".MuiModal-root") || O(
195
+ if (!s || a.current?.contains(s) || v?.contains(s))
196
+ return;
197
+ const H = s instanceof Element ? s : s.parentElement;
198
+ H?.closest(".MuiModal-root") || H?.closest(".MuiAutocomplete-popper") || O(
196
199
  f,
197
200
  "backdropClick"
198
201
  );
@@ -205,29 +208,29 @@ const Ne = se(
205
208
  return o.addEventListener("mousedown", l, !0), o.addEventListener("touchstart", l, !0), o.addEventListener("keydown", _), () => {
206
209
  o.removeEventListener("mousedown", l, !0), o.removeEventListener("touchstart", l, !0), o.removeEventListener("keydown", _);
207
210
  };
208
- }, [r, p, O, u]), !u || !K ? null : ie(
209
- /* @__PURE__ */ H(
210
- ue,
211
+ }, [r, p, O, u]), !u || !K ? null : se(
212
+ /* @__PURE__ */ W(
213
+ de,
211
214
  {
212
- ...le(
213
- pe,
214
- de.root,
215
- J
215
+ ...fe(
216
+ ue,
217
+ me.root,
218
+ Q
216
219
  ),
217
- ...Z,
220
+ ...ee,
218
221
  ref: y,
219
- className: W(T, fe),
220
- ownerState: { position: te },
221
- sx: Q,
222
- children: /* @__PURE__ */ H(
223
- ne,
222
+ className: $(T, pe),
223
+ ownerState: { position: oe },
224
+ sx: Z,
225
+ children: /* @__PURE__ */ W(
226
+ re,
224
227
  {
225
228
  ...d,
226
- ref: ee,
229
+ ref: te,
227
230
  "aria-label": d?.["aria-label"] ?? "Paper-popover-root",
228
- className: W(d?.className),
229
- elevation: d?.elevation ?? G,
230
- sx: oe,
231
+ className: $(d?.className),
232
+ elevation: d?.elevation ?? J,
233
+ sx: ne,
231
234
  children: E
232
235
  }
233
236
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.22.0",
3
+ "version": "9.22.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -51,11 +51,11 @@
51
51
  "@hookform/resolvers": "2.9.11",
52
52
  "nprogress": "0.2.0",
53
53
  "react-transition-group": "4.4.5",
54
- "react-dropzone": "14.4.1",
55
- "react-draggable": "4.5.0",
56
54
  "react-color": "2.19.3",
57
- "@mui/x-date-pickers": "6.20.2",
55
+ "react-draggable": "4.5.0",
58
56
  "react-rnd": "10.5.2",
57
+ "@mui/x-date-pickers": "6.20.2",
58
+ "react-dropzone": "14.4.1",
59
59
  "react-spinners": "0.13.8",
60
60
  "date-fns": "2.30.0",
61
61
  "chart.js": "4.5.1",