rd-outer-component 0.0.27 → 0.0.28
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/esm2020/lib/modules/task-base/index.mjs +3 -0
- package/esm2020/lib/modules/task-base/task-base.component.mjs +97 -0
- package/esm2020/lib/modules/task-base/task-base.type.mjs +2 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/rd-outer-component.mjs +98 -1
- package/fesm2015/rd-outer-component.mjs.map +1 -1
- package/fesm2020/rd-outer-component.mjs +97 -1
- package/fesm2020/rd-outer-component.mjs.map +1 -1
- package/lib/modules/task-base/index.d.ts +2 -0
- package/lib/modules/task-base/task-base.component.d.ts +26 -0
- package/lib/modules/task-base/task-base.type.d.ts +36 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1808,6 +1808,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1808
1808
|
}]
|
|
1809
1809
|
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
1810
1810
|
|
|
1811
|
+
class SearchListBaseComponent {
|
|
1812
|
+
constructor(searchStorageKey = '', isOutDatePicker = false) {
|
|
1813
|
+
this.searchStorageKey = searchStorageKey;
|
|
1814
|
+
this.isOutDatePicker = isOutDatePicker;
|
|
1815
|
+
this.defSearch = '';
|
|
1816
|
+
this.isFilter = false;
|
|
1817
|
+
this.searchTerms = new Subject();
|
|
1818
|
+
this.defSearchKey = 'defSearch';
|
|
1819
|
+
this.filterArr = [];
|
|
1820
|
+
this.paginationParams = {
|
|
1821
|
+
pageSize: 10,
|
|
1822
|
+
pageNumber: 1,
|
|
1823
|
+
totalRecords: 0,
|
|
1824
|
+
totalPages: 0,
|
|
1825
|
+
};
|
|
1826
|
+
this.currentSorters = [];
|
|
1827
|
+
}
|
|
1828
|
+
getSortedParam() {
|
|
1829
|
+
return this.currentSorters;
|
|
1830
|
+
}
|
|
1831
|
+
handleRestoreLastRequest() {
|
|
1832
|
+
const searchParams = sessionStorage.getItem(this.searchStorageKey);
|
|
1833
|
+
if (searchParams) {
|
|
1834
|
+
let advancedFilterArr = JSON.parse(searchParams);
|
|
1835
|
+
this.defSearch = advancedFilterArr.find((item) => item.key === this.defSearchKey)?.value;
|
|
1836
|
+
this.paginationParams.pageNumber = advancedFilterArr.find((item) => item.key === 'pageNumber')?.value;
|
|
1837
|
+
this.paginationParams.pageSize = advancedFilterArr.find((item) => item.key === 'pageSize')?.value;
|
|
1838
|
+
if (advancedFilterArr.length >= 4) {
|
|
1839
|
+
this.isFilter = true;
|
|
1840
|
+
advancedFilterArr.forEach((storage) => {
|
|
1841
|
+
this.filterArr.forEach((item) => {
|
|
1842
|
+
if (item.key === storage.key) {
|
|
1843
|
+
item.value = storage.value;
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
return advancedFilterArr;
|
|
1849
|
+
}
|
|
1850
|
+
return [];
|
|
1851
|
+
}
|
|
1852
|
+
handleAdvancedFilterArrStorage(storageArr = []) {
|
|
1853
|
+
this.filterArr.forEach((item) => {
|
|
1854
|
+
if (item.value) {
|
|
1855
|
+
storageArr.push({ key: item.key, value: item.value });
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
storageArr.push({ key: this.defSearchKey, value: this.defSearch || '' });
|
|
1859
|
+
storageArr.push({
|
|
1860
|
+
key: 'pageNumber',
|
|
1861
|
+
value: this.paginationParams.pageNumber,
|
|
1862
|
+
});
|
|
1863
|
+
storageArr.push({ key: 'pageSize', value: this.paginationParams.pageSize });
|
|
1864
|
+
sessionStorage.setItem(this.searchStorageKey, JSON.stringify(storageArr));
|
|
1865
|
+
}
|
|
1866
|
+
filterSearchChange() {
|
|
1867
|
+
this.searchTerms.next({
|
|
1868
|
+
page: this.paginationParams.pageNumber,
|
|
1869
|
+
pageSize: this.paginationParams.pageSize,
|
|
1870
|
+
filtered: this.getFilterParam(),
|
|
1871
|
+
sorted: this.currentSorters,
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
nzPageSizeChange(size) {
|
|
1875
|
+
this.paginationParams.pageNumber = 1;
|
|
1876
|
+
this.paginationParams.pageSize = size;
|
|
1877
|
+
this.filterSearchChange();
|
|
1878
|
+
}
|
|
1879
|
+
nzPageIndexChange(index) {
|
|
1880
|
+
this.paginationParams.pageNumber = index;
|
|
1881
|
+
this.filterSearchChange();
|
|
1882
|
+
}
|
|
1883
|
+
onQueryParamsChange(params) {
|
|
1884
|
+
this.currentSorters = params.sort
|
|
1885
|
+
.filter((item) => item.value)
|
|
1886
|
+
.map((item) => ({
|
|
1887
|
+
id: item.key,
|
|
1888
|
+
desc: item.value === 'descend' ? true : false,
|
|
1889
|
+
}));
|
|
1890
|
+
this.searchTerms.next({
|
|
1891
|
+
page: this.paginationParams.pageNumber,
|
|
1892
|
+
pageSize: this.paginationParams.pageSize,
|
|
1893
|
+
filtered: this.getFilterParam(),
|
|
1894
|
+
sorted: this.currentSorters,
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
defSearchChange(keyword = '') {
|
|
1898
|
+
this.defSearch = keyword;
|
|
1899
|
+
this.paginationParams.pageNumber = 1;
|
|
1900
|
+
this.filterSearchChange();
|
|
1901
|
+
}
|
|
1902
|
+
refreshPage() {
|
|
1903
|
+
this.nzPageIndexChange(1);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1811
1907
|
class BigNumberPipe {
|
|
1812
1908
|
transform(value, precision = 6, mode = 'cut') {
|
|
1813
1909
|
if (!value)
|
|
@@ -1890,5 +1986,5 @@ function DebounceSearch(milliseconds = 300, queryMinLength = 0, queryMaxLength)
|
|
|
1890
1986
|
* Generated bundle index. Do not edit.
|
|
1891
1987
|
*/
|
|
1892
1988
|
|
|
1893
|
-
export { BigNumberPipe, CustomCheckboxComponent, CustomDateComponent, CustomInputAmountComponent, CustomInputComponent, CustomPaginatorComponent, CustomRadioComponent, CustomSelectComponent, CustomTextareaComponent, DebounceSearch, FilterTypeEnum, HeaderStepComponent, PipesModule, PureSelectTokenComponent, RdCheckboxModule, RdDateModule, RdFilterComponent, RdFilterModule, RdHeaderStepModule, RdInputAmountModule, RdInputModule, RdNotificationComponent, RdNotificationModule, RdNotificationService, RdPaginatorModule, RdPureSelectTokenModule, RdRadioModule, RdSelectModule, RdStatusFieldModule, RdTextareaModule, StatusFieldComponent };
|
|
1989
|
+
export { BigNumberPipe, CustomCheckboxComponent, CustomDateComponent, CustomInputAmountComponent, CustomInputComponent, CustomPaginatorComponent, CustomRadioComponent, CustomSelectComponent, CustomTextareaComponent, DebounceSearch, FilterTypeEnum, HeaderStepComponent, PipesModule, PureSelectTokenComponent, RdCheckboxModule, RdDateModule, RdFilterComponent, RdFilterModule, RdHeaderStepModule, RdInputAmountModule, RdInputModule, RdNotificationComponent, RdNotificationModule, RdNotificationService, RdPaginatorModule, RdPureSelectTokenModule, RdRadioModule, RdSelectModule, RdStatusFieldModule, RdTextareaModule, SearchListBaseComponent, StatusFieldComponent };
|
|
1894
1990
|
//# sourceMappingURL=rd-outer-component.mjs.map
|