@stoker-platform/web-app 0.5.146 → 0.5.147

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @stoker-platform/web-app
2
2
 
3
+ ## 0.5.147
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: increase relation picker item size
8
+
3
9
  ## 0.5.146
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/web-app",
3
- "version": "0.5.146",
3
+ "version": "0.5.147",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "scripts": {
package/src/Filters.tsx CHANGED
@@ -314,9 +314,10 @@ export function Filters({ collection, excluded, relationList }: FiltersProps) {
314
314
  if (isCollectionPreloadCacheEnabled && query) {
315
315
  const searchResults = localFullTextSearch(collectionSchema, query, data.records)
316
316
  const objectIds = searchResults.map((result) => result.id)
317
+ const numberOfResults = isMobile ? 20 : 10
317
318
  setData((prev) => ({
318
319
  ...prev,
319
- [field]: data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, 10),
320
+ [field]: data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, numberOfResults),
320
321
  }))
321
322
  } else {
322
323
  setData((prev) => ({
@@ -613,6 +614,7 @@ export function Filters({ collection, excluded, relationList }: FiltersProps) {
613
614
  <CommandGroup>
614
615
  {data[filter.field] && (
615
616
  <CommandItem
617
+ className={cn(isMobile ? "p-3" : undefined)}
616
618
  key="no_selection"
617
619
  value="no_selection"
618
620
  onSelect={(currentValue) => {
@@ -646,6 +648,7 @@ export function Filters({ collection, excluded, relationList }: FiltersProps) {
646
648
  )}
647
649
  {data[filter.field]?.map((record: StokerRecord) => (
648
650
  <CommandItem
651
+ className={cn(isMobile ? "p-3" : undefined)}
649
652
  key={record.id}
650
653
  value={record.id}
651
654
  onSelect={(currentValue) => {
package/src/Form.tsx CHANGED
@@ -2025,9 +2025,12 @@ function RelationField({
2025
2025
  return !!fieldCustomization.admin?.filterResults?.(result, collection, record)
2026
2026
  })
2027
2027
  const objectIds = searchResults.map((result) => result.id)
2028
- orderData(data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, 10)).then((data) => {
2029
- setData(data)
2030
- })
2028
+ const numberOfResults = isMobile ? 20 : 10
2029
+ orderData(data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, numberOfResults)).then(
2030
+ (data) => {
2031
+ setData(data)
2032
+ },
2033
+ )
2031
2034
  } else {
2032
2035
  orderData(
2033
2036
  data.records
@@ -2165,6 +2168,7 @@ function RelationField({
2165
2168
  <CommandGroup>
2166
2169
  {data && ["OneToOne", "OneToMany"].includes(field.type) && (
2167
2170
  <CommandItem
2171
+ className={cn(isMobile ? "p-3" : undefined)}
2168
2172
  key="no_selection"
2169
2173
  value="no_selection"
2170
2174
  onSelect={(currentValue: string) => {
@@ -2183,6 +2187,7 @@ function RelationField({
2183
2187
  )}
2184
2188
  {data?.map((relationRecord: StokerRecord) => (
2185
2189
  <CommandItem
2190
+ className={cn(isMobile ? "p-3" : undefined)}
2186
2191
  key={relationRecord.id}
2187
2192
  value={relationRecord.id}
2188
2193
  onSelect={(currentValue) => {
@@ -140,7 +140,8 @@ export const PermissionPicker = ({
140
140
  if (isCollectionPreloadCacheEnabled && query) {
141
141
  const searchResults = localFullTextSearch(collection, query, data.records)
142
142
  const objectIds = searchResults.map((result) => result.id)
143
- setData(data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, 10))
143
+ const numberOfResults = isMobile ? 20 : 10
144
+ setData(data.records.filter((doc) => objectIds.includes(doc.id)).slice(0, numberOfResults))
144
145
  } else {
145
146
  setData(data.records.slice(0, 10))
146
147
  }
@@ -387,6 +388,7 @@ export const PermissionPicker = ({
387
388
  <CommandGroup>
388
389
  {data && (
389
390
  <CommandItem
391
+ className={cn(isMobile ? "p-3" : undefined)}
390
392
  key="no_selection"
391
393
  value="no_selection"
392
394
  onSelect={(currentValue) => {
@@ -402,6 +404,7 @@ export const PermissionPicker = ({
402
404
  )}
403
405
  {data?.map((record: StokerRecord) => (
404
406
  <CommandItem
407
+ className={cn(isMobile ? "p-3" : undefined)}
405
408
  key={record.id}
406
409
  value={record.id}
407
410
  onSelect={(currentValue) => {