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.
- package/dist/index.js +425 -248
- package/dist/index.prod.js +2 -2
- package/es/_internal/select-menu/src/SelectOption.js +1 -2
- package/es/_utils/cssr/index.js +1 -1
- package/es/calendar/src/Calendar.js +2 -1
- package/es/card/src/Card.d.ts +24 -1
- package/es/card/src/Card.js +8 -4
- package/es/card/src/styles/index.cssr.js +17 -8
- package/es/card/styles/dark.js +3 -1
- package/es/card/styles/light.d.ts +2 -0
- package/es/card/styles/light.js +1 -1
- package/es/countdown/src/Countdown.js +0 -5
- package/es/data-table/src/DataTable.d.ts +10 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +1 -0
- package/es/data-table/src/TableParts/Body.d.ts +1 -0
- package/es/data-table/src/TableParts/Cell.d.ts +2 -0
- package/es/data-table/src/TableParts/Header.d.ts +1 -0
- package/es/data-table/src/use-sorter.js +1 -1
- package/es/data-table/styles/light.d.ts +1 -0
- package/es/dialog/index.d.ts +1 -1
- package/es/dialog/index.js +1 -1
- package/es/dialog/src/DialogEnvironment.d.ts +3 -0
- package/es/dialog/src/DialogEnvironment.js +2 -2
- package/es/dialog/src/DialogProvider.d.ts +4 -0
- package/es/dialog/src/DialogProvider.js +2 -1
- package/es/dialog/src/composables.d.ts +4 -0
- package/es/dialog/src/composables.js +17 -0
- package/es/dialog/src/context.d.ts +2 -1
- package/es/dialog/src/context.js +1 -0
- package/es/form/src/FormItem.d.ts +1 -0
- package/es/form/src/FormItem.js +27 -18
- package/es/form/src/styles/form-item.cssr.js +41 -19
- package/es/form/src/utils.d.ts +1 -0
- package/es/form/src/utils.js +15 -10
- package/es/input/src/utils.js +1 -1
- package/es/locales/common/frFR.js +8 -11
- package/es/menu/src/Menu.d.ts +13 -0
- package/es/menu/src/Menu.js +7 -1
- package/es/modal/src/BodyWrapper.d.ts +2 -0
- package/es/modal/src/Modal.d.ts +18 -0
- package/es/modal/src/presetProps.d.ts +1 -1
- package/es/modal/styles/light.d.ts +2 -0
- package/es/pagination/src/Pagination.js +5 -1
- package/es/radio/src/Radio.d.ts +13 -32
- package/es/radio/src/Radio.js +7 -6
- package/es/radio/src/RadioButton.d.ts +6 -9
- package/es/radio/src/RadioButton.js +7 -11
- package/es/radio/src/RadioGroup.d.ts +17 -8
- package/es/radio/src/RadioGroup.js +2 -2
- package/es/radio/src/interface.d.ts +2 -2
- package/es/radio/src/styles/radio.cssr.js +4 -1
- package/es/radio/src/use-radio.d.ts +4 -32
- package/es/radio/src/use-radio.js +12 -10
- package/es/radio/styles/dark.js +1 -1
- package/es/radio/styles/light.d.ts +1 -0
- package/es/radio/styles/light.js +1 -1
- package/es/rate/src/Rate.d.ts +23 -14
- package/es/rate/src/Rate.js +32 -12
- package/es/rate/src/interface.d.ts +2 -0
- package/es/rate/src/interface.js +1 -0
- package/es/rate/src/styles/index.cssr.js +13 -13
- package/es/slider/src/Slider.d.ts +13 -0
- package/es/slider/src/Slider.js +6 -3
- package/es/theme-editor/src/MaximizeIcon.d.ts +1 -0
- package/es/theme-editor/src/MaximizeIcon.js +8 -0
- package/es/theme-editor/src/MinimizeIcon.d.ts +1 -0
- package/es/theme-editor/src/MinimizeIcon.js +8 -0
- package/es/theme-editor/src/ThemeEditor.d.ts +4 -0
- package/es/theme-editor/src/ThemeEditor.js +42 -18
- package/es/tree/src/styles/index.cssr.js +4 -3
- package/es/upload/src/interface.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/select-menu/src/SelectOption.js +1 -2
- package/lib/_utils/cssr/index.js +2 -5
- package/lib/calendar/src/Calendar.js +2 -1
- package/lib/card/src/Card.d.ts +24 -1
- package/lib/card/src/Card.js +8 -4
- package/lib/card/src/styles/index.cssr.js +17 -8
- package/lib/card/styles/dark.js +3 -1
- package/lib/card/styles/light.d.ts +2 -0
- package/lib/card/styles/light.js +1 -1
- package/lib/countdown/src/Countdown.js +0 -5
- package/lib/data-table/src/DataTable.d.ts +10 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +1 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +1 -0
- package/lib/data-table/src/TableParts/Body.d.ts +1 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +2 -0
- package/lib/data-table/src/TableParts/Header.d.ts +1 -0
- package/lib/data-table/src/use-sorter.js +1 -1
- package/lib/data-table/styles/light.d.ts +1 -0
- package/lib/dialog/index.d.ts +1 -1
- package/lib/dialog/index.js +4 -3
- package/lib/dialog/src/DialogEnvironment.d.ts +3 -0
- package/lib/dialog/src/DialogEnvironment.js +2 -2
- package/lib/dialog/src/DialogProvider.d.ts +4 -0
- package/lib/dialog/src/DialogProvider.js +1 -0
- package/lib/dialog/src/composables.d.ts +4 -0
- package/lib/dialog/src/{use-dialog.js → composables.js} +9 -1
- package/lib/dialog/src/context.d.ts +2 -1
- package/lib/dialog/src/context.js +2 -1
- package/lib/form/src/FormItem.d.ts +1 -0
- package/lib/form/src/FormItem.js +27 -18
- package/lib/form/src/styles/form-item.cssr.js +41 -19
- package/lib/form/src/utils.d.ts +1 -0
- package/lib/form/src/utils.js +15 -10
- package/lib/input/src/utils.js +1 -1
- package/lib/locales/common/frFR.js +8 -11
- package/lib/menu/src/Menu.d.ts +13 -0
- package/lib/menu/src/Menu.js +7 -1
- package/lib/modal/src/BodyWrapper.d.ts +2 -0
- package/lib/modal/src/Modal.d.ts +18 -0
- package/lib/modal/src/presetProps.d.ts +1 -1
- package/lib/modal/styles/light.d.ts +2 -0
- package/lib/pagination/src/Pagination.js +5 -1
- package/lib/radio/src/Radio.d.ts +13 -32
- package/lib/radio/src/Radio.js +7 -6
- package/lib/radio/src/RadioButton.d.ts +6 -9
- package/lib/radio/src/RadioButton.js +7 -14
- package/lib/radio/src/RadioGroup.d.ts +17 -8
- package/lib/radio/src/RadioGroup.js +2 -2
- package/lib/radio/src/interface.d.ts +2 -2
- package/lib/radio/src/styles/radio.cssr.js +4 -1
- package/lib/radio/src/use-radio.d.ts +4 -32
- package/lib/radio/src/use-radio.js +11 -9
- package/lib/radio/styles/dark.js +1 -1
- package/lib/radio/styles/light.d.ts +1 -0
- package/lib/radio/styles/light.js +1 -1
- package/lib/rate/src/Rate.d.ts +23 -14
- package/lib/rate/src/Rate.js +32 -12
- package/lib/rate/src/interface.d.ts +2 -0
- package/lib/rate/src/interface.js +2 -0
- package/lib/rate/src/styles/index.cssr.js +13 -13
- package/lib/slider/src/Slider.d.ts +13 -0
- package/lib/slider/src/Slider.js +6 -3
- package/lib/theme-editor/src/MaximizeIcon.d.ts +1 -0
- package/lib/theme-editor/src/MaximizeIcon.js +11 -0
- package/lib/theme-editor/src/MinimizeIcon.d.ts +1 -0
- package/lib/theme-editor/src/MinimizeIcon.js +11 -0
- package/lib/theme-editor/src/ThemeEditor.d.ts +4 -0
- package/lib/theme-editor/src/ThemeEditor.js +42 -18
- package/lib/tree/src/styles/index.cssr.js +4 -3
- package/lib/upload/src/interface.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -7
- package/web-types.json +36 -5
- package/es/countdown/src/utils.d.ts +0 -0
- package/es/countdown/src/utils.js +0 -1
- package/es/dialog/src/use-dialog.d.ts +0 -2
- package/es/dialog/src/use-dialog.js +0 -10
- package/lib/countdown/src/utils.d.ts +0 -0
- package/lib/countdown/src/utils.js +0 -1
- package/lib/dialog/src/use-dialog.d.ts +0 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.radioGroupInjectionKey = void 0;
|
|
3
|
+
exports.setup = exports.radioGroupInjectionKey = exports.radioProps = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const vooks_1 = require("vooks");
|
|
6
6
|
const _mixins_1 = require("../../_mixins");
|
|
7
7
|
const _utils_1 = require("../../_utils");
|
|
8
|
-
|
|
8
|
+
exports.radioProps = {
|
|
9
9
|
name: String,
|
|
10
10
|
value: {
|
|
11
|
-
type: [String, Number],
|
|
11
|
+
type: [String, Number, Boolean],
|
|
12
12
|
default: 'on'
|
|
13
13
|
},
|
|
14
14
|
checked: {
|
|
@@ -27,15 +27,18 @@ const radioProps = {
|
|
|
27
27
|
// deprecated
|
|
28
28
|
checkedValue: {
|
|
29
29
|
type: Boolean,
|
|
30
|
-
validator: () => {
|
|
31
|
-
(0, _utils_1.warn)('radio', '`checked-value` is deprecated, please use `checked` instead.');
|
|
32
|
-
return true;
|
|
33
|
-
},
|
|
34
30
|
default: undefined
|
|
35
31
|
}
|
|
36
32
|
};
|
|
37
33
|
exports.radioGroupInjectionKey = (0, _utils_1.createInjectionKey)('n-radio-group');
|
|
38
34
|
function setup(props) {
|
|
35
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
36
|
+
(0, vue_1.watchEffect)(() => {
|
|
37
|
+
if (props.checkedValue !== undefined) {
|
|
38
|
+
(0, _utils_1.warnOnce)('radio', '`checked-value` is deprecated, please use `checked` instead.');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
39
42
|
const formItem = (0, _mixins_1.useFormItem)(props, {
|
|
40
43
|
mergedSize(NFormItem) {
|
|
41
44
|
const { size } = props;
|
|
@@ -133,5 +136,4 @@ function setup(props) {
|
|
|
133
136
|
handleRadioInputFocus
|
|
134
137
|
};
|
|
135
138
|
}
|
|
136
|
-
setup
|
|
137
|
-
exports.default = setup;
|
|
139
|
+
exports.setup = setup;
|
package/lib/radio/styles/dark.js
CHANGED
|
@@ -13,7 +13,7 @@ const radioDark = {
|
|
|
13
13
|
const { borderColor, primaryColor, baseColor, textColorDisabled, inputColorDisabled, textColor2, opacityDisabled, borderRadius, fontSizeSmall, fontSizeMedium, fontSizeLarge, heightSmall, heightMedium, heightLarge, lineHeight } = vars;
|
|
14
14
|
return Object.assign(Object.assign({}, _common_1.default), { labelLineHeight: lineHeight, buttonHeightSmall: heightSmall, buttonHeightMedium: heightMedium, buttonHeightLarge: heightLarge, fontSizeSmall,
|
|
15
15
|
fontSizeMedium,
|
|
16
|
-
fontSizeLarge, boxShadow: `inset 0 0 0 1px ${borderColor}`, boxShadowActive: `inset 0 0 0 1px ${primaryColor}`, boxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}`, boxShadowHover: `inset 0 0 0 1px ${primaryColor}`, boxShadowDisabled: `inset 0 0 0 1px ${borderColor}`, color: '#0000', colorDisabled: inputColorDisabled, textColor: textColor2, textColorDisabled, dotColorActive: primaryColor, dotColorDisabled: borderColor, buttonBorderColor: borderColor, buttonBorderColorActive: primaryColor, buttonBorderColorHover: primaryColor, buttonColor: '#0000', buttonColorActive: primaryColor, buttonTextColor: textColor2, buttonTextColorActive: baseColor, buttonTextColorHover: primaryColor, opacityDisabled, buttonBoxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}`, buttonBoxShadowHover: `inset 0 0 0 1px ${primaryColor}`, buttonBoxShadow: 'inset 0 0 0 1px #0000', buttonBorderRadius: borderRadius });
|
|
16
|
+
fontSizeLarge, boxShadow: `inset 0 0 0 1px ${borderColor}`, boxShadowActive: `inset 0 0 0 1px ${primaryColor}`, boxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}`, boxShadowHover: `inset 0 0 0 1px ${primaryColor}`, boxShadowDisabled: `inset 0 0 0 1px ${borderColor}`, color: '#0000', colorDisabled: inputColorDisabled, colorActive: '#0000', textColor: textColor2, textColorDisabled, dotColorActive: primaryColor, dotColorDisabled: borderColor, buttonBorderColor: borderColor, buttonBorderColorActive: primaryColor, buttonBorderColorHover: primaryColor, buttonColor: '#0000', buttonColorActive: primaryColor, buttonTextColor: textColor2, buttonTextColorActive: baseColor, buttonTextColorHover: primaryColor, opacityDisabled, buttonBoxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}`, buttonBoxShadowHover: `inset 0 0 0 1px ${primaryColor}`, buttonBoxShadow: 'inset 0 0 0 1px #0000', buttonBorderRadius: borderRadius });
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
exports.default = radioDark;
|
|
@@ -10,7 +10,7 @@ const self = (vars) => {
|
|
|
10
10
|
const { borderColor, primaryColor, baseColor, textColorDisabled, inputColorDisabled, textColor2, opacityDisabled, borderRadius, fontSizeSmall, fontSizeMedium, fontSizeLarge, heightSmall, heightMedium, heightLarge, lineHeight } = vars;
|
|
11
11
|
return Object.assign(Object.assign({}, _common_1.default), { labelLineHeight: lineHeight, buttonHeightSmall: heightSmall, buttonHeightMedium: heightMedium, buttonHeightLarge: heightLarge, fontSizeSmall,
|
|
12
12
|
fontSizeMedium,
|
|
13
|
-
fontSizeLarge, boxShadow: `inset 0 0 0 1px ${borderColor}`, boxShadowActive: `inset 0 0 0 1px ${primaryColor}`, boxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.2 })}`, boxShadowHover: `inset 0 0 0 1px ${primaryColor}`, boxShadowDisabled: `inset 0 0 0 1px ${borderColor}`, color: baseColor, colorDisabled: inputColorDisabled, textColor: textColor2, textColorDisabled, dotColorActive: primaryColor, dotColorDisabled: borderColor, buttonBorderColor: borderColor, buttonBorderColorActive: primaryColor, buttonBorderColorHover: borderColor, buttonColor: baseColor, buttonColorActive: baseColor, buttonTextColor: textColor2, buttonTextColorActive: primaryColor, buttonTextColorHover: primaryColor, opacityDisabled, buttonBoxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}`, buttonBoxShadowHover: 'inset 0 0 0 1px #0000', buttonBoxShadow: 'inset 0 0 0 1px #0000', buttonBorderRadius: borderRadius });
|
|
13
|
+
fontSizeLarge, boxShadow: `inset 0 0 0 1px ${borderColor}`, boxShadowActive: `inset 0 0 0 1px ${primaryColor}`, boxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.2 })}`, boxShadowHover: `inset 0 0 0 1px ${primaryColor}`, boxShadowDisabled: `inset 0 0 0 1px ${borderColor}`, color: baseColor, colorDisabled: inputColorDisabled, colorActive: '#0000', textColor: textColor2, textColorDisabled, dotColorActive: primaryColor, dotColorDisabled: borderColor, buttonBorderColor: borderColor, buttonBorderColorActive: primaryColor, buttonBorderColorHover: borderColor, buttonColor: baseColor, buttonColorActive: baseColor, buttonTextColor: textColor2, buttonTextColorActive: primaryColor, buttonTextColorHover: primaryColor, opacityDisabled, buttonBoxShadowFocus: `inset 0 0 0 1px ${primaryColor}, 0 0 0 2px ${(0, seemly_1.changeColor)(primaryColor, { alpha: 0.3 })}`, buttonBoxShadowHover: 'inset 0 0 0 1px #0000', buttonBoxShadow: 'inset 0 0 0 1px #0000', buttonBorderRadius: borderRadius });
|
|
14
14
|
};
|
|
15
15
|
const radioLight = {
|
|
16
16
|
name: 'Radio',
|
package/lib/rate/src/Rate.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
|
|
3
|
+
import type { RateOnUpdateValue } from './interface';
|
|
3
4
|
export declare const rateProps: {
|
|
4
5
|
readonly allowHalf: BooleanConstructor;
|
|
5
6
|
readonly count: {
|
|
@@ -8,17 +9,19 @@ export declare const rateProps: {
|
|
|
8
9
|
};
|
|
9
10
|
readonly value: NumberConstructor;
|
|
10
11
|
readonly defaultValue: {
|
|
11
|
-
readonly type:
|
|
12
|
-
readonly default:
|
|
12
|
+
readonly type: PropType<number | null>;
|
|
13
|
+
readonly default: null;
|
|
13
14
|
};
|
|
14
15
|
readonly readonly: BooleanConstructor;
|
|
15
16
|
readonly size: {
|
|
16
17
|
readonly type: PropType<number | "small" | "medium" | "large">;
|
|
17
18
|
readonly default: "medium";
|
|
18
19
|
};
|
|
20
|
+
readonly clearable: BooleanConstructor;
|
|
19
21
|
readonly color: StringConstructor;
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
+
readonly onClear: PropType<() => void>;
|
|
23
|
+
readonly 'onUpdate:value': PropType<MaybeArray<RateOnUpdateValue>>;
|
|
24
|
+
readonly onUpdateValue: PropType<MaybeArray<RateOnUpdateValue>>;
|
|
22
25
|
readonly theme: PropType<import("../../_mixins").Theme<"Rate", {
|
|
23
26
|
itemColor: string;
|
|
24
27
|
itemColorActive: string;
|
|
@@ -50,17 +53,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
53
|
};
|
|
51
54
|
readonly value: NumberConstructor;
|
|
52
55
|
readonly defaultValue: {
|
|
53
|
-
readonly type:
|
|
54
|
-
readonly default:
|
|
56
|
+
readonly type: PropType<number | null>;
|
|
57
|
+
readonly default: null;
|
|
55
58
|
};
|
|
56
59
|
readonly readonly: BooleanConstructor;
|
|
57
60
|
readonly size: {
|
|
58
61
|
readonly type: PropType<number | "small" | "medium" | "large">;
|
|
59
62
|
readonly default: "medium";
|
|
60
63
|
};
|
|
64
|
+
readonly clearable: BooleanConstructor;
|
|
61
65
|
readonly color: StringConstructor;
|
|
62
|
-
readonly
|
|
63
|
-
readonly
|
|
66
|
+
readonly onClear: PropType<() => void>;
|
|
67
|
+
readonly 'onUpdate:value': PropType<MaybeArray<RateOnUpdateValue>>;
|
|
68
|
+
readonly onUpdateValue: PropType<MaybeArray<RateOnUpdateValue>>;
|
|
64
69
|
readonly theme: PropType<import("../../_mixins").Theme<"Rate", {
|
|
65
70
|
itemColor: string;
|
|
66
71
|
itemColorActive: string;
|
|
@@ -84,11 +89,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
89
|
}, any>>>;
|
|
85
90
|
}, {
|
|
86
91
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
87
|
-
mergedValue: import("vue").ComputedRef<number>;
|
|
92
|
+
mergedValue: import("vue").ComputedRef<number | null>;
|
|
88
93
|
hoverIndex: import("vue").Ref<number | null>;
|
|
89
94
|
handleMouseMove: (index: number, e: MouseEvent) => void;
|
|
90
95
|
handleClick: (index: number, e: MouseEvent) => void;
|
|
91
96
|
handleMouseLeave: () => void;
|
|
97
|
+
handleMouseEnterSomeStar: () => void;
|
|
92
98
|
cssVars: import("vue").ComputedRef<{
|
|
93
99
|
'--n-bezier': string;
|
|
94
100
|
'--n-item-color': string;
|
|
@@ -105,17 +111,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
111
|
};
|
|
106
112
|
readonly value: NumberConstructor;
|
|
107
113
|
readonly defaultValue: {
|
|
108
|
-
readonly type:
|
|
109
|
-
readonly default:
|
|
114
|
+
readonly type: PropType<number | null>;
|
|
115
|
+
readonly default: null;
|
|
110
116
|
};
|
|
111
117
|
readonly readonly: BooleanConstructor;
|
|
112
118
|
readonly size: {
|
|
113
119
|
readonly type: PropType<number | "small" | "medium" | "large">;
|
|
114
120
|
readonly default: "medium";
|
|
115
121
|
};
|
|
122
|
+
readonly clearable: BooleanConstructor;
|
|
116
123
|
readonly color: StringConstructor;
|
|
117
|
-
readonly
|
|
118
|
-
readonly
|
|
124
|
+
readonly onClear: PropType<() => void>;
|
|
125
|
+
readonly 'onUpdate:value': PropType<MaybeArray<RateOnUpdateValue>>;
|
|
126
|
+
readonly onUpdateValue: PropType<MaybeArray<RateOnUpdateValue>>;
|
|
119
127
|
readonly theme: PropType<import("../../_mixins").Theme<"Rate", {
|
|
120
128
|
itemColor: string;
|
|
121
129
|
itemColorActive: string;
|
|
@@ -140,7 +148,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
148
|
}>>, {
|
|
141
149
|
readonly readonly: boolean;
|
|
142
150
|
readonly size: number | "small" | "medium" | "large";
|
|
143
|
-
readonly
|
|
151
|
+
readonly clearable: boolean;
|
|
152
|
+
readonly defaultValue: number | null;
|
|
144
153
|
readonly count: number;
|
|
145
154
|
readonly allowHalf: boolean;
|
|
146
155
|
}>;
|
package/lib/rate/src/Rate.js
CHANGED
|
@@ -10,18 +10,18 @@ const _internal_1 = require("../../_internal");
|
|
|
10
10
|
const _mixins_1 = require("../../_mixins");
|
|
11
11
|
const _utils_1 = require("../../_utils");
|
|
12
12
|
const styles_1 = require("../styles");
|
|
13
|
-
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
14
13
|
const StarIcon_1 = __importDefault(require("./StarIcon"));
|
|
14
|
+
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
15
15
|
exports.rateProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { allowHalf: Boolean, count: {
|
|
16
16
|
type: Number,
|
|
17
17
|
default: 5
|
|
18
18
|
}, value: Number, defaultValue: {
|
|
19
19
|
type: Number,
|
|
20
|
-
default:
|
|
20
|
+
default: null
|
|
21
21
|
}, readonly: Boolean, size: {
|
|
22
22
|
type: [String, Number],
|
|
23
23
|
default: 'medium'
|
|
24
|
-
}, color: String, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array] });
|
|
24
|
+
}, clearable: Boolean, color: String, onClear: Function, 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array] });
|
|
25
25
|
exports.default = (0, vue_1.defineComponent)({
|
|
26
26
|
name: 'Rate',
|
|
27
27
|
props: exports.rateProps,
|
|
@@ -32,6 +32,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
32
32
|
const uncontrolledValueRef = (0, vue_1.ref)(props.defaultValue);
|
|
33
33
|
const hoverIndexRef = (0, vue_1.ref)(null);
|
|
34
34
|
const formItem = (0, _mixins_1.useFormItem)(props);
|
|
35
|
+
const mergedValue = (0, vooks_1.useMergedState)(controlledValueRef, uncontrolledValueRef);
|
|
35
36
|
function doUpdateValue(value) {
|
|
36
37
|
const { 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
|
|
37
38
|
const { nTriggerFormChange, nTriggerFormInput } = formItem;
|
|
@@ -59,14 +60,31 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
59
60
|
return index + 1;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
63
|
+
let cleared = false;
|
|
62
64
|
function handleMouseMove(index, e) {
|
|
65
|
+
if (cleared)
|
|
66
|
+
return;
|
|
63
67
|
hoverIndexRef.value = getDerivedValue(index, e);
|
|
64
68
|
}
|
|
65
69
|
function handleMouseLeave() {
|
|
66
70
|
hoverIndexRef.value = null;
|
|
67
71
|
}
|
|
68
72
|
function handleClick(index, e) {
|
|
69
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
const { clearable } = props;
|
|
75
|
+
const derivedValue = getDerivedValue(index, e);
|
|
76
|
+
if (clearable && derivedValue === mergedValue.value) {
|
|
77
|
+
cleared = true;
|
|
78
|
+
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
79
|
+
hoverIndexRef.value = null;
|
|
80
|
+
doUpdateValue(null);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
doUpdateValue(derivedValue);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function handleMouseEnterSomeStar() {
|
|
87
|
+
cleared = false;
|
|
70
88
|
}
|
|
71
89
|
const mergedSizeRef = (0, vue_1.computed)(() => {
|
|
72
90
|
const { size } = props;
|
|
@@ -81,10 +99,11 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
81
99
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
82
100
|
const { common: { cubicBezierEaseInOut }, self } = themeRef.value;
|
|
83
101
|
const { itemColor, itemColorActive } = self;
|
|
102
|
+
const { color } = props;
|
|
84
103
|
return {
|
|
85
104
|
'--n-bezier': cubicBezierEaseInOut,
|
|
86
105
|
'--n-item-color': itemColor,
|
|
87
|
-
'--n-item-color-active':
|
|
106
|
+
'--n-item-color-active': color || itemColorActive,
|
|
88
107
|
'--n-item-size': mergedSizeRef.value
|
|
89
108
|
};
|
|
90
109
|
});
|
|
@@ -104,11 +123,12 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
104
123
|
: undefined;
|
|
105
124
|
return {
|
|
106
125
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
107
|
-
mergedValue
|
|
126
|
+
mergedValue,
|
|
108
127
|
hoverIndex: hoverIndexRef,
|
|
109
128
|
handleMouseMove,
|
|
110
129
|
handleClick,
|
|
111
130
|
handleMouseLeave,
|
|
131
|
+
handleMouseEnterSomeStar,
|
|
112
132
|
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
113
133
|
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
114
134
|
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
@@ -125,17 +145,17 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
125
145
|
this.themeClass
|
|
126
146
|
], style: this.cssVars, onMouseleave: this.handleMouseLeave }, (0, vue_1.renderList)(this.count, (_, index) => {
|
|
127
147
|
const icon = defaultSlot ? (defaultSlot()) : ((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: mergedClsPrefix }, { default: () => StarIcon_1.default }));
|
|
128
|
-
const
|
|
148
|
+
const entireStarActive = hoverIndex !== null
|
|
129
149
|
? index + 1 <= hoverIndex
|
|
130
|
-
: index + 1 <= mergedValue;
|
|
150
|
+
: index + 1 <= (mergedValue || 0);
|
|
131
151
|
return ((0, vue_1.h)("div", { key: index, class: [
|
|
132
152
|
`${mergedClsPrefix}-rate__item`,
|
|
133
|
-
|
|
153
|
+
entireStarActive && `${mergedClsPrefix}-rate__item--active`
|
|
134
154
|
], onClick: readonly
|
|
135
155
|
? undefined
|
|
136
156
|
: (e) => {
|
|
137
157
|
this.handleClick(index, e);
|
|
138
|
-
}, onMousemove: readonly
|
|
158
|
+
}, onMouseenter: this.handleMouseEnterSomeStar, onMousemove: readonly
|
|
139
159
|
? undefined
|
|
140
160
|
: (e) => {
|
|
141
161
|
this.handleMouseMove(index, e);
|
|
@@ -144,9 +164,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
144
164
|
this.allowHalf ? ((0, vue_1.h)("div", { class: [
|
|
145
165
|
`${mergedClsPrefix}-rate__half`,
|
|
146
166
|
{
|
|
147
|
-
[`${mergedClsPrefix}-rate__half--active`]: !
|
|
167
|
+
[`${mergedClsPrefix}-rate__half--active`]: !entireStarActive && hoverIndex !== null
|
|
148
168
|
? index + 0.5 <= hoverIndex
|
|
149
|
-
: index + 0.5 <= mergedValue
|
|
169
|
+
: index + 0.5 <= (mergedValue || 0)
|
|
150
170
|
}
|
|
151
171
|
] }, icon)) : null));
|
|
152
172
|
})));
|
|
@@ -26,17 +26,17 @@ exports.default = (0, cssr_1.cB)('rate', {
|
|
|
26
26
|
transform: scale(1);
|
|
27
27
|
font-size: var(--n-item-size);
|
|
28
28
|
color: var(--n-item-color);
|
|
29
|
-
`, [(0, cssr_1.c)('&:not(:first-child)',
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
`, [(0, cssr_1.c)('&:not(:first-child)', `
|
|
30
|
+
margin-left: 6px;
|
|
31
|
+
`), (0, cssr_1.cM)('active', `
|
|
32
|
+
color: var(--n-item-color-active);
|
|
33
|
+
`)]), (0, cssr_1.cNotM)('readonly', `
|
|
34
34
|
cursor: pointer;
|
|
35
|
-
`, [(0, cssr_1.cE)('item', [(0, cssr_1.c)('&:hover',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
`, [(0, cssr_1.cE)('item', [(0, cssr_1.c)('&:hover', `
|
|
36
|
+
transform: scale(1.05);
|
|
37
|
+
`), (0, cssr_1.c)('&:active', `
|
|
38
|
+
transform: scale(0.96);
|
|
39
|
+
`)])]), (0, cssr_1.cE)('half', `
|
|
40
40
|
display: flex;
|
|
41
41
|
transition: inherit;
|
|
42
42
|
position: absolute;
|
|
@@ -46,6 +46,6 @@ exports.default = (0, cssr_1.cB)('rate', {
|
|
|
46
46
|
width: 50%;
|
|
47
47
|
overflow: hidden;
|
|
48
48
|
color: rgba(255, 255, 255, 0);
|
|
49
|
-
`, [(0, cssr_1.cM)('active',
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
`, [(0, cssr_1.cM)('active', `
|
|
50
|
+
color: var(--n-item-color-active);
|
|
51
|
+
`)])]);
|
|
@@ -21,6 +21,10 @@ export declare const sliderProps: {
|
|
|
21
21
|
readonly default: undefined;
|
|
22
22
|
};
|
|
23
23
|
readonly formatTooltip: PropType<(value: number) => string | number>;
|
|
24
|
+
readonly keyboard: {
|
|
25
|
+
readonly type: BooleanConstructor;
|
|
26
|
+
readonly default: true;
|
|
27
|
+
};
|
|
24
28
|
readonly min: {
|
|
25
29
|
readonly type: NumberConstructor;
|
|
26
30
|
readonly default: 0;
|
|
@@ -152,6 +156,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
152
156
|
readonly default: undefined;
|
|
153
157
|
};
|
|
154
158
|
readonly formatTooltip: PropType<(value: number) => string | number>;
|
|
159
|
+
readonly keyboard: {
|
|
160
|
+
readonly type: BooleanConstructor;
|
|
161
|
+
readonly default: true;
|
|
162
|
+
};
|
|
155
163
|
readonly min: {
|
|
156
164
|
readonly type: NumberConstructor;
|
|
157
165
|
readonly default: 0;
|
|
@@ -357,6 +365,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
357
365
|
readonly default: undefined;
|
|
358
366
|
};
|
|
359
367
|
readonly formatTooltip: PropType<(value: number) => string | number>;
|
|
368
|
+
readonly keyboard: {
|
|
369
|
+
readonly type: BooleanConstructor;
|
|
370
|
+
readonly default: true;
|
|
371
|
+
};
|
|
360
372
|
readonly min: {
|
|
361
373
|
readonly type: NumberConstructor;
|
|
362
374
|
readonly default: 0;
|
|
@@ -482,6 +494,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
482
494
|
readonly min: number;
|
|
483
495
|
readonly to: string | boolean | HTMLElement;
|
|
484
496
|
readonly defaultValue: number | number[];
|
|
497
|
+
readonly keyboard: boolean;
|
|
485
498
|
readonly showTooltip: boolean | undefined;
|
|
486
499
|
}>;
|
|
487
500
|
export default _default;
|
package/lib/slider/src/Slider.js
CHANGED
|
@@ -21,7 +21,10 @@ exports.sliderProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props),
|
|
|
21
21
|
}, marks: Object, disabled: {
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: undefined
|
|
24
|
-
}, formatTooltip: Function,
|
|
24
|
+
}, formatTooltip: Function, keyboard: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
27
|
+
}, min: {
|
|
25
28
|
type: Number,
|
|
26
29
|
default: 0
|
|
27
30
|
}, max: {
|
|
@@ -262,7 +265,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
262
265
|
return Number(newValue.toFixed(precisionRef.value));
|
|
263
266
|
}
|
|
264
267
|
function getClosestMark(currentValue, markValues = markValuesRef.value, buffer) {
|
|
265
|
-
if (!markValues ||
|
|
268
|
+
if (!(markValues === null || markValues === void 0 ? void 0 : markValues.length))
|
|
266
269
|
return null;
|
|
267
270
|
let closestMark = null;
|
|
268
271
|
let index = -1;
|
|
@@ -302,7 +305,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
302
305
|
}
|
|
303
306
|
// dom event handle
|
|
304
307
|
function handleRailKeyDown(e) {
|
|
305
|
-
if (mergedDisabledRef.value)
|
|
308
|
+
if (mergedDisabledRef.value || !props.keyboard)
|
|
306
309
|
return;
|
|
307
310
|
const { vertical, reverse } = props;
|
|
308
311
|
switch (e.key) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MaximizeIcon: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MaximizeIcon = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
exports.MaximizeIcon = (0, vue_1.defineComponent)({
|
|
6
|
+
render() {
|
|
7
|
+
return ((0, vue_1.h)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16" },
|
|
8
|
+
(0, vue_1.h)("g", { fill: "none" },
|
|
9
|
+
(0, vue_1.h)("path", { d: "M8.5 2a.5.5 0 0 0 0 1h3.793L3 12.293V8.5a.5.5 0 0 0-1 0v4.9a.6.6 0 0 0 .6.6h4.9a.5.5 0 0 0 0-1H3.707L13 3.707V7.5a.5.5 0 0 0 1 0V2.6a.6.6 0 0 0-.6-.6H8.5z", fill: "currentColor" }))));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MinimizeIcon: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MinimizeIcon = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
exports.MinimizeIcon = (0, vue_1.defineComponent)({
|
|
6
|
+
render() {
|
|
7
|
+
return ((0, vue_1.h)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
|
|
8
|
+
(0, vue_1.h)("path", { d: "M4 18v2h6.586L2 28.582L3.414 30L12 21.414V28h2V18H4z", fill: "currentColor" }),
|
|
9
|
+
(0, vue_1.h)("path", { d: "M30 3.416L28.592 2L20 10.586V4h-2v10h10v-2h-6.586L30 3.416z", fill: "currentColor" })));
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -130,5 +130,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
130
130
|
handleExportClick: () => void;
|
|
131
131
|
handleImportClick: () => void;
|
|
132
132
|
handleInputFileChange: () => void;
|
|
133
|
+
toggleMaximized: () => void;
|
|
134
|
+
isMaximized: import("vue").Ref<{
|
|
135
|
+
valueOf: () => boolean;
|
|
136
|
+
}>;
|
|
133
137
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
134
138
|
export default _default;
|
|
@@ -9,6 +9,7 @@ const popover_1 = require("../../popover");
|
|
|
9
9
|
const collapse_1 = require("../../collapse");
|
|
10
10
|
const input_1 = require("../../input");
|
|
11
11
|
const space_1 = require("../../space");
|
|
12
|
+
const grid_1 = require("../../grid");
|
|
12
13
|
const _mixins_1 = require("../../_mixins");
|
|
13
14
|
const element_1 = require("../../element");
|
|
14
15
|
const divider_1 = require("../../divider");
|
|
@@ -16,6 +17,9 @@ const button_1 = require("../../button");
|
|
|
16
17
|
const color_picker_1 = require("../../color-picker");
|
|
17
18
|
const empty_1 = require("../../empty");
|
|
18
19
|
const _utils_1 = require("../../_utils");
|
|
20
|
+
const icon_1 = require("../../icon");
|
|
21
|
+
const MaximizeIcon_1 = require("./MaximizeIcon");
|
|
22
|
+
const MinimizeIcon_1 = require("./MinimizeIcon");
|
|
19
23
|
const ColorWandIcon = ((0, vue_1.h)("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: '1em', height: '1em', color: 'currentColor' } },
|
|
20
24
|
(0, vue_1.h)("path", { d: "M13.5 1C13.7761 1 14 1.22386 14 1.5V2H14.5C14.7761 2 15 2.22386 15 2.5C15 2.77614 14.7761 3 14.5 3H14V3.5C14 3.77614 13.7761 4 13.5 4C13.2239 4 13 3.77614 13 3.5V3H12.5C12.2239 3 12 2.77614 12 2.5C12 2.22386 12.2239 2 12.5 2H13V1.5C13 1.22386 13.2239 1 13.5 1Z", fill: "currentColor" }),
|
|
21
25
|
(0, vue_1.h)("path", { d: "M3.5 3C3.77615 3 4 3.22386 4 3.5V4H4.5C4.77615 4 5 4.22386 5 4.5C5 4.77614 4.77615 5 4.5 5H4V5.5C4 5.77614 3.77615 6 3.5 6C3.22386 6 3 5.77614 3 5.5V5H2.5C2.22386 5 2 4.77614 2 4.5C2 4.22386 2.22386 4 2.5 4H3V3.5C3 3.22386 3.22386 3 3.5 3Z", fill: "currentColor" }),
|
|
@@ -33,6 +37,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
33
37
|
name: 'ThemeEditor',
|
|
34
38
|
inheritAttrs: false,
|
|
35
39
|
setup() {
|
|
40
|
+
const isMaximized = (0, vue_1.ref)(false);
|
|
36
41
|
const fileInputRef = (0, vue_1.ref)(null);
|
|
37
42
|
const NConfigProvider = (0, vue_1.inject)(context_1.configProviderInjectionKey, null);
|
|
38
43
|
const theme = (0, vue_1.computed)(() => {
|
|
@@ -93,6 +98,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
93
98
|
return;
|
|
94
99
|
fileInput.click();
|
|
95
100
|
}
|
|
101
|
+
function toggleMaximized() {
|
|
102
|
+
isMaximized.value = !isMaximized.value;
|
|
103
|
+
}
|
|
96
104
|
function handleInputFileChange() {
|
|
97
105
|
const { value: fileInput } = fileInputRef;
|
|
98
106
|
if (!fileInput)
|
|
@@ -145,7 +153,9 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
145
153
|
handleClearAllClick,
|
|
146
154
|
handleExportClick,
|
|
147
155
|
handleImportClick,
|
|
148
|
-
handleInputFileChange
|
|
156
|
+
handleInputFileChange,
|
|
157
|
+
toggleMaximized,
|
|
158
|
+
isMaximized
|
|
149
159
|
};
|
|
150
160
|
},
|
|
151
161
|
render() {
|
|
@@ -154,7 +164,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
154
164
|
var _a, _b;
|
|
155
165
|
return [
|
|
156
166
|
(0, vue_1.h)(popover_1.NPopover, { scrollable: true, arrowPointToCenter: true, trigger: "manual", show: this.showPanel, displayDirective: "show", placement: "top-end", style: {
|
|
157
|
-
width: '288px',
|
|
167
|
+
width: this.isMaximized ? 'calc(100vw - 80px)' : '288px',
|
|
158
168
|
height: 'calc(100vh - 200px)',
|
|
159
169
|
padding: 0
|
|
160
170
|
} }, {
|
|
@@ -194,12 +204,20 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
194
204
|
visibility: 'hidden'
|
|
195
205
|
}, onChange: this.handleInputFileChange }),
|
|
196
206
|
(0, vue_1.h)(space_1.NSpace, { vertical: true }, {
|
|
197
|
-
default: () =>
|
|
198
|
-
(0, vue_1.h)("
|
|
207
|
+
default: () => [
|
|
208
|
+
(0, vue_1.h)(space_1.NSpace, { align: "center", justify: "space-between", style: {
|
|
199
209
|
marginBottom: '8px',
|
|
200
210
|
fontSize: '18px',
|
|
201
211
|
fontWeight: 500
|
|
202
|
-
} },
|
|
212
|
+
} }, {
|
|
213
|
+
default: () => ((0, vue_1.h)(vue_1.Fragment, null,
|
|
214
|
+
(0, vue_1.h)("span", null, this.locale.title),
|
|
215
|
+
(0, vue_1.h)(button_1.NButton, { onClick: this.toggleMaximized, secondary: true, circle: true, size: "tiny" }, {
|
|
216
|
+
icon: () => ((0, vue_1.h)(icon_1.NIcon, { component: this.isMaximized
|
|
217
|
+
? MinimizeIcon_1.MinimizeIcon
|
|
218
|
+
: MaximizeIcon_1.MaximizeIcon }))
|
|
219
|
+
})))
|
|
220
|
+
}),
|
|
203
221
|
this.locale.filterCompName,
|
|
204
222
|
(0, vue_1.h)(input_1.NInput, { onChange: () => {
|
|
205
223
|
this.compNamePattern = this.tempCompNamePattern;
|
|
@@ -229,7 +247,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
229
247
|
(0, vue_1.h)(button_1.NButton, { block: true, size: "small", onClick: this.handleExportClick }, {
|
|
230
248
|
default: () => this.locale.export
|
|
231
249
|
})))
|
|
232
|
-
})
|
|
250
|
+
})
|
|
251
|
+
]
|
|
233
252
|
}),
|
|
234
253
|
(0, vue_1.h)(divider_1.NDivider, null),
|
|
235
254
|
(0, vue_1.h)(collapse_1.NCollapse, null, {
|
|
@@ -263,16 +282,20 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
263
282
|
}
|
|
264
283
|
filteredItemsCount += 1;
|
|
265
284
|
return ((0, vue_1.h)(collapse_1.NCollapseItem, { title: themeKey, name: themeKey }, {
|
|
266
|
-
default: () => {
|
|
267
|
-
|
|
268
|
-
|
|
285
|
+
default: () => ((0, vue_1.h)(grid_1.NGrid, { xGap: 32, yGap: 16, responsive: "screen", cols: this.isMaximized
|
|
286
|
+
? '1 xs:1 s:2 m:3 l:4'
|
|
287
|
+
: 1 }, {
|
|
288
|
+
default: () => varKeys.map((varKey) => ((0, vue_1.h)(grid_1.NGi, null, {
|
|
289
|
+
default: () => {
|
|
269
290
|
var _a, _b, _c, _d;
|
|
270
|
-
return
|
|
291
|
+
return ((0, vue_1.h)(vue_1.Fragment, null,
|
|
271
292
|
(0, vue_1.h)("div", { key: `${varKey}Label`, style: {
|
|
272
293
|
wordBreak: 'break-word'
|
|
273
294
|
} }, varKey),
|
|
274
|
-
showColorPicker(varKey) ? ((0, vue_1.h)(color_picker_1.NColorPicker, { key: varKey, modes: ['rgb', 'hex'], value: ((_b = (_a = this
|
|
275
|
-
|
|
295
|
+
showColorPicker(varKey) ? ((0, vue_1.h)(color_picker_1.NColorPicker, { key: varKey, modes: ['rgb', 'hex'], value: ((_b = (_a = this
|
|
296
|
+
.tempOverrides) === null || _a === void 0 ? void 0 : _a[themeKey]) === null || _b === void 0 ? void 0 : _b[varKey]) ||
|
|
297
|
+
componentTheme[varKey], onComplete: this
|
|
298
|
+
.applyTempOverrides, onUpdateValue: (value) => {
|
|
276
299
|
this.setTempOverrides(themeKey, varKey, value);
|
|
277
300
|
} }, {
|
|
278
301
|
action: () => {
|
|
@@ -287,13 +310,14 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
287
310
|
.restore
|
|
288
311
|
}));
|
|
289
312
|
}
|
|
290
|
-
})) : ((0, vue_1.h)(input_1.NInput, { key: varKey, onChange: this
|
|
313
|
+
})) : ((0, vue_1.h)(input_1.NInput, { key: varKey, onChange: this
|
|
314
|
+
.applyTempOverrides, onUpdateValue: (value) => {
|
|
291
315
|
this.setTempOverrides(themeKey, varKey, value);
|
|
292
|
-
}, value: ((_d = (_c = this
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
}))
|
|
296
|
-
}
|
|
316
|
+
}, value: ((_d = (_c = this
|
|
317
|
+
.tempOverrides) === null || _c === void 0 ? void 0 : _c[themeKey]) === null || _d === void 0 ? void 0 : _d[varKey]) || '', placeholder: componentTheme[varKey] }))));
|
|
318
|
+
}
|
|
319
|
+
})))
|
|
320
|
+
}))
|
|
297
321
|
}));
|
|
298
322
|
});
|
|
299
323
|
if (!filteredItemsCount)
|
|
@@ -54,8 +54,8 @@ exports.default = (0, cssr_1.cB)('tree', `
|
|
|
54
54
|
`)]), (0, cssr_1.cNotM)('disabled', [(0, cssr_1.cM)('clickable', [(0, cssr_1.cB)('tree-node-content', `
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
`)])])]), (0, cssr_1.cM)('block-node', [(0, cssr_1.cB)('tree-node-content', `
|
|
57
|
-
flex
|
|
58
|
-
|
|
57
|
+
flex: 1;
|
|
58
|
+
min-width: 0;
|
|
59
59
|
`)]), (0, cssr_1.cNotM)('block-line', [(0, cssr_1.cB)('tree-node', [(0, cssr_1.cNotM)('disabled', [(0, cssr_1.cB)('tree-node-content', [(0, cssr_1.c)('&:hover', {
|
|
60
60
|
backgroundColor: 'var(--n-node-color-hover)'
|
|
61
61
|
})]), (0, cssr_1.cM)('selectable', [(0, cssr_1.cB)('tree-node-content', [(0, cssr_1.c)('&:active', {
|
|
@@ -140,7 +140,8 @@ exports.default = (0, cssr_1.cB)('tree', `
|
|
|
140
140
|
`), (0, cssr_1.cE)('text', `
|
|
141
141
|
border-bottom: 1px solid #0000;
|
|
142
142
|
transition: border-color .3s var(--n-bezier);
|
|
143
|
-
flex-grow:1;
|
|
143
|
+
flex-grow: 1;
|
|
144
|
+
max-width: 100%;
|
|
144
145
|
`), (0, cssr_1.cE)('suffix', `
|
|
145
146
|
display: inline-flex;
|
|
146
147
|
`)]), (0, cssr_1.cE)('empty', 'margin: auto;')]);
|
|
@@ -95,7 +95,7 @@ export interface UploadInst {
|
|
|
95
95
|
export declare type OnBeforeUpload = (data: {
|
|
96
96
|
file: SettledFileInfo;
|
|
97
97
|
fileList: SettledFileInfo[];
|
|
98
|
-
}) => Promise<
|
|
98
|
+
}) => Promise<boolean | void> | boolean | void;
|
|
99
99
|
export declare type ListType = 'text' | 'image' | 'image-card';
|
|
100
100
|
export declare type OnPreview = (file: SettledFileInfo) => void;
|
|
101
101
|
export declare type CreateThumbnailUrl = (file: File) => Promise<string>;
|