@nutui/nutui 4.1.0-beta.4 → 4.1.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +5351 -5327
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +2 -2
  5. package/dist/packages/_es/Address.js +4 -3
  6. package/dist/packages/_es/AddressList.js +1 -1
  7. package/dist/packages/_es/Animate.js +1 -1
  8. package/dist/packages/_es/Audio.js +2 -2
  9. package/dist/packages/_es/AudioOperate.js +3 -3
  10. package/dist/packages/_es/Avatar.js +17 -79
  11. package/dist/packages/_es/AvatarGroup.js +92 -21
  12. package/dist/packages/_es/Backtop.js +1 -1
  13. package/dist/packages/_es/Badge.js +1 -1
  14. package/dist/packages/_es/Barrage.js +1 -1
  15. package/dist/packages/_es/Button.js +2 -2
  16. package/dist/packages/_es/Calendar.js +22 -24
  17. package/dist/packages/_es/CalendarItem.js +2 -2
  18. package/dist/packages/_es/Card.js +2 -2
  19. package/dist/packages/_es/Cascader.js +4 -3
  20. package/dist/packages/_es/Category.js +3 -3
  21. package/dist/packages/_es/CategoryPane.js +2 -2
  22. package/dist/packages/_es/Cell.js +1 -1
  23. package/dist/packages/_es/CellGroup.js +1 -1
  24. package/dist/packages/_es/Checkbox.js +2 -2
  25. package/dist/packages/_es/CheckboxGroup.js +1 -1
  26. package/dist/packages/_es/CircleProgress.js +1 -1
  27. package/dist/packages/_es/Col.js +1 -1
  28. package/dist/packages/_es/Collapse.js +1 -1
  29. package/dist/packages/_es/CollapseItem.js +1 -1
  30. package/dist/packages/_es/Comment.js +4 -4
  31. package/dist/packages/_es/ConfigProvider.js +4 -4
  32. package/dist/packages/_es/Countdown.js +4 -4
  33. package/dist/packages/_es/Countup.js +9 -12
  34. package/dist/packages/_es/DatePicker.js +3 -3
  35. package/dist/packages/_es/Dialog.js +4 -4
  36. package/dist/packages/_es/Divider.js +1 -1
  37. package/dist/packages/_es/Drag.js +1 -1
  38. package/dist/packages/_es/Ecard.js +1 -1
  39. package/dist/packages/_es/Elevator.js +1 -1
  40. package/dist/packages/_es/Ellipsis.js +1 -1
  41. package/dist/packages/_es/Empty.js +2 -2
  42. package/dist/packages/_es/FixedNav.js +1 -1
  43. package/dist/packages/_es/Form.js +26 -21
  44. package/dist/packages/_es/FormItem.js +3 -3
  45. package/dist/packages/_es/Grid.js +2 -2
  46. package/dist/packages/_es/GridItem.js +2 -2
  47. package/dist/packages/_es/Image.js +2 -2
  48. package/dist/packages/_es/ImagePreview.js +4 -4
  49. package/dist/packages/_es/Indicator.js +1 -1
  50. package/dist/packages/_es/InfiniteLoading.js +2 -2
  51. package/dist/packages/_es/Input.js +2 -4
  52. package/dist/packages/_es/InputNumber.js +23 -2
  53. package/dist/packages/_es/{Interceptor-5415601e.js → Interceptor-c05a39f2.js} +1 -1
  54. package/dist/packages/_es/Invoice.js +3 -3
  55. package/dist/packages/_es/Layout.js +1 -1
  56. package/dist/packages/_es/List.js +1 -1
  57. package/dist/packages/_es/Menu.js +2 -2
  58. package/dist/packages/_es/MenuItem.js +2 -2
  59. package/dist/packages/_es/Navbar.js +1 -1
  60. package/dist/packages/_es/Noticebar.js +5 -5
  61. package/dist/packages/_es/Notify.js +2 -2
  62. package/dist/packages/_es/NumberKeyboard.js +2 -2
  63. package/dist/packages/_es/Overlay.js +3 -1
  64. package/dist/packages/_es/Pagination.js +1 -1
  65. package/dist/packages/_es/Picker.js +7 -7
  66. package/dist/packages/_es/Popover.js +7 -7
  67. package/dist/packages/_es/Popup.js +2 -2
  68. package/dist/packages/_es/Price.js +1 -1
  69. package/dist/packages/_es/Progress.js +1 -1
  70. package/dist/packages/_es/PullRefresh.js +3 -2
  71. package/dist/packages/_es/Radio.js +2 -2
  72. package/dist/packages/_es/RadioGroup.js +2 -2
  73. package/dist/packages/_es/Range.js +1 -1
  74. package/dist/packages/_es/Rate.js +4 -4
  75. package/dist/packages/_es/Row.js +1 -1
  76. package/dist/packages/_es/Searchbar.js +1 -1
  77. package/dist/packages/_es/ShortPassword.js +2 -2
  78. package/dist/packages/_es/SideNavbar.js +1 -1
  79. package/dist/packages/_es/SideNavbarItem.js +1 -1
  80. package/dist/packages/_es/Signature.js +1 -1
  81. package/dist/packages/_es/Skeleton.js +1 -1
  82. package/dist/packages/_es/Sku.js +8 -8
  83. package/dist/packages/_es/Step.js +1 -1
  84. package/dist/packages/_es/Steps.js +1 -1
  85. package/dist/packages/_es/Sticky.js +125 -5
  86. package/dist/packages/_es/SubSideNavbar.js +1 -1
  87. package/dist/packages/_es/Swipe.js +1 -1
  88. package/dist/packages/_es/Swiper.js +2 -2
  89. package/dist/packages/_es/SwiperItem.js +2 -2
  90. package/dist/packages/_es/Switch.js +1 -1
  91. package/dist/packages/_es/TabPane.js +2 -2
  92. package/dist/packages/_es/Tabbar.js +2 -2
  93. package/dist/packages/_es/TabbarItem.js +2 -2
  94. package/dist/packages/_es/Table.js +12 -6
  95. package/dist/packages/_es/Tabs.js +5 -4
  96. package/dist/packages/_es/Tag.js +1 -1
  97. package/dist/packages/_es/Textarea.js +1 -1
  98. package/dist/packages/_es/TimeDetail.js +1 -1
  99. package/dist/packages/_es/TimePannel.js +1 -1
  100. package/dist/packages/_es/TimeSelect.js +2 -2
  101. package/dist/packages/_es/Toast.js +2 -2
  102. package/dist/packages/_es/Tour.js +2 -2
  103. package/dist/packages/_es/TrendArrow.js +1 -1
  104. package/dist/packages/_es/Uploader.js +5 -4
  105. package/dist/packages/_es/Video.js +1 -1
  106. package/dist/packages/_es/Watermark.js +2 -2
  107. package/dist/packages/_es/{common-21e9de3d.js → common-8775d905.js} +1 -1
  108. package/dist/packages/_es/{component-8f0be7eb.js → component-0fbad28e.js} +3 -3
  109. package/dist/packages/_es/{index-c9b21ed1.js → index-3a5098e4.js} +15 -12
  110. package/dist/packages/_es/{index-dc2ebe90.js → index-5ffbc437.js} +2 -2
  111. package/dist/packages/_es/{index-43c34ac6.js → index-97b44e6c.js} +1 -0
  112. package/dist/packages/_es/{index.vue_vue_type_script_lang-dba4283d.js → index.vue_vue_type_script_lang-2852286e.js} +1 -1
  113. package/dist/packages/_es/{index.vue_vue_type_script_lang-7b265520.js → index.vue_vue_type_script_lang-cdf21a24.js} +2 -2
  114. package/dist/packages/_es/{mountComponent-f2c53efb.js → mountComponent-a895e3f1.js} +1 -1
  115. package/dist/packages/avatargroup/index.scss +0 -3
  116. package/dist/packages/sticky/index.scss +0 -10
  117. package/dist/smartips/web-types.json +4 -10
  118. package/dist/style.css +1 -1
  119. package/dist/styles/themes/default.scss +54 -156
  120. package/dist/styles/themes/jdb.scss +54 -156
  121. package/dist/styles/themes/jddkh.scss +54 -156
  122. package/dist/styles/themes/jdt.scss +54 -156
  123. package/dist/types/__VUE/avatar/index.vue.d.ts +11 -27
  124. package/dist/types/__VUE/avatar/types.d.ts +3 -0
  125. package/dist/types/__VUE/avatargroup/index.vue.d.ts +18 -15
  126. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  127. package/dist/types/__VUE/calendaritem/index.vue.d.ts +7 -8
  128. package/dist/types/__VUE/calendaritem/type.d.ts +0 -8
  129. package/dist/types/__VUE/circleprogress/index.vue.d.ts +3 -3
  130. package/dist/types/__VUE/configprovider/index.vue.d.ts +3 -4
  131. package/dist/types/__VUE/form/common.d.ts +2 -2
  132. package/dist/types/__VUE/form/index.vue.d.ts +4 -4
  133. package/dist/types/__VUE/formitem/types.d.ts +2 -2
  134. package/dist/types/__VUE/picker/common.d.ts +4 -4
  135. package/dist/types/__VUE/picker/index.vue.d.ts +9 -10
  136. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +1 -1
  137. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  138. package/dist/types/__VUE/sticky/index.vue.d.ts +11 -8
  139. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  140. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  141. package/dist/types/__VUE/table/common.d.ts +21 -6
  142. package/dist/types/__VUE/table/renderColumn.d.ts +20 -6
  143. package/dist/types/__VUE/tabs/hooks.d.ts +2 -2
  144. package/dist/types/__VUE/tabs/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
  146. package/dist/types/index.d.ts +1 -1
  147. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  148. package/dist/types/utils/useTouch/index.d.ts +2 -2
  149. package/package.json +1 -1
  150. package/dist/packages/_es/index.vue_vue_type_script_lang-89366761.js +0 -151
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-8f0be7eb.js";
1
+ import { c as createComponent } from "./component-0fbad28e.js";
2
2
  import "vue";
3
3
  import "../locale/lang";
4
4
  const { create } = createComponent("layout");
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import { u as useRect } from "./index-29892cda.js";
23
23
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
24
24
  import "../locale/lang";
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, onMounted, onUnmounted, reactive, provide, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString, renderSlot, createBlock } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { u as useRect } from "./index-29892cda.js";
4
4
  import { ArrowUp2, ArrowDown2 } from "@nutui/icons-vue";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -41,7 +41,7 @@ const _sfc_main = create({
41
41
  },
42
42
  titleClass: [String]
43
43
  },
44
- setup(props, { emit, slots }) {
44
+ setup(props) {
45
45
  const barRef = ref();
46
46
  const offset = ref(0);
47
47
  const isScrollFixed = ref(false);
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, computed, inject, getCurrentInstance, onUnmounted, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeStyle, createElementVNode, vShow, createVNode, mergeProps, withCtx, Fragment, renderList, normalizeClass, renderSlot, createCommentVNode, toDisplayString } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
22
- import { P as Popup } from "./index-dc2ebe90.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
+ import { P as Popup } from "./index-5ffbc437.js";
23
23
  import { Check } from "@nutui/icons-vue";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
25
25
  import "../locale/lang";
@@ -1,5 +1,5 @@
1
1
  import { toRefs, ref, computed, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createVNode, createCommentVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { Left } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, createElementVNode, renderSlot, createBlock, createCommentVNode, createTextVNode, toDisplayString, withModifiers, vShow, Fragment, renderList } from "vue";
21
21
  import { Notice, CircleClose } from "@nutui/icons-vue";
22
- import { c as createComponent } from "./component-8f0be7eb.js";
22
+ import { c as createComponent } from "./component-0fbad28e.js";
23
23
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
25
25
  import "../locale/lang";
@@ -166,7 +166,7 @@ const _sfc_main = create({
166
166
  });
167
167
  watch(
168
168
  () => props.text,
169
- (value) => {
169
+ () => {
170
170
  initScrollWrap();
171
171
  }
172
172
  );
@@ -176,7 +176,7 @@ const _sfc_main = create({
176
176
  state.scrollList = [].concat(value);
177
177
  }
178
178
  );
179
- const initScrollWrap = (value) => {
179
+ const initScrollWrap = () => {
180
180
  if (state.showNoticebar == false) {
181
181
  return;
182
182
  }
@@ -265,7 +265,7 @@ const _sfc_main = create({
265
265
  props.complexAm ? startRoll() : startRollEasy();
266
266
  }, props.standTime);
267
267
  } else {
268
- initScrollWrap(props.text);
268
+ initScrollWrap();
269
269
  }
270
270
  });
271
271
  const updateSlotChild = () => {
@@ -274,7 +274,7 @@ const _sfc_main = create({
274
274
  };
275
275
  const watchSlots = () => {
276
276
  setTimeout(() => {
277
- var observer = new MutationObserver((slots2) => {
277
+ var observer = new MutationObserver(() => {
278
278
  state.showNotica = false;
279
279
  setTimeout(() => {
280
280
  state.showNotica = true;
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, createVNode, render, onMounted, h } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
22
- import { P as Popup } from "./index-dc2ebe90.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
+ import { P as Popup } from "./index-5ffbc437.js";
23
23
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
24
24
  import "../locale/lang";
25
25
  import "./Overlay.js";
@@ -1,6 +1,6 @@
1
1
  import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
3
- import { P as Popup } from "./index-dc2ebe90.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
+ import { P as Popup } from "./index-5ffbc437.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
6
6
  import "./Overlay.js";
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  import { computed, watchEffect, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
18
- import { b as body, c as createComponent } from "./component-8f0be7eb.js";
18
+ import { b as body, c as createComponent } from "./component-0fbad28e.js";
19
19
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
20
20
  import "../locale/lang";
21
21
  let count = 0;
@@ -27,6 +27,7 @@ const useLockScroll = (isLock) => {
27
27
  !count && body.classList.add(CLSNAME);
28
28
  count++;
29
29
  } catch (error) {
30
+ console.warn("[NutUI] <useLockScroll>", error);
30
31
  }
31
32
  }
32
33
  };
@@ -36,6 +37,7 @@ const useLockScroll = (isLock) => {
36
37
  count--;
37
38
  !count && body.classList.remove(CLSNAME);
38
39
  } catch (error) {
40
+ console.warn("[NutUI] <unlock>", error);
39
41
  }
40
42
  }
41
43
  };
@@ -1,5 +1,5 @@
1
1
  import { toRefs, computed, watchEffect, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { create, translate } = createComponent("pagination");
@@ -18,12 +18,12 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, ref, computed, watch, toRefs, onMounted, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, resolveComponent, renderSlot, createVNode } from "vue";
21
- import { c as createComponent, d as preventDefault, e as clamp } from "./component-8f0be7eb.js";
21
+ import { c as createComponent, d as preventDefault, e as clamp } from "./component-0fbad28e.js";
22
22
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
23
23
  import { u as useTouch } from "./index-7a7385e4.js";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
25
25
  import "../locale/lang";
26
- const { componentName: componentName$1 } = createComponent("picker");
26
+ const { componentName } = createComponent("picker");
27
27
  const usePicker = (props, emit) => {
28
28
  const state = reactive({
29
29
  formattedColumns: props.columns
@@ -36,7 +36,7 @@ const usePicker = (props, emit) => {
36
36
  }
37
37
  };
38
38
  const classes = computed(() => {
39
- const prefixCls = componentName$1;
39
+ const prefixCls = componentName;
40
40
  return {
41
41
  [prefixCls]: true
42
42
  };
@@ -110,7 +110,7 @@ const usePicker = (props, emit) => {
110
110
  defaultValues.value = defaultValues.value.slice(0, index + 1);
111
111
  }
112
112
  } else {
113
- defaultValues.value[columnIndex] = option.hasOwnProperty("value") ? option.value : "";
113
+ defaultValues.value[columnIndex] = Object.prototype.hasOwnProperty.call(option, "value") ? option.value : "";
114
114
  }
115
115
  emit("change", {
116
116
  columnIndex,
@@ -359,7 +359,7 @@ const _sfc_main$1 = create$1({
359
359
  };
360
360
  watch(
361
361
  () => props.column,
362
- (val) => {
362
+ () => {
363
363
  if (props.column && props.column.length > 0) {
364
364
  state.transformY = 0;
365
365
  modifyStatus(false);
@@ -371,7 +371,7 @@ const _sfc_main$1 = create$1({
371
371
  );
372
372
  watch(
373
373
  () => props.value,
374
- (val) => {
374
+ () => {
375
375
  state.transformY = 0;
376
376
  modifyStatus(false);
377
377
  },
@@ -479,7 +479,7 @@ const baseProps = {
479
479
  default: 36
480
480
  }
481
481
  };
482
- const { componentName, create, translate } = createComponent("picker");
482
+ const { create, translate } = createComponent("picker");
483
483
  const _sfc_main = create({
484
484
  components: {
485
485
  [column.name]: column
@@ -1,8 +1,8 @@
1
1
  import { ref, computed, onMounted, watch, resolveComponent, openBlock, createElementBlock, Fragment, renderSlot, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, createVNode, withCtx, renderList, withModifiers, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
2
- import { i as isArray, c as createComponent } from "./component-8f0be7eb.js";
2
+ import { i as isArray, c as createComponent } from "./component-0fbad28e.js";
3
3
  import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
4
4
  import { u as useRect } from "./index-29892cda.js";
5
- import { P as Popup } from "./index-dc2ebe90.js";
5
+ import { P as Popup } from "./index-5ffbc437.js";
6
6
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
7
7
  import "../locale/lang";
8
8
  import "./Overlay.js";
@@ -80,7 +80,7 @@ const _sfc_main = create({
80
80
  return styles;
81
81
  });
82
82
  const upperCaseFirst = (str) => {
83
- var str = str.toLowerCase();
83
+ str = str.toLowerCase();
84
84
  str = str.replace(/\b\w+\b/g, (word) => word.substring(0, 1).toUpperCase() + word.substring(1));
85
85
  return str;
86
86
  };
@@ -97,13 +97,13 @@ const _sfc_main = create({
97
97
  let cross = 0;
98
98
  let parallel = 0;
99
99
  if (isArray(offset) && offset.length == 2) {
100
- cross += +offset[1];
101
- parallel += +offset[0];
100
+ cross += Number(offset[1]);
101
+ parallel += Number(offset[0]);
102
102
  }
103
103
  if (width) {
104
104
  if (["bottom", "top"].includes(direction)) {
105
- const h2 = direction == "bottom" ? height + cross : -(conentHeight + cross);
106
- styles.top = `${top + h2}px`;
105
+ const h = direction == "bottom" ? height + cross : -(conentHeight + cross);
106
+ styles.top = `${top + h}px`;
107
107
  if (!skew) {
108
108
  styles.left = `${-(conentWidth - width) / 2 + left + parallel}px`;
109
109
  }
@@ -1,7 +1,7 @@
1
- import { P } from "./index-dc2ebe90.js";
1
+ import { P } from "./index-5ffbc437.js";
2
2
  import "vue";
3
3
  import "./_plugin-vue_export-helper-cc2b3d55.js";
4
- import "./component-8f0be7eb.js";
4
+ import "./component-0fbad28e.js";
5
5
  import "../locale/lang";
6
6
  import "./Overlay.js";
7
7
  import "@nutui/icons-vue";
@@ -1,5 +1,5 @@
1
1
  import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("price");
@@ -1,5 +1,5 @@
1
1
  import { useSlots, ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createVNode } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { Checked } from "@nutui/icons-vue";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
5
5
  import "../locale/lang";
@@ -18,10 +18,10 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, reactive, computed, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
21
- import { c as createComponent, l as getScrollTopRoot } from "./component-8f0be7eb.js";
21
+ import { c as createComponent, l as getScrollTopRoot } from "./component-0fbad28e.js";
22
22
  import { u as useTouch } from "./index-7a7385e4.js";
23
23
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
24
- import { u as useScrollParent } from "./index-43c34ac6.js";
24
+ import { u as useScrollParent } from "./index-97b44e6c.js";
25
25
  import { Loading } from "@nutui/icons-vue";
26
26
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
27
27
  import "../locale/lang";
@@ -87,6 +87,7 @@ const _sfc_main = create({
87
87
  case "loading":
88
88
  return !slots.loading ? props.loadingTxt : "";
89
89
  }
90
+ return "";
90
91
  });
91
92
  const getStyle = computed(() => {
92
93
  return {
@@ -1,6 +1,6 @@
1
- import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-7b265520.js";
1
+ import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-cdf21a24.js";
2
2
  import "vue";
3
- import "./component-8f0be7eb.js";
3
+ import "./component-0fbad28e.js";
4
4
  import "../locale/lang";
5
5
  import "@nutui/icons-vue";
6
6
  import "./pxCheck-c6b9f6b7.js";
@@ -1,6 +1,6 @@
1
- import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-dba4283d.js";
1
+ import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-2852286e.js";
2
2
  import "vue";
3
- import "./component-8f0be7eb.js";
3
+ import "./component-0fbad28e.js";
4
4
  import "../locale/lang";
5
5
  export {
6
6
  _sfc_main as default
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, withModifiers, Fragment, renderList, createTextVNode, renderSlot } from "vue";
21
- import { c as createComponent, i as isArray } from "./component-8f0be7eb.js";
21
+ import { c as createComponent, i as isArray } from "./component-0fbad28e.js";
22
22
  import { u as useTouch } from "./index-7a7385e4.js";
23
23
  import { u as useRect } from "./index-29892cda.js";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, normalizeStyle, createElementVNode, createBlock, resolveDynamicComponent, createCommentVNode } from "vue";
21
21
  import { StarFillN } from "@nutui/icons-vue";
22
- import { c as createComponent } from "./component-8f0be7eb.js";
22
+ import { c as createComponent } from "./component-0fbad28e.js";
23
23
  import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
24
24
  import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
25
25
  import { u as useTouch } from "./index-7a7385e4.js";
@@ -93,9 +93,9 @@ const _sfc_main = create({
93
93
  if (props.disabled || props.readonly)
94
94
  return;
95
95
  let value = 0;
96
- if (index === 1 && props.modelValue === index)
97
- ;
98
- else {
96
+ if (index === 1 && props.modelValue === index) {
97
+ value = 0;
98
+ } else {
99
99
  value = index;
100
100
  if (props.allowHalf && e == 2) {
101
101
  value -= 0.5;
@@ -1,5 +1,5 @@
1
1
  import { provide, computed, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("row");
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, computed, ref, onMounted, toRefs, openBlock, createElementBlock, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, createElementVNode, normalizeClass, withModifiers, withDirectives, createBlock, resolveDynamicComponent, vShow } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
23
23
  import { CircleClose } from "@nutui/icons-vue";
24
24
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -1,6 +1,6 @@
1
1
  import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
3
- import { P as Popup } from "./index-dc2ebe90.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
+ import { P as Popup } from "./index-5ffbc437.js";
4
4
  import { Tips } from "@nutui/icons-vue";
5
5
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
6
6
  import "../locale/lang";
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, reactive, computed, onMounted, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
23
23
  import "../locale/lang";
24
24
  const { componentName, create } = createComponent("side-navbar");
@@ -1,5 +1,5 @@
1
1
  import { computed, openBlock, createElementBlock, normalizeClass, withModifiers, createElementVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
4
  import "../locale/lang";
5
5
  const { componentName, create } = createComponent("side-navbar-item");
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { ref, computed, reactive, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withDirectives, vShow, toDisplayString, createCommentVNode, createVNode, withCtx, createTextVNode } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import Button from "./Button.js";
23
23
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
24
24
  import "../locale/lang";
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "./component-8f0be7eb.js";
1
+ import { c as createComponent } from "./component-0fbad28e.js";
2
2
  import { toRefs, computed, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, createBlock, normalizeClass, normalizeStyle, Fragment, renderList } from "vue";
3
3
  import Avatar from "./Avatar.js";
4
4
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
@@ -19,15 +19,15 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { resolveComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createBlock, createCommentVNode, toDisplayString, ref, watch, onMounted, Fragment, renderList, normalizeClass, createVNode, withCtx, createSlots } from "vue";
21
21
  import Price from "./Price.js";
22
- import { c as createComponent, T as TypeOfFun } from "./component-8f0be7eb.js";
22
+ import { c as createComponent, T as TypeOfFun } from "./component-0fbad28e.js";
23
23
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
24
24
  import InputNumber from "./InputNumber.js";
25
- import { p as popupProps, P as Popup } from "./index-dc2ebe90.js";
25
+ import { p as popupProps, P as Popup } from "./index-5ffbc437.js";
26
26
  import "../locale/lang";
27
27
  import "./pxCheck-c6b9f6b7.js";
28
28
  import "@nutui/icons-vue";
29
29
  import "./Overlay.js";
30
- const { componentName: componentName$4, create: create$4, translate: translate$1 } = createComponent("sku-header");
30
+ const { create: create$4, translate: translate$1 } = createComponent("sku-header");
31
31
  const _sfc_main$4 = create$4({
32
32
  props: {
33
33
  goods: {
@@ -39,7 +39,7 @@ const _sfc_main$4 = create$4({
39
39
  components: {
40
40
  [Price.name]: Price
41
41
  },
42
- setup(props, { emit, slots }) {
42
+ setup(props, { slots }) {
43
43
  const getSlots = (name) => slots[name];
44
44
  return {
45
45
  getSlots,
@@ -74,7 +74,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
74
74
  ]);
75
75
  }
76
76
  const SkuHeader = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
77
- const { componentName: componentName$3, create: create$3 } = createComponent("sku-select");
77
+ const { create: create$3 } = createComponent("sku-select");
78
78
  const _sfc_main$3 = create$3({
79
79
  props: {
80
80
  sku: {
@@ -140,7 +140,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
140
140
  ]);
141
141
  }
142
142
  const SkuSelect = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
143
- const { componentName: componentName$2, create: create$2 } = createComponent("sku-stepper");
143
+ const { create: create$2 } = createComponent("sku-stepper");
144
144
  const _sfc_main$2 = create$2({
145
145
  props: {
146
146
  // 购买数量最大值
@@ -233,7 +233,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
233
233
  ]);
234
234
  }
235
235
  const SkuStepper = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
236
- const { componentName: componentName$1, create: create$1 } = createComponent("sku-operate");
236
+ const { create: create$1 } = createComponent("sku-operate");
237
237
  const _sfc_main$1 = create$1({
238
238
  props: {
239
239
  // 底部按钮配置 confirm cart buy
@@ -310,7 +310,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
310
310
  ])) : createCommentVNode("", true);
311
311
  }
312
312
  const SkuOperate = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
313
- const { componentName, create, translate } = createComponent("sku");
313
+ const { create, translate } = createComponent("sku");
314
314
  const _sfc_main = create({
315
315
  props: __spreadProps(__spreadValues({}, popupProps), {
316
316
  sku: {
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { getCurrentInstance, inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, Fragment, toDisplayString, createCommentVNode } from "vue";
21
- import { c as createComponent } from "./component-8f0be7eb.js";
21
+ import { c as createComponent } from "./component-0fbad28e.js";
22
22
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
23
23
  import "../locale/lang";
24
24
  const { create, componentName } = createComponent("step");
@@ -1,5 +1,5 @@
1
1
  import { reactive, computed, provide, h } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
3
  import "../locale/lang";
4
4
  const { create, componentName } = createComponent("steps");
5
5
  const _sfc_main = create({
@@ -1,8 +1,128 @@
1
- import { _ as _sfc_main } from "./index.vue_vue_type_script_lang-89366761.js";
2
- import "vue";
3
- import "./component-8f0be7eb.js";
1
+ import { ref, reactive, computed, watch, onMounted, onUnmounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, renderSlot } from "vue";
2
+ import { c as createComponent } from "./component-0fbad28e.js";
3
+ import { g as getScrollParent } from "./index-97b44e6c.js";
4
+ import { u as useRect } from "./index-29892cda.js";
5
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
4
6
  import "../locale/lang";
5
- import "./index-29892cda.js";
7
+ const { create } = createComponent("sticky");
8
+ const _sfc_main = create({
9
+ props: {
10
+ position: {
11
+ type: String,
12
+ default: "top"
13
+ },
14
+ top: {
15
+ type: [Number, String],
16
+ default: 0
17
+ },
18
+ bottom: {
19
+ type: [Number, String],
20
+ default: 0
21
+ },
22
+ container: {
23
+ type: Object
24
+ },
25
+ zIndex: {
26
+ type: [Number, String],
27
+ default: 99
28
+ }
29
+ },
30
+ emits: ["change"],
31
+ setup(props, { emit }) {
32
+ const rootRef = ref();
33
+ const stickyRef = ref();
34
+ const state = reactive({
35
+ fixed: false,
36
+ height: 0,
37
+ transform: 0
38
+ });
39
+ const threshold = computed(() => {
40
+ return props.position === "top" ? Number(props.top) : Number(props.bottom);
41
+ });
42
+ const rootStyle = computed(() => {
43
+ if (state.fixed)
44
+ return { height: `${state.height}px` };
45
+ return {};
46
+ });
47
+ const stickyStyle = computed(() => {
48
+ if (!state.fixed)
49
+ return {};
50
+ return {
51
+ [props.position]: `${threshold.value}px`,
52
+ transform: state.transform ? `translate3d(0, ${state.transform}px, 0)` : void 0,
53
+ position: state.fixed ? "fixed" : void 0,
54
+ zIndex: Number(props.zIndex)
55
+ };
56
+ });
57
+ const handleScroll = () => {
58
+ const containerEle = props.container;
59
+ if (!rootRef.value && !containerEle)
60
+ return;
61
+ const rootRect = useRect(rootRef);
62
+ const stCurrent = stickyRef.value;
63
+ const stickyRect = useRect(stCurrent);
64
+ const containerRect = useRect(containerEle);
65
+ state.height = rootRect.height;
66
+ const getFixed = () => {
67
+ let fixed = false;
68
+ if (props.position === "top") {
69
+ fixed = containerEle ? threshold.value > rootRect.top && containerRect.bottom > 0 : threshold.value > rootRect.top;
70
+ } else {
71
+ const clientHeight = document.documentElement.clientHeight;
72
+ fixed = containerEle ? containerRect.bottom > 0 && clientHeight - threshold.value - stickyRect.height > containerRect.top : clientHeight - threshold.value < rootRect.bottom;
73
+ }
74
+ return fixed;
75
+ };
76
+ const getTransform = () => {
77
+ if (containerEle) {
78
+ if (props.position === "top") {
79
+ const diff = containerRect.bottom - threshold.value - stickyRect.height;
80
+ return diff < 0 ? diff : 0;
81
+ } else {
82
+ const clientHeight = document.documentElement.clientHeight;
83
+ const diff = containerRect.bottom - (clientHeight - threshold.value);
84
+ return diff < 0 ? diff : 0;
85
+ }
86
+ }
87
+ return 0;
88
+ };
89
+ state.transform = getTransform();
90
+ state.fixed = getFixed();
91
+ };
92
+ watch(
93
+ () => state.fixed,
94
+ (val) => {
95
+ emit("change", val);
96
+ }
97
+ );
98
+ onMounted(() => {
99
+ handleScroll();
100
+ const el = getScrollParent(rootRef.value);
101
+ el.addEventListener("scroll", handleScroll, true);
102
+ });
103
+ onUnmounted(() => {
104
+ const el = getScrollParent(rootRef.value);
105
+ el.removeEventListener("scroll", handleScroll);
106
+ });
107
+ return { rootRef, rootStyle, stickyRef, stickyStyle };
108
+ }
109
+ });
110
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
111
+ return openBlock(), createElementBlock("div", {
112
+ class: "nut-sticky",
113
+ ref: "rootRef",
114
+ style: normalizeStyle(_ctx.rootStyle)
115
+ }, [
116
+ createElementVNode("div", {
117
+ class: "nut-sticky__box",
118
+ ref: "stickyRef",
119
+ style: normalizeStyle(_ctx.stickyStyle)
120
+ }, [
121
+ renderSlot(_ctx.$slots, "default")
122
+ ], 4)
123
+ ], 4);
124
+ }
125
+ const Sticky = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
6
126
  export {
7
- _sfc_main as default
127
+ Sticky as default
8
128
  };