@banch0u/core-project-test-repository 1.8.4 → 1.9.1

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 (83) hide show
  1. package/dist/assets/css/antd.css +723 -0
  2. package/dist/assets/icons/index.js +182 -0
  3. package/dist/components/Button/index.module.scss +17 -5
  4. package/dist/components/ColSort/index.module.scss +22 -0
  5. package/dist/components/Delete/Delete.js +22 -0
  6. package/dist/components/Delete/Delete.module.scss +22 -0
  7. package/dist/components/DeleteModal/DeleteModal.js +31 -0
  8. package/dist/components/DeleteModal/DeleteModal.module.scss +11 -0
  9. package/dist/components/Filter/index.js +1 -1
  10. package/dist/components/Input/index.js +34 -6
  11. package/dist/components/Input/index.module.scss +55 -23
  12. package/dist/components/ProfileOptions/index.module.scss +3 -3
  13. package/dist/components/Select/index.js +47 -60
  14. package/dist/components/Select/index.module.scss +32 -0
  15. package/dist/components/Success/Success.js +19 -0
  16. package/dist/components/Success/Success.module.scss +26 -0
  17. package/dist/components/Table/index.js +4 -2
  18. package/dist/components/ViewModal/index.js +30 -0
  19. package/dist/helpers/paginationLength.js +3 -0
  20. package/dist/helpers/querySearch.js +22 -0
  21. package/dist/index.js +2 -0
  22. package/dist/layout/Header/AppSelect/index.js +28 -9
  23. package/dist/layout/Header/AppSelect/index.module.scss +6 -1
  24. package/dist/layout/Portal/index.js +23 -0
  25. package/dist/layout/QuestionnairesLayout/index.js +17 -0
  26. package/dist/layout/QuestionnairesLayout/index.module.scss +0 -0
  27. package/dist/layout/QuestionnairesSidebar/index.js +162 -0
  28. package/dist/layout/QuestionnairesSidebar/index.module.scss +76 -0
  29. package/dist/pages/Questionnnaires/Questionnaires.module.scss +194 -0
  30. package/dist/pages/Questionnnaires/QuestionnairesApplicationFormContent/constant.js +58 -0
  31. package/dist/pages/Questionnnaires/QuestionnairesApplicationFormContent/index.js +255 -0
  32. package/dist/pages/Questionnnaires/QuestionnairesBrandsContent/constant.js +58 -0
  33. package/dist/pages/Questionnnaires/QuestionnairesBrandsContent/index.js +247 -0
  34. package/dist/pages/Questionnnaires/QuestionnairesChassisTypesContent/constant.js +58 -0
  35. package/dist/pages/Questionnnaires/QuestionnairesChassisTypesContent/index.js +247 -0
  36. package/dist/pages/Questionnnaires/QuestionnairesColorsContent/constant.js +58 -0
  37. package/dist/pages/Questionnnaires/QuestionnairesColorsContent/index.js +247 -0
  38. package/dist/pages/Questionnnaires/QuestionnairesCountriesContent/constant.js +58 -0
  39. package/dist/pages/Questionnnaires/QuestionnairesCountriesContent/index.js +247 -0
  40. package/dist/pages/Questionnnaires/QuestionnairesDeliveryMethodContent/constant.js +58 -0
  41. package/dist/pages/Questionnnaires/QuestionnairesDeliveryMethodContent/index.js +247 -0
  42. package/dist/pages/Questionnnaires/QuestionnairesDocumentRecieveMethodsContent/constant.js +58 -0
  43. package/dist/pages/Questionnnaires/QuestionnairesDocumentRecieveMethodsContent/index.js +258 -0
  44. package/dist/pages/Questionnnaires/QuestionnairesDocumentTypeContent/constant.js +58 -0
  45. package/dist/pages/Questionnnaires/QuestionnairesDocumentTypeContent/index.js +284 -0
  46. package/dist/pages/Questionnnaires/QuestionnairesDocumentWhomContent/constant.js +82 -0
  47. package/dist/pages/Questionnnaires/QuestionnairesDocumentWhomContent/index.js +331 -0
  48. package/dist/pages/Questionnnaires/QuestionnairesEngineTypesContent/constant.js +58 -0
  49. package/dist/pages/Questionnnaires/QuestionnairesEngineTypesContent/index.js +247 -0
  50. package/dist/pages/Questionnnaires/QuestionnairesExecutionRulesContent/constant.js +58 -0
  51. package/dist/pages/Questionnnaires/QuestionnairesExecutionRulesContent/index.js +258 -0
  52. package/dist/pages/Questionnnaires/QuestionnairesGearboxTypesContent/constant.js +58 -0
  53. package/dist/pages/Questionnnaires/QuestionnairesGearboxTypesContent/index.js +247 -0
  54. package/dist/pages/Questionnnaires/QuestionnairesIssuedAuthoritiesContent/constant.js +58 -0
  55. package/dist/pages/Questionnnaires/QuestionnairesIssuedAuthoritiesContent/index.js +247 -0
  56. package/dist/pages/Questionnnaires/QuestionnairesMarginNoteTextsContent/constant.js +58 -0
  57. package/dist/pages/Questionnnaires/QuestionnairesMarginNoteTextsContent/index.js +249 -0
  58. package/dist/pages/Questionnnaires/QuestionnairesModelsContent/constant.js +58 -0
  59. package/dist/pages/Questionnnaires/QuestionnairesModelsContent/index.js +290 -0
  60. package/dist/pages/Questionnnaires/QuestionnairesOrganizationsContent/constant.js +88 -0
  61. package/dist/pages/Questionnnaires/QuestionnairesOrganizationsContent/index.js +320 -0
  62. package/dist/pages/Questionnnaires/QuestionnairesOwnershipTypesContent/constant.js +58 -0
  63. package/dist/pages/Questionnnaires/QuestionnairesOwnershipTypesContent/index.js +247 -0
  64. package/dist/pages/Questionnnaires/QuestionnairesStreetsContent/constant.js +58 -0
  65. package/dist/pages/Questionnnaires/QuestionnairesStreetsContent/index.js +240 -0
  66. package/dist/pages/Questionnnaires/QuestionnairesStructuresContent/constant.js +58 -0
  67. package/dist/pages/Questionnnaires/QuestionnairesStructuresContent/index.js +247 -0
  68. package/dist/pages/Questionnnaires/QuestionnairesSubtopicContent/constant.js +58 -0
  69. package/dist/pages/Questionnnaires/QuestionnairesSubtopicContent/index.js +317 -0
  70. package/dist/pages/Questionnnaires/QuestionnairesTopicContent/constant.js +58 -0
  71. package/dist/pages/Questionnnaires/QuestionnairesTopicContent/index.js +271 -0
  72. package/dist/pages/Questionnnaires/QuestionnairesTransmitterTypesContent/constant.js +58 -0
  73. package/dist/pages/Questionnnaires/QuestionnairesTransmitterTypesContent/index.js +247 -0
  74. package/dist/pages/Questionnnaires/QuestionnairesVehicleTypesContent/constant.js +58 -0
  75. package/dist/pages/Questionnnaires/QuestionnairesVehicleTypesContent/index.js +247 -0
  76. package/dist/pages/Questionnnaires/index.js +5 -0
  77. package/dist/routes/QuestionnaireRoutes.js +178 -0
  78. package/dist/store/slices/global/index.js +174 -3
  79. package/dist/store/slices/questionnaire/index.js +5139 -0
  80. package/dist/store/slices/questionnaire/service.js +3030 -0
  81. package/dist/store/store.js +2 -1
  82. package/dist/utils/path.js +49 -1
  83. package/package.json +2 -1
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from "react";
2
3
  import style from "./index.module.scss";
