@tagplus/components 5.3.2 → 5.3.4
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/demo.html +1 -0
- package/dist/fonts/bevi-bold.7e4dcd11.woff +0 -0
- package/dist/fonts/bevi-bold.873def84.woff2 +0 -0
- package/dist/fonts/bevi-medium.6187e050.woff2 +0 -0
- package/dist/fonts/bevi-medium.65b3056d.woff +0 -0
- package/dist/fonts/bevi-regular.c89f126e.woff +0 -0
- package/dist/fonts/bevi-regular.f81e4b8f.woff2 +0 -0
- package/dist/tp.common.js +2 -0
- package/dist/tp.common.js.map +1 -0
- package/dist/tp.css +167 -0
- package/dist/tp.umd.js +2 -0
- package/dist/tp.umd.js.map +1 -0
- package/dist/tp.umd.min.js +2 -0
- package/dist/tp.umd.min.js.map +1 -0
- package/package.json +61 -74
- package/src/assets/scss/_fonts.scss +27 -0
- package/src/assets/scss/_functions.scss +22 -0
- package/src/assets/scss/_helpers.scss +112 -0
- package/src/assets/scss/_mixins.scss +69 -0
- package/src/assets/scss/_overrides.scss +69 -0
- package/src/assets/scss/_resass.scss +83 -0
- package/src/assets/scss/_variables.scss +27 -0
- package/src/assets/scss/index.scss +11 -0
- package/src/components/Autosuggest/Autosuggest.vue +791 -0
- package/src/components/Autosuggest/index.js +3 -0
- package/src/components/Dialog/Dialog.vue +253 -0
- package/src/components/Dialog/index.js +3 -0
- package/src/components/Inline/Inline.vue +149 -0
- package/src/components/Inline/index.js +3 -0
- package/src/components/InputNumber/InputNumber.vue +430 -0
- package/src/components/InputNumber/index.js +3 -0
- package/src/components/Loader/Loader.vue +317 -0
- package/src/components/Loader/animations.scss +68 -0
- package/src/components/Loader/index.js +3 -0
- package/src/components/Money/Money.vue +82 -0
- package/src/components/Money/index.js +3 -0
- package/src/components/Multisuggest/Multisuggest.vue +858 -0
- package/src/components/Multisuggest/index.js +3 -0
- package/src/components/OptionsList/OptionsList.vue +61 -0
- package/src/components/OptionsList/index.js +3 -0
- package/src/components/OptionsListItem/OptionsListItem.vue +191 -0
- package/src/components/OptionsListItem/index.js +3 -0
- package/src/components/Percent/Percent.vue +81 -0
- package/src/components/Percent/index.js +3 -0
- package/src/components/Skeleton/Skeleton.vue +137 -0
- package/src/components/Skeleton/index.js +3 -0
- package/src/components/Step/Step.vue +230 -0
- package/src/components/Step/index.js +3 -0
- package/src/components/Steps/Steps.vue +18 -0
- package/src/components/Steps/index.js +3 -0
- package/src/components/Tip/Tip.vue +193 -0
- package/src/components/Tip/index.js +3 -0
- package/src/components/index.js +31 -0
- package/src/locale/index.js +78 -0
- package/{dist → src/locale}/lang/en.js +2 -3
- package/{dist → src/locale}/lang/pt-br.js +2 -3
- package/src/main.js +26 -0
- package/src/mixins/floatFormatter.js +53 -0
- package/src/mixins/locale.js +9 -0
- package/src/utils/currency.js +180 -0
- package/src/utils/filters.js +84 -0
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +0 -10
- package/dist/es/components.css +0 -2391
- package/dist/es/node_modules/@element-plus/icons-vue/dist/index.mjs +0 -148
- package/dist/es/node_modules/@popperjs/core/lib/enums.mjs +0 -22
- package/dist/es/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +0 -28
- package/dist/es/node_modules/@vueuse/core/index.mjs +0 -172
- package/dist/es/node_modules/@vueuse/shared/index.mjs +0 -68
- package/dist/es/node_modules/element-plus/es/constants/size.mjs +0 -4
- package/dist/es/node_modules/element-plus/es/hooks/use-focus-controller/index.mjs +0 -64
- package/dist/es/node_modules/element-plus/es/hooks/use-id/index.mjs +0 -30
- package/dist/es/node_modules/element-plus/es/hooks/use-locale/index.mjs +0 -29
- package/dist/es/node_modules/element-plus/es/hooks/use-namespace/index.mjs +0 -79
- package/dist/es/node_modules/element-plus/es/hooks/use-prop/index.mjs +0 -11
- package/dist/es/node_modules/element-plus/es/hooks/use-size/index.mjs +0 -20
- package/dist/es/node_modules/element-plus/es/locale/lang/en.mjs +0 -182
- package/dist/es/node_modules/element-plus/es/utils/error.mjs +0 -16
- package/dist/es/node_modules/element-plus/es/utils/types.mjs +0 -9
- package/dist/es/node_modules/element-plus/es/utils/vue/props/runtime.mjs +0 -42
- package/dist/es/src/components/Autosuggest/Autosuggest.vue.mjs +0 -446
- package/dist/es/src/components/Autosuggest/Multisuggest.vue.mjs +0 -17
- package/dist/es/src/components/Autosuggest/autosuggest-props.mjs +0 -204
- package/dist/es/src/components/Autosuggest/core.mjs +0 -56
- package/dist/es/src/components/Autosuggest/multisuggest-props.mjs +0 -11
- package/dist/es/src/components/Autosuggest/option.vue.mjs +0 -118
- package/dist/es/src/components/Autosuggest/select-dropdown.vue.mjs +0 -62
- package/dist/es/src/components/Autosuggest/useOption.mjs +0 -93
- package/dist/es/src/components/Autosuggest/useSelect.mjs +0 -803
- package/dist/es/src/components/Inline/Inline.vue.mjs +0 -125
- package/dist/es/src/components/Inline/index.mjs +0 -4
- package/dist/es/src/components/InputNumber/InputNumber.vue.mjs +0 -360
- package/dist/es/src/components/InputNumber/index.mjs +0 -4
- package/dist/es/src/components/InputNumber/input-number.mjs +0 -128
- package/dist/es/src/components/Loader/Loader.vue.mjs +0 -59
- package/dist/es/src/components/Loader/index.mjs +0 -4
- package/dist/es/src/components/Money/Money.vue.mjs +0 -72
- package/dist/es/src/components/Money/index.mjs +0 -4
- package/dist/es/src/components/Multisuggest/index.mjs +0 -4
- package/dist/es/src/components/OptionsList/OptionsList.vue.mjs +0 -28
- package/dist/es/src/components/OptionsList/index.mjs +0 -4
- package/dist/es/src/components/OptionsListItem/OptionsListItem.vue.mjs +0 -96
- package/dist/es/src/components/OptionsListItem/index.mjs +0 -4
- package/dist/es/src/components/Percent/Percent.vue.mjs +0 -73
- package/dist/es/src/components/Percent/index.mjs +0 -4
- package/dist/es/src/components/Skeleton/Skeleton.vue.mjs +0 -79
- package/dist/es/src/components/Skeleton/index.mjs +0 -4
- package/dist/es/src/components/Step/Step.vue.mjs +0 -206
- package/dist/es/src/components/Step/index.mjs +0 -4
- package/dist/es/src/components/Steps/Steps.vue.mjs +0 -15
- package/dist/es/src/components/Steps/index.mjs +0 -4
- package/dist/es/src/components/Tip/Tip.vue.mjs +0 -160
- package/dist/es/src/components/Tip/index.mjs +0 -4
- package/dist/es/src/components/index.mjs +0 -32
- package/dist/es/src/locale/i18nCreator.mjs +0 -93
- package/dist/es/src/locale/lang/pt-br.mjs +0 -21
- package/dist/es/src/main.mjs +0 -17
- package/dist/es/src/mixins/floatFormatter.mjs +0 -42
- package/dist/es/src/plugins/currency.mjs +0 -69
- package/dist/es/src/utils/constants.mjs +0 -6
- package/dist/es/src/utils/error.mjs +0 -22
- package/dist/es/src/utils/i18n.mjs +0 -4
- package/dist/es/src/utils/icon.mjs +0 -9
- package/dist/es/src/utils/index.mjs +0 -11
- package/dist/es/src/utils/runtime.mjs +0 -50
- package/dist/es/src/utils/scroll.mjs +0 -28
- package/dist/es/src/utils/strings.mjs +0 -4
- package/dist/es/src/utils/types.mjs +0 -9
- package/dist/es/src/utils/use-derived-namespace.mjs +0 -15
- package/dist/es/src/utils/use-form-common-props.mjs +0 -25
- package/dist/es/src/utils/use-form-item.mjs +0 -61
- package/dist/es/src/utils/use-id.mjs +0 -35
- package/dist/es/src/utils/use-input.mjs +0 -31
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +0 -10
- package/dist/lib/components.css +0 -2391
- package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +0 -148
- package/dist/lib/node_modules/@popperjs/core/lib/enums.js +0 -22
- package/dist/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -28
- package/dist/lib/node_modules/@vueuse/core/index.js +0 -170
- package/dist/lib/node_modules/@vueuse/shared/index.js +0 -68
- package/dist/lib/node_modules/element-plus/es/constants/size.js +0 -4
- package/dist/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +0 -64
- package/dist/lib/node_modules/element-plus/es/hooks/use-id/index.js +0 -30
- package/dist/lib/node_modules/element-plus/es/hooks/use-locale/index.js +0 -29
- package/dist/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +0 -79
- package/dist/lib/node_modules/element-plus/es/hooks/use-prop/index.js +0 -11
- package/dist/lib/node_modules/element-plus/es/hooks/use-size/index.js +0 -20
- package/dist/lib/node_modules/element-plus/es/locale/lang/en.js +0 -182
- package/dist/lib/node_modules/element-plus/es/utils/error.js +0 -16
- package/dist/lib/node_modules/element-plus/es/utils/types.js +0 -9
- package/dist/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +0 -42
- package/dist/lib/src/components/Autosuggest/Autosuggest.vue.js +0 -446
- package/dist/lib/src/components/Autosuggest/Multisuggest.vue.js +0 -17
- package/dist/lib/src/components/Autosuggest/autosuggest-props.js +0 -204
- package/dist/lib/src/components/Autosuggest/core.js +0 -56
- package/dist/lib/src/components/Autosuggest/multisuggest-props.js +0 -11
- package/dist/lib/src/components/Autosuggest/option.vue.js +0 -118
- package/dist/lib/src/components/Autosuggest/select-dropdown.vue.js +0 -62
- package/dist/lib/src/components/Autosuggest/useOption.js +0 -93
- package/dist/lib/src/components/Autosuggest/useSelect.js +0 -803
- package/dist/lib/src/components/Inline/Inline.vue.js +0 -125
- package/dist/lib/src/components/Inline/index.js +0 -4
- package/dist/lib/src/components/InputNumber/InputNumber.vue.js +0 -360
- package/dist/lib/src/components/InputNumber/index.js +0 -4
- package/dist/lib/src/components/InputNumber/input-number.js +0 -128
- package/dist/lib/src/components/Loader/Loader.vue.js +0 -59
- package/dist/lib/src/components/Loader/index.js +0 -4
- package/dist/lib/src/components/Money/Money.vue.js +0 -72
- package/dist/lib/src/components/Money/index.js +0 -4
- package/dist/lib/src/components/Multisuggest/index.js +0 -4
- package/dist/lib/src/components/OptionsList/OptionsList.vue.js +0 -28
- package/dist/lib/src/components/OptionsList/index.js +0 -4
- package/dist/lib/src/components/OptionsListItem/OptionsListItem.vue.js +0 -96
- package/dist/lib/src/components/OptionsListItem/index.js +0 -4
- package/dist/lib/src/components/Percent/Percent.vue.js +0 -73
- package/dist/lib/src/components/Percent/index.js +0 -4
- package/dist/lib/src/components/Skeleton/Skeleton.vue.js +0 -79
- package/dist/lib/src/components/Skeleton/index.js +0 -4
- package/dist/lib/src/components/Step/Step.vue.js +0 -206
- package/dist/lib/src/components/Step/index.js +0 -4
- package/dist/lib/src/components/Steps/Steps.vue.js +0 -15
- package/dist/lib/src/components/Steps/index.js +0 -4
- package/dist/lib/src/components/Tip/Tip.vue.js +0 -160
- package/dist/lib/src/components/Tip/index.js +0 -4
- package/dist/lib/src/components/index.js +0 -32
- package/dist/lib/src/locale/i18nCreator.js +0 -93
- package/dist/lib/src/locale/lang/pt-br.js +0 -21
- package/dist/lib/src/main.js +0 -17
- package/dist/lib/src/mixins/floatFormatter.js +0 -42
- package/dist/lib/src/plugins/currency.js +0 -69
- package/dist/lib/src/utils/constants.js +0 -6
- package/dist/lib/src/utils/error.js +0 -22
- package/dist/lib/src/utils/i18n.js +0 -4
- package/dist/lib/src/utils/icon.js +0 -9
- package/dist/lib/src/utils/index.js +0 -14
- package/dist/lib/src/utils/runtime.js +0 -50
- package/dist/lib/src/utils/scroll.js +0 -28
- package/dist/lib/src/utils/strings.js +0 -4
- package/dist/lib/src/utils/types.js +0 -12
- package/dist/lib/src/utils/use-derived-namespace.js +0 -15
- package/dist/lib/src/utils/use-form-common-props.js +0 -25
- package/dist/lib/src/utils/use-form-item.js +0 -61
- package/dist/lib/src/utils/use-id.js +0 -35
- package/dist/lib/src/utils/use-input.js +0 -31
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul :class="[justifyContent, 'tp-options-list', (disabled ? 'disabled' : '')]">
|
|
3
|
+
<!-- Conteúdo do OptionList -->
|
|
4
|
+
<slot />
|
|
5
|
+
</ul>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
/**
|
|
10
|
+
* Container de uma lista de opções
|
|
11
|
+
* `<tp-options-list></tp-options-list>`
|
|
12
|
+
*/
|
|
13
|
+
export default {
|
|
14
|
+
name: 'TpOptionsList',
|
|
15
|
+
props: {
|
|
16
|
+
justifyContent: {
|
|
17
|
+
// 'space-between' / 'space-around' / (any flex property)
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'space-between'
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
.tp-options-list {
|
|
31
|
+
list-style: none;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
|
|
35
|
+
&.space-between {
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.center {
|
|
40
|
+
justify-content: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.disabled {
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
cursor: default;
|
|
46
|
+
filter: grayscale(100%);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
div,
|
|
50
|
+
li {
|
|
51
|
+
// só aplicar em telas grandes
|
|
52
|
+
@media screen and ( min-width: 992px ) {
|
|
53
|
+
margin-right: 10px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
ul{
|
|
59
|
+
padding-inline-start: 0px;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li
|
|
3
|
+
:id="id"
|
|
4
|
+
:class="['tp-options-list-item', itemType, active == optValue ? 'active' : '']"
|
|
5
|
+
tabindex="0"
|
|
6
|
+
@click="updateOption"
|
|
7
|
+
@keyup.enter="updateOption"
|
|
8
|
+
>
|
|
9
|
+
<div :class="['icon', direction]">
|
|
10
|
+
<em :class="[icon, 'options-icon']" />
|
|
11
|
+
<p class="text">
|
|
12
|
+
<span
|
|
13
|
+
v-for="(text, index) in texts"
|
|
14
|
+
:key="index"
|
|
15
|
+
>
|
|
16
|
+
{{ text }}
|
|
17
|
+
</span>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<sup v-if="badge" class="option-item-badge" />
|
|
21
|
+
</li>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
name: 'TpOptionsListItem',
|
|
27
|
+
props: {
|
|
28
|
+
itemType: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
},
|
|
36
|
+
optValue: {
|
|
37
|
+
type: [String, Boolean, Number],
|
|
38
|
+
default: null
|
|
39
|
+
},
|
|
40
|
+
icon: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ''
|
|
43
|
+
},
|
|
44
|
+
badge: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
direction: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ''
|
|
51
|
+
},
|
|
52
|
+
id: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ''
|
|
55
|
+
},
|
|
56
|
+
texts: {
|
|
57
|
+
type: Array,
|
|
58
|
+
default: null
|
|
59
|
+
},
|
|
60
|
+
checked: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
type: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ''
|
|
67
|
+
},
|
|
68
|
+
active: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ''
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
updateOption () {
|
|
75
|
+
this.$emit('updateValor', this.optValue)
|
|
76
|
+
this.$emit('input', this.optValue)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="scss" scoped>
|
|
83
|
+
.tp-options-list-item {
|
|
84
|
+
position: relative;
|
|
85
|
+
height: 84px;
|
|
86
|
+
min-width: 114px;
|
|
87
|
+
border: 1px solid #dde5ee;
|
|
88
|
+
border-radius: 6px;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
background: #fff;
|
|
95
|
+
transition: border-color 150ms ease-in-out;
|
|
96
|
+
margin-right: 15px;
|
|
97
|
+
margin-top: 15px;
|
|
98
|
+
|
|
99
|
+
&.entrada {
|
|
100
|
+
@include option-list-item-hover(#08a19e);
|
|
101
|
+
@include option-list-item-checked(#08a19e);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.saida {
|
|
105
|
+
@include option-list-item-hover(#ff7675);
|
|
106
|
+
@include option-list-item-checked(#ff7675);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.default {
|
|
110
|
+
@include option-list-item-hover(#437cf9);
|
|
111
|
+
@include option-list-item-checked(#437cf9);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.entrada,
|
|
115
|
+
&.saida {
|
|
116
|
+
@include r(1024) {
|
|
117
|
+
max-width: 165px;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&:focus{
|
|
122
|
+
border: 1px solid #437cf9;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.icon {
|
|
126
|
+
color: #565b66;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
// text-align: center;
|
|
130
|
+
transition: color 150ms ease-in-out;
|
|
131
|
+
line-height: 1.75em;
|
|
132
|
+
min-width: 120px;
|
|
133
|
+
|
|
134
|
+
&.horizontal {
|
|
135
|
+
justify-content: space-around;
|
|
136
|
+
min-width: 130px;
|
|
137
|
+
|
|
138
|
+
.text {
|
|
139
|
+
text-align: center;
|
|
140
|
+
width: 70px;
|
|
141
|
+
|
|
142
|
+
span {
|
|
143
|
+
&:first-child {
|
|
144
|
+
font-weight: $bold;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.options-icon {
|
|
150
|
+
font-size: 47px;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&.vertical {
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
.text {
|
|
157
|
+
span {
|
|
158
|
+
font-size: 14px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.options-icon {
|
|
163
|
+
font-size: 24px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.text {
|
|
168
|
+
span {
|
|
169
|
+
display: block;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.options-icon {
|
|
174
|
+
font-size: 24px;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.option-item-badge{
|
|
181
|
+
background-color: #F56C6C;
|
|
182
|
+
border: 1px solid #FFF;
|
|
183
|
+
position: absolute;
|
|
184
|
+
top: 0;
|
|
185
|
+
transform: translateY(-50%) translateX(100%);
|
|
186
|
+
height: 12px;
|
|
187
|
+
width: 12px;
|
|
188
|
+
right: 5px;
|
|
189
|
+
border-radius: 50%;
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-input
|
|
3
|
+
:id="`${_id}`"
|
|
4
|
+
class="tp-percent"
|
|
5
|
+
:value="formattedValue"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
:maxlength="maxlength"
|
|
8
|
+
@input="input"
|
|
9
|
+
@change="handleChange"
|
|
10
|
+
@focus="$event.target.select()"
|
|
11
|
+
>
|
|
12
|
+
<template
|
|
13
|
+
v-if="!removePrepend"
|
|
14
|
+
slot="prepend"
|
|
15
|
+
>
|
|
16
|
+
%
|
|
17
|
+
</template>
|
|
18
|
+
<template
|
|
19
|
+
v-if="showAppend"
|
|
20
|
+
slot="append"
|
|
21
|
+
>
|
|
22
|
+
%
|
|
23
|
+
</template>
|
|
24
|
+
</el-input>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import Locale from 'tp-ui/mixins/locale'
|
|
29
|
+
import floatFormatterMixin from 'tp-ui/mixins/floatFormatter'
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'TpPercent',
|
|
33
|
+
|
|
34
|
+
mixins: [Locale, floatFormatterMixin],
|
|
35
|
+
props: {
|
|
36
|
+
id: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false,
|
|
39
|
+
default: null
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// remove o simbolo em prepend
|
|
43
|
+
removePrepend: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
// coloca o simbolo no append
|
|
49
|
+
showAppend: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// valor do campo. Pode ser usado como v-model também
|
|
55
|
+
value: {
|
|
56
|
+
type: [Number, String],
|
|
57
|
+
default: 0
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// tamanho máximo do campo. limitado por padrão a 21 caracteres por limitações do JS
|
|
61
|
+
maxlength: {
|
|
62
|
+
type: Number,
|
|
63
|
+
default: 21
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
computed: {
|
|
68
|
+
_id () {
|
|
69
|
+
return this.id || this.$options.name
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
.tp-percent {
|
|
77
|
+
& input {
|
|
78
|
+
text-align: right;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tp-skeleton">
|
|
3
|
+
<span
|
|
4
|
+
v-for="item in count"
|
|
5
|
+
:key="item"
|
|
6
|
+
:class="{'circle':circle}"
|
|
7
|
+
:style="`--duration:${duration}; --item:${item}; width: ${cWidth}; height: ${cHeight}`"
|
|
8
|
+
>
|
|
9
|
+
|
|
10
|
+
</span>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
/**
|
|
16
|
+
* Placeholder de elemententos enquanto estão sendo carregados.
|
|
17
|
+
* Exibe retângulos e circulos para mostrar ao usuario a estrutura dos dados que serão exibidos.
|
|
18
|
+
* `<tp-skeleton />`
|
|
19
|
+
*/
|
|
20
|
+
export default {
|
|
21
|
+
name: 'TpSkeleton',
|
|
22
|
+
props: {
|
|
23
|
+
/**
|
|
24
|
+
* Quantos itens em sequencia
|
|
25
|
+
*/
|
|
26
|
+
count: {
|
|
27
|
+
type: Number,
|
|
28
|
+
required: false,
|
|
29
|
+
default: 1
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Quanto tempo dura um ciclo da animação em segundos
|
|
34
|
+
*/
|
|
35
|
+
duration: {
|
|
36
|
+
type: Number,
|
|
37
|
+
required: false,
|
|
38
|
+
default: 1
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Largura em "%"". Quando círculo, em "px"
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
width: {
|
|
46
|
+
type: Number,
|
|
47
|
+
required: false,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Altura em "em"". Ignorado quando circulo e utiliza-se o mesmo parametro do width
|
|
53
|
+
*/
|
|
54
|
+
height: {
|
|
55
|
+
type: Number,
|
|
56
|
+
required: false,
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Flag que identifica se será um círculo
|
|
62
|
+
*/
|
|
63
|
+
circle: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
required: false,
|
|
66
|
+
default: false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
computed: {
|
|
71
|
+
cWidth () {
|
|
72
|
+
if (this.circle && this.width) {
|
|
73
|
+
return `${this.width}px`
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return `${this.width}%`
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
cHeight () {
|
|
80
|
+
if (this.circle && this.width) {
|
|
81
|
+
return `${this.width}px`
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return `${this.height}em`
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped>
|
|
91
|
+
@keyframes skeleton{
|
|
92
|
+
0% {
|
|
93
|
+
background-position: -200px 0;
|
|
94
|
+
}
|
|
95
|
+
100% {
|
|
96
|
+
background-position: calc(200px + 100%) 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.tp-skeleton {
|
|
101
|
+
display: block;
|
|
102
|
+
height: 100%;
|
|
103
|
+
|
|
104
|
+
--baseColor: #ebeef2;
|
|
105
|
+
|
|
106
|
+
span {
|
|
107
|
+
background-color: var(--baseColor);
|
|
108
|
+
background-image: linear-gradient(
|
|
109
|
+
90deg,
|
|
110
|
+
var(--baseColor),
|
|
111
|
+
mix($--color-white, $--border-color-light, 70%),
|
|
112
|
+
var(--baseColor)
|
|
113
|
+
);
|
|
114
|
+
background-size: 200px 100%;
|
|
115
|
+
background-repeat: no-repeat;
|
|
116
|
+
background-position: -200px 0;
|
|
117
|
+
border-radius: $--border-radius-base;
|
|
118
|
+
display: inline-block;
|
|
119
|
+
line-height: 20px;
|
|
120
|
+
margin-bottom: 3px;
|
|
121
|
+
width: 100%;
|
|
122
|
+
min-height: 15px;
|
|
123
|
+
|
|
124
|
+
animation-name: skeleton;
|
|
125
|
+
animation-duration: calc(var(--duration) * 1s);
|
|
126
|
+
animation-timing-function: ease-in-out;
|
|
127
|
+
animation-iteration-count: infinite;
|
|
128
|
+
// animation-delay: calc(var(--item) * 300ms);
|
|
129
|
+
|
|
130
|
+
&.circle{
|
|
131
|
+
width: inherit;
|
|
132
|
+
border-radius: 50%;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
</style>
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="el-step"
|
|
4
|
+
:style="style"
|
|
5
|
+
:class="[
|
|
6
|
+
!isSimple && `is-${$parent.direction}`,
|
|
7
|
+
isSimple && 'is-simple',
|
|
8
|
+
isLast && !space && !isCenter && 'is-flex',
|
|
9
|
+
isCenter && !isVertical && !isSimple && 'is-center']"
|
|
10
|
+
>
|
|
11
|
+
<!-- icon & line -->
|
|
12
|
+
<div
|
|
13
|
+
class="el-step__head"
|
|
14
|
+
:class="`is-${currentStatus === 'active' ? 'finish' : currentStatus}`"
|
|
15
|
+
>
|
|
16
|
+
<div
|
|
17
|
+
class="el-step__line"
|
|
18
|
+
:style="isLast ? '' : { marginRight: $parent.stepOffset + 'px' }"
|
|
19
|
+
>
|
|
20
|
+
<em class="el-step__line-inner" :style="lineStyle" />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="el-step__icon" :class="`is-${icon ? 'icon' : 'text'}`">
|
|
24
|
+
<slot
|
|
25
|
+
v-if="currentStatus !== 'success' && currentStatus !== 'error'"
|
|
26
|
+
name="icon"
|
|
27
|
+
>
|
|
28
|
+
<em v-if="icon" class="el-step__icon-inner" :class="[icon]" />
|
|
29
|
+
<div v-if="!icon && !isSimple" class="el-step__icon-inner">
|
|
30
|
+
{{ index + 1 }}
|
|
31
|
+
</div>
|
|
32
|
+
</slot>
|
|
33
|
+
<em
|
|
34
|
+
v-else
|
|
35
|
+
:class="['el-icon-' + (currentStatus === 'success' ? 'check' : 'close')]"
|
|
36
|
+
class="el-step__icon-inner is-status"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<!-- title & description -->
|
|
41
|
+
<div class="el-step__main">
|
|
42
|
+
<div
|
|
43
|
+
ref="title"
|
|
44
|
+
class="el-step__title"
|
|
45
|
+
:class="['is-' + currentStatus]"
|
|
46
|
+
>
|
|
47
|
+
<slot name="title">
|
|
48
|
+
{{ title }}
|
|
49
|
+
</slot>
|
|
50
|
+
</div>
|
|
51
|
+
<div v-if="isSimple" class="el-step__arrow" />
|
|
52
|
+
<div
|
|
53
|
+
v-else
|
|
54
|
+
class="el-step__description"
|
|
55
|
+
:class="['is-' + currentStatus]"
|
|
56
|
+
>
|
|
57
|
+
<slot name="description">
|
|
58
|
+
{{ description }}
|
|
59
|
+
</slot>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
<script>
|
|
65
|
+
export default {
|
|
66
|
+
name: 'TpStep',
|
|
67
|
+
|
|
68
|
+
props: {
|
|
69
|
+
title: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: ''
|
|
72
|
+
},
|
|
73
|
+
icon: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: ''
|
|
76
|
+
},
|
|
77
|
+
description: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: ''
|
|
80
|
+
},
|
|
81
|
+
status: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: ''
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
data () {
|
|
88
|
+
return {
|
|
89
|
+
index: -1,
|
|
90
|
+
lineStyle: {},
|
|
91
|
+
internalStatus: ''
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
computed: {
|
|
96
|
+
currentStatus () {
|
|
97
|
+
return this.internalStatus
|
|
98
|
+
},
|
|
99
|
+
prevStatus () {
|
|
100
|
+
const prevStep = this.$parent.steps[this.index - 1]
|
|
101
|
+
|
|
102
|
+
return prevStep ? prevStep.currentStatus : 'wait'
|
|
103
|
+
},
|
|
104
|
+
isCenter () {
|
|
105
|
+
return this.$parent.alignCenter
|
|
106
|
+
},
|
|
107
|
+
isVertical () {
|
|
108
|
+
return this.$parent.direction === 'vertical'
|
|
109
|
+
},
|
|
110
|
+
isSimple () {
|
|
111
|
+
return this.$parent.simple
|
|
112
|
+
},
|
|
113
|
+
isLast () {
|
|
114
|
+
const parent = this.$parent
|
|
115
|
+
|
|
116
|
+
return parent.steps[parent.steps.length - 1] === this
|
|
117
|
+
},
|
|
118
|
+
stepsCount () {
|
|
119
|
+
return this.$parent.steps.length
|
|
120
|
+
},
|
|
121
|
+
space () {
|
|
122
|
+
const { isSimple, $parent: { space } } = this
|
|
123
|
+
|
|
124
|
+
return isSimple ? '' : space
|
|
125
|
+
},
|
|
126
|
+
style: function () {
|
|
127
|
+
const style = {}
|
|
128
|
+
const parent = this.$parent
|
|
129
|
+
const len = parent.steps.length
|
|
130
|
+
|
|
131
|
+
const space = (typeof this.space === 'number'
|
|
132
|
+
? `${this.space }px`
|
|
133
|
+
: this.space
|
|
134
|
+
? this.space
|
|
135
|
+
: `${100 / (len - (this.isCenter ? 0 : 1)) }%`)
|
|
136
|
+
|
|
137
|
+
style.flexBasis = space
|
|
138
|
+
|
|
139
|
+
if (this.isVertical) return style
|
|
140
|
+
|
|
141
|
+
if (this.isLast) {
|
|
142
|
+
style.maxWidth = `${100 / this.stepsCount }%`
|
|
143
|
+
} else {
|
|
144
|
+
style.marginRight = `${-this.$parent.stepOffset }px`
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return style
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
watch: {
|
|
152
|
+
status () {
|
|
153
|
+
this.updateStatus(this.$parent.active)
|
|
154
|
+
this.internalStatus = this.status
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
beforeCreate () {
|
|
160
|
+
this.$parent.steps.push(this)
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
beforeDestroy () {
|
|
164
|
+
const steps = this.$parent.steps
|
|
165
|
+
const index = steps.indexOf(this)
|
|
166
|
+
|
|
167
|
+
if (index >= 0) {
|
|
168
|
+
steps.splice(index, 1)
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
mounted () {
|
|
173
|
+
const unwatch = this.$watch('index', () => {
|
|
174
|
+
this.$watch('$parent.active', this.updateStatus, { immediate: true })
|
|
175
|
+
this.$watch('$parent.processStatus', () => {
|
|
176
|
+
const activeIndex = this.$parent.active
|
|
177
|
+
|
|
178
|
+
this.updateStatus(activeIndex)
|
|
179
|
+
}, { immediate: true })
|
|
180
|
+
unwatch()
|
|
181
|
+
})
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
methods: {
|
|
185
|
+
updateStatus (val) {
|
|
186
|
+
const prevChild = this.$parent.$children[this.index - 1]
|
|
187
|
+
|
|
188
|
+
if (this.status === 'error') {
|
|
189
|
+
this.internalStatus = 'error'
|
|
190
|
+
} else if (val > this.index) {
|
|
191
|
+
this.internalStatus = this.$parent.finishStatus
|
|
192
|
+
} else if (val === this.index && this.prevStatus !== 'error') {
|
|
193
|
+
this.internalStatus = this.$parent.processStatus
|
|
194
|
+
} else if (this.$parent.newItem && this.prevStatus !== 'error') {
|
|
195
|
+
this.internalStatus = 'wait'
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (prevChild) prevChild.calcProgress(this.internalStatus)
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
calcProgress (status) {
|
|
202
|
+
let step = 100
|
|
203
|
+
const style = {}
|
|
204
|
+
|
|
205
|
+
style.transitionDelay = `${150 * this.index }ms`
|
|
206
|
+
|
|
207
|
+
// if (status === this.$parent.processStatus) {
|
|
208
|
+
// step = this.currentStatus !== 'error' ? 0 : 0
|
|
209
|
+
// } else
|
|
210
|
+
if (status === 'wait') {
|
|
211
|
+
step = 0
|
|
212
|
+
style.transitionDelay = `${-50 * this.index }ms`
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
style.borderWidth = step && !this.isSimple ? '1px' : 0
|
|
216
|
+
this.$parent.direction === 'vertical'
|
|
217
|
+
? style.height = `${step }%`
|
|
218
|
+
: style.width = `${step }%`
|
|
219
|
+
|
|
220
|
+
this.lineStyle = style
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
</script>
|
|
225
|
+
<style lang="scss" scoped>
|
|
226
|
+
.el-step__head.is-process {
|
|
227
|
+
color: #2d6eda;
|
|
228
|
+
border-color: #2d6eda;
|
|
229
|
+
}
|
|
230
|
+
</style>
|