@nutui/nutui 4.1.0-beta.4 → 4.1.0-beta.6

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 (150) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +5351 -5327
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +2 -2
  5. package/dist/packages/_es/Address.js +4 -3
  6. package/dist/packages/_es/AddressList.js +1 -1
  7. package/dist/packages/_es/Animate.js +1 -1
  8. package/dist/packages/_es/Audio.js +2 -2
  9. package/dist/packages/_es/AudioOperate.js +3 -3
  10. package/dist/packages/_es/Avatar.js +17 -79
  11. package/dist/packages/_es/AvatarGroup.js +92 -21
  12. package/dist/packages/_es/Backtop.js +1 -1
  13. package/dist/packages/_es/Badge.js +1 -1
  14. package/dist/packages/_es/Barrage.js +1 -1
  15. package/dist/packages/_es/Button.js +2 -2
  16. package/dist/packages/_es/Calendar.js +22 -24
  17. package/dist/packages/_es/CalendarItem.js +2 -2
  18. package/dist/packages/_es/Card.js +2 -2
  19. package/dist/packages/_es/Cascader.js +4 -3
  20. package/dist/packages/_es/Category.js +3 -3
  21. package/dist/packages/_es/CategoryPane.js +2 -2
  22. package/dist/packages/_es/Cell.js +1 -1
  23. package/dist/packages/_es/CellGroup.js +1 -1
  24. package/dist/packages/_es/Checkbox.js +2 -2
  25. package/dist/packages/_es/CheckboxGroup.js +1 -1
  26. package/dist/packages/_es/CircleProgress.js +1 -1
  27. package/dist/packages/_es/Col.js +1 -1
  28. package/dist/packages/_es/Collapse.js +1 -1
  29. package/dist/packages/_es/CollapseItem.js +1 -1
  30. package/dist/packages/_es/Comment.js +4 -4
  31. package/dist/packages/_es/ConfigProvider.js +4 -4
  32. package/dist/packages/_es/Countdown.js +4 -4
  33. package/dist/packages/_es/Countup.js +9 -12
  34. package/dist/packages/_es/DatePicker.js +3 -3
  35. package/dist/packages/_es/Dialog.js +4 -4
  36. package/dist/packages/_es/Divider.js +1 -1
  37. package/dist/packages/_es/Drag.js +1 -1
  38. package/dist/packages/_es/Ecard.js +1 -1
  39. package/dist/packages/_es/Elevator.js +1 -1
  40. package/dist/packages/_es/Ellipsis.js +1 -1
  41. package/dist/packages/_es/Empty.js +2 -2
  42. package/dist/packages/_es/FixedNav.js +1 -1
  43. package/dist/packages/_es/Form.js +26 -21
  44. package/dist/packages/_es/FormItem.js +3 -3
  45. package/dist/packages/_es/Grid.js +2 -2
  46. package/dist/packages/_es/GridItem.js +2 -2
  47. package/dist/packages/_es/Image.js +2 -2
  48. package/dist/packages/_es/ImagePreview.js +4 -4
  49. package/dist/packages/_es/Indicator.js +1 -1
  50. package/dist/packages/_es/InfiniteLoading.js +2 -2
  51. package/dist/packages/_es/Input.js +2 -4
  52. package/dist/packages/_es/InputNumber.js +23 -2
  53. package/dist/packages/_es/{Interceptor-5415601e.js → Interceptor-c05a39f2.js} +1 -1
  54. package/dist/packages/_es/Invoice.js +3 -3
  55. package/dist/packages/_es/Layout.js +1 -1
  56. package/dist/packages/_es/List.js +1 -1
  57. package/dist/packages/_es/Menu.js +2 -2
  58. package/dist/packages/_es/MenuItem.js +2 -2
  59. package/dist/packages/_es/Navbar.js +1 -1
  60. package/dist/packages/_es/Noticebar.js +5 -5
  61. package/dist/packages/_es/Notify.js +2 -2
  62. package/dist/packages/_es/NumberKeyboard.js +2 -2
  63. package/dist/packages/_es/Overlay.js +3 -1
  64. package/dist/packages/_es/Pagination.js +1 -1
  65. package/dist/packages/_es/Picker.js +7 -7
  66. package/dist/packages/_es/Popover.js +7 -7
  67. package/dist/packages/_es/Popup.js +2 -2
  68. package/dist/packages/_es/Price.js +1 -1
  69. package/dist/packages/_es/Progress.js +1 -1
  70. package/dist/packages/_es/PullRefresh.js +3 -2
  71. package/dist/packages/_es/Radio.js +2 -2
  72. package/dist/packages/_es/RadioGroup.js +2 -2
  73. package/dist/packages/_es/Range.js +1 -1
  74. package/dist/packages/_es/Rate.js +4 -4
  75. package/dist/packages/_es/Row.js +1 -1
  76. package/dist/packages/_es/Searchbar.js +1 -1
  77. package/dist/packages/_es/ShortPassword.js +2 -2
  78. package/dist/packages/_es/SideNavbar.js +1 -1
  79. package/dist/packages/_es/SideNavbarItem.js +1 -1
  80. package/dist/packages/_es/Signature.js +1 -1
  81. package/dist/packages/_es/Skeleton.js +1 -1
  82. package/dist/packages/_es/Sku.js +8 -8
  83. package/dist/packages/_es/Step.js +1 -1
  84. package/dist/packages/_es/Steps.js +1 -1
  85. package/dist/packages/_es/Sticky.js +125 -5
  86. package/dist/packages/_es/SubSideNavbar.js +1 -1
  87. package/dist/packages/_es/Swipe.js +1 -1
  88. package/dist/packages/_es/Swiper.js +2 -2
  89. package/dist/packages/_es/SwiperItem.js +2 -2
  90. package/dist/packages/_es/Switch.js +1 -1
  91. package/dist/packages/_es/TabPane.js +2 -2
  92. package/dist/packages/_es/Tabbar.js +2 -2
  93. package/dist/packages/_es/TabbarItem.js +2 -2
  94. package/dist/packages/_es/Table.js +12 -6
  95. package/dist/packages/_es/Tabs.js +5 -4
  96. package/dist/packages/_es/Tag.js +1 -1
  97. package/dist/packages/_es/Textarea.js +1 -1
  98. package/dist/packages/_es/TimeDetail.js +1 -1
  99. package/dist/packages/_es/TimePannel.js +1 -1
  100. package/dist/packages/_es/TimeSelect.js +2 -2
  101. package/dist/packages/_es/Toast.js +2 -2
  102. package/dist/packages/_es/Tour.js +2 -2
  103. package/dist/packages/_es/TrendArrow.js +1 -1
  104. package/dist/packages/_es/Uploader.js +5 -4
  105. package/dist/packages/_es/Video.js +1 -1
  106. package/dist/packages/_es/Watermark.js +2 -2
  107. package/dist/packages/_es/{common-21e9de3d.js → common-8775d905.js} +1 -1
  108. package/dist/packages/_es/{component-8f0be7eb.js → component-0fbad28e.js} +3 -3
  109. package/dist/packages/_es/{index-c9b21ed1.js → index-3a5098e4.js} +15 -12
  110. package/dist/packages/_es/{index-dc2ebe90.js → index-5ffbc437.js} +2 -2
  111. package/dist/packages/_es/{index-43c34ac6.js → index-97b44e6c.js} +1 -0
  112. package/dist/packages/_es/{index.vue_vue_type_script_lang-dba4283d.js → index.vue_vue_type_script_lang-2852286e.js} +1 -1
  113. package/dist/packages/_es/{index.vue_vue_type_script_lang-7b265520.js → index.vue_vue_type_script_lang-cdf21a24.js} +2 -2
  114. package/dist/packages/_es/{mountComponent-f2c53efb.js → mountComponent-a895e3f1.js} +1 -1
  115. package/dist/packages/avatargroup/index.scss +0 -3
  116. package/dist/packages/sticky/index.scss +0 -10
  117. package/dist/smartips/web-types.json +4 -10
  118. package/dist/style.css +1 -1
  119. package/dist/styles/themes/default.scss +54 -156
  120. package/dist/styles/themes/jdb.scss +54 -156
  121. package/dist/styles/themes/jddkh.scss +54 -156
  122. package/dist/styles/themes/jdt.scss +54 -156
  123. package/dist/types/__VUE/avatar/index.vue.d.ts +11 -27
  124. package/dist/types/__VUE/avatar/types.d.ts +3 -0
  125. package/dist/types/__VUE/avatargroup/index.vue.d.ts +18 -15
  126. package/dist/types/__VUE/calendar/index.vue.d.ts +1 -1
  127. package/dist/types/__VUE/calendaritem/index.vue.d.ts +7 -8
  128. package/dist/types/__VUE/calendaritem/type.d.ts +0 -8
  129. package/dist/types/__VUE/circleprogress/index.vue.d.ts +3 -3
  130. package/dist/types/__VUE/configprovider/index.vue.d.ts +3 -4
  131. package/dist/types/__VUE/form/common.d.ts +2 -2
  132. package/dist/types/__VUE/form/index.vue.d.ts +4 -4
  133. package/dist/types/__VUE/formitem/types.d.ts +2 -2
  134. package/dist/types/__VUE/picker/common.d.ts +4 -4
  135. package/dist/types/__VUE/picker/index.vue.d.ts +9 -10
  136. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +1 -1
  137. package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
  138. package/dist/types/__VUE/sticky/index.vue.d.ts +11 -8
  139. package/dist/types/__VUE/swipe/index.vue.d.ts +2 -2
  140. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  141. package/dist/types/__VUE/table/common.d.ts +21 -6
  142. package/dist/types/__VUE/table/renderColumn.d.ts +20 -6
  143. package/dist/types/__VUE/tabs/hooks.d.ts +2 -2
  144. package/dist/types/__VUE/tabs/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
  146. package/dist/types/index.d.ts +1 -1
  147. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  148. package/dist/types/utils/useTouch/index.d.ts +2 -2
  149. package/package.json +1 -1
  150. package/dist/packages/_es/index.vue_vue_type_script_lang-89366761.js +0 -151