3
4
  import { Select as AntdSelect, Divider } from "antd";
@@ -21,76 +22,62 @@ var Select = function Select(_ref) {
21
22
  _ref$allowClear = _ref.allowClear,
22
23
  allowClear = _ref$allowClear === void 0 ? true : _ref$allowClear,
23
24
  width = _ref.width;
24
- return /*#__PURE__*/React.createElement(React.Fragment, null, mode === "multiple" ? /*#__PURE__*/React.createElement(AntdSelect, {
25
- className: className ? className : size === "sm" ? style.select_sm : style.select,
26
- style: {
27
- width: width ? width + "px" : "100%"
28
- },
29
- showSearch: true,
30
- allowClear: true,
31
- placeholder: placeholder,
32
- optionFilterProp: "children",
33
- onChange: onChange,
34
- disabled: disabled,
35
- value: value,
36
- defaultValue: defaultValue,
37
- mode: "multiple",
38
- optionLabelProp: "label"
39
- }, children) : mode === "divider" ? /*#__PURE__*/React.createElement(AntdSelect, {
40
- className: className ? className : size === "sm" ? style.select_sm : style.select,
41
- style: {
42
- width: width ? width + "px" : "100%"
43
- },
44
- showSearch: true,
45
- allowClear: true,
46
- placeholder: placeholder,
47
- optionFilterProp: "children",
48
- filterOption: function filterOption(input, option) {
49
- if (!(option !== null && option !== void 0 && option.children) || typeof option.children !== "string") return false;
50
- var normalizeAz = function normalizeAz(str) {
51
- return str.replace(/I/g, "i").toLocaleLowerCase("az").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ç/g, "c").replace(/ş/g, "s").replace(/ğ/g, "g").replace(/ü/g, "u").replace(/ö/g, "o").replace(/ə/g, "e");
52
- };
53
- var normalizedInput = normalizeAz(input);
54
- var normalizedOption = normalizeAz(option.children);
55
- return normalizedOption.includes(normalizedInput);
56
- },
57
- onChange: onChange,
58
- disabled: disabled,
59
- value: value,
60
- defaultValue: defaultValue,
61
- dropdownRender: function dropdownRender(menu) {
62
- return /*#__PURE__*/React.createElement("div", null, menu, /*#__PURE__*/React.createElement(Divider, {
63
- style: {
64
- margin: "4px 0"
65
- }
66
- }), /*#__PURE__*/React.createElement("div", {
67
- className: style.select_add_button
68
- }, /*#__PURE__*/React.createElement(Button, {
69
- onClick: onOpen
70
- }, text)));
25
+ var getClassName = function getClassName() {
26
+ if (className) return className;
27
+ switch (size) {
28
+ case "sm":
29
+ return style.select_sm;
30
+ case "md":
31
+ return style.select_md;
32
+ default:
33
+ return style.select;
71
34
  }
72
- }, children) : /*#__PURE__*/React.createElement(AntdSelect, {
73
- className: className ? className : size === "sm" ? style.select_sm : style.select,
35
+ };
36
+ var commonProps = {
37
+ className: getClassName(),
74
38
  style: {
75
- width: width ? width + "px" : "100%"
39
+ width: width ? "".concat(width, "px") : "100%"
76
40
  },
77
41
  showSearch: true,
78
42
  allowClear: allowClear,
79
43
  placeholder: placeholder,
80
44
  optionFilterProp: "children",
81
- filterOption: function filterOption(input, option) {
82
- if (!(option !== null && option !== void 0 && option.children) || typeof option.children !== "string") return false;
83
- var normalizeAz = function normalizeAz(str) {
84
- return str.replace(/I/g, "i").toLocaleLowerCase("az").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ç/g, "c").replace(/ş/g, "s").replace(/ğ/g, "g").replace(/ü/g, "u").replace(/ö/g, "o").replace(/ə/g, "e");
85
- };
86
- var normalizedInput = normalizeAz(input);
87
- var normalizedOption = normalizeAz(option.children);
88
- return normalizedOption.includes(normalizedInput);
89
- },
90
45
  onChange: onChange,
91
46
  disabled: disabled,
92
47
  value: value,
93
48
  defaultValue: defaultValue
94
- }, children));
49
+ };
50
+ var normalizeAz = function normalizeAz(str) {
51
+ return str.replace(/I/g, "i").toLocaleLowerCase("az").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ç/g, "c").replace(/ş/g, "s").replace(/ğ/g, "g").replace(/ü/g, "u").replace(/ö/g, "o").replace(/ə/g, "e");
52
+ };
53
+ var filterOption = function filterOption(input, option) {
54
+ if (!(option !== null && option !== void 0 && option.children) || typeof option.children !== "string") return false;
55
+ return normalizeAz(option.children).includes(normalizeAz(input));
56
+ };
57
+ if (mode === "multiple") {
58
+ return /*#__PURE__*/React.createElement(AntdSelect, _extends({}, commonProps, {
59
+ mode: "multiple",
60
+ optionLabelProp: "label"
61
+ }), children);
62
+ }
63
+ if (mode === "divider") {
64
+ return /*#__PURE__*/React.createElement(AntdSelect, _extends({}, commonProps, {
65
+ filterOption: filterOption,
66
+ dropdownRender: function dropdownRender(menu) {
67
+ return /*#__PURE__*/React.createElement("div", null, menu, /*#__PURE__*/React.createElement(Divider, {
68
+ style: {
69
+ margin: "4px 0"
70
+ }
71
+ }), /*#__PURE__*/React.createElement("div", {
72
+ className: style.select_add_button
73
+ }, /*#__PURE__*/React.createElement(Button, {
74
+ onClick: onOpen
75
+ }, text)));
76
+ }
77
+ }), children);
78
+ }
79
+ return /*#__PURE__*/React.createElement(AntdSelect, _extends({}, commonProps, {
80
+ filterOption: filterOption
81
+ }), children);
95
82
  };
