@banch0u/core-project-test-repository 1.8.3 → 1.9.0

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 (69) hide show
  1. package/dist/assets/css/antd.css +836 -0
  2. package/dist/assets/css/variables.css +6 -0
  3. package/dist/assets/icons/index.js +424 -1
  4. package/dist/components/Button/index.module.scss +14 -2
  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 +1 -2
  11. package/dist/components/Input/index.module.scss +21 -12
  12. package/dist/components/ProfileOptions/index.js +109 -66
  13. package/dist/components/ProfileOptions/index.module.scss +144 -12
  14. package/dist/components/Success/Success.js +19 -0
  15. package/dist/components/Success/Success.module.scss +26 -0
  16. package/dist/components/Table/index.js +4 -2
  17. package/dist/components/ViewModal/index.js +30 -0
  18. package/dist/helpers/paginationLength.js +3 -0
  19. package/dist/helpers/querySearch.js +22 -0
  20. package/dist/index.js +6 -0
  21. package/dist/layout/Header/AppSelect/index.js +107 -0
  22. package/dist/layout/Header/AppSelect/index.module.scss +68 -0
  23. package/dist/layout/Header/index.js +6 -84
  24. package/dist/layout/Header/index.module.scss +8 -12
  25. package/dist/layout/Portal/index.js +23 -0
  26. package/dist/layout/QuestionnairesLayout/index.js +17 -0
  27. package/dist/layout/QuestionnairesLayout/index.module.scss +0 -0
  28. package/dist/layout/QuestionnairesSidebar/index.js +126 -0
  29. package/dist/layout/QuestionnairesSidebar/index.module.scss +76 -0
  30. package/dist/layout/Sidebar/index.js +147 -0
  31. package/dist/layout/Sidebar/index.module.scss +50 -0
  32. package/dist/pages/Platform/constant.js +29 -2
  33. package/dist/pages/Platform/index.js +19 -30
  34. package/dist/pages/Platform/index.module.scss +20 -5
  35. package/dist/pages/Questionnnaires/Questionnaires.module.scss +194 -0
  36. package/dist/pages/Questionnnaires/QuestionnairesApplicationFormContent/constant.js +58 -0
  37. package/dist/pages/Questionnnaires/QuestionnairesApplicationFormContent/index.js +255 -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/QuestionnairesExecutionRulesContent/constant.js +58 -0
  49. package/dist/pages/Questionnnaires/QuestionnairesExecutionRulesContent/index.js +258 -0
  50. package/dist/pages/Questionnnaires/QuestionnairesMarginNoteTextsContent/constant.js +58 -0
  51. package/dist/pages/Questionnnaires/QuestionnairesMarginNoteTextsContent/index.js +249 -0
  52. package/dist/pages/Questionnnaires/QuestionnairesOrganizationsContent/constant.js +88 -0
  53. package/dist/pages/Questionnnaires/QuestionnairesOrganizationsContent/index.js +320 -0
  54. package/dist/pages/Questionnnaires/QuestionnairesStreetsContent/constant.js +58 -0
  55. package/dist/pages/Questionnnaires/QuestionnairesStreetsContent/index.js +240 -0
  56. package/dist/pages/Questionnnaires/QuestionnairesStructuresContent/constant.js +58 -0
  57. package/dist/pages/Questionnnaires/QuestionnairesStructuresContent/index.js +247 -0
  58. package/dist/pages/Questionnnaires/QuestionnairesSubtopicContent/constant.js +58 -0
  59. package/dist/pages/Questionnnaires/QuestionnairesSubtopicContent/index.js +317 -0
  60. package/dist/pages/Questionnnaires/QuestionnairesTopicContent/constant.js +58 -0
  61. package/dist/pages/Questionnnaires/QuestionnairesTopicContent/index.js +271 -0
  62. package/dist/pages/Questionnnaires/index.js +5 -0
  63. package/dist/routes/QuestionnaireRoutes.js +108 -0
  64. package/dist/store/slices/global/index.js +96 -3
  65. package/dist/store/slices/questionnaire/index.js +2500 -0
  66. package/dist/store/slices/questionnaire/service.js +1557 -0
  67. package/dist/store/store.js +2 -1
  68. package/dist/utils/path.js +30 -1
  69. package/package.json +2 -2
