naive-ui 2.24.3 → 2.24.7

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 (70) hide show
  1. package/es/color-picker/src/ColorPicker.d.ts +14 -0
  2. package/es/color-picker/src/ColorPicker.js +7 -3
  3. package/es/color-picker/src/ColorPickerTrigger.d.ts +3 -0
  4. package/es/color-picker/src/ColorPickerTrigger.js +6 -2
  5. package/es/color-picker/src/styles/index.cssr.js +1 -1
  6. package/es/date-picker/src/DatePicker.d.ts +11 -0
  7. package/es/date-picker/src/DatePicker.js +2 -1
  8. package/es/date-picker/src/panel/date.d.ts +1 -0
  9. package/es/date-picker/src/panel/daterange.d.ts +1 -0
  10. package/es/date-picker/src/panel/datetime.d.ts +1 -0
  11. package/es/date-picker/src/panel/datetimerange.d.ts +1 -0
  12. package/es/date-picker/src/panel/month.d.ts +1 -0
  13. package/es/date-picker/src/panel/panelHeader.d.ts +2 -0
  14. package/es/date-picker/src/panel/panelHeader.js +7 -3
  15. package/es/date-picker/src/panel/use-calendar.d.ts +1 -0
  16. package/es/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
  17. package/es/date-picker/src/panel/use-panel-common.d.ts +1 -0
  18. package/es/date-picker/src/styles/index.cssr.js +13 -2
  19. package/es/date-picker/styles/light.d.ts +2 -0
  20. package/es/date-picker/styles/light.js +1 -1
  21. package/es/dialog/src/Dialog.js +0 -1
  22. package/es/dynamic-input/src/DynamicInput.d.ts +6 -32
  23. package/es/dynamic-input/src/DynamicInput.js +14 -20
  24. package/es/icon/src/Icon.d.ts +3 -1
  25. package/es/icon/src/Icon.js +4 -4
  26. package/es/input/src/styles/input.cssr.js +1 -0
  27. package/es/locales/common/jaJP.js +12 -14
  28. package/es/popselect/src/Popselect.d.ts +13 -3
  29. package/es/popselect/src/Popselect.js +4 -5
  30. package/es/popselect/src/PopselectPanel.d.ts +1 -4
  31. package/es/popselect/src/PopselectPanel.js +1 -2
  32. package/es/theme-editor/src/ThemeEditor.js +1 -1
  33. package/es/version.d.ts +1 -1
  34. package/es/version.js +1 -1
  35. package/lib/color-picker/src/ColorPicker.d.ts +14 -0
  36. package/lib/color-picker/src/ColorPicker.js +7 -3
  37. package/lib/color-picker/src/ColorPickerTrigger.d.ts +3 -0
  38. package/lib/color-picker/src/ColorPickerTrigger.js +6 -2
  39. package/lib/color-picker/src/styles/index.cssr.js +1 -1
  40. package/lib/date-picker/src/DatePicker.d.ts +11 -0
  41. package/lib/date-picker/src/DatePicker.js +2 -1
  42. package/lib/date-picker/src/panel/date.d.ts +1 -0
  43. package/lib/date-picker/src/panel/daterange.d.ts +1 -0
  44. package/lib/date-picker/src/panel/datetime.d.ts +1 -0
  45. package/lib/date-picker/src/panel/datetimerange.d.ts +1 -0
  46. package/lib/date-picker/src/panel/month.d.ts +1 -0
  47. package/lib/date-picker/src/panel/panelHeader.d.ts +2 -0
  48. package/lib/date-picker/src/panel/panelHeader.js +7 -3
  49. package/lib/date-picker/src/panel/use-calendar.d.ts +1 -0
  50. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
  51. package/lib/date-picker/src/panel/use-panel-common.d.ts +1 -0
  52. package/lib/date-picker/src/styles/index.cssr.js +13 -2
  53. package/lib/date-picker/styles/light.d.ts +2 -0
  54. package/lib/date-picker/styles/light.js +1 -1
  55. package/lib/dialog/src/Dialog.js +0 -1
  56. package/lib/dynamic-input/src/DynamicInput.d.ts +6 -32
  57. package/lib/dynamic-input/src/DynamicInput.js +12 -18
  58. package/lib/icon/src/Icon.d.ts +3 -1
  59. package/lib/icon/src/Icon.js +3 -3
  60. package/lib/input/src/styles/input.cssr.js +1 -0
  61. package/lib/locales/common/jaJP.js +12 -14
  62. package/lib/popselect/src/Popselect.d.ts +13 -3
  63. package/lib/popselect/src/Popselect.js +4 -5
  64. package/lib/popselect/src/PopselectPanel.d.ts +1 -4
  65. package/lib/popselect/src/PopselectPanel.js +1 -2
  66. package/lib/theme-editor/src/ThemeEditor.js +1 -1
  67. package/lib/version.d.ts +1 -1
  68. package/lib/version.js +1 -1
  69. package/package.json +8 -8
  70. package/web-types.json +19 -1
@@ -30,6 +30,10 @@ export declare const colorPickerPanelProps: {
30
30
  };
31
31
  readonly showPreview: BooleanConstructor;
32
32
  readonly swatches: PropType<string[]>;
