@qrvey/utils 1.11.0-2 → 1.11.0-3
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/general/mix/importScripts.d.ts +5 -0
- package/dist/cjs/general/mix/importScripts.js +15 -9
- package/dist/cjs/globalization/interfaces/filters/II18nFilterPanel.d.ts +1 -0
- package/dist/cjs/globalization/labels/filters/I18N_FILTER_PANEL.js +1 -0
- package/dist/general/mix/importScripts.d.ts +5 -0
- package/dist/general/mix/importScripts.js +15 -9
- package/dist/globalization/interfaces/filters/II18nFilterPanel.d.ts +1 -0
- package/dist/globalization/labels/filters/I18N_FILTER_PANEL.js +1 -0
- package/package.json +1 -1
|
@@ -37,18 +37,20 @@ exports.loadScript = exports.importScripts = void 0;
|
|
|
37
37
|
* ]);
|
|
38
38
|
*/
|
|
39
39
|
function importScripts(scripts) {
|
|
40
|
+
if (!window.loadedQrveyLibraries)
|
|
41
|
+
window.loadedQrveyLibraries = [];
|
|
40
42
|
const promiseList = scripts.map((script) => {
|
|
41
43
|
if (typeof script === "string") {
|
|
44
|
+
if (window.loadedQrveyLibraries.includes(script))
|
|
45
|
+
return;
|
|
42
46
|
return loadScript(script);
|
|
43
47
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
48
|
+
const exist = typeof script.namespace === "function"
|
|
49
|
+
? script.namespace()
|
|
50
|
+
: window[script.namespace] ||
|
|
51
|
+
window.loadedQrveyLibraries.includes(script.url);
|
|
52
|
+
if (exist) {
|
|
53
|
+
return script.dependencies && importScripts(script.dependencies);
|
|
52
54
|
}
|
|
53
55
|
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
54
56
|
});
|
|
@@ -68,12 +70,16 @@ function loadScript(url, type = "text/javascript", noModule = false) {
|
|
|
68
70
|
type,
|
|
69
71
|
noModule,
|
|
70
72
|
defer: true,
|
|
71
|
-
onload: resolve,
|
|
72
73
|
src: url,
|
|
74
|
+
onload: () => {
|
|
75
|
+
window.loadedQrveyLibraries.push(url);
|
|
76
|
+
resolve();
|
|
77
|
+
},
|
|
73
78
|
}));
|
|
74
79
|
if (noModule && "noModule" in HTMLScriptElement.prototype) {
|
|
75
80
|
// this Browser support ES6 module.
|
|
76
81
|
// so, this script is not going to call onload method. resolving manually ....
|
|
82
|
+
window.loadedQrveyLibraries.push(url);
|
|
77
83
|
resolve();
|
|
78
84
|
}
|
|
79
85
|
});
|
|
@@ -11,6 +11,7 @@ export interface II18nFilterPanel {
|
|
|
11
11
|
card_all_except: string;
|
|
12
12
|
card_all_selected: string;
|
|
13
13
|
card_none_selected: string;
|
|
14
|
+
card_no_items: string;
|
|
14
15
|
collapsed_title: string;
|
|
15
16
|
delete_dialog: II18nFilterPanelDeleteDialog;
|
|
16
17
|
empty_state: II18nFilterPanelEmptyState;
|
|
@@ -7,6 +7,7 @@ exports.I18N_FILTER_PANEL = {
|
|
|
7
7
|
aggregated_filters_tooltip: "Logic is not editable for aggregated filters",
|
|
8
8
|
card_all_except: "All Except:",
|
|
9
9
|
card_all_selected: "All Selected",
|
|
10
|
+
card_no_items: "No items to filter",
|
|
10
11
|
card_none_selected: "None",
|
|
11
12
|
empty_state: {
|
|
12
13
|
description: "No filters added",
|
|
@@ -34,18 +34,20 @@
|
|
|
34
34
|
* ]);
|
|
35
35
|
*/
|
|
36
36
|
export function importScripts(scripts) {
|
|
37
|
+
if (!window.loadedQrveyLibraries)
|
|
38
|
+
window.loadedQrveyLibraries = [];
|
|
37
39
|
const promiseList = scripts.map((script) => {
|
|
38
40
|
if (typeof script === "string") {
|
|
41
|
+
if (window.loadedQrveyLibraries.includes(script))
|
|
42
|
+
return;
|
|
39
43
|
return loadScript(script);
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
45
|
+
const exist = typeof script.namespace === "function"
|
|
46
|
+
? script.namespace()
|
|
47
|
+
: window[script.namespace] ||
|
|
48
|
+
window.loadedQrveyLibraries.includes(script.url);
|
|
49
|
+
if (exist) {
|
|
50
|
+
return script.dependencies && importScripts(script.dependencies);
|
|
49
51
|
}
|
|
50
52
|
return loadScript(script.url, script.type, script.noModule).then(() => script.dependencies && importScripts(script.dependencies));
|
|
51
53
|
});
|
|
@@ -64,12 +66,16 @@ export function loadScript(url, type = "text/javascript", noModule = false) {
|
|
|
64
66
|
type,
|
|
65
67
|
noModule,
|
|
66
68
|
defer: true,
|
|
67
|
-
onload: resolve,
|
|
68
69
|
src: url,
|
|
70
|
+
onload: () => {
|
|
71
|
+
window.loadedQrveyLibraries.push(url);
|
|
72
|
+
resolve();
|
|
73
|
+
},
|
|
69
74
|
}));
|
|
70
75
|
if (noModule && "noModule" in HTMLScriptElement.prototype) {
|
|
71
76
|
// this Browser support ES6 module.
|
|
72
77
|
// so, this script is not going to call onload method. resolving manually ....
|
|
78
|
+
window.loadedQrveyLibraries.push(url);
|
|
73
79
|
resolve();
|
|
74
80
|
}
|
|
75
81
|
});
|
|
@@ -11,6 +11,7 @@ export interface II18nFilterPanel {
|
|
|
11
11
|
card_all_except: string;
|
|
12
12
|
card_all_selected: string;
|
|
13
13
|
card_none_selected: string;
|
|
14
|
+
card_no_items: string;
|
|
14
15
|
collapsed_title: string;
|
|
15
16
|
delete_dialog: II18nFilterPanelDeleteDialog;
|
|
16
17
|
empty_state: II18nFilterPanelEmptyState;
|
|
@@ -4,6 +4,7 @@ export const I18N_FILTER_PANEL = {
|
|
|
4
4
|
aggregated_filters_tooltip: "Logic is not editable for aggregated filters",
|
|
5
5
|
card_all_except: "All Except:",
|
|
6
6
|
card_all_selected: "All Selected",
|
|
7
|
+
card_no_items: "No items to filter",
|
|
7
8
|
card_none_selected: "None",
|
|
8
9
|
empty_state: {
|
|
9
10
|
description: "No filters added",
|