fhdp-extenders 4.10.401 → 4.10.901
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/Module.ts +84 -84
- package/README.md +97 -97
- package/cached-package.json +1 -1
- package/dist/Module.d.ts +31 -31
- package/dist/Module.js +54 -53
- package/dist/Module.js.map +1 -1
- package/dist/source/RelocatorRules.d.ts +7 -7
- package/dist/source/RelocatorRules.js +267 -260
- package/dist/source/RelocatorRules.js.map +1 -1
- package/dist/source/constants.d.ts +1 -1
- package/dist/source/constants.js +4 -3
- package/dist/source/constants.js.map +1 -1
- package/dist/source/extenders/CookieParser.d.ts +3 -3
- package/dist/source/extenders/CookieParser.js +13 -11
- package/dist/source/extenders/CookieParser.js.map +1 -1
- package/dist/source/extenders/CookiePoliticsHandler.d.ts +6 -6
- package/dist/source/extenders/CookiePoliticsHandler.js +82 -79
- package/dist/source/extenders/CookiePoliticsHandler.js.map +1 -1
- package/dist/source/extenders/DynamicRelocator.d.ts +3 -3
- package/dist/source/extenders/DynamicRelocator.js +192 -190
- package/dist/source/extenders/DynamicRelocator.js.map +1 -1
- package/dist/source/extenders/FHMLExtender.d.ts +1 -1
- package/dist/source/extenders/FHMLExtender.js +306 -304
- package/dist/source/extenders/FHMLExtender.js.map +1 -1
- package/dist/source/extenders/PortalProcessHandler.d.ts +27 -27
- package/dist/source/extenders/PortalProcessHandler.js +189 -181
- package/dist/source/extenders/PortalProcessHandler.js.map +1 -1
- package/package.json +19 -10
- package/postpublish.js +15 -15
- package/prepublish.js +15 -15
- package/source/RelocatorRules.ts +216 -216
- package/source/extenders/CookieParser.ts +8 -8
- package/source/extenders/CookiePoliticsHandler.ts +101 -101
- package/source/extenders/DynamicRelocator.ts +71 -71
- package/source/extenders/FHMLExtender.ts +311 -311
- package/source/extenders/PortalProcessHandler.ts +184 -177
- package/tsconfig.json +18 -18
package/Module.ts
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import {getCookie} from "./source/extenders/CookieParser";
|
|
2
|
-
import {addTranslationForCookiePolitics, rerenderCookieAlert} from "./source/extenders/CookiePoliticsHandler";
|
|
3
|
-
import {addRule, excludeRule} from "./source/extenders/DynamicRelocator";
|
|
4
|
-
import {extendFHML} from "./source/extenders/FHMLExtender"
|
|
5
|
-
import {
|
|
6
|
-
// addFHMLToTooltipRule,
|
|
7
|
-
// excludeSessionCounterRule,
|
|
8
|
-
initCurrentMenuElementHighlightRule,
|
|
9
|
-
initDynamicFooterPositionRule,
|
|
10
|
-
initErrorBelowFieldRule,
|
|
11
|
-
initMobileNavbarRules,
|
|
12
|
-
SET_BORDER_WINDOW_WIDHT
|
|
13
|
-
} from "./source/RelocatorRules";
|
|
14
|
-
|
|
15
|
-
export interface DynamicRelocatorExtensionRule {
|
|
16
|
-
type: 'extension';
|
|
17
|
-
selector: string;
|
|
18
|
-
condition: (mutation: any) => Promise<boolean>;
|
|
19
|
-
ruleMutator: (mutation: any) => Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface DynamicRelocatorExclusionRule {
|
|
23
|
-
type: 'exclusion';
|
|
24
|
-
selector: string;
|
|
25
|
-
condition: (mutation: any) => Promise<boolean>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ExtenderConfig {
|
|
29
|
-
i18n: any;
|
|
30
|
-
extendFHML?: boolean;
|
|
31
|
-
mobileMaxWidth?: number;
|
|
32
|
-
enableMobileNavbar?: boolean;
|
|
33
|
-
enableErrorBelowField?: boolean;
|
|
34
|
-
enableDynamicFooterPosition?: boolean;
|
|
35
|
-
enableCurrentMenuElementHighlight?:boolean;
|
|
36
|
-
currentMenuElementHighlighBottomBorderStyle?: string;
|
|
37
|
-
enableFHMLinTooltips?: boolean;
|
|
38
|
-
enableSessionCounterRules?: boolean;
|
|
39
|
-
enableCookieAlert?: boolean;
|
|
40
|
-
additionalRules?: Array<DynamicRelocatorExclusionRule | DynamicRelocatorExtensionRule>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
class FHDPExtender {
|
|
44
|
-
constructor(config: ExtenderConfig) {
|
|
45
|
-
if (config.extendFHML) {
|
|
46
|
-
extendFHML();
|
|
47
|
-
}
|
|
48
|
-
if (config.mobileMaxWidth) {
|
|
49
|
-
SET_BORDER_WINDOW_WIDHT(config.mobileMaxWidth);
|
|
50
|
-
}
|
|
51
|
-
if (config.enableMobileNavbar) {
|
|
52
|
-
initMobileNavbarRules();
|
|
53
|
-
}
|
|
54
|
-
if (config.enableErrorBelowField) {
|
|
55
|
-
initErrorBelowFieldRule();
|
|
56
|
-
}
|
|
57
|
-
if (config.enableDynamicFooterPosition) {
|
|
58
|
-
initDynamicFooterPositionRule()
|
|
59
|
-
}
|
|
60
|
-
if(config.enableCurrentMenuElementHighlight) {
|
|
61
|
-
initCurrentMenuElementHighlightRule(config.currentMenuElementHighlighBottomBorderStyle || '3px solid #ffc107');
|
|
62
|
-
}
|
|
63
|
-
// if (config.enableFHMLinTooltips) {
|
|
64
|
-
// addFHMLToTooltipRule();
|
|
65
|
-
// }
|
|
66
|
-
// if (config.enableSessionCounterRules === undefined || config.enableSessionCounterRules === true) {
|
|
67
|
-
// excludeSessionCounterRule();
|
|
68
|
-
// }
|
|
69
|
-
if (config.enableCookieAlert) {
|
|
70
|
-
rerenderCookieAlert(config.i18n);
|
|
71
|
-
}
|
|
72
|
-
if (config.additionalRules && config.additionalRules.length > 0) {
|
|
73
|
-
for (const rule of config.additionalRules) {
|
|
74
|
-
if (rule.type === 'exclusion') {
|
|
75
|
-
excludeRule(rule.selector, rule.condition)
|
|
76
|
-
} else if (rule.type === 'extension') {
|
|
77
|
-
addRule(rule.selector, rule.condition, rule.ruleMutator);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export {FHDPExtender, getCookie, addTranslationForCookiePolitics}
|
|
1
|
+
import {getCookie} from "./source/extenders/CookieParser";
|
|
2
|
+
import {addTranslationForCookiePolitics, rerenderCookieAlert} from "./source/extenders/CookiePoliticsHandler";
|
|
3
|
+
import {addRule, excludeRule} from "./source/extenders/DynamicRelocator";
|
|
4
|
+
import {extendFHML} from "./source/extenders/FHMLExtender"
|
|
5
|
+
import {
|
|
6
|
+
// addFHMLToTooltipRule,
|
|
7
|
+
// excludeSessionCounterRule,
|
|
8
|
+
initCurrentMenuElementHighlightRule,
|
|
9
|
+
initDynamicFooterPositionRule,
|
|
10
|
+
initErrorBelowFieldRule,
|
|
11
|
+
initMobileNavbarRules,
|
|
12
|
+
SET_BORDER_WINDOW_WIDHT
|
|
13
|
+
} from "./source/RelocatorRules";
|
|
14
|
+
|
|
15
|
+
export interface DynamicRelocatorExtensionRule {
|
|
16
|
+
type: 'extension';
|
|
17
|
+
selector: string;
|
|
18
|
+
condition: (mutation: any) => Promise<boolean>;
|
|
19
|
+
ruleMutator: (mutation: any) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface DynamicRelocatorExclusionRule {
|
|
23
|
+
type: 'exclusion';
|
|
24
|
+
selector: string;
|
|
25
|
+
condition: (mutation: any) => Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ExtenderConfig {
|
|
29
|
+
i18n: any;
|
|
30
|
+
extendFHML?: boolean;
|
|
31
|
+
mobileMaxWidth?: number;
|
|
32
|
+
enableMobileNavbar?: boolean;
|
|
33
|
+
enableErrorBelowField?: boolean;
|
|
34
|
+
enableDynamicFooterPosition?: boolean;
|
|
35
|
+
enableCurrentMenuElementHighlight?:boolean;
|
|
36
|
+
currentMenuElementHighlighBottomBorderStyle?: string;
|
|
37
|
+
enableFHMLinTooltips?: boolean;
|
|
38
|
+
enableSessionCounterRules?: boolean;
|
|
39
|
+
enableCookieAlert?: boolean;
|
|
40
|
+
additionalRules?: Array<DynamicRelocatorExclusionRule | DynamicRelocatorExtensionRule>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class FHDPExtender {
|
|
44
|
+
constructor(config: ExtenderConfig) {
|
|
45
|
+
if (config.extendFHML) {
|
|
46
|
+
extendFHML();
|
|
47
|
+
}
|
|
48
|
+
if (config.mobileMaxWidth) {
|
|
49
|
+
SET_BORDER_WINDOW_WIDHT(config.mobileMaxWidth);
|
|
50
|
+
}
|
|
51
|
+
if (config.enableMobileNavbar) {
|
|
52
|
+
initMobileNavbarRules();
|
|
53
|
+
}
|
|
54
|
+
if (config.enableErrorBelowField) {
|
|
55
|
+
initErrorBelowFieldRule();
|
|
56
|
+
}
|
|
57
|
+
if (config.enableDynamicFooterPosition) {
|
|
58
|
+
initDynamicFooterPositionRule()
|
|
59
|
+
}
|
|
60
|
+
if(config.enableCurrentMenuElementHighlight) {
|
|
61
|
+
initCurrentMenuElementHighlightRule(config.currentMenuElementHighlighBottomBorderStyle || '3px solid #ffc107');
|
|
62
|
+
}
|
|
63
|
+
// if (config.enableFHMLinTooltips) {
|
|
64
|
+
// addFHMLToTooltipRule();
|
|
65
|
+
// }
|
|
66
|
+
// if (config.enableSessionCounterRules === undefined || config.enableSessionCounterRules === true) {
|
|
67
|
+
// excludeSessionCounterRule();
|
|
68
|
+
// }
|
|
69
|
+
if (config.enableCookieAlert) {
|
|
70
|
+
rerenderCookieAlert(config.i18n);
|
|
71
|
+
}
|
|
72
|
+
if (config.additionalRules && config.additionalRules.length > 0) {
|
|
73
|
+
for (const rule of config.additionalRules) {
|
|
74
|
+
if (rule.type === 'exclusion') {
|
|
75
|
+
excludeRule(rule.selector, rule.condition)
|
|
76
|
+
} else if (rule.type === 'extension') {
|
|
77
|
+
addRule(rule.selector, rule.condition, rule.ruleMutator);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {FHDPExtender, getCookie, addTranslationForCookiePolitics}
|
package/README.md
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
# FHDP-Extender
|
|
2
|
-
This library extends abilities of stock fh behaviors.
|
|
3
|
-
|
|
4
|
-
It works on Mutator Observer and inject code between luna rendering, and displaying it on client side.
|
|
5
|
-
Also includes fhml extender.
|
|
6
|
-
|
|
7
|
-
## How to use
|
|
8
|
-
|
|
9
|
-
### cookie parser
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
import {getCookie} from 'fhdp-extenders';
|
|
13
|
-
|
|
14
|
-
...
|
|
15
|
-
|
|
16
|
-
const cookie = getCookie();
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
it returns cookie dictionary parsed to json.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### init extenders
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
import {FHDPExtender} from 'fhdp-extenders';
|
|
26
|
-
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
new FHDPExtender({
|
|
30
|
-
i18n: i18nInstance, /* needs to provide i18n instance to handle translations*/
|
|
31
|
-
extendFHML: true, /* extends fhml */
|
|
32
|
-
enableMobileNavbar: true, /* enable changing from desktop to mobile navbar */
|
|
33
|
-
enableHintOnHover: true, /* enable hints on hover */
|
|
34
|
-
enableRequiredAtLabel: true, /* enable moving required star from field to label */
|
|
35
|
-
enableErrorBelowField: true, /* enable moving error from field to label */
|
|
36
|
-
enableDynamicFooterPosition: true, /* enable dynamic footer sliding */
|
|
37
|
-
enableCurrentMenuElementHighlight: true, /* enable highlight for currently selected element */
|
|
38
|
-
enableFHMLinTooltips: true, /* enable fhml in tooltips */
|
|
39
|
-
enableSessionCounterRules: true, /* enable session counter rules */
|
|
40
|
-
enableCookieAlert: true, /* enable cookie alert at bottom */
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### extend translations for cookie alert
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
import {addTranslationForCookiePolitics} from 'fhdp-extenders';
|
|
50
|
-
|
|
51
|
-
addTranslationForCookiePolitics('pl' {
|
|
52
|
-
warning: 'Uwaga!',
|
|
53
|
-
message: 'Używając tej strony akceptujesz politykę prywatności i przetwarzanie plików cookie',
|
|
54
|
-
close: 'Akceptuję'
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### extend rules
|
|
60
|
-
|
|
61
|
-
In FHDPExtender config add node `additionalRules`.
|
|
62
|
-
This is list of objects:
|
|
63
|
-
```
|
|
64
|
-
{
|
|
65
|
-
// 'exclusion' type excludes all mutations described by condition param,
|
|
66
|
-
// 'extension' type extends rules. For this param ruleMutator is obligatory
|
|
67
|
-
type: 'exclusion' | 'extension'
|
|
68
|
-
// 'selector' its marker for recognising whitch element is selected (only used in debug),
|
|
69
|
-
selector: string
|
|
70
|
-
// async function for recognisiong if element fits into mutation rule
|
|
71
|
-
condition: (mutation: Mutation) => Promise<boolean>
|
|
72
|
-
// rule mutator is actual function that modifies elements in DOM. It runs only if type = extension and condition returns true.
|
|
73
|
-
ruleMutator: (mutation: Mutation) => Promise<void>
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Example adding div to dom only if not exists:
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
new FHDPExtender({
|
|
81
|
-
i18n: i18nInstance,
|
|
82
|
-
additionalRules: [
|
|
83
|
-
{
|
|
84
|
-
type: 'extension',
|
|
85
|
-
selector: '#myComponent',
|
|
86
|
-
condition: async (mutation) => !!document.querySelector('#myComponent'),
|
|
87
|
-
ruleMutator: async (mutation) => {
|
|
88
|
-
const myElement = document.createElement(div);
|
|
89
|
-
myElement.id = '#myComponent';
|
|
90
|
-
myElement.innerText = 'Thats my element!';
|
|
91
|
-
document.body.appendChild(myElement);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
...
|
|
95
|
-
]
|
|
96
|
-
});
|
|
97
|
-
```
|
|
1
|
+
# FHDP-Extender
|
|
2
|
+
This library extends abilities of stock fh behaviors.
|
|
3
|
+
|
|
4
|
+
It works on Mutator Observer and inject code between luna rendering, and displaying it on client side.
|
|
5
|
+
Also includes fhml extender.
|
|
6
|
+
|
|
7
|
+
## How to use
|
|
8
|
+
|
|
9
|
+
### cookie parser
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
import {getCookie} from 'fhdp-extenders';
|
|
13
|
+
|
|
14
|
+
...
|
|
15
|
+
|
|
16
|
+
const cookie = getCookie();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
it returns cookie dictionary parsed to json.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### init extenders
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
import {FHDPExtender} from 'fhdp-extenders';
|
|
26
|
+
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
new FHDPExtender({
|
|
30
|
+
i18n: i18nInstance, /* needs to provide i18n instance to handle translations*/
|
|
31
|
+
extendFHML: true, /* extends fhml */
|
|
32
|
+
enableMobileNavbar: true, /* enable changing from desktop to mobile navbar */
|
|
33
|
+
enableHintOnHover: true, /* enable hints on hover */
|
|
34
|
+
enableRequiredAtLabel: true, /* enable moving required star from field to label */
|
|
35
|
+
enableErrorBelowField: true, /* enable moving error from field to label */
|
|
36
|
+
enableDynamicFooterPosition: true, /* enable dynamic footer sliding */
|
|
37
|
+
enableCurrentMenuElementHighlight: true, /* enable highlight for currently selected element */
|
|
38
|
+
enableFHMLinTooltips: true, /* enable fhml in tooltips */
|
|
39
|
+
enableSessionCounterRules: true, /* enable session counter rules */
|
|
40
|
+
enableCookieAlert: true, /* enable cookie alert at bottom */
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### extend translations for cookie alert
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
import {addTranslationForCookiePolitics} from 'fhdp-extenders';
|
|
50
|
+
|
|
51
|
+
addTranslationForCookiePolitics('pl' {
|
|
52
|
+
warning: 'Uwaga!',
|
|
53
|
+
message: 'Używając tej strony akceptujesz politykę prywatności i przetwarzanie plików cookie',
|
|
54
|
+
close: 'Akceptuję'
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### extend rules
|
|
60
|
+
|
|
61
|
+
In FHDPExtender config add node `additionalRules`.
|
|
62
|
+
This is list of objects:
|
|
63
|
+
```
|
|
64
|
+
{
|
|
65
|
+
// 'exclusion' type excludes all mutations described by condition param,
|
|
66
|
+
// 'extension' type extends rules. For this param ruleMutator is obligatory
|
|
67
|
+
type: 'exclusion' | 'extension'
|
|
68
|
+
// 'selector' its marker for recognising whitch element is selected (only used in debug),
|
|
69
|
+
selector: string
|
|
70
|
+
// async function for recognisiong if element fits into mutation rule
|
|
71
|
+
condition: (mutation: Mutation) => Promise<boolean>
|
|
72
|
+
// rule mutator is actual function that modifies elements in DOM. It runs only if type = extension and condition returns true.
|
|
73
|
+
ruleMutator: (mutation: Mutation) => Promise<void>
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Example adding div to dom only if not exists:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
new FHDPExtender({
|
|
81
|
+
i18n: i18nInstance,
|
|
82
|
+
additionalRules: [
|
|
83
|
+
{
|
|
84
|
+
type: 'extension',
|
|
85
|
+
selector: '#myComponent',
|
|
86
|
+
condition: async (mutation) => !!document.querySelector('#myComponent'),
|
|
87
|
+
ruleMutator: async (mutation) => {
|
|
88
|
+
const myElement = document.createElement(div);
|
|
89
|
+
myElement.id = '#myComponent';
|
|
90
|
+
myElement.innerText = 'Thats my element!';
|
|
91
|
+
document.body.appendChild(myElement);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
...
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
```
|
package/cached-package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"fhdp-extenders","version":"4.10.
|
|
1
|
+
{"name":"fhdp-extenders","version":"4.10.901","author":"AssecoPL","contributors":[{"name":"Jacek Borowiec","email":"jacek.borowiec@asseco.pl"},{"name":"Paweł Domański","email":"pawel.domanski@asseco.pl"}],"license":"Apache License 2.0","main":"dist/Module.js","types":"dist/Module.d.ts","scripts":{"prepublishOnly":"node prepublish","postpublish":"node postpublish","build":"tsc","prepare":"yarn build","test":"echo \"Error: no test specified\" && exit 1"},"devDependencies":{"@types/bootstrap":"4.3.1","@types/jquery":"3.3.31","@types/node":"14.14.36","@types/jqueryui":"1.12.10","typescript":"5.0.4"},"dependencies":{"fh-basic-controls":"4.10.901","fh-forms-handler":"4.10.901","lodash":"4.17.21","moment":"2.29.4","moment-timezone":"0.5.34"}}
|
package/dist/Module.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { getCookie } from "./source/extenders/CookieParser";
|
|
2
|
-
import { addTranslationForCookiePolitics } from "./source/extenders/CookiePoliticsHandler";
|
|
3
|
-
export interface DynamicRelocatorExtensionRule {
|
|
4
|
-
type: 'extension';
|
|
5
|
-
selector: string;
|
|
6
|
-
condition: (mutation: any) => Promise<boolean>;
|
|
7
|
-
ruleMutator: (mutation: any) => Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export interface DynamicRelocatorExclusionRule {
|
|
10
|
-
type: 'exclusion';
|
|
11
|
-
selector: string;
|
|
12
|
-
condition: (mutation: any) => Promise<boolean>;
|
|
13
|
-
}
|
|
14
|
-
export interface ExtenderConfig {
|
|
15
|
-
i18n: any;
|
|
16
|
-
extendFHML?: boolean;
|
|
17
|
-
mobileMaxWidth?: number;
|
|
18
|
-
enableMobileNavbar?: boolean;
|
|
19
|
-
enableErrorBelowField?: boolean;
|
|
20
|
-
enableDynamicFooterPosition?: boolean;
|
|
21
|
-
enableCurrentMenuElementHighlight?: boolean;
|
|
22
|
-
currentMenuElementHighlighBottomBorderStyle?: string;
|
|
23
|
-
enableFHMLinTooltips?: boolean;
|
|
24
|
-
enableSessionCounterRules?: boolean;
|
|
25
|
-
enableCookieAlert?: boolean;
|
|
26
|
-
additionalRules?: Array<DynamicRelocatorExclusionRule | DynamicRelocatorExtensionRule>;
|
|
27
|
-
}
|
|
28
|
-
declare class FHDPExtender {
|
|
29
|
-
constructor(config: ExtenderConfig);
|
|
30
|
-
}
|
|
31
|
-
export { FHDPExtender, getCookie, addTranslationForCookiePolitics };
|
|
1
|
+
import { getCookie } from "./source/extenders/CookieParser";
|
|
2
|
+
import { addTranslationForCookiePolitics } from "./source/extenders/CookiePoliticsHandler";
|
|
3
|
+
export interface DynamicRelocatorExtensionRule {
|
|
4
|
+
type: 'extension';
|
|
5
|
+
selector: string;
|
|
6
|
+
condition: (mutation: any) => Promise<boolean>;
|
|
7
|
+
ruleMutator: (mutation: any) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface DynamicRelocatorExclusionRule {
|
|
10
|
+
type: 'exclusion';
|
|
11
|
+
selector: string;
|
|
12
|
+
condition: (mutation: any) => Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
export interface ExtenderConfig {
|
|
15
|
+
i18n: any;
|
|
16
|
+
extendFHML?: boolean;
|
|
17
|
+
mobileMaxWidth?: number;
|
|
18
|
+
enableMobileNavbar?: boolean;
|
|
19
|
+
enableErrorBelowField?: boolean;
|
|
20
|
+
enableDynamicFooterPosition?: boolean;
|
|
21
|
+
enableCurrentMenuElementHighlight?: boolean;
|
|
22
|
+
currentMenuElementHighlighBottomBorderStyle?: string;
|
|
23
|
+
enableFHMLinTooltips?: boolean;
|
|
24
|
+
enableSessionCounterRules?: boolean;
|
|
25
|
+
enableCookieAlert?: boolean;
|
|
26
|
+
additionalRules?: Array<DynamicRelocatorExclusionRule | DynamicRelocatorExtensionRule>;
|
|
27
|
+
}
|
|
28
|
+
declare class FHDPExtender {
|
|
29
|
+
constructor(config: ExtenderConfig);
|
|
30
|
+
}
|
|
31
|
+
export { FHDPExtender, getCookie, addTranslationForCookiePolitics };
|
package/dist/Module.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTranslationForCookiePolitics = exports.getCookie = exports.FHDPExtender = void 0;
|
|
4
|
+
var CookieParser_1 = require("./source/extenders/CookieParser");
|
|
5
|
+
Object.defineProperty(exports, "getCookie", { enumerable: true, get: function () { return CookieParser_1.getCookie; } });
|
|
6
|
+
var CookiePoliticsHandler_1 = require("./source/extenders/CookiePoliticsHandler");
|
|
7
|
+
Object.defineProperty(exports, "addTranslationForCookiePolitics", { enumerable: true, get: function () { return CookiePoliticsHandler_1.addTranslationForCookiePolitics; } });
|
|
8
|
+
var DynamicRelocator_1 = require("./source/extenders/DynamicRelocator");
|
|
9
|
+
var FHMLExtender_1 = require("./source/extenders/FHMLExtender");
|
|
10
|
+
var RelocatorRules_1 = require("./source/RelocatorRules");
|
|
11
|
+
var FHDPExtender = /** @class */ (function () {
|
|
12
|
+
function FHDPExtender(config) {
|
|
13
|
+
if (config.extendFHML) {
|
|
14
|
+
(0, FHMLExtender_1.extendFHML)();
|
|
15
|
+
}
|
|
16
|
+
if (config.mobileMaxWidth) {
|
|
17
|
+
(0, RelocatorRules_1.SET_BORDER_WINDOW_WIDHT)(config.mobileMaxWidth);
|
|
18
|
+
}
|
|
19
|
+
if (config.enableMobileNavbar) {
|
|
20
|
+
(0, RelocatorRules_1.initMobileNavbarRules)();
|
|
21
|
+
}
|
|
22
|
+
if (config.enableErrorBelowField) {
|
|
23
|
+
(0, RelocatorRules_1.initErrorBelowFieldRule)();
|
|
24
|
+
}
|
|
25
|
+
if (config.enableDynamicFooterPosition) {
|
|
26
|
+
(0, RelocatorRules_1.initDynamicFooterPositionRule)();
|
|
27
|
+
}
|
|
28
|
+
if (config.enableCurrentMenuElementHighlight) {
|
|
29
|
+
(0, RelocatorRules_1.initCurrentMenuElementHighlightRule)(config.currentMenuElementHighlighBottomBorderStyle || '3px solid #ffc107');
|
|
30
|
+
}
|
|
31
|
+
// if (config.enableFHMLinTooltips) {
|
|
32
|
+
// addFHMLToTooltipRule();
|
|
33
|
+
// }
|
|
34
|
+
// if (config.enableSessionCounterRules === undefined || config.enableSessionCounterRules === true) {
|
|
35
|
+
// excludeSessionCounterRule();
|
|
36
|
+
// }
|
|
37
|
+
if (config.enableCookieAlert) {
|
|
38
|
+
(0, CookiePoliticsHandler_1.rerenderCookieAlert)(config.i18n);
|
|
39
|
+
}
|
|
40
|
+
if (config.additionalRules && config.additionalRules.length > 0) {
|
|
41
|
+
for (var _i = 0, _a = config.additionalRules; _i < _a.length; _i++) {
|
|
42
|
+
var rule = _a[_i];
|
|
43
|
+
if (rule.type === 'exclusion') {
|
|
44
|
+
(0, DynamicRelocator_1.excludeRule)(rule.selector, rule.condition);
|
|
45
|
+
}
|
|
46
|
+
else if (rule.type === 'extension') {
|
|
47
|
+
(0, DynamicRelocator_1.addRule)(rule.selector, rule.condition, rule.ruleMutator);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return FHDPExtender;
|
|
53
|
+
}());
|
|
54
|
+
exports.FHDPExtender = FHDPExtender;
|
|
54
55
|
//# sourceMappingURL=Module.js.map
|
package/dist/Module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Module.js","sourceRoot":"","sources":["../Module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Module.js","sourceRoot":"","sources":["../Module.ts"],"names":[],"mappings":";;;AAAA,gEAA0D;AAmFpC,0FAnFd,wBAAS,OAmFc;AAlF/B,kFAA8G;AAkF7E,gHAlFzB,uDAA+B,OAkFyB;AAjFhE,wEAAyE;AACzE,gEAA0D;AAC1D,0DAQiC;AA8BjC;IACI,sBAAY,MAAsB;QAChC,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,IAAA,yBAAU,GAAE,CAAC;SACd;QACD,IAAI,MAAM,CAAC,cAAc,EAAE;YACzB,IAAA,wCAAuB,EAAC,MAAM,CAAC,cAAc,CAAC,CAAC;SAChD;QACD,IAAI,MAAM,CAAC,kBAAkB,EAAE;YAC7B,IAAA,sCAAqB,GAAE,CAAC;SACzB;QACD,IAAI,MAAM,CAAC,qBAAqB,EAAE;YAChC,IAAA,wCAAuB,GAAE,CAAC;SAC3B;QACD,IAAI,MAAM,CAAC,2BAA2B,EAAE;YACtC,IAAA,8CAA6B,GAAE,CAAA;SAChC;QACD,IAAG,MAAM,CAAC,iCAAiC,EAAE;YAC3C,IAAA,oDAAmC,EAAC,MAAM,CAAC,2CAA2C,IAAI,mBAAmB,CAAC,CAAC;SAChH;QACD,qCAAqC;QACrC,4BAA4B;QAC5B,IAAI;QACJ,qGAAqG;QACrG,iCAAiC;QACjC,IAAI;QACJ,IAAI,MAAM,CAAC,iBAAiB,EAAE;YAC5B,IAAA,2CAAmB,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SAClC;QACD,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/D,KAAmB,UAAsB,EAAtB,KAAA,MAAM,CAAC,eAAe,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;gBAAtC,IAAM,IAAI,SAAA;gBACb,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;oBAC7B,IAAA,8BAAW,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;iBAC3C;qBAAM,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;oBACpC,IAAA,0BAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;iBAC1D;aACF;SACF;IACH,CAAC;IACL,mBAAC;AAAD,CAAC,AAvCD,IAuCC;AAEO,oCAAY"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare let BORDER_WINDOW_WIDTH: number;
|
|
2
|
-
export declare const SET_BORDER_WINDOW_WIDHT: (width: number) => void;
|
|
3
|
-
export declare const initMobileNavbarRules: () => void;
|
|
4
|
-
export declare const initErrorBelowFieldRule: () => void;
|
|
5
|
-
export declare const initDynamicFooterPositionRule: () => void;
|
|
6
|
-
export declare const initCurrentMenuElementHighlightRule: (borderBottomStyle: string) => void;
|
|
7
|
-
export declare const initHomeAutoSelectRule: () => void;
|
|
1
|
+
export declare let BORDER_WINDOW_WIDTH: number;
|
|
2
|
+
export declare const SET_BORDER_WINDOW_WIDHT: (width: number) => void;
|
|
3
|
+
export declare const initMobileNavbarRules: () => void;
|
|
4
|
+
export declare const initErrorBelowFieldRule: () => void;
|
|
5
|
+
export declare const initDynamicFooterPositionRule: () => void;
|
|
6
|
+
export declare const initCurrentMenuElementHighlightRule: (borderBottomStyle: string) => void;
|
|
7
|
+
export declare const initHomeAutoSelectRule: () => void;
|