diff --git a/package.json b/package.json index 78523bd..e5fa98b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cool-unix", - "version": "8.0.22", + "version": "8.0.23", "license": "MIT", "scripts": { "build-ui": "node ./uni_modules/cool-ui/scripts/generate-types.js", diff --git a/pages.json b/pages.json index be92040..2094bac 100644 --- a/pages.json +++ b/pages.json @@ -214,6 +214,12 @@ "navigationBarTitleText": "Upload 文件上传" } }, + { + "path": "form/calendar", + "style": { + "navigationBarTitleText": "Calendar 日历" + } + }, { "path": "layout/flex", "style": { diff --git a/pages/demo/form/calendar.uvue b/pages/demo/form/calendar.uvue new file mode 100644 index 0000000..79f043f --- /dev/null +++ b/pages/demo/form/calendar.uvue @@ -0,0 +1,41 @@ + + + diff --git a/pages/index/home.uvue b/pages/index/home.uvue index ac7e52f..f90ad27 100644 --- a/pages/index/home.uvue +++ b/pages/index/home.uvue @@ -226,6 +226,11 @@ const data = computed(() => { label: t("文件上传"), icon: "file-upload-line", path: "/pages/demo/form/upload" + }, + { + label: t("日历"), + icon: "calendar-line", + path: "/pages/demo/form/calendar" } ] }, @@ -327,6 +332,11 @@ const data = computed(() => { label: t("树形结构"), icon: "node-tree", path: "/pages/demo/data/tree" + }, + { + label: t("日历"), + icon: "calendar-line", + path: "/pages/demo/data/calendar" } ] }, diff --git a/types/uni-app.d.ts b/types/uni-app.d.ts index 758a5e4..bd1b7c6 100644 --- a/types/uni-app.d.ts +++ b/types/uni-app.d.ts @@ -430,6 +430,17 @@ declare const onUnhandledRejection: ( declare const onUnload: (hook: () => any, target?: ComponentInternalInstance | null) => void; +declare interface DOMRect { + x: number; + y: number; + width: number; + height: number; + left: number; + top: number; + right: number; + bottom: number; +} + declare interface UniElement { $vm: ComponentPublicInstance; id: string; @@ -446,6 +457,7 @@ declare interface UniElement { success?: (res: { tempFilePath: string }) => void; fail?: (err: { errCode: number; errMsg: string }) => void; }): void; + getBoundingClientRectAsync(): Promise; getDrawableContext(): DrawableContext; animate( keyframes: UniAnimationKeyframe | UniAnimationKeyframe[], diff --git a/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue b/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue new file mode 100644 index 0000000..66abfc8 --- /dev/null +++ b/uni_modules/cool-ui/components/cl-calendar-select/cl-calendar-select.uvue @@ -0,0 +1,271 @@ + + + + + diff --git a/uni_modules/cool-ui/components/cl-calendar/cl-calendar.uvue b/uni_modules/cool-ui/components/cl-calendar/cl-calendar.uvue new file mode 100644 index 0000000..e897a49 --- /dev/null +++ b/uni_modules/cool-ui/components/cl-calendar/cl-calendar.uvue @@ -0,0 +1,732 @@ + + + + + diff --git a/uni_modules/cool-ui/components/cl-calendar/picker.uvue b/uni_modules/cool-ui/components/cl-calendar/picker.uvue new file mode 100644 index 0000000..109b6cf --- /dev/null +++ b/uni_modules/cool-ui/components/cl-calendar/picker.uvue @@ -0,0 +1,273 @@ + + + + + diff --git a/uni_modules/cool-ui/components/cl-select-date/cl-select-date.uvue b/uni_modules/cool-ui/components/cl-select-date/cl-select-date.uvue index c396ac2..4f84fe4 100644 --- a/uni_modules/cool-ui/components/cl-select-date/cl-select-date.uvue +++ b/uni_modules/cool-ui/components/cl-select-date/cl-select-date.uvue @@ -252,7 +252,7 @@ const props = defineProps({ // 范围分隔符 rangeSeparator: { type: String, - default: () => t("至") + default: () => t(" 至 ") }, // 是否显示快捷选项 showShortcuts: { diff --git a/uni_modules/cool-ui/types/index.ts b/uni_modules/cool-ui/types/index.ts index 48244bd..59f84e1 100644 --- a/uni_modules/cool-ui/types/index.ts +++ b/uni_modules/cool-ui/types/index.ts @@ -198,3 +198,5 @@ export type ClTreeNodeInfo = { parent?: ClTreeItem; index: number; }; + +export type ClCalendarMode = "single" | "multiple" | "range";