@nutui/nutui 4.0.9 → 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 (168) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +15382 -0
  4. package/dist/nutui.umd.js +1 -7
  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 +96 -152
  59. package/dist/packages/_es/MenuItem.js +117 -172
  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 -441
  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 +130 -179
  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/packages/col/index.scss +2 -2
  126. package/dist/packages/menuitem/index.scss +7 -10
  127. package/dist/packages/searchbar/index.scss +4 -0
  128. package/dist/smartips/web-types.json +2 -2
  129. package/dist/style.css +1 -1
  130. package/dist/styles/themes/default.scss +158 -55
  131. package/dist/styles/themes/jdb.scss +158 -55
  132. package/dist/styles/themes/jddkh.scss +158 -55
  133. package/dist/styles/themes/jdt.scss +158 -55
  134. package/dist/types/__VUE/address/index.vue.d.ts +1 -1
  135. package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
  136. package/dist/types/__VUE/image/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  138. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  139. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  141. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  142. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  143. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  144. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  145. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/table/common.d.ts +55 -2
  147. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  148. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  149. package/dist/types/index.d.ts +1 -1
  150. package/package.json +2 -2
  151. package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
  152. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  153. package/dist/packages/_es/common-b9a5e726.js +0 -145
  154. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  155. package/dist/packages/_es/index-29892cda.js +0 -33
  156. package/dist/packages/_es/index-43c34ac6.js +0 -30
  157. package/dist/packages/_es/index-54d03fc1.js +0 -8
  158. package/dist/packages/_es/index-79c5dc33.js +0 -10
  159. package/dist/packages/_es/index-7a7385e4.js +0 -67
  160. package/dist/packages/_es/index-87422be8.js +0 -942
  161. package/dist/packages/_es/index-da0a7662.js +0 -259
  162. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  163. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  164. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  165. package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
  166. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  167. package/dist/packages/_es/raf-729dad54.js +0 -25
  168. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
@@ -1,165 +1,118 @@
1
- import { c as createComponent } from "./component-81a4c1d0.js";
2
- import { inject, reactive, computed, watch, onMounted, getCurrentInstance, onBeforeUnmount, h } from "vue";
3
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
4
- import { CheckNormal, Checked, CheckDisabled } from "@nutui/icons-vue";
1
+ import { c as D } from "./component-234624bc.js";
2
+ import { inject as I, reactive as z, computed as r, watch as S, onMounted as P, getCurrentInstance as p, onBeforeUnmount as M, h as b } from "vue";
3
+ import { p as j } from "./pxCheck-38173291.js";
4
+ import { CheckNormal as L, Checked as N, CheckDisabled as O } from "@nutui/icons-vue";
5
5
  import "../locale/lang";
