naive-ui 2.23.2 → 2.24.0
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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/es/_internal/icons/Switcher.js +2 -3
- package/es/_internal/selection/src/styles/index.cssr.js +1 -1
- package/es/_internal/selection/styles/_common.js +1 -1
- package/es/auto-complete/src/AutoComplete.d.ts +12 -12
- package/es/auto-complete/src/AutoComplete.js +13 -15
- package/es/back-top/src/BackTop.d.ts +3 -3
- package/es/calendar/src/Calendar.d.ts +5 -1
- package/es/calendar/src/Calendar.js +16 -4
- package/es/calendar/src/interface.d.ts +4 -0
- package/es/carousel/index.d.ts +1 -0
- package/es/carousel/index.js +1 -0
- package/es/carousel/src/Carousel.d.ts +235 -19
- package/es/carousel/src/Carousel.js +683 -229
- package/es/carousel/src/CarouselArrow.d.ts +9 -0
- package/es/carousel/src/CarouselArrow.js +43 -0
- package/es/carousel/src/CarouselDots.d.ts +66 -0
- package/es/carousel/src/CarouselDots.js +118 -0
- package/es/carousel/src/CarouselItem.d.ts +11 -0
- package/es/carousel/src/CarouselItem.js +72 -0
- package/es/carousel/src/interface.d.ts +28 -0
- package/es/carousel/src/interface.js +2 -0
- package/es/carousel/src/styles/index.cssr.js +141 -38
- package/es/carousel/src/utils.d.ts +12 -0
- package/es/carousel/src/utils.js +58 -0
- package/es/carousel/styles/light.d.ts +3 -0
- package/es/carousel/styles/light.js +5 -2
- package/es/cascader/src/Cascader.d.ts +6 -2
- package/es/cascader/src/Cascader.js +2 -1
- package/es/cascader/src/CascaderOption.d.ts +1 -0
- package/es/cascader/src/CascaderOption.js +7 -4
- package/es/cascader/src/interface.d.ts +2 -1
- package/es/checkbox/src/styles/index.cssr.js +1 -1
- package/es/code/src/Code.d.ts +5 -0
- package/es/code/src/Code.js +6 -3
- package/es/code/src/styles/index.cssr.js +2 -2
- package/es/color-picker/src/ColorInputUnit.js +2 -2
- package/es/color-picker/src/ColorPicker.d.ts +13 -5
- package/es/color-picker/src/ColorPicker.js +19 -10
- package/es/color-picker/src/ColorPickerTrigger.d.ts +1 -1
- package/es/color-picker/src/ColorPickerTrigger.js +23 -17
- package/es/color-picker/src/interface.d.ts +2 -0
- package/es/color-picker/src/styles/index.cssr.js +1 -0
- package/es/config-provider/src/ConfigProvider.d.ts +27 -0
- package/es/data-table/src/DataTable.d.ts +10 -55
- package/es/data-table/src/DataTable.js +23 -49
- package/es/data-table/src/interface.d.ts +1 -1
- package/es/data-table/src/styles/index.cssr.js +4 -1
- package/es/data-table/src/utils.js +4 -1
- package/es/date-picker/src/DatePicker.d.ts +26 -22
- package/es/date-picker/src/DatePicker.js +99 -49
- package/es/date-picker/src/interface.d.ts +17 -2
- package/es/date-picker/src/panel/use-calendar.js +2 -2
- package/es/drawer/src/Drawer.d.ts +18 -58
- package/es/drawer/src/Drawer.js +32 -49
- package/es/drawer/src/DrawerBodyWrapper.js +21 -13
- package/es/drawer/src/DrawerContent.js +6 -6
- package/es/dropdown/src/Dropdown.d.ts +5 -0
- package/es/form/src/Feedbacks.js +4 -1
- package/es/form/src/Form.d.ts +7 -7
- package/es/form/src/Form.js +17 -8
- package/es/form/src/FormItem.d.ts +12 -7
- package/es/form/src/FormItem.js +24 -12
- package/es/form/src/FormItemCol.d.ts +8 -4
- package/es/form/src/FormItemGridItem.d.ts +8 -4
- package/es/form/src/FormItemRow.d.ts +7 -3
- package/es/form/src/interface.d.ts +6 -2
- package/es/form/src/styles/form-item.cssr.js +2 -0
- package/es/form/src/utils.d.ts +2 -2
- package/es/form/src/utils.js +29 -18
- package/es/image/src/Image.d.ts +279 -10
- package/es/image/src/Image.js +4 -17
- package/es/image/src/ImageGroup.d.ts +272 -2
- package/es/image/src/ImageGroup.js +5 -8
- package/es/image/src/ImagePreview.d.ts +195 -7
- package/es/image/src/ImagePreview.js +50 -31
- package/es/image/src/interface.d.ts +94 -0
- package/es/image/src/interface.js +2 -1
- package/es/image/src/styles/index.cssr.js +8 -4
- package/es/image/styles/dark.js +8 -1
- package/es/image/styles/light.d.ts +32 -3
- package/es/image/styles/light.js +8 -1
- package/es/input-number/src/utils.js +2 -2
- package/es/locales/common/deDE.js +10 -0
- package/es/locales/common/enUS.d.ts +9 -0
- package/es/locales/common/enUS.js +10 -0
- package/es/locales/common/frFR.js +10 -0
- package/es/locales/common/idID.js +10 -0
- package/es/locales/common/jaJP.js +10 -0
- package/es/locales/common/nbNO.js +10 -0
- package/es/locales/common/ruRU.js +10 -0
- package/es/locales/common/ukUA.js +10 -0
- package/es/locales/common/zhCN.js +9 -0
- package/es/locales/common/zhTW.js +10 -0
- package/es/mention/src/utils.js +0 -1
- package/es/message/index.d.ts +2 -1
- package/es/message/src/Message.d.ts +191 -19
- package/es/message/src/Message.js +13 -11
- package/es/message/src/MessageEnvironment.d.ts +3 -3
- package/es/message/src/MessageProvider.d.ts +5 -10
- package/es/message/src/MessageProvider.js +1 -1
- package/es/message/src/message-props.d.ts +5 -2
- package/es/message/src/types.d.ts +15 -0
- package/es/message/src/types.js +1 -0
- package/es/modal/src/Modal.d.ts +5 -0
- package/es/modal/src/Modal.js +2 -1
- package/es/page-header/index.d.ts +1 -1
- package/es/page-header/src/PageHeader.d.ts +1 -1
- package/es/pagination/index.d.ts +1 -1
- package/es/pagination/src/Pagination.d.ts +8 -4
- package/es/pagination/src/Pagination.js +66 -19
- package/es/pagination/src/interface.d.ts +10 -1
- package/es/pagination/src/utils.d.ts +2 -2
- package/es/pagination/src/utils.js +2 -4
- package/es/popconfirm/src/Popconfirm.d.ts +5 -0
- package/es/popover/src/Popover.d.ts +7 -0
- package/es/popover/src/Popover.js +24 -1
- package/es/popover/src/PopoverBody.d.ts +5 -0
- package/es/popover/src/PopoverBody.js +28 -46
- package/es/popover/src/styles/index.cssr.js +9 -8
- package/es/popselect/src/Popselect.d.ts +62 -73
- package/es/popselect/src/Popselect.js +2 -2
- package/es/progress/src/Circle.d.ts +7 -0
- package/es/progress/src/Circle.js +8 -1
- package/es/progress/src/Line.d.ts +2 -2
- package/es/progress/src/Line.js +4 -1
- package/es/progress/src/Progress.d.ts +6 -2
- package/es/progress/src/Progress.js +2 -2
- package/es/progress/src/styles/index.cssr.js +16 -16
- package/es/radio/src/styles/radio.cssr.js +4 -1
- package/es/result/src/Result.js +9 -10
- package/es/result/src/styles/index.cssr.js +7 -7
- package/es/select/src/Select.d.ts +8 -27
- package/es/select/src/Select.js +16 -24
- package/es/slider/src/Slider.d.ts +2 -4
- package/es/tabs/index.d.ts +1 -0
- package/es/tabs/src/Tabs.d.ts +2 -2
- package/es/tabs/src/Tabs.js +25 -22
- package/es/tabs/src/interface.d.ts +3 -0
- package/es/time-picker/src/TimePicker.d.ts +22 -2
- package/es/time-picker/src/TimePicker.js +59 -29
- package/es/time-picker/src/interface.d.ts +4 -2
- package/es/tooltip/src/Tooltip.d.ts +5 -0
- package/es/tree/src/Tree.d.ts +5 -1
- package/es/tree/src/Tree.js +4 -2
- package/es/tree/src/TreeNodeSwitcher.d.ts +1 -1
- package/es/tree/src/TreeNodeSwitcher.js +25 -14
- package/es/tree/src/interface.d.ts +2 -0
- package/es/tree/src/styles/index.cssr.js +4 -2
- package/es/upload/src/Upload.d.ts +15 -6
- package/es/upload/src/Upload.js +18 -9
- package/es/upload/src/UploadFile.d.ts +5 -5
- package/es/upload/src/UploadFileList.js +2 -2
- package/es/upload/src/interface.d.ts +11 -4
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/icons/Switcher.js +2 -3
- package/lib/_internal/selection/src/styles/index.cssr.js +1 -1
- package/lib/_internal/selection/styles/_common.js +1 -1
- package/lib/auto-complete/src/AutoComplete.d.ts +12 -12
- package/lib/auto-complete/src/AutoComplete.js +14 -16
- package/lib/back-top/src/BackTop.d.ts +3 -3
- package/lib/calendar/src/Calendar.d.ts +5 -1
- package/lib/calendar/src/Calendar.js +15 -3
- package/lib/calendar/src/interface.d.ts +4 -0
- package/lib/carousel/index.d.ts +1 -0
- package/lib/carousel/index.js +3 -1
- package/lib/carousel/src/Carousel.d.ts +235 -19
- package/lib/carousel/src/Carousel.js +681 -227
- package/lib/carousel/src/CarouselArrow.d.ts +9 -0
- package/lib/carousel/src/CarouselArrow.js +45 -0
- package/lib/carousel/src/CarouselDots.d.ts +66 -0
- package/lib/carousel/src/CarouselDots.js +120 -0
- package/lib/carousel/src/CarouselItem.d.ts +11 -0
- package/lib/carousel/src/CarouselItem.js +74 -0
- package/lib/carousel/src/interface.d.ts +28 -0
- package/lib/carousel/src/interface.js +6 -0
- package/lib/carousel/src/styles/index.cssr.js +141 -38
- package/lib/carousel/src/utils.d.ts +12 -0
- package/lib/carousel/src/utils.js +69 -0
- package/lib/carousel/styles/light.d.ts +3 -0
- package/lib/carousel/styles/light.js +5 -2
- package/lib/cascader/src/Cascader.d.ts +6 -2
- package/lib/cascader/src/Cascader.js +2 -1
- package/lib/cascader/src/CascaderOption.d.ts +1 -0
- package/lib/cascader/src/CascaderOption.js +7 -4
- package/lib/cascader/src/interface.d.ts +2 -1
- package/lib/checkbox/src/styles/index.cssr.js +1 -1
- package/lib/code/src/Code.d.ts +5 -0
- package/lib/code/src/Code.js +6 -3
- package/lib/code/src/styles/index.cssr.js +1 -1
- package/lib/color-picker/src/ColorInputUnit.js +1 -1
- package/lib/color-picker/src/ColorPicker.d.ts +13 -5
- package/lib/color-picker/src/ColorPicker.js +19 -10
- package/lib/color-picker/src/ColorPickerTrigger.d.ts +1 -1
- package/lib/color-picker/src/ColorPickerTrigger.js +22 -16
- package/lib/color-picker/src/interface.d.ts +2 -0
- package/lib/color-picker/src/styles/index.cssr.js +1 -0
- package/lib/config-provider/src/ConfigProvider.d.ts +27 -0
- package/lib/data-table/src/DataTable.d.ts +10 -55
- package/lib/data-table/src/DataTable.js +21 -47
- package/lib/data-table/src/interface.d.ts +1 -1
- package/lib/data-table/src/styles/index.cssr.js +4 -1
- package/lib/data-table/src/utils.js +3 -0
- package/lib/date-picker/src/DatePicker.d.ts +26 -22
- package/lib/date-picker/src/DatePicker.js +98 -48
- package/lib/date-picker/src/interface.d.ts +17 -2
- package/lib/date-picker/src/panel/use-calendar.js +2 -2
- package/lib/drawer/src/Drawer.d.ts +18 -58
- package/lib/drawer/src/Drawer.js +30 -47
- package/lib/drawer/src/DrawerBodyWrapper.js +21 -13
- package/lib/drawer/src/DrawerContent.js +6 -6
- package/lib/dropdown/src/Dropdown.d.ts +5 -0
- package/lib/form/src/Feedbacks.js +4 -1
- package/lib/form/src/Form.d.ts +7 -7
- package/lib/form/src/Form.js +16 -7
- package/lib/form/src/FormItem.d.ts +12 -7
- package/lib/form/src/FormItem.js +23 -11
- package/lib/form/src/FormItemCol.d.ts +8 -4
- package/lib/form/src/FormItemGridItem.d.ts +8 -4
- package/lib/form/src/FormItemRow.d.ts +7 -3
- package/lib/form/src/interface.d.ts +6 -2
- package/lib/form/src/styles/form-item.cssr.js +2 -0
- package/lib/form/src/utils.d.ts +2 -2
- package/lib/form/src/utils.js +29 -18
- package/lib/image/src/Image.d.ts +279 -10
- package/lib/image/src/Image.js +4 -17
- package/lib/image/src/ImageGroup.d.ts +272 -2
- package/lib/image/src/ImageGroup.js +4 -7
- package/lib/image/src/ImagePreview.d.ts +195 -7
- package/lib/image/src/ImagePreview.js +49 -30
- package/lib/image/src/interface.d.ts +94 -0
- package/lib/image/src/interface.js +3 -0
- package/lib/image/src/styles/index.cssr.js +8 -4
- package/lib/image/styles/dark.js +8 -1
- package/lib/image/styles/light.d.ts +32 -3
- package/lib/image/styles/light.js +8 -1
- package/lib/input-number/src/utils.js +2 -2
- package/lib/locales/common/deDE.js +10 -0
- package/lib/locales/common/enUS.d.ts +9 -0
- package/lib/locales/common/enUS.js +10 -0
- package/lib/locales/common/frFR.js +10 -0
- package/lib/locales/common/idID.js +10 -0
- package/lib/locales/common/jaJP.js +10 -0
- package/lib/locales/common/nbNO.js +10 -0
- package/lib/locales/common/ruRU.js +10 -0
- package/lib/locales/common/ukUA.js +10 -0
- package/lib/locales/common/zhCN.js +9 -0
- package/lib/locales/common/zhTW.js +10 -0
- package/lib/mention/src/utils.js +0 -1
- package/lib/message/index.d.ts +2 -1
- package/lib/message/src/Message.d.ts +191 -19
- package/lib/message/src/Message.js +13 -11
- package/lib/message/src/MessageEnvironment.d.ts +3 -3
- package/lib/message/src/MessageProvider.d.ts +5 -10
- package/lib/message/src/MessageProvider.js +1 -1
- package/lib/message/src/message-props.d.ts +5 -2
- package/lib/message/src/types.d.ts +15 -0
- package/lib/message/src/types.js +2 -0
- package/lib/modal/src/Modal.d.ts +5 -0
- package/lib/modal/src/Modal.js +2 -1
- package/lib/page-header/index.d.ts +1 -1
- package/lib/page-header/src/PageHeader.d.ts +1 -1
- package/lib/pagination/index.d.ts +1 -1
- package/lib/pagination/src/Pagination.d.ts +8 -4
- package/lib/pagination/src/Pagination.js +65 -18
- package/lib/pagination/src/interface.d.ts +10 -1
- package/lib/pagination/src/utils.d.ts +2 -2
- package/lib/pagination/src/utils.js +2 -4
- package/lib/popconfirm/src/Popconfirm.d.ts +5 -0
- package/lib/popover/src/Popover.d.ts +7 -0
- package/lib/popover/src/Popover.js +23 -0
- package/lib/popover/src/PopoverBody.d.ts +5 -0
- package/lib/popover/src/PopoverBody.js +27 -45
- package/lib/popover/src/styles/index.cssr.js +9 -8
- package/lib/popselect/src/Popselect.d.ts +62 -73
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/progress/src/Circle.d.ts +7 -0
- package/lib/progress/src/Circle.js +8 -1
- package/lib/progress/src/Line.d.ts +2 -2
- package/lib/progress/src/Line.js +4 -1
- package/lib/progress/src/Progress.d.ts +6 -2
- package/lib/progress/src/Progress.js +2 -2
- package/lib/progress/src/styles/index.cssr.js +16 -16
- package/lib/radio/src/styles/radio.cssr.js +4 -1
- package/lib/result/src/Result.js +8 -9
- package/lib/result/src/styles/index.cssr.js +6 -6
- package/lib/select/src/Select.d.ts +8 -27
- package/lib/select/src/Select.js +14 -22
- package/lib/slider/src/Slider.d.ts +2 -4
- package/lib/tabs/index.d.ts +1 -0
- package/lib/tabs/src/Tabs.d.ts +2 -2
- package/lib/tabs/src/Tabs.js +25 -22
- package/lib/tabs/src/interface.d.ts +3 -0
- package/lib/time-picker/src/TimePicker.d.ts +22 -2
- package/lib/time-picker/src/TimePicker.js +59 -29
- package/lib/time-picker/src/interface.d.ts +4 -2
- package/lib/tooltip/src/Tooltip.d.ts +5 -0
- package/lib/tree/src/Tree.d.ts +5 -1
- package/lib/tree/src/Tree.js +4 -2
- package/lib/tree/src/TreeNodeSwitcher.d.ts +1 -1
- package/lib/tree/src/TreeNodeSwitcher.js +24 -13
- package/lib/tree/src/interface.d.ts +2 -0
- package/lib/tree/src/styles/index.cssr.js +4 -2
- package/lib/upload/src/Upload.d.ts +15 -6
- package/lib/upload/src/Upload.js +18 -9
- package/lib/upload/src/UploadFile.d.ts +5 -5
- package/lib/upload/src/UploadFileList.js +2 -2
- package/lib/upload/src/interface.d.ts +11 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +21 -13
- package/web-types.json +413 -31
|
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.imageGroupInjectionKey = void 0;
|
|
7
7
|
const vue_1 = require("vue");
|
|
8
8
|
const seemly_1 = require("seemly");
|
|
9
|
-
const ImagePreview_1 = __importDefault(require("./ImagePreview"));
|
|
10
9
|
const _mixins_1 = require("../../_mixins");
|
|
10
|
+
const ImagePreview_1 = __importDefault(require("./ImagePreview"));
|
|
11
|
+
const interface_1 = require("./interface");
|
|
11
12
|
exports.imageGroupInjectionKey = Symbol('image-group');
|
|
12
|
-
const imageGroupProps =
|
|
13
|
-
showToolbar: { type: Boolean, default: true }
|
|
14
|
-
};
|
|
13
|
+
const imageGroupProps = interface_1.imagePreviewSharedProps;
|
|
15
14
|
exports.default = (0, vue_1.defineComponent)({
|
|
16
15
|
name: 'ImageGroup',
|
|
17
16
|
props: imageGroupProps,
|
|
@@ -63,8 +62,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
63
62
|
};
|
|
64
63
|
},
|
|
65
64
|
render() {
|
|
66
|
-
return ((0, vue_1.h)(ImagePreview_1.default, { clsPrefix: this.mergedClsPrefix, ref: "previewInstRef", onPrev: this.prev, onNext: this.next, showToolbar: this.showToolbar },
|
|
67
|
-
default: () => (0, vue_1.renderSlot)(this.$slots, 'default')
|
|
68
|
-
}));
|
|
65
|
+
return ((0, vue_1.h)(ImagePreview_1.default, { theme: this.theme, themeOverrides: this.themeOverrides, clsPrefix: this.mergedClsPrefix, ref: "previewInstRef", onPrev: this.prev, onNext: this.next, showToolbar: this.showToolbar, showToolbarTooltip: this.showToolbarTooltip }, this.$slots));
|
|
69
66
|
}
|
|
70
67
|
});
|
|
@@ -1,22 +1,109 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
1
|
+
import { PropType, VNode } from 'vue';
|
|
2
2
|
export interface ImagePreviewInst {
|
|
3
3
|
setThumbnailEl: (e: HTMLImageElement | null) => void;
|
|
4
4
|
setPreviewSrc: (src?: string) => void;
|
|
5
5
|
toggleShow: () => void;
|
|
6
6
|
}
|
|
7
7
|
declare const _default: import("vue").DefineComponent<{
|
|
8
|
-
showToolbar: BooleanConstructor;
|
|
9
8
|
onNext: PropType<() => void>;
|
|
10
9
|
onPrev: PropType<() => void>;
|
|
11
10
|
clsPrefix: {
|
|
12
11
|
type: StringConstructor;
|
|
13
12
|
required: true;
|
|
14
13
|
};
|
|
14
|
+
showToolbar: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
showToolbarTooltip: BooleanConstructor;
|
|
19
|
+
theme: PropType<import("../../_mixins").Theme<"Image", {
|
|
20
|
+
toolbarIconColor: string;
|
|
21
|
+
toolbarColor: string;
|
|
22
|
+
toolbarBoxShadow: string;
|
|
23
|
+
toolbarBorderRadius: string;
|
|
24
|
+
}, {
|
|
25
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
26
|
+
borderRadius: string;
|
|
27
|
+
boxShadow: string;
|
|
28
|
+
color: string;
|
|
29
|
+
textColor: string;
|
|
30
|
+
padding: string;
|
|
31
|
+
}, {
|
|
32
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
33
|
+
fontSize: string;
|
|
34
|
+
borderRadius: string;
|
|
35
|
+
color: string;
|
|
36
|
+
dividerColor: string;
|
|
37
|
+
textColor: string;
|
|
38
|
+
boxShadow: string;
|
|
39
|
+
space: string;
|
|
40
|
+
spaceArrow: string;
|
|
41
|
+
arrowOffset: string;
|
|
42
|
+
arrowOffsetVertical: string;
|
|
43
|
+
arrowHeight: string;
|
|
44
|
+
padding: string;
|
|
45
|
+
}, any>;
|
|
46
|
+
}>;
|
|
47
|
+
}>>;
|
|
48
|
+
themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Image", {
|
|
49
|
+
toolbarIconColor: string;
|
|
50
|
+
toolbarColor: string;
|
|
51
|
+
toolbarBoxShadow: string;
|
|
52
|
+
toolbarBorderRadius: string;
|
|
53
|
+
}, {
|
|
54
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
55
|
+
borderRadius: string;
|
|
56
|
+
boxShadow: string;
|
|
57
|
+
color: string;
|
|
58
|
+
textColor: string;
|
|
59
|
+
padding: string;
|
|
60
|
+
}, {
|
|
61
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
62
|
+
fontSize: string;
|
|
63
|
+
borderRadius: string;
|
|
64
|
+
color: string;
|
|
65
|
+
dividerColor: string;
|
|
66
|
+
textColor: string;
|
|
67
|
+
boxShadow: string;
|
|
68
|
+
space: string;
|
|
69
|
+
spaceArrow: string;
|
|
70
|
+
arrowOffset: string;
|
|
71
|
+
arrowOffsetVertical: string;
|
|
72
|
+
arrowHeight: string;
|
|
73
|
+
padding: string;
|
|
74
|
+
}, any>;
|
|
75
|
+
}>;
|
|
76
|
+
}>>>;
|
|
77
|
+
builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Image", {
|
|
78
|
+
toolbarIconColor: string;
|
|
79
|
+
toolbarColor: string;
|
|
80
|
+
toolbarBoxShadow: string;
|
|
81
|
+
toolbarBorderRadius: string;
|
|
82
|
+
}, {
|
|
83
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
84
|
+
borderRadius: string;
|
|
85
|
+
boxShadow: string;
|
|
86
|
+
color: string;
|
|
87
|
+
textColor: string;
|
|
88
|
+
padding: string;
|
|
89
|
+
}, {
|
|
90
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
91
|
+
fontSize: string;
|
|
92
|
+
borderRadius: string;
|
|
93
|
+
color: string;
|
|
94
|
+
dividerColor: string;
|
|
95
|
+
textColor: string;
|
|
96
|
+
boxShadow: string;
|
|
97
|
+
space: string;
|
|
98
|
+
spaceArrow: string;
|
|
99
|
+
arrowOffset: string;
|
|
100
|
+
arrowOffsetVertical: string;
|
|
101
|
+
arrowHeight: string;
|
|
102
|
+
padding: string;
|
|
103
|
+
}, any>;
|
|
104
|
+
}>;
|
|
105
|
+
}>>>;
|
|
15
106
|
}, {
|
|
16
|
-
cssVars: import("vue").ComputedRef<{
|
|
17
|
-
'--n-bezier': string;
|
|
18
|
-
'--n-icon-color': string;
|
|
19
|
-
}>;
|
|
20
107
|
setThumbnailEl: (e: HTMLImageElement | null) => void;
|
|
21
108
|
setPreviewSrc: (src?: string | undefined) => void;
|
|
22
109
|
toggleShow: () => void;
|
|
@@ -37,18 +124,119 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
124
|
rotateClockwise: () => void;
|
|
38
125
|
handleSwitchPrev: () => void;
|
|
39
126
|
handleSwitchNext: () => void;
|
|
127
|
+
withTooltip: (node: VNode, tooltipKey: "tipPrevious" | "tipNext" | "tipCounterclockwise" | "tipClockwise" | "tipZoomOut" | "tipZoomIn" | "tipClose") => VNode;
|
|
128
|
+
cssVars: import("vue").ComputedRef<{
|
|
129
|
+
'--n-bezier': string;
|
|
130
|
+
'--n-toolbar-icon-color': string;
|
|
131
|
+
'--n-toolbar-color': string;
|
|
132
|
+
'--n-toolbar-border-radius': string;
|
|
133
|
+
'--n-toolbar-box-shadow': string;
|
|
134
|
+
}>;
|
|
40
135
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
41
|
-
showToolbar?: unknown;
|
|
42
136
|
onNext?: unknown;
|
|
43
137
|
onPrev?: unknown;
|
|
44
138
|
clsPrefix?: unknown;
|
|
139
|
+
showToolbar?: unknown;
|
|
140
|
+
showToolbarTooltip?: unknown;
|
|
141
|
+
theme?: unknown;
|
|
142
|
+
themeOverrides?: unknown;
|
|
143
|
+
builtinThemeOverrides?: unknown;
|
|
45
144
|
} & {
|
|
46
145
|
clsPrefix: string;
|
|
47
146
|
showToolbar: boolean;
|
|
147
|
+
showToolbarTooltip: boolean;
|
|
48
148
|
} & {
|
|
149
|
+
theme?: import("../../_mixins").Theme<"Image", {
|
|
150
|
+
toolbarIconColor: string;
|
|
151
|
+
toolbarColor: string;
|
|
152
|
+
toolbarBoxShadow: string;
|
|
153
|
+
toolbarBorderRadius: string;
|
|
154
|
+
}, {
|
|
155
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
156
|
+
borderRadius: string;
|
|
157
|
+
boxShadow: string;
|
|
158
|
+
color: string;
|
|
159
|
+
textColor: string;
|
|
160
|
+
padding: string;
|
|
161
|
+
}, {
|
|
162
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
163
|
+
fontSize: string;
|
|
164
|
+
borderRadius: string;
|
|
165
|
+
color: string;
|
|
166
|
+
dividerColor: string;
|
|
167
|
+
textColor: string;
|
|
168
|
+
boxShadow: string;
|
|
169
|
+
space: string;
|
|
170
|
+
spaceArrow: string;
|
|
171
|
+
arrowOffset: string;
|
|
172
|
+
arrowOffsetVertical: string;
|
|
173
|
+
arrowHeight: string;
|
|
174
|
+
padding: string;
|
|
175
|
+
}, any>;
|
|
176
|
+
}>;
|
|
177
|
+
}> | undefined;
|
|
178
|
+
themeOverrides?: import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Image", {
|
|
179
|
+
toolbarIconColor: string;
|
|
180
|
+
toolbarColor: string;
|
|
181
|
+
toolbarBoxShadow: string;
|
|
182
|
+
toolbarBorderRadius: string;
|
|
183
|
+
}, {
|
|
184
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
185
|
+
borderRadius: string;
|
|
186
|
+
boxShadow: string;
|
|
187
|
+
color: string;
|
|
188
|
+
textColor: string;
|
|
189
|
+
padding: string;
|
|
190
|
+
}, {
|
|
191
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
192
|
+
fontSize: string;
|
|
193
|
+
borderRadius: string;
|
|
194
|
+
color: string;
|
|
195
|
+
dividerColor: string;
|
|
196
|
+
textColor: string;
|
|
197
|
+
boxShadow: string;
|
|
198
|
+
space: string;
|
|
199
|
+
spaceArrow: string;
|
|
200
|
+
arrowOffset: string;
|
|
201
|
+
arrowOffsetVertical: string;
|
|
202
|
+
arrowHeight: string;
|
|
203
|
+
padding: string;
|
|
204
|
+
}, any>;
|
|
205
|
+
}>;
|
|
206
|
+
}>> | undefined;
|
|
207
|
+
builtinThemeOverrides?: import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Image", {
|
|
208
|
+
toolbarIconColor: string;
|
|
209
|
+
toolbarColor: string;
|
|
210
|
+
toolbarBoxShadow: string;
|
|
211
|
+
toolbarBorderRadius: string;
|
|
212
|
+
}, {
|
|
213
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
214
|
+
borderRadius: string;
|
|
215
|
+
boxShadow: string;
|
|
216
|
+
color: string;
|
|
217
|
+
textColor: string;
|
|
218
|
+
padding: string;
|
|
219
|
+
}, {
|
|
220
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
221
|
+
fontSize: string;
|
|
222
|
+
borderRadius: string;
|
|
223
|
+
color: string;
|
|
224
|
+
dividerColor: string;
|
|
225
|
+
textColor: string;
|
|
226
|
+
boxShadow: string;
|
|
227
|
+
space: string;
|
|
228
|
+
spaceArrow: string;
|
|
229
|
+
arrowOffset: string;
|
|
230
|
+
arrowOffsetVertical: string;
|
|
231
|
+
arrowHeight: string;
|
|
232
|
+
padding: string;
|
|
233
|
+
}, any>;
|
|
234
|
+
}>;
|
|
235
|
+
}>> | undefined;
|
|
49
236
|
onNext?: (() => void) | undefined;
|
|
50
237
|
onPrev?: (() => void) | undefined;
|
|
51
238
|
}>, {
|
|
52
239
|
showToolbar: boolean;
|
|
240
|
+
showToolbarTooltip: boolean;
|
|
53
241
|
}>;
|
|
54
242
|
export default _default;
|
|
@@ -14,26 +14,24 @@ const _mixins_1 = require("../../_mixins");
|
|
|
14
14
|
const _internal_1 = require("../../_internal");
|
|
15
15
|
const styles_1 = require("../styles");
|
|
16
16
|
const icons_2 = require("./icons");
|
|
17
|
+
const interface_1 = require("./interface");
|
|
17
18
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
19
|
+
const tooltip_1 = require("../../tooltip");
|
|
18
20
|
exports.default = (0, vue_1.defineComponent)({
|
|
19
21
|
name: 'ImagePreview',
|
|
20
|
-
props: {
|
|
21
|
-
showToolbar: Boolean,
|
|
22
|
-
onNext: Function,
|
|
23
|
-
onPrev: Function,
|
|
24
|
-
clsPrefix: {
|
|
22
|
+
props: Object.assign(Object.assign({}, interface_1.imagePreviewSharedProps), { onNext: Function, onPrev: Function, clsPrefix: {
|
|
25
23
|
type: String,
|
|
26
24
|
required: true
|
|
27
|
-
}
|
|
28
|
-
},
|
|
25
|
+
} }),
|
|
29
26
|
setup(props) {
|
|
30
|
-
const themeRef = (0, _mixins_1.useTheme)('Image', 'Image', index_cssr_1.default, styles_1.imageLight,
|
|
27
|
+
const themeRef = (0, _mixins_1.useTheme)('Image', 'Image', index_cssr_1.default, styles_1.imageLight, props, (0, vue_1.toRef)(props, 'clsPrefix'));
|
|
31
28
|
let thumbnailEl = null;
|
|
32
29
|
const previewRef = (0, vue_1.ref)(null);
|
|
33
30
|
const previewWrapperRef = (0, vue_1.ref)(null);
|
|
34
31
|
const previewSrcRef = (0, vue_1.ref)(undefined);
|
|
35
32
|
const showRef = (0, vue_1.ref)(false);
|
|
36
33
|
const displayedRef = (0, vue_1.ref)(false);
|
|
34
|
+
const { localeRef } = (0, _mixins_1.useLocale)('Image');
|
|
37
35
|
function syncTransformOrigin() {
|
|
38
36
|
const { value: previewWrapper } = previewWrapperRef;
|
|
39
37
|
if (!thumbnailEl || !previewWrapper)
|
|
@@ -86,12 +84,8 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
86
84
|
const { mouseUpClientX, mouseUpClientY, mouseDownClientX, mouseDownClientY } = opts;
|
|
87
85
|
const deltaHorizontal = mouseDownClientX - mouseUpClientX;
|
|
88
86
|
const deltaVertical = mouseDownClientY - mouseUpClientY;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
moveVerticalDirection = ('vertical' +
|
|
92
|
-
(deltaVertical > 0 ? 'Top' : 'Bottom'));
|
|
93
|
-
moveHorizontalDirection = ('horizontal' +
|
|
94
|
-
(deltaHorizontal > 0 ? 'Left' : 'Right'));
|
|
87
|
+
const moveVerticalDirection = `vertical${deltaVertical > 0 ? 'Top' : 'Bottom'}`;
|
|
88
|
+
const moveHorizontalDirection = `horizontal${deltaHorizontal > 0 ? 'Left' : 'Right'}`;
|
|
95
89
|
return {
|
|
96
90
|
moveVerticalDirection,
|
|
97
91
|
moveHorizontalDirection,
|
|
@@ -249,7 +243,21 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
249
243
|
},
|
|
250
244
|
toggleShow
|
|
251
245
|
};
|
|
252
|
-
|
|
246
|
+
function withTooltip(node, tooltipKey) {
|
|
247
|
+
if (props.showToolbarTooltip) {
|
|
248
|
+
const { value: theme } = themeRef;
|
|
249
|
+
return ((0, vue_1.h)(tooltip_1.NTooltip, { to: false, theme: theme.peers.Tooltip, themeOverrides: theme.peerOverrides.Tooltip }, {
|
|
250
|
+
default: () => {
|
|
251
|
+
return localeRef.value[tooltipKey];
|
|
252
|
+
},
|
|
253
|
+
trigger: () => node
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
return node;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return Object.assign({ previewRef,
|
|
253
261
|
previewWrapperRef, previewSrc: previewSrcRef, show: showRef, appear: (0, vooks_1.useIsMounted)(), displayed: displayedRef, handlePreviewMousedown,
|
|
254
262
|
handlePreviewDblclick,
|
|
255
263
|
syncTransformOrigin, handleAfterLeave: () => {
|
|
@@ -263,13 +271,17 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
263
271
|
rotateCounterclockwise,
|
|
264
272
|
rotateClockwise,
|
|
265
273
|
handleSwitchPrev,
|
|
266
|
-
handleSwitchNext
|
|
267
|
-
|
|
274
|
+
handleSwitchNext,
|
|
275
|
+
withTooltip, cssVars: (0, vue_1.computed)(() => {
|
|
276
|
+
const { common: { cubicBezierEaseInOut }, self: { toolbarIconColor, toolbarBorderRadius, toolbarBoxShadow, toolbarColor } } = themeRef.value;
|
|
268
277
|
return {
|
|
269
278
|
'--n-bezier': cubicBezierEaseInOut,
|
|
270
|
-
'--n-icon-color':
|
|
279
|
+
'--n-toolbar-icon-color': toolbarIconColor,
|
|
280
|
+
'--n-toolbar-color': toolbarColor,
|
|
281
|
+
'--n-toolbar-border-radius': toolbarBorderRadius,
|
|
282
|
+
'--n-toolbar-box-shadow': toolbarBoxShadow
|
|
271
283
|
};
|
|
272
|
-
}) });
|
|
284
|
+
}) }, exposedMethods);
|
|
273
285
|
},
|
|
274
286
|
render() {
|
|
275
287
|
const { clsPrefix } = this;
|
|
@@ -282,17 +294,24 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
282
294
|
default: () => this.show ? ((0, vue_1.h)("div", { class: `${clsPrefix}-image-preview-overlay`, onClick: this.toggleShow })) : null
|
|
283
295
|
}),
|
|
284
296
|
this.showToolbar ? ((0, vue_1.h)(vue_1.Transition, { name: "fade-in-transition", appear: this.appear }, {
|
|
285
|
-
default: () =>
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
(0, vue_1.h)(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
default: () => {
|
|
298
|
+
if (!this.show)
|
|
299
|
+
return null;
|
|
300
|
+
const { withTooltip } = this;
|
|
301
|
+
return ((0, vue_1.h)("div", { class: `${clsPrefix}-image-preview-toolbar` },
|
|
302
|
+
this.onPrev ? ((0, vue_1.h)(vue_1.Fragment, null,
|
|
303
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.handleSwitchPrev }, { default: () => icons_2.prevIcon }), 'tipPrevious'),
|
|
304
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.handleSwitchNext }, { default: () => icons_2.nextIcon }), 'tipNext'))) : null,
|
|
305
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.rotateCounterclockwise }, {
|
|
306
|
+
default: () => ((0, vue_1.h)(icons_1.RotateCounterclockwiseIcon, null))
|
|
307
|
+
}), 'tipCounterclockwise'),
|
|
308
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.rotateClockwise }, {
|
|
309
|
+
default: () => (0, vue_1.h)(icons_1.RotateClockwiseIcon, null)
|
|
310
|
+
}), 'tipClockwise'),
|
|
311
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.zoomOut }, { default: () => (0, vue_1.h)(icons_1.ZoomOutIcon, null) }), 'tipZoomOut'),
|
|
312
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.zoomIn }, { default: () => (0, vue_1.h)(icons_1.ZoomInIcon, null) }), 'tipZoomIn'),
|
|
313
|
+
withTooltip((0, vue_1.h)(_internal_1.NBaseIcon, { clsPrefix: clsPrefix, onClick: this.toggleShow }, { default: () => icons_2.closeIcon }), 'tipClose')));
|
|
314
|
+
}
|
|
296
315
|
})) : null,
|
|
297
316
|
(0, vue_1.h)(vue_1.Transition, { name: "fade-in-scale-up-transition", onAfterLeave: this.handleAfterLeave, appear: this.appear,
|
|
298
317
|
// BUG:
|
|
@@ -4,3 +4,97 @@ export interface MoveStrategy {
|
|
|
4
4
|
deltaHorizontal: number;
|
|
5
5
|
deltaVertical: number;
|
|
6
6
|
}
|
|
7
|
+
export declare const imagePreviewSharedProps: {
|
|
8
|
+
showToolbar: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
showToolbarTooltip: BooleanConstructor;
|
|
13
|
+
theme: import("vue").PropType<import("../../_mixins").Theme<"Image", {
|
|
14
|
+
toolbarIconColor: string;
|
|
15
|
+
toolbarColor: string;
|
|
16
|
+
toolbarBoxShadow: string;
|
|
17
|
+
toolbarBorderRadius: string;
|
|
18
|
+
}, {
|
|
19
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
20
|
+
borderRadius: string;
|
|
21
|
+
boxShadow: string;
|
|
22
|
+
color: string;
|
|
23
|
+
textColor: string;
|
|
24
|
+
padding: string;
|
|
25
|
+
}, {
|
|
26
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
27
|
+
fontSize: string;
|
|
28
|
+
borderRadius: string;
|
|
29
|
+
color: string;
|
|
30
|
+
dividerColor: string;
|
|
31
|
+
textColor: string;
|
|
32
|
+
boxShadow: string;
|
|
33
|
+
space: string;
|
|
34
|
+
spaceArrow: string;
|
|
35
|
+
arrowOffset: string;
|
|
36
|
+
arrowOffsetVertical: string;
|
|
37
|
+
arrowHeight: string;
|
|
38
|
+
padding: string;
|
|
39
|
+
}, any>;
|
|
40
|
+
}>;
|
|
41
|
+
}>>;
|
|
42
|
+
themeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Image", {
|
|
43
|
+
toolbarIconColor: string;
|
|
44
|
+
toolbarColor: string;
|
|
45
|
+
toolbarBoxShadow: string;
|
|
46
|
+
toolbarBorderRadius: string;
|
|
47
|
+
}, {
|
|
48
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
49
|
+
borderRadius: string;
|
|
50
|
+
boxShadow: string;
|
|
51
|
+
color: string;
|
|
52
|
+
textColor: string;
|
|
53
|
+
padding: string;
|
|
54
|
+
}, {
|
|
55
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
56
|
+
fontSize: string;
|
|
57
|
+
borderRadius: string;
|
|
58
|
+
color: string;
|
|
59
|
+
dividerColor: string;
|
|
60
|
+
textColor: string;
|
|
61
|
+
boxShadow: string;
|
|
62
|
+
space: string;
|
|
63
|
+
spaceArrow: string;
|
|
64
|
+
arrowOffset: string;
|
|
65
|
+
arrowOffsetVertical: string;
|
|
66
|
+
arrowHeight: string;
|
|
67
|
+
padding: string;
|
|
68
|
+
}, any>;
|
|
69
|
+
}>;
|
|
70
|
+
}>>>;
|
|
71
|
+
builtinThemeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Image", {
|
|
72
|
+
toolbarIconColor: string;
|
|
73
|
+
toolbarColor: string;
|
|
74
|
+
toolbarBoxShadow: string;
|
|
75
|
+
toolbarBorderRadius: string;
|
|
76
|
+
}, {
|
|
77
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
78
|
+
borderRadius: string;
|
|
79
|
+
boxShadow: string;
|
|
80
|
+
color: string;
|
|
81
|
+
textColor: string;
|
|
82
|
+
padding: string;
|
|
83
|
+
}, {
|
|
84
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
85
|
+
fontSize: string;
|
|
86
|
+
borderRadius: string;
|
|
87
|
+
color: string;
|
|
88
|
+
dividerColor: string;
|
|
89
|
+
textColor: string;
|
|
90
|
+
boxShadow: string;
|
|
91
|
+
space: string;
|
|
92
|
+
spaceArrow: string;
|
|
93
|
+
arrowOffset: string;
|
|
94
|
+
arrowOffsetVertical: string;
|
|
95
|
+
arrowHeight: string;
|
|
96
|
+
padding: string;
|
|
97
|
+
}, any>;
|
|
98
|
+
}>;
|
|
99
|
+
}>>>;
|
|
100
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imagePreviewSharedProps = void 0;
|
|
4
|
+
const _mixins_1 = require("../../_mixins");
|
|
5
|
+
exports.imagePreviewSharedProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { showToolbar: { type: Boolean, default: true }, showToolbarTooltip: Boolean });
|
|
@@ -15,7 +15,10 @@ const cssr_1 = require("../../../_utils/cssr");
|
|
|
15
15
|
const fade_in_cssr_1 = __importDefault(require("../../../_styles/transitions/fade-in.cssr"));
|
|
16
16
|
|
|
17
17
|
const fade_in_scale_up_cssr_1 = __importDefault(require("../../../_styles/transitions/fade-in-scale-up.cssr")); // vars:
|
|
18
|
-
// --n-icon-color
|
|
18
|
+
// --n-toolbar-icon-color
|
|
19
|
+
// --n-toolbar-color
|
|
20
|
+
// --n-toolbar-border-radius
|
|
21
|
+
// --n-toolbar-box-shadow
|
|
19
22
|
// --n-bezier
|
|
20
23
|
|
|
21
24
|
|
|
@@ -39,12 +42,13 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.c)('body >', [(0, cssr_1.cB)('image-
|
|
|
39
42
|
position: absolute;
|
|
40
43
|
left: 50%;
|
|
41
44
|
transform: translateX(-50%);
|
|
42
|
-
border-radius:
|
|
45
|
+
border-radius: var(--n-toolbar-border-radius);
|
|
43
46
|
height: 48px;
|
|
44
47
|
bottom: 40px;
|
|
45
48
|
padding: 0 12px;
|
|
46
|
-
background:
|
|
47
|
-
|
|
49
|
+
background: var(--n-toolbar-color);
|
|
50
|
+
box-shadow: var(--n-toolbar-box-shadow);
|
|
51
|
+
color: var(--n-toolbar-icon-color);
|
|
48
52
|
transition: color .3s var(--n-bezier);
|
|
49
53
|
display: flex;
|
|
50
54
|
align-items: center;
|
package/lib/image/styles/dark.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.imageDark = void 0;
|
|
4
|
+
const styles_1 = require("../../styles");
|
|
4
5
|
const common_1 = require("../../_styles/common");
|
|
5
6
|
exports.imageDark = {
|
|
6
7
|
name: 'Image',
|
|
7
8
|
common: common_1.commonDark,
|
|
9
|
+
peers: {
|
|
10
|
+
Tooltip: styles_1.tooltipDark
|
|
11
|
+
},
|
|
8
12
|
self: (vars) => {
|
|
9
13
|
const { textColor2 } = vars;
|
|
10
14
|
return {
|
|
11
|
-
|
|
15
|
+
toolbarIconColor: textColor2,
|
|
16
|
+
toolbarColor: 'rgba(0, 0, 0, .35)',
|
|
17
|
+
toolbarBoxShadow: 'none',
|
|
18
|
+
toolbarBorderRadius: '24px'
|
|
12
19
|
};
|
|
13
20
|
}
|
|
14
21
|
};
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
declare function self(): {
|
|
2
|
-
|
|
2
|
+
toolbarIconColor: string;
|
|
3
|
+
toolbarColor: string;
|
|
4
|
+
toolbarBoxShadow: string;
|
|
5
|
+
toolbarBorderRadius: string;
|
|
3
6
|
};
|
|
4
7
|
export declare const imageLight: import("../../_mixins").Theme<"Image", {
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
toolbarIconColor: string;
|
|
9
|
+
toolbarColor: string;
|
|
10
|
+
toolbarBoxShadow: string;
|
|
11
|
+
toolbarBorderRadius: string;
|
|
12
|
+
}, {
|
|
13
|
+
Tooltip: import("../../_mixins").Theme<"Tooltip", {
|
|
14
|
+
borderRadius: string;
|
|
15
|
+
boxShadow: string;
|
|
16
|
+
color: string;
|
|
17
|
+
textColor: string;
|
|
18
|
+
padding: string;
|
|
19
|
+
}, {
|
|
20
|
+
Popover: import("../../_mixins").Theme<"Popover", {
|
|
21
|
+
fontSize: string;
|
|
22
|
+
borderRadius: string;
|
|
23
|
+
color: string;
|
|
24
|
+
dividerColor: string;
|
|
25
|
+
textColor: string;
|
|
26
|
+
boxShadow: string;
|
|
27
|
+
space: string;
|
|
28
|
+
spaceArrow: string;
|
|
29
|
+
arrowOffset: string;
|
|
30
|
+
arrowOffsetVertical: string;
|
|
31
|
+
arrowHeight: string;
|
|
32
|
+
padding: string;
|
|
33
|
+
}, any>;
|
|
34
|
+
}>;
|
|
35
|
+
}>;
|
|
7
36
|
export declare type ImageTheme = typeof imageLight;
|
|
8
37
|
export declare type ImageThemeVars = ReturnType<typeof self>;
|
|
9
38
|
export {};
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.imageLight = void 0;
|
|
4
|
+
const styles_1 = require("../../tooltip/styles");
|
|
4
5
|
const _mixins_1 = require("../../_mixins");
|
|
5
6
|
const common_1 = require("../../_styles/common");
|
|
6
7
|
function self() {
|
|
7
8
|
return {
|
|
8
|
-
|
|
9
|
+
toolbarIconColor: 'rgba(255, 255, 255, .9)',
|
|
10
|
+
toolbarColor: 'rgba(0, 0, 0, .35)',
|
|
11
|
+
toolbarBoxShadow: 'none',
|
|
12
|
+
toolbarBorderRadius: '24px'
|
|
9
13
|
};
|
|
10
14
|
}
|
|
11
15
|
exports.imageLight = (0, _mixins_1.createTheme)({
|
|
12
16
|
name: 'Image',
|
|
13
17
|
common: common_1.commonLight,
|
|
18
|
+
peers: {
|
|
19
|
+
Tooltip: styles_1.tooltipLight
|
|
20
|
+
},
|
|
14
21
|
self
|
|
15
22
|
});
|
|
@@ -13,9 +13,9 @@ function parse(value) {
|
|
|
13
13
|
}
|
|
14
14
|
exports.parse = parse;
|
|
15
15
|
// can be parsed to number but shouldn't be applied when inputing
|
|
16
|
-
//
|
|
16
|
+
// when value includes `.`, ending with 0 and`.`, doesn't update, if 0 parse func will remove 0
|
|
17
17
|
function isWipValue(value) {
|
|
18
|
-
return /^(-)?\d+.*(\.|0)$/.test(value) || /^\.\d+$/.test(value);
|
|
18
|
+
return value.includes('.') && (/^(-)?\d+.*(\.|0)$/.test(value) || /^\.\d+$/.test(value));
|
|
19
19
|
}
|
|
20
20
|
exports.isWipValue = isWipValue;
|
|
21
21
|
// string => boolean (expected, not implemented)
|
|
@@ -98,6 +98,16 @@ const deDE = {
|
|
|
98
98
|
import: 'Importieren',
|
|
99
99
|
export: 'Exportieren',
|
|
100
100
|
restore: 'Auf Standard zurücksetzen'
|
|
101
|
+
},
|
|
102
|
+
// TODO: translation
|
|
103
|
+
Image: {
|
|
104
|
+
tipPrevious: 'Previous picture (←)',
|
|
105
|
+
tipNext: 'Next picture (→)',
|
|
106
|
+
tipCounterclockwise: 'Counterclockwise',
|
|
107
|
+
tipClockwise: 'Clockwise',
|
|
108
|
+
tipZoomOut: 'Zoom out',
|
|
109
|
+
tipZoomIn: 'Zoom in',
|
|
110
|
+
tipClose: 'Close (Esc)'
|
|
101
111
|
}
|
|
102
112
|
};
|
|
103
113
|
exports.default = deDE;
|
|
@@ -96,6 +96,15 @@ declare const enUS: {
|
|
|
96
96
|
export: string;
|
|
97
97
|
restore: string;
|
|
98
98
|
};
|
|
99
|
+
Image: {
|
|
100
|
+
tipPrevious: string;
|
|
101
|
+
tipNext: string;
|
|
102
|
+
tipCounterclockwise: string;
|
|
103
|
+
tipClockwise: string;
|
|
104
|
+
tipZoomOut: string;
|
|
105
|
+
tipZoomIn: string;
|
|
106
|
+
tipClose: string;
|
|
107
|
+
};
|
|
99
108
|
};
|
|
100
109
|
export declare type NLocale = typeof enUS;
|
|
101
110
|
export default enUS;
|