@m4l/components 9.54.2-beta-m4lcom-764-device-picker.1 → 9.55.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 (26) hide show
  1. package/components/DevicesPicker/DevicesPicker.d.ts.map +1 -1
  2. package/components/DevicesPicker/DevicesPicker.js +214 -213
  3. package/components/DevicesPicker/DevicesPicker.styles.d.ts.map +1 -1
  4. package/components/DevicesPicker/DevicesPicker.styles.js +34 -19
  5. package/components/DevicesPicker/constants.d.ts +14 -3
  6. package/components/DevicesPicker/constants.d.ts.map +1 -1
  7. package/components/DevicesPicker/constants.js +15 -13
  8. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts.map +1 -1
  9. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.js +17 -17
  10. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.d.ts.map +1 -1
  11. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.js +44 -36
  12. package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
  13. package/components/extended/mui/Autocomplete/Autocomplete.d.ts.map +1 -1
  14. package/components/extended/mui/Autocomplete/Autocomplete.js +52 -50
  15. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts.map +1 -1
  16. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +58 -60
  17. package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.d.ts +14 -0
  18. package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.d.ts.map +1 -0
  19. package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.js +7 -0
  20. package/hooks/useChipsOverflow/helpers/index.d.ts +1 -0
  21. package/hooks/useChipsOverflow/helpers/index.d.ts.map +1 -1
  22. package/hooks/useChipsOverflow/useChipsOverflow.d.ts +1 -0
  23. package/hooks/useChipsOverflow/useChipsOverflow.d.ts.map +1 -1
  24. package/hooks/useChipsOverflow/useChipsOverflow.js +44 -42
  25. package/index.js +783 -781
  26. package/package.json +6 -6
@@ -3,9 +3,9 @@ import { getTypographyStyles as p } from "../../utils/getTypographyStyles.js";
3
3
  import { BUTTON_CLASSES as c } from "../extended/mui/Button/constants.js";
4
4
  import { SWITCH_CLASSES as n } from "../extended/mui/Switch/constants.js";
5
5
  import { CHECKABLE_LIST_CLASSES as o } from "../CheckableList/constants.js";
