Repository navigation
Expand file tree
/
Copy pathiframe.js
More file actions
75 lines (68 loc) · 2.41 KB
/
Copy pathiframe.js
File metadata and controls
75 lines (68 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import {css, html, LitElement, styleMap} from 'https://cdn.jsdelivr.net/gh/lit/dist@2/all/lit-all.min.js';
export class Iframe extends LitElement {
// Define scoped styles right with your component, in plain CSS
static styles = css` //Add custom CSS. See https://help.nintex.com/en-US/formplugins/Reference/Style.htm
:host {
height: 100%;
width: 100%;
display: block;
}
.frame {
display: inline-block;
height: 100%;
width: 100%;
background-color: transparent;
border: none;
}
`;
static getMetaConfig() {
// plugin contract information
return {
controlName: 'IFrame',
fallbackDisableSubmit: false,
description: 'IFrame component',
iconUrl: "one-line-text",
groupName: 'Visual',
version: '1.0',
properties: { //Custom configuration fields. See https://help.nintex.com/en-US/formplugins/Reference/CustomField.htm
src: {
type: 'string',
title: 'Source URL',
description: 'URL of the iframe, please note many sites block render in iframes'
},
height: {
type: 'string',
title: 'Height',
description: 'Height of the component',
}
},
standardProperties: {
readOnly: true, //Add a read-only mode. See https://help.nintex.com/en-US/formplugins/Reference/ReadOnly.htm
required: true,
description: true,
}
};
}
static properties = {
name: 'Wikipedia',
title: 'Wikipedia',
src: 'https://www.wikipedia.org/',
height: '100%'
}
// Render the UI as a function of component state
render() {
let styles = {height: this.height};
return html`
<iframe
class="frame"
style=${styleMap(styles)}
name=${this.name}
allow="geolocation *; microphone; camera"
title=${this.title}
src=${this.src}
></iframe>`;
}
}
// registering the web component.
const elementName = 'iframe';
customElements.define(elementName, Iframe);