@itfin/components 1.3.96 → 2.0.2

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.
Files changed (94) hide show
  1. package/package.json +1 -1
  2. package/src/assets/scss/_css_variables.scss +2 -2
  3. package/src/assets/scss/_variables.scss +31 -9
  4. package/src/assets/scss/components/_button.scss +10 -0
  5. package/src/assets/scss/components/_datepicker.scss +3 -3
  6. package/src/assets/scss/components/_pagination.scss +4 -1
  7. package/src/assets/scss/components/_select.scss +4 -6
  8. package/src/assets/scss/components/_text-field.scss +19 -11
  9. package/src/assets/scss/main.scss +41 -2
  10. package/src/components/app/message.js +1 -1
  11. package/src/components/button/Button.vue +4 -2
  12. package/src/components/filter/FilterAmountRange.vue +50 -42
  13. package/src/components/filter/FilterBadge.vue +27 -22
  14. package/src/components/filter/FilterFacetsList.vue +20 -17
  15. package/src/components/filter/FilterPanel.vue +82 -27
  16. package/src/components/filter/index.stories.js +0 -2
  17. package/src/components/icon/Icon.vue +4 -2
  18. package/src/components/icon/components/fi_fingerprint.vue +4 -0
  19. package/src/components/icon/components/nomi-arrow-down.vue +4 -0
  20. package/src/components/icon/components/nomi-arrow-right-top.vue +4 -0
  21. package/src/components/icon/components/nomi-arrow-up.vue +4 -0
  22. package/src/components/icon/components/nomi-arrows.vue +7 -0
  23. package/src/components/icon/components/nomi-calendar-alt.vue +4 -0
  24. package/src/components/icon/components/nomi-calendar.vue +11 -0
  25. package/src/components/icon/components/nomi-card.vue +4 -0
  26. package/src/components/icon/components/nomi-clear.vue +4 -0
  27. package/src/components/icon/components/nomi-close.vue +5 -0
  28. package/src/components/icon/components/nomi-eye-close.vue +4 -0
  29. package/src/components/icon/components/nomi-eye-open.vue +4 -0
  30. package/src/components/icon/components/nomi-filter.vue +4 -0
  31. package/src/components/icon/components/nomi-hide.vue +4 -0
  32. package/src/components/icon/components/nomi-money.vue +4 -0
  33. package/src/components/icon/components/nomi-move-left.vue +4 -0
  34. package/src/components/icon/components/nomi-move-right.vue +4 -0
  35. package/src/components/icon/components/nomi-person.vue +5 -0
  36. package/src/components/icon/components/nomi-pin.vue +7 -0
  37. package/src/components/icon/components/nomi-scissors.vue +4 -0
  38. package/src/components/icon/components/nomi-sort-asc.vue +7 -0
  39. package/src/components/icon/components/nomi-sort-desc.vue +7 -0
  40. package/src/components/icon/components/nomi-table-view.vue +4 -0
  41. package/src/components/icon/components/nomi-tag.vue +4 -0
  42. package/src/components/icon/components/nomi-target.vue +4 -0
  43. package/src/components/icon/components/nomi-text.vue +6 -0
  44. package/src/components/icon/components/nomi-unpin.vue +7 -0
  45. package/src/components/icon/convert-icons.js +11 -0
  46. package/src/components/icon/icons.js +311 -284
  47. package/src/components/icon/new-icons/arrow-down.svg +3 -0
  48. package/src/components/icon/new-icons/arrow-right-top.svg +3 -0
  49. package/src/components/icon/new-icons/arrow-up.svg +3 -0
  50. package/src/components/icon/new-icons/arrows.svg +6 -0
  51. package/src/components/icon/new-icons/calendar-alt.svg +3 -0
  52. package/src/components/icon/new-icons/calendar.svg +10 -0
  53. package/src/components/icon/new-icons/card.svg +3 -0
  54. package/src/components/icon/new-icons/clear.svg +3 -0
  55. package/src/components/icon/new-icons/close.svg +4 -0
  56. package/src/components/icon/new-icons/eye-close.svg +3 -0
  57. package/src/components/icon/new-icons/eye-open.svg +3 -0
  58. package/src/components/icon/new-icons/filter.svg +3 -0
  59. package/src/components/icon/new-icons/hide.svg +3 -0
  60. package/src/components/icon/new-icons/money.svg +3 -0
  61. package/src/components/icon/new-icons/move-left.svg +3 -0
  62. package/src/components/icon/new-icons/move-right.svg +3 -0
  63. package/src/components/icon/new-icons/person.svg +4 -0
  64. package/src/components/icon/new-icons/pin.svg +6 -0
  65. package/src/components/icon/new-icons/scissors.svg +3 -0
  66. package/src/components/icon/new-icons/sort-asc.svg +6 -0
  67. package/src/components/icon/new-icons/sort-desc.svg +6 -0
  68. package/src/components/icon/new-icons/table-view.svg +3 -0
  69. package/src/components/icon/new-icons/tag.svg +3 -0
  70. package/src/components/icon/new-icons/target.svg +3 -0
  71. package/src/components/icon/new-icons/text.svg +5 -0
  72. package/src/components/icon/new-icons/unpin.svg +6 -0
  73. package/src/components/modal/DeleteConfirmModal.vue +0 -2
  74. package/src/components/modal/ItemEditor.vue +1 -5
  75. package/src/components/pagination/Pagination.vue +3 -2
  76. package/src/components/pagination/Pagination2.vue +176 -0
  77. package/src/components/panels/Panel.vue +1 -1
  78. package/src/components/popover/NoticePopout.vue +1 -1
  79. package/src/components/sortable/draggable.js +2 -1
  80. package/src/components/table/Table2.vue +24 -1
  81. package/src/components/table/TableBody.vue +7 -2
  82. package/src/components/table/TableGroup.vue +25 -10
  83. package/src/components/table/TableHeader.vue +101 -61
  84. package/src/components/table/TableRows.vue +9 -7
  85. package/src/components/table/index.stories.js +22 -200
  86. package/src/components/table/table2.scss +203 -65
  87. package/src/components/text-field/MoneyField.vue +9 -52
  88. package/src/components/text-field/TextField.vue +12 -8
  89. package/src/components/view/View.vue +154 -0
  90. package/src/components/view/index.stories.js +588 -0
  91. package/src/helpers/formatters.js +14 -1
  92. package/src/locales/en.js +13 -0
  93. package/src/locales/uk.js +11 -0
  94. package/src/components/table/TableRow.vue +0 -221
