saasufy-components 3.35.1 → 3.37.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.
- package/README.md +1 -0
- package/collection-browser.js +18 -0
- package/package.json +1 -1
- package/utils.js +2 -1
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ The following utility functions can be used anywhere inside template `{{expressi
|
|
|
85
85
|
- Remove leading and trailing spaces from text: `{{trim(' test ')}}`
|
|
86
86
|
- Specify one or more fallback values in case values are null or undefined: `{{fallback(Product.imageSrc, 'path/to/default-image.png')}}`
|
|
87
87
|
- Format UNIX timestamp as a human-readable date: `{{date(Product.updatedAt)}}`
|
|
88
|
+
- Make a string safe by escaping HTML characters: `{{safeString(Product.name)}}`
|
|
88
89
|
- Given an array of objects, extract the values from the specified field and join them together into a single comma-separated string: `{{joinFields(Product, 'name')}}`
|
|
89
90
|
|
|
90
91
|
### Special fields
|
package/collection-browser.js
CHANGED
|
@@ -22,6 +22,15 @@ class CollectionBrowser extends SocketConsumer {
|
|
|
22
22
|
event.stopPropagation();
|
|
23
23
|
if (this.collection) {
|
|
24
24
|
this.collection.create(event.detail);
|
|
25
|
+
this.dispatchEvent(
|
|
26
|
+
new CustomEvent('collectionCreate', {
|
|
27
|
+
detail: {
|
|
28
|
+
type: this.collection.type,
|
|
29
|
+
value: event.detail
|
|
30
|
+
},
|
|
31
|
+
bubbles: true
|
|
32
|
+
})
|
|
33
|
+
);
|
|
25
34
|
}
|
|
26
35
|
};
|
|
27
36
|
|
|
@@ -29,6 +38,15 @@ class CollectionBrowser extends SocketConsumer {
|
|
|
29
38
|
event.stopPropagation();
|
|
30
39
|
if (this.collection) {
|
|
31
40
|
this.collection.delete(event.detail);
|
|
41
|
+
this.dispatchEvent(
|
|
42
|
+
new CustomEvent('collectionDelete', {
|
|
43
|
+
detail: {
|
|
44
|
+
type: this.collection.type,
|
|
45
|
+
id: event.detail
|
|
46
|
+
},
|
|
47
|
+
bubbles: true
|
|
48
|
+
})
|
|
49
|
+
);
|
|
32
50
|
}
|
|
33
51
|
};
|
|
34
52
|
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -232,7 +232,8 @@ let templateFormatters = {
|
|
|
232
232
|
combineFilters: (filterMap, useOr) => {
|
|
233
233
|
return Object.values(filterMap || {}).join(useOr ? ' %OR% ' : ' %AND% ');
|
|
234
234
|
},
|
|
235
|
-
computeId
|
|
235
|
+
computeId,
|
|
236
|
+
safeString: toSafeHTML
|
|
236
237
|
};
|
|
237
238
|
|
|
238
239
|
let templateTripleTagsRegExp = /{{{.*?}}}/gs;
|