@sky.ui/core 0.0.8 → 0.0.21
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/auto-import.js +1 -31
- package/dist/custom-elements.json +7115 -21498
- package/dist/helper/utils/color-resolver.d.ts +12 -0
- package/dist/helper/utils/color-resolver.js +1 -1
- package/dist/helper/utils/color-resolver.js.map +1 -1
- package/dist/index.d.ts +1 -31
- package/dist/index.js +1 -1
- package/dist/sky-alert/sky-alert.js +32 -42
- package/dist/sky-alert/sky-alert.js.map +1 -1
- package/dist/sky-appbar/sky-appbar.d.ts +5 -0
- package/dist/sky-appbar/sky-appbar.js +63 -21
- package/dist/sky-appbar/sky-appbar.js.map +1 -1
- package/dist/sky-avatar/sky-avatar.d.ts +2 -2
- package/dist/sky-avatar/sky-avatar.js +36 -28
- package/dist/sky-avatar/sky-avatar.js.map +1 -1
- package/dist/sky-badge/sky-badge.d.ts +2 -0
- package/dist/sky-badge/sky-badge.js +21 -19
- package/dist/sky-badge/sky-badge.js.map +1 -1
- package/dist/sky-button/sky-button.d.ts +4 -0
- package/dist/sky-button/sky-button.js +85 -26
- package/dist/sky-button/sky-button.js.map +1 -1
- package/dist/sky-card/sky-card.d.ts +7 -1
- package/dist/sky-card/sky-card.js +72 -40
- package/dist/sky-card/sky-card.js.map +1 -1
- package/dist/sky-checkbox/sky-checkbox.js +34 -23
- package/dist/sky-checkbox/sky-checkbox.js.map +1 -1
- package/dist/sky-chip/sky-chip.js +53 -35
- package/dist/sky-chip/sky-chip.js.map +1 -1
- package/dist/sky-combobox/sky-combobox.d.ts +6 -2
- package/dist/sky-combobox/sky-combobox.js +92 -262
- package/dist/sky-combobox/sky-combobox.js.map +1 -1
- package/dist/sky-dialog/sky-dialog.d.ts +4 -11
- package/dist/sky-dialog/sky-dialog.js +78 -131
- package/dist/sky-dialog/sky-dialog.js.map +1 -1
- package/dist/sky-flexbox/sky-flexbox.js.map +1 -1
- package/dist/sky-form/sky-form.js +21 -19
- package/dist/sky-form/sky-form.js.map +1 -1
- package/dist/sky-image/sky-image.d.ts +1 -0
- package/dist/sky-image/sky-image.js +14 -7
- package/dist/sky-image/sky-image.js.map +1 -1
- package/dist/sky-input/sky-input.d.ts +15 -2
- package/dist/sky-input/sky-input.js +188 -193
- package/dist/sky-input/sky-input.js.map +1 -1
- package/dist/sky-list/sky-list.d.ts +11 -2
- package/dist/sky-list/sky-list.js +15 -25
- package/dist/sky-list/sky-list.js.map +1 -1
- package/dist/sky-listitem/sky-listitem.js +62 -30
- package/dist/sky-listitem/sky-listitem.js.map +1 -1
- package/dist/sky-radio/sky-radio.d.ts +2 -0
- package/dist/sky-radio/sky-radio.js +29 -9
- package/dist/sky-radio/sky-radio.js.map +1 -1
- package/dist/sky-sheet/sky-sheet.d.ts +1 -1
- package/dist/sky-sheet/sky-sheet.js +68 -22
- package/dist/sky-sheet/sky-sheet.js.map +1 -1
- package/dist/sky-simple-table/index.d.ts +1 -0
- package/dist/sky-simple-table/index.js +1 -0
- package/dist/sky-simple-table/sky-simple-table.d.ts +68 -0
- package/dist/sky-simple-table/sky-simple-table.js +100 -0
- package/dist/sky-simple-table/sky-simple-table.js.map +1 -0
- package/dist/sky-theme-provider/sky-theme-provider.d.ts +10 -1
- package/dist/sky-theme-provider/sky-theme-provider.js +2 -2
- package/dist/sky-theme-provider/sky-theme-provider.js.map +1 -1
- package/package.json +24 -269
- package/dist/sky-accordion/index.d.ts +0 -1
- package/dist/sky-accordion/index.js +0 -1
- package/dist/sky-accordion/sky-accordion.d.ts +0 -201
- package/dist/sky-accordion/sky-accordion.js +0 -84
- package/dist/sky-accordion/sky-accordion.js.map +0 -1
- package/dist/sky-accordion-item/index.d.ts +0 -1
- package/dist/sky-accordion-item/index.js +0 -1
- package/dist/sky-accordion-item/sky-accordion-item.d.ts +0 -161
- package/dist/sky-accordion-item/sky-accordion-item.js +0 -191
- package/dist/sky-accordion-item/sky-accordion-item.js.map +0 -1
- package/dist/sky-breadcrumb/index.d.ts +0 -1
- package/dist/sky-breadcrumb/index.js +0 -1
- package/dist/sky-breadcrumb/sky-breadcrumb.d.ts +0 -111
- package/dist/sky-breadcrumb/sky-breadcrumb.js +0 -230
- package/dist/sky-breadcrumb/sky-breadcrumb.js.map +0 -1
- package/dist/sky-button-group/index.d.ts +0 -1
- package/dist/sky-button-group/index.js +0 -1
- package/dist/sky-button-group/sky-button-group.d.ts +0 -93
- package/dist/sky-button-group/sky-button-group.js +0 -281
- package/dist/sky-button-group/sky-button-group.js.map +0 -1
- package/dist/sky-carousel/index.d.ts +0 -1
- package/dist/sky-carousel/index.js +0 -1
- package/dist/sky-carousel/sky-carousel.d.ts +0 -265
- package/dist/sky-carousel/sky-carousel.js +0 -211
- package/dist/sky-carousel/sky-carousel.js.map +0 -1
- package/dist/sky-counter/index.d.ts +0 -1
- package/dist/sky-counter/index.js +0 -1
- package/dist/sky-counter/sky-counter.d.ts +0 -130
- package/dist/sky-counter/sky-counter.js +0 -101
- package/dist/sky-counter/sky-counter.js.map +0 -1
- package/dist/sky-drawer/index.d.ts +0 -1
- package/dist/sky-drawer/index.js +0 -1
- package/dist/sky-drawer/sky-drawer.d.ts +0 -161
- package/dist/sky-drawer/sky-drawer.js +0 -175
- package/dist/sky-drawer/sky-drawer.js.map +0 -1
- package/dist/sky-dropdown/index.d.ts +0 -1
- package/dist/sky-dropdown/index.js +0 -1
- package/dist/sky-dropdown/sky-dropdown.d.ts +0 -254
- package/dist/sky-dropdown/sky-dropdown.js +0 -61
- package/dist/sky-dropdown/sky-dropdown.js.map +0 -1
- package/dist/sky-dropdown-item/index.d.ts +0 -1
- package/dist/sky-dropdown-item/index.js +0 -1
- package/dist/sky-dropdown-item/sky-dropdown-item.d.ts +0 -207
- package/dist/sky-dropdown-item/sky-dropdown-item.js +0 -341
- package/dist/sky-dropdown-item/sky-dropdown-item.js.map +0 -1
- package/dist/sky-flexbar/index.d.ts +0 -1
- package/dist/sky-flexbar/index.js +0 -1
- package/dist/sky-flexbar/sky-flexbar.d.ts +0 -189
- package/dist/sky-flexbar/sky-flexbar.js +0 -157
- package/dist/sky-flexbar/sky-flexbar.js.map +0 -1
- package/dist/sky-flexitem/index.d.ts +0 -1
- package/dist/sky-flexitem/index.js +0 -1
- package/dist/sky-flexitem/sky-flexitem.d.ts +0 -114
- package/dist/sky-flexitem/sky-flexitem.js +0 -52
- package/dist/sky-flexitem/sky-flexitem.js.map +0 -1
- package/dist/sky-navbar/index.d.ts +0 -1
- package/dist/sky-navbar/index.js +0 -1
- package/dist/sky-navbar/sky-navbar.d.ts +0 -211
- package/dist/sky-navbar/sky-navbar.js +0 -521
- package/dist/sky-navbar/sky-navbar.js.map +0 -1
- package/dist/sky-navpanel/index.d.ts +0 -1
- package/dist/sky-navpanel/index.js +0 -1
- package/dist/sky-navpanel/sky-navpanel.d.ts +0 -187
- package/dist/sky-navpanel/sky-navpanel.js +0 -404
- package/dist/sky-navpanel/sky-navpanel.js.map +0 -1
- package/dist/sky-notification/index.d.ts +0 -1
- package/dist/sky-notification/index.js +0 -1
- package/dist/sky-notification/sky-notification.d.ts +0 -152
- package/dist/sky-notification/sky-notification.js +0 -456
- package/dist/sky-notification/sky-notification.js.map +0 -1
- package/dist/sky-otp/index.d.ts +0 -1
- package/dist/sky-otp/index.js +0 -1
- package/dist/sky-otp/sky-otp.d.ts +0 -101
- package/dist/sky-otp/sky-otp.js +0 -96
- package/dist/sky-otp/sky-otp.js.map +0 -1
- package/dist/sky-overlay/index.d.ts +0 -1
- package/dist/sky-overlay/index.js +0 -1
- package/dist/sky-overlay/sky-overlay.d.ts +0 -71
- package/dist/sky-overlay/sky-overlay.js +0 -26
- package/dist/sky-overlay/sky-overlay.js.map +0 -1
- package/dist/sky-pagination/index.d.ts +0 -1
- package/dist/sky-pagination/index.js +0 -1
- package/dist/sky-pagination/sky-pagination.d.ts +0 -167
- package/dist/sky-pagination/sky-pagination.js +0 -453
- package/dist/sky-pagination/sky-pagination.js.map +0 -1
- package/dist/sky-progress/index.d.ts +0 -1
- package/dist/sky-progress/index.js +0 -1
- package/dist/sky-progress/sky-progress.d.ts +0 -70
- package/dist/sky-progress/sky-progress.js +0 -87
- package/dist/sky-progress/sky-progress.js.map +0 -1
- package/dist/sky-radio-group/index.d.ts +0 -1
- package/dist/sky-radio-group/index.js +0 -1
- package/dist/sky-radio-group/sky-radio-group.d.ts +0 -186
- package/dist/sky-radio-group/sky-radio-group.js +0 -239
- package/dist/sky-radio-group/sky-radio-group.js.map +0 -1
- package/dist/sky-range/index.d.ts +0 -1
- package/dist/sky-range/index.js +0 -1
- package/dist/sky-range/sky-range.d.ts +0 -110
- package/dist/sky-range/sky-range.js +0 -196
- package/dist/sky-range/sky-range.js.map +0 -1
- package/dist/sky-serial/index.d.ts +0 -1
- package/dist/sky-serial/index.js +0 -1
- package/dist/sky-serial/sky-serial.d.ts +0 -127
- package/dist/sky-serial/sky-serial.js +0 -133
- package/dist/sky-serial/sky-serial.js.map +0 -1
- package/dist/sky-skeleton/index.d.ts +0 -1
- package/dist/sky-skeleton/index.js +0 -1
- package/dist/sky-skeleton/sky-skeleton.d.ts +0 -80
- package/dist/sky-skeleton/sky-skeleton.js +0 -233
- package/dist/sky-skeleton/sky-skeleton.js.map +0 -1
- package/dist/sky-slider/index.d.ts +0 -1
- package/dist/sky-slider/index.js +0 -1
- package/dist/sky-slider/sky-slider.d.ts +0 -96
- package/dist/sky-slider/sky-slider.js +0 -139
- package/dist/sky-slider/sky-slider.js.map +0 -1
- package/dist/sky-speeddial/index.d.ts +0 -1
- package/dist/sky-speeddial/index.js +0 -1
- package/dist/sky-speeddial/sky-speeddial.d.ts +0 -86
- package/dist/sky-speeddial/sky-speeddial.js +0 -154
- package/dist/sky-speeddial/sky-speeddial.js.map +0 -1
- package/dist/sky-spinner/index.d.ts +0 -1
- package/dist/sky-spinner/index.js +0 -1
- package/dist/sky-spinner/sky-spinner.d.ts +0 -87
- package/dist/sky-spinner/sky-spinner.js +0 -334
- package/dist/sky-spinner/sky-spinner.js.map +0 -1
- package/dist/sky-steps/index.d.ts +0 -1
- package/dist/sky-steps/index.js +0 -1
- package/dist/sky-steps/sky-steps.d.ts +0 -170
- package/dist/sky-steps/sky-steps.js +0 -455
- package/dist/sky-steps/sky-steps.js.map +0 -1
- package/dist/sky-switch/index.d.ts +0 -1
- package/dist/sky-switch/index.js +0 -1
- package/dist/sky-switch/sky-switch.d.ts +0 -116
- package/dist/sky-switch/sky-switch.js +0 -191
- package/dist/sky-switch/sky-switch.js.map +0 -1
- package/dist/sky-tab/index.d.ts +0 -1
- package/dist/sky-tab/index.js +0 -1
- package/dist/sky-tab/sky-tab.d.ts +0 -188
- package/dist/sky-tab/sky-tab.js +0 -390
- package/dist/sky-tab/sky-tab.js.map +0 -1
- package/dist/sky-tab-button/index.d.ts +0 -1
- package/dist/sky-tab-button/index.js +0 -1
- package/dist/sky-tab-button/sky-tab-button.d.ts +0 -114
- package/dist/sky-tab-button/sky-tab-button.js +0 -167
- package/dist/sky-tab-button/sky-tab-button.js.map +0 -1
- package/dist/sky-theme-switcher/index.d.ts +0 -1
- package/dist/sky-theme-switcher/index.js +0 -1
- package/dist/sky-theme-switcher/sky-theme-switcher.d.ts +0 -92
- package/dist/sky-theme-switcher/sky-theme-switcher.js +0 -43
- package/dist/sky-theme-switcher/sky-theme-switcher.js.map +0 -1
- package/dist/sky-tooltip/index.d.ts +0 -1
- package/dist/sky-tooltip/index.js +0 -1
- package/dist/sky-tooltip/sky-tooltip.d.ts +0 -156
- package/dist/sky-tooltip/sky-tooltip.js +0 -242
- package/dist/sky-tooltip/sky-tooltip.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
1
|
+
import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as s,html as o,nothing as r}from"lit";import{ifDefined as a}from"lit/directives/if-defined.js";import{styleMap as n}from"lit/directives/style-map.js";import{property as l,state as p,query as d,customElement as c}from"lit/decorators.js";import{resolveColor as h}from"../helper/utils/color-resolver.js";import{live as u}from"lit/directives/live.js";import{FormControlBase as y}from"../helper/internals/form-control-base.js";import{SkyIcon as v}from"../sky-icon/sky-icon.js";let f=class extends y{constructor(){super(...arguments),this.value="",this.placeholder="",this.label="",this.type="text",this.suffix="",this.prefix="",this.prefixColor="",this.suffixColor="",this.color="primary",this._validations=[],this.compact=!1,this.loading=!1,this.showErrors=!1,this.clearable=!1,this.errorDisplayMode="single",this.required=!1,this.step=null,this.min=null,this.max=null,this.autocapitalize="off",this.autocomplete="off",this.spellcheck=!1,this.dir="ltr",this.rows=6,this.resizable="none",this.accept="",this.multiple=!1,this.inputmode=null,this.enterkeyhint=null,this.pattern=null,this.minlength=null,this.maxlength=null,this.list=null,this.size=null,this.cols=null,this.autofocus=!1,this.capture=!1,this.inputRole=null,this.ariaLabel=null,this.ariaLabelledby=null,this.ariaDescribedby=null,this.showNumberButtons=!1,this.showPasswordToggle=!0,this.passwordVisibleIcon="material-symbols:visibility-off",this.passwordHiddenIcon="material-symbols:visibility",this.validationActive=!1,this.invalid=!1,this.variant="default",this.selectedFileName="",this.selectedFiles=[],this.focused=!1,this.validationStatus=[],this.validationErrors=[],this.typingStarted=!1,this.autofillIconSlot="left",this.autofillGuardActive=!1,this.showPassword=!1,this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null,this._leftIconSlot=null,this._rightIconSlot=null,this._iconClickWired=new WeakSet,this._onLeftIconSlotChange=()=>this._wireIconSlot("left",this._leftIconSlot),this._onRightIconSlotChange=()=>this._wireIconSlot("right",this._rightIconSlot),this.keepInputFocused=t=>{t.preventDefault(),t.stopPropagation(),this.refocusInput()}}static{this.dependencies={"sky-icon":v}}get validations(){return this._validations}set validations(t){const e=this._validations;this._validations=Array.isArray(t)?t:[],this.requestUpdate("validations",e)}static{this.styles=i`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
font-family: var(--sky-font);
|
|
@@ -6,7 +6,7 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
:host([disabled]) .input-container {
|
|
9
|
-
opacity: 0.6;
|
|
9
|
+
opacity: var(--sky-opacity-disabled, 0.6);
|
|
10
10
|
}
|
|
11
11
|
:host([disabled]) * {
|
|
12
12
|
pointer-events: none;
|
|
@@ -39,7 +39,7 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
39
39
|
}
|
|
40
40
|
.label {
|
|
41
41
|
font-size: var(--sky-font-size-sm);
|
|
42
|
-
margin-bottom:
|
|
42
|
+
margin-bottom: var(--sky-space-1, 4px);
|
|
43
43
|
text-align: start;
|
|
44
44
|
white-space: nowrap;
|
|
45
45
|
overflow: hidden;
|
|
@@ -57,29 +57,18 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
57
57
|
display: flex;
|
|
58
58
|
width: 100%;
|
|
59
59
|
align-items: center;
|
|
60
|
-
background: transparent;
|
|
61
|
-
border-radius: var(--sky-radius-secondary);
|
|
62
|
-
background: var(--sky-glass-primary);
|
|
63
60
|
box-sizing: border-box;
|
|
64
61
|
height: 38px;
|
|
65
62
|
pointer-events: auto;
|
|
63
|
+
background: var(--sky-glass-solid);
|
|
64
|
+
backdrop-filter: none;
|
|
65
|
+
-webkit-backdrop-filter: none;
|
|
66
|
+
border-radius: var(--sky-radius-secondary);
|
|
66
67
|
border: var(--sky-border-primary);
|
|
67
|
-
transition: border 0.3s ease;
|
|
68
68
|
box-shadow: var(--sky-box-shadow-primary);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.input-wrapper::before {
|
|
73
|
-
content: "";
|
|
74
|
-
position: absolute;
|
|
75
|
-
inset: 0px;
|
|
76
|
-
backdrop-filter: var(--sky-blur-primary) var(--sky-brightness-primary)
|
|
77
|
-
var(--sky-saturation-primary);
|
|
78
|
-
-webkit-backdrop-filter: var(--sky-blur-primary)
|
|
79
|
-
var(--sky-brightness-primary) var(--sky-saturation-primary);
|
|
80
|
-
z-index: -1;
|
|
81
|
-
|
|
82
|
-
border-radius: inherit;
|
|
69
|
+
transition:
|
|
70
|
+
border-color var(--sky-transition-normal, 200ms ease),
|
|
71
|
+
box-shadow var(--sky-transition-normal, 200ms ease);
|
|
83
72
|
}
|
|
84
73
|
|
|
85
74
|
.input-wrapper::after {
|
|
@@ -99,6 +88,12 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
99
88
|
pointer-events: none;
|
|
100
89
|
}
|
|
101
90
|
|
|
91
|
+
.input-wrapper:has(input:focus-visible)::after,
|
|
92
|
+
.input-wrapper:has(textarea:focus-visible)::after {
|
|
93
|
+
opacity: 1;
|
|
94
|
+
border-bottom-color: var(--sky-input-color);
|
|
95
|
+
}
|
|
96
|
+
|
|
102
97
|
.input-wrapper:has(input:focus)::after,
|
|
103
98
|
.input-wrapper:has(textarea:focus)::after {
|
|
104
99
|
opacity: 1;
|
|
@@ -132,7 +127,6 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
132
127
|
appearance: none;
|
|
133
128
|
background: none;
|
|
134
129
|
border: none;
|
|
135
|
-
padding-right: 40px;
|
|
136
130
|
font-family: inherit;
|
|
137
131
|
}
|
|
138
132
|
|
|
@@ -144,19 +138,19 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
144
138
|
display: none;
|
|
145
139
|
}
|
|
146
140
|
|
|
147
|
-
.input-wrapper {
|
|
148
|
-
transition: all 0.3s ease;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
141
|
.input-wrapper:has(input:focus)[compact]::after {
|
|
152
142
|
border: 1px solid var(--sky-input-color);
|
|
153
143
|
}
|
|
154
144
|
|
|
145
|
+
.toggle-password[compact] {
|
|
146
|
+
font-size: var(--sky-font-size-md);
|
|
147
|
+
}
|
|
148
|
+
|
|
155
149
|
input {
|
|
156
150
|
font-family: var(--sky-font);
|
|
157
151
|
font-size: var(--sky-font-size-md);
|
|
158
152
|
text-align: left;
|
|
159
|
-
transition: transform
|
|
153
|
+
transition: transform var(--sky-transition-normal, 200ms ease);
|
|
160
154
|
}
|
|
161
155
|
|
|
162
156
|
input:-webkit-autofill {
|
|
@@ -180,13 +174,13 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
180
174
|
}
|
|
181
175
|
.number-btn {
|
|
182
176
|
display: flex;
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
margin-inline-end: var(--sky-space-1, 4px);
|
|
179
|
+
gap: var(--sky-space-1, 4px);
|
|
185
180
|
}
|
|
186
181
|
|
|
187
182
|
:dir(rtl).number-btn {
|
|
188
|
-
margin-
|
|
189
|
-
margin-right: unset;
|
|
183
|
+
margin-inline-end: var(--sky-space-1, 4px);
|
|
190
184
|
}
|
|
191
185
|
|
|
192
186
|
.file-info {
|
|
@@ -203,18 +197,17 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
203
197
|
|
|
204
198
|
.increment-btn,
|
|
205
199
|
.decrement-btn {
|
|
206
|
-
background: var(--sky-glass-
|
|
200
|
+
background: var(--sky-glass-solid);
|
|
207
201
|
color: var(--sky-text-primary);
|
|
208
202
|
border: var(--sky-border-primary);
|
|
209
203
|
border-radius: var(--sky-radius-primary);
|
|
210
|
-
box-shadow: var(--sky-box-shadow-primary);
|
|
211
204
|
display: flex;
|
|
212
205
|
align-items: center;
|
|
213
206
|
justify-content: center;
|
|
214
|
-
padding: 2px 6px;
|
|
207
|
+
padding: var(--sky-space-0\\.5, 2px) var(--sky-space-1\\.5, 6px);
|
|
215
208
|
font-size: var(--sky-font-size-sm);
|
|
216
209
|
cursor: pointer;
|
|
217
|
-
transition:
|
|
210
|
+
transition: color var(--sky-transition-normal, 200ms ease);
|
|
218
211
|
font-family: var(--sky-font);
|
|
219
212
|
}
|
|
220
213
|
|
|
@@ -224,49 +217,88 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
224
217
|
}
|
|
225
218
|
|
|
226
219
|
.toggle-password {
|
|
227
|
-
|
|
228
|
-
|
|
220
|
+
flex-shrink: 0;
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
margin-inline-end: var(--sky-space-1, 4px);
|
|
229
225
|
font-size: var(--sky-font-size-lg);
|
|
230
226
|
color: var(--sky-text-tertiary);
|
|
231
227
|
cursor: pointer;
|
|
232
228
|
}
|
|
233
229
|
|
|
234
|
-
:dir(rtl) .toggle-password {
|
|
235
|
-
right: unset;
|
|
236
|
-
left: 10px;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.input-wrapper:has(.icon-slot[filled].right) .toggle-password {
|
|
240
|
-
right: 45px;
|
|
241
|
-
}
|
|
242
|
-
.input-wrapper:has(.icon-slot[filled].right) .clear-button {
|
|
243
|
-
right: 40px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
:dir(rtl).input-wrapper:has(.icon-slot[filled].right) .toggle-password {
|
|
247
|
-
right: unset;
|
|
248
|
-
left: 45px;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
230
|
.toggle-password:hover {
|
|
252
231
|
color: var(--sky-input-color);
|
|
253
232
|
}
|
|
254
233
|
|
|
255
234
|
input {
|
|
256
|
-
flex: 1;
|
|
257
|
-
min-width:
|
|
235
|
+
flex: 1 1 auto;
|
|
236
|
+
min-width: 0;
|
|
258
237
|
border: none;
|
|
259
238
|
outline: none;
|
|
260
239
|
background: transparent;
|
|
261
240
|
box-sizing: border-box;
|
|
262
241
|
color: var(--sky-text-primary);
|
|
263
|
-
padding: 0
|
|
242
|
+
padding-block: 0;
|
|
243
|
+
padding-inline: var(--sky-space-3, 12px);
|
|
264
244
|
}
|
|
265
245
|
|
|
266
246
|
input::placeholder {
|
|
267
247
|
color: var(--sky-text-tertiary);
|
|
268
248
|
}
|
|
269
249
|
|
|
250
|
+
.input-affix {
|
|
251
|
+
flex: 0 0 auto;
|
|
252
|
+
font-family: var(--sky-font);
|
|
253
|
+
font-size: var(--sky-font-size-md);
|
|
254
|
+
font-weight: var(--sky-font-weight-medium);
|
|
255
|
+
color: var(--sky-text-secondary);
|
|
256
|
+
user-select: none;
|
|
257
|
+
white-space: nowrap;
|
|
258
|
+
line-height: 1;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.input-affix.prefix {
|
|
262
|
+
padding-inline-start: var(--sky-space-3, 12px);
|
|
263
|
+
padding-inline-end: var(--sky-space-1, 4px);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.input-affix.suffix {
|
|
267
|
+
padding-inline-start: var(--sky-space-1, 4px);
|
|
268
|
+
padding-inline-end: var(--sky-space-2, 8px);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.input-wrapper[compact] .input-affix {
|
|
272
|
+
font-size: var(--sky-font-size-sm);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.input-wrapper:has(.input-affix.prefix) input,
|
|
276
|
+
.input-wrapper:has(.input-affix.prefix) textarea {
|
|
277
|
+
padding-inline-start: var(--sky-space-1, 4px);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.input-wrapper:has(.icon-slot[filled].left) input,
|
|
281
|
+
.input-wrapper:has(.icon-slot[filled].left) textarea {
|
|
282
|
+
padding-inline-start: var(--sky-space-1, 4px);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.custom-file-label__text {
|
|
286
|
+
flex: 1 1 auto;
|
|
287
|
+
min-width: 0;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
text-overflow: ellipsis;
|
|
290
|
+
color: var(--sky-text-tertiary);
|
|
291
|
+
padding-inline-end: var(--sky-space-3, 12px);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.custom-file-label:not(:has(.input-affix.prefix)) .custom-file-label__text {
|
|
295
|
+
padding-inline-start: var(--sky-space-3, 12px);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.custom-file-label__text[data-filled] {
|
|
299
|
+
color: var(--sky-text-primary);
|
|
300
|
+
}
|
|
301
|
+
|
|
270
302
|
.icon-slot {
|
|
271
303
|
display: none;
|
|
272
304
|
justify-content: center;
|
|
@@ -278,16 +310,12 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
278
310
|
max-height: 100%;
|
|
279
311
|
box-sizing: border-box;
|
|
280
312
|
min-width: 36px;
|
|
281
|
-
background: var(--sky-glass-
|
|
282
|
-
backdrop-filter:
|
|
283
|
-
|
|
284
|
-
-webkit-backdrop-filter: var(--sky-blur-primary)
|
|
285
|
-
var(--sky-brightness-primary) var(--sky-saturation-primary);
|
|
286
|
-
box-shadow: var(--sky-box-shadow-primary);
|
|
313
|
+
background: var(--sky-glass-solid);
|
|
314
|
+
backdrop-filter: none;
|
|
315
|
+
-webkit-backdrop-filter: none;
|
|
287
316
|
transition:
|
|
288
|
-
transform
|
|
289
|
-
color
|
|
290
|
-
|
|
317
|
+
transform var(--sky-transition-normal, 200ms ease),
|
|
318
|
+
color var(--sky-transition-normal, 200ms ease);
|
|
291
319
|
}
|
|
292
320
|
|
|
293
321
|
.input-wrapper:has(textarea) .icon-slot {
|
|
@@ -297,6 +325,7 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
297
325
|
|
|
298
326
|
.icon-slot[filled] {
|
|
299
327
|
display: flex;
|
|
328
|
+
flex-shrink: 0;
|
|
300
329
|
cursor: pointer;
|
|
301
330
|
}
|
|
302
331
|
.icon-slot[filled]:hover {
|
|
@@ -350,22 +379,6 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
350
379
|
transform: translate(-5px, -5px);
|
|
351
380
|
}
|
|
352
381
|
|
|
353
|
-
.input-wrapper:has(.icon-slot[filled].right) input {
|
|
354
|
-
padding: 0px 0 0 15px;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.input-wrapper:has(.icon-slot[filled].left) input {
|
|
358
|
-
padding: 0px 10px 0 5px;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
:dir(rtl) .input-wrapper:has(.icon-slot[filled].right) input {
|
|
362
|
-
padding: 0px 15px 0 0px;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
:dir(rtl) .input-wrapper:has(.icon-slot[filled].left) input {
|
|
366
|
-
padding: 0px 5px 0 10px;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
382
|
.progress-message {
|
|
370
383
|
pointer-events: none;
|
|
371
384
|
width: 100%;
|
|
@@ -403,27 +416,18 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
403
416
|
display: block;
|
|
404
417
|
}
|
|
405
418
|
|
|
406
|
-
.input-wrapper:has(.icon-slot[filled].right) .loading-indicator {
|
|
407
|
-
right: 45px;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
:dir(rtl).input-wrapper:has(.icon-slot[filled].right) .loading-indicator {
|
|
411
|
-
left: 45px;
|
|
412
|
-
right: unset;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
419
|
.input-wrapper[loading] input {
|
|
416
420
|
cursor: wait;
|
|
417
421
|
}
|
|
418
422
|
|
|
419
423
|
.loading-indicator {
|
|
420
|
-
|
|
421
|
-
|
|
424
|
+
flex-shrink: 0;
|
|
425
|
+
margin-inline-end: var(--sky-space-1, 4px);
|
|
422
426
|
width: 16px;
|
|
423
427
|
height: 16px;
|
|
424
428
|
border: 2px solid var(--sky-hover-primary);
|
|
425
429
|
border-top: 2px solid var(--sky-input-color);
|
|
426
|
-
border-radius:
|
|
430
|
+
border-radius: var(--sky-radius-full);
|
|
427
431
|
animation: spin 1s linear infinite;
|
|
428
432
|
}
|
|
429
433
|
|
|
@@ -432,14 +436,6 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
432
436
|
height: 10px;
|
|
433
437
|
}
|
|
434
438
|
|
|
435
|
-
.input-wrapper[loading] .loading-indicator.right {
|
|
436
|
-
right: 15px;
|
|
437
|
-
}
|
|
438
|
-
:dir(rtl).input-wrapper[loading] .loading-indicator.right {
|
|
439
|
-
left: 15px;
|
|
440
|
-
right: unset;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
439
|
.input-wrapper[loading] .icon-slot.right {
|
|
444
440
|
display: none;
|
|
445
441
|
}
|
|
@@ -454,44 +450,26 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
454
450
|
}
|
|
455
451
|
|
|
456
452
|
.clear-button {
|
|
457
|
-
|
|
458
|
-
|
|
453
|
+
flex-shrink: 0;
|
|
454
|
+
margin-inline-end: var(--sky-space-1, 4px);
|
|
459
455
|
border: none;
|
|
460
456
|
font-size: var(--sky-font-size-xl);
|
|
461
457
|
color: var(--sky-input-color);
|
|
462
458
|
background-color: var(--sky-hover-primary);
|
|
463
|
-
border-radius:
|
|
464
|
-
backdrop-filter:
|
|
465
|
-
|
|
466
|
-
-webkit-backdrop-filter: var(--sky-blur-primary)
|
|
467
|
-
var(--sky-brightness-primary) var(--sky-saturation-primary);
|
|
459
|
+
border-radius: var(--sky-radius-full);
|
|
460
|
+
backdrop-filter: none;
|
|
461
|
+
-webkit-backdrop-filter: none;
|
|
468
462
|
cursor: pointer;
|
|
469
|
-
transition: color
|
|
470
|
-
|
|
463
|
+
transition: color var(--sky-transition-normal, 200ms ease);
|
|
471
464
|
}
|
|
472
465
|
|
|
473
|
-
:dir(rtl) .clear-button {
|
|
474
|
-
left: 10px;
|
|
475
|
-
right: unset;
|
|
476
|
-
}
|
|
477
466
|
.clear-button[compact] {
|
|
478
467
|
font-size: var(--sky-font-size-md);
|
|
479
468
|
}
|
|
480
469
|
|
|
481
470
|
.clear-button[loading] {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
.input-wrapper:has(input[type="password"]) .clear-button {
|
|
485
|
-
right: 30px;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
:dir(rtl) .clear-button[loading] {
|
|
489
|
-
right: unset;
|
|
490
|
-
left: 40px;
|
|
491
|
-
}
|
|
492
|
-
:dir(rtl) .input-wrapper:has(input[type="password"]) .clear-button {
|
|
493
|
-
right: unset;
|
|
494
|
-
left: 30px;
|
|
471
|
+
opacity: 0.6;
|
|
472
|
+
pointer-events: none;
|
|
495
473
|
}
|
|
496
474
|
|
|
497
475
|
input[type="file"] {
|
|
@@ -507,8 +485,10 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
507
485
|
position: relative;
|
|
508
486
|
flex: 1;
|
|
509
487
|
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
gap: var(--sky-space-1, 4px);
|
|
510
490
|
text-align: left;
|
|
511
|
-
padding:
|
|
491
|
+
padding: 0;
|
|
512
492
|
color: var(--sky-input-color);
|
|
513
493
|
border-radius: var(--sky-radius-secondary);
|
|
514
494
|
overflow: hidden;
|
|
@@ -521,13 +501,8 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
521
501
|
font-family: var(--sky-font);
|
|
522
502
|
}
|
|
523
503
|
|
|
524
|
-
.custom-file-label:hover {
|
|
525
|
-
padding-
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
:dir(rtl) .custom-file-label:hover {
|
|
529
|
-
padding-left: unset;
|
|
530
|
-
padding-right: 12px;
|
|
504
|
+
.custom-file-label:hover .custom-file-label__text {
|
|
505
|
+
padding-inline-start: var(--sky-space-2\\.5, 10px);
|
|
531
506
|
}
|
|
532
507
|
|
|
533
508
|
.custom-file-label:empty::after {
|
|
@@ -539,24 +514,15 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
539
514
|
color: var(--sky-danger-primary);
|
|
540
515
|
}
|
|
541
516
|
|
|
542
|
-
.input-wrapper:has(.clear-button) input {
|
|
543
|
-
padding-right: 40px;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
:dir(rtl).input-wrapper:has(.clear-button) input {
|
|
547
|
-
padding-left: 40px;
|
|
548
|
-
padding-right: unset;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
517
|
textarea {
|
|
552
|
-
flex: 1;
|
|
553
|
-
min-width:
|
|
518
|
+
flex: 1 1 auto;
|
|
519
|
+
min-width: 0;
|
|
554
520
|
border: none;
|
|
555
521
|
outline: none;
|
|
556
522
|
background: transparent;
|
|
557
523
|
box-sizing: border-box;
|
|
558
524
|
color: var(--sky-text-primary);
|
|
559
|
-
padding: 10px
|
|
525
|
+
padding: var(--sky-space-2\\.5, 10px) var(--sky-space-3, 12px);
|
|
560
526
|
resize: none;
|
|
561
527
|
overflow: auto;
|
|
562
528
|
font-family: var(--sky-font);
|
|
@@ -570,12 +536,9 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
570
536
|
resize: both;
|
|
571
537
|
}
|
|
572
538
|
|
|
573
|
-
textarea
|
|
574
|
-
width:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
textarea::-webkit-scrollbar-track {
|
|
578
|
-
background: transparent;
|
|
539
|
+
textarea {
|
|
540
|
+
scrollbar-width: thin;
|
|
541
|
+
scrollbar-color: var(--sky-scrollbar-thumb) var(--sky-scrollbar-track);
|
|
579
542
|
}
|
|
580
543
|
|
|
581
544
|
textarea::-webkit-scrollbar {
|
|
@@ -584,20 +547,19 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
584
547
|
}
|
|
585
548
|
|
|
586
549
|
textarea::-webkit-scrollbar-thumb {
|
|
587
|
-
background-color: var(--sky-
|
|
588
|
-
border-radius:
|
|
589
|
-
transition: background-color
|
|
550
|
+
background-color: var(--sky-scrollbar-thumb);
|
|
551
|
+
border-radius: var(--sky-radius-full, 9999px);
|
|
552
|
+
transition: background-color var(--sky-duration-normal, 200ms)
|
|
553
|
+
var(--sky-ease-default, ease);
|
|
590
554
|
cursor: grab;
|
|
591
555
|
}
|
|
592
556
|
|
|
593
557
|
textarea::-webkit-scrollbar-thumb:hover {
|
|
594
|
-
background-color: var(--sky-
|
|
595
|
-
transition: background-color 0.3s ease-in-out;
|
|
558
|
+
background-color: var(--sky-scrollbar-thumb-hover);
|
|
596
559
|
}
|
|
597
560
|
|
|
598
561
|
textarea::-webkit-scrollbar-track {
|
|
599
|
-
background
|
|
600
|
-
border-radius: 4px;
|
|
562
|
+
background: var(--sky-scrollbar-track);
|
|
601
563
|
}
|
|
602
564
|
|
|
603
565
|
textarea::-webkit-scrollbar-button {
|
|
@@ -610,36 +572,62 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
610
572
|
|
|
611
573
|
.input-wrapper:has(textarea) {
|
|
612
574
|
height: calc((var(--rows)) * 23px);
|
|
575
|
+
align-items: flex-start;
|
|
613
576
|
}
|
|
614
577
|
textarea {
|
|
615
578
|
height: calc((var(--rows)) * 23px);
|
|
616
579
|
}
|
|
617
580
|
|
|
618
|
-
|
|
619
|
-
|
|
581
|
+
@media (prefers-reduced-motion: reduce) {
|
|
582
|
+
.loading-indicator {
|
|
583
|
+
animation: none;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.input-container:focus-within .label,
|
|
587
|
+
.input-wrapper,
|
|
588
|
+
.icon-slot,
|
|
589
|
+
.increment-btn,
|
|
590
|
+
.decrement-btn,
|
|
591
|
+
.clear-button,
|
|
592
|
+
input,
|
|
593
|
+
textarea,
|
|
594
|
+
.custom-file-label {
|
|
595
|
+
transition: none;
|
|
596
|
+
}
|
|
620
597
|
}
|
|
621
|
-
`}static{this.shadowRootOptions={...
|
|
598
|
+
`}static{this.shadowRootOptions={...s.shadowRootOptions,delegatesFocus:!0}}connectedCallback(){super.connectedCallback(),this.autofillGuardActive="search"===this.type,this.hasAttribute("tabindex")||(this.tabIndex=this.disabled?-1:0),this.hasUpdated&&this._setupIconSlots()}disconnectedCallback(){this._leftIconSlot?.removeEventListener("slotchange",this._onLeftIconSlotChange),this._rightIconSlot?.removeEventListener("slotchange",this._onRightIconSlotChange),this._leftIconSlot=null,this._rightIconSlot=null,super.disconnectedCallback()}_setupIconSlots(){this._leftIconSlot||(this._leftIconSlot=this.shadowRoot?.querySelector('slot[name="icon-left"]')??null,this._leftIconSlot?.addEventListener("slotchange",this._onLeftIconSlotChange)),this._rightIconSlot||(this._rightIconSlot=this.shadowRoot?.querySelector('slot[name="icon-right"]')??null,this._rightIconSlot?.addEventListener("slotchange",this._onRightIconSlotChange)),this._wireIconSlot("left",this._leftIconSlot),this._wireIconSlot("right",this._rightIconSlot)}_wireIconSlot(t,e){if(e)for(const i of e.assignedElements({flatten:!0}))i instanceof HTMLElement&&(this._iconClickWired.has(i)||(this._iconClickWired.add(i),i.addEventListener("click",()=>this.handleIconClick(t))))}firstUpdated(t){super.firstUpdated(t),this.captureDefaultValue(this.value),this.syncFormValue(),this.syncValidity(),this._setupIconSlots()}willUpdate(t){t.has("validations")&&Array.isArray(this.validations)&&(this.validationStatus=this.validations.map(()=>!1)),t.has("value")&&"file"===this.type&&(null==this.value||""===String(this.value).trim()?(this.selectedFileName="",this.selectedFiles=[],this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null):this.selectedFileName||(this.selectedFileName=this.value)),t.has("type")&&"search"===this.type&&(this.autofillGuardActive=!0)}updated(t){if(super.updated(t),t.has("color")&&this.color&&this.style.setProperty("--sky-input-color",h(this.color)),t.has("rows")){const t=this.inputWrapperEl;t&&t.style.setProperty("--rows",String(this.rows))}(t.has("value")||t.has("selectedFiles")||t.has("selectedFileName")||t.has("type")||t.has("multiple")||t.has("name")||t.has("disabled"))&&this.syncFormValue(),(t.has("value")||t.has("selectedFiles")||t.has("selectedFileName")||t.has("validationErrors")||t.has("required")||t.has("disabled")||t.has("readonly"))&&this.syncValidity()}getFormValue(){if(!this.name)return null;if("file"===this.type){if(!this.selectedFiles||0===this.selectedFiles.length)return null;if(this.multiple){const t=new FormData;for(const e of this.selectedFiles)t.append(this.name,e);return t}return this.selectedFiles[0]}return this.value??""}setValueFromFormState(t){"string"!=typeof t?(this.value="",this.selectedFileName="",this.selectedFiles=[],this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null):this.value=t}getValidityAnchor(){return this}isEmpty(){return"file"===this.type?!this.selectedFiles||0===this.selectedFiles.length:!this.value||""===this.value.toString().trim()}getCustomErrorMessage(){return this.validationErrors?.length?"all"===this.errorDisplayMode?this.validationErrors.join("\n"):this.validationErrors[0]:""}getNativeControl(){return"textarea"===this.type?this.shadowRoot?.querySelector("textarea"):this.shadowRoot?.querySelector("input")}onNativeValueMutated(t){"file"!==this.type&&(this.value=t?.value??""),this.validateInput()}reset(){this.value="",this.selectedFileName="",this.filePreview=null,this.selectedFiles=[],this.selectedFileCount=0,this.validationErrors=[],this.typingStarted=!1,this.validationActive=!1,this.selectedFileCount=0,this.totalFileSize=0}get nativeRequiredMessage(){return this.validationActive?this.disabled?"":this.required&&this.isEmpty()?this.requiredMessage||"This field is required.":"":""}getEmittedValue(){if("number"!==this.type)return this.value;if(""===this.value||null==this.value)return"";const t=Number(this.value);return Number.isFinite(t)?t:this.value}handleClear(){this.disabled||this.readonly||(this.reset(),this.validationActive=!0,this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-cleared",{detail:{value:this.getEmittedValue()},bubbles:!0,composed:!0})))}handleFileChange(t){if(this.disabled||this.readonly)return;const e=t.target.files;if(e&&e.length){const i=Array.from(e);this.selectedFiles=i,this.selectedFileName=i.map(t=>t.name).join(", "),this.value=this.selectedFileName,this.syncFormValue(),this.syncValidity();const s=i.reduce((t,e)=>t+e.size,0);if(this.totalFileSize=s,this.selectedFileCount=i.length,i[0].type.startsWith("image/")){const t=new FileReader;t.onload=t=>{t.target&&(this.filePreview=t.target.result)},t.readAsDataURL(i[0])}else this.filePreview=null;this.reemitNativeEvent("change",t),this.reemitNativeEvent("input",t),this.dispatchEvent(new CustomEvent("file-selected",{detail:{files:i,fileName:this.selectedFileName,totalSize:s,fileCount:this.selectedFileCount},bubbles:!0,composed:!0})),this.validateInput()}else this.value="",this.filePreview=null,this.totalFileSize=0,this.selectedFileCount=0,this.selectedFiles=[],this.validateInput()}handleKeydown(t){this.disabled||this.readonly||"Enter"===t.key&&"file"===this.type&&(t.preventDefault(),t.stopPropagation(),this.triggerNativeDropdown())}get preview(){return this.filePreview}handleInput(t){t.stopPropagation(),this.disabled||this.readonly?t.preventDefault():(this.value=t.target.value,this.syncFormValue(),this.syncValidity(),this.typingStarted||(this.typingStarted=!0),this.validateInput(),this.reemitNativeEvent("input",t),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()},bubbles:!0,composed:!0})))}handleFocus(t){t.stopPropagation(),this.releaseAutofillGuard(),this.focused=!0,this.reemitNativeEvent("focus",t)}releaseAutofillGuard(){this.autofillGuardActive&&(this.autofillGuardActive=!1)}handleAutofillGuardPointerDown(t){this.releaseAutofillGuard(),t.stopPropagation()}onFormReset(){this.setValueFromFormState(this.defaultValue),this.validationActive=!1,this.invalid=!1,this.typingStarted=!1,this.validationErrors=[],this.validationStatus=[],"file"===this.type&&(this.selectedFiles=[],this.selectedFileName="",this.totalFileSize=0,this.selectedFileCount=0,this.filePreview=null),"search"===this.type&&(this.autofillGuardActive=!0)}handleBlur(t){t.stopPropagation(),this.validationActive=!0,this.focused=!1,this.reemitNativeEvent("blur",t)}validateForForm(){const t="file"===this.type?this.selectedFiles??[]:this.value??"";for(const e of this.validations??[]){const i=e(t);if(!0!==i)return"string"==typeof i?i:"Invalid value."}return""}validateInput(){this.validationErrors=[],this.validationStatus=[];const t="file"===this.type,e=t?!this.selectedFiles||0===this.selectedFiles.length:!this.value||""===this.value.toString().trim();if(this.required&&e&&this.syncValidity(),Array.isArray(this.validations)&&this.validations.length){const e=t?this.selectedFiles??[]:this.value??"";this.validationStatus=this.validations.map((t,i)=>{try{if("function"!=typeof t)throw new Error(`Validation at index ${i} must be a function.`);const s=t(e);return!0===s||(this.validationErrors.push("string"==typeof s?s:`Validation ${i} failed.`),!1)}catch(t){const e="object"==typeof t&&null!==t&&"message"in t?String(t.message):"string"==typeof t?t:"Unknown error";return this.validationErrors.push(`Error in validation ${i}: ${e}`),!1}})}this.dispatchEvent(new CustomEvent("validation-error",{detail:{errors:this.validationErrors},bubbles:!0,composed:!0})),this.syncValidity();const i=0===this.validationErrors.length;return this.invalid=!i,i}getErrorMessages(){switch(this.errorDisplayMode){case"single":return this.validationErrors.slice(0,1);case"all":return this.validationErrors;default:return[]}}handleIconClick(t,e=null){this.dispatchEvent(new CustomEvent(`${t}-icon-click`,{detail:{position:t,eventType:e?e.type:null,eventData:e},bubbles:!0,composed:!0}))}formatFileSize(t){if(0===t)return"0 Bytes";const e=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/Math.pow(1024,e)).toFixed(2))} ${["Bytes","KB","MB","GB","TB"][e]}`}incrementValue(){if(this.disabled||this.readonly)return;const t=parseFloat(this.value)||0,e=parseFloat(this.step??"")||1;t+e<=(this.max?parseFloat(this.max):1/0)&&(this.value=(t+e).toString(),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()}}))),this.refocusInput()}decrementValue(){if(this.disabled||this.readonly)return;const t=parseFloat(this.value)||0,e=parseFloat(this.step??"")||1;t-e>=(this.min?parseFloat(this.min):-1/0)&&(this.value=(t-e).toString(),this.validateInput(),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.getEmittedValue()}}))),this.refocusInput()}renderValidationErrors(){if(!this.showErrors||!this.validationActive)return null;const t=this.nativeRequiredMessage,e=this.getErrorMessages();let i=[];if("single"===this.errorDisplayMode?t?i=[t]:e.length&&(i=[e[0]]):i=t?[t,...e]:e,!i.length)return null;const s=`${this.id||"sky-input"}-errors`;return o`
|
|
622
599
|
<div class="progress-message">
|
|
623
|
-
<ul id=${
|
|
624
|
-
${i.map(t=>
|
|
600
|
+
<ul id=${s} class="error-list" part="error-list">
|
|
601
|
+
${i.map(t=>o`<li class="error" part="error">${t}</li>`)}
|
|
625
602
|
</ul>
|
|
626
603
|
</div>
|
|
627
|
-
`}togglePasswordVisibility(){this.showPassword=!this.showPassword}focusInput(){const t=this.nativeInputEl;t&&"function"==typeof t.focus&&t.focus()}handleWrapperClick(t){if(t.stopPropagation(),this.disabled)return;const e=this.nativeInputEl;e&&"function"==typeof e.focus&&e.focus()}get isInvalid(){return this.matches(":invalid")||this.validationActive&&this.validationErrors.length>0}get describedById(){return this.ariaDescribedby??(this.showErrors?`${this.id||"sky-input"}-errors`:void 0)}refocusInput(){const t=this.shadowRoot?.querySelector("input");t?.focus({preventScroll:!0})}triggerNativeDropdown(){if(this.disabled||this.readonly)return;const t=this.shadowRoot?.querySelector('input[type="date"], input[type="time"], input[type="week"], input[type="month"], input[type="datetime-local"], input[type="file"]');t&&("file"===this.type?t.click():this.showPicker())}isFilterSearchInput(){return"search"===this.type}nativeAutocomplete(){return this.isFilterSearchInput()?"off":this.autocomplete}nativeTextInputType(t){return t&&this.showPassword||this.isFilterSearchInput()?"text":this.type}nativeInputMode(){return this.inputmode?this.inputmode:this.isFilterSearchInput()?"search":void 0}nativeEnterKeyHint(){return this.enterkeyhint?this.enterkeyhint:this.isFilterSearchInput()?"search":void 0}nativeInputRole(){return this.inputRole?this.inputRole:"search"===this.type?"searchbox":void 0}
|
|
604
|
+
`}togglePasswordVisibility(){this.showPassword=!this.showPassword}focusInput(){const t=this.nativeInputEl;t&&"function"==typeof t.focus&&t.focus()}handleWrapperClick(t){if(t.stopPropagation(),this.disabled)return;const e=this.nativeInputEl;e&&"function"==typeof e.focus&&e.focus()}get isInvalid(){return this.matches(":invalid")||this.validationActive&&this.validationErrors.length>0}get describedById(){return this.ariaDescribedby??(this.showErrors?`${this.id||"sky-input"}-errors`:void 0)}refocusInput(){const t=this.shadowRoot?.querySelector("input");t?.focus({preventScroll:!0})}triggerNativeDropdown(){if(this.disabled||this.readonly)return;const t=this.shadowRoot?.querySelector('input[type="date"], input[type="time"], input[type="week"], input[type="month"], input[type="datetime-local"], input[type="file"]');t&&("file"===this.type?t.click():this.showPicker())}isFilterSearchInput(){return"search"===this.type}nativeAutocomplete(){return this.isFilterSearchInput()?"off":this.autocomplete}nativeTextInputType(t){return t&&this.showPassword||this.isFilterSearchInput()?"text":this.type}nativeInputMode(){return this.inputmode?this.inputmode:this.isFilterSearchInput()?"search":void 0}nativeEnterKeyHint(){return this.enterkeyhint?this.enterkeyhint:this.isFilterSearchInput()?"search":void 0}nativeInputRole(){return this.inputRole?this.inputRole:"search"===this.type?"searchbox":void 0}affixColorStyle(t){const e=String(t??"").trim();if(e)return{color:h(e)}}renderInputAffix(t){const e="prefix"===t?this.prefix:this.suffix;if(!String(e??"").length)return r;const i="prefix"===t?this.prefixColor:this.suffixColor,s=this.affixColorStyle(i);return o`<span
|
|
605
|
+
class="input-affix ${t}"
|
|
606
|
+
part="input-${t}"
|
|
607
|
+
style=${s?n(s):r}
|
|
608
|
+
>${e}</span
|
|
609
|
+
>`}render(){const t="file"===this.type,e="textarea"===this.type,i="number"===this.type,s="password"===this.type,n=!t&&!e,l=!!this.querySelector('[slot="icon-left"]'),p=!!this.querySelector('[slot="icon-right"]');let d=null;"date"===this.type?d=o`<sky-icon icon="ion:calendar"></sky-icon>`:"time"===this.type?d=o`<sky-icon icon="ion:time"></sky-icon>`:"week"===this.type||"month"===this.type?d=o`<sky-icon icon="ion:calendar"></sky-icon>`:"datetime-local"===this.type&&(d=o`<sky-icon icon="ion:time"></sky-icon>`);const c=this.filePreview&&(l||p),h="left"===this.autofillIconSlot&&d,y="right"===this.autofillIconSlot&&d,v=()=>o`
|
|
628
610
|
<img
|
|
629
611
|
src=${a("string"==typeof this.filePreview?this.filePreview:void 0)}
|
|
630
612
|
alt="Preview"
|
|
631
613
|
style="width:100%;height:100%;object-fit:cover;border-radius:12px;"
|
|
632
614
|
/>
|
|
633
|
-
`,
|
|
615
|
+
`,f=()=>o`
|
|
634
616
|
<label
|
|
635
617
|
class="custom-file-label"
|
|
636
618
|
part="custom-file-label"
|
|
637
619
|
for="fileInput"
|
|
638
620
|
?disabled=${this.disabled}
|
|
639
621
|
>
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
622
|
+
${this.renderInputAffix("prefix")}
|
|
623
|
+
<span
|
|
624
|
+
class="custom-file-label__text"
|
|
625
|
+
part="custom-file-label-text"
|
|
626
|
+
?data-filled=${Boolean(this.selectedFileName)}
|
|
627
|
+
>
|
|
628
|
+
${this.selectedFileName||this.placeholder||"Choose file"}
|
|
629
|
+
</span>
|
|
630
|
+
${this.renderInputAffix("suffix")}
|
|
643
631
|
</label>
|
|
644
632
|
|
|
645
633
|
<input
|
|
@@ -667,9 +655,9 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
667
655
|
aria-labelledby=${a(this.ariaLabelledby||void 0)}
|
|
668
656
|
aria-describedby=${a(this.describedById)}
|
|
669
657
|
/>
|
|
670
|
-
`,
|
|
658
|
+
`,b=()=>o`
|
|
671
659
|
<textarea
|
|
672
|
-
.value=${
|
|
660
|
+
.value=${u(this.value)}
|
|
673
661
|
@input=${this.handleInput}
|
|
674
662
|
@focus=${this.handleFocus}
|
|
675
663
|
@blur=${this.handleBlur}
|
|
@@ -696,10 +684,10 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
696
684
|
aria-describedby=${a(this.describedById)}
|
|
697
685
|
role=${a(this.nativeInputRole())}
|
|
698
686
|
></textarea>
|
|
699
|
-
`,
|
|
687
|
+
`,g=()=>o`
|
|
700
688
|
<input
|
|
701
|
-
.type=${this.nativeTextInputType(
|
|
702
|
-
.value=${
|
|
689
|
+
.type=${this.nativeTextInputType(s)}
|
|
690
|
+
.value=${u(this.value)}
|
|
703
691
|
@input=${this.handleInput}
|
|
704
692
|
@focus=${this.handleFocus}
|
|
705
693
|
@blur=${this.handleBlur}
|
|
@@ -716,7 +704,7 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
716
704
|
spellcheck=${this.spellcheck}
|
|
717
705
|
inputmode=${a(this.nativeInputMode())}
|
|
718
706
|
enterkeyhint=${a(this.nativeEnterKeyHint())}
|
|
719
|
-
data-form-type=${this.isFilterSearchInput()?"other":
|
|
707
|
+
data-form-type=${this.isFilterSearchInput()?"other":r}
|
|
720
708
|
?data-1p-ignore=${this.isFilterSearchInput()}
|
|
721
709
|
?data-lpignore=${this.isFilterSearchInput()}
|
|
722
710
|
list=${a(this.list||void 0)}
|
|
@@ -735,29 +723,33 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
735
723
|
aria-describedby=${a(this.describedById)}
|
|
736
724
|
role=${a(this.nativeInputRole())}
|
|
737
725
|
/>
|
|
738
|
-
`;return
|
|
726
|
+
`;return o`
|
|
739
727
|
<div
|
|
740
728
|
class="input-container"
|
|
741
729
|
@click=${this.handleWrapperClick}
|
|
742
730
|
part="input-container"
|
|
743
731
|
>
|
|
744
|
-
${this.label?
|
|
732
|
+
${this.label?o`<div class="label" part="label">${this.label}</div>`:null}
|
|
745
733
|
<div
|
|
746
734
|
class="input-wrapper"
|
|
747
735
|
part="input-wrapper"
|
|
748
736
|
?compact=${this.compact}
|
|
749
737
|
?loading=${this.loading}
|
|
750
738
|
>
|
|
751
|
-
${(()=>
|
|
739
|
+
${(()=>o`
|
|
752
740
|
<div
|
|
753
741
|
class="icon-slot left ${this.focused?"focused":""}"
|
|
754
742
|
part="icon-slot icon-slot-left"
|
|
755
|
-
?filled=${Boolean(
|
|
743
|
+
?filled=${Boolean(c&&l)||Boolean(h)||l}
|
|
756
744
|
@click=${()=>{(t||h)&&this.triggerNativeDropdown()}}
|
|
757
745
|
>
|
|
758
|
-
${
|
|
746
|
+
${c&&l?v():h?d:o`<slot name="icon-left"></slot>`}
|
|
759
747
|
</div>
|
|
760
|
-
`)()}
|
|
748
|
+
`)()}
|
|
749
|
+
${n?this.renderInputAffix("prefix"):r}
|
|
750
|
+
${t?f():e?b():g()}
|
|
751
|
+
${n?this.renderInputAffix("suffix"):r}
|
|
752
|
+
${(()=>i&&this.showNumberButtons?o`
|
|
761
753
|
<div class="number-btn">
|
|
762
754
|
<button
|
|
763
755
|
class="decrement-btn"
|
|
@@ -782,38 +774,41 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
782
774
|
<sky-icon icon="ion:add"></sky-icon>
|
|
783
775
|
</button>
|
|
784
776
|
</div>
|
|
785
|
-
`:null)()} ${(()=>
|
|
777
|
+
`:null)()} ${(()=>s&&this.showPasswordToggle?o`
|
|
786
778
|
<sky-icon
|
|
787
779
|
class="toggle-password"
|
|
788
780
|
part="toggle-password"
|
|
781
|
+
?compact=${this.compact}
|
|
789
782
|
icon=${this.showPassword?this.passwordVisibleIcon:this.passwordHiddenIcon}
|
|
790
783
|
@click=${this.togglePasswordVisibility}
|
|
791
784
|
></sky-icon>
|
|
792
785
|
`:null)()}
|
|
793
|
-
${(()=>this.clearable&&(this.value||this.selectedFileName||this.selectedFileCount>0)?
|
|
786
|
+
${(()=>this.clearable&&(this.value||this.selectedFileName||this.selectedFileCount>0)?o`
|
|
794
787
|
<sky-icon
|
|
795
788
|
class="clear-button"
|
|
796
789
|
part="clear-button"
|
|
790
|
+
?compact=${this.compact}
|
|
797
791
|
@click=${this.handleClear}
|
|
798
792
|
?loading=${this.loading}
|
|
799
793
|
icon="ion:close"
|
|
800
794
|
></sky-icon>
|
|
801
|
-
`:null)()} ${(()=>this.loading?
|
|
802
|
-
class="loading-indicator
|
|
795
|
+
`:null)()} ${(()=>this.loading?o`<div
|
|
796
|
+
class="loading-indicator"
|
|
803
797
|
part="loading-indicator"
|
|
804
|
-
|
|
798
|
+
?compact=${this.compact}
|
|
799
|
+
></div>`:o`
|
|
805
800
|
<div
|
|
806
801
|
class="icon-slot right ${this.focused?"focused":""}"
|
|
807
802
|
part="icon-slot icon-slot-right"
|
|
808
|
-
?filled=${Boolean(
|
|
809
|
-
@click=${()=>{(t||
|
|
803
|
+
?filled=${Boolean(c&&p)||Boolean(y)||p}
|
|
804
|
+
@click=${()=>{(t||y)&&this.triggerNativeDropdown()}}
|
|
810
805
|
>
|
|
811
|
-
${
|
|
806
|
+
${c&&p?v():y?d:o`<slot name="icon-right"></slot>`}
|
|
812
807
|
</div>
|
|
813
808
|
`)()}
|
|
814
809
|
</div>
|
|
815
810
|
|
|
816
|
-
${(()=>t&&this.totalFileSize?
|
|
811
|
+
${(()=>t&&this.totalFileSize?o`
|
|
817
812
|
<div class="file-info" part="file-info">
|
|
818
813
|
<span>
|
|
819
814
|
${this.selectedFileCount}
|
|
@@ -823,5 +818,5 @@ import{__decorate as t,__metadata as e}from"tslib";import{css as i,LitElement as
|
|
|
823
818
|
</div>
|
|
824
819
|
`:null)()} ${this.renderValidationErrors()}
|
|
825
820
|
</div>
|
|
826
|
-
`}};t([
|
|
821
|
+
`}};t([l({type:String}),e("design:type",Object)],f.prototype,"value",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"placeholder",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"label",void 0),t([l({type:String}),e("design:type",String)],f.prototype,"type",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"suffix",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"prefix",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"prefixColor",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"suffixColor",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"color",void 0),t([l({type:Array}),e("design:type",Object),e("design:paramtypes",[Object])],f.prototype,"validations",null),t([l({type:Boolean,reflect:!0}),e("design:type",Object)],f.prototype,"compact",void 0),t([l({type:Boolean,reflect:!0}),e("design:type",Object)],f.prototype,"loading",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"showErrors",void 0),t([l({type:Boolean,reflect:!0}),e("design:type",Object)],f.prototype,"clearable",void 0),t([l({type:String}),e("design:type",String)],f.prototype,"errorDisplayMode",void 0),t([l({type:Boolean,reflect:!0}),e("design:type",Object)],f.prototype,"required",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"step",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"min",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"max",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"autocapitalize",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"autocomplete",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"spellcheck",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"dir",void 0),t([l({type:Number}),e("design:type",Object)],f.prototype,"rows",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"resizable",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"accept",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"multiple",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"inputmode",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"enterkeyhint",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"pattern",void 0),t([l({type:Number}),e("design:type",Object)],f.prototype,"minlength",void 0),t([l({type:Number}),e("design:type",Object)],f.prototype,"maxlength",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"list",void 0),t([l({type:Number}),e("design:type",Object)],f.prototype,"size",void 0),t([l({type:Number}),e("design:type",Object)],f.prototype,"cols",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"autofocus",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"capture",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"inputRole",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"ariaLabel",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"ariaLabelledby",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"ariaDescribedby",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"showNumberButtons",void 0),t([l({type:Boolean}),e("design:type",Object)],f.prototype,"showPasswordToggle",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"passwordVisibleIcon",void 0),t([l({type:String}),e("design:type",Object)],f.prototype,"passwordHiddenIcon",void 0),t([l({type:Boolean,reflect:!0}),e("design:type",Object)],f.prototype,"validationActive",void 0),t([l({type:Boolean,reflect:!0}),e("design:type",Object)],f.prototype,"invalid",void 0),t([l({type:String,reflect:!0}),e("design:type",Object)],f.prototype,"variant",void 0),t([p(),e("design:type",Object)],f.prototype,"selectedFileName",void 0),t([p(),e("design:type",Array)],f.prototype,"selectedFiles",void 0),t([p(),e("design:type",Object)],f.prototype,"focused",void 0),t([p(),e("design:type",Array)],f.prototype,"validationStatus",void 0),t([p(),e("design:type",Array)],f.prototype,"validationErrors",void 0),t([p(),e("design:type",Object)],f.prototype,"typingStarted",void 0),t([p(),e("design:type",Object)],f.prototype,"autofillIconSlot",void 0),t([p(),e("design:type",Object)],f.prototype,"autofillGuardActive",void 0),t([p(),e("design:type",Object)],f.prototype,"showPassword",void 0),t([p(),e("design:type",Object)],f.prototype,"totalFileSize",void 0),t([p(),e("design:type",Object)],f.prototype,"selectedFileCount",void 0),t([p(),e("design:type",Object)],f.prototype,"filePreview",void 0),t([d(".input-wrapper"),e("design:type",HTMLElement)],f.prototype,"inputWrapperEl",void 0),t([d("input, textarea"),e("design:type",Object)],f.prototype,"nativeInputEl",void 0),f=t([c("sky-input")],f);export{f as SkyInput};
|
|
827
822
|
//# sourceMappingURL=sky-input.js.map
|