@banch0u/core-project-test-repository 2.1.1 → 2.1.3

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.
@@ -3,7 +3,7 @@ import React, { useMemo, useRef, useEffect, useState } from "react";
3
3
  import { useSelector } from "react-redux";
4
4
  import { useLocation } from "react-router-dom";
5
5
  import { Collapse } from "antd";
6
- import { RightOutlined } from "@ant-design/icons";
6
+ import { RightOutlined, SettingOutlined } from "@ant-design/icons";
7
7
  import style from "./index.module.scss";
8
8
  import { entryData } from "../../../pages/Platform/constant";
9
9
  import Portal from "../../Portal";
@@ -35,7 +35,7 @@ var AppSelect = function AppSelect() {
35
35
  var active = useMemo(function () {
36
36
  return filteredOptions.find(function (opt) {
37
37
  return opt.pathname.includes("/".concat(baseSegment));
38
- }) || filteredOptions[0];
38
+ }) || null;
39
39
  }, [filteredOptions, baseSegment]);
40
40
  useEffect(function () {
41
41
  var handleClickOutside = function handleClickOutside(e) {
@@ -87,7 +87,7 @@ var AppSelect = function AppSelect() {
87
87
  }, /*#__PURE__*/React.createElement(Panel, {
88
88
  header: /*#__PURE__*/React.createElement("div", {
89
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)),
90
+ }, baseSegment === "settings" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SettingOutlined, null)), /*#__PURE__*/React.createElement("span", null, "T\u0259nziml\u0259m\u0259l\u0259r")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__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
91
  key: "1"
92
92
  })), activeKey.length > 0 && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
93
93
  "data-no-invert": true,
@@ -100,7 +100,7 @@ var AppSelect = function AppSelect() {
100
100
  return /*#__PURE__*/React.createElement("a", {
101
101
  key: option.id,
102
102
  href: option.pathname,
103
- className: style.accordionOption
103
+ className: "".concat(style.accordionOption, " ").concat(baseSegment === option.pathname.split("/")[1] ? style.selected : "")
104
104
  }, option.icon, /*#__PURE__*/React.createElement("span", null, option.value));
105
105
  }))));
106
106
  };
@@ -5,7 +5,7 @@ import style from "./index.module.scss";
5
5
  import { Layout, Menu, Input } from "antd";
