@smart-react-components/ui 2.0.14 → 2.0.16

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/Table/Tr.js CHANGED
@@ -5,17 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Tr_1 = __importDefault(require("@smart-react-components/core/Element/Tr"));
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
- exports.default = (0, styled_components_1.default)(Tr_1.default)(({ theme, hasHover, isEven, isSoft, palette, startIndex = 0 }) => `
8
+ exports.default = (0, styled_components_1.default)(Tr_1.default)(({ theme, hasHover, isEven, isSoft, palette, startIndex = 0 }) => {
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
10
+ return `
9
11
  ${palette
10
- ? `
12
+ ? `
11
13
  > *:nth-child(n+${startIndex}) {
12
14
  ${!isSoft
13
- ? `
14
- background: ${!isEven ? theme.$.palette[palette].background : theme.$.palette[palette].dynamic};
15
- border-color: ${theme.$.palette[palette].dynamicest};
16
- color: ${theme.$.palette[palette].font};
15
+ ? `
16
+ background: ${!isEven ? ((_c = (_b = (_a = theme.$.palette[palette].table) === null || _a === void 0 ? void 0 : _a.odd) === null || _b === void 0 ? void 0 : _b.background) !== null && _c !== void 0 ? _c : theme.$.palette[palette].background) : ((_f = (_e = (_d = theme.$.palette[palette].table) === null || _d === void 0 ? void 0 : _d.even) === null || _e === void 0 ? void 0 : _e.background) !== null && _f !== void 0 ? _f : theme.$.palette[palette].dynamic)};
17
+ border-color: ${!isEven ? ((_j = (_h = (_g = theme.$.palette[palette].table) === null || _g === void 0 ? void 0 : _g.odd) === null || _h === void 0 ? void 0 : _h.border) !== null && _j !== void 0 ? _j : theme.$.palette[palette].dynamicest) : ((_m = (_l = (_k = theme.$.palette[palette].table) === null || _k === void 0 ? void 0 : _k.even) === null || _l === void 0 ? void 0 : _l.border) !== null && _m !== void 0 ? _m : theme.$.palette[palette].dynamicest)};
18
+ color: ${!isEven ? ((_q = (_p = (_o = theme.$.palette[palette]) === null || _o === void 0 ? void 0 : _o.odd) === null || _p === void 0 ? void 0 : _p.font) !== null && _q !== void 0 ? _q : theme.$.palette[palette].font) : ((_t = (_s = (_r = theme.$.palette[palette]) === null || _r === void 0 ? void 0 : _r.even) === null || _s === void 0 ? void 0 : _s.font) !== null && _t !== void 0 ? _t : theme.$.palette[palette].font)};
17
19
  `
18
- : `
20
+ : `
19
21
  background: ${!isEven ? theme.$.palette[palette].softBackground : theme.$.palette[palette].softDynamic};
20
22
  border-color: ${theme.$.palette[palette].softDynamicest};
21
23
  color: ${theme.$.palette[palette].softFont};
@@ -23,12 +25,19 @@ exports.default = (0, styled_components_1.default)(Tr_1.default)(({ theme, hasHo
23
25
  }
24
26
 
25
27
  ${hasHover
26
- ? `
28
+ ? `
27
29
  &:hover > *:nth-child(n+${startIndex}) {
28
- background: ${!isSoft ? theme.$.palette[palette].dynamicer : theme.$.palette[palette].softDynamicer};
30
+ ${!isSoft
31
+ ? `
32
+ background: ${!isEven ? ((_x = (_w = (_v = (_u = theme.$.palette[palette].table) === null || _u === void 0 ? void 0 : _u.odd) === null || _v === void 0 ? void 0 : _v.hover) === null || _w === void 0 ? void 0 : _w.background) !== null && _x !== void 0 ? _x : theme.$.palette[palette].dynamicer) : ((_1 = (_0 = (_z = (_y = theme.$.palette[palette].table) === null || _y === void 0 ? void 0 : _y.even) === null || _z === void 0 ? void 0 : _z.hover) === null || _0 === void 0 ? void 0 : _0.background) !== null && _1 !== void 0 ? _1 : theme.$.palette[palette].dynamicer)};
33
+ `
34
+ : `
35
+ background: ${theme.$.palette[palette].softDynamicer};
36
+ `}
29
37
  }
30
38
  `
31
- : ''}
39
+ : ''}
32
40
  `
33
- : ''}
34
- `);
41
+ : ''}
42
+ `;
43
+ });
@@ -17,7 +17,9 @@ exports.default = (0, styled_components_1.default)(Table_1.default).attrs({
17
17
  font-size: ${t.$.size.table[v].headFontSize};
18
18
  }
19
19
  `,
