@itfin/components 1.3.39 → 1.3.40

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.39",
3
+ "version": "1.3.40",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -10,6 +10,7 @@ class ITFSettings {
10
10
  defaultLocale: 'en_US',
11
11
  defaultDisplayDateFormat: 'MM/dd/yyyy',
12
12
  // defaultDisplayDateFormat: 'dd.MM.yyyy',
13
+ currencies: []
13
14
  };
14
15
 
15
16
  get defaultLocale() {
@@ -20,6 +21,14 @@ class ITFSettings {
20
21
  this.options.defaultLocale = val;
21
22
  }
22
23
 
24
+ get currencies() {
25
+ return this.options.currencies;
26
+ }
27
+
28
+ set currencies(val) {
29
+ this.options.currencies = val;
30
+ }
31
+
23
32
  get supportLanguages() {
24
33
  return [
25
34
  { locale: 'en_US', name: 'English', dateFormat: 'MM/dd/yyyy' },
@@ -2,7 +2,6 @@
2
2
 
3
3
  .itf-text-field {
4
4
  &__input {
5
- border-radius: $input-border-radius !important;
6
5
  -moz-appearance: textfield; // Hide Arrows From Input Number (Firefox)
7
6
 
8
7
  &::-webkit-outer-spin-button, // Hide Arrows From Input Number (Chrome, Safari, Edge, Opera)
@@ -27,7 +26,6 @@
27
26
  z-index: 10;
28
27
  }
29
28
  &__input {
30
- border-radius: $input-border-radius !important;
31
29
  resize: none;
32
30
  }
33
31
  &__autogrow &__input {
@@ -16,6 +16,8 @@ $border-radius: $vs-border-radius;
16
16
  appearance: none;
17
17
  display: flex;
18
18
  white-space: normal;
19
+ height: 100%;
20
+ width: 100%;
19
21
  }
20
22
 
21
23
  .vs__selected-options {
@@ -39,6 +39,7 @@ class itfDatePickerInline extends Vue {
39
39
  @Prop({ type: Boolean, default: false }) range;
40
40
  @Prop({ type: Object, default: () => ({}) }) customDays;
41
41
  @Prop({ type: [String, Date], default: '' }) minDate;
42
+ @Prop({ type: [String, Date], default: '' }) maxDate;
42
43
  @Prop({
43
44
  type: Array,
44
45
  default: function () {
@@ -90,6 +91,7 @@ class itfDatePickerInline extends Vue {
90
91
  view: (this.valueAsLuxon && !this.minView) ? 'days' : this.startView,
91
92
  minView: this.minView,
92
93
  minDate: this.minDate,
94
+ maxDate: this.maxDate,
93
95
  selectedDates: this.valueAsLuxon ? [this.valueAsLuxon.toJSDate()] : [],
94
96
  onSelect: ({ date }) => {
95
97
  if (this.range && !this.calendar.rangeDateTo) {
@@ -6,28 +6,29 @@
6
6
  </slot>
7
7
  </div>
8
8
  <input
9
- ref="input"
10
- readonly
11
- :disabled="disabled"
12
- class="form-control text-capitalize"
13
- :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }"
14
- @focus="onFocus"
15
- @blur="onBlur"
16
- :value="displayValue"
17
- :placeholder="placeholder"
9
+ ref="input"
10
+ readonly
11
+ :disabled="disabled"
12
+ class="form-control text-capitalize"
13
+ :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }"
14
+ @focus="onFocus"
15
+ @blur="onBlur"
16
+ :value="displayValue"
17
+ :placeholder="placeholder"
18
18
  />
19
19
  <div style="display: none">
20
20
  <div ref="dropdown" class="itf-monthpicker__dropdown border rounded">
21
21
  <div>
22
22
  <itf-date-picker-inline
23
- :value="value"
24
- start-view="months"
25
- min-view="months"
26
- :min-date="minDate"
27
- only-calendar
28
- :display-format="displayFormat"
29
- :value-format="valueFormat"
30
- @input="selectInlineDate"
23
+ :value="value"
24
+ start-view="months"
25
+ min-view="months"
26
+ :min-date="minDate"
27
+ :max-date="maxDate"
28
+ only-calendar
29
+ :display-format="displayFormat"
30
+ :value-format="valueFormat"
31
+ @input="selectInlineDate"
31
32
  />
32
33
  </div>
33
34
  <slot name="after-calendar" />
@@ -57,6 +58,7 @@ class itfMonthPicker extends Vue {
57
58
  @Prop({ type: Boolean }) disabled;
58
59
  @Prop({ type: String, default: 'ISO' }) valueFormat;
59
60
  @Prop({ type: [String, Date], default: '' }) minDate;
61
+ @Prop({ type: [String, Date], default: '' }) maxDate;
60
62
  @Prop({ type: String, default: 'LLLL, yyyy' }) displayFormat;
61
63
  @Prop({ type: String, default: '' }) placeholder;
62
64
  @Prop({ type: String, default: '' }) prependIcon;
@@ -42,6 +42,8 @@ storiesOf('Common', module)
42
42
  }
43
43
  },
44
44
  template: `<div>
45
+ <itf-app ref="app">
46
+
45
47
  <p>You need wrap whole application with this tag</p>
46
48
 
47
49
  <h2>Usage</h2>
@@ -57,8 +59,6 @@ storiesOf('Common', module)
57
59
 
58
60
  <h2>Example</h2>
59
61
 
60
- <itf-app ref="app">
61
-
62
62
  <itf-form ref="form">
63
63
 
64
64
  <itf-icon name="project_tnm" size="32" />
@@ -71,6 +71,7 @@ storiesOf('Common', module)
71
71
 
72
72
  <itf-select
73
73
  :options="['tnm', 'fixed', 'nonprofit']"
74
+ append-to-body
74
75
  v-model="text">
75
76
 
76
77
  <template #selected-option="{ option }">
@@ -96,7 +97,11 @@ storiesOf('Common', module)
96
97
  <div class="col-12">
97
98
  <itf-label :rules="[$v.emptyValidation()]" :value="text" label="Text field" required>
98
99
 
99
- <itf-text-field v-model="text"></itf-text-field>
100
+ <itf-text-field v-model="text">
101
+ <template #addon>
102
+ <span class="input-group-text" id="basic-addon1">@</span>
103
+ </template>
104
+ </itf-text-field>
100
105
 
101
106
  </itf-label>
102
107
  </div>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
 
3
- <div class="scrollable scrollable-x big-scrollbar" :class="{'permanent-checkboxes': selectedIds.length}">
3
+ <div class="itf-table2 scrollable scrollable-x" :class="{'permanent-checkboxes': selectedIds.length}">
4
4
  <itf-checkbox-group v-model="selectedIds">
5
5
  <template v-for="(group, index) in groups">
6
6
  <div class="table-view-body">
@@ -40,22 +40,6 @@
40
40
 
41
41
  </template>
42
42
  <style lang="scss">
43
- .scrollable {
44
- --itf-table-hover-bg: #f2f2f2;
45
- --itf-table-min-width: 45px;
46
-
47
- body[data-theme="dark"] & {
48
- --itf-table-hover-bg: #393b41;
49
- }
50
-
51
- -webkit-overflow-scrolling: touch;
52
- overflow: hidden scroll;
53
-
54
- &.scrollable-x {
55
- overflow-x: scroll;
56
- padding-right: 4px;
57
- }
58
- }
59
43
  .last-sticky-column:after {
60
44
  content: '';
61
45
  background: linear-gradient(to right,#dfe0e2,rgba(255,0,0,0));
@@ -77,6 +61,7 @@ import itfButton from '../button/Button.vue';
77
61
  import itfIcon from '../icon/Icon.vue';
78
62
  import itfTableGroup from './TableGroup.vue';
79
63
  import itfTableHeader from './TableHeader.vue';
64
+ import './table2.scss';
80
65
 
81
66
  export default @Component({
82
67
  name: 'itfTable2',
@@ -4,7 +4,11 @@
4
4
  <div
5
5
  v-for="(item, n) in rows"
6
6
  :key="n"
7
- group="items" data-test="table-item" class="table-view-item grouped draggable-item">
7
+ group="items"
8
+ data-test="table-item"
9
+ class="table-view-item grouped draggable-item"
10
+ :class="{'selected': selectedIds.includes(item[idProperty])}"
11
+ >
8
12
  <div class="table-row-template">
9
13
  <div accept-group="items" class="table-view-body-space"></div>
10
14
  <div class="shadow-area">
@@ -31,7 +35,7 @@
31
35
  v-if="column.visible !== false"
32
36
  :data-column="k"
33
37
  :style="`width: ${column.width}px; max-width: ${column.width}px; left: ${column.left}px;`"
34
- :class="{'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow, 'px-2': !column.editable, 'p-1': column.editable}"
38
+ :class="{'sticky': column.pinned, 'last-sticky-column': k === lastPinnedIndex, 'flex-grow-1': column.grow, 'px-2': !column.editable, 'editable': column.editable}"
35
39
  class="table-view-item-value d-flex h-100 align-items-stretch">
36
40
  <slot :name="`column.${column.property}`" :item="item" :column="column">
37
41
  <template v-if="column.editable">
@@ -45,7 +49,7 @@
45
49
  @update:hours="updateValue(item, $event, n, column)"
46
50
  />
47
51
  <itf-textarea class="w-100" :rows="2" autogrow v-else-if="column.type === 'textarea'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
48
- <itf-money-field class="w-100" v-else-if="column.type === 'money'" no-currency-sign currency-disabled :currency-select="false" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
52
+ <itf-money-field class="w-100" currency-select v-else-if="column.type === 'money'" :value="getValue(item, column)" @input="updateValue(item, $event, n, column)" />
49
53
  </slot>
50
54
  </template>
51
55
  <template v-else>
@@ -92,45 +96,6 @@
92
96
  flex-direction: row;
93
97
  }
94
98
 
95
- .table-view-item-value {
96
- text-overflow: ellipsis;
97
- background-color: var(--bs-body-bg);
98
- border-right: 1px solid var(--bs-border-color);
99
- border-bottom: 1px solid var(--bs-border-color);
100
- align-items: stretch;
101
- display: flex;
102
- position: relative;
103
- min-width: var(--itf-table-min-width);
104
-
105
- &.highlight-drop-column {
106
- position: relative;
107
-
108
- &:after {
109
- content: "";
110
- height: 100%;
111
- z-index: 100;
112
- width: 2px;
113
- background: #47beff;
114
- margin-left: -1px;
115
- position: absolute;
116
- left: 0;
117
- }
118
- &.right:after {
119
- left: auto;
120
- right: 0;
121
- }
122
- }
123
- &:hover {
124
- background-color: var(--bs-tertiary-bg);
125
- }
126
-
127
- &.sticky {
128
- z-index: 4;
129
- position: -webkit-sticky;
130
- position: sticky;
131
- }
132
- }
133
-
134
99
  .table-item-inner .extra {
135
100
  flex-grow: 1;
136
101
  border-color: var(--bs-border-color);
@@ -143,9 +108,9 @@
143
108
  z-index: 4;
144
109
  position: -webkit-sticky;
145
110
  position: sticky;
146
- background-color: var(--bs-body-bg);
111
+ background-color: var(--itf-table2-row-bg);
147
112
  //border-right: 1px solid var(--bs-border-color);
148
- border-bottom: 1px solid var(--bs-border-color);
113
+ //border-bottom: 1px solid var(--bs-border-color);
149
114
  display: flex;
150
115
  align-items: center;
151
116
  justify-content: center;
@@ -201,6 +166,7 @@
201
166
 
202
167
  .table-item-inner .boundary.right {
203
168
  left: auto;
169
+ border-right: 1px solid var(--itf-table-border-color);
204
170
  right: 0;
205
171
  }
206
172
 
@@ -255,6 +221,7 @@ class itfTableBody extends Vue {
255
221
  @Prop() idProperty;
256
222
  @Prop(Boolean) showAddColumn;
257
223
  @Prop(Boolean) noSelectAll;
224
+ @Prop() selectedIds;
258
225
 
259
226
  getValue(item, column) {
260
227
  return get(item, column.property);
@@ -59,6 +59,7 @@
59
59
  :rows="rows"
60
60
  :columns="visibleColumns"
61
61
  :no-select-all="noSelectAll"
62
+ :selected-ids="selectedIds"
62
63
  :show-add-column="showAddColumn">
63
64
  <template v-for="(_, name) in $slots" #[name]="slotData">
64
65
  <slot :name="name" v-bind="slotData || {}"/>
@@ -243,8 +244,9 @@
243
244
  }
244
245
 
245
246
  .table-add-new-item {
246
- border-right: 1px solid rgb(238 238 238 / 1);
247
- border-bottom: 1px solid rgb(238 238 238 / 1);
247
+ border-left: 1px solid var(--itf-table-border-color);
248
+ border-right: 1px solid var(--itf-table-border-color);
249
+ border-bottom: 1px solid var(--itf-table-border-color);
248
250
  outline: none;
249
251
 
250
252
  & > span {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
 
3
- <div class="itf-table-header" :class="{'no-header': !visibleHeader}">
3
+ <div class="itf-table2__header" :class="{'no-header': !visibleHeader}">
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>
@@ -36,8 +36,9 @@
36
36
  <span :title="column.title[locale] || column.title['en_US']">
37
37
  <span v-if="column.icon" :class="column.icon"></span>
38
38
  {{column.title[locale] || column.title['en_US']}}
39
+ <div class="itf-table2__subtitle">kr</div>
39
40
  </span>
40
- <!-- <itf-icon name="arrow_up" :size="16" class="ms-1" />-->
41
+ <itf-icon name="arrow_up" :size="16" class="ms-1" />
41
42
  </template>
42
43
 
43
44
  <div v-if="column.sortable">
@@ -127,162 +128,6 @@
127
128
  </div>
128
129
 
129
130
  </template>
130
- <style lang="scss">
131
- .itf-table-header {
132
- position: sticky;
133
- top: 0;
134
- z-index: calc(var(--row-count) + 1);
135
-
136
- &.no-header {
137
- --table-row-height: 0px;
138
- --table-small-row-size: 0px;
139
-
140
- .table-view-header-value {
141
- border-top: 0 none;
142
- border-bottom: 0 none;
143
- }
144
- }
145
- .table-header.draggable-mirror{
146
- z-index: 100000001;
147
- background: rgba(235,237,239,0.75);
148
- }
149
- .table-row-template {
150
- display: flex;
151
- align-items: stretch;
152
- height: var(--table-small-row-size);
153
- user-select: none;
154
- }
155
- .table-view-header-value {
156
- cursor: pointer;
157
- align-items: center;
158
- justify-content: center;
159
- height: var(--table-row-height);
160
- white-space: nowrap;
161
- //border-top: 0;
162
- border-top: 1px solid transparent;
163
- border-left: 0;
164
- border-right-width: thin;
165
- border-bottom-width: thin;
166
- border-style: solid;
167
- position: relative;
168
- display: flex;
169
- min-width: var(--itf-table-min-width);
170
- border-right-color: transparent;
171
- border-bottom-color: var(--bs-border-color);
172
- background-color: var(--bs-body-bg);
173
- //background-color: rgb(238 238 238 / 1);
174
- font-weight: 500;
175
-
176
- &.last-sticky-column {
177
- border-right-color: var(--bs-border-color);
178
- }
179
- &.reserved {
180
- left: var(--shadow-area-width);
181
- width: var(--indicator-area-width);
182
- }
183
- &.sticky {
184
- position: sticky;
185
- position: -webkit-sticky;
186
- z-index: calc(var(--row-count) + 4);
187
- }
188
- }
189
- .table-header {
190
- flex: 0 0 auto;
191
- overflow: hidden;
192
- width: 100%;
193
- text-overflow: ellipsis;
194
- padding-left: 0.75rem;
195
- padding-right: 0.75rem;
196
- gap: 0.25rem;
197
- align-items: center;
198
- & > div {
199
- min-height: var(--table-row-height);
200
- align-items: center;
201
- justify-content: space-between;
202
- display: flex;
203
- }
204
-
205
- &.table-header-add-column {
206
- text-overflow: clip;
207
- }
208
- }
209
- .resize-handle {
210
- width: 4px;
211
- height: var(--table-row-height);
212
- position: absolute;
213
- right: -2px;
214
- top: 0;
215
- background: #29ACE1;
216
- border-radius: 2px;
217
- z-index: 100;
218
- opacity: 0;
219
- cursor: ew-resize;
220
- transition: .2s;
221
-
222
- &:hover {
223
- opacity: 1;
224
- }
225
- }
226
- .context-menu-toggle {
227
- flex: 1 1 auto;
228
- text-overflow: ellipsis;
229
- white-space: nowrap;
230
- overflow: hidden;
231
-
232
- span {
233
- font-size: 12px;
234
- line-height: 36px;
235
- }
236
- }
237
- .itf-sortable-list {
238
- display: flex;
239
- }
240
- .table-view-header-space {
241
- height: 100%;
242
- position: absolute;
243
- left: 0;
244
- display: none;
245
- background: transparent;
246
- z-index: 100;
247
- width: 2px;
248
- margin-left: -1px;
249
-
250
- &.right {
251
- left: auto;
252
- right: 0;
253
- top: 0;
254
- }
255
- &.active {
256
- display: block;
257
- &.over {
258
- background: #47BEFF;
259
- }
260
- }
261
- }
262
- .draggable-mirror {
263
- opacity: .5;
264
- }
265
- .draggable-container--over .table-view-header-space {
266
- display: block;
267
- }
268
- .draggable-container--over .draggable--over .table-view-header-space {
269
- background: #47BEFF;
270
- }
271
- .table-view-header-space > .table-view-header-dropzone {
272
- position: absolute;
273
- top: 0;
274
- right: -50px;
275
- bottom: 0;
276
- left: -50px;
277
- }
278
- .table-view-header-value:not(.reserved):hover {
279
- background-color: var(--bs-tertiary-bg);
280
- }
281
- .draggable-source--is-dragging {
282
- z-index: 100;
283
- }
284
- }
285
- </style>
286
131
  <script>
287
132
  import {Vue, Component, Prop, PropSync, Watch, Inject} from 'vue-property-decorator';
288
133
  import itfCheckbox from '../checkbox/Checkbox.vue';
@@ -1,8 +1,10 @@
1
1
  import { storiesOf } from '@storybook/vue';
2
+ import ITFSettings from '../../ITFSettings';
2
3
  import itfApp from '../app/App.vue';
3
4
  import itfButton from '../button/Button.vue';
4
5
  import itfTable from './Table.vue';
5
6
  import itfTable2 from './Table2.vue';
7
+ import itfSelect from '../select/Select.vue';
6
8
 
7
9
  const exampleData = [{
8
10
  Employee: 'Cool',
@@ -72,12 +74,17 @@ const exampleData = [{
72
74
  Notes: 'Test'
73
75
  }];
74
76
 
77
+ ITFSettings.currencies = [
78
+ { Id: '1', Code: 'USD', Title: 'USD', IsDefault: true, Symbol: '$' }
79
+ ];
80
+
75
81
  storiesOf('Common', module)
76
82
  .add('Simple Table', () => ({
77
83
  components: {
78
84
  itfTable,
79
85
  itfButton,
80
- itfTable2
86
+ itfTable2,
87
+ itfSelect
81
88
  },
82
89
  data() {
83
90
  return {
@@ -111,7 +118,7 @@ storiesOf('Common', module)
111
118
  Id: 1,
112
119
  summary: true,
113
120
  Description: 'Total',
114
- EmployeeId: 'Vitalii Savchuk',
121
+ EmployeeId: 1,
115
122
  Total: 100,
116
123
  FTE: 1.0,
117
124
  Position: { Title: 'Developer', Id: 1 },
@@ -131,7 +138,7 @@ storiesOf('Common', module)
131
138
  {
132
139
  "property": "Description",
133
140
  "title": { "en_US": "Description", "uk_UA": "Прізвище" },
134
- "type": "textarea",
141
+ "type": "text",
135
142
  "editable": true,
136
143
  "sortable": false,
137
144
  width: 200,
@@ -331,7 +338,12 @@ storiesOf('Common', module)
331
338
  {{item.EmployeeId}}
332
339
  </template>
333
340
  <template #edit.employee="{ item }">
334
- {{item.EmployeeId}}
341
+ <itf-select
342
+ class="w-100"
343
+ v-model="item.EmployeeId"
344
+ :reduce="item => item.Id"
345
+ :get-option-label="item => item.Name"
346
+ :options="[{ Id: 1, Name: 'Vitalii Savchuk' }]" />
335
347
  </template>
336
348
  </itf-table2>
337
349
 
@@ -0,0 +1,261 @@
1
+ .itf-table2 {
2
+ --itf-table-border-color: #dbddd1;
3
+ --itf-table-header-bg: #f9faf5;
4
+ --itf-table-hover-bg: #f2f2f2;
5
+ --itf-table-bg: var(--bs-body-bg);
6
+ --itf-table-min-width: 45px;
7
+ --itf-table-input-border-color: #aaaba6;
8
+ --itf-table-input-focus-border-color: #0028aa;
9
+ --itf-table-selected-bg: #cbd6f4;
10
+ --itf-table-header-subtitle-color: #aeafaa;
11
+
12
+ // dark
13
+ body[data-theme="dark"] & {
14
+ --itf-table-hover-bg: #393b41;
15
+ }
16
+
17
+ &.scrollable {
18
+ -webkit-overflow-scrolling: touch;
19
+ overflow: hidden scroll;
20
+ }
21
+ &.scrollable-x {
22
+ overflow-x: scroll;
23
+ padding-right: 4px;
24
+ }
25
+
26
+ &__header {
27
+ background-color: var(--itf-table-header-bg);
28
+ position: sticky;
29
+ top: 0;
30
+ z-index: calc(var(--row-count) + 1);
31
+
32
+ &.no-header {
33
+ --table-row-height: 0px;
34
+ --table-small-row-size: 0px;
35
+
36
+ .table-view-header-value {
37
+ border-top: 0 none;
38
+ border-bottom: 0 none;
39
+ }
40
+ }
41
+ .table-header.draggable-mirror{
42
+ z-index: 100000001;
43
+ background: rgba(235,237,239,0.75);
44
+ }
45
+ .table-row-template {
46
+ display: flex;
47
+ align-items: stretch;
48
+ height: auto;
49
+ user-select: none;
50
+ }
51
+ .table-view-header-value {
52
+ cursor: pointer;
53
+ align-items: center;
54
+ justify-content: center;
55
+ height: auto;
56
+ white-space: nowrap;
57
+ //border-top: 0;
58
+ border-top: 1px solid var(--itf-table-border-color);
59
+ border-left: 0;
60
+ border-right: 1px solid var(--itf-table-border-color);
61
+ border-bottom: 1px solid var(--itf-table-border-color);
62
+ position: relative;
63
+ display: flex;
64
+ min-width: var(--itf-table-min-width);
65
+ //background-color: var(--bs-body-bg);
66
+ //background-color: rgb(238 238 238 / 1);
67
+ //font-weight: 500;
68
+
69
+ &.last-sticky-column {
70
+ border-right-color: var(--bs-border-color);
71
+ }
72
+ &.reserved {
73
+ border-left: 1px solid var(--itf-table-border-color);
74
+ left: var(--shadow-area-width);
75
+ width: var(--indicator-area-width);
76
+ }
77
+ &.sticky {
78
+ position: sticky;
79
+ position: -webkit-sticky;
80
+ z-index: calc(var(--row-count) + 4);
81
+ }
82
+ }
83
+ .table-header {
84
+ flex: 0 0 auto;
85
+ overflow: hidden;
86
+ width: 100%;
87
+ text-overflow: ellipsis;
88
+ padding-left: 0.75rem;
89
+ padding-right: 0.5rem;
90
+ gap: 0.25rem;
91
+ align-items: center;
92
+ & > div {
93
+ min-height: var(--table-row-height);
94
+ align-items: center;
95
+ justify-content: space-between;
96
+ display: flex;
97
+ }
98
+
99
+ &.table-header-add-column {
100
+ text-overflow: clip;
101
+ }
102
+ }
103
+ .resize-handle {
104
+ width: 4px;
105
+ bottom: 0;
106
+ position: absolute;
107
+ right: -2px;
108
+ top: 0;
109
+ background: #29ACE1;
110
+ border-radius: 2px;
111
+ z-index: 100;
112
+ opacity: 0;
113
+ cursor: ew-resize;
114
+ transition: .2s;
115
+
116
+ &:hover {
117
+ opacity: 1;
118
+ }
119
+ }
120
+ .context-menu-toggle {
121
+ flex: 1 1 auto;
122
+ text-overflow: ellipsis;
123
+ white-space: nowrap;
124
+ overflow: hidden;
125
+
126
+ span {
127
+ font-size: 12px;
128
+ line-height: 36px;
129
+ }
130
+ }
131
+ .itf-sortable-list {
132
+ display: flex;
133
+ }
134
+ .table-view-header-space {
135
+ height: 100%;
136
+ position: absolute;
137
+ left: 0;
138
+ display: none;
139
+ background: transparent;
140
+ z-index: 100;
141
+ width: 2px;
142
+ margin-left: -1px;
143
+
144
+ &.right {
145
+ left: auto;
146
+ right: 0;
147
+ top: 0;
148
+ }
149
+ &.active {
150
+ display: block;
151
+ &.over {
152
+ background: #47BEFF;
153
+ }
154
+ }
155
+ }
156
+ .draggable-mirror {
157
+ opacity: .5;
158
+ }
159
+ .draggable-container--over .table-view-header-space {
160
+ display: block;
161
+ }
162
+ .draggable-container--over .draggable--over .table-view-header-space {
163
+ background: #47BEFF;
164
+ }
165
+ .table-view-header-space > .table-view-header-dropzone {
166
+ position: absolute;
167
+ top: 0;
168
+ right: -50px;
169
+ bottom: 0;
170
+ left: -50px;
171
+ }
172
+ .table-view-header-value:not(.reserved):hover {
173
+ background-color: var(--bs-tertiary-bg);
174
+ }
175
+ .draggable-source--is-dragging {
176
+ z-index: 100;
177
+ }
178
+ }
179
+
180
+ &__subtitle {
181
+ color: var(--itf-table-header-subtitle-color);
182
+ }
183
+
184
+ .table-view-item {
185
+ --itf-table2-row-bg: var(--itf-table-bg);
186
+
187
+ background-color: var(--itf-table2-row-bg);
188
+
189
+ &.selected {
190
+ --itf-table2-row-bg: var(--itf-table-selected-bg);
191
+ }
192
+ &:hover {
193
+ --itf-table2-row-bg: var(--itf-table-selected-bg);
194
+ }
195
+
196
+ .indicator {
197
+ border-left: 1px solid var(--itf-table-border-color);
198
+ }
199
+ }
200
+
201
+
202
+ &:hover {
203
+ .table-view-item-value.editable {
204
+ .form-control {
205
+ border: 1px solid var(--itf-table-input-border-color);
206
+ }
207
+ }
208
+ }
209
+ .table-view-item-value {
210
+ text-overflow: ellipsis;
211
+ align-items: stretch;
212
+ display: flex;
213
+ position: relative;
214
+ min-width: var(--itf-table-min-width);
215
+
216
+ .itf-table2__striped & {
217
+ border-right: 1px solid var(--bs-border-color);
218
+ border-bottom: 1px solid var(--bs-border-color);
219
+ }
220
+
221
+ &.editable {
222
+ padding: 2px;
223
+
224
+ .form-control {
225
+ border-radius: 0;
226
+ border: 1px solid transparent;
227
+ background-color: transparent;
228
+ box-shadow: none;
229
+
230
+ &:focus {
231
+ border-color: var(--itf-table-input-focus-border-color);
232
+ }
233
+ }
234
+ }
235
+
236
+ &.highlight-drop-column {
237
+ position: relative;
238
+
239
+ &:after {
240
+ content: "";
241
+ height: 100%;
242
+ z-index: 100;
243
+ width: 2px;
244
+ background: #47beff;
245
+ margin-left: -1px;
246
+ position: absolute;
247
+ left: 0;
248
+ }
249
+ &.right:after {
250
+ left: auto;
251
+ right: 0;
252
+ }
253
+ }
254
+
255
+ &.sticky {
256
+ z-index: 4;
257
+ position: -webkit-sticky;
258
+ position: sticky;
259
+ }
260
+ }
261
+ }
@@ -15,9 +15,9 @@
15
15
  </div>
16
16
 
17
17
  <div v-if="currencySelect" class="itf-money-field__currency">
18
- <span>{{ selectedCurrencyCode }}<itf-icon v-if="!currencyDisabled" name="chevron_down" /></span>
18
+ <span>{{ selectedCurrencyCode }}<itf-icon v-if="!currencyDisabled && currenciesList.length > 1" name="chevron_down" /></span>
19
19
  <select v-if="!disabled && !currencyDisabled" :value="currencyId" @input="onCurrencyChanged">
20
- <option v-for="currency in currencies" :key="currency.Id" :value="currency.Id" :selected="currencyId === currency.Id">
20
+ <option v-for="currency in currenciesList" :key="currency.Id" :value="currency.Id" :selected="currencyId === currency.Id">
21
21
  {{ currency.Symbol }}, {{ currency.Code }} - {{ currency.Title }}
22
22
  </option>
23
23
  </select>
@@ -77,6 +77,7 @@ import itfSelect from '../select/Select';
77
77
  import itfLabel from '../form/Label';
78
78
  import itfIcon from '../icon/Icon';
79
79
  import {stringToNumber} from '../../helpers/formatters';
80
+ import ITFSettings from '../../ITFSettings';
80
81
 
81
82
  export default @Component({
82
83
  name: 'itfMoneyField',
@@ -101,6 +102,10 @@ class itfMoneyField extends Vue {
101
102
  @Prop({ type: Number, default: -1000000000}) minValue;
102
103
  @Prop({ type: Number, default: 1000000000}) maxValue;
103
104
 
105
+ get currenciesList() {
106
+ return this.currencies?.length ? this.currencies : ITFSettings.currencies;
107
+ }
108
+
104
109
  get mask() {
105
110
  return {
106
111
  mask: Number,
@@ -128,11 +133,11 @@ class itfMoneyField extends Vue {
128
133
  }
129
134
 
130
135
  onCurrencyChanged(e) {
131
- const currency = this.currencies.find((c) => c.Id === parseInt(e.target.value));
136
+ const currency = this.currenciesList.find((c) => c.Id === parseInt(e.target.value));
132
137
  this.$emit('update:currency', currency)
133
138
  }
134
139
 
135
- get precition() {
140
+ get precition() {
136
141
  return this.selectedCurrency ? this.selectedCurrency.Precision : 2;
137
142
  }
138
143
 
@@ -149,10 +154,10 @@ class itfMoneyField extends Vue {
149
154
  }
150
155
 
151
156
  get selectedCurrency() {
152
- if (!this.currency || !this.currencies) {
153
- return null;
157
+ if (!this.currency || !this.currenciesList) {
158
+ return this.currenciesList.find(({ IsDefault }) => IsDefault) || null;
154
159
  }
155
- return this.currencies.find(({ Id }) => this.currency.Id === Id);
160
+ return this.currenciesList.find(({ Id }) => this.currency.Id === Id);
156
161
  }
157
162
 
158
163
  setValue (val) {
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
 
3
3
  <div class="itf-text-field input-group" :class="{ 'with-addon addon-start': prependIcon, 'with-addon addon-end': clearable }">
4
- <div class="addon" v-if="prependIcon || $slots.addon">
5
- <slot name="addon">
4
+ <slot name="addon">
5
+ <div class="addon" v-if="prependIcon">
6
6
  <itf-icon :name="prependIcon"/>
7
- </slot>
8
- </div>
7
+ </div>
8
+ </slot>
9
9
 
10
10
  <input
11
11
  ref="input"
@@ -5,7 +5,7 @@
5
5
  <slot></slot>
6
6
  </div>
7
7
 
8
- <div class="position-relative input-group">
8
+ <div class="position-relative" :class="{'input-group': prependIcon}">
9
9
  <div class="addon" v-if="prependIcon">
10
10
  <slot name="addon">
11
11
  <itf-icon :name="prependIcon"/>