@nutui/nutui 3.1.12-beta.0 → 3.1.12-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 (99) hide show
  1. package/dist/nutui.d.ts +4 -1
  2. package/dist/nutui.es.js +3943 -4130
  3. package/dist/nutui.umd.js +3947 -4201
  4. package/dist/packages/_es/ActionSheet.js +13 -12
  5. package/dist/packages/_es/Address.js +63 -49
  6. package/dist/packages/_es/Avatar.js +4 -5
  7. package/dist/packages/_es/BackTop.js +72 -109
  8. package/dist/packages/_es/Badge.js +4 -5
  9. package/dist/packages/_es/Barrage.js +63 -57
  10. package/dist/packages/_es/Button.js +5 -6
  11. package/dist/packages/_es/Calendar.js +27 -18
  12. package/dist/packages/_es/Card.js +104 -0
  13. package/dist/packages/_es/Cell.js +5 -13
  14. package/dist/packages/_es/CellGroup.js +4 -5
  15. package/dist/packages/_es/Checkbox.js +3 -3
  16. package/dist/packages/_es/CheckboxGroup.js +9 -4
  17. package/dist/packages/_es/CircleProgress.js +142 -46
  18. package/dist/packages/_es/Col.js +4 -5
  19. package/dist/packages/_es/Collapse.js +35 -10
  20. package/dist/packages/_es/CollapseItem.js +80 -35
  21. package/dist/packages/_es/CountDown.js +7 -5
  22. package/dist/packages/_es/CountUp.js +34 -31
  23. package/dist/packages/_es/DatePicker.js +451 -219
  24. package/dist/packages/_es/Dialog.js +24 -89
  25. package/dist/packages/_es/Divider.js +5 -6
  26. package/dist/packages/_es/Drag.js +76 -50
  27. package/dist/packages/_es/Elevator.js +81 -52
  28. package/dist/packages/_es/FixedNav.js +8 -9
  29. package/dist/packages/_es/Form.js +137 -0
  30. package/dist/packages/_es/FormItem.js +109 -0
  31. package/dist/packages/_es/Icon.js +6 -40
  32. package/dist/packages/_es/ImagePreview.js +23 -21
  33. package/dist/packages/_es/InfiniteLoading.js +95 -109
  34. package/dist/packages/_es/Input.js +22 -21
  35. package/dist/packages/_es/InputNumber.js +24 -18
  36. package/dist/packages/_es/Layout.js +2 -2
  37. package/dist/packages/_es/Menu.js +16 -14
  38. package/dist/packages/_es/MenuItem.js +9 -11
  39. package/dist/packages/_es/Navbar.js +7 -7
  40. package/dist/packages/_es/NoticeBar.js +39 -26
  41. package/dist/packages/_es/Notify.js +30 -166
  42. package/dist/packages/_es/NumberKeyboard.js +10 -6
  43. package/dist/packages/_es/OverLay.js +22 -29
  44. package/dist/packages/_es/Pagination.js +8 -9
  45. package/dist/packages/_es/Picker.js +61 -447
  46. package/dist/packages/_es/Popover.js +146 -25
  47. package/dist/packages/_es/Popup.js +17 -77
  48. package/dist/packages/_es/Price.js +18 -7
  49. package/dist/packages/_es/Progress.js +23 -12
  50. package/dist/packages/_es/Radio.js +3 -3
  51. package/dist/packages/_es/RadioGroup.js +2 -2
  52. package/dist/packages/_es/Range.js +37 -30
  53. package/dist/packages/_es/Rate.js +16 -20
  54. package/dist/packages/_es/Row.js +4 -5
  55. package/dist/packages/_es/SearchBar.js +7 -5
  56. package/dist/packages/_es/ShortPassword.js +89 -59
  57. package/dist/packages/_es/Signature.js +70 -71
  58. package/dist/packages/_es/Sku.js +54 -79
  59. package/dist/packages/_es/Step.js +10 -8
  60. package/dist/packages/_es/Steps.js +2 -2
  61. package/dist/packages/_es/Swipe.js +42 -27
  62. package/dist/packages/_es/Swiper.js +17 -418
  63. package/dist/packages/_es/SwiperItem.js +14 -39
  64. package/dist/packages/_es/Switch.js +4 -5
  65. package/dist/packages/_es/TabPane.js +4 -5
  66. package/dist/packages/_es/Tabbar.js +4 -5
  67. package/dist/packages/_es/TabbarItem.js +8 -9
  68. package/dist/packages/_es/Tabs.js +22 -16
  69. package/dist/packages/_es/Tag.js +5 -6
  70. package/dist/packages/_es/TextArea.js +16 -12
  71. package/dist/packages/_es/TimeDetail.js +7 -5
  72. package/dist/packages/_es/TimePannel.js +7 -5
  73. package/dist/packages/_es/TimeSelect.js +12 -7
  74. package/dist/packages/_es/Toast.js +41 -163
  75. package/dist/packages/_es/Uploader.js +109 -149
  76. package/dist/packages/_es/commonProps.js +30 -0
  77. package/dist/packages/_es/component.js +1 -1
  78. package/dist/packages/_es/index.js +1 -1
  79. package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
  80. package/dist/packages/_es/index2.js +40 -27
  81. package/dist/packages/_es/index3.js +413 -7
  82. package/dist/packages/_es/pxCheck.js +1 -1
  83. package/dist/packages/_es/raf.js +1 -1
  84. package/dist/packages/_es/use-lock-scroll.js +23 -0
  85. package/dist/packages/_es/util.js +47 -0
  86. package/dist/packages/button/index.scss +6 -0
  87. package/dist/packages/card/index.scss +97 -0
  88. package/dist/packages/checkbox/index.scss +1 -1
  89. package/dist/packages/form/index.scss +2 -0
  90. package/dist/packages/formitem/index.scss +60 -0
  91. package/dist/packages/numberkeyboard/index.scss +1 -1
  92. package/dist/packages/switch/index.scss +1 -1
  93. package/dist/style.css +1 -1
  94. package/dist/style.es.js +1 -2
  95. package/dist/styles/themes/default.scss +35 -32
  96. package/dist/styles/variables.scss +11 -1
  97. package/package.json +2 -2
  98. package/dist/packages/_es/Video.js +0 -405
  99. package/dist/packages/_es/plugin-vue_export-helper.js +0 -13
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.12-beta.0 Mon Nov 22 2021 20:58:07 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @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, toDisplayString } from "vue";
7
8
  import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  const { componentName, create } = createComponent("circleprogress");
