@cloudtower/eagle 0.26.17 → 0.26.19

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/umd/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('antd'), require('react'), require('classnames'), require('lodash'), require('react-svg-unique-id'), require('@cloudtower/parrot'), require('react-i18next'), require('@linaria/core'), require('@linaria/react'), require('@cloudtower/icons-react'), require('moment'), require('react-dom'), require('react-is'), require('@ant-design/icons'), require('@ant-design/icons/CheckCircleFilled'), require('@ant-design/icons/CloseCircleFilled'), require('@ant-design/icons/ExclamationCircleFilled'), require('@ant-design/icons/InfoCircleFilled'), require('@ant-design/icons/LoadingOutlined'), require('@cloudtower/rc-notification'), require('redux'), require('react-redux'), require('react-beautiful-dnd'), require('timezones.json'), require('dayjs'), require('recharts'), require('antd/lib/locale/en_US'), require('antd/lib/locale/zh_CN')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'antd', 'react', 'classnames', 'lodash', 'react-svg-unique-id', '@cloudtower/parrot', 'react-i18next', '@linaria/core', '@linaria/react', '@cloudtower/icons-react', 'moment', 'react-dom', 'react-is', '@ant-design/icons', '@ant-design/icons/CheckCircleFilled', '@ant-design/icons/CloseCircleFilled', '@ant-design/icons/ExclamationCircleFilled', '@ant-design/icons/InfoCircleFilled', '@ant-design/icons/LoadingOutlined', '@cloudtower/rc-notification', 'redux', 'react-redux', 'react-beautiful-dnd', 'timezones.json', 'dayjs', 'recharts', 'antd/lib/locale/en_US', 'antd/lib/locale/zh_CN'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.index = {}, global.antd, global.React, global.cs, global._, global.reactSvgUniqueId, global.parrot, global.reactI18next, global.core, global.react, global.iconsReact, global.moment, global.reactDom, global.reactIs, global.icons, global.CheckCircleFilled, global.CloseCircleFilled, global.ExclamationCircleFilled, global.InfoCircleFilled, global.LoadingOutlined, global.RCNotification, global.redux, global.reactRedux, global.reactBeautifulDnd, global.TimeZones, global.dayjs, null, global.enUS, global.zhCN));
5
- })(this, (function (exports, antd, React, cs, _, reactSvgUniqueId, parrot, reactI18next, core, react, iconsReact, moment, reactDom, reactIs, icons, CheckCircleFilled, CloseCircleFilled, ExclamationCircleFilled, InfoCircleFilled, LoadingOutlined, RCNotification, redux, reactRedux, reactBeautifulDnd, TimeZones, dayjs, recharts, enUS, zhCN) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('antd'), require('react'), require('classnames'), require('lodash'), require('react-svg-unique-id'), require('@cloudtower/parrot'), require('react-i18next'), require('@linaria/core'), require('@linaria/react'), require('@cloudtower/icons-react'), require('moment'), require('react-dom'), require('react-is'), require('@ant-design/icons'), require('@ant-design/icons/CheckCircleFilled'), require('@ant-design/icons/CloseCircleFilled'), require('@ant-design/icons/ExclamationCircleFilled'), require('@ant-design/icons/InfoCircleFilled'), require('@ant-design/icons/LoadingOutlined'), require('@cloudtower/rc-notification'), require('redux'), require('react-redux'), require('react-beautiful-dnd'), require('dayjs'), require('timezones.json'), require('recharts'), require('antd/lib/locale/en_US'), require('antd/lib/locale/zh_CN')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'antd', 'react', 'classnames', 'lodash', 'react-svg-unique-id', '@cloudtower/parrot', 'react-i18next', '@linaria/core', '@linaria/react', '@cloudtower/icons-react', 'moment', 'react-dom', 'react-is', '@ant-design/icons', '@ant-design/icons/CheckCircleFilled', '@ant-design/icons/CloseCircleFilled', '@ant-design/icons/ExclamationCircleFilled', '@ant-design/icons/InfoCircleFilled', '@ant-design/icons/LoadingOutlined', '@cloudtower/rc-notification', 'redux', 'react-redux', 'react-beautiful-dnd', 'dayjs', 'timezones.json', 'recharts', 'antd/lib/locale/en_US', 'antd/lib/locale/zh_CN'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.index = {}, global.antd, global.React, global.cs, global._, global.reactSvgUniqueId, global.parrot, global.reactI18next, global.core, global.react, global.iconsReact, global.moment, global.reactDom, global.reactIs, global.icons, global.CheckCircleFilled, global.CloseCircleFilled, global.ExclamationCircleFilled, global.InfoCircleFilled, global.LoadingOutlined, global.RCNotification, global.redux, global.reactRedux, global.reactBeautifulDnd, global.dayjs, global.TimeZones, null, global.enUS, global.zhCN));
5
+ })(this, (function (exports, antd, React, cs, _, reactSvgUniqueId, parrot, reactI18next, core, react, iconsReact, moment, reactDom, reactIs, icons, CheckCircleFilled, CloseCircleFilled, ExclamationCircleFilled, InfoCircleFilled, LoadingOutlined, RCNotification, redux, reactRedux, reactBeautifulDnd, dayjs, TimeZones, recharts, enUS, zhCN) { 'use strict';
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
@@ -34,8 +34,8 @@
34
34
  var InfoCircleFilled__default = /*#__PURE__*/_interopDefault(InfoCircleFilled);
35
35
  var LoadingOutlined__default = /*#__PURE__*/_interopDefault(LoadingOutlined);
36
36
  var RCNotification__default = /*#__PURE__*/_interopDefault(RCNotification);
37
- var TimeZones__default = /*#__PURE__*/_interopDefault(TimeZones);
38
37
  var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
38
+ var TimeZones__default = /*#__PURE__*/_interopDefault(TimeZones);
39
39
  var enUS__default = /*#__PURE__*/_interopDefault(enUS);
40
40
  var zhCN__default = /*#__PURE__*/_interopDefault(zhCN);
41
41
 
@@ -1180,6 +1180,7 @@
1180
1180
  subInfo,
1181
1181
  className,
1182
1182
  defaultOpen = false,
1183
+ hoverable,
1183
1184
  shadow = true
1184
1185
  } = _a, domProps = __objRest$p(_a, [
1185
1186
  "collapsible",
@@ -1187,6 +1188,7 @@
1187
1188
  "subInfo",
1188
1189
  "className",
1189
1190
  "defaultOpen",
1191
+ "hoverable",
1190
1192
  "shadow"
1191
1193
  ]);
1192
1194
  const [open, setOpen] = React.useState(defaultOpen);
@@ -1194,7 +1196,7 @@
1194
1196
  CardWrapper,
1195
1197
  __spreadProps$x(__spreadValues$H({
1196
1198
  ref,
1197
- className: cs__default.default(["card-wrapper", className])
1199
+ className: cs__default.default(["card-wrapper", className, hoverable && "hoverable"])
1198
1200
  }, domProps), {
1199
1201
  shadow
1200
1202
  }),
@@ -3612,59 +3614,113 @@
3612
3614
  return /* @__PURE__ */ React__namespace.default.createElement("span", null, /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("value", valueClassName) }, value), /* @__PURE__ */ React__namespace.default.createElement("span", { className: core.cx("unit", unitClassName) }, ` ${unit}`));