6
6
  import { QUESTIONNAIRES_ACADEMIC_DEGREES, QUESTIONNAIRES_APPLICATION_FORMS, QUESTIONNAIRES_AREAS, QUESTIONNAIRES_BRANDS, QUESTIONNAIRES_CATEGORIES, QUESTIONNAIRES_CHASSIS_TYPES, QUESTIONNAIRES_CHEMICALS, QUESTIONNAIRES_COLORS, QUESTIONNAIRES_COMPANIES, QUESTIONNAIRES_CONTRACTCURRENCIES, QUESTIONNAIRES_CONTRACTTYPES, QUESTIONNAIRES_CONTRAGENTTYPES, QUESTIONNAIRES_COUNTRIES, QUESTIONNAIRES_CRUSH_REASONS, QUESTIONNAIRES_DETAIL_PARTS, QUESTIONNAIRES_DISABILITY_STATUSES, QUESTIONNAIRES_DOCUMENT_RECIEVE_METHODS, QUESTIONNAIRES_DOCUMENT_TYPES, QUESTIONNAIRES_DOCUMENT_WHOM, QUESTIONNAIRES_DRIVING_CATEGORIES, QUESTIONNAIRES_EDUCATION_INSTITUTIONS, QUESTIONNAIRES_EDUCATION_LEVELS, QUESTIONNAIRES_EDUCATION_PAYMENTS, QUESTIONNAIRES_EMPLOYEE_CONFIGURATIONS, QUESTIONNAIRES_ENGINE_TYPES, QUESTIONNAIRES_EXECUTION_RULES, QUESTIONNAIRES_EXTRA_SERVICES, QUESTIONNAIRES_FUEL_TYPES, QUESTIONNAIRES_GEARBOX_TYPES, QUESTIONNAIRES_GENERAL_STRUCTURE_STATUSES, QUESTIONNAIRES_GENERAL_STRUCTURE_TYPES, QUESTIONNAIRES_HALLS, QUESTIONNAIRES_HONORARY_TITLES, QUESTIONNAIRES_INSURANCE_TYPES, QUESTIONNAIRES_ISSUED_AUTHORITIES, QUESTIONNAIRES_MARGIN_NOTE_TEXTS, QUESTIONNAIRES_MEASUREMENT_TYPES, QUESTIONNAIRES_MILITARY_CATEGORIES, QUESTIONNAIRES_MILITARY_GROUPS, QUESTIONNAIRES_MILITARY_RANKS, QUESTIONNAIRES_MILITARY_STAFFS, QUESTIONNAIRES_MODELS, QUESTIONNAIRES_OIL_FIELDS, QUESTIONNAIRES_ORDERS, QUESTIONNAIRES_ORGANIZATIONS, QUESTIONNAIRES_OWNERSHIP_TYPES, QUESTIONNAIRES_PENALTY_TYPES, QUESTIONNAIRES_POSITIONS, QUESTIONNAIRES_REPAIR_TYPES, QUESTIONNAIRES_REPAIRMENT_WORK_TYPES,
7
7
  // QUESTIONNAIRES_REGIONS,
8
- QUESTIONNAIRES_REPRIMAND_TYPES, QUESTIONNAIRES_SPECIAL_DAYS, QUESTIONNAIRES_SPECIALIZATIONS, QUESTIONNAIRES_STRUCTURES, QUESTIONNAIRES_SUBTOPIC, QUESTIONNAIRES_TOPIC, QUESTIONNAIRES_TRANSMITTER_TYPES, QUESTIONNAIRES_VEHICLE_CATEGORIES, QUESTIONNAIRES_VEHICLE_GROUPS, QUESTIONNAIRES_VEHICLE_TYPES, QUESTIONNAIRES_WAR_PARTICIPANTS, QUESTIONNAIRES_WORK_MODES, QUESTIONNAIRES_WORK_SCHEDULES, QUESTIONNAIRES_OWNERS } from "../../utils/path";
8
+ QUESTIONNAIRES_REPRIMAND_TYPES, QUESTIONNAIRES_SPECIAL_DAYS, QUESTIONNAIRES_SPECIALIZATIONS, QUESTIONNAIRES_STRUCTURES, QUESTIONNAIRES_SUBTOPIC, QUESTIONNAIRES_TOPIC, QUESTIONNAIRES_TRANSMITTER_TYPES, QUESTIONNAIRES_VEHICLE_CATEGORIES, QUESTIONNAIRES_VEHICLE_GROUPS, QUESTIONNAIRES_VEHICLE_TYPES, QUESTIONNAIRES_WAR_PARTICIPANTS, QUESTIONNAIRES_WORK_MODES, QUESTIONNAIRES_WORK_SCHEDULES, QUESTIONNAIRES_OWNERS, QUESTIONNAIRES_CONTRACTTOPICS, QUESTIONNAIRES_CONTRACTTYPESSUBTYPES } from "../../utils/path";
9
9
  import { SearchIcon } from "../../assets/icons";
10
10
  var Sider = Layout.Sider;
11
11
  var SubMenu = Menu.SubMenu;
@@ -276,13 +276,29 @@ var QuestionnairesSidebar = function QuestionnairesSidebar(_ref) {
276
276
  //delete the "/" at the start of string
277
277
  label: "Mülkiyyətçi",
278
278
  link: QUESTIONNAIRES_OWNERS
279
- }
279
+ },
280
280
  // ---- generated sidebar item by questionnaireGenerator: Owners ----
281
+
282
+ {
283
+ key: "contracttopics",
284
+ //delete the "/" at the start of string
285
+ label: "Mövzular (Müqavilələr)",
286
+ link: QUESTIONNAIRES_CONTRACTTOPICS
287
+ },
288
+ // ---- generated sidebar item by questionnaireGenerator: ContractTopics ----
289
+
290
+ {
291
+ key: "subtypes",
292
+ //delete the "/" at the start of string
293
+ label: "Müqavilə alt növü",
294
+ link: QUESTIONNAIRES_CONTRACTTYPESSUBTYPES
295
+ }
296
+ // ---- generated sidebar item by questionnaireGenerator: ContractTypesSubtypes ----
281
297
  ];
