oa-componentbook 0.17.46 → 0.17.47
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/build/components/oa-component-drawer/CustomDrawer.js +0 -6
- package/build/components/oa-component-modal/CustomModal.js +3 -11
- package/build/components/oa-component-toggle/CustomToggle.js +4 -5
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +67 -83
- package/build/widgets/oa-widget-view-previous-description/ViewPreviousDescriptionWidget.js +2 -2
- package/package.json +1 -1
- package/build/components/GridSystem.js +0 -34
- package/build/components/grid-system.css +0 -205
- package/build/components/oa-component-modal/usage-example.md +0 -0
- package/build/x.css +0 -0
|
@@ -75,7 +75,6 @@ function CustomDrawer(_ref) {
|
|
|
75
75
|
Object.prototype.hasOwnProperty.call(button, 'disabled') ? button.disabled
|
|
76
76
|
// If it doesn't we hardcode the button to never be disabled.
|
|
77
77
|
: false,
|
|
78
|
-
iconConfig: button === null || button === void 0 ? void 0 : button.iconConfig,
|
|
79
78
|
key: (0, _nanoid.nanoid)(),
|
|
80
79
|
label: button.label,
|
|
81
80
|
onClick: button.callback,
|
|
@@ -91,11 +90,6 @@ CustomDrawer.propTypes = {
|
|
|
91
90
|
'data-test': _propTypes.default.string,
|
|
92
91
|
disabled: _propTypes.default.bool,
|
|
93
92
|
callback: _propTypes.default.func.isRequired,
|
|
94
|
-
iconConfig: _propTypes.default.shape({
|
|
95
|
-
icon: _propTypes.default.node,
|
|
96
|
-
position: _propTypes.default.oneOf(['left', 'right']),
|
|
97
|
-
style: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
|
|
98
|
-
}),
|
|
99
93
|
label: _propTypes.default.string.isRequired,
|
|
100
94
|
type: _propTypes.default.oneOf(['secondary', 'primary']).isRequired
|
|
101
95
|
})),
|
|
@@ -49,7 +49,6 @@ function CustomModal(_ref) {
|
|
|
49
49
|
}, title)),
|
|
50
50
|
footer: /*#__PURE__*/_react.default.createElement(_styles.ButtonContainer, null, buttonConfig.map(button => /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
51
51
|
key: button,
|
|
52
|
-
iconConfig: button === null || button === void 0 ? void 0 : button.iconConfig,
|
|
53
52
|
label: button.label,
|
|
54
53
|
onClick: button.callback,
|
|
55
54
|
size: "large",
|
|
@@ -62,23 +61,16 @@ function CustomModal(_ref) {
|
|
|
62
61
|
((0, _utils.isString)(children) || (0, _utils.isNumber)(children)) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
63
62
|
color: "secondarygrey-text",
|
|
64
63
|
typography: typographies.children
|
|
65
|
-
}, children) ||
|
|
66
|
-
// The label is a node
|
|
67
|
-
(0, _utils.isObject)(children) && children));
|
|
64
|
+
}, children) || /*#__PURE__*/_react.default.isValidElement(children) && children));
|
|
68
65
|
}
|
|
69
66
|
CustomModal.propTypes = {
|
|
70
67
|
// Array of button configurations
|
|
71
68
|
buttonConfig: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
72
|
-
callback: _propTypes.default.
|
|
69
|
+
callback: _propTypes.default.string.isRequired,
|
|
73
70
|
label: _propTypes.default.string.isRequired,
|
|
74
|
-
iconConfig: _propTypes.default.shape({
|
|
75
|
-
icon: _propTypes.default.node,
|
|
76
|
-
position: _propTypes.default.oneOf(['left', 'right']),
|
|
77
|
-
style: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
|
|
78
|
-
}),
|
|
79
71
|
type: _propTypes.default.oneOf(['secondary', 'primary']).isRequired
|
|
80
72
|
})).isRequired,
|
|
81
|
-
children: _propTypes.default.
|
|
73
|
+
children: _propTypes.default.string,
|
|
82
74
|
title: _propTypes.default.string.isRequired,
|
|
83
75
|
typographies: _propTypes.default.shape({
|
|
84
76
|
title: _propTypes.default.oneOf(_Typography.typographyOptions),
|
|
@@ -64,11 +64,10 @@ function CustomToggle(_ref) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}, /*#__PURE__*/_react.default.createElement(_antd.Switch, _extends({
|
|
67
|
-
"data-test": dataTest
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
,
|
|
67
|
+
"data-test": dataTest,
|
|
68
|
+
style: {
|
|
69
|
+
transform: "scale(".concat(size === 'large' ? '1.45' : '1.25', ")")
|
|
70
|
+
},
|
|
72
71
|
checkedChildren: checkedLabel,
|
|
73
72
|
unCheckedChildren: uncheckedLabel,
|
|
74
73
|
disabled: disabled,
|
|
@@ -15,7 +15,7 @@ var _antd = require("antd");
|
|
|
15
15
|
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
16
16
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
17
17
|
var _styles = require("./styles");
|
|
18
|
-
const _excluded = ["
|
|
18
|
+
const _excluded = ["onClose", "onSave", "addedSpareList", "allSpareList", "open"];
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,7 +24,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
24
24
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
25
|
function AddSparePartWidget(_ref) {
|
|
26
26
|
let {
|
|
27
|
-
'data-test': dataTest,
|
|
28
27
|
onClose,
|
|
29
28
|
onSave,
|
|
30
29
|
addedSpareList,
|
|
@@ -45,15 +44,13 @@ function AddSparePartWidget(_ref) {
|
|
|
45
44
|
form.validateFields({
|
|
46
45
|
validateOnly: true
|
|
47
46
|
}).then(values => {
|
|
48
|
-
// console.log(values);
|
|
49
|
-
|
|
50
47
|
// This flag tells us if a submittable field is present in the form or not.
|
|
51
48
|
let submittableFieldPresent = false;
|
|
52
49
|
|
|
53
50
|
// Iterating over the parts that have been selected
|
|
54
51
|
selectedParts.forEach(selectedPart => {
|
|
55
52
|
// This means that the selectedPart is already added and not submittable.
|
|
56
|
-
if (addedSpareList.some(addedSpare => addedSpare.
|
|
53
|
+
if (addedSpareList.some(addedSpare => addedSpare.scopeId === selectedPart)) {
|
|
57
54
|
return;
|
|
58
55
|
}
|
|
59
56
|
submittableFieldPresent = true;
|
|
@@ -69,23 +66,23 @@ function AddSparePartWidget(_ref) {
|
|
|
69
66
|
(0, _react.useEffect)(() => {
|
|
70
67
|
const newValueForDisabledParts = {};
|
|
71
68
|
allSpareList.forEach(spare => {
|
|
72
|
-
newValueForDisabledParts[spare.
|
|
69
|
+
newValueForDisabledParts[spare.scopeId] = false;
|
|
73
70
|
});
|
|
74
71
|
form.resetFields();
|
|
75
72
|
const selectedArray = [];
|
|
76
73
|
addedSpareList.forEach(spare => {
|
|
77
|
-
selectedArray.push(spare.
|
|
74
|
+
selectedArray.push(spare.scopeId);
|
|
78
75
|
});
|
|
79
76
|
setSelectedParts(selectedArray);
|
|
80
77
|
}, [addedSpareList, allSpareList]);
|
|
81
78
|
const handleSave = () => {
|
|
82
79
|
const formValues = form.getFieldsValue();
|
|
83
|
-
const formArray = selectedParts.filter(selectedPart => !addedSpareList.some(addedSpare => addedSpare.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
const formArray = selectedParts.filter(selectedPart => !addedSpareList.some(addedSpare => addedSpare.scopeId === selectedPart)).map(selectedPart => ({
|
|
81
|
+
scopeId: selectedPart,
|
|
82
|
+
scopeName: allSpareList.find(spare => spare.scopeId === selectedPart).scopeName,
|
|
83
|
+
cost: formValues["cost-".concat(selectedPart)],
|
|
84
|
+
discount: formValues["discount-".concat(selectedPart)],
|
|
85
|
+
hsnId: formValues["hsnId-".concat(selectedPart)]
|
|
89
86
|
}));
|
|
90
87
|
|
|
91
88
|
// Call to `onSave` callback received from props.
|
|
@@ -94,106 +91,98 @@ function AddSparePartWidget(_ref) {
|
|
|
94
91
|
};
|
|
95
92
|
const dataSource = allSpareList.map(spare => {
|
|
96
93
|
// If the spare is already added, all its fields are disabled.
|
|
97
|
-
if (addedSpareList.some(addedSpare => addedSpare.
|
|
98
|
-
const partObject = addedSpareList.find(correctSpare => correctSpare.
|
|
94
|
+
if (addedSpareList.some(addedSpare => addedSpare.scopeId === spare.scopeId)) {
|
|
95
|
+
const partObject = addedSpareList.find(correctSpare => correctSpare.scopeId === spare.scopeId);
|
|
99
96
|
return {
|
|
100
|
-
key: spare.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
name: "
|
|
97
|
+
key: spare.scopeId,
|
|
98
|
+
scopeName: spare.scopeName,
|
|
99
|
+
cost: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
100
|
+
name: "cost-".concat(spare.scopeId),
|
|
104
101
|
rules: [{
|
|
105
|
-
required: selectedParts.includes(spare.
|
|
102
|
+
required: selectedParts.includes(spare.scopeId),
|
|
106
103
|
message: ''
|
|
107
104
|
// message: 'Enter the discount value.',
|
|
108
105
|
}],
|
|
109
106
|
|
|
110
|
-
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.
|
|
107
|
+
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.cost
|
|
111
108
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
112
|
-
type: "number",
|
|
113
109
|
prefix: "\u20B9",
|
|
114
|
-
disabled: true
|
|
115
|
-
|
|
110
|
+
disabled: true
|
|
111
|
+
// value={}
|
|
116
112
|
})),
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
|
|
114
|
+
discount: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
115
|
+
name: "discount-".concat(spare.scopeId),
|
|
119
116
|
rules: [{
|
|
120
117
|
required: true,
|
|
121
118
|
message: ''
|
|
122
119
|
// message: 'Enter the discount value.',
|
|
123
120
|
}],
|
|
124
121
|
|
|
125
|
-
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.
|
|
122
|
+
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.discount
|
|
126
123
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
127
|
-
type: "number",
|
|
128
124
|
prefix: "\u20B9",
|
|
129
|
-
disabled: true
|
|
130
|
-
"data-test": dataTest ? "".concat(dataTest, "--part-discount-").concat(spare.id) : undefined
|
|
125
|
+
disabled: true
|
|
131
126
|
})),
|
|
132
|
-
|
|
133
|
-
name: "
|
|
127
|
+
hsnId: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
128
|
+
name: "hsnId-".concat(spare.scopeId),
|
|
134
129
|
rules: [{
|
|
135
130
|
required: true,
|
|
136
131
|
message: ''
|
|
137
132
|
// message: 'Enter the discount value.',
|
|
138
133
|
}],
|
|
139
134
|
|
|
140
|
-
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.
|
|
135
|
+
initialValue: partObject === null || partObject === void 0 ? void 0 : partObject.hsnId
|
|
141
136
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
142
|
-
disabled: true
|
|
143
|
-
"data-test": dataTest ? "".concat(dataTest, "--part-hsn-code-").concat(spare.id) : undefined
|
|
137
|
+
disabled: true
|
|
144
138
|
}))
|
|
145
139
|
};
|
|
146
140
|
}
|
|
147
141
|
return {
|
|
148
|
-
key: spare.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
name: "
|
|
142
|
+
key: spare.scopeId,
|
|
143
|
+
scopeName: spare.scopeName,
|
|
144
|
+
cost: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
145
|
+
name: "cost-".concat(spare.scopeId),
|
|
152
146
|
rules: [{
|
|
153
|
-
required: selectedParts.includes(spare.
|
|
147
|
+
required: selectedParts.includes(spare.scopeId),
|
|
154
148
|
message: ''
|
|
155
149
|
// message: 'Enter the discount value.',
|
|
156
150
|
}],
|
|
157
151
|
|
|
158
152
|
initialValue: ""
|
|
159
153
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
160
|
-
disabled: !selectedParts.includes(spare.
|
|
161
|
-
prefix: "\u20B9"
|
|
162
|
-
type: "number",
|
|
163
|
-
"data-test": dataTest ? "".concat(dataTest, "--part-price-").concat(spare.id) : undefined
|
|
154
|
+
disabled: !selectedParts.includes(spare.scopeId),
|
|
155
|
+
prefix: "\u20B9"
|
|
164
156
|
})),
|
|
165
|
-
|
|
166
|
-
name: "
|
|
157
|
+
discount: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
158
|
+
name: "discount-".concat(spare.scopeId),
|
|
167
159
|
rules: [{
|
|
168
|
-
required: selectedParts.includes(spare.
|
|
160
|
+
required: selectedParts.includes(spare.scopeId),
|
|
169
161
|
message: ''
|
|
170
162
|
// message: 'Enter the discount value.',
|
|
171
163
|
}],
|
|
172
164
|
|
|
173
165
|
initialValue: ""
|
|
174
166
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
175
|
-
disabled: !selectedParts.includes(spare.
|
|
176
|
-
prefix: "\u20B9"
|
|
177
|
-
type: "number",
|
|
178
|
-
"data-test": dataTest ? "".concat(dataTest, "--part-discount-").concat(spare.id) : undefined
|
|
167
|
+
disabled: !selectedParts.includes(spare.scopeId),
|
|
168
|
+
prefix: "\u20B9"
|
|
179
169
|
})),
|
|
180
|
-
|
|
181
|
-
name: "
|
|
170
|
+
hsnId: /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
171
|
+
name: "hsnId-".concat(spare.scopeId),
|
|
182
172
|
rules: [{
|
|
183
|
-
required: selectedParts.includes(spare.
|
|
173
|
+
required: selectedParts.includes(spare.scopeId),
|
|
184
174
|
message: ''
|
|
185
175
|
// message: 'Enter the discount value.',
|
|
186
176
|
}],
|
|
187
177
|
|
|
188
178
|
initialValue: ""
|
|
189
179
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
190
|
-
disabled: !selectedParts.includes(spare.
|
|
191
|
-
"data-test": dataTest ? "".concat(dataTest, "--part-hsn-code-").concat(spare.id) : undefined
|
|
180
|
+
disabled: !selectedParts.includes(spare.scopeId)
|
|
192
181
|
}))
|
|
193
182
|
};
|
|
194
183
|
});
|
|
195
184
|
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, _extends({
|
|
196
|
-
|
|
185
|
+
destroyOnClose: true,
|
|
197
186
|
onClose: onClose,
|
|
198
187
|
open: open,
|
|
199
188
|
placement: "right",
|
|
@@ -203,8 +192,7 @@ function AddSparePartWidget(_ref) {
|
|
|
203
192
|
disabled: !submittable,
|
|
204
193
|
callback: handleSave,
|
|
205
194
|
label: 'Save',
|
|
206
|
-
type: 'primary'
|
|
207
|
-
'data-test': dataTest ? "".concat(dataTest, "--save-button") : undefined
|
|
195
|
+
type: 'primary'
|
|
208
196
|
}],
|
|
209
197
|
bodyStyle: {
|
|
210
198
|
padding: '0px'
|
|
@@ -223,35 +211,34 @@ function AddSparePartWidget(_ref) {
|
|
|
223
211
|
}, /*#__PURE__*/_react.default.createElement(_styles.StyledForm, {
|
|
224
212
|
form: form
|
|
225
213
|
}, /*#__PURE__*/_react.default.createElement(_antd.Table, {
|
|
226
|
-
"data-test": dataTest ? "".concat(dataTest, "--table") : undefined,
|
|
227
214
|
columns: [{
|
|
228
215
|
title: '',
|
|
229
|
-
dataIndex: '
|
|
230
|
-
key: '
|
|
216
|
+
dataIndex: 'scopeName',
|
|
217
|
+
key: 'scopeName',
|
|
231
218
|
width: '20%'
|
|
232
219
|
}, {
|
|
233
220
|
title: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
234
221
|
color: "placeholder-text",
|
|
235
222
|
typography: "type-sl1-700"
|
|
236
223
|
}, "Spare part price (without gst)"),
|
|
237
|
-
dataIndex: '
|
|
238
|
-
key: '
|
|
224
|
+
dataIndex: 'cost',
|
|
225
|
+
key: 'cost',
|
|
239
226
|
width: '30%'
|
|
240
227
|
}, {
|
|
241
228
|
title: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
242
229
|
color: "placeholder-text",
|
|
243
230
|
typography: "type-sl1-700"
|
|
244
231
|
}, "discount (without Gst)"),
|
|
245
|
-
dataIndex: '
|
|
246
|
-
key: '
|
|
232
|
+
dataIndex: 'discount',
|
|
233
|
+
key: 'discount',
|
|
247
234
|
width: '30%'
|
|
248
235
|
}, {
|
|
249
236
|
title: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
250
237
|
color: "placeholder-text",
|
|
251
238
|
typography: "type-sl1-700"
|
|
252
239
|
}, "hsn code"),
|
|
253
|
-
dataIndex: '
|
|
254
|
-
key: '
|
|
240
|
+
dataIndex: 'hsnId',
|
|
241
|
+
key: 'hsnId',
|
|
255
242
|
width: '20%'
|
|
256
243
|
}],
|
|
257
244
|
dataSource: dataSource,
|
|
@@ -263,14 +250,14 @@ function AddSparePartWidget(_ref) {
|
|
|
263
250
|
onChange: selectedRowKeys => {
|
|
264
251
|
const removedKeys = selectedParts.filter(part => !selectedRowKeys.includes(part));
|
|
265
252
|
removedKeys.forEach(row => {
|
|
266
|
-
form.setFieldValue("
|
|
267
|
-
form.setFieldValue("
|
|
268
|
-
form.setFieldValue("
|
|
253
|
+
form.setFieldValue("hsnId-".concat(row), '');
|
|
254
|
+
form.setFieldValue("discount-".concat(row), '');
|
|
255
|
+
form.setFieldValue("cost-".concat(row), '');
|
|
269
256
|
});
|
|
270
257
|
let submittableFieldPresent = false;
|
|
271
258
|
selectedRowKeys.forEach(selectedPart => {
|
|
272
259
|
// This part is not already added, so it can be submitted.
|
|
273
|
-
if (!addedSpareList.some(addedSpare => addedSpare.
|
|
260
|
+
if (!addedSpareList.some(addedSpare => addedSpare.scopeId === selectedPart)) {
|
|
274
261
|
submittableFieldPresent = true;
|
|
275
262
|
}
|
|
276
263
|
});
|
|
@@ -278,32 +265,29 @@ function AddSparePartWidget(_ref) {
|
|
|
278
265
|
setSelectedParts(selectedRowKeys);
|
|
279
266
|
},
|
|
280
267
|
getCheckboxProps: record => ({
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
name: record.partName
|
|
268
|
+
disabled: addedSpareList.some(spare => spare.scopeId === record.key),
|
|
269
|
+
scopeName: record.scopeName
|
|
284
270
|
})
|
|
285
271
|
},
|
|
286
272
|
sticky: true
|
|
287
273
|
}))));
|
|
288
274
|
}
|
|
289
275
|
AddSparePartWidget.propTypes = {
|
|
290
|
-
'data-test': _propTypes.default.string,
|
|
291
276
|
onClose: _propTypes.default.func.isRequired,
|
|
292
277
|
onSave: _propTypes.default.func.isRequired,
|
|
293
278
|
open: _propTypes.default.bool,
|
|
294
279
|
addedSpareList: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
280
|
+
scopeName: _propTypes.default.string,
|
|
281
|
+
discount: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
282
|
+
cost: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
283
|
+
hsnId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
299
284
|
})),
|
|
300
285
|
allSpareList: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
301
|
-
|
|
302
|
-
|
|
286
|
+
scopeName: _propTypes.default.string.isRequired,
|
|
287
|
+
scopeId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired
|
|
303
288
|
}))
|
|
304
289
|
};
|
|
305
290
|
AddSparePartWidget.defaultProps = {
|
|
306
|
-
'data-test': null,
|
|
307
291
|
addedSpareList: [],
|
|
308
292
|
allSpareList: [],
|
|
309
293
|
open: true
|
|
@@ -24,7 +24,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
24
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
25
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
26
|
function ViewPreviousDescriptionWidget(_ref) {
|
|
27
|
-
var _translatedText
|
|
27
|
+
var _translatedText$;
|
|
28
28
|
let {
|
|
29
29
|
currentDescription,
|
|
30
30
|
'data-test': dataTest,
|
|
@@ -109,7 +109,7 @@ function ViewPreviousDescriptionWidget(_ref) {
|
|
|
109
109
|
, {
|
|
110
110
|
"data-test": dataTest ? "".concat(dataTest, "--current-description") : undefined,
|
|
111
111
|
typography: "type-b2-400"
|
|
112
|
-
}, "".concat(isTranslationOn && ((_translatedText$ = translatedText[0]) === null || _translatedText$ === void 0 ? void 0 : _translatedText$.length) > 0 ?
|
|
112
|
+
}, "".concat(isTranslationOn && ((_translatedText$ = translatedText[0]) === null || _translatedText$ === void 0 ? void 0 : _translatedText$.length) > 0 ? translatedText[0] : currentDescription.description)), currentDescription.dateSubmitted && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
113
113
|
color: "secondary-content",
|
|
114
114
|
typography: "type-b2-400"
|
|
115
115
|
}, "Updated on:", ' ', "".concat(currentDescription.dateSubmitted))))), /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = GridSystem;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
require("./grid-system.css");
|
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
-
function GridSystem(_ref) {
|
|
15
|
-
let {
|
|
16
|
-
children,
|
|
17
|
-
isFluid
|
|
18
|
-
} = _ref;
|
|
19
|
-
const BasicGrid = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: grid;\n /* \n Small breakpoint: 4 columns.\n */\n grid-template-columns: repeat(4, 1fr);\n gap: 16px;\n\n /* \n Medium breakpoint: 8 columns.\n */\n @media screen and (min-width: 768px) {\n grid-template-columns: repeat(8, 1fr);\n gap: 16px;\n }\n\n /* \n Large breakpoint : 12 columns.\n */\n @media screen and (min-width: 992px) {\n grid-template-columns: repeat(12, 1fr);\n gap: 24px;\n }\n\n /* \n Extra Large breakpoint: 12 columns.\n */\n @media screen and (min-width: 1200px) {\n grid-template-columns: repeat(12, 1fr);\n gap: 24px;\n }\n "])));
|
|
20
|
-
let FluidOrFixedGrid;
|
|
21
|
-
if (isFluid) {
|
|
22
|
-
FluidOrFixedGrid = (0, _styledComponents.default)(BasicGrid)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n "])));
|
|
23
|
-
} else {
|
|
24
|
-
FluidOrFixedGrid = (0, _styledComponents.default)(BasicGrid)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 0 16px;\n\n /* \n Medium breakpoint: 8 columns.\n */\n @media screen and (min-width: 768px) {\n margin: 0 32px;\n }\n\n /* \n Large breakpoint : 12 columns.\n */\n @media screen and (min-width: 992px) {\n margin: 0 32px;\n }\n\n /* \n Extra Large breakpoint: 12 columns.\n */\n @media screen and (min-width: 1200px) {\n width: 1128px;\n margin: 0 auto;\n } \n "])));
|
|
25
|
-
}
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(FluidOrFixedGrid, null, children);
|
|
27
|
-
}
|
|
28
|
-
GridSystem.propTypes = {
|
|
29
|
-
children: _propTypes.default.node.isRequired,
|
|
30
|
-
isFluid: _propTypes.default.bool
|
|
31
|
-
};
|
|
32
|
-
GridSystem.defaultProps = {
|
|
33
|
-
isFluid: false
|
|
34
|
-
};
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Small breakpoint.
|
|
3
|
-
|
|
4
|
-
On small screens, there are only 4 columns, so an element can take 4 columns at max.
|
|
5
|
-
*/
|
|
6
|
-
.col-s-1 {
|
|
7
|
-
/* No start or end defined. Span 1 columns. */
|
|
8
|
-
grid-column: span 1 / auto;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.col-s-2 {
|
|
12
|
-
/* No start or end defined. Span 2 columns. */
|
|
13
|
-
grid-column: span 2 / auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.col-s-3 {
|
|
17
|
-
/* No start or end defined. Span 3 columns. */
|
|
18
|
-
grid-column: span 3 / auto;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.col-s-4 {
|
|
22
|
-
/* No start or end defined. Span 4 columns. */
|
|
23
|
-
grid-column: span 4 / auto;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/*
|
|
27
|
-
Medium breakpoint.
|
|
28
|
-
|
|
29
|
-
On medium screens, there are 8 columns, so an element can take 8 columns at max.
|
|
30
|
-
*/
|
|
31
|
-
@media screen and (min-width: 768px) {
|
|
32
|
-
.col-m-1 {
|
|
33
|
-
/* No start or end defined. Span 1 columns. */
|
|
34
|
-
grid-column: span 1 / auto;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.col-m-2 {
|
|
38
|
-
/* No start or end defined. Span 2 columns. */
|
|
39
|
-
grid-column: span 2 / auto;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.col-m-3 {
|
|
43
|
-
/* No start or end defined. Span 3 columns. */
|
|
44
|
-
grid-column: span 3 / auto;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.col-m-4 {
|
|
48
|
-
/* No start or end defined. Span 4 columns. */
|
|
49
|
-
grid-column: span 4 / auto;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.col-m-5 {
|
|
53
|
-
/* No start or end defined. Span 5 columns. */
|
|
54
|
-
grid-column: span 5 / auto;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.col-m-6 {
|
|
58
|
-
/* No start or end defined. Span 6 columns. */
|
|
59
|
-
grid-column: span 6 / auto;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.col-m-7 {
|
|
63
|
-
/* No start or end defined. Span 7 columns. */
|
|
64
|
-
grid-column: span 7 / auto;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.col-m-8 {
|
|
68
|
-
/* No start or end defined. Span 8 columns. */
|
|
69
|
-
grid-column: span 8 / auto;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/*
|
|
74
|
-
Large breakpoint.
|
|
75
|
-
|
|
76
|
-
On large screens, there are 12 columns, so an element can take 12 columns at max.
|
|
77
|
-
*/
|
|
78
|
-
@media screen and (min-width: 992px) {
|
|
79
|
-
.col-l-1 {
|
|
80
|
-
/* No start or end defined. Span 1 columns. */
|
|
81
|
-
grid-column: span 1 / auto;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.col-l-2 {
|
|
85
|
-
/* No start or end defined. Span 2 columns. */
|
|
86
|
-
grid-column: span 2 / auto;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.col-l-3 {
|
|
90
|
-
/* No start or end defined. Span 3 columns. */
|
|
91
|
-
grid-column: span 3 / auto;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.col-l-4 {
|
|
95
|
-
/* No start or end defined. Span 4 columns. */
|
|
96
|
-
grid-column: span 4 / auto;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.col-l-5 {
|
|
100
|
-
/* No start or end defined. Span 5 columns. */
|
|
101
|
-
grid-column: span 5 / auto;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.col-l-6 {
|
|
105
|
-
/* No start or end defined. Span 6 columns. */
|
|
106
|
-
grid-column: span 6 / auto;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.col-l-7 {
|
|
110
|
-
/* No start or end defined. Span 7 columns. */
|
|
111
|
-
grid-column: span 7 / auto;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.col-l-8 {
|
|
115
|
-
/* No start or end defined. Span 8 columns. */
|
|
116
|
-
grid-column: span 8 / auto;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.col-l-9 {
|
|
120
|
-
/* No start or end defined. Span 9 columns. */
|
|
121
|
-
grid-column: span 9 / auto;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.col-l-10 {
|
|
125
|
-
/* No start or end defined. Span 10 columns. */
|
|
126
|
-
grid-column: span 10 / auto;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.col-l-11 {
|
|
130
|
-
/* No start or end defined. Span 11 columns. */
|
|
131
|
-
grid-column: span 11 / auto;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.col-l-12 {
|
|
135
|
-
/* No start or end defined. Span 12 columns. */
|
|
136
|
-
grid-column: span 12 / auto;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/*
|
|
141
|
-
Extra Large breakpoint.
|
|
142
|
-
|
|
143
|
-
On extra large screens, there are 12 columns, so an element can take 12 columns at max.
|
|
144
|
-
*/
|
|
145
|
-
@media screen and (min-width: 1200px) {
|
|
146
|
-
.col-xl-1 {
|
|
147
|
-
/* No start or end defined. Span 1 columns. */
|
|
148
|
-
grid-column: span 1 / auto;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.col-xl-2 {
|
|
152
|
-
/* No start or end defined. Span 2 columns. */
|
|
153
|
-
grid-column: span 2 / auto;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.col-xl-3 {
|
|
157
|
-
/* No start or end defined. Span 3 columns. */
|
|
158
|
-
grid-column: span 3 / auto;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.col-xl-4 {
|
|
162
|
-
/* No start or end defined. Span 4 columns. */
|
|
163
|
-
grid-column: span 4 / auto;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.col-xl-5 {
|
|
167
|
-
/* No start or end defined. Span 5 columns. */
|
|
168
|
-
grid-column: span 5 / auto;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.col-xl-6 {
|
|
172
|
-
/* No start or end defined. Span 6 columns. */
|
|
173
|
-
grid-column: span 6 / auto;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.col-xl-7 {
|
|
177
|
-
/* No start or end defined. Span 7 columns. */
|
|
178
|
-
grid-column: span 7 / auto;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.col-xl-8 {
|
|
182
|
-
/* No start or end defined. Span 8 columns. */
|
|
183
|
-
grid-column: span 8 / auto;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.col-xl-9 {
|
|
187
|
-
/* No start or end defined. Span 9 columns. */
|
|
188
|
-
grid-column: span 9 / auto;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.col-xl-10 {
|
|
192
|
-
/* No start or end defined. Span 10 columns. */
|
|
193
|
-
grid-column: span 10 / auto;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.col-xl-11 {
|
|
197
|
-
/* No start or end defined. Span 11 columns. */
|
|
198
|
-
grid-column: span 11 / auto;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.col-xl-12 {
|
|
202
|
-
/* No start or end defined. Span 12 columns. */
|
|
203
|
-
grid-column: span 12 / auto;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
File without changes
|
package/build/x.css
DELETED
|
File without changes
|