lovelymaid 1.7.2 → 1.7.3

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.
Files changed (35) hide show
  1. package/README.md +3 -4
  2. package/dist/components/external/Button.vue.d.ts +13 -7
  3. package/dist/components/external/Card.vue.d.ts +6 -1
  4. package/dist/components/external/CheckBox.vue.d.ts +36 -26
  5. package/dist/components/external/ContentBar.vue.d.ts +17 -9
  6. package/dist/components/external/FoldList.vue.d.ts +23 -13
  7. package/dist/components/external/Form.vue.d.ts +39 -29
  8. package/dist/components/external/Input.vue.d.ts +43 -32
  9. package/dist/components/external/Loading.vue.d.ts +4 -4
  10. package/dist/components/external/MenuBar.vue.d.ts +17 -6
  11. package/dist/components/external/Modal.vue.d.ts +24 -13
  12. package/dist/components/external/Select.vue.d.ts +14 -8
  13. package/dist/components/external/SideBar.vue.d.ts +19 -9
  14. package/dist/components/external/TabBar.vue.d.ts +25 -15
  15. package/dist/components/external/Table.vue.d.ts +31 -21
  16. package/dist/components/external/TextArea.vue.d.ts +24 -13
  17. package/dist/components/internal/Date.vue.d.ts +24 -14
  18. package/dist/components/internal/Menu.vue.d.ts +28 -16
  19. package/dist/components/internal/Scroll.vue.d.ts +9 -6
  20. package/dist/index.d.ts +3 -2
  21. package/dist/lovelymaid.css +1 -1
  22. package/dist/lovelymaid.js +293 -287
  23. package/dist/services/menu.d.ts +3 -2
  24. package/dist/{components/types.d.ts → types.d.ts} +7 -4
  25. package/dist/utils/activation.d.ts +6 -4
  26. package/dist/utils/css-var.d.ts +2 -0
  27. package/dist/utils/date.d.ts +3 -1
  28. package/dist/utils/dom.d.ts +2 -2
  29. package/dist/utils/function.d.ts +2 -0
  30. package/dist/utils/layout-offset.d.ts +4 -0
  31. package/dist/utils/slide.d.ts +2 -1
  32. package/dist/utils/view-offset.d.ts +4 -0
  33. package/dist/utils/window.d.ts +8 -6
  34. package/package.json +15 -14
  35. /package/dist/assets/icons/{iconfont.ttf → src/assets/icons/iconfont.ttf} +0 -0
package/README.md CHANGED
@@ -14,7 +14,7 @@ import 'lovelymaid/dist/lovelymaid.css'
14
14
 
15
15
  ```javascript
16
16
  // main.js 或 main.ts
17
- import 'lovelymaid/dist/lovelymaid.css' // ← 必须放在最前面!
17
+ import 'lovelymaid/dist/lovelymaid.css' // ← 必须放在最前面!
18
18
  import './your-own-styles.css'
19
19
  import { createApp } from 'vue'
20
20
  import App from './App.vue'
@@ -32,7 +32,6 @@ import { SideBar } from 'lovelymaid'
32
32
  </script>
33
33
 
34
34
  <template>
35
- <SideBar :visible="true">
36
- 侧边栏内容
37
- </SideBar>
35
+ <SideBar :visible="true"> 侧边栏内容 </SideBar>
38
36
  </template>
37
+ ```
@@ -1,13 +1,19 @@
1
1
  import type { DefineComponent } from 'vue'
2
2
 
3
3
  interface Props {
4
- /** 类型 */
5
- type?: 'common' | 'glass';
6
- /** 按钮点击事件 */
7
- onClick?: () => void;
8
- /** 悬停提示 */
9
- title?: string;
4
+ /** 类型 */
5
+ type?: "common" | "glass"
6
+ /** 按钮点击事件 */
7
+ onClick?: () => void
8
+ /** 悬停提示 */
9
+ title?: string
10
10
  }
