@koi-design/uxd-ui 14.0.0 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/AutoComplete/AutoComplete.vue.d.ts +9 -0
- package/es/components/AutoComplete/index.d.ts +18 -0
- package/es/components/ColorPicker/ColorPicker.vue.d.ts +9 -0
- package/es/components/ColorPicker/index.d.ts +18 -0
- package/es/components/Dropdown/DropdownMenu.mjs +0 -1
- package/es/components/Dropdown/DropdownMenu.mjs.map +1 -1
- package/es/components/Input/Input.d.ts +6 -0
- package/es/components/Input/Input.mjs +1 -0
- package/es/components/Input/Input.mjs.map +1 -1
- package/es/components/Input/Input.type.d.ts +3 -0
- package/es/components/Input/Input.type.mjs +3 -0
- package/es/components/Input/Input.type.mjs.map +1 -1
- package/es/components/Input/index.d.ts +9 -0
- package/es/components/Modal/ConfirmDialog.mjs +24 -27
- package/es/components/Modal/ConfirmDialog.mjs.map +1 -1
- package/es/components/Modal/ConfirmDialog.vue.d.ts +18 -11
- package/es/components/Modal/Modal.mjs +6 -6
- package/es/components/Modal/Modal.mjs.map +1 -1
- package/es/components/Modal/Modal.type.d.ts +8 -5
- package/es/components/Modal/Modal.type.mjs +8 -5
- package/es/components/Modal/Modal.type.mjs.map +1 -1
- package/es/components/Modal/Modal.vue.d.ts +18 -11
- package/es/components/Modal/index.d.ts +30 -18
- package/es/components/Pagination/Options.d.ts +8 -0
- package/es/components/Pagination/Options.mjs +6 -1
- package/es/components/Pagination/Options.mjs.map +1 -1
- package/es/components/Pagination/Pagination.d.ts +8 -0
- package/es/components/Pagination/Pagination.mjs +2 -0
- package/es/components/Pagination/Pagination.mjs.map +1 -1
- package/es/components/Pagination/index.d.ts +16 -0
- package/es/components/Table/Table.vue.d.ts +16 -0
- package/es/components/Transfer/Transfer.vue.d.ts +27 -0
- package/es/components/Transfer/TransferList.vue.d.ts +9 -0
- package/es/components/Transfer/index.d.ts +72 -0
- package/lib/components/AutoComplete/AutoComplete.vue.d.ts +9 -0
- package/lib/components/AutoComplete/index.d.ts +18 -0
- package/lib/components/ColorPicker/ColorPicker.vue.d.ts +9 -0
- package/lib/components/ColorPicker/index.d.ts +18 -0
- package/lib/components/Dropdown/DropdownMenu.js +0 -1
- package/lib/components/Dropdown/DropdownMenu.js.map +1 -1
- package/lib/components/Input/Input.d.ts +6 -0
- package/lib/components/Input/Input.js +1 -0
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.type.d.ts +3 -0
- package/lib/components/Input/Input.type.js +3 -0
- package/lib/components/Input/Input.type.js.map +1 -1
- package/lib/components/Input/index.d.ts +9 -0
- package/lib/components/Modal/ConfirmDialog.js +23 -26
- package/lib/components/Modal/ConfirmDialog.js.map +1 -1
- package/lib/components/Modal/ConfirmDialog.vue.d.ts +18 -11
- package/lib/components/Modal/Modal.js +6 -6
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.type.d.ts +8 -5
- package/lib/components/Modal/Modal.type.js +8 -5
- package/lib/components/Modal/Modal.type.js.map +1 -1
- package/lib/components/Modal/Modal.vue.d.ts +18 -11
- package/lib/components/Modal/index.d.ts +30 -18
- package/lib/components/Pagination/Options.d.ts +8 -0
- package/lib/components/Pagination/Options.js +6 -1
- package/lib/components/Pagination/Options.js.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +8 -0
- package/lib/components/Pagination/Pagination.js +2 -0
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Pagination/index.d.ts +16 -0
- package/lib/components/Table/Table.vue.d.ts +16 -0
- package/lib/components/Transfer/Transfer.vue.d.ts +27 -0
- package/lib/components/Transfer/TransferList.vue.d.ts +9 -0
- package/lib/components/Transfer/index.d.ts +72 -0
- package/package.json +1 -1
- package/styles/animation/zoom.less +1 -3
- package/styles/components/alert/index.css +1 -1
- package/styles/components/autoComplete/index.css +1 -1
- package/styles/components/avatar/index.css +1 -1
- package/styles/components/badge/index.css +1 -1
- package/styles/components/badge/var.less +2 -2
- package/styles/components/button/index.css +1 -1
- package/styles/components/carousel/index.css +1 -1
- package/styles/components/cascader/index.css +1 -1
- package/styles/components/colorPicker/index.css +1 -1
- package/styles/components/colorPicker/var.less +1 -1
- package/styles/components/datePicker/index.css +1 -1
- package/styles/components/datePicker/picker.less +1 -1
- package/styles/components/dropdown/index.css +1 -1
- package/styles/components/dropdown/index.less +12 -26
- package/styles/components/dropdown/var.less +6 -19
- package/styles/components/form/index.css +1 -1
- package/styles/components/form/index.less +50 -30
- package/styles/components/form/var.less +5 -8
- package/styles/components/icon/index.css +1 -1
- package/styles/components/input/index.css +1 -1
- package/styles/components/input/index.less +4 -3
- package/styles/components/inputNumber/index.css +1 -1
- package/styles/components/link/index.css +1 -1
- package/styles/components/link/var.less +4 -4
- package/styles/components/loadingBar/index.css +1 -1
- package/styles/components/loadingBar/index.less +1 -1
- package/styles/components/mentions/index.css +1 -1
- package/styles/components/message/index.css +1 -1
- package/styles/components/message/var.less +1 -1
- package/styles/components/modal/confirm.less +15 -32
- package/styles/components/modal/index.css +1 -1
- package/styles/components/modal/index.less +1 -0
- package/styles/components/modal/modal.less +34 -68
- package/styles/components/modal/var.less +20 -26
- package/styles/components/pagination/index.css +1 -1
- package/styles/components/pagination/index.less +41 -178
- package/styles/components/pagination/var.less +8 -21
- package/styles/components/progress/index.css +1 -1
- package/styles/components/progress/index.less +2 -2
- package/styles/components/progress/var.less +1 -1
- package/styles/components/result/index.css +1 -1
- package/styles/components/result/var.less +1 -1
- package/styles/components/select/index.css +1 -1
- package/styles/components/select/index.less +4 -11
- package/styles/components/select/var.less +1 -8
- package/styles/components/spin/index.css +1 -1
- package/styles/components/steps/index.css +1 -1
- package/styles/components/steps/var.less +10 -10
- package/styles/components/tabs/index.css +1 -1
- package/styles/components/tabs/var.less +1 -1
- package/styles/components/tag/index.css +1 -1
- package/styles/components/tag/var.less +1 -1
- package/styles/components/text/index.css +1 -1
- package/styles/components/text/index.less +1 -1
- package/styles/components/timePicker/index.css +1 -1
- package/styles/components/timePicker/index.less +3 -3
- package/styles/components/timeline/index.css +1 -1
- package/styles/components/timeline/index.less +2 -2
- package/styles/components/transfer/index.css +1 -1
- package/styles/components/transfer/var.less +1 -1
- package/styles/components/upload/index.css +1 -1
- package/styles/components/upload/var.less +2 -2
- package/styles/cssVariable.css +1 -1
- package/styles/cssVariable.less +1 -1
- package/styles/index.css +1 -1
- package/types/components/AutoComplete/AutoComplete.vue.d.ts +9 -0
- package/types/components/AutoComplete/index.d.ts +18 -0
- package/types/components/ColorPicker/ColorPicker.vue.d.ts +9 -0
- package/types/components/ColorPicker/index.d.ts +18 -0
- package/types/components/Input/Input.d.ts +6 -0
- package/types/components/Input/Input.type.d.ts +3 -0
- package/types/components/Input/index.d.ts +9 -0
- package/types/components/Modal/ConfirmDialog.vue.d.ts +18 -11
- package/types/components/Modal/Modal.type.d.ts +8 -5
- package/types/components/Modal/Modal.vue.d.ts +18 -11
- package/types/components/Modal/index.d.ts +30 -18
- package/types/components/Pagination/Options.d.ts +8 -0
- package/types/components/Pagination/Pagination.d.ts +8 -0
- package/types/components/Pagination/index.d.ts +16 -0
- package/types/components/Table/Table.vue.d.ts +16 -0
- package/types/components/Transfer/Transfer.vue.d.ts +27 -0
- package/types/components/Transfer/TransferList.vue.d.ts +9 -0
- package/types/components/Transfer/index.d.ts +72 -0
- package/uxd-ui.css +1 -1
- package/uxd-ui.esm.min.mjs +6 -6
- package/uxd-ui.esm.mjs +50 -40
- package/uxd-ui.umd.js +50 -40
- package/uxd-ui.umd.min.js +4 -4
|
@@ -92,7 +92,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
92
92
|
type: BooleanConstructor;
|
|
93
93
|
default: boolean;
|
|
94
94
|
};
|
|
95
|
-
title:
|
|
95
|
+
title: {
|
|
96
|
+
type: StringConstructor;
|
|
97
|
+
default: string;
|
|
98
|
+
};
|
|
99
|
+
description: {
|
|
100
|
+
type: StringConstructor;
|
|
101
|
+
default: string;
|
|
102
|
+
};
|
|
96
103
|
closable: {
|
|
97
104
|
type: BooleanConstructor;
|
|
98
105
|
default: boolean;
|
|
@@ -133,10 +140,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
133
140
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
134
141
|
};
|
|
135
142
|
afterClose: import("vue").PropType<() => void>;
|
|
136
|
-
vertical: {
|
|
137
|
-
type: BooleanConstructor;
|
|
138
|
-
default: boolean;
|
|
139
|
-
};
|
|
140
143
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
141
144
|
top: {
|
|
142
145
|
type: NumberConstructor;
|
|
@@ -210,7 +213,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
210
213
|
type: BooleanConstructor;
|
|
211
214
|
default: boolean;
|
|
212
215
|
};
|
|
213
|
-
title:
|
|
216
|
+
title: {
|
|
217
|
+
type: StringConstructor;
|
|
218
|
+
default: string;
|
|
219
|
+
};
|
|
220
|
+
description: {
|
|
221
|
+
type: StringConstructor;
|
|
222
|
+
default: string;
|
|
223
|
+
};
|
|
214
224
|
closable: {
|
|
215
225
|
type: BooleanConstructor;
|
|
216
226
|
default: boolean;
|
|
@@ -251,10 +261,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
251
261
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
252
262
|
};
|
|
253
263
|
afterClose: import("vue").PropType<() => void>;
|
|
254
|
-
vertical: {
|
|
255
|
-
type: BooleanConstructor;
|
|
256
|
-
default: boolean;
|
|
257
|
-
};
|
|
258
264
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
259
265
|
top: {
|
|
260
266
|
type: NumberConstructor;
|
|
@@ -292,8 +298,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
292
298
|
size: "small" | "default";
|
|
293
299
|
width: string | number;
|
|
294
300
|
mask: boolean;
|
|
301
|
+
description: string;
|
|
295
302
|
visible: boolean;
|
|
296
|
-
|
|
303
|
+
title: string;
|
|
297
304
|
parentDom: import("..").ParentDom;
|
|
298
305
|
maskClosable: boolean;
|
|
299
306
|
fullScreen: boolean;
|
|
@@ -46,9 +46,6 @@ const _sfc_main = defineComponent({
|
|
|
46
46
|
} else {
|
|
47
47
|
const width = typeof props.width === "number" ? `${props.width}px` : props.width;
|
|
48
48
|
style.width = width;
|
|
49
|
-
if (!props.vertical) {
|
|
50
|
-
style.marginTop = `${props.top}px`;
|
|
51
|
-
}
|
|
52
49
|
}
|
|
53
50
|
if (props.draggable) {
|
|
54
51
|
style.transform = `translate(${dragData.x}px, ${dragData.y}px)`;
|
|
@@ -232,10 +229,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
232
229
|
createElementVNode("div", {
|
|
233
230
|
class: normalizeClass([
|
|
234
231
|
`${_ctx.prefixCls}-wrap`,
|
|
235
|
-
`${_ctx.prefixCls}-size-${_ctx.size}`,
|
|
236
232
|
..._ctx.customClass,
|
|
237
233
|
{
|
|
238
|
-
[`${_ctx.prefixCls}-vertical`]: _ctx.vertical,
|
|
239
234
|
[`${_ctx.prefixCls}-no-mask`]: _ctx.draggable,
|
|
240
235
|
[`${_ctx.prefixCls}-visible`]: _ctx.wrapVisible,
|
|
241
236
|
[`${_ctx.prefixCls}-full-screen`]: _ctx.fullScreen
|
|
@@ -261,6 +256,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
261
256
|
ref: "contentRef",
|
|
262
257
|
class: normalizeClass([
|
|
263
258
|
`${_ctx.prefixCls}`,
|
|
259
|
+
`${_ctx.prefixCls}-size-${_ctx.size}`,
|
|
264
260
|
{
|
|
265
261
|
[`${_ctx.prefixCls}-drag`]: _ctx.draggable,
|
|
266
262
|
[`${_ctx.prefixCls}-dragging`]: _ctx.draggable && _ctx.dragData.dragging,
|
|
@@ -296,7 +292,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
296
292
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
297
293
|
createElementVNode("div", {
|
|
298
294
|
class: normalizeClass(`${_ctx.prefixCls}-title`)
|
|
299
|
-
}, toDisplayString(_ctx.title), 3)
|
|
295
|
+
}, toDisplayString(_ctx.title), 3),
|
|
296
|
+
_ctx.description ? (openBlock(), createElementBlock("div", {
|
|
297
|
+
key: 0,
|
|
298
|
+
class: normalizeClass(`${_ctx.prefixCls}-description`)
|
|
299
|
+
}, toDisplayString(_ctx.description), 3)) : createCommentVNode("v-if", true)
|
|
300
300
|
])
|
|
301
301
|
], 2)) : createCommentVNode("v-if", true),
|
|
302
302
|
createElementVNode("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","sources":["../../../../src/components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport :to=\"toDom\">\n <div :id=\"id\" v-bind=\"$attrs\" :class=\"`${prefixCls}-root`\">\n <transition name=\"fade\" appear>\n <div v-show=\"visible\" v-if=\"mask && !draggable && !fullScreen\" :class=\"`${prefixCls}-mask`\" :style=\"{ ...zIndexStyle, ...positionStyle }\" />\n </transition>\n <div\n :class=\"[\n `${prefixCls}-wrap`,\n `${prefixCls}-size-${size}`,\n ...customClass,\n {\n [`${prefixCls}-vertical`]: vertical,\n [`${prefixCls}-no-mask`]: draggable,\n [`${prefixCls}-visible`]: wrapVisible,\n [`${prefixCls}-full-screen`]: fullScreen\n }\n ]\"\n :style=\"{ ...zIndexStyle, ...positionStyle }\"\n @click=\"onMaskClick\"\n @mousedown=\"onMaskMouseDown\"\n >\n <transition :name=\"fullScreen ? 'zoom-big-fast' : 'zoom-big'\" appear @after-leave=\"afterLeave\" @after-enter=\"handleAnimationEnd\">\n <div v-show=\"visible\" :class=\"`${prefixCls}-container`\" :style=\"transitionDivStyle\">\n <div\n ref=\"contentRef\"\n :class=\"[\n `${prefixCls}`,\n {\n [`${prefixCls}-drag`]: draggable,\n [`${prefixCls}-dragging`]: draggable && dragData.dragging,\n [`${prefixCls}-no-title`]: !showHead\n }\n ]\"\n :style=\"modalStyles\"\n @mousedown=\"onmMouseStart\"\n >\n <button v-if=\"closable\" data-not-drag-target :class=\"`${prefixCls}-close`\" @click=\"handleClose('close')\">\n <slot name=\"close\">\n <UIcon :class=\"`${prefixCls}-close-x`\" flex>\n <component :is=\"closeIcon\" />\n </UIcon>\n </slot>\n </button>\n <div v-if=\"showHead\" key=\"header\" ref=\"header\" :class=\"`${prefixCls}-header`\">\n <slot name=\"header\">\n <div :class=\"`${prefixCls}-title`\">{{ title }}</div>\n </slot>\n </div>\n <div\n :class=\"[\n `${prefixCls}-body ${$attrs.class || ''}`,\n { [`${prefixCls}-body-footer-hide`]: footerHide, [`${prefixCls}-body-head-hide`]: !showHead }\n ]\"\n >\n <slot />\n </div>\n <div v-if=\"!footerHide\" :class=\"`${prefixCls}-footer`\">\n <slot name=\"footer\">\n <UButton data-not-drag-target type=\"default\" :size=\"size\" @click=\"handleClose('cancel')\">\n {{ cancelText || computedLocale.cancelText }}\n </UButton>\n <UButton data-not-drag-target type=\"primary\" :size=\"size\" :loading=\"loading\" @click=\"handleOk\">\n {{ okText || computedLocale.okText }}\n </UButton>\n </slot>\n </div>\n </div>\n </div>\n </transition>\n </div>\n </div>\n </teleport>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, onMounted, onBeforeUnmount, watch, reactive, shallowRef } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport UIcon from '@uxd-ui/components/Icon';\nimport UButton from '@uxd-ui/components/Button';\nimport useGlobalConfig from '../base/hooks/useGlobalConfig';\nimport { setBodyStyle } from '../../utils/tools';\nimport { type DragData, modalProps, modalEmits, type ModalCloseType } from './Modal.type';\n\nlet openModalCount = 0;\nlet modalsList: ((e?: any) => void)[] = [];\n\nexport default defineComponent({\n name: 'UModal',\n components: {\n UIcon,\n UButton\n },\n inheritAttrs: false,\n props: modalProps,\n emits: modalEmits,\n setup(props, { emit, slots }) {\n const { prefixCls, config: globalConfig } = useGlobalConfig('modal');\n const contentRef = shallowRef<HTMLElement | null>(null);\n const dragData = reactive({\n x: 0,\n y: 0,\n eventX: null,\n eventY: null,\n dragging: false\n } as DragData);\n const isMouseIn = ref(false);\n const wrapVisible = ref(false);\n // ===================== computed ============================\n\n const computedLocale = computed(() => {\n return props.locale || globalConfig.locale.modal;\n });\n\n const zIndexStyle = computed(() => {\n return props.zIndex !== undefined ? { zIndex: props.zIndex } : {};\n });\n const showHead = computed(() => {\n return slots.header || props.title;\n });\n const modalStyles = computed(() => {\n const style = {} as CSSProperties;\n if (props.fullScreen) {\n style.width = '100%';\n style.height = '100%';\n } else {\n const width = typeof props.width === 'number' ? `${props.width}px` : props.width;\n style.width = width;\n if (!props.vertical) {\n style.marginTop = `${props.top}px`;\n }\n }\n if (props.draggable) {\n style.transform = `translate(${dragData.x}px, ${dragData.y}px)`;\n }\n return {\n ...style,\n ...props.dialogStyle\n } as CSSProperties;\n });\n const toDom = computed(() => {\n if (!props.parentDom) {\n return 'body';\n }\n if (typeof props.parentDom === 'function') {\n return props.parentDom() || 'body';\n }\n return props.parentDom;\n });\n const positionStyle = computed(() => {\n const style: CSSProperties = {};\n if (toDom.value !== 'body') {\n style.position = 'absolute';\n }\n return style;\n });\n\n // ===================== methods ============================\n\n const handleClose = (type: ModalCloseType) => {\n emit('update:visible', false);\n emit('close', type);\n };\n const handleOk = (e: Event) => {\n emit('ok', e);\n };\n\n const handleVisible = () => {\n if (props.visible) {\n openModalCount += 1;\n wrapVisible.value = true;\n } else {\n openModalCount = openModalCount > 0 ? openModalCount - 1 : openModalCount;\n }\n if (openModalCount) {\n modalsList.push(() => handleClose('esc'));\n if (toDom.value === 'body') setBodyStyle(true);\n } else if (toDom.value === 'body') setBodyStyle(false);\n };\n\n const onMaskClick = (e: Event) => {\n if (!props.maskClosable) return;\n if (isMouseIn.value && props.draggable) {\n isMouseIn.value = false;\n return;\n }\n if (e.target === e.currentTarget) {\n handleClose('mask');\n }\n };\n\n const onMaskMouseDown = () => {\n isMouseIn.value = true;\n };\n\n const onKeyDown = (e: any) => {\n if (props.visible && e.keyCode === 27 && openModalCount) {\n e.stopPropagation();\n modalsList[openModalCount - 1]();\n }\n };\n // ===================== drag ============================\n const onMoveing = (event: any) => {\n const distanceX = event.clientX - dragData.eventX;\n const distanceY = event.clientY - dragData.eventY;\n dragData.eventX = event.clientX;\n dragData.eventY = event.clientY;\n\n dragData.x += distanceX;\n dragData.y += distanceY;\n };\n const onMoveEnd = () => {\n dragData.eventX = null;\n dragData.eventY = null;\n dragData.dragging = false;\n window.removeEventListener('mousemove', onMoveing);\n window.removeEventListener('mouseup', onMoveEnd);\n };\n\n const onmMouseStart = (event: any) => {\n if (!props.draggable || !contentRef.value) return;\n if (event.target.closest('[data-not-drag-target]')) return;\n // if (event.target === contentRef.value) return;\n\n dragData.eventX = event.clientX;\n dragData.eventY = event.clientY;\n dragData.dragging = true;\n\n window.addEventListener('mousemove', onMoveing);\n window.addEventListener('mouseup', onMoveEnd);\n };\n\n const handleAnimationEnd = () => {\n emit('after-visible-change', wrapVisible.value);\n };\n\n const afterLeave = () => {\n wrapVisible.value = false;\n if (props.afterClose) {\n props.afterClose();\n }\n if (!openModalCount) {\n if (toDom.value === 'body') setBodyStyle(false);\n modalsList = [];\n }\n handleAnimationEnd();\n };\n\n // ===================== watch ==============================\n watch(\n () => props.visible,\n () => {\n handleVisible();\n }\n );\n\n const transitionDivStyle = computed(() => {\n if (contentRef.value && props.mousePosition) {\n const rect = contentRef.value.getBoundingClientRect();\n const transformOrigin = `${props.mousePosition.x - rect.left}px ${props.mousePosition.y - rect.top}px`;\n return {\n transformOrigin\n };\n }\n return {};\n });\n\n onMounted(() => {\n document.addEventListener('keydown', onKeyDown);\n\n handleVisible();\n });\n\n onBeforeUnmount(() => {\n document.removeEventListener('keydown', onKeyDown);\n if (props.visible) {\n openModalCount = openModalCount > 0 ? openModalCount - 1 : openModalCount;\n afterLeave();\n }\n });\n\n return {\n prefixCls,\n wrapVisible,\n contentRef,\n toDom,\n positionStyle,\n showHead,\n zIndexStyle,\n modalStyles,\n transitionDivStyle,\n computedLocale,\n dragData,\n handleClose,\n handleOk,\n onMaskClick,\n onMaskMouseDown,\n afterLeave,\n onmMouseStart,\n onKeyDown,\n handleAnimationEnd\n };\n }\n});\n</script>\n\n<style></style>\n"],"names":["_createBlock","_Teleport","_createElementVNode","_mergeProps","_createVNode","_Transition","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_resolveDynamicComponent"],"mappings":";;;;;;;;AAoFA,IAAI,iBAAiB;AACrB,IAAI,aAAoC;AAExC,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA;AACF,EACA,cAAc;AAAA,EACd,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM,OAAO,EAAE,MAAM,SAAS;UACtB,EAAE,WAAW,QAAQ,iBAAiB,gBAAgB,OAAO;UAC7D,aAAa,WAA+B,IAAI;UAChD,WAAW,SAAS;AAAA,MACxB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,UAAU;AAAA,KACC;UACP,YAAY,IAAI,KAAK;UACrB,cAAc,IAAI,KAAK;UAGvB,iBAAiB,SAAS,MAAM;aAC7B,MAAM,UAAU,aAAa,OAAO;AAAA,KAC5C;UAEK,cAAc,SAAS,MAAM;aAC1B,MAAM,WAAW,SAAY,EAAE,QAAQ,MAAM,WAAW;AAAC,KACjE;UACK,WAAW,SAAS,MAAM;aACvB,MAAM,UAAU,MAAM;AAAA,KAC9B;UACK,cAAc,SAAS,MAAM;YAC3B,QAAQ;UACV,MAAM,YAAY;cACd,QAAQ;cACR,SAAS;AAAA,aACV;cACC,QAAQ,OAAO,MAAM,UAAU,WAAW,GAAG,MAAM,YAAY,MAAM;c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kBAAK,sBAAS;AAAA,uCAAa,UAAK;;;gBAG/CL,mBAOM;kBANH,OAAKK;uBAAyB,uBAAkB,YAAO,SAAK;AAAA,0BAAkC,oCAA+B,iBAAU,IAAM,kCAAS,CAAqB;AAAQ;;kBAKpLE,WAAQ;;iBAEE,gCAAZH,mBASM;;kBATmB,OAAKC,kBAAK,uBAAS;AAAA;kBAC1CE,WAOO,2BAPP,MAOO;AAAA,oBANLL,YAEU;sBAFD;sBAAqB,MAAK;AAAA,sBAAW,MAAM;sBAAO,SAAK,sCAAE,iBAAW;;uCAC3E,MAA6C;AAAA,wDAA1C,mBAAc,oBAAe,UAAU;;;;oBAE5CA,YAEU;sBAFD;sBAAqB,MAAK;AAAA,sBAAW,MAAM;sBAAO,SAAS;sBAAU,SAAO;;uCACnF,MAAqC;AAAA,wDAAlC,eAAU,oBAAe,MAAM;;;;;;;;sBAxC/B,YAAO;AAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Modal.mjs","sources":["../../../../src/components/Modal/Modal.vue"],"sourcesContent":["<template>\n <teleport :to=\"toDom\">\n <div :id=\"id\" v-bind=\"$attrs\" :class=\"`${prefixCls}-root`\">\n <transition name=\"fade\" appear>\n <div v-show=\"visible\" v-if=\"mask && !draggable && !fullScreen\" :class=\"`${prefixCls}-mask`\" :style=\"{ ...zIndexStyle, ...positionStyle }\" />\n </transition>\n <div\n :class=\"[\n `${prefixCls}-wrap`,\n\n ...customClass,\n {\n [`${prefixCls}-no-mask`]: draggable,\n [`${prefixCls}-visible`]: wrapVisible,\n [`${prefixCls}-full-screen`]: fullScreen\n }\n ]\"\n :style=\"{ ...zIndexStyle, ...positionStyle }\"\n @click=\"onMaskClick\"\n @mousedown=\"onMaskMouseDown\"\n >\n <transition :name=\"fullScreen ? 'zoom-big-fast' : 'zoom-big'\" appear @after-leave=\"afterLeave\" @after-enter=\"handleAnimationEnd\">\n <div v-show=\"visible\" :class=\"`${prefixCls}-container`\" :style=\"transitionDivStyle\">\n <div\n ref=\"contentRef\"\n :class=\"[\n `${prefixCls}`,\n `${prefixCls}-size-${size}`,\n {\n [`${prefixCls}-drag`]: draggable,\n [`${prefixCls}-dragging`]: draggable && dragData.dragging,\n [`${prefixCls}-no-title`]: !showHead\n }\n ]\"\n :style=\"modalStyles\"\n @mousedown=\"onmMouseStart\"\n >\n <button v-if=\"closable\" data-not-drag-target :class=\"`${prefixCls}-close`\" @click=\"handleClose('close')\">\n <slot name=\"close\">\n <UIcon :class=\"`${prefixCls}-close-x`\" flex>\n <component :is=\"closeIcon\" />\n </UIcon>\n </slot>\n </button>\n <div v-if=\"showHead\" key=\"header\" ref=\"header\" :class=\"`${prefixCls}-header`\">\n <slot name=\"header\">\n <div :class=\"`${prefixCls}-title`\">{{ title }}</div>\n <div v-if=\"description\" :class=\"`${prefixCls}-description`\">{{ description }}</div>\n </slot>\n </div>\n <div\n :class=\"[\n `${prefixCls}-body ${$attrs.class || ''}`,\n { [`${prefixCls}-body-footer-hide`]: footerHide, [`${prefixCls}-body-head-hide`]: !showHead }\n ]\"\n >\n <slot />\n </div>\n <div v-if=\"!footerHide\" :class=\"`${prefixCls}-footer`\">\n <slot name=\"footer\">\n <UButton data-not-drag-target type=\"default\" :size=\"size\" @click=\"handleClose('cancel')\">\n {{ cancelText || computedLocale.cancelText }}\n </UButton>\n <UButton data-not-drag-target type=\"primary\" :size=\"size\" :loading=\"loading\" @click=\"handleOk\">\n {{ okText || computedLocale.okText }}\n </UButton>\n </slot>\n </div>\n </div>\n </div>\n </transition>\n </div>\n </div>\n </teleport>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, onMounted, onBeforeUnmount, watch, reactive, shallowRef } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport UIcon from '@uxd-ui/components/Icon';\nimport UButton from '@uxd-ui/components/Button';\nimport useGlobalConfig from '../base/hooks/useGlobalConfig';\nimport { setBodyStyle } from '../../utils/tools';\nimport { type DragData, modalProps, modalEmits, type ModalCloseType } from './Modal.type';\n\nlet openModalCount = 0;\nlet modalsList: ((e?: any) => void)[] = [];\n\nexport default defineComponent({\n name: 'UModal',\n components: {\n UIcon,\n UButton\n },\n inheritAttrs: false,\n props: modalProps,\n emits: modalEmits,\n setup(props, { emit, slots }) {\n const { prefixCls, config: globalConfig } = useGlobalConfig('modal');\n const contentRef = shallowRef<HTMLElement | null>(null);\n const dragData = reactive({\n x: 0,\n y: 0,\n eventX: null,\n eventY: null,\n dragging: false\n } as DragData);\n const isMouseIn = ref(false);\n const wrapVisible = ref(false);\n // ===================== computed ============================\n\n const computedLocale = computed(() => {\n return props.locale || globalConfig.locale.modal;\n });\n\n const zIndexStyle = computed(() => {\n return props.zIndex !== undefined ? { zIndex: props.zIndex } : {};\n });\n const showHead = computed(() => {\n return slots.header || props.title;\n });\n const modalStyles = computed(() => {\n const style = {} as CSSProperties;\n if (props.fullScreen) {\n style.width = '100%';\n style.height = '100%';\n } else {\n const width = typeof props.width === 'number' ? `${props.width}px` : props.width;\n style.width = width;\n // if (!props.vertical) {\n // style.marginTop = `${props.top}px`;\n // }\n }\n if (props.draggable) {\n style.transform = `translate(${dragData.x}px, ${dragData.y}px)`;\n }\n return {\n ...style,\n ...props.dialogStyle\n } as CSSProperties;\n });\n const toDom = computed(() => {\n if (!props.parentDom) {\n return 'body';\n }\n if (typeof props.parentDom === 'function') {\n return props.parentDom() || 'body';\n }\n return props.parentDom;\n });\n const positionStyle = computed(() => {\n const style: CSSProperties = {};\n if (toDom.value !== 'body') {\n style.position = 'absolute';\n }\n return style;\n });\n\n // ===================== methods ============================\n\n const handleClose = (type: ModalCloseType) => {\n emit('update:visible', false);\n emit('close', type);\n };\n const handleOk = (e: Event) => {\n emit('ok', e);\n };\n\n const handleVisible = () => {\n if (props.visible) {\n openModalCount += 1;\n wrapVisible.value = true;\n } else {\n openModalCount = openModalCount > 0 ? openModalCount - 1 : openModalCount;\n }\n if (openModalCount) {\n modalsList.push(() => handleClose('esc'));\n if (toDom.value === 'body') setBodyStyle(true);\n } else if (toDom.value === 'body') setBodyStyle(false);\n };\n\n const onMaskClick = (e: Event) => {\n if (!props.maskClosable) return;\n if (isMouseIn.value && props.draggable) {\n isMouseIn.value = false;\n return;\n }\n if (e.target === e.currentTarget) {\n handleClose('mask');\n }\n };\n\n const onMaskMouseDown = () => {\n isMouseIn.value = true;\n };\n\n const onKeyDown = (e: any) => {\n if (props.visible && e.keyCode === 27 && openModalCount) {\n e.stopPropagation();\n modalsList[openModalCount - 1]();\n }\n };\n // ===================== drag ============================\n const onMoveing = (event: any) => {\n const distanceX = event.clientX - dragData.eventX;\n const distanceY = event.clientY - dragData.eventY;\n dragData.eventX = event.clientX;\n dragData.eventY = event.clientY;\n\n dragData.x += distanceX;\n dragData.y += distanceY;\n };\n const onMoveEnd = () => {\n dragData.eventX = null;\n dragData.eventY = null;\n dragData.dragging = false;\n window.removeEventListener('mousemove', onMoveing);\n window.removeEventListener('mouseup', onMoveEnd);\n };\n\n const onmMouseStart = (event: any) => {\n if (!props.draggable || !contentRef.value) return;\n if (event.target.closest('[data-not-drag-target]')) return;\n // if (event.target === contentRef.value) return;\n\n dragData.eventX = event.clientX;\n dragData.eventY = event.clientY;\n dragData.dragging = true;\n\n window.addEventListener('mousemove', onMoveing);\n window.addEventListener('mouseup', onMoveEnd);\n };\n\n const handleAnimationEnd = () => {\n emit('after-visible-change', wrapVisible.value);\n };\n\n const afterLeave = () => {\n wrapVisible.value = false;\n if (props.afterClose) {\n props.afterClose();\n }\n if (!openModalCount) {\n if (toDom.value === 'body') setBodyStyle(false);\n modalsList = [];\n }\n handleAnimationEnd();\n };\n\n // ===================== watch ==============================\n watch(\n () => props.visible,\n () => {\n handleVisible();\n }\n );\n\n const transitionDivStyle = computed(() => {\n if (contentRef.value && props.mousePosition) {\n const rect = contentRef.value.getBoundingClientRect();\n const transformOrigin = `${props.mousePosition.x - rect.left}px ${props.mousePosition.y - rect.top}px`;\n return {\n transformOrigin\n };\n }\n return {};\n });\n\n onMounted(() => {\n document.addEventListener('keydown', onKeyDown);\n\n handleVisible();\n });\n\n onBeforeUnmount(() => {\n document.removeEventListener('keydown', onKeyDown);\n if (props.visible) {\n openModalCount = openModalCount > 0 ? openModalCount - 1 : openModalCount;\n afterLeave();\n }\n });\n\n return {\n prefixCls,\n wrapVisible,\n contentRef,\n toDom,\n positionStyle,\n showHead,\n zIndexStyle,\n modalStyles,\n transitionDivStyle,\n computedLocale,\n dragData,\n handleClose,\n handleOk,\n onMaskClick,\n onMaskMouseDown,\n afterLeave,\n onmMouseStart,\n onKeyDown,\n handleAnimationEnd\n };\n }\n});\n</script>\n\n<style></style>\n"],"names":["_createBlock","_Teleport","_createElementVNode","_mergeProps","_createVNode","_Transition","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_resolveDynamicComponent"],"mappings":";;;;;;;;AAqFA,IAAI,iBAAiB;AACrB,IAAI,aAAoC;AAExC,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA;AACF,EACA,cAAc;AAAA,EACd,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM,OAAO,EAAE,MAAM,SAAS;UACtB,EAAE,WAAW,QAAQ,iBAAiB,gBAAgB,OAAO;UAC7D,aAAa,WAA+B,IAAI;UAChD,WAAW,SAAS;AAAA,MACxB,GAAG;AAAA,MACH,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,UAAU;AAAA,KACC;UACP,YAAY,IAAI,KAAK;UACrB,cAAc,IAAI,KAAK;UAGvB,iBAAiB,SAAS,MAAM;aAC7B,MAAM,UAAU,aAAa,OAAO;AAAA,KAC5C;UAEK,cAAc,SAAS,MAAM;aAC1B,MAAM,WAAW,SAAY,EAAE,QAAQ,MAAM,WAAW;AAAC,KACjE;UACK,WAAW,SAAS,MAAM;aACvB,MAAM,UAAU,MAAM;AAAA,KAC9B;UACK,cAAc,SAAS,MAAM;YAC3B,QAAQ;UACV,MAA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A,oBAFLP,mBAAoD;sBAA9C,OAAKK,kBAAK,sBAAS;AAAA,uCAAa,UAAK;oBAChC,iCAAXD,mBAAmF;;sBAA1D,OAAKC,kBAAK,4BAAS;AAAA,uCAAmB,gBAAW;;;gBAG9EL,mBAOM;kBANH,OAAKK;uBAAyB,uBAAkB,YAAO,SAAK;AAAA,0BAAkC,oCAA+B,iBAAU,IAAM,kCAAS,CAAqB;AAAQ;;kBAKpLE,WAAQ;;iBAEE,gCAAZH,mBASM;;kBATmB,OAAKC,kBAAK,uBAAS;AAAA;kBAC1CE,WAOO,2BAPP,MAOO;AAAA,oBANLL,YAEU;sBAFD;sBAAqB,MAAK;AAAA,sBAAW,MAAM;sBAAO,SAAK,sCAAE,iBAAW;;uCAC3E,MAA6C;AAAA,wDAA1C,mBAAc,oBAAe,UAAU;;;;oBAE5CA,YAEU;sBAFD;sBAAqB,MAAK;AAAA,sBAAW,MAAM;sBAAO,SAAS;sBAAU,SAAO;;uCACnF,MAAqC;AAAA,wDAAlC,eAAU,oBAAe,MAAM;;;;;;;;sBA1C/B,YAAO;AAAA;;;;;;;;;;;;"}
|
|
@@ -12,7 +12,14 @@ export declare const modalProps: {
|
|
|
12
12
|
type: BooleanConstructor;
|
|
13
13
|
default: boolean;
|
|
14
14
|
};
|
|
15
|
-
title:
|
|
15
|
+
title: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
description: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
16
23
|
closable: {
|
|
17
24
|
type: BooleanConstructor;
|
|
18
25
|
default: boolean;
|
|
@@ -53,10 +60,6 @@ export declare const modalProps: {
|
|
|
53
60
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
54
61
|
};
|
|
55
62
|
afterClose: PropType<() => void>;
|
|
56
|
-
vertical: {
|
|
57
|
-
type: BooleanConstructor;
|
|
58
|
-
default: boolean;
|
|
59
|
-
};
|
|
60
63
|
locale: PropType<ModalLocal>;
|
|
61
64
|
top: {
|
|
62
65
|
type: NumberConstructor;
|
|
@@ -9,7 +9,14 @@ const modalProps = {
|
|
|
9
9
|
type: Boolean,
|
|
10
10
|
default: false
|
|
11
11
|
},
|
|
12
|
-
title:
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
13
20
|
closable: {
|
|
14
21
|
type: Boolean,
|
|
15
22
|
default: false
|
|
@@ -50,10 +57,6 @@ const modalProps = {
|
|
|
50
57
|
default: () => X
|
|
51
58
|
},
|
|
52
59
|
afterClose: Function,
|
|
53
|
-
vertical: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: false
|
|
56
|
-
},
|
|
57
60
|
locale: Object,
|
|
58
61
|
top: {
|
|
59
62
|
type: Number,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.type.mjs","sources":["../../../../src/components/Modal/Modal.type.ts"],"sourcesContent":["import type { CSSProperties, ExtractPropTypes, PropType, VNodeChild } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport type { IconPropType } from '../../utils/globalType';\nimport type { ModalLocal } from '../locale/default';\nimport type { ParentDom } from '../Drawer/Drawer.type';\n\nimport type Modal from './Modal.vue';\n\nexport const modalProps = {\n parentDom: {\n type: [String, Function] as PropType<ParentDom>,\n default: 'body'\n },\n visible: {\n type: Boolean,\n default: false\n },\n title: String,\n closable: {\n type: Boolean,\n default: false\n },\n maskClosable: {\n type: Boolean,\n default: true\n },\n loading: {\n type: Boolean,\n default: false\n },\n fullScreen: {\n type: Boolean,\n default: false\n },\n draggable: {\n type: Boolean,\n default: false\n },\n mask: {\n type: Boolean,\n default: true\n },\n okText: String,\n cancelText: String,\n width: {\n type: [String, Number],\n default: 520\n },\n footerHide: {\n type: Boolean,\n default: false\n },\n zIndex: Number,\n closeIcon: {\n type: [String, Object, Function] as PropType<IconPropType>,\n default: () => X\n },\n afterClose: Function as PropType<() => void>,\n
|
|
1
|
+
{"version":3,"file":"Modal.type.mjs","sources":["../../../../src/components/Modal/Modal.type.ts"],"sourcesContent":["import type { CSSProperties, ExtractPropTypes, PropType, VNodeChild } from 'vue';\nimport { X } from 'lucide-vue-next';\nimport type { IconPropType } from '../../utils/globalType';\nimport type { ModalLocal } from '../locale/default';\nimport type { ParentDom } from '../Drawer/Drawer.type';\n\nimport type Modal from './Modal.vue';\n\nexport const modalProps = {\n parentDom: {\n type: [String, Function] as PropType<ParentDom>,\n default: 'body'\n },\n visible: {\n type: Boolean,\n default: false\n },\n title: {\n type: String,\n default: ''\n },\n description: {\n type: String,\n default: ''\n },\n closable: {\n type: Boolean,\n default: false\n },\n maskClosable: {\n type: Boolean,\n default: true\n },\n loading: {\n type: Boolean,\n default: false\n },\n fullScreen: {\n type: Boolean,\n default: false\n },\n draggable: {\n type: Boolean,\n default: false\n },\n mask: {\n type: Boolean,\n default: true\n },\n okText: String,\n cancelText: String,\n width: {\n type: [String, Number],\n default: 520\n },\n footerHide: {\n type: Boolean,\n default: false\n },\n zIndex: Number,\n closeIcon: {\n type: [String, Object, Function] as PropType<IconPropType>,\n default: () => X\n },\n afterClose: Function as PropType<() => void>,\n locale: Object as PropType<ModalLocal>,\n top: {\n type: Number,\n default: 100\n },\n // confirm\n customClass: {\n type: Array as PropType<string[]>,\n default: (): string[] => []\n },\n mousePosition: {\n type: Object as PropType<{ x: number; y: number } | undefined>\n },\n dialogStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({} as CSSProperties)\n },\n id: String,\n size: {\n type: String as PropType<'small' | 'default'>,\n default: 'default',\n validator: (val: string) => ['small', 'default'].includes(val)\n }\n};\n\nexport type ModalProps = ExtractPropTypes<typeof modalProps>;\n\nexport interface DragData {\n x: number | null;\n y: number | null;\n eventX: number | null;\n eventY: number | null;\n dragging: boolean;\n}\n\nexport const confirmDialogProps = {\n visible: {\n type: Boolean,\n default: false\n },\n width: {\n type: [String, Number]\n },\n type: String,\n content: [String, Function] as PropType<string | (() => VNodeChild)>,\n title: String,\n loading: {\n type: Boolean,\n default: false\n },\n okCancel: Boolean,\n iconName: [String, Object] as PropType<IconPropType>,\n okText: String,\n cancelText: String,\n close: Function as PropType<() => void>,\n afterClose: Function as PropType<() => void>,\n onOk: Function as PropType<() => void>,\n onCancel: Function as PropType<() => void>,\n id: String,\n locale: Object as PropType<ModalLocal>,\n\n closable: {\n type: Boolean,\n default: false\n },\n size: {\n type: String as PropType<'small' | 'default'>,\n default: 'default',\n validator: (val: string) => ['small', 'default'].includes(val)\n }\n};\n\nexport type ConfirmDialogProps = ExtractPropTypes<typeof confirmDialogProps>;\n\nexport const modalCloseType = ['cancel', 'mask', 'close', 'esc'] as const;\nexport type ModalCloseType = (typeof modalCloseType)[number];\n\nexport const modalEmits = {\n 'update:visible': (v: boolean) => typeof v === 'boolean',\n close: (type: ModalCloseType) => modalCloseType.includes(type),\n ok: (e: Event) => e instanceof Event,\n 'after-visible-change': (v: boolean) => typeof v === 'boolean'\n};\n\nexport type ModalEmits = typeof modalEmits;\n\nexport type ModalInstanceType = InstanceType<typeof Modal>;\n"],"names":[],"mappings":";;MAQa,aAAa;AAAA,EACxB,WAAW;AAAA,IACT,MAAM,CAAC,QAAQ,QAAQ;AAAA,IACvB,SAAS;AAAA;AACX,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,Y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Z,MAAM;AAAA,EACN,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,QAAQ;AAAA,EAER,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AACX,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW,CAAC,QAAgB,CAAC,SAAS,SAAS,EAAE,SAAS,GAAG;AAAA;AAEjE;MAIa,iBAAiB,CAAC,UAAU,QAAQ,SAAS,KAAK;MAGlD,aAAa;AAAA,EACxB,kBAAkB,CAAC,MAAe,OAAO,MAAM;AAAA,EAC/C,OAAO,CAAC,SAAyB,eAAe,SAAS,IAAI;AAAA,EAC7D,IAAI,CAAC,MAAa,aAAa;AAAA,EAC/B,wBAAwB,CAAC,MAAe,OAAO,MAAM;AACvD;;;;"}
|
|
@@ -9,7 +9,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
9
9
|
type: BooleanConstructor;
|
|
10
10
|
default: boolean;
|
|
11
11
|
};
|
|
12
|
-
title:
|
|
12
|
+
title: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
description: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
13
20
|
closable: {
|
|
14
21
|
type: BooleanConstructor;
|
|
15
22
|
default: boolean;
|
|
@@ -50,10 +57,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
50
57
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
51
58
|
};
|
|
52
59
|
afterClose: import("vue").PropType<() => void>;
|
|
53
|
-
vertical: {
|
|
54
|
-
type: BooleanConstructor;
|
|
55
|
-
default: boolean;
|
|
56
|
-
};
|
|
57
60
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
58
61
|
top: {
|
|
59
62
|
type: NumberConstructor;
|
|
@@ -127,7 +130,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
127
130
|
type: BooleanConstructor;
|
|
128
131
|
default: boolean;
|
|
129
132
|
};
|
|
130
|
-
title:
|
|
133
|
+
title: {
|
|
134
|
+
type: StringConstructor;
|
|
135
|
+
default: string;
|
|
136
|
+
};
|
|
137
|
+
description: {
|
|
138
|
+
type: StringConstructor;
|
|
139
|
+
default: string;
|
|
140
|
+
};
|
|
131
141
|
closable: {
|
|
132
142
|
type: BooleanConstructor;
|
|
133
143
|
default: boolean;
|
|
@@ -168,10 +178,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
168
178
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
169
179
|
};
|
|
170
180
|
afterClose: import("vue").PropType<() => void>;
|
|
171
|
-
vertical: {
|
|
172
|
-
type: BooleanConstructor;
|
|
173
|
-
default: boolean;
|
|
174
|
-
};
|
|
175
181
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
176
182
|
top: {
|
|
177
183
|
type: NumberConstructor;
|
|
@@ -209,8 +215,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
209
215
|
size: "small" | "default";
|
|
210
216
|
width: string | number;
|
|
211
217
|
mask: boolean;
|
|
218
|
+
description: string;
|
|
212
219
|
visible: boolean;
|
|
213
|
-
|
|
220
|
+
title: string;
|
|
214
221
|
parentDom: import("..").ParentDom;
|
|
215
222
|
maskClosable: boolean;
|
|
216
223
|
fullScreen: boolean;
|
|
@@ -19,7 +19,14 @@ export declare const UModal: ({
|
|
|
19
19
|
type: BooleanConstructor;
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
|
-
title:
|
|
22
|
+
title: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
description: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
23
30
|
closable: {
|
|
24
31
|
type: BooleanConstructor;
|
|
25
32
|
default: boolean;
|
|
@@ -60,10 +67,6 @@ export declare const UModal: ({
|
|
|
60
67
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
61
68
|
};
|
|
62
69
|
afterClose: import("vue").PropType<() => void>;
|
|
63
|
-
vertical: {
|
|
64
|
-
type: BooleanConstructor;
|
|
65
|
-
default: boolean;
|
|
66
|
-
};
|
|
67
70
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
68
71
|
top: {
|
|
69
72
|
type: NumberConstructor;
|
|
@@ -140,8 +143,9 @@ export declare const UModal: ({
|
|
|
140
143
|
size: "small" | "default";
|
|
141
144
|
width: string | number;
|
|
142
145
|
mask: boolean;
|
|
146
|
+
description: string;
|
|
143
147
|
visible: boolean;
|
|
144
|
-
|
|
148
|
+
title: string;
|
|
145
149
|
parentDom: import("..").ParentDom;
|
|
146
150
|
maskClosable: boolean;
|
|
147
151
|
fullScreen: boolean;
|
|
@@ -857,7 +861,14 @@ export declare const UModal: ({
|
|
|
857
861
|
type: BooleanConstructor;
|
|
858
862
|
default: boolean;
|
|
859
863
|
};
|
|
860
|
-
title:
|
|
864
|
+
title: {
|
|
865
|
+
type: StringConstructor;
|
|
866
|
+
default: string;
|
|
867
|
+
};
|
|
868
|
+
description: {
|
|
869
|
+
type: StringConstructor;
|
|
870
|
+
default: string;
|
|
871
|
+
};
|
|
861
872
|
closable: {
|
|
862
873
|
type: BooleanConstructor;
|
|
863
874
|
default: boolean;
|
|
@@ -898,10 +909,6 @@ export declare const UModal: ({
|
|
|
898
909
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
899
910
|
};
|
|
900
911
|
afterClose: import("vue").PropType<() => void>;
|
|
901
|
-
vertical: {
|
|
902
|
-
type: BooleanConstructor;
|
|
903
|
-
default: boolean;
|
|
904
|
-
};
|
|
905
912
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
906
913
|
top: {
|
|
907
914
|
type: NumberConstructor;
|
|
@@ -973,8 +980,9 @@ export declare const UModal: ({
|
|
|
973
980
|
size: "small" | "default";
|
|
974
981
|
width: string | number;
|
|
975
982
|
mask: boolean;
|
|
983
|
+
description: string;
|
|
976
984
|
visible: boolean;
|
|
977
|
-
|
|
985
|
+
title: string;
|
|
978
986
|
parentDom: import("..").ParentDom;
|
|
979
987
|
maskClosable: boolean;
|
|
980
988
|
fullScreen: boolean;
|
|
@@ -996,7 +1004,14 @@ export declare const UModal: ({
|
|
|
996
1004
|
type: BooleanConstructor;
|
|
997
1005
|
default: boolean;
|
|
998
1006
|
};
|
|
999
|
-
title:
|
|
1007
|
+
title: {
|
|
1008
|
+
type: StringConstructor;
|
|
1009
|
+
default: string;
|
|
1010
|
+
};
|
|
1011
|
+
description: {
|
|
1012
|
+
type: StringConstructor;
|
|
1013
|
+
default: string;
|
|
1014
|
+
};
|
|
1000
1015
|
closable: {
|
|
1001
1016
|
type: BooleanConstructor;
|
|
1002
1017
|
default: boolean;
|
|
@@ -1037,10 +1052,6 @@ export declare const UModal: ({
|
|
|
1037
1052
|
default: () => import("vue").FunctionalComponent<import("lucide-vue-next").LucideProps, {}, any, {}>;
|
|
1038
1053
|
};
|
|
1039
1054
|
afterClose: import("vue").PropType<() => void>;
|
|
1040
|
-
vertical: {
|
|
1041
|
-
type: BooleanConstructor;
|
|
1042
|
-
default: boolean;
|
|
1043
|
-
};
|
|
1044
1055
|
locale: import("vue").PropType<import("../locale/default").ModalLocal>;
|
|
1045
1056
|
top: {
|
|
1046
1057
|
type: NumberConstructor;
|
|
@@ -1117,8 +1128,9 @@ export declare const UModal: ({
|
|
|
1117
1128
|
size: "small" | "default";
|
|
1118
1129
|
width: string | number;
|
|
1119
1130
|
mask: boolean;
|
|
1131
|
+
description: string;
|
|
1120
1132
|
visible: boolean;
|
|
1121
|
-
|
|
1133
|
+
title: string;
|
|
1122
1134
|
parentDom: import("..").ParentDom;
|
|
1123
1135
|
maskClosable: boolean;
|
|
1124
1136
|
fullScreen: boolean;
|
|
@@ -42,6 +42,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
42
42
|
type: NumberConstructor;
|
|
43
43
|
default: number;
|
|
44
44
|
};
|
|
45
|
+
totalPage: {
|
|
46
|
+
type: NumberConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
45
49
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
50
|
'change-page-size': (v: number) => boolean;
|
|
47
51
|
'change-page': (v: number) => boolean;
|
|
@@ -88,6 +92,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
88
92
|
type: NumberConstructor;
|
|
89
93
|
default: number;
|
|
90
94
|
};
|
|
95
|
+
totalPage: {
|
|
96
|
+
type: NumberConstructor;
|
|
97
|
+
required: true;
|
|
98
|
+
};
|
|
91
99
|
}>> & Readonly<{
|
|
92
100
|
"onChange-page-size"?: (v: number) => any;
|
|
93
101
|
"onChange-page"?: (v: number) => any;
|
|
@@ -54,6 +54,10 @@ var Options = defineComponent({
|
|
|
54
54
|
dropdownWidth: {
|
|
55
55
|
type: Number,
|
|
56
56
|
default: 128
|
|
57
|
+
},
|
|
58
|
+
totalPage: {
|
|
59
|
+
type: Number,
|
|
60
|
+
required: true
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
emits: {
|
|
@@ -127,7 +131,8 @@ var Options = defineComponent({
|
|
|
127
131
|
"modelValue": stateValue.value,
|
|
128
132
|
"onUpdate:modelValue": ($event) => stateValue.value = $event,
|
|
129
133
|
"onKeyup": handleJumpTo,
|
|
130
|
-
"onBlur": handleBlur
|
|
134
|
+
"onBlur": handleBlur,
|
|
135
|
+
"inputSize": props.totalPage.toString().length
|
|
131
136
|
}, null), createVNode("span", null, [props.locale.page])]);
|
|
132
137
|
}
|
|
133
138
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Options.mjs","sources":["../../../../src/components/Pagination/Options.tsx"],"sourcesContent":["import { ref, watch, defineComponent } from 'vue';\nimport type { PropType, Ref } from 'vue';\nimport USelect from '@uxd-ui/components/Select';\nimport UInput from '@uxd-ui/components/Input';\nimport keyCode from '../../utils/KeyCode';\nimport Render from '../base/Render';\nimport type { SelectValueType } from '../Select/Select.type';\nimport type { NormalSizeMap } from '../../utils/globalType';\n\nexport default defineComponent({\n name: 'PaginationOption',\n components: {\n Render\n },\n props: {\n prefixCls: {\n type: String\n },\n current: {\n type: Number,\n required: true\n },\n showSizer: {\n type: Boolean,\n default: false\n },\n pageSizeOptions: {\n type: Array as PropType<number[]>,\n required: true\n },\n locale: {\n type: Object,\n required: true\n },\n disabled: {\n type: Boolean,\n default: false\n },\n pageSize: {\n type: Number\n },\n showElevator: {\n type: Boolean,\n default: false\n },\n size: {\n type: String as PropType<NormalSizeMap>,\n default: 'default'\n },\n variant: {\n type: String as PropType<'soft' | 'surface' | 'simple'>,\n default: 'surface'\n },\n dropdownWidth: {\n type: Number,\n default: 128\n }\n },\n emits: {\n 'change-page-size': (v: number) => typeof v === 'number',\n 'change-page': (v: number) => typeof v === 'number'\n },\n setup(props, { emit }) {\n const stateValue: Ref<string> = ref(props.current.toString());\n const changeSize = (value: number) => {\n stateValue.value = props.current.toString();\n emit('change-page-size', value);\n };\n watch(\n () => props.current,\n (value) => {\n stateValue.value = value.toString();\n }\n );\n\n const handleBlur = () => {\n const value = !stateValue.value || Number.isNaN(Number(stateValue.value)) ? props.current : Number(stateValue.value);\n emit('change-page', value);\n };\n const handleJumpTo = (e: any) => {\n if (stateValue.value === '') return;\n if (e.keyCode === keyCode.ENTER || e.type === 'click') {\n emit('change-page', Number(stateValue.value));\n }\n };\n\n return () => {\n const { prefixCls, showSizer, size, disabled, pageSize, locale } = props;\n\n const renderSelect = () => {\n if (showSizer) {\n const options = props.pageSizeOptions.map((opt) => {\n return {\n value: opt,\n label: `${opt}${locale.item}/${locale.page}`\n };\n });\n\n const cls = `${prefixCls}-options-size-changer`;\n return (\n <USelect\n class={cls}\n disabled={disabled}\n size={size}\n modelValue={pageSize}\n options={options}\n onChange={(value: SelectValueType) => changeSize(Number(value))}\n clearable={false}\n variant={props.variant !== 'simple' ? props.variant : undefined}\n dropdownMenuWidth={props.dropdownWidth}\n >\n {options}\n </USelect>\n );\n }\n return null;\n };\n\n const renderJumpInput = () => {\n if (props.showElevator) {\n return (\n <div class={`${props.prefixCls}-options-quick-jumper`}>\n <span>{props.locale.jumpTo}</span>\n <UInput\n disabled={props.disabled}\n size={size}\n variant={props.variant !== 'simple' ? props.variant : undefined}\n v-model={stateValue.value}\n onKeyup={handleJumpTo}\n onBlur={handleBlur}\n />\n <span>{props.locale.page}</span>\n </div>\n );\n }\n return null;\n };\n\n return (\n <li class={`${prefixCls}-options`}>\n {renderSelect()}\n {renderJumpInput()}\n </li>\n );\n };\n }\n});\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","components","Render","props","prefixCls","type","String","current","Number","required","showSizer","Boolean","default","pageSizeOptions","Array","locale","disabled","pageSize","showElevator","size","variant","dropdownWidth","emits","v","setup","emit","stateValue","ref","changeSize","value","watch","handleBlur","isNaN","handleJumpTo","e","keyCode","ENTER","renderSelect","options","map","opt","label","item","page","cls","_createVNode","USelect","undefined","renderJumpInput","jumpTo","UInput","$event"],"mappings":";;;;;;AAKoC,SAAAA,QAAAC;AAAA,gBAAAA,oBAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,4BAAAK,QAAAL,CAAA;AAAA;AAIpC,cAAeM,gBAAgB;AAAA,EAC7BC,MAAM;AAAA,EACNC,YAAY;AAAA,IACVC;AAAAA;AACF,EACAC,OAAO;AAAA,IACLC,WAAW;AAAA,MACTC,MAAMC;AAAAA;AACR,IACAC,SAAS;AAAA,MACPF,MAAMG;AAAAA,MACNC,UAAU;AAAA;AACZ,IACAC,WAAW;AAAA,MACTL,MAAMM;AAAAA,MACNC,SAAS;AAAA;AACX,IACAC,iBAAiB;AAAA,MACfR,MAAMS;AAAAA,MACNL,UAAU;AAAA;AACZ,IACAM,QAAQ;AAAA,MACNV,MAAMX;AAAAA,MACNe,UAAU;AAAA;AACZ,IACAO,UAAU;AAAA,MACRX,MAAMM;AAAAA,MACNC,SAAS;AAAA;AACX,IACAK,UAAU;AAAA,MACRZ,MAAMG;AAAAA;AACR,IACAU,cAAc;AAAA,MACZb,MAAMM;AAAAA,MACNC,SAAS;AAAA;AACX,IACAO,MAAM;AAAA,MACJd,MAAMC;AAAAA,MACNM,SAAS;AAAA;AACX,IACAQ,SAAS;AAAA,MACPf,MAAMC;AAAAA,MACNM,SAAS;AAAA;AACX,IACAS,eAAe;AAAA,MACbhB,MAAMG;AAAAA,MACNI,SAAS;AAAA;AACX;AACF,
|
|
1
|
+
{"version":3,"file":"Options.mjs","sources":["../../../../src/components/Pagination/Options.tsx"],"sourcesContent":["import { ref, watch, defineComponent } from 'vue';\nimport type { PropType, Ref } from 'vue';\nimport USelect from '@uxd-ui/components/Select';\nimport UInput from '@uxd-ui/components/Input';\nimport keyCode from '../../utils/KeyCode';\nimport Render from '../base/Render';\nimport type { SelectValueType } from '../Select/Select.type';\nimport type { NormalSizeMap } from '../../utils/globalType';\n\nexport default defineComponent({\n name: 'PaginationOption',\n components: {\n Render\n },\n props: {\n prefixCls: {\n type: String\n },\n current: {\n type: Number,\n required: true\n },\n showSizer: {\n type: Boolean,\n default: false\n },\n pageSizeOptions: {\n type: Array as PropType<number[]>,\n required: true\n },\n locale: {\n type: Object,\n required: true\n },\n disabled: {\n type: Boolean,\n default: false\n },\n pageSize: {\n type: Number\n },\n showElevator: {\n type: Boolean,\n default: false\n },\n size: {\n type: String as PropType<NormalSizeMap>,\n default: 'default'\n },\n variant: {\n type: String as PropType<'soft' | 'surface' | 'simple'>,\n default: 'surface'\n },\n dropdownWidth: {\n type: Number,\n default: 128\n },\n totalPage: {\n type: Number,\n required: true\n }\n },\n emits: {\n 'change-page-size': (v: number) => typeof v === 'number',\n 'change-page': (v: number) => typeof v === 'number'\n },\n setup(props, { emit }) {\n const stateValue: Ref<string> = ref(props.current.toString());\n const changeSize = (value: number) => {\n stateValue.value = props.current.toString();\n emit('change-page-size', value);\n };\n watch(\n () => props.current,\n (value) => {\n stateValue.value = value.toString();\n }\n );\n\n const handleBlur = () => {\n const value = !stateValue.value || Number.isNaN(Number(stateValue.value)) ? props.current : Number(stateValue.value);\n emit('change-page', value);\n };\n const handleJumpTo = (e: any) => {\n if (stateValue.value === '') return;\n if (e.keyCode === keyCode.ENTER || e.type === 'click') {\n emit('change-page', Number(stateValue.value));\n }\n };\n\n return () => {\n const { prefixCls, showSizer, size, disabled, pageSize, locale } = props;\n\n const renderSelect = () => {\n if (showSizer) {\n const options = props.pageSizeOptions.map((opt) => {\n return {\n value: opt,\n label: `${opt}${locale.item}/${locale.page}`\n };\n });\n\n const cls = `${prefixCls}-options-size-changer`;\n return (\n <USelect\n class={cls}\n disabled={disabled}\n size={size}\n modelValue={pageSize}\n options={options}\n onChange={(value: SelectValueType) => changeSize(Number(value))}\n clearable={false}\n variant={props.variant !== 'simple' ? props.variant : undefined}\n dropdownMenuWidth={props.dropdownWidth}\n >\n {options}\n </USelect>\n );\n }\n return null;\n };\n\n const renderJumpInput = () => {\n if (props.showElevator) {\n return (\n <div class={`${props.prefixCls}-options-quick-jumper`}>\n <span>{props.locale.jumpTo}</span>\n <UInput\n disabled={props.disabled}\n size={size}\n variant={props.variant !== 'simple' ? props.variant : undefined}\n v-model={stateValue.value}\n onKeyup={handleJumpTo}\n onBlur={handleBlur}\n inputSize={props.totalPage.toString().length}\n />\n <span>{props.locale.page}</span>\n </div>\n );\n }\n return null;\n };\n\n return (\n <li class={`${prefixCls}-options`}>\n {renderSelect()}\n {renderJumpInput()}\n </li>\n );\n };\n }\n});\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","defineComponent","name","components","Render","props","prefixCls","type","String","current","Number","required","showSizer","Boolean","default","pageSizeOptions","Array","locale","disabled","pageSize","showElevator","size","variant","dropdownWidth","totalPage","emits","v","setup","emit","stateValue","ref","changeSize","value","watch","handleBlur","isNaN","handleJumpTo","e","keyCode","ENTER","renderSelect","options","map","opt","label","item","page","cls","_createVNode","USelect","undefined","renderJumpInput","jumpTo","UInput","$event","length"],"mappings":";;;;;;AAKoC,SAAAA,QAAAC;AAAA,gBAAAA,oBAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,4BAAAK,QAAAL,CAAA;AAAA;AAIpC,cAAeM,gBAAgB;AAAA,EAC7BC,MAAM;AAAA,EACNC,YAAY;AAAA,IACVC;AAAAA;AACF,EACAC,OAAO;AAAA,IACLC,WAAW;AAAA,MACTC,MAAMC;AAAAA;AACR,IACAC,SAAS;AAAA,MACPF,MAAMG;AAAAA,MACNC,UAAU;AAAA;AACZ,IACAC,WAAW;AAAA,MACTL,MAAMM;AAAAA,MACNC,SAAS;AAAA;AACX,IACAC,iBAAiB;AAAA,MACfR,MAAMS;AAAAA,MACNL,UAAU;AAAA;AACZ,IACAM,QAAQ;AAAA,MACNV,MAAMX;AAAAA,MACNe,UAAU;AAAA;AACZ,IACAO,UAAU;AAAA,MACRX,MAAMM;AAAAA,MACNC,SAAS;AAAA;AACX,IACAK,UAAU;AAAA,MACRZ,MAAMG;AAAAA;AACR,IACAU,cAAc;AAAA,MACZb,MAAMM;AAAAA,MACNC,SAAS;AAAA;AACX,IACAO,MAAM;AAAA,MACJd,MAAMC;AAAAA,MACNM,SAAS;AAAA;AACX,IACAQ,SAAS;AAAA,MACPf,MAAMC;AAAAA,MACNM,SAAS;AAAA;AACX,IACAS,eAAe;AAAA,MACbhB,MAAMG;AAAAA,MACNI,SAAS;AAAA;AACX,IACAU,WAAW;AAAA,MACTjB,MAAMG;AAAAA,MACNC,UAAU;AAAA;AACZ;AACF,EACAc,OAAO;AAAA,IACL,oBAAqBC,OAAc,OAAO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AAO,YACLT,WAA2BD,WAAWrB,OAAOsB,KAAK,CAAC;AAAA,YAAC,aACpD;AAAA,YAAK,WACP3B,MAAMiB,YAAY,WAAWjB,MAAMiB,UAAU4B;AAAAA,YAAS,qBAC5C7C,MAAMkB;AAAAA,aAAa7B,QAErC+C,OAAO,IAAPA;YAAO3B,SAAAA,OAAP2B,OAAO;AAAA;;AAId,eAAO;AAAA;AAGT,YAAMU,kBAAkBA,MAAM;AAC5B,YAAI9C,MAAMe,cAAc;AACtB,iBAAA4B;YAAA,SACc,GAAG3C,MAAMC;AAAAA,cAAgC0C,2BAC5C3C,MAAMY,OAAOmC,MAAM,IAAAJ,YAAAK;YAAA,YAEdhD,MAAMa;AAAAA,YAAQ,QAClBG;AAAAA,YAAI,WACDhB,MAAMiB,YAAY,WAAWjB,MAAMiB,UAAU4B;AAAAA,YAAS,cACtDrB,WAAWG;AAAAA,YAAK,uBAAAsB,YAAhBzB,WAAWG,QAAKsB;AAAAA,YAAA,WAChBlB;AAAAA,YAAY,UACbF;AAAAA,YAAU,aACP7B,MAAMmB,UAAU1B,WAAWyD;AAAAA,oBAAMP,2BAEvC3C,MAAMY,OAAO6B,IAAI;;AAI9B,eAAO;AAAA;AAGT,aAAAE;QAAA,SACa,GAAG1C;AAAAA,UACXkC,gBACAW,iBAAiB;;AAGxB;AAEJ,CAAC;;;;"}
|
|
@@ -436,6 +436,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
436
436
|
type: NumberConstructor;
|
|
437
437
|
default: number;
|
|
438
438
|
};
|
|
439
|
+
totalPage: {
|
|
440
|
+
type: NumberConstructor;
|
|
441
|
+
required: true;
|
|
442
|
+
};
|
|
439
443
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
440
444
|
'change-page-size': (v: number) => boolean;
|
|
441
445
|
'change-page': (v: number) => boolean;
|
|
@@ -482,6 +486,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
482
486
|
type: NumberConstructor;
|
|
483
487
|
default: number;
|
|
484
488
|
};
|
|
489
|
+
totalPage: {
|
|
490
|
+
type: NumberConstructor;
|
|
491
|
+
required: true;
|
|
492
|
+
};
|
|
485
493
|
}>> & Readonly<{
|
|
486
494
|
"onChange-page-size"?: (v: number) => any;
|
|
487
495
|
"onChange-page"?: (v: number) => any;
|
|
@@ -222,6 +222,7 @@ var Pagination = defineComponent({
|
|
|
222
222
|
"modelValue": this.stateCurrent,
|
|
223
223
|
"disabled": this.disabled,
|
|
224
224
|
"size": this.size,
|
|
225
|
+
"inputSize": this.totalPage.toString().length,
|
|
225
226
|
"onKeyup": this.onKeyUp,
|
|
226
227
|
"onKeydown": this.onKeyDown,
|
|
227
228
|
"onBlur": this.onBlur
|
|
@@ -271,6 +272,7 @@ var Pagination = defineComponent({
|
|
|
271
272
|
"dropdownWidth": this.selectDropdownWidth,
|
|
272
273
|
"variant": this.variant,
|
|
273
274
|
"pageSizeOptions": this.pageSizeOptions,
|
|
275
|
+
"totalPage": this.totalPage,
|
|
274
276
|
"onChange-page-size": this.onChangePageSize,
|
|
275
277
|
"onChange-page": this.onChangePage
|
|
276
278
|
}, null)]);
|