@yup/taro-ui 0.0.8 → 0.1.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 +52 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/es/components/button/index.d.ts +19 -3
- package/es/components/button/index.js +1 -1
- package/es/components/button/style/index.css +81 -29
- 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/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/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 +60 -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 +28 -27
- 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/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/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 +18 -0
- package/es/global/index.d.ts +2 -1
- package/es/global/theme-default.css +18 -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 +6 -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 +225 -203
- package/package.json +12 -7
- 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
package/README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
1
|
# yp-taro-ui
|
|
2
2
|
|
|
3
|
-
鱼泡Taro UI实现(抖音小程序)
|
|
3
|
+
鱼泡Taro UI实现(抖音小程序)
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @yup/taro-ui
|
|
9
|
+
# 或
|
|
10
|
+
yarn add @yup/taro-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 按需加载
|
|
14
|
+
|
|
15
|
+
配合 `babel-plugin-import` 插件实现按需加载,自动引入组件样式。
|
|
16
|
+
|
|
17
|
+
### 安装插件
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install babel-plugin-import --save-dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 配置 babel
|
|
24
|
+
|
|
25
|
+
在 `babel.config.js` 或 `.babelrc` 中添加:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
{
|
|
29
|
+
"plugins": [
|
|
30
|
+
["import", {
|
|
31
|
+
"libraryName": "@yup/taro-ui",
|
|
32
|
+
"libraryDirectory": "es/components",
|
|
33
|
+
"style": true
|
|
34
|
+
}]
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 使用
|
|
40
|
+
|
|
41
|
+
配置后可以直接按需引入组件:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Button, Input } from '@yup/taro-ui';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
插件会自动转换为:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import Button from '@yup/taro-ui/es/components/button';
|
|
51
|
+
import '@yup/taro-ui/es/components/button/style';
|
|
52
|
+
import Input from '@yup/taro-ui/es/components/input';
|
|
53
|
+
import '@yup/taro-ui/es/components/input/style';
|
|
54
|
+
```
|
|
@@ -1 +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(r,t,e){return(t=
|
|
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,t,e){return(t=m(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function o(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function i(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,i,a,u=[],l=!0,f=!1;try{if(i=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;l=!1}else for(;!(l=(n=i.call(e)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(r){f=!0,o=r}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(f)throw o}}return u}}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 u(){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){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),e.push.apply(e,n)}return e}function f(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?l(Object(e),!0).forEach(function(t){n(r,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):l(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function c(r,t){if(null==r)return{};var e,n,o=y(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],-1===t.indexOf(e)&&{}.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function y(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)||i(r,e)||O(r,e)||a()}function b(r){return e(r)||o(r)||O(r)||u()}function p(r,t){if("object"!=typeof r||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}function m(r){var t=p(r,"string");return"symbol"==typeof t?t:t+""}function v(r){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},v(r)}function O(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 defineProperty,o as iterableToArray,i as iterableToArrayLimit,a as nonIterableRest,u as nonIterableSpread,f as objectSpread2,c as objectWithoutProperties,y as objectWithoutPropertiesLoose,s as slicedToArray,b as toConsumableArray,p as toPrimitive,m as toPropertyKey,v as typeof,O as unsupportedIterableToArray};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ButtonProps as TaroButtonProps } from '@tarojs/components';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export interface ButtonProps extends Omit<TaroButtonProps, 'type'> {
|
|
3
|
+
export interface ButtonProps extends Omit<TaroButtonProps, 'type' | 'size'> {
|
|
4
4
|
/**
|
|
5
|
-
* 按钮样式类型 primary 主题色样式按钮 default 默认样式 secondary
|
|
5
|
+
* 按钮样式类型 主要是颜色控制 primary 主题色样式按钮 default 默认样式 secondary 次级主题色样式 warning 强调警告的颜色(红色背景)
|
|
6
6
|
*/
|
|
7
|
-
styleType?: 'primary' | 'default' | 'secondary';
|
|
7
|
+
styleType?: 'primary' | 'default' | 'secondary' | "warning";
|
|
8
8
|
/**
|
|
9
9
|
* 是否启用禁用样式(启用禁用样式按钮依然可以点击和disabled有区别 只是样式支持),如果想要按钮有禁用样式 但是依然可点击可以用这个属性
|
|
10
10
|
*/
|
|
@@ -17,6 +17,22 @@ export interface ButtonProps extends Omit<TaroButtonProps, 'type'> {
|
|
|
17
17
|
* icon的支持
|
|
18
18
|
*/
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* 形状控制 default 默认形状,round 大圆角
|
|
22
|
+
*/
|
|
23
|
+
shape?: "default" | "round";
|
|
24
|
+
/**
|
|
25
|
+
* 按钮大小规格 主要是高度控制
|
|
26
|
+
*/
|
|
27
|
+
size?: "default" | "middle" | "small" | "large";
|
|
28
|
+
/**
|
|
29
|
+
* 填充样式 todo solid 背景完全填充的样式,outlined 有外边框,无背景的样式
|
|
30
|
+
*/
|
|
31
|
+
variant?: "outlined" | 'solid';
|
|
32
|
+
/**
|
|
33
|
+
* 幽灵按钮 背景透明的按钮
|
|
34
|
+
*/
|
|
35
|
+
ghost?: boolean;
|
|
20
36
|
}
|
|
21
37
|
declare const Button: React.FC<ButtonProps>;
|
|
22
38
|
export default Button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as t,objectSpread2 as
|
|
1
|
+
import{objectWithoutProperties as t,objectSpread2 as i}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Button as n,Text as e}from"@tarojs/components";import r from"classnames";var l=["children","styleType","className","block","disabled","disabledStyle","icon","ghost","shape","size","variant"],s=function(s){var d=s.children,m=s.styleType,u=void 0===m?"default":m,p=s.className,b=s.block,y=void 0===b||b,c=s.disabled,f=s.disabledStyle,h=s.icon,g=s.ghost,v=s.shape,z=void 0===v?"default":v,N=s.size,j=void 0===N?"default":N,w=s.variant,k=void 0===w?"solid":w,S=t(s,l);return a(n,i(i({className:r("ypmini-taro-button",{"ypmini-taro-button-ghost":g,"ypmini-taro-button-outlined":"outlined"===k,"ypmini-taro-button-solid":"solid"===k,"ypmini-taro-button-size-default":"default"===j,"ypmini-taro-button-size-large":"large"===j,"ypmini-taro-button-size-small":"small"===j,"ypmini-taro-button-size-middle":"middle"===j,"ypmini-taro-button-shape-default":"default"===z,"ypmini-taro-button-shape-round":"round"===z,"ypmini-taro-button-primary":"primary"===u,"ypmini-taro-button-primary-disabled":"primary"===u&&(c||f),"ypmini-taro-button-secondary":"secondary"===u,"ypmini-taro-button-secondary-disabled":"secondary"===u&&(c||f),"ypmini-taro-button-default":"default"===u,"ypmini-taro-button-warning":"warning"===u,"ypmini-taro-button-warning-disabled":"warning"===u&&(c||f),"ypmini-taro-button-default-disabled":"default"===u&&(c||f),"ypmini-taro-button-block":y},p),disabled:c},S),{},{children:h?o(e,{className:"ypmini-taro-button-icon-wrapper",children:[a(e,{className:"ypmini-taro-button-icon",children:h}),a(e,{className:"ypmini-taro-button-icon-content",children:d})]}):d}))};export{s as default};
|
|
@@ -1,47 +1,37 @@
|
|
|
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
|
--border-radius: calc(8px * var(--ypmini-hd));
|
|
26
|
-
--button-height: calc(48px * var(--ypmini-hd));
|
|
4
|
+
--button-height-large: calc(48px * var(--ypmini-hd));
|
|
5
|
+
--button-height-default: calc(44px * var(--ypmini-hd));
|
|
6
|
+
--button-height-middle: calc(40px * var(--ypmini-hd));
|
|
7
|
+
--button-height-small: calc(32px * var(--ypmini-hd));
|
|
8
|
+
--button-font-size-samll: calc(14px * var(--ypmini-hd));
|
|
9
|
+
--button-font-size-moddle: calc(15px * var(--ypmini-hd));
|
|
10
|
+
--button-font-size-default: calc(17px * var(--ypmini-hd));
|
|
11
|
+
--button-font-size-large: calc(17px * var(--ypmini-hd));
|
|
27
12
|
--default-button-background: #f5f7fc;
|
|
28
13
|
--default-button-text-color: rgba(0, 0, 0, 0.65);
|
|
29
|
-
--primary-button-background: var(--
|
|
14
|
+
--primary-button-background: var(--ypmini-primary-color);
|
|
30
15
|
--primary-button-disabled-background: #99d3ff;
|
|
31
16
|
--primary-button-disabled-text-color: rgba(255, 255, 255, 0.45);
|
|
32
17
|
--primary-button-text-color: #fff;
|
|
33
18
|
--secondary-button-background: #00cbff;
|
|
34
19
|
--secondary-button-text-color: #ffffff;
|
|
20
|
+
--warning-button-background: #FF5A57;
|
|
21
|
+
--warning-button-text-color: #ffffff;
|
|
22
|
+
--warning-button-outlined-color: #E8362E;
|
|
23
|
+
--primary-button-outlined-color: var(--ypmini-primary-color);
|
|
24
|
+
--default-button-outlined-color: rgba(0, 0, 0, 0.65);
|
|
35
25
|
}
|
|
36
26
|
.ypmini-taro-button {
|
|
37
|
-
padding: 0
|
|
27
|
+
padding: 0 24px;
|
|
38
28
|
border: unset;
|
|
39
29
|
font-weight: bold;
|
|
40
|
-
font-size:
|
|
30
|
+
font-size: var(--button-font-size-default);
|
|
41
31
|
width: auto;
|
|
42
|
-
height: var(--button-height);
|
|
43
|
-
line-height: var(--button-height);
|
|
44
|
-
color: var(--
|
|
32
|
+
height: var(--button-height-default);
|
|
33
|
+
line-height: var(--button-height-default);
|
|
34
|
+
color: var(--ypmini-color-text);
|
|
45
35
|
border-radius: var(--border-radius);
|
|
46
36
|
display: inline-block;
|
|
47
37
|
white-space: nowrap;
|
|
@@ -49,6 +39,53 @@ page {
|
|
|
49
39
|
.ypmini-taro-button:after {
|
|
50
40
|
display: none;
|
|
51
41
|
}
|
|
42
|
+
.ypmini-taro-button-ghost {
|
|
43
|
+
background: transparent;
|
|
44
|
+
}
|
|
45
|
+
.ypmini-taro-button-shape-default {
|
|
46
|
+
padding: 0 24px;
|
|
47
|
+
}
|
|
48
|
+
.ypmini-taro-button-shape-round {
|
|
49
|
+
padding: 0px 24px;
|
|
50
|
+
border-radius: 1998px;
|
|
51
|
+
}
|
|
52
|
+
.ypmini-taro-button-size-large {
|
|
53
|
+
height: var(--button-height-large);
|
|
54
|
+
line-height: var(--button-height-large);
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
font-size: var(--button-font-size-large);
|
|
57
|
+
}
|
|
58
|
+
.ypmini-taro-button-size-middle {
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
font-size: var(--button-font-size-middle);
|
|
61
|
+
height: var(--button-height-middle);
|
|
62
|
+
line-height: var(--button-height-middle);
|
|
63
|
+
}
|
|
64
|
+
.ypmini-taro-button-size-default {
|
|
65
|
+
height: var(--button-height-default);
|
|
66
|
+
line-height: var(--button-height-default);
|
|
67
|
+
}
|
|
68
|
+
.ypmini-taro-button-size-small {
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
font-size: var(--button-font-size-middle);
|
|
71
|
+
height: var(--button-height-small);
|
|
72
|
+
line-height: var(--button-height-small);
|
|
73
|
+
}
|
|
74
|
+
.ypmini-taro-button-warning {
|
|
75
|
+
background: var(--warning-button-background);
|
|
76
|
+
color: var(--warning-button-text-color);
|
|
77
|
+
}
|
|
78
|
+
.ypmini-taro-button-warning.ypmini-taro-button-warning-disabled {
|
|
79
|
+
opacity: 0.6;
|
|
80
|
+
}
|
|
81
|
+
.ypmini-taro-button-warning.ypmini-taro-button-warning-disabled.ypmini-taro-button-warning.ypmini-taro-button-warning-disabled[disabled] {
|
|
82
|
+
color: var(--warning-button-text-color);
|
|
83
|
+
}
|
|
84
|
+
.ypmini-taro-button-warning.ypmini-taro-button-outlined {
|
|
85
|
+
border: 2px solid #E8362E;
|
|
86
|
+
color: #E8362E;
|
|
87
|
+
background: transparent;
|
|
88
|
+
}
|
|
52
89
|
.ypmini-taro-button-primary {
|
|
53
90
|
background: var(--primary-button-background);
|
|
54
91
|
color: var(--primary-button-text-color);
|
|
@@ -57,6 +94,11 @@ page {
|
|
|
57
94
|
color: var(--primary-button-disabled-text-color);
|
|
58
95
|
background: var(--primary-button-disabled-background);
|
|
59
96
|
}
|
|
97
|
+
.ypmini-taro-button-primary.ypmini-taro-button-outlined {
|
|
98
|
+
border: 2px solid var(--primary-button-outlined-color);
|
|
99
|
+
color: var(--primary-button-outlined-color);
|
|
100
|
+
background: transparent;
|
|
101
|
+
}
|
|
60
102
|
.ypmini-taro-button-default {
|
|
61
103
|
background: var(--default-button-background);
|
|
62
104
|
color: var(--default-button-text-color);
|
|
@@ -67,6 +109,11 @@ page {
|
|
|
67
109
|
.ypmini-taro-button-default.ypmini-taro-button-default-disabled.ypmini-taro-button-default.ypmini-taro-button-default-disabled[disabled] {
|
|
68
110
|
color: var(--default-button-text-color);
|
|
69
111
|
}
|
|
112
|
+
.ypmini-taro-button-default.ypmini-taro-button-outlined {
|
|
113
|
+
border: 2px solid var(--default-button-outlined-color);
|
|
114
|
+
color: var(--default-button-outlined-color);
|
|
115
|
+
background: transparent;
|
|
116
|
+
}
|
|
70
117
|
.ypmini-taro-button-secondary {
|
|
71
118
|
background: var(--secondary-button-background);
|
|
72
119
|
color: var(--secondary-button-text-color);
|
|
@@ -77,6 +124,11 @@ page {
|
|
|
77
124
|
.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled.ypmini-taro-button-secondary.ypmini-taro-button-secondary-disabled[disabled] {
|
|
78
125
|
color: var(--secondary-button-text-color);
|
|
79
126
|
}
|
|
127
|
+
.ypmini-taro-button-secondary.ypmini-taro-button-outlined {
|
|
128
|
+
border: 2px solid var(--secondary-button-background);
|
|
129
|
+
color: var(--secondary-button-background);
|
|
130
|
+
background: transparent;
|
|
131
|
+
}
|
|
80
132
|
.ypmini-taro-button-block {
|
|
81
133
|
display: block;
|
|
82
134
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CheckboxGroupProps as YpCheckboxGroupProps } from '@yup/taro-checkbox/dist/types/type';
|
|
3
|
-
export interface CheckboxGroupProps extends YpCheckboxGroupProps {
|
|
2
|
+
import { CheckboxGroupProps as YpCheckboxGroupProps, ValueType } from '@yup/taro-checkbox/dist/types/type';
|
|
3
|
+
export interface CheckboxGroupProps extends Omit<YpCheckboxGroupProps, 'onChange'> {
|
|
4
4
|
/**
|
|
5
5
|
* 多选类型
|
|
6
6
|
*/
|
|
7
7
|
type?: 'button' | 'default';
|
|
8
|
+
/**
|
|
9
|
+
* change事件
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (value: ValueType) => void;
|
|
8
12
|
}
|
|
9
13
|
declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
|
|
10
14
|
export default CheckboxGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import t from"classnames";import n from"../../node_modules/@yup/taro-checkbox/dist/index.js";var p=["type","block","onChange"],a=function(a){var i=a.type,c=a.block,u=a.onChange,m=o(a,p);return r(n.Group,e({onChange:u,className:t("ypmini-checkbox-group",{"ypmini-checkbox-group-button":"button"===i,"ypmini-checkbox-group-block":c})},m))};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import t from"classnames";import{View as c}from"@tarojs/components";import i from"../../node_modules/@yup/taro-checkbox/dist/index.js";import n from"./checkbox-group.js";var s=["className","children","type"],m=function(n){var m=n.className,a=n.children,p=n.type,u=void 0===p?"button":p,l=o(n,s);return r(i,e({className:t("ypmini-checkbox",m),icon:function(o){return"button"===u?r(c,{className:t("ypmini-checkbox-button",{"ypmini-checkbox-button-checked":o}),children:a}):a}},l))};m.Group=n;export{m as default};
|
|
@@ -1,34 +1,12 @@
|
|
|
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
|
--checkbox-button-font-size: calc(17px * var(--ypmini-hd));
|
|
26
4
|
--checkbox-button-border-radius: calc(8px * var(--ypmini-hd));
|
|
27
5
|
--checkbox-button-background-color: #f5f7fc;
|
|
28
6
|
--checkbox-button-text-color: #000000d9;
|
|
29
7
|
--checkbox-button-checked-background-color: #e0f3ff;
|
|
30
|
-
--checkbox-button-checked-text-color: var(--
|
|
31
|
-
--checkbox-button-checked-border-color: var(--
|
|
8
|
+
--checkbox-button-checked-text-color: var(--ypmini-primary-color);
|
|
9
|
+
--checkbox-button-checked-border-color: var(--ypmini-primary-color);
|
|
32
10
|
--checkbox-button-height: calc(52px * var(--ypmini-hd));
|
|
33
11
|
}
|
|
34
12
|
.ypmini-checkbox-button {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PickerViewProps } from '../picker-view';
|
|
3
|
+
import { Dayjs } from 'dayjs';
|
|
4
|
+
export type DatePickerValue = Dayjs | 'tillNow';
|
|
5
|
+
export interface DatePickerViewProps extends Omit<PickerViewProps, 'value' | 'onChange' | 'columns'> {
|
|
6
|
+
/**
|
|
7
|
+
* 是否展示至今选项
|
|
8
|
+
*/
|
|
9
|
+
tillNow?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 日期选择器最小时间 默认当前时间的前10年
|
|
12
|
+
*/
|
|
13
|
+
minDate?: Dayjs;
|
|
14
|
+
/**
|
|
15
|
+
* 日期选择器最大时间限制 默认当前时间
|
|
16
|
+
*/
|
|
17
|
+
maxDate?: Dayjs;
|
|
18
|
+
/**
|
|
19
|
+
* 受控value,dayjs日期格式
|
|
20
|
+
*/
|
|
21
|
+
value?: DatePickerValue;
|
|
22
|
+
/**
|
|
23
|
+
* 模式支持 date 展示选择到天, month 仅选择到月
|
|
24
|
+
*/
|
|
25
|
+
pickerMode?: 'date' | 'month';
|
|
26
|
+
/**
|
|
27
|
+
* 仅用状态
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 时间选择器类名
|
|
32
|
+
*/
|
|
33
|
+
pickerViewClassName?: string;
|
|
34
|
+
/**
|
|
35
|
+
* change事件
|
|
36
|
+
*/
|
|
37
|
+
onChange?: (value: DatePickerValue) => void;
|
|
38
|
+
}
|
|
39
|
+
declare const DatePickerView: React.FC<DatePickerViewProps>;
|
|
40
|
+
export default DatePickerView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as a,slicedToArray as e,toConsumableArray as l,objectSpread2 as t}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as n}from"react/jsx-runtime";import o from"classnames";import i from"react";import r from"../picker-view/index.js";import{toAppDate as u,genYearColum as s,genMonthColum as d,genDayColum as c,dateFormat as v}from"./util.js";import m from"../../hooks/useRefState.js";var f=["minDate","maxDate","pickerMode","onChange","className","pickerViewClassName","cellRender","indicatorClass","tillNow","disabled","onClick"],p=u(new Date),h=function(a){return Math.max(a,0)},w=function(w){var N=w.minDate,y=w.maxDate,Y=void 0===y?p:y,M=w.pickerMode,x=void 0===M?"date":M,b=w.onChange;w.className;var D=w.pickerViewClassName;w.cellRender,w.indicatorClass;var k=w.tillNow,C=void 0!==k&&k,j=w.disabled;w.onClick;var g=a(w,f),I=m("date"===x?[0,0,0]:[0,0]),P=e(I,2),R=P[0],V=P[1],A=m({}),E=e(A,3),S=E[0],_=E[1],B=E[2],H=i.useMemo(function(){return"month"!==x},[x]);i.useEffect(function(){var a,e;if(!("value"in g)){var t=N||Y.subtract(10,"y"),n=C?["tillNow"].concat(l(null===(a=s(t,Y))||void 0===a?void 0:a.reverse())):null===(e=s(t,Y))||void 0===e?void 0:e.reverse();if("tillNow"===n[null==R?void 0:R[0]])_({years:n,months:[],days:[]});else{var o=d(n[R[0]],t,Y),i="date"===x?c(o[R[1]],t,Y):[];_({years:n,months:o,days:i})}}},[null==g?void 0:g.value,x,R,N,Y,C]),i.useEffect(function(){if("value"in g){var a,e,n,o,i,r,u,m=null==g?void 0:g.value;e=N||Y.subtract(10,"y"),n=null===(a=s(e,Y))||void 0===a?void 0:a.reverse(),o=C?["tillNow"].concat(l(n)):n,i=m&&"tillNow"!==m?m:n[0],r="tillNow"===m?[]:d(i,e,Y),u="date"===x&&"tillNow"!==m?c(i||r[0],e,Y):[],_({years:o,months:r,days:u}),function(){if("tillNow"!==(null==g?void 0:g.value)&&null!=g&&g.value){var a=B.current,e=a.years,l=a.months,n=a.days,o=v(m,"YYYY"),i=v(m,"M"),r=Math.max(null==e?void 0:e.findIndex(function(a){return v(a,"YYYY")===o}),0),u=null==l?void 0:l.findIndex(function(a){return"".concat(v(a,"M"))==="".concat(i)}),s=null==n?void 0:n.findIndex(function(a){return"".concat(v(a,"D"))==="".concat(v(m,"D"))}),d="date"===x?[Math.max(r||0,0),Math.max(u||0,0),Math.max(s||0,0)]:[Math.max(r||0,0),Math.max(u||0,0)];0===r&&"tillNow"===e[0]&&_(function(a){return t(t({},a),{},{months:[],days:[]})}),V(d)}else V("date"===x?[0,0,0]:[0,0])}()}else V("date"===x?[0,0,0]:[0,0])},[null==g?void 0:g.value,N,Y,x,C]);var T=i.useMemo(function(){var a,e,l,t=[null==S||null===(a=S.years)||void 0===a?void 0:a.map(function(a){return{label:"tillNow"===a?"至今":"".concat(v(a,"YYYY"),"年"),value:"tillNow"===a?"tillNow":v(a,"YYYY"),date:a}}),null==S||null===(e=S.months)||void 0===e?void 0:e.map(function(a){return{label:"".concat(v(a,"M"),"月"),value:v(a,"M"),date:a}})];H&&t.push(null==S||null===(l=S.days)||void 0===l?void 0:l.map(function(a){return{label:"".concat(v(a,"D"),"日"),value:v(a,"D"),date:a}}));return t},[H,S]);return n(r,t(t({onChange:function(a){if(!j){var e=a.detail.value;V(e);var l=B.current.years;if("tillNow"===(null==l?void 0:l[h(null==e?void 0:e[0])]))b&&b("tillNow");else{var t=B.current.days,n=d(null==l?void 0:l[h(e[0])],N||Y.subtract(10,"y"),Y),o=v(null==l?void 0:l[h(e[0])],"YYYY"),i=v(null==n?void 0:n[h(e[1])],"M"),r="month"===x?"1":v(null==t?void 0:t[h(e[2])],"D");b&&b(u("".concat(o,"-").concat(i,"-").concat(r)))}}},className:o("ypmini-datepicker-view",D),disabled:j},g),{},{columns:T,value:R}))};w.displayName="DatePickerView";export{w as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
export type AppDateType = dayjs.Dayjs;
|
|
3
|
+
export declare const dateFormat: (date: string | number | Date | AppDateType, format?: string) => string;
|
|
4
|
+
export declare const toAppDate: (date: string | number | Date | AppDateType) => dayjs.Dayjs;
|
|
5
|
+
export declare const genYearColum: (minDate?: AppDateType, maxDate?: AppDateType) => dayjs.Dayjs[];
|
|
6
|
+
export declare const genMonthColum: (current: AppDateType, min: AppDateType, max: AppDateType) => dayjs.Dayjs[];
|
|
7
|
+
export declare const genDayColum: (current: AppDateType, min: AppDateType, max: AppDateType) => dayjs.Dayjs[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"dayjs";var n=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD";return t(r).format(n)},t=function(n){return r(n)},a=function(n,a){var o=n||new Date("1870-01-01"),f=r(t(a||new Date).startOf("year")).diff(r(o).startOf("year"),"year"),u=new Array(f).fill(0).map(function(n,t){return r(o).add(t+1,"year")});return u.unshift(o),u},o=function(n,a,o){if((null==n?void 0:n.format("YYYY"))===(null==a?void 0:a.format("YYYY"))){if((null==o?void 0:o.format("YYYY"))===(null==a?void 0:a.format("YYYY"))){var f=r(o).diff(r(a),"month"),u=new Array(f).fill(0).map(function(n,t){return r(a).add(t,"month")});return u.push(r(o)),u}var i=12-+r(a).format("M"),l=new Array(i).fill(0).map(function(n,t){return r(a).add(t+1,"month")});return l.unshift(r(a)),l}if((null==n?void 0:n.format("YYYY"))===(null==o?void 0:o.format("YYYY"))){var Y,e=+(null==o?void 0:o.format("M"));return null===(Y=new Array(e).fill(0).map(function(n,t){return r(o).subtract(t,"month")}))||void 0===Y?void 0:Y.reverse()}return new Array(12).fill(0).map(function(r,a){return t("".concat(null==n?void 0:n.format("YYYY"),"-").concat(a+1,"-").concat(null==n?void 0:n.format("D")))})},f=function(n,a,o){if((null==n?void 0:n.format("YYYY-MM"))===(null==a?void 0:a.format("YYYY-MM"))){var f=r(a).endOf("M").diff(r(a),"day"),u=new Array(f).fill(0).map(function(n,t){return r(a).add(t+1,"day")});return u.unshift(r(a)),u}if((null==n?void 0:n.format("YYYY-MM"))===(null==o?void 0:o.format("YYYY-MM"))){var i,l=r(o).diff(r(n).startOf("M"),"day"),Y=null===(i=new Array(l).fill(0).map(function(n,t){return r(o).subtract(t+1,"day")}))||void 0===i?void 0:i.reverse();return Y.push(r(o)),Y}var e=null==n?void 0:n.daysInMonth();return new Array(e).fill(0).map(function(r,a){return t("".concat(null==n?void 0:n.format("YYYY"),"-").concat(null==n?void 0:n.format("MM"),"-").concat(a+1))})};export{n as dateFormat,f as genDayColum,o as genMonthColum,a as genYearColum,t as toAppDate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as i}from"react/jsx-runtime";import m from"classnames";import o from"../../node_modules/@yup/taro-form/dist/index.js";var t=["children","required","className"],a=function(a){var s=a.children,l=a.required,n=a.className,u=r(a,t);return i(o.Item,e(e({className:m("ypmini-form-item",{"ypmini-form-item-required":l},n)},u),{},{children:s}))};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e}from"react/jsx-runtime";import t from"classnames";import i from"../../node_modules/@yup/taro-form/dist/index.js";import a from"./form-item.js";var m=["children","layout","className"],s=function(a){var s=a.children,l=a.layout,c=void 0===l?"vertical":l,n=a.className,u=r(a,m);return e(i,o(o({className:t("ypmini-form",{"ypmini-form-horizontal":"horizontal"===c,"ypmini-form-vertical":"vertical"===c},n)},u),{},{children:s}))};s.Item=a,s.useForm=i.useForm,s.useWatch=i.useWatch;export{s as default};
|
|
@@ -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
|
--form-item-label-width: calc(60px * var(--ypmini-hd));
|
|
26
4
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextProps } from '@tarojs/components';
|
|
3
|
+
export interface IconProps extends TextProps {
|
|
4
|
+
/**
|
|
5
|
+
* icon 名称 (上传到阿里云iconfont项目,上传icon命名格式必须是xxx_icon, xxx代表icon的名称也就是icon的name属性,比如:search_icon,delete_icon 注意icon上传时需要选择"去除颜色并提交"。使用的时候颜色通过color去设置)
|
|
6
|
+
* iconfont远端地址:https://www.iconfont.cn/manage/index?spm=a313x.manage_type_myprojects.i1.db775f1f3.5c9d3a81OoaadK&manage_type=myprojects&projectId=5088009
|
|
7
|
+
* seacch 搜索Icon delete删除Icon
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Icon: React.FC<IconProps>;
|
|
12
|
+
export default Icon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import e from"classnames";import{Text as t}from"@tarojs/components";var s=["name","className"],m=function(m){var n=m.name,c=m.className,i=o(m,s);return r(t,a({className:e("iconfont","icon-".concat(n,"_icon"),c)},i))};export{m as default};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont";
|
|
3
|
+
/* Project id 5088009 */
|
|
4
|
+
src: url('iconfont.woff2?t=1766462693408') format('woff2'), url('iconfont.woff?t=1766462693408') format('woff'), url('iconfont.ttf?t=1766462693408') format('truetype');
|
|
5
|
+
}
|
|
6
|
+
.iconfont {
|
|
7
|
+
font-family: "iconfont" !important;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
|
13
|
+
.icon-telephone_icon:before {
|
|
14
|
+
content: "\e60f";
|
|
15
|
+
}
|
|
16
|
+
.icon-wechat_icon:before {
|
|
17
|
+
content: "\e610";
|
|
18
|
+
}
|
|
19
|
+
.icon-search_icon:before {
|
|
20
|
+
content: "\e611";
|
|
21
|
+
}
|
|
22
|
+
.icon-edit_icon:before {
|
|
23
|
+
content: "\e60e";
|
|
24
|
+
}
|
|
25
|
+
.icon-add-circle_icon:before {
|
|
26
|
+
content: "\e612";
|
|
27
|
+
}
|
|
28
|
+
.icon-checked-fill_icon:before {
|
|
29
|
+
content: "\e60d";
|
|
30
|
+
}
|
|
31
|
+
.icon-quote-fill_icon:before {
|
|
32
|
+
content: "\e613";
|
|
33
|
+
}
|
|
34
|
+
.icon-vedio_icon:before {
|
|
35
|
+
content: "\e614";
|
|
36
|
+
}
|
|
37
|
+
.icon-delete-fill_icon:before {
|
|
38
|
+
content: "\e615";
|
|
39
|
+
}
|
|
40
|
+
.icon-close_icon:before {
|
|
41
|
+
content: "\e616";
|
|
42
|
+
}
|
|
43
|
+
.icon-time_icon:before {
|
|
44
|
+
content: "\e617";
|
|
45
|
+
}
|
|
46
|
+
.icon-phone_icon:before {
|
|
47
|
+
content: "\e618";
|
|
48
|
+
}
|
|
49
|
+
.icon-arrow-right_icon:before {
|
|
50
|
+
content: "\e619";
|
|
51
|
+
}
|
|
52
|
+
.icon-attention_icon:before {
|
|
53
|
+
content: "\e61a";
|
|
54
|
+
}
|
|
55
|
+
.icon-comment_icon:before {
|
|
56
|
+
content: "\e61b";
|
|
57
|
+
}
|
|
58
|
+
.icon-camera_icon:before {
|
|
59
|
+
content: "\e61c";
|
|
60
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './iconfont.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './iconfont.css';
|
|
@@ -17,6 +17,18 @@ export interface InputProps extends TaroInputProps {
|
|
|
17
17
|
* 边框样式 outlined 边框 borderless 无边框样式
|
|
18
18
|
*/
|
|
19
19
|
variant?: 'outlined' | 'borderless';
|
|
20
|
+
/**
|
|
21
|
+
* change事件 返回输入值
|
|
22
|
+
*/
|
|
23
|
+
onChange?: (val: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* 输入框的值触发 注意点击删除Icon会触发onChange
|
|
26
|
+
*/
|
|
27
|
+
onDelete?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* 自定义前缀Icon
|
|
30
|
+
*/
|
|
31
|
+
prefixIcon?: React.ReactNode;
|
|
20
32
|
}
|
|
21
33
|
declare const Input: React.FC<InputProps>;
|
|
22
34
|
export default Input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{objectWithoutProperties as e,slicedToArray as
|
|
1
|
+
import{objectWithoutProperties as e,slicedToArray as n,objectSpread2 as l}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as a,jsx as t,Fragment as o}from"react/jsx-runtime";import i from"react";import r from"classnames";import{View as u,Input as c,Text as s}from"@tarojs/components";import p from"../icon/index.js";var m=["variant","allowClear","showCount","clearIcon","className","style","onClick","onInput","maxlength","defaultValue","onChange","onDelete","prefixIcon"],d=function(d){var f=d.variant,h=void 0===f?"outlined":f,v=d.allowClear,y=void 0===v||v,x=d.showCount;d.clearIcon;var C=d.className,g=d.style,N=d.onClick,I=d.onInput,w=d.maxlength,j=d.defaultValue,b=d.onChange,k=d.onDelete,S=d.prefixIcon,D=e(d,m),P=i.useState(j||""),T=n(P,2),V=T[0],_=T[1],z=i.useRef(null);return i.useEffect(function(){"value"in D&&_(D.value||"")},[D]),a(u,{className:r("ypmini-taro-input-wrapper",{"ypmini-taro-input-borderless-wrapper":"borderless"===h},C),style:g,onClick:N,children:[S?t(u,{className:"ypmini-taro-input-prefix-icon-wrapper",children:S}):null,t(c,l({ref:z,placeholderStyle:"font-size: 17px;color: #00000040;",placeholderTextColor:"#00000040",value:V,onInput:function(e){_(e.detail.value),I&&I(e),b&&b(e.detail.value)},maxlength:w,className:"ypmini-taro-input"},D)),y&&null!=V&&V.length?t(u,{className:"ypmini-taro-input-clear",onClick:function(){_(""),k&&k(),b&&b("")},children:t(p,{className:"ypmini-taro-input-clear-icon",name:"delete-fill"})}):null,x?a(u,{className:"ypmini-taro-input-count",children:[t(s,{className:r("ypmini-taro-input-count-current",{"ypmini-taro-input-count-current-light":(null==V?void 0:V.length)>0}),children:null==V?void 0:V.length}),w?a(o,{children:["/",t(s,{className:"ypmini-taro-input-count-total",children:w||0})]}):null]}):null]})};export{d as default};
|