@thestarweb/ui 1.4.0 → 1.5.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 (66) hide show
  1. package/build-ts/main.js +26 -4
  2. package/dist/star-ui.common.js +24800 -2754
  3. package/dist/star-ui.common.js.map +1 -1
  4. package/dist/star-ui.umd.js +24800 -2754
  5. package/dist/star-ui.umd.js.map +1 -1
  6. package/dist/star-ui.umd.min.js +280 -3
  7. package/dist/star-ui.umd.min.js.map +1 -1
  8. package/package.json +3 -2
  9. package/readme.md +2 -2
  10. package/src/components/button.vue +3 -3
  11. package/src/components/calendar.vue +193 -47
  12. package/src/components/call-render.tsx +22 -0
  13. package/src/components/card.vue +4 -4
  14. package/src/components/content/index.ts +1 -0
  15. package/src/components/content/page.vue +117 -0
  16. package/src/components/input.vue +5 -5
  17. package/src/components/layout-h.vue +3 -4
  18. package/src/components/layout-main.vue +3 -2
  19. package/src/components/layout-v.vue +3 -2
  20. package/src/components/line-h.vue +9 -8
  21. package/src/components/line-v.vue +9 -8
  22. package/src/components/menu/index.ts +1 -0
  23. package/src/components/menu/index.vue +83 -0
  24. package/src/components/menu/menu-h/index.vue +66 -0
  25. package/src/components/menu/menu-h/menu-h-child.vue +74 -0
  26. package/src/components/menu/menu-h/menu-h-item.vue +65 -0
  27. package/src/components/menu/menu-v/index.vue +56 -0
  28. package/src/components/select.vue +3 -3
  29. package/src/components/slider.vue +33 -8
  30. package/src/components/switch.vue +43 -43
  31. package/src/components/table.vue +3 -3
  32. package/src/components/tree/index.vue +3 -3
  33. package/src/components/tree/tree-item.vue +5 -4
  34. package/src/components/view-control.vue +3 -4
  35. package/src/directives/is-focus.ts +10 -0
  36. package/src/global-style.css +3 -0
  37. package/src/icon-font/iconfont.css +17 -7
  38. package/src/icon-font/iconfont.json +22 -1
  39. package/src/icon-font/iconfont.ttf +0 -0
  40. package/src/icon-font/iconfont.woff +0 -0
  41. package/src/icon-font/iconfont.woff2 +0 -0
  42. package/src/main.ts +36 -25
  43. package/src/reg.ts +26 -6
  44. package/src/types.d.ts +6 -0
  45. package/src/utils.ts +1 -1
  46. package/types/components/button.vue.d.ts +1 -1
  47. package/types/components/calendar.vue.d.ts +20 -4
  48. package/types/components/call-render.d.ts +6 -0
  49. package/types/components/content/index.d.ts +1 -0
  50. package/types/components/content/page.vue.d.ts +10 -0
  51. package/types/components/layout-h.vue.d.ts +1 -1
  52. package/types/components/layout-main.vue.d.ts +1 -1
  53. package/types/components/layout-v.vue.d.ts +1 -1
  54. package/types/components/line-h.vue.d.ts +1 -1
  55. package/types/components/line-v.vue.d.ts +1 -1
  56. package/types/components/menu/index.d.ts +1 -0
  57. package/types/components/menu/index.vue.d.ts +12 -0
  58. package/types/components/menu/menu-h/index.vue.d.ts +8 -0
  59. package/types/components/menu/menu-h/menu-h-child.vue.d.ts +7 -0
  60. package/types/components/menu/menu-h/menu-h-item.vue.d.ts +8 -0
  61. package/types/components/menu/menu-v/index.vue.d.ts +9 -0
  62. package/types/components/slider.vue.d.ts +2 -0
  63. package/types/directives/is-focus.d.ts +4 -0
  64. package/types/main.d.ts +68 -6
  65. package/types/reg.d.ts +18 -5
  66. package/dist/img/iconfont.ff1d7f50.svg +0 -62
package/build-ts/main.js CHANGED
@@ -2,6 +2,7 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
  const srcDir="./src";
4
4
  const outDir="./out";
5
+ const alias = JSON.parse(fs.readFileSync('./tsconfig.json')).compilerOptions.paths;
5
6
  var down = [];
6
7
  var task = ["/main.ts"];
7
8
  while(task.length){
@@ -14,8 +15,20 @@ while(task.length){
14
15
  fileData=fileData.substring(fileData.indexOf("<script lang=\"ts\">")+18,fileData.lastIndexOf("</script>"));
15
16
  outfile+=".ts";
16
17
  }
17
- fileData=fileData.replace(/import (.+?) from "(.+?)"/g,function(row,m,importFile){
18
- //console.log(r,r2,path);
18
+ fileData=fileData.replace(/(?:import|export) (?:.+?) from "(.+?)"/g,function(row,importFile){
19
+ if(alias){
20
+ Object.keys(alias).find(key => {
21
+ const _key = key.replace("*","");
22
+ if(importFile.startsWith(_key)){
23
+ const _r = path.relative(path.resolve(path.dirname(path.join(srcDir, file))),path.resolve(alias[key][0].replace("*","")));
24
+ const r = _r.replace(/\\/g, "/");
25
+ row = row.replace(`from "${_key}`,`from "${r}/`);
26
+ importFile = importFile.replace(_key, `${r}/`);
27
+ return true;
28
+ }
29
+ return false;
30
+ });
31
+ }
19
32
  if(!importFile.startsWith(".")){
20
33
  return row;
21
34
  }
@@ -24,18 +37,27 @@ while(task.length){
24
37
  const base = path.join(srcDir, importFile_);
25
38
  if(fs.existsSync(base+".ts")){
26
39
  importFile_+=".ts";
40
+ }else if(fs.existsSync(base+".tsx")){
41
+ importFile_+=".tsx";
27
42
  }else if(fs.existsSync(base+".d.ts")){
28
43
  importFile_+=".d.ts";
44
+ }else if(fs.existsSync(base+"/index.ts")){
45
+ importFile_+="/index.ts";
29
46
  }
30
47
  }
31
48
  task.push(importFile_);
32
49
  return row;
33
50
  });
34
51
  try{
35
- fs.mkdirSync(path.dirname(outfile));
52
+ makdir(path.dirname(outfile));
36
53
  }catch(e){
37
54
  //nothin to do
38
55
  }
39
56
  down.push(file);
40
57
  fs.writeFileSync(outfile, fileData, {flag: "w+"});
41
- }
58
+ }
59
+ function makdir(pathName){
60
+ if (fs.existsSync(pathName)) return;
61
+ makdir(path.dirname(pathName));
62
+ fs.mkdirSync(pathName);
63
+ }