6
- const component = (componentName2, components) => {
7
- return {
8
- components,
9
- props: {
10
- modelValue: {
11
- type: Boolean,
12
- default: false
13
- },
14
- disabled: {
15
- type: Boolean,
16
- default: false
17
- },
18
- textPosition: {
19
- type: String,
20
- default: "right"
21
- },
22
- iconSize: {
23
- type: [String, Number],
24
- default: ""
25
- },
26
- label: {
27
- type: String,
28
- default: ""
29
- },
30
- indeterminate: {
31
- type: Boolean,
32
- default: false
33
- },
34
- shape: {
35
- type: String,
36
- default: "round"
37
- // button
38
- }
6
+ const T = (c, h) => ({
7
+ components: h,
8
+ props: {
9
+ modelValue: {
10
+ type: Boolean,
11
+ default: !1
39
12
  },
40
- emits: ["change", "update:modelValue"],
41
- setup(props, { emit, slots }) {
42
- const parent = inject("parent", null);
43
- const state = reactive({
44
- partialSelect: props.indeterminate
45
- });
46
- const hasParent = computed(() => !!parent);
47
- const pValue = computed(() => {
48
- if (hasParent.value) {
49
- return parent.value.value.includes(props.label);
50
- } else {
51
- return props.modelValue;
52
- }
53
- });
54
- const pDisabled = computed(() => {
55
- return hasParent.value ? parent.disabled.value ? parent.disabled.value : props.disabled : props.disabled;
56
- });
57
- const checked = computed(() => !!props.modelValue);
58
- const color = computed(() => {
59
- return !pDisabled.value ? state.partialSelect ? "nut-checkbox__icon--indeterminate" : !pValue.value ? "nut-checkbox__icon--unchecked" : "nut-checkbox__icon" : "nut-checkbox__icon--disable";
13
+ disabled: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ textPosition: {
18
+ type: String,
19
+ default: "right"
20
+ },
21
+ iconSize: {
22
+ type: [String, Number],
23
+ default: ""
24
+ },
25
+ label: {
26
+ type: String,
27
+ default: ""
28
+ },
29
+ indeterminate: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ shape: {
34
+ type: String,
35
+ default: "round"
36
+ // button
37
+ }
38
+ },
39
+ emits: ["change", "update:modelValue"],
40
+ setup(t, { emit: v, slots: e }) {
41
+ const n = I("parent", null), u = z({
42
+ partialSelect: t.indeterminate
43
+ }), d = r(() => !!n), k = r(() => d.value ? n.value.value.includes(t.label) : t.modelValue), o = r(() => d.value && n.disabled.value ? n.disabled.value : t.disabled), _ = r(() => !!t.modelValue), y = r(() => o.value ? "nut-checkbox__icon--disable" : u.partialSelect ? "nut-checkbox__icon--indeterminate" : k.value ? "nut-checkbox__icon" : "nut-checkbox__icon--unchecked");
44
+ let m = "";
45
+ const x = (a, i) => {
46
+ m = "click", v("update:modelValue", a), v("change", a, i);
47
+ };
48
+ S(
49
+ () => t.modelValue,
50
+ (a) => {
51
+ m == "click" ? m = "" : v("change", a);
52
+ }
53
+ );
54
+ const V = () => {
55
+ const { iconSize: a } = t, i = {
56
+ CheckNormal: e.icon ? e.icon : h.CheckNormal,
57
+ Checked: e.checkedIcon ? e.checkedIcon : h.Checked,
58
+ CheckDisabled: e.indeterminate ? e.indeterminate : h.CheckDisabled
59
+ }, f = u.partialSelect ? i.CheckDisabled : k.value ? i.Checked : i.CheckNormal, l = j(a);
60
+ return b(f, {
61
+ width: l,
62
+ height: l,
63
+ size: l,
64
+ class: y.value
60
65
  });
61
- let updateType = "";
62
- const emitChange = (value, label) => {
63
- updateType = "click";
64
- emit("update:modelValue", value);
65
- emit("change", value, label);
66
- };
67
- watch(
68
- () => props.modelValue,
69
- (v) => {
70
- if (updateType == "click") {
71
- updateType = "";
72
- } else {
73
- emit("change", v);
74
- }
75
- }
66
+ }, s = () => {
67
+ var a;
68
+ return b(
69
+ "view",
70
+ {
71
+ class: `${c}__label ${o.value ? `${c}__label--disabled` : ""}`
72
+ },
73
+ (a = e.default) == null ? void 0 : a.call(e)
76
74
  );
77
- const renderIcon = () => {
78
- const { iconSize } = props;
79
- const iconNodeMap = {
80
- CheckNormal: slots.icon ? slots.icon : components.CheckNormal,
81
- Checked: slots.checkedIcon ? slots.checkedIcon : components.Checked,
82
- CheckDisabled: slots.indeterminate ? slots.indeterminate : components.CheckDisabled
83
- };
84
- const iconNode = state.partialSelect ? iconNodeMap.CheckDisabled : !pValue.value ? iconNodeMap.CheckNormal : iconNodeMap.Checked;
85
- const size = pxCheck(iconSize);
86
- return h(iconNode, {
87
- width: size,
88
- height: size,
89
- size,
90
- class: color.value
91
- });
92
- };
93
- const renderLabel = () => {
94
- var _a;
95
- return h(
96
- "view",
97
- {
98
- class: `${componentName2}__label ${pDisabled.value ? `${componentName2}__label--disabled` : ""}`
99
- },
100
- (_a = slots.default) == null ? void 0 : _a.call(slots)
101
- );
102
- };
103
- const renderButton = () => {
104
- var _a;
105
- return h(
106
- "view",
107
- {
108
- class: `${componentName2}__button ${pValue.value && `${componentName2}__button--active`} ${pDisabled.value ? `${componentName2}__button--disabled` : ""}`
109
- },
110
- (_a = slots.default) == null ? void 0 : _a.call(slots)
111
- );
112
- };
113
- const handleClick = (e) => {
114
- var _a, _b;
115
- if (pDisabled.value)
116
- return;
117
- if (checked.value && state.partialSelect) {
118
- state.partialSelect = false;
119
- emitChange(checked.value, (_a = slots.default) == null ? void 0 : _a.call(slots)[0].children);
75
+ }, w = () => {
76
+ var a;
77
+ return b(
78
+ "view",
79
+ {
80
+ class: `${c}__button ${k.value && `${c}__button--active`} ${o.value ? `${c}__button--disabled` : ""}`
81
+ },
82
+ (a = e.default) == null ? void 0 : a.call(e)
83
+ );
84
+ }, B = (a) => {
85
+ var i, f;
86
+ if (!o.value) {
87
+ if (_.value && u.partialSelect) {
88
+ u.partialSelect = !1, x(_.value, (i = e.default) == null ? void 0 : i.call(e)[0].children);
120
89
  return;
121
90
  }
122
- emitChange(!checked.value, (_b = slots.default) == null ? void 0 : _b.call(slots)[0].children);
123
- if (hasParent.value) {
124
- const value = parent.value.value;
125
- const max = parent.max.value;
126
- const { label } = props;
127
- const index = value.indexOf(label);
128
- if (index > -1) {
129
- value.splice(index, 1);
130
- } else if (index <= -1 && (value.length < max || !max)) {
131
- value.push(label);
132
- }
133
- parent.updateValue(value);
91
+ if (x(!_.value, (f = e.default) == null ? void 0 : f.call(e)[0].children), d.value) {
92
+ const l = n.value.value, $ = n.max.value, { label: g } = t, C = l.indexOf(g);
93
+ C > -1 ? l.splice(C, 1) : C <= -1 && (l.length < $ || !$) && l.push(g), n.updateValue(l);
134
94
  }
135
- };
136
- onMounted(() => {
137
- hasParent.value && parent.link(getCurrentInstance());
138
- });
139
- onBeforeUnmount(() => {
140
- hasParent.value && parent.unlink(getCurrentInstance());
141
- });
142
- watch(
143
- () => props.indeterminate,
144
- (newVal) => {
145
- state.partialSelect = newVal;
146
- }
147
- );
148
- return () => {
149
- return h(
150
- "view",
151
- {
152
- class: `${componentName2} ${componentName2}--${props.shape} ${props.textPosition === "left" ? `${componentName2}--reverse` : ""}`,
153
- onClick: handleClick
154
- },
155
- [props.shape == "button" ? renderButton() : [renderIcon(), renderLabel()]]
156
- );
157
- };
158
- }
159
- };
160
- };
161
- const { create, componentName } = createComponent("checkbox");
162
- const _sfc_main = create(component(componentName, { CheckNormal, Checked, CheckDisabled }));
95
+ }
96
+ };
97
+ return P(() => {
98
+ d.value && n.link(p());
99
+ }), M(() => {
100
+ d.value && n.unlink(p());
101
+ }), S(
102
+ () => t.indeterminate,
103
+ (a) => {
104
+ u.partialSelect = a;
105
+ }
106
+ ), () => b(
107
+ "view",
108
+ {
109
+ class: `${c} ${c}--${t.shape} ${t.textPosition === "left" ? `${c}--reverse` : ""}`,
110
+ onClick: B
111
+ },
112
+ [t.shape == "button" ? w() : [V(), s()]]
113
+ );
114
+ }
115
+ }), { create: U, componentName: q } = D("checkbox"), J = U(T(q, { CheckNormal: L, Checked: N, CheckDisabled: O }));
163
116
  export {
164
- _sfc_main as default
117
+ J as default
165
118
  };
@@ -1,9 +1,8 @@
1
- import { reactive, provide, computed, watch, h } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { u as useExpose } from "./index-79c5dc33.js";
1
+ import { reactive as h, provide as b, computed as n, watch as x, h as V } from "vue";
2
+ import { c as g } from "./component-234624bc.js";
3
+ import { u as i } from "./index-fadb0974.js";
4
4
  import "../locale/lang";
5
- const { create, componentName } = createComponent("checkbox-group");
6
- const _sfc_main = create({
5
+ const { create: m, componentName: y } = g("checkbox-group"), E = m({
7
6
  props: {
8
7
  modelValue: {
9
8
  type: Array,
@@ -11,7 +10,7 @@ const _sfc_main = create({
11
10
  },
12
11
  disabled: {
13
12
  type: Boolean,
14
- default: false
13
+ default: !1
15
14
  },
16
15
  max: {
17
16
  type: Number,
@@ -19,68 +18,48 @@ const _sfc_main = create({
19
18
  }
20
19
  },
21
20
  emits: ["change", "update:modelValue"],
22
- setup(props, { slots, emit }) {
23
- const state = reactive({
21
+ setup(o, { slots: u, emit: r }) {
22
+ const d = h({
24
23
  children: []
25
- });
26
- const link = (child) => {
27
- child.proxy && state.children.push(child.proxy);
24
+ }), c = (e) => {
25
+ e.proxy && d.children.push(e.proxy);
26
+ }, t = (e) => {
27
+ e.proxy && (d.children = d.children.filter((a) => a !== e.proxy));
28
+ }, s = (e) => {
29
+ r("update:modelValue", e), r("change", e);
30
+ }, p = (e) => {
31
+ const a = [];
32
+ e && d.children.forEach((l) => {
33
+ l != null && l.disabled || a.push(l == null ? void 0 : l.label);
34
+ }), r("update:modelValue", a);
35
+ }, f = () => {
36
+ const e = d.children.filter((a) => a != null && a.disabled ? !1 : !o.modelValue.includes(a.label)).map((a) => a.label);
37
+ r("update:modelValue", e);
28
38
  };
29
- const unlink = (child) => {
30
- child.proxy && (state.children = state.children.filter((p) => p !== child.proxy));
31
- };
32
- const updateValue = (value) => {
33
- emit("update:modelValue", value);
34
- emit("change", value);
35
- };
36
- const toggleAll = (checked) => {
37
- const values = [];
38
- if (checked) {
39
- state.children.forEach((item) => {
40
- if (!(item == null ? void 0 : item.disabled)) {
41
- values.push(item == null ? void 0 : item.label);
42
- }
43
- });
44
- }
45
- emit("update:modelValue", values);
46
- };
47
- const toggleReverse = () => {
48
- const value = state.children.filter((item) => {
49
- if (item == null ? void 0 : item.disabled) {
50
- return false;
51
- } else {
52
- return !props.modelValue.includes(item.label);
53
- }
54
- }).map((item) => item.label);
55
- emit("update:modelValue", value);
56
- };
57
- provide("parent", {
58
- value: computed(() => props.modelValue),
59
- disabled: computed(() => props.disabled),
60
- max: computed(() => props.max),
61
- updateValue,
62
- link,
63
- unlink
64
- });
65
- watch(
66
- () => props.modelValue,
67
- (value) => {
68
- emit("change", value);
39
+ return b("parent", {
40
+ value: n(() => o.modelValue),
41
+ disabled: n(() => o.disabled),
42
+ max: n(() => o.max),
43
+ updateValue: s,
44
+ link: c,
45
+ unlink: t
46
+ }), x(
47
+ () => o.modelValue,
48
+ (e) => {
49
+ r("change", e);
69
50
  }
70
- );
71
- useExpose({ toggleAll, toggleReverse });
72
- return () => {
73
- var _a;
74
- return h(
51
+ ), i({ toggleAll: p, toggleReverse: f }), () => {
52
+ var e;
53
+ return V(
75
54
  "view",
76
55
  {
77
- class: componentName
56
+ class: y
78
57
  },
79
- (_a = slots.default) == null ? void 0 : _a.call(slots)
58
+ (e = u.default) == null ? void 0 : e.call(u)
80
59
  );
81
60
  };
82
61
  }
83
62
  });
84
63
  export {
85
- _sfc_main as default
64
+ E as default
86
65
  };
@@ -1,13 +1,12 @@
1
- import { useSlots, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot, toDisplayString, createCommentVNode } from "vue";
2
- import { g as isObject, c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { useSlots as v, computed as r, openBlock as s, createElementBlock as l, normalizeClass as _, normalizeStyle as p, createElementVNode as n, Fragment as $, renderList as b, renderSlot as C, toDisplayString as N, createCommentVNode as w } from "vue";
2
+ import { g as h, c as j } from "./component-234624bc.js";
3
+ import { _ as B } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "../locale/lang";
5
- const { componentName, create } = createComponent("circle-progress");
6
- const _sfc_main = create({
5
+ const { componentName: D, create: W } = j("circle-progress"), F = W({
7
6
  props: {
8
7
  progress: {
9
8
  type: [Number, String],
10
- required: true
9
+ required: !0
11
10
  },
12
11
  strokeWidth: {
13
12
  type: [Number, String],
@@ -31,122 +30,94 @@ const _sfc_main = create({
31
30
  },
32
31
  clockwise: {
33
32
  type: Boolean,
34
- default: true
33
+ default: !0
35
34
  }
36
35
  },
37
- setup(props) {
38
- const slotDefault = !!useSlots().default;
39
- const refRandomId = Math.random().toString(36).slice(-8);
40
- const classes = computed(() => {
41
- const prefixCls = componentName;
36
+ setup(e) {
37
+ const f = !!v().default, a = Math.random().toString(36).slice(-8), m = r(() => ({
38
+ [D]: !0
39
+ })), k = r(() => {
40
+ const t = e.clockwise ? 1 : 0;
41
+ return `M 50 50 m 0 -45 a 45 45 0 1 ${t} 0 90 a 45 45 0 1, ${t} 0 -90`;
42
+ }), y = r(() => h(e.color) ? `url(#${a})` : e.color), i = r(() => {
43
+ let t = 283, d = t * Number(e.progress) / 100;
42
44
  return {
43
- [prefixCls]: true
45
+ stroke: h(e.color) ? `url(#${a})` : e.color,
46
+ strokeDasharray: `${d}px ${t}px`
44
47
  };
45
- });
46
- const path = computed(() => {
47
- const isWise = props.clockwise ? 1 : 0;
48
- return `M 50 50 m 0 -45 a 45 45 0 1 ${isWise} 0 90 a 45 45 0 1, ${isWise} 0 -90`;
49
- });
50
- const hoverColor = computed(() => {
51
- return isObject(props.color) ? `url(#${refRandomId})` : props.color;
52
- });
53
- const hoverStyle = computed(() => {
54
- let perimeter = 283;
55
- let offset = perimeter * Number(props.progress) / 100;
56
- return {
57
- stroke: isObject(props.color) ? `url(#${refRandomId})` : props.color,
58
- strokeDasharray: `${offset}px ${perimeter}px`
59
- };
60
- });
61
- const pathStyle = computed(() => {
62
- return {
63
- stroke: props.pathColor
64
- };
65
- });
66
- const stop = computed(() => {
67
- if (!isObject(props.color)) {
48
+ }), u = r(() => ({
49
+ stroke: e.pathColor
50
+ })), S = r(() => {
51
+ if (!h(e.color))
68
52
  return;
69
- }
70
- let color = props.color;
71
- const colorArr = Object.keys(color).sort((a, b) => parseFloat(a) - parseFloat(b));
72
- let stopArr = [];
73
- colorArr.map((item) => {
74
- let obj = {
53
+ let t = e.color;
54
+ const d = Object.keys(t).sort((c, o) => parseFloat(c) - parseFloat(o));
55
+ let g = [];
56
+ return d.map((c) => {
57
+ let o = {
75
58
  key: "",
76
59
  value: ""
77
60
  };
78
- obj.key = item;
79
- obj.value = color[item];
80
- stopArr.push(obj);
81
- });
82
- return stopArr;
61
+ o.key = c, o.value = t[c], g.push(o);
62
+ }), g;
83
63
  });
84
64
  return {
85
- classes,
86
- hoverStyle,
87
- pathStyle,
88
- path,
89
- hoverColor,
90
- stop,
91
- slotDefault,
92
- refRandomId
65
+ classes: m,
66
+ hoverStyle: i,
67
+ pathStyle: u,
68
+ path: k,
69
+ hoverColor: y,
70
+ stop: S,
71
+ slotDefault: f,
72
+ refRandomId: a
93
73
  };
94
74
  }
95
- });
96
- const _hoisted_1 = { viewBox: "0 0 100 100" };
97
- const _hoisted_2 = ["id"];
98
- const _hoisted_3 = ["offset", "stop-color"];
99
- const _hoisted_4 = ["d", "stroke-width"];
100
- const _hoisted_5 = ["d", "stroke", "stroke-linecap", "stroke-width"];
101
- const _hoisted_6 = { class: "nut-circle-progress__text" };
102
- const _hoisted_7 = { key: 0 };
103
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
104
- return openBlock(), createElementBlock("div", {
105
- class: normalizeClass(_ctx.classes),
106
- style: normalizeStyle({ height: Number(_ctx.radius) * 2 + "px", width: Number(_ctx.radius) * 2 + "px" })
75
+ }), L = { viewBox: "0 0 100 100" }, O = ["id"], z = ["offset", "stop-color"], A = ["d", "stroke-width"], E = ["d", "stroke", "stroke-linecap", "stroke-width"], I = { class: "nut-circle-progress__text" }, M = { key: 0 };
76
+ function R(e, f, a, m, k, y) {
77
+ return s(), l("div", {
78
+ class: _(e.classes),
79
+ style: p({ height: Number(e.radius) * 2 + "px", width: Number(e.radius) * 2 + "px" })
107
80
  }, [
108
- (openBlock(), createElementBlock("svg", _hoisted_1, [
109
- createElementVNode("defs", null, [
110
- createElementVNode("linearGradient", {
111
- id: _ctx.refRandomId,
81
+ (s(), l("svg", L, [
82
+ n("defs", null, [
83
+ n("linearGradient", {
84
+ id: e.refRandomId,
112
85
  x1: "100%",
113
86
  y1: "0%",
114
87
  x2: "0%",
115
88
  y2: "0%"
116
89
  }, [
117
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stop, (item, index2) => {
118
- return openBlock(), createElementBlock("stop", {
119
- key: index2,
120
- offset: item.key,
121
- "stop-color": item.value
122
- }, null, 8, _hoisted_3);
123
- }), 128))
124
- ], 8, _hoisted_2)
90
+ (s(!0), l($, null, b(e.stop, (i, u) => (s(), l("stop", {
91
+ key: u,
92
+ offset: i.key,
93
+ "stop-color": i.value
94
+ }, null, 8, z))), 128))
95
+ ], 8, O)
125
96
  ]),
126
- createElementVNode("path", {
97
+ n("path", {
127
98
  class: "nut-circle-progress__path",
128
- style: normalizeStyle(_ctx.pathStyle),
129
- d: _ctx.path,
99
+ style: p(e.pathStyle),
100
+ d: e.path,
130
101
  fill: "none",
131
- "stroke-width": _ctx.strokeWidth
132
- }, " > ", 12, _hoisted_4),
133
- createElementVNode("path", {
102
+ "stroke-width": e.strokeWidth
103
+ }, " > ", 12, A),
104
+ n("path", {
134
105
  class: "nut-circle-progress__hover",
135
- style: normalizeStyle(_ctx.hoverStyle),
136
- d: _ctx.path,
106
+ style: p(e.hoverStyle),
107
+ d: e.path,
137
108
  fill: "none",
138
- stroke: _ctx.hoverColor,
139
- "stroke-linecap": _ctx.strokeLinecap,
140
- "stroke-width": _ctx.strokeWidth
141
- }, null, 12, _hoisted_5)
109
+ stroke: e.hoverColor,
110
+ "stroke-linecap": e.strokeLinecap,
111
+ "stroke-width": e.strokeWidth
112
+ }, null, 12, E)
142
113
  ])),
143
- createElementVNode("div", _hoisted_6, [
144
- renderSlot(_ctx.$slots, "default"),
145
- !_ctx.slotDefault ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(_ctx.progress) + "%", 1)) : createCommentVNode("", true)
114
+ n("div", I, [
115
+ C(e.$slots, "default"),
116
+ e.slotDefault ? w("", !0) : (s(), l("div", M, N(e.progress) + "%", 1))
146
117
  ])
147
118
  ], 6);
148
119
  }
149
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
120
+ const J = /* @__PURE__ */ B(F, [["render", R]]);
150
121
  export {
151
- index as default
122
+ J as default
152
123
  };