ll-plus 2.6.23 → 2.6.24

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.
Files changed (54) hide show
  1. package/es/components/easy-cron/index.d.ts +0 -438
  2. package/es/components/easy-cron/src/easy-cron.vue.d.ts +0 -438
  3. package/es/components/icon-picker/index.d.ts +10 -0
  4. package/es/components/icon-picker/src/components/search.vue.d.ts +10 -0
  5. package/es/components/icon-picker/src/icon-picker.vue.d.ts +10 -0
  6. package/es/components/input/index.d.ts +3 -0
  7. package/es/components/input/src/input.vue.d.ts +3 -0
  8. package/es/packages/components/easy-cron/src/easy-cron.vue2.mjs +33 -22
  9. package/es/packages/components/easy-cron/src/easy-cron.vue2.mjs.map +1 -1
  10. package/es/packages/components/icon-picker/src/components/search.vue2.mjs +12 -5
  11. package/es/packages/components/icon-picker/src/components/search.vue2.mjs.map +1 -1
  12. package/es/packages/components/input/src/input.mjs +1 -1
  13. package/es/packages/components/input/src/input.mjs.map +1 -1
  14. package/es/packages/components/input/src/input.vue2.mjs +74 -40
  15. package/es/packages/components/input/src/input.vue2.mjs.map +1 -1
  16. package/es/packages/components/table/src/components/main-table.vue2.mjs +199 -189
  17. package/es/packages/components/table/src/components/main-table.vue2.mjs.map +1 -1
  18. package/es/utils/props/runtime.d.ts +2 -2
  19. package/index.full.js +312 -252
  20. package/index.full.min.js +3 -3
  21. package/index.full.min.js.map +1 -1
  22. package/index.full.min.mjs +18 -18
  23. package/index.full.min.mjs.map +1 -1
  24. package/index.full.mjs +313 -253
  25. package/lib/components/easy-cron/index.d.ts +0 -438
  26. package/lib/components/easy-cron/src/easy-cron.vue.d.ts +0 -438
  27. package/lib/components/icon-picker/index.d.ts +10 -0
  28. package/lib/components/icon-picker/src/components/search.vue.d.ts +10 -0
  29. package/lib/components/icon-picker/src/icon-picker.vue.d.ts +10 -0
  30. package/lib/components/input/index.d.ts +3 -0
  31. package/lib/components/input/src/input.vue.d.ts +3 -0
  32. package/lib/packages/components/easy-cron/src/easy-cron.vue2.js +31 -20
  33. package/lib/packages/components/easy-cron/src/easy-cron.vue2.js.map +1 -1
  34. package/lib/packages/components/icon-picker/src/components/search.vue2.js +11 -4
  35. package/lib/packages/components/icon-picker/src/components/search.vue2.js.map +1 -1
  36. package/lib/packages/components/input/src/input.js +1 -1
  37. package/lib/packages/components/input/src/input.js.map +1 -1
  38. package/lib/packages/components/input/src/input.vue2.js +73 -39
  39. package/lib/packages/components/input/src/input.vue2.js.map +1 -1
  40. package/lib/packages/components/table/src/components/main-table.vue2.js +198 -188
  41. package/lib/packages/components/table/src/components/main-table.vue2.js.map +1 -1
  42. package/lib/utils/props/runtime.d.ts +2 -2
  43. package/package.json +1 -1
  44. package/theme-chalk/css/easy-cron.css +1 -1
  45. package/theme-chalk/css/icon-picker.css +1 -1
  46. package/theme-chalk/css/index.css +1 -1
  47. package/types/packages/components/easy-cron/index.d.ts +0 -438
  48. package/types/packages/components/easy-cron/src/easy-cron.vue.d.ts +0 -438
  49. package/types/packages/components/icon-picker/index.d.ts +10 -0
  50. package/types/packages/components/icon-picker/src/components/search.vue.d.ts +10 -0
  51. package/types/packages/components/icon-picker/src/icon-picker.vue.d.ts +10 -0
  52. package/types/packages/components/input/index.d.ts +3 -0
  53. package/types/packages/components/input/src/input.vue.d.ts +3 -0
  54. package/types/packages/utils/props/runtime.d.ts +2 -2
