@m4l/components 9.54.2-beta-m4lcom-764-device-picker.0 → 9.54.2

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 (157) hide show
  1. package/@types/types.d.ts +0 -8
  2. package/components/CheckableList/CheckableList.d.ts.map +1 -1
  3. package/components/CheckableList/CheckableList.js +143 -163
  4. package/components/CheckableList/CheckableList.styles.d.ts.map +1 -1
  5. package/components/CheckableList/CheckableList.styles.js +8 -20
  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 +1 -6
  9. package/components/CheckableList/hooks/useCheckableListRender.d.ts.map +1 -1
  10. package/components/CheckableList/hooks/useCheckableListRender.js +113 -126
  11. package/components/CheckableList/slots/slots.d.ts +0 -1
  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 +0 -3
  15. package/components/CheckableList/slots/styled.d.ts.map +1 -1
  16. package/components/CheckableList/slots/styled.js +51 -56
  17. package/components/CheckableList/types.d.ts +0 -20
  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/DynamicFilter/DynamicFilter.styles.d.ts.map +1 -1
  22. package/components/DynamicFilter/DynamicFilter.styles.js +33 -41
  23. package/components/DynamicFilter/helpers/calculateVisibleChipsCount.d.ts.map +1 -0
  24. package/{hooks/useChipsOverflow → components/DynamicFilter/hooks}/useChipsOverflow.d.ts +5 -6
  25. package/components/DynamicFilter/hooks/useChipsOverflow.d.ts.map +1 -0
  26. package/components/DynamicFilter/hooks/useChipsOverflow.js +83 -0
  27. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.d.ts +1 -1
  28. package/components/DynamicFilter/subcomponents/AppliedFilters/useAppliedFilters.js +1 -1
  29. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.d.ts.map +1 -1
  30. package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.js +24 -24
  31. package/components/DynamicFilter/types.d.ts +1 -9
  32. package/components/DynamicFilter/types.d.ts.map +1 -1
  33. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.d.ts +1 -1
  34. package/components/DynamicSort/subcomponents/AppliedSorts/useAppliedSorts.js +1 -1
  35. package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
  36. package/components/extended/mui/Autocomplete/Autocomplete.d.ts.map +1 -1
  37. package/components/extended/mui/Autocomplete/Autocomplete.js +52 -50
  38. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts.map +1 -1
  39. package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.js +58 -60
  40. package/components/extended/mui/CheckBox/CheckBox.js +7 -7
  41. package/components/extended/mui/Select/Select.js +6 -6
  42. package/components/hook-form/index.d.ts +0 -3
  43. package/components/hook-form/index.d.ts.map +1 -1
  44. package/components/index.d.ts +0 -1
  45. package/components/index.d.ts.map +1 -1
  46. package/index.d.ts +0 -2
  47. package/index.d.ts.map +1 -1
  48. package/index.js +760 -804
  49. package/package.json +8 -8
  50. package/components/DevicesPicker/DevicesPicker.d.ts +0 -14
  51. package/components/DevicesPicker/DevicesPicker.d.ts.map +0 -1
  52. package/components/DevicesPicker/DevicesPicker.js +0 -343
  53. package/components/DevicesPicker/DevicesPicker.styles.d.ts +0 -3
  54. package/components/DevicesPicker/DevicesPicker.styles.d.ts.map +0 -1
  55. package/components/DevicesPicker/DevicesPicker.styles.js +0 -494
  56. package/components/DevicesPicker/constants.d.ts +0 -74
  57. package/components/DevicesPicker/constants.d.ts.map +0 -1
  58. package/components/DevicesPicker/constants.js +0 -39
  59. package/components/DevicesPicker/dictionary.d.ts +0 -19
  60. package/components/DevicesPicker/dictionary.d.ts.map +0 -1
  61. package/components/DevicesPicker/dictionary.js +0 -20
  62. package/components/DevicesPicker/helpers/resolveDeviceGroup.d.ts +0 -11
  63. package/components/DevicesPicker/helpers/resolveDeviceGroup.d.ts.map +0 -1
  64. package/components/DevicesPicker/helpers/resolveDeviceGroup.js +0 -14
  65. package/components/DevicesPicker/helpers/toDeviceArray.d.ts +0 -7
  66. package/components/DevicesPicker/helpers/toDeviceArray.d.ts.map +0 -1
  67. package/components/DevicesPicker/helpers/toDeviceArray.js +0 -6
  68. package/components/DevicesPicker/hooks/types.d.ts +0 -176
  69. package/components/DevicesPicker/hooks/types.d.ts.map +0 -1
  70. package/components/DevicesPicker/hooks/useDeviceGroups.d.ts +0 -13
  71. package/components/DevicesPicker/hooks/useDeviceGroups.d.ts.map +0 -1
  72. package/components/DevicesPicker/hooks/useDeviceGroups.js +0 -51
  73. package/components/DevicesPicker/hooks/useDevicesAsyncOptions.d.ts +0 -13
  74. package/components/DevicesPicker/hooks/useDevicesAsyncOptions.d.ts.map +0 -1
  75. package/components/DevicesPicker/hooks/useDevicesAsyncOptions.js +0 -71
  76. package/components/DevicesPicker/hooks/useDevicesSelection.d.ts +0 -12
  77. package/components/DevicesPicker/hooks/useDevicesSelection.d.ts.map +0 -1
  78. package/components/DevicesPicker/hooks/useDevicesSelection.js +0 -26
  79. package/components/DevicesPicker/hooks/usePanelColumns.d.ts +0 -12
  80. package/components/DevicesPicker/hooks/usePanelColumns.d.ts.map +0 -1
  81. package/components/DevicesPicker/hooks/usePanelColumns.js +0 -30
  82. package/components/DevicesPicker/index.d.ts +0 -11
  83. package/components/DevicesPicker/index.d.ts.map +0 -1
  84. package/components/DevicesPicker/slots/DevicesPickerEnum.d.ts +0 -77
  85. package/components/DevicesPicker/slots/DevicesPickerEnum.d.ts.map +0 -1
  86. package/components/DevicesPicker/slots/DevicesPickerEnum.js +0 -4
  87. package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts +0 -112
  88. package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts.map +0 -1
  89. package/components/DevicesPicker/slots/DevicesPickerSlots.js +0 -163
  90. package/components/DevicesPicker/slots/index.d.ts +0 -3
  91. package/components/DevicesPicker/slots/index.d.ts.map +0 -1
  92. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts +0 -8
  93. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts.map +0 -1
  94. package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.js +0 -77
  95. package/components/DevicesPicker/subcomponents/DeviceCard/index.d.ts +0 -3
  96. package/components/DevicesPicker/subcomponents/DeviceCard/index.d.ts.map +0 -1
  97. package/components/DevicesPicker/subcomponents/DeviceCard/types.d.ts +0 -42
  98. package/components/DevicesPicker/subcomponents/DeviceCard/types.d.ts.map +0 -1
  99. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.d.ts +0 -11
  100. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.d.ts.map +0 -1
  101. package/components/DevicesPicker/subcomponents/DevicesPanel/DevicesPanel.js +0 -133
  102. package/components/DevicesPicker/subcomponents/DevicesPanel/index.d.ts +0 -3
  103. package/components/DevicesPicker/subcomponents/DevicesPanel/index.d.ts.map +0 -1
  104. package/components/DevicesPicker/subcomponents/DevicesPanel/types.d.ts +0 -68
  105. package/components/DevicesPicker/subcomponents/DevicesPanel/types.d.ts.map +0 -1
  106. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts +0 -10
  107. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts.map +0 -1
  108. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.js +0 -35
  109. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.d.ts +0 -3
  110. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.d.ts.map +0 -1
  111. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.d.ts +0 -11
  112. package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.d.ts.map +0 -1
  113. package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts +0 -11
  114. package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts.map +0 -1
  115. package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.js +0 -61
  116. package/components/DevicesPicker/subcomponents/SelectedDevicesList/index.d.ts +0 -3
  117. package/components/DevicesPicker/subcomponents/SelectedDevicesList/index.d.ts.map +0 -1
  118. package/components/DevicesPicker/subcomponents/SelectedDevicesList/types.d.ts +0 -32
  119. package/components/DevicesPicker/subcomponents/SelectedDevicesList/types.d.ts.map +0 -1
  120. package/components/DevicesPicker/types.d.ts +0 -170
  121. package/components/DevicesPicker/types.d.ts.map +0 -1
  122. package/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.d.ts +0 -21
  123. package/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.d.ts.map +0 -1
  124. package/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.js +0 -6
  125. package/components/hook-form/RHFDevicesPicker/index.d.ts +0 -3
  126. package/components/hook-form/RHFDevicesPicker/index.d.ts.map +0 -1
  127. package/components/hook-form/RHFDevicesPicker/types.d.ts +0 -8
  128. package/components/hook-form/RHFDevicesPicker/types.d.ts.map +0 -1
  129. package/components/hook-form/renderAsRegistry.d.ts +0 -33
  130. package/components/hook-form/renderAsRegistry.d.ts.map +0 -1
  131. package/components/hook-form/renderAsRegistry.js +0 -7
  132. package/helpers/resolveDeviceIconSrc/constants.d.ts +0 -14
  133. package/helpers/resolveDeviceIconSrc/constants.d.ts.map +0 -1
  134. package/helpers/resolveDeviceIconSrc/constants.js +0 -6
  135. package/helpers/resolveDeviceIconSrc/index.d.ts +0 -3
  136. package/helpers/resolveDeviceIconSrc/index.d.ts.map +0 -1
  137. package/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.d.ts +0 -14
  138. package/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.d.ts.map +0 -1
  139. package/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.js +0 -8
  140. package/helpers/resolveDeviceLabels/index.d.ts +0 -3
  141. package/helpers/resolveDeviceLabels/index.d.ts.map +0 -1
  142. package/helpers/resolveDeviceLabels/resolveDeviceLabels.d.ts +0 -22
  143. package/helpers/resolveDeviceLabels/resolveDeviceLabels.d.ts.map +0 -1
  144. package/helpers/resolveDeviceLabels/resolveDeviceLabels.js +0 -10
  145. package/helpers/resolveDeviceLabels/types.d.ts +0 -18
  146. package/helpers/resolveDeviceLabels/types.d.ts.map +0 -1
  147. package/hooks/useChipsOverflow/helpers/calculateVisibleChipsCount.d.ts.map +0 -1
  148. package/hooks/useChipsOverflow/helpers/index.d.ts +0 -2
  149. package/hooks/useChipsOverflow/helpers/index.d.ts.map +0 -1
  150. package/hooks/useChipsOverflow/index.d.ts +0 -3
  151. package/hooks/useChipsOverflow/index.d.ts.map +0 -1
  152. package/hooks/useChipsOverflow/types.d.ts +0 -24
  153. package/hooks/useChipsOverflow/types.d.ts.map +0 -1
  154. package/hooks/useChipsOverflow/useChipsOverflow.d.ts.map +0 -1
  155. package/hooks/useChipsOverflow/useChipsOverflow.js +0 -108
  156. /package/{hooks/useChipsOverflow → components/DynamicFilter}/helpers/calculateVisibleChipsCount.d.ts +0 -0
  157. /package/{hooks/useChipsOverflow → components/DynamicFilter}/helpers/calculateVisibleChipsCount.js +0 -0