@@ -1,29 +1,33 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import React, { useEffect, useState } from "react";
3
- import { Badge, Dropdown, Menu, Tooltip } from "antd";
4
- import { SunOutlined, MoonOutlined } from "@ant-design/icons";
2
+ import React, { useEffect, useState, useRef } from "react";
3
+ import { Badge, Dropdown, Tooltip } from "antd";
4
+ import { SunOutlined } from "@ant-design/icons";
5
5
  import style from "./index.module.scss";
6
- import { BellOutlined } from "@ant-design/icons";
7
6
  import { useDispatch, useSelector } from "react-redux";
8
- import { Link } from "react-router-dom";
9
7
  import { getProfileInfo, scopes } from "../../store/slices/auth";
10
- import { entryData } from "../../pages/Platform/constant";
11
- import { CategoryIcon, UserIcon } from "../../assets/icons";
8
+ import { LogOutIcon, MoonIcon, NotificationBell, SettingsCogIcon } from "../../assets/icons";
12
9
  import { getNotifications } from "../../store/slices/notification";
13
10
  import NotificationDropdown from "../NotificationDropdown";
11
+ import { Link, useNavigate } from "react-router-dom";
12
+ import { LOGIN_PATH, SETTINGS_PERMISSIONS } from "../../utils/path";
14
13
  var ProfileOptions = function ProfileOptions() {
14
+ var _profileInfo$name;
15
15
  var dispatch = useDispatch();
16
- var _useSelector = useSelector(function (state) {
17
- return state.auth;
18
- }),
19
- scopesData = _useSelector.scopesData;
16
+ var navigate = useNavigate();
20
17
  var profileInfo = useSelector(function (state) {
21
18
  return state.auth.profileInfo;
22
19
  });
23
- var _useSelector2 = useSelector(function (state) {
20
+ var _useSelector = useSelector(function (state) {
24
21
  return state.global;
25
22
  }),
26
- notificationsRender = _useSelector2.notificationsRender;
23
+ notificationsRender = _useSelector.notificationsRender;
24
+ var _useSelector2 = useSelector(function (state) {
25
+ return state.auth;
26
+ }),
27
+ scopesData = _useSelector2.scopesData;
28
+ var notifications = useSelector(function (state) {
29
+ return state.notification.notifications;
30
+ });
27
31
  var _useState = useState(20),
28
32
  _useState2 = _slicedToArray(_useState, 2),
29
33
  size = _useState2[0],
@@ -32,13 +36,37 @@ var ProfileOptions = function ProfileOptions() {
32
36
  _useState4 = _slicedToArray(_useState3, 2),
33
37
  page = _useState4[0],
34
38
  setPage = _useState4[1];
35
- var notifications = useSelector(function (state) {
36
- return state.notification.notifications;
37
- });
38
- var _useState5 = useState(localStorage.getItem("theme") || "light"),
39
+ var _useState5 = useState(false),
39
40
  _useState6 = _slicedToArray(_useState5, 2),
40
- theme = _useState6[0],
41
- setTheme = _useState6[1];
41
+ open = _useState6[0],
42
+ setOpen = _useState6[1];
43
+ var _useState7 = useState(localStorage.getItem("theme") || "light"),
44
+ _useState8 = _slicedToArray(_useState7, 2),
45
+ theme = _useState8[0],
46
+ setTheme = _useState8[1];
47
+ var dropdownRef = useRef(null); // for click outside
48
+
49
+ useEffect(function () {
50
+ dispatch(scopes());
51
+ dispatch(getProfileInfo());
52
+ }, [dispatch]);
53
+ useEffect(function () {
54
+ dispatch(getNotifications({
55
+ size: size,
56
+ page: page
57
+ }));
58
+ }, [dispatch, size, page, notificationsRender]);
59
+ useEffect(function () {
60
+ var handleClickOutside = function handleClickOutside(event) {
61
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
62
+ setOpen(false);
63
+ }
64
+ };
65
+ document.addEventListener("mousedown", handleClickOutside);
66
+ return function () {
67
+ document.removeEventListener("mousedown", handleClickOutside);
68
+ };
69
+ }, []);
42
70
  var toggleTheme = function toggleTheme() {
43
71
  var newTheme = theme === "light" ? "dark" : "light";
44
72
  setTheme(newTheme);
@@ -46,6 +74,19 @@ var ProfileOptions = function ProfileOptions() {
46
74
  document.documentElement.setAttribute("data-theme", newTheme);
47
75
  window.dispatchEvent(new Event("themeChange"));
48
76
  };
77
+ var toggleAccordion = function toggleAccordion() {
78
+ return setOpen(!open);
79
+ };
80
+ var handleLogout = function handleLogout() {
81
+ window.localStorage.removeItem("token");
82
+ navigate(LOGIN_PATH);
83
+ };
84
+ var rootUrl;
85
+ if (window.location.hostname === "localhost") {
86
+ rootUrl = "http://localhost:" + window.location.port;
87
+ } else {
88
+ rootUrl = window.location.origin;
89
+ }
49
90
  var NotificationIcon = function NotificationIcon() {
50
91
  return /*#__PURE__*/React.createElement(Badge, {
51
92
  count: notifications === null || notifications === void 0 ? void 0 : notifications.notReadenCount,
@@ -56,45 +97,14 @@ var ProfileOptions = function ProfileOptions() {
56
97
  lineHeight: "16px",
57
98
  padding: "0 4px"
58
99
  }
59
- }, /*#__PURE__*/React.createElement(BellOutlined, {
60
- style: {
61
- fontSize: "20px"
62
- }
63
- }));
100
+ }, /*#__PURE__*/React.createElement("div", {
101
+ className: style.icon_overlay,
102
+ "data-no-invert": true
103
+ }, /*#__PURE__*/React.createElement(NotificationBell, null)));
64
104
  };
65
- useEffect(function () {
66
- dispatch(scopes());
67
- dispatch(getProfileInfo());
68
- }, [dispatch]);
69
- useEffect(function () {
70
- dispatch(getNotifications({
71
- size: size,
72
- page: page
73
- }));
74
- }, [dispatch, size, page, notificationsRender]);
75
- var rootUrl = window.location.origin;
76
- var menu1 = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement("div", {
77
- className: style.links
78
- }, entryData === null || entryData === void 0 ? void 0 : entryData.map(function (item) {
79
- return scopesData === "*" || scopesData !== null && scopesData !== void 0 && scopesData.includes(item.scopes) ? /*#__PURE__*/React.createElement(Link, {
80
- to: item === null || item === void 0 ? void 0 : item.pathname,
81
- key: item === null || item === void 0 ? void 0 : item.id
82
- }, item === null || item === void 0 ? void 0 : item.icon, item === null || item === void 0 ? void 0 : item.value) : /*#__PURE__*/React.createElement("div", {
83
- className: style.disableMenu,
84
- key: item === null || item === void 0 ? void 0 : item.id
85
- }, item === null || item === void 0 ? void 0 : item.icon, item === null || item === void 0 ? void 0 : item.value);
86
- }), /*#__PURE__*/React.createElement(Link, {
87
- to: "".concat(rootUrl, "/accounts")
88
- }, /*#__PURE__*/React.createElement(UserIcon, null), "\u015E\u0259xsi kabinet")));
89
105
  return /*#__PURE__*/React.createElement("div", {
90
106
  className: style.profile
91
- }, /*#__PURE__*/React.createElement(Tooltip, {
92
- title: theme === "dark" ? "Gündüz modu" : "Gecə modu"
93
- }, /*#__PURE__*/React.createElement("button", {
94
- onClick: toggleTheme,
95
- "data-no-invert": true,
96
- className: style.button
97
- }, theme === "dark" ? /*#__PURE__*/React.createElement(SunOutlined, null) : /*#__PURE__*/React.createElement(MoonOutlined, null))), /*#__PURE__*/React.createElement(Dropdown, {
107
+ }, /*#__PURE__*/React.createElement(Dropdown, {
98
108
  overlay: /*#__PURE__*/React.createElement(NotificationDropdown, {
99
109
  size: size,
100
110
  page: page,
@@ -109,19 +119,52 @@ var ProfileOptions = function ProfileOptions() {
109
119
  }, /*#__PURE__*/React.createElement("button", {
110
120
  "data-no-invert": true,
111
121
  className: style.button
112
- }, /*#__PURE__*/React.createElement(NotificationIcon, null)))), /*#__PURE__*/React.createElement(Dropdown, {
113
- overlay: menu1,
114
- trigger: ["click"]
115
- }, /*#__PURE__*/React.createElement("div", {
116
- className: style.category,
117
- "data-no-invert-1": true
118
- }, /*#__PURE__*/React.createElement(CategoryIcon, null))), /*#__PURE__*/React.createElement("div", {
119
- className: style.dropdown
122
+ }, /*#__PURE__*/React.createElement(NotificationIcon, null)))), /*#__PURE__*/React.createElement(Tooltip, {
123
+ title: theme === "dark" ? "Gündüz modu" : "Gecə modu"
124
+ }, /*#__PURE__*/React.createElement("button", {
125
+ onClick: toggleTheme,
126
+ "data-no-invert": true,
127
+ className: style.button
120
128
  }, /*#__PURE__*/React.createElement("div", {
121
- className: style.pp,
129
+ className: style.icon_overlay,
130
+ "data-no-invert": true
131
+ }, theme === "dark" ? /*#__PURE__*/React.createElement("div", {
122
132
  "data-no-invert": true
123
- }, profileInfo === null || profileInfo === void 0 ? void 0 : profileInfo.name[0]), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
133
+ }, /*#__PURE__*/React.createElement(SunOutlined, {
134
+ style: {
135
+ color: "#035FB5"
136
+ }
137
+ })) : /*#__PURE__*/React.createElement(MoonIcon, null)))), /*#__PURE__*/React.createElement("div", {
138
+ className: style.profile,
139
+ ref: dropdownRef
140
+ }, /*#__PURE__*/React.createElement("div", {
141
+ className: style.profileHeader,
142
+ style: {
143
+ borderRadius: open ? "8px 8px 0px 0px" : "8px"
144
+ },
145
+ onClick: toggleAccordion
146
+ }, /*#__PURE__*/React.createElement("div", {
147
+ style: {
148
+ display: "flex",
149
+ alignItems: "center",
150
+ gap: "8px"
151
+ }
152
+ }, /*#__PURE__*/React.createElement("div", {
153
+ className: style.pp
154
+ }, profileInfo === null || profileInfo === void 0 || (_profileInfo$name = profileInfo.name) === null || _profileInfo$name === void 0 ? void 0 : _profileInfo$name[0]), /*#__PURE__*/React.createElement("div", {
124
155
  className: style.name
125
- }, profileInfo === null || profileInfo === void 0 ? void 0 : profileInfo.name, " ", profileInfo === null || profileInfo === void 0 ? void 0 : profileInfo.surname))));
156
+ }, profileInfo === null || profileInfo === void 0 ? void 0 : profileInfo.name, " ", profileInfo === null || profileInfo === void 0 ? void 0 : profileInfo.surname)), /*#__PURE__*/React.createElement("div", {
157
+ className: "".concat(style.arrow, " ").concat(open ? style.open : "")
158
+ })), open && /*#__PURE__*/React.createElement("div", {
159
+ className: style.profileDropdown
160
+ }, scopesData === "*" && /*#__PURE__*/React.createElement(Link, {
161
+ className: style.menuItem,
162
+ to: "".concat(rootUrl, "/docflow").concat(SETTINGS_PERMISSIONS)
163
+ }, /*#__PURE__*/React.createElement(SettingsCogIcon, null), /*#__PURE__*/React.createElement("span", null, "T\u0259nziml\u0259m\u0259l\u0259r")), /*#__PURE__*/React.createElement("div", {
164
+ className: style.menuItem,
165
+ onClick: handleLogout
166
+ }, /*#__PURE__*/React.createElement(LogOutIcon, null), /*#__PURE__*/React.createElement("span", {
167
+ className: style.logoutText
168
+ }, "\xC7\u0131x\u0131\u015F et")))));
126
169
  };
