@haiilo/catalyst 0.5.0 → 0.5.4
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/README.md +2 -0
- package/package.json +5 -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-23d54bc6.js +0 -2
- package/dist/catalyst/p-23d54bc6.js.map +0 -1
- package/dist/catalyst/p-84693f87.entry.js +0 -24
- package/dist/catalyst/p-84693f87.entry.js.map +0 -1
- package/dist/catalyst/p-8f5cfa78.js +0 -2
- package/dist/catalyst/p-8f5cfa78.js.map +0 -1
- package/dist/catalyst/p-fa7da4c6.js +0 -2
- package/dist/catalyst/p-fa7da4c6.js.map +0 -1
- package/dist/cjs/app-globals-50e7504d.js +0 -180
- package/dist/cjs/app-globals-50e7504d.js.map +0 -1
- package/dist/cjs/cat-alert_15.cjs.entry.js +0 -4652
- package/dist/cjs/cat-alert_15.cjs.entry.js.map +0 -1
- package/dist/cjs/cat-icon-registry-6895750f.js +0 -441
- package/dist/cjs/cat-icon-registry-6895750f.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-2db8e23d.js +0 -1347
- package/dist/cjs/index-2db8e23d.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -12
- 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 -27
- package/dist/collection/components/cat-alert/cat-alert.css +0 -62
- package/dist/collection/components/cat-alert/cat-alert.js +0 -61
- 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 -143
- package/dist/collection/components/cat-badge/cat-badge.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.css +0 -333
- package/dist/collection/components/cat-button/cat-button.js +0 -615
- package/dist/collection/components/cat-button/cat-button.js.map +0 -1
- package/dist/collection/components/cat-card/cat-card.css +0 -25
- package/dist/collection/components/cat-card/cat-card.js +0 -20
- package/dist/collection/components/cat-card/cat-card.js.map +0 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +0 -105
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +0 -314
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +0 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +0 -69
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +0 -55
- 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 -91
- package/dist/collection/components/cat-icon/cat-icon.js.map +0 -1
- package/dist/collection/components/cat-input/cat-input.css +0 -131
- package/dist/collection/components/cat-input/cat-input.js +0 -606
- package/dist/collection/components/cat-input/cat-input.js.map +0 -1
- package/dist/collection/components/cat-menu/cat-menu.css +0 -34
- 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-radio/cat-radio.css +0 -84
- package/dist/collection/components/cat-radio/cat-radio.js +0 -283
- package/dist/collection/components/cat-radio/cat-radio.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 -311
- 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-textarea/cat-textarea.css +0 -74
- package/dist/collection/components/cat-textarea/cat-textarea.js +0 -393
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +0 -1
- package/dist/collection/components/cat-toggle/cat-toggle.css +0 -93
- package/dist/collection/components/cat-toggle/cat-toggle.js +0 -283
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +0 -41
- 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 -3
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/init.js +0 -17
- 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/components/cat-alert.d.ts +0 -11
- package/dist/components/cat-alert.js +0 -53
- 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 -8
- package/dist/components/cat-button.js.map +0 -1
- package/dist/components/cat-button2.js +0 -346
- package/dist/components/cat-button2.js.map +0 -1
- package/dist/components/cat-card.d.ts +0 -11
- package/dist/components/cat-card.js +0 -35
- package/dist/components/cat-card.js.map +0 -1
- package/dist/components/cat-checkbox.d.ts +0 -11
- package/dist/components/cat-checkbox.js +0 -103
- package/dist/components/cat-checkbox.js.map +0 -1
- package/dist/components/cat-i18n-registry.js +0 -73
- package/dist/components/cat-i18n-registry.js.map +0 -1
- package/dist/components/cat-icon-registry.js +0 -59
- 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 -49
- package/dist/components/cat-icon2.js.map +0 -1
- package/dist/components/cat-input.d.ts +0 -11
- package/dist/components/cat-input.js +0 -172
- package/dist/components/cat-input.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-radio.d.ts +0 -11
- package/dist/components/cat-radio.js +0 -93
- package/dist/components/cat-radio.js.map +0 -1
- package/dist/components/cat-scrollable.d.ts +0 -11
- package/dist/components/cat-scrollable.js +0 -1362
- 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-textarea.d.ts +0 -11
- package/dist/components/cat-textarea.js +0 -119
- package/dist/components/cat-textarea.js.map +0 -1
- package/dist/components/cat-toggle.d.ts +0 -11
- package/dist/components/cat-toggle.js +0 -93
- package/dist/components/cat-toggle.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 -1496
- package/dist/components/first-tabbable.js.map +0 -1
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -182
- package/dist/components/index.js.map +0 -1
- package/dist/components/loglevel.js +0 -315
- package/dist/components/loglevel.js.map +0 -1
- package/dist/esm/app-globals-6906ac5c.js +0 -178
- package/dist/esm/app-globals-6906ac5c.js.map +0 -1
- package/dist/esm/cat-alert_15.entry.js +0 -4634
- package/dist/esm/cat-alert_15.entry.js.map +0 -1
- package/dist/esm/cat-icon-registry-77963c26.js +0 -437
- package/dist/esm/cat-icon-registry-77963c26.js.map +0 -1
- package/dist/esm/catalyst.js +0 -22
- package/dist/esm/catalyst.js.map +0 -1
- package/dist/esm/index-1f3ca03b.js +0 -1320
- package/dist/esm/index-1f3ca03b.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 -14
- package/dist/types/components/cat-badge/cat-badge.d.ts +0 -29
- package/dist/types/components/cat-button/cat-button.d.ts +0 -134
- package/dist/types/components/cat-card/cat-card.d.ts +0 -7
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +0 -69
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +0 -18
- 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-input/cat-input.d.ts +0 -130
- package/dist/types/components/cat-menu/cat-menu.d.ts +0 -31
- package/dist/types/components/cat-radio/cat-radio.d.ts +0 -63
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +0 -52
- 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-textarea/cat-textarea.d.ts +0 -85
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +0 -64
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +0 -46
- package/dist/types/components.d.ts +0 -1167
- package/dist/types/index.d.ts +0 -3
- 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/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,20 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h } from '@stencil/core';
|
|
2
|
-
/**
|
|
3
|
-
* Cards are surfaces that display content and actions on a single topic. They
|
|
4
|
-
* should be easy to scan for relevant and actionable information.
|
|
5
|
-
*/
|
|
6
|
-
export class CatCard {
|
|
7
|
-
render() {
|
|
8
|
-
return (h(Host, null,
|
|
9
|
-
h("slot", null)));
|
|
10
|
-
}
|
|
11
|
-
static get is() { return "cat-card"; }
|
|
12
|
-
static get encapsulation() { return "shadow"; }
|
|
13
|
-
static get originalStyleUrls() { return {
|
|
14
|
-
"$": ["cat-card.scss"]
|
|
15
|
-
}; }
|
|
16
|
-
static get styleUrls() { return {
|
|
17
|
-
"$": ["cat-card.css"]
|
|
18
|
-
}; }
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=cat-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat-card.js","sourceRoot":"","sources":["../../../src/components/cat-card/cat-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AAMH,MAAM,OAAO,OAAO;EAClB,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,eAAa,CACR,CACR,CAAC;EACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h } from '@stencil/core';\n\n/**\n * Cards are surfaces that display content and actions on a single topic. They\n * should be easy to scan for relevant and actionable information.\n */\n@Component({\n tag: 'cat-card',\n styleUrl: 'cat-card.scss',\n shadow: true\n})\nexport class CatCard {\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated file. Do not edit directly.
|
|
3
|
-
*/
|
|
4
|
-
/* stylelint-disable value-keyword-case */
|
|
5
|
-
/* stylelint-enable value-keyword-case */
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
margin-bottom: 1rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
:host([hidden]) {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
label {
|
|
16
|
-
flex: 0 1 auto;
|
|
17
|
-
display: flex;
|
|
18
|
-
gap: 0.5rem;
|
|
19
|
-
font-size: 0.9375rem;
|
|
20
|
-
line-height: 1.25rem;
|
|
21
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
22
|
-
-webkit-user-select: none;
|
|
23
|
-
-ms-user-select: none;
|
|
24
|
-
user-select: none;
|
|
25
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
input {
|
|
30
|
-
position: absolute !important;
|
|
31
|
-
width: 1px !important;
|
|
32
|
-
height: 1px !important;
|
|
33
|
-
padding: 0 !important;
|
|
34
|
-
margin: -1px !important;
|
|
35
|
-
overflow: hidden !important;
|
|
36
|
-
clip: rect(0, 0, 0, 0) !important;
|
|
37
|
-
white-space: nowrap !important;
|
|
38
|
-
border: 0 !important;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.box {
|
|
42
|
-
flex: 0 0 auto;
|
|
43
|
-
display: flex;
|
|
44
|
-
position: relative;
|
|
45
|
-
height: 1.25rem;
|
|
46
|
-
width: 1.25rem;
|
|
47
|
-
background-color: white;
|
|
48
|
-
border: 1px solid #d7dbe0;
|
|
49
|
-
border-radius: 0.125rem;
|
|
50
|
-
transition: background-color 0.13s ease, border-color 0.13s ease;
|
|
51
|
-
}
|
|
52
|
-
.box svg {
|
|
53
|
-
fill: none;
|
|
54
|
-
stroke-width: 2;
|
|
55
|
-
stroke-linecap: round;
|
|
56
|
-
stroke-linejoin: round;
|
|
57
|
-
stroke-dasharray: 16px;
|
|
58
|
-
stroke-dashoffset: 16px;
|
|
59
|
-
transition: all 0.13s ease;
|
|
60
|
-
width: 70%;
|
|
61
|
-
position: absolute;
|
|
62
|
-
top: 50%;
|
|
63
|
-
left: 50%;
|
|
64
|
-
transform: translate(-50%, -50%) scale(0.99);
|
|
65
|
-
}
|
|
66
|
-
:checked + .box {
|
|
67
|
-
background-color: rgb(var(--cat-primary-bg, 32, 127, 138));
|
|
68
|
-
border-color: rgb(var(--cat-primary-bg, 32, 127, 138));
|
|
69
|
-
stroke: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
70
|
-
}
|
|
71
|
-
:checked + .box .check {
|
|
72
|
-
stroke-dashoffset: 0;
|
|
73
|
-
}
|
|
74
|
-
:indeterminate + .box {
|
|
75
|
-
background-color: rgb(var(--cat-primary-bg, 32, 127, 138));
|
|
76
|
-
border-color: rgb(var(--cat-primary-bg, 32, 127, 138));
|
|
77
|
-
stroke: rgb(var(--cat-primary-fill, 255, 255, 255));
|
|
78
|
-
}
|
|
79
|
-
:indeterminate + .box .dash {
|
|
80
|
-
stroke-dashoffset: 0;
|
|
81
|
-
}
|
|
82
|
-
:focus-visible + .box {
|
|
83
|
-
outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
|
|
84
|
-
outline-offset: 1px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.label {
|
|
88
|
-
flex: 1 1 auto;
|
|
89
|
-
}
|
|
90
|
-
.is-hidden .label {
|
|
91
|
-
position: absolute !important;
|
|
92
|
-
width: 1px !important;
|
|
93
|
-
height: 1px !important;
|
|
94
|
-
padding: 0 !important;
|
|
95
|
-
margin: -1px !important;
|
|
96
|
-
overflow: hidden !important;
|
|
97
|
-
clip: rect(0, 0, 0, 0) !important;
|
|
98
|
-
white-space: nowrap !important;
|
|
99
|
-
border: 0 !important;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.is-disabled {
|
|
103
|
-
cursor: not-allowed;
|
|
104
|
-
color: rgb(var(--cat-font-color-muted, 105, 118, 135));
|
|
105
|
-
}
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { Component, Event, h, Method, Prop } from '@stencil/core';
|
|
2
|
-
import log from 'loglevel';
|
|
3
|
-
let nextUniqueId = 0;
|
|
4
|
-
/**
|
|
5
|
-
* Checkboxes are used to let a user choose one or more options from a limited
|
|
6
|
-
* number of options.
|
|
7
|
-
*
|
|
8
|
-
* @part checkbox - The checkbox element.
|
|
9
|
-
* @part label - The label content.
|
|
10
|
-
*/
|
|
11
|
-
export class CatCheckbox {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.id = `cat-checkbox-${nextUniqueId++}`;
|
|
14
|
-
/**
|
|
15
|
-
* Checked state of the checkbox
|
|
16
|
-
*/
|
|
17
|
-
this.checked = false;
|
|
18
|
-
/**
|
|
19
|
-
* Disabled state of the checkbox
|
|
20
|
-
*/
|
|
21
|
-
this.disabled = false;
|
|
22
|
-
/**
|
|
23
|
-
* Indeterminate state of the checkbox
|
|
24
|
-
*/
|
|
25
|
-
this.indeterminate = false;
|
|
26
|
-
/**
|
|
27
|
-
* Label of the checkbox which is presented in the UI
|
|
28
|
-
*/
|
|
29
|
-
this.label = '';
|
|
30
|
-
/**
|
|
31
|
-
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
32
|
-
*/
|
|
33
|
-
this.labelHidden = false;
|
|
34
|
-
/**
|
|
35
|
-
* Required state of the checkbox
|
|
36
|
-
*/
|
|
37
|
-
this.required = false;
|
|
38
|
-
}
|
|
39
|
-
componentDidLoad() {
|
|
40
|
-
if (this.input && this.indeterminate) {
|
|
41
|
-
this.input.indeterminate = true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
componentWillRender() {
|
|
45
|
-
if (!this.label) {
|
|
46
|
-
log.error('[A11y] Missing ARIA label on checkbox', this);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.
|
|
51
|
-
*
|
|
52
|
-
* @param options An optional object providing options to control aspects of
|
|
53
|
-
* the focusing process.
|
|
54
|
-
*/
|
|
55
|
-
async setFocus(options) {
|
|
56
|
-
this.input.focus(options);
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
return (h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled } },
|
|
60
|
-
h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }),
|
|
61
|
-
h("span", { class: "box", "aria-hidden": "true", part: "checkbox" },
|
|
62
|
-
h("svg", { class: "check", viewBox: "0 0 12 10" },
|
|
63
|
-
h("polyline", { points: "1.5 6 4.5 9 10.5 1" })),
|
|
64
|
-
h("svg", { class: "dash", viewBox: "0 0 12 10" },
|
|
65
|
-
h("polyline", { points: "1.5 5 10.5 5" }))),
|
|
66
|
-
h("span", { class: "label", part: "label" }, this.label)));
|
|
67
|
-
}
|
|
68
|
-
onInput(event) {
|
|
69
|
-
this.catChange.emit(event);
|
|
70
|
-
}
|
|
71
|
-
onFocus(event) {
|
|
72
|
-
this.catFocus.emit(event);
|
|
73
|
-
}
|
|
74
|
-
onBlur(event) {
|
|
75
|
-
this.catBlur.emit(event);
|
|
76
|
-
}
|
|
77
|
-
static get is() { return "cat-checkbox"; }
|
|
78
|
-
static get encapsulation() { return "shadow"; }
|
|
79
|
-
static get originalStyleUrls() { return {
|
|
80
|
-
"$": ["cat-checkbox.scss"]
|
|
81
|
-
}; }
|
|
82
|
-
static get styleUrls() { return {
|
|
83
|
-
"$": ["cat-checkbox.css"]
|
|
84
|
-
}; }
|
|
85
|
-
static get properties() { return {
|
|
86
|
-
"checked": {
|
|
87
|
-
"type": "boolean",
|
|
88
|
-
"mutable": false,
|
|
89
|
-
"complexType": {
|
|
90
|
-
"original": "boolean",
|
|
91
|
-
"resolved": "boolean",
|
|
92
|
-
"references": {}
|
|
93
|
-
},
|
|
94
|
-
"required": false,
|
|
95
|
-
"optional": false,
|
|
96
|
-
"docs": {
|
|
97
|
-
"tags": [],
|
|
98
|
-
"text": "Checked state of the checkbox"
|
|
99
|
-
},
|
|
100
|
-
"attribute": "checked",
|
|
101
|
-
"reflect": false,
|
|
102
|
-
"defaultValue": "false"
|
|
103
|
-
},
|
|
104
|
-
"disabled": {
|
|
105
|
-
"type": "boolean",
|
|
106
|
-
"mutable": false,
|
|
107
|
-
"complexType": {
|
|
108
|
-
"original": "boolean",
|
|
109
|
-
"resolved": "boolean",
|
|
110
|
-
"references": {}
|
|
111
|
-
},
|
|
112
|
-
"required": false,
|
|
113
|
-
"optional": false,
|
|
114
|
-
"docs": {
|
|
115
|
-
"tags": [],
|
|
116
|
-
"text": "Disabled state of the checkbox"
|
|
117
|
-
},
|
|
118
|
-
"attribute": "disabled",
|
|
119
|
-
"reflect": false,
|
|
120
|
-
"defaultValue": "false"
|
|
121
|
-
},
|
|
122
|
-
"indeterminate": {
|
|
123
|
-
"type": "boolean",
|
|
124
|
-
"mutable": false,
|
|
125
|
-
"complexType": {
|
|
126
|
-
"original": "boolean",
|
|
127
|
-
"resolved": "boolean",
|
|
128
|
-
"references": {}
|
|
129
|
-
},
|
|
130
|
-
"required": false,
|
|
131
|
-
"optional": false,
|
|
132
|
-
"docs": {
|
|
133
|
-
"tags": [],
|
|
134
|
-
"text": "Indeterminate state of the checkbox"
|
|
135
|
-
},
|
|
136
|
-
"attribute": "indeterminate",
|
|
137
|
-
"reflect": false,
|
|
138
|
-
"defaultValue": "false"
|
|
139
|
-
},
|
|
140
|
-
"label": {
|
|
141
|
-
"type": "string",
|
|
142
|
-
"mutable": false,
|
|
143
|
-
"complexType": {
|
|
144
|
-
"original": "string",
|
|
145
|
-
"resolved": "string",
|
|
146
|
-
"references": {}
|
|
147
|
-
},
|
|
148
|
-
"required": false,
|
|
149
|
-
"optional": false,
|
|
150
|
-
"docs": {
|
|
151
|
-
"tags": [],
|
|
152
|
-
"text": "Label of the checkbox which is presented in the UI"
|
|
153
|
-
},
|
|
154
|
-
"attribute": "label",
|
|
155
|
-
"reflect": false,
|
|
156
|
-
"defaultValue": "''"
|
|
157
|
-
},
|
|
158
|
-
"labelHidden": {
|
|
159
|
-
"type": "boolean",
|
|
160
|
-
"mutable": false,
|
|
161
|
-
"complexType": {
|
|
162
|
-
"original": "boolean",
|
|
163
|
-
"resolved": "boolean",
|
|
164
|
-
"references": {}
|
|
165
|
-
},
|
|
166
|
-
"required": false,
|
|
167
|
-
"optional": false,
|
|
168
|
-
"docs": {
|
|
169
|
-
"tags": [],
|
|
170
|
-
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
171
|
-
},
|
|
172
|
-
"attribute": "label-hidden",
|
|
173
|
-
"reflect": false,
|
|
174
|
-
"defaultValue": "false"
|
|
175
|
-
},
|
|
176
|
-
"name": {
|
|
177
|
-
"type": "string",
|
|
178
|
-
"mutable": false,
|
|
179
|
-
"complexType": {
|
|
180
|
-
"original": "string",
|
|
181
|
-
"resolved": "string | undefined",
|
|
182
|
-
"references": {}
|
|
183
|
-
},
|
|
184
|
-
"required": false,
|
|
185
|
-
"optional": true,
|
|
186
|
-
"docs": {
|
|
187
|
-
"tags": [],
|
|
188
|
-
"text": "The name of the input"
|
|
189
|
-
},
|
|
190
|
-
"attribute": "name",
|
|
191
|
-
"reflect": false
|
|
192
|
-
},
|
|
193
|
-
"required": {
|
|
194
|
-
"type": "boolean",
|
|
195
|
-
"mutable": false,
|
|
196
|
-
"complexType": {
|
|
197
|
-
"original": "boolean",
|
|
198
|
-
"resolved": "boolean",
|
|
199
|
-
"references": {}
|
|
200
|
-
},
|
|
201
|
-
"required": false,
|
|
202
|
-
"optional": false,
|
|
203
|
-
"docs": {
|
|
204
|
-
"tags": [],
|
|
205
|
-
"text": "Required state of the checkbox"
|
|
206
|
-
},
|
|
207
|
-
"attribute": "required",
|
|
208
|
-
"reflect": false,
|
|
209
|
-
"defaultValue": "false"
|
|
210
|
-
},
|
|
211
|
-
"value": {
|
|
212
|
-
"type": "string",
|
|
213
|
-
"mutable": false,
|
|
214
|
-
"complexType": {
|
|
215
|
-
"original": "string",
|
|
216
|
-
"resolved": "string | undefined",
|
|
217
|
-
"references": {}
|
|
218
|
-
},
|
|
219
|
-
"required": false,
|
|
220
|
-
"optional": true,
|
|
221
|
-
"docs": {
|
|
222
|
-
"tags": [],
|
|
223
|
-
"text": "The value of the checkbox"
|
|
224
|
-
},
|
|
225
|
-
"attribute": "value",
|
|
226
|
-
"reflect": false
|
|
227
|
-
}
|
|
228
|
-
}; }
|
|
229
|
-
static get events() { return [{
|
|
230
|
-
"method": "catChange",
|
|
231
|
-
"name": "catChange",
|
|
232
|
-
"bubbles": true,
|
|
233
|
-
"cancelable": true,
|
|
234
|
-
"composed": true,
|
|
235
|
-
"docs": {
|
|
236
|
-
"tags": [],
|
|
237
|
-
"text": "Emitted when the checked status of the checkbox is changed."
|
|
238
|
-
},
|
|
239
|
-
"complexType": {
|
|
240
|
-
"original": "any",
|
|
241
|
-
"resolved": "any",
|
|
242
|
-
"references": {}
|
|
243
|
-
}
|
|
244
|
-
}, {
|
|
245
|
-
"method": "catFocus",
|
|
246
|
-
"name": "catFocus",
|
|
247
|
-
"bubbles": true,
|
|
248
|
-
"cancelable": true,
|
|
249
|
-
"composed": true,
|
|
250
|
-
"docs": {
|
|
251
|
-
"tags": [],
|
|
252
|
-
"text": "Emitted when the checkbox received focus."
|
|
253
|
-
},
|
|
254
|
-
"complexType": {
|
|
255
|
-
"original": "FocusEvent",
|
|
256
|
-
"resolved": "FocusEvent",
|
|
257
|
-
"references": {
|
|
258
|
-
"FocusEvent": {
|
|
259
|
-
"location": "global"
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}, {
|
|
264
|
-
"method": "catBlur",
|
|
265
|
-
"name": "catBlur",
|
|
266
|
-
"bubbles": true,
|
|
267
|
-
"cancelable": true,
|
|
268
|
-
"composed": true,
|
|
269
|
-
"docs": {
|
|
270
|
-
"tags": [],
|
|
271
|
-
"text": "Emitted when the checkbox loses focus."
|
|
272
|
-
},
|
|
273
|
-
"complexType": {
|
|
274
|
-
"original": "FocusEvent",
|
|
275
|
-
"resolved": "FocusEvent",
|
|
276
|
-
"references": {
|
|
277
|
-
"FocusEvent": {
|
|
278
|
-
"location": "global"
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}]; }
|
|
283
|
-
static get methods() { return {
|
|
284
|
-
"setFocus": {
|
|
285
|
-
"complexType": {
|
|
286
|
-
"signature": "(options?: FocusOptions | undefined) => Promise<void>",
|
|
287
|
-
"parameters": [{
|
|
288
|
-
"tags": [{
|
|
289
|
-
"name": "param",
|
|
290
|
-
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
291
|
-
}],
|
|
292
|
-
"text": "An optional object providing options to control aspects of\nthe focusing process."
|
|
293
|
-
}],
|
|
294
|
-
"references": {
|
|
295
|
-
"Promise": {
|
|
296
|
-
"location": "global"
|
|
297
|
-
},
|
|
298
|
-
"FocusOptions": {
|
|
299
|
-
"location": "global"
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
"return": "Promise<void>"
|
|
303
|
-
},
|
|
304
|
-
"docs": {
|
|
305
|
-
"text": "Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.",
|
|
306
|
-
"tags": [{
|
|
307
|
-
"name": "param",
|
|
308
|
-
"text": "options An optional object providing options to control aspects of\nthe focusing process."
|
|
309
|
-
}]
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}; }
|
|
313
|
-
}
|
|
314
|
-
//# sourceMappingURL=cat-checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;GAMG;AAMH,MAAM,OAAO,WAAW;EALxB;IAMmB,OAAE,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAGvD;;OAEG;IACK,YAAO,GAAG,KAAK,CAAC;IAExB;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,kBAAa,GAAG,KAAK,CAAC;IAE9B;;OAEG;IACK,UAAK,GAAG,EAAE,CAAC;IAEnB;;OAEG;IACK,gBAAW,GAAG,KAAK,CAAC;IAO5B;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;GAuF1B;EAjEC,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,IAAI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AAK,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW;UACnC,gBAAU,MAAM,EAAC,cAAc,GAAY,CACvC,CACD;MACP,YAAM,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,IAC7B,IAAI,CAAC,KAAK,CACN,CACD,CACT,CAAC;EACJ,CAAC;EAEO,OAAO,CAAC,KAAY;IAC1B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC7B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Method, Prop } from '@stencil/core';\nimport log from 'loglevel';\n\nlet nextUniqueId = 0;\n\n/**\n * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @part checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n shadow: true\n})\nexport class CatCheckbox {\n private readonly id = `cat-checkbox-${nextUniqueId++}`;\n private input!: HTMLInputElement;\n\n /**\n * Checked state of the checkbox\n */\n @Prop() checked = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop() indeterminate = false;\n\n /**\n * Label of the checkbox which is presented in the UI\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input\n */\n @Prop() name?: string;\n\n /**\n * Required state of the checkbox\n */\n @Prop() required = false;\n\n /**\n * The value of the checkbox\n */\n @Prop() value?: string;\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\n }\n\n componentWillRender(): void {\n if (!this.label) {\n log.error('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <label htmlFor={this.id} class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled }}>\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\n </span>\n <span class=\"label\" part=\"label\">\n {this.label}\n </span>\n </label>\n );\n }\n\n private onInput(event: Event) {\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"]}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import log from 'loglevel';
|
|
2
|
-
export class CatI18nRegistry {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.lang = 'en';
|
|
5
|
-
this.messages = new Map();
|
|
6
|
-
// hide constructor
|
|
7
|
-
}
|
|
8
|
-
static getInstance() {
|
|
9
|
-
if (!CatI18nRegistry.instance) {
|
|
10
|
-
CatI18nRegistry.instance = new CatI18nRegistry();
|
|
11
|
-
}
|
|
12
|
-
return CatI18nRegistry.instance;
|
|
13
|
-
}
|
|
14
|
-
getLanguage() {
|
|
15
|
-
return this.lang;
|
|
16
|
-
}
|
|
17
|
-
setLanguage(lang) {
|
|
18
|
-
this.lang = lang;
|
|
19
|
-
}
|
|
20
|
-
getMessage(key) {
|
|
21
|
-
var _a;
|
|
22
|
-
const message = (_a = this.messages.get(this.lang)) === null || _a === void 0 ? void 0 : _a.get(key);
|
|
23
|
-
if (!message) {
|
|
24
|
-
log.error(`[CatI18nRegistry] Unknown message for lang ${this.lang}: ${key}`);
|
|
25
|
-
}
|
|
26
|
-
return message;
|
|
27
|
-
}
|
|
28
|
-
addMessage(lang, key, message) {
|
|
29
|
-
this.getDict(lang).set(key, message);
|
|
30
|
-
log.info(`[CatI18nRegistry] Added message for lang ${lang}: ${key}`);
|
|
31
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, key }));
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
addMessages(lang, i18n) {
|
|
35
|
-
this.messages.set(lang, Object.assign(Object.assign({}, this.getDict(lang)), i18n));
|
|
36
|
-
log.info(`[CatI18nRegistry] Added message for lang ${lang}: ${Object.keys(i18n).concat(', ')}`);
|
|
37
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, keys: Object.keys(i18n) }));
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
removeMessage(lang, key) {
|
|
41
|
-
this.getDict(lang).delete(key);
|
|
42
|
-
log.info(`[CatI18nRegistry] Removed message for lang ${lang}: ${key}`);
|
|
43
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-removed', { lang, key }));
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
removeMessages(lang, keys) {
|
|
47
|
-
const dict = this.getDict(lang);
|
|
48
|
-
keys.forEach(key => dict.delete(key));
|
|
49
|
-
log.info(`[CatI18nRegistry] Removed messages for lang ${lang}: ${keys.concat(', ')}`);
|
|
50
|
-
window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, keys }));
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
buildEvent(name, detail) {
|
|
54
|
-
return new CustomEvent(name, {
|
|
55
|
-
bubbles: true,
|
|
56
|
-
composed: true,
|
|
57
|
-
detail
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
getDict(lang) {
|
|
61
|
-
let messages = this.messages.get(lang);
|
|
62
|
-
if (!messages) {
|
|
63
|
-
messages = new Map();
|
|
64
|
-
this.messages.set(lang, messages);
|
|
65
|
-
}
|
|
66
|
-
return messages;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=cat-i18n-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat-i18n-registry.js","sourceRoot":"","sources":["../../../src/components/cat-i18n/cat-i18n-registry.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,MAAM,OAAO,eAAe;EAM1B;IAHQ,SAAI,GAAG,IAAI,CAAC;IACH,aAAQ,GAAqC,IAAI,GAAG,EAAE,CAAC;IAGtE,mBAAmB;EACrB,CAAC;EAED,MAAM,CAAC,WAAW;IAChB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;MAC7B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe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;MACb,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;MACrB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACnC;IACD,OAAO,QAAQ,CAAC;EAClB,CAAC;CACF","sourcesContent":["import log from 'loglevel';\n\nexport class CatI18nRegistry {\n private static instance: CatI18nRegistry;\n\n private lang = 'en';\n private readonly messages: Map<string, Map<string, string>> = new Map();\n\n private constructor() {\n // hide constructor\n }\n\n static getInstance(): CatI18nRegistry {\n if (!CatI18nRegistry.instance) {\n CatI18nRegistry.instance = new CatI18nRegistry();\n }\n return CatI18nRegistry.instance;\n }\n\n getLanguage(): string {\n return this.lang;\n }\n\n setLanguage(lang: string): void {\n this.lang = lang;\n }\n\n getMessage(key: string): string | undefined {\n const message = this.messages.get(this.lang)?.get(key);\n if (!message) {\n log.error(`[CatI18nRegistry] Unknown message for lang ${this.lang}: ${key}`);\n }\n return message;\n }\n\n addMessage(lang: string, key: string, message: string): CatI18nRegistry {\n this.getDict(lang).set(key, message);\n log.info(`[CatI18nRegistry] Added message for lang ${lang}: ${key}`);\n window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, key }));\n return this;\n }\n\n addMessages(lang: string, i18n: { [key: string]: string }): CatI18nRegistry {\n this.messages.set(lang, { ...this.getDict(lang), ...i18n });\n log.info(`[CatI18nRegistry] Added message for lang ${lang}: ${Object.keys(i18n).concat(', ')}`);\n window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, keys: Object.keys(i18n) }));\n return this;\n }\n\n removeMessage(lang: string, key: string): CatI18nRegistry {\n this.getDict(lang).delete(key);\n log.info(`[CatI18nRegistry] Removed message for lang ${lang}: ${key}`);\n window.dispatchEvent(this.buildEvent('cat-i18n-removed', { lang, key }));\n return this;\n }\n\n removeMessages(lang: string, keys: string[]): CatI18nRegistry {\n const dict = this.getDict(lang);\n keys.forEach(key => dict.delete(key));\n log.info(`[CatI18nRegistry] Removed messages for lang ${lang}: ${keys.concat(', ')}`);\n window.dispatchEvent(this.buildEvent('cat-i18n-added', { lang, keys }));\n return this;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n\n private getDict(lang: string) {\n let messages = this.messages.get(lang);\n if (!messages) {\n messages = new Map();\n this.messages.set(lang, messages);\n }\n return messages;\n }\n}\n"]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import log from 'loglevel';
|
|
2
|
-
export class CatIconRegistry {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.icons = new Map();
|
|
5
|
-
// hide constructor
|
|
6
|
-
}
|
|
7
|
-
static getInstance() {
|
|
8
|
-
if (!CatIconRegistry.instance) {
|
|
9
|
-
CatIconRegistry.instance = new CatIconRegistry();
|
|
10
|
-
}
|
|
11
|
-
return CatIconRegistry.instance;
|
|
12
|
-
}
|
|
13
|
-
getIcon(name, setName) {
|
|
14
|
-
const icon = this.icons.get(this.buildName(name, setName));
|
|
15
|
-
if (!icon) {
|
|
16
|
-
log.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);
|
|
17
|
-
}
|
|
18
|
-
return icon;
|
|
19
|
-
}
|
|
20
|
-
addIcon(name, data, setName) {
|
|
21
|
-
this.icons.set(this.buildName(name, setName), data);
|
|
22
|
-
log.info(`[CatIconRegistry] Added icon${setName ? ` to set ${setName}` : ''}: ${name}`);
|
|
23
|
-
window.dispatchEvent(this.buildEvent('cat-icon-added', { name, setName }));
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
addIcons(icons, setName) {
|
|
27
|
-
Object.entries(icons).forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));
|
|
28
|
-
log.info(`[CatIconRegistry] Added icons${setName ? ` to set ${setName}` : ''}: ${Object.keys(icons).concat(', ')}`);
|
|
29
|
-
window.dispatchEvent(this.buildEvent('cat-icons-added', { names: Object.keys(icons), setName }));
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
removeIcon(name, setName) {
|
|
33
|
-
this.icons.delete(this.buildName(name, setName));
|
|
34
|
-
log.info(`[CatIconRegistry] Removed icon${setName ? ` from set ${setName}` : ''}: ${name}`);
|
|
35
|
-
window.dispatchEvent(this.buildEvent('cat-icon-removed', { name, setName }));
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
removeIcons(names, setName) {
|
|
39
|
-
names.forEach(name => this.icons.delete(this.buildName(name, setName)));
|
|
40
|
-
log.info(`[CatIconRegistry] Removed icons${setName ? ` from set ${setName}` : ''}: ${names.concat(', ')}`);
|
|
41
|
-
window.dispatchEvent(this.buildEvent('cat-icons-removed', { names, setName }));
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
buildName(name, setName) {
|
|
45
|
-
return setName ? `${setName}:name` : name;
|
|
46
|
-
}
|
|
47
|
-
buildEvent(name, detail) {
|
|
48
|
-
return new CustomEvent(name, {
|
|
49
|
-
bubbles: true,
|
|
50
|
-
composed: true,
|
|
51
|
-
detail
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=cat-icon-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cat-icon-registry.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,MAAM,OAAO,eAAe;EAK1B;IAFiB,UAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IAGtD,mBAAmB;EACrB,CAAC;EAED,MAAM,CAAC,WAAW;IAChB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;MAC7B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;KAClD;IACD,OAAO,eAAe,CAAC,QAAQ,CAAC;EAClC,CAAC;EAED,OAAO,CAAC,IAAY,EAAE,OAAgB;IACpC,MAAM,IAAI,G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IAAI,CAAC;EAC5C,CAAC;EAEO,UAAU,CAAI,IAAY,EAAE,MAAU;IAC5C,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;MAC3B,OAAO,EAAE,IAAI;MACb,QAAQ,EAAE,IAAI;MACd,MAAM;KACP,CAAC,CAAC;EACL,CAAC;CACF","sourcesContent":["import log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcon(name: string, data: string, setName?: string): CatIconRegistry {\n this.icons.set(this.buildName(name, setName), data);\n log.info(`[CatIconRegistry] Added icon${setName ? ` to set ${setName}` : ''}: ${name}`);\n window.dispatchEvent(this.buildEvent('cat-icon-added', { name, setName }));\n return this;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string): CatIconRegistry {\n Object.entries(icons).forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(`[CatIconRegistry] Added icons${setName ? ` to set ${setName}` : ''}: ${Object.keys(icons).concat(', ')}`);\n window.dispatchEvent(this.buildEvent('cat-icons-added', { names: Object.keys(icons), setName }));\n return this;\n }\n\n removeIcon(name: string, setName?: string): CatIconRegistry {\n this.icons.delete(this.buildName(name, setName));\n log.info(`[CatIconRegistry] Removed icon${setName ? ` from set ${setName}` : ''}: ${name}`);\n window.dispatchEvent(this.buildEvent('cat-icon-removed', { name, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string): CatIconRegistry {\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(`[CatIconRegistry] Removed icons${setName ? ` from set ${setName}` : ''}: ${names.concat(', ')}`);\n window.dispatchEvent(this.buildEvent('cat-icons-removed', { names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:name` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n"]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-generated file. Do not edit directly.
|
|
3
|
-
*/
|
|
4
|
-
/* stylelint-disable value-keyword-case */
|
|
5
|
-
/* stylelint-enable value-keyword-case */
|
|
6
|
-
:host {
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
vertical-align: middle;
|
|
9
|
-
/* stylelint-disable property-no-vendor-prefix */
|
|
10
|
-
-webkit-user-select: none;
|
|
11
|
-
-ms-user-select: none;
|
|
12
|
-
user-select: none;
|
|
13
|
-
/* stylelint-enable property-no-vendor-prefix */
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:host([hidden]) {
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
span {
|
|
21
|
-
display: inline-flex;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
svg {
|
|
25
|
-
fill: currentColor;
|
|
26
|
-
stroke: none;
|
|
27
|
-
transform-origin: center center;
|
|
28
|
-
width: 1em;
|
|
29
|
-
height: 1em;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.icon-xs svg {
|
|
33
|
-
font-size: 0.75rem;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.icon-s svg {
|
|
37
|
-
font-size: 1rem;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.icon-m svg {
|
|
41
|
-
font-size: 1.25rem;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.icon-l svg {
|
|
45
|
-
font-size: 1.5rem;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.icon-xl svg {
|
|
49
|
-
font-size: 1.75rem;
|
|
50
|
-
}
|