@yup/taro-ui 0.1.0 → 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.
Files changed (54) hide show
  1. package/README.md +182 -6
  2. package/es/_virtual/_rollupPluginBabelHelpers.js +3 -1
  3. package/es/components/avatar/index.d.ts +18 -0
  4. package/es/components/avatar/index.js +1 -0
  5. package/es/components/avatar/style/index.css +28 -0
  6. package/es/components/avatar/style/index.d.ts +2 -0
  7. package/es/components/avatar/style/index.js +2 -0
  8. package/es/components/button/style/index.css +79 -61
  9. package/es/components/city-selector/hooks/useLevel2Multiple.d.ts +24 -0
  10. package/es/components/city-selector/hooks/useLevel2Multiple.js +1 -0
  11. package/es/components/city-selector/hooks/useLevel2Single.d.ts +19 -0
  12. package/es/components/city-selector/hooks/useLevel2Single.js +1 -0
  13. package/es/components/city-selector/hooks/useMultiple.d.ts +28 -0
  14. package/es/components/city-selector/hooks/useMultiple.js +1 -0
  15. package/es/components/city-selector/hooks/useSingle.d.ts +23 -0
  16. package/es/components/city-selector/hooks/useSingle.js +1 -0
  17. package/es/components/city-selector/index.d.ts +5 -0
  18. package/es/components/city-selector/index.js +1 -0
  19. package/es/components/city-selector/style/index.css +153 -0
  20. package/es/components/city-selector/style/index.d.ts +2 -0
  21. package/es/components/city-selector/util.d.ts +2 -0
  22. package/es/components/city-selector/util.js +1 -0
  23. package/es/components/dialog/context.d.ts +4 -0
  24. package/es/components/dialog/index.d.ts +31 -0
  25. package/es/components/dialog/index.js +1 -0
  26. package/es/components/dialog/style/index.css +113 -0
  27. package/es/components/dialog/style/index.d.ts +2 -0
  28. package/es/components/dialog/style/index.js +2 -0
  29. package/es/components/icon/index.js +1 -1
  30. package/es/components/icon/style/iconfont.css +13 -1
  31. package/es/components/icon/style/iconfont.ttf +0 -0
  32. package/es/components/icon/style/iconfont.woff +0 -0
  33. package/es/components/icon/style/iconfont.woff2 +0 -0
  34. package/es/components/input/style/index.css +19 -19
  35. package/es/components/media-uploader/index.d.ts +123 -0
  36. package/es/components/media-uploader/index.js +1 -0
  37. package/es/components/media-uploader/style/index.css +93 -0
  38. package/es/components/media-uploader/style/index.d.ts +2 -0
  39. package/es/components/media-uploader/style/index.js +2 -0
  40. package/es/components/tag/index.d.ts +18 -0
  41. package/es/components/tag/index.js +1 -0
  42. package/es/components/tag/style/index.css +92 -0
  43. package/es/components/tag/style/index.d.ts +2 -0
  44. package/es/components/tag/style/index.js +2 -0
  45. package/es/global/global.css +3 -0
  46. package/es/global/theme-default.css +3 -0
  47. package/es/index.d.ts +20 -0
  48. package/es/index.js +1 -1
  49. package/es/style/iconfont.ttf +0 -0
  50. package/es/style/iconfont.woff +0 -0
  51. package/es/style/iconfont.woff2 +0 -0
  52. package/es/style/index.css +114 -81
  53. package/es/utils/is.js +1 -1
  54. package/package.json +5 -3
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as e,objectSpread2 as n,createForOfIteratorHelper as l,asyncToGenerator as i,regenerator as t}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";import r from"react";import a from"classnames";import{View as u,Text as d}from"@tarojs/components";import{isPromise as s}from"../../utils/is.js";import m from"../button/index.js";import p from"../icon/index.js";import v from"./hooks/useLevel2Multiple.js";import f from"./hooks/useLevel2Single.js";import y from"./hooks/useMultiple.js";import h from"./hooks/useSingle.js";import{isMunicipality as k}from"./util.js";var C=["className","cityList","level","max","maxCount","defaultValue","multiple","municipality","beforeSelect","onChange","onClear","onConfirm","onRemove","onSelect","countArea","panelTitle","checkedIcon","clearButtonProps","confirmButtonProps","checkedMarkForSingle","checkedMarkForMultipe"],S=function(S){var N,M,g,L=S.className,b=S.cityList,D=S.level,j=S.max,P=void 0===j?9:j,x=S.maxCount,T=void 0===x?P:x,I=S.defaultValue,R=S.multiple,V=void 0===R||R,w=S.municipality,B=void 0===w?[]:w,F=S.beforeSelect,z=S.onChange,A=S.onClear,H=S.onConfirm,_=S.onRemove,G=S.onSelect,O=S.countArea,W=S.panelTitle,q=S.checkedIcon,E=S.clearButtonProps,J=S.confirmButtonProps,K=S.checkedMarkForSingle,Q=S.checkedMarkForMultipe,U=e(S,C),X=r.useMemo(function(){var e=function(l,i){var t;return null==l||null===(t=l.filter(function(e){return!i&&!e.parentId||e.parentId===i}))||void 0===t?void 0:t.map(function(i){return n(n({},i),{},{children:e(l,i.id)})})};return e(b,void 0)},[b]),Y=r.useMemo(function(){var e={},n=function(i){var t,c=l(i);try{for(c.s();!(t=c.n()).done;){var o,r=t.value;e[r.id]=r,null!=r&&null!==(o=r.children)&&void 0!==o&&o.length&&n(r.children)}}catch(e){c.e(e)}finally{c.f()}};return n(X),e},[X]),Z=function(e,n){if(!F)return Promise.resolve(!0);var l=null==F?void 0:F(e,n);return s(l)?l:Promise.resolve(l)},$=function(e){if(!_)return Promise.resolve(!0);var n=null==_?void 0:_(e);return s(n)?n:Promise.resolve(n)},ee=function(e){if(!A)return Promise.resolve(!0);var n=null==A?void 0:A(e);return s(n)?n:Promise.resolve(n)},ne=v(n({cityMap:Y,municipality:B,beforeSelect:Z,max:P,onRemove:$,onChange:z,onSelect:G,defaultValue:I},U)),le=ne.handleClear,ie=ne.handleRemove,te=ne.selectedDataTopLevel,ce=ne.handleLevel1Click,oe=ne.handleLevel2Click,re=ne.level1SelectedData,ae=ne.level2SelectedData,ue=f(n({cityMap:Y,municipality:B,onChange:z,beforeSelect:Z,defaultValue:I},U)),de=ue.selectedDataTopLevel,se=ue.handleLevel1Click,me=ue.handleLevel2Click,pe=ue.level1SelectedData,ve=ue.level2SelectedData,fe=y(n({cityMap:Y,municipality:B,max:P,onChange:z,onSelect:G,onRemove:$,beforeSelect:Z,defaultValue:I},U)),ye=fe.handleClear,he=fe.handleRemove,ke=fe.selectedDataTopLevel,Ce=fe.selectedDataSecondaryLevel,Se=fe.municipalitySelectedData,Ne=fe.handleLevel1Click,Me=fe.handleLevel2Click,ge=fe.handleLevel3Click,Le=fe.level1SelectedData,be=fe.level2SelectedData,De=fe.level3SelectedData,je=h(n({cityMap:Y,municipality:B,onChange:z,beforeSelect:Z,defaultValue:I},U)),Pe=je.selectedDataTopLevel,xe=je.selectedDataSecondaryLevel,Te=je.municipalitySelectedData,Ie=je.handleLevel1Click,Re=je.handleLevel2Click,Ve=je.handleLevel3Click,we=je.level1SelectedData,Be=je.level2SelectedData,Fe=je.level3SelectedData,ze=r.useMemo(function(){return V?2===D?re:Le:2===D?pe:we},[D,V,re,Le,pe,we]),Ae=r.useMemo(function(){return V?2===D?ae:be:2===D?ve:Be},[D,V,ae,be,ve,Be]),He=function(){var e=i(t().m(function e(){return t().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ee(Ke);case 1:if(e.v){e.n=2;break}return e.a(2);case 2:if(3!==D){e.n=3;break}return ye(),e.a(2);case 3:le();case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),_e=function(){var e=i(t().m(function e(n){return t().w(function(e){for(;;)switch(e.n){case 0:if(3!==D){e.n=1;break}return he(n),e.a(2);case 1:ie(n);case 2:return e.a(2)}},e)}));return function(n){return e.apply(this,arguments)}}(),Ge=function(e){var n,l,i;return 3===D?V?k(e.parentId,B)?null==Se||null===(l=Se.map(function(e){return e.id}))||void 0===l||null===(i=l.includes)||void 0===i?void 0:i.call(l,e.id):(null==be?void 0:be.id)===(null==e?void 0:e.id):k(e.parentId,B)?(null==Te?void 0:Te.id)===e.id:(null==Be?void 0:Be.id)===e.id:V?null==ae||null===(n=ae.map(function(e){return e.id}))||void 0===n?void 0:n.includes(null==e?void 0:e.id):(null==ve?void 0:ve.id)===(null==e?void 0:e.id)},Oe=function(e){var n;return V?null==De||null===(n=De.map(function(e){return e.id}))||void 0===n?void 0:n.includes(e.id):(null==Fe?void 0:Fe.id)===e.id},We=function(e){return K?K(e):o(u,{className:"ypmini-city-selector-dot-badge"})},qe=function(e){return q?q(e):o(p,{className:"ypmini-city-selector-checked-icon",name:"checked"})},Ee=function(e){return Q?null==Q?void 0:Q(e):o(u,{className:"ypmini-city-selector-count-badge",children:e})},Je=r.useMemo(function(){return null!=Se&&Se.length?Se:De},[Se,De]),Ke=r.useMemo(function(){return 2===D?ae:Je},[D,Je,ae]),Qe=r.useMemo(function(){return null==Ke?void 0:Ke.length},[Ke]),Ue=r.useMemo(function(){return 2===D?te:ke},[D,te,ke]),Xe=r.useMemo(function(){return 2===D?de:Pe},[D,de,Pe]);return c(u,n(n({className:a("ypmini-city-selector-wrapper",L)},U),{},{children:[c(u,{className:"ypmini-city-selector",children:[o(u,{className:a("ypmini-city-selector-column","ypmini-city-selector-column-1",{"ypmini-city-selector-column-secondary":2===D}),children:null==X?void 0:X.map(function(e){return c(u,{className:a("ypmini-city-selector-column-item",{"ypmini-city-selector-column-item-active":(null==ze?void 0:ze.id)===e.id}),onClick:function(){return function(e){if(V)return 2===D?void ce(e):void Ne(e);2!==D?Ie(e):se(e)}(e)},children:[e.name,V||(null==Xe?void 0:Xe.id)!==e.id?null:We(e),V&&(null==Ue?void 0:Ue.id)===e.id?Ee(Qe||0):null]},e.id)})}),o(u,{className:a("ypmini-city-selector-column","ypmini-city-selector-column-2",{"ypmini-city-selector-column-secondary":2===D}),children:null==ze||null===(N=ze.children)||void 0===N?void 0:N.map(function(e){return c(u,{className:a("ypmini-city-selector-column-item",{"ypmini-city-selector-column-item-active":Ge(e)}),onClick:function(){return function(e){if(V)return 2===D?void oe(e):void Me(e);2!==D?Re(e):me(e)}(e)},children:[e.name,V||(null==xe?void 0:xe.id)!==e.id||3!==D?null:We(e),V&&3===D&&(null==Ce?void 0:Ce.id)===e.id?Ee(Qe||0):null,Ge(e)&&2===D||Ge(e)&&3===D&&k(e.parentId,B)?qe(e):null]},e.id)})}),3===D&&null!=Ae&&null!==(M=Ae.children)&&void 0!==M&&M.length?o(u,{className:"ypmini-city-selector-column ypmini-city-selector-colum-3",children:null==Ae||null===(g=Ae.children)||void 0===g?void 0:g.map(function(e){return c(u,{className:a("ypmini-city-selector-column-item",{"ypmini-city-selector-column-item-active":Oe(e)}),onClick:function(){return function(e){V?ge(e):Ve(e)}(e)},children:[e.name,Oe(e)?qe(e):null]},e.id)})}):null]}),V&&Qe?c(u,{className:"ypmini-city-selector-panel",children:[c(u,{className:"ypmini-city-selector-panel-header",children:[o(d,{className:"ypmini-city-selector-panel-title",children:W||"我选择的地址"}),o(d,{className:"ypmini-city-selector-panel-count",children:O?null==O?void 0:O(Qe||0,T):"已选".concat(Qe||0).concat(T?"/".concat(T):"")})]}),o(u,{className:"ypmini-city-selector-panel-selected",children:null==Ke?void 0:Ke.map(function(e){return c(u,{className:"ypmini-city-selector-panel-selected-item",children:[e.name,o(p,{className:"ypmini-city-selector-panel-selected-item-close-icon",name:"close",onClick:function(){return _e(e)}})]},e.id)})}),c(u,{className:"ypmini-city-selector-panel-footer",children:[o(m,n(n({size:"large",className:"ypmini-city-selector-panel-footer-btn-clear",block:!0,styleType:"default"},E||{}),{},{onClick:He,children:"清除"})),o(m,n(n({size:"large",className:"ypmini-city-selector-panel-footer-btn-confirm",block:!0,styleType:"primary"},J||{}),{},{onClick:function(){H&&(null==H||H(null==Ke?void 0:Ke.map(function(e){return e.id})))},children:"确定选择"}))]})]}):null]}))};export{S as default};
@@ -0,0 +1,153 @@
1
+ :root,
2
+ page {
3
+ --ypmini-city-selector-column-item-height: calc(48px * var(--ypmini-hd));
4
+ --ypmini-city-selector-column-item-font-size: var(--ypmini-font-size-default);
5
+ }
6
+ .ypmini-city-selector-wrapper {
7
+ position: relative;
8
+ height: 100%;
9
+ border-top: 1px solid var(--ypmini-border-color);
10
+ }
11
+ .ypmini-city-selector {
12
+ display: flex;
13
+ height: 100%;
14
+ }
15
+ .ypmini-city-selector-column {
16
+ flex: 1;
17
+ }
18
+ .ypmini-city-selector-column.ypmini-city-selector-column-secondary {
19
+ flex: 0 0 50%;
20
+ }
21
+ .ypmini-city-selector-column.ypmini-city-selector-column-secondary:first-child {
22
+ flex: 0 0 50%;
23
+ }
24
+ .ypmini-city-selector-column:first-child {
25
+ flex: 0 0 33.33%;
26
+ }
27
+ .ypmini-city-selector-column:not(:first-child):not(:last-child) {
28
+ border-right: 1px solid var(--ypmini-border-color);
29
+ }
30
+ .ypmini-city-selector-column-item-active {
31
+ font-weight: bold;
32
+ color: var(--ypmini-primary-color);
33
+ }
34
+ .ypmini-city-selector-column-1 {
35
+ background: #f5f6fa;
36
+ }
37
+ .ypmini-city-selector-column-1 .ypmini-city-selector-column-item-active {
38
+ position: relative;
39
+ background: #fff;
40
+ }
41
+ .ypmini-city-selector-column-1 .ypmini-city-selector-column-item-active:before {
42
+ position: absolute;
43
+ content: " ";
44
+ left: 0;
45
+ top: 50%;
46
+ transform: translateY(-50%);
47
+ width: 6px;
48
+ height: 40px;
49
+ border-radius: 0px 4px 4px 0px;
50
+ background: var(--ypmini-primary-color);
51
+ }
52
+ .ypmini-city-selector-column-item {
53
+ position: relative;
54
+ height: var(--ypmini-city-selector-column-item-height);
55
+ display: flex;
56
+ align-items: center;
57
+ padding-left: 24px;
58
+ font-size: var(--ypmini-city-selector-column-item-font-size);
59
+ }
60
+ .ypmini-city-selector-count-badge {
61
+ position: absolute;
62
+ right: 24px;
63
+ width: 28px;
64
+ height: 28px;
65
+ background: var(--ypmini-primary-color);
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ font-weight: bold;
70
+ font-size: 20px;
71
+ color: #fff;
72
+ border-radius: 100%;
73
+ top: 50%;
74
+ transform: translateY(-50%);
75
+ }
76
+ .ypmini-city-selector-dot-badge {
77
+ position: absolute;
78
+ border-radius: 100%;
79
+ top: 50%;
80
+ right: 24px;
81
+ width: 12px;
82
+ height: 12px;
83
+ transform: translateY(-50%);
84
+ background: var(--ypmini-primary-color);
85
+ }
86
+ .ypmini-city-selector-checked-icon {
87
+ font-size: 32px;
88
+ position: absolute;
89
+ right: 24px;
90
+ color: var(--ypmini-primary-color);
91
+ top: 50%;
92
+ transform: translateY(-50%);
93
+ }
94
+ .ypmini-city-selector-panel {
95
+ position: absolute;
96
+ left: 0;
97
+ right: 0;
98
+ bottom: 0;
99
+ padding: 24px;
100
+ border-radius: 24px 24px 0px 0px;
101
+ background: #ffffff;
102
+ box-shadow: 0px -4px 8px rgba(50, 52, 60, 0.1);
103
+ }
104
+ .ypmini-city-selector-panel-header {
105
+ display: flex;
106
+ justify-content: space-between;
107
+ align-items: center;
108
+ }
109
+ .ypmini-city-selector-panel-title {
110
+ color: var(--ypmini-color-text);
111
+ font-weight: bold;
112
+ font-size: 32px;
113
+ }
114
+ .ypmini-city-selector-panel-count {
115
+ color: rgba(0, 0, 0, 0.45);
116
+ font-weight: 400;
117
+ font-size: 28px;
118
+ }
119
+ .ypmini-city-selector-panel-selected {
120
+ margin-top: 8px;
121
+ margin-left: -16px;
122
+ display: flex;
123
+ flex-wrap: wrap;
124
+ }
125
+ .ypmini-city-selector-panel-selected-item {
126
+ margin-left: 16px;
127
+ margin-top: 16px;
128
+ border-radius: 8px;
129
+ padding: 0px 16px;
130
+ display: inline-flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ height: 56px;
134
+ background: var(--ypmini-primary-secondary-color);
135
+ color: var(--ypmini-primary-color);
136
+ font-weight: 400;
137
+ font-size: var(--ypmini-font-size-mini);
138
+ white-space: nowrap;
139
+ }
140
+ .ypmini-city-selector-panel-selected-item .ypmini-city-selector-panel-selected-item-close-icon {
141
+ font-size: 24px;
142
+ margin-left: 8px;
143
+ }
144
+ .ypmini-city-selector-panel-footer {
145
+ display: flex;
146
+ margin-top: 24px;
147
+ }
148
+ .ypmini-city-selector-panel-footer .ypmini-city-selector-panel-footer-btn-clear {
149
+ width: 220px;
150
+ }
151
+ .ypmini-city-selector-panel-footer .ypmini-taro-button:not(:first-child) {
152
+ margin-left: 20px;
153
+ }
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.less';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import { ValueType } from './type';
2
+ export declare const isMunicipality: (id: ValueType, municipality?: ValueType[]) => boolean;
@@ -0,0 +1 @@
1
+ var n=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null==r?void 0:r.includes(n)};export{n as isMunicipality};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DialogProps } from './type';
3
+ declare const _default: React.Context<DialogProps | null>;
4
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { DialogProps, ConfirmModalProps, AlertModalProps } from './type';
3
+ export type * from './type';
4
+ /**
5
+ * 弹窗实例,支持外部调用 close 方法关闭弹窗
6
+ */
7
+ export interface DialogInstance {
8
+ /** 关闭弹窗 */
9
+ close: () => void;
10
+ /** 弹窗唯一标识 */
11
+ show: () => void;
12
+ }
13
+ /**
14
+ * Dialog 组件 ref 类型
15
+ */
16
+ export interface DialogRef {
17
+ /** 显示弹窗 */
18
+ show: () => void;
19
+ /** 关闭弹窗 */
20
+ close: () => void;
21
+ }
22
+ interface DialogStaticMethods {
23
+ confirm: (option: ConfirmModalProps) => void;
24
+ alert: (option: AlertModalProps) => void;
25
+ createDialog: (options?: DialogProps) => {
26
+ DialogWrapper: () => React.JSX.Element;
27
+ };
28
+ }
29
+ declare const InternalDialog: React.ForwardRefExoticComponent<Omit<DialogProps, "ref"> & React.RefAttributes<DialogRef>>;
30
+ declare const Dialog: typeof InternalDialog & DialogStaticMethods;
31
+ export default Dialog;
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as n,slicedToArray as i,objectSpread2 as e,asyncToGenerator as o,regenerator as r}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as l}from"react/jsx-runtime";import a,{useState as c,useEffect as s}from"react";import u from"@tarojs/taro";import{View as f}from"@tarojs/components";import m from"classnames";import d from"../button/index.js";import p from"../icon/index.js";var v=["title","content","children","cancelText","confirmText","showCancel","mask","maskClosable","duration","className","style","onClose","onCancel","onConfirm","afterClose","onMaskClick","showClose","footer","footerLayout"],y="setDialogProps",h=a.createRef(),C=a.forwardRef(function(u,y){var h=u.title,C=u.content,g=u.children,b=u.cancelText,w=void 0===b?"取消":b,k=u.confirmText,N=void 0===k?"确定":k,T=u.showCancel,j=void 0===T||T,x=u.mask,P=void 0===x||x,D=u.maskClosable,E=void 0!==D&&D,H=u.duration,L=void 0===H?200:H,M=u.className,R=u.style,S=u.onClose,W=u.onCancel,_=u.onConfirm,z=u.afterClose,A=u.onMaskClick;u.showClose;var B=u.footer,G=u.footerLayout,I=void 0===G?"horizal":G,q=n(u,v),F=c(!1),J=i(F,2),K=J[0],O=J[1],Q=c(!1),U=i(Q,2),V=U[0],X=U[1];a.useImperativeHandle(y,function(){return{show:function(){return X(!0)},close:function(){X(!1),null==S||S()}}}),s(function(){if(V){X(!0);var n=setTimeout(function(){O(!0)},10);return function(){return clearTimeout(n)}}O(!1);var i=setTimeout(function(){X(!1),null==z||z()},L);return function(){return clearTimeout(i)}},[V,L,z]);var Y=function(){var n=o(r().m(function n(){return r().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,null==W?void 0:W();case 1:"visible"in q||X(!1),null==W||W();case 2:return n.a(2)}},n)}));return function(){return n.apply(this,arguments)}}(),Z=function(){var n=o(r().m(function n(){return r().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,null==_?void 0:_();case 1:"visible"in q||X(!1);case 2:return n.a(2)}},n)}));return function(){return n.apply(this,arguments)}}();return a.useEffect(function(){"visible"in q&&X(!!q.visible)},[q]),V?t(f,e(e({className:m("ypmini-dialog-wrapper",{"ypmini-dialog-wrapper-visible":K}),style:{"--ypmini-dialog-duration":"".concat(L,"ms")}},q),{},{children:[P&&l(f,{className:m("ypmini-dialog-mask",{"ypmini-dialog-mask-visible":K}),onClick:function(){E&&("visible"in q||X(!1)),null==A||A()}}),t(f,{className:m("ypmini-dialog",M,{"ypmini-dialog-visible":K}),style:R,onClick:function(n){n.stopPropagation()},children:[j?l(p,{className:"ypmini-dialog-close",name:"close",onClick:function(){"visible"in q||X(!1),null==S||S()}}):null,h&&l(f,{className:"ypmini-dialog-header",children:h}),l(f,{className:"ypmini-dialog-body",children:g||C}),B?B():t(f,{className:m("ypmini-dialog-footer",{"ypmini-dialog-footer-vertical":"vertical"===I}),children:[j&&l(f,{className:"ypmini-dialog-btn ypmini-dialog-btn-cancel",onClick:Y,children:l(d,{block:!0,className:"ypmini-dialog-footer-btn",styleType:"default",children:w})}),l(f,{className:"ypmini-dialog-btn ypmini-dialog-btn-confirm",onClick:Z,children:l(d,{block:!0,className:"ypmini-dialog-footer-btn",styleType:"primary",children:N})})]})]})]})):null});C.confirm=function(n){var i,t,l;u.eventCenter.trigger(y,e(e({},n),{},{onConfirm:(l=o(r().m(function i(){var e,o;return r().w(function(i){for(;;)switch(i.n){case 0:return i.n=1,null==n||null===(e=n.onConfirm)||void 0===e?void 0:e.call(n);case 1:null==h||null===(o=h.current)||void 0===o||o.close();case 2:return i.a(2)}},i)})),function(){return l.apply(this,arguments)}),onCancel:(t=o(r().m(function i(){var e,o;return r().w(function(i){for(;;)switch(i.n){case 0:return i.n=1,null==n||null===(e=n.onCancel)||void 0===e?void 0:e.call(n);case 1:null==h||null===(o=h.current)||void 0===o||o.close();case 2:return i.a(2)}},i)})),function(){return t.apply(this,arguments)})})),null==h||null===(i=h.current)||void 0===i||i.show()},C.alert=function(n){var i,t;u.eventCenter.trigger(y,e(e({},n),{},{showCancel:!1,onConfirm:(t=o(r().m(function i(){var e,o;return r().w(function(i){for(;;)switch(i.n){case 0:return i.n=1,null==n||null===(e=n.onConfirm)||void 0===e?void 0:e.call(n);case 1:null==h||null===(o=h.current)||void 0===o||o.close();case 2:return i.a(2)}},i)})),function(){return t.apply(this,arguments)})})),null==h||null===(i=h.current)||void 0===i||i.show()},C.createDialog=function(n){return{DialogWrapper:function(){var o=a.useState({}),r=i(o,2),t=r[0],c=r[1];return a.useEffect(function(){u.eventCenter.on(y,function(n){c(n)})},[]),l(C,e(e(e({},n),t),{},{ref:h}))}}};export{C as default};
@@ -0,0 +1,113 @@
1
+ :root,
2
+ page {
3
+ --ypmini-dialog-background: #fff;
4
+ --ypmini-dialog-border-radius: calc(12px * var(--ypmini-hd));
5
+ --ypmini-dialog-mask-background: var(--ypmini-mask-background);
6
+ --ypmini-dialog-z-index: 1100;
7
+ --ypmini-dialog-duration: 200ms;
8
+ --ypmini-dialog-width: calc(300px * var(--ypmini-hd));
9
+ --ypmini-dialog-title-font-size: var(--ypmini-font-size-large);
10
+ --ypmini-dialog-title-color: rgba(0, 0, 0, 0.85);
11
+ --ypmini-dialog-content-font-size: var(--ypmini-font-size-default);
12
+ --ypmini-dialog-content-color: rgba(0, 0, 0, 0.65);
13
+ --ypmini-dialog-btn-font-size: var(--ypmini-font-size-default);
14
+ --ypmini-dialog-btn-cancel-color: rgba(0, 0, 0, 0.65);
15
+ --ypmini-dialog-btn-confirm-color: var(--ypmini-primary-color);
16
+ }
17
+ .ypmini-dialog-wrapper {
18
+ position: fixed;
19
+ top: 0;
20
+ left: 0;
21
+ right: 0;
22
+ bottom: 0;
23
+ z-index: var(--ypmini-dialog-z-index);
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ pointer-events: none;
28
+ }
29
+ .ypmini-dialog-wrapper-visible {
30
+ pointer-events: auto;
31
+ }
32
+ .ypmini-dialog-mask {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ right: 0;
37
+ bottom: 0;
38
+ background: var(--ypmini-dialog-mask-background);
39
+ opacity: 0;
40
+ transition: opacity var(--ypmini-dialog-duration) ease;
41
+ }
42
+ .ypmini-dialog-mask-visible {
43
+ opacity: 1;
44
+ }
45
+ .ypmini-dialog {
46
+ padding: 48px 32px 32px 32px;
47
+ position: relative;
48
+ width: var(--ypmini-dialog-width);
49
+ background: var(--ypmini-dialog-background);
50
+ border-radius: var(--ypmini-dialog-border-radius);
51
+ overflow: hidden;
52
+ opacity: 0;
53
+ transform: scale(0.9);
54
+ transition: opacity var(--ypmini-dialog-duration) ease, transform var(--ypmini-dialog-duration) ease;
55
+ }
56
+ .ypmini-dialog-visible {
57
+ opacity: 1;
58
+ transform: scale(1);
59
+ }
60
+ .ypmini-dialog-header {
61
+ text-align: center;
62
+ font-size: var(--ypmini-dialog-title-font-size);
63
+ font-weight: bold;
64
+ color: var(--ypmini-dialog-title-color);
65
+ line-height: 48px;
66
+ }
67
+ .ypmini-dialog-close {
68
+ font-size: 48px;
69
+ position: absolute;
70
+ right: 16px;
71
+ top: 16px;
72
+ color: rgba(0, 0, 0, 0.25);
73
+ }
74
+ .ypmini-dialog-body {
75
+ margin-top: 24px;
76
+ margin-bottom: 32px;
77
+ text-align: center;
78
+ font-size: var(--ypmini-dialog-content-font-size);
79
+ color: var(--ypmini-dialog-content-color);
80
+ line-height: 1.6;
81
+ word-break: break-word;
82
+ }
83
+ .ypmini-dialog-footer {
84
+ display: flex;
85
+ }
86
+ .ypmini-dialog-footer.ypmini-dialog-footer-vertical {
87
+ display: block;
88
+ }
89
+ .ypmini-dialog-footer.ypmini-dialog-footer-vertical .ypmini-dialog-btn:not(:first-child) {
90
+ margin-top: 24px;
91
+ margin-left: 0;
92
+ }
93
+ .ypmini-dialog-footer-btn {
94
+ height: 40px;
95
+ line-height: 40px;
96
+ }
97
+ .ypmini-dialog-btn {
98
+ flex: 1;
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ font-size: var(--ypmini-dialog-btn-font-size);
103
+ }
104
+ .ypmini-dialog-btn:not(:first-child) {
105
+ margin-left: 22px;
106
+ }
107
+ .ypmini-dialog-btn-cancel {
108
+ color: var(--ypmini-dialog-btn-cancel-color);
109
+ }
110
+ .ypmini-dialog-btn-confirm {
111
+ color: var(--ypmini-dialog-btn-confirm-color);
112
+ font-weight: bold;
113
+ }
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.less';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import '../../../global/theme-default.css';
2
+ import './index.css';
@@ -1 +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};
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(c,"iconfont","icon-".concat(n,"_icon"))},i))};export{m as default};
@@ -1,7 +1,7 @@
1
1
  @font-face {
2
2
  font-family: "iconfont";
3
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');
4
+ src: url('iconfont.woff2?t=1767782477263') format('woff2'), url('iconfont.woff?t=1767782477263') format('woff'), url('iconfont.ttf?t=1767782477263') format('truetype');
5
5
  }
