@esportsplus/ui 0.33.0 → 0.33.2

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.
@@ -16,7 +16,7 @@ const factory = (type) => {
16
16
  return html `
17
17
  <div
18
18
  class='${type} ${() => state.active && '--active'}'
19
- ${this.attributes && omit(this.attributes, OMIT)}
19
+ ${this?.attributes && omit(this.attributes, OMIT)}
20
20
  ${attributes && omit(attributes, OMIT)}
21
21
  >
22
22
  <input
@@ -1,9 +1,10 @@
1
1
  import { type Attributes } from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
- declare const _default: (attributes: Attributes & {
3
+ export default function (this: {
4
+ attributes?: Attributes;
5
+ }, attributes: Attributes & {
4
6
  state?: {
5
7
  active: boolean;
6
8
  error: string;
7
9
  };
8
- }) => Node;
9
- export default _default;
10
+ }): Node;
@@ -2,7 +2,7 @@ import { reactive } from '@esportsplus/reactivity';
2
2
  import { html } from '@esportsplus/template';
3
3
  import form from '../../components/form/index.js';
4
4
  import './scss/index.scss';
5
- export default (attributes) => {
5
+ export default function (attributes) {
6
6
  let state = attributes.state || reactive({
7
7
  active: false,
8
8
  error: ''
@@ -10,6 +10,8 @@ export default (attributes) => {
10
10
  return html `
11
11
  <input
12
12
  class='input'
13
+ ${this?.attributes}
14
+ ${attributes}
13
15
  ${{
14
16
  class: () => state.active && '--active',
15
17
  onfocusin: () => {
@@ -21,7 +23,7 @@ export default (attributes) => {
21
23
  onrender: form.input.onrender(state),
22
24
  type: (attributes.type || 'text')
23
25
  }}
24
- ${attributes}
25
26
  />
26
27
  `;
27
- };
28
+ }
29
+ ;
@@ -1,7 +1,7 @@
1
1
  import { type Attributes } from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
3
  export default function (this: {
4
- attributes: Attributes;
4
+ attributes?: Attributes;
5
5
  }, attributes: Attributes & {
6
6
  state?: {
7
7
  active: boolean;
@@ -15,7 +15,7 @@ export default function (attributes) {
15
15
  <input
16
16
  class='range --border-state --border-black'
17
17
  type='range'
18
- ${this.attributes}
18
+ ${this?.attributes}
19
19
  ${attributes}
20
20
  ${{
21
21
  class: () => state.active && '--active',
@@ -13,12 +13,12 @@ export default template.factory(function (attributes, content) {
13
13
  return html `
14
14
  <div
15
15
  class='scrollbar-container'
16
- ${this.attributes && omit(this.attributes, OMIT)}
16
+ ${this?.attributes && omit(this.attributes, OMIT)}
17
17
  ${omit(attributes, OMIT)}
18
18
  >
19
19
  <div
20
20
  class='scrollbar-container-content'
21
- ${this.attributes?.['scrollbar-container-content']}
21
+ ${this?.attributes?.['scrollbar-container-content']}
22
22
  ${attributes['scrollbar-container-content']}
23
23
  ${{
24
24
  onscroll: function () {
@@ -38,7 +38,7 @@ export default template.factory(function (attributes, content) {
38
38
 
39
39
  <div
40
40
  class='scrollbar'
41
- ${this.attributes?.scrollbar}
41
+ ${this?.attributes?.scrollbar}
42
42
  ${attributes.scrollbar}
43
43
  ${{
44
44
  class: () => state.height >= 100 && 'scrollbar--hidden',
@@ -51,7 +51,7 @@ const select = template.factory(function (attributes, content) {
51
51
  return html `
52
52
  <div
53
53
  class='select tooltip ${() => state.active && '--active'}'
54
- ${this.attributes && omit(this.attributes, OMIT)}
54
+ ${this?.attributes && omit(this.attributes, OMIT)}
55
55
  ${omit(attributes, OMIT)}
56
56
  onclick=${() => {
57
57
  if (state.render) {
@@ -62,7 +62,7 @@ const select = template.factory(function (attributes, content) {
62
62
  >
63
63
  ${content || (() => options[state.selected] || '-')}
64
64
 
65
- <div class='select-arrow' ${this.attributes?.arrow} ${attributes.arrow}></div>
65
+ <div class='select-arrow' ${this?.attributes?.arrow} ${attributes.arrow}></div>
66
66
 
67
67
  <input class='select-tag'
68
68
  ${{
@@ -103,7 +103,7 @@ const select = template.factory(function (attributes, content) {
103
103
  }, keys.map((key) => html `
104
104
  <div
105
105
  class='link select-option ${() => selected[key] && '--active'}'
106
- ${this.attributes?.option}
106
+ ${this?.attributes?.option}
107
107
  ${option}
108
108
  data-key='${key}'
109
109
  >
@@ -12,7 +12,7 @@ export default function (attributes) {
12
12
  return html `
13
13
  <textarea
14
14
  class='textarea'
15
- ${this.attributes && omit(this.attributes, OMIT)}
15
+ ${this?.attributes && omit(this.attributes, OMIT)}
16
16
  ${omit(attributes, OMIT)}
17
17
  ${{
18
18
  class: () => state.active && '--active',
package/package.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "private": false,
49
49
  "sideEffects": false,
50
50
  "type": "module",
51
- "version": "0.33.0",
51
+ "version": "0.33.2",
52
52
  "scripts": {
53
53
  "build": "run-s build:vite build:ts",
54
54
  "build:ts": "tsc && tsc-alias",
@@ -25,7 +25,7 @@ const factory = (type: string) => {
25
25
  return html`
26
26
  <div
27
27
  class='${type} ${() => state.active && '--active'}'
28
- ${this.attributes && omit(this.attributes, OMIT)}
28
+ ${this?.attributes && omit(this.attributes, OMIT)}
29
29
  ${attributes && omit(attributes, OMIT)}
30
30
  >
31
31
  <input
@@ -4,7 +4,10 @@ import form from '~/components/form';
4
4
  import './scss/index.scss';
5
5
 
6
6
 
7
- export default (attributes: Attributes & { state?: { active: boolean, error: string } }) => {
7
+ export default function (
8
+ this: { attributes?: Attributes },
9
+ attributes: Attributes & { state?: { active: boolean, error: string } }
10
+ ) {
8
11
  let state = attributes.state || reactive({
9
12
  active: false,
10
13
  error: ''
@@ -13,6 +16,8 @@ export default (attributes: Attributes & { state?: { active: boolean, error: str
13
16
  return html`
14
17
  <input
15
18
  class='input'
19
+ ${this?.attributes}
20
+ ${attributes}
16
21
  ${{
17
22
  class: () => state.active && '--active',
18
23
  onfocusin: () => {
@@ -24,7 +29,6 @@ export default (attributes: Attributes & { state?: { active: boolean, error: str
24
29
  onrender: form.input.onrender(state),
25
30
  type: (attributes.type || 'text') as string
26
31
  }}
27
- ${attributes}
28
32
  />
29
33
  `;
30
34
  };
@@ -5,7 +5,7 @@ import './scss/index.scss';
5
5
 
6
6
 
7
7
  export default function(
8
- this: { attributes: Attributes },
8
+ this: { attributes?: Attributes },
9
9
  attributes: Attributes & { state?: { active: boolean, error: string, value: number } }
10
10
  ) {
11
11
  let state = attributes.state || reactive({
@@ -22,7 +22,7 @@ export default function(
22
22
  <input
23
23
  class='range --border-state --border-black'
24
24
  type='range'
25
- ${this.attributes}
25
+ ${this?.attributes}
26
26
  ${attributes}
27
27
  ${{
28
28
  class: () => state.active && '--active',
@@ -25,12 +25,12 @@ export default template.factory<A>(
25
25
  return html`
26
26
  <div
27
27
  class='scrollbar-container'
28
- ${this.attributes && omit(this.attributes, OMIT)}
28
+ ${this?.attributes && omit(this.attributes, OMIT)}
29
29
  ${omit(attributes, OMIT)}
30
30
  >
31
31
  <div
32
32
  class='scrollbar-container-content'
33
- ${this.attributes?.['scrollbar-container-content']}
33
+ ${this?.attributes?.['scrollbar-container-content']}
34
34
  ${attributes['scrollbar-container-content']}
35
35
  ${{
36
36
  onscroll: function() {
@@ -52,7 +52,7 @@ export default template.factory<A>(
52
52
 
53
53
  <div
54
54
  class='scrollbar'
55
- ${this.attributes?.scrollbar}
55
+ ${this?.attributes?.scrollbar}
56
56
  ${attributes.scrollbar}
57
57
  ${{
58
58
  class: () => state.height >= 100 && 'scrollbar--hidden',
@@ -86,7 +86,7 @@ const select = template.factory<A>(
86
86
  return html`
87
87
  <div
88
88
  class='select tooltip ${() => state.active && '--active'}'
89
- ${this.attributes && omit(this.attributes, OMIT)}
89
+ ${this?.attributes && omit(this.attributes, OMIT)}
90
90
  ${omit(attributes, OMIT)}
91
91
  onclick=${() => {
92
92
  if (state.render) {
@@ -98,7 +98,7 @@ const select = template.factory<A>(
98
98
  >
99
99
  ${content || (() => options[ state.selected! ] || '-')}
100
100
 
101
- <div class='select-arrow' ${this.attributes?.arrow} ${attributes.arrow}></div>
101
+ <div class='select-arrow' ${this?.attributes?.arrow} ${attributes.arrow}></div>
102
102
 
103
103
  <input class='select-tag'
104
104
  ${{
@@ -150,7 +150,7 @@ const select = template.factory<A>(
150
150
  keys.map((key) => html`
151
151
  <div
152
152
  class='link select-option ${() => selected[key] && '--active'}'
153
- ${this.attributes?.option}
153
+ ${this?.attributes?.option}
154
154
  ${option}
155
155
  data-key='${key}'
156
156
  >
@@ -20,7 +20,7 @@ export default function(
20
20
  return html`
21
21
  <textarea
22
22
  class='textarea'
23
- ${this.attributes && omit(this.attributes, OMIT)}
23
+ ${this?.attributes && omit(this.attributes, OMIT)}
24
24
  ${omit(attributes, OMIT)}
25
25
  ${{
26
26
  class: () => state.active && '--active',