naive-ui 2.32.2 → 2.33.2

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 (155) hide show
  1. package/dist/index.js +425 -248
  2. package/dist/index.prod.js +2 -2
  3. package/es/_internal/select-menu/src/SelectOption.js +1 -2
  4. package/es/_utils/cssr/index.js +1 -1
  5. package/es/calendar/src/Calendar.js +2 -1
  6. package/es/card/src/Card.d.ts +24 -1
  7. package/es/card/src/Card.js +8 -4
  8. package/es/card/src/styles/index.cssr.js +17 -8
  9. package/es/card/styles/dark.js +3 -1
  10. package/es/card/styles/light.d.ts +2 -0
  11. package/es/card/styles/light.js +1 -1
  12. package/es/countdown/src/Countdown.js +0 -5
  13. package/es/data-table/src/DataTable.d.ts +10 -0
  14. package/es/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
  15. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +1 -0
  16. package/es/data-table/src/TableParts/Body.d.ts +1 -0
  17. package/es/data-table/src/TableParts/Cell.d.ts +2 -0
  18. package/es/data-table/src/TableParts/Header.d.ts +1 -0
  19. package/es/data-table/src/use-sorter.js +1 -1
  20. package/es/data-table/styles/light.d.ts +1 -0
  21. package/es/dialog/index.d.ts +1 -1
  22. package/es/dialog/index.js +1 -1
  23. package/es/dialog/src/DialogEnvironment.d.ts +3 -0
  24. package/es/dialog/src/DialogEnvironment.js +2 -2
  25. package/es/dialog/src/DialogProvider.d.ts +4 -0
  26. package/es/dialog/src/DialogProvider.js +2 -1
  27. package/es/dialog/src/composables.d.ts +4 -0
  28. package/es/dialog/src/composables.js +17 -0
  29. package/es/dialog/src/context.d.ts +2 -1
  30. package/es/dialog/src/context.js +1 -0
  31. package/es/form/src/FormItem.d.ts +1 -0
  32. package/es/form/src/FormItem.js +27 -18
  33. package/es/form/src/styles/form-item.cssr.js +41 -19
  34. package/es/form/src/utils.d.ts +1 -0
  35. package/es/form/src/utils.js +15 -10
  36. package/es/input/src/utils.js +1 -1
  37. package/es/locales/common/frFR.js +8 -11
  38. package/es/menu/src/Menu.d.ts +13 -0
  39. package/es/menu/src/Menu.js +7 -1
  40. package/es/modal/src/BodyWrapper.d.ts +2 -0
  41. package/es/modal/src/Modal.d.ts +18 -0
  42. package/es/modal/src/presetProps.d.ts +1 -1
  43. package/es/modal/styles/light.d.ts +2 -0
  44. package/es/pagination/src/Pagination.js +5 -1
  45. package/es/radio/src/Radio.d.ts +13 -32
  46. package/es/radio/src/Radio.js +7 -6
  47. package/es/radio/src/RadioButton.d.ts +6 -9
  48. package/es/radio/src/RadioButton.js +7 -11
  49. package/es/radio/src/RadioGroup.d.ts +17 -8
  50. package/es/radio/src/RadioGroup.js +2 -2
  51. package/es/radio/src/interface.d.ts +2 -2
  52. package/es/radio/src/styles/radio.cssr.js +4 -1
  53. package/es/radio/src/use-radio.d.ts +4 -32
  54. package/es/radio/src/use-radio.js +12 -10
  55. package/es/radio/styles/dark.js +1 -1
  56. package/es/radio/styles/light.d.ts +1 -0
  57. package/es/radio/styles/light.js +1 -1
  58. package/es/rate/src/Rate.d.ts +23 -14
  59. package/es/rate/src/Rate.js +32 -12
  60. package/es/rate/src/interface.d.ts +2 -0
  61. package/es/rate/src/interface.js +1 -0
  62. package/es/rate/src/styles/index.cssr.js +13 -13
  63. package/es/slider/src/Slider.d.ts +13 -0
  64. package/es/slider/src/Slider.js +6 -3
  65. package/es/theme-editor/src/MaximizeIcon.d.ts +1 -0
  66. package/es/theme-editor/src/MaximizeIcon.js +8 -0
  67. package/es/theme-editor/src/MinimizeIcon.d.ts +1 -0
  68. package/es/theme-editor/src/MinimizeIcon.js +8 -0
  69. package/es/theme-editor/src/ThemeEditor.d.ts +4 -0
  70. package/es/theme-editor/src/ThemeEditor.js +42 -18
  71. package/es/tree/src/styles/index.cssr.js +4 -3
  72. package/es/upload/src/interface.d.ts +1 -1
  73. package/es/version.d.ts +1 -1
  74. package/es/version.js +1 -1
  75. package/lib/_internal/select-menu/src/SelectOption.js +1 -2
  76. package/lib/_utils/cssr/index.js +2 -5
  77. package/lib/calendar/src/Calendar.js +2 -1
  78. package/lib/card/src/Card.d.ts +24 -1
  79. package/lib/card/src/Card.js +8 -4
  80. package/lib/card/src/styles/index.cssr.js +17 -8
  81. package/lib/card/styles/dark.js +3 -1
  82. package/lib/card/styles/light.d.ts +2 -0
  83. package/lib/card/styles/light.js +1 -1
  84. package/lib/countdown/src/Countdown.js +0 -5
  85. package/lib/data-table/src/DataTable.d.ts +10 -0
  86. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
  87. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +1 -0
  88. package/lib/data-table/src/TableParts/Body.d.ts +1 -0
  89. package/lib/data-table/src/TableParts/Cell.d.ts +2 -0
  90. package/lib/data-table/src/TableParts/Header.d.ts +1 -0
  91. package/lib/data-table/src/use-sorter.js +1 -1
  92. package/lib/data-table/styles/light.d.ts +1 -0
  93. package/lib/dialog/index.d.ts +1 -1
  94. package/lib/dialog/index.js +4 -3
  95. package/lib/dialog/src/DialogEnvironment.d.ts +3 -0
  96. package/lib/dialog/src/DialogEnvironment.js +2 -2
  97. package/lib/dialog/src/DialogProvider.d.ts +4 -0
  98. package/lib/dialog/src/DialogProvider.js +1 -0
  99. package/lib/dialog/src/composables.d.ts +4 -0
  100. package/lib/dialog/src/{use-dialog.js → composables.js} +9 -1
  101. package/lib/dialog/src/context.d.ts +2 -1
  102. package/lib/dialog/src/context.js +2 -1
  103. package/lib/form/src/FormItem.d.ts +1 -0
  104. package/lib/form/src/FormItem.js +27 -18
  105. package/lib/form/src/styles/form-item.cssr.js +41 -19
  106. package/lib/form/src/utils.d.ts +1 -0
  107. package/lib/form/src/utils.js +15 -10
  108. package/lib/input/src/utils.js +1 -1
  109. package/lib/locales/common/frFR.js +8 -11
  110. package/lib/menu/src/Menu.d.ts +13 -0
  111. package/lib/menu/src/Menu.js +7 -1
  112. package/lib/modal/src/BodyWrapper.d.ts +2 -0
  113. package/lib/modal/src/Modal.d.ts +18 -0
  114. package/lib/modal/src/presetProps.d.ts +1 -1
  115. package/lib/modal/styles/light.d.ts +2 -0
  116. package/lib/pagination/src/Pagination.js +5 -1
  117. package/lib/radio/src/Radio.d.ts +13 -32
  118. package/lib/radio/src/Radio.js +7 -6
  119. package/lib/radio/src/RadioButton.d.ts +6 -9
  120. package/lib/radio/src/RadioButton.js +7 -14
  121. package/lib/radio/src/RadioGroup.d.ts +17 -8
  122. package/lib/radio/src/RadioGroup.js +2 -2
  123. package/lib/radio/src/interface.d.ts +2 -2
  124. package/lib/radio/src/styles/radio.cssr.js +4 -1
  125. package/lib/radio/src/use-radio.d.ts +4 -32
  126. package/lib/radio/src/use-radio.js +11 -9
  127. package/lib/radio/styles/dark.js +1 -1
  128. package/lib/radio/styles/light.d.ts +1 -0
  129. package/lib/radio/styles/light.js +1 -1
  130. package/lib/rate/src/Rate.d.ts +23 -14
  131. package/lib/rate/src/Rate.js +32 -12
  132. package/lib/rate/src/interface.d.ts +2 -0
  133. package/lib/rate/src/interface.js +2 -0
  134. package/lib/rate/src/styles/index.cssr.js +13 -13
  135. package/lib/slider/src/Slider.d.ts +13 -0
  136. package/lib/slider/src/Slider.js +6 -3
  137. package/lib/theme-editor/src/MaximizeIcon.d.ts +1 -0
  138. package/lib/theme-editor/src/MaximizeIcon.js +11 -0
  139. package/lib/theme-editor/src/MinimizeIcon.d.ts +1 -0
  140. package/lib/theme-editor/src/MinimizeIcon.js +11 -0
  141. package/lib/theme-editor/src/ThemeEditor.d.ts +4 -0
  142. package/lib/theme-editor/src/ThemeEditor.js +42 -18
  143. package/lib/tree/src/styles/index.cssr.js +4 -3
  144. package/lib/upload/src/interface.d.ts +1 -1
  145. package/lib/version.d.ts +1 -1
  146. package/lib/version.js +1 -1
  147. package/package.json +8 -7
  148. package/web-types.json +36 -5
  149. package/es/countdown/src/utils.d.ts +0 -0
  150. package/es/countdown/src/utils.js +0 -1
  151. package/es/dialog/src/use-dialog.d.ts +0 -2
  152. package/es/dialog/src/use-dialog.js +0 -10
  153. package/lib/countdown/src/utils.d.ts +0 -0
  154. package/lib/countdown/src/utils.js +0 -1
  155. package/lib/dialog/src/use-dialog.d.ts +0 -2