6
6
  .iconfont {
7
7
  font-family: "iconfont" !important;
@@ -10,6 +10,18 @@
10
10
  -webkit-font-smoothing: antialiased;
11
11
  -moz-osx-font-smoothing: grayscale;
12
12
  }
13
+ .icon-checked_icon:before {
14
+ content: "\e61e";
15
+ }
16
+ .icon-refresh_icon:before {
17
+ content: "\e61f";
18
+ }
19
+ .icon-location_icon:before {
20
+ content: "\e620";
21
+ }
22
+ .icon-add_icon:before {
23
+ content: "\e61d";
24
+ }
13
25
  .icon-telephone_icon:before {
14
26
  content: "\e60f";
15
27
  }
@@ -1,46 +1,46 @@
1
1
  :root,
2
2
  page {
3
- --input-placeholder-color: rgba(0, 0, 0, 0.25);
4
- --input-text-color: var(--ypmini-color-text);
5
- --input-font-size: var(--ypmini-font-size-default);
6
- --input-delete-cion-color: #00000040;
7
- --input-delete-cion-size: calc(var(--ypmini-hd) * 16px);
8
- --input-height: calc(48px * var(--ypmini-hd));
9
- --input-prefix-icon-size: calc(16px * var(--ypmini-hd));
10
- --input-border-color: var(--ypmini-border-color);
11
- --input-prefix-icon-color: #000000a6;
3
+ --ypmini-input-placeholder-color: var(--ypmini-color-text-placeholder);
4
+ --ypmini-input-text-color: var(--ypmini-color-text);
5
+ --ypmini-input-font-size: var(--ypmini-font-size-default);
6
+ --ypmini-input-delete-cion-color: #00000040;
7
+ --ypmini-input-delete-cion-size: calc(var(--ypmini-hd) * 16px);
8
+ --ypmini-input-height: calc(48px * var(--ypmini-hd));
9
+ --ypmini-input-prefix-icon-size: calc(16px * var(--ypmini-hd));
10
+ --ypmini-input-border-color: var(--ypmini-border-color);
11
+ --ypmini-input-prefix-icon-color: #000000a6;
12
12
  }