11
11
 
12
- declare const _default: DefineComponent<Props>
12
+ type Slots = {
13
+ default?: () => any
14
+ }
15
+
16
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, {}> & {
17
+ new (): { $slots: Slots }
18
+ }
13
19
  export default _default
@@ -1,5 +1,10 @@
1
1
  import type { DefineComponent } from 'vue'
2
2
 
3
+ type Slots = {
4
+ default?: () => any
5
+ }
3
6
 
4
- declare const _default: DefineComponent<Props>
7
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, {}, {}, {}> & {
8
+ new (): { $slots: Slots }
9
+ }
5
10
  export default _default
@@ -1,33 +1,43 @@
1
- import type { OptionItem } from '../types';
1
+ import type { OptionItem } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  interface Props {
5
- /** 输入框提示词 */
6
- placeholder?: string;
7
- /** 移动端键盘回车图标 */
8
- enterkeyhint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send";
9
- /** 是否禁用 */
10
- disabled?: boolean;
11
- /** 是否只读 */
12
- readonly?: boolean;
13
- /** 选项 */
14
- options?: OptionItem[];
15
- /** 是否启用选项过滤(输入文字时过滤选项) */
16
- filter?: boolean;
17
- /** 弹窗 z-index */
18
- zIndex?: number;
19
- /** 回车事件 */
20
- onEnter?: () => void;
5
+ /** 输入框提示词 */
6
+ placeholder?: string
7
+ /** 移动端键盘回车图标 */
8
+ enterkeyhint?: "done" | "enter" | "search" | "go" | "next" | "previous" | "send"
9
+ /** 是否禁用 */
10
+ disabled?: boolean
11
+ /** 是否只读 */
12
+ readonly?: boolean
13
+ /** 选项 */
14
+ options?: OptionItem[]
15
+ /** 是否启用选项过滤(输入文字时过滤选项) */
16
+ filter?: boolean
17
+ /** 弹窗 z-index */
18
+ zIndex?: number
19
+ /** 回车事件 */
20
+ onEnter?: () => void
21
+ value: string[]
22
+ warning?: boolean
21
23
  }
22
24
 
23
- declare const _default: DefineComponent<Props & {
24
- 'value': string[];
25
- 'warning'?: boolean;
26
- }, {}, {}, {}, {}, {}, {}, {}> & {
27
- new(): {
28
- focus: () => void;
29
- blur: () => void;
30
- select: () => void | undefined;;
31
- }
25
+ type Slots = {
26
+ default?: () => any
27
+ }
28
+
29
+ type Exposed = {
30
+ focus: () => void
31
+ blur: () => void
32
+ select: () => void
33
+ }
34
+
35
+ type Emits = {
36
+ 'update:value': (value: string[]) => any
37
+ 'update:warning': (value: boolean) => any
38
+ }
39
+
40
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
41
+ new (): Exposed & { $slots: Slots }
32
42
  }
33
43
  export default _default
@@ -1,15 +1,23 @@
1
1
  import type { DefineComponent } from 'vue'
2
2
 
3
3
  interface Props {
4
- /** 是否显示 */
5
- visible?: boolean;
6
- /** 是否展开 */
7
- isOpen: boolean;
8
- /** 关闭事件 */
9
- onCloseClick: () => void;
10
- /** 加载状态 */
11
- loading?: boolean;
4
+ /** 是否显示 */
5
+ visible?: boolean
6
+ /** 是否展开 */
7
+ isOpen: boolean
8
+ /** 关闭事件 */
9
+ onCloseClick: () => void
10
+ /** 加载状态 */
11
+ loading?: boolean
12
12
  }
13
13
 
14
- declare const _default: DefineComponent<Props>
14
+ type Slots = {
15
+ header?: () => any
16
+ default?: () => any
17
+ center?: () => any
18
+ }
19
+
20
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, {}> & {
21
+ new (): { $slots: Slots }
22
+ }
15
23
  export default _default
