@varlet/ui 2.1.0 → 2.2.0-alpha.1667670228109

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 (51) hide show
  1. package/CHANGELOG.md +1885 -1885
  2. package/es/checkbox/checkbox.css +1 -1
  3. package/es/counter/Counter.js +5 -5
  4. package/es/counter/counter.css +1 -1
  5. package/es/form/index.js +4 -0
  6. package/es/form-details/FormDetails.js +39 -8
  7. package/es/form-details/formDetails.css +1 -1
  8. package/es/form-details/props.js +1 -1
  9. package/es/index.d.ts +1 -1
  10. package/es/input/Input.js +3 -3
  11. package/es/input/input.css +1 -1
  12. package/es/locale/en-US.d.ts +5 -5
  13. package/es/locale/zh-CN.d.ts +5 -5
  14. package/es/radio/radio.css +1 -1
  15. package/es/select/select.css +1 -1
  16. package/es/style.css +1 -1
  17. package/es/themes/dark/index.d.ts +5 -5
  18. package/es/uploader/Uploader.js +2 -2
  19. package/es/varlet.esm.js +1971 -1933
  20. package/highlight/attributes.json +820 -0
  21. package/highlight/tags.json +265 -30
  22. package/highlight/web-types.json +3344 -1050
  23. package/json/area.json +10706 -10706
  24. package/lib/checkbox/checkbox.css +1 -1
  25. package/lib/counter/Counter.js +5 -5
  26. package/lib/counter/counter.css +1 -1
  27. package/lib/date-picker/src/day-picker-panel.js +13 -13
  28. package/lib/date-picker/src/month-picker-panel.js +11 -11
  29. package/lib/date-picker/src/year-picker-panel.js +3 -3
  30. package/lib/form/index.js +6 -0
  31. package/lib/form-details/FormDetails.js +38 -7
  32. package/lib/form-details/formDetails.css +1 -1
  33. package/lib/form-details/props.js +1 -1
  34. package/lib/index.d.ts +1 -1
  35. package/lib/input/Input.js +3 -3
  36. package/lib/input/input.css +1 -1
  37. package/lib/locale/en-US.d.ts +5 -5
  38. package/lib/locale/zh-CN.d.ts +5 -5
  39. package/lib/radio/radio.css +1 -1
  40. package/lib/select/select.css +1 -1
  41. package/lib/style.css +1 -1
  42. package/lib/themes/dark/index.d.ts +5 -5
  43. package/lib/uploader/Uploader.js +2 -2
  44. package/package.json +5 -5
  45. package/types/form.d.ts +28 -1
  46. package/types/formDetails.d.ts +12 -0
  47. package/types/index.d.ts +2 -0
  48. package/types/lazy.d.ts +5 -5
  49. package/types/ripple.d.ts +5 -5
  50. package/types/varDirective.d.ts +12 -12
  51. package/umd/varlet.js +7 -7
@@ -1,5 +1,5 @@
1
- import { StyleVars } from '../../../types'
2
-
3
- declare const dark: StyleVars
4
-
5
- export default dark
1
+ import { StyleVars } from '../../../types'
2
+
3
+ declare const dark: StyleVars
4
+
5
+ export default dark
@@ -134,10 +134,10 @@ function render(_ctx, _cache) {
134
134
  /* CLASS */
135
135
  ), (0, _vue.createVNode)(_component_var_form_details, {
136
136
  "error-message": _ctx.errorMessage,
137
- "maxlength-text": _ctx.maxlengthText
137
+ "extra-message": _ctx.maxlengthText
138
138
  }, null, 8
139
139
  /* PROPS */
140
- , ["error-message", "maxlength-text"]), (0, _vue.createVNode)(_component_var_popup, {
140
+ , ["error-message", "extra-message"]), (0, _vue.createVNode)(_component_var_popup, {
141
141
  class: (0, _vue.normalizeClass)(_ctx.n('preview')),
142
142
  "var-uploader-cover": "",
143
143
  position: "center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-alpha.1667670228109",
4
4
  "description": "A material like components library",
5
5
  "module": "es/index.js",
6
6
  "main": "lib/index.js",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@popperjs/core": "^2.11.6",
49
- "@varlet/icons": "2.1.0",
50
- "@varlet/shared": "2.1.0",
49
+ "@varlet/icons": "2.2.0-alpha.1667670228109",
50
+ "@varlet/shared": "2.2.0-alpha.1667670228109",
51
51
  "dayjs": "^1.10.4",
52
52
  "decimal.js": "^10.2.1"
53
53
  },
@@ -55,8 +55,8 @@
55
55
  "@types/jest": "^26.0.15",
56
56
  "@types/lodash-es": "^4.17.6",
57
57
  "@types/node": "^18.7.18",
58
- "@varlet/cli": "2.1.0",
59
- "@varlet/touch-emulator": "2.1.0",
58
+ "@varlet/cli": "2.2.0-alpha.1667670228109",
59
+ "@varlet/touch-emulator": "2.2.0-alpha.1667670228109",
60
60
  "@vue/runtime-core": "3.2.25",
61
61
  "@vue/test-utils": "^2.0.2",
62
62
  "clipboard": "^2.0.6",
package/types/form.d.ts CHANGED
@@ -1,5 +1,16 @@
1
1
  import { VarComponent, BasicAttributes } from './varComponent'
2
- import { VNode } from 'vue'
2
+ import { ComputedRef, VNode, Ref } from 'vue'
3
+
4
+ export interface FormValidation {
5
+ validate(): Promise<boolean>
6
+ resetValidation(): void
7
+ reset(): void
8
+ }
9
+
10
+ export interface FormProvider {
11
+ disabled: ComputedRef<boolean>
12
+ readonly: ComputedRef<boolean>
13
+ }
3
14
 
4
15
  export interface FormProps extends BasicAttributes {
5
16
  disabled?: boolean
@@ -7,6 +18,22 @@ export interface FormProps extends BasicAttributes {
7
18
  }
8
19
 
9
20
  export class Form extends VarComponent {
21
+ static useForm(): {
22
+ form: FormProvider | null
23
+
24
+ bindForm: ((formValidation: FormValidation) => void) | null
25
+ }
26
+
27
+ static useValidation(): {
28
+ errorMessage: Ref<string>
29
+
30
+ validate(rules: any, value: any, apis?: any): Promise<boolean>
31
+
32
+ resetValidation(): void
33
+
34
+ validateWithTrigger<T>(validateTrigger: T[], trigger: T, rules: any, value: any, apis?: any): Promise<void>
35
+ }
36
+
10
37
  $props: FormProps
11
38
 
12
39
  $slots: {
@@ -0,0 +1,12 @@
1
+ import { VarComponent, BasicAttributes } from './varComponent'
2
+
3
+ export interface FormDetailsProps extends BasicAttributes {
4
+ errorMessage?: string
5
+ extraMessage?: string
6
+ }
7
+
8
+ export class FormDetails extends VarComponent {
9
+ $props: FormDetailsProps
10
+ }
11
+
12
+ export class _FormDetailsComponent extends FormDetails {}
package/types/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from './datePicker'
23
23
  export * from './dialog'
24
24
  export * from './divider'
25
25
  export * from './form'
26
+ export * from './formDetails'
26
27
  export * from './icon'
27
28
  export * from './image'
28
29
  export * from './imagePreview'
@@ -91,6 +92,7 @@ declare module 'vue' {
91
92
  VarDialog: typeof import('@varlet/ui')['_DialogComponent']
92
93
  VarDivider: typeof import('@varlet/ui')['_DividerComponent']
93
94
  VarForm: typeof import('@varlet/ui')['_FormComponent']
95
+ VarFormDetails: typeof import('@varlet/ui')['_FormDetailsComponent']
94
96
  VarIcon: typeof import('@varlet/ui')['_IconComponent']
95
97
  VarImage: typeof import('@varlet/ui')['_ImageComponent']
96
98
  VarImagePreview: typeof import('@varlet/ui')['_ImagePreviewComponent']
package/types/lazy.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { VarDirective } from './varDirective'
2
-
3
- export class Lazy extends VarDirective {}
4
-
5
- export class _LazyComponent extends Lazy {}
1
+ import { VarDirective } from './varDirective'
2
+
3
+ export class Lazy extends VarDirective {}
4
+
5
+ export class _LazyComponent extends Lazy {}
package/types/ripple.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { VarDirective } from './varDirective'
2
-
3
- export class Ripple extends VarDirective {}
4
-
5
- export class _RippleComponent extends Ripple {}
1
+ import { VarDirective } from './varDirective'
2
+
3
+ export class Ripple extends VarDirective {}
4
+
5
+ export class _RippleComponent extends Ripple {}
@@ -1,12 +1,12 @@
1
- import type { App } from 'vue'
2
- import { DirectiveBinding } from '@vue/runtime-core'
3
-
4
- export class VarDirective {
5
- static install(app: App): void
6
-
7
- static mounted(el: HTMLElement, binding: DirectiveBinding): void
8
-
9
- static updated(el: HTMLElement, binding: DirectiveBinding): void
10
-
11
- static unmounted(el: HTMLElement, binding: DirectiveBinding): void
12
- }
1
+ import type { App } from 'vue'
2
+ import { DirectiveBinding } from '@vue/runtime-core'
3
+
4
+ export class VarDirective {
5
+ static install(app: App): void
6
+
7
+ static mounted(el: HTMLElement, binding: DirectiveBinding): void
8
+
9
+ static updated(el: HTMLElement, binding: DirectiveBinding): void
10
+
11
+ static unmounted(el: HTMLElement, binding: DirectiveBinding): void
12
+ }