File tree Expand file tree Collapse file tree 9 files changed +36
-17
lines changed
Expand file tree Collapse file tree 9 files changed +36
-17
lines changed Original file line number Diff line number Diff line change 1+ ## 0.0.93
2+
3+ - Fix ` revertSearchField ` prop in ` Select ` component
4+ - Add ` nullDash ` prop for ` Table ` component
5+ - Exclude ` reloadDataAfterSaveForm ` prop from ` Form ` component to prevent console Errors
6+
17## 0.0.92
28
39- ` revertSearchField ` clears inner input ` Select `
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ const excludeProps = [
2020 "loadInitData" ,
2121 "requestSaveForm" ,
2222 "methodSaveForm" ,
23- "processBeforeSaveForm"
23+ "processBeforeSaveForm" ,
24+ "reloadDataAfterSaveForm"
2425] ;
2526
2627/** Компонент заголовка формы */
Original file line number Diff line number Diff line change @@ -90,10 +90,6 @@ const Select = props => {
9090 searchValue : defaultSearchValue ,
9191 reload : true
9292 } ) ;
93- } , [ ] ) ;
94-
95- useEffect ( ( ) => {
96- _setSearchValue ( '' ) ;
9793 } , [ revertSearchValue ] ) ;
9894
9995 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ const defaultProps = {
99 expandColumnKey : undefined ,
1010 expandLazyLoad : false ,
1111 expandParentKey : "parentId" ,
12- customColumnProps : [ ]
12+ customColumnProps : [ ] ,
13+ nullDash : "---" ,
1314} ;
1415
1516const ConfigLoader = props => {
@@ -29,7 +30,8 @@ const ConfigLoader = props => {
2930 customColumnProps,
3031 // cellBordered,
3132 fixWidthColumn,
32- selectable
33+ selectable,
34+ nullDash
3335 } = { ...defaultProps , ...props } ;
3436
3537 useEffect ( ( ) => {
@@ -122,7 +124,7 @@ const ConfigLoader = props => {
122124 rowData = { rowData }
123125 rowIndex = { rowIndex } /> ;
124126 else
125- return item . typeData === "json" ? JSON . stringify ( cellData ) : cellData ? cellData : "---" ;
127+ return item . typeData === "json" ? JSON . stringify ( cellData ) : cellData ? cellData : nullDash ;
126128 } ;
127129 _columns . push ( column ) ;
128130 } ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const excludeProps = [
3232 "searchParamName" ,
3333 "onRowClick" ,
3434 "onRowDoubleClick" ,
35+ "nullDash" ,
3536] ;
3637
3738const Table = props => {
@@ -796,6 +797,9 @@ Table.propTypes = {
796797 /** Значение строки поиска по умолчанию строк */
797798 defaultSearchValue : PropTypes . string ,
798799
800+ /** Содержимое ячейки при значении null */
801+ nullDash : PropTypes . oneOfType ( [ PropTypes . element , PropTypes . string ] ) ,
802+
799803 /** Объект фильтрации по умолчанию */
800804 defaultFilter : PropTypes . object ,
801805
@@ -1064,6 +1068,7 @@ Table.defaultProps = {
10641068 sortBy : { } ,
10651069
10661070 rowKey : "id" ,
1071+ nullDash : "---" ,
10671072
10681073 empty : empty ,
10691074 overlay : overlay ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const defaultProps = {
1212 expandLazyLoad : false ,
1313 expandParentKey : 'parentId' ,
1414 customColumnProps : [ ] ,
15+ nullDash : '---' ,
1516} ;
1617
1718const ConfigLoader = props => {
@@ -30,6 +31,7 @@ const ConfigLoader = props => {
3031 expandParentKey,
3132 customColumnProps,
3233 cellBordered,
34+ nullDash,
3335 } = { ...defaultProps , ...props } ;
3436
3537 useEffect ( ( ) => {
@@ -87,12 +89,12 @@ const ConfigLoader = props => {
8789 cellRenderer : ( object ) => {
8890 if ( colProps && colProps . cellRenderer )
8991 return < colProps . cellRenderer { ...object } />
90- // return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : '---' ;
92+ // return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : nullDash ;
9193 else
9294 return object . cellData
9395 ? < Typography . Text ellipsis = { true } style = { { width : '100%' } } className = { 'rt-table-cell' } > { object . cellData } </ Typography . Text >
94- : < Typography . Text ellipsis = { true } style = { { width : '100%' } } className = { 'rt-table-cell' } > --- </ Typography . Text > ;
95- // return object.cellData ? object.cellData : '---' ;
96+ : < Typography . Text ellipsis = { true } style = { { width : '100%' } } className = { 'rt-table-cell' } > { nullDash } </ Typography . Text > ;
97+ // return object.cellData ? object.cellData : nullDash ;
9698 } ,
9799 } ) ;
98100 } ) ;
Original file line number Diff line number Diff line change @@ -1184,6 +1184,9 @@ Table.propTypes = {
11841184 /** Вывод когда нет данных */
11851185 empty : PropTypes . element ,
11861186
1187+ /** Содержимое ячейки при значении null */
1188+ nullDash : PropTypes . oneOfType ( [ PropTypes . element , PropTypes . string ] ) ,
1189+
11871190 /** Отображение загрузки данных */
11881191 overlay : PropTypes . element ,
11891192
@@ -1357,6 +1360,7 @@ Table.defaultProps = {
13571360 rowKey : "id" ,
13581361
13591362 empty : empty ,
1363+ nullDash : "---" ,
13601364 overlay : overlay ,
13611365 fixWidthColumn : false ,
13621366 footerProps : {
Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ export interface TableProps {
9595
9696 /** Вывод когда нет данных */
9797 empty ?: ReactNode ;
98+ /** Вывод при значении ячейки null */
99+ nullDash ?: string | ReactNode ;
98100 /** Отображение загрузки данных */
99101 overlay ?: ReactNode ;
100102 /** Фиксированная ширина столбцов. Появится боковой скрол */
@@ -107,11 +109,11 @@ export interface TableProps {
107109 /** Массив элементов футтера, которые надо отобразить
108110 * ['selected', 'loaded', 'total'] */
109111 showElements ?: string [ ] ;
110- /** Заколовок для кол-ва выбранных объектов */
112+ /** Заголовок для кол-ва выбранных объектов */
111113 selectedTitle ?: string ;
112- /** Заколовок для кол-ва загруженны объектов */
114+ /** Заголовок для кол-ва загруженных объектов */
113115 loadedTitle ?: string ;
114- /** Заколовок для кол-ва всего объектов */
116+ /** Заголовок для кол-ва всего объектов */
115117 totalTitle ?: string ;
116118 /** Левый кастомный элемент командной панели */
117119 leftCustomSideElement ?: React . ComponentType | any [ ] | ReactNode ,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const AdvancedTable = forwardRef((props, ref) => {
1717 pageSize,
1818 rowKey,
1919 requestLoadConfig,
20+ nullDash,
2021 } = props ;
2122
2223 useEffect ( ( ) => {
@@ -67,12 +68,12 @@ const AdvancedTable = forwardRef((props, ref) => {
6768 cellRenderer : ( object ) => {
6869 if ( colProps && colProps . cellRenderer )
6970 return < colProps . cellRenderer { ...object } />
70- // return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : '---' ;
71+ // return colProps.cellRenderer(object) ? colProps.cellRenderer(object) : nullDash ;
7172 else
7273 return object . cellData
7374 ? < Typography . Text ellipsis = { true } style = { { width : '100%' } } className = { 'rt-table-cell' } > { object . cellData } </ Typography . Text >
74- : < Typography . Text ellipsis = { true } style = { { width : '100%' } } className = { 'rt-table-cell' } > --- </ Typography . Text > ;
75- // return object.cellData ? object.cellData : '---' ;
75+ : < Typography . Text ellipsis = { true } style = { { width : '100%' } } className = { 'rt-table-cell' } > { nullDash } </ Typography . Text > ;
76+ // return object.cellData ? object.cellData : nullDash ;
7677 } ,
7778 } ;
7879 } ) ;
You can’t perform that action at this time.
0 commit comments