@flanksource/clicky-ui 0.3.34 → 0.3.35
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 +4 -0
- package/dist/ai.cjs +3 -0
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.js +3 -0
- package/dist/ai.js.map +1 -1
- package/dist/comments/CommentCard.d.ts +1 -1
- package/dist/comments/CommentProvider.d.ts +1 -1
- package/dist/comments/CommentThread.d.ts +1 -1
- package/dist/comments/CommentThreadList.d.ts +1 -1
- package/dist/comments/MentionTextarea.d.ts +1 -1
- package/dist/comments/comment-context.d.ts +4 -4
- package/dist/comments/comment-fixtures.d.ts +1 -1
- package/dist/comments/comment-types.d.ts +1 -1
- package/dist/components/AccordionList.d.ts +1 -1
- package/dist/components/ComboboxControl.d.ts +1 -1
- package/dist/components/ComboboxMenu.d.ts +2 -2
- package/dist/components/ComboboxTags.cjs +41 -11
- package/dist/components/ComboboxTags.cjs.map +1 -1
- package/dist/components/ComboboxTags.d.ts +6 -0
- package/dist/components/ComboboxTags.d.ts.map +1 -1
- package/dist/components/ComboboxTags.js +41 -11
- package/dist/components/ComboboxTags.js.map +1 -1
- package/dist/components/DateField.d.ts +3 -3
- package/dist/components/DatePicker.d.ts +3 -3
- package/dist/components/DateTimePicker.d.ts +3 -3
- package/dist/components/ErrorWrapper.d.ts +2 -2
- package/dist/components/Field.d.ts +1 -1
- package/dist/components/FilterBar.d.ts +1 -1
- package/dist/components/FormLookupProvider.d.ts +1 -1
- package/dist/components/FormatOptionsDropdown.d.ts +1 -1
- package/dist/components/IconButton.d.ts +3 -3
- package/dist/components/InputField.d.ts +2 -2
- package/dist/components/ItemActions.d.ts +1 -1
- package/dist/components/JsonSchemaForm.cjs +17 -36
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.d.ts +1 -1
- package/dist/components/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm.js +17 -36
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/ListMenu.d.ts +1 -1
- package/dist/components/MultiSelect.d.ts +1 -1
- package/dist/components/SearchInput.d.ts +1 -1
- package/dist/components/SegmentedControl.d.ts +1 -1
- package/dist/components/SplitButton.d.ts +1 -1
- package/dist/components/Switch.d.ts +1 -1
- package/dist/components/TreePickerField.cjs +11 -2
- package/dist/components/TreePickerField.cjs.map +1 -1
- package/dist/components/TreePickerField.d.ts +13 -4
- package/dist/components/TreePickerField.d.ts.map +1 -1
- package/dist/components/TreePickerField.js +11 -2
- package/dist/components/TreePickerField.js.map +1 -1
- package/dist/components/UnitStepControls.d.ts +1 -1
- package/dist/components/button.d.ts +3 -3
- package/dist/components/combobox-types.d.ts +1 -1
- package/dist/components/density-switcher.d.ts +1 -1
- package/dist/components/filter-bar-context.d.ts +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +2 -2
- package/dist/components/form-lookup-context.d.ts +1 -1
- package/dist/components/icon-menu-picker.d.ts +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +44 -21
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +47 -24
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array.cjs +53 -30
- package/dist/components/json-schema-form-array.cjs.map +1 -1
- package/dist/components/json-schema-form-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-array.js +54 -31
- package/dist/components/json-schema-form-array.js.map +1 -1
- package/dist/components/json-schema-form-cards-array.cjs +32 -22
- package/dist/components/json-schema-form-cards-array.cjs.map +1 -1
- package/dist/components/json-schema-form-cards-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-cards-array.js +33 -23
- package/dist/components/json-schema-form-cards-array.js.map +1 -1
- package/dist/components/json-schema-form-collection-layouts.fixtures.d.ts +44 -0
- package/dist/components/json-schema-form-collection-layouts.fixtures.d.ts.map +1 -0
- package/dist/components/json-schema-form-discriminator.d.ts +1 -1
- package/dist/components/json-schema-form-errors.cjs +5 -1
- package/dist/components/json-schema-form-errors.cjs.map +1 -1
- package/dist/components/json-schema-form-errors.d.ts +2 -1
- package/dist/components/json-schema-form-errors.d.ts.map +1 -1
- package/dist/components/json-schema-form-errors.js +6 -2
- package/dist/components/json-schema-form-errors.js.map +1 -1
- package/dist/components/json-schema-form-extensions.d.ts +1 -1
- package/dist/components/json-schema-form-filter-input.cjs +50 -0
- package/dist/components/json-schema-form-filter-input.cjs.map +1 -0
- package/dist/components/json-schema-form-filter-input.d.ts +5 -0
- package/dist/components/json-schema-form-filter-input.d.ts.map +1 -0
- package/dist/components/json-schema-form-filter-input.js +50 -0
- package/dist/components/json-schema-form-filter-input.js.map +1 -0
- package/dist/components/json-schema-form-filter.cjs +49 -0
- package/dist/components/json-schema-form-filter.cjs.map +1 -0
- package/dist/components/json-schema-form-filter.d.ts +8 -0
- package/dist/components/json-schema-form-filter.d.ts.map +1 -0
- package/dist/components/json-schema-form-filter.js +49 -0
- package/dist/components/json-schema-form-filter.js.map +1 -0
- package/dist/components/json-schema-form-layout.cjs +84 -17
- package/dist/components/json-schema-form-layout.cjs.map +1 -1
- package/dist/components/json-schema-form-layout.d.ts +1 -1
- package/dist/components/json-schema-form-layout.d.ts.map +1 -1
- package/dist/components/json-schema-form-layout.js +84 -17
- package/dist/components/json-schema-form-layout.js.map +1 -1
- package/dist/components/json-schema-form-list-array.cjs +16 -5
- package/dist/components/json-schema-form-list-array.cjs.map +1 -1
- package/dist/components/json-schema-form-list-array.d.ts +2 -1
- package/dist/components/json-schema-form-list-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-list-array.js +16 -5
- package/dist/components/json-schema-form-list-array.js.map +1 -1
- package/dist/components/json-schema-form-object.cjs +239 -85
- package/dist/components/json-schema-form-object.cjs.map +1 -1
- package/dist/components/json-schema-form-object.d.ts +2 -2
- package/dist/components/json-schema-form-object.d.ts.map +1 -1
- package/dist/components/json-schema-form-object.js +241 -87
- package/dist/components/json-schema-form-object.js.map +1 -1
- package/dist/components/json-schema-form-preferences.cjs +1 -1
- package/dist/components/json-schema-form-preferences.cjs.map +1 -1
- package/dist/components/json-schema-form-preferences.d.ts +1 -1
- package/dist/components/json-schema-form-preferences.d.ts.map +1 -1
- package/dist/components/json-schema-form-preferences.js +1 -1
- package/dist/components/json-schema-form-preferences.js.map +1 -1
- package/dist/components/json-schema-form-properties-errors.fixtures.d.ts +14 -0
- package/dist/components/json-schema-form-properties-errors.fixtures.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties-size.cjs +19 -0
- package/dist/components/json-schema-form-properties-size.cjs.map +1 -0
- package/dist/components/json-schema-form-properties-size.d.ts +4 -0
- package/dist/components/json-schema-form-properties-size.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties-size.js +19 -0
- package/dist/components/json-schema-form-properties-size.js.map +1 -0
- package/dist/components/json-schema-form-properties.cjs +305 -0
- package/dist/components/json-schema-form-properties.cjs.map +1 -0
- package/dist/components/json-schema-form-properties.d.ts +20 -0
- package/dist/components/json-schema-form-properties.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties.fixtures.d.ts +157 -0
- package/dist/components/json-schema-form-properties.fixtures.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties.js +305 -0
- package/dist/components/json-schema-form-properties.js.map +1 -0
- package/dist/components/json-schema-form-property-actions-context.cjs +6 -0
- package/dist/components/json-schema-form-property-actions-context.cjs.map +1 -0
- package/dist/components/json-schema-form-property-actions-context.d.ts +2 -0
- package/dist/components/json-schema-form-property-actions-context.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-actions-context.js +6 -0
- package/dist/components/json-schema-form-property-actions-context.js.map +1 -0
- package/dist/components/json-schema-form-property-collection.cjs +31 -0
- package/dist/components/json-schema-form-property-collection.cjs.map +1 -0
- package/dist/components/json-schema-form-property-collection.d.ts +6 -0
- package/dist/components/json-schema-form-property-collection.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-collection.js +31 -0
- package/dist/components/json-schema-form-property-collection.js.map +1 -0
- package/dist/components/json-schema-form-property-draft.cjs +45 -0
- package/dist/components/json-schema-form-property-draft.cjs.map +1 -0
- package/dist/components/json-schema-form-property-draft.d.ts +8 -0
- package/dist/components/json-schema-form-property-draft.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-draft.js +45 -0
- package/dist/components/json-schema-form-property-draft.js.map +1 -0
- package/dist/components/json-schema-form-property-preview.cjs +68 -0
- package/dist/components/json-schema-form-property-preview.cjs.map +1 -0
- package/dist/components/json-schema-form-property-preview.d.ts +7 -0
- package/dist/components/json-schema-form-property-preview.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-preview.js +68 -0
- package/dist/components/json-schema-form-property-preview.js.map +1 -0
- package/dist/components/json-schema-form-property-selection.cjs +89 -0
- package/dist/components/json-schema-form-property-selection.cjs.map +1 -0
- package/dist/components/json-schema-form-property-selection.d.ts +6 -0
- package/dist/components/json-schema-form-property-selection.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-selection.js +89 -0
- package/dist/components/json-schema-form-property-selection.js.map +1 -0
- package/dist/components/json-schema-form-render.cjs +41 -4
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +42 -5
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +2 -0
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +2 -0
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +222 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -0
- package/dist/components/json-schema-form-table-array.cjs +82 -51
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +84 -53
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-template-menu.d.ts +1 -1
- package/dist/components/json-schema-form-template.d.ts +1 -1
- package/dist/components/json-schema-form-types.d.ts +7 -179
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.cjs +10 -9
- package/dist/components/json-schema-form-utils.cjs.map +1 -1
- package/dist/components/json-schema-form-utils.d.ts +11 -1
- package/dist/components/json-schema-form-utils.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.js +10 -9
- package/dist/components/json-schema-form-utils.js.map +1 -1
- package/dist/components/loading.d.ts +4 -4
- package/dist/components/mdx-editor-callout.d.ts +1 -1
- package/dist/components/mdx-editor-options.d.ts +1 -1
- package/dist/components/select.d.ts +3 -3
- package/dist/components/theme-switcher.d.ts +1 -1
- package/dist/components/use-list-menu-selection.d.ts +1 -1
- package/dist/components/useComboboxLayout.d.ts +1 -1
- package/dist/components/workload-picker-utils.d.ts +1 -1
- package/dist/data/Avatar.d.ts +1 -1
- package/dist/data/AvatarBadge.d.ts +1 -1
- package/dist/data/Badge.d.ts +1 -1
- package/dist/data/Callout.d.ts +1 -1
- package/dist/data/DataTable.cjs +575 -435
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +21 -13
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.grouping.d.ts +1 -1
- package/dist/data/DataTable.js +575 -435
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/ExecutionTree.d.ts +1 -1
- package/dist/data/FilterPill.d.ts +1 -1
- package/dist/data/FixtureEditor/RawFenceEditor.d.ts +1 -1
- package/dist/data/FixtureEditor/types.d.ts +1 -1
- package/dist/data/Gauge.d.ts +1 -1
- package/dist/data/GaugeHoverCard.d.ts +1 -1
- package/dist/data/Icon.d.ts +1 -1
- package/dist/data/KeyValueList.d.ts +1 -1
- package/dist/data/MarkdownEditor.d.ts +1 -1
- package/dist/data/MatrixTable.d.ts +1 -1
- package/dist/data/ObjectGraph.d.ts +1 -1
- package/dist/data/ProgressBars.d.ts +1 -1
- package/dist/data/Properties.cjs +86 -35
- package/dist/data/Properties.cjs.map +1 -1
- package/dist/data/Properties.d.ts +2 -2
- package/dist/data/Properties.d.ts.map +1 -1
- package/dist/data/Properties.js +87 -36
- package/dist/data/Properties.js.map +1 -1
- package/dist/data/RadialGauge.d.ts +1 -1
- package/dist/data/SchemaViewer.d.ts +1 -1
- package/dist/data/SortableHeader.d.ts +1 -1
- package/dist/data/StatStrip.d.ts +1 -1
- package/dist/data/StatusBreakdown.d.ts +1 -1
- package/dist/data/TabButton.d.ts +1 -1
- package/dist/data/TaskManager.cjs +9 -17
- package/dist/data/TaskManager.cjs.map +1 -1
- package/dist/data/TaskManager.d.ts.map +1 -1
- package/dist/data/TaskManager.js +9 -17
- package/dist/data/TaskManager.js.map +1 -1
- package/dist/data/TaskManagerButton.cjs +17 -34
- package/dist/data/TaskManagerButton.cjs.map +1 -1
- package/dist/data/TaskManagerButton.d.ts.map +1 -1
- package/dist/data/TaskManagerButton.js +18 -35
- package/dist/data/TaskManagerButton.js.map +1 -1
- package/dist/data/TaskProcessDetails.cjs +5 -26
- package/dist/data/TaskProcessDetails.cjs.map +1 -1
- package/dist/data/TaskProcessDetails.d.ts +2 -1
- package/dist/data/TaskProcessDetails.d.ts.map +1 -1
- package/dist/data/TaskProcessDetails.js +5 -26
- package/dist/data/TaskProcessDetails.js.map +1 -1
- package/dist/data/TaskProgress.cjs +24 -15
- package/dist/data/TaskProgress.cjs.map +1 -1
- package/dist/data/TaskProgress.d.ts +2 -1
- package/dist/data/TaskProgress.d.ts.map +1 -1
- package/dist/data/TaskProgress.js +24 -15
- package/dist/data/TaskProgress.js.map +1 -1
- package/dist/data/TaskResourceReadings.cjs +42 -0
- package/dist/data/TaskResourceReadings.cjs.map +1 -0
- package/dist/data/TaskResourceReadings.d.ts +6 -0
- package/dist/data/TaskResourceReadings.d.ts.map +1 -0
- package/dist/data/TaskResourceReadings.js +42 -0
- package/dist/data/TaskResourceReadings.js.map +1 -0
- package/dist/data/TaskSnapshot.cjs.map +1 -1
- package/dist/data/TaskSnapshot.d.ts +14 -1
- package/dist/data/TaskSnapshot.d.ts.map +1 -1
- package/dist/data/TaskSnapshot.js.map +1 -1
- package/dist/data/Timeline.d.ts +1 -1
- package/dist/data/Tree.d.ts +1 -1
- package/dist/data/TreeGroupHeader.d.ts +1 -1
- package/dist/data/TreeNode.d.ts +1 -1
- package/dist/data/Version.d.ts +3 -3
- package/dist/data/ai/ChatWindow.cjs +22 -12
- package/dist/data/ai/ChatWindow.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.js +22 -12
- package/dist/data/ai/ChatWindow.js.map +1 -1
- package/dist/data/ai/ChatWindow.test-utils.d.ts +4 -2
- package/dist/data/ai/ChatWindow.test-utils.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.types.d.ts +1 -1
- package/dist/data/ai/ChatWindowManager.cjs +2 -0
- package/dist/data/ai/ChatWindowManager.cjs.map +1 -1
- package/dist/data/ai/ChatWindowManager.d.ts +1 -1
- package/dist/data/ai/ChatWindowManager.d.ts.map +1 -1
- package/dist/data/ai/ChatWindowManager.js +2 -0
- package/dist/data/ai/ChatWindowManager.js.map +1 -1
- package/dist/data/ai/PolicyTree.d.ts +1 -1
- package/dist/data/ai/PromptCatalog/PromptPageHeader.d.ts +1 -1
- package/dist/data/ai/PromptCatalog/types.d.ts +1 -1
- package/dist/data/ai/PromptRunEditor/index.cjs +4 -0
- package/dist/data/ai/PromptRunEditor/index.cjs.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.d.ts +5 -2
- package/dist/data/ai/PromptRunEditor/index.d.ts.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.js +4 -0
- package/dist/data/ai/PromptRunEditor/index.js.map +1 -1
- package/dist/data/ai/SessionChatComposer.d.ts +1 -1
- package/dist/data/ai/SessionInspector.approvals.cjs +147 -0
- package/dist/data/ai/SessionInspector.approvals.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.approvals.d.ts +21 -0
- package/dist/data/ai/SessionInspector.approvals.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.approvals.js +147 -0
- package/dist/data/ai/SessionInspector.approvals.js.map +1 -0
- package/dist/data/ai/SessionInspector.cjs +21 -8
- package/dist/data/ai/SessionInspector.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.d.ts +6 -2
- package/dist/data/ai/SessionInspector.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy.d.ts +1 -1
- package/dist/data/ai/SessionInspector.js +21 -8
- package/dist/data/ai/SessionInspector.js.map +1 -1
- package/dist/data/ai/SessionInspector.panel-parts.cjs +47 -0
- package/dist/data/ai/SessionInspector.panel-parts.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.panel-parts.d.ts +20 -0
- package/dist/data/ai/SessionInspector.panel-parts.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.panel-parts.js +47 -0
- package/dist/data/ai/SessionInspector.panel-parts.js.map +1 -0
- package/dist/data/ai/SessionInspector.panels.cjs +40 -99
- package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.panels.d.ts +3 -1
- package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.panels.js +12 -71
- package/dist/data/ai/SessionInspector.panels.js.map +1 -1
- package/dist/data/ai/SessionViewer.d.ts +1 -1
- package/dist/data/ai/SessionViewer.rows.d.ts +1 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts +1 -1
- package/dist/data/ai/SessionViewer.unified.d.ts +23 -0
- package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/Footer.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/Rail.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/SectionCard.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.cjs +3 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.d.ts +3 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.js +3 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/fields.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.cjs +3 -1
- package/dist/data/ai/SpecRuntimeEditor/index.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.d.ts +5 -2
- package/dist/data/ai/SpecRuntimeEditor/index.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.js +3 -1
- package/dist/data/ai/SpecRuntimeEditor/index.js.map +1 -1
- package/dist/data/ai/chat-window-context.cjs +1 -0
- package/dist/data/ai/chat-window-context.cjs.map +1 -1
- package/dist/data/ai/chat-window-context.d.ts +13 -5
- package/dist/data/ai/chat-window-context.d.ts.map +1 -1
- package/dist/data/ai/chat-window-context.js +1 -0
- package/dist/data/ai/chat-window-context.js.map +1 -1
- package/dist/data/ai/index.d.ts +2 -1
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/ai/use-session-scroll.d.ts +1 -1
- package/dist/data/cache-browser/adapter.d.ts +1 -1
- package/dist/data/cells/CellFilterActions.d.ts +1 -1
- package/dist/data/cells/EntityCell.d.ts +1 -1
- package/dist/data/cells/tag-utils.d.ts +1 -1
- package/dist/data/chat/Chat.cjs +42 -46
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts +16 -5
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.js +43 -47
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/chat/ModelSelector.d.ts +1 -1
- package/dist/data/chat/PromptInput.cjs +13 -0
- package/dist/data/chat/PromptInput.cjs.map +1 -1
- package/dist/data/chat/PromptInput.d.ts +8 -2
- package/dist/data/chat/PromptInput.d.ts.map +1 -1
- package/dist/data/chat/PromptInput.js +14 -1
- package/dist/data/chat/PromptInput.js.map +1 -1
- package/dist/data/chat/tool-render/ToolArgs.d.ts +1 -1
- package/dist/data/chat/tool-render/ToolParams.d.ts +1 -1
- package/dist/data/chat/tool-render/ToolValue.d.ts +1 -1
- package/dist/data/chat/tool-render/adapter.d.ts +1 -1
- package/dist/data/chat/tool-render/context.d.ts +1 -1
- package/dist/data/chat/tool-render/defaults.d.ts +1 -1
- package/dist/data/chat/tool-render/known-tool-views.d.ts +1 -1
- package/dist/data/chat/tool-render/summary.d.ts +1 -1
- package/dist/data/chat/types.d.ts +1 -1
- package/dist/data/clicky-export/useClickyExport.d.ts +1 -1
- package/dist/data/data-table-server-filters.d.ts +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts +1 -1
- package/dist/data/diagnostics/StackFrameRow.d.ts +1 -1
- package/dist/data/git/GitChangeList.d.ts +1 -1
- package/dist/data/icon-fallback.d.ts +1 -1
- package/dist/data/properties-context.cjs +6 -0
- package/dist/data/properties-context.cjs.map +1 -0
- package/dist/data/properties-context.d.ts +7 -0
- package/dist/data/properties-context.d.ts.map +1 -0
- package/dist/data/properties-context.js +6 -0
- package/dist/data/properties-context.js.map +1 -0
- package/dist/data/query-browser/QueryBrowser.types.d.ts +1 -1
- package/dist/data/runtime/RuntimeBar.cjs +7 -3
- package/dist/data/runtime/RuntimeBar.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBar.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBar.js +7 -3
- package/dist/data/runtime/RuntimeBar.js.map +1 -1
- package/dist/data/task-copy.cjs +1 -1
- package/dist/data/task-copy.cjs.map +1 -1
- package/dist/data/task-copy.js +1 -1
- package/dist/data/task-copy.js.map +1 -1
- package/dist/data/task-resource-summary.cjs +30 -0
- package/dist/data/task-resource-summary.cjs.map +1 -0
- package/dist/data/task-resource-summary.d.ts +15 -0
- package/dist/data/task-resource-summary.d.ts.map +1 -0
- package/dist/data/task-resource-summary.js +30 -0
- package/dist/data/task-resource-summary.js.map +1 -0
- package/dist/data/task-status.cjs +8 -2
- package/dist/data/task-status.cjs.map +1 -1
- package/dist/data/task-status.d.ts +3 -0
- package/dist/data/task-status.d.ts.map +1 -1
- package/dist/data/task-status.js +8 -2
- package/dist/data/task-status.js.map +1 -1
- package/dist/data/task-work-progress.cjs +24 -0
- package/dist/data/task-work-progress.cjs.map +1 -0
- package/dist/data/task-work-progress.d.ts +21 -0
- package/dist/data/task-work-progress.d.ts.map +1 -0
- package/dist/data/task-work-progress.js +24 -0
- package/dist/data/task-work-progress.js.map +1 -0
- package/dist/data/test-runner/TestRunner.d.ts +1 -1
- package/dist/data/test-runner/adapter.d.ts +1 -1
- package/dist/data/test-runner/context.d.ts +1 -1
- package/dist/data/use-data-table-virtual.cjs +73 -0
- package/dist/data/use-data-table-virtual.cjs.map +1 -0
- package/dist/data/use-data-table-virtual.d.ts +40 -0
- package/dist/data/use-data-table-virtual.d.ts.map +1 -0
- package/dist/data/use-data-table-virtual.js +73 -0
- package/dist/data/use-data-table-virtual.js.map +1 -0
- package/dist/data/verification/VerificationResults.d.ts +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/expressions/lang/attributes.cjs +56 -0
- package/dist/expressions/lang/attributes.cjs.map +1 -0
- package/dist/expressions/lang/attributes.d.ts +22 -0
- package/dist/expressions/lang/attributes.d.ts.map +1 -0
- package/dist/expressions/lang/attributes.js +56 -0
- package/dist/expressions/lang/attributes.js.map +1 -0
- package/dist/expressions/lang/completion.cjs +164 -0
- package/dist/expressions/lang/completion.cjs.map +1 -0
- package/dist/expressions/lang/completion.d.ts +29 -0
- package/dist/expressions/lang/completion.d.ts.map +1 -0
- package/dist/expressions/lang/completion.js +164 -0
- package/dist/expressions/lang/completion.js.map +1 -0
- package/dist/expressions/lang/environment.cjs +115 -0
- package/dist/expressions/lang/environment.cjs.map +1 -0
- package/dist/expressions/lang/environment.d.ts +54 -0
- package/dist/expressions/lang/environment.d.ts.map +1 -0
- package/dist/expressions/lang/environment.js +115 -0
- package/dist/expressions/lang/environment.js.map +1 -0
- package/dist/expressions/lang/generated/conformance.json.d.ts +4962 -0
- package/dist/expressions/lang/generated/index.cjs +18 -0
- package/dist/expressions/lang/generated/index.cjs.map +1 -0
- package/dist/expressions/lang/generated/index.d.ts +9 -0
- package/dist/expressions/lang/generated/index.d.ts.map +1 -0
- package/dist/expressions/lang/generated/index.js +18 -0
- package/dist/expressions/lang/generated/index.js.map +1 -0
- package/dist/expressions/lang/generated/languages.json.cjs +18 -0
- package/dist/expressions/lang/generated/languages.json.cjs.map +1 -0
- package/dist/expressions/lang/generated/languages.json.d.ts +2305 -0
- package/dist/expressions/lang/generated/languages.json.js +18 -0
- package/dist/expressions/lang/generated/languages.json.js.map +1 -0
- package/dist/expressions/lang/generated/spec.json.cjs +12 -0
- package/dist/expressions/lang/generated/spec.json.cjs.map +1 -0
- package/dist/expressions/lang/generated/spec.json.d.ts +6260 -0
- package/dist/expressions/lang/generated/spec.json.js +12 -0
- package/dist/expressions/lang/generated/spec.json.js.map +1 -0
- package/dist/expressions/lang/hover.cjs +106 -0
- package/dist/expressions/lang/hover.cjs.map +1 -0
- package/dist/expressions/lang/hover.d.ts +54 -0
- package/dist/expressions/lang/hover.d.ts.map +1 -0
- package/dist/expressions/lang/hover.js +106 -0
- package/dist/expressions/lang/hover.js.map +1 -0
- package/dist/expressions/lang/index.cjs +87 -0
- package/dist/expressions/lang/index.cjs.map +1 -0
- package/dist/expressions/lang/index.d.ts +65 -0
- package/dist/expressions/lang/index.d.ts.map +1 -0
- package/dist/expressions/lang/index.js +90 -0
- package/dist/expressions/lang/index.js.map +1 -0
- package/dist/expressions/lang/merge.cjs +52 -0
- package/dist/expressions/lang/merge.cjs.map +1 -0
- package/dist/expressions/lang/merge.d.ts +12 -0
- package/dist/expressions/lang/merge.d.ts.map +1 -0
- package/dist/expressions/lang/merge.js +52 -0
- package/dist/expressions/lang/merge.js.map +1 -0
- package/dist/expressions/lang/prefix.cjs +91 -0
- package/dist/expressions/lang/prefix.cjs.map +1 -0
- package/dist/expressions/lang/prefix.d.ts +36 -0
- package/dist/expressions/lang/prefix.d.ts.map +1 -0
- package/dist/expressions/lang/prefix.js +91 -0
- package/dist/expressions/lang/prefix.js.map +1 -0
- package/dist/expressions/lang/spec.d.ts +13 -0
- package/dist/expressions/lang/spec.d.ts.map +1 -0
- package/dist/expressions/lang/theme.cjs +97 -0
- package/dist/expressions/lang/theme.cjs.map +1 -0
- package/dist/expressions/lang/theme.d.ts +6 -0
- package/dist/expressions/lang/theme.d.ts.map +1 -0
- package/dist/expressions/lang/theme.js +97 -0
- package/dist/expressions/lang/theme.js.map +1 -0
- package/dist/expressions/lang/types.d.ts +81 -0
- package/dist/expressions/lang/types.d.ts.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.cjs +308 -0
- package/dist/expressions/playground/ExpressionPlayground.cjs.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.d.ts +42 -0
- package/dist/expressions/playground/ExpressionPlayground.d.ts.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.js +291 -0
- package/dist/expressions/playground/ExpressionPlayground.js.map +1 -0
- package/dist/expressions/playground/RunControls.cjs +51 -0
- package/dist/expressions/playground/RunControls.cjs.map +1 -0
- package/dist/expressions/playground/RunControls.d.ts +7 -0
- package/dist/expressions/playground/RunControls.d.ts.map +1 -0
- package/dist/expressions/playground/RunControls.js +51 -0
- package/dist/expressions/playground/RunControls.js.map +1 -0
- package/dist/expressions/playground/VerticalSplit.cjs +109 -0
- package/dist/expressions/playground/VerticalSplit.cjs.map +1 -0
- package/dist/expressions/playground/VerticalSplit.d.ts +23 -0
- package/dist/expressions/playground/VerticalSplit.d.ts.map +1 -0
- package/dist/expressions/playground/VerticalSplit.js +109 -0
- package/dist/expressions/playground/VerticalSplit.js.map +1 -0
- package/dist/expressions/playground/api.cjs +49 -0
- package/dist/expressions/playground/api.cjs.map +1 -0
- package/dist/expressions/playground/api.d.ts +53 -0
- package/dist/expressions/playground/api.d.ts.map +1 -0
- package/dist/expressions/playground/api.js +49 -0
- package/dist/expressions/playground/api.js.map +1 -0
- package/dist/expressions/playground/languages.cjs +88 -0
- package/dist/expressions/playground/languages.cjs.map +1 -0
- package/dist/expressions/playground/languages.d.ts +43 -0
- package/dist/expressions/playground/languages.d.ts.map +1 -0
- package/dist/expressions/playground/languages.js +88 -0
- package/dist/expressions/playground/languages.js.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.cjs +72 -0
- package/dist/expressions/playground/panels/GraphPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.d.ts +19 -0
- package/dist/expressions/playground/panels/GraphPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.js +72 -0
- package/dist/expressions/playground/panels/GraphPanel.js.map +1 -0
- package/dist/expressions/playground/panels/ResultPanel.cjs +82 -0
- package/dist/expressions/playground/panels/ResultPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/ResultPanel.d.ts +11 -0
- package/dist/expressions/playground/panels/ResultPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/ResultPanel.js +82 -0
- package/dist/expressions/playground/panels/ResultPanel.js.map +1 -0
- package/dist/expressions/playground/panels/SpecPanel.cjs +76 -0
- package/dist/expressions/playground/panels/SpecPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/SpecPanel.d.ts +18 -0
- package/dist/expressions/playground/panels/SpecPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/SpecPanel.js +76 -0
- package/dist/expressions/playground/panels/SpecPanel.js.map +1 -0
- package/dist/expressions/playground/panels/TokensPanel.cjs +89 -0
- package/dist/expressions/playground/panels/TokensPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/TokensPanel.d.ts +15 -0
- package/dist/expressions/playground/panels/TokensPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/TokensPanel.js +72 -0
- package/dist/expressions/playground/panels/TokensPanel.js.map +1 -0
- package/dist/expressions/playground/panels/graphNodes.cjs +35 -0
- package/dist/expressions/playground/panels/graphNodes.cjs.map +1 -0
- package/dist/expressions/playground/panels/graphNodes.d.ts +19 -0
- package/dist/expressions/playground/panels/graphNodes.d.ts.map +1 -0
- package/dist/expressions/playground/panels/graphNodes.js +35 -0
- package/dist/expressions/playground/panels/graphNodes.js.map +1 -0
- package/dist/expressions/playground/runAction.cjs +12 -0
- package/dist/expressions/playground/runAction.cjs.map +1 -0
- package/dist/expressions/playground/runAction.d.ts +15 -0
- package/dist/expressions/playground/runAction.d.ts.map +1 -0
- package/dist/expressions/playground/runAction.js +12 -0
- package/dist/expressions/playground/runAction.js.map +1 -0
- package/dist/expressions/playground/runShortcut.cjs +9 -0
- package/dist/expressions/playground/runShortcut.cjs.map +1 -0
- package/dist/expressions/playground/runShortcut.d.ts +2 -0
- package/dist/expressions/playground/runShortcut.d.ts.map +1 -0
- package/dist/expressions/playground/runShortcut.js +9 -0
- package/dist/expressions/playground/runShortcut.js.map +1 -0
- package/dist/expressions/playground/useEditorTheme.cjs +40 -0
- package/dist/expressions/playground/useEditorTheme.cjs.map +1 -0
- package/dist/expressions/playground/useEditorTheme.d.ts +16 -0
- package/dist/expressions/playground/useEditorTheme.d.ts.map +1 -0
- package/dist/expressions/playground/useEditorTheme.js +23 -0
- package/dist/expressions/playground/useEditorTheme.js.map +1 -0
- package/dist/expressions/playground/useEvaluator.cjs +72 -0
- package/dist/expressions/playground/useEvaluator.cjs.map +1 -0
- package/dist/expressions/playground/useEvaluator.d.ts +25 -0
- package/dist/expressions/playground/useEvaluator.d.ts.map +1 -0
- package/dist/expressions/playground/useEvaluator.js +72 -0
- package/dist/expressions/playground/useEvaluator.js.map +1 -0
- package/dist/expressions/playground/useParsedInput.cjs +22 -0
- package/dist/expressions/playground/useParsedInput.cjs.map +1 -0
- package/dist/expressions/playground/useParsedInput.d.ts +20 -0
- package/dist/expressions/playground/useParsedInput.d.ts.map +1 -0
- package/dist/expressions/playground/useParsedInput.js +22 -0
- package/dist/expressions/playground/useParsedInput.js.map +1 -0
- package/dist/expressions/playground/verticalSplitModel.cjs +11 -0
- package/dist/expressions/playground/verticalSplitModel.cjs.map +1 -0
- package/dist/expressions/playground/verticalSplitModel.d.ts +3 -0
- package/dist/expressions/playground/verticalSplitModel.d.ts.map +1 -0
- package/dist/expressions/playground/verticalSplitModel.js +11 -0
- package/dist/expressions/playground/verticalSplitModel.js.map +1 -0
- package/dist/expressions/playground.cjs +18 -0
- package/dist/expressions/playground.cjs.map +1 -0
- package/dist/expressions/playground.d.ts +18 -0
- package/dist/expressions/playground.d.ts.map +1 -0
- package/dist/expressions/playground.js +18 -0
- package/dist/expressions/playground.js.map +1 -0
- package/dist/expressions.cjs +28 -0
- package/dist/expressions.cjs.map +1 -0
- package/dist/expressions.d.ts +10 -0
- package/dist/expressions.d.ts.map +1 -0
- package/dist/expressions.js +28 -0
- package/dist/expressions.js.map +1 -0
- package/dist/hooks/density-provider.d.ts +1 -1
- package/dist/hooks/theme-provider.d.ts +1 -1
- package/dist/hooks/use-density.d.ts +1 -1
- package/dist/hooks/use-resource-clock.cjs +14 -0
- package/dist/hooks/use-resource-clock.cjs.map +1 -0
- package/dist/hooks/use-resource-clock.d.ts +2 -0
- package/dist/hooks/use-resource-clock.d.ts.map +1 -0
- package/dist/hooks/use-resource-clock.js +14 -0
- package/dist/hooks/use-resource-clock.js.map +1 -0
- package/dist/hooks/use-task-run.cjs +12 -3
- package/dist/hooks/use-task-run.cjs.map +1 -1
- package/dist/hooks/use-task-run.d.ts.map +1 -1
- package/dist/hooks/use-task-run.js +12 -3
- package/dist/hooks/use-task-run.js.map +1 -1
- package/dist/hooks/use-theme.d.ts +1 -1
- package/dist/icons/registry.d.ts +1 -1
- package/dist/icons/types.d.ts +1 -1
- package/dist/layout/AppShell.d.ts +1 -1
- package/dist/layout/AppShell.nav.drag.d.ts +1 -1
- package/dist/layout/AppSidebar.d.ts +1 -1
- package/dist/layout/Panel.d.ts +1 -1
- package/dist/layout/PanelFrame.d.ts +1 -1
- package/dist/layout/Section.d.ts +1 -1
- package/dist/layout/SplitPane.d.ts +1 -1
- package/dist/layout/Tabs.d.ts +1 -1
- package/dist/layout/Workspace.d.ts +1 -1
- package/dist/layout/Workspace.model.d.ts +1 -1
- package/dist/lib/combobox-values.d.ts +1 -1
- package/dist/monaco/MonacoEditor.cjs +3 -3
- package/dist/monaco/MonacoEditor.cjs.map +1 -1
- package/dist/monaco/MonacoEditor.js +2 -2
- package/dist/monaco/MonacoEditor.js.map +1 -1
- package/dist/monaco/types.d.ts +1 -1
- package/dist/monaco/use-monaco-worker.d.ts +1 -1
- package/dist/overlay/CellActions.d.ts +1 -1
- package/dist/overlay/CommandPalette.d.ts +2 -2
- package/dist/overlay/CommandPalette.model.d.ts +1 -1
- package/dist/overlay/CommandPaletteList.d.ts +1 -1
- package/dist/overlay/DropdownMenu.d.ts +1 -1
- package/dist/overlay/HoverCard.d.ts +1 -1
- package/dist/overlay/Modal.d.ts +2 -2
- package/dist/overlay/Toast.d.ts +1 -1
- package/dist/overlay/TourCard.d.ts +1 -1
- package/dist/overlay/TourProvider.d.ts +1 -1
- package/dist/overlay/dropdownMenuContext.d.ts +1 -1
- package/dist/overlay/toast-context.d.ts +2 -2
- package/dist/overlay/tour-context.d.ts +1 -1
- package/dist/overlay/tour-types.d.ts +1 -1
- package/dist/profiles/connections/connectionBrowserModel.d.ts +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts +1 -1
- package/dist/profiles/editor/profileBuilder.d.ts +1 -1
- package/dist/profiles/elasticsearch/esParamOperandExtension.d.ts +1 -1
- package/dist/profiles/fields/profileFieldControls.d.ts +1 -1
- package/dist/profiles/fields/profileFieldIcons.d.ts +1 -1
- package/dist/profiles/fields/profileFieldState.d.ts +1 -1
- package/dist/profiles/query/jsonPathSample.d.ts +1 -1
- package/dist/profiles/query/jsonPathSampleRow.d.ts +1 -1
- package/dist/profiles/query/prometheusResults.d.ts +2 -2
- package/dist/rpc/EndpointList.d.ts +1 -1
- package/dist/rpc/EntityExplorerApp.d.ts +1 -1
- package/dist/rpc/OperationCatalog.d.ts +1 -1
- package/dist/rpc/OperationEntityContextPicker.d.ts +1 -1
- package/dist/rpc/OperationEntityPage.d.ts +1 -1
- package/dist/rpc/OperationResultView.d.ts +1 -1
- package/dist/rpc/RouterProvider.d.ts +1 -1
- package/dist/rpc/SchemaActionForm.d.ts +1 -1
- package/dist/rpc/formMetadata.d.ts +1 -1
- package/dist/rpc/router.d.ts +1 -1
- package/dist/rpc/rpc-story.fixtures.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/package.json +21 -2
|
@@ -5,10 +5,10 @@ import { cn } from "../lib/utils.js";
|
|
|
5
5
|
import { Icon } from "../data/Icon.js";
|
|
6
6
|
import { HoverCard } from "../overlay/HoverCard.js";
|
|
7
7
|
import { Button } from "./button.js";
|
|
8
|
-
import { controlHeightClass, inputSizeClass } from "./json-schema-form-size.js";
|
|
8
|
+
import { controlHeightClass, inputSizeClass, controlMinHeightClass } from "./json-schema-form-size.js";
|
|
9
9
|
import { schemaHelper } from "./json-schema-form-resolve.js";
|
|
10
10
|
import { appendInstancePath } from "./json-schema-form-errors.js";
|
|
11
|
-
import { orderByXOrder, orderByClickyOrder, seedFromSchema } from "./json-schema-form-utils.js";
|
|
11
|
+
import { orderByXOrder, orderByClickyOrder, canRemoveItem, canAddItem, seedFromSchema } from "./json-schema-form-utils.js";
|
|
12
12
|
import { UiTrash } from "../icons/components/UiTrash.js";
|
|
13
13
|
import { UiAdd } from "../icons/components/UiAdd.js";
|
|
14
14
|
function TableArray({
|
|
@@ -23,6 +23,7 @@ function TableArray({
|
|
|
23
23
|
itemSchema["x-order"]
|
|
24
24
|
);
|
|
25
25
|
const childCtx = { ...ctx, readOnly, depth: ctx.depth + 1 };
|
|
26
|
+
const removable = !readOnly && canRemoveItem(field, items.length);
|
|
26
27
|
function cell(item, rowIndex, col, prop) {
|
|
27
28
|
const obj = isPlainObject(item) ? item : {};
|
|
28
29
|
const nodes = ctx.render.renderFieldNodes(
|
|
@@ -39,59 +40,89 @@ function TableArray({
|
|
|
39
40
|
},
|
|
40
41
|
childCtx
|
|
41
42
|
);
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
return /* @__PURE__ */ jsxs("div", { className: "overflow-x-auto rounded-md border border-input", children: [
|
|
45
|
-
/* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
46
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-input bg-muted/40 text-left", children: [
|
|
47
|
-
columns.map(([col, prop]) => /* @__PURE__ */ jsx(
|
|
48
|
-
"th",
|
|
49
|
-
{
|
|
50
|
-
className: "px-2 py-1 text-xs font-medium text-muted-foreground",
|
|
51
|
-
children: /* @__PURE__ */ jsx(TableColumnHeader, { name: col, schema: prop })
|
|
52
|
-
},
|
|
53
|
-
col
|
|
54
|
-
)),
|
|
55
|
-
!readOnly && /* @__PURE__ */ jsx("th", { className: "w-10 px-2 py-1" })
|
|
56
|
-
] }) }),
|
|
57
|
-
/* @__PURE__ */ jsx("tbody", { children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
58
|
-
"tr",
|
|
59
|
-
{
|
|
60
|
-
className: "border-b border-input last:border-b-0 align-top",
|
|
61
|
-
children: [
|
|
62
|
-
columns.map(([col, prop]) => /* @__PURE__ */ jsx("td", { className: "px-2 py-1", children: cell(item, i, col, prop) }, col)),
|
|
63
|
-
!readOnly && /* @__PURE__ */ jsx("td", { className: "px-2 py-1", children: /* @__PURE__ */ jsx(
|
|
64
|
-
"button",
|
|
65
|
-
{
|
|
66
|
-
type: "button",
|
|
67
|
-
"aria-label": `Remove item ${i + 1}`,
|
|
68
|
-
className: cn(
|
|
69
|
-
"inline-flex aspect-square items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
70
|
-
controlHeightClass[ctx.size]
|
|
71
|
-
),
|
|
72
|
-
onClick: () => field.onChange(removeIndex(items, i)),
|
|
73
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: UiTrash, className: "text-sm" })
|
|
74
|
-
}
|
|
75
|
-
) })
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
i
|
|
79
|
-
)) })
|
|
80
|
-
] }),
|
|
81
|
-
!readOnly && /* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxs(
|
|
82
|
-
Button,
|
|
43
|
+
return ctx.presentation ? /* @__PURE__ */ jsx(
|
|
44
|
+
"div",
|
|
83
45
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
children:
|
|
89
|
-
/* @__PURE__ */ jsx(Icon, { icon: UiAdd, className: "text-sm" }),
|
|
90
|
-
"Add item"
|
|
91
|
-
]
|
|
46
|
+
className: cn(
|
|
47
|
+
"flex min-w-0 items-center [overflow-wrap:anywhere] [&_span[data-jsf-readonly]]:h-auto [&_span[data-jsf-readonly]]:min-w-0",
|
|
48
|
+
controlMinHeightClass[ctx.size]
|
|
49
|
+
),
|
|
50
|
+
children: nodes == null ? void 0 : nodes.value
|
|
92
51
|
}
|
|
93
|
-
)
|
|
94
|
-
|
|
52
|
+
) : (nodes == null ? void 0 : nodes.value) ?? null;
|
|
53
|
+
}
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
"overflow-x-auto",
|
|
59
|
+
!ctx.presentation && "rounded-md border border-input"
|
|
60
|
+
),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
|
|
63
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs(
|
|
64
|
+
"tr",
|
|
65
|
+
{
|
|
66
|
+
className: cn(
|
|
67
|
+
"border-b bg-muted/40 text-left",
|
|
68
|
+
ctx.presentation ? "border-border" : "border-input"
|
|
69
|
+
),
|
|
70
|
+
children: [
|
|
71
|
+
columns.map(([col, prop]) => /* @__PURE__ */ jsx(
|
|
72
|
+
"th",
|
|
73
|
+
{
|
|
74
|
+
className: "px-2 py-1 text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]",
|
|
75
|
+
children: ctx.presentation ? prop.title || col : /* @__PURE__ */ jsx(TableColumnHeader, { name: col, schema: prop })
|
|
76
|
+
},
|
|
77
|
+
col
|
|
78
|
+
)),
|
|
79
|
+
removable && /* @__PURE__ */ jsx("th", { className: "w-10 px-2 py-1" })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ jsx("tbody", { children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
84
|
+
"tr",
|
|
85
|
+
{
|
|
86
|
+
className: cn(
|
|
87
|
+
"border-b last:border-b-0 align-top",
|
|
88
|
+
ctx.presentation ? "border-border" : "border-input"
|
|
89
|
+
),
|
|
90
|
+
children: [
|
|
91
|
+
columns.map(([col, prop]) => /* @__PURE__ */ jsx("td", { className: "px-2 py-1", children: cell(item, i, col, prop) }, col)),
|
|
92
|
+
removable && /* @__PURE__ */ jsx("td", { className: "px-2 py-1", children: /* @__PURE__ */ jsx(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
"aria-label": `Remove item ${i + 1}`,
|
|
97
|
+
className: cn(
|
|
98
|
+
"inline-flex aspect-square items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
99
|
+
controlHeightClass[ctx.size]
|
|
100
|
+
),
|
|
101
|
+
onClick: () => field.onChange(removeIndex(items, i)),
|
|
102
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: UiTrash, className: "text-sm" })
|
|
103
|
+
}
|
|
104
|
+
) })
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
i
|
|
108
|
+
)) })
|
|
109
|
+
] }),
|
|
110
|
+
!readOnly && canAddItem(field, items.length) && /* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxs(
|
|
111
|
+
Button,
|
|
112
|
+
{
|
|
113
|
+
type: "button",
|
|
114
|
+
variant: "outline",
|
|
115
|
+
className: cn("gap-1.5", inputSizeClass[ctx.size]),
|
|
116
|
+
onClick: () => field.onChange([...items, seedFromSchema(itemSchema)]),
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Icon, { icon: UiAdd, className: "text-sm" }),
|
|
119
|
+
"Add item"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
) })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
);
|
|
95
126
|
}
|
|
96
127
|
function TableColumnHeader({
|
|
97
128
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-table-array.js","sources":["../../src/components/json-schema-form-table-array.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\nimport { isPlainObject, removeIndex, setIndex } from \"../lib/collections\";\nimport { cn } from \"../lib/utils\";\nimport { Icon } from \"../data/Icon\";\nimport { UiAdd, UiTrash } from \"../icons\";\nimport { HoverCard } from \"../overlay/HoverCard\";\nimport { Button } from \"./button\";\nimport {\n controlHeightClass,\n inputSizeClass,\n} from \"./json-schema-form-size\";\nimport { schemaHelper } from \"./json-schema-form-resolve\";\nimport { appendInstancePath } from \"./json-schema-form-errors\";\nimport {\n orderByClickyOrder,\n orderByXOrder,\n seedFromSchema,\n} from \"./json-schema-form-utils\";\nimport type {\n FieldControl,\n JsonSchemaProperty,\n RenderContext,\n} from \"./json-schema-form-types\";\n\n// TableArray renders an object-item array as a table: a header row of the item's\n// property names and one row per item with value-only controls, plus per-row\n// remove and an add button. Driven by `x-layout: table`.\nexport function TableArray({\n field,\n ctx,\n readOnly,\n}: {\n field: FieldControl;\n ctx: RenderContext;\n readOnly: boolean;\n}) {\n const items = Array.isArray(field.value) ? field.value : [];\n const itemSchema = field.itemSchema ?? { type: \"object\" };\n // The item schema's explicit `x-order` is the authority for the keys it names:\n // per-property `x-clicky-order` sorts first (so it still orders everything\n // `x-order` leaves out, and composes across merged sources), then `x-order`\n // pulls its listed columns to the front in its own sequence.\n const columns = orderByXOrder(\n orderByClickyOrder(Object.entries(itemSchema.properties ?? {})),\n itemSchema[\"x-order\"],\n );\n const childCtx: RenderContext = { ...ctx, readOnly, depth: ctx.depth + 1 };\n\n function cell(\n item: unknown,\n rowIndex: number,\n col: string,\n prop: JsonSchemaProperty,\n ): ReactNode {\n const obj = isPlainObject(item) ? item : {};\n const nodes = ctx.render.renderFieldNodes(\n {\n key: `${field.key}[${rowIndex}].${col}`,\n prop,\n required: false,\n value: obj[col],\n onChange: (next) =>\n field.onChange(setIndex(items, rowIndex, { ...obj, [col]: next })),\n instancePath: appendInstancePath(\n appendInstancePath(ctx.instancePath, rowIndex),\n col,\n ),\n },\n childCtx,\n );\n return nodes?.value ?? null;\n }\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"json-schema-form-table-array.js","sources":["../../src/components/json-schema-form-table-array.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\nimport { isPlainObject, removeIndex, setIndex } from \"../lib/collections\";\nimport { cn } from \"../lib/utils\";\nimport { Icon } from \"../data/Icon\";\nimport { UiAdd, UiTrash } from \"../icons\";\nimport { HoverCard } from \"../overlay/HoverCard\";\nimport { Button } from \"./button\";\nimport {\n controlHeightClass,\n controlMinHeightClass,\n inputSizeClass,\n} from \"./json-schema-form-size\";\nimport { schemaHelper } from \"./json-schema-form-resolve\";\nimport { appendInstancePath } from \"./json-schema-form-errors\";\nimport {\n canAddItem,\n canRemoveItem,\n orderByClickyOrder,\n orderByXOrder,\n seedFromSchema,\n} from \"./json-schema-form-utils\";\nimport type {\n FieldControl,\n JsonSchemaProperty,\n RenderContext,\n} from \"./json-schema-form-types\";\n\n// TableArray renders an object-item array as a table: a header row of the item's\n// property names and one row per item with value-only controls, plus per-row\n// remove and an add button. Driven by `x-layout: table`.\nexport function TableArray({\n field,\n ctx,\n readOnly,\n}: {\n field: FieldControl;\n ctx: RenderContext;\n readOnly: boolean;\n}) {\n const items = Array.isArray(field.value) ? field.value : [];\n const itemSchema = field.itemSchema ?? { type: \"object\" };\n // The item schema's explicit `x-order` is the authority for the keys it names:\n // per-property `x-clicky-order` sorts first (so it still orders everything\n // `x-order` leaves out, and composes across merged sources), then `x-order`\n // pulls its listed columns to the front in its own sequence.\n const columns = orderByXOrder(\n orderByClickyOrder(Object.entries(itemSchema.properties ?? {})),\n itemSchema[\"x-order\"],\n );\n const childCtx: RenderContext = { ...ctx, readOnly, depth: ctx.depth + 1 };\n // The trash column disappears with the buttons that would have filled it, so\n // an array of a fixed length reads as a table rather than one with a blank\n // gutter down the side.\n const removable = !readOnly && canRemoveItem(field, items.length);\n\n function cell(\n item: unknown,\n rowIndex: number,\n col: string,\n prop: JsonSchemaProperty,\n ): ReactNode {\n const obj = isPlainObject(item) ? item : {};\n const nodes = ctx.render.renderFieldNodes(\n {\n key: `${field.key}[${rowIndex}].${col}`,\n prop,\n required: false,\n value: obj[col],\n onChange: (next) =>\n field.onChange(setIndex(items, rowIndex, { ...obj, [col]: next })),\n instancePath: appendInstancePath(\n appendInstancePath(ctx.instancePath, rowIndex),\n col,\n ),\n },\n childCtx,\n );\n return ctx.presentation ? (\n <div\n className={cn(\n \"flex min-w-0 items-center [overflow-wrap:anywhere] [&_span[data-jsf-readonly]]:h-auto [&_span[data-jsf-readonly]]:min-w-0\",\n controlMinHeightClass[ctx.size],\n )}\n >\n {nodes?.value}\n </div>\n ) : (\n (nodes?.value ?? null)\n );\n }\n\n return (\n <div\n className={cn(\n \"overflow-x-auto\",\n !ctx.presentation && \"rounded-md border border-input\",\n )}\n >\n <table className=\"w-full text-sm\">\n <thead>\n <tr\n className={cn(\n \"border-b bg-muted/40 text-left\",\n ctx.presentation ? \"border-border\" : \"border-input\",\n )}\n >\n {columns.map(([col, prop]) => (\n <th\n key={col}\n className=\"px-2 py-1 text-xs font-medium text-muted-foreground [overflow-wrap:anywhere]\"\n >\n {ctx.presentation ? (\n prop.title || col\n ) : (\n <TableColumnHeader name={col} schema={prop} />\n )}\n </th>\n ))}\n {removable && <th className=\"w-10 px-2 py-1\" />}\n </tr>\n </thead>\n <tbody>\n {items.map((item, i) => (\n <tr\n key={i}\n className={cn(\n \"border-b last:border-b-0 align-top\",\n ctx.presentation ? \"border-border\" : \"border-input\",\n )}\n >\n {columns.map(([col, prop]) => (\n <td key={col} className=\"px-2 py-1\">\n {cell(item, i, col, prop)}\n </td>\n ))}\n {removable && (\n <td className=\"px-2 py-1\">\n <button\n type=\"button\"\n aria-label={`Remove item ${i + 1}`}\n className={cn(\n \"inline-flex aspect-square items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground\",\n controlHeightClass[ctx.size],\n )}\n onClick={() => field.onChange(removeIndex(items, i))}\n >\n <Icon icon={UiTrash} className=\"text-sm\" />\n </button>\n </td>\n )}\n </tr>\n ))}\n </tbody>\n </table>\n {!readOnly && canAddItem(field, items.length) && (\n <div className=\"p-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n className={cn(\"gap-1.5\", inputSizeClass[ctx.size])}\n onClick={() =>\n field.onChange([...items, seedFromSchema(itemSchema)])\n }\n >\n <Icon icon={UiAdd} className=\"text-sm\" />\n Add item\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nfunction TableColumnHeader({\n name,\n schema,\n}: {\n name: string;\n schema: JsonSchemaProperty;\n}) {\n const label =\n typeof schema.title === \"string\" && schema.title ? schema.title : name;\n const helper = schemaHelper(schema);\n if (!helper) return label;\n\n return (\n <HoverCard\n placement=\"bottom\"\n trigger={\n <button\n type=\"button\"\n aria-label={`${label} help`}\n className=\"cursor-help border-b border-dotted border-current text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {label}\n </button>\n }\n cardClassName=\"max-w-xs whitespace-normal text-left font-normal text-foreground\"\n >\n {helper}\n </HoverCard>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AA8BO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,QAAQ,MAAM,QAAQ,MAAM,KAAK,IAAI,MAAM,QAAQ,CAAA;AACzD,QAAM,aAAa,MAAM,cAAc,EAAE,MAAM,SAAA;AAK/C,QAAM,UAAU;AAAA,IACd,mBAAmB,OAAO,QAAQ,WAAW,cAAc,CAAA,CAAE,CAAC;AAAA,IAC9D,WAAW,SAAS;AAAA,EAAA;AAEtB,QAAM,WAA0B,EAAE,GAAG,KAAK,UAAU,OAAO,IAAI,QAAQ,EAAA;AAIvE,QAAM,YAAY,CAAC,YAAY,cAAc,OAAO,MAAM,MAAM;AAEhE,WAAS,KACP,MACA,UACA,KACA,MACW;AACX,UAAM,MAAM,cAAc,IAAI,IAAI,OAAO,CAAA;AACzC,UAAM,QAAQ,IAAI,OAAO;AAAA,MACvB;AAAA,QACE,KAAK,GAAG,MAAM,GAAG,IAAI,QAAQ,KAAK,GAAG;AAAA,QACrC;AAAA,QACA,UAAU;AAAA,QACV,OAAO,IAAI,GAAG;AAAA,QACd,UAAU,CAAC,SACT,MAAM,SAAS,SAAS,OAAO,UAAU,EAAE,GAAG,KAAK,CAAC,GAAG,GAAG,KAAA,CAAM,CAAC;AAAA,QACnE,cAAc;AAAA,UACZ,mBAAmB,IAAI,cAAc,QAAQ;AAAA,UAC7C;AAAA,QAAA;AAAA,MACF;AAAA,MAEF;AAAA,IAAA;AAEF,WAAO,IAAI,eACT;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,sBAAsB,IAAI,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@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { PreExtension } from './json-schema-form-types';
|
|
3
3
|
import { TemplateValuesLoader } from './json-schema-form-template-menu';
|
|
4
4
|
export type { TemplateToken, TemplateValuesLoader } from './json-schema-form-template-menu';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { LabelIconSpec } from '../data/Icon';
|
|
3
|
-
import { FieldInstancePath, FormErrorContext, FormErrorProps } from './json-schema-form-error-types';
|
|
4
|
-
import { FormSize } from './json-schema-form-size';
|
|
5
|
-
import { SortMode } from './json-schema-form-preferences';
|
|
6
3
|
import { FieldTone } from './json-schema-form-tone';
|
|
7
4
|
import { MdxEditorPluginOptions } from './mdx-editor-options';
|
|
5
|
+
import { LookupDescriptor } from './json-schema-form-runtime-types';
|
|
8
6
|
export type { FieldTone };
|
|
7
|
+
export type * from './json-schema-form-runtime-types';
|
|
9
8
|
export interface JsonSchemaProperty {
|
|
10
9
|
type?: JsonSchemaType | JsonSchemaType[];
|
|
11
10
|
description?: string;
|
|
@@ -19,6 +18,8 @@ export interface JsonSchemaProperty {
|
|
|
19
18
|
maximum?: number;
|
|
20
19
|
multipleOf?: number;
|
|
21
20
|
items?: JsonSchemaProperty;
|
|
21
|
+
minItems?: number;
|
|
22
|
+
maxItems?: number;
|
|
22
23
|
properties?: Record<string, JsonSchemaProperty>;
|
|
23
24
|
required?: string[];
|
|
24
25
|
additionalProperties?: boolean | JsonSchemaProperty;
|
|
@@ -171,6 +172,8 @@ export interface FieldControl {
|
|
|
171
172
|
keyOptions?: FieldOption[];
|
|
172
173
|
layout?: "inline" | "stack" | "table";
|
|
173
174
|
itemSchema?: JsonSchemaProperty;
|
|
175
|
+
minItems?: number;
|
|
176
|
+
maxItems?: number;
|
|
174
177
|
arrayDisplay?: ArrayDisplay;
|
|
175
178
|
itemSpec?: ArrayItemSpec;
|
|
176
179
|
itemSummary?: (args: {
|
|
@@ -187,179 +190,4 @@ export interface FieldOption {
|
|
|
187
190
|
description?: string;
|
|
188
191
|
tone?: FieldTone;
|
|
189
192
|
}
|
|
190
|
-
export interface LookupDescriptor {
|
|
191
|
-
url: string;
|
|
192
|
-
filter: string;
|
|
193
|
-
searchParam?: string;
|
|
194
|
-
multi?: boolean;
|
|
195
|
-
scope?: LookupScope;
|
|
196
|
-
hierarchy?: LookupHierarchy;
|
|
197
|
-
}
|
|
198
|
-
export interface LookupHierarchy {
|
|
199
|
-
delimiters: string;
|
|
200
|
-
}
|
|
201
|
-
export interface LookupScope {
|
|
202
|
-
param: string;
|
|
203
|
-
from: string;
|
|
204
|
-
map?: Record<string, string[]>;
|
|
205
|
-
join?: string;
|
|
206
|
-
}
|
|
207
|
-
export type LookupFetcher = (args: {
|
|
208
|
-
descriptor: LookupDescriptor;
|
|
209
|
-
query: string;
|
|
210
|
-
rootValue?: Record<string, unknown>;
|
|
211
|
-
}) => Promise<FieldOption[]>;
|
|
212
|
-
export interface PreExtensionContext {
|
|
213
|
-
key: string;
|
|
214
|
-
prop: JsonSchemaProperty;
|
|
215
|
-
value: unknown;
|
|
216
|
-
rootValue?: Record<string, unknown>;
|
|
217
|
-
onRootChange?: (next: Record<string, unknown>) => void;
|
|
218
|
-
}
|
|
219
|
-
export type PreExtension = (field: FieldControl, ctx: PreExtensionContext) => FieldControl | null;
|
|
220
|
-
export interface PostExtensionContext {
|
|
221
|
-
rootValue?: Record<string, unknown>;
|
|
222
|
-
onRootChange?: (next: Record<string, unknown>) => void;
|
|
223
|
-
/**
|
|
224
|
-
* RFC 6901 pointer to the field being rendered, e.g. `/columns/3/jsonpath`.
|
|
225
|
-
*
|
|
226
|
-
* With `rootValue` and `onRootChange` it is what lets an extension write a
|
|
227
|
-
* *sibling* of its own field — a control whose value only means something
|
|
228
|
-
* paired with another one has to be able to set both, rather than rendering
|
|
229
|
-
* an instruction telling the author to go and finish the job by hand.
|
|
230
|
-
*/
|
|
231
|
-
instancePath?: string;
|
|
232
|
-
}
|
|
233
|
-
export type PostExtension = (field: FieldControl, nodes: {
|
|
234
|
-
label: ReactNode;
|
|
235
|
-
value: ReactNode;
|
|
236
|
-
}, ctx?: PostExtensionContext) => {
|
|
237
|
-
label: ReactNode;
|
|
238
|
-
value: ReactNode;
|
|
239
|
-
};
|
|
240
|
-
export interface FieldArgs extends FieldInstancePath {
|
|
241
|
-
key: string;
|
|
242
|
-
prop: JsonSchemaProperty;
|
|
243
|
-
required: boolean;
|
|
244
|
-
value: unknown;
|
|
245
|
-
onChange: (next: unknown) => void;
|
|
246
|
-
}
|
|
247
|
-
export interface RenderApi {
|
|
248
|
-
renderFieldNodes(args: FieldArgs, ctx: RenderContext): {
|
|
249
|
-
label: ReactNode;
|
|
250
|
-
value: ReactNode;
|
|
251
|
-
} | null;
|
|
252
|
-
renderFieldRow(args: FieldArgs, ctx: RenderContext, opts?: {
|
|
253
|
-
labelOverride?: string;
|
|
254
|
-
}): ReactNode | null;
|
|
255
|
-
renderObjectFields(schema: JsonSchemaObject, value: Record<string, unknown>, onChange: (next: Record<string, unknown>) => void, ctx: RenderContext, opts?: {
|
|
256
|
-
hiddenKeys?: string[];
|
|
257
|
-
}): ReactNode[];
|
|
258
|
-
}
|
|
259
|
-
export interface RenderContext extends FormErrorContext {
|
|
260
|
-
readOnly: boolean;
|
|
261
|
-
hideReadOnlyFields: boolean;
|
|
262
|
-
layout: FormLayout;
|
|
263
|
-
size: FormSize;
|
|
264
|
-
idPrefix?: string;
|
|
265
|
-
sortMode: SortMode;
|
|
266
|
-
fieldFilter?: string;
|
|
267
|
-
pre: PreExtension[];
|
|
268
|
-
post: PostExtension[];
|
|
269
|
-
rootValue?: Record<string, unknown>;
|
|
270
|
-
onRootChange?: (next: Record<string, unknown>) => void;
|
|
271
|
-
depth: number;
|
|
272
|
-
render: RenderApi;
|
|
273
|
-
}
|
|
274
|
-
export interface FormLayout {
|
|
275
|
-
/** "inline" = 2-column label/value; "stacked" = label above value. */
|
|
276
|
-
mode: "inline" | "stacked";
|
|
277
|
-
/**
|
|
278
|
-
* Inline only: the label column shrinks to fit its widest label and is capped
|
|
279
|
-
* at this width, truncating longer labels with an ellipsis. Default "40ch".
|
|
280
|
-
*/
|
|
281
|
-
labelMaxWidth?: string;
|
|
282
|
-
/**
|
|
283
|
-
* Max width of the value column (inline) or the whole label+value stack
|
|
284
|
-
* (stacked), as a CSS length. Default "600px". Keeps controls readable on
|
|
285
|
-
* wide viewports instead of stretching edge to edge.
|
|
286
|
-
*/
|
|
287
|
-
valueMaxWidth?: string;
|
|
288
|
-
/**
|
|
289
|
-
* How every field's description is presented. "inline" (default) keeps
|
|
290
|
-
* today's paragraph under the control; "hover" moves it behind a `?` beside
|
|
291
|
-
* the label, which costs no vertical space. A field's own `x-help-display`
|
|
292
|
-
* wins over this.
|
|
293
|
-
*/
|
|
294
|
-
help?: HelpDisplay;
|
|
295
|
-
}
|
|
296
|
-
export interface JsonSchemaFormProps extends FormErrorProps {
|
|
297
|
-
schema: JsonSchemaObject;
|
|
298
|
-
value: Record<string, unknown>;
|
|
299
|
-
onChange: (next: Record<string, unknown>) => void;
|
|
300
|
-
readOnly?: boolean;
|
|
301
|
-
/**
|
|
302
|
-
* Shorthand for `layout: { mode: "inline" }` (2-column label/value); stacked
|
|
303
|
-
* when false (default). Ignored when `layout` is provided.
|
|
304
|
-
*/
|
|
305
|
-
inline?: boolean;
|
|
306
|
-
/**
|
|
307
|
-
* Form-level layout. Takes precedence over `inline`. Inline mode shrinks the
|
|
308
|
-
* label column to fit (capped/truncated at 40ch) and caps the value column at
|
|
309
|
-
* 600px.
|
|
310
|
-
*/
|
|
311
|
-
layout?: FormLayout;
|
|
312
|
-
/**
|
|
313
|
-
* Scales every input and label form-wide. One of "xs" | "sm" | "md" | "lg" |
|
|
314
|
-
* "xl"; defaults to "md" (the original fixed sizing). Applies at every depth.
|
|
315
|
-
*/
|
|
316
|
-
size?: FormSize;
|
|
317
|
-
/**
|
|
318
|
-
* Namespaces generated input/label ids (`jsf-<idPrefix>-<key>`). Set this when
|
|
319
|
-
* more than one form renders on the same page so their ids don't collide,
|
|
320
|
-
* which would otherwise break label/input focus association.
|
|
321
|
-
*/
|
|
322
|
-
idPrefix?: string;
|
|
323
|
-
/**
|
|
324
|
-
* Omit fields whose schema declares `readOnly: true` entirely, instead of
|
|
325
|
-
* rendering them as read-only value displays. Applies at every depth.
|
|
326
|
-
*/
|
|
327
|
-
hideReadOnlyFields?: boolean;
|
|
328
|
-
/** Property keys to omit from rendering. */
|
|
329
|
-
hiddenKeys?: string[];
|
|
330
|
-
/**
|
|
331
|
-
* Render required fields before optional ones at every object level. The sort
|
|
332
|
-
* is stable: required keys keep their relative order, then optional keys keep
|
|
333
|
-
* theirs. Defaults to false (schema property order is preserved).
|
|
334
|
-
*/
|
|
335
|
-
requiredFirst?: boolean;
|
|
336
|
-
title?: string;
|
|
337
|
-
pre?: PreExtension[];
|
|
338
|
-
post?: PostExtension[];
|
|
339
|
-
/**
|
|
340
|
-
* Resolves options for `x-clicky-lookup` fields (async entity-reference
|
|
341
|
-
* pickers). When set, the form provides it to its lookup controls via context.
|
|
342
|
-
* Hosts typically build it from the operations api client's lookup endpoint.
|
|
343
|
-
*/
|
|
344
|
-
lookupFetcher?: LookupFetcher;
|
|
345
|
-
/**
|
|
346
|
-
* Show the top-right three-dot display-options menu (size, layout, and sort).
|
|
347
|
-
* Defaults to true. The menu controls only this form's appearance — never
|
|
348
|
-
* global page density or field values. When false the form renders exactly as
|
|
349
|
-
* before and performs no preference reads/writes.
|
|
350
|
-
*/
|
|
351
|
-
showPreferencesMenu?: boolean;
|
|
352
|
-
/**
|
|
353
|
-
* Persist menu selections to localStorage so they survive remounts. Defaults
|
|
354
|
-
* to true. When false the menu still adjusts the current instance, but nothing
|
|
355
|
-
* is read from or written to localStorage.
|
|
356
|
-
*/
|
|
357
|
-
persistPreferences?: boolean;
|
|
358
|
-
/**
|
|
359
|
-
* localStorage key the display preferences are stored under. Defaults to a
|
|
360
|
-
* shared key, so by default every form shares one set of preferences; pass a
|
|
361
|
-
* distinct key to isolate a screen or form.
|
|
362
|
-
*/
|
|
363
|
-
preferencesStorageKey?: string;
|
|
364
|
-
}
|
|
365
193
|
//# sourceMappingURL=json-schema-form-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-types.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"json-schema-form-types.d.ts","sourceRoot":"","sources":["../../src/components/json-schema-form-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,mBAAmB,kCAAkC,CAAC;AAKtD,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,QAAQ,CAAC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,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,QAAQ,CAAC,EAAE,aAAa,CAAC;IAGzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,gBAAgB,CAAC;IAG3E,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACtD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,aAAa,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB"}
|
|
@@ -70,12 +70,6 @@ function keyPickerOptions(options, usedKeys, currentKey) {
|
|
|
70
70
|
const taken = new Set(usedKeys.filter((k) => k !== currentKey));
|
|
71
71
|
return options.filter((o) => !taken.has(o.value));
|
|
72
72
|
}
|
|
73
|
-
function matchesFieldFilter(key, prop, filter) {
|
|
74
|
-
const query = filter.trim().toLowerCase();
|
|
75
|
-
if (!query) return true;
|
|
76
|
-
const label = typeof prop.title === "string" && prop.title ? prop.title : key;
|
|
77
|
-
return key.toLowerCase().includes(query) || label.toLowerCase().includes(query);
|
|
78
|
-
}
|
|
79
73
|
function orderByXOrder(entries, order) {
|
|
80
74
|
if (!Array.isArray(order) || order.length === 0) return entries;
|
|
81
75
|
const rank = new Map(
|
|
@@ -100,8 +94,8 @@ function orderRequiredFirst(entries, required) {
|
|
|
100
94
|
}
|
|
101
95
|
function isEmptyValue(value) {
|
|
102
96
|
if (value === void 0 || value === null || value === "") return true;
|
|
103
|
-
if (Array.isArray(value)) return value.
|
|
104
|
-
if (typeof value === "object") return Object.
|
|
97
|
+
if (Array.isArray(value)) return value.every(isEmptyValue);
|
|
98
|
+
if (typeof value === "object") return Object.values(value).every(isEmptyValue);
|
|
105
99
|
return false;
|
|
106
100
|
}
|
|
107
101
|
function orderByPriority(entries, required, values) {
|
|
@@ -122,6 +116,12 @@ function softError(field) {
|
|
|
122
116
|
}
|
|
123
117
|
return void 0;
|
|
124
118
|
}
|
|
119
|
+
function canAddItem(field, count) {
|
|
120
|
+
return field.maxItems === void 0 || count < field.maxItems;
|
|
121
|
+
}
|
|
122
|
+
function canRemoveItem(field, count) {
|
|
123
|
+
return field.minItems === void 0 || count > field.minItems;
|
|
124
|
+
}
|
|
125
125
|
function seedFromSchema(schema) {
|
|
126
126
|
if (schema.default !== void 0) return schema.default;
|
|
127
127
|
const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
|
|
@@ -131,6 +131,8 @@ function seedFromSchema(schema) {
|
|
|
131
131
|
return "";
|
|
132
132
|
}
|
|
133
133
|
exports.DEFAULT_COLUMN_MIN_WIDTH = DEFAULT_COLUMN_MIN_WIDTH;
|
|
134
|
+
exports.canAddItem = canAddItem;
|
|
135
|
+
exports.canRemoveItem = canRemoveItem;
|
|
134
136
|
exports.comboboxAriaProps = comboboxAriaProps;
|
|
135
137
|
exports.cssLength = cssLength;
|
|
136
138
|
exports.defaultPlaceholder = defaultPlaceholder;
|
|
@@ -141,7 +143,6 @@ exports.hasObjectItemProperties = hasObjectItemProperties;
|
|
|
141
143
|
exports.inputClass = inputClass;
|
|
142
144
|
exports.isEmptyValue = isEmptyValue;
|
|
143
145
|
exports.keyPickerOptions = keyPickerOptions;
|
|
144
|
-
exports.matchesFieldFilter = matchesFieldFilter;
|
|
145
146
|
exports.normalizeColSpan = normalizeColSpan;
|
|
146
147
|
exports.normalizeColumns = normalizeColumns;
|
|
147
148
|
exports.orderByClickyOrder = orderByClickyOrder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-form-utils.cjs","sources":["../../src/components/json-schema-form-utils.ts"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { inputSizeClass, type FormSize } from \"./json-schema-form-size\";\nimport type {\n FieldControl,\n FieldOption,\n GridColumns,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// Non-size styling shared by every text-like input box; the size token supplies\n// height, horizontal padding, and text size (see inputSizeClass).\nconst INPUT_BASE =\n \"w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n\nexport function inputClass(size: FormSize): string {\n return cn(INPUT_BASE, inputSizeClass[size]);\n}\n\n// encodeIdPart escapes one path token (or the id prefix) injectively: every\n// character outside [A-Za-z0-9] becomes `_<hex char code>_`, and the empty token\n// — a legal JSON Schema property name — becomes a lone `_`. The escape is\n// self-delimiting (it always starts and ends with `_`, and a literal `_` escapes\n// to `_5f_`), so distinct tokens can never share an encoding and `-` stays free\n// as a segment separator. Percent-encoding was rejected because `%` in an id,\n// while legal HTML, has to be escaped again inside a `#id` CSS selector; this\n// alphabet ([A-Za-z0-9_-]) is safe as-is for `document.querySelector`.\nfunction encodeIdPart(value: string): string {\n if (value === \"\") return \"_\";\n return value.replace(/[^A-Za-z0-9]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n// fieldInputId derives a control's DOM id from its JSON-pointer instance path,\n// not from its leaf key: a schema that repeats a property name under two parents\n// (e.g. /journalLine1/asset and /journalLine2/asset) must not produce the same\n// id, or every `label[for]` binds to the first control. Each decoded pointer\n// token is escaped with encodeIdPart and joined with \"-\", so distinct paths\n// always produce distinct ids: \"/asset-class\", \"/asset_class\", \"/asset.class\"\n// and \"/asset/class\" are four different ids, and an empty token is preserved\n// (\"/a//b\" ≠ \"/a/b\"). The prefix is escaped the same way, so prefix \"a\" + \"/b-c\"\n// cannot collide with prefix \"a-b\" + \"/c\".\nexport function fieldInputId(instancePath: string, prefix?: string): string {\n const tokens = instancePath === \"\" ? [] : instancePath.replace(/^\\//, \"\").split(\"/\");\n const safe = tokens\n .map((token) => encodeIdPart(token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\")))\n .join(\"-\");\n return prefix ? `jsf-${encodeIdPart(prefix)}-${safe}` : `jsf-${safe}`;\n}\n\n// fieldErrorId names the element that holds a field's validation messages, so a\n// control can point at it with aria-describedby.\nexport function fieldErrorId(fieldId: string): string {\n return `${fieldId}-error`;\n}\n\n// fieldAriaProps is the assistive-technology half of a control: the visual `*`\n// and red message mean nothing to a screen reader on their own, so every\n// editable control spreads these onto its input element.\nexport function fieldAriaProps(\n field: FieldControl,\n fieldId: string,\n): {\n \"aria-required\"?: true;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n} {\n return {\n ...(field.required ? { \"aria-required\": true as const } : {}),\n ...(field.invalid ? { \"aria-invalid\": true as const, \"aria-describedby\": fieldErrorId(fieldId) } : {}),\n };\n}\n\n// comboboxAriaProps is the fieldAriaProps equivalent for Combobox, which takes\n// the same state as named props rather than raw aria-* attributes.\nexport function comboboxAriaProps(\n field: FieldControl,\n fieldId: string,\n): { ariaRequired?: true; invalid?: true; describedBy?: string } {\n return {\n ...(field.required ? { ariaRequired: true as const } : {}),\n ...(field.invalid ? { invalid: true as const, describedBy: fieldErrorId(fieldId) } : {}),\n };\n}\n\nexport function defaultPlaceholder(schema: JsonSchemaProperty): string {\n if (schema.default != null && typeof schema.default !== \"object\") return String(schema.default);\n return \"\";\n}\n\nexport function toText(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\") return \"\";\n return String(value);\n}\n\n// toStringArray normalises the committed value of a multi-value control. The\n// schema types it as an array of strings, but a form mid-edit can hold anything,\n// so a non-string entry is dropped rather than rendered as a broken tag.\nexport function toStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n return value.filter((entry): entry is string => typeof entry === \"string\");\n}\n\n// hasObjectItemProperties reports whether an array's items are objects with a\n// fixed `properties` set — the precondition for both the column-per-property\n// table and the summary-row accordion, which need to know the item's shape.\nexport function hasObjectItemProperties(\n items: JsonSchemaProperty | undefined,\n): boolean {\n return (\n !!items && !!items.properties && Object.keys(items.properties).length > 0\n );\n}\n\n// Object-level `x-columns`: how many equal columns to split a stacked object\n// into. \"auto\" fits as many as the width allows. A number is clamped to [1, 12]\n// (a standard 12-track grid, so a 3-across row of span-4 fields and a 4-across\n// row of span-3 fields share one object); anything invalid is a single column.\nexport function normalizeColumns(value: unknown): GridColumns {\n if (value === \"auto\") return \"auto\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), 12);\n}\n\n// Per-field `x-col-span`: how many of the object's columns a field occupies.\n// \"full\" spans the whole row. Under `x-columns: \"auto\"` a numeric span cannot be\n// clamped against a track count that only exists at layout time, so it is capped\n// at the 12-track maximum instead. Invalid falls back to 1.\nexport function normalizeColSpan(\n value: unknown,\n columns: GridColumns,\n): number | \"full\" {\n if (value === \"full\") return \"full\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), columns === \"auto\" ? 12 : columns);\n}\n\n// The `x-columns: \"auto\"` column floor: wide enough for a labelled control to\n// stay readable, narrow enough that a 1440px pane gets three columns, not two.\nexport const DEFAULT_COLUMN_MIN_WIDTH = \"15rem\";\n\n// cssLength guards a schema-supplied CSS length before it reaches an inline\n// style. Non-strings (and the empty string) fall back rather than emitting a\n// declaration the browser will drop.\nexport function cssLength(value: unknown, fallback: string): string {\n return typeof value === \"string\" && value.trim() ? value.trim() : fallback;\n}\n\n// withSyntheticValue prepends the current value as an option when it is not in\n// the enum, so an out-of-enum value (e.g. a template token) still displays.\nexport function withSyntheticValue(options: FieldOption[], value: string): FieldOption[] {\n if (!value || options.some((o) => o.value === value)) return options;\n return [{ value, label: value }, ...options];\n}\n\n// keyPickerOptions narrows the map-key enum to keys not already used by another\n// entry, while always keeping this row's current key so it stays selectable.\nexport function keyPickerOptions(\n options: FieldOption[],\n usedKeys: string[],\n currentKey: string,\n): FieldOption[] {\n const taken = new Set(usedKeys.filter((k) => k !== currentKey));\n return options.filter((o) => !taken.has(o.value));\n}\n\n// matchesFieldFilter reports whether a property should stay visible under the\n// display-options field filter: a case-insensitive substring match against the\n// field's key and its display label (`title` when set, otherwise the key). A\n// blank filter matches everything, so an empty box never hides fields.\nexport function matchesFieldFilter(\n key: string,\n prop: JsonSchemaProperty,\n filter: string,\n): boolean {\n const query = filter.trim().toLowerCase();\n if (!query) return true;\n const label = typeof prop.title === \"string\" && prop.title ? prop.title : key;\n return key.toLowerCase().includes(query) || label.toLowerCase().includes(query);\n}\n\n// orderByXOrder reorders property entries by the schema's `x-order` hint: keys\n// named there render first (in that order), the rest keep document order. A\n// missing/empty hint is a no-op, so document order remains the default.\nexport function orderByXOrder<T>(entries: [string, T][], order: unknown): [string, T][] {\n if (!Array.isArray(order) || order.length === 0) return entries;\n const rank = new Map(\n order.filter((k): k is string => typeof k === \"string\").map((k, i) => [k, i]),\n );\n const listed = entries\n .filter(([key]) => rank.has(key))\n .sort((a, b) => rank.get(a[0])! - rank.get(b[0])!);\n const rest = entries.filter(([key]) => !rank.has(key));\n return [...listed, ...rest];\n}\n\n// orderByClickyOrder stably sorts property entries by each property's numeric\n// `x-clicky-order` (lower first); entries without it keep their incoming order\n// after the ordered ones. An explicit index tie-break keeps it stable regardless\n// of the engine's sort stability. Unlike the object-level `x-order` array, this\n// composes across merged if/then branches because each property carries its own\n// order — the right tool when fields come from different (embedded) sources.\nexport function orderByClickyOrder(\n entries: [string, JsonSchemaProperty][],\n): [string, JsonSchemaProperty][] {\n const rank = (prop: JsonSchemaProperty): number => {\n const o = prop[\"x-clicky-order\"];\n return typeof o === \"number\" ? o : Number.POSITIVE_INFINITY;\n };\n return entries\n .map((entry, index) => ({ entry, index, rank: rank(entry[1]) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// orderRequiredFirst stably partitions property entries so the keys named in\n// `required` come first (in their original order), then the rest (in theirs).\n// A stable two-pass partition, so it never reshuffles within either group.\nexport function orderRequiredFirst<T>(\n entries: [string, T][],\n required: string[],\n): [string, T][] {\n const isRequired = new Set(required);\n const head = entries.filter(([key]) => isRequired.has(key));\n const tail = entries.filter(([key]) => !isRequired.has(key));\n return [...head, ...tail];\n}\n\n// isEmptyValue reports whether a field's value carries no data, so priority\n// sorting can sink unfilled fields. Empty = undefined/null/\"\" plus empty arrays\n// and empty plain objects; `false` and `0` count as filled (they are choices).\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null || value === \"\") return true;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n}\n\n// orderByPriority sorts property entries so the fields that matter most surface\n// first, ranking each by a score: +2 if required, +1 if its value is non-empty.\n// Required-and-filled lead, then required-and-empty, then optional-and-filled,\n// then optional-and-empty. Ties keep their incoming order (explicit index\n// tie-break, so it does not depend on the engine's sort stability).\nexport function orderByPriority<T>(\n entries: [string, T][],\n required: string[],\n values: Record<string, unknown>,\n): [string, T][] {\n const isRequired = new Set(required);\n const score = (key: string): number =>\n (isRequired.has(key) ? 2 : 0) + (isEmptyValue(values[key]) ? 0 : 1);\n return entries\n .map((entry, index) => ({ entry, index, score: score(entry[0]) }))\n .sort((a, b) => b.score - a.score || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// softError computes a display-only validation hint. It never blocks onChange.\n// Consumers suppress the unknown-enum hint by setting allowCustomValue.\nexport function softError(field: FieldControl): string | undefined {\n const v = field.value;\n const isEmpty = v === undefined || v === null || v === \"\";\n if (field.required && isEmpty) return \"Required\";\n\n if (field.kind === \"number\" && typeof field.minimum === \"number\" && typeof v === \"number\") {\n if (v < field.minimum) return `Must be ≥ ${field.minimum}`;\n }\n\n if (field.kind === \"enum\" && !field.allowCustomValue && !isEmpty) {\n const known = (field.options ?? []).some((o) => o.value === String(v));\n if (!known) return \"Unknown value (allowed)\";\n }\n return undefined;\n}\n\n// seedFromSchema produces the initial value for a freshly-added array item or\n// object field, honouring an explicit default.\nexport function seedFromSchema(schema: JsonSchemaProperty): unknown {\n if (schema.default !== undefined) return schema.default;\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n if (type === \"array\") return [];\n if (type === \"object\") return {};\n if (type === \"boolean\") return false;\n // Numbers seed as \"\" so the soft Required hint can show without coercion\n // surprises; the number control coerces on first real input.\n return \"\";\n}\n"],"names":["cn","inputSizeClass"],"mappings":";;;;AAWA,MAAM,aACJ;AAEK,SAAS,WAAW,MAAwB;AACjD,SAAOA,SAAG,YAAYC,mBAAAA,eAAe,IAAI,CAAC;AAC5C;AAUA,SAAS,aAAa,OAAuB;AAC3C,MAAI,UAAU,GAAI,QAAO;AACzB,SAAO,MAAM,QAAQ,iBAAiB,CAAC,SAAS,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG;AACxF;AAWO,SAAS,aAAa,cAAsB,QAAyB;AAC1E,QAAM,SAAS,iBAAiB,KAAK,KAAK,aAAa,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG;AACnF,QAAM,OAAO,OACV,IAAI,CAAC,UAAU,aAAa,MAAM,WAAW,MAAM,GAAG,EAAE,WAAW,MAAM,GAAG,CAAC,CAAC,EAC9E,KAAK,GAAG;AACX,SAAO,SAAS,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,KAAK,OAAO,IAAI;AACrE;AAIO,SAAS,aAAa,SAAyB;AACpD,SAAO,GAAG,OAAO;AACnB;AAKO,SAAS,eACd,OACA,SAKA;AACA,SAAO;AAAA,IACL,GAAI,MAAM,WAAW,EAAE,iBAAiB,KAAA,IAAkB,CAAA;AAAA,IAC1D,GAAI,MAAM,UAAU,EAAE,gBAAgB,MAAe,oBAAoB,aAAa,OAAO,MAAM,CAAA;AAAA,EAAC;AAExG;AAIO,SAAS,kB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E,QAAQ,EAAE,KAAK,EACrD,IAAI,CAAC,WAAW,OAAO,KAAK;AACjC;AAIO,SAAS,UAAU,OAAyC;AACjE,QAAM,IAAI,MAAM;AAChB,QAAM,UAAU,MAAM,UAAa,MAAM,QAAQ,MAAM;AACvD,MAAI,MAAM,YAAY,QAAS,QAAO;AAEtC,MAAI,MAAM,SAAS,YAAY,OAAO,MAAM,YAAY,YAAY,OAAO,MAAM,UAAU;AACzF,QAAI,IAAI,MAAM,QAAS,QAAO,aAAa,MAAM,OAAO;AAAA,EAC1D;AAEA,MAAI,MAAM,SAAS,UAAU,CAAC,MAAM,oBAAoB,CAAC,SAAS;AAChE,UAAM,SAAS,MAAM,WAAW,CAAA,GAAI,KAAK,CAAC,MAAM,EAAE,UAAU,OAAO,CAAC,CAAC;AACrE,QAAI,CAAC,MAAO,QAAO;AAAA,EACrB;AACA,SAAO;AACT;AAIO,SAAS,eAAe,QAAqC;AAClE,MAAI,OAAO,YAAY,OAAW,QAAO,OAAO;AAChD,QAAM,OAAO,MAAM,QAAQ,OAAO,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO;AAClE,MAAI,SAAS,QAAS,QAAO,CAAA;AAC7B,MAAI,SAAS,SAAU,QAAO,CAAA;AAC9B,MAAI,SAAS,UAAW,QAAO;AAG/B,SAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"json-schema-form-utils.cjs","sources":["../../src/components/json-schema-form-utils.ts"],"sourcesContent":["import { cn } from \"../lib/utils\";\nimport { inputSizeClass, type FormSize } from \"./json-schema-form-size\";\nimport type {\n FieldControl,\n FieldOption,\n GridColumns,\n JsonSchemaProperty,\n} from \"./json-schema-form-types\";\n\n// Non-size styling shared by every text-like input box; the size token supplies\n// height, horizontal padding, and text size (see inputSizeClass).\nconst INPUT_BASE =\n \"w-full min-w-0 rounded-md border border-input bg-background text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n\nexport function inputClass(size: FormSize): string {\n return cn(INPUT_BASE, inputSizeClass[size]);\n}\n\n// encodeIdPart escapes one path token (or the id prefix) injectively: every\n// character outside [A-Za-z0-9] becomes `_<hex char code>_`, and the empty token\n// — a legal JSON Schema property name — becomes a lone `_`. The escape is\n// self-delimiting (it always starts and ends with `_`, and a literal `_` escapes\n// to `_5f_`), so distinct tokens can never share an encoding and `-` stays free\n// as a segment separator. Percent-encoding was rejected because `%` in an id,\n// while legal HTML, has to be escaped again inside a `#id` CSS selector; this\n// alphabet ([A-Za-z0-9_-]) is safe as-is for `document.querySelector`.\nfunction encodeIdPart(value: string): string {\n if (value === \"\") return \"_\";\n return value.replace(/[^A-Za-z0-9]/g, (char) => `_${char.charCodeAt(0).toString(16)}_`);\n}\n\n// fieldInputId derives a control's DOM id from its JSON-pointer instance path,\n// not from its leaf key: a schema that repeats a property name under two parents\n// (e.g. /journalLine1/asset and /journalLine2/asset) must not produce the same\n// id, or every `label[for]` binds to the first control. Each decoded pointer\n// token is escaped with encodeIdPart and joined with \"-\", so distinct paths\n// always produce distinct ids: \"/asset-class\", \"/asset_class\", \"/asset.class\"\n// and \"/asset/class\" are four different ids, and an empty token is preserved\n// (\"/a//b\" ≠ \"/a/b\"). The prefix is escaped the same way, so prefix \"a\" + \"/b-c\"\n// cannot collide with prefix \"a-b\" + \"/c\".\nexport function fieldInputId(instancePath: string, prefix?: string): string {\n const tokens = instancePath === \"\" ? [] : instancePath.replace(/^\\//, \"\").split(\"/\");\n const safe = tokens\n .map((token) => encodeIdPart(token.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\")))\n .join(\"-\");\n return prefix ? `jsf-${encodeIdPart(prefix)}-${safe}` : `jsf-${safe}`;\n}\n\n// fieldErrorId names the element that holds a field's validation messages, so a\n// control can point at it with aria-describedby.\nexport function fieldErrorId(fieldId: string): string {\n return `${fieldId}-error`;\n}\n\n// fieldAriaProps is the assistive-technology half of a control: the visual `*`\n// and red message mean nothing to a screen reader on their own, so every\n// editable control spreads these onto its input element.\nexport function fieldAriaProps(\n field: FieldControl,\n fieldId: string,\n): {\n \"aria-required\"?: true;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n} {\n return {\n ...(field.required ? { \"aria-required\": true as const } : {}),\n ...(field.invalid ? { \"aria-invalid\": true as const, \"aria-describedby\": fieldErrorId(fieldId) } : {}),\n };\n}\n\n// comboboxAriaProps is the fieldAriaProps equivalent for Combobox, which takes\n// the same state as named props rather than raw aria-* attributes.\nexport function comboboxAriaProps(\n field: FieldControl,\n fieldId: string,\n): { ariaRequired?: true; invalid?: true; describedBy?: string } {\n return {\n ...(field.required ? { ariaRequired: true as const } : {}),\n ...(field.invalid ? { invalid: true as const, describedBy: fieldErrorId(fieldId) } : {}),\n };\n}\n\nexport function defaultPlaceholder(schema: JsonSchemaProperty): string {\n if (schema.default != null && typeof schema.default !== \"object\") return String(schema.default);\n return \"\";\n}\n\nexport function toText(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\") return \"\";\n return String(value);\n}\n\n// toStringArray normalises the committed value of a multi-value control. The\n// schema types it as an array of strings, but a form mid-edit can hold anything,\n// so a non-string entry is dropped rather than rendered as a broken tag.\nexport function toStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n return value.filter((entry): entry is string => typeof entry === \"string\");\n}\n\n// hasObjectItemProperties reports whether an array's items are objects with a\n// fixed `properties` set — the precondition for both the column-per-property\n// table and the summary-row accordion, which need to know the item's shape.\nexport function hasObjectItemProperties(\n items: JsonSchemaProperty | undefined,\n): boolean {\n return (\n !!items && !!items.properties && Object.keys(items.properties).length > 0\n );\n}\n\n// Object-level `x-columns`: how many equal columns to split a stacked object\n// into. \"auto\" fits as many as the width allows. A number is clamped to [1, 12]\n// (a standard 12-track grid, so a 3-across row of span-4 fields and a 4-across\n// row of span-3 fields share one object); anything invalid is a single column.\nexport function normalizeColumns(value: unknown): GridColumns {\n if (value === \"auto\") return \"auto\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), 12);\n}\n\n// Per-field `x-col-span`: how many of the object's columns a field occupies.\n// \"full\" spans the whole row. Under `x-columns: \"auto\"` a numeric span cannot be\n// clamped against a track count that only exists at layout time, so it is capped\n// at the 12-track maximum instead. Invalid falls back to 1.\nexport function normalizeColSpan(\n value: unknown,\n columns: GridColumns,\n): number | \"full\" {\n if (value === \"full\") return \"full\";\n const n = typeof value === \"number\" ? value : Number(value);\n if (!Number.isFinite(n) || n < 1) return 1;\n return Math.min(Math.trunc(n), columns === \"auto\" ? 12 : columns);\n}\n\n// The `x-columns: \"auto\"` column floor: wide enough for a labelled control to\n// stay readable, narrow enough that a 1440px pane gets three columns, not two.\nexport const DEFAULT_COLUMN_MIN_WIDTH = \"15rem\";\n\n// cssLength guards a schema-supplied CSS length before it reaches an inline\n// style. Non-strings (and the empty string) fall back rather than emitting a\n// declaration the browser will drop.\nexport function cssLength(value: unknown, fallback: string): string {\n return typeof value === \"string\" && value.trim() ? value.trim() : fallback;\n}\n\n// withSyntheticValue prepends the current value as an option when it is not in\n// the enum, so an out-of-enum value (e.g. a template token) still displays.\nexport function withSyntheticValue(options: FieldOption[], value: string): FieldOption[] {\n if (!value || options.some((o) => o.value === value)) return options;\n return [{ value, label: value }, ...options];\n}\n\n// keyPickerOptions narrows the map-key enum to keys not already used by another\n// entry, while always keeping this row's current key so it stays selectable.\nexport function keyPickerOptions(\n options: FieldOption[],\n usedKeys: string[],\n currentKey: string,\n): FieldOption[] {\n const taken = new Set(usedKeys.filter((k) => k !== currentKey));\n return options.filter((o) => !taken.has(o.value));\n}\n\n// orderByXOrder reorders property entries by the schema's `x-order` hint: keys\n// named there render first (in that order), the rest keep document order. A\n// missing/empty hint is a no-op, so document order remains the default.\nexport function orderByXOrder<T>(entries: [string, T][], order: unknown): [string, T][] {\n if (!Array.isArray(order) || order.length === 0) return entries;\n const rank = new Map(\n order.filter((k): k is string => typeof k === \"string\").map((k, i) => [k, i]),\n );\n const listed = entries\n .filter(([key]) => rank.has(key))\n .sort((a, b) => rank.get(a[0])! - rank.get(b[0])!);\n const rest = entries.filter(([key]) => !rank.has(key));\n return [...listed, ...rest];\n}\n\n// orderByClickyOrder stably sorts property entries by each property's numeric\n// `x-clicky-order` (lower first); entries without it keep their incoming order\n// after the ordered ones. An explicit index tie-break keeps it stable regardless\n// of the engine's sort stability. Unlike the object-level `x-order` array, this\n// composes across merged if/then branches because each property carries its own\n// order — the right tool when fields come from different (embedded) sources.\nexport function orderByClickyOrder(\n entries: [string, JsonSchemaProperty][],\n): [string, JsonSchemaProperty][] {\n const rank = (prop: JsonSchemaProperty): number => {\n const o = prop[\"x-clicky-order\"];\n return typeof o === \"number\" ? o : Number.POSITIVE_INFINITY;\n };\n return entries\n .map((entry, index) => ({ entry, index, rank: rank(entry[1]) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// orderRequiredFirst stably partitions property entries so the keys named in\n// `required` come first (in their original order), then the rest (in theirs).\n// A stable two-pass partition, so it never reshuffles within either group.\nexport function orderRequiredFirst<T>(\n entries: [string, T][],\n required: string[],\n): [string, T][] {\n const isRequired = new Set(required);\n const head = entries.filter(([key]) => isRequired.has(key));\n const tail = entries.filter(([key]) => !isRequired.has(key));\n return [...head, ...tail];\n}\n\n// isEmptyValue reports whether a field's value carries no data, so priority\n// sorting can sink unfilled fields and `hideEmpty` can drop them. Empty =\n// undefined/null/\"\" plus empty arrays and objects; `false` and `0` count as\n// filled (they are choices).\n//\n// An object is empty when everything inside it is, not merely when it has no\n// keys: a section whose every field is blank carries no more data than a missing\n// one, and rendering it as a titled, empty block says otherwise.\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null || value === \"\") return true;\n if (Array.isArray(value)) return value.every(isEmptyValue);\n if (typeof value === \"object\") return Object.values(value).every(isEmptyValue);\n return false;\n}\n\n// orderByPriority sorts property entries so the fields that matter most surface\n// first, ranking each by a score: +2 if required, +1 if its value is non-empty.\n// Required-and-filled lead, then required-and-empty, then optional-and-filled,\n// then optional-and-empty. Ties keep their incoming order (explicit index\n// tie-break, so it does not depend on the engine's sort stability).\nexport function orderByPriority<T>(\n entries: [string, T][],\n required: string[],\n values: Record<string, unknown>,\n): [string, T][] {\n const isRequired = new Set(required);\n const score = (key: string): number =>\n (isRequired.has(key) ? 2 : 0) + (isEmptyValue(values[key]) ? 0 : 1);\n return entries\n .map((entry, index) => ({ entry, index, score: score(entry[0]) }))\n .sort((a, b) => b.score - a.score || a.index - b.index)\n .map((ranked) => ranked.entry);\n}\n\n// softError computes a display-only validation hint. It never blocks onChange.\n// Consumers suppress the unknown-enum hint by setting allowCustomValue.\nexport function softError(field: FieldControl): string | undefined {\n const v = field.value;\n const isEmpty = v === undefined || v === null || v === \"\";\n if (field.required && isEmpty) return \"Required\";\n\n if (field.kind === \"number\" && typeof field.minimum === \"number\" && typeof v === \"number\") {\n if (v < field.minimum) return `Must be ≥ ${field.minimum}`;\n }\n\n if (field.kind === \"enum\" && !field.allowCustomValue && !isEmpty) {\n const known = (field.options ?? []).some((o) => o.value === String(v));\n if (!known) return \"Unknown value (allowed)\";\n }\n return undefined;\n}\n\n/**\n * canAddItem / canRemoveItem read the array's maxItems/minItems bounds.\n *\n * The bounds gate the controls rather than validate the value: an array already\n * at or past a bound offers no way to make it worse, but one that arrives\n * outside its bounds is never trapped — removal stays available above minItems\n * whatever the schema says, and an array the producer owns end to end simply\n * declares min === max and offers neither.\n */\nexport function canAddItem(field: FieldControl, count: number): boolean {\n return field.maxItems === undefined || count < field.maxItems;\n}\n\nexport function canRemoveItem(field: FieldControl, count: number): boolean {\n return field.minItems === undefined || count > field.minItems;\n}\n\n// seedFromSchema produces the initial value for a freshly-added array item or\n// object field, honouring an explicit default.\nexport function seedFromSchema(schema: JsonSchemaProperty): unknown {\n if (schema.default !== undefined) return schema.default;\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n if (type === \"array\") return [];\n if (type === \"object\") return {};\n if (type === \"boolean\") return false;\n // Numbers seed as \"\" so the soft Required hint can show without coercion\n // surprises; the number control coerces on first real input.\n return \"\";\n}\n"],"names":["cn","inputSizeClass"],"mappings":";;;;AAWA,MAAM,aACJ;AAEK,SAAS,WAAW,MAAwB;AACjD,SAAOA,SAAG,YAAYC,mBAAAA,eAAe,IAAI,CAAC;AAC5C;AAUA,SAAS,aAAa,OAAuB;AAC3C,MAAI,UAAU,GAAI,QAAO;AACzB,SAAO,MAAM,QAAQ,iBAAiB,CAAC,SAAS,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG;AACxF;AAWO,SAAS,aAAa,cAAsB,QAAyB;AAC1E,QAAM,SAAS,iBAAiB,KAAK,KAAK,aAAa,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG;AACnF,QAAM,OAAO,OACV,IAAI,CAAC,UAAU,aAAa,MAAM,WAAW,MAAM,GAAG,EAAE,WAAW,MAAM,GAAG,CAAC,CAAC,EAC9E,KAAK,GAAG;AACX,SAAO,SAAS,OAAO,aAAa,MAAM,CAAC,IAAI,IAAI,KAAK,OAAO,IAAI;AACrE;AAIO,SAAS,aAAa,SAAyB;AACpD,SAAO,GAAG,OAAO;AACnB;AAKO,SAAS,eACd,OACA,SAKA;AACA,SAAO;AAAA,IACL,GAAI,MAAM,WAAW,EAAE,iBAAiB,KAAA,IAAkB,CAAA;AAAA,IAC1D,GAAI,MAAM,UAAU,EAAE,gBAAgB,MAAe,oBAAoB,aAAa,OAAO,MAAM,CAAA;AAAA,EAAC;AAExG;AAIO,SAAS,kBACd,OACA,SAC+D;AAC/D,SAAO;AAAA,IACL,GAAI,MAAM,WAAW,EAAE,cAAc,KAAA,IAAkB,CAAA;AAAA,IACvD,GAAI,MAAM,UAAU,EAAE,SAAS,MAAe,aAAa,aAAa,OAAO,MAAM,CAAA;AAAA,EAAC;AAE1F;AAEO,S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