@yup/taro-ui 0.0.8 → 1.0.0
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 +228 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +3 -1
- package/es/components/avatar/index.d.ts +18 -0
- package/es/components/avatar/index.js +1 -0
- package/es/components/avatar/style/index.css +28 -0
- package/es/components/avatar/style/index.d.ts +2 -0
- package/es/components/avatar/style/index.js +2 -0
- package/es/components/button/index.d.ts +19 -3
- package/es/components/button/index.js +1 -1
- package/es/components/button/style/index.css +118 -48
- package/es/components/button/style/index.d.ts +1 -0
- package/es/components/button/style/index.js +1 -0
- package/es/components/checkbox/checkbox-group.d.ts +6 -2
- package/es/components/checkbox/checkbox-group.js +1 -1
- package/es/components/checkbox/index.js +1 -1
- package/es/components/checkbox/style/index.css +2 -24
- package/es/components/checkbox/style/index.d.ts +1 -0
- package/es/components/checkbox/style/index.js +1 -0
- package/es/components/city-selector/hooks/useLevel2Multiple.d.ts +24 -0
- package/es/components/city-selector/hooks/useLevel2Multiple.js +1 -0
- package/es/components/city-selector/hooks/useLevel2Single.d.ts +19 -0
- package/es/components/city-selector/hooks/useLevel2Single.js +1 -0
- package/es/components/city-selector/hooks/useMultiple.d.ts +28 -0
- package/es/components/city-selector/hooks/useMultiple.js +1 -0
- package/es/components/city-selector/hooks/useSingle.d.ts +23 -0
- package/es/components/city-selector/hooks/useSingle.js +1 -0
- package/es/components/city-selector/index.d.ts +5 -0
- package/es/components/city-selector/index.js +1 -0
- package/es/components/city-selector/style/index.css +153 -0
- package/es/components/city-selector/style/index.d.ts +2 -0
- package/es/components/city-selector/util.d.ts +2 -0
- package/es/components/city-selector/util.js +1 -0
- package/es/components/date-picker-view/index.d.ts +40 -0
- package/es/components/date-picker-view/index.js +1 -0
- package/es/components/date-picker-view/style/index.css +3 -0
- package/es/components/date-picker-view/style/index.d.ts +2 -0
- package/es/components/date-picker-view/style/index.js +2 -0
- package/es/components/date-picker-view/util.d.ts +7 -0
- package/es/components/date-picker-view/util.js +1 -0
- package/es/components/dialog/context.d.ts +4 -0
- package/es/components/dialog/index.d.ts +31 -0
- package/es/components/dialog/index.js +1 -0
- package/es/components/dialog/style/index.css +113 -0
- package/es/components/dialog/style/index.d.ts +2 -0
- package/es/components/dialog/style/index.js +2 -0
- package/es/components/form/form-item.js +1 -1
- package/es/components/form/index.js +1 -1
- package/es/components/form/style/index.css +0 -22
- package/es/components/form/style/index.d.ts +1 -0
- package/es/components/form/style/index.js +1 -0
- package/es/components/icon/index.d.ts +12 -0
- package/es/components/icon/index.js +1 -0
- package/es/components/icon/style/iconfont.css +72 -0
- package/es/components/icon/style/iconfont.ttf +0 -0
- package/es/components/icon/style/iconfont.woff +0 -0
- package/es/components/icon/style/iconfont.woff2 +0 -0
- package/es/components/icon/style/index.d.ts +1 -0
- package/es/components/icon/style/index.js +1 -0
- package/es/components/input/index.d.ts +12 -0
- package/es/components/input/index.js +1 -1
- package/es/components/input/style/index.css +33 -32
- package/es/components/input/style/index.d.ts +2 -0
- package/es/components/input/style/index.js +2 -0
- package/es/components/input/style/search.css +21 -0
- package/es/components/media-uploader/index.d.ts +123 -0
- package/es/components/media-uploader/index.js +1 -0
- package/es/components/media-uploader/style/index.css +93 -0
- package/es/components/media-uploader/style/index.d.ts +2 -0
- package/es/components/media-uploader/style/index.js +2 -0
- package/es/components/picker-view/index.d.ts +25 -0
- package/es/components/picker-view/index.js +1 -0
- package/es/components/picker-view/style/index.css +62 -0
- package/es/components/picker-view/style/index.d.ts +2 -0
- package/es/components/picker-view/style/index.js +2 -0
- package/es/components/popup/index.d.ts +62 -0
- package/es/components/popup/index.js +1 -0
- package/es/components/popup/style/index.css +91 -0
- package/es/components/popup/style/index.d.ts +2 -0
- package/es/components/popup/style/index.js +2 -0
- package/es/components/radio/context.d.ts +5 -0
- package/es/components/radio/context.js +1 -0
- package/es/components/radio/index.js +1 -1
- package/es/components/radio/radio-group.js +1 -1
- package/es/components/radio/style/group.css +0 -22
- package/es/components/radio/style/index.d.ts +1 -0
- package/es/components/radio/style/index.js +1 -0
- package/es/components/radio/style/radio.css +11 -24
- package/es/components/safe-area/index.d.ts +13 -0
- package/es/components/safe-area/index.js +1 -0
- package/es/components/safe-area/style/index.css +3 -0
- package/es/components/safe-area/style/index.d.ts +2 -0
- package/es/components/safe-area/style/index.js +2 -0
- package/es/components/safe-area/util.d.ts +5 -0
- package/es/components/safe-area/util.js +1 -0
- package/es/components/switch/index.d.ts +6 -0
- package/es/components/switch/index.js +1 -0
- package/es/components/switch/style/index.css +38 -0
- package/es/components/switch/style/index.d.ts +2 -0
- package/es/components/switch/style/index.js +2 -0
- package/es/components/tag/index.d.ts +18 -0
- package/es/components/tag/index.js +1 -0
- package/es/components/tag/style/index.css +92 -0
- package/es/components/tag/style/index.d.ts +2 -0
- package/es/components/tag/style/index.js +2 -0
- package/es/components/toast/style/index.css +0 -22
- package/es/components/toast/style/index.d.ts +1 -0
- package/es/components/toast/style/index.js +1 -0
- package/es/components/toast/toast.js +1 -1
- package/es/components/toast/withToast.js +1 -1
- package/es/global/global.css +21 -0
- package/es/global/index.d.ts +2 -1
- package/es/global/theme-default.css +21 -0
- package/es/global/variables.css +0 -0
- package/es/hooks/useRefState.d.ts +7 -0
- package/es/hooks/useRefState.js +1 -0
- package/es/index.d.ts +26 -0
- package/es/index.js +1 -1
- package/es/node_modules/@yup/taro-checkbox/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
- package/es/node_modules/@yup/taro-checkbox/dist/checkbox-group.js +1 -0
- package/es/node_modules/@yup/taro-checkbox/dist/context.js +1 -0
- package/es/node_modules/@yup/taro-checkbox/dist/index.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/_virtual/_rollupPluginBabelHelpers.js +3 -0
- package/es/node_modules/@yup/taro-form/dist/context.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/formItem.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/fromStore.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/index.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/useForm.js +1 -0
- package/es/node_modules/@yup/taro-form/dist/useWatch.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/context.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/index.js +1 -0
- package/es/node_modules/@yup/taro-radio/dist/radio-group.js +1 -0
- package/es/style/iconfont.ttf +0 -0
- package/es/style/iconfont.woff +0 -0
- package/es/style/iconfont.woff2 +0 -0
- package/es/style/index.css +282 -227
- package/es/utils/is.js +1 -1
- package/package.json +16 -9
- package/es/_virtual/_commonjsHelpers.js +0 -1
- package/es/_virtual/index.js +0 -1
- package/es/_virtual/jsx-runtime.js +0 -1
- package/es/_virtual/react-jsx-runtime.development.js +0 -1
- package/es/_virtual/react-jsx-runtime.production.min.js +0 -1
- package/es/global.css +0 -22
- package/es/node_modules/classnames/index.js +0 -1
- package/es/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1
- package/es/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -10
- package/es/node_modules/react/jsx-runtime.js +0 -1
- package/es/utils/react.d.ts +0 -2
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
page {
|
|
3
|
+
--ypmini-popup-background: #fff;
|
|
4
|
+
--ypmini-popup-border-radius: calc(12px * var(--ypmini-hd));
|
|
5
|
+
--ypmini-popup-mask-background: rgba(0, 0, 0, 0.5);
|
|
6
|
+
--ypmini-popup-z-index: 1000;
|
|
7
|
+
--ypmini-popup-duration: 300ms;
|
|
8
|
+
--ypmini-popup-title-font-size: var(--ypmini-font-size-large);
|
|
9
|
+
--ypmini-popup-title-font-color: rgba(0, 0, 0, 0.85);
|
|
10
|
+
--ypmini-popup-confirm-text-font-color: var(--ypmini-primary-color);
|
|
11
|
+
--ypmini-popup-cancel-text-font-color: rgba(0, 0, 0, 0.65);
|
|
12
|
+
--ypmini-popup-confirm-text-font-size: var(--ypmini-font-size-default);
|
|
13
|
+
--ypmini-popup-cancel-text-font-size: var(--ypmini-font-size-default);
|
|
14
|
+
}
|
|
15
|
+
.ypmini-popup-wrapper {
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
z-index: var(--ypmini-popup-z-index);
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
24
|
+
.ypmini-popup-wrapper-visible {
|
|
25
|
+
pointer-events: auto;
|
|
26
|
+
}
|
|
27
|
+
.ypmini-popup-mask {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
left: 0;
|
|
31
|
+
right: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
background: var(--ypmini-popup-mask-background);
|
|
34
|
+
opacity: 0;
|
|
35
|
+
transition: opacity var(--ypmini-popup-duration) ease;
|
|
36
|
+
}
|
|
37
|
+
.ypmini-popup-mask-visible {
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}
|
|
40
|
+
.ypmini-popup {
|
|
41
|
+
position: absolute;
|
|
42
|
+
left: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
background: var(--ypmini-popup-background);
|
|
46
|
+
transform: translateY(100%);
|
|
47
|
+
transition: transform var(--ypmini-popup-duration) ease;
|
|
48
|
+
max-height: 80vh;
|
|
49
|
+
overflow-y: auto;
|
|
50
|
+
}
|
|
51
|
+
.ypmini-popup-visible {
|
|
52
|
+
transform: translateY(0);
|
|
53
|
+
}
|
|
54
|
+
.ypmini-popup-round {
|
|
55
|
+
border-radius: var(--ypmini-popup-border-radius) var(--ypmini-popup-border-radius) 0 0;
|
|
56
|
+
}
|
|
57
|
+
.ypmini-popup-header {
|
|
58
|
+
padding: 16px;
|
|
59
|
+
display: flex;
|
|
60
|
+
max-width: 100%;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
}
|
|
64
|
+
.ypmini-popup-header-cancel {
|
|
65
|
+
color: var(--ypmini-popup-cancel-text-font-color);
|
|
66
|
+
font-weight: 400;
|
|
67
|
+
font-size: var(--ypmini-popup-cancel-text-fontsize);
|
|
68
|
+
flex: 0 0 56px;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
text-align: left;
|
|
71
|
+
}
|
|
72
|
+
.ypmini-popup-header-title {
|
|
73
|
+
flex: 1;
|
|
74
|
+
text-align: center;
|
|
75
|
+
color: var(--ypmini-popup-title-font-color);
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
font-size: var(--ypmini-font-size-large);
|
|
78
|
+
margin-left: 44px;
|
|
79
|
+
margin-right: 44px;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
}
|
|
84
|
+
.ypmini-popup-header-confirm {
|
|
85
|
+
color: var(--ypmini-popup-confirm-text-font-color);
|
|
86
|
+
font-weight: 400;
|
|
87
|
+
font-size: var(--ypmini-popup-confirm-text-fontsize);
|
|
88
|
+
flex: 0 0 56px;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
text-align: right;
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";var e=t.createContext({});export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as t}from"react/jsx-runtime";import{View as i}from"@tarojs/components";import e from"classnames";import a from"react";import n from"../../node_modules/@yup/taro-radio/dist/index.js";import m from"./radio-group.js";import d from"./context.js";var p=["children","type"],u=function(m){var u=m.children,s=m.type,c=void 0===s?"button":s,l=r(m,p),f=a.useContext(d).type;return t(n,o({className:e("ypmini-taro-radio",{"ypmini-taro-radio-default":"default"===(f||c),"ypmini-taro-radio-button":"button"===(f||c)}),icon:function(r){return t(i,"default"===c?{className:e("ypmini-taro-radio-default-inner",{"ypmini-taro-radio-default-inner-checked":r}),children:u}:{className:e("ypmini-taro-radio-button-inner",{"ypmini-taro-radio-button-inner-checked":r}),children:u})}},l))};u.Group=m;export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as i}from"react/jsx-runtime";import e from"classnames";import t from"../../node_modules/@yup/taro-radio/dist/index.js";import p from"./context.js";var a=["children","type","block"],l=function(l){var n=l.children,m=l.type,u=l.block,d=void 0!==u&&u,s=r(l,a);return i(p.Provider,{value:{type:m},children:i(t.Group,o(o({className:e("ypmini-radio-group",{"ypmini-radio-group-button":"button"===m,"ypmini-radio-group-block":d})},s),{},{children:n}))})};export{l as default};
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
:root,
|
|
2
|
-
page {
|
|
3
|
-
--ypmini-hd: 2;
|
|
4
|
-
--yp-color-primary: #0092ff;
|
|
5
|
-
--yp-color-text: rgba(0, 0, 0, 0.85);
|
|
6
|
-
--yp-color-text-light: #0092ff;
|
|
7
|
-
--yp-color-text-weak: rgba(0, 0, 0, 0.45);
|
|
8
|
-
--yp-border-color: #e9edf3;
|
|
9
|
-
--yp-color-text-primary: #333;
|
|
10
|
-
--yp-color-text-link: var(--yp-color-primary);
|
|
11
|
-
--yp-color-text-secondary: #666;
|
|
12
|
-
--yp-color-text-disabled: #ccc;
|
|
13
|
-
--yp-color-text-placeholder: #999;
|
|
14
|
-
--yp-font-size-default: calc(17px * var(--ypmini-hd));
|
|
15
|
-
--yp-radio-circle-checked-color: var(--yp-color-primary);
|
|
16
|
-
--yp-radio-button-checked-color: var(--yp-color-primary);
|
|
17
|
-
--yp-checkbox-circle-checked-color: var(--yp-color-primary);
|
|
18
|
-
--yp-checkbox-button-checked-color: var(--yp-color-primary);
|
|
19
|
-
--yp-border-radius-base: calc(4px * var(--ypmini-hd));
|
|
20
|
-
--yp-border-radius-button: calc(8px * var(--ypmini-hd));
|
|
21
|
-
--yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
|
|
22
|
-
}
|
|
23
1
|
.ypmini-radio-group {
|
|
24
2
|
display: flex;
|
|
25
3
|
width: 100%;
|
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
:root,
|
|
2
|
-
page {
|
|
3
|
-
--ypmini-hd: 2;
|
|
4
|
-
--yp-color-primary: #0092ff;
|
|
5
|
-
--yp-color-text: rgba(0, 0, 0, 0.85);
|
|
6
|
-
--yp-color-text-light: #0092ff;
|
|
7
|
-
--yp-color-text-weak: rgba(0, 0, 0, 0.45);
|
|
8
|
-
--yp-border-color: #e9edf3;
|
|
9
|
-
--yp-color-text-primary: #333;
|
|
10
|
-
--yp-color-text-link: var(--yp-color-primary);
|
|
11
|
-
--yp-color-text-secondary: #666;
|
|
12
|
-
--yp-color-text-disabled: #ccc;
|
|
13
|
-
--yp-color-text-placeholder: #999;
|
|
14
|
-
--yp-font-size-default: calc(17px * var(--ypmini-hd));
|
|
15
|
-
--yp-radio-circle-checked-color: var(--yp-color-primary);
|
|
16
|
-
--yp-radio-button-checked-color: var(--yp-color-primary);
|
|
17
|
-
--yp-checkbox-circle-checked-color: var(--yp-color-primary);
|
|
18
|
-
--yp-checkbox-button-checked-color: var(--yp-color-primary);
|
|
19
|
-
--yp-border-radius-base: calc(4px * var(--ypmini-hd));
|
|
20
|
-
--yp-border-radius-button: calc(8px * var(--ypmini-hd));
|
|
21
|
-
--yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
|
|
22
|
-
}
|
|
23
|
-
:root,
|
|
24
2
|
page {
|
|
25
3
|
--radio-button-font-size: calc(17px * var(--ypmini-hd));
|
|
26
4
|
--radio-button-border-radius: calc(8px * var(--ypmini-hd));
|
|
27
5
|
--radio-button-background-color: #f5f7fc;
|
|
28
6
|
--radio-button-text-color: #000000d9;
|
|
29
7
|
--radio-button-checked-background-color: #e0f3ff;
|
|
30
|
-
--radio-button-checked-text-color: var(--
|
|
31
|
-
--radio-button-checked-border-color: var(--
|
|
8
|
+
--radio-button-checked-text-color: var(--ypmini-primary-color);
|
|
9
|
+
--radio-button-checked-border-color: var(--ypmini-primary-color);
|
|
32
10
|
--radio-button-height: calc(52px * var(--ypmini-hd));
|
|
11
|
+
--radio-default-size: calc(16px * var(--ypmini-hd));
|
|
12
|
+
}
|
|
13
|
+
.ypmini-taro-radio-default-inner {
|
|
14
|
+
width: var(--radio-default-size);
|
|
15
|
+
height: var(--radio-default-size);
|
|
16
|
+
border-radius: 100%;
|
|
17
|
+
}
|
|
18
|
+
.ypmini-taro-radio-default-inner-checked::before {
|
|
19
|
+
content: "☑️";
|
|
33
20
|
}
|
|
34
21
|
.ypmini-taro-radio-button-inner {
|
|
35
22
|
background-color: var(--radio-button-background-color);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ViewProps } from '@tarojs/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SafeAreaProps extends ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* 安全距离位置 top 顶部,bottom 底部
|
|
6
|
+
*/
|
|
7
|
+
position?: 'top' | 'bottom';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 安全区域组件 用于安全区域占位
|
|
11
|
+
*/
|
|
12
|
+
declare const SafeArea: React.FC<SafeAreaProps>;
|
|
13
|
+
export default SafeArea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as t,slicedToArray as o,objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e}from"react/jsx-runtime";import{View as a}from"@tarojs/components";import{useState as i,useEffect as s}from"react";import m from"classnames";import{getSystemInfo as p}from"./util.js";var l=["position","className","style","children"],n=function(n){var c=n.position,d=void 0===c?"bottom":c,f=n.className,u=n.style,b=n.children,h=t(n,l),j=i({top:0,bottom:0}),v=o(j,2),g=v[0],y=v[1];return s(function(){var t=p(),o=t.bottomSafeAreaHeight,r=t.statusBarHeight;y({top:r,bottom:o})},[]),e(a,r(r({className:m("ypmini-safe-area-view",f),style:r({paddingTop:"top"===d?g.top:0,paddingBottom:"bottom"===d?g.bottom:0},u)},h),{},{children:b}))};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"@tarojs/taro";var e=function(){try{var e,a=null==t||null===(e=t.getSystemInfoSync)||void 0===e?void 0:e.call(t);return{statusBarHeight:a.statusBarHeight||0,bottomSafeAreaHeight:null!=a&&a.safeArea&&a.safeArea.bottom>0?a.screenHeight-a.safeArea.bottom:0}}catch(t){return{statusBarHeight:0,bottomSafeAreaHeight:0}}};export{e as getSystemInfo};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as o}from"react/jsx-runtime";import s from"classnames";import{Switch as t}from"@tarojs/components";var e=["className"],m=function(m){var i=m.className,c=r(m,e);return o(t,a({className:s("ypmini-switch",i),color:"#0092ff"},c))};export{m as default};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
page {
|
|
3
|
+
--ypmini-witch-defalt-background-color: #e9edf3;
|
|
4
|
+
--ypmini-switch-inner-size: calc(var(--ypmini-hd) * 16px);
|
|
5
|
+
--yomini-switch-border-radius: calc(var(--ypmini-hd) * 12px);
|
|
6
|
+
--yomini-switch-width: calc(var(--ypmini-hd) * 24px);
|
|
7
|
+
--yomini-switch-height: calc(var(--ypmini-hd) * 48px);
|
|
8
|
+
}
|
|
9
|
+
.ypmini-switch {
|
|
10
|
+
height: var(--yomini-switch-width);
|
|
11
|
+
width: var(--yomini-switch-height);
|
|
12
|
+
border-radius: var(--yomini-switch-border-radius);
|
|
13
|
+
}
|
|
14
|
+
.ypmini-switch .weui-switch {
|
|
15
|
+
height: var(--yomini-switch-width);
|
|
16
|
+
width: var(--yomini-switch-height);
|
|
17
|
+
border-radius: var(--yomini-switch-border-radius);
|
|
18
|
+
}
|
|
19
|
+
.ypmini-switch .weui-switch:checked {
|
|
20
|
+
background-color: var(--ypmini-primary-color);
|
|
21
|
+
}
|
|
22
|
+
.ypmini-switch .weui-switch:checked:after {
|
|
23
|
+
transform: translate(46px);
|
|
24
|
+
}
|
|
25
|
+
.ypmini-switch .weui-switch::before,
|
|
26
|
+
.ypmini-switch .weui-switch::after {
|
|
27
|
+
width: var(--ypmini-switch-inner-size);
|
|
28
|
+
height: var(--ypmini-switch-inner-size);
|
|
29
|
+
border-radius: var(--ypmini-switch-inner-size);
|
|
30
|
+
left: 8px;
|
|
31
|
+
}
|
|
32
|
+
.ypmini-switch .weui-switch:before {
|
|
33
|
+
display: none;
|
|
34
|
+
background-color: var(--ypmini-witch-defalt-background-color);
|
|
35
|
+
}
|
|
36
|
+
.ypmini-switch .weui-switch::after {
|
|
37
|
+
top: 6px;
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from '@tarojs/components';
|
|
3
|
+
export interface TagProps extends ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* 颜色类型
|
|
6
|
+
*/
|
|
7
|
+
color?: 'default' | 'primary' | 'warning' | 'success';
|
|
8
|
+
/**
|
|
9
|
+
* 大小规格
|
|
10
|
+
*/
|
|
11
|
+
size?: 'default' | 'small';
|
|
12
|
+
/**
|
|
13
|
+
* 填充样式 outlined 外边框填充, solid 无外边框
|
|
14
|
+
*/
|
|
15
|
+
variant?: "outlined" | 'solid';
|
|
16
|
+
}
|
|
17
|
+
declare const Tag: React.FC<TagProps>;
|
|
18
|
+
export default Tag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as a,objectSpread2 as i}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as t}from"react/jsx-runtime";import o from"classnames";import{View as r}from"@tarojs/components";var e=["color","variant","size","className","children"],c=function(c){var n=c.color,s=void 0===n?"default":n,l=c.variant,m=void 0===l?"solid":l,p=c.size,d=void 0===p?"default":p,u=c.className,f=c.children,v=a(c,e);return t(r,i(i({className:o("ypmini-tag","ypmini-tag-".concat(s),"ypmini-tag-".concat(m),"ypmini-tag-".concat(s,"--").concat(m),"ypmini-tag-size-".concat(d),u)},v),{},{children:f}))};export{c as default};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
page,
|
|
2
|
+
:root {
|
|
3
|
+
--ypmini-tag-size-default-height: calc(var(--ypmini-hd) * 22px);
|
|
4
|
+
--ypmini-tag-size-default-font-size: calc(var(--ypmini-hd) * 12px);
|
|
5
|
+
--ypmini-tag-size-small-height: calc(var(--ypmini-hd) * 18px);
|
|
6
|
+
--ypmini-tag-size-small-font-size: calc(var(--ypmini-hd) * 12px);
|
|
7
|
+
--ypmini-tag-default-background-color: #f5f7fc;
|
|
8
|
+
--ypmini-tag-primary-background-color: var(--ypmini-primary-secondary-color);
|
|
9
|
+
--ypmini-tag-success-background-color: #dff2ec;
|
|
10
|
+
--ypmini-tag-warning-background-color: #ffebec;
|
|
11
|
+
--ypmini-tag-default-font-color: rgba(0, 0, 0, 0.65);
|
|
12
|
+
--ypmini-tag-primary-font-color: var(--ypmini-primary-color);
|
|
13
|
+
--ypmini-tag-success-font-color: #06b578;
|
|
14
|
+
--ypmini-tag-warning-font-color: #e8362e;
|
|
15
|
+
--ypmini-tag-default-font-size: calc(var(--ypmini-hd) * 12px);
|
|
16
|
+
--ypmini-tag-small-font-size: calc(var(--ypmini-hd) * 10px);
|
|
17
|
+
}
|
|
18
|
+
.ypmini-tag {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
height: var(--ypmini-tag-size-default-height);
|
|
23
|
+
padding: 0px 12px;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
font-size: var(--ypmini-tag-size-default-font-size);
|
|
27
|
+
}
|
|
28
|
+
.ypmini-tag-size-default {
|
|
29
|
+
padding: 0px 12px;
|
|
30
|
+
font-size: var(--ypmini-tag-size-default-font-size);
|
|
31
|
+
height: var(--ypmini-tag-size-default-height);
|
|
32
|
+
}
|
|
33
|
+
.ypmini-tag-size-small {
|
|
34
|
+
padding: 0px 8px;
|
|
35
|
+
font-size: var(--ypmini-tag-size-small-font-size);
|
|
36
|
+
height: var(--ypmini-tag-size-small-height);
|
|
37
|
+
}
|
|
38
|
+
.ypmini-tag-outlined {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
.ypmini-tag-default {
|
|
42
|
+
background: var(--ypmini-tag-default-background-color);
|
|
43
|
+
color: var(--ypmini-tag-default-font-color);
|
|
44
|
+
}
|
|
45
|
+
.ypmini-tag-default--outlined {
|
|
46
|
+
--ypmini-tag-default-outlined-border-color: var(--ypmini-tag-default-font-color);
|
|
47
|
+
border: 1px solid var(--ypmini-tag-default-outlined-border-color);
|
|
48
|
+
}
|
|
49
|
+
.ypmini-tag-default--solid {
|
|
50
|
+
border: unset;
|
|
51
|
+
background: var(--ypmini-tag-default-background-color);
|
|
52
|
+
color: var(--ypmini-tag-default-font-color);
|
|
53
|
+
}
|
|
54
|
+
.ypmini-tag-primary {
|
|
55
|
+
background: var(--ypmini-tag-primary-background-color);
|
|
56
|
+
color: var(--ypmini-tag-primary-font-color);
|
|
57
|
+
}
|
|
58
|
+
.ypmini-tag-primary--outlined {
|
|
59
|
+
--ypmini-tag-primary-outlined-border-color: var(--ypmini-tag-primary-font-color);
|
|
60
|
+
border: 1px solid var(--ypmini-tag-primary-outlined-border-color);
|
|
61
|
+
}
|
|
62
|
+
.ypmini-tag-primary--solid {
|
|
63
|
+
border: unset;
|
|
64
|
+
background: var(--ypmini-tag-primary-background-color);
|
|
65
|
+
color: var(--ypmini-tag-primary-font-color);
|
|
66
|
+
}
|
|
67
|
+
.ypmini-tag-warning {
|
|
68
|
+
background: var(--ypmini-tag-warning-background-color);
|
|
69
|
+
color: var(--ypmini-tag-warning-font-color);
|
|
70
|
+
}
|
|
71
|
+
.ypmini-tag-warning--outlined {
|
|
72
|
+
--ypmini-tag-warning-outlined-border-color: var(--ypmini-tag-warning-font-color);
|
|
73
|
+
border: 1px solid var(--ypmini-tag-warning-outlined-border-color);
|
|
74
|
+
}
|
|
75
|
+
.ypmini-tag-warning--solid {
|
|
76
|
+
border: unset;
|
|
77
|
+
background: var(--ypmini-tag-warning-background-color);
|
|
78
|
+
color: var(--ypmini-tag-warning-font-color);
|
|
79
|
+
}
|
|
80
|
+
.ypmini-tag-success {
|
|
81
|
+
background: var(--ypmini-tag-success-background-color);
|
|
82
|
+
color: var(--ypmini-tag-success-font-color);
|
|
83
|
+
}
|
|
84
|
+
.ypmini-tag-success--outlined {
|
|
85
|
+
--ypmini-tag-success-outlined-border-color: var(--ypmini-tag-success-font-color);
|
|
86
|
+
border: 1px solid var(--ypmini-tag-success-outlined-border-color);
|
|
87
|
+
}
|
|
88
|
+
.ypmini-tag-success--solid {
|
|
89
|
+
border: unset;
|
|
90
|
+
background: var(--ypmini-tag-success-background-color);
|
|
91
|
+
color: var(--ypmini-tag-success-font-color);
|
|
92
|
+
}
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
:root,
|
|
2
|
-
page {
|
|
3
|
-
--ypmini-hd: 2;
|
|
4
|
-
--yp-color-primary: #0092ff;
|
|
5
|
-
--yp-color-text: rgba(0, 0, 0, 0.85);
|
|
6
|
-
--yp-color-text-light: #0092ff;
|
|
7
|
-
--yp-color-text-weak: rgba(0, 0, 0, 0.45);
|
|
8
|
-
--yp-border-color: #e9edf3;
|
|
9
|
-
--yp-color-text-primary: #333;
|
|
10
|
-
--yp-color-text-link: var(--yp-color-primary);
|
|
11
|
-
--yp-color-text-secondary: #666;
|
|
12
|
-
--yp-color-text-disabled: #ccc;
|
|
13
|
-
--yp-color-text-placeholder: #999;
|
|
14
|
-
--yp-font-size-default: calc(17px * var(--ypmini-hd));
|
|
15
|
-
--yp-radio-circle-checked-color: var(--yp-color-primary);
|
|
16
|
-
--yp-radio-button-checked-color: var(--yp-color-primary);
|
|
17
|
-
--yp-checkbox-circle-checked-color: var(--yp-color-primary);
|
|
18
|
-
--yp-checkbox-button-checked-color: var(--yp-color-primary);
|
|
19
|
-
--yp-border-radius-base: calc(4px * var(--ypmini-hd));
|
|
20
|
-
--yp-border-radius-button: calc(8px * var(--ypmini-hd));
|
|
21
|
-
--yp-space-horizontal-base: calc(12px * var(--ypmini-hd));
|
|
22
|
-
}
|
|
23
|
-
:root,
|
|
24
2
|
page {
|
|
25
3
|
--toast-z-index: 9999;
|
|
26
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{slicedToArray as r,objectWithoutProperties as e,objectSpread2 as t}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{slicedToArray as r,objectWithoutProperties as e,objectSpread2 as t}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as n}from"react/jsx-runtime";import o,{useState as i}from"react";import{View as a,Text as u}from"@tarojs/components";import s from"classnames";import{isNumber as c}from"../../utils/is.js";var l=["content","duration"],f=["className"],m={},d=o.forwardRef(function(m,d){var v=i(!1),p=r(v,2),h=p[0],j=p[1],T=i(""),w=r(T,2),y=w[0],N=w[1],R=o.useState(),b=r(R,2),g=b[0],x=b[1],H=o.useRef(2e3),P=o.useRef(null);if(o.useImperativeHandle(d,function(){return{show:function(r){if("string"==typeof r)N(r);else{var t=r.content,n=r.duration,o=void 0===n?2e3:n,i=e(r,l);c(o)&&(H.current=o),x(i),N(t)}P.current&&clearTimeout(P.current),j(!0);var a=setTimeout(function(){j(!1)},H.current);P.current=a},hide:function(){clearTimeout(P.current),j(!1)}}}),!h)return null;var S=g||{},W=S.className,_=e(S,f);return n(a,t(t({className:s("ypmini-toast-container",W)},_),{},{children:n(u,{className:"ypmini-toast-content",children:y})}))});var v={createToast:function(){var r;if(null===(r=m)||void 0===r||!r.ref){var e=o.createRef();m={ref:e,ToastWrapper:function(){return n(d,{ref:e})}}}return m},show:function(r){var e;null===(e=m)||void 0===e||null===(e=e.ref)||void 0===e||null===(e=e.current)||void 0===e||e.show(r)},hide:function(){var r;null===(r=m)||void 0===r||null===(r=r.ref)||void 0===r||null===(r=r.current)||void 0===r||r.hide()}};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import a from"./toast.js";function i(i){var n=a.createToast().ToastWrapper;return function(a){return t(e,{children:[o(n,{}),o(i,r({},a))]})}}export{i as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
page {
|
|
3
|
+
--ypmini-hd: 2;
|
|
4
|
+
--ypmini-primary-color: #0092ff;
|
|
5
|
+
--ypmini-primary-secondary-color: #e0f3ff;
|
|
6
|
+
--ypmini-color-text: rgba(0, 0, 0, 0.85);
|
|
7
|
+
--ypmini-color-text-light: var(--ypmini-primary-color);
|
|
8
|
+
--ypmini-color-text-weak: rgba(0, 0, 0, 0.45);
|
|
9
|
+
--ypmini-color-text-primary: #333;
|
|
10
|
+
--ypmini-color-text-link: var(--ypmini-primary-color);
|
|
11
|
+
--ypmini-color-text-secondary: #666;
|
|
12
|
+
--ypmini-color-text-disabled: #ccc;
|
|
13
|
+
--ypmini-color-text-placeholder: #00000040;
|
|
14
|
+
--ypmini-border-color: #e9edf3;
|
|
15
|
+
--ypmini-font-size-max: calc(19px * var(--ypmini-hd));
|
|
16
|
+
--ypmini-font-size-large: calc(17px * var(--ypmini-hd));
|
|
17
|
+
--ypmini-font-size-default: calc(15px * var(--ypmini-hd));
|
|
18
|
+
--ypmini-font-size-middle: calc(14px * var(--ypmini-hd));
|
|
19
|
+
--ypmini-font-size-mini: calc(13px * var(--ypmini-hd));
|
|
20
|
+
--ypmini-mask-background: rgba(0, 0, 0, 0.65);
|
|
21
|
+
}
|
package/es/global/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './variables.less';
|
|
2
|
+
import './theme-default.less';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
page {
|
|
3
|
+
--ypmini-hd: 2;
|
|
4
|
+
--ypmini-primary-color: #0092ff;
|
|
5
|
+
--ypmini-primary-secondary-color: #e0f3ff;
|
|
6
|
+
--ypmini-color-text: rgba(0, 0, 0, 0.85);
|
|
7
|
+
--ypmini-color-text-light: var(--ypmini-primary-color);
|
|
8
|
+
--ypmini-color-text-weak: rgba(0, 0, 0, 0.45);
|
|
9
|
+
--ypmini-color-text-primary: #333;
|
|
10
|
+
--ypmini-color-text-link: var(--ypmini-primary-color);
|
|
11
|
+
--ypmini-color-text-secondary: #666;
|
|
12
|
+
--ypmini-color-text-disabled: #ccc;
|
|
13
|
+
--ypmini-color-text-placeholder: #00000040;
|
|
14
|
+
--ypmini-border-color: #e9edf3;
|
|
15
|
+
--ypmini-font-size-max: calc(19px * var(--ypmini-hd));
|
|
16
|
+
--ypmini-font-size-large: calc(17px * var(--ypmini-hd));
|
|
17
|
+
--ypmini-font-size-default: calc(15px * var(--ypmini-hd));
|
|
18
|
+
--ypmini-font-size-middle: calc(14px * var(--ypmini-hd));
|
|
19
|
+
--ypmini-font-size-mini: calc(13px * var(--ypmini-hd));
|
|
20
|
+
--ypmini-mask-background: rgba(0, 0, 0, 0.65);
|
|
21
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{slicedToArray as r}from"../_virtual/_rollupPluginBabelHelpers.js";import e from"react";function t(t){var u=e.useState(t),n=r(u,2),o=n[0],a=n[1],c=e.useRef(o);return[o,function(r){var e=r;"function"==typeof r&&(e=r(c.current)),e!==c.current&&(c.current=e,a(r))},c]}export{t as default};
|
package/es/index.d.ts
CHANGED
|
@@ -4,3 +4,29 @@ export { default as Input } from './components/input';
|
|
|
4
4
|
export { default as Radio } from './components/radio';
|
|
5
5
|
export { default as Form } from './components/form';
|
|
6
6
|
export { default as Toast } from './components/toast';
|
|
7
|
+
export { default as Icon } from './components/icon';
|
|
8
|
+
export { default as PickerView } from './components/picker-view';
|
|
9
|
+
export { default as DatePickerView } from './components/date-picker-view';
|
|
10
|
+
export { default as Switch } from './components/switch';
|
|
11
|
+
export { default as Popup } from './components/popup';
|
|
12
|
+
export { default as SafeArea } from './components/safe-area';
|
|
13
|
+
export { default as MediaUploader } from './components/media-uploader';
|
|
14
|
+
export { default as Dialog } from './components/dialog';
|
|
15
|
+
export { default as CitySelector } from './components/city-selector';
|
|
16
|
+
export { default as Tag } from './components/tag';
|
|
17
|
+
export { default as Avatar } from './components/avatar';
|
|
18
|
+
export type * from './components/media-uploader';
|
|
19
|
+
export type * from './components/dialog';
|
|
20
|
+
export type * from './components/button';
|
|
21
|
+
export type * from './components/popup';
|
|
22
|
+
export type * from './components/date-picker-view';
|
|
23
|
+
export type * from './components/picker-view';
|
|
24
|
+
export type * from './components/form';
|
|
25
|
+
export type * from './components/radio';
|
|
26
|
+
export type * from './components/input';
|
|
27
|
+
export type * from './components/checkbox';
|
|
28
|
+
export type * from './components/icon';
|
|
29
|
+
export type * from './components/switch';
|
|
30
|
+
export type * from './components/city-selector';
|
|
31
|
+
export type * from './components/tag';
|
|
32
|
+
export type * from './components/avatar';
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as Button}from"./components/button/index.js";export{default as Checkbox}from"./components/checkbox/index.js";export{default as Input}from"./components/input/index.js";export{default as Radio}from"./components/radio/index.js";export{default as Form}from"./components/form/index.js";import"./components/toast/index.js";export{default as Icon}from"./components/icon/index.js";export{default as PickerView}from"./components/picker-view/index.js";export{default as DatePickerView}from"./components/date-picker-view/index.js";export{default as Switch}from"./components/switch/index.js";export{default as Popup}from"./components/popup/index.js";export{default as SafeArea}from"./components/safe-area/index.js";export{default as MediaUploader}from"./components/media-uploader/index.js";export{default as Dialog}from"./components/dialog/index.js";export{default as CitySelector}from"./components/city-selector/index.js";export{default as Tag}from"./components/tag/index.js";export{default as Avatar}from"./components/avatar/index.js";export{default as Toast}from"./components/toast/toast.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(r){if(Array.isArray(r))return r}function e(t){if(Array.isArray(t))return r(t)}function n(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function o(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=a.call(e)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(r){s=!0,o=r}finally{try{if(!u&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(r,t){if(null==r)return{};var e,n,o=u(r,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(n=0;n<a.length;n++)e=a[n],-1===t.indexOf(e)&&{}.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function u(r,t){if(null==r)return{};var e={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==t.indexOf(n))continue;e[n]=r[n]}return e}function s(r,e){return t(r)||o(r,e)||y(r,e)||a()}function f(r){return e(r)||n(r)||y(r)||i()}function y(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}export{r as arrayLikeToArray,t as arrayWithHoles,e as arrayWithoutHoles,n as iterableToArray,o as iterableToArrayLimit,a as nonIterableRest,i as nonIterableSpread,l as objectWithoutProperties,u as objectWithoutPropertiesLoose,s as slicedToArray,f as toConsumableArray,y as unsupportedIterableToArray};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{slicedToArray as e,toConsumableArray as o}from"./_virtual/_rollupPluginBabelHelpers.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import r from"react";import s from"classnames";import{View as t}from"@tarojs/components";import{CheckboxGroupContext as a}from"./context.js";var c=function(c){var l=c.value,i=c.disabled,m=c.children,n=c.className,u=c.block,p=c.onChange,d=r.useState(l||[]),j=e(d,2),b=j[0],f=j[1];return r.createElement(a.Provider,{value:{value:b,onCheckboxChange:function(e,r){if(!i){if(e){var s=o(new Set([].concat(o(b),[r])));return f(s),void(p&&p(s))}var t=b.filter(function(e){return e!==r});f(t),p&&p(t)}},disabled:i,block:u}},r.createElement(t,{className:s("yp-checkbox-group",{"yp-checkbox-group-disabled":i,"yp-checkbox-group-block":u},n)},m))};c.displayName="CheckboxGroup";export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"react";var t=r.createContext({});export{t as CheckboxGroupContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as e,slicedToArray as o}from"./_virtual/_rollupPluginBabelHelpers.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import c from"react";import s from"classnames";import{View as r}from"@tarojs/components";import{CheckboxGroupContext as a}from"./context.js";import l from"./checkbox-group.js";var i=["icon","checked","value","disabled","children","onChange","className","block"],t=function(l){var t=l.icon,n=l.checked,d=void 0!==n&&n,m=l.value,u=l.disabled,p=l.children,b=l.onChange,h=l.className,k=l.block,f=e(l,i),x=c.useContext(a),j=x.value,v=x.onCheckboxChange,y=x.disabled,C=x.block,g=c.useState(d),N=o(g,2),E=N[0],P=N[1];c.useEffect(function(){"checked"in f?P(d):v&&P(!(null==j||!j.includes(m)))},[f,j]);return c.createElement(r,{onClick:function(){if(!u&&!y){var e=!E;P(e),b&&b(e,m),v&&v(e,m)}},className:s("yp-checkbox",{"yp-checkbox-checked":E,"yp-checkbox-block":k||C,"yp-checkbox-disabled":y||u},h)},t?t(E):p)};t.Group=l,t.displayName="Checkbox";export{t as default};
|