@digitalc/dxp-ui 0.0.6-alpha.1 → 0.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/es/components/Amount/index.js +1 -0
- package/es/components/Button/designTokens.d.ts +0 -2
- package/es/components/Button/designTokens.js +1 -2
- package/es/components/Card/index.d.ts +1 -1
- package/es/components/Card/index.js +7 -2
- package/es/components/Card/style/index.less +1 -1
- package/es/components/Checkbox/style/index.less +5 -0
- package/es/components/Form/index.js +1 -1
- package/es/components/Input/index.js +2 -2
- package/es/components/Input/style/index.less +3 -0
- package/es/components/Input/style/variables.less +4 -0
- package/es/components/Modal/index.js +1 -1
- package/es/components/Selector/ESelector.js +1 -1
- package/es/components/Selector/style/index.less +2 -2
- package/es/components/SelectorItem/style/index.less +2 -2
- package/es/components/StickyFooter/index.js +10 -3
- package/es/components/Tabs/index.js +1 -1
- package/es/components/Tabs/style/index.less +5 -5
- package/es/components/index.d.ts +0 -3
- package/es/components/index.js +0 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/utils/deviceType.d.ts +0 -15
- package/es/utils/deviceType.js +0 -46
- package/lib/components/Amount/index.js +1 -0
- package/lib/components/Button/designTokens.d.ts +0 -2
- package/lib/components/Button/designTokens.js +0 -2
- package/lib/components/Card/index.d.ts +1 -1
- package/lib/components/Card/index.js +1 -1
- package/lib/components/Card/style/index.less +1 -1
- package/lib/components/Checkbox/style/index.less +5 -0
- package/lib/components/Form/index.js +1 -1
- package/lib/components/Input/index.js +4 -1
- package/lib/components/Input/style/index.less +3 -0
- package/lib/components/Input/style/variables.less +4 -0
- package/lib/components/Modal/index.js +1 -2
- package/lib/components/Selector/ESelector.js +1 -3
- package/lib/components/Selector/style/index.less +2 -2
- package/lib/components/SelectorItem/style/index.less +2 -2
- package/lib/components/StickyFooter/index.js +2 -2
- package/lib/components/Tabs/index.js +1 -1
- package/lib/components/Tabs/style/index.less +5 -5
- package/lib/components/index.d.ts +0 -3
- package/lib/components/index.js +0 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -1
- package/lib/utils/deviceType.d.ts +0 -15
- package/lib/utils/deviceType.js +0 -25
- package/package.json +2 -2
- package/es/components/AppStyleWrapper/index.d.ts +0 -6
- package/es/components/AppStyleWrapper/index.js +0 -13
- package/es/components/Col/index.d.ts +0 -7
- package/es/components/Col/index.js +0 -21
- package/es/components/Row/index.d.ts +0 -7
- package/es/components/Row/index.js +0 -68
- package/lib/components/AppStyleWrapper/index.d.ts +0 -6
- package/lib/components/AppStyleWrapper/index.js +0 -48
- package/lib/components/Col/index.d.ts +0 -7
- package/lib/components/Col/index.js +0 -74
- package/lib/components/Row/index.d.ts +0 -7
- package/lib/components/Row/index.js +0 -114
|
@@ -66,6 +66,7 @@ var Amount = function Amount(props) {
|
|
|
66
66
|
colorCardTextPriceStrikethrough = designTokens.colorCardTextPriceStrikethrough,
|
|
67
67
|
colorCardTextTitle = designTokens.colorCardTextTitle,
|
|
68
68
|
colorIconActive = designTokens.colorIconActive;
|
|
69
|
+
console.log('colorIconActive', colorIconActive);
|
|
69
70
|
var baseProps = {
|
|
70
71
|
className: classNames(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-size-").concat(size), size), "".concat(prefixCls, "-position-").concat(position), position), className),
|
|
71
72
|
style: style
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* - 缺点:需要了解组件DOM结构,维护成本高,优先选择第1种
|
|
15
15
|
*/
|
|
16
16
|
declare const useDesignTokens: () => {
|
|
17
|
-
controlHeight: string;
|
|
18
17
|
colorPrimary: any;
|
|
19
18
|
colorPrimaryHover: any;
|
|
20
19
|
colorPrimaryTextHover: any;
|
|
@@ -48,7 +47,6 @@ declare const useDesignTokens: () => {
|
|
|
48
47
|
paddingBlockLG: any;
|
|
49
48
|
};
|
|
50
49
|
declare const useInverseDesignTokens: () => {
|
|
51
|
-
controlHeight: string;
|
|
52
50
|
colorPrimary: any;
|
|
53
51
|
colorPrimaryHover: any;
|
|
54
52
|
colorPrimaryTextHover: any;
|
|
@@ -19,7 +19,6 @@ import { useDynamicTokens } from "../../utils";
|
|
|
19
19
|
var useDesignTokens = function useDesignTokens() {
|
|
20
20
|
var getToken = useDynamicTokens();
|
|
21
21
|
return {
|
|
22
|
-
controlHeight: "".concat(2 * getToken('spacingButtonPaddingHorizontal') + 24, "px"),
|
|
23
22
|
// 算法配置
|
|
24
23
|
// algorithm: true,
|
|
25
24
|
// 主要按钮背景色
|
|
@@ -91,7 +90,7 @@ var useInverseDesignTokens = function useInverseDesignTokens() {
|
|
|
91
90
|
return {
|
|
92
91
|
// 算法配置
|
|
93
92
|
// algorithm: true,
|
|
94
|
-
|
|
93
|
+
|
|
95
94
|
// 主要按钮背景色
|
|
96
95
|
colorPrimary: getToken('colorButtonBackgroundPrimaryInverse'),
|
|
97
96
|
// 主要按钮 Hover
|
|
@@ -7,7 +7,7 @@ import cl from 'classnames';
|
|
|
7
7
|
import { theme } from "../../utils/theme";
|
|
8
8
|
import { useDesignTokens } from "./designTokens";
|
|
9
9
|
import { cssClasses } from "../../constants";
|
|
10
|
-
import { Text } from "../";
|
|
10
|
+
import { Text, Amount } from "../";
|
|
11
11
|
import "./style/index.less";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
var Card = function Card(props) {
|
|
@@ -55,7 +55,12 @@ var Card = function Card(props) {
|
|
|
55
55
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
56
56
|
size: "ContentC15Bold",
|
|
57
57
|
children: amountLabel
|
|
58
|
-
}),
|
|
58
|
+
}), /*#__PURE__*/_jsx(Amount, {
|
|
59
|
+
showIcon: false,
|
|
60
|
+
title: "",
|
|
61
|
+
priceColor: colorTextAmount,
|
|
62
|
+
children: amountValue
|
|
63
|
+
})]
|
|
59
64
|
}) : extraBottom;
|
|
60
65
|
};
|
|
61
66
|
var styleBg = bgColor ? {
|
|
@@ -17,7 +17,7 @@ var InternalForm = function InternalForm(props) {
|
|
|
17
17
|
className = _props$className === void 0 ? '' : _props$className,
|
|
18
18
|
children = props.children,
|
|
19
19
|
attr = _objectWithoutProperties(props, _excluded);
|
|
20
|
-
var prefix = "".concat(cssClasses.PREFIX);
|
|
20
|
+
var prefix = "".concat(cssClasses.PREFIX, "-form");
|
|
21
21
|
var designFormTokens = useDesignFormTokens();
|
|
22
22
|
var designFormHorizontalTokens = useDesignFormHorizontalTokens();
|
|
23
23
|
var formDesign = layout === 'vertical' ? designFormTokens : designFormHorizontalTokens;
|
|
@@ -35,7 +35,7 @@ var Input = function Input(props) {
|
|
|
35
35
|
var styleToken = useStyleToken();
|
|
36
36
|
var controlHeight = designTokens.controlHeight;
|
|
37
37
|
// 主Input组件
|
|
38
|
-
var prefix = "".concat(cssClasses.PREFIX);
|
|
38
|
+
var prefix = "".concat(cssClasses.PREFIX, "-inputOutside");
|
|
39
39
|
// 样式注入逻辑
|
|
40
40
|
var useCustomButtonStyle = function useCustomButtonStyle() {
|
|
41
41
|
var hashId = useStyleRegister({
|
|
@@ -43,7 +43,7 @@ var Input = function Input(props) {
|
|
|
43
43
|
token: {},
|
|
44
44
|
path: ["".concat(prefix)]
|
|
45
45
|
}, function () {
|
|
46
|
-
return "\n .".concat(prefix, "-input-affix-wrapper {\n height: ").concat(controlHeight, "px !important;\n padding-block: 0 !important;\n } \n ");
|
|
46
|
+
return "\n .".concat(prefix, "-input {\n height: ").concat(controlHeight, "px;\n }\n .").concat(prefix, "-input-affix-wrapper {\n height: ").concat(controlHeight, "px !important;\n padding-block: 0 !important;\n } \n ");
|
|
47
47
|
});
|
|
48
48
|
return hashId;
|
|
49
49
|
};
|
|
@@ -55,7 +55,7 @@ var Modal = function Modal(props) {
|
|
|
55
55
|
token: {},
|
|
56
56
|
path: ["".concat(prefix)]
|
|
57
57
|
}, function () {
|
|
58
|
-
return "\n .".concat(prefix, "-sticky-headers .").concat(prefix, "-
|
|
58
|
+
return "\n .".concat(prefix, "-sticky-headers .").concat(prefix, "-header {\n }\n .").concat(prefix, "-sticky-header.").concat(prefix, "-sticky-footer .").concat(prefix, "-body {\n overflow-y: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n max-height: calc(80vh - ").concat(spacingModalCardPaddingTop * 2, "px - 26px - ").concat(spacingModalButtonStickyPaddingVertical * 2, "px - 40px - 16px);\n }\n .").concat(prefix, "-sticky-header.").concat(prefix, "-sticky-footer .").concat(prefix, "-body::-webkit-scrollbar {\n display: none;\n }\n .").concat(prefix, "-left .").concat(prefix, "-footer {\n text-align: left;\n }\n .").concat(prefix, "-right .").concat(prefix, "-footer {\n text-align: right;\n }\n .").concat(prefix, "-center .").concat(prefix, "-footer {\n text-align: center;\n }\n .").concat(prefix, " .").concat(prefix, "-close {\n top: ").concat(spacingModalCardPaddingHorizontal - 4, "px\n }\n .").concat(prefix, "-mobile .").concat(prefix, "-close-x {\n font-size: 24px;\n }\n .").concat(prefix, "-desktop .").concat(prefix, "-close-x {\n font-size: 16px;\n }\n ");
|
|
59
59
|
});
|
|
60
60
|
return hashId;
|
|
61
61
|
};
|
|
@@ -98,7 +98,7 @@ var ESelector = function ESelector(props) {
|
|
|
98
98
|
token: {},
|
|
99
99
|
path: ["".concat(prefix, "-warp")]
|
|
100
100
|
}, function () {
|
|
101
|
-
return "\n .".concat(prefix, "-warp {\n
|
|
101
|
+
return "\n .".concat(prefix, "-warp {\n gap: ").concat(gap || 16, "px;\n .itemSelect {\n .filterOptions {\n background: ").concat(colorSelectorBackground, ";\n border: ").concat(borderWidthSelectorStandard || 1, "px solid ").concat(colorSelectorBorderStandard, ";\n border-radius: ").concat(borderRadiusSelector, "px;\n padding: ").concat(spacingSelectorPaddingVertical, "px ").concat(spacingSelectorPaddingHorizontal, "px;\n &.active {\n border: ").concat(borderWidthSelectorActive || 1, "px solid ").concat(colorSelectorBorderActive, ";\n border-radius: ").concat(borderRadiusSelector, "px;\n &.activeBg {\n background: ").concat(colorSelectorBackgroundActive, ";\n }\n } \n &.active.showActiveIcon:after {\n background: ").concat(colorSelectorBorderActive, ";\n } \n &.disabled {\n opacity: ").concat(opacitySelectorTextDisabled / 100, ";\n border-color: ").concat(colorSelectorBorderDisabled, ";\n color:").concat(colorSelectorTextDisabled, ";\n }\n }\n }\n ");
|
|
102
102
|
});
|
|
103
103
|
return hashId;
|
|
104
104
|
};
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
position: absolute;
|
|
51
51
|
right: 8px;
|
|
52
52
|
bottom: 4px;
|
|
53
|
-
z-index:
|
|
53
|
+
z-index: 100;
|
|
54
54
|
transform: scale(0.5, 0.5);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
bottom: -32px;
|
|
69
69
|
right: -32px;
|
|
70
70
|
border-radius: 10000px;
|
|
71
|
-
z-index:
|
|
71
|
+
z-index: 99;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
position: absolute;
|
|
30
30
|
right: 8px;
|
|
31
31
|
bottom: 4px;
|
|
32
|
-
z-index:
|
|
32
|
+
z-index: 100;
|
|
33
33
|
transform: scale(0.5, 0.5);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
bottom: -32px;
|
|
48
48
|
right: -32px;
|
|
49
49
|
border-radius: 10000px;
|
|
50
|
-
z-index:
|
|
50
|
+
z-index: 99;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -86,8 +86,8 @@ var StickyFooter = function StickyFooter(props) {
|
|
|
86
86
|
disabled: btnDisabled,
|
|
87
87
|
children: buttonText
|
|
88
88
|
})
|
|
89
|
-
}), type === 'priceVariant' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
90
|
-
children: [
|
|
89
|
+
}), type === 'priceVariant' && !hideAmount && /*#__PURE__*/_jsxs(_Fragment, {
|
|
90
|
+
children: [/*#__PURE__*/_jsx(Amount, {
|
|
91
91
|
titleType: titleType,
|
|
92
92
|
priceStrikethrough: priceStrikethrough,
|
|
93
93
|
priceColor: colorPrice || priceColor,
|
|
@@ -101,7 +101,7 @@ var StickyFooter = function StickyFooter(props) {
|
|
|
101
101
|
onDropDownClick: onDropDownClick,
|
|
102
102
|
iconType: iconType,
|
|
103
103
|
children: price
|
|
104
|
-
}), !hideBtn && /*#__PURE__*/_jsxs(_Space, {
|
|
104
|
+
}), autoBreakPoint === DESKTOP && !hideBtn && /*#__PURE__*/_jsxs(_Space, {
|
|
105
105
|
size: "middle",
|
|
106
106
|
children: [showCancel, showPrevious, showBackPage, /*#__PURE__*/_jsx(Button, {
|
|
107
107
|
iconPosition: iconPosition,
|
|
@@ -112,6 +112,13 @@ var StickyFooter = function StickyFooter(props) {
|
|
|
112
112
|
onClick: onBtnClick,
|
|
113
113
|
children: buttonText
|
|
114
114
|
})]
|
|
115
|
+
}), autoBreakPoint === MOBILE && /*#__PURE__*/_jsx(Button, {
|
|
116
|
+
icon: btnIcon,
|
|
117
|
+
disabled: btnDisabled,
|
|
118
|
+
loading: btnLoading,
|
|
119
|
+
type: "primary",
|
|
120
|
+
onClick: onBtnClick,
|
|
121
|
+
children: buttonText
|
|
115
122
|
})]
|
|
116
123
|
})]
|
|
117
124
|
}), children]
|
|
@@ -22,7 +22,7 @@ var Tabs = function Tabs(props) {
|
|
|
22
22
|
type = _props$type === void 0 ? 'default' : _props$type,
|
|
23
23
|
defaultActiveKey = props.defaultActiveKey,
|
|
24
24
|
_props$prefixCls = props.prefixCls,
|
|
25
|
-
prefixCls = _props$prefixCls === void 0 ? "".concat(BASE_CLASS_PREFIX) : _props$prefixCls,
|
|
25
|
+
prefixCls = _props$prefixCls === void 0 ? "".concat(BASE_CLASS_PREFIX, "-tabs") : _props$prefixCls,
|
|
26
26
|
_props$className = props.className,
|
|
27
27
|
className = _props$className === void 0 ? '' : _props$className,
|
|
28
28
|
_props$isEqualTabs = props.isEqualTabs,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@components: tabs;
|
|
4
4
|
|
|
5
|
-
.@{prefix}-equal-tabs {
|
|
5
|
+
.@{prefix}-@{components}-equal-tabs {
|
|
6
6
|
.@{prefix}-tabs-nav-list {
|
|
7
7
|
display: grid !important;
|
|
8
8
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.@{prefix}-item {
|
|
24
|
+
.@{prefix}-@{components}-item {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
box-sizing: border-box;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.@{prefix}-tab-btn {
|
|
31
|
+
.@{prefix}-@{components}-tab-btn {
|
|
32
32
|
text-align: center;
|
|
33
33
|
|
|
34
|
-
.@{prefix}-tab-icon {
|
|
34
|
+
.@{prefix}-@{components}-tab-icon {
|
|
35
35
|
margin: 0 !important;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.@{prefix}-fill>.@{prefix}-nav .@{prefix}-tab-focus {
|
|
39
|
+
.@{prefix}-@{components}-fill>.@{prefix}-@{components}-nav .@{prefix}-@{components}-tab-focus {
|
|
40
40
|
outline: none;
|
|
41
41
|
}
|
package/es/components/index.d.ts
CHANGED
|
@@ -63,7 +63,4 @@ export { AlignTypes } from './ListItem';
|
|
|
63
63
|
export { default as Selector } from './Selector';
|
|
64
64
|
export { default as Checkbox } from './Checkbox';
|
|
65
65
|
export { default as Radio } from './Radio';
|
|
66
|
-
export { default as AppStyleWrapper } from './AppStyleWrapper';
|
|
67
|
-
export { default as Row } from './Row';
|
|
68
|
-
export { default as Col } from './Col';
|
|
69
66
|
export { default as GlobalTokenProvider } from './GlobalTokenProvider';
|
package/es/components/index.js
CHANGED
|
@@ -38,7 +38,4 @@ export { AlignTypes } from "./ListItem";
|
|
|
38
38
|
export { default as Selector } from "./Selector";
|
|
39
39
|
export { default as Checkbox } from "./Checkbox";
|
|
40
40
|
export { default as Radio } from "./Radio";
|
|
41
|
-
export { default as AppStyleWrapper } from "./AppStyleWrapper";
|
|
42
|
-
export { default as Row } from "./Row";
|
|
43
|
-
export { default as Col } from "./Col";
|
|
44
41
|
export { default as GlobalTokenProvider } from "./GlobalTokenProvider";
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './style/themes/index.css';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export { default as tokenManager } from './utils/tokenManager';
|
|
4
|
-
export { useBreakPoint, useIsMobile, checkIsMobile
|
|
4
|
+
export { useBreakPoint, useIsMobile, checkIsMobile } from './utils/deviceType';
|
|
5
5
|
export * from './utils/themeContext';
|
package/es/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export * from "./components";
|
|
|
5
5
|
|
|
6
6
|
// 导出工具函数
|
|
7
7
|
export { default as tokenManager } from "./utils/tokenManager";
|
|
8
|
-
export { useBreakPoint, useIsMobile, checkIsMobile
|
|
8
|
+
export { useBreakPoint, useIsMobile, checkIsMobile } from "./utils/deviceType";
|
|
9
9
|
|
|
10
10
|
// 这个是多主题的配置目前没用;选择了直接由消费者注入 token 的方式改变样式更灵活
|
|
11
11
|
export * from "./utils/themeContext";
|
package/es/utils/deviceType.d.ts
CHANGED
|
@@ -12,18 +12,3 @@ export declare const checkIsMobile: () => boolean;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const useIsMobile: () => boolean;
|
|
14
14
|
export declare const useBreakPoint: () => "desktop" | "mobile" | null;
|
|
15
|
-
/**
|
|
16
|
-
* 获取 WebView 的版本号
|
|
17
|
-
* @returns {number|null} 返回 WebView 的版本号(整数),如果无法解析则返回 null
|
|
18
|
-
*/
|
|
19
|
-
export declare const getWebViewVersion: () => number | null;
|
|
20
|
-
/**
|
|
21
|
-
* 检测是否支持某个特性(例如 CSS 属性或 JavaScript API)
|
|
22
|
-
* @returns {boolean} 如果支持返回 true,否则返回 false
|
|
23
|
-
*/
|
|
24
|
-
export declare const isGapSupported: () => boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 检测 WebView 版本是否低于 90
|
|
27
|
-
* @returns {boolean} 如果版本低于 90 或无法检测到版本,则返回 true;否则返回 false
|
|
28
|
-
*/
|
|
29
|
-
export declare const isWebViewBelow90: () => boolean;
|
package/es/utils/deviceType.js
CHANGED
|
@@ -62,50 +62,4 @@ export var useBreakPoint = function useBreakPoint() {
|
|
|
62
62
|
setBreakpoint(autoBreakPoint);
|
|
63
63
|
}, []);
|
|
64
64
|
return breakpoint;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 获取 WebView 的版本号
|
|
69
|
-
* @returns {number|null} 返回 WebView 的版本号(整数),如果无法解析则返回 null
|
|
70
|
-
*/
|
|
71
|
-
export var getWebViewVersion = function getWebViewVersion() {
|
|
72
|
-
try {
|
|
73
|
-
var _navigator;
|
|
74
|
-
var userAgent = ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.userAgent) || ''; // 确保 navigator 和 userAgent 存在
|
|
75
|
-
|
|
76
|
-
// 匹配 Chrome/XX 或 WebView/XX(Android WebView 格式)
|
|
77
|
-
var versionMatch = userAgent.match(/(Chrome|WebView)\/(\d+)/);
|
|
78
|
-
|
|
79
|
-
// 如果匹配成功,返回版本号;否则返回 null
|
|
80
|
-
return versionMatch ? parseInt(versionMatch[2], 10) : null;
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.error('Error while parsing WebView version:', error);
|
|
83
|
-
return null; // 捕获异常并返回 null
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* 检测是否支持某个特性(例如 CSS 属性或 JavaScript API)
|
|
88
|
-
* @returns {boolean} 如果支持返回 true,否则返回 false
|
|
89
|
-
*/
|
|
90
|
-
export var isGapSupported = function isGapSupported() {
|
|
91
|
-
// 示例:检测是否支持 CSS 的 gap 属性
|
|
92
|
-
var testElement = document.createElement('div');
|
|
93
|
-
testElement.style.gap = '1px'; // 尝试设置 gap 属性
|
|
94
|
-
|
|
95
|
-
// 如果浏览器支持 gap 属性,则 style.gap 不会为空
|
|
96
|
-
return testElement.style.gap !== '';
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 检测 WebView 版本是否低于 90
|
|
101
|
-
* @returns {boolean} 如果版本低于 90 或无法检测到版本,则返回 true;否则返回 false
|
|
102
|
-
*/
|
|
103
|
-
export var isWebViewBelow90 = function isWebViewBelow90() {
|
|
104
|
-
var version = getWebViewVersion();
|
|
105
|
-
// 如果版本号有效且小于 90,返回 true
|
|
106
|
-
if (version !== null) {
|
|
107
|
-
return version < 90;
|
|
108
|
-
}
|
|
109
|
-
// 如果无法获取版本号,降级到特性检测
|
|
110
|
-
return !isGapSupported();
|
|
111
65
|
};
|
|
@@ -133,6 +133,7 @@ var Amount = (props) => {
|
|
|
133
133
|
]);
|
|
134
134
|
const designTokens = (0, import_designTokens.useDesignTokens)();
|
|
135
135
|
const { colorCardTextPrice, colorCardTextPriceStrikethrough, colorCardTextTitle, colorIconActive } = designTokens;
|
|
136
|
+
console.log("colorIconActive", colorIconActive);
|
|
136
137
|
const baseProps = {
|
|
137
138
|
className: (0, import_classnames.default)(
|
|
138
139
|
prefixCls,
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* - 缺点:需要了解组件DOM结构,维护成本高,优先选择第1种
|
|
15
15
|
*/
|
|
16
16
|
declare const useDesignTokens: () => {
|
|
17
|
-
controlHeight: string;
|
|
18
17
|
colorPrimary: any;
|
|
19
18
|
colorPrimaryHover: any;
|
|
20
19
|
colorPrimaryTextHover: any;
|
|
@@ -48,7 +47,6 @@ declare const useDesignTokens: () => {
|
|
|
48
47
|
paddingBlockLG: any;
|
|
49
48
|
};
|
|
50
49
|
declare const useInverseDesignTokens: () => {
|
|
51
|
-
controlHeight: string;
|
|
52
50
|
colorPrimary: any;
|
|
53
51
|
colorPrimaryHover: any;
|
|
54
52
|
colorPrimaryTextHover: any;
|
|
@@ -27,7 +27,6 @@ var import_utils = require("../../utils");
|
|
|
27
27
|
var useDesignTokens = () => {
|
|
28
28
|
const getToken = (0, import_utils.useDynamicTokens)();
|
|
29
29
|
return {
|
|
30
|
-
controlHeight: `${2 * getToken("spacingButtonPaddingHorizontal") + 24}px`,
|
|
31
30
|
// 算法配置
|
|
32
31
|
// algorithm: true,
|
|
33
32
|
// 主要按钮背景色
|
|
@@ -96,7 +95,6 @@ var useInverseDesignTokens = () => {
|
|
|
96
95
|
return {
|
|
97
96
|
// 算法配置
|
|
98
97
|
// algorithm: true,
|
|
99
|
-
controlHeight: `${2 * getToken("spacingButtonPaddingVertical") + 24}px`,
|
|
100
98
|
// 主要按钮背景色
|
|
101
99
|
colorPrimary: getToken("colorButtonBackgroundPrimaryInverse"),
|
|
102
100
|
// 主要按钮 Hover
|
|
@@ -168,7 +168,7 @@ var Card = (props) => {
|
|
|
168
168
|
return hashId;
|
|
169
169
|
};
|
|
170
170
|
useCustomButtonStyle();
|
|
171
|
-
const getAmount = () => amountValue ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-amount` }, /* @__PURE__ */ import_react.default.createElement(import__.Text, { size: "ContentC15Bold" }, amountLabel), amountValue) : extraBottom;
|
|
171
|
+
const getAmount = () => amountValue ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-amount` }, /* @__PURE__ */ import_react.default.createElement(import__.Text, { size: "ContentC15Bold" }, amountLabel), /* @__PURE__ */ import_react.default.createElement(import__.Amount, { showIcon: false, title: "", priceColor: colorTextAmount }, amountValue)) : extraBottom;
|
|
172
172
|
const styleBg = bgColor ? { background: bgColor } : {};
|
|
173
173
|
if (type === "default") {
|
|
174
174
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -65,7 +65,7 @@ var import_designTokens = require("./designTokens");
|
|
|
65
65
|
var import_style = require("./style/index.less");
|
|
66
66
|
var InternalForm = (props) => {
|
|
67
67
|
const _a = props, { layout = "vertical", className = "", children } = _a, attr = __objRest(_a, ["layout", "className", "children"]);
|
|
68
|
-
const prefix = `${import_constants.cssClasses.PREFIX}`;
|
|
68
|
+
const prefix = `${import_constants.cssClasses.PREFIX}-form`;
|
|
69
69
|
const designFormTokens = (0, import_designTokens.useDesignFormTokens)();
|
|
70
70
|
const designFormHorizontalTokens = (0, import_designTokens.useDesignFormHorizontalTokens)();
|
|
71
71
|
const formDesign = layout === "vertical" ? designFormTokens : designFormHorizontalTokens;
|
|
@@ -84,13 +84,16 @@ var Input = (props) => {
|
|
|
84
84
|
const designTokens = (0, import_designTokens.useDesignTokens)();
|
|
85
85
|
const styleToken = (0, import_designTokens.useStyleToken)();
|
|
86
86
|
const { controlHeight } = designTokens;
|
|
87
|
-
const prefix = `${import_constants.cssClasses.PREFIX}`;
|
|
87
|
+
const prefix = `${import_constants.cssClasses.PREFIX}-inputOutside`;
|
|
88
88
|
const useCustomButtonStyle = () => {
|
|
89
89
|
const hashId = (0, import_cssinjs.useStyleRegister)({
|
|
90
90
|
theme: import_theme.theme,
|
|
91
91
|
token: {},
|
|
92
92
|
path: [`${prefix}`]
|
|
93
93
|
}, () => `
|
|
94
|
+
.${prefix}-input {
|
|
95
|
+
height: ${controlHeight}px;
|
|
96
|
+
}
|
|
94
97
|
.${prefix}-input-affix-wrapper {
|
|
95
98
|
height: ${controlHeight}px !important;
|
|
96
99
|
padding-block: 0 !important;
|
|
@@ -138,8 +138,7 @@ var Modal = (props) => {
|
|
|
138
138
|
token: {},
|
|
139
139
|
path: [`${prefix}`]
|
|
140
140
|
}, () => `
|
|
141
|
-
.${prefix}-sticky-headers .${prefix}-
|
|
142
|
-
padding-right: 1rem;
|
|
141
|
+
.${prefix}-sticky-headers .${prefix}-header {
|
|
143
142
|
}
|
|
144
143
|
.${prefix}-sticky-header.${prefix}-sticky-footer .${prefix}-body {
|
|
145
144
|
overflow-y: auto;
|
|
@@ -113,9 +113,7 @@ var ESelector = (props) => {
|
|
|
113
113
|
path: [`${prefix}-warp`]
|
|
114
114
|
}, () => `
|
|
115
115
|
.${prefix}-warp {
|
|
116
|
-
|
|
117
|
-
margin-top:${gap || 16}px;
|
|
118
|
-
}
|
|
116
|
+
gap: ${gap || 16}px;
|
|
119
117
|
.itemSelect {
|
|
120
118
|
.filterOptions {
|
|
121
119
|
background: ${colorSelectorBackground};
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
position: absolute;
|
|
51
51
|
right: 8px;
|
|
52
52
|
bottom: 4px;
|
|
53
|
-
z-index:
|
|
53
|
+
z-index: 100;
|
|
54
54
|
transform: scale(0.5, 0.5);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
bottom: -32px;
|
|
69
69
|
right: -32px;
|
|
70
70
|
border-radius: 10000px;
|
|
71
|
-
z-index:
|
|
71
|
+
z-index: 99;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
position: absolute;
|
|
30
30
|
right: 8px;
|
|
31
31
|
bottom: 4px;
|
|
32
|
-
z-index:
|
|
32
|
+
z-index: 100;
|
|
33
33
|
transform: scale(0.5, 0.5);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
bottom: -32px;
|
|
48
48
|
right: -32px;
|
|
49
49
|
border-radius: 10000px;
|
|
50
|
-
z-index:
|
|
50
|
+
z-index: 99;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -169,7 +169,7 @@ var StickyFooter = (props) => {
|
|
|
169
169
|
onClick: props.onClick
|
|
170
170
|
}),
|
|
171
171
|
extraContent && extraContent,
|
|
172
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-wrap` }, type === "default" && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import__.Button, { icon: btnIcon, type: "primary", block: true, onClick: onBtnClick, disabled: btnDisabled }, buttonText)), type === "priceVariant" && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null,
|
|
172
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}-wrap` }, type === "default" && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import__.Button, { icon: btnIcon, type: "primary", block: true, onClick: onBtnClick, disabled: btnDisabled }, buttonText)), type === "priceVariant" && !hideAmount && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
173
173
|
import__.Amount,
|
|
174
174
|
{
|
|
175
175
|
titleType,
|
|
@@ -186,7 +186,7 @@ var StickyFooter = (props) => {
|
|
|
186
186
|
iconType
|
|
187
187
|
},
|
|
188
188
|
price
|
|
189
|
-
), !hideBtn && /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: "middle" }, showCancel, showPrevious, showBackPage, /* @__PURE__ */ import_react.default.createElement(import__.Button, { iconPosition, icon: btnIcon, disabled: btnDisabled, loading: btnLoading, type: "primary", onClick: onBtnClick }, buttonText)))),
|
|
189
|
+
), autoBreakPoint === DESKTOP && !hideBtn && /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: "middle" }, showCancel, showPrevious, showBackPage, /* @__PURE__ */ import_react.default.createElement(import__.Button, { iconPosition, icon: btnIcon, disabled: btnDisabled, loading: btnLoading, type: "primary", onClick: onBtnClick }, buttonText)), autoBreakPoint === MOBILE && /* @__PURE__ */ import_react.default.createElement(import__.Button, { icon: btnIcon, disabled: btnDisabled, loading: btnLoading, type: "primary", onClick: onBtnClick }, buttonText))),
|
|
190
190
|
children
|
|
191
191
|
);
|
|
192
192
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
@components: tabs;
|
|
4
4
|
|
|
5
|
-
.@{prefix}-equal-tabs {
|
|
5
|
+
.@{prefix}-@{components}-equal-tabs {
|
|
6
6
|
.@{prefix}-tabs-nav-list {
|
|
7
7
|
display: grid !important;
|
|
8
8
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.@{prefix}-item {
|
|
24
|
+
.@{prefix}-@{components}-item {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
box-sizing: border-box;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.@{prefix}-tab-btn {
|
|
31
|
+
.@{prefix}-@{components}-tab-btn {
|
|
32
32
|
text-align: center;
|
|
33
33
|
|
|
34
|
-
.@{prefix}-tab-icon {
|
|
34
|
+
.@{prefix}-@{components}-tab-icon {
|
|
35
35
|
margin: 0 !important;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.@{prefix}-fill>.@{prefix}-nav .@{prefix}-tab-focus {
|
|
39
|
+
.@{prefix}-@{components}-fill>.@{prefix}-@{components}-nav .@{prefix}-@{components}-tab-focus {
|
|
40
40
|
outline: none;
|
|
41
41
|
}
|
|
@@ -63,7 +63,4 @@ export { AlignTypes } from './ListItem';
|
|
|
63
63
|
export { default as Selector } from './Selector';
|
|
64
64
|
export { default as Checkbox } from './Checkbox';
|
|
65
65
|
export { default as Radio } from './Radio';
|
|
66
|
-
export { default as AppStyleWrapper } from './AppStyleWrapper';
|
|
67
|
-
export { default as Row } from './Row';
|
|
68
|
-
export { default as Col } from './Col';
|
|
69
66
|
export { default as GlobalTokenProvider } from './GlobalTokenProvider';
|
package/lib/components/index.js
CHANGED
|
@@ -35,13 +35,11 @@ __export(components_exports, {
|
|
|
35
35
|
AlignTypes: () => import_ListItem3.AlignTypes,
|
|
36
36
|
Amount: () => import_Amount.default,
|
|
37
37
|
AmountTitleTypes: () => import_Amount.AmountTitleTypes,
|
|
38
|
-
AppStyleWrapper: () => import_AppStyleWrapper.default,
|
|
39
38
|
BackImageEnum: () => import_Image2.BackImageEnum,
|
|
40
39
|
Button: () => import_Button.default,
|
|
41
40
|
Card: () => import_Card.default,
|
|
42
41
|
Checkbox: () => import_Checkbox.default,
|
|
43
42
|
Chip: () => import_Chip.default,
|
|
44
|
-
Col: () => import_Col.default,
|
|
45
43
|
Divider: () => import_Divider.default,
|
|
46
44
|
Drawer: () => import_Drawer.default,
|
|
47
45
|
DrawerTypeEnum: () => import_Drawer2.DrawerTypeEnum,
|
|
@@ -58,7 +56,6 @@ __export(components_exports, {
|
|
|
58
56
|
Navigation: () => import_Navigation.default,
|
|
59
57
|
Notification: () => import_Notification.default,
|
|
60
58
|
Radio: () => import_Radio.default,
|
|
61
|
-
Row: () => import_Row.default,
|
|
62
59
|
Search: () => import_Search.default,
|
|
63
60
|
Select: () => import_Select.default,
|
|
64
61
|
Selector: () => import_Selector.default,
|
|
@@ -118,7 +115,4 @@ var import_ListItem3 = require("./ListItem");
|
|
|
118
115
|
var import_Selector = __toESM(require("./Selector"));
|
|
119
116
|
var import_Checkbox = __toESM(require("./Checkbox"));
|
|
120
117
|
var import_Radio = __toESM(require("./Radio"));
|
|
121
|
-
var import_AppStyleWrapper = __toESM(require("./AppStyleWrapper"));
|
|
122
|
-
var import_Row = __toESM(require("./Row"));
|
|
123
|
-
var import_Col = __toESM(require("./Col"));
|
|
124
118
|
var import_GlobalTokenProvider = __toESM(require("./GlobalTokenProvider"));
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './style/themes/index.css';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export { default as tokenManager } from './utils/tokenManager';
|
|
4
|
-
export { useBreakPoint, useIsMobile, checkIsMobile
|
|
4
|
+
export { useBreakPoint, useIsMobile, checkIsMobile } from './utils/deviceType';
|
|
5
5
|
export * from './utils/themeContext';
|
package/lib/index.js
CHANGED
|
@@ -31,7 +31,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
checkIsMobile: () => import_deviceType.checkIsMobile,
|
|
34
|
-
isWebViewBelow90: () => import_deviceType.isWebViewBelow90,
|
|
35
34
|
tokenManager: () => import_tokenManager.default,
|
|
36
35
|
useBreakPoint: () => import_deviceType.useBreakPoint,
|
|
37
36
|
useIsMobile: () => import_deviceType.useIsMobile
|
|
@@ -12,18 +12,3 @@ export declare const checkIsMobile: () => boolean;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const useIsMobile: () => boolean;
|
|
14
14
|
export declare const useBreakPoint: () => "desktop" | "mobile" | null;
|
|
15
|
-
/**
|
|
16
|
-
* 获取 WebView 的版本号
|
|
17
|
-
* @returns {number|null} 返回 WebView 的版本号(整数),如果无法解析则返回 null
|
|
18
|
-
*/
|
|
19
|
-
export declare const getWebViewVersion: () => number | null;
|
|
20
|
-
/**
|
|
21
|
-
* 检测是否支持某个特性(例如 CSS 属性或 JavaScript API)
|
|
22
|
-
* @returns {boolean} 如果支持返回 true,否则返回 false
|
|
23
|
-
*/
|
|
24
|
-
export declare const isGapSupported: () => boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 检测 WebView 版本是否低于 90
|
|
27
|
-
* @returns {boolean} 如果版本低于 90 或无法检测到版本,则返回 true;否则返回 false
|
|
28
|
-
*/
|
|
29
|
-
export declare const isWebViewBelow90: () => boolean;
|
package/lib/utils/deviceType.js
CHANGED
|
@@ -20,9 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var deviceType_exports = {};
|
|
21
21
|
__export(deviceType_exports, {
|
|
22
22
|
checkIsMobile: () => checkIsMobile,
|
|
23
|
-
getWebViewVersion: () => getWebViewVersion,
|
|
24
|
-
isGapSupported: () => isGapSupported,
|
|
25
|
-
isWebViewBelow90: () => isWebViewBelow90,
|
|
26
23
|
useBreakPoint: () => useBreakPoint,
|
|
27
24
|
useIsMobile: () => useIsMobile
|
|
28
25
|
});
|
|
@@ -57,25 +54,3 @@ var useBreakPoint = () => {
|
|
|
57
54
|
}, []);
|
|
58
55
|
return breakpoint;
|
|
59
56
|
};
|
|
60
|
-
var getWebViewVersion = () => {
|
|
61
|
-
try {
|
|
62
|
-
const userAgent = (navigator == null ? void 0 : navigator.userAgent) || "";
|
|
63
|
-
const versionMatch = userAgent.match(/(Chrome|WebView)\/(\d+)/);
|
|
64
|
-
return versionMatch ? parseInt(versionMatch[2], 10) : null;
|
|
65
|
-
} catch (error) {
|
|
66
|
-
console.error("Error while parsing WebView version:", error);
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
var isGapSupported = () => {
|
|
71
|
-
const testElement = document.createElement("div");
|
|
72
|
-
testElement.style.gap = "1px";
|
|
73
|
-
return testElement.style.gap !== "";
|
|
74
|
-
};
|
|
75
|
-
var isWebViewBelow90 = () => {
|
|
76
|
-
const version = getWebViewVersion();
|
|
77
|
-
if (version !== null) {
|
|
78
|
-
return version < 90;
|
|
79
|
-
}
|
|
80
|
-
return !isGapSupported();
|
|
81
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digitalc/dxp-ui",
|
|
3
|
-
"version": "0.0.6
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "A UI library of Digitalc Design React Component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -132,4 +132,4 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
}
|
|
135
|
-
}
|
|
135
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleProvider, legacyLogicalPropertiesTransformer } from '@ant-design/cssinjs';
|
|
3
|
-
import { isWebViewBelow90 } from "../../utils";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
var AppStyleWrapper = function AppStyleWrapper(_ref) {
|
|
6
|
-
var children = _ref.children;
|
|
7
|
-
return /*#__PURE__*/_jsx(StyleProvider, {
|
|
8
|
-
transformers: isWebViewBelow90() ? [legacyLogicalPropertiesTransformer] : [],
|
|
9
|
-
hashPriority: isWebViewBelow90() ? "high" : "low",
|
|
10
|
-
children: children
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export default AppStyleWrapper;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "antd/es/config-provider/style";
|
|
2
|
-
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
import "antd/es/col/style";
|
|
5
|
-
import _Col from "antd/es/col";
|
|
6
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["children"];
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { cssClasses } from "../../constants";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
var Col = function Col(_ref) {
|
|
12
|
-
var children = _ref.children,
|
|
13
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
15
|
-
prefixCls: "".concat(cssClasses.PREFIX),
|
|
16
|
-
children: /*#__PURE__*/_jsx(_Col, _objectSpread(_objectSpread({}, props), {}, {
|
|
17
|
-
children: children
|
|
18
|
-
}))
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export default Col;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "antd/es/config-provider/style";
|
|
2
|
-
import _ConfigProvider from "antd/es/config-provider";
|
|
3
|
-
import "antd/es/row/style";
|
|
4
|
-
import _Row from "antd/es/row";
|
|
5
|
-
import "antd/es/col/style";
|
|
6
|
-
import _Col from "antd/es/col";
|
|
7
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
8
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["gutter", "children"];
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { isWebViewBelow90 } from "../../utils";
|
|
13
|
-
import { cssClasses } from "../../constants";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
var Row = function Row(_ref) {
|
|
16
|
-
var gutter = _ref.gutter,
|
|
17
|
-
children = _ref.children,
|
|
18
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
// 计算实际 gutter 值(仅处理数字和数组类型)
|
|
20
|
-
var _ref2 = function () {
|
|
21
|
-
if (!gutter) return [0, 0];
|
|
22
|
-
if (typeof gutter === 'number') return [gutter, 0];
|
|
23
|
-
if (Array.isArray(gutter)) return [gutter[0] || 0, gutter[1] || 0];
|
|
24
|
-
return [0, 0]; // 响应式 gutter 不处理补偿
|
|
25
|
-
}(),
|
|
26
|
-
_ref3 = _slicedToArray(_ref2, 2),
|
|
27
|
-
horizontalGutter = _ref3[0],
|
|
28
|
-
verticalGutter = _ref3[1];
|
|
29
|
-
|
|
30
|
-
// 为每个 Col 添加 padding 补偿
|
|
31
|
-
var wrappedChildren = React.Children.map(children, function (child) {
|
|
32
|
-
if (! /*#__PURE__*/React.isValidElement(child)) return child;
|
|
33
|
-
return /*#__PURE__*/_jsx(_Col, _objectSpread(_objectSpread({}, child.props), {}, {
|
|
34
|
-
style: _objectSpread({
|
|
35
|
-
paddingLeft: horizontalGutter / 2,
|
|
36
|
-
paddingRight: horizontalGutter / 2,
|
|
37
|
-
paddingBottom: verticalGutter
|
|
38
|
-
}, child.props.style)
|
|
39
|
-
}));
|
|
40
|
-
});
|
|
41
|
-
var prefix = "".concat(cssClasses.PREFIX);
|
|
42
|
-
console.log('isWebViewBelow90()', isWebViewBelow90());
|
|
43
|
-
if (isWebViewBelow90()) {
|
|
44
|
-
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
45
|
-
wave: {
|
|
46
|
-
disabled: true
|
|
47
|
-
},
|
|
48
|
-
prefixCls: prefix,
|
|
49
|
-
children: /*#__PURE__*/_jsx(_Row, _objectSpread(_objectSpread({
|
|
50
|
-
gutter: gutter
|
|
51
|
-
}, props), {}, {
|
|
52
|
-
children: wrappedChildren
|
|
53
|
-
}))
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
57
|
-
wave: {
|
|
58
|
-
disabled: true
|
|
59
|
-
},
|
|
60
|
-
prefixCls: prefix,
|
|
61
|
-
children: /*#__PURE__*/_jsx(_Row, _objectSpread(_objectSpread({
|
|
62
|
-
gutter: gutter
|
|
63
|
-
}, props), {}, {
|
|
64
|
-
children: children
|
|
65
|
-
}))
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export default Row;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/components/AppStyleWrapper/index.tsx
|
|
30
|
-
var AppStyleWrapper_exports = {};
|
|
31
|
-
__export(AppStyleWrapper_exports, {
|
|
32
|
-
default: () => AppStyleWrapper_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(AppStyleWrapper_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_cssinjs = require("@ant-design/cssinjs");
|
|
37
|
-
var import_utils = require("../../utils");
|
|
38
|
-
var AppStyleWrapper = ({ children }) => {
|
|
39
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
40
|
-
import_cssinjs.StyleProvider,
|
|
41
|
-
{
|
|
42
|
-
transformers: (0, import_utils.isWebViewBelow90)() ? [import_cssinjs.legacyLogicalPropertiesTransformer] : [],
|
|
43
|
-
hashPriority: (0, import_utils.isWebViewBelow90)() ? "high" : "low"
|
|
44
|
-
},
|
|
45
|
-
children
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
var AppStyleWrapper_default = AppStyleWrapper;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
var __export = (target, all) => {
|
|
34
|
-
for (var name in all)
|
|
35
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
36
|
-
};
|
|
37
|
-
var __copyProps = (to, from, except, desc) => {
|
|
38
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
-
for (let key of __getOwnPropNames(from))
|
|
40
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
41
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
42
|
-
}
|
|
43
|
-
return to;
|
|
44
|
-
};
|
|
45
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
46
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
47
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
48
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
49
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
50
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
51
|
-
mod
|
|
52
|
-
));
|
|
53
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
54
|
-
|
|
55
|
-
// src/components/Col/index.tsx
|
|
56
|
-
var Col_exports = {};
|
|
57
|
-
__export(Col_exports, {
|
|
58
|
-
default: () => Col_default
|
|
59
|
-
});
|
|
60
|
-
module.exports = __toCommonJS(Col_exports);
|
|
61
|
-
var import_react = __toESM(require("react"));
|
|
62
|
-
var import_antd = require("antd");
|
|
63
|
-
var import_constants = require("../../constants");
|
|
64
|
-
var Col = (_a) => {
|
|
65
|
-
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
-
import_antd.ConfigProvider,
|
|
68
|
-
{
|
|
69
|
-
prefixCls: `${import_constants.cssClasses.PREFIX}`
|
|
70
|
-
},
|
|
71
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Col, __spreadValues({}, props), children)
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
var Col_default = Col;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
|
-
var __export = (target, all) => {
|
|
37
|
-
for (var name in all)
|
|
38
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
-
};
|
|
40
|
-
var __copyProps = (to, from, except, desc) => {
|
|
41
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
-
for (let key of __getOwnPropNames(from))
|
|
43
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
-
}
|
|
46
|
-
return to;
|
|
47
|
-
};
|
|
48
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
49
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
50
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
51
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
52
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
53
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
54
|
-
mod
|
|
55
|
-
));
|
|
56
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
57
|
-
|
|
58
|
-
// src/components/Row/index.tsx
|
|
59
|
-
var Row_exports = {};
|
|
60
|
-
__export(Row_exports, {
|
|
61
|
-
default: () => Row_default
|
|
62
|
-
});
|
|
63
|
-
module.exports = __toCommonJS(Row_exports);
|
|
64
|
-
var import_react = __toESM(require("react"));
|
|
65
|
-
var import_antd = require("antd");
|
|
66
|
-
var import_utils = require("../../utils");
|
|
67
|
-
var import_constants = require("../../constants");
|
|
68
|
-
var Row = (_a) => {
|
|
69
|
-
var _b = _a, { gutter, children } = _b, props = __objRest(_b, ["gutter", "children"]);
|
|
70
|
-
const [horizontalGutter, verticalGutter] = (() => {
|
|
71
|
-
if (!gutter)
|
|
72
|
-
return [0, 0];
|
|
73
|
-
if (typeof gutter === "number")
|
|
74
|
-
return [gutter, 0];
|
|
75
|
-
if (Array.isArray(gutter))
|
|
76
|
-
return [gutter[0] || 0, gutter[1] || 0];
|
|
77
|
-
return [0, 0];
|
|
78
|
-
})();
|
|
79
|
-
const wrappedChildren = import_react.default.Children.map(children, (child) => {
|
|
80
|
-
if (!import_react.default.isValidElement(child))
|
|
81
|
-
return child;
|
|
82
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
83
|
-
import_antd.Col,
|
|
84
|
-
__spreadProps(__spreadValues({}, child.props), {
|
|
85
|
-
style: __spreadValues({
|
|
86
|
-
paddingLeft: horizontalGutter / 2,
|
|
87
|
-
paddingRight: horizontalGutter / 2,
|
|
88
|
-
paddingBottom: verticalGutter
|
|
89
|
-
}, child.props.style)
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
});
|
|
93
|
-
const prefix = `${import_constants.cssClasses.PREFIX}`;
|
|
94
|
-
console.log("isWebViewBelow90()", (0, import_utils.isWebViewBelow90)());
|
|
95
|
-
if ((0, import_utils.isWebViewBelow90)()) {
|
|
96
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
97
|
-
import_antd.ConfigProvider,
|
|
98
|
-
{
|
|
99
|
-
wave: { disabled: true },
|
|
100
|
-
prefixCls: prefix
|
|
101
|
-
},
|
|
102
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Row, __spreadValues({ gutter }, props), wrappedChildren)
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
106
|
-
import_antd.ConfigProvider,
|
|
107
|
-
{
|
|
108
|
-
wave: { disabled: true },
|
|
109
|
-
prefixCls: prefix
|
|
110
|
-
},
|
|
111
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Row, __spreadValues({ gutter }, props), children)
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
var Row_default = Row;
|