Skip to content

Commit 4a63a85

Browse files
authored
Merge branch 'master' into bug-kw-radio-group-styling
2 parents 0901aa2 + 5b6f345 commit 4a63a85

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

src/app/shared/components/template/components/progress-path/progress-path.component.ts

+21-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TemplateTranslateService } from "../../services/template-translate.serv
55

66
interface IProgressPathParams {
77
/** TEMPLATE_PARAMETER: "variant". Default "wavy" */
8-
variant: "basic" | "wavy";
8+
variant: "basic" | "wavy" | "curved";
99
}
1010

1111
// HACK - hardcoded sizing values to make content fit reasonably well
@@ -27,7 +27,7 @@ const SIZING = {
2727
})
2828
export class TmplProgressPathComponent extends TemplateBaseComponent implements OnInit {
2929
private params: Partial<IProgressPathParams> = {};
30-
private pathVariant: "basic" | "wavy";
30+
private pathVariant: "basic" | "wavy" | "curved";
3131

3232
public svgPath: string;
3333
public svgViewBox: string;
@@ -47,14 +47,14 @@ export class TmplProgressPathComponent extends TemplateBaseComponent implements
4747
this.params.variant = getStringParamFromTemplateRow(this._row, "variant", "wavy")
4848
.split(",")
4949
.join(" ") as IProgressPathParams["variant"];
50-
this.pathVariant = this.params.variant.includes("basic") ? "basic" : "wavy";
50+
this.pathVariant = this.params.variant;
5151
}
5252

5353
/**
5454
* Generate a base SVG segment used to connect 2 progress items together
5555
* Roughly a horizontal line and smooth bend, adjusted for sizing
5656
*/
57-
private generateSVGPath(variant: "basic" | "wavy" = "wavy") {
57+
private generateSVGPath(variant: "basic" | "curved" | "wavy" = "wavy") {
5858
// arbitrary values used to make base width/height fit
5959
const { widthPx, xOffset, yOffset, textContentHeight } = SIZING;
6060

@@ -87,7 +87,23 @@ export class TmplProgressPathComponent extends TemplateBaseComponent implements
8787
c 48,0 72,64 48,${viewboxHeight - yOffset - 4}
8888
`.trim();
8989

90-
this.svgPath = variant === "basic" ? basic() : wavy();
90+
const curved = () =>
91+
`
92+
M ${xOffset},${yOffset}
93+
c 0,140 280,-80 252,160 1
94+
v 80
95+
`.trim();
96+
97+
switch (variant) {
98+
case "basic":
99+
this.svgPath = basic();
100+
break;
101+
case "curved":
102+
this.svgPath = curved();
103+
break;
104+
default:
105+
this.svgPath = wavy();
106+
}
91107
this.svgViewBox = `0 0 ${widthPx} ${viewboxHeight}`;
92108
this.contentHeight = `${textContentHeight}px`;
93109
}

yarn.lock

+19-10
Original file line numberDiff line numberDiff line change
@@ -6252,13 +6252,13 @@ __metadata:
62526252
languageName: node
62536253
linkType: hard
62546254

6255-
"@octokit/endpoint@npm:^10.0.0":
6256-
version: 10.1.2
6257-
resolution: "@octokit/endpoint@npm:10.1.2"
6255+
"@octokit/endpoint@npm:^10.1.3":
6256+
version: 10.1.3
6257+
resolution: "@octokit/endpoint@npm:10.1.3"
62586258
dependencies:
62596259
"@octokit/types": ^13.6.2
62606260
universal-user-agent: ^7.0.2
6261-
checksum: 425f4b0f12e2565d7270522e2e42d0595bd16c2c16fe262b540d50fc94d279e93b37b670370ae23dfe6117a2b74c69ffd7d3644e4dea5e6fc576a562ed75fba4
6261+
checksum: 47253e341ea1ef2d22fd33566753574f97fa28ebc8a9869821dd4f3f0eca2541562f31317118d203b91194804f1bac5f3373a261abb0b7b7a47ef84d6a88c124
62626262
languageName: node
62636263
linkType: hard
62646264

@@ -6378,7 +6378,7 @@ __metadata:
63786378
languageName: node
63796379
linkType: hard
63806380

6381-
"@octokit/request-error@npm:^6.0.1, @octokit/request-error@npm:^6.1.6":
6381+
"@octokit/request-error@npm:^6.1.6":
63826382
version: 6.1.6
63836383
resolution: "@octokit/request-error@npm:6.1.6"
63846384
dependencies:
@@ -6387,16 +6387,25 @@ __metadata:
63876387
languageName: node
63886388
linkType: hard
63896389

6390+
"@octokit/request-error@npm:^6.1.7":
6391+
version: 6.1.7
6392+
resolution: "@octokit/request-error@npm:6.1.7"
6393+
dependencies:
6394+
"@octokit/types": ^13.6.2
6395+
checksum: 02273f6388f1fa8e9962f5eeddffac784454200fa291d9e2333eeaa53f70fbf3fb8d9bca191f38457c455dda758b95c8db50167085cfd6f97dd7a67a5aff452d
6396+
languageName: node
6397+
linkType: hard
6398+
63906399
"@octokit/request@npm:^9.1.4":
6391-
version: 9.2.0
6392-
resolution: "@octokit/request@npm:9.2.0"
6400+
version: 9.2.2
6401+
resolution: "@octokit/request@npm:9.2.2"
63936402
dependencies:
6394-
"@octokit/endpoint": ^10.0.0
6395-
"@octokit/request-error": ^6.0.1
6403+
"@octokit/endpoint": ^10.1.3
6404+
"@octokit/request-error": ^6.1.7
63966405
"@octokit/types": ^13.6.2
63976406
fast-content-type-parse: ^2.0.0
63986407
universal-user-agent: ^7.0.2
6399-
checksum: 24056e2c3c634bfca5f72277b6cd69f69ad2a58c033a0e96c2fa626e3e6a028f6ca58702aecceb5f2f4ed23a583b16df2dd728fa02dce910dc081bfcbc64ad92
6408+
checksum: b5600cca1823bd1a16a9d85298351d9879c399b5acbaf4c99c77c62c2eaf18fb66debc29ab82e8b0bc3e6b098ab01c0075a843dc57f0647ad9a6dc7cb8e18aa9
64006409
languageName: node
64016410
linkType: hard
64026411

0 commit comments

Comments
 (0)