x4js 2.0.11 → 2.0.13
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/README.md +15 -15
- package/lib/README.txt +15 -15
- package/lib/cjs/x4.css +1 -1
- package/lib/cjs/x4.js +1 -1
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +1 -1
- package/lib/src/components/base.scss +25 -26
- package/lib/src/components/boxes/boxes.module.scss +37 -37
- package/lib/src/components/boxes/boxes.ts +129 -125
- package/lib/src/components/breadcrumb/breadcrumb.scss +28 -0
- package/lib/src/components/breadcrumb/breadcrumb.ts +84 -0
- package/lib/src/components/breadcrumb/chevron-right.svg +1 -0
- package/lib/src/components/btngroup/btngroup.module.scss +28 -28
- package/lib/src/components/btngroup/btngroup.ts +119 -101
- package/lib/src/components/button/button.module.scss +154 -153
- package/lib/src/components/button/button.ts +117 -117
- package/lib/src/components/calendar/calendar.module.scss +162 -162
- package/lib/src/components/calendar/calendar.ts +326 -325
- package/lib/src/components/checkbox/check.svg +3 -3
- package/lib/src/components/checkbox/checkbox.module.scss +141 -141
- package/lib/src/components/checkbox/checkbox.ts +125 -124
- package/lib/src/components/colorinput/colorinput.module.scss +64 -64
- package/lib/src/components/colorinput/colorinput.ts +90 -87
- package/lib/src/components/colorpicker/colorpicker.module.scss +132 -132
- package/lib/src/components/colorpicker/colorpicker.ts +481 -476
- package/lib/src/components/combobox/combobox.module.scss +123 -120
- package/lib/src/components/combobox/combobox.ts +192 -190
- package/lib/src/components/combobox/updown.svg +3 -3
- package/lib/src/components/components.ts +34 -0
- package/lib/src/components/dialog/dialog.module.scss +71 -71
- package/lib/src/components/dialog/dialog.ts +94 -92
- package/lib/src/components/form/form.module.scss +34 -34
- package/lib/src/components/form/form.ts +41 -36
- package/lib/src/components/grid/datastore.ts +1298 -0
- package/lib/src/components/grid/gridview.ts +1108 -0
- package/lib/src/components/grid/memdb.ts +325 -0
- package/lib/src/components/header/header.module.scss +39 -39
- package/lib/src/components/header/header.ts +129 -123
- package/lib/src/components/icon/icon.module.scss +29 -29
- package/lib/src/components/icon/icon.ts +136 -134
- package/lib/src/components/image/image.module.scss +20 -20
- package/lib/src/components/image/image.ts +68 -66
- package/lib/src/components/input/input.module.scss +69 -69
- package/lib/src/components/input/input.ts +275 -274
- package/lib/src/components/label/label.module.scss +58 -52
- package/lib/src/components/label/label.ts +64 -55
- package/lib/src/components/link/link.ts +78 -0
- package/lib/src/components/listbox/listbox.module.scss +103 -103
- package/lib/src/components/listbox/listbox.ts +431 -427
- package/lib/src/components/menu/menu.module.scss +107 -107
- package/lib/src/components/menu/menu.ts +171 -168
- package/lib/src/components/messages/messages.module.scss +48 -47
- package/lib/src/components/messages/messages.ts +68 -63
- package/lib/src/components/normalize.scss +386 -386
- package/lib/src/components/notification/notification.module.scss +81 -81
- package/lib/src/components/notification/notification.ts +109 -108
- package/lib/src/components/panel/panel.module.scss +47 -47
- package/lib/src/components/panel/panel.ts +57 -56
- package/lib/src/components/popup/popup.module.scss +43 -43
- package/lib/src/components/popup/popup.ts +396 -395
- package/lib/src/components/progress/progress.module.scss +56 -56
- package/lib/src/components/progress/progress.ts +43 -42
- package/lib/src/components/rating/rating.module.scss +22 -22
- package/lib/src/components/rating/rating.ts +131 -125
- package/lib/src/components/shared.scss +90 -76
- package/lib/src/components/sizers/sizer.module.scss +89 -89
- package/lib/src/components/sizers/sizer.ts +123 -119
- package/lib/src/components/slider/slider.module.scss +70 -70
- package/lib/src/components/slider/slider.ts +147 -142
- package/lib/src/components/switch/switch.module.scss +126 -126
- package/lib/src/components/switch/switch.ts +61 -55
- package/lib/src/components/tabs/tabs.module.scss +46 -46
- package/lib/src/components/tabs/tabs.ts +168 -157
- package/lib/src/components/textarea/textarea.module.scss +59 -59
- package/lib/src/components/textarea/textarea.ts +60 -54
- package/lib/src/components/textedit/textedit.module.scss +113 -113
- package/lib/src/components/textedit/textedit.ts +83 -82
- package/lib/src/components/themes.scss +81 -77
- package/lib/src/components/tooltips/tooltips.scss +50 -50
- package/lib/src/components/tooltips/tooltips.ts +103 -102
- package/lib/src/components/treeview/treeview.module.scss +115 -115
- package/lib/src/components/treeview/treeview.ts +410 -403
- package/lib/src/components/viewport/viewport.module.scss +24 -24
- package/lib/src/components/viewport/viewport.ts +41 -38
- package/lib/src/core/component.ts +1002 -979
- package/lib/src/core/core_application.ts +44 -0
- package/lib/src/core/core_colors.ts +249 -249
- package/lib/src/core/core_dom.ts +471 -471
- package/lib/src/core/core_dragdrop.ts +200 -200
- package/lib/src/core/core_element.ts +97 -97
- package/lib/src/core/core_events.ts +149 -149
- package/lib/src/core/core_i18n.ts +377 -377
- package/lib/src/core/core_router.ts +221 -221
- package/lib/src/core/core_styles.ts +214 -214
- package/lib/src/core/core_svg.ts +550 -550
- package/lib/src/core/core_tools.ts +688 -673
- package/lib/src/demo/assets/radio.svg +3 -3
- package/lib/src/demo/index.html +11 -11
- package/lib/src/demo/main.scss +21 -21
- package/lib/src/demo/main.tsx +323 -323
- package/lib/src/types/scss.d.ts +4 -4
- package/lib/src/types/x4react.d.ts +8 -8
- package/lib/src/x4.scss +18 -18
- package/lib/src/x4.ts +31 -60
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +100 -49
- package/package.json +2 -3
- package/src/x4.ts +31 -60
- package/lib/output.d.ts +0 -1472
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file icon.module.scss
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Use of this source code is governed by an MIT-style license
|
|
14
|
-
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
-
**/
|
|
16
|
-
|
|
17
|
-
@use "../shared.scss";
|
|
18
|
-
|
|
19
|
-
.x4icon {
|
|
20
|
-
@extend .hbox;
|
|
21
|
-
|
|
22
|
-
min-width: 10px;
|
|
23
|
-
height: 10px;
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
|
|
26
|
-
svg {
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 100%;
|
|
29
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file icon.module.scss
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
@use "../shared.scss";
|
|
18
|
+
|
|
19
|
+
.x4icon {
|
|
20
|
+
@extend .hbox;
|
|
21
|
+
|
|
22
|
+
min-width: 10px;
|
|
23
|
+
height: 10px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
|
|
26
|
+
svg {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
}
|
|
30
30
|
}
|
|
@@ -1,134 +1,136 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file icon.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Use of this source code is governed by an MIT-style license
|
|
14
|
-
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
-
**/
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
ww
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file icon.ts
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
import { class_ns } from '@core/core_tools.js';
|
|
18
|
+
import { Component, ComponentProps } from '../../core/component';
|
|
19
|
+
|
|
20
|
+
import "./icon.module.scss"
|
|
21
|
+
|
|
22
|
+
type solveCallback = (data:string)=>void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
class SvgLoader {
|
|
29
|
+
private cache: Map<string,string>;
|
|
30
|
+
private waiters: Map<string,solveCallback[]>;
|
|
31
|
+
|
|
32
|
+
constructor( ) {
|
|
33
|
+
this.cache = new Map( );
|
|
34
|
+
this.waiters = new Map( );
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async load( file: string ): Promise<string> {
|
|
38
|
+
|
|
39
|
+
if( this.cache.has(file) ) {
|
|
40
|
+
return Promise.resolve( this.cache.get(file) );
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return new Promise( (resolve,reject) => {
|
|
44
|
+
if( this.waiters.has(file) ) {
|
|
45
|
+
this.waiters.get(file).push( resolve );
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.waiters.set( file, [resolve] );
|
|
49
|
+
this._load( file )
|
|
50
|
+
.then( ( data: string ) => {
|
|
51
|
+
console.timeEnd( file );
|
|
52
|
+
this.cache.set( file, data );
|
|
53
|
+
const ww = this.waiters.get( file );
|
|
54
|
+
ww.forEach( cb => cb(data ) );
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private async _load( file: string ): Promise<string> {
|
|
61
|
+
console.time( file );
|
|
62
|
+
const res = await fetch( file );
|
|
63
|
+
if( res.ok ) {
|
|
64
|
+
return res.text( );
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const svgLoader = new SvgLoader( );
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
export interface IconProps extends ComponentProps {
|
|
77
|
+
iconId?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
@class_ns( "x4" )
|
|
85
|
+
export class Icon extends Component<IconProps> {
|
|
86
|
+
|
|
87
|
+
constructor( props: IconProps ) {
|
|
88
|
+
super( props );
|
|
89
|
+
|
|
90
|
+
this.setIcon( props.iconId );
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* change the icon content
|
|
95
|
+
* @param iconId if name is starting with var: then we use css variable name a path
|
|
96
|
+
* @example
|
|
97
|
+
*
|
|
98
|
+
* setIcon( "var:home" )
|
|
99
|
+
*
|
|
100
|
+
* import myicon from "./myicon.svg"
|
|
101
|
+
* setIcon( myicon );
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
setIcon( iconId: string ) {
|
|
106
|
+
if( iconId ) {
|
|
107
|
+
if( iconId.startsWith('var:') ) {
|
|
108
|
+
do {
|
|
109
|
+
const path = iconId.substring( 4 );
|
|
110
|
+
iconId = document.documentElement.style.getPropertyValue( path );
|
|
111
|
+
} while( iconId.startsWith('var:') );
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if( iconId.startsWith("data:image/svg+xml,<svg") ) {
|
|
115
|
+
this.dom.insertAdjacentHTML('beforeend', iconId.substring(19) );
|
|
116
|
+
}
|
|
117
|
+
else if( iconId.endsWith(".svg") ) {
|
|
118
|
+
svgLoader.load( iconId ).then( svg => {
|
|
119
|
+
this.clearContent( );
|
|
120
|
+
this.dom.insertAdjacentHTML('beforeend', svg );
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
this.setContent( new Component( { tag: "img", attrs: { src: iconId } } ) );
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.clearContent( );
|
|
129
|
+
this.addClass( "empty" );
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file image.module.scss
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Use of this source code is governed by an MIT-style license
|
|
14
|
-
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
-
**/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.x-image {
|
|
19
|
-
position: relative;
|
|
20
|
-
background: none;
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file image.module.scss
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
.x-image {
|
|
19
|
+
position: relative;
|
|
20
|
+
background: none;
|
|
21
21
|
}
|
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file image.ts
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Use of this source code is governed by an MIT-style license
|
|
14
|
-
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
-
**/
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file image.ts
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
import { class_ns } from '@core/core_tools.js';
|
|
18
|
+
import { Component, ComponentProps } from '../../core/component.js';
|
|
19
|
+
|
|
20
|
+
import "./image.module.scss"
|
|
21
|
+
|
|
22
|
+
export interface ImageProps extends ComponentProps {
|
|
23
|
+
src: string;
|
|
24
|
+
fit?: "contain" | "cover" | "fill" | "scale-down";
|
|
25
|
+
position?: string;
|
|
26
|
+
lazy?: boolean;
|
|
27
|
+
alt?: string;
|
|
28
|
+
draggable?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
@class_ns( "x4" )
|
|
36
|
+
export class Image extends Component<ImageProps> {
|
|
37
|
+
|
|
38
|
+
private _img: Component;
|
|
39
|
+
|
|
40
|
+
constructor( props: ImageProps ) {
|
|
41
|
+
super( props );
|
|
42
|
+
|
|
43
|
+
this._img = new Component( {
|
|
44
|
+
tag: "img",
|
|
45
|
+
attrs: {
|
|
46
|
+
loading: props.lazy,
|
|
47
|
+
alt: props.alt,
|
|
48
|
+
draggable: props.draggable ?? false,
|
|
49
|
+
},
|
|
50
|
+
style: {
|
|
51
|
+
width: "100%",
|
|
52
|
+
height: "100%",
|
|
53
|
+
objectFit: props.fit,
|
|
54
|
+
objectPosition: props.position,
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
this.setContent( this._img );
|
|
59
|
+
this.setImage( props.src );
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
setImage( src: string ) {
|
|
67
|
+
this._img.setAttribute( "src", src );
|
|
68
|
+
}
|
|
67
69
|
}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ___ ___ __
|
|
3
|
-
* \ \/ / / _
|
|
4
|
-
* \ / /_| |_
|
|
5
|
-
* / \____ _|
|
|
6
|
-
* /__/\__\ |_|
|
|
7
|
-
*
|
|
8
|
-
* @file input.module.scss
|
|
9
|
-
* @author Etienne Cochard
|
|
10
|
-
*
|
|
11
|
-
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
-
*
|
|
13
|
-
* Use of this source code is governed by an MIT-style license
|
|
14
|
-
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
-
**/
|
|
16
|
-
|
|
17
|
-
:root {
|
|
18
|
-
--input-sel-background: var( --accent-background );
|
|
19
|
-
--input-sel-color: var( --accent-color );
|
|
20
|
-
--input-placeholder: var( --disabled-background );
|
|
21
|
-
--input-error: var( --alert-background );
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
input.x4input {
|
|
25
|
-
font: inherit;
|
|
26
|
-
outline: none;
|
|
27
|
-
|
|
28
|
-
border: none;
|
|
29
|
-
|
|
30
|
-
&::selection {
|
|
31
|
-
background-color: var( --input-sel-background );
|
|
32
|
-
color: var( --input-sel-color );
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&[type="text"],
|
|
36
|
-
&[type="password"],
|
|
37
|
-
&[type="email"] {
|
|
38
|
-
padding: 8px 4px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&[type="checkbox"]:checked,
|
|
42
|
-
&[type="radio"]:checked {
|
|
43
|
-
accent-color: var( --color-80 );
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&[type="range"] {
|
|
47
|
-
accent-color: var( --color-60 );
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&::placeholder {
|
|
51
|
-
color: var( --input-placeholder );
|
|
52
|
-
font-style: italic;
|
|
53
|
-
font-weight: 90%;
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&[type="password"] {
|
|
58
|
-
font-weight: bold;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&:disabled {
|
|
62
|
-
background-color: transparent;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&:invalid {
|
|
66
|
-
color: var( --input-error );
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|
|
|
7
|
+
*
|
|
8
|
+
* @file input.module.scss
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2024 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
:root {
|
|
18
|
+
--input-sel-background: var( --accent-background );
|
|
19
|
+
--input-sel-color: var( --accent-color );
|
|
20
|
+
--input-placeholder: var( --disabled-background );
|
|
21
|
+
--input-error: var( --alert-background );
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
input.x4input {
|
|
25
|
+
font: inherit;
|
|
26
|
+
outline: none;
|
|
27
|
+
|
|
28
|
+
border: none;
|
|
29
|
+
|
|
30
|
+
&::selection {
|
|
31
|
+
background-color: var( --input-sel-background );
|
|
32
|
+
color: var( --input-sel-color );
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[type="text"],
|
|
36
|
+
&[type="password"],
|
|
37
|
+
&[type="email"] {
|
|
38
|
+
padding: 8px 4px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[type="checkbox"]:checked,
|
|
42
|
+
&[type="radio"]:checked {
|
|
43
|
+
accent-color: var( --color-80 );
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&[type="range"] {
|
|
47
|
+
accent-color: var( --color-60 );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&::placeholder {
|
|
51
|
+
color: var( --input-placeholder );
|
|
52
|
+
font-style: italic;
|
|
53
|
+
font-weight: 90%;
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[type="password"] {
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:disabled {
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:invalid {
|
|
66
|
+
color: var( --input-error );
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|