@@ -1,19 +1,29 @@
1
- import type { ListItem } from '../types';
1
+ import type { ListItem } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  interface Props {
5
- /** 标题 */
6
- title?: string;
7
- /** 列表 */
8
- list: ListItem[];
9
- /** 头部点击事件 */
10
- onHeaderClick?: () => void;
11
- /** 列表项点击事件 */
12
- onItemClick?: (item: ListItem, index: number) => void;
5
+ /** 标题 */
6
+ title?: string
7
+ /** 列表 */
8
+ list: ListItem[]
9
+ /** 头部点击事件 */
10
+ onHeaderClick?: () => void
11
+ /** 列表项点击事件 */
12
+ onItemClick?: (item: ListItem, index: number) => void
13
+ open: boolean
14
+ activeId?: string | number
13
15
  }
14
16
 
15
- declare const _default: DefineComponent<Props & {
16
- 'open': boolean;
17
- 'activeId'?: string | number;
18
- }>
17
+ type Slots = {
18
+ default?: (props: { item: ListItem; index: number}) => any
19
+ }
20
+
21
+ type Emits = {
22
+ 'update:open': (value: boolean) => any
23
+ 'update:activeId': (value: string | number | undefined) => any
24
+ }
25
+
26
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
27
+ new (): { $slots: Slots }
28
+ }
19
29
  export default _default
@@ -1,38 +1,48 @@
1
- import type { DateItem, OptionItem } from '../types';
1
+ import type { OptionItem, DateItem } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  export type FormItem = {
5
- id: string | number;
6
- name: string;
7
- type?: 'text' | 'number' | 'password' | 'radio' | 'checkbox' | 'textarea' | 'date';
8
- /** 值(仅 type 为 checkbox 时为 string[]) */
9
- value: string | string[];
10
- placeholder?: string;
11
- disabled?: boolean;
12
- readonly?: boolean;
13
- width?: string;
14
- height?: string;
15
- options?: OptionItem[];
16
- /** 是否启用选项过滤 (仅 type 为 radio 时有效) */
17
- filter?: boolean;
18
- /** 格式化 (仅 type 为 date 时有效) */
19
- format?: (date: DateItem) => string;
20
- /** 是否启用校验(仅 type 为 radio 或 date 时有效) */
21
- verify?: boolean;
22
- /** 弹窗 z-index(仅 type 为 radio 或 date 时有效)*/
23
- zIndex?: number;
24
- /** 是否警告 */
25
- warning?: boolean;
5
+ id: string | number
6
+ name: string
7
+ type?: 'text' | 'number' | 'password' | 'radio' | 'checkbox' | 'textarea' | 'date'
8
+ /** 值(仅 type 为 checkbox 时为 string[]) */
9
+ value: string | string[]
10
+ placeholder?: string
11
+ disabled?: boolean
12
+ readonly?: boolean
13
+ width?: string
14
+ height?: string
15
+ options?: OptionItem[]
16
+ /** 是否启用选项过滤 (仅 type 为 radio 时有效) */
17
+ filter?: boolean
18
+ /** 格式化 (仅 type 为 date 时有效) */
19
+ format?: (date: DateItem) => string
20
+ /** 是否启用校验(仅 type 为 radio 或 date 时有效) */
21
+ verify?: boolean
22
+ /** 弹窗 z-index(仅 type 为 radio 或 date 时有效)*/
23
+ zIndex?: number
24
+ /** 是否警告 */
25
+ warning?: boolean
26
26
  }
27
27
 
28
28
  interface Props {
29
- /** 表单项默认宽 */
30
- itemWidth?: string;
31
- /** 标单项默认高 */
32
- itemHeight?: string;
29
+ /** 表单项默认宽 */
30
+ itemWidth?: string
31
+ /** 标单项默认高 */
32
+ itemHeight?: string
33
+ items: FormItem[]
33
34
  }
34
35
 
