提交 3a16f2b8 作者: vben

chore: adjust component file name

上级 83c9cd77
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
"sortablejs": "^1.13.0", "sortablejs": "^1.13.0",
"tinymce": "^5.8.1", "tinymce": "^5.8.1",
"vditor": "^3.8.5", "vditor": "^3.8.5",
"vue": "3.1.0-beta.4", "vue": "3.1.0-beta.5",
"vue-i18n": "9.1.6", "vue-i18n": "9.1.6",
"vue-json-pretty": "^2.0.2", "vue-json-pretty": "^2.0.2",
"vue-router": "^4.0.8", "vue-router": "^4.0.8",
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
"@vitejs/plugin-legacy": "^1.4.0", "@vitejs/plugin-legacy": "^1.4.0",
"@vitejs/plugin-vue": "^1.2.2", "@vitejs/plugin-vue": "^1.2.2",
"@vitejs/plugin-vue-jsx": "^1.1.4", "@vitejs/plugin-vue-jsx": "^1.1.4",
"@vue/compiler-sfc": "3.1.0-beta.4", "@vue/compiler-sfc": "3.1.0-beta.5",
"autoprefixer": "^10.2.6", "autoprefixer": "^10.2.6",
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.1.1", "conventional-changelog-cli": "^2.1.1",
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
"stylelint-config-standard": "^22.0.0", "stylelint-config-standard": "^22.0.0",
"stylelint-order": "^4.1.0", "stylelint-order": "^4.1.0",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",
"typescript": "4.2.4", "typescript": "4.3.2",
"vite": "2.3.3", "vite": "2.3.3",
"vite-plugin-compression": "^0.2.5", "vite-plugin-compression": "^0.2.5",
"vite-plugin-html": "^2.0.7", "vite-plugin-html": "^2.0.7",
......
import Authority from './src/index.vue'; import Authority from './src/Authority.vue';
export { Authority }; export { Authority };
import ClickOutSide from './src/index.vue'; import ClickOutSide from './src/ClickOutSide.vue';
export { ClickOutSide }; export { ClickOutSide };
...@@ -33,24 +33,22 @@ export default defineComponent({ ...@@ -33,24 +33,22 @@ export default defineComponent({
const wrapRef = ref<ElRef>(null); const wrapRef = ref<ElRef>(null);
const showRef = ref(false); const showRef = ref(false);
const getStyle = computed( const getStyle = computed((): CSSProperties => {
(): CSSProperties => { const { axis, items, styles, width } = props;
const { axis, items, styles, width } = props; const { x, y } = axis || { x: 0, y: 0 };
const { x, y } = axis || { x: 0, y: 0 }; const menuHeight = (items || []).length * 40;
const menuHeight = (items || []).length * 40; const menuWidth = width;
const menuWidth = width; const body = document.body;
const body = document.body;
const left = body.clientWidth < x + menuWidth ? x - menuWidth : x;
const left = body.clientWidth < x + menuWidth ? x - menuWidth : x; const top = body.clientHeight < y + menuHeight ? y - menuHeight : y;
const top = body.clientHeight < y + menuHeight ? y - menuHeight : y; return {
return { ...styles,
...styles, width: `${width}px`,
width: `${width}px`, left: `${left + 1}px`,
left: `${left + 1}px`, top: `${top + 1}px`,
top: `${top + 1}px`, };
}; });
}
);
onMounted(() => { onMounted(() => {
nextTick(() => (showRef.value = true)); nextTick(() => (showRef.value = true));
......
import contextMenuVue from './index'; import contextMenuVue from './ContextMenu';
import { isClient } from '/@/utils/is'; import { isClient } from '/@/utils/is';
import { CreateContextOptions, ContextMenuProps } from './types'; import { CreateContextOptions, ContextMenuProps } from './types';
import { createVNode, render } from 'vue'; import { createVNode, render } from 'vue';
......
// Transform vue-count-to to support vue3 version // Transform vue-count-to to support vue3 version
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
export const CountTo = createAsyncComponent(() => import('./src/index.vue')); export const CountTo = createAsyncComponent(() => import('./src/CountTo.vue'));
import type Cropper from 'cropperjs'; import type Cropper from 'cropperjs';
export type { Cropper }; export type { Cropper };
export { default as CropperImage } from './src/index.vue'; export { default as CropperImage } from './src/Cropper.vue';
...@@ -76,22 +76,18 @@ ...@@ -76,22 +76,18 @@
const isReady = ref(false); const isReady = ref(false);
const getImageStyle = computed( const getImageStyle = computed((): CSSProperties => {
(): CSSProperties => { return {
return { height: props.height,
height: props.height, maxWidth: '100%',
maxWidth: '100%', ...props.imageStyle,
...props.imageStyle, };
}; });
}
);
const getWrapperStyle = computed( const getWrapperStyle = computed((): CSSProperties => {
(): CSSProperties => { const { height } = props;
const { height } = props; return { height: `${height}`.replace(/px/, '') + 'px' };
return { height: `${height}`.replace(/px/, '') + 'px' }; });
}
);
async function init() { async function init() {
const imgEl = unref(imgElRef); const imgEl = unref(imgElRef);
......
import Description from './src/index.vue'; import Description from './src/Description.vue';
export { Description }; export { Description };
export * from './src/types'; export * from './src/types';
......
...@@ -51,15 +51,13 @@ ...@@ -51,15 +51,13 @@
/** /**
* @description: Get configuration Collapse * @description: Get configuration Collapse
*/ */
const getCollapseOptions = computed( const getCollapseOptions = computed((): CollapseContainerOptions => {
(): CollapseContainerOptions => { return {
return { // Cannot be expanded by default
// Cannot be expanded by default canExpand: false,
canExpand: false, ...unref(getProps).collapseOptions,
...unref(getProps).collapseOptions, };
}; });
}
);
const getDescriptionsProps = computed(() => { const getDescriptionsProps = computed(() => {
return { ...unref(attrs), ...unref(getProps) } as DescriptionsProps; return { ...unref(attrs), ...unref(getProps) } as DescriptionsProps;
......
import type { App } from 'vue'; import type { App } from 'vue';
import flowChart from './src/index.vue'; import flowChart from './src/FlowChart.vue';
export const FlowChart = Object.assign(flowChart, { export const FlowChart = Object.assign(flowChart, {
install(app: App) { install(app: App) {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
const appStore = useAppStore(); const appStore = useAppStore();
const [register, { openModal }] = useModal(); const [register, { openModal }] = useModal();
createFlowChartContext({ createFlowChartContext({
logicFlow: (lfInstance as unknown) as LogicFlow, logicFlow: lfInstance as unknown as LogicFlow,
}); });
const getFlowOptions = computed(() => { const getFlowOptions = computed(() => {
......
import Icon from './src/index.vue'; import Icon from './src/Icon.vue';
import SvgIcon from './src/SvgIcon.vue'; import SvgIcon from './src/SvgIcon.vue';
import IconPicker from './src/IconPicker.vue'; import IconPicker from './src/IconPicker.vue';
......
...@@ -72,21 +72,19 @@ ...@@ -72,21 +72,19 @@
} }
}; };
const getWrapStyle = computed( const getWrapStyle = computed((): CSSProperties => {
(): CSSProperties => { const { size, color } = props;
const { size, color } = props; let fs = size;
let fs = size; if (isString(size)) {
if (isString(size)) { fs = parseInt(size, 10);
fs = parseInt(size, 10);
}
return {
fontSize: `${fs}px`,
color: color,
display: 'inline-flex',
};
} }
);
return {
fontSize: `${fs}px`,
color: color,
display: 'inline-flex',
};
});
watch(() => props.icon, update, { flush: 'post' }); watch(() => props.icon, update, { flush: 'post' });
......
...@@ -31,7 +31,18 @@ ...@@ -31,7 +31,18 @@
v-for="icon in getPaginationList" v-for="icon in getPaginationList"
:key="icon" :key="icon"
:class="currentSelect === icon ? 'border border-primary' : ''" :class="currentSelect === icon ? 'border border-primary' : ''"
class="p-2 w-1/8 cursor-pointer mr-1 mt-1 flex justify-center items-center border border-solid hover:border-primary" class="
p-2
w-1/8
cursor-pointer
mr-1
mt-1
flex
justify-center
items-center
border border-solid
hover:border-primary
"
@click="handleClick(icon)" @click="handleClick(icon)"
:title="icon" :title="icon"
> >
...@@ -71,7 +82,7 @@ ...@@ -71,7 +82,7 @@
import { ScrollContainer } from '/@/components/Container'; import { ScrollContainer } from '/@/components/Container';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue'; import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import Icon from './index.vue'; import Icon from './Icon.vue';
import SvgIcon from './SvgIcon.vue'; import SvgIcon from './SvgIcon.vue';
import iconsData from '../data/icons.data'; import iconsData from '../data/icons.data';
...@@ -108,9 +119,7 @@ ...@@ -108,9 +119,7 @@
width: propTypes.string.def('100%'), width: propTypes.string.def('100%'),
pageSize: propTypes.number.def(140), pageSize: propTypes.number.def(140),
copy: propTypes.bool.def(false), copy: propTypes.bool.def(false),
mode: propTypes mode: propTypes.oneOf<('svg' | 'iconify')[]>(['svg', 'iconify']).def('iconify'),
.oneOf<('svg' | 'iconify')[]>(['svg', 'iconify'])
.def('iconify'),
}, },
emits: ['change'], emits: ['change'],
setup(props, { emit }) { setup(props, { emit }) {
......
import Loading from './src/index.vue'; import Loading from './src/Loading.vue';
export { Loading }; export { Loading };
export { useLoading } from './src/useLoading'; export { useLoading } from './src/useLoading';
......
...@@ -2,7 +2,7 @@ import { VNode, defineComponent } from 'vue'; ...@@ -2,7 +2,7 @@ import { VNode, defineComponent } from 'vue';
import type { LoadingProps } from './types'; import type { LoadingProps } from './types';
import { createVNode, render, reactive, h } from 'vue'; import { createVNode, render, reactive, h } from 'vue';
import Loading from './index.vue'; import Loading from './Loading.vue';
export function createLoading(props?: Partial<LoadingProps>, target?: HTMLElement, wait = false) { export function createLoading(props?: Partial<LoadingProps>, target?: HTMLElement, wait = false) {
let vm: Nullable<VNode> = null; let vm: Nullable<VNode> = null;
......
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
export const MarkDown = createAsyncComponent(() => import('./src/index.vue')); export const MarkDown = createAsyncComponent(() => import('./src/Markdown.vue'));
export * from './src/types'; export * from './src/types';
export { default as ImagePreview } from './src/index.vue'; export { default as ImagePreview } from './src/Preview.vue';
export { default as QrCode } from './src/index.vue'; export { default as QrCode } from './src/Qrcode.vue';
export * from './src/types'; export * from './src/types';
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* copy from element-ui * copy from element-ui
*/ */
import Scrollbar from './src/index.vue'; import Scrollbar from './src/Scrollbar.vue';
export { Scrollbar }; export { Scrollbar };
export type { ScrollbarType } from './src/types'; export type { ScrollbarType } from './src/types';
export { default as StrengthMeter } from './src/index.vue'; export { default as StrengthMeter } from './src/StrengthMeter.vue';
export { default as Time } from './src/index.vue'; export { default as Time } from './src/Time.vue';
import BasicTree from './src/index.vue'; import BasicTree from './src/Tree.vue';
export { BasicTree }; export { BasicTree };
export type { ContextMenuItem } from '/@/hooks/web/useContextMenu'; export type { ContextMenuItem } from '/@/hooks/web/useContextMenu';
......
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
export const VScroll = createAsyncComponent(() => import('./src/index')); export const VScroll = createAsyncComponent(() => import('./src/VirtualScroll'));
...@@ -54,33 +54,29 @@ export default defineComponent({ ...@@ -54,33 +54,29 @@ export default defineComponent({
return Math.min((props.items || []).length, state.last + unref(getBenchRef)); return Math.min((props.items || []).length, state.last + unref(getBenchRef));
}); });
const getContainerStyleRef = computed( const getContainerStyleRef = computed((): CSSProperties => {
(): CSSProperties => { return {
return { height: convertToUnit((props.items || []).length * unref(getItemHeightRef)),
height: convertToUnit((props.items || []).length * unref(getItemHeightRef)), };
}; });
}
);
const getWrapStyleRef = computed( const getWrapStyleRef = computed((): CSSProperties => {
(): CSSProperties => { const styles: Recordable<string> = {};
const styles: Recordable<string> = {}; const height = convertToUnit(props.height);
const height = convertToUnit(props.height); const minHeight = convertToUnit(props.minHeight);
const minHeight = convertToUnit(props.minHeight); const minWidth = convertToUnit(props.minWidth);
const minWidth = convertToUnit(props.minWidth); const maxHeight = convertToUnit(props.maxHeight);
const maxHeight = convertToUnit(props.maxHeight); const maxWidth = convertToUnit(props.maxWidth);
const maxWidth = convertToUnit(props.maxWidth); const width = convertToUnit(props.width);
const width = convertToUnit(props.width);
if (height) styles.height = height;
if (height) styles.height = height; if (minHeight) styles.minHeight = minHeight;
if (minHeight) styles.minHeight = minHeight; if (minWidth) styles.minWidth = minWidth;
if (minWidth) styles.minWidth = minWidth; if (maxHeight) styles.maxHeight = maxHeight;
if (maxHeight) styles.maxHeight = maxHeight; if (maxWidth) styles.maxWidth = maxWidth;
if (maxWidth) styles.maxWidth = maxWidth; if (width) styles.width = width;
if (width) styles.width = width; return styles;
return styles; });
}
);
watch([() => props.itemHeight, () => props.height], () => { watch([() => props.itemHeight, () => props.height], () => {
onScroll(); onScroll();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论