@nutui/nutui 4.3.2 → 4.3.4

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 (227) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/nutui.es.js +2 -4
  3. package/dist/nutui.js +7000 -7518
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/{Interceptor-WYVtGbGC.js → Interceptor-DlY2h6Y7.js} +2 -2
  6. package/dist/packages/actionsheet/ActionSheet.js +3 -3
  7. package/dist/packages/address/Address.js +5 -5
  8. package/dist/packages/addresslist/AddressList.js +6 -6
  9. package/dist/packages/animate/Animate.js +1 -1
  10. package/dist/packages/audio/Audio.js +2 -2
  11. package/dist/packages/audiooperate/AudioOperate.js +3 -3
  12. package/dist/packages/avatar/Avatar.js +2 -2
  13. package/dist/packages/avatarcropper/AvatarCropper.js +5 -5
  14. package/dist/packages/avatargroup/AvatarGroup.js +3 -3
  15. package/dist/packages/backtop/Backtop.js +80 -90
  16. package/dist/packages/badge/Badge.js +2 -2
  17. package/dist/packages/barrage/Barrage.js +2 -2
  18. package/dist/packages/button/Button.js +1 -1
  19. package/dist/packages/calendar/Calendar.js +817 -6
  20. package/dist/packages/calendar/index.scss +0 -1
  21. package/dist/packages/calendarcard/CalendarCard.js +4 -4
  22. package/dist/packages/card/Card.js +4 -4
  23. package/dist/packages/cascader/Cascader.js +4 -4
  24. package/dist/packages/category/Category.js +4 -4
  25. package/dist/packages/categorypane/CategoryPane.js +5 -5
  26. package/dist/packages/cell/Cell.js +4 -4
  27. package/dist/packages/cellgroup/CellGroup.js +2 -2
  28. package/dist/packages/checkbox/Checkbox.js +4 -4
  29. package/dist/packages/checkboxgroup/CheckboxGroup.js +2 -2
  30. package/dist/packages/circleprogress/CircleProgress.js +91 -98
  31. package/dist/packages/col/Col.js +2 -2
  32. package/dist/packages/collapse/Collapse.js +2 -2
  33. package/dist/packages/collapseitem/CollapseItem.js +3 -3
  34. package/dist/packages/comment/Comment.js +6 -6
  35. package/dist/packages/{common-4inKawxR.js → common-Chr7cC9o.js} +2 -2
  36. package/dist/packages/{common-FZL3qC99.js → common-DRG0ue26.js} +1 -1
  37. package/dist/packages/configprovider/ConfigProvider.js +1 -1
  38. package/dist/packages/countdown/Countdown.js +4 -4
  39. package/dist/packages/countup/Countup.js +9 -9
  40. package/dist/packages/{date-djiVNSnJ.js → date-DHXcwF1m.js} +2 -2
  41. package/dist/packages/datepicker/DatePicker.js +3 -3
  42. package/dist/packages/dialog/Dialog.js +8 -8
  43. package/dist/packages/divider/Divider.js +1 -1
  44. package/dist/packages/drag/Drag.js +3 -3
  45. package/dist/packages/ecard/Ecard.js +5 -5
  46. package/dist/packages/elevator/Elevator.js +2 -2
  47. package/dist/packages/ellipsis/Ellipsis.js +4 -4
  48. package/dist/packages/empty/Empty.js +67 -52
  49. package/dist/packages/fixednav/FixedNav.js +3 -3
  50. package/dist/packages/form/Form.js +4 -4
  51. package/dist/packages/formitem/FormItem.js +4 -4
  52. package/dist/packages/grid/Grid.js +2 -2
  53. package/dist/packages/griditem/GridItem.js +5 -5
  54. package/dist/packages/image/Image.js +3 -3
  55. package/dist/packages/imagepreview/ImagePreview.js +8 -8
  56. package/dist/packages/{index-s3RgMhc7.js → index-CFigyH92.js} +1 -1
  57. package/dist/packages/{index--uVlasFu.js → index-Do4_KY74.js} +2 -2
  58. package/dist/packages/{index-BqB5dTeo.js → index-uHBD4dfS.js} +2 -2
  59. package/dist/packages/{index.vue_vue_type_script_lang-n0HbjvfF.js → index.vue_vue_type_script_lang-CTQUvlgN.js} +4 -4
  60. package/dist/packages/{index.vue_vue_type_script_lang-54PRh3YM.js → index.vue_vue_type_script_lang-CaSiRl9x.js} +2 -2
  61. package/dist/packages/indicator/Indicator.js +56 -50
  62. package/dist/packages/infiniteloading/InfiniteLoading.js +6 -6
  63. package/dist/packages/input/Input.js +10 -10
  64. package/dist/packages/inputnumber/InputNumber.js +85 -104
  65. package/dist/packages/invoice/Invoice.js +87 -138
  66. package/dist/packages/layout/Layout.js +2 -2
  67. package/dist/packages/list/List.js +3 -3
  68. package/dist/packages/locale/lang/en-US.js +1 -1
  69. package/dist/packages/locale/lang/id-ID.js +1 -1
  70. package/dist/packages/locale/lang/index.js +2 -2
  71. package/dist/packages/locale/lang/zh-CN.js +1 -1
  72. package/dist/packages/locale/lang/zh-TW.js +1 -1
  73. package/dist/packages/menu/Menu.js +5 -5
  74. package/dist/packages/menuitem/MenuItem.js +5 -5
  75. package/dist/packages/{mountComponent-uInXoTMp.js → mountComponent-DBQ88Fjz.js} +1 -1
  76. package/dist/packages/navbar/Navbar.js +103 -115
  77. package/dist/packages/noticebar/Noticebar.js +3 -3
  78. package/dist/packages/notify/Notify.js +3 -3
  79. package/dist/packages/numberkeyboard/NumberKeyboard.js +4 -4
  80. package/dist/packages/overlay/Overlay.js +3 -3
  81. package/dist/packages/pagination/Pagination.js +3 -3
  82. package/dist/packages/picker/Picker.js +7 -10
  83. package/dist/packages/popover/Popover.js +5 -5
  84. package/dist/packages/popup/Popup.js +2 -2
  85. package/dist/packages/price/Price.js +1 -1
  86. package/dist/packages/progress/Progress.js +96 -115
  87. package/dist/packages/pullrefresh/PullRefresh.js +7 -7
  88. package/dist/packages/radio/Radio.js +1 -1
  89. package/dist/packages/radiogroup/RadioGroup.js +1 -1
  90. package/dist/packages/range/Range.js +6 -6
  91. package/dist/packages/rate/Rate.js +102 -144
  92. package/dist/packages/row/Row.js +2 -2
  93. package/dist/packages/searchbar/Searchbar.js +5 -5
  94. package/dist/packages/shortpassword/ShortPassword.js +5 -5
  95. package/dist/packages/sidenavbar/SideNavbar.js +2 -2
  96. package/dist/packages/sidenavbaritem/SideNavbarItem.js +2 -2
  97. package/dist/packages/signature/Signature.js +3 -3
  98. package/dist/packages/skeleton/Skeleton.js +13 -13
  99. package/dist/packages/sku/Sku.js +6 -6
  100. package/dist/packages/space/Space.js +1 -1
  101. package/dist/packages/step/Step.js +3 -3
  102. package/dist/packages/steps/Steps.js +2 -2
  103. package/dist/packages/sticky/Sticky.js +4 -4
  104. package/dist/packages/subsidenavbar/SubSideNavbar.js +2 -2
  105. package/dist/packages/swipe/Swipe.js +98 -112
  106. package/dist/packages/swipegroup/SwipeGroup.js +42 -24
  107. package/dist/packages/swiper/Swiper.js +7 -7
  108. package/dist/packages/swiperitem/SwiperItem.js +3 -3
  109. package/dist/packages/switch/Switch.js +68 -86
  110. package/dist/packages/tabbar/Tabbar.js +78 -78
  111. package/dist/packages/tabbaritem/TabbarItem.js +89 -113
  112. package/dist/packages/table/Table.js +3 -3
  113. package/dist/packages/tabpane/TabPane.js +2 -2
  114. package/dist/packages/tabs/Tabs.js +9 -9
  115. package/dist/packages/tag/Tag.js +57 -66
  116. package/dist/packages/textarea/Textarea.js +113 -127
  117. package/dist/packages/timedetail/TimeDetail.js +2 -2
  118. package/dist/packages/timepannel/TimePannel.js +2 -2
  119. package/dist/packages/timeselect/TimeSelect.js +4 -4
  120. package/dist/packages/toast/Toast.js +6 -6
  121. package/dist/packages/tour/Tour.js +3 -3
  122. package/dist/packages/trendarrow/TrendArrow.js +51 -83
  123. package/dist/packages/uploader/Uploader.js +9 -9
  124. package/dist/packages/{useChildren-GU_NVfD8.js → useChildren-BZ4-J79J.js} +2 -2
  125. package/dist/packages/useParent-D6DiuxZZ.js +21 -0
  126. package/dist/packages/{util-4Jkyw4BJ.js → util-DnfK0Qan.js} +2 -2
  127. package/dist/packages/video/Video.js +16 -16
  128. package/dist/packages/watermark/Watermark.js +2 -2
  129. package/dist/smartips/web-types.json +2 -2
  130. package/dist/styles/base-jdb.css +1 -1
  131. package/dist/styles/base-jddkh.css +1 -1
  132. package/dist/styles/base-jdt.css +1 -1
  133. package/dist/styles/themes/default.scss +0 -1
  134. package/dist/styles/themes/jdb.scss +0 -1
  135. package/dist/styles/themes/jddkh.scss +0 -1
  136. package/dist/styles/themes/jdt.scss +0 -1
  137. package/dist/styles/variables-jdb.scss +0 -1
  138. package/dist/styles/variables-jddkh.scss +0 -1
  139. package/dist/styles/variables-jdt.scss +0 -1
  140. package/dist/styles/variables.scss +0 -1
  141. package/dist/types/__VUE/backtop/backtop.vue.d.ts +87 -0
  142. package/dist/types/__VUE/backtop/index.d.ts +5 -0
  143. package/dist/types/__VUE/calendaritem/index.vue.d.ts +2 -12
  144. package/dist/types/__VUE/circleprogress/circle-progress.vue.d.ts +88 -0
  145. package/dist/types/__VUE/circleprogress/index.d.ts +6 -0
  146. package/dist/types/__VUE/empty/empty.vue.d.ts +62 -0
  147. package/dist/types/__VUE/empty/index.d.ts +6 -0
  148. package/dist/types/__VUE/indicator/index.d.ts +6 -0
  149. package/dist/types/__VUE/indicator/indicator.vue.d.ts +65 -0
  150. package/dist/types/__VUE/inputnumber/index.d.ts +5 -0
  151. package/dist/types/__VUE/inputnumber/input-number.vue.d.ts +112 -0
  152. package/dist/types/__VUE/invoice/index.d.ts +6 -0
  153. package/dist/types/__VUE/invoice/invoice.vue.d.ts +59 -0
  154. package/dist/types/__VUE/invoice/types.d.ts +12 -0
  155. package/dist/types/__VUE/navbar/index.d.ts +5 -0
  156. package/dist/types/__VUE/navbar/navbar.vue.d.ts +125 -0
  157. package/dist/types/__VUE/progress/index.d.ts +6 -0
  158. package/dist/types/__VUE/progress/progress.vue.d.ts +91 -0
  159. package/dist/types/__VUE/rate/index.d.ts +5 -0
  160. package/dist/types/__VUE/rate/rate.vue.d.ts +208 -0
  161. package/dist/types/__VUE/swipe/index.d.ts +6 -0
  162. package/dist/types/__VUE/swipe/swipe.vue.d.ts +79 -0
  163. package/dist/types/__VUE/swipe/types.d.ts +1 -0
  164. package/dist/types/__VUE/swipegroup/index.d.ts +5 -0
  165. package/dist/types/__VUE/swipegroup/swipe-group.vue.d.ts +47 -0
  166. package/dist/types/__VUE/switch/index.d.ts +5 -0
  167. package/dist/types/__VUE/switch/switch.vue.d.ts +109 -0
  168. package/dist/types/__VUE/tabbar/index.d.ts +5 -0
  169. package/dist/types/__VUE/tabbar/tabbar.vue.d.ts +83 -0
  170. package/dist/types/__VUE/tabbaritem/index.d.ts +5 -0
  171. package/dist/types/__VUE/tabbaritem/tabbar-item.vue.d.ts +65 -0
  172. package/dist/types/__VUE/tabs/index.vue.d.ts +12 -12
  173. package/dist/types/__VUE/tag/index.d.ts +6 -0
  174. package/dist/types/__VUE/tag/tag.vue.d.ts +90 -0
  175. package/dist/types/__VUE/tag/types.d.ts +1 -1
  176. package/dist/types/__VUE/textarea/index.d.ts +5 -0
  177. package/dist/types/__VUE/textarea/textarea.vue.d.ts +104 -0
  178. package/dist/types/__VUE/trendarrow/index.d.ts +5 -0
  179. package/dist/types/__VUE/trendarrow/trend-arrow.vue.d.ts +96 -0
  180. package/dist/types/index.d.ts +36 -20
  181. package/dist/types/utils/throttle.d.ts +1 -1
  182. package/dist/types/utils/useRelation/useParent.d.ts +1 -0
  183. package/package.json +1 -1
  184. package/dist/packages/calendaritem/CalendarItem.js +0 -819
  185. package/dist/packages/calendaritem/index.css +0 -0
  186. package/dist/packages/calendaritem/index.mjs +0 -2
  187. package/dist/packages/calendaritem/index.scss +0 -0
  188. package/dist/packages/calendaritem/style/css.mjs +0 -2
  189. package/dist/packages/calendaritem/style/index.mjs +0 -2
  190. package/dist/packages/useParent-KIxqkovs.js +0 -16
  191. package/dist/types/__VUE/backtop/index.vue.d.ts +0 -98
  192. package/dist/types/__VUE/circleprogress/index.vue.d.ts +0 -95
  193. package/dist/types/__VUE/empty/index.vue.d.ts +0 -53
  194. package/dist/types/__VUE/indicator/index.vue.d.ts +0 -69
  195. package/dist/types/__VUE/inputnumber/index.vue.d.ts +0 -117
  196. package/dist/types/__VUE/invoice/index.vue.d.ts +0 -53
  197. package/dist/types/__VUE/navbar/index.vue.d.ts +0 -129
  198. package/dist/types/__VUE/progress/index.vue.d.ts +0 -120
  199. package/dist/types/__VUE/rate/index.vue.d.ts +0 -240
  200. package/dist/types/__VUE/swipe/index.vue.d.ts +0 -70
  201. package/dist/types/__VUE/swipegroup/index.vue.d.ts +0 -26
  202. package/dist/types/__VUE/switch/index.vue.d.ts +0 -118
  203. package/dist/types/__VUE/tabbar/index.vue.d.ts +0 -85
  204. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +0 -60
  205. package/dist/types/__VUE/tag/index.vue.d.ts +0 -94
  206. package/dist/types/__VUE/textarea/index.vue.d.ts +0 -127
  207. package/dist/types/__VUE/trendarrow/index.vue.d.ts +0 -102
  208. /package/dist/packages/{_plugin-vue_export-helper-yVxbj29m.js → _plugin-vue_export-helper-1tPrXgE0.js} +0 -0
  209. /package/dist/packages/{component-TCzwHGVq.js → component-DQf3CENX.js} +0 -0
  210. /package/dist/packages/{index-cp6Ms_Qe.js → index-B1qsj2XR.js} +0 -0
  211. /package/dist/packages/{index-xDfQLRen.js → index-BvmDLUYP.js} +0 -0
  212. /package/dist/packages/{index-084nl_oE.js → index-I8tfW3Kf.js} +0 -0
  213. /package/dist/packages/{index-Ii9XdkPy.js → index-aiGQ-EiA.js} +0 -0
  214. /package/dist/packages/locale/lang/{baseLang-7uiEiO-2.js → baseLang-Bnfy6fTl.js} +0 -0
  215. /package/dist/packages/{pxCheck-OnXlN1NC.js → pxCheck-DN6FYV6q.js} +0 -0
  216. /package/dist/packages/{raf-MQjoO-Ag.js → raf-c01wDYCo.js} +0 -0
  217. /package/dist/packages/{renderIcon--EgZu5_5.js → renderIcon-BfOvhG7i.js} +0 -0
  218. /package/dist/packages/{types-RCVUm7Nb.js → types-1HzUV14W.js} +0 -0
  219. /package/dist/packages/{types-zeKkNDAq.js → types-48N1bMrT.js} +0 -0
  220. /package/dist/packages/{types-Ww4ErYJT.js → types-BKDaJvHp.js} +0 -0
  221. /package/dist/packages/{types-odSRziQJ.js → types-BODurTjN.js} +0 -0
  222. /package/dist/packages/{types-qOrhXtA_.js → types-BWhKcf4T.js} +0 -0
  223. /package/dist/packages/{types-4IflWeQO.js → types-BomhFk3T.js} +0 -0
  224. /package/dist/packages/{types-j71K23JP.js → types-CkPfROfI.js} +0 -0
  225. /package/dist/packages/{types-9wCQwtH3.js → types-DUkJysbi.js} +0 -0
  226. /package/dist/packages/{types-Cq2YypZn.js → types-MuhxzCWc.js} +0 -0
  227. /package/dist/packages/{with-install-p59gYYU_.js → with-install-Ch3FF0uS.js} +0 -0
