sccoreui 6.5.24 → 6.5.26

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.
package/dist/App.js CHANGED
@@ -4,6 +4,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  require("./App.scss");
5
5
  // import Home from "./pages/home";
6
6
  const App = () => {
7
- return ((0, jsx_runtime_1.jsx)("div", { className: "m-6" }));
7
+ return (0, jsx_runtime_1.jsx)("div", { className: "m-6" });
8
8
  };
9
9
  exports.default = App;
package/dist/App.scss CHANGED
@@ -752,6 +752,57 @@ code {
752
752
  }
753
753
  }
754
754
 
755
+ .p-datepicker .p-datepicker-header .p-datepicker-title {
756
+ display: inline-flex;
757
+ flex-wrap: nowrap;
758
+ align-items: center;
759
+ white-space: nowrap;
760
+ }
761
+
762
+ .p-datepicker .p-datepicker-header .p-datepicker-title .date_nav_dropdown {
763
+ min-width: 0 !important;
764
+ background: transparent;
765
+ border: none;
766
+ box-shadow: none;
767
+ border-radius: 4px;
768
+
769
+ &:hover,
770
+ &:not(.p-disabled):hover {
771
+ background: #f3f4f6;
772
+ border: none;
773
+ }
774
+
775
+ &:not(.p-disabled).p-focus {
776
+ box-shadow: none;
777
+ border: none;
778
+ }
779
+
780
+ .p-dropdown-label {
781
+ padding: 2px 6px;
782
+ font-size: 1rem;
783
+ font-weight: 600;
784
+ color: #495057;
785
+ line-height: 1.5rem;
786
+ }
787
+
788
+ .p-dropdown-trigger {
789
+ display: none;
790
+ }
791
+ }
792
+
793
+ .p-datepicker .p-dropdown-panel,
794
+ .date_nav_dropdown ~ .p-dropdown-panel {
795
+ min-width: 6rem;
796
+
797
+ .p-dropdown-items .p-dropdown-item {
798
+ display: flex;
799
+ align-items: center;
800
+ justify-content: space-between;
801
+ gap: 0.75rem;
802
+ padding-right: 0.75rem;
803
+ }
804
+ }
805
+
755
806
  .date_filter {
756
807
  margin: 0;
757
808
  position: absolute;
@@ -1945,6 +1996,57 @@ code {
1945
1996
  }
1946
1997
  }
1947
1998
 