@@ -1,30 +1,35 @@
1
1
  :root {
2
- --itf-table-border-color: #e1e1e1;
3
- --itf-table-header-bg: #f8f8f8;
4
- --itf-table-font-size: 1rem;
5
- --itf-table-selected-bg: #f0f0f0;
6
- --itf-table-active-bg: #e0e0e0;
7
- --itf-table-alt-bg: #f9f9f9;
8
- //--itf-table-border-color: #e1e1e1;
9
- //--itf-table-header-bg: #f9faf5;
10
- //--itf-table-selected-bg: #cbd6f4;
11
- --itf-table-header-bg: #f8f8f8;
12
- --itf-table-border-color: #dbddd1;
13
- --itf-table-hover-header-bg: var(--bs-tertiary-bg);
14
- --itf-table-hover-bg: #f2f2f2;
2
+ --itf-primary: #1A4A97;
3
+ --itf-table-header-font-size: 12px;
4
+ --itf-table-content-font-size: 16px;
5
+ --itf-table-selected-bg: #f9fafc;
6
+ --itf-table-active-bg: #1A4A971A;
7
+ --itf-table-alt-bg: #F9FAFB;
8
+ --itf-table-alt-selected-bg: #eff1f3;
9
+ --itf-table-header-bg: #f5f7f8;
10
+ --itf-table-header-color: #8E97A5;
11
+ --itf-table-mirror-bg: #F2F4F7;
12
+ --itf-table-border-color: transparent; //var(--itf-table-header-bg);
13
+ --itf-table-header-border-color: #8E97A533;
14
+ --itf-table-border-base-color: var(--itf-table-header-bg); // кольори границь таблиці без внутрішніх рядків
15
+ --itf-table-border-base-width: 2px;
16
+ --itf-table-hover-header-bg: #1A4A971A;
17
+ --itf-table-hover-bg: #e9edf5;
15
18
  --itf-table-bg: var(--bs-body-bg);
16
19
  --itf-table-min-width: 45px;
17
20
  --itf-table-input-border-color: #aaaba6;
18
21
  --itf-table-input-focus-border-color: #0028aa;
19
22
  --itf-table-header-subtitle-color: #aeafaa;
20
23
  --itf-table-summary-text: var(--bs-tertiary-color);
24
+ --itf-table-table-border-radius: 1rem;
25
+ --itf-table-header-height: 2.25rem;
21
26
 
22
27
  --group-title-height: 40px;
23
- --table-row-height: 36px;
24
- --table-small-row-size: var(--table-row-height);
28
+ --table-row-height: none;
29
+ --table-small-row-size: 3rem;
25
30
  --shadow-area-width: 12px;
26
31
  --indicator-area-width: 38px;
27
- --hover-bg: var(--bs-tertiary-bg);
32
+ --bs-dropdown-item-border-radius: .5rem;
28
33
  }
