@esportsplus/ui 0.24.5 → 0.25.1
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/checkbox/index.d.ts +11 -0
- package/build/components/checkbox/index.js +33 -0
- package/build/components/checkbox/scss/index.scss +2 -0
- package/build/components/index.d.ts +7 -1
- package/build/components/index.js +7 -1
- package/build/components/input/index.d.ts +21 -0
- package/build/components/input/index.js +38 -0
- package/build/components/input/scss/index.scss +2 -0
- package/build/components/radio/index.d.ts +11 -0
- package/build/components/radio/index.js +33 -0
- package/build/components/radio/scss/index.scss +2 -0
- package/build/components/range/index.d.ts +21 -0
- package/build/components/range/index.js +46 -0
- package/build/components/range/scss/index.scss +2 -0
- package/build/components/select/index.d.ts +44 -0
- package/build/components/{field/select.js → select/index.js} +25 -52
- package/build/components/select/scss/index.scss +2 -0
- package/build/components/switch/index.d.ts +11 -0
- package/build/components/switch/index.js +33 -0
- package/build/components/switch/scss/index.scss +2 -0
- package/build/components/text/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +21 -0
- package/build/components/textarea/index.js +37 -0
- package/build/components/textarea/scss/index.scss +2 -0
- package/build/normalize/scss/index.scss +1 -1
- package/package.json +2 -2
- package/src/components/checkbox/index.ts +45 -0
- package/src/components/checkbox/scss/index.scss +50 -0
- package/src/components/checkbox/scss/variables.scss +72 -0
- package/src/components/index.ts +7 -1
- package/src/components/input/index.ts +52 -0
- package/src/components/input/scss/index.scss +37 -0
- package/src/components/input/scss/variables.scss +50 -0
- package/src/components/radio/index.ts +45 -0
- package/src/components/radio/scss/index.scss +50 -0
- package/src/components/radio/scss/variables.scss +67 -0
- package/src/components/range/index.ts +61 -0
- package/src/components/range/scss/index.scss +31 -0
- package/src/components/range/scss/variables.scss +8 -0
- package/src/components/{field/select.ts → select/index.ts} +50 -106
- package/src/components/select/scss/index.scss +36 -0
- package/src/components/select/scss/variables.scss +12 -0
- package/src/components/switch/index.ts +45 -0
- package/src/components/switch/scss/index.scss +48 -0
- package/src/components/switch/scss/variables.scss +72 -0
- package/src/components/text/scss/index.scss +31 -0
- package/src/components/textarea/index.ts +51 -0
- package/src/components/textarea/scss/index.scss +26 -0
- package/src/components/textarea/scss/variables.scss +49 -0
- package/src/normalize/scss/index.scss +36 -1
- package/build/components/field/checkbox.d.ts +0 -73
- package/build/components/field/checkbox.js +0 -71
- package/build/components/field/description.d.ts +0 -19
- package/build/components/field/description.js +0 -7
- package/build/components/field/error.d.ts +0 -5
- package/build/components/field/error.js +0 -13
- package/build/components/field/index.d.ts +0 -17481
- package/build/components/field/index.js +0 -10
- package/build/components/field/input.d.ts +0 -156
- package/build/components/field/input.js +0 -97
- package/build/components/field/scss/index.scss +0 -2
- package/build/components/field/select.d.ts +0 -1350
- package/build/components/field/title.d.ts +0 -1169
- package/build/components/field/title.js +0 -20
- package/src/components/field/checkbox.ts +0 -97
- package/src/components/field/description.ts +0 -11
- package/src/components/field/error.ts +0 -16
- package/src/components/field/index.ts +0 -15
- package/src/components/field/input.ts +0 -134
- package/src/components/field/scss/check.scss +0 -227
- package/src/components/field/scss/index.scss +0 -133
- package/src/components/field/scss/normalize.scss +0 -34
- package/src/components/field/scss/range.scss +0 -46
- package/src/components/field/scss/text.scss +0 -120
- package/src/components/field/scss/variables.scss +0 -128
- package/src/components/field/title.ts +0 -27
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { type Attributes, type Renderable } from '@esportsplus/template';
|
|
2
|
-
type A = Attributes & {
|
|
3
|
-
'field-mask-tag'?: Attributes;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: {
|
|
6
|
-
checkbox: {
|
|
7
|
-
(): ReturnType<(this: {
|
|
8
|
-
mask: (attributes: A, state: {
|
|
9
|
-
active: boolean;
|
|
10
|
-
}) => Renderable<unknown>;
|
|
11
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
12
|
-
<T extends Attributes>(attributes: T): ReturnType<(this: {
|
|
13
|
-
mask: (attributes: A, state: {
|
|
14
|
-
active: boolean;
|
|
15
|
-
}) => Renderable<unknown>;
|
|
16
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
17
|
-
<T extends (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>>(content: T): ReturnType<(this: {
|
|
18
|
-
mask: (attributes: A, state: {
|
|
19
|
-
active: boolean;
|
|
20
|
-
}) => Renderable<unknown>;
|
|
21
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
22
|
-
(attributes: Attributes, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>): ReturnType<(this: {
|
|
23
|
-
mask: (attributes: A, state: {
|
|
24
|
-
active: boolean;
|
|
25
|
-
}) => Renderable<unknown>;
|
|
26
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
27
|
-
};
|
|
28
|
-
radio: {
|
|
29
|
-
(): ReturnType<(this: {
|
|
30
|
-
mask: (attributes: A, state: {
|
|
31
|
-
active: boolean;
|
|
32
|
-
}) => Renderable<unknown>;
|
|
33
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
34
|
-
<T extends Attributes>(attributes: T): ReturnType<(this: {
|
|
35
|
-
mask: (attributes: A, state: {
|
|
36
|
-
active: boolean;
|
|
37
|
-
}) => Renderable<unknown>;
|
|
38
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
39
|
-
<T extends (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>>(content: T): ReturnType<(this: {
|
|
40
|
-
mask: (attributes: A, state: {
|
|
41
|
-
active: boolean;
|
|
42
|
-
}) => Renderable<unknown>;
|
|
43
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
44
|
-
(attributes: Attributes, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>): ReturnType<(this: {
|
|
45
|
-
mask: (attributes: A, state: {
|
|
46
|
-
active: boolean;
|
|
47
|
-
}) => Renderable<unknown>;
|
|
48
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
49
|
-
};
|
|
50
|
-
switch: {
|
|
51
|
-
(): ReturnType<(this: {
|
|
52
|
-
mask: (attributes: A, state: {
|
|
53
|
-
active: boolean;
|
|
54
|
-
}) => Renderable<unknown>;
|
|
55
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
56
|
-
<T extends Attributes>(attributes: T): ReturnType<(this: {
|
|
57
|
-
mask: (attributes: A, state: {
|
|
58
|
-
active: boolean;
|
|
59
|
-
}) => Renderable<unknown>;
|
|
60
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
61
|
-
<T extends (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>>(content: T): ReturnType<(this: {
|
|
62
|
-
mask: (attributes: A, state: {
|
|
63
|
-
active: boolean;
|
|
64
|
-
}) => Renderable<unknown>;
|
|
65
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
66
|
-
(attributes: Attributes, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>): ReturnType<(this: {
|
|
67
|
-
mask: (attributes: A, state: {
|
|
68
|
-
active: boolean;
|
|
69
|
-
}) => Renderable<unknown>;
|
|
70
|
-
}, attributes: Readonly<Attributes>, content: (mask: ((attributes: A) => Renderable<unknown>)) => Renderable<unknown>) => Renderable<any>>;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
export default _default;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { reactive, root } from '@esportsplus/reactivity';
|
|
2
|
-
import { html } from '@esportsplus/template';
|
|
3
|
-
import { omit } from '@esportsplus/utilities';
|
|
4
|
-
import template from '../../components/template/index.js';
|
|
5
|
-
const OMIT_FIELD = ['state'];
|
|
6
|
-
const OMIT_TAG = ['field-mask-tag'];
|
|
7
|
-
function mask(attributes, modifier, state) {
|
|
8
|
-
let a = attributes['field-mask-tag'] || {};
|
|
9
|
-
if (a.checked) {
|
|
10
|
-
state.active = true;
|
|
11
|
-
}
|
|
12
|
-
return html `
|
|
13
|
-
<div
|
|
14
|
-
class='field-mask'
|
|
15
|
-
${omit(attributes, OMIT_TAG)}
|
|
16
|
-
${{
|
|
17
|
-
class: `field-mask--${modifier}`
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
<input
|
|
21
|
-
class='field-mask-tag field-mask-tag--hidden'
|
|
22
|
-
${{
|
|
23
|
-
checked: a.checked || root(() => state.active),
|
|
24
|
-
type: modifier === 'radio' ? 'radio' : 'checkbox',
|
|
25
|
-
value: a.value || 1
|
|
26
|
-
}}
|
|
27
|
-
${a}
|
|
28
|
-
>
|
|
29
|
-
</div>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
const field = template.factory(function (attributes, content) {
|
|
33
|
-
let state = attributes?.state || reactive({
|
|
34
|
-
active: false
|
|
35
|
-
});
|
|
36
|
-
return html `
|
|
37
|
-
<label
|
|
38
|
-
class='field'
|
|
39
|
-
${omit(attributes, OMIT_FIELD)}
|
|
40
|
-
${{
|
|
41
|
-
class: () => state.active && '--active',
|
|
42
|
-
onchange: (e) => {
|
|
43
|
-
let target = e.target, type = target.type;
|
|
44
|
-
if (type !== 'checkbox' && type !== 'radio') {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
state.active = target.checked;
|
|
48
|
-
}
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
${content((attributes) => this.mask(attributes, state))}
|
|
52
|
-
</label>
|
|
53
|
-
`;
|
|
54
|
-
});
|
|
55
|
-
export default {
|
|
56
|
-
checkbox: field.bind({
|
|
57
|
-
mask: (attributes, state) => {
|
|
58
|
-
return mask(attributes, 'checkbox', state);
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
61
|
-
radio: field.bind({
|
|
62
|
-
mask: (attributes, state) => {
|
|
63
|
-
return mask(attributes, 'radio', state);
|
|
64
|
-
}
|
|
65
|
-
}),
|
|
66
|
-
switch: field.bind({
|
|
67
|
-
mask: (attributes, state) => {
|
|
68
|
-
return mask(attributes, 'switch', state);
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
(): ReturnType<(this: {
|
|
3
|
-
attributes?: import("@esportsplus/template").Attributes | undefined;
|
|
4
|
-
content?: import("@esportsplus/template").Renderable<any>;
|
|
5
|
-
}, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
|
|
6
|
-
<T extends import("@esportsplus/template").Attributes>(attributes: T): ReturnType<(this: {
|
|
7
|
-
attributes?: import("@esportsplus/template").Attributes | undefined;
|
|
8
|
-
content?: import("@esportsplus/template").Renderable<any>;
|
|
9
|
-
}, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
|
|
10
|
-
<T extends import("@esportsplus/template").Renderable<any>>(content: T): ReturnType<(this: {
|
|
11
|
-
attributes?: import("@esportsplus/template").Attributes | undefined;
|
|
12
|
-
content?: import("@esportsplus/template").Renderable<any>;
|
|
13
|
-
}, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
|
|
14
|
-
(attributes: import("@esportsplus/template").Attributes, content: import("@esportsplus/template").Renderable<any>): ReturnType<(this: {
|
|
15
|
-
attributes?: import("@esportsplus/template").Attributes | undefined;
|
|
16
|
-
content?: import("@esportsplus/template").Renderable<any>;
|
|
17
|
-
}, attributes: Readonly<import("@esportsplus/template").Attributes>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|