@@ -1,58 +1,55 @@
1
- import { toRef, ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
2
- import { c as createComponent } from "../component-TCzwHGVq.js";
3
- import { u as useLocale } from "../index-s3RgMhc7.js";
4
- import { u as useFormDisabled } from "../common-FZL3qC99.js";
5
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
6
- const { create } = createComponent("textarea");
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
+ import { defineComponent, toRef, ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, unref, toDisplayString, createCommentVNode } from "vue";
21
+ import { u as useLocale } from "../index-CFigyH92.js";
22
+ import { u as useFormDisabled } from "../common-DRG0ue26.js";
23
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
+ const _hoisted_1 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"];
25
+ const _hoisted_2 = {
26
+ key: 0,
27
+ class: "nut-textarea__limit"
28
+ };
7
29
  const cN = "NutTextarea";
8
- const _sfc_main = create({
30
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
31
+ name: cN
32
+ }), {
33
+ __name: "textarea",
9
34
  props: {
10
- modelValue: {
11
- type: String,
12
- default: ""
13
- },
14
- textAlign: {
15
- type: String,
16
- default: ""
17
- },
18
- limitShow: {
19
- type: Boolean,
20
- default: false
21
- },
22
- maxLength: {
23
- type: [String, Number],
24
- default: ""
25
- },
26
- rows: {
27
- type: [String, Number],
28
- default: "2"
29
- },
30
- placeholder: {
31
- type: String,
32
- default: ""
33
- },
34
- readonly: {
35
- type: Boolean,
36
- default: false
37
- },
38
- disabled: {
39
- type: Boolean,
40
- default: false
41
- },
42
- autosize: {
43
- type: [Boolean, Object],
44
- default: false
45
- },
46
- autofocus: {
47
- type: Boolean,
48
- default: false
49
- }
35
+ modelValue: { default: "" },
36
+ textAlign: {},
37
+ limitShow: { type: Boolean, default: false },
38
+ maxLength: { default: "" },
39
+ rows: { default: "2" },
40
+ placeholder: { default: "" },
41
+ readonly: { type: Boolean, default: false },
42
+ disabled: { type: Boolean, default: false },
43
+ autosize: { type: [Boolean, Object], default: false },
44
+ autofocus: { type: Boolean, default: false }
50
45
  },
51
46
  emits: ["update:modelValue", "change", "blur", "focus"],
52
- setup(props, { emit }) {
47
+ setup(__props, { emit: __emit }) {
48
+ const props = __props;
49
+ const emit = __emit;
53
50
  const disabled = useFormDisabled(toRef(props, "disabled"));
54
51
  const translate = useLocale(cN);
55
- const textareaRef = ref();
52
+ const textareaRef = ref(null);
56
53
  const classes = computed(() => {
57
54
  const prefixCls = "nut-textarea";
58
55
  return {
@@ -60,37 +57,43 @@ const _sfc_main = create({
60
57
  [`${prefixCls}--disabled`]: disabled.value
61
58
  };
62
59
  });
63
- onMounted(() => {
64
- if (props.modelValue) {
65
- emitChange(String(props.modelValue));
66
- }
67
- if (props.autosize) {
68
- nextTick(getContentHeight);
69
- }
70
- });
71
60
  const styles = computed(() => {
72
61
  return {
73
62
  textAlign: props.textAlign
74
- // resize: props.autosize ? 'vertical' : 'none'
75
63
  };
76
64
  });
65
+ const setHeight = (height) => {
66
+ const textarea = textareaRef.value;
67
+ if (textarea && textarea.style) {
68
+ textarea.style.height = typeof height === "number" ? `${height}px` : height;
69
+ }
70
+ };
77
71
  const getContentHeight = () => {
78
- let textarea = textareaRef.value;
79
- textarea.style.height = "auto";
80
- let height = textarea.scrollHeight;
81
- if (typeof props.autosize === "object") {
82
- const { maxHeight, minHeight } = props.autosize;
83
- if (maxHeight !== void 0) {
84
- height = Math.min(height, maxHeight);
72
+ setHeight("auto");
73
+ if (textareaRef.value) {
74
+ let height = textareaRef.value.scrollHeight;
75
+ if (typeof props.autosize === "object") {
76
+ const { maxHeight, minHeight } = props.autosize;
77
+ if (maxHeight !== void 0) {
78
+ height = Math.min(height, maxHeight);
79
+ }
80
+ if (minHeight !== void 0) {
81
+ height = Math.max(height, minHeight);
82
+ }
85
83
  }
86
- if (minHeight !== void 0) {
87
- height = Math.max(height, minHeight);
84
+ if (height) {
85
+ setHeight(height);
88
86
  }
89
87
  }
90
- if (height) {
91
- textarea.style.height = height + "px";
92
- }
93
88
  };
89
+ onMounted(() => {
90
+ if (props.modelValue) {
91
+ emitChange(String(props.modelValue));
92
+ }
93
+ if (props.autosize) {
94
+ nextTick(getContentHeight);
95
+ }
96
+ });
94
97
  watch(
95
98
  () => props.modelValue,
96
99
  () => {
@@ -107,8 +110,8 @@ const _sfc_main = create({
107
110
  emit("change", value, event);
108
111
  };
109
112
  const change = (event) => {
110
- if (!event.target.composing) {
111
- const input = event.target;
113
+ const input = event.target;
114
+ if (!input.composing) {
112
115
  let value = input.value;
113
116
  if (props.maxLength && value.length > Number(props.maxLength)) {
114
117
  value = value.slice(0, Number(props.maxLength));
@@ -117,76 +120,59 @@ const _sfc_main = create({
117
120
  }
118
121
  };
119
122
  const focus = (event) => {
120
- if (disabled.value)
121
- return;
122
- if (props.readonly)
123
+ if (disabled.value || props.readonly)
123
124
  return;
124
125
  emit("focus", event);
125
126
  };
126
127
  const blur = (event) => {
127
- if (disabled.value)
128
- return;
129
- if (props.readonly)
128
+ if (disabled.value || props.readonly)
130
129
  return;
131
130
  const input = event.target;
132
- let value = input.value;
131
+ const value = input.value;
133
132
  emitChange(value, event);
134
133
  emit("blur", { value, event });
135
134
  };
136
135
  const startComposing = ({ target }) => {
137
- target.composing = true;
136
+ const input = target;
137
+ input.composing = true;
138
138
  };
139
139
  const endComposing = ({ target }) => {
140
- if (target.composing) {
141
- target.composing = false;
142
- target.dispatchEvent(new Event("input"));
140
+ const input = target;
141
+ if (input.composing) {
142
+ input.composing = false;
143
+ input.dispatchEvent(new Event("input"));
143
144
  }
144
145
  };
145
- return {
146
- textareaRef,
147
- classes,
148
- styles,
149
- disabled,
150
- change,
151
- focus,
152
- blur,
153
- translate,
154
- startComposing,
155
- endComposing
146
+ return (_ctx, _cache) => {
147
+ return openBlock(), createElementBlock("view", {
148
+ class: normalizeClass(classes.value)
149
+ }, [
150
+ createElementVNode("textarea", {
151
+ ref_key: "textareaRef",
152
+ ref: textareaRef,
153
+ class: "nut-textarea__textarea",
154
+ style: normalizeStyle(styles.value),
155
+ rows: _ctx.rows,
156
+ disabled: unref(disabled),
157
+ readonly: _ctx.readonly,
158
+ value: _ctx.modelValue,
159
+ maxlength: _ctx.maxLength,
160
+ placeholder: _ctx.placeholder || unref(translate)("placeholder"),
161
+ autofocus: _ctx.autofocus,
162
+ onInput: change,
163
+ onBlur: blur,
164
+ onFocus: focus,
165
+ onChange: endComposing,
166
+ onCompositionend: endComposing,
167
+ onCompositionstart: startComposing
168
+ }, null, 44, _hoisted_1),
169
+ _ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true)
170
+ ], 2);
156
171
  };
157
172
  }
158
- });
159
- const _hoisted_1 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"];
160
- const _hoisted_2 = {
161
- key: 0,
162
- class: "nut-textarea__limit"
163
- };
164
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
165
- return openBlock(), createElementBlock("view", {
166
- class: normalizeClass(_ctx.classes)
167
- }, [
168
- createElementVNode("textarea", {
169
- ref: "textareaRef",
170
- class: "nut-textarea__textarea",
171
- style: normalizeStyle(_ctx.styles),
172
- rows: _ctx.rows,
173
- disabled: _ctx.disabled,
174
- readonly: _ctx.readonly,
175
- value: _ctx.modelValue,
176
- maxlength: _ctx.maxLength,
177
- placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
178
- autofocus: _ctx.autofocus,
179
- onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
180
- onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
181
- onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args)),
182
- onChange: _cache[3] || (_cache[3] = (...args) => _ctx.endComposing && _ctx.endComposing(...args)),
183
- onCompositionend: _cache[4] || (_cache[4] = (...args) => _ctx.endComposing && _ctx.endComposing(...args)),
184
- onCompositionstart: _cache[5] || (_cache[5] = (...args) => _ctx.startComposing && _ctx.startComposing(...args))
185
- }, null, 44, _hoisted_1),
186
- _ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true)
187
- ], 2);
188
- }
189
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
173
+ }));
174
+ withInstall(_sfc_main);
190
175
  export {
191
- index as default
176
+ _sfc_main as Textarea,
177
+ _sfc_main as default
192
178
  };
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { inject, reactive, computed, toRefs, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString } from "vue";
21
- import { c as createComponent } from "../component-TCzwHGVq.js";
22
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
21
+ import { c as createComponent } from "../component-DQf3CENX.js";
22
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
23
23
  const { create } = createComponent("time-detail");
24
24
  const _sfc_main = create({
25
25
  name: "timedetail",
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString } from "vue";
21
- import { c as createComponent } from "../component-TCzwHGVq.js";
22
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
21
+ import { c as createComponent } from "../component-DQf3CENX.js";
22
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
23
23
  const { componentName, create } = createComponent("time-pannel");
24
24
  const _sfc_main = create({
25
25
  name: "timepannel",
@@ -1,8 +1,8 @@
1
1
  import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, createElementBlock, toDisplayString, renderSlot } from "vue";
2
- import { c as createComponent } from "../component-TCzwHGVq.js";
3
- import { N as NutPopup } from "../index-BqB5dTeo.js";
4
- import { u as useLocale } from "../index-s3RgMhc7.js";
5
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
2
+ import { c as createComponent } from "../component-DQf3CENX.js";
3
+ import { N as NutPopup } from "../index-uHBD4dfS.js";
4
+ import { u as useLocale } from "../index-CFigyH92.js";
5
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
6
6
  const { create } = createComponent("time-select");
7
7
  const cN = "NutTimeSelect";
8
8
  const _sfc_main = create({
@@ -18,10 +18,10 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, onMounted, watch, computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, resolveDynamicComponent, createCommentVNode, toDisplayString, vShow, createVNode, render } from "vue";
21
- import { c as createComponent } from "../component-TCzwHGVq.js";
22
- import { r as renderIcon } from "../renderIcon--EgZu5_5.js";
23
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
24
- import { C as CreateComponent } from "../mountComponent-uInXoTMp.js";
21
+ import { c as createComponent } from "../component-DQf3CENX.js";
22
+ import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
23
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
24
+ import { C as CreateComponent } from "../mountComponent-DBQ88Fjz.js";
25
25
  import { Success, Failure, Tips, Loading } from "@nutui/icons-vue";
26
26
  const { create } = createComponent("toast");
27
27
  const _sfc_main = create({
@@ -217,7 +217,7 @@ const defaultOptions = {
217
217
  msg: "",
218
218
  id: "",
219
219
  duration: 2e3,
220
- //显示时间(毫秒)
220
+ // 显示时间(毫秒)
221
221
  center: true,
222
222
  // 未实现
223
223
  type: "text",
@@ -236,7 +236,7 @@ const defaultOptions = {
236
236
  // 未实现
237
237
  unmount: null,
238
238
  cover: false,
239
- //透明遮罩层 // 未实现
239
+ // 透明遮罩层 // 未实现
240
240
  coverColor: "",
241
241
  // 未实现
242
242
  closeOnClickOverlay: false
@@ -18,11 +18,11 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, ref, computed, onMounted, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vShow, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode, withCtx, renderSlot, toDisplayString } from "vue";
21
- import { c as createComponent } from "../component-TCzwHGVq.js";
22
- import { u as useRect } from "../index-cp6Ms_Qe.js";
21
+ import { c as createComponent } from "../component-DQf3CENX.js";
22
+ import { u as useRect } from "../index-B1qsj2XR.js";
23
23
  import { Close } from "@nutui/icons-vue";
24
24
  import NutPopover from "../popover/Popover.js";
25
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
25
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
26
26
  const { create } = createComponent("tour");
27
27
  const _sfc_main = create({
28
28
  components: {
@@ -17,103 +17,71 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode } from "vue";
21
- import { m as myFixed } from "../util-4Jkyw4BJ.js";
22
- import { c as createComponent } from "../component-TCzwHGVq.js";
20
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode, unref } from "vue";
21
+ import { m as myFixed } from "../util-DnfK0Qan.js";
23
22
  import { TriangleUp, TriangleDown } from "@nutui/icons-vue";
24
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
25
- const { create } = createComponent("trend-arrow");
26
- const _sfc_main = create({
27
- components: { TriangleUp, TriangleDown },
23
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
+ const _hoisted_1 = { class: "nut-trend-arrow" };
25
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
26
+ name: "NutTrendArrow"
27
+ }), {
28
+ __name: "trend-arrow",
28
29
  props: {
29
- rate: {
30
- type: Number,
31
- default: 0
32
- },
33
- digits: {
34
- type: Number,
35
- default: 2
36
- },
37
- showSign: {
38
- type: Boolean,
39
- default: false
40
- },
41
- showZero: {
42
- type: Boolean,
43
- default: false
44
- },
45
- arrowLeft: {
46
- type: Boolean,
47
- default: false
48
- },
49
- syncTextColor: {
50
- type: Boolean,
51
- default: true
52
- },
53
- textColor: {
54
- type: String,
55
- default: "#333"
56
- },
57
- riseColor: {
58
- type: String,
59
- default: "#fa2c19"
60
- },
61
- dropColor: {
62
- type: String,
63
- default: "#64b578"
64
- }
30
+ rate: { default: 0 },
31
+ digits: { default: 2 },
32
+ showSign: { type: Boolean, default: false },
33
+ showZero: { type: Boolean, default: false },
34
+ arrowLeft: { type: Boolean, default: false },
35
+ syncTextColor: { type: Boolean, default: true },
36
+ textColor: { default: "#333" },
37
+ riseColor: { default: "#fa2c19" },
38
+ dropColor: { default: "#64b578" }
65
39
  },
66
- setup(props) {
67
- const state = reactive({
68
- rateTrend: props.rate > 0 ? true : false
40
+ setup(__props) {
41
+ const props = __props;
42
+ const isPositive = computed(() => {
43
+ return props.rate > 0 ? true : false;
69
44
  });
70
45
  const calcRate = computed(() => {
71
- const { rate, digits, showSign, showZero } = props;
72
- state.rateTrend = rate > 0 ? true : false;
73
- const absRate = Math.abs(rate);
74
- if (!showZero && rate === 0) {
46
+ const absRate = Math.abs(props.rate);
47
+ if (!props.showZero && props.rate === 0) {
75
48
  return "--";
76
49
  }
77
- let resultRate = `${showSign && rate !== 0 ? state.rateTrend ? "+" : "-" : ""}${myFixed(
50
+ let resultRate = `${props.showSign && props.rate !== 0 ? isPositive.value ? "+" : "-" : ""}${myFixed(
78
51
  Number(absRate),
79
- digits
52
+ props.digits
80
53
  )}%`;
81
54
  return resultRate;
82
55
  });
83
56
  const calcStyle = computed(() => {
84
- const { dropColor, riseColor, syncTextColor, textColor, rate } = props;
85
- let style = {
86
- color: rate === 0 ? textColor : syncTextColor ? state.rateTrend ? riseColor : dropColor : textColor
57
+ return {
58
+ color: props.rate === 0 ? props.textColor : props.syncTextColor ? isPositive.value ? props.riseColor : props.dropColor : props.textColor
87
59
  };
88
- return style;
89
60
  });
90
- return __spreadProps(__spreadValues({}, toRefs(state)), { calcRate, calcStyle });
61
+ return (_ctx, _cache) => {
62
+ return openBlock(), createElementBlock("view", _hoisted_1, [
63
+ !_ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
64
+ key: 0,
65
+ class: "nut-trend-arrow-icon-before nut-trend-arrow-rate",
66
+ style: normalizeStyle(calcStyle.value)
67
+ }, toDisplayString(calcRate.value), 5)) : createCommentVNode("", true),
68
+ Number(_ctx.rate) !== 0 && isPositive.value ? renderSlot(_ctx.$slots, "up-icon", { key: 1 }, () => [
69
+ createVNode(unref(TriangleUp), { color: _ctx.riseColor }, null, 8, ["color"])
70
+ ]) : createCommentVNode("", true),
71
+ Number(_ctx.rate) !== 0 && !isPositive.value ? renderSlot(_ctx.$slots, "down-icon", { key: 2 }, () => [
72
+ createVNode(unref(TriangleDown), { color: _ctx.dropColor }, null, 8, ["color"])
73
+ ]) : createCommentVNode("", true),
74
+ _ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
75
+ key: 3,
76
+ class: "nut-trend-arrow-icon-after nut-trend-arrow-rate",
77
+ style: normalizeStyle(calcStyle.value)
78
+ }, toDisplayString(calcRate.value), 5)) : createCommentVNode("", true)
79
+ ]);
80
+ };
91
81
  }
92
- });
93
- const _hoisted_1 = { class: "nut-trend-arrow" };
94
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
95
- const _component_TriangleUp = resolveComponent("TriangleUp");
96
- const _component_TriangleDown = resolveComponent("TriangleDown");
97
- return openBlock(), createElementBlock("view", _hoisted_1, [
98
- !_ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
99
- key: 0,
100
- class: "nut-trend-arrow-icon-before nut-trend-arrow-rate",
101
- style: normalizeStyle(_ctx.calcStyle)
102
- }, toDisplayString(_ctx.calcRate), 5)) : createCommentVNode("", true),
103
- Number(_ctx.rate) !== 0 && _ctx.rateTrend ? renderSlot(_ctx.$slots, "up-icon", { key: 1 }, () => [
104
- createVNode(_component_TriangleUp, { color: _ctx.riseColor }, null, 8, ["color"])
105
- ]) : createCommentVNode("", true),
106
- Number(_ctx.rate) !== 0 && !_ctx.rateTrend ? renderSlot(_ctx.$slots, "down-icon", { key: 2 }, () => [
107
- createVNode(_component_TriangleDown, { color: _ctx.dropColor }, null, 8, ["color"])
108
- ]) : createCommentVNode("", true),
109
- _ctx.arrowLeft ? (openBlock(), createElementBlock("span", {
110
- key: 3,
111
- class: "nut-trend-arrow-icon-after nut-trend-arrow-rate",
112
- style: normalizeStyle(_ctx.calcStyle)
113
- }, toDisplayString(_ctx.calcRate), 5)) : createCommentVNode("", true)
114
- ]);
115
- }
116
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
82
+ }));
83
+ withInstall(_sfc_main);
117
84
  export {
118
- index as default
85
+ _sfc_main as TrendArrow,
86
+ _sfc_main as default
119
87
  };
@@ -4,14 +4,14 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { toRef, ref, watch, h, reactive, resolveComponent, openBlock, createElementBlock, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createVNode } from "vue";
8
- import { c as createComponent } from "../component-TCzwHGVq.js";
9
- import { f as funInterceptor } from "../Interceptor-WYVtGbGC.js";
10
- import NutProgress from "../progress/Progress.js";
7
+ import { toRef, ref, watch, h, reactive, resolveComponent, openBlock, createElementBlock, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createVNode, withModifiers } from "vue";
8
+ import { c as createComponent } from "../component-DQf3CENX.js";
9
+ import { f as funInterceptor } from "../Interceptor-DlY2h6Y7.js";
10
+ import { Progress as _sfc_main$1 } from "../progress/Progress.js";
11
11
  import { Photograph, Failure, Loading, Del, Link } from "@nutui/icons-vue";
12
- import { u as useLocale } from "../index-s3RgMhc7.js";
13
- import { u as useFormDisabled } from "../common-FZL3qC99.js";
14
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
12
+ import { u as useLocale } from "../index-CFigyH92.js";
13
+ import { u as useFormDisabled } from "../common-DRG0ue26.js";
14
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
15
15
  class UploadOptions {
16
16
  constructor() {
17
17
  __publicField(this, "url", "");
@@ -94,7 +94,7 @@ const { create } = createComponent("uploader");
94
94
  const cN = "NutUploader";
95
95
  const _sfc_main = create({
96
96
  components: {
97
- NutProgress,
97
+ NutProgress: _sfc_main$1,
98
98
  Photograph,
99
99
  Failure,
100
100
  Loading,
@@ -452,7 +452,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
452
452
  key: 0,
453
453
  color: "#808080",
454
454
  class: "nut-uploader__preview-img__file__del",
455
- onClick: ($event) => _ctx.onDelete(item, index2)
455
+ onClick: withModifiers(($event) => _ctx.onDelete(item, index2), ["stop"])
456
456
  }, null, 8, ["onClick"])) : createCommentVNode("", true)
457
457
  ], 10, _hoisted_13),
458
458
  item.status == "uploading" ? (openBlock(), createBlock(_component_nut_progress, {
@@ -27,11 +27,11 @@ const useChildren = (key) => {
27
27
  };
28
28
  const unlink = (child) => {
29
29
  if (child.proxy) {
30
- let internalIndex = internalChildren.indexOf(child);
30
+ const internalIndex = internalChildren.indexOf(child);
31
31
  if (internalIndex > -1) {
32
32
  internalChildren.splice(internalIndex, 1);
33
33
  }
34
- let publicIndex = publicChildren.indexOf(child.proxy);
34
+ const publicIndex = publicChildren.indexOf(child.proxy);
35
35
  if (internalIndex > -1) {
36
36
  publicChildren.splice(publicIndex, 1);
37
37
  }
@@ -0,0 +1,21 @@
1
+ import { inject, getCurrentInstance, onUnmounted, computed } from "vue";
2
+ const useParent = (key) => {
3
+ const parent = inject(key, null);
4
+ if (parent) {
5
+ const instance = getCurrentInstance();
6
+ const { link, unlink, internalChildren } = parent;
7
+ link(instance);
8
+ onUnmounted(() => {
9
+ unlink(instance);
10
+ });
11
+ const index = computed(() => internalChildren.indexOf(instance));
12
+ return { parent, index };
13
+ }
14
+ return {
15
+ parent,
16
+ index: computed(() => -1)
17
+ };
18
+ };
19
+ export {
20
+ useParent as u
21
+ };
@@ -52,8 +52,8 @@ const getPropByPath = (obj, keyPath) => {
52
52
  }
53
53
  };
54
54
  const floatData = (format, dataOp, mapOps) => {
55
- let mergeFormat = Object.assign({}, format);
56
- let mergeMapOps = Object.assign({}, mapOps);
55
+ const mergeFormat = Object.assign({}, format);
56
+ const mergeMapOps = Object.assign({}, mapOps);
57
57
  if (Object.keys(dataOp).length > 0) {
58
58
  Object.keys(mergeFormat).forEach((keys) => {
59
59
  if (Object.prototype.hasOwnProperty.call(mergeMapOps, keys)) {