tenjin-ui-kit 0.2.49 → 0.2.50

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.
@@ -35,23 +35,67 @@ var useAPI = function useAPI() {
35
35
  _useState8 = _slicedToArray(_useState7, 2),
36
36
  deleteResult = _useState8[0],
37
37
  setdeleteResult = _useState8[1];
38
- var _useState9 = (0, _react.useState)({
38
+ //
39
+ var _useState9 = (0, _react.useState)(null),
40
+ _useState10 = _slicedToArray(_useState9, 2),
41
+ getError = _useState10[0],
42
+ setGetError = _useState10[1];
43
+ var _useState11 = (0, _react.useState)(null),
44
+ _useState12 = _slicedToArray(_useState11, 2),
45
+ postError = _useState12[0],
46
+ setpostError = _useState12[1];
47
+ var _useState13 = (0, _react.useState)(null),
48
+ _useState14 = _slicedToArray(_useState13, 2),
49
+ putError = _useState14[0],
50
+ setputError = _useState14[1];
51
+ var _useState15 = (0, _react.useState)(null),
52
+ _useState16 = _slicedToArray(_useState15, 2),
53
+ deleteError = _useState16[0],
54
+ setdeleteError = _useState16[1];
55
+ //
56
+ var _useState17 = (0, _react.useState)(null),
57
+ _useState18 = _slicedToArray(_useState17, 2),
58
+ getLoading = _useState18[0],
59
+ setGetLoading = _useState18[1];
60
+ var _useState19 = (0, _react.useState)(null),
61
+ _useState20 = _slicedToArray(_useState19, 2),
62
+ postLoading = _useState20[0],
63
+ setpostLoading = _useState20[1];
64
+ var _useState21 = (0, _react.useState)(null),
65
+ _useState22 = _slicedToArray(_useState21, 2),
66
+ putLoading = _useState22[0],
67
+ setputLoading = _useState22[1];
68
+ var _useState23 = (0, _react.useState)(null),
69
+ _useState24 = _slicedToArray(_useState23, 2),
70
+ deleteLoading = _useState24[0],
71
+ setdeleteLoading = _useState24[1];
72
+ var _useState25 = (0, _react.useState)({
39
73
  getResult: getResult,
40
74
  postResult: postResult,
41
75
  putResult: putResult,
42
76
  deleteResult: deleteResult
43
77
  }),
44
- _useState10 = _slicedToArray(_useState9, 2),
45
- result = _useState10[0],
46
- setResult = _useState10[1];
47
- var _useState11 = (0, _react.useState)(null),
48
- _useState12 = _slicedToArray(_useState11, 2),
49
- errorMessage = _useState12[0],
50
- setErrorMessage = _useState12[1];
51
- var _useState13 = (0, _react.useState)(false),
52
- _useState14 = _slicedToArray(_useState13, 2),
53
- loading = _useState14[0],
54
- setLoading = _useState14[1];
78
+ _useState26 = _slicedToArray(_useState25, 2),
79
+ result = _useState26[0],
80
+ setResult = _useState26[1];
81
+ var _useState27 = (0, _react.useState)({
82
+ getError: getError,
83
+ postError: postError,
84
+ putError: putError,
85
+ deleteError: deleteError
86
+ }),
87
+ _useState28 = _slicedToArray(_useState27, 2),
88
+ errorMessage = _useState28[0],
89
+ setErrorMessage = _useState28[1];
90
+ var _useState29 = (0, _react.useState)({
91
+ getLoading: getLoading,
92
+ postLoading: postLoading,
93
+ putLoading: putLoading,
94
+ deleteLoading: deleteLoading
95
+ }),
96
+ _useState30 = _slicedToArray(_useState29, 2),
97
+ loading = _useState30[0],
98
+ setLoading = _useState30[1];
55
99
  var useGet = /*#__PURE__*/function () {
56
100
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, action) {
57
101
  var response;
@@ -67,14 +111,20 @@ var useAPI = function useAPI() {
67
111
  setResult({
68
112
  getResult: response
69
113
  });
70
- setLoading(false);
114
+ setLoading({
115
+ getLoading: false
116
+ });
71
117
  _context.next = 13;
72
118
  break;
73
119
  case 9:
74
120
  _context.prev = 9;
75
121
  _context.t0 = _context["catch"](0);
76
- setErrorMessage(_context.t0.message);
77
- setLoading(false);
122
+ setErrorMessage({
123
+ getError: _context.t0.message
124
+ });
125
+ setLoading({
126
+ getLoading: false
127
+ });
78
128
  case 13:
79
129
  case "end":
80
130
  return _context.stop();
@@ -100,14 +150,20 @@ var useAPI = function useAPI() {
100
150
  setResult({
101
151
  postResult: response
102
152
  });
103
- setLoading(false);
153
+ setLoading({
154
+ postLoading: false
155
+ });
104
156
  _context2.next = 13;
105
157
  break;
106
158
  case 9:
107
159
  _context2.prev = 9;
108
160
  _context2.t0 = _context2["catch"](0);
109
- setErrorMessage(_context2.t0.message);
110
- setLoading(false);
161
+ setErrorMessage({
162
+ postError: _context2.t0.message
163
+ });
164
+ setLoading({
165
+ postLoading: false
166
+ });
111
167
  case 13:
112
168
  case "end":
113
169
  return _context2.stop();
@@ -133,14 +189,20 @@ var useAPI = function useAPI() {
133
189
  setResult({
134
190
  putResult: response
135
191
  });
136
- setLoading(false);
192
+ setLoading({
193
+ putLoading: false
194
+ });
137
195
  _context3.next = 13;
138
196
  break;
139
197
  case 9:
140
198
  _context3.prev = 9;
141
199
  _context3.t0 = _context3["catch"](0);
142
- setErrorMessage(_context3.t0.message);
143
- setLoading(false);
200
+ setErrorMessage({
201
+ putError: _context3.t0.message
202
+ });
203
+ setLoading({
204
+ putLoading: false
205
+ });
144
206
  case 13:
145
207
  case "end":
146
208
  return _context3.stop();
@@ -166,14 +228,20 @@ var useAPI = function useAPI() {
166
228
  setResult({
167
229
  deleteResult: response
168
230
  });
169
- setLoading(false);
231
+ setLoading({
232
+ deleteLoading: false
233
+ });
170
234
  _context4.next = 13;
171
235
  break;
172
236
  case 9:
173
237
  _context4.prev = 9;
174
238
  _context4.t0 = _context4["catch"](0);
175
- setErrorMessage(_context4.t0.message);
176
- setLoading(false);
239
+ setErrorMessage({
240
+ deleteError: _context4.t0.message
241
+ });
242
+ setLoading({
243
+ deleteLoading: false
244
+ });
177
245
  case 13:
178
246
  case "end":
179
247
  return _context4.stop();
@@ -34,7 +34,10 @@ var Input = function Input(_ref) {
34
34
  fullWidth: fullWidth
35
35
  }, label && /*#__PURE__*/_react.default.createElement(_InputLabel.default, {
36
36
  sx: {
37
- fontWeight: 500
37
+ fontWeight: 500,
38
+ '& .MuiFormLabel-asterisk': {
39
+ color: '#FF0000'
40
+ }
38
41
  },
39
42
  size: "small",
40
43
  shrink: true,
@@ -43,13 +46,13 @@ var Input = function Input(_ref) {
43
46
  }, label), !error && /*#__PURE__*/_react.default.createElement(_material.OutlinedInput, _extends({}, rest, {
44
47
  id: id,
45
48
  required: isRequired,
46
- autoComplete: disableAutocomplete ? "nothing" : null,
49
+ autoComplete: disableAutocomplete ? 'nothing' : null,
47
50
  sx: {
48
51
  marginTop: label ? theme.spacing(2.5) : 0,
49
- "& label": {
52
+ '& label': {
50
53
  fontWeight: 500
51
54
  },
52
- "& svg": {
55
+ '& svg': {
53
56
  marginRight: startIcon ? theme.spacing(1) : 0,
54
57
  marginLeft: endIcon ? theme.spacing(1) : 0
55
58
  }
@@ -61,13 +64,13 @@ var Input = function Input(_ref) {
61
64
  })), error && /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({
62
65
  required: isRequired,
63
66
  id: id,
64
- autoComplete: disableAutocomplete ? "nothing" : null,
67
+ autoComplete: disableAutocomplete ? 'nothing' : null,
65
68
  sx: {
66
69
  marginTop: label ? theme.spacing(2.5) : 0,
67
- "& label": {
70
+ '& label': {
68
71
  fontWeight: 500
69
72
  },
70
- "& svg": {
73
+ '& svg': {
71
74
  marginRight: startIcon ? theme.spacing(1) : 0,
72
75
  marginLeft: endIcon ? theme.spacing(1) : 0
73
76
  }
@@ -33,7 +33,7 @@ var ReactSelect = function ReactSelect(props) {
33
33
  isRequired = props.isRequired,
34
34
  isDisabled = props.isDisabled,
35
35
  rest = _objectWithoutProperties(props, _excluded);
36
- console.log(defaultValue, "hsgdsahgd", options[1]);
36
+ console.log(defaultValue, 'hsgdsahgd', options[1]);
37
37
  var icon = /*#__PURE__*/_react.default.createElement(_CheckBoxOutlineBlank.default, {
38
38
  fontSize: "small"
39
39
  });
@@ -45,14 +45,19 @@ var ReactSelect = function ReactSelect(props) {
45
45
  }, /*#__PURE__*/_react.default.createElement(_material.FormLabel, {
46
46
  htmlFor: "my-input",
47
47
  sx: {
48
- fontSize: "0.8rem",
48
+ fontSize: '0.8rem',
49
49
  fontWeight: 500
50
50
  }
51
- }, label, isRequired ? "*" : ""), checkBox && /*#__PURE__*/_react.default.createElement(_material.Autocomplete, _extends({}, rest, {
51
+ }, label, isRequired ? /*#__PURE__*/_react.default.createElement("span", {
52
+ style: {
53
+ color: 'red'
54
+ }
55
+ }, " *") : ''), checkBox && /*#__PURE__*/_react.default.createElement(_material.Autocomplete, _extends({}, rest, {
52
56
  disabled: isDisabled,
53
57
  multiple: isMulti,
54
- options: options,
55
- disableCloseOnSelect: true,
58
+ options: options
59
+ // disableCloseOnSelect
60
+ ,
56
61
  getOptionLabel: function getOptionLabel(option) {
57
62
  return option === null || option === void 0 ? void 0 : option.label;
58
63
  },
@@ -79,8 +84,9 @@ var ReactSelect = function ReactSelect(props) {
79
84
  })), !checkBox && !blueTheme && /*#__PURE__*/_react.default.createElement(_material.Autocomplete, _extends({}, rest, {
80
85
  disabled: isDisabled,
81
86
  multiple: isMulti,
82
- options: options,
83
- disableCloseOnSelect: true,
87
+ options: options
88
+ // disableCloseOnSelect
89
+ ,
84
90
  getOptionLabel: function getOptionLabel(option) {
85
91
  return option.label;
86
92
  },
@@ -100,37 +106,38 @@ var ReactSelect = function ReactSelect(props) {
100
106
  })), blueTheme && /*#__PURE__*/_react.default.createElement(_material.Grid, {
101
107
  container: true,
102
108
  sx: {
103
- height: "200px",
104
- backgroundColor: "#3D3981",
105
- borderRadius: "7px",
106
- padding: "16px",
107
- width: "50%"
109
+ height: '200px',
110
+ backgroundColor: '#3D3981',
111
+ borderRadius: '7px',
112
+ padding: '16px',
113
+ width: '50%'
108
114
  // background: "red",
109
115
  }
110
116
  }, /*#__PURE__*/_react.default.createElement(_material.Autocomplete, _extends({
111
117
  sx: {
112
- width: "100%",
118
+ width: '100%',
113
119
  "& .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root']": {
114
- background: "#6e6ba1",
115
- color: "#F4F7FC"
120
+ background: '#6e6ba1',
121
+ color: '#F4F7FC'
116
122
  }
117
123
  },
118
124
  PaperComponent: function PaperComponent(_ref2) {
119
125
  var children = _ref2.children;
120
126
  return /*#__PURE__*/_react.default.createElement(_material.Paper, {
121
127
  style: {
122
- background: "#6e6ba1",
123
- color: "#F4F7FC",
124
- "&:hover": {
125
- background: "#fff"
128
+ background: '#6e6ba1',
129
+ color: '#F4F7FC',
130
+ '&:hover': {
131
+ background: '#fff'
126
132
  }
127
133
  }
128
134
  }, children);
129
135
  }
130
136
  }, rest, {
131
137
  disabled: isDisabled,
132
- options: options,
133
- disableCloseOnSelect: true,
138
+ options: options
139
+ // disableCloseOnSelect
140
+ ,
134
141
  getOptionLabel: function getOptionLabel(option) {
135
142
  return option.label;
136
143
  },
@@ -166,13 +173,13 @@ ReactSelect.propTypes = {
166
173
  };
167
174
  ReactSelect.defaultProps = {
168
175
  value: {},
169
- label: "",
170
- className: "",
176
+ label: '',
177
+ className: '',
171
178
  defaultValue: [{}],
172
179
  isMulti: false,
173
180
  isDisabled: false,
174
181
  options: [],
175
- placeholder: "",
182
+ placeholder: '',
176
183
  isRequired: false,
177
184
  simulateNativeSelect: true
178
185
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tenjin-ui-kit",
3
- "version": "0.2.49",
3
+ "version": "0.2.50",
4
4
  "repository": {
5
5
  "url": "https://gitlab.com/yethi/react/tenjin-ui-kit.git"
6
6
  },
package/themes/default.js CHANGED
@@ -9,12 +9,12 @@ var _default = (0, _material.createTheme)({
9
9
  components: {
10
10
  MuiButton: {
11
11
  defaultProps: {
12
- variant: "contained",
12
+ variant: 'contained',
13
13
  disableRipple: true
14
14
  },
15
15
  styleOverrides: {
16
16
  root: {
17
- textTransform: "initial"
17
+ textTransform: 'initial'
18
18
  }
19
19
  }
20
20
  },
@@ -41,46 +41,56 @@ var _default = (0, _material.createTheme)({
41
41
  MuiAutocomplete: {
42
42
  styleOverrides: {
43
43
  root: {
44
- padding: "0.5rem 0.75rem",
45
- border: "1px solid black !important",
46
- borderRadius: "0.25rem",
47
- backgroundColor: "white",
48
- "& .MuiAutocomplete-input": {
49
- padding: "0.5rem 0.75rem",
50
- fontSize: "1rem",
51
- border: "1px solid black !important"
44
+ padding: '0.5rem 0.75rem',
45
+ border: '1px solid black !important',
46
+ borderRadius: '0.25rem',
47
+ backgroundColor: 'white',
48
+ '& .MuiAutocomplete-input': {
49
+ padding: '0.5rem 0.75rem',
50
+ fontSize: '1rem',
51
+ border: '1px solid black !important'
52
+ }
53
+ }
54
+ },
55
+ MuiInputLabel: {
56
+ styleOverrides: {
57
+ asterisk: {
58
+ color: '#db3131',
59
+ '&$error': {
60
+ color: '#db3131'
61
+ }
52
62
  }
53
63
  }
54
64
  }
55
65
  },
56
66
  overrides: {
57
67
  MuiCssBaseline: {
58
- "@global": {
68
+ '@global': {
59
69
  html: {
60
- "scroll-behavior": "smooth",
61
- height: "100vh"
70
+ 'scroll-behavior': 'smooth',
71
+ height: '100vh'
62
72
  },
63
73
  body: {
64
- position: "relative",
74
+ position: 'relative',
65
75
  margin: 0,
66
- height: "100vh",
67
- color: "#000000",
68
- backgroundColor: "#f4f7fc"
76
+ height: '100vh',
77
+ color: '#000000',
78
+ backgroundColor: '#f4f7fc'
69
79
  },
70
- "*::-webkit-scrollbar": {
71
- width: "6px"
80
+ '*::-webkit-scrollbar': {
81
+ width: '6px'
72
82
  },
73
83
  a: {
74
- textDecoration: "none",
75
- color: "#44409A"
84
+ textDecoration: 'none',
85
+ color: '#44409A'
76
86
  },
77
- "*::-webkit-scrollbar-thumb": {
78
- backgroundColor: "#e4e4e4",
79
- borderRadius: "3px",
87
+ '*::-webkit-scrollbar-thumb': {
88
+ backgroundColor: '#e4e4e4',
89
+ borderRadius: '3px',
80
90
  opacity: 0.5
81
91
  },
82
- "*::-webkit-scrollbar-track": {
83
- background: "transparent"
92
+ '*::-webkit-scrollbar-track': {
93
+ background: 'transparent'
84
94
  }
85
95
  }
86
96
  }
@@ -123,83 +133,83 @@ var _default = (0, _material.createTheme)({
123
133
  // main: "#BF1E1E",
124
134
  // },
125
135
  primary: {
126
- main: "#44409A"
136
+ main: '#44409A'
127
137
  },
128
138
  primary_light: {
129
- main: "#5B58A9"
139
+ main: '#5B58A9'
130
140
  },
131
141
  primary_dark: {
132
- main: "#000050"
142
+ main: '#000050'
133
143
  },
134
144
  secondary: {
135
- main: "#BF1E1E"
145
+ main: '#BF1E1E'
136
146
  },
137
147
  secondary_light: {
138
- main: "#CC3F3F"
148
+ main: '#CC3F3F'
139
149
  },
140
150
  secondary_dark: {
141
- main: "#951010"
151
+ main: '#951010'
142
152
  },
143
153
  success: {
144
- main: "#2C7413"
154
+ main: '#2C7413'
145
155
  },
146
156
  success_light: {
147
- main: "#5EA342"
157
+ main: '#5EA342'
148
158
  },
149
159
  success_dark: {
150
- main: "#004700"
160
+ main: '#004700'
151
161
  },
152
162
  info: {
153
- main: "#70BBFD"
163
+ main: '#70BBFD'
154
164
  },
155
165
  info_light: {
156
- main: "#A6EDFF"
166
+ main: '#A6EDFF'
157
167
  },
158
168
  info_dark: {
159
- main: "#358BCA"
169
+ main: '#358BCA'
160
170
  },
161
171
  error: {
162
- main: "#BE1515"
172
+ main: '#BE1515'
163
173
  },
164
174
  error_light: {
165
- main: "#F8533F"
175
+ main: '#F8533F'
166
176
  },
167
177
  error_dark: {
168
- main: "#860000"
178
+ main: '#860000'
169
179
  },
170
180
  warning: {
171
- main: "#EB9A31"
181
+ main: '#EB9A31'
172
182
  },
173
183
  warning_light: {
174
- main: "#FFCB62"
184
+ main: '#FFCB62'
175
185
  },
176
186
  warning_dark: {
177
- main: "#B46C00"
187
+ main: '#B46C00'
178
188
  },
179
189
  grey: {
180
- main: "#7D7D7D"
190
+ main: '#7D7D7D'
181
191
  },
182
192
  grey_light: {
183
- main: "#ACACAC"
193
+ main: '#ACACAC'
184
194
  },
185
195
  grey_dark: {
186
- main: "#515151"
196
+ main: '#515151'
187
197
  },
188
198
  secondary_grey: {
189
- main: "#D7E2F0"
199
+ main: '#D7E2F0'
190
200
  },
191
201
  white: {
192
- main: "#ffffff"
202
+ main: '#ffffff'
193
203
  },
194
204
  default: {
195
- main: "#7D7D7D"
205
+ main: '#7D7D7D'
196
206
  },
197
207
  text: {
198
- main: "#000000"
208
+ main: '#000000'
199
209
  }
200
210
  },
201
211
  typography: {
202
- fontFamily: ["-apple-system", "BlinkMacSystemFont", '"Segoe UI"', "Roboto", '"Helvetica Neue"', "Arial", "sans-serif", '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(",")
212
+ fontFamily: ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Roboto', '"Helvetica Neue"', 'Arial', 'sans-serif', '"Apple Color Emoji"', '"Segoe UI Emoji"', '"Segoe UI Symbol"'].join(',')
203
213
  }
204
214
  });
205
215
  exports.default = _default;