@esportsplus/ui 0.0.89 → 0.0.92
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/field/select.js +1 -1
- package/build/components/root/index.d.ts +5 -4
- package/build/components/root/index.js +4 -4
- package/build/components/root/onclick.d.ts +5 -0
- package/build/components/root/onclick.js +16 -0
- package/build/components/site/index.js +2 -1
- package/build/components/tooltip/index.js +7 -9
- package/package.json +2 -2
- package/src/components/field/select.ts +1 -1
- package/src/components/root/index.ts +3 -3
- package/src/components/root/onclick.ts +21 -0
- package/src/components/site/index.ts +2 -1
- package/src/components/tooltip/index.ts +7 -9
- package/build/components/root/queue.d.ts +0 -4
- package/build/components/root/queue.js +0 -10
- package/build/types.d.ts +0 -6
- package/build/types.js +0 -2
- package/src/components/root/queue.ts +0 -28
|
@@ -79,7 +79,7 @@ exports.default = (data) => {
|
|
|
79
79
|
state.render = true;
|
|
80
80
|
state.active = !state.active;
|
|
81
81
|
if (state.active) {
|
|
82
|
-
components_1.root.
|
|
82
|
+
components_1.root.onclick.add(() => state.active = false);
|
|
83
83
|
}
|
|
84
84
|
}}'
|
|
85
85
|
style='${data?.mask?.style || ''}'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import onclick from './onclick';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
onclick: {
|
|
4
|
+
(): Promise<void>;
|
|
5
|
+
add(fn: VoidFunction): void;
|
|
5
6
|
};
|
|
6
7
|
};
|
|
7
8
|
export default _default;
|
|
8
|
-
export {
|
|
9
|
+
export { onclick };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
exports.
|
|
9
|
-
exports.default = {
|
|
6
|
+
exports.onclick = void 0;
|
|
7
|
+
const onclick_1 = __importDefault(require("./onclick"));
|
|
8
|
+
exports.onclick = onclick_1.default;
|
|
9
|
+
exports.default = { onclick: onclick_1.default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
let queue = [];
|
|
4
|
+
const onclick = async () => {
|
|
5
|
+
if (queue.length === 0) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
let item;
|
|
9
|
+
while (item = queue.pop()) {
|
|
10
|
+
await item();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
onclick.add = (fn) => {
|
|
14
|
+
queue.push(fn);
|
|
15
|
+
};
|
|
16
|
+
exports.default = onclick;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const template_1 = require("@esportsplus/template");
|
|
4
4
|
const components_1 = require("../../components");
|
|
5
|
+
const root_1 = require("../../components/root");
|
|
5
6
|
exports.default = (data) => {
|
|
6
7
|
let { attributes: a, html: h } = (0, components_1.scrollbar)({
|
|
7
8
|
fixed: true,
|
|
8
9
|
style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
9
10
|
});
|
|
10
11
|
return (0, template_1.html) `
|
|
11
|
-
<section class='site ${data?.class || ''}'
|
|
12
|
+
<section class='site ${data?.class || ''}' ${a} onclick='${root_1.onclick}'>
|
|
12
13
|
${data?.content || ''}
|
|
13
14
|
${h}
|
|
14
15
|
</section>
|
|
@@ -4,17 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const reactivity_1 = require("@esportsplus/reactivity");
|
|
7
|
-
const components_1 = require("../../components");
|
|
8
7
|
const menu_1 = __importDefault(require("./menu"));
|
|
8
|
+
const root_1 = __importDefault(require("../../components/root"));
|
|
9
9
|
let queue = [], running = false, scheduled = false;
|
|
10
10
|
async function frame() {
|
|
11
11
|
if (running) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
running = true;
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
await
|
|
15
|
+
let item;
|
|
16
|
+
while (item = queue.pop()) {
|
|
17
|
+
await item();
|
|
18
18
|
}
|
|
19
19
|
running = false;
|
|
20
20
|
}
|
|
@@ -42,11 +42,11 @@ const onclick = (data = {}) => {
|
|
|
42
42
|
queue.push(() => state.active = false);
|
|
43
43
|
}
|
|
44
44
|
if (!scheduled) {
|
|
45
|
-
|
|
46
|
-
components_1.root.queue.onclick(() => {
|
|
45
|
+
root_1.default.onclick.add(() => {
|
|
47
46
|
frame();
|
|
48
47
|
scheduled = false;
|
|
49
48
|
});
|
|
49
|
+
scheduled = true;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
@@ -61,9 +61,7 @@ const onhover = (active = false) => {
|
|
|
61
61
|
});
|
|
62
62
|
return {
|
|
63
63
|
attributes: {
|
|
64
|
-
class: () => {
|
|
65
|
-
return `tooltip ${state.active ? '--active' : ''}`;
|
|
66
|
-
},
|
|
64
|
+
class: () => `tooltip ${state.active ? '--active' : ''}`,
|
|
67
65
|
onmouseover: () => {
|
|
68
66
|
state.active = true;
|
|
69
67
|
},
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@esportsplus/action": "^0.0.38",
|
|
5
5
|
"@esportsplus/reactivity": "^0.1.18",
|
|
6
|
-
"@esportsplus/template": "^0.1.
|
|
6
|
+
"@esportsplus/template": "^0.1.29"
|
|
7
7
|
},
|
|
8
8
|
"description": "UI",
|
|
9
9
|
"devDependencies": {
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"prepublishOnly": "npm run build"
|
|
22
22
|
},
|
|
23
23
|
"types": "build/index.d.ts",
|
|
24
|
-
"version": "0.0.
|
|
24
|
+
"version": "0.0.92"
|
|
25
25
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
let queue: VoidFunction[] = [];
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const onclick = async () => {
|
|
5
|
+
if (queue.length === 0) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let item;
|
|
10
|
+
|
|
11
|
+
while (item = queue.pop()) {
|
|
12
|
+
await item();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
onclick.add = (fn: VoidFunction) => {
|
|
17
|
+
queue.push(fn);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export default onclick;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { html } from '@esportsplus/template';
|
|
2
2
|
import { scrollbar } from '~/components';
|
|
3
|
+
import { onclick } from '~/components/root';
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
type Data = {
|
|
@@ -18,7 +19,7 @@ export default (data: Data) => {
|
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
return html`
|
|
21
|
-
<section class='site ${data?.class || ''}'
|
|
22
|
+
<section class='site ${data?.class || ''}' ${a} onclick='${onclick}'>
|
|
22
23
|
${data?.content || ''}
|
|
23
24
|
${h}
|
|
24
25
|
</section>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
-
import { root } from '~/components';
|
|
3
2
|
import menu from './menu';
|
|
3
|
+
import root from '~/components/root';
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
let queue: VoidFunction[] = [],
|
|
@@ -15,10 +15,10 @@ async function frame() {
|
|
|
15
15
|
|
|
16
16
|
running = true;
|
|
17
17
|
|
|
18
|
-
let
|
|
18
|
+
let item;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
await
|
|
20
|
+
while (item = queue.pop()) {
|
|
21
|
+
await item();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
running = false;
|
|
@@ -57,11 +57,11 @@ const onclick = (data: { active?: boolean, menu?: Parameters<typeof menu>[0], to
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (!scheduled) {
|
|
60
|
-
|
|
61
|
-
root.queue.onclick(() => {
|
|
60
|
+
root.onclick.add(() => {
|
|
62
61
|
frame();
|
|
63
62
|
scheduled = false;
|
|
64
63
|
});
|
|
64
|
+
scheduled = true;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
},
|
|
@@ -78,9 +78,7 @@ const onhover = (active: boolean = false) => {
|
|
|
78
78
|
|
|
79
79
|
return {
|
|
80
80
|
attributes: {
|
|
81
|
-
class: () => {
|
|
82
|
-
return `tooltip ${state.active ? '--active' : ''}`;
|
|
83
|
-
},
|
|
81
|
+
class: () => `tooltip ${state.active ? '--active' : ''}`,
|
|
84
82
|
onmouseover: () => {
|
|
85
83
|
state.active = true;
|
|
86
84
|
},
|
package/build/types.d.ts
DELETED
package/build/types.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// import events from '@esportsplus/delegated-events';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let initialized = false,
|
|
5
|
-
queue: VoidFunction[] = [];
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const onclick = (fn: VoidFunction) => {
|
|
9
|
-
if (!initialized) {
|
|
10
|
-
// events.register(document.body, 'click', async () => {
|
|
11
|
-
// if (!queue.length) {
|
|
12
|
-
// return;
|
|
13
|
-
// }
|
|
14
|
-
|
|
15
|
-
// let items = queue.splice(0);
|
|
16
|
-
|
|
17
|
-
// for (let i = 0, n = items.length; i < n; i++) {
|
|
18
|
-
// await items[i]();
|
|
19
|
-
// }
|
|
20
|
-
// });
|
|
21
|
-
initialized = true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
queue.push(fn);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export default { onclick };
|