ll-plus 2.6.24 → 2.6.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.
@@ -45,7 +45,7 @@ export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("
45
45
  } & {}>;
46
46
  innerValue: import("vue").Ref<string | number | undefined>;
47
47
  inputRef: import("vue").Ref<any>;
48
- allowClear: import("vue").Ref<import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
48
+ allowClear: import("vue").Ref<boolean>;
49
49
  handleMouseOver: () => void;
50
50
  handleMouseOut: (e: any) => void;
51
51
  componentType: ({
@@ -44,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
44
44
  } & {}>;
45
45
  innerValue: import("vue").Ref<string | number | undefined>;
46
46
  inputRef: import("vue").Ref<any>;
47
- allowClear: import("vue").Ref<import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
47
+ allowClear: import("vue").Ref<boolean>;
48
48
  handleMouseOver: () => void;
49
49
  handleMouseOut: (e: any) => void;
50
50
  componentType: ({
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, watchEffect, computed, useAttrs, onMounted, resolveComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, createVNode } from 'vue';
1
+ import { defineComponent, ref, watchEffect, computed, useAttrs, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, resolveDynamicComponent, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, createVNode } from 'vue';
2
2
  import { Input } from 'ant-design-vue';
3
3
  import '../../../utils/index.mjs';
4
4
  import { inputProps } from './input.mjs';
@@ -14,7 +14,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  const props = __props;
15
15
  const innerValue = ref("");
16
16
  const inputRef = ref();
17
- const allowClear = ref(props.allowClear);
17
+ const allowClear = ref(false);
18
18
  const handleMouseOver = () => {
19
19
  if (props.allowClear) {
20
20
  allowClear.value = true;
@@ -58,15 +58,17 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
58
58
  return openBlock(), createElementBlock(
59
59
  "div",
60
60
  {
61
+ class: normalizeClass(unref(bem).b()),
61
62
  onMouseover: handleMouseOver,
62
63
  onMouseout: handleMouseOut
63
64
  },
64
65
  [
65
66
  (openBlock(), createBlock(resolveDynamicComponent(unref(componentType)), mergeProps({
66
67
  ref_key: "inputRef",
67
- ref: inputRef,
68
- class: unref(bem).b()
69
- }, computedAttrs.value, { "allow-clear": allowClear.value }), createSlots({
68
+ ref: inputRef
69
+ }, computedAttrs.value, {
70
+ "allow-clear": props.allowClear ? allowClear.value : false
71
+ }), createSlots({
70
72
  _: 2
71
73
  /* DYNAMIC */
72
74
  }, [
@@ -98,10 +100,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
98
100
  ]),
99
101
  key: "1"
100
102
  } : void 0
101
- ]), 1040, ["class", "allow-clear"]))
103
+ ]), 1040, ["allow-clear"]))
102
104
  ],
103
- 32
104
- /* NEED_HYDRATION */
105
+ 34
106
+ /* CLASS, NEED_HYDRATION */
105
107
  );
106
108
  };
