xmlui 0.7.27 → 0.7.28
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/{apiInterceptorWorker-Ca5HMlfW.mjs → apiInterceptorWorker-FalV8U3I.mjs} +1 -1
- package/dist/{index-BMOK5q0U.mjs → index-CTUFRo8v.mjs} +8230 -8042
- package/dist/scripts/src/components/APICall/APICall.js +31 -29
- package/dist/scripts/src/components/AppHeader/AppHeader.js +4 -4
- package/dist/scripts/src/components/Badge/Badge.js +2 -2
- package/dist/scripts/src/components/Bookmark/Bookmark.js +7 -7
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +2 -2
- package/dist/scripts/src/components/Button/Button.js +1 -7
- package/dist/scripts/src/components/Carousel/Carousel.js +3 -1
- package/dist/scripts/src/components/Checkbox/Checkbox.js +0 -1
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +1 -1
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +2 -1
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +13 -4
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +18 -8
- package/dist/scripts/src/components/FlowLayout/FlowLayoutNative.js +5 -1
- package/dist/scripts/src/components/Form/Form.js +53 -17
- package/dist/scripts/src/components/Form/FormNative.js +9 -1
- package/dist/scripts/src/components/FormItem/FormItem.js +11 -5
- package/dist/scripts/src/components/FormItem/FormItemNative.js +6 -1
- package/dist/scripts/src/components/Heading/Heading.js +23 -4
- package/dist/scripts/src/components/Heading/HeadingNative.js +9 -4
- package/dist/scripts/src/components/Icon/Icon.js +6 -2
- package/dist/scripts/src/components/Icon/IconNative.js +2 -2
- package/dist/scripts/src/components/Image/Image.js +5 -1
- package/dist/scripts/src/components/Items/Items.js +4 -2
- package/dist/scripts/src/components/Items/ItemsNative.js +1 -3
- package/dist/scripts/src/components/Link/Link.js +13 -4
- package/dist/scripts/src/components/List/List.js +22 -5
- package/dist/scripts/src/components/Markdown/Markdown.js +8 -4
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +12 -6
- package/dist/scripts/src/components/NavLink/NavLink.js +28 -10
- package/dist/scripts/src/components/NoResult/NoResult.js +6 -2
- package/dist/scripts/src/components/NumberBox/NumberBox.js +22 -6
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +5 -1
- package/dist/scripts/src/components/Spinner/Spinner.js +10 -2
- package/dist/scripts/src/components/Splitter/Splitter.js +38 -13
- package/dist/scripts/src/components/Stack/Stack.js +39 -11
- package/dist/scripts/src/components/StickyBox/StickyBox.js +7 -2
- package/dist/scripts/src/components/Switch/Switch.js +0 -1
- package/dist/scripts/src/components/Table/Table.js +35 -18
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +13 -4
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +15 -22
- package/dist/scripts/src/components/Tabs/Tabs.js +8 -3
- package/dist/scripts/src/components/Text/Text.js +20 -8
- package/dist/scripts/src/components/TextArea/TextArea.js +30 -13
- package/dist/scripts/src/components/Theme/Theme.js +6 -2
- package/dist/scripts/src/components/abstractions.js +14 -3
- package/dist/scripts/src/components-core/TableOfContentsContext.js +57 -17
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +9161 -5514
- package/dist/xmlui-metadata.umd.js +17 -17
- package/dist/xmlui-standalone.umd.js +165 -165
- package/dist/xmlui.mjs +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
6
6
|
const renderers_1 = require("../../components-core/renderers");
|
|
7
7
|
const metadata_helpers_1 = require("../../components/metadata-helpers");
|
|
8
|
+
const abstractions_1 = require("../abstractions");
|
|
8
9
|
const APICallNative_1 = require("./APICallNative");
|
|
9
10
|
const COMP = "APICall";
|
|
10
11
|
exports.APICallMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -12,66 +13,67 @@ exports.APICallMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
12
13
|
`is similar in nature to the \`DataSource\` component which retrieves data from the backend.`,
|
|
13
14
|
props: {
|
|
14
15
|
method: {
|
|
15
|
-
description:
|
|
16
|
-
`HTTP methods are available: \`post\`, \`put\`, and \`delete\`.`,
|
|
16
|
+
description: "The method of data manipulation can be done via setting this property.",
|
|
17
17
|
valueType: "string",
|
|
18
|
+
availableValues: abstractions_1.httpMethodNames,
|
|
19
|
+
defaultValue: "get",
|
|
18
20
|
},
|
|
19
21
|
url: {
|
|
20
|
-
description:
|
|
22
|
+
description: "Use this property to set the URL to send data to.",
|
|
21
23
|
isRequired: true,
|
|
22
24
|
valueType: "string",
|
|
23
25
|
},
|
|
24
26
|
rawBody: {
|
|
25
|
-
description:
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
description: "This property sets the request body to the value provided here without any conversion. " +
|
|
28
|
+
"Use the * \`body\` property if you want the object sent in JSON. When you define " +
|
|
29
|
+
"\`body\` and \`rawBody\`, the latest one prevails.",
|
|
28
30
|
valueType: "string",
|
|
29
31
|
},
|
|
30
32
|
body: {
|
|
31
|
-
description:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
description: "This property sets the request body. The object you pass here will be serialized to " +
|
|
34
|
+
"JSON when sending the request. Use the \`rawBody\` property to send another request " +
|
|
35
|
+
"body using its native format. When you define \`body\` and \`rawBody\`, the latest " +
|
|
36
|
+
"one prevails.",
|
|
35
37
|
valueType: "string",
|
|
36
38
|
},
|
|
37
39
|
queryParams: {
|
|
38
|
-
description:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
description: "This property sets the query parameters for the request. The object you pass here will " +
|
|
41
|
+
"be serialized to a query string and appended to the request URL. You can specify key " +
|
|
42
|
+
"and value pairs where the key is the name of a particular query parameter and the value " +
|
|
43
|
+
"is that parameter's value.",
|
|
42
44
|
},
|
|
43
45
|
headers: {
|
|
44
|
-
description:
|
|
45
|
-
|
|
46
|
+
description: "You can define request header values as key and value pairs, where the key is the ID of " +
|
|
47
|
+
"the particular header and the value is that header's value.",
|
|
46
48
|
},
|
|
47
49
|
confirmTitle: {
|
|
48
|
-
description:
|
|
50
|
+
description: "This optional string sets the title in the confirmation dialog that is displayed before " +
|
|
49
51
|
`the \`${COMP}\` is executed.`,
|
|
50
52
|
valueType: "string",
|
|
51
53
|
},
|
|
52
54
|
confirmMessage: {
|
|
53
|
-
description:
|
|
55
|
+
description: "This optional string sets the message in the confirmation dialog that is displayed before " +
|
|
54
56
|
`the \`${COMP}\` is executed.`,
|
|
55
57
|
valueType: "string",
|
|
56
58
|
},
|
|
57
59
|
confirmButtonLabel: {
|
|
58
|
-
description:
|
|
60
|
+
description: "This optional string property enables the customization of the submit button in the " +
|
|
59
61
|
`confirmation dialog that is displayed before the \`${COMP}\` is executed.`,
|
|
60
62
|
valueType: "string",
|
|
61
63
|
},
|
|
62
64
|
inProgressNotificationMessage: {
|
|
63
|
-
description:
|
|
64
|
-
|
|
65
|
+
description: "This property customizes the message that is displayed in a toast while the API operation " +
|
|
66
|
+
"is in progress.",
|
|
65
67
|
valueType: "string",
|
|
66
68
|
},
|
|
67
69
|
errorNotificationMessage: {
|
|
68
|
-
description:
|
|
69
|
-
|
|
70
|
+
description: "This property defines the message to display automatically when the operation results " +
|
|
71
|
+
"in an error.",
|
|
70
72
|
valueType: "string",
|
|
71
73
|
},
|
|
72
74
|
completedNotificationMessage: {
|
|
73
|
-
description:
|
|
74
|
-
|
|
75
|
+
description: "This property defines the message to display automatically when the operation has " +
|
|
76
|
+
"been completed.",
|
|
75
77
|
valueType: "string",
|
|
76
78
|
},
|
|
77
79
|
payloadType: (0, metadata_helpers_1.dInternal)(),
|
|
@@ -81,14 +83,14 @@ exports.APICallMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
81
83
|
getOptimisticValue: (0, metadata_helpers_1.dInternal)(),
|
|
82
84
|
},
|
|
83
85
|
events: {
|
|
84
|
-
beforeRequest: (0, ComponentDefs_1.d)(
|
|
85
|
-
|
|
86
|
-
success: (0, ComponentDefs_1.d)(
|
|
86
|
+
beforeRequest: (0, ComponentDefs_1.d)("This event fires before the request is sent. Returning an explicit boolean" +
|
|
87
|
+
"\`false\` value will prevent the request from being sent."),
|
|
88
|
+
success: (0, ComponentDefs_1.d)("This event fires when a request results in a success."),
|
|
87
89
|
/**
|
|
88
90
|
* This event fires when a request results in an error.
|
|
89
91
|
* @descriptionRef
|
|
90
92
|
*/
|
|
91
|
-
error: (0, ComponentDefs_1.d)(
|
|
93
|
+
error: (0, ComponentDefs_1.d)("This event fires when a request results in an error."),
|
|
92
94
|
progress: (0, metadata_helpers_1.dInternal)(),
|
|
93
95
|
},
|
|
94
96
|
contextVars: {
|
|
@@ -19,10 +19,10 @@ exports.AppHeaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
19
19
|
description: `\`${COMP}\` is a placeholder within \`App\` to define a custom application header.`,
|
|
20
20
|
props: {
|
|
21
21
|
profileMenuTemplate: (0, metadata_helpers_1.dComponent)(`This property makes the profile menu slot of the \`${COMP}\` component customizable.`),
|
|
22
|
-
logoTemplate: (0, metadata_helpers_1.dComponent)(
|
|
23
|
-
|
|
24
|
-
titleTemplate: (0, metadata_helpers_1.dComponent)(
|
|
25
|
-
|
|
22
|
+
logoTemplate: (0, metadata_helpers_1.dComponent)("This property defines the template to use for the logo. With this property, you can " +
|
|
23
|
+
"construct your custom logo instead of using a single image."),
|
|
24
|
+
titleTemplate: (0, metadata_helpers_1.dComponent)("This property defines the template to use for the title. With this property, you can " +
|
|
25
|
+
"construct your custom title instead of using a single image."),
|
|
26
26
|
title: {
|
|
27
27
|
description: "Title for the application logo",
|
|
28
28
|
valueType: "string",
|
|
@@ -22,8 +22,8 @@ exports.BadgeMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
22
22
|
isRequired: true,
|
|
23
23
|
},
|
|
24
24
|
variant: {
|
|
25
|
-
description:
|
|
26
|
-
|
|
25
|
+
description: "Modifies the shape of the component. Comes in the regular \`badge\` variant or the \`pill\` variant " +
|
|
26
|
+
"with fully rounded corners.",
|
|
27
27
|
type: "string",
|
|
28
28
|
availableValues: BadgeNative_1.badgeVariantValues,
|
|
29
29
|
defaultValue: "badge",
|
|
@@ -7,24 +7,24 @@ const renderers_1 = require("../../components-core/renderers");
|
|
|
7
7
|
const BookmarkNative_1 = require("./BookmarkNative");
|
|
8
8
|
const COMP = "Bookmark";
|
|
9
9
|
exports.BookmarkMd = (0, ComponentDefs_1.createMetadata)({
|
|
10
|
-
description:
|
|
11
|
-
|
|
10
|
+
description: "As its name suggests, this component places a bookmark into its parent component's view. The " +
|
|
11
|
+
"component has an \`id\` that you can use in links to navigate (scroll to) the bookmark's location.",
|
|
12
12
|
opaque: true,
|
|
13
13
|
props: {
|
|
14
14
|
uid: {
|
|
15
|
-
description:
|
|
16
|
-
|
|
15
|
+
description: "The unique identifier of the bookmark. You can use this identifier in links to navigate " +
|
|
16
|
+
"to this component's location.",
|
|
17
17
|
valueType: "string",
|
|
18
18
|
},
|
|
19
19
|
level: {
|
|
20
|
-
description:
|
|
21
|
-
|
|
20
|
+
description: "The level of the bookmark. The level is used to determine the bookmark's " +
|
|
21
|
+
"position in the table of contents.",
|
|
22
22
|
valueType: "number",
|
|
23
23
|
defaultValue: 1,
|
|
24
24
|
},
|
|
25
25
|
title: {
|
|
26
26
|
description: "Defines the text to display the bookmark in the table of contents. If this property is " +
|
|
27
|
-
"empty, the text falls back to the value of
|
|
27
|
+
"empty, the text falls back to the value of \`id\`.",
|
|
28
28
|
valueType: "string",
|
|
29
29
|
},
|
|
30
30
|
omitFromToc: {
|
|
@@ -12,8 +12,8 @@ const Bookmark = ({ uid, level = exports.defaultProps.level, children, title, om
|
|
|
12
12
|
const elementRef = (0, react_1.useRef)(null);
|
|
13
13
|
const tableOfContentsContext = (0, react_1.useContext)(TableOfContentsContext_1.TableOfContentsContext);
|
|
14
14
|
const registerHeading = tableOfContentsContext === null || tableOfContentsContext === void 0 ? void 0 : tableOfContentsContext.registerHeading;
|
|
15
|
-
const observeIntersection = tableOfContentsContext === null || tableOfContentsContext === void 0 ? void 0 : tableOfContentsContext.
|
|
16
|
-
(0, react_1.
|
|
15
|
+
const observeIntersection = tableOfContentsContext === null || tableOfContentsContext === void 0 ? void 0 : tableOfContentsContext.hasTableOfContents;
|
|
16
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
17
17
|
var _a, _b;
|
|
18
18
|
if (observeIntersection && elementRef.current && uid && !omitFromToc) {
|
|
19
19
|
return registerHeading === null || registerHeading === void 0 ? void 0 : registerHeading({
|
|
@@ -15,7 +15,7 @@ const IconNative_1 = require("../Icon/IconNative");
|
|
|
15
15
|
const ButtonNative_1 = require("./ButtonNative");
|
|
16
16
|
const COMP = "Button";
|
|
17
17
|
exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
18
|
-
description:
|
|
18
|
+
description: "Button is an interactive element that triggers an action when clicked.",
|
|
19
19
|
status: "stable",
|
|
20
20
|
props: {
|
|
21
21
|
autoFocus: {
|
|
@@ -50,13 +50,11 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
50
50
|
`specified and an icon is set, the ${COMP} will modify its styling to look like a ` +
|
|
51
51
|
`small icon button. When the ${COMP} has nested children, it will display them and ` +
|
|
52
52
|
`ignore the value of the \`label\` prop.`,
|
|
53
|
-
isRequired: false,
|
|
54
53
|
type: "string",
|
|
55
54
|
},
|
|
56
55
|
type: {
|
|
57
56
|
description: `This optional string describes how the ${COMP} appears in an HTML context. You ` +
|
|
58
57
|
`rarely need to set this property explicitly.`,
|
|
59
|
-
isRequired: false,
|
|
60
58
|
availableValues: abstractions_1.buttonTypesMd,
|
|
61
59
|
valueType: "string",
|
|
62
60
|
defaultValue: ButtonNative_1.propDefaults.type,
|
|
@@ -64,7 +62,6 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
64
62
|
enabled: {
|
|
65
63
|
description: `The value of this property indicates whether the button accepts actions (\`true\`) ` +
|
|
66
64
|
`or does not react to them (\`false\`).`,
|
|
67
|
-
isRequired: false,
|
|
68
65
|
type: "boolean",
|
|
69
66
|
defaultValue: true,
|
|
70
67
|
},
|
|
@@ -73,12 +70,10 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
73
70
|
description: `This string value denotes an icon name. The framework will render an icon if XMLUI ` +
|
|
74
71
|
`recognizes the icon by its name. If no label is specified and an icon is set, the ${COMP} ` +
|
|
75
72
|
`displays only that icon.`,
|
|
76
|
-
isRequired: false,
|
|
77
73
|
type: "string",
|
|
78
74
|
},
|
|
79
75
|
iconPosition: {
|
|
80
76
|
description: `This optional string determines the location of the icon in the ${COMP}.`,
|
|
81
|
-
isRequired: false,
|
|
82
77
|
availableValues: abstractions_1.iconPositionMd,
|
|
83
78
|
type: "string",
|
|
84
79
|
defaultValue: ButtonNative_1.propDefaults.iconPosition,
|
|
@@ -86,7 +81,6 @@ exports.ButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
86
81
|
contentPosition: {
|
|
87
82
|
description: `This optional value determines how the label and icon (or nested children) should be placed` +
|
|
88
83
|
`inside the ${COMP} component.`,
|
|
89
|
-
isRequired: false,
|
|
90
84
|
availableValues: abstractions_1.alignmentOptionMd,
|
|
91
85
|
type: "string",
|
|
92
86
|
defaultValue: ButtonNative_1.propDefaults.contentPosition,
|
|
@@ -19,7 +19,9 @@ exports.CarouselMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
19
19
|
`custom slides) like a carousel.`,
|
|
20
20
|
props: {
|
|
21
21
|
orientation: {
|
|
22
|
-
description: "This property indicates the orientation of the carousel. The `horizontal`
|
|
22
|
+
description: "This property indicates the orientation of the carousel. The `horizontal` " +
|
|
23
|
+
"value indicates that the carousel moves horizontally, and the `vertical` " +
|
|
24
|
+
"value indicates that the carousel moves vertically.",
|
|
23
25
|
availableValues: abstractions_1.orientationOptionMd,
|
|
24
26
|
valueType: "string",
|
|
25
27
|
defaultValue: CarouselNative_1.defaultProps.orientation,
|
|
@@ -36,7 +36,6 @@ exports.CheckboxMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
events: {
|
|
39
|
-
click: (0, metadata_helpers_1.dClick)(COMP),
|
|
40
39
|
gotFocus: (0, metadata_helpers_1.dGotFocus)(COMP),
|
|
41
40
|
lostFocus: (0, metadata_helpers_1.dLostFocus)(COMP),
|
|
42
41
|
didChange: (0, metadata_helpers_1.dDidChange)(COMP),
|
|
@@ -13,7 +13,7 @@ const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
|
13
13
|
const ColorPicker_module_scss_1 = __importDefault(require("./ColorPicker.module.scss"));
|
|
14
14
|
const COMP = "ColorPicker";
|
|
15
15
|
exports.ColorPickerMd = (0, ComponentDefs_1.createMetadata)({
|
|
16
|
-
description:
|
|
16
|
+
description: "This component allows the user to select a color with the browser's default color picker control.",
|
|
17
17
|
props: {
|
|
18
18
|
initialValue: (0, metadata_helpers_1.dInitialValue)(),
|
|
19
19
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
@@ -21,7 +21,8 @@ exports.DropdownMenuMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
21
21
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
22
22
|
triggerTemplate: (0, metadata_helpers_1.dTriggerTemplate)(DDMCOMP),
|
|
23
23
|
alignment: {
|
|
24
|
-
description:
|
|
24
|
+
description: "This property allows you to determine the alignment of the dropdown panel with " +
|
|
25
|
+
"the displayed menu items.",
|
|
25
26
|
valueType: "string",
|
|
26
27
|
availableValues: abstractions_1.alignmentOptionMd,
|
|
27
28
|
defaultValue: DropdownMenuNative_1.defaultDropdownMenuProps.alignment,
|
|
@@ -15,10 +15,19 @@ exports.FileUploadDropZoneMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
15
15
|
description: `The \`${COMP}\` component allows users to upload files to a web application by dragging ` +
|
|
16
16
|
`and dropping files from their local file system onto a designated area within the UI.`,
|
|
17
17
|
props: {
|
|
18
|
-
text:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
text: {
|
|
19
|
+
description: "With this property, you can change the default text to display when files " +
|
|
20
|
+
"are dragged over the drop zone.",
|
|
21
|
+
defaultValue: "Drop files here",
|
|
22
|
+
type: "string",
|
|
23
|
+
},
|
|
24
|
+
allowPaste: {
|
|
25
|
+
description: "This property indicates if the drop zone accepts files pasted from the " +
|
|
26
|
+
"clipboard (\`true\`) or " +
|
|
27
|
+
"only dragged files (\`false\`).",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
defaultValue: true,
|
|
30
|
+
},
|
|
22
31
|
enabled: (0, ComponentDefs_1.d)(`If set to \`false\`, the drop zone will be disabled and users will not be able to upload files.`, null, "boolean", true),
|
|
23
32
|
},
|
|
24
33
|
events: {
|
|
@@ -14,15 +14,25 @@ const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
|
14
14
|
const FlowLayoutNative_1 = require("./FlowLayoutNative");
|
|
15
15
|
const COMP = "FlowLayout";
|
|
16
16
|
exports.FlowLayoutMd = (0, ComponentDefs_1.createMetadata)({
|
|
17
|
-
description:
|
|
18
|
-
|
|
17
|
+
description: "This layout component is used to position content in rows with an auto wrapping feature: if " +
|
|
18
|
+
"the length of the items exceed the available space the layout will wrap into a new line.",
|
|
19
19
|
props: {
|
|
20
|
-
gap:
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
gap: {
|
|
21
|
+
description: `This property defines the gap between items in the same row and between rows. The ${COMP} ` +
|
|
22
|
+
`component creates a new row when an item is about to overflow the current row.`,
|
|
23
|
+
type: "string",
|
|
24
|
+
defaultValue: "$gap-normal",
|
|
25
|
+
},
|
|
26
|
+
columnGap: {
|
|
27
|
+
description: "The \`columnGap\` property specifies the space between items in a single row; it overrides " +
|
|
28
|
+
"the \`gap\` value.",
|
|
29
|
+
defaultValue: FlowLayoutNative_1.defaultProps.columnGap,
|
|
30
|
+
},
|
|
31
|
+
rowGap: {
|
|
32
|
+
description: `The \`rowGap\` property specifies the space between the ${COMP} rows; it overrides ` +
|
|
33
|
+
`the \`gap\` value.`,
|
|
34
|
+
defaultValue: FlowLayoutNative_1.defaultProps.rowGap,
|
|
35
|
+
},
|
|
26
36
|
shadow: (0, ComponentDefs_1.d)(`${COMP} does not support shadow, we're waiting for a decent solution.`),
|
|
27
37
|
},
|
|
28
38
|
themeVars: (0, themeVars_1.parseScssVar)(FlowLayout_module_scss_1.default.themeVars),
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.FlowLayout = exports.FlowItemWrapper = exports.FlowItemBreak = void 0;
|
|
17
|
+
exports.FlowLayout = exports.defaultProps = exports.FlowItemWrapper = exports.FlowItemBreak = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const classnames_1 = __importDefault(require("classnames"));
|
|
@@ -97,6 +97,10 @@ exports.FlowItemWrapper = (0, react_1.forwardRef)(function FlowItemWrapper(_a, r
|
|
|
97
97
|
[FlowLayout_module_scss_1.default.starSized]: isStarSizing,
|
|
98
98
|
}), ref: ref, children: children }), isStarSizing && (0, jsx_runtime_1.jsx)(exports.FlowItemBreak, {})] }));
|
|
99
99
|
});
|
|
100
|
+
exports.defaultProps = {
|
|
101
|
+
columnGap: "$gap-normal",
|
|
102
|
+
rowGap: "$gap-normal",
|
|
103
|
+
};
|
|
100
104
|
exports.FlowLayout = (0, react_1.forwardRef)(function FlowLayout({ style, columnGap = 0, rowGap = 0, children }, forwardedRef) {
|
|
101
105
|
const [numberOfChildren, setNumberOfChildren] = (0, react_1.useState)(0);
|
|
102
106
|
const safeColumnGap = numberOfChildren === 1 ? 0 : columnGap;
|
|
@@ -19,24 +19,60 @@ exports.FormMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
19
19
|
`(or change) data and submit it to the app (a server) for further processing.`,
|
|
20
20
|
props: {
|
|
21
21
|
buttonRowTemplate: (0, metadata_helpers_1.dComponent)(`This property allows defining a custom component to display the buttons at the bottom of the form.`),
|
|
22
|
-
itemLabelPosition:
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
itemLabelPosition: {
|
|
23
|
+
description: `This property sets the position of the item labels within the form.` +
|
|
24
|
+
`Individual \`FormItem\` instances can override this property.`,
|
|
25
|
+
availableValues: abstractions_1.labelPositionMd,
|
|
26
|
+
type: "string",
|
|
27
|
+
defaultValue: FormNative_1.defaultProps.itemLabelPosition,
|
|
28
|
+
},
|
|
29
|
+
itemLabelWidth: {
|
|
30
|
+
description: `This property sets the width of the item labels within the form. Individual ` +
|
|
31
|
+
`\`FormItem\` instances can override this property.`,
|
|
32
|
+
type: "string",
|
|
33
|
+
},
|
|
34
|
+
itemLabelBreak: {
|
|
35
|
+
description: `This boolean value indicates if form item labels can be split into multiple ` +
|
|
36
|
+
`lines if it would overflow the available label width. Individual \`FormItem\` ` +
|
|
37
|
+
`instances can override this property.`,
|
|
38
|
+
type: "boolean",
|
|
39
|
+
defaultValue: FormNative_1.defaultProps.itemLabelBreak,
|
|
40
|
+
},
|
|
41
|
+
keepModalOpenOnSubmit: {
|
|
42
|
+
description: "This property prevents the modal from closing when the form is submitted.",
|
|
43
|
+
type: "boolean",
|
|
44
|
+
defaultValue: FormNative_1.defaultProps.keepModalOpenOnSubmit,
|
|
45
|
+
},
|
|
46
|
+
data: {
|
|
47
|
+
description: `This property sets the initial value of the form's data structure. The form infrastructure ` +
|
|
48
|
+
`uses this value to set the initial state of form items within the form.`,
|
|
49
|
+
},
|
|
50
|
+
cancelLabel: {
|
|
51
|
+
description: "This property defines the label of the Cancel button.",
|
|
52
|
+
type: "string",
|
|
53
|
+
defaultValue: FormNative_1.defaultProps.cancelLabel,
|
|
54
|
+
},
|
|
55
|
+
saveLabel: {
|
|
56
|
+
description: `This property defines the label of the Save button.`,
|
|
57
|
+
type: "string",
|
|
58
|
+
defaultValue: FormNative_1.defaultProps.saveLabel,
|
|
59
|
+
},
|
|
60
|
+
saveInProgressLabel: {
|
|
61
|
+
description: "This property defines the label of the Save button to display during the " +
|
|
62
|
+
"form data submit (save) operation.",
|
|
63
|
+
type: "string",
|
|
64
|
+
defaultValue: FormNative_1.defaultProps.saveInProgressLabel,
|
|
65
|
+
},
|
|
66
|
+
swapCancelAndSave: {
|
|
67
|
+
description: `By default, the Cancel button is to the left of the Save button. Set this property to ` +
|
|
68
|
+
`\`true\` to swap them or \`false\` to keep their original location.`,
|
|
69
|
+
type: "boolean",
|
|
70
|
+
},
|
|
38
71
|
submitUrl: (0, ComponentDefs_1.d)(`URL to submit the form data.`),
|
|
39
|
-
submitMethod:
|
|
72
|
+
submitMethod: {
|
|
73
|
+
description: "This property sets the HTTP method to use when submitting the form data. If not " +
|
|
74
|
+
"defined, `put` is used when the form has initial data; otherwise, `post`.",
|
|
75
|
+
},
|
|
40
76
|
enabled: (0, ComponentDefs_1.d)(`Whether the form is enabled or not. The default value is \`true\`.`),
|
|
41
77
|
_data_url: (0, metadata_helpers_1.dInternal)("when we have an api bound data prop, we inject the url here"),
|
|
42
78
|
},
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getByPath = void 0;
|
|
15
|
+
exports.defaultProps = exports.getByPath = void 0;
|
|
16
16
|
exports.FormWithContextVar = FormWithContextVar;
|
|
17
17
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
const react_1 = require("react");
|
|
@@ -172,6 +172,14 @@ const initialState = {
|
|
|
172
172
|
interactionFlags: {},
|
|
173
173
|
submitInProgress: false,
|
|
174
174
|
};
|
|
175
|
+
exports.defaultProps = {
|
|
176
|
+
cancelLabel: "Cancel",
|
|
177
|
+
saveLabel: "Save",
|
|
178
|
+
saveInProgressLabel: "Saving...",
|
|
179
|
+
itemLabelPosition: "top",
|
|
180
|
+
itemLabelBreak: true,
|
|
181
|
+
keepModalOpenOnSubmit: false,
|
|
182
|
+
};
|
|
175
183
|
const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialValue = constants_1.EMPTY_OBJECT, children, style, enabled = true, cancelLabel = "Cancel", saveLabel = "Save", saveInProgressLabel = "Saving...", swapCancelAndSave, onSubmit, onCancel, onReset, buttonRow, id, registerComponentApi, itemLabelBreak = true, itemLabelWidth, itemLabelPosition = "top", keepModalOpenOnSubmit = false, }, ref) {
|
|
176
184
|
const formRef = (0, react_1.useRef)(null);
|
|
177
185
|
(0, react_1.useImperativeHandle)(ref, () => formRef.current);
|
|
@@ -31,15 +31,21 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
31
31
|
`the \`${COMP}\` may be associated with a particular property within the encapsulating \`Form\` ` +
|
|
32
32
|
`component's data.`,
|
|
33
33
|
props: {
|
|
34
|
-
bindTo:
|
|
35
|
-
`
|
|
36
|
-
|
|
34
|
+
bindTo: {
|
|
35
|
+
description: `This property binds a particular input field to one of the attributes of the \`Form\` data. ` +
|
|
36
|
+
`It names the property of the form's \`data\` data to get the input's initial value.` +
|
|
37
|
+
`When the field is saved, its value will be stored in the \`data\` property with this name.`,
|
|
38
|
+
},
|
|
37
39
|
autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
|
|
38
40
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
39
41
|
labelPosition: (0, metadata_helpers_1.dLabelPosition)(),
|
|
40
42
|
labelWidth: (0, ComponentDefs_1.d)(`This property sets the width of the item label.`),
|
|
41
|
-
labelBreak:
|
|
42
|
-
`
|
|
43
|
+
labelBreak: {
|
|
44
|
+
description: `This boolean value indicates if the label can be split into multiple lines if it would ` +
|
|
45
|
+
`overflow the available label width.`,
|
|
46
|
+
type: "boolean",
|
|
47
|
+
defaultValue: FormItemNative_1.defaultProps.labelBreak,
|
|
48
|
+
},
|
|
43
49
|
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
44
50
|
type: (0, ComponentDefs_1.d)(`This property is used to determine the specific input control the FormItem will wrap ` +
|
|
45
51
|
`around. Note that the control names start with a lowercase letter and map to input ` +
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.FormItem = void 0;
|
|
14
|
+
exports.FormItem = exports.defaultProps = void 0;
|
|
15
15
|
exports.CustomFormItem = CustomFormItem;
|
|
16
16
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
17
|
const react_1 = require("react");
|
|
@@ -38,6 +38,11 @@ const HelperText_1 = require("./HelperText");
|
|
|
38
38
|
const DEFAULT_LABEL_POSITIONS = {
|
|
39
39
|
checkbox: "end",
|
|
40
40
|
};
|
|
41
|
+
exports.defaultProps = {
|
|
42
|
+
type: "text",
|
|
43
|
+
labelBreak: true,
|
|
44
|
+
enabled: true,
|
|
45
|
+
};
|
|
41
46
|
exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
42
47
|
var { style, bindTo, type = "text", label, enabled = true, labelPosition, labelWidth, labelBreak = true, children, validations, onValidate, customValidationsDebounce, validationMode, registerComponentApi, maxTextLength, inputRenderer } = _a, rest = __rest(_a, ["style", "bindTo", "type", "label", "enabled", "labelPosition", "labelWidth", "labelBreak", "children", "validations", "onValidate", "customValidationsDebounce", "validationMode", "registerComponentApi", "maxTextLength", "inputRenderer"]);
|
|
43
48
|
const labelWidthValue = (0, FormContext_1.useFormContextPart)((value) => labelWidth || value.itemLabelWidth);
|
|
@@ -29,19 +29,32 @@ const VALUE_DESC = (0, ComponentDefs_1.d)(`This property determines the text dis
|
|
|
29
29
|
const MAX_LINES_DESC = (0, ComponentDefs_1.d)(`This property determines the maximum number of lines the component can wrap to. If there is ` +
|
|
30
30
|
`not enough space for all of the text, the component wraps the text up to as many ` +
|
|
31
31
|
`lines as specified.`);
|
|
32
|
-
const ELLIPSES_DESC =
|
|
33
|
-
`
|
|
32
|
+
const ELLIPSES_DESC = {
|
|
33
|
+
description: `This property indicates whether ellipses should be displayed (\`true\`) when the heading ` +
|
|
34
|
+
`text is cropped or not (\`false\`).`,
|
|
35
|
+
type: "boolean",
|
|
36
|
+
defaultValue: HeadingNative_1.defaultProps.ellipses,
|
|
37
|
+
};
|
|
34
38
|
const PRESERVE_DESC = (0, ComponentDefs_1.d)(`This property indicates whether linebreaks should be preserved when ` + `displaying text.`);
|
|
35
39
|
const LEVEL_DESC = (level) => `Represents a heading level ${level} text`;
|
|
40
|
+
const OMIT_FROM_TOC_DESC = {
|
|
41
|
+
description: "If true, this heading will be excluded from the table of contents.",
|
|
42
|
+
type: "boolean",
|
|
43
|
+
defaultValue: HeadingNative_1.defaultProps.omitFromToc,
|
|
44
|
+
};
|
|
36
45
|
exports.HeadingMd = (0, ComponentDefs_1.createMetadata)({
|
|
37
46
|
description: "Represents a heading text",
|
|
38
47
|
props: {
|
|
39
48
|
value: VALUE_DESC,
|
|
40
|
-
level:
|
|
49
|
+
level: {
|
|
50
|
+
description: "This property sets the visual significance (level) of the heading.",
|
|
51
|
+
availableValues: ["h1", "h2", "h3", "h4", "h5", "h6"],
|
|
52
|
+
defaultValue: HeadingNative_1.defaultProps.level,
|
|
53
|
+
},
|
|
41
54
|
maxLines: MAX_LINES_DESC,
|
|
42
55
|
ellipses: ELLIPSES_DESC,
|
|
43
56
|
preserveLinebreaks: PRESERVE_DESC,
|
|
44
|
-
omitFromToc:
|
|
57
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
45
58
|
},
|
|
46
59
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
47
60
|
defaultThemeVars: {
|
|
@@ -64,6 +77,7 @@ exports.H1Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
64
77
|
props: {
|
|
65
78
|
value: VALUE_DESC,
|
|
66
79
|
maxLines: MAX_LINES_DESC,
|
|
80
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
67
81
|
},
|
|
68
82
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
69
83
|
defaultThemeVars: {
|
|
@@ -86,6 +100,7 @@ exports.H2Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
86
100
|
props: {
|
|
87
101
|
value: VALUE_DESC,
|
|
88
102
|
maxLines: MAX_LINES_DESC,
|
|
103
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
89
104
|
},
|
|
90
105
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
91
106
|
defaultThemeVars: {
|
|
@@ -108,6 +123,7 @@ exports.H3Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
108
123
|
props: {
|
|
109
124
|
value: VALUE_DESC,
|
|
110
125
|
maxLines: MAX_LINES_DESC,
|
|
126
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
111
127
|
},
|
|
112
128
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
113
129
|
defaultThemeVars: {
|
|
@@ -130,6 +146,7 @@ exports.H4Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
130
146
|
props: {
|
|
131
147
|
value: VALUE_DESC,
|
|
132
148
|
maxLines: MAX_LINES_DESC,
|
|
149
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
133
150
|
},
|
|
134
151
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
135
152
|
defaultThemeVars: {
|
|
@@ -152,6 +169,7 @@ exports.H5Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
152
169
|
props: {
|
|
153
170
|
value: VALUE_DESC,
|
|
154
171
|
maxLines: MAX_LINES_DESC,
|
|
172
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
155
173
|
},
|
|
156
174
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
157
175
|
defaultThemeVars: {
|
|
@@ -174,6 +192,7 @@ exports.H6Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
174
192
|
props: {
|
|
175
193
|
value: VALUE_DESC,
|
|
176
194
|
maxLines: MAX_LINES_DESC,
|
|
195
|
+
omitFromToc: OMIT_FROM_TOC_DESC,
|
|
177
196
|
},
|
|
178
197
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
179
198
|
defaultThemeVars: {
|