1999
+ .p-datepicker .p-datepicker-header .p-datepicker-title {
2000
+ display: inline-flex;
2001
+ flex-wrap: nowrap;
2002
+ align-items: center;
2003
+ white-space: nowrap;
2004
+ }
2005
+
2006
+ .p-datepicker .p-datepicker-header .p-datepicker-title .date_nav_dropdown {
2007
+ min-width: 0 !important;
2008
+ background: transparent;
2009
+ border: none;
2010
+ box-shadow: none;
2011
+ border-radius: 4px;
2012
+
2013
+ &:hover,
2014
+ &:not(.p-disabled):hover {
2015
+ background: #f3f4f6;
2016
+ border: none;
2017
+ }
2018
+
2019
+ &:not(.p-disabled).p-focus {
2020
+ box-shadow: none;
2021
+ border: none;
2022
+ }
2023
+
2024
+ .p-dropdown-label {
2025
+ padding: 2px 6px;
2026
+ font-size: 1rem;
2027
+ font-weight: 600;
2028
+ color: #495057;
2029
+ line-height: 1.5rem;
2030
+ }
2031
+
2032
+ .p-dropdown-trigger {
2033
+ display: none;
2034
+ }
2035
+ }
2036
+
2037
+ .p-datepicker .p-dropdown-panel,
2038
+ .date_nav_dropdown ~ .p-dropdown-panel {
2039
+ min-width: 6rem;
2040
+
2041
+ .p-dropdown-items .p-dropdown-item {
2042
+ display: flex;
2043
+ align-items: center;
2044
+ justify-content: space-between;
2045
+ gap: 0.75rem;
2046
+ padding-right: 0.75rem;
2047
+ }
2048
+ }
2049
+
1948
2050
  .date_filter {
1949
2051
  margin: 0;
1950
2052
  position: absolute;
@@ -538,9 +538,11 @@ a {
538
538
  .p-datepicker.p-datepicker-timeonly .p-timepicker {
539
539
  border-top: 0 none;
540
540
  }
541
- .p-datepicker .p-monthpicker {
541
+ .p-datepicker .p-monthpicker, .p-datepicker .p-yearpicker {
542
542
  margin: 0.5rem 0;
543
+ min-height: 256px;
543
544
  }
545
+
544
546
  .p-datepicker .p-monthpicker .p-monthpicker-month {
545
547
  padding: 0.5rem;
546
548
  transition: box-shadow 0.2s;
@@ -550,9 +552,7 @@ a {
550
552
  color: #4338ca;
551
553
  background: #eef2ff;
552
554
  }
553
- .p-datepicker .p-yearpicker {
554
- margin: 0.5rem 0;
555
- }
555
+
556
556
  .p-datepicker .p-yearpicker .p-yearpicker-year {
557
557
  padding: 0.5rem;
558
558
  transition: box-shadow 0.2s;
@@ -18,7 +18,7 @@ const Conditions = (props) => {
18
18
  // Filter available conditions based on column data type using fieldOperators
19
19
  const filteredConditions = constants_2.default.conditionsList.filter((cond) => cond.fieldOperators.includes(columnName === null || columnName === void 0 ? void 0 : columnName.dataType));
20
20
  // Extract numeric value from condition (handles both object and number formats)
21
- const conditionValue = typeof condition === 'object' ? condition === null || condition === void 0 ? void 0 : condition.value : condition;
21
+ const conditionValue = typeof condition === "object" ? condition === null || condition === void 0 ? void 0 : condition.value : condition;
22
22
  const onAddCondition = (index) => {
23
23
  addEmptyCondition(index);
24
24
  };
@@ -102,7 +102,9 @@ const Conditions = (props) => {
102
102
  }
103
103
  // Preview resulting value and block if > 100
104
104
  if (key !== ".") {
105
- const previewValue = currentValue.substring(0, cursorPos) + key + currentValue.substring(selEnd);
105
+ const previewValue = currentValue.substring(0, cursorPos) +
106
+ key +
107
+ currentValue.substring(selEnd);
106
108
  if (parseFloat(previewValue) > 100) {
107
109
  e.preventDefault();
108
110
  return;
@@ -120,24 +122,168 @@ const Conditions = (props) => {
120
122
  };
121
123
  const renderRangeNumber = (selectedColumn, showError) => {
122
124
  const isPercent = (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.PERCENT;
123
- const handleChange1 = (data) => {
124
- if (isPercent && data != null && data > 100)
125
+ const isInteger = (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.INTEGER;
126
+ const maxFractionDigits = isInteger ? 0 : 2;
127
+ // ✅ Validate input (allows typing states)
128
+ const validateInput = (val) => {
129
+ if (val === "")
130
+ return val;
131
+ const regex = isInteger
132
+ ? /^\d*$/
133
+ : new RegExp(`^\\d*(\\.\\d{0,${maxFractionDigits}})?$`);
134
+ if (!regex.test(val))
135
+ return null;
136
+ // only validate numeric constraints if complete
137
+ if (!val.endsWith(".") && val !== ".") {
138
+ const num = Number(val);
139
+ if (!Number.isNaN(num)) {
140
+ if (num < 0)
141
+ return null;
142
+ if (isPercent && num > 100)
143
+ return null;
144
+ }
145
+ }
146
+ return val;
147
+ };
148
+ // ✅ Safe conversion
149
+ const toSafeNumber = (val) => {
150
+ if (val === "" || val === "." || val.endsWith(".")) {
151
+ return val;
152
+ }
153
+ const num = Number(val);
154
+ if (!Number.isNaN(num) && Math.abs(num) <= Number.MAX_SAFE_INTEGER) {
155
+ return num;
156
+ }
157
+ return val;
158
+ };
159
+ // ✅ Normalize for comparison
160
+ const normalize = (val) => {
161
+ if (val === null || val === "")
162
+ return null;
163
+ return typeof val === "number" ? val.toString() : val;
164
+ };
165
+ // ✅ Large number safe compare (integers)
166
+ const compareValues = (a, b) => {
167
+ const x = a.replace(/^0+/, "") || "0";
168
+ const y = b.replace(/^0+/, "") || "0";
169
+ if (x.length > y.length)
170
+ return 1;
171
+ if (x.length < y.length)
172
+ return -1;
173
+ if (x > y)
174
+ return 1;
175
+ if (x < y)
176
+ return -1;
177
+ return 0;
178
+ };
179
+ // ✅ Between validation
180
+ const isValidRange = (() => {
181
+ if (!Array.isArray(value))
182
+ return true;
183
+ const [minVal, maxVal] = value;
184
+ if (!minVal || !maxVal)
185
+ return true;
186
+ if (!isInteger) {
187
+ return Number(minVal) <= Number(maxVal);
188
+ }
189
+ return compareValues(normalize(minVal), normalize(maxVal)) <= 0;
190
+ })();
191
+ const rangeInvalid = isValidRange ? "" : "p-invalid";
192
+ // ✅ Change handler
193
+ const handleChange = (index, val) => {
194
+ if (val.length > 20)
195
+ return;
196
+ const validated = validateInput(val);
197
+ if (validated === null)
198
+ return;
199
+ const converted = toSafeNumber(validated);
200
+ const newValue = Array.isArray(value) ? [...value] : [null, null];
201
+ newValue[index] = converted;
202
+ handleDynamicFieldState(newValue);
203
+ };
204
+ // ✅ Blur handler (normalize like ControlledInput)
205
+ const handleBlur = (index) => {
206
+ if (!Array.isArray(value))
207
+ return;
208
+ let val = value[index];
209
+ if (!val || typeof val !== "string")
210
+ return;
211
+ if (val === "." || val === "") {
212
+ const newValue = [...value];
213
+ newValue[index] = null;
214
+ handleDynamicFieldState(newValue);
215
+ return;
216
+ }
217
+ // ✅ if too large → DO NOT convert
218
+ if (val.length > 15) {
219
+ // keep as string (prevents precision loss)
220
+ return;
221
+ }
222
+ const num = Number(val);
223
+ if (!Number.isNaN(num)) {
224
+ let formatted = num;
225
+ if (!isInteger) {
226
+ formatted = Number(num.toFixed(maxFractionDigits));
227
+ }
228
+ else {
229
+ formatted = Math.floor(num);
230
+ }
231
+ const newValue = [...value];
232
+ newValue[index] = formatted;
233
+ handleDynamicFieldState(newValue);
234
+ }
235
+ };
236
+ // ✅ Display value
237
+ const getDisplayValue = (val) => {
238
+ if (val === null || val === undefined)
239
+ return "";
240
+ return val.toString();
241
+ };
242
+ // ✅ Keydown validation
243
+ const handleKeyDown = (e) => {
244
+ const allowed = ["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab"];
245
+ const isDot = e.key === ".";
246
+ if (e.ctrlKey || e.metaKey) {
125
247
  return;
126
- Array.isArray(value) && value.splice(0, 1, data);
127
- handleDynamicFieldState(Array.isArray(value) ? value : [data]);
248
+ }
249
+ if (isDot && e.currentTarget.value.includes(".")) {
250
+ e.preventDefault();
251
+ return;
252
+ }
253
+ if (!/[0-9.]/.test(e.key) && !allowed.includes(e.key)) {
254
+ e.preventDefault();
255
+ }
128
256
  };
129
- const handleChange2 = (data) => {
130
- if (isPercent && data != null && data > 100)
257
+ // Paste handling (safe)
258
+ const handlePaste = (e) => {
259
+ let pasted = e.clipboardData.getData("text");
260
+ if (!pasted)
261
+ return;
262
+ // ✅ Trim spaces & normalize
263
+ pasted = pasted.trim();
264
+ // ✅ Remove commas (common copy case like 1,000)
265
+ pasted = pasted.replace(/,/g, "");
266
+ // ✅ Allow valid patterns
267
+ const regex = isInteger ? /^\d+$/ : /^\d*(\.\d*)?$/;
268
+ if (!regex.test(pasted)) {
269
+ e.preventDefault();
131
270
  return;
132
- Array.isArray(value) && value.splice(1, 1, data);
133
- handleDynamicFieldState(value);
271
+ }
272
+ // ✅ Validate numeric constraints (only if complete)
273
+ if (!pasted.endsWith(".")) {
274
+ const num = Number(pasted);
275
+ if (!Number.isNaN(num)) {
276
+ if (num < 0 || (isPercent && num > 100)) {
277
+ e.preventDefault();
278
+ return;
279
+ }
280
+ }
281
+ }
282
+ // ✅ Allow paste
134
283
  };
135
- const rangeInvalid = Array.isArray(value) && (value === null || value === void 0 ? void 0 : value.every((y) => Boolean(y)))
136
- ? value[0] > value[1]
137
- ? "p-invalid"
138
- : ""
139
- : "";
140
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `border-noround-left p-0 col-4 mx-0 focus:shadow-none lh-44 h-44 flex ${showError ? "p-invalid" : ""}` }, { children: [(0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition, min: 0, useGrouping: false, max: isPercent ? 100 : Infinity, maxFractionDigits: (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.INTEGER ? 0 : 2, inputClassName: "mx-0 w-full lh-44 h-44", className: `w-7ren border-noround-left lh-44 h-44 border-noround-right dropdown-focus-none ${rangeInvalid} ${showError ? "p-invalid" : ""}`, value: Array.isArray(value) ? value[0] : null, placeholder: "Min", onChange: (event) => handleChange1(event.value), onKeyDown: isPercent ? handlePercentKeyDown : undefined }), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition || !(Array.isArray(value) && value[0]), min: 0, useGrouping: false, max: isPercent ? 100 : Infinity, maxFractionDigits: (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.INTEGER ? 0 : 2, inputClassName: "mx-0 w-full lh-44 h-44", className: `w-7ren border-noround-left lh-44 h-44 dropdown-focus-none ${rangeInvalid} ${showError ? "p-invalid" : ""}`, value: Array.isArray(value) ? value[1] : null, placeholder: "Max", onChange: (event) => handleChange2(event.value), onKeyDown: isPercent ? handlePercentKeyDown : undefined })] })));
284
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `border-noround-left w-13rem p-0 col-4 mx-0 flex ${showError ? "p-invalid" : ""}` }, { children: [(0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, value: getDisplayValue(Array.isArray(value) ? value[0] : ""), placeholder: "Min", onChange: (e) => handleChange(0, e.target.value), onKeyDown: handleKeyDown, onBlur: () => handleBlur(0),
285
+ // onPaste={handlePaste}
286
+ className: `w-6 border-noround-left lh-44 h-44 border-noround-right ${rangeInvalid} ${showError ? "p-invalid" : ""}` }), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition || !(Array.isArray(value) && value[0]), value: getDisplayValue(Array.isArray(value) ? value[1] : ""), placeholder: "Max", onChange: (e) => handleChange(1, e.target.value), onKeyDown: handleKeyDown, onBlur: () => handleBlur(1), onPaste: handlePaste, className: `w-6 border-left-none border-noround-left lh-44 h-44 ${rangeInvalid} ${showError ? "p-invalid" : ""}` })] })));
141
287
  };
