neo.mjs 4.3.24 → 4.3.25

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": "neo.mjs",
3
- "version": "4.3.24",
3
+ "version": "4.3.25",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -0,0 +1,3 @@
1
+ .neo-layout-grid {
2
+ display: grid;
3
+ }
@@ -2,6 +2,7 @@ import Component from '../component/Base.mjs';
2
2
  import LayoutBase from '../layout/Base.mjs';
3
3
  import LayoutCard from '../layout/Card.mjs';
4
4
  import LayoutFit from '../layout/Fit.mjs';
5
+ import LayoutGrid from '../layout/Grid.mjs';
5
6
  import LayoutHbox from '../layout/HBox.mjs';
6
7
  import LayoutVBox from '../layout/VBox.mjs';
7
8
  import Logger from '../util/Logger.mjs';
@@ -0,0 +1,42 @@
1
+ import Base from './Base.mjs';
2
+ import NeoArray from '../util/Array.mjs';
3
+
4
+ /**
5
+ * @class Neo.layout.Grid
6
+ * @extends Neo.layout.Base
7
+ */
8
+ class Grid extends Base {
9
+ static getConfig() {return {
10
+ /**
11
+ * @member {String} className='Neo.layout.Grid'
12
+ * @protected
13
+ */
14
+ className: 'Neo.layout.Grid',
15
+ /**
16
+ * @member {String} ntype='layout-hbox'
17
+ * @protected
18
+ */
19
+ ntype: 'layout-grid'
20
+ }}
21
+
22
+ /**
23
+ * Applies CSS classes to the container this layout is bound to
24
+ */
25
+ applyRenderAttributes() {
26
+ let me = this,
27
+ container = Neo.getComponent(me.containerId),
28
+ wrapperCls = container?.wrapperCls || [];
29
+
30
+ if (!container) {
31
+ Neo.logError('layout.Grid: applyRenderAttributes -> container not yet created', me.containerId);
32
+ }
33
+
34
+ NeoArray.add(wrapperCls, 'neo-layout-grid');
35
+
36
+ container.wrapperCls = wrapperCls;
37
+ }
38
+ }
39
+
40
+ Neo.applyClassConfig(Grid);
41
+
42
+ export default Grid;