@tagplus/components 5.2.8 → 5.2.9

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.
Files changed (93) hide show
  1. package/dist/tp.common.js +1 -1
  2. package/dist/tp.common.js.map +1 -1
  3. package/dist/{tp.common.lang-tp-en-js.js → tp.common.lang-en-js.js} +2 -2
  4. package/dist/tp.common.lang-en-js.js.map +1 -0
  5. package/dist/tp.umd.js +1 -1
  6. package/dist/tp.umd.js.map +1 -1
  7. package/dist/{tp.umd.lang-tp-en-js.js → tp.umd.lang-en-js.js} +2 -2
  8. package/dist/tp.umd.lang-en-js.js.map +1 -0
  9. package/dist/tp.umd.min.js +1 -1
  10. package/dist/tp.umd.min.js.map +1 -1
  11. package/dist/{tp.umd.min.lang-tp-en-js.js → tp.umd.min.lang-en-js.js} +2 -2
  12. package/dist/tp.umd.min.lang-en-js.js.map +1 -0
  13. package/package.json +2 -7
  14. package/dist/tp.common.lang-tp-en-js.js.map +0 -1
  15. package/dist/tp.umd.lang-tp-en-js.js.map +0 -1
  16. package/dist/tp.umd.min.lang-tp-en-js.js.map +0 -1
  17. package/src/assets/scss/_fonts.scss +0 -28
  18. package/src/assets/scss/_functions.scss +0 -22
  19. package/src/assets/scss/_helpers.scss +0 -116
  20. package/src/assets/scss/_mixins.scss +0 -69
  21. package/src/assets/scss/_overrides.scss +0 -22
  22. package/src/assets/scss/_resass.scss +0 -92
  23. package/src/assets/scss/_variables.scss +0 -26
  24. package/src/assets/scss/index.scss +0 -8
  25. package/src/components/Autosuggest/Autosuggest.vue +0 -362
  26. package/src/components/Autosuggest/Multisuggest.vue +0 -22
  27. package/src/components/Autosuggest/autosuggest-props.js +0 -210
  28. package/src/components/Autosuggest/autosuggest-style.scss +0 -127
  29. package/src/components/Autosuggest/core.js +0 -63
  30. package/src/components/Autosuggest/index.js +0 -5
  31. package/src/components/Autosuggest/multisuggest-props.js +0 -9
  32. package/src/components/Autosuggest/option.vue +0 -136
  33. package/src/components/Autosuggest/select-dropdown.vue +0 -64
  34. package/src/components/Autosuggest/useOption.js +0 -120
  35. package/src/components/Autosuggest/useSelect.js +0 -1133
  36. package/src/components/AutosuggestTest.vue +0 -56
  37. package/src/components/CardExemplo.vue +0 -49
  38. package/src/components/CodeSample.vue +0 -78
  39. package/src/components/Inline/Inline.vue +0 -141
  40. package/src/components/Inline/index.js +0 -3
  41. package/src/components/InputNumber/InputNumber.vue +0 -381
  42. package/src/components/InputNumber/index.js +0 -3
  43. package/src/components/InputNumber/input-number.js +0 -135
  44. package/src/components/Loader/Loader.vue +0 -306
  45. package/src/components/Loader/animations.scss +0 -81
  46. package/src/components/Loader/index.js +0 -3
  47. package/src/components/Money/Money.vue +0 -73
  48. package/src/components/Money/index.js +0 -3
  49. package/src/components/Multisuggest/index.js +0 -2
  50. package/src/components/MultisuggestTest.vue +0 -56
  51. package/src/components/OptionsList/OptionsList.vue +0 -62
  52. package/src/components/OptionsList/index.js +0 -3
  53. package/src/components/OptionsListItem/OptionsListItem.vue +0 -195
  54. package/src/components/OptionsListItem/index.js +0 -3
  55. package/src/components/Percent/Percent.vue +0 -75
  56. package/src/components/Percent/index.js +0 -3
  57. package/src/components/Skeleton/Skeleton.vue +0 -142
  58. package/src/components/Skeleton/index.js +0 -3
  59. package/src/components/Step/Step.vue +0 -237
  60. package/src/components/Step/index.js +0 -3
  61. package/src/components/Steps/Steps.vue +0 -15
  62. package/src/components/Steps/index.js +0 -3
  63. package/src/components/TesteToCurrency.vue +0 -171
  64. package/src/components/Tip/Tip.vue +0 -210
  65. package/src/components/Tip/index.js +0 -3
  66. package/src/components/ValueSelector.vue +0 -60
  67. package/src/components/autosuggestMixin.js +0 -301
  68. package/src/components/index.js +0 -34
  69. package/src/locale/i18nCreator.js +0 -166
  70. package/src/locale/lang/en.js +0 -35
  71. package/src/locale/lang/pt-br.js +0 -35
  72. package/src/main.js +0 -21
  73. package/src/mixins/floatFormatter.js +0 -49
  74. package/src/plugins/currency.js +0 -100
  75. package/src/utils/browser.js +0 -6
  76. package/src/utils/constants.js +0 -3
  77. package/src/utils/error.js +0 -22
  78. package/src/utils/filters.js +0 -71
  79. package/src/utils/helpers.js +0 -41
  80. package/src/utils/i18n.js +0 -2
  81. package/src/utils/icon.js +0 -35
  82. package/src/utils/index.js +0 -20
  83. package/src/utils/objects.js +0 -17
  84. package/src/utils/runtime.js +0 -86
  85. package/src/utils/scroll.js +0 -100
  86. package/src/utils/strings.js +0 -17
  87. package/src/utils/style.js +0 -80
  88. package/src/utils/types.js +0 -39
  89. package/src/utils/use-derived-namespace.js +0 -112
  90. package/src/utils/use-form-common-props.js +0 -41
  91. package/src/utils/use-form-item.js +0 -80
  92. package/src/utils/use-id.js +0 -40
  93. package/src/utils/use-input.js +0 -33
