Removes double '+' and '-' buttons (#10823)

So this removes extra + and - on adjustement buttons saving sapce on UIs. Reverts part of #10799
This commit is contained in:
Karolis
2020-12-26 12:16:38 +02:00
committed by GitHub
parent 8f8e095ce1
commit 4f03289e40
4 changed files with 13 additions and 7 deletions

View File

@@ -224,18 +224,18 @@ Example:
Parameters:
- `name` - name of asset to show that was sent to client.
Please note that regular `<img>` parameters apply here.
### VuiItem `<vui-item>` DEPRECATED
### ~~VuiItem `<vui-item>`~~ DEPRECATED
(Please use VuiGroup and VuiGroupItem)
Helper for making item lists using legacy nano styles.
~~Helper for making item lists using legacy nano styles.~~
Example:
```Vue
<vui-item label="Current health:">75%</vui-item>
```
Parameters:
- `label` - Label to display next to contents
- `balance` - This determines how much space is used by content compared to label. This parameter value should be between 0 and 1.
~~Parameters:~~
- ~~`label` - Label to display next to contents~~
- ~~`balance` - This determines how much space is used by content compared to label. This parameter value should be between 0 and 1.~~
### VuiGroupItem `<vui-group-item>` and VuiGroup `<vui-group>`
Helper for making item lists. Automatically adjusts label width for optimal layout, makes space for content.

View File

@@ -1,8 +1,8 @@
<template>
<div>
<vui-button v-for="bv in subButtons" :key="'-' + bv" :disabled="val - bv < min" @click="onUpdatedValue(-(10 ** bv))">{{"-".repeat(bv+1)}}</vui-button>
<vui-button v-for="bv in subButtons" :key="'-' + bv" :disabled="val - bv < min" @click="onUpdatedValue(-(10 ** bv))">-</vui-button>
<input @keypress="onKeyPress" :style="{width: width}" ref="input" :value="val" @input="onFieldUpdate($event.target)">
<vui-button v-for="bv in addButtons" :key="'+' + bv" :disabled="val + bv > max" @click="onUpdatedValue(10 ** bv)">{{"+".repeat(bv+1)}}</vui-button>
<vui-button v-for="bv in addButtons" :key="'+' + bv" :disabled="val + bv > max" @click="onUpdatedValue(10 ** bv)">+</vui-button>
</div>
</template>

View File

@@ -1,11 +1,13 @@
<template>
<div class="item">
<!-- DEPRICATE PLEASE USE VUI-GROUP AND VUI-GROUP-ITEM -->
<div v-if="label" class="itemLabel" :style="{ width: (1 - balance) * 100 + '%' }">{{ label }}</div>
<div class="itemContent" :style="{ width: (label ? balance : 1) * 100 + '%' }"><slot/></div>
</div>
</template>
<script>
// DEPRICATE PLEASE USE VUI-GROUP AND VUI-GROUP-ITEM
export default {
name: "vui-item",
props: {