@agentscope-ai/design 1.0.4 → 1.0.5
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 +6 -1
- package/dist/antd/themes/bailianTheme.json +6 -1
- package/dist/antd/themes/carbonDarkTheme.json +6 -1
- package/dist/antd/themes/carbonTheme.json +6 -1
- 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/Drawer/index.js +7 -0
- 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/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 +19 -1
- 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/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
|
@@ -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
|
});
|
|
@@ -5,6 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
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
7
|
import { getCommonConfig } from "../../../config";
|
|
8
|
+
import { CloseOutlined } from '@agentscope-ai/icons-override-antd';
|
|
8
9
|
import { Modal } from 'antd';
|
|
9
10
|
import classNames from 'classnames';
|
|
10
11
|
import useIndexStyle from "./index.style";
|
|
@@ -16,7 +17,9 @@ var SparkModal = function SparkModal(props) {
|
|
|
16
17
|
sparkPrefix = _getCommonConfig.sparkPrefix,
|
|
17
18
|
variables = _getCommonConfig.variables;
|
|
18
19
|
var _props$showDivider = props.showDivider,
|
|
19
|
-
showDivider = _props$showDivider === void 0 ? true : _props$showDivider
|
|
20
|
+
showDivider = _props$showDivider === void 0 ? true : _props$showDivider,
|
|
21
|
+
_props$closable = props.closable,
|
|
22
|
+
closable = _props$closable === void 0 ? true : _props$closable;
|
|
20
23
|
var renderFooter = function renderFooter(originNode) {
|
|
21
24
|
return props.info ? /*#__PURE__*/_jsxs("div", {
|
|
22
25
|
className: "".concat(sparkPrefix, "-modal-footer-wrapper"),
|
|
@@ -29,8 +32,23 @@ var SparkModal = function SparkModal(props) {
|
|
|
29
32
|
})]
|
|
30
33
|
}) : originNode;
|
|
31
34
|
};
|
|
35
|
+
var mergedCloseIcon = closable ? props.closeIcon || /*#__PURE__*/_jsx(CloseOutlined, {
|
|
36
|
+
className: "".concat(sparkPrefix, "-modal-title-close"),
|
|
37
|
+
onClick: function onClick(e) {
|
|
38
|
+
var _props$onCancel;
|
|
39
|
+
(_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 || _props$onCancel.call(props, e);
|
|
40
|
+
}
|
|
41
|
+
}) : null;
|
|
32
42
|
var mergedFooter = props.footer === undefined ? renderFooter : props.footer;
|
|
33
43
|
return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({}, props), {}, {
|
|
44
|
+
closeIcon: null,
|
|
45
|
+
title: /*#__PURE__*/_jsxs("div", {
|
|
46
|
+
className: "".concat(sparkPrefix, "-modal-title-wrapper"),
|
|
47
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
48
|
+
className: "".concat(sparkPrefix, "-modal-title"),
|
|
49
|
+
children: props.title
|
|
50
|
+
}), mergedCloseIcon]
|
|
51
|
+
}),
|
|
34
52
|
wrapClassName: classNames("".concat(sparkPrefix, "-modal"), _defineProperty({}, "".concat(sparkPrefix, "-show-divider"), showDivider), props.wrapClassName, 'animate-in'),
|
|
35
53
|
wrapStyle: _objectSpread(_objectSpread({}, variables), props.wrapStyle),
|
|
36
54
|
footer: mergedFooter,
|
|
@@ -7,20 +7,37 @@ export declare function getIndexStyleData(params: any): {
|
|
|
7
7
|
} | {
|
|
8
8
|
[x: string]: string | number | {
|
|
9
9
|
[x: string]: string | number | {
|
|
10
|
+
[x: string]: string | {
|
|
11
|
+
[x: string]: string | {
|
|
12
|
+
flex: number;
|
|
13
|
+
cursor?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
cursor: string;
|
|
16
|
+
flex?: undefined;
|
|
17
|
+
};
|
|
18
|
+
display: string;
|
|
19
|
+
justifyContent: string;
|
|
20
|
+
alignItems: string;
|
|
21
|
+
gap: string;
|
|
22
|
+
};
|
|
10
23
|
lineHeight: string;
|
|
11
24
|
};
|
|
12
25
|
padding: string;
|
|
13
26
|
marginBottom: number;
|
|
14
27
|
color?: undefined;
|
|
15
28
|
marginTop?: undefined;
|
|
29
|
+
width?: undefined;
|
|
30
|
+
height?: undefined;
|
|
16
31
|
top?: undefined;
|
|
17
32
|
right?: undefined;
|
|
18
33
|
'&:hover'?: undefined;
|
|
19
34
|
} | {
|
|
20
|
-
padding:
|
|
35
|
+
padding: number;
|
|
21
36
|
color: string;
|
|
22
37
|
marginBottom?: undefined;
|
|
23
38
|
marginTop?: undefined;
|
|
39
|
+
width?: undefined;
|
|
40
|
+
height?: undefined;
|
|
24
41
|
top?: undefined;
|
|
25
42
|
right?: undefined;
|
|
26
43
|
'&:hover'?: undefined;
|
|
@@ -49,10 +66,21 @@ export declare function getIndexStyleData(params: any): {
|
|
|
49
66
|
marginTop: number;
|
|
50
67
|
marginBottom?: undefined;
|
|
51
68
|
color?: undefined;
|
|
69
|
+
width?: undefined;
|
|
70
|
+
height?: undefined;
|
|
52
71
|
top?: undefined;
|
|
53
72
|
right?: undefined;
|
|
54
73
|
'&:hover'?: undefined;
|
|
55
74
|
} | {
|
|
75
|
+
[x: string]: number | {
|
|
76
|
+
color: string;
|
|
77
|
+
background?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
background: string;
|
|
80
|
+
color?: undefined;
|
|
81
|
+
};
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
56
84
|
top: number;
|
|
57
85
|
right: number;
|
|
58
86
|
"&:hover": {
|
|
@@ -70,8 +98,11 @@ export declare function getIndexStyleData(params: any): {
|
|
|
70
98
|
} | {
|
|
71
99
|
[x: string]: {
|
|
72
100
|
[x: string]: {
|
|
73
|
-
borderTop: string;
|
|
74
101
|
borderBottom: string;
|
|
102
|
+
borderTop?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
borderTop: string;
|
|
105
|
+
borderBottom?: undefined;
|
|
75
106
|
};
|
|
76
107
|
};
|
|
77
108
|
};
|
|
@@ -17,13 +17,22 @@ export function getIndexStyleData(params) {
|
|
|
17
17
|
}, ".".concat(antPrefix, "-modal-header"), _defineProperty({
|
|
18
18
|
padding: '18px 20px',
|
|
19
19
|
marginBottom: 0
|
|
20
|
-
}, ".".concat(antPrefix, "-modal-title"), {
|
|
20
|
+
}, ".".concat(antPrefix, "-modal-title"), _defineProperty({
|
|
21
21
|
lineHeight: '28px'
|
|
22
|
-
}
|
|
23
|
-
|
|
22
|
+
}, ".".concat(sparkPrefix, "-modal-title-wrapper"), _defineProperty(_defineProperty({
|
|
23
|
+
display: 'flex',
|
|
24
|
+
justifyContent: 'space-between',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
gap: '12px'
|
|
27
|
+
}, ".".concat(sparkPrefix, "-modal-title"), {
|
|
28
|
+
flex: 1
|
|
29
|
+
}), ".".concat(sparkPrefix, "-modal-title-close"), {
|
|
30
|
+
cursor: 'pointer'
|
|
31
|
+
})))), ".".concat(antPrefix, "-modal-body"), {
|
|
32
|
+
padding: 20,
|
|
24
33
|
color: "var(--".concat(antPrefix, "-color-text-secondary)")
|
|
25
34
|
}), ".".concat(antPrefix, "-modal-footer"), _defineProperty({
|
|
26
|
-
padding: '16px
|
|
35
|
+
padding: '16px 20px',
|
|
27
36
|
marginTop: 0
|
|
28
37
|
}, ".".concat(sparkPrefix, "-modal-footer-wrapper"), _defineProperty(_defineProperty({
|
|
29
38
|
display: 'flex',
|
|
@@ -37,14 +46,19 @@ export function getIndexStyleData(params) {
|
|
|
37
46
|
}), ".".concat(sparkPrefix, "-modal-footer-origin-node"), {
|
|
38
47
|
display: 'flex',
|
|
39
48
|
gap: '12px'
|
|
40
|
-
}))), ".".concat(antPrefix, "-modal-close"), _defineProperty({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
}))), ".".concat(antPrefix, "-modal-close"), _defineProperty(_defineProperty({
|
|
50
|
+
width: 32,
|
|
51
|
+
height: 32,
|
|
52
|
+
top: 16,
|
|
53
|
+
right: 16
|
|
54
|
+
}, ".".concat(antPrefix, "-modal-close-icon"), {
|
|
55
|
+
color: "var(--".concat(antPrefix, "-color-text)")
|
|
56
|
+
}), "&:hover", {
|
|
44
57
|
background: 'none'
|
|
45
|
-
})))), ".".concat(sparkPrefix, "-show-divider"), _defineProperty({}, ".".concat(antPrefix, "-modal-content"), _defineProperty({}, ".".concat(antPrefix, "-modal-
|
|
46
|
-
borderTop: "1px solid var(--".concat(antPrefix, "-color-border-secondary)"),
|
|
58
|
+
})))), ".".concat(sparkPrefix, "-show-divider"), _defineProperty({}, ".".concat(antPrefix, "-modal-content"), _defineProperty(_defineProperty({}, ".".concat(antPrefix, "-modal-header"), {
|
|
47
59
|
borderBottom: "1px solid var(--".concat(antPrefix, "-color-border-secondary)")
|
|
60
|
+
}), ".".concat(antPrefix, "-modal-footer"), {
|
|
61
|
+
borderTop: "1px solid var(--".concat(antPrefix, "-color-border-secondary)")
|
|
48
62
|
})));
|
|
49
63
|
}
|
|
50
64
|
var useIndexStyle = function useIndexStyle() {
|
|
@@ -18,7 +18,7 @@ var App = function App() {
|
|
|
18
18
|
setDisabled(checked);
|
|
19
19
|
};
|
|
20
20
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
|
-
children: [/*#__PURE__*/_jsx(Slider, {
|
|
21
|
+
children: ["\u666E\u901A\u7528\u6CD5", /*#__PURE__*/_jsx(Slider, {
|
|
22
22
|
defaultValue: 30,
|
|
23
23
|
disabled: disabled
|
|
24
24
|
}), /*#__PURE__*/_jsx(Slider, {
|
|
@@ -18,7 +18,7 @@ var App = function App() {
|
|
|
18
18
|
setDisabled(checked);
|
|
19
19
|
};
|
|
20
20
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
|
-
children: [/*#__PURE__*/_jsx(Slider, {
|
|
21
|
+
children: ["\u5C55\u793Amarks", /*#__PURE__*/_jsx(Slider, {
|
|
22
22
|
defaultValue: 30,
|
|
23
23
|
disabled: disabled,
|
|
24
24
|
marks: {
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { Slider, Switch } from "../../../..";
|
|
8
|
+
import { Flex } from 'antd';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
var App = function App() {
|
|
14
|
+
var _useState = useState(false),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
disabled = _useState2[0],
|
|
17
|
+
setDisabled = _useState2[1];
|
|
18
|
+
var onChange = function onChange(checked) {
|
|
19
|
+
setDisabled(checked);
|
|
20
|
+
};
|
|
21
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
22
|
+
children: ["Slider.Input", /*#__PURE__*/_jsxs(Flex, {
|
|
23
|
+
vertical: true,
|
|
24
|
+
gap: 12,
|
|
25
|
+
children: [/*#__PURE__*/_jsx(Slider.Input, {
|
|
26
|
+
defaultValue: 30,
|
|
27
|
+
disabled: disabled
|
|
28
|
+
}), /*#__PURE__*/_jsx(Slider.Input, {
|
|
29
|
+
defaultValue: 30,
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
styles: {
|
|
32
|
+
inputNumber: {
|
|
33
|
+
width: 300
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})]
|
|
37
|
+
}), "Disabled: ", /*#__PURE__*/_jsx(Switch, {
|
|
38
|
+
size: "small",
|
|
39
|
+
checked: disabled,
|
|
40
|
+
onChange: onChange
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export default App;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SliderRangeProps, SliderSingleProps } from 'antd/es/slider';
|
|
2
|
+
import { SliderRef } from 'rc-slider';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import SliderInput from './slider.input';
|
|
5
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<(SliderSingleProps | SliderRangeProps) & React.RefAttributes<SliderRef>> & {
|
|
6
|
+
Input: typeof SliderInput;
|
|
7
|
+
};
|
|
8
|
+
export declare const SparkSliderBasic: React.ForwardRefExoticComponent<(SliderSingleProps | SliderRangeProps) & React.RefAttributes<SliderRef>>;
|
|
9
|
+
declare const SparkSlider: CompoundedComponent;
|
|
10
|
+
export default SparkSlider;
|
|
11
|
+
export type { SliderInputProps } from './slider.input';
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
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
|
+
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
|
+
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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 "../../..";
|
|
8
|
+
import { Slider } from 'antd';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import useIndexStyle from "./index.style";
|
|
12
|
+
import SliderInput from "./slider.input";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
export var SparkSliderBasic = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
|
+
var _getCommonConfig = getCommonConfig(),
|
|
16
|
+
sparkPrefix = _getCommonConfig.sparkPrefix;
|
|
17
|
+
useIndexStyle();
|
|
18
|
+
return /*#__PURE__*/_jsx(Slider, _objectSpread(_objectSpread({}, props), {}, {
|
|
19
|
+
className: classNames("".concat(sparkPrefix, "-slider"), _defineProperty({}, "".concat(sparkPrefix, "-slider-no-marks"), !Object.keys(props.marks || {}).length), props.className),
|
|
20
|
+
ref: ref
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
|
+
var SparkSlider = SparkSliderBasic;
|
|
24
|
+
Object.assign(SparkSlider, {
|
|
25
|
+
Input: SliderInput
|
|
26
|
+
});
|
|
27
|
+
export default SparkSlider;
|
|
@@ -0,0 +1,22 @@
|
|
|
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(antPrefix, "-slider.").concat(sparkPrefix, "-slider.").concat(sparkPrefix, "-slider-no-marks"), {
|
|
13
|
+
margin: 0
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
var useIndexStyle = createStyle(function (_ref2) {
|
|
17
|
+
var css = _ref2.css,
|
|
18
|
+
params = _objectWithoutProperties(_ref2, _excluded);
|
|
19
|
+
var result = css(getIndexStyleData(params));
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
export default useIndexStyle;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputNumberProps } from 'antd';
|
|
3
|
+
import { SliderSingleProps } from 'antd/es/slider';
|
|
4
|
+
export type SliderInputProps = Omit<SliderSingleProps, 'classNames' | 'styles'> & {
|
|
5
|
+
classNames?: {
|
|
6
|
+
slider?: string;
|
|
7
|
+
inputNumber?: string;
|
|
8
|
+
wrapper?: string;
|
|
9
|
+
};
|
|
10
|
+
styles?: {
|
|
11
|
+
slider?: React.CSSProperties;
|
|
12
|
+
inputNumber?: React.CSSProperties;
|
|
13
|
+
wrapper?: React.CSSProperties;
|
|
14
|
+
};
|
|
15
|
+
sliderProps?: SliderSingleProps;
|
|
16
|
+
inputNumberProps?: InputNumberProps;
|
|
17
|
+
};
|
|
18
|
+
export default function SliderSelector(props: SliderInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
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 = ["styles", "classNames"];
|
|
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; }
|
|
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; }
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
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."); }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
import { Flex, InputNumber } from 'antd';
|
|
17
|
+
import { useState } from 'react';
|
|
18
|
+
import { SparkSliderBasic } from "./index";
|
|
19
|
+
import useIndexStyle from "./index.style";
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
export default function SliderSelector(props) {
|
|
23
|
+
var _props$styles, _props$classNames, _props$styles2, _props$classNames2;
|
|
24
|
+
var styles = props.styles,
|
|
25
|
+
classNames = props.classNames,
|
|
26
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
27
|
+
var _useState = useState(props.value),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
inputValue = _useState2[0],
|
|
30
|
+
setInputValue = _useState2[1];
|
|
31
|
+
useIndexStyle();
|
|
32
|
+
var _onChange = function onChange(newValue) {
|
|
33
|
+
setInputValue(newValue);
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/_jsxs(Flex, {
|
|
36
|
+
gap: 12,
|
|
37
|
+
style: (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.wrapper,
|
|
38
|
+
className: (_props$classNames = props.classNames) === null || _props$classNames === void 0 ? void 0 : _props$classNames.wrapper,
|
|
39
|
+
children: [/*#__PURE__*/_jsx(Flex, {
|
|
40
|
+
align: "center",
|
|
41
|
+
style: {
|
|
42
|
+
flex: 1
|
|
43
|
+
},
|
|
44
|
+
children: /*#__PURE__*/_jsx(SparkSliderBasic, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
45
|
+
style: _objectSpread(_objectSpread({}, styles === null || styles === void 0 ? void 0 : styles.slider), {}, {
|
|
46
|
+
width: '100%'
|
|
47
|
+
}),
|
|
48
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.slider,
|
|
49
|
+
onChange: function onChange(value) {
|
|
50
|
+
var _props$onChange;
|
|
51
|
+
_onChange(value);
|
|
52
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, value);
|
|
53
|
+
},
|
|
54
|
+
value: typeof inputValue === 'number' ? inputValue : 0
|
|
55
|
+
}, props.sliderProps))
|
|
56
|
+
}), /*#__PURE__*/_jsx(Flex, {
|
|
57
|
+
align: "center",
|
|
58
|
+
children: /*#__PURE__*/_jsx(InputNumber, _objectSpread({
|
|
59
|
+
style: _objectSpread({}, (_props$styles2 = props.styles) === null || _props$styles2 === void 0 ? void 0 : _props$styles2.inputNumber),
|
|
60
|
+
className: (_props$classNames2 = props.classNames) === null || _props$classNames2 === void 0 ? void 0 : _props$classNames2.inputNumber,
|
|
61
|
+
min: props.min,
|
|
62
|
+
max: props.max,
|
|
63
|
+
value: inputValue,
|
|
64
|
+
onChange: function onChange(value) {
|
|
65
|
+
var _props$onChange2;
|
|
66
|
+
_onChange(value);
|
|
67
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 || _props$onChange2.call(props, value);
|
|
68
|
+
},
|
|
69
|
+
disabled: props.disabled
|
|
70
|
+
}, props.inputNumberProps))
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|