@nutui/nutui 3.1.19-beta.0 → 3.1.19-beta.1

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 (110) hide show
  1. package/dist/nutui.d.ts +38 -37
  2. package/dist/nutui.es.js +13439 -12616
  3. package/dist/nutui.umd.js +13431 -12695
  4. package/dist/packages/_es/ActionSheet.js +12 -18
  5. package/dist/packages/_es/Address.js +78 -69
  6. package/dist/packages/_es/Audio.js +12 -12
  7. package/dist/packages/_es/AudioOperate.js +1 -1
  8. package/dist/packages/_es/Avatar.js +3 -3
  9. package/dist/packages/_es/BackTop.js +68 -110
  10. package/dist/packages/_es/Badge.js +3 -3
  11. package/dist/packages/_es/Barrage.js +62 -55
  12. package/dist/packages/_es/Button.js +2 -2
  13. package/dist/packages/_es/Calendar.js +28 -23
  14. package/dist/packages/_es/CalendarItem.js +3 -3
  15. package/dist/packages/_es/Card.js +6 -5
  16. package/dist/packages/_es/Cascader.js +7 -7
  17. package/dist/packages/_es/Cell.js +4 -11
  18. package/dist/packages/_es/CellGroup.js +1 -1
  19. package/dist/packages/_es/Checkbox.js +1 -1
  20. package/dist/packages/_es/CheckboxGroup.js +1 -1
  21. package/dist/packages/_es/CircleProgress.js +149 -40
  22. package/dist/packages/_es/Col.js +1 -1
  23. package/dist/packages/_es/Collapse.js +34 -8
  24. package/dist/packages/_es/CollapseItem.js +90 -59
  25. package/dist/packages/_es/CountDown.js +5 -5
  26. package/dist/packages/_es/CountUp.js +43 -51
  27. package/dist/packages/_es/DatePicker.js +21 -20
  28. package/dist/packages/_es/Dialog.js +8 -86
  29. package/dist/packages/_es/Divider.js +4 -4
  30. package/dist/packages/_es/Drag.js +92 -54
  31. package/dist/packages/_es/Elevator.js +74 -49
  32. package/dist/packages/_es/Empty.js +3 -3
  33. package/dist/packages/_es/FixedNav.js +5 -5
  34. package/dist/packages/_es/Form.js +4 -4
  35. package/dist/packages/_es/FormItem.js +1 -1
  36. package/dist/packages/_es/Grid.js +1 -1
  37. package/dist/packages/_es/GridItem.js +8 -26
  38. package/dist/packages/_es/Icon.js +1 -1
  39. package/dist/packages/_es/ImagePreview.js +15 -84
  40. package/dist/packages/_es/Indicator.js +3 -3
  41. package/dist/packages/_es/InfiniteLoading.js +93 -107
  42. package/dist/packages/_es/Input.js +8 -8
  43. package/dist/packages/_es/InputNumber.js +23 -16
  44. package/dist/packages/_es/Layout.js +1 -1
  45. package/dist/packages/_es/List.js +41 -34
  46. package/dist/packages/_es/Menu.js +15 -12
  47. package/dist/packages/_es/MenuItem.js +9 -9
  48. package/dist/packages/_es/Navbar.js +3 -4
  49. package/dist/packages/_es/NoticeBar.js +47 -40
  50. package/dist/packages/_es/Notify.js +29 -168
  51. package/dist/packages/_es/NumberKeyboard.js +5 -10
  52. package/dist/packages/_es/OldPicker.js +122 -120
  53. package/dist/packages/_es/OverLay.js +5 -25
  54. package/dist/packages/_es/Pagination.js +7 -7
  55. package/dist/packages/_es/Picker.js +39 -16
  56. package/dist/packages/_es/Popover.js +155 -30
  57. package/dist/packages/_es/Popup.js +8 -71
  58. package/dist/packages/_es/Price.js +17 -5
  59. package/dist/packages/_es/Progress.js +18 -8
  60. package/dist/packages/_es/PullRefresh.js +1 -1
  61. package/dist/packages/_es/Radio.js +2 -2
  62. package/dist/packages/_es/RadioGroup.js +1 -1
  63. package/dist/packages/_es/Range.js +46 -33
  64. package/dist/packages/_es/Rate.js +16 -19
  65. package/dist/packages/_es/Row.js +1 -1
  66. package/dist/packages/_es/SearchBar.js +8 -6
  67. package/dist/packages/_es/ShortPassword.js +89 -67
  68. package/dist/packages/_es/SideNavBar.js +5 -16
  69. package/dist/packages/_es/SideNavBarItem.js +1 -1
  70. package/dist/packages/_es/Signature.js +69 -88
  71. package/dist/packages/_es/Skeleton.js +8 -11
  72. package/dist/packages/_es/Sku.js +47 -56
  73. package/dist/packages/_es/Step.js +1 -1
  74. package/dist/packages/_es/Steps.js +1 -1
  75. package/dist/packages/_es/Sticky.js +28 -23
  76. package/dist/packages/_es/SubSideNavBar.js +1 -1
  77. package/dist/packages/_es/Swipe.js +39 -26
  78. package/dist/packages/_es/Swiper.js +31 -13
  79. package/dist/packages/_es/SwiperItem.js +1 -1
  80. package/dist/packages/_es/Switch.js +3 -3
  81. package/dist/packages/_es/TabPane.js +1 -1
  82. package/dist/packages/_es/Tabbar.js +3 -3
  83. package/dist/packages/_es/TabbarItem.js +17 -23
  84. package/dist/packages/_es/Table.js +13 -13
  85. package/dist/packages/_es/Tabs.js +21 -20
  86. package/dist/packages/_es/Tag.js +4 -4
  87. package/dist/packages/_es/TextArea.js +44 -42
  88. package/dist/packages/_es/TimeDetail.js +4 -3
  89. package/dist/packages/_es/TimePannel.js +3 -3
  90. package/dist/packages/_es/TimeSelect.js +8 -7
  91. package/dist/packages/_es/Toast.js +41 -170
  92. package/dist/packages/_es/Uploader.js +109 -138
  93. package/dist/packages/_es/Video.js +3 -3
  94. package/dist/packages/_es/common.js +1 -1
  95. package/dist/packages/_es/component.js +1 -1
  96. package/dist/packages/_es/index.js +44 -6
  97. package/dist/packages/_es/{index5.js → index.taro.js} +127 -95
  98. package/dist/packages/_es/index2.js +1 -1
  99. package/dist/packages/_es/index3.js +56 -28
  100. package/dist/packages/_es/index4.js +413 -56
  101. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  102. package/dist/packages/_es/pxCheck.js +1 -1
  103. package/dist/packages/_es/use-lock-scroll.js +23 -0
  104. package/dist/packages/_es/util.js +1 -1
  105. package/dist/packages/uploader/index.scss +2 -2
  106. package/dist/style.css +1 -1
  107. package/dist/styles/themes/default.scss +61 -61
  108. package/dist/styles/themes/jdt.scss +61 -61
  109. package/package.json +1 -1
  110. package/dist/packages/_es/raf.js +0 -19