282
298
  var sortedItems = items.sort(function (a, b) {
283
299
  return a.label.localeCompare(b.label);
284
300
  });
285
- var isAllowAll = allowed === "*" || (allowed === null || allowed === void 0 ? void 0 : allowed.includes("*"));
301
+ var isAllowAll = allowed === "*" || Array.isArray(allowed) && allowed.includes("*");
286
302
  var filteredItems = sortedItems.filter(function (item) {
287
303
  var matchesSearch = item.label.toLowerCase().includes(searchQuery.toLowerCase());
288
304
 
@@ -330,7 +346,8 @@ var QuestionnairesSidebar = function QuestionnairesSidebar(_ref) {
330
346
  className: "questionnaires_menu",
331
347
  style: {
332
348
  overflowY: "auto",
333
- maxHeight: "calc(100vh - 225px)"
349
+ maxHeight: "calc(100vh - 217px)",
350
+ borderBottomLeftRadius: 18
334
351
  }
335
352
  }, /*#__PURE__*/React.createElement(Menu, {
336
353
  defaultSelectedKeys: [selectedKey],
@@ -0,0 +1,58 @@
1
+ import * as React from "react";
2
+ import { Switch, Tooltip } from "antd";
3
+ import style from "../Questionnaires.module.scss";
4
+ import { setDeleteModalVisible } from "../../../store/slices/global";
5
+ import { DeleteIconQ, EditIcon } from "../../../assets/icons";
6
+ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
7
+ return [{
8
+ title: "№",
9
+ dataIndex: "num",
10
+ showCheckbox: false,
11
+ ellipsis: true,
12
+ width: 35
13
+ }, {
14
+ title: "Mövzular (Müqavilələr)",
15
+ dataIndex: "name",
16
+ width: innerW,
17
+ disabled: true,
18
+ ellipsis: true
19
+ }, {
20
+ title: "Status",
21
+ key: "status",
22
+ disabled: true,
23
+ filter: false,
24
+ render: function render(data) {
25
+ return /*#__PURE__*/React.createElement(Tooltip, {
26
+ placement: "top",
27
+ title: "Statusu d\u0259yi\u015F"
28
+ }, /*#__PURE__*/React.createElement(Switch, {
29
+ size: "medium",
30
+ checked: data === null || data === void 0 ? void 0 : data.isActive,
31
+ onChange: function onChange(checked) {
32
+ return onStatusChange(data, checked, dispatch);
33
+ }
34
+ }));
35
+ }
36
+ }, {
37
+ title: "",
38
+ key: "actions",
39
+ showCheckbox: false,
40
+ width: 80,
41
+ render: function render(data) {
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
43
+ className: style.number
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: style.actions
46
+ }, /*#__PURE__*/React.createElement("div", {
47
+ onClick: function onClick() {
48
+ return onEditClick(data);
49
+ }
50
+ }, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("div", {
51
+ onClick: function onClick() {
52
+ onDelete(data === null || data === void 0 ? void 0 : data.id);
53
+ dispatch(setDeleteModalVisible(true));
54
+ }
55
+ }, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
56
+ }
57
+ }];
58
+ };
@@ -0,0 +1,247 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
+ import React from "react";
6
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
7
+ import Cookies from "js-cookie";
8
+ import style from "../Questionnaires.module.scss";
9
+ import { Form, Input, Layout } from "antd";
10
+ import { PlusIcon } from "../../../assets/icons";
11
+ import FormModal from "../../../components/FormModal";
12
+ import { useDispatch, useSelector } from "react-redux";
13
+ import Delete from "../../../components/Delete/Delete";
14
+ import DeleteModal from "../../../components/DeleteModal/DeleteModal";
15
+ import Success from "../../../components/Success/Success";
16
+ import { setDeleteModalVisible, setViewModalVisible } from "../../../store/slices/global";
17
+ import ViewModal from "../../../components/ViewModal";
18
+ import { getStreetColumns } from "./constant";
19
+ import Pagination from "../../../components/Pagination";
20
+ import ColSort from "../../../components/ColSort";
21
+ import { setPaginationLength } from "../../../helpers/paginationLength";
22
+ import Button from "../../../components/Button";
23
+ import Loading from "../../../components/Loading";
24
+ import Table from "../../../components/Table";
25
+ import Filter from "../../../components/Filter";
26
+ import { addContractTopics, deleteContractTopics, editContractTopics, getContractTopics, contractTopicsVisibility } from "../../../store/slices/questionnaire";
27
+ var Content = Layout.Content;
28
+ var Item = Form.Item;
29
+ var QuestionnairesContractTopicsContent = function QuestionnairesContractTopicsContent() {
30
+ var _useState = useState(null),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ innerW = _useState2[0],
33
+ setInnerW = _useState2[1];
34
+ var ref = useRef();
35
+ var dispatch = useDispatch();
36
+ var _useState3 = useState(0),
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ id = _useState4[0],
39
+ setId = _useState4[1];
40
+ var _useState5 = useState(1),
41
+ _useState6 = _slicedToArray(_useState5, 2),
42
+ page = _useState6[0],
43
+ setPage = _useState6[1];
44
+ var _useState7 = useState(Cookies.get("pagination-size-questionnaire-contracttopics") ? JSON.parse(Cookies.get("pagination-size-questionnaire-contracttopics")) : 20),
45
+ _useState8 = _slicedToArray(_useState7, 2),
46
+ size = _useState8[0],
47
+ setSize = _useState8[1];
48
+ var _useState9 = useState({
49
+ name: ""
50
+ }),
51
+ _useState10 = _slicedToArray(_useState9, 2),
52
+ query = _useState10[0],
53
+ setQuery = _useState10[1];
54
+ var _useSelector = useSelector(function (state) {
55
+ return state.global;
56
+ }),
57
+ loading = _useSelector.loading,
58
+ ContractTopicsRender = _useSelector.ContractTopicsRender;
59
+ var ContractTopics = useSelector(function (state) {
60
+ return state.questionnaire.contractTopics;
61
+ });
62
+ var paginationLength = setPaginationLength(ContractTopics === null || ContractTopics === void 0 ? void 0 : ContractTopics.count, ContractTopics === null || ContractTopics === void 0 ? void 0 : ContractTopics.size);
63
+ var onSubmit = useCallback(/*#__PURE__*/function () {
64
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
65
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
66
+ while (1) switch (_context.prev = _context.next) {
67
+ case 0:
68
+ dispatch(addContractTopics(data));
69
+ case 1:
70
+ case "end":
71
+ return _context.stop();
72
+ }
73
+ }, _callee);
74
+ }));
75
+ return function (_x) {
76
+ return _ref.apply(this, arguments);
77
+ };
78
+ }(), [dispatch]);
79
+ var onEdit = useCallback(function (id, record) {
80
+ var data = {
81
+ id: id,
82
+ name: record === null || record === void 0 ? void 0 : record.name
83
+ };
84
+ dispatch(editContractTopics(data));
85
+ }, [dispatch]);
86
+ var onStatusChange = useCallback(function (data, checked) {
87
+ var data_ = {
88
+ id: data === null || data === void 0 ? void 0 : data.id,
89
+ checked: checked
90
+ };
91
+ dispatch(contractTopicsVisibility(data_));
92
+ }, [dispatch]);
93
+ var closeOnViewModal = useCallback(function () {
94
+ dispatch(setViewModalVisible(false));
95
+ }, [dispatch]);
96
+ var onClickModal = function onClickModal() {
97
+ var _ref$current;
98
+ ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.open();
99
+ };
100
+ var onEditClick = useCallback(function (data) {
101
+ var _ref$current2;
102
+ ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.setEdit(data);
103
+ }, []);
104
+ var onDelete = useCallback(function (id) {
105
+ setId(id);
106
+ }, []);
107
+ var handleColumnToggle = function handleColumnToggle(checked, dataIndex) {
108
+ setSelectedColumns(function (prevSelected) {
109
+ if (checked) {
110
+ return [].concat(_toConsumableArray(prevSelected), [dataIndex]);
111
+ } else {
112
+ return prevSelected.filter(function (col) {
113
+ return col !== dataIndex;
114
+ });
115
+ }
116
+ });
117
+ };
118
+ var data = [];
119
+ if (ContractTopics !== null && ContractTopics !== void 0 && ContractTopics.items) {
120
+ var _ContractTopics$items;
121
+ data = ContractTopics === null || ContractTopics === void 0 || (_ContractTopics$items = ContractTopics.items) === null || _ContractTopics$items === void 0 ? void 0 : _ContractTopics$items.map(function (dataObj, i) {
122
+ return {
123
+ num: (ContractTopics === null || ContractTopics === void 0 ? void 0 : ContractTopics.size) * (ContractTopics === null || ContractTopics === void 0 ? void 0 : ContractTopics.page) + i + 1 - (ContractTopics === null || ContractTopics === void 0 ? void 0 : ContractTopics.size),
124
+ id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
125
+ name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
126
+ isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
127
+ className: "rowClassName1"
128
+ };
129
+ });
130
+ }
131
+ var columns = useMemo(function () {
132
+ return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch);
133
+ }, [onEditClick, onDelete, onStatusChange, dispatch]);
134
+ var _useState11 = useState(columns.map(function (col) {
135
+ return col.dataIndex;
136
+ })),
137
+ _useState12 = _slicedToArray(_useState11, 2),
138
+ selectedColumns = _useState12[0],
139
+ setSelectedColumns = _useState12[1];
140
+ useEffect(function () {
141
+ if (window.innerWidth >= 1900) {
142
+ setInnerW(210);
143
+ } else {
144
+ setInnerW(155);
145
+ }
146
+ var data = {
147
+ page: page,
148
+ size: size,
149
+ query: query,
150
+ visibility: "nondeleted"
151
+ };
152
+ dispatch(getContractTopics(data));
153
+ }, [dispatch, page, ContractTopicsRender, query, size]);
154
+ var updateSize = function updateSize(newSize) {
155
+ setSize(newSize);
156
+ Cookies.set("pagination-size-questionnaire-contracttopics", JSON.stringify(newSize), {
157
+ expires: 7
158
+ });
159
+ };
160
+ return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(Loading, null) : null, /*#__PURE__*/React.createElement(Layout, {
161
+ className: style.layout
162
+ }, /*#__PURE__*/React.createElement(Content, {
163
+ className: style.content
164
+ }, /*#__PURE__*/React.createElement("header", {
165
+ className: style.header
166
+ }, /*#__PURE__*/React.createElement(Button, {
167
+ onClick: onClickModal,
168
+ color: "green"
169
+ }, /*#__PURE__*/React.createElement(PlusIcon, null), " Soraq\xE7a \u0259lav\u0259 et"), /*#__PURE__*/React.createElement(Filter, {
170
+ columns: columns,
171
+ selectedColumns: selectedColumns,
172
+ setQuery: setQuery,
173
+ disabledElementCount: 3,
174
+ setPage: setPage
175
+ }))), /*#__PURE__*/React.createElement(Layout, {
176
+ className: style.layout1
177
+ }, /*#__PURE__*/React.createElement(Content, {
178
+ className: style.content
179
+ }, /*#__PURE__*/React.createElement("div", {
180
+ className: style.table_header
181
+ }, /*#__PURE__*/React.createElement("h2", null, "M\xF6vzular (M\xFCqavil\u0259l\u0259r)"), /*#__PURE__*/React.createElement("div", {
182
+ className: style.buttons
183
+ }, /*#__PURE__*/React.createElement(ColSort, {
184
+ columns: columns,
185
+ selectedColumns: selectedColumns,
186
+ handleColumnToggle: handleColumnToggle
187
+ }))), /*#__PURE__*/React.createElement("div", {
188
+ className: "bigTable"
189
+ }, /*#__PURE__*/React.createElement(Table, {
190
+ selectedColumns: selectedColumns,
191
+ innerW: innerW,
192
+ dataSource: data,
193
+ columns: columns,
194
+ disableDrag: true
195
+ })), /*#__PURE__*/React.createElement("div", {
196
+ className: style.pagination
197
+ }, /*#__PURE__*/React.createElement(Pagination, {
198
+ size: size,
199
+ setSize: updateSize,
200
+ total: paginationLength,
201
+ page: page,
202
+ onChange: setPage
203
+ })), /*#__PURE__*/React.createElement(FormModal, {
204
+ ref: ref,
205
+ width: 454,
206
+ title: "Yeni soraqça yaratma",
207
+ titleEdit: "Soraqça redaktə etmə",
208
+ okText: "Yadda saxla",
209
+ cancelText: "Bağla",
210
+ onSubmit: onSubmit,
211
+ onEdit: onEdit,
212
+ className: "absolute",
213
+ centered: false
214
+ }, /*#__PURE__*/React.createElement(Item, {
215
+ rules: [{
216
+ required: true,
217
+ message: ""
218
+ }, {
219
+ min: 3,
220
+ message: "Ən azından 3 simvol olmalıdır"
221
+ }],
222
+ name: "name",
223
+ label: "Ad"
224
+ }, /*#__PURE__*/React.createElement(Input, {
225
+ className: style.modal_input
226
+ }))), /*#__PURE__*/React.createElement(DeleteModal, {
227
+ onCancel: function onCancel() {
228
+ return dispatch(setDeleteModalVisible(false));
229
+ },
230
+ width: 280
231
+ }, /*#__PURE__*/React.createElement(Delete, {
232
+ onDelete: function onDelete() {
233
+ return dispatch(deleteContractTopics(id));
234
+ },
235
+ onCancel: function onCancel() {
236
+ return dispatch(setDeleteModalVisible(false));
237
+ },
238
+ value: "Soraqçanı"
239
+ })), /*#__PURE__*/React.createElement(ViewModal, {
240
+ onCancel: closeOnViewModal,
241
+ width: 695
242
+ }, /*#__PURE__*/React.createElement(Success, {
243
+ onClick: closeOnViewModal,
244
+ value: "Soraqça"
245
+ }))))));
246
+ };
247
+ export default QuestionnairesContractTopicsContent;
@@ -0,0 +1,58 @@
1
+ import * as React from "react";
2
+ import { Switch, Tooltip } from "antd";
3
+ import style from "../Questionnaires.module.scss";
4
+ import { setDeleteModalVisible } from "../../../store/slices/global";
5
+ import { DeleteIconQ, EditIcon } from "../../../assets/icons";
6
+ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
7
+ return [{
8
+ title: "№",
9
+ dataIndex: "num",
10
+ showCheckbox: false,
11
+ ellipsis: true,
12
+ width: 35
13
+ }, {
14
+ title: "Müqavilə alt növü",
15
+ dataIndex: "name",
16
+ width: innerW,
17
+ disabled: true,
18
+ ellipsis: true
19
+ }, {
20
+ title: "Status",
21
+ key: "status",
22
+ disabled: true,
23
+ filter: false,
24
+ render: function render(data) {
25
+ return /*#__PURE__*/React.createElement(Tooltip, {
26
+ placement: "top",
27
+ title: "Statusu d\u0259yi\u015F"
28
+ }, /*#__PURE__*/React.createElement(Switch, {
29
+ size: "medium",
30
+ checked: data === null || data === void 0 ? void 0 : data.isActive,
31
+ onChange: function onChange(checked) {
32
+ return onStatusChange(data, checked, dispatch);
33
+ }
34
+ }));
35
+ }
36
+ }, {
37
+ title: "",
38
+ key: "actions",
39
+ showCheckbox: false,
40
+ width: 80,
41
+ render: function render(data) {
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
43
+ className: style.number
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: style.actions
46
+ }, /*#__PURE__*/React.createElement("div", {
47
+ onClick: function onClick() {
48
+ return onEditClick(data);
49
+ }
50
+ }, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("div", {
51
+ onClick: function onClick() {
52
+ onDelete(data === null || data === void 0 ? void 0 : data.id);
53
+ dispatch(setDeleteModalVisible(true));
54
+ }
55
+ }, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
56
+ }
57
+ }];
58
+ };