@itfin/components 1.3.21 → 1.3.23
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 +3 -1
- package/src/assets/scss/_dark-theme.scss +1 -0
- package/src/assets/scss/main.scss +1 -0
- package/src/components/dropdown/Dropdown.vue +2 -2
- package/src/components/dropdown/index.stories.js +3 -5
- package/src/components/editor/Editor.vue +6 -1
- package/src/components/editor/index.stories.js +0 -226
- package/src/components/editor/tools/bpmn/bpmn.js +187 -0
- package/src/components/editor/tools/bpmn/bpmn.scss +63 -0
- package/src/components/editor/tools/drawing/drawing.js +1 -1
- package/src/components/editor/tools/drawing/excalidraw.production.min.js +2 -0
- package/src/components/filter/FilterBadge.vue +61 -0
- package/src/components/filter/Rule.vue +27 -5
- package/src/components/filter/RuleGroup.vue +24 -14
- package/src/components/filter/constants.js +19 -0
- package/src/components/filter/index.stories.js +7 -1
- package/src/components/table/TableGroup.vue +2 -2
- package/src/components/table/TableHeader.vue +31 -33
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<span class="border rounded d-inline-flex ps-3 pe-1 gap-1 align-items-center">
|
|
5
|
+
Status
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<select class="form-control input-sm filter-operation" v-model="operator">
|
|
9
|
+
<option v-for="option in operators" :value="option.id">
|
|
10
|
+
{{option.title}}
|
|
11
|
+
</option>
|
|
12
|
+
</select>
|
|
13
|
+
|
|
14
|
+
<div>
|
|
15
|
+
asda
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<itf-button icon>
|
|
19
|
+
<itf-icon name="close" />
|
|
20
|
+
</itf-button>
|
|
21
|
+
</span>
|
|
22
|
+
|
|
23
|
+
</template>
|
|
24
|
+
<style>
|
|
25
|
+
.form-control.filter-operation {
|
|
26
|
+
background: transparent;
|
|
27
|
+
border: none;
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
border-radius: 0;
|
|
30
|
+
|
|
31
|
+
&:focus, &:active {
|
|
32
|
+
box-shadow: none;
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
35
|
+
&:hover {
|
|
36
|
+
background-color: var(--bs-tertiary-bg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
<script>
|
|
41
|
+
import { Component, Prop, Watch, Vue } from 'vue-property-decorator';
|
|
42
|
+
import {getOperatorsByType} from "./constants";
|
|
43
|
+
import itfButton from '../button/Button.vue';
|
|
44
|
+
import itfIcon from '../icon/Icon.vue';
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export default @Component({
|
|
48
|
+
name: 'itfFilterBadge',
|
|
49
|
+
components: {
|
|
50
|
+
itfButton,
|
|
51
|
+
itfIcon
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
class itfFilterBadge extends Vue {
|
|
55
|
+
@Prop({ type: String, required: true }) type;
|
|
56
|
+
|
|
57
|
+
get operators() {
|
|
58
|
+
return getOperatorsByType(this.type);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="form-group and-or-rule
|
|
2
|
+
<div class="form-group and-or-rule d-flex">
|
|
3
3
|
<div class="col-3">
|
|
4
4
|
<select class="form-control input-sm" v-model="key">
|
|
5
5
|
<option v-for="option in options.keys" :value="option.id">
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
</select>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<div class="
|
|
12
|
-
<select class="form-control input-sm" v-model="operator">
|
|
13
|
-
<option v-for="option in
|
|
14
|
-
{{option.
|
|
11
|
+
<div style="width: 150px" class="px-2">
|
|
12
|
+
<select class="form-control input-sm input-filter" v-model="operator">
|
|
13
|
+
<option v-for="option in operators" :value="option.id">
|
|
14
|
+
{{option.title}}
|
|
15
15
|
</option>
|
|
16
16
|
</select>
|
|
17
17
|
</div>
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</template>
|
|
29
29
|
<style>
|
|
30
|
+
.input-filter {
|
|
31
|
+
background: var(--bs-primary-bg-subtle);
|
|
32
|
+
}
|
|
30
33
|
.and-or-rule {
|
|
31
34
|
position: relative;
|
|
32
35
|
margin-left: 15px !important;
|
|
@@ -63,12 +66,27 @@ import { Component, Prop, Watch, Vue } from "vue-property-decorator";
|
|
|
63
66
|
import itfButton from '../button/Button.vue';
|
|
64
67
|
import itfIcon from '../icon/Icon.vue';
|
|
65
68
|
|
|
69
|
+
const operations = [
|
|
70
|
+
{
|
|
71
|
+
type: 'string',
|
|
72
|
+
operators: [
|
|
73
|
+
{ id: 'eq', title: 'equal' },
|
|
74
|
+
{ id: 'notEq', title: 'not equal' },
|
|
75
|
+
{ id: 'contains', title: 'contains' },
|
|
76
|
+
{ id: 'noContains', title: 'not contains' },
|
|
77
|
+
{ id: 'startsWith', title: 'starts with' },
|
|
78
|
+
{ id: 'endsWith', title: 'ends with' }
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
|
|
66
83
|
export default @Component({
|
|
67
84
|
name: 'itfRule',
|
|
68
85
|
components: { itfButton, itfIcon }
|
|
69
86
|
})
|
|
70
87
|
class itfRule extends Vue {
|
|
71
88
|
@Prop() options;
|
|
89
|
+
@Prop() type;
|
|
72
90
|
|
|
73
91
|
key = -99;
|
|
74
92
|
|
|
@@ -76,6 +94,10 @@ class itfRule extends Vue {
|
|
|
76
94
|
|
|
77
95
|
value = '';
|
|
78
96
|
|
|
97
|
+
get operators() {
|
|
98
|
+
return operations.find(op => op.type === this.type)?.operators || [];
|
|
99
|
+
}
|
|
100
|
+
|
|
79
101
|
@Watch('options.keys.options')
|
|
80
102
|
onOptionUpdated() {
|
|
81
103
|
this.key = -99;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div>
|
|
3
|
+
<itf-dropdown>
|
|
4
|
+
<template #button>
|
|
5
|
+
<itf-icon name="filter" />
|
|
6
|
+
Filter
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<div class="dropdown-item" @click="addGroup">Add group</div>
|
|
10
|
+
<div class="dropdown-item" @click="addRule">Add condition</div>
|
|
11
|
+
</itf-dropdown>
|
|
3
12
|
<div class="form-group and-or-top col-12">
|
|
4
13
|
<div class="col-5" style="padding: 0">
|
|
5
14
|
<button class="btn btn-xs btn-purple-outline btn-radius"
|
|
@@ -16,14 +25,16 @@
|
|
|
16
25
|
<itf-button v-if="!first" class="btn btn-xs btn-purple pull-right" @click.prevent="deleteSelf()">
|
|
17
26
|
<i class="fa fa-fw fa-close"></i>
|
|
18
27
|
</itf-button>
|
|
19
|
-
<button class="btn btn-xs btn-purple pull-right" @click.prevent="addGroup"> + ( group ) </button>
|
|
20
|
-
<button class="btn btn-xs btn-purple add-rule pull-right" @click.prevent="addRule"> + add </button>
|
|
21
28
|
</div>
|
|
22
29
|
</div>
|
|
23
30
|
|
|
24
31
|
<rule
|
|
25
|
-
v-for="(rule, index) in rules"
|
|
26
|
-
|
|
32
|
+
v-for="(rule, index) in rules"
|
|
33
|
+
ref="rules"
|
|
34
|
+
:options="options"
|
|
35
|
+
:key="rule"
|
|
36
|
+
type="string"
|
|
37
|
+
@delete-rule="deleteRule(index)">
|
|
27
38
|
</rule>
|
|
28
39
|
|
|
29
40
|
<itf-rule-group
|
|
@@ -36,16 +47,8 @@
|
|
|
36
47
|
</template>
|
|
37
48
|
<style>
|
|
38
49
|
.and-or-template {
|
|
39
|
-
padding: 8px;
|
|
40
50
|
position: relative;
|
|
41
|
-
border-radius: 3px;
|
|
42
|
-
border: 1px solid #6d77b8;
|
|
43
|
-
border-top: 3px solid #d2d6de;
|
|
44
51
|
margin-bottom: 20px;
|
|
45
|
-
/* width: 100%; */
|
|
46
|
-
box-shadow: 0 1px 1px rgba(0,0,0,0.1);
|
|
47
|
-
border-top-color: #6d77b8;
|
|
48
|
-
background-color: rgba(255, 255, 255, 0.9);
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
.and-or-template:before,
|
|
@@ -91,11 +94,18 @@
|
|
|
91
94
|
<script>
|
|
92
95
|
import { Component, Prop, Watch, Vue } from 'vue-property-decorator';
|
|
93
96
|
import itfButton from '../button/Button.vue';
|
|
97
|
+
import itfIcon from '../icon/Icon.vue';
|
|
98
|
+
import itfDropdown from '../dropdown/Dropdown.vue';
|
|
94
99
|
import Rule from './Rule'
|
|
95
100
|
|
|
96
101
|
export default @Component({
|
|
97
102
|
name: 'itfRuleGroup',
|
|
98
|
-
components: {
|
|
103
|
+
components: {
|
|
104
|
+
itfIcon,
|
|
105
|
+
itfButton,
|
|
106
|
+
itfDropdown,
|
|
107
|
+
Rule
|
|
108
|
+
}
|
|
99
109
|
})
|
|
100
110
|
class itfRule extends Vue {
|
|
101
111
|
@Prop({ type: Object, required: true }) options;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export function getOperatorsByType(type) {
|
|
4
|
+
const operations = [
|
|
5
|
+
{
|
|
6
|
+
type: 'string',
|
|
7
|
+
operators: [
|
|
8
|
+
{ id: 'eq', title: 'equal' },
|
|
9
|
+
{ id: 'notEq', title: 'not equal' },
|
|
10
|
+
{ id: 'contains', title: 'contains' },
|
|
11
|
+
{ id: 'noContains', title: 'not contains' },
|
|
12
|
+
{ id: 'startsWith', title: 'starts with' },
|
|
13
|
+
{ id: 'endsWith', title: 'ends with' }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
return operations.find((operation) => operation.type === type).operators;
|
|
19
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { storiesOf } from '@storybook/vue';
|
|
2
2
|
import itfRule from './Rule.vue';
|
|
3
3
|
import itfRuleGroup from './RuleGroup.vue';
|
|
4
|
+
import itfFilterBadge from './FilterBadge.vue';
|
|
4
5
|
|
|
5
6
|
storiesOf('Common', module)
|
|
6
7
|
.add('Filter', () => ({
|
|
7
8
|
components: {
|
|
8
9
|
itfRule,
|
|
9
|
-
itfRuleGroup
|
|
10
|
+
itfRuleGroup,
|
|
11
|
+
itfFilterBadge
|
|
10
12
|
},
|
|
11
13
|
data() {
|
|
12
14
|
return {
|
|
@@ -62,6 +64,10 @@ storiesOf('Common', module)
|
|
|
62
64
|
|
|
63
65
|
</pre>
|
|
64
66
|
|
|
67
|
+
|
|
68
|
+
<itf-filter-badge type="string" />
|
|
69
|
+
|
|
70
|
+
|
|
65
71
|
<h2>Example</h2>
|
|
66
72
|
|
|
67
73
|
<itf-rule-group :options="options" first />
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
display: flex;
|
|
151
151
|
width: fit-content;
|
|
152
152
|
//margin-top: 20px;
|
|
153
|
-
margin-bottom: 20px ;
|
|
153
|
+
//margin-bottom: 20px ;
|
|
154
154
|
|
|
155
155
|
.preline {
|
|
156
156
|
display: flex;
|
|
@@ -298,7 +298,7 @@ class itfTableGroup extends Vue {
|
|
|
298
298
|
get visibleColumns() {
|
|
299
299
|
let list = this.columns;
|
|
300
300
|
list = sortBy(list, (column) => column.pinned ? 0 : 1);
|
|
301
|
-
let left =
|
|
301
|
+
let left = 57; // sum of first 2 cells
|
|
302
302
|
const pinned = list.filter((column) => column.pinned && column.visible !== false);
|
|
303
303
|
list = list.map((column, index) => {
|
|
304
304
|
const item = {...column};
|
|
@@ -36,39 +36,37 @@
|
|
|
36
36
|
</span>
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</li>
|
|
71
|
-
</ul>
|
|
39
|
+
<div v-if="column.sortable">
|
|
40
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;">
|
|
41
|
+
<itf-icon name="arrow_up" :size="16" class="me-1" />
|
|
42
|
+
Sort By Asc
|
|
43
|
+
</a>
|
|
44
|
+
</div>
|
|
45
|
+
<div v-if="column.sortable">
|
|
46
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;">
|
|
47
|
+
<itf-icon name="arrow_down" :size="16" class="me-1" />
|
|
48
|
+
Sort By Desc
|
|
49
|
+
</a>
|
|
50
|
+
</div>
|
|
51
|
+
<div v-if="column.groupable">
|
|
52
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;">
|
|
53
|
+
<itf-icon name="episodes" :size="16" class="me-1" />
|
|
54
|
+
Group By
|
|
55
|
+
</a>
|
|
56
|
+
</div>
|
|
57
|
+
<div>
|
|
58
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="togglePinned(n)">
|
|
59
|
+
<itf-icon :name="column.pinned ? 'checkbox_checked' : 'checkbox_empty'" :size="16" class="me-1" />
|
|
60
|
+
<span v-if="column.pinned">Unpin Column</span>
|
|
61
|
+
<span v-else>Pin Column</span>
|
|
62
|
+
</a>
|
|
63
|
+
</div>
|
|
64
|
+
<div>
|
|
65
|
+
<a class="dropdown-item d-flex align-items-center" href="javascript:;" @click="hideColumn(n)">
|
|
66
|
+
<itf-icon name="eye_no" :size="16" class="me-1" />
|
|
67
|
+
Hide
|
|
68
|
+
</a>
|
|
69
|
+
</div>
|
|
72
70
|
</itf-dropdown>
|
|
73
71
|
</div>
|
|
74
72
|
<div v-if="n === sortedColumns.length - 1"
|