@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,17 +1,21 @@
|
|
|
1
1
|
import * as template_u0 from '@esportsplus/template';
|
|
2
2
|
import { type Attributes, type Renderable } from '@esportsplus/template';
|
|
3
|
+
import { MENU_OPTION, MENU_TOOLTIP_CONTENT } from './constants.js';
|
|
3
4
|
type A = Attributes & {
|
|
5
|
+
[MENU_OPTION]?: Attributes;
|
|
6
|
+
[MENU_TOOLTIP_CONTENT]?: Attributes & {
|
|
7
|
+
direction?: string;
|
|
8
|
+
};
|
|
4
9
|
options: (Attributes & {
|
|
5
10
|
content: Renderable<unknown>;
|
|
6
11
|
})[];
|
|
7
|
-
option?: Attributes;
|
|
8
12
|
state?: {
|
|
9
13
|
active: boolean;
|
|
10
14
|
};
|
|
11
15
|
toggle?: boolean;
|
|
12
|
-
'tooltip-content': Attributes & {
|
|
13
|
-
direction?: string;
|
|
14
|
-
};
|
|
15
16
|
};
|
|
16
|
-
declare const _default: template_u0.Factory<A, Renderable<any>, Renderable<any
|
|
17
|
+
declare const _default: template_u0.Factory<A, Renderable<any>, Renderable<any>> & {
|
|
18
|
+
readonly option: typeof MENU_OPTION;
|
|
19
|
+
readonly tooltipContent: typeof MENU_TOOLTIP_CONTENT;
|
|
20
|
+
};
|
|
17
21
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
4
|
+
import { MENU_OPTION, MENU_TOOLTIP_CONTENT } from './constants.js';
|
|
5
5
|
import onclick from './onclick.js';
|
|
6
6
|
const template_u2p = template_u0.template(`<a class='link --width-full' target='_blank' >`);
|
|
7
7
|
const template_u2s = template_u0.template(`<div class='link --width-full' >`);
|
|
@@ -18,35 +18,32 @@ class ReactiveObject_0p4v5170 extends reactivity_u0.ReactiveObject {
|
|
|
18
18
|
reactivity_u0.write(this.#active, _v0);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export default component((attributes, content) => {
|
|
25
|
-
let options = attributes.options, option = attributes.option, state = attributes.state || new ReactiveObject_0p4v5170(), tooltipContent = attributes?.['tooltip-content'], tooltipContentDirection = tooltipContent?.direction || 'nw';
|
|
26
|
-
return onclick({ ...omit(attributes, OMIT), state }, (() => {
|
|
21
|
+
export default Object.assign(component(({ options, state = new ReactiveObject_0p4v5170(), ...attributes }, content) => {
|
|
22
|
+
let { direction = 'nw', ...tooltipContent } = attributes[MENU_TOOLTIP_CONTENT] ?? {};
|
|
23
|
+
return onclick({ ...attributes, state }, (() => {
|
|
27
24
|
let root_u2u = template_u2v(), element_u2w = root_u2u.firstChild, element_u2x = element_u2w.nextSibling;
|
|
28
25
|
template_u0.slot(element_u2w, content);
|
|
29
|
-
template_u0.setList(element_u2x, 'class', `tooltip-content--${
|
|
30
|
-
template_u0.setProperties(element_u2x, tooltipContent
|
|
26
|
+
template_u0.setList(element_u2x, 'class', `tooltip-content--${direction}`);
|
|
27
|
+
template_u0.setProperties(element_u2x, tooltipContent);
|
|
31
28
|
template_u0.setProperty(element_u2x, 'inert', () => !state.active);
|
|
32
|
-
template_u0.slot(element_u2x, options.map((o) => {
|
|
29
|
+
template_u0.slot(element_u2x, options.map(({ content, ...o }) => {
|
|
33
30
|
if (o.href) {
|
|
34
31
|
return (() => {
|
|
35
32
|
let root_u2o = template_u2p(), element_u2q = root_u2o.firstChild;
|
|
36
|
-
template_u0.setProperties(element_u2q,
|
|
37
|
-
template_u0.setProperties(element_u2q,
|
|
38
|
-
template_u0.slot(element_u2q,
|
|
33
|
+
template_u0.setProperties(element_u2q, o);
|
|
34
|
+
template_u0.setProperties(element_u2q, attributes[MENU_OPTION]);
|
|
35
|
+
template_u0.slot(element_u2q, content, 1);
|
|
39
36
|
return root_u2o;
|
|
40
37
|
})();
|
|
41
38
|
}
|
|
42
39
|
return (() => {
|
|
43
40
|
let root_u2r = template_u2s(), element_u2t = root_u2r.firstChild;
|
|
44
|
-
template_u0.setProperties(element_u2t,
|
|
45
|
-
template_u0.setProperties(element_u2t,
|
|
46
|
-
template_u0.slot(element_u2t,
|
|
41
|
+
template_u0.setProperties(element_u2t, o);
|
|
42
|
+
template_u0.setProperties(element_u2t, attributes[MENU_OPTION]);
|
|
43
|
+
template_u0.slot(element_u2t, content, 1);
|
|
47
44
|
return root_u2r;
|
|
48
45
|
})();
|
|
49
46
|
}), 1);
|
|
50
47
|
return root_u2u;
|
|
51
48
|
})());
|
|
52
|
-
});
|
|
49
|
+
}), { option: MENU_OPTION, tooltipContent: MENU_TOOLTIP_CONTENT });
|