@@ -1,127 +0,0 @@
1
- .tp-autosuggest-clear-icon {
2
- margin: 6px 6px 1px 6px;
3
- }
4
-
5
- :deep() {
6
- .el-select__input-wrapper {
7
- width: 100%;
8
-
9
- .el-input {
10
- .el-input__inner {
11
- width: 100%;
12
- }
13
-
14
- .el-input-group__prepend {
15
- padding: 0;
16
- }
17
-
18
- .el-input-group__prepend::after {
19
- // esconde barra vertical duplicada no search
20
- display: none;
21
- }
22
-
23
- .el-input__wrapper {
24
- // "borda" do <input> top e bottom
25
- box-shadow: none;
26
- border-top: 1px solid var(--el-input-border-color);
27
- border-bottom: 1px solid var(--el-input-border-color);
28
- padding-left: 8px;
29
-
30
- .el-select__placeholder {
31
- padding-left: 16px !important;
32
- }
33
- }
34
-
35
- &.is-disabled {
36
-
37
- .el-input__wrapper,
38
- .el-tag {
39
- cursor: not-allowed;
40
- }
41
- }
42
-
43
- .el-input-group__append {
44
- padding: 0;
45
-
46
- .el-input__close {
47
- width: 40px;
48
-
49
- .tp-btn-close {
50
- margin: auto;
51
- }
52
- }
53
- }
54
-
55
- .el-input-group__prepend,
56
- .el-input-group__append {
57
- background-color: var(--el-input-bg-color, var(--el-fill-color-blank));
58
- }
59
-
60
- .el-input-group__prepend,
61
- .el-input-group__append,
62
- .tp-autosuggest-clear-icon {
63
- cursor: pointer;
64
- color: #606266;
65
- }
66
- }
67
- }
68
- }
69
-
70
- .tp-autosuggest-vertical-divider {
71
- height: 33.59px;
72
- margin: 0;
73
- }
74
-
75
- .tp-autosuggest-input-prepend-icon {
76
- display: flex;
77
- margin: 0 10px -2px 12px;
78
- }
79
-
80
- .tp-autosuggest-loading {
81
- text-align: center;
82
- font-size: 1.5em;
83
- padding: 10px;
84
- margin: 0;
85
- }
86
-
87
- .tp-select-dropdown__list.el-select-dropdown__list {
88
- li.el-select-dropdown__item {
89
- line-height: 1.5em;
90
- height: auto;
91
- padding: $--popover-padding;
92
- position: relative;
93
- transition: 100ms all linear;
94
-
95
- &.hover {
96
- padding-left: 20px;
97
-
98
- &::before {
99
- position: absolute;
100
- display: inline-block;
101
- width: 4px;
102
- top: 5px;
103
- bottom: 5px;
104
- left: 5px;
105
- background: $--color-primary;
106
- border-radius: 2px;
107
- }
108
- }
109
-
110
- &.selected {
111
- color: $--color-text-regular;
112
- }
113
-
114
- &.created a {
115
- color: $--color-primary;
116
- font-weight: normal;
117
- border-bottom: 1px solid $--color-primary;
118
- line-height: 1.5em;
119
- display: inline-block;
120
- }
121
-
122
- small {
123
- font-size: $--font-size-base;
124
- color: color-mix($--color-white, $--color-text-secondary, 40%);
125
- }
126
- }
127
- }
@@ -1,63 +0,0 @@
1
-
2
- import { provide, reactive } from 'vue'
3
- import { ClickOutside } from 'element-plus'
4
- import { ArrowDown } from '@element-plus/icons-vue'
5
- import ElSelectMenu from '@/components/Autosuggest/select-dropdown.vue'
6
- import ElOption from '@/components/Autosuggest/option.vue'
7
- import { useSelect } from '@/components/Autosuggest/useSelect'
8
-
9
- export default function (component_name, propsDefinition) {
10
- return {
11
- name: component_name,
12
- componentName: component_name,
13
-
14
- directives: {
15
- ClickOutside
16
- },
17
-
18
- components: {
19
- ArrowDown,
20
- ElOption,
21
- ElSelectMenu
22
- },
23
-
24
- props: propsDefinition,
25
-
26
- emits: [
27
- 'update:modelValue',
28
- 'change',
29
- 'remove-tag',
30
- 'clear',
31
- 'visible-change',
32
- 'focus',
33
- 'blur',
34
- ],
35
-
36
- setup (props, context) {
37
- const API = useSelect(props, context)
38
-
39
- provide(
40
- 'select',
41
- reactive({
42
- props,
43
- states: API.states,
44
- optionsArray: API.optionsArray,
45
- handleOptionSelect: API.handleOptionSelect,
46
- onOptionCreate: API.onOptionCreate,
47
- onOptionDestroy: API.onOptionDestroy,
48
- selectRef: API.selectRef,
49
- setSelected: API.setSelected,
50
- })
51
- )
52
-
53
- return API
54
- },
55
-
56
- data () {
57
- return {
58
- visible: false,
59
- tooltipVisible: false
60
- }
61
- }
62
- }
63
- }
@@ -1,5 +0,0 @@
1
- import Autosuggest from './Autosuggest'
2
- import Multisuggest from './Multisuggest'
3
-
4
- export default Autosuggest
5
- export { Multisuggest, Autosuggest }
@@ -1,9 +0,0 @@
1
- import autosuggestProps from '@src/components/Autosuggest/autosuggest-props'
2
-
3
- export default {
4
- ...autosuggestProps,
5
- multiple: {
6
- type: Boolean,
7
- default: true
8
- }
9
- }
@@ -1,136 +0,0 @@
1
- <template>
2
- <li
3
- v-show="visible"
4
- :id="id"
5
- :class="containerKls"
6
- role="option"
7
- :aria-disabled="isDisabled || undefined"
8
- :aria-selected="itemSelected"
9
- @mouseenter="hoverItem"
10
- @click.stop="selectOptionClick"
11
- >
12
- <slot>
13
- <span>{{ currentLabel }}</span>
14
- </slot>
15
- </li>
16
- </template>
17
-
18
- <script>
19
- // @ts-nocheck
20
- import {
21
- computed,
22
- defineComponent,
23
- getCurrentInstance,
24
- nextTick,
25
- onBeforeUnmount,
26
- reactive,
27
- toRefs,
28
- unref,
29
- } from 'vue'
30
- import { useId, useNamespace } from 'element-plus/es/hooks/index'
31
- import { useOption } from '@/components/Autosuggest/useOption'
32
-
33
- export default defineComponent({
34
- name: 'ElOption',
35
- componentName: 'ElOption',
36
-
37
- props: {
38
- /**
39
- * @description value of option
40
- */
41
- value: {
42
- required: true,
43
- type: [String, Number, Boolean, Object, null],
44
- },
45
- /**
46
- * @description label of option, same as `value` if omitted
47
- */
48
- label: [String, Number],
49
- created: Boolean,
50
- /**
51
- * @description whether option is disabled
52
- */
53
- disabled: Boolean,
54
- /**
55
- * @tagplus
56
- * @description recebe o item inteiro para ser emitido, ao inves de somente key/value
57
- */
58
- item: {
59
- type: [String, Number, Boolean, Object],
60
- required: true
61
- }
62
- },
63
-
64
- setup (props) {
65
- const ns = useNamespace('select')
66
- const id = useId()
67
-
68
- const containerKls = computed(() => [
69
- ns.be('dropdown', 'item'),
70
- ns.is('disabled', unref(isDisabled)),
71
- ns.is('selected', unref(itemSelected)),
72
- ns.is('hovering', unref(hover)),
73
- ])
74
-
75
- const states = reactive({
76
- index: -1,
77
- groupDisabled: false,
78
- visible: true,
79
- hover: false,
80
- })
81
-
82
- const {
83
- currentLabel,
84
- itemSelected,
85
- isDisabled,
86
- select,
87
- hoverItem,
88
- updateOption,
89
- } = useOption(props, states)
90
-
91
- const { visible, hover } = toRefs(states)
92
-
93
- const vm = getCurrentInstance().proxy
94
-
95
- select.onOptionCreate(vm)
96
-
97
- onBeforeUnmount(() => {
98
- const key = vm.value
99
- const { selected } = select.states
100
- const selectedOptions = select.props.multiple ? selected : [selected]
101
- const doesSelected = selectedOptions.some((item) => {
102
- return item.value === vm.value
103
- })
104
- // if option is not selected, remove it from cache
105
- nextTick(() => {
106
- if (select.states.cachedOptions.get(key) === vm && !doesSelected) {
107
- select.states.cachedOptions.delete(key)
108
- }
109
- })
110
- select.onOptionDestroy(key, vm)
111
- })
112
-
113
- function selectOptionClick () {
114
- if (props.disabled !== true && states.groupDisabled !== true) {
115
- select.handleOptionSelect(vm)
116
- }
117
- }
118
-
119
- return {
120
- ns,
121
- id,
122
- containerKls,
123
- currentLabel,
124
- itemSelected,
125
- isDisabled,
126
- select,
127
- hoverItem,
128
- updateOption,
129
- visible,
130
- hover,
131
- selectOptionClick,
132
- states,
133
- }
134
- },
135
- })
136
- </script>
@@ -1,64 +0,0 @@
1
- <template>
2
- <div
3
- :class="[ns.b('dropdown'), ns.is('multiple', isMultiple), popperClass]"
4
- :style="{ [isFitInputWidth ? 'width' : 'minWidth']: minWidth }"
5
- >
6
- <div v-if="$slots.header" :class="ns.be('dropdown', 'header')">
7
- <slot name="header" />
8
- </div>
9
- <slot />
10
- <div v-if="$slots.footer" :class="ns.be('dropdown', 'footer')">
11
- <slot name="footer" />
12
- </div>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import { defineComponent, ref } from 'vue'
18
- import { useResizeObserver } from '@vueuse/core'
19
- import { useNamespace } from 'element-plus/es/hooks/index'
20
-
21
- export default defineComponent({
22
- name: 'ElSelectDropdown',
23
-
24
- componentName: 'ElSelectDropdown',
25
-
26
- inject: ['select'],
27
-
28
- setup () {
29
- const ns = useNamespace('select')
30
- const minWidth = ref('')
31
-
32
- return {
33
- ns,
34
- minWidth,
35
- }
36
- },
37
-
38
- computed: {
39
- popperClass () {
40
- return this.select.popperClass
41
- },
42
-
43
- isMultiple (){
44
- return this.select.multiple
45
- },
46
-
47
- isFitInputWidth (){
48
- return this.select.fitInputWidth
49
- },
50
-
51
- },
52
-
53
- mounted () {
54
- this.updateMinWidth()
55
- useResizeObserver(this.select.selectRef, this.updateMinWidth)
56
- },
57
-
58
- methods: {
59
- updateMinWidth () {
60
- this.minWidth = `${this.select.selectRef?.offsetWidth}px`
61
- }
62
- },
63
- })
64
- </script>
@@ -1,120 +0,0 @@
1
- // @ts-nocheck
2
- import { computed, getCurrentInstance, inject, toRaw, watch } from 'vue'
3
- import { get, isEqual } from 'lodash-unified'
4
- import { escapeStringRegexp, isObject } from '@/utils'
5
-
6
- export function useOption (props, states) {
7
- // inject
8
- const select = inject('select')
9
- const selectGroup = inject('ElSelectGroup', { disabled: false })
10
-
11
- // computed
12
- const itemSelected = computed(() => {
13
- if (select.props.multiple) {
14
- return contains(select.props.modelValue, props.value)
15
- } else {
16
- return contains([select.props.modelValue], props.value)
17
- }
18
- })
19
-
20
- const limitReached = computed(() => {
21
- if (select.props.multiple) {
22
- const modelValue = (select.props.modelValue || [])
23
- return (
24
- !itemSelected.value &&
25
- modelValue.length >= select.props.multipleLimit &&
26
- select.props.multipleLimit > 0
27
- )
28
- } else {
29
- return false
30
- }
31
- })
32
-
33
- const currentLabel = computed(() => {
34
- return props.label || (isObject(props.value) ? '' : props.value)
35
- })
36
-
37
- const currentValue = computed(() => {
38
- return props.value || props.label || ''
39
- })
40
-
41
- const isDisabled = computed(() => {
42
- return props.disabled || states.groupDisabled || limitReached.value
43
- })
44
-
45
- const instance = getCurrentInstance()
46
-
47
- const contains = (arr = [], target) => {
48
- if (!isObject(props.value)) {
49
- return arr && arr.includes(target)
50
- } else {
51
- const valueKey = select.props.valueKey
52
- return (
53
- arr &&
54
- arr.some((item) => {
55
- return toRaw(get(item, valueKey)) === get(target, valueKey)
56
- })
57
- )
58
- }
59
- }
60
-
61
- const hoverItem = () => {
62
- if (!props.disabled && !selectGroup.disabled) {
63
- select.states.hoveringIndex = select.optionsArray.indexOf(instance.proxy)
64
- }
65
- }
66
-
67
- const updateOption = (query) => {
68
- const regexp = new RegExp(escapeStringRegexp(query), 'i')
69
- states.visible = regexp.test(currentLabel.value) || props.created
70
- }
71
-
72
- watch(
73
- () => currentLabel.value,
74
- () => {
75
- if (!props.created && !select.props.remote) select.setSelected()
76
- }
77
- )
78
-
79
- watch(
80
- () => props.value,
81
- (val, oldVal) => {
82
- const { remote, valueKey } = select.props
83
-
84
- if (!isEqual(val, oldVal)) {
85
- select.onOptionDestroy(oldVal, instance.proxy)
86
- select.onOptionCreate(instance.proxy)
87
- }
88
-
89
- if (!props.created && !remote) {
90
- if (
91
- valueKey &&
92
- isObject(val) &&
93
- isObject(oldVal) &&
94
- val[valueKey] === oldVal[valueKey]
95
- ) {
96
- return
97
- }
98
- select.setSelected()
99
- }
100
- }
101
- )
102
-
103
- watch(
104
- () => selectGroup.disabled,
105
- () => {
106
- states.groupDisabled = selectGroup.disabled
107
- },
108
- { immediate: true }
109
- )
110
-
111
- return {
112
- select,
113
- currentLabel,
114
- currentValue,
115
- itemSelected,
116
- isDisabled,
117
- hoverItem,
118
- updateOption,
119
- }
120
- }