@itfin/components 1.5.0 → 1.5.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/dist/ITFComponents.common.js +87 -0
  2. package/dist/ITFComponents.common.js.map +1 -0
  3. package/dist/ITFComponents.umd.js +98 -0
  4. package/dist/ITFComponents.umd.js.map +1 -0
  5. package/dist/ITFComponents.umd.min.js +2 -0
  6. package/dist/ITFComponents.umd.min.js.map +1 -0
  7. package/dist/demo.html +1 -0
  8. package/package.json +1 -1
  9. package/src/assets/scss/_css_variables.scss +7 -2
  10. package/src/assets/scss/_dark-theme.scss +12 -2
  11. package/src/assets/scss/_variables.scss +9 -34
  12. package/src/assets/scss/components/_button.scss +10 -29
  13. package/src/assets/scss/components/_checkbox.scss +0 -9
  14. package/src/assets/scss/components/_datepicker.scss +3 -3
  15. package/src/assets/scss/components/_pagination.scss +1 -4
  16. package/src/assets/scss/components/_popover.scss +0 -22
  17. package/src/assets/scss/components/_segmeneted-control.scss +8 -19
  18. package/src/assets/scss/components/_select.scss +8 -6
  19. package/src/assets/scss/components/_text-field.scss +7 -9
  20. package/src/assets/scss/components/select/_dropdown-menu.scss +0 -1
  21. package/src/assets/scss/components/select/_dropdown-toggle.scss +1 -0
  22. package/src/assets/scss/directives/tooltip.scss +5 -10
  23. package/src/assets/scss/main.scss +0 -48
  24. package/src/components/alert/AlertBanner.vue +70 -14
  25. package/src/components/card/BentoGrid.vue +2 -0
  26. package/src/components/checkbox/NestedCheckboxGroup.vue +109 -0
  27. package/src/components/editor/plugins.js +1012 -0
  28. package/src/components/filter/FilterBadge.vue +3 -3
  29. package/src/components/filter/FilterFacetsList.vue +13 -7
  30. package/src/components/icon/components/nomi-.DS_Store +0 -0
  31. package/src/components/icon/components/nomi-approval-chain.vue +5 -0
  32. package/src/components/icon/components/nomi-budget.vue +4 -0
  33. package/src/components/icon/components/nomi-close-alt.vue +5 -0
  34. package/src/components/icon/components/nomi-cog-lightning.vue +5 -0
  35. package/src/components/icon/components/nomi-comment-add.vue +5 -0
  36. package/src/components/icon/components/nomi-comment.vue +4 -0
  37. package/src/components/icon/components/nomi-comments.vue +5 -0
  38. package/src/components/icon/components/nomi-copy.vue +5 -0
  39. package/src/components/icon/components/nomi-delta.vue +7 -0
  40. package/src/components/icon/components/nomi-dollar.vue +4 -0
  41. package/src/components/icon/components/nomi-expense-requests.vue +5 -0
  42. package/src/components/icon/components/nomi-file-doc.vue +7 -0
  43. package/src/components/icon/components/nomi-file-excel.vue +9 -0
  44. package/src/components/icon/components/nomi-file-image.vue +6 -0
  45. package/src/components/icon/components/nomi-file-pdf.vue +5 -0
  46. package/src/components/icon/components/nomi-light-bulb.vue +4 -0
  47. package/src/components/icon/components/nomi-money-alt.vue +4 -0
  48. package/src/components/icon/components/nomi-money-requests.vue +12 -0
  49. package/src/components/icon/components/nomi-pending.vue +4 -0
  50. package/src/components/icon/components/nomi-plus.vue +5 -0
  51. package/src/components/icon/components/nomi-secure.vue +4 -0
  52. package/src/components/icon/components/nomi-stop.vue +4 -0
  53. package/src/components/icon/components/nomi-thumbs-down.vue +4 -0
  54. package/src/components/icon/components/nomi-thumbs-up.vue +4 -0
  55. package/src/components/icon/components/nomi-undo.vue +4 -0
  56. package/src/components/icon/components/nomi-user-settings.vue +5 -0
  57. package/src/components/icon/icons.js +397 -371
  58. package/src/components/icon/new-icons/approval-chain.svg +4 -0
  59. package/src/components/icon/new-icons/budget.svg +3 -0
  60. package/src/components/icon/new-icons/close-alt.svg +4 -0
  61. package/src/components/icon/new-icons/cog-lightning.svg +4 -0
  62. package/src/components/icon/new-icons/comment-add.svg +4 -0
  63. package/src/components/icon/new-icons/comment.svg +3 -0
  64. package/src/components/icon/new-icons/comments.svg +4 -0
  65. package/src/components/icon/new-icons/copy.svg +4 -0
  66. package/src/components/icon/new-icons/delta.svg +6 -0
  67. package/src/components/icon/new-icons/dollar.svg +3 -0
  68. package/src/components/icon/new-icons/expense-requests.svg +4 -0
  69. package/src/components/icon/new-icons/file-doc.svg +6 -0
  70. package/src/components/icon/new-icons/file-excel.svg +8 -0
  71. package/src/components/icon/new-icons/file-image.svg +5 -0
  72. package/src/components/icon/new-icons/file-pdf.svg +4 -0
  73. package/src/components/icon/new-icons/light-bulb.svg +3 -0
  74. package/src/components/icon/new-icons/money-alt.svg +3 -0
  75. package/src/components/icon/new-icons/money-requests.svg +11 -0
  76. package/src/components/icon/new-icons/pending.svg +3 -0
  77. package/src/components/icon/new-icons/plus.svg +4 -0
  78. package/src/components/icon/new-icons/secure.svg +3 -0
  79. package/src/components/icon/new-icons/stop.svg +3 -0
  80. package/src/components/icon/new-icons/thumbs-down.svg +3 -0
  81. package/src/components/icon/new-icons/thumbs-up.svg +3 -0
  82. package/src/components/icon/new-icons/undo.svg +3 -0
  83. package/src/components/icon/new-icons/user-settings.svg +4 -0
  84. package/src/components/modal/Modal.vue +6 -1
  85. package/src/components/pagination/Pagination2.vue +4 -3
  86. package/src/components/panels/Panel.vue +2 -1
  87. package/src/components/panels/PanelItemEdit.vue +91 -10
  88. package/src/components/panels/PanelList.vue +3 -0
  89. package/src/components/panels/helpers.ts +14 -4
  90. package/src/components/text-field/TextField.vue +8 -0
  91. package/src/components/view/View.vue +14 -0
  92. package/src/locales/en.js +7 -1
  93. package/src/locales/pl.js +2 -1
  94. package/src/locales/uk.js +7 -1