@@ -1,6 +1,8 @@
1
- import { defineComponent, useAttrs, resolveComponent, openBlock, createBlock, withCtx, createVNode, mergeProps, unref, renderSlot, createTextVNode } from 'vue';
1
+ import { defineComponent, useAttrs, resolveComponent, openBlock, createBlock, normalizeClass, unref, withCtx, createVNode, mergeProps, renderSlot, createTextVNode } from 'vue';
2
2
  import '../config/index.mjs';
3
+ import '../../../../utils/index.mjs';
3
4
  import { iconPickerSearchProps, iconPickerSearchEmits } from '../config/search.mjs';
5
+ import { createNamespace } from '../../../../utils/create-namespace.mjs';
4
6
 
5
7
  "use strict";
6
8
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -14,13 +16,17 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
14
16
  const props = __props;
15
17
  const emits = __emit;
16
18
  const attrs = useAttrs();
19
+ const bem = createNamespace("icon-picker-search");
17
20
  const handleCloseModalVisible = () => emits("handleModalVisible", true);
18
21
  return (_ctx, _cache) => {
19
22
  const _component_ll_icon = resolveComponent("ll-icon");
20
23
  const _component_a_input = resolveComponent("a-input");
21
24
  const _component_a_button = resolveComponent("a-button");
22
25
  const _component_a_input_group = resolveComponent("a-input-group");
23
- return openBlock(), createBlock(_component_a_input_group, { compact: "" }, {
26
+ return openBlock(), createBlock(_component_a_input_group, {
27
+ compact: "",
28
+ class: normalizeClass(unref(bem).b())
29
+ }, {
24
30
  default: withCtx(() => [
25
31
  createVNode(_component_a_input, mergeProps({
26
32
  value: props.value,
@@ -37,19 +43,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
37
43
  renderSlot(_ctx.$slots, "rightButton", {}, () => [
38
44
  createVNode(_component_a_button, {
39
45
  type: "primary",
46
+ class: normalizeClass(unref(bem).e("btn")),
40
47
  onClick: handleCloseModalVisible
41
48
  }, {
42
49
  default: withCtx(() => [
43
- createTextVNode("\u56FE\u6807")
50
+ createTextVNode("\u56FE\u6807 ")
44
51
  ]),
45
52
  _: 1
46
53
  /* STABLE */
47
- })
54
+ }, 8, ["class"])
48
55
  ])
49
56
  ]),
50
57
  _: 3
51
58
  /* FORWARDED */
52
- });
59
+ }, 8, ["class"]);
53
60
  };
54
61
  }
55
62
  });
