naive-ui 2.25.1 → 2.25.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/es/_internal/select-menu/src/SelectMenu.d.ts +6 -1
- package/es/_internal/select-menu/src/SelectMenu.js +17 -8
- package/es/_internal/selection/src/Selection.d.ts +31 -26
- package/es/_internal/selection/src/Selection.js +78 -80
- package/es/_internal/selection/styles/dark.js +3 -3
- package/es/_internal/selection/styles/light.d.ts +6 -6
- package/es/_internal/selection/styles/light.js +3 -3
- package/es/_mixins/index.d.ts +1 -1
- package/es/_mixins/index.js +1 -1
- package/es/_mixins/use-css-vars-class.d.ts +9 -2
- package/es/_mixins/use-css-vars-class.js +29 -13
- package/es/_mixins/use-form-item.d.ts +1 -1
- package/es/_utils/css/color-to-class.d.ts +1 -0
- package/es/_utils/css/color-to-class.js +3 -0
- package/es/_utils/css/format-length.d.ts +2 -2
- package/es/_utils/css/format-length.js +1 -2
- package/es/_utils/css/index.d.ts +2 -1
- package/es/_utils/css/index.js +2 -1
- package/es/_utils/index.d.ts +1 -1
- package/es/_utils/index.js +1 -1
- package/es/_utils/vue/resolve-slot.js +0 -1
- package/es/alert/src/Alert.d.ts +4 -4
- package/es/auto-complete/src/AutoComplete.d.ts +1 -1
- package/es/badge/src/Badge.d.ts +4 -4
- package/es/button/src/Button.d.ts +3 -2
- package/es/button/src/Button.js +13 -24
- package/es/button/styles/index.d.ts +1 -1
- package/es/button/styles/index.js +1 -1
- package/es/button/styles/rtl.d.ts +2 -5
- package/es/button/styles/rtl.js +1 -1
- package/es/card/src/Card.d.ts +3 -1
- package/es/card/src/Card.js +41 -38
- package/es/card/styles/index.d.ts +1 -1
- package/es/card/styles/index.js +1 -1
- package/es/card/styles/rtl.d.ts +2 -5
- package/es/card/styles/rtl.js +1 -1
- package/es/cascader/src/Cascader.d.ts +30 -30
- package/es/cascader/src/CascaderMenu.d.ts +3 -3
- package/es/cascader/src/CascaderOption.d.ts +3 -3
- package/es/cascader/src/CascaderSelectMenu.d.ts +3 -3
- package/es/cascader/src/CascaderSubmenu.d.ts +3 -3
- package/es/cascader/styles/light.d.ts +3 -3
- package/es/checkbox/src/styles/index.cssr.js +12 -12
- package/es/data-table/src/DataTable.d.ts +34 -34
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +6 -6
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -6
- package/es/data-table/src/TableParts/Body.d.ts +6 -6
- package/es/data-table/src/TableParts/Cell.d.ts +12 -12
- package/es/data-table/src/TableParts/Header.d.ts +6 -6
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/descriptions/src/Descriptions.d.ts +1 -1
- package/es/dialog/src/Dialog.d.ts +4 -4
- package/es/dialog/src/DialogEnvironment.d.ts +5 -5
- package/es/dialog/src/DialogProvider.d.ts +2 -2
- package/es/dialog/src/dialogProps.d.ts +2 -2
- package/es/dynamic-tags/src/DynamicTags.d.ts +4 -4
- package/es/form/src/FormItem.d.ts +4 -4
- package/es/form/src/FormItemCol.d.ts +3 -3
- package/es/form/src/FormItemGridItem.d.ts +5 -5
- package/es/form/src/FormItemRow.d.ts +3 -3
- package/es/form/src/utils.d.ts +1 -1
- package/es/gradient-text/src/GradientText.d.ts +5 -5
- package/es/icon-wrapper/src/IconWrapper.js +7 -5
- package/es/image/src/Image.d.ts +1 -1
- package/es/input/src/Input.d.ts +1 -1
- package/es/input-number/src/InputNumber.d.ts +1 -1
- package/es/locales/common/eo.d.ts +109 -0
- package/es/locales/common/eo.js +109 -0
- package/es/locales/common/plPL.d.ts +3 -0
- package/es/locales/common/plPL.js +109 -0
- package/es/locales/date/eo.d.ts +3 -0
- package/es/locales/date/eo.js +6 -0
- package/es/locales/date/plPL.d.ts +3 -0
- package/es/locales/date/plPL.js +6 -0
- package/es/locales/index.d.ts +4 -0
- package/es/locales/index.js +4 -0
- package/es/mention/src/Mention.d.ts +1 -1
- package/es/menu/src/Menu.d.ts +1 -1
- package/es/modal/src/BodyWrapper.d.ts +6 -6
- package/es/modal/src/Modal.d.ts +8 -8
- package/es/modal/src/presetProps.d.ts +2 -2
- package/es/notification/src/Notification.d.ts +4 -4
- package/es/notification/src/NotificationEnvironment.d.ts +4 -4
- package/es/notification/src/NotificationProvider.d.ts +1 -1
- package/es/pagination/src/Pagination.d.ts +33 -33
- package/es/pagination/styles/light.d.ts +3 -3
- package/es/progress/src/Circle.d.ts +19 -3
- package/es/progress/src/Circle.js +41 -22
- package/es/progress/src/Progress.d.ts +14 -5
- package/es/progress/src/Progress.js +43 -29
- package/es/progress/src/styles/index.cssr.js +1 -1
- package/es/result/src/Result.d.ts +4 -4
- package/es/select/src/Select.d.ts +45 -31
- package/es/select/src/Select.js +13 -8
- package/es/select/styles/light.d.ts +3 -3
- package/es/tag/src/Tag.d.ts +7 -5
- package/es/tag/src/Tag.js +60 -40
- package/es/tag/src/common-props.d.ts +1 -1
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/tag/styles/index.d.ts +1 -1
- package/es/tag/styles/index.js +1 -1
- package/es/tag/styles/rtl.d.ts +2 -5
- package/es/tag/styles/rtl.js +1 -1
- package/es/timeline/src/TimelineItem.d.ts +4 -4
- package/es/tree/src/utils.js +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +30 -30
- package/es/tree-select/styles/light.d.ts +3 -3
- package/es/typography/src/create-header.d.ts +4 -4
- package/es/typography/src/headers.d.ts +18 -18
- package/es/upload/src/UploadFile.d.ts +1 -1
- package/es/upload/src/UploadProgress.d.ts +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +6 -1
- package/lib/_internal/select-menu/src/SelectMenu.js +16 -7
- package/lib/_internal/selection/src/Selection.d.ts +31 -26
- package/lib/_internal/selection/src/Selection.js +77 -79
- package/lib/_internal/selection/styles/dark.js +3 -3
- package/lib/_internal/selection/styles/light.d.ts +6 -6
- package/lib/_internal/selection/styles/light.js +3 -3
- package/lib/_mixins/index.d.ts +1 -1
- package/lib/_mixins/index.js +3 -2
- package/lib/_mixins/use-css-vars-class.d.ts +9 -2
- package/lib/_mixins/use-css-vars-class.js +31 -15
- package/lib/_mixins/use-form-item.d.ts +1 -1
- package/lib/_utils/css/color-to-class.d.ts +1 -0
- package/lib/_utils/css/color-to-class.js +7 -0
- package/lib/_utils/css/format-length.d.ts +2 -2
- package/lib/_utils/css/format-length.js +2 -1
- package/lib/_utils/css/index.d.ts +2 -1
- package/lib/_utils/css/index.js +4 -5
- package/lib/_utils/index.d.ts +1 -1
- package/lib/_utils/index.js +2 -1
- package/lib/_utils/vue/resolve-slot.js +0 -1
- package/lib/alert/src/Alert.d.ts +4 -4
- package/lib/auto-complete/src/AutoComplete.d.ts +1 -1
- package/lib/badge/src/Badge.d.ts +4 -4
- package/lib/button/src/Button.d.ts +3 -2
- package/lib/button/src/Button.js +11 -22
- package/lib/button/styles/index.d.ts +1 -1
- package/lib/button/styles/index.js +1 -1
- package/lib/button/styles/rtl.d.ts +2 -5
- package/lib/button/styles/rtl.js +2 -1
- package/lib/card/src/Card.d.ts +3 -1
- package/lib/card/src/Card.js +40 -37
- package/lib/card/styles/index.d.ts +1 -1
- package/lib/card/styles/index.js +1 -1
- package/lib/card/styles/rtl.d.ts +2 -5
- package/lib/card/styles/rtl.js +2 -1
- package/lib/cascader/src/Cascader.d.ts +30 -30
- package/lib/cascader/src/CascaderMenu.d.ts +3 -3
- package/lib/cascader/src/CascaderOption.d.ts +3 -3
- package/lib/cascader/src/CascaderSelectMenu.d.ts +3 -3
- package/lib/cascader/src/CascaderSubmenu.d.ts +3 -3
- package/lib/cascader/styles/light.d.ts +3 -3
- package/lib/checkbox/src/styles/index.cssr.js +12 -12
- package/lib/data-table/src/DataTable.d.ts +34 -34
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +6 -6
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -6
- package/lib/data-table/src/TableParts/Body.d.ts +6 -6
- package/lib/data-table/src/TableParts/Cell.d.ts +12 -12
- package/lib/data-table/src/TableParts/Header.d.ts +6 -6
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/descriptions/src/Descriptions.d.ts +1 -1
- package/lib/dialog/src/Dialog.d.ts +4 -4
- package/lib/dialog/src/DialogEnvironment.d.ts +5 -5
- package/lib/dialog/src/DialogProvider.d.ts +2 -2
- package/lib/dialog/src/dialogProps.d.ts +2 -2
- package/lib/dynamic-tags/src/DynamicTags.d.ts +4 -4
- package/lib/form/src/FormItem.d.ts +4 -4
- package/lib/form/src/FormItemCol.d.ts +3 -3
- package/lib/form/src/FormItemGridItem.d.ts +5 -5
- package/lib/form/src/FormItemRow.d.ts +3 -3
- package/lib/form/src/utils.d.ts +1 -1
- package/lib/gradient-text/src/GradientText.d.ts +5 -5
- package/lib/icon-wrapper/src/IconWrapper.js +6 -4
- package/lib/image/src/Image.d.ts +1 -1
- package/lib/input/src/Input.d.ts +1 -1
- package/lib/input-number/src/InputNumber.d.ts +1 -1
- package/lib/locales/common/eo.d.ts +109 -0
- package/lib/locales/common/eo.js +111 -0
- package/lib/locales/common/plPL.d.ts +3 -0
- package/lib/locales/common/plPL.js +111 -0
- package/lib/locales/date/eo.d.ts +3 -0
- package/lib/locales/date/eo.js +11 -0
- package/lib/locales/date/plPL.d.ts +3 -0
- package/lib/locales/date/plPL.js +11 -0
- package/lib/locales/index.d.ts +4 -0
- package/lib/locales/index.js +9 -1
- package/lib/mention/src/Mention.d.ts +1 -1
- package/lib/menu/src/Menu.d.ts +1 -1
- package/lib/modal/src/BodyWrapper.d.ts +6 -6
- package/lib/modal/src/Modal.d.ts +8 -8
- package/lib/modal/src/presetProps.d.ts +2 -2
- package/lib/notification/src/Notification.d.ts +4 -4
- package/lib/notification/src/NotificationEnvironment.d.ts +4 -4
- package/lib/notification/src/NotificationProvider.d.ts +1 -1
- package/lib/pagination/src/Pagination.d.ts +33 -33
- package/lib/pagination/styles/light.d.ts +3 -3
- package/lib/progress/src/Circle.d.ts +19 -3
- package/lib/progress/src/Circle.js +40 -21
- package/lib/progress/src/Progress.d.ts +14 -5
- package/lib/progress/src/Progress.js +42 -28
- package/lib/progress/src/styles/index.cssr.js +1 -1
- package/lib/result/src/Result.d.ts +4 -4
- package/lib/select/src/Select.d.ts +45 -31
- package/lib/select/src/Select.js +13 -8
- package/lib/select/styles/light.d.ts +3 -3
- package/lib/tag/src/Tag.d.ts +7 -5
- package/lib/tag/src/Tag.js +58 -38
- package/lib/tag/src/common-props.d.ts +1 -1
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/tag/styles/index.d.ts +1 -1
- package/lib/tag/styles/index.js +1 -1
- package/lib/tag/styles/rtl.d.ts +2 -5
- package/lib/tag/styles/rtl.js +2 -1
- package/lib/timeline/src/TimelineItem.d.ts +4 -4
- package/lib/tree/src/utils.js +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +30 -30
- package/lib/tree-select/styles/light.d.ts +3 -3
- package/lib/typography/src/create-header.d.ts +4 -4
- package/lib/typography/src/headers.d.ts +18 -18
- package/lib/upload/src/UploadFile.d.ts +1 -1
- package/lib/upload/src/UploadProgress.d.ts +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
- package/web-types.json +28 -1
|
@@ -17,19 +17,19 @@ const self = (vars) => {
|
|
|
17
17
|
// default
|
|
18
18
|
textColor: textColor2, textColorDisabled,
|
|
19
19
|
placeholderColor,
|
|
20
|
-
placeholderColorDisabled, color: inputColor, colorDisabled: inputColorDisabled, colorActive: inputColor, border: `1px solid ${borderColor}`, borderHover: `1px solid ${primaryColorHover}`, borderActive: `1px solid ${primaryColor}`, borderFocus: `1px solid ${primaryColorHover}`, boxShadowHover:
|
|
20
|
+
placeholderColorDisabled, color: inputColor, colorDisabled: inputColorDisabled, colorActive: inputColor, border: `1px solid ${borderColor}`, borderHover: `1px solid ${primaryColorHover}`, borderActive: `1px solid ${primaryColor}`, borderFocus: `1px solid ${primaryColorHover}`, boxShadowHover: 'none', boxShadowActive: `0 0 0 2px ${changeColor(primaryColor, {
|
|
21
21
|
alpha: 0.2
|
|
22
22
|
})}`, boxShadowFocus: `0 0 0 2px ${changeColor(primaryColor, {
|
|
23
23
|
alpha: 0.2
|
|
24
24
|
})}`, caretColor: primaryColor, arrowColor: iconColor, arrowColorDisabled: iconColorDisabled, loadingColor: primaryColor,
|
|
25
25
|
// warning
|
|
26
|
-
borderWarning: `1px solid ${warningColor}`, borderHoverWarning: `1px solid ${warningColorHover}`, borderActiveWarning: `1px solid ${warningColor}`, borderFocusWarning: `1px solid ${warningColorHover}`, boxShadowHoverWarning:
|
|
26
|
+
borderWarning: `1px solid ${warningColor}`, borderHoverWarning: `1px solid ${warningColorHover}`, borderActiveWarning: `1px solid ${warningColor}`, borderFocusWarning: `1px solid ${warningColorHover}`, boxShadowHoverWarning: 'none', boxShadowActiveWarning: `0 0 0 2px ${changeColor(warningColor, {
|
|
27
27
|
alpha: 0.2
|
|
28
28
|
})}`, boxShadowFocusWarning: `0 0 0 2px ${changeColor(warningColor, {
|
|
29
29
|
alpha: 0.2
|
|
30
30
|
})}`, colorActiveWarning: inputColor, caretColorWarning: warningColor,
|
|
31
31
|
// error
|
|
32
|
-
borderError: `1px solid ${errorColor}`, borderHoverError: `1px solid ${errorColorHover}`, borderActiveError: `1px solid ${errorColor}`, borderFocusError: `1px solid ${errorColorHover}`, boxShadowHoverError:
|
|
32
|
+
borderError: `1px solid ${errorColor}`, borderHoverError: `1px solid ${errorColorHover}`, borderActiveError: `1px solid ${errorColor}`, borderFocusError: `1px solid ${errorColorHover}`, boxShadowHoverError: 'none', boxShadowActiveError: `0 0 0 2px ${changeColor(errorColor, {
|
|
33
33
|
alpha: 0.2
|
|
34
34
|
})}`, boxShadowFocusError: `0 0 0 2px ${changeColor(errorColor, {
|
|
35
35
|
alpha: 0.2
|
package/es/_mixins/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export { default as useLocale } from './use-locale';
|
|
|
6
6
|
export { default as useStyle } from './use-style';
|
|
7
7
|
export { default as useHljs } from './use-hljs';
|
|
8
8
|
export type { Hljs } from './use-hljs';
|
|
9
|
-
export {
|
|
9
|
+
export { useThemeClass, emptyThemeClassHandle } from './use-css-vars-class';
|
package/es/_mixins/index.js
CHANGED
|
@@ -4,4 +4,4 @@ export { default as useConfig, defaultClsPrefix } from './use-config';
|
|
|
4
4
|
export { default as useLocale } from './use-locale';
|
|
5
5
|
export { default as useStyle } from './use-style';
|
|
6
6
|
export { default as useHljs } from './use-hljs';
|
|
7
|
-
export {
|
|
7
|
+
export { useThemeClass, emptyThemeClassHandle } from './use-css-vars-class';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function useThemeClass(componentName: string, hashRef: Ref<string> | undefined, cssVarsRef: ComputedRef<Record<string, string>> | undefined, props: {
|
|
3
3
|
themeOverrides?: unknown;
|
|
4
|
-
}):
|
|
4
|
+
}): {
|
|
5
|
+
themeClass: Ref<string>;
|
|
6
|
+
onRender: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const emptyThemeClassHandle: {
|
|
9
|
+
themeClass?: Ref<string>;
|
|
10
|
+
onRender?: () => void;
|
|
11
|
+
};
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { ref, inject, watchEffect } from 'vue';
|
|
2
2
|
import { hash } from 'css-render';
|
|
3
|
+
import { useSsrAdapter } from '@css-render/vue3-ssr';
|
|
3
4
|
import { configProviderInjectionKey } from '../config-provider/src/context';
|
|
4
5
|
import { throwError } from '../_utils';
|
|
5
6
|
import { c } from '../_utils/cssr';
|
|
6
|
-
export function
|
|
7
|
+
export function useThemeClass(componentName, hashRef, cssVarsRef, props) {
|
|
7
8
|
var _a;
|
|
8
9
|
if (!cssVarsRef)
|
|
9
|
-
throwError('
|
|
10
|
+
throwError('useThemeClass', 'cssVarsRef is not passed');
|
|
10
11
|
const mergedThemeHashRef = (_a = inject(configProviderInjectionKey, null)) === null || _a === void 0 ? void 0 : _a.mergedThemeHashRef;
|
|
11
|
-
const
|
|
12
|
+
const themeClassRef = ref('');
|
|
13
|
+
const ssrAdapter = useSsrAdapter();
|
|
14
|
+
let renderCallback;
|
|
12
15
|
const mountStyle = () => {
|
|
13
|
-
const cssVars = cssVarsRef.value;
|
|
14
|
-
let style = '';
|
|
15
|
-
for (const key in cssVars) {
|
|
16
|
-
style += `${key}: ${cssVars[key]};`;
|
|
17
|
-
}
|
|
18
16
|
let finalThemeHash = componentName;
|
|
19
17
|
const hashValue = hashRef ? hashRef.value : undefined;
|
|
20
18
|
const themeHash = mergedThemeHashRef === null || mergedThemeHashRef === void 0 ? void 0 : mergedThemeHashRef.value;
|
|
@@ -25,13 +23,31 @@ export function useCssVarsClass(componentName, hashRef, cssVarsRef, props) {
|
|
|
25
23
|
if (props.themeOverrides) {
|
|
26
24
|
finalThemeHash += '-' + hash(JSON.stringify(props.themeOverrides));
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
themeClassRef.value = finalThemeHash;
|
|
27
|
+
renderCallback = () => {
|
|
28
|
+
const cssVars = cssVarsRef.value;
|
|
29
|
+
let style = '';
|
|
30
|
+
for (const key in cssVars) {
|
|
31
|
+
style += `${key}: ${cssVars[key]};`;
|
|
32
|
+
}
|
|
33
|
+
c(`.${finalThemeHash}`, style).mount({
|
|
34
|
+
id: finalThemeHash,
|
|
35
|
+
ssr: ssrAdapter
|
|
36
|
+
});
|
|
37
|
+
renderCallback = undefined;
|
|
38
|
+
};
|
|
32
39
|
};
|
|
33
40
|
watchEffect(() => {
|
|
34
41
|
mountStyle();
|
|
35
42
|
});
|
|
36
|
-
return
|
|
43
|
+
return {
|
|
44
|
+
themeClass: themeClassRef,
|
|
45
|
+
onRender: () => {
|
|
46
|
+
renderCallback === null || renderCallback === void 0 ? void 0 : renderCallback();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
37
49
|
}
|
|
50
|
+
export const emptyThemeClassHandle = {
|
|
51
|
+
themeClass: undefined,
|
|
52
|
+
onRender: undefined
|
|
53
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
|
2
|
-
import { FormValidationStatus } from '../form/src/interface';
|
|
2
|
+
import type { FormValidationStatus } from '../form/src/interface';
|
|
3
3
|
declare type FormItemSize = 'small' | 'medium' | 'large';
|
|
4
4
|
declare type AllowedSize = 'tiny' | 'small' | 'medium' | 'large' | 'huge' | number;
|
|
5
5
|
export interface FormItemInjection {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function color2Class(color: string): string;
|
|
@@ -3,5 +3,5 @@ interface FormatLengthOptions {
|
|
|
3
3
|
offset?: number;
|
|
4
4
|
attachPx?: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare function formatLength<T extends number | string | null | undefined | any>(length: T, { c, offset, attachPx }?: FormatLengthOptions): T extends null ? null : T extends undefined ? undefined : T extends string | number ? string : T;
|
|
7
|
-
export
|
|
6
|
+
export declare function formatLength<T extends number | string | null | undefined | any>(length: T, { c, offset, attachPx }?: FormatLengthOptions): T extends null ? null : T extends undefined ? undefined : T extends string | number ? string : T;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const pureNumberRegex = /^(\d|\.)+$/;
|
|
2
2
|
const numberRegex = /(\d|\.)+/;
|
|
3
|
-
function formatLength(length, { c = 1, offset = 0, attachPx = true } = {}) {
|
|
3
|
+
export function formatLength(length, { c = 1, offset = 0, attachPx = true } = {}) {
|
|
4
4
|
if (typeof length === 'number') {
|
|
5
5
|
const result = (length + offset) * c;
|
|
6
6
|
if (result === 0)
|
|
@@ -28,4 +28,3 @@ function formatLength(length, { c = 1, offset = 0, attachPx = true } = {}) {
|
|
|
28
28
|
}
|
|
29
29
|
return length;
|
|
30
30
|
}
|
|
31
|
-
export default formatLength;
|
package/es/_utils/css/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { formatLength } from './format-length';
|
|
2
|
+
export { color2Class } from './color-to-class';
|
package/es/_utils/css/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { formatLength } from './format-length';
|
|
2
|
+
export { color2Class } from './color-to-class';
|
package/es/_utils/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { call, keep, omit, flatten, getSlot, getVNodeChildren, keysOf, render, g
|
|
|
2
2
|
export type { MaybeArray } from './vue';
|
|
3
3
|
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute } from './naive';
|
|
4
4
|
export type { ExtractPublicPropTypes, ExtractInternalPropTypes, Mutable } from './naive';
|
|
5
|
-
export { formatLength } from './css';
|
|
5
|
+
export { formatLength, color2Class } from './css';
|
|
6
6
|
export { createKey } from './cssr';
|
|
7
7
|
export * from './composable';
|
package/es/_utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { call, keep, omit, flatten, getSlot, getVNodeChildren, keysOf, render, getFirstSlotVNode, createDataKey, createRefSetter, createInjectionKey, resolveSlot, resolveSlotWithProps, resolveWrappedSlot, isSlotEmpty } from './vue';
|
|
2
2
|
export { warn, warnOnce, throwError, smallerSize, largerSize, getTitleAttribute } from './naive';
|
|
3
|
-
export { formatLength } from './css';
|
|
3
|
+
export { formatLength, color2Class } from './css';
|
|
4
4
|
export { createKey } from './cssr';
|
|
5
5
|
export * from './composable';
|
|
@@ -23,7 +23,6 @@ export function resolveSlot(slot, fallback) {
|
|
|
23
23
|
return (slot && ensureValidVNode(slot())) || fallback();
|
|
24
24
|
}
|
|
25
25
|
export function resolveSlotWithProps(slot, props, fallback) {
|
|
26
|
-
console.log(slot && ensureValidVNode(slot(props)));
|
|
27
26
|
return (slot && ensureValidVNode(slot(props))) || fallback(props);
|
|
28
27
|
}
|
|
29
28
|
export function resolveWrappedSlot(slot, wrapper) {
|
package/es/alert/src/Alert.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare const alertProps: {
|
|
|
10
10
|
default: boolean;
|
|
11
11
|
};
|
|
12
12
|
type: {
|
|
13
|
-
type: PropType<"default" | "
|
|
13
|
+
type: PropType<"default" | "error" | "info" | "success" | "warning">;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
16
|
closable: {
|
|
@@ -192,7 +192,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
192
192
|
default: boolean;
|
|
193
193
|
};
|
|
194
194
|
type: {
|
|
195
|
-
type: PropType<"default" | "
|
|
195
|
+
type: PropType<"default" | "error" | "info" | "success" | "warning">;
|
|
196
196
|
default: string;
|
|
197
197
|
};
|
|
198
198
|
closable: {
|
|
@@ -559,7 +559,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
559
559
|
default: boolean;
|
|
560
560
|
};
|
|
561
561
|
type: {
|
|
562
|
-
type: PropType<"default" | "
|
|
562
|
+
type: PropType<"default" | "error" | "info" | "success" | "warning">;
|
|
563
563
|
default: string;
|
|
564
564
|
};
|
|
565
565
|
closable: {
|
|
@@ -730,7 +730,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
730
730
|
padding: string;
|
|
731
731
|
}, any>>>;
|
|
732
732
|
}>>, {
|
|
733
|
-
type: "default" | "
|
|
733
|
+
type: "default" | "error" | "info" | "success" | "warning";
|
|
734
734
|
onAfterLeave: Function;
|
|
735
735
|
title: string;
|
|
736
736
|
showIcon: boolean;
|
|
@@ -1486,8 +1486,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1486
1486
|
disabled: boolean | undefined;
|
|
1487
1487
|
to: string | boolean | HTMLElement;
|
|
1488
1488
|
options: AutoCompleteOptions;
|
|
1489
|
-
bordered: boolean | undefined;
|
|
1490
1489
|
loading: boolean;
|
|
1490
|
+
bordered: boolean | undefined;
|
|
1491
1491
|
placement: FollowerPlacement;
|
|
1492
1492
|
clearable: boolean;
|
|
1493
1493
|
defaultValue: string | null;
|
package/es/badge/src/Badge.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare const badgeProps: {
|
|
|
8
8
|
readonly default: false;
|
|
9
9
|
};
|
|
10
10
|
readonly type: {
|
|
11
|
-
readonly type: PropType<"default" | "
|
|
11
|
+
readonly type: PropType<"default" | "error" | "info" | "success" | "warning">;
|
|
12
12
|
readonly default: "default";
|
|
13
13
|
};
|
|
14
14
|
readonly show: {
|
|
@@ -61,7 +61,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
61
|
readonly default: false;
|
|
62
62
|
};
|
|
63
63
|
readonly type: {
|
|
64
|
-
readonly type: PropType<"default" | "
|
|
64
|
+
readonly type: PropType<"default" | "error" | "info" | "success" | "warning">;
|
|
65
65
|
readonly default: "default";
|
|
66
66
|
};
|
|
67
67
|
readonly show: {
|
|
@@ -126,7 +126,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
126
126
|
readonly default: false;
|
|
127
127
|
};
|
|
128
128
|
readonly type: {
|
|
129
|
-
readonly type: PropType<"default" | "
|
|
129
|
+
readonly type: PropType<"default" | "error" | "info" | "success" | "warning">;
|
|
130
130
|
readonly default: "default";
|
|
131
131
|
};
|
|
132
132
|
readonly show: {
|
|
@@ -170,7 +170,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
170
170
|
fontFamily: string;
|
|
171
171
|
}, any>>>;
|
|
172
172
|
}>>, {
|
|
173
|
-
type: "default" | "
|
|
173
|
+
type: "default" | "error" | "info" | "success" | "warning";
|
|
174
174
|
show: boolean;
|
|
175
175
|
dot: boolean;
|
|
176
176
|
showZero: boolean;
|
|
@@ -1320,6 +1320,8 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1320
1320
|
rippleDuration: string;
|
|
1321
1321
|
}, any>>>;
|
|
1322
1322
|
}, {
|
|
1323
|
+
themeClass?: import("vue").Ref<string> | undefined;
|
|
1324
|
+
onRender?: (() => void) | undefined;
|
|
1323
1325
|
selfElRef: import("vue").Ref<HTMLElement | null>;
|
|
1324
1326
|
waveElRef: import("vue").Ref<{
|
|
1325
1327
|
play: () => void;
|
|
@@ -1342,7 +1344,6 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
1342
1344
|
'--n-border-color-focus': string;
|
|
1343
1345
|
'--n-border-color-disabled': string;
|
|
1344
1346
|
} | null>;
|
|
1345
|
-
themeClass: import("vue").Ref<string> | undefined;
|
|
1346
1347
|
cssVars: import("vue").ComputedRef<{
|
|
1347
1348
|
'--n-width': string;
|
|
1348
1349
|
'--n-height': string;
|
|
@@ -2043,8 +2044,8 @@ declare const Button: import("vue").DefineComponent<{
|
|
|
2043
2044
|
disabled: boolean;
|
|
2044
2045
|
focusable: boolean;
|
|
2045
2046
|
strong: boolean;
|
|
2046
|
-
bordered: boolean;
|
|
2047
2047
|
loading: boolean;
|
|
2048
|
+
bordered: boolean;
|
|
2048
2049
|
tertiary: boolean;
|
|
2049
2050
|
keyboard: boolean;
|
|
2050
2051
|
ghost: boolean;
|
package/es/button/src/Button.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { h, ref, computed, inject, onMounted, defineComponent, watchEffect } from 'vue';
|
|
2
2
|
import { useMemo } from 'vooks';
|
|
3
3
|
import { createHoverColor, createPressedColor } from '../../_utils/color/index';
|
|
4
|
-
import { useConfig, useFormItem, useTheme,
|
|
4
|
+
import { emptyThemeClassHandle, useConfig, useFormItem, useTheme, useThemeClass } from '../../_mixins';
|
|
5
5
|
import { NFadeInExpandTransition, NIconSwitchTransition, NBaseLoading, NBaseWave } from '../../_internal';
|
|
6
|
-
import { call, createKey, warnOnce } from '../../_utils';
|
|
6
|
+
import { call, color2Class, createKey, warnOnce } from '../../_utils';
|
|
7
7
|
import { buttonLight } from '../styles';
|
|
8
8
|
import { buttonGroupInjectionKey } from './ButtonGroup';
|
|
9
9
|
import style from './styles/button.cssr';
|
|
@@ -360,8 +360,8 @@ const Button = defineComponent({
|
|
|
360
360
|
};
|
|
361
361
|
return Object.assign(Object.assign(Object.assign(Object.assign({ '--n-bezier': cubicBezierEaseInOut, '--n-bezier-ease-out': cubicBezierEaseOut, '--n-ripple-duration': rippleDuration, '--n-opacity-disabled': opacityDisabled, '--n-wave-opacity': waveOpacity }, fontProps), colorProps), borderProps), sizeProps);
|
|
362
362
|
});
|
|
363
|
-
const
|
|
364
|
-
?
|
|
363
|
+
const themeClassHandle = disableInlineTheme
|
|
364
|
+
? useThemeClass('button', computed(() => {
|
|
365
365
|
let hash = '';
|
|
366
366
|
const { dashed, type, ghost, text, color, round, circle, textColor, secondary, tertiary, quaternary, strong } = props;
|
|
367
367
|
if (dashed)
|
|
@@ -383,30 +383,21 @@ const Button = defineComponent({
|
|
|
383
383
|
if (strong)
|
|
384
384
|
hash += 'i';
|
|
385
385
|
if (color)
|
|
386
|
-
hash += 'j' + color
|
|
386
|
+
hash += 'j' + color2Class(color);
|
|
387
387
|
if (textColor)
|
|
388
|
-
hash += 'k' + textColor
|
|
388
|
+
hash += 'k' + color2Class(textColor);
|
|
389
389
|
const { value: size } = mergedSizeRef;
|
|
390
390
|
hash += 'l' + size[0];
|
|
391
391
|
hash += 'm' + type[0];
|
|
392
392
|
return hash;
|
|
393
393
|
}), cssVarsRef, props)
|
|
394
|
-
:
|
|
395
|
-
return {
|
|
396
|
-
|
|
397
|
-
waveElRef,
|
|
398
|
-
mergedClsPrefix: mergedClsPrefixRef,
|
|
399
|
-
mergedFocusable: mergedFocusableRef,
|
|
400
|
-
mergedSize: mergedSizeRef,
|
|
401
|
-
showBorder: showBorderRef,
|
|
402
|
-
enterPressed: enterPressedRef,
|
|
403
|
-
rtlEnabled: rtlEnabledRef,
|
|
404
|
-
handleMousedown,
|
|
394
|
+
: emptyThemeClassHandle;
|
|
395
|
+
return Object.assign({ selfElRef,
|
|
396
|
+
waveElRef, mergedClsPrefix: mergedClsPrefixRef, mergedFocusable: mergedFocusableRef, mergedSize: mergedSizeRef, showBorder: showBorderRef, enterPressed: enterPressedRef, rtlEnabled: rtlEnabledRef, handleMousedown,
|
|
405
397
|
handleKeydown,
|
|
406
398
|
handleBlur,
|
|
407
399
|
handleKeyup,
|
|
408
|
-
handleClick,
|
|
409
|
-
customColorCssVars: computed(() => {
|
|
400
|
+
handleClick, customColorCssVars: computed(() => {
|
|
410
401
|
const { color } = props;
|
|
411
402
|
if (!color)
|
|
412
403
|
return null;
|
|
@@ -418,13 +409,11 @@ const Button = defineComponent({
|
|
|
418
409
|
'--n-border-color-focus': hoverColor,
|
|
419
410
|
'--n-border-color-disabled': color
|
|
420
411
|
};
|
|
421
|
-
}),
|
|
422
|
-
themeClass: themeClassRef,
|
|
423
|
-
cssVars: disableInlineTheme ? undefined : cssVarsRef
|
|
424
|
-
};
|
|
412
|
+
}), cssVars: disableInlineTheme ? undefined : cssVarsRef }, themeClassHandle);
|
|
425
413
|
},
|
|
426
414
|
render() {
|
|
427
|
-
const { $slots, mergedClsPrefix, tag: Component } = this;
|
|
415
|
+
const { $slots, mergedClsPrefix, tag: Component, onRender } = this;
|
|
416
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
428
417
|
return (h(Component, { ref: "selfElRef", class: [
|
|
429
418
|
this.themeClass,
|
|
430
419
|
`${mergedClsPrefix}-button`,
|
package/es/button/styles/rtl.js
CHANGED
package/es/card/src/Card.d.ts
CHANGED
|
@@ -274,6 +274,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
274
274
|
closeSize: string;
|
|
275
275
|
}, any>>>;
|
|
276
276
|
}, {
|
|
277
|
+
themeClass?: import("vue").Ref<string> | undefined;
|
|
278
|
+
onRender?: (() => void) | undefined;
|
|
277
279
|
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
278
280
|
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
279
281
|
mergedTheme: import("vue").ComputedRef<{
|
|
@@ -440,7 +442,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
440
442
|
'--n-font-size': string;
|
|
441
443
|
'--n-title-font-size': string;
|
|
442
444
|
'--n-close-size': string;
|
|
443
|
-
}
|
|
445
|
+
}> | undefined;
|
|
444
446
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
445
447
|
title: StringConstructor;
|
|
446
448
|
contentStyle: PropType<string | CSSProperties>;
|
package/es/card/src/Card.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, defineComponent, computed } from 'vue';
|
|
2
2
|
import { getPadding } from 'seemly';
|
|
3
|
-
import { useConfig, useTheme } from '../../_mixins';
|
|
3
|
+
import { emptyThemeClassHandle, useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
4
4
|
import { call, createKey, keysOf } from '../../_utils';
|
|
5
5
|
import { NBaseClose } from '../../_internal';
|
|
6
6
|
import { cardLight } from '../styles';
|
|
@@ -45,49 +45,52 @@ export default defineComponent({
|
|
|
45
45
|
call(onClose);
|
|
46
46
|
};
|
|
47
47
|
const { mergedClsPrefixRef, NConfigProvider } = useConfig(props);
|
|
48
|
+
const disableInlineTheme = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.disableInlineTheme;
|
|
48
49
|
const themeRef = useTheme('Card', '-card', style, cardLight, props, mergedClsPrefixRef);
|
|
49
50
|
const rtlEnabledRef = useRtl('Card', NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef, mergedClsPrefixRef);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
51
|
+
const cssVarsRef = computed(() => {
|
|
52
|
+
const { size } = props;
|
|
53
|
+
const { self: { color, colorModal, colorTarget, textColor, titleTextColor, titleFontWeight, borderColor, actionColor, borderRadius, closeColor, closeColorHover, closeColorPressed, lineHeight, closeSize, boxShadow, colorPopover, colorEmbedded, [createKey('padding', size)]: padding, [createKey('fontSize', size)]: fontSize, [createKey('titleFontSize', size)]: titleFontSize }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
54
|
+
const { top: paddingTop, left: paddingLeft, bottom: paddingBottom } = getPadding(padding);
|
|
55
|
+
return {
|
|
56
|
+
'--n-bezier': cubicBezierEaseInOut,
|
|
57
|
+
'--n-border-radius': borderRadius,
|
|
58
|
+
'--n-color': props.embedded ? colorEmbedded : color,
|
|
59
|
+
'--n-color-modal': colorModal,
|
|
60
|
+
'--n-color-popover': colorPopover,
|
|
61
|
+
'--n-color-target': colorTarget,
|
|
62
|
+
'--n-text-color': textColor,
|
|
63
|
+
'--n-line-height': lineHeight,
|
|
64
|
+
'--n-action-color': actionColor,
|
|
65
|
+
'--n-title-text-color': titleTextColor,
|
|
66
|
+
'--n-title-font-weight': titleFontWeight,
|
|
67
|
+
'--n-close-color': closeColor,
|
|
68
|
+
'--n-close-color-hover': closeColorHover,
|
|
69
|
+
'--n-close-color-pressed': closeColorPressed,
|
|
70
|
+
'--n-border-color': borderColor,
|
|
71
|
+
'--n-box-shadow': boxShadow,
|
|
72
|
+
// size
|
|
73
|
+
'--n-padding-top': paddingTop,
|
|
74
|
+
'--n-padding-bottom': paddingBottom,
|
|
75
|
+
'--n-padding-left': paddingLeft,
|
|
76
|
+
'--n-font-size': fontSize,
|
|
77
|
+
'--n-title-font-size': titleFontSize,
|
|
78
|
+
'--n-close-size': closeSize
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
const themeClassHandle = disableInlineTheme
|
|
82
|
+
? useThemeClass('card', computed(() => {
|
|
83
|
+
return props.size[0];
|
|
84
|
+
}), cssVarsRef, props)
|
|
85
|
+
: emptyThemeClassHandle;
|
|
86
|
+
return Object.assign({ rtlEnabled: rtlEnabledRef, mergedClsPrefix: mergedClsPrefixRef, mergedTheme: themeRef, handleCloseClick, cssVars: disableInlineTheme ? undefined : cssVarsRef }, themeClassHandle);
|
|
86
87
|
},
|
|
87
88
|
render() {
|
|
88
|
-
const { segmented, bordered, hoverable, mergedClsPrefix, rtlEnabled, $slots } = this;
|
|
89
|
+
const { segmented, bordered, hoverable, mergedClsPrefix, rtlEnabled, onRender, $slots } = this;
|
|
90
|
+
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
89
91
|
return (h("div", { class: [
|
|
90
92
|
`${mergedClsPrefix}-card`,
|
|
93
|
+
this.themeClass,
|
|
91
94
|
{
|
|
92
95
|
[`${mergedClsPrefix}-card--rtl`]: rtlEnabled,
|
|
93
96
|
[`${mergedClsPrefix}-card--content${typeof segmented !== 'boolean' && segmented.content === 'soft'
|
package/es/card/styles/index.js
CHANGED
package/es/card/styles/rtl.d.ts
CHANGED
package/es/card/styles/rtl.js
CHANGED