@tagplus/components 5.3.4 → 5.3.6

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 (203) hide show
  1. package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
  2. package/dist/es/components.css +2391 -0
  3. package/dist/es/node_modules/@element-plus/icons-vue/dist/index.mjs +148 -0
  4. package/dist/es/node_modules/@popperjs/core/lib/enums.mjs +22 -0
  5. package/dist/es/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +28 -0
  6. package/dist/es/node_modules/@vueuse/core/index.mjs +172 -0
  7. package/dist/es/node_modules/@vueuse/shared/index.mjs +68 -0
  8. package/dist/es/node_modules/element-plus/es/constants/size.mjs +4 -0
  9. package/dist/es/node_modules/element-plus/es/hooks/use-focus-controller/index.mjs +64 -0
  10. package/dist/es/node_modules/element-plus/es/hooks/use-id/index.mjs +30 -0
  11. package/dist/es/node_modules/element-plus/es/hooks/use-locale/index.mjs +29 -0
  12. package/dist/es/node_modules/element-plus/es/hooks/use-namespace/index.mjs +79 -0
  13. package/dist/es/node_modules/element-plus/es/hooks/use-prop/index.mjs +11 -0
  14. package/dist/es/node_modules/element-plus/es/hooks/use-size/index.mjs +20 -0
  15. package/dist/es/node_modules/element-plus/es/locale/lang/en.mjs +182 -0
  16. package/dist/es/node_modules/element-plus/es/utils/error.mjs +16 -0
  17. package/dist/es/node_modules/element-plus/es/utils/types.mjs +9 -0
  18. package/dist/es/node_modules/element-plus/es/utils/vue/props/runtime.mjs +42 -0
  19. package/dist/es/src/components/Autosuggest/Autosuggest.vue.mjs +446 -0
  20. package/dist/es/src/components/Autosuggest/Multisuggest.vue.mjs +17 -0
  21. package/dist/es/src/components/Autosuggest/autosuggest-props.mjs +204 -0
  22. package/dist/es/src/components/Autosuggest/core.mjs +62 -0
  23. package/dist/es/src/components/Autosuggest/multisuggest-props.mjs +11 -0
  24. package/dist/es/src/components/Autosuggest/option.vue.mjs +118 -0
  25. package/dist/es/src/components/Autosuggest/select-dropdown.vue.mjs +62 -0
  26. package/dist/es/src/components/Autosuggest/useOption.mjs +93 -0
  27. package/dist/es/src/components/Autosuggest/useSelect.mjs +803 -0
  28. package/dist/es/src/components/Inline/Inline.vue.mjs +130 -0
  29. package/dist/es/src/components/Inline/index.mjs +4 -0
  30. package/dist/es/src/components/InputNumber/InputNumber.vue.mjs +358 -0
  31. package/dist/es/src/components/InputNumber/index.mjs +4 -0
  32. package/dist/es/src/components/InputNumber/input-number.mjs +128 -0
  33. package/dist/es/src/components/Loader/Loader.vue.mjs +59 -0
  34. package/dist/es/src/components/Loader/index.mjs +4 -0
  35. package/dist/es/src/components/Money/Money.vue.mjs +76 -0
  36. package/dist/es/src/components/Money/index.mjs +4 -0
  37. package/dist/es/src/components/Multisuggest/index.mjs +4 -0
  38. package/dist/es/src/components/OptionsList/OptionsList.vue.mjs +28 -0
  39. package/dist/es/src/components/OptionsList/index.mjs +4 -0
  40. package/dist/es/src/components/OptionsListItem/OptionsListItem.vue.mjs +96 -0
  41. package/dist/es/src/components/OptionsListItem/index.mjs +4 -0
  42. package/dist/es/src/components/Percent/Percent.vue.mjs +77 -0
  43. package/dist/es/src/components/Percent/index.mjs +4 -0
  44. package/dist/es/src/components/Skeleton/Skeleton.vue.mjs +79 -0
  45. package/dist/es/src/components/Skeleton/index.mjs +4 -0
  46. package/dist/es/src/components/Step/Step.vue.mjs +206 -0
  47. package/dist/es/src/components/Step/index.mjs +4 -0
  48. package/dist/es/src/components/Steps/Steps.vue.mjs +15 -0
  49. package/dist/es/src/components/Steps/index.mjs +4 -0
  50. package/dist/es/src/components/Tip/Tip.vue.mjs +165 -0
  51. package/dist/es/src/components/Tip/index.mjs +4 -0
  52. package/dist/es/src/components/index.mjs +22 -0
  53. package/dist/es/src/locale/i18nCreator.mjs +93 -0
  54. package/dist/es/src/locale/lang/pt-br.mjs +21 -0
  55. package/dist/es/src/main.mjs +18 -0
  56. package/dist/es/src/mixins/floatFormatter.mjs +42 -0
  57. package/dist/es/src/plugins/currency.mjs +69 -0
  58. package/dist/es/src/utils/constants.mjs +6 -0
  59. package/dist/es/src/utils/error.mjs +20 -0
  60. package/dist/es/src/utils/i18n.mjs +4 -0
  61. package/dist/es/src/utils/icon.mjs +9 -0
  62. package/dist/es/src/utils/index.mjs +8 -0
  63. package/dist/es/src/utils/runtime.mjs +50 -0
  64. package/dist/es/src/utils/scroll.mjs +26 -0
  65. package/dist/es/src/utils/strings.mjs +4 -0
  66. package/dist/es/src/utils/types.mjs +9 -0
  67. package/dist/es/src/utils/use-derived-namespace.mjs +15 -0
  68. package/dist/es/src/utils/use-form-common-props.mjs +25 -0
  69. package/dist/es/src/utils/use-form-item.mjs +61 -0
  70. package/dist/es/src/utils/use-id.mjs +35 -0
  71. package/dist/es/src/utils/use-input.mjs +31 -0
  72. package/{src/locale → dist}/lang/en.js +3 -2
  73. package/{src/locale → dist}/lang/pt-br.js +3 -2
  74. package/dist/lib/_virtual/_plugin-vue_export-helper.js +10 -0
  75. package/dist/lib/components.css +2391 -0
  76. package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +148 -0
  77. package/dist/lib/node_modules/@popperjs/core/lib/enums.js +22 -0
  78. package/dist/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +28 -0
  79. package/dist/lib/node_modules/@vueuse/core/index.js +170 -0
  80. package/dist/lib/node_modules/@vueuse/shared/index.js +68 -0
  81. package/dist/lib/node_modules/element-plus/es/constants/size.js +4 -0
  82. package/dist/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +64 -0
  83. package/dist/lib/node_modules/element-plus/es/hooks/use-id/index.js +30 -0
  84. package/dist/lib/node_modules/element-plus/es/hooks/use-locale/index.js +29 -0
  85. package/dist/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +79 -0
  86. package/dist/lib/node_modules/element-plus/es/hooks/use-prop/index.js +11 -0
  87. package/dist/lib/node_modules/element-plus/es/hooks/use-size/index.js +20 -0
  88. package/dist/lib/node_modules/element-plus/es/locale/lang/en.js +182 -0
  89. package/dist/lib/node_modules/element-plus/es/utils/error.js +16 -0
  90. package/dist/lib/node_modules/element-plus/es/utils/types.js +9 -0
  91. package/dist/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +42 -0
  92. package/dist/lib/src/components/Autosuggest/Autosuggest.vue.js +446 -0
  93. package/dist/lib/src/components/Autosuggest/Multisuggest.vue.js +17 -0
  94. package/dist/lib/src/components/Autosuggest/autosuggest-props.js +204 -0
  95. package/dist/lib/src/components/Autosuggest/core.js +62 -0
  96. package/dist/lib/src/components/Autosuggest/multisuggest-props.js +11 -0
  97. package/dist/lib/src/components/Autosuggest/option.vue.js +118 -0
  98. package/dist/lib/src/components/Autosuggest/select-dropdown.vue.js +62 -0
  99. package/dist/lib/src/components/Autosuggest/useOption.js +93 -0
  100. package/dist/lib/src/components/Autosuggest/useSelect.js +803 -0
  101. package/dist/lib/src/components/Inline/Inline.vue.js +130 -0
  102. package/dist/lib/src/components/Inline/index.js +4 -0
  103. package/dist/lib/src/components/InputNumber/InputNumber.vue.js +358 -0
  104. package/dist/lib/src/components/InputNumber/index.js +4 -0
  105. package/dist/lib/src/components/InputNumber/input-number.js +128 -0
  106. package/dist/lib/src/components/Loader/Loader.vue.js +59 -0
  107. package/dist/lib/src/components/Loader/index.js +4 -0
  108. package/dist/lib/src/components/Money/Money.vue.js +76 -0
  109. package/dist/lib/src/components/Money/index.js +4 -0
  110. package/dist/lib/src/components/Multisuggest/index.js +4 -0
  111. package/dist/lib/src/components/OptionsList/OptionsList.vue.js +28 -0
  112. package/dist/lib/src/components/OptionsList/index.js +4 -0
  113. package/dist/lib/src/components/OptionsListItem/OptionsListItem.vue.js +96 -0
  114. package/dist/lib/src/components/OptionsListItem/index.js +4 -0
  115. package/dist/lib/src/components/Percent/Percent.vue.js +77 -0
  116. package/dist/lib/src/components/Percent/index.js +4 -0
  117. package/dist/lib/src/components/Skeleton/Skeleton.vue.js +79 -0
  118. package/dist/lib/src/components/Skeleton/index.js +4 -0
  119. package/dist/lib/src/components/Step/Step.vue.js +206 -0
  120. package/dist/lib/src/components/Step/index.js +4 -0
  121. package/dist/lib/src/components/Steps/Steps.vue.js +15 -0
  122. package/dist/lib/src/components/Steps/index.js +4 -0
  123. package/dist/lib/src/components/Tip/Tip.vue.js +165 -0
  124. package/dist/lib/src/components/Tip/index.js +4 -0
  125. package/dist/lib/src/components/index.js +22 -0
  126. package/dist/lib/src/locale/i18nCreator.js +93 -0
  127. package/dist/lib/src/locale/lang/pt-br.js +21 -0
  128. package/dist/lib/src/main.js +18 -0
  129. package/dist/lib/src/mixins/floatFormatter.js +42 -0
  130. package/dist/lib/src/plugins/currency.js +69 -0
  131. package/dist/lib/src/utils/constants.js +6 -0
  132. package/dist/lib/src/utils/error.js +20 -0
  133. package/dist/lib/src/utils/i18n.js +4 -0
  134. package/dist/lib/src/utils/icon.js +9 -0
  135. package/dist/lib/src/utils/index.js +8 -0
  136. package/dist/lib/src/utils/runtime.js +50 -0
  137. package/dist/lib/src/utils/scroll.js +26 -0
  138. package/dist/lib/src/utils/strings.js +4 -0
  139. package/dist/lib/src/utils/types.js +12 -0
  140. package/dist/lib/src/utils/use-derived-namespace.js +15 -0
  141. package/dist/lib/src/utils/use-form-common-props.js +25 -0
  142. package/dist/lib/src/utils/use-form-item.js +61 -0
  143. package/dist/lib/src/utils/use-id.js +35 -0
  144. package/dist/lib/src/utils/use-input.js +31 -0
  145. package/package.json +85 -62
  146. package/dist/demo.html +0 -1
  147. package/dist/fonts/bevi-bold.7e4dcd11.woff +0 -0
  148. package/dist/fonts/bevi-bold.873def84.woff2 +0 -0
  149. package/dist/fonts/bevi-medium.6187e050.woff2 +0 -0
  150. package/dist/fonts/bevi-medium.65b3056d.woff +0 -0
  151. package/dist/fonts/bevi-regular.c89f126e.woff +0 -0
  152. package/dist/fonts/bevi-regular.f81e4b8f.woff2 +0 -0
  153. package/dist/tp.common.js +0 -2
  154. package/dist/tp.common.js.map +0 -1
  155. package/dist/tp.css +0 -167
  156. package/dist/tp.umd.js +0 -2
  157. package/dist/tp.umd.js.map +0 -1
  158. package/dist/tp.umd.min.js +0 -2
  159. package/dist/tp.umd.min.js.map +0 -1
  160. package/src/assets/scss/_fonts.scss +0 -27
  161. package/src/assets/scss/_functions.scss +0 -22
  162. package/src/assets/scss/_helpers.scss +0 -112
  163. package/src/assets/scss/_mixins.scss +0 -69
  164. package/src/assets/scss/_overrides.scss +0 -69
  165. package/src/assets/scss/_resass.scss +0 -83
  166. package/src/assets/scss/_variables.scss +0 -27
  167. package/src/assets/scss/index.scss +0 -11
  168. package/src/components/Autosuggest/Autosuggest.vue +0 -791
  169. package/src/components/Autosuggest/index.js +0 -3
  170. package/src/components/Dialog/Dialog.vue +0 -253
  171. package/src/components/Dialog/index.js +0 -3
  172. package/src/components/Inline/Inline.vue +0 -149
  173. package/src/components/Inline/index.js +0 -3
  174. package/src/components/InputNumber/InputNumber.vue +0 -430
  175. package/src/components/InputNumber/index.js +0 -3
  176. package/src/components/Loader/Loader.vue +0 -317
  177. package/src/components/Loader/animations.scss +0 -68
  178. package/src/components/Loader/index.js +0 -3
  179. package/src/components/Money/Money.vue +0 -82
  180. package/src/components/Money/index.js +0 -3
  181. package/src/components/Multisuggest/Multisuggest.vue +0 -858
  182. package/src/components/Multisuggest/index.js +0 -3
  183. package/src/components/OptionsList/OptionsList.vue +0 -61
  184. package/src/components/OptionsList/index.js +0 -3
  185. package/src/components/OptionsListItem/OptionsListItem.vue +0 -191
  186. package/src/components/OptionsListItem/index.js +0 -3
  187. package/src/components/Percent/Percent.vue +0 -81
  188. package/src/components/Percent/index.js +0 -3
  189. package/src/components/Skeleton/Skeleton.vue +0 -137
  190. package/src/components/Skeleton/index.js +0 -3
  191. package/src/components/Step/Step.vue +0 -230
  192. package/src/components/Step/index.js +0 -3
  193. package/src/components/Steps/Steps.vue +0 -18
  194. package/src/components/Steps/index.js +0 -3
  195. package/src/components/Tip/Tip.vue +0 -193
  196. package/src/components/Tip/index.js +0 -3
  197. package/src/components/index.js +0 -31
  198. package/src/locale/index.js +0 -78
  199. package/src/main.js +0 -26
  200. package/src/mixins/floatFormatter.js +0 -53
  201. package/src/mixins/locale.js +0 -9
  202. package/src/utils/currency.js +0 -180
  203. package/src/utils/filters.js +0 -84
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const index = require("../../../node_modules/@element-plus/icons-vue/dist/index.js");
5
+ const elementPlus = require("element-plus");
6
+ ;/* empty css */
7
+ const _pluginVue_exportHelper = require("../../../_virtual/_plugin-vue_export-helper.js");
8
+ const _sfc_main = vue.defineComponent({
9
+ name: "TpInline",
10
+ components: {
11
+ ElButton: elementPlus.ElButton,
12
+ ElInput: elementPlus.ElInput
13
+ },
14
+ props: {
15
+ id: {
16
+ type: String,
17
+ required: false,
18
+ default: null
19
+ },
20
+ value: {
21
+ type: [Number, String],
22
+ default: ""
23
+ },
24
+ readonly: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ inputHidden: {
29
+ type: Boolean,
30
+ default: true
31
+ },
32
+ buttonText: {
33
+ type: String,
34
+ default: "Ok"
35
+ }
36
+ },
37
+ emits: ["input", "change", "blur"],
38
+ data() {
39
+ return {
40
+ hideInput: true,
41
+ ElIconCheck: index.Check
42
+ };
43
+ },
44
+ computed: {
45
+ _id() {
46
+ return this.id || this.$options.name;
47
+ }
48
+ },
49
+ mounted() {
50
+ this.hideInput = this.inputHidden;
51
+ },
52
+ methods: {
53
+ toggleInput() {
54
+ const status = !this.hideInput;
55
+ if (this.readonly) {
56
+ this.hideInput = true;
57
+ } else if (!this.readonly) {
58
+ this.hideInput = status;
59
+ if (!this.hideInput) {
60
+ this.$nextTick(function() {
61
+ this.$refs.inlineInput.focus();
62
+ });
63
+ }
64
+ }
65
+ },
66
+ input(event) {
67
+ this.$emit("input", event);
68
+ },
69
+ blur(event) {
70
+ this.$emit("blur", event);
71
+ }
72
+ }
73
+ });
74
+ const _hoisted_1 = ["id"];
75
+ const _hoisted_2 = {
76
+ key: 0,
77
+ "data-tid": "inline-span"
78
+ };
79
+ const _hoisted_3 = ["id"];
80
+ const _hoisted_4 = { "data-tid": "inline-value" };
81
+ const _hoisted_5 = {
82
+ key: 0,
83
+ class: "el-icon-edit"
84
+ };
85
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
86
+ const _component_el_button = vue.resolveComponent("el-button");
87
+ const _component_el_input = vue.resolveComponent("el-input");
88
+ return vue.openBlock(), vue.createElementBlock("div", {
89
+ id: `${_ctx._id}-wrapper`,
90
+ class: "tp-inline"
91
+ }, [
92
+ _ctx.hideInput || _ctx.readonly ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, [
93
+ vue.createElementVNode("a", {
94
+ id: `${_ctx._id}-toggle`,
95
+ tabindex: "0",
96
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.toggleInput && _ctx.toggleInput(...args)),
97
+ onKeypress: _cache[1] || (_cache[1] = vue.withKeys((...args) => _ctx.toggleInput && _ctx.toggleInput(...args), ["enter"]))
98
+ }, [
99
+ vue.createElementVNode("span", _hoisted_4, vue.toDisplayString(_ctx.value), 1),
100
+ !_ctx.readonly ? (vue.openBlock(), vue.createElementBlock("small", _hoisted_5)) : vue.createCommentVNode("", true)
101
+ ], 40, _hoisted_3)
102
+ ])) : (vue.openBlock(), vue.createBlock(_component_el_input, {
103
+ key: 1,
104
+ id: `${_ctx._id}-input`,
105
+ ref: "inlineInput",
106
+ "model-value": _ctx.value,
107
+ "data-tid": "inline-input",
108
+ onInput: _ctx.input,
109
+ onBlur: _ctx.blur,
110
+ onKeypress: vue.withKeys(_ctx.toggleInput, ["enter"])
111
+ }, {
112
+ append: vue.withCtx(() => [
113
+ vue.createVNode(_component_el_button, {
114
+ id: `${_ctx._id}-btn`,
115
+ icon: _ctx.ElIconCheck,
116
+ "data-tid": "inline-button",
117
+ onClick: _ctx.toggleInput
118
+ }, {
119
+ default: vue.withCtx(() => [
120
+ vue.createTextVNode(vue.toDisplayString(_ctx.buttonText), 1)
121
+ ]),
122
+ _: 1
123
+ }, 8, ["id", "icon", "onClick"])
124
+ ]),
125
+ _: 1
126
+ }, 8, ["id", "model-value", "onInput", "onBlur", "onKeypress"]))
127
+ ], 8, _hoisted_1);
128
+ }
129
+ const Inline = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e30c0e2a"]]);
130
+ exports.default = Inline;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const Inline = require("./Inline.vue.js");
4
+ exports.default = Inline.default;
@@ -0,0 +1,358 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const lodashEs = require("lodash-es");
5
+ const types = require("../../utils/types.js");
6
+ const error = require("../../utils/error.js");
7
+ const useFormItem = require("../../utils/use-form-item.js");
8
+ const useFormCommonProps = require("../../utils/use-form-common-props.js");
9
+ const elementPlus = require("element-plus");
10
+ const index$2 = require("../../../node_modules/@element-plus/icons-vue/dist/index.js");
11
+ const inputNumber = require("./input-number.js");
12
+ const index = require("../../../node_modules/element-plus/es/hooks/use-locale/index.js");
13
+ const index$1 = require("../../../node_modules/element-plus/es/hooks/use-namespace/index.js");
14
+ const shared_esmBundler = require("../../../node_modules/@vue/shared/dist/shared.esm-bundler.js");
15
+ const _hoisted_1 = ["aria-label"];
16
+ const _hoisted_2 = ["aria-label"];
17
+ const UPDATE_MODEL_EVENT = "update:modelValue";
18
+ const CHANGE_EVENT = "change";
19
+ const INPUT_EVENT = "input";
20
+ const _sfc_main = /* @__PURE__ */ Object.assign({
21
+ name: "TpInputNumber"
22
+ }, {
23
+ __name: "InputNumber",
24
+ props: inputNumber.inputNumberProps,
25
+ emits: inputNumber.inputNumberEmits,
26
+ setup(__props, { expose: __expose, emit: __emit }) {
27
+ const props = __props;
28
+ const emit = __emit;
29
+ const { t } = index.useLocale();
30
+ const ns = index$1.useNamespace("input-number");
31
+ const input = vue.ref();
32
+ const vm = vue.getCurrentInstance().proxy;
33
+ const key = vue.ref(1);
34
+ const data = vue.reactive({
35
+ currentValue: props.modelValue,
36
+ userInput: null
37
+ });
38
+ const { formItem } = useFormItem.useFormItem();
39
+ const minDisabled = vue.computed(
40
+ () => types.isNumber(props.modelValue) && props.modelValue <= props.min
41
+ );
42
+ const maxDisabled = vue.computed(
43
+ () => types.isNumber(props.modelValue) && props.modelValue >= props.max
44
+ );
45
+ const numPrecision = vue.computed(() => {
46
+ const stepPrecision = getPrecision(props.step);
47
+ if (!types.isUndefined(props.precision)) {
48
+ if (stepPrecision > props.precision) {
49
+ error.debugWarn(
50
+ "InputNumber",
51
+ "precision should not be less than the decimal places of step"
52
+ );
53
+ }
54
+ return props.precision;
55
+ } else {
56
+ return Math.max(getPrecision(props.modelValue), stepPrecision);
57
+ }
58
+ });
59
+ const controlsAtRight = vue.computed(() => {
60
+ return props.controls && props.controlsPosition === "right";
61
+ });
62
+ const inputNumberSize = useFormCommonProps.useFormSize();
63
+ const inputNumberDisabled = useFormCommonProps.useFormDisabled();
64
+ const displayValue = vue.computed(() => {
65
+ if (data.userInput !== null) {
66
+ return data.userInput;
67
+ }
68
+ let currentValue = data.currentValue;
69
+ const fallbackValue = props.stringDefaultsZero ? 0 : "";
70
+ if (props.modelValue === "" || lodashEs.isNil(currentValue) || currentValue === "") {
71
+ return fallbackValue;
72
+ }
73
+ if (types.isNumber(currentValue)) {
74
+ if (Number.isNaN(currentValue)) return fallbackValue;
75
+ if (!types.isUndefined(props.precision)) {
76
+ currentValue = currentValue.toFixed(props.precision);
77
+ }
78
+ }
79
+ return currentValue;
80
+ });
81
+ const displayFormatter = vue.computed(() => {
82
+ const decimalChar = vm.$t("locale.number.decimal");
83
+ const thousandsChar = vm.$t("locale.number.thousands");
84
+ return (value) => {
85
+ const noLetters = value.replaceAll(/[a-zA-Z]/g, "");
86
+ const res = noLetters.replace(".", decimalChar).replace(/\B(?=(\d{3})+(?!\d))/g, thousandsChar);
87
+ return res;
88
+ };
89
+ });
90
+ const inputParser = vue.computed(() => {
91
+ const decimalChar = vm.$t("locale.number.decimal");
92
+ const thousandsChar = vm.$t("locale.number.thousands");
93
+ return (value) => {
94
+ const regexThou = `/$s?|(${thousandsChar}*)/g`;
95
+ const res = value.replace(regexThou, "").replace(decimalChar, ".");
96
+ return res;
97
+ };
98
+ });
99
+ const toPrecision = (num, pre) => {
100
+ if (types.isUndefined(pre)) pre = numPrecision.value;
101
+ if (pre === 0) return Math.round(num);
102
+ let snum = String(num);
103
+ const pointPos = snum.indexOf(".");
104
+ if (pointPos === -1) return num;
105
+ const nums = snum.replace(".", "").split("");
106
+ const datum = nums[pointPos + pre];
107
+ if (!datum) return num;
108
+ const length = snum.length;
109
+ if (snum.charAt(length - 1) === "5") {
110
+ snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
111
+ }
112
+ return Number.parseFloat(Number(snum).toFixed(pre));
113
+ };
114
+ const getPrecision = (value) => {
115
+ if (lodashEs.isNil(value)) return 0;
116
+ const valueString = value.toString();
117
+ const dotPosition = valueString.indexOf(".");
118
+ let precision = 0;
119
+ if (dotPosition !== -1) {
120
+ precision = valueString.length - dotPosition - 1;
121
+ }
122
+ return precision;
123
+ };
124
+ const ensurePrecision = (val, coefficient = 1) => {
125
+ if (!types.isNumber(val)) return data.currentValue;
126
+ return toPrecision(val + props.step * coefficient);
127
+ };
128
+ const increase = () => {
129
+ if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return;
130
+ const value = Number(displayValue.value) || 0;
131
+ const newVal = ensurePrecision(value);
132
+ setCurrentValue(newVal);
133
+ emit(INPUT_EVENT, data.currentValue);
134
+ setCurrentValueToModelValue();
135
+ };
136
+ const decrease = () => {
137
+ if (props.readonly || inputNumberDisabled.value || minDisabled.value) return;
138
+ const value = Number(displayValue.value) || 0;
139
+ const newVal = ensurePrecision(value, -1);
140
+ setCurrentValue(newVal);
141
+ emit(INPUT_EVENT, data.currentValue);
142
+ setCurrentValueToModelValue();
143
+ };
144
+ const verifyValue = (value, update) => {
145
+ const { max, min, step, precision, stepStrictly, valueOnClear } = props;
146
+ if (max < min) {
147
+ error.throwError("InputNumber", "min should not be greater than max.");
148
+ }
149
+ let newVal = Number(value);
150
+ if (lodashEs.isNil(value) || Number.isNaN(newVal)) {
151
+ return null;
152
+ }
153
+ if (value === "") {
154
+ if (valueOnClear === null) {
155
+ return null;
156
+ }
157
+ newVal = shared_esmBundler.isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear;
158
+ }
159
+ if (stepStrictly) {
160
+ newVal = toPrecision(Math.round(newVal / step) * step, precision);
161
+ }
162
+ if (!types.isUndefined(precision)) {
163
+ newVal = toPrecision(newVal, precision);
164
+ }
165
+ if (newVal > max || newVal < min) {
166
+ newVal = newVal > max ? max : min;
167
+ update && emit(UPDATE_MODEL_EVENT, newVal);
168
+ }
169
+ return newVal;
170
+ };
171
+ const setCurrentValue = (value, emitChange = true) => {
172
+ var _a;
173
+ const oldVal = data.currentValue;
174
+ const newVal = verifyValue(value);
175
+ if (!emitChange) {
176
+ emit(UPDATE_MODEL_EVENT, newVal);
177
+ return;
178
+ }
179
+ if (oldVal === newVal) return;
180
+ data.userInput = null;
181
+ emit(UPDATE_MODEL_EVENT, newVal);
182
+ emit(CHANGE_EVENT, newVal, oldVal);
183
+ if (props.validateEvent) {
184
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => error.debugWarn(err));
185
+ }
186
+ data.currentValue = newVal;
187
+ };
188
+ const handleInput = (value) => {
189
+ data.userInput = value;
190
+ const newVal = value === "" ? null : Number(value);
191
+ emit(INPUT_EVENT, newVal);
192
+ setCurrentValue(newVal, false);
193
+ };
194
+ const handleInputChange = (value) => {
195
+ const newVal = value !== "" ? Number(value) : "";
196
+ if (types.isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
197
+ setCurrentValue(newVal);
198
+ }
199
+ setCurrentValueToModelValue();
200
+ data.userInput = null;
201
+ };
202
+ const focus = () => {
203
+ var _a, _b;
204
+ (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
205
+ };
206
+ const blur = () => {
207
+ var _a, _b;
208
+ (_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
209
+ };
210
+ const handleFocus = (event) => {
211
+ emit("focus", event);
212
+ };
213
+ const handleBlur = (event) => {
214
+ var _a;
215
+ data.userInput = null;
216
+ emit("blur", event);
217
+ if (props.validateEvent) {
218
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => error.debugWarn(err));
219
+ }
220
+ };
221
+ const setCurrentValueToModelValue = () => {
222
+ if (data.currentValue !== props.modelValue) {
223
+ data.currentValue = props.modelValue;
224
+ }
225
+ };
226
+ vue.watch(
227
+ () => props.modelValue,
228
+ (value, oldValue) => {
229
+ const newValue = verifyValue(value, true);
230
+ if (data.userInput === null && newValue !== oldValue) {
231
+ data.currentValue = newValue;
232
+ }
233
+ },
234
+ { immediate: true }
235
+ );
236
+ vue.watch(
237
+ () => vm.$i18nHelper.hooks.onLanguageChanged,
238
+ (value, oldValue) => {
239
+ key.value++;
240
+ }
241
+ );
242
+ vue.onMounted(() => {
243
+ var _a;
244
+ const { min, max, modelValue } = props;
245
+ const innerInput = (_a = input.value) == null ? void 0 : _a.input;
246
+ innerInput.setAttribute("role", "spinbutton");
247
+ if (Number.isFinite(max)) {
248
+ innerInput.setAttribute("aria-valuemax", String(max));
249
+ } else {
250
+ innerInput.removeAttribute("aria-valuemax");
251
+ }
252
+ if (Number.isFinite(min)) {
253
+ innerInput.setAttribute("aria-valuemin", String(min));
254
+ } else {
255
+ innerInput.removeAttribute("aria-valuemin");
256
+ }
257
+ innerInput.setAttribute(
258
+ "aria-valuenow",
259
+ data.currentValue || data.currentValue === 0 ? String(data.currentValue) : ""
260
+ );
261
+ innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
262
+ if (!types.isNumber(modelValue) && modelValue != null) {
263
+ let val = Number(modelValue);
264
+ if (Number.isNaN(val)) {
265
+ val = null;
266
+ }
267
+ emit(UPDATE_MODEL_EVENT, val);
268
+ }
269
+ });
270
+ vue.onUpdated(() => {
271
+ var _a;
272
+ const innerInput = (_a = input.value) == null ? void 0 : _a.input;
273
+ innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${data.currentValue ?? ""}`);
274
+ });
275
+ __expose({
276
+ /** @description get focus the input component */
277
+ focus,
278
+ /** @description remove focus the input component */
279
+ blur
280
+ });
281
+ return (_ctx, _cache) => {
282
+ return vue.openBlock(), vue.createElementBlock("div", {
283
+ class: vue.normalizeClass([
284
+ vue.unref(ns).b(),
285
+ vue.unref(ns).m(vue.unref(inputNumberSize)),
286
+ vue.unref(ns).is("disabled", vue.unref(inputNumberDisabled)),
287
+ vue.unref(ns).is("without-controls", !_ctx.controls),
288
+ vue.unref(ns).is("controls-right", controlsAtRight.value)
289
+ ]),
290
+ onDragstart: _cache[1] || (_cache[1] = vue.withModifiers(() => {
291
+ }, ["prevent"]))
292
+ }, [
293
+ _ctx.controls ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
294
+ key: 0,
295
+ role: "button",
296
+ "aria-label": vue.unref(t)("el.inputNumber.decrease"),
297
+ class: vue.normalizeClass([vue.unref(ns).e("decrease"), vue.unref(ns).is("disabled", minDisabled.value)]),
298
+ onKeydown: vue.withKeys(decrease, ["enter"])
299
+ }, [
300
+ vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
301
+ default: vue.withCtx(() => [
302
+ controlsAtRight.value ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ArrowDown), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(index$2.Minus), { key: 1 }))
303
+ ]),
304
+ _: 1
305
+ })
306
+ ], 42, _hoisted_1)), [
307
+ [vue.unref(elementPlus.vRepeatClick), decrease]
308
+ ]) : vue.createCommentVNode("", true),
309
+ _ctx.controls ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
310
+ key: 1,
311
+ role: "button",
312
+ "aria-label": vue.unref(t)("el.inputNumber.increase"),
313
+ class: vue.normalizeClass([vue.unref(ns).e("increase"), vue.unref(ns).is("disabled", maxDisabled.value)]),
314
+ onKeydown: vue.withKeys(increase, ["enter"])
315
+ }, [
316
+ vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
317
+ default: vue.withCtx(() => [
318
+ controlsAtRight.value ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ArrowUp), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(index$2.Plus), { key: 1 }))
319
+ ]),
320
+ _: 1
321
+ })
322
+ ], 42, _hoisted_2)), [
323
+ [vue.unref(elementPlus.vRepeatClick), increase]
324
+ ]) : vue.createCommentVNode("", true),
325
+ (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElInput), {
326
+ id: _ctx.id,
327
+ ref_key: "input",
328
+ ref: input,
329
+ key: key.value,
330
+ step: _ctx.step,
331
+ "model-value": displayValue.value,
332
+ formatter: displayFormatter.value,
333
+ parser: inputParser.value,
334
+ placeholder: _ctx.placeholder,
335
+ readonly: _ctx.readonly,
336
+ disabled: vue.unref(inputNumberDisabled),
337
+ size: vue.unref(inputNumberSize),
338
+ max: _ctx.max,
339
+ min: _ctx.min,
340
+ name: _ctx.name,
341
+ label: _ctx.label,
342
+ "validate-event": false,
343
+ onWheel: _cache[0] || (_cache[0] = vue.withModifiers(() => {
344
+ }, ["prevent"])),
345
+ onKeydown: [
346
+ vue.withKeys(vue.withModifiers(increase, ["prevent"]), ["up"]),
347
+ vue.withKeys(vue.withModifiers(decrease, ["prevent"]), ["down"])
348
+ ],
349
+ onBlur: handleBlur,
350
+ onFocus: handleFocus,
351
+ onInput: handleInput,
352
+ onChange: handleInputChange
353
+ }, null, 8, ["id", "step", "model-value", "formatter", "parser", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "label", "onKeydown"]))
354
+ ], 34);
355
+ };
356
+ }
357
+ });
358
+ exports.default = _sfc_main;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const InputNumber = require("./InputNumber.vue.js");
4
+ exports.default = InputNumber.default;
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const lodashEs = require("lodash-es");
4
+ const index = require("../../utils/index.js");
5
+ const runtime = require("../../utils/runtime.js");
6
+ const index$1 = require("../../../node_modules/element-plus/es/hooks/use-size/index.js");
7
+ const types = require("../../utils/types.js");
8
+ const inputNumberProps = runtime.buildProps({
9
+ /**
10
+ * @description same as `id` in native input
11
+ */
12
+ id: {
13
+ type: String,
14
+ default: void 0
15
+ },
16
+ /**
17
+ * @description incremental step
18
+ */
19
+ step: {
20
+ type: Number,
21
+ default: 1
22
+ },
23
+ /**
24
+ * @description whether input value can only be multiple of step
25
+ */
26
+ stepStrictly: Boolean,
27
+ /**
28
+ * @description the maximum allowed value
29
+ */
30
+ max: {
31
+ type: Number,
32
+ default: Number.POSITIVE_INFINITY
33
+ },
34
+ /**
35
+ * @description the minimum allowed value
36
+ */
37
+ min: {
38
+ type: Number,
39
+ default: Number.NEGATIVE_INFINITY
40
+ },
41
+ /**
42
+ * @description binding value
43
+ */
44
+ modelValue: {
45
+ type: [Number, String],
46
+ default: null
47
+ },
48
+ /**
49
+ * @description same as `readonly` in native input
50
+ */
51
+ readonly: Boolean,
52
+ /**
53
+ * @description whether the component is disabled
54
+ */
55
+ disabled: Boolean,
56
+ /**
57
+ * @description size of the component
58
+ */
59
+ size: index$1.useSizeProp,
60
+ /**
61
+ * @description whether to enable the control buttons
62
+ */
63
+ controls: {
64
+ type: Boolean,
65
+ default: true
66
+ },
67
+ /**
68
+ * @description position of the control buttons
69
+ */
70
+ controlsPosition: {
71
+ type: String,
72
+ default: "",
73
+ values: ["", "right"]
74
+ },
75
+ /**
76
+ * @description value should be set when input box is cleared
77
+ */
78
+ valueOnClear: {
79
+ type: [String, Number, null],
80
+ validator: (val) => val === null || types.isNumber(val) || ["min", "max"].includes(val),
81
+ default: null
82
+ },
83
+ /**
84
+ * @description same as `name` in native input
85
+ */
86
+ name: String,
87
+ /**
88
+ * @description same as `label` in native input
89
+ */
90
+ label: String,
91
+ /**
92
+ * @description same as `placeholder` in native input
93
+ */
94
+ placeholder: String,
95
+ /**
96
+ * @tagplus default 2
97
+ * @description precision of input value
98
+ */
99
+ precision: {
100
+ type: Number,
101
+ default: 2,
102
+ validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
103
+ },
104
+ /**
105
+ * @description whether to trigger form validation
106
+ */
107
+ validateEvent: {
108
+ type: Boolean,
109
+ default: true
110
+ },
111
+ /**
112
+ * @tagplus
113
+ * Se false permite campo vazio
114
+ **/
115
+ stringDefaultsZero: {
116
+ type: Boolean,
117
+ default: true
118
+ }
119
+ });
120
+ const inputNumberEmits = {
121
+ [index.CHANGE_EVENT]: (cur, prev) => prev !== cur,
122
+ blur: (e) => e instanceof FocusEvent,
123
+ focus: (e) => e instanceof FocusEvent,
124
+ [index.INPUT_EVENT]: (val) => types.isNumber(val) || lodashEs.isNil(val),
125
+ [index.UPDATE_MODEL_EVENT]: (val) => types.isNumber(val) || lodashEs.isNil(val)
126
+ };
127
+ exports.inputNumberEmits = inputNumberEmits;
128
+ exports.inputNumberProps = inputNumberProps;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ ;/* empty css */
5
+ const _pluginVue_exportHelper = require("../../../_virtual/_plugin-vue_export-helper.js");
6
+ const _sfc_main = vue.defineComponent({
7
+ name: "TpLoader",
8
+ props: {
9
+ // Lista contendo as classes de icones a serem exibidos no loader
10
+ icons: {
11
+ type: Array,
12
+ required: false,
13
+ default: () => [
14
+ "fa-solid fa-badge-percent",
15
+ "fa-solid fa-box-usd",
16
+ "fa-solid fa-credit-card-front",
17
+ "fa-solid fa-cart-shopping",
18
+ "fa-solid fa-gift",
19
+ "fa-solid fa-dolly-flatbed-alt",
20
+ "fa-solid fa-receipt",
21
+ "fa-solid fa-chart-pie-alt",
22
+ "fa-solid fa-badge-percent",
23
+ "fa-solid fa-box-usd",
24
+ "fa-solid fa-credit-card-front",
25
+ "fa-solid fa-cart-shopping",
26
+ "fa-solid fa-gift",
27
+ "fa-solid fa-dolly-flatbed-alt",
28
+ "fa-solid fa-receipt",
29
+ "fa-solid fa-chart-pie-alt"
30
+ ]
31
+ }
32
+ }
33
+ });
34
+ const _hoisted_1 = { class: "tp-loader" };
35
+ const _hoisted_2 = { class: "wrapper" };
36
+ const _hoisted_3 = { class: "icones" };
37
+ const _hoisted_4 = { class: "texto" };
38
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
39
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
40
+ vue.createElementVNode("div", _hoisted_2, [
41
+ _cache[0] || (_cache[0] = vue.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="150px" height="150px" data-v-719fb911><mask id="mascara" data-v-719fb911><rect x="0" y="0" width="100%" height="100%" fill="white" data-v-719fb911></rect><circle id="circulo-interno" class="circulo" cx="45" cy="50" r="40" fill="black" data-v-719fb911></circle></mask><g id="bola" fill="none" fill-rule="evenodd" transform="translate(30 30)" data-v-719fb911><circle id="circulo" class="circulo" cx="45" cy="50" r="40" fill="#1F7DE7" mask="url(#mascara)" data-v-719fb911></circle><g fill="none" fill-rule="evenodd" data-v-719fb911><circle class="residuo top center" cx="45" cy="9" r="15" fill="#FFCB05" data-v-719fb911></circle><circle class="residuo top right" cx="72" cy="21" r="8.5" fill="#1F7DE7" data-v-719fb911></circle><circle class="residuo middle right" cx="81" cy="45" r="12" fill="#1F7DE7" data-v-719fb911></circle><circle class="residuo bottom right" cx="71" cy="70" r="8.5" fill="none" stroke="#FFCB05" stroke-width="3" data-v-719fb911></circle><circle class="residuo bottom center" cx="45" cy="81" r="8.5" fill="none" stroke="#1F7DE7" stroke-width="3" data-v-719fb911></circle><circle class="residuo bottom left" cx="19" cy="70" r="8.5" fill="#1F7DE7" data-v-719fb911></circle><circle class="residuo middle left" cx="9" cy="45" r="10" fill="#FFCB05" data-v-719fb911></circle><circle class="residuo top left" cx="18" cy="21" r="8.5" fill="none" stroke="#1F7DE7" stroke-width="3" data-v-719fb911></circle></g></g></svg>', 1)),
42
+ vue.createElementVNode("div", _hoisted_3, [
43
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.icons, (icon, k) => {
44
+ return vue.openBlock(), vue.createElementBlock("i", {
45
+ key: k,
46
+ class: vue.normalizeClass(icon),
47
+ style: vue.normalizeStyle(`--iconsItem:${k}`)
48
+ }, null, 6);
49
+ }), 128))
50
+ ]),
51
+ vue.createElementVNode("div", _hoisted_4, [
52
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
53
+ ])
54
+ ]),
55
+ _cache[1] || (_cache[1] = vue.createElementVNode("div", { class: "overlay" }, null, -1))
56
+ ]);
57
+ }
58
+ const Loader = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-719fb911"]]);
59
+ exports.default = Loader;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const Loader = require("./Loader.vue.js");
4
+ exports.default = Loader.default;