127
170
  export default ProfileOptions;
@@ -1,6 +1,6 @@
1
1
  .profile {
2
2
  display: flex;
3
- gap: 12px;
3
+ gap: 10px;
4
4
  align-items: center;
5
5
  .category {
6
6
  display: flex;
@@ -18,6 +18,7 @@
18
18
  display: flex;
19
19
  align-items: center;
20
20
  cursor: pointer;
21
+ padding: 0;
21
22
  svg {
22
23
  width: 20px;
23
24
  margin-top: 3.5px;
@@ -34,17 +35,7 @@
34
35
  border-radius: 50%;
35
36
  border: 1px solid #bebebe;
36
37
  }
37
- .pp {
38
- width: 39px;
39
- height: 39px;
40
- border-radius: 50%;
41
- // border: 1px solid #bebebe;
42
- background: var(--darkBlueColor);
43
- color: white;
44
- display: flex;
45
- justify-content: center;
46
- align-items: center;
47
- }
38
+
48
39
  .name {
49
40
  font-family: Inter;
50
41
  font-size: 12px;
@@ -129,3 +120,144 @@
129
120
  }
130
121
  }
131
122
  }
123
+ .icon_overlay {
124
+ background-color: var(--lightBlue);
125
+ // padding: 11px;
126
+ border-radius: 6px;
127
+ width: 46px;
128
+ height: 46px;
129
+ display: flex;
130
+ align-items: center;
131
+ justify-content: center;
132
+
133
+ svg {
134
+ width: 24px !important;
135
+ height: 24px !important;
136
+ margin-top: 0 !important;
137
+ }
138
+ }
139
+
140
+ .profileRow {
141
+ display: flex;
142
+ align-items: center;
143
+ gap: 12px;
144
+ position: relative;
145
+ }
146
+
147
+ .button {
148
+ background: transparent;
149
+ border: none;
150
+ display: flex;
151
+ align-items: center;
152
+ cursor: pointer;
153
+ padding: 0;
154
+
155
+ svg {
156
+ width: 20px;
157
+ margin-top: 3.5px;
158
+ }
159
+ }
160
+
161
+ .icon_overlay {
162
+ background-color: var(--lightBlue);
163
+ border-radius: 6px;
164
+ width: 46px;
165
+ height: 46px;
166
+ display: flex;
167
+ align-items: center;
168
+ justify-content: center;
169
+
170
+ svg {
171
+ width: 24px !important;
172
+ height: 24px !important;
173
+ margin-top: 0 !important;
174
+ }
175
+ }
176
+
177
+ .profile {
178
+ position: relative;
179
+ display: flex;
180
+ align-items: flex-end;
181
+ }
182
+
183
+ .profileHeader {
184
+ display: flex;
185
+ align-items: center;
186
+ justify-content: space-between;
187
+ gap: 8px;
188
+ padding: 7px 10px;
189
+ border-radius: 8px;
190
+ background: var(--lightBlue);
191
+ cursor: pointer;
192
+ width: 240px;
193
+
194
+ .pp {
195
+ width: 32px;
196
+ height: 32px;
197
+ border-radius: 4px;
198
+ background: var(--blue);
199
+ color: white;
200
+ display: flex;
201
+ align-items: center;
202
+ justify-content: center;
203
+ font-weight: 500;
204
+ font-size: 16px;
205
+ }
206
+
207
+ .name {
208
+ font-weight: 600;
209
+ font-size: 14px;
210
+ color: var(--black);
211
+ }
212
+ }
213
+
214
+ .arrow {
215
+ width: 10px;
216
+ height: 10px;
217
+ border-right: 2px solid var(--blue);
218
+ border-bottom: 2px solid var(--blue);
219
+ transform: rotate(45deg);
220
+ transition: transform 0.3s ease;
221
+ margin-right: 6px;
222
+ }
223
+
224
+ .arrow.open {
225
+ transform: rotate(-135deg);
226
+ }
227
+
228
+ .profileDropdown {
229
+ position: absolute;
230
+ top: 100%;
231
+ right: -1px;
232
+ width: 242px;
233
+ border-right: 1px solid var(--blue);
234
+ border-left: 1px solid var(--blue);
235
+ border-bottom: 1px solid var(--blue);
236
+
237
+ border-radius: 0px 0px 8px 8px;
238
+ background: var(--lightBlue);
239
+ z-index: 100;
240
+ display: flex;
241
+ flex-direction: column;
242
+ overflow: hidden;
243
+ }
244
+
245
+ .menuItem {
246
+ display: flex;
247
+ align-items: center;
248
+ gap: 10px;
249
+ padding: 10px 16px;
250
+ font-size: 16px;
251
+ cursor: pointer;
252
+ border-top: 1px solid var(--white);
253
+ text-decoration: none;
254
+ transition: background 0.2s ease;
255
+ color: var(--blue);
256
+ &:hover {
257
+ background: #e6f0fc;
258
+ }
259
+ }
260
+
261
+ .logoutText {
262
+ color: red;
263
+ }
@@ -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,10 +15,16 @@ 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";
23
+ import SidebarComponent from "./layout/Sidebar";
21
24
  import { CoreProvider } from "./store/coreProvider";
