@itfin/components 2.0.34 → 2.0.36

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.
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.6936 5.43799C14.8771 5.29535 15.1419 5.29656 15.3254 5.45362C15.5088 5.61084 15.5505 5.87237 15.4377 6.07569L15.3801 6.15869L8.95137 13.6587C8.85689 13.7689 8.71861 13.8328 8.57344 13.8335C8.42843 13.834 8.2899 13.7718 8.19453 13.6626L4.62324 9.57178L4.56465 9.48877C4.45006 9.28652 4.48917 9.02459 4.67109 8.86573C4.85306 8.70687 5.11798 8.70339 5.30293 8.84424L5.37715 8.91358L8.56758 12.5689L14.6203 5.5083L14.6936 5.43799Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9 8.41421L9 15.5858C9 16.4767 10.0771 16.9229 10.7071 16.2929L14.2929 12.7071C14.6834 12.3166 14.6834 11.6834 14.2929 11.2929L10.7071 7.70711C10.0771 7.07714 9 7.52331 9 8.41421Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M5.83325 10H14.1666" stroke="#7A818E" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div v-loading="loading" class="px-3 pt-2 h-100">
2
+ <div v-loading="loading" class="px-3 pt-2 h-100 d-flex flex-column">
3
3
  <itf-form
4
4
  ref="editForm"
5
- class="d-flex flex-column justify-content-between h-100"
5
+ class="d-flex flex-column justify-content-between flex-grow-1"
6
6
  @keydown.native.shift.enter.stop.prevent="onSaveClick"
7
7
  @keydown.native.esc.stop.prevent="$emit('cancel')"
8
8
  >
@@ -10,10 +10,10 @@
10
10
  <div class="py-3 justify-content-end d-flex align-items-center sticky-container">
11
11
  <div v-if="!hideFooter">
12
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>
13
+ <span>{{ cancelBtnText }}</span>
14
14
  </itf-button>
15
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>
16
+ <span>{{ saveBtnText }}</span>
17
17
  </itf-button>
18
18
  </div>
19
19
  </div>
