@esportsplus/ui 0.20.1 → 0.20.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.
|
@@ -19,6 +19,20 @@ declare const file: {
|
|
|
19
19
|
};
|
|
20
20
|
}, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
|
|
21
21
|
};
|
|
22
|
+
declare const range: {
|
|
23
|
+
(): ReturnType<(this: {
|
|
24
|
+
attributes?: Attributes | undefined;
|
|
25
|
+
content?: Renderable<any>;
|
|
26
|
+
}, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
|
|
27
|
+
(content: Renderable<any>): ReturnType<(this: {
|
|
28
|
+
attributes?: Attributes | undefined;
|
|
29
|
+
content?: Renderable<any>;
|
|
30
|
+
}, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
|
|
31
|
+
(attributes: Attributes, content: Renderable<any>): ReturnType<(this: {
|
|
32
|
+
attributes?: Attributes | undefined;
|
|
33
|
+
content?: Renderable<any>;
|
|
34
|
+
}, attributes: Readonly<Attributes>, content: Renderable<any>) => Renderable<any>>;
|
|
35
|
+
};
|
|
22
36
|
declare const text: {
|
|
23
37
|
(): ReturnType<(this: {
|
|
24
38
|
state: {
|
|
@@ -62,47 +76,47 @@ declare const textarea: {
|
|
|
62
76
|
declare const _default: {
|
|
63
77
|
file: {
|
|
64
78
|
(): 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>>;
|
|
79
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
80
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
81
|
+
(content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
82
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
83
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
84
|
+
(attributes: Attributes, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
85
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
86
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
73
87
|
};
|
|
74
88
|
range: {
|
|
75
89
|
(): 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>>;
|
|
90
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
91
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
92
|
+
(content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
93
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
94
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
95
|
+
(attributes: Attributes, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
96
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
97
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
84
98
|
};
|
|
85
99
|
text: {
|
|
86
100
|
(): 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>>;
|
|
101
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
102
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
103
|
+
(content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
104
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
105
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
106
|
+
(attributes: Attributes, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
107
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
108
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
95
109
|
};
|
|
96
110
|
textarea: {
|
|
97
111
|
(): ReturnType<(this: {
|
|
98
|
-
mask: typeof file | typeof text | typeof textarea;
|
|
99
|
-
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
100
|
-
(content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
101
|
-
mask: typeof file | typeof text | typeof textarea;
|
|
102
|
-
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
103
|
-
(attributes: Attributes, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
104
|
-
mask: typeof file | typeof text | typeof textarea;
|
|
105
|
-
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
112
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
113
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
114
|
+
(content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
115
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
116
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
117
|
+
(attributes: Attributes, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>): ReturnType<(this: {
|
|
118
|
+
mask: typeof file | typeof range | typeof text | typeof textarea;
|
|
119
|
+
}, attributes: Readonly<Attributes>, content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>) => Renderable<any>>;
|
|
106
120
|
};
|
|
107
121
|
};
|
|
108
122
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
1
|
+
import { reactive, root } from '@esportsplus/reactivity';
|
|
2
2
|
import { html } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
4
|
import form from '../../components/form/index.js';
|
|
@@ -52,7 +52,7 @@ const range = template.factory(function (attributes, content) {
|
|
|
52
52
|
state.value = Number(e.target.value);
|
|
53
53
|
}}
|
|
54
54
|
type='range'
|
|
55
|
-
value='${a.value || state.value || 0}'
|
|
55
|
+
value='${root(() => a.value || state.value || 0)}'
|
|
56
56
|
${a}
|
|
57
57
|
>
|
|
58
58
|
${content}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
1
|
+
import { reactive, root } from '@esportsplus/reactivity';
|
|
2
2
|
import { html, type Attributes, type Renderable } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
4
|
import form from '~/components/form';
|
|
@@ -18,9 +18,9 @@ const OMIT_TAG = ['field-mask-tag'];
|
|
|
18
18
|
|
|
19
19
|
const field = template.factory(
|
|
20
20
|
function(
|
|
21
|
-
this: { mask: typeof file | typeof text | typeof textarea },
|
|
21
|
+
this: { mask: typeof file | typeof range | typeof text | typeof textarea },
|
|
22
22
|
attributes: Attributes & { state?: { active: boolean, error: string } },
|
|
23
|
-
content: (mask: typeof file | typeof text | typeof textarea) => Renderable<unknown>
|
|
23
|
+
content: (mask: typeof file | typeof range | typeof text | typeof textarea) => Renderable<unknown>
|
|
24
24
|
) {
|
|
25
25
|
let state = attributes.state || reactive({
|
|
26
26
|
active: false,
|
|
@@ -79,7 +79,7 @@ const range = template.factory(
|
|
|
79
79
|
state.value = Number((e.target as HTMLInputElement).value);
|
|
80
80
|
}}
|
|
81
81
|
type='range'
|
|
82
|
-
value='${(a.value as number) || state.value || 0}'
|
|
82
|
+
value='${root(() => (a.value as number) || state.value || 0)}'
|
|
83
83
|
${a}
|
|
84
84
|
>
|
|
85
85
|
${content}
|