@varlet/ui 3.2.14 → 3.2.15-alpha.1718196322899

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 (54) hide show
  1. package/es/action-sheet/ActionSheet.mjs +4 -1
  2. package/es/app-bar/AppBar.mjs +2 -1
  3. package/es/back-top/backTop.css +1 -1
  4. package/es/bottom-navigation/BottomNavigation.mjs +2 -1
  5. package/es/button/button.css +1 -1
  6. package/es/card/Card.mjs +9 -3
  7. package/es/checkbox/checkbox.css +1 -1
  8. package/es/chip/chip.css +1 -1
  9. package/es/collapse-item/collapseItem.css +1 -1
  10. package/es/counter/counter.css +1 -1
  11. package/es/date-picker/DatePicker.mjs +11 -8
  12. package/es/date-picker/date-picker.css +1 -1
  13. package/es/dialog/Dialog.mjs +7 -4
  14. package/es/index-bar/indexBar.css +1 -1
  15. package/es/index.bundle.mjs +7 -1
  16. package/es/index.mjs +6 -1
  17. package/es/list/List.mjs +7 -4
  18. package/es/list/list.css +1 -1
  19. package/es/locale/index.mjs +24 -8
  20. package/es/locale-provider/LocaleProvider.mjs +31 -0
  21. package/es/locale-provider/index.mjs +11 -0
  22. package/es/locale-provider/props.mjs +16 -0
  23. package/es/locale-provider/provide.mjs +17 -0
  24. package/es/locale-provider/style/index.mjs +0 -0
  25. package/es/menu-option/menuOption.css +1 -1
  26. package/es/option/option.css +1 -1
  27. package/es/pagination/Pagination.mjs +7 -4
  28. package/es/picker/Picker.mjs +7 -4
  29. package/es/radio/radio.css +1 -1
  30. package/es/rate/rate.css +1 -1
  31. package/es/slider/slider.css +1 -1
  32. package/es/snackbar/core.mjs +4 -3
  33. package/es/snackbar/index.mjs +1 -0
  34. package/es/snackbar/props.mjs +4 -0
  35. package/es/step/step.css +1 -1
  36. package/es/style.css +1 -1
  37. package/es/style.mjs +1 -0
  38. package/es/switch/switch.css +1 -1
  39. package/es/tab/tab.css +1 -1
  40. package/es/time-picker/TimePicker.mjs +4 -1
  41. package/es/time-picker/timePicker.css +1 -1
  42. package/es/uploader/uploader.css +1 -1
  43. package/es/varlet.esm.js +6440 -6358
  44. package/highlight/web-types.en-US.json +84 -3
  45. package/highlight/web-types.zh-CN.json +84 -3
  46. package/lib/style.css +1 -1
  47. package/lib/varlet.cjs.js +1159 -1063
  48. package/package.json +7 -9
  49. package/types/card.d.ts +15 -3
  50. package/types/index.d.ts +2 -0
  51. package/types/locale.d.ts +4 -4
  52. package/types/localeProvider.d.ts +23 -0
  53. package/types/snackbar.d.ts +2 -0
  54. package/umd/varlet.js +8 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.2.14",
3
+ "version": "3.2.15-alpha.1718196322899",
4
4
  "description": "A material like components library",
5
5
  "main": "lib/varlet.cjs.js",
6
6
  "module": "es/index.mjs",
@@ -48,27 +48,25 @@
48
48
  "@popperjs/core": "^2.11.6",
49
49
  "dayjs": "^1.10.4",
50
50
  "decimal.js": "^10.2.1",
51
- "@varlet/use": "3.2.14",
52
- "@varlet/icons": "3.2.14",
53
- "@varlet/shared": "3.2.14"
51
+ "@varlet/icons": "3.2.15-alpha.1718196322899",
52
+ "@varlet/shared": "3.2.15-alpha.1718196322899",
53
+ "@varlet/use": "3.2.15-alpha.1718196322899"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.21",
57
57
  "@vue/test-utils": "2.4.1",
58
- "@types/lodash-es": "^4.17.6",
59
58
  "@types/node": "^18.7.18",
60
59
  "@vitest/coverage-istanbul": "1.1.0",
61
60
  "jsdom": "22.1.0",
62
61
  "vitest": "1.1.0",
63
62
  "clipboard": "^2.0.6",
64
63
  "live-server": "^1.2.1",
65
- "lodash-es": "^4.17.21",
66
64
  "typescript": "^5.1.5",
67
65
  "vue": "3.4.21",
68
66
  "vue-router": "4.2.0",
69
- "@varlet/touch-emulator": "3.2.14",
70
- "@varlet/cli": "3.2.14",
71
- "@varlet/ui": "3.2.14"
67
+ "@varlet/ui": "3.2.15-alpha.1718196322899",
68
+ "@varlet/touch-emulator": "3.2.15-alpha.1718196322899",
69
+ "@varlet/cli": "3.2.15-alpha.1718196322899"
72
70
  },
