@m4l/components 9.54.2 → 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 (155) hide show
  1. package/@types/types.d.ts +8 -0
  2. package/components/CheckableList/CheckableList.d.ts.map +1 -1
  3. package/components/CheckableList/CheckableList.js +163 -143
  4. package/components/CheckableList/CheckableList.styles.d.ts.map +1 -1
  5. package/components/CheckableList/CheckableList.styles.js +20 -8
  6. package/components/CheckableList/constants.d.ts +1 -1
  7. package/components/CheckableList/constants.d.ts.map +1 -1
  8. package/components/CheckableList/hooks/useCheckableListRender.d.ts +6 -1
  9. package/components/CheckableList/hooks/useCheckableListRender.d.ts.map +1 -1
  10. package/components/CheckableList/hooks/useCheckableListRender.js +126 -113
  11. package/components/CheckableList/slots/slots.d.ts +1 -0
  12. package/components/CheckableList/slots/slots.d.ts.map +1 -1
  13. package/components/CheckableList/slots/slots.js +1 -1
  14. package/components/CheckableList/slots/styled.d.ts +3 -0
  15. package/components/CheckableList/slots/styled.d.ts.map +1 -1
  16. package/components/CheckableList/slots/styled.js +56 -51
  17. package/components/CheckableList/types.d.ts +20 -0
  18. package/components/CheckableList/types.d.ts.map +1 -1
  19. package/components/ColorPicker/ColorPicker.js +2 -2
  20. package/components/DateTimeRangePicker/DateTimeRangePicker.js +1 -1
  21. package/components/DevicesPicker/DevicesPicker.d.ts +14 -0
  22. package/components/DevicesPicker/DevicesPicker.d.ts.map +1 -0
  23. package/components/DevicesPicker/DevicesPicker.js +344 -0
  24. package/components/DevicesPicker/DevicesPicker.styles.d.ts +3 -0
  25. package/components/DevicesPicker/DevicesPicker.styles.d.ts.map +1 -0
  26. package/components/DevicesPicker/DevicesPicker.styles.js +510 -0
  27. package/components/DevicesPicker/constants.d.ts +85 -0
  28. package/components/DevicesPicker/constants.d.ts.map +1 -0
  29. package/components/DevicesPicker/constants.js +41 -0
  30. package/components/DevicesPicker/dictionary.d.ts +19 -0
  31. package/components/DevicesPicker/dictionary.d.ts.map +1 -0
  32. package/components/DevicesPicker/dictionary.js +20 -0
  33. package/components/DevicesPicker/helpers/resolveDeviceGroup.d.ts +11 -0
  34. package/components/DevicesPicker/helpers/resolveDeviceGroup.d.ts.map +1 -0
  35. package/components/DevicesPicker/helpers/resolveDeviceGroup.js +14 -0
  36. package/components/DevicesPicker/helpers/toDeviceArray.d.ts +7 -0
  37. package/components/DevicesPicker/helpers/toDeviceArray.d.ts.map +1 -0
  38. package/components/DevicesPicker/helpers/toDeviceArray.js +6 -0
  39. package/components/DevicesPicker/hooks/types.d.ts +176 -0
  40. package/components/DevicesPicker/hooks/types.d.ts.map +1 -0
  41. package/components/DevicesPicker/hooks/useDeviceGroups.d.ts +13 -0
  42. package/components/DevicesPicker/hooks/useDeviceGroups.d.ts.map +1 -0
  43. package/components/DevicesPicker/hooks/useDeviceGroups.js +51 -0
  44. package/components/DevicesPicker/hooks/useDevicesAsyncOptions.d.ts +13 -0
  45. package/components/DevicesPicker/hooks/useDevicesAsyncOptions.d.ts.map +1 -0
  46. package/components/DevicesPicker/hooks/useDevicesAsyncOptions.js +71 -0
  47. package/components/DevicesPicker/hooks/useDevicesSelection.d.ts +12 -0
  48. package/components/DevicesPicker/hooks/useDevicesSelection.d.ts.map +1 -0
  49. package/components/DevicesPicker/hooks/useDevicesSelection.js +26 -0
  50. package/components/DevicesPicker/hooks/usePanelColumns.d.ts +12 -0
  51. package/components/DevicesPicker/hooks/usePanelColumns.d.ts.map +1 -0
  52. package/components/DevicesPicker/hooks/usePanelColumns.js +30 -0
  53. package/components/DevicesPicker/index.d.ts +11 -0
  54. package/components/DevicesPicker/index.d.ts.map +1 -0
  55. package/components/DevicesPicker/slots/DevicesPickerEnum.d.ts +77 -0
  56. package/components/DevicesPicker/slots/DevicesPickerEnum.d.ts.map +1 -0
  57. package/components/DevicesPicker/slots/DevicesPickerEnum.js +4 -0
  58. package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts +112 -0
  59. package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts.map +1 -0
  60. package/components/DevicesPicker/slots/DevicesPickerSlots.js +163 -0
  61. package/components/DevicesPicker/slots/index.d.ts +3 -0
  62. package/components/DevicesPicker/slots/index.d.ts.map +1 -0
  63. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts +8 -0
  64. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts.map +1 -0
  65. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.js +77 -0
  66. package/components/DevicesPicker/subcomponents/DeviceCard/index.d.ts +3 -0
  67. package/components/DevicesPicker/subcomponents/DeviceCard/index.d.ts.map +1 -0
  68. package/components/DevicesPicker/subcomponents/DeviceCard/types.d.ts +42 -0
  69. package/components/DevicesPicker/subcomponents/DeviceCard/types.d.ts.map +1 -0
  70. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.d.ts +11 -0
  71. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.d.ts.map +1 -0
  72. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.js +141 -0
  73. package/components/DevicesPicker/subcomponents/DevicesPanel/index.d.ts +3 -0
  74. package/components/DevicesPicker/subcomponents/DevicesPanel/index.d.ts.map +1 -0
  75. package/components/DevicesPicker/subcomponents/DevicesPanel/types.d.ts +68 -0
  76. package/components/DevicesPicker/subcomponents/DevicesPanel/types.d.ts.map +1 -0
  77. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts +10 -0
  78. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts.map +1 -0
  79. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.js +35 -0
  80. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.d.ts +3 -0
  81. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.d.ts.map +1 -0
  82. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.d.ts +11 -0
  83. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.d.ts.map +1 -0
  84. package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts +11 -0
  85. package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts.map +1 -0
  86. package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.js +61 -0
  87. package/components/DevicesPicker/subcomponents/SelectedDevicesList/index.d.ts +3 -0
  88. package/components/DevicesPicker/subcomponents/SelectedDevicesList/index.d.ts.map +1 -0
  89. package/components/DevicesPicker/subcomponents/SelectedDevicesList/types.d.ts +32 -0
  90. package/components/DevicesPicker/subcomponents/SelectedDevicesList/types.d.ts.map +1 -0
  91. package/components/DevicesPicker/types.d.ts +171 -0
  92. package/components/DevicesPicker/types.d.ts.map +1 -0
  93. package/components/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  94. package/components/DynamicFilter/DynamicFilter.styles.js +41 -33
  95. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts +1 -1
  96. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.js +1 -1
  97. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.d.ts.map +1 -1
  98. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.js +24 -24
  99. package/components/DynamicFilter/types.d.ts +9 -1
  100. package/components/DynamicFilter/types.d.ts.map +1 -1
  101. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -1
  102. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +1 -1
  103. package/components/extended/mui/CheckBox/CheckBox.js +7 -7
  104. package/components/extended/mui/Select/Select.js +6 -6
  105. package/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.d.ts +21 -0
  106. package/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.d.ts.map +1 -0
  107. package/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.js +6 -0
  108. package/components/hook-form/RHFDevicesPicker/index.d.ts +3 -0
  109. package/components/hook-form/RHFDevicesPicker/index.d.ts.map +1 -0
  110. package/components/hook-form/RHFDevicesPicker/types.d.ts +8 -0
  111. package/components/hook-form/RHFDevicesPicker/types.d.ts.map +1 -0
  112. package/components/hook-form/index.d.ts +3 -0
  113. package/components/hook-form/index.d.ts.map +1 -1
  114. package/components/hook-form/renderAsRegistry.d.ts +33 -0
  115. package/components/hook-form/renderAsRegistry.d.ts.map +1 -0
  116. package/components/hook-form/renderAsRegistry.js +7 -0
  117. package/components/index.d.ts +1 -0
  118. package/components/index.d.ts.map +1 -1
  119. package/helpers/resolveDeviceIconSrc/constants.d.ts +14 -0
  120. package/helpers/resolveDeviceIconSrc/constants.d.ts.map +1 -0
  121. package/helpers/resolveDeviceIconSrc/constants.js +6 -0
  122. package/helpers/resolveDeviceIconSrc/index.d.ts +3 -0
  123. package/helpers/resolveDeviceIconSrc/index.d.ts.map +1 -0
  124. package/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.d.ts +14 -0
  125. package/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.d.ts.map +1 -0
  126. package/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.js +8 -0
  127. package/helpers/resolveDeviceLabels/index.d.ts +3 -0
  128. package/helpers/resolveDeviceLabels/index.d.ts.map +1 -0
  129. package/helpers/resolveDeviceLabels/resolveDeviceLabels.d.ts +22 -0
  130. package/helpers/resolveDeviceLabels/resolveDeviceLabels.d.ts.map +1 -0
  131. package/helpers/resolveDeviceLabels/resolveDeviceLabels.js +10 -0
  132. package/helpers/resolveDeviceLabels/types.d.ts +19 -0
  133. package/helpers/resolveDeviceLabels/types.d.ts.map +1 -0
  134. package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.d.ts +14 -0
  135. package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.d.ts.map +1 -0
  136. package/hooks/useChipsOverflow/helpers/calculateLeftoverWidth.js +7 -0
  137. package/hooks/useChipsOverflow/helpers/calculateVisibleChipsCount.d.ts.map +1 -0
  138. package/hooks/useChipsOverflow/helpers/index.d.ts +3 -0
  139. package/hooks/useChipsOverflow/helpers/index.d.ts.map +1 -0
  140. package/hooks/useChipsOverflow/index.d.ts +3 -0
  141. package/hooks/useChipsOverflow/index.d.ts.map +1 -0
  142. package/hooks/useChipsOverflow/types.d.ts +24 -0
  143. package/hooks/useChipsOverflow/types.d.ts.map +1 -0
  144. package/{components/DynamicFilter/hooks → hooks/useChipsOverflow}/useChipsOverflow.d.ts +7 -5
  145. package/hooks/useChipsOverflow/useChipsOverflow.d.ts.map +1 -0
  146. package/hooks/useChipsOverflow/useChipsOverflow.js +110 -0
  147. package/index.d.ts +2 -0
  148. package/index.d.ts.map +1 -1
  149. package/index.js +803 -757
  150. package/package.json +10 -10
  151. package/components/DynamicFilter/helpers/calculateVisibleChipsCount.d.ts.map +0 -1
  152. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +0 -1
  153. package/components/DynamicFilter/hooks/useChipsOverflow.js +0 -83
  154. /package/{components/DynamicFilter → hooks/useChipsOverflow}/helpers/calculateVisibleChipsCount.d.ts +0 -0
  155. /package/{components/DynamicFilter → hooks/useChipsOverflow}/helpers/calculateVisibleChipsCount.js +0 -0