96
83
  export default Select;
@@ -14,6 +14,22 @@
14
14
  text-align: left !important;
15
15
  }
16
16
  }
17
+ .select_xs > div {
18
+ padding: 5px 16px !important;
19
+ border-radius: 6px !important;
20
+ height: 26px;
21
+ }
22
+ .select_xs {
23
+ width: 100%;
24
+ height: auto;
25
+ height: 26px;
26
+ span {
27
+ font-size: 16px !important;
28
+ font-weight: 500 !important;
29
+ line-height: 24px !important;
30
+ text-align: left !important;
31
+ }
32
+ }
17
33
 
18
34
  .select_sm > div {
19
35
  padding: 5px 16px !important;
@@ -31,6 +47,22 @@
31
47
  text-align: left !important;
32
48
  }
33
49
  }
50
+ .select_md > div {
51
+ padding: 5px 16px !important;
52
+ border-radius: 6px !important;
53
+ height: 42px;
54
+ }
55
+ .select_md {
56
+ width: 100%;
57
+ height: auto;
58
+ height: 42px;
59
+ span {
60
+ font-size: 16px !important;
61
+ font-weight: 500 !important;
62
+ line-height: 24px !important;
63
+ text-align: left !important;
64
+ }
65
+ }
34
66
  .select_add_button {
35
67
  display: inline-flex;
36
68
  flex-wrap: nowrap;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import style from "./Success.module.scss";
3
+ import { OkIcon } from "../../assets/icons";
4
+ import Button from "../Button";
5
+ var Success = function Success(_ref) {
6
+ var value = _ref.value,
7
+ customValue = _ref.customValue,
8
+ onClick = _ref.onClick;
9
+ return /*#__PURE__*/React.createElement("div", {
10
+ className: style.container
11
+ }, /*#__PURE__*/React.createElement("figure", null, /*#__PURE__*/React.createElement(OkIcon, null)), value ? /*#__PURE__*/React.createElement("h3", {
12
+ className: style.value
13
+ }, value, " u\u011Furla \u0259lav\u0259 edildi") : /*#__PURE__*/React.createElement("h3", {
14
+ className: style.value
15
+ }, customValue), /*#__PURE__*/React.createElement(Button, {
16
+ onClick: onClick
17
+ }, "\u018Fsas s\u0259hif\u0259y\u0259 geri qay\u0131t"));
18
+ };
19
+ export default Success;
@@ -0,0 +1,26 @@
1
+ .container {
2
+ display: flex;
3
+ align-items: center;
4
+ flex-direction: column;
5
+ justify-content: center;
6
+ padding: 53px;
7
+ padding-top: 120px;
8
+ button {
9
+ padding: 9px 19px;
10
+ font-family: Inter;
11
+ font-size: 18px;
12
+ font-weight: 400;
13
+ line-height: 27px;
14
+ }
15
+ }
16
+
17
+ .value {
18
+ margin-top: 18px;
19
+ font-family: Inter;
20
+ font-size: 20px;
21
+ font-weight: 500;
22
+ line-height: 30px;
23
+ text-align: left;
24
+ color: #0b0b0b;
25
+ margin-bottom: 53px;
26
+ }
@@ -15,7 +15,9 @@ var Table = function Table(_ref) {
15
15
  dataSource = _ref.dataSource,
16
16
  selectedColumns = _ref.selectedColumns,
17
17
  innerW = _ref.innerW,
18
- disableDrag = _ref.disableDrag;
18
+ disableDrag = _ref.disableDrag,
19
+ _ref$big = _ref.big,
20
+ big = _ref$big === void 0 ? false : _ref$big;
19
21
  var getSavedOrder = function getSavedOrder(id) {
20
22
  var savedOrder = Cookies.get("columnOrder_".concat(id));
21
23
  return savedOrder ? savedOrder.split(",") : null;
@@ -197,7 +199,7 @@ var Table = function Table(_ref) {
197
199
  components: components,
198
200
  scroll: {
199
201
  x: innerW * (Array.isArray(selectedColumns) ? selectedColumns.length - 1 : 0),
200
- y: "calc(88vh - ".concat(window.innerWidth > 1537 ? "260px" : "280px", ")")
202
+ y: "calc(88vh - ".concat(window.innerWidth > 1537 ? big === true ? "180px" : "260px" : big === true ? "200px" : "280px", ")")
201
203
  }
202
204
  }));
203
205
  };
