@sky.ui/core 0.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/LICENSE.md +139 -0
- package/README.md +113 -0
- package/auto-import-loader.js +60 -0
- package/auto-import.js +93 -0
- package/dist/custom-elements.json +27051 -0
- package/dist/helper/controllers/animation-controller.d.ts +120 -0
- package/dist/helper/controllers/animation-controller.js +2 -0
- package/dist/helper/controllers/animation-controller.js.map +1 -0
- package/dist/helper/controllers/index.d.ts +2 -0
- package/dist/helper/controllers/popover-controller.d.ts +162 -0
- package/dist/helper/controllers/popover-controller.js +2 -0
- package/dist/helper/controllers/popover-controller.js.map +1 -0
- package/dist/helper/form-control-base.d.ts +1 -0
- package/dist/helper/iconify-offline.d.ts +73 -0
- package/dist/helper/iconify-offline.js +2 -0
- package/dist/helper/iconify-offline.js.map +1 -0
- package/dist/helper/index.d.ts +5 -0
- package/dist/helper/internals/form-control-base.d.ts +81 -0
- package/dist/helper/internals/form-control-base.js +2 -0
- package/dist/helper/internals/form-control-base.js.map +1 -0
- package/dist/helper/internals/index.d.ts +1 -0
- package/dist/helper/utils/color-resolver.d.ts +139 -0
- package/dist/helper/utils/color-resolver.js +2 -0
- package/dist/helper/utils/color-resolver.js.map +1 -0
- package/dist/helper/utils/index.d.ts +2 -0
- package/dist/helper/utils/size-resolver.d.ts +6 -0
- package/dist/helper/utils/size-resolver.js +2 -0
- package/dist/helper/utils/size-resolver.js.map +1 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/sky-accordion/index.d.ts +1 -0
- package/dist/sky-accordion/index.js +1 -0
- package/dist/sky-accordion/sky-accordion.d.ts +201 -0
- package/dist/sky-accordion/sky-accordion.js +85 -0
- package/dist/sky-accordion/sky-accordion.js.map +1 -0
- package/dist/sky-accordion-item/index.d.ts +1 -0
- package/dist/sky-accordion-item/index.js +1 -0
- package/dist/sky-accordion-item/sky-accordion-item.d.ts +161 -0
- package/dist/sky-accordion-item/sky-accordion-item.js +191 -0
- package/dist/sky-accordion-item/sky-accordion-item.js.map +1 -0
- package/dist/sky-alert/index.d.ts +1 -0
- package/dist/sky-alert/index.js +1 -0
- package/dist/sky-alert/sky-alert.d.ts +136 -0
- package/dist/sky-alert/sky-alert.js +292 -0
- package/dist/sky-alert/sky-alert.js.map +1 -0
- package/dist/sky-appbar/index.d.ts +1 -0
- package/dist/sky-appbar/index.js +1 -0
- package/dist/sky-appbar/sky-appbar.d.ts +84 -0
- package/dist/sky-appbar/sky-appbar.js +173 -0
- package/dist/sky-appbar/sky-appbar.js.map +1 -0
- package/dist/sky-avatar/index.d.ts +1 -0
- package/dist/sky-avatar/index.js +1 -0
- package/dist/sky-avatar/sky-avatar.d.ts +104 -0
- package/dist/sky-avatar/sky-avatar.js +152 -0
- package/dist/sky-avatar/sky-avatar.js.map +1 -0
- package/dist/sky-badge/index.d.ts +1 -0
- package/dist/sky-badge/index.js +1 -0
- package/dist/sky-badge/sky-badge.d.ts +154 -0
- package/dist/sky-badge/sky-badge.js +148 -0
- package/dist/sky-badge/sky-badge.js.map +1 -0
- package/dist/sky-breadcrumb/index.d.ts +1 -0
- package/dist/sky-breadcrumb/index.js +1 -0
- package/dist/sky-breadcrumb/sky-breadcrumb.d.ts +111 -0
- package/dist/sky-breadcrumb/sky-breadcrumb.js +230 -0
- package/dist/sky-breadcrumb/sky-breadcrumb.js.map +1 -0
- package/dist/sky-button/index.d.ts +1 -0
- package/dist/sky-button/index.js +1 -0
- package/dist/sky-button/sky-button.d.ts +118 -0
- package/dist/sky-button/sky-button.js +172 -0
- package/dist/sky-button/sky-button.js.map +1 -0
- package/dist/sky-button-group/index.d.ts +1 -0
- package/dist/sky-button-group/index.js +1 -0
- package/dist/sky-button-group/sky-button-group.d.ts +93 -0
- package/dist/sky-button-group/sky-button-group.js +281 -0
- package/dist/sky-button-group/sky-button-group.js.map +1 -0
- package/dist/sky-card/index.d.ts +1 -0
- package/dist/sky-card/index.js +1 -0
- package/dist/sky-card/sky-card.d.ts +143 -0
- package/dist/sky-card/sky-card.js +186 -0
- package/dist/sky-card/sky-card.js.map +1 -0
- package/dist/sky-carousel/index.d.ts +1 -0
- package/dist/sky-carousel/index.js +1 -0
- package/dist/sky-carousel/sky-carousel.d.ts +265 -0
- package/dist/sky-carousel/sky-carousel.js +211 -0
- package/dist/sky-carousel/sky-carousel.js.map +1 -0
- package/dist/sky-checkbox/index.d.ts +1 -0
- package/dist/sky-checkbox/index.js +1 -0
- package/dist/sky-checkbox/sky-checkbox.d.ts +165 -0
- package/dist/sky-checkbox/sky-checkbox.js +276 -0
- package/dist/sky-checkbox/sky-checkbox.js.map +1 -0
- package/dist/sky-chip/index.d.ts +1 -0
- package/dist/sky-chip/index.js +1 -0
- package/dist/sky-chip/sky-chip.d.ts +95 -0
- package/dist/sky-chip/sky-chip.js +210 -0
- package/dist/sky-chip/sky-chip.js.map +1 -0
- package/dist/sky-col/index.d.ts +1 -0
- package/dist/sky-col/index.js +1 -0
- package/dist/sky-col/sky-col.d.ts +84 -0
- package/dist/sky-col/sky-col.js +46 -0
- package/dist/sky-col/sky-col.js.map +1 -0
- package/dist/sky-combobox/index.d.ts +1 -0
- package/dist/sky-combobox/index.js +1 -0
- package/dist/sky-combobox/sky-combobox.d.ts +313 -0
- package/dist/sky-combobox/sky-combobox.js +1146 -0
- package/dist/sky-combobox/sky-combobox.js.map +1 -0
- package/dist/sky-counter/index.d.ts +1 -0
- package/dist/sky-counter/index.js +1 -0
- package/dist/sky-counter/sky-counter.d.ts +130 -0
- package/dist/sky-counter/sky-counter.js +101 -0
- package/dist/sky-counter/sky-counter.js.map +1 -0
- package/dist/sky-dialog/index.d.ts +1 -0
- package/dist/sky-dialog/index.js +1 -0
- package/dist/sky-dialog/sky-dialog.d.ts +237 -0
- package/dist/sky-dialog/sky-dialog.js +265 -0
- package/dist/sky-dialog/sky-dialog.js.map +1 -0
- package/dist/sky-divider/index.d.ts +1 -0
- package/dist/sky-divider/index.js +1 -0
- package/dist/sky-divider/sky-divider.d.ts +120 -0
- package/dist/sky-divider/sky-divider.js +42 -0
- package/dist/sky-divider/sky-divider.js.map +1 -0
- package/dist/sky-drawer/index.d.ts +1 -0
- package/dist/sky-drawer/index.js +1 -0
- package/dist/sky-drawer/sky-drawer.d.ts +161 -0
- package/dist/sky-drawer/sky-drawer.js +177 -0
- package/dist/sky-drawer/sky-drawer.js.map +1 -0
- package/dist/sky-dropdown/index.d.ts +1 -0
- package/dist/sky-dropdown/index.js +1 -0
- package/dist/sky-dropdown/sky-dropdown.d.ts +252 -0
- package/dist/sky-dropdown/sky-dropdown.js +58 -0
- package/dist/sky-dropdown/sky-dropdown.js.map +1 -0
- package/dist/sky-dropdown-item/index.d.ts +1 -0
- package/dist/sky-dropdown-item/index.js +1 -0
- package/dist/sky-dropdown-item/sky-dropdown-item.d.ts +207 -0
- package/dist/sky-dropdown-item/sky-dropdown-item.js +341 -0
- package/dist/sky-dropdown-item/sky-dropdown-item.js.map +1 -0
- package/dist/sky-flexbar/index.d.ts +1 -0
- package/dist/sky-flexbar/index.js +1 -0
- package/dist/sky-flexbar/sky-flexbar.d.ts +189 -0
- package/dist/sky-flexbar/sky-flexbar.js +148 -0
- package/dist/sky-flexbar/sky-flexbar.js.map +1 -0
- package/dist/sky-flexbox/index.d.ts +1 -0
- package/dist/sky-flexbox/index.js +1 -0
- package/dist/sky-flexbox/sky-flexbox.d.ts +156 -0
- package/dist/sky-flexbox/sky-flexbox.js +40 -0
- package/dist/sky-flexbox/sky-flexbox.js.map +1 -0
- package/dist/sky-flexcol/index.d.ts +1 -0
- package/dist/sky-flexcol/index.js +1 -0
- package/dist/sky-flexcol/sky-flexcol.d.ts +154 -0
- package/dist/sky-flexcol/sky-flexcol.js +14 -0
- package/dist/sky-flexcol/sky-flexcol.js.map +1 -0
- package/dist/sky-flexitem/index.d.ts +1 -0
- package/dist/sky-flexitem/index.js +1 -0
- package/dist/sky-flexitem/sky-flexitem.d.ts +114 -0
- package/dist/sky-flexitem/sky-flexitem.js +45 -0
- package/dist/sky-flexitem/sky-flexitem.js.map +1 -0
- package/dist/sky-form/index.d.ts +1 -0
- package/dist/sky-form/index.js +1 -0
- package/dist/sky-form/sky-form.d.ts +286 -0
- package/dist/sky-form/sky-form.js +66 -0
- package/dist/sky-form/sky-form.js.map +1 -0
- package/dist/sky-grid/index.d.ts +1 -0
- package/dist/sky-grid/index.js +1 -0
- package/dist/sky-grid/sky-grid.d.ts +78 -0
- package/dist/sky-grid/sky-grid.js +40 -0
- package/dist/sky-grid/sky-grid.js.map +1 -0
- package/dist/sky-icon/index.d.ts +1 -0
- package/dist/sky-icon/index.js +1 -0
- package/dist/sky-icon/ion-local.json.js +2 -0
- package/dist/sky-icon/ion-local.json.js.map +1 -0
- package/dist/sky-icon/sky-icon.d.ts +123 -0
- package/dist/sky-icon/sky-icon.js +40 -0
- package/dist/sky-icon/sky-icon.js.map +1 -0
- package/dist/sky-image/index.d.ts +1 -0
- package/dist/sky-image/index.js +1 -0
- package/dist/sky-image/sky-image.d.ts +102 -0
- package/dist/sky-image/sky-image.js +29 -0
- package/dist/sky-image/sky-image.js.map +1 -0
- package/dist/sky-input/index.d.ts +1 -0
- package/dist/sky-input/index.js +1 -0
- package/dist/sky-input/sky-input.d.ts +345 -0
- package/dist/sky-input/sky-input.js +820 -0
- package/dist/sky-input/sky-input.js.map +1 -0
- package/dist/sky-list/index.d.ts +1 -0
- package/dist/sky-list/index.js +1 -0
- package/dist/sky-list/sky-list.d.ts +85 -0
- package/dist/sky-list/sky-list.js +41 -0
- package/dist/sky-list/sky-list.js.map +1 -0
- package/dist/sky-listitem/index.d.ts +1 -0
- package/dist/sky-listitem/index.js +1 -0
- package/dist/sky-listitem/sky-listitem.d.ts +76 -0
- package/dist/sky-listitem/sky-listitem.js +104 -0
- package/dist/sky-listitem/sky-listitem.js.map +1 -0
- package/dist/sky-navbar/index.d.ts +1 -0
- package/dist/sky-navbar/index.js +1 -0
- package/dist/sky-navbar/sky-navbar.d.ts +207 -0
- package/dist/sky-navbar/sky-navbar.js +521 -0
- package/dist/sky-navbar/sky-navbar.js.map +1 -0
- package/dist/sky-navpanel/index.d.ts +1 -0
- package/dist/sky-navpanel/index.js +1 -0
- package/dist/sky-navpanel/sky-navpanel.d.ts +186 -0
- package/dist/sky-navpanel/sky-navpanel.js +404 -0
- package/dist/sky-navpanel/sky-navpanel.js.map +1 -0
- package/dist/sky-notification/index.d.ts +1 -0
- package/dist/sky-notification/index.js +1 -0
- package/dist/sky-notification/sky-notification.d.ts +152 -0
- package/dist/sky-notification/sky-notification.js +456 -0
- package/dist/sky-notification/sky-notification.js.map +1 -0
- package/dist/sky-otp/index.d.ts +1 -0
- package/dist/sky-otp/index.js +1 -0
- package/dist/sky-otp/sky-otp.d.ts +101 -0
- package/dist/sky-otp/sky-otp.js +96 -0
- package/dist/sky-otp/sky-otp.js.map +1 -0
- package/dist/sky-overlay/index.d.ts +1 -0
- package/dist/sky-overlay/index.js +1 -0
- package/dist/sky-overlay/sky-overlay.d.ts +71 -0
- package/dist/sky-overlay/sky-overlay.js +26 -0
- package/dist/sky-overlay/sky-overlay.js.map +1 -0
- package/dist/sky-pagination/index.d.ts +1 -0
- package/dist/sky-pagination/index.js +1 -0
- package/dist/sky-pagination/sky-pagination.d.ts +167 -0
- package/dist/sky-pagination/sky-pagination.js +453 -0
- package/dist/sky-pagination/sky-pagination.js.map +1 -0
- package/dist/sky-progress/index.d.ts +1 -0
- package/dist/sky-progress/index.js +1 -0
- package/dist/sky-progress/sky-progress.d.ts +70 -0
- package/dist/sky-progress/sky-progress.js +87 -0
- package/dist/sky-progress/sky-progress.js.map +1 -0
- package/dist/sky-radio/index.d.ts +1 -0
- package/dist/sky-radio/index.js +1 -0
- package/dist/sky-radio/sky-radio.d.ts +118 -0
- package/dist/sky-radio/sky-radio.js +109 -0
- package/dist/sky-radio/sky-radio.js.map +1 -0
- package/dist/sky-radio-group/index.d.ts +1 -0
- package/dist/sky-radio-group/index.js +1 -0
- package/dist/sky-radio-group/sky-radio-group.d.ts +186 -0
- package/dist/sky-radio-group/sky-radio-group.js +239 -0
- package/dist/sky-radio-group/sky-radio-group.js.map +1 -0
- package/dist/sky-range/index.d.ts +1 -0
- package/dist/sky-range/index.js +1 -0
- package/dist/sky-range/sky-range.d.ts +110 -0
- package/dist/sky-range/sky-range.js +196 -0
- package/dist/sky-range/sky-range.js.map +1 -0
- package/dist/sky-row/index.d.ts +1 -0
- package/dist/sky-row/index.js +1 -0
- package/dist/sky-row/sky-row.d.ts +57 -0
- package/dist/sky-row/sky-row.js +6 -0
- package/dist/sky-row/sky-row.js.map +1 -0
- package/dist/sky-serial/index.d.ts +1 -0
- package/dist/sky-serial/index.js +1 -0
- package/dist/sky-serial/sky-serial.d.ts +127 -0
- package/dist/sky-serial/sky-serial.js +133 -0
- package/dist/sky-serial/sky-serial.js.map +1 -0
- package/dist/sky-sheet/index.d.ts +1 -0
- package/dist/sky-sheet/index.js +1 -0
- package/dist/sky-sheet/sky-sheet.d.ts +70 -0
- package/dist/sky-sheet/sky-sheet.js +47 -0
- package/dist/sky-sheet/sky-sheet.js.map +1 -0
- package/dist/sky-skeleton/index.d.ts +1 -0
- package/dist/sky-skeleton/index.js +1 -0
- package/dist/sky-skeleton/sky-skeleton.d.ts +80 -0
- package/dist/sky-skeleton/sky-skeleton.js +233 -0
- package/dist/sky-skeleton/sky-skeleton.js.map +1 -0
- package/dist/sky-slider/index.d.ts +1 -0
- package/dist/sky-slider/index.js +1 -0
- package/dist/sky-slider/sky-slider.d.ts +96 -0
- package/dist/sky-slider/sky-slider.js +139 -0
- package/dist/sky-slider/sky-slider.js.map +1 -0
- package/dist/sky-speeddial/index.d.ts +1 -0
- package/dist/sky-speeddial/index.js +1 -0
- package/dist/sky-speeddial/sky-speeddial.d.ts +86 -0
- package/dist/sky-speeddial/sky-speeddial.js +154 -0
- package/dist/sky-speeddial/sky-speeddial.js.map +1 -0
- package/dist/sky-spinner/index.d.ts +1 -0
- package/dist/sky-spinner/index.js +1 -0
- package/dist/sky-spinner/sky-spinner.d.ts +87 -0
- package/dist/sky-spinner/sky-spinner.js +334 -0
- package/dist/sky-spinner/sky-spinner.js.map +1 -0
- package/dist/sky-steps/index.d.ts +1 -0
- package/dist/sky-steps/index.js +1 -0
- package/dist/sky-steps/sky-steps.d.ts +170 -0
- package/dist/sky-steps/sky-steps.js +455 -0
- package/dist/sky-steps/sky-steps.js.map +1 -0
- package/dist/sky-switch/index.d.ts +1 -0
- package/dist/sky-switch/index.js +1 -0
- package/dist/sky-switch/sky-switch.d.ts +116 -0
- package/dist/sky-switch/sky-switch.js +191 -0
- package/dist/sky-switch/sky-switch.js.map +1 -0
- package/dist/sky-tab/index.d.ts +1 -0
- package/dist/sky-tab/index.js +1 -0
- package/dist/sky-tab/sky-tab.d.ts +188 -0
- package/dist/sky-tab/sky-tab.js +390 -0
- package/dist/sky-tab/sky-tab.js.map +1 -0
- package/dist/sky-tab-button/index.d.ts +1 -0
- package/dist/sky-tab-button/index.js +1 -0
- package/dist/sky-tab-button/sky-tab-button.d.ts +114 -0
- package/dist/sky-tab-button/sky-tab-button.js +167 -0
- package/dist/sky-tab-button/sky-tab-button.js.map +1 -0
- package/dist/sky-theme-provider/index.d.ts +1 -0
- package/dist/sky-theme-provider/index.js +1 -0
- package/dist/sky-theme-provider/sky-theme-provider.d.ts +169 -0
- package/dist/sky-theme-provider/sky-theme-provider.js +12 -0
- package/dist/sky-theme-provider/sky-theme-provider.js.map +1 -0
- package/dist/sky-theme-switcher/index.d.ts +1 -0
- package/dist/sky-theme-switcher/index.js +1 -0
- package/dist/sky-theme-switcher/sky-theme-switcher.d.ts +92 -0
- package/dist/sky-theme-switcher/sky-theme-switcher.js +43 -0
- package/dist/sky-theme-switcher/sky-theme-switcher.js.map +1 -0
- package/dist/sky-tooltip/index.d.ts +1 -0
- package/dist/sky-tooltip/index.js +1 -0
- package/dist/sky-tooltip/sky-tooltip.d.ts +156 -0
- package/dist/sky-tooltip/sky-tooltip.js +242 -0
- package/dist/sky-tooltip/sky-tooltip.js.map +1 -0
- package/package.json +475 -0
- package/plugins/rollup-plugin.d.ts +19 -0
- package/plugins/rollup-plugin.js +129 -0
- package/plugins/vite-plugin.d.ts +22 -0
- package/plugins/vite-plugin.js +116 -0
- package/plugins/webpack-plugin.d.ts +12 -0
- package/plugins/webpack-plugin.js +46 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{__decorate as t,__metadata as i}from"tslib";import{LitElement as e,css as s,html as o}from"lit";import{property as d,state as r,customElement as p}from"lit/decorators.js";import{styleMap as n}from"lit/directives/style-map.js";let a=class extends e{constructor(){super(...arguments),this.src="",this.alt="Image",this.width="auto",this.height="auto",this.aspectRatio=null,this.borderRadius="0",this.boxShadow="none",this.objectFit="cover",this.objectPosition="center",this.srcset="",this.sizes="",this.autoSizes=!1,this._computedSizes="",this.loading="lazy",this.decoding="async",this._sizesRafId=null,this._updateSizes=()=>{null==this._sizesRafId&&(this._sizesRafId=requestAnimationFrame(()=>{this._sizesRafId=null;const t=Math.ceil(this.getBoundingClientRect().width);t>0&&(this._computedSizes=`${t}px`)}))}}static{this.styles=s`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
img {
|
|
7
|
+
display: block;
|
|
8
|
+
max-width: 100%; /* keeps it responsive if width="auto" */
|
|
9
|
+
}
|
|
10
|
+
`}firstUpdated(){this.autoSizes&&(this._ro=new ResizeObserver(this._updateSizes),this._ro.observe(this),this._updateSizes())}disconnectedCallback(){super.disconnectedCallback(),this._ro?.disconnect(),null!=this._sizesRafId&&(cancelAnimationFrame(this._sizesRafId),this._sizesRafId=null)}render(){const t=this.autoSizes?this._computedSizes:this.sizes||"",i=null!=this.src&&""!==String(this.src).trim(),e={width:this.width,height:this.height,borderRadius:this.borderRadius,boxShadow:this.boxShadow,objectFit:this.objectFit,objectPosition:this.objectPosition,aspectRatio:this.aspectRatio??"auto"};return i?o`
|
|
11
|
+
<img
|
|
12
|
+
src=${this.src}
|
|
13
|
+
alt=${this.alt}
|
|
14
|
+
srcset=${this.srcset}
|
|
15
|
+
sizes=${t}
|
|
16
|
+
loading=${this.loading}
|
|
17
|
+
decoding=${this.decoding}
|
|
18
|
+
style=${n(e)}
|
|
19
|
+
part="img"
|
|
20
|
+
/>
|
|
21
|
+
`:o`
|
|
22
|
+
<div
|
|
23
|
+
part="img"
|
|
24
|
+
style=${n({...e,display:"block",background:"var(--sky-bg-tertiary, rgba(0,0,0,0.04))"})}
|
|
25
|
+
aria-label=${this.alt}
|
|
26
|
+
role="img"
|
|
27
|
+
></div>
|
|
28
|
+
`}};t([d({type:String}),i("design:type",Object)],a.prototype,"src",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"alt",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"width",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"height",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"aspectRatio",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"borderRadius",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"boxShadow",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"objectFit",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"objectPosition",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"srcset",void 0),t([d({type:String}),i("design:type",Object)],a.prototype,"sizes",void 0),t([d({type:Boolean}),i("design:type",Object)],a.prototype,"autoSizes",void 0),t([r(),i("design:type",Object)],a.prototype,"_computedSizes",void 0),t([d({type:String}),i("design:type",String)],a.prototype,"loading",void 0),t([d({type:String}),i("design:type",String)],a.prototype,"decoding",void 0),a=t([p("sky-image")],a);export{a as SkyImage};
|
|
29
|
+
//# sourceMappingURL=sky-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sky-image.js","sources":["../../src/sky-image/sky-image.ts"],"sourcesContent":[null],"names":["SkyImage","LitElement","constructor","this","src","alt","width","height","aspectRatio","borderRadius","boxShadow","objectFit","objectPosition","srcset","sizes","autoSizes","_computedSizes","loading","decoding","_sizesRafId","_updateSizes","requestAnimationFrame","w","Math","ceil","getBoundingClientRect","styles","css","firstUpdated","_ro","ResizeObserver","observe","disconnectedCallback","super","disconnect","cancelAnimationFrame","render","sizesAttr","hasSrc","String","trim","styleVars","html","styleMap","display","background","__decorate","property","type","prototype","Boolean","state","customElement"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sky-input";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sky-input.js';
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { FormControlBase } from "../helper/internals/form-control-base";
|
|
2
|
+
export type SkyInputValue = string | number | File[] | null;
|
|
3
|
+
export type SkyInputType = string;
|
|
4
|
+
export type SkyInputErrorDisplayMode = "none" | "single" | "all";
|
|
5
|
+
export type SkyInputIconPosition = "left" | "right";
|
|
6
|
+
export type SkyInputValidation = (value: string | File[]) => true | string;
|
|
7
|
+
export type SkyInputValueChangedDetail = {
|
|
8
|
+
value: string | number;
|
|
9
|
+
};
|
|
10
|
+
export type SkyInputValueClearedDetail = {
|
|
11
|
+
value: string | number;
|
|
12
|
+
};
|
|
13
|
+
export type SkyInputFileSelectedDetail = {
|
|
14
|
+
files: File[];
|
|
15
|
+
fileName: string;
|
|
16
|
+
totalSize: number;
|
|
17
|
+
fileCount: number;
|
|
18
|
+
};
|
|
19
|
+
export type SkyInputValidationErrorDetail = {
|
|
20
|
+
errors: string[];
|
|
21
|
+
};
|
|
22
|
+
export type SkyInputIconClickDetail = {
|
|
23
|
+
position: SkyInputIconPosition;
|
|
24
|
+
eventType: string | null;
|
|
25
|
+
eventData: Event | null;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @element sky-input
|
|
29
|
+
*
|
|
30
|
+
* @summary Versatile form input supporting text, password, number, textarea, and file workflows.
|
|
31
|
+
*
|
|
32
|
+
* @status stable
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
*
|
|
35
|
+
* @documentation https://library.sky-ui.com/components/input
|
|
36
|
+
* @dependency sky-icon
|
|
37
|
+
*
|
|
38
|
+
* @uiVModel value value-changed
|
|
39
|
+
*
|
|
40
|
+
* @slot icon-left - Optional icon/content placed in the left slot.
|
|
41
|
+
* @slot icon-right - Optional icon/content placed in the right slot.
|
|
42
|
+
* @property {SkyInputValue} value - Current input value.
|
|
43
|
+
* @property {string} placeholder - Placeholder text.
|
|
44
|
+
* @property {string} label - Label text shown above the input.
|
|
45
|
+
* @property {SkyInputType} type - Input type (`text`, `password`, `number`, `textarea`, `file`, etc.).
|
|
46
|
+
* @property {string} suffix - Optional suffix label fragment.
|
|
47
|
+
* @property {string} prefix - Optional prefix label fragment.
|
|
48
|
+
* @property {string} prefixColor - Prefix color override.
|
|
49
|
+
* @property {string} suffixColor - Suffix color override.
|
|
50
|
+
* @property {string} color - Accent color token/value.
|
|
51
|
+
* @property {SkyInputValidation[]} validations - Validation functions.
|
|
52
|
+
* @property {boolean} compact - Compact display mode.
|
|
53
|
+
* @property {boolean} loading - Loading state.
|
|
54
|
+
* @property {boolean} showErrors - Enables error rendering.
|
|
55
|
+
* @property {boolean} clearable - Enables clear button.
|
|
56
|
+
* @property {SkyInputErrorDisplayMode} errorDisplayMode - Error rendering mode.
|
|
57
|
+
* @property {boolean} showNumberButtons - Enables number increment/decrement controls.
|
|
58
|
+
* @property {boolean} showPasswordToggle - Enables password visibility toggle.
|
|
59
|
+
* @property {string} passwordVisibleIcon - Icon used when password is visible.
|
|
60
|
+
* @property {string} passwordHiddenIcon - Icon used when password is hidden.
|
|
61
|
+
*
|
|
62
|
+
* @fires {CustomEvent<SkyInputValueChangedDetail>} value-changed - Fired when value changes.
|
|
63
|
+
* @fires {CustomEvent<SkyInputValueClearedDetail>} value-cleared - Fired after clear action.
|
|
64
|
+
* @fires {CustomEvent<SkyInputFileSelectedDetail>} file-selected - Fired after file selection changes.
|
|
65
|
+
* @fires {CustomEvent<SkyInputValidationErrorDetail>} validation-error - Fired after validations run.
|
|
66
|
+
* @fires {CustomEvent<SkyInputIconClickDetail>} left-icon-click - Fired when left icon slot is clicked.
|
|
67
|
+
* @fires {CustomEvent<SkyInputIconClickDetail>} right-icon-click - Fired when right icon slot is clicked.
|
|
68
|
+
*
|
|
69
|
+
* @method validateInput Runs configured validations and updates invalid state.
|
|
70
|
+
* @method handleClear Clears value and emits corresponding events.
|
|
71
|
+
* @method formatFileSize Formats byte size for UI display.
|
|
72
|
+
* @method focusInput Focuses the underlying native input or textarea.
|
|
73
|
+
*
|
|
74
|
+
* @csspart input-container - The outer container wrapping label and input wrapper.
|
|
75
|
+
* @csspart label - The label element above the input.
|
|
76
|
+
* @csspart input-wrapper - The wrapper around input/textarea and icons.
|
|
77
|
+
* @csspart icon-slot - Base class for left/right icon slots.
|
|
78
|
+
* @csspart icon-slot-left - Left icon slot.
|
|
79
|
+
* @csspart icon-slot-right - Right icon slot.
|
|
80
|
+
* @csspart clear-button - The clear/reset button.
|
|
81
|
+
* @csspart toggle-password - The toggle icon for password visibility.
|
|
82
|
+
* @csspart loading-indicator - The spinner shown when loading.
|
|
83
|
+
* @csspart error-list - UL element containing validation errors.
|
|
84
|
+
* @csspart error - Individual error message.
|
|
85
|
+
* @csspart file-info - File count and size info below the file input.
|
|
86
|
+
* @csspart custom-file-label - Label for file inputs when styled.
|
|
87
|
+
*
|
|
88
|
+
* @Behavior
|
|
89
|
+
* - Extends `FormControlBase` for automatic form association and validation integration
|
|
90
|
+
* - Supports all standard HTML input types with enhanced styling and functionality
|
|
91
|
+
* - File inputs with multi-file support, preview, and size tracking
|
|
92
|
+
* - Automatic validation integration with parent forms via `sky-form`
|
|
93
|
+
*
|
|
94
|
+
* - **none**: No error messages displayed
|
|
95
|
+
* - **single**: Show only the first error message
|
|
96
|
+
* - **all**: Show all validation error messages
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```html
|
|
100
|
+
* <sky-input
|
|
101
|
+
* label="Password"
|
|
102
|
+
* type="password"
|
|
103
|
+
* placeholder="Enter your password"
|
|
104
|
+
* clearable
|
|
105
|
+
* show-password-toggle
|
|
106
|
+
* required
|
|
107
|
+
* >
|
|
108
|
+
* <sky-icon slot="icon-left" icon="ion:lock-closed"></sky-icon>
|
|
109
|
+
* </sky-input>
|
|
110
|
+
* ```
|
|
111
|
+
* ```vue
|
|
112
|
+
* <template>
|
|
113
|
+
* <sky-input label="Password" type="password" clearable show-password-toggle required>
|
|
114
|
+
* <sky-icon slot="icon-left" icon="ion:lock-closed"></sky-icon>
|
|
115
|
+
* </sky-input>
|
|
116
|
+
* </template>
|
|
117
|
+
* ```
|
|
118
|
+
* ```jsx
|
|
119
|
+
* export default function Demo() {
|
|
120
|
+
* return (
|
|
121
|
+
* <sky-input label="Password" type="password" clearable show-password-toggle required>
|
|
122
|
+
* <sky-icon slot="icon-left" icon="ion:lock-closed"></sky-icon>
|
|
123
|
+
* </sky-input>
|
|
124
|
+
* );
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare class SkyInput extends FormControlBase {
|
|
129
|
+
static dependencies: Record<string, CustomElementConstructor>;
|
|
130
|
+
value: SkyInputValue;
|
|
131
|
+
placeholder: string;
|
|
132
|
+
label: string;
|
|
133
|
+
type: SkyInputType;
|
|
134
|
+
suffix: string;
|
|
135
|
+
prefix: string;
|
|
136
|
+
prefixColor: string;
|
|
137
|
+
suffixColor: string;
|
|
138
|
+
color: string;
|
|
139
|
+
validations: SkyInputValidation[];
|
|
140
|
+
compact: boolean;
|
|
141
|
+
loading: boolean;
|
|
142
|
+
showErrors: boolean;
|
|
143
|
+
clearable: boolean;
|
|
144
|
+
errorDisplayMode: SkyInputErrorDisplayMode;
|
|
145
|
+
required: boolean;
|
|
146
|
+
step: string | null;
|
|
147
|
+
min: string | null;
|
|
148
|
+
max: string | null;
|
|
149
|
+
autocapitalize: string;
|
|
150
|
+
autocomplete: string;
|
|
151
|
+
spellcheck: boolean;
|
|
152
|
+
dir: string;
|
|
153
|
+
rows: number;
|
|
154
|
+
resizable: string;
|
|
155
|
+
accept: string;
|
|
156
|
+
multiple: boolean;
|
|
157
|
+
inputmode: string | null;
|
|
158
|
+
enterkeyhint: string | null;
|
|
159
|
+
pattern: string | null;
|
|
160
|
+
minlength: number | null;
|
|
161
|
+
maxlength: number | null;
|
|
162
|
+
list: string | null;
|
|
163
|
+
size: number | null;
|
|
164
|
+
cols: number | null;
|
|
165
|
+
autofocus: boolean;
|
|
166
|
+
capture: boolean;
|
|
167
|
+
inputRole: string | null;
|
|
168
|
+
ariaLabel: string | null;
|
|
169
|
+
ariaLabelledby: string | null;
|
|
170
|
+
ariaDescribedby: string | null;
|
|
171
|
+
showNumberButtons: boolean;
|
|
172
|
+
showPasswordToggle: boolean;
|
|
173
|
+
passwordVisibleIcon: string;
|
|
174
|
+
passwordHiddenIcon: string;
|
|
175
|
+
validationActive: boolean;
|
|
176
|
+
invalid: boolean;
|
|
177
|
+
variant: string;
|
|
178
|
+
private selectedFileName;
|
|
179
|
+
private selectedFiles;
|
|
180
|
+
private focused;
|
|
181
|
+
private validationStatus;
|
|
182
|
+
private validationErrors;
|
|
183
|
+
private typingStarted;
|
|
184
|
+
private autofillIconSlot;
|
|
185
|
+
private showPassword;
|
|
186
|
+
private totalFileSize;
|
|
187
|
+
private selectedFileCount;
|
|
188
|
+
private filePreview;
|
|
189
|
+
private inputWrapperEl;
|
|
190
|
+
private nativeInputEl;
|
|
191
|
+
static styles: import("lit").CSSResult;
|
|
192
|
+
static shadowRootOptions: {
|
|
193
|
+
delegatesFocus: boolean;
|
|
194
|
+
clonable?: boolean;
|
|
195
|
+
customElementRegistry?: CustomElementRegistry;
|
|
196
|
+
mode: ShadowRootMode;
|
|
197
|
+
serializable?: boolean;
|
|
198
|
+
slotAssignment?: SlotAssignmentMode;
|
|
199
|
+
};
|
|
200
|
+
connectedCallback(): void;
|
|
201
|
+
firstUpdated(_changedProperties: Map<string | number | symbol, unknown>): void;
|
|
202
|
+
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
203
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
204
|
+
/** @protected */
|
|
205
|
+
protected getFormValue(): string | File | FormData | null;
|
|
206
|
+
/** @protected */
|
|
207
|
+
protected setValueFromFormState(state: string | File | FormData | null): void;
|
|
208
|
+
/** @protected */
|
|
209
|
+
protected getValidityAnchor(): HTMLElement | undefined;
|
|
210
|
+
/** @protected */
|
|
211
|
+
protected isEmpty(): boolean;
|
|
212
|
+
/** @protected */
|
|
213
|
+
protected getCustomErrorMessage(): string;
|
|
214
|
+
/** @protected */
|
|
215
|
+
protected getNativeControl(): HTMLElement | null;
|
|
216
|
+
/** @protected */
|
|
217
|
+
protected onNativeValueMutated(native: any): void;
|
|
218
|
+
/**
|
|
219
|
+
* Resets the input field to its initial state.
|
|
220
|
+
* @public
|
|
221
|
+
*/
|
|
222
|
+
reset(): void;
|
|
223
|
+
/** @private */
|
|
224
|
+
private get nativeRequiredMessage();
|
|
225
|
+
/** @private */
|
|
226
|
+
private getEmittedValue;
|
|
227
|
+
/**
|
|
228
|
+
* Clears the input value and resets typing state.
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
handleClear(): void;
|
|
232
|
+
/**
|
|
233
|
+
* Handles the `change` event triggered by the file input element.
|
|
234
|
+
* @param {Event} event - The event object generated by the file input element when files are selected.
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
handleFileChange(event: Event): void;
|
|
238
|
+
/**
|
|
239
|
+
* Handles the keydown event for the input component.
|
|
240
|
+
* @param event - The keyboard event triggered by the user.
|
|
241
|
+
* @private
|
|
242
|
+
*/
|
|
243
|
+
private handleKeydown;
|
|
244
|
+
/**
|
|
245
|
+
* Gets the current file preview.
|
|
246
|
+
* @returns The preview of the file, as stored in `filePreview`.
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
get preview(): string | ArrayBuffer | null;
|
|
250
|
+
/**
|
|
251
|
+
* Handles the input event for the input field.
|
|
252
|
+
* @param {Event} event - The input event triggered by user interaction.
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
handleInput(event: Event): void;
|
|
256
|
+
/**
|
|
257
|
+
* Handles the focus event for the input field.
|
|
258
|
+
* @public
|
|
259
|
+
*/
|
|
260
|
+
handleFocus(event: Event): void;
|
|
261
|
+
/** @protected */
|
|
262
|
+
protected onFormReset(): void;
|
|
263
|
+
/**
|
|
264
|
+
* Handles the blur event for the input field.
|
|
265
|
+
* @public
|
|
266
|
+
*/
|
|
267
|
+
handleBlur(event: Event): void;
|
|
268
|
+
/** @protected */
|
|
269
|
+
protected validateForForm(): string;
|
|
270
|
+
/**
|
|
271
|
+
* Validates the input value against the configured validation rules.
|
|
272
|
+
* @returns {boolean} True if validation passes, false otherwise.
|
|
273
|
+
* @public
|
|
274
|
+
*/
|
|
275
|
+
validateInput(): boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Retrieves validation error messages based on the configured error display mode.
|
|
278
|
+
* @returns {Array} - An array of error messages to display.
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
private getErrorMessages;
|
|
282
|
+
/**
|
|
283
|
+
* Handles click events for the left or right icon slots.
|
|
284
|
+
* @param {String} position - The position of the icon ("left" or "right").
|
|
285
|
+
* @param {Event|null} event - The original event triggered by the click (optional).
|
|
286
|
+
* @public
|
|
287
|
+
*/
|
|
288
|
+
handleIconClick(position: "left" | "right", event?: Event | null): void;
|
|
289
|
+
/**
|
|
290
|
+
* Formats a file size in bytes into a human-readable string.
|
|
291
|
+
* @param {number} bytes - The file size in bytes.
|
|
292
|
+
* @returns {string} - The formatted file size string.
|
|
293
|
+
* @public
|
|
294
|
+
*/
|
|
295
|
+
formatFileSize(bytes: number): string;
|
|
296
|
+
/**
|
|
297
|
+
* Increments the input value by the specified step, respecting min/max constraints.
|
|
298
|
+
* @private
|
|
299
|
+
*/
|
|
300
|
+
private incrementValue;
|
|
301
|
+
/**
|
|
302
|
+
* Decrements the input value by the specified step, respecting min/max constraints.
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
private decrementValue;
|
|
306
|
+
/**
|
|
307
|
+
* Renders validation error messages if applicable.
|
|
308
|
+
* @returns {TemplateResult|null} - The rendered error messages or null.
|
|
309
|
+
* @private
|
|
310
|
+
*/
|
|
311
|
+
private renderValidationErrors;
|
|
312
|
+
/**
|
|
313
|
+
* Toggles the visibility of the password input.
|
|
314
|
+
* @public
|
|
315
|
+
*/
|
|
316
|
+
togglePasswordVisibility(): void;
|
|
317
|
+
focusInput(): void;
|
|
318
|
+
/**
|
|
319
|
+
* Handles click events on the input wrapper.
|
|
320
|
+
* @param {Event} event - The original click event.
|
|
321
|
+
* @private
|
|
322
|
+
*/
|
|
323
|
+
private handleWrapperClick;
|
|
324
|
+
/** @private */
|
|
325
|
+
private get isInvalid();
|
|
326
|
+
/** @private */
|
|
327
|
+
private get describedById();
|
|
328
|
+
/**
|
|
329
|
+
* Refocuses the input element.
|
|
330
|
+
* @private
|
|
331
|
+
*/
|
|
332
|
+
private refocusInput;
|
|
333
|
+
/**
|
|
334
|
+
* Keeps the input focused when interacting with related controls.
|
|
335
|
+
* @param {Event} e - The original event.
|
|
336
|
+
* @private
|
|
337
|
+
*/
|
|
338
|
+
private keepInputFocused;
|
|
339
|
+
/**
|
|
340
|
+
* Triggers the native dropdown for date/time/file inputs.
|
|
341
|
+
* @private
|
|
342
|
+
*/
|
|
343
|
+
private triggerNativeDropdown;
|
|
344
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
345
|
+
}
|