sccoreui 6.5.23 → 6.5.25
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 +1 -1
- package/dist/App.scss +102 -0
- package/dist/assets/sccoreui.css +4 -4
- package/dist/components/ag-grid/advancedFeature/global-search.js +1 -0
- package/dist/components/ag-grid/advancedFeature/new-filter/table-filter.js +2 -1
- package/dist/components/ag-grid/context-provider.js +2 -1
- package/dist/components/ag-grid/parent-for-grid.js +3 -2
- package/dist/components/ag-grid/utilComponents.js +2 -2
- package/dist/components/date-picker/date-picker.js +84 -29
- package/dist/types/components/ag-grid/context-provider.d.ts +1 -0
- package/dist/types/components/types/type.d.ts +9 -0
- package/package.json +1 -1
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 (
|
|
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;
|
package/dist/assets/sccoreui.css
CHANGED
|
@@ -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
|
-
|
|
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;
|
|
@@ -13,6 +13,7 @@ const skeleton_1 = require("primereact/skeleton");
|
|
|
13
13
|
function Search({ searchPlaceHolder }) {
|
|
14
14
|
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, inputValue, deboucedValue, setInputValue } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
15
15
|
const isDisabled = (0, helper_1.isComponentDisable)(conditionsToDisplay.displaySearch);
|
|
16
|
+
console.log(deboucedValue, inputValue, "input-data-values");
|
|
16
17
|
(0, react_1.useEffect)(() => {
|
|
17
18
|
var _a, _b, _c;
|
|
18
19
|
if (rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE && quickSearch) {
|
|
@@ -28,7 +28,7 @@ const form_1 = tslib_1.__importDefault(require("../../../form/form"));
|
|
|
28
28
|
*/
|
|
29
29
|
const TableFilter = () => {
|
|
30
30
|
// Context values for filter state management
|
|
31
|
-
const { featureDetails, columnData, conditionType, conditionTypes, globalFilters, setConditionType, setGlobalFilters, setFeatureDetails, callGrid, setViewName, viewName, createView, enableViewCreate, filterModelText, enableAdvancedFilter, gridApi, conditionsToDisplay, renderSelectField, renderMultiSelectField, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
31
|
+
const { featureDetails, columnData, conditionType, conditionTypes, globalFilters, setConditionType, setGlobalFilters, setFeatureDetails, callGrid, setViewName, viewName, createView, enableViewCreate, filterModelText, enableAdvancedFilter, gridApi, conditionsToDisplay, renderSelectField, renderMultiSelectField, onFiltersCleared, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
32
32
|
// Form reference for validation
|
|
33
33
|
const formRef = (0, react_1.useRef)(null);
|
|
34
34
|
// Column mapping keys
|
|
@@ -292,6 +292,7 @@ const TableFilter = () => {
|
|
|
292
292
|
setViewName("");
|
|
293
293
|
formSetter === null || formSetter === void 0 ? void 0 : formSetter("conditions", [newDefault]);
|
|
294
294
|
formSetter === null || formSetter === void 0 ? void 0 : formSetter("viewName", "");
|
|
295
|
+
onFiltersCleared === null || onFiltersCleared === void 0 ? void 0 : onFiltersCleared();
|
|
295
296
|
};
|
|
296
297
|
/**
|
|
297
298
|
* Create a saved view from current filter configuration
|
|
@@ -9,7 +9,7 @@ const hooks_1 = require("primereact/hooks");
|
|
|
9
9
|
const constants_1 = tslib_1.__importDefault(require("./constants"));
|
|
10
10
|
exports.FeatureContext = (0, react_1.createContext)(null);
|
|
11
11
|
function MyProvider({ children, value }) {
|
|
12
|
-
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, defaultSearchText, defaultSort, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns, rowModelType, quickSearch, enableAdvancedFilter, conditionsToDisplay, gridViewFun, gridViewData, setGridViewData, gridView, serverSideSelectRow, defaultViewName, isDataLoading,
|
|
12
|
+
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, defaultSearchText, defaultSort, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, onFiltersCleared, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns, rowModelType, quickSearch, enableAdvancedFilter, conditionsToDisplay, gridViewFun, gridViewData, setGridViewData, gridView, serverSideSelectRow, defaultViewName, isDataLoading,
|
|
13
13
|
// dynamicText
|
|
14
14
|
renderSelectField, renderMultiSelectField, } = value;
|
|
15
15
|
// States for sort
|
|
@@ -185,6 +185,7 @@ function MyProvider({ children, value }) {
|
|
|
185
185
|
gridView,
|
|
186
186
|
inputValue, deboucedValue, setInputValue, serverSideSelectRow, isDataLoading,
|
|
187
187
|
renderSelectField, renderMultiSelectField,
|
|
188
|
+
onFiltersCleared,
|
|
188
189
|
} }, { children: children })));
|
|
189
190
|
}
|
|
190
191
|
exports.default = MyProvider;
|
|
@@ -445,7 +445,7 @@ function ParentForGrid(props) {
|
|
|
445
445
|
const newFilterQueries = ((_a = props === null || props === void 0 ? void 0 : props.defaultFilters) === null || _a === void 0 ? void 0 : _a.length)
|
|
446
446
|
? (0, helper_1.applyDefaultFilters)(props.defaultFilters)
|
|
447
447
|
: [];
|
|
448
|
-
const newSearchText = (props === null || props === void 0 ? void 0 : props.defaultSearchText) || "";
|
|
448
|
+
const newSearchText = (props === null || props === void 0 ? void 0 : props.defaultSearchText) || featureDetails.searchedText || "";
|
|
449
449
|
const currentFeature = Object.assign(Object.assign({}, featureDetails), { filterQueries: newFilterQueries, searchedText: newSearchText });
|
|
450
450
|
setDefaultFilters((props === null || props === void 0 ? void 0 : props.defaultFilters) || []);
|
|
451
451
|
setDefaultSearchText(newSearchText);
|
|
@@ -528,7 +528,7 @@ function ParentForGrid(props) {
|
|
|
528
528
|
initialFeature,
|
|
529
529
|
defaultFilters,
|
|
530
530
|
defaultSearchText,
|
|
531
|
-
defaultSort, createView: props === null || props === void 0 ? void 0 : props.createView, enableViewCreate: (_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.enableViewCreate, filterModelText: (_b = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _b === void 0 ? void 0 : _b.filterModelText, sortModelText: (_c = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _c === void 0 ? void 0 : _c.sortModelText, recordDetailModelText: (_d = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _d === void 0 ? void 0 : _d.recordDetailModelText, sidePanelText: (_e = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _e === void 0 ? void 0 : _e.sidePanelText, sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions) ? props.sortOptions : constants_1.COLUMN_SORT_OPTIONS, filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions, clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters, setGridData, gridApi: gridRef, updateColumnsForGrid: props === null || props === void 0 ? void 0 : props.updateColumnsForGrid, enableManageColumnsCallback: props.enableManageColumnsCallback, columnToRender: gridData.columnData, selectedGroup: selectedGroup, setSelectedGroup: setSelectedGroup, initialCheckBoxData: initialCheckBoxData, intialColumns,
|
|
531
|
+
defaultSort, createView: props === null || props === void 0 ? void 0 : props.createView, enableViewCreate: (_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.enableViewCreate, filterModelText: (_b = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _b === void 0 ? void 0 : _b.filterModelText, sortModelText: (_c = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _c === void 0 ? void 0 : _c.sortModelText, recordDetailModelText: (_d = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _d === void 0 ? void 0 : _d.recordDetailModelText, sidePanelText: (_e = props === null || props === void 0 ? void 0 : props.dynamicText) === null || _e === void 0 ? void 0 : _e.sidePanelText, sortOptions: (props === null || props === void 0 ? void 0 : props.sortOptions) ? props.sortOptions : constants_1.COLUMN_SORT_OPTIONS, filterConditions: props === null || props === void 0 ? void 0 : props.filterConditions, clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters, onFiltersCleared: props === null || props === void 0 ? void 0 : props.onFiltersCleared, setGridData, gridApi: gridRef, updateColumnsForGrid: props === null || props === void 0 ? void 0 : props.updateColumnsForGrid, enableManageColumnsCallback: props.enableManageColumnsCallback, columnToRender: gridData.columnData, selectedGroup: selectedGroup, setSelectedGroup: setSelectedGroup, initialCheckBoxData: initialCheckBoxData, intialColumns,
|
|
532
532
|
setIntialColumns,
|
|
533
533
|
gridViewFun,
|
|
534
534
|
gridViewData,
|
|
@@ -546,6 +546,7 @@ function ParentForGrid(props) {
|
|
|
546
546
|
props === null || props === void 0 ? void 0 : props.sortOptions,
|
|
547
547
|
props === null || props === void 0 ? void 0 : props.filterConditions,
|
|
548
548
|
props === null || props === void 0 ? void 0 : props.clearFilters,
|
|
549
|
+
props === null || props === void 0 ? void 0 : props.onFiltersCleared,
|
|
549
550
|
props === null || props === void 0 ? void 0 : props.updateColumnsForGrid,
|
|
550
551
|
props.enableManageColumnsCallback, selectedGroup, initialCheckBoxData,
|
|
551
552
|
intialColumns, gridViewFun, gridViewData, gridView,
|
|
@@ -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:
|
|
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 (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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) {
|
|
@@ -21,6 +21,7 @@ interface MyProviderProps {
|
|
|
21
21
|
sortOptions: any[];
|
|
22
22
|
filterConditions: FilterCondition[];
|
|
23
23
|
clearFilters: Boolean;
|
|
24
|
+
onFiltersCleared?: () => void;
|
|
24
25
|
setGridData: (GridData: any) => void;
|
|
25
26
|
gridApi: any;
|
|
26
27
|
updateColumnsForGrid: (columns: ColumnDef) => void;
|
|
@@ -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;
|