-
-
Notifications
You must be signed in to change notification settings - Fork 72
Styling as listview #179
Styling as listview #179
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,35 +12,131 @@ | |
| 0px @bottom 0px 0px @color; | ||
| } | ||
|
|
||
| .top-left-cells() { | ||
| .left-cells(); | ||
| .top-cells(); | ||
| .top-left-cells(@isListView) { | ||
| .left-cells(@isListView); | ||
| .top-cells(@isListView); | ||
|
|
||
| tr:first-of-type { | ||
| td:first-of-type, | ||
| th:first-of-type { | ||
| .inset-shadow(var(--border), 1px, 1px, -1px, -1px); | ||
| & when (@isListView = True) { | ||
| .inset-shadow(var(--border), 0px, 1px, 0px, -1px); | ||
| } | ||
|
|
||
| & when (@isListView = False) { | ||
| .inset-shadow(var(--border), 1px, 1px, -1px, -1px); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .top-cells() { | ||
| .top-cells(@isListView) { | ||
| tr:first-of-type { | ||
| td, th { | ||
| .inset-shadow(var(--border), 0px, 1px, -1px, -1px); | ||
| & when (@isListView = True) { | ||
| .inset-shadow(var(--border), 0px, 1px, 0px, -1px); | ||
| } | ||
|
|
||
| & when (@isListView = False) { | ||
| .inset-shadow(var(--border), 0px, 1px, -1px, -1px); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .left-cells() { | ||
| .left-cells(@isListView) { | ||
| tr { | ||
| td:first-of-type, | ||
| th:first-of-type { | ||
| .inset-shadow(var(--border), 1px, 0px, -1px, -1px); | ||
| & when (@isListView = True) { | ||
| .inset-shadow(var(--border), 0px, 0px, 0px, -1px); | ||
| } | ||
|
|
||
| & when (@isListView = False) { | ||
| .inset-shadow(var(--border), 1px, 0px, -1px, -1px); | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| .dash-borders(@isListView) { | ||
| &:not(.dash-freeze-top):not(.dash-freeze-left) { | ||
| .cell-1-1 { | ||
| .top-left-cells(@isListView); | ||
| } | ||
| } | ||
|
|
||
| &:not(.dash-freeze-top).dash-freeze-left { | ||
| .cell-1-0 { | ||
| .top-left-cells(@isListView); | ||
| } | ||
|
|
||
| .cell-1-1 { | ||
| .top-cells(@isListView); | ||
| } | ||
| } | ||
|
|
||
| &.dash-freeze-top:not(.dash-freeze-left) { | ||
| .cell-0-1 { | ||
| .top-left-cells(@isListView); | ||
| } | ||
|
|
||
| .cell-1-1 { | ||
| .left-cells(@isListView); | ||
| } | ||
| } | ||
|
|
||
| &.dash-freeze-top.dash-freeze-left { | ||
| .cell-0-0 { | ||
| .top-left-cells(@isListView); | ||
| } | ||
|
|
||
| .cell-0-1 { | ||
| .top-cells(@isListView); | ||
| } | ||
|
|
||
| .cell-1-0 { | ||
| .left-cells(@isListView); | ||
| } | ||
| } | ||
|
|
||
| td, th { | ||
| & when (@isListView = True) { | ||
| .inset-shadow(var(--border), 0px, 0px, 0px, -1px); | ||
| } | ||
|
|
||
| & when (@isListView = False) { | ||
| .inset-shadow(var(--border), 0px, 0px, -1px, -1px); | ||
| } | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| } | ||
| } | ||
|
|
||
| td.focused { | ||
| & when (@isListView = True) { | ||
| .inset-shadow(var(--accent), 0px, 0px, 0px, -1px); | ||
| } | ||
|
|
||
| & when (@isListView = False) { | ||
| .outline-shadow(var(--accent), 1px, 1px, 0, 0); | ||
| border: 1px solid var(--accent); | ||
| } | ||
| } | ||
|
|
||
| .dash-filter.invalid { | ||
| & when (@isListView = True) { | ||
| .inset-shadow(red, 0px, 0px, 0px, -1px); | ||
| } | ||
|
|
||
| & when (@isListView = False) { | ||
| .inset-shadow(red, 1px, 1px, -1px, -1px); | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. td.focused and .dash-filter.invalid styling moved here to make isListView variable available |
||
| } | ||
| } | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving the block of code related to styling the cells and making it a mixin that accepts one parameter (isListView) -- follow up styling and mixin calls is based on that variable |
||
| .fit-content-polyfill() { | ||
| width: auto; // MS Edge, IE | ||
| width: fit-content; // Chrome | ||
|
|
@@ -162,61 +258,16 @@ | |
| } | ||
| } | ||
|
|
||
| &:not(.dash-freeze-top):not(.dash-freeze-left) { | ||
| .cell-1-1 { | ||
| .top-left-cells(); | ||
| } | ||
| &:not(.dash-list-view) { | ||
| .dash-borders(False); | ||
| } | ||
|
|
||
| &:not(.dash-freeze-top).dash-freeze-left { | ||
| .cell-1-0 { | ||
| .top-left-cells(); | ||
| } | ||
|
|
||
| .cell-1-1 { | ||
| .top-cells(); | ||
| } | ||
| &.dash-list-view { | ||
| .dash-borders(True); | ||
| } | ||
|
|
||
| &.dash-freeze-top:not(.dash-freeze-left) { | ||
| .cell-0-1 { | ||
| .top-left-cells(); | ||
| } | ||
|
|
||
| .cell-1-1 { | ||
| .left-cells(); | ||
| } | ||
| } | ||
|
|
||
| &.dash-freeze-top.dash-freeze-left { | ||
| .cell-0-0 { | ||
| .top-left-cells(); | ||
| } | ||
|
|
||
| .cell-0-1 { | ||
| .top-cells(); | ||
| } | ||
|
|
||
| .cell-1-0 { | ||
| .left-cells(); | ||
| } | ||
| } | ||
|
|
||
| .cell { | ||
| td, th { | ||
| .inset-shadow(var(--border), 0px, 0px, -1px, -1px); | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .filter { | ||
| &.invalid { | ||
| .inset-shadow(red, 1px, 1px, -1px, -1px); | ||
| background-color: pink; | ||
| } | ||
| .dash-filter.invalid { | ||
| background-color: pink; | ||
| } | ||
|
|
||
| .selected-row { | ||
|
|
@@ -237,9 +288,6 @@ | |
| } | ||
|
|
||
| &.focused { | ||
| // .shadow(red, 1px, 1px, 0, 0); | ||
| .outline-shadow(var(--accent), 1px, 1px, 0, 0); | ||
| border: 1px solid var(--accent); | ||
| margin: -1px; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style fragments unaffected by table style are left as is. |
||
| z-index: 200; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,7 @@ export interface IVisibleColumn { | |
| editable?: boolean; | ||
| editable_name?: boolean | number; | ||
| id: ColumnId; | ||
| name: string; | ||
| name: string | string[]; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. array of strings support |
||
| options?: { label: string | number, value: string | number }[]; // legacy | ||
| type?: ColumnType; | ||
| } | ||
|
|
@@ -136,6 +136,7 @@ interface IProps { | |
| sorting_settings?: SortSettings; | ||
| sorting_type?: SortingType; | ||
| sorting_treat_empty_string_as_none?: boolean; | ||
| style_as_list_view?: boolean; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adding this back |
||
| pagination_mode?: PaginationMode; | ||
| pagination_settings?: IPaginationSettings; | ||
|
|
||
|
|
@@ -176,6 +177,7 @@ interface IDefaultProps { | |
| sorting_settings: SortSettings; | ||
| sorting_type: SortingType; | ||
| sorting_treat_empty_string_as_none: boolean; | ||
| style_as_list_view: boolean; | ||
|
|
||
| pagination_mode: PaginationMode; | ||
| pagination_settings: IPaginationSettings; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing react warnings that appeared after tightening the column props