venice-ui 3.0.43 → 3.0.44
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.
|
@@ -61,7 +61,8 @@ const Filters = ({ theme, themeVariant = 'default', size = 'md', labels = {
|
|
|
61
61
|
const resolvedTheme = resolvedThemeData.resolvedTheme;
|
|
62
62
|
const { componentsConfig } = resolvedThemeData;
|
|
63
63
|
const filterConfig = componentsConfig.filters;
|
|
64
|
-
console.log('
|
|
64
|
+
console.log('--------');
|
|
65
|
+
console.log('filter fullElements', fullElements);
|
|
65
66
|
// const normalizeDateValue = useCallback(
|
|
66
67
|
// (rawValue: any): number | undefined => {
|
|
67
68
|
// if (rawValue === undefined || rawValue === null || rawValue === '') {
|
|
@@ -77,7 +78,12 @@ const Filters = ({ theme, themeVariant = 'default', size = 'md', labels = {
|
|
|
77
78
|
// },
|
|
78
79
|
// [],
|
|
79
80
|
// )
|
|
80
|
-
const [source,
|
|
81
|
+
const [source, _setSource] = (0, react_1.useState)(fullElements || []);
|
|
82
|
+
const sourceRef = (0, react_1.useRef)(source);
|
|
83
|
+
const setSource = (data) => {
|
|
84
|
+
sourceRef.current = data;
|
|
85
|
+
_setSource(data);
|
|
86
|
+
};
|
|
81
87
|
(0, react_1.useEffect)(() => {
|
|
82
88
|
setSource(fullElements || []);
|
|
83
89
|
}, [fullElements]);
|
|
@@ -141,7 +147,7 @@ const Filters = ({ theme, themeVariant = 'default', size = 'md', labels = {
|
|
|
141
147
|
collapsible: true,
|
|
142
148
|
};
|
|
143
149
|
}
|
|
144
|
-
if (type === 'select') {
|
|
150
|
+
if (type === 'select' && h.name === 'joint_name') {
|
|
145
151
|
console.log('scope', values);
|
|
146
152
|
}
|
|
147
153
|
return {
|
|
@@ -360,13 +366,7 @@ const Filters = ({ theme, themeVariant = 'default', size = 'md', labels = {
|
|
|
360
366
|
handleSubmitFilters &&
|
|
361
367
|
handleSubmitFilters((source && source.length ? source : elements) || []);
|
|
362
368
|
}
|
|
363
|
-
}, [
|
|
364
|
-
externalClearSignal,
|
|
365
|
-
clearAll,
|
|
366
|
-
handleSubmitFilters,
|
|
367
|
-
source,
|
|
368
|
-
elements,
|
|
369
|
-
]);
|
|
369
|
+
}, [externalClearSignal, clearAll, handleSubmitFilters, source, elements]);
|
|
370
370
|
const mapListItems = (0, react_1.useCallback)((filterName, allowValues) => {
|
|
371
371
|
const sel = (activeFilters[filterName]?.value || []).map(String);
|
|
372
372
|
return (allowValues || []).map((v) => ({
|
|
@@ -48,6 +48,7 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
|
|
|
48
48
|
name: '',
|
|
49
49
|
order: 'none',
|
|
50
50
|
}, pageSize = 20, moreActions = [], onRowClick, filterLabels, paginationCounters, tableHeight, tableWrapperHeight, paginationLabel, calendarLabels, calendarLocaleLabels, paginationZIndex, }) => {
|
|
51
|
+
console.log('=====================');
|
|
51
52
|
const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
|
|
52
53
|
theme,
|
|
53
54
|
themeVariant,
|
|
@@ -57,6 +58,7 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
|
|
|
57
58
|
const tableConfig = componentsConfig.table;
|
|
58
59
|
const initialElementsRef = (0, react_1.useRef)(null);
|
|
59
60
|
(0, react_1.useEffect)(() => {
|
|
61
|
+
console.log('zmiana eleemnts detect', elements);
|
|
60
62
|
if (!initialElementsRef.current &&
|
|
61
63
|
Array.isArray(elements) &&
|
|
62
64
|
elements.length > 0) {
|
|
@@ -141,6 +143,8 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
|
|
|
141
143
|
setCurrentPage(1);
|
|
142
144
|
setNoResultsMessage(null);
|
|
143
145
|
}, [elements, setCurrentPage, setNoResultsMessage]);
|
|
146
|
+
console.log('table Elements', elements);
|
|
147
|
+
console.log('initialElementsRef', initialElementsRef.current);
|
|
144
148
|
const tableElements = (0, react_1.useMemo)(() => {
|
|
145
149
|
if (pagination) {
|
|
146
150
|
return paginatedElements;
|
|
@@ -25,7 +25,8 @@ export const Filters = ({ theme, themeVariant = 'default', size = 'md', labels =
|
|
|
25
25
|
const resolvedTheme = resolvedThemeData.resolvedTheme;
|
|
26
26
|
const { componentsConfig } = resolvedThemeData;
|
|
27
27
|
const filterConfig = componentsConfig.filters;
|
|
28
|
-
console.log('
|
|
28
|
+
console.log('--------');
|
|
29
|
+
console.log('filter fullElements', fullElements);
|
|
29
30
|
// const normalizeDateValue = useCallback(
|
|
30
31
|
// (rawValue: any): number | undefined => {
|
|
31
32
|
// if (rawValue === undefined || rawValue === null || rawValue === '') {
|
|
@@ -41,7 +42,12 @@ export const Filters = ({ theme, themeVariant = 'default', size = 'md', labels =
|
|
|
41
42
|
// },
|
|
42
43
|
// [],
|
|
43
44
|
// )
|
|
44
|
-
const [source,
|
|
45
|
+
const [source, _setSource] = useState(fullElements || []);
|
|
46
|
+
const sourceRef = useRef(source);
|
|
47
|
+
const setSource = (data) => {
|
|
48
|
+
sourceRef.current = data;
|
|
49
|
+
_setSource(data);
|
|
50
|
+
};
|
|
45
51
|
useEffect(() => {
|
|
46
52
|
setSource(fullElements || []);
|
|
47
53
|
}, [fullElements]);
|
|
@@ -105,7 +111,7 @@ export const Filters = ({ theme, themeVariant = 'default', size = 'md', labels =
|
|
|
105
111
|
collapsible: true,
|
|
106
112
|
};
|
|
107
113
|
}
|
|
108
|
-
if (type === 'select') {
|
|
114
|
+
if (type === 'select' && h.name === 'joint_name') {
|
|
109
115
|
console.log('scope', values);
|
|
110
116
|
}
|
|
111
117
|
return {
|
|
@@ -324,13 +330,7 @@ export const Filters = ({ theme, themeVariant = 'default', size = 'md', labels =
|
|
|
324
330
|
handleSubmitFilters &&
|
|
325
331
|
handleSubmitFilters((source && source.length ? source : elements) || []);
|
|
326
332
|
}
|
|
327
|
-
}, [
|
|
328
|
-
externalClearSignal,
|
|
329
|
-
clearAll,
|
|
330
|
-
handleSubmitFilters,
|
|
331
|
-
source,
|
|
332
|
-
elements,
|
|
333
|
-
]);
|
|
333
|
+
}, [externalClearSignal, clearAll, handleSubmitFilters, source, elements]);
|
|
334
334
|
const mapListItems = useCallback((filterName, allowValues) => {
|
|
335
335
|
const sel = (activeFilters[filterName]?.value || []).map(String);
|
|
336
336
|
return (allowValues || []).map((v) => ({
|
|
@@ -12,6 +12,7 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
|
|
|
12
12
|
name: '',
|
|
13
13
|
order: 'none',
|
|
14
14
|
}, pageSize = 20, moreActions = [], onRowClick, filterLabels, paginationCounters, tableHeight, tableWrapperHeight, paginationLabel, calendarLabels, calendarLocaleLabels, paginationZIndex, }) => {
|
|
15
|
+
console.log('=====================');
|
|
15
16
|
const resolvedThemeData = resolveThemeWithComponentsConfig({
|
|
16
17
|
theme,
|
|
17
18
|
themeVariant,
|
|
@@ -21,6 +22,7 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
|
|
|
21
22
|
const tableConfig = componentsConfig.table;
|
|
22
23
|
const initialElementsRef = useRef(null);
|
|
23
24
|
useEffect(() => {
|
|
25
|
+
console.log('zmiana eleemnts detect', elements);
|
|
24
26
|
if (!initialElementsRef.current &&
|
|
25
27
|
Array.isArray(elements) &&
|
|
26
28
|
elements.length > 0) {
|
|
@@ -105,6 +107,8 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
|
|
|
105
107
|
setCurrentPage(1);
|
|
106
108
|
setNoResultsMessage(null);
|
|
107
109
|
}, [elements, setCurrentPage, setNoResultsMessage]);
|
|
110
|
+
console.log('table Elements', elements);
|
|
111
|
+
console.log('initialElementsRef', initialElementsRef.current);
|
|
108
112
|
const tableElements = useMemo(() => {
|
|
109
113
|
if (pagination) {
|
|
110
114
|
return paginatedElements;
|