kemet-ui 3.0.0 → 3.0.1
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/custom-elements.json +657 -715
- package/dist/components/kemet-accordion/kemet-accordion-panel.d.ts +2 -2
- package/dist/components/kemet-accordion/kemet-accordion-panel.js +1 -1
- package/dist/components/kemet-accordion/kemet-accordion-panel.js.map +1 -1
- package/dist/components/kemet-accordion/kemet-accordion.d.ts +3 -3
- package/dist/components/kemet-accordion/kemet-accordion.js +2 -1
- package/dist/components/kemet-accordion/kemet-accordion.js.map +1 -1
- package/dist/components/kemet-alert/kemet-alert.d.ts +2 -2
- package/dist/components/kemet-alert/kemet-alert.js.map +1 -1
- package/dist/components/kemet-badge/kemet-badge.js.map +1 -1
- package/dist/components/kemet-button/kemet-button.d.ts +2 -2
- package/dist/components/kemet-button/kemet-button.js +1 -1
- package/dist/components/kemet-button/kemet-button.js.map +1 -1
- package/dist/components/kemet-card/kemet-card.d.ts +1 -1
- package/dist/components/kemet-card/kemet-card.js +1 -1
- package/dist/components/kemet-card/kemet-card.js.map +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-current.d.ts +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-current.js.map +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.d.ts +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.js +1 -1
- package/dist/components/kemet-carousel/kemet-carousel-last.js.map +1 -1
- package/dist/components/kemet-carousel/kemet-carousel.d.ts +18 -14
- package/dist/components/kemet-carousel/kemet-carousel.js +32 -13
- package/dist/components/kemet-carousel/kemet-carousel.js.map +1 -1
- package/dist/components/kemet-checkbox/kemet-checkbox.d.ts +4 -4
- package/dist/components/kemet-checkbox/kemet-checkbox.js +4 -4
- package/dist/components/kemet-checkbox/kemet-checkbox.js.map +1 -1
- package/dist/components/kemet-combo/kemet-combo.d.ts +8 -8
- package/dist/components/kemet-combo/kemet-combo.js +13 -17
- package/dist/components/kemet-combo/kemet-combo.js.map +1 -1
- package/dist/components/kemet-count/kemet-count.d.ts +1 -1
- package/dist/components/kemet-count/kemet-count.js +1 -1
- package/dist/components/kemet-count/kemet-count.js.map +1 -1
- package/dist/components/kemet-draggable/kemet-draggable.d.ts +3 -3
- package/dist/components/kemet-draggable/kemet-draggable.js +6 -5
- package/dist/components/kemet-draggable/kemet-draggable.js.map +1 -1
- package/dist/components/kemet-drawer/kemet-drawer.d.ts +2 -2
- package/dist/components/kemet-drawer/kemet-drawer.js +2 -2
- package/dist/components/kemet-drawer/kemet-drawer.js.map +1 -1
- package/dist/components/kemet-drawer/styles.js +1 -0
- package/dist/components/kemet-drawer/styles.js.map +1 -1
- package/dist/components/kemet-fab/kemet-fab.d.ts +1 -1
- package/dist/components/kemet-fab/kemet-fab.js +1 -1
- package/dist/components/kemet-fab/kemet-fab.js.map +1 -1
- package/dist/components/kemet-field/kemet-field.d.ts +7 -7
- package/dist/components/kemet-field/kemet-field.js +9 -14
- package/dist/components/kemet-field/kemet-field.js.map +1 -1
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.d.ts +1 -1
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js +2 -3
- package/dist/components/kemet-flipcard/kemet-flipcard-trigger.js.map +1 -1
- package/dist/components/kemet-flipcard/kemet-flipcard.d.ts +2 -2
- package/dist/components/kemet-flipcard/kemet-flipcard.js +3 -5
- package/dist/components/kemet-flipcard/kemet-flipcard.js.map +1 -1
- package/dist/components/kemet-input/kemet-input.d.ts +3 -22
- package/dist/components/kemet-input/kemet-input.js +3 -23
- package/dist/components/kemet-input/kemet-input.js.map +1 -1
- package/dist/components/kemet-modal/kemet-modal.d.ts +4 -4
- package/dist/components/kemet-modal/kemet-modal.js +3 -3
- package/dist/components/kemet-modal/kemet-modal.js.map +1 -1
- package/dist/components/kemet-password/kemet-password.d.ts +14 -8
- package/dist/components/kemet-password/kemet-password.js +4 -33
- package/dist/components/kemet-password/kemet-password.js.map +1 -1
- package/dist/components/kemet-popper/kemet-popper-close.d.ts +1 -1
- package/dist/components/kemet-popper/kemet-popper-close.js +2 -3
- package/dist/components/kemet-popper/kemet-popper-close.js.map +1 -1
- package/dist/components/kemet-popper/kemet-popper.d.ts +18 -7
- package/dist/components/kemet-popper/kemet-popper.js +21 -25
- package/dist/components/kemet-popper/kemet-popper.js.map +1 -1
- package/dist/components/kemet-radio/kemet-radios.d.ts +5 -4
- package/dist/components/kemet-radio/kemet-radios.js +10 -4
- package/dist/components/kemet-radio/kemet-radios.js.map +1 -1
- package/dist/components/kemet-rotator/kemet-rotator.d.ts +1 -1
- package/dist/components/kemet-rotator/kemet-rotator.js +1 -2
- package/dist/components/kemet-rotator/kemet-rotator.js.map +1 -1
- package/dist/components/kemet-scroll-link/kemet-scroll-link.d.ts +2 -2
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js +11 -10
- package/dist/components/kemet-scroll-link/kemet-scroll-link.js.map +1 -1
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.d.ts +2 -2
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js +2 -7
- package/dist/components/kemet-scroll-nav/kemet-scroll-nav.js.map +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.d.ts +5 -4
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-paginator.js.map +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.d.ts +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap-slide.js.map +1 -1
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.d.ts +3 -2
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js +2 -7
- package/dist/components/kemet-scroll-snap/kemet-scroll-snap.js.map +1 -1
- package/dist/components/kemet-select/kemet-option.d.ts +1 -1
- package/dist/components/kemet-select/kemet-option.js +1 -1
- package/dist/components/kemet-select/kemet-option.js.map +1 -1
- package/dist/components/kemet-select/kemet-select.d.ts +19 -10
- package/dist/components/kemet-select/kemet-select.js +3 -44
- package/dist/components/kemet-select/kemet-select.js.map +1 -1
- package/dist/components/kemet-sortable/kemet-sortable.d.ts +5 -5
- package/dist/components/kemet-sortable/kemet-sortable.js +5 -5
- package/dist/components/kemet-sortable/kemet-sortable.js.map +1 -1
- package/dist/components/kemet-svgs/kemet-svgs.d.ts +1 -1
- package/dist/components/kemet-svgs/kemet-svgs.js +1 -1
- package/dist/components/kemet-svgs/kemet-svgs.js.map +1 -1
- package/dist/components/kemet-tabs/kemet-tab-panel.d.ts +1 -0
- package/dist/components/kemet-tabs/kemet-tab-panel.js +3 -0
- package/dist/components/kemet-tabs/kemet-tab-panel.js.map +1 -1
- package/dist/components/kemet-tabs/kemet-tab.d.ts +1 -0
- package/dist/components/kemet-tabs/kemet-tab.js +4 -1
- package/dist/components/kemet-tabs/kemet-tab.js.map +1 -1
- package/dist/components/kemet-tabs/kemet-tabs.d.ts +23 -14
- package/dist/components/kemet-tabs/kemet-tabs.js +3 -47
- package/dist/components/kemet-tabs/kemet-tabs.js.map +1 -1
- package/dist/components/kemet-textarea/kemet-textarea.js.map +1 -1
- package/dist/components/kemet-toggle/kemet-toggle.d.ts +3 -3
- package/dist/components/kemet-toggle/kemet-toggle.js +3 -3
- package/dist/components/kemet-toggle/kemet-toggle.js.map +1 -1
- package/dist/components/kemet-tooltip/kemet-tooltip.d.ts +2 -2
- package/dist/components/kemet-tooltip/kemet-tooltip.js +13 -12
- package/dist/components/kemet-tooltip/kemet-tooltip.js.map +1 -1
- package/dist/components/kemet-tracker/kemet-tracker-step.d.ts +2 -2
- package/dist/components/kemet-tracker/kemet-tracker-step.js +2 -2
- package/dist/components/kemet-tracker/kemet-tracker-step.js.map +1 -1
- package/dist/components/kemet-tracker/kemet-tracker.d.ts +2 -1
- package/dist/components/kemet-tracker/kemet-tracker.js.map +1 -1
- package/dist/components/kemet-upload/kemet-upload-file.js +1 -2
- package/dist/components/kemet-upload/kemet-upload-file.js.map +1 -1
- package/dist/components/kemet-upload/kemet-upload.d.ts +3 -3
- package/dist/components/kemet-upload/kemet-upload.js +3 -8
- package/dist/components/kemet-upload/kemet-upload.js.map +1 -1
- package/dist/kemet-components.bundle.js +98 -86
- package/dist/kemet-components.bundle.js.map +1 -1
- package/dist/kemet-components.cjs +8680 -8803
- package/dist/kemet-components.js +8680 -8803
- package/dist/styles/kemet.core.css +1 -561
- package/dist/styles/kemet.core.css.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/kemet-drawer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,MAAM,cAAc,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,IAAI,CAAC;AAEpE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/kemet-drawer/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,MAAM,cAAc,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,IAAI,CAAC;AAEpE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwG5B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAqCA,SAAS,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAsDzB,SAAS,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2DzB,SAAS,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAwDzB,SAAS,CAAC,cAAc,CAAC;;;;;;CAMxD,CAAC","sourcesContent":["import { css, unsafeCSS } from 'lit';\n\nconst documentHeight = `${document.documentElement.scrollHeight}px`;\n\nexport const stylesBase = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host {\n --kemet-drawer-overlay-color: rgb(var(--kemet-color-black) / 20%);\n --kemet-drawer-width: 300px;\n --kemet-drawer-height: 100%;\n --kemet-drawer-color: rgb(var(--kemet-color-gray-50));\n --kemet-drawer-background-color: rgb(var(--kemet-color-gray-950));\n\n width: 100%;\n }\n\n .off-canvas {\n position: relative;\n overflow: hidden;\n }\n\n .off-canvas__nav {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 100;\n visibility: hidden;\n height: 100%;\n overflow: auto;\n transition: all 0.5s;\n }\n\n .off-canvas__nav::after {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.2);\n content: '';\n opacity: 1;\n transition: opacity 0.5s;\n }\n\n :host([opened]) .off-canvas__nav::after {\n width: 0;\n height: 0;\n opacity: 0;\n transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s;\n }\n\n .off-canvas__pusher {\n position: relative;\n left: 0;\n z-index: 99;\n height: 100%;\n transition: transform 0.5s;\n }\n\n :host([overlay]) .off-canvas__pusher::after {\n position: absolute;\n top: 0;\n right: 0;\n width: 0;\n height: 0;\n background: var(--kemet-drawer-overlay-color);\n content: '';\n opacity: 0;\n transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s;\n }\n\n :host([opened]) .off-canvas__pusher::after {\n width: 100%;\n height: 100%;\n opacity: 1;\n transition: opacity 0.5s;\n transform: scale(2);\n }\n\n .off-canvas__content {\n position: relative;\n /* overflow-y: scroll; */\n min-height: 100vh;\n }\n\n .off-canvas__wrapper {\n position: relative;\n }\n\n ::slotted([slot=\"content\"]) {\n min-height: 100vh;\n }\n\n /* -------------------------------------- */\n /* custom properties */\n /* -------------------------------------- */\n\n .off-canvas__nav {\n width: var(--kemet-drawer-width);\n height: var(--kemet-drawer-height);\n color: var(--kemet-drawer-color);\n background: var(--kemet-drawer-background-color);\n }\n`;\n\nexport const stylesEffects = css`\n /* slide */\n :host([effect='slide']) .off-canvas__nav {\n visibility: visible;\n transform: translate3d(-100%, 0, 0);\n }\n\n :host([effect='slide'][opened]) .off-canvas__nav {\n visibility: visible;\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='slide']) .off-canvas__nav:after {\n display: none;\n }\n\n :host([effect='slide'][side='right']) .off-canvas__nav {\n transform: translate3d(100vw, 0, 0);\n }\n\n :host([effect='slide'][side='right'][opened]) .off-canvas__nav {\n transform: translate3d(calc(100vw - var(--kemet-drawer-width)), 0, 0);\n }\n\n :host([effect='slide'][side='top']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, calc(var(--kemet-drawer-height) * -1), 0);\n }\n\n :host([effect='slide'][side='top'][opened]) .off-canvas__nav {\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='slide'][side='bottom']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, ${unsafeCSS(documentHeight)}, 0);\n }\n\n :host([effect='slide'][side='bottom'][opened]) .off-canvas__nav {\n transform: translate3d(0, calc(100vh - var(--kemet-drawer-height)), 0);\n }\n\n /* reveal */\n :host([effect='reveal'][opened]) .off-canvas__pusher {\n transform: translate3d(var(--kemet-drawer-width), 0, 0);\n }\n\n :host([effect='reveal']) .off-canvas__nav {\n z-index: 1;\n }\n\n :host([effect='reveal'][opened]) .off-canvas__nav {\n visibility: visible;\n transition: transform 0.5s;\n }\n\n :host([effect='reveal']) .off-canvas__nav::after {\n display: none;\n }\n\n :host([effect='reveal'][side='right'][opened]) .off-canvas__pusher {\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='reveal'][side='right']) .off-canvas__nav {\n transform: translate3d(100vw, 0, 0);\n }\n\n :host([effect='reveal'][side='right'][opened]) .off-canvas__nav {\n transform: translate3d(calc(100vw - var(--kemet-drawer-width)), 0, 0);\n }\n\n :host([effect='reveal'][side='top']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, calc(var(--kemet-drawer-height) * -1), 0);\n }\n\n :host([effect='reveal'][side='top'][opened]) .off-canvas__nav {\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='reveal'][side='top'][opened]) .off-canvas__pusher {\n transform: translate3d(0, var(--kemet-drawer-height), 0);\n }\n\n :host([effect='reveal'][side='bottom']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, ${unsafeCSS(documentHeight)}, 0);\n }\n\n :host([effect='reveal'][side='bottom'][opened]) .off-canvas__nav {\n transform: translate3d(0, calc(100vh - var(--kemet-drawer-height)), 0);\n }\n\n :host([effect='reveal'][side='bottom'][opened]) .off-canvas__pusher {\n transform: translate3d(0, calc(var(--kemet-drawer-height) * -1), 0);\n }\n\n /* push */\n :host([effect='push'][opened]) .off-canvas__pusher {\n transform: translate3d(var(--kemet-drawer-width), 0, 0);\n }\n\n :host([effect='push']) .off-canvas__nav {\n transform: translate3d(-100%, 0, 0);\n }\n\n :host([effect='push'][opened]) .off-canvas__nav {\n visibility: visible;\n transition: transform 0.5s;\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='push']) .off-canvas__nav::after {\n display: none;\n }\n\n :host([effect='push'][side='right'][opened]) .off-canvas__pusher {\n transform: translate3d(calc(var(--kemet-drawer-width) * -1), 0, 0);\n }\n\n :host([effect='push'][side='right']) .off-canvas__nav {\n transform: translate3d(100vw, 0, 0);\n }\n\n :host([effect='push'][side='right'][opened]) .off-canvas__nav {\n transform: translate3d(calc(100vw - var(--kemet-drawer-width)), 0, 0);\n }\n\n :host([effect='push'][side='top']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, calc(var(--kemet-drawer-height) * -1), 0);\n }\n\n :host([effect='push'][side='top'][opened]) .off-canvas__nav {\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='push'][side='top'][opened]) .off-canvas__pusher {\n transform: translate3d(0, var(--kemet-drawer-height), 0);\n }\n\n :host([effect='push'][side='bottom']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height);\n transform: translate3d(0, ${unsafeCSS(documentHeight)}, 0);\n }\n\n :host([effect='push'][side='bottom'][opened]) .off-canvas__nav {\n transform: translate3d(0, calc(100vh - var(--kemet-drawer-height)), 0);\n }\n\n :host([effect='push'][side='bottom'][opened]) .off-canvas__pusher {\n transform: translate3d(0, calc(var(--kemet-drawer-height) * -1), 0);\n }\n\n /* scale */\n :host([effect='scale']) .off-canvas__pusher {\n transform-style: preserve-3d;\n }\n\n :host([effect='scale'][opened]) .off-canvas__pusher {\n transform: translate3d(0, 0, 0) scale(0.95);\n }\n\n :host([effect='scale']) .off-canvas__nav {\n opacity: 1;\n transform: translate3d(-100%, 0, 0);\n }\n\n :host([effect='scale'][opened]) .off-canvas__nav {\n visibility: visible;\n transition: transform 0.5s;\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='scale']) .off-canvas__nav::after {\n display: none;\n }\n\n :host([effect='scale'][side='right']) .off-canvas__nav {\n transform: translate3d(100vw, 0, 0);\n }\n\n :host([effect='scale'][side='right'][opened]) .off-canvas__nav {\n transform: translate3d(calc(100vw - var(--kemet-drawer-width)), 0, 0);\n }\n\n :host([effect='scale'][side='top']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, calc(var(--kemet-drawer-height) * -1), 0);\n }\n\n :host([effect='scale'][side='top'][opened]) .off-canvas__nav {\n transform: translate3d(0, 0, 0);\n }\n\n :host([effect='scale'][side='bottom']) .off-canvas__nav {\n width: 100vw;\n height: var(--kemet-drawer-height, 100vh);\n transform: translate3d(0, ${unsafeCSS(documentHeight)}, 0);\n }\n\n :host([effect='scale'][side='bottom'][opened]) .off-canvas__nav {\n transform: translate3d(0, calc(100vh - var(--kemet-drawer-height)), 0);\n }\n`;\n"]}
|
|
@@ -24,7 +24,7 @@ import { LitElement } from 'lit';
|
|
|
24
24
|
* @cssproperty --kemet-fab-pill-radius - The border radius of a pill fab.
|
|
25
25
|
*
|
|
26
26
|
* @csspart button - The button's container.
|
|
27
|
-
* @csspart icon - The FAB
|
|
27
|
+
* @csspart icon - The FAB icon.
|
|
28
28
|
* @csspart text - The text in the FAB.
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
@@ -27,7 +27,7 @@ import { stylesBase } from './styles';
|
|
|
27
27
|
* @cssproperty --kemet-fab-pill-radius - The border radius of a pill fab.
|
|
28
28
|
*
|
|
29
29
|
* @csspart button - The button's container.
|
|
30
|
-
* @csspart icon - The FAB
|
|
30
|
+
* @csspart icon - The FAB icon.
|
|
31
31
|
* @csspart text - The text in the FAB.
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-fab.js","sourceRoot":"","sources":["../../../src/components/kemet-fab/kemet-fab.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,IAAqB,QAAQ,GAA7B,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ED,IAAI,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE;YACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACtB;IACH,CAAC;CACF,CAAA;AArEQ,eAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAC7B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CAClC;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;+CAClC;AAnBH,QAAQ;IAD5B,aAAa,CAAC,WAAW,CAAC;GACN,QAAQ,CAsE5B;eAtEoB,QAAQ","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { stylesBase } from './styles';\n\n/**\n * @since 1.2.0\n * @status stable\n *\n * @tagname kemet-fab\n * @summary The FAB, or Floating Action Button, performs a primary action on a page.\n *\n * @prop {boolean} expanded - The expanded state of the button.\n * @prop {boolean} outlined - Outline style for a button.\n * @prop {boolean} disabled - Determines whether not a button is disabled.\n * @prop {boolean} pill - Displays the fab with rounded corners.\n * @prop {number} expandPoint - The distance, in pixels, where the fab should automatically expand.\n * @prop {number} collapsePoint - The distance, in pixels, where the fab should automatically collapse.\n *\n * @slot Icon - A slot for an icon to display.\n * @slot default - The text for the FAB.\n *\n * @cssproperty --kemet-fab-size - The width and height of the fab.\n * @cssproperty --kemet-fab-color - The text color of the fab.\n * @cssproperty --kemet-fab-background-color - The bg color of the tab.\n * @cssproperty --kemet-fab-outlined-color - The text color of an outlined fab.\n * @cssproperty --kemet-fab-outlined-border - The border of an outlined fab.\n * @cssproperty --kemet-fab-pill-radius - The border radius of a pill fab.\n *\n * @csspart button - The button's container.\n * @csspart icon - The FAB
|
|
1
|
+
{"version":3,"file":"kemet-fab.js","sourceRoot":"","sources":["../../../src/components/kemet-fab/kemet-fab.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,IAAqB,QAAQ,GAA7B,MAAqB,QAAS,SAAQ,UAAU;IAAhD;;QAIE,aAAQ,GAAY,KAAK,CAAC;QAG1B,aAAQ,GAAY,KAAK,CAAC;QAG1B,aAAQ,GAAY,KAAK,CAAC;IA4D5B,CAAC;IAjDC,YAAY;QACV,SAAS;QACT,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;uDACwC,IAAI,CAAC,QAAQ,kBAAkB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,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6CAClC;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;+CAClC;AAnBH,QAAQ;IAD5B,aAAa,CAAC,WAAW,CAAC;GACN,QAAQ,CAsE5B;eAtEoB,QAAQ","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { stylesBase } from './styles';\n\n/**\n * @since 1.2.0\n * @status stable\n *\n * @tagname kemet-fab\n * @summary The FAB, or Floating Action Button, performs a primary action on a page.\n *\n * @prop {boolean} expanded - The expanded state of the button.\n * @prop {boolean} outlined - Outline style for a button.\n * @prop {boolean} disabled - Determines whether not a button is disabled.\n * @prop {boolean} pill - Displays the fab with rounded corners.\n * @prop {number} expandPoint - The distance, in pixels, where the fab should automatically expand.\n * @prop {number} collapsePoint - The distance, in pixels, where the fab should automatically collapse.\n *\n * @slot Icon - A slot for an icon to display.\n * @slot default - The text for the FAB.\n *\n * @cssproperty --kemet-fab-size - The width and height of the fab.\n * @cssproperty --kemet-fab-color - The text color of the fab.\n * @cssproperty --kemet-fab-background-color - The bg color of the tab.\n * @cssproperty --kemet-fab-outlined-color - The text color of an outlined fab.\n * @cssproperty --kemet-fab-outlined-border - The border of an outlined fab.\n * @cssproperty --kemet-fab-pill-radius - The border radius of a pill fab.\n *\n * @csspart button - The button's container.\n * @csspart icon - The FAB icon.\n * @csspart text - The text in the FAB.\n *\n */\n\n@customElement('kemet-fab')\nexport default class KemetFAB extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: Boolean, reflect: true })\n expanded: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n outlined: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n @property({ type: Boolean, reflect: true })\n pill: boolean;\n\n @property({ type: Number, attribute: 'expand-point' })\n expandPoint: number;\n\n @property({ type: Number, attribute: 'collapse-point' })\n collapsePoint: number;\n\n firstUpdated() {\n // events\n window.addEventListener('scroll', this.handleScroll.bind(this));\n this.addEventListener('mouseover', this.handleMouseOver.bind(this));\n this.addEventListener('mouseout', this.handleMouseOut.bind(this));\n }\n\n render() {\n return html`\n <button class=\"button\" part=\"button\" ?disabled=${this.disabled} aria-disabled=${this.disabled ? 'true' : 'false'}>\n <span class=\"icon\" part=\"icon\">\n <slot name=\"icon\"></slot>\n </span>\n <span class=\"text\" part=\"text\">\n <slot></slot>\n </span>\n </button>\n `;\n }\n\n handleMouseOver() {\n if (!this.disabled) {\n this.expanded = true;\n }\n }\n\n handleMouseOut() {\n if (!this.disabled) {\n this.expanded = false;\n }\n }\n\n handleScroll() {\n if (window.scrollY > this.expandPoint) {\n this.expanded = true;\n }\n\n if (window.scrollY < this.expandPoint) {\n this.expanded = false;\n }\n\n if (window.scrollY > this.collapsePoint) {\n this.expanded = false;\n }\n\n if (window.scrollY < this.collapsePoint) {\n this.expanded = true;\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-fab': KemetFAB\n }\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import KemetTextarea from '../kemet-textarea/kemet-textarea';
|
|
|
10
10
|
* @tagname kemet-field
|
|
11
11
|
* @summary Used in combination with Input, Select, and Textarea, to make a Field.
|
|
12
12
|
*
|
|
13
|
-
* @prop {string} slug - Uniquely identifies the control. Use the same slug for slotted
|
|
13
|
+
* @prop {string} slug - Uniquely identifies the control. Use the same slug for slotted subcomponents.
|
|
14
14
|
* @prop {string} label - The label text
|
|
15
15
|
* @prop {string} message - The validation message for error or success
|
|
16
16
|
* @prop {boolean} focused - Determines if the containing input is focused
|
|
@@ -19,9 +19,9 @@ import KemetTextarea from '../kemet-textarea/kemet-textarea';
|
|
|
19
19
|
* @prop {number} length - The length of the containing input
|
|
20
20
|
* @prop {boolean} disabled - Determines the disabled state of the control
|
|
21
21
|
* @prop {string} errorIcon - The icon while in an error or warning state
|
|
22
|
-
* @prop {string} successIcon - The icon while in
|
|
22
|
+
* @prop {string} successIcon - The icon while in a success state
|
|
23
23
|
*
|
|
24
|
-
* @slot component - Allows
|
|
24
|
+
* @slot component - Allows subcomponents of the field to display.
|
|
25
25
|
*
|
|
26
26
|
* @csspart label - The label of the field.
|
|
27
27
|
* @csspart message - The validation message of the field.
|
|
@@ -49,10 +49,10 @@ export default class KemetField extends LitElement {
|
|
|
49
49
|
render(): import("lit-html").TemplateResult<1>;
|
|
50
50
|
makeStatusIcon(): import("lit-html").TemplateResult<1>;
|
|
51
51
|
makeStatusMessage(): import("lit-html").TemplateResult<1>;
|
|
52
|
-
handleFocused(event:
|
|
53
|
-
handleStatus(event:
|
|
54
|
-
handleInput(event:
|
|
55
|
-
handleSelection(event:
|
|
52
|
+
handleFocused(event: CustomEvent): void;
|
|
53
|
+
handleStatus(event: CustomEvent): void;
|
|
54
|
+
handleInput(event: CustomEvent): void;
|
|
55
|
+
handleSelection(event: CustomEvent): void;
|
|
56
56
|
}
|
|
57
57
|
declare global {
|
|
58
58
|
interface HTMLElementTagNameMap {
|
|
@@ -10,7 +10,7 @@ import { stylesBase } from './styles';
|
|
|
10
10
|
* @tagname kemet-field
|
|
11
11
|
* @summary Used in combination with Input, Select, and Textarea, to make a Field.
|
|
12
12
|
*
|
|
13
|
-
* @prop {string} slug - Uniquely identifies the control. Use the same slug for slotted
|
|
13
|
+
* @prop {string} slug - Uniquely identifies the control. Use the same slug for slotted subcomponents.
|
|
14
14
|
* @prop {string} label - The label text
|
|
15
15
|
* @prop {string} message - The validation message for error or success
|
|
16
16
|
* @prop {boolean} focused - Determines if the containing input is focused
|
|
@@ -19,9 +19,9 @@ import { stylesBase } from './styles';
|
|
|
19
19
|
* @prop {number} length - The length of the containing input
|
|
20
20
|
* @prop {boolean} disabled - Determines the disabled state of the control
|
|
21
21
|
* @prop {string} errorIcon - The icon while in an error or warning state
|
|
22
|
-
* @prop {string} successIcon - The icon while in
|
|
22
|
+
* @prop {string} successIcon - The icon while in a success state
|
|
23
23
|
*
|
|
24
|
-
* @slot component - Allows
|
|
24
|
+
* @slot component - Allows subcomponents of the field to display.
|
|
25
25
|
*
|
|
26
26
|
* @csspart label - The label of the field.
|
|
27
27
|
* @csspart message - The validation message of the field.
|
|
@@ -37,11 +37,11 @@ let KemetField = class KemetField extends LitElement {
|
|
|
37
37
|
this.errorIcon = 'exclamation-triangle-fill';
|
|
38
38
|
this.successIcon = 'check-lg';
|
|
39
39
|
// listeners
|
|
40
|
-
this.addEventListener('kemet-input-focused', event => this.handleFocused(event));
|
|
41
|
-
this.addEventListener('kemet-input-status', event => this.handleStatus(event));
|
|
42
|
-
this.addEventListener('kemet-input-input', event => this.handleInput(event));
|
|
43
|
-
this.addEventListener('kemet-count-status', event => this.handleStatus(event));
|
|
44
|
-
this.addEventListener('kemet-combo-selection', event => this.handleSelection(event));
|
|
40
|
+
this.addEventListener('kemet-input-focused', (event) => this.handleFocused(event));
|
|
41
|
+
this.addEventListener('kemet-input-status', (event) => this.handleStatus(event));
|
|
42
|
+
this.addEventListener('kemet-input-input', (event) => this.handleInput(event));
|
|
43
|
+
this.addEventListener('kemet-count-status', (event) => this.handleStatus(event));
|
|
44
|
+
this.addEventListener('kemet-combo-selection', (event) => this.handleSelection(event));
|
|
45
45
|
}
|
|
46
46
|
firstUpdated() {
|
|
47
47
|
this.slotInput = this.querySelector('[slot="input"]');
|
|
@@ -89,12 +89,7 @@ let KemetField = class KemetField extends LitElement {
|
|
|
89
89
|
}
|
|
90
90
|
handleInput(event) {
|
|
91
91
|
emitEvent(this, 'kemet-field-input', event.detail.length);
|
|
92
|
-
|
|
93
|
-
this.filled = false;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
this.filled = true;
|
|
97
|
-
}
|
|
92
|
+
this.filled = event.detail !== '';
|
|
98
93
|
}
|
|
99
94
|
handleSelection(event) {
|
|
100
95
|
this.slotInput.setAttribute('aria-activedescendant', event.detail);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-field.js","sourceRoot":"","sources":["../../../src/components/kemet-field/kemet-field.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,UAAU;IAuChD;QACE,KAAK,EAAE,CAAC;QAxBV,WAAM,GAAe,UAAU,CAAC;QAYhC,cAAS,GAAW,2BAA2B,CAAC;QAGhD,gBAAW,GAAW,UAAU,CAAC;QAW/B,YAAY;QACZ,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"kemet-field.js","sourceRoot":"","sources":["../../../src/components/kemet-field/kemet-field.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,UAAU;IAuChD;QACE,KAAK,EAAE,CAAC;QAxBV,WAAM,GAAe,UAAU,CAAC;QAYhC,cAAS,GAAW,2BAA2B,CAAC;QAGhD,gBAAW,GAAW,UAAU,CAAC;QAW/B,YAAY;QACZ,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC,KAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,C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AGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACX;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACV;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACzB;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;6CACJ;AAGhD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;+CACrB;AAGjC;IADC,KAAK,EAAE;6CAC8B;AAGtC;IADC,KAAK,EAAE;6CACc;AArCH,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CAgH9B;eAhHoB,UAAU","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { stylesBase } from './styles';\nimport { TypeStatus } from './types';\n\nimport KemetCombo from '../kemet-combo/kemet-combo';\nimport KemetInput from '../kemet-input/kemet-input';\nimport KemetTextarea from '../kemet-textarea/kemet-textarea';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-field\n * @summary Used in combination with Input, Select, and Textarea, to make a Field.\n *\n * @prop {string} slug - Uniquely identifies the control. Use the same slug for slotted subcomponents.\n * @prop {string} label - The label text\n * @prop {string} message - The validation message for error or success\n * @prop {boolean} focused - Determines if the containing input is focused\n * @prop {string} status - The validation status of standard, error, or success\n * @prop {boolean} filled - Is true when the containing input has a value\n * @prop {number} length - The length of the containing input\n * @prop {boolean} disabled - Determines the disabled state of the control\n * @prop {string} errorIcon - The icon while in an error or warning state\n * @prop {string} successIcon - The icon while in a success state\n *\n * @slot component - Allows subcomponents of the field to display.\n *\n * @csspart label - The label of the field.\n * @csspart message - The validation message of the field.\n * @csspart text - The text in the label.\n *\n * @event kemet-field-input - Fires when input fires on the input slot\n *\n */\n\n@customElement('kemet-field')\nexport default class KemetField extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: String })\n slug: string;\n\n @property({ type: String })\n label: string;\n\n @property({ type: String })\n message: string;\n\n @property({ type: Boolean, reflect: true })\n focused: boolean;\n\n @property({ type: String, reflect: true })\n status: TypeStatus = 'standard';\n\n @property({ type: Boolean, reflect: true })\n filled: boolean;\n\n @property({ type: Number })\n length: number;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n\n @property({ type: String, attribute: 'error-icon' })\n errorIcon: string = 'exclamation-triangle-fill';\n\n @property({ type: String, attribute: 'success-icon' })\n successIcon: string = 'check-lg';\n\n @state()\n slotInput: KemetInput | KemetTextarea;\n\n @state()\n slotCombo: KemetCombo;\n\n constructor() {\n super();\n\n // listeners\n this.addEventListener('kemet-input-focused', (event: CustomEvent) => this.handleFocused(event));\n this.addEventListener('kemet-input-status', (event: CustomEvent) => this.handleStatus(event));\n this.addEventListener('kemet-input-input', (event: CustomEvent) => this.handleInput(event));\n this.addEventListener('kemet-count-status', (event: CustomEvent) => this.handleStatus(event));\n this.addEventListener('kemet-combo-selection', (event: CustomEvent) => this.handleSelection(event));\n }\n\n firstUpdated() {\n this.slotInput = this.querySelector('[slot=\"input\"]');\n this.slotCombo = this.querySelector('[slot=\"combo\"]');\n\n if (this.slotInput.value) {\n this.length = this.slotInput.value.length;\n } else {\n this.length = 0;\n }\n }\n\n render() {\n return html`\n <label for=\"${this.slug}\" id=\"${this.slug}-label\" part=\"label\">\n <span part=\"text\">${this.label}${this.makeStatusIcon()}</span>\n <slot name=\"input\"></slot>\n </label>\n ${this.makeStatusMessage()}\n <slot name=\"component\"></slot>\n `;\n }\n\n makeStatusIcon() {\n if (this.status === 'error' || this.status === 'warning') {\n return html`<kemet-icon icon=\"${this.errorIcon}\" size=\"16\"></kemet-icon>`;\n }\n\n if (this.status === 'success') {\n return html`<kemet-icon icon=\"${this.successIcon}\" size=\"16\"></kemet-icon>`;\n }\n\n return null;\n }\n\n makeStatusMessage() {\n if (this.status !== 'standard') {\n return html`<span class=\"message\" part=\"message\">${this.message}</span>`;\n }\n\n return null;\n }\n\n handleFocused(event: CustomEvent) {\n this.focused = event.detail;\n\n if (!this.focused && this.slotCombo && this.slotCombo.options.length < 1) {\n this.slotCombo.show = false;\n }\n }\n\n handleStatus(event: CustomEvent) {\n this.status = event.detail.status;\n }\n\n handleInput(event: CustomEvent) {\n emitEvent(this, 'kemet-field-input', event.detail.length);\n this.filled = event.detail !== '';\n }\n\n handleSelection(event: CustomEvent) {\n this.slotInput.setAttribute('aria-activedescendant', event.detail);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-field': KemetField\n }\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export default class KemetFlipcardTrigger extends LitElement {
|
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
14
|
trigger(): void;
|
|
15
|
-
handleKeyup(event:
|
|
15
|
+
handleKeyup(event: KeyboardEvent): void;
|
|
16
16
|
}
|
|
17
17
|
declare global {
|
|
18
18
|
interface HTMLElementTagNameMap {
|
|
@@ -2,7 +2,6 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { LitElement, html, css } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
4
|
import { emitEvent } from '../../utilities/misc/events';
|
|
5
|
-
import { keyCodes } from '../../utilities/misc/constants';
|
|
6
5
|
/**
|
|
7
6
|
* @since 1.0.0
|
|
8
7
|
* @status stable
|
|
@@ -15,7 +14,7 @@ import { keyCodes } from '../../utilities/misc/constants';
|
|
|
15
14
|
let KemetFlipcardTrigger = class KemetFlipcardTrigger extends LitElement {
|
|
16
15
|
render() {
|
|
17
16
|
return html `
|
|
18
|
-
<slot tabindex="0" @click=${() => this.trigger()} @keypress=${event => this.handleKeyup(event)}></slot>
|
|
17
|
+
<slot tabindex="0" @click=${() => this.trigger()} @keypress=${(event) => this.handleKeyup(event)}></slot>
|
|
19
18
|
`;
|
|
20
19
|
}
|
|
21
20
|
trigger() {
|
|
@@ -23,7 +22,7 @@ let KemetFlipcardTrigger = class KemetFlipcardTrigger extends LitElement {
|
|
|
23
22
|
}
|
|
24
23
|
handleKeyup(event) {
|
|
25
24
|
event.preventDefault();
|
|
26
|
-
if (event.
|
|
25
|
+
if (event.key === 'Enter') {
|
|
27
26
|
this.trigger();
|
|
28
27
|
}
|
|
29
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-flipcard-trigger.js","sourceRoot":"","sources":["../../../src/components/kemet-flipcard/kemet-flipcard-trigger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"kemet-flipcard-trigger.js","sourceRoot":"","sources":["../../../src/components/kemet-flipcard/kemet-flipcard-trigger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD;;;;;;;;GAQG;AAGH,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAqB,SAAQ,UAAU;IAS1D,MAAM;QACJ,OAAO,IAAI,CAAA;kCACmB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,KAAoB,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;KAChH,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,CAAC,IAAI,EAAE,wBAAwB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,WAAW,CAAC,KAAoB;QAC9B,KAAK,CAAC,cAAc,EAAE,CAAC;QAEvB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACzB,IAAI,CAAC,OAAO,EAAE,CAAC;SAChB;IACH,CAAC;CACF,CAAA;AAzBQ,2BAAM,GAAG;IACd,GAAG,CAAA;;;;KAIF;CACF,CAAC;AAPiB,oBAAoB;IADxC,aAAa,CAAC,wBAAwB,CAAC;GACnB,oBAAoB,CA0BxC;eA1BoB,oBAAoB","sourcesContent":["import { LitElement, html, css } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { emitEvent } from '../../utilities/misc/events';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-flipcard-trigger\n * @summary Triggers a flipcard component to flip.\n *\n * @event kemet-flipcard-flipped - Fires when a flipcard is flipped\n */\n\n@customElement('kemet-flipcard-trigger')\nexport default class KemetFlipcardTrigger extends LitElement {\n static styles = [\n css`\n :host {\n cursor: pointer;\n }\n `,\n ];\n\n render() {\n return html`\n <slot tabindex=\"0\" @click=${() => this.trigger()} @keypress=${(event: KeyboardEvent) => this.handleKeyup(event)}></slot>\n `;\n }\n\n trigger() {\n emitEvent(this, 'kemet-flipcard-flipped', this);\n }\n\n handleKeyup(event: KeyboardEvent) {\n event.preventDefault();\n\n if (event.key === 'Enter') {\n this.trigger();\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-flipcard-trigger': KemetFlipcardTrigger\n }\n}\n"]}
|
|
@@ -37,8 +37,8 @@ export default class KemetFlipcard extends LitElement {
|
|
|
37
37
|
measure: boolean;
|
|
38
38
|
frontChildren: HTMLSlotElement;
|
|
39
39
|
backChildren: HTMLSlotElement;
|
|
40
|
-
frontElement:
|
|
41
|
-
backElement:
|
|
40
|
+
frontElement: HTMLElement;
|
|
41
|
+
backElement: HTMLElement;
|
|
42
42
|
constructor();
|
|
43
43
|
firstUpdated(): void;
|
|
44
44
|
updated(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, state, query } from 'lit/decorators.js';
|
|
3
|
+
import { customElement, property, state, query, } from 'lit/decorators.js';
|
|
4
4
|
import { stylesBase } from './styles';
|
|
5
5
|
/**
|
|
6
6
|
* @since 1.0.0
|
|
@@ -44,10 +44,8 @@ let KemetFlipcard = class KemetFlipcard extends LitElement {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
firstUpdated() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (this.backChildren)
|
|
50
|
-
[this.backElement] = this.backChildren.assignedNodes({ flatten: true });
|
|
47
|
+
this.frontElement = this.querySelector('[slot=front]');
|
|
48
|
+
this.backElement = this.querySelector('[slot=back]');
|
|
51
49
|
window.addEventListener('resize', this.determineHeight.bind(this));
|
|
52
50
|
}
|
|
53
51
|
updated() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-flipcard.js","sourceRoot":"","sources":["../../../src/components/kemet-flipcard/kemet-flipcard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"kemet-flipcard.js","sourceRoot":"","sources":["../../../src/components/kemet-flipcard/kemet-flipcard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,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E,eAAe,EAAE,CAAC;kDAC3B;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACH;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACH;AAGzB;IADC,KAAK,CAAC,gBAAgB,CAAC;oDACO;AAG/B;IADC,KAAK,CAAC,eAAe,CAAC;mDACO;AAG9B;IADC,KAAK,EAAE;mDACkB;AAG1B;IADC,KAAK,EAAE;kDACiB;AA5BN,aAAa;IADjC,aAAa,CAAC,gBAAgB,CAAC;GACX,aAAa,CAsFjC;eAtFoB,aAAa","sourcesContent":["import { html, LitElement } from 'lit';\nimport {\n customElement, property, state, query,\n} from 'lit/decorators.js';\nimport { stylesBase } from './styles';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-flipcard\n * @summary A card that has a front and back side which can be flipped.\n *\n * @prop {string} axis\n * @prop {boolean} flipped\n * @prop {boolean} flipOnHover\n * @prop {string} height\n * @prop {boolean} measure\n *\n * @slot front - The front of the card.\n * @slot back - The back of the card.\n *\n * @csspart front - The front of the card.\n * @csspart back - The back of the card.\n * @csspart wrapper - A container for both front and back of the card.\n *\n * @cssproperty --kemet-flipcard-front-color - The text color for the front of the card.\n * @cssproperty --kemet-flipcard-back-color - The text color for the back of the card.\n * @cssproperty --kemet-flipcard-front-background-color - The background color for the front of the card.\n * @cssproperty --kemet-flipcard-back-background-color - The background color for the back of the card.\n * @cssproperty --kemet-flipcard-border - The border on the front and back of the card.\n * @cssproperty --kemet-flipcard-border-radius - The border radius on the front and back of the card.\n * @cssproperty --kemet-flipcard-ratio - The aspect ratio of the card.\n *\n */\n\n@customElement('kemet-flipcard')\nexport default class KemetFlipcard extends LitElement {\n static styles = [stylesBase];\n\n @property({ type: String, reflect: true })\n axis: string = 'horizontal';\n\n @property({ type: Boolean, reflect: true })\n flipped: boolean = false;\n\n @property({ type: Boolean, attribute: 'flip-on-hover' })\n flipOnHover: boolean = false;\n\n @property({ type: String })\n height: string = 'auto';\n\n @property({ type: Boolean })\n measure: boolean = false;\n\n @query('[name=\"front\"]')\n frontChildren: HTMLSlotElement;\n\n @query('[name=\"back\"]')\n backChildren: HTMLSlotElement;\n\n @state()\n frontElement: HTMLElement;\n\n @state()\n backElement: HTMLElement;\n\n constructor() {\n super();\n\n this.addEventListener('kemet-flipcard-flipped', () => {\n this.flipped = !this.flipped;\n });\n }\n\n firstUpdated() {\n this.frontElement = this.querySelector('[slot=front]');\n this.backElement = this.querySelector('[slot=back]');\n window.addEventListener('resize', this.determineHeight.bind(this));\n }\n\n updated() {\n this.determineHeight();\n }\n\n render() {\n return html`\n <section\n tabindex=\"0\"\n part=\"wrapper\"\n @blur=${() => { if (this.flipOnHover) this.flipped = false; }}\n @focus=${() => { if (this.flipOnHover) this.flipped = true; }}\n @mouseover=${() => { if (this.flipOnHover) this.flipped = true; }}\n @mouseout=${() => { if (this.flipOnHover) this.flipped = false; }}>\n <div id=\"front\" class=\"front\" part=\"front\">\n <slot name=\"front\" @slotchange=\"${() => this.determineHeight()}\"></slot>\n </div>\n <div id=\"back\" class=\"back\" part=\"back\">\n <slot name=\"back\" @slotchange=\"${() => this.determineHeight()}\"></slot>\n </div>\n </section>\n `;\n }\n\n determineHeight() {\n // setTimeout is need to simulate a DOM repaint\n // without the repaint, offsetHeight on Custom Elements = 0\n // so this is needed for 'measure' to work correctly\n\n setTimeout(() => {\n if (this.measure) {\n if (this.frontElement?.offsetHeight > this.backElement?.offsetHeight) {\n this.height = `${this.frontElement?.offsetHeight}px`;\n } else {\n this.height = `${this.backElement?.offsetHeight}px`;\n }\n\n this.style.height = this.height;\n } else {\n this.style.removeProperty('height');\n }\n }, 0);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-flipcard': KemetFlipcard\n }\n}\n"]}
|
|
@@ -26,7 +26,7 @@ import { TypeAriaAutoComplete, TypeAutoComplete, TypeStatus } from './types';
|
|
|
26
26
|
* @prop {boolean} required - The required attribute
|
|
27
27
|
* @prop {string} type - The type of input
|
|
28
28
|
* @prop {string} value - The input's value
|
|
29
|
-
* @prop {boolean} invalid - States whether
|
|
29
|
+
* @prop {boolean} invalid - States whether the input is invalid
|
|
30
30
|
* @prop {string} status - The status of the input
|
|
31
31
|
* @prop {boolean} validateOnBlur - Activates validation on blur
|
|
32
32
|
* @prop {string} ariaAutoComplete - Aria Autocomplete
|
|
@@ -108,28 +108,9 @@ export default class KemetInput extends LitElement {
|
|
|
108
108
|
constructor();
|
|
109
109
|
firstUpdated(): void;
|
|
110
110
|
render(): import("lit-html").TemplateResult<1>;
|
|
111
|
-
/**
|
|
112
|
-
* Makes the right icon
|
|
113
|
-
* @private
|
|
114
|
-
* @returns {templateResult} A right icon
|
|
115
|
-
*/
|
|
116
111
|
makeIconRight(): import("lit-html").TemplateResult<1>;
|
|
117
|
-
/**
|
|
118
|
-
* Makes the left icon
|
|
119
|
-
* @private
|
|
120
|
-
* @returns {templateResult} A left icon
|
|
121
|
-
*/
|
|
122
112
|
makeIconLeft(): import("lit-html").TemplateResult<1>;
|
|
123
|
-
/**
|
|
124
|
-
* Makes a clear icon for search.
|
|
125
|
-
* @private
|
|
126
|
-
* @returns {templateResult} A search icon
|
|
127
|
-
*/
|
|
128
113
|
makeIconClear(): import("lit-html").TemplateResult<1>;
|
|
129
|
-
/**
|
|
130
|
-
* Makes a password visibility toggle button
|
|
131
|
-
* @returns {templateResult} A mask or unmask icon
|
|
132
|
-
*/
|
|
133
114
|
makeVisibilityToggle(): import("lit-html").TemplateResult<1>;
|
|
134
115
|
setPasswordIcon(): "eye" | "eye-slash";
|
|
135
116
|
/**
|
|
@@ -157,7 +138,7 @@ export default class KemetInput extends LitElement {
|
|
|
157
138
|
* @private
|
|
158
139
|
*/
|
|
159
140
|
handleInvalid(): void;
|
|
160
|
-
handleStatus(event:
|
|
141
|
+
handleStatus(event: CustomEvent): void;
|
|
161
142
|
/**
|
|
162
143
|
* Toggles password visibility
|
|
163
144
|
* @private
|
|
@@ -170,7 +151,7 @@ export default class KemetInput extends LitElement {
|
|
|
170
151
|
handleClear(): void;
|
|
171
152
|
/**
|
|
172
153
|
* Checks the validity of the character limit for the count component
|
|
173
|
-
* @
|
|
154
|
+
* @public
|
|
174
155
|
* @returns {boolean}
|
|
175
156
|
*/
|
|
176
157
|
checkLimitValidity(): boolean;
|
|
@@ -30,7 +30,7 @@ import { stylesBase } from './styles';
|
|
|
30
30
|
* @prop {boolean} required - The required attribute
|
|
31
31
|
* @prop {string} type - The type of input
|
|
32
32
|
* @prop {string} value - The input's value
|
|
33
|
-
* @prop {boolean} invalid - States whether
|
|
33
|
+
* @prop {boolean} invalid - States whether the input is invalid
|
|
34
34
|
* @prop {string} status - The status of the input
|
|
35
35
|
* @prop {boolean} validateOnBlur - Activates validation on blur
|
|
36
36
|
* @prop {string} ariaAutoComplete - Aria Autocomplete
|
|
@@ -84,7 +84,6 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
84
84
|
/** @internal */
|
|
85
85
|
this.formSubmitController = new FormSubmitController(this);
|
|
86
86
|
}
|
|
87
|
-
;
|
|
88
87
|
firstUpdated() {
|
|
89
88
|
// elements
|
|
90
89
|
this.input = this.shadowRoot.querySelector('input');
|
|
@@ -92,7 +91,7 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
92
91
|
this.form = this.closest('form');
|
|
93
92
|
this.slug = this.field ? this.field.slug : 'input';
|
|
94
93
|
if (this.field) {
|
|
95
|
-
this.field.addEventListener('fmc-password-status', event => this.handleStatus(event));
|
|
94
|
+
this.field.addEventListener('fmc-password-status', (event) => this.handleStatus(event));
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
97
|
render() {
|
|
@@ -132,11 +131,6 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
132
131
|
</div>
|
|
133
132
|
`;
|
|
134
133
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Makes the right icon
|
|
137
|
-
* @private
|
|
138
|
-
* @returns {templateResult} A right icon
|
|
139
|
-
*/
|
|
140
134
|
makeIconRight() {
|
|
141
135
|
if (this.iconRight) {
|
|
142
136
|
return html `
|
|
@@ -145,11 +139,6 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
145
139
|
}
|
|
146
140
|
return null;
|
|
147
141
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Makes the left icon
|
|
150
|
-
* @private
|
|
151
|
-
* @returns {templateResult} A left icon
|
|
152
|
-
*/
|
|
153
142
|
makeIconLeft() {
|
|
154
143
|
if (this.iconLeft) {
|
|
155
144
|
return html `
|
|
@@ -158,11 +147,6 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
158
147
|
}
|
|
159
148
|
return null;
|
|
160
149
|
}
|
|
161
|
-
/**
|
|
162
|
-
* Makes a clear icon for search.
|
|
163
|
-
* @private
|
|
164
|
-
* @returns {templateResult} A search icon
|
|
165
|
-
*/
|
|
166
150
|
makeIconClear() {
|
|
167
151
|
if (this.type === 'search' && this.value !== '') {
|
|
168
152
|
return html `
|
|
@@ -171,10 +155,6 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
171
155
|
}
|
|
172
156
|
return null;
|
|
173
157
|
}
|
|
174
|
-
/**
|
|
175
|
-
* Makes a password visibility toggle button
|
|
176
|
-
* @returns {templateResult} A mask or unmask icon
|
|
177
|
-
*/
|
|
178
158
|
makeVisibilityToggle() {
|
|
179
159
|
if (this.type === 'password') {
|
|
180
160
|
return html `<kemet-icon
|
|
@@ -274,7 +254,7 @@ let KemetInput = class KemetInput extends LitElement {
|
|
|
274
254
|
}
|
|
275
255
|
/**
|
|
276
256
|
* Checks the validity of the character limit for the count component
|
|
277
|
-
* @
|
|
257
|
+
* @public
|
|
278
258
|
* @returns {boolean}
|
|
279
259
|
*/
|
|
280
260
|
checkLimitValidity() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kemet-input.js","sourceRoot":"","sources":["../../../src/components/kemet-input/kemet-input.ts"],"names":[],"mappings":";AAAA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M,EAAE,CAAC;4CACL;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACO;AAGnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACT;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAClB;AAGzB;IADC,KAAK,EAAE;yCACmB;AAG3B;IADC,KAAK,EAAE;wCACc;AAGtB;IADC,KAAK,EAAE;yCACgB;AA7GL,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CAyW9B;eAzWoB,UAAU","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { FormSubmitController } from '../../utilities/controllers/forms';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { KemetFieldInterface } from '../kemet-field/types';\nimport { stylesBase } from './styles';\nimport { TypeAriaAutoComplete, TypeAutoComplete, TypeStatus } from './types';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-input\n * @summary An enhanced input element.\n *\n * @prop {string} slug - Used for the id of the input. Should match the slug used in a control if applicable.\n * @prop {string} name - The name of the input\n * @prop {string} placeholder - The placeholder attribute\n * @prop {string} minlength - The minlength attribute\n * @prop {string} maxlength - The maxlength attribute\n * @prop {string} min - The min attribute\n * @prop {string} max - The max attribute\n * @prop {string} step - The step attribute\n * @prop {string} autocomplete - The autocomplete attribute\n * @prop {string} pattern - The pattern attribute\n * @prop {string} inputmode - The input mode attribute\n * @prop {boolean} autofocus - The autofocus attribute\n * @prop {boolean} disabled - The disable attribute\n * @prop {boolean} readonly - The readonly attribute\n * @prop {boolean} required - The required attribute\n * @prop {string} type - The type of input\n * @prop {string} value - The input's value\n * @prop {boolean} invalid - States whether or not the input is invalid\n * @prop {string} status - The status of the input\n * @prop {boolean} validateOnBlur - Activates validation on blur\n * @prop {string} ariaAutoComplete - Aria Autocomplete\n * @prop {string} ariaControls - Aria Controls\n * @prop {string} ariaActiveDescendant - Aria Active Descendant\n * @prop {boolean} rounded - Displays rounded corners\n * @prop {boolean} filled - Displays a filled input box\n * @prop {string} iconRight - Custom Icon to the right of the input\n * @prop {string} iconLeft - Custom Icon to the left of the input\n * @prop {number} iconSize - Size of the icons\n * @prop {object} validity - The HTML5 validity object.\n * @prop {boolean} isPasswordVisible - Manages password visibility\n * @prop {string} inputType - Input Type of keypress handled through handleInput(e)\n * @prop {boolean} focused - Determines if the input is focused\n *\n * @csspart input\n *\n * @cssproperty --kemet-input-height - The height of the input.\n * @cssproperty --kemet-input-padding - The padding on the input.\n * @cssproperty --kemet-input-border - The border of the input.\n * @cssproperty --kemet-input-border-color-error - The border of the error state.\n * @cssproperty --kemet-input-border-color-success - The border of the success state.\n * @cssproperty --kemet-input-border-color-warning - The border of the warning state.\n * @cssproperty --kemet-input-icon-left-padding - The icon-left padding.\n * @cssproperty --kemet-input-icon-right-padding - The icon-right padding.\n * @cssproperty --kemet-input-border-radius-rounded - The border radius on rounded.\n * @cssproperty --kemet-input-border-filled - The border on filled.\n * @cssproperty --kemet-input-color-filled - The color on filled.\n * @cssproperty --kemet-input-background-color-filled - The background-color on filled.\n * @cssproperty --kemet-input-background-color-error - The error state background color.\n * @cssproperty --kemet-input-background-color-success - The success state background color.\n * @cssproperty --kemet-input-background-color-warning - The warning state background color.\n *\n * @event kemet-input-focused - Fires when the input receives and loses focus\n * @event kemet-input-status Fires when there's a change in status. This event includes an object that reports: 1) the status. 2) HTML5 validity object. 3) the component element.\n * Use the validity object to support custom validation messages.\n * @event kemet-input-input - Fires when the input receives input\n *\n */\n\n@customElement('kemet-input')\nexport default class KemetInput extends LitElement {\n /** @internal */\n formSubmitController: FormSubmitController;\n\n static styles = [stylesBase];\n\n @property({ type: String })\n slug: string;\n\n @property({ type: String })\n name: string = 'input';\n\n @property({ type: String })\n placeholder: string;\n\n @property({ type: Number })\n minlength: number;\n\n @property({ type: Number })\n maxlength: number;\n\n @property({ type: String })\n min: string;\n\n @property({ type: String })\n max: string;\n\n @property({ type: Number })\n step: number;\n\n @property({ type: String })\n autocomplete: TypeAutoComplete;\n\n @property({ type: String })\n pattern: string;\n\n @property({ type: String })\n inputmode: string;\n\n @property({ type: Boolean })\n autofocus: boolean;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n\n @property({ type: Boolean })\n readonly: boolean;\n\n @property({ type: Boolean, reflect: true })\n required: boolean;\n\n @property({ type: String })\n type: string = 'text';\n\n @property({ type: String, reflect: true })\n value: string = '';\n\n @property({ type: Boolean, reflect: true })\n invalid: boolean;\n\n @property({ type: String, reflect: true })\n status: TypeStatus = 'standard';\n\n @property({ type: Boolean, attribute: 'validate-on-blur' })\n validateOnBlur: boolean = false;\n\n @property({ type: String, attribute: 'aria-autocomplete' })\n ariaAutoComplete: TypeAriaAutoComplete;\n\n @property({ type: String, attribute: 'aria-controls' })\n ariaControls: string;\n\n @property({ type: String, attribute: 'aria-activedescendant' })\n ariaActiveDescendant: string;\n\n @property({ type: Boolean, reflect: true })\n rounded: boolean;\n\n @property({ type: Boolean, reflect: true })\n filled: boolean;\n\n @property({ type: String, reflect: true, attribute: 'icon-right' })\n iconRight: string;\n\n @property({ type: String, reflect: true, attribute: 'icon-left' })\n iconLeft: string;\n\n @property({ type: Number })\n iconSize: number = 20;\n\n @property({ type: Object })\n validity: object;\n\n @property({ type: Boolean })\n isPasswordVisible: boolean = false;;\n\n @property({ type: String })\n inputType: string;\n\n @property({ type: Boolean, reflect: true })\n focused: boolean = false;\n\n @state()\n field: KemetFieldInterface;\n\n @state()\n form: HTMLFormElement;\n\n @state()\n input: HTMLInputElement;\n\n constructor() {\n super();\n\n /** @internal */\n this.formSubmitController = new FormSubmitController(this);\n }\n\n firstUpdated() {\n // elements\n this.input = this.shadowRoot.querySelector('input');\n this.field = this.closest('kemet-field');\n this.form = this.closest('form');\n this.slug = this.field ? this.field.slug : 'input';\n\n if (this.field) {\n this.field.addEventListener('fmc-password-status', event => this.handleStatus(event));\n }\n }\n\n render() {\n return html`\n <div>\n ${this.makeIconLeft()}\n <input\n part=\"input\"\n id=${this.slug}\n name=${this.name}\n placeholder=${ifDefined(this.placeholder)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n step=${ifDefined(this.step)}\n autocomplete=${ifDefined(this.autocomplete)}\n aria-autocomplete=${ifDefined(this.ariaAutoComplete)}\n aria-controls=${ifDefined(this.ariaControls)}\n aria-activedescendant=${ifDefined(this.ariaActiveDescendant)}\n pattern=${ifDefined(this.pattern)}\n inputmode=${ifDefined(this.inputmode)}\n aria-invalid=${this.invalid ? 'true' : 'false'}\n ?autofocus=${this.autofocus}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n .type=\"${this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\"\n .value=${live(this.value)}\n @change=${this.handleChange}\n @input=${this.handleInput}\n @invalid=${this.handleInvalid}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n />\n ${this.makeIconRight()} ${this.makeIconClear()} ${this.makeVisibilityToggle()}\n </div>\n `;\n }\n\n /**\n * Makes the right icon\n * @private\n * @returns {templateResult} A right icon\n */\n makeIconRight() {\n if (this.iconRight) {\n return html`\n <kemet-icon class=\"right\" icon=\"${this.iconRight}\" size=\"${this.iconSize ? this.iconSize : 20}\"></kemet-icon>\n `;\n }\n\n return null;\n }\n\n /**\n * Makes the left icon\n * @private\n * @returns {templateResult} A left icon\n */\n makeIconLeft() {\n if (this.iconLeft) {\n return html`\n <kemet-icon class=\"left\" icon=\"${this.iconLeft}\" size=\"${this.iconSize ? this.iconSize : 16}\"></kemet-icon>\n `;\n }\n\n return null;\n }\n\n /**\n * Makes a clear icon for search.\n * @private\n * @returns {templateResult} A search icon\n */\n makeIconClear() {\n if (this.type === 'search' && this.value !== '') {\n return html`\n <kemet-icon class=\"search right\" icon=\"x-lg\" size=\"${this.iconSize}\" @click=${() => this.handleClear()}></kemet-icon>\n `;\n }\n\n return null;\n }\n\n /**\n * Makes a password visibility toggle button\n * @returns {templateResult} A mask or unmask icon\n */\n makeVisibilityToggle() {\n if (this.type === 'password') {\n return html`<kemet-icon\n class=\"eye right\"\n icon=\"${this.setPasswordIcon()}\"\n @click=${() => this.togglePasswordVisibility()}\n ></kemet-icon>`;\n }\n\n return null;\n }\n\n setPasswordIcon() {\n if (this.isPasswordVisible) {\n return 'eye';\n }\n\n return 'eye-slash';\n }\n\n /**\n * Handles when the input receives focus\n * @private\n */\n handleFocus() {\n this.focused = true;\n emitEvent(this, 'kemet-input-focused', true);\n }\n\n /**\n * Handles when the input loses focus\n * @private\n */\n handleBlur() {\n if (this.validateOnBlur && this.form && !this.form.noValidate) {\n this.input?.checkValidity();\n this.validity = this.input?.validity;\n }\n\n this.focused = false;\n emitEvent(this, 'kemet-input-focused', false);\n }\n\n /**\n * Handles when the input changes value\n * @private\n */\n handleChange() {\n this.value = this.input.value;\n\n if (this.input.checkValidity() && this.checkLimitValidity() && this.status !== 'success') {\n this.invalid = false;\n this.status = 'standard';\n this.validity = this.input.validity;\n\n emitEvent(this, 'kemet-input-status', {\n status: 'standard',\n validity: this.input.validity,\n element: this,\n });\n }\n }\n\n /**\n * Handles when the input receives input\n * @private\n */\n handleInput() {\n this.value = this.input.value;\n emitEvent(this, 'kemet-input-input', this.value);\n }\n\n /**\n * Handles when the input has an error\n * @private\n */\n handleInvalid() {\n this.validity = this.input?.validity;\n\n if (this.validateOnBlur) {\n this.invalid = true;\n this.status = 'error';\n\n emitEvent(this, 'kemet-input-status', {\n status: 'error',\n validity: this.input?.validity,\n element: this,\n });\n }\n }\n\n handleStatus(event) {\n this.status = event.detail.status;\n }\n\n /**\n * Toggles password visibility\n * @private\n */\n togglePasswordVisibility() {\n this.isPasswordVisible = !this.isPasswordVisible;\n }\n\n /**\n * Handles the clear button for search\n * @private\n */\n handleClear() {\n this.value = '';\n emitEvent(this, 'kemet-input-input', this.value);\n }\n\n /**\n * Checks the validity of the character limit for the count component\n * @private\n * @returns {boolean}\n */\n checkLimitValidity() {\n if (this.field) {\n const count = this.field.querySelector('kemet-count');\n if (count) {\n return this.value.length < count.limit;\n }\n }\n\n return true;\n }\n\n /**\n * Checks the validity of the standard input\n * @public\n * @returns {boolean}\n */\n checkValidity() {\n return this.input?.checkValidity();\n }\n\n /**\n * Focuses the standard input\n * @public\n */\n focus() {\n this.input?.focus();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-input': KemetInput\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"kemet-input.js","sourceRoot":"","sources":["../../../src/components/kemet-input/kemet-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAGH,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,UAAU;IA+GhD;QACE,KAAK,EAAE,CAAC;QAtGV,SAAI,GAAW,OAAO,CAAC;QA0CvB,SAAI,GAAW,MAAM,CAAC;QAGtB,U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AAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;wDAClC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAC3B;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;6CACjD;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;4CACjD;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACL;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACO;AAGnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACT;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAClB;AAGzB;IADC,KAAK,EAAE;yCACmB;AAG3B;IADC,KAAK,EAAE;wCACc;AAGtB;IADC,KAAK,EAAE;yCACgB;AA7GL,UAAU;IAD9B,aAAa,CAAC,aAAa,CAAC;GACR,UAAU,CAsV9B;eAtVoB,UAAU","sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { FormSubmitController } from '../../utilities/controllers/forms';\nimport { emitEvent } from '../../utilities/misc/events';\nimport { KemetFieldInterface } from '../kemet-field/types';\nimport { stylesBase } from './styles';\nimport { TypeAriaAutoComplete, TypeAutoComplete, TypeStatus } from './types';\n\n/**\n * @since 1.0.0\n * @status stable\n *\n * @tagname kemet-input\n * @summary An enhanced input element.\n *\n * @prop {string} slug - Used for the id of the input. Should match the slug used in a control if applicable.\n * @prop {string} name - The name of the input\n * @prop {string} placeholder - The placeholder attribute\n * @prop {string} minlength - The minlength attribute\n * @prop {string} maxlength - The maxlength attribute\n * @prop {string} min - The min attribute\n * @prop {string} max - The max attribute\n * @prop {string} step - The step attribute\n * @prop {string} autocomplete - The autocomplete attribute\n * @prop {string} pattern - The pattern attribute\n * @prop {string} inputmode - The input mode attribute\n * @prop {boolean} autofocus - The autofocus attribute\n * @prop {boolean} disabled - The disable attribute\n * @prop {boolean} readonly - The readonly attribute\n * @prop {boolean} required - The required attribute\n * @prop {string} type - The type of input\n * @prop {string} value - The input's value\n * @prop {boolean} invalid - States whether the input is invalid\n * @prop {string} status - The status of the input\n * @prop {boolean} validateOnBlur - Activates validation on blur\n * @prop {string} ariaAutoComplete - Aria Autocomplete\n * @prop {string} ariaControls - Aria Controls\n * @prop {string} ariaActiveDescendant - Aria Active Descendant\n * @prop {boolean} rounded - Displays rounded corners\n * @prop {boolean} filled - Displays a filled input box\n * @prop {string} iconRight - Custom Icon to the right of the input\n * @prop {string} iconLeft - Custom Icon to the left of the input\n * @prop {number} iconSize - Size of the icons\n * @prop {object} validity - The HTML5 validity object.\n * @prop {boolean} isPasswordVisible - Manages password visibility\n * @prop {string} inputType - Input Type of keypress handled through handleInput(e)\n * @prop {boolean} focused - Determines if the input is focused\n *\n * @csspart input\n *\n * @cssproperty --kemet-input-height - The height of the input.\n * @cssproperty --kemet-input-padding - The padding on the input.\n * @cssproperty --kemet-input-border - The border of the input.\n * @cssproperty --kemet-input-border-color-error - The border of the error state.\n * @cssproperty --kemet-input-border-color-success - The border of the success state.\n * @cssproperty --kemet-input-border-color-warning - The border of the warning state.\n * @cssproperty --kemet-input-icon-left-padding - The icon-left padding.\n * @cssproperty --kemet-input-icon-right-padding - The icon-right padding.\n * @cssproperty --kemet-input-border-radius-rounded - The border radius on rounded.\n * @cssproperty --kemet-input-border-filled - The border on filled.\n * @cssproperty --kemet-input-color-filled - The color on filled.\n * @cssproperty --kemet-input-background-color-filled - The background-color on filled.\n * @cssproperty --kemet-input-background-color-error - The error state background color.\n * @cssproperty --kemet-input-background-color-success - The success state background color.\n * @cssproperty --kemet-input-background-color-warning - The warning state background color.\n *\n * @event kemet-input-focused - Fires when the input receives and loses focus\n * @event kemet-input-status Fires when there's a change in status. This event includes an object that reports: 1) the status. 2) HTML5 validity object. 3) the component element.\n * Use the validity object to support custom validation messages.\n * @event kemet-input-input - Fires when the input receives input\n *\n */\n\n@customElement('kemet-input')\nexport default class KemetInput extends LitElement {\n /** @internal */\n formSubmitController: FormSubmitController;\n\n static styles = [stylesBase];\n\n @property({ type: String })\n slug: string;\n\n @property({ type: String })\n name: string = 'input';\n\n @property({ type: String })\n placeholder: string;\n\n @property({ type: Number })\n minlength: number;\n\n @property({ type: Number })\n maxlength: number;\n\n @property({ type: String })\n min: string;\n\n @property({ type: String })\n max: string;\n\n @property({ type: Number })\n step: number;\n\n @property({ type: String })\n autocomplete: TypeAutoComplete;\n\n @property({ type: String })\n pattern: string;\n\n @property({ type: String })\n inputmode: string;\n\n @property({ type: Boolean })\n autofocus: boolean;\n\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n\n @property({ type: Boolean })\n readonly: boolean;\n\n @property({ type: Boolean, reflect: true })\n required: boolean;\n\n @property({ type: String })\n type: string = 'text';\n\n @property({ type: String, reflect: true })\n value: string = '';\n\n @property({ type: Boolean, reflect: true })\n invalid: boolean;\n\n @property({ type: String, reflect: true })\n status: TypeStatus = 'standard';\n\n @property({ type: Boolean, attribute: 'validate-on-blur' })\n validateOnBlur: boolean = false;\n\n @property({ type: String, attribute: 'aria-autocomplete' })\n ariaAutoComplete: TypeAriaAutoComplete;\n\n @property({ type: String, attribute: 'aria-controls' })\n ariaControls: string;\n\n @property({ type: String, attribute: 'aria-activedescendant' })\n ariaActiveDescendant: string;\n\n @property({ type: Boolean, reflect: true })\n rounded: boolean;\n\n @property({ type: Boolean, reflect: true })\n filled: boolean;\n\n @property({ type: String, reflect: true, attribute: 'icon-right' })\n iconRight: string;\n\n @property({ type: String, reflect: true, attribute: 'icon-left' })\n iconLeft: string;\n\n @property({ type: Number })\n iconSize: number = 20;\n\n @property({ type: Object })\n validity: object;\n\n @property({ type: Boolean })\n isPasswordVisible: boolean = false;\n\n @property({ type: String })\n inputType: string;\n\n @property({ type: Boolean, reflect: true })\n focused: boolean = false;\n\n @state()\n field: KemetFieldInterface;\n\n @state()\n form: HTMLFormElement;\n\n @state()\n input: HTMLInputElement;\n\n constructor() {\n super();\n\n /** @internal */\n this.formSubmitController = new FormSubmitController(this);\n }\n\n firstUpdated() {\n // elements\n this.input = this.shadowRoot.querySelector('input');\n this.field = this.closest('kemet-field');\n this.form = this.closest('form');\n this.slug = this.field ? this.field.slug : 'input';\n\n if (this.field) {\n this.field.addEventListener('fmc-password-status', (event: CustomEvent) => this.handleStatus(event));\n }\n }\n\n render() {\n return html`\n <div>\n ${this.makeIconLeft()}\n <input\n part=\"input\"\n id=${this.slug}\n name=${this.name}\n placeholder=${ifDefined(this.placeholder)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n step=${ifDefined(this.step)}\n autocomplete=${ifDefined(this.autocomplete)}\n aria-autocomplete=${ifDefined(this.ariaAutoComplete)}\n aria-controls=${ifDefined(this.ariaControls)}\n aria-activedescendant=${ifDefined(this.ariaActiveDescendant)}\n pattern=${ifDefined(this.pattern)}\n inputmode=${ifDefined(this.inputmode)}\n aria-invalid=${this.invalid ? 'true' : 'false'}\n ?autofocus=${this.autofocus}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n .type=\"${this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\"\n .value=${live(this.value)}\n @change=${this.handleChange}\n @input=${this.handleInput}\n @invalid=${this.handleInvalid}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n />\n ${this.makeIconRight()} ${this.makeIconClear()} ${this.makeVisibilityToggle()}\n </div>\n `;\n }\n\n makeIconRight() {\n if (this.iconRight) {\n return html`\n <kemet-icon class=\"right\" icon=\"${this.iconRight}\" size=\"${this.iconSize ? this.iconSize : 20}\"></kemet-icon>\n `;\n }\n\n return null;\n }\n\n makeIconLeft() {\n if (this.iconLeft) {\n return html`\n <kemet-icon class=\"left\" icon=\"${this.iconLeft}\" size=\"${this.iconSize ? this.iconSize : 16}\"></kemet-icon>\n `;\n }\n\n return null;\n }\n\n makeIconClear() {\n if (this.type === 'search' && this.value !== '') {\n return html`\n <kemet-icon class=\"search right\" icon=\"x-lg\" size=\"${this.iconSize}\" @click=${() => this.handleClear()}></kemet-icon>\n `;\n }\n\n return null;\n }\n\n makeVisibilityToggle() {\n if (this.type === 'password') {\n return html`<kemet-icon\n class=\"eye right\"\n icon=\"${this.setPasswordIcon()}\"\n @click=${() => this.togglePasswordVisibility()}\n ></kemet-icon>`;\n }\n\n return null;\n }\n\n setPasswordIcon() {\n if (this.isPasswordVisible) {\n return 'eye';\n }\n\n return 'eye-slash';\n }\n\n /**\n * Handles when the input receives focus\n * @private\n */\n handleFocus() {\n this.focused = true;\n emitEvent(this, 'kemet-input-focused', true);\n }\n\n /**\n * Handles when the input loses focus\n * @private\n */\n handleBlur() {\n if (this.validateOnBlur && this.form && !this.form.noValidate) {\n this.input?.checkValidity();\n this.validity = this.input?.validity;\n }\n\n this.focused = false;\n emitEvent(this, 'kemet-input-focused', false);\n }\n\n /**\n * Handles when the input changes value\n * @private\n */\n handleChange() {\n this.value = this.input.value;\n\n if (this.input.checkValidity() && this.checkLimitValidity() && this.status !== 'success') {\n this.invalid = false;\n this.status = 'standard';\n this.validity = this.input.validity;\n\n emitEvent(this, 'kemet-input-status', {\n status: 'standard',\n validity: this.input.validity,\n element: this,\n });\n }\n }\n\n /**\n * Handles when the input receives input\n * @private\n */\n handleInput() {\n this.value = this.input.value;\n emitEvent(this, 'kemet-input-input', this.value);\n }\n\n /**\n * Handles when the input has an error\n * @private\n */\n handleInvalid() {\n this.validity = this.input?.validity;\n\n if (this.validateOnBlur) {\n this.invalid = true;\n this.status = 'error';\n\n emitEvent(this, 'kemet-input-status', {\n status: 'error',\n validity: this.input?.validity,\n element: this,\n });\n }\n }\n\n handleStatus(event: CustomEvent) {\n this.status = event.detail.status;\n }\n\n /**\n * Toggles password visibility\n * @private\n */\n togglePasswordVisibility() {\n this.isPasswordVisible = !this.isPasswordVisible;\n }\n\n /**\n * Handles the clear button for search\n * @private\n */\n handleClear() {\n this.value = '';\n emitEvent(this, 'kemet-input-input', this.value);\n }\n\n /**\n * Checks the validity of the character limit for the count component\n * @public\n * @returns {boolean}\n */\n checkLimitValidity(): boolean {\n if (this.field) {\n const count = this.field.querySelector('kemet-count');\n if (count) {\n return this.value.length < count.limit;\n }\n }\n\n return true;\n }\n\n /**\n * Checks the validity of the standard input\n * @public\n * @returns {boolean}\n */\n checkValidity(): boolean {\n return this.input?.checkValidity();\n }\n\n /**\n * Focuses the standard input\n * @public\n */\n focus() {\n this.input?.focus();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kemet-input': KemetInput\n }\n}\n"]}
|