@tagplus/components 4.7.12 → 5.1.0

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 (88) hide show
  1. package/dist/tp.common.js +2 -1
  2. package/dist/tp.common.js.LICENSE.txt +9 -0
  3. package/dist/tp.common.js.map +1 -1
  4. package/dist/tp.common.lang-tp-en-js.js +2 -0
  5. package/dist/tp.common.lang-tp-en-js.js.map +1 -0
  6. package/dist/tp.css +11 -167
  7. package/dist/tp.umd.js +2 -1
  8. package/dist/tp.umd.js.LICENSE.txt +9 -0
  9. package/dist/tp.umd.js.map +1 -1
  10. package/dist/tp.umd.lang-tp-en-js.js +2 -0
  11. package/dist/tp.umd.lang-tp-en-js.js.map +1 -0
  12. package/dist/tp.umd.min.js +2 -1
  13. package/dist/tp.umd.min.js.LICENSE.txt +9 -0
  14. package/dist/tp.umd.min.js.map +1 -1
  15. package/dist/tp.umd.min.lang-tp-en-js.js +2 -0
  16. package/dist/tp.umd.min.lang-tp-en-js.js.map +1 -0
  17. package/package.json +51 -50
  18. package/src/assets/scss/_fonts.scss +24 -23
  19. package/src/assets/scss/_helpers.scss +4 -0
  20. package/src/assets/scss/_mixins.scss +2 -2
  21. package/src/assets/scss/_overrides.scss +5 -52
  22. package/src/assets/scss/_resass.scss +21 -12
  23. package/src/assets/scss/_variables.scss +0 -1
  24. package/src/assets/scss/index.scss +1 -4
  25. package/src/components/Autosuggest/Autosuggest.vue +340 -767
  26. package/src/components/Autosuggest/Multisuggest.vue +22 -0
  27. package/src/components/Autosuggest/autosuggest-props.js +210 -0
  28. package/src/components/Autosuggest/autosuggest-style.scss +127 -0
  29. package/src/components/Autosuggest/core.js +63 -0
  30. package/src/components/Autosuggest/index.js +2 -0
  31. package/src/components/Autosuggest/multisuggest-props.js +9 -0
  32. package/src/components/Autosuggest/option.vue +136 -0
  33. package/src/components/Autosuggest/select-dropdown.vue +64 -0
  34. package/src/components/Autosuggest/useOption.js +120 -0
  35. package/src/components/Autosuggest/useSelect.js +1133 -0
  36. package/src/components/AutosuggestTest.vue +56 -0
  37. package/src/components/CardExemplo.vue +49 -0
  38. package/src/components/CodeSample.vue +78 -0
  39. package/src/components/Inline/Inline.vue +24 -32
  40. package/src/components/InputNumber/InputNumber.vue +329 -378
  41. package/src/components/InputNumber/input-number.js +135 -0
  42. package/src/components/Loader/Loader.vue +42 -53
  43. package/src/components/Loader/animations.scss +13 -0
  44. package/src/components/Money/Money.vue +11 -20
  45. package/src/components/Multisuggest/index.js +2 -3
  46. package/src/components/MultisuggestTest.vue +56 -0
  47. package/src/components/OptionsList/OptionsList.vue +7 -6
  48. package/src/components/OptionsListItem/OptionsListItem.vue +46 -42
  49. package/src/components/Percent/Percent.vue +8 -14
  50. package/src/components/Skeleton/Skeleton.vue +16 -11
  51. package/src/components/Step/Step.vue +42 -35
  52. package/src/components/Steps/Steps.vue +4 -7
  53. package/src/components/TesteToCurrency.vue +171 -0
  54. package/src/components/Tip/Tip.vue +45 -30
  55. package/src/components/ValueSelector.vue +60 -0
  56. package/src/components/autosuggestMixin.js +301 -0
  57. package/src/components/index.js +4 -1
  58. package/src/locale/i18n.js +162 -0
  59. package/src/locale/lang/en.js +3 -2
  60. package/src/locale/lang/pt-br.js +3 -2
  61. package/src/main.js +8 -14
  62. package/src/mixins/floatFormatter.js +12 -16
  63. package/src/plugins/currency.js +100 -0
  64. package/src/utils/browser.js +6 -0
  65. package/src/utils/constants.js +3 -0
  66. package/src/utils/error.js +22 -0
  67. package/src/utils/filters.js +1 -14
  68. package/src/utils/helpers.js +41 -0
  69. package/src/utils/i18n.js +2 -0
  70. package/src/utils/icon.js +35 -0
  71. package/src/utils/index.js +20 -0
  72. package/src/utils/objects.js +17 -0
  73. package/src/utils/runtime.js +86 -0
  74. package/src/utils/scroll.js +100 -0
  75. package/src/utils/strings.js +17 -0
  76. package/src/utils/style.js +80 -0
  77. package/src/utils/types.js +39 -0
  78. package/src/utils/use-derived-namespace.js +112 -0
  79. package/src/utils/use-form-common-props.js +41 -0
  80. package/src/utils/use-form-item.js +80 -0
  81. package/src/utils/use-id.js +40 -0
  82. package/src/utils/use-input.js +33 -0
  83. package/src/components/Dialog/Dialog.vue +0 -253
  84. package/src/components/Dialog/index.js +0 -3
  85. package/src/components/Multisuggest/Multisuggest.vue +0 -858
  86. package/src/locale/index.js +0 -78
  87. package/src/mixins/locale.js +0 -9
  88. package/src/utils/currency.js +0 -180
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <tp-autosuggest
3
+ :id="_id"
4
+ :model-value="modelValue"
5
+ :placeholder="$t($options.placeholder)"
6
+ :label-key="$options.labelKey"
7
+ :remote-method="remoteMethod"
8
+ :suggestions="list"
9
+ :loading="loading"
10
+ :load-on-create="isLoadOnCreate"
11
+ :disabled="_disabled"
12
+ :allow-create="true"
13
+ :multiple="false"
14
+ @update:model-value="autosuggestMixin_input"
15
+ @handleOptionClick="autosuggestMixin_handleCreate"
16
+ @change="autosuggestMixin_handleChange"
17
+ />
18
+ </template>
19
+
20
+ <script>
21
+ import { defineComponent } from 'vue'
22
+ import AutosuggestsMixin from '@/components/autosuggestMixin'
23
+
24
+ export default defineComponent({
25
+ name: 'AutosuggestTest',
26
+ valueKey: 'id',
27
+ labelKey: 'name',
28
+ placeholder: 'common.placeholder',
29
+
30
+ mixins: [AutosuggestsMixin],
31
+
32
+ data () {
33
+ return {
34
+ uri: 'https://jsonplaceholder.typicode.com/users',
35
+ loading: false
36
+ }
37
+ },
38
+
39
+ methods: {
40
+ remoteMethod (query) {
41
+ this.loading = true
42
+ this.axios
43
+ .get(`${this.uri}?q=${query}`)
44
+ .then(res => {
45
+ this.list = res.data
46
+ this.loading = false
47
+ })
48
+ .catch(err => {
49
+ console.log(err)
50
+ this.loading = false
51
+ this.list = []
52
+ })
53
+ }
54
+ }
55
+ })
56
+ </script>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <el-container class="component-sample">
3
+ <el-header>
4
+ {{ title }}
5
+ </el-header>
6
+ <el-main>
7
+ <el-scrollbar>
8
+ <el-row class="scrollbar-flex-content" justify="center">
9
+ <slot name="default" />
10
+ </el-row>
11
+ </el-scrollbar>
12
+ </el-main>
13
+ <slot name="codeSamples" />
14
+ </el-container>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name:'CardExemplo',
20
+
21
+ props: {
22
+ title: {
23
+ type: String,
24
+ required: true
25
+ },
26
+ },
27
+ }
28
+ </script>
29
+
30
+ <style lang="scss" scoped>
31
+ .component-sample {
32
+ margin: 0px auto;
33
+ margin-bottom: 16px;
34
+ max-width: 700px;
35
+ border: 1px #ccc solid;
36
+ border-radius: 10px;
37
+ padding: 8px;
38
+ background-color: #919191;
39
+
40
+ header.el-header {
41
+ font-size: 17px;
42
+ font-weight: bold;
43
+ color: #fff;
44
+ border-bottom: 1px solid $--border-color-lighter;
45
+ text-align: center;
46
+ height: auto;
47
+ }
48
+ }
49
+ </style>
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div class="code-sample">
3
+ <el-row class="code-sample-description">
4
+ <span v-html="description" />
5
+ </el-row>
6
+ <el-row class="code-sample-code">
7
+ <pre>
8
+ <slot>
9
+ {{ formattedCode }}
10
+ </slot>
11
+ </pre>
12
+ </el-row>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import { onMounted, ref, watch } from 'vue'
18
+ export default {
19
+ name: 'CodeSample',
20
+ props: {
21
+ description: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+ code: {
26
+ required: false
27
+ },
28
+ /**
29
+ * Se vai observar as alterações na variável code
30
+ */
31
+ reactive: {
32
+ type: Boolean,
33
+ default: false
34
+ }
35
+ },
36
+
37
+ setup (props) {
38
+ let formattedCode = ref('')
39
+ const handler = (newValue, oldValue) => {
40
+ const code = props.code ?? 'undefined'
41
+ formattedCode.value = '\n' + JSON.stringify(code, undefined, 2).trim()
42
+ }
43
+
44
+ if (props.reactive){
45
+ watch(() => props.code, handler)
46
+ }
47
+
48
+ onMounted(handler)
49
+ return {
50
+ formattedCode
51
+ }
52
+ }
53
+ }
54
+ </script>
55
+
56
+ <style lang="scss" scoped>
57
+ .code-sample{
58
+ background-color: #eee;
59
+ border-radius: 8px;
60
+ }
61
+ .code-sample-description {
62
+ font-size: 14px;
63
+ padding: 8px;
64
+ }
65
+ .code-sample-code {
66
+ pre {
67
+ display: inline-flex;
68
+ width: 100%;
69
+ margin: 0;
70
+ font-family: monospace;
71
+ background-color: #444;
72
+ color: #eee;
73
+ padding: 10px 10px 0 10px;
74
+ border-bottom-left-radius: 8px;
75
+ border-bottom-right-radius: 8px;
76
+ }
77
+ }
78
+ </style>
@@ -1,12 +1,6 @@
1
1
  <template>
