@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick/src/helpers/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC;AAMpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix of the device icon id the devices endpoint publishes
|
|
3
|
+
* (`i_common_devices_type_sedan`). What follows it is the vehicle type.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEVICE_BACKEND_ICON_PREFIX = "i_common_devices_type_";
|
|
6
|
+
/**
|
|
7
|
+
* Prefix of the 3D device illustrations in the `@m4l/icons` SVG registry
|
|
8
|
+
* (`device_sedan_3d_white`), shared by every vehicle type.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEVICE_ICON_ID_PREFIX = "device_";
|
|
11
|
+
/**
|
|
12
|
+
* Variant of the 3D device illustration painted on the web. Together with
|
|
13
|
+
* `DEVICE_ICON_ID_PREFIX` it turns a vehicle type into the registry id of its
|
|
14
|
+
* artwork. The registry is read as it ships: web resolution does not go through
|
|
15
|
+
* the `_3d_white` entries of `backendIconAliases.json`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEVICE_ICON_VARIANT_SUFFIX = "_3d_white";
|
|
18
|
+
/**
|
|
19
|
+
* Used for devices that arrive with no icon id, and for vehicle types without a
|
|
20
|
+
* 3D illustration the web paints. One artwork covers every such device, and it
|
|
21
|
+
* renders through the same `Image` as the rest of the fleet. The illustration
|
|
22
|
+
* itself is `DEVICE_FALLBACK_ICON_COMPONENT`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEVICE_FALLBACK_ICON_ID = "i_common_devices_type_heavy_truck";
|
|
25
|
+
/**
|
|
26
|
+
* Side of the square the artwork is painted in. Every device surface uses the
|
|
27
|
+
* same size, so it lives with the contract instead of being redeclared by each
|
|
28
|
+
* component.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DEVICE_ICON_SIZE = 31;
|
|
31
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/helpers/resolveDeviceIcon/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,sCAAsC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const _ = "i_common_devices_type_", I = "device_", E = "_3d_white", C = "i_common_devices_type_heavy_truck", c = 31;
|
|
2
|
+
export {
|
|
3
|
+
_ as DEVICE_BACKEND_ICON_PREFIX,
|
|
4
|
+
C as DEVICE_FALLBACK_ICON_ID,
|
|
5
|
+
I as DEVICE_ICON_ID_PREFIX,
|
|
6
|
+
c as DEVICE_ICON_SIZE,
|
|
7
|
+
E as DEVICE_ICON_VARIANT_SUFFIX
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DeviceSedan3dWhite } from '@m4l/icons';
|
|
2
|
+
/**
|
|
3
|
+
* Component type of the 3D device illustrations exported by `@m4l/icons`.
|
|
4
|
+
*/
|
|
5
|
+
export type DeviceIconComponent = typeof DeviceSedan3dWhite;
|
|
6
|
+
/**
|
|
7
|
+
* Illustration painted for a device with no icon id, or whose vehicle type has
|
|
8
|
+
* no illustration the web paints. It is the artwork `DEVICE_FALLBACK_ICON_ID`
|
|
9
|
+
* names: the heavy truck.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEVICE_FALLBACK_ICON_COMPONENT: DeviceIconComponent;
|
|
12
|
+
/**
|
|
13
|
+
* Web counterpart of the registry's `getIconComponentByName` for the 3D device
|
|
14
|
+
* illustrations: resolves the React component of a registry icon name without
|
|
15
|
+
* going through the registry's asset urls, or `undefined` when that name is not
|
|
16
|
+
* a device illustration the web paints.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDeviceIconComponentByName(name: string): DeviceIconComponent | undefined;
|
|
19
|
+
//# sourceMappingURL=deviceIconComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceIconComponents.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/helpers/resolveDeviceIcon/deviceIconComponents.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,kBAAkB,EAInB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,kBAAkB,CAAC;AAuB5D;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,mBACpB,CAAC;AAE1B;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,GACX,mBAAmB,GAAG,SAAS,CAIjC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DeviceHeavyTruck3dWhite as e, DeviceVan3dWhite as c, DeviceTruckTractor3dWhite as t, DeviceTaxi3dWhite as o, DeviceSedan3dWhite as r, DeviceMotorcycle3dWhite as v, DeviceLightTruck3dWhite as D, DeviceBackhoe3dWhite as h, DeviceAvatar3dWhite as d } from "@m4l/icons";
|
|
2
|
+
const n = {
|
|
3
|
+
DeviceAvatar3dWhite: d,
|
|
4
|
+
DeviceBackhoe3dWhite: h,
|
|
5
|
+
DeviceHeavyTruck3dWhite: e,
|
|
6
|
+
DeviceLightTruck3dWhite: D,
|
|
7
|
+
DeviceMotorcycle3dWhite: v,
|
|
8
|
+
DeviceSedan3dWhite: r,
|
|
9
|
+
DeviceTaxi3dWhite: o,
|
|
10
|
+
DeviceTruckTractor3dWhite: t,
|
|
11
|
+
DeviceVan3dWhite: c
|
|
12
|
+
}, W = e;
|
|
13
|
+
function C(i) {
|
|
14
|
+
return n[i];
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
W as DEVICE_FALLBACK_ICON_COMPONENT,
|
|
18
|
+
C as getDeviceIconComponentByName
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/helpers/resolveDeviceIcon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the source of a device artwork as an inline `data:` svg url, using
|
|
4
|
+
* the backend id published in `deviceIcon.iconId`.
|
|
5
|
+
*
|
|
6
|
+
* Meant for surfaces that need a text source, such as a datagrid image column.
|
|
7
|
+
* Surfaces that paint the artwork use `resolveDeviceIcon` instead.
|
|
8
|
+
*
|
|
9
|
+
* The illustration component is serialized to markup, so no file is emitted for
|
|
10
|
+
* it and the bundle carries no `new URL(asset, import.meta.url)` for device
|
|
11
|
+
* artwork.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveDeviceIconSrc(iconId?: string | null): string;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the artwork of a device, ready to render.
|
|
16
|
+
*
|
|
17
|
+
* This is the single place that owns the device-icon contract: the illustration
|
|
18
|
+
* set, the fallback and the size the artwork is painted in. Every surface that
|
|
19
|
+
* paints a device — pickers, cards, lists, map markers — must resolve through
|
|
20
|
+
* here, so a change to the contract is one edit and never a hunt across
|
|
21
|
+
* components.
|
|
22
|
+
*
|
|
23
|
+
* A vehicle type shows its own artwork once its `device_<type>_3d_white`
|
|
24
|
+
* component is listed in `deviceIconComponents.ts`; until then it paints the
|
|
25
|
+
* device fallback.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveDeviceIcon(iconId?: string | null, size?: number): ReactElement;
|
|
28
|
+
//# sourceMappingURL=resolveDeviceIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDeviceIcon.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/helpers/resolveDeviceIcon/resolveDeviceIcon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,OAAO,CAAC;AAgEpD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAenE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,IAAI,GAAE,MAAyB,GAC9B,YAAY,CASd"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createElement as s } from "react";
|
|
2
|
+
import { s as i } from "../../_virtual/server.browser.js";
|
|
3
|
+
import { getIconNameById as m } from "@m4l/icons/svg-registry";
|
|
4
|
+
import { Image as I } from "@m4l/components";
|
|
5
|
+
import { DEVICE_ICON_SIZE as C, DEVICE_BACKEND_ICON_PREFIX as n, DEVICE_ICON_ID_PREFIX as a, DEVICE_ICON_VARIANT_SUFFIX as E } from "./constants.js";
|
|
6
|
+
import { DEVICE_FALLBACK_ICON_COMPONENT as p, getDeviceIconComponentByName as _ } from "./deviceIconComponents.js";
|
|
7
|
+
const c = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
function f(t) {
|
|
9
|
+
const e = t.startsWith(n) ? t.slice(n.length) : t;
|
|
10
|
+
return _(
|
|
11
|
+
m(
|
|
12
|
+
`${a}${e}${E}`
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function l(t) {
|
|
17
|
+
const e = t?.trim();
|
|
18
|
+
return (e ? f(e) : void 0) ?? p;
|
|
19
|
+
}
|
|
20
|
+
function u(t) {
|
|
21
|
+
const e = l(t), r = c.get(e);
|
|
22
|
+
if (r)
|
|
23
|
+
return r;
|
|
24
|
+
const o = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(
|
|
25
|
+
i.renderToStaticMarkup(s(e))
|
|
26
|
+
)}`;
|
|
27
|
+
return c.set(e, o), o;
|
|
28
|
+
}
|
|
29
|
+
function d(t, e = C) {
|
|
30
|
+
return s(I, {
|
|
31
|
+
src: u(t),
|
|
32
|
+
width: e,
|
|
33
|
+
height: e,
|
|
34
|
+
// The row is virtualized and only mounts while visible, so deferring the
|
|
35
|
+
// request again would leave the slot blank on every scroll.
|
|
36
|
+
enableIntersectionObserver: !1
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
d as resolveDeviceIcon,
|
|
41
|
+
u as resolveDeviceIconSrc
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDeviceLabels.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* Plate or hardware code the device was registered with, as published by
|
|
11
|
+
* the backend.
|
|
12
|
+
*/
|
|
13
|
+
name?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Label the fleet gave the device. When present it owns the first line.
|
|
16
|
+
*/
|
|
17
|
+
alias?: string | null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick/src/helpers/resolveDeviceLabels/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
package/index.d.ts
CHANGED
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/gclick/src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAExB,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/gclick/src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAExB,cAAc,kBAAkB,CAAC"}
|