x4js 1.4.51 → 1.4.52

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.
@@ -157,6 +157,7 @@ export declare class Component<P extends CProps<CEventMap> = CProps<CEventMap>,
157
157
  * @param content new content or null
158
158
  */
159
159
  setContent(content: ComponentContent, refreshAll?: boolean): void;
160
+ getContent(): ComponentContent;
160
161
  /**
161
162
  * add a new child to the component content
162
163
  * @param content
@@ -598,10 +599,3 @@ export declare class Container<P extends ContainerProps = ContainerProps, E exte
598
599
  private _handleKeydown;
599
600
  }
600
601
  export declare type ComponentConstructor<T> = new (props: CProps) => T;
601
- /**
602
- *
603
- */
604
- export declare class TSXComponent<P extends CProps<CEventMap> = CProps<CEventMap>, E extends CEventMap = CEventMap> extends Component<P, E> {
605
- render(props: P): void;
606
- renderTSX(props: P): Component | Component[];
607
- }
package/lib/component.js CHANGED
@@ -28,7 +28,7 @@
28
28
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
29
  */
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.TSXComponent = exports.Container = exports.SizerOverlay = exports.EvOverlayResize = exports.Separator = exports.EvSize = exports.Space = exports.Flex = exports.flyWrap = exports.Component = exports.EvFocus = exports.EvDblClick = exports._x4_unitless = exports.html = exports.isHtmlString = exports.HtmlString = void 0;
31
+ exports.Container = exports.SizerOverlay = exports.EvOverlayResize = exports.Separator = exports.EvSize = exports.Space = exports.Flex = exports.flyWrap = exports.Component = exports.EvFocus = exports.EvDblClick = exports._x4_unitless = exports.html = exports.isHtmlString = exports.HtmlString = void 0;
32
32
  /**
33
33
  * @todo
34
34
  * create Container class
@@ -129,6 +129,9 @@ class Component extends base_component_1.BaseComponent {
129
129
  this._updateContent();
130
130
  }
131
131
  }
132
+ getContent() {
133
+ return this.m_props.content;
134
+ }
132
135
  /**
133
136
  * add a new child to the component content
134
137
  * @param content
@@ -1723,18 +1726,3 @@ class Container extends Component {
1723
1726
  }
1724
1727
  }
1725
1728
  exports.Container = Container;
1726
- /**
1727
- *
1728
- */
1729
- class TSXComponent extends Component {
1730
- render(props) {
1731
- const tsx = this.renderTSX(props);
1732
- if (tsx) {
1733
- this.setContent(tsx);
1734
- }
1735
- }
1736
- renderTSX(props) {
1737
- return undefined;
1738
- }
1739
- }
1740
- exports.TSXComponent = TSXComponent;
package/lib/x4.css CHANGED
@@ -217,6 +217,12 @@ textarea::selection {
217
217
  flex: 1;
218
218
  flex-basis: 0;
219
219
  }
