@itfin/components 1.3.96 → 1.3.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itfin/components",
3
- "version": "1.3.96",
3
+ "version": "1.3.98",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -10,7 +10,7 @@
10
10
  <div class="b-panel__expand_text" v-text="title"></div>
11
11
  </a>
12
12
  </div>
13
- <div v-if="!nocard" v-show="!collapsed" class="b-panel-header px-3 pt-3 pb-2">
13
+ <div v-if="!nocard" v-show="!collapsed" class="b-panel-header px-3 pt-3">
14
14
  <slot name="header">
15
15
  <div>
16
16
  <slot name="title">
@@ -632,7 +632,7 @@ export default {
632
632
  default(dropdownList, component, { width, top, left }) {
633
633
  dropdownList.style.top = top
634
634
  dropdownList.style.left = left
635
- dropdownList.style.minWidth = width;
635
+ dropdownList.style.minWidth = width
636
636
  dropdownList.style.width = 'max-content';
637
637
  },
638
638
  },
@@ -53,6 +53,7 @@
53
53
  :editable-property="editableProperty"
54
54
  :sorting.sync="_sorting"
55
55
  :active="active"
56
+ :sort-as-string="sortAsString"
56
57
  @update:expanded-ids="$emit('update:expanded-ids', $event)"
57
58
  @new="$emit('new', $event)"
58
59
  @add-column="$emit('add-column', $event)"
