@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,20 +1,19 @@
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 { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, normalizeStyle, withDirectives, createVNode, vShow } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
8
  function trimExtraChar(value, char, regExp) {
10
- const index2 = value.indexOf(char);
11
- if (index2 === -1) {
9
+ const index = value.indexOf(char);
10
+ if (index === -1) {
12
11
  return value;
13
12
  }
14
- if (char === "-" && index2 !== 0) {
15
- return value.slice(0, index2);
13
+ if (char === "-" && index !== 0) {
14
+ return value.slice(0, index);
16
15
  }
17
- return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
16
+ return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
18
17
  }
19
18
  function formatNumber(value, allowDot = true, allowMinus = true) {
20
19
  if (allowDot) {
@@ -31,7 +30,7 @@ function formatNumber(value, allowDot = true, allowMinus = true) {
31
30
  return value.replace(regExp, "");
32
31
  }
33
32
  const { componentName, create } = createComponent("input");
34
- const _sfc_main = create({
33
+ var _sfc_main = create({
35
34
  props: {
36
35
  type: {
37
36
  type: String,
@@ -67,7 +66,7 @@ const _sfc_main = create({
67
66
  },
68
67
  maxLength: {
69
68
  type: [String, Number],
70
- default: ""
69
+ default: "99999999"
71
70
  },
72
71
  clearable: {
73
72
  type: Boolean,
@@ -93,15 +92,15 @@ const _sfc_main = create({
93
92
  const valueChange = (event) => {
94
93
  const input = event.target;
95
94
  let val = input.value;
95
+ if (props.maxLength && val.length > Number(props.maxLength)) {
96
+ val = val.slice(0, Number(props.maxLength));
97
+ }
96
98
  if (props.type === "digit") {
97
99
  val = formatNumber(val, true);
98
100
  }
99
101
  if (props.type === "number") {
100
102
  val = formatNumber(val, false);
101
103
  }
102
- if (props.maxLength && val.length > Number(props.maxLength)) {
103
- val = val.slice(0, Number(props.maxLength));
104
- }
105
104
  emit("update:modelValue", val, event);
106
105
  emit("change", val, event);
107
106
  };
@@ -117,9 +116,6 @@ const _sfc_main = create({
117
116
  }, 0);
118
117
  const input = event.target;
119
118
  let value = input.value;
120
- if (props.maxLength && value.length > Number(props.maxLength)) {
121
- value = value.slice(0, Number(props.maxLength));
122
- }
123
119
  emit("blur", value, event);
124
120
  };
125
121
  const handleClear = (event) => {
@@ -143,7 +139,11 @@ const _hoisted_2 = {
143
139
  key: 0,
144
140
  class: "label-string"
145
141
  };
146
- const _hoisted_3 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value"];
142
+ const _hoisted_3 = {
143
+ key: 0,
144
+ class: "input-text"
145
+ };
146
+ const _hoisted_4 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value"];
147
147
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
148
148
  const _component_nut_icon = resolveComponent("nut-icon");
149
149
  return openBlock(), createElementBlock("view", {
@@ -152,7 +152,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
152
152
  createElementVNode("view", _hoisted_1, [
153
153
  _ctx.label ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.label), 1)) : createCommentVNode("", true)
154
154
  ]),
155
- createElementVNode("input", {
155
+ _ctx.readonly ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.modelValue), 1)) : (openBlock(), createElementBlock("input", {
156
+ key: 1,
156
157
  class: "input-text",
157
158
  style: normalizeStyle(_ctx.styles),
158
159
  type: _ctx.type,
@@ -164,9 +165,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
164
165
  onInput: _cache[0] || (_cache[0] = (...args) => _ctx.valueChange && _ctx.valueChange(...args)),
165
166
  onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.valueFocus && _ctx.valueFocus(...args)),
166
167
  onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.valueBlur && _ctx.valueBlur(...args))
167
- }, null, 44, _hoisted_3),
168
+ }, null, 44, _hoisted_4)),
168
169
  _ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", {
169
- key: 0,
170
+ key: 2,
170
171
  onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClear && _ctx.handleClear(...args)),
171
172
  class: "nut-textinput-clear"
172
173
  }, [
@@ -179,5 +180,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
179
180
  ]) : createCommentVNode("", true)
180
181
  ], 2);
181
182
  }
182
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
183
- export { index as default };
183
+ _sfc_main.render = _sfc_render;
184
+ export { _sfc_main as default };
@@ -1,14 +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, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, createElementVNode } from "vue";
6
+ import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, toDisplayString } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import { p as pxCheck } from "./pxCheck.js";
9
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
9
  const { componentName, create } = createComponent("inputnumber");
