argous 1.2.246 → 1.2.247
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/api/WebSocket.d.ts +4 -0
- package/dist/api/WebSocket.js +17 -13
- package/dist/api/index.js +119 -108
- package/dist/api/ws.js +3 -3
- package/dist/components/Alert/Alert.js +6 -2
- package/dist/components/ArgousAction/ArgousAction.js +8 -4
- package/dist/components/ArgousAvatar/ArgousAvatar.js +14 -10
- package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +15 -9
- package/dist/components/ArgousComplexTable/ArgousComplexTable.js +79 -52
- package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +16 -12
- package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +13 -9
- package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +12 -8
- package/dist/components/ArgousInput/ArgousInput.js +8 -4
- package/dist/components/ArgousPagination/ArgousPagination.js +1 -1
- package/dist/components/ArgousProgressBar/ArgousProgressBar.js +18 -18
- package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +16 -12
- package/dist/components/AutoComplete/AutoComplete.js +16 -12
- package/dist/components/AutoCompleteFavorites/AutoCompleteFavorites.js +34 -30
- package/dist/components/BarChart/BarChart.js +5 -1
- package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +30 -2
- package/dist/components/BarraFerramentas/BarraFerramentas.js +58 -40
- package/dist/components/Button/Button.js +8 -4
- package/dist/components/Cabecalho/Cabecalho.js +29 -25
- package/dist/components/Calendar/Calendar.js +12 -8
- package/dist/components/Cam/Cam.js +15 -11
- package/dist/components/Carousel/Carousel.js +21 -17
- package/dist/components/CartaoUsuario/CartaoUsuario.js +21 -17
- package/dist/components/Collapse/Collapse.js +18 -14
- package/dist/components/Compartilhar/Compartilhar.js +24 -20
- package/dist/components/ConfirmModal/ModalProvider.js +17 -13
- package/dist/components/ConfirmModal/index.js +5 -1
- package/dist/components/ContactValidationInput/ContactValidationInput.js +34 -31
- package/dist/components/Document/Icons.js +14 -10
- package/dist/components/Document/ModalVisualizacaoDocumentos.js +11 -7
- package/dist/components/Document/Visualizacao.js +15 -11
- package/dist/components/Document/index.js +5 -1
- package/dist/components/DropArea/DropArea.js +16 -12
- package/dist/components/DropArea/Html5FileSelector.js +2 -2
- package/dist/components/Editor/Events.d.ts +2 -2
- package/dist/components/Editor/ScriptLoader2.d.ts +1 -1
- package/dist/components/Editor/ScriptLoader2.js +1 -1
- package/dist/components/Editor/Utils.d.ts +1 -1
- package/dist/components/Editor/Utils.js +1 -1
- package/dist/components/Editor/components/Editor.d.ts +1 -1
- package/dist/components/Editor/components/Editor.js +23 -18
- package/dist/components/Editor/components/EditorPropTypes.d.ts +2 -2
- package/dist/components/Editor/components/EditorPropTypes.js +5 -1
- package/dist/components/FilePreparer/FilePreparer.js +34 -26
- package/dist/components/FileUploader/FileUploader.js +22 -18
- package/dist/components/FormVisualizer/FormVisualizer.js +34 -26
- package/dist/components/HalfGauge/HalfGauge.js +30 -26
- package/dist/components/Highlight/Highlight.js +7 -3
- package/dist/components/ImageResize/ImageResize.js +61 -57
- package/dist/components/ImageResizeButton/ImageResizeButton.js +9 -5
- package/dist/components/Input/Input.js +8 -4
- package/dist/components/InputTags/InputTags.js +16 -8
- package/dist/components/ListSelect/ListSelect.js +11 -7
- package/dist/components/MaterialButton/MaterialButton.js +18 -18
- package/dist/components/MenuBar/MenuBar.js +11 -7
- package/dist/components/MonthPicker/MonthPicker.js +33 -25
- package/dist/components/MultipleSelect/MultipleSelect.js +20 -12
- package/dist/components/OtpInput/OtpInput.js +11 -7
- package/dist/components/OutputText/OutputText.js +8 -4
- package/dist/components/Pagination/Pagination.js +5 -1
- package/dist/components/PercentageDisplay/PercentageDisplay.js +11 -7
- package/dist/components/Programa/PageCodeEasterEgg.d.ts +1 -1
- package/dist/components/Programa/PageCodeEasterEgg.js +11 -7
- package/dist/components/Programa/Programa.d.ts +16 -1
- package/dist/components/Programa/Programa.js +41 -13
- package/dist/components/Programa/Tab.d.ts +7 -0
- package/dist/components/Programa/Tab.js +2 -0
- package/dist/components/Programa/TabNavigationRail.d.ts +12 -0
- package/dist/components/Programa/TabNavigationRail.js +118 -0
- package/dist/components/ProgressBar/ProgressBar.js +8 -4
- package/dist/components/Select/Select.js +11 -7
- package/dist/components/SimpleTable/SimpleTable.js +30 -26
- package/dist/components/Stepper/Stepper.js +18 -14
- package/dist/components/TablePicker/TablePicker.js +40 -32
- package/dist/components/Tabs/Tabs.js +8 -4
- package/dist/components/TextArea/TextArea.js +8 -4
- package/dist/components/TextToHtml/Cursor.js +9 -5
- package/dist/components/TextToHtml/TextStyles.js +10 -6
- package/dist/components/TextToHtml/TextToHtml.js +44 -44
- package/dist/components/ThreadLog/ThreadLog.js +15 -11
- package/dist/components/UserCard/UserCard.js +18 -14
- package/dist/components/UtilAutoComplete/UtilAutoComplete.js +22 -18
- package/dist/components/UtilTextField/UtilTextField.js +10 -6
- package/dist/components/Zoom/Zoom.js +11 -7
- package/dist/components/index.js +5 -1
- package/dist/fieldsRedux/createField.js +22 -18
- package/dist/fieldsRedux/fieldsRedux.js +44 -40
- package/dist/fieldsRedux/passFields.js +16 -12
- package/dist/reducers/index.js +1 -1
- package/dist/utils/api.d.ts +2 -2
- package/dist/utils/api.js +18 -18
- package/dist/utils/date.js +4 -4
- package/dist/utils/index.js +44 -112
- package/dist/utils/xmlToJson.js +1 -1
- package/lib/components/BarraFerramentas/BarraFerramentas.d.ts +30 -2
- package/lib/components/BarraFerramentas/BarraFerramentas.js +63 -19
- package/lib/components/Programa/Programa.d.ts +16 -1
- package/lib/components/Programa/Programa.js +40 -3
- package/lib/components/Programa/Tab.ts +6 -0
- package/lib/components/Programa/TabNavigationRail.js +118 -0
- package/lib/utils/index.ts +0 -88
- package/package.json +2 -2
- package/lib/components/Editor/tinymce/README.md +0 -73
- package/lib/components/Editor/tinymce/langs/README.md +0 -3
|
@@ -16,7 +16,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
18
|
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
20
24
|
}) : (function(o, m, k, k2) {
|
|
21
25
|
if (k2 === undefined) k2 = k;
|
|
22
26
|
o[k2] = m[k];
|
|
@@ -33,10 +37,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
37
|
__setModuleDefault(result, mod);
|
|
34
38
|
return result;
|
|
35
39
|
};
|
|
36
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
37
|
-
for (var i = 0,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
40
48
|
};
|
|
41
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -106,7 +114,7 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
106
114
|
if (fieldObject.defaultValue.length > 0) {
|
|
107
115
|
if (typeof fieldObject.value[0] !== 'string') {
|
|
108
116
|
var stringifyedValues = fieldObject.value.map(function (v) { return v.toString(); });
|
|
109
|
-
fieldsRedux_1.setField(_this.props.field, 'value', stringifyedValues);
|
|
117
|
+
(0, fieldsRedux_1.setField)(_this.props.field, 'value', stringifyedValues);
|
|
110
118
|
}
|
|
111
119
|
var last = fieldObject.defaultValue[fieldObject.defaultValue.length - 1].toString();
|
|
112
120
|
_this.setState({ year: parseInt(last.slice(0, 4), 10) });
|
|
@@ -124,7 +132,7 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
124
132
|
_this.onClick = function (values, month) {
|
|
125
133
|
var year = _this.state.year;
|
|
126
134
|
var _a = _this.props.type, type = _a === void 0 ? 'single' : _a;
|
|
127
|
-
var formatedValue = ""
|
|
135
|
+
var formatedValue = "".concat(year).concat(month);
|
|
128
136
|
var newValue;
|
|
129
137
|
if (values && values.length > 0) {
|
|
130
138
|
newValue = _this.handleExistentValue(values, formatedValue, month);
|
|
@@ -146,13 +154,13 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
146
154
|
var indexValue = value.indexOf(formatedValue);
|
|
147
155
|
if (indexValue > -1) {
|
|
148
156
|
value.splice(indexValue, 1);
|
|
149
|
-
return __spreadArray([], value);
|
|
157
|
+
return __spreadArray([], value, true);
|
|
150
158
|
}
|
|
151
159
|
switch (type) {
|
|
152
160
|
case 'single':
|
|
153
161
|
return [formatedValue];
|
|
154
162
|
case 'stage': {
|
|
155
|
-
var fieldValueLgt2 = fieldsRedux_1.getField(field, 'value').length === 2;
|
|
163
|
+
var fieldValueLgt2 = (0, fieldsRedux_1.getField)(field, 'value').length === 2;
|
|
156
164
|
var newValue = fieldValueLgt2 ? [formatedValue] : [value[0], formatedValue];
|
|
157
165
|
if (!fieldValueLgt2) {
|
|
158
166
|
_this.closeSelect();
|
|
@@ -160,40 +168,40 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
160
168
|
return newValue;
|
|
161
169
|
}
|
|
162
170
|
case 'multiple':
|
|
163
|
-
return __spreadArray(__spreadArray([], value), [formatedValue]);
|
|
171
|
+
return __spreadArray(__spreadArray([], value, true), [formatedValue], false);
|
|
164
172
|
default:
|
|
165
173
|
return [formatedValue];
|
|
166
174
|
}
|
|
167
175
|
};
|
|
168
176
|
_this.handleinputValue = function (value) {
|
|
169
177
|
var _a = _this.props, field = _a.field, _b = _a.type, type = _b === void 0 ? 'single' : _b;
|
|
170
|
-
value = __spreadArray([], value);
|
|
178
|
+
value = __spreadArray([], value, true);
|
|
171
179
|
var sortedValues = value.sort(function (a, b) { return a > b ? 1 : 0; });
|
|
172
|
-
var inputValues = sortedValues.map(function (v) { return ""
|
|
180
|
+
var inputValues = sortedValues.map(function (v) { return "".concat(v.toString().slice(4)).concat(v.toString().slice(0, 4)); });
|
|
173
181
|
switch (type) {
|
|
174
182
|
case 'single':
|
|
175
|
-
fieldsRedux_1.setField(field, 'inputValue', inputValues[0]);
|
|
183
|
+
(0, fieldsRedux_1.setField)(field, 'inputValue', inputValues[0]);
|
|
176
184
|
break;
|
|
177
185
|
case 'stage':
|
|
178
|
-
fieldsRedux_1.setField(field, 'inputValue', ""
|
|
186
|
+
(0, fieldsRedux_1.setField)(field, 'inputValue', "".concat(inputValues[0]).concat(inputValues[1] ? inputValues[1] : ''));
|
|
179
187
|
break;
|
|
180
188
|
case 'multiple': {
|
|
181
189
|
var multipleValue = '';
|
|
182
190
|
for (var _i = 0, inputValues_1 = inputValues; _i < inputValues_1.length; _i++) {
|
|
183
191
|
var v = inputValues_1[_i];
|
|
184
|
-
multipleValue += v.slice(0, 2)
|
|
192
|
+
multipleValue += "".concat(v.slice(0, 2), "/").concat(v.slice(2), " ");
|
|
185
193
|
}
|
|
186
|
-
fieldsRedux_1.setField(field, 'inputValue', multipleValue);
|
|
194
|
+
(0, fieldsRedux_1.setField)(field, 'inputValue', multipleValue);
|
|
187
195
|
break;
|
|
188
196
|
}
|
|
189
197
|
default:
|
|
190
|
-
fieldsRedux_1.setField(field, 'inputValue', inputValues[0]);
|
|
198
|
+
(0, fieldsRedux_1.setField)(field, 'inputValue', inputValues[0]);
|
|
191
199
|
}
|
|
192
200
|
};
|
|
193
201
|
_this.isActive = function (values, month) {
|
|
194
202
|
var _a = _this.state, year = _a.year, stageMonths = _a.stageMonths;
|
|
195
|
-
var formatedValue = ""
|
|
196
|
-
return (values.indexOf(formatedValue) < 0 ? '' : 'active'
|
|
203
|
+
var formatedValue = "".concat(year).concat(month);
|
|
204
|
+
return "".concat(values.indexOf(formatedValue) < 0 ? '' : 'active', " ").concat(stageMonths.indexOf(formatedValue) < 0 ? '' : 'hovered');
|
|
197
205
|
};
|
|
198
206
|
_this.restYear = function () {
|
|
199
207
|
var date = new Date();
|
|
@@ -202,7 +210,7 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
202
210
|
_this.onValueCapture = function (v) {
|
|
203
211
|
var field = _this.props.field;
|
|
204
212
|
var value = v.target.value;
|
|
205
|
-
fieldsRedux_1.setField(field, 'inputValue', value);
|
|
213
|
+
(0, fieldsRedux_1.setField)(field, 'inputValue', value);
|
|
206
214
|
value = value.replace(/\D+/g, '');
|
|
207
215
|
var valueLength = value.length;
|
|
208
216
|
var resolvedValues = [];
|
|
@@ -215,7 +223,7 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
215
223
|
var mes = valueAux.slice(aux, aux + 2);
|
|
216
224
|
var ano = valueAux.slice(aux + 2, aux + 6);
|
|
217
225
|
if (parseInt(mes, 10) <= 12 && parseInt(mes, 10) >= 1) {
|
|
218
|
-
resolvedValues.push(""
|
|
226
|
+
resolvedValues.push("".concat(ano).concat(mes));
|
|
219
227
|
}
|
|
220
228
|
}
|
|
221
229
|
}
|
|
@@ -246,14 +254,14 @@ var MonthPicker = /** @class */ (function (_super) {
|
|
|
246
254
|
};
|
|
247
255
|
MonthPicker.prototype.componentDidUpdate = function (prevProps) {
|
|
248
256
|
var field = this.props.field;
|
|
249
|
-
fieldsRedux_1.fieldChangeListener(field, this.fieldListener, prevProps);
|
|
257
|
+
(0, fieldsRedux_1.fieldChangeListener)(field, this.fieldListener, prevProps);
|
|
250
258
|
};
|
|
251
259
|
MonthPicker.prototype.render = function () {
|
|
252
260
|
var _this = this;
|
|
253
261
|
var _a = this.props, field = _a.field, _b = _a.type, type = _b === void 0 ? 'single' : _b;
|
|
254
262
|
var _c = this.state, year = _c.year, selectOpen = _c.selectOpen;
|
|
255
|
-
var values = fieldsRedux_1.getField(field, 'value');
|
|
256
|
-
var inputValue = fieldsRedux_1.getField(field, 'inputValue');
|
|
263
|
+
var values = (0, fieldsRedux_1.getField)(field, 'value');
|
|
264
|
+
var inputValue = (0, fieldsRedux_1.getField)(field, 'inputValue');
|
|
257
265
|
var mask = type === 'single' ? '11/1111' : '11/1111 à 11/1111';
|
|
258
266
|
return (react_1.default.createElement("div", { className: 'monthPickermaxwidth' },
|
|
259
267
|
(type === 'single' || type === 'stage') && (react_1.default.createElement(react_maskedinput_1.default, { value: inputValue, onClick: this.openSelect, onChange: this.onValueCapture, mask: mask, className: 'pg-monthpicker-input' })),
|
|
@@ -285,4 +293,4 @@ MonthPicker.propTypes = {
|
|
|
285
293
|
destroyOnUnmount: prop_types_1.default.bool,
|
|
286
294
|
type: prop_types_1.default.oneOf(['single', 'stage', 'multiple'])
|
|
287
295
|
};
|
|
288
|
-
exports.default = fieldsRedux_1.createField(MonthPicker, { disableFieldChangeListener: true });
|
|
296
|
+
exports.default = (0, fieldsRedux_1.createField)(MonthPicker, { disableFieldChangeListener: true });
|
|
@@ -27,7 +27,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
27
27
|
};
|
|
28
28
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
29
|
if (k2 === undefined) k2 = k;
|
|
30
|
-
Object.
|
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(o, k2, desc);
|
|
31
35
|
}) : (function(o, m, k, k2) {
|
|
32
36
|
if (k2 === undefined) k2 = k;
|
|
33
37
|
o[k2] = m[k];
|
|
@@ -44,10 +48,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
44
48
|
__setModuleDefault(result, mod);
|
|
45
49
|
return result;
|
|
46
50
|
};
|
|
47
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
48
|
-
for (var i = 0,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
52
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
53
|
+
if (ar || !(i in from)) {
|
|
54
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
55
|
+
ar[i] = from[i];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
51
59
|
};
|
|
52
60
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
53
61
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -66,8 +74,8 @@ var MultipleSelect = /** @class */ (function (_super) {
|
|
|
66
74
|
_this.onChange = function (val) {
|
|
67
75
|
var _a = _this.props, onChange = _a.onChange, field = _a.field;
|
|
68
76
|
var value = val.toString();
|
|
69
|
-
var fldValue = fieldsRedux_1.getField(field, 'value') || [];
|
|
70
|
-
var newValue = __spreadArray([], fldValue);
|
|
77
|
+
var fldValue = (0, fieldsRedux_1.getField)(field, 'value') || [];
|
|
78
|
+
var newValue = __spreadArray([], fldValue, true);
|
|
71
79
|
var index = newValue.indexOf(value);
|
|
72
80
|
if (index >= 0) {
|
|
73
81
|
newValue.splice(index, 1);
|
|
@@ -94,20 +102,20 @@ var MultipleSelect = /** @class */ (function (_super) {
|
|
|
94
102
|
}
|
|
95
103
|
MultipleSelect.prototype.componentDidMount = function () {
|
|
96
104
|
var _a = this.props, optionsField = _a.optionsField, optionsDefaultValue = _a.optionsDefaultValue;
|
|
97
|
-
fieldsRedux_1.initField(optionsField, optionsDefaultValue);
|
|
105
|
+
(0, fieldsRedux_1.initField)(optionsField, optionsDefaultValue);
|
|
98
106
|
};
|
|
99
107
|
MultipleSelect.prototype.componentWillUnmount = function () {
|
|
100
108
|
var _a = this.props, optionsField = _a.optionsField, destroyOnUnmount = _a.destroyOnUnmount;
|
|
101
109
|
if (destroyOnUnmount) {
|
|
102
|
-
fieldsRedux_1.clearField(optionsField);
|
|
110
|
+
(0, fieldsRedux_1.clearField)(optionsField);
|
|
103
111
|
}
|
|
104
112
|
};
|
|
105
113
|
MultipleSelect.prototype.render = function () {
|
|
106
114
|
var _a = this, checkListSelectProps = _a.checkListSelectProps, onChange = _a.onChange;
|
|
107
115
|
var _b = this.props, field = _b.field, optionsField = _b.optionsField, optionsValue = _b.optionsValue, optionsLabel = _b.optionsLabel, classActive = _b.classActive;
|
|
108
116
|
var selectProps = checkListSelectProps();
|
|
109
|
-
var value = fieldsRedux_1.getField(field, 'value') || [];
|
|
110
|
-
var options = fieldsRedux_1.getField(optionsField, 'value') || [];
|
|
117
|
+
var value = (0, fieldsRedux_1.getField)(field, 'value') || [];
|
|
118
|
+
var options = (0, fieldsRedux_1.getField)(optionsField, 'value') || [];
|
|
111
119
|
return (react_1.default.createElement("ul", __assign({}, selectProps), options.map(function (item, index) { return (react_1.default.createElement("li", {
|
|
112
120
|
// eslint-disable-next-line
|
|
113
121
|
className: value.indexOf(item[optionsValue].toString()) >= 0 ? classActive : '', key: index, title: item[optionsLabel], onClick: function () { return onChange(item[optionsValue]); } }, item[optionsLabel])); })));
|
|
@@ -136,4 +144,4 @@ MultipleSelect.propTypes = {
|
|
|
136
144
|
style: prop_types_1.default.object,
|
|
137
145
|
classActive: prop_types_1.default.string,
|
|
138
146
|
};
|
|
139
|
-
exports.default = fieldsRedux_1.createField(MultipleSelect);
|
|
147
|
+
exports.default = (0, fieldsRedux_1.createField)(MultipleSelect);
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -51,7 +55,7 @@ var RIGHT_ARROW = 39;
|
|
|
51
55
|
var DELETE = 46;
|
|
52
56
|
var SPACEBAR = 32;
|
|
53
57
|
var ENTER = 13;
|
|
54
|
-
var useStyles = core_1.makeStyles(function (theme) {
|
|
58
|
+
var useStyles = (0, core_1.makeStyles)(function (theme) {
|
|
55
59
|
var _a;
|
|
56
60
|
return ({
|
|
57
61
|
field: (_a = {
|
|
@@ -99,14 +103,14 @@ var useStyles = core_1.makeStyles(function (theme) {
|
|
|
99
103
|
var SingleOtpInput = function (_a) {
|
|
100
104
|
var separator = _a.separator, isLastChild = _a.isLastChild, focus = _a.focus, autoFocus = _a.autoFocus, index = _a.index, value = _a.value, placeholder = _a.placeholder, props = __rest(_a, ["separator", "isLastChild", "focus", "autoFocus", "index", "value", "placeholder"]);
|
|
101
105
|
var classes = useStyles();
|
|
102
|
-
var inputRef = react_1.useRef();
|
|
106
|
+
var inputRef = (0, react_1.useRef)();
|
|
103
107
|
// Focus on first render
|
|
104
108
|
// Only when autoFocus is true
|
|
105
|
-
react_1.useEffect(function () {
|
|
109
|
+
(0, react_1.useEffect)(function () {
|
|
106
110
|
if ((inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) && focus && autoFocus)
|
|
107
111
|
inputRef.current.focus();
|
|
108
112
|
}, [focus, autoFocus]);
|
|
109
|
-
utils_1.useUpdateEffect(function () {
|
|
113
|
+
(0, utils_1.useUpdateEffect)(function () {
|
|
110
114
|
// Check if focusedInput changed
|
|
111
115
|
// Prevent calling function if input already in focus
|
|
112
116
|
if ((inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) && focus) {
|
|
@@ -120,8 +124,8 @@ var SingleOtpInput = function (_a) {
|
|
|
120
124
|
};
|
|
121
125
|
var OtpInput = function (_a) {
|
|
122
126
|
var _b = _a.numInputs, numInputs = _b === void 0 ? 6 : _b, _c = _a.onChange, onChange = _c === void 0 ? function (otp) { return void (otp); } : _c, _d = _a.value, value = _d === void 0 ? '' : _d, _e = _a.onConfirm, onConfirm = _e === void 0 ? function (otp) { return void (otp); } : _e, props = __rest(_a, ["numInputs", "onChange", "value", "onConfirm"]);
|
|
123
|
-
var _f = react_1.useState(0), activeInput = _f[0], setActiveInput = _f[1];
|
|
124
|
-
var _g = react_1.useState((value === null || value === void 0 ? void 0 : value.toString().split('')) || []), localValue = _g[0], setLocalValue = _g[1];
|
|
127
|
+
var _f = (0, react_1.useState)(0), activeInput = _f[0], setActiveInput = _f[1];
|
|
128
|
+
var _g = (0, react_1.useState)((value === null || value === void 0 ? void 0 : value.toString().split('')) || []), localValue = _g[0], setLocalValue = _g[1];
|
|
125
129
|
var otpValue = (value === null || value === void 0 ? void 0 : value.toString().split('')) || localValue;
|
|
126
130
|
// Helper to return OTP from input
|
|
127
131
|
var handleOtpChange = function (otp) {
|
|
@@ -16,7 +16,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
18
|
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
20
24
|
}) : (function(o, m, k, k2) {
|
|
21
25
|
if (k2 === undefined) k2 = k;
|
|
22
26
|
o[k2] = m[k];
|
|
@@ -65,10 +69,10 @@ var OutputText = /** @class */ (function (_super) {
|
|
|
65
69
|
}
|
|
66
70
|
OutputText.prototype.render = function () {
|
|
67
71
|
var _a = this.props, field = _a.field, _b = _a.renderize, renderize = _b === void 0 ? 'span' : _b, className = _a.className, style = _a.style, _c = _a.prefixo, prefixo = _c === void 0 ? '' : _c, _d = _a.sufixo, sufixo = _d === void 0 ? '' : _d;
|
|
68
|
-
var value = fieldsRedux_1.getField(field, 'value');
|
|
72
|
+
var value = (0, fieldsRedux_1.getField)(field, 'value');
|
|
69
73
|
value = typeof value !== 'object' ? value : JSON.stringify(value);
|
|
70
74
|
value = this.handleDecimalValues(value);
|
|
71
|
-
value = ""
|
|
75
|
+
value = "".concat(prefixo).concat(value).concat(sufixo);
|
|
72
76
|
return react_1.default.createElement(renderize, { className: className, style: style }, value);
|
|
73
77
|
};
|
|
74
78
|
return OutputText;
|
|
@@ -86,4 +90,4 @@ OutputText.propTypes = {
|
|
|
86
90
|
decimalSeparator: prop_types_1.default.string,
|
|
87
91
|
decimalScale: prop_types_1.default.number,
|
|
88
92
|
};
|
|
89
|
-
exports.default = fieldsRedux_1.createField(OutputText);
|
|
93
|
+
exports.default = (0, fieldsRedux_1.createField)(OutputText);
|
|
@@ -16,7 +16,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
18
|
if (k2 === undefined) k2 = k;
|
|
19
|
-
Object.
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
20
24
|
}) : (function(o, m, k, k2) {
|
|
21
25
|
if (k2 === undefined) k2 = k;
|
|
22
26
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -21,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
26
|
var core_1 = require("@material-ui/core");
|
|
23
27
|
var react_1 = __importStar(require("react"));
|
|
24
|
-
var useStyles = core_1.makeStyles({
|
|
28
|
+
var useStyles = (0, core_1.makeStyles)({
|
|
25
29
|
container: {
|
|
26
30
|
display: 'grid',
|
|
27
31
|
placeItems: 'center'
|
|
@@ -78,20 +82,20 @@ var PercentageDisplay = function (_a) {
|
|
|
78
82
|
var id = _a.id, _b = _a.percentage, percentage = _b === void 0 ? 0 : _b, _c = _a.size, size = _c === void 0 ? 50 : _c, _d = _a.barWidth, barWidth = _d === void 0 ? 6 : _d, _e = _a.fontSize, fontSize = _e === void 0 ? '0.9rem' : _e, _f = _a.color, color = _f === void 0 ? '#000' : _f, _g = _a.typographyVariant, typographyVariant = _g === void 0 ? undefined : _g, _h = _a.backgroundColor, backgroundColor = _h === void 0 ? '#fff' : _h, _j = _a.barColor, barColor = _j === void 0 ? '#00995d' : _j, _k = _a.barBackgroundColor, barBackgroundColor = _k === void 0 ? '#00995d26' : _k;
|
|
79
83
|
var progressBarWidth = size - barWidth;
|
|
80
84
|
var classes = useStyles({ color: color, backgroundColor: backgroundColor, barColor: barColor, barBackgroundColor: barBackgroundColor, size: size, progressBarWidth: progressBarWidth, fontSize: fontSize });
|
|
81
|
-
var percentageDisplayProgressId = id
|
|
82
|
-
var createProgress = react_1.useCallback(function () {
|
|
85
|
+
var percentageDisplayProgressId = "".concat(id, "-percentageDisplayProgress");
|
|
86
|
+
var createProgress = (0, react_1.useCallback)(function () {
|
|
83
87
|
var porcentagem = parseInt(percentage);
|
|
84
88
|
var progressBar = document.getElementById(percentageDisplayProgressId);
|
|
85
89
|
if (!progressBar)
|
|
86
90
|
return;
|
|
87
|
-
progressBar.style.background = "conic-gradient("
|
|
91
|
+
progressBar.style.background = "conic-gradient(".concat(barColor, " ").concat(porcentagem * 3.6, "deg, ").concat(barBackgroundColor, " ").concat(porcentagem * 3.6, "deg)");
|
|
88
92
|
}, [barBackgroundColor, barColor, percentage, percentageDisplayProgressId]);
|
|
89
|
-
react_1.useEffect(function () {
|
|
93
|
+
(0, react_1.useEffect)(function () {
|
|
90
94
|
createProgress();
|
|
91
95
|
}, [percentage, createProgress]);
|
|
92
96
|
return react_1.default.createElement("div", { className: classes.container },
|
|
93
97
|
react_1.default.createElement("div", { id: percentageDisplayProgressId, className: classes.circularProgress },
|
|
94
98
|
react_1.default.createElement("div", { className: classes.valueContainer },
|
|
95
|
-
react_1.default.createElement(core_1.Typography, { variant: typographyVariant, className: classes.typography }, percentage
|
|
99
|
+
react_1.default.createElement(core_1.Typography, { variant: typographyVariant, className: classes.typography }, "".concat(percentage, "%")))));
|
|
96
100
|
};
|
|
97
101
|
exports.default = PercentageDisplay;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const _default: import("react-redux").ConnectedComponent<({ code, usuarioLogado }: {
|
|
2
2
|
code: any;
|
|
3
3
|
usuarioLogado: any;
|
|
4
4
|
}) => React.JSX.Element, import("react-redux").Omit<{
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -33,13 +37,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
37
|
var core_1 = require("@material-ui/core");
|
|
34
38
|
var react_1 = __importStar(require("react"));
|
|
35
39
|
var react_redux_1 = require("react-redux");
|
|
36
|
-
var useStyles = core_1.makeStyles(function (theme) { return ({
|
|
40
|
+
var useStyles = (0, core_1.makeStyles)(function (theme) { return ({
|
|
37
41
|
container: {
|
|
38
42
|
display: 'flex',
|
|
39
43
|
overflow: 'hidden',
|
|
40
44
|
borderRadius: 4,
|
|
41
45
|
color: theme.palette.type === 'light' ? '#fff' : '#000',
|
|
42
|
-
background: "linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba("
|
|
46
|
+
background: "linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(".concat(theme.palette.type === 'light' ? '66,66,66' : '255,255,255', ",1) 3%)")
|
|
43
47
|
},
|
|
44
48
|
messageDiv: {
|
|
45
49
|
padding: '.5rem 1rem'
|
|
@@ -53,13 +57,13 @@ var SnackbarTransition = function (props) { return react_1.default.createElement
|
|
|
53
57
|
var PageCodeEasterEgg = function (_a) {
|
|
54
58
|
var code = _a.code, usuarioLogado = _a.usuarioLogado;
|
|
55
59
|
var classes = useStyles();
|
|
56
|
-
var _b = react_1.useState(false), open = _b[0], setOpen = _b[1];
|
|
60
|
+
var _b = (0, react_1.useState)(false), open = _b[0], setOpen = _b[1];
|
|
57
61
|
function easterEggListener(e) {
|
|
58
62
|
var teamMember = (usuarioLogado === null || usuarioLogado === void 0 ? void 0 : usuarioLogado.idFornecedorInterno) === 1; // Membro da TI
|
|
59
63
|
if (teamMember && code && !open && e.ctrlKey && e.shiftKey && e.key === 'Z')
|
|
60
64
|
setOpen(true);
|
|
61
65
|
}
|
|
62
|
-
react_1.useEffect(function () {
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
63
67
|
document.addEventListener('keydown', easterEggListener, false);
|
|
64
68
|
return function () { return document.removeEventListener('keydown', easterEggListener, false); };
|
|
65
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -70,9 +74,9 @@ var PageCodeEasterEgg = function (_a) {
|
|
|
70
74
|
react_1.default.createElement("div", { className: classes.gradientStripe }),
|
|
71
75
|
react_1.default.createElement("div", { className: classes.messageDiv },
|
|
72
76
|
react_1.default.createElement(core_1.Typography, { variant: 'subtitle1' }, "Hi, dev!"),
|
|
73
|
-
react_1.default.createElement(core_1.Typography, { variant: 'body1' }, "The page code is "
|
|
77
|
+
react_1.default.createElement(core_1.Typography, { variant: 'body1' }, "The page code is ".concat(code, ".")))));
|
|
74
78
|
};
|
|
75
79
|
var mapStateToProps = function (state) { return ({
|
|
76
80
|
usuarioLogado: state.argous.usuarioLogado
|
|
77
81
|
}); };
|
|
78
|
-
exports.default = react_redux_1.connect(mapStateToProps)(PageCodeEasterEgg);
|
|
82
|
+
exports.default = (0, react_redux_1.connect)(mapStateToProps)(PageCodeEasterEgg);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { TabArray } from './Tab';
|
|
1
2
|
import { BoxProps } from '@material-ui/core';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
|
|
5
|
+
|
|
4
6
|
export interface ProgramaProps extends BoxProps {
|
|
5
7
|
code: string,
|
|
6
8
|
children: React.ReactNode,
|
|
@@ -12,7 +14,20 @@ export interface ProgramaProps extends BoxProps {
|
|
|
12
14
|
hideTitle: boolean,
|
|
13
15
|
programDidMount: () => void,
|
|
14
16
|
bfHabNavegador: boolean,
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Abas para a barra de ferramentas
|
|
19
|
+
*
|
|
20
|
+
* Array de arrays
|
|
21
|
+
*
|
|
22
|
+
* Array da aba: [('Label' || undefined), ('active' || undefined), ('alias' || undefined), (Icon || undefined)]
|
|
23
|
+
*
|
|
24
|
+
* - [0] Label: Rótulo da aba.
|
|
25
|
+
* - [1] Active: Quando 'active' inicia o programa com essa aba selecionada.
|
|
26
|
+
* - [2] Alias: O nome que será recebido na função 'bfExecutaFuncao'. Caso não forneça esse nome a função retorna 'T[index]'.
|
|
27
|
+
* - [3] Icon: JSX do ícone da aba.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
bfAbas?: Array<TabArray>,
|
|
16
31
|
bfFerramentas: Array<any>,
|
|
17
32
|
bfExecutaFuncao: (prm: string) => void,
|
|
18
33
|
bfNmFuncaoVoltar: string,
|
|
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
14
|
if (k2 === undefined) k2 = k;
|
|
15
|
-
Object.
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
16
20
|
}) : (function(o, m, k, k2) {
|
|
17
21
|
if (k2 === undefined) k2 = k;
|
|
18
22
|
o[k2] = m[k];
|
|
@@ -44,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
44
48
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
49
|
function step(op) {
|
|
46
50
|
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
48
52
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49
53
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
54
|
switch (op[0]) {
|
|
@@ -82,9 +86,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
82
86
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
83
87
|
var BarraFerramentas_1 = __importDefault(require("./../BarraFerramentas"));
|
|
84
88
|
var PageCodeEasterEgg_1 = __importDefault(require("./PageCodeEasterEgg"));
|
|
89
|
+
var TabNavigationRail_1 = __importDefault(require("./TabNavigationRail"));
|
|
85
90
|
var argous = __importStar(require("../../actions"));
|
|
86
91
|
var api_1 = require("../../api");
|
|
87
92
|
var core_1 = require("@material-ui/core");
|
|
93
|
+
var lodash_1 = require("lodash");
|
|
88
94
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
89
95
|
var react_1 = __importStar(require("react"));
|
|
90
96
|
var fa_1 = require("react-icons/fa");
|
|
@@ -97,19 +103,31 @@ function Programa(_a) {
|
|
|
97
103
|
var code = _a.code, children = _a.children, _b = _a.loading, loading = _b === void 0 ? false : _b, _c = _a.threads, threads = _c === void 0 ? [] : _c, hint = _a.hint, title = _a.title, panelTitle = _a.panelTitle, hideTitle = _a.hideTitle, setCurrentProgram = _a.setCurrentProgram, programDidMount = _a.programDidMount, favorites = _a.favorites, setFavorites = _a.setFavorites, bfHabNavegador = _a.bfHabNavegador, _d = _a.bfAbas, bfAbas = _d === void 0 ? [] : _d, _e = _a.bfFerramentas, bfFerramentas = _e === void 0 ? [] : _e, bfExecutaFuncao = _a.bfExecutaFuncao, bfNmFuncaoVoltar = _a.bfNmFuncaoVoltar, bfNmCompartilhar = _a.bfNmCompartilhar, bfHabCrud = _a.bfHabCrud, bfNmSalva = _a.bfNmSalva, bfNmExclui = _a.bfNmExclui, _f = _a.bfHabFavorito, bfHabFavorito = _f === void 0 ? true : _f, bfTitulo = _a.bfTitulo,
|
|
98
104
|
// permissoes = { salvar: true, editar: true, excluir: true },
|
|
99
105
|
linkCompartilhamento = _a.linkCompartilhamento, className = _a.className, rightSidebar = _a.rightSidebar, setRightSidebar = _a.setRightSidebar, setAddProgramWidget = _a.setAddProgramWidget, setProgramAnnotation = _a.setProgramAnnotation, annotationParameters = _a.annotationParameters, openAnnotationParameters = _a.openAnnotationParameters, programAnnotation = _a.programAnnotation, _ = _a.fields, props = __rest(_a, ["code", "children", "loading", "threads", "hint", "title", "panelTitle", "hideTitle", "setCurrentProgram", "programDidMount", "favorites", "setFavorites", "bfHabNavegador", "bfAbas", "bfFerramentas", "bfExecutaFuncao", "bfNmFuncaoVoltar", "bfNmCompartilhar", "bfHabCrud", "bfNmSalva", "bfNmExclui", "bfHabFavorito", "bfTitulo", "linkCompartilhamento", "className", "rightSidebar", "setRightSidebar", "setAddProgramWidget", "setProgramAnnotation", "annotationParameters", "openAnnotationParameters", "programAnnotation", "fields"]);
|
|
100
|
-
var theme = core_1.useTheme();
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
react_1.
|
|
106
|
+
var theme = (0, core_1.useTheme)();
|
|
107
|
+
var xs = (0, core_1.useMediaQuery)(theme.breakpoints.only('xs'));
|
|
108
|
+
var _g = (0, react_1.useState)({}), programa = _g[0], setPrograma = _g[1];
|
|
109
|
+
var _h = (0, react_1.useState)([]), selectedTab = _h[0], setSelectedTab = _h[1];
|
|
110
|
+
var _j = (0, react_1.useState)(false), favoriteAnimationInsert = _j[0], setFavoriteAnimationInsert = _j[1];
|
|
111
|
+
var _k = (0, react_1.useState)(false), favoriteAnimationRemove = _k[0], setFavoriteAnimationRemove = _k[1];
|
|
112
|
+
var toolbarLoading = (0, react_1.useState)(initialStateToolbarLoading)[0] /*, setToolbarLoading*/;
|
|
113
|
+
var tabNavigationRailRule = (!xs && (0, lodash_1.isArray)(bfAbas) && ((bfAbas === null || bfAbas === void 0 ? void 0 : bfAbas.length) > 1));
|
|
114
|
+
var styles = {
|
|
115
|
+
bodyContainer: {
|
|
116
|
+
display: 'flex',
|
|
117
|
+
gap: 10
|
|
118
|
+
},
|
|
119
|
+
childrenContainer: {
|
|
120
|
+
width: (tabNavigationRailRule) ? 'calc(100% - 58px)' : '100%'
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
(0, react_1.useEffect)(function () {
|
|
106
124
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
107
125
|
var res;
|
|
108
126
|
return __generator(this, function (_a) {
|
|
109
127
|
switch (_a.label) {
|
|
110
128
|
case 0:
|
|
111
129
|
setCurrentProgram(code);
|
|
112
|
-
return [4 /*yield*/, api_1.getProgram(code)];
|
|
130
|
+
return [4 /*yield*/, (0, api_1.getProgram)(code)];
|
|
113
131
|
case 1:
|
|
114
132
|
res = _a.sent();
|
|
115
133
|
// TODO prever aqui tempo de bloqueio diferenciado
|
|
@@ -128,7 +146,7 @@ function Programa(_a) {
|
|
|
128
146
|
var openAnnotations = function (event) { return setProgramAnnotation(__assign(__assign({}, programa), { open: true, code: code, annotationParameters: annotationParameters, openAnnotationParameters: openAnnotationParameters })); };
|
|
129
147
|
var addFavorite = function () {
|
|
130
148
|
var path = window.location.pathname;
|
|
131
|
-
api_1.toggleFavorite({ link: path }).then(function (res) {
|
|
149
|
+
(0, api_1.toggleFavorite)({ link: path }).then(function (res) {
|
|
132
150
|
setFavorites(res.fvrts);
|
|
133
151
|
var existIn = res.fvrts.filter(function (item) { return item[3] === path; });
|
|
134
152
|
if (existIn.length > 0) {
|
|
@@ -170,11 +188,21 @@ function Programa(_a) {
|
|
|
170
188
|
react_1.default.createElement("span", { className: 'text-muted', style: { color: theme.palette.text.primary } }, "\u00A0|\u00A0")),
|
|
171
189
|
react_1.default.createElement("p", { id: 'pg-subtitulo', className: 'pull-left hw-program-subtitulo', style: { color: theme.palette.text.primary } }, pgHint)),
|
|
172
190
|
react_1.default.createElement(core_1.Paper, { variant: 'outlined', style: { padding: 10, position: 'relative' } },
|
|
173
|
-
react_1.default.createElement(BarraFerramentas_1.default, __assign({ titulo: bfTitulo, abas: bfAbas, habFavorito: bfHabFavorito, habNavegador: bfHabNavegador, executaFuncao: bfExecutaFuncao, nmFuncaoVoltar: bfNmFuncaoVoltar, nmCompartilhar: bfNmCompartilhar, habCrud: bfHabCrud, nmSalva: bfNmSalva, nmExclui: bfNmExclui, ferramentas: bfFerramentas, checkIfIsFavorite: checkIfIsFavorite, addFavorite: addFavorite, linkCompartilhamento: linkCompartilhamento, favoriteAnimationInsert: favoriteAnimationInsert, favoriteAnimationRemove: favoriteAnimationRemove, threads: threads, currentProgram: code }, {
|
|
191
|
+
react_1.default.createElement(BarraFerramentas_1.default, __assign({ titulo: bfTitulo, abas: bfAbas, habFavorito: bfHabFavorito, habNavegador: bfHabNavegador, executaFuncao: bfExecutaFuncao, nmFuncaoVoltar: bfNmFuncaoVoltar, nmCompartilhar: bfNmCompartilhar, habCrud: bfHabCrud, nmSalva: bfNmSalva, nmExclui: bfNmExclui, ferramentas: bfFerramentas, checkIfIsFavorite: checkIfIsFavorite, addFavorite: addFavorite, linkCompartilhamento: linkCompartilhamento, favoriteAnimationInsert: favoriteAnimationInsert, favoriteAnimationRemove: favoriteAnimationRemove, threads: threads, currentProgram: code }, {
|
|
192
|
+
addWidget: addWidget,
|
|
193
|
+
habWidget: habWidget,
|
|
194
|
+
snAnotacaoPrograma: snAnotacaoPrograma,
|
|
195
|
+
openAnnotations: openAnnotations,
|
|
196
|
+
toolbarLoading: toolbarLoading,
|
|
197
|
+
selectedTab: selectedTab,
|
|
198
|
+
setSelectedTab: setSelectedTab
|
|
199
|
+
})),
|
|
174
200
|
dsErro ? (react_1.default.createElement(core_1.Box, { textAlign: 'center' },
|
|
175
201
|
react_1.default.createElement(fa_1.FaExclamationTriangle, { style: { color: '#ED1651', width: '90px', height: '90px' } }),
|
|
176
202
|
react_1.default.createElement(core_1.Typography, { variant: 'h6' }, dsErro))) : (!pnlTitle || loading || !loaded) ? (react_1.default.createElement(core_1.Box, { position: 'relative', top: 20, left: '50%', "z-index": 20, height: 80, width: 0, marginLeft: '-20px' },
|
|
177
|
-
react_1.default.createElement(core_1.CircularProgress, { disableShrink: true }))) :
|
|
203
|
+
react_1.default.createElement(core_1.CircularProgress, { disableShrink: true }))) : (react_1.default.createElement("div", { style: styles.bodyContainer },
|
|
204
|
+
(tabNavigationRailRule) && (react_1.default.createElement(TabNavigationRail_1.default, __assign({ tabs: bfAbas, executesFunction: bfExecutaFuncao }, { selectedTab: selectedTab, setSelectedTab: setSelectedTab }))),
|
|
205
|
+
react_1.default.createElement("div", { style: styles.childrenContainer }, children)))),
|
|
178
206
|
react_1.default.createElement(PageCodeEasterEgg_1.default, __assign({}, { code: code }))));
|
|
179
207
|
}
|
|
180
208
|
var mapStateToProps = function (state) { return ({
|
|
@@ -217,4 +245,4 @@ Programa.propTypes = {
|
|
|
217
245
|
panelTitle: prop_types_1.default.string,
|
|
218
246
|
// permissoes: PropTypes.object,
|
|
219
247
|
};
|
|
220
|
-
exports.default = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(Programa);
|
|
248
|
+
exports.default = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(Programa);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const TAB_LABEL_INDEX: 0;
|
|
2
|
+
export const TAB_ACTIVE_INDEX: 1;
|
|
3
|
+
export const TAB_ALIAS_INDEX: 2;
|
|
4
|
+
export const TAB_ICON_INDEX: 3;
|
|
5
|
+
export default TabNavigationRail;
|
|
6
|
+
declare function TabNavigationRail({ tabs, selectedTab, setSelectedTab, executesFunction }: {
|
|
7
|
+
tabs?: any[] | undefined;
|
|
8
|
+
selectedTab?: any[] | undefined;
|
|
9
|
+
setSelectedTab?: (() => string) | undefined;
|
|
10
|
+
executesFunction?: (() => string) | undefined;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
import React from "react";
|