35
- declare const _default: DefineComponent<Props & {
36
- 'items': FormItem[];
37
- }>
36
+ type Exposed = {
37
+ /** 校验结果(key 为表单项 id,textarea 和 checkbox 不参与校验) */
38
+ verifications: Record<string, boolean>
39
+ }
40
+
41
+ type Emits = {
42
+ 'update:items': (value: FormItem[]) => any
43
+ }
44
+
45
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
46
+ new (): Exposed
47
+ }
38
48
  export default _default
@@ -1,39 +1,50 @@
1
- import type { OptionItem, DateItem } from '../types';
1
+ import type { OptionItem, DateItem } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  interface Props {
5
- /** 输入框类型 */
6
- type?: "text" | "password" | "number" | "radio" | "date";
7
- /** 输入框提示词 */
8
- placeholder?: string;
9
- /** 移动端键盘回车图标 */
10
- enterkeyhint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send";
11
- /** 是否禁用 */
12
- disabled?: boolean;
13
- /** 是否只读 */
14
- readonly?: boolean;
15
- /** 选项 (仅 type 为 radio 时有效) */
16
- options?: OptionItem[];
17
- /** 是否启用选项过滤 (仅 type 为 radio 时有效) */
18
- filter?: boolean;
19
- /** 格式化 (仅 type 为 date 时有效) */
20
- format?: (date: DateItem) => string;
21
- /** 是否启用校验 (仅 type 为 radio 或 date 时有效) */
22
- verify?: boolean;
23
- /** 弹窗 z-index(仅 type 为 radio 或 date 时有效)*/
24
- zIndex?: number;
25
- /** 回车事件 */
26
- onEnter?: () => void;
5
+ /** 输入框类型 */
6
+ type?: "number" | "text" | "password" | "radio" | "date"
7
+ /** 输入框提示词 */
8
+ placeholder?: string
9
+ /** 移动端键盘回车图标 */
10
+ enterkeyhint?: "done" | "enter" | "search" | "go" | "next" | "previous" | "send"
11
+ /** 是否禁用 */
12
+ disabled?: boolean
13
+ /** 是否只读 */
14
+ readonly?: boolean
15
+ /** 选项 (仅 type 为 radio 时有效) */
16
+ options?: OptionItem[]
17
+ /** 是否启用选项过滤 (仅 type 为 radio 时有效) */
18
+ filter?: boolean
19
+ /** 格式化 (仅 type 为 date 时有效) */
20
+ format?: (date: DateItem) => string
21
+ /** 是否启用校验 (仅 type 为 radio 或 date 时有效) */
22
+ verify?: boolean
23
+ /** 弹窗 z-index(仅 type 为 radio 或 date 时有效) */
24
+ zIndex?: number
25
+ /** 回车事件 */
26
+ onEnter?: () => void
27
+ value: string
28
+ warning?: boolean
27
29
  }
28
30
 
29
- declare const _default: DefineComponent<Props & {
30
- 'value': string;
31
- 'warning'?: boolean;
32
- }, {}, {}, {}, {}, {}, {}, {}> & {
33
- new(): {
34
- focus: () => void;
35
- blur: () => void;
36
- select: () => void | undefined;;
37
- }
31
+ type Slots = {
32
+ default?: () => any
33
+ }
34
+
35
+ type Exposed = {
36
+ verification: boolean
37
+ focus: () => void
38
+ blur: () => void
39
+ select: () => void
40
+ }
41
+
42
+ type Emits = {
43
+ 'update:value': (value: string) => any
44
+ 'update:warning': (value: boolean) => any
45
+ }
46
+
47
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
48
+ new (): Exposed & { $slots: Slots }
38
49
  }
39
50
  export default _default
@@ -1,10 +1,10 @@
1
1
  import type { DefineComponent } from 'vue'
2
2
 
3
3
  interface Props {
4
- /** 加载状态 */
5
- loading: boolean;
6
- /** z-index */
7
- zIndex?: number;
4
+ /** 加载状态 */
5
+ loading: boolean
6
+ /** z-index */
7
+ zIndex?: number
8
8
  }
