@tagplus/components 5.2.7 → 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.
- package/dist/tp.common.js +1 -1
- package/dist/tp.common.js.map +1 -1
- package/dist/{tp.common.lang-tp-en-js.js → tp.common.lang-en-js.js} +2 -2
- package/dist/tp.common.lang-en-js.js.map +1 -0
- package/dist/tp.umd.js +1 -1
- package/dist/tp.umd.js.map +1 -1
- package/dist/{tp.umd.lang-tp-en-js.js → tp.umd.lang-en-js.js} +2 -2
- package/dist/tp.umd.lang-en-js.js.map +1 -0
- package/dist/tp.umd.min.js +1 -1
- package/dist/tp.umd.min.js.map +1 -1
- package/dist/{tp.umd.min.lang-tp-en-js.js → tp.umd.min.lang-en-js.js} +2 -2
- package/dist/tp.umd.min.lang-en-js.js.map +1 -0
- package/package.json +2 -7
- package/dist/tp.common.lang-tp-en-js.js.map +0 -1
- package/dist/tp.umd.lang-tp-en-js.js.map +0 -1
- package/dist/tp.umd.min.lang-tp-en-js.js.map +0 -1
- package/src/assets/scss/_fonts.scss +0 -28
- package/src/assets/scss/_functions.scss +0 -22
- package/src/assets/scss/_helpers.scss +0 -116
- package/src/assets/scss/_mixins.scss +0 -69
- package/src/assets/scss/_overrides.scss +0 -22
- package/src/assets/scss/_resass.scss +0 -92
- package/src/assets/scss/_variables.scss +0 -26
- package/src/assets/scss/index.scss +0 -8
- package/src/components/Autosuggest/Autosuggest.vue +0 -362
- package/src/components/Autosuggest/Multisuggest.vue +0 -22
- package/src/components/Autosuggest/autosuggest-props.js +0 -210
- package/src/components/Autosuggest/autosuggest-style.scss +0 -127
- package/src/components/Autosuggest/core.js +0 -63
- package/src/components/Autosuggest/index.js +0 -5
- package/src/components/Autosuggest/multisuggest-props.js +0 -9
- package/src/components/Autosuggest/option.vue +0 -136
- package/src/components/Autosuggest/select-dropdown.vue +0 -64
- package/src/components/Autosuggest/useOption.js +0 -120
- package/src/components/Autosuggest/useSelect.js +0 -1133
- package/src/components/AutosuggestTest.vue +0 -56
- package/src/components/CardExemplo.vue +0 -49
- package/src/components/CodeSample.vue +0 -78
- package/src/components/Inline/Inline.vue +0 -141
- package/src/components/Inline/index.js +0 -3
- package/src/components/InputNumber/InputNumber.vue +0 -381
- package/src/components/InputNumber/index.js +0 -3
- package/src/components/InputNumber/input-number.js +0 -135
- package/src/components/Loader/Loader.vue +0 -306
- package/src/components/Loader/animations.scss +0 -81
- package/src/components/Loader/index.js +0 -3
- package/src/components/Money/Money.vue +0 -73
- package/src/components/Money/index.js +0 -3
- package/src/components/Multisuggest/index.js +0 -2
- package/src/components/MultisuggestTest.vue +0 -56
- package/src/components/OptionsList/OptionsList.vue +0 -62
- package/src/components/OptionsList/index.js +0 -3
- package/src/components/OptionsListItem/OptionsListItem.vue +0 -195
- package/src/components/OptionsListItem/index.js +0 -3
- package/src/components/Percent/Percent.vue +0 -75
- package/src/components/Percent/index.js +0 -3
- package/src/components/Skeleton/Skeleton.vue +0 -142
- package/src/components/Skeleton/index.js +0 -3
- package/src/components/Step/Step.vue +0 -237
- package/src/components/Step/index.js +0 -3
- package/src/components/Steps/Steps.vue +0 -15
- package/src/components/Steps/index.js +0 -3
- package/src/components/TesteToCurrency.vue +0 -171
- package/src/components/Tip/Tip.vue +0 -210
- package/src/components/Tip/index.js +0 -3
- package/src/components/ValueSelector.vue +0 -60
- package/src/components/autosuggestMixin.js +0 -301
- package/src/components/index.js +0 -34
- package/src/locale/i18nCreator.js +0 -169
- package/src/locale/lang/en.js +0 -35
- package/src/locale/lang/pt-br.js +0 -35
- package/src/main.js +0 -21
- package/src/mixins/floatFormatter.js +0 -49
- package/src/plugins/currency.js +0 -100
- package/src/utils/browser.js +0 -6
- package/src/utils/constants.js +0 -3
- package/src/utils/error.js +0 -22
- package/src/utils/filters.js +0 -71
- package/src/utils/helpers.js +0 -41
- package/src/utils/i18n.js +0 -2
- package/src/utils/icon.js +0 -35
- package/src/utils/index.js +0 -20
- package/src/utils/objects.js +0 -17
- package/src/utils/runtime.js +0 -86
- package/src/utils/scroll.js +0 -100
- package/src/utils/strings.js +0 -17
- package/src/utils/style.js +0 -80
- package/src/utils/types.js +0 -39
- package/src/utils/use-derived-namespace.js +0 -112
- package/src/utils/use-form-common-props.js +0 -41
- package/src/utils/use-form-item.js +0 -80
- package/src/utils/use-id.js +0 -40
- package/src/utils/use-input.js +0 -33
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { computed, getCurrentInstance, inject, ref, unref } from 'vue'
|
|
2
|
-
|
|
3
|
-
export const defaultNamespace = 'el'
|
|
4
|
-
const statePrefix = 'is-'
|
|
5
|
-
|
|
6
|
-
const _bem = (
|
|
7
|
-
namespace,
|
|
8
|
-
block,
|
|
9
|
-
blockSuffix,
|
|
10
|
-
element,
|
|
11
|
-
modifier
|
|
12
|
-
) => {
|
|
13
|
-
let cls = `${namespace}-${block}`
|
|
14
|
-
if (blockSuffix) {
|
|
15
|
-
cls += `-${blockSuffix}`
|
|
16
|
-
}
|
|
17
|
-
if (element) {
|
|
18
|
-
cls += `__${element}`
|
|
19
|
-
}
|
|
20
|
-
if (modifier) {
|
|
21
|
-
cls += `--${modifier}`
|
|
22
|
-
}
|
|
23
|
-
return cls
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const namespaceContextKey =
|
|
27
|
-
Symbol('namespaceContextKey')
|
|
28
|
-
|
|
29
|
-
export const useGetDerivedNamespace = ( namespaceOverrides) => {
|
|
30
|
-
const derivedNamespace =
|
|
31
|
-
namespaceOverrides ||
|
|
32
|
-
(getCurrentInstance()
|
|
33
|
-
? inject(namespaceContextKey, ref(defaultNamespace))
|
|
34
|
-
: ref(defaultNamespace))
|
|
35
|
-
const namespace = computed(() => {
|
|
36
|
-
return unref(derivedNamespace) || defaultNamespace
|
|
37
|
-
})
|
|
38
|
-
return namespace
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const useNamespace = ( block, namespaceOverrides) => {
|
|
42
|
-
const namespace = useGetDerivedNamespace(namespaceOverrides)
|
|
43
|
-
const b = (blockSuffix = '') =>
|
|
44
|
-
_bem(namespace.value, block, blockSuffix, '', '')
|
|
45
|
-
const e = (element) =>
|
|
46
|
-
element ? _bem(namespace.value, block, '', element, '') : ''
|
|
47
|
-
const m = (modifier) =>
|
|
48
|
-
modifier ? _bem(namespace.value, block, '', '', modifier) : ''
|
|
49
|
-
const be = (blockSuffix, element) =>
|
|
50
|
-
blockSuffix && element
|
|
51
|
-
? _bem(namespace.value, block, blockSuffix, element, '')
|
|
52
|
-
: ''
|
|
53
|
-
const em = (element, modifier) =>
|
|
54
|
-
element && modifier
|
|
55
|
-
? _bem(namespace.value, block, '', element, modifier)
|
|
56
|
-
: ''
|
|
57
|
-
const bm = (blockSuffix, modifier) =>
|
|
58
|
-
blockSuffix && modifier
|
|
59
|
-
? _bem(namespace.value, block, blockSuffix, '', modifier)
|
|
60
|
-
: ''
|
|
61
|
-
const bem = (blockSuffix, element, modifier) =>
|
|
62
|
-
blockSuffix && element && modifier
|
|
63
|
-
? _bem(namespace.value, block, blockSuffix, element, modifier)
|
|
64
|
-
: ''
|
|
65
|
-
const is = (name, ...args) => {
|
|
66
|
-
const state = args.length >= 1 ? args[0] : true
|
|
67
|
-
return name && state ? `${statePrefix}${name}` : ''
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// for css var
|
|
71
|
-
// --el-xxx: value;
|
|
72
|
-
const cssVar = (object) => {
|
|
73
|
-
const styles = {}
|
|
74
|
-
for (const key in object) {
|
|
75
|
-
if (object[key]) {
|
|
76
|
-
styles[`--${namespace.value}-${key}`] = object[key]
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return styles
|
|
80
|
-
}
|
|
81
|
-
// with block
|
|
82
|
-
const cssVarBlock = (object) => {
|
|
83
|
-
const styles = {}
|
|
84
|
-
for (const key in object) {
|
|
85
|
-
if (object[key]) {
|
|
86
|
-
styles[`--${namespace.value}-${block}-${key}`] = object[key]
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return styles
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const cssVarName = (name) => `--${namespace.value}-${name}`
|
|
93
|
-
const cssVarBlockName = (name) =>
|
|
94
|
-
`--${namespace.value}-${block}-${name}`
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
namespace,
|
|
98
|
-
b,
|
|
99
|
-
e,
|
|
100
|
-
m,
|
|
101
|
-
be,
|
|
102
|
-
em,
|
|
103
|
-
bm,
|
|
104
|
-
bem,
|
|
105
|
-
is,
|
|
106
|
-
// css
|
|
107
|
-
cssVar,
|
|
108
|
-
cssVarName,
|
|
109
|
-
cssVarBlock,
|
|
110
|
-
cssVarBlockName,
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { computed, inject, ref, unref } from 'vue'
|
|
2
|
-
import { useGlobalSize, useProp } from 'element-plus/es/hooks/index'
|
|
3
|
-
import { formContextKey, formItemContextKey } from '@/utils'
|
|
4
|
-
|
|
5
|
-
export const useFormSize = (
|
|
6
|
-
fallback,
|
|
7
|
-
ignore = {}
|
|
8
|
-
) => {
|
|
9
|
-
const emptyRef = ref(undefined)
|
|
10
|
-
|
|
11
|
-
const size = ignore.prop ? emptyRef : useProp('size')
|
|
12
|
-
const globalConfig = ignore.global ? emptyRef : useGlobalSize()
|
|
13
|
-
const form = ignore.form
|
|
14
|
-
? { size: undefined }
|
|
15
|
-
: inject(formContextKey, undefined)
|
|
16
|
-
const formItem = ignore.formItem
|
|
17
|
-
? { size: undefined }
|
|
18
|
-
: inject(formItemContextKey, undefined)
|
|
19
|
-
|
|
20
|
-
return computed(
|
|
21
|
-
() =>
|
|
22
|
-
size.value ||
|
|
23
|
-
unref(fallback) ||
|
|
24
|
-
formItem?.size ||
|
|
25
|
-
form?.size ||
|
|
26
|
-
globalConfig.value ||
|
|
27
|
-
''
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const useFormDisabled = (fallback) => {
|
|
32
|
-
const disabled = useProp('disabled')
|
|
33
|
-
const form = inject(formContextKey, undefined)
|
|
34
|
-
return computed(
|
|
35
|
-
() => disabled.value || unref(fallback) || form?.disabled || false
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// These exports are used for preventing breaking changes
|
|
40
|
-
export const useSize = useFormSize
|
|
41
|
-
export const useDisabled = useFormDisabled
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
|
2
|
-
import {
|
|
3
|
-
computed,
|
|
4
|
-
inject,
|
|
5
|
-
onMounted,
|
|
6
|
-
onUnmounted,
|
|
7
|
-
ref,
|
|
8
|
-
toRef,
|
|
9
|
-
watch,
|
|
10
|
-
} from 'vue'
|
|
11
|
-
import { useId, formContextKey, formItemContextKey } from '@/utils'
|
|
12
|
-
|
|
13
|
-
export const useFormItem = () => {
|
|
14
|
-
const form = inject(formContextKey, undefined)
|
|
15
|
-
const formItem = inject(formItemContextKey, undefined)
|
|
16
|
-
return {
|
|
17
|
-
form,
|
|
18
|
-
formItem,
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const useFormItemInputId = (
|
|
23
|
-
props,
|
|
24
|
-
{
|
|
25
|
-
formItemContext,
|
|
26
|
-
disableIdGeneration,
|
|
27
|
-
disableIdManagement,
|
|
28
|
-
}
|
|
29
|
-
) => {
|
|
30
|
-
if (!disableIdGeneration) {
|
|
31
|
-
disableIdGeneration = ref(false)
|
|
32
|
-
}
|
|
33
|
-
if (!disableIdManagement) {
|
|
34
|
-
disableIdManagement = ref(false)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const inputId = ref()
|
|
38
|
-
let idUnwatch
|
|
39
|
-
|
|
40
|
-
const isLabeledByFormItem = computed(() => {
|
|
41
|
-
return !!(
|
|
42
|
-
!props.label &&
|
|
43
|
-
formItemContext &&
|
|
44
|
-
formItemContext.inputIds &&
|
|
45
|
-
formItemContext.inputIds?.length <= 1
|
|
46
|
-
)
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
// Generate id for ElFormItem label if not provided as prop
|
|
50
|
-
onMounted(() => {
|
|
51
|
-
idUnwatch = watch(
|
|
52
|
-
[toRef(props, 'id'), disableIdGeneration],
|
|
53
|
-
([id, disableIdGeneration]) => {
|
|
54
|
-
const newId = id ?? (!disableIdGeneration ? useId().value : undefined)
|
|
55
|
-
if (newId !== inputId.value) {
|
|
56
|
-
if (formItemContext?.removeInputId) {
|
|
57
|
-
inputId.value && formItemContext.removeInputId(inputId.value)
|
|
58
|
-
if (!disableIdManagement?.value && !disableIdGeneration && newId) {
|
|
59
|
-
formItemContext.addInputId(newId)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
inputId.value = newId
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{ immediate: true }
|
|
66
|
-
)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
onUnmounted(() => {
|
|
70
|
-
idUnwatch && idUnwatch()
|
|
71
|
-
if (formItemContext?.removeInputId) {
|
|
72
|
-
inputId.value && formItemContext.removeInputId(inputId.value)
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
isLabeledByFormItem,
|
|
78
|
-
inputId,
|
|
79
|
-
}
|
|
80
|
-
}
|
package/src/utils/use-id.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { computed, getCurrentInstance, inject, unref } from 'vue'
|
|
2
|
-
import { debugWarn, isClient } from '@/utils'
|
|
3
|
-
import { useGetDerivedNamespace } from '@/utils'
|
|
4
|
-
|
|
5
|
-
const defaultIdInjection = {
|
|
6
|
-
prefix: Math.floor(Math.random() * 10000),
|
|
7
|
-
current: 0,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const ID_INJECTION_KEY =
|
|
11
|
-
Symbol('elIdInjection')
|
|
12
|
-
|
|
13
|
-
export const useIdInjection = () => {
|
|
14
|
-
return getCurrentInstance()
|
|
15
|
-
? inject(ID_INJECTION_KEY, defaultIdInjection)
|
|
16
|
-
: defaultIdInjection
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const useId = (deterministicId) => {
|
|
20
|
-
const idInjection = useIdInjection()
|
|
21
|
-
if (!isClient && idInjection === defaultIdInjection) {
|
|
22
|
-
debugWarn(
|
|
23
|
-
'IdInjection',
|
|
24
|
-
`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
25
|
-
usage: app.provide(ID_INJECTION_KEY, {
|
|
26
|
-
prefix: number,
|
|
27
|
-
current: number,
|
|
28
|
-
})`
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const namespace = useGetDerivedNamespace()
|
|
33
|
-
const idRef = computed(
|
|
34
|
-
() =>
|
|
35
|
-
unref(deterministicId) ||
|
|
36
|
-
`${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
return idRef
|
|
40
|
-
}
|
package/src/utils/use-input.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable vue/prefer-import-from-vue */
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import { isFunction } from '@vue/shared'
|
|
4
|
-
import { isKorean } from '@/utils'
|
|
5
|
-
|
|
6
|
-
export function useInput (handleInput = (event) => {}) {
|
|
7
|
-
const isComposing = ref(false)
|
|
8
|
-
|
|
9
|
-
const handleCompositionStart = () => {
|
|
10
|
-
isComposing.value = true
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const handleCompositionUpdate = (event) => {
|
|
14
|
-
const text = event.target.value
|
|
15
|
-
const lastCharacter = text[text.length - 1] || ''
|
|
16
|
-
isComposing.value = !isKorean(lastCharacter)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const handleCompositionEnd = (event) => {
|
|
20
|
-
if (isComposing.value) {
|
|
21
|
-
isComposing.value = false
|
|
22
|
-
if (isFunction(handleInput)) {
|
|
23
|
-
handleInput(event)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
handleCompositionStart,
|
|
30
|
-
handleCompositionUpdate,
|
|
31
|
-
handleCompositionEnd,
|
|
32
|
-
}
|
|
33
|
-
}
|