13
13
  .ypmini-taro-input-wrapper {
14
14
  display: flex;
15
15
  align-items: center;
16
- height: var(--input-height);
17
- font-size: var(--input-font-size);
16
+ height: var(--ypmini-input-height);
17
+ font-size: var(--ypmini-input-font-size);
18
18
  padding: 0px 24px;
19
19
  border-radius: 16px;
20
- border: 2px solid var(--input-border-color);
20
+ border: 2px solid var(--ypmini-input-border-color);
21
21
  box-sizing: border-box;
22
22
  }
23
23
  .ypmini-taro-input-borderless-wrapper {
24
24
  border: unset;
25
25
  }
26
26
  .ypmini-taro-input {
27
- color: var(--input-text-color);
27
+ color: var(--ypmini-input-text-color);
28
28
  flex: 1;
29
29
  border: none;
30
30
  }
31
31
  .ypmini-taro-input input::placeholder {
32
- color: var(--input-placeholder-color);
32
+ color: var(--ypmini-input-placeholder-color);
33
33
  }
34
34
  .ypmini-input-placeholder {
35
- color: var(--input-placeholder-color);
35
+ color: var(--ypmini-input-placeholder-color);
36
36
  }
37
37
  .ypmini-taro-input-clear {
38
38
  display: flex;
39
39
  align-items: center;
40
40
  }
