@headless-adminapp/fluent 0.0.17-alpha.11 → 0.0.17-alpha.13
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/DataGrid/CustomizeColumns/AddColumns.js +0 -1
- package/DataGrid/CustomizeColumns/ColumnItem.js +3 -1
- package/DataGrid/GridColumnHeader/OperatorSelect.js +9 -2
- package/PageEntityForm/PageEntityFormDesktopContainer.js +3 -3
- package/form/controls/LookupControl.js +1 -1
- package/form/controls/MultiSelectLookupControl.js +1 -1
- package/form/layout/FormTab/FormTab.js +1 -1
- package/index.css +27 -0
- package/package.json +3 -3
|
@@ -64,7 +64,6 @@ function AddColumns({ onColumnAdd, onColumnRemove, columns, opened, onClose, })
|
|
|
64
64
|
gap: 8,
|
|
65
65
|
marginBottom: react_components_1.tokens.spacingVerticalXS,
|
|
66
66
|
paddingInline: react_components_1.tokens.spacingHorizontalS,
|
|
67
|
-
width: '100%',
|
|
68
67
|
}, children: [(0, jsx_runtime_1.jsx)(react_components_1.Input, { contentBefore: (0, jsx_runtime_1.jsx)(icons_1.Icons.Search, { size: 16 }), placeholder: appStrings.searchPlaceholder, value: searchText, onChange: (e) => setSearchText(e.target.value) }), (0, jsx_runtime_1.jsx)(react_components_1.Dropdown, { value: (_a = selectedGroupItem === null || selectedGroupItem === void 0 ? void 0 : selectedGroupItem.label) !== null && _a !== void 0 ? _a : '', selectedOptions: selectedGroupItem ? [String(selectedGroupItem.key)] : [], onOptionSelect: (event, data) => {
|
|
69
68
|
setSelectedGroup(data.optionValue);
|
|
70
69
|
}, style: { flex: 1, minWidth: 'unset' }, positioning: {
|
|
@@ -71,12 +71,14 @@ const ColumnItem = ({ item, index, moveItem, isFirst, isLast, onRemove, stringSe
|
|
|
71
71
|
drag(drop(ref));
|
|
72
72
|
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: {
|
|
73
73
|
background: react_components_1.tokens.colorNeutralBackground4,
|
|
74
|
-
|
|
74
|
+
paddingBlock: react_components_1.tokens.spacingVerticalXS,
|
|
75
|
+
paddingLeft: react_components_1.tokens.spacingHorizontalS,
|
|
75
76
|
cursor: 'move',
|
|
76
77
|
opacity,
|
|
77
78
|
borderRadius: react_components_1.tokens.borderRadiusMedium,
|
|
78
79
|
display: 'flex',
|
|
79
80
|
flexDirection: 'row',
|
|
81
|
+
alignItems: 'center',
|
|
80
82
|
}, "data-handler-id": handlerId, children: [(0, jsx_runtime_1.jsx)(react_components_1.Body1, { style: { flex: 1 }, children: item.label }), (0, jsx_runtime_1.jsxs)(react_components_1.Menu, { positioning: "below-start", children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsx)(react_components_1.Button, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.MoreVertical, {}), appearance: "transparent", size: "small" }) }), (0, jsx_runtime_1.jsx)(react_components_1.MenuPopover, { children: (0, jsx_runtime_1.jsxs)(react_components_1.MenuList, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Delete, {}), onClick: onRemove, children: stringSet.remove }), !isFirst && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
|
|
81
83
|
moveItem(index, index - 1);
|
|
82
84
|
}, children: stringSet.moveUp })), !isLast && ((0, jsx_runtime_1.jsx)(react_components_1.MenuItem, { icon: (0, jsx_runtime_1.jsx)(icons_1.Icons.Add, {}), onClick: () => {
|
|
@@ -6,16 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.OperatorSelect = OperatorSelect;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const column_filter_1 = require("@headless-adminapp/app/datagrid/column-filter");
|
|
9
|
+
const transport_1 = require("@headless-adminapp/app/transport");
|
|
9
10
|
const react_1 = require("react");
|
|
10
11
|
const AppStringContext_1 = require("../../App/AppStringContext");
|
|
11
12
|
const SelectControl_1 = __importDefault(require("../../form/controls/SelectControl"));
|
|
12
13
|
function OperatorSelect({ attribute, value, onChange, }) {
|
|
13
14
|
const { operatorStrings } = (0, AppStringContext_1.useAppStrings)();
|
|
15
|
+
const dataService = (0, transport_1.useDataService)();
|
|
14
16
|
const operatorOptions = (0, react_1.useMemo)(() => {
|
|
15
17
|
return (0, column_filter_1.getLocalizedOperatorOptions)(operatorStrings);
|
|
16
18
|
}, [operatorStrings]);
|
|
17
19
|
const options = (0, react_1.useMemo)(() => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const supportedOperators = dataService.supportedOperators;
|
|
21
|
+
let operators = operatorOptions[attribute.type];
|
|
22
|
+
if (supportedOperators) {
|
|
23
|
+
operators = operators.filter((option) => supportedOperators[attribute.type].includes(option.value));
|
|
24
|
+
}
|
|
25
|
+
return operators;
|
|
26
|
+
}, [attribute.type, operatorOptions, dataService]);
|
|
20
27
|
return ((0, jsx_runtime_1.jsx)(SelectControl_1.default, { options: options, onChange: (value) => onChange === null || onChange === void 0 ? void 0 : onChange(value), value: value }));
|
|
21
28
|
}
|
|
@@ -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,7 +92,7 @@ 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, utils_1.localizedLabel)(language, schema) })] }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row' }, children: formConfig.experience.headerControls.map((controlName, index) => {
|
|
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,
|
|
@@ -100,7 +100,7 @@ const PageEntityFormDesktopContainer = () => {
|
|
|
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
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, utils_1.localizedLabel)(language, tab) }, tab.name))), !!selectedRelatedItem && ((0, jsx_runtime_1.jsx)(react_components_1.Tab, { value: "related", children: (
|
|
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 })] })] }));
|
|
@@ -116,7 +116,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
116
116
|
open: open && !value && !readOnly && !disabled, value: !value ? searchText : '', onOpenChange: (e, data) => setOpen(data.open), onChange: (e) => {
|
|
117
117
|
setSearchText(e.target.value);
|
|
118
118
|
}, onOptionSelect: (e, item) => {
|
|
119
|
-
const _item = data === null || data === void 0 ? void 0 : data.records.find((x) => String(x[schema.idAttribute]) === item.optionValue);
|
|
119
|
+
const _item = data === null || data === void 0 ? void 0 : data.records.find((x) => String(x[schema.idAttribute]) === String(item.optionValue));
|
|
120
120
|
handleChange(_item !== null && _item !== void 0 ? _item : null);
|
|
121
121
|
}, disableAutoFocus: true, onBlur: onBlur, onFocus: onFocus, id: id, autoFocus: autoFocus, children: [data === null || data === void 0 ? void 0 : data.records.map((item) => ((0, jsx_runtime_1.jsx)(react_components_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 === null || view === void 0 ? void 0 : view.experience.card, record: item, schema: schema }) }, item[schema.idAttribute]))), !isLoading && !(data === null || data === void 0 ? void 0 : data.records.length) && ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
122
122
|
paddingInline: react_components_1.tokens.spacingHorizontalL,
|
|
@@ -135,7 +135,7 @@ const LookupControlMd = ({ value, onChange, id, name, onBlur, onFocus, placehold
|
|
|
135
135
|
}, onChange: (e) => {
|
|
136
136
|
setSearchText(e.target.value);
|
|
137
137
|
}, onOptionSelect: (e, item) => {
|
|
138
|
-
const _item = data === null || data === void 0 ? void 0 : data.records.find((x) => String(x[schema.idAttribute]) === item.optionValue);
|
|
138
|
+
const _item = data === null || data === void 0 ? void 0 : data.records.find((x) => String(x[schema.idAttribute]) === String(item.optionValue));
|
|
139
139
|
if (!_item)
|
|
140
140
|
return;
|
|
141
141
|
handleAdd(_item);
|
|
@@ -66,7 +66,7 @@ const FormTabInternal = ({ children, value, fullHeight, columnCount, columnWidth
|
|
|
66
66
|
flexDirection: 'column',
|
|
67
67
|
flex: 1,
|
|
68
68
|
// marginTop: 12,
|
|
69
|
-
padding: 12,
|
|
69
|
+
// padding: 12,
|
|
70
70
|
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
71
71
|
// display: 'flex',
|
|
72
72
|
// flexWrap: 'wrap',
|
package/index.css
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.TextControl_readonly:after {
|
|
8
|
+
border-bottom-color: var(--colorNeutralStrokeDisabled) !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.FormBody_scrollview > div {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
padding: var(--spacingVerticalM);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
* {
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.fui-MenuItem__icon > svg,
|
|
24
|
+
.fui-Button__icon > svg {
|
|
25
|
+
width: inherit;
|
|
26
|
+
height: inherit;
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/fluent",
|
|
3
|
-
"version": "0.0.17-alpha.
|
|
3
|
+
"version": "0.0.17-alpha.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build": "tsc",
|
|
21
21
|
"clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo",
|
|
22
22
|
"ts-check": "tsc --noEmit",
|
|
23
|
-
"copy-files": "cp package.json dist",
|
|
23
|
+
"copy-files": "cp package.json dist && cp src/index.css dist",
|
|
24
24
|
"prepublishOnly": "pnpm run build && pnpm run copy-files",
|
|
25
25
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
26
26
|
},
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react-hook-form": "7.52.2",
|
|
45
45
|
"yup": "^1.4.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "0ffc57a7efdb38bd07f8e880c8727da517a91c96"
|
|
48
48
|
}
|