wz-h5-design 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 (241) hide show
  1. package/README.md +51 -0
  2. package/dist/Button/index.js +84 -0
  3. package/dist/Button/index.umd.cjs +1 -0
  4. package/dist/Button/style/index.css +1 -0
  5. package/dist/Button/style/index.js +1 -0
  6. package/dist/Button/style.css +1 -0
  7. package/dist/Card/index.js +32 -0
  8. package/dist/Card/index.umd.cjs +1 -0
  9. package/dist/Card/style/index.css +1 -0
  10. package/dist/Card/style/index.js +1 -0
  11. package/dist/Card/style.css +1 -0
  12. package/dist/Cascader/index.js +94 -0
  13. package/dist/Cascader/index.umd.cjs +1 -0
  14. package/dist/Cascader/style/index.css +1 -0
  15. package/dist/Cascader/style/index.js +1 -0
  16. package/dist/Cascader/style.css +1 -0
  17. package/dist/Cell/index.js +135 -0
  18. package/dist/Cell/index.umd.cjs +6 -0
  19. package/dist/Cell/style/index.css +1 -0
  20. package/dist/Cell/style/index.js +1 -0
  21. package/dist/Cell/style.css +1 -0
  22. package/dist/CheckList/index.js +34 -0
  23. package/dist/CheckList/index.umd.cjs +1 -0
  24. package/dist/CheckList/style/index.css +1 -0
  25. package/dist/CheckList/style/index.js +1 -0
  26. package/dist/CheckList/style.css +1 -0
  27. package/dist/Checkbox/index.js +84 -0
  28. package/dist/Checkbox/index.umd.cjs +1 -0
  29. package/dist/Checkbox/style/index.css +1 -0
  30. package/dist/Checkbox/style/index.js +1 -0
  31. package/dist/Checkbox/style.css +1 -0
  32. package/dist/Collapse/index.js +72 -0
  33. package/dist/Collapse/index.umd.cjs +1 -0
  34. package/dist/Collapse/style/index.css +1 -0
  35. package/dist/Collapse/style/index.js +1 -0
  36. package/dist/Collapse/style.css +1 -0
  37. package/dist/DatePicker/index.js +154 -0
  38. package/dist/DatePicker/index.umd.cjs +1 -0
  39. package/dist/DatePicker/style/index.css +1 -0
  40. package/dist/DatePicker/style/index.js +1 -0
  41. package/dist/DatePicker/style.css +1 -0
  42. package/dist/DateRangePicker/index.js +220 -0
  43. package/dist/DateRangePicker/index.umd.cjs +1 -0
  44. package/dist/DateRangePicker/style/index.css +1 -0
  45. package/dist/DateRangePicker/style/index.js +1 -0
  46. package/dist/DateRangePicker/style.css +1 -0
  47. package/dist/Dialog/index.js +216 -0
  48. package/dist/Dialog/index.umd.cjs +6 -0
  49. package/dist/Dialog/style/index.css +1 -0
  50. package/dist/Dialog/style/index.js +1 -0
  51. package/dist/Dialog/style.css +1 -0
  52. package/dist/Divider/index.js +27 -0
  53. package/dist/Divider/index.umd.cjs +1 -0
  54. package/dist/Divider/style/index.css +1 -0
  55. package/dist/Divider/style/index.js +1 -0
  56. package/dist/Divider/style.css +1 -0
  57. package/dist/DropDownMenu/index.js +111 -0
  58. package/dist/DropDownMenu/index.umd.cjs +1 -0
  59. package/dist/DropDownMenu/style/index.css +1 -0
  60. package/dist/DropDownMenu/style/index.js +1 -0
  61. package/dist/DropDownMenu/style.css +1 -0
  62. package/dist/Flex/index.js +85 -0
  63. package/dist/Flex/index.umd.cjs +1 -0
  64. package/dist/Flex/style/index.css +1 -0
  65. package/dist/Flex/style/index.js +1 -0
  66. package/dist/Flex/style.css +1 -0
  67. package/dist/Grid/index.js +54 -0
  68. package/dist/Grid/index.umd.cjs +1 -0
  69. package/dist/Grid/style/index.css +1 -0
  70. package/dist/Grid/style/index.js +1 -0
  71. package/dist/Grid/style.css +1 -0
  72. package/dist/GridView/index.js +90 -0
  73. package/dist/GridView/index.umd.cjs +1 -0
  74. package/dist/GridView/style/index.css +1 -0
  75. package/dist/GridView/style/index.js +1 -0
  76. package/dist/GridView/style.css +1 -0
  77. package/dist/Icon/index.js +31 -0
  78. package/dist/Icon/index.umd.cjs +1 -0
  79. package/dist/Icon/style/index.css +1 -0
  80. package/dist/Icon/style/index.js +1 -0
  81. package/dist/Icon/style.css +1 -0
  82. package/dist/Input/index.js +148 -0
  83. package/dist/Input/index.umd.cjs +1 -0
  84. package/dist/Input/style/index.css +1 -0
  85. package/dist/Input/style/index.js +1 -0
  86. package/dist/Input/style.css +1 -0
  87. package/dist/NavBar/index.js +175 -0
  88. package/dist/NavBar/index.umd.cjs +6 -0
  89. package/dist/NavBar/style/index.css +1 -0
  90. package/dist/NavBar/style/index.js +1 -0
  91. package/dist/NavBar/style.css +1 -0
  92. package/dist/Popup/index.js +124 -0
  93. package/dist/Popup/index.umd.cjs +1 -0
  94. package/dist/Popup/style/index.css +1 -0
  95. package/dist/Popup/style/index.js +1 -0
  96. package/dist/Popup/style.css +1 -0
  97. package/dist/Radio/index.js +82 -0
  98. package/dist/Radio/index.umd.cjs +1 -0
  99. package/dist/Radio/style/index.css +1 -0
  100. package/dist/Radio/style/index.js +1 -0
  101. package/dist/Radio/style.css +1 -0
  102. package/dist/Search/index.js +158 -0
  103. package/dist/Search/index.umd.cjs +1 -0
  104. package/dist/Search/style/index.css +1 -0
  105. package/dist/Search/style/index.js +1 -0
  106. package/dist/Search/style.css +1 -0
  107. package/dist/Stepper/index.js +140 -0
  108. package/dist/Stepper/index.umd.cjs +1 -0
  109. package/dist/Stepper/style/index.css +1 -0
  110. package/dist/Stepper/style/index.js +1 -0
  111. package/dist/Stepper/style.css +1 -0
  112. package/dist/Switch/index.js +53 -0
  113. package/dist/Switch/index.umd.cjs +1 -0
  114. package/dist/Switch/style/index.css +1 -0
  115. package/dist/Switch/style/index.js +1 -0
  116. package/dist/Switch/style.css +1 -0
  117. package/dist/Tabbar/index.js +159 -0
  118. package/dist/Tabbar/index.umd.cjs +6 -0
  119. package/dist/Tabbar/style/index.css +1 -0
  120. package/dist/Tabbar/style/index.js +1 -0
  121. package/dist/Tabbar/style.css +1 -0
  122. package/dist/Tabs/index.js +50 -0
  123. package/dist/Tabs/index.umd.cjs +1 -0
  124. package/dist/Tabs/style/index.css +1 -0
  125. package/dist/Tabs/style/index.js +1 -0
  126. package/dist/Tabs/style.css +1 -0
  127. package/dist/Tag/index.js +96 -0
  128. package/dist/Tag/index.umd.cjs +6 -0
  129. package/dist/Tag/style/index.css +1 -0
  130. package/dist/Tag/style/index.js +1 -0
  131. package/dist/Tag/style.css +1 -0
  132. package/dist/TimePicker/index.js +201 -0
  133. package/dist/TimePicker/index.umd.cjs +1 -0
  134. package/dist/TimePicker/style/index.css +1 -0
  135. package/dist/TimePicker/style/index.js +1 -0
  136. package/dist/TimePicker/style.css +1 -0
  137. package/dist/Tip/index.js +104 -0
  138. package/dist/Tip/index.umd.cjs +6 -0
  139. package/dist/Tip/style/index.css +1 -0
  140. package/dist/Tip/style/index.js +1 -0
  141. package/dist/Tip/style.css +1 -0
  142. package/dist/Toast/index.js +183 -0
  143. package/dist/Toast/index.umd.cjs +6 -0
  144. package/dist/Toast/style/index.css +1 -0
  145. package/dist/Toast/style/index.js +1 -0
  146. package/dist/Toast/style.css +1 -0
  147. package/dist/Tooltip/index.js +172 -0
  148. package/dist/Tooltip/index.umd.cjs +6 -0
  149. package/dist/Tooltip/style/index.css +1 -0
  150. package/dist/Tooltip/style/index.js +1 -0
  151. package/dist/Tooltip/style.css +1 -0
  152. package/dist/assets/fonts/qitu/iconfont.css +140 -0
  153. package/dist/assets/fonts/qitu/iconfont.ttf +0 -0
  154. package/dist/assets/fonts/qitu/iconfont.woff +0 -0
  155. package/dist/assets/fonts/qitu/iconfont.woff2 +0 -0
  156. package/dist/assets/fonts/qituyonghu/iconfont.css +64 -0
  157. package/dist/assets/fonts/qituyonghu/iconfont.ttf +0 -0
  158. package/dist/assets/fonts/qituyonghu/iconfont.woff +0 -0
  159. package/dist/assets/fonts/qituyonghu/iconfont.woff2 +0 -0
  160. package/dist/assets/fonts/wzdaili/iconfont.css +71 -0
  161. package/dist/assets/fonts/wzdaili/iconfont.ttf +0 -0
  162. package/dist/assets/fonts/wzdaili/iconfont.woff +0 -0
  163. package/dist/assets/fonts/wzdaili/iconfont.woff2 +0 -0
  164. package/dist/assets/fonts/wzyonghu/iconfont.css +97 -0
  165. package/dist/assets/fonts/wzyonghu/iconfont.ttf +0 -0
  166. package/dist/assets/fonts/wzyonghu/iconfont.woff +0 -0
  167. package/dist/assets/fonts/wzyonghu/iconfont.woff2 +0 -0
  168. package/dist/assets/fonts/yunying/iconfont.css +303 -0
  169. package/dist/assets/fonts/yunying/iconfont.ttf +0 -0
  170. package/dist/assets/fonts/yunying/iconfont.woff +0 -0
  171. package/dist/assets/fonts/yunying/iconfont.woff2 +0 -0
  172. package/dist/style.css +1 -0
  173. package/dist/types/components/Button/Button.d.ts +16 -0
  174. package/dist/types/components/Button/index.d.ts +5 -0
  175. package/dist/types/components/Card/Card.d.ts +15 -0
  176. package/dist/types/components/Card/index.d.ts +3 -0
  177. package/dist/types/components/Cascader/Cascader.d.ts +14 -0
  178. package/dist/types/components/Cascader/index.d.ts +3 -0
  179. package/dist/types/components/Cell/Cell.d.ts +24 -0
  180. package/dist/types/components/Cell/CellGroup.d.ts +8 -0
  181. package/dist/types/components/Cell/index.d.ts +8 -0
  182. package/dist/types/components/CheckList/CheckList.d.ts +11 -0
  183. package/dist/types/components/CheckList/index.d.ts +3 -0
  184. package/dist/types/components/Checkbox/Checkbox.d.ts +62 -0
  185. package/dist/types/components/Checkbox/index.d.ts +3 -0
  186. package/dist/types/components/Collapse/Collapse.d.ts +17 -0
  187. package/dist/types/components/Collapse/index.d.ts +3 -0
  188. package/dist/types/components/DatePicker/DatePicker.d.ts +13 -0
  189. package/dist/types/components/DatePicker/index.d.ts +3 -0
  190. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +13 -0
  191. package/dist/types/components/DateRangePicker/index.d.ts +3 -0
  192. package/dist/types/components/Dialog/Dialog.d.ts +16 -0
  193. package/dist/types/components/Dialog/imperative.d.ts +8 -0
  194. package/dist/types/components/Dialog/index.d.ts +8 -0
  195. package/dist/types/components/Divider/Divider.d.ts +11 -0
  196. package/dist/types/components/Divider/index.d.ts +3 -0
  197. package/dist/types/components/DropDownMenu/DropdownMenu.d.ts +19 -0
  198. package/dist/types/components/DropDownMenu/index.d.ts +2 -0
  199. package/dist/types/components/Flex/Flex.d.ts +25 -0
  200. package/dist/types/components/Flex/index.d.ts +3 -0
  201. package/dist/types/components/Grid/Grid.d.ts +22 -0
  202. package/dist/types/components/Grid/index.d.ts +3 -0
  203. package/dist/types/components/GridView/GridView.d.ts +59 -0
  204. package/dist/types/components/GridView/index.d.ts +2 -0
  205. package/dist/types/components/Icon/Icon.d.ts +12 -0
  206. package/dist/types/components/Icon/icon-data.d.ts +42 -0
  207. package/dist/types/components/Icon/index.d.ts +3 -0
  208. package/dist/types/components/Input/Input.d.ts +17 -0
  209. package/dist/types/components/Input/index.d.ts +3 -0
  210. package/dist/types/components/NavBar/NavBar.d.ts +20 -0
  211. package/dist/types/components/NavBar/index.d.ts +3 -0
  212. package/dist/types/components/Popup/Popup.d.ts +23 -0
  213. package/dist/types/components/Popup/index.d.ts +3 -0
  214. package/dist/types/components/Radio/Radio.d.ts +62 -0
  215. package/dist/types/components/Radio/index.d.ts +3 -0
  216. package/dist/types/components/Search/Search.d.ts +26 -0
  217. package/dist/types/components/Search/index.d.ts +3 -0
  218. package/dist/types/components/Stepper/Stepper.d.ts +22 -0
  219. package/dist/types/components/Stepper/index.d.ts +3 -0
  220. package/dist/types/components/Switch/Switch.d.ts +16 -0
  221. package/dist/types/components/Switch/index.d.ts +3 -0
  222. package/dist/types/components/Tabbar/Tabbar.d.ts +39 -0
  223. package/dist/types/components/Tabbar/index.d.ts +3 -0
  224. package/dist/types/components/Tabs/Tabs.d.ts +25 -0
  225. package/dist/types/components/Tabs/index.d.ts +3 -0
  226. package/dist/types/components/Tag/Tag.d.ts +39 -0
  227. package/dist/types/components/Tag/index.d.ts +3 -0
  228. package/dist/types/components/TimePicker/TimePicker.d.ts +12 -0
  229. package/dist/types/components/TimePicker/index.d.ts +3 -0
  230. package/dist/types/components/Tip/Tip.d.ts +32 -0
  231. package/dist/types/components/Tip/index.d.ts +3 -0
  232. package/dist/types/components/Toast/Toast.d.ts +11 -0
  233. package/dist/types/components/Toast/index.d.ts +15 -0
  234. package/dist/types/components/Tooltip/Tooltip.d.ts +17 -0
  235. package/dist/types/components/Tooltip/index.d.ts +3 -0
  236. package/dist/types/components/index.d.ts +31 -0
  237. package/dist/types/index.d.ts +7 -0
  238. package/dist/types/utils/color.d.ts +1 -0
  239. package/dist/wz-h5-design.es.js +2449 -0
  240. package/dist/wz-h5-design.umd.js +6 -0
  241. package/package.json +84 -0
