@arquimedes.co/eureka-forms 1.9.19-test → 1.9.20

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.
Files changed (64) hide show
  1. package/dist/App.js +205 -98
  2. package/dist/AxiosAPI.js +3 -3
  3. package/dist/AxiosWidget.js +4 -4
  4. package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +207 -104
  5. package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +17 -5
  6. package/dist/FormComponents/Form/Form.js +56 -29
  7. package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
  8. package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +30 -7
  9. package/dist/FormComponents/Section/Section.js +13 -2
  10. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
  11. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +32 -9
  12. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +70 -49
  13. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +102 -41
  14. package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +92 -37
  15. package/dist/FormComponents/Step/AYFStepMapper.js +75 -23
  16. package/dist/FormComponents/Step/CBRStepMapper.js +144 -56
  17. package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +26 -3
  18. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +21 -6
  19. package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +26 -3
  20. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +65 -32
  21. package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +13 -2
  22. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +21 -6
  23. package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +13 -2
  24. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +88 -27
  25. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +171 -81
  26. package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +41 -15
  27. package/dist/FormComponents/Step/RatingStep/RatingStep.js +13 -2
  28. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +52 -25
  29. package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +26 -3
  30. package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -1
  31. package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +26 -3
  32. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +145 -83
  33. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +13 -2
  34. package/dist/FormComponents/Step/Step.js +39 -19
  35. package/dist/FormComponents/Step/StepFunctions.js +16 -14
  36. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +62 -43
  37. package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +13 -2
  38. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +21 -6
  39. package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +13 -2
  40. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +15 -3
  41. package/dist/FormComponents/Step/TitleStep/TitleStep.js +26 -3
  42. package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +35 -19
  43. package/dist/FormComponents/Term/Term.js +13 -2
  44. package/dist/Widget.js +29 -13
  45. package/dist/constants/Files/FileExtensions.js +3 -3
  46. package/dist/constants/Files/FileMaxSize.js +1 -1
  47. package/dist/constants/InternalFormStyle.js +1 -1
  48. package/dist/constants/MaterialClassNameSeed.js +1 -1
  49. package/dist/controllers/FileService.js +86 -29
  50. package/dist/index.js +15 -4
  51. package/dist/shared/Loader/Loader.js +17 -5
  52. package/dist/shared/Navbar/Navbar.js +14 -2
  53. package/dist/shared/Rating/Rating.js +27 -4
  54. package/dist/shared/Rating/Ratings/LikeRating.js +21 -9
  55. package/dist/shared/Rating/Ratings/SatisfactionRating.js +27 -15
  56. package/dist/shared/Rating/Ratings/ScaleRating.js +49 -22
  57. package/dist/shared/RoundedButton/RoundedButton.js +24 -12
  58. package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +84 -39
  59. package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +286 -235
  60. package/dist/shared/RoundedSelect/RoundedSelect.js +152 -103
  61. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +160 -125
  62. package/dist/shared/RoundedTextField/RoundedTextField.js +137 -92
  63. package/dist/utils/CbrFunctions.js +30 -30
  64. package/package.json +1 -3
package/dist/Widget.js CHANGED
@@ -1,45 +1,61 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var _a;
1
13
  import { jsx as _jsx } from "react/jsx-runtime";
2
14
  import ReactDOM from 'react-dom';
3
15
  import App from './App';
