hy-dispatch-ui-v3 0.2.1 → 0.2.2

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.
@@ -12,9 +12,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
12
12
  default: "text"
13
13
  },
14
14
  clearSpaceType: {
15
- type: String,
15
+ type: String
16
16
  // between-清除两端空格 all-清除所有空格 before-清除前面的空格 after-清除后面的空格 none-不清除空格
17
- default: "between"
18
17
  }
19
18
  }, {
20
19
  "modelValue": { type: String, default: "" },
@@ -25,27 +24,31 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
25
24
  const props = __props;
26
25
  const modelValue = useModel(__props, "modelValue");
27
26
  const inputRef = useTemplateRef("inputRef");
27
+ const clearSpaceType = computed(() => {
28
+ if (props.clearSpaceType) {
29
+ return props.clearSpaceType;
30
+ }
31
+ return ["textarea", "password", "number"].includes(props.type) ? null : "between";
32
+ });
28
33
  const bindValue = computed({
29
34
  get() {
30
35
  return modelValue.value;
31
36
  },
32
37
  set(val) {
33
- if (val && props.type !== "password") {
34
- if (["between", "before"].includes(props.clearSpaceType)) {
38
+ if (val && clearSpaceType.value) {
39
+ if (["between", "before"].includes(clearSpaceType.value)) {
35
40
  modelValue.value = clearSpace(val, "before");
36
- return;
37
- }
38
- if (["all"].includes(props.clearSpaceType)) {
39
- modelValue.value = clearSpace(val, props.clearSpaceType);
40
- return;
41
+ } else {
42
+ modelValue.value = clearSpace(val, clearSpaceType.value);
41
43
  }
44
+ return;
42
45
  }
43
46
  modelValue.value = val;
44
47
  }
45
48
  });
46
49
  function onBlurHandler() {
47
- if (modelValue.value && props.type !== "password") {
48
- modelValue.value = clearSpace(modelValue.value, props.clearSpaceType);
50
+ if (modelValue.value) {
51
+ modelValue.value = clearSpace(modelValue.value, clearSpaceType.value);
49
52
  }
50
53
  }
51
54
  __expose({
@@ -88,10 +91,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
88
91
  ref_key: "inputRef",
89
92
  ref: inputRef,
90
93
  modelValue: bindValue.value,
91
- "onUpdate:modelValue": ($event) => bindValue.value = $event
92
- }, _ctx.$attrs, {
93
- onBlur: ($event) => onBlurHandler(props, _ctx.column)
94
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onBlur"]);
94
+ "onUpdate:modelValue": ($event) => bindValue.value = $event,
95
+ type: __props.type
96
+ }, _ctx.$attrs, { onBlur: onBlurHandler }), null, 16, ["modelValue", "onUpdate:modelValue", "type"]);
95
97
  };
96
98
  }
97
99
  });
@@ -2,5 +2,6 @@ import _sfc_main from './appInput.vue.mjs';
2
2
  import { withInstall } from '../../utils/handler.mjs';
3
3
 
4
4
  const AppInput = withInstall(_sfc_main);
5
+ const ElInput = withInstall(_sfc_main, "ElInput");
5
6
 
6
- export { AppInput, AppInput as default };
7
+ export { AppInput, ElInput, AppInput as default };
@@ -18,7 +18,7 @@ export { AppMenu } from './appMenu/index.mjs';
18
18
  export { AppTree } from './appTree/index.mjs';
19
19
  export { AppVideoPlayer } from './appVideoPlayer/index.mjs';
20
20
  export { AppAudioPlayer } from './appAudioPlayer/index.mjs';
21
- export { AppInput } from './appInput/index.mjs';
21
+ export { AppInput, ElInput } from './appInput/index.mjs';
22
22
  export { useAppForm } from './appForm/js/useAppForm.mjs';
23
23
  export { useAppSearch } from './appSearch/js/useAppSearch.mjs';
24
24
  export { useAppTable } from './appTable/js/useAppTable.mjs';
package/es/index.mjs CHANGED
@@ -9,7 +9,7 @@ export { AppDialog } from './components/appDialog/index.mjs';
9
9
  export { AppForm } from './components/appForm/index.mjs';
10
10
  export { AppIcon } from './components/appIcon/index.mjs';
11
11
  export { AppIconBox } from './components/appIconBox/index.mjs';
12
- export { AppInput } from './components/appInput/index.mjs';
12
+ export { AppInput, ElInput } from './components/appInput/index.mjs';
13
13
  export { AppMenu } from './components/appMenu/index.mjs';
14
14
  export { AppNoPermissions } from './components/appNoPermissions/index.mjs';
15
15
  export { AppNoPermissionsMap } from './components/appNoPermissionsMap/index.mjs';
@@ -72,9 +72,9 @@ function createUniqueId(n) {
72
72
  }
73
73
  return arr[0];
74
74
  }
