@nutui/nutui 4.2.2 → 4.2.4

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 (210) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +34 -21
  3. package/dist/nutui.es.js +1 -1
  4. package/dist/nutui.js +6465 -6441
  5. package/dist/nutui.umd.js +1 -1
  6. package/dist/packages/{Interceptor-6aab6fe0.js → Interceptor-WYVtGbGC.js} +1 -1
  7. package/dist/packages/actionsheet/ActionSheet.js +4 -4
  8. package/dist/packages/address/Address.js +5 -6
  9. package/dist/packages/addresslist/AddressList.js +6 -5
  10. package/dist/packages/animate/Animate.js +2 -2
  11. package/dist/packages/audio/Audio.js +5 -5
  12. package/dist/packages/audiooperate/AudioOperate.js +4 -4
  13. package/dist/packages/avatar/Avatar.js +5 -65
  14. package/dist/packages/avatarcropper/AvatarCropper.js +5 -5
  15. package/dist/packages/avatargroup/AvatarGroup.js +4 -4
  16. package/dist/packages/backtop/Backtop.js +3 -3
  17. package/dist/packages/badge/Badge.js +2 -2
  18. package/dist/packages/barrage/Barrage.js +2 -2
  19. package/dist/packages/button/Button.js +2 -2
  20. package/dist/packages/calendar/Calendar.js +9 -10
  21. package/dist/packages/calendaritem/CalendarItem.js +6 -7
  22. package/dist/packages/card/Card.js +2 -2
  23. package/dist/packages/cascader/Cascader.js +10 -10
  24. package/dist/packages/cascader/index.css +1 -1
  25. package/dist/packages/category/Category.js +2 -2
  26. package/dist/packages/categorypane/CategoryPane.js +2 -2
  27. package/dist/packages/cell/Cell.js +4 -4
  28. package/dist/packages/cellgroup/CellGroup.js +2 -2
  29. package/dist/packages/checkbox/Checkbox.js +149 -152
  30. package/dist/packages/checkboxgroup/CheckboxGroup.js +5 -5
  31. package/dist/packages/circleprogress/CircleProgress.js +3 -3
  32. package/dist/packages/col/Col.js +6 -5
  33. package/dist/packages/collapse/Collapse.js +7 -6
  34. package/dist/packages/collapseitem/CollapseItem.js +9 -9
  35. package/dist/packages/comment/Comment.js +7 -7
  36. package/dist/packages/{common-1579352e.js → common-4inKawxR.js} +2 -2
  37. package/dist/packages/configprovider/ConfigProvider.js +1 -1
  38. package/dist/packages/countdown/Countdown.js +4 -4
  39. package/dist/packages/countup/Countup.js +2 -2
  40. package/dist/packages/datepicker/DatePicker.js +6 -6
  41. package/dist/packages/dialog/Dialog.js +7 -7
  42. package/dist/packages/divider/Divider.js +4 -4
  43. package/dist/packages/drag/Drag.js +3 -3
  44. package/dist/packages/ecard/Ecard.js +5 -5
  45. package/dist/packages/elevator/Elevator.js +7 -8
  46. package/dist/packages/ellipsis/Ellipsis.js +2 -2
  47. package/dist/packages/empty/Empty.js +5 -5
  48. package/dist/packages/fixednav/FixedNav.js +4 -4
  49. package/dist/packages/form/Form.js +15 -46
  50. package/dist/packages/formitem/FormItem.js +38 -24
  51. package/dist/packages/formitem/index.css +1 -1
  52. package/dist/packages/formitem/index.scss +25 -0
  53. package/dist/packages/grid/Grid.js +3 -3
  54. package/dist/packages/griditem/GridItem.js +5 -5
  55. package/dist/packages/image/Image.js +3 -3
  56. package/dist/packages/imagepreview/ImagePreview.js +11 -11
  57. package/dist/packages/index--uVlasFu.js +69 -0
  58. package/dist/packages/{index-914a76f0.js → index-NLe0VBkN.js} +6 -7
  59. package/dist/packages/{index-37ae1f41.js → index-rbZsBckW.js} +2 -2
  60. package/dist/packages/{index-c0fa0f6b.js → index-s3RgMhc7.js} +1 -1
  61. package/dist/packages/{index.vue_vue_type_script_lang-0185ccea.js → index.vue_vue_type_script_lang-54PRh3YM.js} +3 -3
  62. package/dist/packages/{index.vue_vue_type_script_lang-825ed1e0.js → index.vue_vue_type_script_lang-MJYVRFbp.js} +14 -9
  63. package/dist/packages/indicator/Indicator.js +3 -3
  64. package/dist/packages/infiniteloading/InfiniteLoading.js +6 -6
  65. package/dist/packages/input/Input.js +2 -2
  66. package/dist/packages/inputnumber/InputNumber.js +4 -4
  67. package/dist/packages/invoice/Invoice.js +11 -7
  68. package/dist/packages/invoice/index.css +1 -1
  69. package/dist/packages/layout/Layout.js +1 -1
  70. package/dist/packages/list/List.js +3 -3
  71. package/dist/packages/locale/lang/en-US.js +1 -1
  72. package/dist/packages/locale/lang/id-ID.js +1 -1
  73. package/dist/packages/locale/lang/index.js +1 -1
  74. package/dist/packages/locale/lang/zh-CN.js +1 -1
  75. package/dist/packages/locale/lang/zh-TW.js +1 -1
  76. package/dist/packages/menu/Menu.js +17 -52
  77. package/dist/packages/menuitem/MenuItem.js +8 -18
  78. package/dist/packages/{mountComponent-867a9167.js → mountComponent-uInXoTMp.js} +1 -1
  79. package/dist/packages/navbar/Navbar.js +2 -2
  80. package/dist/packages/navbar/index.css +1 -1
  81. package/dist/packages/navbar/index.scss +5 -16
  82. package/dist/packages/noticebar/Noticebar.js +3 -3
  83. package/dist/packages/notify/Notify.js +4 -4
  84. package/dist/packages/numberkeyboard/NumberKeyboard.js +5 -5
  85. package/dist/packages/overlay/Overlay.js +3 -3
  86. package/dist/packages/pagination/Pagination.js +4 -4
  87. package/dist/packages/picker/Picker.js +6 -6
  88. package/dist/packages/popover/Popover.js +9 -8
  89. package/dist/packages/popup/Popup.js +4 -4
  90. package/dist/packages/price/Price.js +2 -2
  91. package/dist/packages/progress/Progress.js +2 -2
  92. package/dist/packages/pullrefresh/PullRefresh.js +7 -7
  93. package/dist/packages/radio/Radio.js +4 -3
  94. package/dist/packages/radio/index.css +1 -1
  95. package/dist/packages/radio/index.scss +21 -0
  96. package/dist/packages/radiogroup/RadioGroup.js +3 -2
  97. package/dist/packages/radiogroup/index.scss +0 -5
  98. package/dist/packages/range/Range.js +5 -7
  99. package/dist/packages/rate/Rate.js +5 -5
  100. package/dist/packages/row/Row.js +6 -5
  101. package/dist/packages/searchbar/Searchbar.js +5 -5
  102. package/dist/packages/shortpassword/ShortPassword.js +5 -5
  103. package/dist/packages/sidenavbar/SideNavbar.js +2 -2
  104. package/dist/packages/sidenavbaritem/SideNavbarItem.js +2 -2
  105. package/dist/packages/signature/Signature.js +4 -4
  106. package/dist/packages/skeleton/Skeleton.js +3 -3
  107. package/dist/packages/sku/Sku.js +6 -6
  108. package/dist/packages/space/Space.js +1 -1
  109. package/dist/packages/step/Step.js +4 -3
  110. package/dist/packages/steps/Steps.js +3 -2
  111. package/dist/packages/sticky/Sticky.js +4 -4
  112. package/dist/packages/subsidenavbar/SubSideNavbar.js +2 -2
  113. package/dist/packages/swipe/Swipe.js +5 -4
  114. package/dist/packages/swipegroup/SwipeGroup.js +4 -3
  115. package/dist/packages/swiper/Swiper.js +9 -9
  116. package/dist/packages/swiperitem/SwiperItem.js +11 -5
  117. package/dist/packages/switch/Switch.js +2 -2
  118. package/dist/packages/tabbar/Tabbar.js +5 -4
  119. package/dist/packages/tabbaritem/TabbarItem.js +6 -5
  120. package/dist/packages/table/Table.js +4 -4
  121. package/dist/packages/tabpane/TabPane.js +2 -2
  122. package/dist/packages/tabs/Tabs.js +9 -9
  123. package/dist/packages/tabs/index.css +1 -1
  124. package/dist/packages/tabs/index.scss +114 -117
  125. package/dist/packages/tag/Tag.js +2 -2
  126. package/dist/packages/textarea/Textarea.js +4 -4
  127. package/dist/packages/textarea/index.css +1 -1
  128. package/dist/packages/textarea/index.scss +1 -0
  129. package/dist/packages/timedetail/TimeDetail.js +2 -2
  130. package/dist/packages/timepannel/TimePannel.js +2 -2
  131. package/dist/packages/timeselect/TimeSelect.js +5 -5
  132. package/dist/packages/toast/Toast.js +5 -5
  133. package/dist/packages/tour/Tour.js +6 -6
  134. package/dist/packages/trendarrow/TrendArrow.js +3 -3
  135. package/dist/packages/types-4IflWeQO.js +4 -0
  136. package/dist/packages/types-9wCQwtH3.js +4 -0
  137. package/dist/packages/types-Cq2YypZn.js +4 -0
  138. package/dist/packages/types-RCVUm7Nb.js +4 -0
  139. package/dist/packages/types-Ww4ErYJT.js +4 -0
  140. package/dist/packages/types-Ynmct7na.js +4 -0
  141. package/dist/packages/types-j71K23JP.js +4 -0
  142. package/dist/packages/types-odSRziQJ.js +4 -0
  143. package/dist/packages/types-qOrhXtA_.js +4 -0
  144. package/dist/packages/types-zeKkNDAq.js +4 -0
  145. package/dist/packages/uploader/Uploader.js +5 -5
  146. package/dist/packages/useChildren-GU_NVfD8.js +54 -0
  147. package/dist/packages/useParent-KIxqkovs.js +16 -0
  148. package/dist/packages/video/Video.js +4 -4
  149. package/dist/packages/watermark/Watermark.js +2 -2
  150. package/dist/smartips/web-types.json +55 -1
  151. package/dist/style.css +1 -1
  152. package/dist/style.js +1 -4
  153. package/dist/types/__VUE/address/index.vue.d.ts +3 -3
  154. package/dist/types/__VUE/avatar/index.vue.d.ts +1 -1
  155. package/dist/types/__VUE/avatar/types.d.ts +1 -0
  156. package/dist/types/__VUE/avatargroup/index.vue.d.ts +2 -2
  157. package/dist/types/__VUE/cell/index.vue.d.ts +1 -1
  158. package/dist/types/__VUE/checkbox/index.vue.d.ts +72 -1
  159. package/dist/types/__VUE/checkbox/types.d.ts +1 -0
  160. package/dist/types/__VUE/col/index.vue.d.ts +1 -0
  161. package/dist/types/__VUE/collapse/index.vue.d.ts +4 -29
  162. package/dist/types/__VUE/collapse/types.d.ts +5 -0
  163. package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -1
  164. package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
  165. package/dist/types/__VUE/divider/index.vue.d.ts +15 -1
  166. package/dist/types/__VUE/form/common.d.ts +9 -1
  167. package/dist/types/__VUE/form/index.vue.d.ts +18 -0
  168. package/dist/types/__VUE/form/types.d.ts +4 -1
  169. package/dist/types/__VUE/formitem/index.vue.d.ts +21 -1
  170. package/dist/types/__VUE/formitem/types.d.ts +2 -0
  171. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  172. package/dist/types/__VUE/image/index.vue.d.ts +1 -1
  173. package/dist/types/__VUE/layout/types.d.ts +1 -0
  174. package/dist/types/__VUE/menu/index.vue.d.ts +18 -9
  175. package/dist/types/__VUE/menu/types.d.ts +6 -0
  176. package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
  177. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  178. package/dist/types/__VUE/radio/index.vue.d.ts +14 -3
  179. package/dist/types/__VUE/radio/types.d.ts +5 -0
  180. package/dist/types/__VUE/radiogroup/index.vue.d.ts +8 -6
  181. package/dist/types/__VUE/sku/components/SkuStepper.vue.d.ts +1 -1
  182. package/dist/types/__VUE/sku/index.vue.d.ts +1 -1
  183. package/dist/types/__VUE/steps/types.d.ts +1 -0
  184. package/dist/types/__VUE/swipe/types.d.ts +1 -0
  185. package/dist/types/__VUE/swiper/types.d.ts +1 -0
  186. package/dist/types/__VUE/tabbar/types.d.ts +1 -0
  187. package/dist/types/__VUE/tabs/index.vue.d.ts +1 -1
  188. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  189. package/dist/types/__VUE/uploader/index.vue.d.ts +2 -28
  190. package/dist/types/index.d.ts +1 -1
  191. package/dist/types/utils/index.d.ts +1 -0
  192. package/dist/types/utils/useRelation/index.d.ts +2 -0
  193. package/dist/types/utils/useRelation/useChildren.d.ts +4 -0
  194. package/dist/types/utils/useRelation/useParent.d.ts +3 -0
  195. package/package.json +1 -1
  196. package/dist/packages/index-79c5dc33.js +0 -10
  197. package/dist/types/__VUE/checkbox/common.d.ts +0 -2
  198. package/dist/types/__VUE/menuitem/type.d.ts +0 -4
  199. package/dist/types/__VUE/picker/common.d.ts +0 -406
  200. /package/dist/packages/{_plugin-vue_export-helper-cc2b3d55.js → _plugin-vue_export-helper-yVxbj29m.js} +0 -0
  201. /package/dist/packages/{component-669c158a.js → component-TCzwHGVq.js} +0 -0
  202. /package/dist/packages/{index-7a7385e4.js → index-084nl_oE.js} +0 -0
  203. /package/dist/packages/{index-54d03fc1.js → index-Ii9XdkPy.js} +0 -0
  204. /package/dist/packages/{index-29892cda.js → index-rf29bejW.js} +0 -0
  205. /package/dist/packages/{index-97b44e6c.js → index-xDfQLRen.js} +0 -0
  206. /package/dist/packages/locale/lang/{baseLang-3a8457ac.js → baseLang-7uiEiO-2.js} +0 -0
  207. /package/dist/packages/{pxCheck-a27490eb.js → pxCheck-OnXlN1NC.js} +0 -0
  208. /package/dist/packages/{raf-729dad54.js → raf-MQjoO-Ag.js} +0 -0
  209. /package/dist/packages/{renderIcon-3d0fd47c.js → renderIcon--EgZu5_5.js} +0 -0
  210. /package/dist/packages/{util-6f26722f.js → util-4Jkyw4BJ.js} +0 -0