25
+ export var Sidebar = function Sidebar(props) {
26
+ return /*#__PURE__*/React.createElement(CoreProvider, null, /*#__PURE__*/React.createElement(SidebarComponent, props));
27
+ };
22
28
  export var Login = function Login() {
23
29
  return /*#__PURE__*/React.createElement(CoreProvider, null, /*#__PURE__*/React.createElement(LoginPage, null));
24
30
  };
@@ -0,0 +1,107 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useMemo, useRef, useEffect, useState } from "react";
3
+ import { useSelector } from "react-redux";
4
+ import { useLocation } from "react-router-dom";
5
+ import { Collapse } from "antd";
6
+ import { RightOutlined } from "@ant-design/icons";
7
+ import style from "./index.module.scss";
8
+ import { entryData } from "../../../pages/Platform/constant";
9
+ import Portal from "../../Portal";
10
+ var Panel = Collapse.Panel;
11
+ var AppSelect = function AppSelect() {
12
+ var location = useLocation();
13
+ var _useSelector = useSelector(function (state) {
14
+ return state.auth;
15
+ }),
16
+ scopesData = _useSelector.scopesData;
17
+ var accordionRef = useRef(null);
18
+ var dropdownRef = useRef(null);
19
+ var _useState = useState([]),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ activeKey = _useState2[0],
22
+ setActiveKey = _useState2[1];
23
+ var _useState3 = useState({}),
24
+ _useState4 = _slicedToArray(_useState3, 2),
25
+ dropdownStyle = _useState4[0],
26
+ setDropdownStyle = _useState4[1];
27
+ var filteredOptions = useMemo(function () {
28
+ return entryData.filter(function (item) {
29
+ return item.scopes === "account" || scopesData === "*" || (scopesData === null || scopesData === void 0 ? void 0 : scopesData.includes(item.scopes));
30
+ });
31
+ }, [scopesData]);
32
+ var baseSegment = useMemo(function () {
33
+ return window.location.pathname.split("/")[1];
34
+ }, [location.pathname]);
35
+ var active = useMemo(function () {
36
+ return filteredOptions.find(function (opt) {
37
+ return opt.pathname.includes("/".concat(baseSegment));
38
+ }) || filteredOptions[0];
39
+ }, [filteredOptions, baseSegment]);
40
+ useEffect(function () {
41
+ var handleClickOutside = function handleClickOutside(e) {
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([]);
45
+ }
46
+ };
47
+ document.addEventListener("mousedown", handleClickOutside);
48
+ return function () {
49
+ return document.removeEventListener("mousedown", handleClickOutside);
50
+ };
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]);
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ ref: accordionRef
66
+ }, /*#__PURE__*/React.createElement(Collapse, {
67
+ bordered: false,
68
+ activeKey: activeKey,
69
+ onChange: function onChange(key) {
70
+ return setActiveKey(key);
71
+ },
72
+ expandIconPosition: "end",
73
+ expandIcon: function expandIcon(_ref) {
74
+ var isActive = _ref.isActive;
75
+ return /*#__PURE__*/React.createElement("div", {
76
+ "data-no-invert": true
77
+ }, /*#__PURE__*/React.createElement(RightOutlined, {
78
+ style: {
79
+ transform: "rotate(".concat(isActive ? 270 : 90, "deg)"),
80
+ transition: "transform 0.2s ease",
81
+ color: "white",
82
+ fontSize: "14px"
83
+ }
84
+ }));
85
+ },
86
+ className: style.accordion
87
+ }, /*#__PURE__*/React.createElement(Panel, {
88
+ header: /*#__PURE__*/React.createElement("div", {
89
+ className: style.accordionHeader
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)),
91
+ key: "1"
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
97
+ }, filteredOptions.filter(function (opt) {
98
+ return opt.pathname !== (active === null || active === void 0 ? void 0 : active.pathname);
99
+ }).map(function (option) {
100
+ return /*#__PURE__*/React.createElement("a", {
101
+ key: option.id,
102
+ href: option.pathname,
103
+ className: style.accordionOption
104
+ }, option.icon, /*#__PURE__*/React.createElement("span", null, option.value));
105
+ }))));
106
+ };
107
+ export default AppSelect;