@niche-works/style-layouts 0.2.0 → 0.3.0
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/README.ja.md +11 -0
- package/README.md +11 -0
- package/balance/index.cjs +1 -1
- package/center/index.cjs +1 -1
- package/constants.cjs +2 -2
- package/constants.d.cts +2 -2
- package/constants.d.mts +2 -2
- package/constants.mjs +2 -2
- package/core/_constants.cjs +58 -78
- package/core/_constants.d.cts +57 -71
- package/core/_constants.d.mts +57 -71
- package/core/_constants.mjs +58 -72
- package/core/balance/balance.cjs +1 -1
- package/core/balance/balance.mjs +2 -2
- package/core/balance/styles.css +8 -22
- package/core/center/center.cjs +1 -1
- package/core/center/center.mjs +2 -2
- package/core/center/styles.css +59 -24
- package/core/constants.cjs +18 -20
- package/core/constants.d.cts +17 -19
- package/core/constants.d.mts +17 -19
- package/core/constants.mjs +17 -19
- package/core/flow/flow.cjs +7 -7
- package/core/flow/flow.mjs +8 -8
- package/core/flow/styles.css +24 -20
- package/core/layer/layer.cjs +1 -1
- package/core/layer/layer.mjs +2 -2
- package/core/layer/styles.css +2 -6
- package/core/matrix/matrix.cjs +39 -41
- package/core/matrix/matrix.mjs +40 -42
- package/core/matrix/styles.css +106 -4
- package/core/pack/pack.cjs +1 -1
- package/core/pack/pack.mjs +2 -2
- package/core/pack/styles.css +17 -8
- package/core/pin/styles.css +1 -0
- package/core/stack/stack.cjs +19 -19
- package/core/stack/stack.mjs +20 -20
- package/core/stack/styles.css +26 -22
- package/core/styles.css +359 -149
- package/core/tile/styles.css +116 -43
- package/core/tile/tile.cjs +2 -52
- package/core/tile/tile.mjs +4 -54
- package/flow/index.cjs +1 -1
- package/layer/index.cjs +1 -1
- package/matrix/index.cjs +1 -1
- package/pack/index.cjs +1 -1
- package/package.json +1 -1
- package/pin/index.cjs +1 -1
- package/stack/index.cjs +1 -1
- package/tile/index.cjs +1 -1
package/core/tile/styles.css
CHANGED
|
@@ -4,21 +4,129 @@
|
|
|
4
4
|
--nws-layout-childSizeX: auto;
|
|
5
5
|
--nws-layout-childSizeY: auto;
|
|
6
6
|
--nws-layout-childRatio: auto;
|
|
7
|
-
--nws-layout-templateX: none;
|
|
8
|
-
--nws-layout-templateY: none;
|
|
9
|
-
--nws-layout-autoTracX: auto;
|
|
10
|
-
--nws-layout-autoTracY: auto;
|
|
11
7
|
display: grid;
|
|
12
8
|
}
|
|
9
|
+
.nws-layout-tile > * {
|
|
10
|
+
min-width: 0;
|
|
11
|
+
min-height: 0;
|
|
12
|
+
}
|
|
13
13
|
.nws-layout-tile.nws-layout-direction-x {
|
|
14
14
|
grid-auto-flow: row;
|
|
15
|
-
grid-template-columns:
|
|
16
|
-
|
|
15
|
+
grid-template-columns: repeat(auto-fit, minmax(max-content, 100%));
|
|
16
|
+
}
|
|
17
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-childSizeX {
|
|
18
|
+
grid-template-columns: repeat(auto-fit, var(--nws-layout-childSizeX));
|
|
19
|
+
}
|
|
20
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-fit, .nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-grow, .nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-shrink {
|
|
21
|
+
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
|
22
|
+
}
|
|
23
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-fit > *, .nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-grow > *, .nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-shrink > * {
|
|
24
|
+
width: auto;
|
|
25
|
+
}
|
|
26
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-fit.nws-layout-childSizeX {
|
|
27
|
+
grid-template-columns: repeat(auto-fit, minmax(clamp(0px, 100%, var(--nws-layout-childSizeX)), 1fr));
|
|
28
|
+
}
|
|
29
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-grow.nws-layout-childSizeX {
|
|
30
|
+
grid-template-columns: repeat(auto-fit, minmax(var(--nws-layout-childSizeX), 1fr));
|
|
31
|
+
}
|
|
32
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustX-shrink.nws-layout-childSizeX {
|
|
33
|
+
grid-template-columns: repeat(auto-fit, minmax(0, var(--nws-layout-childSizeX)));
|
|
34
|
+
}
|
|
35
|
+
.nws-layout-tile.nws-layout-direction-x {
|
|
36
|
+
grid-auto-rows: auto;
|
|
37
|
+
}
|
|
38
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-fit {
|
|
39
|
+
grid-auto-rows: minmax(0, 100%);
|
|
40
|
+
align-content: stretch;
|
|
41
|
+
}
|
|
42
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-fit > * {
|
|
43
|
+
height: auto;
|
|
44
|
+
}
|
|
45
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-grow {
|
|
46
|
+
grid-auto-rows: minmax(auto, 100%);
|
|
47
|
+
}
|
|
48
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-grow > * {
|
|
49
|
+
max-height: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-grow.nws-layout-childSizeY {
|
|
53
|
+
grid-auto-rows: minmax(var(--nws-layout-childSizeY), 100%);
|
|
54
|
+
}
|
|
55
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-grow.nws-layout-childSizeY > * {
|
|
56
|
+
min-height: var(--nws-layout-childSizeY);
|
|
57
|
+
}
|
|
58
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-shrink {
|
|
59
|
+
grid-auto-rows: minmax(0, auto);
|
|
60
|
+
}
|
|
61
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-shrink > * {
|
|
62
|
+
min-height: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-shrink.nws-layout-childSizeY {
|
|
66
|
+
grid-auto-rows: minmax(0, var(--nws-layout-childSizeY));
|
|
67
|
+
}
|
|
68
|
+
.nws-layout-tile.nws-layout-direction-x.nws-layout-adjustY-shrink.nws-layout-childSizeY > * {
|
|
69
|
+
max-height: var(--nws-layout-childSizeY);
|
|
17
70
|
}
|
|
18
71
|
.nws-layout-tile.nws-layout-direction-y {
|
|
19
72
|
grid-auto-flow: column;
|
|
20
|
-
grid-auto-columns:
|
|
21
|
-
|
|
73
|
+
grid-auto-columns: auto;
|
|
74
|
+
}
|
|
75
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-fit > *, .nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-grow > *, .nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-shrink > * {
|
|
76
|
+
width: auto;
|
|
77
|
+
}
|
|
78
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-fit {
|
|
79
|
+
grid-auto-columns: minmax(0, 100%);
|
|
80
|
+
}
|
|
81
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-grow {
|
|
82
|
+
grid-auto-columns: minmax(auto, 100%);
|
|
83
|
+
}
|
|
84
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-grow.nws-layout-childSizeX {
|
|
85
|
+
grid-auto-columns: minmax(var(--nws-layout-childSizeX), 100%);
|
|
86
|
+
}
|
|
87
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-shrink {
|
|
88
|
+
grid-auto-columns: minmax(0, auto);
|
|
89
|
+
}
|
|
90
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustX-shrink.nws-layout-childSizeX {
|
|
91
|
+
grid-auto-columns: minmax(0, var(--nws-layout-childSizeX));
|
|
92
|
+
}
|
|
93
|
+
.nws-layout-tile.nws-layout-direction-y {
|
|
94
|
+
grid-template-rows: repeat(auto-fit, minmax(max-content, 100%));
|
|
95
|
+
}
|
|
96
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-childSizeY {
|
|
97
|
+
grid-template-rows: repeat(auto-fit, var(--nws-layout-childSizeY));
|
|
98
|
+
}
|
|
99
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-fit, .nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-grow, .nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-shrink {
|
|
100
|
+
grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
|
|
101
|
+
}
|
|
102
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-fit {
|
|
103
|
+
align-content: stretch;
|
|
104
|
+
}
|
|
105
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-fit > * {
|
|
106
|
+
height: auto;
|
|
107
|
+
}
|
|
108
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-fit.nws-layout-childSizeY {
|
|
109
|
+
grid-template-rows: repeat(auto-fit, minmax(clamp(0px, 100%, var(--nws-layout-childSizeY)), 1fr));
|
|
110
|
+
}
|
|
111
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-grow > * {
|
|
112
|
+
max-height: 100%;
|
|
113
|
+
height: 100%;
|
|
114
|
+
}
|
|
115
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-grow.nws-layout-childSizeY {
|
|
116
|
+
grid-template-rows: repeat(auto-fit, minmax(var(--nws-layout-childSizeY), 1fr));
|
|
117
|
+
}
|
|
118
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-grow.nws-layout-childSizeY > * {
|
|
119
|
+
min-height: var(--nws-layout-childSizeY);
|
|
120
|
+
}
|
|
121
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-shrink > * {
|
|
122
|
+
min-height: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-shrink.nws-layout-childSizeY {
|
|
126
|
+
grid-template-rows: repeat(auto-fit, minmax(0, var(--nws-layout-childSizeY)));
|
|
127
|
+
}
|
|
128
|
+
.nws-layout-tile.nws-layout-direction-y.nws-layout-adjustY-shrink.nws-layout-childSizeY > * {
|
|
129
|
+
max-height: var(--nws-layout-childSizeY);
|
|
22
130
|
}
|
|
23
131
|
.nws-layout-tile.nws-layout-alignX-left {
|
|
24
132
|
justify-content: flex-start;
|
|
@@ -62,41 +170,6 @@
|
|
|
62
170
|
.nws-layout-tile.nws-layout-childSizeY > * {
|
|
63
171
|
height: var(--nws-layout-childSizeY);
|
|
64
172
|
}
|
|
65
|
-
.nws-layout-tile > * {
|
|
66
|
-
min-width: 0;
|
|
67
|
-
}
|
|
68
|
-
.nws-layout-tile.nws-layout-adjustX-fit > * {
|
|
69
|
-
width: auto;
|
|
70
|
-
}
|
|
71
|
-
.nws-layout-tile.nws-layout-adjustX-grow > * {
|
|
72
|
-
width: auto;
|
|
73
|
-
}
|
|
74
|
-
.nws-layout-tile.nws-layout-adjustX-shrink > * {
|
|
75
|
-
width: auto;
|
|
76
|
-
}
|
|
77
|
-
.nws-layout-tile > * {
|
|
78
|
-
min-height: 0;
|
|
79
|
-
}
|
|
80
|
-
.nws-layout-tile.nws-layout-adjustY-fit {
|
|
81
|
-
align-content: stretch;
|
|
82
|
-
}
|
|
83
|
-
.nws-layout-tile.nws-layout-adjustY-fit > * {
|
|
84
|
-
height: auto;
|
|
85
|
-
}
|
|
86
|
-
.nws-layout-tile.nws-layout-adjustY-grow > * {
|
|
87
|
-
max-height: 100%;
|
|
88
|
-
height: 100%;
|
|
89
|
-
}
|
|
90
|
-
.nws-layout-tile.nws-layout-adjustY-grow.nws-layout-childSizeY > * {
|
|
91
|
-
min-height: var(--nws-layout-childSizeY);
|
|
92
|
-
}
|
|
93
|
-
.nws-layout-tile.nws-layout-adjustY-shrink > * {
|
|
94
|
-
min-height: 100%;
|
|
95
|
-
height: 100%;
|
|
96
|
-
}
|
|
97
|
-
.nws-layout-tile.nws-layout-adjustY-shrink.nws-layout-childSizeY > * {
|
|
98
|
-
max-height: var(--nws-layout-childSizeY);
|
|
99
|
-
}
|
|
100
173
|
.nws-layout-tile.nws-layout-childRatio > * {
|
|
101
174
|
aspect-ratio: var(--nws-layout-childRatio);
|
|
102
175
|
}
|
package/core/tile/tile.cjs
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_core_constants = require('../constants.cjs');
|
|
3
3
|
const require_core__constants = require('../_constants.cjs');
|
|
4
|
-
const require_core__internal_hasValue = require('../_internal/hasValue.cjs');
|
|
5
4
|
const require_core__internal_applyChildRatio = require('../_internal/applyChildRatio.cjs');
|
|
6
|
-
const require_core__internal_unit = require('../_internal/unit.cjs');
|
|
7
5
|
const require_core__internal_applyChildSize = require('../_internal/applyChildSize.cjs');
|
|
8
6
|
const require_core__internal_applyGap = require('../_internal/applyGap.cjs');
|
|
9
|
-
const require_core__internal_mergeLayoutResults = require('../_internal/mergeLayoutResults.cjs');
|
|
10
7
|
let _niche_works_utils_object_maybeDefault = require("@niche-works/utils/object/maybeDefault");
|
|
11
8
|
_niche_works_utils_object_maybeDefault = require_runtime.__toESM(_niche_works_utils_object_maybeDefault, 1);
|
|
12
9
|
let clsx = require("clsx");
|
|
@@ -26,61 +23,14 @@ const tile = (options = {}) => {
|
|
|
26
23
|
alignY: "top"
|
|
27
24
|
}, { overwriteNull: true });
|
|
28
25
|
const result = {
|
|
29
|
-
className: (0, clsx.default)(require_core_constants.clsLayoutTile, require_core__constants.
|
|
26
|
+
className: (0, clsx.default)(require_core_constants.clsLayoutTile, require_core__constants.clsLayout.direction[direction], require_core__constants.clsLayout.align.x[alignX], require_core__constants.clsLayout.align.y[alignY], require_core__constants.clsLayout.adjust.x[adjustX], require_core__constants.clsLayout.adjust.y[adjustY]),
|
|
30
27
|
style: {}
|
|
31
28
|
};
|
|
32
29
|
require_core__internal_applyGap(result, gap, gapX, gapY);
|
|
33
30
|
require_core__internal_applyChildSize(result, childSizeX, childSizeY);
|
|
34
31
|
require_core__internal_applyChildRatio(result, childRatioX, childRatioY);
|
|
35
|
-
return
|
|
32
|
+
return result;
|
|
36
33
|
};
|
|
37
|
-
/**
|
|
38
|
-
* 並べる方向によるスタイル
|
|
39
|
-
*/
|
|
40
|
-
const _getLayoutResultByDirection = {
|
|
41
|
-
x: ({ adjustX, adjustY, childSizeX, childSizeY }) => {
|
|
42
|
-
return require_core__internal_mergeLayoutResults([_getGridMainAxisTemplate(adjustX, childSizeX, require_core_constants.varLayoutTemplateX), _getGridClossAxisAuto(adjustY, childSizeY, require_core_constants.varLayoutAutoTracY)]);
|
|
43
|
-
},
|
|
44
|
-
y: ({ adjustX, adjustY, childSizeY, childSizeX }) => {
|
|
45
|
-
return require_core__internal_mergeLayoutResults([_getGridClossAxisAuto(adjustX, childSizeX, require_core_constants.varLayoutAutoTracX), _getGridMainAxisTemplate(adjustY, childSizeY, require_core_constants.varLayoutTemplateY)]);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* direction方向の子要素のサイズを指定するためのテンプレート
|
|
50
|
-
* @param align 子要素の配置
|
|
51
|
-
* @param childSize 子要素のサイズ
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
function _getGridMainAxisTemplate(adjust, childSize, varName) {
|
|
55
|
-
const hasChildSize = require_core__internal_hasValue(childSize);
|
|
56
|
-
const style = {};
|
|
57
|
-
if (adjust === "fit") if (hasChildSize) style[varName] = `repeat(auto-fit, minmax(clamp(0px, 100%, ${require_core__internal_unit(childSize)}), 1fr))`;
|
|
58
|
-
else style[varName] = "repeat(auto-fit, minmax(0, 1fr))";
|
|
59
|
-
else if (adjust === "grow") if (hasChildSize) style[varName] = `repeat(auto-fit, minmax(${require_core__internal_unit(childSize)}, 1fr))`;
|
|
60
|
-
else style[varName] = "repeat(auto-fit, minmax(0, 1fr))";
|
|
61
|
-
else if (adjust === "shrink") if (hasChildSize) style[varName] = `repeat(auto-fit, minmax(0, ${require_core__internal_unit(childSize)}))`;
|
|
62
|
-
else style[varName] = "repeat(auto-fit, minmax(0, 1fr))";
|
|
63
|
-
else if (hasChildSize) style[varName] = `repeat(auto-fit, ${require_core__internal_unit(childSize)})`;
|
|
64
|
-
else style[varName] = "repeat(auto-fit, minmax(max-content, 100%))";
|
|
65
|
-
return { style };
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* 交差軸方向
|
|
69
|
-
* @param adjust
|
|
70
|
-
* @param childSize
|
|
71
|
-
* @returns
|
|
72
|
-
*/
|
|
73
|
-
function _getGridClossAxisAuto(adjust, childSize, varName) {
|
|
74
|
-
const hasChildSize = require_core__internal_hasValue(childSize);
|
|
75
|
-
const style = {};
|
|
76
|
-
if (adjust === "fit") if (hasChildSize) style[varName] = `minmax(0, 100%)`;
|
|
77
|
-
else style[varName] = `minmax(0, 100%)`;
|
|
78
|
-
else if (adjust === "grow") if (hasChildSize) style[varName] = `minmax(${require_core__internal_unit(childSize)}, 100%)`;
|
|
79
|
-
else style[varName] = `minmax(auto, 100%)`;
|
|
80
|
-
else if (adjust === "shrink") if (hasChildSize) style[varName] = `minmax(0, ${require_core__internal_unit(childSize)})`;
|
|
81
|
-
else style[varName] = `minmax(0, auto)`;
|
|
82
|
-
return { style };
|
|
83
|
-
}
|
|
84
34
|
|
|
85
35
|
//#endregion
|
|
86
36
|
module.exports = tile;
|
package/core/tile/tile.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { clsLayoutTile
|
|
2
|
-
import {
|
|
3
|
-
import hasValue from "../_internal/hasValue.mjs";
|
|
1
|
+
import { clsLayoutTile } from "../constants.mjs";
|
|
2
|
+
import { clsLayout } from "../_constants.mjs";
|
|
4
3
|
import applyChildRatio from "../_internal/applyChildRatio.mjs";
|
|
5
|
-
import unit from "../_internal/unit.mjs";
|
|
6
4
|
import applyChildSize from "../_internal/applyChildSize.mjs";
|
|
7
5
|
import applyGap from "../_internal/applyGap.mjs";
|
|
8
|
-
import mergeLayoutResults from "../_internal/mergeLayoutResults.mjs";
|
|
9
6
|
import maybeDefault from "@niche-works/utils/object/maybeDefault";
|
|
10
7
|
import clsx from "clsx";
|
|
11
8
|
|
|
@@ -23,61 +20,14 @@ const tile = (options = {}) => {
|
|
|
23
20
|
alignY: "top"
|
|
24
21
|
}, { overwriteNull: true });
|
|
25
22
|
const result = {
|
|
26
|
-
className: clsx(clsLayoutTile,
|
|
23
|
+
className: clsx(clsLayoutTile, clsLayout.direction[direction], clsLayout.align.x[alignX], clsLayout.align.y[alignY], clsLayout.adjust.x[adjustX], clsLayout.adjust.y[adjustY]),
|
|
27
24
|
style: {}
|
|
28
25
|
};
|
|
29
26
|
applyGap(result, gap, gapX, gapY);
|
|
30
27
|
applyChildSize(result, childSizeX, childSizeY);
|
|
31
28
|
applyChildRatio(result, childRatioX, childRatioY);
|
|
32
|
-
return
|
|
29
|
+
return result;
|
|
33
30
|
};
|
|
34
|
-
/**
|
|
35
|
-
* 並べる方向によるスタイル
|
|
36
|
-
*/
|
|
37
|
-
const _getLayoutResultByDirection = {
|
|
38
|
-
x: ({ adjustX, adjustY, childSizeX, childSizeY }) => {
|
|
39
|
-
return mergeLayoutResults([_getGridMainAxisTemplate(adjustX, childSizeX, varLayoutTemplateX), _getGridClossAxisAuto(adjustY, childSizeY, varLayoutAutoTracY)]);
|
|
40
|
-
},
|
|
41
|
-
y: ({ adjustX, adjustY, childSizeY, childSizeX }) => {
|
|
42
|
-
return mergeLayoutResults([_getGridClossAxisAuto(adjustX, childSizeX, varLayoutAutoTracX), _getGridMainAxisTemplate(adjustY, childSizeY, varLayoutTemplateY)]);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* direction方向の子要素のサイズを指定するためのテンプレート
|
|
47
|
-
* @param align 子要素の配置
|
|
48
|
-
* @param childSize 子要素のサイズ
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
function _getGridMainAxisTemplate(adjust, childSize, varName) {
|
|
52
|
-
const hasChildSize = hasValue(childSize);
|
|
53
|
-
const style = {};
|
|
54
|
-
if (adjust === "fit") if (hasChildSize) style[varName] = `repeat(auto-fit, minmax(clamp(0px, 100%, ${unit(childSize)}), 1fr))`;
|
|
55
|
-
else style[varName] = "repeat(auto-fit, minmax(0, 1fr))";
|
|
56
|
-
else if (adjust === "grow") if (hasChildSize) style[varName] = `repeat(auto-fit, minmax(${unit(childSize)}, 1fr))`;
|
|
57
|
-
else style[varName] = "repeat(auto-fit, minmax(0, 1fr))";
|
|
58
|
-
else if (adjust === "shrink") if (hasChildSize) style[varName] = `repeat(auto-fit, minmax(0, ${unit(childSize)}))`;
|
|
59
|
-
else style[varName] = "repeat(auto-fit, minmax(0, 1fr))";
|
|
60
|
-
else if (hasChildSize) style[varName] = `repeat(auto-fit, ${unit(childSize)})`;
|
|
61
|
-
else style[varName] = "repeat(auto-fit, minmax(max-content, 100%))";
|
|
62
|
-
return { style };
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* 交差軸方向
|
|
66
|
-
* @param adjust
|
|
67
|
-
* @param childSize
|
|
68
|
-
* @returns
|
|
69
|
-
*/
|
|
70
|
-
function _getGridClossAxisAuto(adjust, childSize, varName) {
|
|
71
|
-
const hasChildSize = hasValue(childSize);
|
|
72
|
-
const style = {};
|
|
73
|
-
if (adjust === "fit") if (hasChildSize) style[varName] = `minmax(0, 100%)`;
|
|
74
|
-
else style[varName] = `minmax(0, 100%)`;
|
|
75
|
-
else if (adjust === "grow") if (hasChildSize) style[varName] = `minmax(${unit(childSize)}, 100%)`;
|
|
76
|
-
else style[varName] = `minmax(auto, 100%)`;
|
|
77
|
-
else if (adjust === "shrink") if (hasChildSize) style[varName] = `minmax(0, ${unit(childSize)})`;
|
|
78
|
-
else style[varName] = `minmax(0, auto)`;
|
|
79
|
-
return { style };
|
|
80
|
-
}
|
|
81
31
|
|
|
82
32
|
//#endregion
|
|
83
33
|
export { tile as default };
|
package/flow/index.cjs
CHANGED
package/layer/index.cjs
CHANGED
package/matrix/index.cjs
CHANGED
package/pack/index.cjs
CHANGED
package/package.json
CHANGED
package/pin/index.cjs
CHANGED
package/stack/index.cjs
CHANGED
package/tile/index.cjs
CHANGED