@@ -1,151 +0,0 @@
1
- import { ref, reactive, computed, watch, onMounted, onUnmounted, h, unref } from "vue";
2
- import { c as createComponent } from "./component-8f0be7eb.js";
3
- import { u as useRect } from "./index-29892cda.js";
4
- const { componentName, create } = createComponent("sticky");
5
- const _sfc_main = create({
6
- props: {
7
- position: {
8
- type: String,
9
- default: "top"
10
- },
11
- top: {
12
- type: [Number, String],
13
- default: 0
14
- },
15
- bottom: {
16
- type: [Number, String],
17
- default: 0
18
- },
19
- container: {
20
- type: Object
21
- },
22
- zIndex: {
23
- type: [Number, String],
24
- default: 2e3
25
- }
26
- },
27
- emits: ["change", "scroll"],
28
- setup(props, { emit, slots }) {
29
- const root = ref();
30
- const state = reactive({
31
- width: 0,
32
- height: 0,
33
- fixed: false,
34
- transform: 0
35
- });
36
- const rootStyle = computed(() => {
37
- const { fixed, width, height } = state;
38
- if (fixed) {
39
- return {
40
- width: `${width}px`,
41
- height: `${height}px`
42
- };
43
- }
44
- });
45
- const stickyStyle = computed(() => {
46
- if (!state.fixed)
47
- return;
48
- const style = {
49
- width: `${state.width}px`,
50
- height: `${state.height}px`,
51
- [props.position]: `${offset.value}px`,
52
- zIndex: +props.zIndex
53
- };
54
- if (state.transform)
55
- style.transform = `translate3d(0, ${state.transform}px, 0)`;
56
- return style;
57
- });
58
- const offset = computed(() => {
59
- return props.position === "top" ? props.top : props.bottom;
60
- });
61
- const isHidden = (elementRef) => {
62
- const el = unref(elementRef);
63
- if (!el)
64
- return false;
65
- const style = window.getComputedStyle(el);
66
- const hidden = style.display === "none";
67
- const parentHidden = el.offsetParent === null && style.position !== "fixed";
68
- return hidden || parentHidden;
69
- };
70
- const isExistRoot = () => {
71
- if (!root.value || isHidden(root))
72
- return false;
73
- return true;
74
- };
75
- const getScrollTop = (el) => {
76
- return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
77
- };
78
- const renderFixed = () => {
79
- var _a;
80
- return h(
81
- "view",
82
- {
83
- style: stickyStyle.value,
84
- class: state.fixed ? `${componentName} nut-sticky--fixed` : componentName
85
- },
86
- (_a = slots.default) == null ? void 0 : _a.call(slots)
87
- );
88
- };
89
- const onScroll = () => {
90
- if (!isExistRoot())
91
- return;
92
- const { container, position } = props;
93
- const scrollTop = getScrollTop(window);
94
- const rootRect = useRect(root);
95
- if (rootRect.width || rootRect.height) {
96
- state.width = rootRect.width;
97
- state.height = rootRect.height;
98
- }
99
- if (position === "top") {
100
- if (container) {
101
- const containerRect = useRect(container);
102
- const diff = containerRect.bottom - +offset.value - state.height;
103
- state.fixed = +offset.value > rootRect.top && containerRect.bottom > 0;
104
- state.transform = diff < 0 ? diff : 0;
105
- } else {
106
- state.fixed = offset.value > rootRect.top;
107
- }
108
- } else if (position === "bottom") {
109
- const clientHeight = document.documentElement.clientHeight;
110
- if (container) {
111
- const containerRect = useRect(container);
112
- const diff = clientHeight - containerRect.top - +offset.value - state.height;
113
- state.fixed = clientHeight - +offset.value < rootRect.bottom && clientHeight > containerRect.top;
114
- state.transform = diff < 0 ? -diff : 0;
115
- } else {
116
- state.fixed = clientHeight - +offset.value < rootRect.bottom;
117
- }
118
- }
119
- emit("scroll", {
120
- top: scrollTop,
121
- fixed: state.fixed
122
- });
123
- };
124
- watch(
125
- () => state.fixed,
126
- (val) => {
127
- emit("change", val);
128
- }
129
- );
130
- onMounted(() => {
131
- window.addEventListener("scroll", onScroll);
132
- onScroll();
133
- });
134
- onUnmounted(() => {
135
- window.removeEventListener("scroll", onScroll);
136
- });
137
- return () => {
138
- return h(
139
- "view",
140
- {
141
- style: rootStyle.value,
142
- ref: root
143
- },
144
- [renderFixed()]
145
- );
146
- };
147
- }
148
- });
149
- export {
150
- _sfc_main as _
151
- };