@@ -1,35 +1,30 @@
1
1
  @import '../variables';
2
2
  @import '../bootstrap';
3
3
 
4
- $tooltip-color: #22222B;
4
+ $tooltip-color: #fff9ae;
5
5
  $dark-tooltip-color: #7b52eb;
6
6
 
7
7
  :root {
8
8
  --itf-tooltip-shadow: 0 0 20px 4px rgba(154, 161, 177, .15), 0 4px 80px -8px rgba(36, 40, 47, .25), 0 4px 4px -2px rgba(91, 94, 105, .15);
9
- --itf-tooltip-color: #FFF;
9
+ --itf-tooltip-color: #{$body-color};
10
10
  --itf-tooltip-bg-color: #{$tooltip-color};
11
- --itf-tooltip-font-size: 14px;
12
11
  }
13
12
 
14
13
  [data-theme="dark"] {
15
14
  --itf-tooltip-shadow: 0 0 20px 4px rgba(87, 78, 101, 0.15), 0 4px 80px -8px rgba(211, 208, 219, 0.25), 0 4px 4px -2px rgba(156, 150, 164, 0.15);
16
15
  --itf-tooltip-color: #{$dark-body-color};
17
16
  --itf-tooltip-bg-color: #{$dark-tooltip-color};
18
- --itf-tooltip-font-size: 14px;
17
+ --itf-tooltip-font-size: 0.875rem;
19
18
  }
20
19
 
