@yup/taro-ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_virtual/_commonjsHelpers.js +1 -3
- package/es/_virtual/_rollupPluginBabelHelpers.js +1 -120
- package/es/_virtual/index.js +1 -1
- package/es/_virtual/jsx-runtime.js +1 -1
- package/es/_virtual/react-jsx-runtime.development.js +1 -1
- package/es/_virtual/react-jsx-runtime.production.min.js +1 -1
- package/es/components/button/index.js +1 -35
- package/es/components/button/style/index.css +2 -1
- package/es/components/button/style/index.js +1 -1
- package/es/components/checkbox/checkbox-group.js +1 -12
- package/es/components/checkbox/index.js +1 -23
- package/es/components/checkbox/style/index.css +2 -1
- package/es/components/checkbox/style/index.js +1 -1
- package/es/components/form/form-item.js +1 -14
- package/es/components/form/index.js +1 -18
- package/es/components/form/style/index.css +2 -1
- package/es/components/form/style/index.js +1 -1
- package/es/components/input/index.js +1 -57
- package/es/components/input/style/index.css +2 -1
- package/es/components/input/style/index.js +1 -1
- package/es/components/radio/index.js +1 -18
- package/es/components/radio/radio-group.js +1 -16
- package/es/components/radio/style/index.js +2 -2
- package/es/components/radio/style/radio.css +2 -1
- package/es/components/toast/index.js +1 -1
- package/es/components/toast/style/index.css +2 -1
- package/es/components/toast/style/index.js +1 -1
- package/es/components/toast/toast.js +1 -89
- package/es/components/toast/withToast.js +1 -9
- package/es/global.css +2 -1
- package/es/index.js +1 -2
- package/es/node_modules/classnames/index.js +1 -56
- package/es/node_modules/react/cjs/react-jsx-runtime.development.js +1 -1137
- package/es/node_modules/react/cjs/react-jsx-runtime.production.min.js +3 -41
- package/es/node_modules/react/jsx-runtime.js +1 -6
- package/es/utils/is.js +1 -9
- package/package.json +1 -1
- package/es/components/button/style/button.css +0 -3
- package/es/components/button/style/button.less +0 -3
- package/es/components/button/style/css.js +0 -1
- package/es/components/button/style/index.less +0 -81
- package/es/components/checkbox/style/css.js +0 -1
- package/es/components/checkbox/style/index.less +0 -59
- package/es/components/form/style/css.js +0 -1
- package/es/components/form/style/index.less +0 -51
- package/es/components/input/style/css.js +0 -1
- package/es/components/input/style/index.less +0 -36
- package/es/components/radio/style/css.js +0 -2
- package/es/components/radio/style/group.less +0 -12
- package/es/components/radio/style/radio.less +0 -32
- package/es/components/toast/style/css.js +0 -1
- package/es/components/toast/style/index.less +0 -23
- package/es/global/global.less +0 -1
- package/es/global/theme-default.less +0 -37
|
@@ -1,3 +1 @@
|
|
|
1
|
-
function
|
|
2
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3
|
-
}export{getDefaultExportFromCjs};
|
|
1
|
+
function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{e as getDefaultExportFromCjs};
|
|
@@ -1,120 +1 @@
|
|
|
1
|
-
function
|
|
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};
|
|
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=y(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function n(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,c=!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){c=!0,o=r}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}function o(){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(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 a(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){e(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function u(r,t){if(null==r)return{};var e,n,o=l(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 l(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 c(r,e){return t(r)||n(r,e)||b(r,e)||o()}function f(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 y(r){var t=f(r,"string");return"symbol"==typeof t?t:t+""}function s(r){return s="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},s(r)}function b(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 defineProperty,n as iterableToArrayLimit,o as nonIterableRest,a as objectSpread2,u as objectWithoutProperties,l as objectWithoutPropertiesLoose,c as slicedToArray,f as toPrimitive,y as toPropertyKey,s as typeof,b as unsupportedIterableToArray};
|
package/es/_virtual/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e={exports:{}};export{e as __module};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e={exports:{}};export{e as __module};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r={};export{r as __exports};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r={};export{r as __exports};
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
import
|
|
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};
|
|
1
|
+
import{objectWithoutProperties as t,objectSpread2 as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as o}from"../../node_modules/react/jsx-runtime.js";import{Button as e,Text as i}from"@tarojs/components";import r from"../../node_modules/classnames/index.js";var n=["children","styleType","className","block","disabled","disabledStyle","icon"],s=function(s){var l=s.children,d=s.styleType,m=void 0===d?"default":d,c=s.className,p=s.block,u=s.disabled,b=s.disabledStyle,y=s.icon,j=t(s,n);return o.jsx(e,a(a({className:r("ypmini-taro-button",{"ypmini-taro-button-primary":"primary"===m,"ypmini-taro-button-primary-disabled":"primary"===m&&(u||b),"ypmini-taro-button-secondary":"secondary"===m,"ypmini-taro-button-secondary-disabled":"secondary"===m&&(u||b),"ypmini-taro-button-default":"default"===m,"ypmini-taro-button-default-disabled":"default"===m&&(u||b),"ypmini-taro-button-block":p},c),disabled:u},j),{},{children:y?o.jsxs(i,{className:"ypmini-taro-button-icon-wrapper",children:[o.jsx(i,{className:"ypmini-taro-button-icon",children:y}),o.jsx(i,{className:"ypmini-taro-button-icon-content",children:l})]}):l}))};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.
|
|
1
|
+
import './index.css';
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
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};
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as r}from"../../node_modules/react/jsx-runtime.js";import t from"../../node_modules/classnames/index.js";import p from"@yup/taro-checkbox";var s=["type","block"],c=function(c){var i=c.type,u=c.block,a=o(c,s);return r.jsx(p.Group,e({className:t("ypmini-checkbox-group",{"ypmini-checkbox-group-button":"button"===i,"ypmini-checkbox-group-block":u})},a))};export{c as default};
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import
|
|
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};
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as r}from"../../node_modules/react/jsx-runtime.js";import t from"../../node_modules/classnames/index.js";import{View as s}from"@tarojs/components";import c from"@yup/taro-checkbox";import i from"./checkbox-group.js";var n=["className","children","type"],m=function(i){var m=i.className,a=i.children,p=i.type,u=void 0===p?"button":p,l=o(i,n);return r.jsx(c,e({className:t("ypmini-checkbox",m),icon:function(o){return"button"===u?r.jsx(s,{className:t("ypmini-checkbox-button",{"ypmini-checkbox-button-checked":o}),children:a}):a}},l))};m.Group=i;export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.
|
|
1
|
+
import './index.css';
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
import
|
|
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};
|
|
1
|
+
import{objectWithoutProperties as e,objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as i}from"../../node_modules/react/jsx-runtime.js";import m from"../../node_modules/classnames/index.js";import o from"@yup/taro-form";var s=["children","required","className"],a=function(a){var t=a.children,l=a.required,n=a.className,u=e(a,s);return i.jsx(o.Item,r(r({className:m("ypmini-form-item",{"ypmini-form-item-required":l},n)},u),{},{children:t}))};export{a as default};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
import
|
|
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};
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as e}from"../../node_modules/react/jsx-runtime.js";import t from"../../node_modules/classnames/index.js";import i from"@yup/taro-form";import m from"./form-item.js";var a=["children","layout"],s=function(m){var s=m.children,l=m.layout,n=void 0===l?"vertical":l,u=r(m,a);return e.jsx(i,o(o({className:t("ypmini-form",{"ypmini-form-horizontal":"horizontal"===n,"ypmini-form-vertical":"vertical"===n})},u),{},{children:s}))};s.Item=m,s.useForm=i.useForm,s.useWatch=i.useWatch;export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.
|
|
1
|
+
import './index.css';
|
|
@@ -1,57 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var Input = function Input(_ref) {
|
|
3
|
-
_ref.variant;
|
|
4
|
-
_ref.allowClear;
|
|
5
|
-
var showCount = _ref.showCount;
|
|
6
|
-
_ref.clearIcon;
|
|
7
|
-
var className = _ref.className,
|
|
8
|
-
style = _ref.style,
|
|
9
|
-
onClick = _ref.onClick,
|
|
10
|
-
onInput = _ref.onInput,
|
|
11
|
-
maxlength = _ref.maxlength;
|
|
12
|
-
_ref.placeholderStyle;
|
|
13
|
-
var defaultValue = _ref.defaultValue,
|
|
14
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
-
var _React$useState = React.useState(defaultValue || ''),
|
|
16
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
17
|
-
innerValue = _React$useState2[0],
|
|
18
|
-
setInnerValue = _React$useState2[1];
|
|
19
|
-
var handleChange = function handleChange(e) {
|
|
20
|
-
setInnerValue(e.detail.value);
|
|
21
|
-
onInput && onInput(e);
|
|
22
|
-
};
|
|
23
|
-
// 受控
|
|
24
|
-
React.useEffect(function () {
|
|
25
|
-
if ("value" in props) {
|
|
26
|
-
setInnerValue(props.value || "");
|
|
27
|
-
}
|
|
28
|
-
}, [props]);
|
|
29
|
-
return jsxRuntimeExports.jsxs(View, {
|
|
30
|
-
className: cns("ypmini-taro-input-wrapper", className),
|
|
31
|
-
style: style,
|
|
32
|
-
onClick: onClick,
|
|
33
|
-
children: [jsxRuntimeExports.jsx(Input$1, _objectSpread2({
|
|
34
|
-
placeholderStyle: "font-size: 17px;color: #00000040;",
|
|
35
|
-
placeholderTextColor: "#00000040",
|
|
36
|
-
value: innerValue,
|
|
37
|
-
onInput: handleChange,
|
|
38
|
-
maxlength: maxlength,
|
|
39
|
-
className: "ypmini-taro-input"
|
|
40
|
-
}, props)), jsxRuntimeExports.jsx(View, {
|
|
41
|
-
className: "ypmini-taro-input-clear"
|
|
42
|
-
}), showCount ? jsxRuntimeExports.jsxs(View, {
|
|
43
|
-
className: "ypmini-taro-input-count",
|
|
44
|
-
children: [jsxRuntimeExports.jsx(Text, {
|
|
45
|
-
className: cns("ypmini-taro-input-count-current", {
|
|
46
|
-
"ypmini-taro-input-count-current-light": (innerValue === null || innerValue === void 0 ? void 0 : innerValue.length) > 0
|
|
47
|
-
}),
|
|
48
|
-
children: innerValue === null || innerValue === void 0 ? void 0 : innerValue.length
|
|
49
|
-
}), maxlength ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
50
|
-
children: ["/", jsxRuntimeExports.jsx(Text, {
|
|
51
|
-
className: "ypmini-taro-input-count-total",
|
|
52
|
-
children: maxlength || 0
|
|
53
|
-
})]
|
|
54
|
-
}) : null]
|
|
55
|
-
}) : null]
|
|
56
|
-
});
|
|
57
|
-
};export{Input as default};
|
|
1
|
+
import{objectWithoutProperties as e,slicedToArray as l,objectSpread2 as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as t}from"../../node_modules/react/jsx-runtime.js";import n from"react";import o from"../../node_modules/classnames/index.js";import{View as r,Input as s,Text as i}from"@tarojs/components";var u=["variant","allowClear","showCount","clearIcon","className","style","onClick","onInput","maxlength","placeholderStyle","defaultValue"],c=function(c){c.variant,c.allowClear;var p=c.showCount;c.clearIcon;var m=c.className,d=c.style,h=c.onClick,j=c.onInput,x=c.maxlength;c.placeholderStyle;var f=c.defaultValue,y=e(c,u),v=n.useState(f||""),g=l(v,2),C=g[0],N=g[1];return n.useEffect(function(){"value"in y&&N(y.value||"")},[y]),t.jsxs(r,{className:o("ypmini-taro-input-wrapper",m),style:d,onClick:h,children:[t.jsx(s,a({placeholderStyle:"font-size: 17px;color: #00000040;",placeholderTextColor:"#00000040",value:C,onInput:function(e){N(e.detail.value),j&&j(e)},maxlength:x,className:"ypmini-taro-input"},y)),t.jsx(r,{className:"ypmini-taro-input-clear"}),p?t.jsxs(r,{className:"ypmini-taro-input-count",children:[t.jsx(i,{className:o("ypmini-taro-input-count-current",{"ypmini-taro-input-count-current-light":(null==C?void 0:C.length)>0}),children:null==C?void 0:C.length}),x?t.jsxs(t.Fragment,{children:["/",t.jsx(i,{className:"ypmini-taro-input-count-total",children:x||0})]}):null]}):null]})};export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.
|
|
1
|
+
import './index.css';
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var Radio = function Radio(_ref) {
|
|
3
|
-
var children = _ref.children;
|
|
4
|
-
_ref.type;
|
|
5
|
-
var rstProps = _objectWithoutProperties(_ref, _excluded);
|
|
6
|
-
return jsxRuntimeExports.jsx(YpRadio, _objectSpread2({
|
|
7
|
-
className: 'ypmini-taro-radio',
|
|
8
|
-
icon: function icon(checked) {
|
|
9
|
-
return jsxRuntimeExports.jsx(View, {
|
|
10
|
-
className: cns("ypmini-taro-radio-button", {
|
|
11
|
-
'ypmini-taro-radio-button-checked': checked
|
|
12
|
-
}),
|
|
13
|
-
children: children
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}, rstProps));
|
|
17
|
-
};
|
|
18
|
-
Radio.Group = RadioGroup;export{Radio as default};
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as t}from"../../node_modules/react/jsx-runtime.js";import{View as e}from"@tarojs/components";import i from"../../node_modules/classnames/index.js";import a from"@yup/taro-radio";import s from"./radio-group.js";var n=["children","type"],m=function(s){var m=s.children;s.type;var p=r(s,n);return t.jsx(a,o({className:"ypmini-taro-radio",icon:function(r){return t.jsx(e,{className:i("ypmini-taro-radio-button",{"ypmini-taro-radio-button-checked":r}),children:m})}},p))};m.Group=s;export{m as default};
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var RadioGroup = function RadioGroup(_ref) {
|
|
3
|
-
var children = _ref.children,
|
|
4
|
-
type = _ref.type,
|
|
5
|
-
_ref$block = _ref.block,
|
|
6
|
-
block = _ref$block === void 0 ? false : _ref$block,
|
|
7
|
-
rst = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
-
return jsxRuntimeExports.jsx(YpRadio.Group, _objectSpread2(_objectSpread2({
|
|
9
|
-
className: cns("ypmini-radio-group", {
|
|
10
|
-
'ypmini-radio-group--button': type === 'button',
|
|
11
|
-
'ypmini-radio-group--block': block
|
|
12
|
-
})
|
|
13
|
-
}, rst), {}, {
|
|
14
|
-
children: children
|
|
15
|
-
}));
|
|
16
|
-
};export{RadioGroup as default};
|
|
1
|
+
import{objectWithoutProperties as o,objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as e}from"../../node_modules/react/jsx-runtime.js";import i from"../../node_modules/classnames/index.js";import t from"@yup/taro-radio";var a=["children","type","block"],p=function(p){var s=p.children,l=p.type,n=p.block,u=void 0!==n&&n,m=o(p,a);return e.jsx(t.Group,r(r({className:i("ypmini-radio-group",{"ypmini-radio-group--button":"button"===l,"ypmini-radio-group--block":u})},m),{},{children:s}))};export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './radio.
|
|
2
|
-
import './group.
|
|
1
|
+
import './radio.css';
|
|
2
|
+
import './group.css';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"./toast.js";import o from"./withToast.js";t.withToast=o;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.
|
|
1
|
+
import './index.css';
|
|
@@ -1,89 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
_excluded2 = ["className"];
|
|
3
|
-
var toastInstance = {};
|
|
4
|
-
var Toast = React.forwardRef(function (props, ref) {
|
|
5
|
-
var _useState = useState(false),
|
|
6
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
7
|
-
visible = _useState2[0],
|
|
8
|
-
setVisible = _useState2[1];
|
|
9
|
-
var _useState3 = useState(''),
|
|
10
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
11
|
-
content = _useState4[0],
|
|
12
|
-
setContent = _useState4[1];
|
|
13
|
-
var _React$useState = React.useState(),
|
|
14
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
15
|
-
wrapperRstProps = _React$useState2[0],
|
|
16
|
-
setWrapperRstProps = _React$useState2[1];
|
|
17
|
-
var durationRef = React.useRef(2000);
|
|
18
|
-
var timer = React.useRef(null);
|
|
19
|
-
React.useImperativeHandle(ref, function () {
|
|
20
|
-
return {
|
|
21
|
-
show: function show(options) {
|
|
22
|
-
if (typeof options === 'string') {
|
|
23
|
-
setContent(options);
|
|
24
|
-
} else {
|
|
25
|
-
var _content = options.content,
|
|
26
|
-
_options$duration = options.duration,
|
|
27
|
-
duration = _options$duration === void 0 ? 2000 : _options$duration,
|
|
28
|
-
rst = _objectWithoutProperties(options, _excluded);
|
|
29
|
-
if (isNumber(duration)) {
|
|
30
|
-
durationRef.current = duration;
|
|
31
|
-
}
|
|
32
|
-
setWrapperRstProps(rst);
|
|
33
|
-
setContent(_content);
|
|
34
|
-
}
|
|
35
|
-
if (timer.current) {
|
|
36
|
-
clearTimeout(timer.current);
|
|
37
|
-
}
|
|
38
|
-
setVisible(true);
|
|
39
|
-
var t = setTimeout(function () {
|
|
40
|
-
setVisible(false);
|
|
41
|
-
}, durationRef.current);
|
|
42
|
-
timer.current = t;
|
|
43
|
-
},
|
|
44
|
-
hide: function hide() {
|
|
45
|
-
clearTimeout(timer.current);
|
|
46
|
-
setVisible(false);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
if (!visible) return null;
|
|
51
|
-
var _ref = wrapperRstProps || {},
|
|
52
|
-
className = _ref.className,
|
|
53
|
-
rstProps = _objectWithoutProperties(_ref, _excluded2);
|
|
54
|
-
return jsxRuntimeExports.jsx(View, _objectSpread2(_objectSpread2({
|
|
55
|
-
className: cns('ypmini-toast-container', className)
|
|
56
|
-
}, rstProps), {}, {
|
|
57
|
-
children: jsxRuntimeExports.jsx(Text, {
|
|
58
|
-
className: 'ypmini-toast-content',
|
|
59
|
-
children: content
|
|
60
|
-
})
|
|
61
|
-
}));
|
|
62
|
-
});
|
|
63
|
-
function createToast() {
|
|
64
|
-
var _toastInstance;
|
|
65
|
-
if (!((_toastInstance = toastInstance) !== null && _toastInstance !== void 0 && _toastInstance.ref)) {
|
|
66
|
-
var ref = React.createRef();
|
|
67
|
-
var ToastWrapper = function ToastWrapper() {
|
|
68
|
-
return jsxRuntimeExports.jsx(Toast, {
|
|
69
|
-
ref: ref
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
toastInstance = {
|
|
73
|
-
ref: ref,
|
|
74
|
-
ToastWrapper: ToastWrapper
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
return toastInstance;
|
|
78
|
-
}
|
|
79
|
-
var Toast$1 = {
|
|
80
|
-
createToast: createToast,
|
|
81
|
-
show: function show(options) {
|
|
82
|
-
var _toastInstance2;
|
|
83
|
-
(_toastInstance2 = toastInstance) === null || _toastInstance2 === void 0 || (_toastInstance2 = _toastInstance2.ref) === null || _toastInstance2 === void 0 || (_toastInstance2 = _toastInstance2.current) === null || _toastInstance2 === void 0 || _toastInstance2.show(options);
|
|
84
|
-
},
|
|
85
|
-
hide: function hide() {
|
|
86
|
-
var _toastInstance3;
|
|
87
|
-
(_toastInstance3 = toastInstance) === null || _toastInstance3 === void 0 || (_toastInstance3 = _toastInstance3.ref) === null || _toastInstance3 === void 0 || (_toastInstance3 = _toastInstance3.current) === null || _toastInstance3 === void 0 || _toastInstance3.hide();
|
|
88
|
-
}
|
|
89
|
-
};export{Toast$1 as default};
|
|
1
|
+
import{slicedToArray as r,objectWithoutProperties as e,objectSpread2 as t}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as n}from"../../node_modules/react/jsx-runtime.js";import o,{useState as i}from"react";import{View as a,Text as u}from"@tarojs/components";import s from"../../node_modules/classnames/index.js";import{isNumber as l}from"../../utils/is.js";var c=["content","duration"],f=["className"],m={},d=o.forwardRef(function(m,d){var v=i(!1),p=r(v,2),j=p[0],h=p[1],x=i(""),T=r(x,2),w=T[0],y=T[1],N=o.useState(),R=r(N,2),_=R[0],b=R[1],g=o.useRef(2e3),H=o.useRef(null);if(o.useImperativeHandle(d,function(){return{show:function(r){if("string"==typeof r)y(r);else{var t=r.content,n=r.duration,o=void 0===n?2e3:n,i=e(r,c);l(o)&&(g.current=o),b(i),y(t)}H.current&&clearTimeout(H.current),h(!0);var a=setTimeout(function(){h(!1)},g.current);H.current=a},hide:function(){clearTimeout(H.current),h(!1)}}}),!j)return null;var P=_||{},S=P.className,W=e(P,f);return n.jsx(a,t(t({className:s("ypmini-toast-container",S)},W),{},{children:n.jsx(u,{className:"ypmini-toast-content",children:w})}))});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.jsx(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,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var _Toast$createToast = Toast.createToast(),
|
|
3
|
-
ToastWrapper = _Toast$createToast.ToastWrapper;
|
|
4
|
-
return function (props) {
|
|
5
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
6
|
-
children: [jsxRuntimeExports.jsx(ToastWrapper, {}), jsxRuntimeExports.jsx(WrappedComponent, _objectSpread2({}, props))]
|
|
7
|
-
});
|
|
8
|
-
};
|
|
9
|
-
}export{withToast as default};
|
|
1
|
+
import{objectSpread2 as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{j as t}from"../../node_modules/react/jsx-runtime.js";import e from"./toast.js";function o(o){var s=e.createToast().ToastWrapper;return function(e){return t.jsxs(t.Fragment,{children:[t.jsx(s,{}),t.jsx(o,r({},e))]})}}export{o as default};
|
package/es/global.css
CHANGED
package/es/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
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 Toast}from'./components/toast/toast.js';
|
|
1
|
+
import"./global.css";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 Toast}from"./components/toast/toast.js";
|