@headless-adminapp/fluent 0.0.17-alpha.61 → 0.0.17-alpha.62
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.
|
@@ -72,12 +72,13 @@ function getRelatedItems(currentSchema, schemas, relatedItems) {
|
|
|
72
72
|
}
|
|
73
73
|
function RelatedViewSelector(props) {
|
|
74
74
|
const schema = (0, hooks_1.useDataFormSchema)();
|
|
75
|
+
const recordId = (0, hooks_1.useRecordId)();
|
|
75
76
|
const formConfig = (0, hooks_1.useSelectedForm)();
|
|
76
77
|
const { schemas } = (0, hooks_2.useMetadata)();
|
|
77
78
|
const strings = (0, PageEntityFormStringContext_1.usePageEntityFormStrings)();
|
|
78
79
|
const { language } = (0, locale_1.useLocale)();
|
|
79
80
|
const data = (0, react_1.useMemo)(() => getRelatedItems(schema, schemas, formConfig.experience.relatedItems), [formConfig.experience.relatedItems, schema, schemas]);
|
|
80
|
-
if (!data.length) {
|
|
81
|
+
if (!data.length || !recordId) {
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
83
84
|
return ((0, jsx_runtime_1.jsxs)(react_components_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_components_1.MenuTrigger, { children: (0, jsx_runtime_1.jsxs)("button", { style: {
|
|
@@ -45,7 +45,7 @@ readOnly, }) {
|
|
|
45
45
|
setInternalValue(value);
|
|
46
46
|
onChange?.(Number(value));
|
|
47
47
|
};
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, autoFocus: autoFocus, name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur?.(), appearance: "filled-darker", onFocus: () => onFocus?.(), contentBefore: (0, jsx_runtime_1.jsx)("div", { children: symbol }),
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, autoFocus: autoFocus, name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur?.(), appearance: "filled-darker", onFocus: () => onFocus?.(), contentBefore: (0, jsx_runtime_1.jsx)("div", { children: symbol }), readOnly: readOnly || disabled, style: {
|
|
49
49
|
width: '100%',
|
|
50
50
|
} }));
|
|
51
51
|
}
|
|
@@ -46,7 +46,7 @@ function DecimalControl({ value, onChange, id, name, onBlur, onFocus, error, dis
|
|
|
46
46
|
setInternalValue(value);
|
|
47
47
|
onChange?.(Number(value));
|
|
48
48
|
};
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(),
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.Input, { placeholder: placeholder, id: id, appearance: "filled-darker", name: name, value: internalValue, onChange: handleChange, onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), readOnly: readOnly || disabled, style: {
|
|
50
50
|
width: '100%',
|
|
51
51
|
} }));
|
|
52
52
|
}
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
/* eslint-disable unused-imports/no-unused-vars */
|
|
6
6
|
const react_components_1 = require("@fluentui/react-components");
|
|
7
7
|
function IntegerControl({ value, onChange, id, name, onBlur, onFocus, error, disabled, placeholder, borderOnFocusOnly, readOnly, }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(react_components_1.SpinButton, { appearance: "filled-darker", placeholder: placeholder, id: id, name: name, value: value ?? null, onChange: (e, data) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(react_components_1.SpinButton, { appearance: "filled-darker", placeholder: placeholder, id: id, name: name, value: value ?? null, readOnly: readOnly || disabled, onChange: (e, data) => {
|
|
9
9
|
if (data.value !== undefined) {
|
|
10
10
|
onChange?.(data.value);
|
|
11
11
|
}
|
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.62",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"uuid": "11.0.3",
|
|
43
43
|
"yup": "^1.4.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "7b4ba8b46dc270e88055b7352d74fae7a2363cd0"
|
|
46
46
|
}
|