3613
3615
  };
3614
3616
 
3617
+ const StepsStyle = "sq6vos1";
3618
+ const HorizontalStyle = "hjtnwxg";
3619
+ const VerticalStyle = "v1p8siwu";
3620
+ const HorizontalStepContentStyle = "h1xo7yjb";
3621
+ const VerticalStepContentStyle = "v1f2f7cy";
3622
+
3615
3623
  var __defProp$e = Object.defineProperty;
3616
3624
  var __defProps$e = Object.defineProperties;
3617
3625
  var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
3618
3626
  var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
3619
3627
  var __hasOwnProp$e = Object.prototype.hasOwnProperty;
3620
3628
  var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
3621
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, {
3622
- enumerable: true,
3623
- configurable: true,
3624
- writable: true,
3625
- value
3626
- }) : obj[key] = value;
3629
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3627
3630
  var __spreadValues$e = (a, b) => {
3628
- for (var prop in b || (b = {})) if (__hasOwnProp$e.call(b, prop)) __defNormalProp$e(a, prop, b[prop]);
3629
- if (__getOwnPropSymbols$e) for (var prop of __getOwnPropSymbols$e(b)) {
3630
- if (__propIsEnum$e.call(b, prop)) __defNormalProp$e(a, prop, b[prop]);
3631
- }
3631
+ for (var prop in b || (b = {}))
3632
+ if (__hasOwnProp$e.call(b, prop))
3633
+ __defNormalProp$e(a, prop, b[prop]);
3634
+ if (__getOwnPropSymbols$e)
3635
+ for (var prop of __getOwnPropSymbols$e(b)) {
3636
+ if (__propIsEnum$e.call(b, prop))
3637
+ __defNormalProp$e(a, prop, b[prop]);
3638
+ }
3632
3639
  return a;
3633
3640
  };
