@tagplus/components 5.2.18 → 5.3.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.
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/dist/es/components.css +2391 -0
- package/dist/es/node_modules/@element-plus/icons-vue/dist/index.mjs +148 -0
- package/dist/es/node_modules/@popperjs/core/lib/enums.mjs +22 -0
- package/dist/es/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +28 -0
- package/dist/es/node_modules/@vueuse/core/index.mjs +172 -0
- package/dist/es/node_modules/@vueuse/shared/index.mjs +68 -0
- package/dist/es/node_modules/element-plus/es/constants/size.mjs +4 -0
- package/dist/es/node_modules/element-plus/es/hooks/use-focus-controller/index.mjs +64 -0
- package/dist/es/node_modules/element-plus/es/hooks/use-id/index.mjs +30 -0
- package/dist/es/node_modules/element-plus/es/hooks/use-locale/index.mjs +29 -0
- package/dist/es/node_modules/element-plus/es/hooks/use-namespace/index.mjs +79 -0
- package/dist/es/node_modules/element-plus/es/hooks/use-prop/index.mjs +11 -0
- package/dist/es/node_modules/element-plus/es/hooks/use-size/index.mjs +20 -0
- package/dist/es/node_modules/element-plus/es/locale/lang/en.mjs +182 -0
- package/dist/es/node_modules/element-plus/es/utils/error.mjs +16 -0
- package/dist/es/node_modules/element-plus/es/utils/types.mjs +9 -0
- package/dist/es/node_modules/element-plus/es/utils/vue/props/runtime.mjs +42 -0
- package/dist/es/src/components/Autosuggest/Autosuggest.vue.mjs +446 -0
- package/dist/es/src/components/Autosuggest/Multisuggest.vue.mjs +17 -0
- package/dist/es/src/components/Autosuggest/autosuggest-props.mjs +204 -0
- package/dist/es/src/components/Autosuggest/core.mjs +56 -0
- package/dist/es/src/components/Autosuggest/multisuggest-props.mjs +11 -0
- package/dist/es/src/components/Autosuggest/option.vue.mjs +118 -0
- package/dist/es/src/components/Autosuggest/select-dropdown.vue.mjs +62 -0
- package/dist/es/src/components/Autosuggest/useOption.mjs +93 -0
- package/dist/es/src/components/Autosuggest/useSelect.mjs +803 -0
- package/dist/es/src/components/Inline/Inline.vue.mjs +125 -0
- package/dist/es/src/components/Inline/index.mjs +4 -0
- package/dist/es/src/components/InputNumber/InputNumber.vue.mjs +360 -0
- package/dist/es/src/components/InputNumber/index.mjs +4 -0
- package/dist/es/src/components/InputNumber/input-number.mjs +128 -0
- package/dist/es/src/components/Loader/Loader.vue.mjs +59 -0
- package/dist/es/src/components/Loader/index.mjs +4 -0
- package/dist/es/src/components/Money/Money.vue.mjs +72 -0
- package/dist/es/src/components/Money/index.mjs +4 -0
- package/dist/es/src/components/Multisuggest/index.mjs +4 -0
- package/dist/es/src/components/OptionsList/OptionsList.vue.mjs +28 -0
- package/dist/es/src/components/OptionsList/index.mjs +4 -0
- package/dist/es/src/components/OptionsListItem/OptionsListItem.vue.mjs +96 -0
- package/dist/es/src/components/OptionsListItem/index.mjs +4 -0
- package/dist/es/src/components/Percent/Percent.vue.mjs +73 -0
- package/dist/es/src/components/Percent/index.mjs +4 -0
- package/dist/es/src/components/Skeleton/Skeleton.vue.mjs +79 -0
- package/dist/es/src/components/Skeleton/index.mjs +4 -0
- package/dist/es/src/components/Step/Step.vue.mjs +206 -0
- package/dist/es/src/components/Step/index.mjs +4 -0
- package/dist/es/src/components/Steps/Steps.vue.mjs +15 -0
- package/dist/es/src/components/Steps/index.mjs +4 -0
- package/dist/es/src/components/Tip/Tip.vue.mjs +160 -0
- package/dist/es/src/components/Tip/index.mjs +4 -0
- package/dist/es/src/components/index.mjs +32 -0
- package/dist/es/src/locale/i18nCreator.mjs +93 -0
- package/dist/es/src/locale/lang/pt-br.mjs +21 -0
- package/dist/es/src/main.mjs +17 -0
- package/dist/es/src/mixins/floatFormatter.mjs +42 -0
- package/dist/es/src/plugins/currency.mjs +69 -0
- package/dist/es/src/utils/constants.mjs +6 -0
- package/dist/es/src/utils/error.mjs +22 -0
- package/dist/es/src/utils/i18n.mjs +4 -0
- package/dist/es/src/utils/icon.mjs +9 -0
- package/dist/es/src/utils/index.mjs +11 -0
- package/dist/es/src/utils/runtime.mjs +50 -0
- package/dist/es/src/utils/scroll.mjs +28 -0
- package/dist/es/src/utils/strings.mjs +4 -0
- package/dist/es/src/utils/types.mjs +9 -0
- package/dist/es/src/utils/use-derived-namespace.mjs +15 -0
- package/dist/es/src/utils/use-form-common-props.mjs +25 -0
- package/dist/es/src/utils/use-form-item.mjs +61 -0
- package/dist/es/src/utils/use-id.mjs +35 -0
- package/dist/es/src/utils/use-input.mjs +31 -0
- package/dist/lib/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/lib/components.css +2391 -0
- package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +148 -0
- package/dist/lib/node_modules/@popperjs/core/lib/enums.js +22 -0
- package/dist/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +28 -0
- package/dist/lib/node_modules/@vueuse/core/index.js +170 -0
- package/dist/lib/node_modules/@vueuse/shared/index.js +68 -0
- package/dist/lib/node_modules/element-plus/es/constants/size.js +4 -0
- package/dist/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +64 -0
- package/dist/lib/node_modules/element-plus/es/hooks/use-id/index.js +30 -0
- package/dist/lib/node_modules/element-plus/es/hooks/use-locale/index.js +29 -0
- package/dist/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +79 -0
- package/dist/lib/node_modules/element-plus/es/hooks/use-prop/index.js +11 -0
- package/dist/lib/node_modules/element-plus/es/hooks/use-size/index.js +20 -0
- package/dist/lib/node_modules/element-plus/es/locale/lang/en.js +182 -0
- package/dist/lib/node_modules/element-plus/es/utils/error.js +16 -0
- package/dist/lib/node_modules/element-plus/es/utils/types.js +9 -0
- package/dist/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +42 -0
- package/dist/lib/src/components/Autosuggest/Autosuggest.vue.js +446 -0
- package/dist/lib/src/components/Autosuggest/Multisuggest.vue.js +17 -0
- package/dist/lib/src/components/Autosuggest/autosuggest-props.js +204 -0
- package/dist/lib/src/components/Autosuggest/core.js +56 -0
- package/dist/lib/src/components/Autosuggest/multisuggest-props.js +11 -0
- package/dist/lib/src/components/Autosuggest/option.vue.js +118 -0
- package/dist/lib/src/components/Autosuggest/select-dropdown.vue.js +62 -0
- package/dist/lib/src/components/Autosuggest/useOption.js +93 -0
- package/dist/lib/src/components/Autosuggest/useSelect.js +803 -0
- package/dist/lib/src/components/Inline/Inline.vue.js +125 -0
- package/dist/lib/src/components/Inline/index.js +4 -0
- package/dist/lib/src/components/InputNumber/InputNumber.vue.js +360 -0
- package/dist/lib/src/components/InputNumber/index.js +4 -0
- package/dist/lib/src/components/InputNumber/input-number.js +128 -0
- package/dist/lib/src/components/Loader/Loader.vue.js +59 -0
- package/dist/lib/src/components/Loader/index.js +4 -0
- package/dist/lib/src/components/Money/Money.vue.js +72 -0
- package/dist/lib/src/components/Money/index.js +4 -0
- package/dist/lib/src/components/Multisuggest/index.js +4 -0
- package/dist/lib/src/components/OptionsList/OptionsList.vue.js +28 -0
- package/dist/lib/src/components/OptionsList/index.js +4 -0
- package/dist/lib/src/components/OptionsListItem/OptionsListItem.vue.js +96 -0
- package/dist/lib/src/components/OptionsListItem/index.js +4 -0
- package/dist/lib/src/components/Percent/Percent.vue.js +73 -0
- package/dist/lib/src/components/Percent/index.js +4 -0
- package/dist/lib/src/components/Skeleton/Skeleton.vue.js +79 -0
- package/dist/lib/src/components/Skeleton/index.js +4 -0
- package/dist/lib/src/components/Step/Step.vue.js +206 -0
- package/dist/lib/src/components/Step/index.js +4 -0
- package/dist/lib/src/components/Steps/Steps.vue.js +15 -0
- package/dist/lib/src/components/Steps/index.js +4 -0
- package/dist/lib/src/components/Tip/Tip.vue.js +160 -0
- package/dist/lib/src/components/Tip/index.js +4 -0
- package/dist/lib/src/components/index.js +32 -0
- package/dist/lib/src/locale/i18nCreator.js +93 -0
- package/dist/lib/src/locale/lang/pt-br.js +21 -0
- package/dist/lib/src/main.js +17 -0
- package/dist/lib/src/mixins/floatFormatter.js +42 -0
- package/dist/lib/src/plugins/currency.js +69 -0
- package/dist/lib/src/utils/constants.js +6 -0
- package/dist/lib/src/utils/error.js +22 -0
- package/dist/lib/src/utils/i18n.js +4 -0
- package/dist/lib/src/utils/icon.js +9 -0
- package/dist/lib/src/utils/index.js +14 -0
- package/dist/lib/src/utils/runtime.js +50 -0
- package/dist/lib/src/utils/scroll.js +28 -0
- package/dist/lib/src/utils/strings.js +4 -0
- package/dist/lib/src/utils/types.js +12 -0
- package/dist/lib/src/utils/use-derived-namespace.js +15 -0
- package/dist/lib/src/utils/use-form-common-props.js +25 -0
- package/dist/lib/src/utils/use-form-item.js +61 -0
- package/dist/lib/src/utils/use-id.js +35 -0
- package/dist/lib/src/utils/use-input.js +31 -0
- package/package.json +19 -17
- package/dist/main.bundle.js +0 -2
- package/dist/main.bundle.js.LICENSE.txt +0 -15
- package/dist/main.css +0 -11
- package/src/locale/i18nCreator.js +0 -170
- package/src/locale/lang/en.js +0 -35
- package/src/locale/lang/pt-br.js +0 -35
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { resolveComponent, createBlock, openBlock, normalizeClass, withCtx, createVNode, createElementVNode, toDisplayString, createElementBlock } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const _sfc_main = {
|
|
5
|
+
name: "TpTip",
|
|
6
|
+
props: {
|
|
7
|
+
id: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: false,
|
|
10
|
+
default: null
|
|
11
|
+
},
|
|
12
|
+
text: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "default"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
closed: true
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
_id() {
|
|
33
|
+
return this.id || this.$options.name;
|
|
34
|
+
},
|
|
35
|
+
tptipclasses() {
|
|
36
|
+
const classes = ["grid-content", "pa-3"];
|
|
37
|
+
if (this.type === "error") {
|
|
38
|
+
classes.push("tp-tip-error");
|
|
39
|
+
}
|
|
40
|
+
if (this.type === "warning") {
|
|
41
|
+
classes.push("tp-tip-warning");
|
|
42
|
+
}
|
|
43
|
+
if (this.type === "success") {
|
|
44
|
+
classes.push("tp-tip-success");
|
|
45
|
+
}
|
|
46
|
+
return classes;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const _hoisted_1 = ["id", "innerHTML"];
|
|
51
|
+
const _hoisted_2 = { class: "tp-title" };
|
|
52
|
+
const _hoisted_3 = ["id", "innerHTML"];
|
|
53
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
54
|
+
const _component_el_col = resolveComponent("el-col");
|
|
55
|
+
const _component_el_row = resolveComponent("el-row");
|
|
56
|
+
return !$props.title ? (openBlock(), createBlock(_component_el_row, {
|
|
57
|
+
key: 0,
|
|
58
|
+
id: `${$options._id}`,
|
|
59
|
+
align: "middle",
|
|
60
|
+
class: normalizeClass([$options.tptipclasses, "text-black"])
|
|
61
|
+
}, {
|
|
62
|
+
default: withCtx(() => [
|
|
63
|
+
createVNode(_component_el_col, {
|
|
64
|
+
xs: 3,
|
|
65
|
+
sm: 1,
|
|
66
|
+
class: "icone"
|
|
67
|
+
}, {
|
|
68
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
69
|
+
createElementVNode("em", { class: "far fa-lightbulb-on" }, null, -1)
|
|
70
|
+
])),
|
|
71
|
+
_: 1
|
|
72
|
+
}),
|
|
73
|
+
createVNode(_component_el_col, {
|
|
74
|
+
xs: 21,
|
|
75
|
+
sm: 23
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
createElementVNode("div", {
|
|
79
|
+
id: `${$options._id}-text`,
|
|
80
|
+
innerHTML: $props.text
|
|
81
|
+
}, null, 8, _hoisted_1)
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
})
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["id", "class"])) : (openBlock(), createBlock(_component_el_row, {
|
|
88
|
+
key: 1,
|
|
89
|
+
id: `${$options._id}`,
|
|
90
|
+
align: "middle",
|
|
91
|
+
justify: "center",
|
|
92
|
+
class: normalizeClass([$options.tptipclasses, "text-black"])
|
|
93
|
+
}, {
|
|
94
|
+
default: withCtx(() => [
|
|
95
|
+
createVNode(_component_el_col, {
|
|
96
|
+
xs: 3,
|
|
97
|
+
sm: 1
|
|
98
|
+
}, {
|
|
99
|
+
default: withCtx(() => [
|
|
100
|
+
createVNode(_component_el_row, { justify: "start" }, {
|
|
101
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
102
|
+
createElementVNode("em", { class: "far fa-lightbulb-on" }, null, -1)
|
|
103
|
+
])),
|
|
104
|
+
_: 1
|
|
105
|
+
})
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
}),
|
|
109
|
+
createVNode(_component_el_col, {
|
|
110
|
+
xs: 18,
|
|
111
|
+
sm: 22
|
|
112
|
+
}, {
|
|
113
|
+
default: withCtx(() => [
|
|
114
|
+
createElementVNode("b", _hoisted_2, toDisplayString($props.title), 1)
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}),
|
|
118
|
+
createVNode(_component_el_col, {
|
|
119
|
+
xs: 3,
|
|
120
|
+
sm: 1
|
|
121
|
+
}, {
|
|
122
|
+
default: withCtx(() => [
|
|
123
|
+
createVNode(_component_el_row, { justify: "end" }, {
|
|
124
|
+
default: withCtx(() => [
|
|
125
|
+
$data.closed ? (openBlock(), createElementBlock("em", {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: "fa fa-plus tp-close-button",
|
|
128
|
+
onClick: _cache[0] || (_cache[0] = ($event) => $data.closed = !$data.closed)
|
|
129
|
+
})) : (openBlock(), createElementBlock("em", {
|
|
130
|
+
key: 1,
|
|
131
|
+
class: "fa fa-minus tp-close-button",
|
|
132
|
+
onClick: _cache[1] || (_cache[1] = ($event) => $data.closed = !$data.closed)
|
|
133
|
+
}))
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
})
|
|
137
|
+
]),
|
|
138
|
+
_: 1
|
|
139
|
+
}),
|
|
140
|
+
createVNode(_component_el_col, {
|
|
141
|
+
xs: 18,
|
|
142
|
+
sm: 22,
|
|
143
|
+
class: normalizeClass("tp-text " + ($data.closed ? "tp-vanish" : ""))
|
|
144
|
+
}, {
|
|
145
|
+
default: withCtx(() => [
|
|
146
|
+
createElementVNode("div", {
|
|
147
|
+
id: `${$options._id}-text`,
|
|
148
|
+
innerHTML: $props.text
|
|
149
|
+
}, null, 8, _hoisted_3)
|
|
150
|
+
]),
|
|
151
|
+
_: 1
|
|
152
|
+
}, 8, ["class"])
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 8, ["id", "class"]));
|
|
156
|
+
}
|
|
157
|
+
const Tip = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2861430a"]]);
|
|
158
|
+
export {
|
|
159
|
+
Tip as default
|
|
160
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as default2 } from "./Autosuggest/Autosuggest.vue.mjs";
|
|
2
|
+
import { default as default3 } from "./Inline/Inline.vue.mjs";
|
|
3
|
+
import { default as default4 } from "./Money/Money.vue.mjs";
|
|
4
|
+
import { default as default5 } from "./Percent/Percent.vue.mjs";
|
|
5
|
+
import { default as default6 } from "./OptionsList/OptionsList.vue.mjs";
|
|
6
|
+
import { default as default7 } from "./OptionsListItem/OptionsListItem.vue.mjs";
|
|
7
|
+
import { default as default8 } from "./Loader/Loader.vue.mjs";
|
|
8
|
+
import { default as default9 } from "./Skeleton/Skeleton.vue.mjs";
|
|
9
|
+
import { default as default10 } from "./Tip/Tip.vue.mjs";
|
|
10
|
+
import { default as default11 } from "./Autosuggest/Multisuggest.vue.mjs";
|
|
11
|
+
import { default as default12 } from "./Step/Step.vue.mjs";
|
|
12
|
+
import { default as default13 } from "./Steps/Steps.vue.mjs";
|
|
13
|
+
import { default as default14 } from "./InputNumber/InputNumber.vue.mjs";
|
|
14
|
+
import { ElDialog } from "element-plus";
|
|
15
|
+
ElDialog.name = "TpDialog";
|
|
16
|
+
const Dialog = ElDialog;
|
|
17
|
+
export {
|
|
18
|
+
default2 as Autosuggest,
|
|
19
|
+
Dialog,
|
|
20
|
+
default3 as Inline,
|
|
21
|
+
default14 as InputNumber,
|
|
22
|
+
default8 as Loader,
|
|
23
|
+
default4 as Money,
|
|
24
|
+
default11 as Multisuggest,
|
|
25
|
+
default6 as OptionsList,
|
|
26
|
+
default7 as OptionsListItem,
|
|
27
|
+
default5 as Percent,
|
|
28
|
+
default9 as Skeleton,
|
|
29
|
+
default12 as Step,
|
|
30
|
+
default13 as Steps,
|
|
31
|
+
default10 as Tip
|
|
32
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { createI18n } from "vue-i18n";
|
|
2
|
+
import { reactive } from "vue";
|
|
3
|
+
let i18n;
|
|
4
|
+
const loadedLanguages = [];
|
|
5
|
+
const i18nHelper = {
|
|
6
|
+
global: false,
|
|
7
|
+
importLangFile: false,
|
|
8
|
+
/**
|
|
9
|
+
* Eventos que podem ser observados com watch
|
|
10
|
+
*/
|
|
11
|
+
hooks: reactive({
|
|
12
|
+
onLanguageChanged: ""
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
const importLangFiles = async function(filename) {
|
|
16
|
+
let langsCustom = {};
|
|
17
|
+
if (i18nHelper.importLangFile && typeof i18nHelper.importLangFile === "function") {
|
|
18
|
+
langsCustom = await i18nHelper.importLangFile(filename);
|
|
19
|
+
if (!(Object.keys(langsCustom).length === 1 && langsCustom.default)) {
|
|
20
|
+
langsCustom.default = langsCustom;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return langsCustom;
|
|
24
|
+
};
|
|
25
|
+
i18nHelper.onLanguageSet = function(locale) {
|
|
26
|
+
throw new Error("Implemente a função onLanguageSet na definição do plugin i18n");
|
|
27
|
+
};
|
|
28
|
+
i18nHelper.setI18nLanguage = function(locale) {
|
|
29
|
+
if (i18n.mode === "legacy") {
|
|
30
|
+
i18n.global.locale = locale;
|
|
31
|
+
} else {
|
|
32
|
+
i18n.global.locale.value = locale;
|
|
33
|
+
}
|
|
34
|
+
i18nHelper.hooks.onLanguageChanged = locale;
|
|
35
|
+
document.querySelector("html").setAttribute("lang", locale);
|
|
36
|
+
i18nHelper.onLanguageSet(locale);
|
|
37
|
+
return locale;
|
|
38
|
+
};
|
|
39
|
+
i18nHelper.loadLanguageAsync = async function(locale) {
|
|
40
|
+
if (loadedLanguages.includes(locale)) {
|
|
41
|
+
return locale;
|
|
42
|
+
}
|
|
43
|
+
const messages = await importLangFiles(locale);
|
|
44
|
+
i18n.global.setLocaleMessage(locale, messages.default);
|
|
45
|
+
loadedLanguages.push(locale);
|
|
46
|
+
return locale;
|
|
47
|
+
};
|
|
48
|
+
async function setupI18n(options = {}) {
|
|
49
|
+
if (!i18n) {
|
|
50
|
+
const locale = options.locale || "pt-br";
|
|
51
|
+
i18n = createI18n({
|
|
52
|
+
legacy: false,
|
|
53
|
+
locale,
|
|
54
|
+
missing: (locale2, key) => {
|
|
55
|
+
console.warn(`translation missing: locale=${locale2}, key=${key}`);
|
|
56
|
+
},
|
|
57
|
+
...options
|
|
58
|
+
});
|
|
59
|
+
await i18nHelper.loadLanguageAsync(locale);
|
|
60
|
+
i18nHelper.setI18nLanguage(locale);
|
|
61
|
+
}
|
|
62
|
+
return i18n;
|
|
63
|
+
}
|
|
64
|
+
const i18nCreator = async (options = {}, postInstall = (app, options2, i18nHelper2) => {
|
|
65
|
+
}) => {
|
|
66
|
+
const keys = Object.keys(options).filter((key) => !["i18nHelper", "i18nOptions"].includes(key));
|
|
67
|
+
if (keys.length) {
|
|
68
|
+
throw new Error(`Invalid options: ${keys.join(", ")}, expected { i18nOptions, i18nHelper }`);
|
|
69
|
+
}
|
|
70
|
+
if (options.i18nHelper && typeof options.i18nHelper.importLangFile === "function") {
|
|
71
|
+
i18nHelper.importLangFile = options.i18nHelper.importLangFile;
|
|
72
|
+
}
|
|
73
|
+
if (options.i18nHelper && typeof options.i18nHelper.onLanguageSet === "function") {
|
|
74
|
+
i18nHelper.onLanguageSet = options.i18nHelper.onLanguageSet;
|
|
75
|
+
}
|
|
76
|
+
let i18nOptions = {};
|
|
77
|
+
if (options.i18nOptions && typeof options.i18nOptions === "object") {
|
|
78
|
+
i18nOptions = options.i18nOptions;
|
|
79
|
+
}
|
|
80
|
+
i18n = await setupI18n(i18nOptions);
|
|
81
|
+
i18nHelper.global = i18n.global;
|
|
82
|
+
return {
|
|
83
|
+
install: (app, opts) => {
|
|
84
|
+
i18n.install(app, i18nOptions);
|
|
85
|
+
if (typeof postInstall === "function") {
|
|
86
|
+
postInstall(app, options, i18nHelper);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
i18nCreator as default
|
|
93
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const ptbrLocale = {
|
|
2
|
+
locale: {
|
|
3
|
+
// locale name equals filename reference
|
|
4
|
+
name: "pt-br",
|
|
5
|
+
// IANA.ORG convetions according to W3C
|
|
6
|
+
prefix: "pt-BR",
|
|
7
|
+
number: {
|
|
8
|
+
decimal: ",",
|
|
9
|
+
thousands: ".",
|
|
10
|
+
prefix: "",
|
|
11
|
+
suffix: "",
|
|
12
|
+
precision: 2
|
|
13
|
+
},
|
|
14
|
+
date: {
|
|
15
|
+
format: "DD/MM/YYYY"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
ptbrLocale as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as index from "./components/index.mjs";
|
|
2
|
+
import Currency from "./plugins/currency.mjs";
|
|
3
|
+
import i18nCreator from "./locale/i18nCreator.mjs";
|
|
4
|
+
const install = function(app) {
|
|
5
|
+
app.use(Currency);
|
|
6
|
+
for (const componentName in index) {
|
|
7
|
+
const component = index[componentName];
|
|
8
|
+
app.component(component.name, component);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
12
|
+
install(window.Vue);
|
|
13
|
+
}
|
|
14
|
+
const main = { ...index, install, i18nCreator };
|
|
15
|
+
export {
|
|
16
|
+
main as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const floatFormatterMixin = {
|
|
2
|
+
inject: ["formatMoney"],
|
|
3
|
+
data() {
|
|
4
|
+
return {
|
|
5
|
+
formattedValue: this.modelValue
|
|
6
|
+
};
|
|
7
|
+
},
|
|
8
|
+
props: {
|
|
9
|
+
allowEmpty: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
},
|
|
13
|
+
customPrecision: {
|
|
14
|
+
default: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
watch: {
|
|
18
|
+
modelValue: {
|
|
19
|
+
immediate: true,
|
|
20
|
+
handler(newValue, oldValue) {
|
|
21
|
+
if (newValue === "" && this.allowEmpty) {
|
|
22
|
+
this.formattedValue = "";
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.formattedValue = this.formatMoney(newValue, true, this.locale, this.customPrecision);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
input(evt) {
|
|
31
|
+
this.formattedValue = this.formatMoney(evt, true, this.locale, this.customPrecision);
|
|
32
|
+
const moneyFormatado = this.formatMoney(evt, false, this.locale, this.customPrecision);
|
|
33
|
+
this.$emit("input", moneyFormatado);
|
|
34
|
+
},
|
|
35
|
+
handleChange(evt) {
|
|
36
|
+
this.$emit("change", this.formatMoney(evt, false, this.locale, this.customPrecision));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
floatFormatterMixin as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import ptbrLocale from "../locale/lang/pt-br.mjs";
|
|
2
|
+
let defaults;
|
|
3
|
+
function setDefaults(app) {
|
|
4
|
+
defaults = app.$i18n ? app.$i18n.t("locale.number") : ptbrLocale.locale;
|
|
5
|
+
}
|
|
6
|
+
function formatMoney(input, toString = false, locale = defaults, customPrecision = false) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
let inputString = `${input}`;
|
|
9
|
+
if (inputString.slice(-1).match(/[.,]/)) {
|
|
10
|
+
inputString = inputString.substring(0, inputString.length - 1);
|
|
11
|
+
}
|
|
12
|
+
const negative = inputString.indexOf("-") >= 0 ? -1 : 1;
|
|
13
|
+
if (toString) {
|
|
14
|
+
input = completeZeros(customPrecision, inputString, locale);
|
|
15
|
+
}
|
|
16
|
+
const precision = customPrecision || locale.number.precision;
|
|
17
|
+
const numbers = onlyNumbers(input);
|
|
18
|
+
const currency = numbersToCurrency(numbers, precision);
|
|
19
|
+
if (toString) {
|
|
20
|
+
let num = negative === -1 ? `-${currency}` : `${currency}`;
|
|
21
|
+
if ((_a = locale == null ? void 0 : locale.number) == null ? void 0 : _a.decimal) {
|
|
22
|
+
const decimalChar = (_b = locale == null ? void 0 : locale.number) == null ? void 0 : _b.decimal;
|
|
23
|
+
num = num.replaceAll(",", decimalChar).replaceAll(".", decimalChar);
|
|
24
|
+
}
|
|
25
|
+
return num;
|
|
26
|
+
}
|
|
27
|
+
return currency * negative;
|
|
28
|
+
}
|
|
29
|
+
function completeZeros(customPrecision, input, locale) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const precision = customPrecision || ((_a = locale == null ? void 0 : locale.number) == null ? void 0 : _a.precision) || defaults.precision;
|
|
32
|
+
const decimal = ((_b = locale == null ? void 0 : locale.number) == null ? void 0 : _b.decimal) || defaults.decimal;
|
|
33
|
+
let i = input.lastIndexOf(".");
|
|
34
|
+
const j = input.lastIndexOf(",");
|
|
35
|
+
i = i > j ? i : j;
|
|
36
|
+
const qntDecimais = i ? input.length - i - 1 : 0;
|
|
37
|
+
if (i === -1) {
|
|
38
|
+
input = input + decimal + "0".repeat(precision);
|
|
39
|
+
} else if (i && qntDecimais < precision) {
|
|
40
|
+
input += "0".repeat(precision - qntDecimais);
|
|
41
|
+
}
|
|
42
|
+
return input;
|
|
43
|
+
}
|
|
44
|
+
function onlyNumbers(input) {
|
|
45
|
+
return toStr(input).replace(/\D+/g, "") || "0";
|
|
46
|
+
}
|
|
47
|
+
function fixed(precision = defaults.precision) {
|
|
48
|
+
return between(0, precision, 20);
|
|
49
|
+
}
|
|
50
|
+
function between(min, n, max) {
|
|
51
|
+
return Math.max(min, Math.min(n, max));
|
|
52
|
+
}
|
|
53
|
+
function numbersToCurrency(numbers, precision) {
|
|
54
|
+
const exp = Math.pow(10, precision);
|
|
55
|
+
const float = parseFloat(numbers) / exp;
|
|
56
|
+
return float.toFixed(fixed(precision));
|
|
57
|
+
}
|
|
58
|
+
function toStr(value) {
|
|
59
|
+
return value ? value.toString() : "";
|
|
60
|
+
}
|
|
61
|
+
const Currency = {
|
|
62
|
+
install: (app, options) => {
|
|
63
|
+
setDefaults(app);
|
|
64
|
+
app.provide("formatMoney", formatMoney);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
Currency as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isString } from "../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
|
|
2
|
+
import "lodash-es";
|
|
3
|
+
import "vue";
|
|
4
|
+
class ElementPlusError extends Error {
|
|
5
|
+
constructor(m) {
|
|
6
|
+
super(m);
|
|
7
|
+
this.name = "ElementPlusError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function throwError(scope, m) {
|
|
11
|
+
throw new ElementPlusError(`[${scope}] ${m}`);
|
|
12
|
+
}
|
|
13
|
+
function debugWarn(scope, message) {
|
|
14
|
+
if (process.env.NODE_ENV !== "production") {
|
|
15
|
+
const error = isString(scope) ? new ElementPlusError(`[${scope}] ${message}`) : scope;
|
|
16
|
+
console.warn(error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
debugWarn,
|
|
21
|
+
throwError
|
|
22
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CircleClose as circle_close_default, CircleCheck as circle_check_default, Loading as loading_default } from "../../node_modules/@element-plus/icons-vue/dist/index.mjs";
|
|
2
|
+
const ValidateComponentsMap = {
|
|
3
|
+
validating: loading_default,
|
|
4
|
+
success: circle_check_default,
|
|
5
|
+
error: circle_close_default
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
ValidateComponentsMap
|
|
9
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { warn } from "vue";
|
|
2
|
+
import { fromPairs } from "lodash-es";
|
|
3
|
+
import { isObject, hasOwn } from "../../node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
|
|
4
|
+
const epPropKey = "__epPropKey";
|
|
5
|
+
const isEpProp = (val) => isObject(val) && !!val[epPropKey];
|
|
6
|
+
const buildProp = (prop, key) => {
|
|
7
|
+
if (!isObject(prop) || isEpProp(prop)) return prop;
|
|
8
|
+
const { values, required, default: defaultValue, type, validator } = prop;
|
|
9
|
+
const _validator = values || validator ? (val) => {
|
|
10
|
+
let valid = false;
|
|
11
|
+
let allowedValues = [];
|
|
12
|
+
if (values) {
|
|
13
|
+
allowedValues = Array.from(values);
|
|
14
|
+
if (hasOwn(prop, "default")) {
|
|
15
|
+
allowedValues.push(defaultValue);
|
|
16
|
+
}
|
|
17
|
+
valid || (valid = allowedValues.includes(val));
|
|
18
|
+
}
|
|
19
|
+
if (validator) valid || (valid = validator(val));
|
|
20
|
+
if (!valid && allowedValues.length > 0) {
|
|
21
|
+
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
|
|
22
|
+
warn(
|
|
23
|
+
`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(
|
|
24
|
+
val
|
|
25
|
+
)}.`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return valid;
|
|
29
|
+
} : void 0;
|
|
30
|
+
const epProp = {
|
|
31
|
+
type,
|
|
32
|
+
required: !!required,
|
|
33
|
+
validator: _validator,
|
|
34
|
+
[epPropKey]: true
|
|
35
|
+
};
|
|
36
|
+
if (hasOwn(prop, "default")) epProp.default = defaultValue;
|
|
37
|
+
return epProp;
|
|
38
|
+
};
|
|
39
|
+
const buildProps = (props) => fromPairs(
|
|
40
|
+
Object.entries(props).map(([key, option]) => [
|
|
41
|
+
key,
|
|
42
|
+
buildProp(option, key)
|
|
43
|
+
])
|
|
44
|
+
);
|
|
45
|
+
export {
|
|
46
|
+
buildProp,
|
|
47
|
+
buildProps,
|
|
48
|
+
epPropKey,
|
|
49
|
+
isEpProp
|
|
50
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "lodash-es";
|
|
2
|
+
import "vue";
|
|
3
|
+
import { isClient } from "../../node_modules/@vueuse/shared/index.mjs";
|
|
4
|
+
function scrollIntoView(container, selected) {
|
|
5
|
+
if (!isClient) return;
|
|
6
|
+
if (!selected) {
|
|
7
|
+
container.scrollTop = 0;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const offsetParents = [];
|
|
11
|
+
let pointer = selected.offsetParent;
|
|
12
|
+
while (pointer !== null && container !== pointer && container.contains(pointer)) {
|
|
13
|
+
offsetParents.push(pointer);
|
|
14
|
+
pointer = pointer.offsetParent;
|
|
15
|
+
}
|
|
16
|
+
const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
|
|
17
|
+
const bottom = top + selected.offsetHeight;
|
|
18
|
+
const viewRectTop = container.scrollTop;
|
|
19
|
+
const viewRectBottom = viewRectTop + container.clientHeight;
|
|
20
|
+
if (top < viewRectTop) {
|
|
21
|
+
container.scrollTop = top;
|
|
22
|
+
} else if (bottom > viewRectBottom) {
|
|
23
|
+
container.scrollTop = bottom - container.clientHeight;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
scrollIntoView
|
|
28
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getCurrentInstance, inject, ref, computed, unref } from "vue";
|
|
2
|
+
const defaultNamespace = "el";
|
|
3
|
+
const namespaceContextKey = Symbol("namespaceContextKey");
|
|
4
|
+
const useGetDerivedNamespace = (namespaceOverrides) => {
|
|
5
|
+
const derivedNamespace = getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace);
|
|
6
|
+
const namespace = computed(() => {
|
|
7
|
+
return unref(derivedNamespace) || defaultNamespace;
|
|
8
|
+
});
|
|
9
|
+
return namespace;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
defaultNamespace,
|
|
13
|
+
namespaceContextKey,
|
|
14
|
+
useGetDerivedNamespace
|
|
15
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ref, inject, computed, unref } from "vue";
|
|
2
|
+
import { formContextKey, formItemContextKey } from "./constants.mjs";
|
|
3
|
+
import { useProp } from "../../node_modules/element-plus/es/hooks/use-prop/index.mjs";
|
|
4
|
+
import { useGlobalSize } from "../../node_modules/element-plus/es/hooks/use-size/index.mjs";
|
|
5
|
+
const useFormSize = (fallback, ignore = {}) => {
|
|
6
|
+
const emptyRef = ref(void 0);
|
|
7
|
+
const size = ignore.prop ? emptyRef : useProp("size");
|
|
8
|
+
const globalConfig = ignore.global ? emptyRef : useGlobalSize();
|
|
9
|
+
const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
|
|
10
|
+
const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
|
|
11
|
+
return computed(
|
|
12
|
+
() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || ""
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
const useFormDisabled = (fallback) => {
|
|
16
|
+
const disabled = useProp("disabled");
|
|
17
|
+
const form = inject(formContextKey, void 0);
|
|
18
|
+
return computed(
|
|
19
|
+
() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
useFormDisabled,
|
|
24
|
+
useFormSize
|
|
25
|
+
};
|