grevlingui 0.1.33 → 0.1.35
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/CheckBox.js
CHANGED
|
@@ -9,13 +9,25 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
+
// export const CheckBox = ({checked, setChecked, label, color = 'white', v2, time = 200}) => {
|
|
12
13
|
const CheckBox = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
checked,
|
|
15
16
|
setChecked,
|
|
16
17
|
label,
|
|
17
|
-
|
|
18
|
+
v2,
|
|
19
|
+
time = 200
|
|
18
20
|
} = _ref;
|
|
21
|
+
const color = 'hotpink';
|
|
22
|
+
|
|
23
|
+
const getStyle = (opening, i) => ({
|
|
24
|
+
// transition: `height ${time}ms, width ${time}ms ${opening ? 'ease-in' : 'ease-out'}`,
|
|
25
|
+
transition: "height ".concat(time, "ms, width ").concat(time, "ms"),
|
|
26
|
+
transitionDelay: "".concat(i * time / 5, "ms"),
|
|
27
|
+
fill: color
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const twoPhaseDiff = 1;
|
|
19
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
32
|
style: {
|
|
21
33
|
display: 'inline-block'
|
|
@@ -33,7 +45,94 @@ const CheckBox = _ref => {
|
|
|
33
45
|
viewBox: "0 0 132.29166 132.29167",
|
|
34
46
|
height: "35",
|
|
35
47
|
width: "35"
|
|
36
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
48
|
+
}, v2 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("mask", {
|
|
49
|
+
id: "checkMask"
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
51
|
+
x: "-20",
|
|
52
|
+
y: "-20",
|
|
53
|
+
width: "200",
|
|
54
|
+
height: "200",
|
|
55
|
+
fill: "white"
|
|
56
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
57
|
+
d: "M135.658 141.294H-5.65894V-6.66338H135.658V141.294ZM21.7649 9.06612C18.2495 9.06619 15.2401 10.3177 12.7366 12.821C10.233 15.3246 8.98076 18.3346 8.98071 21.8503V111.342C8.98079 114.858 10.233 117.867 12.7366 120.371C15.2401 122.874 18.2493 124.127 21.7649 124.127H111.257C114.773 124.127 117.783 122.874 120.286 120.371C122.79 117.867 124.041 114.858 124.041 111.342V21.8503C124.041 18.3346 122.79 15.3246 120.286 12.821C117.783 10.3174 114.773 9.06617 111.257 9.06612H21.7649Z",
|
|
58
|
+
fill: "black"
|
|
59
|
+
})), /*#__PURE__*/_react.default.createElement("g", {
|
|
60
|
+
mask: "url(#checkMask)",
|
|
61
|
+
className: "transformers"
|
|
62
|
+
}, checked ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("rect", {
|
|
63
|
+
style: getStyle(true, 0),
|
|
64
|
+
x: "72.3839",
|
|
65
|
+
y: "-31.2401",
|
|
66
|
+
width: "76.3103",
|
|
67
|
+
height: "88.4339",
|
|
68
|
+
transform: "rotate(50 72.3839 -31.2401)"
|
|
69
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
70
|
+
style: getStyle(true, 1),
|
|
71
|
+
x: "71.5962",
|
|
72
|
+
y: "148.092",
|
|
73
|
+
width: "48.1662",
|
|
74
|
+
height: "103.342",
|
|
75
|
+
transform: "rotate(-130 71.5962 148.092)"
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
77
|
+
style: getStyle(true, 2),
|
|
78
|
+
x: "35.078",
|
|
79
|
+
y: "136.193",
|
|
80
|
+
width: "65.7519",
|
|
81
|
+
height: "35.4406",
|
|
82
|
+
transform: "rotate(-130 35.078 136.193)"
|
|
83
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
84
|
+
style: getStyle(true, 3 + twoPhaseDiff),
|
|
85
|
+
x: "98.5041",
|
|
86
|
+
y: "2.19794",
|
|
87
|
+
width: "56.3159",
|
|
88
|
+
height: "27.3439",
|
|
89
|
+
transform: "rotate(50 98.5041 2.19794)"
|
|
90
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
91
|
+
style: getStyle(true, 4 + twoPhaseDiff),
|
|
92
|
+
x: "18.2496",
|
|
93
|
+
y: "78.9046",
|
|
94
|
+
width: "32.653",
|
|
95
|
+
height: "31.6319",
|
|
96
|
+
transform: "rotate(-130 18.2496 78.9046)"
|
|
97
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("rect", {
|
|
98
|
+
style: getStyle(false, 4 + twoPhaseDiff),
|
|
99
|
+
x: "72.3839",
|
|
100
|
+
y: "-31.2401",
|
|
101
|
+
width: "7.42665",
|
|
102
|
+
height: "88.4339",
|
|
103
|
+
transform: "rotate(50 72.3839 -31.2401)"
|
|
104
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
105
|
+
style: getStyle(false, 3 + twoPhaseDiff),
|
|
106
|
+
x: "71.5962",
|
|
107
|
+
y: "148.092",
|
|
108
|
+
width: "1.70323",
|
|
109
|
+
height: "103.342",
|
|
110
|
+
transform: "rotate(-130 71.5962 148.092)"
|
|
111
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
112
|
+
style: getStyle(false, 2 + twoPhaseDiff),
|
|
113
|
+
x: "35.078",
|
|
114
|
+
y: "136.193",
|
|
115
|
+
width: "65.7519",
|
|
116
|
+
height: "2.75196",
|
|
117
|
+
transform: "rotate(-130 35.078 136.193)"
|
|
118
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
119
|
+
style: getStyle(false, 1),
|
|
120
|
+
x: "98.5041",
|
|
121
|
+
y: "2.19794",
|
|
122
|
+
width: "56.3159",
|
|
123
|
+
height: "1.80076",
|
|
124
|
+
transform: "rotate(50 98.5041 2.19794)"
|
|
125
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
126
|
+
style: getStyle(false, 0),
|
|
127
|
+
x: "18.2496",
|
|
128
|
+
y: "78.9046",
|
|
129
|
+
width: "32.653",
|
|
130
|
+
height: "3.88451",
|
|
131
|
+
transform: "rotate(-130 18.2496 78.9046)"
|
|
132
|
+
})), /*#__PURE__*/_react.default.createElement("path", {
|
|
133
|
+
d: "M21.7652 147.556C14.7876 147.556 -13.189 118.32 -13.189 111.342V21.8505C-13.189 14.8729 14.7876 -12.096 21.7652 -12.096H111.257C118.234 -12.096 141.928 14.8729 141.928 21.8505V111.342C141.928 118.32 118.234 147.556 111.257 147.556H21.7652ZM111.257 111.317V21.8505H21.7652V111.317C56.197 111.317 76.8251 111.317 111.257 111.317Z",
|
|
134
|
+
fill: color
|
|
135
|
+
}))) : /*#__PURE__*/_react.default.createElement("path", {
|
|
37
136
|
style: {
|
|
38
137
|
transition: 'd 250ms'
|
|
39
138
|
},
|
|
@@ -42,7 +141,8 @@ const CheckBox = _ref => {
|
|
|
42
141
|
className: 'mainShape'
|
|
43
142
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
44
143
|
style: {
|
|
45
|
-
marginLeft: '10px'
|
|
144
|
+
marginLeft: '10px',
|
|
145
|
+
color
|
|
46
146
|
}
|
|
47
147
|
}, label)));
|
|
48
148
|
};
|
|
@@ -40,9 +40,6 @@ const NumberSelect = _ref => {
|
|
|
40
40
|
const [doneClosing, setDoneClosing] = (0, _react.useState)(true);
|
|
41
41
|
const [closeTimeout, setCloseTimeout] = (0, _react.useState)();
|
|
42
42
|
const [doneClosingTimeout, setDoneClosingTimeout] = (0, _react.useState)();
|
|
43
|
-
(0, _react.useEffect)(() => {
|
|
44
|
-
if (closed) close();
|
|
45
|
-
}, [closed]);
|
|
46
43
|
|
|
47
44
|
const close = () => {
|
|
48
45
|
clearTimeout(closeTimeout);
|
|
@@ -51,6 +48,10 @@ const NumberSelect = _ref => {
|
|
|
51
48
|
startDoneClosingTimeout();
|
|
52
49
|
};
|
|
53
50
|
|
|
51
|
+
(0, _react.useEffect)(() => {
|
|
52
|
+
if (closed) close(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
}, [closed]);
|
|
54
|
+
|
|
54
55
|
const startCloseTimeout = () => {
|
|
55
56
|
if (!timeout) return;
|
|
56
57
|
clearTimeout(closeTimeout);
|
|
@@ -53,6 +53,7 @@ const NumberSliderSelect = _ref => {
|
|
|
53
53
|
const options = [...Array(Math.max(max - min + 1, 1)).keys()].map(v => v + min);
|
|
54
54
|
let cosmoState = cosmos[id];
|
|
55
55
|
(0, _react.useLayoutEffect)(() => {
|
|
56
|
+
// eslint-disable-next-line
|
|
56
57
|
cosmoState = cosmos[id] = {
|
|
57
58
|
refs: []
|
|
58
59
|
};
|