layers-design-system 2.3.0 → 2.5.1
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/dist/layers-design-system.js +78496 -0
- package/dist/layers-design-system.umd.cjs +285 -0
- package/dist/style.css +1 -0
- package/package.json +26 -12
- package/.nvmrc +0 -1
- package/babel.config.js +0 -5
- package/src/assets/button-text-editor/double-quotes.svg +0 -4
- package/src/assets/button-text-editor/remove-formatting.svg +0 -5
- package/src/assets/button-text-editor/title.svg +0 -4
- package/src/assets/failed-to-load/failed-to-load.svg +0 -60
- package/src/assets/l-presentation/external-apps.png +0 -0
- package/src/assets/l-presentation/notification.png +0 -0
- package/src/assets/search-topics/empty-tags.svg +0 -59
- package/src/components/LAlert/docs.vue +0 -81
- package/src/components/LAlert/index.vue +0 -43
- package/src/components/LAttachmentChip/docs.vue +0 -84
- package/src/components/LAttachmentChip/index.vue +0 -179
- package/src/components/LBox/docs.vue +0 -26
- package/src/components/LBox/index.vue +0 -19
- package/src/components/LBoxHeader/index.vue +0 -24
- package/src/components/LBreadcrumb/docs.vue +0 -21
- package/src/components/LBreadcrumb/index.vue +0 -22
- package/src/components/LBreadcrumbItem/index.vue +0 -7
- package/src/components/LButton/docs.vue +0 -205
- package/src/components/LButton/index.vue +0 -369
- package/src/components/LButtonGroup/index.vue +0 -7
- package/src/components/LCarousel/docs.vue +0 -32
- package/src/components/LCarousel/index.vue +0 -88
- package/src/components/LCheckbox/docs.vue +0 -62
- package/src/components/LCheckbox/index.vue +0 -34
- package/src/components/LCheckboxButton/index.vue +0 -30
- package/src/components/LCheckboxGroup/index.vue +0 -53
- package/src/components/LChip/docs.vue +0 -113
- package/src/components/LChip/index.vue +0 -78
- package/src/components/LCircularLoader/docs.vue +0 -30
- package/src/components/LCircularLoader/index.vue +0 -97
- package/src/components/LCollapse/docs.vue +0 -68
- package/src/components/LCollapse/index.vue +0 -13
- package/src/components/LCollapseItem/index.vue +0 -28
- package/src/components/LDatePicker/docs.vue +0 -66
- package/src/components/LDatePicker/index.vue +0 -63
- package/src/components/LDialog/docs.vue +0 -36
- package/src/components/LDialog/index.vue +0 -37
- package/src/components/LDropdown/index.vue +0 -7
- package/src/components/LDropdownItem/index.vue +0 -13
- package/src/components/LDropdownMenu/docs.vue +0 -44
- package/src/components/LDropdownMenu/index.vue +0 -12
- package/src/components/LFailedToLoad/docs.vue +0 -37
- package/src/components/LFailedToLoad/index.vue +0 -61
- package/src/components/LForm/index.vue +0 -7
- package/src/components/LFormItem/index.vue +0 -12
- package/src/components/LHelperBox/assets/link.svg +0 -4
- package/src/components/LHelperBox/assets/open-envelope.svg +0 -9
- package/src/components/LHelperBox/docs.vue +0 -29
- package/src/components/LHelperBox/index.vue +0 -83
- package/src/components/LIcon/docs.vue +0 -174
- package/src/components/LIcon/index.vue +0 -55
- package/src/components/LImage/index.vue +0 -7
- package/src/components/LImageViewer/docs.vue +0 -111
- package/src/components/LImageViewer/index.vue +0 -449
- package/src/components/LInput/docs.vue +0 -43
- package/src/components/LInput/index.vue +0 -60
- package/src/components/LLinearProgress/docs.vue +0 -21
- package/src/components/LLinearProgress/index.vue +0 -74
- package/src/components/LNotice/docs.vue +0 -26
- package/src/components/LNotice/index.vue +0 -86
- package/src/components/LNotification/index.vue +0 -182
- package/src/components/LOption/index.vue +0 -7
- package/src/components/LOptionGroup/index.vue +0 -7
- package/src/components/LPresentation/docs.vue +0 -35
- package/src/components/LPresentation/index.vue +0 -182
- package/src/components/LProgress/index.vue +0 -7
- package/src/components/LPromptDialog/index.vue +0 -82
- package/src/components/LRadio/docs.vue +0 -54
- package/src/components/LRadio/index.vue +0 -13
- package/src/components/LRadioButton/index.vue +0 -30
- package/src/components/LRadioGroup/index.vue +0 -54
- package/src/components/LSearchBar/AddFilterButton.vue +0 -71
- package/src/components/LSearchBar/Filters/Editors/AmountEditor.vue +0 -110
- package/src/components/LSearchBar/Filters/Editors/DateEditor.vue +0 -146
- package/src/components/LSearchBar/Filters/Editors/NumberEditor.vue +0 -141
- package/src/components/LSearchBar/Filters/Editors/StringEditor.vue +0 -140
- package/src/components/LSearchBar/Filters/Editors/index.js +0 -16
- package/src/components/LSearchBar/Filters/FilterChip.vue +0 -105
- package/src/components/LSearchBar/Filters/Views/AmountView.vue +0 -28
- package/src/components/LSearchBar/Filters/Views/DateView.vue +0 -46
- package/src/components/LSearchBar/Filters/Views/NumberView.vue +0 -24
- package/src/components/LSearchBar/Filters/Views/StringView.vue +0 -47
- package/src/components/LSearchBar/Filters/Views/index.js +0 -16
- package/src/components/LSearchBar/docs.vue +0 -60
- package/src/components/LSearchBar/index.vue +0 -240
- package/src/components/LSearchTopics/RecentTermSearched.vue +0 -30
- package/src/components/LSearchTopics/TopicItem.vue +0 -346
- package/src/components/LSearchTopics/docs/drawer.vue +0 -254
- package/src/components/LSearchTopics/docs.vue +0 -60
- package/src/components/LSearchTopics/header.vue +0 -199
- package/src/components/LSearchTopics/helpers/showDialogConfirmation.js +0 -30
- package/src/components/LSearchTopics/helpers/showDiscardChangesDialog.js +0 -27
- package/src/components/LSearchTopics/index.vue +0 -750
- package/src/components/LSelect/docs.vue +0 -129
- package/src/components/LSelect/index.vue +0 -9
- package/src/components/LSlider/index.vue +0 -7
- package/src/components/LSwitch/docs.vue +0 -24
- package/src/components/LSwitch/index.vue +0 -60
- package/src/components/LTabPane/index.vue +0 -7
- package/src/components/LTable/FieldTypes/AmountView.vue +0 -16
- package/src/components/LTable/FieldTypes/DateView.vue +0 -18
- package/src/components/LTable/FieldTypes/EmailView.vue +0 -8
- package/src/components/LTable/FieldTypes/NumberView.vue +0 -13
- package/src/components/LTable/FieldTypes/PaymentStatusView.vue +0 -8
- package/src/components/LTable/FieldTypes/StringView.vue +0 -24
- package/src/components/LTable/FieldTypes/index.js +0 -18
- package/src/components/LTable/LTableBody.vue +0 -245
- package/src/components/LTable/LTableBodySpacer.vue +0 -17
- package/src/components/LTable/LTableEndspace.vue +0 -20
- package/src/components/LTable/LTableHeader.vue +0 -155
- package/src/components/LTable/LTableHeaderCell.vue +0 -188
- package/src/components/LTable/LTableHeaderLoader.vue +0 -62
- package/src/components/LTable/LTableHeaderResizer.vue +0 -162
- package/src/components/LTable/LTableLoadMore.vue +0 -56
- package/src/components/LTable/LTablePagination.vue +0 -174
- package/src/components/LTable/LTableReloader.vue +0 -61
- package/src/components/LTable/ListAdapter.js +0 -74
- package/src/components/LTable/docs.vue +0 -111
- package/src/components/LTable/helpers.js +0 -194
- package/src/components/LTable/index.vue +0 -961
- package/src/components/LTabs/docs.vue +0 -28
- package/src/components/LTabs/index.vue +0 -37
- package/src/components/LTargetChip/docs.vue +0 -86
- package/src/components/LTargetChip/index.vue +0 -64
- package/src/components/LTargetInput/docs.vue +0 -72
- package/src/components/LTargetInput/index.vue +0 -78
- package/src/components/LTextEditor/FloatingLink.vue +0 -91
- package/src/components/LTextEditor/LinkBox.vue +0 -94
- package/src/components/LTextEditor/docs.vue +0 -32
- package/src/components/LTextEditor/extensions/LayersBlockquote.js +0 -12
- package/src/components/LTextEditor/extensions/LayersBold.js +0 -11
- package/src/components/LTextEditor/extensions/LayersBreakLine.js +0 -16
- package/src/components/LTextEditor/extensions/LayersBubbleMenu.js +0 -10
- package/src/components/LTextEditor/extensions/LayersBulletList.js +0 -12
- package/src/components/LTextEditor/extensions/LayersHeading.js +0 -13
- package/src/components/LTextEditor/extensions/LayersHistory.js +0 -10
- package/src/components/LTextEditor/extensions/LayersItalic.js +0 -11
- package/src/components/LTextEditor/extensions/LayersLink.js +0 -29
- package/src/components/LTextEditor/extensions/LayersOrderedList.js +0 -12
- package/src/components/LTextEditor/extensions/LayersParagraph.js +0 -44
- package/src/components/LTextEditor/extensions/LayersPlaceholder.js +0 -11
- package/src/components/LTextEditor/extensions/LayersUnderline.js +0 -29
- package/src/components/LTextEditor/helpers/addProtocol.js +0 -5
- package/src/components/LTextEditor/helpers/removeEmptyTags.js +0 -5
- package/src/components/LTextEditor/index.vue +0 -421
- package/src/components/LTimeSelect/docs.vue +0 -41
- package/src/components/LTimeSelect/index.vue +0 -49
- package/src/components/LToggleButtonGroup/index.vue +0 -87
- package/src/components/LTooltip/docs.vue +0 -66
- package/src/components/LTooltip/index.vue +0 -28
- package/src/components/LTransitionExpand/docs.vue +0 -26
- package/src/components/LTransitionExpand/index.vue +0 -88
- package/src/components/LUpload/index.vue +0 -7
- package/src/docs/Colors.vue +0 -50
- package/src/docs/Home.vue +0 -11
- package/src/docs/Notifications.vue +0 -88
- package/src/docs/index.vue +0 -76
- package/src/docs/routes.js +0 -20
- package/src/helpers/Colors.js +0 -79
- package/src/helpers/FieldTypeComponents.js +0 -43
- package/src/helpers/Icons.js +0 -67
- package/src/helpers/Notification.js +0 -94
- package/src/helpers/PrettySize.js +0 -25
- package/src/helpers/RegisterElementUIComponents.js +0 -9
- package/src/helpers/Schemas.js +0 -18
- package/src/helpers/util.js +0 -15
- package/src/main-docs.js +0 -132
- package/src/main.js +0 -101
- package/src/style/colors.scss +0 -31
- package/src/style/element-variables.scss +0 -21
- package/src/style/icons.scss +0 -5
- package/src/style/layers-variables.scss +0 -73
- package/src/style/layout.scss +0 -2288
- package/src/style/main.scss +0 -11
- package/src/style/notifications.scss +0 -88
- package/src/style/transitions.scss +0 -43
- package/src/style/typography.scss +0 -155
- package/vue.config.js +0 -14
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/index.html +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { getColor } from '../../helpers/Colors'
|
|
3
|
-
|
|
4
|
-
import { RadioGroup } from 'element-ui';
|
|
5
|
-
|
|
6
|
-
import clone from 'lodash/clone'
|
|
7
|
-
const Base = clone(RadioGroup);
|
|
8
|
-
delete Base.props.fill;
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
tagName: 'l-radio-group',
|
|
12
|
-
extends: RadioGroup,
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
separated: { type: Boolean, default: () => false },
|
|
16
|
-
color: { type: String, default: () => 'primary' },
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
computed: {
|
|
20
|
-
fill() {
|
|
21
|
-
return getColor(this.$options.propsData.color)
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
mounted() {
|
|
26
|
-
if(this.separated) {
|
|
27
|
-
this.$el.classList.add("l-radio-group-separated")
|
|
28
|
-
|
|
29
|
-
if(this.$el.children && this.$el.children.length) {
|
|
30
|
-
Array.from(this.$el.children).forEach(child => child.classList.add("l-radio-button-separated"))
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<style type="text/css">
|
|
38
|
-
.l-radio-group.l-radio-group-separated {
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
flex-wrap: wrap;
|
|
41
|
-
margin: -0.5rem 0 0 -0.5rem;
|
|
42
|
-
width: calc(100% + 0.5rem);
|
|
43
|
-
}
|
|
44
|
-
.l-radio-group.l-radio-group-separated > * {
|
|
45
|
-
margin: 0.5rem 0 0 0.5rem;
|
|
46
|
-
}
|
|
47
|
-
.l-radio-group.l-radio-group-separated .l-radio-button .el-radio-button__inner {
|
|
48
|
-
border: 1px solid var(--color-gray-70)!important;
|
|
49
|
-
border-radius: 4px!important;
|
|
50
|
-
}
|
|
51
|
-
.l-radio-group .l-radio-button .el-radio-button__orig-radio:checked + .el-radio-button__inner{
|
|
52
|
-
border: 1px solid transparent!important;
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<l-dropdown trigger="click" placement="bottom-start" @command="addFilter">
|
|
3
|
-
<l-button
|
|
4
|
-
class="add-filter-button"
|
|
5
|
-
round
|
|
6
|
-
plain
|
|
7
|
-
size="small"
|
|
8
|
-
v-show="availableOptions.length > 0"
|
|
9
|
-
>
|
|
10
|
-
<l-icon style="margin-right: 4px">uil-plus</l-icon>Adicionar filtro
|
|
11
|
-
</l-button>
|
|
12
|
-
<l-dropdown-menu slot="dropdown">
|
|
13
|
-
<l-tooltip
|
|
14
|
-
:disabled="!option.description"
|
|
15
|
-
:content="option.description"
|
|
16
|
-
effect="light"
|
|
17
|
-
:open-delay="600"
|
|
18
|
-
placement="right-start"
|
|
19
|
-
v-for="option in availableOptions"
|
|
20
|
-
:key="option.title"
|
|
21
|
-
>
|
|
22
|
-
<l-dropdown-item
|
|
23
|
-
:icon="$L.Icons.get(option)"
|
|
24
|
-
:key="option.title"
|
|
25
|
-
:command="option"
|
|
26
|
-
:disabled="hasFilterFor(option.path)"
|
|
27
|
-
>{{ option.title }}</l-dropdown-item>
|
|
28
|
-
</l-tooltip>
|
|
29
|
-
</l-dropdown-menu>
|
|
30
|
-
</l-dropdown>
|
|
31
|
-
</template>
|
|
32
|
-
<script>
|
|
33
|
-
|
|
34
|
-
import find from "lodash/find"
|
|
35
|
-
import get from "lodash/get"
|
|
36
|
-
import filter from "lodash/filter"
|
|
37
|
-
|
|
38
|
-
export default {
|
|
39
|
-
name: "AddFilterButton",
|
|
40
|
-
props: ["schema", "filters"],
|
|
41
|
-
methods: {
|
|
42
|
-
addFilter(option) {
|
|
43
|
-
const filter = {
|
|
44
|
-
path: option.path,
|
|
45
|
-
value: null,
|
|
46
|
-
comparison: null,
|
|
47
|
-
valid: false,
|
|
48
|
-
};
|
|
49
|
-
this.$emit("addFilter", filter);
|
|
50
|
-
},
|
|
51
|
-
hasFilterFor(path) {
|
|
52
|
-
return find(this.filters, { path });
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
computed: {
|
|
56
|
-
availableOptions() {
|
|
57
|
-
if (!get(this.schema, "fields", []).length === 0) return [];
|
|
58
|
-
|
|
59
|
-
return filter(
|
|
60
|
-
this.schema.fields,
|
|
61
|
-
option => option.filterable && !this.hasFilterFor(option.path)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
</script>
|
|
67
|
-
<style>
|
|
68
|
-
.add-filter-button {
|
|
69
|
-
border-style: dashed;
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<l-form :model="form" :rules="rules" ref="form" @submit.prevent.native>
|
|
3
|
-
<div><l-icon>{{ $L.Icons.get(schema) }}</l-icon> {{ schema.title }}</div>
|
|
4
|
-
<br>
|
|
5
|
-
|
|
6
|
-
<l-form-item prop="value">
|
|
7
|
-
<el-input
|
|
8
|
-
ref="valueInput"
|
|
9
|
-
v-model="inputValue"
|
|
10
|
-
size="small"
|
|
11
|
-
@change="changeInput"
|
|
12
|
-
>
|
|
13
|
-
<template slot="prepend">R$</template>
|
|
14
|
-
</el-input>
|
|
15
|
-
</l-form-item>
|
|
16
|
-
|
|
17
|
-
<l-form-item prop="comparison">
|
|
18
|
-
<l-radio v-model="form.comparison" label="gt">Maior que</l-radio>
|
|
19
|
-
<br />
|
|
20
|
-
<l-radio v-model="form.comparison" label="gte">Maior que ou igual a</l-radio>
|
|
21
|
-
<br />
|
|
22
|
-
<l-radio v-model="form.comparison" label="eq">Igual a</l-radio>
|
|
23
|
-
<br />
|
|
24
|
-
<l-radio v-model="form.comparison" label="lt">Menor que</l-radio>
|
|
25
|
-
<br />
|
|
26
|
-
<l-radio v-model="form.comparison" label="lte">Menor que ou igual a</l-radio>
|
|
27
|
-
</l-form-item>
|
|
28
|
-
|
|
29
|
-
<div style="text-align: right">
|
|
30
|
-
<l-button plain size="small" @click="cancel">Cancelar</l-button>
|
|
31
|
-
<l-button type="primary" size="small" @click="save">Buscar</l-button>
|
|
32
|
-
</div>
|
|
33
|
-
</l-form>
|
|
34
|
-
</template>
|
|
35
|
-
<script>
|
|
36
|
-
import Vue from "vue";
|
|
37
|
-
import currency from 'currency.js'
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
model: {
|
|
41
|
-
prop: "filter",
|
|
42
|
-
event: "change"
|
|
43
|
-
},
|
|
44
|
-
props: ["filter", "schema"],
|
|
45
|
-
data() {
|
|
46
|
-
return {
|
|
47
|
-
form: {
|
|
48
|
-
value: this.filter.value,
|
|
49
|
-
comparison: this.filter.comparison || "gt"
|
|
50
|
-
},
|
|
51
|
-
inputValue: this.formatValue(this.filter.value)
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
methods: {
|
|
55
|
-
focus() {
|
|
56
|
-
this.$refs.valueInput.focus()
|
|
57
|
-
},
|
|
58
|
-
formatValue(amount) {
|
|
59
|
-
if (!amount) return "0,00"
|
|
60
|
-
return (amount / 100).toFixed(2).replace(".", ",")
|
|
61
|
-
},
|
|
62
|
-
getAmount(value) {
|
|
63
|
-
if (!value) return 0
|
|
64
|
-
return currency(value, { decimal: ','}).intValue
|
|
65
|
-
},
|
|
66
|
-
changeInput() {
|
|
67
|
-
this.form.value = this.getAmount(this.inputValue)
|
|
68
|
-
this.inputValue = this.formatValue(this.form.value)
|
|
69
|
-
},
|
|
70
|
-
validate(callback) {
|
|
71
|
-
return this.$refs.form.validate(callback);
|
|
72
|
-
},
|
|
73
|
-
save() {
|
|
74
|
-
this.$refs.form.validate(valid => {
|
|
75
|
-
if (valid) {
|
|
76
|
-
Vue.set(this.filter, "valid", valid);
|
|
77
|
-
Vue.set(this.filter, "value", this.form.value);
|
|
78
|
-
Vue.set(this.filter, "comparison", this.form.comparison);
|
|
79
|
-
this.$emit("change", this.filter);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
cancel() {
|
|
84
|
-
this.form.value = this.filter.value;
|
|
85
|
-
this.form.comparison = this.filter.comparison;
|
|
86
|
-
this.$emit("cancel");
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
computed: {
|
|
90
|
-
rules() {
|
|
91
|
-
return {
|
|
92
|
-
value: [
|
|
93
|
-
{
|
|
94
|
-
required: true,
|
|
95
|
-
message: `Digite para filtrar ${this.schema.title}`,
|
|
96
|
-
trigger: "change"
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
comparison: [
|
|
100
|
-
{
|
|
101
|
-
required: true,
|
|
102
|
-
message: `Escolha um modo para filtrar ${this.schema.title}`,
|
|
103
|
-
trigger: "change"
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
</script>
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<l-form :model="form" :rules="rules" ref="form" @submit.prevent.native>
|
|
3
|
-
<div>
|
|
4
|
-
<l-icon>{{ $L.Icons.get(schema) }}</l-icon>
|
|
5
|
-
{{ schema.title }}
|
|
6
|
-
</div>
|
|
7
|
-
<br>
|
|
8
|
-
|
|
9
|
-
<l-form-item prop="comparison">
|
|
10
|
-
<strong>Relativo - Passado</strong>
|
|
11
|
-
<div v-for="option in relativePastComparisons" :key="option.value">
|
|
12
|
-
<l-radio v-model="form.comparison" :label="option.value">{{ option.label }}</l-radio>
|
|
13
|
-
<l-form-item prop="value" v-if="form.comparison == option.value" style="margin-left: 24px; margin-bottom: 8px">
|
|
14
|
-
<div class="row">
|
|
15
|
-
<l-input type="number" min="1" ref="valueInput" v-model.number="form.value" size="small"/>
|
|
16
|
-
<div style="margin-left: 8px; white-space: nowrap;">{{ form.value > 1 ? 'dias' : 'dia' }}</div>
|
|
17
|
-
</div>
|
|
18
|
-
</l-form-item>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<strong>Relativo - Futuro</strong>
|
|
22
|
-
<div v-for="option in relativeFutureComparisons" :key="option.value">
|
|
23
|
-
<l-radio v-model="form.comparison" :label="option.value">{{ option.label }}</l-radio>
|
|
24
|
-
<l-form-item prop="value" v-if="form.comparison == option.value" style="margin-left: 24px; margin-bottom: 8px">
|
|
25
|
-
<div class="row">
|
|
26
|
-
<l-input type="number" min="1" ref="valueInput" v-model.number="form.value" size="small"/>
|
|
27
|
-
<div style="margin-left: 8px; white-space: nowrap;">{{ form.value > 1 ? 'dias' : 'dia' }}</div>
|
|
28
|
-
</div>
|
|
29
|
-
</l-form-item>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<strong>Absoluto</strong>
|
|
33
|
-
<div v-for="option in absoluteComparisons" :key="option.value">
|
|
34
|
-
<l-radio v-model="form.comparison" :label="option.value">{{ option.label }}</l-radio>
|
|
35
|
-
<l-form-item prop="value" v-if="form.comparison == option.value" style="margin-left: 24px; margin-bottom: 8px">
|
|
36
|
-
<div class="row">
|
|
37
|
-
<l-date-picker v-model="form.value"></l-date-picker>
|
|
38
|
-
<div style="margin-left: 8px; white-space: nowrap;"></div>
|
|
39
|
-
</div>
|
|
40
|
-
</l-form-item>
|
|
41
|
-
</div>
|
|
42
|
-
</l-form-item>
|
|
43
|
-
|
|
44
|
-
<div style="text-align: right">
|
|
45
|
-
<l-button plain size="small" @click="cancel">Cancelar</l-button>
|
|
46
|
-
<l-button type="primary" size="small" @click="save">Buscar</l-button>
|
|
47
|
-
</div>
|
|
48
|
-
</l-form>
|
|
49
|
-
</template>
|
|
50
|
-
<script>
|
|
51
|
-
import Vue from "vue";
|
|
52
|
-
|
|
53
|
-
export default {
|
|
54
|
-
model: {
|
|
55
|
-
prop: "filter",
|
|
56
|
-
event: "change"
|
|
57
|
-
},
|
|
58
|
-
props: ["filter", "schema"],
|
|
59
|
-
data() {
|
|
60
|
-
return {
|
|
61
|
-
form: {
|
|
62
|
-
value: this.filter.value,
|
|
63
|
-
comparison: this.filter.comparison || "relative_past_gte"
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
watch: {
|
|
68
|
-
"form.comparison": {
|
|
69
|
-
handler(newValue, oldValue) {
|
|
70
|
-
if (oldValue.indexOf("relative_") === 0 && newValue.indexOf("absolute_") === 0) {
|
|
71
|
-
this.form.value = new Date()
|
|
72
|
-
} else if (oldValue.indexOf("absolute_") === 0 && newValue.indexOf("relative_") === 0) {
|
|
73
|
-
this.form.value = 1
|
|
74
|
-
}
|
|
75
|
-
this.$nextTick(() => this.focus());
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
methods: {
|
|
80
|
-
focus() {
|
|
81
|
-
if (this.$refs.valueInput && this.$refs.valueInput.length > 0) {
|
|
82
|
-
this.$refs.valueInput[0].focus();
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
validate(callback) {
|
|
86
|
-
return this.$refs.form.validate(callback);
|
|
87
|
-
},
|
|
88
|
-
save() {
|
|
89
|
-
this.$refs.form.validate(valid => {
|
|
90
|
-
if (valid) {
|
|
91
|
-
Vue.set(this.filter, "valid", valid);
|
|
92
|
-
Vue.set(this.filter, "value", this.form.value);
|
|
93
|
-
Vue.set(this.filter, "comparison", this.form.comparison);
|
|
94
|
-
this.$emit("change", this.filter);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
},
|
|
98
|
-
cancel() {
|
|
99
|
-
this.form.value = this.filter.value;
|
|
100
|
-
this.form.comparison = this.filter.comparison;
|
|
101
|
-
this.$emit("cancel");
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
computed: {
|
|
105
|
-
relativePastComparisons() {
|
|
106
|
-
return [
|
|
107
|
-
{ label: "Há menos de", value: "relative_past_gte" },
|
|
108
|
-
{ label: "Há mais de", value: "relative_past_lt" },
|
|
109
|
-
{ label: "Há exatamente", value: "relative_past_eq" },
|
|
110
|
-
]
|
|
111
|
-
},
|
|
112
|
-
relativeFutureComparisons() {
|
|
113
|
-
return [
|
|
114
|
-
{ label: "Daqui a mais de", value: "relative_future_gte" },
|
|
115
|
-
{ label: "Daqui a menos de", value: "relative_future_lt" },
|
|
116
|
-
{ label: "Daqui a exatamente", value: "relative_future_eq" },
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
absoluteComparisons() {
|
|
120
|
-
return [
|
|
121
|
-
{ label: "Em", value: "absolute_eq" },
|
|
122
|
-
{ label: "A partir de", value: "absolute_gte" },
|
|
123
|
-
{ label: "Até", value: "absolute_lt" },
|
|
124
|
-
];
|
|
125
|
-
},
|
|
126
|
-
rules() {
|
|
127
|
-
return {
|
|
128
|
-
value: [
|
|
129
|
-
{
|
|
130
|
-
required: true,
|
|
131
|
-
message: `Digite para filtrar ${this.schema.title}`,
|
|
132
|
-
trigger: "change"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
comparison: [
|
|
136
|
-
{
|
|
137
|
-
required: true,
|
|
138
|
-
message: `Escolha um modo para filtrar ${this.schema.title}`,
|
|
139
|
-
trigger: "change"
|
|
140
|
-
}
|
|
141
|
-
]
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
</script>
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<l-form :model="form" :rules="rules" ref="form" @submit.prevent.native>
|
|
3
|
-
<div>
|
|
4
|
-
<l-icon>{{ $L.Icons.get(schema) }}</l-icon>
|
|
5
|
-
{{ schema.title }}
|
|
6
|
-
</div>
|
|
7
|
-
<br />
|
|
8
|
-
|
|
9
|
-
<template v-if="valuesEnum">
|
|
10
|
-
<l-form-item prop="value">
|
|
11
|
-
<l-checkbox-group v-model="form.value">
|
|
12
|
-
<div v-for="value of valuesEnum" :key="value">
|
|
13
|
-
<l-checkbox :label="value">
|
|
14
|
-
<component v-if="inlineComponent" v-bind:is="inlineComponent" :value="value" :schema="schema"></component>
|
|
15
|
-
<span v-else v-text="value"></span>
|
|
16
|
-
</l-checkbox>
|
|
17
|
-
</div>
|
|
18
|
-
</l-checkbox-group>
|
|
19
|
-
</l-form-item>
|
|
20
|
-
</template>
|
|
21
|
-
<template v-else>
|
|
22
|
-
<l-form-item prop="comparison">
|
|
23
|
-
<div v-for="option in comparisons" :key="option.value">
|
|
24
|
-
<l-radio v-model="form.comparison" :label="option.value">{{ option.label }}</l-radio>
|
|
25
|
-
<l-form-item
|
|
26
|
-
prop="value"
|
|
27
|
-
v-if="form.comparison == option.value"
|
|
28
|
-
style="margin-left: 24px; margin-bottom: 8px"
|
|
29
|
-
>
|
|
30
|
-
<l-input ref="valueInput" type="number" v-model.number="form.value" />
|
|
31
|
-
</l-form-item>
|
|
32
|
-
</div>
|
|
33
|
-
</l-form-item>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<div style="text-align: right">
|
|
37
|
-
<l-button plain size="small" @click="cancel">Cancelar</l-button>
|
|
38
|
-
<l-button type="primary" size="small" @click="save">Buscar</l-button>
|
|
39
|
-
</div>
|
|
40
|
-
</l-form>
|
|
41
|
-
</template>
|
|
42
|
-
<script>
|
|
43
|
-
import Vue from "vue";
|
|
44
|
-
import get from "lodash/get";
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
model: {
|
|
48
|
-
prop: "filter",
|
|
49
|
-
event: "change"
|
|
50
|
-
},
|
|
51
|
-
props: ["filter", "schema"],
|
|
52
|
-
data() {
|
|
53
|
-
if (get(this.schema, "options.enum")) {
|
|
54
|
-
return {
|
|
55
|
-
form: {
|
|
56
|
-
value: this.filter.value || [],
|
|
57
|
-
comparison: this.filter.comparison || "in"
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
form: {
|
|
63
|
-
value: this.filter.value,
|
|
64
|
-
comparison: this.filter.comparison || "gte"
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
watch: {
|
|
69
|
-
"form.comparison": {
|
|
70
|
-
handler() {
|
|
71
|
-
this.$nextTick(() => this.focus());
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
focus() {
|
|
77
|
-
if (this.$refs.valueInput) {
|
|
78
|
-
this.$refs.valueInput[0].focus();
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
validate(callback) {
|
|
82
|
-
return this.$refs.form.validate(callback);
|
|
83
|
-
},
|
|
84
|
-
save() {
|
|
85
|
-
this.$refs.form.validate(valid => {
|
|
86
|
-
if (valid) {
|
|
87
|
-
Vue.set(this.filter, "valid", valid);
|
|
88
|
-
Vue.set(this.filter, "value", this.form.value);
|
|
89
|
-
Vue.set(this.filter, "comparison", this.form.comparison);
|
|
90
|
-
this.$emit("change", this.filter);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
cancel() {
|
|
95
|
-
this.form.value = this.filter.value;
|
|
96
|
-
this.form.comparison = this.filter.comparison;
|
|
97
|
-
this.$emit("cancel");
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
computed: {
|
|
101
|
-
valuesEnum() {
|
|
102
|
-
return get(this.schema, "options.enum");
|
|
103
|
-
},
|
|
104
|
-
inlineComponent() {
|
|
105
|
-
try {
|
|
106
|
-
return this.$L.FieldTypeComponents.get(this.schema, 'default');
|
|
107
|
-
} catch (e) {
|
|
108
|
-
return null // Ignore error
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
comparisons() {
|
|
112
|
-
return [
|
|
113
|
-
{ label: "Menor que", value: "lt" },
|
|
114
|
-
{ label: "Menor ou igual a", value: "lte" },
|
|
115
|
-
{ label: "Maior que", value: "gt" },
|
|
116
|
-
{ label: "Maior ou igual a", value: "gte" },
|
|
117
|
-
{ label: "Igual a", value: "eq" },
|
|
118
|
-
{ label: "Diferente de", value: "neq" }
|
|
119
|
-
];
|
|
120
|
-
},
|
|
121
|
-
rules() {
|
|
122
|
-
return {
|
|
123
|
-
value: [
|
|
124
|
-
{
|
|
125
|
-
required: true,
|
|
126
|
-
message: `Escolha para filtrar ${this.schema.title}`,
|
|
127
|
-
trigger: "change"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
comparison: [
|
|
131
|
-
{
|
|
132
|
-
required: true,
|
|
133
|
-
message: `Escolha um modo para filtrar ${this.schema.title}`,
|
|
134
|
-
trigger: "change"
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
</script>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<l-form :model="form" :rules="rules" ref="form" @submit.prevent.native>
|
|
3
|
-
<div>
|
|
4
|
-
<l-icon>{{ $L.Icons.get(schema) }}</l-icon>
|
|
5
|
-
{{ schema.title }}
|
|
6
|
-
</div>
|
|
7
|
-
<br />
|
|
8
|
-
|
|
9
|
-
<template v-if="valuesEnum">
|
|
10
|
-
<l-form-item prop="value">
|
|
11
|
-
<l-checkbox-group v-model="form.value">
|
|
12
|
-
<div v-for="value of valuesEnum" :key="value">
|
|
13
|
-
<l-checkbox :label="value">
|
|
14
|
-
<component v-if="inlineComponent" v-bind:is="inlineComponent" :value="value" :schema="schema"></component>
|
|
15
|
-
<span v-else v-text="value"></span>
|
|
16
|
-
</l-checkbox>
|
|
17
|
-
</div>
|
|
18
|
-
</l-checkbox-group>
|
|
19
|
-
</l-form-item>
|
|
20
|
-
</template>
|
|
21
|
-
<template v-else>
|
|
22
|
-
<l-form-item prop="comparison">
|
|
23
|
-
<div v-for="option in comparisons" :key="option.value">
|
|
24
|
-
<l-radio v-model="form.comparison" :label="option.value">{{ option.label }}</l-radio>
|
|
25
|
-
<l-form-item
|
|
26
|
-
prop="value"
|
|
27
|
-
v-if="form.comparison == option.value"
|
|
28
|
-
style="margin-left: 24px; margin-bottom: 8px"
|
|
29
|
-
>
|
|
30
|
-
<l-input ref="valueInput" v-model="form.value" />
|
|
31
|
-
</l-form-item>
|
|
32
|
-
</div>
|
|
33
|
-
</l-form-item>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<div style="text-align: right">
|
|
37
|
-
<l-button plain size="small" @click="cancel">Cancelar</l-button>
|
|
38
|
-
<l-button type="primary" size="small" @click="save">Buscar</l-button>
|
|
39
|
-
</div>
|
|
40
|
-
</l-form>
|
|
41
|
-
</template>
|
|
42
|
-
<script>
|
|
43
|
-
import Vue from "vue";
|
|
44
|
-
import get from "lodash/get";
|
|
45
|
-
|
|
46
|
-
export default {
|
|
47
|
-
model: {
|
|
48
|
-
prop: "filter",
|
|
49
|
-
event: "change"
|
|
50
|
-
},
|
|
51
|
-
props: ["filter", "schema"],
|
|
52
|
-
data() {
|
|
53
|
-
if (get(this.schema, "options.enum")) {
|
|
54
|
-
return {
|
|
55
|
-
form: {
|
|
56
|
-
value: this.filter.value || [],
|
|
57
|
-
comparison: this.filter.comparison || "in"
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
form: {
|
|
63
|
-
value: this.filter.value,
|
|
64
|
-
comparison: this.filter.comparison || "contains"
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
watch: {
|
|
69
|
-
"form.comparison": {
|
|
70
|
-
handler() {
|
|
71
|
-
this.$nextTick(() => this.focus());
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
methods: {
|
|
76
|
-
focus() {
|
|
77
|
-
if (this.$refs.valueInput) {
|
|
78
|
-
this.$refs.valueInput[0].focus();
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
validate(callback) {
|
|
82
|
-
return this.$refs.form.validate(callback);
|
|
83
|
-
},
|
|
84
|
-
save() {
|
|
85
|
-
this.$refs.form.validate(valid => {
|
|
86
|
-
if (valid) {
|
|
87
|
-
Vue.set(this.filter, "valid", valid);
|
|
88
|
-
Vue.set(this.filter, "value", this.form.value);
|
|
89
|
-
Vue.set(this.filter, "comparison", this.form.comparison);
|
|
90
|
-
this.$emit("change", this.filter);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
cancel() {
|
|
95
|
-
this.form.value = this.filter.value;
|
|
96
|
-
this.form.comparison = this.filter.comparison;
|
|
97
|
-
this.$emit("cancel");
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
computed: {
|
|
101
|
-
valuesEnum() {
|
|
102
|
-
return get(this.schema, "options.enum");
|
|
103
|
-
},
|
|
104
|
-
inlineComponent() {
|
|
105
|
-
try {
|
|
106
|
-
return this.$L.FieldTypeComponents.get(this.schema, 'default');
|
|
107
|
-
} catch (e) {
|
|
108
|
-
return null // Ignore error
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
comparisons() {
|
|
112
|
-
return [
|
|
113
|
-
{ label: "Contém", value: "contains" },
|
|
114
|
-
{ label: "Começa com", value: "starts_with" },
|
|
115
|
-
{ label: "Termina com", value: "ends_with" },
|
|
116
|
-
{ label: "É exatamente", value: "eq" },
|
|
117
|
-
{ label: "Não é", value: "neq" }
|
|
118
|
-
];
|
|
119
|
-
},
|
|
120
|
-
rules() {
|
|
121
|
-
return {
|
|
122
|
-
value: [
|
|
123
|
-
{
|
|
124
|
-
required: true,
|
|
125
|
-
message: `Escolha para filtrar ${this.schema.title}`,
|
|
126
|
-
trigger: "change"
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
comparison: [
|
|
130
|
-
{
|
|
131
|
-
required: true,
|
|
132
|
-
message: `Escolha um modo para filtrar ${this.schema.title}`,
|
|
133
|
-
trigger: "change"
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
</script>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import StringEditor from "./StringEditor.vue";
|
|
2
|
-
import AmountEditor from "./AmountEditor.vue";
|
|
3
|
-
import NumberEditor from "./NumberEditor.vue";
|
|
4
|
-
import DateEditor from "./DateEditor.vue";
|
|
5
|
-
|
|
6
|
-
import { FieldTypeComponents } from '../../../../helpers/FieldTypeComponents'
|
|
7
|
-
|
|
8
|
-
const Editors = {}
|
|
9
|
-
Editors.register = function () {
|
|
10
|
-
FieldTypeComponents.register({ type: 'String' }, 'filterChipEditor', StringEditor);
|
|
11
|
-
FieldTypeComponents.register({ type: 'Number' }, 'filterChipEditor', NumberEditor);
|
|
12
|
-
FieldTypeComponents.register({ type: 'Date' }, 'filterChipEditor', DateEditor);
|
|
13
|
-
|
|
14
|
-
FieldTypeComponents.register({ format: 'Amount' }, 'filterChipEditor', AmountEditor);
|
|
15
|
-
}
|
|
16
|
-
export default Editors
|