@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.
- package/components/DevicesPicker/DevicesPicker.d.ts.map +1 -1
- package/components/DevicesPicker/DevicesPicker.js +214 -213
- package/components/DevicesPicker/DevicesPicker.styles.d.ts.map +1 -1
- package/components/DevicesPicker/DevicesPicker.styles.js +34 -19
- package/components/DevicesPicker/constants.d.ts +14 -3
- package/components/DevicesPicker/constants.d.ts.map +1 -1
- package/components/DevicesPicker/constants.js +15 -13
- package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts.map +1 -1
- package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.js +17 -17
- package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.d.ts.map +1 -1
- package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.js +44 -36
- package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/Autocomplete.js +52 -50
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +58 -60
- package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.d.ts +14 -0
- package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.d.ts.map +1 -0
- package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.js +7 -0
- package/hooks/useChipsOverflow/helpers/index.d.ts +1 -0
- package/hooks/useChipsOverflow/helpers/index.d.ts.map +1 -1
- package/hooks/useChipsOverflow/useChipsOverflow.d.ts +1 -0
- package/hooks/useChipsOverflow/useChipsOverflow.d.ts.map +1 -1
- package/hooks/useChipsOverflow/useChipsOverflow.js +44 -42
- package/index.js +783 -781
- 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,
|
|
7
|
-
import { getSizeStyles as
|
|
8
|
-
const
|
|
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
|
-
[`& .${
|
|
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
|
|
92
|
-
//
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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:
|
|
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:
|
|
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
|
-
[`&& .${
|
|
432
|
-
&& .${
|
|
433
|
-
&& .${
|
|
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
|
-
...
|
|
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:
|
|
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
|
-
...
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
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,
|
|
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",
|
|
3
|
+
const I = "M4LDevicesPicker", o = E(
|
|
4
4
|
I,
|
|
5
5
|
_
|
|
6
|
-
),
|
|
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
|
-
},
|
|
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
|
-
],
|
|
25
|
+
], T = 56, i = 200, r = 150;
|
|
26
26
|
export {
|
|
27
27
|
K as DEVICES_PICKER_ASYNC_ONLY_KEYS,
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
s as DEVICES_PICKER_ICON_SIZE,
|
|
32
|
+
e as DEVICES_PICKER_ICON_SIZE,
|
|
32
33
|
I as DEVICES_PICKER_KEY_COMPONENT,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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,
|
|
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
|
|
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
|
|
4
|
-
import { DeviceCardStyled as
|
|
5
|
-
function
|
|
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:
|
|
8
|
-
subtitle:
|
|
7
|
+
name: o,
|
|
8
|
+
subtitle: d,
|
|
9
9
|
deviceId: l,
|
|
10
|
-
icon:
|
|
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
|
-
} =
|
|
16
|
+
} = c, C = (S) => {
|
|
17
17
|
S.stopPropagation(), n?.();
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
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
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
t && /* @__PURE__ */ a(u, { className: e.deviceCardIcon, children: t }),
|
|
28
|
+
/* @__PURE__ */ r(D, { className: e.deviceCardContent, children: [
|
|
29
29
|
/* @__PURE__ */ a(
|
|
30
|
-
|
|
30
|
+
I,
|
|
31
31
|
{
|
|
32
32
|
className: e.deviceCardName,
|
|
33
33
|
variant: "bodyStandard",
|
|
34
34
|
color: "text.primary",
|
|
35
35
|
ellipsis: !0,
|
|
36
|
-
children:
|
|
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:
|
|
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
|
-
|
|
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":"
|
|
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
|
|
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
|
|
4
|
-
import { DEVICES_PICKER_CLASSES as e,
|
|
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
|
|
7
|
-
function
|
|
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:
|
|
10
|
-
items:
|
|
9
|
+
groups: d,
|
|
10
|
+
items: n,
|
|
11
11
|
selectedIds: g,
|
|
12
12
|
onSelectionChange: b,
|
|
13
13
|
multiple: w,
|
|
14
|
-
loading:
|
|
15
|
-
searchable:
|
|
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:
|
|
22
|
-
onToggleDepartments:
|
|
23
|
-
onToggleIds:
|
|
24
|
-
} = S, { getLabel: i } =
|
|
25
|
-
() =>
|
|
26
|
-
[
|
|
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(
|
|
30
|
+
return /* @__PURE__ */ r($, { children: [
|
|
31
31
|
/* @__PURE__ */ t(
|
|
32
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
),
|
|
54
|
-
({ group: a, totalCount: l }) => /* @__PURE__ */ r(
|
|
55
|
-
/* @__PURE__ */ t(
|
|
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
|
-
|
|
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:
|
|
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: !
|
|
97
|
-
onChange:
|
|
104
|
+
disabled: !R,
|
|
105
|
+
onChange: N
|
|
98
106
|
}
|
|
99
107
|
)
|
|
100
108
|
]
|
|
101
109
|
}
|
|
102
110
|
),
|
|
103
111
|
/* @__PURE__ */ t(
|
|
104
|
-
|
|
112
|
+
K,
|
|
105
113
|
{
|
|
106
114
|
className: e.panelList,
|
|
107
115
|
"data-testid": e.panelList,
|
|
108
|
-
groups:
|
|
109
|
-
items:
|
|
116
|
+
groups: d,
|
|
117
|
+
items: n,
|
|
110
118
|
value: g,
|
|
111
119
|
onChange: b,
|
|
112
120
|
multiple: w,
|
|
113
|
-
loading:
|
|
114
|
-
searchable:
|
|
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:
|
|
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:
|
|
134
|
+
renderGroup: P
|
|
127
135
|
}
|
|
128
136
|
)
|
|
129
137
|
] });
|
|
130
138
|
}
|
|
131
139
|
export {
|
|
132
|
-
|
|
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;
|
|
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;
|
|
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
|
|
6
|
-
import { PopperComponent as
|
|
7
|
-
import { PaperComponent as
|
|
8
|
-
import { SkeletonAutocompleteStyled as
|
|
9
|
-
import { NoOptionsText as
|
|
10
|
-
import { LoadingText as
|
|
11
|
-
function
|
|
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:
|
|
26
|
-
memoizedRenderOption:
|
|
27
|
-
memoizedRenderInput:
|
|
26
|
+
isSkeleton: S,
|
|
27
|
+
memoizedRenderOption: T,
|
|
28
|
+
memoizedRenderInput: V,
|
|
28
29
|
// useValuesAndHandlers values
|
|
29
|
-
open:
|
|
30
|
-
selectedValue:
|
|
31
|
-
inputValue:
|
|
32
|
-
isOptionEqualToValueLocal:
|
|
33
|
-
handleChange:
|
|
34
|
-
handleInputChange:
|
|
35
|
-
onCloseLocal:
|
|
36
|
-
onOpenLocal:
|
|
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:
|
|
39
|
+
checkKeyDown: R,
|
|
39
40
|
scrollPositionOptionsRef: s
|
|
40
|
-
} = j(l), u = h ?? g,
|
|
41
|
-
|
|
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]),
|
|
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]),
|
|
54
|
+
), [s]), b = i((e, D) => {
|
|
54
55
|
if (p)
|
|
55
56
|
return e;
|
|
56
|
-
const r =
|
|
57
|
+
const r = D.inputValue.trim().toLowerCase();
|
|
57
58
|
return r ? e.filter((c) => {
|
|
58
|
-
const
|
|
59
|
-
return
|
|
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
|
|
63
|
-
|
|
63
|
+
return S ? /* @__PURE__ */ o(
|
|
64
|
+
G,
|
|
64
65
|
{
|
|
65
66
|
ownerState: t
|
|
66
67
|
}
|
|
67
68
|
) : /* @__PURE__ */ o(
|
|
68
|
-
|
|
69
|
+
H,
|
|
69
70
|
{
|
|
70
71
|
ownerState: t,
|
|
72
|
+
id: P,
|
|
71
73
|
multiple: m,
|
|
72
|
-
onKeyDown:
|
|
74
|
+
onKeyDown: R,
|
|
73
75
|
ref: d,
|
|
74
76
|
forcePopupIcon: !1,
|
|
75
|
-
className:
|
|
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:
|
|
81
|
-
PaperComponent:
|
|
82
|
-
isOptionEqualToValue:
|
|
83
|
-
value:
|
|
84
|
-
inputValue:
|
|
85
|
-
onOpen:
|
|
86
|
-
onClose:
|
|
87
|
-
open:
|
|
88
|
-
onInputChange:
|
|
89
|
-
onChange:
|
|
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(
|
|
93
|
+
loadingText: /* @__PURE__ */ o(Q, {}),
|
|
92
94
|
disabled: C,
|
|
93
|
-
noOptionsText: /* @__PURE__ */ o(
|
|
94
|
-
filterOptions:
|
|
95
|
-
renderOption:
|
|
96
|
-
renderInput:
|
|
95
|
+
noOptionsText: /* @__PURE__ */ o(J, {}),
|
|
96
|
+
filterOptions: b,
|
|
97
|
+
renderOption: T,
|
|
98
|
+
renderInput: V
|
|
97
99
|
}
|
|
98
100
|
);
|
|
99
101
|
}
|
|
100
|
-
const
|
|
102
|
+
const pe = K(X);
|
|
101
103
|
export {
|
|
102
|
-
|
|
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;;;;
|
|
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"}
|