@nutui/nutui 3.1.6 → 3.1.7

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 (92) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/nutui.d.ts +7 -1
  3. package/dist/nutui.es.js +1097 -517
  4. package/dist/nutui.umd.js +1158 -571
  5. package/dist/packages/_es/ActionSheet.js +158 -0
  6. package/dist/packages/_es/Address.js +525 -0
  7. package/dist/packages/_es/Avatar.js +87 -0
  8. package/dist/packages/_es/BackTop.js +159 -0
  9. package/dist/packages/_es/Badge.js +90 -0
  10. package/dist/packages/_es/Barrage.js +118 -0
  11. package/dist/packages/_es/Button.js +124 -0
  12. package/dist/packages/_es/Calendar.js +700 -0
  13. package/dist/packages/_es/Cell.js +95 -0
  14. package/dist/packages/_es/CellGroup.js +42 -0
  15. package/dist/packages/_es/Checkbox.js +109 -0
  16. package/dist/packages/_es/CheckboxGroup.js +62 -0
  17. package/dist/packages/_es/CircleProgress.js +109 -0
  18. package/dist/packages/_es/Col.js +53 -0
  19. package/dist/packages/_es/Collapse.js +89 -0
  20. package/dist/packages/_es/CollapseItem.js +257 -0
  21. package/dist/packages/_es/CountDown.js +224 -0
  22. package/dist/packages/_es/CountUp.js +547 -0
  23. package/dist/packages/_es/DatePicker.js +282 -0
  24. package/dist/packages/_es/Dialog.js +313 -0
  25. package/dist/packages/_es/Divider.js +49 -0
  26. package/dist/packages/_es/Drag.js +198 -0
  27. package/dist/packages/_es/Elevator.js +207 -0
  28. package/dist/packages/_es/FixedNav.js +127 -0
  29. package/dist/packages/_es/Icon.js +44 -0
  30. package/dist/packages/_es/ImagePreview.js +109 -0
  31. package/dist/packages/_es/InfiniteLoading.js +265 -0
  32. package/dist/packages/_es/Input.js +183 -0
  33. package/dist/packages/_es/InputNumber.js +172 -0
  34. package/dist/packages/_es/Layout.js +10 -0
  35. package/dist/packages/_es/MenuItem.js +180 -0
  36. package/dist/packages/_es/Navbar.js +160 -0
  37. package/dist/packages/_es/NoticeBar.js +389 -0
  38. package/dist/packages/_es/Notify.js +233 -0
  39. package/dist/packages/_es/NumberKeyboard.js +248 -0
  40. package/dist/packages/_es/OverLay.js +118 -0
  41. package/dist/packages/_es/Pagination.js +163 -0
  42. package/dist/packages/_es/Picker.js +485 -0
  43. package/dist/packages/_es/Popover.js +157 -0
  44. package/dist/packages/_es/Popup.js +268 -0
  45. package/dist/packages/_es/Price.js +104 -0
  46. package/dist/packages/_es/Progress.js +131 -0
  47. package/dist/packages/_es/Radio.js +72 -0
  48. package/dist/packages/_es/RadioGroup.js +37 -0
  49. package/dist/packages/_es/Range.js +350 -0
  50. package/dist/packages/_es/Rate.js +129 -0
  51. package/dist/packages/_es/Row.js +61 -0
  52. package/dist/packages/_es/ShortPassword.js +221 -0
  53. package/dist/packages/_es/Signature.js +167 -0
  54. package/dist/packages/_es/Step.js +116 -0
  55. package/dist/packages/_es/Steps.js +52 -0
  56. package/dist/packages/_es/Swipe.js +193 -0
  57. package/dist/packages/_es/Swiper.js +429 -0
  58. package/dist/packages/_es/SwiperItem.js +60 -0
  59. package/dist/packages/_es/Switch.js +90 -0
  60. package/dist/packages/_es/Tab.js +179 -0
  61. package/dist/packages/_es/TabPane.js +42 -0
  62. package/dist/packages/_es/TabPanel.js +30 -0
  63. package/dist/packages/_es/Tabbar.js +73 -0
  64. package/dist/packages/_es/TabbarItem.js +142 -0
  65. package/dist/packages/_es/Tag.js +98 -0
  66. package/dist/packages/_es/TextArea.js +127 -0
  67. package/dist/packages/_es/Toast.js +317 -0
  68. package/dist/packages/_es/Uploader.js +400 -0
  69. package/dist/packages/_es/Video.js +405 -0
  70. package/dist/packages/_es/component.js +26 -0
  71. package/dist/packages/_es/index.js +64 -0
  72. package/dist/packages/_es/index2.js +13 -0
  73. package/dist/packages/_es/plugin-vue_export-helper.js +12 -0
  74. package/dist/packages/_es/pxCheck.js +9 -0
  75. package/dist/packages/_es/raf.js +19 -0
  76. package/dist/packages/avatar/index.scss +0 -1
  77. package/dist/packages/badge/index.scss +35 -0
  78. package/dist/packages/calendar/index.scss +13 -0
  79. package/dist/packages/imagepreview/index.scss +48 -0
  80. package/dist/packages/input/index.scss +14 -7
  81. package/dist/packages/pagination/index.scss +51 -0
  82. package/dist/packages/popover/index.scss +159 -0
  83. package/dist/packages/shortpassword/index.scss +19 -7
  84. package/dist/packages/tabpane/index.scss +1 -0
  85. package/dist/packages/tabs/index.scss +1 -0
  86. package/dist/packages/tag/index.scss +47 -0
  87. package/dist/packages/uploader/index.scss +0 -1
  88. package/dist/style.css +1 -1
  89. package/dist/style.es.js +2 -1
  90. package/dist/styles/themes/default.scss +35 -28
  91. package/dist/styles/variables.scss +55 -32
  92. package/package.json +7 -7
