@headless-adminapp/fluent 0.0.17-alpha.3 → 0.0.17-alpha.31
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/App/AppHeaderContianer.d.ts +5 -1
- package/App/AppHeaderContianer.js +15 -12
- package/App/AppLogo.js +14 -2
- package/App/AppUI.js +9 -1
- package/App/NavigationContainer.d.ts +10 -1
- package/App/NavigationContainer.js +7 -6
- package/App/QuickActionItem.js +1 -1
- package/CommandBar/Button.d.ts +2 -1
- package/CommandBar/Button.js +2 -2
- package/CommandBar/Divider.d.ts +2 -1
- package/CommandBar/Divider.js +2 -2
- package/CommandBar/IconButton.d.ts +2 -1
- package/CommandBar/IconButton.js +2 -2
- package/CommandBar/Label.d.ts +2 -1
- package/CommandBar/Label.js +2 -2
- package/CommandBar/MenuButton.d.ts +2 -1
- package/CommandBar/MenuButton.js +3 -3
- package/CommandBar/MenuItem.js +6 -5
- package/CommandBar/MenuItems.js +3 -3
- package/CommandBar/MenuList.js +4 -3
- package/CommandBar/Wrapper.d.ts +2 -2
- package/CommandBar/Wrapper.js +2 -2
- package/CommandBar/index.d.ts +6 -6
- package/DataGrid/ActionCell.d.ts +1 -1
- package/DataGrid/ActionCell.js +8 -4
- package/DataGrid/CustomizeColumns/AddColumns.js +4 -5
- package/DataGrid/CustomizeColumns/ColumnItem.js +3 -1
- package/DataGrid/GridColumnHeader/FilterForm.js +3 -1
- package/DataGrid/GridColumnHeader/OperatorSelect.js +9 -2
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +8 -8
- package/DataGrid/GridHeaderDesktop.js +0 -1
- package/DataGrid/GridTableContainer.js +22 -23
- package/DataGrid/TableCell/TableCellCheckbox.js +4 -3
- package/DataGrid/TableCell/TableCellLink.js +4 -3
- package/DataGrid/TableCell/TableCellText.js +9 -4
- package/DataGrid/useTableColumns.d.ts +4 -1
- package/DataGrid/useTableColumns.js +184 -167
- package/DialogContainer/PromptDialog.d.ts +3 -2
- package/DialogContainer/PromptDialog.js +10 -6
- package/PageEntityForm/CommandContainer.js +18 -6
- package/PageEntityForm/FormTabRelated.js +1 -2
- package/PageEntityForm/PageEntityFormDesktopContainer.js +6 -6
- package/PageEntityForm/RecordSetNavigatorContainer.js +4 -7
- package/PageEntityForm/RelatedViewSelector.js +4 -2
- package/PageEntityForm/SectionContainer.js +18 -4
- package/PageEntityForm/StandardControl.d.ts +2 -2
- package/PageEntityForm/StandardControl.js +75 -112
- package/PageEntityForm/SubgridControl.js +1 -1
- package/componentStore.d.ts +2 -0
- package/componentStore.js +5 -0
- package/components/PageLogin.js +0 -1
- package/form/FormControl.js +1 -1
- package/form/controls/AttachmentControl.d.ts +17 -0
- package/form/controls/AttachmentControl.js +225 -0
- package/form/controls/AttachmentsControl.d.ts +6 -0
- package/form/controls/AttachmentsControl.js +45 -0
- package/form/controls/CurrencyControl.js +38 -6
- package/form/controls/DateControl.d.ts +1 -1
- package/form/controls/DateControl.js +7 -3
- package/form/controls/DateTimeControl.d.ts +1 -1
- package/form/controls/DateTimeControl.js +1 -1
- package/form/controls/EmailControl.d.ts +1 -1
- package/form/controls/EmailControl.js +1 -1
- package/form/controls/LookupControl.js +2 -2
- package/form/controls/MultiSelectControl.d.ts +1 -1
- package/form/controls/MultiSelectControl.js +1 -1
- package/form/controls/MultiSelectLookupControl.js +1 -1
- package/form/controls/NumberControl.js +1 -0
- package/form/controls/PasswordControl.d.ts +1 -1
- package/form/controls/PasswordControl.js +1 -1
- package/form/controls/RichTextControl.d.ts +5 -0
- package/form/controls/RichTextControl.js +33 -0
- package/form/controls/SelectControl.d.ts +1 -1
- package/form/controls/SelectControl.js +1 -1
- package/form/controls/SwitchControl.d.ts +1 -1
- package/form/controls/SwitchControl.js +4 -2
- package/form/controls/TelephoneControl.d.ts +1 -1
- package/form/controls/TelephoneControl.js +1 -1
- package/form/controls/TextAreaControl.d.ts +1 -1
- package/form/controls/TextAreaControl.js +1 -1
- package/form/controls/utils.d.ts +4 -0
- package/form/controls/utils.js +42 -0
- package/form/layout/FormSection/FormSection.js +1 -1
- package/form/layout/FormSection/FormSectionColumn.js +1 -1
- package/form/layout/FormSection/FormSectionLoading.js +1 -1
- package/form/layout/FormTab/FormTab.js +1 -0
- package/package.json +24 -3
- package/styles.css +100 -0
- package/types/index.d.ts +12 -0
- package/App/AppProvider.d.ts +0 -9
- package/App/AppProvider.js +0 -50
- package/DataGrid/getAttributeFormattedValue.d.ts +0 -16
- package/DataGrid/getAttributeFormattedValue.js +0 -92
|
@@ -37,6 +37,8 @@ exports.PromptDialog = PromptDialog;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_components_1 = require("@fluentui/react-components");
|
|
39
39
|
const utils_1 = require("@headless-adminapp/app/dataform/utils");
|
|
40
|
+
const form_1 = require("@headless-adminapp/app/form");
|
|
41
|
+
const locale_1 = require("@headless-adminapp/app/locale");
|
|
40
42
|
const yup_1 = require("@hookform/resolvers/yup");
|
|
41
43
|
const lodash_1 = require("lodash");
|
|
42
44
|
const react_hook_form_1 = require("react-hook-form");
|
|
@@ -45,11 +47,13 @@ const SectionControl_1 = require("../DataForm/SectionControl");
|
|
|
45
47
|
const StandardControl_1 = require("../PageEntityForm/StandardControl");
|
|
46
48
|
function PromptDialog(props) {
|
|
47
49
|
var _a, _b;
|
|
50
|
+
const { language } = (0, locale_1.useLocale)();
|
|
51
|
+
const formValidationStrings = (0, form_1.useFormValidationStrings)();
|
|
48
52
|
const form = (0, react_hook_form_1.useForm)({
|
|
49
53
|
mode: 'all',
|
|
50
54
|
defaultValues: props.defaultValues,
|
|
51
55
|
shouldUnregister: false,
|
|
52
|
-
resolver: (0, exports.formValidator)(props.attributes),
|
|
56
|
+
resolver: (0, exports.formValidator)(props.attributes, language, formValidationStrings),
|
|
53
57
|
});
|
|
54
58
|
return ((0, jsx_runtime_1.jsx)(react_components_1.Dialog, { open: props.open, onOpenChange: () => {
|
|
55
59
|
var _a;
|
|
@@ -70,7 +74,7 @@ function PromptDialog(props) {
|
|
|
70
74
|
: '';
|
|
71
75
|
return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: attribute.label, labelPosition: "left", required: attribute.required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(StandardControl_1.StandardControl, { attribute: attribute, name: attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError }) }));
|
|
72
76
|
} }, attributeName));
|
|
73
|
-
}) })] }), (0, jsx_runtime_1.jsxs)(react_components_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "secondary", onClick: () => {
|
|
77
|
+
}) })] }), (0, jsx_runtime_1.jsxs)(react_components_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "secondary", type: "button", onClick: () => {
|
|
74
78
|
var _a;
|
|
75
79
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
76
80
|
}, children: (_a = props.cancelText) !== null && _a !== void 0 ? _a : 'Cancel' }), (0, jsx_runtime_1.jsx)(react_components_1.Button, { appearance: "primary", disabled: form.formState.submitCount > 0 && !form.formState.isValid, onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -80,19 +84,19 @@ function PromptDialog(props) {
|
|
|
80
84
|
}))();
|
|
81
85
|
}), children: (_b = props.confirmText) !== null && _b !== void 0 ? _b : 'Confirm' })] })] }) }) }));
|
|
82
86
|
}
|
|
83
|
-
exports.formValidator = (0, lodash_1.memoize)(function formValidator(attributes) {
|
|
87
|
+
exports.formValidator = (0, lodash_1.memoize)(function formValidator(attributes, language, strings) {
|
|
84
88
|
return (values, context, options) => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
const validator = (0, exports.generateValidationSchema)(attributes);
|
|
89
|
+
const validator = (0, exports.generateValidationSchema)(attributes, language, strings);
|
|
86
90
|
const resolver = (0, yup_1.yupResolver)(validator);
|
|
87
91
|
const result = yield resolver(values, context, options);
|
|
88
92
|
return result;
|
|
89
93
|
});
|
|
90
94
|
}, (attributes) => JSON.stringify({ attributes }));
|
|
91
|
-
exports.generateValidationSchema = (0, lodash_1.memoize)(function generateValidationSchema(attributes) {
|
|
95
|
+
exports.generateValidationSchema = (0, lodash_1.memoize)(function generateValidationSchema(attributes, language, strings) {
|
|
92
96
|
const columns = Object.keys(attributes);
|
|
93
97
|
return yup.object().shape(Object.assign({}, columns.reduce((acc, column) => {
|
|
94
98
|
const attribute = attributes[column];
|
|
95
|
-
const validationSchema = (0, utils_1.generateAttributeValidationSchema)(attribute,
|
|
99
|
+
const validationSchema = (0, utils_1.generateAttributeValidationSchema)(attribute, language, strings);
|
|
96
100
|
return Object.assign(Object.assign({}, acc), { [column]: validationSchema });
|
|
97
101
|
}, {})));
|
|
98
102
|
}, (attributes) => JSON.stringify({ attributes }));
|
|
@@ -3,18 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CommandContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
6
|
+
const hooks_2 = require("@headless-adminapp/app/hooks");
|
|
6
7
|
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
7
8
|
const recordset_1 = require("@headless-adminapp/app/recordset");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
9
|
+
const hooks_3 = require("@headless-adminapp/app/recordset/hooks");
|
|
10
|
+
const hooks_4 = require("@headless-adminapp/app/route/hooks");
|
|
10
11
|
const icons_1 = require("@headless-adminapp/icons");
|
|
11
12
|
const react_1 = require("react");
|
|
12
13
|
const OverflowCommandBar_1 = require("../OverflowCommandBar");
|
|
13
14
|
const CommandContainer = () => {
|
|
14
15
|
const gridCommands = (0, hooks_1.useMainFormCommands)();
|
|
15
|
-
const router = (0,
|
|
16
|
+
const router = (0, hooks_4.useRouter)();
|
|
17
|
+
const isMobile = (0, hooks_2.useIsMobile)();
|
|
16
18
|
const schema = (0, hooks_1.useDataFormSchema)();
|
|
17
|
-
const [recordSetVisible, setRecordSetVisible] = (0,
|
|
19
|
+
const [recordSetVisible, setRecordSetVisible] = (0, hooks_3.useRecordSetVisibility)();
|
|
18
20
|
const recordSetContext = (0, mutable_1.useContextSelector)(recordset_1.RecordSetContext, (state) => state);
|
|
19
21
|
const extendedCommands = (0, react_1.useMemo)(() => {
|
|
20
22
|
return [
|
|
@@ -28,7 +30,8 @@ const CommandContainer = () => {
|
|
|
28
30
|
},
|
|
29
31
|
],
|
|
30
32
|
...(recordSetContext.logicalName === schema.logicalName &&
|
|
31
|
-
recordSetContext.ids.length > 0
|
|
33
|
+
recordSetContext.ids.length > 0 &&
|
|
34
|
+
!isMobile
|
|
32
35
|
? [
|
|
33
36
|
[
|
|
34
37
|
{
|
|
@@ -43,7 +46,16 @@ const CommandContainer = () => {
|
|
|
43
46
|
: []),
|
|
44
47
|
...gridCommands,
|
|
45
48
|
];
|
|
46
|
-
}, [
|
|
49
|
+
}, [
|
|
50
|
+
gridCommands,
|
|
51
|
+
isMobile,
|
|
52
|
+
recordSetContext.ids.length,
|
|
53
|
+
recordSetContext.logicalName,
|
|
54
|
+
recordSetVisible,
|
|
55
|
+
router,
|
|
56
|
+
schema.logicalName,
|
|
57
|
+
setRecordSetVisible,
|
|
58
|
+
]);
|
|
47
59
|
return (0, jsx_runtime_1.jsx)(OverflowCommandBar_1.OverflowCommandBar, { commands: extendedCommands });
|
|
48
60
|
};
|
|
49
61
|
exports.CommandContainer = CommandContainer;
|
|
@@ -4,11 +4,10 @@ exports.FormTabRelated = FormTabRelated;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
7
|
-
const hooks_2 = require("@headless-adminapp/app/dataform/hooks");
|
|
8
7
|
const FormTab_1 = require("../form/layout/FormTab");
|
|
9
8
|
const SubgridControl_1 = require("./SubgridControl");
|
|
10
9
|
function FormTabRelated({ selectedRelatedItem }) {
|
|
11
|
-
const recordId = (0,
|
|
10
|
+
const recordId = (0, hooks_1.useRecordId)();
|
|
12
11
|
const schema = (0, hooks_1.useDataFormSchema)();
|
|
13
12
|
return ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab, { value: "related", noWrapper: true, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
14
13
|
display: 'flex',
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageEntityFormDesktopContainer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
-
const builders_1 = require("@headless-adminapp/app/builders");
|
|
7
6
|
const dataform_1 = require("@headless-adminapp/app/dataform");
|
|
8
7
|
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
9
8
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
9
|
+
const utils_1 = require("@headless-adminapp/app/locale/utils");
|
|
10
10
|
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
11
|
-
const
|
|
11
|
+
const utils_2 = require("@headless-adminapp/app/utils");
|
|
12
12
|
const react_1 = require("react");
|
|
13
13
|
const react_hook_form_1 = require("react-hook-form");
|
|
14
14
|
const PageBroken_1 = require("../components/PageBroken");
|
|
@@ -21,7 +21,7 @@ const PageEntityFormStringContext_1 = require("./PageEntityFormStringContext");
|
|
|
21
21
|
const RelatedViewSelector_1 = require("./RelatedViewSelector");
|
|
22
22
|
const SectionContainer_1 = require("./SectionContainer");
|
|
23
23
|
const PageEntityFormDesktopContainer = () => {
|
|
24
|
-
var _a, _b;
|
|
24
|
+
var _a, _b, _c;
|
|
25
25
|
const dataState = (0, mutable_1.useContextSelector)(dataform_1.DataFormContext, (state) => state.dataState);
|
|
26
26
|
const strings = (0, PageEntityFormStringContext_1.usePageEntityFormStrings)();
|
|
27
27
|
const recordId = (0, hooks_1.useRecordId)();
|
|
@@ -92,15 +92,15 @@ const PageEntityFormDesktopContainer = () => {
|
|
|
92
92
|
? `- ${strings.unsaved}`
|
|
93
93
|
: !!record
|
|
94
94
|
? `- ${strings.saved}`
|
|
95
|
-
: '' })] }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground3 }, children: (0,
|
|
95
|
+
: '' })] }), (0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground3 }, children: (0, utils_1.localizedLabel)(language, schema) })] }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row' }, children: (_a = formConfig.experience.headerControls) === null || _a === void 0 ? void 0 : _a.map((controlName, index) => {
|
|
96
96
|
const attribute = schema.attributes[controlName];
|
|
97
97
|
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [index > 0 && ((0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: true, style: {
|
|
98
98
|
width: react_components_1.tokens.spacingHorizontalXXL,
|
|
99
99
|
opacity: 0.5,
|
|
100
100
|
} })), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { color: react_components_1.tokens.colorNeutralForeground4 }, children: attribute.label }), (0, jsx_runtime_1.jsx)(react_hook_form_1.Controller, { control: formInstance.control, name: controlName, render: ({ field }) => {
|
|
101
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0,
|
|
101
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: (0, utils_2.getAttributeFormattedValue)(attribute, field.value) }));
|
|
102
102
|
} })] })] }, controlName));
|
|
103
|
-
}) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', paddingBottom: react_components_1.tokens.spacingVerticalS }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.TabList, { selectedValue: activeTab, onTabSelect: (e, value) => setActiveTab(value.value), children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: tab.name, children: (0,
|
|
103
|
+
}) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', paddingBottom: react_components_1.tokens.spacingVerticalS }, children: [(0, jsx_runtime_1.jsxs)(react_components_1.TabList, { selectedValue: activeTab, onTabSelect: (e, value) => setActiveTab(value.value), children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: tab.name, children: (0, utils_1.localizedLabel)(language, tab) }, tab.name))), !!selectedRelatedItem && ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: "related", children: (_c = (_b = selectedRelatedItem.localizedPluralLabels) === null || _b === void 0 ? void 0 : _b[language]) !== null && _c !== void 0 ? _c : selectedRelatedItem.pluralLabel }))] }), (0, jsx_runtime_1.jsx)(RelatedViewSelector_1.RelatedViewSelector, { onSelect: (item) => {
|
|
104
104
|
setSelectedRelatedItem(item);
|
|
105
105
|
setActiveTab('related');
|
|
106
106
|
} })] })] })] }), (0, jsx_runtime_1.jsxs)(FormBody_1.FormBody, { children: [formConfig.experience.tabs.map((tab) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab, { value: tab.name, columnCount: tab.columnCount, columnWidths: tab.columnWidths, children: tab.tabColumns.map((tabColumn, index) => ((0, jsx_runtime_1.jsx)(FormTab_1.FormTab.Column, { children: tabColumn.sections.map((section) => ((0, jsx_runtime_1.jsx)(SectionContainer_1.SectionContainer, { section: section, readOnly: false }, section.name))) }, index))) }, tab.name))), (0, jsx_runtime_1.jsx)(FormTabRelated_1.FormTabRelated, { selectedRelatedItem: selectedRelatedItem })] })] }));
|
|
@@ -6,9 +6,8 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
6
6
|
const ScrollView_1 = require("@headless-adminapp/app/components/ScrollView");
|
|
7
7
|
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
8
8
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
9
|
+
const navigation_1 = require("@headless-adminapp/app/navigation");
|
|
9
10
|
const hooks_2 = require("@headless-adminapp/app/recordset/hooks");
|
|
10
|
-
const hooks_3 = require("@headless-adminapp/app/route/hooks");
|
|
11
|
-
const app_1 = require("@headless-adminapp/core/experience/app");
|
|
12
11
|
const react_1 = require("react");
|
|
13
12
|
const RecordCard_1 = require("./RecordCard");
|
|
14
13
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
@@ -31,8 +30,7 @@ const RecordSetNavigatorContainer = () => {
|
|
|
31
30
|
const [visible] = (0, hooks_2.useRecordSetVisibility)();
|
|
32
31
|
const recordId = (0, hooks_1.useRecordId)();
|
|
33
32
|
const styles = useStyles();
|
|
34
|
-
const
|
|
35
|
-
const router = (0, hooks_3.useRouter)();
|
|
33
|
+
const openForm = (0, navigation_1.useOpenForm)();
|
|
36
34
|
const { language, direction } = (0, locale_1.useLocale)();
|
|
37
35
|
if (!schema) {
|
|
38
36
|
return null;
|
|
@@ -60,12 +58,11 @@ const RecordSetNavigatorContainer = () => {
|
|
|
60
58
|
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1Strong, { children: (_b = (_a = schema.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : schema === null || schema === void 0 ? void 0 : schema.pluralLabel }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: false, style: { opacity: 0.2 } }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(ScrollView_1.ScrollView, { autoHide: true, rtl: direction === 'rtl', children: data === null || data === void 0 ? void 0 : data.map((record) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { role: "button", className: (0, react_components_1.mergeClasses)(styles.item, recordId ===
|
|
61
59
|
record[schema.idAttribute] &&
|
|
62
60
|
styles.selected), onClick: () => {
|
|
63
|
-
|
|
64
|
-
type: app_1.PageType.EntityForm,
|
|
61
|
+
openForm({
|
|
65
62
|
logicalName: schema.logicalName,
|
|
66
63
|
id: record[schema.idAttribute],
|
|
64
|
+
replace: true,
|
|
67
65
|
});
|
|
68
|
-
router.replace(path);
|
|
69
66
|
}, children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: cardView, record: record, schema: schema, selected: recordId ===
|
|
70
67
|
record[schema.idAttribute] }) }), (0, jsx_runtime_1.jsx)("div", { style: { paddingInline: react_components_1.tokens.spacingHorizontalL }, children: (0, jsx_runtime_1.jsx)(react_components_1.Divider, { vertical: false, style: { opacity: 0.2 } }) })] }, record[schema.idAttribute]))) }) })] }) }));
|
|
71
68
|
};
|
|
@@ -28,6 +28,7 @@ function getRelatedItems(currentSchema, schemas) {
|
|
|
28
28
|
})
|
|
29
29
|
.filter(Boolean)
|
|
30
30
|
.map((item) => {
|
|
31
|
+
var _a, _b;
|
|
31
32
|
if (!item) {
|
|
32
33
|
throw new Error('item is null');
|
|
33
34
|
}
|
|
@@ -36,8 +37,8 @@ function getRelatedItems(currentSchema, schemas) {
|
|
|
36
37
|
logicalName: s.logicalName,
|
|
37
38
|
label: s.label,
|
|
38
39
|
localizedLabels: s.localizedLabels,
|
|
39
|
-
pluralLabel: s.pluralLabel,
|
|
40
|
-
localizedPluralLabels: s.localizedPluralLabels,
|
|
40
|
+
pluralLabel: (_a = item.attribute.relatedLabel) !== null && _a !== void 0 ? _a : s.pluralLabel,
|
|
41
|
+
localizedPluralLabels: (_b = item.attribute.localizedRelatedLabel) !== null && _b !== void 0 ? _b : s.localizedPluralLabels,
|
|
41
42
|
attributeName: item.key,
|
|
42
43
|
};
|
|
43
44
|
});
|
|
@@ -70,6 +71,7 @@ function RelatedViewSelector(props) {
|
|
|
70
71
|
outlineStyle: 'none',
|
|
71
72
|
textTransform: 'none',
|
|
72
73
|
columnGap: react_components_1.tokens.spacingHorizontalSNudge,
|
|
74
|
+
color: react_components_1.tokens.colorNeutralForeground2,
|
|
73
75
|
}, children: [strings.related, (0, jsx_runtime_1.jsx)(icons_1.Icons.ChevronDown, { size: 16 })] }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsx)(react_components_1.MenuList, { children: data.map((item) => {
|
|
74
76
|
var _a, _b;
|
|
75
77
|
return ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { onClick: () => props.onSelect(item), children: (_b = (_a = item.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[language]) !== null && _b !== void 0 ? _b : item.pluralLabel }, item.key));
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SectionContainer = SectionContainer;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const builders_1 = require("@headless-adminapp/app/builders");
|
|
6
5
|
const hooks_1 = require("@headless-adminapp/app/dataform/hooks");
|
|
7
6
|
const locale_1 = require("@headless-adminapp/app/locale");
|
|
7
|
+
const utils_1 = require("@headless-adminapp/app/locale/utils");
|
|
8
8
|
const react_hook_form_1 = require("react-hook-form");
|
|
9
|
+
const componentStore_1 = require("../componentStore");
|
|
9
10
|
const SectionControl_1 = require("../DataForm/SectionControl");
|
|
10
11
|
const layout_1 = require("../form/layout");
|
|
11
12
|
const StandardControl_1 = require("./StandardControl");
|
|
@@ -16,11 +17,18 @@ function SectionContainer({ section }) {
|
|
|
16
17
|
const recordId = (0, hooks_1.useRecordId)();
|
|
17
18
|
const readonly = (0, hooks_1.useFormIsReadonly)();
|
|
18
19
|
const { language } = (0, locale_1.useLocale)();
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(layout_1.FormSection, { title: (0,
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(layout_1.FormSection, { title: (0, utils_1.localizedLabel)(language, section), columnCount: section.columnCount, labelPosition: section.labelPosition, noPadding: section.noPadding, hideLabel: section.hideLabel, children: section.controls.map((control, index) => {
|
|
20
21
|
var _a;
|
|
21
22
|
switch (control.type) {
|
|
22
|
-
case 'standard':
|
|
23
|
+
case 'standard': {
|
|
23
24
|
const attribute = schema.attributes[control.attributeName];
|
|
25
|
+
let Control = StandardControl_1.StandardControl;
|
|
26
|
+
if (control.component) {
|
|
27
|
+
const OverrideControl = componentStore_1.componentStore.getComponent(control.component);
|
|
28
|
+
if (OverrideControl) {
|
|
29
|
+
Control = OverrideControl;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
24
32
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
25
33
|
gridColumn: control.span
|
|
26
34
|
? `var(--section-item-span-${control.span})`
|
|
@@ -33,8 +41,14 @@ function SectionContainer({ section }) {
|
|
|
33
41
|
? (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message
|
|
34
42
|
: '';
|
|
35
43
|
const label = (_g = (_f = (_d = (_c = control.localizedLabels) === null || _c === void 0 ? void 0 : _c[language]) !== null && _d !== void 0 ? _d : (_e = attribute.localizedLabels) === null || _e === void 0 ? void 0 : _e[language]) !== null && _f !== void 0 ? _f : control.label) !== null && _g !== void 0 ? _g : attribute.label;
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: attribute.required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: attribute.required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: field.onChange, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError, disabled: readonly, label: label, placeholder: label, allowNavigation: true, allowNewRecord: true, fileServiceContext: {
|
|
45
|
+
type: 'entity-form',
|
|
46
|
+
recordId,
|
|
47
|
+
attributeName: control.attributeName,
|
|
48
|
+
logicalName: schema.logicalName,
|
|
49
|
+
} }) }));
|
|
37
50
|
} }, control.attributeName) }, control.attributeName));
|
|
51
|
+
}
|
|
38
52
|
case 'editablegrid': {
|
|
39
53
|
return null;
|
|
40
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Attribute } from '@headless-adminapp/core/attributes';
|
|
2
2
|
import { FC } from 'react';
|
|
3
|
-
interface StandardControlProps {
|
|
3
|
+
export interface StandardControlProps {
|
|
4
4
|
attribute: Attribute;
|
|
5
5
|
label?: string;
|
|
6
6
|
isError: boolean;
|
|
@@ -10,6 +10,7 @@ interface StandardControlProps {
|
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
onChange: (value: any) => void;
|
|
12
12
|
onBlur: () => void;
|
|
13
|
+
fileServiceContext?: Record<string, unknown>;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
borderOnFocusOnly?: boolean;
|
|
15
16
|
hideLabel?: boolean;
|
|
@@ -21,4 +22,3 @@ interface StandardControlProps {
|
|
|
21
22
|
allowNewRecord?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export declare const StandardControl: FC<StandardControlProps>;
|
|
24
|
-
export {};
|
|
@@ -8,6 +8,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const hooks_1 = require("@headless-adminapp/app/metadata/hooks");
|
|
9
9
|
const transport_1 = require("@headless-adminapp/app/transport");
|
|
10
10
|
const react_1 = require("react");
|
|
11
|
+
const componentStore_1 = require("../componentStore");
|
|
12
|
+
const AttachmentControl_1 = require("../form/controls/AttachmentControl");
|
|
13
|
+
const AttachmentsControl_1 = require("../form/controls/AttachmentsControl");
|
|
11
14
|
const CurrencyControl_1 = require("../form/controls/CurrencyControl");
|
|
12
15
|
const DateControl_1 = require("../form/controls/DateControl");
|
|
13
16
|
const DateRangeControl_1 = require("../form/controls/DateRangeControl");
|
|
@@ -17,22 +20,24 @@ const LookupControl_1 = require("../form/controls/LookupControl");
|
|
|
17
20
|
const MultiSelectControl_1 = __importDefault(require("../form/controls/MultiSelectControl"));
|
|
18
21
|
const MultiSelectLookupControl_1 = require("../form/controls/MultiSelectLookupControl");
|
|
19
22
|
const NumberControl_1 = require("../form/controls/NumberControl");
|
|
23
|
+
const RichTextControl_1 = require("../form/controls/RichTextControl");
|
|
20
24
|
const SelectControl_1 = __importDefault(require("../form/controls/SelectControl"));
|
|
21
25
|
const SwitchControl_1 = require("../form/controls/SwitchControl");
|
|
22
26
|
const TelephoneControl_1 = require("../form/controls/TelephoneControl");
|
|
23
27
|
const TextAreaControl_1 = require("../form/controls/TextAreaControl");
|
|
24
28
|
const TextControl_1 = require("../form/controls/TextControl");
|
|
25
|
-
const StandardControl = (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const StandardControl = (props) => {
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
31
|
+
const { attribute, label: _label, isError,
|
|
32
|
+
// errorMessage,
|
|
33
|
+
name, value, onBlur, onChange,
|
|
34
|
+
// dataService,
|
|
35
|
+
// fileService,
|
|
36
|
+
disabled, borderOnFocusOnly, placeholder: _placeholder,
|
|
37
|
+
// hideLabel,
|
|
38
|
+
hidePlaceholder, readOnly,
|
|
39
|
+
// quickViewControl,
|
|
40
|
+
allowNavigation, allowNewRecord, } = props;
|
|
36
41
|
const isDisabled = attribute.readonly || disabled;
|
|
37
42
|
// const label = hideLabel ? undefined : _label ?? attribute.label;
|
|
38
43
|
const placeholder = hidePlaceholder
|
|
@@ -40,6 +45,7 @@ allowNavigation, allowNewRecord, }) => {
|
|
|
40
45
|
: (_a = _placeholder !== null && _placeholder !== void 0 ? _placeholder : _label) !== null && _a !== void 0 ? _a : attribute.label;
|
|
41
46
|
// const required = quickViewControl ? false : attribute.required;
|
|
42
47
|
const dataService = (0, transport_1.useDataService)();
|
|
48
|
+
const fileService = (0, transport_1.useFileService)();
|
|
43
49
|
const { schemaStore, experienceStore } = (0, hooks_1.useMetadata)();
|
|
44
50
|
// const { openQuickCreate } = useQuickCreateForm();
|
|
45
51
|
switch (attribute.type) {
|
|
@@ -55,21 +61,37 @@ allowNavigation, allowNewRecord, }) => {
|
|
|
55
61
|
readOnly,
|
|
56
62
|
};
|
|
57
63
|
switch (attribute.format) {
|
|
58
|
-
case 'text':
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
case '
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
case '
|
|
67
|
-
|
|
64
|
+
case 'text': {
|
|
65
|
+
const Control = (_b = componentStore_1.componentStore.getComponent('Form.TextControl')) !== null && _b !== void 0 ? _b : TextControl_1.TextControl;
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps, { textTransform: attribute.textTransform })));
|
|
67
|
+
}
|
|
68
|
+
case 'email': {
|
|
69
|
+
const Control = (_c = componentStore_1.componentStore.getComponent('Form.EmailControl')) !== null && _c !== void 0 ? _c : EmailControl_1.EmailControl;
|
|
70
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
71
|
+
}
|
|
72
|
+
case 'phone': {
|
|
73
|
+
const Control = (_d = componentStore_1.componentStore.getComponent('Form.TelephoneControl')) !== null && _d !== void 0 ? _d : TelephoneControl_1.TelephoneControl;
|
|
74
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
75
|
+
}
|
|
76
|
+
case 'url': {
|
|
77
|
+
const Control = (_e = componentStore_1.componentStore.getComponent('Form.UrlControl')) !== null && _e !== void 0 ? _e : TextControl_1.TextControl;
|
|
78
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
79
|
+
}
|
|
80
|
+
case 'textarea': {
|
|
81
|
+
const Control = (_f = componentStore_1.componentStore.getComponent('Form.TextAreaControl')) !== null && _f !== void 0 ? _f : TextAreaControl_1.TextAreaControl;
|
|
82
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
83
|
+
}
|
|
84
|
+
case 'richtext': {
|
|
85
|
+
const Control = (_g = componentStore_1.componentStore.getComponent('Form.RichTextControl')) !== null && _g !== void 0 ? _g : RichTextControl_1.RichTextControl;
|
|
86
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
87
|
+
}
|
|
68
88
|
default:
|
|
69
89
|
return (0, jsx_runtime_1.jsx)(react_1.Fragment, {});
|
|
70
90
|
}
|
|
71
|
-
case 'number':
|
|
72
|
-
|
|
91
|
+
case 'number': {
|
|
92
|
+
const Control = (_h = componentStore_1.componentStore.getComponent('Form.NumberControl')) !== null && _h !== void 0 ? _h : NumberControl_1.NumberControl;
|
|
93
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, placeholder: placeholder, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, readOnly: readOnly }));
|
|
94
|
+
}
|
|
73
95
|
case 'date': {
|
|
74
96
|
const controlProps = {
|
|
75
97
|
name,
|
|
@@ -82,10 +104,12 @@ allowNavigation, allowNewRecord, }) => {
|
|
|
82
104
|
readOnly,
|
|
83
105
|
};
|
|
84
106
|
if (attribute.format === 'datetime') {
|
|
85
|
-
|
|
107
|
+
const Control = (_j = componentStore_1.componentStore.getComponent('Form.DateTimeControl')) !== null && _j !== void 0 ? _j : DateTimeControl_1.DateTimeControl;
|
|
108
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
86
109
|
}
|
|
87
110
|
else {
|
|
88
|
-
|
|
111
|
+
const Control = (_k = componentStore_1.componentStore.getComponent('Form.DateControl')) !== null && _k !== void 0 ? _k : DateControl_1.DateControl;
|
|
112
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
89
113
|
}
|
|
90
114
|
}
|
|
91
115
|
case 'daterange': {
|
|
@@ -99,105 +123,40 @@ allowNavigation, allowNewRecord, }) => {
|
|
|
99
123
|
disabled: isDisabled,
|
|
100
124
|
readOnly,
|
|
101
125
|
};
|
|
102
|
-
|
|
126
|
+
const Control = (_l = componentStore_1.componentStore.getComponent('Form.DateRangeControl')) !== null && _l !== void 0 ? _l : DateRangeControl_1.DateRangeControl;
|
|
127
|
+
return (0, jsx_runtime_1.jsx)(Control, Object.assign({}, controlProps));
|
|
103
128
|
}
|
|
104
129
|
case 'money': {
|
|
105
|
-
|
|
130
|
+
const Control = (_m = componentStore_1.componentStore.getComponent('Form.CurrencyControl')) !== null && _m !== void 0 ? _m : CurrencyControl_1.CurrencyControl;
|
|
131
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, placeholder: placeholder, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
|
|
106
132
|
}
|
|
107
133
|
case 'lookup': {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// const path = routes?.create?.();
|
|
111
|
-
// let createButtonProps:
|
|
112
|
-
// | {
|
|
113
|
-
// label: string;
|
|
114
|
-
// onClick: () => void;
|
|
115
|
-
// }
|
|
116
|
-
// | undefined;
|
|
117
|
-
// if (allowQuickCreate && experienceSchema.defaultQuickCreateForm) {
|
|
118
|
-
// createButtonProps = {
|
|
119
|
-
// label: 'New record',
|
|
120
|
-
// onClick: async () => {
|
|
121
|
-
// try {
|
|
122
|
-
// const result = await openQuickCreate({
|
|
123
|
-
// logicalName: attribute.entity,
|
|
124
|
-
// });
|
|
125
|
-
// if (result) {
|
|
126
|
-
// onChange(result);
|
|
127
|
-
// }
|
|
128
|
-
// } catch (error) {
|
|
129
|
-
// console.error(error);
|
|
130
|
-
// }
|
|
131
|
-
// },
|
|
132
|
-
// };
|
|
133
|
-
// } else if (path) {
|
|
134
|
-
// createButtonProps = {
|
|
135
|
-
// label: 'New record',
|
|
136
|
-
// onClick: () => {
|
|
137
|
-
// router.push(path);
|
|
138
|
-
// },
|
|
139
|
-
// };
|
|
140
|
-
// }
|
|
141
|
-
// return (
|
|
142
|
-
// <FormControl
|
|
143
|
-
// type="lookup"
|
|
144
|
-
// name={name}
|
|
145
|
-
// label={label}
|
|
146
|
-
// placeholder={placeholder}
|
|
147
|
-
// required={required}
|
|
148
|
-
// value={value}
|
|
149
|
-
// onChange={onChange}
|
|
150
|
-
// onBlur={onBlur}
|
|
151
|
-
// error={isError}
|
|
152
|
-
// helperText={errorMessage}
|
|
153
|
-
// disabled={isDisabled}
|
|
154
|
-
// borderOnFocusOnly={borderOnFocusOnly}
|
|
155
|
-
// readOnly={readOnly}
|
|
156
|
-
// createButton={createButtonProps}
|
|
157
|
-
// openRecord={
|
|
158
|
-
// routes?.edit
|
|
159
|
-
// ? (id) => {
|
|
160
|
-
// router.push(routes.edit!(id));
|
|
161
|
-
// }
|
|
162
|
-
// : undefined
|
|
163
|
-
// }
|
|
164
|
-
// async
|
|
165
|
-
// dataResolver={async (options) => {
|
|
166
|
-
// const lookupSchema = getSchema(attribute.entity);
|
|
167
|
-
// const data = await dataService.retriveRecords({
|
|
168
|
-
// logicalName: attribute.entity,
|
|
169
|
-
// search: options?.search ?? '',
|
|
170
|
-
// columnFilters: {},
|
|
171
|
-
// pagination: {
|
|
172
|
-
// pageIndex: 0,
|
|
173
|
-
// rowsPerPage: 10,
|
|
174
|
-
// sortBy: 'createdAt',
|
|
175
|
-
// sortOrder: 'desc',
|
|
176
|
-
// },
|
|
177
|
-
// viewFilter: null,
|
|
178
|
-
// columns: ['_id', lookupSchema.primaryAttribute ?? 'name'],
|
|
179
|
-
// limit: options?.limit ?? 10,
|
|
180
|
-
// });
|
|
181
|
-
// return data.records.map((x: any) => ({
|
|
182
|
-
// _id: x._id,
|
|
183
|
-
// name: x[lookupSchema.primaryAttribute ?? 'name'],
|
|
184
|
-
// }));
|
|
185
|
-
// }}
|
|
186
|
-
// />
|
|
187
|
-
// );
|
|
188
|
-
return ((0, jsx_runtime_1.jsx)(LookupControl_1.LookupControl, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
|
|
134
|
+
const Control = (_o = componentStore_1.componentStore.getComponent('Form.LookupControl')) !== null && _o !== void 0 ? _o : LookupControl_1.LookupControl;
|
|
135
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
|
|
189
136
|
}
|
|
190
137
|
case 'lookups': {
|
|
191
|
-
|
|
138
|
+
const Control = (_p = componentStore_1.componentStore.getComponent('Form.MultiSelectLookupControl')) !== null && _p !== void 0 ? _p : MultiSelectLookupControl_1.MultiSelectLookupControl;
|
|
139
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, placeholder: placeholder, disabled: isDisabled, dataService: dataService, schema: schemaStore.getSchema(attribute.entity), experienceStore: experienceStore, allowNavigation: allowNavigation, allowNewRecord: allowNewRecord }));
|
|
192
140
|
}
|
|
193
141
|
case 'boolean': {
|
|
194
|
-
|
|
142
|
+
const Control = (_q = componentStore_1.componentStore.getComponent('Form.SwitchControl')) !== null && _q !== void 0 ? _q : SwitchControl_1.SwitchControl;
|
|
143
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, readOnly: readOnly }));
|
|
195
144
|
}
|
|
196
145
|
case 'choice': {
|
|
197
|
-
|
|
146
|
+
const Control = (_r = componentStore_1.componentStore.getComponent('Form.SelectControl')) !== null && _r !== void 0 ? _r : SelectControl_1.default;
|
|
147
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
|
|
198
148
|
}
|
|
199
149
|
case 'choices': {
|
|
200
|
-
|
|
150
|
+
const Control = (_s = componentStore_1.componentStore.getComponent('Form.MultiSelectControl')) !== null && _s !== void 0 ? _s : MultiSelectControl_1.default;
|
|
151
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, options: attribute.options, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
|
|
152
|
+
}
|
|
153
|
+
case 'attachment': {
|
|
154
|
+
const Control = (_t = componentStore_1.componentStore.getComponent('Form.AttachmentControl')) !== null && _t !== void 0 ? _t : AttachmentControl_1.AttachmentControl;
|
|
155
|
+
return ((0, jsx_runtime_1.jsx)(Control, { fileService: fileService, format: attribute.format, location: attribute.location, name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly, fileServiceContext: props.fileServiceContext }));
|
|
156
|
+
}
|
|
157
|
+
case 'attachments': {
|
|
158
|
+
const Control = (_u = componentStore_1.componentStore.getComponent('Form.AttachmentsControl')) !== null && _u !== void 0 ? _u : AttachmentsControl_1.AttachmentsControl;
|
|
159
|
+
return ((0, jsx_runtime_1.jsx)(Control, { name: name, value: value, onChange: onChange, onBlur: onBlur, error: isError, disabled: isDisabled, placeholder: placeholder, borderOnFocusOnly: borderOnFocusOnly, readOnly: readOnly }));
|
|
201
160
|
}
|
|
202
161
|
// case 'attachment': {
|
|
203
162
|
// return (
|
|
@@ -222,6 +181,10 @@ allowNavigation, allowNewRecord, }) => {
|
|
|
222
181
|
// );
|
|
223
182
|
// }
|
|
224
183
|
}
|
|
184
|
+
const FallBackControl = componentStore_1.componentStore.getComponent('StandardControl.FallBack');
|
|
185
|
+
if (FallBackControl) {
|
|
186
|
+
return (0, jsx_runtime_1.jsx)(FallBackControl, Object.assign({}, props));
|
|
187
|
+
}
|
|
225
188
|
return (0, jsx_runtime_1.jsx)(react_1.Fragment, {});
|
|
226
189
|
};
|
|
227
190
|
exports.StandardControl = StandardControl;
|
|
@@ -62,5 +62,5 @@ function SubgridControl(props) {
|
|
|
62
62
|
}
|
|
63
63
|
return brokenContent;
|
|
64
64
|
}
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: viewLookup, onChangeView: setViewId, commands: (props.associated ? subgridCommands : commands), isSubGrid: props.associated ? true : false, extraFilter: extraFilter, allowViewSelection: (_a = props.allowViewSelection) !== null && _a !== void 0 ? _a : false, children: (0, jsx_runtime_1.jsx)(FormSubgridContainer_1.FormSubgridContainer, {}) }));
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(DataGridProvider_1.DataGridProvider, { schema: schema, view: view, views: viewLookup, onChangeView: setViewId, commands: (props.associated ? subgridCommands : commands), isSubGrid: props.associated ? true : false, associated: props.associated, extraFilter: extraFilter, allowViewSelection: (_a = props.allowViewSelection) !== null && _a !== void 0 ? _a : false, children: (0, jsx_runtime_1.jsx)(FormSubgridContainer_1.FormSubgridContainer, {}) }));
|
|
66
66
|
}
|
package/components/PageLogin.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageLogin = PageLogin;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/* eslint-disable @next/next/no-img-element */
|
|
6
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
7
6
|
const LoginForm_1 = require("./LoginForm");
|
|
8
7
|
function PageLogin(props) {
|
package/form/FormControl.js
CHANGED
|
@@ -86,7 +86,7 @@ function randomUUID() {
|
|
|
86
86
|
return Math.random().toString(36).substring(2, 15);
|
|
87
87
|
}
|
|
88
88
|
function FormControl(props) {
|
|
89
|
-
const { label, id, onChange
|
|
89
|
+
const { label, id, onChange } = props;
|
|
90
90
|
const _id = (0, react_1.useMemo)(() => id || randomUUID(), [id]);
|
|
91
91
|
const noop = (0, react_1.useCallback)(() => { }, []);
|
|
92
92
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column' }, children: [(0, jsx_runtime_1.jsx)(react_components_1.Label, { style: { width: 160, marginTop: 4 }, children: label }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flex: 1, flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(Control, Object.assign({ id: _id, onChange: onChange || noop }, props)) })] }));
|