41
41
  .ypmini-taro-input-clear-icon {
42
- color: var(--input-delete-cion-color);
43
- font-size: var(--input-delete-cion-size);
42
+ color: var(--ypmini-input-delete-cion-color);
43
+ font-size: var(--ypmini-input-delete-cion-size);
44
44
  }
45
45
  .ypmini-taro-input-count {
46
46
  color: rgba(0, 0, 0, 0.45);
@@ -55,7 +55,7 @@ page {
55
55
  .ypmini-taro-input-prefix-icon-wrapper {
56
56
  display: flex;
57
57
  align-items: center;
58
- font-size: var(--input-prefix-icon-size);
58
+ font-size: var(--ypmini-input-prefix-icon-size);
59
59
  margin-right: 16px;
60
- color: var(--input-prefix-icon-color);
60
+ color: var(--ypmini-input-prefix-icon-color);
61
61
  }
@@ -0,0 +1,123 @@
1
+ import React from 'react';
2
+ import TaroType from '@tarojs/taro/types';
3
+ type TaroImgFile = TaroType.chooseImage.SuccessCallbackResult['tempFiles'][0] | TaroType.chooseMedia.SuccessCallbackResult['tempFiles'][0];
4
+ type TaroImgFileList = TaroType.chooseImage.SuccessCallbackResult['tempFiles'] | TaroType.chooseMedia.SuccessCallbackResult['tempFiles'];
5
+ export type UploadStatus = 'uploading' | 'done' | 'error' | 'removed';
6
+ /***
7
+ * percent 进度 1-10
8
+ */
9
+ export type FileType = UploadFile & {
10
+ percent?: number;
11
+ };
12
+ export type UploadFile = {
13
+ /**
14
+ * 文件唯一ID
15
+ */
16
+ uid?: string | number;
17
+ /**
18
+ * 文件下载地址
19
+ */
20
+ url: string;
21
+ /**
22
+ * 本地预览地址
23
+ */
24
+ path?: string;
25
+ /**
26
+ * 文件名
27
+ */
28
+ name?: string;
29
+ /**
30
+ * 上传状态
31
+ */
32
+ status?: UploadStatus;
33
+ /**
34
+ * 文件类型 目前仅支持图片和视频
35
+ */
36
+ type?: string;
37
+ };
38
+ export interface MediaUploaderProps {
39
+ /**
40
+ * 内置的上传组件类型 image 仅支持图片调用taro的chooseImage api,media 图片和视频都支持 调用taro的chooseMedia api
41
+ */
42
+ chooseApiType?: 'image' | 'media';
43
+ /**
44
+ * 删除事件 返回false不会删除文件
45
+ */
46
+ onRemove?: (file: FileType, fileList: FileType[]) => boolean | Promise<boolean>;
47
+ /**
48
+ * 自定义上传请求
49
+ */
50
+ uploadRequest?: (options: {
51
+ file: TaroImgFile;
52
+ fileList: TaroImgFileList;
53
+ onSuccess: (val: FileType) => void;
54
+ onError: () => void;
55
+ onProgress: (params: {
56
+ percent: number;
57
+ }) => void;
58
+ }) => void;
59
+ /**
60
+ * 自定义上传行为
61
+ */
62
+ customUpload?: () => Promise<{
63
+ file: FileType;
64
+ fileList: FileType[];
65
+ }>;
66
+ /**
67
+ * 是否支持删除
68
+ */
69
+ showDelete?: boolean;
70
+ /**
71
+ * 是否支持多文件上传
72
+ */
73
+ multiple?: boolean;
74
+ /**
75
+ * 对外的change事件
76
+ */
77
+ onChange?: (value: {
78
+ file: UploadFile;
79
+ fileList: UploadFile[];
80
+ }) => void;
81
+ /**
82
+ * 上传文件之前的钩子,返回false会停止上传
83
+ */
84
+ beforeUpload?: (file: TaroImgFile, files: TaroImgFileList) => boolean | Promise<boolean>;
85
+ /**
86
+ * 图片选择option参数
87
+ */
88
+ chooseImageOption?: TaroType.chooseImage.Option;
89
+ /**
90
+ * 获取媒体的option 参数
91
+ */
92
+ chooseMediaOption?: TaroType.chooseMedia.Option;
93
+ /**
94
+ * 已上传文件(受控)
95
+ */
96
+ value?: UploadFile[];
97
+ /**
98
+ * 默认值(已上传文件)
99
+ */
100
+ defaultValue?: UploadFile[];
101
+ /**
102
+ * 是否禁止使用
103
+ */
104
+ disabled?: boolean;
105
+ /**
106
+ * 自定义上传按钮样式
107
+ */
108
+ children?: React.ReactNode;
109
+ /**
110
+ * 单选(multiple为false)时是否允许修改 默认不允许
111
+ */
112
+ allowMofify?: boolean;
113
+ /**
114
+ * 定义多选时最多允许上传多少图片,超出会自动截断并隐藏上传按钮,0表示不做限制,默认0
115
+ */
116
+ maxCount?: number;
117
+ /**
118
+ * 是否允许删除 默认 true 允许删除
119
+ */
120
+ allowClear?: boolean;
121
+ }
122
+ declare const MediaUploader: React.FC<MediaUploaderProps>;
123
+ export default MediaUploader;
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as e,slicedToArray as n,asyncToGenerator as i,regenerator as r,objectSpread2 as a,regeneratorValues as l,toConsumableArray as o}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as u}from"react/jsx-runtime";import s from"react";import c from"classnames";import{chooseImage as d,chooseMedia as m}from"@tarojs/taro";import{View as p,Image as f}from"@tarojs/components";import{isPromise as v}from"../../utils/is.js";import y from"../icon/index.js";var h=["disabled","onChange","defaultValue","chooseApiType","beforeUpload","customUpload","uploadRequest","chooseMediaOption","chooseImageOption","children","maxCount","allowMofify","multiple","onRemove","allowClear"],g=function(g){var b,w,N,k=g.disabled,j=g.onChange,C=g.defaultValue,L=g.chooseApiType,P=void 0===L?"image":L,O=g.beforeUpload,F=g.customUpload,U=g.uploadRequest,T=g.chooseMediaOption,x=g.chooseImageOption,M=g.children,A=g.maxCount,R=void 0===A?0:A,S=g.allowMofify,E=g.multiple,I=void 0===E||E,V=g.onRemove,q=g.allowClear,D=void 0===q||q,_=e(g,h),B=s.useState(C||[]),G=n(B,2),H=G[0],W=G[1],z=function(){var e=i(r().m(function e(){var n,t,u;return r().w(function(e){for(;;)switch(e.n){case 0:if(!k){e.n=1;break}return e.a(2);case 1:if(!F){e.n=3;break}return e.n=2,F();case 2:return n=e.v,t=n.fileList,W(t),j&&j(n),e.a(2);case 3:u=function(){var e,n,t=function(e,n){if(!I){var i=a(a({},e),{},{status:n.status,percent:n.percent||10});return{file:i,fileList:[i]}}var r,l=null==H?void 0:H.findIndex(function(i){return i.uid===((null==n?void 0:n.originUid)||e.uid)});return l>=0?((r=H[l]).status=n.status,r.percent=n.percent||10,H[l]=r):(r=a(a({},e),{},{status:n.status,percent:n.percent||10}),H.push(r)),{file:r,fileList:o(H)}},u=function(e,n){var i=t(a({},e),{status:"done",originUid:n}),r=i.file,l=i.fileList;j&&j({file:r,fileList:l}),W(l)},s=function(e,n){var i=a(a({},e),{},{status:"error"}),r=t(i,{status:"error",originUid:n}),l=r.file,o=r.fileList;j&&j({file:l,fileList:o}),W(o)},c=function(e,n){var i=n.percent,r=t(e,{status:"uploading",percent:i}),a=r.file,l=r.fileList;j&&j({file:a,fileList:l}),W(l)};return"image"===P?a(a({},x||{}),{},{count:I&&(null==x?void 0:x.count)||1,success:(e=i(r().m(function e(n){var i,o,t,d,m,p;return r().w(function(e){for(;;)switch(e.n){case 0:i=n.tempFiles,o=i,R&&(t=R-H.length,o=i.slice(0,t)),d=r().m(function e(){var n,i;return r().w(function(e){for(;;)switch(e.n){case 0:return n=o[p],e.n=1,J(n,o);case 1:if(e.v){e.n=2;break}return e.a(2,{v:void 0});case 2:return i="".concat(p).concat((new Date).valueOf()),e.n=3,null==U?void 0:U({file:n,fileList:o,onSuccess:function(e){u(a({type:n.type},e),i)},onError:function(){var e;return s({url:n.path,name:null===(e=n.originalFileObj)||void 0===e?void 0:e.name,uid:i,type:n.type},i)},onProgress:function(e){var r;return c({url:n.path,name:null===(r=n.originalFileObj)||void 0===r?void 0:r.name,uid:i,type:n.type},e)}});case 3:return e.a(2)}},e)}),p=0;case 1:if(!(p<o.length)){e.n=4;break}return e.d(l(d()),2);case 2:if(!(m=e.v)){e.n=3;break}return e.a(2,m.v);case 3:p++,e.n=1;break;case 4:return e.a(2)}},e)})),function(n){return e.apply(this,arguments)})}):a(a({},T||{}),{},{count:I&&(null==x?void 0:x.count)||1,success:(n=i(r().m(function e(n){var i,o,t,d,m,p;return r().w(function(e){for(;;)switch(e.n){case 0:i=n.tempFiles,o=i,R&&(t=R-H.length,o=i.slice(0,t)),d=r().m(function e(){var n,i;return r().w(function(e){for(;;)switch(e.n){case 0:return n=o[p],e.n=1,J(n,o);case 1:if(e.v){e.n=2;break}return e.a(2,{v:void 0});case 2:return i="".concat(p).concat((new Date).valueOf()),e.n=3,null==U?void 0:U({file:n,fileList:o,onSuccess:function(e){u(a({type:n.fileType},e),i)},onError:function(){var e;return s({url:n.tempFilePath,name:null===(e=n.originalFileObj)||void 0===e?void 0:e.name,uid:i,type:n.fileType},i)},onProgress:function(e){var r;return c({url:n.tempFilePath,name:null==n||null===(r=n.originalFileObj)||void 0===r?void 0:r.name,uid:i,type:n.fileType},e)}});case 3:return e.a(2)}},e)}),p=0;case 1:if(!(p<o.length)){e.n=4;break}return e.d(l(d()),2);case 2:if(!(m=e.v)){e.n=3;break}return e.a(2,m.v);case 3:p++,e.n=1;break;case 4:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)})})},("image"===P?d:m)(u());case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),J=function(e,n){if(!O)return Promise.resolve(!0);var i=null==O?void 0:O(e,n);return v(i)?i:Promise.resolve(i)},K=function(e){if(!V)return Promise.resolve(!0);var n=null==V?void 0:V(e,H);return v(n)?n:Promise.resolve(n)},Q=function(){var e=i(r().m(function e(n){var i,l;return r().w(function(e){for(;;)switch(e.n){case 0:if(!V){e.n=2;break}return e.n=1,K(n);case 1:if(e.v){e.n=2;break}return e.a(2);case 2:i=null==H?void 0:H.find(function(e){return e.uid===n.uid}),l=null==H?void 0:H.filter(function(e){return e.uid!==n.uid}),W(l),j&&j({file:a(a({},i),{},{status:"removed"}),fileList:l});case 3:return e.a(2)}},e)}));return function(n){return e.apply(this,arguments)}}();return s.useEffect(function(){"value"in _&&W(_.value)},[_]),I?t(p,{className:"ypmini-media-uploader-list",children:[null==H?void 0:H.map(function(e){return t(p,{className:"ypmini-media-uploader-cell",children:[D&&!k?u(p,{className:"ypmini-media-uploader-cell-delete",onClick:function(n){n.stopPropagation(),Q(e)},children:u(y,{className:"ypmini-media-uploader-cell-delete-icon",name:"close"})}):null,"uploading"===(null==e?void 0:e.status)&&((null==e?void 0:e.percent)||0)<10?u(p,{className:"ypmini-media-uploader-process-mask",children:u(p,{className:"ypmini-media-uploader-process-bar",children:u(p,{className:"ypmini-media-uploader-process-bar-inner",style:{width:"".concat(10*((null==e?void 0:e.percent)||0),"%")}})})}):null,u(f,{className:"ypmini-media-uploader-image-view",src:e.url})]},e.uid)}),R&&(null==H?void 0:H.length)>=R?null:u(p,{className:"ypmini-media-uploader-cell ypmini-media-uploader-button",onClick:function(){return z()},children:M||u(y,{className:"ypmini-media-uploader-icon",name:"add"})})]}):null!=H&&H[0]?t(p,{className:c("ypmini-media-uploader-cell",{"ypmini-media-uploader-cell-single":!I}),onClick:function(e){S&&z()},children:[D&&!k?u(p,{className:"ypmini-media-uploader-cell-delete",onClick:function(e){e.stopPropagation(),Q(null==H?void 0:H[0])},children:u(y,{className:"ypmini-media-uploader-cell-delete-icon",name:"close"})}):null,"uploading"===(null==H||null===(b=H[0])||void 0===b?void 0:b.status)&&((null==H||null===(w=H[0])||void 0===w?void 0:w.percent)||0)<10?u(p,{className:"ypmini-media-uploader-process-mask",children:u(p,{className:"ypmini-media-uploader-process-bar",children:u(p,{className:"ypmini-media-uploader-process-bar-inner",style:{width:"".concat(10*((null==H||null===(N=H[0])||void 0===N?void 0:N.percent)||0),"%")}})})}):null,u(f,{className:"ypmini-media-uploader-image-view",src:null==H?void 0:H[0].url})]}):u(p,{className:c("ypmini-media-uploader-cell","ypmini-media-uploader-button",{"ypmini-media-uploader-button-single":!I}),onClick:function(){return z()},children:M||u(y,{className:"ypmini-media-uploader-icon",name:"add"})})};g.displayName="MediaUploader";export{g as default};