21
20
  .tippy-box[data-theme~=itfin] {
22
21
  color: var(--itf-tooltip-color);
23
22
  background-color: var(--itf-tooltip-bg-color);
24
23
  font-size: var(--itf-tooltip-font-size);
25
- border-radius: 0.5rem;
24
+ border-radius: 5px;
26
25
  box-shadow: var(--itf-tooltip-shadow);
27
- padding: .25rem .5rem;
26
+ padding: 5px;
28
27
  cursor: default;
29
- a {
30
- color: var(--itf-tooltip-color);
31
- text-decoration: underline;
32
- }
33
28
 
34
29
  &[data-placement^=top] > .tippy-arrow:before {
35
30
  border-top-color: var(--itf-tooltip-bg-color);
@@ -60,51 +60,3 @@ kbd {
60
60
  color: var(--bs-primary-color) !important
61
61
  }
62
62
  }
63
-
64
- // згідно з дизайном
65
- .dropdown-header {
66
- font-size: .75rem;
67
- padding: .75rem .5rem .25rem;
68
-
69
- &:first-child {
70
- padding-top: .25rem;
71
- }
72
- }
73
- //.dropdown-item {
74
- // --bs-dropdown-link-active-bg: #F1F2F4;
75
- // --bs-dropdown-link-active-color: var(--bs-body-color);
76
- // &:not(:last-child) {
77
- // margin-bottom: 1px;
78
- // }
79
- //
80
- // svg {
81
- // color: #8E97A5;
82
- // }
83
- // &:hover svg {
84
- // color: var(--bs-body-color);
85
- // }
86
- //}
87
- body .form-check-input:checked[type=checkbox] {
88
- --bs-form-check-bg-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1L3.5 6.5L1 4' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
89
- box-shadow: 0px 2px 3px 0px #00000026;
90
- }
91
- body .form-check-input:indeterminate[type=checkbox] {
92
- box-shadow: 0px 2px 3px 0px #00000026;
93
- }
94
- body .text-muted {
95
- color: #7A818E !important;
96
- }
97
- body .form-control {
98
- &:focus {
99
- box-shadow: none !important;
100
- }
101
- }
102
-
103
- @keyframes pulse-shadow {
104
- 0% { box-shadow: 0 0 0 0 rgba(26, 74, 151, 0) }
105
- 50% { box-shadow: 0 0 0 4px rgba(26, 74, 151, 0.15) }
106
- 100% { box-shadow: 0 0 0 0 rgba(26, 74, 151, 0) }
107
- }
108
- .pulsing {
109
- animation: pulse-shadow 3s ease-in-out infinite;
110
- }
@@ -1,16 +1,19 @@
1
1
  <template>
2
- <div class="itf-alert-banner">
2
+ <div class="itf-alert-banner" :class="styleVariant">
3
3
  <div v-if="count" class="itf-alert-banner__counter px-2 bg-danger text-white fw-bold text-smaller text-decoration-none d-block rounded-pill">
4
4
  {{ count > 99 ? '99+' : count }}
5
5
  </div>
6
- <div v-if="multiple" class="itf-alert-banner__panel itf-alert-banner__multiple rounded-3 border bg-muted-2"></div>
7
- <div class="itf-alert-banner__panel px-3 rounded-3 border bg-muted-2 d-flex gap-3 align-items-start align-items-sm-center flex-sm-row flex-column">
6
+ <div v-if="$listeners.close" class="itf-alert-banner__close position-absolute text-muted cursor-pointer" @click="$emit('close')">
7
+ <itf-icon new name="close-alt" :size="20" />
8
+ </div>
9
+ <div v-if="multiple" class="itf-alert-banner__panel itf-alert-banner__multiple h-100 position-absolute rounded-3 border bg-muted-2"></div>
10
+ <div class="itf-alert-banner__panel h-100 rounded-3 border bg-muted-2 d-flex gap-2 gap-md-3 align-items-start align-items-md-center">
8
11
  <slot name="icon">
9
12
  <div v-if="icon" class="itf-alert-banner__icon rounded-2 bg-danger flex-shrink-0 d-flex align-items-center justify-content-center">
10
13
  <itf-icon new :name="icon" :size="24" class="text-white" />
11
14
  </div>
12
15
  </slot>
13
- <div class="flex-grow-1">
16
+ <div class="itf-alert-banner__content flex-grow-1 d-flex flex-column">
14
17
  <div class="fw-bold"><slot name="title">{{title}}</slot></div>
15
18
  <div class="small text-muted"><slot></slot></div>
16
19
  </div>
@@ -24,33 +27,85 @@
24
27
  max-width: 420px;
25
28
 
26
29
  &__counter {
27
- top: 0;
28
- right: -4px;
30
+ top: -12px;
31
+ right: -12px;
29
32
  position: absolute;
30
- z-index: 3;
31
- padding-top: 0.375rem;
32
- padding-bottom: 0.375rem;
33
- min-width: 1.75rem;
33
+ z-index: 4;
34
+ padding-top: 3px;
35
+ padding-bottom: 3px;
36
+ min-width: 24px;
34
37
  text-align: center;
38
+ @media (max-width: 768px) {
39
+ right: 0;
40
+ }
41
+ }
42
+ &__close {
43
+ top: 8px;
44
+ right: 8px;
45
+ z-index: 3;
46
+ @media (max-width: 768px) {
47
+ top: 12px;
48
+ right: 12px;
49
+ }
35
50
  }
36
51
  &__panel {
37
52
  position: relative;
38
53
  padding-top: 0.75rem;
39
54
  padding-bottom: 0.75rem;
40
- top: 4px;
55
+ padding-left: 1rem;
56
+ padding-right: 1rem;
41
57
  z-index: 2;
58
+ @media (max-width: 768px) {
59
+ flex-direction: column;
60
+ padding-left: 0.75rem;
61
+ padding-right: 0.75rem;
62
+ }
42
63
  }
43
64
  &__icon {
44
65
  width: 48px;
45
66
  height: 48px;
67
+ @media (max-width: 768px) {
68
+ width: 32px;
69
+ height: 32px;
70
+ }
71
+
72
+ ::v-deep .itf-icon {
73
+
74
+ svg {
75
+ @media (max-width: 768px) {
76
+ width: 16px!important;
77
+ height: 16px!important;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ &__content {
83
+ @media (max-width: 768px) {
84
+ gap: 0.25rem;
85
+ }
46
86
  }
47
87
  &__multiple {
48
- position: absolute;
49
- top: 0;
88
+ top: -4px;
50
89
  right: -4px;
51
90
  z-index: 1;
52
- height: 100%;
53
91
  width: 100%;
92
+ @media (max-width: 768px) {
93
+ width: calc(100% - 8px);
94
+ right: 4px;
95
+ }
96
+ }
97
+
98
+ &.mobile-content-row {
99
+
100
+ @media (max-width: 768px) {
101
+ .itf-alert-banner__panel {
102
+ flex-direction: row;
103
+ padding-right: 2.5rem;
104
+ }
105
+ .itf-alert-banner__content {
106
+ gap: 0;
107
+ }
108
+ }
54
109
  }
55
110
  }
56
111
  </style>
@@ -71,5 +126,6 @@ class AlertBanner extends Vue {
71
126
  @Prop(String) icon;
72
127
  @Prop() count;
73
128
  @Prop(Boolean) multiple;
129
+ @Prop({ type: String, default: '' }) styleVariant;
74
130
  }
75
131
  </script>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <grid-layout
3
3
  :layout="layout"
4
+ :responsive-layouts="responsiveLayouts"
4
5
  @update:layout="onUpdateLayout"
5
6
  class="itf-bento-grid"
6
7
  :col-num="4"
@@ -56,6 +57,7 @@ export default @Component({
56
57
  })
57
58
  class itfBentoGrid extends Vue {
58
59
  @Prop() layout;
60
+ @Prop() responsiveLayouts;
59
61
  @Prop() components;
60
62
  @Prop({ type: Boolean, default: true }) enabled;
61
63
 
@@ -0,0 +1,109 @@
1
+ <template>
2
+
3
+ <div>
4
+ <div v-for="(item, n) in items" :key="n">
5
+ <slot name="item" :item="item" :isChecked="isChecked(item)" :onToggle="(isChecked) => onToggleOption(item, isChecked)" :isDisabled="disabled || isDisabled(item)">
6
+ <itf-checkbox
7
+ :value="isChecked(item)"
8
+ :label="item.name"
9
+ :disabled="disabled || isDisabled(item)"
10
+ @input="onToggleOption(item, $event)"
11
+ >
12
+ {{ item[itemKey] || item }}
13
+ </itf-checkbox>
14
+ </slot>
15
+
16
+ <div v-if="item[childrenKey] && item[childrenKey].length" class="ps-4 mb-2">
17
+ <itf-nested-checkbox-group
18
+ :value="value"
19
+ @input="$emit('input', $event)"
20
+ :items="item[childrenKey]"
21
+ :disabled="disabled || isDisabled(item)"
22
+ :item-key="itemKey"
23
+ :children-key="childrenKey"
24
+ :max="max"
25
+ :disabled-ids="disabledIds"
26
+ >
27
+ <template v-for="(_, name) in $slots" #[name]="slotData">
28
+ <slot :name="name" v-bind="slotData || {}"/>
29
+ </template>
30
+ <template v-for="(_, name) in $scopedSlots" #[name]="slotData">
31
+ <slot :name="name" v-bind="slotData || {}"/>
32
+ </template>
33
+ </itf-nested-checkbox-group>
34
+ </div>
35
+ </div>
36
+
37
+ <slot />
38
+ </div>
39
+
40
+ </template>
41
+ <script>
42
+ import { Vue, Component, Prop, Model } from 'vue-property-decorator';
43
+ import itfCheckbox from './Checkbox';
44
+ import itfTableRows from '@itfin/components/src/components/table/TableRows.vue';
45
+
46
+ export default @Component({
47
+ name: 'itfNestedCheckboxGroup',
48
+ components: {
49
+ itfTableRows,
50
+ itfCheckbox
51
+ },
52
+ })
53
+ class itfNestedCheckboxGroup extends Vue {
54
+ @Model('input', { type: Array, default: () => [] }) value;
55
+
56
+ @Prop(Array) items;
57
+ @Prop(Boolean) disabled;
58
+ @Prop({ type: Array, default: () => [] }) disabledIds;
59
+
60
+ @Prop({ type: String }) itemKey;
61
+ @Prop({ type: String, default: 'children' }) childrenKey;
62
+
63
+ @Prop(Number) max;
64
+
65
+ onToggleOption(value, isChecked) {
66
+ const arr = this.value ? [ ...this.value ] : [];
67
+ if (value[this.childrenKey] && value[this.childrenKey].length) {
68
+ for (const child of value[this.childrenKey]) {
69
+ const index = arr.findIndex(item => this.itemKey ? item[this.itemKey] === child[this.itemKey] : item === child);
70
+ if (index !== -1 && isChecked === false) {
71
+ arr.splice(index, 1);
72
+ } else if (isChecked === true) {
73
+ arr.push(child);
74
+ }
75
+ }
76
+ this.$emit('input', arr);
77
+ return;
78
+ }
79
+ const index = this.getCheckedIndex(value);
80
+ if (index !== -1 && isChecked === false) {
81
+ arr.splice(index, 1);
82
+ } else if (isChecked === true) {
83
+ arr.push(value);
84
+ }
85
+ this.$emit('input', arr);
86
+ }
87
+
88
+ getCheckedIndex(value) {
89
+ if (this.itemKey) {
90
+ return this.value && this.value.findIndex(item => item[this.itemKey] === value[this.itemKey]);
91
+ }
92
+ return this.value.indexOf(value);
93
+ }
94
+
95
+ isChecked(value) {
96
+ if (value[this.childrenKey] && value[this.childrenKey].length) {
97
+ return value[this.childrenKey].every(child => this.isChecked(child)) || this.getCheckedIndex(value) !== -1;
98
+ }
99
+ return this.getCheckedIndex(value) !== -1;
100
+ }
101
+
102
+ isDisabled(value) {
103
+ if (this.disabledIds.includes(value)) {
104
+ return true;
105
+ }
106
+ return this.getCheckedIndex(value) === -1 && (this.max !== 'undefined' && this.value.length >= this.max);
107
+ }
108
+ }
109
+ </script>