@digipair/skill-web-interact 0.4.30 → 0.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.
package/index.cjs.js
CHANGED
|
@@ -17,6 +17,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
17
17
|
element.requestUpdate();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
async getAttribute(params, _pinsSettingsList, _context) {
|
|
21
|
+
const { selector, attribute } = params;
|
|
22
|
+
const element = document.querySelector(selector);
|
|
23
|
+
var _element_attribute;
|
|
24
|
+
return (_element_attribute = element[attribute]) != null ? _element_attribute : element.getAttribute(attribute);
|
|
25
|
+
}
|
|
20
26
|
async dispatchEvent(params, _pinsSettingsList, _context) {
|
|
21
27
|
const { selector, name, detail } = params;
|
|
22
28
|
const element = document.querySelector(selector);
|
|
@@ -30,9 +36,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
const setAttribute = (params, pinsSettingsList, context)=>new DomService().setAttribute(params, pinsSettingsList, context);
|
|
39
|
+
const getAttribute = (params, pinsSettingsList, context)=>new DomService().getAttribute(params, pinsSettingsList, context);
|
|
33
40
|
const dispatchEvent = (params, pinsSettingsList, context)=>new DomService().dispatchEvent(params, pinsSettingsList, context);
|
|
34
41
|
const goTo = (params, pinsSettingsList, context)=>new DomService().goTo(params, pinsSettingsList, context);
|
|
35
42
|
|
|
36
43
|
exports.dispatchEvent = dispatchEvent;
|
|
44
|
+
exports.getAttribute = getAttribute;
|
|
37
45
|
exports.goTo = goTo;
|
|
38
46
|
exports.setAttribute = setAttribute;
|
package/index.esm.js
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
element.requestUpdate();
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
async getAttribute(params, _pinsSettingsList, _context) {
|
|
17
|
+
const { selector, attribute } = params;
|
|
18
|
+
const element = document.querySelector(selector);
|
|
19
|
+
var _element_attribute;
|
|
20
|
+
return (_element_attribute = element[attribute]) != null ? _element_attribute : element.getAttribute(attribute);
|
|
21
|
+
}
|
|
16
22
|
async dispatchEvent(params, _pinsSettingsList, _context) {
|
|
17
23
|
const { selector, name, detail } = params;
|
|
18
24
|
const element = document.querySelector(selector);
|
|
@@ -26,7 +32,8 @@
|
|
|
26
32
|
}
|
|
27
33
|
};
|
|
28
34
|
const setAttribute = (params, pinsSettingsList, context)=>new DomService().setAttribute(params, pinsSettingsList, context);
|
|
35
|
+
const getAttribute = (params, pinsSettingsList, context)=>new DomService().getAttribute(params, pinsSettingsList, context);
|
|
29
36
|
const dispatchEvent = (params, pinsSettingsList, context)=>new DomService().dispatchEvent(params, pinsSettingsList, context);
|
|
30
37
|
const goTo = (params, pinsSettingsList, context)=>new DomService().goTo(params, pinsSettingsList, context);
|
|
31
38
|
|
|
32
|
-
export { dispatchEvent, goTo, setAttribute };
|
|
39
|
+
export { dispatchEvent, getAttribute, goTo, setAttribute };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PinsSettings } from '@digipair/engine';
|
|
2
2
|
export declare const setAttribute: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
3
|
+
export declare const getAttribute: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
3
4
|
export declare const dispatchEvent: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
4
5
|
export declare const goTo: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"post": {
|
|
50
50
|
"tags": ["web", "boost"],
|
|
51
51
|
"summary": "Modifier un attribute",
|
|
52
|
-
"description": "Permet de modifier la valeur d'un attribut d'un élément du DOM
|
|
52
|
+
"description": "Permet de modifier la valeur d'un attribut d'un élément du DOM",
|
|
53
53
|
"parameters": [
|
|
54
54
|
{
|
|
55
55
|
"name": "selector",
|
|
@@ -82,6 +82,34 @@
|
|
|
82
82
|
"x-events": []
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
+
"/getAttribute": {
|
|
86
|
+
"post": {
|
|
87
|
+
"tags": ["web"],
|
|
88
|
+
"summary": "Lire un attribute",
|
|
89
|
+
"description": "Permet de lire la valeur d'un attribut d'un élément du DOM",
|
|
90
|
+
"parameters": [
|
|
91
|
+
{
|
|
92
|
+
"name": "selector",
|
|
93
|
+
"summary": "Sélecteur CSS de l'élément",
|
|
94
|
+
"required": true,
|
|
95
|
+
"description": "Sélecteur CSS de l'élément",
|
|
96
|
+
"schema": {
|
|
97
|
+
"type": "string"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "attribute",
|
|
102
|
+
"summary": "Attribut",
|
|
103
|
+
"required": true,
|
|
104
|
+
"description": "Attribut à modifier",
|
|
105
|
+
"schema": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"x-events": []
|
|
111
|
+
}
|
|
112
|
+
},
|
|
85
113
|
"/goTo": {
|
|
86
114
|
"post": {
|
|
87
115
|
"tags": ["web", "boost"],
|