at-builder 1.0.11 → 1.1.1
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 +104 -1
- package/bin/index.js +0 -13
- package/package.json +1 -1
- package/puppeteer.js +1 -1
- package/webpack.config.js +27 -5
- package/.babelrc +0 -11
- package/.env +0 -6
- package/.eslintrc +0 -525
- package/.globals/css/abstract/color.scss +0 -28
- package/.globals/css/abstract/mixin.scss +0 -76
- package/.globals/css/base/common.scss +0 -184
- package/.globals/css/components/spinner.scss +0 -95
- package/.globals/services/analyticsHelper/index.ts +0 -82
- package/.globals/services/analyticsHelper/types.ts +0 -31
- package/.globals/services/domHandler.js +0 -36
- package/.globals/services/logger.js +0 -55
- package/.globals/services/observer.js +0 -46
- package/.globals/services/prebuiltEventHandler.js +0 -24
- package/.globals/services/utility.js +0 -207
- package/.globals/services/xmlhttp.interceptor.ts +0 -112
- package/.plop/constants/index.js +0 -11
- package/.plop/generators/actions.js +0 -82
- package/.plop/generators/components.js +0 -8
- package/.plop/generators/prompts.js +0 -31
- package/.plop/index.js +0 -5
- package/.plop/templates/analytics.hbs +0 -23
- package/.plop/templates/build-template.hbs +0 -7
- package/.plop/templates/component.cb.hbs +0 -34
- package/.plop/templates/constants.hbs +0 -7
- package/.plop/templates/index.hbs +0 -10
- package/.plop/templates/observer.hbs +0 -18
- package/.plop/templates/style.hbs +0 -3
- package/.plop/utils/index.js +0 -10
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
.ellipse {
|
|
2
|
-
text-overflow: ellipsis;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
white-space: nowrap;
|
|
5
|
-
}
|
|
6
|
-
.margin-0 {
|
|
7
|
-
margin: 0 !important;
|
|
8
|
-
}
|
|
9
|
-
.arrow-down {
|
|
10
|
-
border: solid $gs-23;
|
|
11
|
-
display: inline-block;
|
|
12
|
-
border-width: 0 3px 3px 0;
|
|
13
|
-
padding: 3px;
|
|
14
|
-
transform: rotate(45deg);
|
|
15
|
-
-webkit-transform: rotate(45deg);
|
|
16
|
-
}
|
|
17
|
-
.arrow-up {
|
|
18
|
-
border: 1px solid $gs-23;
|
|
19
|
-
display: inline-block;
|
|
20
|
-
border-width: 3px 3px 0 0;
|
|
21
|
-
padding: 3px;
|
|
22
|
-
transform: rotate(45deg);
|
|
23
|
-
-webkit-transform: rotate(-45deg);
|
|
24
|
-
}
|
|
25
|
-
.disp-inline {
|
|
26
|
-
display: inline-block;
|
|
27
|
-
}
|
|
28
|
-
.cursor-pointer {
|
|
29
|
-
cursor: pointer !important;
|
|
30
|
-
}
|
|
31
|
-
.form-heading {
|
|
32
|
-
@include font-size(160%);
|
|
33
|
-
}
|
|
34
|
-
.visuallyhidden {
|
|
35
|
-
position: absolute;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
clip: rect(0 0 0 0);
|
|
38
|
-
height: 1px;
|
|
39
|
-
width: 1px;
|
|
40
|
-
margin: -1px;
|
|
41
|
-
padding: 0;
|
|
42
|
-
border: 0;
|
|
43
|
-
}
|
|
44
|
-
.custom-button {
|
|
45
|
-
@include margin($top: 10px, $bottom: 10px);
|
|
46
|
-
display: inline-block;
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
border: none;
|
|
49
|
-
position: relative;
|
|
50
|
-
}
|
|
51
|
-
* {
|
|
52
|
-
-webkit-box-sizing: border-box;
|
|
53
|
-
box-sizing: border-box;
|
|
54
|
-
margin: 0;
|
|
55
|
-
padding: 0;
|
|
56
|
-
}
|
|
57
|
-
.clearfix:after {
|
|
58
|
-
content: " ";
|
|
59
|
-
clear: both;
|
|
60
|
-
display: block;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/********************/
|
|
64
|
-
/*** Margins ******/
|
|
65
|
-
|
|
66
|
-
.margin-left-5 {
|
|
67
|
-
margin-left: 5px;
|
|
68
|
-
}
|
|
69
|
-
.margin-right-5 {
|
|
70
|
-
margin-right: 5px;
|
|
71
|
-
}
|
|
72
|
-
.margin-top-5 {
|
|
73
|
-
margin-top: 5px;
|
|
74
|
-
}
|
|
75
|
-
.margin-bottom-5 {
|
|
76
|
-
margin-bottom: 5px;
|
|
77
|
-
}
|
|
78
|
-
.margin-top-0 {
|
|
79
|
-
margin-top: 0 !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.margin-left-10 {
|
|
83
|
-
margin-left: 10px;
|
|
84
|
-
}
|
|
85
|
-
.margin-right-10 {
|
|
86
|
-
margin-right: 10px;
|
|
87
|
-
}
|
|
88
|
-
.margin-top-10 {
|
|
89
|
-
margin-top: 10px;
|
|
90
|
-
}
|
|
91
|
-
.margin-bottom-10 {
|
|
92
|
-
margin-bottom: 10px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.margin-left-15 {
|
|
96
|
-
margin-left: 15px;
|
|
97
|
-
}
|
|
98
|
-
.margin-right-15 {
|
|
99
|
-
margin-right: 15px;
|
|
100
|
-
}
|
|
101
|
-
.margin-top-15 {
|
|
102
|
-
margin-top: 15px;
|
|
103
|
-
}
|
|
104
|
-
.margin-bottom-15 {
|
|
105
|
-
margin-bottom: 15px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.margin-left-20 {
|
|
109
|
-
margin-left: 20px;
|
|
110
|
-
}
|
|
111
|
-
.margin-right-20 {
|
|
112
|
-
margin-right: 20px;
|
|
113
|
-
}
|
|
114
|
-
.margin-top-20 {
|
|
115
|
-
margin-top: 20px;
|
|
116
|
-
}
|
|
117
|
-
.margin-bottom-20 {
|
|
118
|
-
margin-bottom: 20px;
|
|
119
|
-
}
|
|
120
|
-
.margin-left-0 {
|
|
121
|
-
margin-left: 0px !important;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/********************/
|
|
125
|
-
/*** Padding ******/
|
|
126
|
-
.padding-5 {
|
|
127
|
-
padding: 5px;
|
|
128
|
-
}
|
|
129
|
-
.padding-10 {
|
|
130
|
-
padding: 10px;
|
|
131
|
-
}
|
|
132
|
-
.padding-15 {
|
|
133
|
-
padding: 15px;
|
|
134
|
-
}
|
|
135
|
-
.padding-20 {
|
|
136
|
-
padding: 20px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/********************/
|
|
140
|
-
/*** Font ******/
|
|
141
|
-
.font-12 {
|
|
142
|
-
font-size: 60%;
|
|
143
|
-
}
|
|
144
|
-
.font-13 {
|
|
145
|
-
font-size: 65%;
|
|
146
|
-
}
|
|
147
|
-
.font-14 {
|
|
148
|
-
font-size: 70%;
|
|
149
|
-
}
|
|
150
|
-
.font-16 {
|
|
151
|
-
font-size: 80%;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.font-18 {
|
|
155
|
-
font-size: 90%;
|
|
156
|
-
}
|
|
157
|
-
.font-20 {
|
|
158
|
-
font-size: 100%;
|
|
159
|
-
}
|
|
160
|
-
.font-500 {
|
|
161
|
-
font-weight: 500;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/********************/
|
|
165
|
-
/*** Text and container alignment ******/
|
|
166
|
-
.pull-left {
|
|
167
|
-
float: left;
|
|
168
|
-
}
|
|
169
|
-
.pull-right {
|
|
170
|
-
float: right;
|
|
171
|
-
}
|
|
172
|
-
.text-left {
|
|
173
|
-
text-align: left;
|
|
174
|
-
}
|
|
175
|
-
.text-right {
|
|
176
|
-
text-align: right;
|
|
177
|
-
}
|
|
178
|
-
.text-center {
|
|
179
|
-
text-align: center;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.disp-none {
|
|
183
|
-
display: none;
|
|
184
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
@keyframes ldio-5kpfc1it8w6 {
|
|
2
|
-
0% { opacity: 1 }
|
|
3
|
-
100% { opacity: 0 }
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.loading-spinner {
|
|
7
|
-
width: 56px;
|
|
8
|
-
height: 56px;
|
|
9
|
-
display: inline-block;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
background: none;
|
|
12
|
-
|
|
13
|
-
.spinner-circle {
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
position: relative;
|
|
17
|
-
transform: translateZ(0) scale(0.56);
|
|
18
|
-
backface-visibility: hidden;
|
|
19
|
-
transform-origin: 0 0; /* see note above */
|
|
20
|
-
div {
|
|
21
|
-
box-sizing: content-box;
|
|
22
|
-
left: 47px;
|
|
23
|
-
top: 24px;
|
|
24
|
-
position: absolute;
|
|
25
|
-
animation: ldio-5kpfc1it8w6 linear 1s infinite;
|
|
26
|
-
background: #3c3738;
|
|
27
|
-
width: 6px;
|
|
28
|
-
height: 12px;
|
|
29
|
-
border-radius: 3px / 6px;
|
|
30
|
-
transform-origin: 3px 26px;
|
|
31
|
-
|
|
32
|
-
&:nth-child(1){
|
|
33
|
-
transform: rotate(0deg);
|
|
34
|
-
animation-delay: -0.9166666666666666s;
|
|
35
|
-
background: #3c3738;
|
|
36
|
-
}
|
|
37
|
-
&:nth-child(2){
|
|
38
|
-
transform: rotate(30deg);
|
|
39
|
-
animation-delay: -0.8333333333333334s;
|
|
40
|
-
background: #3c3738;
|
|
41
|
-
}
|
|
42
|
-
&:nth-child(3){
|
|
43
|
-
transform: rotate(60deg);
|
|
44
|
-
animation-delay: -0.75s;
|
|
45
|
-
background: #3c3738;
|
|
46
|
-
}
|
|
47
|
-
&:nth-child(4){
|
|
48
|
-
transform: rotate(90deg);
|
|
49
|
-
animation-delay: -0.6666666666666666s;
|
|
50
|
-
background: #3c3738;
|
|
51
|
-
}
|
|
52
|
-
&:nth-child(5){
|
|
53
|
-
transform: rotate(120deg);
|
|
54
|
-
animation-delay: -0.5833333333333334s;
|
|
55
|
-
background: #3c3738;
|
|
56
|
-
}
|
|
57
|
-
&:nth-child(6){
|
|
58
|
-
transform: rotate(150deg);
|
|
59
|
-
animation-delay: -0.5s;
|
|
60
|
-
background: #3c3738;
|
|
61
|
-
}
|
|
62
|
-
&:nth-child(7){
|
|
63
|
-
transform: rotate(180deg);
|
|
64
|
-
animation-delay: -0.4166666666666667s;
|
|
65
|
-
background: #3c3738;
|
|
66
|
-
}
|
|
67
|
-
&:nth-child(8){
|
|
68
|
-
transform: rotate(210deg);
|
|
69
|
-
animation-delay: -0.3333333333333333s;
|
|
70
|
-
background: #3c3738;
|
|
71
|
-
}
|
|
72
|
-
&:nth-child(9){
|
|
73
|
-
transform: rotate(240deg);
|
|
74
|
-
animation-delay: -0.25s;
|
|
75
|
-
background: #3c3738;
|
|
76
|
-
}
|
|
77
|
-
&:nth-child(10){
|
|
78
|
-
transform: rotate(270deg);
|
|
79
|
-
animation-delay: -0.16666666666666666s;
|
|
80
|
-
background: #3c3738;
|
|
81
|
-
}
|
|
82
|
-
&:nth-child(11){
|
|
83
|
-
transform: rotate(300deg);
|
|
84
|
-
animation-delay: -0.08333333333333333s;
|
|
85
|
-
background: #3c3738;
|
|
86
|
-
}
|
|
87
|
-
&:nth-child(12){
|
|
88
|
-
transform: rotate(330deg);
|
|
89
|
-
animation-delay: 0s;
|
|
90
|
-
background: #3c3738;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { triggerAnalytics, trim } from "../utility";
|
|
2
|
-
import { AnalyticsConfig, SelectorType } from "./types";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Method to setup analytics trigger points
|
|
6
|
-
*/
|
|
7
|
-
const AnalyticsHandler = (function AnalyticsHandler(window) {
|
|
8
|
-
// Stores config data to trigger analytics
|
|
9
|
-
let configData: AnalyticsConfig[];
|
|
10
|
-
let events: Array<string>;
|
|
11
|
-
|
|
12
|
-
const trigger = (config: AnalyticsConfig, target: HTMLElement) => {
|
|
13
|
-
if (config?.customValidator) {
|
|
14
|
-
let isValidated = config.customValidator(target);
|
|
15
|
-
if (!isValidated) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
triggerAnalytics(config.linkName);
|
|
20
|
-
if (!!config.once) {
|
|
21
|
-
config.triggered = true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const attachHandler = (eventType: string, capturing: boolean = false) => {
|
|
26
|
-
document.addEventListener(eventType, (event: any) => {
|
|
27
|
-
console.log("logger running");
|
|
28
|
-
let target: HTMLElement = event.target;
|
|
29
|
-
let events = configData.filter(e => e.eventType === eventType && !!e.capturing === capturing);
|
|
30
|
-
events.forEach(config => {
|
|
31
|
-
if (!(!!config.once && config.triggered === true)) {
|
|
32
|
-
if (config.selectorType) {
|
|
33
|
-
switch (config.selectorType) {
|
|
34
|
-
case SelectorType.Attr:
|
|
35
|
-
let attribute = target.getAttribute(config.selector)
|
|
36
|
-
if (attribute === config.attrValue) {
|
|
37
|
-
trigger(config, target);
|
|
38
|
-
}
|
|
39
|
-
break;
|
|
40
|
-
case SelectorType.Class:
|
|
41
|
-
let classes: any = trim(config.className);
|
|
42
|
-
let classesArray = classes.split(",");
|
|
43
|
-
if(classes.length){
|
|
44
|
-
if (classesArray.length > 0) {
|
|
45
|
-
// Trim and remove null || undefined
|
|
46
|
-
let finalClassListArray: Array<string> = classesArray.map((e: string) => trim(e)).filter((e: string) => !!e);
|
|
47
|
-
let isMatched = finalClassListArray.every((cls: string) => {
|
|
48
|
-
return target.classList.contains(cls);
|
|
49
|
-
});
|
|
50
|
-
if (isMatched) {
|
|
51
|
-
trigger(config, target);
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
if (target.classList.contains(classes)) {
|
|
55
|
-
trigger(config, target);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
break;
|
|
60
|
-
case SelectorType.ID:
|
|
61
|
-
if (target?.id === config.id || target.closest('#'+config.id)) {
|
|
62
|
-
trigger(config, target);
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
// Overload condition by callback passed from outside config.customHandler
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}, capturing);
|
|
73
|
-
}
|
|
74
|
-
return function (config: AnalyticsConfig[]) {
|
|
75
|
-
configData = config;
|
|
76
|
-
events = config.map(e => e.eventType);
|
|
77
|
-
events = events.filter((x, i, a) => a.indexOf(x) === i)
|
|
78
|
-
events.forEach(event => attachHandler(event, false));
|
|
79
|
-
}
|
|
80
|
-
})(window);
|
|
81
|
-
|
|
82
|
-
export default AnalyticsHandler;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export enum SelectorType {
|
|
3
|
-
Attr = "attr",
|
|
4
|
-
ID = "id",
|
|
5
|
-
Class = "class",
|
|
6
|
-
Element = "element"
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export interface CustomValidator {
|
|
10
|
-
(element: HTMLElement): boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type AnalyticsConfig = {
|
|
14
|
-
selector: string;
|
|
15
|
-
selectorType: SelectorType;
|
|
16
|
-
attrValue?: string;
|
|
17
|
-
eventType: string;
|
|
18
|
-
linkName: string;
|
|
19
|
-
once?: boolean;
|
|
20
|
-
triggered?: boolean;
|
|
21
|
-
capturing?: boolean;
|
|
22
|
-
callback?: Function;
|
|
23
|
-
customValidator?: CustomValidator;
|
|
24
|
-
id?:string;
|
|
25
|
-
className?:string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const DefaultConfig = {
|
|
29
|
-
once: false,
|
|
30
|
-
capturing: false
|
|
31
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export class GetDOMElement {
|
|
2
|
-
|
|
3
|
-
constructor(elTag, ...classList) {
|
|
4
|
-
this.tagname = elTag;
|
|
5
|
-
this.classList = classList;
|
|
6
|
-
this.el = document.createElement(this.tagname);
|
|
7
|
-
//eslint-disable-next-line
|
|
8
|
-
for (let className of this.classList) {
|
|
9
|
-
this.el.classList.add(className);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
getElement() {
|
|
14
|
-
return this.el;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
appendChildEl(...element) {
|
|
18
|
-
//eslint-disable-next-line
|
|
19
|
-
for (let item of element) {
|
|
20
|
-
this.el.appendChild(item);
|
|
21
|
-
}
|
|
22
|
-
//this.el.appendChild(el);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
setInnerText(text) {
|
|
26
|
-
this.el.innerText = text;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
addEventListenerEl(eventType, cb, capture = false) {
|
|
30
|
-
this.el.addEventListener(eventType, cb, capture);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
setInnerHtml(html) {
|
|
34
|
-
this.el.innerHTML = html;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export const logger = {
|
|
2
|
-
MAX_RECORDS: 2000,
|
|
3
|
-
// "debug"
|
|
4
|
-
log: function (tag, msg, ...rest) {
|
|
5
|
-
this._log("l", msg, tag, rest);
|
|
6
|
-
},
|
|
7
|
-
// "info"
|
|
8
|
-
info: function (tag, msg, ...rest) {
|
|
9
|
-
this._log("i", msg, tag, rest);
|
|
10
|
-
},
|
|
11
|
-
// "warn"
|
|
12
|
-
warn: function (tag, msg, ...rest) {
|
|
13
|
-
this._log("w", msg, tag, rest);
|
|
14
|
-
},
|
|
15
|
-
// "error"
|
|
16
|
-
error: function (tag, msg, ...rest) {
|
|
17
|
-
this._log("e", msg, tag, rest);
|
|
18
|
-
},
|
|
19
|
-
_log: function (level, msg, tag, ...rest) {
|
|
20
|
-
if (rest.length) {
|
|
21
|
-
msg = msg + " " + rest.join("\n")
|
|
22
|
-
}
|
|
23
|
-
let record;
|
|
24
|
-
tag = tag || null;
|
|
25
|
-
record = (
|
|
26
|
-
(tag != null) ? "[" + tag + "] " + msg : msg
|
|
27
|
-
);
|
|
28
|
-
const time = (new Date).toLocaleDateString() + " " + (new Date).toLocaleTimeString();
|
|
29
|
-
record = time + " " + record;
|
|
30
|
-
switch (level) {
|
|
31
|
-
case "l":
|
|
32
|
-
console.log(record);
|
|
33
|
-
break;
|
|
34
|
-
case "i":
|
|
35
|
-
console.info(record);
|
|
36
|
-
break;
|
|
37
|
-
case "w":
|
|
38
|
-
console.warn(record);
|
|
39
|
-
break;
|
|
40
|
-
case "e":
|
|
41
|
-
console.error(record);
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
window.ddoLogs = window.ddoLogs || [];
|
|
45
|
-
const storageSize = window.ddoLogs.length;
|
|
46
|
-
const exceeding = (logger.MAX_RECORDS - storageSize) * -1;
|
|
47
|
-
if (exceeding > 0) {
|
|
48
|
-
window.ddoLogs = window.ddoLogs.slice(exceeding);
|
|
49
|
-
}
|
|
50
|
-
window.ddoLogs.push({
|
|
51
|
-
'level': level,
|
|
52
|
-
'record': record
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mutation observer wrapper with helper functions
|
|
3
|
-
*/
|
|
4
|
-
export class Observer {
|
|
5
|
-
constructor(config) {
|
|
6
|
-
this.config = config || {
|
|
7
|
-
childlist: true,
|
|
8
|
-
subtree: true,
|
|
9
|
-
attributes: true
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
setObserver(cb) {
|
|
14
|
-
const mt = new MutationObserver(cb);
|
|
15
|
-
if (window.NodeList && !NodeList.prototype.forEach) {
|
|
16
|
-
NodeList.prototype.forEach = Array.prototype.forEach;
|
|
17
|
-
}
|
|
18
|
-
mt.observe(document.body, this.config);
|
|
19
|
-
return mt;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
waitForPresenceOfElement(elementSelector, timeout = null) {
|
|
23
|
-
let watchElement = document.querySelector(elementSelector);
|
|
24
|
-
if (watchElement) {
|
|
25
|
-
return new Promise((resolve) => { resolve(watchElement) });
|
|
26
|
-
} else {
|
|
27
|
-
let isFullFilled = false;
|
|
28
|
-
return new Promise((resolve, reject) => {
|
|
29
|
-
let observer = this.setObserver((_, observer) => {
|
|
30
|
-
let watchElement = document.querySelector(elementSelector);
|
|
31
|
-
if (watchElement) {
|
|
32
|
-
isFullFilled = true;
|
|
33
|
-
resolve(watchElement);
|
|
34
|
-
observer.disconnect();
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
if (timeout) {
|
|
38
|
-
setTimeout(() => {
|
|
39
|
-
observer.disconnect();
|
|
40
|
-
reject("Observer timeout error.");
|
|
41
|
-
}, timeout);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {*} callback
|
|
5
|
-
* @param {*} capturing
|
|
6
|
-
*/
|
|
7
|
-
export const setupChangeHandler = (callback, capturing = false) => {
|
|
8
|
-
document.addEventListener("change", callback, capturing);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {*} callback
|
|
14
|
-
*/
|
|
15
|
-
export const setupShipmentCancelHandler = (callback) => {
|
|
16
|
-
document.addEventListener("click", (event) => {
|
|
17
|
-
if (event.target.id === "nbsCancelShipmentWarningYes" ||
|
|
18
|
-
event.target.id == "nbsButtonDrawer4") {
|
|
19
|
-
if (typeof callback === "function") {
|
|
20
|
-
callback();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}, true);
|
|
24
|
-
}
|