@nutui/nutui 3.1.21 → 3.1.22-beta.5

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 (233) hide show
  1. package/dist/nutui.es.js +4203 -19263
  2. package/dist/nutui.umd.js +4208 -19368
  3. package/dist/packages/_es/ActionSheet.js +17 -167
  4. package/dist/packages/_es/Address.js +110 -552
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Animate.js +22 -0
  7. package/dist/packages/_es/Audio.js +53 -274
  8. package/dist/packages/_es/AudioOperate.js +13 -121
  9. package/dist/packages/_es/Avatar.js +38 -177
  10. package/dist/packages/_es/AvatarGroup.js +14 -73
  11. package/dist/packages/_es/BackTop.js +43 -156
  12. package/dist/packages/_es/Badge.js +14 -86
  13. package/dist/packages/_es/Barrage.js +41 -120
  14. package/dist/packages/_es/Button.js +23 -128
  15. package/dist/packages/_es/Calendar.js +30 -237
  16. package/dist/packages/_es/CalendarItem.js +2 -1
  17. package/dist/packages/_es/Card.js +10 -107
  18. package/dist/packages/_es/Cascader.js +147 -523
  19. package/dist/packages/_es/Category.js +15 -58
  20. package/dist/packages/_es/CategoryPane.js +11 -111
  21. package/dist/packages/_es/Cell.js +21 -100
  22. package/dist/packages/_es/CellGroup.js +9 -44
  23. package/dist/packages/_es/Checkbox.js +31 -113
  24. package/dist/packages/_es/CheckboxGroup.js +29 -58
  25. package/dist/packages/_es/CircleProgress.js +28 -151
  26. package/dist/packages/_es/Col.js +14 -56
  27. package/dist/packages/_es/Collapse.js +32 -84
  28. package/dist/packages/_es/CollapseItem.js +59 -272
  29. package/dist/packages/_es/Comment.js +64 -434
  30. package/dist/packages/_es/ConfigProvider.js +13 -0
  31. package/dist/packages/_es/CountDown.js +56 -256
  32. package/dist/packages/_es/CountUp.js +140 -556
  33. package/dist/packages/_es/DatePicker.js +98 -332
  34. package/dist/packages/_es/Dialog.js +60 -271
  35. package/dist/packages/_es/Divider.js +13 -82
  36. package/dist/packages/_es/Drag.js +56 -197
  37. package/dist/packages/_es/Ecard.js +24 -159
  38. package/dist/packages/_es/Elevator.js +58 -212
  39. package/dist/packages/_es/Ellipsis.js +64 -0
  40. package/dist/packages/_es/Empty.js +12 -71
  41. package/dist/packages/_es/FixedNav.js +15 -122
  42. package/dist/packages/_es/Form.js +64 -151
  43. package/dist/packages/_es/FormItem.js +15 -110
  44. package/dist/packages/_es/Grid.js +5 -6
  45. package/dist/packages/_es/GridItem.js +33 -144
  46. package/dist/packages/_es/Icon.js +15 -40
  47. package/dist/packages/_es/Image.js +31 -0
  48. package/dist/packages/_es/ImagePreview.js +77 -309
  49. package/dist/packages/_es/Indicator.js +15 -62
  50. package/dist/packages/_es/InfiniteLoading.js +57 -268
  51. package/dist/packages/_es/Input.js +51 -413
  52. package/dist/packages/_es/InputNumber.js +41 -160
  53. package/dist/packages/_es/Layout.js +4 -5
  54. package/dist/packages/_es/List.js +18 -124
  55. package/dist/packages/_es/Menu.js +45 -118
  56. package/dist/packages/_es/MenuItem.js +37 -162
  57. package/dist/packages/_es/Navbar.js +30 -192
  58. package/dist/packages/_es/NoticeBar.js +74 -397
  59. package/dist/packages/_es/Notify.js +72 -246
  60. package/dist/packages/_es/NumberKeyboard.js +41 -272
  61. package/dist/packages/_es/OldPicker.js +131 -474
  62. package/dist/packages/_es/OverLay.js +24 -113
  63. package/dist/packages/_es/Pagination.js +39 -157
  64. package/dist/packages/_es/Picker.js +129 -469
  65. package/dist/packages/_es/Popover.js +318 -975
  66. package/dist/packages/_es/Popup.js +55 -313
  67. package/dist/packages/_es/Price.js +16 -118
  68. package/dist/packages/_es/Progress.js +14 -146
  69. package/dist/packages/_es/PullRefresh.js +84 -354
  70. package/dist/packages/_es/Radio.js +22 -90
  71. package/dist/packages/_es/RadioGroup.js +8 -37
  72. package/dist/packages/_es/Range.js +83 -427
  73. package/dist/packages/_es/Rate.js +35 -137
  74. package/dist/packages/_es/Row.js +22 -64
  75. package/dist/packages/_es/SearchBar.js +37 -257
  76. package/dist/packages/_es/ShortPassword.js +35 -225
  77. package/dist/packages/_es/SideNavBar.js +24 -99
  78. package/dist/packages/_es/SideNavBarItem.js +11 -46
  79. package/dist/packages/_es/Signature.js +41 -179
  80. package/dist/packages/_es/Skeleton.js +20 -136
  81. package/dist/packages/_es/Sku.js +84 -509
  82. package/dist/packages/_es/Step.js +20 -133
  83. package/dist/packages/_es/Steps.js +18 -53
  84. package/dist/packages/_es/Sticky.js +53 -138
  85. package/dist/packages/_es/SubSideNavBar.js +17 -100
  86. package/dist/packages/_es/Swipe.js +41 -197
  87. package/dist/packages/_es/Swiper.js +121 -433
  88. package/dist/packages/_es/SwiperItem.js +22 -53
  89. package/dist/packages/_es/Switch.js +21 -116
  90. package/dist/packages/_es/TabPane.js +12 -39
  91. package/dist/packages/_es/Tabbar.js +17 -72
  92. package/dist/packages/_es/TabbarItem.js +29 -151
  93. package/dist/packages/_es/Table.js +18 -196
  94. package/dist/packages/_es/Tabs.js +43 -217
  95. package/dist/packages/_es/Tag.js +20 -97
  96. package/dist/packages/_es/TextArea.js +42 -160
  97. package/dist/packages/_es/TimeDetail.js +18 -98
  98. package/dist/packages/_es/TimePannel.js +14 -66
  99. package/dist/packages/_es/TimeSelect.js +15 -103
  100. package/dist/packages/_es/Toast.js +71 -329
  101. package/dist/packages/_es/Uploader.js +104 -468
  102. package/dist/packages/_es/Video.js +74 -350
  103. package/dist/packages/_es/common.js +38 -128
  104. package/dist/packages/_es/component.js +35 -76
  105. package/dist/packages/_es/index.js +5 -6
  106. package/dist/packages/_es/index2.js +9 -30
  107. package/dist/packages/_es/index3.js +6 -8
  108. package/dist/packages/_es/index4.js +13 -58
  109. package/dist/packages/_es/index5.js +164 -682
  110. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  111. package/dist/packages/_es/pxCheck.js +3 -5
  112. package/dist/packages/_es/raf.js +8 -15
  113. package/dist/packages/animate/index.scss +299 -0
  114. package/dist/packages/button/index.scss +2 -1
  115. package/dist/packages/cell/index.scss +18 -1
  116. package/dist/packages/checkbox/index.scss +16 -0
  117. package/dist/packages/configprovider/index.scss +2 -0
  118. package/dist/packages/dialog/index.scss +1 -0
  119. package/dist/packages/elevator/index.scss +21 -0
  120. package/dist/packages/ellipsis/index.scss +12 -0
  121. package/dist/packages/formitem/index.scss +12 -0
  122. package/dist/packages/griditem/index.scss +11 -0
  123. package/dist/packages/image/index.scss +39 -0
  124. package/dist/packages/imagepreview/index.scss +21 -2
  125. package/dist/packages/input/index.scss +26 -1
  126. package/dist/packages/inputnumber/index.scss +21 -0
  127. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  128. package/dist/packages/locale/lang/baseLang.js +3 -3
  129. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  130. package/dist/packages/locale/lang/en-US.js +5 -97
  131. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  132. package/dist/packages/locale/lang/id-ID.js +5 -97
  133. package/dist/packages/locale/lang/index.js +16 -38
  134. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  135. package/dist/packages/locale/lang/zh-CN.js +5 -97
  136. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  137. package/dist/packages/locale/lang/zh-TW.js +5 -97
  138. package/dist/packages/menu/index.scss +45 -36
  139. package/dist/packages/menuitem/index.scss +4 -0
  140. package/dist/packages/navbar/index.scss +9 -0
  141. package/dist/packages/pagination/index.scss +19 -0
  142. package/dist/packages/radio/index.scss +19 -0
  143. package/dist/packages/range/index.scss +19 -0
  144. package/dist/packages/rate/index.scss +1 -1
  145. package/dist/packages/searchbar/index.scss +21 -0
  146. package/dist/packages/switch/index.scss +4 -3
  147. package/dist/packages/tabbar/index.scss +5 -0
  148. package/dist/packages/tabbaritem/index.scss +7 -0
  149. package/dist/packages/tabpane/index.scss +6 -0
  150. package/dist/packages/tabs/index.scss +22 -0
  151. package/dist/packages/textarea/index.scss +8 -0
  152. package/dist/smartips/attributes.json +192 -12
  153. package/dist/smartips/tags.json +70 -10
  154. package/dist/smartips/web-types.json +6945 -0
  155. package/dist/style.css +1 -1
  156. package/dist/style.es.js +1 -1
  157. package/dist/styles/font/config.json +3 -1
  158. package/dist/styles/font/demo_index.html +49 -3
  159. package/dist/styles/font/iconfont.css +11 -3
  160. package/dist/styles/font/iconfont.js +15 -15
  161. package/dist/styles/font/iconfont.json +14 -0
  162. package/dist/styles/font/iconfont.ttf +0 -0
  163. package/dist/styles/font/iconfont.woff +0 -0
  164. package/dist/styles/font/iconfont.woff2 +0 -0
  165. package/dist/styles/themes/default.scss +54 -50
  166. package/dist/styles/themes/jdb.scss +54 -50
  167. package/dist/styles/themes/jdt.scss +54 -50
  168. package/dist/styles/variables-jdb.scss +19 -1
  169. package/dist/styles/variables-jdt.scss +19 -1
  170. package/dist/styles/variables.scss +22 -1
  171. package/dist/types/__VUE/address/index.vue.d.ts +2 -2
  172. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  173. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  174. package/dist/types/__VUE/animate/type.d.ts +6 -0
  175. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  176. package/dist/types/__VUE/avatar/index.vue.d.ts +7 -7
  177. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  180. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  181. package/dist/types/__VUE/cell/index.vue.d.ts +13 -6
  182. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  183. package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
  184. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  185. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  186. package/dist/types/__VUE/collapse/index.vue.d.ts +5 -3
  187. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  188. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  189. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  190. package/dist/types/__VUE/datepicker/index.vue.d.ts +5 -5
  191. package/dist/types/__VUE/datepicker/type.d.ts +6 -0
  192. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  193. package/dist/types/__VUE/dialog/index.vue.d.ts +26 -17
  194. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  195. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  196. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  197. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  198. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  199. package/dist/types/__VUE/grid/common.d.ts +3 -3
  200. package/dist/types/__VUE/grid/index.vue.d.ts +5 -5
  201. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  202. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  203. package/dist/types/__VUE/image/type.d.ts +6 -0
  204. package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
  205. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  206. package/dist/types/__VUE/input/index.vue.d.ts +4 -4
  207. package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
  208. package/dist/types/__VUE/menuitem/index.vue.d.ts +16 -7
  209. package/dist/types/__VUE/menuitem/type.d.ts +8 -0
  210. package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
  211. package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
  212. package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
  213. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  214. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  215. package/dist/types/__VUE/rate/common.d.ts +149 -0
  216. package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
  217. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  218. package/dist/types/__VUE/skeleton/common.d.ts +2 -4
  219. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  220. package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
  221. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  222. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  223. package/dist/types/__VUE/tabs/common.d.ts +2 -2
  224. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  225. package/dist/types/__VUE/timeselect/index.vue.d.ts +8 -0
  226. package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
  227. package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
  228. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  229. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  230. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  231. package/dist/types/index.d.ts +1 -1
  232. package/dist/types/nutui.d.ts +5 -1
  233. package/package.json +7 -3
