@camstack/ui-library 1.2.248 → 1.2.249
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/dist/composites/config-icon-field.d.ts +11 -0
- package/dist/composites/device-export-panel.d.ts +19 -1
- package/dist/composites/device-list/generic-mode.d.ts +12 -0
- package/dist/composites/device-list/index.d.ts +2 -1
- package/dist/composites/device-list/page-size-select.d.ts +10 -0
- package/dist/composites/index.d.ts +1 -1
- package/dist/generated/system-hooks.d.ts +12 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-device-list-page-size.d.ts +2 -1
- package/dist/hooks/use-persisted-page-size.d.ts +18 -0
- package/dist/index.cjs +1118 -910
- package/dist/index.js +1588 -1393
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ConfigIconFieldControlProps {
|
|
2
|
+
/** The field's label — names the picker for assistive tech. */
|
|
3
|
+
readonly label: string;
|
|
4
|
+
/** The stored value (anything — only a vocabulary key is honoured). */
|
|
5
|
+
readonly value: unknown;
|
|
6
|
+
/** The field's default key; `''` when the schema declares none. */
|
|
7
|
+
readonly defaultKey: string;
|
|
8
|
+
readonly disabled?: boolean;
|
|
9
|
+
readonly onChange: (key: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function ConfigIconFieldControl({ label, value, defaultKey, disabled, onChange, }: ConfigIconFieldControlProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
/** Where the viewer's "rows per page" choice for this table is remembered. */
|
|
3
|
+
export declare const DEVICE_EXPORT_PAGE_SIZE_KEY = "camstack.device-export.pageSize";
|
|
2
4
|
export interface DeviceExportPanelProps {
|
|
3
5
|
/**
|
|
4
6
|
* Addon id of the export addon whose surface is rendered. Used for
|
|
@@ -16,9 +18,25 @@ export interface DeviceExportPanelProps {
|
|
|
16
18
|
* reads.
|
|
17
19
|
*/
|
|
18
20
|
readonly onOpenDevice?: (deviceId: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Render the exporter's error and Setup block (pairing QR, copyable fields)
|
|
23
|
+
* inside the panel. Default true. A page that places the devices table at
|
|
24
|
+
* the bottom renders `<DeviceExportSetup>` near the top instead and passes
|
|
25
|
+
* false, so the pairing code is not buried under settings and logs.
|
|
26
|
+
*/
|
|
27
|
+
readonly showSetup?: boolean;
|
|
19
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The exporter's error and Setup block on their own — for a page that shows
|
|
31
|
+
* them above its settings while the devices table sits at the bottom. Renders
|
|
32
|
+
* nothing when the exporter reports neither. Shares `getStatus`'s query key
|
|
33
|
+
* with the panel, so mounting both costs one request.
|
|
34
|
+
*/
|
|
35
|
+
export declare function DeviceExportSetup({ addonId }: {
|
|
36
|
+
readonly addonId: string;
|
|
37
|
+
}): ReactElement | null;
|
|
20
38
|
/**
|
|
21
39
|
* Generic device-export panel. Addon-agnostic — only the `device-export`
|
|
22
40
|
* cap drives it.
|
|
23
41
|
*/
|
|
24
|
-
export declare function DeviceExportPanel({ addonId, onOpenDevice }: DeviceExportPanelProps): ReactElement;
|
|
42
|
+
export declare function DeviceExportPanel({ addonId, onOpenDevice, showSetup, }: DeviceExportPanelProps): ReactElement;
|
|
@@ -17,6 +17,11 @@ export interface DeviceListColumn<T> {
|
|
|
17
17
|
/** Extra classes on the `<td>`. */
|
|
18
18
|
readonly cellClassName?: string;
|
|
19
19
|
}
|
|
20
|
+
export interface GenericPageSizeSelector {
|
|
21
|
+
readonly options: readonly number[];
|
|
22
|
+
readonly defaultSize: number;
|
|
23
|
+
readonly storageKey: string | null;
|
|
24
|
+
}
|
|
20
25
|
export interface DeviceListGenericProps<T> {
|
|
21
26
|
readonly mode: 'generic';
|
|
22
27
|
readonly items: readonly T[];
|
|
@@ -73,7 +78,14 @@ export interface DeviceListGenericProps<T> {
|
|
|
73
78
|
readonly isLoading?: boolean;
|
|
74
79
|
readonly searchPlaceholder?: string;
|
|
75
80
|
readonly emptyLabel?: string;
|
|
81
|
+
/** Fixed rows per page when there is no `pageSizeSelector`. Default 100. */
|
|
76
82
|
readonly pageSize?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Let the viewer pick the page size: a "Per page" control under the table,
|
|
85
|
+
* remembered per viewer under `storageKey` (null = not remembered). Options
|
|
86
|
+
* may include `PAGE_SIZE_ALL`. When set, `pageSize` is ignored.
|
|
87
|
+
*/
|
|
88
|
+
readonly pageSizeSelector?: GenericPageSizeSelector;
|
|
77
89
|
/** Optional control rendered next to the search box (e.g. a Refresh button). */
|
|
78
90
|
readonly toolbar?: ReactNode;
|
|
79
91
|
}
|
|
@@ -12,7 +12,8 @@ export type { DeviceSort, SortDirection, SortableColumnId } from './sort';
|
|
|
12
12
|
export { hardwareLabel, metadataEntries, metadataString } from './hardware';
|
|
13
13
|
export { IconAction, type IconActionProps } from './icon-action';
|
|
14
14
|
export type { DeviceListAddonOption, DeviceListDeviceProps, DeviceListBatchActions, DeviceListIntegrationIconResolver, DeviceListIntegrationOption, } from './device-mode';
|
|
15
|
-
export type { DeviceListColumn, DeviceListGenericProps } from './generic-mode';
|
|
15
|
+
export type { DeviceListColumn, DeviceListGenericProps, GenericPageSizeSelector, } from './generic-mode';
|
|
16
|
+
export { PageSizeSelect, pageSizeLabel, type PageSizeSelectProps } from './page-size-select';
|
|
16
17
|
/**
|
|
17
18
|
* Default registry-device list, or a generic render-prop list (`mode:'generic'`).
|
|
18
19
|
* Existing call sites pass no `mode` and resolve to the device variant unchanged.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PageSizeSelectProps {
|
|
3
|
+
readonly value: number;
|
|
4
|
+
readonly options: readonly number[];
|
|
5
|
+
readonly onChange: (size: number) => void;
|
|
6
|
+
/** Accessible name — names what is being paged ("Devices per page"). */
|
|
7
|
+
readonly ariaLabel: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function pageSizeLabel(size: number): string;
|
|
10
|
+
export declare function PageSizeSelect({ value, options, onChange, ariaLabel, }: PageSizeSelectProps): ReactNode;
|
|
@@ -88,7 +88,7 @@ export { DeviceActivityPanel } from './device-activity-panel';
|
|
|
88
88
|
export * from './device-card';
|
|
89
89
|
export * from './device-controls';
|
|
90
90
|
export type { DeviceExportPanelProps } from './device-export-panel';
|
|
91
|
-
export { DeviceExportPanel } from './device-export-panel';
|
|
91
|
+
export { DEVICE_EXPORT_PAGE_SIZE_KEY, DeviceExportPanel, DeviceExportSetup, } from './device-export-panel';
|
|
92
92
|
export * from './device-grid';
|
|
93
93
|
export * from './device-item';
|
|
94
94
|
export * from './device-list';
|
|
@@ -1319,6 +1319,10 @@ export declare const usePipelineAnalyticsCompleteRetrainTrack: typeof trpc.pipel
|
|
|
1319
1319
|
export declare const usePipelineAnalyticsRestageRetrainTrack: typeof trpc.pipelineAnalytics.restageRetrainTrack.useMutation;
|
|
1320
1320
|
/** Generated alias around `trpc.pipelineAnalytics.getRetrainExportUrl.useQuery`. */
|
|
1321
1321
|
export declare const usePipelineAnalyticsGetRetrainExportUrl: typeof trpc.pipelineAnalytics.getRetrainExportUrl.useQuery;
|
|
1322
|
+
/** Generated alias around `trpc.pipelineAnalytics.setRetrainFrameComplete.useMutation`. */
|
|
1323
|
+
export declare const usePipelineAnalyticsSetRetrainFrameComplete: typeof trpc.pipelineAnalytics.setRetrainFrameComplete.useMutation;
|
|
1324
|
+
/** Generated alias around `trpc.pipelineAnalytics.writeRetrainArchive.useMutation`. */
|
|
1325
|
+
export declare const usePipelineAnalyticsWriteRetrainArchive: typeof trpc.pipelineAnalytics.writeRetrainArchive.useMutation;
|
|
1322
1326
|
/** Generated alias around `trpc.pipelineAnalytics.getEventMedia.useQuery`. */
|
|
1323
1327
|
export declare const usePipelineAnalyticsGetEventMedia: typeof trpc.pipelineAnalytics.getEventMedia.useQuery;
|
|
1324
1328
|
/** Generated alias around `trpc.pipelineAnalytics.getTrackMedia.useQuery`. */
|
|
@@ -2107,6 +2111,14 @@ export declare const useUserManagementOauthExchangeCode: typeof trpc.userManagem
|
|
|
2107
2111
|
export declare const useUserManagementOauthRefresh: typeof trpc.userManagement.oauthRefresh.useMutation;
|
|
2108
2112
|
/** Generated alias around `trpc.userManagement.oauthVerifyAccessToken.useQuery`. */
|
|
2109
2113
|
export declare const useUserManagementOauthVerifyAccessToken: typeof trpc.userManagement.oauthVerifyAccessToken.useQuery;
|
|
2114
|
+
/** Generated alias around `trpc.userManagement.listExternalIdentities.useQuery`. */
|
|
2115
|
+
export declare const useUserManagementListExternalIdentities: typeof trpc.userManagement.listExternalIdentities.useQuery;
|
|
2116
|
+
/** Generated alias around `trpc.userManagement.findUserByExternalIdentity.useQuery`. */
|
|
2117
|
+
export declare const useUserManagementFindUserByExternalIdentity: typeof trpc.userManagement.findUserByExternalIdentity.useQuery;
|
|
2118
|
+
/** Generated alias around `trpc.userManagement.linkExternalIdentity.useMutation`. */
|
|
2119
|
+
export declare const useUserManagementLinkExternalIdentity: typeof trpc.userManagement.linkExternalIdentity.useMutation;
|
|
2120
|
+
/** Generated alias around `trpc.userManagement.unlinkExternalIdentity.useMutation`. */
|
|
2121
|
+
export declare const useUserManagementUnlinkExternalIdentity: typeof trpc.userManagement.unlinkExternalIdentity.useMutation;
|
|
2110
2122
|
/** Generated alias around `trpc.userManagement.listOauthSessions.useQuery`. */
|
|
2111
2123
|
export declare const useUserManagementListOauthSessions: typeof trpc.userManagement.listOauthSessions.useQuery;
|
|
2112
2124
|
/** Generated alias around `trpc.userManagement.revokeOauthSession.useMutation`. */
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type { UseDeviceCapabilityOptions, UseDeviceCapabilityResult, } from './u
|
|
|
16
16
|
export { useDeviceCapability } from './use-device-capability';
|
|
17
17
|
export type { DetectionState, DeviceDetections, MotionRawBox, MotionRawState, MotionState, MotionZone, } from './use-device-detections';
|
|
18
18
|
export { useDeviceDetections } from './use-device-detections';
|
|
19
|
+
export type { PersistedPageSizeConfig, SetPageSize } from './use-persisted-page-size';
|
|
20
|
+
export { PAGE_SIZE_ALL, effectivePageSize, usePersistedPageSize, } from './use-persisted-page-size';
|
|
19
21
|
export type { SetDeviceListPageSize } from './use-device-list-page-size';
|
|
20
22
|
export { DEVICE_LIST_PAGE_SIZE_KEY, DEVICE_LIST_PAGE_SIZE_OPTIONS, useDeviceListPageSize, } from './use-device-list-page-size';
|
|
21
23
|
export type { UseDeviceProxyTrpc } from './use-device-proxy';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { SetPageSize } from './use-persisted-page-size';
|
|
1
2
|
/** Selectable per-page sizes. The table default (50) is intentionally one of them. */
|
|
2
3
|
export declare const DEVICE_LIST_PAGE_SIZE_OPTIONS: readonly number[];
|
|
3
4
|
/** Canonical default — used whenever a caller's `defaultSize` is itself invalid. */
|
|
4
5
|
export declare const DEVICE_LIST_PAGE_SIZE_DEFAULT = 50;
|
|
5
6
|
/** Single global key shared across every device-list surface. */
|
|
6
7
|
export declare const DEVICE_LIST_PAGE_SIZE_KEY = "camstack.device-list.pageSize";
|
|
7
|
-
export type SetDeviceListPageSize =
|
|
8
|
+
export type SetDeviceListPageSize = SetPageSize;
|
|
8
9
|
/**
|
|
9
10
|
* @param defaultSize fallback when nothing valid is stored. If it is not itself
|
|
10
11
|
* a member of {@link DEVICE_LIST_PAGE_SIZE_OPTIONS}, it is replaced by
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The "All" option — one page holding every row. */
|
|
2
|
+
export declare const PAGE_SIZE_ALL = 0;
|
|
3
|
+
export interface PersistedPageSizeConfig {
|
|
4
|
+
/** localStorage key, or null for a choice that is not remembered. */
|
|
5
|
+
readonly storageKey: string | null;
|
|
6
|
+
/** The selectable sizes, in display order. May include `PAGE_SIZE_ALL`. */
|
|
7
|
+
readonly options: readonly number[];
|
|
8
|
+
/** The size before the viewer picks one. Replaced by `options[0]` if not an option. */
|
|
9
|
+
readonly defaultSize: number;
|
|
10
|
+
}
|
|
11
|
+
export type SetPageSize = (next: number) => void;
|
|
12
|
+
/** @returns `[size, setSize]`; `setSize` ignores a size that is not an option. */
|
|
13
|
+
export declare function usePersistedPageSize({ storageKey, options, defaultSize, }: PersistedPageSizeConfig): readonly [number, SetPageSize];
|
|
14
|
+
/**
|
|
15
|
+
* The number of rows one page holds for a chosen size: "All" is every row
|
|
16
|
+
* (at least 1, so the pager arithmetic never divides by zero).
|
|
17
|
+
*/
|
|
18
|
+
export declare function effectivePageSize(size: number, totalItems: number): number;
|