yc-design-vue 2.1.9 → 2.2.0

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 (130) hide show
  1. package/dist/index.umd.js +1 -1
  2. package/dist/style.css +1 -1
  3. package/es/Avatar/Avatar.vue.d.ts +1 -1
  4. package/es/Avatar/index.d.ts +3 -3
  5. package/es/Badge/index.d.ts +3 -3
  6. package/es/Badge/index.vue.d.ts +1 -1
  7. package/es/Button/Button.vue.d.ts +2 -2
  8. package/es/Button/ButtonGroup.vue.d.ts +1 -1
  9. package/es/Button/index.d.ts +9 -9
  10. package/es/Card/Card.vue.d.ts +1 -1
  11. package/es/Card/index.d.ts +3 -3
  12. package/es/Cascader/Cascader.vue.d.ts +12 -44
  13. package/es/Cascader/index.d.ts +6 -22
  14. package/es/Dropdown/DropdownButton.vue.d.ts +1 -1
  15. package/es/Dropdown/index.d.ts +3 -3
  16. package/es/Image/ImagePreviewToolbar.vue.js +6 -6
  17. package/es/Input/Input.vue.d.ts +2 -8
  18. package/es/Input/Input.vue.js +24 -46
  19. package/es/Input/InputPassword.vue.d.ts +309 -0
  20. package/es/Input/InputPassword.vue.js +122 -0
  21. package/es/Input/InputPassword.vue2.js +4 -0
  22. package/es/Input/InputSearch.vue.d.ts +310 -0
  23. package/es/Input/InputSearch.vue.js +133 -0
  24. package/es/Input/InputSearch.vue2.js +4 -0
  25. package/es/Input/hooks/useLimitedInput.d.ts +2 -0
  26. package/es/Input/hooks/useLimitedInput.js +2 -0
  27. package/es/Input/index.css +1 -1
  28. package/es/Input/index.d.ts +420 -23
  29. package/es/Input/index.js +11 -3
  30. package/es/Input/type.d.ts +24 -6
  31. package/es/InputNumber/InputNumber.vue.d.ts +12 -44
  32. package/es/InputNumber/index.d.ts +6 -22
  33. package/es/Link/index.d.ts +3 -3
  34. package/es/Link/index.vue.d.ts +1 -1
  35. package/es/Statistic/Statistic.vue.d.ts +1 -1
  36. package/es/Statistic/index.d.ts +3 -3
  37. package/es/Steps/Step.vue.d.ts +1 -1
  38. package/es/Steps/Steps.vue.d.ts +1 -1
  39. package/es/Steps/index.d.ts +6 -6
  40. package/es/Transfer/TransferPanel.vue.js +1 -1
  41. package/es/Typography/TypographyBase.vue.d.ts +12 -44
  42. package/es/Upload/UploadPictureCard.vue2.js +1 -1
  43. package/es/_shared/icons/IconEyeClose.vue.js +32 -1
  44. package/es/_shared/icons/IconEyeClose.vue2.js +1 -32
  45. package/es/_shared/icons/IconEyeOpen.vue.js +29 -1
  46. package/es/_shared/icons/IconEyeOpen.vue2.js +1 -29
  47. package/es/_shared/icons/IconFullScreen.vue.js +1 -28
  48. package/es/_shared/icons/IconFullScreen.vue2.js +28 -1
  49. package/es/_shared/icons/IconOriginSize.vue.js +1 -34
  50. package/es/_shared/icons/IconOriginSize.vue2.js +34 -1
  51. package/es/_shared/icons/IconRotateLeft.vue.js +1 -28
  52. package/es/_shared/icons/IconRotateLeft.vue2.js +28 -1
  53. package/es/_shared/icons/IconRotateRight.vue.js +1 -28
  54. package/es/_shared/icons/IconRotateRight.vue2.js +28 -1
  55. package/es/_shared/icons/IconSearch.vue.js +28 -1
  56. package/es/_shared/icons/IconSearch.vue2.js +1 -28
  57. package/es/_shared/icons/IconZoomIn.vue.js +1 -28
  58. package/es/_shared/icons/IconZoomIn.vue2.js +28 -1
  59. package/es/_shared/icons/IconZoomOut.vue.js +1 -28
  60. package/es/_shared/icons/IconZoomOut.vue2.js +28 -1
  61. package/es/index.d.ts +9 -9
  62. package/es/index.js +4 -0
  63. package/es/style.css +1 -1
  64. package/lib/Avatar/Avatar.vue.d.ts +1 -1
  65. package/lib/Avatar/index.d.ts +3 -3
  66. package/lib/Badge/index.d.ts +3 -3
  67. package/lib/Badge/index.vue.d.ts +1 -1
  68. package/lib/Button/Button.vue.d.ts +2 -2
  69. package/lib/Button/ButtonGroup.vue.d.ts +1 -1
  70. package/lib/Button/index.d.ts +9 -9
  71. package/lib/Card/Card.vue.d.ts +1 -1
  72. package/lib/Card/index.d.ts +3 -3
  73. package/lib/Cascader/Cascader.vue.d.ts +12 -44
  74. package/lib/Cascader/index.d.ts +6 -22
  75. package/lib/Dropdown/DropdownButton.vue.d.ts +1 -1
  76. package/lib/Dropdown/index.d.ts +3 -3
  77. package/lib/Image/ImagePreviewToolbar.vue.js +1 -1
  78. package/lib/Input/Input.vue.d.ts +2 -8
  79. package/lib/Input/Input.vue.js +1 -1
  80. package/lib/Input/InputPassword.vue.d.ts +309 -0
  81. package/lib/Input/InputPassword.vue.js +1 -0
  82. package/lib/Input/{InputSuffix.vue3.js → InputPassword.vue2.js} +1 -1
  83. package/lib/Input/InputSearch.vue.d.ts +310 -0
  84. package/lib/Input/InputSearch.vue.js +1 -0
  85. package/lib/Input/InputSearch.vue2.js +1 -0
  86. package/lib/Input/hooks/useLimitedInput.d.ts +2 -0
  87. package/lib/Input/hooks/useLimitedInput.js +1 -1
  88. package/lib/Input/index.css +1 -1
  89. package/lib/Input/index.d.ts +420 -23
  90. package/lib/Input/index.js +1 -1
  91. package/lib/Input/type.d.ts +24 -6
  92. package/lib/InputNumber/InputNumber.vue.d.ts +12 -44
  93. package/lib/InputNumber/index.d.ts +6 -22
  94. package/lib/Link/index.d.ts +3 -3
  95. package/lib/Link/index.vue.d.ts +1 -1
  96. package/lib/Statistic/Statistic.vue.d.ts +1 -1
  97. package/lib/Statistic/index.d.ts +3 -3
  98. package/lib/Steps/Step.vue.d.ts +1 -1
  99. package/lib/Steps/Steps.vue.d.ts +1 -1
  100. package/lib/Steps/index.d.ts +6 -6
  101. package/lib/Transfer/TransferPanel.vue.js +1 -1
  102. package/lib/Typography/TypographyBase.vue.d.ts +12 -44
  103. package/lib/Upload/UploadPictureCard.vue2.js +1 -1
  104. package/lib/_shared/icons/IconEyeClose.vue.js +1 -1
  105. package/lib/_shared/icons/IconEyeClose.vue2.js +1 -1
  106. package/lib/_shared/icons/IconEyeOpen.vue.js +1 -1
  107. package/lib/_shared/icons/IconEyeOpen.vue2.js +1 -1
  108. package/lib/_shared/icons/IconFullScreen.vue.js +1 -1
  109. package/lib/_shared/icons/IconFullScreen.vue2.js +1 -1
  110. package/lib/_shared/icons/IconOriginSize.vue.js +1 -1
  111. package/lib/_shared/icons/IconOriginSize.vue2.js +1 -1
  112. package/lib/_shared/icons/IconRotateLeft.vue.js +1 -1
  113. package/lib/_shared/icons/IconRotateLeft.vue2.js +1 -1
  114. package/lib/_shared/icons/IconRotateRight.vue.js +1 -1
  115. package/lib/_shared/icons/IconRotateRight.vue2.js +1 -1
  116. package/lib/_shared/icons/IconSearch.vue.js +1 -1
  117. package/lib/_shared/icons/IconSearch.vue2.js +1 -1
  118. package/lib/_shared/icons/IconZoomIn.vue.js +1 -1
  119. package/lib/_shared/icons/IconZoomIn.vue2.js +1 -1
  120. package/lib/_shared/icons/IconZoomOut.vue.js +1 -1
  121. package/lib/_shared/icons/IconZoomOut.vue2.js +1 -1
  122. package/lib/index.d.ts +9 -9
  123. package/lib/index.js +1 -1
  124. package/lib/style.css +1 -1
  125. package/package.json +1 -1
  126. package/es/Input/InputSuffix.vue.d.ts +0 -31
  127. package/es/Input/InputSuffix.vue.js +0 -58
  128. package/es/Input/InputSuffix.vue3.js +0 -5
  129. package/lib/Input/InputSuffix.vue.d.ts +0 -31
  130. package/lib/Input/InputSuffix.vue.js +0 -1
