@headless-adminapp/fluent 1.4.24 → 1.4.26
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.js +33 -16
- package/App/LayoutProvider.d.ts +2 -1
- package/App/LayoutProvider.js +3 -2
- package/App/Navigation/NavCategoryItemComponent.js +4 -1
- package/App/Navigation/NavItemComponent.js +4 -1
- package/App/Navigation/NavMiniCategoryMenu.js +3 -2
- package/App/QuickActionItem.js +5 -4
- package/CommandBar/Button.js +2 -3
- package/CommandBar/IconButton.js +2 -1
- package/CommandBar/Label.js +2 -2
- package/CommandBar/MenuButton.js +5 -2
- package/CommandBar/MenuItem.js +3 -2
- package/CommandBar/MenuList.js +2 -1
- package/CommandBar/Wrapper.js +1 -0
- package/DataGrid/CustomFilter/ColumnFilterItem.js +4 -2
- package/DataGrid/CustomFilter/CustomFilter.js +2 -1
- package/DataGrid/CustomizeColumns/AddColumns.js +5 -5
- package/DataGrid/CustomizeColumns/ColumnItem.js +4 -3
- package/DataGrid/CustomizeColumns/CustomizeColumns.js +4 -3
- package/DataGrid/FormSubgridViewSelector.js +3 -2
- package/DataGrid/GridColumnHeader/FilterForm.js +2 -1
- package/DataGrid/GridColumnHeader/TableHeaderFilterCell.js +4 -3
- package/DataGrid/GridHeaderDesktop.js +3 -2
- package/DataGrid/GridHeaderDesktopV2.js +8 -7
- package/DataGrid/GridHeaderMobile.js +3 -2
- package/DataGrid/GridListContainer.js +6 -5
- package/DataGrid/MobileHeaderTitleContainer.js +3 -2
- package/DataGrid/TableCell/TableCellAction.js +3 -2
- package/DataGrid/TableCell/TableCellCheckbox.js +2 -1
- package/DataGrid/useTableColumns.js +10 -1
- package/DialogContainer/AlertDialog.js +2 -1
- package/DialogContainer/ConfirmDialog.js +3 -2
- package/DialogContainer/ErrorDialog.js +3 -2
- package/DialogContainer/PromptDialog.js +4 -3
- package/Header/MobileHeaderCommandContainer.js +11 -10
- package/Header/MobileHeaderQuickActionButton.js +2 -2
- package/Insights/Header.js +7 -2
- package/Insights/InsightsContainer.js +22 -20
- package/Insights/WidgetDataGridContainer.js +8 -5
- package/Insights/WidgetSection.js +2 -1
- package/Insights/WidgetTileContainer.js +2 -1
- package/OverflowCommandBar/OverflowMenu.js +2 -1
- package/PageBoard/BoardColumnCard.js +2 -1
- package/PageBoard/BoardColumnUI.js +3 -2
- package/PageBoard/BoardingColumnCardLoading.js +2 -1
- package/PageBoard/Header.js +2 -1
- package/PageBoard/PageBoard.js +2 -1
- package/PageCalendar/CalendarSection.js +3 -2
- package/PageCalendar/EventDialog/EventDialog.js +2 -1
- package/PageCalendar/EventDialog/EventFormBody.js +3 -2
- package/PageCalendar/Header.js +4 -2
- package/PageCalendar/TitleSelector.js +3 -2
- package/PageCalendar/ViewSelector.js +2 -1
- package/PageCalendar/renderEventContent.js +5 -4
- package/PageEntityForm/EditableGridControl/CardUi.js +4 -4
- package/PageEntityForm/EditableGridControl/EditableGridControl.js +2 -1
- package/PageEntityForm/EditableGridControl/TableUi.js +3 -2
- package/PageEntityForm/FormTabRelated.js +2 -1
- package/PageEntityForm/PageCustomEntityForm.js +2 -0
- package/PageEntityForm/PageEntityFormDesktopContainer.js +8 -4
- package/PageEntityForm/RecordSetNavigatorContainer.js +2 -1
- package/PageEntityForm/RelatedViewSelector.js +2 -2
- package/PageEntityForm/TabContainer.js +5 -1
- package/PageEntityForm/UploadImageDialog.js +6 -5
- package/PageEntityView/FormSubgridContainer.js +3 -2
- package/PageEntityView/PageEntityViewDesktopFrame.js +3 -2
- package/PageEntityView/PageEntityViewDesktopFrameV2.js +2 -1
- package/PageEntityView/PageEntityViewMobileFrame.js +2 -1
- package/ProgressIndicatorContainer/index.js +2 -1
- package/QuickCreateContainer/FormContainer.js +2 -1
- package/components/ComponentErrorBoundary.d.ts +1 -1
- package/components/DialogLogin.js +2 -1
- package/components/DrawerHeader.js +3 -2
- package/components/LoginForm.js +2 -1
- package/components/PageBroken.js +2 -1
- package/components/PageLogin.js +2 -1
- package/components/fluent/Button.d.ts +4 -0
- package/components/fluent/Button.js +38 -0
- package/components/fluent/Checkbox.d.ts +4 -0
- package/components/fluent/Checkbox.js +18 -0
- package/components/fluent/Combobox.d.ts +4 -0
- package/components/fluent/Combobox.js +22 -0
- package/components/fluent/DialogSurface.d.ts +4 -0
- package/components/fluent/DialogSurface.js +16 -0
- package/components/fluent/Dropdown.d.ts +4 -0
- package/components/fluent/Dropdown.js +43 -0
- package/components/fluent/FluentProvider.d.ts +12 -0
- package/components/fluent/FluentProvider.js +179 -0
- package/components/fluent/Input.d.ts +4 -0
- package/components/fluent/Input.js +43 -0
- package/components/fluent/MenuItem.d.ts +4 -0
- package/components/fluent/MenuItem.js +17 -0
- package/components/fluent/MenuPopover.d.ts +4 -0
- package/components/fluent/MenuPopover.js +17 -0
- package/components/fluent/Option.d.ts +4 -0
- package/components/fluent/Option.js +17 -0
- package/components/fluent/PopoverSurface.d.ts +4 -0
- package/components/fluent/PopoverSurface.js +16 -0
- package/components/fluent/SearchBox.d.ts +4 -0
- package/components/fluent/SearchBox.js +42 -0
- package/components/fluent/SpinButton.d.ts +4 -0
- package/components/fluent/SpinButton.js +17 -0
- package/components/fluent/Tag.d.ts +4 -0
- package/components/fluent/Tag.js +16 -0
- package/components/fluent/Textarea.d.ts +4 -0
- package/components/fluent/Textarea.js +30 -0
- package/components/fluent/ToolbarButton.d.ts +6 -0
- package/components/fluent/ToolbarButton.js +22 -0
- package/components/fluent/index.d.ts +17 -0
- package/components/fluent/index.js +38 -0
- package/components/fluent/tokens.d.ts +29 -0
- package/components/fluent/tokens.js +32 -0
- package/form/controls/AttachmentControl.js +9 -8
- package/form/controls/AttachmentsControl.js +6 -2
- package/form/controls/CurrencyControl.js +2 -2
- package/form/controls/DateControl.js +7 -0
- package/form/controls/DateRangeControl/DateRangeControl.js +3 -2
- package/form/controls/DateRangeControl/PopoverContent.js +3 -2
- package/form/controls/DateTimeControl.js +17 -2
- package/form/controls/DecimalControl.js +2 -2
- package/form/controls/DurationControl.js +8 -2
- package/form/controls/EmailControl.js +3 -2
- package/form/controls/IntegerControl.js +2 -2
- package/form/controls/LookupControl.js +10 -4
- package/form/controls/MultiSelectControl.js +11 -2
- package/form/controls/MultiSelectLookupControl.js +12 -5
- package/form/controls/PasswordControl.js +6 -2
- package/form/controls/RegardingControl.js +7 -5
- package/form/controls/SelectControl.js +12 -2
- package/form/controls/SkeletonControl.js +6 -1
- package/form/controls/TelephoneControl.js +3 -2
- package/form/controls/TextAreaControl.js +2 -2
- package/form/controls/TextControl.js +6 -5
- package/form/controls/TimeControl/TimeControl.js +8 -1
- package/form/controls/UrlControl.js +3 -2
- package/form/layout/FormSection/FormSection.js +2 -2
- package/package.json +2 -2
- package/styles.css +1 -5
|
@@ -6,6 +6,8 @@ const react_components_1 = require("@fluentui/react-components");
|
|
|
6
6
|
const utils_1 = require("@headless-adminapp/app/utils");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
9
|
+
const fluent_1 = require("../../components/fluent");
|
|
10
|
+
const Option_1 = require("../../components/fluent/Option");
|
|
9
11
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
10
12
|
listbox: {
|
|
11
13
|
maxHeight: '300px !important',
|
|
@@ -118,7 +120,11 @@ const DurationControl = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
118
120
|
if (skeleton) {
|
|
119
121
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
120
122
|
}
|
|
121
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', width: '100%' }, children: (0, jsx_runtime_1.jsx)(
|
|
123
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { position: 'relative', width: '100%' }, children: (0, jsx_runtime_1.jsx)(fluent_1.Combobox, { name: name, appearance: "filled-darker", placeholder: placeholder, inputMode: "search", style: {
|
|
124
|
+
width: '100%',
|
|
125
|
+
minWidth: 'unset',
|
|
126
|
+
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
127
|
+
}, listbox: { className: styles.listbox }, autoComplete: "off", readOnly: readOnly || disabled, value: searchText, disableAutoFocus: true, selectedOptions: value ? [value.toString()] : [], onBlur: () => {
|
|
122
128
|
let newValue = null;
|
|
123
129
|
if (searchText) {
|
|
124
130
|
newValue = resolveValue(searchText);
|
|
@@ -143,7 +149,7 @@ const DurationControl = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
143
149
|
onChange?.(Number(item.optionValue));
|
|
144
150
|
}
|
|
145
151
|
setSearchText('');
|
|
146
|
-
}, children: filteredItems.map((item) => ((0, jsx_runtime_1.jsx)(
|
|
152
|
+
}, children: filteredItems.map((item) => ((0, jsx_runtime_1.jsx)(Option_1.Option, { value: item.value, children: item.text }, item.value))) }) }));
|
|
147
153
|
};
|
|
148
154
|
exports.DurationControl = DurationControl;
|
|
149
155
|
function resolveValue(value) {
|
|
@@ -4,6 +4,7 @@ exports.EmailControl = EmailControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const icons_1 = require("@headless-adminapp/icons");
|
|
7
|
+
const fluent_1 = require("../../components/fluent");
|
|
7
8
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
9
|
function EmailControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoComplete, textTransform, readOnly, skeleton, }) {
|
|
9
10
|
if (skeleton) {
|
|
@@ -19,7 +20,7 @@ function EmailControl({ value, onChange, id, name, onBlur, onFocus, placeholder,
|
|
|
19
20
|
}
|
|
20
21
|
onChange?.(value);
|
|
21
22
|
};
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Input, { type: "email", placeholder: placeholder, id: id, appearance: "filled-darker", name: name,
|
|
23
24
|
// size="sm"
|
|
24
25
|
value: value ?? '', onChange: handleOnChange, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
25
26
|
// invalid={error}
|
|
@@ -27,5 +28,5 @@ function EmailControl({ value, onChange, id, name, onBlur, onFocus, placeholder,
|
|
|
27
28
|
flex: 1,
|
|
28
29
|
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
29
30
|
width: '100%',
|
|
30
|
-
}, contentAfter: value ? ((0, jsx_runtime_1.jsx)(
|
|
31
|
+
}, contentAfter: value ? ((0, jsx_runtime_1.jsx)(fluent_1.Button, { onClick: () => window.open(`mailto:${value}`, '_blank'), color: "primary", appearance: "transparent", icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Mail, {}), size: "small" })) : undefined }));
|
|
31
32
|
}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IntegerControl = IntegerControl;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
/* eslint-disable unused-imports/no-unused-vars */
|
|
6
|
-
const
|
|
6
|
+
const fluent_1 = require("../../components/fluent");
|
|
7
7
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
8
|
function IntegerControl({ value, onChange, id, name, onBlur, onFocus, error, disabled, placeholder, borderOnFocusOnly, readOnly, skeleton, }) {
|
|
9
9
|
if (skeleton) {
|
|
10
10
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
11
11
|
}
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.SpinButton, { appearance: "filled-darker", placeholder: placeholder, id: id, name: name, value: value ?? null, readOnly: readOnly || disabled, style: {
|
|
13
13
|
width: '100%',
|
|
14
14
|
}, input: {
|
|
15
15
|
style: {
|
|
@@ -12,6 +12,8 @@ const app_2 = require("@headless-adminapp/core/experience/app");
|
|
|
12
12
|
const icons_1 = require("@headless-adminapp/icons");
|
|
13
13
|
const react_1 = require("react");
|
|
14
14
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
15
|
+
const fluent_1 = require("../../components/fluent");
|
|
16
|
+
const Option_1 = require("../../components/fluent/Option");
|
|
15
17
|
const RecordCard_1 = require("../../PageEntityForm/RecordCard");
|
|
16
18
|
const avatar_1 = require("../../utils/avatar");
|
|
17
19
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
@@ -110,7 +112,11 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
110
112
|
if (skeleton) {
|
|
111
113
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
112
114
|
}
|
|
113
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)(
|
|
115
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)(fluent_1.Combobox, { name: name, appearance: "filled-darker", expandIcon: readOnly || disabled ? null : isLoading ? ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" })) : ((0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 18 })), placeholder: !value ? placeholder : '', inputMode: "search", style: {
|
|
116
|
+
width: '100%',
|
|
117
|
+
minWidth: 'unset',
|
|
118
|
+
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
119
|
+
}, input: {
|
|
114
120
|
style: {
|
|
115
121
|
width: '100%',
|
|
116
122
|
},
|
|
@@ -124,10 +130,10 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
124
130
|
recentItemStore.addItem((0, useLookupData_1.createLookupRecentKey)(schema.logicalName), _item[schema.idAttribute], _item[schema.idAttribute]);
|
|
125
131
|
}
|
|
126
132
|
handleChange(_item ?? null);
|
|
127
|
-
}, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, autoCapitalize: "none", autoCorrect: "off", spellCheck: false, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(
|
|
133
|
+
}, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, autoCapitalize: "none", autoCorrect: "off", spellCheck: false, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(Option_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: view?.experience.card ? ((0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view.experience.card, record: item, schema: schema })) : item[schema.primaryAttribute] }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
128
134
|
paddingInline: react_components_1.tokens.spacingHorizontalL,
|
|
129
135
|
paddingBlock: react_components_1.tokens.spacingVerticalS,
|
|
130
|
-
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: lookupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(
|
|
136
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: lookupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(fluent_1.ToolbarButton, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: async () => {
|
|
131
137
|
if (isQuickCreateSupported) {
|
|
132
138
|
const result = await openQuickCreate({
|
|
133
139
|
logicalName: schema.logicalName,
|
|
@@ -150,7 +156,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
150
156
|
alignItems: 'center',
|
|
151
157
|
paddingInline: 4,
|
|
152
158
|
display: 'flex',
|
|
153
|
-
}, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", children: (0, jsx_runtime_1.jsx)(
|
|
159
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", children: (0, jsx_runtime_1.jsx)(fluent_1.Tag, { as: "span", appearance: "brand", size: "small", dismissible: !disabled && !readOnly, value: value.id, style: {
|
|
154
160
|
paddingRight: !disabled && !readOnly ? 0 : 5,
|
|
155
161
|
background: react_components_1.tokens.colorNeutralBackground6,
|
|
156
162
|
}, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
|
|
@@ -4,6 +4,7 @@ exports.default = MultiSelectControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../../components/fluent");
|
|
7
8
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
9
|
function MultiSelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, }) {
|
|
9
10
|
const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
|
|
@@ -15,9 +16,17 @@ function MultiSelectControl({ value, onChange, options, id, name, disabled, onBl
|
|
|
15
16
|
if (skeleton) {
|
|
16
17
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
17
18
|
}
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Dropdown, { placeholder: placeholder, id: id, name: name, appearance: "filled-darker", multiselect: true, value: selectedOptions.map((x) => x.label).join(', '), selectedOptions: value ? value.map(String) : [], onOptionSelect: (event, data) => {
|
|
19
20
|
handleChange(data.selectedOptions);
|
|
20
21
|
}, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), disabled: disabled, style: {
|
|
21
22
|
width: '100%',
|
|
22
|
-
},
|
|
23
|
+
}, clearButton: {
|
|
24
|
+
style: {
|
|
25
|
+
marginRight: react_components_1.tokens.spacingHorizontalXS,
|
|
26
|
+
},
|
|
27
|
+
}, expandIcon: {
|
|
28
|
+
style: {
|
|
29
|
+
marginRight: -6,
|
|
30
|
+
},
|
|
31
|
+
}, children: transformedOptions.map((x) => ((0, jsx_runtime_1.jsx)(fluent_1.Option, { value: x.value, children: x.label }, x.value))) }));
|
|
23
32
|
}
|
|
@@ -10,6 +10,8 @@ const app_1 = require("@headless-adminapp/core/experience/app");
|
|
|
10
10
|
const icons_1 = require("@headless-adminapp/icons");
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
13
|
+
const fluent_1 = require("../../components/fluent");
|
|
14
|
+
const Option_1 = require("../../components/fluent/Option");
|
|
13
15
|
const RecordCard_1 = require("../../PageEntityForm/RecordCard");
|
|
14
16
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
15
17
|
const useLookupData_1 = require("./useLookupData");
|
|
@@ -120,7 +122,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
120
122
|
if (skeleton) {
|
|
121
123
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
122
124
|
}
|
|
123
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%', height: containerHeight }, children: [(0, jsx_runtime_1.jsxs)(
|
|
125
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%', height: containerHeight }, children: [(0, jsx_runtime_1.jsxs)(fluent_1.Combobox, { name: name, appearance: "filled-darker", expandIcon: (0, jsx_runtime_1.jsx)("div", { style: { position: 'absolute', right: 4, bottom: 8 }, children: readOnly || disabled ? null : isLoading ? ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" })) : ((0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 18 })) }), input: {
|
|
124
126
|
style: {
|
|
125
127
|
position: 'absolute',
|
|
126
128
|
bottom: 0,
|
|
@@ -128,7 +130,12 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
128
130
|
left: inputLeft,
|
|
129
131
|
height: 30,
|
|
130
132
|
},
|
|
131
|
-
}, placeholder: placeholder, inputMode: "search", style: {
|
|
133
|
+
}, placeholder: placeholder, inputMode: "search", style: {
|
|
134
|
+
width: '100%',
|
|
135
|
+
height: '100%',
|
|
136
|
+
minWidth: 'unset',
|
|
137
|
+
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
138
|
+
}, autoComplete: "off", readOnly: readOnly || disabled, open: open && !readOnly && !disabled, value: searchText, onOpenChange: (e, data) => {
|
|
132
139
|
setOpen(data.open);
|
|
133
140
|
}, onChange: (e) => {
|
|
134
141
|
setSearchText(e.target.value);
|
|
@@ -138,10 +145,10 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
138
145
|
return;
|
|
139
146
|
recentItemStore.addItem((0, useLookupData_1.createLookupRecentKey)(schema.logicalName), _item[schema.idAttribute], _item[schema.idAttribute]);
|
|
140
147
|
handleAdd(_item);
|
|
141
|
-
}, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(
|
|
148
|
+
}, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data?.records.map((item) => ((0, jsx_runtime_1.jsx)(Option_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: (0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view?.experience.card, record: item, schema: schema }) }, item[schema.idAttribute]))), !isLoading && !data?.records.length && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
142
149
|
paddingInline: react_components_1.tokens.spacingHorizontalL,
|
|
143
150
|
paddingBlock: react_components_1.tokens.spacingVerticalS,
|
|
144
|
-
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: lookupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(
|
|
151
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Body1, { children: lookupStrings.noRecordsFound }) })), allowNewRecord && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_components_1.Divider, {}), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: react_components_1.tokens.spacingVerticalXXS }, children: (0, jsx_runtime_1.jsx)(fluent_1.ToolbarButton, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), children: lookupStrings.newRecord }) })] }))] }), (0, jsx_runtime_1.jsx)("div", { ref: tagGroupContainerRef, style: {
|
|
145
152
|
position: 'absolute',
|
|
146
153
|
top: 4,
|
|
147
154
|
left: 0,
|
|
@@ -176,7 +183,7 @@ function TagItem({ disabled, readOnly, value, onRemove, allowNavigation, }) {
|
|
|
176
183
|
}
|
|
177
184
|
router.push(path);
|
|
178
185
|
}, [path, router]);
|
|
179
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
186
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Tag, { as: "span", appearance: "brand", size: "small", dismissible: !disabled && !readOnly, value: value.id, style: {
|
|
180
187
|
paddingRight: !disabled && !readOnly ? 0 : 5,
|
|
181
188
|
pointerEvents: 'auto',
|
|
182
189
|
}, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
|
|
@@ -5,9 +5,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const icons_1 = require("@headless-adminapp/icons");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
+
const fluent_1 = require("../../components/fluent");
|
|
8
9
|
function PasswordControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, autoFocus, appearance = 'filled-darker', }) {
|
|
9
10
|
const [showPassword, setShowPassword] = (0, react_1.useState)(false);
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Input, { placeholder: placeholder, id: id, name: name, appearance: appearance, type: showPassword ? 'text' : 'password', autoFocus: autoFocus, value: value ?? '', onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
11
12
|
// invalid={error}
|
|
12
|
-
|
|
13
|
+
readOnly: disabled, style: {
|
|
14
|
+
width: '100%',
|
|
15
|
+
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
16
|
+
}, contentAfter: (0, jsx_runtime_1.jsx)(fluent_1.Button, { appearance: "transparent", size: "small", onClick: () => setShowPassword(!showPassword), icon: showPassword ? (0, jsx_runtime_1.jsx)(icons_1.Icons.EyeOff, { size: 18 }) : (0, jsx_runtime_1.jsx)(icons_1.Icons.Eye, { size: 18 }) }) }));
|
|
13
17
|
}
|
|
@@ -12,6 +12,8 @@ const icons_1 = require("@headless-adminapp/icons");
|
|
|
12
12
|
const react_query_1 = require("@tanstack/react-query");
|
|
13
13
|
const react_1 = require("react");
|
|
14
14
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
15
|
+
const fluent_1 = require("../../components/fluent");
|
|
16
|
+
const Option_1 = require("../../components/fluent/Option");
|
|
15
17
|
const RecordCard_1 = require("../../PageEntityForm/RecordCard");
|
|
16
18
|
const avatar_1 = require("../../utils/avatar");
|
|
17
19
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
@@ -55,13 +57,13 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
55
57
|
id: value.id,
|
|
56
58
|
});
|
|
57
59
|
}, [allowNavigation, routeResolver, value]);
|
|
58
|
-
const handleOpenRecord = (0, react_1.useCallback)((event) => {
|
|
60
|
+
const handleOpenRecord = (0, react_1.useCallback)(async (event) => {
|
|
59
61
|
event.preventDefault();
|
|
60
62
|
event.stopPropagation();
|
|
61
63
|
if (!path) {
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
64
|
-
router.push(path);
|
|
66
|
+
await router.push(path);
|
|
65
67
|
}, [path, router]);
|
|
66
68
|
(0, react_1.useEffect)(() => {
|
|
67
69
|
if (open)
|
|
@@ -123,7 +125,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
123
125
|
if (skeleton) {
|
|
124
126
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
125
127
|
}
|
|
126
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)(
|
|
128
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)(fluent_1.Combobox, { name: name, appearance: "filled-darker", expandIcon: readOnly || disabled ? null : isLoading ? ((0, jsx_runtime_1.jsx)(react_components_1.Spinner, { size: "extra-tiny" })) : ((0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 18 })), placeholder: !value ? placeholder : '', inputMode: "search", style: { width: '100%', minWidth: 'unset' }, autoComplete: "off", readOnly: readOnly || disabled,
|
|
127
129
|
// disabled={disabled}
|
|
128
130
|
open: open && !value && !readOnly && !disabled, value: !value ? searchText : '', onOpenChange: (e, data) => setOpen(data.open), onChange: (e) => {
|
|
129
131
|
setSearchText(e.target.value);
|
|
@@ -148,7 +150,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
148
150
|
return null;
|
|
149
151
|
}
|
|
150
152
|
return ((0, jsx_runtime_1.jsx)(react_components_1.OptionGroup, { label: schema.label, children: data?.records.map((item) => {
|
|
151
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
153
|
+
return ((0, jsx_runtime_1.jsx)(Option_1.Option, { value: item[schema.idAttribute], className: (0, react_components_1.mergeClasses)(styles.option), text: item[schema.primaryAttribute], children: view?.card ? ((0, jsx_runtime_1.jsx)(RecordCard_1.RecordCard, { cardView: view.card, record: item, schema: schema })) : item[schema.primaryAttribute] }, item[schema.idAttribute]));
|
|
152
154
|
}) }, schema.logicalName));
|
|
153
155
|
}), !isLoading &&
|
|
154
156
|
result.every((item) => !item.data?.records.length) && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -160,7 +162,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
160
162
|
alignItems: 'center',
|
|
161
163
|
paddingInline: 4,
|
|
162
164
|
display: 'flex',
|
|
163
|
-
}, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", children: (0, jsx_runtime_1.jsx)(
|
|
165
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.TagGroup, { as: "div", children: (0, jsx_runtime_1.jsx)(fluent_1.Tag, { as: "span", appearance: "brand", size: "small", dismissible: !disabled && !readOnly, value: value.id, style: {
|
|
164
166
|
paddingRight: !disabled && !readOnly ? 0 : 5,
|
|
165
167
|
background: react_components_1.tokens.colorNeutralBackground6,
|
|
166
168
|
}, dismissIcon: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => {
|
|
@@ -4,6 +4,8 @@ exports.default = SelectControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const fluent_1 = require("../../components/fluent");
|
|
8
|
+
const Option_1 = require("../../components/fluent/Option");
|
|
7
9
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
10
|
function SelectControl({ value, onChange, options, id, name, disabled, onBlur, onFocus, placeholder, skeleton, clearable, }) {
|
|
9
11
|
const transformedOptions = (0, react_1.useMemo)(() => options.map((x) => ({ label: x.label, value: String(x.value) })), [options]);
|
|
@@ -20,7 +22,7 @@ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, o
|
|
|
20
22
|
if (skeleton) {
|
|
21
23
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
22
24
|
}
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Dropdown, { placeholder: placeholder, id: id, name: name, appearance: "filled-darker",
|
|
24
26
|
// data={transformedOptions}
|
|
25
27
|
value: selectedOption?.label ?? '',
|
|
26
28
|
// onChange={(e, v) => handleChange(v as string)}
|
|
@@ -30,5 +32,13 @@ function SelectControl({ value, onChange, options, id, name, disabled, onBlur, o
|
|
|
30
32
|
pointerEvents: disabled ? 'none' : undefined,
|
|
31
33
|
width: '100%',
|
|
32
34
|
minWidth: 'unset',
|
|
33
|
-
}, clearable: clearable,
|
|
35
|
+
}, clearable: clearable, clearButton: {
|
|
36
|
+
style: {
|
|
37
|
+
marginRight: react_components_1.tokens.spacingHorizontalXS,
|
|
38
|
+
},
|
|
39
|
+
}, expandIcon: {
|
|
40
|
+
style: {
|
|
41
|
+
marginRight: -6,
|
|
42
|
+
},
|
|
43
|
+
}, children: transformedOptions.map((x) => ((0, jsx_runtime_1.jsx)(Option_1.Option, { value: x.value, children: x.label }, x.value))) }));
|
|
34
44
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SkeletonControl = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
|
+
const fluent_1 = require("../../components/fluent");
|
|
6
7
|
const useStyles = (0, react_components_1.makeStyles)({
|
|
7
8
|
skeleton: {
|
|
8
9
|
backgroundColor: 'var(--colorNeutralBackground3)',
|
|
@@ -13,6 +14,10 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
13
14
|
});
|
|
14
15
|
const SkeletonControl = ({ height = 32, width, }) => {
|
|
15
16
|
const styles = useStyles();
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { paddingBlock: 2 }, children: (0, jsx_runtime_1.jsx)(react_components_1.SkeletonItem, { style: {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { paddingBlock: 2 }, children: (0, jsx_runtime_1.jsx)(react_components_1.SkeletonItem, { style: {
|
|
18
|
+
height: height - 4,
|
|
19
|
+
width,
|
|
20
|
+
borderRadius: fluent_1.extendedTokens.controlBorderRadius,
|
|
21
|
+
}, className: styles.skeleton }) }));
|
|
17
22
|
};
|
|
18
23
|
exports.SkeletonControl = SkeletonControl;
|
|
@@ -7,6 +7,7 @@ const locale_1 = require("@headless-adminapp/app/locale");
|
|
|
7
7
|
const phone_1 = require("@headless-adminapp/app/utils/phone");
|
|
8
8
|
const icons_1 = require("@headless-adminapp/icons");
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
+
const fluent_1 = require("../../components/fluent");
|
|
10
11
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
11
12
|
function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, autoComplete, skeleton, }) {
|
|
12
13
|
const [internalValue, setInternalValue] = (0, react_1.useState)('');
|
|
@@ -28,7 +29,7 @@ function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placehol
|
|
|
28
29
|
if (skeleton) {
|
|
29
30
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
30
31
|
}
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Input, { type: "tel", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: (e) => setInternalValue?.(e.target.value), onBlur: () => {
|
|
32
33
|
handleChange();
|
|
33
34
|
onBlur?.();
|
|
34
35
|
}, onFocus: () => onFocus?.(),
|
|
@@ -38,5 +39,5 @@ function TelephoneControl({ value, onChange, id, name, onBlur, onFocus, placehol
|
|
|
38
39
|
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
39
40
|
},
|
|
40
41
|
// size="sm"
|
|
41
|
-
contentAfter: number?.uri ? ((0, jsx_runtime_1.jsx)(
|
|
42
|
+
contentAfter: number?.uri ? ((0, jsx_runtime_1.jsx)(fluent_1.Button, { appearance: "transparent", size: "small", onClick: () => window.open(number.uri, '_blank'), title: number.uri, icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Phone, {}) })) : undefined }));
|
|
42
43
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextAreaControl = TextAreaControl;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_components_1 = require("@fluentui/react-components");
|
|
6
5
|
const react_1 = require("react");
|
|
6
|
+
const fluent_1 = require("../../components/fluent");
|
|
7
7
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
8
|
const DEFAULT_MAX_HEIGHT = 260;
|
|
9
9
|
function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFocus, disabled, readOnly, rows = 5, textTransform, autoHeight, maxHeight, skeleton, }) {
|
|
@@ -39,7 +39,7 @@ function TextAreaControl({ value, onChange, id, name, placeholder, onBlur, onFoc
|
|
|
39
39
|
if (skeleton) {
|
|
40
40
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, { height: 116 });
|
|
41
41
|
}
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Textarea, { ref: textAreaRef, placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value ?? '', onChange: handleInput, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
43
43
|
// error={error}
|
|
44
44
|
readOnly: disabled || readOnly, rows: rows, style: {
|
|
45
45
|
width: '100%',
|
|
@@ -4,12 +4,13 @@ exports.StaticSuggestionLoader = exports.DynamicSuggestionLoader = void 0;
|
|
|
4
4
|
exports.useSuggestions = useSuggestions;
|
|
5
5
|
exports.TextControl = TextControl;
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const react_components_1 = require("@fluentui/react-components");
|
|
8
7
|
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
9
8
|
const metadata_1 = require("@headless-adminapp/app/metadata");
|
|
10
9
|
const useRetriveRecords_1 = require("@headless-adminapp/app/transport/hooks/useRetriveRecords");
|
|
11
10
|
const lodash_1 = require("lodash");
|
|
12
11
|
const react_1 = require("react");
|
|
12
|
+
const fluent_1 = require("../../components/fluent");
|
|
13
|
+
const Option_1 = require("../../components/fluent/Option");
|
|
13
14
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
14
15
|
function useSuggestions({ searchText, readOnly, }) {
|
|
15
16
|
const [debouncedSearchText] = (0, hooks_1.useDebouncedValue)(searchText, 500);
|
|
@@ -48,7 +49,7 @@ readOnly, appearance = 'filled-darker', maxLength, skeleton, suggestions, }) {
|
|
|
48
49
|
onChange?.(value);
|
|
49
50
|
};
|
|
50
51
|
if (suggestions) {
|
|
51
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fluent_1.Combobox, { autoCapitalize: "none", autoCorrect: "off", placeholder: placeholder, appearance: "filled-darker", spellCheck: false, autoComplete: "off", freeform: true, id: id, name: name, autoFocus: autoFocus, maxLength: maxLength, style: { width: '100%', minWidth: 'unset' }, input: { style: { width: '100%' } }, expandIcon: null, open: open && !!data.length && !readOnly, onOpenChange: (e, data) => {
|
|
52
53
|
if (!data.open) {
|
|
53
54
|
setOpen(data.open);
|
|
54
55
|
}
|
|
@@ -57,12 +58,12 @@ readOnly, appearance = 'filled-darker', maxLength, skeleton, suggestions, }) {
|
|
|
57
58
|
setOpen(true);
|
|
58
59
|
}, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), onOptionSelect: (e, item) => {
|
|
59
60
|
onChange?.(item.optionText ?? '');
|
|
60
|
-
}, children: data.map((item) => ((0, jsx_runtime_1.jsx)(
|
|
61
|
+
}, children: data.map((item) => ((0, jsx_runtime_1.jsx)(Option_1.Option, { value: item, checkIcon: null, children: item }, item))) }), suggestions?.type === 'static' && ((0, jsx_runtime_1.jsx)(exports.StaticSuggestionLoader, { values: suggestions.values, disabled: !lookupEnabled, onData: onData, searchText: debouncedSearchText })), suggestions?.type === 'dynamic' && ((0, jsx_runtime_1.jsx)(exports.DynamicSuggestionLoader, { entity: suggestions.entity, field: suggestions.field, disabled: !lookupEnabled, searchText: debouncedSearchText, onData: onData }))] }));
|
|
61
62
|
}
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Input, { placeholder: placeholder, id: id, name: name, autoFocus: autoFocus, appearance: appearance, value: value ?? '', onChange: (e) => handleOnChange(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
63
64
|
// invalid={error}
|
|
64
65
|
// readOnly={readOnly || disabled}
|
|
65
|
-
readOnly: readonly, autoComplete: autoComplete, autoCorrect: autoCorrect, autoCapitalize: autoCapitalize,
|
|
66
|
+
readOnly: readonly, autoComplete: autoComplete, autoCorrect: autoCorrect, autoCapitalize: autoCapitalize, style: {
|
|
66
67
|
width: '100%',
|
|
67
68
|
}, maxLength: maxLength, input: {
|
|
68
69
|
style: {
|
|
@@ -12,6 +12,7 @@ const icons_1 = require("@headless-adminapp/icons");
|
|
|
12
12
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
13
13
|
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
14
14
|
const react_1 = require("react");
|
|
15
|
+
const fluent_1 = require("../../../components/fluent");
|
|
15
16
|
const SkeletonControl_1 = require("../SkeletonControl");
|
|
16
17
|
const utils_1 = require("./utils");
|
|
17
18
|
dayjs_1.default.extend(customParseFormat_1.default);
|
|
@@ -46,6 +47,8 @@ function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled,
|
|
|
46
47
|
flex: 1,
|
|
47
48
|
minWidth: 0,
|
|
48
49
|
pointerEvents: isReadonly ? 'none' : 'auto',
|
|
50
|
+
borderRadius: fluent_1.extendedTokens.controlBorderRadius,
|
|
51
|
+
minHeight: fluent_1.extendedTokens.controlMinHeightM,
|
|
49
52
|
}, placeholder: placeholder, id: id, name: name, input: {
|
|
50
53
|
style: { minWidth: 0 },
|
|
51
54
|
}, readOnly: isReadonly, selectedTime: selectedTime, freeform: true, value: internalTimeValue, onTimeChange: (_, data) => {
|
|
@@ -78,5 +81,9 @@ function TimeControl({ value, onChange, id, name, onBlur, placeholder, disabled,
|
|
|
78
81
|
justifyContent: 'center',
|
|
79
82
|
marginRight: -4,
|
|
80
83
|
color: react_components_1.tokens.colorNeutralForeground2,
|
|
81
|
-
}, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Clock, { size: 20 }) })
|
|
84
|
+
}, children: (0, jsx_runtime_1.jsx)(icons_1.Icons.Clock, { size: 20 }) }), listbox: {
|
|
85
|
+
style: {
|
|
86
|
+
borderRadius: fluent_1.extendedTokens.paperBorderRadius,
|
|
87
|
+
},
|
|
88
|
+
} }) }));
|
|
82
89
|
}
|
|
@@ -4,17 +4,18 @@ exports.UrlControl = UrlControl;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const icons_1 = require("@headless-adminapp/icons");
|
|
7
|
+
const fluent_1 = require("../../components/fluent");
|
|
7
8
|
const SkeletonControl_1 = require("./SkeletonControl");
|
|
8
9
|
function UrlControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, skeleton, }) {
|
|
9
10
|
if (skeleton) {
|
|
10
11
|
return (0, jsx_runtime_1.jsx)(SkeletonControl_1.SkeletonControl, {});
|
|
11
12
|
}
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(fluent_1.Input, { type: "url", placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: value ?? '', onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
13
14
|
// invalid={error}
|
|
14
15
|
readOnly: disabled || readOnly, autoComplete: "off", style: {
|
|
15
16
|
width: '100%',
|
|
16
17
|
paddingRight: react_components_1.tokens.spacingHorizontalXS,
|
|
17
18
|
},
|
|
18
19
|
// size="sm"
|
|
19
|
-
contentAfter: value ? ((0, jsx_runtime_1.jsx)(
|
|
20
|
+
contentAfter: value ? ((0, jsx_runtime_1.jsx)(fluent_1.Button, { appearance: "transparent", size: "small", onClick: () => window.open(value, '_blank'), icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.OpenInNew, {}) })) : undefined }));
|
|
20
21
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormSection = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
// import { Divider, Flex, Grid, Paper, Stack, Text } from '@mantine/core';
|
|
6
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
7
6
|
const hooks_1 = require("@headless-adminapp/app/hooks");
|
|
8
7
|
const react_1 = require("react");
|
|
8
|
+
const fluent_1 = require("../../../components/fluent");
|
|
9
9
|
const FormSectionColumn_1 = require("./FormSectionColumn");
|
|
10
10
|
const FormSectionLoading_1 = require("./FormSectionLoading");
|
|
11
11
|
function determineItemCount(availableWidth, itemWidth, gap, padding) {
|
|
@@ -62,7 +62,7 @@ const FormSection = ({ title, children, columnCount, labelPosition, noPadding, h
|
|
|
62
62
|
}
|
|
63
63
|
return ((0, jsx_runtime_1.jsx)("div", { ref: divRef, style: {
|
|
64
64
|
boxShadow: react_components_1.tokens.shadow2,
|
|
65
|
-
borderRadius:
|
|
65
|
+
borderRadius: fluent_1.extendedTokens.paperBorderRadius,
|
|
66
66
|
background: react_components_1.tokens.colorNeutralBackground1,
|
|
67
67
|
display: 'flex',
|
|
68
68
|
flexDirection: 'column',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/lodash": "4.17.20"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "086994cfa783e4228290a2108dc84e057dbb00fb"
|
|
58
58
|
}
|
package/styles.css
CHANGED
|
@@ -4,10 +4,6 @@ body {
|
|
|
4
4
|
margin: 0;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.TextControl_readonly:after {
|
|
8
|
-
border-bottom-color: var(--colorNeutralStrokeDisabled) !important;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
7
|
.FormBody_scrollview > div {
|
|
12
8
|
display: flex;
|
|
13
9
|
flex-direction: column;
|
|
@@ -31,7 +27,7 @@ body {
|
|
|
31
27
|
flex-direction: column;
|
|
32
28
|
background-color: var(--colorNeutralBackground3);
|
|
33
29
|
overflow: hidden;
|
|
34
|
-
border-radius: var(--
|
|
30
|
+
border-radius: var(--controlBorderRadius);
|
|
35
31
|
border: 1px solid transparent;
|
|
36
32
|
}
|
|
37
33
|
.hdlapp_rte:focus-within {
|