9
9
 
10
10
  declare const _default: DefineComponent<Props>
@@ -1,12 +1,23 @@
1
- import type { Item } from '../types';
1
+ import type { Item } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
+ type MenuItem = Item & {
5
+ /** 是否禁用 */
6
+ disabled?: boolean
7
+ }
8
+
4
9
  interface Props {
5
- /** 菜单 */
6
- menus: MenuItem[];
7
- /** 菜单点击事件 */
8
- onMenuClick?: (menu: MenuItem, index: number) => void;
10
+ /** 菜单 */
11
+ menus: MenuItem[]
12
+ /** 菜单点击事件 */
13
+ onMenuClick?: (menu: MenuItem, index: number) => void
9
14
  }
10
15
 
11
- declare const _default: DefineComponent<Props>
16
+ type Slots = {
17
+ default?: (props: { menu: MenuItem; index: number}) => any
18
+ }
19
+
20
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, {}> & {
21
+ new (): { $slots: Slots }
22
+ }
12
23
  export default _default
@@ -1,19 +1,30 @@
1
1
  import type { DefineComponent } from 'vue'
2
2
 
3
3
  interface Props {
4
- /** 宽 */
5
- width?: string;
6
- /** 高 */
7
- height?: string;
8
- /** z-index */
9
- zIndex?: number;
10
- /** 关闭事件 */
11
- onClose?: () => void;
12
- /** 加载状态 */
13
- loading?: boolean;
4
+ /** 宽 */
5
+ width?: string
6
+ /** 高 */
7
+ height?: string
8
+ /** z-index */
9
+ zIndex?: number
10
+ /** 关闭事件 */
11
+ onClose?: () => void
12
+ /** 加载状态 */
13
+ loading?: boolean
14
+ visible: boolean
14
15
  }
15
16
 
16
- declare const _default: DefineComponent<Props & {
17
- 'visible': boolean;
18
- }>
17
+ type Slots = {
18
+ header?: () => any
19
+ default?: () => any
20
+ center?: () => any
21
+ }
22
+
23
+ type Emits = {
24
+ 'update:visible': (value: boolean) => any
25
+ }
26
+
27
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
28
+ new (): { $slots: Slots }
29
+ }
19
30
  export default _default
@@ -1,14 +1,20 @@
1
- import type { OptionItem } from '../types';
1
+ import type { OptionItem } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  interface Props {
5
- /** 选项配置 */
6
- options: OptionItem[];
7
- /** 弹窗 z-index */
8
- zIndex?: number;
9
- /** 选项点击事件 */
10
- onOptionClick?: (option: OptionItem, index: number) => void;
5
+ /** 选项配置 */
6
+ options: OptionItem[]
7
+ /** 弹窗 z-index */
8
+ zIndex?: number
9
+ /** 选项点击事件 */
10
+ onOptionClick?: (option: OptionItem, index: number) => void
11
11
  }
12
12
 
13
- declare const _default: DefineComponent<Props>
13
+ type Slots = {
14
+ default?: (props: { item: OptionItem; index: number}) => any
15
+ }
16
+
17
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, {}> & {
18
+ new (): { $slots: Slots }
19
+ }
14
20
  export default _default
@@ -1,15 +1,25 @@
1
1
  import type { DefineComponent } from 'vue'
2
2
 
3
3
  interface Props {
4
- /** 是否显示 */
5
- visible?: boolean;
6
- /** 按钮点击事件 */
7
- onButtonClick?: () => void;
8
- /** 加载状态 */
9
- loading?: boolean;
4
+ /** 是否显示 */
5
+ visible?: boolean
6
+ /** 按钮点击事件 */
7
+ onButtonClick?: () => void
8
+ /** 加载状态 */
9
+ loading?: boolean
10
+ open: boolean
10
11
  }
11
12
 
