@nutui/nutui 3.1.21 → 3.1.22-beta.5

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 (233) hide show
  1. package/dist/nutui.es.js +4203 -19263
  2. package/dist/nutui.umd.js +4208 -19368
  3. package/dist/packages/_es/ActionSheet.js +17 -167
  4. package/dist/packages/_es/Address.js +110 -552
  5. package/dist/packages/_es/AddressList.js +113 -613
  6. package/dist/packages/_es/Animate.js +22 -0
  7. package/dist/packages/_es/Audio.js +53 -274
  8. package/dist/packages/_es/AudioOperate.js +13 -121
  9. package/dist/packages/_es/Avatar.js +38 -177
  10. package/dist/packages/_es/AvatarGroup.js +14 -73
  11. package/dist/packages/_es/BackTop.js +43 -156
  12. package/dist/packages/_es/Badge.js +14 -86
  13. package/dist/packages/_es/Barrage.js +41 -120
  14. package/dist/packages/_es/Button.js +23 -128
  15. package/dist/packages/_es/Calendar.js +30 -237
  16. package/dist/packages/_es/CalendarItem.js +2 -1
  17. package/dist/packages/_es/Card.js +10 -107
  18. package/dist/packages/_es/Cascader.js +147 -523
  19. package/dist/packages/_es/Category.js +15 -58
  20. package/dist/packages/_es/CategoryPane.js +11 -111
  21. package/dist/packages/_es/Cell.js +21 -100
  22. package/dist/packages/_es/CellGroup.js +9 -44
  23. package/dist/packages/_es/Checkbox.js +31 -113
  24. package/dist/packages/_es/CheckboxGroup.js +29 -58
  25. package/dist/packages/_es/CircleProgress.js +28 -151
  26. package/dist/packages/_es/Col.js +14 -56
  27. package/dist/packages/_es/Collapse.js +32 -84
  28. package/dist/packages/_es/CollapseItem.js +59 -272
  29. package/dist/packages/_es/Comment.js +64 -434
  30. package/dist/packages/_es/ConfigProvider.js +13 -0
  31. package/dist/packages/_es/CountDown.js +56 -256
  32. package/dist/packages/_es/CountUp.js +140 -556
  33. package/dist/packages/_es/DatePicker.js +98 -332
  34. package/dist/packages/_es/Dialog.js +60 -271
  35. package/dist/packages/_es/Divider.js +13 -82
  36. package/dist/packages/_es/Drag.js +56 -197
  37. package/dist/packages/_es/Ecard.js +24 -159
  38. package/dist/packages/_es/Elevator.js +58 -212
  39. package/dist/packages/_es/Ellipsis.js +64 -0
  40. package/dist/packages/_es/Empty.js +12 -71
  41. package/dist/packages/_es/FixedNav.js +15 -122
  42. package/dist/packages/_es/Form.js +64 -151
  43. package/dist/packages/_es/FormItem.js +15 -110
  44. package/dist/packages/_es/Grid.js +5 -6
  45. package/dist/packages/_es/GridItem.js +33 -144
  46. package/dist/packages/_es/Icon.js +15 -40
  47. package/dist/packages/_es/Image.js +31 -0
  48. package/dist/packages/_es/ImagePreview.js +77 -309
  49. package/dist/packages/_es/Indicator.js +15 -62
  50. package/dist/packages/_es/InfiniteLoading.js +57 -268
  51. package/dist/packages/_es/Input.js +51 -413
  52. package/dist/packages/_es/InputNumber.js +41 -160
  53. package/dist/packages/_es/Layout.js +4 -5
  54. package/dist/packages/_es/List.js +18 -124
  55. package/dist/packages/_es/Menu.js +45 -118
  56. package/dist/packages/_es/MenuItem.js +37 -162
  57. package/dist/packages/_es/Navbar.js +30 -192
  58. package/dist/packages/_es/NoticeBar.js +74 -397
  59. package/dist/packages/_es/Notify.js +72 -246
  60. package/dist/packages/_es/NumberKeyboard.js +41 -272
  61. package/dist/packages/_es/OldPicker.js +131 -474
  62. package/dist/packages/_es/OverLay.js +24 -113
  63. package/dist/packages/_es/Pagination.js +39 -157
  64. package/dist/packages/_es/Picker.js +129 -469
  65. package/dist/packages/_es/Popover.js +318 -975
  66. package/dist/packages/_es/Popup.js +55 -313
  67. package/dist/packages/_es/Price.js +16 -118
  68. package/dist/packages/_es/Progress.js +14 -146
  69. package/dist/packages/_es/PullRefresh.js +84 -354
  70. package/dist/packages/_es/Radio.js +22 -90
  71. package/dist/packages/_es/RadioGroup.js +8 -37
  72. package/dist/packages/_es/Range.js +83 -427
  73. package/dist/packages/_es/Rate.js +35 -137
  74. package/dist/packages/_es/Row.js +22 -64
  75. package/dist/packages/_es/SearchBar.js +37 -257
  76. package/dist/packages/_es/ShortPassword.js +35 -225
  77. package/dist/packages/_es/SideNavBar.js +24 -99
  78. package/dist/packages/_es/SideNavBarItem.js +11 -46
  79. package/dist/packages/_es/Signature.js +41 -179
  80. package/dist/packages/_es/Skeleton.js +20 -136
  81. package/dist/packages/_es/Sku.js +84 -509
  82. package/dist/packages/_es/Step.js +20 -133
  83. package/dist/packages/_es/Steps.js +18 -53
  84. package/dist/packages/_es/Sticky.js +53 -138
  85. package/dist/packages/_es/SubSideNavBar.js +17 -100
  86. package/dist/packages/_es/Swipe.js +41 -197
  87. package/dist/packages/_es/Swiper.js +121 -433
  88. package/dist/packages/_es/SwiperItem.js +22 -53
  89. package/dist/packages/_es/Switch.js +21 -116
  90. package/dist/packages/_es/TabPane.js +12 -39
  91. package/dist/packages/_es/Tabbar.js +17 -72
  92. package/dist/packages/_es/TabbarItem.js +29 -151
  93. package/dist/packages/_es/Table.js +18 -196
  94. package/dist/packages/_es/Tabs.js +43 -217
  95. package/dist/packages/_es/Tag.js +20 -97
  96. package/dist/packages/_es/TextArea.js +42 -160
  97. package/dist/packages/_es/TimeDetail.js +18 -98
  98. package/dist/packages/_es/TimePannel.js +14 -66
  99. package/dist/packages/_es/TimeSelect.js +15 -103
  100. package/dist/packages/_es/Toast.js +71 -329
  101. package/dist/packages/_es/Uploader.js +104 -468
  102. package/dist/packages/_es/Video.js +74 -350
  103. package/dist/packages/_es/common.js +38 -128
  104. package/dist/packages/_es/component.js +35 -76
  105. package/dist/packages/_es/index.js +5 -6
  106. package/dist/packages/_es/index2.js +9 -30
  107. package/dist/packages/_es/index3.js +6 -8
  108. package/dist/packages/_es/index4.js +13 -58
  109. package/dist/packages/_es/index5.js +164 -682
  110. package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
  111. package/dist/packages/_es/pxCheck.js +3 -5
  112. package/dist/packages/_es/raf.js +8 -15
  113. package/dist/packages/animate/index.scss +299 -0
  114. package/dist/packages/button/index.scss +2 -1
  115. package/dist/packages/cell/index.scss +18 -1
  116. package/dist/packages/checkbox/index.scss +16 -0
  117. package/dist/packages/configprovider/index.scss +2 -0
  118. package/dist/packages/dialog/index.scss +1 -0
  119. package/dist/packages/elevator/index.scss +21 -0
  120. package/dist/packages/ellipsis/index.scss +12 -0
  121. package/dist/packages/formitem/index.scss +12 -0
  122. package/dist/packages/griditem/index.scss +11 -0
  123. package/dist/packages/image/index.scss +39 -0
  124. package/dist/packages/imagepreview/index.scss +21 -2
  125. package/dist/packages/input/index.scss +26 -1
  126. package/dist/packages/inputnumber/index.scss +21 -0
  127. package/dist/packages/locale/lang/baseLang.d.ts +1 -0
  128. package/dist/packages/locale/lang/baseLang.js +3 -3
  129. package/dist/packages/locale/lang/en-US.d.ts +8 -0
  130. package/dist/packages/locale/lang/en-US.js +5 -97
  131. package/dist/packages/locale/lang/id-ID.d.ts +8 -0
  132. package/dist/packages/locale/lang/id-ID.js +5 -97
  133. package/dist/packages/locale/lang/index.js +16 -38
  134. package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
  135. package/dist/packages/locale/lang/zh-CN.js +5 -97
  136. package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
  137. package/dist/packages/locale/lang/zh-TW.js +5 -97
  138. package/dist/packages/menu/index.scss +45 -36
  139. package/dist/packages/menuitem/index.scss +4 -0
  140. package/dist/packages/navbar/index.scss +9 -0
  141. package/dist/packages/pagination/index.scss +19 -0
  142. package/dist/packages/radio/index.scss +19 -0
  143. package/dist/packages/range/index.scss +19 -0
  144. package/dist/packages/rate/index.scss +1 -1
  145. package/dist/packages/searchbar/index.scss +21 -0
  146. package/dist/packages/switch/index.scss +4 -3
  147. package/dist/packages/tabbar/index.scss +5 -0
  148. package/dist/packages/tabbaritem/index.scss +7 -0
  149. package/dist/packages/tabpane/index.scss +6 -0
  150. package/dist/packages/tabs/index.scss +22 -0
  151. package/dist/packages/textarea/index.scss +8 -0
  152. package/dist/smartips/attributes.json +192 -12
  153. package/dist/smartips/tags.json +70 -10
  154. package/dist/smartips/web-types.json +6945 -0
  155. package/dist/style.css +1 -1
  156. package/dist/style.es.js +1 -1
  157. package/dist/styles/font/config.json +3 -1
  158. package/dist/styles/font/demo_index.html +49 -3
  159. package/dist/styles/font/iconfont.css +11 -3
  160. package/dist/styles/font/iconfont.js +15 -15
  161. package/dist/styles/font/iconfont.json +14 -0
  162. package/dist/styles/font/iconfont.ttf +0 -0
  163. package/dist/styles/font/iconfont.woff +0 -0
  164. package/dist/styles/font/iconfont.woff2 +0 -0
  165. package/dist/styles/themes/default.scss +54 -50
  166. package/dist/styles/themes/jdb.scss +54 -50
  167. package/dist/styles/themes/jdt.scss +54 -50
  168. package/dist/styles/variables-jdb.scss +19 -1
  169. package/dist/styles/variables-jdt.scss +19 -1
  170. package/dist/styles/variables.scss +22 -1
  171. package/dist/types/__VUE/address/index.vue.d.ts +2 -2
  172. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
  173. package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
  174. package/dist/types/__VUE/animate/type.d.ts +6 -0
  175. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
  176. package/dist/types/__VUE/avatar/index.vue.d.ts +7 -7
  177. package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
  178. package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
  179. package/dist/types/__VUE/button/index.vue.d.ts +2 -2
  180. package/dist/types/__VUE/calendaritem/index.vue.d.ts +10 -2
  181. package/dist/types/__VUE/cell/index.vue.d.ts +13 -6
  182. package/dist/types/__VUE/checkbox/common.d.ts +59 -0
  183. package/dist/types/__VUE/checkbox/index.vue.d.ts +20 -7
  184. package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
  185. package/dist/types/__VUE/circleprogress/index.vue.d.ts +2 -2
  186. package/dist/types/__VUE/collapse/index.vue.d.ts +5 -3
  187. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
  188. package/dist/types/__VUE/configprovider/common.d.ts +20 -0
  189. package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
  190. package/dist/types/__VUE/datepicker/index.vue.d.ts +5 -5
  191. package/dist/types/__VUE/datepicker/type.d.ts +6 -0
  192. package/dist/types/__VUE/dialog/index.d.ts +9 -2
  193. package/dist/types/__VUE/dialog/index.vue.d.ts +26 -17
  194. package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
  195. package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
  196. package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
  197. package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
  198. package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
  199. package/dist/types/__VUE/grid/common.d.ts +3 -3
  200. package/dist/types/__VUE/grid/index.vue.d.ts +5 -5
  201. package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
  202. package/dist/types/__VUE/image/index.vue.d.ts +105 -0
  203. package/dist/types/__VUE/image/type.d.ts +6 -0
  204. package/dist/types/__VUE/imagepreview/index.vue.d.ts +36 -2
  205. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +6 -6
  206. package/dist/types/__VUE/input/index.vue.d.ts +4 -4
  207. package/dist/types/__VUE/menu/index.vue.d.ts +29 -2
  208. package/dist/types/__VUE/menuitem/index.vue.d.ts +16 -7
  209. package/dist/types/__VUE/menuitem/type.d.ts +8 -0
  210. package/dist/types/__VUE/noticebar/index.vue.d.ts +3 -3
  211. package/dist/types/__VUE/picker/Column.vue.d.ts +1 -1
  212. package/dist/types/__VUE/picker/index.vue.d.ts +1 -1
  213. package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
  214. package/dist/types/__VUE/range/index.vue.d.ts +1 -1
  215. package/dist/types/__VUE/rate/common.d.ts +149 -0
  216. package/dist/types/__VUE/rate/index.vue.d.ts +17 -7
  217. package/dist/types/__VUE/searchbar/index.vue.d.ts +2 -2
  218. package/dist/types/__VUE/skeleton/common.d.ts +2 -4
  219. package/dist/types/__VUE/step/index.vue.d.ts +2 -2
  220. package/dist/types/__VUE/swiper/index.vue.d.ts +4 -4
  221. package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
  222. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
  223. package/dist/types/__VUE/tabs/common.d.ts +2 -2
  224. package/dist/types/__VUE/textarea/index.vue.d.ts +2 -2
  225. package/dist/types/__VUE/timeselect/index.vue.d.ts +8 -0
  226. package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
  227. package/dist/types/__VUE/uploader/index.vue.d.ts +4 -4
  228. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  229. package/dist/types/__VUE/uploader/uploader.d.ts +1 -0
  230. package/dist/types/__VUE/video/index.vue.d.ts +1 -1
  231. package/dist/types/index.d.ts +1 -1
  232. package/dist/types/nutui.d.ts +5 -1
  233. package/package.json +7 -3
