@varlet/ui 3.15.2 → 3.16.0-alpha.1778310023051

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.15.2",
3
+ "version": "3.16.0-alpha.1778310023051",
4
4
  "description": "A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.",
5
5
  "keywords": [
6
6
  "Vue3",
@@ -44,9 +44,9 @@
44
44
  "@popperjs/core": "^2.11.6",
45
45
  "dayjs": "^1.10.4",
46
46
  "decimal.js": "^10.2.1",
47
- "@varlet/icons": "3.15.2",
48
- "@varlet/shared": "3.15.2",
49
- "@varlet/use": "3.15.2"
47
+ "@varlet/icons": "3.16.0-alpha.1778310023051",
48
+ "@varlet/shared": "3.16.0-alpha.1778310023051",
49
+ "@varlet/use": "3.16.0-alpha.1778310023051"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^20.19.0",
@@ -62,9 +62,9 @@
62
62
  "vue": "3.5.21",
63
63
  "vue-router": "4.5.1",
64
64
  "zod": "^3.23.8",
65
- "@varlet/cli": "3.15.2",
66
- "@varlet/ui": "3.15.2",
67
- "@varlet/touch-emulator": "3.15.2"
65
+ "@varlet/cli": "3.16.0-alpha.1778310023051",
66
+ "@varlet/ui": "3.16.0-alpha.1778310023051",
67
+ "@varlet/touch-emulator": "3.16.0-alpha.1778310023051"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vue": "^3.2.0"
package/types/index.d.ts CHANGED
@@ -60,6 +60,7 @@ export * from './menu'
60
60
  export * from './menuOption'
61
61
  export * from './menuSelect'
62
62
  export * from './option'
63
+ export * from './otpInput'
63
64
  export * from './overlay'
64
65
  export * from './pagination'
65
66
  export * from './paper'
@@ -157,6 +158,7 @@ declare module 'vue' {
157
158
  VarMenuOption: typeof import('@varlet/ui')['_MenuOptionComponent']
158
159
  VarMenuSelect: typeof import('@varlet/ui')['_MenuSelectComponent']
159
160
  VarOption: typeof import('@varlet/ui')['_OptionComponent']
161
+ VarOtpInput: typeof import('@varlet/ui')['_OtpInputComponent']
160
162
  VarOverlay: typeof import('@varlet/ui')['_OverlayComponent']
161
163
  VarPagination: typeof import('@varlet/ui')['_PaginationComponent']
162
164
  VarPaper: typeof import('@varlet/ui')['_PaperComponent']
@@ -0,0 +1,68 @@
1
+ import { VNode } from 'vue'
2
+ import {
3
+ BasicAttributes,
4
+ ListenerProp,
5
+ Rules as OtpInputRules,
6
+ SetPropsDefaults,
7
+ VarComponent,
8
+ Variant as OtpInputVariant,
9
+ } from './varComponent'
10
+
11
+ export declare const otpInputProps: Record<keyof OtpInputProps, any>
12
+
13
+ export type OtpInputType = 'digit' | 'text' | 'alphanumeric'
14
+
15
+ export type OtpInputValidateTrigger = 'onInput' | 'onClick' | 'onPaste' | 'onComplete'
16
+
17
+ export interface OtpInputProps extends BasicAttributes {
18
+ modelValue?: string
19
+ length?: string | number
20
+ type?: OtpInputType
21
+ variant?: OtpInputVariant
22
+ mask?: boolean
23
+ maskSymbol?: string
24
+ cellHeight?: string | number
25
+ cellMaxWidth?: string | number
26
+ textColor?: string
27
+ focusColor?: string
28
+ blurColor?: string
29
+ disabled?: boolean
30
+ readonly?: boolean
31
+ autofocus?: boolean
32
+ gutter?: string | number
33
+ validateTrigger?: OtpInputValidateTrigger[]
34
+ rules?: OtpInputRules
35
+ allowPaste?: boolean
36
+ pasteTransform?: (value: string) => string
37
+ onInput?: ListenerProp<(value: string) => void>
38
+ onClick?: ListenerProp<(e: Event) => void>
39
+ onPaste?: ListenerProp<(value: string, e: ClipboardEvent) => void>
40
+ onComplete?: ListenerProp<(value: string) => void>
41
+ 'onUpdate:modelValue'?: ListenerProp<(value: string) => void>
42
+ }
43
+
44
+ export interface OtpInputSeparatorData {
45
+ index: number
46
+ }
47
+
48
+ export class OtpInput extends VarComponent {
49
+ static setPropsDefaults: SetPropsDefaults<OtpInputProps>
50
+
51
+ $props: OtpInputProps
52
+
53
+ $slots: {
54
+ separator(data: OtpInputSeparatorData): VNode[]
55
+ }
56
+
57
+ focus(index?: number): void
58
+
59
+ blur(): void
60
+
61
+ reset(): void
62
+
63
+ validate(): Promise<boolean>
64
+
65
+ resetValidation(): void
66
+ }
67
+
68
+ export class _OtpInputComponent extends OtpInput {}
@@ -496,6 +496,11 @@ interface BaseStyleVars {
496
496
  '--menu-option-selected-background'?: string
497
497
  '--menu-option-text-color'?: string
498
498
  '--menu-option-disabled-color'?: string
499
+ '--otp-input-gutter'?: string
500
+ '--otp-input-cell-height'?: string
501
+ '--otp-input-cell-max-width'?: string
502
+ '--otp-input-input-font-size'?: string
503
+ '--otp-input-separator-color'?: string
499
504
  '--overlay-background-color'?: string
500
505
  '--pagination-text-color'?: string
501
506
  '--pagination-font-size'?: string