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(toggle-button-group): added min columns option #2228

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(toggle-button-group): added min columns option
  • Loading branch information
ArtBlue committed Aug 7, 2024
commit bb79a2e2e5a20ab2dab3938da42fc9765e8d2715
1 change: 1 addition & 0 deletions src/components/ebay-toggle-button-group/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface ToggleButtonGroupInput
variant?: "checkbox" | "radio" | "radio-toggle";
"a11y-text"?: string;
"a11y-label-id"?: string;
columnsMin?: number;
columnsXS?: number;
columnsSM?: number;
columnsMD?: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ebay-toggle-button-group columnsSM=3 columnsXS=2 columnsMD=6 columnsXL=8 ...input>
<ebay-toggle-button-group columnsMin=1 columnsSM=3 columnsXS=2 columnsMD=6 columnsXL=8 ...input>
<@button>
First Item
<@subtitle>Empty on load</@subtitle>
Expand Down
2 changes: 2 additions & 0 deletions src/components/ebay-toggle-button-group/index.marko
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { processHtmlAttributes } from "../../common/html-attributes";
$ const {
class: inputClass,
layoutType: baseLayoutType,
columnsMin,
columnsXS,
columnsSM,
columnsMD,
Expand All @@ -15,6 +16,7 @@ $ const {

<div
class=["toggle-button-group", inputClass]
data-columns-min=columnsMin
data-columns-xs=columnsXS
data-columns-sm=columnsSM
data-columns-md=columnsMD
Expand Down
1 change: 1 addition & 0 deletions src/components/ebay-toggle-button-group/marko-tag.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"@html-attributes": "expression",
"@radio": "boolean",
"@columnsMin": "number",
"@columnsMD": "number",
"@columnsSM": "number",
"@columnsXS": "number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div
class="toggle-button-group"
data-columns-md="6"
data-columns-min="1"
data-columns-sm="3"
data-columns-xl="8"
data-columns-xs="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export default {
description:
'Selection type for the buttons in the group. May be `"checkbox"` (default), `"radio"`, or `"radio-toggle"` (same as radio but with the option to deselect)',
},
columnsMin: {
type: "number",
control: { type: "number" },
description:
"Preferred minimum number of columns for smallest container/screen (1-3). If this is not set will do an automatic layout. It is recommended to not set this unless needed.",
},
columnsXS: {
type: "number",
control: { type: "number" },
Expand Down Expand Up @@ -145,6 +151,7 @@ export const PerferedColumns = buildExtensionTemplate(
columnsTemplate,
columnsCode,
{
columnsMin: 1,
columnsSM: 3,
columnsXS: 2,
columnsMD: 6,
Expand Down
Loading