Skip to content

Commit

Permalink
Merge pull request #6507 from nextcloud-libraries/fix/noid/stylelint
Browse files Browse the repository at this point in the history
fix(NcAction*): complete BiDi support
  • Loading branch information
Antreesy authored Feb 13, 2025
2 parents 0696745 + e1424a4 commit 44eb9a9
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 37 deletions.
4 changes: 2 additions & 2 deletions src/components/NcActionCaption/NcActionCaption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default {
box-shadow: none !important;
user-select: none;
pointer-events: none;
margin-left: 12px;
padding-right: 14px;
margin-inline-start: 12px;
padding-inline-end: 14px;
height: var(--default-clickable-area);
display: flex;
align-items: center;
Expand Down
10 changes: 3 additions & 7 deletions src/components/NcActionCheckbox/NcActionCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,9 @@ export default {
/* checkbox/radio fixes */
&__checkbox {
position: absolute;
top: auto;
left: -10000px;

overflow: hidden;

width: 1px;
height: 1px;
inset-inline-start: 0 !important;
z-index: -1;
opacity: 0;
}

&__label {
Expand Down
8 changes: 5 additions & 3 deletions src/components/NcActionInput/NcActionInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,11 @@ $input-margin: 4px;
flex: 1 1 auto;

margin: $input-margin 0;
padding-right: $icon-margin;
padding-inline-end: $icon-margin;
}

&__container {
position: relative;
width: 100%;
}

Expand Down Expand Up @@ -615,11 +616,12 @@ $input-margin: 4px;

&--hidden {
position: absolute;
left: -10000px;
top: auto;
inset-inline-start: 0;
width: 1px;
height: 1px;
overflow: hidden;
z-index: -1;
opacity: 0;
}
}

Expand Down
12 changes: 4 additions & 8 deletions src/components/NcActionRadio/NcActionRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,9 @@ export default {
/* checkbox/radio fixes */
&__radio {
position: absolute;
top: auto;
left: -10000px;

overflow: hidden;

width: 1px;
height: 1px;
inset-inline-start: 0 !important;
z-index: -1;
opacity: 0;
}

&__label {
Expand All @@ -253,7 +249,7 @@ export default {

width: 100%;
padding: 0 !important;
padding-right: $icon-margin !important;
padding-inline-end: $icon-margin !important;

// (34 -14) / 2 = 10 same as ncactioncheckbox
&::before {
Expand Down
18 changes: 13 additions & 5 deletions src/components/NcActionTextEditable/NcActionTextEditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export default {
<!-- allow the custom font to inject a ::before
not possible on input[type=submit] -->
<label v-show="!disabled" :for="id" class="action-text-editable__label">
<ArrowRight :size="20" />
<ArrowLeft v-if="isRTL" :size="20" />
<ArrowRight v-else :size="20" />
</label>
</form>
</span>
Expand All @@ -94,12 +95,16 @@ import { useModelMigration } from '../../composables/useModelMigration.ts'
import ActionTextMixin from '../../mixins/actionText.js'
import GenRandomId from '../../utils/GenRandomId.js'

import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'

import { isRTL } from '@nextcloud/l10n'

export default {
name: 'NcActionTextEditable',

components: {
ArrowLeft,
ArrowRight,
},

Expand Down Expand Up @@ -165,6 +170,7 @@ export default {
const model = useModelMigration('value', 'update:value')
return {
model,
isRTL: isRTL(),
}
},

Expand Down Expand Up @@ -276,16 +282,18 @@ $input-margin: 4px;

position: relative;
margin: $input-margin 0;
padding-right: $icon-margin;
padding-inline-end: $icon-margin;
}

&__submit {
position: absolute;
left: -10000px;
inset-inline-start: 0;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
z-index: -1;
opacity: 0;
}

&__label {
Expand All @@ -295,7 +303,7 @@ $input-margin: 4px;

// bottom-right corner
position: absolute;
right: calc($icon-margin + 1);
inset-inline-end: calc($icon-margin + 1px);
bottom: 1px;
width: calc(var(--default-clickable-area) - $input-margin * 2);
height: calc(var(--default-clickable-area) - $input-margin * 2);
Expand Down Expand Up @@ -356,7 +364,7 @@ $input-margin: 4px;
z-index: 2;

border-color: var(--color-primary-element);
border-left-color: transparent;
border-inline-start-color: transparent;
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2040,11 +2040,7 @@ export default {
.action-items {
display: flex;
align-items: center;

// Spacing between buttons
& > button {
margin-right: calc($icon-margin / 2);
}
gap: calc($icon-margin / 2);
}

.action-item {
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcButton/NcButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ td.row-name {
}

td.row-size {
text-align: right;
text-align: end;
padding-inline-end: 16px;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/NcColorPicker/NcColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ export default {
<style>
.container1 {
display: flex;
gap: 20px;
}

.color1 {
width: 100px;
height: 34px;
margin-left: 20px;
border-radius: 6px;
}
</style>
Expand Down Expand Up @@ -129,12 +129,12 @@ export default {
<style>
.container0 {
display: flex;
gap: 20px;
}

.color0 {
width: 100px;
height: 34px;
margin-left: 20px;
border-radius: 6px;
}
</style>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcHeaderButton/NcHeaderButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
justify-content: right;
background-color: var(--color-primary);
height: var(--header-height, 50px);
padding-right: 12px;
padding-inline-end: 12px;
}
</style>
```
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcHeaderMenu/NcHeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
justify-content: right;
background-color: var(--color-primary);
height: var(--header-height, 50px);
padding-right: 12px;
padding-inline-end: 12px;
}
</style>
```
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcPasswordField/NcPasswordField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ export default {

.external-label {
display: flex;
gap: 14px;
width: 100%;
margin-top: 1rem;
}

.external-label label {
padding-top: 7px;
padding-right: 14px;
white-space: nowrap;
}
</style>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NcTextField/NcTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ export default {

.external-label {
display: flex;
gap: 14px;
width: 100%;
margin-top: 1rem;
}

.external-label label {
padding-top: 7px;
padding-right: 14px;
white-space: nowrap;
}
</style>
Expand Down

0 comments on commit 44eb9a9

Please sign in to comment.