@@ -0,0 +1,30 @@
1
+ import { Modal } from "antd";
2
+ import React from "react";
3
+ import { useSelector } from "react-redux";
4
+ var ViewModal = function ViewModal(_ref) {
5
+ var children = _ref.children,
6
+ width = _ref.width,
7
+ onCancel = _ref.onCancel,
8
+ isEditing = _ref.isEditing;
9
+ var _useSelector = useSelector(function (state) {
10
+ return state.global;
11
+ }),
12
+ viewModalVisible = _useSelector.viewModalVisible;
13
+ return /*#__PURE__*/React.createElement(Modal, {
14
+ centered: true,
15
+ okButtonProps: {
16
+ style: {
17
+ display: "none"
18
+ }
19
+ },
20
+ cancelButtonProps: {
21
+ style: {
22
+ display: "none"
23
+ }
24
+ },
25
+ width: width,
26
+ open: viewModalVisible,
27
+ onCancel: onCancel
28
+ }, children);
29
+ };
30
+ export default ViewModal;
@@ -0,0 +1,3 @@
1
+ export var setPaginationLength = function setPaginationLength(count, size) {
2
+ return Math.ceil(Number(count) / (Number(size) || 1)) + "0";
3
+ };
@@ -0,0 +1,22 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ export var queryString = function queryString(data) {
3
+ var query = Object.entries(data).map(function (_ref) {
4
+ var _ref2 = _slicedToArray(_ref, 2),
5
+ key = _ref2[0],
6
+ value = _ref2[1];
7
+ if (value === undefined || value === null || value === "") {
8
+ return null; // Ignore undefined, null, or empty values
9
+ }
10
+
11
+ // Check if value is a string representing an array, e.g., "[0,19]"
12
+ if (typeof value === "string" && value.startsWith("[") && value.endsWith("]")) {
13
+ value = value.slice(1, -1); // Remove the brackets without encoding
14
+ return "".concat(key, "=").concat(value); // Skip encoding for this case
15
+ }
16
+
17
+ // Default case: encode the key and value
18
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
19
+ }).filter(Boolean) // Filter out any null values
20
+ .join("&");
21
+ return query ? "".concat(query) : "";
22
+ };
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ export { default as Select } from "./components/Select";
15
15
  export { default as Input } from "./components/Input";