10
- const _sfc_main = create({
10
+ var _sfc_main = create({
11
11
  props: {
12
12
  progress: {
13
13
  type: [Number, String],
@@ -17,10 +17,6 @@ const _sfc_main = create({
17
17
  type: [Number, String],
18
18
  default: 10
19
19
  },
20
- isAuto: {
21
- tyep: Boolean,
22
- default: false
23
- },
24
20
  progressOption: {
25
21
  type: Object,
26
22
  default: () => {
@@ -28,12 +24,79 @@ const _sfc_main = create({
28
24
  }
29
25
  },
30
26
  setup(props, { emit }) {
27
+ const rotateLeft = ref();
28
+ const rotateRight = ref();
29
+ const InnerWidth = ref(props.strokeInnerWidth);
30
+ const isMobile = ref(false);
31
+ const cricleData = reactive({
32
+ radius: 50,
33
+ strokeOutWidth: 10,
34
+ backColor: "#d9d9d9",
35
+ progressColor: "red"
36
+ });
37
+ const loadPercent = (x, y) => {
38
+ let rotate = x / y * 360;
39
+ let rotateRc = 0;
40
+ let rotateLc = 0;
41
+ if (rotate < 180) {
42
+ rotateRc = rotate + -45;
43
+ } else {
44
+ rotateRc = 135;
45
+ rotateLc = rotate - 180 - 45;
46
+ rotateLeft.value = rotateLc;
47
+ }
48
+ rotateRight.value = rotateRc;
49
+ };
50
+ watch(() => props.progress, (value) => {
51
+ loadPercent(value, 100);
52
+ });
53
+ onMounted(() => {
54
+ if (Taro.getEnv() === "WEB") {
55
+ isMobile.value = true;
56
+ } else {
57
+ isMobile.value = false;
58
+ loadPercent(props.progress, 100);
59
+ Object.assign(cricleData, props.progressOption);
60
+ }
61
+ });
31
62
  const classes = computed(() => {
32
63
  const prefixCls = componentName;
33
64
  return {
34
65
  [prefixCls]: true
35
66
  };
36
67
  });
68
+ const pieStyle = computed(() => {
69
+ return {
70
+ width: (cricleData.radius + cricleData.strokeOutWidth) * 2 + "px",
71
+ height: (cricleData.radius + cricleData.strokeOutWidth) * 2 + "px"
72
+ };
73
+ });
74
+ const mobileStyle = computed(() => {
75
+ return {
76
+ width: "100%",
77
+ height: "100%"
78
+ };
79
+ });
80
+ const RightStyle = computed(() => {
81
+ return {
82
+ transform: `rotate(${rotateRight.value + "deg"})`,
83
+ transition: `all 0.3s`,
84
+ borderTop: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
85
+ borderLeft: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
86
+ borderBottom: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`,
87
+ borderRight: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`
88
+ };
89
+ });
90
+ const LeftStyle = computed(() => {
91
+ return {
92
+ transform: `rotate(${rotateLeft.value + "deg"})`,
93
+ transition: `all 0.3s`,
94
+ borderTop: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
95
+ borderLeft: `${InnerWidth.value + "px"} solid ${cricleData.backColor};`,
96
+ borderBottom: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`,
97
+ borderRight: `${InnerWidth.value + "px"} solid ${cricleData.progressColor};`
98
+ };
99
+ });
37
100
  const option = computed(() => {
38
101
  let baseOption = {
39
102
  radius: 50,
@@ -57,53 +120,86 @@ const _sfc_main = create({
57
120
  return `${progressLength},${circleLength}`;
58
121
  });
59
122
  return {
123
+ isMobile,
124
+ rotateLeft,
125
+ InnerWidth,
126
+ rotateRight,
60
127
  classes,
128
+ pieStyle,
129
+ RightStyle,
130
+ LeftStyle,
61
131
  option,
62
- arcLength
132
+ arcLength,
133
+ mobileStyle
63
134
  };
64
135
  }
65
136
  });
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" };
137
+ const _hoisted_1 = { class: "nut-circleprogress__right" };
138
+ const _hoisted_2 = { class: "nut-circleprogress__line nut-circleprogress__r" };
139
+ const _hoisted_3 = { class: "nut-circleprogress__progress" };
140
+ const _hoisted_4 = { class: "nut-circleprogress__left" };
141
+ const _hoisted_5 = { class: "nut-circleprogress__line nut-circleprogress__l" };
142
+ const _hoisted_6 = { key: 1 };
143
+ const _hoisted_7 = ["height", "width"];
144
+ const _hoisted_8 = ["r", "cx", "cy", "stroke", "stroke-width"];
145
+ const _hoisted_9 = ["r", "cx", "cy", "stroke", "stroke-dasharray", "stroke-width", "transform"];
146
+ const _hoisted_10 = { class: "nut-circleprogress__progress" };
70
147
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
71
148
  return openBlock(), createElementBlock("div", {
72
149
  class: normalizeClass(_ctx.classes),
73
- style: normalizeStyle({ height: _ctx.option.size + "px", width: _ctx.option.size + "px" })
150
+ style: normalizeStyle(_ctx.pieStyle)
74
151
  }, [
75
- (openBlock(), createElementBlock("svg", {
76
- height: _ctx.option.size,
77
- width: _ctx.option.size,
78
- "x-mlns": "http://www.w3.org/200/svg"
152
+ !_ctx.isMobile ? (openBlock(), createElementBlock("div", {
153
+ key: 0,
154
+ style: normalizeStyle(_ctx.mobileStyle)
79
155
  }, [
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
- ])
156
+ createElementVNode("div", _hoisted_1, [
157
+ createElementVNode("div", _hoisted_2, [
158
+ createElementVNode("div", {
159
+ class: "nut-circleprogress__line__c",
160
+ style: normalizeStyle(_ctx.RightStyle)
161
+ }, null, 4)
162
+ ])
163
+ ]),
164
+ createElementVNode("div", _hoisted_3, toDisplayString(_ctx.progress) + " %", 1),
165
+ createElementVNode("div", _hoisted_4, [
166
+ createElementVNode("div", _hoisted_5, [
167
+ createElementVNode("div", {
168
+ class: "nut-circleprogress__line__c",
169
+ style: normalizeStyle(_ctx.LeftStyle)
170
+ }, null, 4)
171
+ ])
172
+ ])
173
+ ], 4)) : (openBlock(), createElementBlock("div", _hoisted_6, [
174
+ (openBlock(), createElementBlock("svg", {
175
+ height: _ctx.option.size,
176
+ width: _ctx.option.size,
177
+ "x-mlns": "http://www.w3.org/200/svg"
178
+ }, [
179
+ createElementVNode("circle", {
180
+ r: _ctx.option.radius,
181
+ cx: _ctx.option.cx,
182
+ cy: _ctx.option.cy,
183
+ stroke: _ctx.option.backColor,
184
+ "stroke-width": _ctx.option.strokeOutWidth,
185
+ fill: "none"
186
+ }, null, 8, _hoisted_8),
187
+ createElementVNode("circle", {
188
+ r: _ctx.option.radius,
189
+ cx: _ctx.option.cx,
190
+ cy: _ctx.option.cy,
191
+ stroke: _ctx.option.progressColor,
192
+ "stroke-dasharray": _ctx.arcLength,
193
+ "stroke-width": _ctx.strokeInnerWidth,
194
+ fill: "none",
195
+ transform: _ctx.option.startPosition,
196
+ "stroke-linecap": "round",
197
+ style: { "transition": "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease 0s" }
198
+ }, null, 8, _hoisted_9)
199
+ ], 8, _hoisted_7)),
200
+ createElementVNode("div", _hoisted_10, toDisplayString(_ctx.progress) + "%", 1)
201
+ ]))
106
202
  ], 6);
107
203
  }
108
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
109
- export { index as default };
204
+ _sfc_main.render = _sfc_render;
205
+ export { _sfc_main as default };
@@ -1,13 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.12-beta.0 Mon Nov 22 2021 20:58:07 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
8
  const { componentName, create } = createComponent("col");
10
- const _sfc_main = create({
9
+ var _sfc_main = create({
11
10
  props: {
12
11
  span: {
13
12
  type: [String, Number],
@@ -49,5 +48,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
49
48
  renderSlot(_ctx.$slots, "default")
50
49
  ], 6);
51
50
  }
52
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
53
- export { index as default };
51
+ _sfc_main.render = _sfc_render;
52
+ export { _sfc_main as default };
@@ -1,13 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.12-beta.0 Mon Nov 22 2021 20:58:07 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { provide, openBlock, createElementBlock, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
8
  const { create } = createComponent("collapse");
10
- const _sfc_main = create({
9
+ var _sfc_main = create({
11
10
  props: {
12
11
  active: {
13
12
  type: [String, Number, Array]
@@ -49,20 +48,20 @@ const _sfc_main = create({
49
48
  }
50
49
  },
51
50
  emits: ["update:active", "change"],
52
- setup(props, { emit }) {
51
+ setup(props, { emit, slots }) {
53
52
  const changeVal = (val) => {
54
53
  emit("update:active", val);
55
54
  emit("change", val);
56
55
  };
57
56
  const changeValAry = (name) => {
58
57
  const activeItem = props.active instanceof Object ? Object.values(props.active) : props.active;
59
- let index2 = -1;
58
+ let index = -1;
60
59
  activeItem.forEach((item, idx) => {
61
60
  if (String(item) == String(name)) {
62
- index2 = idx;
61
+ index = idx;
63
62
  }
64
63
  });
65
- index2 > -1 ? activeItem.splice(index2, 1) : activeItem.push(name);
64
+ index > -1 ? activeItem.splice(index, 1) : activeItem.push(name);
66
65
  changeVal(activeItem);
67
66
  };
68
67
  const isExpanded = (name) => {
@@ -71,12 +70,38 @@ const _sfc_main = create({
71
70
  return typeof active === "number" || typeof active === "string" ? active == name : false;
72
71
  }
73
72
  };
73
+ const activeIndex = () => {
74
+ var _a;
75
+ const activeCollapse = props.active;
76
+ const childrenList = (_a = slots.default) == null ? void 0 : _a.call(slots);
77
+ let act = [];
78
+ childrenList.forEach((item, index) => {
79
+ if (typeof activeCollapse == "number" || typeof activeCollapse == "string") {
80
+ if (item.props.name == activeCollapse) {
81
+ act.push(item.flag);
82
+ return act;
83
+ }
84
+ } else {
85
+ let ary = Array.from(activeCollapse);
86
+ if (ary.includes(String(item.props.name)) || ary.includes(Number(item.props.name))) {
87
+ act.push(item.flag);
88
+ }
89
+ }
90
+ });
91
+ return act;
92
+ };
93
+ const getParentChildren = () => {
94
+ var _a;
95
+ return (_a = slots.default) == null ? void 0 : _a.call(slots);
96
+ };
74
97
  provide("collapseParent", {
75
98
  children: [],
76
99
  props,
77
100
  changeValAry,
78
101
  changeVal,
79
- isExpanded
102
+ isExpanded,
103
+ activeIndex,
104
+ getParentChildren
80
105
  });
81
106
  }
82
107
  });
@@ -85,5 +110,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
85
110
  renderSlot(_ctx.$slots, "default")
86
111
  ]);
87
112
  }
88
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
89
- export { index as default };
113
+ _sfc_main.render = _sfc_render;
114
+ export { _sfc_main as default };
@@ -17,16 +17,19 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __require = typeof require !== "undefined" ? require : (x) => {
21
+ throw new Error('Dynamic require of "' + x + '" is not supported');
22
+ };
20
23
  /*!
21
- * @nutui/nutui v3.1.12-beta.0 Mon Nov 22 2021 20:58:07 GMT+0800 (中国标准时间)
24
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
22
25
  * (c) 2021 @jdf2e.
23
26
  * Released under the MIT License.
24
27
  */
25
- import { inject, reactive, computed, getCurrentInstance, ref, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, renderSlot, normalizeStyle } from "vue";
28
+ import { inject, ref, reactive, computed, getCurrentInstance, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, renderSlot, normalizeStyle } from "vue";
29
+ import Taro, { eventCenter, getCurrentInstance as getCurrentInstance$1 } from "@tarojs/taro";
26
30
  import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
31
  const { create, componentName } = createComponent("collapse-item");
29
- const _sfc_main = create({
32
+ var _sfc_main = create({
30
33
  props: {
31
34
  title: {
32
35
  type: String,
@@ -51,6 +54,7 @@ const _sfc_main = create({
51
54
  },
52
55
  setup(props) {
53
56
  const collapse = inject("collapseParent");
57
+ const conHeight = ref(0);
54
58
  const parent = reactive(collapse);
55
59
  const classes = computed(() => {
56
60
  const prefixCls = componentName;
@@ -69,7 +73,7 @@ const _sfc_main = create({
69
73
  icon: parent.props.icon,
70
74
  iconSize: parent.props.iconSize,
71
75
  iconColor: parent.props.iconColor,
72
- openExpanded: false,
76
+ openExpanded: null,
73
77
  iconStyle: {
74
78
  transform: "rotate(0deg)",
75
79
  marginTop: parent.props.iconHeght ? "-" + parent.props.iconHeght / 2 + "px" : "-10px"
@@ -84,29 +88,33 @@ const _sfc_main = create({
84
88
  const wrapperRef = ref(null);
85
89
  const contentRef = ref(null);
86
90
  const onTransitionEnd = () => {
87
- const wrapperRefEle = document.getElementsByClassName("collapse-wrapper")[0];
88
- wrapperRefEle.style.willChange = "auto";
91
+ nextTick(() => {
92
+ parent.children.forEach((item1, index) => {
93
+ let ary = Array.from(item1.$el.children);
94
+ ary.forEach((item2, index2) => {
95
+ if (item2.className.includes("collapse-wrapper")) {
96
+ item2.style.willChange = "auto";
97
+ }
98
+ });
99
+ });
100
+ });
89
101
  };
90
102
  const animation = () => {
91
- const wrapperRefEle = wrapperRef.value;
92
- const contentRefEle = contentRef.value;
93
- if (!wrapperRefEle || !contentRefEle) {
94
- return;
103
+ if (parent.props.icon && !proxyData.openExpanded) {
104
+ proxyData.iconStyle["transform"] = "rotate(0deg)";
105
+ } else {
106
+ proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
95
107
  }
96
- const offsetHeight = contentRefEle.offsetHeight;
97
- if (offsetHeight) {
98
- const contentHeight = `${offsetHeight}px`;
99
- wrapperRefEle.style.willChange = "height";
100
- wrapperRefEle.style.height = !proxyData.openExpanded ? 0 : contentHeight;
101
- if (parent.props.icon && !proxyData.openExpanded) {
102
- proxyData.iconStyle["transform"] = "rotate(0deg)";
103
- } else {
104
- proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
108
+ nextTick(() => {
109
+ const query = Taro.createSelectorQuery();
110
+ query.selectAll(".collapse-content").boundingClientRect();
111
+ query.exec((res) => {
112
+ getH(res[0]);
113
+ });
114
+ if (!proxyData.openExpanded) {
115
+ onTransitionEnd();
105
116
  }
106
- }
107
- if (!proxyData.openExpanded) {
108
- onTransitionEnd();
109
- }
117
+ });
110
118
  };
111
119
  const open = () => {
112
120
  proxyData.openExpanded = !proxyData.openExpanded;
@@ -121,7 +129,7 @@ const _sfc_main = create({
121
129
  const currentName = computed(() => props.name);
122
130
  const toggleOpen = () => {
123
131
  if (parent.props.accordion) {
124
- parent.children.forEach((item, index2) => {
132
+ parent.children.forEach((item, index) => {
125
133
  if (currentName.value == item.name) {
126
134
  item.changeOpen(!item.openExpanded);
127
135
  } else {
@@ -152,9 +160,45 @@ const _sfc_main = create({
152
160
  proxyData.openExpanded = true;
153
161
  }
154
162
  });
163
+ const getH = (list) => {
164
+ parent.children.forEach((item1, index1) => {
165
+ let ary = Array.from(item1.$el.children);
166
+ let _uid = ary[1].children[0]["uid"];
167
+ let tm = list.filter((item2) => item2.id == _uid);
168
+ if (tm && tm.length > 0) {
169
+ let h = tm[0]["height"];
170
+ item1.conHeight = h;
171
+ }
172
+ });
173
+ };
174
+ const getH5 = () => {
175
+ parent.children.forEach((item1, index1) => {
176
+ let ary = Array.from(item1.$el.children);
177
+ let h = ary[1].children[0]["offsetHeight"];
178
+ item1.conHeight = h;
179
+ });
180
+ };
181
+ const getRefHeight = () => {
182
+ const query = Taro.createSelectorQuery();
183
+ query.selectAll(".collapse-content").boundingClientRect();
184
+ query.exec((res) => {
185
+ if (Taro.getEnv() === "WEB") {
186
+ getH5();
187
+ } else {
188
+ getH(res[0]);
189
+ }
190
+ });
191
+ };
155
192
  onMounted(() => {
156
193
  const { name } = props;
157
194
  const active = parent && parent.props.active;
195
+ if (Taro.getEnv() === "WEB") {
196
+ getRefHeight();
197
+ } else {
198
+ eventCenter.once(getCurrentInstance$1().router.onReady, () => {
199
+ getRefHeight();
200
+ });
201
+ }
158
202
  if (typeof active == "number" || typeof active == "string") {
159
203
  if (name == active) {
160
204
  defaultOpen();
@@ -169,6 +213,7 @@ const _sfc_main = create({
169
213
  return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
170
214
  classes
171
215
  }, toRefs(proxyData)), toRefs(parent.props)), toRefs(titleIconStyle)), {
216
+ conHeight,
172
217
  wrapperRef,
173
218
  contentRef,
174
219
  open,
@@ -187,10 +232,6 @@ const _hoisted_4 = {
187
232
  };
188
233
  const _hoisted_5 = ["innerHTML"];
189
234
  const _hoisted_6 = {
190
- class: "collapse-wrapper",
191
- ref: "wrapperRef"
192
- };
193
- const _hoisted_7 = {
194
235
  class: "collapse-content",
195
236
  ref: "contentRef"
196
237
  };
@@ -211,7 +252,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
211
252
  name: _ctx.titleIcon,
212
253
  size: _ctx.titleIconSize,
213
254
  color: _ctx.titleIconColor,
214
- class: normalizeClass([_ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
255
+ class: normalizeClass(["collapse-title-icon", _ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
215
256
  }, null, 8, ["name", "size", "color", "class"])) : createCommentVNode("", true),
216
257
  _ctx.$slots.mTitle ? renderSlot(_ctx.$slots, "mTitle", { key: 1 }) : (openBlock(), createElementBlock("view", {
217
258
  key: 2,
@@ -237,12 +278,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
237
278
  style: normalizeStyle(_ctx.iconStyle)
238
279
  }, null, 8, ["name", "size", "color", "class", "style"])) : createCommentVNode("", true)
239
280
  ], 2),
240
- createElementVNode("view", _hoisted_6, [
241
- createElementVNode("view", _hoisted_7, [
281
+ createElementVNode("view", {
282
+ class: normalizeClass(["collapse-wrapper", _ctx.openExpanded ? "open-style" : "close-style"]),
283
+ ref: "wrapperRef",
284
+ style: normalizeStyle({ height: _ctx.openExpanded ? _ctx.conHeight + "px" : 0 })
285
+ }, [
286
+ createElementVNode("view", _hoisted_6, [
242
287
  renderSlot(_ctx.$slots, "default")
243
288
  ], 512)
244
- ], 512)
289
+ ], 6)
245
290
  ], 2);
246
291
  }
247
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
248
- export { index as default };
292
+ _sfc_main.render = _sfc_render;
293
+ export { _sfc_main as default };
@@ -17,16 +17,18 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __require = typeof require !== "undefined" ? require : (x) => {
21
+ throw new Error('Dynamic require of "' + x + '" is not supported');
22
+ };
20
23
  /*!
21
- * @nutui/nutui v3.1.12-beta.0 Mon Nov 22 2021 20:58:07 GMT+0800 (中国标准时间)
24
+ * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
22
25
  * (c) 2021 @jdf2e.
23
26
  * Released under the MIT License.
24
27
  */
25
28
  import { reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, toDisplayString, Fragment, createElementVNode, createCommentVNode } from "vue";
26
29
  import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
30
  const { componentName, create } = createComponent("countdown");
29
- const _sfc_main = create({
31
+ var _sfc_main = create({
30
32
  props: {
31
33
  modelValue: {
32
34
  type: Object,
@@ -220,5 +222,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
220
222
  ], 64))
221
223
  ], 2);
222
224
  }
223
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
224
- export { index as default };
225
+ _sfc_main.render = _sfc_render;
226
+ export { _sfc_main as default };