Skip to content

Commit 44eb9a9

Browse files
authored
Merge pull request #6507 from nextcloud-libraries/fix/noid/stylelint
fix(NcAction*): complete BiDi support
2 parents 0696745 + e1424a4 commit 44eb9a9

12 files changed

Lines changed: 35 additions & 37 deletions

File tree

src/components/NcActionCaption/NcActionCaption.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export default {
5252
box-shadow: none !important;
5353
user-select: none;
5454
pointer-events: none;
55-
margin-left: 12px;
56-
padding-right: 14px;
55+
margin-inline-start: 12px;
56+
padding-inline-end: 14px;
5757
height: var(--default-clickable-area);
5858
display: flex;
5959
align-items: center;

src/components/NcActionCheckbox/NcActionCheckbox.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,9 @@ export default {
233233
/* checkbox/radio fixes */
234234
&__checkbox {
235235
position: absolute;
236-
top: auto;
237-
left: -10000px;
238-
239-
overflow: hidden;
240-
241-
width: 1px;
242-
height: 1px;
236+
inset-inline-start: 0 !important;
237+
z-index: -1;
238+
opacity: 0;
243239
}
244240
245241
&__label {

src/components/NcActionInput/NcActionInput.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,11 @@ $input-margin: 4px;
583583
flex: 1 1 auto;
584584
585585
margin: $input-margin 0;
586-
padding-right: $icon-margin;
586+
padding-inline-end: $icon-margin;
587587
}
588588
589589
&__container {
590+
position: relative;
590591
width: 100%;
591592
}
592593
@@ -615,11 +616,12 @@ $input-margin: 4px;
615616
616617
&--hidden {
617618
position: absolute;
618-
left: -10000px;
619-
top: auto;
619+
inset-inline-start: 0;
620620
width: 1px;
621621
height: 1px;
622622
overflow: hidden;
623+
z-index: -1;
624+
opacity: 0;
623625
}
624626
}
625627

src/components/NcActionRadio/NcActionRadio.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,9 @@ export default {
238238
/* checkbox/radio fixes */
239239
&__radio {
240240
position: absolute;
241-
top: auto;
242-
left: -10000px;
243-
244-
overflow: hidden;
245-
246-
width: 1px;
247-
height: 1px;
241+
inset-inline-start: 0 !important;
242+
z-index: -1;
243+
opacity: 0;
248244
}
249245
250246
&__label {
@@ -253,7 +249,7 @@ export default {
253249
254250
width: 100%;
255251
padding: 0 !important;
256-
padding-right: $icon-margin !important;
252+
padding-inline-end: $icon-margin !important;
257253
258254
// (34 -14) / 2 = 10 same as ncactioncheckbox
259255
&::before {

src/components/NcActionTextEditable/NcActionTextEditable.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export default {
8282
<!-- allow the custom font to inject a ::before
8383
not possible on input[type=submit] -->
8484
<label v-show="!disabled" :for="id" class="action-text-editable__label">
85-
<ArrowRight :size="20" />
85+
<ArrowLeft v-if="isRTL" :size="20" />
86+
<ArrowRight v-else :size="20" />
8687
</label>
8788
</form>
8889
</span>
@@ -94,12 +95,16 @@ import { useModelMigration } from '../../composables/useModelMigration.ts'
9495
import ActionTextMixin from '../../mixins/actionText.js'
9596
import GenRandomId from '../../utils/GenRandomId.js'
9697
98+
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
9799
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
98100
101+
import { isRTL } from '@nextcloud/l10n'
102+
99103
export default {
100104
name: 'NcActionTextEditable',
101105
102106
components: {
107+
ArrowLeft,
103108
ArrowRight,
104109
},
105110
@@ -165,6 +170,7 @@ export default {
165170
const model = useModelMigration('value', 'update:value')
166171
return {
167172
model,
173+
isRTL: isRTL(),
168174
}
169175
},
170176
@@ -276,16 +282,18 @@ $input-margin: 4px;
276282
277283
position: relative;
278284
margin: $input-margin 0;
279-
padding-right: $icon-margin;
285+
padding-inline-end: $icon-margin;
280286
}
281287
282288
&__submit {
283289
position: absolute;
284-
left: -10000px;
290+
inset-inline-start: 0;
285291
top: auto;
286292
width: 1px;
287293
height: 1px;
288294
overflow: hidden;
295+
z-index: -1;
296+
opacity: 0;
289297
}
290298
291299
&__label {
@@ -295,7 +303,7 @@ $input-margin: 4px;
295303
296304
// bottom-right corner
297305
position: absolute;
298-
right: calc($icon-margin + 1);
306+
inset-inline-end: calc($icon-margin + 1px);
299307
bottom: 1px;
300308
width: calc(var(--default-clickable-area) - $input-margin * 2);
301309
height: calc(var(--default-clickable-area) - $input-margin * 2);
@@ -356,7 +364,7 @@ $input-margin: 4px;
356364
z-index: 2;
357365
358366
border-color: var(--color-primary-element);
359-
border-left-color: transparent;
367+
border-inline-start-color: transparent;
360368
}
361369
}
362370
}

src/components/NcActions/NcActions.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,11 +2040,7 @@ export default {
20402040
.action-items {
20412041
display: flex;
20422042
align-items: center;
2043-
2044-
// Spacing between buttons
2045-
& > button {
2046-
margin-right: calc($icon-margin / 2);
2047-
}
2043+
gap: calc($icon-margin / 2);
20482044
}
20492045
20502046
.action-item {

src/components/NcButton/NcButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ td.row-name {
397397
}
398398

399399
td.row-size {
400-
text-align: right;
400+
text-align: end;
401401
padding-inline-end: 16px;
402402
}
403403

src/components/NcColorPicker/NcColorPicker.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ export default {
9494
<style>
9595
.container1 {
9696
display: flex;
97+
gap: 20px;
9798
}
9899

99100
.color1 {
100101
width: 100px;
101102
height: 34px;
102-
margin-left: 20px;
103103
border-radius: 6px;
104104
}
105105
</style>
@@ -129,12 +129,12 @@ export default {
129129
<style>
130130
.container0 {
131131
display: flex;
132+
gap: 20px;
132133
}
133134

134135
.color0 {
135136
width: 100px;
136137
height: 34px;
137-
margin-left: 20px;
138138
border-radius: 6px;
139139
}
140140
</style>

src/components/NcHeaderButton/NcHeaderButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default {
5555
justify-content: right;
5656
background-color: var(--color-primary);
5757
height: var(--header-height, 50px);
58-
padding-right: 12px;
58+
padding-inline-end: 12px;
5959
}
6060
</style>
6161
```

src/components/NcHeaderMenu/NcHeaderMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default {
5050
justify-content: right;
5151
background-color: var(--color-primary);
5252
height: var(--header-height, 50px);
53-
padding-right: 12px;
53+
padding-inline-end: 12px;
5454
}
5555
</style>
5656
```

0 commit comments

Comments
 (0)