142
288
  const renderListStringChips = (showError) => ((0, jsx_runtime_1.jsx)(chips_1.Chips, { value: value, type: "", disabled: !condition, className: `table_filters_1 border-noround-left col-4 focus:shadow-none lh-44 h-44 chip_comp flex align-items-center ${showError ? "p-invalid" : ""}`, onChange: (e) => handleDynamicFieldState(e.target.value), placeholder: "Enter tags", separator: "," }));
143
289
  const renderListNumberChips = (selectedColumn, showError) => {
@@ -281,7 +427,11 @@ const Conditions = (props) => {
281
427
  : convertDateToISO(val);
282
428
  handleDynamicFieldState(valueString);
283
429
  };
284
- const selectionMode = spec.kind === "Range" ? "range" : spec.kind === "List" ? "multiple" : "single";
430
+ const selectionMode = spec.kind === "Range"
431
+ ? "range"
432
+ : spec.kind === "List"
433
+ ? "multiple"
434
+ : "single";
285
435
  const isArrayMode = spec.kind === "Range" || spec.kind === "List";
286
436
  return ((0, jsx_runtime_1.jsx)(calendar_1.Calendar, { readOnlyInput: true, showTime: false, disabled: !condition, selectionMode: selectionMode, placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_Calender)
287
437
  ? filterModelText.elementThreePlaceHolder_Calender
@@ -68,10 +68,29 @@ const TableFilter = () => {
68
68
  */
69
69
  const validateNumberValue = (value, condition) => {
70
70
  if (isBetweenCondition(condition)) {
71
- return (Array.isArray(value) &&
72
- value.length > 1 &&
73
- value.every((item) => item !== undefined && item !== null && item !== "") &&
74
- Number(value[1]) > Number(value[0]));
71
+ const normalize = (val) => {
72
+ if (val === null || val === "")
73
+ return null;
74
+ return typeof val === "number" ? val.toString() : val;
75
+ };
76
+ const compareValues = (a, b) => {
77
+ if (a === null || a === undefined)
78
+ return -1;
79
+ if (b === null || b === undefined)
80
+ return 1;
81
+ const x = a.toString().replace(/^0+/, "") || "0";
82
+ const y = b.toString().replace(/^0+/, "") || "0";
83
+ if (x.length > y.length)
84
+ return 1;
85
+ if (x.length < y.length)
86
+ return -1;
87
+ if (x > y)
88
+ return 1;
89
+ if (x < y)
90
+ return -1;
91
+ return 0;
92
+ };
93
+ return (compareValues(normalize((value === null || value === void 0 ? void 0 : value[0]) || null), normalize((value === null || value === void 0 ? void 0 : value[1]) || null)) <= 0);
75
94
  }
76
95
  if (isAnyOrNoneOf(condition)) {
77
96
  return (Array.isArray(value) &&
@@ -206,7 +225,7 @@ const TableFilter = () => {
206
225
  /**
207
226
  * Apply filter conditions to the grid
208
227
  */
209
- const applyAdvancedFilter = (array) => {
228
+ const applyAdvancedFilter = (array, rest) => {
210
229
  const allQueries = array.map((query) => {
211
230
  const column = { code: query.columnName };
212
231
  const operation = query.condition;
@@ -221,7 +240,7 @@ const TableFilter = () => {
221
240
  const currentFeature = Object.assign({}, featureDetails);
222
241
  currentFeature.filterQueries = allQueries;
223
242
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
224
- callGrid(currentFeature);
243
+ !rest && callGrid(currentFeature);
225
244
  return [];
226
245
  };
227
246
  /**
@@ -286,7 +305,7 @@ const TableFilter = () => {
286
305
  * Reset all filters to default state
287
306
  */
288
307
  const onResetFilter = (formSetter) => {
289
- applyAdvancedFilter([]);
308
+ applyAdvancedFilter([], true);
290
309
  const newDefault = Object.assign(Object.assign({}, defaultCondition), { id: Math.random().toString() });
291
310
  setConditionsArray([newDefault]);
292
311
  setViewName("");
@@ -28,13 +28,16 @@ const INITIAL_CHECKBOX_DATA = {
28
28
  };
29
29
  function ParentForGrid(props) {
30
30
  var _a, _b, _c, _d, _e, _f, _g, _h;
31
- const { gridProps = {}, gridViewTemplate, selectColumns = () => { }, enableCheckboxForGroupHeader = false, serverSideSelectRow, blockSize, renderSelectField, renderMultiSelectField } = props;
31
+ const { gridProps = {}, gridViewTemplate, selectColumns = () => { }, enableCheckboxForGroupHeader = false, serverSideSelectRow, blockSize, renderSelectField, renderMultiSelectField, } = props;
32
32
  const effectiveBlockSize = blockSize || constants_1.BLOCK_SIZE;
33
33
  const [gridData, setGridData] = (0, react_1.useState)({
34
34
  rowData: (props === null || props === void 0 ? void 0 : props.rowData) || [],
35
35
  columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData),
36
36
  });
37
- const [gridViewData, setGridViewData] = (0, react_1.useState)({ rowData: [], searchText: "" });
37
+ const [gridViewData, setGridViewData] = (0, react_1.useState)({
38
+ rowData: [],
39
+ searchText: "",
40
+ });
38
41
  const [gridView, setGridView] = (0, react_1.useState)(false);
39
42
  const [isDataLoading, setIsDataLoading] = (0, react_1.useState)(false);
40
43
  // const [style] = useState<Style>(props.style);
@@ -135,7 +138,8 @@ function ParentForGrid(props) {
135
138
  else {
136
139
  setSelectedGroup([]);
137
140
  }
138
- selectColumns && selectColumns(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
141
+ selectColumns &&
142
+ selectColumns(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
139
143
  serverSideRowLeveSelection(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
140
144
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
141
145
  };
@@ -168,7 +172,7 @@ function ParentForGrid(props) {
168
172
  setIsDataLoading(true);
169
173
  try {
170
174
  const response = yield (props === null || props === void 0 ? void 0 : props.getRowData(startRow, endRow, currentFeatures, params));
171
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: [] })));
175
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: [] })));
172
176
  // To identify when to stop the callBack
173
177
  const actualEndRow = (response === null || response === void 0 ? void 0 : response.totalRecords) < constants_1.MAX_RECORDS_TO_LOAD
174
178
  ? response === null || response === void 0 ? void 0 : response.totalRecords
@@ -205,10 +209,16 @@ function ParentForGrid(props) {
205
209
  }
206
210
  (_k = (_j = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) === null || _j === void 0 ? void 0 : _j.api) === null || _k === void 0 ? void 0 : _k.showLoadingOverlay();
207
211
  params && ((_l = params === null || params === void 0 ? void 0 : params.api) === null || _l === void 0 ? void 0 : _l.setGridOption("rowData", []));
208
- const result = gridViewData.rowData.length > 0 ? { rowData: gridViewData.rowData, totalRecords: gridViewData.rowData.length } : yield getData(0, 0, currentFeatures);
212
+ const result = gridViewData.rowData.length > 0
213
+ ? {
214
+ rowData: gridViewData.rowData,
215
+ totalRecords: gridViewData.rowData.length,
216
+ }
217
+ : yield getData(0, 0, currentFeatures);
209
218
  if (((_m = result.rowData) === null || _m === void 0 ? void 0 : _m.length) > 0) {
210
- gridViewData.rowData.length > 0 && setGridViewData({ rowData: [], searchText: "" });
211
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: result.rowData })));
219
+ gridViewData.rowData.length > 0 &&
220
+ setGridViewData({ rowData: [], searchText: "" });
221
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: result.rowData })));
212
222
  gridRef.current && gridRef.current.api.hideOverlay();
213
223
  params && ((_o = params === null || params === void 0 ? void 0 : params.api) === null || _o === void 0 ? void 0 : _o.applyTransaction({ add: result.rowData }));
214
224
  }
@@ -228,10 +238,14 @@ function ParentForGrid(props) {
228
238
  const response = yield getData(startRow, endRow, currentFeatures, params);
229
239
  // simulating real server call with a 500ms delay
230
240
  if (((_q = response.rowData) === null || _q === void 0 ? void 0 : _q.length) > 0) {
231
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: response.rowData })));
241
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: response.rowData })));
232
242
  gridRef.current.api.hideOverlay();
