@esportsplus/ui 0.51.6 → 0.53.0
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 +4 -1
- package/.github/workflows/publish.yml +4 -0
- package/README.md +2 -3
- package/build/components/accordion/index.d.ts +22 -16
- package/build/components/accordion/index.js +10 -36
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/back/index.d.ts +16 -13
- package/build/components/back/index.js +11 -11
- package/build/components/button/index.d.ts +22 -22
- package/build/components/button/index.js +25 -25
- package/build/components/checkbox/index.d.ts +1 -1
- package/build/components/checkbox/index.js +27 -23
- package/build/components/clipboard/index.d.ts +23 -20
- package/build/components/clipboard/index.js +1 -0
- package/build/components/clipboard/onclick.d.ts +1 -1
- package/build/components/clipboard/onclick.js +16 -16
- package/build/components/clipboard/write.d.ts +1 -1
- package/build/components/counter/index.d.ts +5 -5
- package/build/components/counter/index.js +34 -34
- package/build/components/ellipsis/index.d.ts +1 -1
- package/build/components/ellipsis/index.js +5 -5
- package/build/components/form/action.d.ts +3 -3
- package/build/components/form/action.js +8 -8
- package/build/components/form/index.d.ts +2 -2
- package/build/components/form/input.d.ts +8 -6
- package/build/components/form/input.js +3 -3
- package/build/components/frame/index.d.ts +16 -15
- package/build/components/frame/index.js +11 -5
- package/build/components/highlight/index.d.ts +17 -16
- package/build/components/highlight/index.js +16 -16
- package/build/components/icon/index.d.ts +11 -11
- package/build/components/icon/index.js +8 -8
- package/build/components/index.d.ts +1 -4
- package/build/components/index.js +1 -4
- package/build/components/input/index.d.ts +1 -1
- package/build/components/input/index.js +21 -21
- package/build/components/json/download.d.ts +1 -1
- package/build/components/loader/index.d.ts +17 -16
- package/build/components/loader/index.js +35 -35
- package/build/components/loader/scss/index.scss +1 -1
- package/build/components/loading/index.d.ts +1 -1
- package/build/components/loading/index.js +5 -5
- package/build/components/overlay/index.d.ts +16 -15
- package/build/components/overlay/index.js +11 -5
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/radio/index.js +1 -1
- package/build/components/range/index.d.ts +1 -1
- package/build/components/range/index.js +26 -26
- package/build/components/root/index.d.ts +1 -4
- package/build/components/root/onclick.d.ts +4 -4
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/index.d.ts +4 -7
- package/build/components/select/index.js +92 -98
- package/build/components/sidebar/index.d.ts +16 -15
- package/build/components/sidebar/index.js +11 -5
- package/build/components/sidebar/scss/index.scss +1 -1
- package/build/components/switch/index.js +1 -1
- package/build/components/textarea/index.d.ts +1 -1
- package/build/components/textarea/index.js +21 -21
- package/build/components/toast/index.d.ts +9 -0
- package/build/components/toast/index.js +157 -0
- package/build/components/toast/manager.d.ts +60 -0
- package/build/components/toast/manager.js +203 -0
- package/build/components/toast/scss/index.scss +2 -0
- package/build/components/toast/svg/check.svg +1 -0
- package/build/components/toast/svg/chevron.svg +1 -0
- package/build/components/toast/svg/close.svg +1 -0
- package/build/components/toast/svg/copy.svg +1 -0
- package/build/components/toast/svg/error.svg +1 -0
- package/build/components/toast/svg/info.svg +1 -0
- package/build/components/toast/svg/loading.svg +1 -0
- package/build/components/toast/svg/success.svg +1 -0
- package/build/components/toast/svg/warning.svg +1 -0
- package/build/components/tooltip/index.d.ts +40 -40
- package/build/components/tooltip/menu.d.ts +11 -12
- package/build/components/tooltip/menu.js +38 -24
- package/build/components/tooltip/onclick.d.ts +1151 -1151
- package/build/components/tooltip/onclick.js +17 -17
- package/build/components/tooltip/onhover.d.ts +17 -16
- package/build/components/tooltip/onhover.js +17 -17
- package/build/components/typewriter/index.d.ts +11 -11
- package/build/components/typewriter/index.js +16 -16
- package/build/css-utilities/index.scss +1 -1
- package/build/css-utilities/scroll-fade/scss/index.scss +2 -0
- package/build/css-utilities/scrollbar/scss/index.scss +2 -0
- package/build/themes/dark/back.d.ts +8 -4
- package/build/themes/dark/index.d.ts +0 -1
- package/build/themes/dark/index.js +0 -1
- package/build/themes/dark/input.d.ts +2 -2
- package/build/themes/dark/select.d.ts +60 -110
- package/build/themes/dark/textarea.d.ts +2 -2
- package/package.json +15 -15
- package/pnpm-workspace.yaml +11 -0
- package/src/components/accordion/index.ts +7 -30
- package/src/components/accordion/scss/index.scss +9 -12
- package/src/components/back/index.ts +4 -5
- package/src/components/button/index.ts +2 -3
- package/src/components/checkbox/index.ts +7 -2
- package/src/components/clipboard/index.ts +2 -1
- package/src/components/clipboard/onclick.ts +3 -4
- package/src/components/form/input.ts +4 -4
- package/src/components/frame/index.ts +9 -5
- package/src/components/highlight/index.ts +2 -3
- package/src/components/icon/index.ts +2 -3
- package/src/components/index.ts +1 -4
- package/src/components/loader/index.ts +5 -6
- package/src/components/loader/scss/index.scss +1 -1
- package/src/components/overlay/index.ts +9 -5
- package/src/components/overlay/scss/index.scss +0 -1
- package/src/components/page/scss/index.scss +1 -1
- package/src/components/root/scss/index.scss +35 -4
- package/src/components/root/scss/variables.scss +1 -2
- package/src/components/select/index.ts +71 -83
- package/src/components/sidebar/index.ts +9 -5
- package/src/components/sidebar/scss/index.scss +0 -1
- package/src/components/toast/index.ts +188 -0
- package/src/components/toast/manager.ts +312 -0
- package/src/components/toast/scss/index.scss +276 -0
- package/src/components/toast/scss/variables.scss +19 -0
- package/src/components/toast/svg/check.svg +1 -0
- package/src/components/toast/svg/chevron.svg +1 -0
- package/src/components/toast/svg/close.svg +1 -0
- package/src/components/toast/svg/copy.svg +1 -0
- package/src/components/toast/svg/error.svg +1 -0
- package/src/components/toast/svg/info.svg +1 -0
- package/src/components/toast/svg/loading.svg +1 -0
- package/src/components/toast/svg/success.svg +1 -0
- package/src/components/toast/svg/warning.svg +1 -0
- package/src/components/tooltip/menu.ts +8 -4
- package/src/components/tooltip/onclick.ts +3 -4
- package/src/components/tooltip/onhover.ts +2 -3
- package/src/components/typewriter/index.ts +2 -3
- package/src/css-utilities/index.scss +3 -2
- package/src/css-utilities/scroll-fade/scss/index.scss +47 -0
- package/src/css-utilities/scroll-fade/scss/variables.scss +3 -0
- package/src/css-utilities/scrollbar/scss/index.scss +53 -0
- package/src/css-utilities/scrollbar/scss/variables.scss +5 -0
- package/src/themes/dark/index.ts +0 -1
- package/src/tokens/scss/color.scss +14 -14
- package/src/tokens/scss/font-size.scss +12 -11
- package/src/tokens/scss/line-height.scss +7 -4
- package/src/tokens/scss/scale.scss +22 -0
- package/src/tokens/scss/size.scss +12 -9
- package/src/tokens/scss/spacer.scss +9 -9
- package/storage/svg/bolt.svg +1 -0
- package/storage/svg/star.svg +1 -0
- package/tsconfig.json +6 -2
- package/vite-env.d.ts +1 -0
- package/vite.config.ts +73 -72
- package/build/components/alert/index.d.ts +0 -19
- package/build/components/alert/index.js +0 -151
- package/build/components/alert/scss/index.scss +0 -2
- package/build/components/alert/svg/check.svg +0 -11
- package/build/components/alert/svg/close.svg +0 -12
- package/build/components/alert/svg/error.svg +0 -18
- package/build/components/scrollbar/index.d.ts +0 -27
- package/build/components/scrollbar/index.js +0 -56
- package/build/components/scrollbar/scss/index.scss +0 -2
- package/build/components/site/index.d.ts +0 -20
- package/build/components/site/index.js +0 -9
- package/build/components/site/scss/index.scss +0 -2
- package/build/components/template/index.d.ts +0 -13
- package/build/components/template/index.js +0 -21
- package/build/css-utilities/scroller/scss/index.scss +0 -2
- package/build/themes/dark/alert.d.ts +0 -11
- package/build/themes/dark/alert.js +0 -20
- package/src/components/accordion/scss/variables.scss +0 -9
- package/src/components/alert/index.ts +0 -165
- package/src/components/alert/scss/index.scss +0 -25
- package/src/components/alert/scss/variables.scss +0 -3
- package/src/components/alert/svg/check.svg +0 -11
- package/src/components/alert/svg/close.svg +0 -12
- package/src/components/alert/svg/error.svg +0 -18
- package/src/components/scrollbar/index.ts +0 -70
- package/src/components/scrollbar/scss/index.scss +0 -82
- package/src/components/scrollbar/scss/variables.scss +0 -6
- package/src/components/site/index.ts +0 -11
- package/src/components/site/scss/index.scss +0 -3
- package/src/components/template/index.ts +0 -40
- package/src/css-utilities/scroller/scss/index.scss +0 -8
- package/src/css-utilities/scroller/scss/variables.scss +0 -4
- package/src/themes/dark/alert.ts +0 -23
package/README.md
CHANGED
|
@@ -85,10 +85,9 @@ html`
|
|
|
85
85
|
### Layout
|
|
86
86
|
| Component | Description |
|
|
87
87
|
|-----------|-------------|
|
|
88
|
-
| `scrollbar` |
|
|
88
|
+
| `scrollbar` | Native scrollbar styling |
|
|
89
89
|
| `frame` | Scrollable frame |
|
|
90
90
|
| `sidebar` | Side navigation |
|
|
91
|
-
| `site` | Site wrapper |
|
|
92
91
|
| `overlay` | Modal/overlay container |
|
|
93
92
|
|
|
94
93
|
### Utility
|
|
@@ -212,7 +211,7 @@ Each component exposes CSS custom properties:
|
|
|
212
211
|
```scss
|
|
213
212
|
.ui-button {
|
|
214
213
|
--background: var(--color-blue-400);
|
|
215
|
-
--color: var(--color-white);
|
|
214
|
+
--color: var(--color-white-400);
|
|
216
215
|
--border-radius: var(--border-radius-300);
|
|
217
216
|
--padding-horizontal: 16px;
|
|
218
217
|
--padding-vertical: 8px;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { Attributes } from '@esportsplus/template';
|
|
2
3
|
import './scss/index.scss';
|
|
4
|
+
type A = Attributes & {
|
|
5
|
+
state: {
|
|
6
|
+
active: boolean | number;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
3
9
|
declare const _default: {
|
|
4
10
|
(): ReturnType<(this: {
|
|
5
|
-
attributes?:
|
|
6
|
-
content?:
|
|
7
|
-
}, attributes: Readonly<
|
|
8
|
-
<T extends
|
|
9
|
-
attributes?:
|
|
10
|
-
content?:
|
|
11
|
-
}, attributes: Readonly<
|
|
12
|
-
<T extends
|
|
13
|
-
attributes?:
|
|
14
|
-
content?:
|
|
15
|
-
}, attributes: Readonly<
|
|
16
|
-
(attributes:
|
|
17
|
-
attributes?:
|
|
18
|
-
content?:
|
|
19
|
-
}, attributes: Readonly<
|
|
11
|
+
attributes?: A | undefined;
|
|
12
|
+
content?: template_u1.Renderable<any>;
|
|
13
|
+
}, attributes: Readonly<A>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
14
|
+
<T extends A>(attributes: T): ReturnType<(this: {
|
|
15
|
+
attributes?: A | undefined;
|
|
16
|
+
content?: template_u1.Renderable<any>;
|
|
17
|
+
}, attributes: Readonly<A>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
18
|
+
<T extends template_u1.Renderable<any>>(content: T): ReturnType<(this: {
|
|
19
|
+
attributes?: A | undefined;
|
|
20
|
+
content?: template_u1.Renderable<any>;
|
|
21
|
+
}, attributes: Readonly<A>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
22
|
+
(attributes: A, content: template_u1.Renderable<any>): ReturnType<(this: {
|
|
23
|
+
attributes?: A | undefined;
|
|
24
|
+
content?: template_u1.Renderable<any>;
|
|
25
|
+
}, attributes: Readonly<A>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
20
26
|
};
|
|
21
27
|
export default _default;
|
|
@@ -1,42 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { component } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
|
-
import template from '../../components/template/index.js';
|
|
5
4
|
import './scss/index.scss';
|
|
6
|
-
const
|
|
7
|
-
class ReactiveObject_0ff113fe0a6246fbbfe92857b2a0303c2 extends reactivity_0ff113fe0a6246fbbfe92857b2a0303c0.ReactiveObject {
|
|
8
|
-
#active = this[reactivity_0ff113fe0a6246fbbfe92857b2a0303c0.SIGNAL](0);
|
|
9
|
-
constructor() {
|
|
10
|
-
super(null);
|
|
11
|
-
}
|
|
12
|
-
get active() {
|
|
13
|
-
return reactivity_0ff113fe0a6246fbbfe92857b2a0303c0.read(this.#active);
|
|
14
|
-
}
|
|
15
|
-
set active(_v0) {
|
|
16
|
-
reactivity_0ff113fe0a6246fbbfe92857b2a0303c0.write(this.#active, _v0);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
5
|
+
const template_04mlrpv1 = template_u1.template(`<div class='accordion' ><div class='accordion-content'>`);
|
|
19
6
|
const OMIT = ['state'];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let ref, state = attributes.state || new ReactiveObject_0ff113fe0a6246fbbfe92857b2a0303c2();
|
|
7
|
+
export default component(function (attributes, content) {
|
|
8
|
+
let state = attributes.state;
|
|
23
9
|
return (() => {
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
template_0ff113fe0a6246fbbfe92857b2a0303c1.onrender(element_0ff113fe0a6246fbbfe92857b2a0303c5, (element) => {
|
|
30
|
-
(ref = element)[key] = state;
|
|
31
|
-
});
|
|
32
|
-
template_0ff113fe0a6246fbbfe92857b2a0303c1.setList(element_0ff113fe0a6246fbbfe92857b2a0303c5, 'style', () => {
|
|
33
|
-
let parent = ref.closest('accordion');
|
|
34
|
-
if (parent && key in parent) {
|
|
35
|
-
parent[key].active = (+parent[key].active) + 1;
|
|
36
|
-
}
|
|
37
|
-
return state.active && `--max-height: ${ref.scrollHeight}`;
|
|
38
|
-
});
|
|
39
|
-
template_0ff113fe0a6246fbbfe92857b2a0303c1.slot(element_0ff113fe0a6246fbbfe92857b2a0303c5, content, 1);
|
|
40
|
-
return root_0ff113fe0a6246fbbfe92857b2a0303c3;
|
|
10
|
+
let root_04mlrpv0 = template_04mlrpv1(), element_04mlrpv2 = root_04mlrpv0.firstChild, element_04mlrpv3 = element_04mlrpv2.firstElementChild;
|
|
11
|
+
template_u1.setProperties(element_04mlrpv2, omit(attributes, OMIT));
|
|
12
|
+
template_u1.setProperty(element_04mlrpv2, 'inert', () => !state.active);
|
|
13
|
+
template_u1.slot(element_04mlrpv3, content, 1);
|
|
14
|
+
return root_04mlrpv0;
|
|
41
15
|
})();
|
|
42
16
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components {.accordion
|
|
1
|
+
@layer components {.accordion{grid-template-rows:1fr;transition:grid-template-rows .3s;display:grid}.accordion[inert]{grid-template-rows:0fr}.accordion-content{min-height:0;overflow:hidden}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Attributes } from '@esportsplus/template';
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
3
2
|
import './scss/index.scss';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
(): ReturnType<(this: {
|
|
6
|
-
attributes?: Attributes;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, attributes: Readonly<
|
|
5
|
+
attributes?: template_u1.Attributes | undefined;
|
|
6
|
+
content?: template_u1.Renderable<any>;
|
|
7
|
+
}, attributes: Readonly<template_u1.Attributes>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
8
|
+
<T extends template_u1.Attributes>(attributes: T): ReturnType<(this: {
|
|
9
|
+
attributes?: template_u1.Attributes | undefined;
|
|
10
|
+
content?: template_u1.Renderable<any>;
|
|
11
|
+
}, attributes: Readonly<template_u1.Attributes>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
12
|
+
<T extends template_u1.Renderable<any>>(content: T): ReturnType<(this: {
|
|
13
|
+
attributes?: template_u1.Attributes | undefined;
|
|
14
|
+
content?: template_u1.Renderable<any>;
|
|
15
|
+
}, attributes: Readonly<template_u1.Attributes>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
16
|
+
(attributes: template_u1.Attributes, content: template_u1.Renderable<any>): ReturnType<(this: {
|
|
17
|
+
attributes?: template_u1.Attributes | undefined;
|
|
18
|
+
content?: template_u1.Renderable<any>;
|
|
19
|
+
}, attributes: Readonly<template_u1.Attributes>, content: template_u1.Renderable<any>) => template_u1.Renderable<any>>;
|
|
17
20
|
};
|
|
18
21
|
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { component } from '@esportsplus/template';
|
|
3
|
+
import icon from '../icon/index.js';
|
|
4
4
|
import arrow from './svg/arrow.svg';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
-
const
|
|
7
|
-
export default
|
|
6
|
+
const template_1hhpvdm1 = template_u1.template(`<a class='back link --padding-0px --flex-vertical' ><!--$-->`);
|
|
7
|
+
export default component(function (attributes, content) {
|
|
8
8
|
return (() => {
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
9
|
+
let root_1hhpvdm0 = template_1hhpvdm1(), element_1hhpvdm2 = root_1hhpvdm0.firstChild, element_1hhpvdm3 = element_1hhpvdm2.firstChild;
|
|
10
|
+
template_u1.setProperties(element_1hhpvdm2, this?.attributes);
|
|
11
|
+
template_u1.setProperties(element_1hhpvdm2, attributes);
|
|
12
|
+
template_u1.slot(element_1hhpvdm3, icon({ class: 'back-arrow --margin-right --margin-200' }, arrow));
|
|
13
|
+
template_u1.slot(element_1hhpvdm2, content, 2);
|
|
14
|
+
return root_1hhpvdm0;
|
|
15
15
|
})();
|
|
16
16
|
});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Renderable } from '@esportsplus/template';
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { type Renderable } from '@esportsplus/template';
|
|
3
3
|
import './scss/index.scss';
|
|
4
4
|
declare const hold: {
|
|
5
5
|
(): ReturnType<(this: {
|
|
6
|
-
attributes?:
|
|
6
|
+
attributes?: template_u1.Attributes | undefined;
|
|
7
7
|
content?: ((state: {
|
|
8
8
|
holding: boolean;
|
|
9
9
|
complete: boolean;
|
|
10
10
|
}) => Renderable<any>) | undefined;
|
|
11
|
-
}, attributes: Readonly<
|
|
11
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
12
12
|
holding: boolean;
|
|
13
13
|
complete: boolean;
|
|
14
14
|
}) => Renderable<any>) => Renderable<any>>;
|
|
15
|
-
<T extends
|
|
16
|
-
attributes?:
|
|
15
|
+
<T extends template_u1.Attributes>(attributes: T): ReturnType<(this: {
|
|
16
|
+
attributes?: template_u1.Attributes | undefined;
|
|
17
17
|
content?: ((state: {
|
|
18
18
|
holding: boolean;
|
|
19
19
|
complete: boolean;
|
|
20
20
|
}) => Renderable<any>) | undefined;
|
|
21
|
-
}, attributes: Readonly<
|
|
21
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
22
22
|
holding: boolean;
|
|
23
23
|
complete: boolean;
|
|
24
24
|
}) => Renderable<any>) => Renderable<any>>;
|
|
@@ -26,25 +26,25 @@ declare const hold: {
|
|
|
26
26
|
holding: boolean;
|
|
27
27
|
complete: boolean;
|
|
28
28
|
}) => Renderable<any>>(content: T): ReturnType<(this: {
|
|
29
|
-
attributes?:
|
|
29
|
+
attributes?: template_u1.Attributes | undefined;
|
|
30
30
|
content?: ((state: {
|
|
31
31
|
holding: boolean;
|
|
32
32
|
complete: boolean;
|
|
33
33
|
}) => Renderable<any>) | undefined;
|
|
34
|
-
}, attributes: Readonly<
|
|
34
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
35
35
|
holding: boolean;
|
|
36
36
|
complete: boolean;
|
|
37
37
|
}) => Renderable<any>) => Renderable<any>>;
|
|
38
|
-
(attributes:
|
|
38
|
+
(attributes: template_u1.Attributes, content: (state: {
|
|
39
39
|
holding: boolean;
|
|
40
40
|
complete: boolean;
|
|
41
41
|
}) => Renderable<any>): ReturnType<(this: {
|
|
42
|
-
attributes?:
|
|
42
|
+
attributes?: template_u1.Attributes | undefined;
|
|
43
43
|
content?: ((state: {
|
|
44
44
|
holding: boolean;
|
|
45
45
|
complete: boolean;
|
|
46
46
|
}) => Renderable<any>) | undefined;
|
|
47
|
-
}, attributes: Readonly<
|
|
47
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
48
48
|
holding: boolean;
|
|
49
49
|
complete: boolean;
|
|
50
50
|
}) => Renderable<any>) => Renderable<any>>;
|
|
@@ -52,22 +52,22 @@ declare const hold: {
|
|
|
52
52
|
declare const _default: {
|
|
53
53
|
hold: {
|
|
54
54
|
(): ReturnType<(this: {
|
|
55
|
-
attributes?:
|
|
55
|
+
attributes?: template_u1.Attributes | undefined;
|
|
56
56
|
content?: ((state: {
|
|
57
57
|
holding: boolean;
|
|
58
58
|
complete: boolean;
|
|
59
59
|
}) => Renderable<any>) | undefined;
|
|
60
|
-
}, attributes: Readonly<
|
|
60
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
61
61
|
holding: boolean;
|
|
62
62
|
complete: boolean;
|
|
63
63
|
}) => Renderable<any>) => Renderable<any>>;
|
|
64
|
-
<T extends
|
|
65
|
-
attributes?:
|
|
64
|
+
<T extends template_u1.Attributes>(attributes: T): ReturnType<(this: {
|
|
65
|
+
attributes?: template_u1.Attributes | undefined;
|
|
66
66
|
content?: ((state: {
|
|
67
67
|
holding: boolean;
|
|
68
68
|
complete: boolean;
|
|
69
69
|
}) => Renderable<any>) | undefined;
|
|
70
|
-
}, attributes: Readonly<
|
|
70
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
71
71
|
holding: boolean;
|
|
72
72
|
complete: boolean;
|
|
73
73
|
}) => Renderable<any>) => Renderable<any>>;
|
|
@@ -75,25 +75,25 @@ declare const _default: {
|
|
|
75
75
|
holding: boolean;
|
|
76
76
|
complete: boolean;
|
|
77
77
|
}) => Renderable<any>>(content: T): ReturnType<(this: {
|
|
78
|
-
attributes?:
|
|
78
|
+
attributes?: template_u1.Attributes | undefined;
|
|
79
79
|
content?: ((state: {
|
|
80
80
|
holding: boolean;
|
|
81
81
|
complete: boolean;
|
|
82
82
|
}) => Renderable<any>) | undefined;
|
|
83
|
-
}, attributes: Readonly<
|
|
83
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
84
84
|
holding: boolean;
|
|
85
85
|
complete: boolean;
|
|
86
86
|
}) => Renderable<any>) => Renderable<any>>;
|
|
87
|
-
(attributes:
|
|
87
|
+
(attributes: template_u1.Attributes, content: (state: {
|
|
88
88
|
holding: boolean;
|
|
89
89
|
complete: boolean;
|
|
90
90
|
}) => Renderable<any>): ReturnType<(this: {
|
|
91
|
-
attributes?:
|
|
91
|
+
attributes?: template_u1.Attributes | undefined;
|
|
92
92
|
content?: ((state: {
|
|
93
93
|
holding: boolean;
|
|
94
94
|
complete: boolean;
|
|
95
95
|
}) => Renderable<any>) | undefined;
|
|
96
|
-
}, attributes: Readonly<
|
|
96
|
+
}, attributes: Readonly<template_u1.Attributes>, content: (state: {
|
|
97
97
|
holding: boolean;
|
|
98
98
|
complete: boolean;
|
|
99
99
|
}) => Renderable<any>) => Renderable<any>>;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { component } from '@esportsplus/template';
|
|
3
|
+
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
4
4
|
import './scss/index.scss';
|
|
5
|
-
const
|
|
6
|
-
class
|
|
7
|
-
#complete = this[
|
|
8
|
-
#holding = this[
|
|
5
|
+
const template_1u9ndnf2 = template_u1.template(`<div class='button ' >`);
|
|
6
|
+
class ReactiveObject_1u9ndnf0 extends reactivity_u0.ReactiveObject {
|
|
7
|
+
#complete = this[reactivity_u0.SIGNAL](false);
|
|
8
|
+
#holding = this[reactivity_u0.SIGNAL](false);
|
|
9
9
|
constructor() {
|
|
10
10
|
super(null);
|
|
11
11
|
}
|
|
12
12
|
get complete() {
|
|
13
|
-
return
|
|
13
|
+
return reactivity_u0.read(this.#complete);
|
|
14
14
|
}
|
|
15
15
|
set complete(_v0) {
|
|
16
|
-
|
|
16
|
+
reactivity_u0.write(this.#complete, _v0);
|
|
17
17
|
}
|
|
18
18
|
get holding() {
|
|
19
|
-
return
|
|
19
|
+
return reactivity_u0.read(this.#holding);
|
|
20
20
|
}
|
|
21
21
|
set holding(_v1) {
|
|
22
|
-
|
|
22
|
+
reactivity_u0.write(this.#holding, _v1);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
const hold =
|
|
25
|
+
const hold = component(function (attributes, content) {
|
|
26
26
|
let end = () => {
|
|
27
27
|
if (!state.complete) {
|
|
28
28
|
state.holding = false;
|
|
29
29
|
}
|
|
30
|
-
}, state = new
|
|
30
|
+
}, state = new ReactiveObject_1u9ndnf0();
|
|
31
31
|
return (() => {
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let root_1u9ndnf1 = template_1u9ndnf2(), element_1u9ndnf3 = root_1u9ndnf1.firstChild;
|
|
33
|
+
template_u1.setList(element_1u9ndnf3, 'class', () => state.holding && 'button--holding');
|
|
34
|
+
template_u1.delegate(element_1u9ndnf3, 'mousedown', (e) => {
|
|
35
35
|
e.preventDefault();
|
|
36
36
|
state.holding = true;
|
|
37
37
|
});
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
template_u1.setProperties(element_1u9ndnf3, attributes);
|
|
39
|
+
template_u1.delegate(element_1u9ndnf3, 'animationend', (e) => {
|
|
40
40
|
if (e.animationName === 'buttonHolding') {
|
|
41
41
|
state.complete = true;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
template_u1.delegate(element_1u9ndnf3, 'click', () => { });
|
|
45
|
+
template_u1.delegate(element_1u9ndnf3, 'mousedown', (e) => {
|
|
46
46
|
e.preventDefault();
|
|
47
47
|
state.holding = true;
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
template_u1.delegate(element_1u9ndnf3, 'mouseup', end);
|
|
50
|
+
template_u1.delegate(element_1u9ndnf3, 'touchend', end);
|
|
51
|
+
template_u1.delegate(element_1u9ndnf3, 'touchstart', (e) => {
|
|
52
52
|
e.preventDefault();
|
|
53
53
|
state.holding = true;
|
|
54
54
|
});
|
|
55
|
-
new
|
|
56
|
-
return
|
|
55
|
+
new template_u1.EffectSlot(element_1u9ndnf3, () => content(state), 1);
|
|
56
|
+
return root_1u9ndnf1;
|
|
57
57
|
})();
|
|
58
58
|
});
|
|
59
59
|
export default { hold };
|
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
3
3
|
import { root } from '@esportsplus/reactivity';
|
|
4
4
|
import { omit } from '@esportsplus/utilities';
|
|
5
|
-
import form from '
|
|
5
|
+
import form from '../form/index.js';
|
|
6
6
|
import './scss/index.scss';
|
|
7
|
-
const
|
|
8
|
-
class
|
|
9
|
-
#active = this[
|
|
10
|
-
#error = this[
|
|
7
|
+
const template_0l38kpg2 = template_u1.template(`<div><input >`);
|
|
8
|
+
class ReactiveObject_0l38kpg0 extends reactivity_u0.ReactiveObject {
|
|
9
|
+
#active = this[reactivity_u0.SIGNAL](false);
|
|
10
|
+
#error = this[reactivity_u0.SIGNAL]('');
|
|
11
11
|
constructor() {
|
|
12
12
|
super(null);
|
|
13
13
|
}
|
|
14
14
|
get active() {
|
|
15
|
-
return
|
|
15
|
+
return reactivity_u0.read(this.#active);
|
|
16
16
|
}
|
|
17
17
|
set active(_v0) {
|
|
18
|
-
|
|
18
|
+
reactivity_u0.write(this.#active, _v0);
|
|
19
19
|
}
|
|
20
20
|
get error() {
|
|
21
|
-
return
|
|
21
|
+
return reactivity_u0.read(this.#error);
|
|
22
22
|
}
|
|
23
23
|
set error(_v1) {
|
|
24
|
-
|
|
24
|
+
reactivity_u0.write(this.#error, _v1);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const OMIT = ['checked', 'value'];
|
|
28
28
|
const factory = (type) => {
|
|
29
29
|
function template(attributes) {
|
|
30
|
-
let state = attributes?.state || new
|
|
30
|
+
let ref, state = attributes?.state || new ReactiveObject_0l38kpg0();
|
|
31
31
|
if (attributes?.checked) {
|
|
32
32
|
state.active = true;
|
|
33
33
|
}
|
|
34
34
|
return (() => {
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
let root_0l38kpg1 = template_0l38kpg2(), element_0l38kpg3 = root_0l38kpg1.firstChild, element_0l38kpg4 = element_0l38kpg3.firstElementChild;
|
|
36
|
+
template_u1.setList(element_0l38kpg3, 'class', () => state.active ? type + " --active" : type);
|
|
37
|
+
template_u1.setProperties(element_0l38kpg3, this?.attributes && omit(this.attributes, OMIT));
|
|
38
|
+
template_u1.setProperties(element_0l38kpg3, attributes && omit(attributes, OMIT));
|
|
39
|
+
template_u1.delegate(element_0l38kpg3, 'click', () => ref.click());
|
|
40
|
+
template_u1.setProperty(element_0l38kpg4, 'checked', attributes?.checked || root(() => state.active));
|
|
41
|
+
template_u1.setList(element_0l38kpg4, 'class', `${type}-tag`);
|
|
42
|
+
template_u1.delegate(element_0l38kpg4, 'change', (e) => {
|
|
42
43
|
state.active = e.target.checked;
|
|
43
44
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
template_u1.onconnect(element_0l38kpg4, (input) => {
|
|
46
|
+
ref = input;
|
|
47
|
+
});
|
|
48
|
+
template_u1.onrender(element_0l38kpg4, form.input.onrender(state));
|
|
49
|
+
template_u1.setProperty(element_0l38kpg4, 'type', type === 'radio' ? 'radio' : 'checkbox');
|
|
50
|
+
template_u1.setProperty(element_0l38kpg4, 'value', attributes?.value || 1);
|
|
51
|
+
return root_0l38kpg1;
|
|
48
52
|
})();
|
|
49
53
|
}
|
|
50
54
|
return template;
|