@gingkoo/pandora-metabase 1.0.61 → 1.0.63
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/lib/cjs/components/dialog/formula-list/index.js +159 -79
- package/lib/cjs/components/dialog/select-column-multiple/index.js +3 -3
- package/lib/cjs/components/dialog/select-join-column/index.js +3 -3
- package/lib/cjs/components/dialog/select-join-column-multiple/index.js +2 -2
- package/lib/cjs/components/dialog/select-permission-table/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-permission-table/index.js +4 -3
- package/lib/cjs/components/dialog/select-table/index.d.ts +3 -1
- package/lib/cjs/components/dialog/select-table/index.js +104 -9
- package/lib/cjs/components/metabase/index.js +8 -4
- package/lib/cjs/components/metabase/index.less +0 -1
- package/lib/cjs/components/modules/join-data.js +4 -1
- package/lib/cjs/components/modules/permission-table.js +1 -0
- package/lib/cjs/components/modules/table-data.js +2 -0
- package/lib/cjs/components/popup.d.ts +40 -102
- package/lib/cjs/components/popup.js +219 -190
- package/lib/cjs/hooks/use-state.js +103 -42
- package/lib/cjs/index.js +5 -2
- package/lib/cjs/types.d.ts +1 -0
- package/lib/cjs/utils/helper.d.ts +1 -1
- package/lib/cjs/utils/helper.js +2 -2
- package/lib/es/components/dialog/formula-list/index.js +159 -79
- package/lib/es/components/dialog/select-column-multiple/index.js +3 -3
- package/lib/es/components/dialog/select-join-column/index.js +3 -3
- package/lib/es/components/dialog/select-join-column-multiple/index.js +2 -2
- package/lib/es/components/dialog/select-permission-table/index.d.ts +2 -1
- package/lib/es/components/dialog/select-permission-table/index.js +4 -3
- package/lib/es/components/dialog/select-table/index.d.ts +3 -1
- package/lib/es/components/dialog/select-table/index.js +104 -9
- package/lib/es/components/metabase/index.js +8 -4
- package/lib/es/components/metabase/index.less +0 -1
- package/lib/es/components/modules/join-data.js +4 -1
- package/lib/es/components/modules/permission-table.js +1 -0
- package/lib/es/components/modules/table-data.js +2 -0
- package/lib/es/components/popup.d.ts +40 -102
- package/lib/es/components/popup.js +220 -191
- package/lib/es/hooks/use-state.js +104 -43
- package/lib/es/index.js +5 -2
- package/lib/es/types.d.ts +1 -0
- package/lib/es/utils/helper.d.ts +1 -1
- package/lib/es/utils/helper.js +2 -2
- package/package.json +1 -1
|
@@ -123,7 +123,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
123
123
|
tableName = v.name,
|
|
124
124
|
_v$datasourceName = v.datasourceName,
|
|
125
125
|
datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
|
|
126
|
-
var fullName = datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias)) : mergeNameAlias(tableName, tableAlias);
|
|
126
|
+
var fullName = datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias, store.tableEnableAlias)) : mergeNameAlias(tableName, tableAlias, store.tableEnableAlias);
|
|
127
127
|
if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
|
|
128
128
|
// let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
|
|
129
129
|
return _objectSpread({}, v);
|
|
@@ -213,8 +213,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
213
213
|
},
|
|
214
214
|
children: _jsx("h3", {
|
|
215
215
|
className: 'List-item-title ml-2',
|
|
216
|
-
title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias),
|
|
217
|
-
children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias)
|
|
216
|
+
title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias, store.tableEnableAlias)) : mergeNameAlias(table, tableAlias, store.tableEnableAlias),
|
|
217
|
+
children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias, store.tableEnableAlias)) : mergeNameAlias(table, tableAlias, store.tableEnableAlias)
|
|
218
218
|
})
|
|
219
219
|
}), isMultiple && _jsx("span", {
|
|
220
220
|
className: 'List-title-arrow',
|
|
@@ -187,8 +187,8 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
187
187
|
},
|
|
188
188
|
children: _jsx("h3", {
|
|
189
189
|
className: 'List-item-title ml-2',
|
|
190
|
-
title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias),
|
|
191
|
-
children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias)) : mergeNameAlias(table, tableAlias)
|
|
190
|
+
title: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias, store.tableEnableAlias)) : mergeNameAlias(table, tableAlias, store.tableEnableAlias),
|
|
191
|
+
children: datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(table, tableAlias, store.tableEnableAlias)) : mergeNameAlias(table, tableAlias, store.tableEnableAlias)
|
|
192
192
|
})
|
|
193
193
|
}), isMultiple && _jsx("span", {
|
|
194
194
|
className: 'List-title-arrow',
|
|
@@ -10,6 +10,7 @@ interface PropsType {
|
|
|
10
10
|
value: MetaData_TableType;
|
|
11
11
|
onChange: (reocrd: MetaData_TableType) => void;
|
|
12
12
|
didUpdate?: Function;
|
|
13
|
+
tableEnableAlias: boolean;
|
|
13
14
|
}
|
|
14
|
-
declare const SelectPermissionTable: ({ data, value, onChange, didUpdate }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const SelectPermissionTable: ({ data, value, onChange, didUpdate, tableEnableAlias, }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default SelectPermissionTable;
|
|
@@ -19,7 +19,8 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
|
|
|
19
19
|
value = _ref.value,
|
|
20
20
|
_ref$onChange = _ref.onChange,
|
|
21
21
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
22
|
-
didUpdate = _ref.didUpdate
|
|
22
|
+
didUpdate = _ref.didUpdate,
|
|
23
|
+
tableEnableAlias = _ref.tableEnableAlias;
|
|
23
24
|
var _useState = useState(data.slice()),
|
|
24
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
26
|
datasource = _useState2[0],
|
|
@@ -31,7 +32,7 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
|
|
|
31
32
|
var val = e.target.value;
|
|
32
33
|
var newList = cloneDeep(data.slice());
|
|
33
34
|
setDatasource(newList.filter(function (v) {
|
|
34
|
-
return ~(v.datasourceName + '.' + mergeNameAlias(v.name, v.alias)).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
|
|
35
|
+
return ~(v.datasourceName + '.' + mergeNameAlias(v.name, v.alias, tableEnableAlias)).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
|
|
35
36
|
}));
|
|
36
37
|
}
|
|
37
38
|
return _jsx("div", {
|
|
@@ -77,7 +78,7 @@ var SelectPermissionTable = function SelectPermissionTable(_ref) {
|
|
|
77
78
|
}), _jsx("div", {
|
|
78
79
|
children: _jsxs("h4", {
|
|
79
80
|
className: 'List-item-title ml-2',
|
|
80
|
-
children: [v.datasourceName ? "".concat(v.datasourceName, ".") : '', v.name === 'source' ? PrevResult : mergeNameAlias(v.name, v.alias)]
|
|
81
|
+
children: [v.datasourceName ? "".concat(v.datasourceName, ".") : '', v.name === 'source' ? PrevResult : mergeNameAlias(v.name, v.alias, tableEnableAlias)]
|
|
81
82
|
})
|
|
82
83
|
})]
|
|
83
84
|
})
|
|
@@ -9,9 +9,11 @@ import { MetaData_TableType } from '../../../store/types';
|
|
|
9
9
|
import { DatasourceType } from '../../../types';
|
|
10
10
|
interface PropsType {
|
|
11
11
|
data: DatasourceType[];
|
|
12
|
+
sourceTable: any[];
|
|
12
13
|
value: MetaData_TableType;
|
|
13
14
|
onChange: (reocrd: MetaData_TableType) => void;
|
|
14
15
|
didUpdate?: Function;
|
|
16
|
+
tableFlat?: boolean;
|
|
15
17
|
}
|
|
16
|
-
declare const SelectTable: ({ data, value, onChange, didUpdate }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const SelectTable: ({ data, sourceTable, value, onChange, didUpdate, tableFlat, }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export default SelectTable;
|
|
@@ -22,10 +22,14 @@ import { TableIcon, SearchIcon, DataSourceIcon, LeftArrowIcon } from '../../icon
|
|
|
22
22
|
var SelectTable = function SelectTable(_ref) {
|
|
23
23
|
var _ref$data = _ref.data,
|
|
24
24
|
data = _ref$data === void 0 ? [] : _ref$data,
|
|
25
|
+
_ref$sourceTable = _ref.sourceTable,
|
|
26
|
+
sourceTable = _ref$sourceTable === void 0 ? [] : _ref$sourceTable,
|
|
25
27
|
value = _ref.value,
|
|
26
28
|
_ref$onChange = _ref.onChange,
|
|
27
29
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
28
|
-
didUpdate = _ref.didUpdate
|
|
30
|
+
didUpdate = _ref.didUpdate,
|
|
31
|
+
_ref$tableFlat = _ref.tableFlat,
|
|
32
|
+
tableFlat = _ref$tableFlat === void 0 ? false : _ref$tableFlat;
|
|
29
33
|
var store = useStore();
|
|
30
34
|
var _useState = useState(false),
|
|
31
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -34,18 +38,22 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
34
38
|
var _useState3 = useState(data.slice()),
|
|
35
39
|
_useState4 = _slicedToArray(_useState3, 1),
|
|
36
40
|
datasource = _useState4[0];
|
|
37
|
-
var _useState5 = useState(
|
|
41
|
+
var _useState5 = useState(sourceTable.slice()),
|
|
38
42
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
datasourceTable = _useState6[0],
|
|
44
|
+
setDatasourceTable = _useState6[1];
|
|
41
45
|
var _useState7 = useState([]),
|
|
42
46
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var _useState9 = useState(
|
|
47
|
+
list = _useState8[0],
|
|
48
|
+
setList = _useState8[1];
|
|
49
|
+
var _useState9 = useState([]),
|
|
46
50
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
originList = _useState0[0],
|
|
52
|
+
setOriginList = _useState0[1];
|
|
53
|
+
var _useState1 = useState(value),
|
|
54
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
55
|
+
val = _useState10[0],
|
|
56
|
+
setVal = _useState10[1];
|
|
49
57
|
useEffect(function () {
|
|
50
58
|
if (value.datasourceId) {
|
|
51
59
|
getTables(value.datasourceId);
|
|
@@ -86,6 +94,21 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
86
94
|
return ~(v.name + (v.name_zh || '')).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
|
|
87
95
|
}));
|
|
88
96
|
}
|
|
97
|
+
function onInput1(e) {
|
|
98
|
+
var val = e.target.value;
|
|
99
|
+
var newList = cloneDeep(sourceTable.slice());
|
|
100
|
+
var _new = newList.map(function (v) {
|
|
101
|
+
var _v$children;
|
|
102
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
103
|
+
children: v === null || v === void 0 || (_v$children = v.children) === null || _v$children === void 0 ? void 0 : _v$children.filter(function (v) {
|
|
104
|
+
return ~(v.name + (v.name_zh || '')).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}).filter(function (v) {
|
|
108
|
+
return v.children.length > 0;
|
|
109
|
+
});
|
|
110
|
+
setDatasourceTable(_new);
|
|
111
|
+
}
|
|
89
112
|
function goPrevPage() {
|
|
90
113
|
setVal({
|
|
91
114
|
datasourceId: '',
|
|
@@ -97,6 +120,78 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
97
120
|
alias: ''
|
|
98
121
|
});
|
|
99
122
|
}
|
|
123
|
+
if (tableFlat) {
|
|
124
|
+
return _jsx("div", {
|
|
125
|
+
className: cx("Sqb-SelectTable--box pb-2"),
|
|
126
|
+
children: _jsx("div", {
|
|
127
|
+
style: {
|
|
128
|
+
minWidth: 300
|
|
129
|
+
},
|
|
130
|
+
children: _jsxs("div", {
|
|
131
|
+
style: {
|
|
132
|
+
width: '100%'
|
|
133
|
+
},
|
|
134
|
+
children: [_jsx("div", {
|
|
135
|
+
className: cx("Sqb-List-section"),
|
|
136
|
+
children: _jsxs("div", {
|
|
137
|
+
className: cx("Sqb-List-search m-2 rounded-lg"),
|
|
138
|
+
children: [_jsx("span", {
|
|
139
|
+
className: 'px-2',
|
|
140
|
+
children: _jsx(SearchIcon, {})
|
|
141
|
+
}), _jsx("input", {
|
|
142
|
+
autoFocus: true,
|
|
143
|
+
type: 'text',
|
|
144
|
+
className: 'p-2',
|
|
145
|
+
placeholder: __('data.search'),
|
|
146
|
+
onInput: onInput1
|
|
147
|
+
})]
|
|
148
|
+
})
|
|
149
|
+
}), datasourceTable.map(function (table) {
|
|
150
|
+
var _table$children;
|
|
151
|
+
return _jsxs(_Fragment, {
|
|
152
|
+
children: [_jsx("div", {
|
|
153
|
+
className: cx("Sqb-List-title mx-4 pb-2 pt-2"),
|
|
154
|
+
children: table.datasourceName
|
|
155
|
+
}), Array.isArray(table.children) && (table === null || table === void 0 || (_table$children = table.children) === null || _table$children === void 0 ? void 0 : _table$children.map(function (v) {
|
|
156
|
+
var _val = {
|
|
157
|
+
datasourceId: table.datasourceId,
|
|
158
|
+
datasourceName: table.datasourceName,
|
|
159
|
+
name: '',
|
|
160
|
+
name_zh: '',
|
|
161
|
+
id: '',
|
|
162
|
+
tableUuid: uuidv4('table'),
|
|
163
|
+
alias: ''
|
|
164
|
+
};
|
|
165
|
+
return _jsx("div", {
|
|
166
|
+
className: cx("Sqb-List-section"),
|
|
167
|
+
children: _jsx("div", {
|
|
168
|
+
className: cx("Sqb-List-item mx-2", {
|
|
169
|
+
active: value.name === v.name
|
|
170
|
+
}),
|
|
171
|
+
onClick: function onClick() {
|
|
172
|
+
onChange(_objectSpread(_objectSpread({}, _val), v));
|
|
173
|
+
},
|
|
174
|
+
children: _jsxs("a", {
|
|
175
|
+
className: 'p-2',
|
|
176
|
+
children: [_jsx("span", {
|
|
177
|
+
className: 'List-item-icon',
|
|
178
|
+
children: _jsx(TableIcon, {})
|
|
179
|
+
}), _jsx("div", {
|
|
180
|
+
children: _jsx("h4", {
|
|
181
|
+
className: 'List-item-title ml-2',
|
|
182
|
+
children: replaceTpl(store.tableNameTpl, v)
|
|
183
|
+
})
|
|
184
|
+
})]
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
}, v.name);
|
|
188
|
+
}))]
|
|
189
|
+
});
|
|
190
|
+
})]
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
}
|
|
100
195
|
var nextPage = !val.datasourceId;
|
|
101
196
|
// 没有选 数据源 先选数据源
|
|
102
197
|
if (nextPage) {
|
|
@@ -151,8 +151,10 @@ var Metabase = function Metabase(props) {
|
|
|
151
151
|
disabled: saveLoading,
|
|
152
152
|
onClick: onCheck,
|
|
153
153
|
children: btnText || __('SqlQueryBuilder.visualize')
|
|
154
|
-
}) : null, store.popupContainer.current && _jsx(Popup
|
|
155
|
-
|
|
154
|
+
}) : null, store.popupContainer.current && _jsx(Popup
|
|
155
|
+
// container={store.popupData.container || store.popupContainer.current}
|
|
156
|
+
, {
|
|
157
|
+
// container={store.popupData.container || store.popupContainer.current}
|
|
156
158
|
visible: store.popupData.visible,
|
|
157
159
|
node: store.popupData.node,
|
|
158
160
|
closable: store.popupClosable,
|
|
@@ -162,8 +164,10 @@ var Metabase = function Metabase(props) {
|
|
|
162
164
|
});
|
|
163
165
|
},
|
|
164
166
|
children: popupContent
|
|
165
|
-
}), store.popupContainer.current && _jsx(Popup
|
|
166
|
-
|
|
167
|
+
}), store.popupContainer.current && _jsx(Popup
|
|
168
|
+
// container={store.popupData2.container || store.popupContainer.current}
|
|
169
|
+
, {
|
|
170
|
+
// container={store.popupData2.container || store.popupContainer.current}
|
|
167
171
|
visible: store.popupData2.visible,
|
|
168
172
|
node: store.popupData2.node,
|
|
169
173
|
closable: store.popupClosable2,
|
|
@@ -501,6 +501,7 @@ var JoinData = function JoinData(props) {
|
|
|
501
501
|
visible: true,
|
|
502
502
|
node: node,
|
|
503
503
|
content: _jsx(SelectPermissionTable, {
|
|
504
|
+
tableEnableAlias: store.tableEnableAlias,
|
|
504
505
|
data: data,
|
|
505
506
|
value: newMeta[index][table_type],
|
|
506
507
|
onChange: function onChange(data) {
|
|
@@ -542,6 +543,8 @@ var JoinData = function JoinData(props) {
|
|
|
542
543
|
visible: true,
|
|
543
544
|
node: e.currentTarget,
|
|
544
545
|
content: _jsx(SelectTable, {
|
|
546
|
+
sourceTable: store.sourceTable || [],
|
|
547
|
+
tableFlat: store.tableFlat,
|
|
545
548
|
data: store.sourceList,
|
|
546
549
|
value: value,
|
|
547
550
|
onChange: function onChange(data) {
|
|
@@ -1343,7 +1346,7 @@ var JoinData = function JoinData(props) {
|
|
|
1343
1346
|
if (meta.table1.name === SummarizeAlias) {
|
|
1344
1347
|
return PrevResult;
|
|
1345
1348
|
} else {
|
|
1346
|
-
return "".concat(meta.table1.datasourceName, ".").concat(mergeNameAlias(meta.table1.name, meta.table1.alias));
|
|
1349
|
+
return "".concat(meta.table1.datasourceName, ".").concat(mergeNameAlias(meta.table1.name, meta.table1.alias, store.tableEnableAlias));
|
|
1347
1350
|
}
|
|
1348
1351
|
} else {
|
|
1349
1352
|
return '';
|
|
@@ -85,6 +85,7 @@ var PermissionTable = function PermissionTable(props) {
|
|
|
85
85
|
visible: true,
|
|
86
86
|
node: e.currentTarget,
|
|
87
87
|
content: _jsx(SelectPermissionTable, {
|
|
88
|
+
tableEnableAlias: store.tableEnableAlias,
|
|
88
89
|
data: data,
|
|
89
90
|
value: meta.table,
|
|
90
91
|
onChange: function onChange(data) {
|
|
@@ -81,7 +81,9 @@ var TableData = function TableData(props) {
|
|
|
81
81
|
visible: true,
|
|
82
82
|
node: e.currentTarget,
|
|
83
83
|
content: _jsx(SelectTable, {
|
|
84
|
+
tableFlat: store.tableFlat,
|
|
84
85
|
data: store.sourceList,
|
|
86
|
+
sourceTable: store.sourceTable || [],
|
|
85
87
|
value: meta.table,
|
|
86
88
|
onChange: function onChange(data) {
|
|
87
89
|
if (meta.table.datasourceId !== data.datasourceId || meta.table.name !== data.name) {
|
|
@@ -1,109 +1,47 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
interface PropsType {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
hideVisible: () => void;
|
|
6
|
+
node: HTMLElement;
|
|
7
|
+
innerSpacing?: number;
|
|
8
|
+
zIndex?: string | number;
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
}
|
|
2
11
|
interface StateType {
|
|
3
12
|
popupRefreshKey: number;
|
|
4
13
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
initResizeObserver: () => void;
|
|
15
|
-
bindEvent: () => void;
|
|
16
|
-
closePopup: () => void;
|
|
17
|
-
attachParent: (popupContainer: HTMLSpanElement) => void;
|
|
18
|
-
getCurrentNodePos: () => {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
t: number;
|
|
22
|
-
h: any;
|
|
23
|
-
};
|
|
24
|
-
getContainer: () => HTMLSpanElement;
|
|
25
|
-
getComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
didUpdate: () => void | false;
|
|
27
|
-
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
-
context: unknown;
|
|
29
|
-
setState<K extends "popupRefreshKey">(state: StateType | ((prevState: Readonly<StateType>, props: Readonly<PropsType>) => StateType | Pick<StateType, K> | null) | Pick<StateType, K> | null, callback?: (() => void) | undefined): void;
|
|
30
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
31
|
-
readonly props: Readonly<PropsType>;
|
|
32
|
-
state: Readonly<StateType>;
|
|
33
|
-
refs: {
|
|
34
|
-
[key: string]: React.ReactInstance;
|
|
35
|
-
};
|
|
36
|
-
shouldComponentUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<StateType>, nextContext: any): boolean;
|
|
37
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
38
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<PropsType>, prevState: Readonly<StateType>): any;
|
|
39
|
-
componentWillMount?(): void;
|
|
40
|
-
UNSAFE_componentWillMount?(): void;
|
|
41
|
-
componentWillReceiveProps?(nextProps: Readonly<PropsType>, nextContext: any): void;
|
|
42
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<PropsType>, nextContext: any): void;
|
|
43
|
-
componentWillUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<StateType>, nextContext: any): void;
|
|
44
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<StateType>, nextContext: any): void;
|
|
45
|
-
};
|
|
46
|
-
defaultProps: {
|
|
14
|
+
declare class TriggerInternal extends React.Component<PropsType, StateType> {
|
|
15
|
+
private resizeObserver;
|
|
16
|
+
private resetId;
|
|
17
|
+
private popupContainer;
|
|
18
|
+
private contentResizeObserver;
|
|
19
|
+
private scrollHeightCheckTimer;
|
|
20
|
+
private lastScrollHeight;
|
|
21
|
+
private handleClickOutside;
|
|
22
|
+
static defaultProps: {
|
|
47
23
|
visible: boolean;
|
|
48
|
-
|
|
24
|
+
closable: boolean;
|
|
25
|
+
innerSpacing: number;
|
|
49
26
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
y: number;
|
|
68
|
-
t: number;
|
|
69
|
-
h: any;
|
|
70
|
-
};
|
|
71
|
-
getContainer: () => HTMLSpanElement;
|
|
72
|
-
getComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
didUpdate: () => void | false;
|
|
74
|
-
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
75
|
-
context: unknown;
|
|
76
|
-
setState<K extends "popupRefreshKey">(state: StateType | ((prevState: Readonly<StateType>, props: Readonly<PropsType>) => StateType | Pick<StateType, K> | null) | Pick<StateType, K> | null, callback?: (() => void) | undefined): void;
|
|
77
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
78
|
-
readonly props: Readonly<PropsType>;
|
|
79
|
-
state: Readonly<StateType>;
|
|
80
|
-
refs: {
|
|
81
|
-
[key: string]: React.ReactInstance;
|
|
82
|
-
};
|
|
83
|
-
shouldComponentUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<StateType>, nextContext: any): boolean;
|
|
84
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
85
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<PropsType>, prevState: Readonly<StateType>): any;
|
|
86
|
-
componentWillMount?(): void;
|
|
87
|
-
UNSAFE_componentWillMount?(): void;
|
|
88
|
-
componentWillReceiveProps?(nextProps: Readonly<PropsType>, nextContext: any): void;
|
|
89
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<PropsType>, nextContext: any): void;
|
|
90
|
-
componentWillUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<StateType>, nextContext: any): void;
|
|
91
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<StateType>, nextContext: any): void;
|
|
92
|
-
};
|
|
93
|
-
defaultProps: {
|
|
94
|
-
visible: boolean;
|
|
95
|
-
children: null;
|
|
96
|
-
};
|
|
97
|
-
contextType?: React.Context<any> | undefined;
|
|
98
|
-
};
|
|
99
|
-
export default _default;
|
|
100
|
-
interface PropsType {
|
|
101
|
-
visible: boolean;
|
|
102
|
-
children: any;
|
|
103
|
-
hideVisible: Function;
|
|
104
|
-
node: any;
|
|
105
|
-
innerSpacing?: number;
|
|
106
|
-
container?: HTMLDivElement;
|
|
107
|
-
zIndex?: string | null;
|
|
108
|
-
closable?: boolean;
|
|
27
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
28
|
+
constructor(props: PropsType);
|
|
29
|
+
componentDidMount(): void;
|
|
30
|
+
componentDidUpdate(prevProps: PropsType): void;
|
|
31
|
+
componentWillUnmount(): void;
|
|
32
|
+
private mountPopup;
|
|
33
|
+
private unmountPopup;
|
|
34
|
+
private cleanup;
|
|
35
|
+
private refreshPopup;
|
|
36
|
+
private initContentResizeObserver;
|
|
37
|
+
private startScrollHeightCheck;
|
|
38
|
+
private closePopup;
|
|
39
|
+
private createPopupContainer;
|
|
40
|
+
private getContainer;
|
|
41
|
+
private getComponent;
|
|
42
|
+
private didUpdate;
|
|
43
|
+
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
109
44
|
}
|
|
45
|
+
export declare function generateTrigger(PortalComponent: any): typeof TriggerInternal;
|
|
46
|
+
declare const _default: typeof TriggerInternal;
|
|
47
|
+
export default _default;
|