@esportsplus/ui 0.0.121 → 0.0.122
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/.editorconfig +9 -0
- package/.gitattributes +2 -0
- package/build/assets/0af89c10df9bc2f8d646.woff2 +0 -0
- package/build/assets/109e3207d9afea8524be.woff2 +0 -0
- package/build/assets/16663c3f6ab1da2d6c86.woff +0 -0
- package/build/assets/16e8721ef5837bc6375e.woff +0 -0
- package/build/assets/2a3e005f58bfca9c117e.woff +0 -0
- package/build/assets/58a8d7ebc386843b62c5.woff2 +0 -0
- package/build/assets/593de7c561e5ffe80c3e.woff2 +0 -0
- package/build/assets/68b7982c2b30b51bf932.woff2 +0 -0
- package/build/assets/a04b5e24af93da353f0e.woff +0 -0
- package/build/assets/bf331673b91821715c08.woff +0 -0
- package/build/assets/c54b0f4340f2914802d1.woff +0 -0
- package/build/assets/dd8646a41e4397b77fc4.woff2 +0 -0
- package/build/assets/e06c107cc50506570954.woff2 +0 -0
- package/build/assets/ecdfe4c05425592708aa.woff2 +0 -0
- package/build/assets/f0032576ac7462ccbd0c.woff +0 -0
- package/build/assets/f872e621917a45943fbc.woff +0 -0
- package/build/components/alert/index.d.ts +10 -0
- package/build/components/alert/index.js +124 -0
- package/build/components/export/clipboard.d.ts +2 -0
- package/build/components/export/clipboard.js +10 -0
- package/build/components/export/index.d.ts +5 -0
- package/build/components/export/index.js +8 -0
- package/build/components/export/json.d.ts +2 -0
- package/build/components/export/json.js +10 -0
- package/build/components/field/checkbox.d.ts +17 -0
- package/build/components/field/checkbox.js +46 -0
- package/build/components/field/description.d.ts +4 -0
- package/build/components/field/description.js +11 -0
- package/build/components/field/error.d.ts +4 -0
- package/build/components/field/error.js +13 -0
- package/build/components/field/file.d.ts +18 -0
- package/build/components/field/file.js +50 -0
- package/build/components/field/index.d.ts +222 -0
- package/build/components/field/index.js +13 -0
- package/build/components/field/optional.d.ts +92 -0
- package/build/components/field/optional.js +21 -0
- package/build/components/field/select.d.ts +32 -0
- package/build/components/field/select.js +110 -0
- package/build/components/field/switch.d.ts +3 -0
- package/build/components/field/switch.js +11 -0
- package/build/components/field/text.d.ts +21 -0
- package/build/components/field/text.js +51 -0
- package/build/components/field/textarea.d.ts +3 -0
- package/build/components/field/textarea.js +10 -0
- package/build/components/field/title.d.ts +5 -0
- package/build/components/field/title.js +24 -0
- package/build/components/form/action.d.ts +5 -0
- package/build/components/form/action.js +51 -0
- package/build/components/form/index.d.ts +23 -0
- package/build/components/form/index.js +9 -0
- package/build/components/form/input.d.ts +9 -0
- package/build/components/form/input.js +12 -0
- package/build/components/form/layout.d.ts +12 -0
- package/build/components/form/layout.js +14 -0
- package/build/components/form/types.d.ts +12 -0
- package/build/components/form/types.js +2 -0
- package/build/components/number/index.d.ts +8 -0
- package/build/components/number/index.js +20 -0
- package/build/components/page/index.d.ts +22 -0
- package/build/components/page/index.js +16 -0
- package/build/components/root/index.d.ts +9 -0
- package/build/components/root/index.js +9 -0
- package/build/components/root/onclick.d.ts +5 -0
- package/build/components/root/onclick.js +16 -0
- package/build/components/scrollbar/index.d.ts +11 -0
- package/build/components/scrollbar/index.js +38 -0
- package/build/components/site/index.d.ts +9 -0
- package/build/components/site/index.js +20 -0
- package/build/components/styles.css +1 -0
- package/build/components/tooltip/index.d.ts +58 -0
- package/build/components/tooltip/index.js +75 -0
- package/build/components/tooltip/menu.d.ts +25 -0
- package/build/components/tooltip/menu.js +46 -0
- package/build/components/variables.css +1 -0
- package/build/fonts/montserrat.css +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.js +24 -0
- package/build/normalizer.css +1 -0
- package/build/utilities/styles.css +1 -0
- package/build/utilities/variables.css +1 -0
- package/package.json +1 -5
- package/src/components/accordion/scss/index.scss +16 -0
- package/src/components/accordion/scss/variables.scss +4 -0
- package/src/components/alert/index.ts +157 -0
- package/src/components/alert/scss/index.scss +55 -0
- package/src/components/alert/scss/variables.scss +8 -0
- package/src/components/anchor/scss/index.scss +41 -0
- package/src/components/anchor/scss/variables.scss +5 -0
- package/src/components/banner/scss/index.scss +40 -0
- package/src/components/banner/scss/variables.scss +6 -0
- package/src/components/border/scss/index.scss +10 -0
- package/src/components/border/scss/variables.scss +6 -0
- package/src/components/bubble/scss/index.scss +30 -0
- package/src/components/bubble/scss/variables.scss +19 -0
- package/src/components/button/scss/index.scss +92 -0
- package/src/components/button/scss/variables.scss +69 -0
- package/src/components/card/scss/index.scss +35 -0
- package/src/components/card/scss/variables.scss +42 -0
- package/src/components/container/scss/index.scss +10 -0
- package/src/components/container/scss/variables.scss +5 -0
- package/src/components/ellipsis/scss/index.scss +72 -0
- package/src/components/ellipsis/scss/variables.scss +3 -0
- package/src/components/export/clipboard.ts +12 -0
- package/src/components/export/index.ts +5 -0
- package/src/components/export/json.ts +15 -0
- package/src/components/field/checkbox.ts +61 -0
- package/src/components/field/description.ts +12 -0
- package/src/components/field/error.ts +14 -0
- package/src/components/field/file.ts +64 -0
- package/src/components/field/index.ts +10 -0
- package/src/components/field/optional.ts +27 -0
- package/src/components/field/scss/_check.scss +225 -0
- package/src/components/field/scss/_normalize.scss +36 -0
- package/src/components/field/scss/_text.scss +106 -0
- package/src/components/field/scss/index.scss +159 -0
- package/src/components/field/scss/variables.scss +138 -0
- package/src/components/field/select.ts +151 -0
- package/src/components/field/switch.ts +9 -0
- package/src/components/field/text.ts +68 -0
- package/src/components/field/textarea.ts +8 -0
- package/src/components/field/title.ts +23 -0
- package/src/components/form/action.ts +68 -0
- package/src/components/form/index.ts +6 -0
- package/src/components/form/input.ts +15 -0
- package/src/components/form/layout.ts +26 -0
- package/src/components/form/types.ts +16 -0
- package/src/components/group/scss/index.scss +36 -0
- package/src/components/group/scss/variables.scss +17 -0
- package/src/components/icon/scss/index.scss +17 -0
- package/src/components/icon/scss/variables.scss +7 -0
- package/src/components/link/scss/index.scss +28 -0
- package/src/components/link/scss/variables.scss +47 -0
- package/src/components/loading/scss/index.scss +24 -0
- package/src/components/loading/scss/variables.scss +31 -0
- package/src/components/modal/scss/index.scss +32 -0
- package/src/components/modal/scss/variables.scss +10 -0
- package/src/components/number/index.ts +24 -0
- package/src/components/page/index.ts +15 -0
- package/src/components/page/scss/index.scss +27 -0
- package/src/components/page/scss/variables.scss +27 -0
- package/src/components/processing/scss/index.scss +47 -0
- package/src/components/processing/scss/variables.scss +11 -0
- package/src/components/root/index.ts +5 -0
- package/src/components/root/onclick.ts +21 -0
- package/src/components/root/scss/index.scss +93 -0
- package/src/components/root/scss/variables.scss +55 -0
- package/src/components/row/scss/index.scss +7 -0
- package/src/components/scrollbar/index.ts +44 -0
- package/src/components/scrollbar/scss/index.scss +59 -0
- package/src/components/scrollbar/scss/variables.scss +6 -0
- package/src/components/sidebar/scss/index.scss +50 -0
- package/src/components/sidebar/scss/variables.scss +21 -0
- package/src/components/site/index.ts +27 -0
- package/src/components/site/scss/index.scss +3 -0
- package/src/components/text/scss/index.scss +12 -0
- package/src/components/text/scss/variables.scss +9 -0
- package/src/components/thumbnail/scss/index.scss +7 -0
- package/src/components/thumbnail/scss/variables.scss +7 -0
- package/src/components/tooltip/index.ts +94 -0
- package/src/components/tooltip/menu.ts +71 -0
- package/src/components/tooltip/scss/_center.scss +13 -0
- package/src/components/tooltip/scss/_east.scss +34 -0
- package/src/components/tooltip/scss/_north.scss +34 -0
- package/src/components/tooltip/scss/_south.scss +35 -0
- package/src/components/tooltip/scss/_west.scss +34 -0
- package/src/components/tooltip/scss/index.scss +93 -0
- package/src/components/tooltip/scss/variables.scss +25 -0
- package/src/css-utilities/[margin,padding]/scss/index.scss +41 -0
- package/src/css-utilities/[margin,padding]/scss/variables.scss +54 -0
- package/src/css-utilities/absolute/scss/index.scss +59 -0
- package/src/css-utilities/background/scss/variables.scss +27 -0
- package/src/css-utilities/border/scss/index.scss +21 -0
- package/src/css-utilities/border/scss/variables.scss +66 -0
- package/src/css-utilities/color/scss/variables.scss +31 -0
- package/src/css-utilities/disabled/scss/index.scss +4 -0
- package/src/css-utilities/flex/scss/index.scss +65 -0
- package/src/css-utilities/glass/scss/index.scss +3 -0
- package/src/css-utilities/glass/scss/variables.scss +3 -0
- package/src/css-utilities/hidden/scss/index.scss +28 -0
- package/src/css-utilities/index.scss +14 -0
- package/src/css-utilities/inline/scss/index.scss +7 -0
- package/src/css-utilities/line-height/scss/variables.scss +10 -0
- package/src/css-utilities/not-allowed/scss/index.scss +7 -0
- package/src/css-utilities/overflow/scss/index.scss +5 -0
- package/src/css-utilities/pointer/scss/index.scss +5 -0
- package/src/css-utilities/size/scss/variables.scss +12 -0
- package/src/css-utilities/slide/scss/index.scss +20 -0
- package/src/css-utilities/slide/scss/variables.scss +6 -0
- package/src/css-utilities/text/scss/index.scss +93 -0
- package/src/css-utilities/text/scss/variables.scss +31 -0
- package/src/css-utilities/transition/scss/variables.scss +14 -0
- package/src/css-utilities/viewport/scss/index.scss +5 -0
- package/src/css-utilities/width/scss/index.scss +3 -0
- package/src/css-utilities/width/scss/variables.scss +9 -0
- package/src/index.ts +11 -0
- package/src/lib/index.scss +7 -0
- package/src/lib/scss/breakpoint.scss +41 -0
- package/src/lib/scss/color.scss +1 -0
- package/src/lib/scss/css-variables.scss +13 -0
- package/src/lib/scss/list.scss +76 -0
- package/src/lib/scss/map.scss +1 -0
- package/src/lib/scss/position.scss +77 -0
- package/src/lib/scss/string.scss +33 -0
- package/src/tokens/index.scss +11 -0
- package/src/tokens/scss/border-radius.scss +12 -0
- package/src/tokens/scss/border-width.scss +6 -0
- package/src/tokens/scss/box-shadow.scss +13 -0
- package/src/tokens/scss/color.scss +64 -0
- package/src/tokens/scss/font-size.scss +12 -0
- package/src/tokens/scss/font-weight.scss +6 -0
- package/src/tokens/scss/line-height.scss +6 -0
- package/src/tokens/scss/size.scss +13 -0
- package/src/tokens/scss/spacer.scss +8 -0
- package/src/tokens/scss/state.scss +86 -0
- package/src/tokens/scss/transition-duration.scss +5 -0
- package/storage/fonts/montserrat/Montserrat-Bold.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Bold.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-BoldItalic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-BoldItalic.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-Italic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Italic.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-Medium.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Medium.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-MediumItalic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-MediumItalic.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-Regular.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Regular.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBold.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBold.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBoldItalic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/storage/fonts/montserrat/index.css +79 -0
- package/storage/psd/Color Palette.psd +0 -0
- package/tsconfig.json +11 -0
- package/webpack.config.ts +23 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
select: (data: {
|
|
3
|
+
class?: string | undefined;
|
|
4
|
+
field?: {
|
|
5
|
+
content?: any;
|
|
6
|
+
} | undefined;
|
|
7
|
+
mask?: {
|
|
8
|
+
class?: string | undefined;
|
|
9
|
+
style?: string | undefined;
|
|
10
|
+
} | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
style?: string | undefined;
|
|
13
|
+
title: string;
|
|
14
|
+
value?: any;
|
|
15
|
+
} & {
|
|
16
|
+
description?: string | undefined;
|
|
17
|
+
} & {
|
|
18
|
+
field: {
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
effect?: ((selected: string | number) => void) | undefined;
|
|
21
|
+
mask?: {
|
|
22
|
+
class?: string | undefined;
|
|
23
|
+
content?: any;
|
|
24
|
+
style?: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
name?: string | undefined;
|
|
27
|
+
options: Record<string | number, string | number>;
|
|
28
|
+
option?: {
|
|
29
|
+
class?: string | undefined;
|
|
30
|
+
style?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
selected?: any;
|
|
33
|
+
scrollbar?: {
|
|
34
|
+
style?: string | undefined;
|
|
35
|
+
} | undefined;
|
|
36
|
+
style?: string | undefined;
|
|
37
|
+
text?: {
|
|
38
|
+
class?: string | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
tooltip?: {
|
|
41
|
+
class?: string | undefined;
|
|
42
|
+
direction?: any;
|
|
43
|
+
style?: string | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
} & {
|
|
46
|
+
description?: string | undefined;
|
|
47
|
+
} & {
|
|
48
|
+
required?: boolean | undefined;
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
}) => import("@esportsplus/template/build/types").Renderable;
|
|
52
|
+
text: (data: {
|
|
53
|
+
class?: string | undefined;
|
|
54
|
+
field?: {
|
|
55
|
+
content?: any;
|
|
56
|
+
} | undefined;
|
|
57
|
+
mask?: {
|
|
58
|
+
class?: string | undefined;
|
|
59
|
+
style?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
style?: string | undefined;
|
|
63
|
+
title: string;
|
|
64
|
+
value?: any;
|
|
65
|
+
} & {
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
} & {
|
|
68
|
+
field: {
|
|
69
|
+
class?: string | undefined;
|
|
70
|
+
mask?: {
|
|
71
|
+
class?: string | undefined;
|
|
72
|
+
content?: any;
|
|
73
|
+
style?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
name?: string | undefined;
|
|
76
|
+
placeholder?: string | undefined;
|
|
77
|
+
style?: string | undefined;
|
|
78
|
+
tag?: {
|
|
79
|
+
class?: string | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
textarea?: boolean | undefined;
|
|
82
|
+
type?: string | undefined;
|
|
83
|
+
value?: unknown;
|
|
84
|
+
} & {
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
} & {
|
|
87
|
+
required?: boolean | undefined;
|
|
88
|
+
title?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
}) => import("@esportsplus/template/build/types").Renderable;
|
|
91
|
+
};
|
|
92
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const select_1 = __importDefault(require("./select"));
|
|
7
|
+
const switch_1 = __importDefault(require("./switch"));
|
|
8
|
+
const text_1 = __importDefault(require("./text"));
|
|
9
|
+
const select = (data) => {
|
|
10
|
+
data.field.content = (0, select_1.default)(Object.assign(data.field || {}, {
|
|
11
|
+
class: `field--optional ${data?.field?.class || ''}`
|
|
12
|
+
}));
|
|
13
|
+
return (0, switch_1.default)(data);
|
|
14
|
+
};
|
|
15
|
+
const text = (data) => {
|
|
16
|
+
data.field.content = (0, text_1.default)(Object.assign(data.field || {}, {
|
|
17
|
+
class: `field--optional ${data?.field?.class || ''}`
|
|
18
|
+
}));
|
|
19
|
+
return (0, switch_1.default)(data);
|
|
20
|
+
};
|
|
21
|
+
exports.default = { select, text };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import description from './description';
|
|
2
|
+
import title from './title';
|
|
3
|
+
type Data = {
|
|
4
|
+
class?: string;
|
|
5
|
+
effect?: (selected: number | string) => void;
|
|
6
|
+
mask?: {
|
|
7
|
+
class?: string;
|
|
8
|
+
content?: any;
|
|
9
|
+
style?: string;
|
|
10
|
+
};
|
|
11
|
+
name?: string;
|
|
12
|
+
options: Record<number | string, number | string>;
|
|
13
|
+
option?: {
|
|
14
|
+
class?: string;
|
|
15
|
+
style?: string;
|
|
16
|
+
};
|
|
17
|
+
selected?: any;
|
|
18
|
+
scrollbar?: {
|
|
19
|
+
style?: string;
|
|
20
|
+
};
|
|
21
|
+
style?: string;
|
|
22
|
+
text?: {
|
|
23
|
+
class?: string;
|
|
24
|
+
};
|
|
25
|
+
tooltip?: {
|
|
26
|
+
class?: string;
|
|
27
|
+
direction?: any;
|
|
28
|
+
style?: string;
|
|
29
|
+
};
|
|
30
|
+
} & Parameters<typeof description>[0] & Parameters<typeof title>[0];
|
|
31
|
+
declare const _default: (data: Data) => import("@esportsplus/template/build/types").Renderable;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const reactivity_1 = require("@esportsplus/reactivity");
|
|
7
|
+
const template_1 = require("@esportsplus/template");
|
|
8
|
+
const form_1 = __importDefault(require("../../components/form"));
|
|
9
|
+
const scrollbar_1 = __importDefault(require("../../components/scrollbar"));
|
|
10
|
+
const root_1 = __importDefault(require("../../components/root"));
|
|
11
|
+
const description_1 = __importDefault(require("./description"));
|
|
12
|
+
const error_1 = __importDefault(require("./error"));
|
|
13
|
+
const title_1 = __importDefault(require("./title"));
|
|
14
|
+
function parse(keys, selected) {
|
|
15
|
+
let options = {};
|
|
16
|
+
for (let key of keys) {
|
|
17
|
+
options[key] = false;
|
|
18
|
+
}
|
|
19
|
+
options[selected] = true;
|
|
20
|
+
return {
|
|
21
|
+
options,
|
|
22
|
+
selected: selected || keys[0]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function template(data, state) {
|
|
26
|
+
let { attributes: a, html: h } = (0, scrollbar_1.default)({
|
|
27
|
+
fixed: true,
|
|
28
|
+
style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
29
|
+
});
|
|
30
|
+
return (0, template_1.html) `
|
|
31
|
+
<div
|
|
32
|
+
class='tooltip-content tooltip-content--${data?.tooltip?.direction || 's'} ${data?.tooltip?.class || ''} --flex-column --width-full'
|
|
33
|
+
style='${data?.tooltip?.style || ''}'
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
class='row --flex-column'
|
|
37
|
+
onclick='${(e) => {
|
|
38
|
+
let key = e?.target?.dataset?.key;
|
|
39
|
+
if (key === undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
state.options[key] = true;
|
|
43
|
+
state.options[state.selected] = false;
|
|
44
|
+
state.active = false;
|
|
45
|
+
state.selected = key;
|
|
46
|
+
if (data.effect) {
|
|
47
|
+
data.effect(key);
|
|
48
|
+
}
|
|
49
|
+
}}'
|
|
50
|
+
${a}
|
|
51
|
+
>
|
|
52
|
+
${Object.keys(data.options || {}).map((key) => (0, template_1.html) `
|
|
53
|
+
<div
|
|
54
|
+
class='link ${data?.option?.class || ''} ${() => state.options[key] ? '--active' : ''} --flex-vertical' data-key='${key}'
|
|
55
|
+
style='${data?.option?.style || ''}'
|
|
56
|
+
>
|
|
57
|
+
<span class="--text-truncate">
|
|
58
|
+
${data.options[key]}
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
`)}
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
${h}
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
exports.default = (data) => {
|
|
69
|
+
let state = (0, reactivity_1.reactive)(Object.assign({
|
|
70
|
+
active: false,
|
|
71
|
+
error: '',
|
|
72
|
+
render: false,
|
|
73
|
+
}, parse(Object.keys(data.options || {}), data.selected)));
|
|
74
|
+
return (0, template_1.html) `
|
|
75
|
+
<div class="field tooltip ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column" style='${data?.style || ''}'>
|
|
76
|
+
${(0, title_1.default)(data)}
|
|
77
|
+
|
|
78
|
+
<label
|
|
79
|
+
class="field-mask field-mask--select --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) && '--margin-top'} --margin-300 --padding-400"
|
|
80
|
+
onclick='${() => {
|
|
81
|
+
state.render = true;
|
|
82
|
+
state.active = !state.active;
|
|
83
|
+
if (state.active) {
|
|
84
|
+
root_1.default.onclick.add(() => state.active = false);
|
|
85
|
+
}
|
|
86
|
+
}}'
|
|
87
|
+
style='${data?.mask?.style || ''}'
|
|
88
|
+
>
|
|
89
|
+
<input
|
|
90
|
+
class='field-tag field-tag--hidden'
|
|
91
|
+
name='${data.name}'
|
|
92
|
+
onclick='${() => { }}'
|
|
93
|
+
onrender='${form_1.default.input.attributes(state)}'
|
|
94
|
+
value='${() => state.selected}'
|
|
95
|
+
>
|
|
96
|
+
|
|
97
|
+
<div class="field-text ${data?.text?.class || ''}" style='pointer-events: none'>
|
|
98
|
+
${() => data.options[state.selected] || '-'}
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class='field-mask-arrow'></div>
|
|
102
|
+
|
|
103
|
+
${() => state.render ? template(data, state) : ''}
|
|
104
|
+
</label>
|
|
105
|
+
|
|
106
|
+
${(0, description_1.default)(data)}
|
|
107
|
+
${(0, error_1.default)(state)}
|
|
108
|
+
</div>
|
|
109
|
+
`;
|
|
110
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const checkbox_1 = __importDefault(require("./checkbox"));
|
|
7
|
+
exports.default = (data) => {
|
|
8
|
+
data.mask = data.mask || {};
|
|
9
|
+
data.mask.class = `field-mask--switch ${data.mask?.class || ''}`;
|
|
10
|
+
return (0, checkbox_1.default)(data);
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import description from './description';
|
|
2
|
+
import title from './title';
|
|
3
|
+
type Data = {
|
|
4
|
+
class?: string;
|
|
5
|
+
mask?: {
|
|
6
|
+
class?: string;
|
|
7
|
+
content?: any;
|
|
8
|
+
style?: string;
|
|
9
|
+
};
|
|
10
|
+
name?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
style?: string;
|
|
13
|
+
tag?: {
|
|
14
|
+
class?: string;
|
|
15
|
+
};
|
|
16
|
+
textarea?: boolean;
|
|
17
|
+
type?: string;
|
|
18
|
+
value?: unknown;
|
|
19
|
+
} & Parameters<typeof description>[0] & Parameters<typeof title>[0];
|
|
20
|
+
declare const _default: (data: Data) => import("@esportsplus/template/build/types").Renderable;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const reactivity_1 = require("@esportsplus/reactivity");
|
|
7
|
+
const template_1 = require("@esportsplus/template");
|
|
8
|
+
const form_1 = __importDefault(require("../../components/form"));
|
|
9
|
+
const description_1 = __importDefault(require("./description"));
|
|
10
|
+
const error_1 = __importDefault(require("./error"));
|
|
11
|
+
const title_1 = __importDefault(require("./title"));
|
|
12
|
+
exports.default = (data) => {
|
|
13
|
+
let state = (0, reactivity_1.reactive)({
|
|
14
|
+
active: false,
|
|
15
|
+
error: ''
|
|
16
|
+
});
|
|
17
|
+
return (0, template_1.html) `
|
|
18
|
+
<div
|
|
19
|
+
class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
|
|
20
|
+
onfocusin='${() => {
|
|
21
|
+
state.active = true;
|
|
22
|
+
}}'
|
|
23
|
+
onfocusout='${() => {
|
|
24
|
+
state.active = false;
|
|
25
|
+
}}'
|
|
26
|
+
style='${data?.style || ''}'
|
|
27
|
+
>
|
|
28
|
+
${(0, title_1.default)(data)}
|
|
29
|
+
|
|
30
|
+
<label
|
|
31
|
+
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
|
|
32
|
+
style='${data?.mask?.style || ''}'
|
|
33
|
+
>
|
|
34
|
+
<${data?.textarea ? 'textarea' : 'input'}
|
|
35
|
+
class='field-tag --padding-400 ${data?.tag?.class || ''}'
|
|
36
|
+
name='${data?.name || ''}'
|
|
37
|
+
placeholder='${data?.placeholder || ''}'
|
|
38
|
+
onrender='${form_1.default.input.attributes(state)}'
|
|
39
|
+
type='${data?.type || 'string'}'
|
|
40
|
+
${!data?.textarea && data?.value !== undefined ? (0, template_1.html) `value='${data.value}'` : ''}
|
|
41
|
+
>
|
|
42
|
+
${data?.textarea ? (0, template_1.html) `${data?.value || ''}</textarea>` : ''}
|
|
43
|
+
|
|
44
|
+
${data?.mask?.content || ''}
|
|
45
|
+
</label>
|
|
46
|
+
|
|
47
|
+
${(0, description_1.default)(data)}
|
|
48
|
+
${(0, error_1.default)(state)}
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const text_1 = __importDefault(require("./text"));
|
|
7
|
+
exports.default = (data) => {
|
|
8
|
+
data.textarea = true;
|
|
9
|
+
return (0, text_1.default)(data);
|
|
10
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const template_1 = require("@esportsplus/template");
|
|
7
|
+
const tooltip_1 = __importDefault(require("../../components/tooltip"));
|
|
8
|
+
exports.default = (data) => {
|
|
9
|
+
if (!data?.title) {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
let { attributes } = tooltip_1.default.onhover();
|
|
13
|
+
return (0, template_1.html) `
|
|
14
|
+
<div class="field-title --flex-horizontal-space-between --flex-vertical">
|
|
15
|
+
${data.title}
|
|
16
|
+
|
|
17
|
+
${data?.required && (0, template_1.html) `
|
|
18
|
+
<div class="bubble --background-primary --margin-left" ${attributes}>
|
|
19
|
+
<span class="tooltip-message tooltip-message--w">Required</span>
|
|
20
|
+
</div>
|
|
21
|
+
`}
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const action_1 = require("@esportsplus/action");
|
|
7
|
+
const alert_1 = __importDefault(require("../../components/alert"));
|
|
8
|
+
const input_1 = __importDefault(require("./input"));
|
|
9
|
+
function parse(input) {
|
|
10
|
+
let data = {};
|
|
11
|
+
for (let path in input) {
|
|
12
|
+
let bucket = data, keys = path.indexOf('.') !== -1 ? path.split('.') : [path];
|
|
13
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
14
|
+
bucket = bucket[keys[i]] = bucket[keys[i]] || {};
|
|
15
|
+
}
|
|
16
|
+
bucket[keys[keys.length - 1]] = input[path];
|
|
17
|
+
}
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
;
|
|
21
|
+
function default_1(action) {
|
|
22
|
+
return {
|
|
23
|
+
onclick: function (event) {
|
|
24
|
+
let trigger = event.target;
|
|
25
|
+
if (trigger?.type !== 'submit') {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
this.dispatchEvent(new SubmitEvent('submit', { cancelable: true, bubbles: true, submitter: trigger }));
|
|
30
|
+
},
|
|
31
|
+
onsubmit: async function (event) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event?.submitter?.classList.add('button--processing');
|
|
34
|
+
let { errors } = await action({
|
|
35
|
+
alert: alert_1.default,
|
|
36
|
+
input: parse(Object.fromEntries(new FormData(this)?.entries())),
|
|
37
|
+
response: action_1.response
|
|
38
|
+
});
|
|
39
|
+
for (let i = 0, n = errors.length; i < n; i++) {
|
|
40
|
+
let { message, path } = errors[i], state = input_1.default.get(this[path]);
|
|
41
|
+
if (!state) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
state.error = `${message[0].toUpperCase()}${message.substring(1)}`;
|
|
45
|
+
}
|
|
46
|
+
event?.submitter?.classList.remove('button--processing');
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
exports.default = default_1;
|
|
51
|
+
;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import action from './action';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
action: typeof action;
|
|
4
|
+
input: {
|
|
5
|
+
attributes: (reactive: {
|
|
6
|
+
error: string;
|
|
7
|
+
}) => (element: HTMLInputElement | HTMLSelectElement) => void;
|
|
8
|
+
get: (element?: HTMLInputElement | HTMLSelectElement | undefined) => {
|
|
9
|
+
error: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
};
|
|
12
|
+
layout: (data: {
|
|
13
|
+
action?: any;
|
|
14
|
+
button?: {
|
|
15
|
+
class?: string | undefined;
|
|
16
|
+
content?: any;
|
|
17
|
+
style?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
content?: any;
|
|
21
|
+
}) => import("@esportsplus/template/build/types").Renderable;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const action_1 = __importDefault(require("./action"));
|
|
7
|
+
const input_1 = __importDefault(require("./input"));
|
|
8
|
+
const layout_1 = __importDefault(require("./layout"));
|
|
9
|
+
exports.default = { action: action_1.default, input: input_1.default, layout: layout_1.default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
attributes: (reactive: {
|
|
3
|
+
error: string;
|
|
4
|
+
}) => (element: HTMLInputElement | HTMLSelectElement) => void;
|
|
5
|
+
get: (element?: HTMLInputElement | HTMLSelectElement | undefined) => {
|
|
6
|
+
error: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
let cache = new WeakMap();
|
|
4
|
+
const attributes = (reactive) => {
|
|
5
|
+
return (element) => {
|
|
6
|
+
cache.set(element, reactive);
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
const get = (element) => {
|
|
10
|
+
return element ? cache.get(element) : undefined;
|
|
11
|
+
};
|
|
12
|
+
exports.default = { attributes, get };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Data = {
|
|
2
|
+
action?: any;
|
|
3
|
+
button?: {
|
|
4
|
+
class?: string;
|
|
5
|
+
content?: any;
|
|
6
|
+
style?: string;
|
|
7
|
+
};
|
|
8
|
+
class?: string;
|
|
9
|
+
content?: any;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (data: Data) => import("@esportsplus/template/build/types").Renderable;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template_1 = require("@esportsplus/template");
|
|
4
|
+
exports.default = (data) => (0, template_1.html) `
|
|
5
|
+
<form class='${data?.class}' ${data?.action || ''}>
|
|
6
|
+
${data?.content || ''}
|
|
7
|
+
|
|
8
|
+
${data?.button?.content ? (0, template_1.html) `
|
|
9
|
+
<button class="button ${data?.button?.class || ''}" style='${data?.button?.style || ''}'>
|
|
10
|
+
${data?.button?.content || ''}
|
|
11
|
+
</button>
|
|
12
|
+
` : ''}
|
|
13
|
+
</form>
|
|
14
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { response, Response } from '@esportsplus/action';
|
|
2
|
+
import alert from '../../components/alert';
|
|
3
|
+
type Action = (data: Payload) => Promise<Errors> | Errors;
|
|
4
|
+
type Errors = {
|
|
5
|
+
errors: Response<unknown>['errors'];
|
|
6
|
+
};
|
|
7
|
+
type Payload = {
|
|
8
|
+
alert: typeof alert;
|
|
9
|
+
input: Record<string, any>;
|
|
10
|
+
response: typeof response;
|
|
11
|
+
};
|
|
12
|
+
export { Action, Errors, Payload };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const abbreviate: (number: number) => string;
|
|
2
|
+
declare const ordinal: (number: number) => string;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
abbreviate: (number: number) => string;
|
|
5
|
+
ordinal: (number: number) => string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export { abbreviate, ordinal };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ordinal = exports.abbreviate = void 0;
|
|
4
|
+
let formatter = null, suffixes = ['th', 'st', 'nd', 'rd'];
|
|
5
|
+
const abbreviate = (number) => {
|
|
6
|
+
if (formatter === null) {
|
|
7
|
+
formatter = new Intl.NumberFormat('en-GB', {
|
|
8
|
+
notation: 'compact',
|
|
9
|
+
compactDisplay: 'short'
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return formatter.format(number);
|
|
13
|
+
};
|
|
14
|
+
exports.abbreviate = abbreviate;
|
|
15
|
+
const ordinal = (number) => {
|
|
16
|
+
let value = number % 100;
|
|
17
|
+
return suffixes[(value - 20) % 10] || suffixes[value] || suffixes[0];
|
|
18
|
+
};
|
|
19
|
+
exports.ordinal = ordinal;
|
|
20
|
+
exports.default = { abbreviate, ordinal };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const subtitle: {
|
|
2
|
+
class: string;
|
|
3
|
+
};
|
|
4
|
+
declare const suptitle: {
|
|
5
|
+
class: string;
|
|
6
|
+
};
|
|
7
|
+
declare const title: {
|
|
8
|
+
class: string;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: {
|
|
11
|
+
subtitle: {
|
|
12
|
+
class: string;
|
|
13
|
+
};
|
|
14
|
+
suptitle: {
|
|
15
|
+
class: string;
|
|
16
|
+
};
|
|
17
|
+
title: {
|
|
18
|
+
class: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
export { subtitle, suptitle, title };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.title = exports.suptitle = exports.subtitle = void 0;
|
|
4
|
+
const subtitle = {
|
|
5
|
+
class: 'page-subtitle --margin-200 --text-crop-bottom'
|
|
6
|
+
};
|
|
7
|
+
exports.subtitle = subtitle;
|
|
8
|
+
const suptitle = {
|
|
9
|
+
class: 'page-suptitle --text-bold-600 --text-crop --text-uppercase --text-300'
|
|
10
|
+
};
|
|
11
|
+
exports.suptitle = suptitle;
|
|
12
|
+
const title = {
|
|
13
|
+
class: 'page-title --line-height-200 --margin-400 --text-crop'
|
|
14
|
+
};
|
|
15
|
+
exports.title = title;
|
|
16
|
+
exports.default = { subtitle, suptitle, title };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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 };
|