cps-ui-kit 0.25.0 → 0.26.0
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/fesm2020/cps-ui-kit.mjs
CHANGED
|
@@ -16,6 +16,28 @@ import { TableService, Table, TableModule, SortableColumn, SortIcon } from 'prim
|
|
|
16
16
|
import * as i2$1 from 'primeng/calendar';
|
|
17
17
|
import { CalendarModule } from 'primeng/calendar';
|
|
18
18
|
|
|
19
|
+
const convertSize = (size) => {
|
|
20
|
+
const res = String(size).trim();
|
|
21
|
+
if (!res) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
if (/^\d+(\.\d+)?$/i.test(res)) {
|
|
25
|
+
return res + 'px';
|
|
26
|
+
}
|
|
27
|
+
if (/^\d+(\.\d+)?(px|rem|em|%)$/i.test(res)) {
|
|
28
|
+
return res;
|
|
29
|
+
}
|
|
30
|
+
throw new Error(`Invalid size value: ${size}`);
|
|
31
|
+
};
|
|
32
|
+
const parseSize = (size) => {
|
|
33
|
+
const match = size.match(/^(\d+(?:\.\d+)?)(px|rem|em|%)$/);
|
|
34
|
+
if (!match)
|
|
35
|
+
throw new Error(`Invalid size value: ${size}`);
|
|
36
|
+
const value = parseFloat(match[1]);
|
|
37
|
+
const unit = match[2];
|
|
38
|
+
return { value, unit };
|
|
39
|
+
};
|
|
40
|
+
|
|
19
41
|
const isSameDomain = (styleSheet) => {
|
|
20
42
|
if (!styleSheet.href) {
|
|
21
43
|
return true;
|
|
@@ -73,28 +95,6 @@ const getTextColor = (backgroundColor) => {
|
|
|
73
95
|
}
|
|
74
96
|
};
|
|
75
97
|
|
|
76
|
-
const convertSize = (size) => {
|
|
77
|
-
const res = String(size).trim();
|
|
78
|
-
if (!res) {
|
|
79
|
-
return '';
|
|
80
|
-
}
|
|
81
|
-
if (/^\d+(\.\d+)?$/i.test(res)) {
|
|
82
|
-
return res + 'px';
|
|
83
|
-
}
|
|
84
|
-
if (/^\d+(\.\d+)?(px|rem|em|%)$/i.test(res)) {
|
|
85
|
-
return res;
|
|
86
|
-
}
|
|
87
|
-
throw new Error(`Invalid size value: ${size}`);
|
|
88
|
-
};
|
|
89
|
-
const parseSize = (size) => {
|
|
90
|
-
const match = size.match(/^(\d+(?:\.\d+)?)(px|rem|em|%)$/);
|
|
91
|
-
if (!match)
|
|
92
|
-
throw new Error(`Invalid size value: ${size}`);
|
|
93
|
-
const value = parseFloat(match[1]);
|
|
94
|
-
const unit = match[2];
|
|
95
|
-
return { value, unit };
|
|
96
|
-
};
|
|
97
|
-
|
|
98
98
|
const iconNames = [
|
|
99
99
|
'access',
|
|
100
100
|
'access-denied',
|