awing-library 2.1.71-beta → 2.1.73-beta

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.
@@ -152,7 +152,7 @@ var CreateOrEdit = function () {
152
152
  handleJobActionChange(jobActions.filter(function (x) { return x.name === name; })[0]);
153
153
  handleChange('jobAction', name);
154
154
  }, value: jobModel.jobAction, children: jobActions.map(function (item) { return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: item.name, children: item.name }, item.name)); }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 8, style: { marginTop: '16px' }, children: (jobModel === null || jobModel === void 0 ? void 0 : jobModel.inputParameters) && ((0, jsx_runtime_1.jsx)(InputParameters_1.default, { inputParameters: jobModel === null || jobModel === void 0 ? void 0 : jobModel.inputParameters, jobActionSelected: jobActionSelected, handleInputParamChange: handleInputParamChange })) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 6, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 6, style: { paddingRight: '10px' }, children: (0, jsx_runtime_1.jsx)(BasicInput_1.default, { fullWidth: true, name: "authUsername", required: false, label: t('User.Username'), checkValid: function (value) {
155
- return (0, validation_1.textValidation)(value, 50, false);
155
+ return (0, validation_1.textValidation)(value, 150, false, /^[a-zA-Z0-9\/\-_.@()\[\] ]+$/g, false);
156
156
  }, onChange: handleChange, value: jobModel.authUsername }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 5, style: { paddingRight: '10px' }, children: (0, jsx_runtime_1.jsx)(BasicInput_1.default, { fullWidth: true, autoComplete: "current-password", name: "authPassword", type: "password", required: false, label: t('User.Password'), onChange: handleChange, value: jobModel.authPassword }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 1, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { placement: "top", title: t('TaskScheduler.Help.Authen'), arrow: true, children: (0, jsx_runtime_1.jsx)(icons_material_1.HelpOutline, { fontSize: "small", color: "action", style: {
157
157
  marginTop: '20px',
158
158
  marginLeft: '-10px',
@@ -12,6 +12,8 @@ exports.cloneValue = exports.getFormValidation = void 0;
12
12
  var Enums_1 = require("./Enums");
13
13
  var getFormValidation = function (job, jobValid) {
14
14
  var isValid = false;
15
+ if (!Object.values(jobValid).length)
16
+ return true;
15
17
  if (job.jobType === Enums_1.JobTypeEnum.Trigger) {
16
18
  isValid =
17
19
  (Boolean(job.triggerTopic) ||
@@ -30,13 +30,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
31
  exports.DataGrid = void 0;
32
32
  var jsx_runtime_1 = require("react/jsx-runtime");
33
+ var react_1 = __importDefault(require("react"));
33
34
  var styles_1 = require("@mui/material/styles");
34
35
  var material_1 = require("@mui/material");
35
36
  var Pagination_1 = __importDefault(require("../Pagination"));
36
37
  var NoData_1 = __importDefault(require("../NoData"));
37
38
  var constants_1 = require("../constants");
38
- var helper_1 = require("../helper");
39
+ var Helpers_1 = require("../../Utils/Helpers");
39
40
  var get_1 = __importDefault(require("../Form/Utils/get"));
41
+ var i18n_1 = __importDefault(require("../../i18n"));
40
42
  var StyledTableRow = (0, styles_1.styled)(material_1.TableRow)({
41
43
  '& .MuiTableCell-root:last-child .MuiButtonBase-root': {
42
44
  visibility: 'hidden',
@@ -72,6 +74,11 @@ var SpanSortIndex = (0, styles_1.styled)('span')({
72
74
  });
73
75
  var DataGrid = function (props) {
74
76
  var columns = props.columns, rows = props.rows, _a = props.hideHeader, hideHeader = _a === void 0 ? false : _a, spanningRows = props.spanningRows, _b = props.spanningRowsPosition, spanningRowsPosition = _b === void 0 ? 'bottom' : _b, getRowId = props.getRowId, onRowClick = props.onRowClick, rowActions = props.rowActions, sortModel = props.sortModel, onSortModelChange = props.onSortModelChange, selected = props.selected, onSelectedChange = props.onSelectedChange, selectionActions = props.selectionActions, _c = props.pageIndex, pageIndex = _c === void 0 ? constants_1.PAGE_INDEX_DEFAULT : _c, _d = props.pageSize, pageSize = _d === void 0 ? constants_1.PAGE_SIZE_DEFAULT : _d, _e = props.totalOfRows, totalOfRows = _e === void 0 ? rows.length : _e, _f = props.rowsPerPageOptions, rowsPerPageOptions = _f === void 0 ? [10, 20, 30] : _f, onPageIndexChange = props.onPageIndexChange, onPageSizeChange = props.onPageSizeChange;
77
+ react_1.default.useEffect(function () {
78
+ var language = localStorage.getItem('i18nextLng');
79
+ i18n_1.default.changeLanguage(language || 'vi');
80
+ // eslint-disable-next-line react-hooks/exhaustive-deps
81
+ }, [localStorage.getItem('i18nextLng')]);
75
82
  var createSortHandler = function (fieldName) { return function (event) {
76
83
  var _a, _b, _c;
77
84
  if (onSortModelChange) {
@@ -168,7 +175,7 @@ var DataGrid = function (props) {
168
175
  }
169
176
  };
170
177
  var calcOrder = function (index) { return pageIndex * pageSize + 1 + index; };
171
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableContainer, { component: material_1.Paper, children: [(0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "simple table", style: { tableLayout: 'fixed' }, children: [!hideHeader && ((0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [selected && onSelectedChange && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { padding: "checkbox", children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", indeterminate: selected.length > 0 &&
178
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableContainer, { component: material_1.Paper, children: [(0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "simple table", style: { tableLayout: 'fixed' }, children: [!hideHeader && ((0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [selected && onSelectedChange && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { padding: "checkbox", children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", indeterminate: selected.length > 0 &&
172
179
  selected.length < rows.length, checked: selected.length > 0 &&
173
180
  selected.length === rows.length, onChange: function () { return handleSelectAll(); }, inputProps: {
174
181
  'aria-label': 'select all desserts',
@@ -232,7 +239,7 @@ var DataGrid = function (props) {
232
239
  var displayValue = col.valueGetter
233
240
  ? col.valueGetter(row, idx, calcOrder(idx))
234
241
  : col.type === 'number'
235
- ? (0, helper_1.formatNumber)(row[col.field])
242
+ ? (0, Helpers_1.formatNumber)(row[col.field])
236
243
  : (0, get_1.default)(row, col.field);
237
244
  var dynamicStyle = col.dynamicTableCellProps
238
245
  ? col.dynamicTableCellProps(row)
@@ -256,7 +263,12 @@ var DataGrid = function (props) {
256
263
  : 1,
257
264
  }, sx: __assign(__assign({}, actionDef.sx), { borderRadius: '15%' }), children: typeof actionDef.icon ===
258
265
  'function'
259
- ? actionDef.icon({ id: id, row: row, idx: idx, order: calcOrder(idx) })
266
+ ? actionDef.icon({
267
+ id: id,
268
+ row: row,
269
+ idx: idx,
270
+ order: calcOrder(idx),
271
+ })
260
272
  : actionDef.icon }) }, "".concat(id, "-").concat(actIdx)));
261
273
  }) }))] }), id));
262
274
  }), spanningRowsPosition == 'bottom' && spanningRows] })] }), !rows.length && (0, jsx_runtime_1.jsx)(NoData_1.default, {})] }), onPageIndexChange && onPageSizeChange && ((0, jsx_runtime_1.jsx)(Pagination_1.default, { rowsPerPageOptions: rowsPerPageOptions, colSpan: 3, count: totalOfRows, rowsPerPage: pageSize, page: pageIndex, SelectProps: {
@@ -264,7 +276,7 @@ var DataGrid = function (props) {
264
276
  native: true,
265
277
  }, onPageChange: function (e, page) { return onPageIndexChange(page); }, onRowsPerPageChange: function (e) {
266
278
  return onPageSizeChange(parseInt(e.target.value, 10));
267
- } }))] });
279
+ } }))] }));
268
280
  };
269
281
  exports.DataGrid = DataGrid;
270
282
  exports.default = exports.DataGrid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.71-beta",
3
+ "version": "2.1.73-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",