233
243
  // supply rows for requested block to grid
234
- params && params.success({ rowData: response.rowData, rowCount: response.actualEndRow });
244
+ params &&
245
+ params.success({
246
+ rowData: response.rowData,
247
+ rowCount: response.actualEndRow,
248
+ });
235
249
  return;
236
250
  }
237
251
  else {
@@ -320,8 +334,7 @@ function ParentForGrid(props) {
320
334
  GridHeaderComponent, // Header component
321
335
  headerCheckBoxRenderer, //
322
336
  enableCheckboxForGroupHeader, ((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayGroupCount) || false, parseInt(props === null || props === void 0 ? void 0 : props.rowGroupColumnWidth), // for grouped column width
323
- cellRendererConditionally, GroupHeaderRenderer // Custom component for group header
324
- );
337
+ cellRendererConditionally, GroupHeaderRenderer);
325
338
  }
326
339
  else {
327
340
  return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
@@ -330,8 +343,7 @@ function ParentForGrid(props) {
330
343
  GridHeaderComponent, // Header component
331
344
  headerCheckBoxRenderer, //
332
345
  enableCheckboxForGroupHeader, ((_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.displayGroupCount) || false, parseInt(props === null || props === void 0 ? void 0 : props.rowGroupColumnWidth), // for grouped column width
333
- GroupHeaderRenderer // Custom component for group header
334
- );
346
+ GroupHeaderRenderer);
335
347
  }
