diff --git a/src/Mobile.vue b/src/Mobile.vue index dd69de85..44a5f006 100644 --- a/src/Mobile.vue +++ b/src/Mobile.vue @@ -220,6 +220,8 @@ i.icon.la, i.icon.las, i.icon.lab { align-self: center; margin-left: var(--f7-list-item-media-margin); margin-right: var(--f7-list-item-media-margin); + overflow: hidden; + text-overflow: ellipsis; } .sortable-enabled .nested-list-item .nested-list-item-child .item-inner { diff --git a/src/components/mobile/PieChart.vue b/src/components/mobile/PieChart.vue index 6bd4f5c9..a635e717 100644 --- a/src/components/mobile/PieChart.vue +++ b/src/components/mobile/PieChart.vue @@ -28,7 +28,11 @@ :r="diameter / 2.5" v-if="showCenterText"/> - + + + + + @@ -51,7 +55,7 @@

- + Name {{ selectedItem.name }} Value @@ -300,6 +304,11 @@ export default { color: var(--f7-text-color); } +.pie-chart-selected-item-info { + display: inline-block; + text-align: center; +} + .pie-chart-background { fill: #f0f0f0; } diff --git a/src/components/mobile/TransactionTagSelectionSheet.vue b/src/components/mobile/TransactionTagSelectionSheet.vue index 34b12239..a3ec5599 100644 --- a/src/components/mobile/TransactionTagSelectionSheet.vue +++ b/src/components/mobile/TransactionTagSelectionSheet.vue @@ -23,7 +23,7 @@
-
+
{{ item.name }}
@@ -164,5 +164,10 @@ export default { height: 400px; } } + +.tag-selection-list-item { + overflow: hidden; + text-overflow: ellipsis; +} self diff --git a/src/filters/textLimit.js b/src/filters/textLimit.js new file mode 100644 index 00000000..711d4e22 --- /dev/null +++ b/src/filters/textLimit.js @@ -0,0 +1,19 @@ +export default function (value, maxLength) { + let length = 0; + + for (let i = 0; i < value.length; i++) { + const c = value.charCodeAt(i); + + if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { + length++; + } else { + length += 2; + } + } + + if (length <= maxLength || maxLength <= 3) { + return value; + } + + return value.substr(0, maxLength - 3) + '...'; +} diff --git a/src/mobile-main.js b/src/mobile-main.js index dd0672d7..49926c0c 100644 --- a/src/mobile-main.js +++ b/src/mobile-main.js @@ -73,6 +73,7 @@ import percentFilter from './filters/percent.js'; import itemFieldContentFilter from './filters/itemFieldContent.js'; import currencyFilter from './filters/currency.js'; import utcOffsetFilter from './filters/utcOffset.js'; +import textLimitFilter from './filters/textLimit.js'; import iconFilter from './filters/icon.js'; import iconStyleFilter from './filters/iconStyle.js'; import defaultIconColorFilter from './filters/defaultIconColor.js'; @@ -155,6 +156,7 @@ Vue.filter('percent', (value, precision, lowPrecisionValue) => percentFilter(val Vue.filter('itemFieldContent', (value, fieldName, defaultValue, translate) => itemFieldContentFilter({ i18n }, value, fieldName, defaultValue, translate)); Vue.filter('currency', (value, currencyCode) => currencyFilter({ i18n }, value, currencyCode)); Vue.filter('utcOffset', (value) => utcOffsetFilter(value)); +Vue.filter('textLimit', (value, maxLength) => textLimitFilter(value, maxLength)); Vue.filter('icon', (value, iconType) => iconFilter(value, iconType)); Vue.filter('iconStyle', (value, iconType, defaultColor, additionalFieldName) => iconStyleFilter(value, iconType, defaultColor, additionalFieldName)); Vue.filter('defaultIconColor', (value, defaultColor) => defaultIconColorFilter(value, defaultColor)); diff --git a/src/views/mobile/statistics/Transaction.vue b/src/views/mobile/statistics/Transaction.vue index a7d8120d..9a8aaf05 100644 --- a/src/views/mobile/statistics/Transaction.vue +++ b/src/views/mobile/statistics/Transaction.vue @@ -57,7 +57,7 @@ {{ query.chartDataType | totalAmountName(allChartDataTypes) | localized }} - {{ statisticsData.totalAmount | currency(defaultCurrency) }} + {{ statisticsData.totalAmount | currency(defaultCurrency) | textLimit(16) }} {{ $t('No data') }} @@ -76,7 +76,7 @@
-
+
Category Name 1 33.33
@@ -98,7 +98,7 @@
-
+
Category Name 2 33.33
@@ -120,7 +120,7 @@
-
+
Category Name 3 33.33
@@ -166,7 +166,7 @@
-
+
{{ item.name }} {{ item.percent | percent(2, '<0.01') }}
@@ -906,6 +906,13 @@ export default { .statistics-list-item-overview-amount { margin-top: 2px; font-size: 1.5em; + overflow: hidden; + text-overflow: ellipsis; +} + +.statistics-list-item-text { + overflow: hidden; + text-overflow: ellipsis; } .statistics-list-item .item-content { diff --git a/src/views/mobile/tags/List.vue b/src/views/mobile/tags/List.vue index e028bf3b..57cc87e5 100644 --- a/src/views/mobile/tags/List.vue +++ b/src/views/mobile/tags/List.vue @@ -17,7 +17,7 @@
-
Tag Name
+
Tag Name
@@ -25,7 +25,7 @@
-
Tag Name 2
+
Tag Name 2
@@ -33,7 +33,7 @@
-
Tag Name 3
+
Tag Name 3
@@ -61,7 +61,7 @@ -
{{ tag.name }}
@@ -410,3 +410,10 @@ export default { } } + + diff --git a/src/views/mobile/transactions/Edit.vue b/src/views/mobile/transactions/Edit.vue index a8072589..488aca80 100644 --- a/src/views/mobile/transactions/Edit.vue +++ b/src/views/mobile/transactions/Edit.vue @@ -82,7 +82,7 @@ @click="showCategorySheet = true" v-if="transaction.type === $constants.transaction.allTransactionTypes.Expense" > -
+
{{ transaction.expenseCategory | primaryCategoryName(allCategories[$constants.category.allCategoryTypes.Expense]) }} {{ transaction.expenseCategory | secondaryCategoryName(allCategories[$constants.category.allCategoryTypes.Expense]) }} @@ -107,7 +107,7 @@ @click="showCategorySheet = true" v-if="transaction.type === $constants.transaction.allTransactionTypes.Income" > -
+
{{ transaction.incomeCategory | primaryCategoryName(allCategories[$constants.category.allCategoryTypes.Income]) }} {{ transaction.incomeCategory | secondaryCategoryName(allCategories[$constants.category.allCategoryTypes.Income]) }} @@ -132,7 +132,7 @@ @click="showCategorySheet = true" v-if="transaction.type === $constants.transaction.allTransactionTypes.Transfer" > -
+
{{ transaction.transferCategory | primaryCategoryName(allCategories[$constants.category.allCategoryTypes.Transfer]) }} {{ transaction.transferCategory | secondaryCategoryName(allCategories[$constants.category.allCategoryTypes.Transfer]) }} @@ -885,20 +885,24 @@ export default { margin-bottom: 11px; } -.transaction-edit-time input[type="datetime-local"] { - max-width: inherit; -} - +.transaction-edit-category-title, .transaction-edit-timezone-title { overflow: hidden; text-overflow: ellipsis; } +.transaction-edit-time input[type="datetime-local"] { + max-width: inherit; +} + .transaction-edit-timezone-name { padding-left: 4px; } .transaction-edit-tag { margin-right: 4px; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; } diff --git a/src/views/mobile/transactions/List.vue b/src/views/mobile/transactions/List.vue index a2bfe51f..20eab27d 100644 --- a/src/views/mobile/transactions/List.vue +++ b/src/views/mobile/transactions/List.vue @@ -62,7 +62,7 @@
-
+
Category
-
+
Category 2
-
+
Category 3
-
+
Category 4
-
+
Category 5
-
+
Category
-
+
Category 2
-
+
Category 3
-
+
{{ $t('Modify Balance') }} @@ -989,12 +989,18 @@ export default { .transaction-amount { color: var(--f7-list-item-after-text-color); + overflow: hidden; + text-overflow: ellipsis; } .transaction-info .item-inner:after { background-color: transparent; } +.transaction-info .item-after { + max-width: 70%; +} + .transaction-info .transaction-icon:after { content: ''; position: absolute; @@ -1010,6 +1016,11 @@ export default { transform: scaleY(calc(1 / var(--f7-device-pixel-ratio))); } +.transaction-category-name { + overflow: hidden; + text-overflow: ellipsis; +} + .date-popover-menu .popover-inner, .category-popover-menu .popover-inner, .account-popover-menu .popover-inner { max-height: 400px; overflow-Y: auto;