@@ -1 +1 @@
1
- {"version":3,"file":"search.vue2.mjs","sources":["../../../../../../../packages/components/icon-picker/src/components/search.vue"],"sourcesContent":["<template>\n <a-input-group compact>\n <a-input\n :value=\"props.value\"\n readonly\n v-bind=\"attrs\"\n style=\"width: calc(100% - 60px)\"\n >\n <template #suffix>\n <ll-icon :icon-name=\"'icon-' + value\" />\n </template>\n </a-input>\n\n <slot name=\"rightButton\">\n <a-button type=\"primary\" @click=\"handleCloseModalVisible\">图标</a-button>\n </slot>\n </a-input-group>\n</template>\n<script lang=\"ts\" setup>\nimport { useAttrs } from 'vue'\n\nimport { iconPickerSearchProps, iconPickerSearchEmits } from '../config'\n\ndefineOptions({\n name: 'LlIconPickerSearch'\n})\n\nconst props = defineProps(iconPickerSearchProps)\nconst emits = defineEmits(iconPickerSearchEmits)\n\nconst attrs = useAttrs()\n\nconst handleCloseModalVisible = () => emits('handleModalVisible', true)\n</script>\n<style lang=\"less\" scoped></style>\n"],"names":[],"mappings":";;;;;;;;;;;;;AA2BA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,uBAA0B,GAAA,MAAM,KAAM,CAAA,oBAAA,EAAsB,IAAI,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"search.vue2.mjs","sources":["../../../../../../../packages/components/icon-picker/src/components/search.vue"],"sourcesContent":["<template>\n <a-input-group compact :class=\"bem.b()\">\n <a-input\n :value=\"props.value\"\n readonly\n v-bind=\"attrs\"\n style=\"width: calc(100% - 60px)\"\n >\n <template #suffix>\n <ll-icon :icon-name=\"'icon-' + value\" />\n </template>\n </a-input>\n\n <slot name=\"rightButton\">\n <a-button\n type=\"primary\"\n :class=\"bem.e('btn')\"\n @click=\"handleCloseModalVisible\"\n >图标\n </a-button>\n </slot>\n </a-input-group>\n</template>\n<script lang=\"ts\" setup>\nimport { useAttrs } from 'vue'\n\nimport { iconPickerSearchProps, iconPickerSearchEmits } from '../config'\nimport { createNamespace } from '@ll-plus/utils'\n\ndefineOptions({\n name: 'LlIconPickerSearch'\n})\n\nconst props = defineProps(iconPickerSearchProps)\nconst emits = defineEmits(iconPickerSearchEmits)\n\nconst attrs = useAttrs()\nconst bem = createNamespace('icon-picker-search')\nconst handleCloseModalVisible = () => emits('handleModalVisible', true)\n</script>\n<style lang=\"less\" scoped></style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiCA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,GAAA,GAAM,gBAAgB,oBAAoB,CAAA,CAAA;AAChD,IAAA,MAAM,uBAA0B,GAAA,MAAM,KAAM,CAAA,oBAAA,EAAsB,IAAI,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -28,7 +28,7 @@ const inputProps = buildProps({
28
28
  type: Boolean
29
29
  },
30
30
  /**
31
- * @description 是否显示密码框
31
+ * @description 是否点击清除图标删除内容
32
32
  */
