x4js 2.2.10 → 2.2.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "2.2.10",
3
+ "version": "2.2.12",
4
4
  "type": "module",
5
5
  "main": "src/x4.ts",
6
6
  "module": "src/x4.ts",
@@ -12,6 +12,8 @@
12
12
  *
13
13
  * Use of this source code is governed by an MIT-style license
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
+ *
16
+ * 2026-05-26: added resize types
15
17
  **/
16
18
 
17
19
  import { BaseProps } from '../input/input';
@@ -30,7 +32,7 @@ import { class_ns, IFormElement } from '../../core/core_tools';
30
32
  interface TextAreaProps extends BaseProps {
31
33
  label?: string;
32
34
  value?: string;
33
- resize?: boolean;
35
+ resize?: boolean | "none" | "vertical" | "horizontal" | "both";
34
36
  readonly?: boolean;
35
37
  trim?: boolean;
36
38
  }
@@ -48,8 +50,8 @@ class SimpleTextArea extends Component<TextAreaProps> {
48
50
  this.setAttribute( "name", props.name );
49
51
  this.setAttribute( "value", props.value+'' );
50
52
 
51
- if( !props.resize ) {
52
- this.setAttribute( "resize", false );
53
+ if( props.resize!==undefined ) {
54
+ this.setStyleValue( "resize", props.resize===false ? "none" : props.resize as string );
53
55
  }
54
56
 
55
57
  if( props.readonly ) {
@@ -0,0 +1,30 @@
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|.2
7
+ *
8
+ * @file video.module.scss
9
+ * @author Etienne Cochard
10
+ *
11
+ * @copyright (c) 2026 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
+
19
+ .x4video {
20
+ background-color: black;
21
+ position: relative;
22
+
23
+ .vplayer {
24
+ position: absolute;
25
+ left: 0;
26
+ top: 0;
27
+ right: 0;
28
+ bottom: 0;
29
+ }
30
+ }
@@ -0,0 +1,130 @@
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|.2
7
+ *
8
+ * @file video.ts
9
+ * @author Etienne Cochard
10
+ *
11
+ * @copyright (c) 2026 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 { Box, Component, ComponentProps } from 'x4js';
18
+
19
+ import "./video.module.scss"
20
+
21
+ interface VideoProps extends ComponentProps {
22
+ autoplay?: boolean;
23
+ muted?: boolean;
24
+ playsInline?: boolean;
25
+ stream: MediaStream;
26
+ }
27
+
28
+ /**
29
+ *
30
+ */
31
+
32
+ export class Video extends Box {
33
+
34
+ private _vplayer: HTMLVideoElement;
35
+
36
+ constructor( props: VideoProps ) {
37
+ super( props );
38
+
39
+ const el = new Component( { cls: "vplayer", tag: 'video', } );
40
+ this.setContent( el );
41
+
42
+ this._vplayer = el.dom as HTMLVideoElement;
43
+
44
+ if( props.autoplay !== undefined ) {
45
+ this.autoPlay = props.autoplay;
46
+ }
47
+
48
+ if( props.muted !== undefined ) {
49
+ this.mute( props.muted );
50
+ }
51
+
52
+ if( props.playsInline !== undefined ) {
53
+ this.playsInline = props.playsInline;
54
+ }
55
+
56
+ this.stream = props.stream;
57
+ }
58
+
59
+ get player( ) {
60
+ return this._vplayer;
61
+ }
62
+
63
+ get volume( ) {
64
+ return this.player.volume;
65
+ }
66
+
67
+ set volume( vol: number ) {
68
+ this.player.volume = vol;
69
+ }
70
+
71
+ get autoPlay( ) {
72
+ return this.player.autoplay;
73
+ }
74
+
75
+ set autoPlay( set: boolean ) {
76
+ this.player.autoplay = set;
77
+ }
78
+
79
+ get playsInline( ) {
80
+ return this.player.playsInline;
81
+ }
82
+
83
+ set playsInline( set: boolean ) {
84
+ this.player.playsInline = set;
85
+ }
86
+
87
+ set stream( stream: MediaStream ) {
88
+ this.player.srcObject = stream;
89
+ }
90
+
91
+ get videoWidth( ) {
92
+ return this.player.videoWidth;
93
+ }
94
+
95
+ get videoHeight( ) {
96
+ return this.player.videoHeight;
97
+ }
98
+
99
+ get loop( ) {
100
+ return this.player.loop;
101
+ }
102
+
103
+ set loop( set: boolean ) {
104
+ this.player.loop = set;
105
+ }
106
+
107
+ get duration( ) {
108
+ return this.player.duration;
109
+ }
110
+
111
+ get muted( ) {
112
+ return this.player.muted;
113
+ }
114
+
115
+ mute( set: boolean ) {
116
+ this.player.muted = set;
117
+ }
118
+
119
+ get paused( ) {
120
+ return this.player.paused;
121
+ }
122
+
123
+ pause( ) {
124
+ this.player.pause( );
125
+ }
126
+
127
+ play( ) {
128
+ this.player.play( );
129
+ }
130
+ }