@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,180 @@
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, inject, reactive, computed, onMounted, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, createElementVNode, normalizeStyle, Fragment, renderList, createBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from "vue";
26
+ import { c as createComponent } from "./component.js";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
+ const { create, componentName } = createComponent("menu-item");
29
+ const _sfc_main = create({
30
+ props: {
31
+ title: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ disabled: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ menuList: {
40
+ type: Array,
41
+ default: () => {
42
+ return [];
43
+ }
44
+ },
45
+ autoClose: {
46
+ type: Boolean,
47
+ default: true
48
+ },
49
+ multiStyle: {
50
+ type: [String, Number],
51
+ default: 1
52
+ },
53
+ maxHeight: {
54
+ type: [String, Number],
55
+ default: ""
56
+ }
57
+ },
58
+ emits: ["change", "menu-click"],
59
+ setup(props, { emit }) {
60
+ const menuTitle = ref(props.title);
61
+ const menu = inject("menuRelation");
62
+ const parent = reactive(menu);
63
+ const state = reactive({
64
+ showPanel: false,
65
+ currMenu: 0,
66
+ showMask: false
67
+ });
68
+ const classes = computed(() => {
69
+ const prefixCls = componentName;
70
+ return {
71
+ [prefixCls]: true,
72
+ disabled: props.disabled,
73
+ [`${prefixCls}-active`]: state.showPanel
74
+ };
75
+ });
76
+ const handleMenuPanel = () => {
77
+ emit("menu-click", menuTitle.value);
78
+ if (props.disabled) {
79
+ return;
80
+ }
81
+ state.showPanel = !state.showPanel;
82
+ if (parent.hasMask) {
83
+ state.showMask = !state.showMask;
84
+ parent.handleMaskShow(state.showPanel);
85
+ }
86
+ };
87
+ const handleShowAndHide = (event) => {
88
+ const menuBox = document.querySelectorAll(".nut-menu-active")[0];
89
+ if (menuBox && state.showPanel) {
90
+ if (!menuBox.contains(event.target)) {
91
+ state.showPanel = false;
92
+ state.showMask = false;
93
+ parent.handleMaskShow(false);
94
+ }
95
+ }
96
+ };
97
+ const checkMenus = (item, index2) => {
98
+ menuTitle.value = item.value;
99
+ state.currMenu = index2;
100
+ if (props.autoClose) {
101
+ state.showPanel = false;
102
+ state.showMask = false;
103
+ parent.handleMaskShow(false);
104
+ }
105
+ emit("change", item, menuTitle.value);
106
+ };
107
+ onMounted(() => {
108
+ document.addEventListener("mouseup", (event) => {
109
+ handleShowAndHide(event);
110
+ }, false);
111
+ });
112
+ onUnmounted(() => {
113
+ document.removeEventListener("mouseup", (event) => {
114
+ handleShowAndHide(event);
115
+ });
116
+ });
117
+ return __spreadProps(__spreadValues({
118
+ classes
119
+ }, toRefs(state)), {
120
+ handleMenuPanel,
121
+ checkMenus,
122
+ menuTitle
123
+ });
124
+ }
125
+ });
126
+ const _hoisted_1 = ["innerHTML"];
127
+ const _hoisted_2 = ["onClick"];
128
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
129
+ const _component_nut_popup = resolveComponent("nut-popup");
130
+ const _component_nut_icon = resolveComponent("nut-icon");
131
+ return openBlock(), createElementBlock("view", {
132
+ class: normalizeClass(_ctx.classes)
133
+ }, [
134
+ createVNode(_component_nut_popup, {
135
+ visible: _ctx.showMask,
136
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.showMask = $event)
137
+ }, null, 8, ["visible"]),
138
+ createElementVNode("view", {
139
+ class: "nut-menu-title",
140
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleMenuPanel && _ctx.handleMenuPanel(...args))
141
+ }, [
142
+ createElementVNode("view", {
143
+ class: "title-name",
144
+ innerHTML: _ctx.menuTitle
145
+ }, null, 8, _hoisted_1),
146
+ createVNode(_component_nut_icon, { "class-prefix": "icon" })
147
+ ]),
148
+ createElementVNode("view", {
149
+ class: "nut-menu-panel",
150
+ style: normalizeStyle(`max-height:${_ctx.maxHeight}px`)
151
+ }, [
152
+ _ctx.menuList && _ctx.menuList.length ? (openBlock(), createElementBlock("view", {
153
+ key: 0,
154
+ class: normalizeClass(["menu-list", [
155
+ { "bubble-line": _ctx.multiStyle == 2 },
156
+ { "three-line": _ctx.multiStyle == 3 }
157
+ ]])
158
+ }, [
159
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuList, (item, index2) => {
160
+ return openBlock(), createElementBlock("view", {
161
+ class: normalizeClass(["menu-option", { checked: _ctx.currMenu === index2 }]),
162
+ key: index2,
163
+ onClick: ($event) => _ctx.checkMenus(item, index2)
164
+ }, [
165
+ _ctx.currMenu === index2 ? (openBlock(), createBlock(_component_nut_icon, {
166
+ key: 0,
167
+ class: "check-icon",
168
+ name: "Check",
169
+ size: "14px"
170
+ })) : createCommentVNode("", true),
171
+ createTextVNode(toDisplayString(item.value), 1)
172
+ ], 10, _hoisted_2);
173
+ }), 128))
174
+ ], 2)) : createCommentVNode("", true),
175
+ renderSlot(_ctx.$slots, "default")
176
+ ], 4)
177
+ ], 2);
178
+ }
179
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
180
+ export { index as default };
@@ -0,0 +1,160 @@
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, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, toDisplayString, Fragment, renderList, normalizeStyle, renderSlot } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
+ const { componentName, create } = createComponent("navbar");
10
+ const _sfc_main = create({
11
+ props: {
12
+ leftShow: { type: Boolean, default: true },
13
+ title: { type: String, default: "" },
14
+ titIcon: { type: String, default: "" },
15
+ tabs: {
16
+ type: Array,
17
+ defaul: () => {
18
+ return [];
19
+ }
20
+ },
21
+ icon: { type: String, default: "" },
22
+ desc: { type: String, default: "" },
23
+ defaultIndex: {
24
+ type: Number,
25
+ default: 0
26
+ }
27
+ },
28
+ emits: [
29
+ "click",
30
+ "on-click-back",
31
+ "on-click-title",
32
+ "on-click-right",
33
+ "on-click-desc",
34
+ "on-click-icon",
35
+ "on-click-more",
36
+ "on-click-clear",
37
+ "on-click-send",
38
+ "on-click-slot",
39
+ "on-click-slot-send",
40
+ "switch-tab"
41
+ ],
42
+ setup(props, { emit }) {
43
+ const activeIndex = ref(props.defaultIndex);
44
+ const classes = computed(() => {
45
+ const prefixCls = componentName;
46
+ return {
47
+ [prefixCls]: true
48
+ };
49
+ });
50
+ function switchTitle(id, name) {
51
+ activeIndex.value = id;
52
+ console.log(id);
53
+ emit("switch-tab", activeIndex.value, name);
54
+ }
55
+ function handleLeft() {
56
+ emit("on-click-back");
57
+ }
58
+ function handleCenter() {
59
+ emit("on-click-title");
60
+ }
61
+ function handleCenterIcon() {
62
+ emit("on-click-icon");
63
+ }
64
+ function handleClear() {
65
+ emit("on-click-clear");
66
+ }
67
+ function handleSend() {
68
+ emit("on-click-send");
69
+ }
70
+ function handleSlot() {
71
+ emit("on-click-slot");
72
+ }
73
+ function handleSends() {
74
+ emit("on-click-slot-send");
75
+ }
76
+ return {
77
+ classes,
78
+ handleLeft,
79
+ handleCenter,
80
+ handleCenterIcon,
81
+ handleClear,
82
+ handleSend,
83
+ handleSlot,
84
+ handleSends,
85
+ switchTitle,
86
+ activeIndex
87
+ };
88
+ }
89
+ });
90
+ const _hoisted_1 = { class: "nut-navbar__left" };
91
+ const _hoisted_2 = { class: "tab-title" };
92
+ const _hoisted_3 = ["onClick"];
93
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
94
+ const _component_nut_icon = resolveComponent("nut-icon");
95
+ return openBlock(), createElementBlock("view", {
96
+ class: normalizeClass(_ctx.classes)
97
+ }, [
98
+ createElementVNode("view", _hoisted_1, [
99
+ _ctx.leftShow ? (openBlock(), createBlock(_component_nut_icon, {
100
+ key: 0,
101
+ color: "#979797",
102
+ name: "left",
103
+ onClick: _ctx.handleLeft
104
+ }, null, 8, ["onClick"])) : createCommentVNode("", true)
105
+ ]),
106
+ _ctx.title || _ctx.titIcon || _ctx.tabs ? (openBlock(), createElementBlock("view", {
107
+ key: 0,
108
+ class: normalizeClass(["nut-navbar__title", { icon: _ctx.icon }])
109
+ }, [
110
+ _ctx.title ? (openBlock(), createElementBlock("view", {
111
+ key: 0,
112
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
113
+ }, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
114
+ _ctx.titIcon ? (openBlock(), createBlock(_component_nut_icon, {
115
+ key: 1,
116
+ class: "icon",
117
+ name: _ctx.titIcon,
118
+ onClick: _ctx.handleCenterIcon
119
+ }, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
120
+ createElementVNode("view", _hoisted_2, [
121
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tabs, (item, index2) => {
122
+ return openBlock(), createElementBlock("view", {
123
+ class: normalizeClass([
124
+ "tab-title-box",
125
+ { "nut-tab-active": _ctx.activeIndex == item.id || _ctx.activeIndex == index2 }
126
+ ]),
127
+ onClick: ($event) => _ctx.switchTitle(item.id, item.name),
128
+ key: item.id
129
+ }, toDisplayString(item.name), 11, _hoisted_3);
130
+ }), 128))
131
+ ])
132
+ ], 2)) : createCommentVNode("", true),
133
+ _ctx.desc || _ctx.icon ? (openBlock(), createElementBlock("view", {
134
+ key: 1,
135
+ class: normalizeClass(["nut-navbar__right", { icon: _ctx.icon }])
136
+ }, [
137
+ _ctx.desc ? (openBlock(), createElementBlock("view", {
138
+ key: 0,
139
+ style: normalizeStyle({ "text-align": _ctx.descTextAlign }),
140
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClear && _ctx.handleClear(...args))
141
+ }, toDisplayString(_ctx.desc), 5)) : createCommentVNode("", true),
142
+ _ctx.icon ? (openBlock(), createElementBlock("view", {
143
+ key: 1,
144
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleSends && _ctx.handleSends(...args))
145
+ }, [
146
+ renderSlot(_ctx.$slots, "icons")
147
+ ])) : createCommentVNode("", true),
148
+ createElementVNode("view", null, [
149
+ _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
150
+ key: 0,
151
+ class: "rightIcon",
152
+ name: _ctx.icon,
153
+ onClick: _ctx.handleSend
154
+ }, null, 8, ["name", "onClick"])) : createCommentVNode("", true)
155
+ ])
156
+ ], 2)) : createCommentVNode("", true)
157
+ ], 2);
158
+ }
159
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
160
+ export { index as default };