@gobolt/genesis 0.4.21 → 0.4.22
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InfiniteScrollTableProps } from './types';
|
|
2
|
-
declare const InfiniteScrollTable: <T>({ columns: initialColumns, fetchService, scrollHeight, scrollWidth, onChange, rowSelection, onRowClick, onRowSelectionChange, onDataChange, }: InfiniteScrollTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const InfiniteScrollTable: <T>({ columns: initialColumns, fetchService, scrollHeight, scrollWidth, onChange, rowSelection, onRowClick, onRowSelectionChange, onDataChange, filterFn, }: InfiniteScrollTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default InfiniteScrollTable;
|
|
@@ -6,6 +6,7 @@ interface UseInfiniteQueryOptions<T> {
|
|
|
6
6
|
}) => Promise<ApiResponse<T>>;
|
|
7
7
|
initialPageParam: number;
|
|
8
8
|
getNextPageParam: (lastPage: ApiResponse<T>) => number | undefined;
|
|
9
|
+
filterFn?: (data: ApiResponse<T>) => ApiResponse<T>;
|
|
9
10
|
}
|
|
10
11
|
interface UseInfiniteQueryResult<T> {
|
|
11
12
|
data: {
|
|
@@ -17,5 +18,5 @@ interface UseInfiniteQueryResult<T> {
|
|
|
17
18
|
isFetchingNextPage: boolean;
|
|
18
19
|
status: "pending" | "error" | "success";
|
|
19
20
|
}
|
|
20
|
-
export declare const useInfiniteQuery: <T>({ queryKey, queryFn, initialPageParam, getNextPageParam, }: UseInfiniteQueryOptions<T>) => UseInfiniteQueryResult<T>;
|
|
21
|
+
export declare const useInfiniteQuery: <T>({ queryKey, queryFn, initialPageParam, getNextPageParam, filterFn, }: UseInfiniteQueryOptions<T>) => UseInfiniteQueryResult<T>;
|
|
21
22
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -74078,13 +74078,186 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
|
|
|
74078
74078
|
/* @__PURE__ */ jsxRuntime.jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsxRuntime.jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { children: message2 }) : /* @__PURE__ */ jsxRuntime.jsx(MessageText, { children: message2 }) })
|
|
74079
74079
|
] });
|
|
74080
74080
|
};
|
|
74081
|
+
const getStateColors = (colors2, type4, state) => {
|
|
74082
|
+
const filled = {
|
|
74083
|
+
color: colors2.inputs.onsurface.active,
|
|
74084
|
+
borderColor: colors2[TYPE.secondary].active.borderColor,
|
|
74085
|
+
ringColor: colors2[type4]?.focussed?.ringColor
|
|
74086
|
+
};
|
|
74087
|
+
const success = {
|
|
74088
|
+
color: colors2.status.success.default,
|
|
74089
|
+
borderColor: colors2.status.success.default,
|
|
74090
|
+
ringColor: colors2.status.success.ringColor
|
|
74091
|
+
};
|
|
74092
|
+
const error2 = {
|
|
74093
|
+
color: colors2.status.error.default,
|
|
74094
|
+
borderColor: colors2.status.error.default,
|
|
74095
|
+
ringColor: colors2.status.error.ringColor
|
|
74096
|
+
};
|
|
74097
|
+
const themeState = state !== STATE.error && state !== STATE.success && state !== STATE.filled ? {
|
|
74098
|
+
color: colors2.inputs.onsurface.active,
|
|
74099
|
+
backgroundColor: colors2.inputs.surface.active,
|
|
74100
|
+
borderColor: colors2.inputs.surface.border,
|
|
74101
|
+
ringColor: type4 && state ? colors2[type4]?.[state]?.ringColor : void 0
|
|
74102
|
+
} : null;
|
|
74103
|
+
const stateMap = {
|
|
74104
|
+
filled,
|
|
74105
|
+
error: error2,
|
|
74106
|
+
success,
|
|
74107
|
+
themeState
|
|
74108
|
+
};
|
|
74109
|
+
const getValidKey = (state2) => {
|
|
74110
|
+
const validStates = [STATE.filled, STATE.error, STATE.success];
|
|
74111
|
+
return validStates.includes(state2) ? state2 : "themeState";
|
|
74112
|
+
};
|
|
74113
|
+
const css = stateMap[getValidKey(state)];
|
|
74114
|
+
return css;
|
|
74115
|
+
};
|
|
74116
|
+
const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size) => {
|
|
74117
|
+
const stateColors = getStateColors(colors2, type4, state);
|
|
74118
|
+
const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
|
|
74119
|
+
if (hasAfterAddon2 && !hasBeforeAddon2) {
|
|
74120
|
+
return `${borderRadius2.BorderRadiusMd}px 0px 0px ${borderRadius2.BorderRadiusMd}px`;
|
|
74121
|
+
}
|
|
74122
|
+
if (hasBeforeAddon2 && !hasAfterAddon2) {
|
|
74123
|
+
return `0px ${borderRadius2.BorderRadiusMd}px ${borderRadius2.BorderRadiusMd}px 0px`;
|
|
74124
|
+
}
|
|
74125
|
+
return `0px`;
|
|
74126
|
+
};
|
|
74127
|
+
return `
|
|
74128
|
+
&.ant-input {
|
|
74129
|
+
font-family: 'Inter', sans-serif;
|
|
74130
|
+
color: ${stateColors.color};
|
|
74131
|
+
border-color: ${stateColors.borderColor};
|
|
74132
|
+
box-shadow: ${shadows2.inputs[1]} !important;
|
|
74133
|
+
height: ${size === "normal" || size === "large" ? "40px" : "32px"} !important;
|
|
74134
|
+
}
|
|
74135
|
+
|
|
74136
|
+
/* Increase specificity for focus states */
|
|
74137
|
+
&.ant-input.ant-input:focus,
|
|
74138
|
+
&.ant-input.ant-input:focus-visible,
|
|
74139
|
+
&.ant-input.ant-input-focused {
|
|
74140
|
+
outline: none !important;
|
|
74141
|
+
border-color: ${colors2[type4].focussed.borderColor} !important;
|
|
74142
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor} !important;
|
|
74143
|
+
}
|
|
74144
|
+
|
|
74145
|
+
&.ant-input-outlined {
|
|
74146
|
+
border: 1px solid ${stateColors.borderColor};
|
|
74147
|
+
|
|
74148
|
+
&:hover {
|
|
74149
|
+
border-color: ${stateColors.borderColor};
|
|
74150
|
+
}
|
|
74151
|
+
}
|
|
74152
|
+
|
|
74153
|
+
.ant-input-group & {
|
|
74154
|
+
&:focus-within {
|
|
74155
|
+
outline: none;
|
|
74156
|
+
color: ${stateColors.color};
|
|
74157
|
+
box-shadow: none;
|
|
74158
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74159
|
+
}
|
|
74160
|
+
}
|
|
74161
|
+
|
|
74162
|
+
.ant-input-group:focus-within {
|
|
74163
|
+
outline: none;
|
|
74164
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74165
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74166
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74167
|
+
|
|
74168
|
+
/* Hide focus styles on inner input when parent is focused */
|
|
74169
|
+
.ant-input:focus-within {
|
|
74170
|
+
box-shadow: none;
|
|
74171
|
+
border-radius: 0;
|
|
74172
|
+
border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
|
|
74173
|
+
border-color: #ddd;
|
|
74174
|
+
}
|
|
74175
|
+
}
|
|
74176
|
+
|
|
74177
|
+
/* Remove inner input focus styles when in a group */
|
|
74178
|
+
.ant-input-group .ant-input:focus,
|
|
74179
|
+
.ant-input-group .ant-input:focus-visible,
|
|
74180
|
+
.ant-input-group .ant-input:focus-within {
|
|
74181
|
+
outline: none;
|
|
74182
|
+
box-shadow: none;
|
|
74183
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74184
|
+
}
|
|
74185
|
+
|
|
74186
|
+
/* Single focus ring on group */
|
|
74187
|
+
.ant-input-group:focus-within {
|
|
74188
|
+
outline: none;
|
|
74189
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74190
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74191
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74192
|
+
}
|
|
74193
|
+
|
|
74194
|
+
/* Remove focus styles for standalone inputs */
|
|
74195
|
+
&:not(.ant-input-group):focus-visible {
|
|
74196
|
+
outline: none;
|
|
74197
|
+
color: ${stateColors.color};
|
|
74198
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74199
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74200
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74201
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74202
|
+
}
|
|
74203
|
+
|
|
74204
|
+
&:not(.ant-input-group .ant-input):focus-visible {
|
|
74205
|
+
outline: none;
|
|
74206
|
+
color: ${stateColors.color};
|
|
74207
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74208
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74209
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74210
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74211
|
+
}
|
|
74212
|
+
|
|
74213
|
+
&.ant-input-group-wrapper {
|
|
74214
|
+
.ant-input-group {
|
|
74215
|
+
display: flex;
|
|
74216
|
+
align-items: center;
|
|
74217
|
+
height: ${size === "normal" || size === "large" ? "40px" : "32px"};
|
|
74218
|
+
|
|
74219
|
+
.ant-input {
|
|
74220
|
+
height: 100% !important;
|
|
74221
|
+
}
|
|
74222
|
+
|
|
74223
|
+
.ant-input-group-addon {
|
|
74224
|
+
padding: 0 ${components2.input.suffixPrefixHorPadding};
|
|
74225
|
+
height: 100%;
|
|
74226
|
+
display: flex;
|
|
74227
|
+
align-items: center;
|
|
74228
|
+
min-width: fit-content;
|
|
74229
|
+
width: auto;
|
|
74230
|
+
|
|
74231
|
+
> * {
|
|
74232
|
+
width: 100%;
|
|
74233
|
+
}
|
|
74234
|
+
|
|
74235
|
+
.ant-select {
|
|
74236
|
+
height: 100%;
|
|
74237
|
+
|
|
74238
|
+
.ant-select-selector {
|
|
74239
|
+
height: 100%;
|
|
74240
|
+
display: flex;
|
|
74241
|
+
align-items: center;
|
|
74242
|
+
}
|
|
74243
|
+
}
|
|
74244
|
+
}
|
|
74245
|
+
}
|
|
74246
|
+
}
|
|
74247
|
+
`;
|
|
74248
|
+
};
|
|
74081
74249
|
const Input$1 = styled(Input$2)`
|
|
74082
74250
|
${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
|
|
74083
|
-
!!rest.addonBefore;
|
|
74084
|
-
!!rest.addonAfter;
|
|
74085
|
-
return
|
|
74086
|
-
|
|
74087
|
-
|
|
74251
|
+
const hasBeforeAddon = !!rest.addonBefore;
|
|
74252
|
+
const hasAfterAddon = !!rest.addonAfter;
|
|
74253
|
+
return getGenesisInputClass(
|
|
74254
|
+
theme,
|
|
74255
|
+
type4,
|
|
74256
|
+
state,
|
|
74257
|
+
hasBeforeAddon,
|
|
74258
|
+
hasAfterAddon,
|
|
74259
|
+
size
|
|
74260
|
+
);
|
|
74088
74261
|
}}
|
|
74089
74262
|
`;
|
|
74090
74263
|
const DropdownChevron = (properties) => {
|
|
@@ -84344,7 +84517,8 @@ const useInfiniteQuery = ({
|
|
|
84344
84517
|
queryKey: queryKey2,
|
|
84345
84518
|
queryFn,
|
|
84346
84519
|
initialPageParam,
|
|
84347
|
-
getNextPageParam
|
|
84520
|
+
getNextPageParam,
|
|
84521
|
+
filterFn
|
|
84348
84522
|
}) => {
|
|
84349
84523
|
const [pages, setPages] = React.useState([]);
|
|
84350
84524
|
const [error2, setError] = React.useState(null);
|
|
@@ -84374,7 +84548,8 @@ const useInfiniteQuery = ({
|
|
|
84374
84548
|
}
|
|
84375
84549
|
abortControllerRef.current = new AbortController();
|
|
84376
84550
|
try {
|
|
84377
|
-
const
|
|
84551
|
+
const rawResult = await queryFn({ pageParam });
|
|
84552
|
+
const result = filterFn ? filterFn(rawResult) : rawResult;
|
|
84378
84553
|
if (abortControllerRef.current?.signal.aborted) {
|
|
84379
84554
|
return;
|
|
84380
84555
|
}
|
|
@@ -84490,7 +84665,8 @@ const InfiniteScrollTable = ({
|
|
|
84490
84665
|
rowSelection,
|
|
84491
84666
|
onRowClick,
|
|
84492
84667
|
onRowSelectionChange,
|
|
84493
|
-
onDataChange
|
|
84668
|
+
onDataChange,
|
|
84669
|
+
filterFn
|
|
84494
84670
|
}) => {
|
|
84495
84671
|
const observer = React.useRef();
|
|
84496
84672
|
const [scrollableNode, setScrollableNode] = React.useState(
|
|
@@ -84567,7 +84743,8 @@ const InfiniteScrollTable = ({
|
|
|
84567
84743
|
},
|
|
84568
84744
|
[isFetchingNextPage, hasNextPage, fetchNextPage, scrollableNode]
|
|
84569
84745
|
);
|
|
84570
|
-
const
|
|
84746
|
+
const rawDataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
84747
|
+
const dataSource = filterFn ? filterFn(rawDataSource) : rawDataSource;
|
|
84571
84748
|
const totalDocs = data?.pages?.[0]?.totalDocs ?? 0;
|
|
84572
84749
|
React.useEffect(() => {
|
|
84573
84750
|
if (onRowSelectionChange) {
|
|
@@ -84799,8 +84976,10 @@ function Table({
|
|
|
84799
84976
|
title: infiniteScrollConfig.title,
|
|
84800
84977
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
84801
84978
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
84979
|
+
onChange,
|
|
84802
84980
|
onRowSelectionChange,
|
|
84803
|
-
onDataChange
|
|
84981
|
+
onDataChange,
|
|
84982
|
+
filterFn: infiniteScrollConfig.filterFn
|
|
84804
84983
|
}
|
|
84805
84984
|
);
|
|
84806
84985
|
}
|
package/dist/index.js
CHANGED
|
@@ -74060,13 +74060,186 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
|
|
|
74060
74060
|
/* @__PURE__ */ jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsx(Markdown, { children: message2 }) : /* @__PURE__ */ jsx(MessageText, { children: message2 }) })
|
|
74061
74061
|
] });
|
|
74062
74062
|
};
|
|
74063
|
+
const getStateColors = (colors2, type4, state) => {
|
|
74064
|
+
const filled = {
|
|
74065
|
+
color: colors2.inputs.onsurface.active,
|
|
74066
|
+
borderColor: colors2[TYPE.secondary].active.borderColor,
|
|
74067
|
+
ringColor: colors2[type4]?.focussed?.ringColor
|
|
74068
|
+
};
|
|
74069
|
+
const success = {
|
|
74070
|
+
color: colors2.status.success.default,
|
|
74071
|
+
borderColor: colors2.status.success.default,
|
|
74072
|
+
ringColor: colors2.status.success.ringColor
|
|
74073
|
+
};
|
|
74074
|
+
const error2 = {
|
|
74075
|
+
color: colors2.status.error.default,
|
|
74076
|
+
borderColor: colors2.status.error.default,
|
|
74077
|
+
ringColor: colors2.status.error.ringColor
|
|
74078
|
+
};
|
|
74079
|
+
const themeState = state !== STATE.error && state !== STATE.success && state !== STATE.filled ? {
|
|
74080
|
+
color: colors2.inputs.onsurface.active,
|
|
74081
|
+
backgroundColor: colors2.inputs.surface.active,
|
|
74082
|
+
borderColor: colors2.inputs.surface.border,
|
|
74083
|
+
ringColor: type4 && state ? colors2[type4]?.[state]?.ringColor : void 0
|
|
74084
|
+
} : null;
|
|
74085
|
+
const stateMap = {
|
|
74086
|
+
filled,
|
|
74087
|
+
error: error2,
|
|
74088
|
+
success,
|
|
74089
|
+
themeState
|
|
74090
|
+
};
|
|
74091
|
+
const getValidKey = (state2) => {
|
|
74092
|
+
const validStates = [STATE.filled, STATE.error, STATE.success];
|
|
74093
|
+
return validStates.includes(state2) ? state2 : "themeState";
|
|
74094
|
+
};
|
|
74095
|
+
const css = stateMap[getValidKey(state)];
|
|
74096
|
+
return css;
|
|
74097
|
+
};
|
|
74098
|
+
const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size) => {
|
|
74099
|
+
const stateColors = getStateColors(colors2, type4, state);
|
|
74100
|
+
const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
|
|
74101
|
+
if (hasAfterAddon2 && !hasBeforeAddon2) {
|
|
74102
|
+
return `${borderRadius2.BorderRadiusMd}px 0px 0px ${borderRadius2.BorderRadiusMd}px`;
|
|
74103
|
+
}
|
|
74104
|
+
if (hasBeforeAddon2 && !hasAfterAddon2) {
|
|
74105
|
+
return `0px ${borderRadius2.BorderRadiusMd}px ${borderRadius2.BorderRadiusMd}px 0px`;
|
|
74106
|
+
}
|
|
74107
|
+
return `0px`;
|
|
74108
|
+
};
|
|
74109
|
+
return `
|
|
74110
|
+
&.ant-input {
|
|
74111
|
+
font-family: 'Inter', sans-serif;
|
|
74112
|
+
color: ${stateColors.color};
|
|
74113
|
+
border-color: ${stateColors.borderColor};
|
|
74114
|
+
box-shadow: ${shadows2.inputs[1]} !important;
|
|
74115
|
+
height: ${size === "normal" || size === "large" ? "40px" : "32px"} !important;
|
|
74116
|
+
}
|
|
74117
|
+
|
|
74118
|
+
/* Increase specificity for focus states */
|
|
74119
|
+
&.ant-input.ant-input:focus,
|
|
74120
|
+
&.ant-input.ant-input:focus-visible,
|
|
74121
|
+
&.ant-input.ant-input-focused {
|
|
74122
|
+
outline: none !important;
|
|
74123
|
+
border-color: ${colors2[type4].focussed.borderColor} !important;
|
|
74124
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor} !important;
|
|
74125
|
+
}
|
|
74126
|
+
|
|
74127
|
+
&.ant-input-outlined {
|
|
74128
|
+
border: 1px solid ${stateColors.borderColor};
|
|
74129
|
+
|
|
74130
|
+
&:hover {
|
|
74131
|
+
border-color: ${stateColors.borderColor};
|
|
74132
|
+
}
|
|
74133
|
+
}
|
|
74134
|
+
|
|
74135
|
+
.ant-input-group & {
|
|
74136
|
+
&:focus-within {
|
|
74137
|
+
outline: none;
|
|
74138
|
+
color: ${stateColors.color};
|
|
74139
|
+
box-shadow: none;
|
|
74140
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74141
|
+
}
|
|
74142
|
+
}
|
|
74143
|
+
|
|
74144
|
+
.ant-input-group:focus-within {
|
|
74145
|
+
outline: none;
|
|
74146
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74147
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74148
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74149
|
+
|
|
74150
|
+
/* Hide focus styles on inner input when parent is focused */
|
|
74151
|
+
.ant-input:focus-within {
|
|
74152
|
+
box-shadow: none;
|
|
74153
|
+
border-radius: 0;
|
|
74154
|
+
border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
|
|
74155
|
+
border-color: #ddd;
|
|
74156
|
+
}
|
|
74157
|
+
}
|
|
74158
|
+
|
|
74159
|
+
/* Remove inner input focus styles when in a group */
|
|
74160
|
+
.ant-input-group .ant-input:focus,
|
|
74161
|
+
.ant-input-group .ant-input:focus-visible,
|
|
74162
|
+
.ant-input-group .ant-input:focus-within {
|
|
74163
|
+
outline: none;
|
|
74164
|
+
box-shadow: none;
|
|
74165
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74166
|
+
}
|
|
74167
|
+
|
|
74168
|
+
/* Single focus ring on group */
|
|
74169
|
+
.ant-input-group:focus-within {
|
|
74170
|
+
outline: none;
|
|
74171
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74172
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74173
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74174
|
+
}
|
|
74175
|
+
|
|
74176
|
+
/* Remove focus styles for standalone inputs */
|
|
74177
|
+
&:not(.ant-input-group):focus-visible {
|
|
74178
|
+
outline: none;
|
|
74179
|
+
color: ${stateColors.color};
|
|
74180
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74181
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74182
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74183
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74184
|
+
}
|
|
74185
|
+
|
|
74186
|
+
&:not(.ant-input-group .ant-input):focus-visible {
|
|
74187
|
+
outline: none;
|
|
74188
|
+
color: ${stateColors.color};
|
|
74189
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
|
|
74190
|
+
border-radius: ${borderRadius2.BorderRadiusMd}px;
|
|
74191
|
+
border-color: ${colors2[type4].focussed.borderColor};
|
|
74192
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
74193
|
+
}
|
|
74194
|
+
|
|
74195
|
+
&.ant-input-group-wrapper {
|
|
74196
|
+
.ant-input-group {
|
|
74197
|
+
display: flex;
|
|
74198
|
+
align-items: center;
|
|
74199
|
+
height: ${size === "normal" || size === "large" ? "40px" : "32px"};
|
|
74200
|
+
|
|
74201
|
+
.ant-input {
|
|
74202
|
+
height: 100% !important;
|
|
74203
|
+
}
|
|
74204
|
+
|
|
74205
|
+
.ant-input-group-addon {
|
|
74206
|
+
padding: 0 ${components2.input.suffixPrefixHorPadding};
|
|
74207
|
+
height: 100%;
|
|
74208
|
+
display: flex;
|
|
74209
|
+
align-items: center;
|
|
74210
|
+
min-width: fit-content;
|
|
74211
|
+
width: auto;
|
|
74212
|
+
|
|
74213
|
+
> * {
|
|
74214
|
+
width: 100%;
|
|
74215
|
+
}
|
|
74216
|
+
|
|
74217
|
+
.ant-select {
|
|
74218
|
+
height: 100%;
|
|
74219
|
+
|
|
74220
|
+
.ant-select-selector {
|
|
74221
|
+
height: 100%;
|
|
74222
|
+
display: flex;
|
|
74223
|
+
align-items: center;
|
|
74224
|
+
}
|
|
74225
|
+
}
|
|
74226
|
+
}
|
|
74227
|
+
}
|
|
74228
|
+
}
|
|
74229
|
+
`;
|
|
74230
|
+
};
|
|
74063
74231
|
const Input$1 = styled(Input$2)`
|
|
74064
74232
|
${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
|
|
74065
|
-
!!rest.addonBefore;
|
|
74066
|
-
!!rest.addonAfter;
|
|
74067
|
-
return
|
|
74068
|
-
|
|
74069
|
-
|
|
74233
|
+
const hasBeforeAddon = !!rest.addonBefore;
|
|
74234
|
+
const hasAfterAddon = !!rest.addonAfter;
|
|
74235
|
+
return getGenesisInputClass(
|
|
74236
|
+
theme,
|
|
74237
|
+
type4,
|
|
74238
|
+
state,
|
|
74239
|
+
hasBeforeAddon,
|
|
74240
|
+
hasAfterAddon,
|
|
74241
|
+
size
|
|
74242
|
+
);
|
|
74070
74243
|
}}
|
|
74071
74244
|
`;
|
|
74072
74245
|
const DropdownChevron = (properties) => {
|
|
@@ -84326,7 +84499,8 @@ const useInfiniteQuery = ({
|
|
|
84326
84499
|
queryKey: queryKey2,
|
|
84327
84500
|
queryFn,
|
|
84328
84501
|
initialPageParam,
|
|
84329
|
-
getNextPageParam
|
|
84502
|
+
getNextPageParam,
|
|
84503
|
+
filterFn
|
|
84330
84504
|
}) => {
|
|
84331
84505
|
const [pages, setPages] = useState([]);
|
|
84332
84506
|
const [error2, setError] = useState(null);
|
|
@@ -84356,7 +84530,8 @@ const useInfiniteQuery = ({
|
|
|
84356
84530
|
}
|
|
84357
84531
|
abortControllerRef.current = new AbortController();
|
|
84358
84532
|
try {
|
|
84359
|
-
const
|
|
84533
|
+
const rawResult = await queryFn({ pageParam });
|
|
84534
|
+
const result = filterFn ? filterFn(rawResult) : rawResult;
|
|
84360
84535
|
if (abortControllerRef.current?.signal.aborted) {
|
|
84361
84536
|
return;
|
|
84362
84537
|
}
|
|
@@ -84472,7 +84647,8 @@ const InfiniteScrollTable = ({
|
|
|
84472
84647
|
rowSelection,
|
|
84473
84648
|
onRowClick,
|
|
84474
84649
|
onRowSelectionChange,
|
|
84475
|
-
onDataChange
|
|
84650
|
+
onDataChange,
|
|
84651
|
+
filterFn
|
|
84476
84652
|
}) => {
|
|
84477
84653
|
const observer = useRef();
|
|
84478
84654
|
const [scrollableNode, setScrollableNode] = useState(
|
|
@@ -84549,7 +84725,8 @@ const InfiniteScrollTable = ({
|
|
|
84549
84725
|
},
|
|
84550
84726
|
[isFetchingNextPage, hasNextPage, fetchNextPage, scrollableNode]
|
|
84551
84727
|
);
|
|
84552
|
-
const
|
|
84728
|
+
const rawDataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
84729
|
+
const dataSource = filterFn ? filterFn(rawDataSource) : rawDataSource;
|
|
84553
84730
|
const totalDocs = data?.pages?.[0]?.totalDocs ?? 0;
|
|
84554
84731
|
useEffect(() => {
|
|
84555
84732
|
if (onRowSelectionChange) {
|
|
@@ -84781,8 +84958,10 @@ function Table({
|
|
|
84781
84958
|
title: infiniteScrollConfig.title,
|
|
84782
84959
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
84783
84960
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
84961
|
+
onChange,
|
|
84784
84962
|
onRowSelectionChange,
|
|
84785
|
-
onDataChange
|
|
84963
|
+
onDataChange,
|
|
84964
|
+
filterFn: infiniteScrollConfig.filterFn
|
|
84786
84965
|
}
|
|
84787
84966
|
);
|
|
84788
84967
|
}
|