@nutui/nutui 4.0.10-beta.1 → 4.0.10

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 (160) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +6550 -8291
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/_es/ActionSheet.js +78 -111
  6. package/dist/packages/_es/Address.js +250 -375
  7. package/dist/packages/_es/AddressList.js +269 -354
  8. package/dist/packages/_es/Animate.js +41 -58
  9. package/dist/packages/_es/Audio.js +128 -197
  10. package/dist/packages/_es/AudioOperate.js +60 -71
  11. package/dist/packages/_es/Avatar.js +66 -89
  12. package/dist/packages/_es/AvatarGroup.js +23 -31
  13. package/dist/packages/_es/Backtop.js +59 -99
  14. package/dist/packages/_es/Badge.js +36 -47
  15. package/dist/packages/_es/Barrage.js +68 -147
  16. package/dist/packages/_es/Button.js +47 -66
  17. package/dist/packages/_es/Calendar.js +135 -157
  18. package/dist/packages/_es/CalendarItem.js +6 -6
  19. package/dist/packages/_es/Card.js +42 -56
  20. package/dist/packages/_es/Cascader.js +315 -474
  21. package/dist/packages/_es/Category.js +29 -39
  22. package/dist/packages/_es/CategoryPane.js +57 -83
  23. package/dist/packages/_es/Cell.js +56 -71
  24. package/dist/packages/_es/CellGroup.js +19 -27
  25. package/dist/packages/_es/Checkbox.js +109 -156
  26. package/dist/packages/_es/CheckboxGroup.js +38 -59
  27. package/dist/packages/_es/CircleProgress.js +67 -96
  28. package/dist/packages/_es/Col.js +23 -31
  29. package/dist/packages/_es/Collapse.js +33 -58
  30. package/dist/packages/_es/CollapseItem.js +78 -108
  31. package/dist/packages/_es/Comment.js +207 -279
  32. package/dist/packages/_es/ConfigProvider.js +37 -55
  33. package/dist/packages/_es/Countdown.js +100 -212
  34. package/dist/packages/_es/Countup.js +232 -445
  35. package/dist/packages/_es/DatePicker.js +162 -265
  36. package/dist/packages/_es/Dialog.js +161 -213
  37. package/dist/packages/_es/Divider.js +42 -57
  38. package/dist/packages/_es/Drag.js +70 -153
  39. package/dist/packages/_es/Ecard.js +64 -104
  40. package/dist/packages/_es/Elevator.js +143 -219
  41. package/dist/packages/_es/Ellipsis.js +95 -178
  42. package/dist/packages/_es/Empty.js +23 -39
  43. package/dist/packages/_es/FixedNav.js +93 -116
  44. package/dist/packages/_es/Form.js +107 -178
  45. package/dist/packages/_es/FormItem.js +48 -61
  46. package/dist/packages/_es/Grid.js +5 -6
  47. package/dist/packages/_es/GridItem.js +58 -84
  48. package/dist/packages/_es/Image.js +90 -129
  49. package/dist/packages/_es/ImagePreview.js +256 -412
  50. package/dist/packages/_es/Indicator.js +30 -34
  51. package/dist/packages/_es/InfiniteLoading.js +83 -136
  52. package/dist/packages/_es/Input.js +160 -264
  53. package/dist/packages/_es/InputNumber.js +81 -117
  54. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  55. package/dist/packages/_es/Invoice.js +104 -130
  56. package/dist/packages/_es/Layout.js +3 -4
  57. package/dist/packages/_es/List.js +117 -215
  58. package/dist/packages/_es/Menu.js +95 -150
  59. package/dist/packages/_es/MenuItem.js +109 -154
  60. package/dist/packages/_es/Navbar.js +103 -119
  61. package/dist/packages/_es/Noticebar.js +197 -312
  62. package/dist/packages/_es/Notify.js +110 -166
  63. package/dist/packages/_es/NumberKeyboard.js +127 -202
  64. package/dist/packages/_es/Overlay.js +52 -80
  65. package/dist/packages/_es/Pagination.js +70 -100
  66. package/dist/packages/_es/Picker.js +275 -437
  67. package/dist/packages/_es/Popover.js +122 -225
  68. package/dist/packages/_es/Popup.js +4 -4
  69. package/dist/packages/_es/Price.js +44 -82
  70. package/dist/packages/_es/Progress.js +63 -79
  71. package/dist/packages/_es/PullRefresh.js +95 -173
  72. package/dist/packages/_es/Radio.js +4 -4
  73. package/dist/packages/_es/RadioGroup.js +3 -3
  74. package/dist/packages/_es/Range.js +204 -347
  75. package/dist/packages/_es/Rate.js +92 -141
  76. package/dist/packages/_es/Row.js +21 -27
  77. package/dist/packages/_es/Searchbar.js +123 -174
  78. package/dist/packages/_es/ShortPassword.js +69 -93
  79. package/dist/packages/_es/SideNavbar.js +49 -80
  80. package/dist/packages/_es/SideNavbarItem.js +22 -32
  81. package/dist/packages/_es/Signature.js +83 -146
  82. package/dist/packages/_es/Skeleton.js +110 -130
  83. package/dist/packages/_es/Sku.js +250 -343
  84. package/dist/packages/_es/Step.js +59 -86
  85. package/dist/packages/_es/Steps.js +26 -31
  86. package/dist/packages/_es/Sticky.js +4 -4
  87. package/dist/packages/_es/SubSideNavbar.js +52 -74
  88. package/dist/packages/_es/Swipe.js +83 -155
  89. package/dist/packages/_es/Swiper.js +174 -311
  90. package/dist/packages/_es/SwiperItem.js +28 -44
  91. package/dist/packages/_es/Switch.js +55 -68
  92. package/dist/packages/_es/TabPane.js +30 -41
  93. package/dist/packages/_es/Tabbar.js +41 -52
  94. package/dist/packages/_es/TabbarItem.js +61 -82
  95. package/dist/packages/_es/Table.js +109 -165
  96. package/dist/packages/_es/Tabs.js +240 -388
  97. package/dist/packages/_es/Tag.js +44 -61
  98. package/dist/packages/_es/Textarea.js +80 -124
  99. package/dist/packages/_es/TimeDetail.js +49 -76
  100. package/dist/packages/_es/TimePannel.js +34 -48
  101. package/dist/packages/_es/TimeSelect.js +47 -68
  102. package/dist/packages/_es/Toast.js +144 -218
  103. package/dist/packages/_es/Tour.js +138 -192
  104. package/dist/packages/_es/TrendArrow.js +57 -77
  105. package/dist/packages/_es/Uploader.js +234 -359
  106. package/dist/packages/_es/Video.js +191 -316
  107. package/dist/packages/_es/Watermark.js +84 -117
  108. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  109. package/dist/packages/_es/common-d218746f.js +116 -0
  110. package/dist/packages/_es/component-234624bc.js +89 -0
  111. package/dist/packages/_es/index-14dfadc4.js +561 -0
  112. package/dist/packages/_es/index-192a3ef6.js +29 -0
  113. package/dist/packages/_es/index-360c5092.js +210 -0
  114. package/dist/packages/_es/index-496e6e05.js +24 -0
  115. package/dist/packages/_es/index-50eed3d9.js +7 -0
  116. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  117. package/dist/packages/_es/index-fadb0974.js +8 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  121. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  122. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  123. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  124. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  125. package/dist/smartips/web-types.json +1 -1
  126. package/dist/style.css +1 -1
  127. package/dist/styles/themes/default.scss +154 -51
  128. package/dist/styles/themes/jdb.scss +154 -51
  129. package/dist/styles/themes/jddkh.scss +154 -51
  130. package/dist/styles/themes/jdt.scss +154 -51
  131. package/dist/types/__VUE/address/index.vue.d.ts +1 -1
  132. package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
  133. package/dist/types/__VUE/image/index.vue.d.ts +2 -2
  134. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  135. package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
  136. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  138. package/dist/types/__VUE/table/common.d.ts +55 -2
  139. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  141. package/dist/types/index.d.ts +1 -1
  142. package/package.json +2 -2
  143. package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
  144. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  145. package/dist/packages/_es/common-b9a5e726.js +0 -145
  146. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  147. package/dist/packages/_es/index-29892cda.js +0 -33
  148. package/dist/packages/_es/index-43c34ac6.js +0 -30
  149. package/dist/packages/_es/index-54d03fc1.js +0 -8
  150. package/dist/packages/_es/index-79c5dc33.js +0 -10
  151. package/dist/packages/_es/index-7a7385e4.js +0 -67
  152. package/dist/packages/_es/index-87422be8.js +0 -942
  153. package/dist/packages/_es/index-da0a7662.js +0 -259
  154. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  155. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  156. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  157. package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
  158. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  159. package/dist/packages/_es/raf-729dad54.js +0 -25
  160. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
