@banch0u/core-project-test-repository 2.1.10 → 2.1.12

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.
@@ -4,10 +4,11 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import React, { useState } from "react";
7
- import { Dropdown, Menu, Form, Input, Select as AntdSelect, DatePicker, TreeSelect } from "antd";
7
+ import { Dropdown, Menu, Form, Select as AntdSelect, DatePicker, TreeSelect } from "antd";
8
8
  import style from "./index.module.scss";
9
9
  import { FilterIcon } from "../../assets/icons";
10
10
  import Select from "../Select";
11
+ import Input from "../Input";
11
12
  import Button from "../Button";
12
13
  var Option = AntdSelect.Option;
13
14
  var RangePicker = DatePicker.RangePicker;
@@ -33,18 +34,34 @@ var Filter = function Filter(_ref) {
33
34
  var formattedMonth = String(month).padStart(2, "0");
34
35
  return "".concat(formattedDay, ".").concat(formattedMonth, ".").concat(year);
35
36
  };
37
+
38
+ // ✅ detect dayjs/moment-like objects
39
+ var isDateLike = function isDateLike(v) {
40
+ if (!v) return false;
41
+ if (typeof (v === null || v === void 0 ? void 0 : v.isValid) === "function" && v.isValid()) return true; // dayjs/moment
42
+ if (typeof (v === null || v === void 0 ? void 0 : v.date) === "function" && typeof (v === null || v === void 0 ? void 0 : v.month) === "function" && typeof (v === null || v === void 0 ? void 0 : v.year) === "function") return true; // fallback
43
+ return false;
44
+ };
45
+
46
+ // ✅ only treat [start,end] as date range if both are date-like
47
+ var isDateRange = function isDateRange(v) {
48
+ return Array.isArray(v) && v.length === 2 && isDateLike(v[0]) && isDateLike(v[1]);
49
+ };
36
50
  var handleFinish = function handleFinish(values) {
37
51
  var formattedValues = _objectSpread({}, values);
38
52
  Object.keys(values).forEach(function (key) {
39
- if (Array.isArray(values[key]) && values[key].length === 2) {
40
- var _values$key = _slicedToArray(values[key], 2),
41
- start = _values$key[0],
42
- end = _values$key[1];
43
- if (start && end) {
44
- var formattedStart = formatDate(start.date(), start.month() + 1, start.year());
45
- var formattedEnd = formatDate(end.date(), end.month() + 1, end.year());
46
- formattedValues[key] = "".concat(formattedStart, " - ").concat(formattedEnd);
47
- }
53
+ var val = values[key];
54
+
55
+ // only format RangePicker values, ignore multi-select arrays
56
+ if (isDateRange(val)) {
57
+ var _val = _slicedToArray(val, 2),
58
+ start = _val[0],
59
+ end = _val[1];
60
+
61
+ // Prefer .format if available (dayjs/moment), else manual
62
+ var formattedStart = typeof (start === null || start === void 0 ? void 0 : start.format) === "function" ? start.format("DD.MM.YYYY") : formatDate(start.date(), start.month() + 1, start.year());
63
+ var formattedEnd = typeof (end === null || end === void 0 ? void 0 : end.format) === "function" ? end.format("DD.MM.YYYY") : formatDate(end.date(), end.month() + 1, end.year());
64
+ formattedValues[key] = "".concat(formattedStart, " - ").concat(formattedEnd);
48
65
  }
49
66
  });
50
67
  setQuery(formattedValues);
@@ -54,8 +71,7 @@ var Filter = function Filter(_ref) {
54
71
  // Filter the columns based on selectedColumns, filterDisable, and filter status
55
72
  var filteredColumns = columns.filter(function (col) {
56
73
  return selectedColumns.includes(col.dataIndex) && col.filter !== false && col.filterDisable !== true || col.dataIndex === "filterOnly";
57
- } // Always include "filterOnly" columns in the filter
58
- );
74
+ });
59
75
  var getGrid = function getGrid() {
60
76
  var elementCount = selectedColumns.length - disabledElementCount;
61
77
  if (elementCount >= 5) return style.grid5;
@@ -78,25 +94,26 @@ var Filter = function Filter(_ref) {
78
94
  })), _toConsumableArray(filteredColumns.filter(function (col) {
79
95
  return col.isDouble;
80
96
  }))).map(function (col) {
81
- if (col.showCheckbox === false) {
82
- return null;
83
- }
97
+ if (col.showCheckbox === false) return null;
84
98
  var gridSpanClass = col.isDouble ? style.doubleGrid : style.singleGrid;
85
99
  if (col.type === "select") {
86
100
  return /*#__PURE__*/React.createElement(Form.Item, {
87
101
  key: col.dataIndex,
88
102
  label: col.title,
89
103
  name: col.queryName ? col.queryName : col.dataIndex,
90
- className: gridSpanClass // Dynamically apply grid class
91
- }, /*#__PURE__*/React.createElement(Select
92
- // showSearch={col.isDouble}
93
- , {
104
+ className: gridSpanClass
105
+ }, /*#__PURE__*/React.createElement(Select, {
94
106
  size: "sm",
107
+ style: {
108
+ height: "32px"
109
+ },
95
110
  onChange: function onChange(value) {
96
111
  if (col.dataIndex === "topic" || col.dataIndex === "contractTypeId" || col.dataIndex === "contractType") {
97
112
  setSelectedTopic(value);
98
113
  }
99
- }
114
+ },
115
+ mode: col.selectType === "multiple" ? "multiple" : "single",
116
+ optionFilterProp: "label"
100
117
  }, /*#__PURE__*/React.createElement(Option, {
101
118
  value: ""
102
119
  }), ((col === null || col === void 0 ? void 0 : col.selectData) || []).map(function (option, i) {
@@ -104,8 +121,8 @@ var Filter = function Filter(_ref) {
104
121
  var isIdArray = Array.isArray(option.id);
105
122
  return /*#__PURE__*/React.createElement(Option, {
106
123
  key: i,
107
- value: isIdArray ? JSON.stringify(option.id) // Convert array to string
108
- : option.id // Use ID directly
124
+ value: isIdArray ? JSON.stringify(option.id) : option.id,
125
+ label: option.name
109
126
  }, option.name, " ", option.surname, " ", option.text, (option === null || option === void 0 ? void 0 : option.registrationNumber) && (option === null || option === void 0 || (_option$brandId = option.brandId) === null || _option$brandId === void 0 ? void 0 : _option$brandId.text) && (option === null || option === void 0 || (_option$modelId = option.modelId) === null || _option$modelId === void 0 ? void 0 : _option$modelId.text) && " [".concat(option.registrationNumber, "] ").concat((_option$brandId2 = option.brandId) === null || _option$brandId2 === void 0 ? void 0 : _option$brandId2.text, " ").concat((_option$modelId2 = option.modelId) === null || _option$modelId2 === void 0 ? void 0 : _option$modelId2.text));
110
127
  })));
111
128
  }
@@ -114,7 +131,7 @@ var Filter = function Filter(_ref) {
114
131
  key: col.dataIndex,
115
132
  label: col.title,
116
133
  name: col.queryName ? col.queryName : col.dataIndex,
117
- className: gridSpanClass // Dynamically apply grid class
134
+ className: gridSpanClass
118
135
  }, /*#__PURE__*/React.createElement(RangePicker, {
119
136
  format: "DD.MM.YYYY",
120
137
  placeholder: ""
@@ -125,7 +142,7 @@ var Filter = function Filter(_ref) {
125
142
  key: col.dataIndex,
126
143
  label: col.title,
127
144
  name: col.queryName ? col.queryName : col.dataIndex,
128
- className: gridSpanClass // Dynamically apply grid class
145
+ className: gridSpanClass
129
146
  }, /*#__PURE__*/React.createElement(TreeSelect, {
130
147
  showSearch: true,
131
148
  popupMatchSelectWidth: false,
@@ -138,8 +155,10 @@ var Filter = function Filter(_ref) {
138
155
  key: col.dataIndex,
139
156
  label: col.title,
140
157
  name: col.queryName ? col.queryName : col.dataIndex,
141
- className: gridSpanClass // Dynamically apply grid class
142
- }, /*#__PURE__*/React.createElement(Input, null));
158
+ className: gridSpanClass
159
+ }, /*#__PURE__*/React.createElement(Input, {
160
+ size: "sm"
161
+ }));
143
162
  })), /*#__PURE__*/React.createElement("div", {
144
163
  className: style.buttons
145
164
  }, /*#__PURE__*/React.createElement(Button, {
@@ -157,9 +176,8 @@ var Filter = function Filter(_ref) {
157
176
  return /*#__PURE__*/React.createElement(Dropdown, {
158
177
  overlay: menu,
159
178
  trigger: ["click"],
160
- open: visible // Updated to use open
161
- ,
162
- onOpenChange: handleOpenChange // Updated to use onOpenChange
179
+ open: visible,
180
+ onOpenChange: handleOpenChange
163
181
  }, /*#__PURE__*/React.createElement(Button, {
164
182
  color: "white"
165
183
  }, /*#__PURE__*/React.createElement(FilterIcon, null)));
@@ -4,14 +4,14 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React, { useEffect, useCallback, useState } from "react";
5
5
  import style from "./index.module.scss";
6
6
  import { Form, Input } from "antd";
7
- import { Link, useNavigate } from "react-router-dom";
7
+ import { useNavigate } from "react-router-dom";
8
8
  import { DsgLogo } from "../../assets/icons";
9
9
  import Loading from "../../components/Loading";
10
10
  import { login } from "../../store/slices/auth";
11
11
  import { useDispatch, useSelector } from "react-redux";
12
- import AsanImza from "../../assets/icons/AsanImza.png";
13
- import Sima from "../../assets/icons/Sima.png";
14
- import Ldap from "../../assets/icons/Ldap.png";
12
+ // import AsanImza from "../../assets/icons/AsanImza.png";
13
+ // import Sima from "../../assets/icons/Sima.png";
14
+ // import Ldap from "../../assets/icons/Ldap.png";
15
15
  import { getCompanyInfo } from "../../store/slices/companyInfo";
16
16
  import api from "../../utils/axios"; // 💡 Make sure this points to your axios instance
17
17
 
@@ -150,32 +150,13 @@ var Login = function Login() {
150
150
  },
151
151
  placeholder: "\u015Eifr\u0259",
152
152
  className: style.control_input
153
- }))), /*#__PURE__*/React.createElement(Link, {
154
- to: ""
155
- }, "\u015Eifr\u0259ni unuttdun?"), /*#__PURE__*/React.createElement("div", {
153
+ }))), /*#__PURE__*/React.createElement("div", {
156
154
  className: style.button
157
155
  }, /*#__PURE__*/React.createElement("div", {
158
156
  className: style.border,
159
157
  "data-no-invert": true
160
158
  }, /*#__PURE__*/React.createElement("button", {
161
159
  type: "submit"
162
- }, "Daxil Ol"))), /*#__PURE__*/React.createElement("div", {
163
- className: style.alternative_login
164
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
165
- className: style.background
166
- }, /*#__PURE__*/React.createElement("img", {
167
- src: AsanImza,
168
- alt: "asan_imza"
169
- })), /*#__PURE__*/React.createElement("h3", null, "Asan imza")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
170
- className: style.background
171
- }, /*#__PURE__*/React.createElement("img", {
172
- src: Sima,
173
- alt: "sima"
174
- })), /*#__PURE__*/React.createElement("h3", null, "E-\u0130mza")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
175
- className: style.background
176
- }, /*#__PURE__*/React.createElement("img", {
177
- src: Ldap,
178
- alt: "ldap"
179
- })), /*#__PURE__*/React.createElement("h3", null, "Ldap")))));
160
+ }, "Daxil Ol")))));
180
161
  };