16
16
  export { default as api } from "./utils/axios";
17
17
  export { default as NotFound } from "./pages/NotFound";
18
+ export { questionnairesRoutes } from "./routes/QuestionnaireRoutes";
19
+ export { CoreProvider } from "./store/coreProvider";
18
20
  import LoginPage from "./pages/Login";
19
21
  import PlatformPage from "./pages/Platform";
20
22
  import HeaderLayout from "./layout/Header";
@@ -6,6 +6,7 @@ import { Collapse } from "antd";
6
6
  import { RightOutlined } from "@ant-design/icons";
7
7
  import style from "./index.module.scss";
8
8
  import { entryData } from "../../../pages/Platform/constant";
9
+ import Portal from "../../Portal";
9
10
  var Panel = Collapse.Panel;
10
11
  var AppSelect = function AppSelect() {
11
12
  var location = useLocation();
@@ -14,11 +15,15 @@ var AppSelect = function AppSelect() {
14
15
  }),
15
16
  scopesData = _useSelector.scopesData;
16
17
  var accordionRef = useRef(null);
18
+ var dropdownRef = useRef(null);
17
19
  var _useState = useState([]),
18
20
  _useState2 = _slicedToArray(_useState, 2),
19
21
  activeKey = _useState2[0],
20
- setActiveKey = _useState2[1]; // manage open/close state
21
-
22
+ setActiveKey = _useState2[1];
23
+ var _useState3 = useState({}),
24
+ _useState4 = _slicedToArray(_useState3, 2),
25
+ dropdownStyle = _useState4[0],
26
+ setDropdownStyle = _useState4[1];
22
27
  var filteredOptions = useMemo(function () {
23
28
  return entryData.filter(function (item) {
24
29
  return item.scopes === "account" || scopesData === "*" || (scopesData === null || scopesData === void 0 ? void 0 : scopesData.includes(item.scopes));
@@ -32,12 +37,11 @@ var AppSelect = function AppSelect() {
32
37
  return opt.pathname.includes("/".concat(baseSegment));
33
38
  }) || filteredOptions[0];
34
39
  }, [filteredOptions, baseSegment]);
35
-
36
- // ✨ Outside click listener
37
40
  useEffect(function () {
38
41
  var handleClickOutside = function handleClickOutside(e) {
39
- if (accordionRef.current && !accordionRef.current.contains(e.target)) {
40
- setActiveKey([]); // collapse if clicked outside
42
+ var _dropdownRef$current;
43
+ if (accordionRef.current && !accordionRef.current.contains(e.target) && !((_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(e.target))) {
44
+ setActiveKey([]);
41
45
  }
42
46
  };
43
47
  document.addEventListener("mousedown", handleClickOutside);
@@ -45,6 +49,18 @@ var AppSelect = function AppSelect() {
45
49
  return document.removeEventListener("mousedown", handleClickOutside);
46
50
  };
47
51
  }, []);
52
+ useEffect(function () {
53
+ if (activeKey.length > 0 && accordionRef.current) {
54
+ var rect = accordionRef.current.getBoundingClientRect();
55
+ setDropdownStyle({
56
+ position: "absolute",
57
+ top: rect.bottom + window.scrollY + 4,
58
+ left: rect.left + window.scrollX,
59
+ width: rect.width,
60
+ zIndex: 9999
61
+ });
62
+ }
63
+ }, [activeKey]);
48
64
  return /*#__PURE__*/React.createElement("div", {
49
65
  ref: accordionRef
50
66
  }, /*#__PURE__*/React.createElement(Collapse, {
@@ -73,8 +89,11 @@ var AppSelect = function AppSelect() {
73
89
  className: style.accordionHeader
74
90
  }, /*#__PURE__*/React.createElement("div", null, active === null || active === void 0 ? void 0 : active.icon), /*#__PURE__*/React.createElement("span", null, active === null || active === void 0 ? void 0 : active.value)),
75
91
  key: "1"
76
- }, /*#__PURE__*/React.createElement("div", {
77
- className: style.accordionBody
92
+ })), activeKey.length > 0 && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
93
+ "data-no-invert": true,
94
+ ref: dropdownRef,
95
+ className: style.accordionBody,
96
+ style: dropdownStyle
78
97
  }, filteredOptions.filter(function (opt) {
79
98
  return opt.pathname !== (active === null || active === void 0 ? void 0 : active.pathname);
80
99
  }).map(function (option) {
@@ -83,6 +102,6 @@ var AppSelect = function AppSelect() {
83
102
  href: option.pathname,
84
103
  className: style.accordionOption
85
104
  }, option.icon, /*#__PURE__*/React.createElement("span", null, option.value));
86
- })))));
105
+ }))));
87
106
  };
