@m4l/gclick 0.28.0 → 0.29.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/@types/types.d.ts +19 -0
- package/_virtual/react-dom-server-legacy.browser.development.js +4 -0
- package/_virtual/react-dom-server-legacy.browser.production.js +4 -0
- package/_virtual/react-dom-server.browser.development.js +4 -0
- package/_virtual/react-dom-server.browser.production.js +4 -0
- package/_virtual/server.browser.js +5 -0
- package/_virtual/server.browser2.js +4 -0
- package/components/CheckableDevicesPicker/CheckableDevicesPicker.d.ts +13 -0
- package/components/CheckableDevicesPicker/CheckableDevicesPicker.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/CheckableDevicesPicker.js +237 -0
- package/components/CheckableDevicesPicker/CheckableDevicesPicker.styles.d.ts +3 -0
- package/components/CheckableDevicesPicker/CheckableDevicesPicker.styles.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/CheckableDevicesPicker.styles.js +157 -0
- package/components/CheckableDevicesPicker/constants.d.ts +22 -0
- package/components/CheckableDevicesPicker/constants.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/constants.js +13 -0
- package/components/CheckableDevicesPicker/dictionary.d.ts +15 -0
- package/components/CheckableDevicesPicker/dictionary.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/dictionary.js +15 -0
- package/components/CheckableDevicesPicker/helpers/resolveDeviceGroup.d.ts +11 -0
- package/components/CheckableDevicesPicker/helpers/resolveDeviceGroup.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/helpers/resolveDeviceGroup.js +23 -0
- package/components/CheckableDevicesPicker/helpers/toDeviceArray.d.ts +7 -0
- package/components/CheckableDevicesPicker/helpers/toDeviceArray.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/helpers/toDeviceArray.js +6 -0
- package/components/CheckableDevicesPicker/hooks/types.d.ts +178 -0
- package/components/CheckableDevicesPicker/hooks/types.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/hooks/useDeviceGroups.d.ts +13 -0
- package/components/CheckableDevicesPicker/hooks/useDeviceGroups.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/hooks/useDeviceGroups.js +51 -0
- package/components/CheckableDevicesPicker/hooks/useDevicesAsyncOptions.d.ts +13 -0
- package/components/CheckableDevicesPicker/hooks/useDevicesAsyncOptions.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/hooks/useDevicesAsyncOptions.js +69 -0
- package/components/CheckableDevicesPicker/hooks/useDevicesSelection.d.ts +12 -0
- package/components/CheckableDevicesPicker/hooks/useDevicesSelection.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/hooks/useDevicesSelection.js +26 -0
- package/components/CheckableDevicesPicker/hooks/usePanelColumns.d.ts +12 -0
- package/components/CheckableDevicesPicker/hooks/usePanelColumns.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/hooks/usePanelColumns.js +30 -0
- package/components/CheckableDevicesPicker/index.d.ts +7 -0
- package/components/CheckableDevicesPicker/index.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/slots/CheckableDevicesPickerEnum.d.ts +23 -0
- package/components/CheckableDevicesPicker/slots/CheckableDevicesPickerEnum.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/slots/CheckableDevicesPickerEnum.js +4 -0
- package/components/CheckableDevicesPicker/slots/CheckableDevicesPickerSlots.d.ts +31 -0
- package/components/CheckableDevicesPicker/slots/CheckableDevicesPickerSlots.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/slots/CheckableDevicesPickerSlots.js +49 -0
- package/components/CheckableDevicesPicker/slots/index.d.ts +3 -0
- package/components/CheckableDevicesPicker/slots/index.d.ts.map +1 -0
- package/components/CheckableDevicesPicker/types.d.ts +210 -0
- package/components/CheckableDevicesPicker/types.d.ts.map +1 -0
- package/components/DevicesPicker/DevicesPicker.d.ts +15 -0
- package/components/DevicesPicker/DevicesPicker.d.ts.map +1 -0
- package/components/DevicesPicker/DevicesPicker.js +311 -0
- package/components/DevicesPicker/DevicesPicker.styles.d.ts +3 -0
- package/components/DevicesPicker/DevicesPicker.styles.d.ts.map +1 -0
- package/components/DevicesPicker/DevicesPicker.styles.js +373 -0
- package/components/DevicesPicker/constants.d.ts +51 -0
- package/components/DevicesPicker/constants.d.ts.map +1 -0
- package/components/DevicesPicker/constants.js +30 -0
- package/components/DevicesPicker/dictionary.d.ts +17 -0
- package/components/DevicesPicker/dictionary.d.ts.map +1 -0
- package/components/DevicesPicker/dictionary.js +17 -0
- package/components/DevicesPicker/index.d.ts +8 -0
- package/components/DevicesPicker/index.d.ts.map +1 -0
- package/components/DevicesPicker/slots/DevicesPickerEnum.d.ts +61 -0
- package/components/DevicesPicker/slots/DevicesPickerEnum.d.ts.map +1 -0
- package/components/DevicesPicker/slots/DevicesPickerEnum.js +4 -0
- package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts +88 -0
- package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts.map +1 -0
- package/components/DevicesPicker/slots/DevicesPickerSlots.js +125 -0
- package/components/DevicesPicker/slots/index.d.ts +3 -0
- package/components/DevicesPicker/slots/index.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts +8 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/DeviceCard.js +77 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/index.d.ts +3 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/index.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/types.d.ts +42 -0
- package/components/DevicesPicker/subcomponents/DeviceCard/types.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts +10 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.js +35 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.d.ts +3 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/index.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.d.ts +11 -0
- package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/types.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts +11 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.js +61 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/index.d.ts +3 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/index.d.ts.map +1 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/types.d.ts +32 -0
- package/components/DevicesPicker/subcomponents/SelectedDevicesList/types.d.ts.map +1 -0
- package/components/DevicesPicker/types.d.ts +91 -0
- package/components/DevicesPicker/types.d.ts.map +1 -0
- package/components/RHFs/RHFCheckableDevicesPicker/RHFCheckableDevicesPicker.d.ts +23 -0
- package/components/RHFs/RHFCheckableDevicesPicker/RHFCheckableDevicesPicker.d.ts.map +1 -0
- package/components/RHFs/RHFCheckableDevicesPicker/RHFCheckableDevicesPicker.js +6 -0
- package/components/RHFs/RHFCheckableDevicesPicker/index.d.ts +3 -0
- package/components/RHFs/RHFCheckableDevicesPicker/index.d.ts.map +1 -0
- package/components/RHFs/RHFCheckableDevicesPicker/types.d.ts +10 -0
- package/components/RHFs/RHFCheckableDevicesPicker/types.d.ts.map +1 -0
- package/components/RHFs/RHFDevicesPicker/RHFDevicesPicker.d.ts +21 -0
- package/components/RHFs/RHFDevicesPicker/RHFDevicesPicker.d.ts.map +1 -0
- package/components/RHFs/RHFDevicesPicker/RHFDevicesPicker.js +6 -0
- package/components/RHFs/RHFDevicesPicker/index.d.ts +3 -0
- package/components/RHFs/RHFDevicesPicker/index.d.ts.map +1 -0
- package/components/RHFs/RHFDevicesPicker/types.d.ts +9 -0
- package/components/RHFs/RHFDevicesPicker/types.d.ts.map +1 -0
- package/components/RHFs/renderAsRegistry.d.ts +33 -0
- package/components/RHFs/renderAsRegistry.d.ts.map +1 -0
- package/components/RHFs/renderAsRegistry.js +7 -0
- package/components/index.d.ts +6 -0
- package/components/index.d.ts.map +1 -1
- package/helpers/index.d.ts +3 -0
- package/helpers/index.d.ts.map +1 -0
- package/helpers/resolveDeviceIcon/constants.d.ts +31 -0
- package/helpers/resolveDeviceIcon/constants.d.ts.map +1 -0
- package/helpers/resolveDeviceIcon/constants.js +8 -0
- package/helpers/resolveDeviceIcon/deviceIconComponents.d.ts +19 -0
- package/helpers/resolveDeviceIcon/deviceIconComponents.d.ts.map +1 -0
- package/helpers/resolveDeviceIcon/deviceIconComponents.js +19 -0
- package/helpers/resolveDeviceIcon/index.d.ts +3 -0
- package/helpers/resolveDeviceIcon/index.d.ts.map +1 -0
- package/helpers/resolveDeviceIcon/resolveDeviceIcon.d.ts +28 -0
- package/helpers/resolveDeviceIcon/resolveDeviceIcon.d.ts.map +1 -0
- package/helpers/resolveDeviceIcon/resolveDeviceIcon.js +42 -0
- package/helpers/resolveDeviceLabels/index.d.ts +3 -0
- package/helpers/resolveDeviceLabels/index.d.ts.map +1 -0
- package/helpers/resolveDeviceLabels/resolveDeviceLabels.d.ts +22 -0
- package/helpers/resolveDeviceLabels/resolveDeviceLabels.d.ts.map +1 -0
- package/helpers/resolveDeviceLabels/resolveDeviceLabels.js +10 -0
- package/helpers/resolveDeviceLabels/types.d.ts +19 -0
- package/helpers/resolveDeviceLabels/types.d.ts.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +275 -221
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeviceCardProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* One selected device inside the trigger.
|
|
4
|
+
* Renders on top of the system Card and fills its internal slot with the
|
|
5
|
+
* device icon, alias, plate and id, plus the action that removes it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function DeviceCard(props: DeviceCardProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DeviceCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceCard.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/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"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/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 '@m4l/components';
|
|
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/gclick/src/components/DevicesPicker/subcomponents/DeviceCard/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;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"}
|
package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts
ADDED
|
@@ -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
|
package/components/DevicesPicker/subcomponents/DevicesPickerSkeleton/DevicesPickerSkeleton.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevicesPickerSkeleton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/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/gclick/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 '../../../CheckableDevicesPicker/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
|
package/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectedDevicesList.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/DevicesPicker/subcomponents/SelectedDevicesList/SelectedDevicesList.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/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 '../../../CheckableDevicesPicker/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/gclick/src/components/DevicesPicker/subcomponents/SelectedDevicesList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E;;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"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Theme } from '@mui/material/styles';
|
|
2
|
+
import { Sizes } from '@m4l/styles';
|
|
3
|
+
import { AutocompleteAsyncProps, M4LOverridesStyleRules } from '@m4l/components';
|
|
4
|
+
import { DevicePickerGroupRef, DevicePickerOption } from '../CheckableDevicesPicker/types';
|
|
5
|
+
import { DEVICES_PICKER_KEY_COMPONENT } from './constants';
|
|
6
|
+
import { DevicesPickerSlots } from './slots/DevicesPickerEnum';
|
|
7
|
+
/**
|
|
8
|
+
* Props inherited from AutocompleteAsync that only make sense for its text
|
|
9
|
+
* `<input>`. The DevicesPicker has no text input in the trigger (the search
|
|
10
|
+
* field lives inside the panel), so they are removed from the public contract:
|
|
11
|
+
* passing them must fail at compile time instead of being silently ignored.
|
|
12
|
+
*/
|
|
13
|
+
export type DevicesPickerInputOnlyProps = 'readOnly' | 'startAdornment' | 'endAdornment' | 'autoCapitalize' | 'autoComplete' | 'type' | 'htmlFor' | 'menuMinWidth' | 'minWidth' | 'variant' | 'refresh' | 'onChangeFilterParmsLocal' | 'getOptionUrlImage' | 'getOptionStartAdornment' | 'getOptionEndAdornment' | 'getOptionDescription' | 'getOptionLabel';
|
|
14
|
+
/**
|
|
15
|
+
* Props of the DevicesPicker component.
|
|
16
|
+
* Extends the AutocompleteAsync contract so the async engine (endPoint, parms,
|
|
17
|
+
* resultField, isRemote, shouldFetch...) is declared once and stays in sync.
|
|
18
|
+
* The engine props are forwarded verbatim to the CheckableDevicesPicker
|
|
19
|
+
* mounted inside the selection popover, which is what performs the fetch.
|
|
20
|
+
*/
|
|
21
|
+
export interface DevicesPickerProps<T = DevicePickerOption> extends Omit<AutocompleteAsyncProps<T>, DevicesPickerInputOnlyProps> {
|
|
22
|
+
/**
|
|
23
|
+
* Visibility of the +N overflow toggle (Figma `Show+`).
|
|
24
|
+
* Disable it only when the container guarantees room for every card.
|
|
25
|
+
*/
|
|
26
|
+
showOverflowToggle?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* "Ver departamentos" switch: groups the list and shows the "Todos" row.
|
|
29
|
+
* Omitted means derived from the data.
|
|
30
|
+
*/
|
|
31
|
+
showDepartments?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* "Ver ID" switch: shows the id line on every row.
|
|
34
|
+
* Omitted means derived from the data.
|
|
35
|
+
*/
|
|
36
|
+
showIds?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Renders the search field inside the panel.
|
|
39
|
+
*/
|
|
40
|
+
searchable?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Text shown in the trigger while there is no selection.
|
|
43
|
+
*/
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Resolves the group of an option; null falls into the default group.
|
|
47
|
+
*/
|
|
48
|
+
getDeviceGroup?: (option: T) => DevicePickerGroupRef | null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Owner state shared by the DevicesPicker slots for styling purposes.
|
|
52
|
+
*/
|
|
53
|
+
export interface DevicesPickerOwnerState extends Record<string, unknown> {
|
|
54
|
+
/**
|
|
55
|
+
* Size of the component.
|
|
56
|
+
*/
|
|
57
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
58
|
+
/**
|
|
59
|
+
* Selection panel is open; adds the primary stroke to the trigger.
|
|
60
|
+
*/
|
|
61
|
+
panelOpen?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Selected-devices list is open.
|
|
64
|
+
*/
|
|
65
|
+
listOpen?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Validation failed; paints the trigger stroke with the error token.
|
|
68
|
+
*/
|
|
69
|
+
error?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whole picker is disabled.
|
|
72
|
+
*/
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Devices are still loading; renders the tokenized skeleton.
|
|
76
|
+
*/
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* There is at least one selected device.
|
|
80
|
+
*/
|
|
81
|
+
hasSelection?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Slot names available for the DevicesPicker.
|
|
85
|
+
*/
|
|
86
|
+
export type DevicesPickerSlotsType = keyof typeof DevicesPickerSlots;
|
|
87
|
+
/**
|
|
88
|
+
* Styles applicable to the DevicesPicker through theme overrides and slots.
|
|
89
|
+
*/
|
|
90
|
+
export type DevicesPickerStyles = M4LOverridesStyleRules<DevicesPickerSlotsType, typeof DEVICES_PICKER_KEY_COMPONENT, Theme>;
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/DevicesPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GACnC,UAAU,GACV,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,MAAM,GACN,SAAS,GACT,cAAc,GACd,UAAU,GACV,SAAS,GACT,SAAS,GACT,0BAA0B,GAC1B,mBAAmB,GACnB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GAItB,gBAAgB,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,kBAAkB,CACxD,SAAQ,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,2BAA2B,CAAC;IACpE;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,oBAAoB,GAAG,IAAI,CAAC;CAC7D;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CACtD,sBAAsB,EACtB,OAAO,4BAA4B,EACnC,KAAK,CACN,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { DevicePickerOption } from '../../CheckableDevicesPicker/types';
|
|
3
|
+
import { RHFCheckableDevicesPickerProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* RHFCheckableDevicesPicker: grouped device selector integrated with
|
|
6
|
+
* react-hook-form.
|
|
7
|
+
* Wraps CheckableDevicesPicker with the same HOC as RHFDevicesPicker, so form
|
|
8
|
+
* state, label and error message behave identically, and the field stores the
|
|
9
|
+
* selected devices as objects.
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <RHFCheckableDevicesPicker
|
|
13
|
+
* name="devices"
|
|
14
|
+
* label="Dispositivos"
|
|
15
|
+
* endPoint="devices"
|
|
16
|
+
* multiple
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const RHFCheckableDevicesPicker: <T = DevicePickerOption>(props: RHFCheckableDevicesPickerProps<T> & {
|
|
21
|
+
ref?: Ref<HTMLDivElement>;
|
|
22
|
+
}) => JSX.Element;
|
|
23
|
+
//# sourceMappingURL=RHFCheckableDevicesPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RHFCheckableDevicesPicker.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFCheckableDevicesPicker/RHFCheckableDevicesPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAI9D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,EAA+C,CACnF,CAAC,GAAG,kBAAkB,EAEtB,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,GAAG;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B,KACE,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFCheckableDevicesPicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseRHFProps } from '@m4l/components';
|
|
2
|
+
import { CheckableDevicesPickerProps, DevicePickerOption } from '../../CheckableDevicesPicker/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for RHFCheckableDevicesPicker (CheckableDevicesPicker wrapped with
|
|
5
|
+
* withRHFController). value and onChange are injected by the HOC from the form
|
|
6
|
+
* state, and `ref` is the HOC's own (it points at the wrapper root), so the
|
|
7
|
+
* picker's imperative handle is not part of the form contract.
|
|
8
|
+
*/
|
|
9
|
+
export type RHFCheckableDevicesPickerProps<T = DevicePickerOption> = BaseRHFProps & Omit<CheckableDevicesPickerProps<T>, 'value' | 'onChange' | 'ref'>;
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFCheckableDevicesPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,8BAA8B,CAAC,CAAC,GAAG,kBAAkB,IAAI,YAAY,GAC/E,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { DevicePickerOption } from '../../CheckableDevicesPicker/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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RHFDevicesPicker.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFDevicesPicker/RHFDevicesPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFDevicesPicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseRHFProps } from '@m4l/components';
|
|
2
|
+
import { DevicesPickerProps } from '../../DevicesPicker/types';
|
|
3
|
+
import { DevicePickerOption } from '../../CheckableDevicesPicker/types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for RHFDevicesPicker (DevicesPicker wrapped with withRHFController).
|
|
6
|
+
* value and onChange are injected by the HOC from the form state.
|
|
7
|
+
*/
|
|
8
|
+
export type RHFDevicesPickerProps<T = DevicePickerOption> = BaseRHFProps & Omit<DevicesPickerProps<T>, 'value' | 'onChange'>;
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/gclick/src/components/RHFs/RHFDevicesPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,kBAAkB,IAAI,YAAY,GACtE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderAsRegistry.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/components/RHFs/renderAsRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC;;WANrD,CAAD;;CAQU,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACzC,MAAM,OAAO,yCAAyC,CAAC"}
|
package/components/index.d.ts
CHANGED
|
@@ -14,4 +14,10 @@ export * from './ReportsViewer';
|
|
|
14
14
|
export * from './TimelineCardsViewer';
|
|
15
15
|
export * from './AddressLocation';
|
|
16
16
|
export * from './RHFs/RHFAddressLocation';
|
|
17
|
+
export * from './DevicesPicker';
|
|
18
|
+
export * from './CheckableDevicesPicker';
|
|
19
|
+
export * from './RHFs/RHFDevicesPicker';
|
|
20
|
+
export * from './RHFs/RHFCheckableDevicesPicker';
|
|
21
|
+
export { RHF_AUTOCOMPLETE_ASYNC_RENDER_AS_REGISTRY } from './RHFs/renderAsRegistry';
|
|
22
|
+
export type { RHFAutocompleteAsyncRenderAsKey } from './RHFs/renderAsRegistry';
|
|
17
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC1D,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAC;AAC1D,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,yCAAyC,EAAE,MAAM,yBAAyB,CAAC;AACpF,YAAY,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC"}
|