@3t-transform/threeteeui 0.1.43 → 0.1.45
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/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/{domsanitiser.options-975e3317.js → domsanitiser.options-b2d88e35.js} +16 -30
- package/dist/cjs/{index-457ca775.js → index-1a35850c.js} +62 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +24 -24
- package/dist/cjs/tttx-dialog-box.cjs.entry.js +81 -0
- package/dist/cjs/tttx-filter.cjs.entry.js +177 -177
- package/dist/cjs/tttx-form.cjs.entry.js +459 -458
- package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +59 -59
- package/dist/cjs/tttx-list.cjs.entry.js +33 -32
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
- package/dist/cjs/tttx-qrcode.cjs.entry.js +37 -0
- package/dist/cjs/tttx-sorter.cjs.entry.js +102 -102
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +79 -79
- package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +109 -109
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.css +0 -0
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.js +74 -0
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.stories.js +22 -0
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.css +146 -0
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +172 -0
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +380 -0
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +369 -369
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +72 -72
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -61
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +479 -479
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +272 -272
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
- package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +224 -224
- package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
- package/dist/collection/components/palette.stories.js +7 -7
- package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
- package/dist/collection/icons.js +2838 -2838
- package/dist/collection/index.js +1 -1
- package/dist/collection/shared/domsanitiser.options.js +14 -14
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/domsanitiser.options.js +13 -27
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/tttx-button.js +1 -54
- package/dist/components/tttx-button2.js +56 -0
- package/dist/components/tttx-dialog-box.d.ts +11 -0
- package/dist/components/tttx-dialog-box.js +110 -0
- package/dist/components/tttx-filter.js +210 -210
- package/dist/components/tttx-form.js +475 -475
- package/dist/components/tttx-icon2.js +28 -28
- package/dist/components/tttx-keyvalue-block.js +76 -76
- package/dist/components/tttx-list.js +53 -53
- package/dist/components/tttx-loading-spinner.js +33 -33
- package/dist/components/tttx-qrcode.d.ts +11 -0
- package/dist/components/tttx-qrcode.js +53 -0
- package/dist/components/tttx-sorter.js +130 -130
- package/dist/components/tttx-standalone-input.js +130 -130
- package/dist/components/tttx-toolbar.js +26 -26
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/{domsanitiser.options-3c7ded83.js → domsanitiser.options-81611f82.js} +13 -27
- package/dist/esm/{index-d784fb3e.js → index-a848bfb4.js} +62 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/tttx-button.entry.js +24 -24
- package/dist/esm/tttx-dialog-box.entry.js +77 -0
- package/dist/esm/tttx-filter.entry.js +177 -177
- package/dist/esm/tttx-form.entry.js +459 -458
- package/dist/esm/tttx-icon.entry.js +11 -11
- package/dist/esm/tttx-keyvalue-block.entry.js +59 -59
- package/dist/esm/tttx-list.entry.js +33 -32
- package/dist/esm/tttx-loading-spinner.entry.js +16 -16
- package/dist/esm/tttx-qrcode.entry.js +33 -0
- package/dist/esm/tttx-sorter.entry.js +102 -102
- package/dist/esm/tttx-standalone-input.entry.js +79 -79
- package/dist/esm/tttx-toolbar.entry.js +10 -10
- package/dist/esm/tttx.js +3 -3
- package/dist/tttx/p-0b25ac9c.js +3 -0
- package/dist/tttx/p-112455b1.js +1 -0
- package/dist/tttx/{p-b720c4ad.entry.js → p-120a0732.entry.js} +1 -1
- package/dist/tttx/p-2d130f82.entry.js +1 -0
- package/dist/tttx/{p-aaf02902.entry.js → p-42349ae5.entry.js} +1 -1
- package/dist/tttx/{p-92cade7f.entry.js → p-623b9147.entry.js} +1 -1
- package/dist/tttx/{p-cac26a1b.entry.js → p-7428fc97.entry.js} +1 -1
- package/dist/tttx/{p-ab6ce9f6.entry.js → p-77fb8e0f.entry.js} +1 -1
- package/dist/tttx/p-83563ce9.entry.js +1 -0
- package/dist/tttx/p-a092cd71.entry.js +1 -0
- package/dist/tttx/p-ab4652a8.js +2 -0
- package/dist/tttx/p-af7ff3b3.entry.js +1 -0
- package/dist/tttx/{p-563605b2.entry.js → p-d0ca435d.entry.js} +1 -1
- package/dist/tttx/{p-798a098a.entry.js → p-d2b0ec0a.entry.js} +1 -1
- package/dist/tttx/{p-ec253eea.entry.js → p-e1efb888.entry.js} +1 -1
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
- package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
- package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
- package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.d.ts +6 -0
- package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.stories.d.ts +23 -0
- package/dist/types/components/molecules/tttx-dialog-box/interfaces.d.ts +25 -0
- package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.d.ts +18 -0
- package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.d.ts +23 -0
- package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +41 -41
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +133 -133
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
- package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +19 -19
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
- package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
- package/dist/types/components/palette.stories.d.ts +6 -6
- package/dist/types/components.d.ts +41 -0
- package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
- package/dist/types/icons.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/domsanitiser.options.d.ts +10 -10
- package/package.json +7 -5
- package/readme.md +19 -7
- package/dist/tttx/p-0ebffdfc.js +0 -2
- package/dist/tttx/p-1db3704e.entry.js +0 -1
- package/dist/tttx/p-350ddb03.js +0 -3
- package/dist/tttx/p-f702df4f.entry.js +0 -1
- package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +0 -70
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +0 -278
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +0 -14
- package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +0 -30
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { QRCode, QRErrorCorrectLevel } from 'ts-qrcode';
|
|
4
|
+
export class TttxQrCode {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.link = 'https://example.com';
|
|
7
|
+
this.size = 258;
|
|
8
|
+
}
|
|
9
|
+
componentDidRender() {
|
|
10
|
+
const options = {
|
|
11
|
+
width: this.size,
|
|
12
|
+
height: this.size,
|
|
13
|
+
correctLevel: QRErrorCorrectLevel.H,
|
|
14
|
+
background: '#ffffff',
|
|
15
|
+
foreground: '#000000',
|
|
16
|
+
text: this.link,
|
|
17
|
+
};
|
|
18
|
+
QRCode.setCanvas('qrcode', options);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return h("div", { id: "qrcode" });
|
|
22
|
+
}
|
|
23
|
+
static get is() { return "tttx-qrcode"; }
|
|
24
|
+
static get originalStyleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["tttx-qrcode.scss"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get styleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["tttx-qrcode.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get properties() {
|
|
35
|
+
return {
|
|
36
|
+
"link": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"mutable": true,
|
|
39
|
+
"complexType": {
|
|
40
|
+
"original": "string",
|
|
41
|
+
"resolved": "string",
|
|
42
|
+
"references": {}
|
|
43
|
+
},
|
|
44
|
+
"required": false,
|
|
45
|
+
"optional": false,
|
|
46
|
+
"docs": {
|
|
47
|
+
"tags": [],
|
|
48
|
+
"text": ""
|
|
49
|
+
},
|
|
50
|
+
"attribute": "link",
|
|
51
|
+
"reflect": false,
|
|
52
|
+
"defaultValue": "'https://example.com'"
|
|
53
|
+
},
|
|
54
|
+
"size": {
|
|
55
|
+
"type": "number",
|
|
56
|
+
"mutable": true,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "number",
|
|
59
|
+
"resolved": "number",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": ""
|
|
67
|
+
},
|
|
68
|
+
"attribute": "size",
|
|
69
|
+
"reflect": false,
|
|
70
|
+
"defaultValue": "258"
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Atoms/QRCode',
|
|
3
|
+
component: 'tttx-qrcode',
|
|
4
|
+
argTypes: {
|
|
5
|
+
url: {
|
|
6
|
+
control: { type: 'text' },
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
control: 'number',
|
|
10
|
+
default: 258
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export const basicQRCode = args => {
|
|
15
|
+
const url = args.url;
|
|
16
|
+
const size = args.size;
|
|
17
|
+
return `<tttx-qrcode link='${url}' size='${size}'></tttx-qrcode>`;
|
|
18
|
+
};
|
|
19
|
+
basicQRCode.args = {
|
|
20
|
+
url: 'https://example.com',
|
|
21
|
+
size: 258
|
|
22
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.material-symbols-rounded {
|
|
6
|
+
font-family: "Material Symbols Rounded", sans-serif;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-size: 24px;
|
|
10
|
+
line-height: 1;
|
|
11
|
+
letter-spacing: normal;
|
|
12
|
+
text-transform: none;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
word-wrap: normal;
|
|
16
|
+
direction: ltr;
|
|
17
|
+
text-rendering: optimizeLegibility;
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
color: #9e9e9e;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
h3 {
|
|
23
|
+
margin-block-start: 0em;
|
|
24
|
+
margin-block-end: 0em;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dialog-box {
|
|
28
|
+
background-color: #ffffff;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
border: 1px solid #d5d5d5;
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
box-shadow: 0px 1px 5px #1111114d;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dialog-box.small {
|
|
37
|
+
width: 400px;
|
|
38
|
+
min-height: 200px;
|
|
39
|
+
max-height: 500px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dialog-box.regular {
|
|
43
|
+
width: 600px;
|
|
44
|
+
min-height: 200px;
|
|
45
|
+
max-height: 500px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dialog-box.large {
|
|
49
|
+
width: 900px;
|
|
50
|
+
min-height: 200px;
|
|
51
|
+
max-height: 500px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dialog-box.mobile {
|
|
55
|
+
max-width: 424px;
|
|
56
|
+
max-height: 510px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dialog-box-clickable {
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dialog-box-padding {
|
|
64
|
+
padding: 8px 16px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.dialog-box-align-right {
|
|
68
|
+
margin-left: auto;
|
|
69
|
+
display: flex;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dialog-box-header-box {
|
|
73
|
+
border-bottom: 1px solid #d5d5d5;
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
height: 36px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.dialog-box-header {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
width: 100%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.dialog-box-title {
|
|
86
|
+
font-size: 18;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
font-family: "Roboto", serif;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.dialog-box-icon {
|
|
92
|
+
padding-right: 8px;
|
|
93
|
+
width: 24px;
|
|
94
|
+
height: 24px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.dialog-box-icon-close {
|
|
98
|
+
margin-left: auto;
|
|
99
|
+
padding-top: 3px;
|
|
100
|
+
width: 24px;
|
|
101
|
+
height: 24px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.dialog-box-content {
|
|
105
|
+
font-size: 16;
|
|
106
|
+
font-weight: 400;
|
|
107
|
+
font-family: "Roboto", serif;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.dialog-box-body-box {
|
|
111
|
+
padding: 16px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.dialog-box-footer-box {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: row;
|
|
117
|
+
margin-top: auto;
|
|
118
|
+
border-top: 1px solid #d5d5d5;
|
|
119
|
+
height: 36px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dialog-box-footer {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
width: 100%;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dialog-box-spacing-button {
|
|
129
|
+
margin-right: 8px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.dialog-box-header-box.info {
|
|
133
|
+
border-bottom: 1px solid #1479c6;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.dialog-box-header-box.success {
|
|
137
|
+
border-bottom: 1px solid #a2bb31;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.dialog-box-header-box.warning {
|
|
141
|
+
border-bottom: 1px solid #f59500;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.dialog-box-header-box.critical {
|
|
145
|
+
border-bottom: 1px solid #dc0000;
|
|
146
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import * as DOMPurify from 'dompurify';
|
|
4
|
+
import domSanitiserOptions from '../../../shared/domsanitiser.options';
|
|
5
|
+
export class TttxDialogBox {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.data = undefined;
|
|
8
|
+
this.size = 'regular';
|
|
9
|
+
this.elementSize = undefined;
|
|
10
|
+
}
|
|
11
|
+
handleResize() {
|
|
12
|
+
if (window.innerWidth < 698) {
|
|
13
|
+
this.elementSize = 'mobile';
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
this.elementSize = this.size;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
onCloseClickHandler() {
|
|
20
|
+
this.closeButtonClick.emit({ close: true });
|
|
21
|
+
}
|
|
22
|
+
onButtonClickHandler(index) {
|
|
23
|
+
this.buttonClick.emit({ buttonNumber: index, buttonClicked: true });
|
|
24
|
+
}
|
|
25
|
+
renderHeader(header) {
|
|
26
|
+
const title = header.title;
|
|
27
|
+
const iconName = header.iconName;
|
|
28
|
+
const iconColor = header.iconColor;
|
|
29
|
+
const iconEnabled = header.hasIcon ? true : false;
|
|
30
|
+
const closeEnabled = header.hasClose ? true : false;
|
|
31
|
+
return (h("div", { class: "dialog-box-header" }, iconEnabled && h("tttx-icon", { class: "dialog-box-icon", icon: iconName, color: iconColor }), h("h3", { class: "dialog-box-title" }, title), closeEnabled && (h("div", { class: "dialog-box-align-right close-button", onClick: () => this.onCloseClickHandler() }, h("tttx-icon", { class: "dialog-box-icon-close dialog-box-clickable", icon: "close", color: "black" })))));
|
|
32
|
+
}
|
|
33
|
+
renderContent(content) {
|
|
34
|
+
if (content.isCustomHtml) {
|
|
35
|
+
const cleanHTML = DOMPurify.sanitize(content.customHtml, domSanitiserOptions);
|
|
36
|
+
return (h("div", { class: "dialog-box-body" }, h("div", { innerHTML: cleanHTML })));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return (h("div", { class: "dialog-box-body" }, h("span", { class: "dialog-box-content" }, content.contentText)));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
renderFooter(footer) {
|
|
43
|
+
const button = footer.buttons;
|
|
44
|
+
const button1Enabled = button.length > 0;
|
|
45
|
+
const button2Enabled = button.length > 1;
|
|
46
|
+
const button3Enabled = button.length == 3;
|
|
47
|
+
const isMobile = this.elementSize === 'mobile';
|
|
48
|
+
return (h("div", { class: "dialog-box-footer" }, h("div", { class: "dialog-box-align-right" }, button3Enabled && (h("tttx-button", { class: "dialog-box-spacing-button", onClick: () => this.onButtonClickHandler(3), design: button[2].type, notext: isMobile, icon: button[2].icon }, !isMobile && button[2].name)), button2Enabled && (h("tttx-button", { class: "dialog-box-spacing-button", onClick: () => this.onButtonClickHandler(2), design: button[1].type, icon: button[1].icon }, button[1].name)), button1Enabled && (h("tttx-button", { onClick: () => this.onButtonClickHandler(1), design: button[0].type, icon: button[0].icon }, button[0].name)))));
|
|
49
|
+
}
|
|
50
|
+
componentWillLoad() {
|
|
51
|
+
if (window.innerWidth < 698) {
|
|
52
|
+
this.elementSize = 'mobile';
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.elementSize = this.size;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
if (!this.data)
|
|
60
|
+
return;
|
|
61
|
+
if (typeof this.data === 'string') {
|
|
62
|
+
this._data = JSON.parse(this.data);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this._data = this.data;
|
|
66
|
+
}
|
|
67
|
+
return (h("div", { class: `dialog-box ${this.elementSize}` }, h("div", { class: `dialog-box-padding dialog-box-header-box ${this._data.type || ''}` }, this.renderHeader(this._data.header)), h("div", { class: "dialog-box-padding dialog-box-body-box" }, this.renderContent(this._data.body)), h("div", { class: "dialog-box-padding dialog-box-footer-box" }, this.renderFooter(this._data.footer))));
|
|
68
|
+
}
|
|
69
|
+
static get is() { return "tttx-dialog-box"; }
|
|
70
|
+
static get encapsulation() { return "shadow"; }
|
|
71
|
+
static get originalStyleUrls() {
|
|
72
|
+
return {
|
|
73
|
+
"$": ["tttx-dialog-box.scss"]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
static get styleUrls() {
|
|
77
|
+
return {
|
|
78
|
+
"$": ["tttx-dialog-box.css"]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
static get properties() {
|
|
82
|
+
return {
|
|
83
|
+
"data": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"mutable": true,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "string | DialogItems",
|
|
88
|
+
"resolved": "DialogItems | string",
|
|
89
|
+
"references": {
|
|
90
|
+
"DialogItems": {
|
|
91
|
+
"location": "import",
|
|
92
|
+
"path": "./interfaces"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": ""
|
|
101
|
+
},
|
|
102
|
+
"attribute": "data",
|
|
103
|
+
"reflect": false
|
|
104
|
+
},
|
|
105
|
+
"size": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "'regular' | 'mobile' | 'large' | 'small'",
|
|
110
|
+
"resolved": "\"large\" | \"mobile\" | \"regular\" | \"small\"",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": ""
|
|
118
|
+
},
|
|
119
|
+
"attribute": "size",
|
|
120
|
+
"reflect": false,
|
|
121
|
+
"defaultValue": "'regular'"
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
static get states() {
|
|
126
|
+
return {
|
|
127
|
+
"elementSize": {}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static get events() {
|
|
131
|
+
return [{
|
|
132
|
+
"method": "closeButtonClick",
|
|
133
|
+
"name": "closeButtonClick",
|
|
134
|
+
"bubbles": true,
|
|
135
|
+
"cancelable": false,
|
|
136
|
+
"composed": true,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": ""
|
|
140
|
+
},
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "any",
|
|
143
|
+
"resolved": "any",
|
|
144
|
+
"references": {}
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
"method": "buttonClick",
|
|
148
|
+
"name": "buttonClick",
|
|
149
|
+
"bubbles": true,
|
|
150
|
+
"cancelable": true,
|
|
151
|
+
"composed": true,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": ""
|
|
155
|
+
},
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "any",
|
|
158
|
+
"resolved": "any",
|
|
159
|
+
"references": {}
|
|
160
|
+
}
|
|
161
|
+
}];
|
|
162
|
+
}
|
|
163
|
+
static get listeners() {
|
|
164
|
+
return [{
|
|
165
|
+
"name": "resize",
|
|
166
|
+
"method": "handleResize",
|
|
167
|
+
"target": "window",
|
|
168
|
+
"capture": false,
|
|
169
|
+
"passive": true
|
|
170
|
+
}];
|
|
171
|
+
}
|
|
172
|
+
}
|