@cosmicdrift/kumiko-renderer 0.389.0 → 0.390.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/dist/app/projection-detail-body.js +59 -394
- package/dist/app/projection-detail-header-model.d.ts +11 -0
- package/dist/app/projection-detail-header-model.js +33 -0
- package/dist/app/projection-detail-header-region.d.ts +28 -0
- package/dist/app/projection-detail-header-region.js +81 -0
- package/dist/app/projection-detail-header.d.ts +29 -0
- package/dist/app/projection-detail-header.js +84 -0
- package/dist/app/projection-detail-navigation.d.ts +13 -0
- package/dist/app/projection-detail-navigation.js +91 -0
- package/dist/app/projection-detail-states.d.ts +22 -0
- package/dist/app/projection-detail-states.js +26 -0
- package/dist/app/projection-drawer-host.d.ts +12 -0
- package/dist/app/projection-drawer-host.js +10 -0
- package/dist/app/projection-list-body.d.ts +1 -1
- package/dist/app/projection-list-body.js +69 -189
- package/dist/app/projection-list-render-props.d.ts +56 -0
- package/dist/app/projection-list-render-props.js +47 -0
- package/dist/app/projection-list-render.d.ts +26 -0
- package/dist/app/projection-list-render.js +20 -0
- package/dist/app/projection-list-row-click.d.ts +12 -0
- package/dist/app/projection-list-row-click.js +14 -0
- package/dist/app/use-projection-detail-actions.d.ts +35 -0
- package/dist/app/use-projection-detail-actions.js +156 -0
- package/dist/app/use-projection-detail-data.d.ts +19 -0
- package/dist/app/use-projection-detail-data.js +47 -0
- package/dist/app/use-projection-detail-layout.d.ts +17 -0
- package/dist/app/use-projection-detail-layout.js +23 -0
- package/dist/app/use-projection-list-actions.d.ts +31 -0
- package/dist/app/use-projection-list-actions.js +73 -0
- package/dist/app/use-projection-list-data.d.ts +20 -0
- package/dist/app/use-projection-list-data.js +26 -0
- package/dist/app/use-projection-list-definitions.d.ts +11 -0
- package/dist/app/use-projection-list-definitions.js +20 -0
- package/dist/app/use-projection-list-query.d.ts +28 -0
- package/dist/app/use-projection-list-query.js +83 -0
- package/dist/components/render-edit-banners.d.ts +12 -0
- package/dist/components/render-edit-banners.js +90 -0
- package/dist/components/render-edit-draft-save-helpers.d.ts +19 -0
- package/dist/components/render-edit-draft-save-helpers.js +42 -0
- package/dist/components/render-edit-field-grid.d.ts +4 -0
- package/dist/components/render-edit-field-grid.js +40 -0
- package/dist/components/render-edit-fields-section.d.ts +4 -0
- package/dist/components/render-edit-fields-section.js +76 -0
- package/dist/components/render-edit-form-actions.d.ts +4 -0
- package/dist/components/render-edit-form-actions.js +66 -0
- package/dist/components/render-edit-header-actions.d.ts +11 -0
- package/dist/components/render-edit-header-actions.js +120 -0
- package/dist/components/render-edit-layout-flags.d.ts +29 -0
- package/dist/components/render-edit-layout-flags.js +106 -0
- package/dist/components/render-edit-layout.d.ts +4 -0
- package/dist/components/render-edit-layout.js +79 -0
- package/dist/components/render-edit-render-model.d.ts +63 -0
- package/dist/components/render-edit-render-model.js +14 -0
- package/dist/components/render-edit-section-kinds.d.ts +4 -0
- package/dist/components/render-edit-section-kinds.js +115 -0
- package/dist/components/render-edit-submit-result.d.ts +8 -0
- package/dist/components/render-edit-submit-result.js +77 -0
- package/dist/components/render-edit-submit.d.ts +7 -0
- package/dist/components/render-edit-submit.js +113 -0
- package/dist/components/render-edit-titles.d.ts +17 -0
- package/dist/components/render-edit-titles.js +99 -0
- package/dist/components/render-edit-wizard-navigation.d.ts +11 -0
- package/dist/components/render-edit-wizard-navigation.js +115 -0
- package/dist/components/render-edit.d.ts +2 -2
- package/dist/components/render-edit.js +63 -1128
- package/dist/components/render-field-choice-inputs.d.ts +7 -0
- package/dist/components/render-field-choice-inputs.js +52 -0
- package/dist/components/render-field-control.d.ts +12 -0
- package/dist/components/render-field-control.js +93 -0
- package/dist/components/render-field-display-text.d.ts +4 -0
- package/dist/components/render-field-display-text.js +48 -0
- package/dist/components/render-field-fill-action.d.ts +13 -0
- package/dist/components/render-field-fill-action.js +63 -0
- package/dist/components/render-field-input-shared.d.ts +39 -0
- package/dist/components/render-field-input-shared.js +20 -0
- package/dist/components/render-field-input.d.ts +3 -0
- package/dist/components/render-field-input.js +34 -0
- package/dist/components/render-field-meta.d.ts +6 -0
- package/dist/components/render-field-meta.js +51 -0
- package/dist/components/render-field-read-only.d.ts +11 -0
- package/dist/components/render-field-read-only.js +75 -0
- package/dist/components/render-field-reference.d.ts +15 -0
- package/dist/components/render-field-reference.js +103 -0
- package/dist/components/render-field-scalar-inputs.d.ts +10 -0
- package/dist/components/render-field-scalar-inputs.js +35 -0
- package/dist/components/render-field-text-inputs.d.ts +3 -0
- package/dist/components/render-field-text-inputs.js +34 -0
- package/dist/components/render-field-values.d.ts +18 -0
- package/dist/components/render-field-values.js +111 -0
- package/dist/components/render-field-write-only.d.ts +9 -0
- package/dist/components/render-field-write-only.js +29 -0
- package/dist/components/render-field.d.ts +2 -2
- package/dist/components/render-field.js +39 -670
- package/dist/components/render-list-header-slot.d.ts +5 -0
- package/dist/components/render-list-header-slot.js +30 -0
- package/dist/components/render-list-reference-bridge.d.ts +3 -0
- package/dist/components/render-list-reference-bridge.js +25 -0
- package/dist/components/render-list-reference-columns.d.ts +25 -0
- package/dist/components/render-list-reference-columns.js +137 -0
- package/dist/components/render-list-table-props.d.ts +52 -0
- package/dist/components/render-list-table-props.js +53 -0
- package/dist/components/render-list-toolbar-model.d.ts +42 -0
- package/dist/components/render-list-toolbar-model.js +82 -0
- package/dist/components/render-list-toolbar.d.ts +38 -0
- package/dist/components/render-list-toolbar.js +40 -0
- package/dist/components/render-list-types.d.ts +113 -0
- package/dist/components/render-list-types.js +1 -0
- package/dist/components/render-list.d.ts +4 -113
- package/dist/components/render-list.js +91 -307
- package/dist/components/use-reference-input-state.d.ts +20 -0
- package/dist/components/use-reference-input-state.js +85 -0
- package/dist/components/use-render-edit-controlled-sync.d.ts +3 -0
- package/dist/components/use-render-edit-controlled-sync.js +26 -0
- package/dist/components/use-render-edit-draft-save.d.ts +29 -0
- package/dist/components/use-render-edit-draft-save.js +141 -0
- package/dist/components/use-render-edit-form.d.ts +10 -0
- package/dist/components/use-render-edit-form.js +101 -0
- package/dist/components/use-render-edit-sections.d.ts +15 -0
- package/dist/components/use-render-edit-sections.js +100 -0
- package/dist/components/use-render-edit-state.d.ts +65 -0
- package/dist/components/use-render-edit-state.js +158 -0
- package/dist/components/use-render-edit-steps.d.ts +13 -0
- package/dist/components/use-render-edit-steps.js +52 -0
- package/dist/components/use-render-list-columns.d.ts +18 -0
- package/dist/components/use-render-list-columns.js +41 -0
- package/dist/components/use-render-list-search.d.ts +4 -0
- package/dist/components/use-render-list-search.js +50 -0
- package/dist/primitives.d.ts +1 -1
- package/dist/web/app/dashboard-body.d.ts +1 -1
- package/dist/web/app/dashboard-body.js +42 -246
- package/dist/web/app/dashboard-header.d.ts +34 -0
- package/dist/web/app/dashboard-header.js +58 -0
- package/dist/web/app/dashboard-screen-controls.d.ts +11 -0
- package/dist/web/app/dashboard-screen-controls.js +42 -0
- package/dist/web/app/dashboard-screen-tiles.d.ts +8 -0
- package/dist/web/app/dashboard-screen-tiles.js +42 -0
- package/dist/web/app/dashboard-visibility.d.ts +42 -0
- package/dist/web/app/dashboard-visibility.js +102 -0
- package/dist/web/app/use-dashboard-screen-state.d.ts +35 -0
- package/dist/web/app/use-dashboard-screen-state.js +69 -0
- package/dist/web/primitives/data-table/actions-column.js +6 -5
- package/dist/web/primitives/data-table/card-body.d.ts +6 -0
- package/dist/web/primitives/data-table/card-body.js +32 -0
- package/dist/web/primitives/data-table/card-row.d.ts +5 -0
- package/dist/web/primitives/data-table/card-row.js +31 -0
- package/dist/web/primitives/data-table/card-view.d.ts +3 -0
- package/dist/web/primitives/data-table/card-view.js +13 -0
- package/dist/web/primitives/data-table/column-resize-handle.js +3 -1
- package/dist/web/primitives/data-table/data-cell-props.d.ts +7 -0
- package/dist/web/primitives/data-table/data-cell-props.js +8 -0
- package/dist/web/primitives/data-table/row-render-parts.d.ts +8 -0
- package/dist/web/primitives/data-table/row-render-parts.js +35 -0
- package/dist/web/primitives/data-table/table-body.d.ts +3 -0
- package/dist/web/primitives/data-table/table-body.js +32 -0
- package/dist/web/primitives/data-table/table-content.d.ts +3 -0
- package/dist/web/primitives/data-table/table-content.js +41 -0
- package/dist/web/primitives/data-table/table-data-cell.d.ts +4 -0
- package/dist/web/primitives/data-table/table-data-cell.js +25 -0
- package/dist/web/primitives/data-table/table-header-row.d.ts +3 -0
- package/dist/web/primitives/data-table/table-header-row.js +21 -0
- package/dist/web/primitives/data-table/table-view.d.ts +3 -0
- package/dist/web/primitives/data-table/table-view.js +25 -0
- package/dist/web/primitives/data-table/toolbar.d.ts +6 -0
- package/dist/web/primitives/data-table/toolbar.js +53 -0
- package/dist/web/primitives/data-table/use-data-table-state.d.ts +44 -0
- package/dist/web/primitives/data-table/use-data-table-state.js +123 -0
- package/dist/web/primitives/data-table.d.ts +3 -4
- package/dist/web/primitives/data-table.js +32 -252
- package/dist/web/primitives/file-value-list.js +1 -1
- package/dist/web/primitives/form-footer-parts.d.ts +25 -0
- package/dist/web/primitives/form-footer-parts.js +55 -0
- package/dist/web/primitives/form.js +33 -43
- package/dist/web/primitives/input-choice-kinds.d.ts +4 -0
- package/dist/web/primitives/input-choice-kinds.js +67 -0
- package/dist/web/primitives/input-file-kinds.d.ts +3 -0
- package/dist/web/primitives/input-file-kinds.js +6 -0
- package/dist/web/primitives/input-number-kinds.d.ts +4 -0
- package/dist/web/primitives/input-number-kinds.js +16 -0
- package/dist/web/primitives/input-optional-props.d.ts +20 -0
- package/dist/web/primitives/input-optional-props.js +24 -0
- package/dist/web/primitives/input-select-presentation.d.ts +13 -0
- package/dist/web/primitives/input-select-presentation.js +19 -0
- package/dist/web/primitives/input-shared.d.ts +22 -0
- package/dist/web/primitives/input-shared.js +10 -0
- package/dist/web/primitives/input-temporal-kinds.d.ts +5 -0
- package/dist/web/primitives/input-temporal-kinds.js +10 -0
- package/dist/web/primitives/input-text-kinds.d.ts +7 -0
- package/dist/web/primitives/input-text-kinds.js +33 -0
- package/dist/web/primitives/input.js +35 -161
- package/dist/web/widgets/chart-data.d.ts +35 -0
- package/dist/web/widgets/chart-data.js +37 -0
- package/dist/web/widgets/chart-markers.d.ts +26 -0
- package/dist/web/widgets/chart-markers.js +64 -0
- package/dist/web/widgets/chart-parts.d.ts +20 -0
- package/dist/web/widgets/chart-parts.js +15 -0
- package/dist/web/widgets/charts.d.ts +5 -78
- package/dist/web/widgets/charts.js +7 -485
- package/dist/web/widgets/drawer-panel-class.d.ts +3 -0
- package/dist/web/widgets/drawer-panel-class.js +40 -0
- package/dist/web/widgets/drawer-resize-controls.d.ts +11 -0
- package/dist/web/widgets/drawer-resize-controls.js +12 -0
- package/dist/web/widgets/drawer-sizing.d.ts +19 -0
- package/dist/web/widgets/drawer-sizing.js +60 -0
- package/dist/web/widgets/drawer.js +17 -116
- package/dist/web/widgets/stacked-area-brush.d.ts +13 -0
- package/dist/web/widgets/stacked-area-brush.js +91 -0
- package/dist/web/widgets/stacked-area-chart.d.ts +6 -0
- package/dist/web/widgets/stacked-area-chart.js +45 -0
- package/dist/web/widgets/stacked-area-chrome.d.ts +7 -0
- package/dist/web/widgets/stacked-area-chrome.js +77 -0
- package/dist/web/widgets/stacked-area-geometry.d.ts +54 -0
- package/dist/web/widgets/stacked-area-geometry.js +83 -0
- package/dist/web/widgets/stacked-area-model.d.ts +11 -0
- package/dist/web/widgets/stacked-area-model.js +1 -0
- package/dist/web/widgets/stacked-area-plot.d.ts +3 -0
- package/dist/web/widgets/stacked-area-plot.js +51 -0
- package/dist/web/widgets/stacked-area-props.d.ts +83 -0
- package/dist/web/widgets/stacked-area-props.js +16 -0
- package/dist/web/widgets/stacked-area-svg.d.ts +3 -0
- package/dist/web/widgets/stacked-area-svg.js +38 -0
- package/dist/web/widgets/stacked-area-tooltip.d.ts +3 -0
- package/dist/web/widgets/stacked-area-tooltip.js +86 -0
- package/dist/web/widgets/use-drawer-resize.d.ts +22 -0
- package/dist/web/widgets/use-drawer-resize.js +52 -0
- package/dist/web/widgets/use-stacked-area-tooltip.d.ts +9 -0
- package/dist/web/widgets/use-stacked-area-tooltip.js +34 -0
- package/dist/web/widgets/use-stacked-area-window.d.ts +20 -0
- package/dist/web/widgets/use-stacked-area-window.js +76 -0
- package/package.json +9 -9
- package/src/changes.json +54 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { tabIdAt, wizardStepKey } from "./render-edit-helpers.js";
|
|
2
|
+
import { findFirstErroringSectionIndex, resolveExtensionEntityId } from "./render-edit-logic.js";
|
|
3
|
+
// Rebuilt every render on purpose: the closures read this render's step and
|
|
4
|
+
// section state, and the wizard refs publish the current ones.
|
|
5
|
+
export function createWizardNavigation({ props, state, form, draft, sections, steps }, saveDraft) {
|
|
6
|
+
const { disabled } = props;
|
|
7
|
+
const { isCreateMode, isTabs, setRawStep } = state;
|
|
8
|
+
const { filteredSections } = sections;
|
|
9
|
+
const { currentStep, lastStepIndex } = steps;
|
|
10
|
+
const { hasNavigatedRef } = draft.refs;
|
|
11
|
+
// Persist all composed extension sections using the resolved entityId.
|
|
12
|
+
// false means a section failed and its i18n key is shown in the banner. Without
|
|
13
|
+
// entity context (create mode without a route id), there is nothing to write.
|
|
14
|
+
async function persistExtensions() {
|
|
15
|
+
const entityId = resolveExtensionEntityId(props.entityId, sections.vm.id);
|
|
16
|
+
if (entityId === null)
|
|
17
|
+
return true;
|
|
18
|
+
const results = await state.runExtensionSubmits({ entityId });
|
|
19
|
+
const failed = results.find((r) => !r.isSuccess);
|
|
20
|
+
if (failed !== undefined) {
|
|
21
|
+
state.setExtensionErrorKey(failed.errorKey ?? "kumiko.form.extension.save-failed");
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function jumpToStep(index) {
|
|
27
|
+
setRawStep(index);
|
|
28
|
+
if (isTabs)
|
|
29
|
+
state.setActiveTabId(tabIdAt(filteredSections[index], index));
|
|
30
|
+
}
|
|
31
|
+
function currentStepHasFieldErrors() {
|
|
32
|
+
const section = filteredSections[currentStep];
|
|
33
|
+
const fieldNames = section?.kind === "fields" ? section.fields.map((f) => f.field) : [];
|
|
34
|
+
return fieldNames.length > 0 && !form.controller.validate(fieldNames);
|
|
35
|
+
}
|
|
36
|
+
function markCurrentStepPassed() {
|
|
37
|
+
const leftSection = filteredSections[currentStep];
|
|
38
|
+
// skip: no current section to mark as passed
|
|
39
|
+
if (leftSection === undefined)
|
|
40
|
+
return;
|
|
41
|
+
const leftKey = wizardStepKey(leftSection, currentStep);
|
|
42
|
+
state.setPassedStepKeys((prev) => (prev.has(leftKey) ? prev : new Set(prev).add(leftKey)));
|
|
43
|
+
}
|
|
44
|
+
// Next: scoped validate() on the current step's fields — errors stay
|
|
45
|
+
// attached to the field and block the step transition. Extension steps
|
|
46
|
+
// have no field scope here (they validate via the controlled-mode
|
|
47
|
+
// controls.validate() API), so no call, no clearing of unrelated errors.
|
|
48
|
+
function handleWizardNext() {
|
|
49
|
+
const next = Math.min(currentStep + 1, lastStepIndex);
|
|
50
|
+
hasNavigatedRef.current = true;
|
|
51
|
+
// Locked state: `disabled` means "no input/no write", not "no
|
|
52
|
+
// navigation" — a disabled wizard must still be steppable so Back/Next
|
|
53
|
+
// reach every step. But neither validate() (would block on an empty
|
|
54
|
+
// required field nobody can fill in) nor saveDraft() (would mint a
|
|
55
|
+
// draftId / dispatch a write — exactly what `disabled` forbids) may run.
|
|
56
|
+
if (disabled) {
|
|
57
|
+
setRawStep(next);
|
|
58
|
+
// skip: locked wizard only steps, no validate or draft save
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// skip: the current step has field errors — no transition, no draft save.
|
|
62
|
+
if (currentStepHasFieldErrors())
|
|
63
|
+
return;
|
|
64
|
+
if (!isCreateMode)
|
|
65
|
+
markCurrentStepPassed();
|
|
66
|
+
setRawStep(next);
|
|
67
|
+
saveDraft(next);
|
|
68
|
+
}
|
|
69
|
+
function handleWizardBack() {
|
|
70
|
+
handleWizardStepSelect(currentStep - 1);
|
|
71
|
+
}
|
|
72
|
+
// Update mode: the record already exists and the final Save validates the
|
|
73
|
+
// whole form and jumps to the first erroring step (findFirstErroringStep), so
|
|
74
|
+
// skipping steps forward is safe; leaving the current step still goes through
|
|
75
|
+
// its validate gate.
|
|
76
|
+
function handleWizardStepSelect(targetStep) {
|
|
77
|
+
// skip: already on the target step
|
|
78
|
+
if (targetStep === currentStep)
|
|
79
|
+
return;
|
|
80
|
+
const isForward = targetStep > currentStep;
|
|
81
|
+
// Create mode: a forward jump would skip the per-step validate() gate.
|
|
82
|
+
// skip: create mode has no forward jump
|
|
83
|
+
if (isForward && isCreateMode)
|
|
84
|
+
return;
|
|
85
|
+
// skip: current step has field errors
|
|
86
|
+
if (isForward && !disabled && currentStepHasFieldErrors())
|
|
87
|
+
return;
|
|
88
|
+
const clampedTarget = Math.min(Math.max(targetStep, 0), lastStepIndex);
|
|
89
|
+
hasNavigatedRef.current = true;
|
|
90
|
+
setRawStep(clampedTarget);
|
|
91
|
+
if (!disabled)
|
|
92
|
+
saveDraft(clampedTarget);
|
|
93
|
+
}
|
|
94
|
+
// Stepped modes (wizard, tabs): locates the first step whose "fields"
|
|
95
|
+
// section contains one of the given field paths — matched on the path's
|
|
96
|
+
// first segment, since `FieldIssue.path`/`snapshot.errors` keys can be
|
|
97
|
+
// dotted (embedded-list rows, e.g. `tasks.2.title`) while a section's field
|
|
98
|
+
// name is always the plain top-level name. Returns undefined for a
|
|
99
|
+
// root-level issue (path `"(root)"`, see zod-bridge.ts) or one that matches
|
|
100
|
+
// no rendered field — callers must NOT suppress the error banner in that
|
|
101
|
+
// case, there is nowhere to jump the user to. Extension sections are not
|
|
102
|
+
// jump targets by design: they validate through the controlled-mode
|
|
103
|
+
// controls.validate() API and own no field specs to match against.
|
|
104
|
+
function findFirstErroringStep(fieldPaths) {
|
|
105
|
+
return findFirstErroringSectionIndex(filteredSections, fieldPaths);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
persistExtensions,
|
|
109
|
+
jumpToStep,
|
|
110
|
+
handleWizardNext,
|
|
111
|
+
handleWizardBack,
|
|
112
|
+
handleWizardStepSelect,
|
|
113
|
+
findFirstErroringStep,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import type { FormValues } from "../headless/index.ts";
|
|
3
3
|
import type { RenderEditProps } from "./render-edit-types.ts";
|
|
4
4
|
export type { RenderEditAction, RenderEditChangeState, RenderEditControls, RenderEditProps, } from "./render-edit-types.ts";
|
|
5
|
-
export declare function RenderEdit<TValues extends FormValues, TCtx = unknown>(
|
|
5
|
+
export declare function RenderEdit<TValues extends FormValues, TCtx = unknown>(rawProps: RenderEditProps<TValues, TCtx>): ReactNode;
|