33
+ readonly disabled: {
34
+ readonly type: PropType<boolean | undefined>;
35
+ readonly default: undefined;
36
+ };
33
37
  readonly actions: {
34
38
  readonly type: PropType<"confirm"[]>;
35
39
  readonly default: null;
@@ -914,6 +918,10 @@ declare const _default: import("vue").DefineComponent<{
914
918
  };
915
919
  readonly showPreview: BooleanConstructor;
916
920
  readonly swatches: PropType<string[]>;
921
+ readonly disabled: {
922
+ readonly type: PropType<boolean | undefined>;
923
+ readonly default: undefined;
924
+ };
917
925
  readonly actions: {
918
926
  readonly type: PropType<"confirm"[]>;
919
927
  readonly default: null;
@@ -1773,6 +1781,7 @@ declare const _default: import("vue").DefineComponent<{
1773
1781
  hsla: ComputedRef<HSLA | null>;
1774
1782
  rgba: ComputedRef<RGBA | null>;
1775
1783
  mergedShow: ComputedRef<boolean>;
1784
+ mergedDisabled: ComputedRef<boolean>;
1776
1785
  isMounted: Readonly<Ref<boolean>>;
1777
1786
  adjustedTo: ComputedRef<string | HTMLElement>;
1778
1787
  mergedValue: ComputedRef<string | null>;
@@ -1816,6 +1825,10 @@ declare const _default: import("vue").DefineComponent<{
1816
1825
  };
1817
1826
  readonly showPreview: BooleanConstructor;
1818
1827
  readonly swatches: PropType<string[]>;
1828
+ readonly disabled: {
1829
+ readonly type: PropType<boolean | undefined>;
1830
+ readonly default: undefined;
1831
+ };
1819
1832
  readonly actions: {
1820
1833
  readonly type: PropType<"confirm"[]>;
1821
1834
  readonly default: null;
@@ -2670,6 +2683,7 @@ declare const _default: import("vue").DefineComponent<{
2670
2683
  }>>>;
2671
2684
  }>>, {
2672
2685
  show: boolean | undefined;
2686
+ disabled: boolean | undefined;
2673
2687
  to: string | boolean | HTMLElement;
2674
2688
  defaultShow: boolean;
2675
2689
  showAlpha: boolean;
@@ -29,7 +29,10 @@ export const colorPickerPanelProps = Object.assign(Object.assign({}, useTheme.pr
29
29
  }, to: useAdjustedTo.propTo, showAlpha: {
30
30
  type: Boolean,
31
31
  default: true
32
- }, showPreview: Boolean, swatches: Array, actions: {
32
+ }, showPreview: Boolean, swatches: Array, disabled: {
33
+ type: Boolean,
34
+ default: undefined
35
+ }, actions: {
33
36
  type: Array,
34
37
  default: null
35
38
  }, internalActions: Array, size: String, renderLabel: Function, onComplete: Function, 'onUpdate:show': [Function, Array], onUpdateShow: [Function, Array], 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array] });
@@ -41,7 +44,7 @@ export default defineComponent({
41
44
  const selfRef = ref(null);
42
45
  let upcomingValue = null;
43
46
  const formItem = useFormItem(props);
44
- const { mergedSizeRef } = formItem;
47
+ const { mergedSizeRef, mergedDisabledRef } = formItem;
45
48
  const { localeRef } = useLocale('global');
46
49
  const { mergedClsPrefixRef, namespaceRef } = useConfig(props);
47
50
  const themeRef = useTheme('ColorPicker', 'ColorPicker', style, colorPickerLight, props, mergedClsPrefixRef);
@@ -377,6 +380,7 @@ export default defineComponent({
377
380
  hsla: hslaRef,
378
381
  rgba: rgbaRef,
379
382
  mergedShow: mergedShowRef,
383
+ mergedDisabled: mergedDisabledRef,
380
384
  isMounted: useIsMounted(),
381
385
  adjustedTo: useAdjustedTo(props),
382
386
  mergedValue: mergedValueRef,
@@ -399,7 +403,7 @@ export default defineComponent({
399
403
  h(VBinder, null, {
400
404
  default: () => [
401
405
  h(VTarget, null, {
402
- default: () => (h(ColorPickerTrigger, { clsPrefix: mergedClsPrefix, value: this.mergedValue, hsla: this.hsla, onClick: this.handleTriggerClick }, {
406
+ default: () => (h(ColorPickerTrigger, { clsPrefix: mergedClsPrefix, value: this.mergedValue, hsla: this.hsla, disabled: this.mergedDisabled, onClick: this.handleTriggerClick }, {
403
407
  label: $slots.label
404
408
  }))
405
409
  }),
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<{
13
13
  type: PropType<HSLA | null>;
14
14
  default: null;
15
15
  };
16
+ disabled: BooleanConstructor;
16
17
  onClick: PropType<() => void>;
17
18
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
19
  clsPrefix: {
@@ -27,9 +28,11 @@ declare const _default: import("vue").DefineComponent<{
27
28
  type: PropType<HSLA | null>;
28
29
  default: null;
29
30
  };
31
+ disabled: BooleanConstructor;
30
32
  onClick: PropType<() => void>;
31
33
  }>>, {
32
34
  value: string | null;
35
+ disabled: boolean;
33
36
  hsla: HSLA | null;
34
37
  }>;
35
38
  export default _default;
@@ -16,15 +16,19 @@ export default defineComponent({
16
16
  type: Array,
17
17
  default: null
18
18
  },
19
+ disabled: Boolean,
19
20
  onClick: Function
20
21
  },
21
22
  setup(props) {
22
23
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
23
24
  const { colorPickerSlots, renderLabelRef } = inject(colorPickerInjectionKey, null);
24
25
  return () => {
25
- const { hsla, value, clsPrefix, onClick } = props;
26
+ const { hsla, value, clsPrefix, onClick, disabled } = props;
26
27
  const renderLabel = colorPickerSlots.label || renderLabelRef.value;
27
- return (h("div", { class: `${clsPrefix}-color-picker-trigger`, onClick: onClick },
28
+ return (h("div", { class: [
29
+ `${clsPrefix}-color-picker-trigger`,
30
+ disabled && `${clsPrefix}-color-picker-trigger--disabled`
31
+ ], onClick: disabled ? undefined : onClick },
28
32
  h("div", { class: `${clsPrefix}-color-picker-trigger__fill` },
29
33
  h("div", { class: `${clsPrefix}-color-picker-checkboard` }),
30
34
  h("div", { style: {
@@ -151,7 +151,7 @@ export default c([cB('color-picker', `
151
151
  right: 4px;
152
152
  top: 4px;
153
153
  bottom: 4px;
154
- `), cB('color-picker-checkboard', `
154
+ `), cM('disabled', 'cursor: not-allowed'), cB('color-picker-checkboard', `
155
155
  border-radius: var(--n-border-radius);
156
156
  `, [c('&::after', `
157
157
  --n-block-size: calc((var(--n-height) - 8px) / 3);
@@ -78,6 +78,7 @@ declare const datePickerProps: {
78
78
  panelTextColor: string;
79
79
  arrowColor: string;
80
80
  calendarTitleTextColor: string;
81
+ calendarTitleColorHover: string;
81
82
  calendarDaysTextColor: string;
82
83
  panelHeaderDividerColor: string;
83
84
  calendarDaysDividerColor: string;
@@ -689,6 +690,7 @@ declare const datePickerProps: {
689
690
  panelTextColor: string;
690
691
  arrowColor: string;
691
692
  calendarTitleTextColor: string;
693
+ calendarTitleColorHover: string;
692
694
  calendarDaysTextColor: string;
693
695
  panelHeaderDividerColor: string;
694
696
  calendarDaysDividerColor: string;
@@ -1300,6 +1302,7 @@ declare const datePickerProps: {
1300
1302
  panelTextColor: string;
1301
1303
  arrowColor: string;
1302
1304
  calendarTitleTextColor: string;
1305
+ calendarTitleColorHover: string;
1303
1306
  calendarDaysTextColor: string;
1304
1307
  panelHeaderDividerColor: string;
1305
1308
  calendarDaysDividerColor: string;
@@ -1972,6 +1975,7 @@ declare const _default: import("vue").DefineComponent<{
1972
1975
  panelTextColor: string;
1973
1976
  arrowColor: string;
1974
1977
  calendarTitleTextColor: string;
1978
+ calendarTitleColorHover: string;
1975
1979
  calendarDaysTextColor: string;
1976
1980
  panelHeaderDividerColor: string;
1977
1981
  calendarDaysDividerColor: string;
@@ -2583,6 +2587,7 @@ declare const _default: import("vue").DefineComponent<{
2583
2587
  panelTextColor: string;
2584
2588
  arrowColor: string;
2585
2589
  calendarTitleTextColor: string;
2590
+ calendarTitleColorHover: string;
2586
2591
  calendarDaysTextColor: string;
2587
2592
  panelHeaderDividerColor: string;
2588
2593
  calendarDaysDividerColor: string;
@@ -3194,6 +3199,7 @@ declare const _default: import("vue").DefineComponent<{
3194
3199
  panelTextColor: string;
3195
3200
  arrowColor: string;
3196
3201
  calendarTitleTextColor: string;
3202
+ calendarTitleColorHover: string;
3197
3203
  calendarDaysTextColor: string;
3198
3204
  panelHeaderDividerColor: string;
3199
3205
  calendarDaysDividerColor: string;
@@ -3974,6 +3980,7 @@ declare const _default: import("vue").DefineComponent<{
3974
3980
  panelTextColor: string;
3975
3981
  arrowColor: string;
3976
3982
  calendarTitleTextColor: string;
3983
+ calendarTitleColorHover: string;
3977
3984
  calendarDaysTextColor: string;
3978
3985
  panelHeaderDividerColor: string;
3979
3986
  calendarDaysDividerColor: string;
@@ -4875,6 +4882,7 @@ declare const _default: import("vue").DefineComponent<{
4875
4882
  '--n-panel-header-divider-color': string;
4876
4883
  '--n-calendar-left-padding': string;
4877
4884
  '--n-calendar-right-padding': string;
4885
+ '--n-calendar-title-color-hover': string;
4878
4886
  '--n-calendar-title-height': string;
4879
4887
  '--n-calendar-title-padding': string;
4880
4888
  '--n-calendar-title-font-size': string;
@@ -4986,6 +4994,7 @@ declare const _default: import("vue").DefineComponent<{
4986
4994
  panelTextColor: string;
4987
4995
  arrowColor: string;
4988
4996
  calendarTitleTextColor: string;
4997
+ calendarTitleColorHover: string;
4989
4998
  calendarDaysTextColor: string;
4990
4999
  panelHeaderDividerColor: string;
4991
5000
  calendarDaysDividerColor: string;
@@ -5597,6 +5606,7 @@ declare const _default: import("vue").DefineComponent<{
5597
5606
  panelTextColor: string;
5598
5607
  arrowColor: string;
5599
5608
  calendarTitleTextColor: string;
5609
+ calendarTitleColorHover: string;
5600
5610
  calendarDaysTextColor: string;
5601
5611
  panelHeaderDividerColor: string;
5602
5612
  calendarDaysDividerColor: string;
@@ -6208,6 +6218,7 @@ declare const _default: import("vue").DefineComponent<{
6208
6218
  panelTextColor: string;
6209
6219
  arrowColor: string;
6210
6220
  calendarTitleTextColor: string;
6221
+ calendarTitleColorHover: string;
6211
6222
  calendarDaysTextColor: string;
6212
6223
  panelHeaderDividerColor: string;
6213
6224
  calendarDaysDividerColor: string;
@@ -510,7 +510,7 @@ export default defineComponent({
510
510
  };
511
511
  }), cssVars: computed(() => {
512
512
  const { type } = props;
513
- const { common: { cubicBezierEaseInOut }, self: { calendarTitleFontSize, calendarDaysFontSize, itemFontSize, itemTextColor, itemColorDisabled, itemColorIncluded, itemColorHover, itemColorActive, itemBorderRadius, itemTextColorDisabled, itemTextColorActive, panelColor, panelTextColor, arrowColor, calendarTitleTextColor, panelActionDividerColor, panelHeaderDividerColor, calendarDaysDividerColor, panelBoxShadow, panelBorderRadius, calendarTitleFontWeight, panelExtraFooterPadding, panelActionPadding, itemSize, itemCellWidth, itemCellHeight, scrollItemWidth, scrollItemHeight, calendarTitlePadding, calendarTitleHeight, calendarDaysHeight, calendarDaysTextColor, arrowSize, panelHeaderPadding, calendarDividerColor, calendarTitleGridTempateColumns, iconColor, iconColorDisabled, scrollItemBorderRadius, [createKey('calendarLeftPadding', type)]: calendarLeftPadding, [createKey('calendarRightPadding', type)]: calendarRightPadding } } = themeRef.value;
513
+ const { common: { cubicBezierEaseInOut }, self: { calendarTitleFontSize, calendarDaysFontSize, itemFontSize, itemTextColor, itemColorDisabled, itemColorIncluded, itemColorHover, itemColorActive, itemBorderRadius, itemTextColorDisabled, itemTextColorActive, panelColor, panelTextColor, arrowColor, calendarTitleTextColor, panelActionDividerColor, panelHeaderDividerColor, calendarDaysDividerColor, panelBoxShadow, panelBorderRadius, calendarTitleFontWeight, panelExtraFooterPadding, panelActionPadding, itemSize, itemCellWidth, itemCellHeight, scrollItemWidth, scrollItemHeight, calendarTitlePadding, calendarTitleHeight, calendarDaysHeight, calendarDaysTextColor, arrowSize, panelHeaderPadding, calendarDividerColor, calendarTitleGridTempateColumns, iconColor, iconColorDisabled, scrollItemBorderRadius, calendarTitleColorHover, [createKey('calendarLeftPadding', type)]: calendarLeftPadding, [createKey('calendarRightPadding', type)]: calendarRightPadding } } = themeRef.value;
514
514
  return {
515
515
  '--n-bezier': cubicBezierEaseInOut,
516
516
  '--n-panel-border-radius': panelBorderRadius,
@@ -523,6 +523,7 @@ export default defineComponent({
523
523
  // panel calendar
524
524
  '--n-calendar-left-padding': calendarLeftPadding,
525
525
  '--n-calendar-right-padding': calendarRightPadding,
526
+ '--n-calendar-title-color-hover': calendarTitleColorHover,
526
527
  '--n-calendar-title-height': calendarTitleHeight,
527
528
  '--n-calendar-title-padding': calendarTitlePadding,
528
529
  '--n-calendar-title-font-size': calendarTitleFontSize,
@@ -192,6 +192,7 @@ declare const _default: import("vue").DefineComponent<{
192
192
  panelTextColor: string;
193
193
  arrowColor: string;
194
194
  calendarTitleTextColor: string;
195
+ calendarTitleColorHover: string;
195
196
  calendarDaysTextColor: string;
196
197
  panelHeaderDividerColor: string;
197
198
  calendarDaysDividerColor: string;
@@ -178,6 +178,7 @@ declare const _default: import("vue").DefineComponent<{
178
178
  panelTextColor: string;
179
179
  arrowColor: string;
180
180
  calendarTitleTextColor: string;
181
+ calendarTitleColorHover: string;
181
182
  calendarDaysTextColor: string;
182
183
  panelHeaderDividerColor: string;
183
184
  calendarDaysDividerColor: string;
@@ -186,6 +186,7 @@ declare const _default: import("vue").DefineComponent<{
186
186
  panelTextColor: string;
187
187
  arrowColor: string;
188
188
  calendarTitleTextColor: string;
189
+ calendarTitleColorHover: string;
189
190
  calendarDaysTextColor: string;
190
191
  panelHeaderDividerColor: string;
191
192
  calendarDaysDividerColor: string;
@@ -178,6 +178,7 @@ declare const _default: import("vue").DefineComponent<{
178
178
  panelTextColor: string;
179
179
  arrowColor: string;
180
180
  calendarTitleTextColor: string;
181
+ calendarTitleColorHover: string;
181
182
  calendarDaysTextColor: string;
182
183
  panelHeaderDividerColor: string;
183
184
  calendarDaysDividerColor: string;
@@ -194,6 +194,7 @@ declare const _default: import("vue").DefineComponent<{
194
194
  panelTextColor: string;
195
195
  arrowColor: string;
196
196
  calendarTitleTextColor: string;
197
+ calendarTitleColorHover: string;
197
198
  calendarDaysTextColor: string;
198
199
  panelHeaderDividerColor: string;
199
200
  calendarDaysDividerColor: string;
@@ -271,6 +271,7 @@ declare const _default: import("vue").DefineComponent<{
271
271
  panelTextColor: string;
272
272
  arrowColor: string;
273
273
  calendarTitleTextColor: string;
274
+ calendarTitleColorHover: string;
274
275
  calendarDaysTextColor: string;
275
276
  panelHeaderDividerColor: string;
276
277
  calendarDaysDividerColor: string;
@@ -1449,6 +1450,7 @@ declare const _default: import("vue").DefineComponent<{
1449
1450
  panelTextColor: string;
1450
1451
  arrowColor: string;
1451
1452
  calendarTitleTextColor: string;
1453
+ calendarTitleColorHover: string;
1452
1454
  calendarDaysTextColor: string;
1453
1455
  panelHeaderDividerColor: string;
1454
1456
  calendarDaysDividerColor: string;
@@ -53,9 +53,13 @@ export default defineComponent({
53
53
  h(VBinder, null, {
54
54
  default: () => [
55
55
  h(VTarget, null, {
56
- default: () => (h("div", { class: `${mergedClsPrefix}-date-panel-month__text`, onClick: this.handleHeaderClick }, this.monthBeforeYear
57
- ? [this.calendarMonth, this.calendarYear]
58
- : [this.calendarYear, this.calendarMonth]))
56
+ default: () => (h("div", { class: [
57
+ `${mergedClsPrefix}-date-panel-month__text`,
58
+ this.show &&
59
+ `${mergedClsPrefix}-date-panel-month__text--active`
60
+ ], onClick: this.handleHeaderClick }, this.monthBeforeYear
61
+ ? [this.calendarMonth, ' ', this.calendarYear]
62
+ : [this.calendarYear, ' ', this.calendarMonth]))
59
63
  }),
60
64
  h(VFollower, { show: this.show, teleportDisabled: true }, {
61
65
  default: () => (h(Transition, { name: "fade-in-scale-up-transition", appear: true }, {
@@ -190,6 +190,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
190
190
  panelTextColor: string;
191
191
  arrowColor: string;
192
192
  calendarTitleTextColor: string;
193
+ calendarTitleColorHover: string;
193
194
  calendarDaysTextColor: string;
194
195
  panelHeaderDividerColor: string;
195
196
  calendarDaysDividerColor: string;
@@ -182,6 +182,7 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
182
182
  panelTextColor: string;
183
183
  arrowColor: string;
184
184
  calendarTitleTextColor: string;
185
+ calendarTitleColorHover: string;
185
186
  calendarDaysTextColor: string;
186
187
  panelHeaderDividerColor: string;
187
188
  calendarDaysDividerColor: string;
@@ -144,6 +144,7 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
144
144
  panelTextColor: string;
145
145
  arrowColor: string;
146
146
  calendarTitleTextColor: string;
147
+ calendarTitleColorHover: string;
147
148
  calendarDaysTextColor: string;
148
149
  panelHeaderDividerColor: string;
149
150
  calendarDaysDividerColor: string;
@@ -13,6 +13,7 @@ import fadeInScaleUpTransition from '../../../_styles/transitions/fade-in-scale-
13
13
  // panel calendar
14
14
  // --n-calendar-left-padding
15
15
  // --n-calendar-right-padding
16
+ // --n-calendar-title-color-hover
16
17
  // --n-calendar-title-height
17
18
  // --n-calendar-title-padding
18
19
  // --n-calendar-title-font-size
@@ -185,16 +186,24 @@ export default c([cB('date-picker', `
185
186
  height: var(--n-arrow-size);
186
187
  color: var(--n-arrow-color);
187
188
  `), cE('month-year', `
189
+ user-select: none;
188
190
  flex-grow: 1;
189
191
  position: relative;
190
192
  `, [cE('text', `
191
193
  font-size: var(--n-calendar-title-font-size);
194
+ line-height: var(--n-calendar-title-font-size);
192
195
  font-weight: var(--n-calendar-title-font-weight);
193
- line-height: 17px;
196
+ padding: 6px 8px;
194
197
  text-align: center;
195
198
  color: var(--n-calendar-title-text-color);
196
199
  cursor: pointer;
197
- `)])]), cB('date-panel-weekdays', `
200
+ transition: background-color .3s var(--n-bezier);
201
+ border-radius: var(--n-panel-border-radius);
202
+ `, [cM('active', `
203
+ background-color: var(--n-calendar-title-color-hover);
204
+ `), c('&:hover', `
205
+ background-color: var(--n-calendar-title-color-hover);
206
+ `)])])]), cB('date-panel-weekdays', `
198
207
  display: grid;
199
208
  margin: auto;
200
209
  grid-template-columns: repeat(7, var(--n-item-cell-width));
@@ -204,6 +213,7 @@ export default c([cB('date-picker', `
204
213
  margin-bottom: 4px;
205
214
  border-bottom: 1px solid var(--n-calendar-days-divider-color);
206
215
  `, [cE('day', `
216
+ user-select: none;
207
217
  line-height: 15px;
208
218
  width: var(--n-item-size);
209
219
  text-align: center;
@@ -218,6 +228,7 @@ export default c([cB('date-picker', `
218
228
  justify-items: center;
219
229
  flex-wrap: wrap;
220
230
  `, [cB('date-panel-date', `
231
+ user-select: none;
221
232
  position: relative;
222
233
  width: var(--n-item-size);
223
234
  height: var(--n-item-size);
@@ -16,6 +16,7 @@ export declare const self: (vars: ThemeCommonVars) => {
16
16
  panelTextColor: string;
17
17
  arrowColor: string;
18
18
  calendarTitleTextColor: string;
19
+ calendarTitleColorHover: string;
19
20
  calendarDaysTextColor: string;
20
21
  panelHeaderDividerColor: string;
21
22
  calendarDaysDividerColor: string;
@@ -73,6 +74,7 @@ declare const datePickerLight: import("../../_mixins").Theme<"DatePicker", {
73
74
  panelTextColor: string;
74
75
  arrowColor: string;
75
76
  calendarTitleTextColor: string;
77
+ calendarTitleColorHover: string;
76
78
  calendarDaysTextColor: string;
77
79
  panelHeaderDividerColor: string;
78
80
  calendarDaysDividerColor: string;
@@ -8,7 +8,7 @@ import commonVars from './_common';
8
8
  import { createTheme } from '../../_mixins';
9
9
  export const self = (vars) => {
10
10
  const { hoverColor, fontSize, textColor2, textColorDisabled, popoverColor, primaryColor, borderRadiusSmall, iconColor, iconColorDisabled, textColor1, dividerColor, boxShadow2, borderRadius, fontWeightStrong } = vars;
11
- return Object.assign(Object.assign({}, commonVars), { itemFontSize: fontSize, calendarDaysFontSize: fontSize, calendarTitleFontSize: fontSize, itemTextColor: textColor2, itemTextColorDisabled: textColorDisabled, itemTextColorActive: popoverColor, itemTextColorCurrent: primaryColor, itemColorIncluded: changeColor(primaryColor, { alpha: 0.1 }), itemColorHover: hoverColor, itemColorDisabled: hoverColor, itemColorActive: primaryColor, itemBorderRadius: borderRadiusSmall, panelColor: popoverColor, panelTextColor: textColor2, arrowColor: iconColor, calendarTitleTextColor: textColor1, calendarDaysTextColor: textColor2, panelHeaderDividerColor: dividerColor, calendarDaysDividerColor: dividerColor, calendarDividerColor: dividerColor, panelActionDividerColor: dividerColor, panelBoxShadow: boxShadow2, panelBorderRadius: borderRadius, calendarTitleFontWeight: fontWeightStrong, scrollItemBorderRadius: borderRadius, iconColor,
11
+ return Object.assign(Object.assign({}, commonVars), { itemFontSize: fontSize, calendarDaysFontSize: fontSize, calendarTitleFontSize: fontSize, itemTextColor: textColor2, itemTextColorDisabled: textColorDisabled, itemTextColorActive: popoverColor, itemTextColorCurrent: primaryColor, itemColorIncluded: changeColor(primaryColor, { alpha: 0.1 }), itemColorHover: hoverColor, itemColorDisabled: hoverColor, itemColorActive: primaryColor, itemBorderRadius: borderRadiusSmall, panelColor: popoverColor, panelTextColor: textColor2, arrowColor: iconColor, calendarTitleTextColor: textColor1, calendarTitleColorHover: hoverColor, calendarDaysTextColor: textColor2, panelHeaderDividerColor: dividerColor, calendarDaysDividerColor: dividerColor, calendarDividerColor: dividerColor, panelActionDividerColor: dividerColor, panelBoxShadow: boxShadow2, panelBorderRadius: borderRadius, calendarTitleFontWeight: fontWeightStrong, scrollItemBorderRadius: borderRadius, iconColor,
12
12
  iconColorDisabled });
13
13
  };
14
14
  const datePickerLight = createTheme({
@@ -110,7 +110,6 @@ export default defineComponent({
110
110
  },
111
111
  render() {
112
112
  const { $slots, bordered, mergedIconPlacement, cssVars, closable, showIcon, title, content, action, negativeText, positiveText, handlePositiveClick, handleNegativeClick, mergedTheme, loading, type, mergedClsPrefix } = this;
113
- console.log('action', $slots.action);
114
113
  return (h("div", { class: [
115
114
  `${mergedClsPrefix}-dialog`,
116
115
  `${mergedClsPrefix}-dialog--icon-${mergedIconPlacement}`,
@@ -34,16 +34,8 @@ declare const dynamicInputProps: {
34
34
  readonly onRemove: PropType<(index: number) => void>;
35
35
  readonly 'onUpdate:value': PropType<MaybeArray<OnUpdateValue>>;
36
36
  readonly onUpdateValue: PropType<MaybeArray<OnUpdateValue>>;
37
- readonly onClear: {
38
- readonly type: PropType<() => void>;
39
- readonly validator: () => boolean;
40
- readonly default: undefined;
41
- };
42
- readonly onInput: {
43
- readonly type: PropType<MaybeArray<OnUpdateValue> | undefined>;
44
- readonly validator: () => boolean;
45
- readonly default: undefined;
46
- };
37
+ readonly onClear: PropType<() => void>;
38
+ readonly onInput: PropType<MaybeArray<OnUpdateValue>>;
47
39
  readonly theme: PropType<import("../../_mixins").Theme<"DynamicInput", {
48
40
  actionMargin: string;
49
41
  }, {
@@ -883,16 +875,8 @@ declare const _default: import("vue").DefineComponent<{
883
875
  readonly onRemove: PropType<(index: number) => void>;
884
876
  readonly 'onUpdate:value': PropType<MaybeArray<OnUpdateValue>>;
885
877
  readonly onUpdateValue: PropType<MaybeArray<OnUpdateValue>>;
886
- readonly onClear: {
887
- readonly type: PropType<() => void>;
888
- readonly validator: () => boolean;
889
- readonly default: undefined;
890
- };
891
- readonly onInput: {
892
- readonly type: PropType<MaybeArray<OnUpdateValue> | undefined>;
893
- readonly validator: () => boolean;
894
- readonly default: undefined;
895
- };
878
+ readonly onClear: PropType<() => void>;
879
+ readonly onInput: PropType<MaybeArray<OnUpdateValue>>;
896
880
  readonly theme: PropType<import("../../_mixins").Theme<"DynamicInput", {
897
881
  actionMargin: string;
898
882
  }, {
@@ -2135,16 +2119,8 @@ declare const _default: import("vue").DefineComponent<{
2135
2119
  readonly onRemove: PropType<(index: number) => void>;
2136
2120
  readonly 'onUpdate:value': PropType<MaybeArray<OnUpdateValue>>;
2137
2121
  readonly onUpdateValue: PropType<MaybeArray<OnUpdateValue>>;
2138
- readonly onClear: {
2139
- readonly type: PropType<() => void>;
2140
- readonly validator: () => boolean;
2141
- readonly default: undefined;
2142
- };
2143
- readonly onInput: {
2144
- readonly type: PropType<MaybeArray<OnUpdateValue> | undefined>;
2145
- readonly validator: () => boolean;
2146
- readonly default: undefined;
2147
- };
2122
+ readonly onClear: PropType<() => void>;
2123
+ readonly onInput: PropType<MaybeArray<OnUpdateValue>>;
2148
2124
  readonly theme: PropType<import("../../_mixins").Theme<"DynamicInput", {
2149
2125
  actionMargin: string;
2150
2126
  }, {
@@ -2950,10 +2926,8 @@ declare const _default: import("vue").DefineComponent<{
2950
2926
  }, any>;
2951
2927
  }>>>;
2952
2928
  }>>, {
2953
- onInput: MaybeArray<OnUpdateValue> | undefined;
2954
2929
  placeholder: string;
2955
2930
  min: number;
2956
- onClear: () => void;
2957
2931
  defaultValue: any[];
2958
2932
  preset: "input" | "pair";
2959
2933
  keyPlaceholder: string;
@@ -1,11 +1,11 @@
1
- import { h, ref, toRef, isProxy, toRaw, computed, defineComponent, inject, provide } from 'vue';
1
+ import { h, ref, toRef, isProxy, toRaw, computed, defineComponent, inject, provide, watchEffect } from 'vue';
2
2
  import { useMergedState } from 'vooks';
3
3
  import { createId } from 'seemly';
4
4
  import { RemoveIcon, AddIcon } from '../../_internal/icons';
5
5
  import { NBaseIcon } from '../../_internal';
6
6
  import { NButton, NButtonGroup } from '../../button';
7
7
  import { useTheme, useLocale, useConfig } from '../../_mixins';
8
- import { warn, call } from '../../_utils';
8
+ import { call, warnOnce } from '../../_utils';
9
9
  import { formItemInjectionKey } from '../../_mixins/use-form-item';
10
10
  import { dynamicInputLight } from '../styles';
11
11
  import NDynamicInputInputPreset from './InputPreset';
@@ -39,27 +39,21 @@ const dynamicInputProps = Object.assign(Object.assign({}, useTheme.props), { max
39
39
  default: ''
40
40
  }, onCreate: Function, onRemove: Function, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array],
41
41
  // deprecated
42
- onClear: {
43
- type: Function,
44
- validator: () => {
45
- warn('dynamic-input', '`on-clear` is deprecated, it is out of usage anymore.');
46
- return true;
47
- },
48
- default: undefined
49
- }, onInput: {
50
- type: [Function, Array],
51
- validator: () => {
52
- if (process.env.NODE_ENV !== 'production') {
53
- warn('dynamic-input', '`on-input` is deprecated, please use `on-update:value` instead.');
54
- }
55
- return true;
56
- },
57
- default: undefined
58
- } });
42
+ onClear: Function, onInput: [Function, Array] });
59
43
  export default defineComponent({
60
44
  name: 'DynamicInput',
61
45
  props: dynamicInputProps,
62
46
  setup(props, { slots }) {
47
+ if (process.env.NODE_ENV !== 'production') {
48
+ watchEffect(() => {
49
+ if (props.onClear !== undefined) {
50
+ warnOnce('dynamic-input', '`on-clear` is deprecated, it is out of usage anymore.');
51
+ }
52
+ if (props.onInput !== undefined) {
53
+ warnOnce('dynamic-input', '`on-input` is deprecated, please use `on-update:value` instead.');
54
+ }
55
+ });
56
+ }
63
57
  const { NConfigProvider, mergedClsPrefixRef } = useConfig();
64
58
  const NFormItem = inject(formItemInjectionKey, null);
65
59
  const uncontrolledValueRef = ref(props.defaultValue);
@@ -201,7 +195,7 @@ export default defineComponent({
201
195
  },
202
196
  render() {
203
197
  const { buttonSize, mergedClsPrefix, mergedValue, locale, mergedTheme, keyField, $slots, preset, itemStyle, NFormItem, ensureKey, handleValueChange, remove, createItem } = this;
204
- return (h("div", { class: `${mergedClsPrefix}-dynamic-input`, style: this.cssVars }, !Array.isArray(mergedValue) || mergedValue.length === 0 ? (h(NButton, { block: true, ghost: true, dashed: true, size: buttonSize, theme: mergedTheme.peers.Button, themeOverrides: mergedTheme.peerOverrides.Button, onClick: this.handleCreateClick }, {
198
+ return (h("div", { class: `${mergedClsPrefix}-dynamic-input`, style: this.cssVars }, !Array.isArray(mergedValue) || mergedValue.length === 0 ? (h(NButton, { block: true, ghost: true, dashed: true, disabled: this.insertionDisabled, size: buttonSize, theme: mergedTheme.peers.Button, themeOverrides: mergedTheme.peerOverrides.Button, onClick: this.handleCreateClick }, {
205
199
  default: () => locale.create,
206
200
  icon: () => (h(NBaseIcon, { clsPrefix: mergedClsPrefix }, { default: () => h(AddIcon, null) }))
207
201
  })) : (mergedValue.map((_, index) => (h("div", { key: keyField ? _[keyField] : ensureKey(_, index), "data-key": keyField ? _[keyField] : ensureKey(_, index), class: `${mergedClsPrefix}-dynamic-input-item`, style: itemStyle },
@@ -1,9 +1,10 @@
1
- import { PropType } from 'vue';
1
+ import { Component, PropType } from 'vue';
2
2
  export declare type Depth = 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5' | undefined;
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  depth: PropType<Depth>;
5
5
  size: (StringConstructor | NumberConstructor)[];
6
6
  color: StringConstructor;
7
+ component: PropType<Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
7
8
  theme: PropType<import("../../_mixins").Theme<"Icon", {
8
9
  color: string;
9
10
  opacity1Depth: string;
@@ -47,6 +48,7 @@ declare const _default: import("vue").DefineComponent<{
47
48
  depth: PropType<Depth>;
48
49
  size: (StringConstructor | NumberConstructor)[];
49
50
  color: StringConstructor;
51
+ component: PropType<Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
50
52
  theme: PropType<import("../../_mixins").Theme<"Icon", {
51
53
  color: string;
52
54
  opacity1Depth: string;
@@ -1,4 +1,4 @@
1
- import { h, defineComponent, computed, mergeProps } from 'vue';
1
+ import { computed, defineComponent, h, mergeProps } from 'vue';
2
2
  import { useConfig, useTheme } from '../../_mixins';
3
3
  import { formatLength, warn } from '../../_utils';
4
4
  import { iconLight } from '../styles';
@@ -7,7 +7,7 @@ export default defineComponent({
7
7
  _n_icon__: true,
8
8
  name: 'Icon',
9
9
  inheritAttrs: false,
10
- props: Object.assign(Object.assign({}, useTheme.props), { depth: [String, Number], size: [Number, String], color: String }),
10
+ props: Object.assign(Object.assign({}, useTheme.props), { depth: [String, Number], size: [Number, String], color: String, component: Object }),
11
11
  setup(props) {
12
12
  const { mergedClsPrefixRef } = useConfig(props);
13
13
  const themeRef = useTheme('Icon', 'Icon', style, iconLight, props, mergedClsPrefixRef);
@@ -39,7 +39,7 @@ export default defineComponent({
39
39
  },
40
40
  render() {
41
41
  var _a;
42
- const { $parent, depth, mergedClsPrefix } = this;
42
+ const { $parent, depth, mergedClsPrefix, component } = this;
43
43
  if ((_a = $parent === null || $parent === void 0 ? void 0 : $parent.$options) === null || _a === void 0 ? void 0 : _a._n_icon__) {
44
44
  warn('icon', "don't wrap `n-icon` inside `n-icon`");
45
45
  }
@@ -53,6 +53,6 @@ export default defineComponent({
53
53
  }
54
54
  ],
55
55
  style: Object.assign(this.cssVars, this.mergedStyle)
56
- }), this.$slots);
56
+ }), component ? h(component) : this.$slots);
57
57
  }
58
58
  });
@@ -146,6 +146,7 @@ cE('textarea', `
146
146
  line-height: var(--n-line-height-textarea);
147
147
  margin: 0;
148
148
  resize: none;
149
+ white-space: pre-wrap;
149
150
  `), cE('textarea-mirror', `
150
151
  pointer-events: none;
151
152
  overflow: hidden;