12
- declare const _default: DefineComponent<Props & {
13
- 'open': boolean;
14
- }>
13
+ type Slots = {
14
+ header?: () => any
15
+ default?: () => any
16
+ }
17
+
18
+ type Emits = {
19
+ 'update:open': (value: boolean) => any
20
+ }
21
+
22
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
23
+ new (): { $slots: Slots }
24
+ }
15
25
  export default _default
@@ -1,21 +1,31 @@
1
- import type { Item } from '../types';
1
+ import type { Item } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  interface Props {
5
- /** 标签 */
6
- tabs: Item[];
7
- /** 是否启用搜索按钮 */
8
- showSearch?: boolean;
9
- /** 输入框提示词 */
10
- placeholder?: string;
11
- /** 列表项按压事件 */
12
- onActiveTabPress?: (newIndex: number) => void;
13
- /** 搜索事件 */
14
- onSearch?: () => void;
5
+ /** 标签 */
6
+ tabs: Item[]
7
+ /** 是否启用搜索按钮 */
8
+ showSearch?: boolean
9
+ /** 输入框提示词 */
10
+ placeholder?: string
11
+ /** 列表项按压事件 */
12
+ onActiveTabPress?: (newIndex: number) => void
13
+ /** 搜索事件 */
14
+ onSearch?: () => void
15
+ activeId: string | number
16
+ value?: string
15
17
  }
16
18
 
17
- declare const _default: DefineComponent<Props & {
18
- 'activeId': string | number;
19
- 'value'?: string;
20
- }>
19
+ type Slots = {
20
+ default?: (props: { tab: Item; index: number}) => any
21
+ }
22
+
23
+ type Emits = {
24
+ 'update:value': (value: string) => any
25
+ 'update:activeId': (value: string | number) => any
26
+ }
27
+
28
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
29
+ new (): { $slots: Slots }
30
+ }
21
31
  export default _default
@@ -1,32 +1,42 @@
1
- import type { Item } from '../types';
1
+ import type { Item } from '../../types'
2
2
  import type { DefineComponent } from 'vue'
3
3
 
4
4
  export type ColumnConfig = {
5
- id: string | number;
6
- name: string;
7
- prop: string;
8
- width?: string;
5
+ id: string | number
6
+ name: string
7
+ prop: string
8
+ width?: string
9
9
  }
10
10
  export type SortConfig = {
11
- /** 列 id */
12
- id: string | number;
13
- /** 排序规则 */
14
- order: 'asc' | 'desc';
11
+ /** 列 id */
12
+ id: string | number
13
+ /** 排序规则 */
14
+ order: 'asc' | 'desc'
15
15
  }
16
16
 
17
17
  interface Props {
18
- /** 列 */
19
- columns: ColumnConfig[];
20
- /** 行 */
21
- rows: Item[];
22
- /** 弹窗 z-index */
23
- zIndex?: number;
24
- /** 加载状态 */
25
- loading?: boolean;
18
+ /** 列 */
19
+ columns: ColumnConfig[]
20
+ /** 行 */
21
+ rows: Item[]
22
+ /** 弹窗 z-index */
23
+ zIndex?: number
24
+ /** 加载状态 */
25
+ loading?: boolean
26
+ sort?: SortConfig
27
+ activeIds?: Set<string | number>
26
28
  }
27
29
 
28
- declare const _default: DefineComponent<Props & {
29
- 'sort'?: SortConfig;
30
- 'activeIds'?: Set<string | number>;
31
- }>
30
+ type Slots = {
31
+ default?: (props: { row: Item; column: ColumnConfig}) => any
32
+ }
33
+
34
+ type Emits = {
35
+ 'update:sort': (value: SortConfig | undefined) => any
36
+ 'update:activeIds': (value: Set<string | number>) => any
37
+ }
38
+
39
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, {}, {}, Emits> & {
40
+ new (): { $slots: Slots }
41
+ }
32
42
  export default _default