Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Add OcCheckbox outline option, OcTable add event to TRow click #2218

Merged
merged 5 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions changelog/unreleased/change-table-emit-event-row-click
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: OcTable emit event data on row click

We've extended the emit data on row click to now also include the event data

https://github.com/owncloud/owncloud-design-system/pull/2218
https://github.com/owncloud/web/issues/6029
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-checkbox-add-outline
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: OcCheckbox add outline

We've added an optional outline to be able to highlight the checkbox

https://github.com/owncloud/owncloud-design-system/pull/2218
https://github.com/owncloud/web/issues/6029
7 changes: 7 additions & 0 deletions src/components/atoms/OcCheckbox/OcCheckbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@ describe("OcCheckbox", () => {
expect(checkbox.element.checked).toBeTruthy()
})
})
describe("set outline", () => {
it("should show outline", async () => {
const wrapper = await getWrapperWithProps({ outline: true })
const checkbox = wrapper.find(checkboxSelector)
expect(checkbox.element._prevClass).toContain("oc-checkbox-outline")
})
})
})
20 changes: 19 additions & 1 deletion src/components/atoms/OcCheckbox/OcCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ export default {
default: "medium",
validator: size => /(small|medium|large)/.test(size),
},
/**
* Show outline of checkbox
**/
outline: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
model: {
Expand All @@ -101,7 +109,12 @@ export default {
},
},
classes() {
return ["oc-checkbox", "oc-rounded", "oc-checkbox-" + getSizeClass(this.size)]
return [
"oc-checkbox",
"oc-rounded",
"oc-checkbox-" + getSizeClass(this.size),
{ "oc-checkbox-outline": this.outline },
]
},
labelClasses() {
return {
Expand Down Expand Up @@ -143,6 +156,11 @@ export default {
overflow: hidden;
vertical-align: middle;
background-color: transparent;
outline: none;

&-outline {
outline: solid 2px var(--oc-color-swatch-passive-default);
}

&-s {
@include oc-form-check-size(0.7);
Expand Down
3 changes: 2 additions & 1 deletion src/components/molecules/OcTable/OcTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
v-bind="extractTbodyTrProps(item, trIndex)"
:data-item-id="item[idKey]"
:draggable="dragDrop"
@click.native="$emit(constants.EVENT_TROW_CLICKED, item)"
@click.native="$emit(constants.EVENT_TROW_CLICKED, [item, $event])"
@contextmenu.native="
$emit(constants.EVENT_TROW_CONTEXTMENU, $refs[`row-${trIndex}`][0], $event, item)
"
Expand Down Expand Up @@ -477,6 +477,7 @@ export default {
}

tr {
outline: none;
height: var(--oc-size-height-table-row);
}

Expand Down