@@ -0,0 +1,198 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { r as requestAniFrame } from "./raf.js";
9
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
+ const { componentName, create } = createComponent("drag");
11
+ const _sfc_main = create({
12
+ props: {
13
+ attract: {
14
+ type: Boolean,
15
+ default: false
16
+ },
17
+ direction: {
18
+ type: String,
19
+ default: "all"
20
+ },
21
+ boundary: {
22
+ type: Object,
23
+ default: () => {
24
+ return {
25
+ top: 0,
26
+ left: 0,
27
+ right: 0,
28
+ bottom: 0
29
+ };
30
+ }
31
+ }
32
+ },
33
+ setup(props, { emit }) {
34
+ const myDrag = ref();
35
+ const state = reactive({
36
+ keepAlive: false,
37
+ elWidth: 0,
38
+ elHeight: 0,
39
+ screenWidth: 0,
40
+ screenHeight: 0,
41
+ startTop: 0,
42
+ startLeft: 0,
43
+ nx: 0,
44
+ ny: 0,
45
+ xPum: 0,
46
+ yPum: 0,
47
+ position: { x: 0, y: 0 },
48
+ boundary: {
49
+ top: 0,
50
+ left: 0,
51
+ right: 0,
52
+ bottom: 0
53
+ }
54
+ });
55
+ const classes = computed(() => {
56
+ const prefixCls = componentName;
57
+ return {
58
+ [prefixCls]: true
59
+ };
60
+ });
61
+ function getInfo() {
62
+ const domElem = document.documentElement;
63
+ state.elWidth = myDrag.value.offsetWidth;
64
+ state.elHeight = myDrag.value.offsetHeight;
65
+ state.screenWidth = domElem.clientWidth;
66
+ state.screenHeight = domElem.clientHeight;
67
+ }
68
+ function goLeft(target) {
69
+ if (state.boundary.left) {
70
+ if (+target.style.left.split("px")[0] > state.boundary.left) {
71
+ target.style.left = +target.style.left.split("px")[0] - 10 + "px";
72
+ requestAniFrame(() => {
73
+ goLeft(target);
74
+ });
75
+ } else {
76
+ target.style.left = `${state.boundary.left}px`;
77
+ }
78
+ } else {
79
+ if (+target.style.left.split("px")[0] > 10) {
80
+ target.style.left = +target.style.left.split("px")[0] - 10 + "px";
81
+ requestAniFrame(() => {
82
+ goLeft(target);
83
+ });
84
+ } else {
85
+ target.style.left = "0px";
86
+ }
87
+ }
88
+ }
89
+ function goRight(target, rightLocation) {
90
+ if (rightLocation - parseInt(target.style.left.split("px")[0]) > 10) {
91
+ target.style.left = parseInt(target.style.left.split("px")[0]) + 10 + "px";
92
+ requestAniFrame(() => {
93
+ goRight(target, rightLocation);
94
+ });
95
+ } else {
96
+ target.style.left = rightLocation + "px";
97
+ }
98
+ }
99
+ function touchMove(e) {
100
+ e.preventDefault();
101
+ const target = e.currentTarget;
102
+ if (e.targetTouches.length === 1) {
103
+ const touch = e.targetTouches[0];
104
+ state.nx = touch.clientX - state.position.x;
105
+ state.ny = touch.clientY - state.position.y;
106
+ state.xPum = state.startLeft + state.nx;
107
+ state.yPum = state.startTop + state.ny;
108
+ const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
109
+ if (Math.abs(state.xPum) > rightLocation) {
110
+ state.xPum = rightLocation;
111
+ } else if (state.xPum <= state.boundary.left) {
112
+ state.xPum = state.boundary.left;
113
+ }
114
+ if (state.yPum < state.boundary.top) {
115
+ state.yPum = state.boundary.top;
116
+ } else if (state.yPum > state.screenHeight - state.elHeight - state.boundary.bottom) {
117
+ state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
118
+ }
119
+ if (props.direction != "y") {
120
+ target.style.left = state.xPum + "px";
121
+ }
122
+ if (props.direction != "x") {
123
+ target.style.top = state.yPum + "px";
124
+ }
125
+ }
126
+ }
127
+ function touchEnd(e) {
128
+ const target = e.currentTarget;
129
+ const touch = e.changedTouches[0];
130
+ let currX = touch.clientX;
131
+ const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
132
+ if (currX > rightLocation) {
133
+ currX = rightLocation;
134
+ } else if (currX < state.boundary.left) {
135
+ currX = state.boundary.left;
136
+ } else {
137
+ currX = currX < state.screenWidth / 2 ? state.boundary.left : rightLocation;
138
+ }
139
+ if (props.direction != "y" && props.attract) {
140
+ if (currX < state.screenWidth / 2) {
141
+ requestAniFrame(() => {
142
+ goLeft(target);
143
+ });
144
+ } else {
145
+ requestAniFrame(() => {
146
+ goRight(target, rightLocation);
147
+ });
148
+ }
149
+ }
150
+ if (props.direction !== "x") {
151
+ target.style.top = state.yPum + "px";
152
+ }
153
+ }
154
+ function touchStart(e) {
155
+ const target = e.currentTarget;
156
+ const touches = e.touches[0];
157
+ state.startTop = target.offsetTop;
158
+ state.startLeft = target.offsetLeft;
159
+ state.position.x = touches.clientX;
160
+ state.position.y = touches.clientY;
161
+ }
162
+ onMounted(() => {
163
+ getInfo();
164
+ state.boundary = props.boundary;
165
+ });
166
+ onActivated(() => {
167
+ if (state.keepAlive) {
168
+ state.keepAlive = false;
169
+ }
170
+ });
171
+ onDeactivated(() => {
172
+ state.keepAlive = true;
173
+ myDrag.removeEventListener("touchstart", touchStart);
174
+ myDrag.removeEventListener("touchmove", touchMove);
175
+ myDrag.removeEventListener("touchend", touchEnd);
176
+ });
177
+ return {
178
+ classes,
179
+ myDrag,
180
+ touchStart,
181
+ touchMove,
182
+ touchEnd
183
+ };
184
+ }
185
+ });
186
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
187
+ return openBlock(), createElementBlock("view", {
188
+ class: normalizeClass(_ctx.classes),
189
+ ref: "myDrag",
190
+ onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
191
+ onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
192
+ onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
193
+ }, [
194
+ renderSlot(_ctx.$slots, "default")
195
+ ], 34);
196
+ }
197
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
198
+ export { index as default };
@@ -0,0 +1,207 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ /*!
21
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
22
+ * (c) 2021 @jdf2e.
23
+ * Released under the MIT License.
24
+ */
25
+ import { ref, reactive, computed, toRefs, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
26
+ import { c as createComponent } from "./component.js";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
+ const { componentName, create } = createComponent("elevator");
29
+ const _sfc_main = create({
30
+ props: {
31
+ height: {
32
+ type: [Number, String],
33
+ default: "200px"
34
+ },
35
+ acceptKey: {
36
+ type: [String],
37
+ default: "title"
38
+ },
39
+ indexList: {
40
+ type: Array,
41
+ default: () => {
42
+ return [];
43
+ }
44
+ }
45
+ },
46
+ emits: ["click-item", "click-index"],
47
+ setup(props, context) {
48
+ const spaceHeight = 23;
49
+ const listview = ref(null);
50
+ const state = reactive({
51
+ anchorIndex: 0,
52
+ listHeight: [],
53
+ listGroup: [],
54
+ touchState: {
55
+ y1: 0,
56
+ y2: 0
57
+ },
58
+ scrollStart: false,
59
+ currentIndex: 0
60
+ });
61
+ const classes = computed(() => {
62
+ const prefixCls = componentName;
63
+ return {
64
+ [prefixCls]: true
65
+ };
66
+ });
67
+ const resetScrollState = () => {
68
+ state.anchorIndex = 0;
69
+ state.listHeight = [];
70
+ state.listGroup = [];
71
+ state.currentIndex = 0;
72
+ state.scrollStart = false;
73
+ state.touchState = {
74
+ y1: 0,
75
+ y2: 0
76
+ };
77
+ };
78
+ const getData = (el, name) => {
79
+ const prefix = "data-";
80
+ return el.getAttribute(prefix + name);
81
+ };
82
+ const setListGroup = (el) => {
83
+ nextTick(() => {
84
+ if (!state.listGroup.includes(el) && el != null) {
85
+ state.listGroup.push(el);
86
+ }
87
+ });
88
+ };
89
+ const calculateHeight = () => {
90
+ let height = 0;
91
+ state.listHeight.push(height);
92
+ for (let i = 0; i < state.listGroup.length; i++) {
93
+ let item = state.listGroup[i];
94
+ height += item.clientHeight;
95
+ state.listHeight.push(height);
96
+ }
97
+ };
98
+ const scrollTo = (index2) => {
99
+ if (!index2 && index2 !== 0) {
100
+ return;
101
+ }
102
+ if (!state.listHeight.length) {
103
+ calculateHeight();
104
+ }
105
+ if (index2 < 0)
106
+ index2 = 0;
107
+ if (index2 > state.listHeight.length - 2)
108
+ index2 = state.listHeight.length - 2;
109
+ state.currentIndex = index2;
110
+ listview.value.scrollTo(0, state.listHeight[index2]);
111
+ };
112
+ const touchStart = (e) => {
113
+ state.scrollStart = true;
114
+ let index2 = getData(e.target, "index");
115
+ let firstTouch = e.touches[0];
116
+ state.touchState.y1 = firstTouch.pageY;
117
+ state.anchorIndex = +index2;
118
+ state.currentIndex = +index2;
119
+ console.log(state.currentIndex);
120
+ scrollTo(+index2);
121
+ };
122
+ const touchMove = (e) => {
123
+ let firstTouch = e.touches[0];
124
+ state.touchState.y2 = firstTouch.pageY;
125
+ let delta = (state.touchState.y2 - state.touchState.y1) / spaceHeight | 0;
126
+ state.currentIndex = state.anchorIndex + delta;
127
+ scrollTo(state.currentIndex);
128
+ };
129
+ const touchEnd = () => {
130
+ resetScrollState();
131
+ };
132
+ const handleClickItem = (key, item) => {
133
+ context.emit("click-item", key, item);
134
+ };
135
+ const handleClickIndex = (key) => {
136
+ context.emit("click-index", key);
137
+ };
138
+ return __spreadProps(__spreadValues({
139
+ classes
140
+ }, toRefs(state)), {
141
+ setListGroup,
142
+ listview,
143
+ touchStart,
144
+ touchMove,
145
+ touchEnd,
146
+ handleClickItem,
147
+ handleClickIndex
148
+ });
149
+ }
150
+ });
151
+ const _hoisted_1 = { class: "nut-elevator__list__item__code" };
152
+ const _hoisted_2 = ["onClick"];
153
+ const _hoisted_3 = { class: "nut-elevator__bars__inner" };
154
+ const _hoisted_4 = ["data-index", "onClick"];
155
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
156
+ return openBlock(), createElementBlock("view", {
157
+ class: normalizeClass(_ctx.classes)
158
+ }, [
159
+ createElementVNode("view", {
160
+ class: "nut-elevator__list",
161
+ ref: "listview",
162
+ style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
163
+ }, [
164
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item) => {
165
+ return openBlock(), createElementBlock("view", {
166
+ class: "nut-elevator__list__item",
167
+ key: item[_ctx.acceptKey],
168
+ ref: _ctx.setListGroup
169
+ }, [
170
+ createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
171
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
172
+ return openBlock(), createElementBlock("view", {
173
+ class: "nut-elevator__list__item__name",
174
+ key: subitem["id"],
175
+ onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem)
176
+ }, toDisplayString(subitem.name), 9, _hoisted_2);
177
+ }), 128))
178
+ ], 512);
179
+ }), 128))
180
+ ], 4),
181
+ _ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
182
+ key: 0,
183
+ class: "nut-elevator__code--current"
184
+ }, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 513)), [
185
+ [vShow, _ctx.scrollStart]
186
+ ]) : createCommentVNode("", true),
187
+ createElementVNode("view", {
188
+ class: "nut-elevator__bars",
189
+ onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
190
+ onTouchmove: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.touchMove && _ctx.touchMove(...args), ["stop", "prevent"])),
191
+ onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
192
+ }, [
193
+ createElementVNode("view", _hoisted_3, [
194
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index2) => {
195
+ return openBlock(), createElementBlock("view", {
196
+ class: "nut-elevator__bars__inner__item",
197
+ "data-index": index2,
198
+ key: item[_ctx.acceptKey],
199
+ onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
200
+ }, toDisplayString(item[_ctx.acceptKey]), 9, _hoisted_4);
201
+ }), 128))
202
+ ])
203
+ ], 32)
204
+ ], 2);
205
+ }
206
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
207
+ export { index as default };
@@ -0,0 +1,127 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, renderSlot, createElementVNode, Fragment, renderList, toDisplayString, createVNode } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import overlay from "./OverLay.js";
9
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
+ const { componentName, create } = createComponent("fixednav");
11
+ const _sfc_main = create({
12
+ components: {
13
+ [overlay.name]: overlay
14
+ },
15
+ props: {
16
+ visible: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ overlay: {
21
+ type: Boolean,
22
+ default: true
23
+ },
24
+ navList: {
25
+ default: () => [],
26
+ type: Array
27
+ },
28
+ activeText: {
29
+ default: "\u6536\u8D77\u5BFC\u822A",
30
+ type: String
31
+ },
32
+ unActiveText: {
33
+ default: "\u5FEB\u901F\u5BFC\u822A",
34
+ type: String
35
+ },
36
+ position: {
37
+ default: () => {
38
+ return {
39
+ top: "auto",
40
+ bottom: "auto"
41
+ };
42
+ },
43
+ type: Object
44
+ },
45
+ type: {
46
+ default: "right",
47
+ type: String
48
+ }
49
+ },
50
+ components: {},
51
+ emits: ["update:visible", "selected"],
52
+ setup(props, { emit }) {
53
+ const classes = computed(() => {
54
+ const prefixCls = componentName;
55
+ return {
56
+ [prefixCls]: true,
57
+ active: props.visible,
58
+ [props.type]: true
59
+ };
60
+ });
61
+ const updateValue = (value = !props.visible) => {
62
+ emit("update:visible", value);
63
+ };
64
+ const selected = (item, event) => {
65
+ emit("selected", {
66
+ item,
67
+ event
68
+ });
69
+ };
70
+ return { classes, updateValue, selected };
71
+ }
72
+ });
73
+ const _hoisted_1 = { class: "nut-fixednav__list" };
74
+ const _hoisted_2 = ["onClick"];
75
+ const _hoisted_3 = ["src"];
76
+ const _hoisted_4 = { class: "span" };
77
+ const _hoisted_5 = {
78
+ key: 0,
79
+ class: "b"
80
+ };
81
+ const _hoisted_6 = { class: "text" };
82
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
83
+ const _component_nut_overlay = resolveComponent("nut-overlay");
84
+ const _component_nut_icon = resolveComponent("nut-icon");
85
+ return openBlock(), createElementBlock("view", {
86
+ class: normalizeClass(_ctx.classes),
87
+ style: normalizeStyle(_ctx.position)
88
+ }, [
89
+ _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
90
+ key: 0,
91
+ visible: _ctx.visible,
92
+ "z-index": 200,
93
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.updateValue(false))
94
+ }, null, 8, ["visible"])) : createCommentVNode("", true),
95
+ renderSlot(_ctx.$slots, "list", {}, () => [
96
+ createElementVNode("view", _hoisted_1, [
97
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.navList, (item, index2) => {
98
+ return openBlock(), createElementBlock("view", {
99
+ class: "nut-fixednav__list-item",
100
+ onClick: ($event) => _ctx.selected(item, $event),
101
+ key: item.id || index2
102
+ }, [
103
+ createElementVNode("img", {
104
+ src: item.icon
105
+ }, null, 8, _hoisted_3),
106
+ createElementVNode("view", _hoisted_4, toDisplayString(item.text), 1),
107
+ item.num ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(item.num), 1)) : createCommentVNode("", true)
108
+ ], 8, _hoisted_2);
109
+ }), 128))
110
+ ])
111
+ ]),
112
+ createElementVNode("div", {
113
+ class: "nut-fixednav__btn",
114
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.updateValue())
115
+ }, [
116
+ renderSlot(_ctx.$slots, "btn", {}, () => [
117
+ createVNode(_component_nut_icon, {
118
+ name: "left",
119
+ color: "#fff"
120
+ }),
121
+ createElementVNode("view", _hoisted_6, toDisplayString(_ctx.visible ? _ctx.activeText : _ctx.unActiveText), 1)
122
+ ])
123
+ ])
124
+ ], 6);
125
+ }
126
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
127
+ export { index as default };
@@ -0,0 +1,44 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { h } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { p as pxCheck } from "./pxCheck.js";
9
+ const { componentName, create } = createComponent("icon");
10
+ const _sfc_main = create({
11
+ props: {
12
+ name: { type: String, default: "" },
13
+ size: { type: [String, Number], default: "" },
14
+ classPrefix: { type: String, default: "nut-icon" },
15
+ fontClassName: { type: String, default: "nutui-iconfont" },
16
+ color: { type: String, default: "" },
17
+ tag: { type: String, default: "i" }
18
+ },
19
+ emits: ["click"],
20
+ setup(props, { emit, slots }) {
21
+ const handleClick = (event) => {
22
+ emit("click", event);
23
+ };
24
+ const isImage = () => {
25
+ return props.name ? props.name.indexOf("/") !== -1 : false;
26
+ };
27
+ return () => {
28
+ var _a;
29
+ const _isImage = isImage();
30
+ return h(_isImage ? "img" : props.tag, {
31
+ class: _isImage ? `${componentName}__img` : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`,
32
+ style: {
33
+ color: props.color,
34
+ fontSize: pxCheck(props.size),
35
+ width: pxCheck(props.size),
36
+ height: pxCheck(props.size)
37
+ },
38
+ onClick: handleClick,
39
+ src: _isImage ? props.name : ""
40
+ }, (_a = slots.default) == null ? void 0 : _a.call(slots));
41
+ };
42
+ }
43
+ });
44
+ export { _sfc_main as default };
@@ -0,0 +1,109 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ /*!
21
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
22
+ * (c) 2021 @jdf2e.
23
+ * Released under the MIT License.
24
+ */
25
+ import { toRefs, reactive, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createBlock, Fragment, renderList, createElementVNode, createCommentVNode, toDisplayString } from "vue";
26
+ import { c as createComponent } from "./component.js";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
+ const { componentName, create } = createComponent("imagepreview");
29
+ const _sfc_main = create({
30
+ props: {
31
+ show: {
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ images: {
36
+ type: Array,
37
+ default: () => []
38
+ }
39
+ },
40
+ components: {},
41
+ setup(props, { emit }) {
42
+ const { value, images } = toRefs(props);
43
+ const state = reactive({
44
+ showPop: value,
45
+ active: 1
46
+ });
47
+ const slideChangeEnd = function(page) {
48
+ state.active = page + 1;
49
+ };
50
+ const closePop = function() {
51
+ state.showPop = false;
52
+ state.active = 1;
53
+ emit("close");
54
+ };
55
+ watch(() => props.show, (val) => {
56
+ state.showPop = val;
57
+ });
58
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
59
+ slideChangeEnd,
60
+ closePop
61
+ });
62
+ }
63
+ });
64
+ const _hoisted_1 = { class: "nut-imagepreview" };
65
+ const _hoisted_2 = ["src"];
66
+ const _hoisted_3 = { class: "nut-imagepreview-index" };
67
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
68
+ const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
69
+ const _component_nut_swiper = resolveComponent("nut-swiper");
70
+ const _component_nut_popup = resolveComponent("nut-popup");
71
+ return openBlock(), createElementBlock("view", _hoisted_1, [
72
+ createVNode(_component_nut_popup, {
73
+ "pop-class": "custom-pop",
74
+ visible: _ctx.showPop,
75
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showPop = $event),
76
+ onClick: _ctx.closePop
77
+ }, {
78
+ default: withCtx(() => [
79
+ _ctx.showPop ? (openBlock(), createBlock(_component_nut_swiper, {
80
+ key: 0,
81
+ "auto-play": 3e3,
82
+ class: "nut-imagepreview-swiper",
83
+ loop: true,
84
+ direction: "horizontal",
85
+ onChange: _ctx.slideChangeEnd
86
+ }, {
87
+ default: withCtx(() => [
88
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index2) => {
89
+ return openBlock(), createBlock(_component_nut_swiper_item, { key: index2 }, {
90
+ default: withCtx(() => [
91
+ createElementVNode("img", {
92
+ src: item.imgSrc,
93
+ class: "nut-imagepreview-img"
94
+ }, null, 8, _hoisted_2)
95
+ ]),
96
+ _: 2
97
+ }, 1024);
98
+ }), 128))
99
+ ]),
100
+ _: 1
101
+ }, 8, ["onChange"])) : createCommentVNode("", true),
102
+ createElementVNode("view", _hoisted_3, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length), 1)
103
+ ]),
104
+ _: 1
105
+ }, 8, ["visible", "onClick"])
106
+ ]);
107
+ }
108
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
109
+ export { index as default };