107
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input.vue2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div @mouseover=\"handleMouseOver\" @mouseout=\"handleMouseOut\">\n <component\n :is=\"componentType\"\n ref=\"inputRef\"\n :class=\"bem.b()\"\n v-bind=\"computedAttrs\"\n :allow-clear=\"allowClear\"\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, watchEffect, onMounted } from 'vue'\nimport { Input } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { InputValue, inputProps } from './input'\n\ndefineOptions({ name: 'LlInput' })\n\nconst bem = createNamespace('input')\n\nconst props = defineProps(inputProps)\n\nconst innerValue = ref<InputValue>('')\n\nconst inputRef = ref()\n\nconst allowClear = ref(props.allowClear)\n\n// 鼠标移入事件\nconst handleMouseOver = () => {\n if (props.allowClear) {\n allowClear.value = true\n }\n}\n\n// 鼠标移出事件\nconst handleMouseOut = (e: any) => {\n // if (!props.allowClear) {\n // return\n // }\n // if (\n // e.relatedTarget &&\n // (e.relatedTarget.classList.contains('ant-input-clear-icon') ||\n // e.relatedTarget.closest('.ant-input-clear-icon'))\n // ) {\n // return\n // }\n // allowClear.value = false\n}\n\nwatchEffect(() => {\n if (props.value !== innerValue.value) {\n innerValue.value = props.value\n }\n})\n\nconst componentType = props.showPassword ? Input.Password : Input\n\nconst computedAttrs = computed(() => {\n const attrs = { ...useAttrs(), ...props }\n\n return attrs\n})\n\nconst focus = () => {\n inputRef.value.focus()\n}\n\n// 给图标阻止冒泡事件\nonMounted(() => {\n if (props.allowClear) {\n const clearIcon = inputRef.value?.$el.querySelector('.ant-input-clear-icon')\n if (clearIcon) {\n clearIcon.addEventListener('mouseover', (e: any) => {\n e.stopPropagation()\n allowClear.value = true\n })\n clearIcon.addEventListener('mouseout', (e: any) => {\n if (e.relatedTarget && inputRef.value.$el.contains(e.relatedTarget)) {\n return\n }\n allowClear.value = false\n })\n }\n }\n})\n\ndefineExpose({ focus })\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;AA8BA,IAAM,MAAA,GAAA,GAAM,gBAAgB,OAAO,CAAA,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAM,MAAA,UAAA,GAAa,IAAgB,EAAE,CAAA,C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AAA;AAAA,WACpB,CAAA,CAAA;AACD,UAAU,SAAA,CAAA,gBAAA,CAAiB,UAAY,EAAA,CAAC,CAAW,KAAA;AACjD,YAAI,IAAA,CAAA,CAAE,iBAAiB,QAAS,CAAA,KAAA,CAAM,IAAI,QAAS,CAAA,CAAA,CAAE,aAAa,CAAG,EAAA;AACnE,cAAA,OAAA;AAAA,aACF;AACA,YAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AAAA,WACpB,CAAA,CAAA;AAAA,SACH;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAED,IAAa,QAAA,CAAA,EAAE,OAAO,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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 :allow-clear=\"props.allowClear ? allowClear : false\"\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, watchEffect, onMounted } from 'vue'\nimport { Input } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { InputValue, inputProps } from './input'\n\ndefineOptions({ name: 'LlInput' })\n\nconst bem = createNamespace('input')\n\nconst props = defineProps(inputProps)\n\nconst innerValue = ref<InputValue>('')\n\nconst inputRef = ref()\n\nconst allowClear = ref(false)\n\n// 鼠标移入事件\nconst handleMouseOver = () => {\n if (props.allowClear) {\n allowClear.value = true\n }\n}\n\n// 鼠标移出事件\nconst handleMouseOut = (e: any) => {\n // if (!props.allowClear) {\n // return\n // }\n // if (\n // e.relatedTarget &&\n // (e.relatedTarget.classList.contains('ant-input-clear-icon') ||\n // e.relatedTarget.closest('.ant-input-clear-icon'))\n // ) {\n // return\n // }\n // allowClear.value = false\n}\n\nwatchEffect(() => {\n if (props.value !== innerValue.value) {\n innerValue.value = props.value\n }\n})\n\nconst componentType = props.showPassword ? Input.Password : Input\n\nconst computedAttrs = computed(() => {\n const attrs = { ...useAttrs(), ...props }\n\n return attrs\n})\n\nconst focus = () => {\n inputRef.value.focus()\n}\n\n// 给图标阻止冒泡事件\nonMounted(() => {\n if (props.allowClear) {\n const clearIcon = inputRef.value?.$el.querySelector('.ant-input-clear-icon')\n if (clearIcon) {\n clearIcon.addEventListener('mouseover', (e: any) => {\n e.stopPropagation()\n allowClear.value = true\n })\n clearIcon.addEventListener('mouseout', (e: any) => {\n if (e.relatedTarget && inputRef.value.$el.contains(e.relatedTarget)) {\n return\n }\n allowClear.value = false\n })\n }\n }\n})\n\ndefineExpose({ focus })\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BA,IAAM,MAAA,GAAA,GAAM,gBAAgB,OAAO,CAAA,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAM,MAAA,UAAA,GAAa,IAAgB,EAAE,CAAA,CAAA;AAErC,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,UAAA,GAAa,IAAI,KAAK,CAAA,CAAA;AAG5B,IAAA,MAAM,kBAAkB,MAAM;AAC5B,MAAA,IAAI,MAAM,UAAY,EAAA;AACpB,QAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,OACrB;AAAA,KACF,CAAA;AAGA,IAAM,MAAA,cAAA,GAAiB,CAAC,CAAW,KAAA;AAAA,KA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ACF;AAAA,KACD,CAAA,CAAA;AAED,IAAa,QAAA,CAAA,EAAE,OAAO,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/index.full.js CHANGED
@@ -62850,7 +62850,7 @@
62850
62850
  const props = __props;
62851
62851
  const innerValue = require$$0.ref("");
62852
62852
  const inputRef = require$$0.ref();
62853
- const allowClear = require$$0.ref(props.allowClear);
62853
+ const allowClear = require$$0.ref(false);
62854
62854
  const handleMouseOver = () => {
62855
62855
  if (props.allowClear) {
62856
62856
  allowClear.value = true;
@@ -62894,15 +62894,17 @@
62894
62894
  return require$$0.openBlock(), require$$0.createElementBlock(
62895
62895
  "div",
62896
62896
  {
62897
+ class: require$$0.normalizeClass(require$$0.unref(bem).b()),
62897
62898
  onMouseover: handleMouseOver,
62898
62899
  onMouseout: handleMouseOut
62899
62900
  },
62900
62901
  [
62901
62902
  (require$$0.openBlock(), require$$0.createBlock(require$$0.resolveDynamicComponent(require$$0.unref(componentType)), require$$0.mergeProps({
62902
62903
  ref_key: "inputRef",
62903
- ref: inputRef,
62904
- class: require$$0.unref(bem).b()
62905
- }, computedAttrs.value, { "allow-clear": allowClear.value }), require$$0.createSlots({
62904
+ ref: inputRef
62905
+ }, computedAttrs.value, {
62906
+ "allow-clear": props.allowClear ? allowClear.value : false
62907
+ }), require$$0.createSlots({
62906
62908
  _: 2
62907
62909
  /* DYNAMIC */
62908
62910
  }, [
@@ -62934,10 +62936,10 @@
62934
62936
  ]),
62935
62937
  key: "1"
62936
62938
  } : void 0
62937
- ]), 1040, ["class", "allow-clear"]))
62939
+ ]), 1040, ["allow-clear"]))
62938
62940
  ],
62939
- 32
62940
- /* NEED_HYDRATION */
62941
+ 34
62942
+ /* CLASS, NEED_HYDRATION */
62941
62943
  );
62942
62944
  };
62943
62945
  }