@cloudtower/eagle 0.34.21 → 0.34.23
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/dist/cjs/UIKitProvider/index.js +5 -10
- package/dist/cjs/core/{Modal → LegacyModal}/index.js +7 -3
- package/dist/cjs/core/LegacySelect/index.js +4 -0
- package/dist/cjs/core/message/message.js +24 -1
- package/dist/cjs/coreX/KubeConfigModal/index.js +4 -4
- package/dist/cjs/hooks/useLegacyComponentWarning.js +16 -0
- package/dist/cjs/index.js +16 -16
- package/dist/cjs/legacy-antd.js +2 -2
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +2817 -2817
- package/dist/esm/UIKitProvider/index.js +5 -10
- package/dist/esm/core/{Modal → LegacyModal}/index.js +9 -5
- package/dist/esm/core/LegacySelect/index.js +4 -0
- package/dist/esm/core/message/message.js +24 -1
- package/dist/esm/coreX/KubeConfigModal/index.js +5 -5
- package/dist/esm/hooks/useLegacyComponentWarning.js +14 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/legacy-antd.js +4 -4
- package/dist/esm/stats1.html +1 -1
- package/dist/linaria.merged.scss +3265 -3265
- package/dist/src/core/{Modal/modal.type.d.ts → LegacyModal/LegacyModal.type.d.ts} +12 -1
- package/dist/src/core/LegacyModal/index.d.ts +16 -0
- package/dist/src/core/index.d.ts +2 -2
- package/dist/src/core/message/message.d.ts +5 -0
- package/dist/src/hooks/useLegacyComponentWarning.d.ts +2 -0
- package/dist/src/spec/base.d.ts +2 -2
- package/dist/stories/docs/core/LegacyModal.stories.d.ts +23 -0
- package/dist/stories/docs/core/message-group.stories.d.ts +1 -0
- package/dist/style.css +2817 -2817
- package/package.json +4 -4
- package/dist/src/core/Modal/index.d.ts +0 -5
- package/dist/stories/docs/core/Modal.stories.d.ts +0 -13
|
@@ -40,21 +40,16 @@ const UIKitProvider = (props) => {
|
|
|
40
40
|
});
|
|
41
41
|
}, [batchMessage, kit]);
|
|
42
42
|
useEffect(() => {
|
|
43
|
-
_message.config(omit(message, "batch"))
|
|
44
|
-
|
|
43
|
+
_message.config(__spreadProps(__spreadValues({}, omit(message, "batch")), {
|
|
44
|
+
configProviderProps: config
|
|
45
|
+
}));
|
|
46
|
+
}, [message, config]);
|
|
45
47
|
useEffect(() => {
|
|
46
48
|
if (parrotI18n.language !== lng) {
|
|
47
49
|
parrotI18n.changeLanguage(lng);
|
|
48
50
|
}
|
|
49
51
|
}, [lng]);
|
|
50
|
-
return /* @__PURE__ */ React__default.createElement(kitContext.Provider, { value: _kit }, /* @__PURE__ */ React__default.createElement(MessageContext.Provider, { value: batchMessage != null ? batchMessage : _message },
|
|
51
|
-
ConfigProvider,
|
|
52
|
-
{
|
|
53
|
-
antd4Configs: __spreadValues({}, config == null ? void 0 : config.antd4Configs),
|
|
54
|
-
antd5Configs: __spreadValues({}, config == null ? void 0 : config.antd5Configs)
|
|
55
|
-
},
|
|
56
|
-
children
|
|
57
|
-
)));
|
|
52
|
+
return /* @__PURE__ */ React__default.createElement(kitContext.Provider, { value: _kit }, /* @__PURE__ */ React__default.createElement(ConfigProvider, __spreadValues({}, config), /* @__PURE__ */ React__default.createElement(MessageContext.Provider, { value: batchMessage != null ? batchMessage : _message }, children)));
|
|
58
53
|
};
|
|
59
54
|
var UIKitProvider$1 = UIKitProvider;
|
|
60
55
|
const useUIKit = () => {
|
|
@@ -3,8 +3,9 @@ import Button from '../Button/index.js';
|
|
|
3
3
|
import { useKitSelector, useKitDispatch } from '../KitStoreProvider/index.js';
|
|
4
4
|
import Steps from '../Steps/index.js';
|
|
5
5
|
import { WizardBody } from '../Styled/index.js';
|
|
6
|
+
import useLegacyComponentWarning from '../../hooks/useLegacyComponentWarning.js';
|
|
6
7
|
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
7
|
-
import { Modal
|
|
8
|
+
import { Modal } from 'antd';
|
|
8
9
|
import cs from 'classnames';
|
|
9
10
|
import React__default, { useRef, useMemo } from 'react';
|
|
10
11
|
import { ModalActions } from '../../store/modal.js';
|
|
@@ -40,9 +41,12 @@ var __objRest = (source, exclude) => {
|
|
|
40
41
|
}
|
|
41
42
|
return target;
|
|
42
43
|
};
|
|
43
|
-
const
|
|
44
|
+
const LegacyModal = (props) => {
|
|
44
45
|
var _b;
|
|
45
46
|
const { t } = useParrotTranslation();
|
|
47
|
+
useLegacyComponentWarning(
|
|
48
|
+
"Warning: LegacyModal is deprecated and will be removed in future versions. Please use Dialog/MediumDialog/SmallDialog/ImmersiveDialog/WizardDialog instead."
|
|
49
|
+
);
|
|
46
50
|
const _a = props, {
|
|
47
51
|
error,
|
|
48
52
|
okText = t("common.confirm"),
|
|
@@ -120,7 +124,7 @@ const Modal = (props) => {
|
|
|
120
124
|
stepsRef.current[wizard.step] = wizard.steps[wizard.step].render;
|
|
121
125
|
}
|
|
122
126
|
return /* @__PURE__ */ React__default.createElement(
|
|
123
|
-
Modal
|
|
127
|
+
Modal,
|
|
124
128
|
__spreadProps(__spreadValues({
|
|
125
129
|
maskClosable,
|
|
126
130
|
className: cs(
|
|
@@ -224,6 +228,6 @@ const Modal = (props) => {
|
|
|
224
228
|
))), wizard.right && /* @__PURE__ */ React__default.createElement("div", { className: "right" }, wizard.right)) : restProps.children
|
|
225
229
|
);
|
|
226
230
|
};
|
|
227
|
-
var
|
|
231
|
+
var LegacyModal$1 = LegacyModal;
|
|
228
232
|
|
|
229
|
-
export {
|
|
233
|
+
export { LegacyModal$1 as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Loading from '../Loading/index.js';
|
|
2
2
|
import { Typo } from '../Typo/index.js';
|
|
3
|
+
import useLegacyComponentWarning from '../../hooks/useLegacyComponentWarning.js';
|
|
3
4
|
import { Select } from 'antd';
|
|
4
5
|
import cs from 'classnames';
|
|
5
6
|
import _ from 'lodash';
|
|
@@ -113,6 +114,9 @@ const LegacySelect = (_a) => {
|
|
|
113
114
|
);
|
|
114
115
|
}
|
|
115
116
|
}, [selectRef, placeholder]);
|
|
117
|
+
useLegacyComponentWarning(
|
|
118
|
+
"Warning: LegacySelect is deprecated and will be removed in future versions. Please use Select instead."
|
|
119
|
+
);
|
|
116
120
|
return /* @__PURE__ */ React__default.createElement(
|
|
117
121
|
Select,
|
|
118
122
|
__spreadValues(__spreadProps(__spreadValues({}, input), {
|
|
@@ -6,6 +6,7 @@ import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
|
|
6
6
|
import RCNotification from '@cloudtower/rc-notification';
|
|
7
7
|
import cs from 'classnames';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import { ConfigProvider } from '../ConfigProvider/index.js';
|
|
9
10
|
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __defProps = Object.defineProperties;
|
|
@@ -26,7 +27,23 @@ var __spreadValues = (a, b) => {
|
|
|
26
27
|
return a;
|
|
27
28
|
};
|
|
28
29
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
30
|
+
var __objRest = (source, exclude) => {
|
|
31
|
+
var target = {};
|
|
32
|
+
for (var prop in source)
|
|
33
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
34
|
+
target[prop] = source[prop];
|
|
35
|
+
if (source != null && __getOwnPropSymbols)
|
|
36
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
37
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
38
|
+
target[prop] = source[prop];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
};
|
|
29
42
|
const DEFAULT_DURATION = 3;
|
|
43
|
+
const ConfigProviderWrapper = (props) => {
|
|
44
|
+
const _a = props, { children } = _a, configProps = __objRest(_a, ["children"]);
|
|
45
|
+
return /* @__PURE__ */ React.createElement(ConfigProvider, __spreadValues({}, configProps), children);
|
|
46
|
+
};
|
|
30
47
|
let messageInstance;
|
|
31
48
|
let defaultDuration = DEFAULT_DURATION;
|
|
32
49
|
let defaultTop;
|
|
@@ -36,6 +53,7 @@ let transitionName = "move-up";
|
|
|
36
53
|
let getContainer;
|
|
37
54
|
let maxCount;
|
|
38
55
|
let rtl = false;
|
|
56
|
+
let globalConfigProviderProps = null;
|
|
39
57
|
function getKeyThenIncreaseKey() {
|
|
40
58
|
return key++;
|
|
41
59
|
}
|
|
@@ -64,6 +82,10 @@ function setMessageConfig(options) {
|
|
|
64
82
|
if (options.rtl !== void 0) {
|
|
65
83
|
rtl = options.rtl;
|
|
66
84
|
}
|
|
85
|
+
if (options.configProviderProps !== void 0) {
|
|
86
|
+
globalConfigProviderProps = options.configProviderProps;
|
|
87
|
+
messageInstance = null;
|
|
88
|
+
}
|
|
67
89
|
}
|
|
68
90
|
function getRCNotificationInstance(args, callback) {
|
|
69
91
|
const prefixCls = args.prefixCls || localPrefixCls;
|
|
@@ -113,12 +135,13 @@ function getRCNoticeProps(args, prefixCls) {
|
|
|
113
135
|
[`${prefixCls}-${args.type}`]: args.type,
|
|
114
136
|
[`${prefixCls}-rtl`]: rtl === true
|
|
115
137
|
});
|
|
138
|
+
const wrappedContent = globalConfigProviderProps ? /* @__PURE__ */ React.createElement(ConfigProviderWrapper, __spreadValues({}, globalConfigProviderProps), /* @__PURE__ */ React.createElement("div", { className: messageClass }, args.icon || IconComponent && /* @__PURE__ */ React.createElement(IconComponent, null), /* @__PURE__ */ React.createElement("span", null, args.content))) : /* @__PURE__ */ React.createElement("div", { className: messageClass }, args.icon || IconComponent && /* @__PURE__ */ React.createElement(IconComponent, null), /* @__PURE__ */ React.createElement("span", null, args.content));
|
|
116
139
|
return {
|
|
117
140
|
key: args.key,
|
|
118
141
|
duration,
|
|
119
142
|
style: args.style || {},
|
|
120
143
|
className: args.className,
|
|
121
|
-
content:
|
|
144
|
+
content: wrappedContent,
|
|
122
145
|
onClose: args.onClose
|
|
123
146
|
};
|
|
124
147
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React__default, { useCallback } from 'react';
|
|
2
|
-
import Modal from '../../core/Modal/index.js';
|
|
3
1
|
import { ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon } from '@cloudtower/icons-react';
|
|
4
|
-
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
5
2
|
import { cx } from '@linaria/core';
|
|
6
|
-
import
|
|
3
|
+
import LegacyModal from '../../core/LegacyModal/index.js';
|
|
4
|
+
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
|
|
5
|
+
import React__default, { useCallback } from 'react';
|
|
7
6
|
import { KubeConfigModalStyle, KubeConfigFooterStyle, KubeConfigWrapperStyle, KubeConfigTitleStyle, KubeConfigTipStyle, KubeConfigContentStyle, ErrorWrapper, ErrorContentWrapper } from './KubeConfigModal.style.js';
|
|
7
|
+
import { copy, download } from './utils.js';
|
|
8
8
|
import { usePopModal } from '../../core/KitStoreProvider/index.js';
|
|
9
9
|
import _message from '../../core/message/message.js';
|
|
10
10
|
import Button from '../../core/Button/index.js';
|
|
@@ -47,7 +47,7 @@ const KubeConfigModal = ({
|
|
|
47
47
|
popModal();
|
|
48
48
|
}, [data, popModal, downloadName]);
|
|
49
49
|
return /* @__PURE__ */ React__default.createElement(
|
|
50
|
-
|
|
50
|
+
LegacyModal,
|
|
51
51
|
{
|
|
52
52
|
visible: true,
|
|
53
53
|
fullscreen: true,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const useLegacyComponentWarning = (msg) => {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (process.env.NODE_ENV === "development") {
|
|
6
|
+
console.warn(
|
|
7
|
+
msg != null ? msg : "Warning: LegacyComponent is deprecated and will be removed in future versions."
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
}, [msg]);
|
|
11
|
+
};
|
|
12
|
+
var useLegacyComponentWarning$1 = useLegacyComponentWarning;
|
|
13
|
+
|
|
14
|
+
export { useLegacyComponentWarning$1 as default };
|
package/dist/esm/index.js
CHANGED
|
@@ -47,13 +47,13 @@ export { AntdInputNumberStyled, default as InputNumber } from './core/InputNumbe
|
|
|
47
47
|
export { AntdPasswordInputStyled, default as InputPassword } from './core/InputPassword/index.js';
|
|
48
48
|
export { default as InputTagItem } from './core/InputTagItem/index.js';
|
|
49
49
|
export { default as KitStoreProvider, useCloseModal, useKitDispatch, useKitSelector, usePopModal, usePushModal, useResetModal } from './core/KitStoreProvider/index.js';
|
|
50
|
+
export { default as LegacyModal } from './core/LegacyModal/index.js';
|
|
50
51
|
export { default as LegacySelect } from './core/LegacySelect/index.js';
|
|
51
52
|
export { default as Legend, LegendIcon, LegendPresetColors } from './core/Legend/index.js';
|
|
52
53
|
export { default as LineChart } from './core/LineChart/index.js';
|
|
53
54
|
export { default as Link } from './core/Link/index.js';
|
|
54
55
|
export { default as Loading } from './core/Loading/index.js';
|
|
55
56
|
export { default as Metric } from './core/Metric/index.js';
|
|
56
|
-
export { default as Modal } from './core/Modal/index.js';
|
|
57
57
|
export { default as ModalStack } from './core/ModalStack/index.js';
|
|
58
58
|
export { default as Nav } from './core/Nav/index.js';
|
|
59
59
|
export { ExtraOverflow, default as Overflow } from './core/Overflow/index.js';
|
package/dist/esm/legacy-antd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select as Select$1, Row, Col, Dropdown, Tree, Divider, Skeleton, List, Menu, Layout, AutoComplete, Popover, Space, Timeline, Checkbox as Checkbox$1, Typography, Upload, DatePicker, TimePicker, Tabs, Badge as Badge$1, message, Button as Button$1, Tooltip as Tooltip$1, Modal
|
|
1
|
+
import { Select as Select$1, Row, Col, Dropdown, Tree, Divider, Skeleton, List, Menu, Layout, AutoComplete, Popover, Space, Timeline, Checkbox as Checkbox$1, Typography, Upload, DatePicker, TimePicker, Tabs, Badge as Badge$1, message, Button as Button$1, Tooltip as Tooltip$1, Modal, Input as Input$1, Table as Table$1, Empty as Empty$1, Switch as Switch$1, Collapse, TreeSelect, Drawer, Steps as Steps$1 } from 'antd';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import AccordionCard from './core/AccordionCard/index.js';
|
|
4
4
|
import Alert from './core/Alert/index.js';
|
|
@@ -28,11 +28,11 @@ import Form from './core/Form/index.js';
|
|
|
28
28
|
import Frequency from './core/Frequency/index.js';
|
|
29
29
|
import Input from './core/Input/index.js';
|
|
30
30
|
import InputGroup from './core/InputGroup/index.js';
|
|
31
|
+
import LegacyModal from './core/LegacyModal/index.js';
|
|
31
32
|
import LegacySelect from './core/LegacySelect/index.js';
|
|
32
33
|
import Link from './core/Link/index.js';
|
|
33
34
|
import Loading from './core/Loading/index.js';
|
|
34
35
|
import _message from './core/message/message.js';
|
|
35
|
-
import Modal from './core/Modal/index.js';
|
|
36
36
|
import Pagination from './core/Pagination/index.js';
|
|
37
37
|
import Percent from './core/Percent/index.js';
|
|
38
38
|
import Radio, { RadioGroup, RadioButton } from './core/Radio/index.js';
|
|
@@ -86,7 +86,7 @@ function getAntdKit() {
|
|
|
86
86
|
row: Row,
|
|
87
87
|
col: Col,
|
|
88
88
|
button: Button,
|
|
89
|
-
|
|
89
|
+
legacyModal: LegacyModal,
|
|
90
90
|
dropdown: Dropdown,
|
|
91
91
|
switch: Switch,
|
|
92
92
|
tooltip: Tooltip,
|
|
@@ -155,7 +155,7 @@ function getAntdKit() {
|
|
|
155
155
|
antdButton: Button$1,
|
|
156
156
|
antdSelect: Select$1,
|
|
157
157
|
antdTooltip: Tooltip$1,
|
|
158
|
-
antdModal: Modal
|
|
158
|
+
antdModal: Modal,
|
|
159
159
|
antdInput: Input$1,
|
|
160
160
|
antdTable: Table$1,
|
|
161
161
|
antdEmpty: Empty$1,
|