@esportsplus/ui 0.1.8 → 0.2.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/.editorconfig +9 -9
- package/.gitattributes +2 -2
- package/.github/dependabot.yml +23 -0
- package/.github/workflows/bump.yml +7 -0
- package/.github/workflows/publish.yml +14 -0
- package/build/components/alert/index.d.ts +1 -1
- package/build/components/alert/index.js +34 -36
- package/build/components/export/clipboard.js +1 -3
- package/build/components/export/index.js +3 -8
- package/build/components/export/json.js +1 -3
- package/build/components/field/checkbox.d.ts +1 -1
- package/build/components/field/checkbox.js +32 -37
- package/build/components/field/description.d.ts +1 -1
- package/build/components/field/description.js +4 -6
- package/build/components/field/error.d.ts +1 -1
- package/build/components/field/error.js +4 -6
- package/build/components/field/file.d.ts +1 -1
- package/build/components/field/file.js +36 -41
- package/build/components/field/index.d.ts +8 -8
- package/build/components/field/index.js +8 -13
- package/build/components/field/optional.d.ts +2 -2
- package/build/components/field/optional.js +8 -13
- package/build/components/field/select.d.ts +1 -1
- package/build/components/field/select.js +65 -70
- package/build/components/field/switch.d.ts +1 -1
- package/build/components/field/switch.js +3 -8
- package/build/components/field/text.d.ts +1 -1
- package/build/components/field/text.js +37 -42
- package/build/components/field/textarea.d.ts +1 -1
- package/build/components/field/textarea.js +3 -8
- package/build/components/field/title.d.ts +1 -1
- package/build/components/field/title.js +14 -19
- package/build/components/form/action.js +7 -13
- package/build/components/form/index.d.ts +1 -1
- package/build/components/form/index.js +4 -9
- package/build/components/form/input.js +1 -3
- package/build/components/form/layout.d.ts +1 -1
- package/build/components/form/layout.js +11 -13
- package/build/components/form/types.d.ts +1 -1
- package/build/components/form/types.js +1 -2
- package/build/components/number/index.js +2 -6
- package/build/components/page/index.js +2 -7
- package/build/components/root/index.js +3 -9
- package/build/components/root/onclick.js +1 -3
- package/build/components/scrollbar/index.d.ts +3 -3
- package/build/components/scrollbar/index.js +13 -15
- package/build/components/site/index.d.ts +1 -1
- package/build/components/site/index.js +10 -15
- package/build/components/tooltip/index.d.ts +5 -5
- package/build/components/tooltip/index.js +8 -13
- package/build/components/tooltip/menu.d.ts +1 -1
- package/build/components/tooltip/menu.js +34 -36
- package/build/index.js +11 -27
- package/lib.scss +1 -1
- package/package.json +25 -25
- package/src/components/accordion/scss/index.scss +16 -16
- package/src/components/accordion/scss/variables.scss +4 -4
- package/src/components/alert/index.ts +156 -156
- package/src/components/alert/scss/index.scss +54 -54
- package/src/components/alert/scss/variables.scss +8 -8
- package/src/components/anchor/scss/index.scss +41 -41
- package/src/components/anchor/scss/variables.scss +5 -5
- package/src/components/banner/scss/index.scss +40 -40
- package/src/components/banner/scss/variables.scss +5 -5
- package/src/components/border/scss/index.scss +10 -10
- package/src/components/border/scss/variables.scss +6 -6
- package/src/components/bubble/scss/index.scss +30 -30
- package/src/components/bubble/scss/variables.scss +19 -19
- package/src/components/button/scss/index.scss +92 -92
- package/src/components/button/scss/variables.scss +69 -69
- package/src/components/card/scss/index.scss +35 -35
- package/src/components/card/scss/variables.scss +42 -42
- package/src/components/container/scss/index.scss +10 -10
- package/src/components/container/scss/variables.scss +5 -5
- package/src/components/ellipsis/scss/index.scss +71 -71
- package/src/components/ellipsis/scss/variables.scss +2 -2
- package/src/components/export/clipboard.ts +11 -11
- package/src/components/export/index.ts +4 -4
- package/src/components/export/json.ts +14 -14
- package/src/components/field/checkbox.ts +60 -60
- package/src/components/field/description.ts +11 -11
- package/src/components/field/error.ts +13 -13
- package/src/components/field/file.ts +64 -64
- package/src/components/field/index.ts +9 -9
- package/src/components/field/optional.ts +26 -26
- package/src/components/field/scss/_check.scss +225 -225
- package/src/components/field/scss/_normalize.scss +36 -36
- package/src/components/field/scss/_text.scss +106 -106
- package/src/components/field/scss/index.scss +158 -158
- package/src/components/field/scss/variables.scss +138 -138
- package/src/components/field/select.ts +150 -150
- package/src/components/field/switch.ts +8 -8
- package/src/components/field/text.ts +68 -68
- package/src/components/field/textarea.ts +7 -7
- package/src/components/field/title.ts +22 -22
- package/src/components/form/action.ts +67 -67
- package/src/components/form/index.ts +5 -5
- package/src/components/form/input.ts +14 -14
- package/src/components/form/layout.ts +25 -25
- package/src/components/form/types.ts +15 -15
- package/src/components/group/scss/index.scss +36 -36
- package/src/components/group/scss/variables.scss +17 -17
- package/src/components/icon/scss/index.scss +17 -17
- package/src/components/icon/scss/variables.scss +7 -7
- package/src/components/link/scss/index.scss +28 -28
- package/src/components/link/scss/variables.scss +47 -47
- package/src/components/loading/scss/index.scss +24 -24
- package/src/components/loading/scss/variables.scss +31 -31
- package/src/components/modal/scss/index.scss +31 -31
- package/src/components/modal/scss/variables.scss +10 -10
- package/src/components/number/index.ts +23 -23
- package/src/components/page/index.ts +14 -14
- package/src/components/page/scss/index.scss +27 -27
- package/src/components/page/scss/variables.scss +27 -27
- package/src/components/processing/scss/index.scss +46 -46
- package/src/components/processing/scss/variables.scss +11 -11
- package/src/components/root/index.ts +4 -4
- package/src/components/root/onclick.ts +20 -20
- package/src/components/root/scss/index.scss +93 -93
- package/src/components/root/scss/variables.scss +55 -55
- package/src/components/row/scss/index.scss +7 -7
- package/src/components/scrollbar/index.ts +43 -43
- package/src/components/scrollbar/scss/index.scss +59 -59
- package/src/components/scrollbar/scss/variables.scss +6 -6
- package/src/components/sidebar/scss/index.scss +50 -50
- package/src/components/sidebar/scss/variables.scss +21 -21
- package/src/components/site/index.ts +26 -26
- package/src/components/site/scss/index.scss +3 -3
- package/src/components/text/scss/index.scss +12 -12
- package/src/components/text/scss/variables.scss +9 -9
- package/src/components/thumbnail/scss/index.scss +7 -7
- package/src/components/thumbnail/scss/variables.scss +7 -7
- package/src/components/tooltip/index.ts +93 -93
- package/src/components/tooltip/menu.ts +70 -70
- package/src/components/tooltip/scss/_center.scss +13 -13
- package/src/components/tooltip/scss/_east.scss +34 -34
- package/src/components/tooltip/scss/_north.scss +34 -34
- package/src/components/tooltip/scss/_south.scss +35 -35
- package/src/components/tooltip/scss/_west.scss +34 -34
- package/src/components/tooltip/scss/index.scss +93 -93
- package/src/components/tooltip/scss/variables.scss +25 -25
- package/src/css-utilities/[margin,padding]/scss/index.scss +41 -41
- package/src/css-utilities/[margin,padding]/scss/variables.scss +54 -54
- package/src/css-utilities/absolute/scss/index.scss +59 -59
- package/src/css-utilities/background/scss/variables.scss +27 -27
- package/src/css-utilities/border/scss/index.scss +21 -21
- package/src/css-utilities/border/scss/variables.scss +66 -66
- package/src/css-utilities/color/scss/variables.scss +31 -31
- package/src/css-utilities/disabled/scss/index.scss +4 -4
- package/src/css-utilities/flex/scss/index.scss +65 -65
- package/src/css-utilities/glass/scss/index.scss +2 -2
- package/src/css-utilities/glass/scss/variables.scss +2 -2
- package/src/css-utilities/hidden/scss/index.scss +28 -28
- package/src/css-utilities/index.scss +14 -14
- package/src/css-utilities/inline/scss/index.scss +7 -7
- package/src/css-utilities/line-height/scss/variables.scss +10 -10
- package/src/css-utilities/not-allowed/scss/index.scss +7 -7
- package/src/css-utilities/overflow/scss/index.scss +4 -4
- package/src/css-utilities/pointer/scss/index.scss +5 -5
- package/src/css-utilities/size/scss/variables.scss +12 -12
- package/src/css-utilities/slide/scss/index.scss +21 -21
- package/src/css-utilities/slide/scss/variables.scss +10 -10
- package/src/css-utilities/text/scss/index.scss +93 -93
- package/src/css-utilities/text/scss/variables.scss +31 -31
- package/src/css-utilities/transition/scss/variables.scss +14 -14
- package/src/css-utilities/viewport/scss/index.scss +4 -4
- package/src/css-utilities/width/scss/index.scss +3 -3
- package/src/css-utilities/width/scss/variables.scss +9 -9
- package/src/index.ts +11 -11
- package/src/lib/index.scss +7 -7
- package/src/lib/scss/breakpoint.scss +41 -41
- package/src/lib/scss/color.scss +1 -1
- package/src/lib/scss/css-variables.scss +13 -13
- package/src/lib/scss/list.scss +76 -76
- package/src/lib/scss/map.scss +1 -1
- package/src/lib/scss/position.scss +77 -77
- package/src/lib/scss/string.scss +33 -33
- package/src/tokens/index.scss +11 -11
- package/src/tokens/scss/border-radius.scss +12 -12
- package/src/tokens/scss/border-width.scss +6 -6
- package/src/tokens/scss/box-shadow.scss +13 -13
- package/src/tokens/scss/color.scss +64 -64
- package/src/tokens/scss/font-size.scss +12 -12
- package/src/tokens/scss/font-weight.scss +6 -6
- package/src/tokens/scss/line-height.scss +6 -6
- package/src/tokens/scss/size.scss +13 -13
- package/src/tokens/scss/spacer.scss +8 -8
- package/src/tokens/scss/state.scss +86 -86
- package/src/tokens/scss/transition-duration.scss +5 -5
- package/storage/fonts/montserrat/index.css +79 -79
- package/tokens.scss +1 -1
- package/tsconfig.json +10 -10
- package/utilities/styles.css +1 -1
- package/utilities/variables.css +1 -1
- package/webpack.config.ts +25 -25
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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"));
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import form from '../../components/form';
|
|
4
|
+
import scrollbar from '../../components/scrollbar';
|
|
5
|
+
import root from '../../components/root';
|
|
6
|
+
import description from './description';
|
|
7
|
+
import error from './error';
|
|
8
|
+
import title from './title';
|
|
14
9
|
function parse(keys, selected) {
|
|
15
10
|
let options = {};
|
|
16
11
|
for (let key of keys) {
|
|
@@ -23,17 +18,17 @@ function parse(keys, selected) {
|
|
|
23
18
|
};
|
|
24
19
|
}
|
|
25
20
|
function template(data, state) {
|
|
26
|
-
let { attributes: a, html: h } = (
|
|
21
|
+
let { attributes: a, html: h } = scrollbar({
|
|
27
22
|
fixed: true,
|
|
28
23
|
style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
29
24
|
});
|
|
30
|
-
return
|
|
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'
|
|
25
|
+
return html `
|
|
26
|
+
<div
|
|
27
|
+
class='tooltip-content tooltip-content--${data?.tooltip?.direction || 's'} ${data?.tooltip?.class || ''} --flex-column --width-full'
|
|
28
|
+
style='${data?.tooltip?.style || ''}'
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
class='row --flex-column'
|
|
37
32
|
onclick='${(e) => {
|
|
38
33
|
let key = e?.target?.dataset?.key;
|
|
39
34
|
if (key === undefined) {
|
|
@@ -46,65 +41,65 @@ function template(data, state) {
|
|
|
46
41
|
if (data.effect) {
|
|
47
42
|
data.effect(key);
|
|
48
43
|
}
|
|
49
|
-
}}'
|
|
50
|
-
${a}
|
|
51
|
-
>
|
|
52
|
-
${Object.keys(data.options || {}).map((key) =>
|
|
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>
|
|
44
|
+
}}'
|
|
45
|
+
${a}
|
|
46
|
+
>
|
|
47
|
+
${Object.keys(data.options || {}).map((key) => html `
|
|
48
|
+
<div
|
|
49
|
+
class='link ${data?.option?.class || ''} ${() => state.options[key] ? '--active' : ''} --flex-vertical' data-key='${key}'
|
|
50
|
+
style='${data?.option?.style || ''}'
|
|
51
|
+
>
|
|
52
|
+
<span class="--text-truncate">
|
|
53
|
+
${data.options[key]}
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
`)}
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
${h}
|
|
60
|
+
</div>
|
|
66
61
|
`;
|
|
67
62
|
}
|
|
68
|
-
|
|
69
|
-
let state =
|
|
63
|
+
export default (data) => {
|
|
64
|
+
let state = reactive(Object.assign({
|
|
70
65
|
active: false,
|
|
71
66
|
error: '',
|
|
72
67
|
render: false,
|
|
73
68
|
}, parse(Object.keys(data.options || {}), data.selected)));
|
|
74
|
-
return
|
|
75
|
-
<div class="field tooltip ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column" style='${data?.style || ''}'>
|
|
76
|
-
${(
|
|
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"
|
|
69
|
+
return html `
|
|
70
|
+
<div class="field tooltip ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column" style='${data?.style || ''}'>
|
|
71
|
+
${title(data)}
|
|
72
|
+
|
|
73
|
+
<label
|
|
74
|
+
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
75
|
onclick='${() => {
|
|
81
76
|
state.render = true;
|
|
82
77
|
state.active = !state.active;
|
|
83
78
|
if (state.active) {
|
|
84
|
-
|
|
79
|
+
root.onclick.add(() => state.active = false);
|
|
85
80
|
}
|
|
86
|
-
}}'
|
|
87
|
-
style='${data?.mask?.style || ''}'
|
|
88
|
-
>
|
|
89
|
-
<input
|
|
90
|
-
class='field-tag field-tag--hidden'
|
|
91
|
-
name='${data.name}'
|
|
92
|
-
onclick='${() => { }}'
|
|
93
|
-
onrender='${
|
|
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
|
-
${(
|
|
107
|
-
${(
|
|
108
|
-
</div>
|
|
81
|
+
}}'
|
|
82
|
+
style='${data?.mask?.style || ''}'
|
|
83
|
+
>
|
|
84
|
+
<input
|
|
85
|
+
class='field-tag field-tag--hidden'
|
|
86
|
+
name='${data.name}'
|
|
87
|
+
onclick='${() => { }}'
|
|
88
|
+
onrender='${form.input.attributes(state)}'
|
|
89
|
+
value='${() => state.selected}'
|
|
90
|
+
>
|
|
91
|
+
|
|
92
|
+
<div class="field-text ${data?.text?.class || ''}" style='pointer-events: none'>
|
|
93
|
+
${() => data.options[state.selected] || '-'}
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class='field-mask-arrow'></div>
|
|
97
|
+
|
|
98
|
+
${() => state.render ? template(data, state) : ''}
|
|
99
|
+
</label>
|
|
100
|
+
|
|
101
|
+
${description(data)}
|
|
102
|
+
${error(state)}
|
|
103
|
+
</div>
|
|
109
104
|
`;
|
|
110
105
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import checkbox from './checkbox';
|
|
2
|
-
declare const _default: (data: Parameters<typeof checkbox>[0]) => import("@esportsplus/template
|
|
2
|
+
declare const _default: (data: Parameters<typeof checkbox>[0]) => import("@esportsplus/template").Renderable;
|
|
3
3
|
export default _default;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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) => {
|
|
1
|
+
import checkbox from './checkbox';
|
|
2
|
+
export default (data) => {
|
|
8
3
|
data.mask = data.mask || {};
|
|
9
4
|
data.mask.class = `field-mask--switch ${data.mask?.class || ''}`;
|
|
10
|
-
return (
|
|
5
|
+
return checkbox(data);
|
|
11
6
|
};
|
|
@@ -17,5 +17,5 @@ type Data = {
|
|
|
17
17
|
type?: string;
|
|
18
18
|
value?: unknown;
|
|
19
19
|
} & Parameters<typeof description>[0] & Parameters<typeof title>[0];
|
|
20
|
-
declare const _default: (data: Data) => import("@esportsplus/template
|
|
20
|
+
declare const _default: (data: Data) => import("@esportsplus/template").Renderable;
|
|
21
21
|
export default _default;
|
|
@@ -1,51 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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)({
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import form from '../../components/form';
|
|
4
|
+
import description from './description';
|
|
5
|
+
import error from './error';
|
|
6
|
+
import title from './title';
|
|
7
|
+
export default (data) => {
|
|
8
|
+
let state = reactive({
|
|
14
9
|
active: false,
|
|
15
10
|
error: ''
|
|
16
11
|
});
|
|
17
|
-
return
|
|
18
|
-
<div
|
|
19
|
-
class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
|
|
12
|
+
return html `
|
|
13
|
+
<div
|
|
14
|
+
class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
|
|
20
15
|
onfocusin='${() => {
|
|
21
16
|
state.active = true;
|
|
22
|
-
}}'
|
|
17
|
+
}}'
|
|
23
18
|
onfocusout='${() => {
|
|
24
19
|
state.active = false;
|
|
25
|
-
}}'
|
|
26
|
-
style='${data?.style || ''}'
|
|
27
|
-
>
|
|
28
|
-
${(
|
|
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='${
|
|
39
|
-
type='${data?.type || 'string'}'
|
|
40
|
-
${!data?.textarea && data?.value !== undefined ?
|
|
41
|
-
>
|
|
42
|
-
${data?.textarea ?
|
|
43
|
-
|
|
44
|
-
${data?.mask?.content || ''}
|
|
45
|
-
</label>
|
|
46
|
-
|
|
47
|
-
${(
|
|
48
|
-
${(
|
|
49
|
-
</div>
|
|
20
|
+
}}'
|
|
21
|
+
style='${data?.style || ''}'
|
|
22
|
+
>
|
|
23
|
+
${title(data)}
|
|
24
|
+
|
|
25
|
+
<label
|
|
26
|
+
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) ? '--margin-top' : ''} --margin-300'
|
|
27
|
+
style='${data?.mask?.style || ''}'
|
|
28
|
+
>
|
|
29
|
+
<${data?.textarea ? 'textarea' : 'input'}
|
|
30
|
+
class='field-tag --padding-400 ${data?.tag?.class || ''}'
|
|
31
|
+
name='${data?.name || ''}'
|
|
32
|
+
placeholder='${data?.placeholder || ''}'
|
|
33
|
+
onrender='${form.input.attributes(state)}'
|
|
34
|
+
type='${data?.type || 'string'}'
|
|
35
|
+
${!data?.textarea && data?.value !== undefined ? html `value='${data.value}'` : ''}
|
|
36
|
+
>
|
|
37
|
+
${data?.textarea ? html `${data?.value || ''}</textarea>` : ''}
|
|
38
|
+
|
|
39
|
+
${data?.mask?.content || ''}
|
|
40
|
+
</label>
|
|
41
|
+
|
|
42
|
+
${description(data)}
|
|
43
|
+
${error(state)}
|
|
44
|
+
</div>
|
|
50
45
|
`;
|
|
51
46
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import text from './text';
|
|
2
|
-
declare const _default: (data: Parameters<typeof text>[0]) => import("@esportsplus/template
|
|
2
|
+
declare const _default: (data: Parameters<typeof text>[0]) => import("@esportsplus/template").Renderable;
|
|
3
3
|
export default _default;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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) => {
|
|
1
|
+
import text from './text';
|
|
2
|
+
export default (data) => {
|
|
8
3
|
data.textarea = true;
|
|
9
|
-
return (
|
|
4
|
+
return text(data);
|
|
10
5
|
};
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) => {
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
import tooltip from '../../components/tooltip';
|
|
3
|
+
export default (data) => {
|
|
9
4
|
if (!data?.title) {
|
|
10
5
|
return '';
|
|
11
6
|
}
|
|
12
|
-
let { attributes } =
|
|
13
|
-
return
|
|
14
|
-
<div class="field-title --flex-horizontal-space-between --flex-vertical">
|
|
15
|
-
${data.title}
|
|
16
|
-
|
|
17
|
-
${data?.required &&
|
|
18
|
-
<div class="bubble --background-primary --margin-left" ${attributes}>
|
|
19
|
-
<span class="tooltip-message tooltip-message--w">Required</span>
|
|
20
|
-
</div>
|
|
21
|
-
`}
|
|
22
|
-
</div>
|
|
7
|
+
let { attributes } = tooltip.onhover();
|
|
8
|
+
return html `
|
|
9
|
+
<div class="field-title --flex-horizontal-space-between --flex-vertical">
|
|
10
|
+
${data.title}
|
|
11
|
+
|
|
12
|
+
${data?.required && html `
|
|
13
|
+
<div class="bubble --background-primary --margin-left" ${attributes}>
|
|
14
|
+
<span class="tooltip-message tooltip-message--w">Required</span>
|
|
15
|
+
</div>
|
|
16
|
+
`}
|
|
17
|
+
</div>
|
|
23
18
|
`;
|
|
24
19
|
};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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"));
|
|
1
|
+
import response from '@esportsplus/action';
|
|
2
|
+
import alert from '../../components/alert';
|
|
3
|
+
import input from './input';
|
|
9
4
|
function parse(input) {
|
|
10
5
|
let data = {};
|
|
11
6
|
for (let path in input) {
|
|
@@ -18,7 +13,7 @@ function parse(input) {
|
|
|
18
13
|
return data;
|
|
19
14
|
}
|
|
20
15
|
;
|
|
21
|
-
function
|
|
16
|
+
export default function (action) {
|
|
22
17
|
return {
|
|
23
18
|
onclick: function (event) {
|
|
24
19
|
let trigger = event.target;
|
|
@@ -32,12 +27,12 @@ function default_1(action) {
|
|
|
32
27
|
event.preventDefault();
|
|
33
28
|
event?.submitter?.classList.add('button--processing');
|
|
34
29
|
let { errors } = await action({
|
|
35
|
-
alert
|
|
30
|
+
alert,
|
|
36
31
|
input: parse(Object.fromEntries(new FormData(this)?.entries())),
|
|
37
|
-
response
|
|
32
|
+
response
|
|
38
33
|
});
|
|
39
34
|
for (let i = 0, n = errors.length; i < n; i++) {
|
|
40
|
-
let { message, path } = errors[i], state =
|
|
35
|
+
let { message, path } = errors[i], state = input.get(this[path]);
|
|
41
36
|
if (!state) {
|
|
42
37
|
continue;
|
|
43
38
|
}
|
|
@@ -47,5 +42,4 @@ function default_1(action) {
|
|
|
47
42
|
}
|
|
48
43
|
};
|
|
49
44
|
}
|
|
50
|
-
exports.default = default_1;
|
|
51
45
|
;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 };
|
|
1
|
+
import action from './action';
|
|
2
|
+
import input from './input';
|
|
3
|
+
import layout from './layout';
|
|
4
|
+
export default { action, input, layout };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
let cache = new WeakMap();
|
|
4
2
|
const attributes = (reactive) => {
|
|
5
3
|
return (element) => {
|
|
@@ -9,4 +7,4 @@ const attributes = (reactive) => {
|
|
|
9
7
|
const get = (element) => {
|
|
10
8
|
return element ? cache.get(element) : undefined;
|
|
11
9
|
};
|
|
12
|
-
|
|
10
|
+
export default { attributes, get };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
${data?.content
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
` : ''}
|
|
13
|
-
</form>
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
export default (data) => html `
|
|
3
|
+
<form class='${data?.class}' ${data?.action || ''}>
|
|
4
|
+
${data?.content || ''}
|
|
5
|
+
|
|
6
|
+
${data?.button?.content ? html `
|
|
7
|
+
<button class="button ${data?.button?.class || ''}" style='${data?.button?.style || ''}'>
|
|
8
|
+
${data?.button?.content || ''}
|
|
9
|
+
</button>
|
|
10
|
+
` : ''}
|
|
11
|
+
</form>
|
|
14
12
|
`;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ordinal = exports.abbreviate = void 0;
|
|
4
1
|
let formatter = null, suffixes = ['th', 'st', 'nd', 'rd'];
|
|
5
2
|
const abbreviate = (number) => {
|
|
6
3
|
if (formatter === null) {
|
|
@@ -11,10 +8,9 @@ const abbreviate = (number) => {
|
|
|
11
8
|
}
|
|
12
9
|
return formatter.format(number);
|
|
13
10
|
};
|
|
14
|
-
exports.abbreviate = abbreviate;
|
|
15
11
|
const ordinal = (number) => {
|
|
16
12
|
let value = number % 100;
|
|
17
13
|
return suffixes[(value - 20) % 10] || suffixes[value] || suffixes[0];
|
|
18
14
|
};
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export default { abbreviate, ordinal };
|
|
16
|
+
export { abbreviate, ordinal };
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.title = exports.suptitle = exports.subtitle = void 0;
|
|
4
1
|
const subtitle = {
|
|
5
2
|
class: 'page-subtitle --margin-200 --text-crop-bottom'
|
|
6
3
|
};
|
|
7
|
-
exports.subtitle = subtitle;
|
|
8
4
|
const suptitle = {
|
|
9
5
|
class: 'page-suptitle --text-bold-600 --text-crop --text-uppercase --text-300'
|
|
10
6
|
};
|
|
11
|
-
exports.suptitle = suptitle;
|
|
12
7
|
const title = {
|
|
13
8
|
class: 'page-title --line-height-200 --margin-400 --text-crop'
|
|
14
9
|
};
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export default { subtitle, suptitle, title };
|
|
11
|
+
export { subtitle, suptitle, title };
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 };
|
|
1
|
+
import onclick from './onclick';
|
|
2
|
+
export default { onclick };
|
|
3
|
+
export { onclick };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
let queue = [];
|
|
4
2
|
const onclick = async () => {
|
|
5
3
|
if (queue.length === 0) {
|
|
@@ -13,4 +11,4 @@ const onclick = async () => {
|
|
|
13
11
|
onclick.add = (fn) => {
|
|
14
12
|
queue.push(fn);
|
|
15
13
|
};
|
|
16
|
-
|
|
14
|
+
export default onclick;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare const _default: ({ fixed, style }?: {
|
|
2
|
-
fixed?: boolean
|
|
3
|
-
style?: string
|
|
2
|
+
fixed?: boolean;
|
|
3
|
+
style?: string;
|
|
4
4
|
}) => {
|
|
5
5
|
attributes: {
|
|
6
6
|
class: () => string;
|
|
7
7
|
onscroll: (this: HTMLElement) => void;
|
|
8
8
|
};
|
|
9
|
-
html: import("@esportsplus/template
|
|
9
|
+
html: import("@esportsplus/template").Renderable;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const reactivity_1 = require("@esportsplus/reactivity");
|
|
4
|
-
const template_1 = require("@esportsplus/template");
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
5
3
|
let root = document.body, width;
|
|
6
|
-
|
|
7
|
-
let state =
|
|
4
|
+
export default ({ fixed, style } = {}) => {
|
|
5
|
+
let state = reactive({
|
|
8
6
|
height: 100,
|
|
9
7
|
translate: 0
|
|
10
8
|
});
|
|
@@ -24,15 +22,15 @@ exports.default = ({ fixed, style } = {}) => {
|
|
|
24
22
|
state.translate = (this.scrollTop / this.clientHeight) * 100;
|
|
25
23
|
}
|
|
26
24
|
},
|
|
27
|
-
html:
|
|
28
|
-
<div
|
|
29
|
-
class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
|
|
30
|
-
style='${() => `
|
|
31
|
-
${style || ''}
|
|
32
|
-
--translate: translate3d(0, ${state.translate}%, 0);
|
|
33
|
-
--height: ${state.height}%;
|
|
34
|
-
`}'
|
|
35
|
-
></div>
|
|
25
|
+
html: html `
|
|
26
|
+
<div
|
|
27
|
+
class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
|
|
28
|
+
style='${() => `
|
|
29
|
+
${style || ''}
|
|
30
|
+
--translate: translate3d(0, ${state.translate}%, 0);
|
|
31
|
+
--height: ${state.height}%;
|
|
32
|
+
`}'
|
|
33
|
+
></div>
|
|
36
34
|
`
|
|
37
35
|
};
|
|
38
36
|
};
|