@strato-admin/cloudscape 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Admin.d.ts +6 -2
- package/dist/Admin.js +14 -8
- package/dist/RecordLink.js +5 -4
- package/dist/Settings.d.ts +17 -0
- package/dist/Settings.js +14 -0
- package/dist/button/BulkDeleteButton.d.ts +2 -1
- package/dist/button/BulkDeleteButton.js +17 -11
- package/dist/button/Button.d.ts +2 -1
- package/dist/button/CancelButton.d.ts +6 -0
- package/dist/button/CancelButton.js +10 -0
- package/dist/button/CreateButton.js +9 -8
- package/dist/button/DeleteButton.d.ts +13 -0
- package/dist/button/DeleteButton.js +36 -0
- package/dist/button/EditButton.d.ts +1 -1
- package/dist/button/EditButton.js +10 -10
- package/dist/button/SaveButton.js +2 -2
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +2 -0
- package/dist/collection-hooks/interfaces.d.ts +7 -3
- package/dist/collection-hooks/useCollection.d.ts +1 -1
- package/dist/collection-hooks/useCollection.js +15 -10
- package/dist/create/Create.d.ts +9 -17
- package/dist/create/Create.js +40 -12
- package/dist/create/CreateHeader.d.ts +2 -2
- package/dist/create/CreateHeader.js +4 -5
- package/dist/defaults.d.ts +6 -0
- package/dist/defaults.js +21 -0
- package/dist/detail/Detail.d.ts +33 -0
- package/dist/detail/Detail.js +22 -0
- package/dist/detail/DetailHeader.d.ts +11 -0
- package/dist/detail/{ShowHeader.js → DetailHeader.js} +7 -5
- package/dist/detail/DetailHub.d.ts +27 -0
- package/dist/detail/DetailHub.js +63 -0
- package/dist/detail/KeyValuePairs.d.ts +7 -1
- package/dist/detail/KeyValuePairs.js +14 -8
- package/dist/detail/index.d.ts +3 -2
- package/dist/detail/index.js +3 -2
- package/dist/edit/Edit.d.ts +8 -19
- package/dist/edit/Edit.js +48 -12
- package/dist/edit/EditHeader.d.ts +2 -2
- package/dist/edit/EditHeader.js +5 -4
- package/dist/field/ArrayField.d.ts +26 -10
- package/dist/field/ArrayField.js +38 -10
- package/dist/field/BadgeField.d.ts +1 -1
- package/dist/field/BadgeField.js +1 -1
- package/dist/field/BooleanField.d.ts +1 -1
- package/dist/field/BooleanField.js +2 -2
- package/dist/field/CurrencyField.d.ts +1 -1
- package/dist/field/CurrencyField.js +1 -1
- package/dist/field/DateField.d.ts +1 -1
- package/dist/field/DateField.js +1 -1
- package/dist/field/IdField.d.ts +1 -1
- package/dist/field/IdField.js +3 -3
- package/dist/field/NumberField.d.ts +1 -1
- package/dist/field/NumberField.js +1 -1
- package/dist/field/ReferenceField.d.ts +1 -1
- package/dist/field/ReferenceField.js +4 -2
- package/dist/field/ReferenceManyField.d.ts +35 -4
- package/dist/field/ReferenceManyField.js +17 -4
- package/dist/field/StatusIndicatorField.d.ts +1 -1
- package/dist/field/StatusIndicatorField.js +6 -5
- package/dist/field/TextField.d.ts +1 -1
- package/dist/field/TextField.js +1 -1
- package/dist/field/types.d.ts +9 -9
- package/dist/form/Form.d.ts +12 -2
- package/dist/form/Form.js +10 -16
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +1 -1
- package/dist/hooks/useSchemaFields.d.ts +22 -0
- package/dist/hooks/useSchemaFields.js +45 -0
- package/dist/i18n/Message.d.ts +15 -0
- package/dist/i18n/Message.js +19 -0
- package/dist/i18n/RecordMessage.d.ts +14 -0
- package/dist/i18n/RecordMessage.js +16 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/types.d.ts +19 -0
- package/dist/i18n/types.js +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/input/ArrayInput.d.ts +33 -0
- package/dist/input/{AttributeEditor.js → ArrayInput.js} +18 -11
- package/dist/input/AutocompleteInput.d.ts +1 -1
- package/dist/input/AutocompleteInput.js +3 -3
- package/dist/input/BooleanInput.d.ts +6 -0
- package/dist/input/BooleanInput.js +23 -0
- package/dist/input/CommonInputProps.d.ts +6 -0
- package/dist/input/CommonInputProps.js +6 -0
- package/dist/input/FieldTitle.js +4 -4
- package/dist/input/FormField.js +12 -3
- package/dist/input/FormFieldContext.d.ts +1 -1
- package/dist/input/NumberInput.d.ts +1 -1
- package/dist/input/NumberInput.js +3 -3
- package/dist/input/ReferenceInput.d.ts +1 -1
- package/dist/input/ReferenceInput.js +22 -12
- package/dist/input/SelectInput.d.ts +1 -1
- package/dist/input/SelectInput.js +3 -3
- package/dist/input/SliderInput.d.ts +1 -1
- package/dist/input/SliderInput.js +4 -4
- package/dist/input/TextAreaInput.d.ts +1 -1
- package/dist/input/TextAreaInput.js +3 -3
- package/dist/input/TextInput.d.ts +1 -1
- package/dist/input/TextInput.js +6 -12
- package/dist/input/index.d.ts +2 -1
- package/dist/input/index.js +2 -1
- package/dist/input/types.d.ts +33 -2
- package/dist/layout/AppLayout.js +6 -3
- package/dist/layout/Notifications.d.ts +1 -0
- package/dist/layout/Notifications.js +51 -0
- package/dist/layout/Ready.d.ts +6 -0
- package/dist/layout/Ready.js +24 -0
- package/dist/layout/TopNavigation.d.ts +4 -2
- package/dist/layout/TopNavigation.js +7 -7
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +2 -0
- package/dist/list/Cards.d.ts +31 -4
- package/dist/list/Cards.js +81 -10
- package/dist/list/List.d.ts +9 -12
- package/dist/list/List.js +41 -11
- package/dist/list/Table.d.ts +8 -4
- package/dist/list/Table.js +55 -55
- package/dist/list/TableHeader.d.ts +2 -2
- package/dist/list/TableHeader.js +4 -5
- package/dist/theme/ThemeManager.js +1 -1
- package/package.json +8 -5
- package/src/Admin.tsx +35 -18
- package/src/RecordLink.stories.tsx +1 -1
- package/src/RecordLink.tsx +5 -4
- package/src/Settings.tsx +16 -0
- package/src/__mocks__/ra-core.tsx +83 -0
- package/src/__mocks__/strato-core.tsx +36 -42
- package/src/button/BulkDeleteButton.test.tsx +17 -4
- package/src/button/BulkDeleteButton.tsx +24 -29
- package/src/button/Button.tsx +31 -2
- package/src/button/CancelButton.tsx +20 -0
- package/src/button/CreateButton.tsx +12 -10
- package/src/button/DeleteButton.tsx +96 -0
- package/src/button/EditButton.tsx +13 -12
- package/src/button/SaveButton.tsx +2 -3
- package/src/button/index.ts +2 -0
- package/src/collection-hooks/interfaces.ts +7 -3
- package/src/collection-hooks/useCollection.test.ts +115 -2
- package/src/collection-hooks/useCollection.ts +15 -10
- package/src/create/Create.test.tsx +3 -3
- package/src/create/Create.tsx +68 -37
- package/src/create/CreateHeader.tsx +6 -10
- package/src/defaults.tsx +28 -0
- package/src/detail/Detail-CollectionFields.test.tsx +84 -0
- package/src/detail/Detail.test.tsx +91 -0
- package/src/detail/Detail.tsx +48 -0
- package/src/detail/{ShowHeader.test.tsx → DetailHeader.test.tsx} +11 -9
- package/src/detail/DetailHeader.tsx +42 -0
- package/src/detail/DetailHub.tsx +88 -0
- package/src/detail/KeyValuePairs.test.tsx +2 -2
- package/src/detail/KeyValuePairs.tsx +25 -18
- package/src/detail/index.ts +3 -2
- package/src/edit/Edit.test.tsx +7 -5
- package/src/edit/Edit.tsx +92 -40
- package/src/edit/EditHeader.tsx +7 -5
- package/src/field/ArrayField.tsx +57 -11
- package/src/field/BadgeField.tsx +2 -3
- package/src/field/BooleanField.test.tsx +2 -3
- package/src/field/BooleanField.tsx +3 -3
- package/src/field/CurrencyField.tsx +1 -1
- package/src/field/DateField.tsx +1 -1
- package/src/field/IdField.test.tsx +8 -20
- package/src/field/IdField.tsx +5 -20
- package/src/field/NumberField.tsx +1 -1
- package/src/field/ReferenceField.test.tsx +15 -6
- package/src/field/ReferenceField.tsx +10 -7
- package/src/field/ReferenceManyField.test.tsx +55 -10
- package/src/field/ReferenceManyField.tsx +84 -13
- package/src/field/StatusIndicatorField.test.tsx +7 -21
- package/src/field/StatusIndicatorField.tsx +8 -20
- package/src/field/TextField.tsx +1 -1
- package/src/field/types.ts +12 -13
- package/src/form/Form.test.tsx +8 -4
- package/src/form/Form.tsx +24 -19
- package/src/form/index.ts +1 -1
- package/src/hooks/useSchemaFields.ts +89 -0
- package/src/i18n/Message.tsx +22 -0
- package/src/i18n/RecordMessage.tsx +22 -0
- package/src/i18n/index.ts +3 -0
- package/src/i18n/types.ts +19 -0
- package/src/index.ts +5 -1
- package/src/input/ArrayInput.test.tsx +81 -0
- package/src/input/{AttributeEditor.tsx → ArrayInput.tsx} +36 -18
- package/src/input/AutocompleteInput.test.tsx +2 -4
- package/src/input/AutocompleteInput.tsx +9 -11
- package/src/input/BooleanInput.tsx +42 -0
- package/src/input/CommonInputProps.tsx +8 -0
- package/src/input/FieldTitle.tsx +3 -15
- package/src/input/FormField.tsx +78 -67
- package/src/input/FormFieldContext.ts +1 -1
- package/src/input/NumberInput.tsx +10 -7
- package/src/input/ReferenceInput.test.tsx +12 -2
- package/src/input/ReferenceInput.tsx +32 -14
- package/src/input/SelectInput.tsx +14 -17
- package/src/input/SliderInput.test.tsx +2 -3
- package/src/input/SliderInput.tsx +48 -38
- package/src/input/TextAreaInput.tsx +10 -6
- package/src/input/TextInput.test.tsx +2 -4
- package/src/input/TextInput.tsx +35 -20
- package/src/input/index.ts +2 -1
- package/src/input/types.ts +40 -8
- package/src/layout/AppLayout.test.tsx +23 -3
- package/src/layout/AppLayout.tsx +11 -8
- package/src/layout/Notifications.test.tsx +102 -0
- package/src/layout/Notifications.tsx +61 -0
- package/src/layout/Ready.tsx +123 -0
- package/src/layout/TopNavigation.test.tsx +2 -3
- package/src/layout/TopNavigation.tsx +9 -8
- package/src/layout/index.ts +2 -0
- package/src/list/Cards.test.tsx +320 -0
- package/src/list/Cards.tsx +146 -16
- package/src/list/List.tsx +87 -26
- package/src/list/Table.test.tsx +40 -5
- package/src/list/Table.tsx +89 -98
- package/src/list/TableHeader.test.tsx +15 -11
- package/src/list/TableHeader.tsx +6 -8
- package/src/theme/ThemeManager.tsx +1 -1
- package/dist/__mocks__/strato-core.js +0 -50
- package/dist/__mocks__to__delete/strato-core.js +0 -50
- package/dist/detail/Show.d.ts +0 -39
- package/dist/detail/Show.js +0 -40
- package/dist/detail/ShowHeader.d.ts +0 -7
- package/dist/input/AttributeEditor.d.ts +0 -25
- package/src/detail/Show.test.tsx +0 -96
- package/src/detail/Show.tsx +0 -104
- package/src/detail/ShowHeader.tsx +0 -35
- package/src/input/AttributeEditor.test.tsx +0 -147
package/dist/field/DateField.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFieldValue, useRecordContext, useLocale } from '@strato-admin/core';
|
|
2
|
+
import { useFieldValue, useRecordContext, useLocale } from '@strato-admin/ra-core';
|
|
3
3
|
import RecordLink from '../RecordLink';
|
|
4
4
|
const DateField = (props) => {
|
|
5
5
|
const { source, record: recordProp, emptyText, options, locales, link } = props;
|
package/dist/field/IdField.d.ts
CHANGED
package/dist/field/IdField.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useResourceDefinition } from '@strato-admin/core';
|
|
2
|
+
import { useResourceDefinition } from '@strato-admin/ra-core';
|
|
3
3
|
import TextField from './TextField';
|
|
4
4
|
/**
|
|
5
5
|
* A field that displays the record's ID.
|
|
@@ -15,7 +15,7 @@ import TextField from './TextField';
|
|
|
15
15
|
*/
|
|
16
16
|
const IdField = (props) => {
|
|
17
17
|
const { hasShow } = useResourceDefinition(props);
|
|
18
|
-
const { source = 'id', link = hasShow ? '
|
|
19
|
-
return
|
|
18
|
+
const { source = 'id', link = hasShow ? 'detail' : undefined, input = false, ...rest } = props;
|
|
19
|
+
return _jsx(TextField, { source: source, link: link, input: input, ...rest });
|
|
20
20
|
};
|
|
21
21
|
export default IdField;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFieldValue, useRecordContext, useLocale } from '@strato-admin/core';
|
|
2
|
+
import { useFieldValue, useRecordContext, useLocale } from '@strato-admin/ra-core';
|
|
3
3
|
import RecordLink from '../RecordLink';
|
|
4
4
|
const NumberField = (props) => {
|
|
5
5
|
const { source, record: recordProp, emptyText, options, locales, link } = props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type RaRecord } from '@strato-admin/core';
|
|
2
|
+
import { type RaRecord } from '@strato-admin/ra-core';
|
|
3
3
|
import { type FieldProps } from './types';
|
|
4
4
|
export type ReferenceFieldProps<RecordType extends RaRecord = RaRecord> = FieldProps<RecordType> & {
|
|
5
5
|
/**
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ReferenceFieldBase, useRecordContext, useGetRecordRepresentation
|
|
2
|
+
import { ReferenceFieldBase, useRecordContext, useGetRecordRepresentation } from '@strato-admin/ra-core';
|
|
3
|
+
import { useResourceSchema } from '@strato-admin/core';
|
|
3
4
|
import RecordLink from '../RecordLink';
|
|
4
5
|
const ReferenceField = (props) => {
|
|
5
6
|
const { source, reference, children, emptyText, record, link } = props;
|
|
7
|
+
const { queryOptions } = useResourceSchema(reference);
|
|
6
8
|
if (!source) {
|
|
7
9
|
return null; // Or some fallback
|
|
8
10
|
}
|
|
9
|
-
return (_jsx(ReferenceFieldBase, { source: source, reference: reference, record: record, empty: _jsx(_Fragment, { children: emptyText ?? null }), children: _jsx(ReferenceFieldValue, { emptyText: emptyText, link: link, reference: reference, children: children }) }));
|
|
11
|
+
return (_jsx(ReferenceFieldBase, { source: source, reference: reference, record: record, empty: _jsx(_Fragment, { children: emptyText ?? null }), queryOptions: queryOptions, children: _jsx(ReferenceFieldValue, { emptyText: emptyText, link: link, reference: reference, children: children }) }));
|
|
10
12
|
};
|
|
11
13
|
const ReferenceFieldValue = ({ children, emptyText, link, reference }) => {
|
|
12
14
|
const record = useRecordContext();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { type RaRecord } from '@strato-admin/core';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { type RaRecord } from '@strato-admin/ra-core';
|
|
3
3
|
import { type FieldProps } from './types';
|
|
4
|
-
export interface ReferenceManyFieldProps<RecordType extends RaRecord = RaRecord
|
|
4
|
+
export interface ReferenceManyFieldProps<RecordType extends RaRecord = RaRecord> extends FieldProps<RecordType> {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
reference: string;
|
|
7
7
|
target: string;
|
|
@@ -38,6 +38,30 @@ export interface ReferenceManyFieldProps<RecordType extends RaRecord = RaRecord,
|
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
40
|
synchronizeWithLocation?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Include only these fields from the schema.
|
|
43
|
+
*/
|
|
44
|
+
include?: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Exclude these fields from the schema.
|
|
47
|
+
*/
|
|
48
|
+
exclude?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* The fields to display by default.
|
|
51
|
+
*/
|
|
52
|
+
display?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether to enable text filtering.
|
|
55
|
+
*/
|
|
56
|
+
filtering?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to show the preferences button or custom preferences content.
|
|
59
|
+
*/
|
|
60
|
+
preferences?: boolean | React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* The title of the list.
|
|
63
|
+
*/
|
|
64
|
+
title?: React.ReactNode;
|
|
41
65
|
}
|
|
42
66
|
/**
|
|
43
67
|
* Render related records to the current one.
|
|
@@ -50,6 +74,13 @@ export interface ReferenceManyFieldProps<RecordType extends RaRecord = RaRecord,
|
|
|
50
74
|
* <Table.Column source="created_at" />
|
|
51
75
|
* </Table>
|
|
52
76
|
* </ReferenceManyField>
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* // Honors the default listComponent from the reviews resource schema
|
|
80
|
+
* <ReferenceManyField reference="reviews" target="product_id" />
|
|
53
81
|
*/
|
|
54
|
-
export declare const ReferenceManyField:
|
|
82
|
+
export declare const ReferenceManyField: {
|
|
83
|
+
<RecordType extends RaRecord = RaRecord<import("@strato-admin/ra-core").Identifier>>(props: ReferenceManyFieldProps<RecordType>): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
isCollectionField: boolean;
|
|
85
|
+
};
|
|
55
86
|
export default ReferenceManyField;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ReferenceManyFieldBase
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ReferenceManyFieldBase } from '@strato-admin/ra-core';
|
|
3
|
+
import { ResourceSchemaProvider, useResourceSchema } from '@strato-admin/core';
|
|
4
|
+
import Table from '../list/Table';
|
|
3
5
|
/**
|
|
4
6
|
* Render related records to the current one.
|
|
5
7
|
*
|
|
@@ -11,9 +13,20 @@ import { ReferenceManyFieldBase, ResourceSchemaProvider } from '@strato-admin/co
|
|
|
11
13
|
* <Table.Column source="created_at" />
|
|
12
14
|
* </Table>
|
|
13
15
|
* </ReferenceManyField>
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Honors the default listComponent from the reviews resource schema
|
|
19
|
+
* <ReferenceManyField reference="reviews" target="product_id" />
|
|
14
20
|
*/
|
|
15
21
|
export const ReferenceManyField = (props) => {
|
|
16
|
-
const { children, reference, fieldSchema, ...rest } = props;
|
|
17
|
-
|
|
22
|
+
const { children, reference, fieldSchema, include, exclude, display, filtering, preferences, title, ...rest } = props;
|
|
23
|
+
const { queryOptions } = useResourceSchema(reference);
|
|
24
|
+
return (_jsx(ReferenceManyFieldBase, { reference: reference, queryOptions: queryOptions, ...rest, children: _jsx(ResourceSchemaProvider, { resource: reference, fieldSchema: fieldSchema, children: _jsx(ReferenceManyFieldUI, { reference: reference, include: include, exclude: exclude, display: display, filtering: filtering, preferences: preferences, title: title, children: children }) }) }));
|
|
25
|
+
};
|
|
26
|
+
const ReferenceManyFieldUI = ({ children, reference, include, exclude, display, filtering, preferences, title, }) => {
|
|
27
|
+
const { listComponent: ListComponent = Table } = useResourceSchema(reference);
|
|
28
|
+
const finalChildren = children || (_jsx(ListComponent, { include: include, exclude: exclude, display: display, filtering: filtering, preferences: preferences, title: title }));
|
|
29
|
+
return _jsx(_Fragment, { children: finalChildren });
|
|
18
30
|
};
|
|
19
31
|
export default ReferenceManyField;
|
|
32
|
+
ReferenceManyField.isCollectionField = true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type StatusIndicatorProps } from '@cloudscape-design/components/status-indicator';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type RaRecord } from '@strato-admin/core';
|
|
3
|
+
import { type RaRecord } from '@strato-admin/ra-core';
|
|
4
4
|
import { type FieldProps } from './types';
|
|
5
5
|
export interface StatusIndicatorLabelProps {
|
|
6
6
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import StatusIndicator from '@cloudscape-design/components/status-indicator';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { useFieldValue, useRecordContext, useTranslate } from '@strato-admin/core';
|
|
4
|
+
import { useFieldValue, useRecordContext, useTranslate } from '@strato-admin/ra-core';
|
|
5
5
|
import RecordLink from '../RecordLink';
|
|
6
6
|
/**
|
|
7
7
|
* A declarative way to define status indicator mapping.
|
|
8
8
|
*/
|
|
9
9
|
export const StatusIndicatorLabel = (_) => null;
|
|
10
10
|
const StatusIndicatorField = (props) => {
|
|
11
|
-
const { source, record: recordProp, emptyText, link, type, mapping, iconAriaLabel, colorOverride, children
|
|
11
|
+
const { source, record: recordProp, emptyText, link, type, mapping, iconAriaLabel, colorOverride, children } = props;
|
|
12
12
|
const record = useRecordContext({ record: recordProp });
|
|
13
13
|
const value = useFieldValue({ source: source, record });
|
|
14
14
|
const translate = useTranslate();
|
|
@@ -28,9 +28,10 @@ const StatusIndicatorField = (props) => {
|
|
|
28
28
|
finalColorOverride = matchingLabel.props.color;
|
|
29
29
|
}
|
|
30
30
|
if (matchingLabel.props.label) {
|
|
31
|
-
label =
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
label =
|
|
32
|
+
typeof matchingLabel.props.label === 'string'
|
|
33
|
+
? translate(matchingLabel.props.label)
|
|
34
|
+
: matchingLabel.props.label;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
else if (typeof type === 'function') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RaRecord } from '@strato-admin/core';
|
|
1
|
+
import { type RaRecord } from '@strato-admin/ra-core';
|
|
2
2
|
import { type FieldProps } from './types';
|
|
3
3
|
export type TextFieldProps<RecordType extends RaRecord = RaRecord> = FieldProps<RecordType>;
|
|
4
4
|
declare const TextField: <RecordType extends RaRecord = RaRecord>(props: TextFieldProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/field/TextField.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFieldValue, useRecordContext } from '@strato-admin/core';
|
|
2
|
+
import { useFieldValue, useRecordContext } from '@strato-admin/ra-core';
|
|
3
3
|
import RecordLink from '../RecordLink';
|
|
4
4
|
const TextField = (props) => {
|
|
5
5
|
const { source, record: recordProp, emptyText, link } = props;
|
package/dist/field/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type BaseFieldProps, type RaRecord } from '@strato-admin/core';
|
|
2
|
+
import { ExtractRecordPaths, type BaseFieldProps, type RaRecord } from '@strato-admin/ra-core';
|
|
3
3
|
import { type RecordLinkType } from '../RecordLink';
|
|
4
4
|
/**
|
|
5
5
|
* Common props for all field components in strato-cloudscape.
|
|
@@ -8,11 +8,11 @@ export interface FieldProps<RecordType extends RaRecord = RaRecord> extends Omit
|
|
|
8
8
|
/**
|
|
9
9
|
* The property name in the record that should be displayed.
|
|
10
10
|
*/
|
|
11
|
-
source?:
|
|
11
|
+
source?: ExtractRecordPaths<RecordType>;
|
|
12
12
|
/**
|
|
13
|
-
* The label to display for this field.
|
|
13
|
+
* The label to display for this field. If not provided, it will be inferred from the `source`.
|
|
14
14
|
*/
|
|
15
|
-
label?: ReactNode;
|
|
15
|
+
label?: string | ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Whether the field is sortable in a table.
|
|
18
18
|
* @default true
|
|
@@ -20,8 +20,8 @@ export interface FieldProps<RecordType extends RaRecord = RaRecord> extends Omit
|
|
|
20
20
|
sortable?: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Whether to link the field to another page.
|
|
23
|
-
* - true: links to the '
|
|
24
|
-
* - 'edit' | '
|
|
23
|
+
* - true: links to the 'detail' page of the current resource
|
|
24
|
+
* - 'edit' | 'detail': links to the specified page type
|
|
25
25
|
* - string: a custom URL
|
|
26
26
|
* - function: (record, resource) => string
|
|
27
27
|
*/
|
|
@@ -29,7 +29,7 @@ export interface FieldProps<RecordType extends RaRecord = RaRecord> extends Omit
|
|
|
29
29
|
/**
|
|
30
30
|
* The text to display if the value is empty or null.
|
|
31
31
|
*/
|
|
32
|
-
emptyText?: ReactNode;
|
|
32
|
+
emptyText?: string | ReactNode;
|
|
33
33
|
/**
|
|
34
34
|
* Configuration for the inferred form input.
|
|
35
35
|
* - object: Props passed to the inferred Input component.
|
|
@@ -47,10 +47,10 @@ export interface FieldProps<RecordType extends RaRecord = RaRecord> extends Omit
|
|
|
47
47
|
* Additional text to help the user fill in the field.
|
|
48
48
|
* Passed to the inferred Input component's FormField.
|
|
49
49
|
*/
|
|
50
|
-
description?: ReactNode;
|
|
50
|
+
description?: string | ReactNode;
|
|
51
51
|
/**
|
|
52
52
|
* Text describing constraints (e.g., "Must be between 1 and 100").
|
|
53
53
|
* Passed to the inferred Input component's FormField.
|
|
54
54
|
*/
|
|
55
|
-
constraintText?: ReactNode;
|
|
55
|
+
constraintText?: string | ReactNode;
|
|
56
56
|
}
|
package/dist/form/Form.d.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type FormProps as RaFormProps } from '@strato-admin/core';
|
|
2
|
+
import { type FormProps as RaFormProps } from '@strato-admin/ra-core';
|
|
3
3
|
export interface FormProps extends Omit<RaFormProps, 'children'> {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* List of field sources to include in the form.
|
|
7
|
+
*/
|
|
5
8
|
include?: string[];
|
|
9
|
+
/**
|
|
10
|
+
* List of field sources to exclude from the form.
|
|
11
|
+
*/
|
|
6
12
|
exclude?: string[];
|
|
7
13
|
toolbar?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Label for the save button.
|
|
16
|
+
*/
|
|
17
|
+
saveButtonLabel?: string;
|
|
8
18
|
}
|
|
9
19
|
export declare const Form: {
|
|
10
|
-
({ children, include, exclude, toolbar, ...props }: FormProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
({ children, include, exclude, toolbar, saveButtonLabel, ...props }: FormProps): import("react/jsx-runtime").JSX.Element;
|
|
11
21
|
Field: (props: import("..").FormFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
22
|
};
|
|
13
23
|
export default Form;
|
package/dist/form/Form.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Form as RaForm, useSaveContext,
|
|
3
|
+
import { Form as RaForm, useSaveContext, useRecordContext } from '@strato-admin/ra-core';
|
|
4
|
+
import { useSchemaFields } from '../hooks/useSchemaFields';
|
|
4
5
|
import CloudscapeForm from '@cloudscape-design/components/form';
|
|
5
6
|
import SpaceBetween from '@cloudscape-design/components/space-between';
|
|
6
7
|
import { SaveButton } from '../button/SaveButton';
|
|
8
|
+
import { CancelButton } from '../button/CancelButton';
|
|
7
9
|
import { FormField } from '../input/FormField';
|
|
8
|
-
export const Form = ({ children, include, exclude, toolbar, ...props }) => {
|
|
10
|
+
export const Form = ({ children, include, exclude, toolbar, saveButtonLabel, ...props }) => {
|
|
9
11
|
const saveContext = useSaveContext();
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (include) {
|
|
15
|
-
result = result.filter((child) => React.isValidElement(child) && include.includes(child.props.source));
|
|
16
|
-
}
|
|
17
|
-
else if (exclude) {
|
|
18
|
-
result = result.filter((child) => React.isValidElement(child) && !exclude.includes(child.props.source));
|
|
19
|
-
}
|
|
20
|
-
return result;
|
|
21
|
-
}, [children, schemaChildren, include, exclude]);
|
|
12
|
+
const record = useRecordContext();
|
|
13
|
+
const isEditMode = record?.id != null;
|
|
14
|
+
const { getEditFields, getCreateFields } = useSchemaFields();
|
|
15
|
+
const finalChildren = React.useMemo(() => isEditMode ? getEditFields(children, { include, exclude }) : getCreateFields(children, { include, exclude }), [isEditMode, getEditFields, getCreateFields, children, include, exclude]);
|
|
22
16
|
const handleSubmit = async (values, event) => {
|
|
23
17
|
if (props.onSubmit) {
|
|
24
18
|
return props.onSubmit(values, event);
|
|
@@ -27,7 +21,7 @@ export const Form = ({ children, include, exclude, toolbar, ...props }) => {
|
|
|
27
21
|
return saveContext.save(values, event);
|
|
28
22
|
}
|
|
29
23
|
};
|
|
30
|
-
return (_jsx(RaForm, { ...props, onSubmit: handleSubmit, children: _jsx(CloudscapeForm, { actions: toolbar || (
|
|
24
|
+
return (_jsx(RaForm, { ...props, onSubmit: handleSubmit, children: _jsx(CloudscapeForm, { actions: toolbar || (_jsxs(SpaceBetween, { direction: "horizontal", size: "xs", children: [_jsx(CancelButton, {}), _jsx(SaveButton, { label: saveButtonLabel })] })), children: _jsx(SpaceBetween, { direction: "vertical", size: "l", children: finalChildren }) }) }));
|
|
31
25
|
};
|
|
32
26
|
Form.Field = FormField;
|
|
33
27
|
export default Form;
|
package/dist/form/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Form';
|
|
2
|
-
export { ValidationError } from '@strato-admin/core';
|
|
2
|
+
export { ValidationError } from '@strato-admin/ra-core';
|
package/dist/form/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Form';
|
|
2
|
-
export { ValidationError } from '@strato-admin/core';
|
|
2
|
+
export { ValidationError } from '@strato-admin/ra-core';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function useSchemaFields(): {
|
|
3
|
+
getListFields: (children: React.ReactNode, opts?: {
|
|
4
|
+
include?: string[];
|
|
5
|
+
exclude?: string[];
|
|
6
|
+
}) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
7
|
+
getDetailFields: (children: React.ReactNode, opts?: {
|
|
8
|
+
include?: string[];
|
|
9
|
+
exclude?: string[];
|
|
10
|
+
}) => {
|
|
11
|
+
scalarFields: React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
12
|
+
collectionFields: React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
13
|
+
};
|
|
14
|
+
getEditFields: (children: React.ReactNode, opts?: {
|
|
15
|
+
include?: string[];
|
|
16
|
+
exclude?: string[];
|
|
17
|
+
}) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
18
|
+
getCreateFields: (children: React.ReactNode, opts?: {
|
|
19
|
+
include?: string[];
|
|
20
|
+
exclude?: string[];
|
|
21
|
+
}) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
|
|
22
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useResourceSchema } from '@strato-admin/core';
|
|
3
|
+
const noCollectionFields = (child) => !child.type.isCollectionField;
|
|
4
|
+
function filterFields(base, options = {}) {
|
|
5
|
+
const { include, exclude, defaultFilter } = options;
|
|
6
|
+
let result = React.Children.toArray(base);
|
|
7
|
+
if (include) {
|
|
8
|
+
return result.filter((child) => React.isValidElement(child) && include.includes(child.props.source));
|
|
9
|
+
}
|
|
10
|
+
if (defaultFilter) {
|
|
11
|
+
result = result.filter((child) => React.isValidElement(child) && defaultFilter(child));
|
|
12
|
+
}
|
|
13
|
+
if (exclude) {
|
|
14
|
+
result = result.filter((child) => React.isValidElement(child) && !exclude.includes(child.props.source));
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
export function useSchemaFields() {
|
|
19
|
+
const { fieldSchema, inputSchema, listInclude, listExclude, detailInclude, detailExclude, formInclude, formExclude, editInclude, editExclude, createInclude, createExclude, } = useResourceSchema();
|
|
20
|
+
const getListFields = React.useCallback((children, opts = {}) => filterFields(children || fieldSchema, {
|
|
21
|
+
include: opts.include || listInclude,
|
|
22
|
+
exclude: opts.exclude || listExclude,
|
|
23
|
+
defaultFilter: noCollectionFields,
|
|
24
|
+
}), [fieldSchema, listInclude, listExclude]);
|
|
25
|
+
const getDetailFields = React.useCallback((children, opts = {}) => {
|
|
26
|
+
const hasExplicit = React.Children.count(children) > 0;
|
|
27
|
+
const all = filterFields(children || fieldSchema, {
|
|
28
|
+
include: hasExplicit ? undefined : opts.include || detailInclude,
|
|
29
|
+
exclude: hasExplicit ? undefined : opts.exclude || detailExclude,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
scalarFields: all.filter((c) => !c.type.isCollectionField),
|
|
33
|
+
collectionFields: all.filter((c) => c.type.isCollectionField),
|
|
34
|
+
};
|
|
35
|
+
}, [fieldSchema, detailInclude, detailExclude]);
|
|
36
|
+
const getEditFields = React.useCallback((children, opts = {}) => filterFields(children || inputSchema, {
|
|
37
|
+
include: opts.include || editInclude || formInclude,
|
|
38
|
+
exclude: opts.exclude || editExclude || formExclude,
|
|
39
|
+
}), [inputSchema, editInclude, editExclude, formInclude, formExclude]);
|
|
40
|
+
const getCreateFields = React.useCallback((children, opts = {}) => filterFields(children || inputSchema, {
|
|
41
|
+
include: opts.include || createInclude || formInclude,
|
|
42
|
+
exclude: opts.exclude || createExclude || formExclude,
|
|
43
|
+
}), [inputSchema, createInclude, createExclude, formInclude, formExclude]);
|
|
44
|
+
return { getListFields, getDetailFields, getEditFields, getCreateFields };
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MessageProps } from './types';
|
|
2
|
+
export type { MessageProps };
|
|
3
|
+
/**
|
|
4
|
+
* Renders a translatable string inline. The children text is the English source
|
|
5
|
+
* string and serves as both the translation key and the fallback value.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Message>Product Name</Message>
|
|
9
|
+
* <Message id="resources.products.actions.archive">Archive</Message>
|
|
10
|
+
* <Message context="verb">Archive</Message>
|
|
11
|
+
* <Message context="noun">Archive</Message>
|
|
12
|
+
* <Message comment="Appears in the confirmation dialog">Are you sure?</Message>
|
|
13
|
+
* <Message count={n}>{'Found {count, plural, one {# result} other {# results}}'}</Message>
|
|
14
|
+
*/
|
|
15
|
+
export declare const Message: ({ children, id, context, comment: _comment, vars }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslate } from '@strato-admin/ra-core';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a translatable string inline. The children text is the English source
|
|
5
|
+
* string and serves as both the translation key and the fallback value.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Message>Product Name</Message>
|
|
9
|
+
* <Message id="resources.products.actions.archive">Archive</Message>
|
|
10
|
+
* <Message context="verb">Archive</Message>
|
|
11
|
+
* <Message context="noun">Archive</Message>
|
|
12
|
+
* <Message comment="Appears in the confirmation dialog">Are you sure?</Message>
|
|
13
|
+
* <Message count={n}>{'Found {count, plural, one {# result} other {# results}}'}</Message>
|
|
14
|
+
*/
|
|
15
|
+
export const Message = ({ children, id, context, comment: _comment, vars }) => {
|
|
16
|
+
const translate = useTranslate();
|
|
17
|
+
const key = id ?? (context ? `${context}\x04${children}` : children);
|
|
18
|
+
return _jsx(_Fragment, { children: translate(key, { ...vars, _: children }) });
|
|
19
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MessageProps } from './types';
|
|
2
|
+
export interface RecordMessageProps extends MessageProps {
|
|
3
|
+
/** Explicit record to use instead of the one from context. */
|
|
4
|
+
record?: Record<string, any>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Renders a translatable string with all fields of the current record available
|
|
8
|
+
* as ICU variables. Must be used inside a record context (Detail, Edit, etc.).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <RecordMessage>{'Product: {name}'}</RecordMessage>
|
|
12
|
+
* <RecordMessage>{'Order #{id} — {status}'}</RecordMessage>
|
|
13
|
+
*/
|
|
14
|
+
export declare const RecordMessage: ({ children, id, context, comment: _comment, record, vars }: RecordMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslate, useRecordContext } from '@strato-admin/ra-core';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a translatable string with all fields of the current record available
|
|
5
|
+
* as ICU variables. Must be used inside a record context (Detail, Edit, etc.).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <RecordMessage>{'Product: {name}'}</RecordMessage>
|
|
9
|
+
* <RecordMessage>{'Order #{id} — {status}'}</RecordMessage>
|
|
10
|
+
*/
|
|
11
|
+
export const RecordMessage = ({ children, id, context, comment: _comment, record, vars }) => {
|
|
12
|
+
const translate = useTranslate();
|
|
13
|
+
const resolvedRecord = useRecordContext({ record }) ?? {};
|
|
14
|
+
const key = id ?? (context ? `${context}\x04${children}` : children);
|
|
15
|
+
return _jsx(_Fragment, { children: translate(key, { ...resolvedRecord, ...vars, _: children }) });
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface MessageProps {
|
|
2
|
+
children: string;
|
|
3
|
+
/**
|
|
4
|
+
* Explicit stable message ID. Used directly as the lookup key — bypasses
|
|
5
|
+
* hashing entirely. Takes priority over `context`. Written as `#. id: <id>`
|
|
6
|
+
* in PO files so translators see the stable identifier alongside the source text.
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Disambiguation context. Prepended to the message before hashing so that
|
|
11
|
+
* the same string in different contexts produces different translation entries.
|
|
12
|
+
* Ignored when `id` is provided. Stored as `msgctxt` in PO files.
|
|
13
|
+
*/
|
|
14
|
+
context?: string;
|
|
15
|
+
/** Translator note written into the PO file as a `#` comment. Ignored at runtime. */
|
|
16
|
+
comment?: string;
|
|
17
|
+
/** ICU variables substituted into the message at runtime. */
|
|
18
|
+
vars?: Record<string, any>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ export * from './form';
|
|
|
10
10
|
export * from './layout';
|
|
11
11
|
export * from './theme';
|
|
12
12
|
export * from './button';
|
|
13
|
+
export * from './i18n';
|
|
13
14
|
export * from './Admin';
|
|
15
|
+
export * from './Settings';
|
|
14
16
|
export { default as RecordLink } from './RecordLink';
|
|
15
17
|
export * from './RecordLink';
|
|
16
18
|
export { Admin, type AdminProps } from './Admin';
|
|
@@ -18,5 +20,7 @@ export { Form, type FormProps } from './form';
|
|
|
18
20
|
export { List, type ListProps } from './list';
|
|
19
21
|
export { Create, type CreateProps } from './create';
|
|
20
22
|
export { Edit, type EditProps } from './edit';
|
|
21
|
-
export { Show, type ShowProps } from './detail';
|
|
23
|
+
export { Detail, type DetailProps, Detail as Show, type DetailProps as ShowProps } from './detail';
|
|
22
24
|
export { type InputProps } from './input';
|
|
25
|
+
export { Ready, AppLayout, TopNavigation } from './layout';
|
|
26
|
+
export { Button } from './button';
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,9 @@ export * from './form';
|
|
|
10
10
|
export * from './layout';
|
|
11
11
|
export * from './theme';
|
|
12
12
|
export * from './button';
|
|
13
|
+
export * from './i18n';
|
|
13
14
|
export * from './Admin';
|
|
15
|
+
export * from './Settings';
|
|
14
16
|
export { default as RecordLink } from './RecordLink';
|
|
15
17
|
export * from './RecordLink';
|
|
16
18
|
// Explicitly export themed components to resolve ambiguity with strato-core (ra-core) re-exports
|
|
@@ -19,4 +21,6 @@ export { Form } from './form';
|
|
|
19
21
|
export { List } from './list';
|
|
20
22
|
export { Create } from './create';
|
|
21
23
|
export { Edit } from './edit';
|
|
22
|
-
export { Show } from './detail';
|
|
24
|
+
export { Detail, Detail as Show } from './detail';
|
|
25
|
+
export { Ready, AppLayout, TopNavigation } from './layout';
|
|
26
|
+
export { Button } from './button';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeEditorProps as CloudscapeAttributeEditorProps } from '@cloudscape-design/components/attribute-editor';
|
|
3
|
+
import { InputProps } from './types';
|
|
4
|
+
export interface ArrayInputItemProps {
|
|
5
|
+
source: string;
|
|
6
|
+
label?: string | false;
|
|
7
|
+
field?: React.ComponentType<any>;
|
|
8
|
+
validate?: any;
|
|
9
|
+
defaultValue?: any;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Item: (_props: ArrayInputItemProps) => null;
|
|
13
|
+
export interface ArrayInputProps extends Omit<InputProps, 'source'> {
|
|
14
|
+
source?: string;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
addButtonText?: string;
|
|
17
|
+
removeButtonText?: string;
|
|
18
|
+
empty?: React.ReactNode;
|
|
19
|
+
disableAddButton?: boolean;
|
|
20
|
+
hideAddButton?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optionally specifies the layout of the attributes.
|
|
23
|
+
*/
|
|
24
|
+
gridLayout?: ReadonlyArray<CloudscapeAttributeEditorProps.GridLayout>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ArrayInput component that uses Cloudscape's AttributeEditor to edit arrays of objects.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ArrayInput: {
|
|
30
|
+
(props: ArrayInputProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Item: (_props: ArrayInputItemProps) => null;
|
|
32
|
+
};
|
|
33
|
+
export default ArrayInput;
|