@agentscope-ai/design 1.0.4 → 1.0.6
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/README.md +5 -6
- package/dist/antd/styles/breadcrumb.style.d.ts +18 -0
- package/dist/antd/styles/breadcrumb.style.js +15 -0
- package/dist/antd/styles/index.style.js +3 -2
- package/dist/antd/styles/select.style.d.ts +15 -0
- package/dist/antd/styles/select.style.js +7 -2
- package/dist/antd/themes/bailianDarkTheme.json +35 -28
- package/dist/antd/themes/bailianTheme.json +35 -28
- package/dist/antd/themes/carbonDarkTheme.json +35 -28
- package/dist/antd/themes/carbonTheme.json +35 -28
- package/dist/components/commonComponents/AlertDialog/index.js +58 -55
- package/dist/components/commonComponents/AlertDialog/index.style.d.ts +17 -0
- package/dist/components/commonComponents/AlertDialog/index.style.js +30 -0
- package/dist/components/commonComponents/Breadcrumb/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Breadcrumb/demo/demo1.js +23 -0
- package/dist/components/commonComponents/Button/index.d.ts +3 -0
- package/dist/components/commonComponents/Button/index.js +36 -23
- package/dist/components/commonComponents/ConfigProvider/index.d.ts +2 -4
- package/dist/components/commonComponents/ConfigProvider/index.js +17 -34
- package/dist/components/commonComponents/Drawer/index.js +8 -2
- package/dist/components/commonComponents/Drawer/index.style.d.ts +9 -0
- package/dist/components/commonComponents/Drawer/index.style.js +4 -2
- package/dist/components/commonComponents/Dropdown/index.js +2 -5
- package/dist/components/commonComponents/Empty/index.js +12 -6
- package/dist/components/commonComponents/Empty/index.style.d.ts +4 -19
- package/dist/components/commonComponents/Empty/index.style.js +3 -4
- package/dist/components/commonComponents/FloatButton/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/FloatButton/demo/demo1.js +11 -0
- package/dist/components/commonComponents/FloatButton/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/FloatButton/demo/demo2.js +11 -0
- package/dist/components/commonComponents/Form/index.js +2 -2
- package/dist/components/commonComponents/Form/index.style.d.ts +4 -2
- package/dist/components/commonComponents/Form/index.style.js +3 -3
- package/dist/components/commonComponents/HelpIcon/demo/index.js +1 -0
- package/dist/components/commonComponents/HelpIcon/index.js +6 -1
- package/dist/components/commonComponents/HelpIcon/index.style.d.ts +4 -0
- package/dist/components/commonComponents/HelpIcon/index.style.js +5 -2
- package/dist/components/commonComponents/IconButton/demo/demo1.js +5 -14
- package/dist/components/commonComponents/IconButton/demo/demo2.js +5 -5
- package/dist/components/commonComponents/IconButton/demo/demo3.js +5 -5
- package/dist/components/commonComponents/IconButton/demo/demo4.js +5 -5
- package/dist/components/commonComponents/IconButton/index.js +4 -0
- package/dist/components/commonComponents/IconButton/index.style.d.ts +16 -0
- package/dist/components/commonComponents/IconButton/index.style.js +25 -0
- package/dist/components/commonComponents/Input/index.js +10 -1
- package/dist/components/commonComponents/Input/index.style.d.ts +7 -0
- package/dist/components/commonComponents/Input/index.style.js +7 -3
- package/dist/components/commonComponents/Message/{demo.js → demo/demo1.js} +1 -1
- package/dist/components/commonComponents/Message/demo/demo2.js +66 -0
- package/dist/components/commonComponents/Message/index.d.ts +11 -2
- package/dist/components/commonComponents/Message/index.js +49 -1
- package/dist/components/commonComponents/Modal/index.js +26 -5
- package/dist/components/commonComponents/Modal/index.style.d.ts +33 -2
- package/dist/components/commonComponents/Modal/index.style.js +24 -10
- package/dist/components/commonComponents/Pagination/demo/demo1.js +3 -1
- package/dist/components/commonComponents/Pagination/demo/demo2.js +2 -1
- package/dist/components/commonComponents/Slider/demo/demo1.js +1 -1
- package/dist/components/commonComponents/Slider/demo/demo2.js +1 -1
- package/dist/components/commonComponents/Slider/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Slider/demo/demo3.js +44 -0
- package/dist/components/commonComponents/Slider/index.d.ts +11 -0
- package/dist/components/commonComponents/Slider/index.js +27 -0
- package/dist/components/commonComponents/Slider/index.style.d.ts +7 -0
- package/dist/components/commonComponents/Slider/index.style.js +22 -0
- package/dist/components/commonComponents/Slider/slider.input.d.ts +18 -0
- package/dist/components/commonComponents/Slider/slider.input.js +73 -0
- package/dist/components/commonComponents/Tag/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Tag/{demo.js → demo1.js} +3 -0
- package/dist/components/commonComponents/Tag/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Tag/demo2.js +40 -0
- package/dist/components/commonComponents/Tag/index.style.d.ts +11 -0
- package/dist/components/commonComponents/Tag/index.style.js +5 -1
- package/dist/config.d.ts +0 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -3
- package/dist/libs/env/index.d.ts +1 -5
- package/dist/libs/env/index.js +11 -2
- package/dist/libs/region/index.d.ts +1 -1
- package/package.json +13 -7
- /package/dist/components/commonComponents/Message/{demo.d.ts → demo/demo1.d.ts} +0 -0
- /package/dist/components/commonComponents/{Tag/demo.d.ts → Message/demo/demo2.d.ts} +0 -0
|
@@ -11,9 +11,8 @@ export function getIndexStyleData(params) {
|
|
|
11
11
|
antPrefix = params.antPrefix;
|
|
12
12
|
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-form"), _defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-required-mark"), {
|
|
13
13
|
color: "var(--".concat(antPrefix, "-color-error)"),
|
|
14
|
-
marginLeft: '4px',
|
|
15
14
|
lineHeight: 1,
|
|
16
|
-
marginTop: '
|
|
15
|
+
marginTop: '-4px'
|
|
17
16
|
}), ".".concat(antPrefix, "-form-item .").concat(antPrefix, "-form-item-label"), {
|
|
18
17
|
textAlign: 'left'
|
|
19
18
|
})), ".".concat(antPrefix, "-form-item .").concat(antPrefix, "-form-item-label > label"), {
|
|
@@ -21,7 +20,8 @@ export function getIndexStyleData(params) {
|
|
|
21
20
|
whiteSpace: 'normal',
|
|
22
21
|
fontSize: '13px',
|
|
23
22
|
lineHeight: '20px',
|
|
24
|
-
color: "var(--".concat(antPrefix, "-color-text)")
|
|
23
|
+
color: "var(--".concat(antPrefix, "-color-text)"),
|
|
24
|
+
gap: '4px'
|
|
25
25
|
}), ".".concat(sparkPrefix, "-form-label-margin-small"), _defineProperty({}, ".".concat(antPrefix, "-form-item-label > label"), {
|
|
26
26
|
marginRight: '8px'
|
|
27
27
|
})), ".".concat(antPrefix, "-col"), {
|
|
@@ -7,6 +7,7 @@ export default (function () {
|
|
|
7
7
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
8
8
|
children: ["\u57FA\u7840\u7528\u6CD5\uFF1A", /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsxs(Flex, {
|
|
9
9
|
align: "center",
|
|
10
|
+
gap: 2,
|
|
10
11
|
children: [/*#__PURE__*/_jsx("span", {
|
|
11
12
|
children: "\u529F\u80FD1"
|
|
12
13
|
}), /*#__PURE__*/_jsx(HelpIcon, {
|
|
@@ -4,6 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { getCommonConfig } from "../../../config";
|
|
8
|
+
import classNames from 'classnames';
|
|
7
9
|
import IconButton from "../IconButton";
|
|
8
10
|
import useIconFontStyle from "../IconFont/index.style";
|
|
9
11
|
import Tooltip from "../Tooltip";
|
|
@@ -16,6 +18,8 @@ export default function HelpIcon(props) {
|
|
|
16
18
|
content = props.content,
|
|
17
19
|
className = props.className,
|
|
18
20
|
popoverProps = props.popoverProps;
|
|
21
|
+
var _getCommonConfig = getCommonConfig(),
|
|
22
|
+
sparkPrefix = _getCommonConfig.sparkPrefix;
|
|
19
23
|
return /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
|
|
20
24
|
title: content,
|
|
21
25
|
overlayInnerStyle: {
|
|
@@ -25,8 +29,9 @@ export default function HelpIcon(props) {
|
|
|
25
29
|
style: style
|
|
26
30
|
}, popoverProps), {}, {
|
|
27
31
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
28
|
-
className: className,
|
|
32
|
+
className: classNames("".concat(sparkPrefix, "-help-icon"), className),
|
|
29
33
|
icon: "spark-info-line",
|
|
34
|
+
iconSize: 20,
|
|
30
35
|
shape: "circle",
|
|
31
36
|
bordered: false,
|
|
32
37
|
size: "small"
|
|
@@ -8,8 +8,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
import createStyle from "../../../libs/createStyle";
|
|
9
9
|
export function getIndexStyleData(params) {
|
|
10
10
|
var antPrefix = params.antPrefix,
|
|
11
|
-
blPrefix = params.blPrefix
|
|
12
|
-
|
|
11
|
+
blPrefix = params.blPrefix,
|
|
12
|
+
sparkPrefix = params.sparkPrefix;
|
|
13
|
+
return _defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-help-icon"), {
|
|
14
|
+
color: "var(--".concat(antPrefix, "-color-text-tertiary)")
|
|
15
|
+
}), ".".concat(blPrefix, "-info-icon"), _defineProperty({
|
|
13
16
|
color: "var(--".concat(antPrefix, "-color-icon)"),
|
|
14
17
|
marginLeft: "var(--".concat(antPrefix, "-margin-xxs)"),
|
|
15
18
|
fontSize: '14px'
|
|
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { IconButton, Switch } from "../../../..";
|
|
8
|
-
import {
|
|
8
|
+
import { SparkSearchLine } from '@agentscope-ai/icons';
|
|
9
9
|
import { Flex, Space } from 'antd';
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -29,32 +29,23 @@ var App = function App() {
|
|
|
29
29
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
30
30
|
size: 16,
|
|
31
31
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
32
|
-
iconType: "spark-
|
|
32
|
+
iconType: "spark-setting-line",
|
|
33
33
|
disabled: disabled,
|
|
34
34
|
shape: "circle"
|
|
35
35
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
36
|
-
icon: /*#__PURE__*/_jsx(
|
|
37
|
-
disabled: disabled,
|
|
38
|
-
shape: "circle"
|
|
39
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
|
40
|
-
icon: /*#__PURE__*/_jsx(DashOutlined, {}),
|
|
36
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
41
37
|
disabled: disabled,
|
|
42
38
|
shape: "circle"
|
|
43
39
|
})]
|
|
44
40
|
}), /*#__PURE__*/_jsxs(Space, {
|
|
45
41
|
size: 16,
|
|
46
42
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
47
|
-
|
|
48
|
-
size: "small",
|
|
49
|
-
disabled: disabled,
|
|
50
|
-
shape: "circle"
|
|
51
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
|
52
|
-
iconType: "spark-jumpsuit-line",
|
|
43
|
+
iconType: "spark-setting-line",
|
|
53
44
|
size: "small",
|
|
54
45
|
disabled: disabled,
|
|
55
46
|
shape: "circle"
|
|
56
47
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
57
|
-
icon: /*#__PURE__*/_jsx(
|
|
48
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
58
49
|
size: "small",
|
|
59
50
|
disabled: disabled,
|
|
60
51
|
shape: "circle"
|
|
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { IconButton, Switch } from "../../../..";
|
|
8
|
-
import {
|
|
8
|
+
import { SparkSearchLine } from '@agentscope-ai/icons';
|
|
9
9
|
import { Flex, Space } from 'antd';
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -29,12 +29,12 @@ var App = function App() {
|
|
|
29
29
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
30
30
|
size: 16,
|
|
31
31
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
32
|
-
icon:
|
|
32
|
+
icon: 'spark-setting-line',
|
|
33
33
|
bordered: false,
|
|
34
34
|
disabled: disabled,
|
|
35
35
|
shape: "circle"
|
|
36
36
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
37
|
-
icon: /*#__PURE__*/_jsx(
|
|
37
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
38
38
|
bordered: false,
|
|
39
39
|
disabled: disabled,
|
|
40
40
|
shape: "circle"
|
|
@@ -42,13 +42,13 @@ var App = function App() {
|
|
|
42
42
|
}), /*#__PURE__*/_jsxs(Space, {
|
|
43
43
|
size: 16,
|
|
44
44
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
45
|
-
icon:
|
|
45
|
+
icon: 'spark-setting-line',
|
|
46
46
|
size: "small",
|
|
47
47
|
bordered: false,
|
|
48
48
|
disabled: disabled,
|
|
49
49
|
shape: "circle"
|
|
50
50
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
51
|
-
icon: /*#__PURE__*/_jsx(
|
|
51
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
52
52
|
size: "small",
|
|
53
53
|
bordered: false,
|
|
54
54
|
disabled: disabled,
|
|
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { IconButton, Switch } from "../../../..";
|
|
8
|
-
import {
|
|
8
|
+
import { SparkSearchLine } from '@agentscope-ai/icons';
|
|
9
9
|
import { Flex, Space } from 'antd';
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -29,20 +29,20 @@ var App = function App() {
|
|
|
29
29
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
30
30
|
size: 16,
|
|
31
31
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
32
|
-
icon:
|
|
32
|
+
icon: 'spark-setting-line',
|
|
33
33
|
disabled: disabled
|
|
34
34
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
35
|
-
icon: /*#__PURE__*/_jsx(
|
|
35
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
36
36
|
disabled: disabled
|
|
37
37
|
})]
|
|
38
38
|
}), /*#__PURE__*/_jsxs(Space, {
|
|
39
39
|
size: 16,
|
|
40
40
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
41
|
-
icon:
|
|
41
|
+
icon: 'spark-setting-line',
|
|
42
42
|
size: "small",
|
|
43
43
|
disabled: disabled
|
|
44
44
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
45
|
-
icon: /*#__PURE__*/_jsx(
|
|
45
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
46
46
|
size: "small",
|
|
47
47
|
disabled: disabled
|
|
48
48
|
})]
|
|
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { IconButton, Switch } from "../../../..";
|
|
8
|
-
import {
|
|
8
|
+
import { SparkSearchLine } from '@agentscope-ai/icons';
|
|
9
9
|
import { Flex, Space } from 'antd';
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -29,22 +29,22 @@ var App = function App() {
|
|
|
29
29
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
30
30
|
size: 16,
|
|
31
31
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
32
|
-
icon:
|
|
32
|
+
icon: 'spark-setting-line',
|
|
33
33
|
bordered: false,
|
|
34
34
|
disabled: disabled
|
|
35
35
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
36
|
-
icon: /*#__PURE__*/_jsx(
|
|
36
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
37
37
|
bordered: false,
|
|
38
38
|
disabled: disabled
|
|
39
39
|
})]
|
|
40
40
|
}), /*#__PURE__*/_jsxs(Space, {
|
|
41
41
|
size: 16,
|
|
42
42
|
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
43
|
-
icon:
|
|
43
|
+
icon: 'spark-setting-line',
|
|
44
44
|
bordered: false,
|
|
45
45
|
disabled: disabled
|
|
46
46
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
47
|
-
icon: /*#__PURE__*/_jsx(
|
|
47
|
+
icon: /*#__PURE__*/_jsx(SparkSearchLine, {}),
|
|
48
48
|
bordered: false,
|
|
49
49
|
disabled: disabled
|
|
50
50
|
})]
|
|
@@ -9,7 +9,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
import IconFont from "../IconFont";
|
|
11
11
|
import { Button, getCommonConfig } from "../../..";
|
|
12
|
+
import classNames from 'classnames';
|
|
12
13
|
import { useMemo } from 'react';
|
|
14
|
+
import useIndexStyle from "./index.style";
|
|
13
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
16
|
export default (function (props) {
|
|
15
17
|
var _props$bordered = props.bordered,
|
|
@@ -17,6 +19,7 @@ export default (function (props) {
|
|
|
17
19
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
18
20
|
var config = getCommonConfig();
|
|
19
21
|
var iconfont = config.iconfont;
|
|
22
|
+
useIndexStyle();
|
|
20
23
|
var icon = useMemo(function () {
|
|
21
24
|
if (props.iconType) {
|
|
22
25
|
return /*#__PURE__*/_jsx(IconFont, {
|
|
@@ -33,6 +36,7 @@ export default (function (props) {
|
|
|
33
36
|
}
|
|
34
37
|
}, [props.icon, props.iconType, iconfont]);
|
|
35
38
|
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
39
|
+
className: classNames(props.className, "".concat(config.sparkPrefix, "-icon-button")),
|
|
36
40
|
style: {
|
|
37
41
|
lineHeight: 1
|
|
38
42
|
},
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function getIndexStyleData(params: any): {
|
|
2
|
+
[x: string]: {
|
|
3
|
+
[x: string]: number | {
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
borderColor: string;
|
|
6
|
+
fontSize?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
fontSize: number;
|
|
9
|
+
backgroundColor?: undefined;
|
|
10
|
+
borderColor?: undefined;
|
|
11
|
+
};
|
|
12
|
+
fontSize: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
declare const useIndexStyle: (props?: {}) => import("../../../config").CommonConfig;
|
|
16
|
+
export default useIndexStyle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var _excluded = ["css"];
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
import createStyle from "../../../libs/createStyle";
|
|
9
|
+
export function getIndexStyleData(params) {
|
|
10
|
+
var sparkPrefix = params.sparkPrefix,
|
|
11
|
+
antPrefix = params.antPrefix;
|
|
12
|
+
return _defineProperty({}, ".".concat(sparkPrefix, "-icon-button.").concat(antPrefix, "-btn"), _defineProperty(_defineProperty(_defineProperty({}, "&:not(:disabled):not(.".concat(antPrefix, "-btn-disabled):hover"), {
|
|
13
|
+
backgroundColor: "var(--".concat(antPrefix, "-color-primary-bg)"),
|
|
14
|
+
borderColor: "transparent"
|
|
15
|
+
}), "fontSize", 20), "&.".concat(antPrefix, "-btn-sm"), {
|
|
16
|
+
fontSize: 16
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
var useIndexStyle = createStyle(function (_ref2) {
|
|
20
|
+
var css = _ref2.css,
|
|
21
|
+
params = _objectWithoutProperties(_ref2, _excluded);
|
|
22
|
+
var result = css(getIndexStyleData(params));
|
|
23
|
+
return result;
|
|
24
|
+
});
|
|
25
|
+
export default useIndexStyle;
|
|
@@ -25,8 +25,17 @@ var SparkInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
25
|
ref: ref
|
|
26
26
|
}));
|
|
27
27
|
});
|
|
28
|
+
var SparkTextArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
29
|
+
var _getCommonConfig2 = getCommonConfig(),
|
|
30
|
+
antPrefix = _getCommonConfig2.antPrefix;
|
|
31
|
+
useIndexStyle();
|
|
32
|
+
return /*#__PURE__*/_jsx(Input.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
33
|
+
className: classNames("".concat(antPrefix, "-text-area"), props.className),
|
|
34
|
+
ref: ref
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
28
37
|
Object.assign(SparkInput, {
|
|
29
|
-
TextArea:
|
|
38
|
+
TextArea: SparkTextArea,
|
|
30
39
|
Search: Input.Search,
|
|
31
40
|
Password: Input.Password,
|
|
32
41
|
OTP: Input.OTP
|
|
@@ -3,6 +3,7 @@ export declare function getIndexStyleData(params: any): {
|
|
|
3
3
|
borderColor: string;
|
|
4
4
|
fontWeight?: undefined;
|
|
5
5
|
borderRadius?: undefined;
|
|
6
|
+
'&::placeholder'?: undefined;
|
|
6
7
|
fontSize?: undefined;
|
|
7
8
|
} | {
|
|
8
9
|
[x: string]: string | number | {
|
|
@@ -10,6 +11,9 @@ export declare function getIndexStyleData(params: any): {
|
|
|
10
11
|
};
|
|
11
12
|
fontWeight: number;
|
|
12
13
|
borderRadius: string;
|
|
14
|
+
'&::placeholder': {
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
13
17
|
borderColor?: undefined;
|
|
14
18
|
fontSize?: undefined;
|
|
15
19
|
} | {
|
|
@@ -19,16 +23,19 @@ export declare function getIndexStyleData(params: any): {
|
|
|
19
23
|
borderColor?: undefined;
|
|
20
24
|
fontWeight?: undefined;
|
|
21
25
|
borderRadius?: undefined;
|
|
26
|
+
'&::placeholder'?: undefined;
|
|
22
27
|
fontSize?: undefined;
|
|
23
28
|
} | {
|
|
24
29
|
fontSize: string;
|
|
25
30
|
borderColor?: undefined;
|
|
26
31
|
fontWeight?: undefined;
|
|
27
32
|
borderRadius?: undefined;
|
|
33
|
+
'&::placeholder'?: undefined;
|
|
28
34
|
} | {
|
|
29
35
|
borderRadius: string;
|
|
30
36
|
borderColor?: undefined;
|
|
31
37
|
fontWeight?: undefined;
|
|
38
|
+
'&::placeholder'?: undefined;
|
|
32
39
|
fontSize?: undefined;
|
|
33
40
|
};
|
|
34
41
|
};
|
|
@@ -8,12 +8,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
import createStyle from "../../../libs/createStyle";
|
|
9
9
|
export function getIndexStyleData(params) {
|
|
10
10
|
var antPrefix = params.antPrefix;
|
|
11
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(antPrefix, "-input-outlined"), {
|
|
11
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(antPrefix, "-input-outlined, .").concat(antPrefix, "-input-outlined.").concat(antPrefix, "-input-disabled, .").concat(antPrefix, "-input-outlined[disabled]"), {
|
|
12
12
|
borderColor: "var(--".concat(antPrefix, "-color-border-secondary)")
|
|
13
|
-
}), ".".concat(antPrefix, "-input"), _defineProperty({
|
|
13
|
+
}), ".".concat(antPrefix, "-input"), _defineProperty(_defineProperty({
|
|
14
14
|
fontWeight: 400,
|
|
15
15
|
borderRadius: '6px'
|
|
16
|
-
}, ".".concat(antPrefix, "-input-
|
|
16
|
+
}, ".".concat(antPrefix, "-input-show-count-suffix, .").concat(antPrefix, "-input-data-count-suffix"), {
|
|
17
|
+
color: "var(--".concat(antPrefix, "-color-text-tertiary)")
|
|
18
|
+
}), '&::placeholder', {
|
|
17
19
|
color: "var(--".concat(antPrefix, "-color-text-tertiary)")
|
|
18
20
|
})), ".".concat(antPrefix, "-input-affix-wrapper"), _defineProperty({}, ".".concat(antPrefix, "-input-prefix"), {
|
|
19
21
|
marginInlineEnd: '8px'
|
|
@@ -21,6 +23,8 @@ export function getIndexStyleData(params) {
|
|
|
21
23
|
fontSize: '15px'
|
|
22
24
|
}), ".".concat(antPrefix, "-input-round"), {
|
|
23
25
|
borderRadius: '999px'
|
|
26
|
+
}), ".".concat(antPrefix, "-text-area"), {
|
|
27
|
+
borderColor: "var(--".concat(antPrefix, "-color-border-secondary)")
|
|
24
28
|
});
|
|
25
29
|
}
|
|
26
30
|
var useIndexStyle = createStyle(function (_ref2) {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { message } from "../../../..";
|
|
8
|
+
import { Button, Flex } from 'antd';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
+
export default (function () {
|
|
13
|
+
var _message$useMessage = message.useMessage(),
|
|
14
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
15
|
+
messageApi = _message$useMessage2[0],
|
|
16
|
+
contextHolder = _message$useMessage2[1];
|
|
17
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
18
|
+
children: [contextHolder, /*#__PURE__*/_jsxs(Flex, {
|
|
19
|
+
align: "center",
|
|
20
|
+
justify: "center",
|
|
21
|
+
gap: 20,
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
23
|
+
type: "primary",
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
messageApi.success({
|
|
26
|
+
content: 'success',
|
|
27
|
+
viewLink: 'https://www.taobao.com',
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
alert('click');
|
|
30
|
+
},
|
|
31
|
+
duration: 0
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
children: "Success"
|
|
35
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
36
|
+
danger: true,
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
messageApi.warning('warning');
|
|
39
|
+
},
|
|
40
|
+
children: "warning"
|
|
41
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
42
|
+
type: "primary",
|
|
43
|
+
danger: true,
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
messageApi.error({
|
|
46
|
+
content: 'error'
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
children: "error"
|
|
50
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
messageApi.info({
|
|
53
|
+
content: 'info',
|
|
54
|
+
viewLink: 'https://www.taobao.com'
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
children: "info"
|
|
58
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
59
|
+
onClick: function onClick() {
|
|
60
|
+
messageApi.loading('loading');
|
|
61
|
+
},
|
|
62
|
+
children: "loading"
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MessageArgsProps } from 'antd';
|
|
3
|
+
import { ConfigOptions } from 'antd/es/message/interface';
|
|
3
4
|
interface SparkMessageArgsProps extends MessageArgsProps {
|
|
4
5
|
viewLink?: string;
|
|
5
6
|
conent?: string;
|
|
@@ -11,10 +12,18 @@ declare const _default: {
|
|
|
11
12
|
error: (props: JointContent) => void;
|
|
12
13
|
info: (props: JointContent) => void;
|
|
13
14
|
loading: (props: JointContent) => void;
|
|
15
|
+
useMessage: (config?: ConfigOptions) => [{
|
|
16
|
+
success: (options: JointContent) => void;
|
|
17
|
+
warning: (options: JointContent) => void;
|
|
18
|
+
error: (options: JointContent) => void;
|
|
19
|
+
info: (options: JointContent) => void;
|
|
20
|
+
loading: (options: JointContent) => void;
|
|
21
|
+
open(args: MessageArgsProps): import("antd/es/message/interface").MessageType;
|
|
22
|
+
destroy(key?: import("react").Key): void;
|
|
23
|
+
}, import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>];
|
|
14
24
|
open: (config: MessageArgsProps) => import("antd/es/message/interface").MessageType;
|
|
15
25
|
destroy: (key?: import("react").Key) => void;
|
|
16
|
-
config: (config:
|
|
17
|
-
useMessage: typeof import("antd/es/message/useMessage").default;
|
|
26
|
+
config: (config: ConfigOptions) => void;
|
|
18
27
|
_InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/message/PurePanel").PurePanelProps>;
|
|
19
28
|
};
|
|
20
29
|
export default _default;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
var _excluded = ["content"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -47,6 +53,47 @@ var open = function open(type, props) {
|
|
|
47
53
|
icon: type === 'loading' ? undefined : (_types$type = types[type]) === null || _types$type === void 0 ? void 0 : _types$type.icon
|
|
48
54
|
}, restProps));
|
|
49
55
|
};
|
|
56
|
+
var useMessage = function useMessage(config) {
|
|
57
|
+
var _message$useMessage = message.useMessage(config),
|
|
58
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
59
|
+
messageApi = _message$useMessage2[0],
|
|
60
|
+
contextHolder = _message$useMessage2[1];
|
|
61
|
+
var openApi = function openApi(type, options) {
|
|
62
|
+
var _types$type2;
|
|
63
|
+
var newOptions;
|
|
64
|
+
if (typeof options === 'string') {
|
|
65
|
+
newOptions = {
|
|
66
|
+
content: options,
|
|
67
|
+
type: type
|
|
68
|
+
};
|
|
69
|
+
} else {
|
|
70
|
+
newOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
71
|
+
type: type
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
messageApi[type](_objectSpread(_objectSpread({}, newOptions), {}, {
|
|
75
|
+
icon: (_types$type2 = types[type]) === null || _types$type2 === void 0 ? void 0 : _types$type2.icon
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
var newMessageApi = _objectSpread(_objectSpread({}, messageApi), {}, {
|
|
79
|
+
success: function success(options) {
|
|
80
|
+
return openApi('success', options);
|
|
81
|
+
},
|
|
82
|
+
warning: function warning(options) {
|
|
83
|
+
return openApi('warning', options);
|
|
84
|
+
},
|
|
85
|
+
error: function error(options) {
|
|
86
|
+
return openApi('error', options);
|
|
87
|
+
},
|
|
88
|
+
info: function info(options) {
|
|
89
|
+
return openApi('info', options);
|
|
90
|
+
},
|
|
91
|
+
loading: function loading(options) {
|
|
92
|
+
return openApi('loading', options);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return [newMessageApi, contextHolder];
|
|
96
|
+
};
|
|
50
97
|
export default _objectSpread(_objectSpread({}, message), {}, {
|
|
51
98
|
success: function success(props) {
|
|
52
99
|
return open('success', props);
|
|
@@ -62,5 +109,6 @@ export default _objectSpread(_objectSpread({}, message), {}, {
|
|
|
62
109
|
},
|
|
63
110
|
loading: function loading(props) {
|
|
64
111
|
return open('loading', props);
|
|
65
|
-
}
|
|
112
|
+
},
|
|
113
|
+
useMessage: useMessage
|
|
66
114
|
});
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["showDivider", "closable"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
10
|
import { getCommonConfig } from "../../../config";
|
|
11
|
+
import { CloseOutlined } from '@agentscope-ai/icons-override-antd';
|
|
8
12
|
import { Modal } from 'antd';
|
|
9
13
|
import classNames from 'classnames';
|
|
10
14
|
import useIndexStyle from "./index.style";
|
|
@@ -13,10 +17,12 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
17
|
var SparkModal = function SparkModal(props) {
|
|
14
18
|
useIndexStyle();
|
|
15
19
|
var _getCommonConfig = getCommonConfig(),
|
|
16
|
-
sparkPrefix = _getCommonConfig.sparkPrefix
|
|
17
|
-
variables = _getCommonConfig.variables;
|
|
20
|
+
sparkPrefix = _getCommonConfig.sparkPrefix;
|
|
18
21
|
var _props$showDivider = props.showDivider,
|
|
19
|
-
showDivider = _props$showDivider === void 0 ? true : _props$showDivider
|
|
22
|
+
showDivider = _props$showDivider === void 0 ? true : _props$showDivider,
|
|
23
|
+
_props$closable = props.closable,
|
|
24
|
+
closable = _props$closable === void 0 ? true : _props$closable,
|
|
25
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
20
26
|
var renderFooter = function renderFooter(originNode) {
|
|
21
27
|
return props.info ? /*#__PURE__*/_jsxs("div", {
|
|
22
28
|
className: "".concat(sparkPrefix, "-modal-footer-wrapper"),
|
|
@@ -29,10 +35,25 @@ var SparkModal = function SparkModal(props) {
|
|
|
29
35
|
})]
|
|
30
36
|
}) : originNode;
|
|
31
37
|
};
|
|
38
|
+
var mergedCloseIcon = closable ? props.closeIcon || /*#__PURE__*/_jsx(CloseOutlined, {
|
|
39
|
+
className: "".concat(sparkPrefix, "-modal-title-close"),
|
|
40
|
+
onClick: function onClick(e) {
|
|
41
|
+
var _props$onCancel;
|
|
42
|
+
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 || _props$onCancel.call(props, e);
|
|
43
|
+
}
|
|
44
|
+
}) : null;
|
|
32
45
|
var mergedFooter = props.footer === undefined ? renderFooter : props.footer;
|
|
33
|
-
return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({},
|
|
46
|
+
return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
47
|
+
closeIcon: null,
|
|
48
|
+
title: /*#__PURE__*/_jsxs("div", {
|
|
49
|
+
className: "".concat(sparkPrefix, "-modal-title-wrapper"),
|
|
50
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
51
|
+
className: "".concat(sparkPrefix, "-modal-title"),
|
|
52
|
+
children: props.title
|
|
53
|
+
}), mergedCloseIcon]
|
|
54
|
+
}),
|
|
34
55
|
wrapClassName: classNames("".concat(sparkPrefix, "-modal"), _defineProperty({}, "".concat(sparkPrefix, "-show-divider"), showDivider), props.wrapClassName, 'animate-in'),
|
|
35
|
-
wrapStyle: _objectSpread(
|
|
56
|
+
wrapStyle: _objectSpread({}, props.wrapStyle),
|
|
36
57
|
footer: mergedFooter,
|
|
37
58
|
transitionName: ""
|
|
38
59
|
}));
|