hzzt-plus 1.0.1 → 1.0.2
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/attributes.json +1 -0
- package/dist/index.full.js +3080 -279
- package/dist/index.full.min.js +16 -16
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +18 -18
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +3078 -281
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/es/component.mjs +3 -1
- package/es/component.mjs.map +1 -1
- package/es/components/dropdown/index.d.ts +5 -5
- package/es/components/dropdown/src/index.mjs +3 -2
- package/es/components/dropdown/src/index.mjs.map +1 -1
- package/es/components/dropdown/src/index.vue.d.ts +6 -5
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/page-size/index.d.ts +1 -1
- package/es/components/page-size/src/index.mjs.map +1 -1
- package/es/components/page-size/src/index.vue.d.ts +1 -1
- package/es/components/scan/src/scan2.mjs.map +1 -1
- package/es/components/select-textarea/index.d.ts +13076 -0
- package/es/components/select-textarea/index.mjs +9 -0
- package/es/components/select-textarea/index.mjs.map +1 -0
- package/es/components/select-textarea/src/select-textarea.d.ts +26 -0
- package/es/components/select-textarea/src/select-textarea.mjs +35 -0
- package/es/components/select-textarea/src/select-textarea.mjs.map +1 -0
- package/es/components/select-textarea/src/select-textarea.vue.d.ts +13075 -0
- package/es/components/select-textarea/src/select-textarea2.mjs +105 -0
- package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -0
- package/es/components/select-textarea/style/css.d.ts +2 -0
- package/es/components/select-textarea/style/css.mjs +3 -0
- package/es/components/select-textarea/style/css.mjs.map +1 -0
- package/es/components/select-textarea/style/index.d.ts +2 -0
- package/es/components/select-textarea/style/index.mjs +3 -0
- package/es/components/select-textarea/style/index.mjs.map +1 -0
- package/es/components/title/src/title2.mjs +1 -2
- package/es/components/title/src/title2.mjs.map +1 -1
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/index.mjs.map +1 -1
- package/es/hooks/use-cursor/index.d.ts +1 -0
- package/es/hooks/use-cursor/index.mjs +14 -0
- package/es/hooks/use-cursor/index.mjs.map +1 -0
- package/es/index.mjs +3 -0
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/global.d.ts +1 -0
- package/lib/component.js +3 -1
- package/lib/component.js.map +1 -1
- package/lib/components/dropdown/index.d.ts +5 -5
- package/lib/components/dropdown/src/index.js +3 -2
- package/lib/components/dropdown/src/index.js.map +1 -1
- package/lib/components/dropdown/src/index.vue.d.ts +6 -5
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/page-size/index.d.ts +1 -1
- package/lib/components/page-size/src/index.js.map +1 -1
- package/lib/components/page-size/src/index.vue.d.ts +1 -1
- package/lib/components/scan/src/scan2.js.map +1 -1
- package/lib/components/select-textarea/index.d.ts +13076 -0
- package/lib/components/select-textarea/index.js +16 -0
- package/lib/components/select-textarea/index.js.map +1 -0
- package/lib/components/select-textarea/src/select-textarea.d.ts +26 -0
- package/lib/components/select-textarea/src/select-textarea.js +40 -0
- package/lib/components/select-textarea/src/select-textarea.js.map +1 -0
- package/lib/components/select-textarea/src/select-textarea.vue.d.ts +13075 -0
- package/lib/components/select-textarea/src/select-textarea2.js +109 -0
- package/lib/components/select-textarea/src/select-textarea2.js.map +1 -0
- package/lib/components/select-textarea/style/css.d.ts +2 -0
- package/lib/components/select-textarea/style/css.js +6 -0
- package/lib/components/select-textarea/style/css.js.map +1 -0
- package/lib/components/select-textarea/style/index.d.ts +2 -0
- package/lib/components/select-textarea/style/index.js +6 -0
- package/lib/components/select-textarea/style/index.js.map +1 -0
- package/lib/components/title/src/title2.js +1 -2
- package/lib/components/title/src/title2.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-cursor/index.d.ts +1 -0
- package/lib/hooks/use-cursor/index.js +18 -0
- package/lib/hooks/use-cursor/index.js.map +1 -0
- package/lib/index.js +35 -28
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/tags.json +1 -0
- package/theme/hzzt-select-textarea.css +0 -0
- package/theme/src/index.scss +1 -0
- package/theme/src/select-textarea.scss +0 -0
- package/web-types.json +692 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, createBlock, createCommentVNode, mergeProps } from 'vue';
|
|
2
|
+
import { selectTextareaProps, selectTextareaEmits } from './select-textarea.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { useFormSize, useFormDisabled, ElSelectV2, ElInput } from 'element-plus';
|
|
5
|
+
import HzztTitle from '../../title/src/title2.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
+
import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
|
|
9
|
+
import { insertCursorPosition } from '../../../hooks/use-cursor/index.mjs';
|
|
10
|
+
|
|
11
|
+
const _hoisted_1 = { class: "flex column" };
|
|
12
|
+
const _hoisted_2 = { class: "flex align-items-center" };
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: "HzztSelectTextarea"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: selectTextareaProps,
|
|
19
|
+
emits: selectTextareaEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const inputVal = ref(props.modelValue);
|
|
23
|
+
const selectValue = ref("");
|
|
24
|
+
const inputRef = ref();
|
|
25
|
+
const nsInput = useNamespace("select-textarea");
|
|
26
|
+
const formSize = useFormSize();
|
|
27
|
+
const formDisabled = useFormDisabled();
|
|
28
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
29
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
30
|
+
const containerCls = computed(() => [
|
|
31
|
+
nsInput.b(),
|
|
32
|
+
nsInput.m(trueSize.value)
|
|
33
|
+
]);
|
|
34
|
+
const _inputProps = computed(() => ({
|
|
35
|
+
disabled: trueDisabled.value,
|
|
36
|
+
clearable: true,
|
|
37
|
+
...props.inputProps,
|
|
38
|
+
type: "textarea"
|
|
39
|
+
}));
|
|
40
|
+
watch(() => props.modelValue, (v) => {
|
|
41
|
+
inputVal.value = v;
|
|
42
|
+
});
|
|
43
|
+
function input(val) {
|
|
44
|
+
emit("update:modelValue", val);
|
|
45
|
+
emit("input", val);
|
|
46
|
+
}
|
|
47
|
+
function change(val) {
|
|
48
|
+
emit("change", val);
|
|
49
|
+
}
|
|
50
|
+
function selectChange(val) {
|
|
51
|
+
if (!inputVal.value && inputVal.value !== 0)
|
|
52
|
+
inputVal.value = "";
|
|
53
|
+
let content = val;
|
|
54
|
+
if (!props.replace) {
|
|
55
|
+
const inputEl = inputRef.value.getElementsByTagName("textarea")[0];
|
|
56
|
+
content = insertCursorPosition(inputEl, val);
|
|
57
|
+
}
|
|
58
|
+
input(content);
|
|
59
|
+
change(content);
|
|
60
|
+
emit("select", val);
|
|
61
|
+
}
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return openBlock(), createElementBlock("div", {
|
|
64
|
+
class: normalizeClass(unref(containerCls))
|
|
65
|
+
}, [
|
|
66
|
+
createElementVNode("div", _hoisted_1, [
|
|
67
|
+
createElementVNode("div", _hoisted_2, [
|
|
68
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
69
|
+
createVNode(HzztTitle, {
|
|
70
|
+
class: "margin-l-1",
|
|
71
|
+
label: _ctx.label
|
|
72
|
+
}, null, 8, ["label"])
|
|
73
|
+
]),
|
|
74
|
+
!unref(trueDisabled) ? (openBlock(), createBlock(unref(ElSelectV2), {
|
|
75
|
+
key: 0,
|
|
76
|
+
class: "flex-1",
|
|
77
|
+
modelValue: selectValue.value,
|
|
78
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
|
|
79
|
+
"allow-create": "",
|
|
80
|
+
filterable: "",
|
|
81
|
+
clearable: "",
|
|
82
|
+
onChange: selectChange,
|
|
83
|
+
options: _ctx.data
|
|
84
|
+
}, null, 8, ["modelValue", "options"])) : createCommentVNode("v-if", true),
|
|
85
|
+
renderSlot(_ctx.$slots, "right")
|
|
86
|
+
]),
|
|
87
|
+
createVNode(unref(ElInput), mergeProps({
|
|
88
|
+
ref_key: "inputRef",
|
|
89
|
+
ref: inputRef,
|
|
90
|
+
class: "flex-1 margin-t-1",
|
|
91
|
+
modelValue: inputVal.value,
|
|
92
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
|
|
93
|
+
}, unref(_inputProps), {
|
|
94
|
+
onInput: input,
|
|
95
|
+
onChange: change
|
|
96
|
+
}), null, 16, ["modelValue"])
|
|
97
|
+
])
|
|
98
|
+
], 2);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
var SelectTextarea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-textarea.vue"]]);
|
|
103
|
+
|
|
104
|
+
export { SelectTextarea as default };
|
|
105
|
+
//# sourceMappingURL=select-textarea2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-textarea2.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div class=\"flex column\">\n <div class=\"flex align-items-center\">\n <slot name=\"title\">\n <hzzt-title class=\"margin-l-1\" :label=\"label\"></hzzt-title>\n </slot>\n <el-select-v2 class=\"flex-1\" v-model=\"selectValue\" allow-create filterable clearable @change=\"selectChange\"\n v-if=\"!trueDisabled\" :options=\"data\"></el-select-v2>\n <slot name=\"right\"></slot>\n </div>\n <el-input ref=\"inputRef\" class=\"flex-1 margin-t-1\" v-model=\"inputVal\" v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"></el-input>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {selectTextareaProps, selectTextareaEmits} from './select-textarea'\n import {computed, ref, watch} from \"vue\";\n import {useGlobalSize, useNamespace, insertCursorPosition} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import HzztTitle from \"@hzzt-plus/components/title/src/title.vue\";\n import {ElInput, ElSelectV2} from 'element-plus'\n\n defineOptions({\n name: 'HzztSelectTextarea',\n })\n\n const props = defineProps(selectTextareaProps)\n const emit = defineEmits(selectTextareaEmits)\n\n const inputVal = ref(props.modelValue);\n const selectValue = ref('');\n const inputRef = ref();\n\n const nsInput = useNamespace('select-textarea')\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n type: 'textarea',\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n })\n\n function input(val: string) {\n emit('update:modelValue', val);\n emit('input', val);\n }\n\n function change(val: string) {\n emit('change', val);\n }\n\n function selectChange(val: string) {\n if (!inputVal.value && inputVal.value !== 0) inputVal.value = '';\n let content = val;\n if (!props.replace) {\n const inputEl = inputRef.value.getElementsByTagName('textarea')[0];\n content = insertCursorPosition(inputEl, val);\n }\n input(content);\n change(content);\n emit('select', val);\n }\n\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;;;;;mCA0BgB,CAAA;AAAA,EACZ,IAAM,EAAA,oBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AACrC,IAAM,MAAA,WAAA,GAAc,IAAI,EAAE,CAAA,CAAA;AAC1B,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,OAAA,GAAU,aAAa,iBAAiB,CAAA,CAAA;AAC9C,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,IAAA,MAAM,eAAe,eAAgB,EAAA,CAAA;AAErC,IAAA,MAAM,QAAW,GAAA,QAAA,CAAA,MAAA,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,KAAA,IAAA,aAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IAAA,kBACH,GAAA,QAAiB,CAAA,MAAA,kBAAuB,YAAE,CAAA,KAAA,CAAA,CAAA;AAAA,IACxD,MAAA,YAAA,GAAA,QAAA,CAAA,MAAA;AAEA,MAAA;AAEA,MAAM,OAAA,CAAA,CAAA,CAAA,QAAA,CAAe;AAAe,KAAA,CAClC;AAAU,IACV,MAAA,WAAU,GAAA,QAAc,CAAA,OAAA;AAAA,MACzB,QAAA,EAAA,YAAA,CAAA,KAAA;AAED,MAAM,SAAA,EAAA,IAAA;AAA8B,MAClC,mBAAuB;AAAA,MACvB,IAAW,EAAA,UAAA;AAAA,KAAA,CACX;AAAS,IAAA,KACH,CAAA,MAA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sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineComponent, useSlots, computed, unref, openBlock, createElementBlock, createCommentVNode, renderSlot, createElementVNode, createTextVNode, toDisplayString } from 'vue';
|
|
2
|
-
import '../../index.mjs';
|
|
3
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
4
2
|
import { titleProps } from './title.mjs';
|
|
3
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
4
|
|
|
6
5
|
const _hoisted_1 = {
|
|
7
6
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"title2.mjs","sources":["../../../../../../packages/components/title/src/title.vue"],"sourcesContent":["<template>\n <div v-if=\"showLabel\" class=\"hzzt-title flex align-items-center\">\n <span v-if=\"sideline\" class=\"decorative-line\" />\n <slot name=\"before\" />\n <label class=\"label-name\">\n <slot>{{ label }}</slot>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { titleProps } from '
|
|
1
|
+
{"version":3,"file":"title2.mjs","sources":["../../../../../../packages/components/title/src/title.vue"],"sourcesContent":["<template>\n <div v-if=\"showLabel\" class=\"hzzt-title flex align-items-center\">\n <span v-if=\"sideline\" class=\"decorative-line\" />\n <slot name=\"before\" />\n <label class=\"label-name\">\n <slot>{{ label }}</slot>\n </label>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { titleProps } from './title'\n\ndefineOptions({\n name: 'HzztTitle',\n})\n\nconst props = defineProps(titleProps)\n\nconst slots = useSlots()\n\nconst showLabel = computed(\n () => props.label || slots?.default?.()?.[0]?.children\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;mCAcc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,SAAY,GAAA,QAAA,CAAA,MAAA;AAAA,MAChB,MAAM,EAAM,EAAA,EAAA,EAAA,CAAA;AAAkC,MAChD,OAAA,KAAA,CAAA,KAAA,KAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,OAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;"}
|
package/es/hooks/index.d.ts
CHANGED
package/es/hooks/index.mjs
CHANGED
|
@@ -2,4 +2,5 @@ export { buildLocaleContext, buildTranslator, localeContextKey, translate, useLo
|
|
|
2
2
|
export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps } from './use-size/index.mjs';
|
|
3
3
|
export { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from './use-namespace/index.mjs';
|
|
4
4
|
export { numberToLetter } from './use-letter/index.mjs';
|
|
5
|
+
export { insertCursorPosition } from './use-cursor/index.mjs';
|
|
5
6
|
//# sourceMappingURL=index.mjs.map
|
package/es/hooks/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function insertCursorPosition(inputEl: HTMLInputElement, content: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function insertCursorPosition(inputEl, content) {
|
|
2
|
+
const startPos = inputEl.selectionStart || 0;
|
|
3
|
+
const endPos = inputEl.selectionEnd || 0;
|
|
4
|
+
const restoreTop = inputEl.scrollTop;
|
|
5
|
+
inputEl.value = inputEl.value.substring(0, startPos) + content + inputEl.value.substring(endPos, inputEl.value.length);
|
|
6
|
+
inputEl.focus();
|
|
7
|
+
inputEl.scrollTop = restoreTop;
|
|
8
|
+
inputEl.selectionStart = startPos + content.length;
|
|
9
|
+
inputEl.selectionEnd = startPos + content.length;
|
|
10
|
+
return inputEl.value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { insertCursorPosition };
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-cursor/index.ts"],"sourcesContent":["export function insertCursorPosition(inputEl: HTMLInputElement, content: string) {\n const startPos: number = inputEl.selectionStart || 0;\n const endPos: number = inputEl.selectionEnd || 0;\n const restoreTop = inputEl.scrollTop;\n inputEl.value = inputEl.value.substring(0, startPos) +\n content + inputEl.value.substring(endPos, inputEl.value.length);\n inputEl.focus();\n inputEl.scrollTop = restoreTop;\n inputEl.selectionStart = startPos + content.length;\n inputEl.selectionEnd = startPos + content.length;\n return inputEl.value;\n}\n"],"names":[],"mappings":"AAAO,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE;AACvD,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC;AAC/C,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC;AAC3C,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;AACvC,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACzH,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,EAAE,OAAO,CAAC,SAAS,GAAG,UAAU,CAAC;AACjC,EAAE,OAAO,CAAC,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;AACrD,EAAE,OAAO,CAAC,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;AACnD,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -25,6 +25,8 @@ export { scanEmits, scanProps } from './components/scan/src/scan.mjs';
|
|
|
25
25
|
export { HzztScan } from './components/scan/index.mjs';
|
|
26
26
|
export { selectInputEmits, selectInputProps } from './components/select-input/src/select-input.mjs';
|
|
27
27
|
export { HzztSelectInput } from './components/select-input/index.mjs';
|
|
28
|
+
export { selectTextareaEmits, selectTextareaProps } from './components/select-textarea/src/select-textarea.mjs';
|
|
29
|
+
export { HzztSelectTextarea } from './components/select-textarea/index.mjs';
|
|
28
30
|
export { INSTALLED_KEY } from './constants/key.mjs';
|
|
29
31
|
export { componentSizeMap, componentSizes } from './constants/size.mjs';
|
|
30
32
|
export { WEEK_DAYS, datePickTypes } from './constants/date.mjs';
|
|
@@ -38,6 +40,7 @@ export { buildLocaleContext, buildTranslator, localeContextKey, translate, useLo
|
|
|
38
40
|
export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps } from './hooks/use-size/index.mjs';
|
|
39
41
|
export { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from './hooks/use-namespace/index.mjs';
|
|
40
42
|
export { numberToLetter } from './hooks/use-letter/index.mjs';
|
|
43
|
+
export { insertCursorPosition } from './hooks/use-cursor/index.mjs';
|
|
41
44
|
|
|
42
45
|
const install = installer.install;
|
|
43
46
|
const version = installer.version;
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../packages/hzzt-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@hzzt-plus/components'\nexport * from '@hzzt-plus/constants'\nexport * from '@hzzt-plus/directives'\nexport * from '@hzzt-plus/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../packages/hzzt-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@hzzt-plus/components'\nexport * from '@hzzt-plus/constants'\nexport * from '@hzzt-plus/directives'\nexport * from '@hzzt-plus/hooks'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "1.0.2";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '1.0.2'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/global.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare module 'vue' {
|
|
|
15
15
|
HzztQuarterPicker: typeof import('hzzt-plus')['HzztQuarterPicker']
|
|
16
16
|
HzztScan: typeof import('hzzt-plus')['HzztScan']
|
|
17
17
|
HzztSelectInput: typeof import('hzzt-plus')['HzztSelectInput']
|
|
18
|
+
HzztSelectTextarea: typeof import('hzzt-plus')['HzztSelectTextarea']
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
package/lib/component.js
CHANGED
|
@@ -16,6 +16,7 @@ var index$a = require('./components/check-button/index.js');
|
|
|
16
16
|
var index$b = require('./components/quarter-picker/index.js');
|
|
17
17
|
var index$c = require('./components/scan/index.js');
|
|
18
18
|
var index$d = require('./components/select-input/index.js');
|
|
19
|
+
var index$e = require('./components/select-textarea/index.js');
|
|
19
20
|
|
|
20
21
|
var Components = [
|
|
21
22
|
index.HzztConfigProvider,
|
|
@@ -31,7 +32,8 @@ var Components = [
|
|
|
31
32
|
index$a.HzztCheckButton,
|
|
32
33
|
index$b.HzztQuarterPicker,
|
|
33
34
|
index$c.HzztScan,
|
|
34
|
-
index$d.HzztSelectInput
|
|
35
|
+
index$d.HzztSelectInput,
|
|
36
|
+
index$e.HzztSelectTextarea
|
|
35
37
|
];
|
|
36
38
|
|
|
37
39
|
exports["default"] = Components;
|
package/lib/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\nimport { HzztCollapse } from '@hzzt-plus/components/collapse'\nimport { HzztConfigProvider } from '@hzzt-plus/components/config-provider'\nimport { HzztTab } from '@hzzt-plus/components/tab'\nimport { HzztIcon } from '@hzzt-plus/components/icon'\nimport { HzztPagination } from '@hzzt-plus/components/pagination'\nimport { HzztTooltip } from '@hzzt-plus/components/tooltip'\nimport { HzztPageSize } from '@hzzt-plus/components/page-size'\nimport { HzztConfirmPassword } from '@hzzt-plus/components/confirm-password'\nimport { HzztCheckButton } from '@hzzt-plus/components/check-button'\nimport { HzztQuarterPicker } from '@hzzt-plus/components/quarter-picker'\nimport { HzztScan } from '@hzzt-plus/components/scan'\nimport { HzztSelectInput } from '@hzzt-plus/components/select-input'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n HzztIcon,\n HzztPagination,\n HzztTooltip,\n HzztPageSize,\n HzztConfirmPassword,\n HzztCheckButton,\n HzztQuarterPicker,\n HzztScan,\n HzztSelectInput,\n] as Plugin[]\n"],"names":["HzztConfigProvider","HzztTitle","HzztDropdown","HzztCollapse","HzztTab","HzztIcon","HzztPagination","HzztTooltip","HzztPageSize","HzztConfirmPassword","HzztCheckButton","HzztQuarterPicker","HzztScan","HzztSelectInput"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\nimport { HzztCollapse } from '@hzzt-plus/components/collapse'\nimport { HzztConfigProvider } from '@hzzt-plus/components/config-provider'\nimport { HzztTab } from '@hzzt-plus/components/tab'\nimport { HzztIcon } from '@hzzt-plus/components/icon'\nimport { HzztPagination } from '@hzzt-plus/components/pagination'\nimport { HzztTooltip } from '@hzzt-plus/components/tooltip'\nimport { HzztPageSize } from '@hzzt-plus/components/page-size'\nimport { HzztConfirmPassword } from '@hzzt-plus/components/confirm-password'\nimport { HzztCheckButton } from '@hzzt-plus/components/check-button'\nimport { HzztQuarterPicker } from '@hzzt-plus/components/quarter-picker'\nimport { HzztScan } from '@hzzt-plus/components/scan'\nimport { HzztSelectInput } from '@hzzt-plus/components/select-input'\nimport { HzztSelectTextarea } from '@hzzt-plus/components/select-textarea'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n HzztTab,\n HzztIcon,\n HzztPagination,\n HzztTooltip,\n HzztPageSize,\n HzztConfirmPassword,\n HzztCheckButton,\n HzztQuarterPicker,\n HzztScan,\n HzztSelectInput,\n HzztSelectTextarea,\n] as Plugin[]\n"],"names":["HzztConfigProvider","HzztTitle","HzztDropdown","HzztCollapse","HzztTab","HzztIcon","HzztPagination","HzztTooltip","HzztPageSize","HzztConfirmPassword","HzztCheckButton","HzztQuarterPicker","HzztScan","HzztSelectInput","HzztSelectTextarea"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeA,iBAAe;AACf,EAAEA,wBAAkB;AACpB,EAAEC,iBAAS;AACX,EAAEC,oBAAY;AACd,EAAEC,oBAAY;AACd,EAAEC,eAAO;AACT,EAAEC,gBAAQ;AACV,EAAEC,sBAAc;AAChB,EAAEC,mBAAW;AACb,EAAEC,oBAAY;AACd,EAAEC,2BAAmB;AACrB,EAAEC,uBAAe;AACjB,EAAEC,yBAAiB;AACnB,EAAEC,gBAAQ;AACV,EAAEC,uBAAe;AACjB,EAAEC,0BAAkB;AACpB,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
2
|
options: {
|
|
3
|
-
type:
|
|
3
|
+
type: import("vue").PropType<import("..").OptionType[]>;
|
|
4
4
|
default: () => never[];
|
|
5
5
|
};
|
|
6
6
|
label: StringConstructor;
|
|
@@ -28,7 +28,7 @@ export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<i
|
|
|
28
28
|
}, {
|
|
29
29
|
dProps: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
30
30
|
options: {
|
|
31
|
-
type:
|
|
31
|
+
type: import("vue").PropType<import("..").OptionType[]>;
|
|
32
32
|
default: () => never[];
|
|
33
33
|
};
|
|
34
34
|
label: StringConstructor;
|
|
@@ -60,12 +60,12 @@ export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<i
|
|
|
60
60
|
toggle: import("vue").Ref<boolean>;
|
|
61
61
|
dropToggle: () => void;
|
|
62
62
|
close: () => void;
|
|
63
|
-
selectValue: (val:
|
|
63
|
+
selectValue: (val: string[]) => void;
|
|
64
64
|
vClickOutside: import("vue").ObjectDirective<any, any>;
|
|
65
65
|
isEmpty: (val: unknown) => boolean;
|
|
66
66
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
67
|
options: {
|
|
68
|
-
type:
|
|
68
|
+
type: import("vue").PropType<import("..").OptionType[]>;
|
|
69
69
|
default: () => never[];
|
|
70
70
|
};
|
|
71
71
|
label: StringConstructor;
|
|
@@ -94,7 +94,7 @@ export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<i
|
|
|
94
94
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
95
95
|
}, {
|
|
96
96
|
props: Record<string, any>;
|
|
97
|
-
options:
|
|
97
|
+
options: import("..").OptionType[];
|
|
98
98
|
defaultValue: unknown[];
|
|
99
99
|
position: string;
|
|
100
100
|
returnType: string;
|
|
@@ -6,6 +6,7 @@ var vue = require('vue');
|
|
|
6
6
|
var elementPlus = require('element-plus');
|
|
7
7
|
require('../../../utils/index.js');
|
|
8
8
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
9
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
10
|
var types = require('../../../utils/types.js');
|
|
10
11
|
|
|
11
12
|
const _hoisted_1 = ["onClick"];
|
|
@@ -22,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
22
23
|
...__default__,
|
|
23
24
|
props: {
|
|
24
25
|
options: {
|
|
25
|
-
type: Array,
|
|
26
|
+
type: runtime.definePropType(Array),
|
|
26
27
|
default: () => []
|
|
27
28
|
},
|
|
28
29
|
label: String,
|
|
@@ -63,7 +64,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
64
|
emits("change", val);
|
|
64
65
|
}
|
|
65
66
|
if (dProps.returnType === "String") {
|
|
66
|
-
emits("change", val.
|
|
67
|
+
emits("change", val[val.length - 1]);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
return (_ctx, _cache) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul v-click-outside=\"close\" class=\"hzzt-dropdown\" @click.stop=\"dropToggle\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\" />\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li\n v-if=\"isEmpty(option[props.children])\"\n :key=\"index\"\n :class=\"{\n 'hzzt-dropdown-menu-item': true,\n selected: defaultValue.includes(option[props.value]),\n }\"\n >\n <a\n class=\"hzzt-dropdown-menu-item-label\"\n @click=\"selectValue([option[props.value]])\"\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul v-click-outside=\"close\" class=\"hzzt-dropdown\" @click.stop=\"dropToggle\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\" />\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li\n v-if=\"isEmpty(option[props.children])\"\n :key=\"index\"\n :class=\"{\n 'hzzt-dropdown-menu-item': true,\n selected: defaultValue.includes(option[props.value]),\n }\"\n >\n <a\n class=\"hzzt-dropdown-menu-item-label\"\n @click=\"selectValue([option[props.value]])\"\n >{{ option[props.label] }}</a\n >\n </li>\n <li\n v-else\n :key=\"index + 'submenu'\"\n class=\"hzzt-dropdown-menu-item hzzt-dropdown-submenu\"\n >\n <a class=\"submenu\">{{ option[props.label] }}</a>\n <ul :class=\"['pull-' + position]\" class=\"hzzt-dropdown-menu\">\n <li\n v-for=\"(child, cIndex) in option.children\"\n :key=\"cIndex\"\n :class=\"{\n 'hzzt-dropdown-menu-item': true,\n selected: defaultValue.includes(child[props.value]),\n }\"\n >\n <a\n class=\"hzzt-dropdown-menu-item-label\"\n @click=\"\n selectValue([option[props.value], child[props.value]])\n \"\n >{{ child[props.label] }}</a\n >\n </li>\n </ul>\n </li>\n <li v-if=\"option.divider\" :key=\"index + 'divider'\" class=\"divider\" />\n </template>\n </ul>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import {ref} from 'vue'\n import {ClickOutside as vClickOutside} from 'element-plus'\n import {definePropType, isEmpty} from '@hzzt-plus/utils'\n import {OptionType} from \"@hzzt-plus/components\";\n\n const dProps = defineProps({\n options: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n label: String,\n value: String,\n defaultValue: {\n type: Array,\n default: () => [],\n },\n position: {\n type: String,\n default: 'right',\n },\n props: {\n type: Object,\n default: () => ({\n children: 'children',\n label: 'label',\n value: 'value',\n }),\n },\n returnType: {\n type: String,\n default: 'Array',\n },\n })\n\n const emits = defineEmits(['change'])\n\n defineOptions({\n name: 'HzztDropDown',\n })\n\n const toggle = ref(false)\n\n function dropToggle() {\n toggle.value = !toggle.value\n }\n\n function close() {\n toggle.value = false\n }\n\n function selectValue(val: Array<string>) {\n if (dProps.returnType === 'Array') {\n emits('change', val)\n }\n if (dProps.returnType === 'String') {\n emits('change', val[val.length-1])\n }\n }\n</script>\n"],"names":["_defineComponent","definePropType","_withDirectives","_openBlock","_createElementBlock","_withModifiers","_createElementVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsDE,CAAA,CAAA,CAAA;AACA,MAAA,4BAA4CA,mBAAA,CAAA;AAC5C,EAAA,GAAA;;;AAkCc,MACN,IAAA,EAAAC,sBAAA,CAAA,KAAA,CAAA;AACR,MAAA,OAAA,EAAA,MAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,KAAM;AAEN,IAAA,SAAS,WAAa,CAAA,GAAA,EAAA;AACpB,MAAO,IAAA,MAAA,CAAA,UAAgB,KAAA,OAAA,EAAA;AAAA,QACzB,KAAA,CAAA,QAAA,EAAA,GAAA,CAAA,CAAA;AAEA,OAAA;AACE,MAAA,IAAA,MAAe,CAAA,UAAA,KAAA,QAAA,EAAA;AAAA,QACjB,KAAA,CAAA,QAAA,EAAA,GAAA,CAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAEA,OAAA;AACE,KAAI;AACF,IAAA,OAAA,CAAA,YAAgB,KAAG;AAAA,MACrB,OAAAC,kBAAA,EAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,IAAA,EAAA;AACA,QAAI,KAAA,EAAA;AACF,QAAA,OAAgB,EAAAC,iBAAQ,CAAA,UAAQ,EAAC,CAAA,MAAA,CAAA,CAAA;AAAA,OACnC,EAAA;AAAA,QACFC,sBAAA,CAAA,IAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { OptionType } from "hzzt-plus/es/components";
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
options: {
|
|
3
|
-
type:
|
|
4
|
+
type: import("vue").PropType<OptionType[]>;
|
|
4
5
|
default: () => never[];
|
|
5
6
|
};
|
|
6
7
|
label: StringConstructor;
|
|
@@ -28,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
29
|
}, {
|
|
29
30
|
dProps: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
30
31
|
options: {
|
|
31
|
-
type:
|
|
32
|
+
type: import("vue").PropType<OptionType[]>;
|
|
32
33
|
default: () => never[];
|
|
33
34
|
};
|
|
34
35
|
label: StringConstructor;
|
|
@@ -60,12 +61,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
61
|
toggle: import("vue").Ref<boolean>;
|
|
61
62
|
dropToggle: () => void;
|
|
62
63
|
close: () => void;
|
|
63
|
-
selectValue: (val:
|
|
64
|
+
selectValue: (val: Array<string>) => void;
|
|
64
65
|
vClickOutside: import("vue").ObjectDirective<any, any>;
|
|
65
66
|
isEmpty: (val: unknown) => boolean;
|
|
66
67
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
68
|
options: {
|
|
68
|
-
type:
|
|
69
|
+
type: import("vue").PropType<OptionType[]>;
|
|
69
70
|
default: () => never[];
|
|
70
71
|
};
|
|
71
72
|
label: StringConstructor;
|
|
@@ -94,7 +95,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
95
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
95
96
|
}, {
|
|
96
97
|
props: Record<string, any>;
|
|
97
|
-
options:
|
|
98
|
+
options: OptionType[];
|
|
98
99
|
defaultValue: unknown[];
|
|
99
100
|
position: string;
|
|
100
101
|
returnType: string;
|
package/lib/components/index.js
CHANGED
|
@@ -16,12 +16,14 @@ var index$a = require('./check-button/index.js');
|
|
|
16
16
|
var index$b = require('./quarter-picker/index.js');
|
|
17
17
|
var index$c = require('./scan/index.js');
|
|
18
18
|
var index$d = require('./select-input/index.js');
|
|
19
|
+
var index$e = require('./select-textarea/index.js');
|
|
19
20
|
var title = require('./title/src/title.js');
|
|
20
21
|
var configProviderProps = require('./config-provider/src/config-provider-props.js');
|
|
21
22
|
var constants = require('./config-provider/src/constants.js');
|
|
22
23
|
var useGlobalConfig = require('./config-provider/src/hooks/use-global-config.js');
|
|
23
24
|
var scan = require('./scan/src/scan.js');
|
|
24
25
|
var selectInput = require('./select-input/src/select-input.js');
|
|
26
|
+
var selectTextarea = require('./select-textarea/src/select-textarea.js');
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
|
|
@@ -39,6 +41,7 @@ exports.HzztCheckButton = index$a.HzztCheckButton;
|
|
|
39
41
|
exports.HzztQuarterPicker = index$b.HzztQuarterPicker;
|
|
40
42
|
exports.HzztScan = index$c.HzztScan;
|
|
41
43
|
exports.HzztSelectInput = index$d.HzztSelectInput;
|
|
44
|
+
exports.HzztSelectTextarea = index$e.HzztSelectTextarea;
|
|
42
45
|
exports.titleProps = title.titleProps;
|
|
43
46
|
exports.configProviderProps = configProviderProps.configProviderProps;
|
|
44
47
|
exports.configProviderContextKey = constants.configProviderContextKey;
|
|
@@ -48,4 +51,6 @@ exports.scanEmits = scan.scanEmits;
|
|
|
48
51
|
exports.scanProps = scan.scanProps;
|
|
49
52
|
exports.selectInputEmits = selectInput.selectInputEmits;
|
|
50
53
|
exports.selectInputProps = selectInput.selectInputProps;
|
|
54
|
+
exports.selectTextareaEmits = selectTextarea.selectTextareaEmits;
|
|
55
|
+
exports.selectTextareaProps = selectTextarea.selectTextareaProps;
|
|
51
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -82,7 +82,7 @@ export declare const HzztPageSize: import("hzzt-plus/es/utils").SFCWithInstall<i
|
|
|
82
82
|
compKls: import("vue").ComputedRef<string[]>;
|
|
83
83
|
page: import("vue").ComputedRef<number>;
|
|
84
84
|
pageSizeChange: (size: number) => void;
|
|
85
|
-
currentChange: (page: number) => void;
|
|
85
|
+
currentChange: (page: number | undefined) => void;
|
|
86
86
|
ElButton: import("element-plus/es/utils").SFCWithInstall<{
|
|
87
87
|
new (...args: any[]): {
|
|
88
88
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/page-size/src/index.vue"],"sourcesContent":["<template>\n <main\n :class=\"compKls\"\n class=\"flex wrap align-items-center justify-content-end\"\n >\n <span v-if=\"total > 0 && !isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.total') }}{{ total\n }}{{ t('hzzt.pageSize.strip') }}</span\n >\n <span v-if=\"isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.d') }}{{ modelValue\n }}{{ t('hzzt.pageSize.page') }}</span\n >\n <div\n v-if=\"pageSizeOptions.length\"\n :class=\"ns.e('option')\"\n class=\"flex align-items-center\"\n >\n <span class=\"line-height-1\">{{ t('hzzt.pageSize.per_page') }}</span>\n <el-select\n v-model=\"sizeValue\"\n :disabled=\"disabled\"\n :size=\"trueSize\"\n :clearable=\"false\"\n @change=\"pageSizeChange\"\n >\n <el-option\n v-for=\"item in pageSizeOptions\"\n :key=\"item\"\n :label=\"`${item}${t('hzzt.pageSize.strip')}`\"\n :value=\"item\"\n />\n </el-select>\n </div>\n <div v-if=\"page > 1 || isManual\" :class=\"ns.e('pagination')\">\n <span v-if=\"!isManual\" class=\"margin-l-1 margin-r-2\"\n >{{ modelValue }}/{{ page }}</span\n >\n <el-button\n v-if=\"page > 2 && modelValue > 2\"\n type=\"primary\"\n style=\"margin-right: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(1)\"\n >\n <hzzt-icon name=\"d-arrow-left\" />\n </el-button>\n <el-input-number\n v-model=\"innerPage\"\n class=\"width-2\"\n :size=\"trueSize\"\n :min=\"1\"\n :max=\"page\"\n @change=\"currentChange\"\n />\n <el-button\n v-if=\"page > 2 && modelValue < page\"\n type=\"primary\"\n style=\"margin-left: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(page)\"\n >\n <hzzt-icon name=\"d-arrow-right\" />\n </el-button>\n </div>\n </main>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElButton, ElInputNumber, ElSelect } from 'element-plus'\nimport {\n useGlobalSize,\n useLocale,\n useNamespace,\n useSizeProp,\n} from '@hzzt-plus/hooks'\nimport HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n\ndefineOptions({\n name: 'HzztPageSize',\n})\n\nconst props = defineProps({\n modelValue: {\n type: Number,\n default: 1,\n },\n pageSize: {\n type: Number,\n default: 20,\n },\n total: {\n type: Number,\n default: 0,\n },\n disabled: Boolean,\n isManual: Boolean,\n isLastPage: Boolean,\n pageSizeOptions: {\n type: Array,\n default: () => [20, 50, 100, 200, 500, 1000, 2000],\n },\n size: useSizeProp,\n})\n\nconst emit = defineEmits([\n 'page-size-change',\n 'update:modelValue',\n 'current-change',\n])\n\nconst sizeValue = ref(props.pageSize)\nconst innerPage = ref(props.modelValue || 0)\nconst { t } = useLocale()\nconst ns = useNamespace('page-size')\n\nconst trueSize = computed(() => props.size || useGlobalSize().value)\n\nconst compKls = computed(() => {\n return [ns.b(), ns.m(trueSize.value)]\n})\n\nconst page = computed(() => Math.ceil(props.total / props.pageSize) || 1)\n\nwatch(\n () => props.pageSize,\n (val) => {\n sizeValue.value = val\n }\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n innerPage.value = val\n }\n)\n\nfunction pageSizeChange(size: number) {\n emit('page-size-change', size)\n}\n\nfunction currentChange(page: number) {\n emit('update:modelValue', page)\n emit('current-change', page)\n}\n</script>\n"],"names":["ref","useLocale","useNamespace","computed","useGlobalSize","watch","_resolveComponent","_openBlock","page","_createElementBlock","_toDisplayString","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uCA+Ec,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,MAAA,SAAA,GAAYA,OAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACpC,IAAA,MAAM,SAAY,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAAc,CAAC,C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ources":["../../../../../../packages/components/page-size/src/index.vue"],"sourcesContent":["<template>\n <main\n :class=\"compKls\"\n class=\"flex wrap align-items-center justify-content-end\"\n >\n <span v-if=\"total > 0 && !isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.total') }}{{ total\n }}{{ t('hzzt.pageSize.strip') }}</span\n >\n <span v-if=\"isManual\" style=\"white-space: nowrap\"\n >{{ t('hzzt.pageSize.d') }}{{ modelValue\n }}{{ t('hzzt.pageSize.page') }}</span\n >\n <div\n v-if=\"pageSizeOptions.length\"\n :class=\"ns.e('option')\"\n class=\"flex align-items-center\"\n >\n <span class=\"line-height-1\">{{ t('hzzt.pageSize.per_page') }}</span>\n <el-select\n v-model=\"sizeValue\"\n :disabled=\"disabled\"\n :size=\"trueSize\"\n :clearable=\"false\"\n @change=\"pageSizeChange\"\n >\n <el-option\n v-for=\"item in pageSizeOptions\"\n :key=\"item\"\n :label=\"`${item}${t('hzzt.pageSize.strip')}`\"\n :value=\"item\"\n />\n </el-select>\n </div>\n <div v-if=\"page > 1 || isManual\" :class=\"ns.e('pagination')\">\n <span v-if=\"!isManual\" class=\"margin-l-1 margin-r-2\"\n >{{ modelValue }}/{{ page }}</span\n >\n <el-button\n v-if=\"page > 2 && modelValue > 2\"\n type=\"primary\"\n style=\"margin-right: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(1)\"\n >\n <hzzt-icon name=\"d-arrow-left\" />\n </el-button>\n <el-input-number\n v-model=\"innerPage\"\n class=\"width-2\"\n :size=\"trueSize\"\n :min=\"1\"\n :max=\"page\"\n @change=\"currentChange\"\n />\n <el-button\n v-if=\"page > 2 && modelValue < page\"\n type=\"primary\"\n style=\"margin-left: 2px\"\n :size=\"trueSize\"\n @click=\"currentChange(page)\"\n >\n <hzzt-icon name=\"d-arrow-right\" />\n </el-button>\n </div>\n </main>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElButton, ElInputNumber, ElSelect } from 'element-plus'\nimport {\n useGlobalSize,\n useLocale,\n useNamespace,\n useSizeProp,\n} from '@hzzt-plus/hooks'\nimport HzztIcon from '@hzzt-plus/components/icon/src/index.vue'\n\ndefineOptions({\n name: 'HzztPageSize',\n})\n\nconst props = defineProps({\n modelValue: {\n type: Number,\n default: 1,\n },\n pageSize: {\n type: Number,\n default: 20,\n },\n total: {\n type: Number,\n default: 0,\n },\n disabled: Boolean,\n isManual: Boolean,\n isLastPage: Boolean,\n pageSizeOptions: {\n type: Array,\n default: () => [20, 50, 100, 200, 500, 1000, 2000],\n },\n size: useSizeProp,\n})\n\nconst emit = defineEmits([\n 'page-size-change',\n 'update:modelValue',\n 'current-change',\n])\n\nconst sizeValue = ref(props.pageSize)\nconst innerPage = ref(props.modelValue || 0)\nconst { t } = useLocale()\nconst ns = useNamespace('page-size')\n\nconst trueSize = computed(() => props.size || useGlobalSize().value)\n\nconst compKls = computed(() => {\n return [ns.b(), ns.m(trueSize.value)]\n})\n\nconst page = computed(() => Math.ceil(props.total / props.pageSize) || 1)\n\nwatch(\n () => props.pageSize,\n (val) => {\n sizeValue.value = val\n }\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n innerPage.value = val\n }\n)\n\nfunction pageSizeChange(size: number) {\n emit('page-size-change', size)\n}\n\nfunction currentChange(page: number | undefined) {\n emit('update:modelValue', page)\n emit('current-change', page)\n}\n</script>\n"],"names":["ref","useLocale","useNamespace","computed","useGlobalSize","watch","_resolveComponent","_openBlock","page","_createElementBlock","_toDisplayString","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uCA+Ec,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,MAAA,SAAA,GAAYA,OAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACpC,IAAA,MAAM,SAAY,GAAAA,OAAA,CAAI,KAAM,CAAA,UAAA,IAA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AAA;AAC/C,QAAA,2BAA0BA,SAAI,CAAA,OAAA,CAAA,EAAA,kDAAA,CAAA,CAAA;AAC9B,OAAA,EAAA;AAA2B,QAC7B,OAAA,CAAA,KAAA,GAAA,CAAA,IAAA,CAAA,OAAA,CAAA,QAAA,IAAAD,aAAA,EAAA,EAAAE,sBAAA,CAAA,MAAA,EAAA,UAAA,EAAAC,mBAAA,CAAAC,SAAA,CAAA,CAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,GAAAD,mBAAA,CAAA,OAAA,CAAA,KAAA,CAAA,GAAAA,mBAAA,CAAAC,SAAA,CAAA,CAAA,CAAA,CAAA,qBAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAAC,sBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -82,7 +82,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
82
82
|
compKls: import("vue").ComputedRef<string[]>;
|
|
83
83
|
page: import("vue").ComputedRef<number>;
|
|
84
84
|
pageSizeChange: (size: number) => void;
|
|
85
|
-
currentChange: (page: number) => void;
|
|
85
|
+
currentChange: (page: number | undefined) => void;
|
|
86
86
|
ElButton: import("element-plus/es/utils").SFCWithInstall<{
|
|
87
87
|
new (...args: any[]): {
|
|
88
88
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan2.js","sources":["../../../../../../packages/components/scan/src/scan.vue"],"sourcesContent":["<template>\n <div\n class=\"hzzt-scan\"\n style=\"position: relative\"\n :class=\"$attrs.class\"\n :style=\"$attrs.style\"\n >\n <div style=\"width: 0; height: 0; overflow: hidden\">\n <input readonly style=\"width: 0; height: 0; overflow: hidden\" />\n <input\n readonly\n type=\"password\"\n autocomplete=\"off\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n\n <el-input\n ref=\"inputRef\"\n v-model=\"innerValue\"\n v-bind=\"{\n ...$attrs,\n class: '',\n style: '',\n onChange: '',\n }\"\n :readonly=\"readonly\"\n :type=\"inputType\"\n class=\"hzzt-scan-input-original\"\n autocomplete=\"off\"\n @focus=\"inputFocus\"\n @blur=\"inputBlur\"\n @change=\"inputChange\"\n >\n <template v-for=\"(_, key, index) in $slots\" :key=\"index\" #[key]>\n <slot :name=\"key\" />\n </template>\n </el-input>\n <div\n class=\"hzzt-scan-input-backup\"\n :class=\"{ 'placeholder-color': innerValue === ' ' }\"\n >\n <div class=\"width-100%\" style=\"overflow: hidden\">\n {{ showValue }}\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElInput } from 'element-plus'\nimport { scanEmits, scanProps } from '
|
|
1
|
+
{"version":3,"file":"scan2.js","sources":["../../../../../../packages/components/scan/src/scan.vue"],"sourcesContent":["<template>\n <div\n class=\"hzzt-scan\"\n style=\"position: relative\"\n :class=\"$attrs.class\"\n :style=\"$attrs.style\"\n >\n <div style=\"width: 0; height: 0; overflow: hidden\">\n <input readonly style=\"width: 0; height: 0; overflow: hidden\" />\n <input\n readonly\n type=\"password\"\n autocomplete=\"off\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n\n <el-input\n ref=\"inputRef\"\n v-model=\"innerValue\"\n v-bind=\"{\n ...$attrs,\n class: '',\n style: '',\n onChange: '',\n }\"\n :readonly=\"readonly\"\n :type=\"inputType\"\n class=\"hzzt-scan-input-original\"\n autocomplete=\"off\"\n @focus=\"inputFocus\"\n @blur=\"inputBlur\"\n @change=\"inputChange\"\n >\n <template v-for=\"(_, key, index) in $slots\" :key=\"index\" #[key]>\n <slot :name=\"key\" />\n </template>\n </el-input>\n <div\n class=\"hzzt-scan-input-backup\"\n :class=\"{ 'placeholder-color': innerValue === ' ' }\"\n >\n <div class=\"width-100%\" style=\"overflow: hidden\">\n {{ showValue }}\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, watch } from 'vue'\nimport { ElInput } from 'element-plus'\nimport { scanEmits, scanProps } from './scan'\n\ndefineOptions({\n inheritAttrs: false,\n name: 'HzztScan',\n})\n\nconst props = defineProps(scanProps)\n\nconst emit = defineEmits(scanEmits)\n\nconst readonly = ref(true)\nconst innerValue = ref(' ')\nconst inputRef = ref()\n\nconst showValue = computed(() => {\n if (innerValue.value === ' ') {\n return ` ${props.placeholder}`\n } else {\n return innerValue.value\n }\n})\n\nconst inputType = computed(() => {\n if (innerValue.value && !readonly.value) {\n return 'password'\n } else {\n return 'text'\n }\n})\n\nwatch(\n () => props.modelValue,\n (v) => {\n if (!v) {\n innerValue.value = ' '\n } else {\n innerValue.value = ` ${changeLetter(v)}`\n }\n }\n)\n\nwatch(\n () => innerValue.value,\n (v) => {\n if (!v) {\n innerValue.value = ' '\n }\n const str =\n innerValue.value[0] === ' ' ? innerValue.value.slice(1) : innerValue.value\n const final = changeLetter(str ?? '')\n emit('update:modelValue', final)\n emit('input', final)\n }\n)\n\nfunction changeLetter(v: string) {\n if (props.letter === 'upper') {\n return v.toLocaleUpperCase()\n } else if (props.letter === 'lower') {\n return v.toLocaleLowerCase()\n } else {\n return v\n }\n}\n\nfunction inputFocus() {\n readonly.value = false\n}\n\nfunction inputBlur() {\n readonly.value = true\n}\n\nfunction inputChange() {\n emit('change', props.modelValue)\n}\n\nfunction focus() {\n readonly.value = false\n setTimeout(() => {\n inputRef.value.focus()\n })\n}\n\nfunction blur() {\n readonly.value = true\n inputRef.value.blur()\n}\n\nfunction clear() {\n inputRef.value.clear()\n}\n\ndefineExpose({\n focus,\n blur,\n clear,\n})\n</script>\n"],"names":["_defineComponent","scanEmits","watch","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createVNode","_unref","ElInput","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,EAAS,IAAA,EAAA,UAAA;AACT,CAAA,CAAA,C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