2
- <div
3
- :id="`${_id}-wrapper`"
4
- class="tp-inline"
5
- >
6
- <span
7
- v-if="hideInput || readonly"
8
- data-tid="inline-span"
9
- >
2
+ <div :id="`${_id}-wrapper`" class="tp-inline">
3
+ <span v-if="hideInput || readonly" data-tid="inline-span">
10
4
  <a
11
5
  :id="`${_id}-toggle`"
12
6
  tabindex="0"
@@ -14,37 +8,37 @@
14
8
  @keypress.enter="toggleInput"
15
9
  >
16
10
  <span data-tid="inline-value">{{ value }}</span>
17
- <small
18
- v-if="!readonly"
19
- class="el-icon-edit"
20
- />
11
+ <small v-if="!readonly" class="el-icon-edit" />
21
12
  </a>
22
13
  </span>
23
14
  <el-input
24
15
  v-else
25
16
  :id="`${_id}-input`"
26
17
  ref="inlineInput"
27
- :value="value"
18
+ :model-value="value"
28
19
  data-tid="inline-input"
29
20
  @input="input"
30
21
  @blur="blur"
31
- @keypress.enter.native="toggleInput"
22
+ @keypress.enter="toggleInput"
32
23
  >
33
- <el-button
34
- :id="`${_id}-btn`"
35
- slot="append"
36
- icon="el-icon-check"
37
- data-tid="inline-button"
38
- @click="toggleInput"
39
- >
40
- {{ buttonText }}
41
- </el-button>
24
+ <template #append>
25
+ <el-button
26
+ :id="`${_id}-btn`"
27
+ :icon="ElIconCheck"
28
+ data-tid="inline-button"
29
+ @click="toggleInput"
30
+ >
31
+ {{ buttonText }}
32
+ </el-button>
33
+ </template>
42
34
  </el-input>
