hzzt-plus 1.0.4 → 1.0.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.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +505 -193
- package/dist/index.full.min.js +12 -12
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +15 -15
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +500 -194
- 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 +5 -1
- package/es/component.mjs.map +1 -1
- package/es/components/click-input/index.d.ts +638 -0
- package/es/components/click-input/index.mjs +9 -0
- package/es/components/click-input/index.mjs.map +1 -0
- package/es/components/click-input/src/click-input.d.ts +22 -0
- package/es/components/click-input/src/click-input.mjs +26 -0
- package/es/components/click-input/src/click-input.mjs.map +1 -0
- package/es/components/click-input/src/click-input.vue.d.ts +638 -0
- package/es/components/click-input/src/click-input2.mjs +89 -0
- package/es/components/click-input/src/click-input2.mjs.map +1 -0
- package/es/components/click-input/style/css.d.ts +2 -0
- package/es/components/click-input/style/css.mjs +3 -0
- package/es/components/click-input/style/css.mjs.map +1 -0
- package/es/components/click-input/style/index.d.ts +2 -0
- package/es/components/click-input/style/index.mjs +3 -0
- package/es/components/click-input/style/index.mjs.map +1 -0
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +0 -67
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +67 -0
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +5 -1
- package/es/components/index.mjs.map +1 -1
- package/es/components/scan/index.mjs +2 -2
- package/es/components/scan/src/scan.mjs +23 -144
- package/es/components/scan/src/scan.mjs.map +1 -1
- package/es/components/scan/src/scan2.mjs +144 -23
- package/es/components/scan/src/scan2.mjs.map +1 -1
- package/es/components/select/index.d.ts +5 -0
- package/es/components/select/index.mjs +9 -0
- package/es/components/select/index.mjs.map +1 -0
- package/es/components/select/src/select.d.ts +38 -0
- package/es/components/select/src/select.mjs +43 -0
- package/es/components/select/src/select.mjs.map +1 -0
- package/es/components/select/src/select.vue.d.ts +13241 -0
- package/es/components/select/src/select2.mjs +183 -0
- package/es/components/select/src/select2.mjs.map +1 -0
- package/es/components/select/style/css.d.ts +2 -0
- package/es/components/select/style/css.mjs +3 -0
- package/es/components/select/style/css.mjs.map +1 -0
- package/es/components/select/style/index.d.ts +2 -0
- package/es/components/select/style/index.mjs +3 -0
- package/es/components/select/style/index.mjs.map +1 -0
- package/es/components/select-input/index.d.ts +6 -6
- package/es/components/select-input/src/select-input.d.ts +1 -7
- package/es/components/select-input/src/select-input.mjs.map +1 -1
- package/es/components/select-input/src/select-input.vue.d.ts +1 -1
- package/es/components/select-input/src/select-input2.mjs.map +1 -1
- package/es/index.mjs +5 -1
- 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 +2 -0
- package/lib/component.js +5 -1
- package/lib/component.js.map +1 -1
- package/lib/components/click-input/index.d.ts +638 -0
- package/lib/components/click-input/index.js +16 -0
- package/lib/components/click-input/index.js.map +1 -0
- package/lib/components/click-input/src/click-input.d.ts +22 -0
- package/lib/components/click-input/src/click-input.js +31 -0
- package/lib/components/click-input/src/click-input.js.map +1 -0
- package/lib/components/click-input/src/click-input.vue.d.ts +638 -0
- package/lib/components/click-input/src/click-input2.js +93 -0
- package/lib/components/click-input/src/click-input2.js.map +1 -0
- package/lib/components/click-input/style/css.d.ts +2 -0
- package/lib/components/click-input/style/css.js +6 -0
- package/lib/components/click-input/style/css.js.map +1 -0
- package/lib/components/click-input/style/index.d.ts +2 -0
- package/lib/components/click-input/style/index.js +6 -0
- package/lib/components/click-input/style/index.js.map +1 -0
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +0 -70
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +70 -0
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +11 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/scan/index.js +2 -2
- package/lib/components/scan/src/scan.js +24 -144
- package/lib/components/scan/src/scan.js.map +1 -1
- package/lib/components/scan/src/scan2.js +144 -24
- package/lib/components/scan/src/scan2.js.map +1 -1
- package/lib/components/select/index.d.ts +5 -0
- package/lib/components/select/index.js +16 -0
- package/lib/components/select/index.js.map +1 -0
- package/lib/components/select/src/select.d.ts +38 -0
- package/lib/components/select/src/select.js +48 -0
- package/lib/components/select/src/select.js.map +1 -0
- package/lib/components/select/src/select.vue.d.ts +13241 -0
- package/lib/components/select/src/select2.js +187 -0
- package/lib/components/select/src/select2.js.map +1 -0
- package/lib/components/select/style/css.d.ts +2 -0
- package/lib/components/select/style/css.js +6 -0
- package/lib/components/select/style/css.js.map +1 -0
- package/lib/components/select/style/index.d.ts +2 -0
- package/lib/components/select/style/index.js +6 -0
- package/lib/components/select/style/index.js.map +1 -0
- package/lib/components/select-input/index.d.ts +6 -6
- package/lib/components/select-input/src/select-input.d.ts +1 -7
- package/lib/components/select-input/src/select-input.js.map +1 -1
- package/lib/components/select-input/src/select-input.vue.d.ts +1 -1
- package/lib/components/select-input/src/select-input2.js.map +1 -1
- package/lib/index.js +41 -31
- 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 -1
- package/theme/hzzt-click-input.css +1 -0
- package/theme/hzzt-select.css +1 -0
- package/theme/index.css +1 -1
- package/theme/src/click-input.scss +19 -0
- package/theme/src/index.scss +2 -0
- package/theme/src/mixins/mixins.scss +3 -0
- package/theme/src/select.scss +10 -0
- package/web-types.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, createBlock, mergeProps, withKeys, toDisplayString } from 'vue';
|
|
2
|
+
import { clickInputProps, clickInputEmits } from './click-input.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { useFormSize, useFormDisabled, ElInput } from 'element-plus';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
+
import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
|
|
8
|
+
|
|
9
|
+
const __default__ = defineComponent({
|
|
10
|
+
name: "HzztClickInput"
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: clickInputProps,
|
|
15
|
+
emits: clickInputEmits,
|
|
16
|
+
setup(__props, { emit }) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const _inputVal = ref(props.modelValue || "");
|
|
19
|
+
const inputVal = ref(props.modelValue || "");
|
|
20
|
+
const inputRef = ref();
|
|
21
|
+
const editable = ref(false);
|
|
22
|
+
const nsInput = useNamespace("click-input");
|
|
23
|
+
const formSize = useFormSize();
|
|
24
|
+
const formDisabled = useFormDisabled();
|
|
25
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
26
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
27
|
+
const trueReadonly = computed(() => trueDisabled.value || props.readonly || !editable.value);
|
|
28
|
+
const containerCls = computed(() => [
|
|
29
|
+
nsInput.b(),
|
|
30
|
+
nsInput.m(trueSize.value),
|
|
31
|
+
"flex width-100% align-items-center"
|
|
32
|
+
]);
|
|
33
|
+
const spanClass = computed(() => [
|
|
34
|
+
nsInput.em("span"),
|
|
35
|
+
"flex width-100% align-items-center"
|
|
36
|
+
]);
|
|
37
|
+
watch(() => props.modelValue, (v) => {
|
|
38
|
+
inputVal.value = v || "";
|
|
39
|
+
_inputVal.value = v || "";
|
|
40
|
+
});
|
|
41
|
+
function input(val) {
|
|
42
|
+
emit("update:modelValue", val);
|
|
43
|
+
emit("input", val);
|
|
44
|
+
}
|
|
45
|
+
function change() {
|
|
46
|
+
editable.value = false;
|
|
47
|
+
if (_inputVal.value === inputVal.value) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
input(inputVal.value);
|
|
51
|
+
emit("change", inputVal.value);
|
|
52
|
+
}
|
|
53
|
+
function edit() {
|
|
54
|
+
if (trueDisabled.value || props.readonly) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
editable.value = true;
|
|
58
|
+
nextTick(() => {
|
|
59
|
+
inputRef.value.focus();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return openBlock(), createElementBlock("div", {
|
|
64
|
+
class: normalizeClass(unref(containerCls))
|
|
65
|
+
}, [
|
|
66
|
+
!unref(trueReadonly) ? (openBlock(), createBlock(unref(ElInput), mergeProps({
|
|
67
|
+
key: 0,
|
|
68
|
+
ref_key: "inputRef",
|
|
69
|
+
ref: inputRef,
|
|
70
|
+
modelValue: inputVal.value,
|
|
71
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event)
|
|
72
|
+
}, _ctx.inputProps, {
|
|
73
|
+
clearable: "",
|
|
74
|
+
size: unref(trueSize),
|
|
75
|
+
onKeyup: withKeys(change, ["enter"]),
|
|
76
|
+
onBlur: change
|
|
77
|
+
}), null, 16, ["modelValue", "size", "onKeyup"])) : (openBlock(), createElementBlock("div", {
|
|
78
|
+
key: 1,
|
|
79
|
+
class: normalizeClass(["width-100%", unref(spanClass)]),
|
|
80
|
+
onClick: edit
|
|
81
|
+
}, toDisplayString(inputVal.value || " "), 3))
|
|
82
|
+
], 2);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
var ClickInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "click-input.vue"]]);
|
|
87
|
+
|
|
88
|
+
export { ClickInput as default };
|
|
89
|
+
//# sourceMappingURL=click-input2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-input2.mjs","sources":["../../../../../../packages/components/click-input/src/click-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <el-input\n v-if=\"!trueReadonly\"\n ref=\"inputRef\"\n v-model=\"inputVal\"\n v-bind=\"inputProps\"\n clearable\n :size=\"trueSize\"\n @keyup.enter=\"change\"\n @blur=\"change\"\n />\n <div v-else class=\"width-100%\" :class=\"spanClass\" @click=\"edit\">\n {{ inputVal || ' ' }}\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch, nextTick} from 'vue'\n import {clickInputEmits, clickInputProps} from './click-input'\n import {useGlobalSize, useNamespace} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import {ElInput} from 'element-plus'\n\n defineOptions({\n name: 'HzztClickInput',\n })\n\n const props = defineProps(clickInputProps)\n const emit = defineEmits(clickInputEmits)\n\n const _inputVal = ref(props.modelValue || '');\n const inputVal = ref(props.modelValue || '');\n const inputRef = ref();\n const editable = ref(false);\n\n const nsInput = useNamespace('click-input')\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 trueReadonly = computed(() => trueDisabled.value || props.readonly || !editable.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n 'flex width-100% align-items-center',\n ])\n\n const spanClass = computed(() => [\n nsInput.em('span'),\n 'flex width-100% align-items-center',\n ])\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = 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() {\n editable.value = false;\n if (_inputVal.value === inputVal.value) {\n return;\n }\n input(inputVal.value);\n emit('change', inputVal.value);\n }\n\n function edit() {\n if (trueDisabled.value || props.readonly) {\n return;\n }\n editable.value = true;\n nextTick(() => {\n inputRef.value.focus();\n });\n }\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":";;;;;;;;mCAyBgB,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAA,MAAM,SAAY,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC5C,IAAA,MAAM,QAAW,GAAA,GAAA,CAAI,KAAM,CAAA,UAAA,IAAc,EAAE,CAAA,CAAA;AAC3C,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AACrB,IAAM,MAAA,QAAA,GAAW,IAAI,KAAK,CAAA,CAAA;AAE1B,IAAM,MAAA,OAAA,GAAU,aAAa,aAAa,CAAA,CAAA;AAC1C,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,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,IAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAEA,IAAA,MAAM,eAAe,QAAS,CAAA,MAAM;AAEpC,MAAM,OAAA,CAAA,CAAA,EAAA;AAEN,MAAM,OAAA,CAAA,CAAA,CAAA,QAAA,CAAe;AAAe,MAClC,oCAAU;AAAA,KACV,CAAA,CAAA;AAAwB,IACxB,MAAA,SAAA,GAAA,QAAA,CAAA,MAAA;AAAA,MACD,OAAA,CAAA,EAAA,CAAA,MAAA,CAAA;AAED,MAAM,oCAA2B;AAAA,KAC/B,CAAA,CAAA;AAAiB,IACjB,KAAA,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,CAAA,CAAA,KAAA;AAAA,MACD,QAAA,CAAA,KAAA,GAAA,CAAA,IAAA,EAAA,CAAA;AAED,MAAA,SAAY,CAAA,KAAA,GAAkB,CAAA,IAAA,EAAA,CAAA;AAC5B,KAAA,CAAA,CAAA;AACA,IAAA,SAAA,WAAkB;AAAK,MACxB,IAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA;AAED,MAAA,IAAA,CAAA,SAA4B,GAAA,CAAA,CAAA;AAC1B,KAAA;AACA,IAAA,kBAAiB;AAAA,MACnB,QAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AAEA,MAAA,IAAA,SAAkB,CAAA,KAAA,KAAA,QAAA,CAAA,KAAA,EAAA;AAChB,QAAA,OAAS;AACT,OAAI;AACF,MAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AAAA,MACF,IAAA,CAAA,QAAA,EAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAK,SAAA,IAAA,GAAA;AAAwB,MAC/B,IAAA,YAAA,CAAA,KAAA,IAAA,KAAA,CAAA,QAAA,EAAA;AAEA,QAAA,OAAgB;AACd,OAAI;AACF,MAAA,QAAA,CAAA,KAAA,GAAA,IAAA,CAAA;AAAA,MACF,QAAA,CAAA,MAAA;AACA,QAAA,QAAiB,CAAA,KAAA,CAAA,KAAA,EAAA,CAAA;AACjB,OAAA,CAAA,CAAA;AACE,KAAA;AAAqB,IAAA,OACtB,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACH,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Collapse from './src/
|
|
3
|
-
import './src/
|
|
2
|
+
import Collapse from './src/collapse2.mjs';
|
|
3
|
+
import './src/collapse.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztCollapse = withInstall(Collapse);
|
|
@@ -1,69 +1,2 @@
|
|
|
1
|
-
import { createElementVNode, defineComponent, ref, watch, openBlock, createElementBlock, toDisplayString, unref, createCommentVNode, renderSlot } from 'vue';
|
|
2
|
-
import '../../../hooks/index.mjs';
|
|
3
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
4
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
5
1
|
|
|
6
|
-
const _hoisted_1 = { class: "hzzt-collapse" };
|
|
7
|
-
const _hoisted_2 = { class: "flex align-items-center" };
|
|
8
|
-
const _hoisted_3 = { class: "hzzt-collapse-title-wrapper" };
|
|
9
|
-
const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
|
|
10
|
-
const _hoisted_5 = { class: "hzzt-collapse-title" };
|
|
11
|
-
const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
|
|
12
|
-
const _hoisted_7 = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "hzzt-collapse-text"
|
|
15
|
-
};
|
|
16
|
-
const __default__ = defineComponent({
|
|
17
|
-
name: "HzztCollapse"
|
|
18
|
-
});
|
|
19
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
-
...__default__,
|
|
21
|
-
props: {
|
|
22
|
-
defaultActive: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
title: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: ""
|
|
29
|
-
},
|
|
30
|
-
expand: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: true
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
setup(__props) {
|
|
36
|
-
const props = __props;
|
|
37
|
-
const { t } = useLocale();
|
|
38
|
-
const active = ref(props.defaultActive);
|
|
39
|
-
watch(() => props.defaultActive, (val) => {
|
|
40
|
-
active.value = val;
|
|
41
|
-
});
|
|
42
|
-
function toggle() {
|
|
43
|
-
active.value = !active.value;
|
|
44
|
-
}
|
|
45
|
-
return (_ctx, _cache) => {
|
|
46
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
47
|
-
createElementVNode("div", {
|
|
48
|
-
class: "hzzt-collapse-header",
|
|
49
|
-
onClick: toggle
|
|
50
|
-
}, [
|
|
51
|
-
createElementVNode("div", _hoisted_2, [
|
|
52
|
-
createElementVNode("div", _hoisted_3, [
|
|
53
|
-
_hoisted_4,
|
|
54
|
-
createElementVNode("div", _hoisted_5, toDisplayString(__props.title), 1)
|
|
55
|
-
]),
|
|
56
|
-
_hoisted_6
|
|
57
|
-
]),
|
|
58
|
-
__props.expand ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(active.value ? unref(t)("hzzt.collapse.retract") : unref(t)("hzzt.collapse.expand")), 1)) : createCommentVNode("v-if", true)
|
|
59
|
-
]),
|
|
60
|
-
renderSlot(_ctx.$slots, "active", { active: active.value }),
|
|
61
|
-
renderSlot(_ctx.$slots, "default")
|
|
62
|
-
]);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse.vue"]]);
|
|
67
|
-
|
|
68
|
-
export { Collapse as default };
|
|
69
2
|
//# sourceMappingURL=collapse.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"collapse.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,69 @@
|
|
|
1
|
+
import { createElementVNode, defineComponent, ref, watch, openBlock, createElementBlock, toDisplayString, unref, createCommentVNode, renderSlot } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
4
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
1
5
|
|
|
6
|
+
const _hoisted_1 = { class: "hzzt-collapse" };
|
|
7
|
+
const _hoisted_2 = { class: "flex align-items-center" };
|
|
8
|
+
const _hoisted_3 = { class: "hzzt-collapse-title-wrapper" };
|
|
9
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
|
|
10
|
+
const _hoisted_5 = { class: "hzzt-collapse-title" };
|
|
11
|
+
const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
|
|
12
|
+
const _hoisted_7 = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "hzzt-collapse-text"
|
|
15
|
+
};
|
|
16
|
+
const __default__ = defineComponent({
|
|
17
|
+
name: "HzztCollapse"
|
|
18
|
+
});
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
+
...__default__,
|
|
21
|
+
props: {
|
|
22
|
+
defaultActive: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
title: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
expand: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
setup(__props) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const { t } = useLocale();
|
|
38
|
+
const active = ref(props.defaultActive);
|
|
39
|
+
watch(() => props.defaultActive, (val) => {
|
|
40
|
+
active.value = val;
|
|
41
|
+
});
|
|
42
|
+
function toggle() {
|
|
43
|
+
active.value = !active.value;
|
|
44
|
+
}
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
47
|
+
createElementVNode("div", {
|
|
48
|
+
class: "hzzt-collapse-header",
|
|
49
|
+
onClick: toggle
|
|
50
|
+
}, [
|
|
51
|
+
createElementVNode("div", _hoisted_2, [
|
|
52
|
+
createElementVNode("div", _hoisted_3, [
|
|
53
|
+
_hoisted_4,
|
|
54
|
+
createElementVNode("div", _hoisted_5, toDisplayString(__props.title), 1)
|
|
55
|
+
]),
|
|
56
|
+
_hoisted_6
|
|
57
|
+
]),
|
|
58
|
+
__props.expand ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(active.value ? unref(t)("hzzt.collapse.retract") : unref(t)("hzzt.collapse.expand")), 1)) : createCommentVNode("v-if", true)
|
|
59
|
+
]),
|
|
60
|
+
renderSlot(_ctx.$slots, "active", { active: active.value }),
|
|
61
|
+
renderSlot(_ctx.$slots, "default")
|
|
62
|
+
]);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse.vue"]]);
|
|
67
|
+
|
|
68
|
+
export { Collapse as default };
|
|
2
69
|
//# sourceMappingURL=collapse2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"collapse2.mjs","sources":["../../../../../../packages/components/collapse/src/collapse.vue"],"sourcesContent":["<template>\n <div class=\"hzzt-collapse\">\n <div class=\"hzzt-collapse-header\" @click=\"toggle\">\n <div class=\"flex align-items-center\">\n <div class=\"hzzt-collapse-title-wrapper\">\n <div class=\"hzzt-collapse-title-block\" />\n <div class=\"hzzt-collapse-title\">{{ title }}</div>\n </div>\n <div class=\"hzzt-collapse-line\" />\n </div>\n <span v-if=\"expand\" class=\"hzzt-collapse-text\">{{\n active ? t('hzzt.collapse.retract') : t('hzzt.collapse.expand')\n }}</span>\n </div>\n <slot name=\"active\" :active=\"active\" />\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue'\nimport { useLocale } from '@hzzt-plus/hooks'\n\ndefineOptions({\n name: 'HzztCollapse',\n})\nconst { t } = useLocale()\nconst props = defineProps({\n defaultActive: {\n type: Boolean,\n default: false,\n },\n title: {\n type: String,\n default: '',\n },\n expand: {\n type: Boolean,\n default: true,\n },\n})\n\nconst active = ref(props.defaultActive)\n\nwatch(\n () => props.defaultActive,\n (val: boolean) => {\n active.value = val\n }\n)\n\nfunction toggle() {\n active.value = !active.value\n}\n</script>\n"],"names":["_createElementVNode","_toDisplayString","_openBlock","_createElementBlock","_unref","_createCommentVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA,KAAA;AACA,IAAA,KAAS,EAAiB;;;AAEZ,KACN;AACR,IAAA,MAAA,EAAA;;;;;;;;;;;;;;;;;;;AACA,UAAM,OAAI,EAAc,MAAA;AAgBxB,SAAM,EAAA;AAEN,UAAAA,kBAAA,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,YACQA,kBAAM,CAAA,KAAA,EAAA,UAAA,EAAA;AAAA,cACM,UAAA;AAChB,cAAAA,kBAAe,CAAA,KAAA,EAAA,UAAA,EAAAC,eAAA,CAAA,OAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA;AAAA,aACjB,CAAA;AAAA,YACF,UAAA;AAEA,WAAA,CAAA;AACE,UAAO,OAAA,CAAA,MAAgB,IAAAC,SAAA,EAAA,EAAAC,kBAAA,CAAA,MAAA,EAAA,UAAA,EAAAF,eAAA,CAAA,MAAA,CAAA,KAAA,GAAAG,KAAA,CAAA,CAAA,CAAA,CAAA,uBAAA,CAAA,GAAAA,KAAA,CAAA,CAAA,CAAA,CAAA,sBAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAAC,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,SACzB,CAAA;;;;;;;;;;;"}
|
package/es/components/index.d.ts
CHANGED
package/es/components/index.mjs
CHANGED
|
@@ -15,13 +15,17 @@ export { HzztSelectInput } from './select-input/index.mjs';
|
|
|
15
15
|
export { HzztSelectTextarea } from './select-textarea/index.mjs';
|
|
16
16
|
export { HzztInputRange } from './input-range/index.mjs';
|
|
17
17
|
export { HzztCascader } from './cascader/index.mjs';
|
|
18
|
+
export { HzztSelect } from './select/index.mjs';
|
|
19
|
+
export { HzztClickInput } from './click-input/index.mjs';
|
|
18
20
|
export { titleProps } from './title/src/title.mjs';
|
|
19
21
|
export { configProviderProps } from './config-provider/src/config-provider-props.mjs';
|
|
20
22
|
export { configProviderContextKey } from './config-provider/src/constants.mjs';
|
|
21
23
|
export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
|
|
22
|
-
export { scanEmits, scanProps } from './scan/src/
|
|
24
|
+
export { scanEmits, scanProps } from './scan/src/scan.mjs';
|
|
23
25
|
export { selectInputEmits, selectInputProps } from './select-input/src/select-input.mjs';
|
|
24
26
|
export { selectTextareaEmits, selectTextareaProps } from './select-textarea/src/select-textarea.mjs';
|
|
25
27
|
export { inputRangeEmits, inputRangeProps } from './input-range/src/input-range.mjs';
|
|
26
28
|
export { cascaderEmits, cascaderProps } from './cascader/src/cascader.mjs';
|
|
29
|
+
export { selectEmits, selectProps } from './select/src/select.mjs';
|
|
30
|
+
export { clickInputEmits, clickInputProps } from './click-input/src/click-input.mjs';
|
|
27
31
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Scan from './src/
|
|
3
|
-
export { scanEmits, scanProps } from './src/
|
|
2
|
+
import Scan from './src/scan2.mjs';
|
|
3
|
+
export { scanEmits, scanProps } from './src/scan.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztScan = withInstall(Scan);
|
|
@@ -1,149 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import '../../../constants/index.mjs';
|
|
3
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
4
|
+
import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
|
5
|
+
import { isString } from '@vue/shared';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const _hoisted_2 = {
|
|
19
|
-
class: "width-100%",
|
|
20
|
-
style: { "overflow": "hidden" }
|
|
21
|
-
};
|
|
22
|
-
const __default__ = defineComponent({
|
|
23
|
-
inheritAttrs: false,
|
|
24
|
-
name: "HzztScan"
|
|
25
|
-
});
|
|
26
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
|
-
...__default__,
|
|
28
|
-
props: scanProps,
|
|
29
|
-
emits: scanEmits,
|
|
30
|
-
setup(__props, { expose, emit }) {
|
|
31
|
-
const props = __props;
|
|
32
|
-
const readonly = ref(true);
|
|
33
|
-
const innerValue = ref(" ");
|
|
34
|
-
const inputRef = ref();
|
|
35
|
-
const showValue = computed(() => {
|
|
36
|
-
if (innerValue.value === " ") {
|
|
37
|
-
return ` ${props.placeholder}`;
|
|
38
|
-
} else {
|
|
39
|
-
return innerValue.value;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const inputType = computed(() => {
|
|
43
|
-
if (innerValue.value && !readonly.value) {
|
|
44
|
-
return "password";
|
|
45
|
-
} else {
|
|
46
|
-
return "text";
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
watch(() => props.modelValue, (v) => {
|
|
50
|
-
if (!v) {
|
|
51
|
-
innerValue.value = " ";
|
|
52
|
-
} else {
|
|
53
|
-
innerValue.value = ` ${changeLetter(v)}`;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
watch(() => innerValue.value, (v) => {
|
|
57
|
-
if (!v) {
|
|
58
|
-
innerValue.value = " ";
|
|
59
|
-
}
|
|
60
|
-
const str = innerValue.value[0] === " " ? innerValue.value.slice(1) : innerValue.value;
|
|
61
|
-
const final = changeLetter(str != null ? str : "");
|
|
62
|
-
emit("update:modelValue", final);
|
|
63
|
-
emit("input", final);
|
|
64
|
-
});
|
|
65
|
-
function changeLetter(v) {
|
|
66
|
-
if (props.letter === "upper") {
|
|
67
|
-
return v.toLocaleUpperCase();
|
|
68
|
-
} else if (props.letter === "lower") {
|
|
69
|
-
return v.toLocaleLowerCase();
|
|
70
|
-
} else {
|
|
71
|
-
return v;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function inputFocus() {
|
|
75
|
-
readonly.value = false;
|
|
76
|
-
}
|
|
77
|
-
function inputBlur() {
|
|
78
|
-
readonly.value = true;
|
|
79
|
-
}
|
|
80
|
-
function inputChange() {
|
|
81
|
-
emit("change", props.modelValue);
|
|
82
|
-
}
|
|
83
|
-
function focus() {
|
|
84
|
-
readonly.value = false;
|
|
85
|
-
setTimeout(() => {
|
|
86
|
-
inputRef.value.focus();
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
function blur() {
|
|
90
|
-
readonly.value = true;
|
|
91
|
-
inputRef.value.blur();
|
|
92
|
-
}
|
|
93
|
-
function clear() {
|
|
94
|
-
inputRef.value.clear();
|
|
95
|
-
}
|
|
96
|
-
expose({
|
|
97
|
-
focus,
|
|
98
|
-
blur,
|
|
99
|
-
clear
|
|
100
|
-
});
|
|
101
|
-
return (_ctx, _cache) => {
|
|
102
|
-
return openBlock(), createElementBlock("div", {
|
|
103
|
-
class: normalizeClass(["hzzt-scan", _ctx.$attrs.class]),
|
|
104
|
-
style: normalizeStyle([{ "position": "relative" }, _ctx.$attrs.style])
|
|
105
|
-
}, [
|
|
106
|
-
_hoisted_1,
|
|
107
|
-
createVNode(unref(ElInput), mergeProps({
|
|
108
|
-
ref_key: "inputRef",
|
|
109
|
-
ref: inputRef,
|
|
110
|
-
modelValue: innerValue.value,
|
|
111
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => innerValue.value = $event)
|
|
112
|
-
}, {
|
|
113
|
-
..._ctx.$attrs,
|
|
114
|
-
class: "",
|
|
115
|
-
style: "",
|
|
116
|
-
onChange: ""
|
|
117
|
-
}, {
|
|
118
|
-
readonly: readonly.value,
|
|
119
|
-
type: unref(inputType),
|
|
120
|
-
class: "hzzt-scan-input-original",
|
|
121
|
-
autocomplete: "off",
|
|
122
|
-
onFocus: inputFocus,
|
|
123
|
-
onBlur: inputBlur,
|
|
124
|
-
onChange: inputChange
|
|
125
|
-
}), createSlots({
|
|
126
|
-
_: 2
|
|
127
|
-
}, [
|
|
128
|
-
renderList(_ctx.$slots, (_, key, index) => {
|
|
129
|
-
return {
|
|
130
|
-
name: key,
|
|
131
|
-
fn: withCtx(() => [
|
|
132
|
-
renderSlot(_ctx.$slots, key)
|
|
133
|
-
])
|
|
134
|
-
};
|
|
135
|
-
})
|
|
136
|
-
]), 1040, ["modelValue", "readonly", "type"]),
|
|
137
|
-
createElementVNode("div", {
|
|
138
|
-
class: normalizeClass(["hzzt-scan-input-backup", { "placeholder-color": innerValue.value === " " }])
|
|
139
|
-
}, [
|
|
140
|
-
createElementVNode("div", _hoisted_2, toDisplayString(unref(showValue)), 1)
|
|
141
|
-
], 2)
|
|
142
|
-
], 6);
|
|
143
|
-
};
|
|
7
|
+
const scanProps = buildProps({
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
placeholder: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
letter: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "upper"
|
|
144
19
|
}
|
|
145
20
|
});
|
|
146
|
-
|
|
21
|
+
const scanEmits = {
|
|
22
|
+
[UPDATE_MODEL_EVENT]: (value) => isString(value),
|
|
23
|
+
[CHANGE_EVENT]: (value) => isString(value),
|
|
24
|
+
[INPUT_EVENT]: (value) => isString(value)
|
|
25
|
+
};
|
|
147
26
|
|
|
148
|
-
export {
|
|
27
|
+
export { scanEmits, scanProps };
|
|
149
28
|
//# sourceMappingURL=scan.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.mjs","sources":["../../../../../../packages/components/scan/src/scan.
|
|
1
|
+
{"version":3,"file":"scan.mjs","sources":["../../../../../../packages/components/scan/src/scan.ts"],"sourcesContent":["import { buildProps, isString } from '@hzzt-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@hzzt-plus/constants'\nimport type Scan from './scan.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const scanProps = buildProps({\n modelValue: {\n type: String,\n default: '',\n },\n placeholder: {\n type: String,\n default: '',\n },\n letter: {\n type: String,\n default: 'upper',\n },\n} as const)\nexport type ScanProps = ExtractPropTypes<typeof scanProps>\n\nexport const scanEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n [CHANGE_EVENT]: (value: string) => isString(value),\n [INPUT_EVENT]: (value: string) => isString(value),\n}\nexport type ScanEmits = typeof scanEmits\n\nexport type ScanInstance = InstanceType<typeof Scan>\n"],"names":[],"mappings":";;;;;;AAMY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,SAAS,GAAG;AACzB,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC5C,EAAE,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAC3C;;;;"}
|