@trionesdev/antd-mobile-base-react 0.0.2-beta.16 → 0.0.2-beta.18
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/LICENSE +21 -21
- package/README.md +23 -23
- package/dist/Alert/alert.js +1 -1
- package/dist/Alert/style.scss +69 -69
- package/dist/Avatar/avatar.d.ts +2 -2
- package/dist/Avatar/avatar.js +1 -1
- package/dist/Avatar/style.scss +17 -17
- package/dist/Badge/style.scss +100 -100
- package/dist/Card/style.scss +35 -35
- package/dist/CascaderView/cascader-column-item.js +1 -1
- package/dist/CascaderView/style.scss +22 -22
- package/dist/Cell/CellGroup.js +25 -8
- package/dist/Cell/cell.js +20 -37
- package/dist/Cell/context.d.ts +4 -2
- package/dist/Cell/styles.scss +81 -52
- package/dist/Cell/types.d.ts +6 -4
- package/dist/Checkbox/checkbox-button.js +1 -1
- package/dist/Checkbox/checkbox-group.js +1 -2
- package/dist/Checkbox/checkbox-round.js +1 -1
- package/dist/Checkbox/index.scss +165 -165
- package/dist/ConfigProvider/config-provider.d.ts +1 -0
- package/dist/DemoBlock/index.scss +20 -20
- package/dist/DemoDescription/index.scss +3 -3
- package/dist/Descriptions/style.scss +65 -65
- package/dist/Divider/divider.d.ts +1 -1
- package/dist/Divider/divider.js +5 -3
- package/dist/Divider/style.scss +62 -62
- package/dist/Ellipsis/style.scss +13 -13
- package/dist/Empty/style.scss +29 -29
- package/dist/ErrorBlock/demo/base.js +2 -2
- package/dist/ErrorBlock/style.scss +62 -62
- package/dist/Footer/style.scss +55 -55
- package/dist/Form/ErrorList.d.ts +4 -0
- package/dist/Form/ErrorList.js +9 -0
- package/dist/Form/context.d.ts +4 -2
- package/dist/Form/context.js +2 -1
- package/dist/Form/form.d.ts +24 -6
- package/dist/Form/form.js +22 -11
- package/dist/Form/hooks/useForm.js +1 -8
- package/dist/Form/hooks/useFormContext.js +1 -2
- package/dist/Form/index.d.ts +6 -3
- package/dist/Form/index.js +4 -1
- package/dist/Form/styles.scss +11 -0
- package/dist/Form/types.d.ts +2 -1
- package/dist/FormCell/FormCell.d.ts +21 -0
- package/dist/FormCell/FormCell.js +56 -0
- package/dist/FormCell/index.d.ts +4 -0
- package/dist/FormCell/index.js +3 -0
- package/dist/FormCell/styles.scss +103 -0
- package/dist/Grid/style.scss +17 -17
- package/dist/Icon/demo/base.js +2 -2
- package/dist/InputNumber/style.scss +100 -100
- package/dist/Loading/DotLoading.d.ts +8 -0
- package/dist/Loading/DotLoading.js +33 -0
- package/dist/Loading/SpinLoading.js +70 -0
- package/dist/Loading/dot-loading.scss +72 -0
- package/dist/Loading/index.d.ts +5 -0
- package/dist/Loading/index.js +3 -0
- package/dist/{SpinLoading → Loading}/spin-loading.scss +39 -40
- package/dist/NavBar/nav-bar.js +1 -1
- package/dist/NavBar/style.scss +64 -64
- package/dist/NoticeBar/style.scss +130 -130
- package/dist/PageIndicator/style.scss +59 -59
- package/dist/Progress/Progress.js +1 -1
- package/dist/Progress/ProgressCircle.js +5 -2
- package/dist/Progress/ProgressLine.js +2 -2
- package/dist/Progress/style.scss +33 -33
- package/dist/Progress/types.d.ts +2 -2
- package/dist/Radio/radio.js +1 -1
- package/dist/Radio/style.scss +154 -141
- package/dist/Rate/rate.js +1 -1
- package/dist/Rate/style.scss +37 -37
- package/dist/Result/demo/base.js +2 -2
- package/dist/Result/style.scss +73 -73
- package/dist/Result/use-result-icon.js +1 -1
- package/dist/SafeArea/style.scss +20 -20
- package/dist/Scaffold/style.scss +17 -17
- package/dist/Segmented/style.scss +75 -75
- package/dist/Skeleton/Skeleton.d.ts +80 -21
- package/dist/Skeleton/Skeleton.js +248 -57
- package/dist/Skeleton/index.d.ts +3 -1
- package/dist/Skeleton/index.js +2 -1
- package/dist/Skeleton/style.scss +215 -48
- package/dist/Space/space.js +12 -9
- package/dist/Space/style.scss +101 -80
- package/dist/Stepper/stepper.js +2 -1
- package/dist/Stepper/style.scss +100 -100
- package/dist/Steps/HorizontalSteps.js +5 -2
- package/dist/Steps/VerticalSteps.js +5 -2
- package/dist/Steps/style.scss +153 -153
- package/dist/Steps/types.d.ts +2 -0
- package/dist/Switch/style.scss +127 -128
- package/dist/Switch/switch.d.ts +2 -0
- package/dist/Switch/switch.js +6 -5
- package/dist/TabBar/demo/base.js +2 -2
- package/dist/TabBar/index.scss +37 -37
- package/dist/Tabs/style.scss +108 -108
- package/dist/Tag/style.scss +110 -109
- package/dist/Tag/tag.d.ts +1 -1
- package/dist/Tag/tag.js +1 -1
- package/dist/WaterMark/style.scss +17 -17
- package/dist/index.d.ts +9 -4
- package/dist/index.js +4 -2
- package/dist/style/css-variable.scss +6 -6
- package/dist/style/style.scss +52 -52
- package/dist/style/theme-dark.scss +24 -24
- package/dist/style/theme-default.scss +54 -54
- package/dist/style/variable.scss +180 -173
- package/dist/types.d.ts +6 -1
- package/dist/utils/type.js +36 -36
- package/dist/utils/with-default-props.js +4 -4
- package/package.json +4 -7
- package/dist/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
- package/dist/SpinLoading/spin-loading.js +0 -59
- package/dist/Tabs/demo/base.d.ts +0 -3
- package/dist/Tabs/demo/base.js +0 -59
- /package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -0
package/dist/utils/type.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
/** https://github.com/Microsoft/TypeScript/issues/29729 */
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Get component props
|
|
5
|
-
* @example
|
|
6
|
-
* ```ts
|
|
7
|
-
* import { Checkbox } from 'antd'
|
|
8
|
-
* import type { GetProps } from 'antd';
|
|
9
|
-
*
|
|
10
|
-
* type CheckboxGroupProps = GetProps<typeof Checkbox.Group>
|
|
11
|
-
* ```
|
|
12
|
-
* @since 5.13.0
|
|
3
|
+
/**
|
|
4
|
+
* Get component props
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { Checkbox } from 'antd'
|
|
8
|
+
* import type { GetProps } from 'antd';
|
|
9
|
+
*
|
|
10
|
+
* type CheckboxGroupProps = GetProps<typeof Checkbox.Group>
|
|
11
|
+
* ```
|
|
12
|
+
* @since 5.13.0
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Get component props by component name
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* import { Select } from 'antd';
|
|
20
|
-
* import type { GetProp, SelectProps } from 'antd';
|
|
21
|
-
*
|
|
22
|
-
* type SelectOption1 = GetProp<SelectProps, 'options'>[number];
|
|
23
|
-
* // or
|
|
24
|
-
* type SelectOption2 = GetProp<typeof Select, 'options'>[number];
|
|
25
|
-
*
|
|
26
|
-
* const onChange: GetProp<typeof Select, 'onChange'> = (value, option) => {
|
|
27
|
-
* // Do something
|
|
28
|
-
* };
|
|
29
|
-
* ```
|
|
30
|
-
* @since 5.13.0
|
|
15
|
+
/**
|
|
16
|
+
* Get component props by component name
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Select } from 'antd';
|
|
20
|
+
* import type { GetProp, SelectProps } from 'antd';
|
|
21
|
+
*
|
|
22
|
+
* type SelectOption1 = GetProp<SelectProps, 'options'>[number];
|
|
23
|
+
* // or
|
|
24
|
+
* type SelectOption2 = GetProp<typeof Select, 'options'>[number];
|
|
25
|
+
*
|
|
26
|
+
* const onChange: GetProp<typeof Select, 'onChange'> = (value, option) => {
|
|
27
|
+
* // Do something
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
* @since 5.13.0
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* Get component ref
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* import { Input } from 'antd';
|
|
38
|
-
* import type { GetRef } from 'antd';
|
|
39
|
-
*
|
|
40
|
-
* type InputRef = GetRef<typeof Input>;
|
|
41
|
-
* ```
|
|
42
|
-
* @since 5.13.0
|
|
33
|
+
/**
|
|
34
|
+
* Get component ref
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { Input } from 'antd';
|
|
38
|
+
* import type { GetRef } from 'antd';
|
|
39
|
+
*
|
|
40
|
+
* type InputRef = GetRef<typeof Input>;
|
|
41
|
+
* ```
|
|
42
|
+
* @since 5.13.0
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
export var ComponentDefaults = {
|
|
@@ -15,10 +15,10 @@ export function mergeProps() {
|
|
|
15
15
|
return ret;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Merge props and return the first non-undefined value.
|
|
20
|
-
* The later has higher priority. e.g. (10, 1, 5) => 5 wins.
|
|
21
|
-
* This is useful with legacy props that have been deprecated.
|
|
18
|
+
/**
|
|
19
|
+
* Merge props and return the first non-undefined value.
|
|
20
|
+
* The later has higher priority. e.g. (10, 1, 5) => 5 wins.
|
|
21
|
+
* This is useful with legacy props that have been deprecated.
|
|
22
22
|
*/
|
|
23
23
|
export function mergeProp(defaultProp) {
|
|
24
24
|
for (var _len2 = arguments.length, propList = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trionesdev/antd-mobile-base-react",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.18",
|
|
4
4
|
"description": "antd mobile base react",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"react": ">=16.9.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@trionesdev/antd-mobile-icons-react": "
|
|
33
|
+
"@trionesdev/antd-mobile-icons-react": "0.0.2-beta.17",
|
|
34
34
|
"@types/crypto-js": "^4.2.2",
|
|
35
35
|
"@types/lodash-es": "^4.17.12",
|
|
36
36
|
"@types/node": "^18.19.123",
|
|
37
37
|
"@types/react": "^18.0.0",
|
|
38
38
|
"classnames": "^2.5.1",
|
|
39
|
-
"father": "^4.6.
|
|
39
|
+
"father": "^4.6.19",
|
|
40
40
|
"react": "^18.0.0",
|
|
41
41
|
"stylelint": "^16.12.0"
|
|
42
42
|
},
|
|
@@ -47,8 +47,5 @@
|
|
|
47
47
|
"react": "^18.0.0",
|
|
48
48
|
"runes2": "^1.1.4"
|
|
49
49
|
},
|
|
50
|
-
"
|
|
51
|
-
"@trionesdev/antd-mobile-icons-react": "0.0.2-beta.16"
|
|
52
|
-
},
|
|
53
|
-
"gitHead": "c43752ae341cc478de96784586fbf3b36251f4a0"
|
|
50
|
+
"gitHead": "2dd659ecca3e4ce4cdca02cb9dd6b0bb512bb32e"
|
|
54
51
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import Base64 from 'crypto-js/enc-base64';
|
|
3
|
-
import Utf8 from 'crypto-js/enc-utf8';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import "./spin-loading.scss";
|
|
6
|
-
var spinLoadingCls = 'triones-antm-spin-loading';
|
|
7
|
-
export function createSvgStr(props) {
|
|
8
|
-
return "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"width:100%;height:100%\" viewBox=\"0 0 32 32\">\n <circle r=\"15\" cx=\"16\" cy=\"16\"\n stroke-width=\"2\"\n stroke=\"".concat(props.stroke, "\"\n fill=\"transparent\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"").concat(15 * 3.14159265358979 * 2, "\"\n stroke-dashoffset=\"").concat(15 * 3.14159265358979 * 0.5, "\"></circle>\n </svg>");
|
|
9
|
-
}
|
|
10
|
-
export var SpinLoading = function SpinLoading(_ref) {
|
|
11
|
-
var _ref$size = _ref.size,
|
|
12
|
-
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
13
|
-
_ref$color = _ref.color,
|
|
14
|
-
color = _ref$color === void 0 ? 'default' : _ref$color;
|
|
15
|
-
var computedSize = React.useMemo(function () {
|
|
16
|
-
var resSize = null;
|
|
17
|
-
if (size === 'small') {
|
|
18
|
-
resSize = '24Px';
|
|
19
|
-
} else if (size === 'middle') {
|
|
20
|
-
resSize = '32Px';
|
|
21
|
-
} else if (size === 'large') {
|
|
22
|
-
resSize = '48Px';
|
|
23
|
-
} else {
|
|
24
|
-
resSize = size;
|
|
25
|
-
}
|
|
26
|
-
if (typeof resSize === 'number') {
|
|
27
|
-
return "".concat(resSize, "Px");
|
|
28
|
-
} else {
|
|
29
|
-
return resSize;
|
|
30
|
-
}
|
|
31
|
-
}, [size]);
|
|
32
|
-
var computedColor = React.useMemo(function () {
|
|
33
|
-
if (color === 'default') {
|
|
34
|
-
return '#9D9D9D';
|
|
35
|
-
} else if (color === 'primary') {
|
|
36
|
-
return '#1677ff';
|
|
37
|
-
} else if (color === 'white') {
|
|
38
|
-
return '#ffffff';
|
|
39
|
-
} else {
|
|
40
|
-
return color;
|
|
41
|
-
}
|
|
42
|
-
}, [color]);
|
|
43
|
-
var completedStyle = React.useMemo(function () {
|
|
44
|
-
var maskImageSvg = createSvgStr({
|
|
45
|
-
stroke: computedColor
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
'--size': computedSize,
|
|
49
|
-
'--color': computedColor,
|
|
50
|
-
'--maskImage': "url(data:image/svg+xml;base64,".concat(Base64.stringify(Utf8.parse(maskImageSvg)), ")")
|
|
51
|
-
};
|
|
52
|
-
}, [computedSize, computedColor]);
|
|
53
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: classNames(spinLoadingCls),
|
|
55
|
-
style: completedStyle
|
|
56
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
57
|
-
className: classNames("".concat(spinLoadingCls, "-loading"))
|
|
58
|
-
}));
|
|
59
|
-
};
|
package/dist/Tabs/demo/base.d.ts
DELETED
package/dist/Tabs/demo/base.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DemoBlock } from "../../DemoBlock";
|
|
3
|
-
import Tabs from "../index";
|
|
4
|
-
export default (function () {
|
|
5
|
-
var items = [{
|
|
6
|
-
key: '1',
|
|
7
|
-
label: 'Tab1',
|
|
8
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "1")
|
|
9
|
-
}, {
|
|
10
|
-
key: '2',
|
|
11
|
-
label: 'Tab2',
|
|
12
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "2")
|
|
13
|
-
}];
|
|
14
|
-
var items2 = [{
|
|
15
|
-
key: '1',
|
|
16
|
-
label: 'Tab1-测试',
|
|
17
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "1")
|
|
18
|
-
}, {
|
|
19
|
-
key: '2',
|
|
20
|
-
label: 'Tab2-测试',
|
|
21
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "2")
|
|
22
|
-
}, {
|
|
23
|
-
key: '3',
|
|
24
|
-
label: 'Tab3-测试',
|
|
25
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "3")
|
|
26
|
-
}, {
|
|
27
|
-
key: '4',
|
|
28
|
-
label: 'Tab4-测试',
|
|
29
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "4")
|
|
30
|
-
}, {
|
|
31
|
-
key: '5',
|
|
32
|
-
label: 'Tab5-测试',
|
|
33
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "5")
|
|
34
|
-
}, {
|
|
35
|
-
key: '6',
|
|
36
|
-
label: 'Tab6-测试',
|
|
37
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, "6")
|
|
38
|
-
}];
|
|
39
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
40
|
-
title: "\u57FA\u672C\u4F7F\u7528"
|
|
41
|
-
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
42
|
-
items: items
|
|
43
|
-
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
44
|
-
title: "\u6EDA\u52A8"
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
46
|
-
items: items2,
|
|
47
|
-
stretch: false
|
|
48
|
-
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
49
|
-
title: "Tab"
|
|
50
|
-
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
51
|
-
stretch: false
|
|
52
|
-
}, /*#__PURE__*/React.createElement(Tabs.Tab, {
|
|
53
|
-
key: "1",
|
|
54
|
-
label: "Tab1"
|
|
55
|
-
}, /*#__PURE__*/React.createElement("div", null, "1")), /*#__PURE__*/React.createElement(Tabs.Tab, {
|
|
56
|
-
key: "2",
|
|
57
|
-
label: "Tab2"
|
|
58
|
-
}, /*#__PURE__*/React.createElement("div", null, "2")))));
|
|
59
|
-
});
|
|
File without changes
|