@@ -1,145 +0,0 @@
1
- import { shallowReactive, getCurrentInstance, provide, markRaw, isVNode, computed, h } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
4
- function flattenVNodes(children, childName) {
5
- const result = [];
6
- const traverse = (children2) => {
7
- if (!Array.isArray(children2))
8
- return;
9
- children2.forEach((child) => {
10
- var _a;
11
- if (!isVNode(child))
12
- return;
13
- if (childName) {
14
- if (child.type && child.type.name === childName) {
15
- result.push(child);
16
- return;
17
- }
18
- } else {
19
- result.push(child);
20
- }
21
- if ((_a = child.component) == null ? void 0 : _a.subTree) {
22
- traverse(child.component.subTree.children);
23
- }
24
- if (child.children) {
25
- traverse(child.children);
26
- }
27
- });
28
- };
29
- traverse(children);
30
- return result;
31
- }
32
- function sortChildren(parent, internalChildren, childName) {
33
- const vnodes = flattenVNodes(parent.subTree.children, childName);
34
- internalChildren.sort((a, b) => {
35
- return vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode);
36
- });
37
- }
38
- function useProvide(key, childName) {
39
- const internalChildren = shallowReactive([]);
40
- const parent = getCurrentInstance();
41
- const add = (child) => {
42
- if (!child.proxy)
43
- return;
44
- internalChildren.push(markRaw(child));
45
- sortChildren(parent, internalChildren, childName);
46
- };
47
- const remove = (child) => {
48
- internalChildren.splice(internalChildren.indexOf(markRaw(child)), 1);
49
- };
50
- const extend = Object.assign;
51
- return (value) => {
52
- provide(
53
- key,
54
- extend(
55
- {
56
- add,
57
- remove,
58
- internalChildren
59
- },
60
- value
61
- )
62
- );
63
- return {
64
- internalChildren
65
- };
66
- };
67
- }
68
- const { componentName } = createComponent("grid");
69
- const GRID_KEY = Symbol("grid");
70
- const gridProps = {
71
- // 列数
72
- columnNum: {
73
- type: [Number, String],
74
- default: 4
75
- },
76
- // 是否显示边框
77
- border: {
78
- type: Boolean,
79
- default: true
80
- },
81
- // 格子之间间隔距离
82
- gutter: {
83
- type: [Number, String],
84
- default: 0
85
- },
86
- // 是否内容居中
87
- center: {
88
- type: Boolean,
89
- default: true
90
- },
91
- // 是否固定正方形
92
- square: {
93
- type: Boolean,
94
- default: false
95
- },
96
- // 内容与文字翻转
97
- reverse: {
98
- type: Boolean,
99
- default: false
100
- },
101
- // 内容排列方向
102
- direction: {
103
- type: String
104
- },
105
- // 是否开启点击反馈
106
- clickable: {
107
- type: Boolean,
108
- default: false
109
- }
110
- };
111
- const component = {
112
- props: gridProps,
113
- setup(props, { slots }) {
114
- useProvide(GRID_KEY, `${componentName}-item`)({ props });
115
- const rootClass = computed(() => {
116
- const prefixCls = componentName;
117
- return {
118
- [prefixCls]: true,
119
- [`${prefixCls}--border`]: props.border && !props.gutter
120
- };
121
- });
122
- const rootStyle = computed(() => {
123
- const style = {};
124
- if (props.gutter) {
125
- style.paddingLeft = pxCheck(props.gutter);
126
- }
127
- return style;
128
- });
129
- return () => {
130
- var _a;
131
- return h(
132
- "view",
133
- {
134
- class: rootClass.value,
135
- style: rootStyle.value
136
- },
137
- (_a = slots.default) == null ? void 0 : _a.call(slots)
138
- );
139
- };
140
- }
141
- };
142
- export {
143
- GRID_KEY as G,
144
- component as c
145
- };
@@ -1,145 +0,0 @@
1
- import { defineComponent } from "vue";
2
- import locale from "../locale/lang";
3
- const TypeOfFun = (value) => {
4
- if (null === value) {
5
- return "null";
6
- }
7
- const type = typeof value;
8
- if ("undefined" === type || "string" === type) {
9
- return type;
10
- }
11
- const typeString = toString.call(value);
12
- switch (typeString) {
13
- case "[object Array]":
14
- return "array";
15
- case "[object Date]":
16
- return "date";
17
- case "[object Boolean]":
18
- return "boolean";
19
- case "[object Number]":
20
- return "number";
21
- case "[object Function]":
22
- return "function";
23
- case "[object RegExp]":
24
- return "regexp";
25
- case "[object Object]":
26
- if (void 0 !== value.nodeType) {
27
- if (3 == value.nodeType) {
28
- return /\S/.test(value.nodeValue) ? "textnode" : "whitespace";
29
- } else {
30
- return "element";
31
- }
32
- } else {
33
- return "object";
34
- }
35
- default:
36
- return "unknow";
37
- }
38
- };
39
- const isArray = Array.isArray;
40
- const isDate = (val) => val instanceof Date;
41
- const isFunction = (val) => typeof val === "function";
42
- const isString = (val) => typeof val === "string";
43
- const isObject = (val) => val !== null && typeof val === "object";
44
- const isPromise = (val) => {
45
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
46
- };
47
- const docu = document;
48
- const body = docu.body;
49
- const getPropByPath = (obj, keyPath) => {
50
- try {
51
- return keyPath.split(".").reduce((prev, curr) => prev[curr], obj);
52
- } catch (error) {
53
- return "";
54
- }
55
- };
56
- const floatData = (format, dataOp, mapOps) => {
57
- let mergeFormat = Object.assign({}, format);
58
- let mergeMapOps = Object.assign({}, mapOps);
59
- if (Object.keys(dataOp).length > 0) {
60
- Object.keys(mergeFormat).forEach((keys) => {
61
- if (mergeMapOps.hasOwnProperty(keys)) {
62
- const tof = TypeOfFun(mergeMapOps[keys]);
63
- if (tof == "function") {
64
- mergeFormat[keys] = mergeMapOps[keys](dataOp);
65
- }
66
- if (tof == "string") {
67
- mergeFormat[keys] = dataOp[mergeMapOps[keys]];
68
- }
69
- } else {
70
- if (dataOp[keys])
71
- mergeFormat[keys] = dataOp[keys];
72
- }
73
- });
74
- return mergeFormat;
75
- }
76
- return format;
77
- };
78
- function myFixed(num, digit = 2) {
79
- if (Object.is(parseFloat(num), NaN)) {
80
- return console.log(`传入的值:${num}不是一个数字`);
81
- }
82
- num = parseFloat(num);
83
- return (Math.round((num + Number.EPSILON) * Math.pow(10, digit)) / Math.pow(10, digit)).toFixed(digit);
84
- }
85
- function preventDefault(event, isStopPropagation) {
86
- if (typeof event.cancelable !== "boolean" || event.cancelable) {
87
- event.preventDefault();
88
- }
89
- if (isStopPropagation) {
90
- event.stopPropagation();
91
- }
92
- }
93
- const padZero = (num, length = 2) => {
94
- num += "";
95
- while (num.length < length) {
96
- num = "0" + num;
97
- }
98
- return num.toString();
99
- };
100
- const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
101
- const getScrollTopRoot = () => {
102
- return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
103
- };
104
- function createComponent(name) {
105
- const componentName = "nut-" + name;
106
- return {
107
- componentName,
108
- translate(keyPath, ...args) {
109
- const languages = locale.languages();
110
- const text = getPropByPath(languages, `${name.replace("-", "")}.${keyPath}`) || getPropByPath(languages, keyPath);
111
- return isFunction(text) ? text(...args) : text;
112
- },
113
- create: function(_component) {
114
- _component.baseName = name;
115
- _component.name = componentName;
116
- _component.install = (vue) => {
117
- vue.component(_component.name, _component);
118
- };
119
- return defineComponent(_component);
120
- },
121
- createDemo: function(_component) {
122
- _component.baseName = name;
123
- _component.name = "demo-" + name;
124
- return defineComponent(_component);
125
- }
126
- };
127
- }
128
- export {
129
- TypeOfFun as T,
130
- isDate as a,
131
- body as b,
132
- createComponent as c,
133
- preventDefault as d,
134
- clamp as e,
135
- isPromise as f,
136
- isObject as g,
137
- getPropByPath as h,
138
- isArray as i,
139
- isString as j,
140
- isFunction as k,
141
- getScrollTopRoot as l,
142
- myFixed as m,
143
- floatData as n,
144
- padZero as p
145
- };
@@ -1,33 +0,0 @@
1
- import { unref } from "vue";
2
- function isWindow(val) {
3
- return val === window;
4
- }
5
- const useRect = (elementRef) => {
6
- const element = unref(elementRef);
7
- if (isWindow(element)) {
8
- const width = element.innerWidth;
9
- const height = element.innerHeight;
10
- return {
11
- top: 0,
12
- left: 0,
13
- right: width,
14
- bottom: height,
15
- width,
16
- height
17
- };
18
- }
19
- if (element && element.getBoundingClientRect) {
20
- return element.getBoundingClientRect();
21
- }
22
- return {
23
- top: 0,
24
- left: 0,
25
- right: 0,
26
- bottom: 0,
27
- width: 0,
28
- height: 0
29
- };
30
- };
31
- export {
32
- useRect as u
33
- };
@@ -1,30 +0,0 @@
1
- import { ref, onMounted } from "vue";
2
- const overflowScrollReg = /scroll|auto|overlay/i;
3
- const defaultRoot = window;
4
- function isElement(node) {
5
- const ELEMENT_NODE_TYPE = 1;
6
- return node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === ELEMENT_NODE_TYPE;
7
- }
8
- function getScrollParent(el, root = defaultRoot) {
9
- let node = el;
10
- while (node && node !== root && isElement(node)) {
11
- const { overflowY } = window.getComputedStyle(node);
12
- if (overflowScrollReg.test(overflowY)) {
13
- return node;
14
- }
15
- node = node.parentNode;
16
- }
17
- return root;
18
- }
19
- function useScrollParent(el, root = defaultRoot) {
20
- const scrollParent = ref();
21
- onMounted(() => {
22
- if (el.value) {
23
- scrollParent.value = getScrollParent(el.value, root);
24
- }
25
- });
26
- return scrollParent;
27
- }
28
- export {
29
- useScrollParent as u
30
- };
@@ -1,8 +0,0 @@
1
- import { getCurrentInstance } from "vue";
2
- function useRouter() {
3
- const proxy = getCurrentInstance().proxy;
4
- return proxy.$router || null;
5
- }
6
- export {
7
- useRouter as u
8
- };
@@ -1,10 +0,0 @@
1
- import { getCurrentInstance } from "vue";
2
- function useExpose(apis) {
3
- const instance = getCurrentInstance();
4
- if (instance) {
5
- Object.assign(instance.proxy, apis);
6
- }
7
- }
8
- export {
9
- useExpose as u
10
- };
@@ -1,67 +0,0 @@
1
- import { ref } from "vue";
2
- const MIN_DISTANCE = 10;
3
- function getDirection(x, y) {
4
- if (x > y && x > MIN_DISTANCE) {
5
- return "horizontal";
6
- }
7
- if (y > x && y > MIN_DISTANCE) {
8
- return "vertical";
9
- }
10
- return "";
11
- }
12
- function useTouch() {
13
- const startX = ref(0);
14
- const startY = ref(0);
15
- const moveX = ref(0);
16
- const moveY = ref(0);
17
- const deltaX = ref(0);
18
- const deltaY = ref(0);
19
- const offsetX = ref(0);
20
- const offsetY = ref(0);
21
- const direction = ref("");
22
- const isVertical = () => direction.value === "vertical";
23
- const isHorizontal = () => direction.value === "horizontal";
24
- const reset = () => {
25
- deltaX.value = 0;
26
- deltaY.value = 0;
27
- offsetX.value = 0;
28
- offsetY.value = 0;
29
- direction.value = "";
30
- };
31
- const start = (event) => {
32
- reset();
33
- startX.value = event.touches[0].clientX;
34
- startY.value = event.touches[0].clientY;
35
- };
36
- const move = (event) => {
37
- const touch = event.touches[0];
38
- deltaX.value = touch.clientX - startX.value;
39
- deltaY.value = touch.clientY - startY.value;
40
- moveX.value = touch.clientX;
41
- moveY.value = touch.clientY;
42
- offsetX.value = Math.abs(deltaX.value);
43
- offsetY.value = Math.abs(deltaY.value);
44
- if (!direction.value) {
45
- direction.value = getDirection(offsetX.value, offsetY.value);
46
- }
47
- };
48
- return {
49
- move,
50
- start,
51
- reset,
52
- startX,
53
- startY,
54
- moveX,
55
- moveY,
56
- deltaX,
57
- deltaY,
58
- offsetX,
59
- offsetY,
60
- direction,
61
- isVertical,
62
- isHorizontal
63
- };
64
- }
65
- export {
66
- useTouch as u
67
- };