20
- })(({ theme, hasBorderX, hasBorderY, hasHeadBackground, hasHover, isBlock, isSoft, isStriped, palette, shape, stripedOrientation }) => `
20
+ })(({ theme, hasBorderX, hasBorderY, hasHeadBackground, hasHover, isBlock, isSoft, isStriped, palette, shape, stripedOrientation }) => {
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
22
+ return `
21
23
  border-collapse: separate;
22
24
  border-spacing: 0;
23
25
  empty-cells: hide;
@@ -29,10 +31,10 @@ exports.default = (0, styled_components_1.default)(Table_1.default).attrs({
29
31
  }
30
32
 
31
33
  ${isBlock
32
- ? `
34
+ ? `
33
35
  width: 100%;
34
36
  `
35
- : ''}
37
+ : ''}
36
38
 
37
39
  > * > tr > * {
38
40
  border: solid 0;
@@ -40,24 +42,24 @@ exports.default = (0, styled_components_1.default)(Table_1.default).attrs({
40
42
  fill: currentcolor;
41
43
 
42
44
  ${hasBorderX
43
- ? `
45
+ ? `
44
46
  border-right-width: ${theme.$.length.table.border};
45
47
 
46
48
  &:first-child {
47
49
  border-left-width: ${theme.$.length.table.border};
48
50
  }
49
51
  `
50
- : ''}
52
+ : ''}
51
53
 
52
54
  ${hasBorderY
53
- ? `
55
+ ? `
54
56
  border-bottom-width: ${theme.$.length.table.border};
55
57
  `
56
- : ''}
58
+ : ''}
57
59
  }
58
60
 
59
61
  ${hasBorderY
60
- ? `
62
+ ? `
61
63
  > thead > tr > * {
62
64
  border-bottom-width: ${theme.$.length.table.headBorder};
63
65
  }
@@ -66,7 +68,7 @@ exports.default = (0, styled_components_1.default)(Table_1.default).attrs({
66
68
  border-top-width: ${theme.$.length.table.border};
67
69
  }
68
70
  `
69
- : ''}
71
+ : ''}
70
72
 
