hy-dispatch-ui-v3 0.2.0 → 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.
@@ -1,5 +1,4 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode } from 'vue';
2
- import { svgIconLoad } from '../../utils/loadScript.mjs';
3
2
 
4
3
  import "./style/appIcon.scss";
5
4
 
@@ -32,7 +31,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
32
31
  return "app-icon";
33
32
  }
34
33
  });
35
- svgIconLoad();
36
34
  return (_ctx, _cache) => {
37
35
  return openBlock(), createElementBlock("svg", {
38
36
  class: normalizeClass(svgClass.value),
@@ -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 };
@@ -2,7 +2,6 @@ import { defineComponent, useTemplateRef, onMounted, onUnmounted, openBlock, cre
2
2
  import { ElPopover, ElSlider } from 'element-plus';
3
3
  import _sfc_main$1 from './cpns/mediaLoading.vue.mjs';
4
4
  import { useVideoPlayer, useVideoResize } from './js/index.mjs';
5
- import { protocolcheckLoad } from '../../utils/loadScript.mjs';
6
5
  import { useLocale } from '../../hooks/useLocale.mjs';
7
6
  import { useMixins } from '../../hooks/useMixins.mjs';
8
7
  import { AppIcon } from '../appIcon/index.mjs';
@@ -179,7 +178,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
179
178
  },
180
179
  [useVideoPlayer, useVideoResize]
181
180
  );
182
- protocolcheckLoad();
183
181
  onMounted(() => {
184
182
  initFullScreenEvent();
185
183
  listenerVideoWrapper();
@@ -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';
@@ -35,7 +35,6 @@ export { localPermissionMapKey, usePermissionMap } from './hooks/usePermissionMa
35
35
  export { localUserAvatarMapKey, useUserAvatarMap } from './hooks/useUserAvatarMap.mjs';
36
36
  export { localVideoPlayerConfigKey, useVideoPlayerConfig } from './hooks/useVideoPlayerConfig.mjs';
37
37
  export { parseRem, pxTorem, remToPx, vwToPx } from './utils/adaptive.mjs';
38
- export { protocolcheckLoad, svgIconLoad } from './utils/loadScript.mjs';
39
38
  export { useAppForm } from './components/appForm/js/useAppForm.mjs';
40
39
  export { useAppSearch } from './components/appSearch/js/useAppSearch.mjs';
41
40
  export { useAppTable } from './components/appTable/js/useAppTable.mjs';
@@ -0,0 +1,2 @@
1
+ import './hy-svg-icons.js';
2
+ import './protocolcheck.js';
@@ -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
  };
@@ -6,4 +6,3 @@ export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInst
6
6
  export { formatDuration, getDefaultValueFormatByType } from './date.mjs';
7
7
  export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './file.mjs';
8
8
  export { clearSpace, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
9
- export { protocolcheckLoad, svgIconLoad } from './loadScript.mjs';
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.0";
1
+ const version = "0.2.2";
2
2
 
3
3
  export { version };
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var loadScript = require('../../utils/loadScript.js');
7
6
 
8
7
  import "./style/appIcon.scss";
9
8
 
@@ -36,7 +35,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
36
35
  return "app-icon";
37
36
  }
38
37
  });