@@ -1,170 +0,0 @@
1
- import { Theme } from '@mui/material/styles';
2
- import { ReactNode } from 'react';
3
- import { Sizes } from '@m4l/styles';
4
- import { HexColor } from '@m4l/graphics';
5
- import { M4LOverridesStyleRules } from '../../@types/augmentations';
6
- import { AutocompleteAsyncProps } from '../extended/mui/AutocompleteAsync/types';
7
- import { DEVICES_PICKER_KEY_COMPONENT } from './constants';
8
- import { DevicesPickerSlots } from './slots/DevicesPickerEnum';
9
- /**
10
- * Props inherited from AutocompleteAsync that only make sense for its text
11
- * `<input>`. The DevicesPicker has no text input in the trigger (the search
12
- * field lives inside the panel), so they are removed from the public contract:
13
- * passing them must fail at compile time instead of being silently ignored.
14
- */
15
- export type DevicesPickerInputOnlyProps = 'readOnly' | 'startAdornment' | 'endAdornment' | 'autoCapitalize' | 'autoComplete' | 'type' | 'htmlFor' | 'menuMinWidth' | 'minWidth' | 'variant' | 'refresh' | 'onChangeFilterParmsLocal' | 'getOptionUrlImage' | 'getOptionStartAdornment' | 'getOptionEndAdornment' | 'getOptionDescription';
16
- /**
17
- * Department shape returned by the devices endpoints that expose it as an
18
- * object (same contract the geofences assignment already consumes).
19
- */
20
- export interface DevicePickerDepartment {
21
- /**
22
- * Unique identifier of the department.
23
- */
24
- id: string | number;
25
- /**
26
- * Department name, used as the group header label.
27
- */
28
- name: string;
29
- /**
30
- * Department color, painted on the group count badge.
31
- */
32
- color?: HexColor;
33
- }
34
- /**
35
- * Group a device belongs to, as resolved by `getDeviceGroup`.
36
- */
37
- export interface DevicePickerGroupRef {
38
- /**
39
- * Unique identifier of the group.
40
- */
41
- id: string | number;
42
- /**
43
- * Label rendered on the group header.
44
- */
45
- label: string;
46
- /**
47
- * Color painted on the group count badge.
48
- */
49
- color?: HexColor;
50
- }
51
- /**
52
- * Minimal shape the picker needs from a device option.
53
- * Every field is reachable through an accessor prop, so consumers are not
54
- * forced into this exact shape.
55
- */
56
- export interface DevicePickerOption {
57
- /**
58
- * Unique identifier of the device.
59
- */
60
- id: string | number;
61
- /**
62
- * Device name, rendered as the second line, or as the first one when the
63
- * device carries no alias.
64
- */
65
- name?: string;
66
- /**
67
- * Device plate/alias. When present it owns the first line.
68
- */
69
- alias?: string | null;
70
- /**
71
- * Department the device belongs to; drives the grouping.
72
- * Accepted both as a plain name and as an object, because the devices
73
- * endpoints in the workspace expose it in either shape.
74
- */
75
- department?: string | DevicePickerDepartment | null;
76
- /**
77
- * Icon reference returned by the backend.
78
- */
79
- deviceIcon?: {
80
- /**
81
- * Icon identifier used to build the asset url.
82
- */
83
- iconId?: string;
84
- };
85
- }
86
- /**
87
- * Props of the DevicesPicker component.
88
- * Extends the AutocompleteAsync contract so the async engine (endPoint, parms,
89
- * resultField, isRemote, shouldFetch...) is declared once and stays in sync.
90
- */
91
- export interface DevicesPickerProps<T = DevicePickerOption> extends Omit<AutocompleteAsyncProps<T>, DevicesPickerInputOnlyProps> {
92
- /**
93
- * Visibility of the +N overflow toggle (Figma `Show+`).
94
- * Disable it only when the container guarantees room for every card.
95
- */
96
- showOverflowToggle?: boolean;
97
- /**
98
- * "Ver departamentos" switch: groups the list and shows the "Todos" row.
99
- * Omitted means derived from the data.
100
- */
101
- showDepartments?: boolean;
102
- /**
103
- * "Ver ID" switch: shows the id line on every row.
104
- * Omitted means derived from the data.
105
- */
106
- showIds?: boolean;
107
- /**
108
- * Renders the search field inside the panel.
109
- */
110
- searchable?: boolean;
111
- /**
112
- * Text shown in the trigger while there is no selection.
113
- */
114
- placeholder?: string;
115
- /**
116
- * Resolves the group of an option; null falls into the default group.
117
- */
118
- getDeviceGroup?: (option: T) => DevicePickerGroupRef | null;
119
- /**
120
- * Resolves the second line of the card and of the row; defaults to the
121
- * device name once the alias took the first line.
122
- */
123
- getDeviceSubtitle?: (option: T) => string;
124
- /**
125
- * Resolves the icon rendered on the card and on the row.
126
- */
127
- getDeviceIcon?: (option: T) => ReactNode;
128
- }
129
- /**
130
- * Owner state shared by the DevicesPicker slots for styling purposes.
131
- */
132
- export interface DevicesPickerOwnerState extends Record<string, unknown> {
133
- /**
134
- * Size of the component.
135
- */
136
- size?: Extract<Sizes, 'small' | 'medium'>;
137
- /**
138
- * Selection panel is open; adds the primary stroke to the trigger.
139
- */
140
- panelOpen?: boolean;
141
- /**
142
- * Selected-devices list is open.
143
- */
144
- listOpen?: boolean;
145
- /**
146
- * Validation failed; paints the trigger stroke with the error token.
147
- */
148
- error?: boolean;
149
- /**
150
- * Whole picker is disabled.
151
- */
152
- disabled?: boolean;
153
- /**
154
- * Devices are still loading; renders the tokenized skeleton.
155
- */
156
- loading?: boolean;
157
- /**
158
- * There is at least one selected device.
159
- */
160
- hasSelection?: boolean;
161
- }
162
- /**
163
- * Slot names available for the DevicesPicker.
164
- */
165
- export type DevicesPickerSlotsType = keyof typeof DevicesPickerSlots;
166
- /**
167
- * Styles applicable to the DevicesPicker through theme overrides and slots.
168
- */
169
- export type DevicesPickerStyles = M4LOverridesStyleRules<DevicesPickerSlotsType, typeof DEVICES_PICKER_KEY_COMPONENT, Theme>;
170
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/DevicesPicker/types.ts"],"names":[],"mappings":"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"}
@@ -1,21 +0,0 @@
1
- import { Ref } from 'react';
2
- import { DevicePickerOption } from '../../DevicesPicker/types';
3
- import { RHFDevicesPickerProps } from './types';
4
- /**
5
- * RHFDevicesPicker: device selector integrated with react-hook-form.
6
- * Wraps DevicesPicker with the same HOC as RHFAutocompleteAsync, so form
7
- * state, label and error message behave identically.
8
- * @example
9
- * ```tsx
10
- * <RHFDevicesPicker
11
- * name="devices"
12
- * label="Dispositivos"
13
- * endPoint="devices"
14
- * multiple
15
- * />
16
- * ```
17
- */
18
- export declare const RHFDevicesPicker: <T = DevicePickerOption>(props: RHFDevicesPickerProps<T> & {
19
- ref?: Ref<HTMLDivElement>;
20
- }) => JSX.Element;
21
- //# sourceMappingURL=RHFDevicesPicker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RHFDevicesPicker.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFDevicesPicker/RHFDevicesPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIrD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,EAAsC,CACjE,CAAC,GAAG,kBAAkB,EAEtB,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B,KACE,GAAG,CAAC,OAAO,CAAC"}
@@ -1,6 +0,0 @@
1
- import { withRHFController as e } from "../../../hocs/withRHFController/index.js";
2
- import { DevicesPicker as r } from "../../DevicesPicker/DevicesPicker.js";
3
- const i = e(r), t = i;
4
- export {
5
- t as RHFDevicesPicker
6
- };
@@ -1,3 +0,0 @@
1
- export { RHFDevicesPicker } from './RHFDevicesPicker';
2
- export type { RHFDevicesPickerProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFDevicesPicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,8 +0,0 @@
1
- import { BaseRHFProps } from '../../../hocs/withRHFController/types';
2
- import { DevicePickerOption, DevicesPickerProps } from '../../DevicesPicker/types';
3
- /**
4
- * Props for RHFDevicesPicker (DevicesPicker wrapped with withRHFController).
5
- * value and onChange are injected by the HOC from the form state.
6
- */
7
- export type RHFDevicesPickerProps<T = DevicePickerOption> = BaseRHFProps & Omit<DevicesPickerProps<T>, 'value' | 'onChange'>;
8
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/hook-form/RHFDevicesPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,kBAAkB,IAAI,YAAY,GACtE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Home of the `renderAs` catalogs. Each catalog is named after the component
3
- * its entries stand in for, so a file holding several of them still says which
4
- * one substitutes what.
5
- *
6
- * Every catalog follows the same rule: the consumer resolves the entry it needs
7
- * and hands the component over already resolved
8
- * (`renderAs: RHF_AUTOCOMPLETE_ASYNC_RENDER_AS_REGISTRY.devices`). No generic
9
- * component reads a catalog, so neither `RHFAutocompleteAsync` nor the
10
- * `DynamicFilter` learns about devices or any other domain a picker may belong
11
- * to.
12
- *
13
- * Once a second catalog needs its own pickers, split this file into one module
14
- * per catalog: sharing a module would make importing one catalog pull in the
15
- * components of all the others.
16
- */
17
- /**
18
- * Components that can be rendered in place of `RHFAutocompleteAsync`.
19
- * To belong here a component must accept `RHFAutocompleteAsyncProps` and be
20
- * already wired to react-hook-form, which is what the `RHF` prefix states.
21
- *
22
- * Adding a picker means adding one entry here; nothing downstream changes.
23
- */
24
- export declare const RHF_AUTOCOMPLETE_ASYNC_RENDER_AS_REGISTRY: {
25
- readonly devices: <T = import('..').DevicePickerOption>(props: import('./RHFDevicesPicker').RHFDevicesPickerProps<T> & {
26
- ref?: import('react').Ref<HTMLDivElement>;
27
- }) => JSX.Element;
28
- };
29
- /**
30
- * Keys of the `RHFAutocompleteAsync` picker catalog.
31
- */
32
- export type RHFAutocompleteAsyncRenderAsKey = keyof typeof RHF_AUTOCOMPLETE_ASYNC_RENDER_AS_REGISTRY;
33
- //# sourceMappingURL=renderAsRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderAsRegistry.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/hook-form/renderAsRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC;;WANhD,CAAC;;CAQG,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACzC,MAAM,OAAO,yCAAyC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { RHFDevicesPicker as e } from "./RHFDevicesPicker/RHFDevicesPicker.js";
2
- const E = {
3
- devices: e
4
- };
5
- export {
6
- E as RHF_AUTOCOMPLETE_ASYNC_RENDER_AS_REGISTRY
7
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * Backend route that serves a graphic resource by its id, appended to
3
- * `hostApiRemote`. Exported on its own so a future icon family reuses the
4
- * endpoint contract instead of re-declaring the path.
5
- */
6
- export declare const DEVICE_ICONS_PATH = "/main/na/icons/";
7
- /**
8
- * Variant suffix the backend expects for the 3D vehicle artwork. The devices
9
- * endpoint publishes the bare id and every consumer appends the variant.
10
- */
11
- export declare const DEVICE_ICON_VARIANT_SUFFIX = "_3d_white";
12
- /** Used for devices that arrive with no icon id. */
13
- export declare const DEVICE_FALLBACK_ICON_ID = "i_common_devices_type_sedan";
14
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/helpers/resolveDeviceIconSrc/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,gCAAgC,CAAC"}
@@ -1,6 +0,0 @@
1
- const _ = "/main/na/icons/", I = "_3d_white", n = "i_common_devices_type_sedan";
2
- export {
3
- n as DEVICE_FALLBACK_ICON_ID,
4
- _ as DEVICE_ICONS_PATH,
5
- I as DEVICE_ICON_VARIANT_SUFFIX
6
- };
@@ -1,3 +0,0 @@
1
- export { resolveDeviceIconSrc } from './resolveDeviceIconSrc';
2
- export { DEVICE_FALLBACK_ICON_ID, DEVICE_ICONS_PATH, DEVICE_ICON_VARIANT_SUFFIX, } from './constants';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/helpers/resolveDeviceIconSrc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,aAAa,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Build the url of a device artwork, asking the backend for the icon id it
3
- * published in `deviceIcon.iconId`.
4
- *
5
- * This is the single place that owns the device-icon contract: the endpoint
6
- * path, the artwork variant and the fallback id. Every surface that paints a
7
- * device — pickers, cards, lists, map markers — must resolve through here, so a
8
- * change to the contract is one edit and never a hunt across components.
9
- *
10
- * A new device type needs no change at all: the backend publishes the id and
11
- * the frontend forwards it.
12
- */
13
- export declare function resolveDeviceIconSrc(hostApiRemote: string | undefined, iconId?: string | null): string;
14
- //# sourceMappingURL=resolveDeviceIconSrc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveDeviceIconSrc.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/helpers/resolveDeviceIconSrc/resolveDeviceIconSrc.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,MAAM,CAKR"}
@@ -1,8 +0,0 @@
1
- import { DEVICE_FALLBACK_ICON_ID as r, DEVICE_ICONS_PATH as c, DEVICE_ICON_VARIANT_SUFFIX as _ } from "./constants.js";
2
- function C(e, I) {
3
- const o = I?.trim() || r;
4
- return `${(e ?? "").replace(/\/+$/u, "")}${c}${o}${_}`;
5
- }
6
- export {
7
- C as resolveDeviceIconSrc
8
- };
@@ -1,3 +0,0 @@
1
- export { resolveDeviceTitle, resolveDeviceSubtitle } from './resolveDeviceLabels';
2
- export type { DeviceLabelsSource } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/helpers/resolveDeviceLabels/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAClF,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
@@ -1,22 +0,0 @@
1
- import { DeviceLabelsSource } from './types';
2
- /**
3
- * Resolve the first line of a device: the alias, or the name when the device
4
- * carries no alias.
5
- *
6
- * This is the single place that owns the device label contract. The alias is
7
- * what identifies a vehicle for the people using the platform, so it always
8
- * wins the prominent line; the name takes it only when there is no alias, and
9
- * moves to the description line otherwise.
10
- *
11
- * Every surface that paints a device — picker cards, panel rows, selected
12
- * lists, filter chips — must resolve through here, so the same device never
13
- * reads one way in a module and another way in a shared component.
14
- */
15
- export declare function resolveDeviceTitle(device?: DeviceLabelsSource | null): string;
16
- /**
17
- * Resolve the second line of a device: the name, once the alias took the first
18
- * line. Empty when there is no alias, because the name is already on top and
19
- * repeating it would paint the same text twice.
20
- */
21
- export declare function resolveDeviceSubtitle(device?: DeviceLabelsSource | null): string;
22
- //# sourceMappingURL=resolveDeviceLabels.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveDeviceLabels.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/helpers/resolveDeviceLabels/resolveDeviceLabels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,MAAM,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,IAAI,GAAG,MAAM,CAEhF"}
@@ -1,10 +0,0 @@
1
- function e(t) {
2
- return t?.alias?.trim() || t?.name?.trim() || "";
3
- }
4
- function r(t) {
5
- return t?.alias?.trim() ? t?.name?.trim() ?? "" : "";
6
- }
7
- export {
8
- r as resolveDeviceSubtitle,
9
- e as resolveDeviceTitle
10
- };
@@ -1,18 +0,0 @@
1
- /**
2
- * Minimal shape the device label contract needs from a device.
3
- *
4
- * Declared here instead of imported from a component so any surface that paints
5
- * a device — pickers, cards, lists, map markers, filter chips — can resolve its
6
- * labels without depending on the picker.
7
- */
8
- export interface DeviceLabelsSource {
9
- /**
10
- * Device name, as published by the backend.
11
- */
12
- name?: string | null;
13
- /**
14
- * Device alias (plate). When present it owns the first line.
15
- */
16
- alias?: string | null;
17
- }
18
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/helpers/resolveDeviceLabels/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateVisibleChipsCount.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/hooks/useChipsOverflow/helpers/calculateVisibleChipsCount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAAE,GACnB,MAAM,CAsBR"}
@@ -1,2 +0,0 @@
1
- export { calculateVisibleChipsCount } from './calculateVisibleChipsCount';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/hooks/useChipsOverflow/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,3 +0,0 @@
1
- export { useChipsOverflow } from './useChipsOverflow';
2
- export type { OverflowItem } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/hooks/useChipsOverflow/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Minimum shape an item needs to take part in the overflow calculation.
3
- * The hook only ever uses the id to cache measured widths, so anything with a
4
- * stable identifier works: filter chips, sort chips or device cards.
5
- */
6
- export interface OverflowItem {
7
- /**
8
- * Stable identifier of the item.
9
- */
10
- id: string | number;
11
- }
12
- /**
13
- * Options of the overflow hook.
14
- */
15
- export interface UseChipsOverflowOptions {
16
- /**
17
- * Reports the items pending measurement through `measuringItems` instead of
18
- * showing them all while their width is unknown. The consumer must render
19
- * them out of the layout so the split does not flicker on every addition.
20
- * Off by default: the visible set keeps carrying them.
21
- */
22
- deferMeasurement?: boolean;
23
- }
24
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/hooks/useChipsOverflow/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChipsOverflow.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/hooks/useChipsOverflow/useChipsOverflow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,YAAY,EACrD,OAAO,EAAE,CAAC,EAAE,EACZ,OAAO,GAAE,uBAA4B;;;;;;qBA8JD,YAAY,CAAC,IAAI,CAAC,MAAM,WAAW,GAAG,IAAI;yBAcvE,WAAW,GAAG,IAAI;wBAalB,WAAW,GAAG,IAAI;wBAYlB,WAAW,GAAG,IAAI;EA4F1B"}
@@ -1,108 +0,0 @@
1
- import { useRef as c, useState as U, useEffect as m, useCallback as h, useMemo as q } from "react";
2
- import { calculateVisibleChipsCount as V } from "./helpers/calculateVisibleChipsCount.js";
3
- const ee = [];
4
- function se(t, x = {}) {
5
- const { deferMeasurement: f = !1 } = x, v = c(null), b = c(null), C = c(null), M = c(null), W = c(null), R = c(/* @__PURE__ */ new Map()), a = c(/* @__PURE__ */ new Map()), [o, p] = U(null), [S, z] = U(/* @__PURE__ */ new Set()), u = c(null);
6
- m(() => {
7
- const e = new Set(t.map((r) => r.id));
8
- for (const r of a.current.keys())
9
- e.has(r) || a.current.delete(r);
10
- t.some((r) => !a.current.has(r.id)) && !f && p(null);
11
- }, [t, f]);
12
- const s = h(() => {
13
- const e = v.current, n = b.current;
14
- if (!e || !n || t.length === 0) {
15
- p(null);
16
- return;
17
- }
18
- let r = !1;
19
- if (t.forEach((l) => {
20
- const w = R.current.get(l.id);
21
- w && w.offsetWidth > 0 && (r = r || !a.current.has(l.id), a.current.set(l.id, w.offsetWidth));
22
- }), r && z(new Set(a.current.keys())), !t.every((l) => a.current.has(l.id))) {
23
- u.current === null && (u.current = requestAnimationFrame(() => {
24
- u.current = null, y.current?.();
25
- }));
26
- return;
27
- }
28
- const i = getComputedStyle(e), F = getComputedStyle(n), j = parseFloat(i.paddingLeft) || 0, D = parseFloat(i.paddingRight) || 0, H = parseFloat(F.paddingLeft) || 0, J = parseFloat(F.paddingRight) || 0, d = parseFloat(F.gap) || 0, E = e.getBoundingClientRect().width || e.clientWidth;
29
- if (E === 0)
30
- return;
31
- const I = M.current?.offsetWidth ?? 0, K = I > 0 ? I + d : 0, L = W.current?.offsetWidth ?? 0, Q = L > 0 ? L + d : 0, O = E - j - D - H - J - K - Q, P = t.map((l) => a.current.get(l.id) ?? 0);
32
- if (V(O, d, P) >= t.length) {
33
- p(t.length);
34
- return;
35
- }
36
- const k = C.current?.offsetWidth ?? 0, X = k > 0 ? k + d : 0, Z = O - X, $ = V(Z, d, P);
37
- p($);
38
- }, [t]), y = c(null);
39
- y.current = s, m(
40
- () => () => {
41
- u.current !== null && cancelAnimationFrame(u.current);
42
- },
43
- []
44
- );
45
- const B = h((e, n) => {
46
- n ? R.current.set(e, n) : R.current.delete(e);
47
- }, []), G = h(
48
- (e) => {
49
- C.current = e, s();
50
- },
51
- [s]
52
- ), N = h(
53
- (e) => {
54
- M.current = e, s();
55
- },
56
- [s]
57
- ), T = h(
58
- (e) => {
59
- W.current = e, s();
60
- },
61
- [s]
62
- );
63
- m(() => {
64
- const e = v.current;
65
- if (!e)
66
- return;
67
- const n = new ResizeObserver(() => {
68
- s();
69
- });
70
- return n.observe(e), () => {
71
- n.disconnect();
72
- };
73
- }, [s]), m(() => {
74
- const e = requestAnimationFrame(() => {
75
- s();
76
- });
77
- return () => cancelAnimationFrame(e);
78
- }, [t, s]);
79
- const g = q(
80
- () => f && o !== null ? t.filter((e) => !S.has(e.id)) : ee,
81
- [t, f, o, S]
82
- ), { visibleFilters: Y, overflowFilters: _ } = q(() => {
83
- if (g.length === 0)
84
- return o === null || o >= t.length ? { visibleFilters: t, overflowFilters: [] } : {
85
- visibleFilters: t.slice(0, o),
86
- overflowFilters: t.slice(o)
87
- };
88
- const e = new Set(g.map((i) => i.id)), n = t.filter((i) => !e.has(i.id)), r = o === null || o >= n.length ? n : n.slice(0, o), A = new Set(r.map((i) => i.id));
89
- return {
90
- visibleFilters: r,
91
- overflowFilters: t.filter((i) => !A.has(i.id))
92
- };
93
- }, [t, o, g]);
94
- return {
95
- visibleFilters: Y,
96
- overflowFilters: _,
97
- measuringFilters: g,
98
- parentRef: v,
99
- containerRef: b,
100
- setChipRef: B,
101
- setMoreChipRef: G,
102
- setActionsRef: N,
103
- setLeadingRef: T
104
- };
105
- }
106
- export {
107
- se as useChipsOverflow
108
- };