181
162
  export default Login;
@@ -72,6 +72,8 @@
72
72
  display: flex;
73
73
  justify-content: center;
74
74
  margin-bottom: 42px;
75
+ margin-top: 45px;
76
+
75
77
  .border {
76
78
  width: 228px;
77
79
  padding: 2px;
@@ -96,7 +96,8 @@ var QuestionnairesDefaultAgreementPlansContent = function QuestionnairesDefaultA
96
96
  var onEdit = useCallback(function (id, record) {
97
97
  var data = {
98
98
  id: id,
99
- name: record === null || record === void 0 ? void 0 : record.name
99
+ responsiblePersonId: record === null || record === void 0 ? void 0 : record.responsiblePersonId,
100
+ rank: record === null || record === void 0 ? void 0 : record.rank
100
101
  };
101
102
  dispatch(editDefaultAgreementPlans(data));
102
103
  setEditingRecord(null);
@@ -3,7 +3,7 @@ import { Switch, Tooltip } from "antd";
3
3
  import style from "../Questionnaires.module.scss";
4
4
  import { setDeleteModalVisible } from "../../../store/slices/global";
5
5
  import { DeleteIconQ, EditIcon } from "../../../assets/icons";
6
- export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
6
+ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, onTrailerChange) {
7
7
  return [{
8
8
  title: "№",
9
9
  dataIndex: "num",
@@ -13,9 +13,25 @@ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, o
13
13
  }, {
14
14
  title: "Növ",
15
15
  dataIndex: "name",
16
- width: innerW,
17
16
  disabled: true,
18
17
  ellipsis: true
18
+ }, {
19
+ title: "Qoşqu",
20
+ key: "Qoşqu",
21
+ disabled: false,
22
+ filter: true,
23
+ render: function render(data) {
24
+ return /*#__PURE__*/React.createElement(Tooltip, {
25
+ placement: "top",
26
+ title: "Qo\u015Fqu"
27
+ }, /*#__PURE__*/React.createElement(Switch, {
28
+ size: "medium",
29
+ checked: data === null || data === void 0 ? void 0 : data.isTrailer,
30
+ onChange: function onChange(checked) {
31
+ return onTrailerChange(data, checked, dispatch);
32
+ }
33
+ }));
34
+ }
19
35
  }, {
20
36
  title: "Status",
21
37
  key: "status",
@@ -90,6 +90,14 @@ var QuestionnairesVehicleTypesContent = function QuestionnairesVehicleTypesConte
90
90
  };
91
91
  dispatch(vehicletypesVisibility(data_));
92
92
  }, [dispatch]);
93
+ var onTrailerChange = useCallback(function (data, checked) {
94
+ var data_ = {
95
+ id: data === null || data === void 0 ? void 0 : data.id,
96
+ name: data === null || data === void 0 ? void 0 : data.name,
97
+ isTrailer: checked
98
+ };
99
+ dispatch(editVehicletype(data_));
100
+ }, [dispatch]);
93
101
  var closeOnViewModal = useCallback(function () {
94
102
  dispatch(setViewModalVisible(false));
95
103
  }, [dispatch]);
@@ -124,13 +132,14 @@ var QuestionnairesVehicleTypesContent = function QuestionnairesVehicleTypesConte
124
132
  id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
125
133
  name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
126
134
  isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
135
+ isTrailer: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isTrailer,
127
136
  className: "rowClassName1"
128
137
  };
129
138
  });
130
139
  }
131
140
  var columns = useMemo(function () {
132
- return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch);
133
- }, [onEditClick, onDelete, onStatusChange, dispatch]);
141
+ return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, onTrailerChange);
142
+ }, [onEditClick, onDelete, onStatusChange, dispatch, onTrailerChange]);
134
143
  var _useState11 = useState(columns.map(function (col) {
135
144
  return col.dataIndex;
136
145
  })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banch0u/core-project-test-repository",
3
- "version": "2.1.10",
3
+ "version": "2.1.12",
4
4
  "description": "Shared core features for all projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [