@thi.ng/layout 3.1.15 → 3.1.17
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 +1 -1
- package/README.md +1 -1
- package/api.d.ts +20 -22
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
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 202 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
|
>
|
package/api.d.ts
CHANGED
|
@@ -17,13 +17,13 @@ export interface LayoutBox {
|
|
|
17
17
|
*/
|
|
18
18
|
h: number;
|
|
19
19
|
/**
|
|
20
|
-
* Single cell column width (always w/o col span), based on
|
|
21
|
-
*
|
|
20
|
+
* Single cell column width (always w/o col span), based on layout's
|
|
21
|
+
* available space and configured number of columns.
|
|
22
22
|
*/
|
|
23
23
|
cw: number;
|
|
24
24
|
/**
|
|
25
|
-
* Single cell row height (always same as `rowHeight` arg given to
|
|
26
|
-
*
|
|
25
|
+
* Single cell row height (always same as `rowHeight` arg given to layout
|
|
26
|
+
* ctor).
|
|
27
27
|
*/
|
|
28
28
|
ch: number;
|
|
29
29
|
/**
|
|
@@ -59,33 +59,31 @@ export interface IGridLayout<T extends IGridLayout<T>> extends ILayout<CellSpan,
|
|
|
59
59
|
*/
|
|
60
60
|
rowsForHeight(height: number): number;
|
|
61
61
|
/**
|
|
62
|
-
* Calculates the required number of columns & rows for the given
|
|
63
|
-
* size.
|
|
62
|
+
* Calculates the required number of columns & rows for the given size.
|
|
64
63
|
*
|
|
65
64
|
* @param size -
|
|
66
65
|
*/
|
|
67
66
|
spanForSize(size: ArrayLike<number>): CellSpan;
|
|
68
67
|
spanForSize(w: number, h: number): CellSpan;
|
|
69
68
|
/**
|
|
70
|
-
* Returns a squared {@link LayoutBox} based on this layout's column
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* square constraint.
|
|
69
|
+
* Returns a squared {@link LayoutBox} based on this layout's column width.
|
|
70
|
+
* This box will consume `ceil(columnWidth / rowHeight)` rows, but the
|
|
71
|
+
* returned box height might be less to satisfy the square constraint.
|
|
74
72
|
*/
|
|
75
73
|
nextSquare(): LayoutBox;
|
|
76
74
|
/**
|
|
77
|
-
* Requests a `spans` sized cell from this layout (via `.next()`)
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
75
|
+
* Requests a `spans` sized cell from this layout (via `.next()`) and
|
|
76
|
+
* creates and returns a new child {@link GridLayout} for the returned box /
|
|
77
|
+
* grid cell. This child layout is configured to use `cols` columns and
|
|
78
|
+
* shares same `gap` as this (parent) layout. The configured row span only
|
|
79
|
+
* acts as initial minimum vertical space reseervation, but is allowed to
|
|
80
|
+
* grow and if needed will propagate the new space requirements to parent
|
|
81
|
+
* layouts.
|
|
84
82
|
*
|
|
85
|
-
* Note: this size child-parent size propagation ONLY works until
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
83
|
+
* Note: this size child-parent size propagation ONLY works until the next
|
|
84
|
+
* cell is requested from any parent. IOW, child layouts MUST be
|
|
85
|
+
* completed/populated first before continuing with siblings/ancestors of
|
|
86
|
+
* this current layout.
|
|
89
87
|
*
|
|
90
88
|
* ```
|
|
91
89
|
* import { gridLayout } from "@thi.ng/layout";
|
|
@@ -110,7 +108,7 @@ export interface IGridLayout<T extends IGridLayout<T>> extends ILayout<CellSpan,
|
|
|
110
108
|
* ```
|
|
111
109
|
*
|
|
112
110
|
* @param cols - columns in nested layout
|
|
113
|
-
* @param spans - default [1,
|
|
111
|
+
* @param spans - default `[1,1]` (i.e. size of single cell)
|
|
114
112
|
* @param gap - gap for child layout
|
|
115
113
|
*/
|
|
116
114
|
nest(cols: number, spans?: CellSpan, gap?: number): T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/layout",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.17",
|
|
4
4
|
"description": "Configurable nested 2D grid layout generators",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.11.
|
|
43
|
-
"@thi.ng/arrays": "^2.10.
|
|
44
|
-
"@thi.ng/checks": "^3.6.
|
|
42
|
+
"@thi.ng/api": "^8.11.21",
|
|
43
|
+
"@thi.ng/arrays": "^2.10.16",
|
|
44
|
+
"@thi.ng/checks": "^3.6.24"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"esbuild": "^0.
|
|
48
|
-
"typedoc": "^0.27.
|
|
47
|
+
"esbuild": "^0.25.0",
|
|
48
|
+
"typedoc": "^0.27.7",
|
|
49
49
|
"typescript": "^5.7.3"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
],
|
|
99
99
|
"year": 2019
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "bee617702ac61d093465b967f8f973dc566faa6b\n"
|
|
102
102
|
}
|