knt-shared 1.8.7 → 1.8.8

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/dist/index.esm.js CHANGED
@@ -4244,6 +4244,21 @@ const componentsNeedSelectPlaceholder$1 = /* @__PURE__ */ new Set([
4244
4244
  "ApiCascader",
4245
4245
  "TreeSelect"
4246
4246
  ]);
4247
+ const componentsWithAllowClear = /* @__PURE__ */ new Set([
4248
+ "Input",
4249
+ "InputNumber",
4250
+ "InputPassword",
4251
+ "Textarea",
4252
+ "Select",
4253
+ "TreeSelect",
4254
+ "Cascader",
4255
+ "DatePicker",
4256
+ "TimePicker",
4257
+ "RangePicker",
4258
+ "AutoComplete",
4259
+ "ApiSelect",
4260
+ "ApiCascader"
4261
+ ]);
4247
4262
  const componentsNeedUploadPlaceholder$1 = /* @__PURE__ */ new Set([
4248
4263
  "Upload",
4249
4264
  "BasicUpload"
@@ -5144,11 +5159,14 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5144
5159
  };
5145
5160
  const getComponentProps = (schema) => {
5146
5161
  const propsData = unref(getProps);
5162
+ const componentType = typeof schema.component === "string" ? schema.component : "";
5163
+ const defaultAllowClear = componentsWithAllowClear.has(componentType) ? { allowClear: true } : {};
5147
5164
  let disabled = propsData.disabled;
5148
5165
  if (schema.disabled !== void 0) {
5149
5166
  disabled = typeof schema.disabled === "boolean" ? schema.disabled : schema.disabled(formModel);
5150
5167
  }
5151
5168
  return {
5169
+ ...defaultAllowClear,
5152
5170
  ...resolveComponentProps(schema),
5153
5171
  disabled
5154
5172
  };