@yup/taro-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/LICENSE +21 -0
- package/README.md +3 -0
- package/es/_virtual/_commonjsHelpers.js +3 -0
- package/es/_virtual/_rollupPluginBabelHelpers.js +120 -0
- package/es/_virtual/index.js +1 -0
- package/es/_virtual/jsx-runtime.js +1 -0
- package/es/_virtual/react-jsx-runtime.development.js +1 -0
- package/es/_virtual/react-jsx-runtime.production.min.js +1 -0
- package/es/components/button/index.d.ts +19 -0
- package/es/components/button/index.js +35 -0
- package/es/components/button/style/button.css +3 -0
- package/es/components/button/style/button.less +3 -0
- package/es/components/button/style/css.js +1 -0
- package/es/components/button/style/index.css +67 -0
- package/es/components/button/style/index.d.ts +1 -0
- package/es/components/button/style/index.js +1 -0
- package/es/components/button/style/index.less +81 -0
- package/es/components/checkbox/checkbox-group.d.ts +10 -0
- package/es/components/checkbox/checkbox-group.js +12 -0
- package/es/components/checkbox/index.d.ts +13 -0
- package/es/components/checkbox/index.js +23 -0
- package/es/components/checkbox/style/css.js +1 -0
- package/es/components/checkbox/style/index.css +45 -0
- package/es/components/checkbox/style/index.d.ts +1 -0
- package/es/components/checkbox/style/index.js +1 -0
- package/es/components/checkbox/style/index.less +59 -0
- package/es/components/form/form-item.d.ts +10 -0
- package/es/components/form/form-item.js +14 -0
- package/es/components/form/index.d.ts +15 -0
- package/es/components/form/index.js +18 -0
- package/es/components/form/style/css.js +1 -0
- package/es/components/form/style/index.css +33 -0
- package/es/components/form/style/index.d.ts +1 -0
- package/es/components/form/style/index.js +1 -0
- package/es/components/form/style/index.less +51 -0
- package/es/components/input/index.d.ts +22 -0
- package/es/components/input/index.js +57 -0
- package/es/components/input/style/css.js +1 -0
- package/es/components/input/style/index.css +30 -0
- package/es/components/input/style/index.d.ts +1 -0
- package/es/components/input/style/index.js +1 -0
- package/es/components/input/style/index.less +36 -0
- package/es/components/radio/index.d.ts +13 -0
- package/es/components/radio/index.js +18 -0
- package/es/components/radio/radio-group.d.ts +10 -0
- package/es/components/radio/radio-group.js +16 -0
- package/es/components/radio/style/css.js +2 -0
- package/es/components/radio/style/group.css +12 -0
- package/es/components/radio/style/group.less +12 -0
- package/es/components/radio/style/index.d.ts +2 -0
- package/es/components/radio/style/index.js +2 -0
- package/es/components/radio/style/radio.css +28 -0
- package/es/components/radio/style/radio.less +32 -0
- package/es/components/toast/index.d.ts +2 -0
- package/es/components/toast/index.js +1 -0
- package/es/components/toast/style/css.js +1 -0
- package/es/components/toast/style/index.css +22 -0
- package/es/components/toast/style/index.d.ts +1 -0
- package/es/components/toast/style/index.js +1 -0
- package/es/components/toast/style/index.less +23 -0
- package/es/components/toast/toast.d.ts +18 -0
- package/es/components/toast/toast.js +89 -0
- package/es/components/toast/withToast.d.ts +2 -0
- package/es/components/toast/withToast.js +9 -0
- package/es/global/global.less +1 -0
- package/es/global/index.d.ts +1 -0
- package/es/global/theme-default.less +37 -0
- package/es/global.css +20 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +2 -0
- package/es/node_modules/classnames/index.js +56 -0
- package/es/node_modules/react/cjs/react-jsx-runtime.development.js +1137 -0
- package/es/node_modules/react/cjs/react-jsx-runtime.production.min.js +48 -0
- package/es/node_modules/react/jsx-runtime.js +6 -0
- package/es/utils/debounce.d.ts +1 -0
- package/es/utils/is.d.ts +7 -0
- package/es/utils/is.js +9 -0
- package/es/utils/react.d.ts +2 -0
- package/es/utils/throttle.d.ts +4 -0
- package/es/utils/tool.d.ts +4 -0
- package/package.json +127 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
function _arrayLikeToArray(r, a) {
|
|
2
|
+
(null == a || a > r.length) && (a = r.length);
|
|
3
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4
|
+
return n;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithHoles(r) {
|
|
7
|
+
if (Array.isArray(r)) return r;
|
|
8
|
+
}
|
|
9
|
+
function _defineProperty(e, r, t) {
|
|
10
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
11
|
+
value: t,
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
configurable: !0,
|
|
14
|
+
writable: !0
|
|
15
|
+
}) : e[r] = t, e;
|
|
16
|
+
}
|
|
17
|
+
function _iterableToArrayLimit(r, l) {
|
|
18
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
19
|
+
if (null != t) {
|
|
20
|
+
var e,
|
|
21
|
+
n,
|
|
22
|
+
i,
|
|
23
|
+
u,
|
|
24
|
+
a = [],
|
|
25
|
+
f = !0,
|
|
26
|
+
o = !1;
|
|
27
|
+
try {
|
|
28
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
29
|
+
if (Object(t) !== t) return;
|
|
30
|
+
f = !1;
|
|
31
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
32
|
+
} catch (r) {
|
|
33
|
+
o = !0, n = r;
|
|
34
|
+
} finally {
|
|
35
|
+
try {
|
|
36
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
37
|
+
} finally {
|
|
38
|
+
if (o) throw n;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return a;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function _nonIterableRest() {
|
|
45
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
46
|
+
}
|
|
47
|
+
function ownKeys(e, r) {
|
|
48
|
+
var t = Object.keys(e);
|
|
49
|
+
if (Object.getOwnPropertySymbols) {
|
|
50
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
51
|
+
r && (o = o.filter(function (r) {
|
|
52
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
53
|
+
})), t.push.apply(t, o);
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
}
|
|
57
|
+
function _objectSpread2(e) {
|
|
58
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
59
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
60
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
61
|
+
_defineProperty(e, r, t[r]);
|
|
62
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
63
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return e;
|
|
67
|
+
}
|
|
68
|
+
function _objectWithoutProperties(e, t) {
|
|
69
|
+
if (null == e) return {};
|
|
70
|
+
var o,
|
|
71
|
+
r,
|
|
72
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
73
|
+
if (Object.getOwnPropertySymbols) {
|
|
74
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
75
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
76
|
+
}
|
|
77
|
+
return i;
|
|
78
|
+
}
|
|
79
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
80
|
+
if (null == r) return {};
|
|
81
|
+
var t = {};
|
|
82
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
83
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
84
|
+
t[n] = r[n];
|
|
85
|
+
}
|
|
86
|
+
return t;
|
|
87
|
+
}
|
|
88
|
+
function _slicedToArray(r, e) {
|
|
89
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
90
|
+
}
|
|
91
|
+
function _toPrimitive(t, r) {
|
|
92
|
+
if ("object" != typeof t || !t) return t;
|
|
93
|
+
var e = t[Symbol.toPrimitive];
|
|
94
|
+
if (void 0 !== e) {
|
|
95
|
+
var i = e.call(t, r || "default");
|
|
96
|
+
if ("object" != typeof i) return i;
|
|
97
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
98
|
+
}
|
|
99
|
+
return ("string" === r ? String : Number)(t);
|
|
100
|
+
}
|
|
101
|
+
function _toPropertyKey(t) {
|
|
102
|
+
var i = _toPrimitive(t, "string");
|
|
103
|
+
return "symbol" == typeof i ? i : i + "";
|
|
104
|
+
}
|
|
105
|
+
function _typeof(o) {
|
|
106
|
+
"@babel/helpers - typeof";
|
|
107
|
+
|
|
108
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
109
|
+
return typeof o;
|
|
110
|
+
} : function (o) {
|
|
111
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
112
|
+
}, _typeof(o);
|
|
113
|
+
}
|
|
114
|
+
function _unsupportedIterableToArray(r, a) {
|
|
115
|
+
if (r) {
|
|
116
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
117
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
118
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
119
|
+
}
|
|
120
|
+
}export{_arrayLikeToArray as arrayLikeToArray,_arrayWithHoles as arrayWithHoles,_defineProperty as defineProperty,_iterableToArrayLimit as iterableToArrayLimit,_nonIterableRest as nonIterableRest,_objectSpread2 as objectSpread2,_objectWithoutProperties as objectWithoutProperties,_objectWithoutPropertiesLoose as objectWithoutPropertiesLoose,_slicedToArray as slicedToArray,_toPrimitive as toPrimitive,_toPropertyKey as toPropertyKey,_typeof as typeof,_unsupportedIterableToArray as unsupportedIterableToArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var classnames = {exports: {}};export{classnames as __module};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var jsxRuntime = {exports: {}};export{jsxRuntime as __module};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var reactJsxRuntime_development = {};export{reactJsxRuntime_development as __exports};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var reactJsxRuntime_production_min = {};export{reactJsxRuntime_production_min as __exports};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonProps as TaroButtonProps } from '@tarojs/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ButtonProps extends Omit<TaroButtonProps, 'type'> {
|
|
4
|
+
/**
|
|
5
|
+
* 按钮样式类型
|
|
6
|
+
*/
|
|
7
|
+
styleType?: 'primary' | 'default' | 'secondary';
|
|
8
|
+
/**
|
|
9
|
+
* 是否启用禁用样式(启用禁用样式按钮依然可以点击和disabled有区别 只是样式支持)
|
|
10
|
+
*/
|
|
11
|
+
disabledStyle?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 是否块级标签
|
|
14
|
+
*/
|
|
15
|
+
block?: boolean;
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const Button: React.FC<ButtonProps>;
|
|
19
|
+
export default Button;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {objectWithoutProperties as _objectWithoutProperties,objectSpread2 as _objectSpread2}from'../../_virtual/_rollupPluginBabelHelpers.js';import {j as jsxRuntimeExports}from'../../node_modules/react/jsx-runtime.js';import {Button as Button$1,Text}from'@tarojs/components';import cns from'../../node_modules/classnames/index.js';var _excluded = ["children", "styleType", "className", "block", "disabled", "disabledStyle", "icon"];
|
|
2
|
+
var Button = function Button(_ref) {
|
|
3
|
+
var children = _ref.children,
|
|
4
|
+
_ref$styleType = _ref.styleType,
|
|
5
|
+
styleType = _ref$styleType === void 0 ? 'default' : _ref$styleType,
|
|
6
|
+
className = _ref.className,
|
|
7
|
+
block = _ref.block,
|
|
8
|
+
disabled = _ref.disabled,
|
|
9
|
+
disabledStyle = _ref.disabledStyle,
|
|
10
|
+
icon = _ref.icon,
|
|
11
|
+
rst = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
return jsxRuntimeExports.jsx(Button$1, _objectSpread2(_objectSpread2({
|
|
13
|
+
className: cns('ypmini-taro-button', {
|
|
14
|
+
'ypmini-taro-button-primary': styleType === 'primary',
|
|
15
|
+
'ypmini-taro-button-primary-disabled': styleType === 'primary' && (disabled || disabledStyle),
|
|
16
|
+
'ypmini-taro-button-secondary': styleType === 'secondary',
|
|
17
|
+
'ypmini-taro-button-secondary-disabled': styleType === 'secondary' && (disabled || disabledStyle),
|
|
18
|
+
'ypmini-taro-button-default': styleType === 'default',
|
|
19
|
+
'ypmini-taro-button-default-disabled': styleType === 'default' && (disabled || disabledStyle),
|
|
20
|
+
'ypmini-taro-button-block': block
|
|
21
|
+
}, className),
|
|
22
|
+
disabled: disabled
|
|
23
|
+
}, rst), {}, {
|
|
24
|
+
children: icon ? jsxRuntimeExports.jsxs(Text, {
|
|
25
|
+
className: "ypmini-taro-button-icon-wrapper",
|
|
26
|
+
children: [jsxRuntimeExports.jsx(Text, {
|
|
27
|
+
className: 'ypmini-taro-button-icon',
|
|
28
|
+
children: icon
|
|
29
|
+
}), jsxRuntimeExports.jsx(Text, {
|
|
30
|
+
className: "ypmini-taro-button-icon-content",
|
|
31
|
+
children: children
|
|
32
|
+
})]
|
|
33
|
+
}) : children
|
|
34
|
+
}));
|
|
35
|
+
};export{Button as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--border-radius: 8px;
|
|
3
|
+
--button-height: 48px;
|
|
4
|
+
--default-button-background: #f5f7fc;
|
|
5
|
+
--default-button-text-color: rgba(0, 0, 0, 0.65);
|
|
6
|
+
--primary-button-background: var(--yp-color-primary);
|
|
7
|
+
--primary-button-disabled-background: #99d3ff;
|
|
8
|
+
--primary-button-disabled-text-color: rgba(255, 255, 255, 0.45);
|
|
9
|
+
--primary-button-text-color: #fff;
|
|
10
|
+
--secondary-button-background: #00cbff;
|
|
11
|
+
--secondary-button-text-color: #ffffff;
|
|
12
|
+
}
|
|
13
|
+
.ypmini-taro-button {
|
|
14
|
+
padding: 0px 24px;
|
|
15
|
+
border: unset;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
font-size: 17px;
|
|
18
|
+
width: auto;
|
|
19
|
+
height: var(--button-height);
|
|
20
|
+
line-height: var(--button-height);
|
|
21
|
+
color: var(--yp-color-text);
|
|
22
|
+
border-radius: var(--border-radius);
|
|
23
|
+
display: inline-block;
|
|
24
|
+
}
|
|
25
|
+
.ypmini-taro-button:after {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
.ypmini-taro-button-primary {
|
|
29
|
+
background: var(--primary-button-background);
|
|
30
|
+
color: var(--primary-button-text-color);
|
|
31
|
+
}
|
|
32
|
+
.ypmini-taro-button-primary.ypmini-taro-button-primary-disabled {
|
|
33
|
+
color: var(--primary-button-disabled-text-color);
|
|
34
|
+
background: var(--primary-button-disabled-background);
|
|
35
|
+
}
|
|
36
|
+
.ypmini-taro-button-default {
|
|
37
|
+
background: var(--default-button-background);
|
|
38
|
+
color: var(--default-button-text-color);
|
|
39
|
+
}
|
|
40
|
+
.ypmini-taro-button-default.ypmini-taro-button-default-disabled {
|
|
41
|
+
opacity: 0.6;
|
|
42
|
+
}
|
|
43
|
+
.ypmini-taro-button-default.ypmini-taro-button-default-disabled.ypmini-taro-button-default.ypmini-taro-button-default-disabled[disabled] {
|
|
44
|
+
color: var(--default-button-text-color);
|
|
45
|
+
}
|
|
46
|
+
.ypmini-taro-button-secondary {
|
|
47
|
+
background: var(--secondary-button-background);
|
|
48
|
+
color: var(--secondary-button-text-color);
|
|
49
|
+
}
|
|
50
|
+
.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled {
|
|
51
|
+
opacity: 0.6;
|
|
52
|
+
}
|
|
53
|
+
.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled[disabled] {
|
|
54
|
+
color: var(--secondary-button-text-color);
|
|
55
|
+
}
|
|
56
|
+
.ypmini-taro-button-block {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
.ypmini-taro-button-icon-wrapper {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
}
|
|
63
|
+
.ypmini-taro-button-icon {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
margin-right: 4px;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--border-radius: 8px;
|
|
3
|
+
--button-height: 48px;
|
|
4
|
+
--default-button-background: rgba(245, 247, 252, 1);
|
|
5
|
+
--default-button-text-color: rgba(0, 0, 0, 0.65);
|
|
6
|
+
|
|
7
|
+
--primary-button-background: var(--yp-color-primary);
|
|
8
|
+
--primary-button-disabled-background: rgba(153, 211, 255, 1);
|
|
9
|
+
--primary-button-disabled-text-color: rgba(255, 255, 255, 0.45);
|
|
10
|
+
--primary-button-text-color: #fff;
|
|
11
|
+
|
|
12
|
+
--secondary-button-background: rgba(0, 203, 255, 1);
|
|
13
|
+
--secondary-button-text-color: rgba(255, 255, 255, 1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ypmini-taro-button {
|
|
17
|
+
|
|
18
|
+
padding: 0px 24px;
|
|
19
|
+
border: unset;
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
font-size: 17px;
|
|
22
|
+
width: auto;
|
|
23
|
+
height: var(--button-height);
|
|
24
|
+
line-height: var(--button-height);
|
|
25
|
+
color: var(--yp-color-text);
|
|
26
|
+
border-radius: var(--border-radius);
|
|
27
|
+
display: inline-block;
|
|
28
|
+
|
|
29
|
+
&:after {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:not([disabled]):active {
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&-primary {
|
|
38
|
+
background: var(--primary-button-background);
|
|
39
|
+
color: var(--primary-button-text-color);
|
|
40
|
+
|
|
41
|
+
&&-disabled {
|
|
42
|
+
color: var(--primary-button-disabled-text-color);
|
|
43
|
+
background: var(--primary-button-disabled-background);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
&-default {
|
|
47
|
+
background: var(--default-button-background);
|
|
48
|
+
color: var(--default-button-text-color);
|
|
49
|
+
&&-disabled {
|
|
50
|
+
opacity: 0.6;
|
|
51
|
+
&&[disabled] {
|
|
52
|
+
color: var(--default-button-text-color);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&-secondary {
|
|
58
|
+
background: var(--secondary-button-background);
|
|
59
|
+
color: var(--secondary-button-text-color);
|
|
60
|
+
&&-disabled {
|
|
61
|
+
opacity: 0.6;
|
|
62
|
+
&&[disabled] {
|
|
63
|
+
color: var(--secondary-button-text-color);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-block {
|
|
69
|
+
display: block;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&-icon-wrapper {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
}
|
|
76
|
+
&-icon {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
margin-right: 4px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckboxGroupProps as YpCheckboxGroupProps } from '@yup/taro-checkbox/dist/types/type';
|
|
3
|
+
export interface CheckboxGroupProps extends YpCheckboxGroupProps {
|
|
4
|
+
/**
|
|
5
|
+
* 多选类型
|
|
6
|
+
*/
|
|
7
|
+
type?: 'button' | 'default';
|
|
8
|
+
}
|
|
9
|
+
declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
|
|
10
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {objectWithoutProperties as _objectWithoutProperties,objectSpread2 as _objectSpread2}from'../../_virtual/_rollupPluginBabelHelpers.js';import {j as jsxRuntimeExports}from'../../node_modules/react/jsx-runtime.js';import cns from'../../node_modules/classnames/index.js';import YpCheckbox from'@yup/taro-checkbox';var _excluded = ["type", "block"];
|
|
2
|
+
var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
3
|
+
var type = _ref.type,
|
|
4
|
+
block = _ref.block,
|
|
5
|
+
rst = _objectWithoutProperties(_ref, _excluded);
|
|
6
|
+
return jsxRuntimeExports.jsx(YpCheckbox.Group, _objectSpread2({
|
|
7
|
+
className: cns("ypmini-checkbox-group", {
|
|
8
|
+
"ypmini-checkbox-group-button": type === 'button',
|
|
9
|
+
"ypmini-checkbox-group-block": block
|
|
10
|
+
})
|
|
11
|
+
}, rst));
|
|
12
|
+
};export{CheckboxGroup as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckboxProps as YpCheckboxProps } from '@yup/taro-checkbox/dist/types/type';
|
|
3
|
+
import CheckboxGroup from './checkbox-group';
|
|
4
|
+
export interface CheckboxProps extends YpCheckboxProps {
|
|
5
|
+
/**
|
|
6
|
+
* 多选类型
|
|
7
|
+
*/
|
|
8
|
+
type?: 'button' | 'default';
|
|
9
|
+
}
|
|
10
|
+
declare const Checkbox: React.FC<CheckboxProps> & {
|
|
11
|
+
Group: typeof CheckboxGroup;
|
|
12
|
+
};
|
|
13
|
+
export default Checkbox;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {objectWithoutProperties as _objectWithoutProperties,objectSpread2 as _objectSpread2}from'../../_virtual/_rollupPluginBabelHelpers.js';import {j as jsxRuntimeExports}from'../../node_modules/react/jsx-runtime.js';import cns from'../../node_modules/classnames/index.js';import {View}from'@tarojs/components';import YpCheckbox from'@yup/taro-checkbox';import CheckboxGroup from'./checkbox-group.js';var _excluded = ["className", "children", "type"];
|
|
2
|
+
var Checkbox = function Checkbox(_ref) {
|
|
3
|
+
var className = _ref.className,
|
|
4
|
+
children = _ref.children,
|
|
5
|
+
_ref$type = _ref.type,
|
|
6
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
7
|
+
rst = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
+
return jsxRuntimeExports.jsx(YpCheckbox, _objectSpread2({
|
|
9
|
+
className: cns("ypmini-checkbox", className),
|
|
10
|
+
icon: function icon(checked) {
|
|
11
|
+
if (type === 'button') {
|
|
12
|
+
return jsxRuntimeExports.jsx(View, {
|
|
13
|
+
className: cns("ypmini-checkbox-button", {
|
|
14
|
+
"ypmini-checkbox-button-checked": checked
|
|
15
|
+
}),
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return children;
|
|
20
|
+
}
|
|
21
|
+
}, rst));
|
|
22
|
+
};
|
|
23
|
+
Checkbox.Group = CheckboxGroup;export{Checkbox as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--checkbox-button-font-size: 17px;
|
|
3
|
+
--checkbox-button-border-radius: 8px;
|
|
4
|
+
--checkbox-button-background-color: #f5f7fc;
|
|
5
|
+
--checkbox-button-text-color: #000000d9;
|
|
6
|
+
--checkbox-button-checked-background-color: #e0f3ff;
|
|
7
|
+
--checkbox-button-checked-text-color: var(--yp-color-primary);
|
|
8
|
+
--checkbox-button-checked-border-color: var(--yp-color-primary);
|
|
9
|
+
--checkbox-button-height: 52px;
|
|
10
|
+
}
|
|
11
|
+
.ypmini-checkbox-button {
|
|
12
|
+
background-color: var(--checkbox-button-background-color);
|
|
13
|
+
color: var(--checkbox-button-text-color);
|
|
14
|
+
font-size: var(--checkbox-button-font-size);
|
|
15
|
+
text-align: center;
|
|
16
|
+
padding: 0px 16px;
|
|
17
|
+
height: var(--checkbox-button-height);
|
|
18
|
+
line-height: var(--checkbox-button-height);
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
border-radius: var(--checkbox-button-border-radius);
|
|
21
|
+
}
|
|
22
|
+
.ypmini-checkbox-button-checked {
|
|
23
|
+
background-color: var(--checkbox-button-checked-background-color);
|
|
24
|
+
color: var(--checkbox-button-checked-text-color);
|
|
25
|
+
border-color: var(--checkbox-button-checked-border-color);
|
|
26
|
+
border-width: 1px;
|
|
27
|
+
border-style: solid;
|
|
28
|
+
}
|
|
29
|
+
.ypmini-checkbox-group {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
}
|
|
34
|
+
.ypmini-checkbox-group.ypmini-checkbox-group-block {
|
|
35
|
+
display: block;
|
|
36
|
+
margin-top: 0px;
|
|
37
|
+
}
|
|
38
|
+
.ypmini-checkbox-group.ypmini-checkbox-group-block .ypmini-checkbox:not(:first-child) {
|
|
39
|
+
margin-top: 12px;
|
|
40
|
+
margin-left: 0px;
|
|
41
|
+
}
|
|
42
|
+
.ypmini-checkbox-group .ypmini-checkbox:not(:first-child) {
|
|
43
|
+
margin-left: 12px;
|
|
44
|
+
margin-top: 0px;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--checkbox-button-font-size: 17px;
|
|
3
|
+
--checkbox-button-border-radius: 8px;
|
|
4
|
+
--checkbox-button-background-color: #f5f7fc;
|
|
5
|
+
--checkbox-button-text-color: #000000d9;
|
|
6
|
+
--checkbox-button-checked-background-color: #e0f3ff;
|
|
7
|
+
--checkbox-button-checked-text-color: var(--yp-color-primary);
|
|
8
|
+
--checkbox-button-checked-border-color: var(--yp-color-primary);
|
|
9
|
+
--checkbox-button-height: 52px;
|
|
10
|
+
}
|
|
11
|
+
.ypmini-checkbox {
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
&-button {
|
|
16
|
+
|
|
17
|
+
background-color: var(--checkbox-button-background-color);
|
|
18
|
+
color: var(--checkbox-button-text-color);
|
|
19
|
+
font-size: var(--checkbox-button-font-size);
|
|
20
|
+
text-align: center;
|
|
21
|
+
padding: 0px 16px;
|
|
22
|
+
height: var(--checkbox-button-height);
|
|
23
|
+
line-height: var(--checkbox-button-height);
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
border-radius: var(--checkbox-button-border-radius);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-button-checked {
|
|
29
|
+
background-color: var(--checkbox-button-checked-background-color);
|
|
30
|
+
color: var(--checkbox-button-checked-text-color);
|
|
31
|
+
border-color: var(--checkbox-button-checked-border-color);
|
|
32
|
+
border-width: 1px;
|
|
33
|
+
border-style: solid;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
.ypmini-checkbox-group {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
&.ypmini-checkbox-group-block {
|
|
44
|
+
display: block;
|
|
45
|
+
margin-top: 0px;
|
|
46
|
+
.ypmini-checkbox {
|
|
47
|
+
&:not(:first-child) {
|
|
48
|
+
margin-top: 12px;
|
|
49
|
+
margin-left: 0px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
.ypmini-checkbox {
|
|
54
|
+
&:not(:first-child) {
|
|
55
|
+
margin-left: 12px;
|
|
56
|
+
margin-top: 0px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormItemProps as YpFormItemProps } from '@yup/taro-form';
|
|
3
|
+
export interface FormItemProps extends YpFormItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* 带有必填星号的label
|
|
6
|
+
*/
|
|
7
|
+
required?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const FormItem: React.FC<FormItemProps>;
|
|
10
|
+
export default FormItem;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {objectWithoutProperties as _objectWithoutProperties,objectSpread2 as _objectSpread2}from'../../_virtual/_rollupPluginBabelHelpers.js';import {j as jsxRuntimeExports}from'../../node_modules/react/jsx-runtime.js';import cns from'../../node_modules/classnames/index.js';import YpForm from'@yup/taro-form';var _excluded = ["children", "required", "className"];
|
|
2
|
+
var FormItem = function FormItem(_ref) {
|
|
3
|
+
var children = _ref.children,
|
|
4
|
+
required = _ref.required,
|
|
5
|
+
className = _ref.className,
|
|
6
|
+
rst = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return jsxRuntimeExports.jsx(YpForm.Item, _objectSpread2(_objectSpread2({
|
|
8
|
+
className: cns('ypmini-form-item', {
|
|
9
|
+
'ypmini-form-item-required': required
|
|
10
|
+
}, className)
|
|
11
|
+
}, rst), {}, {
|
|
12
|
+
children: children
|
|
13
|
+
}));
|
|
14
|
+
};export{FormItem as default};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import YpForm, { FormProps as YpFormProps } from '@yup/taro-form';
|
|
3
|
+
import FormItem from './form-item';
|
|
4
|
+
export interface FormProps extends YpFormProps {
|
|
5
|
+
/**
|
|
6
|
+
* 布局样式 horizontal label和表单水平排列 vertical label和表单垂直排列,默认为vertical
|
|
7
|
+
*/
|
|
8
|
+
layout?: 'horizontal' | "vertical";
|
|
9
|
+
}
|
|
10
|
+
declare const Form: React.FC<FormProps> & {
|
|
11
|
+
Item: typeof FormItem;
|
|
12
|
+
useForm: typeof YpForm.useForm;
|
|
13
|
+
useWatch: typeof YpForm.useWatch;
|
|
14
|
+
};
|
|
15
|
+
export default Form;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {objectWithoutProperties as _objectWithoutProperties,objectSpread2 as _objectSpread2}from'../../_virtual/_rollupPluginBabelHelpers.js';import {j as jsxRuntimeExports}from'../../node_modules/react/jsx-runtime.js';import cns from'../../node_modules/classnames/index.js';import YpForm from'@yup/taro-form';import FormItem from'./form-item.js';var _excluded = ["children", "layout"];
|
|
2
|
+
var Form = function Form(_ref) {
|
|
3
|
+
var children = _ref.children,
|
|
4
|
+
_ref$layout = _ref.layout,
|
|
5
|
+
layout = _ref$layout === void 0 ? 'vertical' : _ref$layout,
|
|
6
|
+
rst = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return jsxRuntimeExports.jsx(YpForm, _objectSpread2(_objectSpread2({
|
|
8
|
+
className: cns("ypmini-form", {
|
|
9
|
+
"ypmini-form-horizontal": layout === "horizontal",
|
|
10
|
+
"ypmini-form-vertical": layout === "vertical"
|
|
11
|
+
})
|
|
12
|
+
}, rst), {}, {
|
|
13
|
+
children: children
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
Form.Item = FormItem;
|
|
17
|
+
Form.useForm = YpForm.useForm;
|
|
18
|
+
Form.useWatch = YpForm.useWatch;export{Form as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|