@esportsplus/ui 0.33.1 → 0.33.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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Attributes } from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
|
-
|
|
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
|
-
})
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { reactive } from '@esportsplus/reactivity';
|
|
2
2
|
import { html } from '@esportsplus/template';
|
|
3
|
-
import { omit, toArray } from '@esportsplus/utilities';
|
|
3
|
+
import { EMPTY_ARRAY, omit, toArray } from '@esportsplus/utilities';
|
|
4
4
|
import form from '../../components/form/index.js';
|
|
5
5
|
import root from '../../components/root/index.js';
|
|
6
6
|
import scrollbar from '../../components/scrollbar/index.js';
|
|
@@ -79,6 +79,7 @@ const select = template.factory(function (attributes, content) {
|
|
|
79
79
|
}
|
|
80
80
|
let keys = Object.keys(options), selected = reactive(Object.fromEntries(keys.map(key => [key, false])));
|
|
81
81
|
return sb({
|
|
82
|
+
...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
|
|
82
83
|
...attributes['tooltip-content'],
|
|
83
84
|
class: [
|
|
84
85
|
...toArray(attributes['tooltip-content']?.class),
|
package/package.json
CHANGED
|
@@ -4,7 +4,10 @@ import form from '~/components/form';
|
|
|
4
4
|
import './scss/index.scss';
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
export default (
|
|
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
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reactive } from '@esportsplus/reactivity';
|
|
2
2
|
import { html, Renderable, type Attributes } from '@esportsplus/template';
|
|
3
|
-
import { omit, toArray } from '@esportsplus/utilities';
|
|
3
|
+
import { EMPTY_ARRAY, 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 Attr } from '~/components/scrollbar';
|
|
@@ -121,6 +121,7 @@ const select = template.factory<A>(
|
|
|
121
121
|
|
|
122
122
|
return sb(
|
|
123
123
|
{
|
|
124
|
+
...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
|
|
124
125
|
...attributes['tooltip-content'],
|
|
125
126
|
class: [
|
|
126
127
|
...toArray(attributes['tooltip-content']?.class),
|