@@ -1,164 +1,161 @@
1
- import { c as createComponent } from "../component-669c158a.js";
2
1
  import { inject, reactive, computed, watch, onMounted, getCurrentInstance, onBeforeUnmount, h } from "vue";
3
- import { p as pxCheck } from "../pxCheck-a27490eb.js";
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
4
3
  import { CheckNormal, Checked, CheckDisabled } from "@nutui/icons-vue";
5
- const component = (componentName2, components) => {
6
- return {
7
- components,
8
- props: {
9
- modelValue: {
10
- type: Boolean,
11
- default: false
12
- },
13
- disabled: {
14
- type: Boolean,
15
- default: false
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: false
32
- },
33
- shape: {
34
- type: String,
35
- default: "round"
36
- // button
37
- }
4
+ import { p as pxCheck } from "../pxCheck-OnXlN1NC.js";
5
+ import { C as CHECKBOX_KEY } from "../types-zeKkNDAq.js";
6
+ const { create, componentName } = createComponent("checkbox");
7
+ const _sfc_main = create({
8
+ props: {
9
+ modelValue: {
10
+ type: Boolean,
11
+ default: false
38
12
  },
39
- emits: ["change", "update:modelValue"],
40
- setup(props, { emit, slots }) {
41
- const parent = inject("parent", null);
42
- const state = reactive({
43
- partialSelect: props.indeterminate
44
- });
45
- const hasParent = computed(() => !!parent);
46
- const pValue = computed(() => {
47
- if (hasParent.value) {
48
- return parent.value.value.includes(props.label);
13
+ disabled: {
14
+ type: Boolean,
15
+ default: false
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: false
32
+ },
33
+ shape: {
34
+ type: String,
35
+ default: "round"
36
+ // button
37
+ }
38
+ },
39
+ emits: ["change", "update:modelValue"],
40
+ setup(props, { emit, slots }) {
41
+ const parent = inject(CHECKBOX_KEY, null);
42
+ const state = reactive({
43
+ partialSelect: props.indeterminate
44
+ });
45
+ const hasParent = computed(() => !!parent);
46
+ const pValue = computed(() => {
47
+ if (hasParent.value) {
48
+ return parent.value.value.includes(props.label);
49
+ } else {
50
+ return props.modelValue;
51
+ }
52
+ });
53
+ const pDisabled = computed(() => {
54
+ return hasParent.value ? parent.disabled.value ? parent.disabled.value : props.disabled : props.disabled;
55
+ });
56
+ const checked = computed(() => !!props.modelValue);
57
+ const color = computed(() => {
58
+ return !pDisabled.value ? state.partialSelect ? "nut-checkbox__icon--indeterminate" : !pValue.value ? "nut-checkbox__icon--unchecked" : "nut-checkbox__icon" : "nut-checkbox__icon--disable";
59
+ });
60
+ let updateType = "";
61
+ const emitChange = (value, label) => {
62
+ updateType = "click";
63
+ emit("update:modelValue", value);
64
+ emit("change", value, label);
65
+ };
66
+ watch(
67
+ () => props.modelValue,
68
+ (v) => {
69
+ if (updateType == "click") {
70
+ updateType = "";
49
71
  } else {
50
- return props.modelValue;
51
- }
52
- });
53
- const pDisabled = computed(() => {
54
- return hasParent.value ? parent.disabled.value ? parent.disabled.value : props.disabled : props.disabled;
55
- });
56
- const checked = computed(() => !!props.modelValue);
57
- const color = computed(() => {
58
- return !pDisabled.value ? state.partialSelect ? "nut-checkbox__icon--indeterminate" : !pValue.value ? "nut-checkbox__icon--unchecked" : "nut-checkbox__icon" : "nut-checkbox__icon--disable";
59
- });
60
- let updateType = "";
61
- const emitChange = (value, label) => {
62
- updateType = "click";
63
- emit("update:modelValue", value);
64
- emit("change", value, label);
65
- };
66
- watch(
67
- () => props.modelValue,
68
- (v) => {
69
- if (updateType == "click") {
70
- updateType = "";
71
- } else {
72
- emit("change", v);
73
- }
74
- }
75
- );
76
- const renderIcon = () => {
77
- const { iconSize } = props;
78
- const iconNodeMap = {
79
- CheckNormal: slots.icon ? slots.icon : components.CheckNormal,
80
- Checked: slots.checkedIcon ? slots.checkedIcon : components.Checked,
81
- CheckDisabled: slots.indeterminate ? slots.indeterminate : components.CheckDisabled
82
- };
83
- const iconNode = state.partialSelect ? iconNodeMap.CheckDisabled : !pValue.value ? iconNodeMap.CheckNormal : iconNodeMap.Checked;
84
- const size = pxCheck(iconSize);
85
- return h(iconNode, {
86
- width: size,
87
- height: size,
88
- size,
89
- class: color.value
90
- });
91
- };
92
- const renderLabel = () => {
93
- var _a;
94
- return h(
95
- "view",
96
- {
97
- class: `${componentName2}__label ${pDisabled.value ? `${componentName2}__label--disabled` : ""}`
98
- },
99
- (_a = slots.default) == null ? void 0 : _a.call(slots)
100
- );
101
- };
102
- const renderButton = () => {
103
- var _a;
104
- return h(
105
- "view",
106
- {
107
- class: `${componentName2}__button ${pValue.value && `${componentName2}__button--active`} ${pDisabled.value ? `${componentName2}__button--disabled` : ""}`
108
- },
109
- (_a = slots.default) == null ? void 0 : _a.call(slots)
110
- );
111
- };
112
- const handleClick = () => {
113
- var _a, _b;
114
- if (pDisabled.value)
115
- return;
116
- if (checked.value && state.partialSelect) {
117
- state.partialSelect = false;
118
- emitChange(checked.value, (_a = slots.default) == null ? void 0 : _a.call(slots)[0].children);
119
- return;
120
- }
121
- emitChange(!checked.value, (_b = slots.default) == null ? void 0 : _b.call(slots)[0].children);
122
- if (hasParent.value) {
123
- const value = parent.value.value;
124
- const max = parent.max.value;
125
- const { label } = props;
126
- const index = value.indexOf(label);
127
- if (index > -1) {
128
- value.splice(index, 1);
129
- } else if (index <= -1 && (value.length < max || !max)) {
130
- value.push(label);
131
- }
132
- parent.updateValue(value);
72
+ emit("change", v);
133
73
  }
74
+ }
75
+ );
76
+ const renderIcon = () => {
77
+ const { iconSize } = props;
78
+ const iconNodeMap = {
79
+ CheckNormal: slots.icon ? slots.icon : CheckNormal,
80
+ Checked: slots.checkedIcon ? slots.checkedIcon : Checked,
81
+ CheckDisabled: slots.indeterminate ? slots.indeterminate : CheckDisabled
134
82
  };
135
- onMounted(() => {
136
- hasParent.value && parent.link(getCurrentInstance());
83
+ const iconNode = state.partialSelect ? iconNodeMap.CheckDisabled : !pValue.value ? iconNodeMap.CheckNormal : iconNodeMap.Checked;
84
+ const size = pxCheck(iconSize);
85
+ return h(iconNode, {
86
+ width: size,
87
+ height: size,
88
+ size,
89
+ class: color.value
137
90
  });
138
- onBeforeUnmount(() => {
139
- hasParent.value && parent.unlink(getCurrentInstance());
140
- });
141
- watch(
142
- () => props.indeterminate,
143
- (newVal) => {
144
- state.partialSelect = newVal;
91
+ };
92
+ const renderLabel = () => {
93
+ var _a;
94
+ return h(
95
+ "view",
96
+ {
97
+ class: `${componentName}__label ${pDisabled.value ? `${componentName}__label--disabled` : ""}`
98
+ },
99
+ (_a = slots.default) == null ? void 0 : _a.call(slots)
100
+ );
101
+ };
102
+ const renderButton = () => {
103
+ var _a;
104
+ return h(
105
+ "view",
106
+ {
107
+ class: `${componentName}__button ${pValue.value && `${componentName}__button--active`} ${pDisabled.value ? `${componentName}__button--disabled` : ""}`
108
+ },
109
+ (_a = slots.default) == null ? void 0 : _a.call(slots)
110
+ );
111
+ };
112
+ const handleClick = () => {
113
+ var _a, _b;
114
+ if (pDisabled.value)
115
+ return;
116
+ if (checked.value && state.partialSelect) {
117
+ state.partialSelect = false;
118
+ emitChange(checked.value, (_a = slots.default) == null ? void 0 : _a.call(slots)[0].children);
119
+ return;
120
+ }
121
+ emitChange(!checked.value, (_b = slots.default) == null ? void 0 : _b.call(slots)[0].children);
122
+ if (hasParent.value) {
123
+ const value = parent.value.value;
124
+ const max = parent.max.value;
125
+ const { label } = props;
126
+ const index = value.indexOf(label);
127
+ if (index > -1) {
128
+ value.splice(index, 1);
129
+ } else if (index <= -1 && (value.length < max || !max)) {
130
+ value.push(label);
145
131
  }
132
+ parent.updateValue(value);
133
+ }
134
+ };
135
+ onMounted(() => {
136
+ hasParent.value && parent.link(getCurrentInstance());
137
+ });
138
+ onBeforeUnmount(() => {
139
+ hasParent.value && parent.unlink(getCurrentInstance());
140
+ });
141
+ watch(
142
+ () => props.indeterminate,
143
+ (newVal) => {
144
+ state.partialSelect = newVal;
145
+ }
146
+ );
147
+ return () => {
148
+ return h(
149
+ "view",
150
+ {
151
+ class: `${componentName} ${componentName}--${props.shape} ${props.textPosition === "left" ? `${componentName}--reverse` : ""}`,
152
+ onClick: handleClick
153
+ },
154
+ [props.shape == "button" ? renderButton() : [renderIcon(), renderLabel()]]
146
155
  );
147
- return () => {
148
- return h(
149
- "view",
150
- {
151
- class: `${componentName2} ${componentName2}--${props.shape} ${props.textPosition === "left" ? `${componentName2}--reverse` : ""}`,
152
- onClick: handleClick
153
- },
154
- [props.shape == "button" ? renderButton() : [renderIcon(), renderLabel()]]
155
- );
156
- };
157
- }
158
- };
159
- };
160
- const { create, componentName } = createComponent("checkbox");
161
- const _sfc_main = create(component(componentName, { CheckNormal, Checked, CheckDisabled }));
156
+ };
157
+ }
158
+ });
162
159
  export {
163
160
  _sfc_main as default
164
161
  };
@@ -1,6 +1,6 @@
1
1
  import { reactive, provide, computed, watch, h } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
3
- import { u as useExpose } from "../index-79c5dc33.js";
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
+ import { C as CHECKBOX_KEY } from "../types-zeKkNDAq.js";
4
4
  const { create, componentName } = createComponent("checkbox-group");
5
5
  const _sfc_main = create({
6
6
  props: {
@@ -18,7 +18,7 @@ const _sfc_main = create({
18
18
  }
19
19
  },
20
20
  emits: ["change", "update:modelValue"],
21
- setup(props, { slots, emit }) {
21
+ setup(props, { slots, emit, expose }) {
22
22
  const state = reactive({
23
23
  children: []
24
24
  });
@@ -53,7 +53,7 @@ const _sfc_main = create({
53
53
  }).map((item) => item.label);
54
54
  emit("update:modelValue", value);
55
55
  };
56
- provide("parent", {
56
+ provide(CHECKBOX_KEY, {
57
57
  value: computed(() => props.modelValue),
58
58
  disabled: computed(() => props.disabled),
59
59
  max: computed(() => props.max),
@@ -67,7 +67,7 @@ const _sfc_main = create({
67
67
  emit("change", value);
68
68
  }
69
69
  );
70
- useExpose({ toggleAll, toggleReverse });
70
+ expose({ toggleAll, toggleReverse });
71
71
  return () => {
72
72
  var _a;
73
73
  return h(
@@ -1,7 +1,7 @@
1
1
  import { computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, Fragment, renderList, renderSlot, toDisplayString } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
3
- import { k as isObject } from "../util-6f26722f.js";
4
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
+ import { k as isObject } from "../util-4Jkyw4BJ.js";
4
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
5
5
  const { create } = createComponent("circle-progress");
6
6
  const _sfc_main = create({
7
7
  props: {
@@ -1,7 +1,8 @@
1
1
  import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
3
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
4
- const { componentName, create } = createComponent("col");
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
+ import { L as LAYOUT_KEY } from "../types-Ww4ErYJT.js";
4
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
5
+ const { create } = createComponent("col");
5
6
  const _sfc_main = create({
6
7
  props: {
7
8
  span: {
@@ -15,8 +16,8 @@ const _sfc_main = create({
15
16
  },
16
17
  emits: [],
17
18
  setup(props) {
18
- const prefixCls = componentName;
19
- const gutter = inject("gutter");
19
+ const prefixCls = "nut-col";
20
+ const gutter = inject(LAYOUT_KEY);
20
21
  const classes = computed(() => {
21
22
  return {
22
23
  [prefixCls]: true,
@@ -1,6 +1,7 @@
1
1
  import { ref, watch, provide, openBlock, createElementBlock, renderSlot } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
3
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
+ import { C as COLLAPSE_KEY } from "../types-4IflWeQO.js";
4
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
4
5
  const { create } = createComponent("collapse");
5
6
  const _sfc_main = create({
6
7
  props: {
@@ -15,7 +16,7 @@ const _sfc_main = create({
15
16
  },
16
17
  emits: ["update:modelValue", "change"],
17
18
  setup(props, { emit }) {
18
- const collapseDom = ref(null);
19
+ const nutCollapseRef = ref(null);
19
20
  const innerValue = ref(props.modelValue || (props.accordion ? "" : []));
20
21
  watch(
21
22
  () => props.modelValue,
@@ -57,15 +58,15 @@ const _sfc_main = create({
57
58
  }
58
59
  return false;
59
60
  };
60
- provide("collapseParent", {
61
+ provide(COLLAPSE_KEY, {
61
62
  updateVal,
62
63
  isExpanded
63
64
  });
64
- return { collapseDom };
65
+ return { nutCollapseRef };
65
66
  }
66
67
  });
67
68
  const _hoisted_1 = {
68
- ref: "collapseDom",
69
+ ref: "nutCollapseRef",
69
70
  class: "nut-collapse"
70
71
  };
71
72
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -1,9 +1,10 @@
1
- import { ref, inject, reactive, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, toDisplayString, createCommentVNode, normalizeStyle, createBlock, resolveDynamicComponent } from "vue";
1
+ import { ref, inject, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, toDisplayString, createCommentVNode, normalizeStyle, createBlock, resolveDynamicComponent } from "vue";
2
2
  import { DownArrow } from "@nutui/icons-vue";
3
- import { c as createComponent } from "../component-669c158a.js";
4
- import { r as renderIcon } from "../renderIcon-3d0fd47c.js";
5
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
6
- const { create, componentName } = createComponent("collapse-item");
3
+ import { c as createComponent } from "../component-TCzwHGVq.js";
4
+ import { r as renderIcon } from "../renderIcon--EgZu5_5.js";
5
+ import { C as COLLAPSE_KEY } from "../types-4IflWeQO.js";
6
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
7
+ const { create } = createComponent("collapse-item");
7
8
  const _sfc_main = create({
8
9
  props: {
9
10
  collapseRef: {
@@ -46,10 +47,9 @@ const _sfc_main = create({
46
47
  setup(props) {
47
48
  const wrapperRef = ref(null);
48
49
  const contentRef = ref(null);
49
- const collapse = inject("collapseParent");
50
- const parent = reactive(collapse);
50
+ const parent = inject(COLLAPSE_KEY);
51
51
  const classes = computed(() => {
52
- const prefixCls = componentName;
52
+ const prefixCls = "nut-collapse-item";
53
53
  return {
54
54
  [prefixCls]: true,
55
55
  [prefixCls + "__border"]: props.border
@@ -63,7 +63,7 @@ const _sfc_main = create({
63
63
  });
64
64
  const wrapperHeight = ref(expanded.value ? "auto" : "0px");
65
65
  const toggle = () => {
66
- parent.updateVal(props.name);
66
+ parent && parent.updateVal(props.name);
67
67
  };
68
68
  const onTransitionEnd = () => {
69
69
  if (expanded.value) {
@@ -1,14 +1,14 @@
1
1
  import { resolveComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, normalizeClass, toDisplayString, renderSlot, createVNode, ref, watch, onMounted, Fragment, renderList, createBlock, computed, withCtx, normalizeStyle, createTextVNode } from "vue";
2
2
  import { Right, Fabulous, Comment, MoreX } from "@nutui/icons-vue";
3
- import { c as createComponent } from "../component-669c158a.js";
3
+ import { c as createComponent } from "../component-TCzwHGVq.js";
4
4
  import NutRate from "../rate/Rate.js";
5
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
6
- import { u as useLocale } from "../index-c0fa0f6b.js";
7
- import "../renderIcon-3d0fd47c.js";
8
- import "../pxCheck-a27490eb.js";
9
- import "../index-7a7385e4.js";
5
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
6
+ import { u as useLocale } from "../index-s3RgMhc7.js";
7
+ import "../renderIcon--EgZu5_5.js";
8
+ import "../pxCheck-OnXlN1NC.js";
9
+ import "../index-084nl_oE.js";
10
10
  import "@nutui/nutui/dist/packages/locale/lang";
11
- import "../util-6f26722f.js";
11
+ import "../util-4Jkyw4BJ.js";
12
12
  const { create: create$3 } = createComponent("comment-header");
13
13
  const _sfc_main$3 = create$3({
14
14
  components: {
@@ -1,6 +1,6 @@
1
1
  import { shallowReactive, getCurrentInstance, provide, markRaw, isVNode, computed, h } from "vue";
2
- import { c as createComponent } from "./component-669c158a.js";
3
- import { p as pxCheck } from "./pxCheck-a27490eb.js";
2
+ import { c as createComponent } from "./component-TCzwHGVq.js";
3
+ import { p as pxCheck } from "./pxCheck-OnXlN1NC.js";
4
4
  function flattenVNodes(children, childName) {
5
5
  const result = [];
6
6
  const traverse = (children2) => {
@@ -1,4 +1,4 @@
1
- import { c as createComponent } from "../component-669c158a.js";
1
+ import { c as createComponent } from "../component-TCzwHGVq.js";
2
2
  import { computed, h } from "vue";
3
3
  const component = (tag) => {
4
4
  return {
@@ -18,10 +18,10 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, computed, onBeforeMount, watch, toRefs, openBlock, createElementBlock, renderSlot } from "vue";
21
- import { c as createComponent } from "../component-669c158a.js";
22
- import { p as padZero } from "../util-6f26722f.js";
23
- import { u as useLocale } from "../index-c0fa0f6b.js";
24
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
21
+ import { c as createComponent } from "../component-TCzwHGVq.js";
22
+ import { p as padZero } from "../util-4Jkyw4BJ.js";
23
+ import { u as useLocale } from "../index-s3RgMhc7.js";
24
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
25
25
  import "@nutui/nutui/dist/packages/locale/lang";
26
26
  const getTimeStamp = (timeStr) => {
27
27
  if (!timeStr)
@@ -18,8 +18,8 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { getCurrentInstance, ref, reactive, watch, nextTick, onMounted, onUnmounted, toRefs, openBlock, createElementBlock, Fragment, normalizeStyle, renderList, createCommentVNode, toDisplayString, createTextVNode } from "vue";
21
- import { c as createComponent } from "../component-669c158a.js";
22
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
21
+ import { c as createComponent } from "../component-TCzwHGVq.js";
22
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
23
23
  function useExtend(apis) {
24
24
  const instance = getCurrentInstance();
25
25
  if (instance) {
@@ -19,12 +19,12 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot } from "vue";
21
21
  import NutPicker from "../picker/Picker.js";
22
- import { c as createComponent } from "../component-669c158a.js";
23
- import { c as isDate$1, p as padZero } from "../util-6f26722f.js";
24
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
25
- import "../pxCheck-a27490eb.js";
26
- import "../index-7a7385e4.js";
27
- import "../index-c0fa0f6b.js";
22
+ import { c as createComponent } from "../component-TCzwHGVq.js";
23
+ import { c as isDate$1, p as padZero } from "../util-4Jkyw4BJ.js";
24
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
25
+ import "../pxCheck-OnXlN1NC.js";
26
+ import "../index-084nl_oE.js";
27
+ import "../index-s3RgMhc7.js";
28
28
  import "@nutui/nutui/dist/packages/locale/lang";
29
29
  const { create } = createComponent("date-picker");
30
30
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
@@ -22,15 +22,15 @@ var __publicField = (obj, key, value) => {
22
22
  return value;
23
23
  };
24
24
  import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, nextTick, h } from "vue";
25
- import { c as createComponent } from "../component-669c158a.js";
26
- import { f as funInterceptor } from "../Interceptor-6aab6fe0.js";
27
- import { N as NutPopup, p as popupProps } from "../index-37ae1f41.js";
25
+ import { c as createComponent } from "../component-TCzwHGVq.js";
26
+ import { f as funInterceptor } from "../Interceptor-WYVtGbGC.js";
27
+ import { N as NutPopup, p as popupProps } from "../index-rbZsBckW.js";
28
28
  import NutButton from "../button/Button.js";
29
- import { u as useLocale } from "../index-c0fa0f6b.js";
30
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
29
+ import { u as useLocale } from "../index-s3RgMhc7.js";
30
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
31
31
  import NutOverlay from "../overlay/Overlay.js";
32
- import { C as CreateComponent } from "../mountComponent-867a9167.js";
33
- import "../util-6f26722f.js";
32
+ import { C as CreateComponent } from "../mountComponent-uInXoTMp.js";
33
+ import "../util-4Jkyw4BJ.js";
34
34
  import "@nutui/icons-vue";
35
35
  import "@nutui/nutui/dist/packages/locale/lang";
36
36
  const { create } = createComponent("dialog");
@@ -1,7 +1,7 @@
1
1
  import { computed, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
3
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
4
- const { componentName, create } = createComponent("divider");
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
4
+ const { create } = createComponent("divider");
5
5
  const _sfc_main = create({
6
6
  props: {
7
7
  contentPosition: {
@@ -23,7 +23,7 @@ const _sfc_main = create({
23
23
  },
24
24
  setup(props, context) {
25
25
  const classes = computed(() => {
26
- const prefixCls = componentName;
26
+ const prefixCls = "nut-divider";
27
27
  if (props.direction === "horizontal") {
28
28
  return {
29
29
  [prefixCls]: true,
@@ -1,7 +1,7 @@
1
1
  import { ref, reactive, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, renderSlot } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
3
- import { r as requestAniFrame } from "../raf-729dad54.js";
4
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
+ import { r as requestAniFrame } from "../raf-MQjoO-Ag.js";
4
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
5
5
  const { create } = createComponent("drag");
6
6
  const _sfc_main = create({
7
7
  props: {
@@ -1,12 +1,12 @@
1
1
  import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText, createTextVNode, createVNode } from "vue";
2
- import { c as createComponent } from "../component-669c158a.js";
2
+ import { c as createComponent } from "../component-TCzwHGVq.js";
3
3
  import NutInputNumber from "../inputnumber/InputNumber.js";
4
- import { u as useLocale } from "../index-c0fa0f6b.js";
5
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.js";
6
- import "../pxCheck-a27490eb.js";
4
+ import { u as useLocale } from "../index-s3RgMhc7.js";
5
+ import { _ as _export_sfc } from "../_plugin-vue_export-helper-yVxbj29m.js";
6
+ import "../pxCheck-OnXlN1NC.js";
7
7
  import "@nutui/icons-vue";
8
8
  import "@nutui/nutui/dist/packages/locale/lang";
9
- import "../util-6f26722f.js";
9
+ import "../util-4Jkyw4BJ.js";
10
10
  const { create } = createComponent("ecard");
11
11
  const cN = "NutEcard";
12
12
  const _sfc_main = create({