@esri/calcite-components 1.0.0-next.355 → 1.0.0-next.359
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/calcite/assets/calcite-icon/rightAlign16.json +1 -0
- package/dist/calcite/assets/calcite-icon/rightAlign24.json +1 -0
- package/dist/calcite/assets/calcite-icon/rightAlign32.json +1 -0
- package/dist/calcite/calcite.esm.js +1 -1
- package/dist/calcite/calcite.js +1 -1
- package/dist/calcite/{p-3e308abf.system.entry.js → p-019c8036.system.entry.js} +1 -1
- package/dist/calcite/{p-5044316a.system.entry.js → p-0ac72794.system.entry.js} +1 -1
- package/dist/calcite/{p-1d59e70a.system.entry.js → p-0b187e6a.system.entry.js} +1 -1
- package/dist/calcite/p-12c57970.js +5 -0
- package/dist/calcite/{p-2787571e.system.entry.js → p-2c3bbbb4.system.entry.js} +2 -2
- package/dist/calcite/{p-b57ddca8.entry.js → p-3366ef60.entry.js} +1 -1
- package/dist/calcite/p-3c34f20d.system.js +5 -0
- package/dist/calcite/{p-be8c7dbb.system.entry.js → p-3f51ac4b.system.entry.js} +1 -1
- package/dist/calcite/{p-52966b4c.js → p-4f9b0b0f.js} +1 -1
- package/dist/calcite/{p-d6e20af1.system.entry.js → p-4fee156d.system.entry.js} +1 -1
- package/dist/calcite/{p-c25f34d6.entry.js → p-55e6b0b2.entry.js} +1 -1
- package/dist/calcite/{p-7f68da96.entry.js → p-5d9fe852.entry.js} +1 -1
- package/dist/calcite/p-5f285d1d.entry.js +5 -0
- package/dist/calcite/p-6173cf08.system.js +5 -0
- package/dist/calcite/{p-a7f8b343.entry.js → p-634115dd.entry.js} +1 -1
- package/dist/calcite/{p-23a085a3.system.entry.js → p-748c198c.system.entry.js} +1 -1
- package/dist/calcite/p-83d41684.entry.js +5 -0
- package/dist/calcite/{p-cf9debce.entry.js → p-92ad7d95.entry.js} +1 -1
- package/dist/calcite/p-99d32fc3.system.js +5 -0
- package/dist/calcite/{p-eca26cba.system.entry.js → p-9a0a29a7.system.entry.js} +1 -1
- package/dist/calcite/p-a07e9c46.system.entry.js +5 -0
- package/dist/calcite/p-ad81283a.entry.js +5 -0
- package/dist/calcite/p-bc00846c.entry.js +5 -0
- package/dist/calcite/{p-6c453fd0.system.entry.js → p-c13560e5.system.entry.js} +1 -1
- package/dist/calcite/{p-da3b96f9.entry.js → p-d00fbd1e.entry.js} +1 -1
- package/dist/calcite/{p-834ec82a.system.js → p-d4bafc77.system.js} +1 -1
- package/dist/calcite/{p-a918eec6.entry.js → p-d8653ba3.entry.js} +1 -1
- package/dist/calcite/p-dd9f2e61.js +5 -0
- package/dist/calcite/{p-15bc7ccd.system.entry.js → p-e8270c76.system.entry.js} +1 -1
- package/dist/calcite/p-f3d02833.js +5 -0
- package/dist/calcite/p-fcde21ce.system.js +5 -0
- package/dist/cjs/calcite-alert.cjs.entry.js +7 -4
- package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-date-picker_4.cjs.entry.js +3 -3
- package/dist/cjs/calcite-dropdown_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-input-date-picker.cjs.entry.js +4 -4
- package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/calcite-input.cjs.entry.js +19 -4
- package/dist/cjs/calcite-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-tooltip_2.cjs.entry.js +1 -1
- package/dist/cjs/calcite-tree_2.cjs.entry.js +0 -1
- package/dist/cjs/calcite.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/locale-b9b153dd.js +127 -0
- package/dist/cjs/number-e813e801.js +84 -0
- package/dist/cjs/{popper-ccef76e3.js → popper-adfdc032.js} +28 -9
- package/dist/cjs/{resources-d3c42dc4.js → resources-c524c005.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/calcite-alert/calcite-alert.css +28 -6
- package/dist/collection/components/calcite-alert/calcite-alert.js +30 -4
- package/dist/collection/components/calcite-color-picker-swatch/resources.js +1 -1
- package/dist/collection/components/calcite-icon/assets/calcite-icon/rightAlign16.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/rightAlign24.json +1 -0
- package/dist/collection/components/calcite-icon/assets/calcite-icon/rightAlign32.json +1 -0
- package/dist/collection/components/calcite-input/calcite-input.js +17 -2
- package/dist/collection/components/calcite-input-time-picker/calcite-input-time-picker.js +2 -2
- package/dist/collection/components/calcite-time-picker/calcite-time-picker.js +4 -4
- package/dist/collection/components/calcite-tree-item/calcite-tree-item.js +0 -1
- package/dist/collection/utils/locale.js +42 -38
- package/dist/collection/utils/number.js +41 -23
- package/dist/components/calcite-alert.js +8 -4
- package/dist/components/calcite-color-picker-swatch2.js +1 -1
- package/dist/components/calcite-input-time-picker.js +1 -1
- package/dist/components/calcite-input2.js +17 -2
- package/dist/components/calcite-time-picker2.js +3 -3
- package/dist/components/calcite-tree-item.js +0 -1
- package/dist/components/locale.js +42 -38
- package/dist/components/number.js +42 -24
- package/dist/components/popper.js +28 -9
- package/dist/custom-elements/index.js +139 -81
- package/dist/esm/calcite-alert.entry.js +7 -4
- package/dist/esm/calcite-color-picker_3.entry.js +1 -1
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/calcite-date-picker_4.entry.js +3 -3
- package/dist/esm/calcite-dropdown_3.entry.js +1 -1
- package/dist/esm/calcite-input-date-picker.entry.js +4 -4
- package/dist/esm/calcite-input-time-picker_2.entry.js +4 -4
- package/dist/esm/calcite-input.entry.js +19 -4
- package/dist/esm/calcite-popover_2.entry.js +1 -1
- package/dist/esm/calcite-tooltip_2.entry.js +1 -1
- package/dist/esm/calcite-tree_2.entry.js +0 -1
- package/dist/esm/calcite.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/locale-1b48f64f.js +122 -0
- package/dist/esm/number-8779395f.js +76 -0
- package/dist/esm/{popper-405efdae.js → popper-1814b3c1.js} +28 -9
- package/dist/esm/{resources-421133b2.js → resources-74c807b4.js} +1 -1
- package/dist/esm-es5/calcite-alert.entry.js +1 -1
- package/dist/esm-es5/calcite-color-picker_3.entry.js +1 -1
- package/dist/esm-es5/calcite-combobox_3.entry.js +1 -1
- package/dist/esm-es5/calcite-date-picker_4.entry.js +2 -2
- package/dist/esm-es5/calcite-dropdown_3.entry.js +1 -1
- package/dist/esm-es5/calcite-input-date-picker.entry.js +1 -1
- package/dist/esm-es5/calcite-input-time-picker_2.entry.js +1 -1
- package/dist/esm-es5/calcite-input.entry.js +1 -1
- package/dist/esm-es5/calcite-popover_2.entry.js +2 -2
- package/dist/esm-es5/calcite-tooltip_2.entry.js +1 -1
- package/dist/esm-es5/calcite-tree_2.entry.js +1 -1
- package/dist/esm-es5/calcite.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/locale-1b48f64f.js +5 -0
- package/dist/esm-es5/number-8779395f.js +5 -0
- package/dist/esm-es5/popper-1814b3c1.js +5 -0
- package/dist/esm-es5/{resources-421133b2.js → resources-74c807b4.js} +1 -1
- package/dist/extras/docs-json.json +44 -6
- package/dist/types/components/calcite-alert/calcite-alert.d.ts +4 -2
- package/dist/types/components/calcite-alert/interfaces.d.ts +1 -0
- package/dist/types/components/calcite-input-time-picker/calcite-input-time-picker.d.ts +1 -1
- package/dist/types/components/calcite-pick-list/shared-list-render.d.ts +2 -2
- package/dist/types/components/calcite-time-picker/calcite-time-picker.d.ts +2 -2
- package/dist/types/components.d.ts +17 -9
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/utils/number.d.ts +2 -1
- package/hydrate/index.js +140 -81
- package/package.json +17 -17
- package/readme.md +2 -2
- package/dist/calcite/p-0140ba79.entry.js +0 -5
- package/dist/calcite/p-11b9e4bb.system.js +0 -5
- package/dist/calcite/p-18c4af8f.system.js +0 -5
- package/dist/calcite/p-18d9a261.system.js +0 -5
- package/dist/calcite/p-22523fc5.entry.js +0 -5
- package/dist/calcite/p-54e07c75.entry.js +0 -5
- package/dist/calcite/p-6d0d9bba.js +0 -5
- package/dist/calcite/p-732a0005.system.entry.js +0 -5
- package/dist/calcite/p-8396a2d2.js +0 -5
- package/dist/calcite/p-91300144.js +0 -5
- package/dist/calcite/p-db85eed9.entry.js +0 -5
- package/dist/calcite/p-fc998713.system.js +0 -5
- package/dist/cjs/locale-ccfa66f6.js +0 -123
- package/dist/cjs/number-f57fd111.js +0 -65
- package/dist/esm/locale-86b789f9.js +0 -118
- package/dist/esm/number-eb92427e.js +0 -58
- package/dist/esm-es5/locale-86b789f9.js +0 -5
- package/dist/esm-es5/number-eb92427e.js +0 -5
- package/dist/esm-es5/popper-405efdae.js +0 -5
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
+
*/
|
|
5
|
+
import { a as sanitizeExponentialNumberString, b as sanitizeDecimalString } from './number-8779395f.js';
|
|
6
|
+
|
|
7
|
+
const locales = [
|
|
8
|
+
"ar",
|
|
9
|
+
"bs",
|
|
10
|
+
"ca",
|
|
11
|
+
"cs",
|
|
12
|
+
"da",
|
|
13
|
+
"de",
|
|
14
|
+
"de-CH",
|
|
15
|
+
"el",
|
|
16
|
+
"en",
|
|
17
|
+
"en-AU",
|
|
18
|
+
"en-CA",
|
|
19
|
+
"en-GB",
|
|
20
|
+
"es",
|
|
21
|
+
"es-MX",
|
|
22
|
+
"et",
|
|
23
|
+
"fi",
|
|
24
|
+
"fr",
|
|
25
|
+
"fr-CH",
|
|
26
|
+
"he",
|
|
27
|
+
"hi",
|
|
28
|
+
"hr",
|
|
29
|
+
"hu",
|
|
30
|
+
"id",
|
|
31
|
+
"it",
|
|
32
|
+
"it-CH",
|
|
33
|
+
"ja",
|
|
34
|
+
"ko",
|
|
35
|
+
"lt",
|
|
36
|
+
"lv",
|
|
37
|
+
"mk",
|
|
38
|
+
"nb",
|
|
39
|
+
"nl",
|
|
40
|
+
"pl",
|
|
41
|
+
"pt",
|
|
42
|
+
"pt-PT",
|
|
43
|
+
"ro",
|
|
44
|
+
"ru",
|
|
45
|
+
"sk",
|
|
46
|
+
"sl",
|
|
47
|
+
"sr",
|
|
48
|
+
"sv",
|
|
49
|
+
"th",
|
|
50
|
+
"tr",
|
|
51
|
+
"uk",
|
|
52
|
+
"vi",
|
|
53
|
+
"zh-CN",
|
|
54
|
+
"zh-HK",
|
|
55
|
+
"zh-TW"
|
|
56
|
+
];
|
|
57
|
+
function createLocaleNumberFormatter(locale) {
|
|
58
|
+
return new Intl.NumberFormat(locale, {
|
|
59
|
+
minimumFractionDigits: 0,
|
|
60
|
+
maximumFractionDigits: 20
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function delocalizeNumberString(numberString, locale) {
|
|
64
|
+
return sanitizeExponentialNumberString(numberString, (nonExpoNumString) => {
|
|
65
|
+
if (nonExpoNumString) {
|
|
66
|
+
const groupSeparator = getGroupSeparator(locale);
|
|
67
|
+
const decimalSeparator = getDecimalSeparator(locale);
|
|
68
|
+
const splitNumberString = nonExpoNumString.split("");
|
|
69
|
+
const decimalIndex = splitNumberString.lastIndexOf(decimalSeparator);
|
|
70
|
+
const delocalizedNumberString = splitNumberString
|
|
71
|
+
.map((value, index) => {
|
|
72
|
+
if (value === groupSeparator || (value === decimalSeparator && index !== decimalIndex)) {
|
|
73
|
+
return "";
|
|
74
|
+
}
|
|
75
|
+
return value;
|
|
76
|
+
})
|
|
77
|
+
.reduce((string, part) => string + part)
|
|
78
|
+
.replace(decimalSeparator, ".");
|
|
79
|
+
return isNaN(Number(delocalizedNumberString)) ? nonExpoNumString : delocalizedNumberString;
|
|
80
|
+
}
|
|
81
|
+
return nonExpoNumString;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function getGroupSeparator(locale) {
|
|
85
|
+
const formatter = createLocaleNumberFormatter(locale);
|
|
86
|
+
const parts = formatter.formatToParts(1234567.8);
|
|
87
|
+
const value = parts.find((part) => part.type === "group").value;
|
|
88
|
+
return value.trim().length === 0 ? " " : value;
|
|
89
|
+
}
|
|
90
|
+
function getDecimalSeparator(locale) {
|
|
91
|
+
const formatter = createLocaleNumberFormatter(locale);
|
|
92
|
+
const parts = formatter.formatToParts(1234567.8);
|
|
93
|
+
const value = parts.find((part) => part.type === "decimal").value;
|
|
94
|
+
return value.trim().length === 0 ? " " : value;
|
|
95
|
+
}
|
|
96
|
+
function localizeNumberString(numberString, locale, displayGroupSeparator = false) {
|
|
97
|
+
return sanitizeExponentialNumberString(numberString, (nonExpoNumString) => {
|
|
98
|
+
if (nonExpoNumString) {
|
|
99
|
+
const number = Number(sanitizeDecimalString(nonExpoNumString));
|
|
100
|
+
if (!isNaN(number)) {
|
|
101
|
+
const formatter = createLocaleNumberFormatter(locale);
|
|
102
|
+
const parts = formatter.formatToParts(number);
|
|
103
|
+
const localizedNumberString = parts
|
|
104
|
+
.map(({ type, value }) => {
|
|
105
|
+
switch (type) {
|
|
106
|
+
case "group":
|
|
107
|
+
return displayGroupSeparator ? getGroupSeparator(locale) : "";
|
|
108
|
+
case "decimal":
|
|
109
|
+
return getDecimalSeparator(locale);
|
|
110
|
+
default:
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
.reduce((string, part) => string + part);
|
|
115
|
+
return localizedNumberString;
|
|
116
|
+
}
|
|
117
|
+
return nonExpoNumString;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { locales as a, delocalizeNumberString as d, getDecimalSeparator as g, localizeNumberString as l };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
|
+
*/
|
|
5
|
+
function isActivationKey(key) {
|
|
6
|
+
return key === "Enter" || key === " ";
|
|
7
|
+
}
|
|
8
|
+
const numberKeys = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
|
9
|
+
|
|
10
|
+
function isValidNumber(numberString) {
|
|
11
|
+
return !(!numberString || isNaN(Number(numberString)));
|
|
12
|
+
}
|
|
13
|
+
function parseNumberString(numberString) {
|
|
14
|
+
if (!numberString || !stringContainsNumbers(numberString)) {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
return sanitizeExponentialNumberString(numberString, (nonExpoNumString) => {
|
|
18
|
+
let containsDecimal = false;
|
|
19
|
+
const result = nonExpoNumString
|
|
20
|
+
.split("")
|
|
21
|
+
.filter((value, i) => {
|
|
22
|
+
if (value.match(/\./g) && !containsDecimal) {
|
|
23
|
+
containsDecimal = true;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (value.match(/\-/g) && i === 0) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return numberKeys.includes(value);
|
|
30
|
+
})
|
|
31
|
+
.reduce((string, part) => string + part);
|
|
32
|
+
return isValidNumber(result) ? Number(result).toString() : null;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function sanitizeDecimalString(decimalString) {
|
|
36
|
+
const decimalAtEndOfStringButNotStart = /(?!^\.)\.$/;
|
|
37
|
+
return decimalString.replace(decimalAtEndOfStringButNotStart, "");
|
|
38
|
+
}
|
|
39
|
+
function sanitizeNegativeString(negativeString) {
|
|
40
|
+
const allHyphensExceptTheStart = /(?!^-)-/g;
|
|
41
|
+
return negativeString.replace(allHyphensExceptTheStart, "");
|
|
42
|
+
}
|
|
43
|
+
function sanitizeLeadingZeroString(zeroString) {
|
|
44
|
+
const allLeadingZerosOptionallyNegative = /^([-0])0+(?=\d)/;
|
|
45
|
+
return zeroString.replace(allLeadingZerosOptionallyNegative, "$1");
|
|
46
|
+
}
|
|
47
|
+
function sanitizeNumberString(numberString) {
|
|
48
|
+
return sanitizeExponentialNumberString(numberString, (nonExpoNumString) => {
|
|
49
|
+
const sanitizedValue = sanitizeNegativeString(sanitizeDecimalString(sanitizeLeadingZeroString(nonExpoNumString)));
|
|
50
|
+
const isNegativeDecimalOnlyZeros = /^-\b0\b\.?0*$/;
|
|
51
|
+
return isValidNumber(sanitizedValue)
|
|
52
|
+
? isNegativeDecimalOnlyZeros.test(sanitizedValue)
|
|
53
|
+
? sanitizedValue
|
|
54
|
+
: Number(sanitizedValue).toString()
|
|
55
|
+
: nonExpoNumString;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function sanitizeExponentialNumberString(numberString, func) {
|
|
59
|
+
if (!numberString) {
|
|
60
|
+
return numberString;
|
|
61
|
+
}
|
|
62
|
+
const firstE = numberString.toLowerCase().indexOf("e") + 1;
|
|
63
|
+
return numberString
|
|
64
|
+
.replace(/[eE]*$/g, "")
|
|
65
|
+
.substring(0, firstE)
|
|
66
|
+
.concat(numberString.slice(firstE).replace(/[eE]/g, ""))
|
|
67
|
+
.split(/[eE]/)
|
|
68
|
+
.map((section, i) => (i === 1 ? func(section.replace(/\./g, "")) : func(section)))
|
|
69
|
+
.join("e")
|
|
70
|
+
.replace(/^e/, "1e");
|
|
71
|
+
}
|
|
72
|
+
function stringContainsNumbers(string) {
|
|
73
|
+
return numberKeys.some((number) => string.includes(number));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { sanitizeExponentialNumberString as a, sanitizeDecimalString as b, isActivationKey as c, isValidNumber as i, numberKeys as n, parseNumberString as p, sanitizeNumberString as s };
|
|
@@ -487,13 +487,21 @@ function mapToStyles(_ref2) {
|
|
|
487
487
|
adaptive = _ref2.adaptive,
|
|
488
488
|
roundOffsets = _ref2.roundOffsets,
|
|
489
489
|
isFixed = _ref2.isFixed;
|
|
490
|
+
var _offsets$x = offsets.x,
|
|
491
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
492
|
+
_offsets$y = offsets.y,
|
|
493
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
490
494
|
|
|
491
|
-
var _ref3 =
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
495
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
496
|
+
x: x,
|
|
497
|
+
y: y
|
|
498
|
+
}) : {
|
|
499
|
+
x: x,
|
|
500
|
+
y: y
|
|
501
|
+
};
|
|
496
502
|
|
|
503
|
+
x = _ref3.x;
|
|
504
|
+
y = _ref3.y;
|
|
497
505
|
var hasX = offsets.hasOwnProperty('x');
|
|
498
506
|
var hasY = offsets.hasOwnProperty('y');
|
|
499
507
|
var sideX = left;
|
|
@@ -538,6 +546,17 @@ function mapToStyles(_ref2) {
|
|
|
538
546
|
position: position
|
|
539
547
|
}, adaptive && unsetSides);
|
|
540
548
|
|
|
549
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
550
|
+
x: x,
|
|
551
|
+
y: y
|
|
552
|
+
}) : {
|
|
553
|
+
x: x,
|
|
554
|
+
y: y
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
x = _ref4.x;
|
|
558
|
+
y = _ref4.y;
|
|
559
|
+
|
|
541
560
|
if (gpuAcceleration) {
|
|
542
561
|
var _Object$assign;
|
|
543
562
|
|
|
@@ -547,9 +566,9 @@ function mapToStyles(_ref2) {
|
|
|
547
566
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
548
567
|
}
|
|
549
568
|
|
|
550
|
-
function computeStyles(
|
|
551
|
-
var state =
|
|
552
|
-
options =
|
|
569
|
+
function computeStyles(_ref5) {
|
|
570
|
+
var state = _ref5.state,
|
|
571
|
+
options = _ref5.options;
|
|
553
572
|
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
554
573
|
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
555
574
|
_options$adaptive = options.adaptive,
|
|
@@ -838,7 +857,7 @@ function getClippingParents(element) {
|
|
|
838
857
|
|
|
839
858
|
|
|
840
859
|
return clippingParents.filter(function (clippingParent) {
|
|
841
|
-
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'
|
|
860
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
842
861
|
});
|
|
843
862
|
} // Gets the maximum area that the element is visible in due to any number of
|
|
844
863
|
// clipping parents
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
4
4
|
*/
|
|
5
5
|
import { a as getAssetPath } from './index-9de00868.js';
|
|
6
|
-
import { a as locales } from './locale-
|
|
6
|
+
import { a as locales } from './locale-1b48f64f.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Get supported locale code from raw user input
|
|
@@ -2,4 +2,4 @@ var __awaiter=this&&this.__awaiter||function(t,e,i,a){function n(t){return t ins
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
|
5
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-9de00868.js";import{s as setRequestedIcon}from"./dom-e55f9eaf.js";import{S as StatusIcons}from"./interfaces-51dc4e1b.js";import"./guid-196bd5ea.js";var TEXT={intlClose:"Close"};var DURATIONS={slow:14e3,medium:1e4,fast:6e3};var SLOTS={title:"title",message:"message",link:"link"};var calciteAlertCss='@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .alert-queue-count{margin-left:0.5rem;margin-right:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=s]) .alert-close{padding:0.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .alert-queue-count{margin-left:0.75rem;margin-right:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-bottom:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .alert-queue-count{margin-left:1rem;margin-right:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host{display:block}:host .container{pointer-events:none;position:fixed;left:0px;right:0px;bottom:0px;margin-top:0px;margin-bottom:0px;margin-left:auto;margin-right:auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius);border-top:0px solid transparent;border-left:1px solid var(--calcite-ui-border-3);border-right:1px solid var(--calcite-ui-border-3);border-bottom:1px solid var(--calcite-ui-border-3);min-height:var(--calcite-alert-min-height);width:var(--calcite-alert-width);max-width:90%;max-height:0;z-index:101;-webkit-transform:translate3d(0, 1.5rem, 0);transform:translate3d(0, 1.5rem, 0);-webkit-transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out;transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container{display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.alert-close{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.alert-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([active]) .container:not(.queued){max-height:100%;border-top-width:2px;opacity:1;-webkit-transform:translate3d(0, -1.5rem, 0);transform:translate3d(0, -1.5rem, 0);pointer-events:initial}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:-ms-inline-flexbox;display:inline-flex;color:var(--calcite-ui-text-link)}.alert-content{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;padding:var(--calcite-alert-spacing-token-small) var(--calcite-alert-spacing-token-large);overflow-wrap:break-word;background-color:var(--calcite-ui-foreground-1);-ms-flex:1 1 auto;flex:1 1 auto;min-width:0;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:0 var(--calcite-alert-spacing-token-small);border-bottom-left-radius:var(--calcite-border-radius);border-bottom-right-radius:var(--calcite-border-radius)}.alert-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-alert-spacing-token-large);padding-inline-start:var(--calcite-alert-spacing-token-large)}.alert-content:only-child{padding:var(--calcite-alert-spacing-token-small)}.alert-icon{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;padding:var(--calcite-alert-spacing-token-small) var(--calcite-alert-spacing-token-large);-ms-flex:0 0 auto;flex:0 0 auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-foreground-1);padding-top:0px;padding-bottom:0px}.alert-close{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;padding:var(--calcite-alert-spacing-token-small) var(--calcite-alert-spacing-token-large);-ms-flex:0 0 auto;flex:0 0 auto;cursor:pointer;-ms-flex-item-align:stretch;align-self:stretch;border-style:none;background-color:var(--calcite-ui-foreground-1);padding-top:0px;padding-bottom:0px;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;overflow:hidden;border-end-end-radius:var(--calcite-border-radius)}.alert-close:hover,.alert-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.alert-close:active{background-color:var(--calcite-ui-foreground-3)}.alert-queue-count{visibility:hidden;display:-ms-flexbox;display:flex;cursor:default;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);opacity:0;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;overflow:hidden;border-left:0px solid transparent;border-right:0px solid transparent;border-top-right-radius:0}.alert-queue-count.active{visibility:visible;opacity:1}:host([auto-dismiss])>.alert-queue-count{-webkit-border-end:0px solid transparent;border-inline-end:0px solid transparent}.alert-dismiss-progress{position:absolute;left:0px;right:0px;display:block;width:100%;overflow:hidden;top:-2px;height:2px;z-index:103;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.alert-dismiss-progress:after{position:absolute;top:0px;display:block;height:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);z-index:104;inset-inline-end:0}:host([color=blue]) .container{border-top-color:var(--calcite-ui-info)}:host([color=blue]) .container .alert-icon{color:var(--calcite-ui-info)}:host([color=red]) .container{border-top-color:var(--calcite-ui-danger)}:host([color=red]) .container .alert-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-top-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .alert-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-top-color:var(--calcite-ui-success)}:host([color=green]) .container .alert-icon{color:var(--calcite-ui-success)}:host([auto-dismiss-duration=fast]) .alert-dismiss-progress:after{-webkit-animation:dismissProgress 6000ms ease-out;animation:dismissProgress 6000ms ease-out}:host([auto-dismiss-duration=medium]) .alert-dismiss-progress:after{-webkit-animation:dismissProgress 10000ms ease-out;animation:dismissProgress 10000ms ease-out}:host([auto-dismiss-duration=slow]) .alert-dismiss-progress:after{-webkit-animation:dismissProgress 14000ms ease-out;animation:dismissProgress 14000ms ease-out}@-webkit-keyframes dismissProgress{0%{width:0px}0%{opacity:0.75}100%{width:100%}100%{opacity:1}}@keyframes dismissProgress{0%{width:0px}0%{opacity:0.75}100%{width:100%}100%{opacity:1}}';var CalciteAlert=function(){function t(t){var e=this;registerInstance(this,t);this.calciteAlertClose=createEvent(this,"calciteAlertClose",7);this.calciteAlertOpen=createEvent(this,"calciteAlertOpen",7);this.calciteAlertSync=createEvent(this,"calciteAlertSync",7);this.calciteAlertRegister=createEvent(this,"calciteAlertRegister",7);this.active=false;this.autoDismiss=false;this.autoDismissDuration=this.autoDismiss?"medium":null;this.color="blue";this.intlClose=TEXT.intlClose;this.scale="m";this.queue=[];this.queueLength=0;this.queued=false;this.autoDismissTimeoutId=null;this.trackTimer=Date.now();this.closeAlert=function(){e.autoDismissTimeoutId=null;e.queued=false;e.active=false;e.queue=e.queue.filter((function(t){return t!==e.el}));e.determineActiveAlert();e.calciteAlertSync.emit({queue:e.queue});e.calciteAlertClose.emit({el:e.el,queue:e.queue})}}t.prototype.watchActive=function(){var t=this;if(this.active&&!this.queued){this.calciteAlertRegister.emit()}if(!this.active){this.queue=this.queue.filter((function(e){return e!==t.el}));this.calciteAlertSync.emit({queue:this.queue})}};t.prototype.updateRequestedIcon=function(){this.requestedIcon=setRequestedIcon(StatusIcons,this.icon,this.color)};t.prototype.updateDuration=function(){var t=this;if(this.autoDismiss&&this.autoDismissTimeoutId){window.clearTimeout(this.autoDismissTimeoutId);this.autoDismissTimeoutId=window.setTimeout((function(){return t.closeAlert()}),DURATIONS[this.autoDismissDuration]-(Date.now()-this.trackTimer))}};t.prototype.connectedCallback=function(){if(this.active&&!this.queued){this.calciteAlertRegister.emit()}};t.prototype.componentWillLoad=function(){this.requestedIcon=setRequestedIcon(StatusIcons,this.icon,this.color)};t.prototype.componentDidLoad=function(){this.alertLinkEl=this.el.querySelectorAll("calcite-link")[0]};t.prototype.disconnectedCallback=function(){window.clearTimeout(this.autoDismissTimeoutId)};t.prototype.render=function(){var t=this;var e=h("button",{"aria-label":this.intlClose,class:"alert-close",onClick:this.closeAlert,ref:function(e){return t.closeButton=e},type:"button"},h("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"}));var i="+"+(this.queueLength>2?this.queueLength-1:1);var a=h("div",{class:(this.queueLength>1?"active ":"")+"alert-queue-count"},h("calcite-chip",{scale:this.scale,value:i},i));var n=this,o=n.active,r=n.autoDismiss,s=n.label,l=n.queued,c=n.requestedIcon;var u=r?"alert":"alertdialog";var m=!o;return h(Host,{"aria-hidden":m.toString(),"aria-label":s,"calcite-hydrated-hidden":m,role:u},h("div",{class:{container:true,queued:l}},c?h("div",{class:"alert-icon"},h("calcite-icon",{icon:c,scale:this.scale==="l"?"m":"s"})):null,h("div",{class:"alert-content"},h("slot",{name:SLOTS.title}),h("slot",{name:SLOTS.message}),h("slot",{name:SLOTS.link})),a,!r?e:null,o&&!l&&r?h("div",{class:"alert-dismiss-progress"}):null))};t.prototype.alertSync=function(t){if(this.queue!==t.detail.queue){this.queue=t.detail.queue}this.queueLength=this.queue.length;this.determineActiveAlert()};t.prototype.alertRegister=function(){if(this.active&&!this.queue.includes(this.el)){this.queued=true;this.queue.push(this.el)}this.calciteAlertSync.emit({queue:this.queue});this.determineActiveAlert()};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.closeButton&&!this.alertLinkEl){return[2]}else if(this.alertLinkEl){this.alertLinkEl.setFocus()}else if(this.closeButton){this.closeButton.focus()}return[2]}))}))};t.prototype.determineActiveAlert=function(){var t=this;var e;if(((e=this.queue)===null||e===void 0?void 0:e[0])===this.el){this.openAlert();if(this.autoDismiss&&!this.autoDismissTimeoutId){this.trackTimer=Date.now();this.autoDismissTimeoutId=window.setTimeout((function(){return t.closeAlert()}),DURATIONS[this.autoDismissDuration])}}else{return}};t.prototype.openAlert=function(){var t=this;window.clearTimeout(this.queueTimeout);this.queueTimeout=window.setTimeout((function(){return t.queued=false}),300);this.calciteAlertOpen.emit({el:this.el,queue:this.queue})};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{active:["watchActive"],icon:["updateRequestedIcon"],color:["updateRequestedIcon"],autoDismissDuration:["updateDuration"]}},enumerable:false,configurable:true});return t}();CalciteAlert.style=calciteAlertCss;export{CalciteAlert as calcite_alert};
|
|
5
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-9de00868.js";import{s as setRequestedIcon}from"./dom-e55f9eaf.js";import{S as StatusIcons}from"./interfaces-51dc4e1b.js";import"./guid-196bd5ea.js";var TEXT={intlClose:"Close"};var DURATIONS={slow:14e3,medium:1e4,fast:6e3};var SLOTS={title:"title",message:"message",link:"link"};var calciteAlertCss='@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .alert-queue-count{margin-left:0.5rem;margin-right:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=s]) .alert-close{padding:0.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .alert-queue-count{margin-left:0.75rem;margin-right:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-bottom:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .alert-queue-count{margin-left:1rem;margin-right:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host{--calcite-alert-edge-distance:2rem;display:block}:host .container{pointer-events:none;position:fixed;margin-top:0px;margin-bottom:0px;margin-left:auto;margin-right:auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--calcite-ui-foreground-1);opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius);border-top:0px solid transparent;border-left:1px solid var(--calcite-ui-border-3);border-right:1px solid var(--calcite-ui-border-3);border-bottom:1px solid var(--calcite-ui-border-3);min-height:var(--calcite-alert-min-height);width:var(--calcite-alert-width);max-width:calc(100% - (var(--calcite-alert-edge-distance) * 2 + 2px));max-height:0;z-index:101;-webkit-transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out;transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}:host .container.bottom,:host .container.top{inset-inline-end:0;inset-inline-start:0}:host .container[class*=bottom]{-webkit-transform:translate3d(0, var(--calcite-alert-edge-distance), 0);transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}:host .container[class*=top]{-webkit-transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}:host .container[class*=-start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}:host .container[class*=-end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.container{display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.alert-close{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.alert-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([active]) .container:not(.queued){max-height:100%;border-top-width:2px;opacity:1;pointer-events:initial}:host([active]) .container:not(.queued)[class*=bottom]{-webkit-transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit);transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([active]) .container:not(.queued)[class*=top]{-webkit-transform:translate3d(0, var(--calcite-alert-edge-distance), inherit);transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:-ms-inline-flexbox;display:inline-flex;color:var(--calcite-ui-text-link)}.alert-content{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;padding:var(--calcite-alert-spacing-token-small) var(--calcite-alert-spacing-token-large);overflow-wrap:break-word;background-color:var(--calcite-ui-foreground-1);-ms-flex:1 1 auto;flex:1 1 auto;min-width:0;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:0 var(--calcite-alert-spacing-token-small);border-bottom-left-radius:var(--calcite-border-radius);border-bottom-right-radius:var(--calcite-border-radius)}.alert-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-alert-spacing-token-large);padding-inline-start:var(--calcite-alert-spacing-token-large)}.alert-content:only-child{padding:var(--calcite-alert-spacing-token-small)}.alert-icon{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;padding:var(--calcite-alert-spacing-token-small) var(--calcite-alert-spacing-token-large);-ms-flex:0 0 auto;flex:0 0 auto;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-foreground-1);padding-top:0px;padding-bottom:0px}.alert-close{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;padding:var(--calcite-alert-spacing-token-small) var(--calcite-alert-spacing-token-large);-ms-flex:0 0 auto;flex:0 0 auto;cursor:pointer;-ms-flex-item-align:stretch;align-self:stretch;border-style:none;background-color:var(--calcite-ui-foreground-1);padding-top:0px;padding-bottom:0px;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;overflow:hidden;border-end-end-radius:var(--calcite-border-radius)}.alert-close:hover,.alert-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.alert-close:active{background-color:var(--calcite-ui-foreground-3)}.alert-queue-count{visibility:hidden;display:-ms-flexbox;display:flex;cursor:default;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around;-ms-flex-item-align:stretch;align-self:stretch;background-color:var(--calcite-ui-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);opacity:0;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;overflow:hidden;border-left:0px solid transparent;border-right:0px solid transparent;border-top-right-radius:0}.alert-queue-count.active{visibility:visible;opacity:1}:host([auto-dismiss])>.alert-queue-count{-webkit-border-end:0px solid transparent;border-inline-end:0px solid transparent}.alert-dismiss-progress{position:absolute;left:0px;right:0px;display:block;width:100%;overflow:hidden;top:-2px;height:2px;z-index:103;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.alert-dismiss-progress:after{position:absolute;top:0px;display:block;height:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);z-index:104;inset-inline-end:0}:host([color=blue]) .container{border-top-color:var(--calcite-ui-info)}:host([color=blue]) .container .alert-icon{color:var(--calcite-ui-info)}:host([color=red]) .container{border-top-color:var(--calcite-ui-danger)}:host([color=red]) .container .alert-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-top-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .alert-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-top-color:var(--calcite-ui-success)}:host([color=green]) .container .alert-icon{color:var(--calcite-ui-success)}:host([auto-dismiss-duration=fast]) .alert-dismiss-progress:after{-webkit-animation:dismissProgress 6000ms ease-out;animation:dismissProgress 6000ms ease-out}:host([auto-dismiss-duration=medium]) .alert-dismiss-progress:after{-webkit-animation:dismissProgress 10000ms ease-out;animation:dismissProgress 10000ms ease-out}:host([auto-dismiss-duration=slow]) .alert-dismiss-progress:after{-webkit-animation:dismissProgress 14000ms ease-out;animation:dismissProgress 14000ms ease-out}@-webkit-keyframes dismissProgress{0%{width:0px}0%{opacity:0.75}100%{width:100%}100%{opacity:1}}@keyframes dismissProgress{0%{width:0px}0%{opacity:0.75}100%{width:100%}100%{opacity:1}}';var CalciteAlert=function(){function t(t){var e=this;registerInstance(this,t);this.calciteAlertClose=createEvent(this,"calciteAlertClose",7);this.calciteAlertOpen=createEvent(this,"calciteAlertOpen",7);this.calciteAlertSync=createEvent(this,"calciteAlertSync",7);this.calciteAlertRegister=createEvent(this,"calciteAlertRegister",7);this.active=false;this.autoDismiss=false;this.autoDismissDuration=this.autoDismiss?"medium":null;this.color="blue";this.intlClose=TEXT.intlClose;this.placement="bottom";this.scale="m";this.queue=[];this.queueLength=0;this.queued=false;this.autoDismissTimeoutId=null;this.trackTimer=Date.now();this.closeAlert=function(){e.autoDismissTimeoutId=null;e.queued=false;e.active=false;e.queue=e.queue.filter((function(t){return t!==e.el}));e.determineActiveAlert();e.calciteAlertSync.emit({queue:e.queue});e.calciteAlertClose.emit({el:e.el,queue:e.queue})}}t.prototype.watchActive=function(){var t=this;if(this.active&&!this.queued){this.calciteAlertRegister.emit()}if(!this.active){this.queue=this.queue.filter((function(e){return e!==t.el}));this.calciteAlertSync.emit({queue:this.queue})}};t.prototype.updateRequestedIcon=function(){this.requestedIcon=setRequestedIcon(StatusIcons,this.icon,this.color)};t.prototype.updateDuration=function(){var t=this;if(this.autoDismiss&&this.autoDismissTimeoutId){window.clearTimeout(this.autoDismissTimeoutId);this.autoDismissTimeoutId=window.setTimeout((function(){return t.closeAlert()}),DURATIONS[this.autoDismissDuration]-(Date.now()-this.trackTimer))}};t.prototype.connectedCallback=function(){if(this.active&&!this.queued){this.calciteAlertRegister.emit()}};t.prototype.componentWillLoad=function(){this.requestedIcon=setRequestedIcon(StatusIcons,this.icon,this.color)};t.prototype.componentDidLoad=function(){this.alertLinkEl=this.el.querySelectorAll("calcite-link")[0]};t.prototype.disconnectedCallback=function(){window.clearTimeout(this.autoDismissTimeoutId)};t.prototype.render=function(){var t;var e=this;var i=h("button",{"aria-label":this.intlClose,class:"alert-close",onClick:this.closeAlert,ref:function(t){return e.closeButton=t},type:"button"},h("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"}));var a="+"+(this.queueLength>2?this.queueLength-1:1);var n=h("div",{class:(this.queueLength>1?"active ":"")+"alert-queue-count"},h("calcite-chip",{scale:this.scale,value:a},a));var o=this,r=o.active,s=o.autoDismiss,l=o.label,c=o.placement,u=o.queued,d=o.requestedIcon;var m=s?"alert":"alertdialog";var p=!r;return h(Host,{"aria-hidden":p.toString(),"aria-label":l,"calcite-hydrated-hidden":p,role:m},h("div",{class:(t={container:true,queued:u},t[c]=true,t)},d?h("div",{class:"alert-icon"},h("calcite-icon",{icon:d,scale:this.scale==="l"?"m":"s"})):null,h("div",{class:"alert-content"},h("slot",{name:SLOTS.title}),h("slot",{name:SLOTS.message}),h("slot",{name:SLOTS.link})),n,!s?i:null,r&&!u&&s?h("div",{class:"alert-dismiss-progress"}):null))};t.prototype.alertSync=function(t){if(this.queue!==t.detail.queue){this.queue=t.detail.queue}this.queueLength=this.queue.length;this.determineActiveAlert()};t.prototype.alertRegister=function(){if(this.active&&!this.queue.includes(this.el)){this.queued=true;this.queue.push(this.el)}this.calciteAlertSync.emit({queue:this.queue});this.determineActiveAlert()};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(!this.closeButton&&!this.alertLinkEl){return[2]}else if(this.alertLinkEl){this.alertLinkEl.setFocus()}else if(this.closeButton){this.closeButton.focus()}return[2]}))}))};t.prototype.determineActiveAlert=function(){var t=this;var e;if(((e=this.queue)===null||e===void 0?void 0:e[0])===this.el){this.openAlert();if(this.autoDismiss&&!this.autoDismissTimeoutId){this.trackTimer=Date.now();this.autoDismissTimeoutId=window.setTimeout((function(){return t.closeAlert()}),DURATIONS[this.autoDismissDuration])}}else{return}};t.prototype.openAlert=function(){var t=this;window.clearTimeout(this.queueTimeout);this.queueTimeout=window.setTimeout((function(){return t.queued=false}),300);this.calciteAlertOpen.emit({el:this.el,queue:this.queue})};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{active:["watchActive"],icon:["updateRequestedIcon"],color:["updateRequestedIcon"],autoDismissDuration:["updateDuration"]}},enumerable:false,configurable:true});return t}();CalciteAlert.style=calciteAlertCss;export{CalciteAlert as calcite_alert};
|