29
34
  // dark
30
35
  body[data-theme="dark"] {
@@ -40,16 +45,27 @@ body[data-theme="dark"] {
40
45
  --itf-table-summary-text: #82909d80;
41
46
  }
42
47
  .itf-table2 {
43
- font-size: var(--itf-table-font-size);
48
+ font-size: var(--itf-table-content-font-size, var(--itf-table-font-size));
49
+ position: relative;
44
50
 
51
+ .itf-cell-center {
52
+ width: 100%;
53
+ height: 100%;
54
+ display: flex;
55
+ align-items: center;
56
+ }
45
57
  .scrollable {
46
58
  -webkit-overflow-scrolling: touch;
47
59
  overflow: hidden scroll;
48
60
  height: 100%;
49
61
  }
62
+ .scroller {
63
+ margin-bottom: .5rem;
64
+ }
50
65
  .scrollable-x {
51
66
  overflow-x: scroll;
52
67
  padding-right: 4px;
68
+ padding-top: 10px; // щоб drag для колонок був видимий
53
69
  }
54
70
  &.table-absolute {
55
71
  position: absolute;
@@ -92,16 +108,58 @@ body[data-theme="dark"] {
92
108
  pointer-events: none;
93
109
  }
94
110
  .table-header-add-column {
95
- background-image: linear-gradient(90deg, transparent 0, var(--itf-table-header-bg) 10px);
111
+ border-top-right-radius: var(--itf-table-table-border-radius);
112
+ background-image: linear-gradient(90deg, var(--itf-table2-row-bg) 0, var(--itf-table-header-bg) 10px);
96
113
  }
97
114
 
115
+ &__header-icon {
116
+ margin-top: -1px;
117
+ }
118
+ &__drag-column {
119
+ position: absolute;
120
+ top: -.5rem;
121
+ left: 50%;
122
+ transform: translateX(-50%);
123
+ z-index: 100;
124
+ opacity: 0;
125
+ transition: opacity 0.2s;
126
+ cursor: move;
127
+ height: 1.5rem !important;
128
+ padding: 0 !important;
129
+ min-height: auto !important;
130
+ }
131
+ .last-sticky-column {
132
+ position: relative;
133
+ &:after {
134
+ content: "";
135
+ position: absolute;
136
+ right: 0;
137
+ top: 0;
138
+ width: 20px;
139
+ z-index: 1;
140
+ bottom: 5px;
141
+ box-shadow: 0px 4px 20px 0px #0000001A;
142
+ }
143
+ }
98
144
  &__header {
99
- --itf-table2-row-bg: --itf-table-header-bg;
100
- background-color: var(--itf-table-header-bg);
145
+ --itf-table2-row-bg: var(--itf-table-header-bg);
146
+ //background-color: var(--itf-table-header-bg);
101
147
  position: sticky;
102
148
  top: 0;
103
149
  z-index: calc(var(--row-count) + 1);
150
+ font-size: var(--itf-table-header-font-size, var(--itf-table-font-size));
151
+ color: var(--itf-table-header-color);
152
+ text-transform: uppercase;
104
153
 
154
+ .table-view-header-value:hover {
155
+ .itf-table2__drag-column {
156
+ opacity: 1;
157
+ }
158
+ }
159
+
160
+ .table-view-item-value.extra {
161
+ border-top-right-radius: var(--itf-table-table-border-radius);
162
+ }
105
163
  &.no-header {
106
164
  --table-row-height: 0px;
107
165
  --table-small-row-size: 0px;
@@ -113,10 +171,21 @@ body[data-theme="dark"] {
113
171
  }
114
172
  .table-header.draggable-mirror{
115
173
  z-index: 100000001;
116
- background: rgba(235,237,239,0.75);
174
+ border-radius: .25rem;
175
+ border: 1px solid var(--itf-primary);
176
+ color: var(--itf-primary);
177
+ background-color: var(--itf-table-hover-header-bg);
178
+
179
+ .itf-table2__drag-column {
180
+ opacity: 1;
181
+ display: block;
182
+ }
183
+ }
184
+ .itf-table2 & .boundary.right {
185
+ top: var(--itf-table-table-border-radius);
117
186
  }
118
187
  .itf-table2 & .boundary.top, .itf-table2 & .boundary.bottom {
119
- border-color: var(--itf-table-border-color)
188
+ border-color: transparent;// var(--itf-table-border-color)
120
189
  }
121
190
  .table-row-template {
122
191
  display: flex;
@@ -124,6 +193,23 @@ body[data-theme="dark"] {
124
193
  align-items: stretch;
125
194
  height: auto;
126
195
  user-select: none;
196
+ background: var(--itf-table-bg);
197
+ min-height: var(--itf-table-header-height);
198
+
199
+ &:not(.draggable-container--is-dragging) .table-view-header-value {
200
+ z-index: 9;
201
+ }
202
+ &:after {
203
+ content: "";
204
+ position: absolute;
205
+ display: block;
206
+ height: 12px;
207
+ left: 0;
208
+ right: 0;
209
+ top: -12px;
210
+ z-index: 4;
211
+ background: var(--itf-table-bg);
212
+ }
127
213
  }
128
214
  .table-view-header-value {
129
215
  cursor: pointer;
@@ -132,10 +218,9 @@ body[data-theme="dark"] {
132
218
  height: auto;
133
219
  white-space: nowrap;
134
220
  //border-top: 0;
135
- border-top: 1px solid var(--itf-table-border-color);
221
+ //border-top: 1px solid var(--itf-table-border-color);
136
222
  border-left: 0;
137
- border-right: 1px solid var(--itf-table-border-color);
138
- border-bottom: 1px solid var(--itf-table-border-color);
223
+ //border-bottom: 1px solid var(--itf-table-border-color);
139
224
  position: relative;
140
225
  display: flex;
141
226
  min-width: var(--itf-table-min-width);
@@ -143,14 +228,25 @@ body[data-theme="dark"] {
143
228
  //background-color: var(--bs-body-bg);
144
229
  //background-color: rgb(238 238 238 / 1);
145
230
  //font-weight: 500;
146
-
147
- &.last-sticky-column {
148
- border-right-color: var(--bs-border-color);
231
+ &:not(.reserved) {
232
+ border-right: 1px solid var(--itf-table-header-border-color);
233
+ }
234
+ &.active .table-header {
235
+ color: var(--itf-primary);
236
+ background-color: var(--itf-table-hover-header-bg);
149
237
  }
238
+
239
+ //&.last-sticky-column {
240
+ // border-right-color: var(--bs-border-color);
241
+ //}
150
242
  &.reserved {
151
- border-left: 1px solid var(--itf-table-border-color);
243
+ border-left: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
152
244
  left: var(--shadow-area-width);
153
245
  width: var(--indicator-area-width);
246
+
247
+ &.sticky {
248
+ border-top-left-radius: var(--itf-table-table-border-radius);
249
+ }
154
250
  }
155
251
  &.sticky {
156
252
  position: sticky;
@@ -160,16 +256,21 @@ body[data-theme="dark"] {
160
256
  }
161
257
  .table-header {
162
258
  flex: 0 0 auto;
163
- overflow: hidden;
259
+ //overflow: hidden;
164
260
  width: 100%;
261
+ height: 100%;
165
262
  text-overflow: ellipsis;
166
- padding-left: 0.75rem;
167
- padding-right: 0.5rem;
168
263
  gap: 0.25rem;
169
264
  align-items: center;
265
+ position: relative;
266
+ z-index: 2;
267
+ background: var(--itf-table-header-bg);
268
+
170
269
  & > div {
270
+ padding: .5rem .75rem;
271
+ height: 100%;
171
272
  min-height: var(--table-row-height);
172
- align-items: center;
273
+ align-items: start;
173
274
  justify-content: space-between;
174
275
  display: flex;
175
276
  }
@@ -179,12 +280,12 @@ body[data-theme="dark"] {
179
280
  }
180
281
  }
181
282
  .resize-handle {
182
- width: 4px;
283
+ width: 2px;
183
284
  bottom: 0;
184
285
  position: absolute;
185
- right: -2px;
286
+ right: -1px;
186
287
  top: 0;
187
- background: #29ACE1;
288
+ background: var(--itf-primary);
188
289
  border-radius: 2px;
189
290
  z-index: 100;
190
291
  opacity: 0;
@@ -226,19 +327,20 @@ body[data-theme="dark"] {
226
327
  }
227
328
  &.active {
228
329
  display: block;
330
+
331
+ .drag-handle {
332
+ opacity: 1;
333
+ }
229
334
  &.over {
230
- background: #47BEFF;
335
+ background: var(--itf-primary);
231
336
  }
232
337
  }
233
338
  }
234
- .draggable-mirror {
235
- opacity: .5;
236
- }
237
339
  .draggable-container--over .table-view-header-space {
238
340
  display: block;
239
341
  }
240
342
  .draggable-container--over .draggable--over .table-view-header-space {
241
- background: #47BEFF;
343
+ background: var(--itf-primary);
242
344
  }
243
345
  .table-view-header-space > .table-view-header-dropzone {
244
346
  position: absolute;
@@ -247,41 +349,77 @@ body[data-theme="dark"] {
247
349
  bottom: 0;
248
350
  left: -50px;
249
351
  }
250
- .table-view-header-value:not(.reserved):hover {
251
- background-color: var(--itf-table-hover-header-bg);
352
+ .table-view-header-value:not(.reserved):hover .table-header {
353
+ color: var(--itf-primary);
354
+ //background-color: var(--itf-table-hover-header-bg);
252
355
  }
253
356
  .draggable-source--is-dragging {
254
- z-index: 100;
357
+ z-index: 1000;
358
+ color: transparent;
359
+ background: var(--itf-table-mirror-bg);
360
+ }
361
+ .draggable-container--is-dragging {
362
+ .itf-table2__drag-column, .resize-handle {
363
+ display: none;
364
+ }
255
365
  }
256
366
  }
257
367
 
368
+ &__title-container, &__header-title, &__title, &__subtitle {
369
+ min-width: 0; // for text ellipsis
370
+ }
258
371
  &__subtitle {
259
372
  color: var(--itf-table-header-subtitle-color);
373
+
374
+ .draggable-source--is-dragging & {
375
+ color: transparent;
376
+ }
260
377
  }
261
378
 
262
379
  .table-view-item {
263
380
  --itf-table2-row-bg: var(--itf-table-bg);
381
+ --itf-table2-border-color: var(--itf-table-border-base-color);
264
382
 
265
383
  background-color: var(--itf-table2-row-bg);
266
384
 
267
- &.selected, &:hover {
385
+ &.selected {
386
+ --itf-table2-border-color: var(--bs-body-color);
387
+ }
388
+ &:hover {
389
+ --itf-table2-row-bg: var(--itf-table-hover-bg) !important;
390
+ }
391
+ &.selected {
268
392
  --itf-table2-row-bg: var(--itf-table-selected-bg) !important;
393
+ &:nth-child(even) {
394
+ --itf-table2-row-bg: var(--itf-table-alt-selected-bg) !important;
395
+ }
396
+
397
+ &:hover {
398
+ --itf-table2-row-bg: var(--itf-table-hover-bg) !important;
399
+ }
269
400
  }
270
401
  &.active {
271
402
  --itf-table2-row-bg: var(--itf-table-active-bg) !important;
272
403
  }
273
404
 
274
405
  .indicator {
275
- border-left: 1px solid var(--itf-table-border-color);
406
+ border-left: var(--itf-table-border-base-width) solid var(--itf-table2-border-color);
276
407
  }
277
408
  }
278
409
 
279
- &:hover, &.permanent-editable-border {
280
- .table-view-item-value.editable {
281
- .form-control {
282
- border: 1px solid var(--itf-table-input-border-color);
283
- }
284
- }
410
+ //&:hover, &.permanent-editable-border {
411
+ // .table-view-item-value.editable {
412
+ // .form-control {
413
+ // border: 1px solid var(--itf-table-input-border-color);
414
+ // }
415
+ // }
416
+ //}
417
+ .table-view-item-value-content {
418
+ position: relative;
419
+ z-index: 2;
420
+ width: 100%;
421
+ height: 100%;
422
+ background: var(--itf-table2-row-bg)
285
423
  }
286
424
  .table-view-item-value {
287
425
  text-overflow: ellipsis;
@@ -298,16 +436,16 @@ body[data-theme="dark"] {
298
436
  &.editable {
299
437
  padding: 2px;
300
438
 
301
- .form-control {
302
- border-radius: 0;
303
- border: 1px solid transparent;
304
- background-color: transparent;
305
- box-shadow: none;
306
-
307
- &:focus {
308
- border-color: var(--itf-table-input-focus-border-color);
309
- }
310
- }
439
+ //.form-control {
440
+ // border-radius: 0;
441
+ // border: 1px solid transparent;
442
+ // background-color: transparent;
443
+ // box-shadow: none;
444
+ //
445
+ // &:focus {
446
+ // border-color: var(--itf-table-input-focus-border-color);
447
+ // }
448
+ //}
311
449
  }
312
450
 
313
451
  &.highlight-drop-column {
@@ -316,9 +454,9 @@ body[data-theme="dark"] {
316
454
  &:after {
317
455
  content: "";
318
456
  height: 100%;
319
- z-index: 100;
457
+ z-index: 1000;
320
458
  width: 2px;
321
- background: #47beff;
459
+ background: var(--itf-primary);
322
460
  margin-left: -1px;
323
461
  position: absolute;
324
462
  left: 0;
@@ -355,7 +493,7 @@ body[data-theme="dark"] {
355
493
 
356
494
  &.right {
357
495
  left: auto;
358
- border-right: 1px solid var(--itf-table-border-color);
496
+ border-right: var(--itf-table-border-base-width) solid var(--itf-table-border-base-color);
359
497
  right: 0;
360
498
  }
361
499
 
@@ -1,26 +1,24 @@
1
1
  <template>
2
2
  <div class="itf-money-field ph-no-capture" :class="{'currency-arrow': !currencyDisabled, 'currency-select': currencySelect}">
3
- <div class="h-100" :class="{'input-group h-100': noCurrencySign}" :style="`--itf-money-field-padding-left: ${noCurrencySign ? 1 : selectedCurrencySymbol.length * 0.6 + 1}rem`">
4
- <span class="itf-money-field__prepend" v-if="!noCurrencySign">{{ selectedCurrencySymbol }}</span>
3
+ <div class="input-group h-100" :style="`--itf-money-field-padding-left: ${noCurrencySign ? 1 : selectedCurrencySymbol.length * 0.6 + 1}rem`">
4
+ <span class="input-group-text pe-1" v-if="!noCurrencySign">{{ selectedCurrencySymbol }}</span>
5
5
  <i-mask-component
6
6
  ref="input"
7
7
  v-bind="mask"
8
- class="form-control h-100"
8
+ class="form-control"
9
9
  :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }"
10
10
  @input="setValue"
11
11
  :value="maskedValue"
12
12
  :unmask="false"
13
13
  :disabled="disabled"
14
14
  />
15
- </div>
16
-
17
- <div v-if="currencySelect" class="itf-money-field__currency">
18
- <span>{{ selectedCurrencyCode }}<itf-icon v-if="!currencyDisabled && currenciesList.length > 1" name="chevron_down" /></span>
19
- <select v-if="!disabled && !currencyDisabled" :value="currencyId" @input="onCurrencyChanged">
15
+ <span v-if="currencySelect" class="input-group-text ps-1">{{ selectedCurrencyCode }}<itf-icon v-if="!currencyDisabled && currenciesList.length > 1" name="chevron_down" /></span>
16
+ <select v-if="currencySelect && !disabled && !currencyDisabled" :value="currencyId" @input="onCurrencyChanged">
20
17
  <option v-for="currency in currenciesList" :key="currency.Id" :value="currency.Id" :selected="currencyId === currency.Id">
21
18
  {{ currency.Symbol }}, {{ currency.Code }} - {{ currency.Title }}
22
19
  </option>
23
20
  </select>
21
+ <slot name="postfix"></slot>
24
22
  </div>
25
23
  </div>
26
24
  </template>
@@ -28,50 +26,9 @@
28
26
  .itf-money-field {
29
27
  position: relative;
30
28
 
31
- input {
32
- padding-left: var(--itf-money-field-padding-left, 1.5rem);
33
-
34
- &.is-invalid, &.is-valid {
35
- padding-right: 4rem;
36
- }
37
- }
38
- &.currency-select {
39
- input {
40
- padding-right: 3rem;
41
- }
42
- &.currency-arrow {
43
- input {
44
- padding-right: 4.5rem;
45
- }
46
- }
47
- }
48
-
49
- &__prepend {
50
- position: absolute;
51
- left: .75rem;
52
- top: .5rem;
53
- bottom: .5rem;
54
- display: flex;
55
- align-items: center;
56
- }
57
- &__currency {
58
- position: absolute;
59
- right: .75rem;
60
- top: 0;
61
- bottom: 0;
62
- display: flex;
63
- align-items: center;
64
- .is-invalid &, .is-valid & {
65
- right: 1.75rem;
66
- }
67
-
68
- select {
69
- position: absolute;
70
- height: 100%;
71
- right: 0;
72
- opacity: 0;
73
- left: 0;
74
- }
29
+ .form-control {
30
+ padding-left: 0;
31
+ padding-right: 0;
75
32
  }
76
33
  }
77
34
  </style>
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
 
3
- <div class="itf-text-field input-group" :class="{ 'with-addon addon-start': prependIcon, 'with-addon addon-end': clearable }">
3
+ <div class="itf-text-field input-group form-control p-0" :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess() }">
4
4
  <slot name="addon">
5
- <div class="addon" v-if="prependIcon">
6
- <itf-icon :name="prependIcon"/>
5
+ <div class="input-group-text" v-if="prependIcon">
6
+ <itf-icon :size="small ? 18 : 20" :name="prependIcon"/>
7
7
  </div>
8
8
  </slot>
9
9
 
@@ -11,7 +11,7 @@
11
11
  ref="input"
12
12
  autocomplete="off"
13
13
  :placeholder="placeholder"
14
- :class="{ 'is-invalid': isInvalid(), 'is-valid': isSuccess(), 'form-control-sm': small }"
14
+ :class="{ 'form-control-sm': small }"
15
15
  class="itf-text-field__input form-control"
16
16
  :type="type"
17
17
  :value="value"
@@ -24,12 +24,13 @@
24
24
  @blur="$emit('blur', $event)"
25
25
  @focus="$emit('focus', $event)"
26
26
  @change="$emit('change', $event.target.value)"
27
+ :maxlength="maxlength"
27
28
  :min="min"
28
29
  :max="max"
29
30
  :step="step"
30
31
  />
31
32
 
32
- <div class="addon-end" v-if="clearable && value">
33
+ <template v-if="clearable && value">
33
34
  <slot name="clear">
34
35
  <itf-button
35
36
  icon
@@ -39,7 +40,7 @@
39
40
  <itf-icon name="close" />
40
41
  </itf-button>
41
42
  </slot>
42
- </div>
43
+ </template>
43
44
  </div>
44
45
 
45
46
  </template>
@@ -64,10 +65,13 @@ class itfTextField extends Vue {
64
65
  @Prop() step;
65
66
  @Prop() min;
66
67
  @Prop() max;
68
+ @Prop() maxlength;
67
69
  @Prop(Boolean) clearable;
68
70
  @Prop(Boolean) disabled;
69
71
  @Prop(Boolean) readonly;
70
72
  @Prop(Boolean) small;
73
+ @Prop(Boolean) invalid;
74
+ @Prop(Boolean) valid;
71
75
  @Prop({ type: String, default: 'text' }) type;
72
76
  @Prop({ type: [Number, String], default: 0 }) delayInput;
73
77
 
@@ -78,11 +82,11 @@ class itfTextField extends Vue {
78
82
  }
79
83
 
80
84
  isInvalid() {
81
- return this.itemLabel && this.itemLabel.isHasError();
85
+ return typeof this.invalid !== 'undefined' ? this.invalid : (this.itemLabel && this.itemLabel.isHasError());
82
86
  }
83
87
 
84
88
  isSuccess() {
85
- return this.itemLabel && this.itemLabel.isHasSuccess();
89
+ return typeof this.valid !== 'undefined' ? this.valid : (this.itemLabel && this.itemLabel.isHasSuccess());
86
90
  }
87
91
 
88
92
  insertTextToCurrentPosition(text) {