@@ -1,11 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode, Fragment, createElementVNode, toDisplayString, createTextVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { u as useRouter } from "./index.js";
9
8
  import { p as pxCheck } from "./pxCheck.js";
10
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
10
  const { componentName, create } = createComponent("cell");
@@ -16,7 +15,7 @@ const _sfc_main = create({
16
15
  desc: { type: String, default: "" },
17
16
  descTextAlign: { type: String, default: "right" },
18
17
  isLink: { type: Boolean, default: false },
19
- to: [String, Object],
18
+ to: { type: String, default: "" },
20
19
  replace: { type: Boolean, default: false },
21
20
  roundRadius: { type: [String, Number], default: "" },
22
21
  url: { type: String, default: "" },
@@ -31,7 +30,6 @@ const _sfc_main = create({
31
30
  [`${prefixCls}--clickable`]: props.isLink || props.to
32
31
  };
33
32
  });
34
- const router = useRouter();
35
33
  const baseStyle = computed(() => {
36
34
  return {
37
35
  borderRadius: pxCheck(props.roundRadius)
@@ -39,11 +37,6 @@ const _sfc_main = create({
39
37
  });
40
38
  const handleClick = (event) => {
41
39
  emit("click", event);
42
- if (props.to && router) {
43
- router[props.replace ? "replace" : "push"](props.to);
44
- } else if (props.url) {
45
- props.replace ? location.replace(props.url) : location.href = props.url;
46
- }
47
40
  };
48
41
  return {
49
42
  handleClick,
@@ -98,5 +91,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
98
91
  ])
99
92
  ], 6);
100
93
  }
