contentoh-components-library 21.2.97 → 21.2.98
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/dist/assets/fonts/{Roboto → roboto}/LICENSE.txt +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Black.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-BlackItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Bold.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-BoldItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Italic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Light.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-LightItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Medium.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-MediumItalic.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Regular.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-Thin.ttf +0 -0
- package/dist/assets/fonts/{Roboto → roboto}/Roboto-ThinItalic.ttf +0 -0
- package/dist/components/atoms/CheckBox/index.js +5 -2
- package/dist/components/organisms/OrderDetail/OrderDetail.stories.js +3 -2
- package/dist/components/organisms/OrderDetail/index.js +9 -3
- package/dist/components/organisms/OrderDetail/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/index.js +2 -1
- package/package.json +1 -1
- package/src/components/atoms/CheckBox/index.js +9 -1
- package/src/components/organisms/OrderDetail/OrderDetail.stories.js +2 -1
- package/src/components/organisms/OrderDetail/index.js +4 -1
- package/src/components/organisms/OrderDetail/styles.js +1 -0
- package/src/components/organisms/OrderDetail/utils/Table/index.js +1 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -14,14 +14,17 @@ var CheckBox = function CheckBox(_ref) {
|
|
|
14
14
|
label = _ref.label,
|
|
15
15
|
onChange = _ref.onChange,
|
|
16
16
|
isFilter = _ref.isFilter,
|
|
17
|
-
defaultChecked = _ref.defaultChecked
|
|
17
|
+
defaultChecked = _ref.defaultChecked,
|
|
18
|
+
_ref$disabled = _ref.disabled,
|
|
19
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
18
20
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
19
21
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
20
22
|
type: "checkbox",
|
|
21
23
|
name: id,
|
|
22
24
|
id: id,
|
|
23
25
|
onChange: onChange,
|
|
24
|
-
defaultChecked: defaultChecked
|
|
26
|
+
defaultChecked: defaultChecked,
|
|
27
|
+
disabled: disabled
|
|
25
28
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
26
29
|
htmlFor: id,
|
|
27
30
|
children: label && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -179,7 +179,7 @@ OrderDetailDefault.args = {
|
|
|
179
179
|
status: "PA",
|
|
180
180
|
total: 731.2639770507812,
|
|
181
181
|
timestamp: "2022-11-12T22:48:23.000Z",
|
|
182
|
-
payment:
|
|
182
|
+
payment: null,
|
|
183
183
|
deliver_date: "2022-11-19T00:00:00.000Z",
|
|
184
184
|
product_count: 1,
|
|
185
185
|
is_billing: 0
|
|
@@ -199,5 +199,6 @@ OrderDetailDefault.args = {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
return console.log(args);
|
|
202
|
-
}
|
|
202
|
+
} // isProvider: true,
|
|
203
|
+
|
|
203
204
|
};
|
|
@@ -80,6 +80,7 @@ var OrderDetail = function OrderDetail(props) {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
(0, _react.useEffect)(function () {
|
|
83
|
+
var ac = new AbortController();
|
|
83
84
|
props.getOrderDetail && props.getOrderDetail({
|
|
84
85
|
query: {
|
|
85
86
|
orderId: order.id_order
|
|
@@ -101,7 +102,11 @@ var OrderDetail = function OrderDetail(props) {
|
|
|
101
102
|
setDataGeneral((0, _objectSpread2.default)((0, _objectSpread2.default)({}, countArticles), {}, {
|
|
102
103
|
totalArticles: totalArticles
|
|
103
104
|
}));
|
|
104
|
-
});
|
|
105
|
+
});
|
|
106
|
+
return function () {
|
|
107
|
+
return ac.abort();
|
|
108
|
+
}; // Abort both fetches on unmount
|
|
109
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
105
110
|
}, [order.id_order]);
|
|
106
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.MainContainer, {
|
|
107
112
|
id: props.id,
|
|
@@ -112,7 +117,7 @@ var OrderDetail = function OrderDetail(props) {
|
|
|
112
117
|
children: ["Orden de trabajo ", order.id_order]
|
|
113
118
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
114
119
|
className: "buttons",
|
|
115
|
-
children: [showPaymentButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
120
|
+
children: [showPaymentButton && !props.isProvider && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
116
121
|
type: "primary",
|
|
117
122
|
onClick: function onClick() {
|
|
118
123
|
props.updatePaymentStatus(order.id_order, "pagado");
|
|
@@ -208,7 +213,8 @@ var OrderDetail = function OrderDetail(props) {
|
|
|
208
213
|
name: "Fact.",
|
|
209
214
|
type: "checkout"
|
|
210
215
|
}],
|
|
211
|
-
data: orderData
|
|
216
|
+
data: orderData,
|
|
217
|
+
isProvider: props.isProvider
|
|
212
218
|
})
|
|
213
219
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
214
220
|
className: "footer",
|
|
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
17
17
|
|
|
18
|
-
var MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n right: 0;\n width: 785px;\n height: 100vh;\n z-index: 5;\n background: #ffffff;\n box-sizing: border-box;\n font-family: ", ";\n & > * {\n padding: 0 30px;\n }\n .headerTitle {\n font-weight: bold;\n font-size: 25px;\n }\n\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: 101px 120px 1fr 115px;\n grid-column-gap: 0px;\n grid-row-gap: 0px;\n\n .body {\n overflow-y: auto;\n }\n .footer {\n width: 100%;\n display: flex;\n align-items: center;\n height: 115px;\n border-top: 1px solid #e6e6e6;\n position: sticky;\n bottom: 0;\n padding: 20px;\n box-sizing: border-box;\n > h2 {\n margin-right: 20px;\n }\n > div {\n margin-right: 10px;\n }\n }\n"])), _variables.FontFamily.Roboto);
|
|
18
|
+
var MainContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n top: 0;\n right: 0;\n width: 785px;\n height: 100vh;\n z-index: 5;\n background: #ffffff;\n box-sizing: border-box;\n font-family: ", ";\n & > * {\n padding: 0 30px;\n }\n .headerTitle {\n font-weight: bold;\n font-size: 25px;\n }\n\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: 101px 120px 1fr 115px;\n grid-column-gap: 0px;\n grid-row-gap: 0px;\n\n .body {\n overflow-y: auto;\n }\n .footer {\n width: 100%;\n display: flex;\n align-items: center;\n height: 115px;\n border-top: 1px solid #e6e6e6;\n position: sticky;\n bottom: 0;\n padding: 20px;\n box-sizing: border-box;\n > h2 {\n margin-right: 20px;\n }\n > div {\n margin-right: 10px;\n }\n }\n"])), _variables.FontFamily.Roboto);
|
|
19
19
|
|
|
20
20
|
exports.MainContainer = MainContainer;
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Container } from "./styles";
|
|
2
2
|
|
|
3
|
-
export const CheckBox = ({
|
|
3
|
+
export const CheckBox = ({
|
|
4
|
+
id,
|
|
5
|
+
label,
|
|
6
|
+
onChange,
|
|
7
|
+
isFilter,
|
|
8
|
+
defaultChecked,
|
|
9
|
+
disabled = false,
|
|
10
|
+
}) => {
|
|
4
11
|
return (
|
|
5
12
|
<Container key={`check-${id}`}>
|
|
6
13
|
<input
|
|
@@ -9,6 +16,7 @@ export const CheckBox = ({ id, label, onChange, isFilter, defaultChecked }) => {
|
|
|
9
16
|
id={id}
|
|
10
17
|
onChange={onChange}
|
|
11
18
|
defaultChecked={defaultChecked}
|
|
19
|
+
disabled={disabled}
|
|
12
20
|
/>
|
|
13
21
|
<label htmlFor={id}>
|
|
14
22
|
{label && <p className={isFilter && "filter-text"}>{label}</p>}
|
|
@@ -62,7 +62,7 @@ OrderDetailDefault.args = {
|
|
|
62
62
|
status: "PA",
|
|
63
63
|
total: 731.2639770507812,
|
|
64
64
|
timestamp: "2022-11-12T22:48:23.000Z",
|
|
65
|
-
payment:
|
|
65
|
+
payment: null,
|
|
66
66
|
deliver_date: "2022-11-19T00:00:00.000Z",
|
|
67
67
|
product_count: 1,
|
|
68
68
|
is_billing: 0,
|
|
@@ -71,4 +71,5 @@ OrderDetailDefault.args = {
|
|
|
71
71
|
updateBilling,
|
|
72
72
|
updateGeneralBilling: (...args) => console.log(args),
|
|
73
73
|
setShowOrderDetail: (...args) => console.log(args),
|
|
74
|
+
// isProvider: true,
|
|
74
75
|
};
|
|
@@ -50,6 +50,7 @@ export const OrderDetail = (props) => {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
useEffect(() => {
|
|
53
|
+
const ac = new AbortController();
|
|
53
54
|
props.getOrderDetail &&
|
|
54
55
|
props
|
|
55
56
|
.getOrderDetail({ query: { orderId: order.id_order } })
|
|
@@ -75,6 +76,7 @@ export const OrderDetail = (props) => {
|
|
|
75
76
|
setOrderData(obj);
|
|
76
77
|
setDataGeneral({ ...countArticles, totalArticles });
|
|
77
78
|
});
|
|
79
|
+
return () => ac.abort(); // Abort both fetches on unmount
|
|
78
80
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
81
|
}, [order.id_order]);
|
|
80
82
|
|
|
@@ -84,7 +86,7 @@ export const OrderDetail = (props) => {
|
|
|
84
86
|
<SpaceBetween>
|
|
85
87
|
<h2 className="headerTitle">Orden de trabajo {order.id_order}</h2>
|
|
86
88
|
<div className="buttons">
|
|
87
|
-
{showPaymentButton && (
|
|
89
|
+
{showPaymentButton && !props.isProvider && (
|
|
88
90
|
<Button
|
|
89
91
|
type="primary"
|
|
90
92
|
onClick={() => {
|
|
@@ -163,6 +165,7 @@ export const OrderDetail = (props) => {
|
|
|
163
165
|
{ width: 65, name: "Fact.", type: "checkout" },
|
|
164
166
|
]}
|
|
165
167
|
data={orderData}
|
|
168
|
+
isProvider={props.isProvider}
|
|
166
169
|
/>
|
|
167
170
|
</div>
|
|
168
171
|
<div className="footer">
|