39
- loadScript.svgIconLoad();
40
38
  return (_ctx, _cache) => {
41
39
  return vue.openBlock(), vue.createElementBlock("svg", {
42
40
  class: vue.normalizeClass(svgClass.value),
@@ -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;
@@ -6,7 +6,6 @@ var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var mediaLoading = require('./cpns/mediaLoading.vue.js');
8
8
  var index = require('./js/index.js');
9
- var loadScript = require('../../utils/loadScript.js');
10
9
  var useLocale = require('../../hooks/useLocale.js');
11
10
  var useMixins = require('../../hooks/useMixins.js');
12
11
  var index$1 = require('../appIcon/index.js');
@@ -183,7 +182,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
183
182
  },
184
183
  [index.useVideoPlayer, index.useVideoResize]
185
184
  );
186
- loadScript.protocolcheckLoad();
187
185
  vue.onMounted(() => {
188
186
  initFullScreenEvent();
189
187
  listenerVideoWrapper();
@@ -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
@@ -39,7 +39,6 @@ var usePermissionMap = require('./hooks/usePermissionMap.js');
39
39
  var useUserAvatarMap = require('./hooks/useUserAvatarMap.js');
40
40
  var useVideoPlayerConfig = require('./hooks/useVideoPlayerConfig.js');
41
41
  var adaptive = require('./utils/adaptive.js');
42
- var loadScript = require('./utils/loadScript.js');
43
42
  var useAppForm = require('./components/appForm/js/useAppForm.js');
44
43
  var useAppSearch = require('./components/appSearch/js/useAppSearch.js');
45
44
  var useAppTable = require('./components/appTable/js/useAppTable.js');
@@ -61,6 +60,7 @@ exports.AppForm = index$7.AppForm;
61
60
  exports.AppIcon = index$8.AppIcon;
62
61
  exports.AppIconBox = index$9.AppIconBox;
63
62
  exports.AppInput = index$a.AppInput;
63
+ exports.ElInput = index$a.ElInput;
64
64
  exports.AppMenu = index$b.AppMenu;
65
65
  exports.AppNoPermissions = index$c.AppNoPermissions;
66
66
  exports.AppNoPermissionsMap = index$d.AppNoPermissionsMap;
@@ -131,8 +131,6 @@ exports.parseRem = adaptive.parseRem;
131
131
  exports.pxTorem = adaptive.pxTorem;
132
132
  exports.remToPx = adaptive.remToPx;
133
133
  exports.vwToPx = adaptive.vwToPx;
134
- exports.protocolcheckLoad = loadScript.protocolcheckLoad;
135
- exports.svgIconLoad = loadScript.svgIconLoad;
136
134
  exports.useAppForm = useAppForm.useAppForm;
137
135
  exports.useAppSearch = useAppSearch.useAppSearch;
138
136
  exports.useAppTable = useAppTable.useAppTable;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ require('./hy-svg-icons.js');
4
+ require('./protocolcheck.js');
5
+
@@ -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
  };
@@ -8,7 +8,6 @@ var handler = require('./handler.js');
8
8
  var date = require('./date.js');
9
9
  var file = require('./file.js');
10
10
  var form = require('./form.js');
11
- var loadScript = require('./loadScript.js');
12
11
 
13
12
 
14
13
 
@@ -52,5 +51,3 @@ exports.clearSpace = form.clearSpace;
52
51
  exports.genValueByProp = form.genValueByProp;
53
52
  exports.getValueByProp = form.getValueByProp;
54
53
  exports.setValueByProp = form.setValueByProp;
55
- exports.protocolcheckLoad = loadScript.protocolcheckLoad;
56
- exports.svgIconLoad = loadScript.svgIconLoad;
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.0";
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.0",
3
+ "version": "0.2.2",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {
@@ -102,9 +102,15 @@
102
102
  "./es": {
103
103
  "import": "./es/index.mjs"
104
104
  },
105
+ "./es/*": {
106
+ "import": "./es/*/*.mjs"
107
+ },
105
108
  "./lib": {
106
109
  "require": "./lib/index.js"
107
110
  },
111
+ "./lib/*": {
112
+ "import": "./lib/*/*.js"
113
+ },
108
114
  "./style": {
109
115
  "import": "./es/style/index.scss",
110
116
  "require": "./lib/style/index.scss"
@@ -113,6 +119,14 @@
113
119
  "import": "./es/style/theme.scss",
114
120
  "require": "./lib/style/theme.scss"
115
121
  },
122
+ "./static": {
123
+ "import": "./es/static/index.js",
124
+ "require": "./lib/static/index.js"
125
+ },
126
+ "./static/*": {
127
+ "import": "./es/static/*.js",
128
+ "require": "./lib/static/*.js"
129
+ },
116
130
  "./tailwind.css": "./dist/tailwind.css"
117
131
  },
118
132
  "peerDependencies": {
@@ -1,33 +0,0 @@
1
- async function loadPlugins(src) {
2
- const res = await fetch(src);
3
- const jsCode = await res.text();
4
- const runner = new Function(jsCode);
5
- runner.call(window);
6
- }
7
- let isLoadProtocolcheck = false;
8
- async function protocolcheckLoad() {
9
- if (window.protocolCheck || isLoadProtocolcheck) return;
10
- try {
11
- await loadPlugins(
12
- new URL("../static/protocolcheck.js", import.meta.url).href
13
- );
14
- } catch (err) {
15
- console.error(err);
16
- }
17
- isLoadSvgIcon = false;
18
- }
19
- let isLoadSvgIcon = false;
20
- async function svgIconLoad() {
21
- if (isLoadSvgIcon) return;
22
- isLoadSvgIcon = true;
23
- try {
24
- await loadPlugins(
25
- new URL("../static/hy-svg-icons.js", import.meta.url).href
26
- );
27
- } catch (err) {
28
- console.error(err);
29
- }
30
- isLoadSvgIcon = false;
31
- }
32
-
33
- export { protocolcheckLoad, svgIconLoad };
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
4
- async function loadPlugins(src) {
5
- const res = await fetch(src);
6
- const jsCode = await res.text();
7
- const runner = new Function(jsCode);
8
- runner.call(window);
9
- }
10
- let isLoadProtocolcheck = false;
11
- async function protocolcheckLoad() {
12
- if (window.protocolCheck || isLoadProtocolcheck) return;
13
- try {
14
- await loadPlugins(
15
- new URL("../static/protocolcheck.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/loadScript.js', document.baseURI).href))).href
16
- );
17
- } catch (err) {
18
- console.error(err);
19
- }
20
- isLoadSvgIcon = false;
21
- }
22
- let isLoadSvgIcon = false;
23
- async function svgIconLoad() {
24
- if (isLoadSvgIcon) return;
25
- isLoadSvgIcon = true;
26
- try {
27
- await loadPlugins(
28
- new URL("../static/hy-svg-icons.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/loadScript.js', document.baseURI).href))).href
29
- );
30
- } catch (err) {
31
- console.error(err);
32
- }
33
- isLoadSvgIcon = false;
34
- }
35
-
36
- exports.protocolcheckLoad = protocolcheckLoad;
37
- exports.svgIconLoad = svgIconLoad;