88
107
  export default AppSelect;
@@ -1,6 +1,6 @@
1
1
  .accordion {
2
2
  background: var(--blue);
3
- width: 250px;
3
+ width: 270px;
4
4
  }
5
5
 
6
6
  .accordionHeader {
@@ -27,6 +27,11 @@
27
27
  display: flex;
28
28
  flex-direction: column;
29
29
  gap: 8px;
30
+ background-color: var(--blue);
31
+ padding: 10px;
32
+ top: 81px !important;
33
+ width: 250px !important;
34
+ border-radius: 0 0 6px 6px;
30
35
  }
31
36
 
32
37
  .accordionOption {
@@ -0,0 +1,23 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ // src/components/Portal.js
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { createPortal } from "react-dom";
5
+ var Portal = function Portal(_ref) {
6
+ var children = _ref.children;
7
+ var elRef = useRef(null);
8
+ var _useState = useState(false),
9
+ _useState2 = _slicedToArray(_useState, 2),
10
+ mounted = _useState2[0],
11
+ setMounted = _useState2[1];
12
+ useEffect(function () {
13
+ var el = document.createElement("div");
14
+ elRef.current = el;
15
+ document.body.appendChild(el);
16
+ setMounted(true);
17
+ return function () {
18
+ document.body.removeChild(el);
19
+ };
20
+ }, []);
21
+ return mounted ? /*#__PURE__*/createPortal(children, elRef.current) : null;
22
+ };
23
+ export default Portal;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { Layout } from "antd";
3
+ import { Outlet } from "react-router-dom";
4
+ import QuestionnairesSidebar from "../QuestionnairesSidebar";
5
+ import style from "./index.module.scss";
6
+ var Content = Layout.Content;
7
+ var QuestionnairesLayout = function QuestionnairesLayout(_ref) {
8
+ var allowed = _ref.allowed;
9
+ return /*#__PURE__*/React.createElement(Layout, {
10
+ className: style.layout
11
+ }, /*#__PURE__*/React.createElement(QuestionnairesSidebar, {
12
+ allowed: allowed
13
+ }), /*#__PURE__*/React.createElement(Content, {
14
+ className: style.content
15
+ }, /*#__PURE__*/React.createElement(Outlet, null)));
16
+ };
17
+ export default QuestionnairesLayout;
@@ -0,0 +1,162 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useState } from "react";
3
+ import { Link, useLocation } from "react-router-dom";
4
+ import style from "./index.module.scss";
5
+ import { Layout, Menu, Input } from "antd";
6
+ import { QUESTIONNAIRES_APPLICATION_FORMS, QUESTIONNAIRES_BRANDS, QUESTIONNAIRES_CHASSIS_TYPES, QUESTIONNAIRES_COLORS, QUESTIONNAIRES_COUNTRIES, QUESTIONNAIRES_DOCUMENT_RECIEVE_METHODS, QUESTIONNAIRES_DOCUMENT_TYPES, QUESTIONNAIRES_DOCUMENT_WHOM, QUESTIONNAIRES_ENGINE_TYPES, QUESTIONNAIRES_EXECUTION_RULES, QUESTIONNAIRES_GEARBOX_TYPES, QUESTIONNAIRES_ISSUED_AUTHORITIES, QUESTIONNAIRES_MARGIN_NOTE_TEXTS, QUESTIONNAIRES_MODELS, QUESTIONNAIRES_ORGANIZATIONS, QUESTIONNAIRES_OWNERSHIP_TYPES, QUESTIONNAIRES_STREETS, QUESTIONNAIRES_STRUCTURES, QUESTIONNAIRES_SUBTOPIC, QUESTIONNAIRES_TOPIC, QUESTIONNAIRES_TRANSMITTER_TYPES, QUESTIONNAIRES_VEHICLE_TYPES, SETTINGS_QUESTIONNAIRES_APPLICATION_FORMS, SETTINGS_QUESTIONNAIRES_BRANDS, SETTINGS_QUESTIONNAIRES_CHASSISTYPES, SETTINGS_QUESTIONNAIRES_COLORS, SETTINGS_QUESTIONNAIRES_COUNTRIES, SETTINGS_QUESTIONNAIRES_DOCUMENT_RECIEVE_METHODS, SETTINGS_QUESTIONNAIRES_DOCUMENT_TYPES, SETTINGS_QUESTIONNAIRES_DOCUMENT_WHOM, SETTINGS_QUESTIONNAIRES_ENGINETYPES, SETTINGS_QUESTIONNAIRES_EXECUTION_RULES, SETTINGS_QUESTIONNAIRES_GEARBOXTYPES, SETTINGS_QUESTIONNAIRES_ISSUEDAUTHORITIES, SETTINGS_QUESTIONNAIRES_MARGIN_NOTE_TEXTS, SETTINGS_QUESTIONNAIRES_MODELS, SETTINGS_QUESTIONNAIRES_ORGANIZATIONS, SETTINGS_QUESTIONNAIRES_OWNERSHIPTYPES, SETTINGS_QUESTIONNAIRES_STREETS, SETTINGS_QUESTIONNAIRES_STRUCTURES, SETTINGS_QUESTIONNAIRES_SUBTOPIC, SETTINGS_QUESTIONNAIRES_TOPIC, SETTINGS_QUESTIONNAIRES_TRANSMITTERTYPES, SETTINGS_QUESTIONNAIRES_VEHICLETYPES } from "../../utils/path";
7
+ import { SearchIcon } from "../../assets/icons";
8
+ var Sider = Layout.Sider;
9
+ var SubMenu = Menu.SubMenu;
10
+ var QuestionnairesSidebar = function QuestionnairesSidebar(_ref) {
11
+ var selectedKey = _ref.selectedKey,
12
+ _ref$allowed = _ref.allowed,
13
+ allowed = _ref$allowed === void 0 ? [] : _ref$allowed;
14
+ var _useState = useState(""),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ searchQuery = _useState2[0],
17
+ setSearchQuery = _useState2[1];
18
+ var location = useLocation();
19
+ var mainPath = "/".concat(location.pathname.split("/")[1]);
20
+ var items = [{
21
+ key: "topic",
22
+ label: "Mövzular",
23
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_TOPIC : QUESTIONNAIRES_TOPIC
24
+ }, {
25
+ key: "subtopic",
26
+ label: "Alt mövzular",
27
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_SUBTOPIC : QUESTIONNAIRES_SUBTOPIC
28
+ }, {
29
+ key: "executionRules",
30
+ label: "İcra qaydaları",
31
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_EXECUTION_RULES : QUESTIONNAIRES_EXECUTION_RULES
32
+ }, {
33
+ key: "document-recieve-methods",
34
+ label: "Daxil olma yolları",
35
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_DOCUMENT_RECIEVE_METHODS : QUESTIONNAIRES_DOCUMENT_RECIEVE_METHODS
36
+ }, {
37
+ key: "documentType",
38
+ label: "Sənəd Növləri",
39
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_DOCUMENT_TYPES : QUESTIONNAIRES_DOCUMENT_TYPES
40
+ }, {
41
+ key: "country",
42
+ label: "Ölkələr",
43
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_COUNTRIES : QUESTIONNAIRES_COUNTRIES
44
+ }, {
45
+ key: "street",
46
+ label: "Küçələr",
47
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_STREETS : QUESTIONNAIRES_STREETS
48
+ }, {
49
+ key: "organization",
50
+ label: "Təşkilatlar",
51
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_ORGANIZATIONS : QUESTIONNAIRES_ORGANIZATIONS
52
+ }, {
53
+ key: "structure",
54
+ label: "Strukturlar",
55
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_STRUCTURES : QUESTIONNAIRES_STRUCTURES
56
+ }, {
57
+ key: "application_form",
58
+ label: "Müraciət formaları",
59
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_APPLICATION_FORMS : QUESTIONNAIRES_APPLICATION_FORMS
60
+ }, {
61
+ key: "document_whom",
62
+ label: "Şəxslər",
63
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_DOCUMENT_WHOM : QUESTIONNAIRES_DOCUMENT_WHOM
64
+ }, {
65
+ key: "margin_note_texts",
66
+ label: "Dərkənar mətni",
67
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_MARGIN_NOTE_TEXTS : QUESTIONNAIRES_MARGIN_NOTE_TEXTS
68
+ }, {
69
+ key: "brands",
70
+ label: "Markalar",
71
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_BRANDS : QUESTIONNAIRES_BRANDS
72
+ }, {
73
+ key: "chassis-types",
74
+ label: "Şassi növləri",
75
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_CHASSISTYPES : QUESTIONNAIRES_CHASSIS_TYPES
76
+ }, {
77
+ key: "engine-types",
78
+ label: "Mühərrik növləri",
79
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_ENGINETYPES : QUESTIONNAIRES_ENGINE_TYPES
80
+ }, {
81
+ key: "gearbox-types",
82
+ label: "Sürətlər qutusu",
83
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_GEARBOXTYPES : QUESTIONNAIRES_GEARBOX_TYPES
84
+ }, {
85
+ key: "issued-authorities",
86
+ label: "Verən orqanlar",
87
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_ISSUEDAUTHORITIES : QUESTIONNAIRES_ISSUED_AUTHORITIES
88
+ }, {
89
+ key: "models",
90
+ label: "Modellər",
91
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_MODELS : QUESTIONNAIRES_MODELS
92
+ }, {
93
+ key: "ownership-types",
94
+ label: "Mülkiyyət növləri",
95
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_OWNERSHIPTYPES : QUESTIONNAIRES_OWNERSHIP_TYPES
96
+ }, {
97
+ key: "transmitter-types",
98
+ label: "Ötürücü növləri",
99
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_TRANSMITTERTYPES : QUESTIONNAIRES_TRANSMITTER_TYPES
100
+ }, {
101
+ key: "vehicle-types",
102
+ label: "Nəqliyyat növləri",
103
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_VEHICLETYPES : QUESTIONNAIRES_VEHICLE_TYPES
104
+ }, {
105
+ key: "colors",
106
+ label: "Rənglər",
107
+ link: mainPath === "/settings" ? SETTINGS_QUESTIONNAIRES_COLORS : QUESTIONNAIRES_COLORS
108
+ }];
109
+ var sortedItems = items.sort(function (a, b) {
110
+ return a.label.localeCompare(b.label);
111
+ });
112
+ var filteredItems = sortedItems.filter(function (item) {
113
+ return item.label.toLowerCase().includes(searchQuery.toLowerCase()) && allowed[item.key];
114
+ } // ✅ Check if allowed true
115
+ );
116
+ var defaultOpenKeys = items.filter(function (item) {
117
+ return item.children && item.children.some(function (child) {
118
+ return child.key === selectedKey;
119
+ });
120
+ }).map(function (item) {
121
+ return item.key;
122
+ });
123
+ var renderMenuItems = function renderMenuItems(items) {
124
+ return items.map(function (item) {
125
+ return /*#__PURE__*/React.createElement(Menu.Item, {
126
+ key: item.key,
127
+ icon: item.icon
128
+ }, /*#__PURE__*/React.createElement(Link, {
129
+ to: item.link
130
+ }, item.label));
131
+ });
132
+ };
133
+ return /*#__PURE__*/React.createElement(Sider, {
134
+ width: 256,
135
+ className: style.sidebar
136
+ }, /*#__PURE__*/React.createElement("div", {
137
+ className: style.logo
138
+ }, /*#__PURE__*/React.createElement("h2", null, "Soraq\xE7alar")), /*#__PURE__*/React.createElement("div", {
139
+ className: style.search
140
+ }, /*#__PURE__*/React.createElement(Input, {
141
+ onChange: function onChange(e) {
142
+ var _e$target;
143
+ return setSearchQuery(e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
144
+ },
145
+ placeholder: "Axtar",
146
+ className: style.search_input,
147
+ suffix: /*#__PURE__*/React.createElement("div", {
148
+ className: style.search_icon
149
+ }, /*#__PURE__*/React.createElement(SearchIcon, null))
150
+ })), /*#__PURE__*/React.createElement("div", {
151
+ className: "questionnaires_menu",
152
+ style: {
153
+ overflowY: "auto",
154
+ maxHeight: "calc(100vh - 225px)"
155
+ }
156
+ }, /*#__PURE__*/React.createElement(Menu, {
157
+ defaultSelectedKeys: [selectedKey],
158
+ defaultOpenKeys: defaultOpenKeys,
159
+ className: style.menu
160
+ }, renderMenuItems(filteredItems))));
161
+ };
162
+ export default QuestionnairesSidebar;