@gobolt/genesis 0.4.20 → 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.
- package/dist/components/Badge/Badge.d.ts +1 -0
- package/dist/components/Badge/styles.d.ts +1 -0
- package/dist/components/Table/InfiniteScrollTable/InfiniteScrollTable.d.ts +1 -1
- package/dist/components/Table/InfiniteScrollTable/useInfiniteQuery.d.ts +2 -1
- package/dist/components/Table/Table.d.ts +1 -0
- package/dist/index.cjs +193 -13
- package/dist/index.js +193 -13
- package/package.json +1 -1
|
@@ -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
|
@@ -60537,6 +60537,7 @@ const Badge$2 = styled.div`
|
|
|
60537
60537
|
${({
|
|
60538
60538
|
theme,
|
|
60539
60539
|
state,
|
|
60540
|
+
$state,
|
|
60540
60541
|
label,
|
|
60541
60542
|
disabled: disabled2,
|
|
60542
60543
|
$backgroundColor,
|
|
@@ -60544,7 +60545,7 @@ const Badge$2 = styled.div`
|
|
|
60544
60545
|
}) => {
|
|
60545
60546
|
return getGenesisClass$c(
|
|
60546
60547
|
theme,
|
|
60547
|
-
state || "info",
|
|
60548
|
+
$state || state || "info",
|
|
60548
60549
|
label,
|
|
60549
60550
|
disabled2,
|
|
60550
60551
|
$backgroundColor,
|
|
@@ -60863,7 +60864,7 @@ const Badge$1 = ({
|
|
|
60863
60864
|
{
|
|
60864
60865
|
label,
|
|
60865
60866
|
role: "badge",
|
|
60866
|
-
state,
|
|
60867
|
+
$state: state,
|
|
60867
60868
|
disabled: isDisabled,
|
|
60868
60869
|
style: {
|
|
60869
60870
|
padding: "4px 4px"
|
|
@@ -60896,7 +60897,7 @@ const Badge$1 = ({
|
|
|
60896
60897
|
label,
|
|
60897
60898
|
role,
|
|
60898
60899
|
onClick,
|
|
60899
|
-
state,
|
|
60900
|
+
$state: state,
|
|
60900
60901
|
disabled: isDisabled,
|
|
60901
60902
|
style: { cursor: role === "button" ? "pointer" : "default" },
|
|
60902
60903
|
$backgroundColor: backgroundColor || void 0,
|
|
@@ -74077,13 +74078,186 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
|
|
|
74077
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 }) })
|
|
74078
74079
|
] });
|
|
74079
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
|
+
};
|
|
74080
74249
|
const Input$1 = styled(Input$2)`
|
|
74081
74250
|
${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
|
|
74082
|
-
!!rest.addonBefore;
|
|
74083
|
-
!!rest.addonAfter;
|
|
74084
|
-
return
|
|
74085
|
-
|
|
74086
|
-
|
|
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
|
+
);
|
|
74087
74261
|
}}
|
|
74088
74262
|
`;
|
|
74089
74263
|
const DropdownChevron = (properties) => {
|
|
@@ -84343,7 +84517,8 @@ const useInfiniteQuery = ({
|
|
|
84343
84517
|
queryKey: queryKey2,
|
|
84344
84518
|
queryFn,
|
|
84345
84519
|
initialPageParam,
|
|
84346
|
-
getNextPageParam
|
|
84520
|
+
getNextPageParam,
|
|
84521
|
+
filterFn
|
|
84347
84522
|
}) => {
|
|
84348
84523
|
const [pages, setPages] = React.useState([]);
|
|
84349
84524
|
const [error2, setError] = React.useState(null);
|
|
@@ -84373,7 +84548,8 @@ const useInfiniteQuery = ({
|
|
|
84373
84548
|
}
|
|
84374
84549
|
abortControllerRef.current = new AbortController();
|
|
84375
84550
|
try {
|
|
84376
|
-
const
|
|
84551
|
+
const rawResult = await queryFn({ pageParam });
|
|
84552
|
+
const result = filterFn ? filterFn(rawResult) : rawResult;
|
|
84377
84553
|
if (abortControllerRef.current?.signal.aborted) {
|
|
84378
84554
|
return;
|
|
84379
84555
|
}
|
|
@@ -84489,7 +84665,8 @@ const InfiniteScrollTable = ({
|
|
|
84489
84665
|
rowSelection,
|
|
84490
84666
|
onRowClick,
|
|
84491
84667
|
onRowSelectionChange,
|
|
84492
|
-
onDataChange
|
|
84668
|
+
onDataChange,
|
|
84669
|
+
filterFn
|
|
84493
84670
|
}) => {
|
|
84494
84671
|
const observer = React.useRef();
|
|
84495
84672
|
const [scrollableNode, setScrollableNode] = React.useState(
|
|
@@ -84566,7 +84743,8 @@ const InfiniteScrollTable = ({
|
|
|
84566
84743
|
},
|
|
84567
84744
|
[isFetchingNextPage, hasNextPage, fetchNextPage, scrollableNode]
|
|
84568
84745
|
);
|
|
84569
|
-
const
|
|
84746
|
+
const rawDataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
84747
|
+
const dataSource = filterFn ? filterFn(rawDataSource) : rawDataSource;
|
|
84570
84748
|
const totalDocs = data?.pages?.[0]?.totalDocs ?? 0;
|
|
84571
84749
|
React.useEffect(() => {
|
|
84572
84750
|
if (onRowSelectionChange) {
|
|
@@ -84798,8 +84976,10 @@ function Table({
|
|
|
84798
84976
|
title: infiniteScrollConfig.title,
|
|
84799
84977
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
84800
84978
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
84979
|
+
onChange,
|
|
84801
84980
|
onRowSelectionChange,
|
|
84802
|
-
onDataChange
|
|
84981
|
+
onDataChange,
|
|
84982
|
+
filterFn: infiniteScrollConfig.filterFn
|
|
84803
84983
|
}
|
|
84804
84984
|
);
|
|
84805
84985
|
}
|
package/dist/index.js
CHANGED
|
@@ -60519,6 +60519,7 @@ const Badge$2 = styled.div`
|
|
|
60519
60519
|
${({
|
|
60520
60520
|
theme,
|
|
60521
60521
|
state,
|
|
60522
|
+
$state,
|
|
60522
60523
|
label,
|
|
60523
60524
|
disabled: disabled2,
|
|
60524
60525
|
$backgroundColor,
|
|
@@ -60526,7 +60527,7 @@ const Badge$2 = styled.div`
|
|
|
60526
60527
|
}) => {
|
|
60527
60528
|
return getGenesisClass$c(
|
|
60528
60529
|
theme,
|
|
60529
|
-
state || "info",
|
|
60530
|
+
$state || state || "info",
|
|
60530
60531
|
label,
|
|
60531
60532
|
disabled2,
|
|
60532
60533
|
$backgroundColor,
|
|
@@ -60845,7 +60846,7 @@ const Badge$1 = ({
|
|
|
60845
60846
|
{
|
|
60846
60847
|
label,
|
|
60847
60848
|
role: "badge",
|
|
60848
|
-
state,
|
|
60849
|
+
$state: state,
|
|
60849
60850
|
disabled: isDisabled,
|
|
60850
60851
|
style: {
|
|
60851
60852
|
padding: "4px 4px"
|
|
@@ -60878,7 +60879,7 @@ const Badge$1 = ({
|
|
|
60878
60879
|
label,
|
|
60879
60880
|
role,
|
|
60880
60881
|
onClick,
|
|
60881
|
-
state,
|
|
60882
|
+
$state: state,
|
|
60882
60883
|
disabled: isDisabled,
|
|
60883
60884
|
style: { cursor: role === "button" ? "pointer" : "default" },
|
|
60884
60885
|
$backgroundColor: backgroundColor || void 0,
|
|
@@ -74059,13 +74060,186 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
|
|
|
74059
74060
|
/* @__PURE__ */ jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsx(Markdown, { children: message2 }) : /* @__PURE__ */ jsx(MessageText, { children: message2 }) })
|
|
74060
74061
|
] });
|
|
74061
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
|
+
};
|
|
74062
74231
|
const Input$1 = styled(Input$2)`
|
|
74063
74232
|
${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
|
|
74064
|
-
!!rest.addonBefore;
|
|
74065
|
-
!!rest.addonAfter;
|
|
74066
|
-
return
|
|
74067
|
-
|
|
74068
|
-
|
|
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
|
+
);
|
|
74069
74243
|
}}
|
|
74070
74244
|
`;
|
|
74071
74245
|
const DropdownChevron = (properties) => {
|
|
@@ -84325,7 +84499,8 @@ const useInfiniteQuery = ({
|
|
|
84325
84499
|
queryKey: queryKey2,
|
|
84326
84500
|
queryFn,
|
|
84327
84501
|
initialPageParam,
|
|
84328
|
-
getNextPageParam
|
|
84502
|
+
getNextPageParam,
|
|
84503
|
+
filterFn
|
|
84329
84504
|
}) => {
|
|
84330
84505
|
const [pages, setPages] = useState([]);
|
|
84331
84506
|
const [error2, setError] = useState(null);
|
|
@@ -84355,7 +84530,8 @@ const useInfiniteQuery = ({
|
|
|
84355
84530
|
}
|
|
84356
84531
|
abortControllerRef.current = new AbortController();
|
|
84357
84532
|
try {
|
|
84358
|
-
const
|
|
84533
|
+
const rawResult = await queryFn({ pageParam });
|
|
84534
|
+
const result = filterFn ? filterFn(rawResult) : rawResult;
|
|
84359
84535
|
if (abortControllerRef.current?.signal.aborted) {
|
|
84360
84536
|
return;
|
|
84361
84537
|
}
|
|
@@ -84471,7 +84647,8 @@ const InfiniteScrollTable = ({
|
|
|
84471
84647
|
rowSelection,
|
|
84472
84648
|
onRowClick,
|
|
84473
84649
|
onRowSelectionChange,
|
|
84474
|
-
onDataChange
|
|
84650
|
+
onDataChange,
|
|
84651
|
+
filterFn
|
|
84475
84652
|
}) => {
|
|
84476
84653
|
const observer = useRef();
|
|
84477
84654
|
const [scrollableNode, setScrollableNode] = useState(
|
|
@@ -84548,7 +84725,8 @@ const InfiniteScrollTable = ({
|
|
|
84548
84725
|
},
|
|
84549
84726
|
[isFetchingNextPage, hasNextPage, fetchNextPage, scrollableNode]
|
|
84550
84727
|
);
|
|
84551
|
-
const
|
|
84728
|
+
const rawDataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
84729
|
+
const dataSource = filterFn ? filterFn(rawDataSource) : rawDataSource;
|
|
84552
84730
|
const totalDocs = data?.pages?.[0]?.totalDocs ?? 0;
|
|
84553
84731
|
useEffect(() => {
|
|
84554
84732
|
if (onRowSelectionChange) {
|
|
@@ -84780,8 +84958,10 @@ function Table({
|
|
|
84780
84958
|
title: infiniteScrollConfig.title,
|
|
84781
84959
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
84782
84960
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
84961
|
+
onChange,
|
|
84783
84962
|
onRowSelectionChange,
|
|
84784
|
-
onDataChange
|
|
84963
|
+
onDataChange,
|
|
84964
|
+
filterFn: infiniteScrollConfig.filterFn
|
|
84785
84965
|
}
|
|
84786
84966
|
);
|
|
84787
84967
|
}
|