@@ -0,0 +1,77 @@
1
+ import { jsxs as r, jsx as a } from "@emotion/react/jsx-runtime";
2
+ import { ActionsCloseSmOutlined as p } from "@m4l/icons";
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
+ const {
7
+ name: o,
8
+ subtitle: d,
9
+ deviceId: l,
10
+ icon: t,
11
+ disableRemove: s = !1,
12
+ onRemove: n,
13
+ dataTestid: i,
14
+ variant: m = "outlined",
15
+ ...v
16
+ } = c, C = (S) => {
17
+ S.stopPropagation(), n?.();
18
+ };
19
+ return /* @__PURE__ */ r(
20
+ y,
21
+ {
22
+ ...v,
23
+ variant: m,
24
+ className: e.deviceCard,
25
+ "data-testid": i,
26
+ children: [
27
+ t && /* @__PURE__ */ a(u, { className: e.deviceCardIcon, children: t }),
28
+ /* @__PURE__ */ r(D, { className: e.deviceCardContent, children: [
29
+ /* @__PURE__ */ a(
30
+ I,
31
+ {
32
+ className: e.deviceCardName,
33
+ variant: "bodyStandard",
34
+ color: "text.primary",
35
+ ellipsis: !0,
36
+ children: o
37
+ }
38
+ ),
39
+ d && /* @__PURE__ */ a(
40
+ N,
41
+ {
42
+ className: e.deviceCardSubtitle,
43
+ variant: "microSlim",
44
+ color: "text.secondary",
45
+ ellipsis: !0,
46
+ children: d
47
+ }
48
+ ),
49
+ /* @__PURE__ */ a(
50
+ h,
51
+ {
52
+ className: e.deviceCardId,
53
+ variant: "microSlim",
54
+ color: "text.secondary",
55
+ ellipsis: !0,
56
+ children: `ID ${l}`
57
+ }
58
+ )
59
+ ] }),
60
+ !s && /* @__PURE__ */ a(
61
+ x,
62
+ {
63
+ className: e.deviceCardRemove,
64
+ dataTestId: i ? `${i}-remove` : void 0,
65
+ icon: /* @__PURE__ */ a(p, {}),
66
+ variant: "text",
67
+ size: "small",
68
+ onClick: C
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ );
74
+ }
75
+ export {
76
+ P as DeviceCard
77
+ };
@@ -0,0 +1,3 @@
1
+ export * from './DeviceCard';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DeviceCard/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ import { CardProps } from '../../../Card/types';
3
+ /**
4
+ * Props of the DeviceCard subcomponent.
5
+ * Extends the system Card contract: the card is the Card itself, this
6
+ * subcomponent only fills its internal slot with the device content.
7
+ * `children` is omitted because that slot is owned by the card.
8
+ */
9
+ export interface DeviceCardProps extends Omit<CardProps, 'children'> {
10
+ /**
11
+ * Device name, rendered as the first line.
12
+ */
13
+ name: string;
14
+ /**
15
+ * Device plate, rendered as the second line when present.
16
+ */
17
+ subtitle?: string;
18
+ /**
19
+ * Device id, rendered as the third line.
20
+ * Named `deviceId` because `id` is already the DOM attribute inherited
21
+ * from the Card.
22
+ */
23
+ deviceId: string | number;
24
+ /**
25
+ * Icon rendered at the start of the card.
26
+ */
27
+ icon?: ReactNode;
28
+ /**
29
+ * Hides the remove action; used in single-selection contexts, where the
30
+ * selection is replaced instead of removed one by one.
31
+ */
32
+ disableRemove?: boolean;
33
+ /**
34
+ * Removes this device from the selection.
35
+ */
36
+ onRemove?: () => void;
37
+ /**
38
+ * Custom data-testid for testing purposes.
39
+ */
40
+ dataTestid?: string;
41
+ }
42
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DeviceCard/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAClE;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,11 @@
1
+ import { DevicesPanelProps } from './types';
2
+ /**
3
+ * Selection panel of the DevicesPicker.
4
+ *
5
+ * Holds the two column switches, the search field and the CheckableList.
6
+ * Rows and group headers are rendered through the CheckableList render props,
7
+ * which replace only the content area and keep its checkbox/radio and chevron
8
+ * in place — exactly the anatomy the design asks for.
9
+ */
10
+ export declare function DevicesPanel(props: DevicesPanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=DevicesPanel.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,141 @@
1
+ import { jsxs as r, Fragment as $, jsx as t } from "@emotion/react/jsx-runtime";
2
+ import { useMemo as f, useCallback as p } from "react";
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
+ import { DICCTIONARY as m } from "../../dictionary.js";
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
+ const {
9
+ groups: d,
10
+ items: n,
11
+ selectedIds: g,
12
+ onSelectionChange: b,
13
+ multiple: w,
14
+ loading: y = !1,
15
+ searchable: I = !0,
16
+ onSearchChange: C,
17
+ size: s = "medium",
18
+ showDepartments: h,
19
+ showIds: o,
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
+ ), L = p(
28
+ ({ item: a }) => {
29
+ const l = a.metadata?.subtitle;
30
+ return /* @__PURE__ */ r($, { children: [
31
+ /* @__PURE__ */ t(
32
+ x,
33
+ {
34
+ "data-testid": `${e.rowName}-${a.id}`,
35
+ variant: "bodyStandard",
36
+ color: "text.primary",
37
+ children: a.label
38
+ }
39
+ ),
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
+ ),
49
+ o && /* @__PURE__ */ t(
50
+ A,
51
+ {
52
+ "data-testid": `${e.rowId}-${a.id}`,
53
+ variant: "microSlim",
54
+ color: "text.secondary",
55
+ children: `ID: ${a.metadata?.deviceId ?? a.id}`
56
+ }
57
+ )
58
+ ] });
59
+ },
60
+ [o]
61
+ ), P = p(
62
+ ({ group: a, totalCount: l }) => /* @__PURE__ */ r(G, { className: e.groupRow, children: [
63
+ /* @__PURE__ */ t(T, { variant: "captionDens", children: a.label }),
64
+ /* @__PURE__ */ t(
65
+ k,
66
+ {
67
+ ownerState: { color: a.color },
68
+ className: e.groupBadge,
69
+ "data-testid": `${e.groupBadge}-${a.id}`,
70
+ variant: "bodyDens",
71
+ children: l
72
+ }
73
+ )
74
+ ] }),
75
+ []
76
+ );
77
+ return /* @__PURE__ */ r(B, { className: e.panel, "data-testid": e.panel, children: [
78
+ /* @__PURE__ */ r(
79
+ j,
80
+ {
81
+ className: e.panelHeader,
82
+ "data-testid": e.panelHeader,
83
+ children: [
84
+ /* @__PURE__ */ t(
85
+ u,
86
+ {
87
+ className: e.panelSwitch,
88
+ label: i(m.label_show_departments),
89
+ labelPlacement: "start",
90
+ size: s,
91
+ checked: h,
92
+ disabled: !D,
93
+ onChange: _
94
+ }
95
+ ),
96
+ /* @__PURE__ */ t(
97
+ u,
98
+ {
99
+ className: e.panelSwitch,
100
+ label: i(m.label_show_ids),
101
+ labelPlacement: "start",
102
+ size: s,
103
+ checked: o,
104
+ disabled: !R,
105
+ onChange: N
106
+ }
107
+ )
108
+ ]
109
+ }
110
+ ),
111
+ /* @__PURE__ */ t(
112
+ K,
113
+ {
114
+ className: e.panelList,
115
+ "data-testid": e.panelList,
116
+ groups: d,
117
+ items: n,
118
+ value: g,
119
+ onChange: b,
120
+ multiple: w,
121
+ loading: y,
122
+ searchable: I,
123
+ onSearchChange: C,
124
+ size: s,
125
+ width: "100%",
126
+ measureImmediately: !0,
127
+ selectAll: h,
128
+ selectAllLabel: i(m.label_select_all),
129
+ selectAllCount: v,
130
+ itemRowHeight: o ? c.threeLines : c.twoLines,
131
+ groupRowHeight: c.group,
132
+ expandAllGroups: !0,
133
+ renderItem: L,
134
+ renderGroup: P
135
+ }
136
+ )
137
+ ] });
138
+ }
139
+ export {
140
+ Y as DevicesPanel
141
+ };
@@ -0,0 +1,3 @@
1
+ export * from './DevicesPanel';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPanel/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ import { CheckableListGroup, CheckableListItem } from '../../../CheckableList/types';
3
+ /**
4
+ * Props of the DevicesPanel subcomponent.
5
+ */
6
+ export interface DevicesPanelProps {
7
+ /**
8
+ * Collapsible groups; undefined renders a flat list.
9
+ */
10
+ groups?: CheckableListGroup[];
11
+ /**
12
+ * Flat items; undefined when the list is grouped.
13
+ */
14
+ items?: CheckableListItem[];
15
+ /**
16
+ * Ids currently selected.
17
+ */
18
+ selectedIds: (string | number)[];
19
+ /**
20
+ * Reports the new selection.
21
+ */
22
+ onSelectionChange: (selectedIds: (string | number)[]) => void;
23
+ /**
24
+ * Multiple selection; drives checkbox versus radio in the rows.
25
+ */
26
+ multiple: boolean;
27
+ /**
28
+ * Devices are still loading.
29
+ */
30
+ loading?: boolean;
31
+ /**
32
+ * Renders the search field.
33
+ */
34
+ searchable?: boolean;
35
+ /**
36
+ * Forwards the search text so the picker can issue a remote query.
37
+ */
38
+ onSearchChange?: (query: string) => void;
39
+ /**
40
+ * Size of the panel controls.
41
+ */
42
+ size?: Extract<Sizes, 'small' | 'medium'>;
43
+ /**
44
+ * "Ver departamentos" switch is on.
45
+ */
46
+ showDepartments: boolean;
47
+ /**
48
+ * "Ver ID" switch is on.
49
+ */
50
+ showIds: boolean;
51
+ /**
52
+ * At least one device has a department, so the switch is offered.
53
+ */
54
+ canShowDepartments: boolean;
55
+ /**
56
+ * At least one device has an id, so the switch is offered.
57
+ */
58
+ canShowIds: boolean;
59
+ /**
60
+ * Toggles the "Ver departamentos" switch.
61
+ */
62
+ onToggleDepartments: () => void;
63
+ /**
64
+ * Toggles the "Ver ID" switch.
65
+ */
66
+ onToggleIds: () => void;
67
+ }
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPanel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAErF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B;;OAEG;IACH,WAAW,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC;;OAEG;IACH,iBAAiB,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IAC9D;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB"}
@@ -0,0 +1,10 @@
1
+ import { DevicesPickerSkeletonProps } from './types';
2
+ /**
3
+ * Loading state of the trigger.
4
+ *
5
+ * The master draws a single row — the icon box, one text bar and the chevron —
6
+ * with the same geometry as the placeholder, so the layout does not jump when
7
+ * the devices arrive. Nothing is interactive until there is data.
8
+ */
9
+ export declare function DevicesPickerSkeleton(props: DevicesPickerSkeletonProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=DevicesPickerSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevicesPickerSkeleton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,oDAwBtE"}
@@ -0,0 +1,35 @@
1
+ import { jsxs as a, jsx as n } from "@emotion/react/jsx-runtime";
2
+ import { DEVICES_PICKER_CLASSES as t } from "../../constants.js";
3
+ import { SkeletonCardStyled as l, SkeletonIconStyled as s, SkeletonLineStyled as c, SkeletonChevronStyled as i } from "../../slots/DevicesPickerSlots.js";
4
+ function d(r) {
5
+ const { size: o = "medium" } = r, e = { size: o };
6
+ return /* @__PURE__ */ a(l, { ownerState: e, className: t.skeletonCard, children: [
7
+ /* @__PURE__ */ n(
8
+ s,
9
+ {
10
+ ownerState: e,
11
+ className: t.skeletonIcon,
12
+ variant: "rectangular"
13
+ }
14
+ ),
15
+ /* @__PURE__ */ n(
16
+ c,
17
+ {
18
+ ownerState: e,
19
+ className: t.skeletonLine,
20
+ variant: "rectangular"
21
+ }
22
+ ),
23
+ /* @__PURE__ */ n(
24
+ i,
25
+ {
26
+ ownerState: e,
27
+ className: t.skeletonChevron,
28
+ variant: "rectangular"
29
+ }
30
+ )
31
+ ] });
32
+ }
33
+ export {
34
+ d as DevicesPickerSkeleton
35
+ };
@@ -0,0 +1,3 @@
1
+ export * from './DevicesPickerSkeleton';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ /**
3
+ * Props of the DevicesPickerSkeleton subcomponent.
4
+ */
5
+ export interface DevicesPickerSkeletonProps {
6
+ /**
7
+ * Size of the ghost elements, aligned with the picker size.
8
+ */
9
+ size?: Extract<Sizes, 'small' | 'medium'>;
10
+ }
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;CAC3C"}
@@ -0,0 +1,11 @@
1
+ import { DevicePickerOption } from '../../types';
2
+ import { SelectedDevicesListProps } from './types';
3
+ /**
4
+ * List of every selected device, opened from the +N toggle.
5
+ *
6
+ * It is the only way to reach the cards that do not fit in the trigger, so it
7
+ * always lists the whole selection — not just the hidden ones — and each row
8
+ * can be removed from here.
9
+ */
10
+ export declare function SelectedDevicesList<T extends DevicePickerOption = DevicePickerOption>(props: SelectedDevicesListProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=SelectedDevicesList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectedDevicesList.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EACnF,KAAK,EAAE,wBAAwB,CAAC,CAAC,CAAC,oDAsDnC"}
@@ -0,0 +1,61 @@
1
+ import { jsxs as s, jsx as i } from "@emotion/react/jsx-runtime";
2
+ import { Icon as p, Typography as L } from "@m4l/base";
3
+ import { useModuleDictionary as S } from "@m4l/core";
4
+ import { ConectivityDispositiveOutlined as y } from "@m4l/icons";
5
+ import { DEVICES_PICKER_CLASSES as e } from "../../constants.js";
6
+ import { DICCTIONARY as u } from "../../dictionary.js";
7
+ import { SelectedListStyled as I, SelectedListHeaderStyled as C, SelectedListTitleStyled as f, SelectedListCountStyled as D, SelectedListItemsStyled as b } from "../../slots/DevicesPickerSlots.js";
8
+ import { DeviceCard as h } from "../DeviceCard/DeviceCard.js";
9
+ function O(o) {
10
+ const {
11
+ devices: l,
12
+ getOptionLabel: r,
13
+ getDeviceSubtitle: c,
14
+ getDeviceIcon: d,
15
+ onRemove: a,
16
+ titleIcon: n
17
+ } = o, { getLabel: m } = S();
18
+ return /* @__PURE__ */ s(
19
+ I,
20
+ {
21
+ className: e.selectedList,
22
+ "data-testid": e.selectedList,
23
+ children: [
24
+ /* @__PURE__ */ s(C, { className: e.selectedListHeader, children: [
25
+ /* @__PURE__ */ s(f, { className: e.selectedListTitle, children: [
26
+ n ?? /* @__PURE__ */ i(p, { src: /* @__PURE__ */ i(y, {}), color: "text.secondary" }),
27
+ /* @__PURE__ */ i(L, { variant: "bodyStandard", color: "text.secondary", ellipsis: !0, children: m(u.label_selected_title) })
28
+ ] }),
29
+ /* @__PURE__ */ i(
30
+ D,
31
+ {
32
+ className: e.selectedListCount,
33
+ "data-testid": e.selectedListCount,
34
+ label: `${l.length}`,
35
+ color: "primary",
36
+ variant: "contained",
37
+ size: "small",
38
+ opacity: !0
39
+ }
40
+ )
41
+ ] }),
42
+ /* @__PURE__ */ i(b, { className: e.selectedListItems, children: l.map((t) => /* @__PURE__ */ i(
43
+ h,
44
+ {
45
+ deviceId: t.id,
46
+ name: r(t),
47
+ subtitle: c(t),
48
+ icon: d?.(t),
49
+ variant: "text",
50
+ onRemove: () => a(t),
51
+ dataTestid: `${e.selectedListItems}-${t.id}`
52
+ },
53
+ t.id
54
+ )) })
55
+ ]
56
+ }
57
+ );
58
+ }
59
+ export {
60
+ O as SelectedDevicesList
61
+ };
@@ -0,0 +1,3 @@
1
+ export * from './SelectedDevicesList';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/SelectedDevicesList/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from 'react';
2
+ import { DevicePickerOption } from '../../types';
3
+ /**
4
+ * Props of the SelectedDevicesList subcomponent.
5
+ */
6
+ export interface SelectedDevicesListProps<T = DevicePickerOption> {
7
+ /**
8
+ * Devices currently selected, including the ones hidden in the trigger.
9
+ */
10
+ devices: T[];
11
+ /**
12
+ * Resolves the first line of each row.
13
+ */
14
+ getOptionLabel: (option: T) => string;
15
+ /**
16
+ * Resolves the second line of each row.
17
+ */
18
+ getDeviceSubtitle: (option: T) => string | undefined;
19
+ /**
20
+ * Resolves the icon of each row.
21
+ */
22
+ getDeviceIcon?: (option: T) => ReactNode;
23
+ /**
24
+ * Removes one device from the selection.
25
+ */
26
+ onRemove: (device: T) => void;
27
+ /**
28
+ * Icon rendered at the start of the header, before the title.
29
+ */
30
+ titleIcon?: ReactNode;
31
+ }
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/DevicesPicker/subcomponents/SelectedDevicesList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC,GAAG,kBAAkB;IAC9D;;OAEG;IACH,OAAO,EAAE,CAAC,EAAE,CAAC;IACb;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;IACtC;;OAEG;IACH,iBAAiB,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,CAAC;IACrD;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,SAAS,CAAC;IACzC;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB"}