@@ -1,4 +1,4 @@
1
- import { defineComponent, useSlots, toRefs, ref, computed, createElementBlock, openBlock, normalizeClass, unref, createBlock, createCommentVNode, createElementVNode, withCtx, renderSlot, withDirectives, mergeProps, withKeys, vShow, createSlots } from "vue";
1
+ import { defineComponent, useSlots, ref, createElementBlock, openBlock, normalizeClass, unref, createBlock, createCommentVNode, createElementVNode, withCtx, renderSlot, withDirectives, createVNode, mergeProps, withKeys, vShow, toDisplayString } from "vue";
2
2
  import "../node_modules/b-tween/dist/b-tween.es.js";
3
3
  import "../node_modules/dayjs/dayjs.min.js";
4
4
  import "../node_modules/tinycolor2/esm/tinycolor.js";
@@ -8,7 +8,6 @@ import "../node_modules/dayjs/plugin/isSameOrAfter.js";
8
8
  import "../node_modules/dayjs/plugin/isSameOrBefore.js";
9
9
  import "../_shared/utils/dom.js";
10
10
  import { getGlobalConfig } from "../_shared/utils/global-config.js";
11
- import { useControlValue } from "../_shared/utils/hooks.js";
12
11
  import "../_shared/utils/locale.js";