75
- const withInstall = (comp) => {
75
+ const withInstall = (comp, name) => {
76
76
  comp.install = function(app) {
77
- app.component(comp.name, comp);
77
+ app.component(name || comp.name, comp);
78
78
  };
79
79
  return comp;
80
80
  };
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.1";
1
+ const version = "0.2.2";
2
2
 
3
3
  export { version };
@@ -16,9 +16,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
16
16
  default: "text"
17
17
  },
18
18
  clearSpaceType: {
19
- type: String,
19
+ type: String
20
20
  // between-清除两端空格 all-清除所有空格 before-清除前面的空格 after-清除后面的空格 none-不清除空格
21
- default: "between"
22
21
  }
23
22
  }, {
24
23
  "modelValue": { type: String, default: "" },
@@ -29,27 +28,31 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
29
28
  const props = __props;
30
29
  const modelValue = vue.useModel(__props, "modelValue");
31
30
  const inputRef = vue.useTemplateRef("inputRef");
31
+ const clearSpaceType = vue.computed(() => {
32
+ if (props.clearSpaceType) {
33
+ return props.clearSpaceType;
34
+ }
35
+ return ["textarea", "password", "number"].includes(props.type) ? null : "between";
36
+ });
32
37
  const bindValue = vue.computed({
33
38
  get() {
34
39
  return modelValue.value;
35
40
  },
36
41
  set(val) {
37
- if (val && props.type !== "password") {
38
- if (["between", "before"].includes(props.clearSpaceType)) {
42
+ if (val && clearSpaceType.value) {
43
+ if (["between", "before"].includes(clearSpaceType.value)) {
39
44
  modelValue.value = form.clearSpace(val, "before");
40
- return;
41
- }
42
- if (["all"].includes(props.clearSpaceType)) {
43
- modelValue.value = form.clearSpace(val, props.clearSpaceType);
44
- return;
45
+ } else {
46
+ modelValue.value = form.clearSpace(val, clearSpaceType.value);
45
47
  }
48
+ return;
46
49
  }
47
50
  modelValue.value = val;
48
51
  }
49
52
  });
50
53
  function onBlurHandler() {
51
- if (modelValue.value && props.type !== "password") {
52
- modelValue.value = form.clearSpace(modelValue.value, props.clearSpaceType);
54
+ if (modelValue.value) {
55
+ modelValue.value = form.clearSpace(modelValue.value, clearSpaceType.value);
53
56
  }
54
57
  }
55
58
  __expose({
@@ -92,10 +95,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
92
95
  ref_key: "inputRef",
93
96
  ref: inputRef,
94
97
  modelValue: bindValue.value,
95
- "onUpdate:modelValue": ($event) => bindValue.value = $event
96
- }, _ctx.$attrs, {
97
- onBlur: ($event) => onBlurHandler(props, _ctx.column)
98
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onBlur"]);
98
+ "onUpdate:modelValue": ($event) => bindValue.value = $event,
99
+ type: __props.type
100
+ }, _ctx.$attrs, { onBlur: onBlurHandler }), null, 16, ["modelValue", "onUpdate:modelValue", "type"]);
99
101
  };
100
102
  }
101
103
  });
@@ -6,6 +6,8 @@ var appInput = require('./appInput.vue.js');
6
6
  var handler = require('../../utils/handler.js');
7
7
 
8
8
  const AppInput = handler.withInstall(appInput.default);
9
+ const ElInput = handler.withInstall(appInput.default, "ElInput");
9
10
 
10
11
  exports.AppInput = AppInput;
12
+ exports.ElInput = ElInput;
11
13
  exports.default = AppInput;
@@ -48,6 +48,7 @@ exports.AppTree = index$i.AppTree;
48
48
  exports.AppVideoPlayer = index$k.AppVideoPlayer;
49
49
  exports.AppAudioPlayer = index.AppAudioPlayer;
50
50
  exports.AppInput = index$a.AppInput;
51
+ exports.ElInput = index$a.ElInput;
51
52
  exports.useAppForm = useAppForm.useAppForm;
52
53
  exports.useAppSearch = useAppSearch.useAppSearch;
53
54
  exports.useAppTable = useAppTable.useAppTable;
package/lib/index.js CHANGED
@@ -60,6 +60,7 @@ exports.AppForm = index$7.AppForm;
60
60
  exports.AppIcon = index$8.AppIcon;
61
61
  exports.AppIconBox = index$9.AppIconBox;
62
62
  exports.AppInput = index$a.AppInput;
63
+ exports.ElInput = index$a.ElInput;
63
64
  exports.AppMenu = index$b.AppMenu;
64
65
  exports.AppNoPermissions = index$c.AppNoPermissions;
65
66
  exports.AppNoPermissionsMap = index$d.AppNoPermissionsMap;
@@ -74,9 +74,9 @@ function createUniqueId(n) {
74
74
  }
75
75
  return arr[0];
76
76
  }
77
- const withInstall = (comp) => {
77
+ const withInstall = (comp, name) => {
78
78
  comp.install = function(app) {
79
- app.component(comp.name, comp);
79
+ app.component(name || comp.name, comp);
80
80
  };
81
81
  return comp;
82
82
  };
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.1";
3
+ const version = "0.2.2";
4
4
 
5
5
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-dispatch-ui-v3",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {