@esportsplus/ui 0.54.0 → 0.55.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/build/components/accordion/index.d.ts +713 -5
- package/build/components/accordion/index.js +16 -5
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/checkbox/constants.d.ts +2 -0
- package/build/components/checkbox/constants.js +2 -0
- package/build/components/checkbox/index.d.ts +17 -11
- package/build/components/checkbox/index.js +22 -36
- package/build/components/clipboard/copy.d.ts +1 -1
- package/build/components/clipboard/copy.js +12 -7
- package/build/components/clipboard/index.d.ts +981 -981
- package/build/components/clipboard/onclick.js +4 -6
- package/build/components/counter/index.d.ts +1 -1
- package/build/components/counter/index.js +4 -8
- package/build/components/form/action.d.ts +1 -1
- package/build/components/form/action.js +2 -5
- package/build/components/form/index.d.ts +1 -1
- package/build/components/input/index.d.ts +1 -1
- package/build/components/input/index.js +2 -3
- package/build/components/radio/index.d.ts +3 -1442
- package/build/components/radio/index.js +2 -1
- package/build/components/select/constants.d.ts +4 -0
- package/build/components/select/constants.js +4 -0
- package/build/components/select/index.d.ts +12 -6
- package/build/components/select/index.js +43 -60
- package/build/components/switch/index.d.ts +3 -1442
- package/build/components/switch/index.js +2 -1
- package/build/components/textarea/index.d.ts +490 -490
- package/build/components/textarea/index.js +5 -8
- package/build/components/tooltip/constants.d.ts +3 -0
- package/build/components/tooltip/constants.js +3 -0
- package/build/components/tooltip/index.d.ts +8 -2153
- package/build/components/tooltip/index.js +2 -1
- package/build/components/tooltip/menu.d.ts +9 -5
- package/build/components/tooltip/menu.js +14 -17
- package/build/components/tooltip/onclick.d.ts +490 -490
- package/build/components/tooltip/onclick.js +17 -23
- package/build/components/tooltip/onhover.d.ts +497 -494
- package/build/components/tooltip/onhover.js +12 -17
- package/build/themes/dark/input.d.ts +491 -491
- package/build/themes/dark/select.d.ts +3 -735
- package/build/themes/dark/select.js +5 -4
- package/build/themes/dark/textarea.d.ts +490 -490
- package/package.json +2 -2
- package/pnpm-workspace.yaml +1 -1
- package/src/components/accordion/index.ts +7 -14
- package/src/components/accordion/scss/index.scss +3 -1
- package/src/components/checkbox/constants.ts +4 -0
- package/src/components/checkbox/index.ts +12 -23
- package/src/components/clipboard/copy.ts +7 -12
- package/src/components/clipboard/onclick.ts +4 -9
- package/src/components/counter/index.ts +5 -14
- package/src/components/form/action.ts +2 -8
- package/src/components/input/index.ts +7 -5
- package/src/components/radio/index.ts +5 -2
- package/src/components/select/constants.ts +8 -0
- package/src/components/select/index.ts +49 -53
- package/src/components/switch/index.ts +5 -2
- package/src/components/textarea/index.ts +13 -14
- package/src/components/tooltip/constants.ts +6 -0
- package/src/components/tooltip/index.ts +4 -1
- package/src/components/tooltip/menu.ts +18 -29
- package/src/components/tooltip/onclick.ts +22 -33
- package/src/components/tooltip/onhover.ts +18 -29
- package/src/themes/dark/select.ts +7 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as template_u0 from '@esportsplus/template';
|
|
2
2
|
import { component } from '@esportsplus/template';
|
|
3
3
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
4
|
-
import { omit } from '@esportsplus/utilities';
|
|
5
4
|
import write from './write.js';
|
|
6
5
|
const template_uo = template_u0.template(`<div >`);
|
|
7
6
|
class ReactiveObject_0g8trzu0 extends reactivity_u0.ReactiveObject {
|
|
@@ -16,16 +15,15 @@ class ReactiveObject_0g8trzu0 extends reactivity_u0.ReactiveObject {
|
|
|
16
15
|
reactivity_u0.write(this.#copied, _v0);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let state = new ReactiveObject_0g8trzu0(), timeout = attributes.timeout || 1000 * 2;
|
|
18
|
+
export default component(function ({ timeout = 1000 * 2, value, ...attributes }, content) {
|
|
19
|
+
let state = new ReactiveObject_0g8trzu0();
|
|
22
20
|
return (() => {
|
|
23
21
|
let root_un = template_uo(), element_up = root_un.firstChild;
|
|
24
|
-
template_u0.setProperties(element_up,
|
|
22
|
+
template_u0.setProperties(element_up, attributes);
|
|
25
23
|
template_u0.delegate(element_up, 'click', (e) => {
|
|
26
24
|
e.preventDefault();
|
|
27
25
|
e.stopPropagation();
|
|
28
|
-
void write(
|
|
26
|
+
void write(value).then(() => {
|
|
29
27
|
state.copied = true;
|
|
30
28
|
setTimeout(() => {
|
|
31
29
|
state.copied = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Attributes } from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
export default _default;
|
|
4
|
-
declare function _default(attributes: Attributes & {
|
|
4
|
+
declare function _default({ currency, decimals, delay, max, state: api, suffix, value, ...attributes }: Attributes & {
|
|
5
5
|
currency?: 'IGNORE' | 'EUR' | 'GBP' | 'USD';
|
|
6
6
|
decimals?: number;
|
|
7
7
|
delay?: number;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as template_u0 from '@esportsplus/template';
|
|
2
2
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
3
3
|
import { effect, onCleanup, untrack } from '@esportsplus/reactivity';
|
|
4
|
-
import { omit } from '@esportsplus/utilities';
|
|
5
4
|
import './scss/index.scss';
|
|
6
5
|
const template_ur = template_u0.template(`<span class='counter-character counter-character--symbol'>`);
|
|
7
6
|
const template_uu = template_u0.template(`<span>`);
|
|
@@ -31,17 +30,14 @@ class ReactiveObject_00nd5up1 extends reactivity_u0.ReactiveObject {
|
|
|
31
30
|
reactivity_u0.write(this.#started, _v0);
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
const OMIT = ['currency', 'decimals', 'delay', 'max', 'state', 'suffix', 'value'];
|
|
35
33
|
let formatters = {};
|
|
36
|
-
export default (attributes) => {
|
|
37
|
-
let
|
|
34
|
+
export default ({ currency, decimals = 2, delay, max, state: api = new ReactiveObject_00nd5up0(), suffix, value, ...attributes }) => {
|
|
35
|
+
let formatter = currency === 'IGNORE'
|
|
38
36
|
? undefined
|
|
39
37
|
: formatters[currency || 'USD'] ??= new Intl.NumberFormat('en-US', {
|
|
40
38
|
style: 'currency',
|
|
41
39
|
currency: currency || 'USD'
|
|
42
|
-
}), animation = new ReactiveObject_00nd5up1(), render = new reactivity_u0.ReactiveArray()
|
|
43
|
-
decimals ??= 2;
|
|
44
|
-
let stop = effect(() => {
|
|
40
|
+
}), animation = new ReactiveObject_00nd5up1(), render = new reactivity_u0.ReactiveArray(), stop = effect(() => {
|
|
45
41
|
let target = api.value === -1 ? value : api.value, started = animation.started;
|
|
46
42
|
let padding = (max || target).toFixed(decimals).length - target.toFixed(decimals).length, values = target.toString().padStart(target.toString().length + padding, '1');
|
|
47
43
|
if (formatter) {
|
|
@@ -83,7 +79,7 @@ export default (attributes) => {
|
|
|
83
79
|
});
|
|
84
80
|
return (() => {
|
|
85
81
|
let root_u10 = template_u11(), element_u12 = root_u10.firstChild;
|
|
86
|
-
template_u0.setProperties(element_u12,
|
|
82
|
+
template_u0.setProperties(element_u12, attributes);
|
|
87
83
|
element_u12.appendChild(new template_u0.ArraySlot(render, function (character) {
|
|
88
84
|
if (!character.digit) {
|
|
89
85
|
return (() => {
|
|
@@ -4,7 +4,7 @@ type Errors = {
|
|
|
4
4
|
errors: Response<unknown>['errors'];
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
declare function _default<T extends Record<string, any>>(attributes: {
|
|
7
|
+
declare function _default<T extends Record<string, any>>({ action, state, ...attributes }: {
|
|
8
8
|
action: (data: {
|
|
9
9
|
input: T;
|
|
10
10
|
response: typeof response;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import response from '@esportsplus/action';
|
|
2
2
|
import * as template_u0 from '@esportsplus/template';
|
|
3
|
-
import { omit } from '@esportsplus/utilities';
|
|
4
3
|
import input from './input.js';
|
|
5
4
|
const template_u14 = template_u0.template(`<form class='form' >`);
|
|
6
|
-
const OMIT = ['action', 'state'];
|
|
7
5
|
function parse(input) {
|
|
8
6
|
let data = {};
|
|
9
7
|
for (let [path, value] of input) {
|
|
@@ -26,11 +24,10 @@ function parse(input) {
|
|
|
26
24
|
return data;
|
|
27
25
|
}
|
|
28
26
|
;
|
|
29
|
-
export default (attributes, content) => {
|
|
30
|
-
let { action, state } = attributes;
|
|
27
|
+
export default ({ action, state, ...attributes }, content) => {
|
|
31
28
|
return (() => {
|
|
32
29
|
let root_u13 = template_u14(), element_u15 = root_u13.firstChild;
|
|
33
|
-
template_u0.setProperties(element_u15,
|
|
30
|
+
template_u0.setProperties(element_u15, attributes);
|
|
34
31
|
template_u0.delegate(element_u15, 'click', function (event) {
|
|
35
32
|
let trigger = event.target;
|
|
36
33
|
if (trigger?.type !== 'submit') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './scss/index.scss';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
action: <T extends Record<string, any>>(attributes: {
|
|
3
|
+
action: <T extends Record<string, any>>({ action, state, ...attributes }: {
|
|
4
4
|
action: (data: {
|
|
5
5
|
input: T;
|
|
6
6
|
response: typeof import("@esportsplus/action").default;
|
|
@@ -2,7 +2,7 @@ import { type Attributes } from '@esportsplus/template';
|
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
export default function (this: {
|
|
4
4
|
attributes?: Attributes;
|
|
5
|
-
} | void, attributes: Attributes & {
|
|
5
|
+
} | void, { state, ...attributes }: Attributes & {
|
|
6
6
|
state?: {
|
|
7
7
|
active: boolean;
|
|
8
8
|
error: string;
|
|
@@ -22,8 +22,8 @@ class ReactiveObject_0j57g2t0 extends reactivity_u0.ReactiveObject {
|
|
|
22
22
|
reactivity_u0.write(this.#error, _v1);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export default function (attributes) {
|
|
26
|
-
|
|
25
|
+
export default function ({ state = new ReactiveObject_0j57g2t0(), ...attributes }) {
|
|
26
|
+
attributes.type ??= 'text';
|
|
27
27
|
return (() => {
|
|
28
28
|
let root_u1a = template_u1b(), element_u1c = root_u1a.firstChild;
|
|
29
29
|
template_u0.setProperties(element_u1c, this?.attributes);
|
|
@@ -36,7 +36,6 @@ export default function (attributes) {
|
|
|
36
36
|
state.active = false;
|
|
37
37
|
});
|
|
38
38
|
template_u0.onrender(element_u1c, form.input.onrender(state));
|
|
39
|
-
template_u0.setProperty(element_u1c, 'type', (attributes.type || 'text'));
|
|
40
39
|
return root_u1a;
|
|
41
40
|
})();
|
|
42
41
|
}
|