4
- const WIDGET_ID = 'widget:eureka';
5
- const element = document.getElementById(WIDGET_ID);
6
- const props = {};
16
+ var WIDGET_ID = 'widget:eureka';
17
+ var element = document.getElementById(WIDGET_ID);
18
+ var props = {};
7
19
  if (element) {
8
- const url = element.getAttribute('data-formurl');
20
+ var url = element.getAttribute('data-formurl');
9
21
  if (url) {
10
- const splitUrl = url.split('/');
22
+ var splitUrl = url.split('/');
11
23
  if (splitUrl.length > 0) {
12
24
  props.apiKey = splitUrl[splitUrl.length - 1];
13
25
  }
14
- const domain = /:\/\/([^\/]+)/.exec(url)?.[1];
26
+ var domain = (_a = /:\/\/([^\/]+)/.exec(url)) === null || _a === void 0 ? void 0 : _a[1];
15
27
  if (domain) {
16
- const splitDomain = domain.split('.');
28
+ var splitDomain = domain.split('.');
17
29
  if (splitDomain.length > 0 && splitDomain[0] !== 'forms') {
18
30
  props.domain = splitDomain[0];
19
31
  }
20
32
  }
21
33
  }
22
- const formDataString = element.getAttribute('data-formdata');
34
+ var formDataString = element.getAttribute('data-formdata');
23
35
  if (formDataString) {
24
36
  props.formData = JSON.parse(formDataString);
25
37
  }
26
- const valuesString = element.getAttribute('data-values');
38
+ var valuesString = element.getAttribute('data-values');
27
39
  if (valuesString) {
28
40
  props.valuesData = JSON.parse(valuesString);
29
41
  }
30
- const internal = element.getAttribute('data-internal');
42
+ var internal = element.getAttribute('data-internal');
31
43
  if (internal) {
32
44
  props.internal = true;
33
45
  }
34
- const postview = element.getAttribute('data-postview');
46
+ var postview = element.getAttribute('data-postview');
35
47
  if (postview) {
36
48
  props.postview = true;
37
49
  }
38
- const preview = element.getAttribute('data-preview');
50
+ var preview = element.getAttribute('data-preview');
39
51
  if (preview) {
40
52
  props.preview = true;
41
53
  }
54
+ var partial = element.getAttribute('data-partial');
55
+ if (partial) {
56
+ props.partial = true;
57
+ }
42
58
  // eslint-disable-next-line no-console
43
59
  console.log(props);
44
60
  }