43
35
  </div>
44
36
  </template>
45
37
 
46
38
  <script>
47
- export default {
39
+ import { defineComponent } from 'vue'
40
+ import { Check as ElIconCheck } from '@element-plus/icons-vue'
41
+ export default defineComponent({
48
42
  name: 'TpInline',
49
43
  props: {
50
44
  id: {
@@ -73,23 +67,21 @@ export default {
73
67
  default: 'Ok'
74
68
  }
75
69
  },
76
-
70
+ emits: ['input', 'change', 'blur'],
77
71
  data () {
78
72
  return {
79
- hideInput: true
73
+ hideInput: true,
74
+ ElIconCheck
80
75
  }
81
76
  },
82
-
83
77
  computed: {
84
78
  _id () {
85
79
  return this.id || this.$options.name
86
80
  }
87
81
  },
88
-
89
82
  mounted () {
90
83
  this.hideInput = this.inputHidden
91
84
  },
92
-
93
85
  methods: {
94
86
  toggleInput () {
95
87
  const status = !this.hideInput
@@ -114,9 +106,8 @@ export default {
114
106
  blur (event) {
115
107
  this.$emit('blur', event)
116
108
  }
117
-
118
109
  }
119
- }
110
+ })
120
111
  </script>
121
112
 
122
113
  <style lang="scss" scoped>
@@ -127,13 +118,14 @@ export default {
127
118
  border-color: $--color-primary;
128
119
  color: $--color-white;
129
120
  height: 100%;
130
- border-radius: 0px
121
+ border-radius: 0;
131
122
  }
132
123
 
133
124
  > span {
134
125
  display: inline-block;
135
126
  padding: 12px 0;
136
127
  }
128
+
137
129
  a {
138
130
  cursor: pointer;
139
131
  display: inline-block;