Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b79817

Browse filesBrowse files
committed
Add cannotStartYet prop
1 parent 50f32c2 commit 7b79817
Copy full SHA for 7b79817

File tree

Expand file treeCollapse file tree

1 file changed

+10
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-2
lines changed
Open diff view settings
Collapse file

‎src/components/govuk-vue/task-list/GvTaskListItem.vue‎

Copy file name to clipboardExpand all lines: src/components/govuk-vue/task-list/GvTaskListItem.vue
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ const props = defineProps({
4242
statusClass: {
4343
type: [String, Array, Object],
4444
default: ''
45-
}
45+
},
46+
/**
47+
* Set to `true` if the task cannot be started yet. This will make the status text grey.
48+
*/
49+
cannotStartYet: Boolean
4650
})
4751
4852
const id = createUid('gv-task-list-item')
@@ -83,6 +87,10 @@ const statusId = computed(() => {
8387
return hasStatus.value ? `${id}-status` : undefined
8488
})
8589
90+
const computedStatusClass = computed(() => {
91+
return `${props.cannotStartYet ? 'govuk-task-list__status--cannot-start-yet' : ''} ${normalizeClass(props.statusClass)}`
92+
})
93+
8694
const computedDescribedBy = computed(() => {
8795
if (computedTitleElement.value === 'div') {
8896
return undefined
@@ -116,7 +124,7 @@ const computedDescribedBy = computed(() => {
116124
</slot>
117125
</div>
118126
</div>
119-
<div :id="statusId" class="govuk-task-list__status" :class="statusClass">
127+
<div :id="statusId" class="govuk-task-list__status" :class="computedStatusClass">
120128
<!-- @slot The content of the status, usually a `GvTag`. If content is provided in this slot, the `hint` prop will be ignored. -->
121129
<slot name="status">
122130
{{ status }}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.