@cloudtower/eagle 0.34.0 → 0.34.1

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.
Files changed (145) hide show
  1. package/dist/cjs/UIKitProvider/index.js +13 -18
  2. package/dist/cjs/core/Banner/banner.style.js +11 -0
  3. package/dist/cjs/core/Banner/index.js +32 -0
  4. package/dist/cjs/core/BasicCTError/BasicCTError.style.js +5 -0
  5. package/dist/cjs/core/BasicCTError/index.js +40 -0
  6. package/dist/cjs/core/ConfigProvider/index.js +8 -2
  7. package/dist/cjs/core/Fields/FieldsDateTimeRange/index.js +20 -3
  8. package/dist/cjs/core/ImmersiveDialog/index.js +188 -0
  9. package/dist/cjs/core/ImmersiveDialog/styles.js +31 -0
  10. package/dist/cjs/core/MediumDialog/MediumDialog.js +54 -0
  11. package/dist/cjs/core/SmallDialog/SmallDialog.js +144 -0
  12. package/dist/cjs/core/SmallDialog/SmallDialog.style.js +11 -0
  13. package/dist/cjs/core/TableForm/AddRowButton.js +2 -2
  14. package/dist/cjs/core/TableForm/index.js +21 -6
  15. package/dist/cjs/core/Timeline/index.js +13 -7
  16. package/dist/cjs/core/WizardDialog/index.js +170 -0
  17. package/dist/cjs/core/WizardDialog/styles.js +11 -0
  18. package/dist/cjs/core/index.js +9 -9
  19. package/dist/cjs/core/message/index.js +5 -215
  20. package/dist/cjs/core/message/message.js +222 -0
  21. package/dist/cjs/core/message/useMessage.js +12 -0
  22. package/dist/cjs/core/message-group/index.js +2 -2
  23. package/dist/cjs/coreX/DateRangePicker/AbsoluteDate.js +2 -1
  24. package/dist/cjs/coreX/DateRangePicker/Calendar.js +78 -58
  25. package/dist/cjs/coreX/DateRangePicker/index.js +13 -1
  26. package/dist/cjs/coreX/DateRangePicker/utils.js +5 -0
  27. package/dist/cjs/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
  28. package/dist/cjs/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
  29. package/dist/cjs/coreX/KubeConfigModal/KubeConfigModal.style.js +29 -0
  30. package/dist/cjs/coreX/KubeConfigModal/index.js +102 -0
  31. package/dist/cjs/coreX/KubeConfigModal/utils.js +25 -0
  32. package/dist/cjs/hooks/useCTErrorMsg.js +25 -0
  33. package/dist/cjs/index.js +225 -197
  34. package/dist/cjs/legacy-antd.js +81 -81
  35. package/dist/cjs/stats1.html +1 -1
  36. package/dist/cjs/utils/cterror.js +64 -0
  37. package/dist/cjs/utils/unit.js +19 -0
  38. package/dist/components.css +2054 -2776
  39. package/dist/esm/UIKitProvider/index.js +3 -6
  40. package/dist/esm/core/Banner/banner.style.js +6 -0
  41. package/dist/esm/core/Banner/index.js +25 -0
  42. package/dist/esm/core/BasicCTError/BasicCTError.style.js +3 -0
  43. package/dist/esm/core/BasicCTError/index.js +34 -0
  44. package/dist/esm/core/ConfigProvider/index.js +9 -4
  45. package/dist/esm/core/Fields/FieldsDateTimeRange/index.js +20 -3
  46. package/dist/esm/core/ImmersiveDialog/index.js +182 -0
  47. package/dist/esm/core/ImmersiveDialog/styles.js +16 -0
  48. package/dist/esm/core/MediumDialog/MediumDialog.js +48 -0
  49. package/dist/esm/core/SmallDialog/SmallDialog.js +137 -0
  50. package/dist/esm/core/SmallDialog/SmallDialog.style.js +6 -0
  51. package/dist/esm/core/TableForm/AddRowButton.js +2 -2
  52. package/dist/esm/core/TableForm/index.js +21 -6
  53. package/dist/esm/core/Timeline/index.js +13 -7
  54. package/dist/esm/core/WizardDialog/index.js +164 -0
  55. package/dist/esm/core/WizardDialog/styles.js +6 -0
  56. package/dist/esm/core/message/index.js +4 -184
  57. package/dist/esm/core/message/message.js +186 -0
  58. package/dist/esm/core/message/useMessage.js +9 -0
  59. package/dist/esm/core/message-group/index.js +1 -1
  60. package/dist/esm/coreX/DateRangePicker/AbsoluteDate.js +2 -1
  61. package/dist/esm/coreX/DateRangePicker/Calendar.js +79 -59
  62. package/dist/esm/coreX/DateRangePicker/index.js +13 -1
  63. package/dist/esm/coreX/DateRangePicker/utils.js +3 -0
  64. package/dist/esm/coreX/Dialogs/DeleteDialog/DeleteDialog.js +5 -3
  65. package/dist/esm/coreX/Dialogs/RejectDialog/RejectDialog.js +1 -1
  66. package/dist/esm/coreX/KubeConfigModal/KubeConfigModal.style.js +20 -0
  67. package/dist/esm/coreX/KubeConfigModal/index.js +96 -0
  68. package/dist/esm/coreX/KubeConfigModal/utils.js +22 -0
  69. package/dist/esm/hooks/useCTErrorMsg.js +23 -0
  70. package/dist/esm/index.js +14 -5
  71. package/dist/esm/legacy-antd.js +1 -1
  72. package/dist/esm/stats1.html +1 -1
  73. package/dist/esm/utils/cterror.js +58 -0
  74. package/dist/esm/utils/unit.js +17 -0
  75. package/dist/linaria.merged.scss +2329 -1902
  76. package/dist/src/UIKitProvider/index.d.ts +1 -3
  77. package/dist/src/core/Antd5Flex/index.d.ts +2 -0
  78. package/dist/src/core/Antd5Tree/Antd5Tree.d.ts +1 -0
  79. package/dist/src/core/Antd5Tree/Antd5Tree.type.d.ts +4 -0
  80. package/dist/src/core/Antd5Tree/index.d.ts +2 -0
  81. package/dist/src/core/Banner/banner.style.d.ts +4 -0
  82. package/dist/src/core/Banner/banner.types.d.ts +28 -0
  83. package/dist/src/core/Banner/index.d.ts +3 -0
  84. package/dist/src/core/BasicCTError/BasicCTError.style.d.ts +1 -0
  85. package/dist/src/core/BasicCTError/BasicCTError.type.d.ts +56 -0
  86. package/dist/src/core/BasicCTError/index.d.ts +3 -0
  87. package/dist/src/core/ConfigProvider/index.d.ts +6 -1
  88. package/dist/src/core/ImmersiveDialog/index.d.ts +3 -0
  89. package/dist/src/core/ImmersiveDialog/styles.d.ts +14 -0
  90. package/dist/src/core/ImmersiveDialog/type.d.ts +37 -0
  91. package/dist/src/core/Input/index.d.ts +2 -4
  92. package/dist/src/core/Input/input.type.d.ts +4 -0
  93. package/dist/src/core/MediumDialog/MediumDialog.d.ts +3 -0
  94. package/dist/src/core/MediumDialog/index.d.ts +1 -0
  95. package/dist/src/core/SmallDialog/SmallDialog.d.ts +3 -0
  96. package/dist/src/core/SmallDialog/SmallDialog.style.d.ts +4 -0
  97. package/dist/src/{coreX/Dialogs/SmallDialog.d.ts → core/SmallDialog/SmallDialog.type.d.ts} +12 -4
  98. package/dist/src/core/SmallDialog/index.d.ts +3 -0
  99. package/dist/src/core/TableForm/types.d.ts +7 -2
  100. package/dist/src/core/Timeline/Timeline.type.d.ts +27 -7
  101. package/dist/src/core/Timeline/index.d.ts +5 -1
  102. package/dist/src/core/WizardDialog/index.d.ts +3 -0
  103. package/dist/src/core/WizardDialog/styles.d.ts +4 -0
  104. package/dist/src/core/WizardDialog/type.d.ts +31 -0
  105. package/dist/src/core/index.d.ts +10 -14
  106. package/dist/src/core/message/index.d.ts +4 -53
  107. package/dist/src/core/message/message.d.ts +53 -0
  108. package/dist/src/core/message/useMessage.d.ts +4 -0
  109. package/dist/src/coreX/DateRangePicker/__tests__/utils.test.d.ts +1 -0
  110. package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +10 -2
  111. package/dist/src/coreX/DateRangePicker/utils.d.ts +7 -0
  112. package/dist/src/coreX/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +2 -0
  113. package/dist/src/coreX/Dialogs/index.d.ts +0 -1
  114. package/dist/src/coreX/KubeConfigModal/KubeConfigModal.style.d.ts +9 -0
  115. package/dist/src/coreX/KubeConfigModal/KubeConfigModal.type.d.ts +21 -0
  116. package/dist/src/coreX/KubeConfigModal/index.d.ts +4 -0
  117. package/dist/src/coreX/KubeConfigModal/utils.d.ts +2 -0
  118. package/dist/src/coreX/index.d.ts +2 -0
  119. package/dist/src/hooks/__tests__/useCTErrorMsg.test.d.ts +1 -0
  120. package/dist/src/hooks/index.d.ts +1 -0
  121. package/dist/src/hooks/useCTErrorMsg.d.ts +7 -0
  122. package/dist/src/utils/__test__/cterror.test.d.ts +1 -0
  123. package/dist/src/utils/__test__/unit.spec.d.ts +1 -0
  124. package/dist/src/utils/cterror.d.ts +29 -0
  125. package/dist/src/utils/index.d.ts +1 -0
  126. package/dist/src/utils/type.d.ts +32 -0
  127. package/dist/src/utils/unit.d.ts +14 -0
  128. package/dist/stories/docs/core/Antd5Tree.stories.d.ts +44 -0
  129. package/dist/stories/docs/core/Banner.stories.d.ts +53 -0
  130. package/dist/stories/docs/core/BasicCTError.stories.d.ts +47 -0
  131. package/dist/stories/docs/core/FieldsDateTimeRange.stories.d.ts +1 -0
  132. package/dist/stories/docs/core/ImmersiveDialog.stories.d.ts +96 -0
  133. package/dist/stories/docs/core/Input.simple.stories.d.ts +1 -3
  134. package/dist/stories/docs/core/MediumDialog.stories.d.ts +35 -0
  135. package/dist/stories/docs/core/Modal.stories.d.ts +0 -2
  136. package/dist/stories/docs/core/SmallDialog.stories.d.ts +37 -0
  137. package/dist/stories/docs/core/Timeline.stories.d.ts +4 -1
  138. package/dist/stories/docs/core/WizardDialog.stories.d.ts +109 -0
  139. package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
  140. package/dist/stories/docs/coreX/Dialogs/DeleteDialog.stories.d.ts +5 -0
  141. package/dist/stories/docs/coreX/KubeConfigModal.stories.d.ts +83 -0
  142. package/dist/style.css +2093 -1705
  143. package/package.json +5 -4
  144. package/dist/cjs/coreX/Dialogs/SmallDialog.js +0 -86
  145. package/dist/esm/coreX/Dialogs/SmallDialog.js +0 -80