@@ -0,0 +1,90 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ const GridViewItem = ({
3
+ icon,
4
+ text,
5
+ description,
6
+ badge,
7
+ corner,
8
+ onClick,
9
+ className = "",
10
+ style = {},
11
+ disabled = false,
12
+ children,
13
+ horizontal = false,
14
+ compact = false,
15
+ backgroundImage,
16
+ backgroundStyle = {}
17
+ }) => {
18
+ const handleClick = () => {
19
+ if (!disabled && onClick) {
20
+ onClick();
21
+ }
22
+ };
23
+ const itemClass = [
24
+ "wz-grid-view-item",
25
+ disabled ? "wz-grid-view-item--disabled" : "",
26
+ onClick ? "wz-grid-view-item--clickable" : "",
27
+ horizontal ? "wz-grid-view-item--horizontal" : "",
28
+ compact ? "wz-grid-view-item--compact" : "",
29
+ backgroundImage ? "wz-grid-view-item--with-bg" : "",
30
+ className
31
+ ].filter(Boolean).join(" ");
32
+ const itemStyle = backgroundImage ? {
33
+ backgroundImage: `url(${backgroundImage})`,
34
+ backgroundSize: "cover",
35
+ backgroundPosition: "center",
36
+ backgroundRepeat: "no-repeat",
37
+ ...backgroundStyle,
38
+ ...style
39
+ } : style;
40
+ if (children) {
41
+ return /* @__PURE__ */ jsxs("div", { className: itemClass, style: itemStyle, onClick: handleClick, children: [
42
+ corner && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__corner", children: corner }),
43
+ children,
44
+ badge && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__badge", children: badge })
45
+ ] });
46
+ }
47
+ return /* @__PURE__ */ jsxs("div", { className: itemClass, style: itemStyle, onClick: handleClick, children: [
48
+ corner && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__corner", children: corner }),
49
+ /* @__PURE__ */ jsxs("div", { className: "wz-grid-view-item__content", children: [
50
+ icon && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__icon", children: icon }),
51
+ /* @__PURE__ */ jsxs("div", { className: "wz-grid-view-item__text", children: [
52
+ text && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__title", children: text }),
53
+ description && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__desc", children: description })
54
+ ] })
55
+ ] }),
56
+ badge && /* @__PURE__ */ jsx("div", { className: "wz-grid-view-item__badge", children: badge })
57
+ ] });
58
+ };
59
+ const GridView = ({
60
+ columns = 4,
61
+ gap = 0,
62
+ square = true,
63
+ className = "",
64
+ style = {},
65
+ children,
66
+ noBg = false,
67
+ rounded = false,
68
+ shadow = false,
69
+ horizontal = false
70
+ }) => {
71
+ const gridStyle = {
72
+ gridTemplateColumns: `repeat(${columns}, 1fr)`,
73
+ gap: typeof gap === "number" ? `${gap}px` : gap,
74
+ ...style
75
+ };
76
+ const gridClass = [
77
+ "wz-grid-view",
78
+ square ? "wz-grid-view--square" : "",
79
+ noBg ? "wz-grid-view--no-bg" : "",
80
+ rounded ? "wz-grid-view--rounded" : "",
81
+ shadow ? "wz-grid-view--shadow" : "",
82
+ horizontal ? "wz-grid-view--horizontal" : "",
83
+ className
84
+ ].filter(Boolean).join(" ");
85
+ return /* @__PURE__ */ jsx("div", { className: gridClass, style: gridStyle, children });
86
+ };
87
+ GridView.Item = GridViewItem;
88
+ export {
89
+ GridView
90
+ };
@@ -0,0 +1 @@
1
+ !function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime"],i):i((e="undefined"!=typeof globalThis?globalThis:e||self).GridView={},e.jsxRuntime)}(this,(function(e,i){"use strict";const r=({columns:e=4,gap:r=0,square:d=!0,className:s="",style:t={},children:n,noBg:a=!1,rounded:o=!1,shadow:c=!1,horizontal:l=!1})=>{const w={gridTemplateColumns:`repeat(${e}, 1fr)`,gap:"number"==typeof r?`${r}px`:r,...t},m=["wz-grid-view",d?"wz-grid-view--square":"",a?"wz-grid-view--no-bg":"",o?"wz-grid-view--rounded":"",c?"wz-grid-view--shadow":"",l?"wz-grid-view--horizontal":"",s].filter(Boolean).join(" ");return i.jsx("div",{className:m,style:w,children:n})};r.Item=({icon:e,text:r,description:d,badge:s,corner:t,onClick:n,className:a="",style:o={},disabled:c=!1,children:l,horizontal:w=!1,compact:m=!1,backgroundImage:g,backgroundStyle:v={}})=>{const u=()=>{!c&&n&&n()},z=["wz-grid-view-item",c?"wz-grid-view-item--disabled":"",n?"wz-grid-view-item--clickable":"",w?"wz-grid-view-item--horizontal":"",m?"wz-grid-view-item--compact":"",g?"wz-grid-view-item--with-bg":"",a].filter(Boolean).join(" "),h=g?{backgroundImage:`url(${g})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",...v,...o}:o;return l?i.jsxs("div",{className:z,style:h,onClick:u,children:[t&&i.jsx("div",{className:"wz-grid-view-item__corner",children:t}),l,s&&i.jsx("div",{className:"wz-grid-view-item__badge",children:s})]}):i.jsxs("div",{className:z,style:h,onClick:u,children:[t&&i.jsx("div",{className:"wz-grid-view-item__corner",children:t}),i.jsxs("div",{className:"wz-grid-view-item__content",children:[e&&i.jsx("div",{className:"wz-grid-view-item__icon",children:e}),i.jsxs("div",{className:"wz-grid-view-item__text",children:[r&&i.jsx("div",{className:"wz-grid-view-item__title",children:r}),d&&i.jsx("div",{className:"wz-grid-view-item__desc",children:d})]})]}),s&&i.jsx("div",{className:"wz-grid-view-item__badge",children:s})]})},e.GridView=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1 @@
1
+ .wz-grid-view{box-sizing:border-box;width:100%;display:grid}.wz-grid-view--square .wz-grid-view-item{aspect-ratio:1}.wz-grid-view.wz-grid-view--horizontal{flex-wrap:wrap;justify-content:space-between;display:flex}.wz-grid-view-item{padding:var(--wz-grid-view-item-padding,16px 8px);box-sizing:border-box;background-color:var(--wz-grid-view-item-bg,#fff);border-radius:var(--wz-grid-view-item-border-radius,8px);flex-direction:column;justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative;overflow:hidden}.wz-grid-view-item--clickable{cursor:pointer}.wz-grid-view-item--clickable:hover{background-color:var(--wz-grid-view-item-hover-bg,#f7f8fa);transform:scale(.98)}.wz-grid-view-item--clickable:active{background-color:var(--wz-grid-view-item-active-bg,#ebedf0);transform:scale(.95)}.wz-grid-view-item--disabled{opacity:.5;cursor:not-allowed}.wz-grid-view-item--disabled:hover{background-color:var(--wz-grid-view-item-bg,#fff);transform:none}.wz-grid-view-item__content{flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.wz-grid-view-item__icon{margin-bottom:var(--wz-grid-view-icon-margin,8px);font-size:var(--wz-grid-view-icon-size,24px);color:var(--wz-grid-view-text-color,#323233);justify-content:center;align-items:center;display:flex}.wz-grid-view-item__icon img{object-fit:contain;width:32px;height:32px}.wz-grid-view-item__icon svg{width:var(--wz-grid-view-icon-size,24px);height:var(--wz-grid-view-icon-size,24px);fill:currentColor}.wz-grid-view-item__text{text-align:center;width:100%}.wz-grid-view-item__title{font-size:var(--wz-grid-view-text-size,12px);color:var(--wz-grid-view-text-color,#323233);word-break:break-all;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-weight:500;line-height:1.2;display:-webkit-box;overflow:hidden}.wz-grid-view-item__desc{font-size:var(--wz-grid-view-desc-size,10px);color:var(--wz-grid-view-desc-color,#969799);word-break:break-all;text-overflow:ellipsis;-webkit-line-clamp:1;-webkit-box-orient:vertical;margin-top:6px;line-height:1.2;display:-webkit-box;overflow:hidden}.wz-grid-view-item__badge{z-index:1;background-color:var(--wz-grid-view-badge-bg,#ee0a24);color:#fff;text-align:center;box-sizing:border-box;border-radius:10px;min-width:16px;padding:2px 4px;font-size:10px;line-height:1;position:absolute;top:4px;right:4px}.wz-grid-view-item__badge:empty{border-radius:50%;width:8px;height:8px;padding:0}.wz-grid-view-item__corner{z-index:1;background-color:var(--wz-grid-view-corner-bg,#ff976a);color:#fff;transform-origin:0 0;border-radius:0 0 8px;padding:2px 6px;font-size:10px;line-height:1;position:absolute;top:0;left:0}.wz-grid-view-item--horizontal{border-radius:10px;width:167px;height:62px;padding:12px 16px}.wz-grid-view-item--horizontal .wz-grid-view-item__content{text-align:left;flex-direction:row;justify-content:flex-start;align-items:center}.wz-grid-view-item--horizontal .wz-grid-view-item__icon{flex-shrink:0;margin-bottom:0;margin-right:12px}.wz-grid-view-item--horizontal .wz-grid-view-item__text{text-align:left;flex:1;align-items:flex-start}.wz-grid-view-item--horizontal .wz-grid-view-item__title{text-align:left;font-size:14px;font-weight:600}.wz-grid-view-item--horizontal .wz-grid-view-item__desc{text-align:left;margin-top:8px;font-size:12px}.wz-grid-view-item--compact{padding:var(--wz-grid-view-item-padding,8px 4px)}.wz-grid-view-item--compact .wz-grid-view-item__icon{margin-bottom:4px;font-size:20px}.wz-grid-view-item--compact .wz-grid-view-item__icon img{width:24px;height:24px}.wz-grid-view-item--compact .wz-grid-view-item__icon svg{width:20px;height:20px}.wz-grid-view-item--compact .wz-grid-view-item__title{font-size:11px}.wz-grid-view--no-bg .wz-grid-view-item{background-color:#0000}.wz-grid-view--no-bg .wz-grid-view-item--clickable:hover{background-color:#0000000d}.wz-grid-view--no-bg .wz-grid-view-item--clickable:active{background-color:#0000001a}.wz-grid-view--rounded .wz-grid-view-item{border-radius:12px}.wz-grid-view--shadow .wz-grid-view-item{box-shadow:0 2px 8px #0000001a}.wz-grid-view--shadow .wz-grid-view-item--clickable:hover{box-shadow:0 4px 12px #00000026}.wz-grid-view-item--with-bg{color:#fff;position:relative}.wz-grid-view-item--with-bg:before{content:"";border-radius:inherit;z-index:0;background:linear-gradient(135deg,#0000004d 0%,#0000001a 50%,#0000004d 100%);position:absolute;top:0;bottom:0;left:0;right:0}.wz-grid-view-item--with-bg .wz-grid-view-item__content{z-index:1;position:relative}.wz-grid-view-item--with-bg .wz-grid-view-item__title{color:#fff;text-shadow:1px 1px 2px #00000080;font-weight:600}.wz-grid-view-item--with-bg .wz-grid-view-item__desc{color:#ffffffe6;text-shadow:1px 1px 2px #00000080}.wz-grid-view-item--with-bg .wz-grid-view-item__icon{color:#fff;filter:drop-shadow(1px 1px 2px #00000080)}.wz-grid-view-item--with-bg.wz-grid-view-item--horizontal{border-radius:10px;width:167px;height:62px}.wz-grid-view-item--with-bg.wz-grid-view-item--horizontal:before{background:linear-gradient(90deg,#0006 0%,#0000001a 70%,#0003 100%);border-radius:10px}.wz-grid-view-item--with-bg.wz-grid-view-item--horizontal .wz-grid-view-item__content{justify-content:flex-start;align-items:center}
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1 @@
1
+ .wz-grid-view{box-sizing:border-box;width:100%;display:grid}.wz-grid-view--square .wz-grid-view-item{aspect-ratio:1}.wz-grid-view.wz-grid-view--horizontal{flex-wrap:wrap;justify-content:space-between;display:flex}.wz-grid-view-item{padding:var(--wz-grid-view-item-padding,16px 8px);box-sizing:border-box;background-color:var(--wz-grid-view-item-bg,#fff);border-radius:var(--wz-grid-view-item-border-radius,8px);flex-direction:column;justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative;overflow:hidden}.wz-grid-view-item--clickable{cursor:pointer}.wz-grid-view-item--clickable:hover{background-color:var(--wz-grid-view-item-hover-bg,#f7f8fa);transform:scale(.98)}.wz-grid-view-item--clickable:active{background-color:var(--wz-grid-view-item-active-bg,#ebedf0);transform:scale(.95)}.wz-grid-view-item--disabled{opacity:.5;cursor:not-allowed}.wz-grid-view-item--disabled:hover{background-color:var(--wz-grid-view-item-bg,#fff);transform:none}.wz-grid-view-item__content{flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.wz-grid-view-item__icon{margin-bottom:var(--wz-grid-view-icon-margin,8px);font-size:var(--wz-grid-view-icon-size,24px);color:var(--wz-grid-view-text-color,#323233);justify-content:center;align-items:center;display:flex}.wz-grid-view-item__icon img{object-fit:contain;width:32px;height:32px}.wz-grid-view-item__icon svg{width:var(--wz-grid-view-icon-size,24px);height:var(--wz-grid-view-icon-size,24px);fill:currentColor}.wz-grid-view-item__text{text-align:center;width:100%}.wz-grid-view-item__title{font-size:var(--wz-grid-view-text-size,12px);color:var(--wz-grid-view-text-color,#323233);word-break:break-all;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-weight:500;line-height:1.2;display:-webkit-box;overflow:hidden}.wz-grid-view-item__desc{font-size:var(--wz-grid-view-desc-size,10px);color:var(--wz-grid-view-desc-color,#969799);word-break:break-all;text-overflow:ellipsis;-webkit-line-clamp:1;-webkit-box-orient:vertical;margin-top:6px;line-height:1.2;display:-webkit-box;overflow:hidden}.wz-grid-view-item__badge{z-index:1;background-color:var(--wz-grid-view-badge-bg,#ee0a24);color:#fff;text-align:center;box-sizing:border-box;border-radius:10px;min-width:16px;padding:2px 4px;font-size:10px;line-height:1;position:absolute;top:4px;right:4px}.wz-grid-view-item__badge:empty{border-radius:50%;width:8px;height:8px;padding:0}.wz-grid-view-item__corner{z-index:1;background-color:var(--wz-grid-view-corner-bg,#ff976a);color:#fff;transform-origin:0 0;border-radius:0 0 8px;padding:2px 6px;font-size:10px;line-height:1;position:absolute;top:0;left:0}.wz-grid-view-item--horizontal{border-radius:10px;width:167px;height:62px;padding:12px 16px}.wz-grid-view-item--horizontal .wz-grid-view-item__content{text-align:left;flex-direction:row;justify-content:flex-start;align-items:center}.wz-grid-view-item--horizontal .wz-grid-view-item__icon{flex-shrink:0;margin-bottom:0;margin-right:12px}.wz-grid-view-item--horizontal .wz-grid-view-item__text{text-align:left;flex:1;align-items:flex-start}.wz-grid-view-item--horizontal .wz-grid-view-item__title{text-align:left;font-size:14px;font-weight:600}.wz-grid-view-item--horizontal .wz-grid-view-item__desc{text-align:left;margin-top:8px;font-size:12px}.wz-grid-view-item--compact{padding:var(--wz-grid-view-item-padding,8px 4px)}.wz-grid-view-item--compact .wz-grid-view-item__icon{margin-bottom:4px;font-size:20px}.wz-grid-view-item--compact .wz-grid-view-item__icon img{width:24px;height:24px}.wz-grid-view-item--compact .wz-grid-view-item__icon svg{width:20px;height:20px}.wz-grid-view-item--compact .wz-grid-view-item__title{font-size:11px}.wz-grid-view--no-bg .wz-grid-view-item{background-color:#0000}.wz-grid-view--no-bg .wz-grid-view-item--clickable:hover{background-color:#0000000d}.wz-grid-view--no-bg .wz-grid-view-item--clickable:active{background-color:#0000001a}.wz-grid-view--rounded .wz-grid-view-item{border-radius:12px}.wz-grid-view--shadow .wz-grid-view-item{box-shadow:0 2px 8px #0000001a}.wz-grid-view--shadow .wz-grid-view-item--clickable:hover{box-shadow:0 4px 12px #00000026}.wz-grid-view-item--with-bg{color:#fff;position:relative}.wz-grid-view-item--with-bg:before{content:"";border-radius:inherit;z-index:0;background:linear-gradient(135deg,#0000004d 0%,#0000001a 50%,#0000004d 100%);position:absolute;top:0;bottom:0;left:0;right:0}.wz-grid-view-item--with-bg .wz-grid-view-item__content{z-index:1;position:relative}.wz-grid-view-item--with-bg .wz-grid-view-item__title{color:#fff;text-shadow:1px 1px 2px #00000080;font-weight:600}.wz-grid-view-item--with-bg .wz-grid-view-item__desc{color:#ffffffe6;text-shadow:1px 1px 2px #00000080}.wz-grid-view-item--with-bg .wz-grid-view-item__icon{color:#fff;filter:drop-shadow(1px 1px 2px #00000080)}.wz-grid-view-item--with-bg.wz-grid-view-item--horizontal{border-radius:10px;width:167px;height:62px}.wz-grid-view-item--with-bg.wz-grid-view-item--horizontal:before{background:linear-gradient(90deg,#0006 0%,#0000001a 70%,#0003 100%);border-radius:10px}.wz-grid-view-item--with-bg.wz-grid-view-item--horizontal .wz-grid-view-item__content{justify-content:flex-start;align-items:center}
@@ -0,0 +1,31 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const Icon = ({
3
+ name,
4
+ size = 24,
5
+ color = "currentColor",
6
+ className = "",
7
+ style,
8
+ onClick,
9
+ type = "yunying"
10
+ // 默认使用yunying图标库
11
+ }) => {
12
+ const iconStyle = {
13
+ fontSize: typeof size === "number" ? `${size}px` : size,
14
+ color,
15
+ ...style
16
+ };
17
+ const iconFontClass = `iconfont-${type}`;
18
+ const iconPrefix = "icon-";
19
+ const iconClass = `${iconPrefix}${name}`;
20
+ return /* @__PURE__ */ jsx(
21
+ "i",
22
+ {
23
+ className: `wz-icon ${iconFontClass} ${iconClass} ${className}`,
24
+ style: iconStyle,
25
+ onClick
26
+ }
27
+ );
28
+ };
29
+ export {
30
+ Icon as default
31
+ };
@@ -0,0 +1 @@
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["react/jsx-runtime"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Icon=n(e.jsxRuntime)}(this,(function(e){"use strict";return({name:n,size:o=24,color:t="currentColor",className:i="",style:s,onClick:c,type:r="yunying"})=>{const u={fontSize:"number"==typeof o?`${o}px`:o,color:t,...s},f=`iconfont-${r}`,l=`icon-${n}`;return e.jsx("i",{className:`wz-icon ${f} ${l} ${i}`,style:u,onClick:c})}}));
@@ -0,0 +1 @@
1
+ .wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1 @@
1
+ .wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}
@@ -0,0 +1,148 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from "react";
3
+ const Icon = ({
4
+ name,
5
+ size = 24,
6
+ color = "currentColor",
7
+ className = "",
8
+ style,
9
+ onClick,
10
+ type = "yunying"
11
+ // 默认使用yunying图标库
12
+ }) => {
13
+ const iconStyle = {
14
+ fontSize: typeof size === "number" ? `${size}px` : size,
15
+ color,
16
+ ...style
17
+ };
18
+ const iconFontClass = `iconfont-${type}`;
19
+ const iconPrefix = "icon-";
20
+ const iconClass = `${iconPrefix}${name}`;
21
+ return /* @__PURE__ */ jsx(
22
+ "i",
23
+ {
24
+ className: `wz-icon ${iconFontClass} ${iconClass} ${className}`,
25
+ style: iconStyle,
26
+ onClick
27
+ }
28
+ );
29
+ };
30
+ const Input = forwardRef(
31
+ ({
32
+ clearable = false,
33
+ align = "center",
34
+ value,
35
+ defaultValue,
36
+ onChange,
37
+ style,
38
+ className = "",
39
+ type = "text",
40
+ showCount = false,
41
+ rows = 3,
42
+ maxLength,
43
+ countStyle,
44
+ suffix,
45
+ borderRadius,
46
+ backgroundColor,
47
+ bordered,
48
+ ...props
49
+ }, ref) => {
50
+ const isControlled = value !== void 0;
51
+ const [innerValue, setInnerValue] = useState(defaultValue || "");
52
+ const showClear = clearable && !!(isControlled ? value : innerValue);
53
+ const [passwordVisible, setPasswordVisible] = useState(false);
54
+ const handleChange = (e) => {
55
+ if (!isControlled) setInnerValue(e.target.value);
56
+ onChange == null ? void 0 : onChange(e);
57
+ };
58
+ const handleClear = () => {
59
+ if (!isControlled) setInnerValue("");
60
+ const event = {
61
+ ...props,
62
+ target: { value: "" }
63
+ };
64
+ onChange == null ? void 0 : onChange(event);
65
+ };
66
+ const handlePasswordVisible = () => {
67
+ setPasswordVisible(!passwordVisible);
68
+ };
69
+ const wrapperStyle = {
70
+ position: "relative",
71
+ width: style == null ? void 0 : style.width,
72
+ ...style
73
+ };
74
+ const inputStyle = {
75
+ textAlign: align,
76
+ borderRadius,
77
+ backgroundColor,
78
+ border: bordered !== void 0 ? void 0 : "none"
79
+ };
80
+ const currentValue = isControlled ? value : innerValue;
81
+ const count = (currentValue == null ? void 0 : currentValue.toString().length) || 0;
82
+ const isExceeded = maxLength && count > maxLength;
83
+ const renderInput = () => {
84
+ if (type === "textarea") {
85
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
86
+ /* @__PURE__ */ jsx(
87
+ "textarea",
88
+ {
89
+ ref,
90
+ className: `wz-input ${className}`,
91
+ value: currentValue,
92
+ onChange: handleChange,
93
+ style: { ...inputStyle, resize: "none" },
94
+ rows,
95
+ maxLength,
96
+ ...props
97
+ }
98
+ ),
99
+ showCount && maxLength && /* @__PURE__ */ jsxs(
100
+ "div",
101
+ {
102
+ className: `wz-input-count ${isExceeded ? "wz-input-count-exceeded" : ""}`,
103
+ style: countStyle,
104
+ children: [
105
+ count,
106
+ "/",
107
+ maxLength
108
+ ]
109
+ }
110
+ )
111
+ ] });
112
+ }
113
+ return /* @__PURE__ */ jsx(
114
+ "input",
115
+ {
116
+ ref,
117
+ className: `wz-input ${className}`,
118
+ value: currentValue,
119
+ onChange: handleChange,
120
+ style: inputStyle,
121
+ type: type === "password" && passwordVisible ? "text" : type,
122
+ maxLength,
123
+ ...props
124
+ }
125
+ );
126
+ };
127
+ return /* @__PURE__ */ jsxs(
128
+ "div",
129
+ {
130
+ className: `wz-input-affix-wrapper ${type === "textarea" ? "wz-input-affix-wrapper-textarea" : ""} ${suffix ? "wz-input-has-suffix" : ""} ${bordered === void 0 ? "wz-input-no-border" : ""}`,
131
+ style: wrapperStyle,
132
+ children: [
133
+ renderInput(),
134
+ showClear && !props.disabled && type !== "textarea" && !suffix && /* @__PURE__ */ jsx("span", { className: "wz-input-clear", onClick: handleClear, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 22 }) }),
135
+ type === "password" && !suffix && /* @__PURE__ */ jsx("span", { className: "wz-input-password", onClick: handlePasswordVisible, children: /* @__PURE__ */ jsx(Icon, { name: passwordVisible ? "eyes-close" : "eyes-open", size: 22 }) }),
136
+ suffix && /* @__PURE__ */ jsxs("div", { className: "wz-input-suffix", children: [
137
+ /* @__PURE__ */ jsx("span", { className: "wz-input-suffix-divider" }),
138
+ suffix
139
+ ] })
140
+ ]
141
+ }
142
+ );
143
+ }
144
+ );
145
+ Input.displayName = "Input";
146
+ export {
147
+ Input as default
148
+ };
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Input=t(e.jsxRuntime,e.React)}(this,(function(e,t){"use strict";const n=({name:t,size:n=24,color:s="currentColor",className:a="",style:i,onClick:o,type:r="yunying"})=>{const l={fontSize:"number"==typeof n?`${n}px`:n,color:s,...i},u=`iconfont-${r}`,c=`icon-${t}`;return e.jsx("i",{className:`wz-icon ${u} ${c} ${a}`,style:l,onClick:o})},s=t.forwardRef((({clearable:s=!1,align:a="center",value:i,defaultValue:o,onChange:r,style:l,className:u="",type:c="text",showCount:d=!1,rows:p=3,maxLength:x,countStyle:f,suffix:m,borderRadius:w,backgroundColor:y,bordered:h,...g},z)=>{const j=void 0!==i,[v,b]=t.useState(o||""),N=s&&!!(j?i:v),[C,$]=t.useState(!1),k=e=>{j||b(e.target.value),null==r||r(e)},R={position:"relative",width:null==l?void 0:l.width,...l},S={textAlign:a,borderRadius:w,backgroundColor:y,border:void 0!==h?void 0:"none"},L=j?i:v,q=(null==L?void 0:L.toString().length)||0,I=x&&q>x;return e.jsxs("div",{className:`wz-input-affix-wrapper ${"textarea"===c?"wz-input-affix-wrapper-textarea":""} ${m?"wz-input-has-suffix":""} ${void 0===h?"wz-input-no-border":""}`,style:R,children:["textarea"===c?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{ref:z,className:`wz-input ${u}`,value:L,onChange:k,style:{...S,resize:"none"},rows:p,maxLength:x,...g}),d&&x&&e.jsxs("div",{className:"wz-input-count "+(I?"wz-input-count-exceeded":""),style:f,children:[q,"/",x]})]}):e.jsx("input",{ref:z,className:`wz-input ${u}`,value:L,onChange:k,style:S,type:"password"===c&&C?"text":c,maxLength:x,...g}),N&&!g.disabled&&"textarea"!==c&&!m&&e.jsx("span",{className:"wz-input-clear",onClick:()=>{j||b("");const e={...g,target:{value:""}};null==r||r(e)},children:e.jsx(n,{name:"close",size:22})}),"password"===c&&!m&&e.jsx("span",{className:"wz-input-password",onClick:()=>{$(!C)},children:e.jsx(n,{name:C?"eyes-close":"eyes-open",size:22})}),m&&e.jsxs("div",{className:"wz-input-suffix",children:[e.jsx("span",{className:"wz-input-suffix-divider"}),m]})]})}));return s.displayName="Input",s}));
@@ -0,0 +1 @@
1
+ .wz-input-affix-wrapper{width:100%;display:block;position:relative}.wz-input{color:#222;text-align:center;box-sizing:border-box;box-shadow:none;background:#fff;border:none;border-radius:6px;outline:none;width:100%;height:40px;padding:0 15px;font-size:15px;font-weight:500;transition:border .2s,box-shadow .2s,background .2s,color .2s;display:block}.wz-input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.wz-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.wz-input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.wz-input:focus{caret-color:#22c94d;border:1px solid #22c94d;box-shadow:none!important;outline:none!important}.wz-input-no-border .wz-input,.wz-input-no-border .wz-input:focus{border:none!important}.wz-input:disabled{color:#eee;cursor:not-allowed;background:#fff;border:none}.wz-input-clear{cursor:pointer;z-index:2;background:0 0;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;transition:background .2s;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.wz-input-clear:active{background:#e5e7eb}.wz-input-password{cursor:pointer;z-index:2;background:0 0;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;transition:background .2s;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.wz-input-password:active{background:#e5e7eb}@media (max-width:375px){.wz-input{min-height:36px;padding:0 12px;font-size:14px}.wz-input-clear,.wz-input-password{width:28px;height:28px;right:8px}}.wz-input-affix-wrapper-textarea{width:100%;display:inline-block;position:relative}.wz-input-affix-wrapper-textarea .wz-input{text-align:left;height:auto;padding:12px 12px 30px}.wz-input-affix-wrapper-textarea .wz-input-count{color:#999;font-size:14px;position:absolute;bottom:8px;right:12px}.wz-input-affix-wrapper-textarea .wz-input-count-exceeded{color:#f5222d}.wz-input-has-suffix .wz-input{padding-right:100px}.wz-input-suffix{color:#22c94d;align-items:center;font-size:14px;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.wz-input-suffix-divider{background-color:#e0e0e0;width:1px;height:16px;margin-right:12px}
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1 @@
1
+ .wz-input-affix-wrapper{width:100%;display:block;position:relative}.wz-input{color:#222;text-align:center;box-sizing:border-box;box-shadow:none;background:#fff;border:none;border-radius:6px;outline:none;width:100%;height:40px;padding:0 15px;font-size:15px;font-weight:500;transition:border .2s,box-shadow .2s,background .2s,color .2s;display:block}.wz-input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.wz-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.wz-input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.wz-input:focus{caret-color:#22c94d;border:1px solid #22c94d;box-shadow:none!important;outline:none!important}.wz-input-no-border .wz-input,.wz-input-no-border .wz-input:focus{border:none!important}.wz-input:disabled{color:#eee;cursor:not-allowed;background:#fff;border:none}.wz-input-clear{cursor:pointer;z-index:2;background:0 0;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;transition:background .2s;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.wz-input-clear:active{background:#e5e7eb}.wz-input-password{cursor:pointer;z-index:2;background:0 0;border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;transition:background .2s;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.wz-input-password:active{background:#e5e7eb}@media (max-width:375px){.wz-input{min-height:36px;padding:0 12px;font-size:14px}.wz-input-clear,.wz-input-password{width:28px;height:28px;right:8px}}.wz-input-affix-wrapper-textarea{width:100%;display:inline-block;position:relative}.wz-input-affix-wrapper-textarea .wz-input{text-align:left;height:auto;padding:12px 12px 30px}.wz-input-affix-wrapper-textarea .wz-input-count{color:#999;font-size:14px;position:absolute;bottom:8px;right:12px}.wz-input-affix-wrapper-textarea .wz-input-count-exceeded{color:#f5222d}.wz-input-has-suffix .wz-input{padding-right:100px}.wz-input-suffix{color:#22c94d;align-items:center;font-size:14px;display:flex;position:absolute;top:50%;right:16px;transform:translateY(-50%)}.wz-input-suffix-divider{background-color:#e0e0e0;width:1px;height:16px;margin-right:12px}.wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}
@@ -0,0 +1,175 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { useState, useRef, useEffect } from "react";
3
+ function getDefaultExportFromCjs(x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
+ }
6
+ var classnames$1 = { exports: {} };
7
+ /*!
8
+ Copyright (c) 2018 Jed Watson.
9
+ Licensed under the MIT License (MIT), see
10
+ http://jedwatson.github.io/classnames
11
+ */
12
+ (function(module) {
13
+ (function() {
14
+ var hasOwn = {}.hasOwnProperty;
15
+ function classNames() {
16
+ var classes = [];
17
+ for (var i = 0; i < arguments.length; i++) {
18
+ var arg = arguments[i];
19
+ if (!arg) continue;
20
+ var argType = typeof arg;
21
+ if (argType === "string" || argType === "number") {
22
+ classes.push(arg);
23
+ } else if (Array.isArray(arg)) {
24
+ if (arg.length) {
25
+ var inner = classNames.apply(null, arg);
26
+ if (inner) {
27
+ classes.push(inner);
28
+ }
29
+ }
30
+ } else if (argType === "object") {
31
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
32
+ classes.push(arg.toString());
33
+ continue;
34
+ }
35
+ for (var key in arg) {
36
+ if (hasOwn.call(arg, key) && arg[key]) {
37
+ classes.push(key);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ return classes.join(" ");
43
+ }
44
+ if (module.exports) {
45
+ classNames.default = classNames;
46
+ module.exports = classNames;
47
+ } else {
48
+ window.classNames = classNames;
49
+ }
50
+ })();
51
+ })(classnames$1);
52
+ var classnamesExports = classnames$1.exports;
53
+ const classnames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
54
+ const Icon = ({
55
+ name,
56
+ size = 24,
57
+ color = "currentColor",
58
+ className = "",
59
+ style,
60
+ onClick,
61
+ type = "yunying"
62
+ // 默认使用yunying图标库
63
+ }) => {
64
+ const iconStyle = {
65
+ fontSize: typeof size === "number" ? `${size}px` : size,
66
+ color,
67
+ ...style
68
+ };
69
+ const iconFontClass = `iconfont-${type}`;
70
+ const iconPrefix = "icon-";
71
+ const iconClass = `${iconPrefix}${name}`;
72
+ return /* @__PURE__ */ jsx(
73
+ "i",
74
+ {
75
+ className: `wz-icon ${iconFontClass} ${iconClass} ${className}`,
76
+ style: iconStyle,
77
+ onClick
78
+ }
79
+ );
80
+ };
81
+ const NavBar = ({
82
+ title,
83
+ leftArrow = true,
84
+ leftText,
85
+ rightText,
86
+ onLeftClick,
87
+ onRightClick,
88
+ leftSlot,
89
+ rightSlot,
90
+ titleSlot,
91
+ className,
92
+ style,
93
+ fixed = false,
94
+ scrollFixed = false
95
+ }) => {
96
+ const [isFixed, setIsFixed] = useState(fixed);
97
+ const navbarRef = useRef(null);
98
+ const placeholderRef = useRef(null);
99
+ useEffect(() => {
100
+ if (scrollFixed === false) {
101
+ setIsFixed(fixed);
102
+ return;
103
+ }
104
+ const threshold = typeof scrollFixed === "number" ? scrollFixed : 0;
105
+ const handleScroll = () => {
106
+ const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
107
+ setIsFixed(scrollTop > threshold);
108
+ };
109
+ window.addEventListener("scroll", handleScroll);
110
+ handleScroll();
111
+ return () => {
112
+ window.removeEventListener("scroll", handleScroll);
113
+ };
114
+ }, [scrollFixed, fixed]);
115
+ const handleLeftClick = () => {
116
+ if (onLeftClick) {
117
+ onLeftClick();
118
+ }
119
+ };
120
+ const handleRightClick = () => {
121
+ if (onRightClick) {
122
+ onRightClick();
123
+ }
124
+ };
125
+ const renderLeft = () => {
126
+ if (leftSlot) {
127
+ return /* @__PURE__ */ jsx("div", { className: "wz-navbar-left", children: leftSlot });
128
+ }
129
+ return /* @__PURE__ */ jsxs("div", { className: "wz-navbar-left", onClick: handleLeftClick, children: [
130
+ leftArrow && /* @__PURE__ */ jsx(
131
+ Icon,
132
+ {
133
+ name: "right-arrow",
134
+ size: 20,
135
+ style: { transform: "scaleX(-1)" },
136
+ className: "wz-navbar-icon"
137
+ }
138
+ ),
139
+ leftText && /* @__PURE__ */ jsx("span", { className: "wz-navbar-text", children: leftText })
140
+ ] });
141
+ };
142
+ const renderRight = () => {
143
+ if (rightSlot) {
144
+ return /* @__PURE__ */ jsx("div", { className: "wz-navbar-right", children: rightSlot });
145
+ }
146
+ return /* @__PURE__ */ jsxs("div", { className: "wz-navbar-right", onClick: handleRightClick, children: [
147
+ rightText && /* @__PURE__ */ jsx("span", { className: "wz-navbar-text", children: rightText }),
148
+ !rightText && /* @__PURE__ */ jsx(Icon, { name: "more-h", className: "wz-navbar-icon" })
149
+ ] });
150
+ };
151
+ const renderTitle = () => {
152
+ if (titleSlot) {
153
+ return /* @__PURE__ */ jsx("div", { className: "wz-navbar-title", children: titleSlot });
154
+ }
155
+ return /* @__PURE__ */ jsx("div", { className: "wz-navbar-title", children: title });
156
+ };
157
+ const navbarClass = classnames(
158
+ "wz-navbar",
159
+ {
160
+ "wz-navbar-fixed": isFixed
161
+ },
162
+ className
163
+ );
164
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
165
+ isFixed && /* @__PURE__ */ jsx("div", { ref: placeholderRef, style: { height: "44px" } }),
166
+ /* @__PURE__ */ jsxs("div", { ref: navbarRef, className: navbarClass, style, children: [
167
+ renderLeft(),
168
+ renderTitle(),
169
+ renderRight()
170
+ ] })
171
+ ] });
172
+ };
173
+ export {
174
+ NavBar as default
175
+ };
@@ -0,0 +1,6 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["react/jsx-runtime","react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).NavBar=t(e.jsxRuntime,e.React)}(this,(function(e,t){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r,s={exports:{}};
2
+ /*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */r=s,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var s=arguments[r];if(s){var a=typeof s;if("string"===a||"number"===a)n.push(s);else if(Array.isArray(s)){if(s.length){var i=t.apply(null,s);i&&n.push(i)}}else if("object"===a){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){n.push(s.toString());continue}for(var l in s)e.call(s,l)&&s[l]&&n.push(l)}}}return n.join(" ")}r.exports?(t.default=t,r.exports=t):window.classNames=t}();const a=n(s.exports),i=({name:t,size:n=24,color:r="currentColor",className:s="",style:a,onClick:i,type:l="yunying"})=>{const o={fontSize:"number"==typeof n?`${n}px`:n,color:r,...a},c=`iconfont-${l}`,f=`icon-${t}`;return e.jsx("i",{className:`wz-icon ${c} ${f} ${s}`,style:o,onClick:i})};return({title:n,leftArrow:r=!0,leftText:s,rightText:l,onLeftClick:o,onRightClick:c,leftSlot:f,rightSlot:u,titleSlot:d,className:m,style:v,fixed:p=!1,scrollFixed:x=!1})=>{const[h,w]=t.useState(p),y=t.useRef(null),j=t.useRef(null);t.useEffect((()=>{if(!1===x)return void w(p);const e="number"==typeof x?x:0,t=()=>{const t=window.pageYOffset||document.documentElement.scrollTop;w(t>e)};return window.addEventListener("scroll",t),t(),()=>{window.removeEventListener("scroll",t)}}),[x,p]);const b=()=>{o&&o()},g=()=>{c&&c()},z=a("wz-navbar",{"wz-navbar-fixed":h},m);return e.jsxs(e.Fragment,{children:[h&&e.jsx("div",{ref:j,style:{height:"44px"}}),e.jsxs("div",{ref:y,className:z,style:v,children:[f?e.jsx("div",{className:"wz-navbar-left",children:f}):e.jsxs("div",{className:"wz-navbar-left",onClick:b,children:[r&&e.jsx(i,{name:"right-arrow",size:20,style:{transform:"scaleX(-1)"},className:"wz-navbar-icon"}),s&&e.jsx("span",{className:"wz-navbar-text",children:s})]}),d?e.jsx("div",{className:"wz-navbar-title",children:d}):e.jsx("div",{className:"wz-navbar-title",children:n}),u?e.jsx("div",{className:"wz-navbar-right",children:u}):e.jsxs("div",{className:"wz-navbar-right",onClick:g,children:[l&&e.jsx("span",{className:"wz-navbar-text",children:l}),!l&&e.jsx(i,{name:"more-h",className:"wz-navbar-icon"})]})]})]})}}));
@@ -0,0 +1 @@
1
+ .wz-navbar{background-color:#fff;border-bottom:1px solid #f0f0f0;align-items:center;height:44px;display:flex;position:relative}.wz-navbar.wz-navbar-fixed{z-index:999;position:fixed;top:0;left:0;right:0}.wz-navbar-left,.wz-navbar-right{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;align-items:center;height:100%;padding:0 16px;display:flex}.wz-navbar-left .wz-navbar-icon,.wz-navbar-right .wz-navbar-icon{font-size:20px}.wz-navbar-title{text-align:center;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:16px;font-weight:500;overflow:hidden}.wz-navbar-text{font-size:14px}
@@ -0,0 +1 @@
1
+ import './index.css';
@@ -0,0 +1 @@
1
+ .wz-icon{justify-content:center;align-items:center;transition:color .2s ease-in-out;display:inline-flex}.wz-icon-home:before{content:""}.wz-icon-search:before{content:""}.wz-icon-person:before{content:""}.wz-icon-settings:before{content:""}.wz-icon-notifications:before{content:""}.wz-icon-message:before{content:""}.wz-icon-favorite:before{content:""}.wz-icon-star:before{content:""}.wz-icon-close:before{content:""}.wz-icon-check:before{content:""}.wz-icon-arrow-back:before{content:""}.wz-icon-arrow-forward:before{content:""}.wz-icon-menu:before{content:""}.wz-icon-more:before{content:""}.wz-icon-add:before{content:""}.wz-icon-edit:before{content:""}.wz-icon-delete:before{content:""}.wz-icon-share:before{content:""}.wz-icon-download:before{content:""}.wz-icon-upload:before{content:""}.wz-icon-refresh:before{content:""}.wz-icon-help:before{content:""}.wz-icon-info:before{content:""}.wz-icon-warning:before{content:""}.wz-icon-error:before{content:""}.wz-icon-success:before{content:""}.wz-navbar{background-color:#fff;border-bottom:1px solid #f0f0f0;align-items:center;height:44px;display:flex;position:relative}.wz-navbar.wz-navbar-fixed{z-index:999;position:fixed;top:0;left:0;right:0}.wz-navbar-left,.wz-navbar-right{cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;align-items:center;height:100%;padding:0 16px;display:flex}.wz-navbar-left .wz-navbar-icon,.wz-navbar-right .wz-navbar-icon{font-size:20px}.wz-navbar-title{text-align:center;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:16px;font-weight:500;overflow:hidden}.wz-navbar-text{font-size:14px}