@esportsplus/ui 0.46.0 → 0.47.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.
- package/.github/workflows/bump.yml +2 -2
- package/.github/workflows/dependabot.yml +1 -1
- package/.github/workflows/publish.yml +3 -3
- package/README.md +288 -0
- package/build/components/accordion/index.d.ts +16 -16
- package/build/components/accordion/index.js +28 -20
- package/build/components/alert/index.d.ts +1 -1
- package/build/components/alert/index.js +82 -57
- package/build/components/back/index.d.ts +8 -7
- package/build/components/back/index.js +11 -11
- package/build/components/button/index.d.ts +21 -20
- package/build/components/button/index.js +52 -27
- package/build/components/checkbox/index.d.ts +3 -3
- package/build/components/checkbox/index.js +39 -25
- package/build/components/clipboard/index.d.ts +90 -70
- package/build/components/clipboard/onclick.d.ts +1 -1
- package/build/components/clipboard/onclick.js +31 -21
- package/build/components/counter/index.d.ts +2 -2
- package/build/components/counter/index.js +72 -36
- package/build/components/ellipsis/index.d.ts +1 -1
- package/build/components/ellipsis/index.js +7 -8
- package/build/components/form/action.d.ts +1 -1
- package/build/components/form/action.js +13 -15
- package/build/components/form/index.d.ts +1 -1
- package/build/components/highlight/index.d.ts +16 -16
- package/build/components/highlight/index.js +26 -18
- package/build/components/icon/index.d.ts +11 -10
- package/build/components/icon/index.js +9 -6
- package/build/components/input/index.d.ts +2 -2
- package/build/components/input/index.js +38 -22
- package/build/components/loader/index.d.ts +16 -16
- package/build/components/loader/index.js +68 -50
- package/build/components/loading/index.d.ts +1 -1
- package/build/components/loading/index.js +9 -9
- package/build/components/radio/index.d.ts +1 -1
- package/build/components/range/index.d.ts +2 -2
- package/build/components/range/index.js +50 -27
- package/build/components/scrollbar/index.d.ts +12 -11
- package/build/components/scrollbar/index.js +42 -37
- package/build/components/select/index.d.ts +1 -1
- package/build/components/select/index.js +121 -86
- package/build/components/switch/index.d.ts +1 -1
- package/build/components/textarea/index.d.ts +2 -2
- package/build/components/textarea/index.js +37 -22
- package/build/components/tooltip/index.d.ts +180 -140
- package/build/components/tooltip/menu.d.ts +12 -11
- package/build/components/tooltip/menu.js +33 -33
- package/build/components/tooltip/onclick.d.ts +1121 -1100
- package/build/components/tooltip/onclick.js +26 -16
- package/build/components/tooltip/onhover.d.ts +16 -16
- package/build/components/tooltip/onhover.js +28 -18
- package/build/components/typewriter/index.d.ts +11 -10
- package/build/components/typewriter/index.js +25 -12
- package/build/themes/dark/alert.d.ts +1 -1
- package/build/themes/dark/input.d.ts +10 -8
- package/build/themes/dark/select.d.ts +90 -70
- package/build/themes/dark/textarea.d.ts +10 -8
- package/package.json +18 -14
- package/src/components/button/index.ts +21 -13
- package/src/components/counter/index.ts +6 -6
- package/src/components/select/index.ts +13 -1
- package/tsconfig.json +6 -1
|
@@ -1,64 +1,82 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
|
|
2
|
+
import * as template_a6aeaec5a75649bd8ec693d5230c50001 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 template_a6aeaec5a75649bd8ec693d5230c50002d = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div class='loader-content'><div
|
|
7
|
+
class='loader-logo text --flex-center --text-uppercase --text-600'
|
|
8
|
+
style='color: var(--color-grey-500);'><!--$--></div></div>`);
|
|
9
|
+
const template_a6aeaec5a75649bd8ec693d5230c50002i = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
|
|
10
|
+
class='loader '><div
|
|
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
|
+
}
|
|
6
38
|
const OMIT = ['loader-content', 'loader-logo'];
|
|
7
39
|
export default template.factory((attributes, content) => {
|
|
8
|
-
let state =
|
|
9
|
-
load: false,
|
|
10
|
-
remove: false,
|
|
11
|
-
scale: false
|
|
12
|
-
});
|
|
40
|
+
let state = new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002b();
|
|
13
41
|
return () => {
|
|
14
42
|
if (state.remove) {
|
|
15
43
|
return;
|
|
16
44
|
}
|
|
17
45
|
let i = 0;
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
${!content && {
|
|
32
|
-
onconnect: () => {
|
|
33
|
-
state.load = true;
|
|
34
|
-
}
|
|
35
|
-
}}
|
|
36
|
-
${attributes.loader}
|
|
37
|
-
>
|
|
38
|
-
${content && html `
|
|
39
|
-
<div class='loader-content' ${attributes['loader-content']}>
|
|
40
|
-
<div
|
|
41
|
-
class='loader-logo text --flex-center --text-uppercase --text-600'
|
|
42
|
-
style='color: var(--color-grey-500);'
|
|
43
|
-
${attributes['loader-logo']}
|
|
44
|
-
${{
|
|
45
|
-
class: () => state.scale && 'loader-logo--scale',
|
|
46
|
-
onanimationend: ({ animationName: name }) => {
|
|
47
|
-
if (name === 'scale') {
|
|
46
|
+
return (() => {
|
|
47
|
+
let root_a6aeaec5a75649bd8ec693d5230c50002h = template_a6aeaec5a75649bd8ec693d5230c50002i(), element_a6aeaec5a75649bd8ec693d5230c50002j = root_a6aeaec5a75649bd8ec693d5230c50002h.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002k = element_a6aeaec5a75649bd8ec693d5230c50002j.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50002l = element_a6aeaec5a75649bd8ec693d5230c50002k.firstChild;
|
|
48
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002j, ' ', () => state.load && 'loader--load');
|
|
49
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50002j, 'animationend', (e) => {
|
|
50
|
+
i++;
|
|
51
|
+
if (e.animationName === 'move' && i > 1) {
|
|
52
|
+
state.remove = true;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002j, omit(attributes, OMIT));
|
|
56
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002k, ' ', () => state.load && 'loader--load');
|
|
57
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002k, !content && {
|
|
58
|
+
onconnect: () => {
|
|
48
59
|
state.load = true;
|
|
49
60
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
});
|
|
62
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002k, attributes.loader);
|
|
63
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c50002l, content && (() => {
|
|
64
|
+
let root_a6aeaec5a75649bd8ec693d5230c50002c = template_a6aeaec5a75649bd8ec693d5230c50002d(), element_a6aeaec5a75649bd8ec693d5230c50002e = root_a6aeaec5a75649bd8ec693d5230c50002c.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002f = element_a6aeaec5a75649bd8ec693d5230c50002e.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50002g = element_a6aeaec5a75649bd8ec693d5230c50002f.firstChild;
|
|
65
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002e, attributes['loader-content']);
|
|
66
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002f, attributes['loader-logo']);
|
|
67
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002f, '', () => state.scale && 'loader-logo--scale');
|
|
68
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50002f, 'animationend', ({ animationName: name }) => {
|
|
69
|
+
if (name === 'scale') {
|
|
70
|
+
state.load = true;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.onconnect(element_a6aeaec5a75649bd8ec693d5230c50002f, () => {
|
|
74
|
+
state.scale = true;
|
|
75
|
+
});
|
|
76
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c50002g, content);
|
|
77
|
+
return root_a6aeaec5a75649bd8ec693d5230c50002c;
|
|
78
|
+
})());
|
|
79
|
+
return root_a6aeaec5a75649bd8ec693d5230c50002h;
|
|
80
|
+
})();
|
|
63
81
|
};
|
|
64
82
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
|
+
const template_a6aeaec5a75649bd8ec693d5230c50002n = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
|
|
4
|
+
class='loading --border-width-700 --size-800'
|
|
5
|
+
style='--border-color: var(--color-border-500);'></div>`);
|
|
3
6
|
export default (attributes) => {
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
</div>
|
|
11
|
-
`;
|
|
7
|
+
return (() => {
|
|
8
|
+
let root_a6aeaec5a75649bd8ec693d5230c50002m = template_a6aeaec5a75649bd8ec693d5230c50002n(), element_a6aeaec5a75649bd8ec693d5230c50002o = root_a6aeaec5a75649bd8ec693d5230c50002m.firstChild;
|
|
9
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002o, attributes);
|
|
10
|
+
return root_a6aeaec5a75649bd8ec693d5230c50002m;
|
|
11
|
+
})();
|
|
12
12
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Attributes } from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
export default function (this: {
|
|
4
4
|
attributes?: Attributes;
|
|
@@ -10,4 +10,4 @@ export default function (this: {
|
|
|
10
10
|
error: string;
|
|
11
11
|
value: number;
|
|
12
12
|
};
|
|
13
|
-
}):
|
|
13
|
+
}): DocumentFragment;
|
|
@@ -1,38 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
|
|
2
|
+
import { root } from '@esportsplus/reactivity';
|
|
3
|
+
import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
|
|
3
4
|
import form from '../../components/form/index.js';
|
|
4
5
|
import './scss/index.scss';
|
|
6
|
+
const template_a6aeaec5a75649bd8ec693d5230c50002r = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<input
|
|
7
|
+
class='range --border-state --border-black'
|
|
8
|
+
type='range'
|
|
9
|
+
/>`);
|
|
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
|
+
}
|
|
5
36
|
export default function (attributes) {
|
|
6
|
-
let { max, min } = attributes, state = attributes.state ||
|
|
7
|
-
active: false,
|
|
8
|
-
error: '',
|
|
9
|
-
value: 0
|
|
10
|
-
});
|
|
37
|
+
let { max, min } = attributes, state = attributes.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002p();
|
|
11
38
|
if (attributes?.value) {
|
|
12
39
|
state.value = Number(attributes.value);
|
|
13
40
|
}
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
${{
|
|
22
|
-
class: () => state.active && '--active',
|
|
23
|
-
onfocusin: () => {
|
|
41
|
+
return (() => {
|
|
42
|
+
let root_a6aeaec5a75649bd8ec693d5230c50002q = template_a6aeaec5a75649bd8ec693d5230c50002r(), element_a6aeaec5a75649bd8ec693d5230c50002s = root_a6aeaec5a75649bd8ec693d5230c50002q.firstChild;
|
|
43
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setStyle(element_a6aeaec5a75649bd8ec693d5230c50002s, ';', () => `--thumb-position: ${((state.value - min) / (max - min)) * 100}%`);
|
|
44
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002s, this?.attributes);
|
|
45
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002s, attributes);
|
|
46
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002s, '', () => state.active && '--active');
|
|
47
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50002s, 'focusin', () => {
|
|
24
48
|
state.active = true;
|
|
25
|
-
}
|
|
26
|
-
|
|
49
|
+
});
|
|
50
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50002s, 'focusout', () => {
|
|
27
51
|
state.active = false;
|
|
28
|
-
}
|
|
29
|
-
|
|
52
|
+
});
|
|
53
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50002s, 'input', (e) => {
|
|
30
54
|
state.value = Number(e.target.value);
|
|
31
|
-
}
|
|
32
|
-
onrender
|
|
33
|
-
value
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`;
|
|
55
|
+
});
|
|
56
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c50002s, form.input.onrender(state));
|
|
57
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50002s, 'value', root(() => attributes?.value || state.value || 0));
|
|
58
|
+
return root_a6aeaec5a75649bd8ec693d5230c50002q;
|
|
59
|
+
})();
|
|
37
60
|
}
|
|
38
61
|
;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
|
|
2
|
+
import { Attributes } from '@esportsplus/template';
|
|
2
3
|
import './scss/index.scss';
|
|
3
4
|
type A = Attributes & {
|
|
4
5
|
scrollbar?: Attributes;
|
|
@@ -7,20 +8,20 @@ type A = Attributes & {
|
|
|
7
8
|
declare const _default: {
|
|
8
9
|
(): ReturnType<(this: {
|
|
9
10
|
attributes?: A | undefined;
|
|
10
|
-
content?:
|
|
11
|
-
}, attributes: Readonly<A>, content:
|
|
11
|
+
content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
|
|
12
|
+
}, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
|
|
12
13
|
<T extends A>(attributes: T): ReturnType<(this: {
|
|
13
14
|
attributes?: A | undefined;
|
|
14
|
-
content?:
|
|
15
|
-
}, attributes: Readonly<A>, content:
|
|
16
|
-
<T extends
|
|
15
|
+
content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
|
|
16
|
+
}, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
|
|
17
|
+
<T extends template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>(content: T): ReturnType<(this: {
|
|
17
18
|
attributes?: A | undefined;
|
|
18
|
-
content?:
|
|
19
|
-
}, attributes: Readonly<A>, content:
|
|
20
|
-
(attributes: A, content:
|
|
19
|
+
content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
|
|
20
|
+
}, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
|
|
21
|
+
(attributes: A, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>): ReturnType<(this: {
|
|
21
22
|
attributes?: A | undefined;
|
|
22
|
-
content?:
|
|
23
|
-
}, attributes: Readonly<A>, content:
|
|
23
|
+
content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
|
|
24
|
+
}, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
|
|
24
25
|
};
|
|
25
26
|
export default _default;
|
|
26
27
|
export type { A as Attributes };
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
|
|
2
|
+
import * as template_a6aeaec5a75649bd8ec693d5230c50001 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 template_a6aeaec5a75649bd8ec693d5230c50002v = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
|
|
7
|
+
class='scrollbar-container'><div
|
|
8
|
+
class='scrollbar-container-content'><!--$--></div><div
|
|
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
|
+
}
|
|
6
29
|
const OMIT = ['scrollbar', 'scrollbar-container-content'];
|
|
7
30
|
let root = document.body, width;
|
|
8
31
|
export default template.factory(function (attributes, content) {
|
|
9
|
-
let state =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
${omit(attributes, OMIT)}
|
|
18
|
-
>
|
|
19
|
-
<div
|
|
20
|
-
class='scrollbar-container-content'
|
|
21
|
-
${this?.attributes?.['scrollbar-container-content']}
|
|
22
|
-
${attributes['scrollbar-container-content']}
|
|
23
|
-
${{
|
|
24
|
-
onscroll: function () {
|
|
32
|
+
let state = new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002t();
|
|
33
|
+
return (() => {
|
|
34
|
+
let root_a6aeaec5a75649bd8ec693d5230c50002u = template_a6aeaec5a75649bd8ec693d5230c50002v(), element_a6aeaec5a75649bd8ec693d5230c50002w = root_a6aeaec5a75649bd8ec693d5230c50002u.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002x = element_a6aeaec5a75649bd8ec693d5230c50002w.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50002y = element_a6aeaec5a75649bd8ec693d5230c50002x.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002z = element_a6aeaec5a75649bd8ec693d5230c50002x.nextElementSibling;
|
|
35
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002w, this?.attributes && omit(this.attributes, OMIT));
|
|
36
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002w, omit(attributes, OMIT));
|
|
37
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002x, this?.attributes?.['scrollbar-container-content']);
|
|
38
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002x, attributes['scrollbar-container-content']);
|
|
39
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50002x, 'scroll', function () {
|
|
25
40
|
if (width === undefined) {
|
|
26
41
|
width = this.offsetWidth - this.clientWidth;
|
|
27
42
|
if (width && width !== 17) {
|
|
@@ -30,25 +45,15 @@ export default template.factory(function (attributes, content) {
|
|
|
30
45
|
}
|
|
31
46
|
state.height = (this.clientHeight / this.scrollHeight) * 100;
|
|
32
47
|
state.translate = (this.scrollTop / this.clientHeight) * 100;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div
|
|
40
|
-
class='scrollbar'
|
|
41
|
-
${this?.attributes?.scrollbar}
|
|
42
|
-
${attributes.scrollbar}
|
|
43
|
-
${{
|
|
44
|
-
class: () => state.height >= 100 && 'scrollbar--hidden',
|
|
45
|
-
style: () => `
|
|
48
|
+
});
|
|
49
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c50002y, content);
|
|
50
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002z, this?.attributes?.scrollbar);
|
|
51
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002z, attributes.scrollbar);
|
|
52
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002z, '', () => state.height >= 100 && 'scrollbar--hidden');
|
|
53
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setStyle(element_a6aeaec5a75649bd8ec693d5230c50002z, '', () => `
|
|
46
54
|
--translate: translate3d(0, ${state.translate}%, 0);
|
|
47
55
|
--height: ${state.height}%;
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
`;
|
|
56
|
+
`);
|
|
57
|
+
return root_a6aeaec5a75649bd8ec693d5230c50002u;
|
|
58
|
+
})();
|
|
54
59
|
});
|