3634
3641
  var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
3635
3642
  var __objRest$5 = (source, exclude) => {
3636
3643
  var target = {};
3637
- for (var prop in source) if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
3638
- if (source != null && __getOwnPropSymbols$e) for (var prop of __getOwnPropSymbols$e(source)) {
3639
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop)) target[prop] = source[prop];
3640
- }
3644
+ for (var prop in source)
3645
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
3646
+ target[prop] = source[prop];
3647
+ if (source != null && __getOwnPropSymbols$e)
3648
+ for (var prop of __getOwnPropSymbols$e(source)) {
3649
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
3650
+ target[prop] = source[prop];
3651
+ }
3641
3652
  return target;
3642
3653
  };
3643
- const StepsContainer = /*#__PURE__*/react.styled('div')({
3644
- name: "StepsContainer",
3645
- class: "s3mgie3",
3646
- propsAsIs: false
3647
- });
3648
- const Steps = props => {
3649
- const _a = props,
3654
+ const StepTitle = (props) => {
3655
+ const { current, step, index, isVerticalMode } = props;
3656
+ const textRef = React.useRef(null);
3657
+ const [tooltipEnable, setTooltipEnable] = React.useState({
3658
+ visible: false
3659
+ });
3660
+ React.useLayoutEffect(() => {
3661
+ if (textRef.current && textRef.current.offsetWidth < textRef.current.scrollWidth) {
3662
+ setTooltipEnable({});
3663
+ }
3664
+ }, [textRef]);
3665
+ return /* @__PURE__ */ React__namespace.default.createElement(Tooltip, __spreadProps$e(__spreadValues$e({}, tooltipEnable), { title: step.title }), /* @__PURE__ */ React__namespace.default.createElement(
3666
+ "div",
3650
3667
  {
3651
- stepsConfig,
3652
- containerClassname,
3653
- showStepCount
3654
- } = _a,
3655
- stepsProps = __objRest$5(_a, ["stepsConfig", "containerClassname", "showStepCount"]);
3656
- const titleWithCount = (_step, count) => /* @__PURE__ */React__namespace.default.createElement(React__namespace.default.Fragment, null, showStepCount ? /* @__PURE__ */React__namespace.default.createElement("span", {
3657
- className: "step-count"
3658
- }, count) : null, _step.title);
3659
- return /* @__PURE__ */React__namespace.default.createElement(StepsContainer, {
3660
- className: containerClassname
3661
- }, /* @__PURE__ */React__namespace.default.createElement(antd.Steps, __spreadProps$e(__spreadValues$e({}, stepsProps), {
3662
- type: "default"
3663
- }), (stepsConfig == null ? void 0 : stepsConfig.length) ? stepsConfig.map((step, index) => /* @__PURE__ */React__namespace.default.createElement(antd.Steps.Step, __spreadProps$e(__spreadValues$e({
3664
- key: index
3665
- }, step), {
3666
- title: titleWithCount(step, index + 1)
3667
- }))) : props.children));
3668
+ className: isVerticalMode ? VerticalStepContentStyle : HorizontalStepContentStyle
3669
+ },
3670
+ /* @__PURE__ */ React__namespace.default.createElement("span", { className: "step-item-prefix-container" }, index < current ? /* @__PURE__ */ React__namespace.default.createElement(iconsReact.CheckmarkDoneSuccessCorrect16SecondaryIcon, null) : index + 1),
3671
+ /* @__PURE__ */ React__namespace.default.createElement("span", { ref: textRef, className: "step-item-title" }, /* @__PURE__ */ React__namespace.default.createElement("span", { className: "step-item-title" }, step.title))
3672
+ ));
3673
+ };
3674
+ const Steps = (props) => {
3675
+ const _a = props, {
3676
+ stepsConfig,
3677
+ direction,
3678
+ containerClassname,
3679
+ current = 0,
3680
+ disabled
3681
+ } = _a, stepsProps = __objRest$5(_a, [
3682
+ "stepsConfig",
3683
+ "direction",
3684
+ "containerClassname",
3685
+ "current",
3686
+ "disabled"
3687
+ ]);
3688
+ const isVerticalMode = direction === "vertical";
3689
+ return /* @__PURE__ */ React__namespace.default.createElement(
3690
+ "div",
3691
+ {
3692
+ className: cs__default.default(
3693
+ containerClassname,
3694
+ StepsStyle,
3695
+ isVerticalMode ? VerticalStyle : HorizontalStyle
3696
+ )
3697
+ },
3698
+ /* @__PURE__ */ React__namespace.default.createElement(
3699
+ antd.Steps,
3700
+ __spreadProps$e(__spreadValues$e({}, stepsProps), {
3701
+ direction,
3702
+ current,
3703
+ type: "default"
3704
+ }),
3705
+ (stepsConfig == null ? void 0 : stepsConfig.length) ? stepsConfig.map((step, index) => /* @__PURE__ */ React__namespace.default.createElement(
3706
+ antd.Steps.Step,
3707
+ __spreadProps$e(__spreadValues$e({
3708
+ key: index
3709
+ }, step), {
3710
+ disabled: disabled || index > current,
3711
+ title: /* @__PURE__ */ React__namespace.default.createElement(
3712
+ StepTitle,
3713
+ {
3714
+ index,
3715
+ step,
3716
+ current,
3717
+ isVerticalMode
3718
+ }
3719
+ )
3720
+ })
3721
+ )) : props.children
3722
+ )
3723
+ );
3668
3724
  };