11
- const _sfc_main = create({
10
+ var _sfc_main = create({
12
11
  props: {
13
12
  modelValue: {
14
13
  type: [Number, String],
@@ -61,7 +60,7 @@ const _sfc_main = create({
61
60
  };
62
61
  const change = (event) => {
63
62
  const input = event.target;
64
- emit("update:modelValue", input.valueAsNumber, event);
63
+ emit("update:modelValue", input.value, event);
65
64
  };
66
65
  const emitChange = (value, event) => {
67
66
  let output_value = fixedDecimalPlaces(value);
@@ -92,20 +91,13 @@ const _sfc_main = create({
92
91
  emit("overlimit", event, "add");
93
92
  }
94
93
  };
95
- const focus = (event) => {
96
- if (props.disabled)
97
- return;
98
- if (props.readonly)
99
- return;
100
- emit("focus", event);
101
- };
102
94
  const blur = (event) => {
103
95
  if (props.disabled)
104
96
  return;
105
97
  if (props.readonly)
106
98
  return;
107
99
  const input = event.target;
108
- let value = input.valueAsNumber;
100
+ let value = +input.value;
109
101
  if (value < Number(props.min)) {
110
102
  value = Number(props.min);
111
103
  } else if (value > Number(props.max)) {
@@ -114,6 +106,15 @@ const _sfc_main = create({
114
106
  emitChange(value, event);
115
107
  emit("blur", event);
116
108
  };
109
+ const focus = (event) => {
110
+ if (props.disabled)
111
+ return;
112
+ if (props.readonly) {
113
+ blur(event);
114
+ return;
115
+ }
116
+ emit("focus", event);
117
+ };
117
118
  return {
118
119
  classes,
119
120
  change,
@@ -127,7 +128,11 @@ const _sfc_main = create({
127
128
  };
128
129
  }
129
130
  });
130
- const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
131
+ const _hoisted_1 = {
132
+ key: 0,
133
+ class: "nut-inputnumber__text--readonly"
134
+ };
135
+ const _hoisted_2 = ["min", "max", "disabled", "readonly", "value"];
131
136
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
132
137
  const _component_nut_icon = resolveComponent("nut-icon");
133
138
  return openBlock(), createElementBlock("view", {
@@ -140,7 +145,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
140
145
  size: _ctx.buttonSize,
141
146
  onClick: _ctx.reduce
142
147
  }, null, 8, ["class", "size", "onClick"]),
143
- createElementVNode("input", {
148
+ _ctx.readonly ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.modelValue), 1)) : (openBlock(), createElementBlock("input", {
149
+ key: 1,
144
150
  type: "number",
145
151
  min: _ctx.min,
146
152
  max: _ctx.max,
@@ -151,7 +157,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
151
157
  onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
152
158
  onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
153
159
  onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
154
- }, null, 44, _hoisted_1),
160
+ }, null, 44, _hoisted_2)),
155
161
  createVNode(_component_nut_icon, {
156
162
  name: "plus",
157
163
  class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.addAllow() }]),
@@ -160,5 +166,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
160
166
  }, null, 8, ["class", "size", "onClick"])
161
167
  ], 6);
162
168
  }
163
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
164
- export { index as default };
169
+ _sfc_main.render = _sfc_render;
170
+ export { _sfc_main as default };
@@ -1,10 +1,10 @@
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 { c as createComponent } from "./component.js";
7
7
  import "vue";
8
8
  const { create } = createComponent("layout");
9
- const _sfc_main = create({});
9
+ var _sfc_main = create({});
10
10
  export { _sfc_main as default };
@@ -1,14 +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
6
  import { ref, computed, reactive, provide, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString, createVNode, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { u as useRect } from "./index2.js";
9
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
8
+ import Taro from "@tarojs/taro";
10
9
  const { componentName, create } = createComponent("menu");
11
- const _sfc_main = create({
10
+ var _sfc_main = create({
12
11
  props: {
13
12
  activeColor: {
14
13
  type: String,
@@ -20,7 +19,7 @@ const _sfc_main = create({
20
19
  },
21
20
  duration: {
22
21
  type: [Number, String],
23
- default: 0
22
+ default: 0.3
24
23
  }
25
24
  },
26
25
  setup(props, { emit, slots }) {
@@ -57,14 +56,17 @@ const _sfc_main = create({
57
56
  });
58
57
  const updateOffset = () => {
59
58
  if (barRef.value) {
60
- const rect = useRect(barRef);
61
- offset.value = rect.bottom;
59
+ setTimeout(() => {
60
+ Taro.createSelectorQuery().select(".nut-menu__bar.opened").boundingClientRect((rect) => {
61
+ offset.value = rect.bottom;
62
+ }).exec();
63
+ }, 100);
62
64
  }
63
65
  };
64
66
  linkChildren({ props, offset });
65
67
  const toggleItem = (active) => {
66
- children.forEach((item, index2) => {
67
- if (index2 === active) {
68
+ children.forEach((item, index) => {
69
+ if (index === active) {
68
70
  updateOffset();
69
71
  item.toggle();
70
72
  } else if (item.state.showPopup) {
@@ -92,11 +94,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
92
94
  class: normalizeClass(["nut-menu__bar", { opened: _ctx.opened }]),
93
95
  ref: "barRef"
94
96
  }, [
95
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item, index2) => {
97
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item, index) => {
96
98
  return openBlock(), createElementBlock("view", {
97
- key: index2,
99
+ key: index,
98
100
  class: normalizeClass(["nut-menu__item", { disabled: item.disabled }]),
99
- onClick: ($event) => !item.disabled && _ctx.toggleItem(index2),
101
+ onClick: ($event) => !item.disabled && _ctx.toggleItem(index),
100
102
  style: normalizeStyle({ color: item.state.showPopup ? _ctx.activeColor : "" })
101
103
  }, [
102
104
  createElementVNode("view", {
@@ -115,5 +117,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
115
117
  renderSlot(_ctx.$slots, "default")
116
118
  ], 2);
117
119
  }
118
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
119
- export { index as default };
120
+ _sfc_main.render = _sfc_render;
121
+ export { _sfc_main as default };
@@ -1,17 +1,15 @@
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 { reactive, computed, inject, getCurrentInstance, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, vShow, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import _sfc_main$1 from "./Icon.js";
9
- import Popup from "./Popup.js";
10
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
8
+ import { _ as _sfc_main$1, a as _sfc_main$2 } from "./index3.js";
9
+ import "./use-lock-scroll.js";
11
10
  import "./pxCheck.js";
12
- import "./OverLay.js";
13
11
  const { componentName, create } = createComponent("menu-item");
14
- const _sfc_main = create({
12
+ var _sfc_main = create({
15
13
  props: {
16
14
  title: String,
17
15
  options: {
@@ -34,7 +32,7 @@ const _sfc_main = create({
34
32
  },
35
33
  components: {
36
34
  [_sfc_main$1.name]: _sfc_main$1,
37
- [Popup.name]: Popup
35
+ [_sfc_main$2.name]: _sfc_main$2
38
36
  },
39
37
  emits: ["update:modelValue", "change"],
40
38
  setup(props, { emit, slots }) {
@@ -138,9 +136,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
138
136
  }), {
139
137
  default: withCtx(() => [
140
138
  createElementVNode("view", _hoisted_1, [
141
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index2) => {
139
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
142
140
  return openBlock(), createElementBlock("view", {
143
- key: index2,
141
+ key: index,
144
142
  class: normalizeClass(["nut-menu-item__option", { active: option.value === _ctx.modelValue }]),
145
143
  style: normalizeStyle({ "flex-basis": 100 / _ctx.cols + "%" }),
146
144
  onClick: ($event) => _ctx.onClick(option)
@@ -164,5 +162,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
164
162
  [vShow, _ctx.state.showWrapper]
165
163
  ]);
166
164
  }
167
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
168
- export { index as default };
165
+ _sfc_main.render = _sfc_render;
166
+ 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 { ref, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, toDisplayString, Fragment, renderList, 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("navbar");
10
- const _sfc_main = create({
9
+ var _sfc_main = create({
11
10
  props: {
12
11
  leftShow: { type: Boolean, default: true },
13
12
  title: { type: String, default: "" },
@@ -109,6 +108,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
109
108
  }, [
110
109
  _ctx.title ? (openBlock(), createElementBlock("view", {
111
110
  key: 0,
111
+ class: "text__title",
112
112
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
113
113
  }, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
114
114
  _ctx.titIcon ? (openBlock(), createBlock(_component_nut_icon, {
@@ -118,11 +118,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
118
118
  onClick: _ctx.handleCenterIcon
119
119
  }, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
120
120
  createElementVNode("view", _hoisted_2, [
121
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tabs, (item, index2) => {
121
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tabs, (item, index) => {
122
122
  return openBlock(), createElementBlock("view", {
123
123
  class: normalizeClass([
124
124
  "tab-title-box",
125
- { "nut-tab-active": _ctx.activeIndex == item.id || _ctx.activeIndex == index2 }
125
+ { "nut-tab-active": _ctx.activeIndex == item.id || _ctx.activeIndex == index }
126
126
  ]),
127
127
  onClick: ($event) => _ctx.switchTitle(item.id, item.name),
128
128
  key: item.id
@@ -156,5 +156,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
156
156
  ], 2)) : createCommentVNode("", true)
157
157
  ], 2);
158
158
  }
159
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
160
- export { index as default };
159
+ _sfc_main.render = _sfc_render;
160
+ 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
28
  import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, createBlock, createCommentVNode, createElementVNode, renderSlot, createTextVNode, toDisplayString, withModifiers, createVNode, vShow, Fragment, renderList } from "vue";
26
29
  import { c as createComponent } from "./component.js";
27
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
+ import Taro from "@tarojs/taro";
28
31
  const { componentName, create } = createComponent("noticebar");
29
- const _sfc_main = create({
32
+ var _sfc_main = create({
30
33
  props: {
31
34
  direction: {
32
35
  type: String,
@@ -65,11 +68,11 @@ const _sfc_main = create({
65
68
  leftIcon: { type: String, default: "" },
66
69
  color: {
67
70
  type: String,
68
- default: ""
71
+ default: "#F9911B"
69
72
  },
70
73
  background: {
71
74
  type: String,
72
- default: ""
75
+ default: "rgba(254,250,216,1)"
73
76
  },
74
77
  delay: {
75
78
  type: [String, Number],
@@ -122,9 +125,10 @@ const _sfc_main = create({
122
125
  }
123
126
  });
124
127
  const barStyle = computed(() => {
125
- let style = {};
126
- props.color && (style.color = props.color);
127
- props.background && (style.background = props.background);
128
+ let style = {
129
+ color: props.color,
130
+ background: props.background
131
+ };
128
132
  if (props.direction == "vertical") {
129
133
  style.height = `${props.height}px`;
130
134
  }
@@ -174,17 +178,25 @@ const _sfc_main = create({
174
178
  if (!wrap.value || !content.value) {
175
179
  return;
176
180
  }
177
- const wrapWidth = wrap.value.getBoundingClientRect().width;
178
- const offsetWidth = content.value.getBoundingClientRect().width;
179
- if (props.scrollable && offsetWidth > wrapWidth) {
180
- state.wrapWidth = wrapWidth;
181
- state.offsetWidth = offsetWidth;
182
- state.duration = offsetWidth / props.speed;
183
- state.animationClass = "play";
184
- } else {
185
- state.animationClass = "";
186
- }
187
- });
181
+ let wrapWidth = 0;
182
+ let offsetWidth = 0;
183
+ Taro.createSelectorQuery().select(".wrap").boundingClientRect((rect) => {
184
+ if (rect.width > 0)
185
+ wrapWidth = rect.width;
186
+ }).exec();
187
+ Taro.createSelectorQuery().select(`.content`).boundingClientRect((rect) => {
188
+ if (rect.width > 0)
189
+ offsetWidth = rect.width;
190
+ if (props.scrollable && offsetWidth > wrapWidth) {
191
+ state.wrapWidth = wrapWidth;
192
+ state.offsetWidth = offsetWidth;
193
+ state.duration = offsetWidth / props.speed;
194
+ state.animationClass = "play";
195
+ } else {
196
+ state.animationClass = "";
197
+ }
198
+ }).exec();
199
+ }, 100);
188
200
  };
189
201
  const handleClick = (event) => {
190
202
  emit("click", event);
@@ -323,7 +335,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
323
335
  onWebkitAnimationEnd: _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
324
336
  }, [
325
337
  renderSlot(_ctx.$slots, "default", {}, () => [
326
- createTextVNode("1" + toDisplayString(_ctx.text), 1)
338
+ createTextVNode(toDisplayString(_ctx.text), 1)
327
339
  ])
328
340
  ], 38)
329
341
  ], 512),
@@ -334,6 +346,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
334
346
  }, [
335
347
  createVNode(_component_nut_icon, {
336
348
  name: "close",
349
+ size: "11",
337
350
  color: _ctx.color
338
351
  }, null, 8, ["color"])
339
352
  ])) : createCommentVNode("", true)
@@ -350,9 +363,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
350
363
  class: "horseLamp_list",
351
364
  style: normalizeStyle(_ctx.horseLampStyle)
352
365
  }, [
353
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
366
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index) => {
354
367
  return openBlock(), createBlock(_component_ScrollItem, {
355
- key: index2,
368
+ key: index,
356
369
  style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
357
370
  item
358
371
  }, null, 8, ["style", "item"]);
@@ -362,10 +375,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
362
375
  class: "horseLamp_list",
363
376
  style: normalizeStyle(_ctx.horseLampStyle)
364
377
  }, [
365
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
378
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index) => {
366
379
  return openBlock(), createElementBlock("li", {
367
380
  class: "horseLamp_list_item",
368
- key: index2,
381
+ key: index,
369
382
  style: normalizeStyle({ height: _ctx.height }),
370
383
  onClick: ($event) => _ctx.go(item)
371
384
  }, toDisplayString(item), 13, _hoisted_2);
@@ -385,5 +398,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
385
398
  ], 4)) : createCommentVNode("", true)
386
399
  ], 2);
387
400
  }
388
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
389
- export { index as default };
401
+ _sfc_main.render = _sfc_render;
402
+ export { _sfc_main as default };