@nutui/nutui 4.0.0 → 4.0.1-2.beta-1

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 (285) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/README.md +34 -65
  3. package/dist/nutui.es.js +10 -17
  4. package/dist/nutui.js +16202 -0
  5. package/dist/nutui.umd.js +1 -7
  6. package/dist/packages/_es/ActionSheet.js +79 -94
  7. package/dist/packages/_es/Address.js +260 -345
  8. package/dist/packages/_es/AddressList.js +269 -354
  9. package/dist/packages/_es/Animate.js +46 -38
  10. package/dist/packages/_es/Audio.js +128 -180
  11. package/dist/packages/_es/AudioOperate.js +60 -52
  12. package/dist/packages/_es/Avatar.js +67 -75
  13. package/dist/packages/_es/AvatarGroup.js +23 -31
  14. package/dist/packages/_es/Backtop.js +59 -99
  15. package/dist/packages/_es/Badge.js +39 -46
  16. package/dist/packages/_es/Barrage.js +68 -145
  17. package/dist/packages/_es/Button.js +47 -66
  18. package/dist/packages/_es/Calendar.js +135 -152
  19. package/dist/packages/_es/CalendarItem.js +6 -6
  20. package/dist/packages/_es/Card.js +42 -56
  21. package/dist/packages/_es/Cascader.js +323 -433
  22. package/dist/packages/_es/Category.js +29 -39
  23. package/dist/packages/_es/CategoryPane.js +57 -83
  24. package/dist/packages/_es/Cell.js +56 -71
  25. package/dist/packages/_es/CellGroup.js +19 -27
  26. package/dist/packages/_es/Checkbox.js +109 -138
  27. package/dist/packages/_es/CheckboxGroup.js +38 -61
  28. package/dist/packages/_es/CircleProgress.js +67 -96
  29. package/dist/packages/_es/Col.js +23 -31
  30. package/dist/packages/_es/Collapse.js +37 -67
  31. package/dist/packages/_es/CollapseItem.js +91 -184
  32. package/dist/packages/_es/Comment.js +207 -279
  33. package/dist/packages/_es/ConfigProvider.js +38 -56
  34. package/dist/packages/_es/Countdown.js +100 -194
  35. package/dist/packages/_es/Countup.js +232 -428
  36. package/dist/packages/_es/DatePicker.js +169 -245
  37. package/dist/packages/_es/Dialog.js +163 -188
  38. package/dist/packages/_es/Divider.js +42 -40
  39. package/dist/packages/_es/Drag.js +70 -153
  40. package/dist/packages/_es/Ecard.js +64 -104
  41. package/dist/packages/_es/Elevator.js +144 -201
  42. package/dist/packages/_es/Ellipsis.js +95 -159
  43. package/dist/packages/_es/Empty.js +23 -39
  44. package/dist/packages/_es/FixedNav.js +93 -116
  45. package/dist/packages/_es/Form.js +108 -164
  46. package/dist/packages/_es/FormItem.js +48 -61
  47. package/dist/packages/_es/Grid.js +5 -6
  48. package/dist/packages/_es/GridItem.js +58 -84
  49. package/dist/packages/_es/Image.js +98 -88
  50. package/dist/packages/_es/ImagePreview.js +262 -392
  51. package/dist/packages/_es/Indicator.js +30 -34
  52. package/dist/packages/_es/InfiniteLoading.js +83 -117
  53. package/dist/packages/_es/Input.js +176 -223
  54. package/dist/packages/_es/InputNumber.js +81 -117
  55. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  56. package/dist/packages/_es/Invoice.js +105 -113
  57. package/dist/packages/_es/Layout.js +3 -4
  58. package/dist/packages/_es/List.js +147 -89
  59. package/dist/packages/_es/Menu.js +96 -152
  60. package/dist/packages/_es/MenuItem.js +117 -153
  61. package/dist/packages/_es/Navbar.js +103 -119
  62. package/dist/packages/_es/Noticebar.js +207 -273
  63. package/dist/packages/_es/Notify.js +110 -147
  64. package/dist/packages/_es/NumberKeyboard.js +127 -202
  65. package/dist/packages/_es/Overlay.js +53 -66
  66. package/dist/packages/_es/Pagination.js +70 -100
  67. package/dist/packages/_es/Picker.js +276 -425
  68. package/dist/packages/_es/Popover.js +122 -225
  69. package/dist/packages/_es/Popup.js +4 -4
  70. package/dist/packages/_es/Price.js +47 -80
  71. package/dist/packages/_es/Progress.js +63 -79
  72. package/dist/packages/_es/PullRefresh.js +96 -157
  73. package/dist/packages/_es/Radio.js +4 -4
  74. package/dist/packages/_es/RadioGroup.js +3 -3
  75. package/dist/packages/_es/Range.js +205 -329
  76. package/dist/packages/_es/Rate.js +93 -122
  77. package/dist/packages/_es/Row.js +21 -27
  78. package/dist/packages/_es/Searchbar.js +130 -160
  79. package/dist/packages/_es/ShortPassword.js +69 -93
  80. package/dist/packages/_es/SideNavbar.js +49 -59
  81. package/dist/packages/_es/SideNavbarItem.js +22 -32
  82. package/dist/packages/_es/Signature.js +83 -128
  83. package/dist/packages/_es/Skeleton.js +110 -130
  84. package/dist/packages/_es/Sku.js +251 -326
  85. package/dist/packages/_es/Step.js +60 -69
  86. package/dist/packages/_es/Steps.js +26 -31
  87. package/dist/packages/_es/Sticky.js +4 -4
  88. package/dist/packages/_es/SubSideNavbar.js +52 -56
  89. package/dist/packages/_es/Swipe.js +84 -137
  90. package/dist/packages/_es/Swiper.js +175 -310
  91. package/dist/packages/_es/SwiperItem.js +28 -44
  92. package/dist/packages/_es/Switch.js +55 -67
  93. package/dist/packages/_es/TabPane.js +32 -20
  94. package/dist/packages/_es/Tabbar.js +41 -52
  95. package/dist/packages/_es/TabbarItem.js +61 -81
  96. package/dist/packages/_es/Table.js +110 -148
  97. package/dist/packages/_es/Tabs.js +284 -205
  98. package/dist/packages/_es/Tag.js +44 -61
  99. package/dist/packages/_es/Textarea.js +80 -124
  100. package/dist/packages/_es/TimeDetail.js +49 -57
  101. package/dist/packages/_es/TimePannel.js +35 -31
  102. package/dist/packages/_es/TimeSelect.js +47 -68
  103. package/dist/packages/_es/Toast.js +150 -203
  104. package/dist/packages/_es/Tour.js +139 -175
  105. package/dist/packages/_es/TrendArrow.js +57 -58
  106. package/dist/packages/_es/Uploader.js +235 -359
  107. package/dist/packages/_es/Video.js +191 -298
  108. package/dist/packages/_es/Watermark.js +84 -98
  109. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  110. package/dist/packages/_es/common-d218746f.js +116 -0
  111. package/dist/packages/_es/component-234624bc.js +89 -0
  112. package/dist/packages/_es/index-14dfadc4.js +561 -0
  113. package/dist/packages/_es/index-192a3ef6.js +29 -0
  114. package/dist/packages/_es/index-360c5092.js +210 -0
  115. package/dist/packages/_es/index-496e6e05.js +24 -0
  116. package/dist/packages/_es/index-50eed3d9.js +7 -0
  117. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  118. package/dist/packages/_es/index-fadb0974.js +8 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  121. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  122. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  123. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  124. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  125. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  126. package/dist/packages/actionsheet/index.scss +2 -0
  127. package/dist/packages/actionsheet/style.mjs +0 -2
  128. package/dist/packages/address/index.scss +5 -2
  129. package/dist/packages/address/style.mjs +0 -3
  130. package/dist/packages/addresslist/index.scss +3 -0
  131. package/dist/packages/addresslist/style.mjs +0 -2
  132. package/dist/packages/audio/index.scss +2 -0
  133. package/dist/packages/audio/style.mjs +0 -1
  134. package/dist/packages/audiooperate/index.scss +2 -0
  135. package/dist/packages/audiooperate/style.mjs +0 -1
  136. package/dist/packages/badge/index.scss +3 -0
  137. package/dist/packages/button/index.scss +1 -1
  138. package/dist/packages/calendar/index.scss +3 -0
  139. package/dist/packages/calendar/style.mjs +0 -3
  140. package/dist/packages/card/index.scss +3 -0
  141. package/dist/packages/card/style.mjs +0 -2
  142. package/dist/packages/cascader/index.scss +4 -0
  143. package/dist/packages/cascader/style.mjs +0 -5
  144. package/dist/packages/cellgroup/index.scss +1 -1
  145. package/dist/packages/checkbox/index.scss +41 -0
  146. package/dist/packages/col/index.scss +2 -2
  147. package/dist/packages/comment/index.scss +2 -0
  148. package/dist/packages/comment/style.mjs +0 -1
  149. package/dist/packages/datepicker/index.scss +1 -2
  150. package/dist/packages/datepicker/style.mjs +0 -3
  151. package/dist/packages/dialog/index.scss +11 -0
  152. package/dist/packages/dialog/style.mjs +0 -3
  153. package/dist/packages/ecard/index.scss +2 -0
  154. package/dist/packages/ecard/style.mjs +0 -1
  155. package/dist/packages/fixednav/index.scss +2 -0
  156. package/dist/packages/fixednav/style.mjs +0 -1
  157. package/dist/packages/form/index.scss +1 -2
  158. package/dist/packages/form/style.mjs +0 -1
  159. package/dist/packages/formitem/index.scss +3 -0
  160. package/dist/packages/formitem/style.mjs +0 -1
  161. package/dist/packages/imagepreview/index.scss +5 -5
  162. package/dist/packages/imagepreview/style.mjs +0 -5
  163. package/dist/packages/input/index.scss +13 -13
  164. package/dist/packages/invoice/index.scss +6 -0
  165. package/dist/packages/invoice/style.mjs +0 -7
  166. package/dist/packages/list/index.scss +8 -8
  167. package/dist/packages/menuitem/index.scss +9 -10
  168. package/dist/packages/menuitem/style.mjs +0 -2
  169. package/dist/packages/navbar/index.scss +0 -1
  170. package/dist/packages/noticebar/index.scss +12 -2
  171. package/dist/packages/notify/index.scss +2 -0
  172. package/dist/packages/notify/style.mjs +0 -2
  173. package/dist/packages/numberkeyboard/index.scss +2 -0
  174. package/dist/packages/numberkeyboard/style.mjs +0 -2
  175. package/dist/packages/picker/index.scss +4 -9
  176. package/dist/packages/picker/style.mjs +0 -2
  177. package/dist/packages/popover/index.scss +2 -0
  178. package/dist/packages/popover/style.mjs +0 -2
  179. package/dist/packages/popup/index.scss +2 -0
  180. package/dist/packages/popup/style.mjs +0 -1
  181. package/dist/packages/price/index.scss +5 -10
  182. package/dist/packages/rate/index.scss +6 -9
  183. package/dist/packages/searchbar/index.scss +4 -0
  184. package/dist/packages/shortpassword/index.scss +18 -0
  185. package/dist/packages/shortpassword/style.mjs +0 -2
  186. package/dist/packages/signature/index.scss +2 -0
  187. package/dist/packages/signature/style.mjs +0 -1
  188. package/dist/packages/skeleton/index.scss +2 -0
  189. package/dist/packages/skeleton/style.mjs +0 -1
  190. package/dist/packages/sku/index.scss +4 -0
  191. package/dist/packages/sku/style.mjs +0 -4
  192. package/dist/packages/tabbaritem/index.scss +2 -0
  193. package/dist/packages/tabbaritem/style.mjs +0 -1
  194. package/dist/packages/tabs/index.scss +36 -2
  195. package/dist/packages/tabs/style.mjs +0 -1
  196. package/dist/packages/textarea/index.scss +2 -0
  197. package/dist/packages/timeselect/index.scss +2 -0
  198. package/dist/packages/timeselect/style.mjs +0 -2
  199. package/dist/packages/tour/index.scss +2 -0
  200. package/dist/packages/tour/style.mjs +0 -3
  201. package/dist/packages/uploader/index.scss +10 -2
  202. package/dist/packages/uploader/style.mjs +0 -2
  203. package/dist/resolver/index.d.ts +6 -0
  204. package/dist/resolver/index.js +1 -0
  205. package/dist/resolver/index.mjs +24 -0
  206. package/dist/resolver/package.json +20 -0
  207. package/dist/smartips/web-types.json +114 -15
  208. package/dist/style.css +1 -1
  209. package/dist/styles/themes/default.scss +155 -52
  210. package/dist/styles/themes/jdb.scss +155 -52
  211. package/dist/styles/themes/jddkh.scss +155 -52
  212. package/dist/styles/themes/jdt.scss +155 -52
  213. package/dist/styles/variables-jdb.scss +9 -1
  214. package/dist/styles/variables-jddkh.scss +9 -1
  215. package/dist/styles/variables-jdt.scss +9 -1
  216. package/dist/styles/variables.scss +8 -0
  217. package/dist/types/__VUE/address/index.vue.d.ts +2 -1
  218. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +1 -1
  219. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -1
  220. package/dist/types/__VUE/addresslist/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/animate/index.vue.d.ts +6 -0
  222. package/dist/types/__VUE/audiooperate/index.vue.d.ts +4 -4
  223. package/dist/types/__VUE/badge/index.vue.d.ts +9 -0
  224. package/dist/types/__VUE/button/type.d.ts +1 -0
  225. package/dist/types/__VUE/calendaritem/type.d.ts +1 -0
  226. package/dist/types/__VUE/collapse/index.vue.d.ts +31 -5
  227. package/dist/types/__VUE/collapseitem/index.vue.d.ts +117 -11
  228. package/dist/types/__VUE/configprovider/index.vue.d.ts +2 -2
  229. package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
  230. package/dist/types/__VUE/dialog/index.d.ts +1 -0
  231. package/dist/types/__VUE/dialog/index.vue.d.ts +1 -0
  232. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  233. package/dist/types/__VUE/image/index.vue.d.ts +14 -3
  234. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +9 -0
  235. package/dist/types/__VUE/imagepreview/index.vue.d.ts +1 -1
  236. package/dist/types/__VUE/input/index.vue.d.ts +27 -2
  237. package/dist/types/__VUE/list/index.vue.d.ts +42 -13
  238. package/dist/types/__VUE/list/type.d.ts +13 -0
  239. package/dist/types/__VUE/menu/index.vue.d.ts +0 -2
  240. package/dist/types/__VUE/menuitem/index.vue.d.ts +9 -17
  241. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  242. package/dist/types/__VUE/noticebar/index.vue.d.ts +5 -2
  243. package/dist/types/__VUE/picker/common.d.ts +2 -0
  244. package/dist/types/__VUE/picker/usePicker.d.ts +1 -1
  245. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  246. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  247. package/dist/types/__VUE/row/index.vue.d.ts +1 -1
  248. package/dist/types/__VUE/searchbar/index.vue.d.ts +121 -5
  249. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  250. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -2
  251. package/dist/types/__VUE/switch/index.vue.d.ts +1 -0
  252. package/dist/types/__VUE/table/common.d.ts +55 -2
  253. package/dist/types/__VUE/tabpane/index.vue.d.ts +1 -4
  254. package/dist/types/__VUE/tabs/hooks.d.ts +12 -0
  255. package/dist/types/__VUE/tabs/index.vue.d.ts +35 -5
  256. package/dist/types/__VUE/tabs/types.d.ts +12 -0
  257. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  258. package/dist/types/__VUE/toast/index.vue.d.ts +11 -4
  259. package/dist/types/__VUE/uploader/type.d.ts +2 -1
  260. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  261. package/dist/types/index.d.ts +1 -2
  262. package/dist/types/resolver/index.d.ts +6 -0
  263. package/dist/types/utils/date.d.ts +4 -0
  264. package/dist/types/utils/useTaroRect/index.d.ts +1 -1
  265. package/dist/types/utils/util.d.ts +1 -1
  266. package/package.json +13 -6
  267. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  268. package/dist/packages/_es/common-b9a5e726.js +0 -145
  269. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  270. package/dist/packages/_es/index-29892cda.js +0 -33
  271. package/dist/packages/_es/index-2ae3ae87.js +0 -846
  272. package/dist/packages/_es/index-43c34ac6.js +0 -30
  273. package/dist/packages/_es/index-54d03fc1.js +0 -8
  274. package/dist/packages/_es/index-79c5dc33.js +0 -10
  275. package/dist/packages/_es/index-7a7385e4.js +0 -67
  276. package/dist/packages/_es/index-991c279f.js +0 -244
  277. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  278. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  279. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  280. package/dist/packages/_es/interceptor-956b24fc.js +0 -29
  281. package/dist/packages/_es/mountComponent-1ece4110.js +0 -39
  282. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  283. package/dist/packages/_es/raf-729dad54.js +0 -25
  284. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
  285. /package/dist/types/utils/{interceptor.d.ts → Interceptor.d.ts} +0 -0