@@ -32,6 +32,7 @@ const Timeline = ({
32
32
  emptyText,
33
33
  emptyRender,
34
34
  compact,
35
+ timelineContainerClassName,
35
36
  emptyTextClassName
36
37
  }) => {
37
38
  if (!items.length) {
@@ -56,7 +57,7 @@ const Timeline = ({
56
57
  pending: "info",
57
58
  idle: "normal"
58
59
  };
59
- return /* @__PURE__ */ React__default.createElement("div", { className: cx(TimelineWrapper) }, /* @__PURE__ */ React__default.createElement(Timeline$1, null, items.map((item, index) => {
60
+ return /* @__PURE__ */ React__default.createElement("div", { className: cx(TimelineWrapper, timelineContainerClassName) }, /* @__PURE__ */ React__default.createElement(Timeline$1, null, items.map((item, index) => {
60
61
  const {
61
62
  status,
62
63
  infos,
@@ -65,8 +66,10 @@ const Timeline = ({
65
66
  subInfo,
66
67
  subInfoRender,
67
68
  detailMessage,
69
+ detailMessages,
68
70
  detailMessageRender
69
71
  } = item;
72
+ const finalDetailMessages = detailMessages != null ? detailMessages : detailMessage ? [detailMessage] : [];
70
73
  return /* @__PURE__ */ React__default.createElement(
71
74
  Timeline$1.Item,
72
75
  {
@@ -101,12 +104,15 @@ const Timeline = ({
101
104
  })
102
105
  ))
103
106
  ),
104
- /* @__PURE__ */ React__default.createElement("div", { className: "item-time" }, subInfoRender ? subInfoRender(subInfo) : subInfo ? /* @__PURE__ */ React__default.createElement(TimelineArea, __spreadValues({}, subInfo)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null), detailMessageRender ? detailMessageRender(detailMessage) : detailMessage ? /* @__PURE__ */ React__default.createElement(
105
- Alert,
106
- __spreadValues({
107
- showIcon: false,
108
- type: alertTypeMap[status]
109
- }, detailMessage)
107
+ /* @__PURE__ */ React__default.createElement("div", { className: "item-time" }, subInfoRender ? subInfoRender(subInfo) : subInfo ? /* @__PURE__ */ React__default.createElement(TimelineArea, __spreadValues({}, subInfo)) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null), finalDetailMessages.length > 0 ? finalDetailMessages.map(
108
+ (detailMessage2, index2) => detailMessageRender ? detailMessageRender(detailMessage2, index2) : /* @__PURE__ */ React__default.createElement(
109
+ Alert,
110
+ __spreadValues({
111
+ key: `detail-message-${index2}`,
112
+ showIcon: false,
113
+ type: alertTypeMap[status]
114
+ }, detailMessage2)
115
+ )
110
116
  ) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null))
111
117
  );
112
118
  })));
@@ -0,0 +1,164 @@
1
+ import { ArrowChevronLeft16BoldBlueIcon } from '@cloudtower/icons-react';
2
+ import Button from '../Button/index.js';
3
+ import { ImmersiveDialog } from '../ImmersiveDialog/index.js';
4
+ import Steps from '../Steps/index.js';
5
+ import useParrotTranslation from '../../hooks/useParrotTranslation.js';
6
+ import React__default, { useState, useMemo, useEffect } from 'react';
7
+ import { StepContentStyle, PrevIconStyle, StepStyle, RightPanelStyle } from './styles.js';
8
+ import { cx } from '@linaria/core';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __defProps = Object.defineProperties;
12
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
+ var __spreadValues = (a, b) => {
18
+ for (var prop in b || (b = {}))
19
+ if (__hasOwnProp.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop))
24
+ __defNormalProp(a, prop, b[prop]);
25
+ }
26
+ return a;
27
+ };
28
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29
+ var __objRest = (source, exclude) => {
30
+ var target = {};
31
+ for (var prop in source)
32
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
33
+ target[prop] = source[prop];
34
+ if (source != null && __getOwnPropSymbols)
35
+ for (var prop of __getOwnPropSymbols(source)) {
36
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
37
+ target[prop] = source[prop];
38
+ }
39
+ return target;
40
+ };
41
+ function WizardDialog(props) {
42
+ const _a = props, {
43
+ className,
44
+ steps,
45
+ step,
46
+ children,
47
+ hideSteps,
48
+ destroyOtherStep,
49
+ prevText,
50
+ nextText,
51
+ onPrevStep,
52
+ onNextStep,
53
+ onStepChange,
54
+ left,
55
+ right,
56
+ rightClassName,
57
+ okText,
58
+ onOk
59
+ } = _a, restProps = __objRest(_a, [
60
+ "className",
61
+ "steps",
62
+ "step",
63
+ "children",
64
+ "hideSteps",
65
+ "destroyOtherStep",
66
+ "prevText",
67
+ "nextText",
68
+ "onPrevStep",
69
+ "onNextStep",
70
+ "onStepChange",
71
+ "left",
72
+ "right",
73
+ "rightClassName",
74
+ "okText",
75
+ "onOk"
76
+ ]);
77
+ const { t } = useParrotTranslation();
78
+ const [_step, _setStep] = useState(step || 0);
79
+ const stepVal = useMemo(() => step != null ? step : _step, [step, _step]);
80
+ const content = useMemo(() => {
81
+ var _a2;
82
+ if (destroyOtherStep) {
83
+ return ((_a2 = steps == null ? void 0 : steps[stepVal]) == null ? void 0 : _a2.children) || children;
84
+ }
85
+ return (steps == null ? void 0 : steps.map((s, index) => /* @__PURE__ */ React__default.createElement(
86
+ "div",
87
+ {
88
+ key: s.title,
89
+ className: StepContentStyle,
90
+ style: {
91
+ display: stepVal === index ? "block" : "none"
92
+ }
93
+ },
94
+ s.children
95
+ ))) || children;
96
+ }, [children, destroyOtherStep, steps, stepVal]);
97
+ const _confirmText = useMemo(() => {
98
+ let text = okText || t("common.confirm");
99
+ if (steps == null ? void 0 : steps.length) {
100
+ text = stepVal < steps.length - 1 ? nextText || t("common.next_step") : text;
101
+ }
102
+ return text;
103
+ }, [okText, t, steps == null ? void 0 : steps.length, stepVal, nextText]);
104
+ useEffect(() => {
105
+ if (step) {
106
+ _setStep(step);
107
+ }
108
+ }, [step]);
109
+ return /* @__PURE__ */ React__default.createElement(
110
+ ImmersiveDialog,
111
+ __spreadProps(__spreadValues({
112
+ className,
113
+ footerLeftAction: stepVal > 0 ? /* @__PURE__ */ React__default.createElement(
114
+ Button,
115
+ {
116
+ type: "link",
117
+ onClick: () => {
118
+ const newStep = stepVal - 1;
119
+ _setStep(newStep);
120
+ onPrevStep == null ? void 0 : onPrevStep(newStep);
121
+ onStepChange == null ? void 0 : onStepChange(newStep);
122
+ }
123
+ },
124
+ /* @__PURE__ */ React__default.createElement(ArrowChevronLeft16BoldBlueIcon, { className: PrevIconStyle }),
125
+ prevText || t("common.prev_step")
126
+ ) : null,
127
+ left: left || (steps && steps.length > 0 && !hideSteps ? /* @__PURE__ */ React__default.createElement(
128
+ Steps,
129
+ {
130
+ containerClassname: StepStyle,
131
+ current: stepVal,
132
+ onChange: (value) => {
133
+ _setStep(value);
134
+ onStepChange == null ? void 0 : onStepChange(value);
135
+ },
136
+ direction: "vertical",
137
+ stepsConfig: steps.map((s) => ({
138
+ title: s.title
139
+ }))
140
+ }
141
+ ) : null),
142
+ right,
143
+ okText: _confirmText,
144
+ onOk: (e) => {
145
+ if (stepVal < ((steps == null ? void 0 : steps.length) || 0) - 1) {
146
+ const newStep = stepVal + 1;
147
+ const prevent = (onNextStep == null ? void 0 : onNextStep(newStep)) === false;
148
+ if (!prevent) {
149
+ _setStep(newStep);
150
+ onStepChange == null ? void 0 : onStepChange(newStep);
151
+ }
152
+ } else {
153
+ onOk == null ? void 0 : onOk(e);
154
+ }
155
+ },
156
+ rightClassName: cx(RightPanelStyle, rightClassName)
157
+ }, restProps), {
158
+ isContentFull: false
159
+ }),
160
+ content
161
+ );
162
+ }
163
+
164
+ export { WizardDialog };
@@ -0,0 +1,6 @@
1
+ const StepStyle = "E_sqv6dmy";
2
+ const PrevIconStyle = "E_p1rm8wzb";
3
+ const StepContentStyle = "E_sd7qcf4";
4
+ const RightPanelStyle = "E_r1fxc9gq";
5
+
6
+ export { PrevIconStyle, RightPanelStyle, StepContentStyle, StepStyle };
@@ -1,186 +1,6 @@
1
- import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled';
2
- import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
3
- import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
4
- import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
5
- import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
6
- import RCNotification from '@cloudtower/rc-notification';
7
- import cs from 'classnames';
8
- import * as React from 'react';
1
+ import _message from './message.js';
2
+ export { DEFAULT_DURATION, attachTypeApi, getKeyThenIncreaseKey } from './message.js';
9
3
 
10
- var __defProp = Object.defineProperty;
11
- var __defProps = Object.defineProperties;
12
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
- var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
17
- var __spreadValues = (a, b) => {
18
- for (var prop in b || (b = {}))
19
- if (__hasOwnProp.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- if (__getOwnPropSymbols)
22
- for (var prop of __getOwnPropSymbols(b)) {
23
- if (__propIsEnum.call(b, prop))
24
- __defNormalProp(a, prop, b[prop]);
25
- }
26
- return a;
27
- };
28
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29
- const DEFAULT_DURATION = 3;
30
- let messageInstance;
31
- let defaultDuration = DEFAULT_DURATION;
32
- let defaultTop;
33
- let key = 1;
34
- let localPrefixCls = "ant-message";
35
- let transitionName = "move-up";
36
- let getContainer;
37
- let maxCount;
38
- let rtl = false;
39
- function getKeyThenIncreaseKey() {
40
- return key++;
41
- }
42
- function setMessageConfig(options) {
43
- if (options.top !== void 0) {
44
- defaultTop = options.top;
45
- messageInstance = null;
46
- }
47
- if (options.duration !== void 0) {
48
- defaultDuration = options.duration;
49
- }
50
- if (options.prefixCls !== void 0) {
51
- localPrefixCls = options.prefixCls;
52
- }
53
- if (options.getContainer !== void 0) {
54
- getContainer = options.getContainer;
55
- }
56
- if (options.transitionName !== void 0) {
57
- transitionName = options.transitionName;
58
- messageInstance = null;
59
- }
60
- if (options.maxCount !== void 0) {
61
- maxCount = options.maxCount;
62
- messageInstance = null;
63
- }
64
- if (options.rtl !== void 0) {
65
- rtl = options.rtl;
66
- }
67
- }
68
- function getRCNotificationInstance(args, callback) {
69
- const prefixCls = args.prefixCls || localPrefixCls;
70
- if (messageInstance) {
71
- callback({
72
- prefixCls,
73
- instance: messageInstance
74
- });
75
- return;
76
- }
77
- RCNotification.newInstance(
78
- {
79
- prefixCls,
80
- transitionName,
81
- style: { top: defaultTop },
82
- // 覆盖原来的样式
83
- getContainer,
84
- maxCount
85
- },
86
- (instance) => {
87
- if (messageInstance) {
88
- callback({
89
- prefixCls,
90
- instance: messageInstance
91
- });
92
- return;
93
- }
94
- messageInstance = instance;
95
- callback({
96
- prefixCls,
97
- instance
98
- });
99
- }
100
- );
101
- }
102
- const typeToIcon = {
103
- info: InfoCircleFilled,
104
- success: CheckCircleFilled,
105
- error: CloseCircleFilled,
106
- warning: ExclamationCircleFilled,
107
- loading: LoadingOutlined
108
- };
109
- function getRCNoticeProps(args, prefixCls) {
110
- const duration = args.duration !== void 0 ? args.duration : defaultDuration;
111
- const IconComponent = args.type != null ? typeToIcon[args.type] : void 0;
112
- const messageClass = cs(`${prefixCls}-custom-content`, {
113
- [`${prefixCls}-${args.type}`]: args.type,
114
- [`${prefixCls}-rtl`]: rtl === true
115
- });
116
- return {
117
- key: args.key,
118
- duration,
119
- style: args.style || {},
120
- className: args.className,
121
- content: /* @__PURE__ */ React.createElement("div", { className: messageClass }, args.icon || IconComponent && /* @__PURE__ */ React.createElement(IconComponent, null), /* @__PURE__ */ React.createElement("span", null, args.content)),
122
- onClose: args.onClose
123
- };
124
- }
125
- function notice(args) {
126
- const target = args.key || key++;
127
- const closePromise = new Promise((resolve) => {
128
- const callback = () => {
129
- if (typeof args.onClose === "function") {
130
- args.onClose();
131
- }
132
- return resolve(true);
133
- };
134
- if (document.hidden) {
135
- return;
136
- }
137
- getRCNotificationInstance(args, ({ prefixCls, instance }) => {
138
- instance.notice(
139
- getRCNoticeProps(
140
- __spreadProps(__spreadValues({}, args), { key: target, onClose: callback }),
141
- prefixCls
142
- )
143
- );
144
- });
145
- });
146
- const result = () => {
147
- if (messageInstance) {
148
- messageInstance.removeNotice(target);
149
- }
150
- };
151
- result.then = (filled, rejected) => closePromise.then(filled, rejected);
152
- result.promise = closePromise;
153
- return result;
154
- }
155
- function isArgsProps(content) {
156
- return Object.prototype.toString.call(content) === "[object Object]" && !!content.content;
157
- }
158
- const api = {
159
- open: notice,
160
- config: setMessageConfig,
161
- destroy() {
162
- if (messageInstance) {
163
- messageInstance.destroy();
164
- messageInstance = null;
165
- }
166
- }
167
- };
168
- function attachTypeApi(originalApi, type) {
169
- originalApi[type] = (content, duration, onClose) => {
170
- if (isArgsProps(content)) {
171
- return originalApi.open(__spreadProps(__spreadValues({}, content), { type }));
172
- }
173
- if (typeof duration === "function") {
174
- onClose = duration;
175
- duration = void 0;
176
- }
177
- return originalApi.open({ content, duration, type, onClose });
178
- };
179
- }
180
- ["success", "info", "warning", "error", "loading"].forEach(
181
- (type) => attachTypeApi(api, type)
182
- );
183
- api.warn = api.warning;
184
- var _message = api;
185
4
 
186
- export { DEFAULT_DURATION, attachTypeApi, _message as default, getKeyThenIncreaseKey };
5
+
6
+ export { _message as default };
@@ -0,0 +1,186 @@
1
+ import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled';
2
+ import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
3
+ import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
4
+ import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
5
+ import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
6
+ import RCNotification from '@cloudtower/rc-notification';
7
+ import cs from 'classnames';
8
+ import * as React from 'react';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __defProps = Object.defineProperties;
12
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
+ var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
17
+ var __spreadValues = (a, b) => {
18
+ for (var prop in b || (b = {}))
19
+ if (__hasOwnProp.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop))
24
+ __defNormalProp(a, prop, b[prop]);
25
+ }
26
+ return a;
27
+ };
28
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29
+ const DEFAULT_DURATION = 3;
30
+ let messageInstance;
31
+ let defaultDuration = DEFAULT_DURATION;
32
+ let defaultTop;
33
+ let key = 1;
34
+ let localPrefixCls = "ant-message";
35
+ let transitionName = "move-up";
36
+ let getContainer;
37
+ let maxCount;
38
+ let rtl = false;
39
+ function getKeyThenIncreaseKey() {
40
+ return key++;
41
+ }
42
+ function setMessageConfig(options) {
43
+ if (options.top !== void 0) {
44
+ defaultTop = options.top;
45
+ messageInstance = null;
46
+ }
47
+ if (options.duration !== void 0) {
48
+ defaultDuration = options.duration;
49
+ }
50
+ if (options.prefixCls !== void 0) {
51
+ localPrefixCls = options.prefixCls;
52
+ }
53
+ if (options.getContainer !== void 0) {
54
+ getContainer = options.getContainer;
55
+ }
56
+ if (options.transitionName !== void 0) {
57
+ transitionName = options.transitionName;
58
+ messageInstance = null;
59
+ }
60
+ if (options.maxCount !== void 0) {
61
+ maxCount = options.maxCount;
62
+ messageInstance = null;
63
+ }
64
+ if (options.rtl !== void 0) {
65
+ rtl = options.rtl;
66
+ }
67
+ }
68
+ function getRCNotificationInstance(args, callback) {
69
+ const prefixCls = args.prefixCls || localPrefixCls;
70
+ if (messageInstance) {
71
+ callback({
72
+ prefixCls,
73
+ instance: messageInstance
74
+ });
75
+ return;
76
+ }
77
+ RCNotification.newInstance(
78
+ {
79
+ prefixCls,
80
+ transitionName,
81
+ style: { top: defaultTop },
82
+ // 覆盖原来的样式
83
+ getContainer,
84
+ maxCount
85
+ },
86
+ (instance) => {
87
+ if (messageInstance) {
88
+ callback({
89
+ prefixCls,
90
+ instance: messageInstance
91
+ });
92
+ return;
93
+ }
94
+ messageInstance = instance;
95
+ callback({
96
+ prefixCls,
97
+ instance
98
+ });
99
+ }
100
+ );
101
+ }
102
+ const typeToIcon = {
103
+ info: InfoCircleFilled,
104
+ success: CheckCircleFilled,
105
+ error: CloseCircleFilled,
106
+ warning: ExclamationCircleFilled,
107
+ loading: LoadingOutlined
108
+ };
109
+ function getRCNoticeProps(args, prefixCls) {
110
+ const duration = args.duration !== void 0 ? args.duration : defaultDuration;
111
+ const IconComponent = args.type != null ? typeToIcon[args.type] : void 0;
112
+ const messageClass = cs(`${prefixCls}-custom-content`, {
113
+ [`${prefixCls}-${args.type}`]: args.type,
114
+ [`${prefixCls}-rtl`]: rtl === true
115
+ });
116
+ return {
117
+ key: args.key,
118
+ duration,
119
+ style: args.style || {},
120
+ className: args.className,
121
+ content: /* @__PURE__ */ React.createElement("div", { className: messageClass }, args.icon || IconComponent && /* @__PURE__ */ React.createElement(IconComponent, null), /* @__PURE__ */ React.createElement("span", null, args.content)),
122
+ onClose: args.onClose
123
+ };
124
+ }
125
+ function notice(args) {
126
+ const target = args.key || key++;
127
+ const closePromise = new Promise((resolve) => {
128
+ const callback = () => {
129
+ if (typeof args.onClose === "function") {
130
+ args.onClose();
131
+ }
132
+ return resolve(true);
133
+ };
134
+ if (document.hidden) {
135
+ return;
136
+ }
137
+ getRCNotificationInstance(args, ({ prefixCls, instance }) => {
138
+ instance.notice(
139
+ getRCNoticeProps(
140
+ __spreadProps(__spreadValues({}, args), { key: target, onClose: callback }),
141
+ prefixCls
142
+ )
143
+ );
144
+ });
145
+ });
146
+ const result = () => {
147
+ if (messageInstance) {
148
+ messageInstance.removeNotice(target);
149
+ }
150
+ };
151
+ result.then = (filled, rejected) => closePromise.then(filled, rejected);
152
+ result.promise = closePromise;
153
+ return result;
154
+ }
155
+ function isArgsProps(content) {
156
+ return Object.prototype.toString.call(content) === "[object Object]" && !!content.content;
157
+ }
158
+ const api = {
159
+ open: notice,
160
+ config: setMessageConfig,
161
+ destroy() {
162
+ if (messageInstance) {
163
+ messageInstance.destroy();
164
+ messageInstance = null;
165
+ }
166
+ }
167
+ };
168
+ function attachTypeApi(originalApi, type) {
169
+ originalApi[type] = (content, duration, onClose) => {
170
+ if (isArgsProps(content)) {
171
+ return originalApi.open(__spreadProps(__spreadValues({}, content), { type }));
172
+ }
173
+ if (typeof duration === "function") {
174
+ onClose = duration;
175
+ duration = void 0;
176
+ }
177
+ return originalApi.open({ content, duration, type, onClose });
178
+ };
179
+ }
180
+ ["success", "info", "warning", "error", "loading"].forEach(
181
+ (type) => attachTypeApi(api, type)
182
+ );
183
+ api.warn = api.warning;
184
+ var _message = api;
185
+
186
+ export { DEFAULT_DURATION, attachTypeApi, _message as default, getKeyThenIncreaseKey };
@@ -0,0 +1,9 @@
1
+ import { createContext, useContext } from 'react';
2
+ import _message from './message.js';
3
+
4
+ const MessageContext = createContext(_message);
5
+ const useMessage = () => {
6
+ return useContext(MessageContext);
7
+ };
8
+
9
+ export { MessageContext, useMessage };
@@ -1,4 +1,4 @@
1
- import { DEFAULT_DURATION } from '../message/index.js';
1
+ import { DEFAULT_DURATION } from '../message/message.js';
2
2
 
3
3
  var __defProp = Object.defineProperty;
4
4
  var __defProps = Object.defineProperties;
@@ -139,7 +139,7 @@ const Time = React__default.forwardRef((props, ref) => {
139
139
  });
140
140
  const AbsoluteDate = React__default.forwardRef(
141
141
  (props, ref) => {
142
- const { range, minDate, maxDate, onChange, onOk } = props;
142
+ const { range, minDate, maxDate, maxRange, onChange, onOk } = props;
143
143
  const timeRef = useRef(null);
144
144
  useImperativeHandle(ref, () => {
145
145
  var _a;
@@ -158,6 +158,7 @@ const AbsoluteDate = React__default.forwardRef(
158
158
  range,
159
159
  minDate,
160
160
  maxDate,
161
+ maxRange,
161
162
  onChange
162
163
  }
163
164
  ), /* @__PURE__ */ React__default.createElement(