lowcoder-comps 0.0.31 → 0.0.32

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 (86) hide show
  1. package/1e5cb9c2.js +447 -0
  2. package/24307cf2.js +25 -0
  3. package/256b619e.js +92 -0
  4. package/2b031be2.js +2967 -0
  5. package/2ff2c7a6.js +6 -0
  6. package/2ff7471d.js +9 -0
  7. package/444e09f1.js +268 -0
  8. package/4564a1bc.js +86 -0
  9. package/4a489df6.js +8 -0
  10. package/4a860f5d.js +505 -0
  11. package/4cc9caa5.js +2501 -0
  12. package/64d87c95.js +1536 -0
  13. package/6deaf0be.js +881 -0
  14. package/794e64d5.js +208 -0
  15. package/7a3f27e4.js +391 -0
  16. package/7ae6dd1c.js +319 -0
  17. package/92e85b65.js +65 -0
  18. package/97059d88.js +237 -0
  19. package/98955949.js +134435 -0
  20. package/a408f817.js +796 -0
  21. package/a40faea7.js +11624 -0
  22. package/a969f4ca.js +48428 -0
  23. package/aa1becc7.js +455 -0
  24. package/aa82b740.js +1269 -0
  25. package/c289b0aa.js +1102 -0
  26. package/c4d99b09.js +5 -0
  27. package/c9bb75eb.js +960 -0
  28. package/cb40fdd9.js +933 -0
  29. package/cc799554.js +1276 -0
  30. package/d3700d97.js +2284 -0
  31. package/d622fb26.js +818 -0
  32. package/d8c50a91.js +34 -0
  33. package/dce9fa3f.js +769 -0
  34. package/de8c90a7.js +1284 -0
  35. package/debd9490.js +819 -0
  36. package/df803461.js +220 -0
  37. package/e06dcfb0.js +1089 -0
  38. package/e6388bfd.js +915 -0
  39. package/ee801edf.js +804 -0
  40. package/f7c6b13d.js +19104 -0
  41. package/f8b68c1a.js +1127 -0
  42. package/f9637058.js +16 -0
  43. package/fcee2d3c.js +64 -0
  44. package/fd51bb2f.js +1579 -0
  45. package/index.js +5 -0
  46. package/package.json +4 -3
  47. package/README.md +0 -120
  48. package/index.html +0 -26
  49. package/index.tsx +0 -21
  50. package/jest.config.js +0 -6
  51. package/src/__test__/allComp.test.tsx +0 -61
  52. package/src/app-env.d.ts +0 -3
  53. package/src/comps/calendarComp/calendarComp.tsx +0 -633
  54. package/src/comps/calendarComp/calendarConstants.tsx +0 -1048
  55. package/src/comps/calendarComp/errorBoundary.tsx +0 -30
  56. package/src/comps/chartComp/chartComp.tsx +0 -442
  57. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +0 -51
  58. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +0 -307
  59. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +0 -9
  60. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +0 -55
  61. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +0 -96
  62. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +0 -83
  63. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +0 -62
  64. package/src/comps/chartComp/chartConstants.tsx +0 -299
  65. package/src/comps/chartComp/chartPropertyView.tsx +0 -235
  66. package/src/comps/chartComp/chartUtils.ts +0 -291
  67. package/src/comps/chartComp/reactEcharts/core.tsx +0 -194
  68. package/src/comps/chartComp/reactEcharts/index.ts +0 -21
  69. package/src/comps/chartComp/reactEcharts/types.ts +0 -76
  70. package/src/comps/chartComp/seriesComp.tsx +0 -119
  71. package/src/comps/imageEditorComp/imageEditorClass.tsx +0 -52
  72. package/src/comps/imageEditorComp/imageEditorConstants.tsx +0 -109
  73. package/src/comps/imageEditorComp/index.tsx +0 -184
  74. package/src/comps/mermaidComp/index.tsx +0 -44
  75. package/src/comps/mermaidComp/mermaid.tsx +0 -29
  76. package/src/global.ts +0 -1
  77. package/src/i18n/comps/index.tsx +0 -29
  78. package/src/i18n/comps/locales/en.ts +0 -163
  79. package/src/i18n/comps/locales/enObj.tsx +0 -198
  80. package/src/i18n/comps/locales/index.ts +0 -7
  81. package/src/i18n/comps/locales/types.tsx +0 -10
  82. package/src/i18n/comps/locales/zh.ts +0 -156
  83. package/src/i18n/comps/locales/zhObj.tsx +0 -4
  84. package/src/index.ts +0 -11
  85. package/tsconfig.json +0 -22
  86. package/vite.config.js +0 -10
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="lowcoder-comps-0.0.32",e.appendChild(document.createTextNode("")),document.head.appendChild(e)}}catch(c){console.error("vite-plugin-css-injected-by-js",c)}})();
2
+ import { b8 as f } from "./98955949.js";
3
+ export {
4
+ f as default
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lowcoder-comps",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -64,7 +64,8 @@
64
64
  "h": 40
65
65
  }