@@ -1,147 +1,118 @@
1
- import { c as createComponent } from "./component-81a4c1d0.js";
2
- import { inject, reactive, computed, watch, onMounted, getCurrentInstance, 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
- }
6
+ const T = (c, h) => ({
7
+ components: h,
8
+ props: {
9
+ modelValue: {
10
+ type: Boolean,
11
+ default: !1
34
12
  },
35
- emits: ["change", "update:modelValue"],
36
- setup(props, { emit, slots }) {
37
- const parent = inject("parent", null);
38
- const state = reactive({
39
- partialSelect: props.indeterminate
40
- });
41
- const hasParent = computed(() => !!parent);
42
- const pValue = computed(() => {
43
- if (hasParent.value) {
44
- return parent.value.value.includes(props.label);
45
- } else {
46
- return props.modelValue;
47
- }
48
- });
49
- const pDisabled = computed(() => {
50
- return hasParent.value ? parent.disabled.value ? parent.disabled.value : props.disabled : props.disabled;
51
- });
52
- const checked = computed(() => !!props.modelValue);
53
- const color = computed(() => {
54
- return !pDisabled.value ? !pValue.value ? "nut-checkbox__icon--unchecked" : state.partialSelect ? "nut-checkbox__icon--indeterminate" : "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
55
65
  });
56
- let updateType = "";
57
- const emitChange = (value, label) => {
58
- updateType = "click";
59
- emit("update:modelValue", value);
60
- emit("change", value, label);
61
- };
62
- watch(
63
- () => props.modelValue,
64
- (v) => {
65
- if (updateType == "click") {
66
- updateType = "";
67
- } else {
68
- emit("change", v);
69
- }
70
- }
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)
71
74
  );
72
- const renderIcon = () => {
73
- const { iconSize } = props;
74
- const iconNodeMap = {
75
- CheckNormal: slots.icon ? slots.icon : components.CheckNormal,
76
- Checked: slots.checkedIcon ? slots.checkedIcon : components.Checked,
77
- CheckDisabled: slots.indeterminate ? slots.indeterminate : components.CheckDisabled
78
- };
79
- const iconNode = !pValue.value ? iconNodeMap.CheckNormal : state.partialSelect ? iconNodeMap.CheckDisabled : iconNodeMap.Checked;
80
- const size = pxCheck(iconSize);
81
- return h(iconNode, {
82
- width: size,
83
- height: size,
84
- size,
85
- class: color.value
86
- });
87
- };
88
- const renderLabel = () => {
89
- var _a;
90
- return h(
91
- "view",
92
- {
93
- class: `${componentName2}__label ${pDisabled.value ? `${componentName2}__label--disabled` : ""}`
94
- },
95
- (_a = slots.default) == null ? void 0 : _a.call(slots)
96
- );
97
- };
98
- const handleClick = (e) => {
99
- var _a, _b;
100
- if (pDisabled.value)
101
- return;
102
- if (checked.value && state.partialSelect) {
103
- state.partialSelect = false;
104
- 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);
105
89
  return;
106
90
  }
107
- emitChange(!checked.value, (_b = slots.default) == null ? void 0 : _b.call(slots)[0].children);
108
- if (hasParent.value) {
109
- const value = parent.value.value;
110
- const max = parent.max.value;
111
- const { label } = props;
112
- const index = value.indexOf(label);
113
- if (index > -1) {
114
- value.splice(index, 1);
115
- } else if (index <= -1 && (value.length < max || !max)) {
116
- value.push(label);
117
- }
118
- parent.updateValue(value);
119
- }
120
- };
121
- onMounted(() => {
122
- hasParent.value && parent["relation"](getCurrentInstance());
123
- });
124
- watch(
125
- () => props.indeterminate,
126
- (newVal) => {
127
- state.partialSelect = newVal;
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);
128
94
  }
129
- );
130
- return () => {
131
- return h(
132
- "view",
133
- {
134
- class: `${componentName2} ${props.textPosition === "left" ? `${componentName2}--reverse` : ""}`,
135
- onClick: handleClick
136
- },
137
- [renderIcon(), renderLabel()]
138
- );
139
- };
140
- }
141
- };
142
- };
143
- const { create, componentName } = createComponent("checkbox");
144
- 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 }));
145
116
  export {
146
- _sfc_main as default
117
+ J as default
147
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,70 +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 relation = (child) => {
27
- if (child.proxy) {
28
- state.children.push(child.proxy);
29
- }
30
- };
31
- const updateValue = (value) => {
32
- emit("update:modelValue", value);
33
- emit("change", value);
34
- };
35
- const toggleAll = (checked) => {
36
- let values = [];
37
- if (!!checked) {
38
- state.children.forEach((item) => {
39
- if (!(item == null ? void 0 : item.disabled)) {
40
- values.push(item == null ? void 0 : item.label);
41
- }
42
- });
43
- }
44
- emit("update:modelValue", values);
45
- };
46
- const toggleReverse = () => {
47
- let values = props.modelValue.slice();
48
- state.children.forEach((item) => {
49
- let findIndex = values.findIndex((value) => value === item.label);
50
- if (findIndex > -1) {
51
- values.splice(findIndex, 1);
52
- } else {
53
- if (!(item == null ? void 0 : item.disabled)) {
54
- values.push(item == null ? void 0 : item.label);
55
- }
56
- }
57
- });
58
- emit("update:modelValue", values);
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);
59
38
  };
