-
Notifications
You must be signed in to change notification settings - Fork 0
Adjustments after review #171
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
Open
gkrajniak
wants to merge
8
commits into
main
Choose a base branch
from
feat/adjust-ref-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dfce238
Adjust the dragging cursor
gkrajniak e1bd42b
Adjust the dragging cursor
gkrajniak c75fde5
Adjust after review
gkrajniak 2c131f3
Adjust after review
gkrajniak 3c945f9
Adjust after review
gkrajniak ae29745
Adjust after review
gkrajniak 5cf1778
Adjust after review
gkrajniak c351ee0
Merge branch 'main' into feat/adjust-ref-2
gkrajniak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
projects/ngx/declarative-ui/dashboard/models/_breakpoints.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // ───────────────────────────────────────────────────────────────────────────── | ||
| // MUST MATCH: ./breakpoints.ts | ||
| // | ||
| // SCSS half of the shared dashboard breakpoint table. Consumed by | ||
| // dashboard.component.scss for @container queries on .mfp-sections-container. | ||
| // Keep these values identical to DASHBOARD_BREAKPOINTS in breakpoints.ts. | ||
| // ───────────────────────────────────────────────────────────────────────────── | ||
|
|
||
| // Each breakpoint's max-width (in px) and the corresponding column count | ||
| // applied at that breakpoint. Ordered ascending by `w` so it's easy to read | ||
| // off as a series of (max-width, columns) pairs. | ||
| $dashboard-breakpoints: ( | ||
| (599, 4), | ||
| (1023, 8), | ||
| (1439, 12), | ||
| // Above 1439: 14 columns. Implemented as the default (no @container rule); | ||
| // the 4000 ceiling exists in the TS table for Gridstack's benefit only. | ||
| ); | ||
|
|
||
| /// Convenience accessors for the four breakpoint widths used by the grid. | ||
| $dashboard-bp-sm: 599px; | ||
| $dashboard-bp-md: 1023px; | ||
| $dashboard-bp-lg: 1439px; | ||
|
|
||
| /// Column counts at each breakpoint. | ||
| $dashboard-cols-sm: 4; | ||
| $dashboard-cols-md: 8; | ||
| $dashboard-cols-lg: 12; | ||
| $dashboard-cols-xl: 14; | ||
|
|
||
| /// Emit `grid-template-columns: repeat(N, 1fr)` rules wrapped in @container | ||
| /// queries against the `mfp-dashboard` named container. Every dashboard grid | ||
| /// (the section-laying-out one and each section's card-laying-out one) calls | ||
| /// this so the column counts stay aligned. | ||
| /// | ||
| /// `$override` lets a caller substitute a CSS variable in front of each value | ||
| /// (used by .section__grid to honour an explicit `--cols` override before | ||
| /// falling back to the responsive default). | ||
| @mixin dashboard-grid-columns($override: null) { | ||
| $sm: if($override, var($override, #{$dashboard-cols-sm}), $dashboard-cols-sm); | ||
| $md: if($override, var($override, #{$dashboard-cols-md}), $dashboard-cols-md); | ||
| $lg: if($override, var($override, #{$dashboard-cols-lg}), $dashboard-cols-lg); | ||
| $xl: if($override, var($override, #{$dashboard-cols-xl}), $dashboard-cols-xl); | ||
|
|
||
| grid-template-columns: repeat(#{$xl}, 1fr); | ||
|
|
||
| @container mfp-dashboard (max-width: #{$dashboard-bp-sm}) { | ||
| grid-template-columns: repeat(#{$sm}, 1fr); | ||
| } | ||
|
|
||
| @container mfp-dashboard (min-width: #{$dashboard-bp-sm + 1px}) and (max-width: #{$dashboard-bp-md}) { | ||
| grid-template-columns: repeat(#{$md}, 1fr); | ||
| } | ||
|
|
||
| @container mfp-dashboard (min-width: #{$dashboard-bp-md + 1px}) and (max-width: #{$dashboard-bp-lg}) { | ||
| grid-template-columns: repeat(#{$lg}, 1fr); | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
projects/ngx/declarative-ui/dashboard/models/breakpoints.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // ───────────────────────────────────────────────────────────────────────────── | ||
| // MUST MATCH: ./_breakpoints.scss | ||
| // | ||
| // These breakpoints are consumed by two systems that can't share a single | ||
| // source of truth at compile time: | ||
| // | ||
| // 1. dashboard.component.ts — passed to Gridstack as | ||
| // `gridOptions.columnOpts.breakpoints`. Gridstack picks the active | ||
| // breakpoint by `w` (max-width). At each breakpoint, every grid item is | ||
| // laid out using `c` columns. | ||
| // | ||
| // 2. dashboard.component.scss — used in a `@container` query so the | ||
| // `.mfp-sections-container` CSS grid mirrors the same column count as | ||
| // Gridstack at the same width. | ||
| // | ||
| // If you change either set of values, change BOTH files in the same commit. | ||
| // The two are kept in sync by hand (no codegen). A SCSS-from-TS generator | ||
| // would remove this hazard but is out of scope here. | ||
| // ───────────────────────────────────────────────────────────────────────────── | ||
|
|
||
| import type { Breakpoint } from 'gridstack'; | ||
|
|
||
| /** | ||
| * Layout strategy applied at each breakpoint when Gridstack changes column | ||
| * count. See ColumnOptions in gridstack/dist/types.d.ts:27 for the full set. | ||
| */ | ||
| type LayoutStrategy = 'compact' | 'list' | 'none'; | ||
|
|
||
| /** Single source of truth for grid + section breakpoints (TypeScript half). */ | ||
| export const DASHBOARD_BREAKPOINTS: ReadonlyArray< | ||
| Readonly<Required<Pick<Breakpoint, 'w' | 'c'>> & { layout: LayoutStrategy }> | ||
| > = [ | ||
|
gkrajniak marked this conversation as resolved.
|
||
| { w: 4000, c: 14, layout: 'compact' }, | ||
| { w: 1439, c: 12, layout: 'compact' }, | ||
| { w: 1023, c: 8, layout: 'compact' }, | ||
| { w: 599, c: 4, layout: 'list' }, | ||
| ] as const; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from './dashboard.model'; | ||
| export * from './breakpoints'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.