Skip to content

Commit 02528f2

Browse files
author
iropolo
committed
fix(components): DLT-3100 remove rootClass references
1 parent 589edb5 commit 02528f2

25 files changed

Lines changed: 55 additions & 124 deletions

packages/dialtone-vue/common/mixins/input.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,6 @@ export const InputMixin = {
105105
type: Object,
106106
default: () => ({}),
107107
},
108-
109-
/**
110-
* Additional class name for the root element.
111-
* Can accept all of: String, Object, and Array, i.e. has the
112-
* same api as Vue's built-in handling of the class attribute.
113-
*/
114-
rootClass: {
115-
type: [String, Object, Array],
116-
default: '',
117-
},
118108
},
119109

120110
data () {

packages/dialtone-vue/components/breadcrumbs/breadcrumb.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ describe('DtBreadcrumb Tests', () => {
122122
});
123123

124124
describe('Extendability Tests', () => {
125-
describe('When a rootClass is provided to a breadcrumb item', () => {
126-
it('should include the root class', () => {
125+
describe('When a class is provided to a breadcrumb item', () => {
126+
it('should include the class', () => {
127127
mockProps = {
128128
breadcrumbs: [{
129129
url: '#',
130130
label: 'Root',
131-
rootClass: MOCK_ROOT_CLASS,
131+
class: MOCK_ROOT_CLASS,
132132
}],
133133
}
134134

packages/dialtone-vue/components/breadcrumbs/breadcrumb_item.vue

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<li
33
data-qa="dt-breadcrumb-item"
44
:class="[
5-
rootClass,
65
'd-breadcrumbs__item',
76
{ [BREADCRUMB_ITEM_SELECTED_MODIFIER]: selected },
7+
$attrs.class,
88
]"
9-
v-bind="addClassStyleAttrs($attrs)"
9+
:style="$attrs.style"
1010
>
1111
<dt-link
1212
:kind="linkKind"
@@ -27,7 +27,7 @@
2727

2828
<script>
2929
import { BREADCRUMB_ITEM_SELECTED_MODIFIER } from './breadcrumbs_constants';
30-
import { removeClassStyleAttrs, addClassStyleAttrs } from '@/common/utils';
30+
import { removeClassStyleAttrs } from '@/common/utils';
3131
import { DtLink, MUTED } from '@/components/link';
3232
3333
export default {
@@ -65,16 +65,6 @@ export default {
6565
type: String,
6666
default: '',
6767
},
68-
69-
/**
70-
* Additional class name for the root element.
71-
* Can accept all of: String, Object, and Array, i.e. has the
72-
* same api as Vue's built-in handling of the class attribute.
73-
*/
74-
rootClass: {
75-
type: [String, Object, Array],
76-
default: '',
77-
},
7868
},
7969
8070
data () {
@@ -100,7 +90,6 @@ export default {
10090
10191
methods: {
10292
removeClassStyleAttrs,
103-
addClassStyleAttrs,
10493
},
10594
};
10695
</script>

packages/dialtone-vue/components/breadcrumbs/breadcrumb_item_default.story.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:selected="$attrs.selected"
55
:label="$attrs.label"
66
:href="$attrs.href"
7-
:root-class="$attrs.rootClass"
7+
:class="$attrs.class"
88
/>
99
</template>
1010

packages/dialtone-vue/components/checkbox/checkbox.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,9 @@ describe('DtCheckbox Tests', () => {
580580
});
581581
});
582582

583-
describe('When a rootClass is provided', () => {
584-
it('should include the root class', () => {
585-
mockProps = { rootClass: MOCK_ROOT_CLASS }
583+
describe('When a class is provided', () => {
584+
it('should include the class', () => {
585+
mockAttrs = { class: MOCK_ROOT_CLASS }
586586

587587
updateWrapper();
588588

packages/dialtone-vue/components/checkbox/checkbox.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
3-
:class="rootClass"
4-
v-bind="addClassStyleAttrs($attrs)"
3+
:class="$attrs.class"
4+
:style="$attrs.style"
55
>
66
<label :class="['d-checkbox-group', { 'd-checkbox-group--disabled': internalDisabled }]">
77
<div class="d-checkbox__input">
@@ -72,7 +72,7 @@ import {
7272
GroupableMixin,
7373
MessagesMixin,
7474
} from '@/common/mixins/input';
75-
import { removeClassStyleAttrs, addClassStyleAttrs } from '@/common/utils';
75+
import { removeClassStyleAttrs } from '@/common/utils';
7676
import { CHECKBOX_INPUT_VALIDATION_CLASSES } from './checkbox_constants';
7777
import { DtValidationMessages } from '../validation_messages';
7878
import { DtText, TEXT_SIZE_MODIFIERS, TEXT_STRENGTH_MODIFIERS } from '@/components/text';
@@ -214,7 +214,6 @@ export default {
214214
215215
methods: {
216216
removeClassStyleAttrs,
217-
addClassStyleAttrs,
218217
219218
emitValue (target) {
220219
let { value, checked } = target;

packages/dialtone-vue/components/checkbox/checkbox_default.story.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
:description-child-props="$attrs.descriptionChildProps"
1515
:indeterminate="$attrs.indeterminate"
1616
:messages="$attrs.messages"
17-
:root-class="$attrs.rootClass"
17+
:class="$attrs.class"
1818
@input="$attrs.onInput"
1919
@focusin="$attrs.onFocusIn"
2020
@focusout="$attrs.onFocusOut"

packages/dialtone-vue/components/input/input.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,9 +844,9 @@ describe('DtInput tests', () => {
844844
expect(nativeInput.element.disabled).toBe(true);
845845
});
846846

847-
describe('When a rootClass is provided', () => {
848-
it('should include the root class', () => {
849-
mockProps = { rootClass: MOCK_ROOT_CLASS }
847+
describe('When a class is provided', () => {
848+
it('should include the class', () => {
849+
mockAttrs = { class: MOCK_ROOT_CLASS }
850850

851851
updateWrapper();
852852

packages/dialtone-vue/components/input/input.vue

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<div
33
ref="container"
4-
:class="[rootClass, 'd-input__root', { 'd-input--hidden': hidden }]"
5-
v-bind="addClassStyleAttrs($attrs)"
4+
:class="['d-input__root', { 'd-input--hidden': hidden }, $attrs.class]"
5+
:style="$attrs.style"
66
data-qa="dt-input"
77
>
88
<label
@@ -152,7 +152,6 @@ import {
152152
getValidationState,
153153
hasSlotContent,
154154
removeClassStyleAttrs,
155-
addClassStyleAttrs,
156155
} from '@/common/utils';
157156
import { DtValidationMessages } from '@/components/validation_messages';
158157
import { DtText, TEXT_SIZE_MODIFIERS, TEXT_STRENGTH_MODIFIERS } from '@/components/text';
@@ -276,16 +275,6 @@ export default {
276275
default: '',
277276
},
278277
279-
/**
280-
* Additional class name for the root element.
281-
* Can accept all of: String, Object, and Array, i.e. has the
282-
* same api as Vue's built-in handling of the class attribute.
283-
*/
284-
rootClass: {
285-
type: [String, Object, Array],
286-
default: '',
287-
},
288-
289278
/**
290279
* The current character length that the user has entered into the input.
291280
* This will only need to be used if you are using `validate.length` and
@@ -651,7 +640,6 @@ export default {
651640
652641
methods: {
653642
removeClassStyleAttrs,
654-
addClassStyleAttrs,
655643
inputClasses () {
656644
return [
657645
'd-input__input',

packages/dialtone-vue/components/radio/radio.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ describe('DtRadio Tests', () => {
557557
});
558558

559559
describe('Extendability Tests', () => {
560-
describe('When a rootClass is provided', () => {
561-
it('should include the root class', () => {
562-
mockProps = { rootClass: MOCK_ROOT_CLASS }
560+
describe('When a class is provided', () => {
561+
it('should include the class', () => {
562+
mockAttrs = { class: MOCK_ROOT_CLASS }
563563

564564
updateWrapper();
565565

0 commit comments

Comments
 (0)