@@ -42,6 +42,9 @@ exports.menuProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), {
42
42
  }, childrenField: {
43
43
  type: String,
44
44
  default: 'children'
45
+ }, disabledField: {
46
+ type: String,
47
+ default: 'disabled'
45
48
  }, defaultExpandAll: Boolean, defaultExpandedKeys: Array, expandedKeys: Array, value: [String, Number], defaultValue: {
46
49
  type: [String, Number],
47
50
  default: null
@@ -84,11 +87,14 @@ exports.default = (0, vue_1.defineComponent)({
84
87
  return false;
85
88
  });
86
89
  const treeMateRef = (0, vue_1.computed)(() => {
87
- const { keyField, childrenField } = props;
90
+ const { keyField, childrenField, disabledField } = props;
88
91
  return (0, treemate_1.createTreeMate)(props.items || props.options, {
89
92
  getChildren(node) {
90
93
  return node[childrenField];
91
94
  },
95
+ getDisabled(node) {
96
+ return node[disabledField];
97
+ },
92
98
  getKey(node) {
93
99
  var _a;
94
100
  return (_a = node[keyField]) !== null && _a !== void 0 ? _a : node.name;
@@ -441,6 +441,8 @@ declare const _default: import("vue").DefineComponent<{
441
441
  colorPopover: string;
442
442
  colorTarget: string;
443
443
  colorEmbedded: string;
444
+ colorEmbeddedModal: string;
445
+ colorEmbeddedPopover: string;
444
446
  textColor: string;
445
447
  titleTextColor: string;
446
448
  borderColor: string;
@@ -347,6 +347,8 @@ export declare const modalProps: {
347
347
  colorPopover: string;
348
348
  colorTarget: string;
349
349
  colorEmbedded: string;
350
+ colorEmbeddedModal: string;
351
+ colorEmbeddedPopover: string;
350
352
  textColor: string;
351
353
  titleTextColor: string;
352
354
  borderColor: string;
@@ -629,6 +631,8 @@ export declare const modalProps: {
629
631
  colorPopover: string;
630
632
  colorTarget: string;
631
633
  colorEmbedded: string;
634
+ colorEmbeddedModal: string;
635
+ colorEmbeddedPopover: string;
632
636
  textColor: string;
633
637
  titleTextColor: string;
634
638
  borderColor: string;
@@ -911,6 +915,8 @@ export declare const modalProps: {
911
915
  colorPopover: string;
912
916
  colorTarget: string;
913
917
  colorEmbedded: string;
918
+ colorEmbeddedModal: string;
919
+ colorEmbeddedPopover: string;
914
920
  textColor: string;
915
921
  titleTextColor: string;
916
922
  borderColor: string;
@@ -1289,6 +1295,8 @@ declare const _default: import("vue").DefineComponent<{
1289
1295
  colorPopover: string;
1290
1296
  colorTarget: string;
1291
1297
  colorEmbedded: string;
1298
+ colorEmbeddedModal: string;
1299
+ colorEmbeddedPopover: string;
1292
1300
  textColor: string;
1293
1301
  titleTextColor: string;
1294
1302
  borderColor: string;
@@ -1571,6 +1579,8 @@ declare const _default: import("vue").DefineComponent<{
1571
1579
  colorPopover: string;
1572
1580
  colorTarget: string;
1573
1581
  colorEmbedded: string;
1582
+ colorEmbeddedModal: string;
1583
+ colorEmbeddedPopover: string;
1574
1584
  textColor: string;
1575
1585
  titleTextColor: string;
1576
1586
  borderColor: string;
@@ -1853,6 +1863,8 @@ declare const _default: import("vue").DefineComponent<{
1853
1863
  colorPopover: string;
1854
1864
  colorTarget: string;
1855
1865
  colorEmbedded: string;
1866
+ colorEmbeddedModal: string;
1867
+ colorEmbeddedPopover: string;
1856
1868
  textColor: string;
1857
1869
  titleTextColor: string;
1858
1870
  borderColor: string;
@@ -2251,6 +2263,8 @@ declare const _default: import("vue").DefineComponent<{
2251
2263
  colorPopover: string;
2252
2264
  colorTarget: string;
2253
2265
  colorEmbedded: string;
2266
+ colorEmbeddedModal: string;
2267
+ colorEmbeddedPopover: string;
2254
2268
  textColor: string;
2255
2269
  titleTextColor: string;
2256
2270
  borderColor: string;
@@ -2533,6 +2547,8 @@ declare const _default: import("vue").DefineComponent<{
2533
2547
  colorPopover: string;
2534
2548
  colorTarget: string;
2535
2549
  colorEmbedded: string;
2550
+ colorEmbeddedModal: string;
2551
+ colorEmbeddedPopover: string;
2536
2552
  textColor: string;
2537
2553
  titleTextColor: string;
2538
2554
  borderColor: string;
@@ -2815,6 +2831,8 @@ declare const _default: import("vue").DefineComponent<{
2815
2831
  colorPopover: string;
2816
2832
  colorTarget: string;
2817
2833
  colorEmbedded: string;
2834
+ colorEmbeddedModal: string;
2835
+ colorEmbeddedPopover: string;
2818
2836
  textColor: string;
2819
2837
  titleTextColor: string;
2820
2838
  borderColor: string;
@@ -41,5 +41,5 @@ declare const presetProps: {
41
41
  hoverable: BooleanConstructor;
42
42
  role: StringConstructor;
43
43
  };
44
- declare const presetPropsKeys: ("type" | "content" | "size" | "icon" | "title" | "role" | "action" | "positiveText" | "negativeText" | "loading" | "bordered" | "showIcon" | "closable" | "contentStyle" | "onClose" | "headerStyle" | "footerStyle" | "iconPlacement" | "hoverable" | "headerExtraStyle" | "embedded" | "segmented" | "positiveButtonProps" | "negativeButtonProps" | "onPositiveClick" | "onNegativeClick")[];
44
+ declare const presetPropsKeys: ("type" | "content" | "size" | "icon" | "title" | "role" | "action" | "positiveText" | "negativeText" | "loading" | "bordered" | "showIcon" | "closable" | "contentStyle" | "onClose" | "headerStyle" | "footerStyle" | "iconPlacement" | "hoverable" | "embedded" | "headerExtraStyle" | "segmented" | "positiveButtonProps" | "negativeButtonProps" | "onPositiveClick" | "onNegativeClick")[];
45
45
  export { presetProps, presetPropsKeys };
@@ -258,6 +258,8 @@ declare const modalLight: import("../../_mixins").Theme<"Modal", {
258
258
  colorPopover: string;
259
259
  colorTarget: string;
260
260
  colorEmbedded: string;
261
+ colorEmbeddedModal: string;
262
+ colorEmbeddedPopover: string;
261
263
  textColor: string;
262
264
  titleTextColor: string;
263
265
  borderColor: string;
@@ -98,10 +98,14 @@ exports.default = (0, vue_1.defineComponent)({
98
98
  const showFastForwardMenuRef = (0, vue_1.ref)(false);
99
99
  const showFastBackwardMenuRef = (0, vue_1.ref)(false);
100
100
  const handleFastForwardMouseenter = () => {
101
+ if (props.disabled)
102
+ return;
101
103
  fastForwardActiveRef.value = true;
102
104
  disableTransitionOneTick();
103
105
  };
104
106
  const handleFastForwardMouseleave = () => {
107
+ if (props.disabled)
108
+ return;
105
109
  fastForwardActiveRef.value = false;
106
110
  disableTransitionOneTick();
107
111
  };
@@ -507,7 +511,7 @@ exports.default = (0, vue_1.defineComponent)({
507
511
  ? 'fast-backward'
508
512
  : 'fast-forward'
509
513
  : pageItem.type;
510
- return ((0, vue_1.h)(popselect_1.NPopselect, { key: key, trigger: "hover", virtualScroll: true, style: { width: '60px' }, theme: mergedTheme.peers.Popselect, themeOverrides: mergedTheme.peerOverrides.Popselect, builtinThemeOverrides: {
514
+ return ((0, vue_1.h)(popselect_1.NPopselect, { key: key, disabled: disabled, trigger: "hover", virtualScroll: true, style: { width: '60px' }, theme: mergedTheme.peers.Popselect, themeOverrides: mergedTheme.peerOverrides.Popselect, builtinThemeOverrides: {
511
515
  peers: {
512
516
  InternalSelectMenu: {
513
517
  height: 'calc(var(--n-option-height) * 4.6)'
@@ -1,35 +1,11 @@
1
1
  import type { ExtractPublicPropTypes } from '../../_utils';
2
- import useRadio from './use-radio';
3
- export declare const radioProps: {
4
- readonly name: StringConstructor;
5
- readonly value: {
6
- readonly type: import("vue").PropType<string | number>;
7
- readonly default: "on";
8
- };
9
- readonly checked: {
10
- readonly type: import("vue").PropType<boolean | undefined>;
11
- readonly default: undefined;
12
- };
13
- readonly defaultChecked: BooleanConstructor;
14
- readonly disabled: {
15
- readonly type: import("vue").PropType<boolean | undefined>;
16
- readonly default: undefined;
17
- };
18
- readonly label: StringConstructor;
19
- readonly size: import("vue").PropType<"small" | "medium" | "large">;
20
- readonly onUpdateChecked: import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
21
- readonly 'onUpdate:checked': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
22
- readonly checkedValue: {
23
- readonly type: import("vue").PropType<boolean | undefined>;
24
- readonly validator: () => boolean;
25
- readonly default: undefined;
26
- };
27
- };
28
- export declare type RadioProps = ExtractPublicPropTypes<typeof useRadio.props>;
2
+ import { radioProps } from './use-radio';
3
+ export { radioProps };
4
+ export declare type RadioProps = ExtractPublicPropTypes<typeof radioProps>;
29
5
  declare const _default: import("vue").DefineComponent<{
30
6
  name: StringConstructor;
31
7
  value: {
32
- readonly type: import("vue").PropType<string | number>;
8
+ readonly type: import("vue").PropType<string | number | boolean>;
33
9
  readonly default: "on";
34
10
  };
35
11
  checked: {
@@ -47,7 +23,6 @@ declare const _default: import("vue").DefineComponent<{
47
23
  'onUpdate:checked': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
48
24
  checkedValue: {
49
25
  readonly type: import("vue").PropType<boolean | undefined>;
50
- readonly validator: () => boolean;
51
26
  readonly default: undefined;
52
27
  };
53
28
  theme: import("vue").PropType<import("../../_mixins").Theme<"Radio", {
@@ -65,6 +40,7 @@ declare const _default: import("vue").DefineComponent<{
65
40
  boxShadowDisabled: string;
66
41
  color: string;
67
42
  colorDisabled: string;
43
+ colorActive: string;
68
44
  textColor: string;
69
45
  textColorDisabled: string;
70
46
  dotColorActive: string;
@@ -102,6 +78,7 @@ declare const _default: import("vue").DefineComponent<{
102
78
  boxShadowDisabled: string;
103
79
  color: string;
104
80
  colorDisabled: string;
81
+ colorActive: string;
105
82
  textColor: string;
106
83
  textColorDisabled: string;
107
84
  dotColorActive: string;
@@ -139,6 +116,7 @@ declare const _default: import("vue").DefineComponent<{
139
116
  boxShadowDisabled: string;
140
117
  color: string;
141
118
  colorDisabled: string;
119
+ colorActive: string;
142
120
  textColor: string;
143
121
  textColorDisabled: string;
144
122
  dotColorActive: string;
@@ -172,6 +150,7 @@ declare const _default: import("vue").DefineComponent<{
172
150
  '--n-box-shadow-focus': string;
173
151
  '--n-box-shadow-hover': string;
174
152
  '--n-color': string;
153
+ '--n-color-active': string;
175
154
  '--n-color-disabled': string;
176
155
  '--n-dot-color-active': string;
177
156
  '--n-dot-color-disabled': string;
@@ -186,7 +165,7 @@ declare const _default: import("vue").DefineComponent<{
186
165
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
187
166
  name: StringConstructor;
188
167
  value: {
189
- readonly type: import("vue").PropType<string | number>;
168
+ readonly type: import("vue").PropType<string | number | boolean>;
190
169
  readonly default: "on";
191
170
  };
192
171
  checked: {
@@ -204,7 +183,6 @@ declare const _default: import("vue").DefineComponent<{
204
183
  'onUpdate:checked': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
205
184
  checkedValue: {
206
185
  readonly type: import("vue").PropType<boolean | undefined>;
207
- readonly validator: () => boolean;
208
186
  readonly default: undefined;
209
187
  };
210
188
  theme: import("vue").PropType<import("../../_mixins").Theme<"Radio", {
@@ -222,6 +200,7 @@ declare const _default: import("vue").DefineComponent<{
222
200
  boxShadowDisabled: string;
223
201
  color: string;
224
202
  colorDisabled: string;
203
+ colorActive: string;
225
204
  textColor: string;
226
205
  textColorDisabled: string;
227
206
  dotColorActive: string;
@@ -259,6 +238,7 @@ declare const _default: import("vue").DefineComponent<{
259
238
  boxShadowDisabled: string;
260
239
  color: string;
261
240
  colorDisabled: string;
241
+ colorActive: string;
262
242
  textColor: string;
263
243
  textColorDisabled: string;
264
244
  dotColorActive: string;
@@ -296,6 +276,7 @@ declare const _default: import("vue").DefineComponent<{
296
276
  boxShadowDisabled: string;
297
277
  color: string;
298
278
  colorDisabled: string;
279
+ colorActive: string;
299
280
  textColor: string;
300
281
  textColorDisabled: string;
301
282
  dotColorActive: string;
@@ -319,7 +300,7 @@ declare const _default: import("vue").DefineComponent<{
319
300
  labelPadding: string;
320
301
  }, any>>>;
321
302
  }>>, {
322
- value: string | number;
303
+ value: string | number | boolean;
323
304
  disabled: boolean | undefined;
324
305
  checked: boolean | undefined;
325
306
  defaultChecked: boolean;
@@ -5,22 +5,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.radioProps = void 0;
7
7
  const vue_1 = require("vue");
8
+ const use_rtl_1 = require("../../_mixins/use-rtl");
8
9
  const _mixins_1 = require("../../_mixins");
9
10
  const _utils_1 = require("../../_utils");
10
11
  const styles_1 = require("../styles");
11
- const use_radio_1 = __importDefault(require("./use-radio"));
12
+ const use_radio_1 = require("./use-radio");
13
+ Object.defineProperty(exports, "radioProps", { enumerable: true, get: function () { return use_radio_1.radioProps; } });
12
14
  const radio_cssr_1 = __importDefault(require("./styles/radio.cssr"));
13
- const use_rtl_1 = require("../../_mixins/use-rtl");
14
- exports.radioProps = use_radio_1.default.props;
15
15
  exports.default = (0, vue_1.defineComponent)({
16
16
  name: 'Radio',
17
- props: Object.assign(Object.assign({}, _mixins_1.useTheme.props), use_radio_1.default.props),
17
+ props: Object.assign(Object.assign({}, _mixins_1.useTheme.props), use_radio_1.radioProps),
18
18
  setup(props) {
19
- const radio = (0, use_radio_1.default)(props);
19
+ const radio = (0, use_radio_1.setup)(props);
20
20
  const themeRef = (0, _mixins_1.useTheme)('Radio', '-radio', radio_cssr_1.default, styles_1.radioLight, props, radio.mergedClsPrefix);
21
21
  const cssVarsRef = (0, vue_1.computed)(() => {
22
22
  const { mergedSize: { value: size } } = radio;
23
- const { common: { cubicBezierEaseInOut }, self: { boxShadow, boxShadowActive, boxShadowDisabled, boxShadowFocus, boxShadowHover, color, colorDisabled, textColor, textColorDisabled, dotColorActive, dotColorDisabled, labelPadding, labelLineHeight, [(0, _utils_1.createKey)('fontSize', size)]: fontSize, [(0, _utils_1.createKey)('radioSize', size)]: radioSize } } = themeRef.value;
23
+ const { common: { cubicBezierEaseInOut }, self: { boxShadow, boxShadowActive, boxShadowDisabled, boxShadowFocus, boxShadowHover, color, colorDisabled, colorActive, textColor, textColorDisabled, dotColorActive, dotColorDisabled, labelPadding, labelLineHeight, [(0, _utils_1.createKey)('fontSize', size)]: fontSize, [(0, _utils_1.createKey)('radioSize', size)]: radioSize } } = themeRef.value;
24
24
  return {
25
25
  '--n-bezier': cubicBezierEaseInOut,
26
26
  '--n-label-line-height': labelLineHeight,
@@ -30,6 +30,7 @@ exports.default = (0, vue_1.defineComponent)({
30
30
  '--n-box-shadow-focus': boxShadowFocus,
31
31
  '--n-box-shadow-hover': boxShadowHover,
32
32
  '--n-color': color,
33
+ '--n-color-active': colorActive,
33
34
  '--n-color-disabled': colorDisabled,
34
35
  '--n-dot-color-active': dotColorActive,
35
36
  '--n-dot-color-disabled': dotColorDisabled,
@@ -1,9 +1,9 @@
1
1
  import { ExtractPublicPropTypes } from '../../_utils';
2
- import useRadio from './use-radio';
2
+ import { radioProps } from './use-radio';
3
3
  export declare const radioButtonProps: {
4
4
  readonly name: StringConstructor;
5
5
  readonly value: {
6
- readonly type: import("vue").PropType<string | number>;
6
+ readonly type: import("vue").PropType<string | number | boolean>;
7
7
  readonly default: "on";
8
8
  };
9
9
  readonly checked: {
@@ -21,15 +21,14 @@ export declare const radioButtonProps: {
21
21
  readonly 'onUpdate:checked': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
22
22
  readonly checkedValue: {
23
23
  readonly type: import("vue").PropType<boolean | undefined>;
24
- readonly validator: () => boolean;
25
24
  readonly default: undefined;
26
25
  };
27
26
  };
28
- export declare type RadioButtonProps = ExtractPublicPropTypes<typeof useRadio.props>;
27
+ export declare type RadioButtonProps = ExtractPublicPropTypes<typeof radioProps>;
29
28
  declare const _default: import("vue").DefineComponent<{
30
29
  readonly name: StringConstructor;
31
30
  readonly value: {
32
- readonly type: import("vue").PropType<string | number>;
31
+ readonly type: import("vue").PropType<string | number | boolean>;
33
32
  readonly default: "on";
34
33
  };
35
34
  readonly checked: {
@@ -47,13 +46,12 @@ declare const _default: import("vue").DefineComponent<{
47
46
  readonly 'onUpdate:checked': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
48
47
  readonly checkedValue: {
49
48
  readonly type: import("vue").PropType<boolean | undefined>;
50
- readonly validator: () => boolean;
51
49
  readonly default: undefined;
52
50
  };
53
51
  }, import("./use-radio").UseRadio, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
54
52
  readonly name: StringConstructor;
55
53
  readonly value: {
56
- readonly type: import("vue").PropType<string | number>;
54
+ readonly type: import("vue").PropType<string | number | boolean>;
57
55
  readonly default: "on";
58
56
  };
59
57
  readonly checked: {
@@ -71,11 +69,10 @@ declare const _default: import("vue").DefineComponent<{
71
69
  readonly 'onUpdate:checked': import("vue").PropType<import("../../_utils").MaybeArray<(value: boolean) => void> | undefined>;
72
70
  readonly checkedValue: {
73
71
  readonly type: import("vue").PropType<boolean | undefined>;
74
- readonly validator: () => boolean;
75
72
  readonly default: undefined;
76
73
  };
77
74
  }>>, {
78
- readonly value: string | number;
75
+ readonly value: string | number | boolean;
79
76
  readonly disabled: boolean | undefined;
80
77
  readonly checked: boolean | undefined;
81
78
  readonly defaultChecked: boolean;
@@ -1,28 +1,21 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.radioButtonProps = void 0;
7
4
  const vue_1 = require("vue");
8
5
  const _utils_1 = require("../../_utils");
9
- const use_radio_1 = __importDefault(require("./use-radio"));
10
- exports.radioButtonProps = use_radio_1.default.props;
6
+ const use_radio_1 = require("./use-radio");
7
+ exports.radioButtonProps = use_radio_1.radioProps;
11
8
  exports.default = (0, vue_1.defineComponent)({
12
9
  name: 'RadioButton',
13
- props: use_radio_1.default.props,
14
- setup(props) {
15
- return (0, use_radio_1.default)(props);
16
- },
10
+ props: use_radio_1.radioProps,
11
+ setup: use_radio_1.setup,
17
12
  render() {
18
13
  const { mergedClsPrefix } = this;
19
14
  return ((0, vue_1.h)("label", { class: [
20
15
  `${mergedClsPrefix}-radio-button`,
21
- {
22
- [`${mergedClsPrefix}-radio-button--disabled`]: this.mergedDisabled,
23
- [`${mergedClsPrefix}-radio-button--checked`]: this.renderSafeChecked,
24
- [`${mergedClsPrefix}-radio-button--focus`]: this.focus
25
- }
16
+ this.mergedDisabled && `${mergedClsPrefix}-radio-button--disabled`,
17
+ this.renderSafeChecked && `${mergedClsPrefix}-radio-button--checked`,
18
+ this.focus && [`${mergedClsPrefix}-radio-button--focus`]
26
19
  ] },
27
20
  (0, vue_1.h)("input", { ref: "inputRef", type: "radio", class: `${mergedClsPrefix}-radio-input`, value: this.value, name: this.mergedName, checked: this.renderSafeChecked, disabled: this.mergedDisabled, onChange: this.handleRadioInputChange, onFocus: this.handleRadioInputFocus, onBlur: this.handleRadioInputBlur }),
28
21
  (0, vue_1.h)("div", { class: `${mergedClsPrefix}-radio-button__state-border` }),
@@ -3,9 +3,9 @@ import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
3
3
  import { OnUpdateValue } from './interface';
4
4
  export declare const radioGroupProps: {
5
5
  readonly name: StringConstructor;
6
- readonly value: PropType<string | number | null>;
6
+ readonly value: PropType<string | number | boolean | null>;
7
7
  readonly defaultValue: {
8
- readonly type: PropType<string | number | null>;
8
+ readonly type: PropType<string | number | boolean | null>;
9
9
  readonly default: null;
10
10
  };
11
11
  readonly size: PropType<"small" | "medium" | "large">;
@@ -30,6 +30,7 @@ export declare const radioGroupProps: {
30
30
  boxShadowDisabled: string;
31
31
  color: string;
32
32
  colorDisabled: string;
33
+ colorActive: string;
33
34
  textColor: string;
34
35
  textColorDisabled: string;
35
36
  dotColorActive: string;
@@ -67,6 +68,7 @@ export declare const radioGroupProps: {
67
68
  boxShadowDisabled: string;
68
69
  color: string;
69
70
  colorDisabled: string;
71
+ colorActive: string;
70
72
  textColor: string;
71
73
  textColorDisabled: string;
72
74
  dotColorActive: string;
@@ -104,6 +106,7 @@ export declare const radioGroupProps: {
104
106
  boxShadowDisabled: string;
105
107
  color: string;
106
108
  colorDisabled: string;
109
+ colorActive: string;
107
110
  textColor: string;
108
111
  textColorDisabled: string;
109
112
  dotColorActive: string;
@@ -130,9 +133,9 @@ export declare const radioGroupProps: {
130
133
  export declare type RadioGroupProps = ExtractPublicPropTypes<typeof radioGroupProps>;
131
134
  declare const _default: import("vue").DefineComponent<{
132
135
  readonly name: StringConstructor;
133
- readonly value: PropType<string | number | null>;
136
+ readonly value: PropType<string | number | boolean | null>;
134
137
  readonly defaultValue: {
135
- readonly type: PropType<string | number | null>;
138
+ readonly type: PropType<string | number | boolean | null>;
136
139
  readonly default: null;
137
140
  };
138
141
  readonly size: PropType<"small" | "medium" | "large">;
@@ -157,6 +160,7 @@ declare const _default: import("vue").DefineComponent<{
157
160
  boxShadowDisabled: string;
158
161
  color: string;
159
162
  colorDisabled: string;
163
+ colorActive: string;
160
164
  textColor: string;
161
165
  textColorDisabled: string;
162
166
  dotColorActive: string;
@@ -194,6 +198,7 @@ declare const _default: import("vue").DefineComponent<{
194
198
  boxShadowDisabled: string;
195
199
  color: string;
196
200
  colorDisabled: string;
201
+ colorActive: string;
197
202
  textColor: string;
198
203
  textColorDisabled: string;
199
204
  dotColorActive: string;
@@ -231,6 +236,7 @@ declare const _default: import("vue").DefineComponent<{
231
236
  boxShadowDisabled: string;
232
237
  color: string;
233
238
  colorDisabled: string;
239
+ colorActive: string;
234
240
  textColor: string;
235
241
  textColorDisabled: string;
236
242
  dotColorActive: string;
@@ -257,7 +263,7 @@ declare const _default: import("vue").DefineComponent<{
257
263
  selfElRef: import("vue").Ref<HTMLDivElement | null>;
258
264
  rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
259
265
  mergedClsPrefix: import("vue").ComputedRef<string>;
260
- mergedValue: import("vue").ComputedRef<string | number | null>;
266
+ mergedValue: import("vue").ComputedRef<string | number | boolean | null>;
261
267
  handleFocusout: (e: FocusEvent) => void;
262
268
  handleFocusin: (e: FocusEvent) => void;
263
269
  cssVars: import("vue").ComputedRef<{
@@ -280,9 +286,9 @@ declare const _default: import("vue").DefineComponent<{
280
286
  onRender: (() => void) | undefined;
281
287
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
282
288
  readonly name: StringConstructor;
283
- readonly value: PropType<string | number | null>;
289
+ readonly value: PropType<string | number | boolean | null>;
284
290
  readonly defaultValue: {
285
- readonly type: PropType<string | number | null>;
291
+ readonly type: PropType<string | number | boolean | null>;
286
292
  readonly default: null;
287
293
  };
288
294
  readonly size: PropType<"small" | "medium" | "large">;
@@ -307,6 +313,7 @@ declare const _default: import("vue").DefineComponent<{
307
313
  boxShadowDisabled: string;
308
314
  color: string;
309
315
  colorDisabled: string;
316
+ colorActive: string;
310
317
  textColor: string;
311
318
  textColorDisabled: string;
312
319
  dotColorActive: string;
@@ -344,6 +351,7 @@ declare const _default: import("vue").DefineComponent<{
344
351
  boxShadowDisabled: string;
345
352
  color: string;
346
353
  colorDisabled: string;
354
+ colorActive: string;
347
355
  textColor: string;
348
356
  textColorDisabled: string;
349
357
  dotColorActive: string;
@@ -381,6 +389,7 @@ declare const _default: import("vue").DefineComponent<{
381
389
  boxShadowDisabled: string;
382
390
  color: string;
383
391
  colorDisabled: string;
392
+ colorActive: string;
384
393
  textColor: string;
385
394
  textColorDisabled: string;
386
395
  dotColorActive: string;
@@ -405,6 +414,6 @@ declare const _default: import("vue").DefineComponent<{
405
414
  }, any>>>;
406
415
  }>>, {
407
416
  readonly disabled: boolean | undefined;
408
- readonly defaultValue: string | number | null;
417
+ readonly defaultValue: string | number | boolean | null;
409
418
  }>;
410
419
  export default _default;
@@ -69,8 +69,8 @@ function mapSlot(defaultSlot, value, clsPrefix) {
69
69
  isButtonGroup
70
70
  };
71
71
  }
72
- exports.radioGroupProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { name: String, value: [String, Number], defaultValue: {
73
- type: [String, Number],
72
+ exports.radioGroupProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { name: String, value: [String, Number, Boolean], defaultValue: {
73
+ type: [String, Number, Boolean],
74
74
  default: null
75
75
  }, size: String, disabled: {
76
76
  type: Boolean,
@@ -1,2 +1,2 @@
1
- export declare type OnUpdateValue = (value: string & number) => void;
2
- export declare type OnUpdateValueImpl = (value: string | number) => void;
1
+ export declare type OnUpdateValue = (value: string & number & boolean) => void;
2
+ export declare type OnUpdateValueImpl = (value: string | number | boolean) => void;
@@ -21,6 +21,7 @@ const cssr_1 = require("../../../_utils/cssr"); // vars:
21
21
  // --n-text-color-disabled
22
22
  // --n-label-padding
23
23
  // --n-label-line-height
24
+ // --n-color-active
24
25
 
25
26
 
26
27
  exports.default = (0, cssr_1.cB)('radio', `
@@ -34,7 +35,9 @@ exports.default = (0, cssr_1.cB)('radio', `
34
35
  flex-wrap: nowrap;
35
36
  font-size: var(--n-font-size);
36
37
  word-break: break-word;
37
- `, [(0, cssr_1.cE)('dot-wrapper', `
38
+ `, [(0, cssr_1.cM)('checked', [(0, cssr_1.cE)('dot', `
39
+ background-color: var(--n-color-active);
40
+ `)]), (0, cssr_1.cE)('dot-wrapper', `
38
41
  position: relative;
39
42
  flex-shrink: 0;
40
43
  flex-grow: 0;
@@ -1,10 +1,10 @@
1
1
  import { ExtractPropTypes, PropType, Ref, ComputedRef } from 'vue';
2
2
  import type { MaybeArray } from '../../_utils';
3
3
  import { OnUpdateValue } from './interface';
4
- declare const radioProps: {
4
+ export declare const radioProps: {
5
5
  readonly name: StringConstructor;
6
6
  readonly value: {
7
- readonly type: PropType<string | number>;
7
+ readonly type: PropType<string | number | boolean>;
8
8
  readonly default: "on";
9
9
  };
10
10
  readonly checked: {
@@ -22,14 +22,13 @@ declare const radioProps: {
22
22
  readonly 'onUpdate:checked': PropType<MaybeArray<(value: boolean) => void> | undefined>;
23
23
  readonly checkedValue: {
24
24
  readonly type: PropType<boolean | undefined>;
25
- readonly validator: () => boolean;
26
25
  readonly default: undefined;
27
26
  };
28
27
  };
29
28
  export interface RadioGroupInjection {
30
29
  mergedClsPrefixRef: Ref<string>;
31
30
  nameRef: Ref<string | undefined>;
32
- valueRef: Ref<string | number | null>;
31
+ valueRef: Ref<string | number | boolean | null>;
33
32
  mergedSizeRef: Ref<'small' | 'medium' | 'large'>;
34
33
  disabledRef: Ref<boolean>;
35
34
  doUpdateValue: OnUpdateValue;
@@ -50,32 +49,5 @@ export interface UseRadio {
50
49
  handleRadioInputFocus: () => void;
51
50
  }
52
51
  declare function setup(props: ExtractPropTypes<typeof radioProps>): UseRadio;
53
- declare namespace setup {
54
- var props: {
55
- readonly name: StringConstructor;
56
- readonly value: {
57
- readonly type: PropType<string | number>;
58
- readonly default: "on";
59
- };
60
- readonly checked: {
61
- readonly type: PropType<boolean | undefined>;
62
- readonly default: undefined;
63
- };
64
- readonly defaultChecked: BooleanConstructor;
65
- readonly disabled: {
66
- readonly type: PropType<boolean | undefined>;
67
- readonly default: undefined;
68
- };
69
- readonly label: StringConstructor;
70
- readonly size: PropType<"small" | "medium" | "large">;
71
- readonly onUpdateChecked: PropType<MaybeArray<(value: boolean) => void> | undefined>;
72
- readonly 'onUpdate:checked': PropType<MaybeArray<(value: boolean) => void> | undefined>;
73
- readonly checkedValue: {
74
- readonly type: PropType<boolean | undefined>;
75
- readonly validator: () => boolean;
76
- readonly default: undefined;
77
- };
78
- };
79
- }
80
52
  export declare type RadioProps = ExtractPropTypes<typeof radioProps>;
81
- export default setup;
53
+ export { setup };