45
- ReactDOM.render(_jsx(App, { isWidget: true, ...props }), document.getElementById(WIDGET_ID));
61
+ ReactDOM.render(_jsx(App, __assign({ isWidget: true }, props)), document.getElementById(WIDGET_ID));
@@ -1,9 +1,9 @@
1
- export const getAcceptedExtensions = () => {
2
- let extensionString = extensions.reduce((acc, current) => acc + ',.' + current);
1
+ export var getAcceptedExtensions = function () {
2
+ var extensionString = extensions.reduce(function (acc, current) { return acc + ',.' + current; });
3
3
  extensionString = '.' + extensionString;
4
4
  return extensionString;
5
5
  };
6
- const extensions = [
6
+ var extensions = [
7
7
  'aif',
8
8
  'cda',
9
9
  'mid',
@@ -1,2 +1,2 @@
1
- const maxSize = 31457280;
1
+ var maxSize = 31457280;
2
2
  export default maxSize;
@@ -1,5 +1,5 @@
1
1
  import { FormStyleTypes } from './FormStepTypes';
2
- const InternalFormStyle = {
2
+ var InternalFormStyle = {
3
3
  type: FormStyleTypes.MATERIAL,
4
4
  backgroundColor: '#ffffff',
5
5
  stepBackgroundColor: '#ffffff',
@@ -1 +1 @@
1
- export const SEED = 'EF';
1
+ export var SEED = 'EF';
@@ -1,35 +1,92 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ 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;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
1
37
  import axios from 'axios';
2
38
  import axiosInstance from '../AxiosAPI';
3
39
  import widgetInstance from '../AxiosWidget';
4
- export async function getUploadUrls(files, domain) {
5
- const filesArray = files.map((file) => ({
6
- publicFile: false,
7
- extension: file.name.split('.').pop(),
8
- }));
9
- let response;
10
- if (domain) {
11
- response = await widgetInstance.post(`/uploadfile?idOrganization=${domain}`, filesArray);
12
- }
13
- else {
14
- response = await axiosInstance.post('/uploadfile', filesArray);
15
- }
16
- return response.data ?? undefined;
17
- }
18
- export async function postFile(file, postInfo) {
19
- const formData = new FormData();
20
- Object.keys(postInfo.postInfo.fields).forEach((key) => {
21
- formData.append(key, postInfo.postInfo.fields[key]);
40
+ export function getUploadUrls(files, domain) {
41
+ var _a;
42
+ return __awaiter(this, void 0, void 0, function () {
43
+ var filesArray, response;
44
+ return __generator(this, function (_b) {
45
+ switch (_b.label) {
46
+ case 0:
47
+ filesArray = files.map(function (file) { return ({
48
+ publicFile: false,
49
+ extension: file.name.split('.').pop(),
50
+ }); });
51
+ if (!domain) return [3 /*break*/, 2];
52
+ return [4 /*yield*/, widgetInstance.post("/uploadfile?idOrganization=".concat(domain), filesArray)];
53
+ case 1:
54
+ response = _b.sent();
55
+ return [3 /*break*/, 4];
56
+ case 2: return [4 /*yield*/, axiosInstance.post('/uploadfile', filesArray)];
57
+ case 3:
58
+ response = _b.sent();
59
+ _b.label = 4;
60
+ case 4: return [2 /*return*/, (_a = response.data) !== null && _a !== void 0 ? _a : undefined];
61
+ }
62
+ });
22
63
  });
23
- // Actual file has to be appended last.
24
- formData.append('file', file);
25
- await axios.post(postInfo.postInfo.url, formData, {
26
- timeout: 300000,
27
- headers: {
28
- 'Content-Type': 'multipart/form-data',
29
- },
64
+ }
65
+ export function postFile(file, postInfo) {
66
+ return __awaiter(this, void 0, void 0, function () {
67
+ var formData;
68
+ return __generator(this, function (_a) {
69
+ switch (_a.label) {
70
+ case 0:
71
+ formData = new FormData();
72
+ Object.keys(postInfo.postInfo.fields).forEach(function (key) {
73
+ formData.append(key, postInfo.postInfo.fields[key]);
74
+ });
75
+ // Actual file has to be appended last.
76
+ formData.append('file', file);
77
+ return [4 /*yield*/, axios.post(postInfo.postInfo.url, formData, {
78
+ timeout: 300000,
79
+ headers: {
80
+ 'Content-Type': 'multipart/form-data',
81
+ },
82
+ })];
83
+ case 1:
84
+ _a.sent();
85
+ return [2 /*return*/, {
86
+ fileName: file.name,
87
+ S3Key: postInfo.S3Key,
88
+ }];
89
+ }
90
+ });
30
91
  });
31
- return {
32
- fileName: file.name,
33
- S3Key: postInfo.S3Key,
34
- };
35
92
  }
package/dist/index.js CHANGED
@@ -1,10 +1,21 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import * as ReactDOM from 'react-dom';
3
14
  import App from './App';
4
15
  import styles from './index.module.css';
5
- const urlParams = new URLSearchParams(window.location.search);
6
- const values = urlParams.get('data-values');
7
- let dataValues = undefined;
16
+ var urlParams = new URLSearchParams(window.location.search);
17
+ var values = urlParams.get('data-values');
18
+ var dataValues = undefined;
8
19
  if (values) {
9
20
  try {
10
21
  dataValues = JSON.parse(decodeURIComponent(values));
@@ -15,4 +26,4 @@ if (values) {
15
26
  console.error('Invalid data-values JSON', error);
16
27
  }
17
28
  }
18
- ReactDOM.render(_jsx("div", { className: styles.eurekaForm, children: _jsx(App, { isWidget: false, apiKey: window.location.pathname.replace('/', ''), valuesData: dataValues }) }), document.getElementById('eureka-root'));
29
+ ReactDOM.render(_jsx("div", __assign({ className: styles.eurekaForm }, { children: _jsx(App, { isWidget: false, apiKey: window.location.pathname.replace('/', ''), valuesData: dataValues }) })), document.getElementById('eureka-root'));
@@ -1,14 +1,26 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import CircularProgress from '@material-ui/core/CircularProgress';
3
14
  import styles from './Loader.module.css';
4
15
  /**
5
16
  * Generic Loader Component with optional curtain.
6
17
  */
7
- function Loader({ color = '#3d5a7f', curtain = false, zIndex = 20, size = 40, position = 'absolute', }) {
8
- return (_jsx("div", { className: styles.loaderContainer + ' flexbox', style: {
18
+ function Loader(_a) {
19
+ var _b = _a.color, color = _b === void 0 ? '#3d5a7f' : _b, _c = _a.curtain, curtain = _c === void 0 ? false : _c, _d = _a.zIndex, zIndex = _d === void 0 ? 20 : _d, _e = _a.size, size = _e === void 0 ? 40 : _e, _f = _a.position, position = _f === void 0 ? 'absolute' : _f;
20
+ return (_jsx("div", __assign({ className: styles.loaderContainer + ' flexbox', style: {
9
21
  backgroundColor: curtain ? 'rgb(0, 0, 0, 0.4)' : '',
10
- zIndex,
11
- position,
12
- }, children: _jsx("div", { className: styles.loader, children: _jsx(CircularProgress, { size: size, style: { color } }) }) }));
22
+ zIndex: zIndex,
23
+ position: position,
24
+ } }, { children: _jsx("div", __assign({ className: styles.loader }, { children: _jsx(CircularProgress, { size: size, style: { color: color } }) })) })));
13
25
  }
14
26
  export default Loader;
@@ -1,6 +1,18 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import styles from './Navbar.module.css';
3
- function Navbar({ logo, color }) {
4
- return (_jsx("div", { className: styles.navContainer, style: { backgroundColor: color }, children: _jsx("img", { src: logo, alt: "Organization Logo", className: styles.navImage }) }));
14
+ function Navbar(_a) {
15
+ var logo = _a.logo, color = _a.color;
16
+ return (_jsx("div", __assign({ className: styles.navContainer, style: { backgroundColor: color } }, { children: _jsx("img", { src: logo, alt: "Organization Logo", className: styles.navImage }) })));
5
17
  }
6
18
  export default Navbar;
@@ -1,16 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
1
23
  import { jsx as _jsx } from "react/jsx-runtime";
2
24
  import LikeRating from './Ratings/LikeRating';
3
25
  import ScaleRating from './Ratings/ScaleRating';
4
26
  import SatisfactionRating from './Ratings/SatisfactionRating';
5
27
  import { RatingTypes } from '../../constants/FormStepTypes';
6
- function Rating({ type, ...others }) {
28
+ function Rating(_a) {
29
+ var type = _a.type, others = __rest(_a, ["type"]);
7
30
  switch (type) {
8
31
  case RatingTypes.LIKE:
9
- return _jsx(LikeRating, { ...others });
32
+ return _jsx(LikeRating, __assign({}, others));
10
33
  case RatingTypes.SATISFACTION:
11
- return _jsx(SatisfactionRating, { ...others });
34
+ return _jsx(SatisfactionRating, __assign({}, others));
12
35
  case RatingTypes.SCALE:
13
- return _jsx(ScaleRating, { ...others });
36
+ return _jsx(ScaleRating, __assign({}, others));
14
37
  default:
15
38
  return _jsx("div", {});
16
39
  }
@@ -1,31 +1,43 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import ThumbDownRoundedIcon from '@material-ui/icons/ThumbDownRounded';
3
14
  import ThumbUpRoundedIcon from '@material-ui/icons/ThumbUpRounded';
4
15
  import styles from '../Rating.module.css';
5
- function LikeRating({ disabled, inputRef, value, onChange, focusColor, unSelectedColor, }) {
6
- return (_jsxs("div", { className: styles.ratingContainer, style: {
16
+ function LikeRating(_a) {
17
+ var disabled = _a.disabled, inputRef = _a.inputRef, value = _a.value, onChange = _a.onChange, focusColor = _a.focusColor, unSelectedColor = _a.unSelectedColor;
18
+ return (_jsxs("div", __assign({ className: styles.ratingContainer, style: {
7
19
  '--eureka-primary': focusColor,
8
20
  '--eureka-outline': unSelectedColor,
9
- }, children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }), _jsx("div", { className: disabled
21
+ } }, { children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }), _jsx("div", __assign({ className: disabled
10
22
  ? styles.disabledLikeContainer
11
- : styles.likeContainer, onClick: () => {
23
+ : styles.likeContainer, onClick: function () {
12
24
  if (!disabled)
13
25
  onChange(value === 1 ? null : 1);
14
- }, children: _jsx(ThumbUpRoundedIcon, { fontSize: "inherit", style: value === 1
26
+ } }, { children: _jsx(ThumbUpRoundedIcon, { fontSize: "inherit", style: value === 1
15
27
  ? {
16
28
  color: focusColor,
17
29
  }
18
- : {} }) }), _jsx("div", { className: disabled
30
+ : {} }) })), _jsx("div", __assign({ className: disabled
19
31
  ? styles.disabledLikeContainer
20
- : styles.likeContainer, onClick: () => {
32
+ : styles.likeContainer, onClick: function () {
21
33
  if (!disabled)
22
34
  onChange(value === 0 ? null : 0);
23
- }, children: _jsx(ThumbDownRoundedIcon, { fontSize: "inherit", style: value === 0
35
+ } }, { children: _jsx(ThumbDownRoundedIcon, { fontSize: "inherit", style: value === 0
24
36
  ? {
25
37
  color: focusColor,
26
38
  marginTop: 14,
27
39
  marginLeft: 15,
28
40
  }
29
- : { marginTop: 14, marginLeft: 15 } }) })] }));
41
+ : { marginTop: 14, marginLeft: 15 } }) }))] })));
30
42
  }
31
43
  export default LikeRating;
@@ -1,49 +1,61 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import styles from '../Rating.module.css';
3
14
  import SentimentVeryDissatisfiedIcon from '@material-ui/icons/SentimentVeryDissatisfied';
4
15
  import SentimentDissatisfiedIcon from '@material-ui/icons/SentimentDissatisfied';
5
16
  import SentimentSatisfiedAltIcon from '@material-ui/icons/SentimentSatisfiedAltOutlined';
6
17
  import SentimentVerySatisfiedIcon from '@material-ui/icons/SentimentVerySatisfied';
7
- function SatisfactionRating({ value, inputRef, disabled, onChange, focusColor, unSelectedColor, }) {
8
- return (_jsxs("div", { className: styles.ratingContainer, style: {
18
+ function SatisfactionRating(_a) {
19
+ var value = _a.value, inputRef = _a.inputRef, disabled = _a.disabled, onChange = _a.onChange, focusColor = _a.focusColor, unSelectedColor = _a.unSelectedColor;
20
+ return (_jsxs("div", __assign({ className: styles.ratingContainer, style: {
9
21
  '--eureka-primary': focusColor,
10
22
  '--eureka-outline': unSelectedColor,
11
- }, children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }), _jsx("div", { className: disabled
23
+ } }, { children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }), _jsx("div", __assign({ className: disabled
12
24
  ? styles.disabledSentimentContainer
13
- : styles.sentimentContainer, onClick: () => {
25
+ : styles.sentimentContainer, onClick: function () {
14
26
  if (!disabled)
15
27
  onChange(value === 1 ? null : 1);
16
- }, children: _jsx(SentimentVeryDissatisfiedIcon, { fontSize: "inherit", style: value === 1
28
+ } }, { children: _jsx(SentimentVeryDissatisfiedIcon, { fontSize: "inherit", style: value === 1
17
29
  ? {
18
30
  color: focusColor,
19
31
  }
20
- : {} }) }), _jsx("div", { className: disabled
32
+ : {} }) })), _jsx("div", __assign({ className: disabled
21
33
  ? styles.disabledSentimentContainer
22
- : styles.sentimentContainer, onClick: () => {
34
+ : styles.sentimentContainer, onClick: function () {
23
35
  if (!disabled)
24
36
  onChange(value === 2 ? null : 2);
25
- }, children: _jsx(SentimentDissatisfiedIcon, { fontSize: "inherit", style: value === 2
37
+ } }, { children: _jsx(SentimentDissatisfiedIcon, { fontSize: "inherit", style: value === 2
26
38
  ? {
27
39
  color: focusColor,
28
40
  }
29
- : {} }) }), _jsx("div", { className: disabled
41
+ : {} }) })), _jsx("div", __assign({ className: disabled
30
42
  ? styles.disabledSentimentContainer
31
- : styles.sentimentContainer, onClick: () => {
43
+ : styles.sentimentContainer, onClick: function () {
32
44
  if (!disabled)
33
45
  onChange(value === 3 ? null : 3);
34
- }, children: _jsx(SentimentSatisfiedAltIcon, { fontSize: "inherit", style: value === 3
46
+ } }, { children: _jsx(SentimentSatisfiedAltIcon, { fontSize: "inherit", style: value === 3
35
47
  ? {
36
48
  color: focusColor,
37
49
  }
38
- : {} }) }), _jsx("div", { className: disabled
50
+ : {} }) })), _jsx("div", __assign({ className: disabled
39
51
  ? styles.disabledSentimentContainer
40
- : styles.sentimentContainer, onClick: () => {
52
+ : styles.sentimentContainer, onClick: function () {
41
53
  if (!disabled)
42
54
  onChange(value === 4 ? null : 4);
43
- }, children: _jsx(SentimentVerySatisfiedIcon, { fontSize: "inherit", style: value === 4
55
+ } }, { children: _jsx(SentimentVerySatisfiedIcon, { fontSize: "inherit", style: value === 4
44
56
  ? {
45
57
  color: focusColor,
46
58
  }
47
- : {} }) })] }));
59
+ : {} }) }))] })));
48
60
  }
49
61
  export default SatisfactionRating;
@@ -1,36 +1,63 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
1
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
24
  import styles from '../Rating.module.css';
3
25
  import { Rating } from '@material-ui/lab';
4
26
  import GradeRoundedIcon from '@material-ui/icons/GradeRounded';
5
27
  import { makeStyles } from '@material-ui/core';
6
28
  import React from 'react';
7
- const useRatingStyles = (props) => makeStyles({
8
- root: {
9
- '&.Mui-disabled': {
10
- opacity: 1,
29
+ var useRatingStyles = function (props) {
30
+ return makeStyles({
31
+ root: {
32
+ '&.Mui-disabled': {
33
+ opacity: 1,
34
+ },
35
+ '& .EF-MuiRating-iconFilled': {
36
+ color: props.focusColor,
37
+ },
38
+ '& .EF-MuiRating-iconEmpty': {
39
+ color: props.unSelectedColor,
40
+ },
11
41
  },
12
- '& .EF-MuiRating-iconFilled': {
13
- color: props.focusColor,
14
- },
15
- '& .EF-MuiRating-iconEmpty': {
16
- color: props.unSelectedColor,
17
- },
18
- },
19
- });
20
- function ScaleRating({ value, name, inputRef, disabled, onChange, isMobile, focusColor, unSelectedColor, }) {
21
- const ratingClasses = useRatingStyles({
22
- unSelectedColor,
23
- focusColor,
42
+ });
43
+ };
44
+ function ScaleRating(_a) {
45
+ var value = _a.value, name = _a.name, inputRef = _a.inputRef, disabled = _a.disabled, onChange = _a.onChange, isMobile = _a.isMobile, focusColor = _a.focusColor, unSelectedColor = _a.unSelectedColor;
46
+ var ratingClasses = useRatingStyles({
47
+ unSelectedColor: unSelectedColor,
48
+ focusColor: focusColor,
24
49
  })();
25
- return (_jsxs(React.Fragment, { children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }), _jsx(Rating, { value: value, onChange: (_event, newValue) => {
50
+ return (_jsxs(React.Fragment, { children: [_jsx("input", { ref: inputRef, className: styles.hiddenInput }), _jsx(Rating, { value: value, onChange: function (_event, newValue) {
26
51
  if (!disabled)
27
52
  onChange(newValue);
28
- }, disabled: disabled, classes: ratingClasses, name: name, size: "large", defaultValue: 0, getLabelText: (value) => value + '/5', max: 5, IconContainerComponent: isMobile ? SmallIconContainer : IconContainer })] }));
53
+ }, disabled: disabled, classes: ratingClasses, name: name, size: "large", defaultValue: 0, getLabelText: function (value) { return value + '/5'; }, max: 5, IconContainerComponent: isMobile ? SmallIconContainer : IconContainer })] }));
29
54
  }
30
- function IconContainer({ value, ...other }) {
31
- return (_jsx("span", { className: 'icon' + value, ...other, children: _jsx(GradeRoundedIcon, { style: { fontSize: 60 } }) }));
55
+ function IconContainer(_a) {
56
+ var value = _a.value, other = __rest(_a, ["value"]);
57
+ return (_jsx("span", __assign({ className: 'icon' + value }, other, { children: _jsx(GradeRoundedIcon, { style: { fontSize: 60 } }) })));
32
58
  }
33
- function SmallIconContainer({ value, ...other }) {
34
- return (_jsx("span", { className: 'icon' + value, ...other, children: _jsx(GradeRoundedIcon, { style: { fontSize: 50 } }) }));
59
+ function SmallIconContainer(_a) {
60
+ var value = _a.value, other = __rest(_a, ["value"]);
61
+ return (_jsx("span", __assign({ className: 'icon' + value }, other, { children: _jsx(GradeRoundedIcon, { style: { fontSize: 50 } }) })));
35
62
  }
36
63
  export default ScaleRating;
@@ -1,33 +1,45 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import { Button, withStyles } from '@material-ui/core';
3
14
  /**
4
15
  * Generic rounded button
5
16
  */
6
- function RoundedButton({ text, backgroundColor = '#3d5a7f', color = '#ffffff', onClick, disabled, fontSize = '1rem', padding = '0 13px 0 13px', borderRadius = 10, height = 28, bold = false, width = 'fit-content', }) {
7
- const CustomButton = withStyles({
17
+ function RoundedButton(_a) {
18
+ var text = _a.text, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.color, color = _c === void 0 ? '#ffffff' : _c, onClick = _a.onClick, disabled = _a.disabled, _d = _a.fontSize, fontSize = _d === void 0 ? '1rem' : _d, _e = _a.padding, padding = _e === void 0 ? '0 13px 0 13px' : _e, _f = _a.borderRadius, borderRadius = _f === void 0 ? 10 : _f, _g = _a.height, height = _g === void 0 ? 28 : _g, _h = _a.bold, bold = _h === void 0 ? false : _h, _j = _a.width, width = _j === void 0 ? 'fit-content' : _j;
19
+ var CustomButton = withStyles({
8
20
  root: {
9
- width,
21
+ width: width,
10
22
  textTransform: 'none',
11
23
  fontFamily: 'inherit',
12
- fontSize,
13
- borderRadius,
14
- padding,
24
+ fontSize: fontSize,
25
+ borderRadius: borderRadius,
26
+ padding: padding,
15
27
  height: height,
16
28
  boxShadow: 'none',
17
- backgroundColor,
18
- color,
29
+ backgroundColor: backgroundColor,
30
+ color: color,
19
31
  '&:hover': {
20
32
  boxShadow: 'none',
21
- backgroundColor,
33
+ backgroundColor: backgroundColor,
22
34
  },
23
35
  '&:disabled': {
24
- backgroundColor,
25
- color,
36
+ backgroundColor: backgroundColor,
37
+ color: color,
26
38
  opacity: 0.5,
27
39
  },
28
40
  fontWeight: bold ? 'bold' : 'normal',
29
41
  },
30
42
  })(Button);
31
- return (_jsx(CustomButton, { variant: "contained", onMouseDown: onClick, disabled: disabled, children: text }));
43
+ return (_jsx(CustomButton, __assign({ variant: "contained", onMouseDown: onClick, disabled: disabled }, { children: text })));
32
44
  }
33
45
  export default RoundedButton;