@cloudtower/eagle 0.32.26 → 0.32.28-dialog.0
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/core/Dialogs/DeleteDialog/DeleteDialog.js +47 -0
- package/dist/cjs/core/Dialogs/RejectDialog/RejectDialog.js +80 -0
- package/dist/cjs/core/Dialogs/RejectDialog/RejectDialog.type.js +10 -0
- package/dist/cjs/core/Dialogs/SmallDialog.js +89 -0
- package/dist/cjs/coreX/DateRangePicker/common.js +7 -5
- package/dist/cjs/coreX/DateRangePicker/index.js +10 -5
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +4278 -4167
- package/dist/esm/core/Dialogs/DeleteDialog/DeleteDialog.js +41 -0
- package/dist/esm/core/Dialogs/RejectDialog/RejectDialog.js +74 -0
- package/dist/esm/core/Dialogs/RejectDialog/RejectDialog.type.js +8 -0
- package/dist/esm/core/Dialogs/SmallDialog.js +83 -0
- package/dist/esm/coreX/DateRangePicker/common.js +7 -5
- package/dist/esm/coreX/DateRangePicker/index.js +10 -5
- package/dist/esm/index.js +3 -0
- package/dist/esm/stats1.html +1 -1
- package/dist/src/core/Dialogs/DeleteDialog/DeleteDialog.d.ts +3 -0
- package/dist/src/core/Dialogs/DeleteDialog/DeleteDialog.type.d.ts +19 -0
- package/dist/src/core/Dialogs/DeleteDialog/index.d.ts +2 -0
- package/dist/src/core/Dialogs/RejectDialog/RejectDialog.d.ts +3 -0
- package/dist/src/core/Dialogs/RejectDialog/RejectDialog.type.d.ts +49 -0
- package/dist/src/core/Dialogs/RejectDialog/index.d.ts +2 -0
- package/dist/src/core/Dialogs/SmallDialog.d.ts +29 -0
- package/dist/src/core/Dialogs/index.d.ts +2 -0
- package/dist/src/core/MenuItem/index.d.ts +4 -0
- package/dist/src/core/MenuItem/type.d.ts +24 -0
- package/dist/src/core/index.d.ts +1 -0
- package/dist/src/coreX/DateRangePicker/dateRangePicker.type.d.ts +6 -1
- package/dist/src/styles/colors.d.ts +40 -0
- package/dist/stories/MenuItem.stories.d.ts +12 -0
- package/dist/stories/docs/core/Dialogs/DeleteDialog.stories.d.ts +41 -0
- package/dist/stories/docs/core/Dialogs/RejectDialog.stories.d.ts +15 -0
- package/dist/stories/docs/coreX/DateRangePicker.stories.d.ts +1 -0
- package/dist/style.css +3654 -3553
- package/package.json +6 -5
- package/README.md +0 -70
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@linaria/core');
|
|
4
|
+
var useParrotTranslation = require('../../../hooks/useParrotTranslation.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../../Typo/index.js');
|
|
7
|
+
var SmallDialog = require('../SmallDialog.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
|
+
|
|
13
|
+
const ContentStyle = "E_cqcxfx3";
|
|
14
|
+
const HelperTextStyle = "E_ho721bb";
|
|
15
|
+
const DeleteDialog = props => {
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useParrotTranslation();
|
|
19
|
+
const {
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
helperText,
|
|
23
|
+
cancelText = t("common.cancel"),
|
|
24
|
+
okText = t("common.delete"),
|
|
25
|
+
onOk,
|
|
26
|
+
onCancel,
|
|
27
|
+
className
|
|
28
|
+
} = props;
|
|
29
|
+
return /* @__PURE__ */React__default.default.createElement(SmallDialog, {
|
|
30
|
+
title,
|
|
31
|
+
showOk: true,
|
|
32
|
+
onOk,
|
|
33
|
+
onCancel,
|
|
34
|
+
className,
|
|
35
|
+
okText,
|
|
36
|
+
cancelText,
|
|
37
|
+
okButtonProps: {
|
|
38
|
+
danger: true
|
|
39
|
+
}
|
|
40
|
+
}, description && /* @__PURE__ */React__default.default.createElement("div", {
|
|
41
|
+
className: core.cx(ContentStyle, index.Typo.Label.l2_regular)
|
|
42
|
+
}, description), helperText && /* @__PURE__ */React__default.default.createElement("div", {
|
|
43
|
+
className: core.cx(HelperTextStyle, index.Typo.Label.l3_regular)
|
|
44
|
+
}, helperText));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.DeleteDialog = DeleteDialog;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@linaria/core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var index = require('../../Typo/index.js');
|
|
6
|
+
var SmallDialog = require('../SmallDialog.js');
|
|
7
|
+
var RejectDialog_type = require('./RejectDialog.type.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
12
|
+
|
|
13
|
+
const ContentList = "E_csj3xle";
|
|
14
|
+
const MultiRejectContentList = "E_m3w5cc3";
|
|
15
|
+
const Description = "E_d2ff2gp";
|
|
16
|
+
const HelperText = "E_hs4o4ol";
|
|
17
|
+
const Divider = "E_d1w8c9z9";
|
|
18
|
+
const SingleRejectContent = ({
|
|
19
|
+
content
|
|
20
|
+
}) => {
|
|
21
|
+
if (Array.isArray(content) && content.length > 1) {
|
|
22
|
+
return /* @__PURE__ */React__default.default.createElement("div", {
|
|
23
|
+
className: core.cx(ContentList)
|
|
24
|
+
}, content.map((reason, index$1) => /* @__PURE__ */React__default.default.createElement("li", {
|
|
25
|
+
className: index.Typo.Label.l4_regular,
|
|
26
|
+
key: index$1
|
|
27
|
+
}, index$1 + 1, ". ", reason)));
|
|
28
|
+
}
|
|
29
|
+
return /* @__PURE__ */React__default.default.createElement("div", {
|
|
30
|
+
className: core.cx(ContentList, index.Typo.Label.l4_regular)
|
|
31
|
+
}, content);
|
|
32
|
+
};
|
|
33
|
+
const MultiRejectContent = ({
|
|
34
|
+
content
|
|
35
|
+
}) => /* @__PURE__ */React__default.default.createElement("div", {
|
|
36
|
+
className: core.cx(MultiRejectContentList)
|
|
37
|
+
}, Object.entries(content).map(([name, reasons], index$1) => /* @__PURE__ */React__default.default.createElement("li", {
|
|
38
|
+
className: index.Typo.Label.l4_regular,
|
|
39
|
+
key: index$1
|
|
40
|
+
}, name, ": ", reasons.join("; "))));
|
|
41
|
+
const RejectDialog = props => {
|
|
42
|
+
const {
|
|
43
|
+
title,
|
|
44
|
+
cancelText,
|
|
45
|
+
description,
|
|
46
|
+
className
|
|
47
|
+
} = props;
|
|
48
|
+
const renderContent = () => {
|
|
49
|
+
switch (props.type) {
|
|
50
|
+
case RejectDialog_type.RejectDialogType.Single:
|
|
51
|
+
return /* @__PURE__ */React__default.default.createElement(SingleRejectContent, {
|
|
52
|
+
content: props.content
|
|
53
|
+
});
|
|
54
|
+
case RejectDialog_type.RejectDialogType.All:
|
|
55
|
+
case RejectDialog_type.RejectDialogType.Part:
|
|
56
|
+
return /* @__PURE__ */React__default.default.createElement(React__default.default.Fragment, null, props.helperText && /* @__PURE__ */React__default.default.createElement("div", {
|
|
57
|
+
className: core.cx(HelperText, index.Typo.Label.l4_regular)
|
|
58
|
+
}, props.helperText), props.type === RejectDialog_type.RejectDialogType.Part && /* @__PURE__ */React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */React__default.default.createElement("div", {
|
|
59
|
+
className: Divider
|
|
60
|
+
}), /* @__PURE__ */React__default.default.createElement("div", {
|
|
61
|
+
className: core.cx(Description, index.Typo.Label.l3_regular)
|
|
62
|
+
}, props.partialDescription)), /* @__PURE__ */React__default.default.createElement(MultiRejectContent, {
|
|
63
|
+
content: props.content
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */React__default.default.createElement(SmallDialog, {
|
|
68
|
+
title,
|
|
69
|
+
cancelText,
|
|
70
|
+
showOk: props.type === RejectDialog_type.RejectDialogType.Part,
|
|
71
|
+
okText: props.type === RejectDialog_type.RejectDialogType.Part ? props.okText : void 0,
|
|
72
|
+
onOk: props.type === RejectDialog_type.RejectDialogType.Part ? props.onOk : void 0,
|
|
73
|
+
onCancel: props.onCancel,
|
|
74
|
+
className
|
|
75
|
+
}, description && /* @__PURE__ */React__default.default.createElement("div", {
|
|
76
|
+
className: core.cx(Description, index.Typo.Label.l3_regular)
|
|
77
|
+
}, description), renderContent());
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.RejectDialog = RejectDialog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var RejectDialogType = /* @__PURE__ */ ((RejectDialogType2) => {
|
|
4
|
+
RejectDialogType2["Single"] = "RejectSingle";
|
|
5
|
+
RejectDialogType2["All"] = "RejectAll";
|
|
6
|
+
RejectDialogType2["Part"] = "RejectPart";
|
|
7
|
+
return RejectDialogType2;
|
|
8
|
+
})(RejectDialogType || {});
|
|
9
|
+
|
|
10
|
+
exports.RejectDialogType = RejectDialogType;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var icons = require('@ant-design/icons');
|
|
4
|
+
var core = require('@linaria/core');
|
|
5
|
+
var index = require('../KitStoreProvider/index.js');
|
|
6
|
+
var antd = require('antd');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var index$2 = require('../Button/index.js');
|
|
9
|
+
var index$1 = require('../Typo/index.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
|
+
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
17
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
19
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value
|
|
24
|
+
}) : obj[key] = value;
|
|
25
|
+
var __spreadValues = (a, b) => {
|
|
26
|
+
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
27
|
+
if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) {
|
|
28
|
+
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
29
|
+
}
|
|
30
|
+
return a;
|
|
31
|
+
};
|
|
32
|
+
const DialogStyle = "E_d16owvsh";
|
|
33
|
+
const SmallDialog = ({
|
|
34
|
+
title,
|
|
35
|
+
cancelText = "\u5173\u95ED",
|
|
36
|
+
okText = "\u786E\u5B9A",
|
|
37
|
+
showOk = true,
|
|
38
|
+
onOk,
|
|
39
|
+
onCancel,
|
|
40
|
+
maskClosable = true,
|
|
41
|
+
closable = true,
|
|
42
|
+
className,
|
|
43
|
+
okButtonProps,
|
|
44
|
+
cancelButtonProps,
|
|
45
|
+
children
|
|
46
|
+
}) => {
|
|
47
|
+
const popModal = index.usePopModal();
|
|
48
|
+
const handleClose = () => {
|
|
49
|
+
if (onCancel) {
|
|
50
|
+
onCancel(popModal);
|
|
51
|
+
} else {
|
|
52
|
+
popModal();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const handleOk = () => {
|
|
56
|
+
if (onOk) {
|
|
57
|
+
onOk(popModal);
|
|
58
|
+
} else {
|
|
59
|
+
popModal();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */React__default.default.createElement(antd.Modal, {
|
|
63
|
+
visible: true,
|
|
64
|
+
title: /* @__PURE__ */React__default.default.createElement("span", {
|
|
65
|
+
className: index$1.Typo.Display.d2_bold_title
|
|
66
|
+
}, title),
|
|
67
|
+
footer: /* @__PURE__ */React__default.default.createElement("div", {
|
|
68
|
+
style: {
|
|
69
|
+
display: "flex",
|
|
70
|
+
justifyContent: "flex-end",
|
|
71
|
+
gap: 8
|
|
72
|
+
}
|
|
73
|
+
}, /* @__PURE__ */React__default.default.createElement(index$2, __spreadValues({
|
|
74
|
+
type: "ghost",
|
|
75
|
+
onClick: handleClose
|
|
76
|
+
}, cancelButtonProps), cancelText), showOk && /* @__PURE__ */React__default.default.createElement(index$2, __spreadValues({
|
|
77
|
+
type: "primary",
|
|
78
|
+
onClick: handleOk
|
|
79
|
+
}, okButtonProps), okText)),
|
|
80
|
+
onCancel: handleClose,
|
|
81
|
+
closable,
|
|
82
|
+
maskClosable,
|
|
83
|
+
className: core.cx(DialogStyle, className),
|
|
84
|
+
closeIcon: /* @__PURE__ */React__default.default.createElement(icons.CloseCircleFilled, null)
|
|
85
|
+
}, children);
|
|
86
|
+
};
|
|
87
|
+
var SmallDialog$1 = SmallDialog;
|
|
88
|
+
|
|
89
|
+
module.exports = SmallDialog$1;
|
|
@@ -145,12 +145,14 @@ function time2string(time) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
function getDateText(date, t) {
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
const count = date.value;
|
|
149
|
+
const dateString = {
|
|
150
|
+
d: t("common.day_count", { count }),
|
|
151
|
+
h: t("common.hour_count", { count }),
|
|
152
|
+
m: t("common.minute_count", { count }),
|
|
153
|
+
M: t("common.month_count", { count })
|
|
152
154
|
}[date.unit];
|
|
153
|
-
return `${t("components.past")} ${
|
|
155
|
+
return `${t("components.past")} ${dateString}`;
|
|
154
156
|
}
|
|
155
157
|
function checkDateNotInRange(date, minDate, maxDate) {
|
|
156
158
|
if (!minDate && !maxDate) {
|
|
@@ -54,7 +54,8 @@ const TimeRange = (props) => {
|
|
|
54
54
|
onTypeChange,
|
|
55
55
|
onRelativeTimeChange,
|
|
56
56
|
onAbsoluteTimeOk,
|
|
57
|
-
onAbsoluteTimeChange
|
|
57
|
+
onAbsoluteTimeChange,
|
|
58
|
+
relativeTimeSelectOptions
|
|
58
59
|
} = props;
|
|
59
60
|
const { t } = useParrotTranslation();
|
|
60
61
|
const absoluteDateRef = React.useRef(null);
|
|
@@ -69,7 +70,8 @@ const TimeRange = (props) => {
|
|
|
69
70
|
RelativeTime,
|
|
70
71
|
{
|
|
71
72
|
value: relativeTime,
|
|
72
|
-
onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time)
|
|
73
|
+
onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
|
|
74
|
+
config: relativeTimeSelectOptions
|
|
73
75
|
}
|
|
74
76
|
));
|
|
75
77
|
} else if (mode === "absolute") {
|
|
@@ -93,7 +95,8 @@ const TimeRange = (props) => {
|
|
|
93
95
|
RelativeTime,
|
|
94
96
|
{
|
|
95
97
|
value: relativeTime,
|
|
96
|
-
onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time)
|
|
98
|
+
onChange: (time) => onRelativeTimeChange == null ? void 0 : onRelativeTimeChange(time),
|
|
99
|
+
config: relativeTimeSelectOptions
|
|
97
100
|
}
|
|
98
101
|
))
|
|
99
102
|
},
|
|
@@ -150,7 +153,8 @@ const DateRangePicker = (props) => {
|
|
|
150
153
|
mode = ["relative", "absolute"],
|
|
151
154
|
minDate,
|
|
152
155
|
maxDate,
|
|
153
|
-
onChange
|
|
156
|
+
onChange,
|
|
157
|
+
relativeTimeSelectOptions
|
|
154
158
|
} = props;
|
|
155
159
|
const { t } = useParrotTranslation();
|
|
156
160
|
const [datePickerVisible, setDatePickerVisible] = React.useState(false);
|
|
@@ -290,7 +294,8 @@ const DateRangePicker = (props) => {
|
|
|
290
294
|
onAbsoluteTimeChange: setRange,
|
|
291
295
|
onAbsoluteTimeOk: (range2) => {
|
|
292
296
|
handleChange("absolute", range2);
|
|
293
|
-
}
|
|
297
|
+
},
|
|
298
|
+
relativeTimeSelectOptions
|
|
294
299
|
}
|
|
295
300
|
),
|
|
296
301
|
placement: "bottomLeft",
|
package/dist/cjs/index.js
CHANGED
|
@@ -84,6 +84,9 @@ var cascader_style = require('./core/Cascader/cascader.style.js');
|
|
|
84
84
|
var cascader_widget = require('./core/Cascader/cascader.widget.js');
|
|
85
85
|
var index$18 = require('./core/Cascader/index.js');
|
|
86
86
|
var index$19 = require('./core/ConfigProvider/index.js');
|
|
87
|
+
var DeleteDialog = require('./core/Dialogs/DeleteDialog/DeleteDialog.js');
|
|
88
|
+
var RejectDialog = require('./core/Dialogs/RejectDialog/RejectDialog.js');
|
|
89
|
+
var RejectDialog_type = require('./core/Dialogs/RejectDialog/RejectDialog.type.js');
|
|
87
90
|
var ExpandableContainer = require('./core/ExpandableList/ExpandableContainer.js');
|
|
88
91
|
var ExpandableItem = require('./core/ExpandableList/ExpandableItem.js');
|
|
89
92
|
var ExpandIcon = require('./core/ExpandableList/ExpandIcon.js');
|
|
@@ -413,6 +416,9 @@ exports.PresetCascaderRender = cascader_widget.PresetCascaderRender;
|
|
|
413
416
|
exports.defaultTagRender = cascader_widget.defaultTagRender;
|
|
414
417
|
exports.Cascader = index$18.Cascader;
|
|
415
418
|
exports.ConfigProvider = index$19.ConfigProvider;
|
|
419
|
+
exports.DeleteDialog = DeleteDialog.DeleteDialog;
|
|
420
|
+
exports.RejectDialog = RejectDialog.RejectDialog;
|
|
421
|
+
exports.RejectDialogType = RejectDialog_type.RejectDialogType;
|
|
416
422
|
exports.ExpandableContainer = ExpandableContainer;
|
|
417
423
|
exports.ExpandableItem = ExpandableItem;
|
|
418
424
|
exports.ExpandIcon = ExpandIcon;
|