@headless-adminapp/fluent 1.0.0 → 1.0.2
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/NavigationContainer.js +6 -1
- package/DataGrid/TableCell/TableCellChoice.js +15 -1
- package/PageBoard/PageBoard.js +2 -2
- package/PageCalendar/PageCalendar.js +2 -2
- package/PageEntityForm/PageCustomEntityForm.js +3 -2
- package/PageEntityForm/RecordAvatar.js +4 -1
- package/PageEntityForm/SectionContainer.js +2 -1
- package/form/controls/DateControl.js +5 -6
- package/form/controls/DateTimeControl.js +7 -2
- package/package.json +10 -8
|
@@ -15,6 +15,8 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
15
15
|
overflow: 'hidden',
|
|
16
16
|
display: 'flex',
|
|
17
17
|
flexShrink: 0,
|
|
18
|
+
boxShadow: react_components_1.tokens.shadow4,
|
|
19
|
+
zIndex: 1,
|
|
18
20
|
},
|
|
19
21
|
content: {
|
|
20
22
|
flex: '1',
|
|
@@ -34,7 +36,10 @@ const useStyles = (0, react_components_1.makeStyles)({
|
|
|
34
36
|
const NavigationContainer = ({ open, type, onOpenChange, }) => {
|
|
35
37
|
const styles = useStyles();
|
|
36
38
|
const { appExperience: app } = (0, app_1.useAppContext)();
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: styles.root, children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawer, { selectedValue: "active", open: open, type: type, onOpenChange: (value, data) => onOpenChange(data.open), children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawerBody, { style: {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: styles.root, children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawer, { selectedValue: "active", open: open, type: type, onOpenChange: (value, data) => onOpenChange(data.open), children: (0, jsx_runtime_1.jsx)(react_nav_preview_1.NavDrawerBody, { style: {
|
|
40
|
+
paddingTop: 8,
|
|
41
|
+
// borderRight: `1px solid ${tokens.colorNeutralStroke1}`,
|
|
42
|
+
}, children: app.navItems.map((area) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: area.groups.map((group) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [!group.hideLabel && ((0, jsx_runtime_1.jsx)(react_nav_preview_1.NavSectionHeader, { children: group.label })), group.items.map((item, index) => ((0, jsx_runtime_1.jsx)(Test, { item: item, drawerType: type, onOpenChange: onOpenChange }, (item.label ?? '') + String(index))))] }, group.label))) }, area.label))) }) }) }));
|
|
38
43
|
};
|
|
39
44
|
exports.NavigationContainer = NavigationContainer;
|
|
40
45
|
const Test = ({ item, onOpenChange, drawerType }) => {
|
|
@@ -19,6 +19,16 @@ function TableCellChoice(props) {
|
|
|
19
19
|
}
|
|
20
20
|
return (0, color_1.isColorDark)(bgColor) ? '#FFFFFF' : '#000000';
|
|
21
21
|
}, [bgColor]);
|
|
22
|
+
if (!props.formattedValue) {
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(TableCellBase_1.TableCellBase, { style: {
|
|
24
|
+
textOverflow: 'ellipsis',
|
|
25
|
+
overflow: 'hidden',
|
|
26
|
+
whiteSpace: 'nowrap',
|
|
27
|
+
width: props.width,
|
|
28
|
+
minWidth: props.width,
|
|
29
|
+
maxWidth: props.width,
|
|
30
|
+
} }));
|
|
31
|
+
}
|
|
22
32
|
return ((0, jsx_runtime_1.jsx)(TableCellBase_1.TableCellBase, { style: {
|
|
23
33
|
textOverflow: 'ellipsis',
|
|
24
34
|
overflow: 'hidden',
|
|
@@ -26,5 +36,9 @@ function TableCellChoice(props) {
|
|
|
26
36
|
width: props.width,
|
|
27
37
|
minWidth: props.width,
|
|
28
38
|
maxWidth: props.width,
|
|
29
|
-
}, children: (0, jsx_runtime_1.jsx)(react_components_1.
|
|
39
|
+
}, children: (0, jsx_runtime_1.jsx)(react_components_1.Badge, { style: {
|
|
40
|
+
backgroundColor: bgColor ?? react_components_1.tokens.colorNeutralBackground3,
|
|
41
|
+
color: color ?? react_components_1.tokens.colorNeutralForeground2,
|
|
42
|
+
fontWeight: react_components_1.tokens.fontWeightRegular,
|
|
43
|
+
}, children: props.formattedValue }) }));
|
|
30
44
|
}
|
package/PageBoard/PageBoard.js
CHANGED
|
@@ -25,8 +25,8 @@ function PageBoard(props) {
|
|
|
25
25
|
flexDirection: 'column',
|
|
26
26
|
flex: 1,
|
|
27
27
|
gap: react_components_1.tokens.spacingVerticalM,
|
|
28
|
-
padding: react_components_1.tokens.
|
|
29
|
-
background: react_components_1.tokens.
|
|
28
|
+
padding: react_components_1.tokens.spacingHorizontalM,
|
|
29
|
+
background: react_components_1.tokens.colorNeutralBackground2,
|
|
30
30
|
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
31
31
|
display: 'flex',
|
|
32
32
|
flexDirection: 'column',
|
|
@@ -225,7 +225,7 @@ function PageCalendar(props) {
|
|
|
225
225
|
flexDirection: 'column',
|
|
226
226
|
flex: 1,
|
|
227
227
|
gap: react_components_1.tokens.spacingVerticalM,
|
|
228
|
-
padding: react_components_1.tokens.
|
|
229
|
-
background: react_components_1.tokens.
|
|
228
|
+
padding: react_components_1.tokens.spacingHorizontalM,
|
|
229
|
+
background: react_components_1.tokens.colorNeutralBackground2,
|
|
230
230
|
}, children: [(0, jsx_runtime_1.jsx)(Header_1.Header, { filterForm: filterForm, onCreateButtonClick: handleCreateButtonClick }), (0, jsx_runtime_1.jsx)(CalendarSection, { startDate: currentStartDate, endDate: currentEndDate, viewType: viewType, onRangeChange: onRangeChange, events: events ?? [], onEventClick: handleEventClick, onDateSelect: handleDateSelect, loading: loading })] }) }));
|
|
231
231
|
}
|
|
@@ -5,13 +5,14 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_components_1 = require("@fluentui/react-components");
|
|
6
6
|
const PageEntityFormProvider_1 = require("@headless-adminapp/app/providers/PageEntityFormProvider");
|
|
7
7
|
const PageEntityFormDesktopContainer_1 = require("./PageEntityFormDesktopContainer");
|
|
8
|
+
const RecordSetNavigatorContainer_1 = require("./RecordSetNavigatorContainer");
|
|
8
9
|
const PageCustomEntityForm = ({ recordId, commands, form, schema, retriveRecordFn, saveRecordFn, }) => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(PageEntityFormProvider_1.PageEntityFormProvider, { schema: schema, form: form, recordId: recordId, commands: commands, retriveRecordFn: retriveRecordFn, saveRecordFn: saveRecordFn, children: (0, jsx_runtime_1.
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(PageEntityFormProvider_1.PageEntityFormProvider, { schema: schema, form: form, recordId: recordId, commands: commands, retriveRecordFn: retriveRecordFn, saveRecordFn: saveRecordFn, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
10
11
|
display: 'flex',
|
|
11
12
|
flex: 1,
|
|
12
13
|
flexDirection: 'row',
|
|
13
14
|
backgroundColor: react_components_1.tokens.colorNeutralBackground2,
|
|
14
15
|
overflow: 'hidden',
|
|
15
|
-
}, children: (0, jsx_runtime_1.jsx)(PageEntityFormDesktopContainer_1.PageEntityFormDesktopContainer, {}) }) }));
|
|
16
|
+
}, children: [(0, jsx_runtime_1.jsx)(RecordSetNavigatorContainer_1.RecordSetNavigatorContainer, {}), (0, jsx_runtime_1.jsx)(PageEntityFormDesktopContainer_1.PageEntityFormDesktopContainer, {})] }) }));
|
|
16
17
|
};
|
|
17
18
|
exports.PageCustomEntityForm = PageCustomEntityForm;
|
|
@@ -56,8 +56,11 @@ const RecordAvatar = () => {
|
|
|
56
56
|
hideProgressIndicator();
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
+
const experienceSchema = schemaMetadataDic[schema.logicalName];
|
|
60
|
+
if (!experienceSchema) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
59
63
|
if (isPlaceholder && !value) {
|
|
60
|
-
const experienceSchema = schemaMetadataDic[schema.logicalName];
|
|
61
64
|
const Icon = experienceSchema.icon ?? icons_1.Icons.Entity ?? icons_1.IconPlaceholder;
|
|
62
65
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
63
66
|
display: 'flex',
|
|
@@ -79,8 +79,9 @@ function SectionContainer({ section }) {
|
|
|
79
79
|
control.label ??
|
|
80
80
|
attribute.label;
|
|
81
81
|
return ((0, jsx_runtime_1.jsx)(SectionControl_1.SectionControlWrapper, { label: label, labelPosition: section.labelPosition, required: required, isError: isError, errorMessage: errorMessage, children: (0, jsx_runtime_1.jsx)(Control, { attribute: attribute, name: control.attributeName, value: field.value, onChange: (value) => {
|
|
82
|
+
const previousValue = field.value;
|
|
82
83
|
field.onChange(value);
|
|
83
|
-
eventManager.emit(constants_1.EVENT_KEY_ON_FIELD_CHANGE, control.attributeName, value);
|
|
84
|
+
eventManager.emit(constants_1.EVENT_KEY_ON_FIELD_CHANGE, control.attributeName, value, previousValue);
|
|
84
85
|
}, onBlur: field.onBlur, errorMessage: errorMessage, isError: isError, readOnly: disabled, label: label, placeholder: label, allowNavigation: true, allowNewRecord: true, fileServiceContext: {
|
|
85
86
|
type: 'entity-form',
|
|
86
87
|
recordId,
|
|
@@ -18,12 +18,11 @@ dayjs_1.default.extend(timezone_1.default);
|
|
|
18
18
|
function DateControl({ value, onChange, id, name, onBlur, onFocus, placeholder, disabled, readOnly, }) {
|
|
19
19
|
const { dateFormats, timezone } = (0, locale_1.useLocale)();
|
|
20
20
|
const { datePickerStrings } = (0, AppStringContext_1.useAppStrings)();
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: placeholder, appearance: "filled-darker",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormats.short) : '', value: value ? new Date(value) : null, onSelectDate: (date) => onChange?.(date ? (0, dayjs_1.default)(date).tz(timezone).startOf('day').toISOString() : null), strings: datePickerStrings, contentAfter: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(react_datepicker_compat_1.DatePicker, { id: id, name: name, onFocus: () => onFocus?.(), onBlur: () => onBlur?.(), placeholder: placeholder, appearance: "filled-darker", disabled: disabled, readOnly: readOnly, formatDate: (date) => date ? (0, dayjs_1.default)(date).tz(timezone).format(dateFormats.short) : '', value: value ? new Date(value) : null, onSelectDate: (date) => {
|
|
22
|
+
onChange?.(date
|
|
23
|
+
? (0, dayjs_1.default)(date).tz(timezone, true).startOf('day').toISOString()
|
|
24
|
+
: null);
|
|
25
|
+
}, strings: datePickerStrings, contentAfter: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
27
26
|
display: 'flex',
|
|
28
27
|
alignItems: 'center',
|
|
29
28
|
justifyContent: 'center',
|
|
@@ -43,10 +43,13 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
43
43
|
onChange?.((0, dayjs_1.default)(date).tz(timezone, true).toISOString());
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const dateISOString = (0, dayjs_1.default)(date).tz(timezone, true).toISOString();
|
|
47
|
+
onChange?.((0, dayjs_1.default)(dateISOString)
|
|
48
|
+
.tz(timezone)
|
|
48
49
|
.set('hour', (0, dayjs_1.default)(value).tz(timezone).hour())
|
|
49
50
|
.set('minute', (0, dayjs_1.default)(value).tz(timezone).minute())
|
|
51
|
+
.set('second', 0)
|
|
52
|
+
.set('millisecond', 0)
|
|
50
53
|
.toISOString());
|
|
51
54
|
}
|
|
52
55
|
},
|
|
@@ -77,6 +80,8 @@ function DateTimeControl({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
77
80
|
onChange?.(dateValue
|
|
78
81
|
.set('hour', (0, dayjs_1.default)(data.selectedTime).tz(timezone, true).hour())
|
|
79
82
|
.set('minute', (0, dayjs_1.default)(data.selectedTime).tz(timezone, true).minute())
|
|
83
|
+
.set('second', 0)
|
|
84
|
+
.set('millisecond', 0)
|
|
80
85
|
.toISOString());
|
|
81
86
|
}
|
|
82
87
|
else if (data.selectedTimeText) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,19 +20,21 @@
|
|
|
20
20
|
"keywords": [],
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "ISC",
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@fluentui/react-calendar-compat": "^0.1.20",
|
|
25
|
+
"@fluentui/react-components": "^9.54.4",
|
|
26
|
+
"@fluentui/react-datepicker-compat": "^0.4.43",
|
|
27
|
+
"@fluentui/react-nav-preview": "^0.5.1",
|
|
28
|
+
"@fluentui/react-timepicker-compat": "^0.2.46",
|
|
29
|
+
"@tanstack/react-query": "^5.51.1"
|
|
30
|
+
},
|
|
23
31
|
"dependencies": {
|
|
24
|
-
"@fluentui/react-calendar-compat": "0.1.20",
|
|
25
|
-
"@fluentui/react-components": "9.54.4",
|
|
26
|
-
"@fluentui/react-datepicker-compat": "0.4.43",
|
|
27
|
-
"@fluentui/react-nav-preview": "0.5.1",
|
|
28
|
-
"@fluentui/react-timepicker-compat": "0.2.46",
|
|
29
32
|
"@fullcalendar/core": "6.1.15",
|
|
30
33
|
"@fullcalendar/daygrid": "6.1.15",
|
|
31
34
|
"@fullcalendar/interaction": "6.1.15",
|
|
32
35
|
"@fullcalendar/react": "6.1.15",
|
|
33
36
|
"@fullcalendar/timegrid": "6.1.15",
|
|
34
37
|
"@hookform/resolvers": "^3.9.0",
|
|
35
|
-
"@tanstack/react-query": "5.51.1",
|
|
36
38
|
"@tanstack/react-table": "^8.20.1",
|
|
37
39
|
"@tanstack/react-virtual": "^3.8.6",
|
|
38
40
|
"dayjs": "^1.11.13",
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"uuid": "11.0.3",
|
|
49
51
|
"yup": "^1.4.0"
|
|
50
52
|
},
|
|
51
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "fc167255beb567e4557fa7024f8db669db8aaa33"
|
|
52
54
|
}
|