101
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
102
- export { index as default };
94
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
95
+ export { index_taro as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,9 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
6
+ import Taro from "@tarojs/taro";
7
+ import { ref, reactive, watch, onMounted, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createTextVNode, toDisplayString } from "vue";
7
8
  import { c as createComponent } from "./component.js";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  const { componentName, create } = createComponent("circleprogress");
@@ -28,12 +29,79 @@ const _sfc_main = create({
28
29
  }
29
30
  },
30
31
  setup(props, { emit }) {
32
+ const rotateLeft = ref();
33
+ const rotateRight = ref();
34
+ const InnerWidth = ref(props.strokeInnerWidth);
35
+ const isMobile = ref(false);
36
+ const cricleData = reactive({
37
+ radius: 50,
38
+ strokeOutWidth: 10,
39
+ backColor: "#d9d9d9",
40
+ progressColor: "red"
41
+ });
42
+ const loadPercent = (x, y) => {
43
+ let rotate = x / y * 360;
44
+ let rotateRc = 0;
45
+ let rotateLc = 0;
46
+ if (rotate < 180) {
47
+ rotateRc = rotate + -45;
48
+ } else {
49
+ rotateRc = 135;
50
+ rotateLc = rotate - 180 - 45;
51
+ rotateLeft.value = rotateLc;
52
+ }
53
+ rotateRight.value = rotateRc;
54
+ };
55
+ watch(() => props.progress, (value) => {
56
+ loadPercent(value, 100);
57
+ });
58
+ onMounted(() => {
59
+ if (Taro.getEnv() === "WEB") {
60
+ isMobile.value = true;
61
+ } else {
62
+ isMobile.value = false;
63
+ loadPercent(props.progress, 100);
64
+ Object.assign(cricleData, props.progressOption);
65
+ }
66
+ });
31
67
  const classes = computed(() => {
32
68
  const prefixCls = componentName;
33
69
  return {
34
70
  [prefixCls]: true
35
71
  };
36
72
  });
73
+ const pieStyle = computed(() => {
74
+ return {
75
+ width: (cricleData.radius + cricleData.strokeOutWidth) * 2 + "px",
76
+ height: (cricleData.radius + cricleData.strokeOutWidth) * 2 + "px"
77
+ };
78
+ });
79
+ const mobileStyle = computed(() => {
80
+ return {
81
+ width: "100%",
82
+ height: "100%"
83
+ };
84
+ });
85
+ const RightStyle = computed(() => {
86
+ return {
87
+ transform: `rotate(${rotateRight.value + "deg"})`,
88
+ transition: `all 0.3s`,
89
+ borderTop: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
90
+ borderLeft: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
91
+ borderBottom: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`,
92
+ borderRight: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`
93
+ };
94
+ });
95
+ const LeftStyle = computed(() => {
96
+ return {
97
+ transform: `rotate(${rotateLeft.value + "deg"})`,
98
+ transition: `all 0.3s`,
99
+ borderTop: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
100
+ borderLeft: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
101
+ borderBottom: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`,
102
+ borderRight: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`
103
+ };
104
+ });
37
105
  const option = computed(() => {
38
106
  let baseOption = {
39
107
  radius: 50,
@@ -57,53 +125,94 @@ const _sfc_main = create({
57
125
  return `${progressLength},${circleLength}`;
58
126
  });
59
127
  return {
128
+ isMobile,
129
+ rotateLeft,
130
+ InnerWidth,
131
+ rotateRight,
60
132
  classes,
133
+ pieStyle,
134
+ RightStyle,
135
+ LeftStyle,
61
136
  option,
62
- arcLength
137
+ arcLength,
138
+ mobileStyle
63
139
  };
64
140
  }
65
141
  });
66
- const _hoisted_1 = ["height", "width"];
67
- const _hoisted_2 = ["r", "cx", "cy", "stroke", "stroke-width"];
68
- const _hoisted_3 = ["r", "cx", "cy", "stroke", "stroke-dasharray", "stroke-width", "transform"];
69
- const _hoisted_4 = { class: "nut-circleprogress-content" };
142
+ const _hoisted_1 = { class: "nut-circleprogress__right" };
143
+ const _hoisted_2 = { class: "nut-circleprogress__line nut-circleprogress__r" };
144
+ const _hoisted_3 = { class: "nut-circleprogress__progress" };
145
+ const _hoisted_4 = { class: "nut-circleprogress__left" };
146
+ const _hoisted_5 = { class: "nut-circleprogress__line nut-circleprogress__l" };
147
+ const _hoisted_6 = { key: 1 };
148
+ const _hoisted_7 = ["height", "width"];
149
+ const _hoisted_8 = ["r", "cx", "cy", "stroke", "stroke-width"];
150
+ const _hoisted_9 = ["r", "cx", "cy", "stroke", "stroke-dasharray", "stroke-width", "transform"];
151
+ const _hoisted_10 = { class: "nut-circleprogress__progress" };
70
152
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
71
153
  return openBlock(), createElementBlock("div", {
72
154
  class: normalizeClass(_ctx.classes),
73
- style: normalizeStyle({ height: _ctx.option.size + "px", width: _ctx.option.size + "px" })
155
+ style: normalizeStyle(_ctx.pieStyle)
74
156
  }, [
75
- (openBlock(), createElementBlock("svg", {
76
- height: _ctx.option.size,
77
- width: _ctx.option.size,
78
- "x-mlns": "http://www.w3.org/200/svg"
157
+ !_ctx.isMobile ? (openBlock(), createElementBlock("div", {
158
+ key: 0,
159
+ style: normalizeStyle(_ctx.mobileStyle)
79
160
  }, [
80
- createElementVNode("circle", {
81
- r: _ctx.option.radius,
82
- cx: _ctx.option.cx,
83
- cy: _ctx.option.cy,
84
- stroke: _ctx.option.backColor,
85
- "stroke-width": _ctx.option.strokeOutWidth,
86
- fill: "none"
87
- }, null, 8, _hoisted_2),
88
- createElementVNode("circle", {
89
- r: _ctx.option.radius,
90
- cx: _ctx.option.cx,
91
- cy: _ctx.option.cy,
92
- stroke: _ctx.option.progressColor,
93
- "stroke-dasharray": _ctx.arcLength,
94
- "stroke-width": _ctx.strokeInnerWidth,
95
- fill: "none",
96
- transform: _ctx.option.startPosition,
97
- "stroke-linecap": "round",
98
- style: { "transition": "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease 0s" }
99
- }, null, 8, _hoisted_3)
100
- ], 8, _hoisted_1)),
101
- createElementVNode("div", _hoisted_4, [
102
- !_ctx.isAuto ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
103
- createTextVNode(toDisplayString(_ctx.progress) + "%", 1)
104
- ]) : renderSlot(_ctx.$slots, "default", { key: 1 })
105
- ])
161
+ createElementVNode("div", _hoisted_1, [
162
+ createElementVNode("div", _hoisted_2, [
163
+ createElementVNode("div", {
164
+ class: "nut-circleprogress__line__c",
165
+ style: normalizeStyle(_ctx.RightStyle)
166
+ }, null, 4)
167
+ ])
168
+ ]),
169
+ createElementVNode("div", _hoisted_3, [
170
+ !_ctx.isAuto ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
171
+ createTextVNode(toDisplayString(_ctx.progress) + "%", 1)
172
+ ]) : renderSlot(_ctx.$slots, "default", { key: 1 })
173
+ ]),
174
+ createElementVNode("div", _hoisted_4, [
175
+ createElementVNode("div", _hoisted_5, [
176
+ createElementVNode("div", {
177
+ class: "nut-circleprogress__line__c",
178
+ style: normalizeStyle(_ctx.LeftStyle)
179
+ }, null, 4)
180
+ ])
181
+ ])
182
+ ], 4)) : (openBlock(), createElementBlock("div", _hoisted_6, [
183
+ (openBlock(), createElementBlock("svg", {
184
+ height: _ctx.option.size,
185
+ width: _ctx.option.size,
186
+ "x-mlns": "http://www.w3.org/200/svg"
187
+ }, [
188
+ createElementVNode("circle", {
189
+ r: _ctx.option.radius,
190
+ cx: _ctx.option.cx,
191
+ cy: _ctx.option.cy,
192
+ stroke: _ctx.option.backColor,
193
+ "stroke-width": _ctx.option.strokeOutWidth,
194
+ fill: "none"
195
+ }, null, 8, _hoisted_8),
196
+ createElementVNode("circle", {
197
+ r: _ctx.option.radius,
198
+ cx: _ctx.option.cx,
199
+ cy: _ctx.option.cy,
200
+ stroke: _ctx.option.progressColor,
201
+ "stroke-dasharray": _ctx.arcLength,
202
+ "stroke-width": _ctx.strokeInnerWidth,
203
+ fill: "none",
204
+ transform: _ctx.option.startPosition,
205
+ "stroke-linecap": "round",
206
+ style: { "transition": "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease 0s" }
207
+ }, null, 8, _hoisted_9)
208
+ ], 8, _hoisted_7)),
209
+ createElementVNode("div", _hoisted_10, [
210
+ !_ctx.isAuto ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
211
+ createTextVNode(toDisplayString(_ctx.progress) + "%", 1)
212
+ ]) : renderSlot(_ctx.$slots, "default", { key: 1 })
213
+ ])
214
+ ]))
106
215
  ], 6);
