@chobantonov/jsonforms-react-shadcn-renderers 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +157 -2
- package/lib/additional/LabelRenderer.d.ts +4 -0
- package/lib/additional/index.d.ts +1 -0
- package/lib/cells/BooleanCell.d.ts +3 -0
- package/lib/cells/Cell.d.ts +3 -0
- package/lib/cells/CompositeCell.d.ts +9 -0
- package/lib/cells/CompositeDetailDialog.d.ts +3 -0
- package/lib/cells/EnumCell.d.ts +3 -0
- package/lib/cells/NumberCell.d.ts +3 -0
- package/lib/cells/NumberFormatCell.d.ts +4 -0
- package/lib/cells/TextCell.d.ts +3 -0
- package/lib/cells/asCell.d.ts +12 -0
- package/lib/cells/index.d.ts +7 -0
- package/lib/complex/AdditionalProperties.d.ts +4 -0
- package/lib/complex/AnyOfRenderer.d.ts +7 -0
- package/lib/complex/ArrayChoicesControl.d.ts +6 -0
- package/lib/complex/ArrayControlRenderer.d.ts +4 -0
- package/lib/complex/ArrayPanelToggle.d.ts +6 -0
- package/lib/complex/CollectionPager.d.ts +5 -0
- package/lib/complex/CombinatorSwitchDialog.d.ts +8 -0
- package/lib/complex/DeleteDialog.d.ts +6 -0
- package/lib/complex/DetailDialogContent.d.ts +7 -0
- package/lib/complex/ErrorIndicator.d.ts +7 -0
- package/lib/complex/MixedRenderer.d.ts +6 -0
- package/lib/complex/ObjectRenderer.d.ts +3 -0
- package/lib/complex/OneOfRenderer.d.ts +5 -0
- package/lib/complex/RecursiveTreeRenderer.d.ts +4 -0
- package/lib/complex/RowDetailFrame.d.ts +16 -0
- package/lib/complex/ScalarCompositionRenderer.d.ts +4 -0
- package/lib/complex/TupleAdditionalItems.d.ts +4 -0
- package/lib/complex/TupleControlRenderer.d.ts +6 -0
- package/lib/complex/TupleField.d.ts +4 -0
- package/lib/complex/array/ArrayItemPanels.d.ts +18 -0
- package/lib/complex/array/ArrayItemViewProps.d.ts +11 -0
- package/lib/complex/array/ArrayListDetail.d.ts +9 -0
- package/lib/complex/array/ArrayTable.d.ts +21 -0
- package/lib/complex/index.d.ts +10 -0
- package/lib/complex/mixed/JsonTypeIcon.d.ts +5 -0
- package/lib/complex/mixed/MixedWidgets.d.ts +22 -0
- package/lib/complex/mixed/useConfirmation.d.ts +6 -0
- package/lib/components/ClearValueButton.d.ts +12 -0
- package/lib/components/ScrollRegion.d.ts +4 -0
- package/lib/components/TimePicker.d.ts +13 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/controls/AnyOfStringOrEnumControl.d.ts +4 -0
- package/lib/controls/BooleanControl.d.ts +4 -0
- package/lib/controls/BooleanToggleControl.d.ts +4 -0
- package/lib/controls/ChoiceCards.d.ts +1 -0
- package/lib/controls/DateControl.d.ts +4 -0
- package/lib/controls/DateTimeControl.d.ts +4 -0
- package/lib/controls/EnumControl.d.ts +5 -0
- package/lib/controls/InputControl.d.ts +30 -0
- package/lib/controls/IntegerControl.d.ts +4 -0
- package/lib/controls/NumberControl.d.ts +4 -0
- package/lib/controls/OneOfEnumControl.d.ts +3 -0
- package/lib/controls/PasswordControl.d.ts +9 -0
- package/lib/controls/RadioGroupControl.d.ts +4 -0
- package/lib/controls/SliderControl.d.ts +4 -0
- package/lib/controls/TextControl.d.ts +4 -0
- package/lib/controls/TimeControl.d.ts +4 -0
- package/lib/controls/index.d.ts +15 -0
- package/lib/index.d.ts +6 -0
- package/lib/jsonforms-react-shadcn.cjs.js +3 -0
- package/lib/jsonforms-react-shadcn.cjs.js.map +1 -0
- package/lib/jsonforms-react-shadcn.esm.js +4040 -0
- package/lib/jsonforms-react-shadcn.esm.js.map +1 -0
- package/lib/layouts/CategorizationLayout.d.ts +7 -0
- package/lib/layouts/GroupLayout.d.ts +4 -0
- package/lib/layouts/HorizontalLayout.d.ts +4 -0
- package/lib/layouts/Layout.d.ts +5 -0
- package/lib/layouts/ValidationIndicator.d.ts +4 -0
- package/lib/layouts/VerticalLayout.d.ts +4 -0
- package/lib/layouts/index.d.ts +4 -0
- package/lib/renderers.d.ts +8 -0
- package/lib/util/dateTime.d.ts +12 -0
- package/lib/util/groupState.d.ts +1 -0
- package/lib/util/useTemporalControl.d.ts +28 -0
- package/package.json +86 -3
- package/src/additional/LabelRenderer.tsx +8 -0
- package/src/additional/index.ts +1 -0
- package/src/cells/BooleanCell.tsx +26 -0
- package/src/cells/Cell.tsx +101 -0
- package/src/cells/CompositeCell.tsx +275 -0
- package/src/cells/CompositeDetailDialog.tsx +79 -0
- package/src/cells/EnumCell.tsx +74 -0
- package/src/cells/NumberCell.tsx +51 -0
- package/src/cells/NumberFormatCell.tsx +47 -0
- package/src/cells/TextCell.tsx +40 -0
- package/src/cells/asCell.tsx +79 -0
- package/src/cells/index.ts +7 -0
- package/src/complex/AdditionalProperties.tsx +453 -0
- package/src/complex/AnyOfRenderer.tsx +341 -0
- package/src/complex/ArrayChoicesControl.tsx +303 -0
- package/src/complex/ArrayControlRenderer.tsx +400 -0
- package/src/complex/ArrayPanelToggle.tsx +33 -0
- package/src/complex/CollectionPager.tsx +76 -0
- package/src/complex/CombinatorSwitchDialog.tsx +43 -0
- package/src/complex/DeleteDialog.tsx +41 -0
- package/src/complex/DetailDialogContent.tsx +84 -0
- package/src/complex/ErrorIndicator.tsx +136 -0
- package/src/complex/MixedRenderer.tsx +262 -0
- package/src/complex/ObjectRenderer.tsx +43 -0
- package/src/complex/OneOfRenderer.tsx +14 -0
- package/src/complex/RecursiveTreeRenderer.tsx +20 -0
- package/src/complex/RowDetailFrame.tsx +158 -0
- package/src/complex/ScalarCompositionRenderer.tsx +14 -0
- package/src/complex/TupleAdditionalItems.tsx +94 -0
- package/src/complex/TupleControlRenderer.tsx +54 -0
- package/src/complex/TupleField.tsx +41 -0
- package/src/complex/array/ArrayItemPanels.tsx +217 -0
- package/src/complex/array/ArrayItemViewProps.ts +15 -0
- package/src/complex/array/ArrayListDetail.tsx +165 -0
- package/src/complex/array/ArrayTable.tsx +535 -0
- package/src/complex/index.ts +16 -0
- package/src/complex/mixed/JsonTypeIcon.tsx +41 -0
- package/src/complex/mixed/MixedWidgets.tsx +326 -0
- package/src/complex/mixed/useConfirmation.tsx +34 -0
- package/src/components/ClearValueButton.tsx +56 -0
- package/src/components/ScrollRegion.tsx +27 -0
- package/src/components/TimePicker.tsx +250 -0
- package/src/components/index.ts +2 -0
- package/src/controls/AnyOfStringOrEnumControl.tsx +44 -0
- package/src/controls/BooleanControl.tsx +67 -0
- package/src/controls/BooleanToggleControl.tsx +58 -0
- package/src/controls/ChoiceCards.tsx +9 -0
- package/src/controls/DateControl.tsx +240 -0
- package/src/controls/DateTimeControl.tsx +187 -0
- package/src/controls/EnumControl.tsx +159 -0
- package/src/controls/InputControl.tsx +258 -0
- package/src/controls/IntegerControl.tsx +14 -0
- package/src/controls/NumberControl.tsx +14 -0
- package/src/controls/OneOfEnumControl.tsx +13 -0
- package/src/controls/PasswordControl.tsx +216 -0
- package/src/controls/RadioGroupControl.tsx +72 -0
- package/src/controls/SliderControl.tsx +77 -0
- package/src/controls/TextControl.tsx +50 -0
- package/src/controls/TimeControl.tsx +135 -0
- package/src/controls/index.ts +19 -0
- package/src/index.tsx +10 -0
- package/src/layouts/CategorizationLayout.tsx +248 -0
- package/src/layouts/GroupLayout.tsx +210 -0
- package/src/layouts/HorizontalLayout.tsx +12 -0
- package/src/layouts/Layout.tsx +62 -0
- package/src/layouts/ValidationIndicator.tsx +40 -0
- package/src/layouts/VerticalLayout.tsx +12 -0
- package/src/layouts/index.ts +4 -0
- package/src/renderers.ts +225 -0
- package/src/styles.css +482 -0
- package/src/tailwind-theme.cjs +42 -0
- package/src/theme.css +43 -0
- package/src/util/dateTime.ts +80 -0
- package/src/util/groupState.ts +5 -0
- package/src/util/useTemporalControl.ts +160 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Krasimir Chobantonov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,158 @@
|
|
|
1
|
-
#
|
|
1
|
+
# JSON Forms React shadcn/ui renderers
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This renderer set uses application-owned **React shadcn/ui components**. It does
|
|
4
|
+
not bundle generated UI components or depend on shadcn, Ant Design, or Radix UI
|
|
5
|
+
at runtime. The consuming application must define **every component used by the
|
|
6
|
+
renderer registry**, install their dependencies, and supply their CSS. This is
|
|
7
|
+
the same ownership model as the Svelte shadcn renderer.
|
|
8
|
+
|
|
9
|
+
## Install and configure
|
|
10
|
+
|
|
11
|
+
Initialize [shadcn/ui](https://ui.shadcn.com/docs/installation) in your application.
|
|
12
|
+
Use the Radix-based component APIs and install these components:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm dlx shadcn@latest add alert avatar item button calendar card checkbox collapsible dialog input popover resizable select tabs textarea tooltip switch radio-group slider
|
|
16
|
+
pnpm add @chobantonov/jsonforms-react-shadcn-renderers @jsonforms/core @jsonforms/react
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Commit the generated component files. Customize and update them in your app.
|
|
20
|
+
The renderer imports named exports from a stable prefix, for example
|
|
21
|
+
`@jsonforms-react-shadcn-ui/input` exports `Input`. It does not provide fallbacks.
|
|
22
|
+
Missing components produce a module resolution error at build time.
|
|
23
|
+
|
|
24
|
+
Map that prefix to your generated components in Vite:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
resolve: {
|
|
31
|
+
alias: {
|
|
32
|
+
'@jsonforms-react-shadcn-ui': fileURLToPath(
|
|
33
|
+
new URL('./src/components/ui', import.meta.url),
|
|
34
|
+
),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
ssr: {
|
|
38
|
+
noExternal: [
|
|
39
|
+
'@chobantonov/jsonforms-react-shadcn-renderers',
|
|
40
|
+
'@chobantonov/jsonforms-react-shadcn-extended-renderers',
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Merge the equivalent mapping into your TypeScript configuration:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"compilerOptions": {
|
|
51
|
+
"baseUrl": ".",
|
|
52
|
+
"paths": {
|
|
53
|
+
"@jsonforms-react-shadcn-ui/*": ["./src/components/ui/*"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The alias must resolve subpaths. Keep your app's usual `@/` alias for imports
|
|
60
|
+
inside generated components. CommonJS consumers also need a bundler or resolver
|
|
61
|
+
that maps the prefix; unconfigured direct Node `require` is not supported.
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { JsonForms } from '@jsonforms/react';
|
|
67
|
+
import {
|
|
68
|
+
shadcnRenderers,
|
|
69
|
+
shadcnCells,
|
|
70
|
+
} from '@chobantonov/jsonforms-react-shadcn-renderers';
|
|
71
|
+
|
|
72
|
+
<JsonForms
|
|
73
|
+
schema={schema}
|
|
74
|
+
uischema={uischema}
|
|
75
|
+
data={data}
|
|
76
|
+
renderers={shadcnRenderers}
|
|
77
|
+
cells={shadcnCells}
|
|
78
|
+
onChange={({ data }) => setData(data)}
|
|
79
|
+
/>;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Import UI components directly from your app, never from the renderer package:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { Button } from './components/ui/button';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The optional extended renderer package uses the same alias and app components.
|
|
89
|
+
It does not supply a second UI library. Add its `createShadcnExtendedRenderers()`
|
|
90
|
+
registry to the base registry.
|
|
91
|
+
|
|
92
|
+
## Styling and hosts
|
|
93
|
+
|
|
94
|
+
Configure shadcn's semantic theme tokens, dark mode, and Tailwind in the host.
|
|
95
|
+
Scan the renderer and extended renderer `src/**/*.{ts,tsx}` files in addition to
|
|
96
|
+
your generated components. Include the renderer's `src/styles.css` for its form
|
|
97
|
+
layout classes. The demo contains a complete Tailwind 3 configuration; adapt
|
|
98
|
+
source scanning to your Tailwind version.
|
|
99
|
+
|
|
100
|
+
The demo and Web Component projects each own their generated components and
|
|
101
|
+
runtime dependencies. A React app supplies the alias when bundling the renderer.
|
|
102
|
+
The Web Component build resolves the alias against its own component directory.
|
|
103
|
+
Keep shadow-root styles in the Web Component build.
|
|
104
|
+
|
|
105
|
+
## Development and verification
|
|
106
|
+
|
|
107
|
+
`pnpm test:shadcn` runs the renderer and shared behavioral tests.
|
|
108
|
+
`pnpm build:shadcn` checks declarations and builds the demo and its dependencies.
|
|
109
|
+
The ownership tests check host component inventories, runtime dependencies,
|
|
110
|
+
source imports, and the external component imports in library bundles. Control
|
|
111
|
+
contract tests exercise the real demo-owned components, including edits, clears,
|
|
112
|
+
readonly state, validation feedback, and JSON value types.
|
|
113
|
+
|
|
114
|
+
`test/ui-types` contains build-only declaration fixtures for the app component
|
|
115
|
+
API. These are not shipped as a component implementation. When changing a
|
|
116
|
+
component API, update both host components and these fixtures.
|
|
117
|
+
|
|
118
|
+
## Parity status
|
|
119
|
+
|
|
120
|
+
The ownership migration covers the base renderer, extended renderer, demo, and
|
|
121
|
+
Web Component projects. Behavioral tests cover primitives, editable cells,
|
|
122
|
+
combinators, array action restrictions and confirmation, layout sizing, and host
|
|
123
|
+
updates. This is not yet complete Ant Design feature parity. Remaining work
|
|
124
|
+
includes advanced table options, list array variants and tuple controls, the complete temporal display/save-format contract,
|
|
125
|
+
and the full localization and validation-indicator contracts. The repository
|
|
126
|
+
specification remains the acceptance target for those features.
|
|
127
|
+
|
|
128
|
+
### Table and AG Grid composite columns
|
|
129
|
+
|
|
130
|
+
Pass `shadcnCells` alongside the renderer registry. Object and array cells show
|
|
131
|
+
compact summaries and open host-owned shadcn dialogs. Edits and Clear stay in a
|
|
132
|
+
draft until Apply; Cancel discards the draft. Readonly forms allow inspection.
|
|
133
|
+
If the underlying value changes while a dialog is open, Apply is disabled.
|
|
134
|
+
|
|
135
|
+
Use `options.table: true` for a table, or `options.variant: "ag-grid"` with
|
|
136
|
+
the extended renderers. Configure summaries and detail layouts with
|
|
137
|
+
`options.cells.<property>.summary` and `detail`.
|
|
138
|
+
The shared **Array controls → Scalar and composite cells** spec example shows
|
|
139
|
+
both presentations using the same data, including object and array columns.
|
|
140
|
+
|
|
141
|
+
### Categorization variants
|
|
142
|
+
|
|
143
|
+
Set `options.variant` to `accordion` or `stepper`; the default is tabs.
|
|
144
|
+
All three honor category visibility rules, translated labels and
|
|
145
|
+
`options.initial` (a category name). Accordion panels remain mounted when
|
|
146
|
+
closed, with at most one open and an optional all-closed state. Stepper supports
|
|
147
|
+
`showNavButtons` and `vertical`. Navigation remains available in readonly forms.
|
|
148
|
+
No extra UI aliases are required: these presentations use the app's Button and
|
|
149
|
+
Tabs components.
|
|
150
|
+
|
|
151
|
+
Collapsible groups use the app-owned `collapsible` module (`Collapsible`,
|
|
152
|
+
`CollapsibleTrigger`, `CollapsibleContent`) with the [shadcn Base UI API](https://ui.shadcn.com/docs/components/base/collapsible).
|
|
153
|
+
Supply support for `render` composition and `keepMounted` content so collapsing preserves field state.
|
|
154
|
+
The consuming app installs Base UI; the renderer has no Base UI runtime dependency.
|
|
155
|
+
|
|
156
|
+
List-with-detail arrays use the app-owned `item` and `avatar` modules. Each list row includes selection and delete actions; `hideAvatar` hides its numbered avatar.
|
|
157
|
+
|
|
158
|
+
Array toolbar actions use the Button `icon-sm` size (28px); include this variant in the host-owned Button component.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LabelRenderer';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CellProps, JsonFormsRendererRegistryEntry, JsonFormsCellRendererRegistryEntry } from '@jsonforms/core';
|
|
3
|
+
type Props = CellProps & {
|
|
4
|
+
renderers?: JsonFormsRendererRegistryEntry[];
|
|
5
|
+
cells?: JsonFormsCellRendererRegistryEntry[];
|
|
6
|
+
};
|
|
7
|
+
/** A compact summary with isolated editing; only Apply writes to the form. */
|
|
8
|
+
export declare const ShadcnCompositeCell: (props: Props) => React.JSX.Element | null;
|
|
9
|
+
export { compositeCellTester as shadcnCompositeCellTester } from '@chobantonov/jsonforms-react-renderer-common/cells/compositeCellTester';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CellProps, Formatted } from '@jsonforms/core';
|
|
3
|
+
export declare const numberFormatCellTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: import("@jsonforms/core").JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
4
|
+
export declare const ShadcnNumberFormatCell: (props: CellProps & Partial<Formatted<number>>) => React.JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { JsonSchema, UISchemaElement } from '@jsonforms/core';
|
|
3
|
+
export declare const ShadcnCellMode: React.Context<boolean>;
|
|
4
|
+
/** DispatchCell paths already include the field scope; connected controls must not append it again. */
|
|
5
|
+
export declare const asShadcnCell: <P extends {
|
|
6
|
+
uischema?: UISchemaElement;
|
|
7
|
+
}>(Control: React.ComponentType<P>) => React.ComponentType<P>;
|
|
8
|
+
export declare const ShadcnGridCellFrame: (props: React.PropsWithChildren<{
|
|
9
|
+
schema?: JsonSchema;
|
|
10
|
+
uischema?: UISchemaElement;
|
|
11
|
+
path: string;
|
|
12
|
+
}>) => React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type AdditionalPropertiesProps } from '@chobantonov/jsonforms-react-renderer-common/objects/useAdditionalPropertyEntries';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type { AdditionalPropertiesProps } from '@chobantonov/jsonforms-react-renderer-common/objects/useAdditionalPropertyEntries';
|
|
4
|
+
export declare const AdditionalProperties: (props: AdditionalPropertiesProps) => React.JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CombinatorRendererProps, RankedTester } from '@jsonforms/core';
|
|
3
|
+
export declare const ShadcnAnyOfRenderer: ({ handleChange, schema, rootSchema, indexOfFittingSchema, visible, path, renderers, cells, uischema, uischemas, data, enabled, label, config, combinator, }: CombinatorRendererProps & {
|
|
4
|
+
combinator?: "anyOf" | "oneOf";
|
|
5
|
+
}) => React.JSX.Element | null;
|
|
6
|
+
export declare const anyOfControlTester: RankedTester;
|
|
7
|
+
export declare const ShadcnAnyOfControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ControlProps } from '@jsonforms/core';
|
|
3
|
+
export declare const chipsControlTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: import("@jsonforms/core").JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
4
|
+
export declare const multiSelectControlTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: import("@jsonforms/core").JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
5
|
+
export declare const enumArrayControlTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: import("@jsonforms/core").JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
6
|
+
export declare const ShadcnArrayChoicesControl: (props: ControlProps) => React.JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { useArrayPanelState } from '@chobantonov/jsonforms-react-renderer-common/collections/useArrayPanelState';
|
|
3
|
+
export declare function ArrayPanelToggle({ panel, label, }: {
|
|
4
|
+
panel: ReturnType<typeof useArrayPanelState>;
|
|
5
|
+
label?: string;
|
|
6
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type CombinatorSwitchDialogProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const CombinatorSwitchDialog: ({ open, onCancel, onConfirm, }: CombinatorSwitchDialogProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DialogContent } from '@jsonforms-react-shadcn-ui/dialog';
|
|
3
|
+
import { DetailDialogOptions } from '@chobantonov/jsonforms-react-renderer-common/interaction/detailDialog';
|
|
4
|
+
export declare const DetailDialogContent: ({ options, open, children, ...props }: React.ComponentProps<typeof DialogContent> & {
|
|
5
|
+
options?: DetailDialogOptions;
|
|
6
|
+
open: boolean;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export { schemaForType, isArrayElementPath, isMixedSchema, isMixedControl, mixedControlTester, } from '@chobantonov/jsonforms-react-renderer-common/mixed/mixedSchema';
|
|
3
|
+
export type { JsonDataType } from '@chobantonov/jsonforms-react-renderer-common/mixed/mixedSchema';
|
|
4
|
+
import { ControlProps } from '@jsonforms/core';
|
|
5
|
+
export declare const MixedRendererComponent: (props: ControlProps) => React.JSX.Element | null;
|
|
6
|
+
export declare const MixedRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CombinatorRendererProps } from '@jsonforms/core';
|
|
3
|
+
export declare const ShadcnOneOfRenderer: (props: CombinatorRendererProps) => React.JSX.Element;
|
|
4
|
+
export declare const oneOfControlTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: import("@jsonforms/core").JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
5
|
+
export declare const ShadcnOneOfControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { recursiveTreeTester } from '@chobantonov/jsonforms-react-renderer-common/mixed/RecursiveTreeRenderer';
|
|
3
|
+
export { recursiveTreeTester };
|
|
4
|
+
export declare const RecursiveTreeRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type RowDetailState } from '@chobantonov/jsonforms-react-renderer-common/collections/rowDetail';
|
|
3
|
+
export declare const RowDetailFrame: ({ state, children }: {
|
|
4
|
+
state: RowDetailState;
|
|
5
|
+
} & {
|
|
6
|
+
children?: React.ReactNode | undefined;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export declare const RowDetailToggle: ({ state }: {
|
|
9
|
+
state: RowDetailState;
|
|
10
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
11
|
+
/** Shared row edit action for native tables and AG Grid. */
|
|
12
|
+
export declare const RowDetailEditButton: ({ label, onClick, disabled, }: {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TupleAdditionalItemsProps } from '@chobantonov/jsonforms-react-renderer-common/tuple/useTupleAdditionalItems';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type { TupleAdditionalItemsProps } from '@chobantonov/jsonforms-react-renderer-common/tuple/useTupleAdditionalItems';
|
|
4
|
+
export declare const TupleAdditionalItems: (props: TupleAdditionalItemsProps) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TupleControlProps } from '@chobantonov/jsonforms-react-renderer-common/tuple/TupleControlContent';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { RankedTester } from '@jsonforms/core';
|
|
4
|
+
export declare const tupleControlRendererTester: RankedTester;
|
|
5
|
+
export declare const TupleControl: (props: TupleControlProps) => React.JSX.Element | null;
|
|
6
|
+
export declare const TupleControlRenderer: React.ComponentType<any>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TupleFieldProps } from '@chobantonov/jsonforms-react-renderer-common/tuple/TupleField';
|
|
3
|
+
export type { TupleFieldProps } from '@chobantonov/jsonforms-react-renderer-common/tuple/TupleField';
|
|
4
|
+
export declare function TupleField(props: TupleFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ArrayLayoutProps } from '@jsonforms/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ArrayItemViewProps } from './ArrayItemViewProps';
|
|
4
|
+
type ArrayItemPanelsProps = ArrayItemViewProps & Pick<ArrayLayoutProps, 'config' | 'uischema'> & {
|
|
5
|
+
expandedIndex?: number;
|
|
6
|
+
onExpand: (index: number | undefined) => void;
|
|
7
|
+
onMove: (index: number, direction: -1 | 1) => void;
|
|
8
|
+
canMove: boolean;
|
|
9
|
+
count: number;
|
|
10
|
+
translations: {
|
|
11
|
+
upAriaLabel: string;
|
|
12
|
+
up: string;
|
|
13
|
+
downAriaLabel: string;
|
|
14
|
+
down: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare function ArrayItemPanels(props: ArrayItemPanelsProps): React.JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ArrayLayoutProps, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
export type ArrayItemViewProps = Pick<ArrayLayoutProps, 'schema' | 'path' | 'enabled' | 'cells' | 'renderers'> & {
|
|
3
|
+
detail: UISchemaElement;
|
|
4
|
+
indices: number[];
|
|
5
|
+
hideAvatar: boolean;
|
|
6
|
+
canRemove: boolean;
|
|
7
|
+
requestRemove: (index: number) => void;
|
|
8
|
+
childLabelForIndex: (path: string, index: number) => string;
|
|
9
|
+
removeLabel: string;
|
|
10
|
+
removeTooltip: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ArrayLayoutProps } from '@jsonforms/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ArrayItemViewProps } from './ArrayItemViewProps';
|
|
4
|
+
export declare function ArrayListDetail({ schema, path, enabled, cells, renderers, detail, indices, count, label, readonly, selectedItem, emptyMessage, ...itemProps }: ArrayItemViewProps & Pick<ArrayLayoutProps, 'label' | 'readonly'> & {
|
|
5
|
+
count: number;
|
|
6
|
+
selectedItem: number;
|
|
7
|
+
onSelect: (index: number) => void;
|
|
8
|
+
emptyMessage: () => string;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useColumnWidths } from '@chobantonov/jsonforms-react-renderer-common/collections/columnResize';
|
|
2
|
+
import { useTableSelection } from '@chobantonov/jsonforms-react-renderer-common/collections/useTableSelection';
|
|
3
|
+
import { useRowDetail } from '@chobantonov/jsonforms-react-renderer-common/collections/rowDetail';
|
|
4
|
+
import { ArrayLayoutProps } from '@jsonforms/core';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { CollectionPage } from '@chobantonov/jsonforms-react-renderer-common/collections/collectionPagination';
|
|
7
|
+
type ArrayTableProps = ArrayLayoutProps & {
|
|
8
|
+
options: NonNullable<ArrayLayoutProps['uischema']['options']>;
|
|
9
|
+
rowDetail: ReturnType<typeof useRowDetail>;
|
|
10
|
+
page: CollectionPage;
|
|
11
|
+
selection: ReturnType<typeof useTableSelection>;
|
|
12
|
+
columnSizes: ReturnType<typeof useColumnWidths>;
|
|
13
|
+
translations: {
|
|
14
|
+
upAriaLabel: string;
|
|
15
|
+
up: string;
|
|
16
|
+
downAriaLabel: string;
|
|
17
|
+
down: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function ArrayTable(props: ArrayTableProps): React.JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './AdditionalProperties';
|
|
2
|
+
export { AllOfRenderer as ShadcnAllOfRenderer, AllOfControl as ShadcnAllOfControl, allOfControlTester, } from '@chobantonov/jsonforms-react-renderer-common/composition/AllOfRenderer';
|
|
3
|
+
export * from './AnyOfRenderer';
|
|
4
|
+
export * from './ArrayControlRenderer';
|
|
5
|
+
export * from '@chobantonov/jsonforms-react-renderer-common/composition/CombinatorProperties';
|
|
6
|
+
export * from './CombinatorSwitchDialog';
|
|
7
|
+
export * from './MixedRenderer';
|
|
8
|
+
export * from './ObjectRenderer';
|
|
9
|
+
export * from './OneOfRenderer';
|
|
10
|
+
export * from './TupleControlRenderer';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MixedTreeProps } from '@chobantonov/jsonforms-react-renderer-common/mixed/RecursiveTreeRenderer';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const MixedNavigationContext: React.Context<{
|
|
4
|
+
selectPath: (path: string) => void;
|
|
5
|
+
} | null>;
|
|
6
|
+
export declare const MixedTypeSelector: ({ clearable, disabled, error, onChange, types, value, }: {
|
|
7
|
+
clearable?: boolean;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
onChange: (value: string | undefined) => void;
|
|
13
|
+
types: string[];
|
|
14
|
+
value: string | null;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
|
+
export declare const NestedMixedNavigation: ({ label, onView, selector, }: {
|
|
17
|
+
description?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
onView: () => void;
|
|
20
|
+
selector: React.ReactNode;
|
|
21
|
+
}) => React.JSX.Element;
|
|
22
|
+
export declare const MixedTree: (props: MixedTreeProps) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Presents the shared destructive-change policy with a shadcn dialog. */
|
|
3
|
+
export declare const useConfirmation: () => {
|
|
4
|
+
request: (next: import("@chobantonov/jsonforms-react-renderer-common").ConfirmationRequest) => void;
|
|
5
|
+
dialog: React.JSX.Element | null;
|
|
6
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ClearValueButtonProps {
|
|
3
|
+
clearable?: boolean;
|
|
4
|
+
adornmentAware?: boolean;
|
|
5
|
+
trailingControlSpace?: number;
|
|
6
|
+
data: unknown;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
onClear: () => void;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const hasClearableValue: (data: unknown) => boolean;
|
|
12
|
+
export declare const ClearValueButton: ({ clearable, adornmentAware, trailingControlSpace, data, enabled, onClear, readonly, }: ClearValueButtonProps) => React.JSX.Element | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollArea } from '@jsonforms-react-shadcn-ui/scroll-area';
|
|
3
|
+
/** The host supplies upstream themed scrollbars; both axes remain reachable. */
|
|
4
|
+
export declare const ScrollRegion: ({ children, style, className, ...props }: React.ComponentProps<typeof ScrollArea>) => React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TimeValue } from '../util/dateTime';
|
|
3
|
+
export type TimePickerProps = {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
useSeconds?: boolean;
|
|
7
|
+
showHours?: boolean;
|
|
8
|
+
showMinutes?: boolean;
|
|
9
|
+
ampm?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
isAllowed?: (time: TimeValue) => boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const TimePicker: ({ value, onChange, useSeconds, showHours, showMinutes, ampm, disabled, isAllowed, }: TimePickerProps) => React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ControlProps, JsonSchema } from '@jsonforms/core';
|
|
3
|
+
export declare const anyOfStringOrEnumControlTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
4
|
+
export declare const ShadcnAnyOfStringOrEnumControl: (props: ControlProps) => React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ControlProps, RankedTester } from '@jsonforms/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const ShadcnBooleanControl: ({ config, uischema, schema, data, description, enabled, errors, handleChange, label, path, required, readonly, visible, }: ControlProps) => React.JSX.Element | null;
|
|
4
|
+
export declare const booleanControlTester: RankedTester;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ControlProps } from '@jsonforms/core';
|
|
3
|
+
export declare const ShadcnBooleanToggleControl: (props: ControlProps) => React.JSX.Element | null;
|
|
4
|
+
export declare const booleanToggleControlTester: (uischema: import("@jsonforms/core").UISchemaElement, schema: import("@jsonforms/core").JsonSchema, context: import("@jsonforms/core").TesterContext) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChoiceCards: (props: import("@jsonforms/core").OwnPropsOfControl) => React.JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ControlProps, OwnPropsOfEnum, RankedTester } from '@jsonforms/core';
|
|
2
|
+
import { TranslateProps } from '@jsonforms/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export declare const ShadcnEnumControl: ({ schema, data, config, description, enabled, errors, handleChange, label, options, path, required, readonly, uischema, visible, }: ControlProps & OwnPropsOfEnum & TranslateProps) => React.JSX.Element | null;
|
|
5
|
+
export declare const enumControlTester: RankedTester;
|