3669
3725
 
3670
3726
  var __defProp$d = Object.defineProperty;
@@ -5041,6 +5097,23 @@
5041
5097
  };
5042
5098
  Tag.SplitTag = SplitTag;
5043
5099
 
5100
+ const Time = (props) => {
5101
+ const {
5102
+ className,
5103
+ date,
5104
+ dateTemplate = "YYYY-MM-DD",
5105
+ timeTemplate = "HH:mm",
5106
+ plainText
5107
+ } = props;
5108
+ if (!date)
5109
+ return /* @__PURE__ */ React__namespace.default.createElement(React__namespace.default.Fragment, null, "-");
5110
+ const time = dayjs__default.default(date);
5111
+ if (plainText) {
5112
+ return /* @__PURE__ */ React__namespace.default.createElement(React__namespace.default.Fragment, null, dateTemplate !== null && time.format(dateTemplate), " ", timeTemplate !== null && time.format(timeTemplate));
5113
+ }
5114
+ return /* @__PURE__ */ React__namespace.default.createElement("span", { className: `time-wrapper ${className || ""}` }, dateTemplate !== null && /* @__PURE__ */ React__namespace.default.createElement("span", { className: "date" }, " ", time.format(dateTemplate)), timeTemplate !== null && /* @__PURE__ */ React__namespace.default.createElement("span", { className: "time" }, " ", time.format(timeTemplate)));
5115
+ };
5116
+
5044
5117
  const allTimeZones = _.uniqBy(TimeZones__default.default.reduce((sum, zone) => {
5045
5118
  const utcZones = zone.utc.map(utc => {
5046
5119
  return {
@@ -5228,7 +5301,7 @@
5228
5301
  large: "l1d492wb"
5229
5302
  };
5230
5303
  const TokenStyle = "t1lzavmu";
5231
- const Token = _a => {
5304
+ const Token = React__namespace.default.forwardRef((_a, ref) => {
5232
5305
  var _b = _a,
5233
5306
  {
5234
5307
  size = "small",
@@ -5236,26 +5309,32 @@
5236
5309
  className,
5237
5310
  icon,
5238
5311
  checked,
5239
- children
5312
+ children,
5313
+ tooltipConfig
5240
5314
  } = _b,
5241
- props = __objRest(_b, ["size", "color", "className", "icon", "checked", "children"]);
5315
+ props = __objRest(_b, ["size", "color", "className", "icon", "checked", "children", "tooltipConfig"]);
5242
5316
  return /* @__PURE__ */React__namespace.default.createElement(antd.Tag, __spreadProps$3(__spreadValues$3({}, props), {
5317
+ ref,
5243
5318
  className: cs__default.default(className, Size[size], TokenStyle, {
5244
5319
  [Typo.Label.l4_regular]: size === "small" || size === "medium",
5245
5320
  [Typo.Label.l3_regular]: size === "large",
5246
5321
  [`ant-tag-${color}`]: PresetColors.includes(color)
5247
5322
  }, "ui-kit-token", checked && "ui-kit-token-checked"),
5248
- closeIcon: /* @__PURE__ */React__namespace.default.createElement(Icon, {
5323
+ closeIcon: /* @__PURE__ */React__namespace.default.createElement(Tooltip, __spreadValues$3({
5324
+ title: tooltipConfig == null ? void 0 : tooltipConfig.title
5325
+ }, !(tooltipConfig == null ? void 0 : tooltipConfig.title) && {
5326
+ visible: false
5327
+ }), /* @__PURE__ */React__namespace.default.createElement(Icon, {
5249
5328
  className: "selected-icon",
5250
5329
  src: iconsReact.XmarkRemoveSmall16RegularInheritIcon,
5251
5330
  iconHeight: 16,
5252
5331
  iconWidth: 16
5253
- }),
5332
+ })),
5254
5333
  color: color === "gray" ? void 0 : color
5255
5334
  }), icon && /* @__PURE__ */React__namespace.default.createElement("span", {
5256
5335
  className: cs__default.default("ui-kit-tag-icon", IconStyle)
5257
5336
  }, icon), children);
5258
- };
5337
+ });
5259
5338
 
5260
5339
  const Inline = "i1e4sgug";
5261
5340
  const Truncate = props => {
@@ -5298,23 +5377,6 @@
5298
5377
  }, Text);
5299
5378
  };
5300
5379
 
5301
- const Time = (props) => {
5302
- const {
5303
- className,
5304
- date,
5305
- dateTemplate = "YYYY-MM-DD",
5306
- timeTemplate = "HH:mm",
5307
- plainText
5308
- } = props;
5309
- if (!date)
5310
- return /* @__PURE__ */ React__namespace.default.createElement(React__namespace.default.Fragment, null, "-");
5311
- const time = dayjs__default.default(date);
5312
- if (plainText) {
5313
- return /* @__PURE__ */ React__namespace.default.createElement(React__namespace.default.Fragment, null, dateTemplate !== null && time.format(dateTemplate), " ", timeTemplate !== null && time.format(timeTemplate));
5314
- }
5315
- return /* @__PURE__ */ React__namespace.default.createElement("span", { className: `time-wrapper ${className || ""}` }, dateTemplate !== null && /* @__PURE__ */ React__namespace.default.createElement("span", { className: "date" }, " ", time.format(dateTemplate)), timeTemplate !== null && /* @__PURE__ */ React__namespace.default.createElement("span", { className: "time" }, " ", time.format(timeTemplate)));
5316
- };
5317
-
5318
5380
  function getAntdKit() {
5319
5381
  const kit = {
5320
5382
  loading: Loading,