@esportsplus/ui 0.47.2 → 0.48.1
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.
- package/README.md +2 -3
- package/build/components/accordion/index.d.ts +16 -16
- package/build/components/accordion/index.js +13 -23
- package/build/components/alert/index.js +33 -64
- package/build/components/back/index.d.ts +8 -8
- package/build/components/back/index.js +8 -8
- package/build/components/button/index.d.ts +21 -21
- package/build/components/button/index.js +20 -36
- package/build/components/checkbox/index.js +19 -36
- package/build/components/clipboard/onclick.js +11 -21
- package/build/components/counter/index.js +28 -59
- package/build/components/ellipsis/index.js +5 -5
- package/build/components/form/action.js +8 -8
- package/build/components/highlight/index.d.ts +16 -16
- package/build/components/highlight/index.js +12 -22
- package/build/components/icon/index.d.ts +11 -11
- package/build/components/icon/index.js +6 -6
- package/build/components/input/index.js +16 -32
- package/build/components/loader/index.d.ts +16 -16
- package/build/components/loader/index.js +26 -48
- package/build/components/loading/index.js +5 -5
- package/build/components/range/index.js +19 -42
- package/build/components/scrollbar/index.d.ts +11 -11
- package/build/components/scrollbar/index.js +19 -35
- package/build/components/select/index.js +34 -63
- package/build/components/textarea/index.js +16 -32
- package/build/components/tooltip/menu.d.ts +11 -11
- package/build/components/tooltip/menu.js +20 -20
- package/build/components/tooltip/onclick.d.ts +1101 -1101
- package/build/components/tooltip/onclick.js +10 -22
- package/build/components/tooltip/onhover.d.ts +16 -16
- package/build/components/tooltip/onhover.js +11 -23
- package/build/components/typewriter/index.d.ts +11 -11
- package/build/components/typewriter/index.js +10 -22
- package/package.json +3 -4
- package/src/components/accordion/index.ts +1 -2
- package/src/components/alert/index.ts +1 -2
- package/src/components/button/index.ts +1 -2
- package/src/components/checkbox/index.ts +1 -2
- package/src/components/clipboard/onclick.ts +1 -2
- package/src/components/counter/index.ts +1 -2
- package/src/components/highlight/index.ts +1 -2
- package/src/components/input/index.ts +1 -2
- package/src/components/loader/index.ts +1 -2
- package/src/components/range/index.ts +1 -2
- package/src/components/scrollbar/index.ts +1 -2
- package/src/components/select/index.ts +1 -2
- package/src/components/textarea/index.ts +1 -2
- package/src/components/tooltip/onclick.ts +1 -2
- package/src/components/tooltip/onhover.ts +1 -2
- package/src/components/typewriter/index.ts +1 -2
|
@@ -1,82 +1,60 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
|
+
import { reactive } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
4
|
import template from '../../components/template/index.js';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
-
const
|
|
6
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc5023 = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div class='loader-content'><div
|
|
7
7
|
class='loader-logo text --flex-center --text-uppercase --text-600'
|
|
8
8
|
style='color: var(--color-grey-500);'><!--$--></div></div>`);
|
|
9
|
-
const
|
|
9
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc5028 = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
|
|
10
10
|
class='loader '><div
|
|
11
11
|
class='loader '><!--$--></div></div>`);
|
|
12
|
-
class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002b extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
|
|
13
|
-
#load = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
14
|
-
#remove = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
15
|
-
#scale = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
16
|
-
constructor() {
|
|
17
|
-
super(null);
|
|
18
|
-
}
|
|
19
|
-
get load() {
|
|
20
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#load);
|
|
21
|
-
}
|
|
22
|
-
set load(_v0) {
|
|
23
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#load, _v0);
|
|
24
|
-
}
|
|
25
|
-
get remove() {
|
|
26
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#remove);
|
|
27
|
-
}
|
|
28
|
-
set remove(_v1) {
|
|
29
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#remove, _v1);
|
|
30
|
-
}
|
|
31
|
-
get scale() {
|
|
32
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#scale);
|
|
33
|
-
}
|
|
34
|
-
set scale(_v2) {
|
|
35
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#scale, _v2);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
12
|
const OMIT = ['loader-content', 'loader-logo'];
|
|
39
13
|
export default template.factory((attributes, content) => {
|
|
40
|
-
let state =
|
|
14
|
+
let state = reactive({
|
|
15
|
+
load: false,
|
|
16
|
+
remove: false,
|
|
17
|
+
scale: false
|
|
18
|
+
});
|
|
41
19
|
return () => {
|
|
42
20
|
if (state.remove) {
|
|
43
21
|
return;
|
|
44
22
|
}
|
|
45
23
|
let i = 0;
|
|
46
24
|
return (() => {
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc5027 = template_23a4f055a2904f1fa5d72b30cc2abc5028(), element_23a4f055a2904f1fa5d72b30cc2abc5029 = root_23a4f055a2904f1fa5d72b30cc2abc5027.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502a = element_23a4f055a2904f1fa5d72b30cc2abc5029.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc502b = element_23a4f055a2904f1fa5d72b30cc2abc502a.firstChild;
|
|
26
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc5029, ' ', () => state.load && 'loader--load');
|
|
27
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc5029, 'animationend', (e) => {
|
|
50
28
|
i++;
|
|
51
29
|
if (e.animationName === 'move' && i > 1) {
|
|
52
30
|
state.remove = true;
|
|
53
31
|
}
|
|
54
32
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5029, omit(attributes, OMIT));
|
|
34
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502a, ' ', () => state.load && 'loader--load');
|
|
35
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502a, !content && {
|
|
58
36
|
onconnect: () => {
|
|
59
37
|
state.load = true;
|
|
60
38
|
}
|
|
61
39
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
40
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502a, attributes.loader);
|
|
41
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc502b, content && (() => {
|
|
42
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc5022 = template_23a4f055a2904f1fa5d72b30cc2abc5023(), element_23a4f055a2904f1fa5d72b30cc2abc5024 = root_23a4f055a2904f1fa5d72b30cc2abc5022.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc5025 = element_23a4f055a2904f1fa5d72b30cc2abc5024.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc5026 = element_23a4f055a2904f1fa5d72b30cc2abc5025.firstChild;
|
|
43
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5024, attributes['loader-content']);
|
|
44
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5025, attributes['loader-logo']);
|
|
45
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc5025, '', () => state.scale && 'loader-logo--scale');
|
|
46
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc5025, 'animationend', ({ animationName: name }) => {
|
|
69
47
|
if (name === 'scale') {
|
|
70
48
|
state.load = true;
|
|
71
49
|
}
|
|
72
50
|
});
|
|
73
|
-
|
|
51
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.onconnect(element_23a4f055a2904f1fa5d72b30cc2abc5025, () => {
|
|
74
52
|
state.scale = true;
|
|
75
53
|
});
|
|
76
|
-
|
|
77
|
-
return
|
|
54
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc5026, content);
|
|
55
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc5022;
|
|
78
56
|
})());
|
|
79
|
-
return
|
|
57
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc5027;
|
|
80
58
|
})();
|
|
81
59
|
};
|
|
82
60
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
|
-
const
|
|
3
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc502d = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
|
|
4
4
|
class='loading --border-width-700 --size-800'
|
|
5
5
|
style='--border-color: var(--color-border-500);'></div>`);
|
|
6
6
|
export default (attributes) => {
|
|
7
7
|
return (() => {
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
return
|
|
8
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc502c = template_23a4f055a2904f1fa5d72b30cc2abc502d(), element_23a4f055a2904f1fa5d72b30cc2abc502e = root_23a4f055a2904f1fa5d72b30cc2abc502c.firstChild;
|
|
9
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502e, attributes);
|
|
10
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc502c;
|
|
11
11
|
})();
|
|
12
12
|
};
|
|
@@ -1,61 +1,38 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { root } from '@esportsplus/
|
|
3
|
-
import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
|
+
import { reactive, root } from '@esportsplus/template';
|
|
4
3
|
import form from '../../components/form/index.js';
|
|
5
4
|
import './scss/index.scss';
|
|
6
|
-
const
|
|
5
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc502g = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<input
|
|
7
6
|
class='range --border-state --border-black'
|
|
8
7
|
type='range'
|
|
9
8
|
/>`);
|
|
10
|
-
class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002p extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
|
|
11
|
-
#active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
12
|
-
#error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
|
|
13
|
-
#value = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](0);
|
|
14
|
-
constructor() {
|
|
15
|
-
super(null);
|
|
16
|
-
}
|
|
17
|
-
get active() {
|
|
18
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
|
|
19
|
-
}
|
|
20
|
-
set active(_v0) {
|
|
21
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
|
|
22
|
-
}
|
|
23
|
-
get error() {
|
|
24
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
|
|
25
|
-
}
|
|
26
|
-
set error(_v1) {
|
|
27
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
|
|
28
|
-
}
|
|
29
|
-
get value() {
|
|
30
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#value);
|
|
31
|
-
}
|
|
32
|
-
set value(_v2) {
|
|
33
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#value, _v2);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
9
|
export default function (attributes) {
|
|
37
|
-
let { max, min } = attributes, state = attributes.state ||
|
|
10
|
+
let { max, min } = attributes, state = attributes.state || reactive({
|
|
11
|
+
active: false,
|
|
12
|
+
error: '',
|
|
13
|
+
value: 0
|
|
14
|
+
});
|
|
38
15
|
if (attributes?.value) {
|
|
39
16
|
state.value = Number(attributes.value);
|
|
40
17
|
}
|
|
41
18
|
return (() => {
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
19
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc502f = template_23a4f055a2904f1fa5d72b30cc2abc502g(), element_23a4f055a2904f1fa5d72b30cc2abc502h = root_23a4f055a2904f1fa5d72b30cc2abc502f.firstChild;
|
|
20
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setStyle(element_23a4f055a2904f1fa5d72b30cc2abc502h, ';', () => `--thumb-position: ${((state.value - min) / (max - min)) * 100}%`);
|
|
21
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502h, this?.attributes);
|
|
22
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502h, attributes);
|
|
23
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502h, '', () => state.active && '--active');
|
|
24
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'focusin', () => {
|
|
48
25
|
state.active = true;
|
|
49
26
|
});
|
|
50
|
-
|
|
27
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'focusout', () => {
|
|
51
28
|
state.active = false;
|
|
52
29
|
});
|
|
53
|
-
|
|
30
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'input', (e) => {
|
|
54
31
|
state.value = Number(e.target.value);
|
|
55
32
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
33
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.onrender(element_23a4f055a2904f1fa5d72b30cc2abc502h, form.input.onrender(state));
|
|
34
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'value', root(() => attributes?.value || state.value || 0));
|
|
35
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc502f;
|
|
59
36
|
})();
|
|
60
37
|
}
|
|
61
38
|
;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
2
|
import { Attributes } from '@esportsplus/template';
|
|
3
3
|
import './scss/index.scss';
|
|
4
4
|
type A = Attributes & {
|
|
@@ -8,20 +8,20 @@ type A = Attributes & {
|
|
|
8
8
|
declare const _default: {
|
|
9
9
|
(): ReturnType<(this: {
|
|
10
10
|
attributes?: A | undefined;
|
|
11
|
-
content?:
|
|
12
|
-
}, attributes: Readonly<A>, content:
|
|
11
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
12
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
|
|
13
13
|
<T extends A>(attributes: T): ReturnType<(this: {
|
|
14
14
|
attributes?: A | undefined;
|
|
15
|
-
content?:
|
|
16
|
-
}, attributes: Readonly<A>, content:
|
|
17
|
-
<T extends
|
|
15
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
16
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
|
|
17
|
+
<T extends template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>(content: T): ReturnType<(this: {
|
|
18
18
|
attributes?: A | undefined;
|
|
19
|
-
content?:
|
|
20
|
-
}, attributes: Readonly<A>, content:
|
|
21
|
-
(attributes: A, content:
|
|
19
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
20
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
|
|
21
|
+
(attributes: A, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>): ReturnType<(this: {
|
|
22
22
|
attributes?: A | undefined;
|
|
23
|
-
content?:
|
|
24
|
-
}, attributes: Readonly<A>, content:
|
|
23
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
24
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
|
|
25
25
|
};
|
|
26
26
|
export default _default;
|
|
27
27
|
export type { A as Attributes };
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
|
+
import { reactive } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
4
|
import template from '../../components/template/index.js';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
-
const
|
|
6
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc502j = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
|
|
7
7
|
class='scrollbar-container'><div
|
|
8
8
|
class='scrollbar-container-content'><!--$--></div><div
|
|
9
9
|
class='scrollbar'></div></div>`);
|
|
10
|
-
class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002t extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
|
|
11
|
-
#height = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](100);
|
|
12
|
-
#translate = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](0);
|
|
13
|
-
constructor() {
|
|
14
|
-
super(null);
|
|
15
|
-
}
|
|
16
|
-
get height() {
|
|
17
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#height);
|
|
18
|
-
}
|
|
19
|
-
set height(_v0) {
|
|
20
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#height, _v0);
|
|
21
|
-
}
|
|
22
|
-
get translate() {
|
|
23
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#translate);
|
|
24
|
-
}
|
|
25
|
-
set translate(_v1) {
|
|
26
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#translate, _v1);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
10
|
const OMIT = ['scrollbar', 'scrollbar-container-content'];
|
|
30
11
|
let root = document.body, width;
|
|
31
12
|
export default template.factory(function (attributes, content) {
|
|
32
|
-
let state =
|
|
13
|
+
let state = reactive({
|
|
14
|
+
height: 100,
|
|
15
|
+
translate: 0
|
|
16
|
+
});
|
|
33
17
|
return (() => {
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc502i = template_23a4f055a2904f1fa5d72b30cc2abc502j(), element_23a4f055a2904f1fa5d72b30cc2abc502k = root_23a4f055a2904f1fa5d72b30cc2abc502i.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502l = element_23a4f055a2904f1fa5d72b30cc2abc502k.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc502m = element_23a4f055a2904f1fa5d72b30cc2abc502l.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502n = element_23a4f055a2904f1fa5d72b30cc2abc502l.nextElementSibling;
|
|
19
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502k, this?.attributes && omit(this.attributes, OMIT));
|
|
20
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502k, omit(attributes, OMIT));
|
|
21
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502l, this?.attributes?.['scrollbar-container-content']);
|
|
22
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502l, attributes['scrollbar-container-content']);
|
|
23
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc502l, 'scroll', function () {
|
|
40
24
|
if (width === undefined) {
|
|
41
25
|
width = this.offsetWidth - this.clientWidth;
|
|
42
26
|
if (width && width !== 17) {
|
|
@@ -46,14 +30,14 @@ export default template.factory(function (attributes, content) {
|
|
|
46
30
|
state.height = (this.clientHeight / this.scrollHeight) * 100;
|
|
47
31
|
state.translate = (this.scrollTop / this.clientHeight) * 100;
|
|
48
32
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc502m, content);
|
|
34
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502n, this?.attributes?.scrollbar);
|
|
35
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502n, attributes.scrollbar);
|
|
36
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502n, '', () => state.height >= 100 && 'scrollbar--hidden');
|
|
37
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setStyle(element_23a4f055a2904f1fa5d72b30cc2abc502n, '', () => `
|
|
54
38
|
--translate: translate3d(0, ${state.translate}%, 0);
|
|
55
39
|
--height: ${state.height}%;
|
|
56
40
|
`);
|
|
57
|
-
return
|
|
41
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc502i;
|
|
58
42
|
})();
|
|
59
43
|
});
|
|
@@ -1,50 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
|
+
import { reactive } from '@esportsplus/template';
|
|
3
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';
|
|
7
7
|
import template from '../../components/template/index.js';
|
|
8
8
|
import './scss/index.scss';
|
|
9
|
-
const
|
|
9
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc502p = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
|
|
10
10
|
class='link select-option '><!--$--></div>`);
|
|
11
|
-
const
|
|
11
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc502t = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
|
|
12
12
|
class='select tooltip '><!--$--><div class='select-arrow'></div><input class='select-tag'
|
|
13
13
|
/><!--$--></div>`);
|
|
14
|
-
class ReactiveObject_a6aeaec5a75649bd8ec693d5230c500030 extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
|
|
15
|
-
#active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
16
|
-
#error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
|
|
17
|
-
#render = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
18
|
-
#selected;
|
|
19
|
-
constructor(_p0) {
|
|
20
|
-
super(null);
|
|
21
|
-
this.#selected = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](_p0);
|
|
22
|
-
}
|
|
23
|
-
get active() {
|
|
24
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
|
|
25
|
-
}
|
|
26
|
-
set active(_v0) {
|
|
27
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
|
|
28
|
-
}
|
|
29
|
-
get error() {
|
|
30
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
|
|
31
|
-
}
|
|
32
|
-
set error(_v1) {
|
|
33
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
|
|
34
|
-
}
|
|
35
|
-
get render() {
|
|
36
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#render);
|
|
37
|
-
}
|
|
38
|
-
set render(_v2) {
|
|
39
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#render, _v2);
|
|
40
|
-
}
|
|
41
|
-
get selected() {
|
|
42
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#selected);
|
|
43
|
-
}
|
|
44
|
-
set selected(_v3) {
|
|
45
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#selected, _v3);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
14
|
const OMIT = [
|
|
49
15
|
'arrow',
|
|
50
16
|
'options',
|
|
@@ -81,19 +47,24 @@ function set(current, value) {
|
|
|
81
47
|
}
|
|
82
48
|
}
|
|
83
49
|
const select = template.factory(function (attributes, content) {
|
|
84
|
-
let { options, option } = attributes, state = attributes.state ||
|
|
50
|
+
let { options, option } = attributes, state = attributes.state || reactive({
|
|
51
|
+
active: false,
|
|
52
|
+
error: '',
|
|
53
|
+
render: false,
|
|
54
|
+
selected: attributes.selected || Object.keys(options)[0]
|
|
55
|
+
});
|
|
85
56
|
return (() => {
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
57
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc502s = template_23a4f055a2904f1fa5d72b30cc2abc502t(), element_23a4f055a2904f1fa5d72b30cc2abc502u = root_23a4f055a2904f1fa5d72b30cc2abc502s.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502v = element_23a4f055a2904f1fa5d72b30cc2abc502u.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502w = element_23a4f055a2904f1fa5d72b30cc2abc502u.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc502x = element_23a4f055a2904f1fa5d72b30cc2abc502w.nextElementSibling, element_23a4f055a2904f1fa5d72b30cc2abc502y = element_23a4f055a2904f1fa5d72b30cc2abc502v.nextSibling.nextSibling.nextSibling;
|
|
58
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502u, ' ', () => state.active && '--active');
|
|
59
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502u, this?.attributes && omit(this.attributes, OMIT));
|
|
60
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502u, omit(attributes, OMIT));
|
|
61
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc502u, 'click', () => {
|
|
91
62
|
if (state.render) {
|
|
92
63
|
set(state, !state.active);
|
|
93
64
|
}
|
|
94
65
|
state.render = true;
|
|
95
66
|
});
|
|
96
|
-
new
|
|
67
|
+
new template_23a4f055a2904f1fa5d72b30cc2abc501.EffectSlot(element_23a4f055a2904f1fa5d72b30cc2abc502v, content ? (() => content(state)) : (() => {
|
|
97
68
|
let selected = options[state.selected];
|
|
98
69
|
if (!selected) {
|
|
99
70
|
return '-';
|
|
@@ -103,17 +74,17 @@ const select = template.factory(function (attributes, content) {
|
|
|
103
74
|
}
|
|
104
75
|
return selected;
|
|
105
76
|
}));
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
new
|
|
77
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502w, this?.attributes?.arrow);
|
|
78
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502w, attributes.arrow);
|
|
79
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502x, 'name', attributes.name);
|
|
80
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc502x, 'click', () => { });
|
|
81
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.onrender(element_23a4f055a2904f1fa5d72b30cc2abc502x, form.input.onrender(state));
|
|
82
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502x, 'value', () => state.selected);
|
|
83
|
+
new template_23a4f055a2904f1fa5d72b30cc2abc501.EffectSlot(element_23a4f055a2904f1fa5d72b30cc2abc502y, () => {
|
|
113
84
|
if (!state.render) {
|
|
114
85
|
return;
|
|
115
86
|
}
|
|
116
|
-
let keys = Object.keys(options), selected =
|
|
87
|
+
let keys = Object.keys(options), selected = reactive(Object.fromEntries(keys.map(key => [key, false])));
|
|
117
88
|
return sb({
|
|
118
89
|
...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
|
|
119
90
|
...attributes['tooltip-content'],
|
|
@@ -138,8 +109,8 @@ const select = template.factory(function (attributes, content) {
|
|
|
138
109
|
let previous = state.selected;
|
|
139
110
|
set(state, false);
|
|
140
111
|
state.selected = key;
|
|
141
|
-
|
|
142
|
-
|
|
112
|
+
selected[key] = true;
|
|
113
|
+
selected[previous] = false;
|
|
143
114
|
},
|
|
144
115
|
onconnect: () => {
|
|
145
116
|
set(state, true);
|
|
@@ -152,17 +123,17 @@ const select = template.factory(function (attributes, content) {
|
|
|
152
123
|
content = content.content;
|
|
153
124
|
}
|
|
154
125
|
return (() => {
|
|
155
|
-
let
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return
|
|
126
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc502o = template_23a4f055a2904f1fa5d72b30cc2abc502p(), element_23a4f055a2904f1fa5d72b30cc2abc502q = root_23a4f055a2904f1fa5d72b30cc2abc502o.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502r = element_23a4f055a2904f1fa5d72b30cc2abc502q.firstChild;
|
|
127
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502q, ' ', () => selected[key] && '--active');
|
|
128
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502q, this?.attributes?.option);
|
|
129
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502q, option);
|
|
130
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502q, 'data-key', key);
|
|
131
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc502r, content);
|
|
132
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc502o;
|
|
162
133
|
})();
|
|
163
134
|
}));
|
|
164
135
|
});
|
|
165
|
-
return
|
|
136
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc502s;
|
|
166
137
|
})();
|
|
167
138
|
});
|
|
168
139
|
export default select;
|
|
@@ -1,46 +1,30 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
|
+
import { reactive } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
4
|
import form from '../../components/form/index.js';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
-
const
|
|
6
|
+
const template_23a4f055a2904f1fa5d72b30cc2abc5030 = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<textarea
|
|
7
7
|
class='textarea'></textarea>`);
|
|
8
|
-
class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50003c extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
|
|
9
|
-
#active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
|
|
10
|
-
#error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
|
|
11
|
-
constructor() {
|
|
12
|
-
super(null);
|
|
13
|
-
}
|
|
14
|
-
get active() {
|
|
15
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
|
|
16
|
-
}
|
|
17
|
-
set active(_v0) {
|
|
18
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
|
|
19
|
-
}
|
|
20
|
-
get error() {
|
|
21
|
-
return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
|
|
22
|
-
}
|
|
23
|
-
set error(_v1) {
|
|
24
|
-
reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
8
|
const OMIT = ['state'];
|
|
28
9
|
export default function (attributes) {
|
|
29
|
-
let state = attributes.state ||
|
|
10
|
+
let state = attributes.state || reactive({
|
|
11
|
+
active: false,
|
|
12
|
+
error: ''
|
|
13
|
+
});
|
|
30
14
|
return (() => {
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
let root_23a4f055a2904f1fa5d72b30cc2abc502z = template_23a4f055a2904f1fa5d72b30cc2abc5030(), element_23a4f055a2904f1fa5d72b30cc2abc5031 = root_23a4f055a2904f1fa5d72b30cc2abc502z.firstChild;
|
|
16
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5031, this?.attributes && omit(this.attributes, OMIT));
|
|
17
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5031, omit(attributes, OMIT));
|
|
18
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc5031, '', () => state.active && '--active');
|
|
19
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc5031, 'focusin', () => {
|
|
36
20
|
state.active = true;
|
|
37
21
|
});
|
|
38
|
-
|
|
22
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc5031, 'focusout', () => {
|
|
39
23
|
state.active = false;
|
|
40
24
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return
|
|
25
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.onrender(element_23a4f055a2904f1fa5d72b30cc2abc5031, form.input.onrender(state));
|
|
26
|
+
template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc5031, 'value', attributes?.value || '');
|
|
27
|
+
return root_23a4f055a2904f1fa5d72b30cc2abc502z;
|
|
44
28
|
})();
|
|
45
29
|
}
|
|
46
30
|
;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
|
|
2
2
|
import { Attributes, Renderable } from '@esportsplus/template';
|
|
3
3
|
type A = Attributes & {
|
|
4
4
|
options: (Attributes & {
|
|
@@ -16,19 +16,19 @@ type A = Attributes & {
|
|
|
16
16
|
declare const _default: {
|
|
17
17
|
(): ReturnType<(this: {
|
|
18
18
|
attributes?: A | undefined;
|
|
19
|
-
content?:
|
|
20
|
-
}, attributes: Readonly<A>, content:
|
|
19
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
20
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
|
|
21
21
|
<T extends A>(attributes: T): ReturnType<(this: {
|
|
22
22
|
attributes?: A | undefined;
|
|
23
|
-
content?:
|
|
24
|
-
}, attributes: Readonly<A>, content:
|
|
25
|
-
<T extends
|
|
23
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
24
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
|
|
25
|
+
<T extends template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>(content: T): ReturnType<(this: {
|
|
26
26
|
attributes?: A | undefined;
|
|
27
|
-
content?:
|
|
28
|
-
}, attributes: Readonly<A>, content:
|
|
29
|
-
(attributes: A, content:
|
|
27
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
28
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
|
|
29
|
+
(attributes: A, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>): ReturnType<(this: {
|
|
30
30
|
attributes?: A | undefined;
|
|
31
|
-
content?:
|
|
32
|
-
}, attributes: Readonly<A>, content:
|
|
31
|
+
content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
|
|
32
|
+
}, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
|
|
33
33
|
};
|
|
34
34
|
export default _default;
|