1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports.countToColumns = exports.widthToColumns = void 0;
|
5 |
|
6 |
|
7 |
|
8 | var px = function px(n) {
|
9 | return typeof n === "number" ? n + "px" : n;
|
10 | };
|
11 |
|
12 | var widthToColumns = function widthToColumns(width) {
|
13 | if (Array.isArray(width)) {
|
14 | return width.map(widthToColumns);
|
15 | }
|
16 |
|
17 | if (width !== null && typeof width === "object" && Object.keys(width).length > 0) {
|
18 | var acc = {};
|
19 |
|
20 | for (var key in width) {
|
21 | acc[key] = "repeat(auto-fit, minmax(" + px(width[key]) + ", 1fr))";
|
22 | }
|
23 |
|
24 | return acc;
|
25 | }
|
26 |
|
27 | if (width != null) {
|
28 | return "repeat(auto-fit, minmax(" + px(width) + ", 1fr))";
|
29 | }
|
30 |
|
31 | return null;
|
32 | };
|
33 |
|
34 | exports.widthToColumns = widthToColumns;
|
35 |
|
36 | var countToColumns = function countToColumns(count) {
|
37 | if (Array.isArray(count)) {
|
38 | return count.map(countToColumns);
|
39 | }
|
40 |
|
41 | if (count !== null && typeof count === "object" && Object.keys(count).length > 0) {
|
42 | var acc = {};
|
43 |
|
44 | for (var key in count) {
|
45 | acc[key] = "repeat(" + count[key] + ", 1fr)";
|
46 | }
|
47 |
|
48 | return acc;
|
49 | }
|
50 |
|
51 | if (count != null) {
|
52 | return "repeat(" + count + ", 1fr)";
|
53 | }
|
54 |
|
55 | return null;
|
56 | };
|
57 |
|
58 | exports.countToColumns = countToColumns; |
\ | No newline at end of file |