336
348
  };
337
349
  (0, react_1.useEffect)(() => {
@@ -344,7 +356,7 @@ function ParentForGrid(props) {
344
356
  }
345
357
  if (props === null || props === void 0 ? void 0 : props.rowData) {
346
358
  setTotalRecords(props === null || props === void 0 ? void 0 : props.rowData.length);
347
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: props.rowData })));
359
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: props.rowData })));
348
360
  }
349
361
  if (props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) {
350
362
  (_b = (_a = props === null || props === void 0 ? void 0 : props.getGridRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.api.setGridOption("advancedFilterParent", document.getElementById("advancedFilterParent"));
@@ -357,10 +369,16 @@ function ParentForGrid(props) {
357
369
  }, [props === null || props === void 0 ? void 0 : props.getGridRef]);
358
370
  const gridStyle = (0, react_1.useMemo)(() => {
359
371
  var _a, _b, _c;
360
- return (Object.assign({ width: (_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width }, (totalRecords > constants_1.AUTO_HEIGHT_ROWS || !((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.isGridAutoHeight)
372
+ return (Object.assign({ width: (_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width }, (totalRecords > constants_1.AUTO_HEIGHT_ROWS ||
373
+ !((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.isGridAutoHeight)
361
374
  ? { height: (_c = props === null || props === void 0 ? void 0 : props.style) === null || _c === void 0 ? void 0 : _c.height }
362
375
  : null)));
363
- }, [(_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width, (_b = props === null || props === void 0 ? void 0 : props.style) === null || _b === void 0 ? void 0 : _b.height, totalRecords, (_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.isGridAutoHeight]);
376
+ }, [
377
+ (_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width,
378
+ (_b = props === null || props === void 0 ? void 0 : props.style) === null || _b === void 0 ? void 0 : _b.height,
379
+ totalRecords,
380
+ (_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.isGridAutoHeight,
381
+ ]);
364
382
  // Dont show hide overlay component when any row pinned
365
383
  // useEffect(() => {
366
384
  // if (!props?.pinnedTopRowData) return;
@@ -399,7 +417,10 @@ function ParentForGrid(props) {
399
417
  }
400
418
  }), autoGroupColumnDef: (props === null || props === void 0 ? void 0 : props.autoGroupColumnDef)
401
419
  ? props === null || props === void 0 ? void 0 : props.autoGroupColumnDef
402
- : manageColumnGrouping(), treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false, getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null, defaultColDef: defaultColDef, suppressMenuHide: false, suppressRowClickSelection: false, headerHeight: props === null || props === void 0 ? void 0 : props.columnHeaderHeight, rowHeight: constants_1.ROW_HEIGHT, rowModelType: props.rowModelType, pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData }, (props.rowModelType === (constants_1.ROWMODELTYPE === null || constants_1.ROWMODELTYPE === void 0 ? void 0 : constants_1.ROWMODELTYPE.SERVER_SIDE) && { cacheBlockSize: effectiveBlockSize })), { maxBlocksInCache: effectiveBlockSize, blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL, noRowsOverlayComponent: props === null || props === void 0 ? void 0 : props.noRowsOverlayComponent, loadingOverlayComponent: loading_component_1.default, suppressCellFocus: true, suppressPropertyNamesCheck: true, suppressServerSideFullWidthLoadingRow: true, enableRangeSelection: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.enableFillHandle, enableFillHandle: (_f = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _f === void 0 ? void 0 : _f.enableFillHandle, onFillEnd: wrapperToFillOpertation, fillOperation: myOpertaion, serverSideInitialRowCount: (props === null || props === void 0 ? void 0 : props.serverSideInitialRowCount) || 10, getRowId: getRowId, enableAdvancedFilter: (props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) || false, fillHandleDirection: "y" }), ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), (totalRecords <= constants_1.AUTO_HEIGHT_ROWS && ((_g = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _g === void 0 ? void 0 : _g.isGridAutoHeight)
420
+ : manageColumnGrouping(), treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false, getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null, defaultColDef: defaultColDef, suppressMenuHide: false, suppressRowClickSelection: false, headerHeight: props === null || props === void 0 ? void 0 : props.columnHeaderHeight, rowHeight: constants_1.ROW_HEIGHT, rowModelType: props.rowModelType, pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData }, (props.rowModelType === (constants_1.ROWMODELTYPE === null || constants_1.ROWMODELTYPE === void 0 ? void 0 : constants_1.ROWMODELTYPE.SERVER_SIDE) && {
421
+ cacheBlockSize: effectiveBlockSize,
422
+ })), { maxBlocksInCache: effectiveBlockSize, blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL, noRowsOverlayComponent: props === null || props === void 0 ? void 0 : props.noRowsOverlayComponent, loadingOverlayComponent: loading_component_1.default, suppressCellFocus: true, suppressPropertyNamesCheck: true, suppressServerSideFullWidthLoadingRow: true, enableRangeSelection: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.enableFillHandle, enableFillHandle: (_f = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _f === void 0 ? void 0 : _f.enableFillHandle, onFillEnd: wrapperToFillOpertation, fillOperation: myOpertaion, serverSideInitialRowCount: (props === null || props === void 0 ? void 0 : props.serverSideInitialRowCount) || 10, getRowId: getRowId, enableAdvancedFilter: (props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) || false, fillHandleDirection: "y" }), ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), (totalRecords <= constants_1.AUTO_HEIGHT_ROWS &&
423
+ ((_g = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _g === void 0 ? void 0 : _g.isGridAutoHeight)
403
424
  ? { domLayout: "autoHeight" }
404
425
  : { domLayout: "normal" })), ((props === null || props === void 0 ? void 0 : props.dataTypeDefinitions) && {
405
426
  dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
@@ -538,8 +559,14 @@ function ParentForGrid(props) {
538
559
  }, [
539
560
  props.rowModelType,
540
561
  props === null || props === void 0 ? void 0 : props.quickSearch,
541
- featureDetails, gridData, callGrid,
542
- totalRecords, initialFeature, defaultFilters, defaultSearchText, defaultSort,
562
+ featureDetails,
563
+ gridData,
564
+ callGrid,
565
+ totalRecords,
566
+ initialFeature,
567
+ defaultFilters,
568
+ defaultSearchText,
569
+ defaultSort,
543
570
  props === null || props === void 0 ? void 0 : props.createView,
544
571
  props === null || props === void 0 ? void 0 : props.conditionsToDisplay,
545
572
  props === null || props === void 0 ? void 0 : props.dynamicText,
@@ -548,15 +575,21 @@ function ParentForGrid(props) {
548
575
  props === null || props === void 0 ? void 0 : props.clearFilters,
549
576
  props === null || props === void 0 ? void 0 : props.onFiltersCleared,
550
577
  props === null || props === void 0 ? void 0 : props.updateColumnsForGrid,
551
- props.enableManageColumnsCallback, selectedGroup, initialCheckBoxData,
552
- intialColumns, gridViewFun, gridViewData, gridView,
578
+ props.enableManageColumnsCallback,
579
+ selectedGroup,
580
+ initialCheckBoxData,
581
+ intialColumns,
582
+ gridViewFun,
583
+ gridViewData,
584
+ gridView,
553
585
  props === null || props === void 0 ? void 0 : props.enableAdvancedFilter,
554
586
  props === null || props === void 0 ? void 0 : props.rowData,
555
587
  props.serverSideSelectRow,
556
588
  props === null || props === void 0 ? void 0 : props.defaultViewName,
557
589
  isDataLoading,
558
- renderSelectField, renderMultiSelectField,
590
+ renderSelectField,
591
+ renderMultiSelectField,
559
592
  ]);
560
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ id: "wrapper", style: { height: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.height, width: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.width }, className: `ag-grid-container ag-grid-parent-div ${(props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) ? "hide-advance-filter" : ""}` }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: contextValue }, { children: ((_h = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _h === void 0 ? void 0 : _h.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), gridView ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: gridViewTemplate(gridViewData) }) : (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: gridStyle, gridOptions: gridOptions, onGridReady: (props === null || props === void 0 ? void 0 : props.rowData) ? undefined : onGridReady, gridRef: gridRef })] }) })) }) }));
593
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ id: "wrapper", style: { height: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.height, width: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.width }, className: `ag-grid-container ag-grid-parent-div ${(props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) ? "hide-advance-filter" : ""}` }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: contextValue }, { children: ((_h = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _h === void 0 ? void 0 : _h.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), gridView ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: gridViewTemplate(gridViewData) })) : ((0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: gridStyle, gridOptions: gridOptions, onGridReady: (props === null || props === void 0 ? void 0 : props.rowData) ? undefined : onGridReady, gridRef: gridRef }))] }) })) }) }));
561
594
  }
