@haiilo/catalyst 0.4.0 → 0.5.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/package.json +7 -6
- package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/catalyst/catalyst.css +0 -1
- package/dist/catalyst/catalyst.esm.js +0 -2
- package/dist/catalyst/catalyst.esm.js.map +0 -1
- package/dist/catalyst/index.cdn.js +0 -21
- package/dist/catalyst/index.esm.js +0 -2
- package/dist/catalyst/index.esm.js.map +0 -1
- package/dist/catalyst/p-89a97b7b.entry.js +0 -10
- package/dist/catalyst/p-89a97b7b.entry.js.map +0 -1
- package/dist/catalyst/p-ed826597.js +0 -2
- package/dist/catalyst/p-ed826597.js.map +0 -1
- package/dist/catalyst/p-ef0a8ae9.js +0 -2
- package/dist/catalyst/p-ef0a8ae9.js.map +0 -1
- package/dist/catalyst/p-f151cb13.js +0 -2
- package/dist/catalyst/p-f151cb13.js.map +0 -1
- package/dist/cjs/app-globals-7f2b1f8e.js +0 -173
- package/dist/cjs/app-globals-7f2b1f8e.js.map +0 -1
- package/dist/cjs/cat-alert_9.cjs.entry.js +0 -4557
- package/dist/cjs/cat-alert_9.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-850c538c.js +0 -47
- package/dist/cjs/cat-icon-registry-850c538c.js.map +0 -1
- package/dist/cjs/catalyst.cjs.js +0 -24
- package/dist/cjs/catalyst.cjs.js.map +0 -1
- package/dist/cjs/index-c0881ae0.js +0 -1348
- package/dist/cjs/index-c0881ae0.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -11
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -26
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
- package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
- package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
- package/dist/collection/collection-manifest.json +0 -21
- package/dist/collection/components/cat-alert/cat-alert.css +0 -57
- package/dist/collection/components/cat-alert/cat-alert.js +0 -50
- package/dist/collection/components/cat-alert/cat-alert.js.map +0 -1
- package/dist/collection/components/cat-badge/cat-badge.css +0 -154
- package/dist/collection/components/cat-badge/cat-badge.js +0 -142
- package/dist/collection/components/cat-badge/cat-badge.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.css +0 -323
- package/dist/collection/components/cat-button/cat-button.js +0 -591
- package/dist/collection/components/cat-button/cat-button.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +0 -42
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon.css +0 -50
- package/dist/collection/components/cat-icon/cat-icon.js +0 -90
- package/dist/collection/components/cat-icon/cat-icon.js.map +0 -1
- package/dist/collection/components/cat-menu/cat-menu.css +0 -33
- package/dist/collection/components/cat-menu/cat-menu.js +0 -184
- package/dist/collection/components/cat-menu/cat-menu.js.map +0 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.css +0 -69
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +0 -309
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +0 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.css +0 -177
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +0 -131
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +0 -1
- package/dist/collection/components/cat-spinner/cat-spinner.css +0 -63
- package/dist/collection/components/cat-spinner/cat-spinner.js +0 -65
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +0 -37
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +0 -254
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +0 -1
- package/dist/collection/index.cdn.js +0 -21
- package/dist/collection/index.js +0 -2
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/init.js +0 -9
- package/dist/collection/init.js.map +0 -1
- package/dist/collection/utils/breakpoints.js +0 -12
- package/dist/collection/utils/breakpoints.js.map +0 -1
- package/dist/collection/utils/first-tabbable.js +0 -6
- package/dist/collection/utils/first-tabbable.js.map +0 -1
- package/dist/collection/utils/is-touch-screen.js +0 -3
- package/dist/collection/utils/is-touch-screen.js.map +0 -1
- package/dist/collection/utils/media-matcher.js +0 -55
- package/dist/collection/utils/media-matcher.js.map +0 -1
- package/dist/collection/utils/platform.js +0 -50
- package/dist/collection/utils/platform.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/cat-alert.d.ts +0 -11
- package/dist/components/cat-alert.js +0 -44
- package/dist/components/cat-alert.js.map +0 -1
- package/dist/components/cat-badge.d.ts +0 -11
- package/dist/components/cat-badge.js +0 -68
- package/dist/components/cat-badge.js.map +0 -1
- package/dist/components/cat-button.d.ts +0 -11
- package/dist/components/cat-button.js +0 -654
- package/dist/components/cat-button.js.map +0 -1
- package/dist/components/cat-icon-registry.js +0 -45
- package/dist/components/cat-icon-registry.js.map +0 -1
- package/dist/components/cat-icon.d.ts +0 -11
- package/dist/components/cat-icon.js +0 -8
- package/dist/components/cat-icon.js.map +0 -1
- package/dist/components/cat-icon2.js +0 -48
- package/dist/components/cat-icon2.js.map +0 -1
- package/dist/components/cat-menu.d.ts +0 -11
- package/dist/components/cat-menu.js +0 -870
- package/dist/components/cat-menu.js.map +0 -1
- package/dist/components/cat-scrollable.d.ts +0 -11
- package/dist/components/cat-scrollable.js +0 -1363
- package/dist/components/cat-scrollable.js.map +0 -1
- package/dist/components/cat-skeleton.d.ts +0 -11
- package/dist/components/cat-skeleton.js +0 -78
- package/dist/components/cat-skeleton.js.map +0 -1
- package/dist/components/cat-spinner.d.ts +0 -11
- package/dist/components/cat-spinner.js +0 -8
- package/dist/components/cat-spinner.js.map +0 -1
- package/dist/components/cat-spinner2.js +0 -41
- package/dist/components/cat-spinner2.js.map +0 -1
- package/dist/components/cat-tooltip.d.ts +0 -11
- package/dist/components/cat-tooltip.js +0 -154
- package/dist/components/cat-tooltip.js.map +0 -1
- package/dist/components/first-tabbable.js +0 -1495
- package/dist/components/first-tabbable.js.map +0 -1
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -173
- package/dist/components/index.js.map +0 -1
- package/dist/esm/app-globals-8af9b2cf.js +0 -171
- package/dist/esm/app-globals-8af9b2cf.js.map +0 -1
- package/dist/esm/cat-alert_9.entry.js +0 -4545
- package/dist/esm/cat-alert_9.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-59da2e37.js +0 -45
- package/dist/esm/cat-icon-registry-59da2e37.js.map +0 -1
- package/dist/esm/catalyst.js +0 -22
- package/dist/esm/catalyst.js.map +0 -1
- package/dist/esm/index-0ff35bca.js +0 -1320
- package/dist/esm/index-0ff35bca.js.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -22
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/types/components/cat-alert/cat-alert.d.ts +0 -12
- package/dist/types/components/cat-badge/cat-badge.d.ts +0 -28
- package/dist/types/components/cat-button/cat-button.d.ts +0 -129
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +0 -15
- package/dist/types/components/cat-icon/cat-icon.d.ts +0 -23
- package/dist/types/components/cat-menu/cat-menu.d.ts +0 -31
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +0 -50
- package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +0 -28
- package/dist/types/components/cat-spinner/cat-spinner.d.ts +0 -15
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +0 -46
- package/dist/types/components.d.ts +0 -552
- package/dist/types/index.d.ts +0 -2
- package/dist/types/init.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/breakpoints.d.ts +0 -7
- package/dist/types/utils/first-tabbable.d.ts +0 -4
- package/dist/types/utils/is-touch-screen.d.ts +0 -2
- package/dist/types/utils/media-matcher.d.ts +0 -13
- package/dist/types/utils/platform.d.ts +0 -18
- package/dist/types/utils/utils.d.ts +0 -1
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
|
@@ -1,654 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$3 } from './cat-icon2.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './cat-spinner2.js';
|
|
4
|
-
|
|
5
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
|
-
|
|
7
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
8
|
-
return module = {
|
|
9
|
-
path: basedir,
|
|
10
|
-
exports: {},
|
|
11
|
-
require: function (path, base) {
|
|
12
|
-
return commonjsRequire();
|
|
13
|
-
}
|
|
14
|
-
}, fn(module, module.exports), module.exports;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function commonjsRequire () {
|
|
18
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var loglevel = createCommonjsModule(function (module) {
|
|
22
|
-
/*
|
|
23
|
-
* loglevel - https://github.com/pimterry/loglevel
|
|
24
|
-
*
|
|
25
|
-
* Copyright (c) 2013 Tim Perry
|
|
26
|
-
* Licensed under the MIT license.
|
|
27
|
-
*/
|
|
28
|
-
(function (root, definition) {
|
|
29
|
-
if (module.exports) {
|
|
30
|
-
module.exports = definition();
|
|
31
|
-
} else {
|
|
32
|
-
root.log = definition();
|
|
33
|
-
}
|
|
34
|
-
}(commonjsGlobal, function () {
|
|
35
|
-
|
|
36
|
-
// Slightly dubious tricks to cut down minimized file size
|
|
37
|
-
var noop = function() {};
|
|
38
|
-
var undefinedType = "undefined";
|
|
39
|
-
var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (
|
|
40
|
-
/Trident\/|MSIE /.test(window.navigator.userAgent)
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
var logMethods = [
|
|
44
|
-
"trace",
|
|
45
|
-
"debug",
|
|
46
|
-
"info",
|
|
47
|
-
"warn",
|
|
48
|
-
"error"
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
// Cross-browser bind equivalent that works at least back to IE6
|
|
52
|
-
function bindMethod(obj, methodName) {
|
|
53
|
-
var method = obj[methodName];
|
|
54
|
-
if (typeof method.bind === 'function') {
|
|
55
|
-
return method.bind(obj);
|
|
56
|
-
} else {
|
|
57
|
-
try {
|
|
58
|
-
return Function.prototype.bind.call(method, obj);
|
|
59
|
-
} catch (e) {
|
|
60
|
-
// Missing bind shim or IE8 + Modernizr, fallback to wrapping
|
|
61
|
-
return function() {
|
|
62
|
-
return Function.prototype.apply.apply(method, [obj, arguments]);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Trace() doesn't print the message in IE, so for that case we need to wrap it
|
|
69
|
-
function traceForIE() {
|
|
70
|
-
if (console.log) {
|
|
71
|
-
if (console.log.apply) {
|
|
72
|
-
console.log.apply(console, arguments);
|
|
73
|
-
} else {
|
|
74
|
-
// In old IE, native console methods themselves don't have apply().
|
|
75
|
-
Function.prototype.apply.apply(console.log, [console, arguments]);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (console.trace) console.trace();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Build the best logging method possible for this env
|
|
82
|
-
// Wherever possible we want to bind, not wrap, to preserve stack traces
|
|
83
|
-
function realMethod(methodName) {
|
|
84
|
-
if (methodName === 'debug') {
|
|
85
|
-
methodName = 'log';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (typeof console === undefinedType) {
|
|
89
|
-
return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives
|
|
90
|
-
} else if (methodName === 'trace' && isIE) {
|
|
91
|
-
return traceForIE;
|
|
92
|
-
} else if (console[methodName] !== undefined) {
|
|
93
|
-
return bindMethod(console, methodName);
|
|
94
|
-
} else if (console.log !== undefined) {
|
|
95
|
-
return bindMethod(console, 'log');
|
|
96
|
-
} else {
|
|
97
|
-
return noop;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// These private functions always need `this` to be set properly
|
|
102
|
-
|
|
103
|
-
function replaceLoggingMethods(level, loggerName) {
|
|
104
|
-
/*jshint validthis:true */
|
|
105
|
-
for (var i = 0; i < logMethods.length; i++) {
|
|
106
|
-
var methodName = logMethods[i];
|
|
107
|
-
this[methodName] = (i < level) ?
|
|
108
|
-
noop :
|
|
109
|
-
this.methodFactory(methodName, level, loggerName);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Define log.log as an alias for log.debug
|
|
113
|
-
this.log = this.debug;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// In old IE versions, the console isn't present until you first open it.
|
|
117
|
-
// We build realMethod() replacements here that regenerate logging methods
|
|
118
|
-
function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {
|
|
119
|
-
return function () {
|
|
120
|
-
if (typeof console !== undefinedType) {
|
|
121
|
-
replaceLoggingMethods.call(this, level, loggerName);
|
|
122
|
-
this[methodName].apply(this, arguments);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// By default, we use closely bound real methods wherever possible, and
|
|
128
|
-
// otherwise we wait for a console to appear, and then try again.
|
|
129
|
-
function defaultMethodFactory(methodName, level, loggerName) {
|
|
130
|
-
/*jshint validthis:true */
|
|
131
|
-
return realMethod(methodName) ||
|
|
132
|
-
enableLoggingWhenConsoleArrives.apply(this, arguments);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function Logger(name, defaultLevel, factory) {
|
|
136
|
-
var self = this;
|
|
137
|
-
var currentLevel;
|
|
138
|
-
defaultLevel = defaultLevel == null ? "WARN" : defaultLevel;
|
|
139
|
-
|
|
140
|
-
var storageKey = "loglevel";
|
|
141
|
-
if (typeof name === "string") {
|
|
142
|
-
storageKey += ":" + name;
|
|
143
|
-
} else if (typeof name === "symbol") {
|
|
144
|
-
storageKey = undefined;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function persistLevelIfPossible(levelNum) {
|
|
148
|
-
var levelName = (logMethods[levelNum] || 'silent').toUpperCase();
|
|
149
|
-
|
|
150
|
-
if (typeof window === undefinedType || !storageKey) return;
|
|
151
|
-
|
|
152
|
-
// Use localStorage if available
|
|
153
|
-
try {
|
|
154
|
-
window.localStorage[storageKey] = levelName;
|
|
155
|
-
return;
|
|
156
|
-
} catch (ignore) {}
|
|
157
|
-
|
|
158
|
-
// Use session cookie as fallback
|
|
159
|
-
try {
|
|
160
|
-
window.document.cookie =
|
|
161
|
-
encodeURIComponent(storageKey) + "=" + levelName + ";";
|
|
162
|
-
} catch (ignore) {}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function getPersistedLevel() {
|
|
166
|
-
var storedLevel;
|
|
167
|
-
|
|
168
|
-
if (typeof window === undefinedType || !storageKey) return;
|
|
169
|
-
|
|
170
|
-
try {
|
|
171
|
-
storedLevel = window.localStorage[storageKey];
|
|
172
|
-
} catch (ignore) {}
|
|
173
|
-
|
|
174
|
-
// Fallback to cookies if local storage gives us nothing
|
|
175
|
-
if (typeof storedLevel === undefinedType) {
|
|
176
|
-
try {
|
|
177
|
-
var cookie = window.document.cookie;
|
|
178
|
-
var location = cookie.indexOf(
|
|
179
|
-
encodeURIComponent(storageKey) + "=");
|
|
180
|
-
if (location !== -1) {
|
|
181
|
-
storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];
|
|
182
|
-
}
|
|
183
|
-
} catch (ignore) {}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// If the stored level is not valid, treat it as if nothing was stored.
|
|
187
|
-
if (self.levels[storedLevel] === undefined) {
|
|
188
|
-
storedLevel = undefined;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return storedLevel;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function clearPersistedLevel() {
|
|
195
|
-
if (typeof window === undefinedType || !storageKey) return;
|
|
196
|
-
|
|
197
|
-
// Use localStorage if available
|
|
198
|
-
try {
|
|
199
|
-
window.localStorage.removeItem(storageKey);
|
|
200
|
-
return;
|
|
201
|
-
} catch (ignore) {}
|
|
202
|
-
|
|
203
|
-
// Use session cookie as fallback
|
|
204
|
-
try {
|
|
205
|
-
window.document.cookie =
|
|
206
|
-
encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
207
|
-
} catch (ignore) {}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/*
|
|
211
|
-
*
|
|
212
|
-
* Public logger API - see https://github.com/pimterry/loglevel for details
|
|
213
|
-
*
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
self.name = name;
|
|
217
|
-
|
|
218
|
-
self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,
|
|
219
|
-
"ERROR": 4, "SILENT": 5};
|
|
220
|
-
|
|
221
|
-
self.methodFactory = factory || defaultMethodFactory;
|
|
222
|
-
|
|
223
|
-
self.getLevel = function () {
|
|
224
|
-
return currentLevel;
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
self.setLevel = function (level, persist) {
|
|
228
|
-
if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {
|
|
229
|
-
level = self.levels[level.toUpperCase()];
|
|
230
|
-
}
|
|
231
|
-
if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {
|
|
232
|
-
currentLevel = level;
|
|
233
|
-
if (persist !== false) { // defaults to true
|
|
234
|
-
persistLevelIfPossible(level);
|
|
235
|
-
}
|
|
236
|
-
replaceLoggingMethods.call(self, level, name);
|
|
237
|
-
if (typeof console === undefinedType && level < self.levels.SILENT) {
|
|
238
|
-
return "No console available for logging";
|
|
239
|
-
}
|
|
240
|
-
} else {
|
|
241
|
-
throw "log.setLevel() called with invalid level: " + level;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
self.setDefaultLevel = function (level) {
|
|
246
|
-
defaultLevel = level;
|
|
247
|
-
if (!getPersistedLevel()) {
|
|
248
|
-
self.setLevel(level, false);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
self.resetLevel = function () {
|
|
253
|
-
self.setLevel(defaultLevel, false);
|
|
254
|
-
clearPersistedLevel();
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
self.enableAll = function(persist) {
|
|
258
|
-
self.setLevel(self.levels.TRACE, persist);
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
self.disableAll = function(persist) {
|
|
262
|
-
self.setLevel(self.levels.SILENT, persist);
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
// Initialize with the right level
|
|
266
|
-
var initialLevel = getPersistedLevel();
|
|
267
|
-
if (initialLevel == null) {
|
|
268
|
-
initialLevel = defaultLevel;
|
|
269
|
-
}
|
|
270
|
-
self.setLevel(initialLevel, false);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/*
|
|
274
|
-
*
|
|
275
|
-
* Top-level API
|
|
276
|
-
*
|
|
277
|
-
*/
|
|
278
|
-
|
|
279
|
-
var defaultLogger = new Logger();
|
|
280
|
-
|
|
281
|
-
var _loggersByName = {};
|
|
282
|
-
defaultLogger.getLogger = function getLogger(name) {
|
|
283
|
-
if ((typeof name !== "symbol" && typeof name !== "string") || name === "") {
|
|
284
|
-
throw new TypeError("You must supply a name when creating a logger.");
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
var logger = _loggersByName[name];
|
|
288
|
-
if (!logger) {
|
|
289
|
-
logger = _loggersByName[name] = new Logger(
|
|
290
|
-
name, defaultLogger.getLevel(), defaultLogger.methodFactory);
|
|
291
|
-
}
|
|
292
|
-
return logger;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
// Grab the current global log variable in case of overwrite
|
|
296
|
-
var _log = (typeof window !== undefinedType) ? window.log : undefined;
|
|
297
|
-
defaultLogger.noConflict = function() {
|
|
298
|
-
if (typeof window !== undefinedType &&
|
|
299
|
-
window.log === defaultLogger) {
|
|
300
|
-
window.log = _log;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return defaultLogger;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
defaultLogger.getLoggers = function getLoggers() {
|
|
307
|
-
return _loggersByName;
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
// ES6 default export, for compatibility
|
|
311
|
-
defaultLogger['default'] = defaultLogger;
|
|
312
|
-
|
|
313
|
-
return defaultLogger;
|
|
314
|
-
}));
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
const _breakpoints = ['xs', 's', 'm', 'l', 'xl'];
|
|
318
|
-
const Breakpoints = {
|
|
319
|
-
xs: '(max-width: 539.98px)',
|
|
320
|
-
s: '(max-width: 767.98px)',
|
|
321
|
-
m: '(max-width: 991.98px)',
|
|
322
|
-
l: '(max-width: 1199.98px)',
|
|
323
|
-
xl: '(max-width: 1399.98px)'
|
|
324
|
-
};
|
|
325
|
-
function isBreakpoint(value) {
|
|
326
|
-
return typeof value === 'string' && _breakpoints.includes(value);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts
|
|
330
|
-
// Whether the current platform supports the V8 Break Iterator. The V8 check
|
|
331
|
-
// is necessary to detect all Blink based browsers.
|
|
332
|
-
let hasV8BreakIterator;
|
|
333
|
-
// We need a try/catch around the reference to `Intl`, because accessing it in some cases can
|
|
334
|
-
// cause IE to throw. These cases are tied to particular versions of Windows and can happen if
|
|
335
|
-
// the consumer is providing a polyfilled `Map`. See:
|
|
336
|
-
// https://github.com/Microsoft/ChakraCore/issues/3189
|
|
337
|
-
// https://github.com/angular/components/issues/15687
|
|
338
|
-
try {
|
|
339
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
340
|
-
hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator;
|
|
341
|
-
}
|
|
342
|
-
catch (_a) {
|
|
343
|
-
hasV8BreakIterator = false;
|
|
344
|
-
}
|
|
345
|
-
class Platform {
|
|
346
|
-
constructor() {
|
|
347
|
-
/** Whether the current browser is Microsoft Edge. */
|
|
348
|
-
this.EDGE = /(edge)/i.test(navigator.userAgent);
|
|
349
|
-
/** Whether the current rendering engine is Microsoft Trident. */
|
|
350
|
-
this.TRIDENT = /(msie|trident)/i.test(navigator.userAgent);
|
|
351
|
-
// EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
|
|
352
|
-
/** Whether the current rendering engine is Blink. */
|
|
353
|
-
this.BLINK =
|
|
354
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
355
|
-
!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;
|
|
356
|
-
// Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
|
|
357
|
-
// ensure that Webkit runs standalone and is not used as another engine's base.
|
|
358
|
-
/** Whether the current rendering engine is WebKit. */
|
|
359
|
-
this.WEBKIT = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;
|
|
360
|
-
/** Whether the current platform is Apple iOS. */
|
|
361
|
-
this.IOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
|
|
362
|
-
// It's difficult to detect the plain Gecko engine, because most of the browsers identify
|
|
363
|
-
// them self as Gecko-like browsers and modify the userAgent's according to that.
|
|
364
|
-
// Since we only cover one explicit Firefox case, we can simply check for Firefox
|
|
365
|
-
// instead of having an unstable check for Gecko.
|
|
366
|
-
/** Whether the current browser is Firefox. */
|
|
367
|
-
this.FIREFOX = /(firefox|minefield)/i.test(navigator.userAgent);
|
|
368
|
-
/** Whether the current platform is Android. */
|
|
369
|
-
// Trident on mobile adds the android platform to the userAgent to trick detections.
|
|
370
|
-
this.ANDROID = /android/i.test(navigator.userAgent) && !this.TRIDENT;
|
|
371
|
-
// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
|
|
372
|
-
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
|
|
373
|
-
// Safari browser should also use Webkit as its layout engine.
|
|
374
|
-
/** Whether the current browser is Safari. */
|
|
375
|
-
this.SAFARI = /safari/i.test(navigator.userAgent) && this.WEBKIT;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts
|
|
380
|
-
/** Global registry for all dynamically-created, injected media queries. */
|
|
381
|
-
const mediaQueriesForWebkitCompatibility = new Set();
|
|
382
|
-
/** Style tag that holds all of the dynamically-created media queries. */
|
|
383
|
-
let mediaQueryStyleNode;
|
|
384
|
-
/** A utility for calling matchMedia queries. */
|
|
385
|
-
class MediaMatcher {
|
|
386
|
-
constructor() {
|
|
387
|
-
this._platform = new Platform();
|
|
388
|
-
this._matchMedia = window.matchMedia.bind(window);
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Evaluates the given media query and returns the native MediaQueryList from which results
|
|
392
|
-
* can be retrieved.
|
|
393
|
-
* Confirms the layout engine will trigger for the selector query provided and returns the
|
|
394
|
-
* MediaQueryList for the query provided.
|
|
395
|
-
*/
|
|
396
|
-
matchMedia(query) {
|
|
397
|
-
if (this._platform.WEBKIT || this._platform.BLINK) {
|
|
398
|
-
createEmptyStyleRule(query);
|
|
399
|
-
}
|
|
400
|
-
return this._matchMedia(query);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Creates an empty stylesheet that is used to work around browser inconsistencies related to
|
|
405
|
-
* `matchMedia`. At the time of writing, it handles the following cases:
|
|
406
|
-
* 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`
|
|
407
|
-
* to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.
|
|
408
|
-
* 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules
|
|
409
|
-
* inside the `@media` match existing elements on the page. We work around it by having one rule
|
|
410
|
-
* targeting the `body`. See https://github.com/angular/components/issues/23546.
|
|
411
|
-
*/
|
|
412
|
-
function createEmptyStyleRule(query) {
|
|
413
|
-
if (mediaQueriesForWebkitCompatibility.has(query)) {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
try {
|
|
417
|
-
if (!mediaQueryStyleNode) {
|
|
418
|
-
mediaQueryStyleNode = document.createElement('style');
|
|
419
|
-
mediaQueryStyleNode.setAttribute('type', 'text/css');
|
|
420
|
-
document.head.appendChild(mediaQueryStyleNode);
|
|
421
|
-
}
|
|
422
|
-
if (mediaQueryStyleNode.sheet) {
|
|
423
|
-
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
|
|
424
|
-
mediaQueriesForWebkitCompatibility.add(query);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
catch (e) {
|
|
428
|
-
loglevel.error(e);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cat-button{font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:0.25rem;text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid #0071ff;outline-offset:1px}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:underline}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1rem;padding-right:1rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1rem;padding-right:1rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1rem;padding-right:1rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1rem;padding-right:1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1rem;padding-right:1rem}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host-context(nav) .cat-button-content{text-align:left}:host([hidden]){display:none}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
|
|
433
|
-
|
|
434
|
-
const CatButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
435
|
-
constructor() {
|
|
436
|
-
super();
|
|
437
|
-
this.__registerHost();
|
|
438
|
-
this.__attachShadow();
|
|
439
|
-
this.catClick = createEvent(this, "catClick", 7);
|
|
440
|
-
this.catFocus = createEvent(this, "catFocus", 7);
|
|
441
|
-
this.catBlur = createEvent(this, "catBlur", 7);
|
|
442
|
-
this._iconOnly = true;
|
|
443
|
-
/**
|
|
444
|
-
* The rendering style of the button.
|
|
445
|
-
*/
|
|
446
|
-
this.variant = 'outlined';
|
|
447
|
-
/**
|
|
448
|
-
* The color palette of the button.
|
|
449
|
-
*/
|
|
450
|
-
this.color = 'secondary';
|
|
451
|
-
/**
|
|
452
|
-
* The size of the button.
|
|
453
|
-
*/
|
|
454
|
-
this.size = 'm';
|
|
455
|
-
/**
|
|
456
|
-
* Specifies that the button should be disabled. A disabled button is unusable
|
|
457
|
-
* and un-clickable. Corresponds with the native HTML disabled attribute.
|
|
458
|
-
*/
|
|
459
|
-
this.disabled = false;
|
|
460
|
-
/**
|
|
461
|
-
* Displays the button in a loading state with a spinner. Just like a disabled
|
|
462
|
-
* button, an inactive button is unusable and un-clickable. However, it
|
|
463
|
-
* retains the current focus state.
|
|
464
|
-
*/
|
|
465
|
-
this.loading = false;
|
|
466
|
-
/**
|
|
467
|
-
* Allows the button to submit a form.
|
|
468
|
-
*/
|
|
469
|
-
this.submit = false;
|
|
470
|
-
/**
|
|
471
|
-
* Ellipse overflowing button content.
|
|
472
|
-
*/
|
|
473
|
-
this.ellipsed = true;
|
|
474
|
-
/**
|
|
475
|
-
* Use round button edges.
|
|
476
|
-
*/
|
|
477
|
-
this.round = false;
|
|
478
|
-
/**
|
|
479
|
-
* Hide the actual button content and only display the icon.
|
|
480
|
-
*/
|
|
481
|
-
this.iconOnly = false;
|
|
482
|
-
/**
|
|
483
|
-
* Display the icon as a suffix.
|
|
484
|
-
*/
|
|
485
|
-
this.iconSuffix = false;
|
|
486
|
-
}
|
|
487
|
-
onIconOnlyChanged(value) {
|
|
488
|
-
var _a, _b;
|
|
489
|
-
// teardown
|
|
490
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
491
|
-
(_a = this.mediaQueryList) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.mediaQueryListener);
|
|
492
|
-
this.mediaQueryList = undefined;
|
|
493
|
-
this.mediaQueryListener = undefined;
|
|
494
|
-
// setup
|
|
495
|
-
if (isBreakpoint(value)) {
|
|
496
|
-
(_b = this.mediaMatcher) !== null && _b !== void 0 ? _b : (this.mediaMatcher = new MediaMatcher());
|
|
497
|
-
this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);
|
|
498
|
-
this.mediaQueryListener = (event) => (this._iconOnly = event.matches);
|
|
499
|
-
this.mediaQueryList.addEventListener('change', this.mediaQueryListener);
|
|
500
|
-
this._iconOnly = this.mediaQueryList.matches;
|
|
501
|
-
}
|
|
502
|
-
else {
|
|
503
|
-
this._iconOnly = value;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
componentWillLoad() {
|
|
507
|
-
this.onIconOnlyChanged(this.iconOnly);
|
|
508
|
-
}
|
|
509
|
-
componentWillRender() {
|
|
510
|
-
if (this.isIconButton && !this.a11yLabel) {
|
|
511
|
-
loglevel.warn('[A11y] Missing ARIA label on icon button', this);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
haltDisabledEvents(event) {
|
|
515
|
-
if (this.disabled || this.loading) {
|
|
516
|
-
event.preventDefault();
|
|
517
|
-
event.stopImmediatePropagation();
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* Sets focus on the button. Use this method instead of `button.focus()`.
|
|
522
|
-
*
|
|
523
|
-
* @param options An optional object providing options to control aspects of
|
|
524
|
-
* the focusing process.
|
|
525
|
-
*/
|
|
526
|
-
async setFocus(options) {
|
|
527
|
-
this.button.focus(options);
|
|
528
|
-
}
|
|
529
|
-
render() {
|
|
530
|
-
var _a;
|
|
531
|
-
if (this.url) {
|
|
532
|
-
return (h("a", { ref: el => (this.button = el), href: this.disabled ? undefined : this.url, target: this.urlTarget, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
|
|
533
|
-
'cat-button': true,
|
|
534
|
-
'cat-button-icon': this.isIconButton,
|
|
535
|
-
'cat-button-round': this.round,
|
|
536
|
-
'cat-button-loading': this.loading,
|
|
537
|
-
'cat-button-disabled': this.disabled,
|
|
538
|
-
'cat-button-ellipsed': this.ellipsed && !this.isIconButton,
|
|
539
|
-
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
540
|
-
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
541
|
-
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
542
|
-
}, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
543
|
-
}
|
|
544
|
-
else {
|
|
545
|
-
return (h("button", { ref: el => (this.button = el), type: this.submit ? 'submit' : 'button', name: this.name, value: this.value, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : null, "aria-label": this.a11yLabel, id: this.buttonId, part: "button", class: {
|
|
546
|
-
'cat-button': true,
|
|
547
|
-
'cat-button-icon': this.isIconButton,
|
|
548
|
-
'cat-button-round': (_a = this.round) !== null && _a !== void 0 ? _a : this.isIconButton,
|
|
549
|
-
'cat-button-loading': this.loading,
|
|
550
|
-
'cat-button-disabled': this.disabled,
|
|
551
|
-
'cat-button-ellipsed': this.ellipsed && !this.isIconButton,
|
|
552
|
-
[`cat-button-${this.variant}`]: Boolean(this.variant),
|
|
553
|
-
[`cat-button-${this.color}`]: Boolean(this.color),
|
|
554
|
-
[`cat-button-${this.size}`]: Boolean(this.size)
|
|
555
|
-
}, onClick: this.onClick.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }, this.content));
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
get iconSize() {
|
|
559
|
-
switch (this.size) {
|
|
560
|
-
case 'xs':
|
|
561
|
-
return 's';
|
|
562
|
-
default:
|
|
563
|
-
return 'l';
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
get spinnerSize() {
|
|
567
|
-
switch (this.size) {
|
|
568
|
-
case 'xs':
|
|
569
|
-
return 'xs';
|
|
570
|
-
default:
|
|
571
|
-
return 'm';
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
get isIconButton() {
|
|
575
|
-
return Boolean(this.icon) && this._iconOnly;
|
|
576
|
-
}
|
|
577
|
-
get hasPrefixIcon() {
|
|
578
|
-
return Boolean(this.icon) && !this._iconOnly && !this.iconSuffix;
|
|
579
|
-
}
|
|
580
|
-
get hasSuffixIcon() {
|
|
581
|
-
return Boolean(this.icon) && !this._iconOnly && this.iconSuffix;
|
|
582
|
-
}
|
|
583
|
-
get content() {
|
|
584
|
-
return [
|
|
585
|
-
this.hasPrefixIcon ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-prefix", part: "prefix" })) : null,
|
|
586
|
-
this.isIconButton ? (h("cat-icon", { icon: this.icon, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" }, h("slot", null))),
|
|
587
|
-
this.hasSuffixIcon ? (h("cat-icon", { icon: this.icon, size: this.iconSize, class: "cat-button-suffix", part: "suffix" })) : null,
|
|
588
|
-
this.loading ? h("cat-spinner", { size: this.spinnerSize }) : null
|
|
589
|
-
];
|
|
590
|
-
}
|
|
591
|
-
onClick(event) {
|
|
592
|
-
this.catClick.emit(event);
|
|
593
|
-
}
|
|
594
|
-
onFocus(event) {
|
|
595
|
-
this.catFocus.emit(event);
|
|
596
|
-
}
|
|
597
|
-
onBlur(event) {
|
|
598
|
-
this.catBlur.emit(event);
|
|
599
|
-
}
|
|
600
|
-
static get watchers() { return {
|
|
601
|
-
"iconOnly": ["onIconOnlyChanged"]
|
|
602
|
-
}; }
|
|
603
|
-
static get style() { return catButtonCss; }
|
|
604
|
-
}, [1, "cat-button", {
|
|
605
|
-
"variant": [1],
|
|
606
|
-
"color": [1],
|
|
607
|
-
"size": [1],
|
|
608
|
-
"name": [1],
|
|
609
|
-
"value": [1],
|
|
610
|
-
"disabled": [4],
|
|
611
|
-
"loading": [4],
|
|
612
|
-
"submit": [4],
|
|
613
|
-
"ellipsed": [4],
|
|
614
|
-
"round": [4],
|
|
615
|
-
"url": [1],
|
|
616
|
-
"urlTarget": [1, "url-target"],
|
|
617
|
-
"icon": [1],
|
|
618
|
-
"iconOnly": [8, "icon-only"],
|
|
619
|
-
"iconSuffix": [4, "icon-suffix"],
|
|
620
|
-
"buttonId": [1, "button-id"],
|
|
621
|
-
"a11yLabel": [1, "a11y-label"],
|
|
622
|
-
"_iconOnly": [32],
|
|
623
|
-
"setFocus": [64]
|
|
624
|
-
}, [[0, "click", "haltDisabledEvents"]]]);
|
|
625
|
-
function defineCustomElement$1() {
|
|
626
|
-
if (typeof customElements === "undefined") {
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
const components = ["cat-button", "cat-icon", "cat-spinner"];
|
|
630
|
-
components.forEach(tagName => { switch (tagName) {
|
|
631
|
-
case "cat-button":
|
|
632
|
-
if (!customElements.get(tagName)) {
|
|
633
|
-
customElements.define(tagName, CatButton$1);
|
|
634
|
-
}
|
|
635
|
-
break;
|
|
636
|
-
case "cat-icon":
|
|
637
|
-
if (!customElements.get(tagName)) {
|
|
638
|
-
defineCustomElement$3();
|
|
639
|
-
}
|
|
640
|
-
break;
|
|
641
|
-
case "cat-spinner":
|
|
642
|
-
if (!customElements.get(tagName)) {
|
|
643
|
-
defineCustomElement$2();
|
|
644
|
-
}
|
|
645
|
-
break;
|
|
646
|
-
} });
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
const CatButton = CatButton$1;
|
|
650
|
-
const defineCustomElement = defineCustomElement$1;
|
|
651
|
-
|
|
652
|
-
export { CatButton, defineCustomElement };
|
|
653
|
-
|
|
654
|
-
//# sourceMappingURL=cat-button.js.map
|