@simpoobusiness/sdk 2.0.87 → 2.0.88
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/README.md +24 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/embed.d.ts +4 -2
- package/dist/simpoo-sdk.js +1 -1
- package/dist/simpoo-sdk.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,19 +67,27 @@ SimpooSDK.init({
|
|
|
67
67
|
|
|
68
68
|
---
|
|
69
69
|
|
|
70
|
-
### **SimpooSDK.renderWidget(widget_name,
|
|
70
|
+
### **SimpooSDK.renderWidget(widget_name, target, [props])**
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Renders a specific widget into a target container.
|
|
73
73
|
|
|
74
74
|
**Parameters:**
|
|
75
75
|
|
|
76
|
-
- `widget_name` (string) –
|
|
77
|
-
- `
|
|
76
|
+
- `widget_name` (string) – Name of the widget to render. Options: `"inventory"`, `"sales_report"`.
|
|
77
|
+
- `target` (string | Element) – CSS selector for the container OR a direct DOM Element.
|
|
78
|
+
- `props` (object, optional) – Additional props to pass to the widget.
|
|
79
|
+
|
|
80
|
+
**Returns:**
|
|
81
|
+
An object containing lifecycle methods:
|
|
82
|
+
- `unmount()` – Properly destroys the React root and removes the widget from the DOM.
|
|
78
83
|
|
|
79
84
|
**Example: Render Inventory Widget**
|
|
80
85
|
|
|
81
86
|
```js
|
|
82
|
-
SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
87
|
+
const widget = await SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
88
|
+
|
|
89
|
+
// Later, if you need to remove it:
|
|
90
|
+
widget.unmount();
|
|
83
91
|
```
|
|
84
92
|
|
|
85
93
|
**Example: Render Sales Report Widget**
|
|
@@ -88,6 +96,17 @@ SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
|
88
96
|
SimpooSDK.renderWidget("sales_report", "#sales-report-widget");
|
|
89
97
|
```
|
|
90
98
|
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### **SimpooSDK.version**
|
|
102
|
+
|
|
103
|
+
Returns the current version of the SDK.
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
console.log(SimpooSDK.version); // e.g., "2.0.88"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
|
|
91
110
|
---
|
|
92
111
|
|
|
93
112
|
## 🔍 Troubleshooting
|