@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,7 +1,16 @@
1
1
  import { Attributes } from '@esportsplus/template';
2
2
  declare const _default: {
3
- (): import("@esportsplus/template").Renderable<unknown>;
4
- (content: import("@esportsplus/template").Renderable<unknown>): import("@esportsplus/template").Renderable<unknown>;
5
- (attributes: Attributes, content: import("@esportsplus/template").Renderable<unknown>): import("@esportsplus/template").Renderable<unknown>;
3
+ (): ReturnType<(this: {
4
+ attributes?: Attributes | undefined;
5
+ content?: import("@esportsplus/template").Renderable<any>;
6
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
7
+ (content: import("@esportsplus/template").Renderable<any>): ReturnType<(this: {
8
+ attributes?: Attributes | undefined;
9
+ content?: import("@esportsplus/template").Renderable<any>;
10
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
11
+ (attributes: Attributes, content: import("@esportsplus/template").Renderable<any>): ReturnType<(this: {
12
+ attributes?: Attributes | undefined;
13
+ content?: import("@esportsplus/template").Renderable<any>;
14
+ }, attributes: Readonly<Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
6
15
  };
7
16
  export default _default;
@@ -1,7 +1,16 @@
1
1
  import './scss/index.scss';
2
2
  declare const _default: {
3
- (): import("@esportsplus/template").Renderable<unknown>;
4
- (content: string[]): import("@esportsplus/template").Renderable<unknown>;
5
- (attributes: import("@esportsplus/template").Attributes, content: string[]): import("@esportsplus/template").Renderable<unknown>;
3
+ (): ReturnType<(this: {
4
+ attributes?: import("@esportsplus/template").Attributes | undefined;
5
+ content?: string[] | undefined;
6
+ }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: string[]) => import("@esportsplus/template").Renderable<any>>;
7
+ (content: string[]): ReturnType<(this: {
8
+ attributes?: import("@esportsplus/template").Attributes | undefined;
9
+ content?: string[] | undefined;
10
+ }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: string[]) => import("@esportsplus/template").Renderable<any>>;
11
+ (attributes: import("@esportsplus/template").Attributes, content: string[]): ReturnType<(this: {
12
+ attributes?: import("@esportsplus/template").Attributes | undefined;
13
+ content?: string[] | undefined;
14
+ }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: string[]) => import("@esportsplus/template").Renderable<any>>;
6
15
  };
7
16
  export default _default;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "@esportsplus/action": "^0.0.58",
5
5
  "@esportsplus/queue": "^0.1.0",
6
6
  "@esportsplus/reactivity": "^0.16.7",
7
- "@esportsplus/template": "^0.19.5",
7
+ "@esportsplus/template": "^0.20.3",
8
8
  "@esportsplus/utilities": "^0.22.1",
9
9
  "modern-normalize": "^3.0.1"
10
10
  },
@@ -16,7 +16,7 @@
16
16
  "lightningcss": "^1.30.1",
17
17
  "npm-run-all": "^4.1.5",
18
18
  "sass": "^1.90.0",
19
- "vite": "^7.1.2"
19
+ "vite": "^7.1.3"
20
20
  },
21
21
  "exports": {
22
22
  "./css-utilities": {
@@ -48,7 +48,7 @@
48
48
  "private": false,
49
49
  "sideEffects": false,
50
50
  "type": "module",
51
- "version": "0.19.1",
51
+ "version": "0.19.3",
52
52
  "scripts": {
53
53
  "build": "run-s build:vite build:ts",
54
54
  "build:ts": "tsc && tsc-alias",
@@ -1,29 +1,26 @@
1
1
  import { reactive } from '@esportsplus/reactivity';
2
2
  import { html, type Attributes, type Renderable } from '@esportsplus/template';
3
- import { omit, pick } from '@esportsplus/utilities';
3
+ import { omit } from '@esportsplus/utilities';
4
4
  import template from '~/components/template';
5
5
 
6
6
 
7
7
  type A = Attributes & {
8
- checked?: boolean;
9
- disabled?: boolean;
10
- name?: string;
11
- required?: boolean;
12
- type?: string;
13
- value?: unknown;
8
+ 'field-mask-tag'?: Attributes
14
9
  };
15
10
 
16
11
 
17
12
  const OMIT_FIELD = ['state'];
18
13
 
19
- const TAG = ['checked', 'disabled', 'name', 'required'];
14
+ const OMIT_TAG = ['field-mask-tag'];
20
15
 
21
16
 
22
17
  function mask(attributes: A, modifier: string, state: { active: boolean }) {
18
+ let a = attributes['field-mask-tag'] || {};
19
+
23
20
  return html`
24
21
  <div
25
22
  class='field-mask'
26
- ${omit(attributes, TAG)}
23
+ ${omit(attributes, OMIT_TAG)}
27
24
  ${{
28
25
  class: `field-mask--${modifier}`
29
26
  }}
@@ -31,11 +28,11 @@ function mask(attributes: A, modifier: string, state: { active: boolean }) {
31
28
  <input
32
29
  class='field-mask-tag field-mask-tag--hidden'
33
30
  ${{
34
- checked: attributes.checked || attributes.value || state.active,
31
+ checked: a.checked || a.value || state.active,
35
32
  type: modifier === 'radio' ? 'radio' : 'checkbox',
36
- value: attributes.value || 1
33
+ value: a.value || 1
37
34
  }}
38
- ${pick(attributes, TAG) as Attributes}
35
+ ${a}
39
36
  >
40
37
  </div>
41
38
  `;
@@ -44,7 +41,7 @@ function mask(attributes: A, modifier: string, state: { active: boolean }) {
44
41
 
45
42
  const field = template.factory(
46
43
  function(
47
- this: ((attributes: A, state: { active: boolean }) => Renderable<unknown>),
44
+ this: { mask: (attributes: A, state: { active: boolean }) => Renderable<unknown> },
48
45
  attributes: Attributes & { state?: { active: boolean } },
49
46
  content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>
50
47
  ) {
@@ -67,7 +64,7 @@ const field = template.factory(
67
64
  }
68
65
  }}
69
66
  >
70
- ${content((attributes) => this(attributes, state))}
67
+ ${content((attributes) => this.mask(attributes, state))}
71
68
  </label>
72
69
  `
73
70
  }
@@ -75,13 +72,19 @@ const field = template.factory(
75
72
 
76
73
 
77
74
  export default {
78
- checkbox: field.bind((attributes: A, state: { active: boolean }) => {
79
- return mask(attributes, 'checkbox', state);
75
+ checkbox: field.bind({
76
+ mask: (attributes: A, state: { active: boolean }) => {
77
+ return mask(attributes, 'checkbox', state);
78
+ }
80
79
  }),
81
- radio: field.bind((attributes: A, state: { active: boolean }) => {
82
- return mask(attributes, 'radio', state);
80
+ radio: field.bind({
81
+ mask: (attributes: A, state: { active: boolean }) => {
82
+ return mask(attributes, 'radio', state);
83
+ }
83
84
  }),
84
- switch: field.bind((attributes: A, state: { active: boolean }) => {
85
- return mask(attributes, 'switch', state);
85
+ switch: field.bind({
86
+ mask: (attributes: A, state: { active: boolean }) => {
87
+ return mask(attributes, 'switch', state);
88
+ }
86
89
  }),
87
90
  };
@@ -1,32 +1,19 @@
1
1
  import { reactive } from '@esportsplus/reactivity';
2
2
  import { html, type Attributes, type Renderable } from '@esportsplus/template';
3
- import { omit, pick } from '@esportsplus/utilities';
3
+ import { omit } from '@esportsplus/utilities';
4
4
  import form from '~/components/form';
5
5
  import template from '~/components/template';
6
6
  import error from './error';
7
7
 
8
8
 
9
- const FILE_TAG = ['accept', 'disabled', 'name', 'required', 'value'];
9
+ type A = Attributes & {
10
+ 'field-mask-tag'?: Attributes
11
+ };
12
+
10
13
 
11
- const OMIT = ['state'];
14
+ const OMIT_FIELD = ['state'];
12
15
 
13
- const TEXT_TAG = [
14
- 'autocapitalize',
15
- 'autocomplete',
16
- 'autocorrect',
17
- 'autofocus',
18
- 'disabled',
19
- 'maxlength',
20
- 'minlength',
21
- 'name',
22
- 'placeholder',
23
- 'readonly',
24
- 'required',
25
- 'spellcheck',
26
- 'type',
27
- 'value',
28
- 'wrap'
29
- ];
16
+ const OMIT_TAG = ['field-mask-tag'];
30
17
 
31
18
 
32
19
  const field = template.factory(
@@ -43,7 +30,7 @@ const field = template.factory(
43
30
  return html`
44
31
  <div
45
32
  class='field'
46
- ${omit(attributes, OMIT)}
33
+ ${omit(attributes, OMIT_FIELD)}
47
34
  ${{
48
35
  class: () => state.active && '--active',
49
36
  onfocusin: () => {
@@ -65,16 +52,16 @@ const field = template.factory(
65
52
  );
66
53
 
67
54
  const file = template.factory(
68
- function(this: { state: { active: boolean, error: string } }, attributes, content) {
55
+ function(this: { state: { active: boolean, error: string } }, attributes: A, content) {
69
56
  return html`
70
57
  <label
71
58
  class='field-mask field-mask--file'
72
- ${omit(attributes, FILE_TAG)}
59
+ ${omit(attributes, OMIT_TAG)}
73
60
  >
74
61
  <input
75
62
  class='field-mask-tag field-mask-tag--hidden'
76
63
  type='file'
77
- ${pick(attributes, FILE_TAG) as Attributes}
64
+ ${attributes['field-mask-tag']}
78
65
  ${{
79
66
  onrender: form.input.onrender(this.state)
80
67
  }}
@@ -87,12 +74,15 @@ const file = template.factory(
87
74
  );
88
75
 
89
76
  const text = template.factory(
90
- function(this: { state: { active: boolean, error: string } }, attributes, content) {
77
+ function(this: { state: { active: boolean, error: string } }, attributes: A, content) {
91
78
  return html`
92
- <label class='field-mask field-mask--input' ${omit(attributes, TEXT_TAG)}>
79
+ <label
80
+ class='field-mask field-mask--input'
81
+ ${omit(attributes, OMIT_TAG)}
82
+ >
93
83
  <input
94
84
  class='field-mask-tag'
95
- ${pick(attributes, TEXT_TAG) as Attributes}
85
+ ${attributes['field-mask-tag']}
96
86
  ${{
97
87
  onrender: form.input.onrender(this.state),
98
88
  type: attributes.type || 'text'
@@ -105,20 +95,22 @@ const text = template.factory(
105
95
  );
106
96
 
107
97
  const textarea = template.factory(
108
- function(this: { state: { active: boolean, error: string } }, attributes: Attributes & { value?: string }, content) {
98
+ function(this: { state: { active: boolean, error: string } }, attributes: A, content) {
99
+ let a = attributes['field-mask-tag'] || {};
100
+
109
101
  return html`
110
102
  <label
111
103
  class='field-mask field-mask--textarea'
112
- ${omit(attributes, TEXT_TAG)}
104
+ ${omit(attributes, OMIT_TAG)}
113
105
  >
114
106
  <textarea
115
107
  class='field-mask-tag'
116
- ${pick(attributes, TEXT_TAG) as Attributes}
108
+ ${a}
117
109
  ${{
118
110
  onrender: form.input.onrender(this.state)
119
111
  }}
120
112
  >
121
- ${attributes.value}
113
+ ${a.value as string}
122
114
  </textarea>
123
115
  ${content}
124
116
  </label>
@@ -1,6 +1,6 @@
1
1
  import { reactive } from '@esportsplus/reactivity';
2
2
  import { html, type Attributes, type Renderable } from '@esportsplus/template';
3
- import { isObject, omit, pick, toArray } from '@esportsplus/utilities';
3
+ import { isObject, omit, toArray } from '@esportsplus/utilities';
4
4
  import form from '~/components/form';
5
5
  import root from '~/components/root';
6
6
  import scrollbar, { Attributes as A } from '~/components/scrollbar';
@@ -8,21 +8,12 @@ import template from '~/components/template';
8
8
  import error from './error';
9
9
 
10
10
 
11
- const PICK_TAG = [
12
- 'autocomplete',
13
- 'autofocus',
14
- 'disabled',
15
- 'name',
16
- 'required',
17
- 'type'
18
- ];
19
-
20
11
  const OMIT_FIELD = ['options', 'state'];
21
12
 
22
13
  const OMIT_MASK = [
23
- ...PICK_TAG,
24
14
  'field-mask-arrow',
25
15
  'field-mask-text',
16
+ 'field-mask-tag',
26
17
  'scrollbar',
27
18
  'scrollbar-container-content',
28
19
  'tooltip-content',
@@ -45,6 +36,7 @@ const select = template.factory(
45
36
  },
46
37
  attributes: Attributes & A & {
47
38
  'field-mask-arrow'?: Attributes;
39
+ 'field-mask-tag'?: Attributes;
48
40
  'field-mask-text'?: Attributes;
49
41
  'tooltip-content'?: Attributes & { direction?: string };
50
42
  },
@@ -74,7 +66,7 @@ const select = template.factory(
74
66
  onrender: form.input.onrender(state),
75
67
  value: () => state.selected
76
68
  }}
77
- ${pick(attributes, PICK_TAG) as Attributes}
69
+ ${attributes['field-mask-tag']}
78
70
  >
79
71
 
80
72
  ${content || html`
@@ -142,9 +134,6 @@ const select = template.factory(
142
134
  );
143
135
 
144
136
 
145
-
146
-
147
-
148
137
  export default template.factory<
149
138
  Attributes & {
150
139
  options: Record<number | string, (number | string | Attributes & { content: unknown })>;
@@ -3,15 +3,15 @@ import { Attributes, Renderable } from '@esportsplus/template';
3
3
 
4
4
  const factory = <
5
5
  A extends Attributes,
6
- C = Renderable<unknown>,
6
+ C = Renderable<any>,
7
7
  Context = { attributes?: A, content?: C }
8
8
  >(
9
- template: (this: Context, attributes: Readonly<A>, content: C) => Renderable<unknown>
9
+ template: (this: Context, attributes: Readonly<A>, content: C) => Renderable<any>
10
10
  ) => {
11
- function factory(): Renderable<unknown>;
12
- function factory(content: C): Renderable<unknown>;
13
- function factory(attributes: A, content: C): Renderable<unknown>;
14
- function factory(this: Context, one?: A | C, two?: C): Renderable<unknown> {
11
+ function factory(): ReturnType<typeof template>;
12
+ function factory(content: C): ReturnType<typeof template>;
13
+ function factory(attributes: A, content: C): ReturnType<typeof template>;
14
+ function factory(this: Context, one?: A | C, two?: C): ReturnType<typeof template> {
15
15
  let attributes: A = {} as A,
16
16
  content: C;
17
17