562
595
  exports.default = ParentForGrid;
@@ -7,9 +7,9 @@ const react_1 = require("react");
7
7
  const context_provider_1 = require("./context-provider");
8
8
  // Render checkbox as well as initial component/data from props
9
9
  const dataCellRenderer = (cellRendererParams, column, props) => {
10
- var _a, _b, _c;
10
+ var _a, _b, _c, _d, _e;
11
11
  const { initialRenderer, cellCheckBoxRenderer } = cellRendererParams;
12
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "inline-flex w-full h-full" }, { children: ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxOnRight) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "custom_class_name flex w-full justify-content-between" }, { children: [typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)("div", { children: (_b = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _b === void 0 ? void 0 : _b[column === null || column === void 0 ? void 0 : column.field] })), cellCheckBoxRenderer(cellRendererParams) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center" }, { children: cellCheckBoxRenderer(cellRendererParams) })))] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [cellCheckBoxRenderer(cellRendererParams) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center" }, { children: cellCheckBoxRenderer(cellRendererParams) }))), typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-3" }, { children: (_c = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _c === void 0 ? void 0 : _c[column === null || column === void 0 ? void 0 : column.field] })))] })) })));
12
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "inline-flex w-full h-full" }, { children: ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxOnRight) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `custom_class_name flex w-full ${((_b = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _b === void 0 ? void 0 : _b[column === null || column === void 0 ? void 0 : column.field]) ? "justify-content-between" : "justify-content-center"}` }, { children: [typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: ((_c = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _c === void 0 ? void 0 : _c[column === null || column === void 0 ? void 0 : column.field]) && ((0, jsx_runtime_1.jsx)("div", { children: (_d = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _d === void 0 ? void 0 : _d[column === null || column === void 0 ? void 0 : column.field] })) })), cellCheckBoxRenderer(cellRendererParams) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center" }, { children: cellCheckBoxRenderer(cellRendererParams) })))] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [cellCheckBoxRenderer(cellRendererParams) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center" }, { children: cellCheckBoxRenderer(cellRendererParams) }))), typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "px-3" }, { children: (_e = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _e === void 0 ? void 0 : _e[column === null || column === void 0 ? void 0 : column.field] })))] })) })));
13
13
  };
