@itfin/components 1.3.100 → 1.4.0
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 +1 -1
- package/src/components/button/Button.vue +4 -2
- package/src/components/card/BentoCard.vue +70 -19
- package/src/components/card/BentoGrid.vue +21 -8
- package/src/components/filter/FilterAmountRange.vue +50 -42
- package/src/components/filter/FilterBadge.vue +27 -22
- package/src/components/filter/FilterFacetsList.vue +21 -17
- package/src/components/filter/FilterPanel.vue +141 -44
- package/src/components/filter/index.stories.js +0 -2
- package/src/components/form/Label.vue +19 -2
- package/src/components/icon/Icon.vue +4 -2
- package/src/components/icon/components/fi_fingerprint.vue +4 -0
- package/src/components/icon/components/nomi-ai.vue +6 -0
- package/src/components/icon/components/nomi-arrow-down.vue +4 -0
- package/src/components/icon/components/nomi-arrow-right-top.vue +4 -0
- package/src/components/icon/components/nomi-arrow-up.vue +4 -0
- package/src/components/icon/components/nomi-arrow_down.vue +4 -0
- package/src/components/icon/components/nomi-arrow_up.vue +4 -0
- package/src/components/icon/components/nomi-arrows.vue +7 -0
- package/src/components/icon/components/nomi-calendar-alt.vue +4 -0
- package/src/components/icon/components/nomi-calendar-alt2.vue +4 -0
- package/src/components/icon/components/nomi-calendar.vue +11 -0
- package/src/components/icon/components/nomi-card.vue +4 -0
- package/src/components/icon/components/nomi-clear.vue +4 -0
- package/src/components/icon/components/nomi-close.vue +5 -0
- package/src/components/icon/components/nomi-counterparty.vue +4 -0
- package/src/components/icon/components/nomi-dashboard.vue +4 -0
- package/src/components/icon/components/nomi-expand.vue +7 -0
- package/src/components/icon/components/nomi-eye-close.vue +4 -0
- package/src/components/icon/components/nomi-eye-open.vue +4 -0
- package/src/components/icon/components/nomi-eye.vue +4 -0
- package/src/components/icon/components/nomi-filter.vue +4 -0
- package/src/components/icon/components/nomi-help.vue +5 -0
- package/src/components/icon/components/nomi-hide.vue +4 -0
- package/src/components/icon/components/nomi-logout.vue +5 -0
- package/src/components/icon/components/nomi-money.vue +4 -0
- package/src/components/icon/components/nomi-move-left.vue +4 -0
- package/src/components/icon/components/nomi-move-right.vue +4 -0
- package/src/components/icon/components/nomi-pen.vue +5 -0
- package/src/components/icon/components/nomi-person.vue +5 -0
- package/src/components/icon/components/nomi-pin.vue +7 -0
- package/src/components/icon/components/nomi-project.vue +4 -0
- package/src/components/icon/components/nomi-recurrence.vue +2 -0
- package/src/components/icon/components/nomi-repeat.vue +7 -0
- package/src/components/icon/components/nomi-report.vue +4 -0
- package/src/components/icon/components/nomi-scissors.vue +4 -0
- package/src/components/icon/components/nomi-settings.vue +4 -0
- package/src/components/icon/components/nomi-sort-asc.vue +7 -0
- package/src/components/icon/components/nomi-sort-desc.vue +7 -0
- package/src/components/icon/components/nomi-table-view.vue +4 -0
- package/src/components/icon/components/nomi-tag.vue +4 -0
- package/src/components/icon/components/nomi-target.vue +4 -0
- package/src/components/icon/components/nomi-text.vue +6 -0
- package/src/components/icon/components/nomi-transactions.vue +8 -0
- package/src/components/icon/components/nomi-trash.vue +4 -0
- package/src/components/icon/components/nomi-unpin.vue +7 -0
- package/src/components/icon/components/nomi-user.vue +5 -0
- package/src/components/icon/convert-icons.js +11 -0
- package/src/components/icon/icons.js +332 -286
- package/src/components/icon/new-icons/ai.svg +5 -0
- package/src/components/icon/new-icons/arrow-down.svg +3 -0
- package/src/components/icon/new-icons/arrow-right-top.svg +3 -0
- package/src/components/icon/new-icons/arrow-up.svg +3 -0
- package/src/components/icon/new-icons/arrow_down.svg +3 -0
- package/src/components/icon/new-icons/arrow_up.svg +3 -0
- package/src/components/icon/new-icons/arrows.svg +6 -0
- package/src/components/icon/new-icons/calendar-alt.svg +3 -0
- package/src/components/icon/new-icons/calendar-alt2.svg +3 -0
- package/src/components/icon/new-icons/calendar.svg +10 -0
- package/src/components/icon/new-icons/card.svg +3 -0
- package/src/components/icon/new-icons/clear.svg +3 -0
- package/src/components/icon/new-icons/close.svg +4 -0
- package/src/components/icon/new-icons/counterparty.svg +3 -0
- package/src/components/icon/new-icons/dashboard.svg +3 -0
- package/src/components/icon/new-icons/expand.svg +6 -0
- package/src/components/icon/new-icons/eye-close.svg +3 -0
- package/src/components/icon/new-icons/eye-open.svg +3 -0
- package/src/components/icon/new-icons/eye.svg +3 -0
- package/src/components/icon/new-icons/filter.svg +3 -0
- package/src/components/icon/new-icons/help.svg +4 -0
- package/src/components/icon/new-icons/hide.svg +3 -0
- package/src/components/icon/new-icons/logout.svg +4 -0
- package/src/components/icon/new-icons/money.svg +3 -0
- package/src/components/icon/new-icons/move-left.svg +3 -0
- package/src/components/icon/new-icons/move-right.svg +3 -0
- package/src/components/icon/new-icons/pen.svg +4 -0
- package/src/components/icon/new-icons/person.svg +4 -0
- package/src/components/icon/new-icons/pin.svg +6 -0
- package/src/components/icon/new-icons/project.svg +3 -0
- package/src/components/icon/new-icons/recurrence.svg +1 -0
- package/src/components/icon/new-icons/repeat.svg +6 -0
- package/src/components/icon/new-icons/report.svg +3 -0
- package/src/components/icon/new-icons/scissors.svg +3 -0
- package/src/components/icon/new-icons/settings.svg +3 -0
- package/src/components/icon/new-icons/sort-asc.svg +6 -0
- package/src/components/icon/new-icons/sort-desc.svg +6 -0
- package/src/components/icon/new-icons/table-view.svg +3 -0
- package/src/components/icon/new-icons/tag.svg +3 -0
- package/src/components/icon/new-icons/target.svg +3 -0
- package/src/components/icon/new-icons/text.svg +5 -0
- package/src/components/icon/new-icons/transactions.svg +7 -0
- package/src/components/icon/new-icons/trash.svg +3 -0
- package/src/components/icon/new-icons/unpin.svg +6 -0
- package/src/components/icon/new-icons/user.svg +4 -0
- package/src/components/modal/DeleteConfirmModal.vue +0 -2
- package/src/components/modal/ItemEditor.vue +1 -5
- package/src/components/pagination/Pagination.vue +3 -2
- package/src/components/pagination/Pagination2.vue +179 -0
- package/src/components/panels/Panel.vue +23 -7
- package/src/components/panels/PanelItemEdit.vue +62 -0
- package/src/components/panels/PanelLink.vue +26 -6
- package/src/components/panels/PanelList.vue +27 -26
- package/src/components/panels/helpers.spec.ts +27 -0
- package/src/components/panels/helpers.ts +37 -0
- package/src/components/popover/NoticePopout.vue +1 -1
- package/src/components/select/Select.vue +1 -1
- package/src/components/sortable/draggable.js +2 -1
- package/src/components/table/Table2.vue +35 -8
- package/src/components/table/TableBody.vue +10 -18
- package/src/components/table/TableGroup.vue +29 -13
- package/src/components/table/TableHeader.vue +120 -69
- package/src/components/table/TableRowToggle.vue +51 -0
- package/src/components/table/TableRows.vue +20 -29
- package/src/components/table/index.stories.js +22 -200
- package/src/components/table/table2.scss +237 -68
- package/src/components/text-field/MoneyField.vue +23 -21
- package/src/components/text-field/TextField.vue +12 -8
- package/src/components/tree/TreeEditor.vue +615 -0
- package/src/components/view/View.vue +244 -0
- package/src/components/view/index.stories.js +588 -0
- package/src/helpers/formatters.js +14 -1
- package/src/helpers/tree/cdbl.js +32 -0
- package/src/helpers/tree/cint.js +43 -0
- package/src/helpers/tree/domDrag.js +911 -0
- package/src/helpers/tree/domFinds.js +20 -0
- package/src/helpers/tree/domGetPointFromEvent.js +53 -0
- package/src/helpers/tree/domIsClientXYIn.js +65 -0
- package/src/helpers/tree/domRemove.js +50 -0
- package/src/helpers/tree/evem.js +27 -0
- package/src/helpers/tree/genID.js +56 -0
- package/src/helpers/tree/isEle.js +28 -0
- package/src/helpers/tree/isestr.js +35 -0
- package/src/helpers/tree/isint.js +40 -0
- package/src/helpers/tree/isnbr.js +24 -0
- package/src/helpers/tree/isnum.js +38 -0
- package/src/helpers/tree/ispint.js +41 -0
- package/src/helpers/tree/isstr.js +27 -0
- package/src/helpers/tree.js +30 -0
- package/src/helpers/vuetifyColor.js +136 -0
- package/src/locales/en.js +17 -0
- package/src/locales/uk.js +17 -0
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ export default @Component({
|
|
|
10
10
|
class itfButton extends Vue {
|
|
11
11
|
@Prop(Boolean) labeled;
|
|
12
12
|
@Prop(Boolean) primary;
|
|
13
|
+
@Prop(Boolean) default;
|
|
13
14
|
@Prop(Boolean) secondary;
|
|
14
15
|
@Prop(Boolean) loading;
|
|
15
16
|
@Prop(Boolean) small;
|
|
@@ -27,7 +28,7 @@ class itfButton extends Vue {
|
|
|
27
28
|
|
|
28
29
|
render (createElement, { data, slots, children, props }) {
|
|
29
30
|
const {
|
|
30
|
-
to, href, target, disabled, color, block, loading, labeled, secondary, primary, small, large, icon, loadingText, squircle,
|
|
31
|
+
to, href, target, disabled, color, block, loading, labeled, secondary, primary, small, large, icon, loadingText, squircle, default: defaultStyle,
|
|
31
32
|
class: classNames
|
|
32
33
|
} = props;
|
|
33
34
|
const component = to ? 'nuxt-link' : (props.href ? 'a' : 'button');
|
|
@@ -44,7 +45,8 @@ class itfButton extends Vue {
|
|
|
44
45
|
'labeled': labeled,
|
|
45
46
|
'disabled': disabled || loading,
|
|
46
47
|
'btn-primary': primary,
|
|
47
|
-
'btn-
|
|
48
|
+
'btn-default': defaultStyle,
|
|
49
|
+
'btn-basic': !primary && !secondary && !color && !defaultStyle,
|
|
48
50
|
'btn-secondary': secondary,
|
|
49
51
|
'btn-squircle': squircle,
|
|
50
52
|
'btn-sm': small,
|
|
@@ -1,33 +1,74 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="itf-bento-card-wrapper
|
|
2
|
+
<div class="itf-bento-card-wrapper rounded bg-white" :class="{ enabled }">
|
|
3
|
+
<div class="itf-bento-card__drag">
|
|
4
|
+
<svg width="35" height="23" viewBox="0 0 35 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<g filter="url(#filter0_d_1320_32101)">
|
|
6
|
+
<rect x="4" y="2" width="27" height="15" rx="4" fill="#22222B"/>
|
|
7
|
+
<circle cx="23.5" cy="9.5" r="1.5" fill="white"/>
|
|
8
|
+
<circle cx="17.5" cy="9.5" r="1.5" fill="white"/>
|
|
9
|
+
<circle cx="11.5" cy="9.5" r="1.5" fill="white"/>
|
|
10
|
+
</g>
|
|
11
|
+
<defs>
|
|
12
|
+
<filter id="filter0_d_1320_32101" x="0" y="0" width="35" height="23" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
13
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
14
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
15
|
+
<feOffset dy="2"/>
|
|
16
|
+
<feGaussianBlur stdDeviation="2"/>
|
|
17
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
18
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
|
19
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1320_32101"/>
|
|
20
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1320_32101" result="shape"/>
|
|
21
|
+
</filter>
|
|
22
|
+
</defs>
|
|
23
|
+
</svg>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
3
26
|
<slot/>
|
|
4
27
|
|
|
5
|
-
<div class="settings shadow
|
|
6
|
-
<button @click="$emit('resize', [
|
|
7
|
-
<svg width="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<svg width="18" height="18" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 9H3C2.50669 9 2.23688 9.00108 2.04183 9.01439C2.03276 9.01501 2.02424 9.01564 2.01626 9.01626C2.01564 9.02424 2.01501 9.03276 2.01439 9.04183C2.00108 9.23688 2 9.50669 2 10C2 10.4933 2.00108 10.7631 2.01439 10.9582C2.01501 10.9672 2.01564 10.9758 2.01626 10.9837C2.02424 10.9844 2.03276 10.985 2.04183 10.9856C2.23688 10.9989 2.50669 11 3 11H17C17.4933 11 17.7631 10.9989 17.9582 10.9856C17.9672 10.985 17.9758 10.9844 17.9837 10.9837C17.9844 10.9758 17.985 10.9672 17.9856 10.9582C17.9989 10.7631 18 10.4933 18 10C18 9.50669 17.9989 9.23688 17.9856 9.04183C17.985 9.03276 17.9844 9.02424 17.9837 9.01626C17.9758 9.01564 17.9672 9.01501 17.9582 9.01439C17.7631 9.00108 17.4933 9 17 9ZM0.152241 8.23463C0 8.60218 0 9.06812 0 10C0 10.9319 0 11.3978 0.152241 11.7654C0.355229 12.2554 0.744577 12.6448 1.23463 12.8478C1.60218 13 2.06812 13 3 13H17C17.9319 13 18.3978 13 18.7654 12.8478C19.2554 12.6448 19.6448 12.2554 19.8478 11.7654C20 11.3978 20 10.9319 20 10C20 9.06812 20 8.60218 19.8478 8.23463C19.6448 7.74458 19.2554 7.35523 18.7654 7.15224C18.3978 7 17.9319 7 17 7H3C2.06812 7 1.60218 7 1.23463 7.15224C0.744577 7.35523 0.355229 7.74458 0.152241 8.23463Z" fill="currentColor"></path></svg>
|
|
28
|
+
<div class="settings shadow bg-black gap-2 align-items-center">
|
|
29
|
+
<button @click="$emit('resize', [1, 1])" class="rounded-1" :class="{'active': w === 1 && h === 1}">
|
|
30
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
31
|
+
<path d="M14 16L10 16C8.89543 16 8 15.1046 8 14L8 10C8 8.89543 8.89543 8 10 8L14 8C15.1046 8 16 8.89543 16 10L16 14C16 15.1046 15.1046 16 14 16Z" stroke="white" stroke-width="1.2"/>
|
|
32
|
+
</svg>
|
|
11
33
|
</button>
|
|
12
|
-
<button @click="$emit('resize', [
|
|
13
|
-
<svg width="
|
|
34
|
+
<button @click="$emit('resize', [2, 2])" class="rounded-1" :class="{'active': w === 2 && h === 2}">
|
|
35
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
36
|
+
<path d="M17 16L7 16C5.89543 16 5 15.1046 5 14L5 10C5 8.89543 5.89543 8 7 8L17 8C18.1046 8 19 8.89543 19 10L19 14C19 15.1046 18.1046 16 17 16Z" stroke="white" stroke-width="1.2"/>
|
|
37
|
+
</svg>
|
|
14
38
|
</button>
|
|
15
|
-
<button @click="$emit('resize', [
|
|
16
|
-
<svg width="
|
|
39
|
+
<button @click="$emit('resize', [4, 4])" class="rounded-1" :class="{'active': w === 4 && h === 4}">
|
|
40
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
<path d="M17 19L7 19C5.89543 19 5 18.1046 5 17L5 7C5 5.89543 5.89543 5 7 5L17 5C18.1046 5 19 5.89543 19 7L19 17C19 18.1046 18.1046 19 17 19Z" stroke="white" stroke-width="1.2"/>
|
|
42
|
+
</svg>
|
|
17
43
|
</button>
|
|
18
44
|
</div>
|
|
19
45
|
</div>
|
|
20
46
|
</template>
|
|
21
47
|
<style scoped lang="scss">
|
|
48
|
+
.itf-bento-card {
|
|
49
|
+
&__drag {
|
|
50
|
+
transition: opacity .3s;
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: -12px;
|
|
53
|
+
left: 50%;
|
|
54
|
+
transform: translateX(-50%);
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
22
58
|
.itf-bento-card-wrapper {
|
|
23
59
|
position: absolute;
|
|
24
60
|
top: 0;
|
|
25
61
|
bottom: 0;
|
|
26
62
|
left: 0;
|
|
27
63
|
right: 0;
|
|
64
|
+
border: 1px solid #E7E8EC;
|
|
28
65
|
|
|
29
|
-
|
|
30
|
-
|
|
66
|
+
&.enabled:hover {
|
|
67
|
+
border-color: #0B1315;
|
|
68
|
+
|
|
69
|
+
.settings, .itf-bento-card__drag {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
31
72
|
}
|
|
32
73
|
.vue-draggable-dragging &:hover .settings {
|
|
33
74
|
opacity: 0;
|
|
@@ -35,17 +76,27 @@
|
|
|
35
76
|
|
|
36
77
|
.settings {
|
|
37
78
|
transition: opacity .3s;
|
|
38
|
-
transition-delay: .3s;
|
|
39
79
|
opacity: 0;
|
|
40
80
|
display: flex;
|
|
41
81
|
position: absolute;
|
|
42
|
-
bottom: -
|
|
82
|
+
bottom: -5px;
|
|
43
83
|
left: 50%;
|
|
44
|
-
padding: .375rem;
|
|
45
84
|
transform: translateX(-50%);
|
|
46
85
|
z-index: 100;
|
|
86
|
+
width: 24px;
|
|
87
|
+
height: 9px;
|
|
88
|
+
border-radius: .5rem;
|
|
47
89
|
|
|
90
|
+
&:hover {
|
|
91
|
+
width: auto;
|
|
92
|
+
height: auto;
|
|
93
|
+
padding: .175rem;
|
|
94
|
+
button {
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
48
98
|
button {
|
|
99
|
+
display: none;
|
|
49
100
|
color: #fff;
|
|
50
101
|
padding: 0;
|
|
51
102
|
width: 25px;
|
|
@@ -54,11 +105,10 @@
|
|
|
54
105
|
background: transparent;
|
|
55
106
|
justify-content: center;
|
|
56
107
|
align-items: center;
|
|
57
|
-
display: flex;
|
|
58
108
|
|
|
59
109
|
&.active {
|
|
60
|
-
background:
|
|
61
|
-
color: #
|
|
110
|
+
background-color: #494A55;
|
|
111
|
+
color: #FFF;
|
|
62
112
|
}
|
|
63
113
|
}
|
|
64
114
|
}
|
|
@@ -75,5 +125,6 @@ export default @Component({
|
|
|
75
125
|
class itfBentoCard extends Vue {
|
|
76
126
|
@Prop() w;
|
|
77
127
|
@Prop() h;
|
|
128
|
+
@Prop() enabled;
|
|
78
129
|
}
|
|
79
130
|
</script>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<grid-layout
|
|
3
3
|
:layout="layout"
|
|
4
|
-
@update:layout="
|
|
4
|
+
@update:layout="onUpdateLayout"
|
|
5
5
|
class="itf-bento-grid"
|
|
6
|
-
:col-num="
|
|
7
|
-
:
|
|
6
|
+
:col-num="4"
|
|
7
|
+
:row-height="200"
|
|
8
|
+
:cols="{ lg: 4, md: 4, sm: 2, xs: 2, xxs: 2 }"
|
|
8
9
|
:preserve-aspect-ratio="true"
|
|
9
10
|
:responsive="true"
|
|
10
|
-
:is-draggable="
|
|
11
|
+
:is-draggable="enabled"
|
|
11
12
|
:is-resizable="false"
|
|
12
13
|
:is-mirrored="false"
|
|
13
14
|
:is-bounded="true"
|
|
@@ -15,14 +16,15 @@
|
|
|
15
16
|
:margin="[10, 10]"
|
|
16
17
|
:use-css-transforms="true">
|
|
17
18
|
<grid-item v-for="item in layout"
|
|
19
|
+
drag-allow-from=".itf-bento-card__drag"
|
|
18
20
|
:x="item.x"
|
|
19
21
|
:y="item.y"
|
|
20
22
|
:w="item.w"
|
|
21
23
|
:h="item.h"
|
|
22
24
|
:i="item.i"
|
|
23
25
|
:key="item.i">
|
|
24
|
-
<bento-card @resize="(e) => onResize(item, e)" :w="item.w" :h="item.h">
|
|
25
|
-
<slot name="cell" :item="item" :index="item.i"></slot>
|
|
26
|
+
<bento-card :enabled="enabled" @resize="(e) => onResize(item, e)" :w="item.w" :h="item.h">
|
|
27
|
+
<slot name="cell" :item="item" :index="item.i" :component="getComponent(item.i)"></slot>
|
|
26
28
|
</bento-card>
|
|
27
29
|
</grid-item>
|
|
28
30
|
</grid-layout>
|
|
@@ -32,8 +34,9 @@
|
|
|
32
34
|
margin: -10px;
|
|
33
35
|
|
|
34
36
|
.vue-grid-item.vue-grid-placeholder {
|
|
35
|
-
background:
|
|
36
|
-
border:
|
|
37
|
+
background-color: #F5F7F9;
|
|
38
|
+
border: 1px solid #F5F7F9;
|
|
39
|
+
opacity: 1 !important;
|
|
37
40
|
border-radius: 10px;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -53,6 +56,8 @@ export default @Component({
|
|
|
53
56
|
})
|
|
54
57
|
class itfBentoGrid extends Vue {
|
|
55
58
|
@Prop() layout;
|
|
59
|
+
@Prop() components;
|
|
60
|
+
@Prop({ type: Boolean, default: true }) enabled;
|
|
56
61
|
|
|
57
62
|
onResize(item, [w, h]) {
|
|
58
63
|
const newLayout = this.layout.map((i) => {
|
|
@@ -64,5 +69,13 @@ class itfBentoGrid extends Vue {
|
|
|
64
69
|
});
|
|
65
70
|
this.$emit('update:layout', newLayout);
|
|
66
71
|
}
|
|
72
|
+
|
|
73
|
+
getComponent(id) {
|
|
74
|
+
return this.components[id] ?? null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
onUpdateLayout(layout) {
|
|
78
|
+
this.$emit('update:layout', layout);
|
|
79
|
+
}
|
|
67
80
|
}
|
|
68
81
|
</script>
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="py-
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
:value="value"
|
|
11
|
-
:width="260"
|
|
12
|
-
@input="onChange"
|
|
13
|
-
:min="min"
|
|
14
|
-
:max="max"
|
|
15
|
-
:stop-propagation="false"
|
|
16
|
-
:use-keyboard="false"
|
|
17
|
-
:tooltip="false"
|
|
18
|
-
:tooltip-merge="false"
|
|
2
|
+
<div class="py-1 px-1 small text-muted">
|
|
3
|
+
<itf-label :label="$t('components.filter.filterBy')" hide-details class="w-100">
|
|
4
|
+
<itf-select
|
|
5
|
+
v-model="filterType"
|
|
6
|
+
:options="filterTypes"
|
|
7
|
+
:get-option-label="option => option.text"
|
|
8
|
+
:reduce="option => option.value"
|
|
9
|
+
@input="onChangeType"
|
|
19
10
|
/>
|
|
11
|
+
</itf-label>
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
<itf-label v-if="filterType === 'exact'" :label="$t('components.filter.value')" hide-details class="mb-0 w-100">
|
|
14
|
+
<itf-text-field type="number" :value="internalValue" @input="onChange($event)" />
|
|
15
|
+
</itf-label>
|
|
16
|
+
<div v-else-if="internalValue" class="d-flex justify-content-between gap-2">
|
|
17
|
+
<itf-label :label="$t('components.filter.from')" hide-details class="mb-0 w-100">
|
|
18
|
+
<itf-text-field type="number" :value="internalValue[0]" @input="onChange([$event, internalValue[1]])" />
|
|
19
|
+
</itf-label>
|
|
20
|
+
<itf-label :label="$t('components.filter.to')" hide-details class="mb-0 w-100">
|
|
21
|
+
<itf-text-field type="number" :value="internalValue[1]" @input="onChange([internalValue[0], $event])" />
|
|
22
|
+
</itf-label>
|
|
25
23
|
</div>
|
|
26
24
|
</div>
|
|
27
25
|
</template>
|
|
@@ -42,13 +40,18 @@
|
|
|
42
40
|
</style>
|
|
43
41
|
<script>
|
|
44
42
|
import { Vue, Prop, Model, Component } from 'vue-property-decorator';
|
|
43
|
+
import itfLabel from '../form/Label.vue';
|
|
44
|
+
import itfSelect from '../select/Select.vue';
|
|
45
45
|
import itfTextField from '../text-field/TextField.vue';
|
|
46
46
|
import itfRange from '../range/Range.vue';
|
|
47
|
+
import debounce from 'lodash/debounce';
|
|
47
48
|
|
|
48
49
|
export default @Component({
|
|
49
50
|
name: 'FilterAmountRange',
|
|
50
51
|
components: {
|
|
52
|
+
itfSelect,
|
|
51
53
|
itfTextField,
|
|
54
|
+
itfLabel,
|
|
52
55
|
itfRange
|
|
53
56
|
}
|
|
54
57
|
})
|
|
@@ -58,36 +61,41 @@ class FilterAmountRange extends Vue {
|
|
|
58
61
|
@Prop() max;
|
|
59
62
|
@Prop() histogram;
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
internalValue =
|
|
63
|
-
|
|
64
|
-
mounted() {
|
|
65
|
-
this.internalValue = this.value;
|
|
66
|
-
}
|
|
64
|
+
filterType = false;
|
|
65
|
+
internalValue = 'exact';
|
|
66
|
+
onChangeFn = null;
|
|
67
67
|
|
|
68
|
-
get
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
get filterTypes() {
|
|
69
|
+
return [
|
|
70
|
+
{ text: this.$t('components.filter.exact'), value: 'exact' },
|
|
71
|
+
{ text: this.$t('components.filter.range'), value: 'range' }
|
|
72
|
+
];
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
mounted() {
|
|
76
|
+
this.internalValue = this.value;
|
|
77
|
+
this.filterType = Array.isArray(this.internalValue) ? 'range' : 'exact';
|
|
78
|
+
this.onChangeFn = debounce(() => {
|
|
79
|
+
this.$emit('input', this.internalValue);
|
|
80
|
+
}, 500);
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
onChange(val
|
|
82
|
-
this.isRefreshed = false;
|
|
83
|
+
onChange(val) {
|
|
83
84
|
this.internalValue = val;
|
|
84
|
-
if (
|
|
85
|
-
this.
|
|
85
|
+
if (!Number.isNaN(parseFloat(val))) {
|
|
86
|
+
this.onChangeFn()
|
|
87
|
+
}
|
|
88
|
+
if (!val) {
|
|
89
|
+
this.onChangeFn();
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
onChangeType(type) {
|
|
94
|
+
if (type === 'range') {
|
|
95
|
+
this.internalValue = [parseFloat(this.internalValue), parseFloat(this.internalValue)];
|
|
96
|
+
} else {
|
|
97
|
+
this.internalValue = Array.isArray(this.internalValue) ? parseFloat(this.internalValue[0]) : parseFloat(this.internalValue);
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
101
|
</script>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<itf-dropdown text ref="dropdown" autoclose="outside">
|
|
2
|
+
<itf-dropdown text ref="dropdown" autoclose="outside" shadow class="h-100">
|
|
3
3
|
<template #button>
|
|
4
|
-
<div class="filter-pill" :class="{'filter-not-default-pill': !isDefault && !isInvalid, 'filter-invalid-pill': isInvalid}">
|
|
4
|
+
<div class="filter-pill rounded" :class="{'filter-not-default-pill': !isDefault && !isInvalid, 'filter-invalid-pill': isInvalid}">
|
|
5
5
|
<div class="filter-pill__label" :class="{'filter-pill__not-default-value': !isDefault && !isInvalid, 'filter-pill__default-value': isDefault, 'filter-pill__label-invalid': isInvalid}">
|
|
6
|
-
<itf-icon v-if="icon" :size="
|
|
6
|
+
<itf-icon v-if="icon" :size="20" new :name="icon" class="icon" />
|
|
7
7
|
{{ text }}
|
|
8
8
|
</div>
|
|
9
9
|
<div @click.stop.prevent="resetValue" v-if="!isDefault" class="filter-pill__icon" :class="{'filter-pill__icon-not-default-value': !isDefault && !isInvalid, 'filter-pill__icon-invalid': isInvalid}">
|
|
10
|
-
<
|
|
10
|
+
<itf-icon new name="close" />
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
@@ -24,17 +24,19 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
<template v-else-if="type === 'period'">
|
|
26
26
|
<itf-date-range-picker-inline
|
|
27
|
+
style="margin: -.5rem"
|
|
27
28
|
:value="value.value"
|
|
28
29
|
@input="onFilterChange({ value: $event })"
|
|
29
30
|
/>
|
|
30
31
|
</template>
|
|
31
32
|
<template v-else-if="type === 'date'">
|
|
32
33
|
<itf-date-picker-inline
|
|
34
|
+
style="margin: -.5rem"
|
|
33
35
|
:value="value.value"
|
|
34
36
|
@input="onFilterChange({ value: $event })"
|
|
35
37
|
/>
|
|
36
38
|
</template>
|
|
37
|
-
<div
|
|
39
|
+
<div v-else-if="type === 'facets-list'" style="width: 300px;">
|
|
38
40
|
<filter-facets-list
|
|
39
41
|
:title="options.title"
|
|
40
42
|
:value="value.value"
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
@input="onFilterChange({ value: $event })"
|
|
45
47
|
/>
|
|
46
48
|
</div>
|
|
47
|
-
<div
|
|
49
|
+
<div v-else-if="type === 'amount'" style="width: 300px;">
|
|
48
50
|
<filter-amount-range
|
|
49
51
|
:value="value.value"
|
|
50
52
|
:histogram="options.histogram"
|
|
@@ -59,29 +61,33 @@
|
|
|
59
61
|
<style lang="scss">
|
|
60
62
|
:root {
|
|
61
63
|
--filter-badge__default-color: #475266;
|
|
62
|
-
--filter-badge__default-
|
|
63
|
-
--filter-badge__default-bg-color
|
|
64
|
+
--filter-badge__default-border-color: #0000001A;
|
|
65
|
+
--filter-badge__default-bg-color: transparent;
|
|
66
|
+
--filter-badge__default-bg-color-hover: #1A4A970D;
|
|
64
67
|
|
|
65
68
|
--filter-badge__invalid-color: #D83C31;
|
|
66
69
|
--filter-badge__invalid-bg-color: #D83C311A;
|
|
67
70
|
--filter-badge__invalid-bg-color-hover: #D83C3142;
|
|
68
71
|
|
|
69
|
-
--filter-badge__selected-color: #
|
|
70
|
-
--filter-badge__selected-bg-color: #
|
|
71
|
-
--filter-badge__selected-bg-color-hover:
|
|
72
|
-
--filter-badge__padding-
|
|
73
|
-
--filter-badge__padding-
|
|
72
|
+
--filter-badge__selected-color: #1A4A97; // #0d935b;
|
|
73
|
+
--filter-badge__selected-bg-color: #1A4A970D; // #0d935b1A;
|
|
74
|
+
--filter-badge__selected-bg-color-hover: rgba(26, 74, 151, 0.1); // #0d935b42;
|
|
75
|
+
--filter-badge__padding-y: .5rem;
|
|
76
|
+
--filter-badge__padding-x: .75rem;
|
|
74
77
|
}
|
|
75
78
|
.filter-pill {
|
|
76
79
|
align-items: center;
|
|
77
|
-
border-radius: 21px;
|
|
78
80
|
font-size: 14px;
|
|
79
81
|
line-height: 100%;
|
|
82
|
+
outline: 1px solid var(--filter-badge__default-border-color);
|
|
80
83
|
background-color: var(--filter-badge__default-bg-color);
|
|
81
84
|
display: flex;
|
|
82
85
|
min-height: 2rem;
|
|
83
86
|
transition: 0.1s;
|
|
84
87
|
|
|
88
|
+
.icon {
|
|
89
|
+
margin: -2px;
|
|
90
|
+
}
|
|
85
91
|
&:hover {
|
|
86
92
|
background-color: var(--filter-badge__default-bg-color-hover);
|
|
87
93
|
cursor: pointer;
|
|
@@ -94,12 +100,12 @@
|
|
|
94
100
|
background-color: var(--filter-badge__invalid-bg-color);
|
|
95
101
|
}
|
|
96
102
|
&.filter-pill__default-value {
|
|
97
|
-
padding: var(--filter-badge__padding-
|
|
103
|
+
padding: var(--filter-badge__padding-y) var(--filter-badge__padding-x);
|
|
98
104
|
}
|
|
99
105
|
}
|
|
100
106
|
.filter-pill__label {
|
|
101
107
|
color: var(--filter-badge__default-color);
|
|
102
|
-
padding: var(--filter-badge__padding-
|
|
108
|
+
padding: var(--filter-badge__padding-y) 0 var(--filter-badge__padding-y) var(--filter-badge__padding-x);
|
|
103
109
|
max-width: 330px;
|
|
104
110
|
text-overflow: ellipsis;
|
|
105
111
|
white-space: nowrap;
|
|
@@ -109,7 +115,7 @@
|
|
|
109
115
|
align-items: center;
|
|
110
116
|
|
|
111
117
|
&.filter-pill__default-value {
|
|
112
|
-
padding: var(--filter-badge__padding-
|
|
118
|
+
padding: var(--filter-badge__padding-y) var(--filter-badge__padding-x);
|
|
113
119
|
}
|
|
114
120
|
&.filter-pill__not-default-value {
|
|
115
121
|
color: var(--filter-badge__selected-color);
|
|
@@ -120,17 +126,16 @@
|
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
.filter-pill__icon {
|
|
123
|
-
padding:
|
|
124
|
-
margin-top: -2px;
|
|
129
|
+
padding: 0 calc(var(--filter-badge__padding-x) / 2) 0 calc(var(--filter-badge__padding-x) / 4);
|
|
125
130
|
|
|
126
131
|
svg {
|
|
127
|
-
|
|
132
|
+
color: var(--filter-badge__default-color);
|
|
128
133
|
}
|
|
129
134
|
&.filter-pill__icon-invalid svg {
|
|
130
|
-
|
|
135
|
+
color: var(--filter-badge__invalid-color);
|
|
131
136
|
}
|
|
132
137
|
&.filter-pill__icon-not-default-value svg {
|
|
133
|
-
|
|
138
|
+
color: var(--filter-badge__selected-color);
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
</style>
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<div class="px-1">
|
|
4
|
-
<div
|
|
4
|
+
<div class="facets-filter-header">
|
|
5
|
+
<div v-if="title">{{title}}</div>
|
|
6
|
+
</div>
|
|
5
7
|
|
|
6
8
|
<itf-text-field small v-model="query" class="mb-2" :placeholder="$t('components.filter.search')" clearable />
|
|
7
9
|
|
|
8
|
-
<div
|
|
10
|
+
<div class="d-flex justify-content-between small mb-2">
|
|
9
11
|
<a v-if="isSelectedAll" href="" @click.stop.prevent="onSelectAll(false)">{{$t('components.filter.deselectAll')}}</a>
|
|
10
12
|
<a v-else href="" @click.stop.prevent="onSelectAll(true)">{{$t('components.filter.selectAll')}}</a>
|
|
11
13
|
|
|
12
14
|
<span class="text-muted" v-if="!isHasSelected" href="" @click.stop.prevent="onShowSelected(true)">{{$t('components.filter.showSelected')}}</span>
|
|
13
15
|
<a v-else-if="!isShowSelected" href="" @click.stop.prevent="onShowSelected(true)">{{$t('components.filter.showSelected')}}</a>
|
|
14
|
-
<a v-else href="" @click.stop.prevent="onShowSelected(false)">{{$t('components.filter.
|
|
16
|
+
<a v-else href="" @click.stop.prevent="onShowSelected(false)">{{$t('components.filter.showAll')}}</a>
|
|
15
17
|
</div>
|
|
16
|
-
<div v-
|
|
18
|
+
<div v-if="!mappedValues.length">
|
|
17
19
|
<div class="text-muted text-center py-4">{{ $t('components.filter.noResults') }}</div>
|
|
18
20
|
</div>
|
|
19
21
|
</div>
|
|
20
|
-
<div v-for="(val, n) of mappedValues" :key="n" class="
|
|
22
|
+
<div v-for="(val, n) of mappedValues" :key="n" class="dropdown-item" :class="{'active': val.isSelected}" @click="onFilterClick(val)">
|
|
21
23
|
<span class="facet-name text-dark d-flex align-items-center">
|
|
22
24
|
<itf-checkbox ungrouped :value="val.isSelected" class="m-0" />
|
|
23
25
|
<div class="w-100 text-truncate">{{ val.label }}</div>
|
|
@@ -28,15 +30,20 @@
|
|
|
28
30
|
</span>
|
|
29
31
|
</div>
|
|
30
32
|
|
|
31
|
-
<itf-button class="mt-1" v-if="hasMore" small block @click="toggleMore">
|
|
33
|
+
<itf-button default class="mt-1" v-if="hasMore" small block @click="toggleMore">
|
|
32
34
|
<span v-if="showMore">{{ $t('components.filter.hideMore', { count: visibleList.length }) }}</span>
|
|
33
35
|
<span v-else>{{ $t('components.filter.showMore', { count: visibleList.length }) }}</span>
|
|
34
36
|
</itf-button>
|
|
35
37
|
</div>
|
|
36
38
|
</template>
|
|
37
39
|
<style lang="scss" scoped>
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
+
.facets-filter-header {
|
|
41
|
+
border-bottom: 1px solid var(--bs-border-color-translucent);
|
|
42
|
+
color: #A5A5A9;
|
|
43
|
+
padding: 0 0.75rem .5rem;
|
|
44
|
+
margin: 0 -.75rem .75rem;
|
|
45
|
+
}
|
|
46
|
+
.dropdown-item {
|
|
40
47
|
cursor: pointer;
|
|
41
48
|
display: inline-flex;
|
|
42
49
|
-webkit-box-align: center;
|
|
@@ -47,8 +54,6 @@
|
|
|
47
54
|
box-sizing: border-box;
|
|
48
55
|
height: 1.75rem;
|
|
49
56
|
width: 100%;
|
|
50
|
-
padding-left: 0.25rem;
|
|
51
|
-
padding-right: 0.25rem;
|
|
52
57
|
font-size: 0.875rem;
|
|
53
58
|
line-height: 1.25rem;
|
|
54
59
|
font-weight: 400;
|
|
@@ -62,16 +67,12 @@
|
|
|
62
67
|
transition: none 0s ease 0s;
|
|
63
68
|
margin: 1px 0;
|
|
64
69
|
&.active {
|
|
65
|
-
background-color: rgba(var(--bs-primary-rgb), 25%);
|
|
66
|
-
|
|
67
70
|
.facet-bar-progress {
|
|
68
|
-
background-color:
|
|
71
|
+
background-color: var(--bs-blue);
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
|
-
&:hover, &:focus, &.active {
|
|
72
|
-
border-color: var(--bs-primary);
|
|
73
|
-
}
|
|
74
74
|
.facet-name {
|
|
75
|
+
min-width: 0;
|
|
75
76
|
text-align: left;
|
|
76
77
|
white-space: nowrap;
|
|
77
78
|
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
width: var(--bar-width);
|
|
96
97
|
min-width: 5px;
|
|
97
98
|
height: 10px;
|
|
98
|
-
background-color: rgb
|
|
99
|
+
background-color: rgba(var(--bs-blue-rgb), 50%);
|
|
99
100
|
transition: width 0.3s ease 0s;
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -200,6 +201,9 @@ class FilterFacetsList extends Vue {
|
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
onShowSelected(isShow = false) {
|
|
204
|
+
if (!this.value.length && isShow) { // не показувати, якщо нічого не вибрано
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
203
207
|
this.isShowSelected = isShow;
|
|
204
208
|
}
|
|
205
209
|
}
|