33
33
  allowClear: {
34
34
  type: Boolean,
@@ -1 +1 @@
1
- {"version":3,"file":"input.mjs","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { InputProps as AntInputProps } from 'ant-design-vue'\nimport type Input from './input.vue'\n\nexport const inputProps = buildProps({\n /**\n * @description input的value\n */\n value: {\n type: definePropType<AntInputProps['value']>(String)\n },\n /**\n * @description 带有前缀图标的 input\n */\n prefixIcon: {\n type: String\n },\n /**\n * @description 带有后缀图标的 input\n */\n suffixIcon: {\n type: String\n },\n /**\n * @description 是否显示密码框\n */\n showPassword: {\n type: Boolean\n },\n /**\n * @description 是否显示密码框\n */\n allowClear: {\n type: Boolean,\n default: true\n }\n} as const)\n\n// props\nexport type InputProps = ExtractPropTypes<typeof inputProps> // ExtractPropTypes和defineCpmponent类似\nexport type InputValue = AntInputProps['value']\n\n// instance\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":[],"mappings":";;;;AAMO,MAAM,aAAa,UAAW,CAAA;AAAA;AAAA;AAAA;AAAA,EAInC,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAuC,MAAM,CAAA;AAAA,GACrD;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF,CAAU;;;;"}
1
+ {"version":3,"file":"input.mjs","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { InputProps as AntInputProps } from 'ant-design-vue'\nimport type Input from './input.vue'\n\nexport const inputProps = buildProps({\n /**\n * @description input的value\n */\n value: {\n type: definePropType<AntInputProps['value']>(String)\n },\n /**\n * @description 带有前缀图标的 input\n */\n prefixIcon: {\n type: String\n },\n /**\n * @description 带有后缀图标的 input\n */\n suffixIcon: {\n type: String\n },\n /**\n * @description 是否显示密码框\n */\n showPassword: {\n type: Boolean\n },\n /**\n * @description 是否点击清除图标删除内容\n */\n allowClear: {\n type: Boolean,\n default: true\n }\n} as const)\n\n// props\nexport type InputProps = ExtractPropTypes<typeof inputProps> // ExtractPropTypes和defineCpmponent类似\nexport type InputValue = AntInputProps['value']\n\n// instance\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":[],"mappings":";;;;AAMO,MAAM,aAAa,UAAW,CAAA;AAAA;AAAA;AAAA;AAAA,EAInC,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAuC,MAAM,CAAA;AAAA,GACrD;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF,CAAU;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, watchEffect, computed, useAttrs, resolveComponent, openBlock, createBlock, resolveDynamicComponent, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, createVNode } from 'vue';
1
+ import { defineComponent, ref, watchEffect, computed, useAttrs, onMounted, resolveComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, 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,6 +14,14 @@ 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);
18
+ const handleMouseOver = () => {
19
+ if (props.allowClear) {
20
+ allowClear.value = true;
21
+ }
22
+ };
23
+ const handleMouseOut = (e) => {
24
+ };
17
25
  watchEffect(() => {
18
26
  if (props.value !== innerValue.value) {
19
27
  innerValue.value = props.value;
@@ -27,48 +35,74 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
27
35
  const focus = () => {
28
36
  inputRef.value.focus();
29
37
  };
38
+ onMounted(() => {
39
+ if (props.allowClear) {
40
+ const clearIcon = inputRef.value?.$el.querySelector(".ant-input-clear-icon");
41
+ if (clearIcon) {
42
+ clearIcon.addEventListener("mouseover", (e) => {
43
+ e.stopPropagation();
44
+ allowClear.value = true;
45
+ });
46
+ clearIcon.addEventListener("mouseout", (e) => {
47
+ if (e.relatedTarget && inputRef.value.$el.contains(e.relatedTarget)) {
48
+ return;
49
+ }
50
+ allowClear.value = false;
51
+ });
52
+ }
53
+ }
54
+ });
30
55
  __expose({ focus });
31
56
  return (_ctx, _cache) => {
32
57
  const _component_ll_icon = resolveComponent("ll-icon");
33
- return openBlock(), createBlock(resolveDynamicComponent(unref(componentType)), mergeProps({
34
- ref_key: "inputRef",
35
- ref: inputRef,
36
- class: unref(bem).b()
37
- }, computedAttrs.value, {
38
- "allow-clear": props.allowClear
39
- }), createSlots({
40
- _: 2
41
- /* DYNAMIC */
42
- }, [
43
- renderList(Object.keys(_ctx.$slots), (item) => {
44
- return {
45
- name: item,
46
- fn: withCtx((data) => [
47
- renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
48
- ])
49
- };
50
- }),
51
- _ctx.prefixIcon ? {
52
- name: "prefix",
53
- fn: withCtx(() => [
54
- createVNode(_component_ll_icon, {
55
- "icon-name": _ctx.prefixIcon,
56
- "class-name": "prefix-icon"
57
- }, null, 8, ["icon-name"])
58
- ]),
59
- key: "0"
60
- } : void 0,
61
- _ctx.suffixIcon ? {
62
- name: "suffix",
63
- fn: withCtx(() => [
64
- createVNode(_component_ll_icon, {
65
- "icon-name": _ctx.suffixIcon,
66
- "class-name": "suffix-icon"
67
- }, null, 8, ["icon-name"])
68
- ]),
69
- key: "1"
70
- } : void 0
71
- ]), 1040, ["class", "allow-clear"]);
58
+ return openBlock(), createElementBlock(
59
+ "div",
60
+ {
61
+ onMouseover: handleMouseOver,
62
+ onMouseout: handleMouseOut
63
+ },
64
+ [
65
+ (openBlock(), createBlock(resolveDynamicComponent(unref(componentType)), mergeProps({
66
+ ref_key: "inputRef",
67
+ ref: inputRef,
68
+ class: unref(bem).b()
69
+ }, computedAttrs.value, { "allow-clear": allowClear.value }), createSlots({
70
+ _: 2
71
+ /* DYNAMIC */
72
+ }, [
73
+ renderList(Object.keys(_ctx.$slots), (item) => {
74
+ return {
75
+ name: item,
76
+ fn: withCtx((data) => [
77
+ renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
78
+ ])
79
+ };
80
+ }),
81
+ _ctx.prefixIcon ? {
82
+ name: "prefix",
83
+ fn: withCtx(() => [
84
+ createVNode(_component_ll_icon, {
85
+ "icon-name": _ctx.prefixIcon,
86
+ class: "prefix-icon"
87
+ }, null, 8, ["icon-name"])
88
+ ]),
89
+ key: "0"
90
+ } : void 0,
91
+ _ctx.suffixIcon ? {
92
+ name: "suffix",
93
+ fn: withCtx(() => [
94
+ createVNode(_component_ll_icon, {
95
+ "icon-name": _ctx.suffixIcon,
96
+ class: "suffix-icon"
97
+ }, null, 8, ["icon-name"])
98
+ ]),
99
+ key: "1"
100
+ } : void 0
101
+ ]), 1040, ["class", "allow-clear"]))
102
+ ],
103
+ 32
104
+ /* NEED_HYDRATION */
105
+ );
72
106
  };
73
107
  }
74
108
  });
@@ -1 +1 @@
1
- {"version":3,"file":"input.vue2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <component\n :is=\"componentType\"\n ref=\"inputRef\"\n :class=\"bem.b()\"\n v-bind=\"computedAttrs\"\n :allow-clear=\"props.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-name=\"prefix-icon\" />\n </template>\n <template v-if=\"suffixIcon\" #suffix>\n <ll-icon :icon-name=\"suffixIcon\" class-name=\"suffix-icon\" />\n </template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watchEffect } 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\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\ndefineExpose({ focus })\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BA,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,IAAA,WAAA,CAAY,MAAM;AAChB,MAAI,IAAA,KAAA,CAAM,KAAU,KAAA,UAAA,CAAW,KAAO,EAAA;AACpC,QAAA,UAAA,CAAW,QAAQ,KAAM,CAAA,KAAA,CAAA;AAAA,OAC3B;AAAA,KACD,CAAA,CAAA;AAED,IAAA,MAAM,aAAgB,GAAA,KAAA,CAAM,YAAe,GAAA,KAAA,CAAM,QAAW,GAAA,KAAA,CAAA;AAE5D,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM;AACnC,MAAA,MAAM,QAAQ,EAAE,GAAG,QAAS,EAAA,EAAG,GAAG,KAAM,EAAA,CAAA;AAExC,MAAO,OAAA,KAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,MAAM,QAAQ,MAAM;AAClB,MAAA,QAAA,CAAS,MAAM,KAAM,EAAA,CAAA;AAAA,KACvB,CAAA;AAEA,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 @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,CAAA;AAErC,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,UAAA,GAAa,GAAI,CAAA,KAAA,CAAM,UAAU,CAAA,CAAA;AAGvC,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,KAYnC,CAAA;AAEA,IAAA,WAAA,CAAY,MAAM;AAChB,MAAI,IAAA,KAAA,CAAM,KAAU,KAAA,UAAA,CAAW,KAAO,EAAA;AACpC,QAAA,UAAA,CAAW,QAAQ,KAAM,CAAA,KAAA,CAAA;AAAA,OAC3B;AAAA,KACD,CAAA,CAAA;AAED,IAAA,MAAM,aAAgB,GAAA,KAAA,CAAM,YAAe,GAAA,KAAA,CAAM,QAAW,GAAA,KAAA,CAAA;AAE5D,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM;AACnC,MAAA,MAAM,QAAQ,EAAE,GAAG,QAAS,EAAA,EAAG,GAAG,KAAM,EAAA,CAAA;AAExC,MAAO,OAAA,KAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,MAAM,QAAQ,MAAM;AAClB,MAAA,QAAA,CAAS,MAAM,KAAM,EAAA,CAAA;AAAA,KACvB,CAAA;AAGA,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,IAAI,MAAM,UAAY,EAAA;AACpB,QAAA,MAAM,SAAY,GAAA,QAAA,CAAS,KAAO,EAAA,GAAA,CAAI,cAAc,uBAAuB,CAAA,CAAA;AAC3E,QAAA,IAAI,SAAW,EAAA;AACb,UAAU,SAAA,CAAA,gBAAA,CAAiB,WAAa,EAAA,CAAC,CAAW,KAAA;AAClD,YAAA,CAAA,CAAE,eAAgB,EAAA,CAAA;AAClB,YAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}