71
73
  > *:first-child > tr:first-child > * {
72
74
  border-top-left-radius: ${theme.$.radius.table[shape]};
@@ -79,44 +81,76 @@ exports.default = (0, styled_components_1.default)(Table_1.default).attrs({
79
81
  }
80
82
 
81
83
  ${!isSoft
82
- ? `
84
+ ? `
83
85
  > * > tr > * {
84
- background: ${theme.$.palette[palette].background};
85
- border-color: ${theme.$.palette[palette].dynamicest};
86
- color: ${theme.$.palette[palette].font};
86
+ background: ${(_c = (_b = (_a = theme.$.palette[palette].table) === null || _a === void 0 ? void 0 : _a.odd) === null || _b === void 0 ? void 0 : _b.background) !== null && _c !== void 0 ? _c : theme.$.palette[palette].background};
87
+ border-color: ${(_f = (_e = (_d = theme.$.palette[palette].table) === null || _d === void 0 ? void 0 : _d.odd) === null || _e === void 0 ? void 0 : _e.border) !== null && _f !== void 0 ? _f : theme.$.palette[palette].dynamicest};
88
+ color: ${(_j = (_h = (_g = theme.$.palette[palette].table) === null || _g === void 0 ? void 0 : _g.odd) === null || _h === void 0 ? void 0 : _h.font) !== null && _j !== void 0 ? _j : theme.$.palette[palette].font};
87
89
  }
88
90
 
89
91
  ${hasHeadBackground
90
- ? `
92
+ ? `
91
93
  > thead > tr > * {
92
- background: ${theme.$.palette[palette].dynamic};
94
+ background: ${(_m = (_l = (_k = theme.$.palette[palette].table) === null || _k === void 0 ? void 0 : _k.even) === null || _l === void 0 ? void 0 : _l.background) !== null && _m !== void 0 ? _m : theme.$.palette[palette].dynamic};
95
+
96
+ ${((_p = (_o = theme.$.palette[palette].table) === null || _o === void 0 ? void 0 : _o.even) === null || _p === void 0 ? void 0 : _p.border)
97
+ ? `
98
+ border-color: ${(_r = (_q = theme.$.palette[palette].table) === null || _q === void 0 ? void 0 : _q.even) === null || _r === void 0 ? void 0 : _r.border};
99
+ `
100
+ : ''}
101
+
102
+ ${((_t = (_s = theme.$.palette[palette].table) === null || _s === void 0 ? void 0 : _s.even) === null || _t === void 0 ? void 0 : _t.font)
103
+ ? `
104
+ border-color: ${(_v = (_u = theme.$.palette[palette].table) === null || _u === void 0 ? void 0 : _u.even) === null || _v === void 0 ? void 0 : _v.font};
105
+ `
106
+ : ''}
93
107
  }
94
108
  `
95
- : ''}
109
+ : ''}
96
110
 
97
111
  ${isStriped
98
- ? `
112
+ ? `
99
113
  > tbody > tr:nth-child(${stripedOrientation}) > * {
100
- background: ${theme.$.palette[palette].dynamic};
114
+ background: ${(_y = (_x = (_w = theme.$.palette[palette].table) === null || _w === void 0 ? void 0 : _w.even) === null || _x === void 0 ? void 0 : _x.background) !== null && _y !== void 0 ? _y : theme.$.palette[palette].dynamic};
115
+
116
+ ${((_0 = (_z = theme.$.palette[palette].table) === null || _z === void 0 ? void 0 : _z.even) === null || _0 === void 0 ? void 0 : _0.border)
117
+ ? `
118
+ border-color: ${(_2 = (_1 = theme.$.palette[palette].table) === null || _1 === void 0 ? void 0 : _1.even) === null || _2 === void 0 ? void 0 : _2.border};
119
+ `
120
+ : ''}
121
+
122
+ ${((_4 = (_3 = theme.$.palette[palette].table) === null || _3 === void 0 ? void 0 : _3.even) === null || _4 === void 0 ? void 0 : _4.font)
123
+ ? `
124
+ border-color: ${(_6 = (_5 = theme.$.palette[palette].table) === null || _5 === void 0 ? void 0 : _5.even) === null || _6 === void 0 ? void 0 : _6.font};
125
+ `
126
+ : ''}
101
127
  }
102
128
  `
103
- : ''}
129
+ : ''}
104
130
 
105
131
  ${hasHover
106
- ? `
132
+ ? `
107
133
  > tbody > tr {
108
134
  > * {
109
- transition: background 150ms 0 ease-in-out;
135
+ transition: background 150ms 0s ease-in-out;
110
136
  }
111
137
 
112
138
  &:hover > * {
113
- background: ${theme.$.palette[palette].dynamicer};
139
+ background: ${(_10 = (_9 = (_8 = (_7 = theme.$.palette[palette].table) === null || _7 === void 0 ? void 0 : _7.odd) === null || _8 === void 0 ? void 0 : _8.hover) === null || _9 === void 0 ? void 0 : _9.background) !== null && _10 !== void 0 ? _10 : theme.$.palette[palette].dynamicer};
114
140
  }
141
+
142
+ ${(isStriped && ((_13 = (_12 = (_11 = theme.$.palette[palette].table) === null || _11 === void 0 ? void 0 : _11.even) === null || _12 === void 0 ? void 0 : _12.hover) === null || _13 === void 0 ? void 0 : _13.background))
143
+ ? `
144
+ > tbody > tr:nth-child(${stripedOrientation}) > * {
145
+ background: ${(_16 = (_15 = (_14 = theme.$.palette[palette].table) === null || _14 === void 0 ? void 0 : _14.even) === null || _15 === void 0 ? void 0 : _15.hover) === null || _16 === void 0 ? void 0 : _16.background};
146
+ }
147
+ `
148
+ : ''}
115
149
  }
116
150
  `
117
- : ''}
151
+ : ''}
118
152
  `
119
- : `
153
+ : `
120
154
  > * > tr > * {
121
155
  background: ${theme.$.palette[palette].softBackground};
122
156
  border-color: ${theme.$.palette[palette].softDynamicest};
@@ -124,27 +158,28 @@ exports.default = (0, styled_components_1.default)(Table_1.default).attrs({
124
158
  }
125
159
 
126
160
  ${hasHeadBackground
127
- ? `
161
+ ? `
128
162
  > thead > tr > * {
129
163
  background: ${theme.$.palette[palette].softDynamic};
130
164
  }
131
165
  `
132
- : ''}
166
+ : ''}
133
167
 
134
168
  ${isStriped
135
- ? `
169
+ ? `
136
170
  > tbody > tr:nth-child(${stripedOrientation}) > * {
137
171
  background: ${theme.$.palette[palette].softDynamic};
138
172
  }
139
173
  `
140
- : ''}
174
+ : ''}
141
175
 
142
176
  ${hasHover
143
- ? `
177
+ ? `
144
178
  > tbody > tr:hover > * {
145
179
  background: ${theme.$.palette[palette].softDynamicer};
146
180
  }
147
181
  `
148
- : ''}
182
+ : ''}
149
183
  `}
150
- `);
184
+ `;
185
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-react-components/ui",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "description": "SRC UI includes React and Styled components.",
@@ -64,9 +64,9 @@
64
64
  "test": "jest"
65
65
  },
66
66
  "devDependencies": {
67
- "@smart-react-components/core": "2.0.12",
68
- "@smart-react-components/router": "2.0.10",
69
- "@smart-react-components/transition": "2.0.11",
67
+ "@smart-react-components/core": "2.0.13",
68
+ "@smart-react-components/router": "2.0.11",
69
+ "@smart-react-components/transition": "2.0.12",
70
70
  "@testing-library/react": "13.4.0",
71
71
  "@types/jest": "29.0.1",
72
72
  "@types/react": "18.0.19",
@@ -83,9 +83,9 @@
83
83
  "typescript": "4.8.3"
84
84
  },
85
85
  "peerDependencies": {
86
- "@smart-react-components/core": "^2.0.12",
87
- "@smart-react-components/router": "^2.0.10",
88
- "@smart-react-components/transition": "^2.0.11",
86
+ "@smart-react-components/core": "^2.0.13",
87
+ "@smart-react-components/router": "^2.0.11",
88
+ "@smart-react-components/transition": "^2.0.12",
89
89
  "react": "^18.2.0",
90
90
  "react-dom": "^18.2.0",
91
91
  "styled-components": "^5.3.5"