@esportsplus/ui 0.45.5 → 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/button/scss/index.scss +1 -1
- package/build/themes/dark/index.d.ts +0 -2
- package/build/themes/dark/index.js +0 -2
- package/build/themes/dark/input.d.ts +10 -8
- package/build/themes/dark/link/scss/index.scss +2 -0
- package/build/themes/dark/select.d.ts +90 -70
- package/build/themes/dark/textarea.d.ts +10 -8
- package/package.json +20 -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/src/themes/dark/button/scss/index.scss +16 -0
- package/src/themes/dark/index.ts +0 -2
- package/src/themes/dark/link/scss/index.scss +26 -0
- package/tsconfig.json +6 -1
- package/build/themes/dark/button/index.d.ts +0 -16
- package/build/themes/dark/button/index.js +0 -14
- package/build/themes/dark/link.d.ts +0 -11
- package/build/themes/dark/link.js +0 -9
- package/src/themes/dark/button/index.ts +0 -22
- package/src/themes/dark/link.ts +0 -12
|
@@ -1,11 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
|
|
2
|
+
import * as template_a6aeaec5a75649bd8ec693d5230c50001 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 template_a6aeaec5a75649bd8ec693d5230c500032 = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
|
|
10
|
+
class='link select-option '><!--$--></div>`);
|
|
11
|
+
const template_a6aeaec5a75649bd8ec693d5230c500036 = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
|
|
12
|
+
class='select tooltip '><!--$--><div class='select-arrow'></div><input class='select-tag'
|
|
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
|
+
}
|
|
9
48
|
const OMIT = [
|
|
10
49
|
'arrow',
|
|
11
50
|
'options',
|
|
@@ -42,92 +81,88 @@ function set(current, value) {
|
|
|
42
81
|
}
|
|
43
82
|
}
|
|
44
83
|
const select = template.factory(function (attributes, content) {
|
|
45
|
-
let { options, option } = attributes, state = attributes.state ||
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
name
|
|
70
|
-
|
|
71
|
-
onrender
|
|
72
|
-
value
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (key !== undefined) {
|
|
95
|
-
break;
|
|
84
|
+
let { options, option } = attributes, state = attributes.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c500030(attributes.selected || Object.keys(options)[0]);
|
|
85
|
+
return (() => {
|
|
86
|
+
let root_a6aeaec5a75649bd8ec693d5230c500035 = template_a6aeaec5a75649bd8ec693d5230c500036(), element_a6aeaec5a75649bd8ec693d5230c500037 = root_a6aeaec5a75649bd8ec693d5230c500035.firstChild, element_a6aeaec5a75649bd8ec693d5230c500038 = element_a6aeaec5a75649bd8ec693d5230c500037.firstChild, element_a6aeaec5a75649bd8ec693d5230c500039 = element_a6aeaec5a75649bd8ec693d5230c500037.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50003a = element_a6aeaec5a75649bd8ec693d5230c500039.nextElementSibling, element_a6aeaec5a75649bd8ec693d5230c50003b = element_a6aeaec5a75649bd8ec693d5230c500038.nextSibling.nextSibling.nextSibling;
|
|
87
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500037, ' ', () => state.active && '--active');
|
|
88
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500037, this?.attributes && omit(this.attributes, OMIT));
|
|
89
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500037, omit(attributes, OMIT));
|
|
90
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c500037, 'click', () => {
|
|
91
|
+
if (state.render) {
|
|
92
|
+
set(state, !state.active);
|
|
93
|
+
}
|
|
94
|
+
state.render = true;
|
|
95
|
+
});
|
|
96
|
+
new template_a6aeaec5a75649bd8ec693d5230c50001.EffectSlot(element_a6aeaec5a75649bd8ec693d5230c500038, content ? (() => content(state)) : (() => {
|
|
97
|
+
let selected = options[state.selected];
|
|
98
|
+
if (!selected) {
|
|
99
|
+
return '-';
|
|
100
|
+
}
|
|
101
|
+
if (selected !== null && typeof selected === 'object' && 'content' in selected) {
|
|
102
|
+
return selected.content;
|
|
103
|
+
}
|
|
104
|
+
return selected;
|
|
105
|
+
}));
|
|
106
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500039, this?.attributes?.arrow);
|
|
107
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500039, attributes.arrow);
|
|
108
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50003a, 'name', attributes.name);
|
|
109
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50003a, 'click', () => { });
|
|
110
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c50003a, form.input.onrender(state));
|
|
111
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50003a, 'value', () => state.selected);
|
|
112
|
+
new template_a6aeaec5a75649bd8ec693d5230c50001.EffectSlot(element_a6aeaec5a75649bd8ec693d5230c50003b, () => {
|
|
113
|
+
if (!state.render) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let keys = Object.keys(options), selected = reactivity_a6aeaec5a75649bd8ec693d5230c50000.signal(Object.fromEntries(keys.map(key => [key, false])));
|
|
117
|
+
return sb({
|
|
118
|
+
...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
|
|
119
|
+
...attributes['tooltip-content'],
|
|
120
|
+
class: [
|
|
121
|
+
...toArray(attributes['tooltip-content']?.class),
|
|
122
|
+
`tooltip-content--${attributes['tooltip-content']?.direction || 's'}`
|
|
123
|
+
],
|
|
124
|
+
onclick: (e) => {
|
|
125
|
+
let element = e.target, key = element.dataset?.key;
|
|
126
|
+
if (key === undefined) {
|
|
127
|
+
let parent;
|
|
128
|
+
while (parent = element.parentElement) {
|
|
129
|
+
key = parent.dataset?.key;
|
|
130
|
+
if (key !== undefined) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
96
133
|
}
|
|
97
134
|
}
|
|
135
|
+
if (key === undefined) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
let previous = state.selected;
|
|
139
|
+
set(state, false);
|
|
140
|
+
state.selected = key;
|
|
141
|
+
reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(selected)[key] = true;
|
|
142
|
+
reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(selected)[previous] = false;
|
|
143
|
+
},
|
|
144
|
+
onconnect: () => {
|
|
145
|
+
set(state, true);
|
|
146
|
+
},
|
|
147
|
+
scrollbar: attributes.scrollbar,
|
|
148
|
+
'scrollbar-container-content': attributes['scrollbar-container-content']
|
|
149
|
+
}, keys.map((key) => {
|
|
150
|
+
let content = options[key];
|
|
151
|
+
if (content !== null && typeof content === 'object' && 'content' in content) {
|
|
152
|
+
content = content.content;
|
|
98
153
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
'scrollbar-container-content': attributes['scrollbar-container-content']
|
|
113
|
-
}, keys.map((key) => {
|
|
114
|
-
let content = options[key];
|
|
115
|
-
if (content !== null && typeof content === 'object' && 'content' in content) {
|
|
116
|
-
content = content.content;
|
|
117
|
-
}
|
|
118
|
-
return html `
|
|
119
|
-
<div
|
|
120
|
-
class='link select-option ${() => selected[key] && '--active'}'
|
|
121
|
-
${this?.attributes?.option}
|
|
122
|
-
${option}
|
|
123
|
-
data-key='${key}'
|
|
124
|
-
>
|
|
125
|
-
${content}
|
|
126
|
-
</div>
|
|
127
|
-
`;
|
|
128
|
-
}));
|
|
129
|
-
}}
|
|
130
|
-
</div>
|
|
131
|
-
`;
|
|
154
|
+
return (() => {
|
|
155
|
+
let root_a6aeaec5a75649bd8ec693d5230c500031 = template_a6aeaec5a75649bd8ec693d5230c500032(), element_a6aeaec5a75649bd8ec693d5230c500033 = root_a6aeaec5a75649bd8ec693d5230c500031.firstChild, element_a6aeaec5a75649bd8ec693d5230c500034 = element_a6aeaec5a75649bd8ec693d5230c500033.firstChild;
|
|
156
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500033, ' ', () => reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(selected)[key] && '--active');
|
|
157
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500033, this?.attributes?.option);
|
|
158
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500033, option);
|
|
159
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c500033, 'data-key', key);
|
|
160
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c500034, content);
|
|
161
|
+
return root_a6aeaec5a75649bd8ec693d5230c500031;
|
|
162
|
+
})();
|
|
163
|
+
}));
|
|
164
|
+
});
|
|
165
|
+
return root_a6aeaec5a75649bd8ec693d5230c500035;
|
|
166
|
+
})();
|
|
132
167
|
});
|
|
133
168
|
export default select;
|
|
@@ -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;
|
|
@@ -7,4 +7,4 @@ export default function (this: {
|
|
|
7
7
|
active: boolean;
|
|
8
8
|
error: string;
|
|
9
9
|
};
|
|
10
|
-
}):
|
|
10
|
+
}): DocumentFragment;
|
|
@@ -1,31 +1,46 @@
|
|
|
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 form from '../../components/form/index.js';
|
|
5
5
|
import './scss/index.scss';
|
|
6
|
+
const template_a6aeaec5a75649bd8ec693d5230c50003e = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<textarea
|
|
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
|
+
}
|
|
6
27
|
const OMIT = ['state'];
|
|
7
28
|
export default function (attributes) {
|
|
8
|
-
let state = attributes.state ||
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
${this?.attributes && omit(this.attributes, OMIT)}
|
|
16
|
-
${omit(attributes, OMIT)}
|
|
17
|
-
${{
|
|
18
|
-
class: () => state.active && '--active',
|
|
19
|
-
onfocusin: () => {
|
|
29
|
+
let state = attributes.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50003c();
|
|
30
|
+
return (() => {
|
|
31
|
+
let root_a6aeaec5a75649bd8ec693d5230c50003d = template_a6aeaec5a75649bd8ec693d5230c50003e(), element_a6aeaec5a75649bd8ec693d5230c50003f = root_a6aeaec5a75649bd8ec693d5230c50003d.firstChild;
|
|
32
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50003f, this?.attributes && omit(this.attributes, OMIT));
|
|
33
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50003f, omit(attributes, OMIT));
|
|
34
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50003f, '', () => state.active && '--active');
|
|
35
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50003f, 'focusin', () => {
|
|
20
36
|
state.active = true;
|
|
21
|
-
}
|
|
22
|
-
|
|
37
|
+
});
|
|
38
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50003f, 'focusout', () => {
|
|
23
39
|
state.active = false;
|
|
24
|
-
}
|
|
25
|
-
onrender
|
|
26
|
-
value
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`;
|
|
40
|
+
});
|
|
41
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c50003f, form.input.onrender(state));
|
|
42
|
+
template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50003f, 'value', attributes?.value || '');
|
|
43
|
+
return root_a6aeaec5a75649bd8ec693d5230c50003d;
|
|
44
|
+
})();
|
|
30
45
|
}
|
|
31
46
|
;
|