13
12
  import "../_shared/utils/time.js";
14
13
  import useLimitedInput from "./hooks/useLimitedInput.js";
@@ -17,9 +16,11 @@ import _sfc_main$2 from "../_shared/components/IconButton/index.vue.js";
17
16
  import _sfc_main$1 from "../_shared/components/PreventFocus/index.vue.js";
18
17
  /* empty css */
19
18
  /* empty css */
20
- import _sfc_main$3 from "./InputSuffix.vue.js";
21
- /* empty css */
22
- const _hoisted_1 = ["value", "type", "disabled", "readonly", "placeholder"];
19
+ const _hoisted_1 = ["value", "disabled", "readonly", "placeholder"];
20
+ const _hoisted_2 = {
21
+ key: 0,
22
+ class: "yc-input-word-limit"
23
+ };
23
24
  const _sfc_main = /* @__PURE__ */ defineComponent({
24
25
  ...{
25
26
  name: "Input"
@@ -45,31 +46,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
46
  inputAttrs: { default: () => {
46
47
  return {};
47
48
  } },
48
- isPassword: { type: Boolean, default: false },
49
- visibility: { type: Boolean, default: void 0 },
50
- defaultVisibility: { type: Boolean, default: false },
51
- invisibleButton: { type: Boolean, default: true },
52
49
  showInput: { type: Boolean, default: false }
53
50
  },
54
- emits: ["update:modelValue", "update:visibility", "input", "change", "visibility-change", "pressEnter", "keydown", "clear", "focus", "blur"],
51
+ emits: ["update:modelValue", "input", "change", "pressEnter", "keydown", "clear", "focus", "blur"],
55
52
  setup(__props, { expose: __expose, emit: __emit }) {
56
53
  const $slots = useSlots();
57
54
  const props = __props;
58
55
  const emits = __emit;
59
- const { visibility, defaultVisibility } = toRefs(props);
60
56
  const { size } = getGlobalConfig(props);
61
57
  const inputRef = ref();
62
- const computedVisibility = useControlValue(
63
- visibility,
64
- defaultVisibility.value,
65
- (val) => {
66
- emits("update:visibility", val);
67
- emits("visibility-change", val);
68
- }
69
- );
70
- const type = computed(() => {
71
- return computedVisibility.value ? "password" : "text";
72
- });
73
58
  const {
74
59
  computedValue,
75
60
  showWordLimit,
@@ -77,6 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
62
  curLength,
78
63
  maxLength,
79
64
  error,
65
+ recordCursor,
66
+ setCursor,
80
67
  handleInput,
81
68
  handleComposition
82
69
  } = useLimitedInput({
@@ -84,8 +71,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
84
71
  emits,
85
72
  inputRef
86
73
  });
87
- const handleEvent = async (type2, e) => {
88
- switch (type2) {
74
+ const handleEvent = async (type, e) => {
75
+ switch (type) {
89
76
  case "input":
90
77
  {
91
78
  handleInput(e);
@@ -99,7 +86,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
99
86
  case "focus":
100
87
  case "blur":
101
88
  {
102
- emits(type2, e);
89
+ emits(type, e);
103
90
  }
104
91
  break;
105
92
  case "clear":
@@ -118,6 +105,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
118
105
  }
119
106
  };
120
107
  __expose({
108
+ setCursor,
109
+ recordCursor,
121
110
  focus() {
122
111
  var _a;
123
112
  (_a = inputRef.value) == null ? void 0 : _a.focus();
@@ -166,10 +155,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
166
155
  })) : createCommentVNode("", true),
167
156
  withDirectives(createElementVNode("input", mergeProps({
168
157
  value: unref(computedValue),
169
- type: type.value,
170
158
  disabled: _ctx.disabled,
171
159
  readonly: _ctx.readonly,
172
- placeholder: _ctx.placeholder
160
+ placeholder: _ctx.placeholder,
161
+ type: "text"
173
162
  }, _ctx.inputAttrs, {
174
163
  class: "yc-input",
175
164
  ref_key: "inputRef",
@@ -204,25 +193,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
204
193
  class: "yc-input-clear-button",
205
194
  onClick: _cache[8] || (_cache[8] = ($event) => handleEvent("clear", $event))
206
195
  })) : createCommentVNode("", true),
207
- $slots.suffix || unref(showWordLimit) || _ctx.isPassword && _ctx.invisibleButton ? (openBlock(), createBlock(_sfc_main$3, {
208
- key: 3,
209
- "cur-length": unref(curLength),
210
- "max-length": unref(maxLength),
211
- "computed-value": unref(computedValue),
212
- "show-word-limit": unref(showWordLimit),
213
- "computed-visibility": unref(computedVisibility),
214
- "invisible-button": _ctx.invisibleButton,
215
- "is-password": _ctx.isPassword,
216
- onVisibilityChange: _cache[9] || (_cache[9] = (v) => computedVisibility.value = v)
217
- }, createSlots({ _: 2 }, [
218
- $slots.suffix ? {
219
- name: "suffix",
220
- fn: withCtx(() => [
221
- renderSlot(_ctx.$slots, "suffix")
222
- ]),
223
- key: "0"
224
- } : void 0
225
- ]), 1032, ["cur-length", "max-length", "computed-value", "show-word-limit", "computed-visibility", "invisible-button", "is-password"])) : createCommentVNode("", true)
196
+ createVNode(unref(_sfc_main$1), { class: "yc-input-suffix" }, {
197
+ default: withCtx(() => [
198
+ unref(showWordLimit) ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(curLength)) + "/" + toDisplayString(unref(maxLength)), 1)) : createCommentVNode("", true),
199
+ renderSlot(_ctx.$slots, "extra"),
200
+ renderSlot(_ctx.$slots, "suffix")
201
+ ]),
202
+ _: 3
203
+ })
226
204
  ], 2),
227
205
  $slots.append ? (openBlock(), createBlock(unref(_sfc_main$1), {
228
206
  key: 1,
@@ -0,0 +1,309 @@
1
+ import { InputPasswordProps } from './type';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ prepend?(_: {}): any;
6
+ append?(_: {}): any;
7
+ prefix?(_: {}): any;
8
+ suffix?(_: {}): any;
9
+ };
10
+ refs: {
11
+ inputRef: ({
12
+ $: import('vue').ComponentInternalInstance;
13
+ $data: {};
14
+ $props: {
15
+ readonly modelValue?: string | undefined;
16
+ readonly defaultValue?: string | undefined;
17
+ readonly size?: import('..').Size | undefined;
18
+ readonly allowClear?: boolean | undefined;
19
+ readonly disabled?: boolean | undefined;
20
+ readonly readonly?: boolean | undefined;
21
+ readonly error?: boolean | undefined;
22
+ readonly placeholder?: string | undefined;
23
+ readonly maxLength?: import('./type').MaxLength | undefined;
24
+ readonly wordLength?: import('./type').WordLength | undefined;
25
+ readonly wordSlice?: import('./type').WordSlice | undefined;
26
+ readonly showWordLimit?: boolean | undefined;
27
+ readonly inputAttrs?: import('..').RecordType | undefined;
28
+ readonly showInput?: boolean | undefined;
29
+ readonly onChange?: ((value: string, ev: Event) => any) | undefined;
30
+ readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
31
+ readonly onClear?: ((ev: MouseEvent) => any) | undefined;
32
+ readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
33
+ readonly onInput?: ((value: string, ev: Event) => any) | undefined;
34
+ readonly onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
35
+ readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
36
+ readonly onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
37
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
38
+ $attrs: {
39
+ [x: string]: unknown;
40
+ };
41
+ $refs: {
42
+ [x: string]: unknown;
43
+ } & {
44
+ inputRef: HTMLInputElement;
45
+ };
46
+ $slots: Readonly<{
47
+ [name: string]: import('vue').Slot<any> | undefined;
48
+ }>;
49
+ $root: import('vue').ComponentPublicInstance | null;
50
+ $parent: import('vue').ComponentPublicInstance | null;
51
+ $host: Element | null;
52
+ $emit: ((event: "change", value: string, ev: Event) => void) & ((event: "focus", ev: FocusEvent) => void) & ((event: "clear", ev: MouseEvent) => void) & ((event: "blur", ev: FocusEvent) => void) & ((event: "input", value: string, ev: Event) => void) & ((event: "keydown", ev: KeyboardEvent) => void) & ((event: "update:modelValue", value: string) => void) & ((event: "pressEnter", ev: KeyboardEvent) => void);
53
+ $el: HTMLDivElement;
54
+ $options: import('vue').ComponentOptionsBase<Readonly<import('./type').InputProps> & Readonly<{
55
+ onChange?: ((value: string, ev: Event) => any) | undefined;
56
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
57
+ onClear?: ((ev: MouseEvent) => any) | undefined;
58
+ onBlur?: ((ev: FocusEvent) => any) | undefined;
59
+ onInput?: ((value: string, ev: Event) => any) | undefined;
60
+ onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
61
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
62
+ onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
63
+ }>, {
64
+ focus(): void;
65
+ blur(): void;
66
+ getInputRef(): HTMLInputElement;
67
+ setCursor?: () => void;
68
+ recordCursor?: () => void;
69
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
70
+ change: (value: string, ev: Event) => any;
71
+ focus: (ev: FocusEvent) => any;
72
+ clear: (ev: MouseEvent) => any;
73
+ blur: (ev: FocusEvent) => any;
74
+ input: (value: string, ev: Event) => any;
75
+ keydown: (ev: KeyboardEvent) => any;
76
+ "update:modelValue": (value: string) => any;
77
+ pressEnter: (ev: KeyboardEvent) => any;
78
+ }, string, {
79
+ error: boolean;
80
+ size: import('..').Size;
81
+ disabled: boolean;
82
+ placeholder: string;
83
+ modelValue: string;
84
+ defaultValue: string;
85
+ maxLength: import('./type').MaxLength;
86
+ showWordLimit: boolean;
87
+ allowClear: boolean;
88
+ readonly: boolean;
89
+ wordLength: import('./type').WordLength;
90
+ wordSlice: import('./type').WordSlice;
91
+ inputAttrs: import('..').RecordType;
92
+ showInput: boolean;
93
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
94
+ beforeCreate?: (() => void) | (() => void)[];
95
+ created?: (() => void) | (() => void)[];
96
+ beforeMount?: (() => void) | (() => void)[];
97
+ mounted?: (() => void) | (() => void)[];
98
+ beforeUpdate?: (() => void) | (() => void)[];
99
+ updated?: (() => void) | (() => void)[];
100
+ activated?: (() => void) | (() => void)[];
101
+ deactivated?: (() => void) | (() => void)[];
102
+ beforeDestroy?: (() => void) | (() => void)[];
103
+ beforeUnmount?: (() => void) | (() => void)[];
104
+ destroyed?: (() => void) | (() => void)[];
105
+ unmounted?: (() => void) | (() => void)[];
106
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
107
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
108
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
109
+ };
110
+ $forceUpdate: () => void;
111
+ $nextTick: typeof import('vue').nextTick;
112
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
113
+ } & Readonly<{
114
+ error: boolean;
115
+ size: import('..').Size;
116
+ disabled: boolean;
117
+ placeholder: string;
118
+ modelValue: string;
119
+ defaultValue: string;
120
+ maxLength: import('./type').MaxLength;
121
+ showWordLimit: boolean;
122
+ allowClear: boolean;
123
+ readonly: boolean;
124
+ wordLength: import('./type').WordLength;
125
+ wordSlice: import('./type').WordSlice;
126
+ inputAttrs: import('..').RecordType;
127
+ showInput: boolean;
128
+ }> & Omit<Readonly<import('./type').InputProps> & Readonly<{
129
+ onChange?: ((value: string, ev: Event) => any) | undefined;
130
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
131
+ onClear?: ((ev: MouseEvent) => any) | undefined;
132
+ onBlur?: ((ev: FocusEvent) => any) | undefined;
133
+ onInput?: ((value: string, ev: Event) => any) | undefined;
134
+ onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
135
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
136
+ onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
137
+ }>, "focus" | "blur" | "setCursor" | "recordCursor" | "getInputRef" | ("error" | "size" | "disabled" | "placeholder" | "modelValue" | "defaultValue" | "maxLength" | "showWordLimit" | "allowClear" | "readonly" | "wordLength" | "wordSlice" | "inputAttrs" | "showInput")> & import('vue').ShallowUnwrapRef<{
138
+ focus(): void;
139
+ blur(): void;
140
+ getInputRef(): HTMLInputElement;
141
+ setCursor?: () => void;
142
+ recordCursor?: () => void;
143
+ }> & {} & import('@vue/runtime-core').ComponentCustomProperties & {} & {
144
+ $slots: any;
145
+ }) | null;
146
+ };
147
+ rootEl: HTMLDivElement;
148
+ };
149
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
150
+ declare const __VLS_component: import('vue').DefineComponent<InputPasswordProps, {
151
+ focus(): void;
152
+ blur(): void;
153
+ getInputRef(): HTMLInputElement;
154
+ setCursor?: () => void;
155
+ recordCursor?: () => void;
156
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
157
+ "update:visibility": (value: boolean) => any;
158
+ "visibility-change": (value: boolean) => any;
159
+ }, string, import('vue').PublicProps, Readonly<InputPasswordProps> & Readonly<{
160
+ "onUpdate:visibility"?: ((value: boolean) => any) | undefined;
161
+ "onVisibility-change"?: ((value: boolean) => any) | undefined;
162
+ }>, {
163
+ visibility: boolean;
164
+ defaultVisibility: boolean;
165
+ invisibleButton: boolean;
166
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
167
+ inputRef: ({
168
+ $: import('vue').ComponentInternalInstance;
169
+ $data: {};
170
+ $props: {
171
+ readonly modelValue?: string | undefined;
172
+ readonly defaultValue?: string | undefined;
173
+ readonly size?: import('..').Size | undefined;
174
+ readonly allowClear?: boolean | undefined;
175
+ readonly disabled?: boolean | undefined;
176
+ readonly readonly?: boolean | undefined;
177
+ readonly error?: boolean | undefined;
178
+ readonly placeholder?: string | undefined;
179
+ readonly maxLength?: import('./type').MaxLength | undefined;
180
+ readonly wordLength?: import('./type').WordLength | undefined;
181
+ readonly wordSlice?: import('./type').WordSlice | undefined;
182
+ readonly showWordLimit?: boolean | undefined;
183
+ readonly inputAttrs?: import('..').RecordType | undefined;
184
+ readonly showInput?: boolean | undefined;
185
+ readonly onChange?: ((value: string, ev: Event) => any) | undefined;
186
+ readonly onFocus?: ((ev: FocusEvent) => any) | undefined;
187
+ readonly onClear?: ((ev: MouseEvent) => any) | undefined;
188
+ readonly onBlur?: ((ev: FocusEvent) => any) | undefined;
189
+ readonly onInput?: ((value: string, ev: Event) => any) | undefined;
190
+ readonly onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
191
+ readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
192
+ readonly onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
193
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
194
+ $attrs: {
195
+ [x: string]: unknown;
196
+ };
197
+ $refs: {
198
+ [x: string]: unknown;
199
+ } & {
200
+ inputRef: HTMLInputElement;
201
+ };
202
+ $slots: Readonly<{
203
+ [name: string]: import('vue').Slot<any> | undefined;
204
+ }>;
205
+ $root: import('vue').ComponentPublicInstance | null;
206
+ $parent: import('vue').ComponentPublicInstance | null;
207
+ $host: Element | null;
208
+ $emit: ((event: "change", value: string, ev: Event) => void) & ((event: "focus", ev: FocusEvent) => void) & ((event: "clear", ev: MouseEvent) => void) & ((event: "blur", ev: FocusEvent) => void) & ((event: "input", value: string, ev: Event) => void) & ((event: "keydown", ev: KeyboardEvent) => void) & ((event: "update:modelValue", value: string) => void) & ((event: "pressEnter", ev: KeyboardEvent) => void);
209
+ $el: HTMLDivElement;
210
+ $options: import('vue').ComponentOptionsBase<Readonly<import('./type').InputProps> & Readonly<{
211
+ onChange?: ((value: string, ev: Event) => any) | undefined;
212
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
213
+ onClear?: ((ev: MouseEvent) => any) | undefined;
214
+ onBlur?: ((ev: FocusEvent) => any) | undefined;
215
+ onInput?: ((value: string, ev: Event) => any) | undefined;
216
+ onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
217
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
218
+ onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
219
+ }>, {
220
+ focus(): void;
221
+ blur(): void;
222
+ getInputRef(): HTMLInputElement;
223
+ setCursor?: () => void;
224
+ recordCursor?: () => void;
225
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
226
+ change: (value: string, ev: Event) => any;
227
+ focus: (ev: FocusEvent) => any;
228
+ clear: (ev: MouseEvent) => any;
229
+ blur: (ev: FocusEvent) => any;
230
+ input: (value: string, ev: Event) => any;
231
+ keydown: (ev: KeyboardEvent) => any;
232
+ "update:modelValue": (value: string) => any;
233
+ pressEnter: (ev: KeyboardEvent) => any;
234
+ }, string, {
235
+ error: boolean;
236
+ size: import('..').Size;
237
+ disabled: boolean;
238
+ placeholder: string;
239
+ modelValue: string;
240
+ defaultValue: string;
241
+ maxLength: import('./type').MaxLength;
242
+ showWordLimit: boolean;
243
+ allowClear: boolean;
244
+ readonly: boolean;
245
+ wordLength: import('./type').WordLength;
246
+ wordSlice: import('./type').WordSlice;
247
+ inputAttrs: import('..').RecordType;
248
+ showInput: boolean;
249
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
250
+ beforeCreate?: (() => void) | (() => void)[];
251
+ created?: (() => void) | (() => void)[];
252
+ beforeMount?: (() => void) | (() => void)[];
253
+ mounted?: (() => void) | (() => void)[];
254
+ beforeUpdate?: (() => void) | (() => void)[];
255
+ updated?: (() => void) | (() => void)[];
256
+ activated?: (() => void) | (() => void)[];
257
+ deactivated?: (() => void) | (() => void)[];
258
+ beforeDestroy?: (() => void) | (() => void)[];
259
+ beforeUnmount?: (() => void) | (() => void)[];
260
+ destroyed?: (() => void) | (() => void)[];
261
+ unmounted?: (() => void) | (() => void)[];
262
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
263
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
264
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
265
+ };
266
+ $forceUpdate: () => void;
267
+ $nextTick: typeof import('vue').nextTick;
268
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
269
+ } & Readonly<{
270
+ error: boolean;
271
+ size: import('..').Size;
272
+ disabled: boolean;
273
+ placeholder: string;
274
+ modelValue: string;
275
+ defaultValue: string;
276
+ maxLength: import('./type').MaxLength;
277
+ showWordLimit: boolean;
278
+ allowClear: boolean;
279
+ readonly: boolean;
280
+ wordLength: import('./type').WordLength;
281
+ wordSlice: import('./type').WordSlice;
282
+ inputAttrs: import('..').RecordType;
283
+ showInput: boolean;
284
+ }> & Omit<Readonly<import('./type').InputProps> & Readonly<{
285
+ onChange?: ((value: string, ev: Event) => any) | undefined;
286
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
287
+ onClear?: ((ev: MouseEvent) => any) | undefined;
288
+ onBlur?: ((ev: FocusEvent) => any) | undefined;
289
+ onInput?: ((value: string, ev: Event) => any) | undefined;
290
+ onKeydown?: ((ev: KeyboardEvent) => any) | undefined;
291
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
292
+ onPressEnter?: ((ev: KeyboardEvent) => any) | undefined;
293
+ }>, "focus" | "blur" | "setCursor" | "recordCursor" | "getInputRef" | ("error" | "size" | "disabled" | "placeholder" | "modelValue" | "defaultValue" | "maxLength" | "showWordLimit" | "allowClear" | "readonly" | "wordLength" | "wordSlice" | "inputAttrs" | "showInput")> & import('vue').ShallowUnwrapRef<{
294
+ focus(): void;
295
+ blur(): void;
296
+ getInputRef(): HTMLInputElement;
297
+ setCursor?: () => void;
298
+ recordCursor?: () => void;
299
+ }> & {} & import('@vue/runtime-core').ComponentCustomProperties & {} & {
300
+ $slots: any;
301
+ }) | null;
302
+ }, HTMLDivElement>;
303
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
304
+ export default _default;
305
+ type __VLS_WithTemplateSlots<T, S> = T & {
306
+ new (): {
307
+ $slots: S;
308
+ };
309
+ };
@@ -0,0 +1,122 @@
1
+ import { defineComponent, toRefs, ref, createBlock, openBlock, mergeProps, unref, createSlots, withCtx, createCommentVNode, renderSlot } from "vue";
2
+ import "../node_modules/b-tween/dist/b-tween.es.js";
3
+ import "../node_modules/dayjs/dayjs.min.js";
4
+ import "../node_modules/tinycolor2/esm/tinycolor.js";
5
+ import "../node_modules/dayjs/plugin/duration.js";
6
+ import "../node_modules/dayjs/plugin/toObject.js";
7
+ import "../node_modules/dayjs/plugin/isSameOrAfter.js";
8
+ import "../node_modules/dayjs/plugin/isSameOrBefore.js";
9
+ import { sleep } from "../_shared/utils/dom.js";
10
+ import { useControlValue } from "../_shared/utils/hooks.js";
11
+ import "../_shared/utils/locale.js";
12
+ import "../_shared/utils/time.js";
13
+ import _sfc_main$2 from "../_shared/components/IconButton/index.vue.js";
14
+ /* empty css */
15
+ /* empty css */
16
+ /* empty css */
17
+ import _sfc_main$4 from "../_shared/icons/IconEyeClose.vue.js";
18
+ import _sfc_main$3 from "../_shared/icons/IconEyeOpen.vue.js";
19
+ import _sfc_main$1 from "./Input.vue.js";
20
+ /* empty css */
21
+ const _sfc_main = /* @__PURE__ */ defineComponent({
22
+ ...{
23
+ name: "InputPassword"
24
+ },
25
+ __name: "InputPassword",
26
+ props: {
27
+ visibility: { type: Boolean, default: void 0 },
28
+ defaultVisibility: { type: Boolean, default: false },
29
+ invisibleButton: { type: Boolean, default: true }
30
+ },
31
+ emits: ["update:visibility", "visibility-change"],
32
+ setup(__props, { expose: __expose, emit: __emit }) {
33
+ const props = __props;
34
+ const emits = __emit;
35
+ const { visibility, defaultVisibility } = toRefs(props);
36
+ const computedVisibility = useControlValue(
37
+ visibility,
38
+ defaultVisibility.value,
39
+ (val) => {
40
+ emits("update:visibility", val);
41
+ emits("visibility-change", val);
42
+ }
43
+ );
44
+ const inputRef = ref();
45
+ const handleClick = async () => {
46
+ var _a, _b, _c, _d;
47
+ (_b = (_a = inputRef.value) == null ? void 0 : _a.recordCursor) == null ? void 0 : _b.call(_a);
48
+ await sleep(0);
49
+ computedVisibility.value = !computedVisibility.value;
50
+ (_d = (_c = inputRef.value) == null ? void 0 : _c.setCursor) == null ? void 0 : _d.call(_c);
51
+ };
52
+ __expose({
53
+ focus() {
54
+ var _a;
55
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
56
+ },
57
+ blur() {
58
+ var _a;
59
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
60
+ },
61
+ getInputRef() {
62
+ var _a;
63
+ return (_a = inputRef.value) == null ? void 0 : _a.getInputRef();
64
+ }
65
+ });
66
+ return (_ctx, _cache) => {
67
+ return openBlock(), createBlock(_sfc_main$1, mergeProps(_ctx.$attrs, {
68
+ "input-attrs": {
69
+ type: unref(computedVisibility) ? "text" : "password"
70
+ },
71
+ ref_key: "inputRef",
72
+ ref: inputRef
73
+ }), createSlots({
74
+ extra: withCtx(() => [
75
+ _ctx.invisibleButton ? (openBlock(), createBlock(unref(_sfc_main$2), {
76
+ key: 0,
77
+ size: 14,
78
+ onClick: handleClick
79
+ }, {
80
+ default: withCtx(() => [
81
+ unref(computedVisibility) ? (openBlock(), createBlock(unref(_sfc_main$3), { key: 0 })) : (openBlock(), createBlock(unref(_sfc_main$4), { key: 1 }))
82
+ ]),
83
+ _: 1
84
+ })) : createCommentVNode("", true)
85
+ ]),
86
+ _: 2
87
+ }, [
88
+ _ctx.$slots.prepend ? {
89
+ name: "prepend",
90
+ fn: withCtx(() => [
91
+ renderSlot(_ctx.$slots, "prepend")
92
+ ]),
93
+ key: "0"
94
+ } : void 0,
95
+ _ctx.$slots.append ? {
96
+ name: "append",
97
+ fn: withCtx(() => [
98
+ renderSlot(_ctx.$slots, "append")
99
+ ]),
100
+ key: "1"
101
+ } : void 0,
102
+ _ctx.$slots.prefix ? {
103
+ name: "prefix",
104
+ fn: withCtx(() => [
105
+ renderSlot(_ctx.$slots, "prefix")
106
+ ]),
107
+ key: "2"
108
+ } : void 0,
109
+ _ctx.$slots.suffix ? {
110
+ name: "suffix",
111
+ fn: withCtx(() => [
112
+ renderSlot(_ctx.$slots, "suffix")
113
+ ]),
114
+ key: "3"
115
+ } : void 0
116
+ ]), 1040, ["input-attrs"]);
117
+ };
118
+ }
119
+ });
120
+ export {
121
+ _sfc_main as default
122
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./InputPassword.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };