@power-xa/m-ui 0.0.1
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 +21 -0
- package/dist/ActionSheet/index.d.ts +16 -0
- package/dist/ActionSheet/index.js +79 -0
- package/dist/ActionSheet/index.less +39 -0
- package/dist/Breadcrumb/index.d.ts +14 -0
- package/dist/Breadcrumb/index.js +31 -0
- package/dist/Breadcrumb/index.less +28 -0
- package/dist/Button/index.d.ts +16 -0
- package/dist/Button/index.js +53 -0
- package/dist/Button/index.less +42 -0
- package/dist/ConfigProvider/index.d.ts +23 -0
- package/dist/ConfigProvider/index.js +41 -0
- package/dist/CreatorEdit/index.d.ts +12 -0
- package/dist/CreatorEdit/index.js +70 -0
- package/dist/CreatorEdit/index.less +41 -0
- package/dist/Drawer/index.d.ts +12 -0
- package/dist/Drawer/index.js +71 -0
- package/dist/Drawer/index.less +24 -0
- package/dist/Empty/index.d.ts +12 -0
- package/dist/Empty/index.js +18 -0
- package/dist/Empty/index.less +15 -0
- package/dist/FloatButton/index.d.ts +10 -0
- package/dist/FloatButton/index.js +60 -0
- package/dist/FloatButton/index.less +26 -0
- package/dist/Grid/index.d.ts +15 -0
- package/dist/Grid/index.js +26 -0
- package/dist/Grid/index.less +4 -0
- package/dist/PageContainer/index.d.ts +17 -0
- package/dist/PageContainer/index.js +50 -0
- package/dist/PageContainer/index.less +41 -0
- package/dist/Popup/index.d.ts +13 -0
- package/dist/Popup/index.js +65 -0
- package/dist/Popup/index.less +22 -0
- package/dist/ProForm/Field/index.d.ts +8 -0
- package/dist/ProForm/Field/index.js +33 -0
- package/dist/ProForm/Field/index.less +96 -0
- package/dist/ProForm/Form/index.d.ts +7 -0
- package/dist/ProForm/Form/index.js +145 -0
- package/dist/ProForm/Form/index.less +61 -0
- package/dist/ProForm/Group/index.d.ts +7 -0
- package/dist/ProForm/Group/index.js +73 -0
- package/dist/ProForm/Group/index.less +32 -0
- package/dist/ProForm/controls/Date/index.d.ts +3 -0
- package/dist/ProForm/controls/Date/index.js +141 -0
- package/dist/ProForm/controls/List/index.d.ts +23 -0
- package/dist/ProForm/controls/List/index.js +77 -0
- package/dist/ProForm/controls/List/index.less +53 -0
- package/dist/ProForm/controls/Select/index.d.ts +4 -0
- package/dist/ProForm/controls/Select/index.js +263 -0
- package/dist/ProForm/controls/Select/index.less +120 -0
- package/dist/ProForm/controls/Text/index.d.ts +4 -0
- package/dist/ProForm/controls/Text/index.js +29 -0
- package/dist/ProForm/controls/Text/index.less +7 -0
- package/dist/ProForm/controls/TextArea/index.d.ts +4 -0
- package/dist/ProForm/controls/TextArea/index.js +63 -0
- package/dist/ProForm/controls/TextArea/index.less +46 -0
- package/dist/ProForm/controls/Upload/index.d.ts +4 -0
- package/dist/ProForm/controls/Upload/index.js +383 -0
- package/dist/ProForm/controls/Upload/index.less +174 -0
- package/dist/ProForm/index.d.ts +9 -0
- package/dist/ProForm/index.js +5 -0
- package/dist/ProForm/typings.d.ts +164 -0
- package/dist/ProList/index.d.ts +78 -0
- package/dist/ProList/index.js +323 -0
- package/dist/ProList/index.less +318 -0
- package/dist/RefreshList/index.d.ts +17 -0
- package/dist/RefreshList/index.js +43 -0
- package/dist/RefreshList/index.less +19 -0
- package/dist/Skeleton/index.d.ts +5 -0
- package/dist/Skeleton/index.js +37 -0
- package/dist/Skeleton/index.less +7 -0
- package/dist/Tabbar/index.d.ts +13 -0
- package/dist/Tabbar/index.js +77 -0
- package/dist/Tabbar/index.less +44 -0
- package/dist/Tabs/index.d.ts +26 -0
- package/dist/Tabs/index.js +186 -0
- package/dist/Tabs/index.less +249 -0
- package/dist/assets/fonts/PingFangSC-Light.ttf +0 -0
- package/dist/assets/fonts/PingFangSC-Medium.ttf +0 -0
- package/dist/assets/fonts/PingFangSC-Regular.ttf +0 -0
- package/dist/assets/less/mixins.less +37 -0
- package/dist/global.less +0 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +27 -0
- package/dist/request/index.d.ts +8 -0
- package/dist/request/index.js +61 -0
- package/dist/services/FileController/index.d.ts +12 -0
- package/dist/services/FileController/index.js +39 -0
- package/dist/services/FileController/typings.d.ts +52 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +2 -0
- package/dist/services/typings.d.ts +25 -0
- package/dist/utils/tools.d.ts +33 -0
- package/dist/utils/tools.js +231 -0
- package/package.json +88 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
import { Text, View } from "@tarojs/components";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
var Empty = function Empty(_ref) {
|
|
5
|
+
var image = _ref.image,
|
|
6
|
+
_ref$description = _ref.description,
|
|
7
|
+
description = _ref$description === void 0 ? "暂无数据" : _ref$description,
|
|
8
|
+
children = _ref.children,
|
|
9
|
+
classNames = _ref.classNames,
|
|
10
|
+
styles = _ref.styles;
|
|
11
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
12
|
+
className: "p-empty-view-container ".concat(classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
13
|
+
style: styles === null || styles === void 0 ? void 0 : styles.root
|
|
14
|
+
}, children || /*#__PURE__*/React.createElement(Fragment, null, image && image, /*#__PURE__*/React.createElement(Text, {
|
|
15
|
+
className: "p-empty-text"
|
|
16
|
+
}, description)));
|
|
17
|
+
};
|
|
18
|
+
export default Empty;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@import "@power-xa/m-ui/dist/assets/less/mixins.less";
|
|
2
|
+
|
|
3
|
+
.p-empty-view-container {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
min-height: 20vh;
|
|
11
|
+
|
|
12
|
+
.p-empty-text {
|
|
13
|
+
.font(24, #999)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
type FloatButtonProps = {
|
|
4
|
+
size?: number;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
onTap?: () => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const FloatButton: FC<FloatButtonProps>;
|
|
10
|
+
export default FloatButton;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 React, { useEffect, useState } from "react";
|
|
8
|
+
import { createSelectorQuery } from "@tarojs/taro";
|
|
9
|
+
import { MovableArea, MovableView, View } from "@tarojs/components";
|
|
10
|
+
import { getUUID } from "../utils/tools";
|
|
11
|
+
import "./index.less";
|
|
12
|
+
var FloatButton = function FloatButton(_ref) {
|
|
13
|
+
var _ref$size = _ref.size,
|
|
14
|
+
size = _ref$size === void 0 ? 48 : _ref$size,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
onTap = _ref.onTap,
|
|
17
|
+
className = _ref.className;
|
|
18
|
+
var id = "p-moveable-area-".concat(getUUID());
|
|
19
|
+
var _useState = useState({
|
|
20
|
+
x: 0,
|
|
21
|
+
y: 0
|
|
22
|
+
}),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
position = _useState2[0],
|
|
25
|
+
setPosition = _useState2[1];
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
var query = createSelectorQuery();
|
|
28
|
+
query.selectAll("#".concat(id)).boundingClientRect(function (rect) {
|
|
29
|
+
if (rect instanceof Array) {
|
|
30
|
+
setPosition({
|
|
31
|
+
x: rect[0].width - size - 16,
|
|
32
|
+
y: rect[0].height - size - 90
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
setPosition({
|
|
36
|
+
x: rect.width - size - 16,
|
|
37
|
+
y: rect.height - size - 90
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}).exec();
|
|
41
|
+
}, []);
|
|
42
|
+
return /*#__PURE__*/React.createElement(MovableArea, {
|
|
43
|
+
className: "p-moveable-area ".concat(className),
|
|
44
|
+
id: id
|
|
45
|
+
}, (position.x !== 0 || position.y !== 0) && /*#__PURE__*/React.createElement(MovableView, {
|
|
46
|
+
className: "p-moveable-view",
|
|
47
|
+
direction: "all",
|
|
48
|
+
x: position.x,
|
|
49
|
+
y: position.y,
|
|
50
|
+
style: {
|
|
51
|
+
width: size + 'px',
|
|
52
|
+
height: size + 'px'
|
|
53
|
+
},
|
|
54
|
+
inertia: true,
|
|
55
|
+
onClick: onTap
|
|
56
|
+
}, children || /*#__PURE__*/React.createElement(View, {
|
|
57
|
+
className: "iconfont icon-icon-psp-xinjian"
|
|
58
|
+
})));
|
|
59
|
+
};
|
|
60
|
+
export default FloatButton;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.p-moveable-area {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
right: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
z-index: 999;
|
|
9
|
+
width: 100vw;
|
|
10
|
+
height: 100vh;
|
|
11
|
+
|
|
12
|
+
.p-moveable-view {
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
background: #333437;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
pointer-events: auto;
|
|
19
|
+
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.1), inset 4px 6px 8px 0px #242222;
|
|
20
|
+
|
|
21
|
+
.iconfont {
|
|
22
|
+
font-size: 36px;
|
|
23
|
+
color: #fff;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
type GridProps = {
|
|
4
|
+
dataSource: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}[];
|
|
7
|
+
column?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
renderItem: (data: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
gap?: number;
|
|
13
|
+
};
|
|
14
|
+
declare const Grid: FC<GridProps>;
|
|
15
|
+
export default Grid;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "@tarojs/components";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
var Grid = function Grid(_ref) {
|
|
5
|
+
var className = _ref.className,
|
|
6
|
+
dataSource = _ref.dataSource,
|
|
7
|
+
_ref$column = _ref.column,
|
|
8
|
+
column = _ref$column === void 0 ? 4 : _ref$column,
|
|
9
|
+
renderItem = _ref.renderItem,
|
|
10
|
+
_ref$gap = _ref.gap,
|
|
11
|
+
gap = _ref$gap === void 0 ? 24 : _ref$gap;
|
|
12
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
13
|
+
className: "p-grid-view ".concat(className),
|
|
14
|
+
style: {
|
|
15
|
+
rowGap: gap + 'px'
|
|
16
|
+
}
|
|
17
|
+
}, dataSource.map(function (item, index) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
key: 'p-grid-content-' + index,
|
|
20
|
+
style: {
|
|
21
|
+
width: 100 / column + "%"
|
|
22
|
+
}
|
|
23
|
+
}, renderItem(item));
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
export default Grid;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
type PageContainerProps = {
|
|
4
|
+
fixedHeader?: boolean;
|
|
5
|
+
header?: {
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
showBackBtn?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
content?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
disabledScroll?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const PageContainer: FC<PageContainerProps>;
|
|
17
|
+
export default PageContainer;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
import { getMenuButtonBoundingClientRect, navigateBack } from "@tarojs/taro";
|
|
3
|
+
import { ScrollView, Text, View } from "@tarojs/components";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
var PageContainer = function PageContainer(_ref) {
|
|
6
|
+
var _ref$fixedHeader = _ref.fixedHeader,
|
|
7
|
+
fixedHeader = _ref$fixedHeader === void 0 ? false : _ref$fixedHeader,
|
|
8
|
+
header = _ref.header,
|
|
9
|
+
children = _ref.children,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
disabledScroll = _ref.disabledScroll;
|
|
12
|
+
var _getMenuButtonBoundin = getMenuButtonBoundingClientRect(),
|
|
13
|
+
top = _getMenuButtonBoundin.top,
|
|
14
|
+
height = _getMenuButtonBoundin.height,
|
|
15
|
+
left = _getMenuButtonBoundin.left;
|
|
16
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
17
|
+
className: "p-page-container ".concat(className),
|
|
18
|
+
style: !fixedHeader ? {
|
|
19
|
+
paddingTop: top
|
|
20
|
+
} : {}
|
|
21
|
+
}, !fixedHeader && /*#__PURE__*/React.createElement(View, {
|
|
22
|
+
className: "p-page-header ".concat(header === null || header === void 0 ? void 0 : header.className),
|
|
23
|
+
style: {
|
|
24
|
+
height: height,
|
|
25
|
+
width: left
|
|
26
|
+
}
|
|
27
|
+
}, (header === null || header === void 0 ? void 0 : header.showBackBtn) && /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
className: "iconfont icon-icon-psp-fanhui",
|
|
29
|
+
onTap: function onTap() {
|
|
30
|
+
return navigateBack();
|
|
31
|
+
}
|
|
32
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
33
|
+
className: "p-page-header-content"
|
|
34
|
+
}, header !== null && header !== void 0 && header.name ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
35
|
+
className: "title"
|
|
36
|
+
}, header === null || header === void 0 ? void 0 : header.title), /*#__PURE__*/React.createElement(Text, {
|
|
37
|
+
className: "text"
|
|
38
|
+
}, header.name)) : (header === null || header === void 0 ? void 0 : header.content) || /*#__PURE__*/React.createElement(Text, {
|
|
39
|
+
className: "title"
|
|
40
|
+
}, header === null || header === void 0 ? void 0 : header.title))), disabledScroll ? /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
className: "p-page-content"
|
|
42
|
+
}, children) : /*#__PURE__*/React.createElement(ScrollView, {
|
|
43
|
+
scrollY: true,
|
|
44
|
+
enableFlex: true,
|
|
45
|
+
enhanced: true,
|
|
46
|
+
showScrollbar: false,
|
|
47
|
+
className: "p-page-content"
|
|
48
|
+
}, children));
|
|
49
|
+
};
|
|
50
|
+
export default PageContainer;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import "@power-xa/m-ui/dist/assets/less/mixins.less";
|
|
2
|
+
|
|
3
|
+
.p-page-container {
|
|
4
|
+
width: 100vw;
|
|
5
|
+
height: 100vh;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
|
|
10
|
+
.p-page-header {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding: 0 32px;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
gap: 16px;
|
|
16
|
+
|
|
17
|
+
.iconfont {
|
|
18
|
+
font-size: 28px;
|
|
19
|
+
color: #333437;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.p-page-header-content {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
|
|
26
|
+
.title {
|
|
27
|
+
.font(28, #333437, Regular, 500)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.text {
|
|
31
|
+
.font(24, #666)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.p-page-content {
|
|
37
|
+
margin-top: 20px;
|
|
38
|
+
height: 0;
|
|
39
|
+
flex: 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactElement } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
type PopupProps = {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
rootClassName?: string;
|
|
7
|
+
children?: (({ onOpenChange }: {
|
|
8
|
+
onOpenChange: () => void;
|
|
9
|
+
}) => ReactElement) | ReactElement;
|
|
10
|
+
height?: number;
|
|
11
|
+
};
|
|
12
|
+
declare const Popup: FC<PopupProps>;
|
|
13
|
+
export default Popup;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 React, { useEffect, useState } from "react";
|
|
8
|
+
import { RootPortal, View } from "@tarojs/components";
|
|
9
|
+
import "./index.less";
|
|
10
|
+
var Popup = function Popup(_ref) {
|
|
11
|
+
var open = _ref.open,
|
|
12
|
+
onOpenChange = _ref.onOpenChange,
|
|
13
|
+
rootClassName = _ref.rootClassName,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
_ref$height = _ref.height,
|
|
16
|
+
height = _ref$height === void 0 ? 85 : _ref$height;
|
|
17
|
+
var _useState = useState("translateY(100vh)"),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
transform = _useState2[0],
|
|
20
|
+
setTransform = _useState2[1];
|
|
21
|
+
var _useState3 = useState(false),
|
|
22
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
23
|
+
show = _useState4[0],
|
|
24
|
+
setShow = _useState4[1];
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
var timer = setTimeout(function () {
|
|
27
|
+
setShow(open || false);
|
|
28
|
+
clearTimeout(timer);
|
|
29
|
+
}, 100);
|
|
30
|
+
}, [open]);
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (show !== open) {
|
|
33
|
+
var timer = setTimeout(function () {
|
|
34
|
+
onOpenChange === null || onOpenChange === void 0 || onOpenChange(show);
|
|
35
|
+
clearTimeout(timer);
|
|
36
|
+
}, 300);
|
|
37
|
+
}
|
|
38
|
+
}, [show]);
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
setTransform(show ? "translateY(".concat(100 - height, "vh)") : "translateY(100vh)");
|
|
41
|
+
}, [show]);
|
|
42
|
+
return /*#__PURE__*/React.createElement(RootPortal, null, /*#__PURE__*/React.createElement(View, {
|
|
43
|
+
className: "p-popup-mask ".concat(rootClassName),
|
|
44
|
+
style: {
|
|
45
|
+
display: open ? "block" : "none"
|
|
46
|
+
},
|
|
47
|
+
onTap: function onTap() {
|
|
48
|
+
return setShow(false);
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
51
|
+
className: "p-popup-container",
|
|
52
|
+
style: {
|
|
53
|
+
transform: transform,
|
|
54
|
+
height: height + "vh"
|
|
55
|
+
},
|
|
56
|
+
onClick: function onClick(e) {
|
|
57
|
+
return e.stopPropagation();
|
|
58
|
+
}
|
|
59
|
+
}, typeof children === "function" ? children === null || children === void 0 ? void 0 : children({
|
|
60
|
+
onOpenChange: function onOpenChange() {
|
|
61
|
+
return setShow(false);
|
|
62
|
+
}
|
|
63
|
+
}) : children)));
|
|
64
|
+
};
|
|
65
|
+
export default Popup;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.p-popup-mask {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
background: rgba(51, 52, 55, 0.70);
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: flex-end;
|
|
11
|
+
|
|
12
|
+
.p-popup-container {
|
|
13
|
+
width: 100vw;
|
|
14
|
+
background: #fff;
|
|
15
|
+
transform: translateY(100vh);
|
|
16
|
+
transition: .3s;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
border-radius: 32px 32px 0 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactElement } from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
type ProFormFieldProps = ProFormAPI.ProFormItemProps & {
|
|
4
|
+
extra?: ReactElement | false;
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
};
|
|
7
|
+
declare const ProFormField: FC<ProFormFieldProps>;
|
|
8
|
+
export default ProFormField;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text, View } from "@tarojs/components";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
var ProFormField = function ProFormField(props) {
|
|
5
|
+
var _props$className = props.className,
|
|
6
|
+
className = _props$className === void 0 ? "" : _props$className,
|
|
7
|
+
label = props.label,
|
|
8
|
+
extra = props.extra,
|
|
9
|
+
required = props.required,
|
|
10
|
+
_props$rules = props.rules,
|
|
11
|
+
rules = _props$rules === void 0 ? [] : _props$rules,
|
|
12
|
+
_props$layout = props.layout,
|
|
13
|
+
layout = _props$layout === void 0 ? "horizontal" : _props$layout,
|
|
14
|
+
children = props.children,
|
|
15
|
+
hiddenBorder = props.hiddenBorder,
|
|
16
|
+
hidden = props.hidden;
|
|
17
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
18
|
+
className: "p-pro-form-item ".concat(className, " ").concat(layout, " ").concat(hiddenBorder ? 'p-pro-form-item-hidden-border' : '', " ").concat(hidden ? 'hidden' : '')
|
|
19
|
+
}, label && /*#__PURE__*/React.createElement(View, {
|
|
20
|
+
className: "p-pro-form-item-header"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
22
|
+
className: "p-pro-form-item-label"
|
|
23
|
+
}, (required || rules.some(function (r) {
|
|
24
|
+
return r.required;
|
|
25
|
+
})) && /*#__PURE__*/React.createElement(Text, {
|
|
26
|
+
className: "p-pro-form-item-label-required"
|
|
27
|
+
}, "*"), /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
className: "p-pro-form-item-label-text"
|
|
29
|
+
}, label)), extra), /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
className: "p-pro-form-item-control"
|
|
31
|
+
}, children));
|
|
32
|
+
};
|
|
33
|
+
export default ProFormField;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@import "@power-xa/m-ui/dist/assets/less/mixins.less";
|
|
2
|
+
|
|
3
|
+
.p-pro-form-item {
|
|
4
|
+
margin: 0 32px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
border-bottom: 1px solid #E5E5E5;
|
|
7
|
+
background: #FFF;
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: 24px;
|
|
10
|
+
|
|
11
|
+
.p-pro-form-item-header {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
|
|
16
|
+
.p-pro-form-item-label {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
.p-pro-form-item-label-required {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: -4px;
|
|
24
|
+
left: -18px;
|
|
25
|
+
.font(28, #ED5349);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.p-pro-form-item-label-text {
|
|
29
|
+
.font(28, #333437)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.p-pro-form-item-placeholder {
|
|
35
|
+
display: block;
|
|
36
|
+
width: 100%;
|
|
37
|
+
text-align: right;
|
|
38
|
+
.font(28, #999);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.p-pro-form-item-value,
|
|
42
|
+
.p-pro-form-item-control-disabled {
|
|
43
|
+
width: 100%;
|
|
44
|
+
text-align: right;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
display: block;
|
|
49
|
+
.font(28, #333437);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.horizontal {
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
align-items: center;
|
|
55
|
+
padding: 36px 0;
|
|
56
|
+
|
|
57
|
+
.p-pro-form-item-control {
|
|
58
|
+
flex: 1;
|
|
59
|
+
width: 0;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: flex-end;
|
|
63
|
+
|
|
64
|
+
.p-pro-form-item-control-picker {
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.vertical {
|
|
71
|
+
padding: 24px 0;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
align-items: flex-start;
|
|
74
|
+
|
|
75
|
+
.p-pro-form-item-header {
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.p-pro-form-item-control {
|
|
80
|
+
width: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.p-pro-form-item-control-disabled {
|
|
84
|
+
text-align: left;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.p-pro-form-item-hidden-border {
|
|
89
|
+
border-bottom: 0;
|
|
90
|
+
padding-bottom: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.hidden {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
}
|