@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
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Tag } from "../../..";
|
|
2
|
+
import { Flex } from 'antd';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/_jsxs(Flex, {
|
|
7
|
+
align: "center",
|
|
8
|
+
vertical: true,
|
|
9
|
+
gap: 50,
|
|
10
|
+
children: [/*#__PURE__*/_jsx(Tag, {
|
|
11
|
+
size: "small",
|
|
12
|
+
color: "purple",
|
|
13
|
+
children: "purple"
|
|
14
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
15
|
+
size: "small",
|
|
16
|
+
color: "pink",
|
|
17
|
+
children: "pink"
|
|
18
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
19
|
+
size: "small",
|
|
20
|
+
color: "yellow",
|
|
21
|
+
children: "yellow"
|
|
22
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
23
|
+
size: "small",
|
|
24
|
+
color: "teal",
|
|
25
|
+
children: "teal"
|
|
26
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
27
|
+
size: "small",
|
|
28
|
+
color: "blue",
|
|
29
|
+
children: "blue"
|
|
30
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
31
|
+
size: "small",
|
|
32
|
+
color: "mauve",
|
|
33
|
+
children: "mauve"
|
|
34
|
+
}), /*#__PURE__*/_jsx(Tag, {
|
|
35
|
+
size: "small",
|
|
36
|
+
color: "transparent",
|
|
37
|
+
children: "transparent"
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -6,6 +6,7 @@ export declare function getIndexStyleData(params: any): {
|
|
|
6
6
|
padding?: undefined;
|
|
7
7
|
color?: undefined;
|
|
8
8
|
background?: undefined;
|
|
9
|
+
borderColor?: undefined;
|
|
9
10
|
} | {
|
|
10
11
|
fontSize: string;
|
|
11
12
|
lineHeight: string;
|
|
@@ -13,6 +14,7 @@ export declare function getIndexStyleData(params: any): {
|
|
|
13
14
|
fontWeight?: undefined;
|
|
14
15
|
color?: undefined;
|
|
15
16
|
background?: undefined;
|
|
17
|
+
borderColor?: undefined;
|
|
16
18
|
} | {
|
|
17
19
|
color: string;
|
|
18
20
|
background: string;
|
|
@@ -20,6 +22,15 @@ export declare function getIndexStyleData(params: any): {
|
|
|
20
22
|
fontSize?: undefined;
|
|
21
23
|
lineHeight?: undefined;
|
|
22
24
|
padding?: undefined;
|
|
25
|
+
borderColor?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
color: string;
|
|
28
|
+
background: string;
|
|
29
|
+
borderColor: string;
|
|
30
|
+
fontWeight?: undefined;
|
|
31
|
+
fontSize?: undefined;
|
|
32
|
+
lineHeight?: undefined;
|
|
33
|
+
padding?: undefined;
|
|
23
34
|
};
|
|
24
35
|
};
|
|
25
36
|
declare const useIndexStyle: (props?: {}) => import("../../../config").CommonConfig;
|
|
@@ -9,7 +9,7 @@ import createStyle from "../../../libs/createStyle";
|
|
|
9
9
|
export function getIndexStyleData(params) {
|
|
10
10
|
var antPrefix = params.antPrefix,
|
|
11
11
|
sparkPrefix = params.sparkPrefix;
|
|
12
|
-
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-tag"), {
|
|
12
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(sparkPrefix, "-tag"), {
|
|
13
13
|
fontWeight: 500
|
|
14
14
|
}), ".".concat(sparkPrefix, "-tag-small"), {
|
|
15
15
|
fontSize: '12px',
|
|
@@ -37,6 +37,10 @@ export function getIndexStyleData(params) {
|
|
|
37
37
|
}), ".".concat(sparkPrefix, "-tag-mauve"), {
|
|
38
38
|
color: "var(--".concat(antPrefix, "-color-mauve)"),
|
|
39
39
|
background: "var(--".concat(antPrefix, "-color-mauve-bg)")
|
|
40
|
+
}), ".".concat(sparkPrefix, "-tag-transparent"), {
|
|
41
|
+
color: "var(--".concat(antPrefix, "-color-text-tertiary)"),
|
|
42
|
+
background: 'transparent',
|
|
43
|
+
borderColor: "var(--".concat(antPrefix, "-color-border-secondary)")
|
|
40
44
|
});
|
|
41
45
|
}
|
|
42
46
|
var useIndexStyle = createStyle(function (_ref2) {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ConfigProviderProps } from 'antd';
|
|
3
2
|
import { Locale } from 'antd/es/locale';
|
|
4
3
|
export declare const DEFAULT_ANT_PREFIX = "ant";
|
|
@@ -18,8 +17,6 @@ export interface CommonConfig {
|
|
|
18
17
|
locale?: Locale;
|
|
19
18
|
/** iconfont 地址 */
|
|
20
19
|
iconfont?: string;
|
|
21
|
-
/** css variables style */
|
|
22
|
-
variables?: React.CSSProperties;
|
|
23
20
|
isDarkMode?: boolean;
|
|
24
21
|
}
|
|
25
22
|
export declare function setCommonConfig(newConf: CommonConfig): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 通用组件
|
|
3
3
|
*/
|
|
4
|
-
export { Alert, Badge, Checkbox, InputNumber, Progress, Radio, Select, Skeleton,
|
|
4
|
+
export { Alert, Badge, Checkbox, InputNumber, Progress, Radio, Select, Skeleton, type AlertProps, type BadgeProps, type CheckboxProps, type DrawerProps, type InputNumberProps, type NotificationArgsProps, type PopoverProps, type ProgressProps, type RadioProps, type SelectProps, type SkeletonProps, type TagProps, } from 'antd';
|
|
5
5
|
export { default as AlertDialog, type AlertDialogProps, } from './components/commonComponents/AlertDialog';
|
|
6
6
|
export { default as Avatar } from './components/commonComponents/Avatar';
|
|
7
7
|
export { default as Button, type SparkButtonProps as ButtonProps, } from './components/commonComponents/Button';
|
|
@@ -26,12 +26,13 @@ export { default as Popconfirm, type SparkPopconfirmProps as PopconfirmProps, }
|
|
|
26
26
|
export { default as Popover } from './components/commonComponents/Popover';
|
|
27
27
|
export { default as RadioButton, type SparkRadioButtonProps as RadioButtonProps, } from './components/commonComponents/RadioButton';
|
|
28
28
|
export { default as SlateEditor } from './components/commonComponents/SlateEditor';
|
|
29
|
+
export { default as Slider, type SliderInputProps, } from './components/commonComponents/Slider';
|
|
30
|
+
export { default as SliderSelector } from './components/commonComponents/SliderSelector';
|
|
29
31
|
export { default as Spinner } from './components/commonComponents/Spinner';
|
|
30
32
|
export { default as Switch, type SparkSwitchProps as SwitchProps, } from './components/commonComponents/Switch';
|
|
31
33
|
export { default as Tabs, type SparkTabsProps as TabsProps, } from './components/commonComponents/Tabs';
|
|
32
34
|
export { default as Tag } from './components/commonComponents/Tag';
|
|
33
35
|
export { default as Tooltip, type SparkTooltipProps as TooltipProps, } from './components/commonComponents/Tooltip';
|
|
34
|
-
export { default as SliderSelector } from './components/commonComponents/SliderSelector';
|
|
35
36
|
export { default as staticRenderer } from './libs/staticRenderer';
|
|
36
37
|
/**
|
|
37
38
|
* hooks
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 通用组件
|
|
3
3
|
*/
|
|
4
|
-
export { Alert, Badge, Checkbox, InputNumber, Progress, Radio, Select, Skeleton
|
|
4
|
+
export { Alert, Badge, Checkbox, InputNumber, Progress, Radio, Select, Skeleton } from 'antd';
|
|
5
5
|
export { default as AlertDialog } from "./components/commonComponents/AlertDialog";
|
|
6
6
|
export { default as Avatar } from "./components/commonComponents/Avatar";
|
|
7
7
|
export { default as Button } from "./components/commonComponents/Button";
|
|
@@ -26,13 +26,13 @@ export { default as Popconfirm } from "./components/commonComponents/Popconfirm"
|
|
|
26
26
|
export { default as Popover } from "./components/commonComponents/Popover";
|
|
27
27
|
export { default as RadioButton } from "./components/commonComponents/RadioButton";
|
|
28
28
|
export { default as SlateEditor } from "./components/commonComponents/SlateEditor";
|
|
29
|
+
export { default as Slider } from "./components/commonComponents/Slider";
|
|
30
|
+
export { default as SliderSelector } from "./components/commonComponents/SliderSelector";
|
|
29
31
|
export { default as Spinner } from "./components/commonComponents/Spinner";
|
|
30
32
|
export { default as Switch } from "./components/commonComponents/Switch";
|
|
31
33
|
export { default as Tabs } from "./components/commonComponents/Tabs";
|
|
32
34
|
export { default as Tag } from "./components/commonComponents/Tag";
|
|
33
35
|
export { default as Tooltip } from "./components/commonComponents/Tooltip";
|
|
34
|
-
// export { default as Slider } from './components/commonComponents/Slider';
|
|
35
|
-
export { default as SliderSelector } from "./components/commonComponents/SliderSelector";
|
|
36
36
|
export { default as staticRenderer } from "./libs/staticRenderer";
|
|
37
37
|
|
|
38
38
|
/**
|
package/dist/libs/env/index.d.ts
CHANGED
package/dist/libs/env/index.js
CHANGED
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
* 获取当前环境语言,例如zh-CN或者en-US
|
|
3
3
|
* @returns {string}
|
|
4
4
|
*/
|
|
5
|
+
import Cookies from 'js-cookie';
|
|
5
6
|
export function getLang() {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
// 优先级:cookie > 环境变量 > 默认值
|
|
8
|
+
if (location.host.includes('console.aliyun.com')) {
|
|
9
|
+
return 'zh-CN';
|
|
10
|
+
}
|
|
11
|
+
if (Cookies.get('aliyun_lang')) {
|
|
12
|
+
return Cookies.get('aliyun_lang') === 'en' ? 'en-US' : 'zh-CN';
|
|
13
|
+
} else {
|
|
14
|
+
var _window$g_config;
|
|
15
|
+
return (_window$g_config = window.g_config) !== null && _window$g_config !== void 0 && (_window$g_config = _window$g_config.userPreference) !== null && _window$g_config !== void 0 && _window$g_config.language || location.host.includes('alibabacloud') ? 'en-US' : 'zh-CN';
|
|
16
|
+
}
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** 获取regionId对应的名称 */
|
|
2
|
-
export declare function getRegionName(regionId: string, lang?:
|
|
2
|
+
export declare function getRegionName(regionId: string, lang?: string): any;
|