diff --git a/packages/devui-vue/devui/date-picker/index.ts b/packages/devui-vue/devui/date-picker/index.ts index 26274dc708352d1aaedc1a7494f8eb8d982d6703..f38643d148c03a5d321a6206489600d3c63ffa41 100644 --- a/packages/devui-vue/devui/date-picker/index.ts +++ b/packages/devui-vue/devui/date-picker/index.ts @@ -1,6 +1,6 @@ import { App } from 'vue' -import DatePicker from './date-picker' -import StickSlider from './stick-slider' +import DatePicker from './src/date-picker' +import StickSlider from './src/stick-slider' DatePicker.install = function(app: App) { app.component(DatePicker.name, DatePicker) @@ -14,6 +14,6 @@ export default { category: '数据录入', status: '50%', install(app: App): void { - app.use(DatePicker) + app.use(DatePicker as any) } } diff --git a/packages/devui-vue/devui/date-picker/README.md b/packages/devui-vue/devui/date-picker/src/README.md similarity index 100% rename from packages/devui-vue/devui/date-picker/README.md rename to packages/devui-vue/devui/date-picker/src/README.md diff --git a/packages/devui-vue/devui/date-picker/components/calendar/index.scss b/packages/devui-vue/devui/date-picker/src/components/calendar/index.scss similarity index 100% rename from packages/devui-vue/devui/date-picker/components/calendar/index.scss rename to packages/devui-vue/devui/date-picker/src/components/calendar/index.scss diff --git a/packages/devui-vue/devui/date-picker/components/calendar/index.tsx b/packages/devui-vue/devui/date-picker/src/components/calendar/index.tsx similarity index 100% rename from packages/devui-vue/devui/date-picker/components/calendar/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/calendar/index.tsx diff --git a/packages/devui-vue/devui/date-picker/components/helper.ts b/packages/devui-vue/devui/date-picker/src/components/helper.ts similarity index 100% rename from packages/devui-vue/devui/date-picker/components/helper.ts rename to packages/devui-vue/devui/date-picker/src/components/helper.ts diff --git a/packages/devui-vue/devui/date-picker/components/panel/index.scss b/packages/devui-vue/devui/date-picker/src/components/panel/index.scss similarity index 98% rename from packages/devui-vue/devui/date-picker/components/panel/index.scss rename to packages/devui-vue/devui/date-picker/src/components/panel/index.scss index 9fb2adaea7a4cb6fec4a8d7a3e2a749d65cda733..816045f78e6357f93624297074597ca8a62e5221 100644 --- a/packages/devui-vue/devui/date-picker/components/panel/index.scss +++ b/packages/devui-vue/devui/date-picker/src/components/panel/index.scss @@ -1,4 +1,4 @@ -@import '../../../style/devui.scss'; +@import '../../../../style/devui'; $panel-width: 230px; $panel-height: 210px; diff --git a/packages/devui-vue/devui/date-picker/components/panel/index.tsx b/packages/devui-vue/devui/date-picker/src/components/panel/index.tsx similarity index 100% rename from packages/devui-vue/devui/date-picker/components/panel/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/panel/index.tsx diff --git a/packages/devui-vue/devui/date-picker/components/popup/index.scss b/packages/devui-vue/devui/date-picker/src/components/popup/index.scss similarity index 100% rename from packages/devui-vue/devui/date-picker/components/popup/index.scss rename to packages/devui-vue/devui/date-picker/src/components/popup/index.scss diff --git a/packages/devui-vue/devui/date-picker/components/popup/index.tsx b/packages/devui-vue/devui/date-picker/src/components/popup/index.tsx similarity index 98% rename from packages/devui-vue/devui/date-picker/components/popup/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/popup/index.tsx index f241927b34a43764e07ffe34803e639e634c4857..162863434dfa404d670a42086ab6c22839584280 100644 --- a/packages/devui-vue/devui/date-picker/components/popup/index.tsx +++ b/packages/devui-vue/devui/date-picker/src/components/popup/index.tsx @@ -2,8 +2,6 @@ import { defineComponent, reactive, renderSlot, ref, useSlots, onMounted, onUnmo import { EventManager, isIn, traceNode, invokeFunction } from '../../utils' import { handlePositionFactory, - formatValue, - formatPlaceholder, getAttachInputDom, } from '../../helper' diff --git a/packages/devui-vue/devui/date-picker/components/timepicker/index.scss b/packages/devui-vue/devui/date-picker/src/components/timepicker/index.scss similarity index 95% rename from packages/devui-vue/devui/date-picker/components/timepicker/index.scss rename to packages/devui-vue/devui/date-picker/src/components/timepicker/index.scss index 139b9aaaa27d6fa03304af43b56307ddd428eba8..041d82884b7539d40993a3a3e70a045b7f1498bd 100644 --- a/packages/devui-vue/devui/date-picker/components/timepicker/index.scss +++ b/packages/devui-vue/devui/date-picker/src/components/timepicker/index.scss @@ -1,5 +1,5 @@ -@import '../../../style/devui.scss'; -@import '../panel/index.scss'; +@import '../../../../style/devui'; +@import '../panel/index'; $calendar-timepicker-width: 100px; $head-height: 32px; diff --git a/packages/devui-vue/devui/date-picker/components/timepicker/index.tsx b/packages/devui-vue/devui/date-picker/src/components/timepicker/index.tsx similarity index 96% rename from packages/devui-vue/devui/date-picker/components/timepicker/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/timepicker/index.tsx index df874f8722b7cd3aab97d05af21e93f090414960..ab6740cdf45b6f1d619d19da100d6325ea20ff41 100644 --- a/packages/devui-vue/devui/date-picker/components/timepicker/index.tsx +++ b/packages/devui-vue/devui/date-picker/src/components/timepicker/index.tsx @@ -1,4 +1,4 @@ -import { defineComponent, onMounted, ref, reactive } from 'vue' +import { defineComponent, reactive } from 'vue' import VerticalSliderFunction from '../vertical-slider' import './index.scss' diff --git a/packages/devui-vue/devui/date-picker/components/today-default/index.tsx b/packages/devui-vue/devui/date-picker/src/components/today-default/index.tsx similarity index 100% rename from packages/devui-vue/devui/date-picker/components/today-default/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/today-default/index.tsx diff --git a/packages/devui-vue/devui/date-picker/components/toolbar/index.scss b/packages/devui-vue/devui/date-picker/src/components/toolbar/index.scss similarity index 95% rename from packages/devui-vue/devui/date-picker/components/toolbar/index.scss rename to packages/devui-vue/devui/date-picker/src/components/toolbar/index.scss index d73f4afc503a6b0d568452bb30e28d1322d1b681..fc3d5f50866415746a726a6ef9a4a6d94dfd1a26 100644 --- a/packages/devui-vue/devui/date-picker/components/toolbar/index.scss +++ b/packages/devui-vue/devui/date-picker/src/components/toolbar/index.scss @@ -1,4 +1,4 @@ -@import '../../../style/devui.scss'; +@import '../../../../style/devui'; $toolbar-height: 32px; $cell-size: 28px; diff --git a/packages/devui-vue/devui/date-picker/components/toolbar/index.tsx b/packages/devui-vue/devui/date-picker/src/components/toolbar/index.tsx similarity index 96% rename from packages/devui-vue/devui/date-picker/components/toolbar/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/toolbar/index.tsx index 802ba1672b213cdb26a7f13a46bd01b00c2094c1..61b6d809e632c1f732e1a949eee089beac8cf65e 100644 --- a/packages/devui-vue/devui/date-picker/components/toolbar/index.tsx +++ b/packages/devui-vue/devui/date-picker/src/components/toolbar/index.tsx @@ -1,4 +1,4 @@ -import { compareDate, invokeCallback, subDateMonth } from '../utils' +import { compareDate, invokeCallback } from '../utils' import { Year, Month } from './svg-icon' import { TCalendarToolbarItemProps, TDateToolbarProps } from '../types' import './index.scss' @@ -10,7 +10,6 @@ const Item = (props: TCalendarToolbarItemProps) => { rotate = 0, date, pos, - cb, } = props const color = disabled ? '#cfd0d3' : '#585d6b' const className = `${disabled ? 'disabled' : ''}` diff --git a/packages/devui-vue/devui/date-picker/components/toolbar/svg-icon.tsx b/packages/devui-vue/devui/date-picker/src/components/toolbar/svg-icon.tsx similarity index 100% rename from packages/devui-vue/devui/date-picker/components/toolbar/svg-icon.tsx rename to packages/devui-vue/devui/date-picker/src/components/toolbar/svg-icon.tsx diff --git a/packages/devui-vue/devui/date-picker/components/types.ts b/packages/devui-vue/devui/date-picker/src/components/types.ts similarity index 100% rename from packages/devui-vue/devui/date-picker/components/types.ts rename to packages/devui-vue/devui/date-picker/src/components/types.ts diff --git a/packages/devui-vue/devui/date-picker/components/utils.ts b/packages/devui-vue/devui/date-picker/src/components/utils.ts similarity index 100% rename from packages/devui-vue/devui/date-picker/components/utils.ts rename to packages/devui-vue/devui/date-picker/src/components/utils.ts diff --git a/packages/devui-vue/devui/date-picker/components/vertical-slider/index.scss b/packages/devui-vue/devui/date-picker/src/components/vertical-slider/index.scss similarity index 100% rename from packages/devui-vue/devui/date-picker/components/vertical-slider/index.scss rename to packages/devui-vue/devui/date-picker/src/components/vertical-slider/index.scss diff --git a/packages/devui-vue/devui/date-picker/components/vertical-slider/index.tsx b/packages/devui-vue/devui/date-picker/src/components/vertical-slider/index.tsx similarity index 100% rename from packages/devui-vue/devui/date-picker/components/vertical-slider/index.tsx rename to packages/devui-vue/devui/date-picker/src/components/vertical-slider/index.tsx diff --git a/packages/devui-vue/devui/date-picker/date-picker.scss b/packages/devui-vue/devui/date-picker/src/date-picker.scss similarity index 97% rename from packages/devui-vue/devui/date-picker/date-picker.scss rename to packages/devui-vue/devui/date-picker/src/date-picker.scss index 60bc524970502d3595c09f32db96c452194d5e00..b1885cf26d756a7807ac37ff2a6355de485c63d6 100644 --- a/packages/devui-vue/devui/date-picker/date-picker.scss +++ b/packages/devui-vue/devui/date-picker/src/date-picker.scss @@ -1,4 +1,4 @@ -@import '../style/devui.scss'; +@import '../../style/devui'; $cell-font-size: 13px; $border-width: 1px; diff --git a/packages/devui-vue/devui/date-picker/date-picker.tsx b/packages/devui-vue/devui/date-picker/src/date-picker.tsx similarity index 97% rename from packages/devui-vue/devui/date-picker/date-picker.tsx rename to packages/devui-vue/devui/date-picker/src/date-picker.tsx index 1b67f1932da9c8ffee205622f163ba66889019e9..e3b6eef31d409093217fc1588984410512e1e59d 100644 --- a/packages/devui-vue/devui/date-picker/date-picker.tsx +++ b/packages/devui-vue/devui/date-picker/src/date-picker.tsx @@ -1,8 +1,8 @@ import { onUnmounted, UnwrapRef , defineComponent, reactive, onMounted, ref } from 'vue' import { invokeFunction, isIn } from './utils' import { compareDateSort , parseDate } from './components/utils' -import { Input } from '../input' -import { Icon } from '../icon' +import { Input } from '../../input' +import { Icon } from '../../icon' import { TState, @@ -47,7 +47,7 @@ export default defineComponent({ dateMin: { type: String }, dateMax: { type: String }, }, - setup(props, ctx) { + setup(props) { const panel = ref(null) const input = ref(null) @@ -60,7 +60,7 @@ export default defineComponent({ show: false, value: '', placeholder: formatPlaceholder(props), - current, + current, next, }) @@ -115,7 +115,7 @@ export default defineComponent({ state.end = state.hover = undefined state.start = date }} - onChange={(type, config) => { + onChange={() => { state.value = formatValue(state, props) state.placeholder = formatPlaceholder(props) invokeFunction(props.selectedDateChange, state.value) diff --git a/packages/devui-vue/devui/date-picker/helper.ts b/packages/devui-vue/devui/date-picker/src/helper.ts similarity index 89% rename from packages/devui-vue/devui/date-picker/helper.ts rename to packages/devui-vue/devui/date-picker/src/helper.ts index 47baf8fa50987f6a45d3bea189d9c0db96deaeba..4fa82a2b855551e82d17929d485ce8d8a1169276 100644 --- a/packages/devui-vue/devui/date-picker/helper.ts +++ b/packages/devui-vue/devui/date-picker/src/helper.ts @@ -16,10 +16,10 @@ export type TState = { /** * Calendar 面板年月切换逻辑 - * @param state - * @param index - * @param pos - * @param date + * @param state + * @param index + * @param pos + * @param date */ export const handleCalendarSwitchState = (state: TState, index: number, pos: number, date: Date) => { switch (index) { @@ -48,9 +48,9 @@ export const handleCalendarSwitchState = (state: TState, index: number, pos: num /** * 格式化输入日期字符串 - * @param state - * @param props - * @returns + * @param state + * @param props + * @returns */ export const formatValue = (state: TState, props: any) => { const { format = 'y/MM/dd', range, rangeSpliter = '-' } = props || {} @@ -80,8 +80,8 @@ export const formatValue = (state: TState, props: any) => { /** * 格式化placeholder显示 - * @param props - * @returns + * @param props + * @returns */ export const formatPlaceholder = (props: any) => { if (!props) return '' @@ -92,8 +92,8 @@ export const formatPlaceholder = (props: any) => { /** * 输出日期选择结果 - * @param id - * @param output + * @param id + * @param output */ export const handleValue = (id: string | undefined, output: string) => { if (id && typeof id === 'string') { @@ -106,7 +106,7 @@ export const handleValue = (id: string | undefined, output: string) => { /** * 获取绑定节点 - * @returns + * @returns */ export const getAttachInputDom = (props: any) => { const { attach, attachInputDom = attach } = props || {} @@ -122,10 +122,10 @@ export const getAttachInputDom = (props: any) => { /** * 绑定弹出层场景,计算弹出层位置。 - * @param state - * @param props - * @param container - * @returns + * @param state + * @param props + * @param container + * @returns */ export const handlePositionFactory = (state: { x?: string @@ -144,8 +144,8 @@ export const handlePositionFactory = (state: { state.st = true return } - const { left, top, width, height } = el.getBoundingClientRect() - const { width: _width, height: _height } = container.value.getBoundingClientRect() + const { left, top, height } = el.getBoundingClientRect() + const { height: _height } = container.value.getBoundingClientRect() const bottom = window.innerHeight - top - height state.x = `${left}px` if (bottom > top) { diff --git a/packages/devui-vue/devui/date-picker/stick-slider/index.scss b/packages/devui-vue/devui/date-picker/src/stick-slider/index.scss similarity index 100% rename from packages/devui-vue/devui/date-picker/stick-slider/index.scss rename to packages/devui-vue/devui/date-picker/src/stick-slider/index.scss diff --git a/packages/devui-vue/devui/date-picker/stick-slider/index.tsx b/packages/devui-vue/devui/date-picker/src/stick-slider/index.tsx similarity index 98% rename from packages/devui-vue/devui/date-picker/stick-slider/index.tsx rename to packages/devui-vue/devui/date-picker/src/stick-slider/index.tsx index d51ef64d84ea6e4c0bd6780f039cddd2da8cc951..5958215b73e71fc78227674b5c760f8ad1057ad5 100644 --- a/packages/devui-vue/devui/date-picker/stick-slider/index.tsx +++ b/packages/devui-vue/devui/date-picker/src/stick-slider/index.tsx @@ -5,7 +5,7 @@ import './index.scss' const StickSlider = defineComponent({ name: 'DStickSlider', props: {}, - setup(props) { + setup() { const state = reactive({ showButtons: false, diff --git a/packages/devui-vue/devui/date-picker/utils.ts b/packages/devui-vue/devui/date-picker/src/utils.ts similarity index 96% rename from packages/devui-vue/devui/date-picker/utils.ts rename to packages/devui-vue/devui/date-picker/src/utils.ts index 9400fc5fe80ef2105e650b874769cee434fb9148..e2e59c7bd770456252a5d3a8687579cd9e5162cc 100644 --- a/packages/devui-vue/devui/date-picker/utils.ts +++ b/packages/devui-vue/devui/date-picker/src/utils.ts @@ -17,8 +17,8 @@ const fixStart = (n: number, m: string, max = 2, ch = '0') => { /** * - y: year yy 取后2位,其他情况取4位 * - M: month 最多取2位补0 - * @param fmt - * @param d + * @param fmt + * @param d */ export const formatDate = (fmt: string, d: Date) => { const usage = getDateTime(d) @@ -48,9 +48,9 @@ export const formatRange = (fmt: string, a: Date, b: Date, conn = '-') => { /** * 判断节点a是否在节点b中 - * @param a - * @param b - * @returns + * @param a + * @param b + * @returns */ export const isIn = (a: Node | null, b: any) => { if (!b) { @@ -85,7 +85,7 @@ export class EventManager { } export const traceNode = (el: Node) => { - const els: Node[] = [], name = 'scroll' + const els: Node[] = [] while (el.parentNode) { els.push(el.parentNode) el = el.parentNode diff --git a/packages/devui-vue/devui/skeleton/__tests__/skeletonItem.spec.ts b/packages/devui-vue/devui/skeleton/__tests__/skeleton-item.spec.ts similarity index 100% rename from packages/devui-vue/devui/skeleton/__tests__/skeletonItem.spec.ts rename to packages/devui-vue/devui/skeleton/__tests__/skeleton-item.spec.ts