@@ -51,6 +51,8 @@ import itfButton from '../button/Button.vue';
51
51
  export default class PanelItemEdit extends Vue {
52
52
  @Prop(Boolean) loading;
53
53
  @Prop(Boolean) hideFooter;
54
+ @Prop({ type: String, default: function() { return this.$t('components.modal.save') } }) saveBtnText;
55
+ @Prop({ type: String, default: function() { return this.$t('components.modal.cancel') } }) cancelBtnText;
54
56
 
55
57
  onSaveClick() {
56
58
  if (this.$refs.editForm && !this.$refs.editForm.doValidation()) {
@@ -25,6 +25,7 @@ export default class PanelLink extends Vue {
25
25
  @Prop() list;
26
26
  @Prop({ type: String, default: 'active' }) activeClass: string;
27
27
  @Prop(Boolean) append: boolean;
28
+ @Prop(Boolean) replace: boolean;
28
29
 
29
30
  get on() {
30
31
  const handlers = {};
@@ -51,6 +52,9 @@ export default class PanelLink extends Vue {
51
52
  if (!this.append) {
52
53
  stack = stack.splice(0, this.currentPanel?.index + 1);
53
54
  }
55
+ if (this.replace) {
56
+ stack = [];
57
+ }
54
58
  const hash = stackToHash([
55
59
  ...stack,
56
60
  {
@@ -64,15 +68,16 @@ export default class PanelLink extends Vue {
64
68
  onClick(e) {
65
69
  e.preventDefault();
66
70
  e.stopPropagation();
71
+ const index = this.replace ? 0 : (this.append ? undefined : this.currentPanel?.index + 1);
67
72
  this.$emit('open', {
68
73
  panel: this.panel,
69
74
  payload: this.payload || {},
70
- index: this.append ? undefined : this.currentPanel?.index + 1
75
+ index
71
76
  });
72
77
  if (!this.activeList) {
73
78
  return;
74
79
  }
75
- this.activeList.openPanel(this.panel, this.payload || {}, this.append ? undefined : this.currentPanel?.index + 1);
80
+ this.activeList.openPanel(this.panel, this.payload || {}, index);
76
81
  }
77
82
  }
78
83
  </script>
@@ -364,9 +364,7 @@ export default class PanelList extends Vue {
364
364
  newPanel.getPayload = () => newPanel.payload;
365
365
  newPanel.setPayload = (value: any) => {
366
366
  newPanel.payload = value;
367
- newPanel.title = panel.caption(this.$t.bind(this), value);
368
- newPanel.icon = panel.icon ? panel.icon(this.$t.bind(this), payload) : null,
369
- this.setPanelHash()
367
+ this.setPanelHash();
370
368
  }
371
369
  newStack.push(newPanel);
372
370
  this.panelsStack = newStack;
@@ -29,6 +29,8 @@ class itfPopover extends Vue {
29
29
  @Prop({ type: String, default: 'click', validator: (value) => ['click', 'focus', 'hover', 'manual'].includes(value) }) trigger;
30
30
 
31
31
  @Prop({ type: String, default: '' }) customClass;
32
+ @Prop({ type: Boolean }) appendToBody;
33
+ @Prop({ type: Boolean }) appendToContext;
32
34
 
33
35
  modalId = '';
34
36
 
@@ -64,7 +66,15 @@ class itfPopover extends Vue {
64
66
  const el = this.$refs.popover;
65
67
  const { default: Popover } = await import('bootstrap/js/src/popover');
66
68
 
67
- const context = this.$el.closest('.itf-append-context') || document.body;
69
+ let context = document.body;
70
+ if (this.appendToContext && this.$el instanceof Node && this.$el.parentNode) {
71
+ context = this.$el.closest('.itf-append-context') || document.body;
72
+ this.$el.parentNode.removeChild(this.$el);
73
+ context.appendChild(this.$el); // should append only to body
74
+ } else if (this.appendToBody && this.$el instanceof Node && this.$el.parentNode) {
75
+ this.$el.parentNode.removeChild(this.$el);
76
+ context.appendChild(this.$el); // should append only to body
77
+ }
68
78
  this.modalEl = new Popover(this.$el, {
69
79
  content: el,
70
80
  container: context,
@@ -4,14 +4,14 @@
4
4
  <span v-if="!isUndefined" ref="slider" class="selection" :class="{'elevation-1': !disabled}"></span>
5
5
 
6
6
  <div class="option" v-for="(item, n) in itemsWithNames" :key="n">
7
- <label v-tooltip="tooltipCallback(item)" :key="n">
7
+ <label v-tooltip="tooltipCallback(item)" :key="n" :class="{'disabled': disabled || item[itemDisabled]}">
8
8
  <slot name="itemMarkup" :item="item" />
9
9
  <input
10
10
  ref="input"
11
11
  type="radio"
12
12
  :name="name"
13
13
  :value="n"
14
- :disabled="disabled"
14
+ :disabled="disabled || item[itemDisabled]"
15
15
  :checked="isChecked(item)"
16
16
  @change="onItemChanged(item)" />
17
17
  <span>
@@ -51,6 +51,7 @@ class itfSegmentedControl extends Vue {
51
51
  @Prop({ type: Array, required: true }) items;
52
52
  @Prop({ type: String, default: 'Id' }) itemKey;
53
53
  @Prop({ type: String, default: 'Name' }) itemText;
54
+ @Prop({ type: String, default: 'Disabled' }) itemDisabled;
54
55
  @Prop({ type: Boolean, default: false }) returnObject;
55
56
  @Prop({ type: Boolean, default: false }) disabled;
56
57
  @Prop({ type: Function, default: () => null }) tooltipCallback;
@@ -4,8 +4,8 @@
4
4
  <div ref="container" class="table-row-template">
5
5
  <div accept-group="items" class="table-view-body-space" v-dropzone="{ payload: 0 }"></div>
6
6
  <div class="shadow-area"></div>
7
- <div v-if="indicatorType !== 'none'" class="table-view-header-value reserved sticky">
8
- <itf-checkbox v-if="indicatorType !== 'none' && visibleHeader && !noSelectAll" ungrouped value="all" v-model="selectAll" ref="selectAll" />
7
+ <div class="table-view-header-value reserved sticky">
8
+ <itf-checkbox v-if="indicatorType === 'checkbox' && visibleHeader && !noSelectAll" ungrouped value="all" v-model="selectAll" ref="selectAll" />
9
9
  </div>
10
10
 
11
11
  <template v-for="(column, n) in visibleAttributes">
@@ -97,10 +97,8 @@ body[data-theme="dark"] {
97
97
  position: sticky;
98
98
  top: 0;
99
99
  bottom: 0;
100
- right: -5px;
100
+ right: -.5rem;
101
101
  z-index: 8;
102
- padding-right: 5px;
103
- padding-left: 5px;
104
102
  display: flex;
105
103
  align-items: center;
106
104
 
@@ -112,12 +110,17 @@ body[data-theme="dark"] {
112
110
  .on-hover {
113
111
  opacity: 0;
114
112
  width: 0;
113
+ padding: 4px .5rem;
115
114
  overflow: hidden;
116
115
  pointer-events: none;
116
+ position: absolute;
117
+ right: 0;
118
+ background: linear-gradient(90deg, transparent 0, var(--itf-table2-row-bg) 10px);
117
119
 
118
120
  @media (max-width: 768px) {
119
121
  width: max-content;
120
122
  opacity: 1;
123
+ position: relative;
121
124
  }
122
125
  }
123
126
  .table-row-template:hover .on-hover {
@@ -154,11 +154,11 @@ class itfMoneyField extends Vue {
154
154
  }
155
155
 
156
156
  get selectedCurrencySymbol() {
157
- return this.selectedCurrency ? this.selectedCurrency[this.symbolKey] : '#';
157
+ return this.selectedCurrency ? this.selectedCurrency[this.symbolKey] : '';
158
158
  }
159
159
 
160
160
  get selectedCurrencyCode() {
161
- return this.selectedCurrency ? this.selectedCurrency[this.codeKey] : '###';
161
+ return this.selectedCurrency ? this.selectedCurrency[this.codeKey] : '';
162
162
  }
163
163
 
164
164
  get currencyId() {