@camstack/ui-library 1.2.256 → 1.2.258
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/accelerator-label.d.ts +9 -9
- package/dist/composites/adaptive-downlink.d.ts +141 -143
- package/dist/composites/addon-global-settings-form.d.ts +73 -60
- package/dist/composites/addon-page-props.d.ts +34 -10
- package/dist/composites/agent-step-editor.d.ts +48 -47
- package/dist/composites/app-shell/app-shell.d.ts +17 -17
- package/dist/composites/app-shell/index.d.ts +3 -3
- package/dist/composites/app-shell/sidebar-item.d.ts +9 -8
- package/dist/composites/app-shell/sidebar.d.ts +10 -10
- package/dist/composites/audio-classification-list.d.ts +16 -15
- package/dist/composites/audio-level-waveform.d.ts +31 -30
- package/dist/composites/audio-waveform.d.ts +18 -17
- package/dist/composites/battery-badge.d.ts +27 -13
- package/dist/composites/breadcrumb.d.ts +21 -21
- package/dist/composites/camera-stream-player.d.ts +309 -309
- package/dist/composites/cap-settings/AutotrackSection.d.ts +19 -2
- package/dist/composites/cap-settings/CameraGridLayoutEditor.d.ts +24 -2
- package/dist/composites/cap-settings/ConsumablesPanel.d.ts +21 -2
- package/dist/composites/cap-settings/CoverageTrack.d.ts +21 -20
- package/dist/composites/cap-settings/EventBucketStrip.d.ts +21 -20
- package/dist/composites/cap-settings/EventHeatmap.d.ts +8 -7
- package/dist/composites/cap-settings/HomePresetPicker.d.ts +2 -2
- package/dist/composites/cap-settings/MaskShapeCanvas.d.ts +143 -41
- package/dist/composites/cap-settings/MotionZonesSettings.d.ts +41 -2
- package/dist/composites/cap-settings/NavigationPanel.d.ts +14 -2
- package/dist/composites/cap-settings/PrivacyMaskSettings.d.ts +3 -2
- package/dist/composites/cap-settings/PtzPanel.d.ts +15 -2
- package/dist/composites/cap-settings/RecordingBandsEditor.d.ts +33 -32
- package/dist/composites/cap-settings/RecordingPanel.d.ts +3 -2
- package/dist/composites/cap-settings/RecordingSettings.d.ts +11 -10
- package/dist/composites/cap-settings/RecordingTimeline.d.ts +3 -2
- package/dist/composites/cap-settings/SceneMonitorEditor.d.ts +3 -51
- package/dist/composites/cap-settings/SceneReferenceGallery.d.ts +62 -23
- package/dist/composites/cap-settings/SceneSettingsForm.d.ts +52 -16
- package/dist/composites/cap-settings/TimelineControls.d.ts +21 -20
- package/dist/composites/cap-settings/camera-grid-layout.d.ts +95 -95
- package/dist/composites/cap-settings/event-thumb.d.ts +9 -8
- package/dist/composites/cap-settings/index.d.ts +20 -20
- package/dist/composites/cap-settings/privacy-mask-audio.d.ts +47 -47
- package/dist/composites/cap-settings/recording-config-form.d.ts +25 -25
- package/dist/composites/cap-settings/recording-spans.d.ts +14 -14
- package/dist/composites/cap-settings/recording-timeline-model.d.ts +57 -57
- package/dist/composites/cap-settings/scene-monitor-copy.d.ts +58 -49
- package/dist/composites/client-network-sample.d.ts +41 -41
- package/dist/composites/clips/ClipBandBar.d.ts +44 -14
- package/dist/composites/clips/ClipPanel.d.ts +30 -6
- package/dist/composites/clips/ClipTile.d.ts +26 -5
- package/dist/composites/clips/ClipsSection.d.ts +107 -2
- package/dist/composites/clips/clip-band.d.ts +72 -38
- package/dist/composites/clips/clip-day-window.d.ts +7 -30
- package/dist/composites/clips/clip-source-state.d.ts +55 -26
- package/dist/composites/clips/clip-still-retry.d.ts +39 -39
- package/dist/composites/clips/clip-thumbnail-fetch.d.ts +9 -9
- package/dist/composites/clips/clip-tile-media.d.ts +64 -32
- package/dist/composites/clips/clip-view-state.d.ts +76 -46
- package/dist/composites/code-block.d.ts +5 -4
- package/dist/composites/config-form-builder.d.ts +14 -13
- package/dist/composites/config-form-field.d.ts +63 -62
- package/dist/composites/config-icon-field.d.ts +10 -9
- package/dist/composites/config-secret-field.d.ts +51 -27
- package/dist/composites/confirm-action-button.d.ts +52 -39
- package/dist/composites/confirm-dialog.d.ts +110 -48
- package/dist/composites/copy-button.d.ts +25 -19
- package/dist/composites/data-table/data-table-header.d.ts +8 -7
- package/dist/composites/data-table/data-table-pagination.d.ts +7 -6
- package/dist/composites/data-table/data-table-row.d.ts +8 -7
- package/dist/composites/data-table/data-table.d.ts +3 -2
- package/dist/composites/data-table/index.d.ts +2 -2
- package/dist/composites/data-table/types.d.ts +29 -29
- package/dist/composites/data-table-filter-bar.d.ts +30 -29
- package/dist/composites/data-table-filter.d.ts +34 -34
- package/dist/composites/data-table-layout.d.ts +24 -24
- package/dist/composites/data-table-pager.d.ts +5 -5
- package/dist/composites/data-table-pagination.d.ts +23 -23
- package/dist/composites/data-table-selection.d.ts +10 -10
- package/dist/composites/data-table.d.ts +167 -118
- package/dist/composites/detection-canvas.d.ts +34 -25
- package/dist/composites/detection-colors.d.ts +9 -9
- package/dist/composites/detection-overlay.d.ts +33 -32
- package/dist/composites/detection-result-tree.d.ts +22 -9
- package/dist/composites/dev-shell.d.ts +15 -14
- package/dist/composites/device-activity-panel.d.ts +37 -31
- package/dist/composites/device-card.d.ts +32 -32
- package/dist/composites/device-controls/ac-panel.d.ts +2 -2
- package/dist/composites/device-controls/alarm-hero-card.d.ts +42 -42
- package/dist/composites/device-controls/atoms.d.ts +50 -50
- package/dist/composites/device-controls/brightness-panel.d.ts +3 -3
- package/dist/composites/device-controls/button-control.d.ts +14 -14
- package/dist/composites/device-controls/climate-panel.d.ts +12 -12
- package/dist/composites/device-controls/container-primary-hero.d.ts +33 -16
- package/dist/composites/device-controls/container-primary.d.ts +68 -39
- package/dist/composites/device-controls/control-panel.d.ts +4 -4
- package/dist/composites/device-controls/control-registry.d.ts +81 -70
- package/dist/composites/device-controls/cover-hero-card.d.ts +26 -26
- package/dist/composites/device-controls/cover-inline.d.ts +20 -20
- package/dist/composites/device-controls/cover-panel.d.ts +2 -2
- package/dist/composites/device-controls/dummy-hero-card.d.ts +2 -2
- package/dist/composites/device-controls/fan-hero-card.d.ts +20 -20
- package/dist/composites/device-controls/fan-panel.d.ts +3 -3
- package/dist/composites/device-controls/humidifier-control.d.ts +46 -29
- package/dist/composites/device-controls/image-control.d.ts +41 -27
- package/dist/composites/device-controls/index.d.ts +34 -34
- package/dist/composites/device-controls/lawn-mower-control.d.ts +30 -16
- package/dist/composites/device-controls/light-hero-card.d.ts +15 -15
- package/dist/composites/device-controls/lock-hero-card.d.ts +14 -14
- package/dist/composites/device-controls/lock-panel.d.ts +3 -3
- package/dist/composites/device-controls/media-player-hero-card.d.ts +16 -16
- package/dist/composites/device-controls/media-player-panel.d.ts +7 -7
- package/dist/composites/device-controls/offline-badge.d.ts +23 -8
- package/dist/composites/device-controls/panel-controls.d.ts +39 -20
- package/dist/composites/device-controls/pet-feeder-panel.d.ts +27 -9
- package/dist/composites/device-controls/popover-row-action.d.ts +18 -6
- package/dist/composites/device-controls/primary-child-picker.d.ts +31 -15
- package/dist/composites/device-controls/primary-child.d.ts +14 -25
- package/dist/composites/device-controls/radial-gauge.d.ts +17 -17
- package/dist/composites/device-controls/script-automation-controls.d.ts +9 -9
- package/dist/composites/device-controls/sensor-hero-card.d.ts +26 -8
- package/dist/composites/device-controls/sensor-inline-control.d.ts +21 -9
- package/dist/composites/device-controls/sensor-value-atom.d.ts +97 -76
- package/dist/composites/device-controls/switch-hero-card.d.ts +11 -11
- package/dist/composites/device-controls/switch-panel.d.ts +2 -2
- package/dist/composites/device-controls/tap-toggle.d.ts +13 -13
- package/dist/composites/device-controls/thermostat-hero-card.d.ts +16 -16
- package/dist/composites/device-controls/types.d.ts +11 -11
- package/dist/composites/device-controls/update-control.d.ts +20 -7
- package/dist/composites/device-controls/vacuum-control.d.ts +41 -25
- package/dist/composites/device-controls/valve-control.d.ts +51 -35
- package/dist/composites/device-controls/water-heater-control.d.ts +48 -31
- package/dist/composites/device-controls/weather-control.d.ts +46 -28
- package/dist/composites/device-export-panel.d.ts +34 -34
- package/dist/composites/device-grid.d.ts +10 -10
- package/dist/composites/device-item/actions.d.ts +40 -18
- package/dist/composites/device-item/admin-link-quick-action.d.ts +66 -26
- package/dist/composites/device-item/child-layout.d.ts +43 -26
- package/dist/composites/device-item/child-section-accordion.d.ts +20 -6
- package/dist/composites/device-item/children-accordion.d.ts +11 -11
- package/dist/composites/device-item/container-children-context.d.ts +28 -11
- package/dist/composites/device-item/device-delete-action.d.ts +23 -5
- package/dist/composites/device-item/features.d.ts +33 -15
- package/dist/composites/device-item/header.d.ts +53 -31
- package/dist/composites/device-item/helpers.d.ts +291 -274
- package/dist/composites/device-item/index.d.ts +18 -9
- package/dist/composites/device-item/preview.d.ts +41 -21
- package/dist/composites/device-item/quick-detail-action.d.ts +4 -4
- package/dist/composites/device-item/reboot-quick-action.d.ts +28 -7
- package/dist/composites/device-item/role-display-defaults-context.d.ts +28 -12
- package/dist/composites/device-item/status-dot.d.ts +24 -6
- package/dist/composites/device-list/batch-actions-bar.d.ts +23 -12
- package/dist/composites/device-list/batch-toolbar.d.ts +13 -13
- package/dist/composites/device-list/columns.d.ts +108 -108
- package/dist/composites/device-list/device-integration.d.ts +48 -58
- package/dist/composites/device-list/device-mode.d.ts +121 -121
- package/dist/composites/device-list/empty-state.d.ts +14 -3
- package/dist/composites/device-list/filter-chips.d.ts +42 -29
- package/dist/composites/device-list/fuzzy-match.d.ts +22 -22
- package/dist/composites/device-list/generic-mode.d.ts +88 -88
- package/dist/composites/device-list/group.d.ts +62 -35
- package/dist/composites/device-list/hardware-cell.d.ts +14 -3
- package/dist/composites/device-list/hardware.d.ts +29 -11
- package/dist/composites/device-list/icon-action.d.ts +27 -15
- package/dist/composites/device-list/index.d.ts +46 -23
- package/dist/composites/device-list/multi-select.d.ts +17 -17
- package/dist/composites/device-list/page-size-select.d.ts +13 -7
- package/dist/composites/device-list/pagination.d.ts +19 -12
- package/dist/composites/device-list/sort.d.ts +28 -15
- package/dist/composites/device-list/sortable-header.d.ts +20 -7
- package/dist/composites/device-list/table-layout.d.ts +44 -44
- package/dist/composites/device-list/type-filter.d.ts +16 -16
- package/dist/composites/device-list/url-state.d.ts +35 -35
- package/dist/composites/device-meta.d.ts +43 -43
- package/dist/composites/device-picker/DevicePicker.d.ts +72 -33
- package/dist/composites/device-picker/SelectedChip.d.ts +10 -9
- package/dist/composites/device-picker/device-filter-bar.d.ts +19 -18
- package/dist/composites/device-picker/device-fleet-view.d.ts +11 -3
- package/dist/composites/device-picker/device-parent.d.ts +27 -27
- package/dist/composites/device-picker/device-picker-grouping.d.ts +3 -3
- package/dist/composites/device-picker/device-picker-model.d.ts +140 -140
- package/dist/composites/device-picker/device-selection-rows.d.ts +31 -24
- package/dist/composites/device-picker/device-selection.d.ts +43 -43
- package/dist/composites/device-picker/index.d.ts +9 -9
- package/dist/composites/device-select-field.d.ts +17 -16
- package/dist/composites/device-select-filter.d.ts +78 -78
- package/dist/composites/device-selector-picker.d.ts +25 -25
- package/dist/composites/device-step-matrix.d.ts +54 -28
- package/dist/composites/discovery-panel.d.ts +22 -22
- package/dist/composites/doorbell-recent-panel.d.ts +9 -8
- package/dist/composites/empty-state.d.ts +8 -8
- package/dist/composites/error-box.d.ts +32 -17
- package/dist/composites/event-kind-visuals.d.ts +29 -18
- package/dist/composites/event-stream.d.ts +59 -42
- package/dist/composites/extensions/AssociationSlotCard.d.ts +45 -24
- package/dist/composites/extensions/ExtensionsPanel.d.ts +41 -18
- package/dist/composites/extensions/extensions-view-state.d.ts +71 -53
- package/dist/composites/filter-bar.d.ts +22 -21
- package/dist/composites/form-field.d.ts +9 -9
- package/dist/composites/format-state-value.d.ts +23 -51
- package/dist/composites/grouped-model-selector.d.ts +7 -6
- package/dist/composites/hls-quality.d.ts +26 -26
- package/dist/composites/hls-video.d.ts +62 -39
- package/dist/composites/hover-zoom-image.d.ts +35 -16
- package/dist/composites/icon-picker.d.ts +86 -50
- package/dist/composites/image-selector.d.ts +21 -20
- package/dist/composites/index.d.ts +204 -204
- package/dist/composites/inference-config-selector.d.ts +36 -35
- package/dist/composites/kebab-menu.d.ts +53 -35
- package/dist/composites/key-value-list.d.ts +14 -14
- package/dist/composites/log-stream-scroll.d.ts +24 -24
- package/dist/composites/log-stream.d.ts +81 -70
- package/dist/composites/login-form.d.ts +7 -6
- package/dist/composites/model-bound-slider.d.ts +46 -26
- package/dist/composites/model-picker.d.ts +20 -19
- package/dist/composites/mount-addon-page.d.ts +12 -12
- package/dist/composites/network-link-badge.d.ts +7 -6
- package/dist/composites/node-picker.d.ts +14 -13
- package/dist/composites/notification-targets-field.d.ts +76 -58
- package/dist/composites/notification-targets-options.d.ts +9 -6
- package/dist/composites/option-select/OptionSelect.d.ts +23 -22
- package/dist/composites/option-select/index.d.ts +4 -4
- package/dist/composites/option-select/option-select-model.d.ts +35 -35
- package/dist/composites/page-header.d.ts +6 -6
- package/dist/composites/peer-connection-config.d.ts +9 -9
- package/dist/composites/phase-icon.d.ts +10 -3
- package/dist/composites/pipeline-builder.d.ts +21 -13
- package/dist/composites/pipeline-matrix-shared.d.ts +159 -150
- package/dist/composites/pipeline-runtime-selector.d.ts +12 -11
- package/dist/composites/pipeline-step.d.ts +39 -31
- package/dist/composites/placeholder-field/PlaceholderChipField.d.ts +23 -22
- package/dist/composites/placeholder-field/index.d.ts +1 -1
- package/dist/composites/provider-badge.d.ts +6 -5
- package/dist/composites/ptz-overlay.d.ts +38 -18
- package/dist/composites/qr-code.d.ts +24 -10
- package/dist/composites/reconnect-schedule.d.ts +22 -22
- package/dist/composites/resolve-step-default-model.d.ts +94 -94
- package/dist/composites/response-log.d.ts +7 -6
- package/dist/composites/root-model-source.d.ts +21 -10
- package/dist/composites/scope-picker.d.ts +49 -25
- package/dist/composites/section-card.d.ts +19 -11
- package/dist/composites/setting-row.d.ts +39 -21
- package/dist/composites/snapshot-button.d.ts +23 -19
- package/dist/composites/sort-header-button.d.ts +25 -8
- package/dist/composites/stat-card.d.ts +20 -8
- package/dist/composites/state-values-stream.d.ts +49 -24
- package/dist/composites/status-badge.d.ts +10 -8
- package/dist/composites/step-inspector/gate-control.d.ts +13 -12
- package/dist/composites/step-inspector/index.d.ts +8 -8
- package/dist/composites/step-inspector/layered-settings-form.d.ts +41 -30
- package/dist/composites/step-inspector/segmented-choice.d.ts +8 -7
- package/dist/composites/step-inspector/setting-values.d.ts +13 -8
- package/dist/composites/step-inspector/step-detail-dock.d.ts +39 -23
- package/dist/composites/step-inspector/step-inspector-panel.d.ts +34 -28
- package/dist/composites/step-inspector/step-model-row.d.ts +29 -24
- package/dist/composites/step-inspector/step-search.d.ts +11 -11
- package/dist/composites/step-timings.d.ts +7 -6
- package/dist/composites/step-tree.d.ts +17 -12
- package/dist/composites/stream-broker-selector.d.ts +29 -8
- package/dist/composites/stream-debug/stream-debug-overlay.d.ts +40 -40
- package/dist/composites/stream-debug/webrtc-debug-stats.d.ts +144 -129
- package/dist/composites/stream-panel.d.ts +212 -201
- package/dist/composites/table-sort.d.ts +61 -61
- package/dist/composites/timezone-selector.d.ts +15 -13
- package/dist/composites/training/send-frame-to-training.d.ts +5 -4
- package/dist/composites/training/training-collection-picker.d.ts +4 -3
- package/dist/composites/training/training-refusal-text.d.ts +6 -6
- package/dist/composites/unit-picker/UnitPicker.d.ts +19 -14
- package/dist/composites/unit-picker/index.d.ts +1 -1
- package/dist/composites/use-data-table-filter.d.ts +19 -19
- package/dist/composites/version-badge.d.ts +19 -18
- package/dist/composites/webrtc-diagnostics/EndpointTestCard.d.ts +7 -7
- package/dist/composites/webrtc-diagnostics/HubSessionTestCard.d.ts +14 -14
- package/dist/composites/webrtc-diagnostics/RunReport.d.ts +10 -5
- package/dist/composites/webrtc-diagnostics/endpoint-probe.d.ts +41 -21
- package/dist/composites/webrtc-diagnostics/endpoint-test.d.ts +37 -32
- package/dist/composites/webrtc-diagnostics/format.d.ts +3 -3
- package/dist/composites/webrtc-diagnostics/ice-candidates.d.ts +49 -49
- package/dist/composites/webrtc-diagnostics/nat-mapping.d.ts +36 -36
- package/dist/composites/webrtc-diagnostics/session-run.d.ts +108 -95
- package/dist/composites/webrtc-diagnostics/session-verdict.d.ts +29 -20
- package/dist/composites/widget-panel.d.ts +23 -23
- package/dist/composites/widget-slot.d.ts +35 -17
- package/dist/contexts/custom-field-renderers.d.ts +53 -17
- package/dist/contexts/device-context.d.ts +32 -12
- package/dist/contexts/device-quick-detail.d.ts +13 -4
- package/dist/contexts/player-overlays.d.ts +82 -42
- package/dist/contexts/recorded-playback.d.ts +40 -18
- package/dist/contexts/system-context.d.ts +28 -13
- package/dist/contexts/vod-playback.d.ts +39 -22
- package/dist/contexts/widget-registry.d.ts +139 -102
- package/dist/contexts/zone-editing.d.ts +69 -46
- package/dist/generated/system-hooks.d.ts +17 -1
- package/dist/hooks/index.d.ts +43 -43
- package/dist/hooks/turn-server-cache.d.ts +69 -69
- package/dist/hooks/use-capability-presence.d.ts +65 -28
- package/dist/hooks/use-cluster-nodes.d.ts +54 -27
- package/dist/hooks/use-device-autotrack.d.ts +7 -7
- package/dist/hooks/use-device-battery.d.ts +24 -11
- package/dist/hooks/use-device-cap-slice.d.ts +15 -15
- package/dist/hooks/use-device-capability.d.ts +61 -27
- package/dist/hooks/use-device-detections.d.ts +32 -32
- package/dist/hooks/use-device-features.d.ts +18 -18
- package/dist/hooks/use-device-list-page-size.d.ts +19 -6
- package/dist/hooks/use-device-network-link.d.ts +15 -7
- package/dist/hooks/use-device-proxy.d.ts +98 -92
- package/dist/hooks/use-device-snapshot.d.ts +23 -23
- package/dist/hooks/use-device-webrtc.d.ts +211 -205
- package/dist/hooks/use-devices.d.ts +9 -9
- package/dist/hooks/use-doorbell-events.d.ts +13 -13
- package/dist/hooks/use-event-stream.d.ts +6 -3
- package/dist/hooks/use-is-mobile.d.ts +5 -5
- package/dist/hooks/use-live-buffer.d.ts +5 -5
- package/dist/hooks/use-live-event.d.ts +1 -1
- package/dist/hooks/use-navigation.d.ts +20 -20
- package/dist/hooks/use-optimistic-slice.d.ts +13 -13
- package/dist/hooks/use-persisted-page-size.d.ts +10 -10
- package/dist/hooks/use-ptz.d.ts +108 -108
- package/dist/hooks/use-stationary-overlay.d.ts +37 -37
- package/dist/hooks/use-system-query.d.ts +33 -10
- package/dist/hooks/use-url-query.d.ts +3 -3
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/provider-icons.d.ts +2 -2
- package/dist/icons/status-icons.d.ts +2 -2
- package/dist/index.cjs +123 -69
- package/dist/index.d.ts +31 -27
- package/dist/index.js +123 -69
- package/dist/lib/cap-error.d.ts +18 -39
- package/dist/lib/cn.d.ts +1 -1
- package/dist/lib/fleet-query-defaults.d.ts +68 -34
- package/dist/lib/format-control-datetime.d.ts +16 -16
- package/dist/lib/format-duration.d.ts +12 -12
- package/dist/lib/format-last-seen.d.ts +5 -18
- package/dist/lib/format-numeric.d.ts +7 -7
- package/dist/lib/hub-mount.d.ts +8 -42
- package/dist/lib/index.d.ts +21 -21
- package/dist/lib/phase-config.d.ts +24 -11
- package/dist/lib/pipeline-mirror.d.ts +16 -16
- package/dist/lib/recorded-control-protocol.d.ts +41 -43
- package/dist/lib/resolve-sensor-display.d.ts +36 -20
- package/dist/lib/responsive.d.ts +54 -54
- package/dist/lib/scrub-controller.d.ts +75 -78
- package/dist/lib/shared-context.d.ts +27 -2
- package/dist/lib/tailwind-variants.d.ts +20 -20
- package/dist/primitives/badge.d.ts +5 -10
- package/dist/primitives/bottom-sheet.d.ts +7 -7
- package/dist/primitives/button.d.ts +5 -9
- package/dist/primitives/card.d.ts +4 -8
- package/dist/primitives/checkbox.d.ts +3 -4
- package/dist/primitives/collapsible-card.d.ts +23 -13
- package/dist/primitives/dialog.d.ts +33 -59
- package/dist/primitives/dropdown.d.ts +13 -13
- package/dist/primitives/floating-panel.d.ts +41 -20
- package/dist/primitives/icon-button.d.ts +8 -12
- package/dist/primitives/index.d.ts +22 -22
- package/dist/primitives/input.d.ts +6 -16
- package/dist/primitives/label.d.ts +3 -4
- package/dist/primitives/mobile-drawer.d.ts +8 -8
- package/dist/primitives/password-input.d.ts +18 -18
- package/dist/primitives/popover.d.ts +7 -7
- package/dist/primitives/scroll-area.d.ts +3 -4
- package/dist/primitives/select.d.ts +20 -20
- package/dist/primitives/separator.d.ts +4 -8
- package/dist/primitives/skeleton.d.ts +3 -4
- package/dist/primitives/switch.d.ts +6 -6
- package/dist/primitives/tabs.d.ts +26 -26
- package/dist/primitives/tooltip.d.ts +12 -12
- package/dist/theme/create-theme.d.ts +1 -1
- package/dist/theme/defaults.d.ts +1 -1
- package/dist/theme/index.d.ts +6 -6
- package/dist/theme/theme-provider.d.ts +8 -7
- package/dist/theme/theme-to-css.d.ts +1 -1
- package/dist/theme/types.d.ts +98 -100
- package/dist/theme/use-theme-mode.d.ts +1 -1
- package/dist/trpc-react.d.ts +23 -3
- package/dist/widgets/host-widgets.d.ts +4 -4
- package/package.json +8 -4
- package/src/tailwind/camstack-theme.css +11 -0
- package/dist/composites/unit-picker/UnitPicker.spec.d.ts +0 -1
|
@@ -1,45 +1,72 @@
|
|
|
1
|
-
import { DeviceItemDevice } from '../device-item/helpers';
|
|
2
1
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
* groupTopLevelAndAccessories — pure splitter for the DeviceList
|
|
3
|
+
* row pipeline.
|
|
4
|
+
*
|
|
5
|
+
* Classification:
|
|
6
|
+
* - Top-level rows: standalone devices (`parentDeviceId === null`)
|
|
7
|
+
* plus adopted devices whose parent is a hub or NVR (e.g. cameras
|
|
8
|
+
* under a `Home hub`). Adopted devices keep their parent badge but
|
|
9
|
+
* render as primary rows + paginate.
|
|
10
|
+
* - Accessories: devices whose parent is a CAMERA (or any non-
|
|
11
|
+
* hub/nvr type). Render nested under the parent's chevron.
|
|
12
|
+
*
|
|
13
|
+
* Why parent-type and not the device's own `role`: the wire response
|
|
14
|
+
* from `deviceManager.listAll` ships `role: null` even for siren /
|
|
15
|
+
* floodlight / pir-sensor children — `device.role` is currently only
|
|
16
|
+
* populated on the in-memory `IDevice` instance and is dropped during
|
|
17
|
+
* `toDeviceInfo()` projection. Using parent-type gives the same answer
|
|
18
|
+
* without depending on a field that's empty in practice. As a defensive
|
|
19
|
+
* fallback we ALSO treat any row with a non-null `role` as an accessory
|
|
20
|
+
* so a future wire fix doesn't accidentally re-flatten the table.
|
|
21
|
+
*
|
|
22
|
+
* - Orphan accessories (parentDeviceId references a device not in
|
|
23
|
+
* the input list) fall through to topLevel — better to show them
|
|
24
|
+
* once with a stale parent badge than hide them entirely.
|
|
25
|
+
*
|
|
26
|
+
* Pure: no side effects, no React; testable as a unit.
|
|
27
|
+
*/
|
|
28
|
+
import type { DeviceItemDevice } from "../device-item/helpers";
|
|
29
|
+
/**
|
|
30
|
+
* countableDevices — the subset of `devices` that should be counted in
|
|
31
|
+
* the device-list footer "Showing N of **M** devices".
|
|
32
|
+
*
|
|
33
|
+
* A device is countable when:
|
|
34
|
+
* - it has no parent (`parentDeviceId === null`), OR
|
|
35
|
+
* - its parent's type is a hub-like owner (`hub` / `nvr`) — an NVR's
|
|
36
|
+
* cameras and a hub's children are real, individually-operable devices.
|
|
37
|
+
*
|
|
38
|
+
* Excluded:
|
|
39
|
+
* - devices whose parent has type `container` — a Container is a grouping
|
|
40
|
+
* shell for entity-children (e.g. a HA device's entities); the children
|
|
41
|
+
* are represented by the parent row and must NOT inflate the total.
|
|
42
|
+
* - orphan devices (parent id present but not in the input list) are
|
|
43
|
+
* treated as countable — better to over-count by one than hide them.
|
|
44
|
+
*
|
|
45
|
+
* Pure: builds a `Map<id, device>` once and then filters in a single pass.
|
|
46
|
+
*/
|
|
20
47
|
export declare function countableDevices(devices: readonly DeviceItemDevice[]): readonly DeviceItemDevice[];
|
|
21
48
|
export interface GroupedDevices {
|
|
22
|
-
|
|
23
|
-
|
|
49
|
+
readonly topLevel: readonly DeviceItemDevice[];
|
|
50
|
+
readonly accessoriesByParent: ReadonlyMap<number, readonly DeviceItemDevice[]>;
|
|
24
51
|
}
|
|
25
52
|
/** Options for `groupTopLevelAndAccessories`. */
|
|
26
53
|
export interface GroupDevicesOptions {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
/** Include devices carrying an operator `display.hidden` override. Default
|
|
55
|
+
* false — hidden devices are omitted from BOTH top-level and accessory
|
|
56
|
+
* lists. NOTE: distinct from the HA `accessories` cap `hiddenChildIds`
|
|
57
|
+
* mechanism (container-scoped, provider-persisted) — this is the device-level
|
|
58
|
+
* `display.hidden` flag. A future "show hidden" toggle flips this one prop. */
|
|
59
|
+
readonly includeHidden?: boolean;
|
|
33
60
|
}
|
|
34
61
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
62
|
+
* Re-order top-level rows so an ADOPTED device sits immediately after its
|
|
63
|
+
* parent row (a camera adopted by a `Home hub` is a primary row by design,
|
|
64
|
+
* but a primary row whose family is scattered across the table reads as a
|
|
65
|
+
* bug — the operator saw a standalone camera WEDGED between a hub and its
|
|
66
|
+
* two children). Pure and stable: parents/standalone keep their incoming
|
|
67
|
+
* relative order, siblings keep theirs, and a child whose parent is not a
|
|
68
|
+
* top-level row keeps its own position (emitted in the leftover pass —
|
|
69
|
+
* never dropped).
|
|
70
|
+
*/
|
|
44
71
|
export declare function orderAdoptedAfterParent(rows: readonly DeviceItemDevice[]): readonly DeviceItemDevice[];
|
|
45
72
|
export declare function groupTopLevelAndAccessories(devices: readonly DeviceItemDevice[], options?: GroupDevicesOptions): GroupedDevices;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `<HardwareCell>` — the inner content of the device-table `manufacturer`
|
|
3
|
+
* column's `<td>`. Renders the compact `manufacturer · model` label and, on
|
|
4
|
+
* hover/focus, a tooltip listing the FULL device-metadata identity blob
|
|
5
|
+
* (every string-coercible, non-empty key/value pair).
|
|
6
|
+
*
|
|
7
|
+
* Reuses the shared `<Tooltip>` primitive (`primitives/tooltip`). The default
|
|
8
|
+
* tooltip is single-line (`whitespace-nowrap`); we override that so the
|
|
9
|
+
* key/value list wraps and left-aligns. When there's no usable metadata the
|
|
10
|
+
* cell shows an em-dash and no tooltip wraps it (nothing to reveal).
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactNode } from "react";
|
|
13
|
+
import type { DeviceItemDevice } from "../device-item/helpers";
|
|
3
14
|
interface HardwareCellProps {
|
|
4
|
-
|
|
15
|
+
readonly device: DeviceItemDevice;
|
|
5
16
|
}
|
|
6
17
|
export declare function HardwareCell({ device }: HardwareCellProps): ReactNode;
|
|
7
18
|
export {};
|
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for the device-table `manufacturer` column.
|
|
3
|
+
*
|
|
4
|
+
* A device's hardware/identity blob lives in `DeviceItemDevice.metadata`
|
|
5
|
+
* (mirror of `DeviceInfo.metadata`) — a driver-populated, free-form
|
|
6
|
+
* `Record<string, unknown>`. Keys are NOT a fixed enum; values are arbitrary.
|
|
7
|
+
* These helpers coerce that untrusted blob into safe display strings:
|
|
8
|
+
*
|
|
9
|
+
* - `metadataString` — read ONE key as a trimmed non-empty string, else null.
|
|
10
|
+
* - `hardwareLabel` — the compact cell text (`manufacturer · model`).
|
|
11
|
+
* - `metadataEntries` — the full key/value list for the tooltip (only
|
|
12
|
+
* string-coercible, non-empty values; stable insertion order).
|
|
13
|
+
* - `compareHardware` — comparator on `manufacturer` then `model`.
|
|
14
|
+
*
|
|
15
|
+
* The `unknown` → string boundary is handled with a `typeof === 'string'`
|
|
16
|
+
* guard plus a numeric/boolean coercion fallback; objects/arrays/null are
|
|
17
|
+
* skipped (never `String([object Object])`).
|
|
18
|
+
*/
|
|
19
|
+
import type { DeviceItemDevice } from "../device-item/helpers";
|
|
2
20
|
/** Coerce a single metadata value to a trimmed, non-empty display string.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
21
|
+
* Strings pass through (trimmed); finite numbers + booleans coerce; every
|
|
22
|
+
* other shape (object, array, null, undefined, NaN) yields `null` so callers
|
|
23
|
+
* skip it rather than render a useless `[object Object]`. */
|
|
6
24
|
export declare function metadataValueString(value: unknown): string | null;
|
|
7
25
|
/** Read one metadata key as a safe display string (null when absent/empty). */
|
|
8
26
|
export declare function metadataString(metadata: Readonly<Record<string, unknown>> | null | undefined, key: string): string | null;
|
|
9
27
|
/** Compact cell text: `manufacturer · model`, or whichever is present, or
|
|
10
|
-
|
|
28
|
+
* `null` when neither is a usable string (caller renders the empty state). */
|
|
11
29
|
export declare function hardwareLabel(device: DeviceItemDevice): string | null;
|
|
12
30
|
/** A single key/value pair for the metadata tooltip dump. */
|
|
13
31
|
export interface MetadataEntry {
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
readonly key: string;
|
|
33
|
+
readonly value: string;
|
|
16
34
|
}
|
|
17
35
|
/** All string-coercible, non-empty metadata entries in insertion order — the
|
|
18
|
-
|
|
36
|
+
* full identity blob for the tooltip. Empty array when there's nothing to show. */
|
|
19
37
|
export declare function metadataEntries(metadata: Readonly<Record<string, unknown>> | null | undefined): readonly MetadataEntry[];
|
|
20
38
|
/** True when the device advertises a non-empty `manufacturer`. Drives the
|
|
21
|
-
|
|
39
|
+
* direction-independent "missing sorts last" rule in `sortRows`. */
|
|
22
40
|
export declare function hasManufacturer(device: DeviceItemDevice): boolean;
|
|
23
41
|
/** Ascending, case-insensitive comparator on `manufacturer` then `model`. The
|
|
24
|
-
|
|
25
|
-
|
|
42
|
+
* "missing manufacturer sorts last" rule is applied direction-independently by
|
|
43
|
+
* the caller (`sortRows`); this comparator only orders the values themselves. */
|
|
26
44
|
export declare function compareHardware(a: DeviceItemDevice, b: DeviceItemDevice): number;
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IconAction — icon-only action button for condensed table action cells.
|
|
3
|
+
*
|
|
4
|
+
* Absorbed from the (now-retired in Phase 5) `device-table/cells.tsx` so the
|
|
5
|
+
* unified `device-list/` table owns its own condensation helpers and does not
|
|
6
|
+
* depend on the skeleton directory.
|
|
7
|
+
*
|
|
8
|
+
* The `label` is accessible via `aria-label` and `title` but is NOT rendered as
|
|
9
|
+
* visible text, keeping the button compact at narrow widths. A `danger` flag
|
|
10
|
+
* applies the `text-danger` token (and matching hover) for destructive actions
|
|
11
|
+
* such as Delete, which keep their red treatment even when condensed to an icon.
|
|
12
|
+
*/
|
|
13
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
14
|
export interface IconActionProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
/** Lucide icon component (or any component accepting `className?: string`). */
|
|
16
|
+
readonly icon: ComponentType<{
|
|
17
|
+
className?: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** Human-readable label — exposed via aria-label + title, NOT as visible text. */
|
|
20
|
+
readonly label: string;
|
|
21
|
+
/** Click handler. */
|
|
22
|
+
readonly onClick: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* When true, applies a red/destructive accent to the button. Use for Delete
|
|
25
|
+
* and other irreversible actions — Delete keeps red even icon-only.
|
|
26
|
+
*/
|
|
27
|
+
readonly danger?: boolean;
|
|
16
28
|
}
|
|
17
|
-
export declare function IconAction({ icon: Icon, label, onClick, danger
|
|
29
|
+
export declare function IconAction({ icon: Icon, label, onClick, danger }: IconActionProps): ReactNode;
|
|
@@ -1,27 +1,50 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DeviceListDeviceProps } from './device-mode';
|
|
3
|
-
import { DeviceListGenericProps } from './generic-mode';
|
|
4
|
-
export { countableDevices } from './group';
|
|
5
|
-
export { resolveDeviceIntegration, deviceIntegrationResolver } from './device-integration';
|
|
6
|
-
export type { DeviceIntegrationLink, DeviceIntegrationRef, DeviceIntegrationResolution, DeviceIntegrationResolver, } from './device-integration';
|
|
7
|
-
export { fuzzyMatch, normalizeForSearch } from './fuzzy-match';
|
|
8
|
-
export { DEVICE_COLUMNS, columnsForContext, COLUMN_PRIORITY, COLUMN_BREAKPOINT_CLASS, } from './columns';
|
|
9
|
-
export type { DeviceColumnId, TableContext } from './columns';
|
|
10
|
-
export { nextSort, sortRows } from './sort';
|
|
11
|
-
export type { DeviceSort, SortDirection, SortableColumnId } from './sort';
|
|
12
|
-
export { hardwareLabel, metadataEntries, metadataString } from './hardware';
|
|
13
|
-
export { IconAction, type IconActionProps } from './icon-action';
|
|
14
|
-
export type { DeviceListAddonOption, DeviceListDeviceProps, DeviceListBatchActions, DeviceListIntegrationIconResolver, DeviceListIntegrationOption, } from './device-mode';
|
|
15
|
-
export type { DeviceListColumn, DeviceListGenericProps, GenericPageSizeSelector, } from './generic-mode';
|
|
16
|
-
export { PageSizeSelect, pageSizeLabel, type PageSizeSelectProps } from './page-size-select';
|
|
17
1
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
* <DeviceList> — paginated, filterable, view-toggleable device list.
|
|
3
|
+
*
|
|
4
|
+
* Composes:
|
|
5
|
+
* - useDeviceListUrlState (URL+LS hybrid)
|
|
6
|
+
* - groupTopLevelAndAccessories (top-level vs accessory split)
|
|
7
|
+
* - <Pagination>, <FilterChips>, <DeviceListEmptyState>
|
|
8
|
+
* - <DeviceItem view={view}> per row
|
|
9
|
+
*
|
|
10
|
+
* Realtime: per-page useEventInvalidation calls remain authoritative for
|
|
11
|
+
* Phase 2. Lifting the sync into ui-library would require a context bridge
|
|
12
|
+
* that's out of scope.
|
|
13
|
+
*
|
|
14
|
+
* Search: debounced 300 ms before pushing to URL state. A search NARROWS the
|
|
15
|
+
* rows and never opens a parent — the chevron is the only thing that does,
|
|
16
|
+
* and what it opened survives the search (`DeviceModeList.openParents`).
|
|
17
|
+
*
|
|
18
|
+
* This module is the dispatcher + public barrel. The two render paths live
|
|
19
|
+
* in focused sibling files:
|
|
20
|
+
* - device-mode.tsx → the default registry-device list (table/cards)
|
|
21
|
+
* - generic-mode.tsx → the generic render-prop list (`mode:'generic'`)
|
|
22
|
+
* - table-layout.tsx / cards-layout.tsx → device-mode row layouts
|
|
23
|
+
*/
|
|
24
|
+
import { type ReactNode } from "react";
|
|
25
|
+
import { type DeviceListDeviceProps } from "./device-mode";
|
|
26
|
+
import { type DeviceListGenericProps } from "./generic-mode";
|
|
27
|
+
export { countableDevices } from "./group";
|
|
28
|
+
export { resolveDeviceIntegration, deviceIntegrationResolver } from "./device-integration";
|
|
29
|
+
export type { DeviceIntegrationLink, DeviceIntegrationRef, DeviceIntegrationResolution, DeviceIntegrationResolver } from "./device-integration";
|
|
30
|
+
export { fuzzyMatch, normalizeForSearch } from "./fuzzy-match";
|
|
31
|
+
export { DEVICE_COLUMNS, columnsForContext, COLUMN_PRIORITY, COLUMN_BREAKPOINT_CLASS } from "./columns";
|
|
32
|
+
export type { DeviceColumnId, TableContext } from "./columns";
|
|
33
|
+
export { nextSort, sortRows } from "./sort";
|
|
34
|
+
export type { DeviceSort, SortDirection, SortableColumnId } from "./sort";
|
|
35
|
+
export { hardwareLabel, metadataEntries, metadataString } from "./hardware";
|
|
36
|
+
export { IconAction, type IconActionProps } from "./icon-action";
|
|
37
|
+
export type { DeviceListAddonOption, DeviceListDeviceProps, DeviceListBatchActions, DeviceListIntegrationIconResolver, DeviceListIntegrationOption } from "./device-mode";
|
|
38
|
+
export type { DeviceListColumn, DeviceListGenericProps, GenericPageSizeSelector } from "./generic-mode";
|
|
39
|
+
export { PageSizeSelect, pageSizeLabel, type PageSizeSelectProps } from "./page-size-select";
|
|
40
|
+
/**
|
|
41
|
+
* Default registry-device list, or a generic render-prop list (`mode:'generic'`).
|
|
42
|
+
* Existing call sites pass no `mode` and resolve to the device variant unchanged.
|
|
43
|
+
*/
|
|
21
44
|
export type DeviceListProps<T = unknown> = DeviceListDeviceProps | DeviceListGenericProps<T>;
|
|
22
45
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
* Dispatcher: default registry-device list, or a generic render-prop list when
|
|
47
|
+
* `mode:'generic'`. The two paths are separate component instances so their
|
|
48
|
+
* hooks never interleave (a given call site's mode is stable).
|
|
49
|
+
*/
|
|
27
50
|
export declare function DeviceList<T = unknown>(props: DeviceListProps<T>): ReactNode;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { LucideIcon } from
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type LucideIcon } from "lucide-react";
|
|
3
3
|
export interface MultiSelectOption {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly icon?: LucideIcon;
|
|
7
7
|
}
|
|
8
8
|
export interface MultiSelectDropdownProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/** Trigger label, e.g. "Type". A count badge is appended when items are selected. */
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly options: readonly MultiSelectOption[];
|
|
12
|
+
readonly selected: readonly string[];
|
|
13
|
+
readonly onChange: (selected: readonly string[]) => void;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export declare function MultiSelectDropdown({ label, options, selected, onChange
|
|
16
|
+
* Compact multi-select dropdown — a single chip-sized trigger ("Label · N")
|
|
17
|
+
* that opens a checklist. Self-contained (outside-click / Escape dismiss), so
|
|
18
|
+
* it stays compressed regardless of how many options exist or how little
|
|
19
|
+
* horizontal room the container has. Shared by the device list's generic-mode
|
|
20
|
+
* type filter and any other multi-select needs.
|
|
21
|
+
*/
|
|
22
|
+
export declare function MultiSelectDropdown({ label, options, selected, onChange }: MultiSelectDropdownProps): ReactNode;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* <PageSizeSelect> — the "Per page" control under a paginated list.
|
|
3
|
+
*
|
|
4
|
+
* One control for both list modes (the device table and the generic table),
|
|
5
|
+
* so the two never drift in look or wording. `PAGE_SIZE_ALL` renders as "All".
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactNode } from "react";
|
|
2
8
|
export interface PageSizeSelectProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
readonly value: number;
|
|
10
|
+
readonly options: readonly number[];
|
|
11
|
+
readonly onChange: (size: number) => void;
|
|
12
|
+
/** Accessible name — names what is being paged ("Devices per page"). */
|
|
13
|
+
readonly ariaLabel: string;
|
|
8
14
|
}
|
|
9
15
|
export declare function pageSizeLabel(size: number): string;
|
|
10
|
-
export declare function PageSizeSelect({ value, options, onChange, ariaLabel
|
|
16
|
+
export declare function PageSizeSelect({ value, options, onChange, ariaLabel }: PageSizeSelectProps): ReactNode;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* <Pagination> — numbered-pages-with-ellipsis control.
|
|
3
|
+
*
|
|
4
|
+
* Layout: Showing 51–100 of 312 devices [<] 1 … 3 4 [5] 6 7 … 28 [>]
|
|
5
|
+
*
|
|
6
|
+
* Returns `null` when totalItems <= pageSize (single page — no nav).
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from "react";
|
|
2
9
|
export interface PaginationProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
readonly currentPage: number;
|
|
11
|
+
readonly totalItems: number;
|
|
12
|
+
readonly pageSize: number;
|
|
13
|
+
readonly onPageChange: (page: number) => void;
|
|
14
|
+
/** Singular noun for the showing-info label. Default `'devices'`. */
|
|
15
|
+
readonly itemNoun?: string;
|
|
9
16
|
}
|
|
10
17
|
export type PageButton = {
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
readonly kind: "page";
|
|
19
|
+
readonly n: number;
|
|
13
20
|
} | {
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
readonly kind: "ellipsis";
|
|
22
|
+
readonly side: "left" | "right";
|
|
16
23
|
};
|
|
17
24
|
export declare function computePageButtons(currentPage: number, totalPages: number): readonly PageButton[];
|
|
18
|
-
export declare function Pagination({ currentPage, totalItems, pageSize, onPageChange, itemNoun
|
|
25
|
+
export declare function Pagination({ currentPage, totalItems, pageSize, onPageChange, itemNoun }: PaginationProps): ReactNode;
|
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Device-table column sorting (top-level rows only).
|
|
3
|
+
*
|
|
4
|
+
* Only `name`, `type`, and `manufacturer` are sortable. Sorting reorders the
|
|
5
|
+
* TOP-LEVEL device rows; accessory children stay grouped under their parent
|
|
6
|
+
* (they're looked up per-parent-id from `accessoriesByParent`, not part of this
|
|
7
|
+
* list), so sorting parents never lifts a child to the top level.
|
|
8
|
+
*
|
|
9
|
+
* `sortRows` is pure: it returns a NEW array and never mutates the input. A
|
|
10
|
+
* `null` sort = current order, returned as a fresh shallow copy. The sort is
|
|
11
|
+
* stable (Array.prototype.sort is stable in every supported runtime) so equal
|
|
12
|
+
* keys keep their incoming relative order.
|
|
13
|
+
*/
|
|
14
|
+
import type { DeviceItemDevice } from "../device-item/helpers";
|
|
2
15
|
/** Columns that expose a clickable sort header. */
|
|
3
|
-
export type SortableColumnId =
|
|
4
|
-
export type SortDirection =
|
|
16
|
+
export type SortableColumnId = "name" | "type" | "manufacturer";
|
|
17
|
+
export type SortDirection = "asc" | "desc";
|
|
5
18
|
export interface DeviceSort {
|
|
6
|
-
|
|
7
|
-
|
|
19
|
+
readonly columnId: SortableColumnId;
|
|
20
|
+
readonly dir: SortDirection;
|
|
8
21
|
}
|
|
9
22
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
* Toggle a column's sort on header click: none → asc → desc → none.
|
|
24
|
+
* Clicking a DIFFERENT column starts it fresh at `asc`.
|
|
25
|
+
*
|
|
26
|
+
* The rule itself lives in `composites/table-sort.ts` and is shared with
|
|
27
|
+
* `DataTable` — this function only re-labels the result with the device
|
|
28
|
+
* list's own `columnId` vocabulary.
|
|
29
|
+
*/
|
|
17
30
|
export declare function nextSort(current: DeviceSort | null, columnId: SortableColumnId): DeviceSort | null;
|
|
18
31
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
* Return a NEW array of the top-level rows in sorted order. `null` ⇒ a fresh
|
|
33
|
+
* copy in the original order. Stable + immutable; the input is never mutated.
|
|
34
|
+
*/
|
|
22
35
|
export declare function sortRows(rows: readonly DeviceItemDevice[], sort: DeviceSort | null): readonly DeviceItemDevice[];
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The device table's sortable column header.
|
|
3
|
+
*
|
|
4
|
+
* The rendering — label + chevron indicator + hover placeholder — lives in
|
|
5
|
+
* `composites/sort-header-button.tsx` and is shared with `DataTable`. This
|
|
6
|
+
* file is the device-list adapter: it maps `DeviceSort` (which keys columns by
|
|
7
|
+
* `columnId`) onto the shared control's `active`/`dir` pair. It exists so the
|
|
8
|
+
* device list keeps its own column vocabulary without a second copy of the
|
|
9
|
+
* button.
|
|
10
|
+
*
|
|
11
|
+
* The owning `<th>` carries `aria-sort` (WAI-ARIA scopes it to `<th>`/`<td>`);
|
|
12
|
+
* non-sortable columns keep plain static text and never mount this.
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from "react";
|
|
15
|
+
import type { DeviceSort, SortableColumnId } from "./sort";
|
|
3
16
|
interface SortableHeaderButtonProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
17
|
+
readonly columnId: SortableColumnId;
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly sort: DeviceSort | null;
|
|
20
|
+
readonly onSort: (columnId: SortableColumnId) => void;
|
|
8
21
|
}
|
|
9
|
-
export declare function SortableHeaderButton({ columnId, label, sort, onSort
|
|
22
|
+
export declare function SortableHeaderButton({ columnId, label, sort, onSort }: SortableHeaderButtonProps): ReactNode;
|
|
10
23
|
export {};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { UseDeviceProxyTrpc } from
|
|
3
|
-
import { DeviceItemDevice, DeviceItemParent } from
|
|
4
|
-
import { DeviceColumnId } from
|
|
5
|
-
import { DeviceSort, SortableColumnId } from
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { UseDeviceProxyTrpc } from "../../hooks/use-device-proxy";
|
|
3
|
+
import type { DeviceItemDevice, DeviceItemParent } from "../device-item/helpers";
|
|
4
|
+
import { type DeviceColumnId } from "./columns";
|
|
5
|
+
import type { DeviceSort, SortableColumnId } from "./sort";
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
* The row-layout contract. It used to live in `cards-layout.tsx` and be
|
|
8
|
+
* EXTENDED here, because two layouts shared it. The cards layout is gone — the
|
|
9
|
+
* device list is a table, always — so the contract lives with its only
|
|
10
|
+
* implementation rather than in a file that exists to be inherited from.
|
|
11
|
+
*/
|
|
12
12
|
interface DeviceRowsProps {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
readonly rows: readonly DeviceItemDevice[];
|
|
14
|
+
readonly accessoriesByParent: ReadonlyMap<number, readonly DeviceItemDevice[]>;
|
|
15
|
+
readonly trpc: UseDeviceProxyTrpc;
|
|
16
|
+
/** The badge beside a row's name — already bound to the row's resolved
|
|
17
|
+
* integration by the device-mode wrapper. */
|
|
18
|
+
readonly resolveIntegrationIcon: ((device: DeviceItemDevice) => ReactNode | null) | null;
|
|
19
|
+
readonly resolveParent: ((parentId: number) => DeviceItemParent | null) | null;
|
|
20
|
+
readonly onNavigate: ((deviceId: number) => void) | null;
|
|
21
|
+
readonly renderRowAction: ((device: DeviceItemDevice) => ReactNode) | null;
|
|
22
|
+
readonly selectable: boolean;
|
|
23
|
+
/** Batch mode active — a row click toggles selection instead of navigating. */
|
|
24
|
+
readonly rowClickSelects: boolean;
|
|
25
|
+
readonly activeSelected: ReadonlySet<number>;
|
|
26
|
+
readonly onToggleSelection: (id: number) => void;
|
|
27
27
|
}
|
|
28
28
|
interface TableLayoutProps extends DeviceRowsProps {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
/** Built-in confirmed delete (table feature). Null ⇒ no trash. Only
|
|
30
|
+
* top-level rows carry it (accessory sub-rows are excluded — same gate
|
|
31
|
+
* as `renderRowAction`). */
|
|
32
|
+
readonly onDeleteDevice: ((device: DeviceItemDevice) => void) | null;
|
|
33
|
+
/** Parent rows the OPERATOR opened. Only the chevron writes it — a search
|
|
34
|
+
* never does (it narrows the rows; it does not open them). */
|
|
35
|
+
readonly expandedParents: ReadonlySet<number>;
|
|
36
|
+
readonly onToggleExpand: (parentId: number) => void;
|
|
37
|
+
/** Full unfiltered device list — used to resolve parent.type for the
|
|
38
|
+
* adopted-row indent. We can't rely on `resolveParent` returning the
|
|
39
|
+
* parent's type (callers historically only project id+name). */
|
|
40
|
+
readonly devices: readonly DeviceItemDevice[];
|
|
41
|
+
/** Context-selected columns to render (header + cells). `name` always on. */
|
|
42
|
+
readonly visibleColumns: readonly DeviceColumnId[];
|
|
43
|
+
/** Active sort (top-level rows), or `null` for the default incoming order.
|
|
44
|
+
* Owned by the device-mode wrapper so the sort applies before pagination. */
|
|
45
|
+
readonly sort: DeviceSort | null;
|
|
46
|
+
/** Header-click handler — toggles the column's sort (asc→desc→none). */
|
|
47
|
+
readonly onSort: (columnId: SortableColumnId) => void;
|
|
48
48
|
}
|
|
49
|
-
export declare function TableLayout({ rows, accessoriesByParent, expandedParents, onToggleExpand, devices, visibleColumns, trpc, resolveIntegrationIcon, resolveParent, onNavigate, renderRowAction, onDeleteDevice, selectable, rowClickSelects, activeSelected, onToggleSelection, sort, onSort
|
|
49
|
+
export declare function TableLayout({ rows, accessoriesByParent, expandedParents, onToggleExpand, devices, visibleColumns, trpc, resolveIntegrationIcon, resolveParent, onNavigate, renderRowAction, onDeleteDevice, selectable, rowClickSelects, activeSelected, onToggleSelection, sort, onSort }: TableLayoutProps): ReactNode;
|
|
50
50
|
export {};
|