@esportsplus/ui 0.33.1 → 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.
@@ -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
+ ;
package/package.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "private": false,
49
49
  "sideEffects": false,
50
50
  "type": "module",
51
- "version": "0.33.1",
51
+ "version": "0.33.2",
52
52
  "scripts": {
53
53
  "build": "run-s build:vite build:ts",
54
54
  "build:ts": "tsc && tsc-alias",
@@ -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
  };