@rjsf/fluentui-rc 5.14.1
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.md +201 -0
- package/README.md +127 -0
- package/dist/core.umd.js +940 -0
- package/dist/index.esm.js +1091 -0
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +1063 -0
- package/dist/index.js.map +7 -0
- package/lib/AddButton/AddButton.d.ts +3 -0
- package/lib/AddButton/AddButton.js +11 -0
- package/lib/AddButton/AddButton.js.map +1 -0
- package/lib/AddButton/index.d.ts +2 -0
- package/lib/AddButton/index.js +3 -0
- package/lib/AddButton/index.js.map +1 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.d.ts +7 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js +12 -0
- package/lib/ArrayFieldItemTemplate/ArrayFieldItemTemplate.js.map +1 -0
- package/lib/ArrayFieldItemTemplate/index.d.ts +2 -0
- package/lib/ArrayFieldItemTemplate/index.js +3 -0
- package/lib/ArrayFieldItemTemplate/index.js.map +1 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.d.ts +7 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js +28 -0
- package/lib/ArrayFieldTemplate/ArrayFieldTemplate.js.map +1 -0
- package/lib/ArrayFieldTemplate/index.d.ts +2 -0
- package/lib/ArrayFieldTemplate/index.js +3 -0
- package/lib/ArrayFieldTemplate/index.js.map +1 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.d.ts +9 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.js +38 -0
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -0
- package/lib/BaseInputTemplate/index.d.ts +2 -0
- package/lib/BaseInputTemplate/index.js +3 -0
- package/lib/BaseInputTemplate/index.js.map +1 -0
- package/lib/CheckboxWidget/CheckboxWidget.d.ts +8 -0
- package/lib/CheckboxWidget/CheckboxWidget.js +23 -0
- package/lib/CheckboxWidget/CheckboxWidget.js.map +1 -0
- package/lib/CheckboxWidget/index.d.ts +2 -0
- package/lib/CheckboxWidget/index.js +3 -0
- package/lib/CheckboxWidget/index.js.map +1 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.d.ts +8 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.js +30 -0
- package/lib/CheckboxesWidget/CheckboxesWidget.js.map +1 -0
- package/lib/CheckboxesWidget/index.d.ts +2 -0
- package/lib/CheckboxesWidget/index.js +3 -0
- package/lib/CheckboxesWidget/index.js.map +1 -0
- package/lib/DescriptionField/DescriptionField.d.ts +7 -0
- package/lib/DescriptionField/DescriptionField.js +21 -0
- package/lib/DescriptionField/DescriptionField.js.map +1 -0
- package/lib/DescriptionField/index.d.ts +2 -0
- package/lib/DescriptionField/index.js +3 -0
- package/lib/DescriptionField/index.js.map +1 -0
- package/lib/ErrorList/ErrorList.d.ts +7 -0
- package/lib/ErrorList/ErrorList.js +26 -0
- package/lib/ErrorList/ErrorList.js.map +1 -0
- package/lib/ErrorList/index.d.ts +2 -0
- package/lib/ErrorList/index.js +3 -0
- package/lib/ErrorList/index.js.map +1 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.d.ts +7 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js +28 -0
- package/lib/FieldErrorTemplate/FieldErrorTemplate.js.map +1 -0
- package/lib/FieldErrorTemplate/index.d.ts +2 -0
- package/lib/FieldErrorTemplate/index.js +3 -0
- package/lib/FieldErrorTemplate/index.js.map +1 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.d.ts +7 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js +16 -0
- package/lib/FieldHelpTemplate/FieldHelpTemplate.js.map +1 -0
- package/lib/FieldHelpTemplate/index.d.ts +2 -0
- package/lib/FieldHelpTemplate/index.js +3 -0
- package/lib/FieldHelpTemplate/index.js.map +1 -0
- package/lib/FieldTemplate/FieldTemplate.d.ts +8 -0
- package/lib/FieldTemplate/FieldTemplate.js +18 -0
- package/lib/FieldTemplate/FieldTemplate.js.map +1 -0
- package/lib/FieldTemplate/index.d.ts +2 -0
- package/lib/FieldTemplate/index.js +3 -0
- package/lib/FieldTemplate/index.js.map +1 -0
- package/lib/FluentForm/FluentForm.d.ts +6 -0
- package/lib/FluentForm/FluentForm.js +7 -0
- package/lib/FluentForm/FluentForm.js.map +1 -0
- package/lib/FluentForm/index.d.ts +2 -0
- package/lib/FluentForm/index.js +3 -0
- package/lib/FluentForm/index.js.map +1 -0
- package/lib/FluentUIRCFrameProvider.d.ts +2 -0
- package/lib/FluentUIRCFrameProvider.js +12 -0
- package/lib/FluentUIRCFrameProvider.js.map +1 -0
- package/lib/IconButton/IconButton.d.ts +7 -0
- package/lib/IconButton/IconButton.js +26 -0
- package/lib/IconButton/IconButton.js.map +1 -0
- package/lib/IconButton/index.d.ts +2 -0
- package/lib/IconButton/index.js +3 -0
- package/lib/IconButton/index.js.map +1 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.d.ts +9 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js +22 -0
- package/lib/ObjectFieldTemplate/ObjectFieldTemplate.js.map +1 -0
- package/lib/ObjectFieldTemplate/index.d.ts +2 -0
- package/lib/ObjectFieldTemplate/index.js +3 -0
- package/lib/ObjectFieldTemplate/index.js.map +1 -0
- package/lib/RadioWidget/RadioWidget.d.ts +8 -0
- package/lib/RadioWidget/RadioWidget.js +22 -0
- package/lib/RadioWidget/RadioWidget.js.map +1 -0
- package/lib/RadioWidget/index.d.ts +2 -0
- package/lib/RadioWidget/index.js +3 -0
- package/lib/RadioWidget/index.js.map +1 -0
- package/lib/RangeWidget/RangeWidget.d.ts +8 -0
- package/lib/RangeWidget/RangeWidget.js +20 -0
- package/lib/RangeWidget/RangeWidget.js.map +1 -0
- package/lib/RangeWidget/index.d.ts +2 -0
- package/lib/RangeWidget/index.js +3 -0
- package/lib/RangeWidget/index.js.map +1 -0
- package/lib/SelectWidget/SelectWidget.d.ts +9 -0
- package/lib/SelectWidget/SelectWidget.js +41 -0
- package/lib/SelectWidget/SelectWidget.js.map +1 -0
- package/lib/SelectWidget/index.d.ts +2 -0
- package/lib/SelectWidget/index.js +3 -0
- package/lib/SelectWidget/index.js.map +1 -0
- package/lib/SubmitButton/SubmitButton.d.ts +3 -0
- package/lib/SubmitButton/SubmitButton.js +17 -0
- package/lib/SubmitButton/SubmitButton.js.map +1 -0
- package/lib/SubmitButton/index.d.ts +2 -0
- package/lib/SubmitButton/index.js +3 -0
- package/lib/SubmitButton/index.js.map +1 -0
- package/lib/Templates/Templates.d.ts +4 -0
- package/lib/Templates/Templates.js +39 -0
- package/lib/Templates/Templates.js.map +1 -0
- package/lib/Templates/index.d.ts +2 -0
- package/lib/Templates/index.js +3 -0
- package/lib/Templates/index.js.map +1 -0
- package/lib/TextareaWidget/TextareaWidget.d.ts +7 -0
- package/lib/TextareaWidget/TextareaWidget.js +27 -0
- package/lib/TextareaWidget/TextareaWidget.js.map +1 -0
- package/lib/TextareaWidget/index.d.ts +2 -0
- package/lib/TextareaWidget/index.js +3 -0
- package/lib/TextareaWidget/index.js.map +1 -0
- package/lib/Theme/Theme.d.ts +5 -0
- package/lib/Theme/Theme.js +10 -0
- package/lib/Theme/Theme.js.map +1 -0
- package/lib/Theme/index.d.ts +2 -0
- package/lib/Theme/index.js +3 -0
- package/lib/Theme/index.js.map +1 -0
- package/lib/TitleField/TitleField.d.ts +7 -0
- package/lib/TitleField/TitleField.js +17 -0
- package/lib/TitleField/TitleField.js.map +1 -0
- package/lib/TitleField/index.d.ts +2 -0
- package/lib/TitleField/index.js +3 -0
- package/lib/TitleField/index.js.map +1 -0
- package/lib/Widgets/Widgets.d.ts +4 -0
- package/lib/Widgets/Widgets.js +18 -0
- package/lib/Widgets/Widgets.js.map +1 -0
- package/lib/Widgets/index.d.ts +2 -0
- package/lib/Widgets/index.js +3 -0
- package/lib/Widgets/index.js.map +1 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.d.ts +8 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +40 -0
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -0
- package/lib/WrapIfAdditionalTemplate/index.d.ts +2 -0
- package/lib/WrapIfAdditionalTemplate/index.js +3 -0
- package/lib/WrapIfAdditionalTemplate/index.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +98 -0
- package/src/AddButton/AddButton.tsx +12 -0
- package/src/AddButton/index.ts +2 -0
- package/src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx +72 -0
- package/src/ArrayFieldItemTemplate/index.ts +2 -0
- package/src/ArrayFieldTemplate/ArrayFieldTemplate.tsx +87 -0
- package/src/ArrayFieldTemplate/index.ts +2 -0
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +99 -0
- package/src/BaseInputTemplate/index.ts +2 -0
- package/src/CheckboxWidget/CheckboxWidget.tsx +81 -0
- package/src/CheckboxWidget/index.ts +2 -0
- package/src/CheckboxesWidget/CheckboxesWidget.tsx +91 -0
- package/src/CheckboxesWidget/index.ts +2 -0
- package/src/DescriptionField/DescriptionField.tsx +31 -0
- package/src/DescriptionField/index.ts +2 -0
- package/src/ErrorList/ErrorList.tsx +40 -0
- package/src/ErrorList/index.ts +2 -0
- package/src/FieldErrorTemplate/FieldErrorTemplate.tsx +44 -0
- package/src/FieldErrorTemplate/index.ts +2 -0
- package/src/FieldHelpTemplate/FieldHelpTemplate.tsx +19 -0
- package/src/FieldHelpTemplate/index.ts +2 -0
- package/src/FieldTemplate/FieldTemplate.tsx +80 -0
- package/src/FieldTemplate/index.ts +2 -0
- package/src/FluentForm/FluentForm.ts +15 -0
- package/src/FluentForm/index.ts +2 -0
- package/src/FluentUIRCFrameProvider.tsx +21 -0
- package/src/IconButton/IconButton.tsx +73 -0
- package/src/IconButton/index.ts +2 -0
- package/src/ObjectFieldTemplate/ObjectFieldTemplate.tsx +97 -0
- package/src/ObjectFieldTemplate/index.ts +2 -0
- package/src/RadioWidget/RadioWidget.tsx +77 -0
- package/src/RadioWidget/index.ts +2 -0
- package/src/RangeWidget/RangeWidget.tsx +49 -0
- package/src/RangeWidget/index.ts +2 -0
- package/src/SelectWidget/SelectWidget.tsx +98 -0
- package/src/SelectWidget/index.ts +2 -0
- package/src/SubmitButton/SubmitButton.tsx +27 -0
- package/src/SubmitButton/index.ts +2 -0
- package/src/Templates/Templates.ts +45 -0
- package/src/Templates/index.ts +2 -0
- package/src/TextareaWidget/TextareaWidget.tsx +81 -0
- package/src/TextareaWidget/index.ts +2 -0
- package/src/Theme/Theme.ts +18 -0
- package/src/Theme/index.ts +2 -0
- package/src/TitleField/TitleField.tsx +28 -0
- package/src/TitleField/index.ts +2 -0
- package/src/Widgets/Widgets.ts +24 -0
- package/src/Widgets/index.ts +2 -0
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +100 -0
- package/src/WrapIfAdditionalTemplate/index.ts +2 -0
- package/src/index.ts +9 -0
- package/src/tsconfig.json +24 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Form: () => FluentForm_default,
|
|
24
|
+
Templates: () => Templates_default,
|
|
25
|
+
Theme: () => Theme_default,
|
|
26
|
+
Widgets: () => Widgets_default,
|
|
27
|
+
__createFluentUIRCFrameProvider: () => __createFluentUIRCFrameProvider,
|
|
28
|
+
default: () => src_default,
|
|
29
|
+
generateForm: () => generateForm,
|
|
30
|
+
generateTemplates: () => generateTemplates,
|
|
31
|
+
generateTheme: () => generateTheme,
|
|
32
|
+
generateWidgets: () => generateWidgets
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
|
|
36
|
+
// src/FluentForm/FluentForm.ts
|
|
37
|
+
var import_core = require("@rjsf/core");
|
|
38
|
+
|
|
39
|
+
// src/ArrayFieldItemTemplate/ArrayFieldItemTemplate.tsx
|
|
40
|
+
var import_react_migration_v0_v9 = require("@fluentui/react-migration-v0-v9");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
function ArrayFieldItemTemplate(props) {
|
|
43
|
+
const {
|
|
44
|
+
children,
|
|
45
|
+
disabled,
|
|
46
|
+
hasToolbar,
|
|
47
|
+
hasCopy,
|
|
48
|
+
hasMoveDown,
|
|
49
|
+
hasMoveUp,
|
|
50
|
+
hasRemove,
|
|
51
|
+
index,
|
|
52
|
+
onCopyIndexClick,
|
|
53
|
+
onDropIndexClick,
|
|
54
|
+
onReorderClick,
|
|
55
|
+
readonly,
|
|
56
|
+
uiSchema,
|
|
57
|
+
registry
|
|
58
|
+
} = props;
|
|
59
|
+
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_migration_v0_v9.Flex, { vAlign: "end", children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_migration_v0_v9.Flex, { children }),
|
|
62
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_migration_v0_v9.Flex, { style: { marginLeft: "8px" }, children: [
|
|
63
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
MoveUpButton2,
|
|
65
|
+
{
|
|
66
|
+
disabled: disabled || readonly || !hasMoveUp,
|
|
67
|
+
onClick: onReorderClick(index, index - 1),
|
|
68
|
+
uiSchema,
|
|
69
|
+
registry
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
MoveDownButton2,
|
|
74
|
+
{
|
|
75
|
+
disabled: disabled || readonly || !hasMoveDown,
|
|
76
|
+
onClick: onReorderClick(index, index + 1),
|
|
77
|
+
uiSchema,
|
|
78
|
+
registry
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
hasCopy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
82
|
+
CopyButton2,
|
|
83
|
+
{
|
|
84
|
+
disabled: disabled || readonly,
|
|
85
|
+
onClick: onCopyIndexClick(index),
|
|
86
|
+
uiSchema,
|
|
87
|
+
registry
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
hasRemove && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
RemoveButton2,
|
|
92
|
+
{
|
|
93
|
+
disabled: disabled || readonly,
|
|
94
|
+
onClick: onDropIndexClick(index),
|
|
95
|
+
uiSchema,
|
|
96
|
+
registry
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] })
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/AddButton/AddButton.tsx
|
|
104
|
+
var import_utils = require("@rjsf/utils");
|
|
105
|
+
var import_react_components = require("@fluentui/react-components");
|
|
106
|
+
var import_react_icons = require("@fluentui/react-icons");
|
|
107
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
108
|
+
function AddButton({
|
|
109
|
+
uiSchema,
|
|
110
|
+
registry,
|
|
111
|
+
...props
|
|
112
|
+
}) {
|
|
113
|
+
const { translateString } = registry;
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_components.Button, { ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_icons.AddRegular, {}), title: translateString(import_utils.TranslatableString.AddItemButton) });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/ArrayFieldTemplate/ArrayFieldTemplate.tsx
|
|
118
|
+
var import_react_components2 = require("@fluentui/react-components");
|
|
119
|
+
var import_react_migration_v0_v92 = require("@fluentui/react-migration-v0-v9");
|
|
120
|
+
var import_utils2 = require("@rjsf/utils");
|
|
121
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
122
|
+
var useStyles = (0, import_react_components2.makeStyles)({
|
|
123
|
+
arrayItemList: {
|
|
124
|
+
...import_react_components2.shorthands.gap("12px")
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
function ArrayFieldTemplate(props) {
|
|
128
|
+
const { canAdd, disabled, idSchema, uiSchema, items, onAddClick, readonly, registry, required, schema, title } = props;
|
|
129
|
+
const classes = useStyles();
|
|
130
|
+
const uiOptions = (0, import_utils2.getUiOptions)(uiSchema);
|
|
131
|
+
const ArrayFieldDescriptionTemplate = (0, import_utils2.getTemplate)(
|
|
132
|
+
"ArrayFieldDescriptionTemplate",
|
|
133
|
+
registry,
|
|
134
|
+
uiOptions
|
|
135
|
+
);
|
|
136
|
+
const ArrayFieldItemTemplate2 = (0, import_utils2.getTemplate)(
|
|
137
|
+
"ArrayFieldItemTemplate",
|
|
138
|
+
registry,
|
|
139
|
+
uiOptions
|
|
140
|
+
);
|
|
141
|
+
const ArrayFieldTitleTemplate = (0, import_utils2.getTemplate)(
|
|
142
|
+
"ArrayFieldTitleTemplate",
|
|
143
|
+
registry,
|
|
144
|
+
uiOptions
|
|
145
|
+
);
|
|
146
|
+
const {
|
|
147
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
148
|
+
} = registry.templates;
|
|
149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
151
|
+
ArrayFieldTitleTemplate,
|
|
152
|
+
{
|
|
153
|
+
idSchema,
|
|
154
|
+
title: uiOptions.title || title,
|
|
155
|
+
schema,
|
|
156
|
+
uiSchema,
|
|
157
|
+
required,
|
|
158
|
+
registry
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
162
|
+
ArrayFieldDescriptionTemplate,
|
|
163
|
+
{
|
|
164
|
+
idSchema,
|
|
165
|
+
description: uiOptions.description || schema.description,
|
|
166
|
+
schema,
|
|
167
|
+
uiSchema,
|
|
168
|
+
registry
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_migration_v0_v92.Flex, { column: true, className: classes.arrayItemList, children: [
|
|
172
|
+
items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrayFieldItemTemplate2, { ...itemProps }, key)),
|
|
173
|
+
canAdd && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_migration_v0_v92.Flex, { hAlign: "end", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
174
|
+
AddButton2,
|
|
175
|
+
{
|
|
176
|
+
className: "array-item-add",
|
|
177
|
+
onClick: onAddClick,
|
|
178
|
+
disabled: disabled || readonly,
|
|
179
|
+
uiSchema,
|
|
180
|
+
registry
|
|
181
|
+
}
|
|
182
|
+
) })
|
|
183
|
+
] }, `array-item-list-${idSchema.$id}`)
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
188
|
+
var import_react_components3 = require("@fluentui/react-components");
|
|
189
|
+
var import_utils3 = require("@rjsf/utils");
|
|
190
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
191
|
+
var useStyles2 = (0, import_react_components3.makeStyles)({
|
|
192
|
+
input: {
|
|
193
|
+
width: "100%"
|
|
194
|
+
},
|
|
195
|
+
label: {
|
|
196
|
+
paddingTop: "2px",
|
|
197
|
+
paddingBottom: "2px",
|
|
198
|
+
marginBottom: "2px"
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
function BaseInputTemplate(props) {
|
|
202
|
+
const {
|
|
203
|
+
id,
|
|
204
|
+
placeholder,
|
|
205
|
+
required,
|
|
206
|
+
readonly,
|
|
207
|
+
disabled,
|
|
208
|
+
type,
|
|
209
|
+
value,
|
|
210
|
+
label,
|
|
211
|
+
hideLabel,
|
|
212
|
+
onChange,
|
|
213
|
+
onChangeOverride,
|
|
214
|
+
onBlur,
|
|
215
|
+
onFocus,
|
|
216
|
+
autofocus,
|
|
217
|
+
options,
|
|
218
|
+
schema
|
|
219
|
+
} = props;
|
|
220
|
+
const classes = useStyles2();
|
|
221
|
+
const inputProps = (0, import_utils3.getInputProps)(schema, type, options);
|
|
222
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
223
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
224
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
226
|
+
(0, import_utils3.labelValue)(
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_components3.Label, { htmlFor: id, required, disabled, className: classes.label, children: label }),
|
|
228
|
+
hideLabel
|
|
229
|
+
),
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
231
|
+
import_react_components3.Input,
|
|
232
|
+
{
|
|
233
|
+
id,
|
|
234
|
+
name: id,
|
|
235
|
+
placeholder,
|
|
236
|
+
autoFocus: autofocus,
|
|
237
|
+
required,
|
|
238
|
+
disabled: disabled || readonly,
|
|
239
|
+
...inputProps,
|
|
240
|
+
input: {
|
|
241
|
+
className: classes.input,
|
|
242
|
+
// Due to Fluent UI this does not work correctly
|
|
243
|
+
list: schema.examples ? (0, import_utils3.examplesId)(id) : void 0
|
|
244
|
+
},
|
|
245
|
+
value: value || value === 0 ? value : "",
|
|
246
|
+
onChange: onChangeOverride || _onChange,
|
|
247
|
+
onFocus: _onFocus,
|
|
248
|
+
onBlur: _onBlur,
|
|
249
|
+
"aria-describedby": (0, import_utils3.ariaDescribedByIds)(id, !!schema.examples)
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
Array.isArray(schema.examples) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("datalist", { id: (0, import_utils3.examplesId)(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: example }, example);
|
|
254
|
+
}) })
|
|
255
|
+
] });
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// src/DescriptionField/DescriptionField.tsx
|
|
259
|
+
var import_react_components4 = require("@fluentui/react-components");
|
|
260
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
261
|
+
var useStyles3 = (0, import_react_components4.makeStyles)({
|
|
262
|
+
label: {
|
|
263
|
+
marginTop: import_react_components4.tokens.spacingVerticalS,
|
|
264
|
+
marginBottom: import_react_components4.tokens.spacingVerticalM
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
function DescriptionField(props) {
|
|
268
|
+
const { id, description } = props;
|
|
269
|
+
const classes = useStyles3();
|
|
270
|
+
if (description) {
|
|
271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_components4.Text, { block: true, id, className: classes.label, children: description });
|
|
272
|
+
}
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/ErrorList/ErrorList.tsx
|
|
277
|
+
var import_react_components5 = require("@fluentui/react-components");
|
|
278
|
+
var import_utils4 = require("@rjsf/utils");
|
|
279
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
280
|
+
var useStyles4 = (0, import_react_components5.makeStyles)({
|
|
281
|
+
errorCard: {
|
|
282
|
+
backgroundColor: import_react_components5.tokens.colorStatusDangerBackground1,
|
|
283
|
+
marginBottom: import_react_components5.tokens.spacingVerticalL,
|
|
284
|
+
"&::after": {
|
|
285
|
+
...import_react_components5.shorthands.borderColor(import_react_components5.tokens.colorStatusDangerBorder1)
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
errorTitle: {
|
|
289
|
+
marginTop: 0,
|
|
290
|
+
marginBottom: 0
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
function ErrorList({
|
|
294
|
+
errors,
|
|
295
|
+
registry
|
|
296
|
+
}) {
|
|
297
|
+
const { translateString } = registry;
|
|
298
|
+
const classes = useStyles4();
|
|
299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_components5.Card, { appearance: "outline", className: classes.errorCard, children: [
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_components5.Text, { as: "h6", size: 400, className: classes.errorTitle, children: translateString(import_utils4.TranslatableString.ErrorsLabel) }),
|
|
301
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: errors.map((error, i) => {
|
|
302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("li", { children: error.stack }, i);
|
|
303
|
+
}) })
|
|
304
|
+
] });
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// src/IconButton/IconButton.tsx
|
|
308
|
+
var import_react_components6 = require("@fluentui/react-components");
|
|
309
|
+
var import_react_icons2 = require("@fluentui/react-icons");
|
|
310
|
+
var import_utils5 = require("@rjsf/utils");
|
|
311
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
312
|
+
function FluentIconButton(props) {
|
|
313
|
+
const { color, uiSchema, registry, ...otherProps } = props;
|
|
314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_components6.Button, { ...otherProps, color: "secondary" });
|
|
315
|
+
}
|
|
316
|
+
function CopyButton(props) {
|
|
317
|
+
const {
|
|
318
|
+
registry: { translateString }
|
|
319
|
+
} = props;
|
|
320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
321
|
+
FluentIconButton,
|
|
322
|
+
{
|
|
323
|
+
title: translateString(import_utils5.TranslatableString.CopyButton),
|
|
324
|
+
...props,
|
|
325
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_icons2.CopyRegular, {})
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
function MoveDownButton(props) {
|
|
330
|
+
const {
|
|
331
|
+
registry: { translateString }
|
|
332
|
+
} = props;
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
334
|
+
FluentIconButton,
|
|
335
|
+
{
|
|
336
|
+
title: translateString(import_utils5.TranslatableString.MoveDownButton),
|
|
337
|
+
...props,
|
|
338
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_icons2.ArrowSortDownRegular, {})
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
function MoveUpButton(props) {
|
|
343
|
+
const {
|
|
344
|
+
registry: { translateString }
|
|
345
|
+
} = props;
|
|
346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
347
|
+
FluentIconButton,
|
|
348
|
+
{
|
|
349
|
+
title: translateString(import_utils5.TranslatableString.MoveUpButton),
|
|
350
|
+
...props,
|
|
351
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_icons2.ArrowSortUpRegular, {})
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
function RemoveButton(props) {
|
|
356
|
+
const {
|
|
357
|
+
registry: { translateString }
|
|
358
|
+
} = props;
|
|
359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
360
|
+
FluentIconButton,
|
|
361
|
+
{
|
|
362
|
+
title: translateString(import_utils5.TranslatableString.RemoveButton),
|
|
363
|
+
...props,
|
|
364
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_icons2.SubtractRegular, {})
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
370
|
+
var import_react_components7 = require("@fluentui/react-components");
|
|
371
|
+
var import_utils6 = require("@rjsf/utils");
|
|
372
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
373
|
+
var useStyles5 = (0, import_react_components7.makeStyles)({
|
|
374
|
+
list: { marginTop: 0, marginBottom: 0, paddingLeft: 0, listStyleType: "none" },
|
|
375
|
+
listItem: {
|
|
376
|
+
paddingLeft: import_react_components7.tokens.spacingHorizontalL,
|
|
377
|
+
paddingTop: import_react_components7.tokens.spacingVerticalXS,
|
|
378
|
+
paddingBottom: import_react_components7.tokens.spacingVerticalXS
|
|
379
|
+
},
|
|
380
|
+
errorLabel: { color: import_react_components7.tokens.colorPaletteRedForeground1 }
|
|
381
|
+
});
|
|
382
|
+
function FieldErrorTemplate(props) {
|
|
383
|
+
const { errors = [], idSchema } = props;
|
|
384
|
+
const classes = useStyles5();
|
|
385
|
+
if (errors.length === 0) {
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
const id = (0, import_utils6.errorId)(idSchema);
|
|
389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: classes.list, children: errors.map((error, i) => {
|
|
390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { className: classes.listItem, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: classes.errorLabel, id, children: error }) }, i);
|
|
391
|
+
}) });
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
395
|
+
var import_react_components8 = require("@fluentui/react-components");
|
|
396
|
+
var import_utils7 = require("@rjsf/utils");
|
|
397
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
398
|
+
function FieldHelpTemplate(props) {
|
|
399
|
+
const { idSchema, help } = props;
|
|
400
|
+
if (!help) {
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
const id = (0, import_utils7.helpId)(idSchema);
|
|
404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_components8.Caption1, { id, children: help });
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// src/FieldTemplate/FieldTemplate.tsx
|
|
408
|
+
var import_react_components9 = require("@fluentui/react-components");
|
|
409
|
+
var import_utils8 = require("@rjsf/utils");
|
|
410
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
411
|
+
function FieldTemplate(props) {
|
|
412
|
+
const {
|
|
413
|
+
id,
|
|
414
|
+
children,
|
|
415
|
+
classNames,
|
|
416
|
+
style,
|
|
417
|
+
disabled,
|
|
418
|
+
displayLabel,
|
|
419
|
+
hidden,
|
|
420
|
+
label,
|
|
421
|
+
onDropPropertyClick,
|
|
422
|
+
onKeyChange,
|
|
423
|
+
readonly,
|
|
424
|
+
required,
|
|
425
|
+
rawErrors = [],
|
|
426
|
+
errors,
|
|
427
|
+
help,
|
|
428
|
+
description,
|
|
429
|
+
rawDescription,
|
|
430
|
+
schema,
|
|
431
|
+
uiSchema,
|
|
432
|
+
registry
|
|
433
|
+
} = props;
|
|
434
|
+
const uiOptions = (0, import_utils8.getUiOptions)(uiSchema);
|
|
435
|
+
const WrapIfAdditionalTemplate2 = (0, import_utils8.getTemplate)(
|
|
436
|
+
"WrapIfAdditionalTemplate",
|
|
437
|
+
registry,
|
|
438
|
+
uiOptions
|
|
439
|
+
);
|
|
440
|
+
if (hidden) {
|
|
441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "none" }, children });
|
|
442
|
+
}
|
|
443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
444
|
+
WrapIfAdditionalTemplate2,
|
|
445
|
+
{
|
|
446
|
+
classNames,
|
|
447
|
+
style,
|
|
448
|
+
disabled,
|
|
449
|
+
id,
|
|
450
|
+
label,
|
|
451
|
+
onDropPropertyClick,
|
|
452
|
+
onKeyChange,
|
|
453
|
+
readonly,
|
|
454
|
+
required,
|
|
455
|
+
schema,
|
|
456
|
+
uiSchema,
|
|
457
|
+
registry,
|
|
458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_components9.Field, { validationState: rawErrors.length ? "error" : void 0, required, children: [
|
|
459
|
+
children,
|
|
460
|
+
displayLabel && rawDescription ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_components9.Text, { as: "p", block: true, style: { marginTop: 0, marginBottom: 0 }, children: description }) : null,
|
|
461
|
+
errors,
|
|
462
|
+
help
|
|
463
|
+
] })
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
469
|
+
var import_react_migration_v0_v93 = require("@fluentui/react-migration-v0-v9");
|
|
470
|
+
var import_utils9 = require("@rjsf/utils");
|
|
471
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
472
|
+
function ObjectFieldTemplate(props) {
|
|
473
|
+
const {
|
|
474
|
+
description,
|
|
475
|
+
title,
|
|
476
|
+
properties,
|
|
477
|
+
required,
|
|
478
|
+
disabled,
|
|
479
|
+
readonly,
|
|
480
|
+
uiSchema,
|
|
481
|
+
idSchema,
|
|
482
|
+
schema,
|
|
483
|
+
formData,
|
|
484
|
+
onAddClick,
|
|
485
|
+
registry
|
|
486
|
+
} = props;
|
|
487
|
+
const uiOptions = (0, import_utils9.getUiOptions)(uiSchema);
|
|
488
|
+
const TitleFieldTemplate = (0, import_utils9.getTemplate)("TitleFieldTemplate", registry, uiOptions);
|
|
489
|
+
const DescriptionFieldTemplate = (0, import_utils9.getTemplate)(
|
|
490
|
+
"DescriptionFieldTemplate",
|
|
491
|
+
registry,
|
|
492
|
+
uiOptions
|
|
493
|
+
);
|
|
494
|
+
const {
|
|
495
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
496
|
+
} = registry.templates;
|
|
497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
498
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
499
|
+
TitleFieldTemplate,
|
|
500
|
+
{
|
|
501
|
+
id: (0, import_utils9.titleId)(idSchema),
|
|
502
|
+
title,
|
|
503
|
+
required,
|
|
504
|
+
schema,
|
|
505
|
+
uiSchema,
|
|
506
|
+
registry
|
|
507
|
+
}
|
|
508
|
+
),
|
|
509
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
510
|
+
DescriptionFieldTemplate,
|
|
511
|
+
{
|
|
512
|
+
id: (0, import_utils9.descriptionId)(idSchema),
|
|
513
|
+
description,
|
|
514
|
+
schema,
|
|
515
|
+
uiSchema,
|
|
516
|
+
registry
|
|
517
|
+
}
|
|
518
|
+
),
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_migration_v0_v93.Flex, { fill: true, column: true, gap: "gap.medium", children: [
|
|
520
|
+
properties.map(
|
|
521
|
+
(element, index) => (
|
|
522
|
+
// Remove the <Grid> if the inner element is hidden as the <Grid>
|
|
523
|
+
// itself would otherwise still take up space.
|
|
524
|
+
element.hidden ? element.content : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_migration_v0_v93.Flex, { column: true, fill: true, style: { marginBottom: "10px" }, children: element.content }, index)
|
|
525
|
+
)
|
|
526
|
+
),
|
|
527
|
+
(0, import_utils9.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_migration_v0_v93.Flex, { hAlign: "end", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
528
|
+
AddButton2,
|
|
529
|
+
{
|
|
530
|
+
className: "object-property-expand",
|
|
531
|
+
onClick: onAddClick(schema),
|
|
532
|
+
disabled: disabled || readonly,
|
|
533
|
+
uiSchema,
|
|
534
|
+
registry
|
|
535
|
+
}
|
|
536
|
+
) })
|
|
537
|
+
] })
|
|
538
|
+
] });
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// src/SubmitButton/SubmitButton.tsx
|
|
542
|
+
var import_utils10 = require("@rjsf/utils");
|
|
543
|
+
var import_react_components10 = require("@fluentui/react-components");
|
|
544
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
545
|
+
var useStyles6 = (0, import_react_components10.makeStyles)({
|
|
546
|
+
buttonRow: {
|
|
547
|
+
marginTop: import_react_components10.tokens.spacingVerticalL
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
function SubmitButton({ uiSchema }) {
|
|
551
|
+
const classes = useStyles6();
|
|
552
|
+
const { submitText, norender, props: submitButtonProps } = (0, import_utils10.getSubmitButtonOptions)(uiSchema);
|
|
553
|
+
if (norender) {
|
|
554
|
+
return null;
|
|
555
|
+
}
|
|
556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: classes.buttonRow, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_components10.Button, { appearance: "primary", type: "submit", ...submitButtonProps, children: submitText }) });
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// src/TitleField/TitleField.tsx
|
|
560
|
+
var import_react_components11 = require("@fluentui/react-components");
|
|
561
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
562
|
+
var useStyles7 = (0, import_react_components11.makeStyles)({
|
|
563
|
+
root: {
|
|
564
|
+
marginTop: "8px",
|
|
565
|
+
marginBottom: "8px"
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
function TitleField({
|
|
569
|
+
id,
|
|
570
|
+
title
|
|
571
|
+
}) {
|
|
572
|
+
const classes = useStyles7();
|
|
573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { id, className: classes.root, children: [
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_components11.Text, { as: "h5", size: 600, children: title }),
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_components11.Divider, {})
|
|
576
|
+
] });
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
580
|
+
var import_utils11 = require("@rjsf/utils");
|
|
581
|
+
var import_react_components12 = require("@fluentui/react-components");
|
|
582
|
+
var import_react_migration_v0_v94 = require("@fluentui/react-migration-v0-v9");
|
|
583
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
584
|
+
var useStyles8 = (0, import_react_components12.makeStyles)({
|
|
585
|
+
input: {
|
|
586
|
+
width: "100%"
|
|
587
|
+
},
|
|
588
|
+
label: {
|
|
589
|
+
marginBottom: "4px"
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
function WrapIfAdditionalTemplate(props) {
|
|
593
|
+
const {
|
|
594
|
+
children,
|
|
595
|
+
classNames,
|
|
596
|
+
style,
|
|
597
|
+
disabled,
|
|
598
|
+
id,
|
|
599
|
+
label,
|
|
600
|
+
onDropPropertyClick,
|
|
601
|
+
onKeyChange,
|
|
602
|
+
readonly,
|
|
603
|
+
required,
|
|
604
|
+
schema,
|
|
605
|
+
uiSchema,
|
|
606
|
+
registry
|
|
607
|
+
} = props;
|
|
608
|
+
const { templates, translateString } = registry;
|
|
609
|
+
const classes = useStyles8();
|
|
610
|
+
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
611
|
+
const keyLabel = translateString(import_utils11.TranslatableString.KeyLabel, [label]);
|
|
612
|
+
const additional = import_utils11.ADDITIONAL_PROPERTY_FLAG in schema;
|
|
613
|
+
const btnStyle = {
|
|
614
|
+
flex: 1,
|
|
615
|
+
paddingLeft: 6,
|
|
616
|
+
paddingRight: 6,
|
|
617
|
+
fontWeight: "bold"
|
|
618
|
+
};
|
|
619
|
+
if (!additional) {
|
|
620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: classNames, style, children });
|
|
621
|
+
}
|
|
622
|
+
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_migration_v0_v94.Flex, { gap: "gap.medium", vAlign: "center", className: classNames, style, children: [
|
|
624
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_components12.Field, { label: keyLabel, required, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
625
|
+
import_react_components12.Input,
|
|
626
|
+
{
|
|
627
|
+
required,
|
|
628
|
+
defaultValue: label,
|
|
629
|
+
disabled: disabled || readonly,
|
|
630
|
+
id: `${id}-key`,
|
|
631
|
+
name: `${id}-key`,
|
|
632
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
633
|
+
type: "text",
|
|
634
|
+
input: {
|
|
635
|
+
className: classes.input
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
) }) }),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children }),
|
|
640
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
641
|
+
RemoveButton2,
|
|
642
|
+
{
|
|
643
|
+
iconType: "default",
|
|
644
|
+
style: btnStyle,
|
|
645
|
+
disabled: disabled || readonly,
|
|
646
|
+
onClick: onDropPropertyClick(label),
|
|
647
|
+
uiSchema,
|
|
648
|
+
registry
|
|
649
|
+
}
|
|
650
|
+
) })
|
|
651
|
+
] }, `${id}-key`);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/Templates/Templates.ts
|
|
655
|
+
function generateTemplates() {
|
|
656
|
+
return {
|
|
657
|
+
ArrayFieldItemTemplate,
|
|
658
|
+
ArrayFieldTemplate,
|
|
659
|
+
BaseInputTemplate,
|
|
660
|
+
ButtonTemplates: {
|
|
661
|
+
CopyButton,
|
|
662
|
+
AddButton,
|
|
663
|
+
MoveDownButton,
|
|
664
|
+
MoveUpButton,
|
|
665
|
+
RemoveButton,
|
|
666
|
+
SubmitButton
|
|
667
|
+
},
|
|
668
|
+
DescriptionFieldTemplate: DescriptionField,
|
|
669
|
+
ErrorListTemplate: ErrorList,
|
|
670
|
+
FieldErrorTemplate,
|
|
671
|
+
FieldHelpTemplate,
|
|
672
|
+
FieldTemplate,
|
|
673
|
+
ObjectFieldTemplate,
|
|
674
|
+
TitleFieldTemplate: TitleField,
|
|
675
|
+
WrapIfAdditionalTemplate
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
var Templates_default = generateTemplates();
|
|
679
|
+
|
|
680
|
+
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
681
|
+
var import_utils12 = require("@rjsf/utils");
|
|
682
|
+
var import_react_components13 = require("@fluentui/react-components");
|
|
683
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
684
|
+
function CheckboxWidget(props) {
|
|
685
|
+
const {
|
|
686
|
+
schema,
|
|
687
|
+
id,
|
|
688
|
+
value,
|
|
689
|
+
disabled,
|
|
690
|
+
readonly,
|
|
691
|
+
label = "",
|
|
692
|
+
hideLabel,
|
|
693
|
+
autofocus,
|
|
694
|
+
onChange,
|
|
695
|
+
onBlur,
|
|
696
|
+
onFocus,
|
|
697
|
+
registry,
|
|
698
|
+
options,
|
|
699
|
+
uiSchema
|
|
700
|
+
} = props;
|
|
701
|
+
const DescriptionFieldTemplate = (0, import_utils12.getTemplate)(
|
|
702
|
+
"DescriptionFieldTemplate",
|
|
703
|
+
registry,
|
|
704
|
+
options
|
|
705
|
+
);
|
|
706
|
+
const required = (0, import_utils12.schemaRequiresTrueValue)(schema);
|
|
707
|
+
const _onChange = ({ target: { checked } }) => onChange(checked);
|
|
708
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
709
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
710
|
+
const description = options.description ?? schema.description;
|
|
711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
712
|
+
!hideLabel && !!description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
713
|
+
DescriptionFieldTemplate,
|
|
714
|
+
{
|
|
715
|
+
id: (0, import_utils12.descriptionId)(id),
|
|
716
|
+
description,
|
|
717
|
+
schema,
|
|
718
|
+
uiSchema,
|
|
719
|
+
registry
|
|
720
|
+
}
|
|
721
|
+
),
|
|
722
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
723
|
+
import_react_components13.Checkbox,
|
|
724
|
+
{
|
|
725
|
+
id,
|
|
726
|
+
name: id,
|
|
727
|
+
label,
|
|
728
|
+
checked: typeof value === "undefined" ? false : Boolean(value),
|
|
729
|
+
required,
|
|
730
|
+
disabled: disabled || readonly,
|
|
731
|
+
autoFocus: autofocus,
|
|
732
|
+
onChange: _onChange,
|
|
733
|
+
onBlur: _onBlur,
|
|
734
|
+
onFocus: _onFocus,
|
|
735
|
+
"aria-describedby": (0, import_utils12.ariaDescribedByIds)(id)
|
|
736
|
+
}
|
|
737
|
+
)
|
|
738
|
+
] });
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
742
|
+
var import_utils13 = require("@rjsf/utils");
|
|
743
|
+
var import_react_components14 = require("@fluentui/react-components");
|
|
744
|
+
var import_react_migration_v0_v95 = require("@fluentui/react-migration-v0-v9");
|
|
745
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
746
|
+
function CheckboxesWidget({
|
|
747
|
+
label,
|
|
748
|
+
hideLabel,
|
|
749
|
+
id,
|
|
750
|
+
disabled,
|
|
751
|
+
options,
|
|
752
|
+
value,
|
|
753
|
+
autofocus,
|
|
754
|
+
readonly,
|
|
755
|
+
required,
|
|
756
|
+
onChange,
|
|
757
|
+
onBlur,
|
|
758
|
+
onFocus
|
|
759
|
+
}) {
|
|
760
|
+
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
761
|
+
const checkboxesValues = Array.isArray(value) ? value : [value];
|
|
762
|
+
const _onChange = (index) => ({ target: { checked } }) => {
|
|
763
|
+
if (checked) {
|
|
764
|
+
onChange((0, import_utils13.enumOptionsSelectValue)(index, checkboxesValues, enumOptions));
|
|
765
|
+
} else {
|
|
766
|
+
onChange((0, import_utils13.enumOptionsDeselectValue)(index, checkboxesValues, enumOptions));
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, (0, import_utils13.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
770
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, (0, import_utils13.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
772
|
+
(0, import_utils13.labelValue)(
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_components14.Label, { required, htmlFor: id, children: label || void 0 }),
|
|
774
|
+
hideLabel
|
|
775
|
+
),
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_migration_v0_v95.Flex, { column: !inline, children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
777
|
+
const checked = (0, import_utils13.enumOptionsIsSelected)(option.value, checkboxesValues);
|
|
778
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
780
|
+
import_react_components14.Checkbox,
|
|
781
|
+
{
|
|
782
|
+
id: (0, import_utils13.optionId)(id, index),
|
|
783
|
+
name: id,
|
|
784
|
+
label: option.label,
|
|
785
|
+
checked,
|
|
786
|
+
disabled: disabled || itemDisabled || readonly,
|
|
787
|
+
autoFocus: autofocus && index === 0,
|
|
788
|
+
onChange: _onChange(index),
|
|
789
|
+
onBlur: _onBlur,
|
|
790
|
+
onFocus: _onFocus,
|
|
791
|
+
"aria-describedby": (0, import_utils13.ariaDescribedByIds)(id)
|
|
792
|
+
},
|
|
793
|
+
index
|
|
794
|
+
);
|
|
795
|
+
}) })
|
|
796
|
+
] });
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// src/RadioWidget/RadioWidget.tsx
|
|
800
|
+
var import_utils14 = require("@rjsf/utils");
|
|
801
|
+
var import_react_components15 = require("@fluentui/react-components");
|
|
802
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
803
|
+
function RadioWidget({
|
|
804
|
+
id,
|
|
805
|
+
options,
|
|
806
|
+
value,
|
|
807
|
+
required,
|
|
808
|
+
disabled,
|
|
809
|
+
readonly,
|
|
810
|
+
label,
|
|
811
|
+
hideLabel,
|
|
812
|
+
onChange,
|
|
813
|
+
onBlur,
|
|
814
|
+
onFocus
|
|
815
|
+
}) {
|
|
816
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
817
|
+
const _onChange = (_, data) => onChange((0, import_utils14.enumOptionsValueForIndex)(data.value, enumOptions, emptyValue));
|
|
818
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, (0, import_utils14.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
819
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, (0, import_utils14.enumOptionsValueForIndex)(value2, enumOptions, emptyValue));
|
|
820
|
+
const selectedIndex = (0, import_utils14.enumOptionsIndexForValue)(value, enumOptions) ?? void 0;
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
822
|
+
(0, import_utils14.labelValue)(
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_components15.Label, { required, htmlFor: id, children: label || void 0 }),
|
|
824
|
+
hideLabel
|
|
825
|
+
),
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
827
|
+
import_react_components15.RadioGroup,
|
|
828
|
+
{
|
|
829
|
+
id,
|
|
830
|
+
name: id,
|
|
831
|
+
value: selectedIndex,
|
|
832
|
+
onChange: _onChange,
|
|
833
|
+
onBlur: _onBlur,
|
|
834
|
+
onFocus: _onFocus,
|
|
835
|
+
"aria-describedby": (0, import_utils14.ariaDescribedByIds)(id),
|
|
836
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
837
|
+
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
839
|
+
import_react_components15.Radio,
|
|
840
|
+
{
|
|
841
|
+
id: (0, import_utils14.optionId)(id, index),
|
|
842
|
+
label: option.label,
|
|
843
|
+
value: String(index),
|
|
844
|
+
disabled: disabled || itemDisabled || readonly
|
|
845
|
+
},
|
|
846
|
+
index
|
|
847
|
+
);
|
|
848
|
+
})
|
|
849
|
+
}
|
|
850
|
+
)
|
|
851
|
+
] });
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
// src/RangeWidget/RangeWidget.tsx
|
|
855
|
+
var import_utils15 = require("@rjsf/utils");
|
|
856
|
+
var import_react_components16 = require("@fluentui/react-components");
|
|
857
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
858
|
+
function RangeWidget(props) {
|
|
859
|
+
const { value, readonly, disabled, onBlur, onFocus, options, schema, onChange, required, label, hideLabel, id } = props;
|
|
860
|
+
const sliderProps = { value, label, id, name: id, ...(0, import_utils15.rangeSpec)(schema) };
|
|
861
|
+
const _onChange = (_, data) => {
|
|
862
|
+
onChange(data.value ?? options.emptyValue);
|
|
863
|
+
};
|
|
864
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
865
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
867
|
+
(0, import_utils15.labelValue)(
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_components16.Label, { required, htmlFor: id, children: label || void 0 }),
|
|
869
|
+
hideLabel
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
872
|
+
import_react_components16.Slider,
|
|
873
|
+
{
|
|
874
|
+
disabled: disabled || readonly,
|
|
875
|
+
onChange: _onChange,
|
|
876
|
+
onBlur: _onBlur,
|
|
877
|
+
onFocus: _onFocus,
|
|
878
|
+
...sliderProps,
|
|
879
|
+
"aria-describedby": (0, import_utils15.ariaDescribedByIds)(id)
|
|
880
|
+
}
|
|
881
|
+
)
|
|
882
|
+
] });
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// src/SelectWidget/SelectWidget.tsx
|
|
886
|
+
var import_utils16 = require("@rjsf/utils");
|
|
887
|
+
var import_react_components17 = require("@fluentui/react-components");
|
|
888
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
889
|
+
function getValue(data, multiple) {
|
|
890
|
+
if (multiple) {
|
|
891
|
+
return data.selectedOptions;
|
|
892
|
+
}
|
|
893
|
+
return data.selectedOptions[0];
|
|
894
|
+
}
|
|
895
|
+
function SelectWidget({
|
|
896
|
+
id,
|
|
897
|
+
options,
|
|
898
|
+
label,
|
|
899
|
+
hideLabel,
|
|
900
|
+
value,
|
|
901
|
+
required,
|
|
902
|
+
disabled,
|
|
903
|
+
readonly,
|
|
904
|
+
multiple = false,
|
|
905
|
+
autofocus = false,
|
|
906
|
+
rawErrors = [],
|
|
907
|
+
onChange,
|
|
908
|
+
onBlur,
|
|
909
|
+
onFocus
|
|
910
|
+
}) {
|
|
911
|
+
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
912
|
+
const selectedIndexes = (0, import_utils16.enumOptionsIndexForValue)(value, enumOptions, multiple);
|
|
913
|
+
let selectedIndexesAsArray = [];
|
|
914
|
+
if (typeof selectedIndexes === "string") {
|
|
915
|
+
selectedIndexesAsArray = [selectedIndexes];
|
|
916
|
+
} else if (Array.isArray(selectedIndexes)) {
|
|
917
|
+
selectedIndexesAsArray = selectedIndexes.map((index) => String(index));
|
|
918
|
+
}
|
|
919
|
+
const dropdownValue = selectedIndexesAsArray.map((index) => enumOptions ? enumOptions[Number(index)].label : void 0).join(", ");
|
|
920
|
+
const _onBlur = () => onBlur(id, selectedIndexes);
|
|
921
|
+
const _onFocus = () => onFocus(id, selectedIndexes);
|
|
922
|
+
const _onChange = (_, data) => {
|
|
923
|
+
const newValue = getValue(data, multiple);
|
|
924
|
+
return onChange((0, import_utils16.enumOptionsValueForIndex)(newValue, enumOptions, optEmptyVal));
|
|
925
|
+
};
|
|
926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
927
|
+
import_react_components17.Field,
|
|
928
|
+
{
|
|
929
|
+
label: (0, import_utils16.labelValue)(label, hideLabel),
|
|
930
|
+
validationState: rawErrors.length ? "error" : void 0,
|
|
931
|
+
required,
|
|
932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
933
|
+
import_react_components17.Dropdown,
|
|
934
|
+
{
|
|
935
|
+
id,
|
|
936
|
+
name: id,
|
|
937
|
+
multiselect: multiple,
|
|
938
|
+
className: "form-control",
|
|
939
|
+
value: dropdownValue,
|
|
940
|
+
disabled: disabled || readonly,
|
|
941
|
+
autoFocus: autofocus,
|
|
942
|
+
onBlur: _onBlur,
|
|
943
|
+
onFocus: _onFocus,
|
|
944
|
+
onOptionSelect: _onChange,
|
|
945
|
+
selectedOptions: selectedIndexesAsArray,
|
|
946
|
+
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
947
|
+
children: Array.isArray(enumOptions) && enumOptions.map(({ value: value2, label: label2 }, i) => {
|
|
948
|
+
const disabled2 = enumDisabled && enumDisabled.indexOf(value2) !== -1;
|
|
949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_components17.Option, { value: String(i), disabled: disabled2, children: label2 }, i);
|
|
950
|
+
})
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
}
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
var SelectWidget_default = SelectWidget;
|
|
957
|
+
|
|
958
|
+
// src/TextareaWidget/TextareaWidget.tsx
|
|
959
|
+
var import_react_components18 = require("@fluentui/react-components");
|
|
960
|
+
var import_utils17 = require("@rjsf/utils");
|
|
961
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
962
|
+
var useStyles9 = (0, import_react_components18.makeStyles)({
|
|
963
|
+
label: {
|
|
964
|
+
paddingTop: "2px",
|
|
965
|
+
paddingBottom: "2px",
|
|
966
|
+
marginBottom: "2px"
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
function TextareaWidget(props) {
|
|
970
|
+
const {
|
|
971
|
+
id,
|
|
972
|
+
placeholder,
|
|
973
|
+
required,
|
|
974
|
+
readonly,
|
|
975
|
+
disabled,
|
|
976
|
+
value,
|
|
977
|
+
label,
|
|
978
|
+
hideLabel,
|
|
979
|
+
onChange,
|
|
980
|
+
onChangeOverride,
|
|
981
|
+
onBlur,
|
|
982
|
+
onFocus,
|
|
983
|
+
autofocus,
|
|
984
|
+
options,
|
|
985
|
+
schema
|
|
986
|
+
} = props;
|
|
987
|
+
const classes = useStyles9();
|
|
988
|
+
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
989
|
+
const _onBlur = ({ target: { value: value2 } }) => onBlur(id, value2);
|
|
990
|
+
const _onFocus = ({ target: { value: value2 } }) => onFocus(id, value2);
|
|
991
|
+
let rows = 5;
|
|
992
|
+
if (typeof options.rows === "string" || typeof options.rows === "number") {
|
|
993
|
+
rows = options.rows;
|
|
994
|
+
}
|
|
995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
996
|
+
(0, import_utils17.labelValue)(
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_components18.Label, { htmlFor: id, required, disabled, className: classes.label, children: label }),
|
|
998
|
+
hideLabel
|
|
999
|
+
),
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1001
|
+
import_react_components18.Textarea,
|
|
1002
|
+
{
|
|
1003
|
+
id,
|
|
1004
|
+
name: id,
|
|
1005
|
+
placeholder,
|
|
1006
|
+
autoFocus: autofocus,
|
|
1007
|
+
required,
|
|
1008
|
+
disabled: disabled || readonly,
|
|
1009
|
+
value: value || value === 0 ? value : "",
|
|
1010
|
+
onChange: onChangeOverride || _onChange,
|
|
1011
|
+
onFocus: _onFocus,
|
|
1012
|
+
onBlur: _onBlur,
|
|
1013
|
+
"aria-describedby": (0, import_utils17.ariaDescribedByIds)(id, !!schema.examples),
|
|
1014
|
+
rows
|
|
1015
|
+
}
|
|
1016
|
+
)
|
|
1017
|
+
] });
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// src/Widgets/Widgets.ts
|
|
1021
|
+
function generateWidgets() {
|
|
1022
|
+
return {
|
|
1023
|
+
CheckboxWidget,
|
|
1024
|
+
CheckboxesWidget,
|
|
1025
|
+
RadioWidget,
|
|
1026
|
+
RangeWidget,
|
|
1027
|
+
SelectWidget: SelectWidget_default,
|
|
1028
|
+
TextareaWidget
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
var Widgets_default = generateWidgets();
|
|
1032
|
+
|
|
1033
|
+
// src/Theme/Theme.ts
|
|
1034
|
+
function generateTheme() {
|
|
1035
|
+
return {
|
|
1036
|
+
templates: generateTemplates(),
|
|
1037
|
+
widgets: generateWidgets()
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
var Theme_default = generateTheme();
|
|
1041
|
+
|
|
1042
|
+
// src/FluentForm/FluentForm.ts
|
|
1043
|
+
function generateForm() {
|
|
1044
|
+
return (0, import_core.withTheme)(generateTheme());
|
|
1045
|
+
}
|
|
1046
|
+
var FluentForm_default = generateForm();
|
|
1047
|
+
|
|
1048
|
+
// src/FluentUIRCFrameProvider.tsx
|
|
1049
|
+
var import_react_components19 = require("@fluentui/react-components");
|
|
1050
|
+
var import_react = require("react");
|
|
1051
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1052
|
+
var FluentWrapper = (props) => {
|
|
1053
|
+
const { children, targetDocument } = props;
|
|
1054
|
+
const renderer = (0, import_react.useMemo)(() => (0, import_react_components19.createDOMRenderer)(targetDocument), [targetDocument]);
|
|
1055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_components19.RendererProvider, { renderer, targetDocument, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_components19.FluentProvider, { targetDocument, theme: import_react_components19.teamsLightTheme, children }) });
|
|
1056
|
+
};
|
|
1057
|
+
var __createFluentUIRCFrameProvider = (props) => ({ document }) => {
|
|
1058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FluentWrapper, { targetDocument: document, children: props.children });
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
// src/index.ts
|
|
1062
|
+
var src_default = FluentForm_default;
|
|
1063
|
+
//# sourceMappingURL=index.js.map
|