220
+ .x-hlayout > .x-min-content {
221
+ min-width: min-content;
222
+ }
223
+ .x-vlayout > .x-min-content {
224
+ min-height: min-content;
225
+ }
220
226
  .x-fit {
221
227
  position: absolute;
222
228
  left: 0;
@@ -329,6 +335,11 @@ textarea::selection {
329
335
  margin: 0 4px;
330
336
  color: inherit;
331
337
  }
338
+ .x-base-button .x-svg-icon {
339
+ width: 100%;
340
+ height: 100%;
341
+ margin: 0;
342
+ }
332
343
  .x-base-button:focus {
333
344
  border-color: var(--x4-focus-color);
334
345
  background-color: var(--x4-focus-color);
package/lib/x4react.d.ts CHANGED
@@ -1,6 +1,41 @@
1
- import { ComponentContent } from './component';
1
+ /**
2
+ * ___ ___ __
3
+ * \ \_/ / / _
4
+ * \ / /_| |_
5
+ * / _ \____ _|
6
+ * /__/ \__\ |_|
7
+ *
8
+ * @file x4react.ts
9
+ * @author Etienne Cochard
10
+ *
11
+ * Copyright (c) 2019-2022 R-libre ingenierie
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
18
+ * subject to the following conditions:
19
+ * The above copyright notice and this permission notice shall be included in all copies
20
+ * or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ **/
29
+ import { Component, ComponentContent, CProps, CEventMap } from './component';
2
30
  export declare let React: {
3
31
  createElement: (clsOrTag: any, attrs: any, ...children: any[]) => ComponentContent;
4
32
  createFragment: () => ComponentContent;
5
33
  Fragment: symbol;
6
34
  };
35
+ /**
36
+ *
37
+ */
38
+ export declare abstract class TSXComponent<P extends CProps<CEventMap> = CProps<CEventMap>, E extends CEventMap = CEventMap> extends Component<P, E> {
39
+ render(props: P): void;
40
+ abstract renderTSX(props: P): Component | Component[];
41
+ }
package/lib/x4react.js CHANGED
@@ -1,6 +1,34 @@
1
1
  "use strict";
2
+ /**
3
+ * ___ ___ __
4
+ * \ \_/ / / _
5
+ * \ / /_| |_
6
+ * / _ \____ _|
7
+ * /__/ \__\ |_|
8
+ *
9
+ * @file x4react.ts
10
+ * @author Etienne Cochard
11
+ *
12
+ * Copyright (c) 2019-2022 R-libre ingenierie
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ * of this software and associated documentation files (the "Software"), to deal
16
+ * in the Software without restriction, including without limitation the rights
17
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
18
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
19
+ * subject to the following conditions:
20
+ * The above copyright notice and this permission notice shall be included in all copies
21
+ * or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
24
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
25
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
+ **/
2
30
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.React = void 0;
31
+ exports.TSXComponent = exports.React = void 0;
4
32
  const component_1 = require("./component");
5
33
  const createElement = (clsOrTag, attrs, ...children) => {
6
34
  let comp;
@@ -33,3 +61,15 @@ exports.React = {
33
61
  createFragment,
34
62
  Fragment,
35
63
  };
64
+ /**
65
+ *
66
+ */
67
+ class TSXComponent extends component_1.Component {
68
+ render(props) {
69
+ const tsx = this.renderTSX(props);
70
+ if (tsx) {
71
+ this.setContent(tsx);
72
+ }
73
+ }
74
+ }
75
+ exports.TSXComponent = TSXComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.4.51",
3
+ "version": "1.4.52",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/component.ts CHANGED
@@ -240,6 +240,9 @@ export class Component<P extends CProps<CEventMap> = CProps<CEventMap>, E extend
240
240
  }
241
241
  }
242
242
 
243
+ getContent( ) {
244
+ return this.m_props.content;
245
+ }
243
246
 
244
247
  /**
245
248
  * add a new child to the component content
@@ -2324,21 +2327,3 @@ export class Container<P extends ContainerProps = ContainerProps, E extends Cont
2324
2327
  }
2325
2328
 
2326
2329
  export type ComponentConstructor<T> = new (props: CProps) => T;
2327
-
2328
- /**
2329
- *
2330
- */
2331
-
2332
- export class TSXComponent<P extends CProps<CEventMap> = CProps<CEventMap>, E extends CEventMap = CEventMap> extends Component<P,E> {
2333
- public render(props: P) {
2334
- const tsx = this.renderTSX( props );
2335
- if( tsx ) {
2336
- this.setContent( tsx );
2337
- }
2338
- }
2339
-
2340
- public renderTSX( props: P ): Component | Component[] {
2341
- return undefined;
2342
- }
2343
- }
2344
-
package/src/x4.less CHANGED
@@ -283,6 +283,14 @@ textarea {
283
283
  flex-basis: 0;
284
284
  }
285
285
 
286
+ .x-hlayout > .x-min-content {
287
+ min-width: min-content;
288
+ }
289
+
290
+ .x-vlayout > .x-min-content {
291
+ min-height: min-content;
292
+ }
293
+
286
294
  .x-fit {
287
295
  position: absolute;
288
296
  left: 0;
@@ -417,6 +425,12 @@ textarea {
417
425
  color: inherit;
418
426
  }
419
427
 
428
+ .x-svg-icon {
429
+ width: 100%;
430
+ height: 100%;
431
+ margin: 0;
432
+ }
433
+
420
434
  &:focus {
421
435
  border-color: var( --x4-focus-color );
422
436
  background-color: var( --x4-focus-color );
package/src/x4react.ts CHANGED
@@ -1,4 +1,33 @@
1
- import { Component, ComponentContent } from './component';
1
+ /**
2
+ * ___ ___ __
3
+ * \ \_/ / / _
4
+ * \ / /_| |_
5
+ * / _ \____ _|
6
+ * /__/ \__\ |_|
7
+ *
8
+ * @file x4react.ts
9
+ * @author Etienne Cochard
10
+ *
11
+ * Copyright (c) 2019-2022 R-libre ingenierie
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
17
+ * of the Software, and to permit persons to whom the Software is furnished to do so,
18
+ * subject to the following conditions:
19
+ * The above copyright notice and this permission notice shall be included in all copies
20
+ * or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
23
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
24
+ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ **/
29
+
30
+ import { Component, ComponentContent, CProps, CEventMap } from './component';
2
31
 
3
32
 
4
33
  const createElement = ( clsOrTag, attrs, ...children ): ComponentContent => {
@@ -40,3 +69,22 @@ export let React = {
40
69
  Fragment,
41
70
  }
42
71
 
72
+
73
+
74
+
75
+
76
+ /**
77
+ *
78
+ */
79
+
80
+ export abstract class TSXComponent<P extends CProps<CEventMap> = CProps<CEventMap>, E extends CEventMap = CEventMap> extends Component<P,E> {
81
+ public render(props: P) {
82
+ const tsx = this.renderTSX( props );
83
+ if( tsx ) {
84
+ this.setContent( tsx );
85
+ }
86
+ }
87
+
88
+ public abstract renderTSX( props: P ): Component | Component[];
89
+ }
90
+