diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/Row.tsx b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/Row.tsx index 563a595609bb..992dba4a707a 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/Row.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/Row.tsx @@ -16,8 +16,6 @@ interface RowType { export function Row(props: RowType) { const { - accentColor, - borderRadius, columns, isAddRowInProgress, multiRowSelection, diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/StaticTableBody.tsx b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/StaticTableBody.tsx index 4b5b3404ca87..e7edf832aa59 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/StaticTableBody.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/StaticTableBody.tsx @@ -12,7 +12,7 @@ export interface StaticTableProps { ): TableBodyProps; pageSize: number; rows: ReactTableRowType>[]; - height: number; + height: number; } export const StaticTableBody = (props: StaticTableProps) => { diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/context.ts b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/context.ts index 528d1da0d87f..bcccab3287fb 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/context.ts +++ b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/context.ts @@ -1,7 +1,7 @@ import type { - Row as ReactTableRowType, - TableBodyPropGetter, - TableBodyProps, + Row as ReactTableRowType, + TableBodyPropGetter, + TableBodyProps, } from "react-table"; import React from "react"; @@ -9,37 +9,37 @@ import type { HeaderComponentProps } from "../Table"; import type { ReactTableColumnProps } from "../Constants"; export type TableBodyContextType = { - accentColor: string; - borderRadius: string; - multiRowSelection: boolean; - prepareRow?(row: ReactTableRowType>): void; - selectTableRow?: (row: { - original: Record; - index: number; - }) => void; - selectedRowIndex: number; - selectedRowIndices: number[]; - columns: ReactTableColumnProps[]; - width: number; - rows: ReactTableRowType>[]; - primaryColumnId?: string; - isAddRowInProgress: boolean; - getTableBodyProps?( - propGetter?: TableBodyPropGetter> | undefined, - ): TableBodyProps; - totalColumnsWidth?: number; - } & Partial; - - export const TableBodyContext = React.createContext({ - accentColor: "", - borderRadius: "", - multiRowSelection: false, - selectedRowIndex: -1, - selectedRowIndices: [], - columns: [], - width: 0, - rows: [], - primaryColumnId: "", - isAddRowInProgress: false, - totalColumnsWidth: 0, - }); \ No newline at end of file + accentColor: string; + borderRadius: string; + multiRowSelection: boolean; + prepareRow?(row: ReactTableRowType>): void; + selectTableRow?: (row: { + original: Record; + index: number; + }) => void; + selectedRowIndex: number; + selectedRowIndices: number[]; + columns: ReactTableColumnProps[]; + width: number; + rows: ReactTableRowType>[]; + primaryColumnId?: string; + isAddRowInProgress: boolean; + getTableBodyProps?( + propGetter?: TableBodyPropGetter> | undefined, + ): TableBodyProps; + totalColumnsWidth?: number; +} & Partial; + +export const TableBodyContext = React.createContext({ + accentColor: "", + borderRadius: "", + multiRowSelection: false, + selectedRowIndex: -1, + selectedRowIndices: [], + columns: [], + width: 0, + rows: [], + primaryColumnId: "", + isAddRowInProgress: false, + totalColumnsWidth: 0, +}); diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/index.tsx b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/index.tsx index ec9abed32001..b68e0d62d55b 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/index.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/component/TableBody/index.tsx @@ -1,9 +1,10 @@ import React from "react"; -import { TableBodyContext } from './context' +import { TableBodyContext } from "./context"; import { StaticTableBody } from "./StaticTableBody"; import type { TableBodyContextType } from "./context"; -import { VirtualTableBody, VirtualTableBodyProps } from "./VirtualTableBody"; +import type { VirtualTableBodyProps } from "./VirtualTableBody"; +import { VirtualTableBody } from "./VirtualTableBody"; export const TableBody = ( props: VirtualTableBodyProps & TableBodyContextType & { useVirtual: boolean }, @@ -81,4 +82,4 @@ export const TableBody = ( ); }; -export { TableBodyContext }; \ No newline at end of file +export { TableBodyContext }; diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx b/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx index c04ac6bcdfdf..949dbe026fa6 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx @@ -1,28 +1,20 @@ import styled, { css } from "styled-components"; import type { - TableSizes, CellLayoutProperties, CellAlignment, VerticalAlignment, ImageSize, } from "./Constants"; import { - JUSTIFY_CONTENT, - ALIGN_ITEMS, - IMAGE_HORIZONTAL_ALIGN, - IMAGE_VERTICAL_ALIGN, - TEXT_ALIGN, TABLE_SIZES, ImageSizes, MULTISELECT_CHECKBOX_WIDTH, } from "./Constants"; -import type { Color } from "constants/Colors"; import { Colors } from "constants/Colors"; import { invisible } from "constants/DefaultTheme"; import { lightenColor, darkenColor } from "widgets/WidgetUtils"; import { FontStyleTypes } from "constants/WidgetConstants"; import { Classes } from "@blueprintjs/core"; -import type { TableVariant } from "../constants"; import { Layers } from "constants/Layers"; const BORDER_RADIUS = "border-radius: 4px;"; diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/cellComponents/CheckboxCell.tsx b/app/client/src/widgets/wds/WDSTableWidget/component/cellComponents/CheckboxCell.tsx index b1831023704a..6eca71158daf 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/cellComponents/CheckboxCell.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/component/cellComponents/CheckboxCell.tsx @@ -1,45 +1,7 @@ import React, { memo } from "react"; -import type { BaseCellComponentProps, CellAlignment } from "../Constants"; -import { ALIGN_ITEMS, JUSTIFY_CONTENT } from "../Constants"; -import { CellWrapper, TooltipContentWrapper } from "../TableStyledWrappers"; -import CheckboxComponent from "widgets/CheckboxWidget/component/index"; -import { LabelPosition } from "components/constants"; -import styled from "styled-components"; -import { Tooltip } from "@blueprintjs/core"; +import type { BaseCellComponentProps } from "../Constants"; import { Checkbox } from "@design-system/widgets"; -const UnsavedChangesMarker = styled.div<{ accentColor: string }>` - position: absolute; - top: -1px; - right: -3px; - width: 0; - height: 0; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-bottom: 5px solid ${(props) => props.accentColor}; - transform: rotateZ(45deg); -`; - -const CheckboxCellWrapper = styled(CellWrapper)<{ - horizontalAlignment?: CellAlignment; -}>` - & div { - & .bp3-checkbox { - gap: 0px; - } - } - & .bp3-disabled { - cursor: grab !important; - & .bp3-control-indicator::before { - cursor: grab !important; - } - } - - & > .bp3-popover-wrapper { - overflow: unset; - } -`; - type CheckboxCellProps = BaseCellComponentProps & { value: boolean; accentColor: string; diff --git a/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Basic.ts b/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Basic.ts index 599bffe782df..1002eb3496ea 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Basic.ts +++ b/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Basic.ts @@ -3,15 +3,9 @@ import type { TableWidgetProps } from "widgets/wds/WDSTableWidget/constants"; import { ColumnTypes, ICON_NAMES } from "widgets/wds/WDSTableWidget/constants"; import { hideByColumnType, - hideByMenuItemsSource, - hideIfMenuItemsSourceDataIsFalsy, updateIconAlignment, - updateMenuItemsSource, } from "../../../widget/propertyUtils"; import { IconNames } from "@blueprintjs/icons"; -import { MenuItemsSource } from "widgets/MenuButtonWidget/constants"; -import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory"; -import configureMenuItemsConfig from "./childPanels/configureMenuItemsConfig"; export default { sectionName: "Basic", @@ -34,7 +28,6 @@ export default { updateHook: updateIconAlignment, dependencies: ["primaryColumns", "columnOrder"], controlType: "ICON_SELECT", - defaultIconName: "add", isJSConvertible: true, isBindProperty: true, diff --git a/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/General.ts b/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/General.ts index fea9de9aec30..48c35117c990 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/General.ts +++ b/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/General.ts @@ -1,11 +1,7 @@ import { ValidationTypes } from "constants/WidgetValidation"; import type { TableWidgetProps } from "widgets/wds/WDSTableWidget/constants"; import { ColumnTypes } from "widgets/wds/WDSTableWidget/constants"; -import { - hideByColumnType, - updateColumnOrderWhenFrozen, -} from "../../../widget/propertyUtils"; -import { StickyType } from "widgets/wds/WDSTableWidget/component/Constants"; +import { hideByColumnType } from "../../../widget/propertyUtils"; import { BUTTON_VARIANTS } from "@design-system/widgets"; import capitalize from "lodash/capitalize"; @@ -19,7 +15,6 @@ export default { helpText: "Controls the visibility of the cell in the column", defaultValue: true, controlType: "SWITCH", - isJSConvertible: true, isBindProperty: true, isTriggerProperty: false, @@ -36,7 +31,6 @@ export default { helpText: "Controls the disabled state of the button", defaultValue: false, controlType: "SWITCH", - isJSConvertible: true, isBindProperty: true, isTriggerProperty: false, @@ -60,7 +54,6 @@ export default { helpText: "Decides if menu items will consume lesser space", label: "Compact", controlType: "SWITCH", - isJSConvertible: true, isBindProperty: true, validation: { @@ -82,7 +75,6 @@ export default { helpText: "Allows content of the cell to be wrapped", defaultValue: false, controlType: "SWITCH", - isJSConvertible: true, isBindProperty: true, isTriggerProperty: false, @@ -110,7 +102,6 @@ export const GeneralStyle = { propertyName: "buttonVariant", label: "Button variant", controlType: "DROP_DOWN", - fullWidth: true, helpText: "Sets the variant of the button", options: Object.values(BUTTON_VARIANTS).map((variant) => ({ diff --git a/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Icon.ts b/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Icon.ts index 6bcc80c731e7..5e6b9cb14233 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Icon.ts +++ b/app/client/src/widgets/wds/WDSTableWidget/config/propertyPaneConfig/PanelConfig/Icon.ts @@ -20,7 +20,6 @@ export default { updateHook: updateIconAlignment, dependencies: ["primaryColumns", "columnOrder"], controlType: "ICON_SELECT", - isJSConvertible: true, isBindProperty: true, isTriggerProperty: false, diff --git a/app/client/src/widgets/wds/WDSTableWidget/widget/utilities.ts b/app/client/src/widgets/wds/WDSTableWidget/widget/utilities.ts index 40d8ef197c7f..1c4a7b709507 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/widget/utilities.ts +++ b/app/client/src/widgets/wds/WDSTableWidget/widget/utilities.ts @@ -201,7 +201,7 @@ export function getDefaultColumnProperties( isDerived: !!isDerived, label: id, isSaveVisible: true, - isDiscardVisible: true, + isDiscardVisible: true, sticky: StickyType.NONE, validation: {}, currencyCode: "USD",