@giteeteam/apps-team-components 1.0.14 → 1.0.15
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.
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ReadViewBaseProps } from '../types';
|
|
3
|
-
|
|
3
|
+
type DropdownReadViewProps = ReadViewBaseProps & {
|
|
4
|
+
userData?: Record<string, any>;
|
|
5
|
+
};
|
|
6
|
+
declare const DropdownReadView: import("react").NamedExoticComponent<DropdownReadViewProps>;
|
|
4
7
|
export default DropdownReadView;
|
|
@@ -4,7 +4,15 @@ import EmptyField from '../../common/EmptyField';
|
|
|
4
4
|
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
|
|
5
5
|
import { handleValue } from './BaseField';
|
|
6
6
|
const DropdownReadView = memo(props => {
|
|
7
|
-
const { value, options, readonly } = props;
|
|
7
|
+
const { value, options, readonly: propsReadonly, userData } = props;
|
|
8
|
+
const readonly = useMemo(() => {
|
|
9
|
+
if ((userData === null || userData === void 0 ? void 0 : userData.source) === 'apps-function') {
|
|
10
|
+
return (userData === null || userData === void 0 ? void 0 : userData.readonly) || propsReadonly;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return propsReadonly;
|
|
14
|
+
}
|
|
15
|
+
}, [propsReadonly, userData]);
|
|
8
16
|
const showValue = useMemo(() => {
|
|
9
17
|
var _a;
|
|
10
18
|
if (!(value === null || value === void 0 ? void 0 : value.length))
|