@@ -1,185 +1,47 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
1
  /*!
21
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
22
3
  * (c) 2022 @jdf2e.
23
4
  * Released under the MIT License.
24
5
  */
25
- import { ref, computed, reactive, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, withCtx, createTextVNode } from "vue";
26
- import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { ref as e, computed as t, reactive as n, onMounted as a, toRefs as s, resolveComponent as r, openBlock as l, createElementBlock as o, normalizeClass as u, createElementVNode as i, toDisplayString as c, createVNode as v, withCtx as p, createTextVNode as d } from "vue";
7
+ import { c as m } from "./component.js";
8
+ import { _ as g } from "./plugin-vue_export-helper.js";
28
9
  import "../locale/lang";
29
- const { componentName, create, translate } = createComponent("signature");
30
- const _sfc_main = create({
31
- props: {
32
- customClass: {
33
- type: String,
34
- default: ""
35
- },
36
- lineWidth: {
37
- type: Number,
38
- default: 2
39
- },
40
- strokeStyle: {
41
- type: String,
42
- default: "#000"
43
- },
44
- type: {
45
- type: String,
46
- default: "png"
47
- },
48
- unSupportTpl: {
49
- type: String,
50
- default: ""
10
+ const { componentName: h, create: f, translate: y } = m("signature"), S = f({ props: { customClass: { type: String, default: "" }, lineWidth: { type: Number, default: 2 }, strokeStyle: { type: String, default: "#000" }, type: { type: String, default: "png" }, unSupportTpl: { type: String, default: "" } }, components: {}, emits: ["confirm", "clear"], setup(r2, { emit: l2 }) {
11
+ const o2 = e(null), u2 = e(null), i2 = t(() => ({ [h]: true, [`${r2.customClass}`]: r2.customClass })), c2 = n({ canvasHeight: 0, canvasWidth: 0, ctx: null, isSupportTouch: "ontouchstart" in window, events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"] }), v2 = () => {
12
+ let e2 = document.createElement("canvas");
13
+ return !(!e2.getContext || !e2.getContext("2d"));
14
+ }, p2 = (e2) => {
15
+ e2.preventDefault(), c2.ctx.beginPath(), c2.ctx.lineWidth = r2.lineWidth, c2.ctx.strokeStyle = r2.strokeStyle, o2.value.addEventListener(c2.events[1], d2, false), o2.value.addEventListener(c2.events[2], m2, false), o2.value.addEventListener(c2.events[3], g2, false);
16
+ }, d2 = (e2) => {
17
+ e2.preventDefault();
18
+ let t2 = c2.isSupportTouch ? e2.touches[0] : e2, n2 = o2.value.getBoundingClientRect(), a2 = t2.clientX - n2.left, s2 = t2.clientY - n2.top;
19
+ c2.ctx.lineTo(a2, s2), c2.ctx.stroke();
20
+ }, m2 = (e2) => {
21
+ e2.preventDefault(), o2.value.removeEventListener(c2.events[1], d2, false), o2.value.removeEventListener(c2.events[2], m2, false);
22
+ }, g2 = (e2) => {
23
+ e2.preventDefault(), o2.value.removeEventListener(c2.events[1], d2, false), o2.value.removeEventListener(c2.events[2], m2, false);
24
+ }, f2 = () => {
25
+ o2.value.addEventListener(c2.events[2], m2, false), c2.ctx.clearRect(0, 0, c2.canvasWidth, c2.canvasHeight), c2.ctx.closePath(), l2("clear");
26
+ }, S2 = (e2) => {
27
+ let t2;
28
+ switch (r2.type) {
29
+ case "png":
30
+ t2 = e2.toDataURL("image/png");
31
+ break;
32
+ case "jpg":
33
+ t2 = e2.toDataURL("image/jpeg", 0.8);
51
34
  }
52
- },
53
- components: {},
54
- emits: ["confirm", "clear"],
55
- setup(props, { emit }) {
56
- const canvas = ref(null);
57
- const wrap = ref(null);
58
- const classes = computed(() => {
59
- const prefixCls = componentName;
60
- return {
61
- [prefixCls]: true,
62
- [`${props.customClass}`]: props.customClass
63
- };
64
- });
65
- const state = reactive({
66
- canvasHeight: 0,
67
- canvasWidth: 0,
68
- ctx: null,
69
- isSupportTouch: "ontouchstart" in window,
70
- events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"]
71
- });
72
- const isCanvasSupported = () => {
73
- let elem = document.createElement("canvas");
74
- return !!(elem.getContext && elem.getContext("2d"));
75
- };
76
- const addEvent = () => {
77
- canvas.value.addEventListener(state.events[0], startEventHandler, false);
78
- };
79
- const startEventHandler = (event) => {
80
- event.preventDefault();
81
- state.ctx.beginPath();
82
- state.ctx.lineWidth = props.lineWidth;
83
- state.ctx.strokeStyle = props.strokeStyle;
84
- canvas.value.addEventListener(state.events[1], moveEventHandler, false);
85
- canvas.value.addEventListener(state.events[2], endEventHandler, false);
86
- canvas.value.addEventListener(state.events[3], leaveEventHandler, false);
87
- };
88
- const moveEventHandler = (event) => {
89
- event.preventDefault();
90
- let evt = state.isSupportTouch ? event.touches[0] : event;
91
- let coverPos = canvas.value.getBoundingClientRect();
92
- let mouseX = evt.clientX - coverPos.left;
93
- let mouseY = evt.clientY - coverPos.top;
94
- state.ctx.lineTo(mouseX, mouseY);
95
- state.ctx.stroke();
96
- };
97
- const endEventHandler = (event) => {
98
- event.preventDefault();
99
- canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
100
- canvas.value.removeEventListener(state.events[2], endEventHandler, false);
101
- };
102
- const leaveEventHandler = (event) => {
103
- event.preventDefault();
104
- canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
105
- canvas.value.removeEventListener(state.events[2], endEventHandler, false);
106
- };
107
- const clear = () => {
108
- canvas.value.addEventListener(state.events[2], endEventHandler, false);
109
- state.ctx.clearRect(0, 0, state.canvasWidth, state.canvasHeight);
110
- state.ctx.closePath();
111
- emit("clear");
112
- };
113
- const confirm = () => {
114
- onSave(canvas.value);
115
- };
116
- const onSave = (canvas2) => {
117
- let dataurl;
118
- switch (props.type) {
119
- case "png":
120
- dataurl = canvas2.toDataURL("image/png");
121
- break;
122
- case "jpg":
123
- dataurl = canvas2.toDataURL("image/jpeg", 0.8);
124
- break;
125
- }
126
- clear();
127
- emit("confirm", canvas2, dataurl);
128
- };
129
- onMounted(() => {
130
- if (isCanvasSupported()) {
131
- state.ctx = canvas.value.getContext("2d");
132
- state.canvasWidth = wrap.value.offsetWidth;
133
- state.canvasHeight = wrap.value.offsetHeight;
134
- addEvent();
135
- }
136
- });
137
- return __spreadProps(__spreadValues({}, toRefs(state)), { canvas, wrap, isCanvasSupported, confirm, clear, classes, translate });
138
- }
139
- });
140
- const _hoisted_1 = {
141
- class: "nut-signature-inner",
142
- ref: "wrap"
143
- };
144
- const _hoisted_2 = ["height", "width"];
145
- const _hoisted_3 = {
146
- key: 1,
147
- class: "nut-signature-unsopport"
148
- };
149
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
150
- const _component_nut_button = resolveComponent("nut-button");
151
- return openBlock(), createElementBlock("div", {
152
- class: normalizeClass(_ctx.classes)
153
- }, [
154
- createElementVNode("div", _hoisted_1, [
155
- (() => _ctx.isCanvasSupported()) ? (openBlock(), createElementBlock("canvas", {
156
- key: 0,
157
- ref: "canvas",
158
- height: _ctx.canvasHeight,
159
- width: _ctx.canvasWidth
160
- }, null, 8, _hoisted_2)) : (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.unSupportTpl || _ctx.translate("unSupportTpl")), 1))
161
- ], 512),
162
- createVNode(_component_nut_button, {
163
- class: "nut-signature-btn",
164
- type: "default",
165
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.clear())
166
- }, {
167
- default: withCtx(() => [
168
- createTextVNode(toDisplayString(_ctx.translate("reSign")), 1)
169
- ]),
170
- _: 1
171
- }),
172
- createVNode(_component_nut_button, {
173
- class: "nut-signature-btn",
174
- type: "primary",
175
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
176
- }, {
177
- default: withCtx(() => [
178
- createTextVNode(toDisplayString(_ctx.translate("confirm")), 1)
179
- ]),
180
- _: 1
181
- })
182
- ], 2);
183
- }
184
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
185
- export { index as default };
35
+ f2(), l2("confirm", e2, t2);
36
+ };
37
+ return a(() => {
38
+ v2() && (c2.ctx = o2.value.getContext("2d"), c2.canvasWidth = u2.value.offsetWidth, c2.canvasHeight = u2.value.offsetHeight, o2.value.addEventListener(c2.events[0], p2, false));
39
+ }), { ...s(c2), canvas: o2, wrap: u2, isCanvasSupported: v2, confirm: () => {
40
+ S2(o2.value);
41
+ }, clear: f2, classes: i2, translate: y };
42
+ } }), x = { class: "nut-signature-inner", ref: "wrap" }, C = ["height", "width"], L = { key: 1, class: "nut-signature-unsopport" };
43
+ var w = g(S, [["render", function(e2, t2, n2, a2, s2, m2) {
44
+ const g2 = r("nut-button");
45
+ return l(), o("div", { class: u(e2.classes) }, [i("div", x, [() => e2.isCanvasSupported() ? (l(), o("canvas", { key: 0, ref: "canvas", height: e2.canvasHeight, width: e2.canvasWidth }, null, 8, C)) : (l(), o("p", L, c(e2.unSupportTpl || e2.translate("unSupportTpl")), 1))], 512), v(g2, { class: "nut-signature-btn", type: "default", onClick: t2[0] || (t2[0] = (t3) => e2.clear()) }, { default: p(() => [d(c(e2.translate("reSign")), 1)]), _: 1 }), v(g2, { class: "nut-signature-btn", type: "primary", onClick: t2[1] || (t2[1] = (t3) => e2.confirm()) }, { default: p(() => [d(c(e2.translate("confirm")), 1)]), _: 1 })], 2);
46
+ }]]);
47
+ export { w as default };
@@ -1,141 +1,25 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { c as createComponent } from "./component.js";
7
- import { toRefs, computed, onMounted, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, createBlock, normalizeClass, normalizeStyle, Fragment, renderList } from "vue";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { c as e } from "./component.js";
7
+ import { toRefs as a, computed as t, onMounted as l, resolveComponent as s, openBlock as o, createElementBlock as r, renderSlot as n, createCommentVNode as i, createElementVNode as u, createBlock as p, normalizeClass as v, normalizeStyle as d, Fragment as h, renderList as c } from "vue";
8
+ import { _ as y } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const component = {
11
- props: {
12
- width: {
13
- type: String,
14
- default: "100px"
15
- },
16
- height: {
17
- type: String,
18
- default: "100px"
19
- },
20
- animated: {
21
- type: Boolean,
22
- default: false
23
- },
24
- avatar: {
25
- type: Boolean,
26
- default: false
27
- },
28
- avatarShape: {
29
- type: String,
30
- default: "round"
31
- },
32
- avatarSize: {
33
- type: String,
34
- default: "50px"
35
- },
36
- loading: {
37
- type: Boolean,
38
- default: true
39
- },
40
- round: {
41
- type: Boolean,
42
- default: false
43
- },
44
- row: {
45
- type: String,
46
- default: "1"
47
- },
48
- title: {
49
- type: Boolean,
50
- default: true
51
- }
52
- },
53
- setup(props) {
54
- const { avatarShape, round, avatarSize } = toRefs(props);
55
- const avatarClass = computed(() => {
56
- const prefixCls = "avatarClass";
57
- return {
58
- [prefixCls]: true,
59
- [`${prefixCls}--${avatarShape.value}`]: avatarShape.value
60
- };
61
- });
62
- const blockClass = computed(() => {
63
- const prefixCls = "blockClass";
64
- return {
65
- [prefixCls]: true,
66
- [`${prefixCls}--round`]: round.value
67
- };
68
- });
69
- const getStyle = () => {
70
- if (avatarSize.value) {
71
- return {
72
- width: avatarSize.value,
73
- height: avatarSize.value
74
- };
75
- }
76
- return {
77
- width: "50px",
78
- height: "50px"
79
- };
80
- };
81
- onMounted(() => {
82
- });
83
- return {
84
- avatarShape,
85
- avatarClass,
86
- blockClass,
87
- getStyle
88
- };
89
- }
90
- };
91
- const { create } = createComponent("skeleton");
92
- const _sfc_main = create(component);
93
- const _hoisted_1 = { key: 0 };
94
- const _hoisted_2 = {
95
- key: 1,
96
- class: "skeleton"
97
- };
98
- const _hoisted_3 = {
99
- key: 0,
100
- class: "skeleton-animation"
101
- };
102
- const _hoisted_4 = { class: "content" };
103
- const _hoisted_5 = { class: "content-line" };
104
- const _hoisted_6 = {
105
- key: 0,
106
- class: "title"
107
- };
108
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
109
- const _component_nut_avatar = resolveComponent("nut-avatar");
110
- return !_ctx.loading ? (openBlock(), createElementBlock("view", _hoisted_1, [
111
- renderSlot(_ctx.$slots, "default")
112
- ])) : (openBlock(), createElementBlock("view", _hoisted_2, [
113
- _ctx.animated ? (openBlock(), createElementBlock("view", _hoisted_3)) : createCommentVNode("", true),
114
- createElementVNode("view", _hoisted_4, [
115
- _ctx.avatar ? (openBlock(), createBlock(_component_nut_avatar, {
116
- key: 0,
117
- class: normalizeClass(_ctx.avatarClass),
118
- shape: _ctx.avatarShape,
119
- style: normalizeStyle(_ctx.getStyle()),
120
- "bg-color": "rgb(239, 239, 239)"
121
- }, null, 8, ["class", "shape", "style"])) : createCommentVNode("", true),
122
- Number(_ctx.row) == 1 ? (openBlock(), createElementBlock("view", {
123
- key: 1,
124
- class: normalizeClass(_ctx.blockClass),
125
- style: normalizeStyle({ width: _ctx.width, height: _ctx.height })
126
- }, null, 6)) : createCommentVNode("", true),
127
- createElementVNode("view", _hoisted_5, [
128
- _ctx.title ? (openBlock(), createElementBlock("view", _hoisted_6)) : createCommentVNode("", true),
129
- (openBlock(true), createElementBlock(Fragment, null, renderList(Number(_ctx.row), (item, index2) => {
130
- return openBlock(), createElementBlock("view", {
131
- key: index2,
132
- class: normalizeClass(_ctx.blockClass),
133
- style: normalizeStyle({ width: _ctx.width, height: _ctx.height })
134
- }, null, 6);
135
- }), 128))
136
- ])
137
- ])
138
- ]));
139
- }
140
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
141
- export { index as default };
10
+ const g = { props: { width: { type: String, default: "100px" }, height: { type: String, default: "100px" }, animated: { type: Boolean, default: false }, avatar: { type: Boolean, default: false }, avatarShape: { type: String, default: "round" }, avatarSize: { type: String, default: "50px" }, loading: { type: Boolean, default: true }, round: { type: Boolean, default: false }, row: { type: String, default: "1" }, title: { type: Boolean, default: true } }, setup(e2) {
11
+ const { avatarShape: s2, round: o2, avatarSize: r2 } = a(e2), n2 = t(() => {
12
+ const e3 = "avatarClass";
13
+ return { [e3]: true, [`avatarClass--${s2.value}`]: s2.value };
14
+ }), i2 = t(() => {
15
+ const e3 = "blockClass";
16
+ return { [e3]: true, "blockClass--round": o2.value };
17
+ });
18
+ return l(() => {
19
+ }), { avatarShape: s2, avatarClass: n2, blockClass: i2, getStyle: () => r2.value ? { width: r2.value, height: r2.value } : { width: "50px", height: "50px" } };
20
+ } }, { create: w } = e("skeleton"), f = w(g), k = { key: 0 }, m = { key: 1, class: "skeleton" }, S = { key: 0, class: "skeleton-animation" }, b = { class: "content" }, C = { class: "content-line" }, x = { key: 0, class: "title" };
21
+ var B = y(f, [["render", function(e2, a2, t2, l2, y2, g2) {
22
+ const w2 = s("nut-avatar");
23
+ return e2.loading ? (o(), r("view", m, [e2.animated ? (o(), r("view", S)) : i("", true), u("view", b, [e2.avatar ? (o(), p(w2, { key: 0, class: v(e2.avatarClass), shape: e2.avatarShape, style: d(e2.getStyle()), "bg-color": "rgb(239, 239, 239)" }, null, 8, ["class", "shape", "style"])) : i("", true), Number(e2.row) == 1 ? (o(), r("view", { key: 1, class: v(e2.blockClass), style: d({ width: e2.width, height: e2.height }) }, null, 6)) : i("", true), u("view", C, [e2.title ? (o(), r("view", x)) : i("", true), (o(true), r(h, null, c(Number(e2.row), (a3, t3) => (o(), r("view", { key: t3, class: v(e2.blockClass), style: d({ width: e2.width, height: e2.height }) }, null, 6))), 128))])])])) : (o(), r("view", k, [n(e2.$slots, "default")]));
24
+ }]]);
25
+ export { B as default };