sard-uniapp 1.4.0 → 1.4.1

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/changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [1.4.1](https://github.com/sutras/sard-uniapp/compare/v1.4.0...v1.4.1) (2024-08-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * search组件新增clear, focus, blur事件 ([05dc641](https://github.com/sutras/sard-uniapp/commit/05dc641947e83a6d9e9c92b46cfc33135116eb22))
7
+
8
+
9
+
1
10
  # [1.4.0](https://github.com/sutras/sard-uniapp/compare/v1.3.0...v1.4.0) (2024-08-01)
2
11
 
3
12
 
@@ -30,4 +30,7 @@ export interface SearchEmits {
30
30
  (e: 'cancel'): void;
31
31
  (e: 'search', value: string): void;
32
32
  (e: 'click', event: any): void;
33
+ (e: 'clear'): void;
34
+ (e: 'focus', event: any): void;
35
+ (e: 'blur', event: any): void;
33
36
  }
@@ -7,13 +7,19 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
7
7
  cancel: () => void;
8
8
  search: (value: string) => void;
9
9
  click: (event: any) => void;
10
+ clear: () => void;
11
+ focus: (event: any) => void;
12
+ blur: (event: any) => void;
10
13
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<SearchProps>, {
11
14
  shape: "square";
12
15
  focus: boolean;
13
16
  }>>> & {
14
17
  "onUpdate:model-value"?: ((value: string) => any) | undefined;
18
+ onFocus?: ((event: any) => any) | undefined;
19
+ onBlur?: ((event: any) => any) | undefined;
15
20
  onClick?: ((event: any) => any) | undefined;
16
21
  onCancel?: (() => any) | undefined;
22
+ onClear?: (() => any) | undefined;
17
23
  onSearch?: ((value: string) => any) | undefined;
18
24
  }, {
19
25
  shape: "round" | "square";
@@ -18,6 +18,9 @@
18
18
  :focus="focus"
19
19
  @update:model-value="onInput"
20
20
  @confirm="onConfirm"
21
+ @clear="onClear"
22
+ @focus="onFocus"
23
+ @blur="onBlur"
21
24
  >
22
25
  <template #prepend>
23
26
  <slot name="input-prepend">
@@ -85,7 +88,7 @@ export default _defineComponent({
85
88
  search: { type: String, required: false },
86
89
  focus: { type: Boolean, required: false }
87
90
  }, searchPropsDefaults),
88
- emits: ["update:model-value", "cancel", "search", "click"],
91
+ emits: ["update:model-value", "cancel", "search", "click", "clear", "focus", "blur"],
89
92
  setup(__props, { expose: __expose, emit: __emit }) {
90
93
  __expose();
91
94
  const props = __props;
@@ -112,6 +115,15 @@ export default _defineComponent({
112
115
  const onClick = (event) => {
113
116
  emit("click", event);
114
117
  };
118
+ const onClear = () => {
119
+ emit("clear");
120
+ };
121
+ const onFocus = (event) => {
122
+ emit("focus", event);
123
+ };
124
+ const onBlur = (event) => {
125
+ emit("blur", event);
126
+ };
115
127
  const searchClass = computed(() => {
116
128
  return classNames(
117
129
  bem.b(),
@@ -138,7 +150,7 @@ export default _defineComponent({
138
150
  backgroundColor: props.inputBackground
139
151
  });
140
152
  });
141
- const __returned__ = { props, emit, bem, innerValue, onInput, onConfirm, onCancel, onClick, searchClass, searchStyle, inputClass, inputStyle, SarInput, SarIcon, SarButton };
153
+ const __returned__ = { props, emit, bem, innerValue, onInput, onConfirm, onCancel, onClick, onClear, onFocus, onBlur, searchClass, searchStyle, inputClass, inputStyle, SarInput, SarIcon, SarButton };
142
154
  return __returned__;
143
155
  }
144
156
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "sard-uniapp",
3
3
  "name": "sard-uniapp",
4
4
  "displayName": "sard-uniapp",
5
- "version": "1.4.0",
5
+ "version": "1.4.1",
6
6
  "type": "module",
7
7
  "description": "sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库",
8
8
  "keywords": [