@esportsplus/ui 0.19.1 → 0.19.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 (31) hide show
  1. package/build/components/accordion/index.d.ts +12 -3
  2. package/build/components/field/checkbox.d.ts +46 -15
  3. package/build/components/field/checkbox.js +20 -13
  4. package/build/components/field/description.d.ts +12 -3
  5. package/build/components/field/index.d.ts +10283 -1736
  6. package/build/components/field/input.d.ts +81 -18
  7. package/build/components/field/input.js +15 -28
  8. package/build/components/field/select.d.ts +917 -113
  9. package/build/components/field/select.js +3 -11
  10. package/build/components/field/title.d.ts +809 -110
  11. package/build/components/form/action.d.ts +12 -3
  12. package/build/components/form/index.d.ts +869 -110
  13. package/build/components/frame/index.d.ts +12 -3
  14. package/build/components/highlight/index.d.ts +12 -3
  15. package/build/components/icon/index.d.ts +12 -3
  16. package/build/components/loader/index.d.ts +12 -3
  17. package/build/components/overlay/index.d.ts +12 -3
  18. package/build/components/scrollbar/index.d.ts +12 -3
  19. package/build/components/sidebar/index.d.ts +12 -3
  20. package/build/components/site/index.d.ts +12 -3
  21. package/build/components/template/index.d.ts +5 -5
  22. package/build/components/tooltip/index.d.ts +1708 -223
  23. package/build/components/tooltip/menu.d.ts +12 -3
  24. package/build/components/tooltip/onclick.d.ts +827 -110
  25. package/build/components/tooltip/onhover.d.ts +12 -3
  26. package/build/components/typewriter/index.d.ts +12 -3
  27. package/package.json +3 -3
  28. package/src/components/field/checkbox.ts +23 -20
  29. package/src/components/field/input.ts +23 -31
  30. package/src/components/field/select.ts +4 -15
  31. package/src/components/template/index.ts +6 -6
@@ -1,34 +1,97 @@
1
1
  import { type Attributes, type Renderable } from '@esportsplus/template';
2
2
  declare const file: {
3
- (): Renderable<unknown>;
4
- (content: Renderable<unknown>): Renderable<unknown>;
5
- (attributes: Attributes, content: Renderable<unknown>): Renderable<unknown>;
3
+ (): ReturnType<(this: {
4
+ state: {
5
+ active: boolean;
6
+ error: string;
7
+ };
8
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
9
+ (content: Renderable<any>): ReturnType<(this: {
10
+ state: {
11
+ active: boolean;
12
+ error: string;
13
+ };
14
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
15
+ (attributes: Attributes, content: Renderable<any>): ReturnType<(this: {
16
+ state: {
17
+ active: boolean;
18
+ error: string;
19
+ };
20
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
6
21
  };
7
22
  declare const text: {
8
- (): Renderable<unknown>;
9
- (content: Renderable<unknown>): Renderable<unknown>;
10
- (attributes: Attributes, content: Renderable<unknown>): Renderable<unknown>;
23
+ (): ReturnType<(this: {
24
+ state: {
25
+ active: boolean;
26
+ error: string;
27
+ };
28
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
29
+ (content: Renderable<any>): ReturnType<(this: {
30
+ state: {
31
+ active: boolean;
32
+ error: string;
33
+ };
34
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
35
+ (attributes: Attributes, content: Renderable<any>): ReturnType<(this: {
36
+ state: {
37
+ active: boolean;
38
+ error: string;
39
+ };
40
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
11
41
  };
12
42
  declare const textarea: {
13
- (): Renderable<unknown>;
14
- (content: Renderable<unknown>): Renderable<unknown>;
15
- (attributes: Attributes, content: Renderable<unknown>): Renderable<unknown>;
43
+ (): ReturnType<(this: {
44
+ state: {
45
+ active: boolean;
46
+ error: string;
47
+ };
48
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
49
+ (content: Renderable<any>): ReturnType<(this: {
50
+ state: {
51
+ active: boolean;
52
+ error: string;
53
+ };
54
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
55
+ (attributes: Attributes, content: Renderable<any>): ReturnType<(this: {
56
+ state: {
57
+ active: boolean;
58
+ error: string;
59
+ };
60
+ }, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
16
61
  };
17
62
  declare const _default: {
18
63
  file: {
19
- (): Renderable<unknown>;
20
- (content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): Renderable<unknown>;
21
- (attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): Renderable<unknown>;
64
+ (): ReturnType<(this: {
65
+ mask: typeof file | typeof text | typeof textarea;
66
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
67
+ (content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
68
+ mask: typeof file | typeof text | typeof textarea;
69
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
70
+ (attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
71
+ mask: typeof file | typeof text | typeof textarea;
72
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
22
73
  };
23
74
  text: {
24
- (): Renderable<unknown>;
25
- (content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): Renderable<unknown>;
26
- (attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): Renderable<unknown>;
75
+ (): ReturnType<(this: {
76
+ mask: typeof file | typeof text | typeof textarea;
77
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
78
+ (content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
79
+ mask: typeof file | typeof text | typeof textarea;
80
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
81
+ (attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
82
+ mask: typeof file | typeof text | typeof textarea;
83
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
27
84
  };
28
85
  textarea: {
29
- (): Renderable<unknown>;
30
- (content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): Renderable<unknown>;
31
- (attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): Renderable<unknown>;
86
+ (): ReturnType<(this: {
87
+ mask: typeof file | typeof text | typeof textarea;
88
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
89
+ (content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
90
+ mask: typeof file | typeof text | typeof textarea;
91
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
92
+ (attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
93
+ mask: typeof file | typeof text | typeof textarea;
94
+ }, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
32
95
  };
33
96
  };
34
97
  export default _default;
@@ -1,28 +1,11 @@
1
1
  import { reactive } from '@esportsplus/reactivity';
2
2
  import { html } from '@esportsplus/template';
3
- import { omit, pick } from '@esportsplus/utilities';
3
+ import { omit } from '@esportsplus/utilities';
4
4
  import form from '../../components/form/index.js';
5
5
  import template from '../../components/template/index.js';
6
6
  import error from './error.js';
7
- const FILE_TAG = ['accept', 'disabled', 'name', 'required', 'value'];
8
- const OMIT = ['state'];
9
- const TEXT_TAG = [
10
- 'autocapitalize',
11
- 'autocomplete',
12
- 'autocorrect',
13
- 'autofocus',
14
- 'disabled',
15
- 'maxlength',
16
- 'minlength',
17
- 'name',
18
- 'placeholder',
19
- 'readonly',
20
- 'required',
21
- 'spellcheck',
22
- 'type',
23
- 'value',
24
- 'wrap'
25
- ];
7
+ const OMIT_FIELD = ['state'];
8
+ const OMIT_TAG = ['field-mask-tag'];
26
9
  const field = template.factory(function (attributes, content) {
27
10
  let state = attributes.state || reactive({
28
11
  active: false,
@@ -31,7 +14,7 @@ const field = template.factory(function (attributes, content) {
31
14
  return html `
32
15
  <div
33
16
  class='field'
34
- ${omit(attributes, OMIT)}
17
+ ${omit(attributes, OMIT_FIELD)}
35
18
  ${{
36
19
  class: () => state.active && '--active',
37
20
  onfocusin: () => {
@@ -51,12 +34,12 @@ const file = template.factory(function (attributes, content) {
51
34
  return html `
52
35
  <label
53
36
  class='field-mask field-mask--file'
54
- ${omit(attributes, FILE_TAG)}
37
+ ${omit(attributes, OMIT_TAG)}
55
38
  >
56
39
  <input
57
40
  class='field-mask-tag field-mask-tag--hidden'
58
41
  type='file'
59
- ${pick(attributes, FILE_TAG)}
42
+ ${attributes['field-mask-tag']}
60
43
  ${{
61
44
  onrender: form.input.onrender(this.state)
62
45
  }}
@@ -68,10 +51,13 @@ const file = template.factory(function (attributes, content) {
68
51
  });
69
52
  const text = template.factory(function (attributes, content) {
70
53
  return html `
71
- <label class='field-mask field-mask--input' ${omit(attributes, TEXT_TAG)}>
54
+ <label
55
+ class='field-mask field-mask--input'
56
+ ${omit(attributes, OMIT_TAG)}
57
+ >
72
58
  <input
73
59
  class='field-mask-tag'
74
- ${pick(attributes, TEXT_TAG)}
60
+ ${attributes['field-mask-tag']}
75
61
  ${{
76
62
  onrender: form.input.onrender(this.state),
77
63
  type: attributes.type || 'text'
@@ -82,19 +68,20 @@ const text = template.factory(function (attributes, content) {
82
68
  `;
83
69
  });
84
70
  const textarea = template.factory(function (attributes, content) {
71
+ let a = attributes['field-mask-tag'] || {};
85
72
  return html `
86
73
  <label
87
74
  class='field-mask field-mask--textarea'
88
- ${omit(attributes, TEXT_TAG)}
75
+ ${omit(attributes, OMIT_TAG)}
89
76
  >
90
77
  <textarea
91
78
  class='field-mask-tag'
92
- ${pick(attributes, TEXT_TAG)}
79
+ ${a}
93
80
  ${{
94
81
  onrender: form.input.onrender(this.state)
95
82
  }}
96
83
  >
97
- ${attributes.value}
84
+ ${a.value}
98
85
  </textarea>
99
86
  ${content}
100
87
  </label>