73
71
  "scripts": {
74
72
  "dev": "varlet-cli dev",
package/types/card.d.ts CHANGED
@@ -25,6 +25,18 @@ export interface CardProps extends BasicAttributes {
25
25
  'onUpdate:floating'?: ListenerProp<(value: boolean) => void>
26
26
  }
27
27
 
28
+ export interface CardTitleData {
29
+ slotClass: string
30
+ }
31
+
32
+ export interface CardSubtitleData {
33
+ slotClass: string
34
+ }
35
+
36
+ export interface CardDescriptionData {
37
+ slotClass: string
38
+ }
39
+
28
40
  export class Card extends VarComponent {
29
41
  static setPropsDefaults: SetPropsDefaults<CardProps>
30
42
 
@@ -32,9 +44,9 @@ export class Card extends VarComponent {
32
44
 
33
45
  $slots: {
34
46
  image(): VNode[]
35
- title(): VNode[]
36
- subtitle(): VNode[]
37
- description(): VNode[]
47
+ title(data: CardTitleData): VNode[]
48
+ subtitle(data: CardSubtitleData): VNode[]
49
+ description(data: CardDescriptionData): VNode[]
38
50
  extra(): VNode[]
39
51
  'close-button'(): VNode[]
40
52
  'floating-content'(): VNode[]
package/types/index.d.ts CHANGED
@@ -50,6 +50,7 @@ export * from './list'
50
50
  export * from './loading'
51
51
  export * from './loadingBar'
52
52
  export * from './locale'
53
+ export * from './localeProvider'
53
54
  export * from './menu'
54
55
  export * from './menuOption'
55
56
  export * from './menuSelect'
@@ -140,6 +141,7 @@ declare module 'vue' {
140
141
  VarLoading: typeof import('@varlet/ui')['_LoadingComponent']
141
142
  VarLoadingBar: typeof import('@varlet/ui')['_LoadingBarComponent']
142
143
  VarLocale: typeof import('@varlet/ui')['_LocaleComponent']
144
+ VarLocaleProvider: typeof import('@varlet/ui')['_LocaleProviderComponent']
143
145
  VarMenu: typeof import('@varlet/ui')['_MenuComponent']
144
146
  VarMenuOption: typeof import('@varlet/ui')['_MenuOptionComponent']
145
147
  VarMenuSelect: typeof import('@varlet/ui')['_MenuSelectComponent']
package/types/locale.d.ts CHANGED
@@ -36,20 +36,20 @@ interface Locale {
36
36
  enUS: Message
37
37
  zhTW: Message
38
38
  zhHK: Message
39
- messages: Record<string, Partial<Message>>
39
+ messages: Ref<Record<string, Partial<Message>>>
40
40
  currentMessage: Ref<Partial<Pack>>
41
41
  add(lang: string, message: Partial<Message>): void
42
42
  use(lang: string): void
43
43
  merge(lang: string, message: Partial<Message>): void
44
- t(id: string): string
44
+ t(id: string, options?: { locale?: string }): string
45
45
 
46
46
  useLocale<T = Message>(): {
47
- messages: Record<string, Partial<T>>
47
+ messages: Ref<Record<string, Partial<T>>>
48
48
  currentMessage: Ref<Partial<T>>
49
49
  add(lang: string, message: Partial<T> & { lang?: string }): void
50
50
  use(lang: string): void
51
51
  merge(lang: string, message: Partial<T>): void
52
- t(id: string): string
52
+ t(id: string, options?: { locale?: string }): string
53
53
  }
54
54
  }
55
55
 
@@ -0,0 +1,23 @@
1
+ import { Message } from './locale'
2
+ import { VarComponent, SetPropsDefaults, BasicAttributes } from './varComponent'
3
+ import { VNode } from 'vue'
4
+
5
+ export declare const localeProviderProps: Record<keyof LocaleProviderProps, any>
6
+
7
+ export interface LocaleProviderProps extends BasicAttributes {
8
+ tag?: string
9
+ locale?: string
10
+ messages?: Record<string, Partial<Message>>
11
+ }
12
+
13
+ export class LocaleProvider extends VarComponent {
14
+ static setPropsDefaults: SetPropsDefaults<LocaleProviderProps>
15
+
16
+ $props: LocaleProviderProps
17
+
18
+ $slots: {
19
+ default(): VNode[]
20
+ }
21
+ }
22
+
23
+ export class _LocaleProviderComponent extends LocaleProvider {}
@@ -20,6 +20,7 @@ export interface SnackbarProps extends BasicAttributes {
20
20
  lockScroll?: boolean
21
21
  contentClass?: string
22
22
  duration?: number
23
+ elevation?: boolean | string | number
23
24
  vertical?: boolean
24
25
  show?: boolean
25
26
  forbidClick?: boolean
@@ -51,6 +52,7 @@ export interface SnackbarOptions {
51
52
  icon?: string | VNode | (() => VNode)
52
53
  action?: string | VNode | (() => VNode)
53
54
  duration?: number
55
+ elevation?: boolean | string | number
54
56
  contentClass?: string
55
57
  vertical?: boolean
56
58
  loadingType?: string