@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,105 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { OioPaginationProps, PatchFlags, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
3
|
+
import { Pagination as APagination } from 'ant-design-vue';
|
|
4
|
+
import { isBoolean, isFunction, toString } from 'lodash-es';
|
|
5
|
+
import { computed, createVNode, defineComponent } from 'vue';
|
|
6
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'OioPagination',
|
|
10
|
+
components: {
|
|
11
|
+
APagination
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
...OioPaginationProps
|
|
15
|
+
},
|
|
16
|
+
slots: ['pageSizeOption'],
|
|
17
|
+
emits: ['update:current-page', 'update:page-size', 'change'],
|
|
18
|
+
setup(props, context) {
|
|
19
|
+
const virtualTotal = computed(() => {
|
|
20
|
+
const pageSize = props.pageSize || props.defaultPageSize;
|
|
21
|
+
const currentPage = props.currentPage || props.defaultCurrentPage;
|
|
22
|
+
const totalPage = props.total / pageSize;
|
|
23
|
+
if (totalPage >= 1) {
|
|
24
|
+
const diffPage = totalPage - currentPage;
|
|
25
|
+
if (diffPage <= -1) {
|
|
26
|
+
return currentPage * pageSize;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return props.total;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const onUpdateCurrentPage = (val) => {
|
|
33
|
+
context.emit('update:current-page', val);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const onUpdatePageSize = (val) => {
|
|
37
|
+
context.emit('update:page-size', val);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const onChange = (currentPage: number, pageSize: number) => {
|
|
41
|
+
context.emit('change', currentPage, pageSize);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
virtualTotal,
|
|
46
|
+
|
|
47
|
+
onUpdateCurrentPage,
|
|
48
|
+
onUpdatePageSize,
|
|
49
|
+
onChange
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
render() {
|
|
53
|
+
const { showTotal, showLastPage, onUpdateCurrentPage, onUpdatePageSize, onChange } = this;
|
|
54
|
+
let finalShowTotal: ((total: number, range) => string) | undefined;
|
|
55
|
+
if (isBoolean(showTotal)) {
|
|
56
|
+
if (showTotal) {
|
|
57
|
+
finalShowTotal = (total: number): string => {
|
|
58
|
+
return `${total} ${this.$translate('条')}`;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
} else if (isFunction(showTotal)) {
|
|
62
|
+
finalShowTotal = showTotal;
|
|
63
|
+
}
|
|
64
|
+
const className = `${DEFAULT_PREFIX}-pagination`;
|
|
65
|
+
const props: Record<string, unknown> = {
|
|
66
|
+
...PropRecordHelper.collectionBasicProps(this.$attrs, [className, !showLastPage ? `${className}-simple` : '']),
|
|
67
|
+
current: this.currentPage,
|
|
68
|
+
defaultCurrent: this.defaultCurrentPage,
|
|
69
|
+
pageSize: this.pageSize,
|
|
70
|
+
defaultPageSize: this.defaultPageSize,
|
|
71
|
+
pageSizeOptions: this.pageSizeOptions?.map((v) => toString(v)),
|
|
72
|
+
total: this.virtualTotal,
|
|
73
|
+
showTotal: (_, range) => finalShowTotal?.(this.total, range),
|
|
74
|
+
showSizeChanger: this.showSizeChanger,
|
|
75
|
+
showQuickJumper: this.showJumper,
|
|
76
|
+
disabled: this.disabled,
|
|
77
|
+
'onUpdate:current': onUpdateCurrentPage,
|
|
78
|
+
'onUpdate:page-size': onUpdatePageSize,
|
|
79
|
+
onChange,
|
|
80
|
+
onShowSizeChange: onChange
|
|
81
|
+
};
|
|
82
|
+
let { pageSizeOption } = this.$slots;
|
|
83
|
+
if (!pageSizeOption) {
|
|
84
|
+
pageSizeOption = (option: { value: string }) => [
|
|
85
|
+
createVNode('span', {}, `${option.value} ${this.$translate('条/页')}`, PatchFlags.TEXT)
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
props.buildOptionText = pageSizeOption;
|
|
89
|
+
if (this.showJumper) {
|
|
90
|
+
let locale: Record<string, unknown> | undefined = props.locale as Record<string, unknown>;
|
|
91
|
+
if (!locale) {
|
|
92
|
+
locale = {};
|
|
93
|
+
props.locale = locale;
|
|
94
|
+
}
|
|
95
|
+
if (!locale.jump_to) {
|
|
96
|
+
locale.jump_to = this.$translate('跳至');
|
|
97
|
+
}
|
|
98
|
+
if (!locale.page) {
|
|
99
|
+
locale.page = this.$translate('页');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return createVNode(APagination, props);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
</script>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
@import '../../oio-input/style/mixin.scss';
|
|
3
|
+
|
|
4
|
+
.#{$paginationClassPrefix} {
|
|
5
|
+
&.ant-pagination {
|
|
6
|
+
min-height: var($paginationParameterPrefix + -height);
|
|
7
|
+
font-size: var($parameterPrefix + -font-size);
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: flex-end;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ant-pagination-prev,
|
|
14
|
+
.ant-pagination-next {
|
|
15
|
+
button {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ant-pagination-prev,
|
|
23
|
+
.ant-pagination-next,
|
|
24
|
+
.ant-pagination-item {
|
|
25
|
+
min-width: var($paginationParameterPrefix + -item-width);
|
|
26
|
+
height: var($paginationParameterPrefix + -item-height);
|
|
27
|
+
|
|
28
|
+
vertical-align: -1px;
|
|
29
|
+
a {
|
|
30
|
+
display: flex;
|
|
31
|
+
height: 100%;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
&-simple {
|
|
37
|
+
.ant-pagination-jump-next + .ant-pagination-item {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
&.ant-pagination-simple {
|
|
42
|
+
.ant-pagination-prev,
|
|
43
|
+
.ant-pagination-next {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ant-pagination-simple-pager {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ant-pagination-total-text {
|
|
55
|
+
height: var($paginationParameterPrefix + -item-height);
|
|
56
|
+
line-height: var($paginationParameterPrefix + -item-height);
|
|
57
|
+
vertical-align: -1px;
|
|
58
|
+
color: var(--oio-text-color);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ant-pagination-prev .ant-pagination-item-link,
|
|
62
|
+
.ant-pagination-next .ant-pagination-item-link,
|
|
63
|
+
.ant-pagination-item {
|
|
64
|
+
border: var($parameterPrefix + -border-width) var($parameterPrefix + -border-style)
|
|
65
|
+
var($parameterPrefix + -border-color);
|
|
66
|
+
border-radius: var($parameterPrefix + -border-radius);
|
|
67
|
+
|
|
68
|
+
a {
|
|
69
|
+
color: var($parameterPrefix + -text-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
background-color: var($parameterPrefix + -primary-color-hover);
|
|
74
|
+
border-color: var($parameterPrefix + -primary-color-hover);
|
|
75
|
+
color: #ffffff;
|
|
76
|
+
|
|
77
|
+
a {
|
|
78
|
+
color: #ffffff;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ant-pagination-item-active {
|
|
84
|
+
background-color: var($parameterPrefix + -primary-color);
|
|
85
|
+
border-color: var($parameterPrefix + -primary-color);
|
|
86
|
+
|
|
87
|
+
a {
|
|
88
|
+
color: #ffffff;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis,
|
|
93
|
+
.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis {
|
|
94
|
+
color: var(--oio-text-color);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ant-pagination-options {
|
|
98
|
+
height: var($paginationParameterPrefix + -item-height);
|
|
99
|
+
line-height: var($paginationParameterPrefix + -item-height);
|
|
100
|
+
|
|
101
|
+
.ant-select-single:not(.ant-select-customize-input):hover {
|
|
102
|
+
z-index: auto;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ant-select {
|
|
106
|
+
.ant-select-selector {
|
|
107
|
+
height: var($paginationParameterPrefix + -item-height);
|
|
108
|
+
line-height: var($paginationParameterPrefix + -item-height);
|
|
109
|
+
border: var($parameterPrefix + -border-width) var($parameterPrefix + -border-style)
|
|
110
|
+
var($parameterPrefix + -border-color);
|
|
111
|
+
border-radius: var($parameterPrefix + -border-radius);
|
|
112
|
+
background: var(--oio-pagination-background);
|
|
113
|
+
color: var(--oio-pagination-text-color);
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
border-color: var($parameterPrefix + -primary-color-hover);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ant-select-selection-item {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
.ant-select-arrow {
|
|
125
|
+
transform: translate(0, -50%);
|
|
126
|
+
color: var(--oio-pagination-text-color);
|
|
127
|
+
margin: 0;
|
|
128
|
+
}
|
|
129
|
+
.ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled):after {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) {
|
|
135
|
+
.ant-select-selector {
|
|
136
|
+
border-color: var($parameterPrefix + -primary-color-focus);
|
|
137
|
+
box-shadow: none;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled):after {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
& > *:last-child {
|
|
146
|
+
margin-right: 0;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ant-select-dropdown {
|
|
151
|
+
.ant-select-item {
|
|
152
|
+
text-align: left;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ant-pagination-next .ant-pagination-item-link,
|
|
157
|
+
.ant-pagination-prev .ant-pagination-item-link,
|
|
158
|
+
.ant-pagination-item {
|
|
159
|
+
background: var(--oio-pagination-background);
|
|
160
|
+
color: var(--oio-pagination-text-color);
|
|
161
|
+
border-color: var(--oio-pagination-border-color);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ant-pagination-item-active {
|
|
165
|
+
background-color: var(--oio-primary-color);
|
|
166
|
+
border-color: var(--oio-primary-color);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ant-pagination-options-quick-jumper {
|
|
170
|
+
height: var($paginationParameterPrefix + -item-height);
|
|
171
|
+
line-height: var($paginationParameterPrefix + -item-height);
|
|
172
|
+
color: var(--oio-text-color);
|
|
173
|
+
|
|
174
|
+
input {
|
|
175
|
+
@include input-style();
|
|
176
|
+
height: var($paginationParameterPrefix + -item-height);
|
|
177
|
+
line-height: var($paginationParameterPrefix + -item-height);
|
|
178
|
+
border-radius: var($parameterPrefix + -border-radius);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioPopconfirm } from './oio-popconfirm.vue';
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ObjectUtils, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioPopconfirmProps, PopconfirmPlacement, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { Popconfirm as APopconfirm, Popover as APopover } from 'ant-design-vue';
|
|
5
|
+
import { isBoolean, isFunction } from 'lodash-es';
|
|
6
|
+
import { computed, createVNode, defineComponent, h, ref, Slot } from 'vue';
|
|
7
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
8
|
+
|
|
9
|
+
export default defineComponent({
|
|
10
|
+
name: 'OioPopconfirm',
|
|
11
|
+
components: {
|
|
12
|
+
APopconfirm,
|
|
13
|
+
APopover
|
|
14
|
+
},
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
props: {
|
|
17
|
+
...OioPopconfirmProps
|
|
18
|
+
},
|
|
19
|
+
emits: ['update:visible'],
|
|
20
|
+
setup(props, context) {
|
|
21
|
+
const _visible = ref<boolean>(false);
|
|
22
|
+
|
|
23
|
+
const rawVisibleChange = (val: boolean) => {
|
|
24
|
+
if (isBoolean(props.visible)) {
|
|
25
|
+
context.emit('update:visible', val);
|
|
26
|
+
} else {
|
|
27
|
+
_visible.value = val;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const visible = computed<boolean>({
|
|
32
|
+
get() {
|
|
33
|
+
return isBoolean(props.visible) ? props.visible : _visible.value;
|
|
34
|
+
},
|
|
35
|
+
set(val) {
|
|
36
|
+
if (props.manual) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
rawVisibleChange(val);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const visibleChange = async (val: boolean) => {
|
|
44
|
+
if (!val) {
|
|
45
|
+
visible.value = false;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (isBoolean(props.condition)) {
|
|
49
|
+
if (props.condition) {
|
|
50
|
+
visible.value = val;
|
|
51
|
+
} else {
|
|
52
|
+
confirm();
|
|
53
|
+
}
|
|
54
|
+
} else if (isFunction(props.condition)) {
|
|
55
|
+
const result = await props.condition();
|
|
56
|
+
if (ObjectUtils.isNotEmpty(result)) {
|
|
57
|
+
if (result) {
|
|
58
|
+
visible.value = val;
|
|
59
|
+
} else {
|
|
60
|
+
confirm();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
visible.value = val;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const placement = computed<string | undefined>(() => {
|
|
69
|
+
const { placement: _placement } = props;
|
|
70
|
+
if (!_placement) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
switch (_placement) {
|
|
74
|
+
case PopconfirmPlacement.tl:
|
|
75
|
+
return 'topLeft';
|
|
76
|
+
case PopconfirmPlacement.tm:
|
|
77
|
+
return 'top';
|
|
78
|
+
case PopconfirmPlacement.tr:
|
|
79
|
+
return 'topRight';
|
|
80
|
+
case PopconfirmPlacement.rt:
|
|
81
|
+
return 'rightTop';
|
|
82
|
+
case PopconfirmPlacement.rm:
|
|
83
|
+
return 'right';
|
|
84
|
+
case PopconfirmPlacement.rb:
|
|
85
|
+
return 'rightBottom';
|
|
86
|
+
case PopconfirmPlacement.bl:
|
|
87
|
+
return 'bottomLeft';
|
|
88
|
+
case PopconfirmPlacement.bm:
|
|
89
|
+
return 'bottom';
|
|
90
|
+
case PopconfirmPlacement.br:
|
|
91
|
+
return 'bottomRight';
|
|
92
|
+
case PopconfirmPlacement.lt:
|
|
93
|
+
return 'leftTop';
|
|
94
|
+
case PopconfirmPlacement.lm:
|
|
95
|
+
return 'left';
|
|
96
|
+
case PopconfirmPlacement.lb:
|
|
97
|
+
return 'leftBottom';
|
|
98
|
+
default:
|
|
99
|
+
return 'top';
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const confirm = () => {
|
|
104
|
+
visible.value = false;
|
|
105
|
+
if (props.confirmCallback) {
|
|
106
|
+
props.confirmCallback();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const cancel = () => {
|
|
111
|
+
visible.value = false;
|
|
112
|
+
if (props.cancelCallback) {
|
|
113
|
+
props.cancelCallback();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
visible,
|
|
119
|
+
visibleChange,
|
|
120
|
+
placement,
|
|
121
|
+
confirm,
|
|
122
|
+
cancel
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
render() {
|
|
126
|
+
const defaultSlot = this.$slots.default;
|
|
127
|
+
if (defaultSlot) {
|
|
128
|
+
const [title, icon] = ['title', 'icon'].map((name) => {
|
|
129
|
+
const slot = this.$slots[name];
|
|
130
|
+
return slot ? slot() : undefined;
|
|
131
|
+
});
|
|
132
|
+
const children: Record<string, Slot> = {
|
|
133
|
+
default: defaultSlot
|
|
134
|
+
};
|
|
135
|
+
if (title) {
|
|
136
|
+
children.title = () => title;
|
|
137
|
+
} else {
|
|
138
|
+
children.title = () => {
|
|
139
|
+
return [
|
|
140
|
+
h(
|
|
141
|
+
'div',
|
|
142
|
+
{
|
|
143
|
+
class: `${DEFAULT_PREFIX}-popconfirm-content`
|
|
144
|
+
},
|
|
145
|
+
[
|
|
146
|
+
h(
|
|
147
|
+
'div',
|
|
148
|
+
{
|
|
149
|
+
class: `${DEFAULT_PREFIX}-popconfirm-title`
|
|
150
|
+
},
|
|
151
|
+
[h('span', this.$translate(this.title))]
|
|
152
|
+
),
|
|
153
|
+
h(
|
|
154
|
+
'p',
|
|
155
|
+
{
|
|
156
|
+
class: `${DEFAULT_PREFIX}-popconfirm-text`
|
|
157
|
+
},
|
|
158
|
+
this.$translate(this.text)
|
|
159
|
+
)
|
|
160
|
+
]
|
|
161
|
+
)
|
|
162
|
+
];
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (icon) {
|
|
166
|
+
children.icon = () => icon;
|
|
167
|
+
}
|
|
168
|
+
return createVNode(
|
|
169
|
+
APopconfirm,
|
|
170
|
+
{
|
|
171
|
+
visible: this.visible,
|
|
172
|
+
placement: this.placement,
|
|
173
|
+
destroyTooltipOnHide: this.destroyOnClose,
|
|
174
|
+
arrowPointAtCenter: true,
|
|
175
|
+
okText: this.$translate(this.enterText),
|
|
176
|
+
cancelText: this.$translate(this.cancelText),
|
|
177
|
+
getPopupContainer: this.getTriggerContainer,
|
|
178
|
+
...PropRecordHelper.collectionBasicProps(this.$attrs),
|
|
179
|
+
onVisibleChange: this.visibleChange,
|
|
180
|
+
onConfirm: this.confirm,
|
|
181
|
+
onCancel: this.cancel,
|
|
182
|
+
overlayClassName: StringHelper.append([`${DEFAULT_PREFIX}-popconfirm-overlay`], this.overlayClassName).join(
|
|
183
|
+
' '
|
|
184
|
+
)
|
|
185
|
+
},
|
|
186
|
+
children
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
|
|
3
|
+
.#{$popconfirmClassPrefix}-overlay {
|
|
4
|
+
&.ant-popover {
|
|
5
|
+
z-index: 1050;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.ant-popover-inner,
|
|
9
|
+
.ant-popover-arrow-content {
|
|
10
|
+
background-color: var($popconfirmParameterPrefix + -background);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ant-popover-inner-content {
|
|
14
|
+
padding: 8px;
|
|
15
|
+
|
|
16
|
+
.ant-popover-message {
|
|
17
|
+
padding: 4px 0;
|
|
18
|
+
|
|
19
|
+
.ant-popover-message-title {
|
|
20
|
+
color: var($popconfirmParameterPrefix + -color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.#{$popconfirmClassPrefix}-content {
|
|
24
|
+
.#{$popconfirmClassPrefix}-title {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.#{$popconfirmClassPrefix}-text {
|
|
28
|
+
margin: 4px 0;
|
|
29
|
+
max-width: 300px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ant-popover-buttons {
|
|
35
|
+
margin-bottom: 0;
|
|
36
|
+
|
|
37
|
+
button {
|
|
38
|
+
@import '../../oio-button/style/a-button.scss';
|
|
39
|
+
|
|
40
|
+
&.ant-btn {
|
|
41
|
+
height: 22px;
|
|
42
|
+
padding: 2px 6px;
|
|
43
|
+
margin: 0 3px;
|
|
44
|
+
line-height: 12px;
|
|
45
|
+
|
|
46
|
+
& > span {
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
line-height: inherit;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
|
|
3
|
+
.#{$popoverClassPrefix} {
|
|
4
|
+
&.ant-popover {
|
|
5
|
+
.ant-popover-inner,
|
|
6
|
+
.ant-popover-arrow-content {
|
|
7
|
+
background: var(--oio-background);
|
|
8
|
+
box-shadow: var(--oio-box-shadow);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ant-popover-title {
|
|
12
|
+
color: var(--oio-text-color);
|
|
13
|
+
border-bottom-color: var(--oio-border-color);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@import './parameters.scss';
|
|
2
|
+
|
|
3
|
+
.ant-radio {
|
|
4
|
+
.ant-radio-inner {
|
|
5
|
+
background-color: var(--oio-background);
|
|
6
|
+
border: 1px solid var(--oio-border-color);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ant-radio-checked .ant-radio-inner {
|
|
10
|
+
border-color: var(--oio-primary-color, #606cee);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ant-radio-group {
|
|
15
|
+
.ant-radio-button-wrapper {
|
|
16
|
+
background-color: var(--oio-background);
|
|
17
|
+
border-color: var(--oio-border-color);
|
|
18
|
+
color: var(--oio-text-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ant-radio-button-wrapper:not(:first-child):before {
|
|
22
|
+
background-color: var(--oio-border-color);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioSelect } from './oio-select.vue';
|