107
216
  }
108
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
109
- export { index as default };
217
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
218
+ export { index_taro as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -49,20 +49,20 @@ const _sfc_main = create({
49
49
  }
50
50
  },
51
51
  emits: ["update:active", "change"],
52
- setup(props, { emit }) {
52
+ setup(props, { emit, slots }) {
53
53
  const changeVal = (val) => {
54
54
  emit("update:active", val);
55
55
  emit("change", val);
56
56
  };
57
57
  const changeValAry = (name) => {
58
58
  const activeItem = props.active instanceof Object ? Object.values(props.active) : props.active;
59
- let index2 = -1;
59
+ let index = -1;
60
60
  activeItem.forEach((item, idx) => {
61
61
  if (String(item) == String(name)) {
62
- index2 = idx;
62
+ index = idx;
63
63
  }
64
64
  });
65
- index2 > -1 ? activeItem.splice(index2, 1) : activeItem.push(name);
65
+ index > -1 ? activeItem.splice(index, 1) : activeItem.push(name);
66
66
  changeVal(activeItem);
67
67
  };
68
68
  const isExpanded = (name) => {
@@ -71,12 +71,38 @@ const _sfc_main = create({
71
71
  return typeof active === "number" || typeof active === "string" ? active == name : false;
72
72
  }
73
73
  };
74
+ const activeIndex = () => {
75
+ var _a;
76
+ const activeCollapse = props.active;
77
+ const childrenList = (_a = slots.default) == null ? void 0 : _a.call(slots);
78
+ let act = [];
79
+ childrenList.forEach((item, index) => {
80
+ if (typeof activeCollapse == "number" || typeof activeCollapse == "string") {
81
+ if (item.props.name == activeCollapse) {
82
+ act.push(item.flag);
83
+ return act;
84
+ }
85
+ } else {
86
+ let ary = Array.from(activeCollapse);
87
+ if (ary.includes(String(item.props.name)) || ary.includes(Number(item.props.name))) {
88
+ act.push(item.flag);
89
+ }
90
+ }
91
+ });
92
+ return act;
93
+ };
94
+ const getParentChildren = () => {
95
+ var _a;
96
+ return (_a = slots.default) == null ? void 0 : _a.call(slots);
97
+ };
74
98
  provide("collapseParent", {
75
99
  children: [],
76
100
  props,
77
101
  changeValAry,
78
102
  changeVal,
79
- isExpanded
103
+ isExpanded,
104
+ activeIndex,
105
+ getParentChildren
80
106
  });
81
107
  }
82
108
  });
@@ -85,5 +111,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
85
111
  renderSlot(_ctx.$slots, "default")
86
112
  ]);