6
- import { DEVICES_PICKER_WIDTH as d, DEVICES_PICKER_PANEL_WIDTH as g, DEVICES_PICKER_PANEL_LIST_HEIGHT as t, DEVICES_PICKER_SKELETON as b, DEVICES_PICKER_SELECTED_LIST_WIDTH as v, DEVICES_PICKER_CLASSES as s } from "./constants.js";
7
- import { getSizeStyles as a } from "../../utils/getSizeStyles/getSizeStyles.js";
8
- const m = {
6
+ import { DEVICES_PICKER_WIDTH as d, DEVICES_PICKER_CARD_MAX_WIDTH as g, DEVICES_PICKER_CARD_MIN_HEIGHT as v, DEVICES_PICKER_PANEL_WIDTH as b, DEVICES_PICKER_PANEL_LIST_HEIGHT as t, DEVICES_PICKER_SKELETON as S, DEVICES_PICKER_SELECTED_LIST_WIDTH as f, DEVICES_PICKER_CLASSES as a } from "./constants.js";
7
+ import { getSizeStyles as s } from "../../utils/getSizeStyles/getSizeStyles.js";
8
+ const y = {
9
9
  /**
10
10
  * root: Full-width wrapper. The overflow measurement reads its width, so it
11
11
  * must not depend on how many cards are currently painted.
@@ -51,7 +51,14 @@ const m = {
51
51
  */
52
52
  deviceCardWrapper: () => ({
53
53
  display: "inline-flex",
54
- flexShrink: 0
54
+ flexShrink: 0,
55
+ // Un alias largo se comía el renglón entero y dejaba a las demás cards
56
+ // reducidas a su icono, así que aquí se topa y el texto trunca.
57
+ maxWidth: g,
58
+ [`& .${a.deviceCard}`]: {
59
+ maxWidth: "100%",
60
+ minWidth: 0
61
+ }
55
62
  }),
56
63
  /**
57
64
  * measuringLayer: Holds the cards whose width is still unknown. It is taken
@@ -75,7 +82,7 @@ const m = {
75
82
  display: "inline-flex",
76
83
  flexShrink: 1,
77
84
  minWidth: 0,
78
- [`& .${s.deviceCard}`]: {
85
+ [`& .${a.deviceCard}`]: {
79
86
  flexShrink: 1,
80
87
  minWidth: 0
81
88
  }
@@ -88,8 +95,8 @@ const m = {
88
95
  cardsContainer: ({ theme: e }) => ({
89
96
  display: "flex",
90
97
  alignItems: "center",
91
- // Abraza las cards en lugar de estirarse: si se estira, el +N se va al
92
- // borde y deja un hueco que parece sitio libre sin serlo.
98
+ // Abraza las cards: el hueco que sobre queda entre ellas y el +N, que se
99
+ // ancla a la derecha junto al chevron.
93
100
  flex: "0 1 auto",
94
101
  minWidth: 0,
95
102
  overflow: "hidden",
@@ -116,7 +123,7 @@ const m = {
116
123
  padding: e.vars.size.baseSpacings.sp1,
117
124
  borderRadius: e.vars.size.borderRadius.r2,
118
125
  backgroundColor: e.vars.palette.chips.default.contained.backgroundColor,
119
- ...a(e, "medium", "container", (i) => ({
126
+ ...s(e, "medium", "container", (i) => ({
120
127
  width: i,
121
128
  height: i
122
129
  }))
@@ -135,6 +142,13 @@ const m = {
135
142
  */
136
143
  overflowToggle: ({ theme: e, ownerState: i }) => ({
137
144
  flexShrink: 0,
145
+ // Vive con el chevron, en el extremo derecho del trigger, no pegado a la
146
+ // última card. El chevron cede su propio margen automático: con dos, flex
147
+ // reparte el sobrante entre ambos y el +N se queda a medio camino.
148
+ marginLeft: "auto",
149
+ [`& + .${a.chevronButton}`]: {
150
+ marginLeft: 0
151
+ },
138
152
  alignSelf: "stretch",
139
153
  height: "auto",
140
154
  "&&": {
@@ -176,6 +190,7 @@ const m = {
176
190
  alignItems: "center",
177
191
  flexShrink: 0,
178
192
  width: "auto",
193
+ minHeight: v,
179
194
  gap: e.vars.size.baseSpacings["sp1-5"],
180
195
  padding: `${e.vars.size.baseSpacings.sp1} ${e.vars.size.baseSpacings["sp1-5"]}`
181
196
  }),
@@ -188,7 +203,7 @@ const m = {
188
203
  justifyContent: "center",
189
204
  flexShrink: 0,
190
205
  borderRadius: e.vars.size.borderRadius.r1,
191
- ...a(e, "medium", "container", (i) => ({
206
+ ...s(e, "medium", "container", (i) => ({
192
207
  width: i,
193
208
  height: i
194
209
  }))
@@ -228,7 +243,7 @@ const m = {
228
243
  */
229
244
  deviceCardRemove: ({ theme: e, ownerState: i }) => ({
230
245
  flexShrink: 0,
231
- ...a(e, i?.size || "medium", "base", (r) => ({
246
+ ...s(e, i?.size || "medium", "base", (r) => ({
232
247
  width: r,
233
248
  height: r
234
249
  }))
@@ -238,7 +253,7 @@ const m = {
238
253
  * the height follows the content and the list scrolls inside.
239
254
  */
240
255
  panel: ({ theme: e }) => ({
241
- width: g,
256
+ width: b,
242
257
  display: "flex",
243
258
  flexDirection: "column",
244
259
  borderRadius: e.vars.size.borderRadius.r3,
@@ -383,7 +398,7 @@ const m = {
383
398
  * toggle. It is the only way to reach the cards that do not fit.
384
399
  */
385
400
  selectedList: ({ theme: e }) => ({
386
- width: v,
401
+ width: f,
387
402
  display: "flex",
388
403
  flexDirection: "column",
389
404
  borderRadius: e.vars.size.borderRadius.r3,
@@ -428,9 +443,9 @@ const m = {
428
443
  padding: e.vars.size.baseSpacings.sp2,
429
444
  // Aquí sí hay sitio para el texto entero: el recorte es cosa del trigger,
430
445
  // donde la card compite por el ancho de la fila.
431
- [`&& .${s.deviceCardName},
432
- && .${s.deviceCardSubtitle},
433
- && .${s.deviceCardId}`]: {
446
+ [`&& .${a.deviceCardName},
447
+ && .${a.deviceCardSubtitle},
448
+ && .${a.deviceCardId}`]: {
434
449
  whiteSpace: "normal",
435
450
  overflowWrap: "anywhere",
436
451
  textOverflow: "clip"
@@ -456,7 +471,7 @@ const m = {
456
471
  "&&.MuiSkeleton-root": {
457
472
  borderRadius: e.vars.size.borderRadius.r2,
458
473
  backgroundColor: e.vars.palette.skeleton.default,
459
- ...a(e, i?.size || "medium", "container", (r) => ({
474
+ ...s(e, i?.size || "medium", "container", (r) => ({
460
475
  width: r,
461
476
  height: r
462
477
  }))
@@ -469,7 +484,7 @@ const m = {
469
484
  skeletonLine: ({ theme: e }) => ({
470
485
  flexShrink: 0,
471
486
  "&&.MuiSkeleton-root": {
472
- width: b.textLineWidth,
487
+ width: S.textLineWidth,
473
488
  height: e.vars.size.baseSpacings["sp2-5"],
474
489
  borderRadius: e.vars.size.borderRadius.r4,
475
490
  backgroundColor: e.vars.palette.skeleton.default
@@ -483,7 +498,7 @@ const m = {
483
498
  "&&.MuiSkeleton-root": {
484
499
  borderRadius: e.vars.size.borderRadius.r4,
485
500
  backgroundColor: e.vars.palette.skeleton.default,
486
- ...a(e, i?.size || "medium", "base", (r) => ({
501
+ ...s(e, i?.size || "medium", "base", (r) => ({
487
502
  width: r,
488
503
  height: r
489
504
  }))
@@ -491,5 +506,5 @@ const m = {
491
506
  })
492
507
  };
493
508
  export {
494
- m as devicesPickerStyles
509
+ y as devicesPickerStyles
495
510
  };
@@ -67,8 +67,19 @@ export declare const DEVICES_PICKER_SKELETON: {
67
67
  */
68
68
  export declare const DEVICES_PICKER_ASYNC_ONLY_KEYS: readonly ["endPoint", "timeout", "parms", "resultField", "isRemote", "isExternalUrl", "responseToCamelCase", "shouldFetch"];
69
69
  /**
70
- * Placeholder shown when a device has no subtitle, so every card keeps the
71
- * same height.
70
+ * Fixed height of a selected device card, so a device without a plate keeps
71
+ * the same height as one with it. Taken from the master's three-line Item.
72
72
  */
73
- export declare const DEVICES_PICKER_EMPTY_VALUE = "--";
73
+ export declare const DEVICES_PICKER_CARD_MIN_HEIGHT = 56;
74
+ /**
75
+ * Widest a selected device card can get inside the trigger. The card that does
76
+ * not fit whole is excluded: it already truncates against the leftover space.
77
+ */
78
+ export declare const DEVICES_PICKER_CARD_MAX_WIDTH = 200;
79
+ /**
80
+ * Narrowest the card that does not fit whole may get before it stops being
81
+ * painted: below this it only shows the icon and the remove action, which
82
+ * identifies no device. It is reported by the +N toggle instead.
83
+ */
84
+ export declare const DEVICES_PICKER_PARTIAL_CARD_MIN_WIDTH = 150;
74
85
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DevicesPicker/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,2pBAGlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAQxC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YAAY,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB;IACpC,0EAA0E;;IAE1E,uDAAuD;;IAEvD,wDAAwD;;CAEhD,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;IAClC,sEAAsE;;CAE9D,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,8BAA8B,6HASjC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DevicesPicker/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,2pBAGlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAQxC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,YAAY,CAAC;AAEzD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB;IACpC,0EAA0E;;IAE1E,uDAAuD;;IAEvD,wDAAwD;;CAEhD,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;IAClC,sEAAsE;;CAE9D,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,8BAA8B,6HASjC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,MAAM,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { getComponentClasses as E } from "../../utils/getComponentSlotRoot.js";
2
2
  import { DevicesPickerSlots as _ } from "./slots/DevicesPickerEnum.js";
3
- const I = "M4LDevicesPicker", e = E(
3
+ const I = "M4LDevicesPicker", o = E(
4
4
  I,
5
5
  _
6
- ), o = 440, s = 31, S = 320, n = 320, D = 320, P = "default", c = {
6
+ ), s = 440, e = 31, D = 320, S = 320, n = 320, P = "default", R = {
7
7
  /** Name + plate: bodyStandard (16.5) + microSlim (15) + 12 of padding. */
8
8
  twoLines: 44,
9
9
  /** Name + plate + id: adds a second microSlim line. */
10
10
  threeLines: 60,
11
11
  /** Collapsible group header, a single bodyDens line. */
12
12
  group: 36
13
- }, i = {
13
+ }, c = {
14
14
  /** Ghost text bar width, taken from the master's Skeleton variant. */
15
15
  textLineWidth: 140
16
16
  }, K = [
@@ -22,18 +22,20 @@ const I = "M4LDevicesPicker", e = E(
22
22
  "isExternalUrl",
23
23
  "responseToCamelCase",
24
24
  "shouldFetch"
25
- ], R = "--";
25
+ ], T = 56, i = 200, r = 150;
26
26
  export {
27
27
  K as DEVICES_PICKER_ASYNC_ONLY_KEYS,
28
- e as DEVICES_PICKER_CLASSES,
28
+ i as DEVICES_PICKER_CARD_MAX_WIDTH,
29
+ T as DEVICES_PICKER_CARD_MIN_HEIGHT,
30
+ o as DEVICES_PICKER_CLASSES,
29
31
  P as DEVICES_PICKER_DEFAULT_GROUP_ID,
30
- R as DEVICES_PICKER_EMPTY_VALUE,
31
- s as DEVICES_PICKER_ICON_SIZE,
32
+ e as DEVICES_PICKER_ICON_SIZE,
32
33
  I as DEVICES_PICKER_KEY_COMPONENT,
33
- D as DEVICES_PICKER_PANEL_LIST_HEIGHT,
34
- S as DEVICES_PICKER_PANEL_WIDTH,
35
- c as DEVICES_PICKER_ROW_HEIGHT,
36
- n as DEVICES_PICKER_SELECTED_LIST_WIDTH,
37
- i as DEVICES_PICKER_SKELETON,
38
- o as DEVICES_PICKER_WIDTH
34
+ n as DEVICES_PICKER_PANEL_LIST_HEIGHT,
35
+ D as DEVICES_PICKER_PANEL_WIDTH,
36
+ r as DEVICES_PICKER_PARTIAL_CARD_MIN_WIDTH,
37
+ R as DEVICES_PICKER_ROW_HEIGHT,
38
+ S as DEVICES_PICKER_SELECTED_LIST_WIDTH,
39
+ c as DEVICES_PICKER_SKELETON,
40
+ s as DEVICES_PICKER_WIDTH
39
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceCard.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDAuEhD"}
1
+ {"version":3,"file":"DeviceCard.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,oDAyEhD"}
@@ -1,49 +1,49 @@
1
- import { jsxs as t, jsx as a } from "@emotion/react/jsx-runtime";
1
+ import { jsxs as r, jsx as a } from "@emotion/react/jsx-runtime";
2
2
  import { ActionsCloseSmOutlined as p } from "@m4l/icons";
3
- import { DEVICES_PICKER_CLASSES as e, DEVICES_PICKER_EMPTY_VALUE as y } from "../../constants.js";
4
- import { DeviceCardStyled as D, DeviceCardIconStyled as I, DeviceCardContentStyled as u, DeviceCardNameStyled as E, DeviceCardSubtitleStyled as N, DeviceCardIdStyled as h, DeviceCardRemoveStyled as x } from "../../slots/DevicesPickerSlots.js";
5
- function _(r) {
3
+ import { DEVICES_PICKER_CLASSES as e } from "../../constants.js";
4
+ import { DeviceCardStyled as y, DeviceCardIconStyled as u, DeviceCardContentStyled as D, DeviceCardNameStyled as I, DeviceCardSubtitleStyled as N, DeviceCardIdStyled as h, DeviceCardRemoveStyled as x } from "../../slots/DevicesPickerSlots.js";
5
+ function P(c) {
6
6
  const {
7
- name: c,
8
- subtitle: o,
7
+ name: o,
8
+ subtitle: d,
9
9
  deviceId: l,
10
- icon: d,
10
+ icon: t,
11
11
  disableRemove: s = !1,
12
12
  onRemove: n,
13
13
  dataTestid: i,
14
14
  variant: m = "outlined",
15
15
  ...v
16
- } = r, C = (S) => {
16
+ } = c, C = (S) => {
17
17
  S.stopPropagation(), n?.();
18
18
  };
19
- return /* @__PURE__ */ t(
20
- D,
19
+ return /* @__PURE__ */ r(
20
+ y,
21
21
  {
22
22
  ...v,
23
23
  variant: m,
24
24
  className: e.deviceCard,
25
25
  "data-testid": i,
26
26
  children: [
27
- d && /* @__PURE__ */ a(I, { className: e.deviceCardIcon, children: d }),
28
- /* @__PURE__ */ t(u, { className: e.deviceCardContent, children: [
27
+ t && /* @__PURE__ */ a(u, { className: e.deviceCardIcon, children: t }),
28
+ /* @__PURE__ */ r(D, { className: e.deviceCardContent, children: [
29
29
  /* @__PURE__ */ a(
30
- E,
30
+ I,
31
31
  {
32
32
  className: e.deviceCardName,
33
33
  variant: "bodyStandard",
34
34
  color: "text.primary",
35
35
  ellipsis: !0,
36
- children: c
36
+ children: o
37
37
  }
38
38
  ),
39
- /* @__PURE__ */ a(
39
+ d && /* @__PURE__ */ a(
40
40
  N,
41
41
  {
42
42
  className: e.deviceCardSubtitle,
43
43
  variant: "microSlim",
44
44
  color: "text.secondary",
45
45
  ellipsis: !0,
46
- children: o || y
46
+ children: d
47
47
  }
48
48
  ),
49
49
  /* @__PURE__ */ a(
@@ -73,5 +73,5 @@ function _(r) {
73
73
  );
74
74
  }
75
75
  export {
76
- _ as DeviceCard
76
+ P as DeviceCard
77
77
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DevicesPanel.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,oDA0IpD"}
1
+ {"version":3,"file":"DevicesPanel.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,oDAgJpD"}
@@ -1,35 +1,35 @@
1
- import { jsxs as r, Fragment as v, jsx as t } from "@emotion/react/jsx-runtime";
1
+ import { jsxs as r, Fragment as $, jsx as t } from "@emotion/react/jsx-runtime";
2
2
  import { useMemo as f, useCallback as p } from "react";
3
- import { useModuleDictionary as x } from "@m4l/core";
4
- import { DEVICES_PICKER_CLASSES as e, DEVICES_PICKER_EMPTY_VALUE as A, DEVICES_PICKER_ROW_HEIGHT as c } from "../../constants.js";
3
+ import { useModuleDictionary as E } from "@m4l/core";
4
+ import { DEVICES_PICKER_CLASSES as e, DEVICES_PICKER_ROW_HEIGHT as c } from "../../constants.js";
5
5
  import { DICCTIONARY as m } from "../../dictionary.js";
6
- import { RowNameStyled as H, RowSubtitleStyled as $, RowIdStyled as G, GroupRowStyled as T, GroupLabelStyled as V, GroupBadgeStyled as k, PanelStyled as B, PanelHeaderStyled as K, PanelSwitchStyled as u, PanelListStyled as M } from "../../slots/DevicesPickerSlots.js";
7
- function W(S) {
6
+ import { RowNameStyled as x, RowSubtitleStyled as H, RowIdStyled as A, GroupRowStyled as G, GroupLabelStyled as T, GroupBadgeStyled as k, PanelStyled as B, PanelHeaderStyled as j, PanelSwitchStyled as u, PanelListStyled as K } from "../../slots/DevicesPickerSlots.js";
7
+ function Y(S) {
8
8
  const {
9
- groups: n,
10
- items: d,
9
+ groups: d,
10
+ items: n,
11
11
  selectedIds: g,
12
12
  onSelectionChange: b,
13
13
  multiple: w,
14
- loading: I = !1,
15
- searchable: y = !0,
14
+ loading: y = !1,
15
+ searchable: I = !0,
16
16
  onSearchChange: C,
17
17
  size: s = "medium",
18
18
  showDepartments: h,
19
19
  showIds: o,
20
- canShowDepartments: _,
21
- canShowIds: D,
22
- onToggleDepartments: E,
23
- onToggleIds: R
24
- } = S, { getLabel: i } = x(), P = f(
25
- () => n?.reduce((a, l) => a + l.items.length, 0) ?? d?.length ?? 0,
26
- [n, d]
20
+ canShowDepartments: D,
21
+ canShowIds: R,
22
+ onToggleDepartments: _,
23
+ onToggleIds: N
24
+ } = S, { getLabel: i } = E(), v = f(
25
+ () => d?.reduce((a, l) => a + l.items.length, 0) ?? n?.length ?? 0,
26
+ [d, n]
27
27
  ), L = p(
28
28
  ({ item: a }) => {
29
29
  const l = a.metadata?.subtitle;
30
- return /* @__PURE__ */ r(v, { children: [
30
+ return /* @__PURE__ */ r($, { children: [
31
31
  /* @__PURE__ */ t(
32
- H,
32
+ x,
33
33
  {
34
34
  "data-testid": `${e.rowName}-${a.id}`,
35
35
  variant: "bodyStandard",
@@ -37,9 +37,17 @@ function W(S) {
37
37
  children: a.label
38
38
  }
39
39
  ),
40
- /* @__PURE__ */ t($, { variant: "microSlim", color: "text.secondary", children: l || A }),
40
+ l && /* @__PURE__ */ t(
41
+ H,
42
+ {
43
+ "data-testid": `${e.rowSubtitle}-${a.id}`,
44
+ variant: "microSlim",
45
+ color: "text.secondary",
46
+ children: l
47
+ }
48
+ ),
41
49
  o && /* @__PURE__ */ t(
42
- G,
50
+ A,
43
51
  {
44
52
  "data-testid": `${e.rowId}-${a.id}`,
45
53
  variant: "microSlim",
@@ -50,9 +58,9 @@ function W(S) {
50
58
  ] });
51
59
  },
52
60
  [o]
53
- ), N = p(
54
- ({ group: a, totalCount: l }) => /* @__PURE__ */ r(T, { className: e.groupRow, children: [
55
- /* @__PURE__ */ t(V, { variant: "captionDens", children: a.label }),
61
+ ), P = p(
62
+ ({ group: a, totalCount: l }) => /* @__PURE__ */ r(G, { className: e.groupRow, children: [
63
+ /* @__PURE__ */ t(T, { variant: "captionDens", children: a.label }),
56
64
  /* @__PURE__ */ t(
57
65
  k,
58
66
  {
@@ -68,7 +76,7 @@ function W(S) {
68
76
  );
69
77
  return /* @__PURE__ */ r(B, { className: e.panel, "data-testid": e.panel, children: [
70
78
  /* @__PURE__ */ r(
71
- K,
79
+ j,
72
80
  {
73
81
  className: e.panelHeader,
74
82
  "data-testid": e.panelHeader,
@@ -81,8 +89,8 @@ function W(S) {
81
89
  labelPlacement: "start",
82
90
  size: s,
83
91
  checked: h,
84
- disabled: !_,
85
- onChange: E
92
+ disabled: !D,
93
+ onChange: _
86
94
  }
87
95
  ),
88
96
  /* @__PURE__ */ t(
@@ -93,41 +101,41 @@ function W(S) {
93
101
  labelPlacement: "start",
94
102
  size: s,
95
103
  checked: o,
96
- disabled: !D,
97
- onChange: R
104
+ disabled: !R,
105
+ onChange: N
98
106
  }
99
107
  )
100
108
  ]
101
109
  }
102
110
  ),
103
111
  /* @__PURE__ */ t(
104
- M,
112
+ K,
105
113
  {
106
114
  className: e.panelList,
107
115
  "data-testid": e.panelList,
108
- groups: n,
109
- items: d,
116
+ groups: d,
117
+ items: n,
110
118
  value: g,
111
119
  onChange: b,
112
120
  multiple: w,
113
- loading: I,
114
- searchable: y,
121
+ loading: y,
122
+ searchable: I,
115
123
  onSearchChange: C,
116
124
  size: s,
117
125
  width: "100%",
118
126
  measureImmediately: !0,
119
127
  selectAll: h,
120
128
  selectAllLabel: i(m.label_select_all),
121
- selectAllCount: P,
129
+ selectAllCount: v,
122
130
  itemRowHeight: o ? c.threeLines : c.twoLines,
123
131
  groupRowHeight: c.group,
124
132
  expandAllGroups: !0,
125
133
  renderItem: L,
126
- renderGroup: N
134
+ renderGroup: P
127
135
  }
128
136
  )
129
137
  ] });
130
138
  }
131
139
  export {
132
- W as DevicesPanel
140
+ Y as DevicesPanel
133
141
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CardsView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/CardsView/CardsView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAMzC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,2DAyO/C"}
1
+ {"version":3,"file":"CardsView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/CardsView/CardsView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUzC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,2DAyO/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,GAAG,EAEJ,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiJ5C,eAAO,MAAM,YAAY,EAAwC,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EACnH,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAA;CAAE,KAC1F,GAAG,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,GAAG,EAEJ,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAoJ5C,eAAO,MAAM,YAAY,EAAwC,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EACnH,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAA;CAAE,KAC1F,GAAG,CAAC,OAAO,CAAC"}
@@ -2,13 +2,13 @@ import { jsx as o } from "@emotion/react/jsx-runtime";
2
2
  import { forwardRef as K, useCallback as i } from "react";
3
3
  import { useAutocomplete as j } from "./hooks/useAutocomplete/useAutocomplete.js";
4
4
  import { AUTOCOMPLETE_CLASSES as B } from "./constants.js";
5
- import F from "clsx";
6
- import { PopperComponent as U } from "./subcomponents/PopperComponent/PopperComponent.js";
7
- import { PaperComponent as _ } from "./subcomponents/PaperComponent/PaperComponent.js";
8
- import { SkeletonAutocompleteStyled as v, AutocompleteRootStyled as G } from "./slots/AutocompleteSlots.js";
9
- import { NoOptionsText as H } from "./subcomponents/NoOptionsText/NoOptionsText.js";
10
- import { LoadingText as J } from "./subcomponents/LoadingText/LoadingText.js";
11
- function Q(l, d) {
5
+ import U from "clsx";
6
+ import { PopperComponent as _ } from "./subcomponents/PopperComponent/PopperComponent.js";
7
+ import { PaperComponent as v } from "./subcomponents/PaperComponent/PaperComponent.js";
8
+ import { SkeletonAutocompleteStyled as G, AutocompleteRootStyled as H } from "./slots/AutocompleteSlots.js";
9
+ import { NoOptionsText as J } from "./subcomponents/NoOptionsText/NoOptionsText.js";
10
+ import { LoadingText as Q } from "./subcomponents/LoadingText/LoadingText.js";
11
+ function X(l, d) {
12
12
  const {
13
13
  options: f,
14
14
  disabled: C,
@@ -18,86 +18,88 @@ function Q(l, d) {
18
18
  multiple: m,
19
19
  className: O,
20
20
  menuMinWidth: h,
21
- minWidth: g
21
+ minWidth: g,
22
+ htmlFor: P
22
23
  } = l, {
23
24
  // useAutocomplete values
24
25
  ownerState: t,
25
- isSkeleton: P,
26
- memoizedRenderOption: S,
27
- memoizedRenderInput: T,
26
+ isSkeleton: S,
27
+ memoizedRenderOption: T,
28
+ memoizedRenderInput: V,
28
29
  // useValuesAndHandlers values
29
- open: V,
30
- selectedValue: w,
31
- inputValue: x,
32
- isOptionEqualToValueLocal: A,
33
- handleChange: z,
34
- handleInputChange: I,
35
- onCloseLocal: y,
36
- onOpenLocal: E,
30
+ open: w,
31
+ selectedValue: x,
32
+ inputValue: A,
33
+ isOptionEqualToValueLocal: z,
34
+ handleChange: I,
35
+ handleInputChange: y,
36
+ onCloseLocal: E,
37
+ onOpenLocal: M,
37
38
  getOptionLabelLocal: n,
38
- checkKeyDown: M,
39
+ checkKeyDown: R,
39
40
  scrollPositionOptionsRef: s
40
- } = j(l), u = h ?? g, R = i((e) => /* @__PURE__ */ o(
41
- U,
41
+ } = j(l), u = h ?? g, k = i((e) => /* @__PURE__ */ o(
42
+ _,
42
43
  {
43
44
  ...e,
44
45
  currentSize: t.size,
45
46
  menuMinWidth: u
46
47
  }
47
- ), [t.size, u]), k = i((e) => /* @__PURE__ */ o(
48
- _,
48
+ ), [t.size, u]), W = i((e) => /* @__PURE__ */ o(
49
+ v,
49
50
  {
50
51
  ...e,
51
52
  scrollPositionOptionsRef: s
52
53
  }
53
- ), [s]), W = i((e, b) => {
54
+ ), [s]), b = i((e, D) => {
54
55
  if (p)
55
56
  return e;
56
- const r = b.inputValue.trim().toLowerCase();
57
+ const r = D.inputValue.trim().toLowerCase();
57
58
  return r ? e.filter((c) => {
58
- const D = c, N = n(c).toLowerCase(), q = a?.(D)?.toLowerCase() ?? "";
59
- return N.includes(r) || q.includes(r);
59
+ const N = c, q = n(c).toLowerCase(), F = a?.(N)?.toLowerCase() ?? "";
60
+ return q.includes(r) || F.includes(r);
60
61
  }) : e;
61
62
  }, [a, n, p]);
62
- return P ? /* @__PURE__ */ o(
63
- v,
63
+ return S ? /* @__PURE__ */ o(
64
+ G,
64
65
  {
65
66
  ownerState: t
66
67
  }
67
68
  ) : /* @__PURE__ */ o(
68
- G,
69
+ H,
69
70
  {
70
71
  ownerState: t,
72
+ id: P,
71
73
  multiple: m,
72
- onKeyDown: M,
74
+ onKeyDown: R,
73
75
  ref: d,
74
76
  forcePopupIcon: !1,
75
- className: F(O, m && B.multiple),
77
+ className: U(O, m && B.multiple),
76
78
  autoSelect: !1,
77
79
  options: f,
78
80
  getOptionLabel: n,
79
81
  clearOnBlur: !1,
80
- PopperComponent: R,
81
- PaperComponent: k,
82
- isOptionEqualToValue: A,
83
- value: w,
84
- inputValue: x,
85
- onOpen: E,
86
- onClose: y,
87
- open: V,
88
- onInputChange: I,
89
- onChange: z,
82
+ PopperComponent: k,
83
+ PaperComponent: W,
84
+ isOptionEqualToValue: z,
85
+ value: x,
86
+ inputValue: A,
87
+ onOpen: M,
88
+ onClose: E,
89
+ open: w,
90
+ onInputChange: y,
91
+ onChange: I,
90
92
  loading: L,
91
- loadingText: /* @__PURE__ */ o(J, {}),
93
+ loadingText: /* @__PURE__ */ o(Q, {}),
92
94
  disabled: C,
93
- noOptionsText: /* @__PURE__ */ o(H, {}),
94
- filterOptions: W,
95
- renderOption: S,
96
- renderInput: T
95
+ noOptionsText: /* @__PURE__ */ o(J, {}),
96
+ filterOptions: b,
97
+ renderOption: T,
98
+ renderInput: V
97
99
  }
98
100
  );
99
101
  }
100
- const le = K(Q);
102
+ const pe = K(X);
101
103
  export {
102
- le as Autocomplete
104
+ pe as Autocomplete
103
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUxE;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC;;;;wCAqFrD,GAAG,UAAU,GAAG;kCA0BtB,GAAG;;;;;;;;;;;;;;;;EA0ErD"}
1
+ {"version":3,"file":"useAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUxE;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAAE,QAAQ,CAAC;;;;wCAoFrD,GAAG,UAAU,GAAG;kCA4BtB,GAAG;;;;;;;;;;;;;;;;EAyErD"}