@banch0u/core-project-test-repository 2.2.1 → 2.2.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.
|
@@ -40,12 +40,20 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
40
40
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
41
|
dropdownStyle = _useState4[0],
|
|
42
42
|
setDropdownStyle = _useState4[1];
|
|
43
|
-
var isDisabled = !!mainPage;
|
|
44
43
|
var filteredOptions = useMemo(function () {
|
|
45
|
-
|
|
44
|
+
// Filter by scopes first
|
|
45
|
+
var scopeFiltered = (entryData || []).filter(function (item) {
|
|
46
46
|
return item.scopes === "account" || scopesData === "*" || (scopesData === null || scopesData === void 0 ? void 0 : scopesData.includes(item.scopes));
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
// If mainPage is true, remove "account" option
|
|
50
|
+
if (mainPage) {
|
|
51
|
+
return scopeFiltered.filter(function (item) {
|
|
52
|
+
return item.scopes !== "account";
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return scopeFiltered;
|
|
56
|
+
}, [entryData, scopesData, mainPage]);
|
|
49
57
|
|
|
50
58
|
// ✅ IMPORTANT: use real browser path so basename won't hide "/contracts"
|
|
51
59
|
var baseSegment = useMemo(function () {
|
|
@@ -62,7 +70,6 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
62
70
|
useEffect(function () {
|
|
63
71
|
var handleClickOutside = function handleClickOutside(e) {
|
|
64
72
|
var _dropdownRef$current;
|
|
65
|
-
if (isDisabled) return;
|
|
66
73
|
if (accordionRef.current && !accordionRef.current.contains(e.target) && !((_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(e.target))) {
|
|
67
74
|
setActiveKey([]);
|
|
68
75
|
}
|
|
@@ -71,9 +78,8 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
71
78
|
return function () {
|
|
72
79
|
return document.removeEventListener("mousedown", handleClickOutside);
|
|
73
80
|
};
|
|
74
|
-
}, [
|
|
81
|
+
}, []);
|
|
75
82
|
useEffect(function () {
|
|
76
|
-
if (isDisabled) return;
|
|
77
83
|
if (activeKey.length > 0 && accordionRef.current) {
|
|
78
84
|
var rect = accordionRef.current.getBoundingClientRect();
|
|
79
85
|
setDropdownStyle({
|
|
@@ -84,18 +90,18 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
84
90
|
zIndex: 9999
|
|
85
91
|
});
|
|
86
92
|
}
|
|
87
|
-
}, [activeKey
|
|
93
|
+
}, [activeKey]);
|
|
88
94
|
useEffect(function () {
|
|
89
|
-
if
|
|
90
|
-
|
|
95
|
+
// Clear active key when mainPage changes if needed
|
|
96
|
+
setActiveKey([]);
|
|
97
|
+
}, [mainPage]);
|
|
91
98
|
return /*#__PURE__*/React.createElement("div", {
|
|
92
99
|
ref: accordionRef
|
|
93
100
|
}, /*#__PURE__*/React.createElement(Collapse, {
|
|
94
101
|
bordered: false,
|
|
95
|
-
activeKey:
|
|
102
|
+
activeKey: activeKey,
|
|
96
103
|
onChange: function onChange(key) {
|
|
97
|
-
|
|
98
|
-
setActiveKey(key);
|
|
104
|
+
return setActiveKey(key);
|
|
99
105
|
},
|
|
100
106
|
expandIconPosition: "end",
|
|
101
107
|
expandIcon: function expandIcon(_ref2) {
|
|
@@ -104,26 +110,20 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
104
110
|
"data-no-invert": true
|
|
105
111
|
}, /*#__PURE__*/React.createElement(RightOutlined, {
|
|
106
112
|
style: {
|
|
107
|
-
transform: "rotate(".concat(
|
|
113
|
+
transform: "rotate(".concat(isActive ? 270 : 90, "deg)"),
|
|
108
114
|
transition: "transform 0.2s ease",
|
|
109
115
|
color: "white",
|
|
110
|
-
fontSize: "14px"
|
|
111
|
-
opacity: isDisabled ? 0.5 : 1,
|
|
112
|
-
cursor: isDisabled ? "not-allowed" : "pointer"
|
|
116
|
+
fontSize: "14px"
|
|
113
117
|
}
|
|
114
118
|
}));
|
|
115
119
|
},
|
|
116
120
|
className: style.accordion
|
|
117
121
|
}, /*#__PURE__*/React.createElement(Panel, {
|
|
118
122
|
header: /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
className: style.accordionHeader
|
|
120
|
-
style: {
|
|
121
|
-
opacity: isDisabled ? 0.8 : 1,
|
|
122
|
-
cursor: isDisabled ? "default" : "pointer"
|
|
123
|
-
}
|
|
123
|
+
className: style.accordionHeader
|
|
124
124
|
}, baseSegment === "settings" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SettingOutlined, null)), /*#__PURE__*/React.createElement("span", null, "T\u0259nziml\u0259m\u0259l\u0259r")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, active === null || active === void 0 ? void 0 : active.icon), /*#__PURE__*/React.createElement("span", null, active === null || active === void 0 ? void 0 : active.value))),
|
|
125
125
|
key: "1"
|
|
126
|
-
})),
|
|
126
|
+
})), activeKey.length > 0 && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
|
|
127
127
|
"data-no-invert": true,
|
|
128
128
|
ref: dropdownRef,
|
|
129
129
|
className: style.accordionBody,
|