@tellescope/react-components 1.174.0 → 1.175.0
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/lib/cjs/Forms/inputs.d.ts.map +1 -1
- package/lib/cjs/Forms/inputs.js +3 -1
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/table.d.ts +2 -1
- package/lib/cjs/table.d.ts.map +1 -1
- package/lib/cjs/table.js +25 -17
- package/lib/cjs/table.js.map +1 -1
- package/lib/esm/Forms/inputs.d.ts.map +1 -1
- package/lib/esm/Forms/inputs.js +3 -1
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/table.d.ts +2 -1
- package/lib/esm/table.d.ts.map +1 -1
- package/lib/esm/table.js +25 -17
- package/lib/esm/table.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/inputs.tsx +5 -1
- package/src/table.tsx +21 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.175.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
48
|
"@stripe/react-stripe-js": "^2.9.0",
|
|
49
49
|
"@stripe/stripe-js": "^1.52.1",
|
|
50
|
-
"@tellescope/constants": "^1.
|
|
51
|
-
"@tellescope/sdk": "^1.
|
|
52
|
-
"@tellescope/types-client": "^1.
|
|
53
|
-
"@tellescope/types-models": "^1.
|
|
54
|
-
"@tellescope/types-utilities": "^1.
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
56
|
-
"@tellescope/validation": "^1.
|
|
50
|
+
"@tellescope/constants": "^1.175.0",
|
|
51
|
+
"@tellescope/sdk": "^1.175.0",
|
|
52
|
+
"@tellescope/types-client": "^1.175.0",
|
|
53
|
+
"@tellescope/types-models": "^1.175.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.175.0",
|
|
55
|
+
"@tellescope/utilities": "^1.175.0",
|
|
56
|
+
"@tellescope/validation": "^1.175.0",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
58
58
|
"@typescript-eslint/parser": "^4.33.0",
|
|
59
59
|
"css-to-react-native": "^3.0.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
85
85
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "d4b035d1d3a40b4177169dd41b911eec7383c949",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -1755,7 +1755,11 @@ export const DropdownInput = ({ field, value, onChange }: FormInputProps<'Dropdo
|
|
|
1755
1755
|
? onChange(e.target.value ? [e.target.value] : [], field.id)
|
|
1756
1756
|
: undefined
|
|
1757
1757
|
)}
|
|
1758
|
-
placeholder={
|
|
1758
|
+
placeholder={
|
|
1759
|
+
field.placeholder
|
|
1760
|
+
? field.placeholder + ((!field.title && !field.isOptional) ? '*' : '')
|
|
1761
|
+
: undefined
|
|
1762
|
+
}
|
|
1759
1763
|
label={
|
|
1760
1764
|
(!field.options?.radio && field.options?.other)
|
|
1761
1765
|
? "Press enter to save a custom value"
|
package/src/table.tsx
CHANGED
|
@@ -38,7 +38,7 @@ import { PRIMARY_HEX } from "@tellescope/constants"
|
|
|
38
38
|
|
|
39
39
|
import CloudDownloadIcon from '@mui/icons-material/CloudDownload';
|
|
40
40
|
import { Autocomplete } from "@mui/material"
|
|
41
|
-
import { SortingField } from "@tellescope/types-models"
|
|
41
|
+
import { ListQueryQualifier, SortingField } from "@tellescope/types-models"
|
|
42
42
|
// import DragHandleIcon from '@mui/icons-material/DragHandle';
|
|
43
43
|
|
|
44
44
|
const LIGHT_GRAY = "#fafafa"
|
|
@@ -101,6 +101,7 @@ const checkboxStyle: React.CSSProperties = {
|
|
|
101
101
|
type LocalFilter = {
|
|
102
102
|
query: string,
|
|
103
103
|
values?: string[],
|
|
104
|
+
valuesQualifier?: ListQueryQualifier,
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
// export type SortType = 'infer'
|
|
@@ -183,6 +184,19 @@ export const TableHeader = <T extends Item>({
|
|
|
183
184
|
<Flex flex={1} justifyContent="center">
|
|
184
185
|
{fields[openFilter]?.filterType === 'multi'
|
|
185
186
|
? (
|
|
187
|
+
<>
|
|
188
|
+
<Autocomplete disableClearable disablePortal size={'small'} options={['One Of', 'All Of']} sx={{ width: 140, mr: 0.5 }}
|
|
189
|
+
onChange={(e, value) => {
|
|
190
|
+
setLocalFilters(fs => fs.map((f, i) => i === openFilter ? { ...f, valuesQualifier: value === 'All Of' ? 'All Of' : 'One Of' } : f))
|
|
191
|
+
}}
|
|
192
|
+
value={localFilters[openFilter]?.valuesQualifier === 'All Of' ? 'All Of' : 'One Of'}
|
|
193
|
+
renderInput={(params) =>
|
|
194
|
+
<TextField {...params} fullWidth autoFocus label={"Qualifier"} size={'small'}
|
|
195
|
+
value={localFilters[openFilter]?.valuesQualifier === 'All Of' ? 'All Of' : 'One Of'}
|
|
196
|
+
/>
|
|
197
|
+
}
|
|
198
|
+
/>
|
|
199
|
+
|
|
186
200
|
<Autocomplete size={'small'}
|
|
187
201
|
disablePortal multiple
|
|
188
202
|
options={(filterSuggestions?.[fields[openFilter]?.key?.toString()] || []).sort()}
|
|
@@ -192,13 +206,14 @@ export const TableHeader = <T extends Item>({
|
|
|
192
206
|
}}
|
|
193
207
|
value={localFilters[openFilter]?.values ?? []}
|
|
194
208
|
renderInput={(params) =>
|
|
195
|
-
<TextField {...params} autoFocus label={"Filter"} size={'small'}
|
|
209
|
+
<TextField {...params} autoFocus label={"Filter by"} size={'small'}
|
|
196
210
|
style={{ width: 400 }}
|
|
197
211
|
value={localFilters[openFilter]?.query ?? ''}
|
|
198
212
|
// onKeyUp={e => e.which === 13 && onEnterPress?.()}
|
|
199
213
|
/>
|
|
200
214
|
}
|
|
201
215
|
/>
|
|
216
|
+
</>
|
|
202
217
|
) : (
|
|
203
218
|
<Autocomplete size={'small'}
|
|
204
219
|
disablePortal
|
|
@@ -922,13 +937,16 @@ export const Table = <T extends Item>({
|
|
|
922
937
|
const { getFilterValue, filterType } = fields[i]
|
|
923
938
|
if (!getFilterValue) continue
|
|
924
939
|
|
|
925
|
-
const { query, values } = localFilters[i] ?? {}
|
|
940
|
+
const { query, values, valuesQualifier } = localFilters[i] ?? {}
|
|
926
941
|
|
|
927
942
|
if (filterType === 'multi') {
|
|
928
943
|
if (!values?.length) continue
|
|
929
944
|
|
|
930
945
|
const filterValueOrValues = getFilterValue(v)
|
|
931
946
|
const filterValues = Array.isArray(filterValueOrValues) ? filterValueOrValues : [filterValueOrValues]
|
|
947
|
+
if (valuesQualifier === 'All Of') {
|
|
948
|
+
return values.every(v => filterValues.includes(v))
|
|
949
|
+
}
|
|
932
950
|
if (!filterValues.find(v => values.includes(v))) {
|
|
933
951
|
return false
|
|
934
952
|
}
|