14
14
  exports.dataCellRenderer = dataCellRenderer;
15
15
  //Get this compnent from products
@@ -6,9 +6,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const calendar_1 = require("primereact/calendar");
7
7
  const react_1 = require("react");
8
8
  const button_1 = require("primereact/button");
9
+ const dropdown_1 = require("primereact/dropdown");
9
10
  const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
10
11
  const DatePicker = (props) => {
11
12
  const dateRef = (0, react_1.useRef)(null);
13
+ const monthCallCount = (0, react_1.useRef)(0);
14
+ const yearCallCount = (0, react_1.useRef)(0);
15
+ const masterMonthRef = (0, react_1.useRef)(0);
12
16
  const today = new Date();
13
17
  const options = { year: 'numeric', month: 'short', day: 'numeric' };
14
18
  const oneWeekFromToday = new Date(today);
@@ -100,38 +104,89 @@ const DatePicker = (props) => {
100
104
  props.onChange(e);
101
105
  };
102
106
  (0, react_1.useEffect)(() => {
107
+ // Pass through every prop to the underlying PrimeReact Calendar, except
108
+ // the ones this wrapper handles itself (value/onChange/onClear/clear/
109
+ // footerTemplate/iconPos — those are wired explicitly below). This way
110
+ // any PrimeReact Calendar prop (monthNavigator, yearNavigator, yearRange,
111
+ // minDate, viewDate, inline, readOnlyInput, touchUI, showButtonBar, etc.)
112
+ // works without updating the wrapper for each new field.
113
+ const EXCLUDE = new Set([
114
+ 'value', 'onChange', 'onClear', 'clear',
115
+ 'footerTemplate', 'iconPos', 'icon', 'ref',
116
+ ]);
103
117
  const datePickerProps = {};
104
- for (let key in props) {
105
- switch (key) {
106
- case 'iconPos':
107
- // datePickerProps['iconPos'] = props.iconPos
108
- datePickerProps['icon'] = (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: props.icon });
109
- break;
110
- case 'numberOfMonths':
111
- datePickerProps['numberOfMonths'] = props.numberOfMonths;
112
- break;
113
- case 'dateFormat':
114
- datePickerProps['dateFormat'] = props.dateFormat;
115
- break;
116
- case 'selectionMode':
117
- datePickerProps['selectionMode'] = props.selectionMode;
118
- break;
119
- case 'placeholder':
120
- datePickerProps['placeholder'] = props.placeholder;
121
- break;
122
- case 'maxDate':
123
- datePickerProps['maxDate'] = props.maxDate;
124
- break;
125
- case 'className':
126
- datePickerProps['className'] = props.className;
127
- break;
128
- case 'showIcon':
129
- datePickerProps['showIcon'] = true;
130
- break;
131
- }
118
+ for (const key in props) {
119
+ if (EXCLUDE.has(key))
120
+ continue;
121
+ datePickerProps[key] = props[key];
122
+ }
123
+ // Keep the custom SvgComponent icon behaviour for iconPos consumers.
124
+ if (props.iconPos) {
125
+ datePickerProps['icon'] = (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: props.icon });
126
+ }
127
+ if (props.showIcon) {
128
+ datePickerProps['showIcon'] = true;
129
+ }
130
+ // Use PrimeReact's monthNavigator/yearNavigator and render PrimeReact
131
+ // Dropdowns (styled as plain text) so the user can change month/year
132
+ // without switching to a separate picker view. Each navigator template
133
+ // is called once per pane in render order, so we use a render counter
134
+ // to give pane 2 its actual month/year (PrimeReact otherwise reads
135
+ // viewDate.getMonth() for both panes). Consumer values always win.
136
+ if (datePickerProps.monthNavigator === undefined) {
137
+ datePickerProps.monthNavigator = true;
138
+ }
139
+ if (datePickerProps.yearNavigator === undefined) {
140
+ datePickerProps.yearNavigator = true;
141
+ }
142
+ if (datePickerProps.yearRange === undefined) {
143
+ const cy = new Date().getFullYear();
144
+ datePickerProps.yearRange = `${cy - 50}:${cy + 50}`;
145
+ }
146
+ const numberOfMonths = datePickerProps.numberOfMonths || 1;
147
+ if (datePickerProps.monthNavigatorTemplate === undefined) {
148
+ datePickerProps.monthNavigatorTemplate = (e) => {
149
+ const paneIndex = monthCallCount.current % numberOfMonths;
150
+ if (paneIndex === 0)
151
+ masterMonthRef.current = e.value;
152
+ monthCallCount.current++;
153
+ const displayMonth = (e.value + paneIndex) % 12;
154
+ const monthOptions = (e.options || []).map((o) => ({
155
+ label: String(o.label),
156
+ value: o.value,
157
+ }));
158
+ return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { value: displayMonth, options: monthOptions, onChange: (ev) => {
159
+ const newViewMonth = (ev.value - paneIndex + 12) % 12;
160
+ e.onChange(ev.originalEvent, newViewMonth);
161
+ }, className: "date_nav_dropdown date_nav_dropdown--month", style: { width: 'auto', marginRight: '0.25rem' }, appendTo: "self" }));
162
+ };
163
+ }
164
+ if (datePickerProps.yearNavigatorTemplate === undefined) {
165
+ datePickerProps.yearNavigatorTemplate = (e) => {
166
+ const paneIndex = yearCallCount.current % numberOfMonths;
167
+ yearCallCount.current++;
168
+ // Pane 2 rolls into next year only when master month is December.
169
+ const displayYear = paneIndex > 0 && masterMonthRef.current + paneIndex > 11
170
+ ? e.value + 1
171
+ : e.value;
172
+ const yearOptions = (e.options || []).map((o) => {
173
+ const raw = typeof o === 'object' ? o.value : o;
174
+ return { label: String(raw), value: raw };
175
+ });
176
+ return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { value: displayYear, options: yearOptions, onChange: (ev) => {
177
+ const newViewYear = paneIndex > 0 && masterMonthRef.current + paneIndex > 11
178
+ ? ev.value - 1
179
+ : ev.value;
180
+ e.onChange(ev.originalEvent, newViewYear);
181
+ }, className: "date_nav_dropdown date_nav_dropdown--year", style: { width: 'auto' }, appendTo: "self" }));
182
+ };
132
183
  }
