@nutui/nutui 3.1.16-beta.1 → 3.1.17

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 (122) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/dist/nutui.d.ts +3 -1
  3. package/dist/nutui.es.js +1759 -689
  4. package/dist/nutui.umd.js +1765 -690
  5. package/dist/packages/_es/ActionSheet.js +2 -2
  6. package/dist/packages/_es/Address.js +60 -7
  7. package/dist/packages/_es/Audio.js +289 -0
  8. package/dist/packages/_es/Avatar.js +1 -1
  9. package/dist/packages/_es/BackTop.js +1 -1
  10. package/dist/packages/_es/Badge.js +1 -1
  11. package/dist/packages/_es/Barrage.js +1 -1
  12. package/dist/packages/_es/Button.js +13 -4
  13. package/dist/packages/_es/Calendar.js +428 -209
  14. package/dist/packages/_es/Card.js +1 -2
  15. package/dist/packages/_es/Cascader.js +2 -2
  16. package/dist/packages/_es/Cell.js +1 -1
  17. package/dist/packages/_es/CellGroup.js +1 -1
  18. package/dist/packages/_es/Checkbox.js +2 -2
  19. package/dist/packages/_es/CheckboxGroup.js +1 -1
  20. package/dist/packages/_es/CircleProgress.js +1 -1
  21. package/dist/packages/_es/Col.js +1 -1
  22. package/dist/packages/_es/Collapse.js +1 -1
  23. package/dist/packages/_es/CollapseItem.js +1 -1
  24. package/dist/packages/_es/CountDown.js +1 -1
  25. package/dist/packages/_es/CountUp.js +1 -1
  26. package/dist/packages/_es/DatePicker.js +1 -2
  27. package/dist/packages/_es/Dialog.js +1 -1
  28. package/dist/packages/_es/Divider.js +1 -1
  29. package/dist/packages/_es/Drag.js +1 -1
  30. package/dist/packages/_es/Elevator.js +10 -5
  31. package/dist/packages/_es/Empty.js +1 -1
  32. package/dist/packages/_es/FixedNav.js +1 -1
  33. package/dist/packages/_es/Form.js +1 -1
  34. package/dist/packages/_es/FormItem.js +1 -1
  35. package/dist/packages/_es/Grid.js +1 -1
  36. package/dist/packages/_es/GridItem.js +1 -1
  37. package/dist/packages/_es/Icon.js +1 -1
  38. package/dist/packages/_es/ImagePreview.js +1 -3
  39. package/dist/packages/_es/Indicator.js +1 -1
  40. package/dist/packages/_es/InfiniteLoading.js +1 -1
  41. package/dist/packages/_es/Input.js +7 -2
  42. package/dist/packages/_es/InputNumber.js +1 -1
  43. package/dist/packages/_es/Layout.js +1 -1
  44. package/dist/packages/_es/Menu.js +2 -2
  45. package/dist/packages/_es/MenuItem.js +1 -1
  46. package/dist/packages/_es/Navbar.js +1 -1
  47. package/dist/packages/_es/NoticeBar.js +1 -4
  48. package/dist/packages/_es/Notify.js +1 -1
  49. package/dist/packages/_es/NumberKeyboard.js +1 -2
  50. package/dist/packages/_es/OverLay.js +1 -1
  51. package/dist/packages/_es/Pagination.js +1 -1
  52. package/dist/packages/_es/Picker.js +1 -1
  53. package/dist/packages/_es/Popover.js +1 -1
  54. package/dist/packages/_es/Popup.js +1 -1
  55. package/dist/packages/_es/Price.js +2 -2
  56. package/dist/packages/_es/Progress.js +24 -11
  57. package/dist/packages/_es/Radio.js +2 -2
  58. package/dist/packages/_es/RadioGroup.js +1 -1
  59. package/dist/packages/_es/Range.js +3 -3
  60. package/dist/packages/_es/Rate.js +1 -1
  61. package/dist/packages/_es/Row.js +1 -1
  62. package/dist/packages/_es/SearchBar.js +1 -1
  63. package/dist/packages/_es/ShortPassword.js +5 -2
  64. package/dist/packages/_es/SideNavBar.js +1 -1
  65. package/dist/packages/_es/SideNavBarItem.js +1 -1
  66. package/dist/packages/_es/Signature.js +1 -1
  67. package/dist/packages/_es/Skeleton.js +8 -6
  68. package/dist/packages/_es/Sku.js +1 -1
  69. package/dist/packages/_es/Step.js +1 -1
  70. package/dist/packages/_es/Steps.js +1 -1
  71. package/dist/packages/_es/Sticky.js +143 -0
  72. package/dist/packages/_es/SubSideNavBar.js +1 -1
  73. package/dist/packages/_es/Swipe.js +2 -2
  74. package/dist/packages/_es/Swiper.js +1 -1
  75. package/dist/packages/_es/SwiperItem.js +3 -8
  76. package/dist/packages/_es/Switch.js +2 -2
  77. package/dist/packages/_es/TabPane.js +1 -1
  78. package/dist/packages/_es/Tabbar.js +1 -1
  79. package/dist/packages/_es/TabbarItem.js +1 -1
  80. package/dist/packages/_es/Table.js +2 -2
  81. package/dist/packages/_es/Tabs.js +1 -1
  82. package/dist/packages/_es/Tag.js +1 -1
  83. package/dist/packages/_es/TextArea.js +1 -1
  84. package/dist/packages/_es/TimeDetail.js +1 -1
  85. package/dist/packages/_es/TimePannel.js +1 -1
  86. package/dist/packages/_es/TimeSelect.js +1 -1
  87. package/dist/packages/_es/Toast.js +1 -1
  88. package/dist/packages/_es/Uploader.js +1 -1
  89. package/dist/packages/_es/Video.js +1 -55
  90. package/dist/packages/_es/common.js +1 -1
  91. package/dist/packages/_es/component.js +1 -1
  92. package/dist/packages/_es/index.js +1 -1
  93. package/dist/packages/_es/index2.js +28 -56
  94. package/dist/packages/_es/index3.js +56 -28
  95. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  96. package/dist/packages/_es/pxCheck.js +1 -1
  97. package/dist/packages/_es/raf.js +1 -1
  98. package/dist/packages/_es/util.js +1 -1
  99. package/dist/packages/address/index.scss +8 -0
  100. package/dist/packages/audio/index.scss +66 -0
  101. package/dist/packages/audiooperate/index.scss +13 -0
  102. package/dist/packages/calendar/index.scss +47 -41
  103. package/dist/packages/calendaritem/index.scss +57 -42
  104. package/dist/packages/elevator/index.scss +3 -0
  105. package/dist/packages/infiniteloading/index.scss +1 -1
  106. package/dist/packages/input/index.scss +4 -2
  107. package/dist/packages/range/index.scss +4 -4
  108. package/dist/packages/row/index.scss +3 -0
  109. package/dist/packages/sticky/index.scss +5 -0
  110. package/dist/packages/tabbar/index.scss +4 -2
  111. package/dist/style.css +1 -1
  112. package/dist/styles/font/config.json +6 -1
  113. package/dist/styles/font/demo_index.html +118 -3
  114. package/dist/styles/font/iconfont.css +23 -3
  115. package/dist/styles/font/iconfont.js +25 -24
  116. package/dist/styles/font/iconfont.json +35 -0
  117. package/dist/styles/font/iconfont.ttf +0 -0
  118. package/dist/styles/font/iconfont.woff +0 -0
  119. package/dist/styles/font/iconfont.woff2 +0 -0
  120. package/dist/styles/themes/default.scss +43 -40
  121. package/dist/styles/variables.scss +34 -31
  122. package/package.json +12 -13
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -49,11 +49,16 @@ const _sfc_main = create({
49
49
  iconColor: {
50
50
  type: String,
51
51
  default: "#439422"
52
+ },
53
+ isShowPercentage: {
54
+ type: Boolean,
55
+ default: true
52
56
  }
53
57
  },
54
58
  setup(props, { emit }) {
55
59
  const height = ref(props.strokeWidth + "px");
56
60
  const progressOuter = ref();
61
+ const insideText = ref();
57
62
  const left = ref();
58
63
  const bgStyle = computed(() => {
59
64
  return {
@@ -66,19 +71,29 @@ const _sfc_main = create({
66
71
  color: props.textColor || ""
67
72
  };
68
73
  });
74
+ const slideLeft = (values) => {
75
+ if (props.textInside) {
76
+ let offsetWidth = progressOuter.value.offsetWidth;
77
+ let percentageWidth = progressOuter.value.offsetWidth * Number(values) * 0.01;
78
+ let insideTextWidth = insideText.value.offsetWidth;
79
+ left.value = percentageWidth - 5 + "px";
80
+ if (offsetWidth == percentageWidth) {
81
+ left.value = percentageWidth - insideTextWidth + "px";
82
+ }
83
+ }
84
+ };
69
85
  watch(() => props.percentage, (values) => {
70
- console.log("progressOuter.value.offsetWidth", progressOuter.value.offsetWidth);
71
- console.log("values", values);
72
- left.value = progressOuter.value.offsetWidth * Number(values) * 0.01 - 5 + "px";
86
+ slideLeft(values);
73
87
  });
74
88
  onMounted(() => {
75
- left.value = progressOuter.value.offsetWidth * Number(props.percentage) * 0.01 - 5 + "px";
89
+ slideLeft(props.percentage);
76
90
  });
77
91
  return {
78
92
  height,
79
93
  bgStyle,
80
94
  textStyle,
81
95
  progressOuter,
96
+ insideText,
82
97
  left
83
98
  };
84
99
  }
@@ -88,10 +103,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
88
103
  const _component_nut_icon = resolveComponent("nut-icon");
89
104
  return openBlock(), createElementBlock("div", _hoisted_1, [
90
105
  createElementVNode("div", {
91
- class: normalizeClass(["nut-progress-outer", [
92
- _ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "",
93
- _ctx.size ? "nut-progress-" + _ctx.size : ""
94
- ]]),
106
+ class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
95
107
  ref: "progressOuter",
96
108
  style: normalizeStyle({ height: _ctx.height })
97
109
  }, [
@@ -102,11 +114,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
102
114
  _ctx.showText && _ctx.textInside ? (openBlock(), createElementBlock("div", {
103
115
  key: 0,
104
116
  class: "nut-progress-text nut-progress-insidetext",
117
+ ref: "insideText",
105
118
  style: normalizeStyle({ lineHeight: _ctx.height, left: _ctx.left })
106
119
  }, [
107
120
  createElementVNode("span", {
108
121
  style: normalizeStyle(_ctx.textStyle)
109
- }, toDisplayString(_ctx.percentage) + "%", 5)
122
+ }, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
110
123
  ], 4)) : createCommentVNode("", true)
111
124
  ], 6)
112
125
  ], 6),
@@ -118,7 +131,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
118
131
  _ctx.status == "active" || _ctx.status == "" ? (openBlock(), createElementBlock("span", {
119
132
  key: 0,
120
133
  style: normalizeStyle(_ctx.textStyle)
121
- }, toDisplayString(_ctx.percentage) + "%", 5)) : _ctx.status == "icon" ? (openBlock(), createBlock(_component_nut_icon, {
134
+ }, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status == "icon" ? (openBlock(), createBlock(_component_nut_icon, {
122
135
  key: 1,
123
136
  size: "16px",
124
137
  name: _ctx.iconName,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -36,7 +36,7 @@ const _sfc_main = create({
36
36
  }
37
37
  },
38
38
  setup(props, { emit, slots }) {
39
- let parent = inject("parent");
39
+ let parent = inject("parent", null);
40
40
  const isCurValue = computed(() => {
41
41
  return parent.label.value == props.label;
42
42
  });
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,14 +18,14 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { ref, computed, toRefs, openBlock, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, normalizeClass, withModifiers, Fragment, renderList, renderSlot } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
- import { u as useTouch } from "./index2.js";
28
- import { u as useRect } from "./index3.js";
27
+ import { u as useTouch } from "./index3.js";
28
+ import { u as useRect } from "./index2.js";
29
29
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
30
  const { componentName, create } = createComponent("range");
31
31
  const _sfc_main = create({
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -63,7 +63,10 @@ const _sfc_main = create({
63
63
  });
64
64
  watch(() => props.modelValue, (value) => {
65
65
  realInput.value = value;
66
- console.log("watch", value);
66
+ emit("update:modelValue", value);
67
+ }, {
68
+ deep: true,
69
+ immediate: true
67
70
  });
68
71
  function changeValue(e) {
69
72
  const input = e.target;
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { c as createComponent } from "./component.js";
7
- import { toRefs, computed, onMounted, resolveComponent, openBlock, createElementBlock, renderSlot, createElementVNode, createBlock, normalizeClass, normalizeStyle, createCommentVNode, Fragment, renderList } from "vue";
7
+ import { toRefs, computed, onMounted, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, createBlock, normalizeClass, normalizeStyle, Fragment, renderList } from "vue";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  const component = {
10
10
  props: {
@@ -66,7 +66,7 @@ const component = {
66
66
  };
67
67
  });
68
68
  const getStyle = () => {
69
- if (avatarSize == null ? void 0 : avatarSize.value) {
69
+ if (avatarSize.value) {
70
70
  return {
71
71
  width: avatarSize.value,
72
72
  height: avatarSize.value
@@ -78,7 +78,6 @@ const component = {
78
78
  };
79
79
  };
80
80
  onMounted(() => {
81
- console.log("row", props.row);
82
81
  });
83
82
  return {
84
83
  avatarShape,
@@ -95,7 +94,10 @@ const _hoisted_2 = {
95
94
  key: 1,
96
95
  class: "skeleton"
97
96
  };
98
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("view", { class: "skeleton-animation" }, null, -1);
97
+ const _hoisted_3 = {
98
+ key: 0,
99
+ class: "skeleton-animation"
100
+ };
99
101
  const _hoisted_4 = { class: "content" };
100
102
  const _hoisted_5 = { class: "content-line" };
101
103
  const _hoisted_6 = {
@@ -107,7 +109,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
107
109
  return !_ctx.loading ? (openBlock(), createElementBlock("view", _hoisted_1, [
108
110
  renderSlot(_ctx.$slots, "default")
109
111
  ])) : (openBlock(), createElementBlock("view", _hoisted_2, [
110
- _hoisted_3,
112
+ _ctx.animated ? (openBlock(), createElementBlock("view", _hoisted_3)) : createCommentVNode("", true),
111
113
  createElementVNode("view", _hoisted_4, [
112
114
  _ctx.avatar ? (openBlock(), createBlock(_component_nut_avatar, {
113
115
  key: 0,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -0,0 +1,143 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { ref, reactive, computed, watch, onMounted, onUnmounted, h, unref } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { u as useRect } from "./index2.js";
9
+ const { componentName, create } = createComponent("sticky");
10
+ const _sfc_main = create({
11
+ props: {
12
+ position: {
13
+ type: String,
14
+ default: "top"
15
+ },
16
+ top: {
17
+ type: [Number, String],
18
+ default: 0
19
+ },
20
+ bottom: {
21
+ type: [Number, String],
22
+ default: 0
23
+ },
24
+ container: {
25
+ type: Object
26
+ },
27
+ zIndex: {
28
+ type: [Number, String],
29
+ default: 2e3
30
+ }
31
+ },
32
+ emits: ["change", "scroll"],
33
+ setup(props, { emit, slots }) {
34
+ const root = ref();
35
+ const state = reactive({
36
+ width: 0,
37
+ height: 0,
38
+ fixed: false,
39
+ transform: 0
40
+ });
41
+ const rootStyle = computed(() => {
42
+ const { fixed, width, height } = state;
43
+ if (fixed) {
44
+ return {
45
+ width: `${width}px`,
46
+ height: `${height}px`
47
+ };
48
+ }
49
+ });
50
+ const stickyStyle = computed(() => {
51
+ if (!state.fixed)
52
+ return;
53
+ const style = {
54
+ width: `${state.width}px`,
55
+ height: `${state.height}px`,
56
+ [props.position]: `${offset.value}px`,
57
+ zIndex: +props.zIndex
58
+ };
59
+ if (state.transform)
60
+ style.transform = `translate3d(0, ${state.transform}px, 0)`;
61
+ return style;
62
+ });
63
+ const offset = computed(() => {
64
+ return props.position === "top" ? props.top : props.bottom;
65
+ });
66
+ const isHidden = (elementRef) => {
67
+ const el = unref(elementRef);
68
+ if (!el)
69
+ return false;
70
+ const style = window.getComputedStyle(el);
71
+ const hidden = style.display === "none";
72
+ const parentHidden = el.offsetParent === null && style.position !== "fixed";
73
+ return hidden || parentHidden;
74
+ };
75
+ const isExistRoot = () => {
76
+ if (!root.value || isHidden(root))
77
+ return false;
78
+ return true;
79
+ };
80
+ const getScrollTop = (el) => {
81
+ return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
82
+ };
83
+ const renderFixed = () => {
84
+ var _a;
85
+ return h("view", {
86
+ style: stickyStyle.value,
87
+ class: state.fixed ? `${componentName} nut-sticky--fixed` : componentName
88
+ }, (_a = slots.default) == null ? void 0 : _a.call(slots));
89
+ };
90
+ const onScroll = () => {
91
+ if (!isExistRoot())
92
+ return;
93
+ const { container, position } = props;
94
+ const scrollTop = getScrollTop(window);
95
+ const rootRect = useRect(root);
96
+ if (rootRect.width || rootRect.height) {
97
+ state.width = rootRect.width;
98
+ state.height = rootRect.height;
99
+ }
100
+ if (position === "top") {
101
+ if (container) {
102
+ const containerRect = useRect(container);
103
+ const diff = containerRect.bottom - +offset.value - state.height;
104
+ state.fixed = +offset.value > rootRect.top && containerRect.bottom > 0;
105
+ state.transform = diff < 0 ? diff : 0;
106
+ } else {
107
+ state.fixed = offset.value > rootRect.top;
108
+ }
109
+ } else if (position === "bottom") {
110
+ const clientHeight = document.documentElement.clientHeight;
111
+ if (container) {
112
+ const containerRect = useRect(container);
113
+ const diff = clientHeight - containerRect.top - +offset.value - state.height;
114
+ state.fixed = clientHeight - +offset.value < rootRect.bottom && clientHeight > containerRect.top;
115
+ state.transform = diff < 0 ? -diff : 0;
116
+ } else {
117
+ state.fixed = clientHeight - +offset.value < rootRect.bottom;
118
+ }
119
+ }
120
+ emit("scroll", {
121
+ top: scrollTop,
122
+ fixed: state.fixed
123
+ });
124
+ };
125
+ watch(() => state.fixed, (val) => {
126
+ emit("change", val);
127
+ });
128
+ onMounted(() => {
129
+ window.addEventListener("scroll", onScroll);
130
+ onScroll();
131
+ });
132
+ onUnmounted(() => {
133
+ window.removeEventListener("scroll", onScroll);
134
+ });
135
+ return () => {
136
+ return h("view", {
137
+ style: rootStyle.value,
138
+ ref: root
139
+ }, [renderFixed()]);
140
+ };
141
+ }
142
+ });
143
+ export { _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
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -18,11 +18,11 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { u as useTouch } from "./index2.js";
25
+ import { u as useTouch } from "./index3.js";
26
26
  import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
27
27
  import { c as createComponent } from "./component.js";
28
28
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,17 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { getCurrentInstance, inject, reactive, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
6
+ import { inject, getCurrentInstance, reactive, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
+ import { u as useExpose } from "./index.js";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
- function useExpose(apis) {
10
- const instance = getCurrentInstance();
11
- if (instance) {
12
- Object.assign(instance.proxy, apis);
13
- }
14
- }
15
10
  const { create, componentName } = createComponent("swiper-item");
16
11
  const _sfc_main = create({
17
12
  props: {},
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -58,7 +58,7 @@ const _sfc_main = create({
58
58
  default: ""
59
59
  }
60
60
  },
61
- emits: ["change", "update:modelValue"],
61
+ emits: ["change", "update:modelValue", "update:loading"],
62
62
  setup(props, { emit }) {
63
63
  const isActive = computed(() => props.modelValue === props.activeValue);
64
64
  const classes = computed(() => {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -30,7 +30,7 @@ var RenderColumn = {
30
30
  return () => h(`view`, {}, props.slots());
31
31
  },
32
32
  props: {
33
- slots: Object
33
+ slots: Function
34
34
  }
35
35
  };
36
36
  const component = (componentName2) => {
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
19
19
  return value;
20
20
  };
21
21
  /*!
22
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
22
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
23
23
  * (c) 2021 @jdf2e.
24
24
  * Released under the MIT License.
25
25
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
19
19
  return value;
20
20
  };
21
21
  /*!
22
- * @nutui/nutui v3.1.16-beta.1 Thu Jan 27 2022 18:18:31 GMT+0800 (中国标准时间)
22
+ * @nutui/nutui v3.1.16 Fri Feb 25 2022 18:32:15 GMT+0800 (中国标准时间)
23
23
  * (c) 2021 @jdf2e.
24
24
  * Released under the MIT License.
25
25
  */