66
66
  }
67
- }
67
+ },
68
+ "entry": "index.js"
68
69
  },
69
70
  "scripts": {
70
71
  "start": "NODE_OPTIONS=--max_old_space_size=6144 vite",
@@ -78,4 +79,4 @@
78
79
  "vite": "^5.0.12",
79
80
  "vite-tsconfig-paths": "^3.6.0"
80
81
  }
81
- }
82
+ }
package/README.md DELETED
@@ -1,120 +0,0 @@
1
- # Lowcoder Extra Components
2
-
3
- This is the workspace for Lowcoder Extra Components like Calendar, Image Editor, Mermaid Charts and eCharts.
4
-
5
- ## Local Development preparation
6
-
7
- Navigate your terminal or bash to your /root folder (lowcoder repository) to install Lowcoder Extra Components dependencies and the Lowcoder SDK
8
-
9
- To develop with the Lowcoder Extra Components after you clone the Lowcoder Repository, first make sure the Lowcoder SDK is local built.
10
-
11
- ```bash
12
- cd client/packages/lowcoder-sdk
13
- yarn build
14
- ```
15
-
16
- ## Start
17
-
18
- Now you can start the local dev server for Lowcoder Extra Components to develop and add your Component Plugin
19
-
20
- ```bash
21
- cd client/packages/lowcoder-comps
22
- yarn start
23
- ```
24
-
25
- The local dev server will build for roughly a minute and open then a Browser Window on http://localhost:9000/ with the Lowcoder Component Builder.
26
-
27
- ## Local development
28
-
29
- After the local dev server is started, the Lowcoder Component Builder is prepared. A new browser window should open at http://localhost:9000 This is the Components Preview, which allows you to see your new component in action, as it would work in the Lowcoder Editor.
30
-
31
- Data, methods and properties are visible and interactive, so you can test your Component during development. The view will get automatically refreshed.
32
-
33
- The Lowcoder Component Builder makes the development & publishing of multiple individual components as bundle possible. Find the /src/comps folder in /lowcoder-comps. Here are existing components to find. It is suggested for new components to create a new folder. In the left navigation of the Components Preview you can switch between your components.
34
-
35
- to see your component and include it in the processing on the development server, you have to do the folloiwing steps:
36
-
37
- ### modify /lowcoder-comps/package.json
38
-
39
- ```JSON
40
- "yournewcomponent": {
41
- "name": "Your new Component name",
42
- "icon": "./icons/your-icon.svg",
43
- "description": "A Component Plugin to ...",
44
- "category": "itemHandling",
45
- "layoutInfo": {
46
- "w": 6,
47
- "h": 30
48
- }
49
- }
50
- ```
51
-
52
-
53
- Please choose one category out of:
54
-
55
- - dashboards
56
- - layout
57
- - forms
58
- - collaboration
59
- - projectmanagement
60
- - scheduling
61
- - documents
62
- - itemHandling
63
- - multimedia
64
- - integration
65
-
66
- layoutInfo helps you to define the size (in grid-cells) of your Component in the grid for the very first moment, when a user drags your Component out of the components display on the right side in the Lowcoder Editor.
67
-
68
- ### modify /lowcoder-comps/src/index.ts
69
-
70
- ```JavaScript
71
- Add your Component for the exported members of Lowcoder Extra Components
72
-
73
- import { ChartCompWithDefault } from "./comps/chartComp/chartComp";
74
- import { ImageEditorComp } from "./comps/imageEditorComp/index";
75
- import { CalendarComp } from "./comps/calendarComp/calendarComp";
76
- import { MermaidComp } from "comps/mermaidComp";
77
-
78
- import { YourComponent } from "comps/yourComponentFolder/yourComponent";
79
-
80
- export default {
81
- chart: ChartCompWithDefault,
82
- imageEditor: ImageEditorComp,
83
- calendar: CalendarComp,
84
- mermaid: MermaidComp,
85
-
86
- yourcomponent: YourComponent,
87
- };
88
- ```
89
- Now your Plugin should be visibe and displayed in the Lowcoder Component Builder at http://localhost:9000/
90
-
91
- ## Build
92
-
93
- When you finish development and all tests, you can build the Components to use it in runtime.
94
-
95
- This will build the current Component Plugins into a .tgz file that you can upload.
96
-
97
- **Before build you should change the version in package.json file.**
98
-
99
- ```bash
100
- yarn build
101
-
102
- # or
103
-
104
- npm run build
105
- ```
106
-
107
- ## How to publish a Component Plugin
108
-
109
- With the following command you can publish the script to the NPM repository:
110
-
111
- ```bash
112
- yarn build --publish
113
- ```
114
-
115
- This command will publis the whole Lowcoder Extra Components bundle to [NPMjs](https://www.npmjs.com/)
116
- Make sure, you updated the Version of Lowcoder Comps before in /lowcoder-comps/package.json
117
-
118
- ## Contribute your Plugin
119
-
120
- If you wish to contribute your plugin and persist it as general Lowcoder Extra Component, please raise a PR to our /dev branch in the Lowcoder Community-Edition Repository https://github.com/lowcoder-org/lowcoder
package/index.html DELETED
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Lowcoder Comp Playground</title>
8
- <style>
9
- #root {
10
- height: 100vh;
11
- }
12
- #root-loader {
13
- height: 100vh;
14
- display: flex;
15
- justify-content: center;
16
- align-items: center;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div id="root">
22
- <div id="root-loader">Loading...</div>
23
- </div>
24
- <script src="index.tsx" type="module"></script>
25
- </body>
26
- </html>
package/index.tsx DELETED
@@ -1,21 +0,0 @@
1
- import { createRoot } from "react-dom/client";
2
- import { CompIDE } from "lowcoder-sdk";
3
- import { name, version, lowcoder } from "./package.json";
4
- import compMap from "./src/index";
5
-
6
- import "lowcoder-sdk/dist/style.css";
7
-
8
- function CompDevApp() {
9
- return (
10
- <CompIDE
11
- compMap={compMap}
12
- packageName={name}
13
- packageVersion={version}
14
- compMeta={lowcoder.comps}
15
- />
16
- );
17
- }
18
-
19
- const container = document.querySelector("#root");
20
- const root = createRoot(container!);
21
- root.render(<CompDevApp />);
package/jest.config.js DELETED
@@ -1,6 +0,0 @@
1
- import config from "../../config/test/jest.config.js";
2
-
3
- export default {
4
- ...config,
5
- setupFiles: [...config.setupFiles],
6
- };
@@ -1,61 +0,0 @@
1
- import _ from "lodash";
2
- import { CompConstructor, CustomAction } from "lowcoder-core";
3
- import { evalAndReduce, isExposingMethodComp } from "lowcoder-sdk";
4
- import { ChartCompWithDefault } from "comps/chartComp/chartComp";
5
- import log from "loglevel";
6
-
7
- const COMPS_MAP = {
8
- chart: ChartCompWithDefault,
9
- } as Record<string, CompConstructor>;
10
-
11
- const compContextActionMap = {} as Record<string, CustomAction>;
12
-
13
- test("test comp don't change if no value change", () => {
14
- Object.keys(COMPS_MAP).forEach((name) => {
15
- const Comp = COMPS_MAP[name];
16
- let comp = new Comp({});
17
- if (compContextActionMap[name]) {
18
- // set context
19
- comp = comp.reduce(compContextActionMap[name]);
20
- }
21
- comp.getView(); // getView() is allowed when unevaluated
22
- comp = evalAndReduce(comp);
23
- expect(comp.node() === comp.node()).toBe(true);
24
- expect(comp.node()?.evaluate() === comp.node()?.evaluate()).toBe(true);
25
- const comp2 = evalAndReduce(comp);
26
- if (comp2 !== comp) {
27
- const comp3 = evalAndReduce(comp2);
28
- if (comp3 === comp2) {
29
- // log.debug(`${name} need eval twice to converge`);
30
- } else {
31
- const newComp = evalAndReduce(comp);
32
- Object.keys((comp as any).children).forEach((key) => {
33
- log.log(
34
- `${key}, isEqual ${(comp as any).children[key] === (newComp as any).children[key]}`
35
- );
36
- });
37
- throw new Error("bad " + name);
38
- }
39
- }
40
- });
41
- });
42
-
43
- test("comp exposing method duplicate name", () => {
44
- // one comp can't expose two methods with the same name
45
- Object.values(COMPS_MAP).forEach((Comp) => {
46
- const comp = new Comp({});
47
- const methods = [];
48
- if (isExposingMethodComp(comp)) {
49
- methods.push(comp.getMethodConfig());
50
- }
51
- const childrenMap = (comp as any).children;
52
- childrenMap &&
53
- Object.values(childrenMap).forEach((child) => {
54
- if (isExposingMethodComp(child as any)) {
55
- methods.push((child as any).getMethodConfig());
56
- }
57
- });
58
- const allMethodName = methods.flatMap((m) => m.map((methodConfig) => methodConfig.name));
59
- expect(allMethodName.length).toEqual(_.uniq(allMethodName).length);
60
- });
61
- });
package/src/app-env.d.ts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference types="lowcoder-cli/client" />
2
-
3
- declare module "lowcoder-sdk";