@fringeworks/style-layouts 0.0.0-stage → 0.8.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/LICENSE +21 -0
- package/README.ja.md +331 -0
- package/README.md +331 -3
- package/_constants.cjs +327 -0
- package/_constants.d.cts +237 -0
- package/_constants.d.mts +237 -0
- package/_constants.mjs +275 -0
- package/_internal/applyGap.cjs +30 -0
- package/_internal/applyGap.d.cts +12 -0
- package/_internal/applyGap.d.mts +13 -0
- package/_internal/applyGap.mjs +30 -0
- package/_internal/applyItemCount.cjs +20 -0
- package/_internal/applyItemCount.d.cts +5 -0
- package/_internal/applyItemCount.d.mts +6 -0
- package/_internal/applyItemCount.mjs +20 -0
- package/_internal/applyItemRatio.cjs +21 -0
- package/_internal/applyItemRatio.d.cts +11 -0
- package/_internal/applyItemRatio.d.mts +12 -0
- package/_internal/applyItemRatio.mjs +21 -0
- package/_internal/applyItemSize.cjs +21 -0
- package/_internal/applyItemSize.d.cts +5 -0
- package/_internal/applyItemSize.d.mts +6 -0
- package/_internal/applyItemSize.mjs +21 -0
- package/_internal/hasValue.cjs +15 -0
- package/_internal/hasValue.d.cts +8 -0
- package/_internal/hasValue.d.mts +9 -0
- package/_internal/hasValue.mjs +14 -0
- package/_internal/mergeClassName.cjs +11 -0
- package/_internal/mergeClassName.d.cts +3 -0
- package/_internal/mergeClassName.d.mts +4 -0
- package/_internal/mergeClassName.mjs +10 -0
- package/_internal/mergeLayoutResults.cjs +16 -0
- package/_internal/mergeLayoutResults.d.cts +5 -0
- package/_internal/mergeLayoutResults.d.mts +6 -0
- package/_internal/mergeLayoutResults.mjs +16 -0
- package/_internal/unit.cjs +9 -0
- package/_internal/unit.d.cts +11 -0
- package/_internal/unit.d.mts +12 -0
- package/_internal/unit.mjs +8 -0
- package/_styles.scss.cjs +1 -0
- package/_styles.scss.d.cts +1 -0
- package/_styles.scss.d.mts +1 -0
- package/_styles.scss.mjs +3 -0
- package/_types.cjs +0 -0
- package/_types.d.cts +115 -0
- package/_types.d.mts +115 -0
- package/_types.mjs +1 -0
- package/_virtual/_rolldown/runtime.cjs +29 -0
- package/balance/balance.cjs +37 -0
- package/balance/balance.d.cts +13 -0
- package/balance/balance.d.mts +14 -0
- package/balance/balance.mjs +35 -0
- package/balance/index.cjs +3 -0
- package/balance/index.d.cts +3 -0
- package/balance/index.d.mts +3 -0
- package/balance/index.mjs +3 -0
- package/balance/styles.css +131 -0
- package/balance/types.cjs +0 -0
- package/balance/types.d.cts +21 -0
- package/balance/types.d.mts +21 -0
- package/balance/types.mjs +1 -0
- package/center/center.cjs +34 -0
- package/center/center.d.cts +12 -0
- package/center/center.d.mts +13 -0
- package/center/center.mjs +32 -0
- package/center/index.cjs +3 -0
- package/center/index.d.cts +3 -0
- package/center/index.d.mts +3 -0
- package/center/index.mjs +3 -0
- package/center/styles.css +157 -0
- package/center/types.cjs +0 -0
- package/center/types.d.cts +9 -0
- package/center/types.d.mts +9 -0
- package/center/types.mjs +1 -0
- package/constants.cjs +109 -0
- package/constants.d.cts +112 -0
- package/constants.d.mts +112 -0
- package/constants.mjs +101 -0
- package/flow/flow.cjs +71 -0
- package/flow/flow.d.cts +12 -0
- package/flow/flow.d.mts +13 -0
- package/flow/flow.mjs +69 -0
- package/flow/index.cjs +3 -0
- package/flow/index.d.cts +3 -0
- package/flow/index.d.mts +3 -0
- package/flow/index.mjs +3 -0
- package/flow/styles.css +160 -0
- package/flow/types.cjs +0 -0
- package/flow/types.d.cts +21 -0
- package/flow/types.d.mts +21 -0
- package/flow/types.mjs +1 -0
- package/helpers/_internal/constants.cjs +25 -0
- package/helpers/_internal/constants.d.cts +13 -0
- package/helpers/_internal/constants.d.mts +13 -0
- package/helpers/_internal/constants.mjs +16 -0
- package/helpers/_internal/createExtractLayoutOptions.cjs +25 -0
- package/helpers/_internal/createExtractLayoutOptions.d.cts +8 -0
- package/helpers/_internal/createExtractLayoutOptions.d.mts +9 -0
- package/helpers/_internal/createExtractLayoutOptions.mjs +24 -0
- package/helpers/extractBalanceOptions.cjs +15 -0
- package/helpers/extractBalanceOptions.d.cts +5 -0
- package/helpers/extractBalanceOptions.d.mts +6 -0
- package/helpers/extractBalanceOptions.mjs +15 -0
- package/helpers/extractCenterOptions.cjs +14 -0
- package/helpers/extractCenterOptions.d.cts +6 -0
- package/helpers/extractCenterOptions.d.mts +7 -0
- package/helpers/extractCenterOptions.mjs +14 -0
- package/helpers/extractFlowOptions.cjs +15 -0
- package/helpers/extractFlowOptions.d.cts +6 -0
- package/helpers/extractFlowOptions.d.mts +7 -0
- package/helpers/extractFlowOptions.mjs +15 -0
- package/helpers/extractLayerOptions.cjs +13 -0
- package/helpers/extractLayerOptions.d.cts +6 -0
- package/helpers/extractLayerOptions.d.mts +7 -0
- package/helpers/extractLayerOptions.mjs +13 -0
- package/helpers/extractMatrixOptions.cjs +17 -0
- package/helpers/extractMatrixOptions.d.cts +5 -0
- package/helpers/extractMatrixOptions.d.mts +6 -0
- package/helpers/extractMatrixOptions.mjs +17 -0
- package/helpers/extractPackOptions.cjs +8 -0
- package/helpers/extractPackOptions.d.cts +6 -0
- package/helpers/extractPackOptions.d.mts +7 -0
- package/helpers/extractPackOptions.mjs +8 -0
- package/helpers/extractPinOptions.cjs +8 -0
- package/helpers/extractPinOptions.d.cts +6 -0
- package/helpers/extractPinOptions.d.mts +7 -0
- package/helpers/extractPinOptions.mjs +8 -0
- package/helpers/extractStackOptions.cjs +15 -0
- package/helpers/extractStackOptions.d.cts +6 -0
- package/helpers/extractStackOptions.d.mts +7 -0
- package/helpers/extractStackOptions.mjs +15 -0
- package/helpers/extractTileOptions.cjs +15 -0
- package/helpers/extractTileOptions.d.cts +6 -0
- package/helpers/extractTileOptions.d.mts +7 -0
- package/helpers/extractTileOptions.mjs +15 -0
- package/helpers/index.cjs +20 -0
- package/helpers/index.d.cts +10 -0
- package/helpers/index.d.mts +10 -0
- package/helpers/index.mjs +11 -0
- package/index.cjs +20 -0
- package/index.d.cts +20 -0
- package/index.d.mts +20 -0
- package/index.mjs +11 -0
- package/layer/index.cjs +3 -0
- package/layer/index.d.cts +3 -0
- package/layer/index.d.mts +3 -0
- package/layer/index.mjs +3 -0
- package/layer/layer.cjs +34 -0
- package/layer/layer.d.cts +13 -0
- package/layer/layer.d.mts +14 -0
- package/layer/layer.mjs +32 -0
- package/layer/styles.css +56 -0
- package/layer/types.cjs +0 -0
- package/layer/types.d.cts +13 -0
- package/layer/types.d.mts +13 -0
- package/layer/types.mjs +1 -0
- package/matrix/index.cjs +3 -0
- package/matrix/index.d.cts +3 -0
- package/matrix/index.d.mts +3 -0
- package/matrix/index.mjs +3 -0
- package/matrix/matrix.cjs +110 -0
- package/matrix/matrix.d.cts +12 -0
- package/matrix/matrix.d.mts +13 -0
- package/matrix/matrix.mjs +108 -0
- package/matrix/styles.css +141 -0
- package/matrix/types.cjs +0 -0
- package/matrix/types.d.cts +46 -0
- package/matrix/types.d.mts +46 -0
- package/matrix/types.mjs +1 -0
- package/pack/index.cjs +3 -0
- package/pack/index.d.cts +3 -0
- package/pack/index.d.mts +3 -0
- package/pack/index.mjs +3 -0
- package/pack/pack.cjs +25 -0
- package/pack/pack.d.cts +11 -0
- package/pack/pack.d.mts +12 -0
- package/pack/pack.mjs +23 -0
- package/pack/styles.css +35 -0
- package/pack/types.cjs +0 -0
- package/pack/types.d.cts +6 -0
- package/pack/types.d.mts +6 -0
- package/pack/types.mjs +1 -0
- package/package.json +52 -4
- package/pin/index.cjs +3 -0
- package/pin/index.d.cts +3 -0
- package/pin/index.d.mts +3 -0
- package/pin/index.mjs +3 -0
- package/pin/pin.cjs +23 -0
- package/pin/pin.d.cts +11 -0
- package/pin/pin.d.mts +12 -0
- package/pin/pin.mjs +23 -0
- package/pin/styles.css +19 -0
- package/pin/types.cjs +0 -0
- package/pin/types.d.cts +6 -0
- package/pin/types.d.mts +6 -0
- package/pin/types.mjs +1 -0
- package/stack/index.cjs +3 -0
- package/stack/index.d.cts +3 -0
- package/stack/index.d.mts +3 -0
- package/stack/index.mjs +3 -0
- package/stack/stack.cjs +96 -0
- package/stack/stack.d.cts +11 -0
- package/stack/stack.d.mts +12 -0
- package/stack/stack.mjs +94 -0
- package/stack/styles.css +167 -0
- package/stack/types.cjs +0 -0
- package/stack/types.d.cts +21 -0
- package/stack/types.d.mts +21 -0
- package/stack/types.mjs +1 -0
- package/styles.css +1055 -0
- package/tile/index.cjs +3 -0
- package/tile/index.d.cts +3 -0
- package/tile/index.d.mts +3 -0
- package/tile/index.mjs +3 -0
- package/tile/styles.css +181 -0
- package/tile/tile.cjs +36 -0
- package/tile/tile.d.cts +12 -0
- package/tile/tile.d.mts +13 -0
- package/tile/tile.mjs +34 -0
- package/tile/types.cjs +0 -0
- package/tile/types.d.cts +9 -0
- package/tile/types.d.mts +9 -0
- package/tile/types.mjs +1 -0
- package/types.cjs +0 -0
- package/types.d.cts +14 -0
- package/types.d.mts +14 -0
- package/types.mjs +1 -0
- package/with-css/balance/index.cjs +8 -0
- package/with-css/balance/index.d.cts +3 -0
- package/with-css/balance/index.d.mts +3 -0
- package/with-css/balance/index.mjs +8 -0
- package/with-css/center/index.cjs +8 -0
- package/with-css/center/index.d.cts +3 -0
- package/with-css/center/index.d.mts +3 -0
- package/with-css/center/index.mjs +8 -0
- package/with-css/flow/index.cjs +8 -0
- package/with-css/flow/index.d.cts +3 -0
- package/with-css/flow/index.d.mts +3 -0
- package/with-css/flow/index.mjs +8 -0
- package/with-css/index.cjs +20 -0
- package/with-css/index.d.cts +20 -0
- package/with-css/index.d.mts +20 -0
- package/with-css/index.mjs +11 -0
- package/with-css/layer/index.cjs +8 -0
- package/with-css/layer/index.d.cts +3 -0
- package/with-css/layer/index.d.mts +3 -0
- package/with-css/layer/index.mjs +8 -0
- package/with-css/matrix/index.cjs +8 -0
- package/with-css/matrix/index.d.cts +3 -0
- package/with-css/matrix/index.d.mts +3 -0
- package/with-css/matrix/index.mjs +8 -0
- package/with-css/pack/index.cjs +8 -0
- package/with-css/pack/index.d.cts +3 -0
- package/with-css/pack/index.d.mts +3 -0
- package/with-css/pack/index.mjs +8 -0
- package/with-css/pin/index.cjs +8 -0
- package/with-css/pin/index.d.cts +3 -0
- package/with-css/pin/index.d.mts +3 -0
- package/with-css/pin/index.mjs +8 -0
- package/with-css/stack/index.cjs +8 -0
- package/with-css/stack/index.d.cts +3 -0
- package/with-css/stack/index.d.mts +3 -0
- package/with-css/stack/index.mjs +8 -0
- package/with-css/tile/index.cjs +8 -0
- package/with-css/tile/index.d.cts +3 -0
- package/with-css/tile/index.d.mts +3 -0
- package/with-css/tile/index.mjs +8 -0
package/_constants.d.mts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Adjust, AlignX, AlignY, Direction } from "./constants.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/_constants.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* レイアウト種別: stack
|
|
6
|
+
*/
|
|
7
|
+
declare const clsLayoutStack = "frg-layout-stack";
|
|
8
|
+
/**
|
|
9
|
+
* レイアウト種別: flow
|
|
10
|
+
*/
|
|
11
|
+
declare const clsLayoutFlow = "frg-layout-flow";
|
|
12
|
+
/**
|
|
13
|
+
* レイアウト種別: tile
|
|
14
|
+
*/
|
|
15
|
+
declare const clsLayoutTile = "frg-layout-tile";
|
|
16
|
+
/**
|
|
17
|
+
* レイアウト種別: matrix
|
|
18
|
+
*/
|
|
19
|
+
declare const clsLayoutMatrix = "frg-layout-matrix";
|
|
20
|
+
/**
|
|
21
|
+
* レイアウト種別: center
|
|
22
|
+
*/
|
|
23
|
+
declare const clsLayoutCenter = "frg-layout-center";
|
|
24
|
+
/**
|
|
25
|
+
* レイアウト種別: pack
|
|
26
|
+
*/
|
|
27
|
+
declare const clsLayoutPack = "frg-layout-pack";
|
|
28
|
+
/**
|
|
29
|
+
* レイアウト種別: balance
|
|
30
|
+
*/
|
|
31
|
+
declare const clsLayoutBalance = "frg-layout-balance";
|
|
32
|
+
/**
|
|
33
|
+
* レイアウト種別: layer
|
|
34
|
+
*/
|
|
35
|
+
declare const clsLayoutLayer = "frg-layout-layer";
|
|
36
|
+
/**
|
|
37
|
+
* レイアウト種別: pin
|
|
38
|
+
*/
|
|
39
|
+
declare const clsLayoutPin = "frg-layout-pin";
|
|
40
|
+
/**
|
|
41
|
+
* 整列: 横方向
|
|
42
|
+
*/
|
|
43
|
+
declare const clsLayoutDirectionX = "frg-layout-direction-x";
|
|
44
|
+
/**
|
|
45
|
+
* 整列: 縦方向
|
|
46
|
+
*/
|
|
47
|
+
declare const clsLayoutDirectionY = "frg-layout-direction-y";
|
|
48
|
+
/**
|
|
49
|
+
* 横位置: 左
|
|
50
|
+
*/
|
|
51
|
+
declare const clsLayoutAlignXLeft = "frg-layout-alignX-left";
|
|
52
|
+
/**
|
|
53
|
+
* 横位置: 中央
|
|
54
|
+
*/
|
|
55
|
+
declare const clsLayoutAlignXCenter = "frg-layout-alignX-center";
|
|
56
|
+
/**
|
|
57
|
+
* 横位置: 右
|
|
58
|
+
*/
|
|
59
|
+
declare const clsLayoutAlignXRight = "frg-layout-alignX-right";
|
|
60
|
+
/**
|
|
61
|
+
* 横位置: 両端揃え
|
|
62
|
+
*/
|
|
63
|
+
declare const clsLayoutAlignXSpaceBetween = "frg-layout-alignX-spaceBetween";
|
|
64
|
+
/**
|
|
65
|
+
* 横位置: 両端余白あり均等
|
|
66
|
+
*/
|
|
67
|
+
declare const clsLayoutAlignXSpaceAround = "frg-layout-alignX-spaceAround";
|
|
68
|
+
/**
|
|
69
|
+
* 横位置: 完全均等
|
|
70
|
+
*/
|
|
71
|
+
declare const clsLayoutAlignXSpaceEvenly = "frg-layout-alignX-spaceEvenly";
|
|
72
|
+
/**
|
|
73
|
+
* 縦位置: 上
|
|
74
|
+
*/
|
|
75
|
+
declare const clsLayoutAlignYTop = "frg-layout-alignY-top";
|
|
76
|
+
/**
|
|
77
|
+
* 縦位置: 中央
|
|
78
|
+
*/
|
|
79
|
+
declare const clsLayoutAlignYMiddle = "frg-layout-alignY-middle";
|
|
80
|
+
/**
|
|
81
|
+
* 縦位置: 下
|
|
82
|
+
*/
|
|
83
|
+
declare const clsLayoutAlignYBottom = "frg-layout-alignY-bottom";
|
|
84
|
+
/**
|
|
85
|
+
* 縦位置: 両端揃え
|
|
86
|
+
*/
|
|
87
|
+
declare const clsLayoutAlignYSpaceBetween = "frg-layout-alignY-spaceBetween";
|
|
88
|
+
/**
|
|
89
|
+
* 縦位置: 両端余白あり均等
|
|
90
|
+
*/
|
|
91
|
+
declare const clsLayoutAlignYSpaceAround = "frg-layout-alignY-spaceAround";
|
|
92
|
+
/**
|
|
93
|
+
* 縦位置: 完全均等
|
|
94
|
+
*/
|
|
95
|
+
declare const clsLayoutAlignYSpaceEvenly = "frg-layout-alignY-spaceEvenly";
|
|
96
|
+
/**
|
|
97
|
+
* 子要素の幅調整: なし
|
|
98
|
+
*/
|
|
99
|
+
declare const clsLayoutAdjustXNone = "frg-layout-adjustX-none";
|
|
100
|
+
/**
|
|
101
|
+
* 子要素の幅調整: 伸ばす & 縮める
|
|
102
|
+
*/
|
|
103
|
+
declare const clsLayoutAdjustXFit = "frg-layout-adjustX-fit";
|
|
104
|
+
/**
|
|
105
|
+
* 子要素の幅調整: 伸ばす
|
|
106
|
+
*/
|
|
107
|
+
declare const clsLayoutAdjustXExpand = "frg-layout-adjustX-grow";
|
|
108
|
+
/**
|
|
109
|
+
* 子要素の幅調整: 縮める
|
|
110
|
+
*/
|
|
111
|
+
declare const clsLayoutAdjustXShrink = "frg-layout-adjustX-shrink";
|
|
112
|
+
/**
|
|
113
|
+
* 子要素の高さ調整: なし
|
|
114
|
+
*/
|
|
115
|
+
declare const clsLayoutAdjustYNone = "frg-layout-adjustY-none";
|
|
116
|
+
/**
|
|
117
|
+
* 子要素の高さ調整: 伸ばす & 縮める
|
|
118
|
+
*/
|
|
119
|
+
declare const clsLayoutAdjustYFit = "frg-layout-adjustY-fit";
|
|
120
|
+
/**
|
|
121
|
+
* 子要素の高さ調整: 伸ばす
|
|
122
|
+
*/
|
|
123
|
+
declare const clsLayoutAdjustYExpand = "frg-layout-adjustY-grow";
|
|
124
|
+
/**
|
|
125
|
+
* 子要素の高さ調整: 縮める
|
|
126
|
+
*/
|
|
127
|
+
declare const clsLayoutAdjustYShrink = "frg-layout-adjustY-shrink";
|
|
128
|
+
/**
|
|
129
|
+
* 間隔: 横方向
|
|
130
|
+
*/
|
|
131
|
+
declare const clsLayoutGapX = "frg-layout-gapX";
|
|
132
|
+
/**
|
|
133
|
+
* 間隔: 縦方向
|
|
134
|
+
*/
|
|
135
|
+
declare const clsLayoutGapY = "frg-layout-gapY";
|
|
136
|
+
/**
|
|
137
|
+
* 子要素の幅
|
|
138
|
+
*/
|
|
139
|
+
declare const clsLayoutItemSizeX = "frg-layout-itemSizeX";
|
|
140
|
+
/**
|
|
141
|
+
* 子要素の高さ
|
|
142
|
+
*/
|
|
143
|
+
declare const clsLayoutItemSizeY = "frg-layout-itemSizeY";
|
|
144
|
+
/**
|
|
145
|
+
* 子要素の縦横比
|
|
146
|
+
*/
|
|
147
|
+
declare const clsLayoutItemRatio = "frg-layout-itemRatio";
|
|
148
|
+
/**
|
|
149
|
+
* 子要素の横方向の数
|
|
150
|
+
*/
|
|
151
|
+
declare const clsLayoutItemCountX = "frg-layout-itemCountX";
|
|
152
|
+
/**
|
|
153
|
+
* 子要素の縦方向の数
|
|
154
|
+
*/
|
|
155
|
+
declare const clsLayoutItemCountY = "frg-layout-itemCountY";
|
|
156
|
+
/**
|
|
157
|
+
* 横方向のテンプレート
|
|
158
|
+
*/
|
|
159
|
+
declare const clsLayoutTemplateX = "frg-layout-templateX";
|
|
160
|
+
/**
|
|
161
|
+
* 縦方向のテンプレート
|
|
162
|
+
*/
|
|
163
|
+
declare const clsLayoutTemplateY = "frg-layout-templateY";
|
|
164
|
+
/**
|
|
165
|
+
* 変数\
|
|
166
|
+
* 間隔: 横方向
|
|
167
|
+
*/
|
|
168
|
+
declare const varLayoutGapX = "--frg-layout-gapX";
|
|
169
|
+
/**
|
|
170
|
+
* 変数\
|
|
171
|
+
* 間隔: 縦方向
|
|
172
|
+
*/
|
|
173
|
+
declare const varLayoutGapY = "--frg-layout-gapY";
|
|
174
|
+
/**
|
|
175
|
+
* 変数\
|
|
176
|
+
* 子要素の幅
|
|
177
|
+
*/
|
|
178
|
+
declare const varLayoutItemSizeX = "--frg-layout-itemSizeX";
|
|
179
|
+
/**
|
|
180
|
+
* 変数\
|
|
181
|
+
* 子要素の高さ
|
|
182
|
+
*/
|
|
183
|
+
declare const varLayoutItemSizeY = "--frg-layout-itemSizeY";
|
|
184
|
+
/**
|
|
185
|
+
* 変数\
|
|
186
|
+
* 子要素の縦横比
|
|
187
|
+
*/
|
|
188
|
+
declare const varLayoutItemRatio = "--frg-layout-itemRatio";
|
|
189
|
+
/**
|
|
190
|
+
* 変数\
|
|
191
|
+
* 子要素の横方向の数
|
|
192
|
+
*/
|
|
193
|
+
declare const varLayoutItemCountX = "--frg-layout-itemCountX";
|
|
194
|
+
/**
|
|
195
|
+
* 変数\
|
|
196
|
+
* 子要素の縦方向の数
|
|
197
|
+
*/
|
|
198
|
+
declare const varLayoutItemCountY = "--frg-layout-itemCountY";
|
|
199
|
+
/**
|
|
200
|
+
* 変数\
|
|
201
|
+
* 横方向のテンプレート
|
|
202
|
+
*/
|
|
203
|
+
declare const varLayoutTemplateX = "--frg-layout-templateX";
|
|
204
|
+
/**
|
|
205
|
+
* 変数\
|
|
206
|
+
* 縦方向のテンプレート
|
|
207
|
+
*/
|
|
208
|
+
declare const varLayoutTemplateY = "--frg-layout-templateY";
|
|
209
|
+
/**
|
|
210
|
+
* axis毎のクラス
|
|
211
|
+
*/
|
|
212
|
+
declare const clsLayout: {
|
|
213
|
+
direction: Record<Direction, string>;
|
|
214
|
+
align: Record<Direction, Partial<Record<AlignX | AlignY, string>>>;
|
|
215
|
+
adjust: Record<Direction, Record<Adjust, string>>;
|
|
216
|
+
itemSize: Record<Direction, string>;
|
|
217
|
+
template: Record<Direction, string>;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* axis毎の変数
|
|
221
|
+
*/
|
|
222
|
+
declare const varLayout: {
|
|
223
|
+
readonly itemSize: {
|
|
224
|
+
readonly x: "--frg-layout-itemSizeX";
|
|
225
|
+
readonly y: "--frg-layout-itemSizeY";
|
|
226
|
+
};
|
|
227
|
+
readonly template: {
|
|
228
|
+
readonly x: "--frg-layout-templateX";
|
|
229
|
+
readonly y: "--frg-layout-templateY";
|
|
230
|
+
};
|
|
231
|
+
readonly gap: {
|
|
232
|
+
readonly x: "--frg-layout-gapX";
|
|
233
|
+
readonly y: "--frg-layout-gapY";
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
//#endregion
|
|
237
|
+
export { clsLayout, clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutBalance, clsLayoutCenter, clsLayoutDirectionX, clsLayoutDirectionY, clsLayoutFlow, clsLayoutGapX, clsLayoutGapY, clsLayoutItemCountX, clsLayoutItemCountY, clsLayoutItemRatio, clsLayoutItemSizeX, clsLayoutItemSizeY, clsLayoutLayer, clsLayoutMatrix, clsLayoutPack, clsLayoutPin, clsLayoutStack, clsLayoutTemplateX, clsLayoutTemplateY, clsLayoutTile, varLayout, varLayoutGapX, varLayoutGapY, varLayoutItemCountX, varLayoutItemCountY, varLayoutItemRatio, varLayoutItemSizeX, varLayoutItemSizeY, varLayoutTemplateX, varLayoutTemplateY };
|
package/_constants.mjs
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
//#region src/_constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* レイアウト種別: stack
|
|
4
|
+
*/
|
|
5
|
+
const clsLayoutStack = "frg-layout-stack";
|
|
6
|
+
/**
|
|
7
|
+
* レイアウト種別: flow
|
|
8
|
+
*/
|
|
9
|
+
const clsLayoutFlow = "frg-layout-flow";
|
|
10
|
+
/**
|
|
11
|
+
* レイアウト種別: tile
|
|
12
|
+
*/
|
|
13
|
+
const clsLayoutTile = "frg-layout-tile";
|
|
14
|
+
/**
|
|
15
|
+
* レイアウト種別: matrix
|
|
16
|
+
*/
|
|
17
|
+
const clsLayoutMatrix = "frg-layout-matrix";
|
|
18
|
+
/**
|
|
19
|
+
* レイアウト種別: center
|
|
20
|
+
*/
|
|
21
|
+
const clsLayoutCenter = "frg-layout-center";
|
|
22
|
+
/**
|
|
23
|
+
* レイアウト種別: pack
|
|
24
|
+
*/
|
|
25
|
+
const clsLayoutPack = "frg-layout-pack";
|
|
26
|
+
/**
|
|
27
|
+
* レイアウト種別: balance
|
|
28
|
+
*/
|
|
29
|
+
const clsLayoutBalance = "frg-layout-balance";
|
|
30
|
+
/**
|
|
31
|
+
* レイアウト種別: layer
|
|
32
|
+
*/
|
|
33
|
+
const clsLayoutLayer = "frg-layout-layer";
|
|
34
|
+
/**
|
|
35
|
+
* レイアウト種別: pin
|
|
36
|
+
*/
|
|
37
|
+
const clsLayoutPin = "frg-layout-pin";
|
|
38
|
+
/**
|
|
39
|
+
* 整列: 横方向
|
|
40
|
+
*/
|
|
41
|
+
const clsLayoutDirectionX = "frg-layout-direction-x";
|
|
42
|
+
/**
|
|
43
|
+
* 整列: 縦方向
|
|
44
|
+
*/
|
|
45
|
+
const clsLayoutDirectionY = "frg-layout-direction-y";
|
|
46
|
+
/**
|
|
47
|
+
* 横位置: 左
|
|
48
|
+
*/
|
|
49
|
+
const clsLayoutAlignXLeft = "frg-layout-alignX-left";
|
|
50
|
+
/**
|
|
51
|
+
* 横位置: 中央
|
|
52
|
+
*/
|
|
53
|
+
const clsLayoutAlignXCenter = "frg-layout-alignX-center";
|
|
54
|
+
/**
|
|
55
|
+
* 横位置: 右
|
|
56
|
+
*/
|
|
57
|
+
const clsLayoutAlignXRight = "frg-layout-alignX-right";
|
|
58
|
+
/**
|
|
59
|
+
* 横位置: 両端揃え
|
|
60
|
+
*/
|
|
61
|
+
const clsLayoutAlignXSpaceBetween = "frg-layout-alignX-spaceBetween";
|
|
62
|
+
/**
|
|
63
|
+
* 横位置: 両端余白あり均等
|
|
64
|
+
*/
|
|
65
|
+
const clsLayoutAlignXSpaceAround = "frg-layout-alignX-spaceAround";
|
|
66
|
+
/**
|
|
67
|
+
* 横位置: 完全均等
|
|
68
|
+
*/
|
|
69
|
+
const clsLayoutAlignXSpaceEvenly = "frg-layout-alignX-spaceEvenly";
|
|
70
|
+
/**
|
|
71
|
+
* 縦位置: 上
|
|
72
|
+
*/
|
|
73
|
+
const clsLayoutAlignYTop = "frg-layout-alignY-top";
|
|
74
|
+
/**
|
|
75
|
+
* 縦位置: 中央
|
|
76
|
+
*/
|
|
77
|
+
const clsLayoutAlignYMiddle = "frg-layout-alignY-middle";
|
|
78
|
+
/**
|
|
79
|
+
* 縦位置: 下
|
|
80
|
+
*/
|
|
81
|
+
const clsLayoutAlignYBottom = "frg-layout-alignY-bottom";
|
|
82
|
+
/**
|
|
83
|
+
* 縦位置: 両端揃え
|
|
84
|
+
*/
|
|
85
|
+
const clsLayoutAlignYSpaceBetween = "frg-layout-alignY-spaceBetween";
|
|
86
|
+
/**
|
|
87
|
+
* 縦位置: 両端余白あり均等
|
|
88
|
+
*/
|
|
89
|
+
const clsLayoutAlignYSpaceAround = "frg-layout-alignY-spaceAround";
|
|
90
|
+
/**
|
|
91
|
+
* 縦位置: 完全均等
|
|
92
|
+
*/
|
|
93
|
+
const clsLayoutAlignYSpaceEvenly = "frg-layout-alignY-spaceEvenly";
|
|
94
|
+
/**
|
|
95
|
+
* 子要素の幅調整: なし
|
|
96
|
+
*/
|
|
97
|
+
const clsLayoutAdjustXNone = "frg-layout-adjustX-none";
|
|
98
|
+
/**
|
|
99
|
+
* 子要素の幅調整: 伸ばす & 縮める
|
|
100
|
+
*/
|
|
101
|
+
const clsLayoutAdjustXFit = "frg-layout-adjustX-fit";
|
|
102
|
+
/**
|
|
103
|
+
* 子要素の幅調整: 伸ばす
|
|
104
|
+
*/
|
|
105
|
+
const clsLayoutAdjustXExpand = "frg-layout-adjustX-grow";
|
|
106
|
+
/**
|
|
107
|
+
* 子要素の幅調整: 縮める
|
|
108
|
+
*/
|
|
109
|
+
const clsLayoutAdjustXShrink = "frg-layout-adjustX-shrink";
|
|
110
|
+
/**
|
|
111
|
+
* 子要素の高さ調整: なし
|
|
112
|
+
*/
|
|
113
|
+
const clsLayoutAdjustYNone = "frg-layout-adjustY-none";
|
|
114
|
+
/**
|
|
115
|
+
* 子要素の高さ調整: 伸ばす & 縮める
|
|
116
|
+
*/
|
|
117
|
+
const clsLayoutAdjustYFit = "frg-layout-adjustY-fit";
|
|
118
|
+
/**
|
|
119
|
+
* 子要素の高さ調整: 伸ばす
|
|
120
|
+
*/
|
|
121
|
+
const clsLayoutAdjustYExpand = "frg-layout-adjustY-grow";
|
|
122
|
+
/**
|
|
123
|
+
* 子要素の高さ調整: 縮める
|
|
124
|
+
*/
|
|
125
|
+
const clsLayoutAdjustYShrink = "frg-layout-adjustY-shrink";
|
|
126
|
+
/**
|
|
127
|
+
* 間隔: 横方向
|
|
128
|
+
*/
|
|
129
|
+
const clsLayoutGapX = "frg-layout-gapX";
|
|
130
|
+
/**
|
|
131
|
+
* 間隔: 縦方向
|
|
132
|
+
*/
|
|
133
|
+
const clsLayoutGapY = "frg-layout-gapY";
|
|
134
|
+
/**
|
|
135
|
+
* 子要素の幅
|
|
136
|
+
*/
|
|
137
|
+
const clsLayoutItemSizeX = "frg-layout-itemSizeX";
|
|
138
|
+
/**
|
|
139
|
+
* 子要素の高さ
|
|
140
|
+
*/
|
|
141
|
+
const clsLayoutItemSizeY = "frg-layout-itemSizeY";
|
|
142
|
+
/**
|
|
143
|
+
* 子要素の縦横比
|
|
144
|
+
*/
|
|
145
|
+
const clsLayoutItemRatio = "frg-layout-itemRatio";
|
|
146
|
+
/**
|
|
147
|
+
* 子要素の横方向の数
|
|
148
|
+
*/
|
|
149
|
+
const clsLayoutItemCountX = "frg-layout-itemCountX";
|
|
150
|
+
/**
|
|
151
|
+
* 子要素の縦方向の数
|
|
152
|
+
*/
|
|
153
|
+
const clsLayoutItemCountY = "frg-layout-itemCountY";
|
|
154
|
+
/**
|
|
155
|
+
* 横方向のテンプレート
|
|
156
|
+
*/
|
|
157
|
+
const clsLayoutTemplateX = "frg-layout-templateX";
|
|
158
|
+
/**
|
|
159
|
+
* 縦方向のテンプレート
|
|
160
|
+
*/
|
|
161
|
+
const clsLayoutTemplateY = "frg-layout-templateY";
|
|
162
|
+
/**
|
|
163
|
+
* 変数\
|
|
164
|
+
* 間隔: 横方向
|
|
165
|
+
*/
|
|
166
|
+
const varLayoutGapX = "--frg-layout-gapX";
|
|
167
|
+
/**
|
|
168
|
+
* 変数\
|
|
169
|
+
* 間隔: 縦方向
|
|
170
|
+
*/
|
|
171
|
+
const varLayoutGapY = "--frg-layout-gapY";
|
|
172
|
+
/**
|
|
173
|
+
* 変数\
|
|
174
|
+
* 子要素の幅
|
|
175
|
+
*/
|
|
176
|
+
const varLayoutItemSizeX = "--frg-layout-itemSizeX";
|
|
177
|
+
/**
|
|
178
|
+
* 変数\
|
|
179
|
+
* 子要素の高さ
|
|
180
|
+
*/
|
|
181
|
+
const varLayoutItemSizeY = "--frg-layout-itemSizeY";
|
|
182
|
+
/**
|
|
183
|
+
* 変数\
|
|
184
|
+
* 子要素の縦横比
|
|
185
|
+
*/
|
|
186
|
+
const varLayoutItemRatio = "--frg-layout-itemRatio";
|
|
187
|
+
/**
|
|
188
|
+
* 変数\
|
|
189
|
+
* 子要素の横方向の数
|
|
190
|
+
*/
|
|
191
|
+
const varLayoutItemCountX = "--frg-layout-itemCountX";
|
|
192
|
+
/**
|
|
193
|
+
* 変数\
|
|
194
|
+
* 子要素の縦方向の数
|
|
195
|
+
*/
|
|
196
|
+
const varLayoutItemCountY = "--frg-layout-itemCountY";
|
|
197
|
+
/**
|
|
198
|
+
* 変数\
|
|
199
|
+
* 横方向のテンプレート
|
|
200
|
+
*/
|
|
201
|
+
const varLayoutTemplateX = "--frg-layout-templateX";
|
|
202
|
+
/**
|
|
203
|
+
* 変数\
|
|
204
|
+
* 縦方向のテンプレート
|
|
205
|
+
*/
|
|
206
|
+
const varLayoutTemplateY = "--frg-layout-templateY";
|
|
207
|
+
/**
|
|
208
|
+
* axis毎のクラス
|
|
209
|
+
*/
|
|
210
|
+
const clsLayout = {
|
|
211
|
+
direction: {
|
|
212
|
+
x: clsLayoutDirectionX,
|
|
213
|
+
y: clsLayoutDirectionY
|
|
214
|
+
},
|
|
215
|
+
align: {
|
|
216
|
+
x: {
|
|
217
|
+
left: clsLayoutAlignXLeft,
|
|
218
|
+
center: clsLayoutAlignXCenter,
|
|
219
|
+
right: clsLayoutAlignXRight,
|
|
220
|
+
"space-between": clsLayoutAlignXSpaceBetween,
|
|
221
|
+
"space-around": clsLayoutAlignXSpaceAround,
|
|
222
|
+
"space-evenly": clsLayoutAlignXSpaceEvenly
|
|
223
|
+
},
|
|
224
|
+
y: {
|
|
225
|
+
top: clsLayoutAlignYTop,
|
|
226
|
+
middle: clsLayoutAlignYMiddle,
|
|
227
|
+
bottom: clsLayoutAlignYBottom,
|
|
228
|
+
"space-between": clsLayoutAlignYSpaceBetween,
|
|
229
|
+
"space-around": clsLayoutAlignYSpaceAround,
|
|
230
|
+
"space-evenly": clsLayoutAlignYSpaceEvenly
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
adjust: {
|
|
234
|
+
x: {
|
|
235
|
+
none: clsLayoutAdjustXNone,
|
|
236
|
+
fit: clsLayoutAdjustXFit,
|
|
237
|
+
grow: clsLayoutAdjustXExpand,
|
|
238
|
+
shrink: clsLayoutAdjustXShrink
|
|
239
|
+
},
|
|
240
|
+
y: {
|
|
241
|
+
none: clsLayoutAdjustYNone,
|
|
242
|
+
fit: clsLayoutAdjustYFit,
|
|
243
|
+
grow: clsLayoutAdjustYExpand,
|
|
244
|
+
shrink: clsLayoutAdjustYShrink
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
itemSize: {
|
|
248
|
+
x: clsLayoutItemSizeX,
|
|
249
|
+
y: clsLayoutItemSizeY
|
|
250
|
+
},
|
|
251
|
+
template: {
|
|
252
|
+
x: clsLayoutTemplateX,
|
|
253
|
+
y: clsLayoutTemplateY
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* axis毎の変数
|
|
258
|
+
*/
|
|
259
|
+
const varLayout = {
|
|
260
|
+
itemSize: {
|
|
261
|
+
x: varLayoutItemSizeX,
|
|
262
|
+
y: varLayoutItemSizeY
|
|
263
|
+
},
|
|
264
|
+
template: {
|
|
265
|
+
x: varLayoutTemplateX,
|
|
266
|
+
y: varLayoutTemplateY
|
|
267
|
+
},
|
|
268
|
+
gap: {
|
|
269
|
+
x: varLayoutGapX,
|
|
270
|
+
y: varLayoutGapY
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
//#endregion
|
|
275
|
+
export { clsLayout, clsLayoutAdjustXExpand, clsLayoutAdjustXFit, clsLayoutAdjustXNone, clsLayoutAdjustXShrink, clsLayoutAdjustYExpand, clsLayoutAdjustYFit, clsLayoutAdjustYNone, clsLayoutAdjustYShrink, clsLayoutAlignXCenter, clsLayoutAlignXLeft, clsLayoutAlignXRight, clsLayoutAlignXSpaceAround, clsLayoutAlignXSpaceBetween, clsLayoutAlignXSpaceEvenly, clsLayoutAlignYBottom, clsLayoutAlignYMiddle, clsLayoutAlignYSpaceAround, clsLayoutAlignYSpaceBetween, clsLayoutAlignYSpaceEvenly, clsLayoutAlignYTop, clsLayoutBalance, clsLayoutCenter, clsLayoutDirectionX, clsLayoutDirectionY, clsLayoutFlow, clsLayoutGapX, clsLayoutGapY, clsLayoutItemCountX, clsLayoutItemCountY, clsLayoutItemRatio, clsLayoutItemSizeX, clsLayoutItemSizeY, clsLayoutLayer, clsLayoutMatrix, clsLayoutPack, clsLayoutPin, clsLayoutStack, clsLayoutTemplateX, clsLayoutTemplateY, clsLayoutTile, varLayout, varLayoutGapX, varLayoutGapY, varLayoutItemCountX, varLayoutItemCountY, varLayoutItemRatio, varLayoutItemSizeX, varLayoutItemSizeY, varLayoutTemplateX, varLayoutTemplateY };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const require__constants = require('../_constants.cjs');
|
|
2
|
+
const require__internal_hasValue = require('./hasValue.cjs');
|
|
3
|
+
const require__internal_mergeClassName = require('./mergeClassName.cjs');
|
|
4
|
+
const require__internal_unit = require('./unit.cjs');
|
|
5
|
+
|
|
6
|
+
//#region src/_internal/applyGap.ts
|
|
7
|
+
/**
|
|
8
|
+
* スペーシングに関する設定の適用
|
|
9
|
+
* @param result
|
|
10
|
+
* @param gap
|
|
11
|
+
* @param gapX
|
|
12
|
+
* @param gapY
|
|
13
|
+
*/
|
|
14
|
+
function applyGap(result, gap, gapX, gapY) {
|
|
15
|
+
gapX = gapX ?? gap;
|
|
16
|
+
if (require__internal_hasValue(gapX)) {
|
|
17
|
+
result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutGapX);
|
|
18
|
+
result.style ??= {};
|
|
19
|
+
result.style[require__constants.varLayoutGapX] = require__internal_unit(gapX);
|
|
20
|
+
}
|
|
21
|
+
gapY = gapY ?? gap;
|
|
22
|
+
if (require__internal_hasValue(gapY)) {
|
|
23
|
+
result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutGapY);
|
|
24
|
+
result.style ??= {};
|
|
25
|
+
result.style[require__constants.varLayoutGapY] = require__internal_unit(gapY);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
module.exports = applyGap;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LayoutStyle } from "../types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/_internal/applyGap.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* スペーシングに関する設定の適用
|
|
6
|
+
* @param result
|
|
7
|
+
* @param gap
|
|
8
|
+
* @param gapX
|
|
9
|
+
* @param gapY
|
|
10
|
+
*/
|
|
11
|
+
declare function applyGap(result: LayoutStyle, gap: number | null | undefined, gapX: number | null | undefined, gapY: number | null | undefined): void;
|
|
12
|
+
export = applyGap;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LayoutStyle } from "../types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/_internal/applyGap.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* スペーシングに関する設定の適用
|
|
6
|
+
* @param result
|
|
7
|
+
* @param gap
|
|
8
|
+
* @param gapX
|
|
9
|
+
* @param gapY
|
|
10
|
+
*/
|
|
11
|
+
declare function applyGap(result: LayoutStyle, gap: number | null | undefined, gapX: number | null | undefined, gapY: number | null | undefined): void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { applyGap as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { clsLayoutGapX, clsLayoutGapY, varLayoutGapX, varLayoutGapY } from "../_constants.mjs";
|
|
2
|
+
import hasValue from "./hasValue.mjs";
|
|
3
|
+
import mergeClassName from "./mergeClassName.mjs";
|
|
4
|
+
import unit from "./unit.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/_internal/applyGap.ts
|
|
7
|
+
/**
|
|
8
|
+
* スペーシングに関する設定の適用
|
|
9
|
+
* @param result
|
|
10
|
+
* @param gap
|
|
11
|
+
* @param gapX
|
|
12
|
+
* @param gapY
|
|
13
|
+
*/
|
|
14
|
+
function applyGap(result, gap, gapX, gapY) {
|
|
15
|
+
gapX = gapX ?? gap;
|
|
16
|
+
if (hasValue(gapX)) {
|
|
17
|
+
result.className = mergeClassName(result.className, clsLayoutGapX);
|
|
18
|
+
result.style ??= {};
|
|
19
|
+
result.style[varLayoutGapX] = unit(gapX);
|
|
20
|
+
}
|
|
21
|
+
gapY = gapY ?? gap;
|
|
22
|
+
if (hasValue(gapY)) {
|
|
23
|
+
result.className = mergeClassName(result.className, clsLayoutGapY);
|
|
24
|
+
result.style ??= {};
|
|
25
|
+
result.style[varLayoutGapY] = unit(gapY);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { applyGap as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const require__constants = require('../_constants.cjs');
|
|
2
|
+
const require__internal_hasValue = require('./hasValue.cjs');
|
|
3
|
+
const require__internal_mergeClassName = require('./mergeClassName.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/_internal/applyItemCount.ts
|
|
6
|
+
function applyItemCount(result, itemCountX, itemCountY) {
|
|
7
|
+
if (require__internal_hasValue(itemCountX)) {
|
|
8
|
+
result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutItemCountX);
|
|
9
|
+
result.style ??= {};
|
|
10
|
+
result.style[require__constants.varLayoutItemCountX] = `${itemCountX}`;
|
|
11
|
+
}
|
|
12
|
+
if (require__internal_hasValue(itemCountY)) {
|
|
13
|
+
result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutItemCountY);
|
|
14
|
+
result.style ??= {};
|
|
15
|
+
result.style[require__constants.varLayoutItemCountY] = `${itemCountY}`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
module.exports = applyItemCount;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LayoutStyle } from "../types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/_internal/applyItemCount.d.ts
|
|
4
|
+
declare function applyItemCount(result: LayoutStyle, itemCountX: number | null | undefined, itemCountY: number | null | undefined): void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { applyItemCount as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsLayoutItemCountX, clsLayoutItemCountY, varLayoutItemCountX, varLayoutItemCountY } from "../_constants.mjs";
|
|
2
|
+
import hasValue from "./hasValue.mjs";
|
|
3
|
+
import mergeClassName from "./mergeClassName.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/_internal/applyItemCount.ts
|
|
6
|
+
function applyItemCount(result, itemCountX, itemCountY) {
|
|
7
|
+
if (hasValue(itemCountX)) {
|
|
8
|
+
result.className = mergeClassName(result.className, clsLayoutItemCountX);
|
|
9
|
+
result.style ??= {};
|
|
10
|
+
result.style[varLayoutItemCountX] = `${itemCountX}`;
|
|
11
|
+
}
|
|
12
|
+
if (hasValue(itemCountY)) {
|
|
13
|
+
result.className = mergeClassName(result.className, clsLayoutItemCountY);
|
|
14
|
+
result.style ??= {};
|
|
15
|
+
result.style[varLayoutItemCountY] = `${itemCountY}`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { applyItemCount as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require__constants = require('../_constants.cjs');
|
|
2
|
+
const require__internal_hasValue = require('./hasValue.cjs');
|
|
3
|
+
const require__internal_mergeClassName = require('./mergeClassName.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/_internal/applyItemRatio.ts
|
|
6
|
+
/**
|
|
7
|
+
* 子要素の縦横比に関する設定の適用
|
|
8
|
+
* @param result
|
|
9
|
+
* @param itemRatioX
|
|
10
|
+
* @param itemRatioY
|
|
11
|
+
*/
|
|
12
|
+
function applyItemRatio(result, itemRatioX, itemRatioY) {
|
|
13
|
+
if (require__internal_hasValue(itemRatioX) || require__internal_hasValue(itemRatioY)) {
|
|
14
|
+
result.className = require__internal_mergeClassName(result.className, require__constants.clsLayoutItemRatio);
|
|
15
|
+
result.style ??= {};
|
|
16
|
+
result.style[require__constants.varLayoutItemRatio] = `${itemRatioX ?? 1} / ${itemRatioY ?? 1}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
module.exports = applyItemRatio;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LayoutStyle } from "../types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/_internal/applyItemRatio.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 子要素の縦横比に関する設定の適用
|
|
6
|
+
* @param result
|
|
7
|
+
* @param itemRatioX
|
|
8
|
+
* @param itemRatioY
|
|
9
|
+
*/
|
|
10
|
+
declare function applyItemRatio(result: LayoutStyle, itemRatioX: number | null | undefined, itemRatioY: number | null | undefined): void;
|
|
11
|
+
export = applyItemRatio;
|