184
+ // Reset render counters at start of each render cycle so the modulo
185
+ // pane index stays correct across re-renders.
186
+ monthCallCount.current = 0;
187
+ yearCallCount.current = 0;
133
188
  setPropsState(datePickerProps);
134
- }, []);
189
+ }, [props]);
135
190
  (0, react_1.useEffect)(() => {
136
191
  if (props.value !== undefined) {
137
192
  if (props.value === null) {
@@ -279,6 +279,7 @@ export interface ListBoxDropdownTypes {
279
279
  export interface DatePickerTypes {
280
280
  value: any;
281
281
  maxDate?: any;
282
+ minDate?: any;
282
283
  showIcon?: any;
283
284
  clear?: string;
284
285
  iconPos?: string;
@@ -294,6 +295,14 @@ export interface DatePickerTypes {
294
295
  touchUI?: any;
295
296
  todayButtonClassName?: any;
296
297
  showButtonBar?: any;
298
+ monthNavigator?: boolean;
299
+ yearNavigator?: boolean;
300
+ yearRange?: string;
301
+ viewDate?: any;
302
+ readOnlyInput?: boolean;
303
+ inline?: boolean;
304
+ disabled?: boolean;
305
+ [key: string]: any;
297
306
  }
298
307
  export interface ScMultiSelectTypes {
299
308
  optionLabel: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.5.24",
3
+ "version": "6.5.26",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",