@@ -113,6 +114,7 @@ class itfTable2 extends Vue {
113
114
  @Prop({ type: Array, default: () => [] }) expandedIds;
114
115
  @Prop() currency;
115
116
  @Prop() currencies;
117
+ @Prop(Boolean) sortAsString;
116
118
  @Prop(Boolean) stickyHeader;
117
119
  @Prop(Boolean) addNewRows;
118
120
  @Prop(Boolean) columnSorting;
@@ -42,6 +42,7 @@
42
42
  :rows="rows"
43
43
  :schema="schema"
44
44
  :editable="editable"
45
+ :sort-as-string="sortAsString"
45
46
  :no-column-menu="noColumnMenu"
46
47
  :no-select-all="noSelectAll"
47
48
  :selected-ids="selectedIds"
@@ -361,6 +362,7 @@ class itfTableGroup extends Vue {
361
362
  @Prop(Boolean) expandedAll;
362
363
  @Prop(Boolean) striped;
363
364
  @Prop(Boolean) stickyHeader;
365
+ @Prop(Boolean) sortAsString;
364
366
  @Prop() indicatorWidth;
365
367
  @Prop() cssProperty;
366
368
  @PropSync('sorting') _sorting;
@@ -174,6 +174,7 @@ class itfTableHeader extends Vue {
174
174
  @Prop(Boolean) noColumnMenu;
175
175
  @Prop(Boolean) noSelectAll;
176
176
  @Prop(Boolean) editable;
177
+ @Prop(Boolean) sortAsString;
177
178
  @Prop() idProperty;
178
179
  @Prop() indicatorType;
179
180
 
@@ -359,8 +360,10 @@ class itfTableHeader extends Vue {
359
360
  }
360
361
 
361
362
  sortBy(column, order) {
362
- let sort = order === 'desc' ? `-${column.property}` : column.property;
363
- console.info(sort);
363
+ let sort = { [column.property]: order };
364
+ if (this.sortAsString) {
365
+ sort = order === 'desc' ? `-${column.property}` : column.property;
366
+ }
364
367
  this.$emit('update:sorting', sort);
365
368
  }
366
369
  }
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  </div>
23
23
  <div v-if="indicatorType !== 'none'" class="indicator sticky">
24
- <div class="fill table-view-row-count" :class="{'on-rest': indicatorType !== 'checkbox' && indicatorType !== 'toggle'}">
24
+ <div class="fill table-view-row-count" :class="{'on-rest': !noSelectAll}">
25
25
  <span v-if="indicatorType === 'order'">{{ (n + 1) }}</span>
26
26
  <span v-else-if="indicatorType === 'property'">{{ item[idProperty] }}</span>
27
27
  <a href="" @click.prevent.stop="$emit('toggle', item)" v-else-if="indicatorType === 'toggle'">
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
  </a>
43
43
  </div>
44
- <div v-if="indicatorType !== 'toggle'" class="fill" :class="{'on-hover': indicatorType !== 'checkbox'}">
44
+ <div v-if="!noSelectAll" class="fill on-hover">
45
45
  <itf-checkbox :value="item[idProperty]" />
46
46
  </div>
47
47
  </div>
@@ -276,7 +276,8 @@ body[data-theme="dark"] {
276
276
  }
277
277
  }
278
278
 
279
- &:hover, &.permanent-editable-border {
279
+
280
+ &:hover {
280
281
  .table-view-item-value.editable {
281
282
  .form-control {
282
283
  border: 1px solid var(--itf-table-input-border-color);
@@ -295,6 +296,7 @@ body[data-theme="dark"] {
295
296
  border-right: 1px solid var(--bs-border-color);
296
297
  border-bottom: 1px solid var(--bs-border-color);
297
298
  }
299
+
298
300
  &.editable {
299
301
  padding: 2px;
300
302
 
@@ -167,6 +167,10 @@ class itfMoneyField extends Vue {
167
167
  }
168
168
 
169
169
  setValue (val) {
170
+ if (val === '') {
171
+ this.$emit('input', null);
172
+ return;
173
+ }
170
174
  if (!isNumeric(val) || (val || '').toString().match(/\..*0$/)) { // що не видаляло останній нуль вкінці
171
175
  return;
172
176
  }
@@ -1,61 +0,0 @@
1
- <template>
2
- <div v-loading="loading" class="px-3 pt-2 h-100">
3
- <itf-form
4
- ref="editForm"
5
- class="d-flex flex-column justify-content-between h-100"
6
- @keydown.native.shift.enter.stop.prevent="onSaveClick"
7
- @keydown.native.esc.stop.prevent="$emit('cancel')"
8
- >
9
- <slot></slot>
10
- <div class="py-3 justify-content-end d-flex align-items-center sticky-container">
11
- <div>
12
- <itf-button v-tooltip.delay="'Hot key: Esc'" secondary squircle :loading="loading" :disabled="loading" @click="$emit('cancel')">
13
- <span>{{ $t('components.modal.cancel') }}</span>
14
- </itf-button>
15
- <itf-button v-tooltip.delay="'Hot key: Shift + Enter'" primary squircle :loading="loading" :disabled="loading" @click="onSaveClick">
16
- <span>{{ $t('components.modal.save') }}</span>
17
- </itf-button>
18
- </div>
19
- </div>
20
- </itf-form>
21
- </div>
22
- </template>
23
- <style lang="scss" scoped>
24
- .sticky-container {
25
- position: sticky;
26
- top: auto;
27
- bottom: 0;
28
- z-index: 999;
29
- background-color: var(--bs-body-bg);
30
- }
31
- </style>
32
- <script>
33
- import { Vue, Component, Prop } from 'vue-property-decorator';
34
- import tooltip from '../../directives/tooltip';
35
- import loading from '../../directives/loading';
36
- import itfForm from '../form/Form.vue';
37
- import itfButton from '../button/Button.vue';
38
-
39
- @Component({
40
- components: {
41
- itfForm,
42
- itfButton
43
- },
44
- directives: {
45
- tooltip,
46
- loading
47
- },
48
- filters: {
49
- }
50
- })
51
- export default class PanelItemEdit extends Vue {
52
- @Prop(Boolean) loading;
53
-
54
- onSaveClick() {
55
- if (this.$refs.editForm && !this.$refs.editForm.doValidation()) {
56
- return;
57
- }
58
- this.$emit('save');
59
- }
60
- }
61
- </script>