@thi.ng/layout 3.0.47 → 3.1.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/CHANGELOG.md +7 -1
- package/README.md +2 -2
- package/package.json +6 -5
- package/stacked-layout.d.ts +4 -0
- package/stacked-layout.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-08-
|
|
3
|
+
- **Last updated**: 2024-08-18T14:11:34Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [3.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/layout@3.1.0) (2024-08-13)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add StackedLayout.isEqualized() ([b93702c](https://github.com/thi-ng/umbrella/commit/b93702c))
|
|
17
|
+
|
|
12
18
|
### [3.0.37](https://github.com/thi-ng/umbrella/tree/@thi.ng/layout@3.0.37) (2024-04-20)
|
|
13
19
|
|
|
14
20
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 199 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
@@ -74,7 +74,7 @@ For Node.js REPL:
|
|
|
74
74
|
const l = await import("@thi.ng/layout");
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 1.
|
|
77
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 1.21 KB
|
|
78
78
|
|
|
79
79
|
## Dependencies
|
|
80
80
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/layout",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Configurable nested 2D grid layout generators",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/arrays": "^2.
|
|
41
|
-
"@thi.ng/checks": "^3.6.
|
|
39
|
+
"@thi.ng/api": "^8.11.9",
|
|
40
|
+
"@thi.ng/arrays": "^2.10.0",
|
|
41
|
+
"@thi.ng/checks": "^3.6.11"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.47.5",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"datastructure",
|
|
53
53
|
"design",
|
|
54
54
|
"grid",
|
|
55
|
+
"gui",
|
|
55
56
|
"layout",
|
|
56
57
|
"recursion",
|
|
57
58
|
"tree",
|
|
@@ -95,5 +96,5 @@
|
|
|
95
96
|
],
|
|
96
97
|
"year": 2019
|
|
97
98
|
},
|
|
98
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "f6e26ea1142525171de5d36b9c3119f2782bb437\n"
|
|
99
100
|
}
|
package/stacked-layout.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export declare class StackedLayout extends GridLayout {
|
|
|
36
36
|
*/
|
|
37
37
|
availableSpan(maxSpan?: CellSpan): CellSpan;
|
|
38
38
|
propagateSize(rspan: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* Returns true if all column offsets/heights in the layout are equal.
|
|
41
|
+
*/
|
|
42
|
+
isEqualized(): boolean;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Syntax sugar for {@link StackedLayout} ctor. By default creates a 4-column
|
package/stacked-layout.js
CHANGED
|
@@ -82,6 +82,12 @@ class StackedLayout extends GridLayout {
|
|
|
82
82
|
this.offsets.fill(newY, this.currCol, this.currCol + this.currSpan);
|
|
83
83
|
this.parent && this.parent.propagateSize(newY);
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Returns true if all column offsets/heights in the layout are equal.
|
|
87
|
+
*/
|
|
88
|
+
isEqualized() {
|
|
89
|
+
return Math.min(...this.offsets) === Math.max(...this.offsets);
|
|
90
|
+
}
|
|
85
91
|
}
|
|
86
92
|
const stackedLayout = (x, y, width, cols = 4, rowH = 16, gap = 4) => new StackedLayout(null, x, y, width, cols, rowH, gap);
|
|
87
93
|
export {
|