@@ -1,170 +1,45 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
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
- 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";
6
+ import { reactive as e, computed as o, inject as t, getCurrentInstance as l, resolveComponent as n, withDirectives as p, openBlock as a, createElementBlock as r, normalizeClass as s, createElementVNode as i, normalizeStyle as u, vShow as c, createVNode as d, mergeProps as m, withCtx as h, Fragment as v, renderList as f, createBlock as y, createCommentVNode as w, toDisplayString as k, renderSlot as C } from "vue";
7
+ import { c as P } from "./component.js";
8
+ import S from "./Icon.js";
9
+ import x from "./Popup.js";
10
+ import { _ } from "./plugin-vue_export-helper.js";
11
11
  import "../locale/lang";
12
12
  import "./pxCheck.js";
13
13
  import "./OverLay.js";
14
- const { componentName, create } = createComponent("menu-item");
15
- const _sfc_main = create({
16
- props: {
17
- title: String,
18
- options: {
19
- type: Array,
20
- default: []
21
- },
22
- disabled: {
23
- type: Boolean,
24
- default: false
25
- },
26
- modelValue: null,
27
- cols: {
28
- type: Number,
29
- default: 1
30
- },
31
- titleIcon: {
32
- type: String,
33
- default: "down-arrow"
14
+ const { componentName: g, create: b } = P("menu-item"), V = b({ props: { title: String, options: { type: Array, default: [] }, disabled: { type: Boolean, default: false }, modelValue: null, cols: { type: Number, default: 1 }, titleIcon: String, optionIcon: { type: String, default: "Check" } }, components: { [S.name]: S, [x.name]: x }, emits: ["update:modelValue", "change"], setup(n2, { emit: p2, slots: a2 }) {
15
+ const r2 = e({ showPopup: false, transition: true, showWrapper: false, isShowPlaceholderElement: false }), { parent: s2 } = (() => {
16
+ const e2 = t("menuParent", null);
17
+ if (e2) {
18
+ const o2 = l(), { link: t2 } = e2;
19
+ return t2(o2), { parent: e2 };
34
20
  }
35
- },
36
- components: {
37
- [_sfc_main$1.name]: _sfc_main$1,
38
- [Popup.name]: Popup
39
- },
40
- emits: ["update:modelValue", "change"],
41
- setup(props, { emit, slots }) {
42
- const state = reactive({
43
- showPopup: false,
44
- transition: true,
45
- showWrapper: false,
46
- isShowPlaceholderElement: false
47
- });
48
- const useParent = () => {
49
- const parent2 = inject("menuParent", null);
50
- if (parent2) {
51
- const instance = getCurrentInstance();
52
- const { link } = parent2;
53
- link(instance);
54
- return {
55
- parent: parent2
56
- };
57
- }
58
- };
59
- const { parent } = useParent();
60
- const classes = computed(() => {
61
- const prefixCls = componentName;
62
- return {
63
- [prefixCls]: true
64
- };
65
- });
66
- const toggle = (show = !state.showPopup, options = {}) => {
67
- if (show === state.showPopup) {
68
- return;
69
- }
70
- state.showPopup = show;
71
- state.isShowPlaceholderElement = show;
72
- if (show) {
73
- state.showWrapper = true;
74
- }
75
- };
76
- const renderTitle = () => {
77
- var _a;
78
- if (props.title) {
79
- return props.title;
80
- }
81
- const match = (_a = props.options) == null ? void 0 : _a.find((option) => option.value === props.modelValue);
82
- return match ? match.text : "";
83
- };
84
- const onClick = (option) => {
85
- state.showPopup = false;
86
- state.isShowPlaceholderElement = false;
87
- if (option.value !== props.modelValue) {
88
- emit("update:modelValue", option.value);
89
- emit("change", option.value);
90
- }
91
- };
92
- const handleClose = () => {
93
- state.showWrapper = false;
94
- state.isShowPlaceholderElement = false;
95
- };
96
- const handleClickOutside = () => {
97
- state.showPopup = false;
98
- };
99
- return {
100
- classes,
101
- renderTitle,
102
- state,
103
- parent,
104
- toggle,
105
- onClick,
106
- handleClose,
107
- handleClickOutside
108
- };
109
- }
110
- });
111
- const _hoisted_1 = { class: "nut-menu-item__content" };
112
- const _hoisted_2 = ["onClick"];
113
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
114
- const _component_nut_icon = resolveComponent("nut-icon");
115
- const _component_nut_popup = resolveComponent("nut-popup");
116
- return withDirectives((openBlock(), createElementBlock("view", {
117
- class: normalizeClass(_ctx.classes)
118
- }, [
119
- withDirectives(createElementVNode("div", {
120
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClickOutside && _ctx.handleClickOutside(...args)),
121
- class: "placeholder-element",
122
- style: normalizeStyle({ height: _ctx.parent.offset.value + "px" })
123
- }, null, 4), [
124
- [vShow, _ctx.state.isShowPlaceholderElement]
125
- ]),
126
- createVNode(_component_nut_popup, mergeProps({
127
- style: { top: _ctx.parent.offset.value + "px" },
128
- overlayStyle: { top: _ctx.parent.offset.value + "px" }
129
- }, _ctx.$attrs, {
130
- visible: _ctx.state.showPopup,
131
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.state.showPopup = $event),
132
- position: "top",
133
- duration: _ctx.parent.props.duration,
134
- "pop-class": "nut-menu__pop",
135
- overlayClass: "nut-menu__overlay",
136
- overlay: _ctx.parent.props.overlay,
137
- onClosed: _ctx.handleClose,
138
- isWrapTeleport: false,
139
- "close-on-click-overlay": _ctx.parent.props.closeOnClickOverlay
140
- }), {
141
- default: withCtx(() => [
142
- createElementVNode("view", _hoisted_1, [
143
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index2) => {
144
- return openBlock(), createElementBlock("view", {
145
- key: index2,
146
- class: normalizeClass(["nut-menu-item__option", { active: option.value === _ctx.modelValue }]),
147
- style: normalizeStyle({ "flex-basis": 100 / _ctx.cols + "%" }),
148
- onClick: ($event) => _ctx.onClick(option)
149
- }, [
150
- option.value === _ctx.modelValue ? (openBlock(), createBlock(_component_nut_icon, {
151
- key: 0,
152
- name: "Check",
153
- color: _ctx.parent.props.activeColor
154
- }, null, 8, ["color"])) : createCommentVNode("", true),
155
- createElementVNode("view", {
156
- style: normalizeStyle({ color: option.value === _ctx.modelValue ? _ctx.parent.props.activeColor : "" })
157
- }, toDisplayString(option.text), 5)
158
- ], 14, _hoisted_2);
159
- }), 128)),
160
- renderSlot(_ctx.$slots, "default")
161
- ])
162
- ]),
163
- _: 3
164
- }, 16, ["style", "overlayStyle", "visible", "duration", "overlay", "onClosed", "close-on-click-overlay"])
165
- ], 2)), [
166
- [vShow, _ctx.state.showWrapper]
167
- ]);
168
- }
169
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
170
- export { index as default };
21
+ })();
22
+ return { classes: o(() => ({ [g]: true })), placeholderElementStyle: o(() => {
23
+ const e2 = { height: s2.offset.value + "px" };
24
+ return s2.props.direction === "down" ? e2 : { ...e2, top: "auto" };
25
+ }), renderTitle: () => {
26
+ var _a;
27
+ if (n2.title)
28
+ return n2.title;
29
+ const e2 = (_a = n2.options) == null ? void 0 : _a.find((e3) => e3.value === n2.modelValue);
30
+ return e2 ? e2.text : "";
31
+ }, state: r2, parent: s2, toggle: (e2 = !r2.showPopup, o2 = {}) => {
32
+ e2 !== r2.showPopup && (r2.showPopup = e2, r2.isShowPlaceholderElement = e2, e2 && (r2.showWrapper = true));
33
+ }, onClick: (e2) => {
34
+ r2.showPopup = false, r2.isShowPlaceholderElement = false, e2.value !== n2.modelValue && (p2("update:modelValue", e2.value), p2("change", e2.value));
35
+ }, handleClose: () => {
36
+ r2.showWrapper = false, r2.isShowPlaceholderElement = false;
37
+ }, handleClickOutside: () => {
38
+ r2.showPopup = false;
39
+ } };
40
+ } }), E = { class: "nut-menu-item__content" }, j = ["onClick"];
41
+ var O = _(V, [["render", function(e2, o2, t2, l2, P2, S2) {
42
+ const x2 = n("nut-icon"), _2 = n("nut-popup");
43
+ return p((a(), r("view", { class: s(e2.classes) }, [p(i("div", { onClick: o2[0] || (o2[0] = (...o3) => e2.handleClickOutside && e2.handleClickOutside(...o3)), class: s(["placeholder-element", { up: e2.parent.props.direction === "up" }]), style: u(e2.placeholderElementStyle) }, null, 6), [[c, e2.state.isShowPlaceholderElement]]), d(_2, m({ style: e2.parent.props.direction === "down" ? { top: e2.parent.offset.value + "px" } : { bottom: e2.parent.offset.value + "px" }, overlayStyle: e2.parent.props.direction === "down" ? { top: e2.parent.offset.value + "px" } : { bottom: e2.parent.offset.value + "px" } }, e2.$attrs, { visible: e2.state.showPopup, "onUpdate:visible": o2[1] || (o2[1] = (o3) => e2.state.showPopup = o3), position: e2.parent.props.direction === "down" ? "top" : "bottom", duration: e2.parent.props.duration, "pop-class": "nut-menu__pop", overlayClass: "nut-menu__overlay", overlay: e2.parent.props.overlay, onClosed: e2.handleClose, lockScroll: e2.parent.props.lockScroll, isWrapTeleport: false, "close-on-click-overlay": e2.parent.props.closeOnClickOverlay }), { default: h(() => [i("view", E, [(a(true), r(v, null, f(e2.options, (o3, t3) => (a(), r("view", { key: t3, class: s(["nut-menu-item__option", { active: o3.value === e2.modelValue }]), style: u({ "flex-basis": 100 / e2.cols + "%" }), onClick: (t4) => e2.onClick(o3) }, [o3.value === e2.modelValue ? (a(), y(x2, { key: 0, name: e2.optionIcon, color: e2.parent.props.activeColor }, null, 8, ["name", "color"])) : w("", true), i("view", { style: u({ color: o3.value === e2.modelValue ? e2.parent.props.activeColor : "" }) }, k(o3.text), 5)], 14, j))), 128)), C(e2.$slots, "default")])]), _: 3 }, 16, ["style", "overlayStyle", "visible", "position", "duration", "overlay", "onClosed", "lockScroll", "close-on-click-overlay"])], 2)), [[c, e2.state.showWrapper]]);
44
+ }]]);
45
+ export { O as default };
@@ -1,198 +1,36 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.21 Mon May 30 2022 20:20:01 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.22-beta.5 Fri Jun 24 2022 15:10:09 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { toRefs, ref, computed, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
7
- import { c as createComponent } from "./component.js";
8
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
6
+ import { toRefs as e, ref as t, computed as l, onMounted as n, nextTick as a, resolveComponent as o, openBlock as i, createElementBlock as c, createElementVNode as s, normalizeClass as r, normalizeStyle as d, createBlock as u, createCommentVNode as f, toDisplayString as v, renderSlot as h } from "vue";
7
+ import { c as p } from "./component.js";
8
+ import { _ as k } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
- const { componentName, create } = createComponent("navbar");
11
- const _sfc_main = create({
12
- props: {
13
- leftShow: { type: Boolean, default: true },
14
- title: { type: String, default: "" },
15
- titIcon: { type: String, default: "" },
16
- leftText: { type: String, default: "" },
17
- desc: { type: String, default: "" },
18
- fixed: {
19
- type: Boolean,
20
- default: false
21
- },
22
- safeAreaInsetTop: {
23
- type: Boolean,
24
- default: false
25
- },
26
- border: {
27
- type: Boolean,
28
- default: false
29
- },
30
- placeholder: {
31
- type: Boolean,
32
- default: true
33
- },
34
- zIndex: {
35
- type: [Number, String],
36
- default: 10
37
- }
38
- },
39
- emits: ["on-click-back", "on-click-title", "on-click-icon", "on-click-right"],
40
- setup(props, { emit }) {
41
- const { border, fixed, safeAreaInsetTop, placeholder, zIndex } = toRefs(props);
42
- const navBarWrap = ref(null);
43
- const navBarHtml = ref(null);
44
- let navHeight = ref(0);
45
- const classes = computed(() => {
46
- const prefixCls = componentName;
47
- return {
48
- [prefixCls]: true,
49
- [`${prefixCls}--border`]: border.value,
50
- [`${prefixCls}--fixed`]: fixed.value,
51
- [`${prefixCls}--safe-area-inset-top`]: safeAreaInsetTop.value
52
- };
10
+ const { componentName: y, create: g } = p("navbar"), _ = g({ props: { leftShow: { type: Boolean, default: true }, title: { type: String, default: "" }, titIcon: { type: String, default: "" }, leftText: { type: String, default: "" }, desc: { type: String, default: "" }, fixed: { type: Boolean, default: false }, safeAreaInsetTop: { type: Boolean, default: false }, border: { type: Boolean, default: false }, placeholder: { type: Boolean, default: true }, zIndex: { type: [Number, String], default: 10 } }, emits: ["on-click-back", "on-click-title", "on-click-icon", "on-click-right"], setup(o2, { emit: i2 }) {
11
+ const { border: c2, fixed: s2, safeAreaInsetTop: r2, placeholder: d2, zIndex: u2 } = e(o2), f2 = t(null), v2 = t(null);
12
+ let h2 = t(0);
13
+ const p2 = l(() => {
14
+ const e2 = y;
15
+ return { [e2]: true, [`${e2}--border`]: c2.value, [`${e2}--fixed`]: s2.value, [`${e2}--safe-area-inset-top`]: r2.value };
16
+ }), k2 = l(() => ({ zIndex: u2.value }));
17
+ return n(() => {
18
+ s2.value && d2.value && a(() => {
19
+ var _a;
20
+ h2 = (_a = v2 == null ? void 0 : v2.value) == null ? void 0 : _a.getBoundingClientRect().height, f2.value.style.height = h2 + "px";
53
21
  });
54
- const styles = computed(() => {
55
- return {
56
- zIndex: zIndex.value
57
- };
58
- });
59
- onMounted(() => {
60
- if (fixed.value && placeholder.value) {
61
- nextTick(() => {
62
- var _a;
63
- navHeight = (_a = navBarHtml == null ? void 0 : navBarHtml.value) == null ? void 0 : _a.getBoundingClientRect().height;
64
- navBarWrap.value.style.height = navHeight + "px";
65
- });
66
- }
67
- });
68
- function handleLeft() {
69
- emit("on-click-back");
70
- }
71
- function handleCenter() {
72
- emit("on-click-title");
73
- }
74
- function handleCenterIcon() {
75
- emit("on-click-icon");
76
- }
77
- function handleRight() {
78
- emit("on-click-right");
79
- }
80
- return {
81
- navBarWrap,
82
- navBarHtml,
83
- classes,
84
- styles,
85
- handleLeft,
86
- handleCenter,
87
- handleCenterIcon,
88
- handleRight
89
- };
90
- }
91
- });
92
- const _hoisted_1 = {
93
- key: 0,
94
- class: "nut-navbar--placeholder",
95
- ref: "navBarWrap"
96
- };
97
- const _hoisted_2 = {
98
- key: 1,
99
- class: "nut-navbar__text"
100
- };
101
- const _hoisted_3 = { class: "nut-navbar__title" };
102
- const _hoisted_4 = {
103
- key: 0,
104
- class: "nut-navbar__text"
105
- };
106
- const _hoisted_5 = {
107
- key: 1,
108
- class: "nut-navbar__text"
109
- };
110
- const _hoisted_6 = { class: "nut-navbar__title" };
111
- const _hoisted_7 = {
112
- key: 0,
113
- class: "nut-navbar__text"
114
- };
115
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
116
- const _component_nut_icon = resolveComponent("nut-icon");
117
- return _ctx.fixed && _ctx.placeholder ? (openBlock(), createElementBlock("view", _hoisted_1, [
118
- createElementVNode("view", {
119
- class: normalizeClass(_ctx.classes),
120
- style: normalizeStyle(_ctx.styles),
121
- ref: "navBarHtml"
122
- }, [
123
- createElementVNode("view", {
124
- class: "nut-navbar__left",
125
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleLeft && _ctx.handleLeft(...args))
126
- }, [
127
- _ctx.leftShow ? (openBlock(), createBlock(_component_nut_icon, {
128
- key: 0,
129
- color: "#979797",
130
- name: "left"
131
- })) : createCommentVNode("", true),
132
- _ctx.leftText ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.leftText), 1)) : createCommentVNode("", true),
133
- renderSlot(_ctx.$slots, "left")
134
- ]),
135
- createElementVNode("view", _hoisted_3, [
136
- _ctx.title ? (openBlock(), createElementBlock("view", {
137
- key: 0,
138
- class: "title",
139
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
140
- }, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
141
- _ctx.titIcon ? (openBlock(), createBlock(_component_nut_icon, {
142
- key: 1,
143
- class: "icon",
144
- name: _ctx.titIcon,
145
- onClick: _ctx.handleCenterIcon
146
- }, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
147
- renderSlot(_ctx.$slots, "content")
148
- ]),
149
- createElementVNode("view", {
150
- class: "nut-navbar__right",
151
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleRight && _ctx.handleRight(...args))
152
- }, [
153
- _ctx.desc ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.desc), 1)) : createCommentVNode("", true),
154
- renderSlot(_ctx.$slots, "right")
155
- ])
156
- ], 6)
157
- ], 512)) : (openBlock(), createElementBlock("view", {
158
- key: 1,
159
- class: normalizeClass(_ctx.classes),
160
- style: normalizeStyle(_ctx.styles)
161
- }, [
162
- createElementVNode("view", {
163
- class: "nut-navbar__left",
164
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleLeft && _ctx.handleLeft(...args))
165
- }, [
166
- _ctx.leftShow ? (openBlock(), createBlock(_component_nut_icon, {
167
- key: 0,
168
- color: "#979797",
169
- name: "left"
170
- })) : createCommentVNode("", true),
171
- _ctx.leftText ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(_ctx.leftText), 1)) : createCommentVNode("", true),
172
- renderSlot(_ctx.$slots, "left")
173
- ]),
174
- createElementVNode("view", _hoisted_6, [
175
- _ctx.title ? (openBlock(), createElementBlock("view", {
176
- key: 0,
177
- class: "title",
178
- onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleCenter && _ctx.handleCenter(...args))
179
- }, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
180
- _ctx.titIcon ? (openBlock(), createBlock(_component_nut_icon, {
181
- key: 1,
182
- class: "icon",
183
- name: _ctx.titIcon,
184
- onClick: _ctx.handleCenterIcon
185
- }, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
186
- renderSlot(_ctx.$slots, "content")
187
- ]),
188
- createElementVNode("view", {
189
- class: "nut-navbar__right",
190
- onClick: _cache[5] || (_cache[5] = (...args) => _ctx.handleRight && _ctx.handleRight(...args))
191
- }, [
192
- _ctx.desc ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.desc), 1)) : createCommentVNode("", true),
193
- renderSlot(_ctx.$slots, "right")
194
- ])
195
- ], 6));
196
- }
197
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
198
- export { index as default };
22
+ }), { navBarWrap: f2, navBarHtml: v2, classes: p2, styles: k2, handleLeft: function() {
23
+ i2("on-click-back");
24
+ }, handleCenter: function() {
25
+ i2("on-click-title");
26
+ }, handleCenterIcon: function() {
27
+ i2("on-click-icon");
28
+ }, handleRight: function() {
29
+ i2("on-click-right");
30
+ } };
31
+ } }), m = { key: 0, class: "nut-navbar--placeholder", ref: "navBarWrap" }, x = { key: 1, class: "nut-navbar__text" }, C = { class: "nut-navbar__title" }, b = { key: 0, class: "nut-navbar__text" }, w = { key: 1, class: "nut-navbar__text" }, I = { class: "nut-navbar__title" }, B = { key: 0, class: "nut-navbar__text" };
32
+ var $ = k(_, [["render", function(e2, t2, l2, n2, a2, p2) {
33
+ const k2 = o("nut-icon");
34
+ return e2.fixed && e2.placeholder ? (i(), c("view", m, [s("view", { class: r(e2.classes), style: d(e2.styles), ref: "navBarHtml" }, [s("view", { class: "nut-navbar__left", onClick: t2[0] || (t2[0] = (...t3) => e2.handleLeft && e2.handleLeft(...t3)) }, [e2.leftShow ? (i(), u(k2, { key: 0, color: "#979797", name: "left" })) : f("", true), e2.leftText ? (i(), c("view", x, v(e2.leftText), 1)) : f("", true), h(e2.$slots, "left")]), s("view", C, [e2.title ? (i(), c("view", { key: 0, class: "title", onClick: t2[1] || (t2[1] = (...t3) => e2.handleCenter && e2.handleCenter(...t3)) }, v(e2.title), 1)) : f("", true), e2.titIcon ? (i(), u(k2, { key: 1, class: "icon", name: e2.titIcon, onClick: e2.handleCenterIcon }, null, 8, ["name", "onClick"])) : f("", true), h(e2.$slots, "content")]), s("view", { class: "nut-navbar__right", onClick: t2[2] || (t2[2] = (...t3) => e2.handleRight && e2.handleRight(...t3)) }, [e2.desc ? (i(), c("view", b, v(e2.desc), 1)) : f("", true), h(e2.$slots, "right")])], 6)], 512)) : (i(), c("view", { key: 1, class: r(e2.classes), style: d(e2.styles) }, [s("view", { class: "nut-navbar__left", onClick: t2[3] || (t2[3] = (...t3) => e2.handleLeft && e2.handleLeft(...t3)) }, [e2.leftShow ? (i(), u(k2, { key: 0, color: "#979797", name: "left" })) : f("", true), e2.leftText ? (i(), c("view", w, v(e2.leftText), 1)) : f("", true), h(e2.$slots, "left")]), s("view", I, [e2.title ? (i(), c("view", { key: 0, class: "title", onClick: t2[4] || (t2[4] = (...t3) => e2.handleCenter && e2.handleCenter(...t3)) }, v(e2.title), 1)) : f("", true), e2.titIcon ? (i(), u(k2, { key: 1, class: "icon", name: e2.titIcon, onClick: e2.handleCenterIcon }, null, 8, ["name", "onClick"])) : f("", true), h(e2.$slots, "content")]), s("view", { class: "nut-navbar__right", onClick: t2[5] || (t2[5] = (...t3) => e2.handleRight && e2.handleRight(...t3)) }, [e2.desc ? (i(), c("view", B, v(e2.desc), 1)) : f("", true), h(e2.$slots, "right")])], 6));
35
+ }]]);
36
+ export { $ as default };