layers-design-system 2.0.4 → 2.0.6
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 -4
- package/src/assets/l-presentation/external-apps.png +0 -0
- package/src/assets/l-presentation/notification.png +0 -0
- package/src/components/LAlert/docs.vue +2 -2
- package/src/components/LAlert/index.vue +2 -2
- package/src/components/LCheckbox/index.vue +5 -8
- package/src/components/LCheckboxGroup/index.vue +2 -2
- package/src/components/LPresentation/docs.vue +33 -34
- package/src/components/LPresentation/index.vue +55 -22
- package/src/components/LRadioGroup/index.vue +2 -2
- package/src/components/LSearchBar/AddFilterButton.vue +7 -4
- package/src/components/LSearchBar/Filters/Editors/NumberEditor.vue +1 -1
- package/src/components/LSearchBar/Filters/Editors/StringEditor.vue +1 -1
- package/src/components/LSearchBar/Filters/Views/DateView.vue +3 -3
- package/src/components/LSearchBar/docs.vue +2 -2
- package/src/components/LSearchBar/index.vue +35 -30
- package/src/components/LSearchTopics/TopicItem.vue +1 -1
- package/src/components/LSearchTopics/docs/drawer.vue +3 -3
- package/src/components/LSearchTopics/header.vue +1 -1
- package/src/components/LSearchTopics/index.vue +7 -1
- package/src/components/LSwitch/index.vue +2 -2
- package/src/components/LTable/FieldTypes/DateView.vue +3 -3
- package/src/components/LTable/FieldTypes/StringView.vue +1 -1
- package/src/components/LTable/LTableBody.vue +1 -1
- package/src/components/LTable/helpers.js +2 -1
- package/src/components/LTooltip/index.vue +2 -2
- package/src/main.js +4 -2
- package/vue.config.js +7 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "layers-design-system",
|
|
3
3
|
"main": "src/main.js",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.6",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "vue-cli-service serve ./src/main-docs.js",
|
|
7
7
|
"build": "vue-cli-service build --target lib ./src/main.js",
|
|
@@ -26,14 +26,12 @@
|
|
|
26
26
|
"@tiptap/extension-text": "2.0.0-beta.13",
|
|
27
27
|
"@tiptap/extension-underline": "2.0.0-beta.16",
|
|
28
28
|
"@tiptap/vue-2": "2.0.0-beta.60",
|
|
29
|
-
"core-js": "^3.25.2",
|
|
30
29
|
"currency.js": "1.2.2",
|
|
30
|
+
"dayjs": "^1.11.7",
|
|
31
31
|
"dompurify": "2.3.3",
|
|
32
32
|
"element-ui": "2.15.6",
|
|
33
33
|
"layers-utils": "1.0.4",
|
|
34
|
-
"moment": "2.29.1",
|
|
35
34
|
"mustache": "4.2.0",
|
|
36
|
-
"sass-loader": "7.3.1",
|
|
37
35
|
"tiptap": "1.32.2",
|
|
38
36
|
"url-regex-safe": "2.0.2",
|
|
39
37
|
"vant": "2.12.30",
|
|
@@ -43,6 +41,7 @@
|
|
|
43
41
|
"vuetify": "2.5.10"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
44
|
+
"sass-loader": "7.3.1",
|
|
46
45
|
"@vue/cli-plugin-babel": "4.5.14",
|
|
47
46
|
"@vue/cli-plugin-eslint": "4.5.14",
|
|
48
47
|
"@vue/cli-service": "4.5.14",
|
|
Binary file
|
|
Binary file
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
|
-
import
|
|
34
|
+
import pickBy from "lodash/pickBy";
|
|
35
35
|
|
|
36
36
|
export default {
|
|
37
37
|
name: "Alert",
|
|
@@ -74,7 +74,7 @@ export default {
|
|
|
74
74
|
methods: {
|
|
75
75
|
fetchQuery() {
|
|
76
76
|
// Pick only values that are not empty string
|
|
77
|
-
return
|
|
77
|
+
return pickBy(this.query, val => (val === "" ? false : true));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Checkbox } from "element-ui";
|
|
3
3
|
export default {
|
|
4
4
|
tagName: "l-checkbox",
|
|
5
|
-
extends: Checkbox
|
|
5
|
+
extends: Checkbox,
|
|
6
6
|
};
|
|
7
7
|
</script>
|
|
8
8
|
<style>
|
|
@@ -11,21 +11,18 @@ export default {
|
|
|
11
11
|
.l-checkbox .el-checkbox__inner {
|
|
12
12
|
transition: none !important;
|
|
13
13
|
box-sizing: border-box;
|
|
14
|
-
border-width: 2px;
|
|
15
14
|
border-color: var(--color-gray-50);
|
|
16
15
|
width: 16px;
|
|
17
16
|
height: 16px;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
.l-checkbox .el-checkbox__input.is-checked .el-checkbox__inner {
|
|
21
|
-
border-width: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
.l-checkbox .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
|
25
20
|
border-width: 2px;
|
|
26
21
|
width: 5px;
|
|
27
22
|
height: 12px;
|
|
28
|
-
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
29
26
|
left: 5px;
|
|
30
27
|
border-color: var(--white);
|
|
31
28
|
}
|
|
@@ -34,4 +31,4 @@ export default {
|
|
|
34
31
|
height: 4px;
|
|
35
32
|
top: 4px;
|
|
36
33
|
}
|
|
37
|
-
</style>
|
|
34
|
+
</style>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { getColor } from '../../helpers/Colors'
|
|
3
3
|
import { CheckboxGroup } from 'element-ui';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
const Base =
|
|
5
|
+
import clone from 'lodash/clone'
|
|
6
|
+
const Base = clone(CheckboxGroup);
|
|
7
7
|
delete Base.props.fill;
|
|
8
8
|
|
|
9
9
|
export default {
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
2
|
+
<div id="app">
|
|
3
|
+
<h1>Presentation</h1>
|
|
4
|
+
<l-presentation @close="toggleDialog" :value="dialog" color="#BAEAF8" :image="require('../../assets/l-presentation/notification.png')">
|
|
5
|
+
<slot slot="content">
|
|
6
|
+
Agora é possível administrar suas notificações. Diga como e por quais apps você deseja ser notificado em <strong>Notificações.</strong>
|
|
7
|
+
</slot>
|
|
8
|
+
<l-button @click="toggleDialog" style="width: fit-content; margin-top: 20px;">Apresentação por dialog</l-button>
|
|
9
|
+
</l-presentation>
|
|
10
|
+
<l-presentation @close="toggleTooltip" mode="cover" :isTooltip="true" :value="tooltip" placement="right" color="#BAEAF8" :image="require('../../assets/l-presentation/external-apps.png')">
|
|
11
|
+
<slot slot="content">
|
|
12
|
+
Administre suas notificações. Diga como e por quais apps você deseja ser notificado, acesse a aba de <strong>Notificações.</strong>
|
|
13
|
+
</slot>
|
|
14
|
+
<l-button @click="toggleTooltip" style="width: fit-content; margin-top: 20px;">Apresentação por tooltip</l-button>
|
|
15
|
+
</l-presentation>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: "Presentation",
|
|
22
|
+
data: () => ({
|
|
23
|
+
tooltip: false,
|
|
24
|
+
dialog: false
|
|
25
|
+
}),
|
|
26
|
+
methods: {
|
|
27
|
+
toggleTooltip() {
|
|
28
|
+
this.tooltip = !this.tooltip;
|
|
29
|
+
},
|
|
30
|
+
toggleDialog() {
|
|
31
|
+
this.dialog = !this.dialog;
|
|
33
32
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
</script>
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<l-tooltip v-if="isTooltip" ref="tooltip" :placement="placement" effect="light" :value="value" manual
|
|
2
|
+
<l-tooltip v-if="isTooltip" ref="tooltip" :placement="placement" effect="light" :value="value" manual
|
|
3
|
+
:tooltipClass="['l-presentation-popper', tooltipClass]">
|
|
3
4
|
<div class="tooltip-content" slot="content">
|
|
4
|
-
<div class="image" :style="{'background-color': color}">
|
|
5
|
-
<img :src="image"
|
|
5
|
+
<div class="image-container" :style="{ 'background-color': color }">
|
|
6
|
+
<img :src="image" :class="['l-presentation-image', mode]" draggable="false" alt="Presentation">
|
|
6
7
|
<l-button @click="close" class="close-button" fab icon="uil-times" size="mini" type="info" />
|
|
7
8
|
</div>
|
|
8
|
-
<p
|
|
9
|
-
|
|
9
|
+
<p>
|
|
10
|
+
<slot name="content" />
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
10
13
|
<slot />
|
|
11
14
|
</l-tooltip>
|
|
12
15
|
<div v-else>
|
|
13
|
-
<l-dialog :visible.sync="value" :before-close="close"
|
|
14
|
-
<div slot="title" class="image" :style="{'background-color': color}">
|
|
15
|
-
<img :src="image" width="280" height="160" draggable="false"
|
|
16
|
+
<l-dialog :visible.sync="value" :before-close="close">
|
|
17
|
+
<div slot="title" class="image-container" :style="{ 'background-color': color }">
|
|
18
|
+
<img :src="image" :class="['l-presentation-image', mode]" width="280" height="160" draggable="false"
|
|
19
|
+
alt="Presentation">
|
|
16
20
|
</div>
|
|
17
21
|
<div class="tooltip-content">
|
|
18
|
-
<p
|
|
19
|
-
|
|
22
|
+
<p>
|
|
23
|
+
<slot name="content" />
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
20
26
|
</l-dialog>
|
|
21
27
|
<slot />
|
|
22
28
|
</div>
|
|
@@ -47,6 +53,15 @@ export default {
|
|
|
47
53
|
isTooltip: {
|
|
48
54
|
type: Boolean,
|
|
49
55
|
default: false
|
|
56
|
+
},
|
|
57
|
+
mode: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "contain",
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
tooltipClass: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false
|
|
50
65
|
}
|
|
51
66
|
},
|
|
52
67
|
watch: {
|
|
@@ -75,33 +90,45 @@ export default {
|
|
|
75
90
|
border-radius: 2px;
|
|
76
91
|
max-width: 330px;
|
|
77
92
|
}
|
|
78
|
-
|
|
93
|
+
|
|
94
|
+
.image-container {
|
|
79
95
|
display: flex;
|
|
80
96
|
justify-content: center;
|
|
81
97
|
align-items: center;
|
|
82
|
-
width: auto;
|
|
83
|
-
padding: 20px;
|
|
84
98
|
position: relative;
|
|
85
99
|
border-radius: 20px 20px 0 0;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.l-presentation-image {
|
|
104
|
+
height: 100%;
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.contain {
|
|
109
|
+
object-fit: contain !important;
|
|
86
110
|
}
|
|
87
|
-
|
|
88
|
-
|
|
111
|
+
|
|
112
|
+
.cover {
|
|
113
|
+
object-fit: cover !important;
|
|
89
114
|
}
|
|
115
|
+
|
|
90
116
|
.tooltip-content .close-button {
|
|
91
117
|
position: absolute;
|
|
92
|
-
width: 25px!important;
|
|
93
|
-
height: 25px!important;
|
|
94
|
-
padding-top: 8px!important;
|
|
95
|
-
padding-left: 8px!important;
|
|
118
|
+
width: 25px !important;
|
|
119
|
+
height: 25px !important;
|
|
120
|
+
padding-top: 8px !important;
|
|
121
|
+
padding-left: 8px !important;
|
|
96
122
|
top: 20px;
|
|
97
123
|
right: 20px;
|
|
98
124
|
background: rgba(0, 0, 0, 0.25);
|
|
99
125
|
}
|
|
126
|
+
|
|
100
127
|
.tooltip-content .close-button i {
|
|
101
128
|
margin-top: 1px;
|
|
102
129
|
}
|
|
130
|
+
|
|
103
131
|
.tooltip-content p {
|
|
104
|
-
width: auto;
|
|
105
132
|
padding: 20px;
|
|
106
133
|
padding-bottom: 30px;
|
|
107
134
|
margin: 0;
|
|
@@ -110,6 +137,7 @@ export default {
|
|
|
110
137
|
word-wrap: break-word;
|
|
111
138
|
}
|
|
112
139
|
</style>
|
|
140
|
+
|
|
113
141
|
<style>
|
|
114
142
|
.l-presentation-popper {
|
|
115
143
|
padding: 0 !important;
|
|
@@ -119,26 +147,31 @@ export default {
|
|
|
119
147
|
user-select: none;
|
|
120
148
|
--popper-arrow: #FFF;
|
|
121
149
|
}
|
|
150
|
+
|
|
122
151
|
.l-presentation-popper .popper__arrow {
|
|
123
152
|
border-width: 0 !important;
|
|
124
|
-
|
|
125
153
|
}
|
|
154
|
+
|
|
126
155
|
.l-presentation-popper .popper__arrow::after {
|
|
127
156
|
border-right-color: var(--popper-arrow) !important;
|
|
128
157
|
}
|
|
158
|
+
|
|
129
159
|
.l-presentation .el-dialog {
|
|
130
160
|
max-width: 80%;
|
|
131
161
|
width: 330px;
|
|
132
162
|
overflow: hidden;
|
|
133
163
|
border-radius: 2px;
|
|
134
164
|
}
|
|
165
|
+
|
|
135
166
|
.l-presentation .el-dialog__header {
|
|
136
167
|
padding: 0 !important;
|
|
137
168
|
border: none;
|
|
138
169
|
}
|
|
170
|
+
|
|
139
171
|
.l-presentation .el-dialog__header .image {
|
|
140
172
|
border-radius: 0px;
|
|
141
173
|
}
|
|
174
|
+
|
|
142
175
|
.l-presentation .el-dialog__body {
|
|
143
176
|
padding: 0 !important;
|
|
144
177
|
border: none;
|
|
@@ -146,4 +179,4 @@ export default {
|
|
|
146
179
|
margin-top: 10px;
|
|
147
180
|
text-align: center;
|
|
148
181
|
}
|
|
149
|
-
</style>
|
|
182
|
+
</style>
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
</l-dropdown>
|
|
31
31
|
</template>
|
|
32
32
|
<script>
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
import find from "lodash/find"
|
|
35
|
+
import get from "lodash/get"
|
|
36
|
+
import filter from "lodash/filter"
|
|
34
37
|
|
|
35
38
|
export default {
|
|
36
39
|
name: "AddFilterButton",
|
|
@@ -46,14 +49,14 @@ export default {
|
|
|
46
49
|
this.$emit("addFilter", filter);
|
|
47
50
|
},
|
|
48
51
|
hasFilterFor(path) {
|
|
49
|
-
return
|
|
52
|
+
return find(this.filters, { path });
|
|
50
53
|
}
|
|
51
54
|
},
|
|
52
55
|
computed: {
|
|
53
56
|
availableOptions() {
|
|
54
|
-
if (!
|
|
57
|
+
if (!get(this.schema, "fields", []).length === 0) return [];
|
|
55
58
|
|
|
56
|
-
return
|
|
59
|
+
return filter(
|
|
57
60
|
this.schema.fields,
|
|
58
61
|
option => option.filterable && !this.hasFilterFor(option.path)
|
|
59
62
|
);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
</span>
|
|
7
7
|
</template>
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import get from "lodash/get";
|
|
10
|
+
import dayjs from 'dayjs';
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
model: {
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
return `${this.filter.value} ${this.filter.value > 1 ? 'dias' : 'dia'}`
|
|
40
40
|
}
|
|
41
41
|
const format = get(this.schema, 'options.format', 'LL')
|
|
42
|
-
return
|
|
42
|
+
return dayjs(this.filter.value, { locale: 'pt-br' }).format(format)
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
22
|
-
import
|
|
22
|
+
import pickBy from "lodash/pickBy";
|
|
23
23
|
|
|
24
24
|
export default {
|
|
25
25
|
name: "SearchBar",
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
methods: {
|
|
54
54
|
fetchQuery() {
|
|
55
55
|
// Pick only values that are not empty string
|
|
56
|
-
return
|
|
56
|
+
return pickBy(this.query, val => (val === "" ? false : true));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
};
|
|
@@ -43,7 +43,12 @@
|
|
|
43
43
|
</div>
|
|
44
44
|
</template>
|
|
45
45
|
<script>
|
|
46
|
-
import
|
|
46
|
+
import get from "lodash/get";
|
|
47
|
+
import cloneDeep from "lodash/cloneDeep";
|
|
48
|
+
import isEqual from "lodash/isEqual";
|
|
49
|
+
import findIndex from "lodash/findIndex";
|
|
50
|
+
import find from "lodash/find";
|
|
51
|
+
|
|
47
52
|
import AddFilterButton from "./AddFilterButton";
|
|
48
53
|
import FilterChip from "./Filters/FilterChip";
|
|
49
54
|
|
|
@@ -51,12 +56,12 @@ export default {
|
|
|
51
56
|
tagName: "l-search-bar",
|
|
52
57
|
model: {
|
|
53
58
|
prop: "value",
|
|
54
|
-
event: "change"
|
|
59
|
+
event: "change",
|
|
55
60
|
},
|
|
56
61
|
props: {
|
|
57
62
|
availableModes: {
|
|
58
63
|
type: Array,
|
|
59
|
-
default: () => ["simple"]
|
|
64
|
+
default: () => ["simple"],
|
|
60
65
|
},
|
|
61
66
|
value: {
|
|
62
67
|
type: Object,
|
|
@@ -64,15 +69,15 @@ export default {
|
|
|
64
69
|
return {
|
|
65
70
|
mode: this.availableModes[0],
|
|
66
71
|
queryText: "",
|
|
67
|
-
filters: []
|
|
72
|
+
filters: [],
|
|
68
73
|
};
|
|
69
|
-
}
|
|
74
|
+
},
|
|
70
75
|
},
|
|
71
76
|
schema: {
|
|
72
77
|
type: Object,
|
|
73
78
|
default: () => {
|
|
74
|
-
return {}
|
|
75
|
-
}
|
|
79
|
+
return {};
|
|
80
|
+
},
|
|
76
81
|
},
|
|
77
82
|
disabled: {
|
|
78
83
|
type: Boolean,
|
|
@@ -81,40 +86,40 @@ export default {
|
|
|
81
86
|
},
|
|
82
87
|
data() {
|
|
83
88
|
return {
|
|
84
|
-
mode:
|
|
85
|
-
queryText:
|
|
86
|
-
filters:
|
|
89
|
+
mode: get(this.value, "mode", this.availableModes[0]),
|
|
90
|
+
queryText: get(this.value, "queryText", ""),
|
|
91
|
+
filters: cloneDeep(get(this.value, "filters", [])),
|
|
87
92
|
};
|
|
88
93
|
},
|
|
89
94
|
watch: {
|
|
90
95
|
value(newValue) {
|
|
91
|
-
this.mode =
|
|
92
|
-
this.queryText =
|
|
96
|
+
this.mode = get(newValue, "mode", this.availableModes[0]);
|
|
97
|
+
this.queryText = get(newValue, "queryText", "");
|
|
93
98
|
|
|
94
|
-
const newFilters =
|
|
95
|
-
if (!
|
|
96
|
-
this.filters =
|
|
99
|
+
const newFilters = get(newValue, "filters", []);
|
|
100
|
+
if (!isEqual(this.filters, newFilters)) {
|
|
101
|
+
this.filters = cloneDeep(newFilters);
|
|
97
102
|
}
|
|
98
103
|
},
|
|
99
104
|
queryValue: {
|
|
100
105
|
deep: true,
|
|
101
106
|
handler(newValue) {
|
|
102
107
|
if (this.isValid) {
|
|
103
|
-
this.$emit("change",
|
|
108
|
+
this.$emit("change", cloneDeep(newValue));
|
|
104
109
|
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
110
|
+
},
|
|
111
|
+
},
|
|
107
112
|
},
|
|
108
113
|
methods: {
|
|
109
114
|
getFilterSchema(filter) {
|
|
110
115
|
const { path } = filter;
|
|
111
|
-
return
|
|
116
|
+
return find(this.schema.fields, { path });
|
|
112
117
|
},
|
|
113
118
|
addFilter(option) {
|
|
114
119
|
this.filters.push(Object.assign({}, option));
|
|
115
120
|
},
|
|
116
121
|
removeFilter(filter) {
|
|
117
|
-
const index =
|
|
122
|
+
const index = findIndex(this.filters, filter);
|
|
118
123
|
this.$delete(this.filters, index);
|
|
119
124
|
},
|
|
120
125
|
clear() {
|
|
@@ -128,24 +133,24 @@ export default {
|
|
|
128
133
|
default:
|
|
129
134
|
throw new Error(`Unknown mode ${this.mode}`);
|
|
130
135
|
}
|
|
131
|
-
}
|
|
136
|
+
},
|
|
132
137
|
},
|
|
133
138
|
computed: {
|
|
134
139
|
queryValue() {
|
|
135
140
|
return {
|
|
136
141
|
mode: this.mode,
|
|
137
142
|
queryText: this.queryText,
|
|
138
|
-
filters: this.filters
|
|
143
|
+
filters: this.filters,
|
|
139
144
|
};
|
|
140
145
|
},
|
|
141
146
|
isValid() {
|
|
142
|
-
return this.filters.filter(filter => !filter.valid).length === 0;
|
|
147
|
+
return this.filters.filter((filter) => !filter.valid).length === 0;
|
|
143
148
|
},
|
|
144
149
|
availableModesOptions() {
|
|
145
150
|
return [
|
|
146
151
|
{ icon: "uil-search", value: "simple", title: "Filtro simples" },
|
|
147
|
-
{ icon: "uil-filter", value: "advanced", title: "Filtro avançado" }
|
|
148
|
-
].filter(option => this.availableModes.includes(option.value));
|
|
152
|
+
{ icon: "uil-filter", value: "advanced", title: "Filtro avançado" },
|
|
153
|
+
].filter((option) => this.availableModes.includes(option.value));
|
|
149
154
|
},
|
|
150
155
|
showClearButton() {
|
|
151
156
|
switch (this.mode) {
|
|
@@ -156,12 +161,12 @@ export default {
|
|
|
156
161
|
default:
|
|
157
162
|
throw new Error(`Unknown mode ${this.mode}`);
|
|
158
163
|
}
|
|
159
|
-
}
|
|
164
|
+
},
|
|
160
165
|
},
|
|
161
166
|
components: {
|
|
162
167
|
AddFilterButton,
|
|
163
|
-
FilterChip
|
|
164
|
-
}
|
|
168
|
+
FilterChip,
|
|
169
|
+
},
|
|
165
170
|
};
|
|
166
171
|
</script>
|
|
167
172
|
<style lang="scss">
|
|
@@ -229,7 +234,7 @@ export default {
|
|
|
229
234
|
border-color: #c8d0d8 !important;
|
|
230
235
|
background: #f5f7fa;
|
|
231
236
|
&:hover {
|
|
232
|
-
cursor: not-allowed
|
|
237
|
+
cursor: not-allowed;
|
|
233
238
|
}
|
|
234
239
|
}
|
|
235
|
-
</style>
|
|
240
|
+
</style>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script>
|
|
21
|
-
import
|
|
21
|
+
import cloneDeep from 'lodash/cloneDeep'
|
|
22
22
|
export default {
|
|
23
23
|
name: 'Drawer',
|
|
24
24
|
|
|
@@ -100,12 +100,12 @@ export default {
|
|
|
100
100
|
},
|
|
101
101
|
methods: {
|
|
102
102
|
pushToRecentTopicsSearched(term) {
|
|
103
|
-
const clone =
|
|
103
|
+
const clone = cloneDeep(this.recentTopicsSearchedData)
|
|
104
104
|
clone.push(term)
|
|
105
105
|
this.recentTopicsSearchedData = clone
|
|
106
106
|
},
|
|
107
107
|
removeFromRecentTopicsSearched(term) {
|
|
108
|
-
const clone =
|
|
108
|
+
const clone = cloneDeep(this.recentTopicsSearchedData)
|
|
109
109
|
const indexToRemove = clone.findIndex((v) => v === term)
|
|
110
110
|
clone.splice(indexToRemove, 1)
|
|
111
111
|
this.recentTopicsSearchedData = clone
|
|
@@ -176,10 +176,16 @@
|
|
|
176
176
|
</template>
|
|
177
177
|
|
|
178
178
|
<script>
|
|
179
|
+
import cloneDeep from 'lodash/cloneDeep'
|
|
180
|
+
import get from "lodash/get"
|
|
181
|
+
import filter from 'lodash/filter'
|
|
182
|
+
import debounce from 'lodash/debounce'
|
|
183
|
+
import keys from 'lodash/keys'
|
|
184
|
+
import difference from 'lodash/difference'
|
|
185
|
+
|
|
179
186
|
import TopicItemGroup from './TopicItem.vue'
|
|
180
187
|
import RecentTermSearched from './RecentTermSearched.vue'
|
|
181
188
|
import SearchTopicsHeader from './header.vue'
|
|
182
|
-
import { cloneDeep, get, filter, debounce, keys, difference } from 'lodash'
|
|
183
189
|
import showDialogConfirmation from './helpers/showDialogConfirmation'
|
|
184
190
|
import showDiscardChangesDialog from './helpers/showDiscardChangesDialog'
|
|
185
191
|
import { errorHandler } from 'layers-utils'
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<span>{{ $options.methods.formatValue(props.value, props.schema) }}</span>
|
|
3
3
|
</template>
|
|
4
4
|
<script>
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import get from "lodash/get";
|
|
6
|
+
import dayjs from "dayjs"
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
props: ["value", "schema"],
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
formatValue(value, schema) {
|
|
12
12
|
if (!value) return "-"
|
|
13
13
|
const format = get(schema, 'options.format', 'dd/MM/yyyy hh:mm:ss')
|
|
14
|
-
return
|
|
14
|
+
return dayjs(value, { locale: 'pt-br' }).format(format)
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import flatten from "lodash/flatten";
|
|
2
|
+
import uniq from "lodash/uniq";
|
|
2
3
|
|
|
3
4
|
export function changeSelection({ key, selected }, tableComponent) {
|
|
4
5
|
let { loadedPages, allowInvertedSelection, includedIds, excludedIds, multiselect, itemToId = (id) => id } = tableComponent
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
2
|
+
import clone from "lodash/clone";
|
|
3
3
|
import { Tooltip } from "element-ui";
|
|
4
4
|
|
|
5
|
-
const Base =
|
|
5
|
+
const Base = clone(Tooltip);
|
|
6
6
|
delete Base.props.popperClass; // Hack to overwrite base component prop
|
|
7
7
|
|
|
8
8
|
export default {
|
package/src/main.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import lang from 'element-ui/lib/locale/lang/pt-br'
|
|
2
2
|
import locale from 'element-ui/lib/locale'
|
|
3
|
-
import
|
|
3
|
+
import 'dayjs/locale/pt-br'
|
|
4
|
+
import dayjs from 'dayjs'
|
|
5
|
+
import localizedFormatPlugin from 'dayjs/plugin/localizedFormat';
|
|
4
6
|
|
|
5
7
|
import './style/main.scss'
|
|
6
8
|
import Colors from './helpers/Colors'
|
|
@@ -29,7 +31,7 @@ LayersDesignSystem.install = function(Vue) {
|
|
|
29
31
|
Vue.use(RegisterElementUIComponents)
|
|
30
32
|
|
|
31
33
|
locale.use(lang)
|
|
32
|
-
|
|
34
|
+
dayjs.extend(localizedFormatPlugin)
|
|
33
35
|
|
|
34
36
|
Vue.mixin({
|
|
35
37
|
mounted() {
|
package/vue.config.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const HardSourceWebpackPlugin = require(
|
|
1
|
+
const HardSourceWebpackPlugin = require("hard-source-webpack-plugin");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
css: {
|
|
5
5
|
loaderOptions: {
|
|
6
6
|
sass: {
|
|
7
|
-
prependData: `@import "./src/style/main.scss"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
7
|
+
prependData: `@import "./src/style/main.scss";`,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
10
|
},
|
|
11
11
|
configureWebpack: {
|
|
12
|
-
plugins: [new HardSourceWebpackPlugin()]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
12
|
+
plugins: [new HardSourceWebpackPlugin()],
|
|
13
|
+
},
|
|
14
|
+
};
|