60
- provide("parent", {
61
- value: computed(() => props.modelValue),
62
- disabled: computed(() => props.disabled),
63
- max: computed(() => props.max),
64
- updateValue,
65
- relation
66
- });
67
- watch(
68
- () => props.modelValue,
69
- (value) => {
70
- 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);
71
50
  }
72
- );
73
- useExpose({ toggleAll, toggleReverse });
74
- return () => {
75
- var _a;
76
- return h(
51
+ ), i({ toggleAll: p, toggleReverse: f }), () => {
52
+ var e;
53
+ return V(
77
54
  "view",
78
55
  {
79
- class: componentName
56
+ class: y
80
57
  },
81
- (_a = slots.default) == null ? void 0 : _a.call(slots)
58
+ (e = u.default) == null ? void 0 : e.call(u)
82
59
  );
83
60
  };
84
61
  }
85
62
  });
86
63
  export {
87
- _sfc_main as default
64
+ E as default
88
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
  };
@@ -1,9 +1,8 @@
1
- import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { inject as c, computed as n, openBlock as a, createElementBlock as p, normalizeClass as l, normalizeStyle as u, renderSlot as f } from "vue";
2
+ import { c as i } from "./component-234624bc.js";
3
+ import { _ as m } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "../locale/lang";
5
- const { componentName, create } = createComponent("col");
6
- const _sfc_main = create({
5
+ const { componentName: d, create: g } = i("col"), y = g({
7
6
  props: {
8
7
  span: {
9
8
  type: [String, Number],
@@ -15,38 +14,31 @@ const _sfc_main = create({
15
14
  }
16
15
  },
17
16
  emits: [],
18
- setup(props) {
19
- const prefixCls = componentName;
20
- const gutter = inject("gutter");
21
- const classes = computed(() => {
22
- return {
23
- [prefixCls]: true,
24
- [prefixCls + "-gutter"]: gutter,
25
- ["nut-col-" + props.span]: true,
26
- ["nut-col-offset-" + props.offset]: true
27
- };
28
- });
29
- const style = computed(() => {
30
- return {
31
- paddingLeft: gutter / 2 + "px",
32
- paddingRight: gutter / 2 + "px"
33
- };
34
- });
17
+ setup(e) {
18
+ const r = d, t = c("gutter"), s = n(() => ({
19
+ [r]: !0,
20
+ [r + "-gutter"]: t,
21
+ ["nut-col-" + e.span]: !0,
22
+ ["nut-col-offset-" + e.offset]: !0
23
+ })), o = n(() => ({
24
+ paddingLeft: t / 2 + "px",
25
+ paddingRight: t / 2 + "px"
26
+ }));
35
27
  return {
36
- classes,
37
- style
28
+ classes: s,
29
+ style: o
38
30
  };
39
31
  }
40
32
  });
41
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
42
- return openBlock(), createElementBlock("view", {
43
- class: normalizeClass(_ctx.classes),
44
- style: normalizeStyle(_ctx.style)
33
+ function _(e, r, t, s, o, $) {
34
+ return a(), p("view", {
35
+ class: l(e.classes),
36
+ style: u(e.style)
45
37
  }, [
46
- renderSlot(_ctx.$slots, "default")
38
+ f(e.$slots, "default")
47
39
  ], 6);
48
40
  }
49
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
41
+ const b = /* @__PURE__ */ m(y, [["render", _]]);
50
42
  export {
51
- index as default
43
+ b as default
52
44
  };