@unofficialbox/box-open-elements 0.4.0 → 0.6.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/README.md +39 -14
- package/dist/components/actions/button-group.d.ts +2 -2
- package/dist/components/actions/button-group.js +3 -9
- package/dist/components/actions/button.d.ts +2 -2
- package/dist/components/actions/button.js +3 -9
- package/dist/components/actions/icon-button.d.ts +2 -2
- package/dist/components/actions/icon-button.js +3 -9
- package/dist/components/actions/link-button.d.ts +2 -2
- package/dist/components/actions/link-button.js +3 -9
- package/dist/components/actions/menu-item.d.ts +2 -2
- package/dist/components/actions/menu-item.js +3 -9
- package/dist/components/actions/menu.d.ts +2 -2
- package/dist/components/actions/menu.js +3 -9
- package/dist/components/actions/segmented-control.d.ts +2 -2
- package/dist/components/actions/segmented-control.js +3 -9
- package/dist/components/collections/card.d.ts +2 -2
- package/dist/components/collections/card.js +3 -9
- package/dist/components/collections/carousel.d.ts +2 -2
- package/dist/components/collections/carousel.js +3 -9
- package/dist/components/collections/datalist-item.d.ts +2 -2
- package/dist/components/collections/datalist-item.js +3 -9
- package/dist/components/collections/draggable-list.d.ts +2 -2
- package/dist/components/collections/draggable-list.js +3 -9
- package/dist/components/collections/grid-view.d.ts +2 -2
- package/dist/components/collections/grid-view.js +3 -9
- package/dist/components/collections/pagination.d.ts +2 -2
- package/dist/components/collections/pagination.js +3 -9
- package/dist/components/collections/table.d.ts +59 -5
- package/dist/components/collections/table.js +342 -29
- package/dist/components/collections/thumbnail-card.d.ts +2 -2
- package/dist/components/collections/thumbnail-card.js +3 -9
- package/dist/components/collections/tree-grid.d.ts +2 -2
- package/dist/components/collections/tree-grid.js +3 -9
- package/dist/components/collections/tree.d.ts +2 -2
- package/dist/components/collections/tree.js +3 -9
- package/dist/components/feedback/alert.d.ts +2 -2
- package/dist/components/feedback/alert.js +3 -9
- package/dist/components/feedback/badge.d.ts +2 -2
- package/dist/components/feedback/badge.js +3 -9
- package/dist/components/feedback/badgeable.d.ts +2 -2
- package/dist/components/feedback/badgeable.js +3 -9
- package/dist/components/feedback/chip.d.ts +2 -2
- package/dist/components/feedback/chip.js +3 -9
- package/dist/components/feedback/due-badge.d.ts +38 -0
- package/dist/components/feedback/due-badge.js +168 -0
- package/dist/components/feedback/due-types.d.ts +32 -0
- package/dist/components/feedback/due-types.js +91 -0
- package/dist/components/feedback/empty-state.d.ts +2 -2
- package/dist/components/feedback/empty-state.js +3 -9
- package/dist/components/feedback/error-mask.d.ts +2 -2
- package/dist/components/feedback/error-mask.js +3 -9
- package/dist/components/feedback/help-text.d.ts +2 -2
- package/dist/components/feedback/help-text.js +3 -9
- package/dist/components/feedback/nudge.d.ts +2 -2
- package/dist/components/feedback/nudge.js +3 -9
- package/dist/components/feedback/progress-bar.d.ts +2 -2
- package/dist/components/feedback/progress-bar.js +3 -9
- package/dist/components/feedback/progress-ring.d.ts +2 -2
- package/dist/components/feedback/progress-ring.js +3 -9
- package/dist/components/feedback/progress-steps.d.ts +53 -7
- package/dist/components/feedback/progress-steps.js +203 -31
- package/dist/components/feedback/skeleton.d.ts +2 -2
- package/dist/components/feedback/skeleton.js +3 -9
- package/dist/components/feedback/spinner.d.ts +2 -2
- package/dist/components/feedback/spinner.js +3 -9
- package/dist/components/feedback/stage-path.d.ts +44 -0
- package/dist/components/feedback/stage-path.js +235 -0
- package/dist/components/feedback/toast.d.ts +2 -2
- package/dist/components/feedback/toast.js +3 -9
- package/dist/components/files/drop-zone.d.ts +2 -2
- package/dist/components/files/drop-zone.js +3 -9
- package/dist/components/forms/calendar.d.ts +2 -2
- package/dist/components/forms/calendar.js +3 -9
- package/dist/components/forms/category-selector.d.ts +2 -2
- package/dist/components/forms/category-selector.js +3 -9
- package/dist/components/forms/checkbox-group.d.ts +2 -2
- package/dist/components/forms/checkbox-group.js +3 -9
- package/dist/components/forms/checkbox.d.ts +2 -2
- package/dist/components/forms/checkbox.js +3 -9
- package/dist/components/forms/color-picker.d.ts +2 -2
- package/dist/components/forms/color-picker.js +3 -9
- package/dist/components/forms/combobox.d.ts +2 -2
- package/dist/components/forms/combobox.js +3 -9
- package/dist/components/forms/date-field.d.ts +2 -2
- package/dist/components/forms/date-field.js +3 -9
- package/dist/components/forms/dropdown.d.ts +2 -2
- package/dist/components/forms/dropdown.js +3 -9
- package/dist/components/forms/dual-listbox.d.ts +2 -2
- package/dist/components/forms/dual-listbox.js +3 -9
- package/dist/components/forms/fieldset.d.ts +2 -2
- package/dist/components/forms/fieldset.js +3 -9
- package/dist/components/forms/multi-select.d.ts +2 -2
- package/dist/components/forms/multi-select.js +3 -9
- package/dist/components/forms/number-input.d.ts +2 -2
- package/dist/components/forms/number-input.js +3 -9
- package/dist/components/forms/pill-cloud.d.ts +2 -2
- package/dist/components/forms/pill-cloud.js +3 -9
- package/dist/components/forms/pill-selector-dropdown.d.ts +2 -2
- package/dist/components/forms/pill-selector-dropdown.js +3 -9
- package/dist/components/forms/radio-group.d.ts +2 -2
- package/dist/components/forms/radio-group.js +3 -9
- package/dist/components/forms/range-slider.d.ts +2 -2
- package/dist/components/forms/range-slider.js +3 -9
- package/dist/components/forms/rating.d.ts +2 -2
- package/dist/components/forms/rating.js +3 -9
- package/dist/components/forms/rich-text-input.d.ts +2 -2
- package/dist/components/forms/rich-text-input.js +3 -9
- package/dist/components/forms/search-field.d.ts +2 -2
- package/dist/components/forms/search-field.js +3 -9
- package/dist/components/forms/select.d.ts +23 -2
- package/dist/components/forms/select.js +103 -12
- package/dist/components/forms/slider.d.ts +2 -2
- package/dist/components/forms/slider.js +3 -9
- package/dist/components/forms/spin-button.d.ts +2 -2
- package/dist/components/forms/spin-button.js +3 -9
- package/dist/components/forms/switch.d.ts +2 -2
- package/dist/components/forms/switch.js +3 -9
- package/dist/components/forms/tag-input.d.ts +2 -2
- package/dist/components/forms/tag-input.js +3 -9
- package/dist/components/forms/text-area.d.ts +2 -2
- package/dist/components/forms/text-area.js +3 -9
- package/dist/components/forms/text-field.d.ts +23 -2
- package/dist/components/forms/text-field.js +103 -10
- package/dist/components/forms/time-field.d.ts +2 -2
- package/dist/components/forms/time-field.js +4 -10
- package/dist/components/identity/avatar.d.ts +2 -2
- package/dist/components/identity/avatar.js +3 -9
- package/dist/components/identity/contact-datalist-item.d.ts +2 -2
- package/dist/components/identity/contact-datalist-item.js +3 -9
- package/dist/components/identity/persona.d.ts +2 -2
- package/dist/components/identity/persona.js +3 -9
- package/dist/components/layout/app-shell.d.ts +2 -2
- package/dist/components/layout/app-shell.js +3 -9
- package/dist/components/layout/divider.d.ts +2 -2
- package/dist/components/layout/divider.js +3 -9
- package/dist/components/layout/nav-sidebar.d.ts +16 -2
- package/dist/components/layout/nav-sidebar.js +52 -9
- package/dist/components/layout/section.d.ts +2 -2
- package/dist/components/layout/section.js +3 -9
- package/dist/components/layout/sidebar-toggle-button.d.ts +2 -2
- package/dist/components/layout/sidebar-toggle-button.js +3 -9
- package/dist/components/layout/split-view.d.ts +16 -2
- package/dist/components/layout/split-view.js +83 -10
- package/dist/components/navigation/accordion.d.ts +2 -2
- package/dist/components/navigation/accordion.js +3 -9
- package/dist/components/navigation/breadcrumb.d.ts +2 -2
- package/dist/components/navigation/breadcrumb.js +3 -9
- package/dist/components/navigation/tabs.d.ts +2 -2
- package/dist/components/navigation/tabs.js +3 -9
- package/dist/components/overlays/command-palette.d.ts +62 -0
- package/dist/components/overlays/command-palette.js +537 -0
- package/dist/components/overlays/command-types.d.ts +90 -0
- package/dist/components/overlays/command-types.js +259 -0
- package/dist/components/overlays/context-menu.d.ts +2 -2
- package/dist/components/overlays/context-menu.js +3 -9
- package/dist/components/overlays/dialog.d.ts +2 -2
- package/dist/components/overlays/dialog.js +3 -9
- package/dist/components/overlays/drawer.d.ts +20 -2
- package/dist/components/overlays/drawer.js +138 -18
- package/dist/components/overlays/guide-tooltip.d.ts +2 -2
- package/dist/components/overlays/guide-tooltip.js +3 -9
- package/dist/components/overlays/popover.d.ts +2 -2
- package/dist/components/overlays/popover.js +3 -9
- package/dist/components/overlays/shortcuts-overlay.d.ts +48 -0
- package/dist/components/overlays/shortcuts-overlay.js +385 -0
- package/dist/components/overlays/tooltip.d.ts +2 -2
- package/dist/components/overlays/tooltip.js +4 -10
- package/dist/components/visuals/illustration.d.ts +2 -2
- package/dist/components/visuals/illustration.js +3 -9
- package/dist/core/element.d.ts +5 -1
- package/dist/core/element.js +29 -1
- package/dist/element-maps.d.ts +292 -0
- package/dist/element-maps.js +1 -0
- package/dist/entries/access-stats.d.ts +1 -0
- package/dist/entries/access-stats.js +1 -0
- package/dist/entries/accordion.d.ts +1 -0
- package/dist/entries/accordion.js +1 -0
- package/dist/entries/activity-density.d.ts +1 -0
- package/dist/entries/activity-density.js +1 -0
- package/dist/entries/agent-chat.d.ts +1 -0
- package/dist/entries/agent-chat.js +1 -0
- package/dist/entries/alert.d.ts +1 -0
- package/dist/entries/alert.js +1 -0
- package/dist/entries/annotation-inspector.d.ts +1 -0
- package/dist/entries/annotation-inspector.js +1 -0
- package/dist/entries/annotation-thread.d.ts +1 -0
- package/dist/entries/annotation-thread.js +1 -0
- package/dist/entries/annotation-toolbar.d.ts +1 -0
- package/dist/entries/annotation-toolbar.js +1 -0
- package/dist/entries/app-shell.d.ts +1 -0
- package/dist/entries/app-shell.js +1 -0
- package/dist/entries/audit-log.d.ts +1 -0
- package/dist/entries/audit-log.js +1 -0
- package/dist/entries/avatar.d.ts +1 -0
- package/dist/entries/avatar.js +1 -0
- package/dist/entries/badge.d.ts +1 -0
- package/dist/entries/badge.js +1 -0
- package/dist/entries/badgeable.d.ts +1 -0
- package/dist/entries/badgeable.js +1 -0
- package/dist/entries/bar-chart.d.ts +1 -0
- package/dist/entries/bar-chart.js +1 -0
- package/dist/entries/breadcrumb.d.ts +1 -0
- package/dist/entries/breadcrumb.js +1 -0
- package/dist/entries/bulk-action-bar.d.ts +1 -0
- package/dist/entries/bulk-action-bar.js +1 -0
- package/dist/entries/button-group.d.ts +1 -0
- package/dist/entries/button-group.js +1 -0
- package/dist/entries/button.d.ts +1 -0
- package/dist/entries/button.js +1 -0
- package/dist/entries/calendar.d.ts +1 -0
- package/dist/entries/calendar.js +1 -0
- package/dist/entries/card.d.ts +1 -0
- package/dist/entries/card.js +1 -0
- package/dist/entries/carousel.d.ts +1 -0
- package/dist/entries/carousel.js +1 -0
- package/dist/entries/category-selector.d.ts +1 -0
- package/dist/entries/category-selector.js +1 -0
- package/dist/entries/chart-panel.d.ts +1 -0
- package/dist/entries/chart-panel.js +1 -0
- package/dist/entries/checkbox-group.d.ts +1 -0
- package/dist/entries/checkbox-group.js +1 -0
- package/dist/entries/checkbox.d.ts +1 -0
- package/dist/entries/checkbox.js +1 -0
- package/dist/entries/chip.d.ts +1 -0
- package/dist/entries/chip.js +1 -0
- package/dist/entries/collaborator-avatars.d.ts +1 -0
- package/dist/entries/collaborator-avatars.js +1 -0
- package/dist/entries/color-picker.d.ts +1 -0
- package/dist/entries/color-picker.js +1 -0
- package/dist/entries/combobox.d.ts +1 -0
- package/dist/entries/combobox.js +1 -0
- package/dist/entries/command-palette.d.ts +1 -0
- package/dist/entries/command-palette.js +1 -0
- package/dist/entries/compare-view.d.ts +1 -0
- package/dist/entries/compare-view.js +1 -0
- package/dist/entries/contact-datalist-item.d.ts +1 -0
- package/dist/entries/contact-datalist-item.js +1 -0
- package/dist/entries/content-explorer.d.ts +1 -0
- package/dist/entries/content-explorer.js +1 -0
- package/dist/entries/context-menu.d.ts +1 -0
- package/dist/entries/context-menu.js +1 -0
- package/dist/entries/datalist-item.d.ts +1 -0
- package/dist/entries/datalist-item.js +1 -0
- package/dist/entries/date-field.d.ts +1 -0
- package/dist/entries/date-field.js +1 -0
- package/dist/entries/dialog.d.ts +1 -0
- package/dist/entries/dialog.js +1 -0
- package/dist/entries/diff-viewer.d.ts +1 -0
- package/dist/entries/diff-viewer.js +1 -0
- package/dist/entries/divider.d.ts +1 -0
- package/dist/entries/divider.js +1 -0
- package/dist/entries/donut-chart.d.ts +1 -0
- package/dist/entries/donut-chart.js +1 -0
- package/dist/entries/draggable-list.d.ts +1 -0
- package/dist/entries/draggable-list.js +1 -0
- package/dist/entries/drawer.d.ts +1 -0
- package/dist/entries/drawer.js +1 -0
- package/dist/entries/drop-zone.d.ts +1 -0
- package/dist/entries/drop-zone.js +1 -0
- package/dist/entries/dropdown.d.ts +1 -0
- package/dist/entries/dropdown.js +1 -0
- package/dist/entries/dual-listbox.d.ts +1 -0
- package/dist/entries/dual-listbox.js +1 -0
- package/dist/entries/due-badge.d.ts +1 -0
- package/dist/entries/due-badge.js +1 -0
- package/dist/entries/empty-state.d.ts +1 -0
- package/dist/entries/empty-state.js +1 -0
- package/dist/entries/error-mask.d.ts +1 -0
- package/dist/entries/error-mask.js +1 -0
- package/dist/entries/explorer-action-menu.d.ts +1 -0
- package/dist/entries/explorer-action-menu.js +1 -0
- package/dist/entries/explorer-breadcrumbs.d.ts +1 -0
- package/dist/entries/explorer-breadcrumbs.js +1 -0
- package/dist/entries/explorer-items.d.ts +1 -0
- package/dist/entries/explorer-items.js +1 -0
- package/dist/entries/explorer-list.d.ts +1 -0
- package/dist/entries/explorer-list.js +1 -0
- package/dist/entries/explorer-table.d.ts +1 -0
- package/dist/entries/explorer-table.js +1 -0
- package/dist/entries/explorer-toolbar.d.ts +1 -0
- package/dist/entries/explorer-toolbar.js +1 -0
- package/dist/entries/fieldset.d.ts +1 -0
- package/dist/entries/fieldset.js +1 -0
- package/dist/entries/file-request-builder.d.ts +1 -0
- package/dist/entries/file-request-builder.js +1 -0
- package/dist/entries/filter-bar.d.ts +1 -0
- package/dist/entries/filter-bar.js +1 -0
- package/dist/entries/form-wizard.d.ts +1 -0
- package/dist/entries/form-wizard.js +1 -0
- package/dist/entries/governance-panel.d.ts +1 -0
- package/dist/entries/governance-panel.js +1 -0
- package/dist/entries/grid-view.d.ts +1 -0
- package/dist/entries/grid-view.js +1 -0
- package/dist/entries/guide-tooltip.d.ts +1 -0
- package/dist/entries/guide-tooltip.js +1 -0
- package/dist/entries/help-text.d.ts +1 -0
- package/dist/entries/help-text.js +1 -0
- package/dist/entries/icon-button.d.ts +1 -0
- package/dist/entries/icon-button.js +1 -0
- package/dist/entries/illustration.d.ts +1 -0
- package/dist/entries/illustration.js +1 -0
- package/dist/entries/invite-collaborators-modal.d.ts +1 -0
- package/dist/entries/invite-collaborators-modal.js +1 -0
- package/dist/entries/item-details-panel.d.ts +1 -0
- package/dist/entries/item-details-panel.js +1 -0
- package/dist/entries/item-form.d.ts +1 -0
- package/dist/entries/item-form.js +1 -0
- package/dist/entries/line-chart.d.ts +1 -0
- package/dist/entries/line-chart.js +1 -0
- package/dist/entries/lineage-graph.d.ts +1 -0
- package/dist/entries/lineage-graph.js +1 -0
- package/dist/entries/link-button.d.ts +1 -0
- package/dist/entries/link-button.js +1 -0
- package/dist/entries/menu-item.d.ts +1 -0
- package/dist/entries/menu-item.js +1 -0
- package/dist/entries/menu.d.ts +1 -0
- package/dist/entries/menu.js +1 -0
- package/dist/entries/metadata-filter-builder.d.ts +1 -0
- package/dist/entries/metadata-filter-builder.js +1 -0
- package/dist/entries/metadata-inspector.d.ts +1 -0
- package/dist/entries/metadata-inspector.js +1 -0
- package/dist/entries/metric-card.d.ts +1 -0
- package/dist/entries/metric-card.js +1 -0
- package/dist/entries/multi-select.d.ts +1 -0
- package/dist/entries/multi-select.js +1 -0
- package/dist/entries/nav-sidebar.d.ts +1 -0
- package/dist/entries/nav-sidebar.js +1 -0
- package/dist/entries/notification-bell.d.ts +1 -0
- package/dist/entries/notification-bell.js +1 -0
- package/dist/entries/notification-inbox.d.ts +1 -0
- package/dist/entries/notification-inbox.js +1 -0
- package/dist/entries/nudge.d.ts +1 -0
- package/dist/entries/nudge.js +1 -0
- package/dist/entries/number-input.d.ts +1 -0
- package/dist/entries/number-input.js +1 -0
- package/dist/entries/pagination.d.ts +1 -0
- package/dist/entries/pagination.js +1 -0
- package/dist/entries/permission-matrix.d.ts +1 -0
- package/dist/entries/permission-matrix.js +1 -0
- package/dist/entries/persona.d.ts +1 -0
- package/dist/entries/persona.js +1 -0
- package/dist/entries/pill-cloud.d.ts +1 -0
- package/dist/entries/pill-cloud.js +1 -0
- package/dist/entries/pill-selector-dropdown.d.ts +1 -0
- package/dist/entries/pill-selector-dropdown.js +1 -0
- package/dist/entries/popover.d.ts +1 -0
- package/dist/entries/popover.js +1 -0
- package/dist/entries/presence.d.ts +1 -0
- package/dist/entries/presence.js +1 -0
- package/dist/entries/preview-header.d.ts +1 -0
- package/dist/entries/preview-header.js +1 -0
- package/dist/entries/preview.d.ts +1 -0
- package/dist/entries/preview.js +1 -0
- package/dist/entries/progress-bar.d.ts +1 -0
- package/dist/entries/progress-bar.js +1 -0
- package/dist/entries/progress-ring.d.ts +1 -0
- package/dist/entries/progress-ring.js +1 -0
- package/dist/entries/progress-steps.d.ts +1 -0
- package/dist/entries/progress-steps.js +1 -0
- package/dist/entries/provenance-strip.d.ts +1 -0
- package/dist/entries/provenance-strip.js +1 -0
- package/dist/entries/radio-group.d.ts +1 -0
- package/dist/entries/radio-group.js +1 -0
- package/dist/entries/range-slider.d.ts +1 -0
- package/dist/entries/range-slider.js +1 -0
- package/dist/entries/rating.d.ts +1 -0
- package/dist/entries/rating.js +1 -0
- package/dist/entries/review-queue-item.d.ts +1 -0
- package/dist/entries/review-queue-item.js +1 -0
- package/dist/entries/rich-text-input.d.ts +1 -0
- package/dist/entries/rich-text-input.js +1 -0
- package/dist/entries/run-trace.d.ts +1 -0
- package/dist/entries/run-trace.js +1 -0
- package/dist/entries/saved-view-picker.d.ts +1 -0
- package/dist/entries/saved-view-picker.js +1 -0
- package/dist/entries/search-field.d.ts +1 -0
- package/dist/entries/search-field.js +1 -0
- package/dist/entries/search-results-header.d.ts +1 -0
- package/dist/entries/search-results-header.js +1 -0
- package/dist/entries/section.d.ts +1 -0
- package/dist/entries/section.js +1 -0
- package/dist/entries/segmented-control.d.ts +1 -0
- package/dist/entries/segmented-control.js +1 -0
- package/dist/entries/select.d.ts +1 -0
- package/dist/entries/select.js +1 -0
- package/dist/entries/share-panel.d.ts +1 -0
- package/dist/entries/share-panel.js +1 -0
- package/dist/entries/shortcuts-overlay.d.ts +1 -0
- package/dist/entries/shortcuts-overlay.js +1 -0
- package/dist/entries/sidebar-toggle-button.d.ts +1 -0
- package/dist/entries/sidebar-toggle-button.js +1 -0
- package/dist/entries/signature-ceremony.d.ts +1 -0
- package/dist/entries/signature-ceremony.js +1 -0
- package/dist/entries/skeleton.d.ts +1 -0
- package/dist/entries/skeleton.js +1 -0
- package/dist/entries/slider.d.ts +1 -0
- package/dist/entries/slider.js +1 -0
- package/dist/entries/spin-button.d.ts +1 -0
- package/dist/entries/spin-button.js +1 -0
- package/dist/entries/spinner.d.ts +1 -0
- package/dist/entries/spinner.js +1 -0
- package/dist/entries/split-view.d.ts +1 -0
- package/dist/entries/split-view.js +1 -0
- package/dist/entries/stage-path.d.ts +1 -0
- package/dist/entries/stage-path.js +1 -0
- package/dist/entries/switch.d.ts +1 -0
- package/dist/entries/switch.js +1 -0
- package/dist/entries/table.d.ts +1 -0
- package/dist/entries/table.js +1 -0
- package/dist/entries/tabs.d.ts +1 -0
- package/dist/entries/tabs.js +1 -0
- package/dist/entries/tag-input.d.ts +1 -0
- package/dist/entries/tag-input.js +1 -0
- package/dist/entries/task-assignment-panel.d.ts +1 -0
- package/dist/entries/task-assignment-panel.js +1 -0
- package/dist/entries/text-area.d.ts +1 -0
- package/dist/entries/text-area.js +1 -0
- package/dist/entries/text-field.d.ts +1 -0
- package/dist/entries/text-field.js +1 -0
- package/dist/entries/thumbnail-card.d.ts +1 -0
- package/dist/entries/thumbnail-card.js +1 -0
- package/dist/entries/time-field.d.ts +1 -0
- package/dist/entries/time-field.js +1 -0
- package/dist/entries/timeline.d.ts +1 -0
- package/dist/entries/timeline.js +1 -0
- package/dist/entries/toast.d.ts +1 -0
- package/dist/entries/toast.js +1 -0
- package/dist/entries/tooltip.d.ts +1 -0
- package/dist/entries/tooltip.js +1 -0
- package/dist/entries/tree-grid.d.ts +1 -0
- package/dist/entries/tree-grid.js +1 -0
- package/dist/entries/tree.d.ts +1 -0
- package/dist/entries/tree.js +1 -0
- package/dist/entries/unified-share-modal.d.ts +1 -0
- package/dist/entries/unified-share-modal.js +1 -0
- package/dist/entries/version-graph.d.ts +1 -0
- package/dist/entries/version-graph.js +1 -0
- package/dist/entries/version-list.d.ts +1 -0
- package/dist/entries/version-list.js +1 -0
- package/dist/entries/wizard-summary.d.ts +1 -0
- package/dist/entries/wizard-summary.js +1 -0
- package/dist/entries/work-queue.d.ts +1 -0
- package/dist/entries/work-queue.js +1 -0
- package/dist/entries/workload-board.d.ts +1 -0
- package/dist/entries/workload-board.js +1 -0
- package/dist/foundations/geometry/tokens.d.ts +46 -45
- package/dist/foundations/geometry/tokens.js +46 -45
- package/dist/foundations/motion/tokens.d.ts +10 -10
- package/dist/foundations/motion/tokens.js +10 -10
- package/dist/foundations/profiles/built-ins.d.ts +4 -0
- package/dist/foundations/profiles/built-ins.js +131 -0
- package/dist/foundations/profiles/controller.d.ts +4 -0
- package/dist/foundations/profiles/controller.js +107 -0
- package/dist/foundations/profiles/index.d.ts +4 -0
- package/dist/foundations/profiles/index.js +3 -0
- package/dist/foundations/profiles/registry.d.ts +72 -0
- package/dist/foundations/profiles/registry.js +119 -0
- package/dist/foundations/profiles/types.d.ts +94 -0
- package/dist/foundations/profiles/types.js +1 -0
- package/dist/foundations/theming/controller.d.ts +37 -0
- package/dist/foundations/theming/controller.js +176 -0
- package/dist/foundations/theming/index.d.ts +2 -0
- package/dist/foundations/theming/index.js +1 -0
- package/dist/foundations/tokens/box-dark.d.ts +3 -3
- package/dist/foundations/tokens/box-defaults.d.ts +3 -3
- package/dist/foundations/tokens/index.d.ts +2 -2
- package/dist/foundations/tokens/index.js +1 -1
- package/dist/foundations/tokens/registry.d.ts +37 -7
- package/dist/foundations/tokens/registry.js +55 -5
- package/dist/foundations/tokens/types.d.ts +38 -1
- package/dist/index.d.ts +27 -2
- package/dist/index.js +24 -1
- package/dist/patterns/agent-chat/agent-chat.d.ts +75 -0
- package/dist/patterns/agent-chat/agent-chat.js +820 -0
- package/dist/patterns/agent-chat/controller.d.ts +27 -0
- package/dist/patterns/agent-chat/controller.js +182 -0
- package/dist/patterns/agent-chat/index.d.ts +3 -0
- package/dist/patterns/agent-chat/index.js +6 -0
- package/dist/patterns/agent-chat/types.d.ts +109 -0
- package/dist/patterns/agent-chat/types.js +1 -0
- package/dist/patterns/audit/activity-density.d.ts +68 -0
- package/dist/patterns/audit/activity-density.js +428 -0
- package/dist/patterns/audit/audit-log.d.ts +81 -0
- package/dist/patterns/audit/audit-log.js +794 -0
- package/dist/patterns/audit/index.d.ts +3 -0
- package/dist/patterns/audit/index.js +7 -0
- package/dist/patterns/audit/shared.d.ts +10 -0
- package/dist/patterns/audit/shared.js +50 -0
- package/dist/patterns/audit/types.d.ts +143 -0
- package/dist/patterns/audit/types.js +327 -0
- package/dist/patterns/content-explorer/actions/controller.js +12 -2
- package/dist/patterns/content-explorer/adapters/action-menu.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/action-menu.js +3 -9
- package/dist/patterns/content-explorer/adapters/breadcrumbs.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/breadcrumbs.js +3 -9
- package/dist/patterns/content-explorer/adapters/items.d.ts +3 -3
- package/dist/patterns/content-explorer/adapters/items.js +4 -10
- package/dist/patterns/content-explorer/adapters/list.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/list.js +3 -9
- package/dist/patterns/content-explorer/adapters/table.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/table.js +3 -9
- package/dist/patterns/content-explorer/adapters/toolbar.d.ts +2 -2
- package/dist/patterns/content-explorer/adapters/toolbar.js +7 -13
- package/dist/patterns/content-explorer/box-transport.js +117 -25
- package/dist/patterns/content-explorer/content-explorer.d.ts +28 -16
- package/dist/patterns/content-explorer/content-explorer.js +41 -14
- package/dist/patterns/content-explorer/contracts.d.ts +24 -1
- package/dist/patterns/content-explorer/contracts.js +68 -11
- package/dist/patterns/content-explorer/controller.d.ts +16 -1
- package/dist/patterns/content-explorer/controller.js +130 -4
- package/dist/patterns/content-explorer/navigation/controller.js +11 -9
- package/dist/patterns/content-explorer/types.d.ts +58 -1
- package/dist/patterns/content-picker/content-picker.d.ts +71 -0
- package/dist/patterns/content-picker/content-picker.js +747 -0
- package/dist/patterns/content-picker/controller.d.ts +38 -0
- package/dist/patterns/content-picker/controller.js +141 -0
- package/dist/patterns/content-picker/index.d.ts +3 -0
- package/dist/patterns/content-picker/index.js +6 -0
- package/dist/patterns/content-picker/types.d.ts +52 -0
- package/dist/patterns/content-picker/types.js +26 -0
- package/dist/patterns/content-sidebar/content-sidebar.d.ts +43 -0
- package/dist/patterns/content-sidebar/content-sidebar.js +293 -0
- package/dist/patterns/content-sidebar/index.d.ts +2 -0
- package/dist/patterns/content-sidebar/index.js +4 -0
- package/dist/patterns/content-sidebar/types.d.ts +18 -0
- package/dist/patterns/content-sidebar/types.js +20 -0
- package/dist/patterns/content-uploader/box-transport.d.ts +14 -0
- package/dist/patterns/content-uploader/box-transport.js +54 -0
- package/dist/patterns/content-uploader/content-uploader.d.ts +62 -0
- package/dist/patterns/content-uploader/content-uploader.js +559 -0
- package/dist/patterns/content-uploader/controller.d.ts +39 -0
- package/dist/patterns/content-uploader/controller.js +227 -0
- package/dist/patterns/content-uploader/index.d.ts +4 -0
- package/dist/patterns/content-uploader/index.js +8 -0
- package/dist/patterns/content-uploader/types.d.ts +120 -0
- package/dist/patterns/content-uploader/types.js +38 -0
- package/dist/patterns/diff/compare-view.d.ts +47 -0
- package/dist/patterns/diff/compare-view.js +276 -0
- package/dist/patterns/diff/diff-viewer.d.ts +42 -0
- package/dist/patterns/diff/diff-viewer.js +434 -0
- package/dist/patterns/diff/engine.d.ts +22 -0
- package/dist/patterns/diff/engine.js +276 -0
- package/dist/patterns/diff/index.d.ts +4 -0
- package/dist/patterns/diff/index.js +8 -0
- package/dist/patterns/diff/types.d.ts +69 -0
- package/dist/patterns/diff/types.js +24 -0
- package/dist/patterns/file-request/file-request-builder.d.ts +2 -2
- package/dist/patterns/file-request/file-request-builder.js +3 -9
- package/dist/patterns/form-wizard/controller.d.ts +39 -0
- package/dist/patterns/form-wizard/controller.js +157 -0
- package/dist/patterns/form-wizard/form-wizard.d.ts +63 -0
- package/dist/patterns/form-wizard/form-wizard.js +468 -0
- package/dist/patterns/form-wizard/index.d.ts +4 -0
- package/dist/patterns/form-wizard/index.js +8 -0
- package/dist/patterns/form-wizard/types.d.ts +109 -0
- package/dist/patterns/form-wizard/types.js +83 -0
- package/dist/patterns/form-wizard/wizard-summary.d.ts +62 -0
- package/dist/patterns/form-wizard/wizard-summary.js +324 -0
- package/dist/patterns/governance/governance-panel.d.ts +2 -2
- package/dist/patterns/governance/governance-panel.js +3 -6
- package/dist/patterns/insights/bar-chart.d.ts +2 -2
- package/dist/patterns/insights/bar-chart.js +3 -6
- package/dist/patterns/insights/chart-panel.d.ts +2 -2
- package/dist/patterns/insights/chart-panel.js +3 -6
- package/dist/patterns/insights/donut-chart.d.ts +2 -2
- package/dist/patterns/insights/donut-chart.js +3 -6
- package/dist/patterns/insights/line-chart.d.ts +2 -2
- package/dist/patterns/insights/line-chart.js +3 -6
- package/dist/patterns/insights/metric-card.d.ts +2 -2
- package/dist/patterns/insights/metric-card.js +3 -6
- package/dist/patterns/internal/safe-href.d.ts +17 -0
- package/dist/patterns/internal/safe-href.js +17 -0
- package/dist/patterns/item/bulk-action-bar.d.ts +2 -2
- package/dist/patterns/item/bulk-action-bar.js +3 -6
- package/dist/patterns/item/item-details-panel.d.ts +2 -2
- package/dist/patterns/item/item-details-panel.js +3 -9
- package/dist/patterns/item/item-form.d.ts +2 -2
- package/dist/patterns/item/item-form.js +3 -9
- package/dist/patterns/item/preview-header.d.ts +2 -2
- package/dist/patterns/item/preview-header.js +3 -9
- package/dist/patterns/lineage/index.d.ts +3 -0
- package/dist/patterns/lineage/index.js +6 -0
- package/dist/patterns/lineage/lineage-graph.d.ts +30 -0
- package/dist/patterns/lineage/lineage-graph.js +434 -0
- package/dist/patterns/lineage/provenance-strip.d.ts +22 -0
- package/dist/patterns/lineage/provenance-strip.js +194 -0
- package/dist/patterns/lineage/types.d.ts +53 -0
- package/dist/patterns/lineage/types.js +49 -0
- package/dist/patterns/metadata/metadata-filter-builder.d.ts +2 -2
- package/dist/patterns/metadata/metadata-filter-builder.js +3 -9
- package/dist/patterns/metadata/metadata-inspector.d.ts +2 -2
- package/dist/patterns/metadata/metadata-inspector.js +3 -9
- package/dist/patterns/notifications/index.d.ts +3 -0
- package/dist/patterns/notifications/index.js +6 -0
- package/dist/patterns/notifications/notification-bell.d.ts +38 -0
- package/dist/patterns/notifications/notification-bell.js +198 -0
- package/dist/patterns/notifications/notification-inbox.d.ts +46 -0
- package/dist/patterns/notifications/notification-inbox.js +537 -0
- package/dist/patterns/notifications/types.d.ts +61 -0
- package/dist/patterns/notifications/types.js +108 -0
- package/dist/patterns/preview/annotation-inspector.d.ts +27 -8
- package/dist/patterns/preview/annotation-inspector.js +242 -103
- package/dist/patterns/preview/annotation-thread.d.ts +27 -7
- package/dist/patterns/preview/annotation-thread.js +236 -91
- package/dist/patterns/preview/annotation-toolbar.d.ts +22 -8
- package/dist/patterns/preview/annotation-toolbar.js +165 -105
- package/dist/patterns/preview/content-preview-adapter.d.ts +10 -1
- package/dist/patterns/preview/content-preview-adapter.js +26 -1
- package/dist/patterns/preview/preview-element.d.ts +17 -4
- package/dist/patterns/preview/preview-element.js +226 -61
- package/dist/patterns/preview/provider-adapter.d.ts +47 -0
- package/dist/patterns/preview/provider-adapter.js +17 -0
- package/dist/patterns/run/index.d.ts +2 -0
- package/dist/patterns/run/index.js +4 -0
- package/dist/patterns/run/run-trace.d.ts +40 -0
- package/dist/patterns/run/run-trace.js +441 -0
- package/dist/patterns/run/types.d.ts +66 -0
- package/dist/patterns/run/types.js +152 -0
- package/dist/patterns/search/filter-bar.d.ts +2 -2
- package/dist/patterns/search/filter-bar.js +3 -9
- package/dist/patterns/search/saved-view-picker.d.ts +2 -2
- package/dist/patterns/search/saved-view-picker.js +3 -9
- package/dist/patterns/search/search-results-header.d.ts +2 -2
- package/dist/patterns/search/search-results-header.js +3 -9
- package/dist/patterns/share/access-stats.d.ts +2 -2
- package/dist/patterns/share/access-stats.js +3 -9
- package/dist/patterns/share/collaborator-avatars.d.ts +2 -2
- package/dist/patterns/share/collaborator-avatars.js +3 -9
- package/dist/patterns/share/invite-collaborators-modal.d.ts +2 -2
- package/dist/patterns/share/invite-collaborators-modal.js +3 -9
- package/dist/patterns/share/permission-matrix.d.ts +2 -2
- package/dist/patterns/share/permission-matrix.js +3 -9
- package/dist/patterns/share/presence.d.ts +2 -2
- package/dist/patterns/share/presence.js +3 -9
- package/dist/patterns/share/share-panel.d.ts +2 -2
- package/dist/patterns/share/share-panel.js +3 -9
- package/dist/patterns/share/unified-share-modal.d.ts +2 -2
- package/dist/patterns/share/unified-share-modal.js +3 -9
- package/dist/patterns/signature/index.d.ts +2 -0
- package/dist/patterns/signature/index.js +4 -0
- package/dist/patterns/signature/signature-ceremony.d.ts +33 -0
- package/dist/patterns/signature/signature-ceremony.js +317 -0
- package/dist/patterns/signature/types.d.ts +68 -0
- package/dist/patterns/signature/types.js +89 -0
- package/dist/patterns/task/review-queue-item.d.ts +2 -2
- package/dist/patterns/task/review-queue-item.js +3 -6
- package/dist/patterns/task/task-assignment-panel.d.ts +2 -2
- package/dist/patterns/task/task-assignment-panel.js +3 -6
- package/dist/patterns/timeline/index.d.ts +2 -0
- package/dist/patterns/timeline/index.js +4 -0
- package/dist/patterns/timeline/timeline.d.ts +27 -0
- package/dist/patterns/timeline/timeline.js +430 -0
- package/dist/patterns/timeline/types.d.ts +36 -0
- package/dist/patterns/timeline/types.js +27 -0
- package/dist/patterns/versions/graph-layout.d.ts +43 -0
- package/dist/patterns/versions/graph-layout.js +159 -0
- package/dist/patterns/versions/index.d.ts +4 -0
- package/dist/patterns/versions/index.js +8 -0
- package/dist/patterns/versions/shared.d.ts +4 -0
- package/dist/patterns/versions/shared.js +13 -0
- package/dist/patterns/versions/types.d.ts +37 -0
- package/dist/patterns/versions/types.js +39 -0
- package/dist/patterns/versions/version-graph.d.ts +36 -0
- package/dist/patterns/versions/version-graph.js +438 -0
- package/dist/patterns/versions/version-list.d.ts +39 -0
- package/dist/patterns/versions/version-list.js +407 -0
- package/dist/patterns/work-queue/controller.d.ts +26 -0
- package/dist/patterns/work-queue/controller.js +150 -0
- package/dist/patterns/work-queue/index.d.ts +4 -0
- package/dist/patterns/work-queue/index.js +7 -0
- package/dist/patterns/work-queue/types.d.ts +128 -0
- package/dist/patterns/work-queue/types.js +45 -0
- package/dist/patterns/work-queue/work-queue.d.ts +48 -0
- package/dist/patterns/work-queue/work-queue.js +534 -0
- package/dist/patterns/work-queue/workload-board.d.ts +53 -0
- package/dist/patterns/work-queue/workload-board.js +608 -0
- package/package.json +93 -5
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { FormWizardController } from "./controller.js";
|
|
2
|
+
import { ProgressSteps } from "../../components/feedback/progress-steps.js";
|
|
3
|
+
import { BaseElement } from "../../core/index.js";
|
|
4
|
+
import { boeMotionDuration, boeMotionEasing } from "../../foundations/motion/index.js";
|
|
5
|
+
import { boePanel, boeRadius } from "../../foundations/geometry/index.js";
|
|
6
|
+
const DEFAULT_TAG_NAME = "box-form-wizard";
|
|
7
|
+
const escapeHtml = (value) => value
|
|
8
|
+
.replaceAll("&", "&")
|
|
9
|
+
.replaceAll("<", "<")
|
|
10
|
+
.replaceAll(">", ">")
|
|
11
|
+
.replaceAll('"', """)
|
|
12
|
+
.replaceAll("'", "'");
|
|
13
|
+
/** Attribute payloads are author input — validate every record. */
|
|
14
|
+
const isWizardStepRecord = (value) => {
|
|
15
|
+
if (typeof value !== "object" || value === null) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const step = value;
|
|
19
|
+
return typeof step.id === "string" && step.id.length > 0 && typeof step.label === "string";
|
|
20
|
+
};
|
|
21
|
+
const elementStyles = `
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
color: inherit;
|
|
25
|
+
font: inherit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[part="wizard"] {
|
|
29
|
+
display: grid;
|
|
30
|
+
gap: ${boePanel.gap};
|
|
31
|
+
padding: ${boePanel.padding};
|
|
32
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 82%, transparent);
|
|
33
|
+
border-radius: ${boePanel.radius};
|
|
34
|
+
background: var(--boe-token-surface-surface, #ffffff);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[part="title"] {
|
|
38
|
+
margin: 0;
|
|
39
|
+
font: inherit;
|
|
40
|
+
font-size: 1.1rem;
|
|
41
|
+
font-weight: 700;
|
|
42
|
+
color: var(--boe-token-text-text, #1f1e1b);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[part="layout"] {
|
|
46
|
+
display: grid;
|
|
47
|
+
grid-template-columns: minmax(180px, 260px) 1fr;
|
|
48
|
+
gap: ${boePanel.gap};
|
|
49
|
+
align-items: start;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (max-width: 720px) {
|
|
53
|
+
[part="layout"] {
|
|
54
|
+
grid-template-columns: 1fr;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[part="panels"] {
|
|
59
|
+
display: grid;
|
|
60
|
+
gap: ${boePanel.gap};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[part="panel"][hidden] {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[part="error"] {
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0.55rem 0.7rem;
|
|
70
|
+
border-radius: ${boeRadius.large};
|
|
71
|
+
font-size: 0.9rem;
|
|
72
|
+
background: color-mix(in srgb, var(--boe-token-surface-status-surface-error, #ed3757) 10%, var(--boe-token-surface-surface, #ffffff));
|
|
73
|
+
border: 1px solid color-mix(in srgb, var(--boe-token-surface-status-surface-error, #ed3757) 34%, transparent);
|
|
74
|
+
color: color-mix(in srgb, var(--boe-token-surface-status-surface-error, #ed3757) 72%, black 28%);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[part="error"][hidden] {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[part="footer"] {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
gap: ${boePanel.gap};
|
|
85
|
+
padding-top: 0.2rem;
|
|
86
|
+
border-top: 1px solid color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 62%, transparent);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[part="footer-spacer"] {
|
|
90
|
+
flex: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[part="back"],
|
|
94
|
+
[part="draft"],
|
|
95
|
+
[part="next"],
|
|
96
|
+
[part="submit"] {
|
|
97
|
+
appearance: none;
|
|
98
|
+
font: inherit;
|
|
99
|
+
font-size: 0.875rem;
|
|
100
|
+
font-weight: 600;
|
|
101
|
+
min-height: 2.1rem;
|
|
102
|
+
padding: 0.4rem 0.9rem;
|
|
103
|
+
border-radius: ${boeRadius.control};
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
transition: background ${boeMotionDuration.interactive} ${boeMotionEasing.standard}, border-color ${boeMotionDuration.interactive} ${boeMotionEasing.standard}, box-shadow ${boeMotionDuration.interactive} ${boeMotionEasing.standard};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[part="back"],
|
|
109
|
+
[part="draft"] {
|
|
110
|
+
border: 1px solid var(--boe-token-stroke-stroke, #e8e8e8);
|
|
111
|
+
background: var(--boe-token-surface-surface, #ffffff);
|
|
112
|
+
color: var(--boe-token-text-text, #222222);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[part="back"]:hover:not(:disabled),
|
|
116
|
+
[part="draft"]:hover {
|
|
117
|
+
background: var(--boe-token-surface-surface-hover, #f4f4f4);
|
|
118
|
+
border-color: var(--boe-token-stroke-stroke-hover, #bcbcbc);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[part="back"]:disabled {
|
|
122
|
+
cursor: not-allowed;
|
|
123
|
+
opacity: 0.55;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[part="next"],
|
|
127
|
+
[part="submit"] {
|
|
128
|
+
border: 1px solid transparent;
|
|
129
|
+
background: var(--boe-token-surface-surface-brand, #0061d5);
|
|
130
|
+
color: var(--boe-token-text-text-on-brand, #ffffff);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[part="next"]:hover,
|
|
134
|
+
[part="submit"]:hover {
|
|
135
|
+
background: color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 88%, black 12%);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[part="next"][hidden],
|
|
139
|
+
[part="submit"][hidden],
|
|
140
|
+
[part="draft"][hidden] {
|
|
141
|
+
display: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
[part="back"]:focus-visible,
|
|
145
|
+
[part="draft"]:focus-visible,
|
|
146
|
+
[part="next"]:focus-visible,
|
|
147
|
+
[part="submit"]:focus-visible {
|
|
148
|
+
outline: none;
|
|
149
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 18%, transparent);
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
export class FormWizard extends BaseElement {
|
|
153
|
+
static tagName = DEFAULT_TAG_NAME;
|
|
154
|
+
static get observedAttributes() {
|
|
155
|
+
return ["draft-label", "heading", "steps", "submit-label"];
|
|
156
|
+
}
|
|
157
|
+
controller = null;
|
|
158
|
+
pendingStart = false;
|
|
159
|
+
unsubscribeFns = [];
|
|
160
|
+
validatorsValue = {};
|
|
161
|
+
initialValuesValue = {};
|
|
162
|
+
titleEl;
|
|
163
|
+
railEl;
|
|
164
|
+
panelsEl;
|
|
165
|
+
errorEl;
|
|
166
|
+
backEl;
|
|
167
|
+
draftEl;
|
|
168
|
+
nextEl;
|
|
169
|
+
submitEl;
|
|
170
|
+
panelsSignature = "";
|
|
171
|
+
suppressRailEvent = false;
|
|
172
|
+
get heading() {
|
|
173
|
+
return this.getAttribute("heading") ?? "";
|
|
174
|
+
}
|
|
175
|
+
set heading(value) {
|
|
176
|
+
if (!value) {
|
|
177
|
+
this.removeAttribute("heading");
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
this.setAttribute("heading", value);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Step configuration; JSON `[{"id","label","description?","optional?"}]`.
|
|
184
|
+
* A step's id doubles as the slot name feeding its panel.
|
|
185
|
+
*/
|
|
186
|
+
get steps() {
|
|
187
|
+
const raw = this.getAttribute("steps");
|
|
188
|
+
if (!raw) {
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
try {
|
|
192
|
+
const parsed = JSON.parse(raw);
|
|
193
|
+
return Array.isArray(parsed) && parsed.every(isWizardStepRecord) ? parsed : [];
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
set steps(value) {
|
|
200
|
+
if (value.length) {
|
|
201
|
+
this.setAttribute("steps", JSON.stringify(value));
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this.removeAttribute("steps");
|
|
205
|
+
}
|
|
206
|
+
get submitLabel() {
|
|
207
|
+
return this.getAttribute("submit-label") ?? "Submit";
|
|
208
|
+
}
|
|
209
|
+
set submitLabel(value) {
|
|
210
|
+
this.setAttribute("submit-label", value);
|
|
211
|
+
}
|
|
212
|
+
/** When set, a Save draft button renders and emits `draft-saved`. */
|
|
213
|
+
get draftLabel() {
|
|
214
|
+
return this.getAttribute("draft-label");
|
|
215
|
+
}
|
|
216
|
+
set draftLabel(value) {
|
|
217
|
+
if (!value) {
|
|
218
|
+
this.removeAttribute("draft-label");
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this.setAttribute("draft-label", value);
|
|
222
|
+
}
|
|
223
|
+
get validators() {
|
|
224
|
+
return this.validatorsValue;
|
|
225
|
+
}
|
|
226
|
+
set validators(value) {
|
|
227
|
+
this.validatorsValue = value;
|
|
228
|
+
this.scheduleStart();
|
|
229
|
+
}
|
|
230
|
+
get initialValues() {
|
|
231
|
+
return this.initialValuesValue;
|
|
232
|
+
}
|
|
233
|
+
set initialValues(value) {
|
|
234
|
+
this.initialValuesValue = value;
|
|
235
|
+
this.scheduleStart();
|
|
236
|
+
}
|
|
237
|
+
get values() {
|
|
238
|
+
return this.controller?.getState().values ?? {};
|
|
239
|
+
}
|
|
240
|
+
get activeStep() {
|
|
241
|
+
return this.controller?.getState().currentStepId ?? "";
|
|
242
|
+
}
|
|
243
|
+
/** The live session controller. Null until steps are configured. */
|
|
244
|
+
get wizardController() {
|
|
245
|
+
return this.controller;
|
|
246
|
+
}
|
|
247
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
248
|
+
// Labels are presentation-only; steps re-create the session.
|
|
249
|
+
if (name === "steps") {
|
|
250
|
+
this.scheduleStart();
|
|
251
|
+
}
|
|
252
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
253
|
+
}
|
|
254
|
+
connectedCallback() {
|
|
255
|
+
super.connectedCallback();
|
|
256
|
+
this.scheduleStart();
|
|
257
|
+
}
|
|
258
|
+
disconnectedCallback() {
|
|
259
|
+
this.teardownController();
|
|
260
|
+
}
|
|
261
|
+
setValue(field, value) {
|
|
262
|
+
this.controller?.setValue(field, value);
|
|
263
|
+
}
|
|
264
|
+
setValues(patch) {
|
|
265
|
+
this.controller?.setValues(patch);
|
|
266
|
+
}
|
|
267
|
+
next() {
|
|
268
|
+
return this.controller?.next() ?? false;
|
|
269
|
+
}
|
|
270
|
+
previous() {
|
|
271
|
+
return this.controller?.previous() ?? false;
|
|
272
|
+
}
|
|
273
|
+
goTo(stepId) {
|
|
274
|
+
return this.controller?.goTo(stepId) ?? false;
|
|
275
|
+
}
|
|
276
|
+
saveDraft() {
|
|
277
|
+
this.controller?.saveDraft();
|
|
278
|
+
}
|
|
279
|
+
submit() {
|
|
280
|
+
return this.controller?.submit() ?? false;
|
|
281
|
+
}
|
|
282
|
+
reset() {
|
|
283
|
+
this.controller?.reset();
|
|
284
|
+
}
|
|
285
|
+
scheduleStart() {
|
|
286
|
+
if (this.pendingStart) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
this.pendingStart = true;
|
|
290
|
+
queueMicrotask(() => {
|
|
291
|
+
this.pendingStart = false;
|
|
292
|
+
this.startController();
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
startController() {
|
|
296
|
+
if (!this.isConnected) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const steps = this.steps;
|
|
300
|
+
if (!steps.length) {
|
|
301
|
+
this.teardownController();
|
|
302
|
+
if (this.isRendered) {
|
|
303
|
+
this.update();
|
|
304
|
+
}
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.teardownController();
|
|
308
|
+
const controller = new FormWizardController({
|
|
309
|
+
steps,
|
|
310
|
+
validators: this.validatorsValue,
|
|
311
|
+
initialValues: this.initialValuesValue,
|
|
312
|
+
});
|
|
313
|
+
this.controller = controller;
|
|
314
|
+
this.subscribeToController(controller);
|
|
315
|
+
if (this.isRendered) {
|
|
316
|
+
this.update();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
subscribeToController(controller) {
|
|
320
|
+
const events = [
|
|
321
|
+
["stepChanged", "step-changed"],
|
|
322
|
+
["valuesChanged", "values-changed"],
|
|
323
|
+
["stepInvalid", "step-invalid"],
|
|
324
|
+
["draftSaved", "draft-saved"],
|
|
325
|
+
["submitted", "submitted"],
|
|
326
|
+
];
|
|
327
|
+
this.unsubscribeFns = events.map(([eventName, domEventName]) => controller.subscribe(eventName, payload => {
|
|
328
|
+
this.dispatchEvent(new CustomEvent(domEventName, {
|
|
329
|
+
bubbles: true,
|
|
330
|
+
composed: true,
|
|
331
|
+
detail: payload,
|
|
332
|
+
}));
|
|
333
|
+
if (this.isRendered) {
|
|
334
|
+
this.update();
|
|
335
|
+
}
|
|
336
|
+
}));
|
|
337
|
+
}
|
|
338
|
+
teardownController() {
|
|
339
|
+
for (const unsubscribe of this.unsubscribeFns) {
|
|
340
|
+
unsubscribe();
|
|
341
|
+
}
|
|
342
|
+
this.unsubscribeFns = [];
|
|
343
|
+
this.controller?.destroy();
|
|
344
|
+
this.controller = null;
|
|
345
|
+
this.panelsSignature = "";
|
|
346
|
+
}
|
|
347
|
+
renderTemplate() {
|
|
348
|
+
if (!this.shadowRoot) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
this.shadowRoot.innerHTML = `
|
|
352
|
+
<style>${elementStyles}</style>
|
|
353
|
+
<section part="wizard" aria-label="Form wizard">
|
|
354
|
+
<h2 part="title" hidden></h2>
|
|
355
|
+
<div part="layout">
|
|
356
|
+
<box-progress-steps part="rail"></box-progress-steps>
|
|
357
|
+
<div part="body">
|
|
358
|
+
<p part="error" role="alert" hidden></p>
|
|
359
|
+
<div part="panels"></div>
|
|
360
|
+
</div>
|
|
361
|
+
</div>
|
|
362
|
+
<footer part="footer">
|
|
363
|
+
<button type="button" part="back">Back</button>
|
|
364
|
+
<span part="footer-spacer"></span>
|
|
365
|
+
<button type="button" part="draft" hidden></button>
|
|
366
|
+
<button type="button" part="next">Next</button>
|
|
367
|
+
<button type="button" part="submit" hidden></button>
|
|
368
|
+
</footer>
|
|
369
|
+
</section>
|
|
370
|
+
`;
|
|
371
|
+
this.titleEl = this.shadowRoot.querySelector('[part="title"]');
|
|
372
|
+
this.railEl = this.shadowRoot.querySelector('[part="rail"]');
|
|
373
|
+
this.panelsEl = this.shadowRoot.querySelector('[part="panels"]');
|
|
374
|
+
this.errorEl = this.shadowRoot.querySelector('[part="error"]');
|
|
375
|
+
this.backEl = this.shadowRoot.querySelector('[part="back"]');
|
|
376
|
+
this.draftEl = this.shadowRoot.querySelector('[part="draft"]');
|
|
377
|
+
this.nextEl = this.shadowRoot.querySelector('[part="next"]');
|
|
378
|
+
this.submitEl = this.shadowRoot.querySelector('[part="submit"]');
|
|
379
|
+
}
|
|
380
|
+
setupListeners() {
|
|
381
|
+
this.backEl.addEventListener("click", () => {
|
|
382
|
+
this.previous();
|
|
383
|
+
});
|
|
384
|
+
this.nextEl.addEventListener("click", () => {
|
|
385
|
+
this.next();
|
|
386
|
+
});
|
|
387
|
+
this.submitEl.addEventListener("click", () => {
|
|
388
|
+
this.submit();
|
|
389
|
+
});
|
|
390
|
+
this.draftEl.addEventListener("click", () => {
|
|
391
|
+
this.saveDraft();
|
|
392
|
+
});
|
|
393
|
+
// Rail clicks route through the controller's gating: visited steps are
|
|
394
|
+
// reachable, jumping ahead validates the steps in between.
|
|
395
|
+
this.railEl.addEventListener("value-changed", event => {
|
|
396
|
+
event.stopPropagation();
|
|
397
|
+
if (this.suppressRailEvent) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const stepId = event.detail?.value ?? "";
|
|
401
|
+
const current = this.controller?.getState().currentStepId ?? "";
|
|
402
|
+
if (stepId && stepId !== current) {
|
|
403
|
+
this.goTo(stepId);
|
|
404
|
+
// goTo may refuse (or stop partway); re-sync the rail to the truth.
|
|
405
|
+
if (this.isRendered) {
|
|
406
|
+
this.update();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
/** One panel per step, fed by a slot named after the step id. */
|
|
412
|
+
rebuildPanels(steps) {
|
|
413
|
+
this.panelsEl.innerHTML = steps
|
|
414
|
+
.map(step => `
|
|
415
|
+
<div part="panel" data-step-id="${escapeHtml(step.id)}" role="group" aria-label="${escapeHtml(step.label)}" hidden>
|
|
416
|
+
<slot name="${escapeHtml(step.id)}"></slot>
|
|
417
|
+
</div>
|
|
418
|
+
`)
|
|
419
|
+
.join("");
|
|
420
|
+
}
|
|
421
|
+
update() {
|
|
422
|
+
if (!this.railEl) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const state = this.controller?.getState() ?? null;
|
|
426
|
+
const steps = state?.steps ?? [];
|
|
427
|
+
this.titleEl.hidden = !this.heading;
|
|
428
|
+
this.titleEl.textContent = this.heading;
|
|
429
|
+
const signature = JSON.stringify(steps.map(step => step.id));
|
|
430
|
+
if (signature !== this.panelsSignature) {
|
|
431
|
+
this.panelsSignature = signature;
|
|
432
|
+
this.rebuildPanels(steps);
|
|
433
|
+
}
|
|
434
|
+
this.suppressRailEvent = true;
|
|
435
|
+
try {
|
|
436
|
+
this.railEl.label = this.heading ? `${this.heading} steps` : "Wizard steps";
|
|
437
|
+
this.railEl.items = steps.map(step => ({
|
|
438
|
+
label: step.label,
|
|
439
|
+
value: step.id,
|
|
440
|
+
...(step.description ? { description: step.description } : {}),
|
|
441
|
+
}));
|
|
442
|
+
if (state && this.railEl.value !== state.currentStepId) {
|
|
443
|
+
this.railEl.value = state.currentStepId;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
finally {
|
|
447
|
+
this.suppressRailEvent = false;
|
|
448
|
+
}
|
|
449
|
+
this.panelsEl.querySelectorAll('[part="panel"]').forEach(panel => {
|
|
450
|
+
panel.hidden = panel.dataset.stepId !== state?.currentStepId;
|
|
451
|
+
});
|
|
452
|
+
const error = state?.stepError ?? null;
|
|
453
|
+
this.errorEl.hidden = !error;
|
|
454
|
+
this.errorEl.textContent = error?.message ?? (error ? "Complete the required fields to continue." : "");
|
|
455
|
+
const isLast = this.controller?.isLastStep ?? false;
|
|
456
|
+
this.backEl.disabled = this.controller?.isFirstStep ?? true;
|
|
457
|
+
this.nextEl.hidden = isLast;
|
|
458
|
+
this.submitEl.hidden = !isLast;
|
|
459
|
+
this.submitEl.textContent = this.submitLabel;
|
|
460
|
+
const draftLabel = this.draftLabel;
|
|
461
|
+
this.draftEl.hidden = !draftLabel;
|
|
462
|
+
if (draftLabel) {
|
|
463
|
+
this.draftEl.textContent = draftLabel;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
ProgressSteps.register();
|
|
468
|
+
FormWizard.register();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Wizard step model, validation contract, and state types
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
// Headless step/session controller
|
|
4
|
+
export * from "./controller.js";
|
|
5
|
+
// Composed workflow surface
|
|
6
|
+
export * from "./form-wizard.js";
|
|
7
|
+
// Review step: collected values grouped by step, with per-step Edit intents
|
|
8
|
+
export * from "./wizard-summary.js";
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export interface WizardStepConfig {
|
|
2
|
+
/** Step id — doubles as the slot name feeding the step's panel. */
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Optional steps can be skipped by Next without passing validation. */
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Result of validating one step against the current values. */
|
|
10
|
+
export interface WizardStepValidation {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
/** Human-readable summary shown by the shell when the step blocks. */
|
|
13
|
+
message?: string;
|
|
14
|
+
/** Field-level errors for hosts that render per-field messaging. */
|
|
15
|
+
fieldErrors?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export type WizardStepValidator = (values: Readonly<Record<string, unknown>>) => WizardStepValidation;
|
|
18
|
+
export interface WizardSessionConfig {
|
|
19
|
+
steps: WizardStepConfig[];
|
|
20
|
+
/** Per-step gate, keyed by step id. Steps without a validator always pass. */
|
|
21
|
+
validators?: Record<string, WizardStepValidator>;
|
|
22
|
+
/** Seed values (e.g. a restored draft). */
|
|
23
|
+
initialValues?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface WizardState {
|
|
26
|
+
steps: WizardStepConfig[];
|
|
27
|
+
currentStepId: string;
|
|
28
|
+
currentStepIndex: number;
|
|
29
|
+
values: Record<string, unknown>;
|
|
30
|
+
/** Ids the user has reached — the rail lets them jump back to any of these. */
|
|
31
|
+
visitedStepIds: string[];
|
|
32
|
+
/** Last validation failure for the current step; null once it passes or changes. */
|
|
33
|
+
stepError: WizardStepValidation | null;
|
|
34
|
+
/** True after a successful submit(). */
|
|
35
|
+
submitted: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface WizardEvents {
|
|
38
|
+
stepChanged: {
|
|
39
|
+
stepId: string;
|
|
40
|
+
stepIndex: number;
|
|
41
|
+
};
|
|
42
|
+
valuesChanged: {
|
|
43
|
+
values: Record<string, unknown>;
|
|
44
|
+
};
|
|
45
|
+
/** The current step blocked navigation or submission. */
|
|
46
|
+
stepInvalid: {
|
|
47
|
+
stepId: string;
|
|
48
|
+
validation: WizardStepValidation;
|
|
49
|
+
};
|
|
50
|
+
draftSaved: {
|
|
51
|
+
values: Record<string, unknown>;
|
|
52
|
+
};
|
|
53
|
+
submitted: {
|
|
54
|
+
values: Record<string, unknown>;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* One collected value to show on the review step. `stepId` is what makes the
|
|
59
|
+
* Edit link possible: the summary knows which step to send the user back to.
|
|
60
|
+
*/
|
|
61
|
+
export interface WizardSummaryField {
|
|
62
|
+
/** Key into the wizard's `values`. */
|
|
63
|
+
key: string;
|
|
64
|
+
label: string;
|
|
65
|
+
/** Step this field was collected on. */
|
|
66
|
+
stepId: string;
|
|
67
|
+
/** Display override. Return an empty string to render the not-provided state. */
|
|
68
|
+
format?: (value: unknown) => string;
|
|
69
|
+
}
|
|
70
|
+
export interface WizardSummaryRow {
|
|
71
|
+
key: string;
|
|
72
|
+
label: string;
|
|
73
|
+
/** Already formatted for display; empty string when nothing was collected. */
|
|
74
|
+
value: string;
|
|
75
|
+
/** Nothing was collected — rendered as a placeholder rather than a blank line. */
|
|
76
|
+
empty: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface WizardSummarySection {
|
|
79
|
+
stepId: string;
|
|
80
|
+
label: string;
|
|
81
|
+
rows: WizardSummaryRow[];
|
|
82
|
+
/**
|
|
83
|
+
* The field named a step that is not in `steps`. Surfaced rather than
|
|
84
|
+
* dropped — see `summarizeWizardValues`.
|
|
85
|
+
*/
|
|
86
|
+
unknownStep: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Default rendering for a collected value. Deliberately conservative: a
|
|
90
|
+
* boolean reads as Yes/No because `false` is a real answer that must not look
|
|
91
|
+
* like an unanswered question, and an empty array counts as nothing collected.
|
|
92
|
+
*/
|
|
93
|
+
export declare const formatWizardValue: (value: unknown) => string;
|
|
94
|
+
/**
|
|
95
|
+
* Group collected values into per-step sections for a review card.
|
|
96
|
+
*
|
|
97
|
+
* Sections follow **step order**, not field order, so the summary reads back
|
|
98
|
+
* in the sequence the user filled it in.
|
|
99
|
+
*
|
|
100
|
+
* A field naming a step that does not exist is collected into a trailing
|
|
101
|
+
* section rather than dropped. Dropping would be the dangerous behaviour: the
|
|
102
|
+
* review step exists so someone can confirm what they are about to submit, and
|
|
103
|
+
* a mistyped `stepId` silently hiding an answer would let them confirm a value
|
|
104
|
+
* they never saw. A visibly odd extra section is a bug someone reports; a
|
|
105
|
+
* missing row is a bug nobody notices.
|
|
106
|
+
*/
|
|
107
|
+
export declare const summarizeWizardValues: (fields: readonly WizardSummaryField[], values: Readonly<Record<string, unknown>>, steps: readonly WizardStepConfig[]) => WizardSummarySection[];
|
|
108
|
+
/** Attribute payloads are author input — validate every record. */
|
|
109
|
+
export declare const isWizardSummaryFieldRecord: (value: unknown) => value is WizardSummaryField;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const WIZARD_SUMMARY_UNKNOWN_LABEL = "Other answers";
|
|
2
|
+
/**
|
|
3
|
+
* Default rendering for a collected value. Deliberately conservative: a
|
|
4
|
+
* boolean reads as Yes/No because `false` is a real answer that must not look
|
|
5
|
+
* like an unanswered question, and an empty array counts as nothing collected.
|
|
6
|
+
*/
|
|
7
|
+
export const formatWizardValue = (value) => {
|
|
8
|
+
if (value === null || value === undefined) {
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
if (typeof value === "boolean") {
|
|
12
|
+
return value ? "Yes" : "No";
|
|
13
|
+
}
|
|
14
|
+
if (typeof value === "number") {
|
|
15
|
+
return Number.isFinite(value) ? String(value) : "";
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
return value.map(entry => formatWizardValue(entry)).filter(Boolean).join(", ");
|
|
19
|
+
}
|
|
20
|
+
if (value instanceof Date) {
|
|
21
|
+
return Number.isNaN(value.getTime()) ? "" : value.toISOString().slice(0, 10);
|
|
22
|
+
}
|
|
23
|
+
if (typeof value === "object") {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
return String(value);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Group collected values into per-step sections for a review card.
|
|
30
|
+
*
|
|
31
|
+
* Sections follow **step order**, not field order, so the summary reads back
|
|
32
|
+
* in the sequence the user filled it in.
|
|
33
|
+
*
|
|
34
|
+
* A field naming a step that does not exist is collected into a trailing
|
|
35
|
+
* section rather than dropped. Dropping would be the dangerous behaviour: the
|
|
36
|
+
* review step exists so someone can confirm what they are about to submit, and
|
|
37
|
+
* a mistyped `stepId` silently hiding an answer would let them confirm a value
|
|
38
|
+
* they never saw. A visibly odd extra section is a bug someone reports; a
|
|
39
|
+
* missing row is a bug nobody notices.
|
|
40
|
+
*/
|
|
41
|
+
export const summarizeWizardValues = (fields, values, steps) => {
|
|
42
|
+
const order = new Map(steps.map((step, index) => [step.id, index]));
|
|
43
|
+
const sections = new Map();
|
|
44
|
+
for (const field of fields) {
|
|
45
|
+
const known = order.has(field.stepId);
|
|
46
|
+
let section = sections.get(field.stepId);
|
|
47
|
+
if (!section) {
|
|
48
|
+
section = {
|
|
49
|
+
stepId: field.stepId,
|
|
50
|
+
label: known
|
|
51
|
+
? (steps[order.get(field.stepId)]?.label ?? field.stepId)
|
|
52
|
+
: WIZARD_SUMMARY_UNKNOWN_LABEL,
|
|
53
|
+
rows: [],
|
|
54
|
+
unknownStep: !known,
|
|
55
|
+
};
|
|
56
|
+
sections.set(field.stepId, section);
|
|
57
|
+
}
|
|
58
|
+
const raw = values[field.key];
|
|
59
|
+
const formatted = field.format ? field.format(raw) : formatWizardValue(raw);
|
|
60
|
+
section.rows.push({
|
|
61
|
+
key: field.key,
|
|
62
|
+
label: field.label,
|
|
63
|
+
value: formatted,
|
|
64
|
+
empty: formatted.length === 0,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const known = [...sections.values()].filter(section => !section.unknownStep);
|
|
68
|
+
known.sort((left, right) => (order.get(left.stepId) ?? 0) - (order.get(right.stepId) ?? 0));
|
|
69
|
+
return [...known, ...[...sections.values()].filter(section => section.unknownStep)];
|
|
70
|
+
};
|
|
71
|
+
/** Attribute payloads are author input — validate every record. */
|
|
72
|
+
export const isWizardSummaryFieldRecord = (value) => {
|
|
73
|
+
if (typeof value !== "object" || value === null) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const field = value;
|
|
77
|
+
return (typeof field.key === "string" &&
|
|
78
|
+
field.key.length > 0 &&
|
|
79
|
+
typeof field.label === "string" &&
|
|
80
|
+
field.label.length > 0 &&
|
|
81
|
+
typeof field.stepId === "string" &&
|
|
82
|
+
field.stepId.length > 0);
|
|
83
|
+
};
|