Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dashboard): BulkEditor Boolean cell behaviour #8418

Merged
merged 9 commits into from
Aug 13, 2024
3 changes: 1 addition & 2 deletions packages/admin-next/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@medusajs/js-sdk": "0.0.1",
"@medusajs/ui": "3.0.0",
"@radix-ui/react-collapsible": "1.1.0",
"@radix-ui/react-hover-card": "1.1.1",
"@tanstack/react-query": "^5.28.14",
"@tanstack/react-table": "8.10.7",
"@tanstack/react-virtual": "^3.8.3",
Expand All @@ -50,6 +49,7 @@
"i18next-http-backend": "2.4.2",
"lodash": "^4.17.21",
"match-sorter": "^6.3.4",
"prop-types": "^15.8.1",
"qs": "^6.12.0",
"react": "^18.2.0",
"react-country-flag": "^3.1.0",
Expand All @@ -59,7 +59,6 @@
"react-i18next": "13.5.0",
"react-jwt": "^1.2.0",
"react-nestable": "^3.0.2",
"react-resizable-panels": "^2.0.16",
"react-router-dom": "6.20.1",
"zod": "3.22.4"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { FocusEvent, MouseEvent, createContext } from "react"
import { Control, FieldValues, Path, UseFormRegister } from "react-hook-form"
import { CellCoords } from "./types"
import { CellCoords, CellType } from "./types"

type DataGridContextType<TForm extends FieldValues> = {
// Grid state
anchor: CellCoords | null
selection: Record<string, boolean>
dragSelection: Record<string, boolean>
trapActive: boolean
// Cell handlers
registerCell: (coords: CellCoords, key: string) => void
registerCell: (coords: CellCoords, field: string, type: CellType) => void
getIsCellSelected: (coords: CellCoords) => boolean
getIsCellDragSelected: (coords: CellCoords) => boolean
// Grid handlers
setIsEditing: (value: boolean) => void
setIsSelecting: (value: boolean) => void
setRangeEnd: (coords: CellCoords) => void
setSingleRange: (coords: CellCoords) => void
// Form state and handlers
register: UseFormRegister<TForm>
control: Control<TForm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const DataGridBooleanCell = <TData, TValue = any>({
const { control, renderProps } = useDataGridCell({
field,
context,
type: "select",
type: "boolean",
})

const { container, input } = renderProps
Expand Down
Loading
Loading