87
113
  }
88
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
89
- export { index as default };
114
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
115
+ export { index_taro as default };
@@ -18,11 +18,12 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { inject, reactive, computed, getCurrentInstance, ref, watch, onMounted, nextTick, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, renderSlot, normalizeStyle } from "vue";
25
+ import { inject, ref, reactive, computed, getCurrentInstance, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, renderSlot, normalizeStyle } from "vue";
26
+ import Taro, { eventCenter, getCurrentInstance as getCurrentInstance$1 } from "@tarojs/taro";
26
27
  import { c as createComponent } from "./component.js";
27
28
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
29
  const { create, componentName } = createComponent("collapse-item");
@@ -51,6 +52,7 @@ const _sfc_main = create({
51
52
  },
52
53
  setup(props, ctx) {
53
54
  const collapse = inject("collapseParent");
55
+ const conHeight = ref("auto");
54
56
  const parent = reactive(collapse);
55
57
  const classes = computed(() => {
56
58
  const prefixCls = componentName;
@@ -69,7 +71,7 @@ const _sfc_main = create({
69
71
  icon: parent.props.icon,
70
72
  iconSize: parent.props.iconSize,
71
73
  iconColor: parent.props.iconColor,
72
- openExpanded: false,
74
+ openExpanded: null,
73
75
  iconStyle: {
74
76
  transform: "rotate(0deg)",
75
77
  marginTop: parent.props.iconHeght ? "-" + parent.props.iconHeght / 2 + "px" : "-10px"
@@ -84,31 +86,33 @@ const _sfc_main = create({
84
86
  const wrapperRef = ref(null);
85
87
  const contentRef = ref(null);
86
88
  const onTransitionEnd = () => {
87
- const wrapperRefEle = document.getElementsByClassName("collapse-wrapper")[0];
88
- if (wrapperRefEle) {
89
- wrapperRefEle.style.willChange = "auto";
90
- }
89
+ nextTick(() => {
90
+ parent.children.forEach((item1, index) => {
91
+ let ary = Array.from(item1.$el.children);
92
+ ary.forEach((item2, index2) => {
93
+ if (item2.className.includes("collapse-wrapper")) {
94
+ item2.style.willChange = "auto";
95
+ }
96
+ });
97
+ });
98
+ });
91
99
  };
92
100
  const animation = () => {
93
- const wrapperRefEle = wrapperRef.value;
94
- const contentRefEle = contentRef.value;
95
- if (!wrapperRefEle || !contentRefEle) {
96
- return;
101
+ if (parent.props.icon && !proxyData.openExpanded) {
102
+ proxyData.iconStyle["transform"] = "rotate(0deg)";
103
+ } else {
104
+ proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
97
105
  }
98
- const offsetHeight = contentRefEle.offsetHeight || "auto";
99
- if (offsetHeight) {
100
- const contentHeight = `${offsetHeight}px`;
101
- wrapperRefEle.style.willChange = "height";
102
- wrapperRefEle.style.height = !proxyData.openExpanded ? 0 : contentHeight;
103
- if (parent.props.icon && !proxyData.openExpanded) {
104
- proxyData.iconStyle["transform"] = "rotate(0deg)";
105
- } else {
106
- proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
106
+ nextTick(() => {
107
+ const query = Taro.getEnv() === "ALIPAY" ? my.createSelectorQuery() : Taro.createSelectorQuery();
108
+ query.selectAll(".collapse-content").boundingClientRect();
109
+ query.exec((res) => {
110
+ getH(res[0]);
111
+ });
112
+ if (!proxyData.openExpanded) {
113
+ onTransitionEnd();
107
114
  }
108
- }
109
- if (!proxyData.openExpanded) {
110
- onTransitionEnd();
111
- }
115
+ });
112
116
  };
113
117
  const open = () => {
114
118
  proxyData.openExpanded = !proxyData.openExpanded;
@@ -123,7 +127,7 @@ const _sfc_main = create({
123
127
  const currentName = computed(() => props.name);
124
128
  const toggleOpen = () => {
125
129
  if (parent.props.accordion) {
126
- parent.children.forEach((item, index2) => {
130
+ parent.children.forEach((item, index) => {
127
131
  if (currentName.value == item.name) {
128
132
  item.changeOpen(!item.openExpanded);
129
133
  } else {
@@ -157,39 +161,65 @@ const _sfc_main = create({
157
161
  watch(() => {
158
162
  var _a, _b;
159
163
  return (_b = (_a = ctx == null ? void 0 : ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a);
160
- }, () => {
164
+ }, (vnodes) => {
161
165
  setTimeout(() => {
162
- animation();
166
+ getRefHeight();
163
167
  }, 300);
164
168
  });
169
+ const getH = (list) => {
170
+ parent.children.forEach((item1, index1) => {
171
+ let ary = Array.from(item1.$el.children);
172
+ let _uid = ary[1].children[0]["uid"];
173
+ let tm = list.filter((item2) => item2.id == _uid);
174
+ if (tm && tm.length > 0) {
175
+ let h = tm[0]["height"];
176
+ item1.conHeight = h;
177
+ }
178
+ });
179
+ };
180
+ const getH5 = () => {
181
+ parent.children.forEach((item1, index1) => {
182
+ let ary = Array.from(item1.$el.children);
183
+ let h = ary[1].children[0]["offsetHeight"];
184
+ item1.conHeight = h;
185
+ });
186
+ };
187
+ const getRefHeight = () => {
188
+ const query = Taro.getEnv() === "ALIPAY" ? my.createSelectorQuery() : Taro.createSelectorQuery();
189
+ query.selectAll(".collapse-content").boundingClientRect();
190
+ query.exec((res) => {
191
+ if (Taro.getEnv() === "WEB") {
192
+ getH5();
193
+ } else {
194
+ getH(res[0]);
195
+ }
196
+ });
197
+ };
165
198
  onMounted(() => {
166
199
  const { name } = props;
167
200
  const active = parent && parent.props.active;
168
- nextTick(() => {
169
- if (typeof active == "number" || typeof active == "string") {
170
- if (name == active) {
171
- defaultOpen();
172
- }
173
- } else if (Object.values(active) instanceof Array) {
174
- const f = Object.values(active).filter((item) => item == name);
175
- if (f.length > 0) {
176
- defaultOpen();
177
- }
201
+ if (typeof active == "number" || typeof active == "string") {
202
+ if (name == active) {
203
+ defaultOpen();
204
+ }
205
+ } else if (Object.values(active) instanceof Array) {
206
+ const f = Object.values(active).filter((item) => item == name);
207
+ if (f.length > 0) {
208
+ defaultOpen();
178
209
  }
179
- });
180
- });
181
- const emptyContent = computed(() => {
182
- let ele = contentRef.value;
183
- let _class = "";
184
- if (!(ele == null ? void 0 : ele.innerText)) {
185
- _class = "empty";
186
210
  }
187
- return _class;
211
+ if (Taro.getEnv() === "WEB") {
212
+ getRefHeight();
213
+ } else {
214
+ eventCenter.once(getCurrentInstance$1().router.onReady, () => {
215
+ getRefHeight();
216
+ });
217
+ }
188
218
  });
189
219
  return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
190
- classes,
191
- emptyContent
220
+ classes
192
221
  }, toRefs(proxyData)), toRefs(parent.props)), toRefs(titleIconStyle)), {
222
+ conHeight,
193
223
  wrapperRef,
194
224
  contentRef,
195
225
  open,
@@ -208,8 +238,8 @@ const _hoisted_4 = {
208
238
  };
209
239
  const _hoisted_5 = ["innerHTML"];
210
240
  const _hoisted_6 = {
211
- class: "collapse-wrapper",
212
- ref: "wrapperRef"
241
+ class: "collapse-content",
242
+ ref: "contentRef"
213
243
  };
214
244
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
215
245
  const _component_nut_icon = resolveComponent("nut-icon");
@@ -228,7 +258,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
228
258
  name: _ctx.titleIcon,
229
259
  size: _ctx.titleIconSize,
230
260
  color: _ctx.titleIconColor,
231
- class: normalizeClass([_ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
261
+ class: normalizeClass(["collapse-title-icon", _ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
232
262
  }, null, 8, ["name", "size", "color", "class"])) : createCommentVNode("", true),
233
263
  _ctx.$slots.mTitle ? renderSlot(_ctx.$slots, "mTitle", { key: 1 }) : (openBlock(), createElementBlock("view", {
234
264
  key: 2,
@@ -254,15 +284,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
254
284
  style: normalizeStyle(_ctx.iconStyle)
255
285
  }, null, 8, ["name", "size", "color", "class", "style"])) : createCommentVNode("", true)
256
286
  ], 2),
257
- createElementVNode("view", _hoisted_6, [
258
- createElementVNode("view", {
259
- class: normalizeClass(["collapse-content", _ctx.emptyContent]),
260
- ref: "contentRef"
261
- }, [
287
+ createElementVNode("view", {
288
+ class: normalizeClass(["collapse-wrapper", _ctx.openExpanded ? "open-style" : "close-style"]),
289
+ ref: "wrapperRef",
290
+ style: normalizeStyle({ height: _ctx.openExpanded ? _ctx.conHeight == "auto" ? "auto" : _ctx.conHeight + "px" : 0 })
291
+ }, [
292
+ createElementVNode("view", _hoisted_6, [
262
293
  renderSlot(_ctx.$slots, "default")
263
- ], 2)
264
- ], 512)
294
+ ], 512)
295
+ ], 6)
265
296
  ], 2);
266
297
  }
267
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
268
- export { index as default };
298
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
299
+ export { index_taro 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.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
@@ -62,7 +62,7 @@ const _sfc_main = create({
62
62
  }
63
63
  },
64
64
  components: {},
65
- emits: ["input", "on-end", "on-restart", "on-paused", "update:modelValue"],
65
+ emits: ["input", "on-end", "on-restart", "on-paused"],
66
66
  setup(props, { emit, slots }) {
67
67
  const state = reactive({
68
68
  restTime: 0,
@@ -131,7 +131,7 @@ const _sfc_main = create({
131
131
  if (!props.paused) {
132
132
  let restTime2 = end - (Date.now() - state.p + diffTime);
133
133
  state.restTime = restTime2;
134
- if (restTime2 < 0) {
134
+ if (restTime2 < delay) {
135
135
  state.restTime = 0;
136
136
  emit("on-end");
137
137
  clearInterval(state.timer);
@@ -221,5 +221,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
221
221
  ], 64))
222
222
  ], 2);
223
223
  }
224
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
225
- export { index as default };
224
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
225
+ export { index_taro as default };