@oinone/kunlun-vue-ui-antd 6.2.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 -0
- package/dist/oinone-kunlun-vue-ui-antd.css +1 -0
- package/dist/oinone-kunlun-vue-ui-antd.esm.js +16 -0
- package/dist/oinone-kunlun-vue-ui-antd.scss +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/component/index.d.ts +31 -0
- package/dist/types/src/component/oio-block/index.d.ts +3 -0
- package/dist/types/src/component/oio-block/oio-block.vue.d.ts +39 -0
- package/dist/types/src/component/oio-block/oio-col.vue.d.ts +86 -0
- package/dist/types/src/component/oio-block/oio-row.vue.d.ts +34 -0
- package/dist/types/src/component/oio-breadcrumb/index.d.ts +2 -0
- package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb-item.vue.d.ts +14 -0
- package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb.vue.d.ts +14 -0
- package/dist/types/src/component/oio-button/index.d.ts +1 -0
- package/dist/types/src/component/oio-button/oio-button.vue.d.ts +136 -0
- package/dist/types/src/component/oio-cascader/index.d.ts +1 -0
- package/dist/types/src/component/oio-cascader/oio-cascader.vue.d.ts +236 -0
- package/dist/types/src/component/oio-checkbox/index.d.ts +1 -0
- package/dist/types/src/component/oio-checkbox/oio-checkbox.vue.d.ts +56 -0
- package/dist/types/src/component/oio-collapse/index.d.ts +2 -0
- package/dist/types/src/component/oio-collapse/oio-collapse-panel.vue.d.ts +86 -0
- package/dist/types/src/component/oio-collapse/oio-collapse.vue.d.ts +103 -0
- package/dist/types/src/component/oio-date-time-picker/index.d.ts +5 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-picker.vue.d.ts +182 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-time-picker.vue.d.ts +240 -0
- package/dist/types/src/component/oio-date-time-picker/oio-time-picker.vue.d.ts +176 -0
- package/dist/types/src/component/oio-date-time-picker/oio-year-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-picker/use-date-time-picker-props.d.ts +15 -0
- package/dist/types/src/component/oio-date-time-range-picker/index.d.ts +5 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-date-range-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue.d.ts +195 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-time-range-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-year-range-picker.vue.d.ts +124 -0
- package/dist/types/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.d.ts +12 -0
- package/dist/types/src/component/oio-divider/index.d.ts +2 -0
- package/dist/types/src/component/oio-divider/oio-divider.vue.d.ts +38 -0
- package/dist/types/src/component/oio-drawer/index.d.ts +1 -0
- package/dist/types/src/component/oio-drawer/oio-drawer.vue.d.ts +227 -0
- package/dist/types/src/component/oio-dropdown/index.d.ts +1 -0
- package/dist/types/src/component/oio-dropdown/oio-dropdown.vue.d.ts +78 -0
- package/dist/types/src/component/oio-empty/index.d.ts +1 -0
- package/dist/types/src/component/oio-empty/oio-empty-data.vue.d.ts +42 -0
- package/dist/types/src/component/oio-form/index.d.ts +2 -0
- package/dist/types/src/component/oio-form/oio-form-item.vue.d.ts +126 -0
- package/dist/types/src/component/oio-form/oio-form.vue.d.ts +100 -0
- package/dist/types/src/component/oio-gallery/index.d.ts +1 -0
- package/dist/types/src/component/oio-gallery/oio-gallery.vue.d.ts +98 -0
- package/dist/types/src/component/oio-group/index.d.ts +2 -0
- package/dist/types/src/component/oio-group/oio-group-help.vue.d.ts +65 -0
- package/dist/types/src/component/oio-group/oio-group.vue.d.ts +113 -0
- package/dist/types/src/component/oio-inner-popup/index.d.ts +1 -0
- package/dist/types/src/component/oio-inner-popup/oio-inner-popup.vue.d.ts +195 -0
- package/dist/types/src/component/oio-input/index.d.ts +5 -0
- package/dist/types/src/component/oio-input/oio-input-group.vue.d.ts +16 -0
- package/dist/types/src/component/oio-input/oio-input-number.vue.d.ts +167 -0
- package/dist/types/src/component/oio-input/oio-input-password.vue.d.ts +111 -0
- package/dist/types/src/component/oio-input/oio-input-search.vue.d.ts +106 -0
- package/dist/types/src/component/oio-input/oio-input.vue.d.ts +107 -0
- package/dist/types/src/component/oio-modal/index.d.ts +1 -0
- package/dist/types/src/component/oio-modal/oio-modal.vue.d.ts +230 -0
- package/dist/types/src/component/oio-notification/index.d.ts +116 -0
- package/dist/types/src/component/oio-pagination/index.d.ts +1 -0
- package/dist/types/src/component/oio-pagination/oio-pagination.vue.d.ts +107 -0
- package/dist/types/src/component/oio-popconfirm/index.d.ts +1 -0
- package/dist/types/src/component/oio-popconfirm/oio-popconfirm.vue.d.ts +119 -0
- package/dist/types/src/component/oio-select/index.d.ts +1 -0
- package/dist/types/src/component/oio-select/oio-select.vue.d.ts +153 -0
- package/dist/types/src/component/oio-slider/index.d.ts +1 -0
- package/dist/types/src/component/oio-slider/oio-slider.vue.d.ts +155 -0
- package/dist/types/src/component/oio-spin/index.d.ts +1 -0
- package/dist/types/src/component/oio-spin/oio-spin.vue.d.ts +54 -0
- package/dist/types/src/component/oio-switch/index.d.ts +1 -0
- package/dist/types/src/component/oio-switch/oio-switch.vue.d.ts +92 -0
- package/dist/types/src/component/oio-tabs/index.d.ts +3 -0
- package/dist/types/src/component/oio-tabs/oio-tab.vue.d.ts +67 -0
- package/dist/types/src/component/oio-tabs/oio-tabs.vue.d.ts +93 -0
- package/dist/types/src/component/oio-tabs/use-tab-bar.d.ts +5 -0
- package/dist/types/src/component/oio-textarea/index.d.ts +1 -0
- package/dist/types/src/component/oio-textarea/oio-textarea.vue.d.ts +100 -0
- package/dist/types/src/component/oio-tooltip/index.d.ts +2 -0
- package/dist/types/src/component/oio-tooltip/oio-tooltip-help.vue.d.ts +12 -0
- package/dist/types/src/component/oio-tooltip/oio-tooltip.vue.d.ts +76 -0
- package/dist/types/src/component/oio-tree/index.d.ts +1 -0
- package/dist/types/src/component/oio-tree/oio-tree.vue.d.ts +171 -0
- package/dist/types/src/component/oio-tree-select/index.d.ts +1 -0
- package/dist/types/src/component/oio-tree-select/oio-tree-select.vue.d.ts +226 -0
- package/dist/types/src/component/oio-upload/index.d.ts +1 -0
- package/dist/types/src/component/oio-upload/oio-upload.vue.d.ts +187 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/theme/index.d.ts +1 -0
- package/dist/types/src/vc-component/index.d.ts +1 -0
- package/dist/types/src/vc-component/use-max-tag-placeholder.d.ts +7 -0
- package/index.ts +3 -0
- package/package.json +36 -0
- package/rollup.config.js +15 -0
- package/src/component/index.ts +32 -0
- package/src/component/oio-block/index.ts +3 -0
- package/src/component/oio-block/oio-block.vue +77 -0
- package/src/component/oio-block/oio-col.vue +32 -0
- package/src/component/oio-block/oio-row.vue +42 -0
- package/src/component/oio-block/style/a-col.scss +18 -0
- package/src/component/oio-block/style/index.scss +42 -0
- package/src/component/oio-block/style/parameters.scss +13 -0
- package/src/component/oio-breadcrumb/index.ts +2 -0
- package/src/component/oio-breadcrumb/oio-breadcrumb-item.vue +30 -0
- package/src/component/oio-breadcrumb/oio-breadcrumb.vue +30 -0
- package/src/component/oio-button/index.ts +1 -0
- package/src/component/oio-button/oio-button.vue +154 -0
- package/src/component/oio-button/style/a-button.scss +210 -0
- package/src/component/oio-button/style/index.scss +21 -0
- package/src/component/oio-button/style/parameters.scss +5 -0
- package/src/component/oio-cascader/index.ts +1 -0
- package/src/component/oio-cascader/oio-cascader.vue +171 -0
- package/src/component/oio-cascader/style/index.scss +59 -0
- package/src/component/oio-cascader/style/parameters.scss +5 -0
- package/src/component/oio-checkbox/index.ts +1 -0
- package/src/component/oio-checkbox/oio-checkbox.vue +69 -0
- package/src/component/oio-checkbox/style/index.scss +8 -0
- package/src/component/oio-checkbox/style/parameters.scss +5 -0
- package/src/component/oio-collapse/index.ts +2 -0
- package/src/component/oio-collapse/oio-collapse-panel.vue +92 -0
- package/src/component/oio-collapse/oio-collapse.vue +138 -0
- package/src/component/oio-collapse/style/index.scss +59 -0
- package/src/component/oio-collapse/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/index.ts +5 -0
- package/src/component/oio-date-time-picker/oio-date-picker.vue +34 -0
- package/src/component/oio-date-time-picker/oio-date-time-picker.vue +91 -0
- package/src/component/oio-date-time-picker/oio-time-picker.vue +34 -0
- package/src/component/oio-date-time-picker/oio-year-picker.vue +34 -0
- package/src/component/oio-date-time-picker/style/index.scss +348 -0
- package/src/component/oio-date-time-picker/style/mixin.scss +16 -0
- package/src/component/oio-date-time-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/use-date-time-picker-props.ts +151 -0
- package/src/component/oio-date-time-range-picker/index.ts +5 -0
- package/src/component/oio-date-time-range-picker/oio-date-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue +82 -0
- package/src/component/oio-date-time-range-picker/oio-time-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/oio-year-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/style/index.scss +227 -0
- package/src/component/oio-date-time-range-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.ts +138 -0
- package/src/component/oio-divider/index.ts +3 -0
- package/src/component/oio-divider/oio-divider.vue +31 -0
- package/src/component/oio-divider/style/index.scss +7 -0
- package/src/component/oio-divider/style/parameters.scss +5 -0
- package/src/component/oio-drawer/index.ts +1 -0
- package/src/component/oio-drawer/oio-drawer.vue +120 -0
- package/src/component/oio-drawer/style/index.scss +93 -0
- package/src/component/oio-drawer/style/parameters.scss +5 -0
- package/src/component/oio-dropdown/index.ts +1 -0
- package/src/component/oio-dropdown/oio-dropdown.vue +81 -0
- package/src/component/oio-dropdown/style/index.scss +30 -0
- package/src/component/oio-dropdown/style/parameters.scss +5 -0
- package/src/component/oio-empty/index.ts +1 -0
- package/src/component/oio-empty/oio-empty-data.vue +47 -0
- package/src/component/oio-empty/style/index.scss +6 -0
- package/src/component/oio-form/index.ts +2 -0
- package/src/component/oio-form/oio-form-item.vue +81 -0
- package/src/component/oio-form/oio-form.vue +102 -0
- package/src/component/oio-form/style/animation.scss +17 -0
- package/src/component/oio-form/style/index.scss +135 -0
- package/src/component/oio-form/style/parameters.scss +9 -0
- package/src/component/oio-gallery/index.ts +1 -0
- package/src/component/oio-gallery/oio-gallery.vue +158 -0
- package/src/component/oio-group/index.ts +2 -0
- package/src/component/oio-group/oio-group-help.vue +28 -0
- package/src/component/oio-group/oio-group.vue +140 -0
- package/src/component/oio-group/style/index.scss +98 -0
- package/src/component/oio-group/style/parameters.scss +5 -0
- package/src/component/oio-inner-popup/index.ts +1 -0
- package/src/component/oio-inner-popup/oio-inner-popup.vue +230 -0
- package/src/component/oio-inner-popup/style/index.scss +147 -0
- package/src/component/oio-inner-popup/style/parameters.scss +5 -0
- package/src/component/oio-input/index.ts +5 -0
- package/src/component/oio-input/oio-input-group.vue +40 -0
- package/src/component/oio-input/oio-input-number.vue +374 -0
- package/src/component/oio-input/oio-input-password.vue +67 -0
- package/src/component/oio-input/oio-input-search.vue +107 -0
- package/src/component/oio-input/oio-input.vue +124 -0
- package/src/component/oio-input/style/a-input.scss +103 -0
- package/src/component/oio-input/style/index.scss +198 -0
- package/src/component/oio-input/style/mixin.scss +50 -0
- package/src/component/oio-input/style/oio-input-group.scss +31 -0
- package/src/component/oio-input/style/oio-input-number.scss +13 -0
- package/src/component/oio-input/style/oio-input-search.scss +94 -0
- package/src/component/oio-input/style/parameters.scss +21 -0
- package/src/component/oio-modal/index.ts +1 -0
- package/src/component/oio-modal/index.zh-CN.md +167 -0
- package/src/component/oio-modal/oio-modal.vue +184 -0
- package/src/component/oio-modal/style/index.scss +167 -0
- package/src/component/oio-modal/style/parameters.scss +5 -0
- package/src/component/oio-notification/index.ts +197 -0
- package/src/component/oio-notification/style/index.scss +67 -0
- package/src/component/oio-notification/style/parameters.scss +5 -0
- package/src/component/oio-pagination/index.ts +1 -0
- package/src/component/oio-pagination/oio-pagination.vue +105 -0
- package/src/component/oio-pagination/style/index.scss +181 -0
- package/src/component/oio-pagination/style/parameters.scss +5 -0
- package/src/component/oio-popconfirm/index.ts +1 -0
- package/src/component/oio-popconfirm/oio-popconfirm.vue +192 -0
- package/src/component/oio-popconfirm/style/index.scss +54 -0
- package/src/component/oio-popconfirm/style/parameters.scss +5 -0
- package/src/component/oio-popover/style/index.scss +16 -0
- package/src/component/oio-popover/style/parameters.scss +5 -0
- package/src/component/oio-radio/style/index.scss +24 -0
- package/src/component/oio-radio/style/parameters.scss +5 -0
- package/src/component/oio-select/index.ts +1 -0
- package/src/component/oio-select/oio-select.vue +104 -0
- package/src/component/oio-select/style/a-select.scss +102 -0
- package/src/component/oio-select/style/index.scss +129 -0
- package/src/component/oio-select/style/mixin.scss +18 -0
- package/src/component/oio-select/style/parameters.scss +5 -0
- package/src/component/oio-slider/index.ts +1 -0
- package/src/component/oio-slider/oio-slider.vue +81 -0
- package/src/component/oio-slider/style/index.scss +100 -0
- package/src/component/oio-slider/style/parameters.scss +5 -0
- package/src/component/oio-spin/index.ts +1 -0
- package/src/component/oio-spin/oio-spin.vue +87 -0
- package/src/component/oio-spin/style/index.scss +48 -0
- package/src/component/oio-spin/style/parameters.scss +5 -0
- package/src/component/oio-switch/index.ts +1 -0
- package/src/component/oio-switch/oio-switch.vue +42 -0
- package/src/component/oio-switch/style/index.scss +36 -0
- package/src/component/oio-switch/style/parameters.scss +5 -0
- package/src/component/oio-tabs/index.ts +3 -0
- package/src/component/oio-tabs/oio-tab.vue +99 -0
- package/src/component/oio-tabs/oio-tabs.vue +188 -0
- package/src/component/oio-tabs/style/index.scss +274 -0
- package/src/component/oio-tabs/style/parameters.scss +9 -0
- package/src/component/oio-tabs/use-tab-bar.ts +69 -0
- package/src/component/oio-textarea/index.ts +1 -0
- package/src/component/oio-textarea/oio-textarea.vue +76 -0
- package/src/component/oio-textarea/style/index.scss +108 -0
- package/src/component/oio-textarea/style/parameters.scss +5 -0
- package/src/component/oio-tooltip/index.ts +2 -0
- package/src/component/oio-tooltip/oio-tooltip-help.vue +40 -0
- package/src/component/oio-tooltip/oio-tooltip.vue +59 -0
- package/src/component/oio-tooltip/style/index.scss +8 -0
- package/src/component/oio-tooltip/style/parameters.scss +9 -0
- package/src/component/oio-tree/index.ts +1 -0
- package/src/component/oio-tree/oio-tree.vue +181 -0
- package/src/component/oio-tree/style/index.scss +51 -0
- package/src/component/oio-tree/style/parameters.scss +5 -0
- package/src/component/oio-tree-select/index.ts +1 -0
- package/src/component/oio-tree-select/oio-tree-select.vue +180 -0
- package/src/component/oio-tree-select/style/index.scss +92 -0
- package/src/component/oio-tree-select/style/parameters.scss +5 -0
- package/src/component/oio-upload/index.ts +1 -0
- package/src/component/oio-upload/oio-upload.vue +232 -0
- package/src/component/oio-upload/style/index.scss +66 -0
- package/src/component/oio-upload/style/parameters.scss +5 -0
- package/src/index.ts +3 -0
- package/src/shim-translate.d.ts +7 -0
- package/src/shim-vue.d.ts +6 -0
- package/src/style/global-parameters.scss +9 -0
- package/src/style/index.scss +31 -0
- package/src/style/mixin.scss +135 -0
- package/src/theme/index.ts +1 -0
- package/src/vc-component/index.ts +1 -0
- package/src/vc-component/use-max-tag-placeholder.ts +38 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, StringHelper, uniqueKeyGenerator } from '@oinone/kunlun-shared';
|
|
3
|
+
import {
|
|
4
|
+
OioCloseIcon,
|
|
5
|
+
OioModalProps,
|
|
6
|
+
PropRecordHelper,
|
|
7
|
+
StyleHelper,
|
|
8
|
+
useDraggable,
|
|
9
|
+
useModal
|
|
10
|
+
} from '@oinone/kunlun-vue-ui-common';
|
|
11
|
+
import { Modal as AModal } from 'ant-design-vue';
|
|
12
|
+
import { isBoolean } from 'lodash-es';
|
|
13
|
+
import { computed, createVNode, defineComponent, nextTick, ref, watch } from 'vue';
|
|
14
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
15
|
+
import { OioButton } from '../oio-button';
|
|
16
|
+
import { OioSpin } from '../oio-spin';
|
|
17
|
+
import { OioTooltip, OioTooltipHelp } from '../oio-tooltip';
|
|
18
|
+
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: 'OioModal',
|
|
21
|
+
components: {
|
|
22
|
+
AModal,
|
|
23
|
+
OioButton,
|
|
24
|
+
OioSpin,
|
|
25
|
+
OioTooltip
|
|
26
|
+
},
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: {
|
|
29
|
+
...OioModalProps
|
|
30
|
+
},
|
|
31
|
+
slots: ['default', 'title', 'header', 'footer', 'closeIcon'],
|
|
32
|
+
emits: ['update:visible'],
|
|
33
|
+
setup(props, context) {
|
|
34
|
+
const internalId = `${DEFAULT_PREFIX}-modal-${uniqueKeyGenerator()}`;
|
|
35
|
+
|
|
36
|
+
const modalRef = ref<HTMLElement | undefined>();
|
|
37
|
+
const dragHandleRef = ref<HTMLElement | undefined>();
|
|
38
|
+
const draggable = computed(() => props.draggable || false);
|
|
39
|
+
|
|
40
|
+
useDraggable(modalRef, dragHandleRef, draggable);
|
|
41
|
+
|
|
42
|
+
const id = computed<string>(() => {
|
|
43
|
+
return props.wrapperProps?.id || internalId;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
watch(
|
|
47
|
+
() => props.visible,
|
|
48
|
+
(val) => {
|
|
49
|
+
if (val) {
|
|
50
|
+
nextTick(() => {
|
|
51
|
+
const modalDom = document.getElementById(id.value)?.firstElementChild;
|
|
52
|
+
if (!modalDom) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let dragHandleDom: Element | undefined;
|
|
56
|
+
if (props.headerInvisible) {
|
|
57
|
+
[dragHandleDom] = modalDom.getElementsByClassName('ant-modal-body');
|
|
58
|
+
} else {
|
|
59
|
+
[dragHandleDom] = modalDom.getElementsByClassName('ant-modal-header');
|
|
60
|
+
}
|
|
61
|
+
if (!dragHandleDom) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
dragHandleRef.value = dragHandleDom as HTMLElement;
|
|
65
|
+
modalRef.value = modalDom as HTMLElement;
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
modalRef.value = undefined;
|
|
69
|
+
dragHandleRef.value = undefined;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{ immediate: true }
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
...useModal(props, context),
|
|
77
|
+
id
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
render() {
|
|
81
|
+
const slots = PropRecordHelper.collectionSlots(this.$slots, [
|
|
82
|
+
{
|
|
83
|
+
origin: 'default',
|
|
84
|
+
isNotNull: true
|
|
85
|
+
},
|
|
86
|
+
'title',
|
|
87
|
+
'header',
|
|
88
|
+
'footer',
|
|
89
|
+
'closeIcon'
|
|
90
|
+
]);
|
|
91
|
+
let defaultSlot = slots.default;
|
|
92
|
+
const finalDefaultSlot = defaultSlot({ data: this.data });
|
|
93
|
+
if (isBoolean(this.loading)) {
|
|
94
|
+
defaultSlot = () => [
|
|
95
|
+
createVNode(
|
|
96
|
+
OioSpin,
|
|
97
|
+
{
|
|
98
|
+
loading: this.loading
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
default: () => finalDefaultSlot
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
];
|
|
105
|
+
} else {
|
|
106
|
+
defaultSlot = () => finalDefaultSlot;
|
|
107
|
+
}
|
|
108
|
+
const isOverrideTitle = !!slots.header;
|
|
109
|
+
if (!isOverrideTitle) {
|
|
110
|
+
let titleSlot = slots.title;
|
|
111
|
+
if (!titleSlot) {
|
|
112
|
+
titleSlot = () => {
|
|
113
|
+
const title = this.title || OioModalProps.title.default;
|
|
114
|
+
return [createVNode('span', {}, this.$translate(title))];
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (this.help) {
|
|
118
|
+
const titleChildren = titleSlot();
|
|
119
|
+
titleSlot = () => {
|
|
120
|
+
return [createVNode('span', {}, titleChildren), createVNode(OioTooltipHelp, { content: this.help })];
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
slots.title = titleSlot;
|
|
124
|
+
}
|
|
125
|
+
if (!slots.closeIcon) {
|
|
126
|
+
slots.closeIcon = () => [createVNode(OioCloseIcon)];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const mainClassName = `${DEFAULT_PREFIX}-modal`;
|
|
130
|
+
const classNames = [mainClassName];
|
|
131
|
+
if (this.widthClassSuffix) {
|
|
132
|
+
classNames.push(`${mainClassName}-width-${this.widthClassSuffix}`);
|
|
133
|
+
}
|
|
134
|
+
if (this.heightClassSuffix) {
|
|
135
|
+
classNames.push(`${mainClassName}-height-${this.heightClassSuffix}`);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (this.customHeightClassSuffix) {
|
|
139
|
+
classNames.push(`${mainClassName}-height-${this.customHeightClassSuffix}`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (this.headerInvisible) {
|
|
143
|
+
classNames.push(`${mainClassName}-header-invisible`);
|
|
144
|
+
}
|
|
145
|
+
if (this.footerInvisible) {
|
|
146
|
+
classNames.push(`${mainClassName}-footer-invisible`);
|
|
147
|
+
}
|
|
148
|
+
return createVNode(
|
|
149
|
+
AModal,
|
|
150
|
+
{
|
|
151
|
+
...PropRecordHelper.collectionBasicProps(this.$attrs, classNames),
|
|
152
|
+
mask: this.mask,
|
|
153
|
+
maskClosable: this.headerInvisible ? true : this.maskClosable,
|
|
154
|
+
width: StyleHelper.px(this.width),
|
|
155
|
+
wrapClassName: StringHelper.append([`${mainClassName}-wrapper`], CastHelper.cast(this.wrapperClassName)).join(
|
|
156
|
+
' '
|
|
157
|
+
),
|
|
158
|
+
style: {
|
|
159
|
+
[`--${mainClassName}-custom-height`]: this.heightPx
|
|
160
|
+
},
|
|
161
|
+
wrapProps: {
|
|
162
|
+
...(this.wrapperProps || {}),
|
|
163
|
+
id: this.id
|
|
164
|
+
},
|
|
165
|
+
zIndex: this.zIndex,
|
|
166
|
+
okText: this.$translate(this.enterText),
|
|
167
|
+
cancelText: this.$translate(this.cancelText),
|
|
168
|
+
visible: this.visible,
|
|
169
|
+
closable: this.closable,
|
|
170
|
+
keyboard: this.keyboard,
|
|
171
|
+
destroyOnClose: this.destroyOnClose,
|
|
172
|
+
getContainer: this.getTriggerContainer,
|
|
173
|
+
confirmLoading: this.confirmLoading,
|
|
174
|
+
onOk: this.enter,
|
|
175
|
+
onCancel: this.cancel
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
...slots,
|
|
179
|
+
default: defaultSlot
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
</script>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import '../../../style/global-parameters';
|
|
3
|
+
@import './parameters.scss';
|
|
4
|
+
|
|
5
|
+
.#{$modalClassPrefix} {
|
|
6
|
+
padding: 0;
|
|
7
|
+
&.#{$modalClassPrefix}-width-small {
|
|
8
|
+
width: var($modalParameterPrefix + -width-small) !important;
|
|
9
|
+
}
|
|
10
|
+
&.#{$modalClassPrefix}-width-medium {
|
|
11
|
+
width: var($modalParameterPrefix + -width-medium) !important;
|
|
12
|
+
}
|
|
13
|
+
&.#{$modalClassPrefix}-width-large {
|
|
14
|
+
width: var($modalParameterPrefix + -width-large) !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.#{$modalClassPrefix}-width-full {
|
|
18
|
+
width: 100% !important;
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
&.ant-modal {
|
|
21
|
+
margin: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.#{$modalClassPrefix}-height-small {
|
|
26
|
+
.ant-modal-content {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
height: var($modalParameterPrefix + -height-small) !important;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
&.#{$modalClassPrefix}-height-medium {
|
|
34
|
+
.ant-modal-content {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
height: var($modalParameterPrefix + -height-medium) !important;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
&.#{$modalClassPrefix}-height-large {
|
|
42
|
+
.ant-modal-content {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
height: var($modalParameterPrefix + -height-large) !important;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.#{$modalClassPrefix}-height-custom {
|
|
51
|
+
.ant-modal-content {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
height: var(--oio-modal-custom-height) !important;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.#{$modalClassPrefix}-height-full {
|
|
60
|
+
&.ant-modal {
|
|
61
|
+
top: 0;
|
|
62
|
+
padding-bottom: 0;
|
|
63
|
+
margin: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ant-modal-content {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
height: calc(100vh);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ant-modal-body {
|
|
74
|
+
flex: 1;
|
|
75
|
+
overflow: auto;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&-wrapper {
|
|
79
|
+
@include oio-scrollbar();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&-header-invisible {
|
|
83
|
+
.ant-modal-content {
|
|
84
|
+
& > .ant-modal-close,
|
|
85
|
+
& > .ant-modal-header {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&-footer-invisible {
|
|
92
|
+
.ant-modal-content > .ant-modal-footer {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ant-modal-content {
|
|
98
|
+
background: var($parameterPrefix + -background);
|
|
99
|
+
border: 1px solid var($parameterPrefix + -border-color);
|
|
100
|
+
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.2);
|
|
101
|
+
border-radius: var($parameterPrefix + -border-radius);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ant-modal-close-x {
|
|
105
|
+
color: var($parameterPrefix + -text-color);
|
|
106
|
+
height: 49px;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ant-modal-header {
|
|
113
|
+
padding: 16px;
|
|
114
|
+
border-bottom: 1px solid var($parameterPrefix + -border-color);
|
|
115
|
+
background-color: var($parameterPrefix + -background);
|
|
116
|
+
|
|
117
|
+
.ant-modal-title {
|
|
118
|
+
opacity: 0.85;
|
|
119
|
+
font-size: var($parameterPrefix + -font-size-lg);
|
|
120
|
+
color: var($parameterPrefix + -text-color);
|
|
121
|
+
line-height: 24px;
|
|
122
|
+
font-weight: var($parameterPrefix + -font-weight-bold);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ant-modal-confirm-title,
|
|
127
|
+
.ant-modal-confirm-content {
|
|
128
|
+
color: var($modalParameterPrefix + -color);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ant-modal-body {
|
|
132
|
+
padding: var($parameterPrefix + -margin-md);
|
|
133
|
+
@include oio-scrollbar();
|
|
134
|
+
|
|
135
|
+
.ant-modal-confirm-body-wrapper {
|
|
136
|
+
.ant-modal-confirm-btns {
|
|
137
|
+
button {
|
|
138
|
+
@import '../../oio-button/style/a-button.scss';
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ant-modal-footer {
|
|
145
|
+
padding: var($parameterPrefix + -margin-md);
|
|
146
|
+
border-top: 1px solid var($parameterPrefix + -border-color);
|
|
147
|
+
overflow: auto hidden;
|
|
148
|
+
@include oio-scrollbar();
|
|
149
|
+
|
|
150
|
+
button {
|
|
151
|
+
@import '../../oio-button/style/a-button.scss';
|
|
152
|
+
|
|
153
|
+
&.ant-btn {
|
|
154
|
+
height: var($parameterPrefix + -height);
|
|
155
|
+
margin: var($parameterPrefix + -margin-xxs) 0 var($parameterPrefix + -margin-xxs)
|
|
156
|
+
var($parameterPrefix + -margin-md);
|
|
157
|
+
|
|
158
|
+
& + .ant-btn {
|
|
159
|
+
margin-left: var($parameterPrefix + -margin-md);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
.ant-modal-confirm-btns .ant-btn + .ant-btn {
|
|
165
|
+
margin-left: 12px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { StringHelper } from '@oinone/kunlun-shared';
|
|
2
|
+
import { OioCloseIcon, OioIcon, OioNotificationOptions } from '@oinone/kunlun-vue-ui-common';
|
|
3
|
+
import { message as AMessage, notification as ANotification } from 'ant-design-vue';
|
|
4
|
+
import { createVNode } from 'vue';
|
|
5
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 通知类型
|
|
9
|
+
*/
|
|
10
|
+
export enum NotificationType {
|
|
11
|
+
/**
|
|
12
|
+
* 提示
|
|
13
|
+
*/
|
|
14
|
+
info = 'info',
|
|
15
|
+
/**
|
|
16
|
+
* 成功
|
|
17
|
+
*/
|
|
18
|
+
success = 'success',
|
|
19
|
+
/**
|
|
20
|
+
* 警告
|
|
21
|
+
*/
|
|
22
|
+
warning = 'warning',
|
|
23
|
+
/**
|
|
24
|
+
* 错误
|
|
25
|
+
*/
|
|
26
|
+
error = 'error'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const getIconVNode = (icon: string, color: string, size = '21') =>
|
|
30
|
+
createVNode(OioIcon, {
|
|
31
|
+
icon,
|
|
32
|
+
size,
|
|
33
|
+
color
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const genNotificationIcon = (type: NotificationType, size = '21') => {
|
|
37
|
+
switch (type) {
|
|
38
|
+
case NotificationType.error:
|
|
39
|
+
return getIconVNode('oinone-cuowu1', 'var(--oio-notification-error)', size);
|
|
40
|
+
case NotificationType.info:
|
|
41
|
+
return getIconVNode('oinone-tishi', 'var(--oio-notification-info)', size);
|
|
42
|
+
|
|
43
|
+
case NotificationType.success:
|
|
44
|
+
return getIconVNode('oinone-chenggong1', 'var(--oio-notification-success)', size);
|
|
45
|
+
|
|
46
|
+
case NotificationType.warning:
|
|
47
|
+
return getIconVNode('oinone-jinggao', 'var(--oio-notification-warning)', size);
|
|
48
|
+
|
|
49
|
+
default:
|
|
50
|
+
return '';
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 消息提示
|
|
56
|
+
*/
|
|
57
|
+
class Message {
|
|
58
|
+
/**
|
|
59
|
+
* 根据指定类型打开相应的消息提示框
|
|
60
|
+
* @param type 通知类型
|
|
61
|
+
* @param message 消息内容
|
|
62
|
+
* @param options 可选项
|
|
63
|
+
*/
|
|
64
|
+
public open(type: NotificationType, message: string, options?: OioNotificationOptions) {
|
|
65
|
+
AMessage[type]({
|
|
66
|
+
...(options || {}),
|
|
67
|
+
content: message,
|
|
68
|
+
icon: genNotificationIcon(type, '16'),
|
|
69
|
+
duration: options?.duration || 3,
|
|
70
|
+
class: StringHelper.append([`${DEFAULT_PREFIX}-message ${DEFAULT_PREFIX}-message-${type}`], options?.class).join(
|
|
71
|
+
' '
|
|
72
|
+
)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 打开【提示】类型的消息提示框 {@link NotificationType.info}
|
|
78
|
+
* @param message 消息内容
|
|
79
|
+
* @param options 可选项
|
|
80
|
+
*/
|
|
81
|
+
public info(message: string, options?: OioNotificationOptions) {
|
|
82
|
+
this.open(NotificationType.info, message, options);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 打开【成功】类型的消息提示框 {@link NotificationType.success}
|
|
87
|
+
* @param message 消息内容
|
|
88
|
+
* @param options 可选项
|
|
89
|
+
*/
|
|
90
|
+
public success(message: string, options?: OioNotificationOptions) {
|
|
91
|
+
this.open(NotificationType.success, message, options);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 打开【警告】类型的消息提示框 {@link NotificationType.warning}
|
|
96
|
+
* @param message 消息内容
|
|
97
|
+
* @param options 可选项
|
|
98
|
+
*/
|
|
99
|
+
public warning(message: string, options?: OioNotificationOptions) {
|
|
100
|
+
this.open(NotificationType.warning, message, options);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 打开【错误】类型的消息提示框 {@link NotificationType.error}
|
|
105
|
+
* @param message 消息内容
|
|
106
|
+
* @param options 可选项
|
|
107
|
+
*/
|
|
108
|
+
public error(message: string, options?: OioNotificationOptions) {
|
|
109
|
+
this.open(NotificationType.error, message, options);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 消息通知
|
|
115
|
+
*/
|
|
116
|
+
class Notification {
|
|
117
|
+
/**
|
|
118
|
+
* 根据指定类型打开相应的消息通知框
|
|
119
|
+
* @param type 通知类型
|
|
120
|
+
* @param title 消息标题
|
|
121
|
+
* @param message 消息内容
|
|
122
|
+
* @param options 可选项
|
|
123
|
+
*/
|
|
124
|
+
public open(type: NotificationType, title: string, message?: string, options?: OioNotificationOptions) {
|
|
125
|
+
ANotification[type]({
|
|
126
|
+
...(options || {}),
|
|
127
|
+
message: title ? createVNode('div', { class: `${DEFAULT_PREFIX}-notification-message-title` }, title) : '',
|
|
128
|
+
description: message,
|
|
129
|
+
icon: genNotificationIcon(type),
|
|
130
|
+
closeIcon: createVNode(OioCloseIcon, { volume: '16', size: '6' }),
|
|
131
|
+
class: StringHelper.append(
|
|
132
|
+
[`${DEFAULT_PREFIX}-notification ${DEFAULT_PREFIX}-notification-${type}`],
|
|
133
|
+
options?.class
|
|
134
|
+
).join(' ')
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 打开【提示】类型的消息通知框 {@link NotificationType.info}
|
|
140
|
+
* @param title 消息标题
|
|
141
|
+
* @param message 消息内容
|
|
142
|
+
* @param options 可选项
|
|
143
|
+
*/
|
|
144
|
+
public info(title: string, message?: string, options?: OioNotificationOptions) {
|
|
145
|
+
this.open(NotificationType.info, title, message, options);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* 打开【成功】类型的消息通知框 {@link NotificationType.success}
|
|
150
|
+
* @param title 消息标题
|
|
151
|
+
* @param message 消息内容
|
|
152
|
+
* @param options 可选项
|
|
153
|
+
*/
|
|
154
|
+
public success(title: string, message?: string, options?: OioNotificationOptions) {
|
|
155
|
+
this.open(NotificationType.success, title, message, options);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* 打开【警告】类型的消息通知框 {@link NotificationType.warning}
|
|
160
|
+
* @param title 消息标题
|
|
161
|
+
* @param message 消息内容
|
|
162
|
+
* @param options 可选项
|
|
163
|
+
*/
|
|
164
|
+
public warning(title: string, message?: string, options?: OioNotificationOptions) {
|
|
165
|
+
this.open(NotificationType.warning, title, message, options);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 打开【错误】类型的消息通知框 {@link NotificationType.error}
|
|
170
|
+
* @param title 消息标题
|
|
171
|
+
* @param message 消息内容
|
|
172
|
+
* @param options 可选项
|
|
173
|
+
*/
|
|
174
|
+
public error(title: string, message?: string, options?: OioNotificationOptions) {
|
|
175
|
+
this.open(NotificationType.error, title, message, options);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 消息提示
|
|
181
|
+
*/
|
|
182
|
+
export const OioMessage = new Message();
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* 消息通知
|
|
186
|
+
*/
|
|
187
|
+
export const OioNotification = new Notification();
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @deprecated 请使用{@link OioMessage}
|
|
191
|
+
*/
|
|
192
|
+
export const message = OioMessage;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @deprecated 请使用{@link OioNotification}
|
|
196
|
+
*/
|
|
197
|
+
export const notification = OioNotification;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
|
|
3
|
+
.ant-notification {
|
|
4
|
+
z-index: 99999;
|
|
5
|
+
|
|
6
|
+
.ant-notification-notice {
|
|
7
|
+
padding: 20px 20px 20px 25px;
|
|
8
|
+
line-height: normal;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
box-shadow: var(--oio-box-shadow);
|
|
11
|
+
background: var(--oio-background);
|
|
12
|
+
|
|
13
|
+
.ant-notification-notice-icon {
|
|
14
|
+
margin-left: 0;
|
|
15
|
+
top: 16px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.ant-notification-notice-with-icon {
|
|
19
|
+
.ant-notification-notice-message {
|
|
20
|
+
color: var(--oio-text-color);
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
|
|
24
|
+
.oio-notification-message-title {
|
|
25
|
+
margin-bottom: 5px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.ant-notification-notice-description {
|
|
29
|
+
margin-top: 3px;
|
|
30
|
+
color: var(--oio-text-color-secondary);
|
|
31
|
+
}
|
|
32
|
+
.ant-notification-notice-message,
|
|
33
|
+
.ant-notification-notice-description {
|
|
34
|
+
margin-left: calc(var(--oio-margin) + 24px);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.#{$notificationClassPrefix} {
|
|
40
|
+
&.ant-message-notice {
|
|
41
|
+
.ant-message-notice-content {
|
|
42
|
+
min-width: 300px !important;
|
|
43
|
+
text-align: left !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ant-message-notice {
|
|
49
|
+
.ant-message-notice-content {
|
|
50
|
+
border-radius: 8px;
|
|
51
|
+
box-shadow: var(--oio-box-shadow);
|
|
52
|
+
background: var(--oio-background);
|
|
53
|
+
padding: 9px 12px;
|
|
54
|
+
color: var(--oio-text-color);
|
|
55
|
+
.ant-message-custom-content {
|
|
56
|
+
.oio-icon {
|
|
57
|
+
position: relative;
|
|
58
|
+
top: -1px;
|
|
59
|
+
}
|
|
60
|
+
& > span {
|
|
61
|
+
&:last-child {
|
|
62
|
+
margin-left: 9px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioPagination } from './oio-pagination.vue';
|