ll-plus 2.7.24 → 2.7.26
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/es/components/input/index.d.ts +2 -0
- package/es/components/input/src/input.vue.d.ts +2 -0
- package/es/packages/components/input/src/input.vue2.mjs +13 -4
- package/es/packages/components/input/src/input.vue2.mjs.map +1 -1
- package/index.full.js +13 -4
- package/index.full.min.js +17 -17
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +24 -24
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +13 -4
- package/lib/components/input/index.d.ts +2 -0
- package/lib/components/input/src/input.vue.d.ts +2 -0
- package/lib/packages/components/input/src/input.vue2.js +13 -4
- package/lib/packages/components/input/src/input.vue2.js.map +1 -1
- package/package.json +1 -1
- package/types/packages/components/input/index.d.ts +2 -0
- package/types/packages/components/input/src/input.vue.d.ts +2 -0
|
@@ -1338,6 +1338,8 @@ export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("
|
|
|
1338
1338
|
readonly onClear?: ((...args: any[]) => any) | undefined;
|
|
1339
1339
|
} & {}>;
|
|
1340
1340
|
}>;
|
|
1341
|
+
focus: () => void;
|
|
1342
|
+
select: () => void;
|
|
1341
1343
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "change" | "update:value")[], "clear" | "change" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1342
1344
|
readonly defaultValue: {
|
|
1343
1345
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
@@ -1337,6 +1337,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1337
1337
|
readonly onClear?: ((...args: any[]) => any) | undefined;
|
|
1338
1338
|
} & {}>;
|
|
1339
1339
|
}>;
|
|
1340
|
+
focus: () => void;
|
|
1341
|
+
select: () => void;
|
|
1340
1342
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "change" | "update:value")[], "clear" | "change" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1341
1343
|
readonly defaultValue: {
|
|
1342
1344
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
@@ -35,9 +35,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
emit("change", e);
|
|
36
36
|
};
|
|
37
37
|
watch(
|
|
38
|
-
() => props.value,
|
|
39
|
-
(newValue) => {
|
|
40
|
-
innerValue.value = newValue;
|
|
38
|
+
() => [props.value, props.defaultValue],
|
|
39
|
+
([newValue, newDefaultValue]) => {
|
|
40
|
+
innerValue.value = newValue || newDefaultValue;
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
immediate: true
|
|
@@ -57,7 +57,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
const attrs = { ...omit(useAttrs(), ["class", "style"]), props };
|
|
58
58
|
return attrs;
|
|
59
59
|
});
|
|
60
|
-
|
|
60
|
+
const focus = () => {
|
|
61
|
+
inputRef.value.focus();
|
|
62
|
+
};
|
|
63
|
+
const select = () => {
|
|
64
|
+
inputRef.value.select();
|
|
65
|
+
};
|
|
66
|
+
__expose({
|
|
67
|
+
focus,
|
|
68
|
+
select
|
|
69
|
+
});
|
|
61
70
|
return (_ctx, _cache) => {
|
|
62
71
|
const _component_ll_icon = resolveComponent("ll-icon");
|
|
63
72
|
return openBlock(), createElementBlock(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.vue2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\" @mouseover=\"handleMouseOver\" @mouseout=\"handleMouseOut\">\n <component\n :is=\"componentType\"\n ref=\"inputRef\"\n v-bind=\"computedAttrs\"\n v-model:value=\"innerValue\"\n :allow-clear=\"props.allowClear\"\n :disabled=\"props.disabled\"\n :class=\"{\n 'show-clear-icon':\n props.allowClear && hasValue && isMouseOver && !props.disabled\n }\"\n @change=\"onChange\"\n >\n <template v-for=\"item in Object.keys($slots)\" :key=\"item\" #[item]=\"data\">\n <slot :name=\"item\" v-bind=\"data || {}\"></slot>\n </template>\n <template v-if=\"prefixIcon\" #prefix>\n <ll-icon :icon-name=\"prefixIcon\" class=\"prefix-icon\" />\n </template>\n <template v-if=\"suffixIcon\" #suffix>\n <ll-icon :icon-name=\"suffixIcon\" class=\"suffix-icon\" />\n </template>\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch, nextTick } from 'vue'\nimport { Input } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { InputValue, inputProps } from './input'\nimport { omit } from 'lodash'\n\ndefineOptions({ name: 'LlInput' })\n\nconst bem = createNamespace('input')\n\nconst props = defineProps(inputProps)\n\nconst emit = defineEmits(['update:value', 'change', 'clear'])\n\nconst innerValue = ref<InputValue>('')\n\nconst inputRef = ref()\n\nconst isMouseOver = ref(false)\n\n// 判断当前输入框是否有值\nconst hasValue = computed(() => innerValue.value || props.defaultValue)\n\n// 鼠标移入事件\nconst handleMouseOver = () => {\n isMouseOver.value = true\n}\n\n// 鼠标移出事件\nconst handleMouseOut = () => {\n isMouseOver.value = false\n}\n\n// 输入框发送变化的回调\nconst onChange = async (e: any) => {\n const { value } = e.target\n innerValue.value = value\n await nextTick()\n if (!value && e.type === 'click') {\n emit('clear', value)\n }\n emit('change', e)\n}\n\n// 监听props.value的变化\nwatch(\n () => props.value,\n newValue => {\n innerValue.value = newValue\n },\n {\n immediate: true\n }\n)\n\n// 监听innerValue的变化,触发update:value事件\nwatch(\n innerValue,\n newValue => {\n emit('update:value', newValue)\n },\n {\n immediate: true\n }\n)\n\n// 根据showPassword属性决定组件类型\nconst componentType = props.showPassword ? Input.Password : Input\n\n// 计算属性,合并attrs和props\nconst computedAttrs = computed(() => {\n const attrs = { ...omit(useAttrs(), ['class', 'style']), props }\n return attrs\n})\n\n// 公开focus方法\ndefineExpose({
|
|
1
|
+
{"version":3,"file":"input.vue2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\" @mouseover=\"handleMouseOver\" @mouseout=\"handleMouseOut\">\n <component\n :is=\"componentType\"\n ref=\"inputRef\"\n v-bind=\"computedAttrs\"\n v-model:value=\"innerValue\"\n :allow-clear=\"props.allowClear\"\n :disabled=\"props.disabled\"\n :class=\"{\n 'show-clear-icon':\n props.allowClear && hasValue && isMouseOver && !props.disabled\n }\"\n @change=\"onChange\"\n >\n <template v-for=\"item in Object.keys($slots)\" :key=\"item\" #[item]=\"data\">\n <slot :name=\"item\" v-bind=\"data || {}\"></slot>\n </template>\n <template v-if=\"prefixIcon\" #prefix>\n <ll-icon :icon-name=\"prefixIcon\" class=\"prefix-icon\" />\n </template>\n <template v-if=\"suffixIcon\" #suffix>\n <ll-icon :icon-name=\"suffixIcon\" class=\"suffix-icon\" />\n </template>\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch, nextTick } from 'vue'\nimport { Input } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { InputValue, inputProps } from './input'\nimport { omit } from 'lodash'\n\ndefineOptions({ name: 'LlInput' })\n\nconst bem = createNamespace('input')\n\nconst props = defineProps(inputProps)\n\nconst emit = defineEmits(['update:value', 'change', 'clear'])\n\nconst innerValue = ref<InputValue>('')\n\nconst inputRef = ref()\n\nconst isMouseOver = ref(false)\n\n// 判断当前输入框是否有值\nconst hasValue = computed(() => innerValue.value || props.defaultValue)\n\n// 鼠标移入事件\nconst handleMouseOver = () => {\n isMouseOver.value = true\n}\n\n// 鼠标移出事件\nconst handleMouseOut = () => {\n isMouseOver.value = false\n}\n\n// 输入框发送变化的回调\nconst onChange = async (e: any) => {\n const { value } = e.target\n innerValue.value = value\n await nextTick()\n if (!value && e.type === 'click') {\n emit('clear', value)\n }\n emit('change', e)\n}\n\n// 监听props.value/props.defaultValue的变化\nwatch(\n () => [props.value, props.defaultValue],\n ([newValue, newDefaultValue]) => {\n innerValue.value = newValue || newDefaultValue\n },\n {\n immediate: true\n }\n)\n\n// 监听innerValue的变化,触发update:value事件\nwatch(\n innerValue,\n newValue => {\n emit('update:value', newValue)\n },\n {\n immediate: true\n }\n)\n\n// 根据showPassword属性决定组件类型\nconst componentType = props.showPassword ? Input.Password : Input\n\n// 计算属性,合并attrs和props\nconst computedAttrs = computed(() => {\n const attrs = { ...omit(useAttrs(), ['class', 'style']), props }\n return attrs\n})\n\nconst focus = () => {\n inputRef.value.focus()\n}\nconst select = () => {\n inputRef.value.select()\n}\n\n// 公开focus方法\ndefineExpose({\n focus,\n select\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqCA,IAAM,MAAA,GAAA,GAAM,gBAAgB,OAAO,CAAA,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAM,MAAA,UAAA,GAAa,IAAgB,EAAE,CAAA,CAAA;AAErC,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,WAAA,GAAc,IAAI,KAAK,CAAA,CAAA;AAG7B,IAAA,MAAM,WAAW,QAAS,CAAA,MAAM,UAAW,CAAA,KAAA,IAAS,MAAM,YAAY,CAAA,CAAA;AAGtE,IAAA,MAAM,kBAAkB,MAAM;AAC5B,MAAA,WAAA,CAAY,KAAQ,GAAA,IAAA,CAAA;AAAA,KACtB,CAAA;AAGA,IAAA,MAAM,iBAAiB,MAAM;AAC3B,MAAA,WAAA,CAAY,KAA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IAAA,MAAM,QAAQ,MAAM;AAClB,MAAA,QAAA,CAAS,MAAM,KAAM,EAAA,CAAA;AAAA,KACvB,CAAA;AACA,IAAA,MAAM,SAAS,MAAM;AACnB,MAAA,QAAA,CAAS,MAAM,MAAO,EAAA,CAAA;AAAA,KACxB,CAAA;AAGA,IAAa,QAAA,CAAA;AAAA,MACX,KAAA;AAAA,MACA,MAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.full.js
CHANGED
|
@@ -70046,9 +70046,9 @@
|
|
|
70046
70046
|
emit("change", e);
|
|
70047
70047
|
};
|
|
70048
70048
|
require$$0.watch(
|
|
70049
|
-
() => props.value,
|
|
70050
|
-
(newValue) => {
|
|
70051
|
-
innerValue.value = newValue;
|
|
70049
|
+
() => [props.value, props.defaultValue],
|
|
70050
|
+
([newValue, newDefaultValue]) => {
|
|
70051
|
+
innerValue.value = newValue || newDefaultValue;
|
|
70052
70052
|
},
|
|
70053
70053
|
{
|
|
70054
70054
|
immediate: true
|
|
@@ -70068,7 +70068,16 @@
|
|
|
70068
70068
|
const attrs = { ...lodashExports.omit(require$$0.useAttrs(), ["class", "style"]), props };
|
|
70069
70069
|
return attrs;
|
|
70070
70070
|
});
|
|
70071
|
-
|
|
70071
|
+
const focus = () => {
|
|
70072
|
+
inputRef.value.focus();
|
|
70073
|
+
};
|
|
70074
|
+
const select = () => {
|
|
70075
|
+
inputRef.value.select();
|
|
70076
|
+
};
|
|
70077
|
+
__expose({
|
|
70078
|
+
focus,
|
|
70079
|
+
select
|
|
70080
|
+
});
|
|
70072
70081
|
return (_ctx, _cache) => {
|
|
70073
70082
|
const _component_ll_icon = require$$0.resolveComponent("ll-icon");
|
|
70074
70083
|
return require$$0.openBlock(), require$$0.createElementBlock(
|