@camstack/ui-library 1.2.300 → 1.2.302
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/data-records/data-records-hub.d.ts +9 -0
- package/dist/composites/data-records/data-records-model.d.ts +26 -0
- package/dist/composites/data-records/index.d.ts +2 -0
- package/dist/composites/data-table-filter-bar.d.ts +6 -0
- package/dist/composites/data-table.d.ts +11 -2
- package/dist/composites/device-controls/dishwasher-control.d.ts +14 -2
- package/dist/composites/index.d.ts +1 -0
- package/dist/composites/record-entries/index.d.ts +0 -1
- package/dist/composites/record-entries/record-entries-panel.d.ts +15 -3
- package/dist/composites/storage-records/index.d.ts +0 -1
- package/dist/generated/system-hooks.d.ts +14 -0
- package/dist/index.cjs +615 -385
- package/dist/index.js +600 -380
- package/package.json +1 -1
- package/dist/composites/record-entries/record-entries-hub.d.ts +0 -9
- package/dist/composites/storage-records/storage-records-hub.d.ts +0 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
export declare const DATA_RECORDS_OWNER_PARAM = "recordsOwner";
|
|
3
|
+
export declare const DATA_RECORDS_KIND_PARAM = "recordsKind";
|
|
4
|
+
/**
|
|
5
|
+
* System → Data → Records: every declared record kind in ONE table with
|
|
6
|
+
* compact filters; an entry kind opens its editable list, any other kind its
|
|
7
|
+
* read-only row preview. Selection is in `?recordsOwner=&recordsKind=`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function DataRecordsHub(): JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of the unified System → Data record view: one row per declared
|
|
3
|
+
* record kind (entry kinds included), the facet dimensions an operator filters
|
|
4
|
+
* on, and the text the search matches. No React, no queries.
|
|
5
|
+
*/
|
|
6
|
+
import type { EntryKindInfo, StorageKind } from "@camstack/types";
|
|
7
|
+
import type { DataTableFacetGroupConfig } from "../data-table-filter";
|
|
8
|
+
/** One table row: a declared kind, plus the entry catalog's title when it is an entry kind. */
|
|
9
|
+
export interface DataRecordRow {
|
|
10
|
+
readonly kind: StorageKind;
|
|
11
|
+
/** `null` when the kind is not an entry kind, or the entry catalog has not answered / lacks it. */
|
|
12
|
+
readonly entryTitle: string | null;
|
|
13
|
+
}
|
|
14
|
+
export type DataRecordType = "entry" | "record";
|
|
15
|
+
export type DataRecordContents = "has-rows" | "empty" | "unknown";
|
|
16
|
+
export declare function dataRecordKey(kind: Pick<StorageKind, "owner" | "kind">): string;
|
|
17
|
+
export declare function dataRecordType(kind: StorageKind): DataRecordType;
|
|
18
|
+
/** `unknown` is a kind whose count was not asked for or could not be read — never "empty". */
|
|
19
|
+
export declare function dataRecordContents(kind: StorageKind): DataRecordContents;
|
|
20
|
+
/**
|
|
21
|
+
* Join the declared kinds with the entry catalog. A pending/failed catalog
|
|
22
|
+
* (`undefined`) leaves titles `null`; it never changes which kinds are listed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildDataRecordRows(kinds: readonly StorageKind[], entryKinds: readonly EntryKindInfo[] | undefined): readonly DataRecordRow[];
|
|
25
|
+
export declare const DATA_RECORD_FACET_GROUPS: readonly DataTableFacetGroupConfig<DataRecordRow>[];
|
|
26
|
+
export declare function dataRecordSearchText(row: DataRecordRow): readonly string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DataRecordsHub, DATA_RECORDS_KIND_PARAM, DATA_RECORDS_OWNER_PARAM } from "./data-records-hub";
|
|
2
|
+
export { buildDataRecordRows, DATA_RECORD_FACET_GROUPS, dataRecordContents, dataRecordKey, dataRecordSearchText, dataRecordType, type DataRecordContents, type DataRecordRow, type DataRecordType } from "./data-records-model";
|
|
@@ -9,6 +9,12 @@ export interface DataTableFilterBarGroup {
|
|
|
9
9
|
readonly selected: readonly string[];
|
|
10
10
|
/** Render a chip's caption. Default: the raw value. */
|
|
11
11
|
readonly facetLabel?: (value: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* `chips` (default): one pressable chip per value, inline. `menu`: ONE
|
|
14
|
+
* chip-sized trigger ("Owner · 2") that opens a checklist — for a group
|
|
15
|
+
* with many values or a bar with many groups, so the bar stays one row.
|
|
16
|
+
*/
|
|
17
|
+
readonly display?: "chips" | "menu";
|
|
12
18
|
}
|
|
13
19
|
export interface DataTableFilterBarLabels {
|
|
14
20
|
/** Placeholder of the search box. */
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* history) so the page keeps its own header, filters and actions in view while
|
|
46
46
|
* the operator moves through the rows.
|
|
47
47
|
*/
|
|
48
|
-
import { type
|
|
48
|
+
import { type JSX, type ReactNode } from "react";
|
|
49
49
|
import { type DataTablePaginationLabels } from "./data-table-pagination";
|
|
50
50
|
import { type DataTableSelection } from "./data-table-selection";
|
|
51
51
|
import { type TableSortState, type TableSortValue } from "./table-sort";
|
|
@@ -158,6 +158,15 @@ export interface DataTableProps<T> {
|
|
|
158
158
|
* Needs `rowKey`: keys are what the caller's bulk action acts on.
|
|
159
159
|
*/
|
|
160
160
|
readonly selection?: DataTableSelection<T>;
|
|
161
|
+
/**
|
|
162
|
+
* Inline row detail: rendered in its own full-width row DIRECTLY UNDER the
|
|
163
|
+
* row for which `isExpanded` is true, so it stays attached to that row under
|
|
164
|
+
* sorting and paging. The caller owns the open state and the toggle control
|
|
165
|
+
* (a column cell). Never render the detail after the table — it would sit
|
|
166
|
+
* below every row.
|
|
167
|
+
*/
|
|
168
|
+
readonly renderExpanded?: (row: T, rowIndex: number) => ReactNode;
|
|
169
|
+
readonly isExpanded?: (row: T) => boolean;
|
|
161
170
|
}
|
|
162
171
|
/**
|
|
163
172
|
* The default cap for an internally-scrolling table.
|
|
@@ -167,4 +176,4 @@ export interface DataTableProps<T> {
|
|
|
167
176
|
* does not need a breakpoint of its own.
|
|
168
177
|
*/
|
|
169
178
|
export declare const TABLE_SCROLL_MAX_H: "max-h-[60vh]";
|
|
170
|
-
export declare function DataTable<T>({ columns, rows, rowKey, onRowClick, minWidthPx, emptyMessage, className, bordered, rowClassName, maxBodyHeight, fill, defaultSort, sort: sortProp, onSortChange, pageSize, page: pageProp, onPageChange, paginationLabels, selection }: DataTableProps<T>): JSX.Element | null;
|
|
179
|
+
export declare function DataTable<T>({ columns, rows, rowKey, onRowClick, minWidthPx, emptyMessage, className, bordered, rowClassName, maxBodyHeight, fill, defaultSort, sort: sortProp, onSortChange, pageSize, page: pageProp, onPageChange, paginationLabels, selection, renderExpanded, isExpanded }: DataTableProps<T>): JSX.Element | null;
|
|
@@ -3,15 +3,27 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Reads the `dishwasher` cap status slice and renders inline + hero surfaces
|
|
5
5
|
* mirroring vacuum-control / pet-feeder patterns.
|
|
6
|
+
*
|
|
7
|
+
* UNKNOWN IS NOT OFF. The slice carries `null` for everything the appliance has not
|
|
8
|
+
* reported, and this view renders that as "—" / a disabled control, never as an unchecked
|
|
9
|
+
* box or a zero. It also does not echo a command before the appliance confirms it: the
|
|
10
|
+
* slice moves when the appliance says so.
|
|
6
11
|
*/
|
|
7
12
|
import { type UiTextFn } from "../../contexts/ui-text";
|
|
8
13
|
import type { ReactNode } from "react";
|
|
9
|
-
import type {
|
|
14
|
+
import type { DishwasherOperationState, DishwasherStatus } from "@camstack/types";
|
|
10
15
|
import type { DeviceControlProps } from "./control-registry";
|
|
11
16
|
export interface DishwasherStateMeta {
|
|
12
17
|
readonly label: string;
|
|
13
18
|
readonly tone: string;
|
|
14
19
|
}
|
|
15
|
-
|
|
20
|
+
/** What the operation state is called to a person, and how it is toned. */
|
|
21
|
+
export declare function dishwasherOperationMeta(operationState: DishwasherOperationState | null, t?: UiTextFn): DishwasherStateMeta;
|
|
22
|
+
/** The headline for the whole slice: the appliance's state, or why there is none. */
|
|
23
|
+
export declare function dishwasherHeadline(status: DishwasherStatus, t?: UiTextFn): DishwasherStateMeta;
|
|
24
|
+
/** Last segment of a feature key, spaced out: `Dishcare.Dishwasher.Program.Eco50` -> `Eco50`. */
|
|
25
|
+
export declare function featureLabel(key: string): string;
|
|
26
|
+
/** Whole seconds as a short duration: `1 h 24 min`, `42 min`, `30 s`. */
|
|
27
|
+
export declare function formatDuration(seconds: number, t?: UiTextFn): string;
|
|
16
28
|
export declare function DishwasherInlineControl(props: DeviceControlProps): ReactNode;
|
|
17
29
|
export declare function DishwasherHeroCard(props: DeviceControlProps): ReactNode;
|
|
@@ -178,6 +178,7 @@ export { ConfigSchemaField, PipelineStep } from "./pipeline-step";
|
|
|
178
178
|
export * from "./provider-badge";
|
|
179
179
|
export { AddProviderEntryDialog, ProviderEntryPills } from "./provider-entries";
|
|
180
180
|
export type { AddProviderEntryCreateInput, AddProviderEntryDialogProps, ProviderEntryPill, ProviderEntryPillsProps, ProviderEntryStatus, ProviderEntryTypeOption } from "./provider-entries";
|
|
181
|
+
export * from "./data-records";
|
|
181
182
|
export * from "./record-entries";
|
|
182
183
|
export * from "./storage-records";
|
|
183
184
|
export type { PTZOverlayProps } from "./ptz-overlay";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { isRedactedSecret, isSecretField, mergeSecretForSubmit, secretDisplayValue } from "./record-entry-secrets";
|
|
2
2
|
export { EntryJsonSchemaForm, type EntryJsonSchemaFormProps } from "./entry-json-schema-form";
|
|
3
3
|
export { RecordEntriesPanel, type RecordEntriesPanelProps } from "./record-entries-panel";
|
|
4
|
-
export { RecordEntriesHub, RECORD_ENTRY_KIND_PARAM, RECORD_ENTRY_OWNER_PARAM, type RecordEntriesHubProps } from "./record-entries-hub";
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import type { EntryKindInfo } from "@camstack/types";
|
|
2
|
-
import { type JSX } from "react";
|
|
1
|
+
import type { EntryKindInfo, EntryView } from "@camstack/types";
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
import { type DataColumn } from "../data-table";
|
|
3
4
|
export interface RecordEntriesPanelProps {
|
|
4
5
|
readonly kind: EntryKindInfo;
|
|
6
|
+
/**
|
|
7
|
+
* Extra per-row buttons, drawn before Edit / Delete — for a kind whose rows
|
|
8
|
+
* carry an action of their own (a broker's Sign in / Sign out).
|
|
9
|
+
*/
|
|
10
|
+
readonly rowActions?: (entry: EntryView) => ReactNode;
|
|
11
|
+
/** Extra columns, drawn between Updated and the actions. */
|
|
12
|
+
readonly extraColumns?: readonly DataColumn<EntryView>[];
|
|
13
|
+
/** Draw the Updated column (default). A kind whose rows say more than a date drops it. */
|
|
14
|
+
readonly showUpdated?: boolean;
|
|
15
|
+
/** The table's floor width (`DataTable.minWidthPx`); a kind with few columns lowers it so a phone does not scroll. */
|
|
16
|
+
readonly minWidthPx?: number;
|
|
5
17
|
}
|
|
6
|
-
export declare function RecordEntriesPanel({ kind }: RecordEntriesPanelProps): JSX.Element;
|
|
18
|
+
export declare function RecordEntriesPanel({ kind, rowActions, extraColumns, showUpdated, minWidthPx }: RecordEntriesPanelProps): JSX.Element;
|
|
@@ -749,6 +749,8 @@ export declare const useDeviceStatusGetStatus: typeof trpc.deviceStatus.getStatu
|
|
|
749
749
|
export declare const useDishwasherStart: typeof trpc.dishwasher.start.useMutation;
|
|
750
750
|
/** Generated alias around `trpc.dishwasher.pause.useMutation`. */
|
|
751
751
|
export declare const useDishwasherPause: typeof trpc.dishwasher.pause.useMutation;
|
|
752
|
+
/** Generated alias around `trpc.dishwasher.resume.useMutation`. */
|
|
753
|
+
export declare const useDishwasherResume: typeof trpc.dishwasher.resume.useMutation;
|
|
752
754
|
/** Generated alias around `trpc.dishwasher.stop.useMutation`. */
|
|
753
755
|
export declare const useDishwasherStop: typeof trpc.dishwasher.stop.useMutation;
|
|
754
756
|
/** Generated alias around `trpc.dishwasher.setProgram.useMutation`. */
|
|
@@ -759,8 +761,18 @@ export declare const useDishwasherSetPower: typeof trpc.dishwasher.setPower.useM
|
|
|
759
761
|
export declare const useDishwasherSetHalfLoad: typeof trpc.dishwasher.setHalfLoad.useMutation;
|
|
760
762
|
/** Generated alias around `trpc.dishwasher.setHygienePlus.useMutation`. */
|
|
761
763
|
export declare const useDishwasherSetHygienePlus: typeof trpc.dishwasher.setHygienePlus.useMutation;
|
|
764
|
+
/** Generated alias around `trpc.dishwasher.setExtraDry.useMutation`. */
|
|
765
|
+
export declare const useDishwasherSetExtraDry: typeof trpc.dishwasher.setExtraDry.useMutation;
|
|
766
|
+
/** Generated alias around `trpc.dishwasher.setIntensiveZone.useMutation`. */
|
|
767
|
+
export declare const useDishwasherSetIntensiveZone: typeof trpc.dishwasher.setIntensiveZone.useMutation;
|
|
768
|
+
/** Generated alias around `trpc.dishwasher.setVarioSpeedPlus.useMutation`. */
|
|
769
|
+
export declare const useDishwasherSetVarioSpeedPlus: typeof trpc.dishwasher.setVarioSpeedPlus.useMutation;
|
|
770
|
+
/** Generated alias around `trpc.dishwasher.setChildLock.useMutation`. */
|
|
771
|
+
export declare const useDishwasherSetChildLock: typeof trpc.dishwasher.setChildLock.useMutation;
|
|
762
772
|
/** Generated alias around `trpc.dishwasher.setOption.useMutation`. */
|
|
763
773
|
export declare const useDishwasherSetOption: typeof trpc.dishwasher.setOption.useMutation;
|
|
774
|
+
/** Generated alias around `trpc.dishwasher.getOptions.useQuery`. */
|
|
775
|
+
export declare const useDishwasherGetOptions: typeof trpc.dishwasher.getOptions.useQuery;
|
|
764
776
|
/** Generated alias around `trpc.dishwasher.getStatus.useQuery`. */
|
|
765
777
|
export declare const useDishwasherGetStatus: typeof trpc.dishwasher.getStatus.useQuery;
|
|
766
778
|
/** Generated alias around `trpc.doorbell.getStatus.useQuery`. */
|
|
@@ -2087,6 +2099,8 @@ export declare const useStorageMigrationStatus: typeof trpc.storageMigration.sta
|
|
|
2087
2099
|
export declare const useStorageMigrationCancel: typeof trpc.storageMigration.cancel.useMutation;
|
|
2088
2100
|
/** Generated alias around `trpc.storageMigration.movers.useQuery`. */
|
|
2089
2101
|
export declare const useStorageMigrationMovers: typeof trpc.storageMigration.movers.useQuery;
|
|
2102
|
+
/** Generated alias around `trpc.storageMigration.moverClearance.useQuery`. */
|
|
2103
|
+
export declare const useStorageMigrationMoverClearance: typeof trpc.storageMigration.moverClearance.useQuery;
|
|
2090
2104
|
/** Generated alias around `trpc.storageMigration.residue.useQuery`. */
|
|
2091
2105
|
export declare const useStorageMigrationResidue: typeof trpc.storageMigration.residue.useQuery;
|
|
2092
2106
|
/** Generated alias around `trpc.storageMigration.drain.useMutation`. */
|