@apteva/apteva-kit 0.1.80 → 0.1.81
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/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -85,7 +85,7 @@ interface ListItem {
|
|
|
85
85
|
subtitle?: string;
|
|
86
86
|
description?: string;
|
|
87
87
|
image?: string;
|
|
88
|
-
|
|
88
|
+
meta?: Record<string, any>;
|
|
89
89
|
backgroundColor?: string;
|
|
90
90
|
}
|
|
91
91
|
interface ChartWidget extends Widget {
|
|
@@ -192,8 +192,8 @@ declare const WIDGET_DEFINITIONS: {
|
|
|
192
192
|
readonly example: "@ui:card[{\"title\": \"Summary\", \"description\": \"Details here\"}]";
|
|
193
193
|
};
|
|
194
194
|
readonly list: {
|
|
195
|
-
readonly schema: "items: [{id, title, subtitle?, description
|
|
196
|
-
readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\"}]}]";
|
|
195
|
+
readonly schema: "items: [{id, title, subtitle?, description?, image?, meta?: {any extra data}}], actions?: [{type, label}] - meta is sent as action payload when clicked";
|
|
196
|
+
readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\", \"meta\": {\"key\": \"value\"}}]}]";
|
|
197
197
|
};
|
|
198
198
|
readonly button_group: {
|
|
199
199
|
readonly schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits";
|
package/dist/index.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ interface ListItem {
|
|
|
85
85
|
subtitle?: string;
|
|
86
86
|
description?: string;
|
|
87
87
|
image?: string;
|
|
88
|
-
|
|
88
|
+
meta?: Record<string, any>;
|
|
89
89
|
backgroundColor?: string;
|
|
90
90
|
}
|
|
91
91
|
interface ChartWidget extends Widget {
|
|
@@ -192,8 +192,8 @@ declare const WIDGET_DEFINITIONS: {
|
|
|
192
192
|
readonly example: "@ui:card[{\"title\": \"Summary\", \"description\": \"Details here\"}]";
|
|
193
193
|
};
|
|
194
194
|
readonly list: {
|
|
195
|
-
readonly schema: "items: [{id, title, subtitle?, description
|
|
196
|
-
readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\"}]}]";
|
|
195
|
+
readonly schema: "items: [{id, title, subtitle?, description?, image?, meta?: {any extra data}}], actions?: [{type, label}] - meta is sent as action payload when clicked";
|
|
196
|
+
readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\", \"meta\": {\"key\": \"value\"}}]}]";
|
|
197
197
|
};
|
|
198
198
|
readonly button_group: {
|
|
199
199
|
readonly schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits";
|
package/dist/index.js
CHANGED
|
@@ -739,8 +739,8 @@ var WIDGET_DEFINITIONS = {
|
|
|
739
739
|
example: '@ui:card[{"title": "Summary", "description": "Details here"}]'
|
|
740
740
|
},
|
|
741
741
|
list: {
|
|
742
|
-
schema: "items: [{id, title, subtitle?, description
|
|
743
|
-
example: '@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info"}]}]'
|
|
742
|
+
schema: "items: [{id, title, subtitle?, description?, image?, meta?: {any extra data}}], actions?: [{type, label}] - meta is sent as action payload when clicked",
|
|
743
|
+
example: '@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info", "meta": {"key": "value"}}]}]'
|
|
744
744
|
},
|
|
745
745
|
button_group: {
|
|
746
746
|
schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits",
|
|
@@ -782,7 +782,7 @@ WRONG: @ui:list{"items": [...]} (missing square brackets)
|
|
|
782
782
|
`;
|
|
783
783
|
}
|
|
784
784
|
context += `
|
|
785
|
-
|
|
785
|
+
Per-item "meta" is sent as payload on action click.
|
|
786
786
|
`;
|
|
787
787
|
return context;
|
|
788
788
|
}
|
|
@@ -872,7 +872,7 @@ function List({ widget, onAction }) {
|
|
|
872
872
|
{
|
|
873
873
|
onClick: () => _optionalChain([onAction, 'optionalCall', _3 => _3({
|
|
874
874
|
type: action.type,
|
|
875
|
-
payload: item.
|
|
875
|
+
payload: item.meta || item,
|
|
876
876
|
widgetId: widget.id,
|
|
877
877
|
timestamp: /* @__PURE__ */ new Date()
|
|
878
878
|
})]),
|