@aquera/nile-elements 0.0.74 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/index.iife.js +182 -214
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +13 -0
- package/dist/nile-card/nile-card.css.cjs.js +1 -1
- package/dist/nile-card/nile-card.css.cjs.js.map +1 -1
- package/dist/nile-card/nile-card.css.esm.js +4 -4
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.esm.js +30 -47
- package/dist/nile-checkbox/nile-checkbox.esm.js +56 -54
- package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.esm.js +7 -2
- package/dist/nile-drawer/nile-drawer.esm.js +15 -8
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.css.esm.js +50 -91
- package/dist/nile-tag/nile-tag.esm.js +13 -14
- package/dist/src/nile-calendar/nile-calendar.css.js +13 -0
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-card/nile-card.css.js +2 -2
- package/dist/src/nile-card/nile-card.css.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.css.js +30 -47
- package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.d.ts +2 -4
- package/dist/src/nile-checkbox/nile-checkbox.js +63 -67
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.css.d.ts +5 -5
- package/dist/src/nile-drawer/nile-drawer.css.js +10 -5
- package/dist/src/nile-drawer/nile-drawer.css.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.js +18 -9
- package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.css.js +48 -89
- package/dist/src/nile-tag/nile-tag.css.js.map +1 -1
- package/dist/src/nile-tag/nile-tag.d.ts +2 -1
- package/dist/src/nile-tag/nile-tag.js +30 -13
- package/dist/src/nile-tag/nile-tag.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-calendar/nile-calendar.css.ts +13 -0
- package/src/nile-card/nile-card.css.ts +2 -2
- package/src/nile-checkbox/nile-checkbox.css.ts +34 -51
- package/src/nile-checkbox/nile-checkbox.ts +111 -108
- package/src/nile-drawer/nile-drawer.css.ts +11 -6
- package/src/nile-drawer/nile-drawer.ts +18 -9
- package/src/nile-tag/nile-tag.css.ts +48 -89
- package/src/nile-tag/nile-tag.ts +34 -15
package/dist/index.iife.js
CHANGED
@@ -1894,6 +1894,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
1894
1894
|
`}},M.NileBadge.styles=VN,N([$M({reflect:!0})],M.NileBadge.prototype,"variant",void 0),N([$M({type:Boolean,reflect:!0})],M.NileBadge.prototype,"rounded",void 0),N([$M({reflect:!0})],M.NileBadge.prototype,"pilltype",void 0),M.NileBadge=N([FM("nile-badge")],M.NileBadge);const FN=new Map,HN=new WeakMap;function XN(M,N){return"rtl"===N.toLowerCase()?{keyframes:M.rtlKeyframes||M.keyframes,options:M.options}:M}function $N(M,N){FN.set(M,function(M){return M??{keyframes:[],options:{duration:0}}}(N))}function _N(M,N,D){const i=HN.get(M);if(i?.[N])return XN(i[N],D.dir);const j=FN.get(N);return j?XN(j,D.dir):{keyframes:[],options:{duration:0}}}const qN=new Set;function KN(M){if(qN.add(M),!document.body.classList.contains("nile-scroll-lock")){const M=function(){const M=document.documentElement.clientWidth;return Math.abs(window.innerWidth-M)}();document.body.classList.add("nile-scroll-lock"),document.body.style.setProperty("--nile-scroll-lock-size",`${M}px`)}}function MD(M){qN.delete(M),0===qN.size&&(document.body.classList.remove("nile-scroll-lock"),document.body.style.removeProperty("--nile-scroll-lock-size"))}function ND(M,N,D="vertical",i="smooth"){const j=function(M,N){return{top:Math.round(M.getBoundingClientRect().top-N.getBoundingClientRect().top),left:Math.round(M.getBoundingClientRect().left-N.getBoundingClientRect().left)}}(M,N),t=j.top+N.scrollTop,I=j.left+N.scrollLeft,z=N.scrollLeft,u=N.scrollLeft+N.offsetWidth,g=N.scrollTop,e=N.scrollTop+N.offsetHeight;"horizontal"!==D&&"both"!==D||(I<z?N.scrollTo({left:I,behavior:i}):I+M.clientWidth>u&&N.scrollTo({left:I-N.offsetWidth+M.clientWidth,behavior:i})),"vertical"!==D&&"both"!==D||(t<g?N.scrollTo({top:t,behavior:i}):t+M.clientHeight>e&&N.scrollTo({top:t-N.offsetHeight+M.clientHeight,behavior:i}))}function DD(M){return M.charAt(0).toUpperCase()+M.slice(1)}function iD(M,N){return new Promise((D=>{M.addEventListener(N,(function i(j){j.target===M&&(M.removeEventListener(N,i),D())}))}))}function jD(M){const N=M.tagName.toLowerCase();return"-1"!==M.getAttribute("tabindex")&&(!M.hasAttribute("disabled")&&((!M.hasAttribute("aria-disabled")||"false"===M.getAttribute("aria-disabled"))&&(!("input"===N&&"radio"===M.getAttribute("type")&&!M.hasAttribute("checked"))&&(null!==M.offsetParent&&("hidden"!==window.getComputedStyle(M).visibility&&(!("audio"!==N&&"video"!==N||!M.hasAttribute("controls"))||(!!M.hasAttribute("tabindex")||(!(!M.hasAttribute("contenteditable")||"false"===M.getAttribute("contenteditable"))||["button","input","select","textarea","a","audio","video","summary"].includes(N)))))))))}function tD(M){const N=[];!function M(D){D instanceof HTMLElement&&(N.push(D),null!==D.shadowRoot&&"open"===D.shadowRoot.mode&&M(D.shadowRoot)),[...D.children].forEach((N=>M(N)))}(M);return{start:N.find((M=>jD(M)))??null,end:N.reverse().find((M=>jD(M)))??null}}let ID=[];class zD{constructor(M){this.tabDirection="forward",this.element=M,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){ID.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){ID=ID.filter((M=>M!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return ID[ID.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:M,end:N}=tD(this.element),D="forward"===this.tabDirection?M:N;"function"==typeof D?.focus&&D.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(M){"Tab"===M.key&&M.shiftKey&&(this.tabDirection="backward",requestAnimationFrame((()=>this.checkFocus())))}handleKeyUp(){this.tabDirection="forward"}}var uD=[z`
|
1895
1895
|
:host {
|
1896
1896
|
box-sizing: border-box;
|
1897
|
+
--nile-drawer-remove-icon-color:#000;
|
1897
1898
|
}
|
1898
1899
|
|
1899
1900
|
:host *,
|
@@ -2053,6 +2054,10 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2053
2054
|
display: none;
|
2054
2055
|
}
|
2055
2056
|
|
2057
|
+
.drawer__close:hover {
|
2058
|
+
cursor:pointer;
|
2059
|
+
}
|
2060
|
+
|
2056
2061
|
@media (forced-colors: active) {
|
2057
2062
|
.drawer__panel {
|
2058
2063
|
border: solid 1px hsl(0, 0%, 100%);
|
@@ -2063,7 +2068,12 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2063
2068
|
part="base"
|
2064
2069
|
class=${uN({drawer:!0,"drawer--open":this.open,"drawer--top":"top"===this.placement,"drawer--end":"end"===this.placement,"drawer--bottom":"bottom"===this.placement,"drawer--start":"start"===this.placement,"drawer--contained":this.contained,"drawer--fixed":!this.contained,"drawer--rtl":"rtl","drawer--has-footer":this.hasSlotController.test("footer")})}
|
2065
2070
|
>
|
2066
|
-
<div
|
2071
|
+
<div
|
2072
|
+
part="overlay"
|
2073
|
+
class="drawer__overlay"
|
2074
|
+
@click=${()=>this.requestClose("overlay")}
|
2075
|
+
tabindex="-1"
|
2076
|
+
></div>
|
2067
2077
|
|
2068
2078
|
<div
|
2069
2079
|
part="panel"
|
@@ -2079,19 +2089,21 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2079
2089
|
<header part="header" class="drawer__header">
|
2080
2090
|
<h2 part="title" class="drawer__title" id="title">
|
2081
2091
|
<!-- If there's no label, use an invisible character to prevent the header from collapsing -->
|
2082
|
-
<slot name="label">
|
2092
|
+
<slot name="label">
|
2093
|
+
${this.label.length>0?this.label:String.fromCharCode(65279)}
|
2094
|
+
</slot>
|
2083
2095
|
</h2>
|
2084
2096
|
<div part="header-actions" class="drawer__header-actions">
|
2085
2097
|
<slot name="header-actions"></slot>
|
2086
|
-
<nile-icon
|
2087
|
-
part="close-button"
|
2088
|
-
exportparts="base:close-button__base"
|
2098
|
+
<nile-icon
|
2089
2099
|
class="drawer__close"
|
2090
2100
|
name="close"
|
2091
|
-
label=
|
2092
|
-
|
2101
|
+
label="close"
|
2102
|
+
part="close-button"
|
2103
|
+
exportparts="base:close-button__base"
|
2104
|
+
color="var(--nile-drawer-remove-icon-color)"
|
2093
2105
|
@click=${()=>this.requestClose("close-button")}
|
2094
|
-
></nile-icon
|
2106
|
+
></nile-icon>
|
2095
2107
|
</div>
|
2096
2108
|
</header>
|
2097
2109
|
`}
|
@@ -2107,25 +2119,26 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2107
2119
|
:host {
|
2108
2120
|
display: inline-block;
|
2109
2121
|
}
|
2110
|
-
|
2122
|
+
|
2111
2123
|
:host(.full-width) {
|
2112
2124
|
width: 100%;
|
2113
2125
|
}
|
2114
|
-
|
2126
|
+
|
2115
2127
|
.checkbox {
|
2116
2128
|
position: relative;
|
2117
2129
|
display: inline-flex;
|
2118
|
-
align-items:
|
2130
|
+
align-items: top;
|
2119
2131
|
font-weight: 400;
|
2120
2132
|
color: var(--nile-colors-dark-900);
|
2121
2133
|
vertical-align: middle;
|
2122
2134
|
cursor: pointer;
|
2123
2135
|
}
|
2124
|
-
|
2125
|
-
.checkbox--
|
2126
|
-
|
2136
|
+
|
2137
|
+
.checkbox--medium {
|
2138
|
+
--toggle-size: var(--nile-type-scale-3);
|
2139
|
+
font-size: var(--nile-type-scale-3);
|
2127
2140
|
}
|
2128
|
-
|
2141
|
+
|
2129
2142
|
.checkbox__control {
|
2130
2143
|
flex: 0 0 auto;
|
2131
2144
|
position: relative;
|
@@ -2136,13 +2149,13 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2136
2149
|
height: var(--nile-type-scale-3);
|
2137
2150
|
border: solid 1px var(--nile-checkbox-color-border-standard);
|
2138
2151
|
background-color: var(--nile-checkbox-color-background-standard);
|
2139
|
-
border-radius:
|
2152
|
+
border-radius: 4px;
|
2140
2153
|
transition: var(--nile-transition-duration-default border-color),
|
2141
2154
|
var(--nile-transition-duration-default) background-color,
|
2142
2155
|
var(--nile-transition-duration-default) color,
|
2143
2156
|
var(--nile-transition-duration-default box-shadow);
|
2144
2157
|
}
|
2145
|
-
|
2158
|
+
|
2146
2159
|
.checkbox__input {
|
2147
2160
|
position: absolute;
|
2148
2161
|
opacity: 0;
|
@@ -2150,11 +2163,11 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2150
2163
|
margin: 0;
|
2151
2164
|
pointer-events: none;
|
2152
2165
|
}
|
2153
|
-
|
2166
|
+
|
2154
2167
|
/* svg {
|
2155
2168
|
display:none !important;
|
2156
2169
|
} */
|
2157
|
-
|
2170
|
+
|
2158
2171
|
/* Hover */
|
2159
2172
|
.checkbox:not(.checkbox--checked):not(.checkbox--disabled)
|
2160
2173
|
.checkbox__control:hover {
|
@@ -2162,7 +2175,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2162
2175
|
border: 1px solid var(--nile-checkbox-color-border-hover);
|
2163
2176
|
border-radius: 4px;
|
2164
2177
|
}
|
2165
|
-
|
2178
|
+
|
2166
2179
|
/* Focus */
|
2167
2180
|
.checkbox:not(.checkbox--checked):not(.checkbox--disabled)
|
2168
2181
|
.checkbox__input:focus-visible
|
@@ -2170,14 +2183,14 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2170
2183
|
outline: solid 3px hsl(198.6 88.7% 48.4% / 40%);
|
2171
2184
|
outline-offset: 1px;
|
2172
2185
|
}
|
2173
|
-
|
2186
|
+
|
2174
2187
|
/* Checked/indeterminate */
|
2175
2188
|
.checkbox--checked .checkbox__control,
|
2176
2189
|
.checkbox--indeterminate .checkbox__control {
|
2177
2190
|
border-color: var(--nile-checkbox-color-border-checked-standard);
|
2178
2191
|
background-color: var(--nile-checkbox-color-background-checked-standard);
|
2179
2192
|
}
|
2180
|
-
|
2193
|
+
|
2181
2194
|
/* Checked/indeterminate + hover */
|
2182
2195
|
.checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,
|
2183
2196
|
.checkbox.checkbox--indeterminate:not(.checkbox--disabled)
|
@@ -2185,7 +2198,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2185
2198
|
background: var(--nile-checkbox-color-background-checked-hover);
|
2186
2199
|
border: 1px solid var(--nile-checkbox-color-border-checked-hover);
|
2187
2200
|
}
|
2188
|
-
|
2201
|
+
|
2189
2202
|
/* Checked/indeterminate + focus */
|
2190
2203
|
.checkbox.checkbox--checked:not(.checkbox--disabled)
|
2191
2204
|
.checkbox__input:focus-visible
|
@@ -2196,121 +2209,100 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2196
2209
|
outline: solid 3px var(--nile-checkbox-color-outline-standard);
|
2197
2210
|
outline-offset: 1px;
|
2198
2211
|
}
|
2199
|
-
|
2212
|
+
|
2200
2213
|
/* Disabled */
|
2201
2214
|
.checkbox--disabled {
|
2202
2215
|
opacity: 0.3;
|
2203
2216
|
cursor: not-allowed;
|
2204
2217
|
}
|
2205
|
-
|
2218
|
+
|
2219
|
+
|
2206
2220
|
.checkbox__label {
|
2207
|
-
display:
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
margin-left: 8px;
|
2221
|
+
display: inline-block;
|
2222
|
+
line-height: 14px;
|
2223
|
+
font-size: 14px;
|
2224
|
+
margin-inline-start: 0.5em;
|
2212
2225
|
user-select: none;
|
2226
|
+
margin-top: 2px;
|
2213
2227
|
color: var(--nile-colors-dark-900);
|
2228
|
+
font-family: Colfax-regular;
|
2214
2229
|
font-style: normal;
|
2215
|
-
letter-spacing: 0.2px;
|
2216
|
-
box-sizing: border-box;
|
2217
|
-
}
|
2218
|
-
|
2219
|
-
.checkbox__icon__container{
|
2220
|
-
display:flex;
|
2221
|
-
align-items:center;
|
2222
|
-
}
|
2223
|
-
|
2224
|
-
.checkbox__label__text {
|
2225
|
-
display: block;
|
2226
|
-
font-size: 14px;
|
2227
|
-
font-weight: 500;
|
2228
|
-
color: #344054;
|
2229
|
-
}
|
2230
|
-
|
2231
|
-
.checkbox__sublabel__text {
|
2232
|
-
display: block;
|
2233
|
-
font-size: 14px;
|
2234
2230
|
font-weight: 400;
|
2235
|
-
|
2236
|
-
color: #475467;
|
2231
|
+
letter-spacing: 0.2px;
|
2237
2232
|
}
|
2238
|
-
|
2233
|
+
|
2239
2234
|
:host([required]) .checkbox__label::after {
|
2240
2235
|
content: '*';
|
2241
2236
|
margin-inline-start: -2px;
|
2242
2237
|
}
|
2243
|
-
|
2238
|
+
|
2244
2239
|
.checkbox__checked-icon {
|
2245
2240
|
--nile-svg-stroke: white;
|
2246
2241
|
}
|
2247
|
-
|
2242
|
+
|
2248
2243
|
.checkbox__indeterminate-icon {
|
2249
2244
|
--nile-svg-stroke: white;
|
2250
2245
|
}
|
2251
|
-
|
2246
|
+
|
2252
2247
|
.checkbox__helptext-icon {
|
2253
2248
|
float: right;
|
2254
2249
|
cursor: pointer;
|
2255
2250
|
margin-right: 12px;
|
2256
2251
|
}
|
2257
|
-
`;M.NileCheckbox=class extends kN{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.
|
2252
|
+
`;M.NileCheckbox=class extends kN{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.errorMessage="",this.showHelpText=!1,this.form="",this.required=!1}toggleHelpText(){this.showHelpText=!this.showHelpText}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(M){this.input.focus(M)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}updated(M){super.updated(M),M.has("helpText")&&this.updateHostClass()}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const M=!!this.helpText,N=!!this.errorMessage;return EM`
|
2258
2253
|
<label
|
2259
2254
|
part="base"
|
2260
|
-
class=${uN({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate})}
|
2255
|
+
class=${uN({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size})}
|
2261
2256
|
>
|
2262
|
-
<
|
2263
|
-
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2307
|
-
<div part="label" class="checkbox__label" style="${this.label||this.subLabel?"":"margin-left:0;"}">
|
2308
|
-
${this.label?EM`<span class="checkbox__label__text">${this.label}</span>`:""}
|
2309
|
-
${this.subLabel?EM`<span class="checkbox__sublabel__text">${this.subLabel}</span>`:""}
|
2257
|
+
<input
|
2258
|
+
class="checkbox__input"
|
2259
|
+
type="checkbox"
|
2260
|
+
title=${this.title}
|
2261
|
+
name=${this.name}
|
2262
|
+
value=${SN(this.value)}
|
2263
|
+
.indeterminate=${vN(this.indeterminate)}
|
2264
|
+
.checked=${vN(this.checked)}
|
2265
|
+
.disabled=${this.disabled}
|
2266
|
+
.required=${this.required}
|
2267
|
+
aria-checked=${this.checked?"true":"false"}
|
2268
|
+
@click=${this.handleClick}
|
2269
|
+
@input=${this.handleInput}
|
2270
|
+
@blur=${this.handleBlur}
|
2271
|
+
@focus=${this.handleFocus}
|
2272
|
+
/>
|
2273
|
+
|
2274
|
+
<span
|
2275
|
+
part="control${this.checked?" control--checked":""}${this.indeterminate?" control--indeterminate":""}"
|
2276
|
+
class="checkbox__control"
|
2277
|
+
>
|
2278
|
+
${this.checked?EM`
|
2279
|
+
<nile-icon
|
2280
|
+
part="checked-icon"
|
2281
|
+
class="checkbox__checked-icon"
|
2282
|
+
color="white"
|
2283
|
+
library="system"
|
2284
|
+
name="tick"
|
2285
|
+
size="12"
|
2286
|
+
></nile-icon>
|
2287
|
+
`:""}
|
2288
|
+
${!this.checked&&this.indeterminate?EM`
|
2289
|
+
<nile-icon
|
2290
|
+
part="indeterminate-icon"
|
2291
|
+
class="checkbox__indeterminate-icon"
|
2292
|
+
library="system"
|
2293
|
+
color="white"
|
2294
|
+
name="minus"
|
2295
|
+
size="12"
|
2296
|
+
></nile-icon>
|
2297
|
+
`:""}
|
2298
|
+
</span>
|
2299
|
+
|
2300
|
+
<div part="label" class="checkbox__label">
|
2301
|
+
${"boolean"==typeof this.label?"":this.label}
|
2310
2302
|
<slot></slot>
|
2311
2303
|
</div>
|
2312
2304
|
</label>
|
2313
|
-
|
2305
|
+
|
2314
2306
|
${M?EM`
|
2315
2307
|
<nile-tooltip content="${this.helpText}" placement="bottom">
|
2316
2308
|
<nile-icon
|
@@ -2318,9 +2310,14 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2318
2310
|
class="checkbox__helptext-icon"
|
2319
2311
|
></nile-icon>
|
2320
2312
|
</nile-tooltip>
|
2321
|
-
`:
|
2322
|
-
|
2323
|
-
|
2313
|
+
`:""}
|
2314
|
+
|
2315
|
+
${N?EM`
|
2316
|
+
<nile-form-error-message
|
2317
|
+
>${this.errorMessage}</nile-form-error-message
|
2318
|
+
>
|
2319
|
+
`:""}
|
2320
|
+
`}},M.NileCheckbox.styles=gD,N([KM('input[type="checkbox"]')],M.NileCheckbox.prototype,"input",void 0),N([_M()],M.NileCheckbox.prototype,"hasFocus",void 0),N([$M()],M.NileCheckbox.prototype,"title",void 0),N([$M()],M.NileCheckbox.prototype,"name",void 0),N([$M()],M.NileCheckbox.prototype,"value",void 0),N([$M({reflect:!0})],M.NileCheckbox.prototype,"size",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"disabled",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"checked",void 0),N([$M({type:String,reflect:!0})],M.NileCheckbox.prototype,"label",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"indeterminate",void 0),N([UN("checked")],M.NileCheckbox.prototype,"defaultChecked",void 0),N([$M({attribute:"help-text",reflect:!0})],M.NileCheckbox.prototype,"helpText",void 0),N([$M({attribute:"error-message",reflect:!0})],M.NileCheckbox.prototype,"errorMessage",void 0),N([$M({type:Boolean})],M.NileCheckbox.prototype,"showHelpText",void 0),N([$M({reflect:!0})],M.NileCheckbox.prototype,"form",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"required",void 0),N([hN(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],M.NileCheckbox.prototype,"handleStateChange",null),M.NileCheckbox=N([FM("nile-checkbox")],M.NileCheckbox);const eD=z`
|
2324
2321
|
:host {
|
2325
2322
|
display: block;
|
2326
2323
|
}
|
@@ -3527,21 +3524,22 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
3527
3524
|
`,di=z`
|
3528
3525
|
:host {
|
3529
3526
|
display: inline-block;
|
3530
|
-
--nile-remove-icon-color: var(--nile-colors-blue-500);
|
3531
3527
|
}
|
3532
3528
|
|
3533
3529
|
.tag {
|
3534
3530
|
display: flex;
|
3535
3531
|
align-items: center;
|
3536
|
-
|
3537
|
-
|
3538
|
-
gap: 3px;
|
3532
|
+
border: solid 2px;
|
3533
|
+
line-height: 1;
|
3539
3534
|
white-space: nowrap;
|
3540
3535
|
user-select: none;
|
3541
3536
|
border-radius: 4px;
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3537
|
+
gap: 6px;
|
3538
|
+
}
|
3539
|
+
|
3540
|
+
.tag__remove::part(base) {
|
3541
|
+
color: inherit;
|
3542
|
+
padding: 0;
|
3545
3543
|
}
|
3546
3544
|
|
3547
3545
|
/*
|
@@ -3549,120 +3547,101 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
3549
3547
|
*/
|
3550
3548
|
|
3551
3549
|
.tag--primary {
|
3552
|
-
background: #
|
3553
|
-
color: #
|
3554
|
-
|
3550
|
+
background: #005EA6;
|
3551
|
+
border-color: #005EA6;
|
3552
|
+
border: 2px solid #005EA6;
|
3553
|
+
color: #FFF;
|
3555
3554
|
}
|
3556
3555
|
|
3557
3556
|
.tag--primary:hover {
|
3558
|
-
|
3557
|
+
border: 2px solid rgba(0, 94, 166, 0.50);
|
3559
3558
|
}
|
3560
3559
|
|
3561
|
-
.tag--primary:active > nile-icon {
|
3560
|
+
.tag--primary:active > nile-icon-button {
|
3562
3561
|
color: hsl(200.4 98% 39.4%);
|
3563
3562
|
}
|
3564
3563
|
|
3565
3564
|
.tag--success {
|
3566
|
-
background: #
|
3565
|
+
background: #A5F3E1;
|
3566
|
+
border: 2px solid #A5F3E1;
|
3567
3567
|
color: #000;
|
3568
|
-
--nile-remove-icon-color: var(--nile-colors-green-500);
|
3569
3568
|
}
|
3570
3569
|
|
3571
3570
|
.tag--success:hover {
|
3572
|
-
|
3571
|
+
border: 2px solid #43E5C0;
|
3573
3572
|
}
|
3574
3573
|
|
3575
|
-
.tag--success:active > nile-icon {
|
3574
|
+
.tag--success:active > nile-icon-button {
|
3576
3575
|
color: hsl(142.1 76.2% 36.3%);
|
3577
3576
|
}
|
3578
3577
|
|
3579
3578
|
.tag--normal {
|
3580
|
-
background: #
|
3579
|
+
background: #E5E9EB;
|
3580
|
+
border: 2px solid #E5E9EB;
|
3581
3581
|
color: #000;
|
3582
|
-
--nile-remove-icon-color: var(--nile-colors-dark-500);
|
3583
3582
|
}
|
3584
3583
|
|
3585
3584
|
.tag--normal:hover {
|
3586
|
-
|
3585
|
+
border: 2px solid #C7CED4;
|
3587
3586
|
}
|
3588
3587
|
|
3589
|
-
|
3588
|
+
|
3589
|
+
.tag--normal:active > nile-icon-button {
|
3590
3590
|
color: hsl(240 5.2% 33.9%);
|
3591
3591
|
}
|
3592
3592
|
|
3593
3593
|
.tag--warning {
|
3594
|
-
background: #
|
3594
|
+
background: #F3E0A5;
|
3595
|
+
border: 2px solid #F3E0A5;
|
3595
3596
|
color: #000;
|
3596
|
-
--nile-remove-icon-color: var(--nile-colors-yellow-500);
|
3597
3597
|
}
|
3598
3598
|
|
3599
3599
|
.tag--warning:hover {
|
3600
|
-
|
3600
|
+
border: 2px solid #E5BF43;
|
3601
3601
|
}
|
3602
3602
|
|
3603
|
-
.tag--warning:active > nile-icon {
|
3603
|
+
.tag--warning:active > nile-icon-button {
|
3604
3604
|
color: hsl(32.1 94.6% 43.7%);
|
3605
3605
|
}
|
3606
3606
|
|
3607
|
+
|
3607
3608
|
.tag--error {
|
3608
|
-
background: #
|
3609
|
+
background: #F3A5AA;
|
3610
|
+
border: 2px solid #F3A5AA;
|
3609
3611
|
color: #000;
|
3610
|
-
--nile-remove-icon-color: var(--nile-colors-red-500);
|
3611
3612
|
}
|
3612
3613
|
|
3613
3614
|
.tag--error:hover {
|
3614
|
-
|
3615
|
+
border: 2px solid #E5434D;
|
3615
3616
|
}
|
3616
3617
|
|
3617
|
-
.tag--error:active > nile-icon {
|
3618
|
+
.tag--error:active > nile-icon-button {
|
3618
3619
|
color: hsl(0 72.2% 50.6%);
|
3619
3620
|
}
|
3620
3621
|
|
3621
3622
|
.tag--info {
|
3622
|
-
background: #
|
3623
|
+
background: #A5D3F3;
|
3624
|
+
border: 2px solid #A5D3F3;
|
3623
3625
|
color: #000000;
|
3624
|
-
--nile-remove-icon-color: var(--nile-colors-blue-500);
|
3625
3626
|
}
|
3626
3627
|
|
3627
3628
|
.tag--info:hover {
|
3628
|
-
|
3629
|
+
border: 2px solid #42A3E5;
|
3629
3630
|
}
|
3630
3631
|
|
3631
|
-
.tag--info:active > nile-icon {
|
3632
|
+
.tag--info:active > nile-icon-button {
|
3632
3633
|
color: hsl(0 72.2% 50.6%);
|
3633
3634
|
}
|
3634
3635
|
|
3635
|
-
.tag--gray {
|
3636
|
-
background: var(--nile-tag-gray-background-color);
|
3637
|
-
border: 1px solid var(--nile-colors-gray-light-mode-300);
|
3638
|
-
color: var(--nile-tag-gray-color);
|
3639
|
-
--nile-remove-icon-color: var(--nile-tag-gray-x-color);
|
3640
|
-
}
|
3641
|
-
|
3642
|
-
.tag--gray:hover {
|
3643
|
-
background-color: var(--nile-tag-gray-hover-background-color);
|
3644
|
-
}
|
3645
|
-
|
3646
|
-
/* .tag--gray:active > nile-icon {
|
3647
|
-
color: #101828;
|
3648
|
-
} */
|
3649
|
-
|
3650
|
-
.tag--small {
|
3651
|
-
height: 24px;
|
3652
|
-
padding: 3px 8px;
|
3653
|
-
font-size: 12px;
|
3654
|
-
font-style: normal;
|
3655
|
-
font-weight: 500;
|
3656
|
-
line-height: 18px;
|
3657
|
-
}
|
3658
3636
|
|
3659
3637
|
.tag--medium {
|
3660
|
-
height: 24px;
|
3661
|
-
padding: 2px 9px;
|
3662
3638
|
font-size: 14px;
|
3663
|
-
|
3664
|
-
|
3665
|
-
|
3639
|
+
height: 26px;
|
3640
|
+
padding: 0 0.75rem;
|
3641
|
+
}
|
3642
|
+
|
3643
|
+
.tag__remove {
|
3644
|
+
margin-inline-start: 0.5rem;
|
3666
3645
|
}
|
3667
3646
|
|
3668
3647
|
/*
|
@@ -3673,59 +3652,35 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
3673
3652
|
border-radius: 9999px;
|
3674
3653
|
}
|
3675
3654
|
|
3676
|
-
.
|
3677
|
-
|
3678
|
-
|
3679
|
-
|
3680
|
-
.tag--medium .tag__remove-wrapper {
|
3681
|
-
display: inline-flex;
|
3682
|
-
justify-content: centre;
|
3683
|
-
box-sizing: border-box;
|
3684
|
-
height: 16px;
|
3685
|
-
width: 16px;
|
3686
|
-
padding: 2px;
|
3687
|
-
}
|
3688
|
-
|
3689
|
-
.tag--small .tag__remove-wrapper {
|
3690
|
-
display: inline-flex;
|
3691
|
-
justify-content: centre;
|
3692
|
-
box-sizing: border-box;
|
3693
|
-
height: 14px;
|
3694
|
-
width: 14px;
|
3695
|
-
padding: 2px;
|
3696
|
-
}
|
3655
|
+
.tag__prefix {
|
3656
|
+
padding: 3px 6px;
|
3657
|
+
}
|
3697
3658
|
|
3698
|
-
|
3699
|
-
|
3700
|
-
|
3659
|
+
.tag__content {
|
3660
|
+
font-size: 14px;
|
3661
|
+
}
|
3701
3662
|
|
3702
|
-
|
3703
|
-
cursor: pointer;
|
3704
|
-
--nile-remove-icon-color: #101828;
|
3705
|
-
color: red;
|
3706
|
-
}
|
3707
|
-
`;M.NileTag=class extends kN{constructor(){super(...arguments),this.variant="normal",this.size="medium",this.pill=!1,this.removable=!1}handleRemoveClick(){this.emit("nile-remove")}render(){return EM`
|
3663
|
+
`;M.NileTag=class extends kN{constructor(){super(...arguments),this.variant="normal",this.size="medium",this.pill=!1,this.removable=!1}handleRemoveClick(){this.emit("nile-remove")}getCloseButtonColor(){switch(this.variant){case"primary":case"info":return"--nile-colors-blue-500";case"success":return"--nile-colors-green-500";case"normal":default:return"--nile-colors-dark-500";case"warning":return"--nile-colors-yellow-500";case"error":return"--nile-colors-red-500"}}render(){const M=this.getCloseButtonColor();return EM`
|
3708
3664
|
<span
|
3709
3665
|
part="base"
|
3710
|
-
class=${uN({tag:!0,"tag--primary":"primary"===this.variant,"tag--success":"success"===this.variant,"tag--normal":"normal"===this.variant,"tag--warning":"warning"===this.variant,"tag--error":"error"===this.variant,"tag--info":"info"===this.variant,"tag--
|
3666
|
+
class=${uN({tag:!0,"tag--primary":"primary"===this.variant,"tag--success":"success"===this.variant,"tag--normal":"normal"===this.variant,"tag--warning":"warning"===this.variant,"tag--error":"error"===this.variant,"tag--info":"info"===this.variant,"tag--small":"small"===this.size,"tag--medium":"medium"===this.size,"tag--large":"large"===this.size,"tag--pill":this.pill,"tag--removable":this.removable})}
|
3711
3667
|
>
|
3712
3668
|
<slot name="prefix" part="prefix" class="tag__prefix"></slot>
|
3713
3669
|
|
3714
3670
|
<slot part="content" class="tag__content"></slot>
|
3715
3671
|
|
3716
3672
|
${this.removable?EM`
|
3717
|
-
|
3718
|
-
|
3719
|
-
|
3720
|
-
|
3721
|
-
|
3722
|
-
|
3723
|
-
|
3724
|
-
|
3725
|
-
|
3726
|
-
|
3727
|
-
|
3728
|
-
</span>
|
3673
|
+
<nile-icon-button
|
3674
|
+
part="remove-button"
|
3675
|
+
exportparts="base:remove-button__base"
|
3676
|
+
name="close"
|
3677
|
+
library="system"
|
3678
|
+
label="remove"
|
3679
|
+
class="tag__remove"
|
3680
|
+
@click=${this.handleRemoveClick}
|
3681
|
+
tabindex="-1"
|
3682
|
+
color="var(${M})"
|
3683
|
+
></nile-icon-button>
|
3729
3684
|
`:""}
|
3730
3685
|
</span>
|
3731
3686
|
`}},M.NileTag.styles=di,N([$M({reflect:!0})],M.NileTag.prototype,"variant",void 0),N([$M({reflect:!0})],M.NileTag.prototype,"size",void 0),N([$M({type:Boolean,reflect:!0})],M.NileTag.prototype,"pill",void 0),N([$M({type:Boolean})],M.NileTag.prototype,"removable",void 0),M.NileTag=N([FM("nile-tag")],M.NileTag),M.NileSelect=class extends kN{constructor(){super(...arguments),this.formControlController=new nN(this,{assumeInteractionOn:["nile-blur","nile-input"]}),this.hasSlotController=new oN(this,"help-text","label"),this.typeToSelectString="",this.hasFocus=!1,this.displayLabel="",this.selectedOptions=[],this.oldValue="",this.name="",this.value="",this.defaultValue="",this.size="medium",this.placeholder="Select...",this.searchValue="",this.searchEnabled=!1,this.blockValueChange=!1,this.disableLocalSearch=!1,this.optionsLoading=!1,this.noWidthSync=!1,this.multiple=!1,this.helpText="",this.errorMessage="",this.warning=!1,this.error=!1,this.success=!1,this.maxOptionsVisible=3,this.disabled=!1,this.clearable=!1,this.open=!1,this.hoist=!1,this.filled=!1,this.pill=!1,this.label="",this.placement="bottom",this.form="",this.required=!1,this.showSelected=!1,this.oldMaxOptionsVisible=1,this.showNoResults=!1,this.noResultsMessage="No results found"}get validity(){return this.valueInput?.validity}get validationMessage(){return this.valueInput?.validationMessage}connectedCallback(){super.connectedCallback(),this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.open=!1,this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("nile-focus",{value:this.value,name:this.name})}handleBlur(){this.hasFocus=!1,this.emit("nile-blur",{value:this.value,name:this.name})}handleDocumentFocusIn(M){const N=M.composedPath();this&&!N.includes(this)&&this.hide()}handleFooterClick(M){M.stopPropagation(),M.preventDefault()}toggleShowSelected(M){if(M.stopPropagation(),M.preventDefault(),0===this.selectedOptions?.length)return;this.showSelected=!this.showSelected;this.getAllOptions().forEach((M=>{M.selected||(M.hidden=this.showSelected)})),this.requestUpdate()}unSlectAll(){this.showSelected=!1;this.getAllOptions().forEach((M=>{M.selected=!1,M.hidden=!1})),this.value="",this.selectionChanged(),this.emit("nile-change",{value:this.value,name:this.name})}handleDocumentKeyDown(M){const N=M.target,D=null!==N.closest(".select__clear"),i=null!==N.closest("nile-icon-button");if(!D&&!i){if("Escape"===M.key&&this.open&&(M.preventDefault(),M.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===M.key||" "===M.key&&""===this.typeToSelectString)return M.preventDefault(),M.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("nile-input",{value:this.value,name:this.name}),this.emit("nile-change",{value:this.value,name:this.name})})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(M.key)){const N=this.getAllOptions(),D=N.indexOf(this.currentOption);let i=Math.max(0,D);if(M.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===M.key?(i=D+1,i>N.length-1&&(i=0)):"ArrowUp"===M.key?(i=D-1,i<0&&(i=N.length-1)):"Home"===M.key?i=0:"End"===M.key&&(i=N.length-1),this.setCurrentOption(N[i])}if(1===M.key.length||"Backspace"===M.key){const N=this.getAllOptions();if(M.metaKey||M.ctrlKey||M.altKey)return;if(!this.open){if("Backspace"===M.key)return;this.show()}M.stopPropagation(),M.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===M.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=M.key.toLowerCase();for(const M of N){if(M.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(M);break}}}}}handleDocumentMouseDown(M){const N=M.composedPath();this&&!N.includes(this)&&this.hide()}handleLabelClick(){this.displayInput.focus(),this.hide()}handleComboboxMouseDown(M){const N=M.composedPath().some((M=>M instanceof Element&&"nile-icon-button"===M.tagName.toLowerCase()));this.disabled||N||(M.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(M){M.stopPropagation(),this.handleDocumentKeyDown(M)}handleClearClick(M){M.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("nile-clear",{value:this.value,name:this.name}),this.emit("nile-input",{value:this.value,name:this.name}),this.emit("nile-change",{value:this.value,name:this.name})})))}handleClearMouseDown(M){M.stopPropagation(),M.preventDefault()}handleOptionClick(M){const N=M.target.closest("nile-option");if(this.blockValueChange&&N)return this.emit("nile-block-change",{value:N?.value,name:this.name}),void this.hide();const D=this.value;if(this.oldValue=D,N&&!N.disabled&&(this.multiple?this.toggleOptionSelection(N):this.setSelectedOptions(N),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==D&&this.updateComplete.then((()=>{this.emit("nile-input",{value:this.value,name:this.name}),this.emit("nile-change",{value:this.value,name:this.name})})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}))),this.showSelected){this.getAllOptions().forEach((M=>{M.selected||(M.hidden=this.showSelected)})),this.requestUpdate()}}handleDefaultSlotChange(){const M=this.getAllOptions(),N=Array.isArray(this.value)?this.value:[this.value],D=[];customElements.get("nile-option")?(M.forEach((M=>D.push(M.value))),this.setSelectedOptions(M.filter((M=>N.map(String).includes(M.value))))):customElements.whenDefined("nile-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(M,N){if(M.stopPropagation(),!this.disabled){this.toggleOptionSelection(N,!1);this.getAllOptions().forEach((M=>{M.selected||(M.hidden=this.showSelected)})),this.updateComplete.then((()=>{this.emit("nile-input",{value:this.value,name:this.name}),this.emit("nile-change",{value:this.value,name:this.name})}))}}getAllOptions(){const M=[...this.querySelectorAll("nile-option")];return this.multiple&&this.oldValue?.length>0&&M.sort(((M,N)=>{let D=this.oldValue.indexOf(M.value),i=this.oldValue.indexOf(N.value);return-1===D&&(D=1/0),-1===i&&(i=1/0),D<i?-1:D>i?1:0})),M}getOptionPrefix(M){const N=M.shadowRoot?.querySelector('slot[name="prefix"]');if(!N)return"";const D=N.assignedNodes(),i=[];return D.forEach((M=>{M instanceof HTMLElement?i.push(M.outerHTML):M.nodeType===Node.TEXT_NODE&&i.push(M.textContent||"")})),i.join("")}getFirstOption(){return this.querySelector("nile-option")}setCurrentOption(M){this.getAllOptions().forEach((M=>{M.current=!1,M.tabIndex=-1})),M&&(this.currentOption=M,M.current=!0,M.tabIndex=0,M.focus())}setSelectedOptions(M){const N=this.getAllOptions(),D=Array.isArray(M)?M:[M];N.forEach((M=>M.selected=!1)),D.length&&D.forEach((M=>M.selected=!0)),this.selectionChanged()}toggleOptionSelection(M,N){M.selected=!0===N||!1===N?N:!M.selected,this.selectionChanged()}selectionChanged(){if(this.selectedOptions=this.getAllOptions().filter((M=>M.selected)),this.multiple){if(this.value=this.selectedOptions.map((M=>M.value)),this.placeholder&&0===this.value.length?this.displayLabel="":this.displayLabel=this.selectedOptions.length+" selected",0===this.selectedOptions.length){this.showSelected=!1;this.getAllOptions().forEach((M=>{M.selected||(M.hidden=this.showSelected)})),this.requestUpdate()}}else this.value=this.selectedOptions[0]?.value??this.value,this.displayLabel=this.selectedOptions[0]?.getTextLabel()?this.selectedOptions[0].getTextLabel():this.value??"";this.updateComplete.then((()=>{this.formControlController.updateValidity()})),this.calculateTotalWidthOfTags()}handleSearchFocus(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleSearchBlur(){document.addEventListener("keydown",this.handleDocumentKeyDown)}handleSearchChange(M){if(this.searchValue=M.detail.value,!this.disableLocalSearch){0===this.filterOptions(this.searchValue).length?this.showNoResults=!0:this.showNoResults=!1}}filterOptions(M){const N=this.getAllOptions(),D=M.toLowerCase();let i=[];return N.forEach((M=>{const N=M.getTextLabel().toLowerCase(),j=(M.value||"").toLowerCase();N.includes(D)||j.includes(D)?(M.hidden=!1,i.push(M)):M.hidden=!0})),i}handleInvalid(M){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(M)}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}handleValueChange(){const M=this.getAllOptions(),N=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(M.filter((M=>N.includes(M.value))))}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("nile-show",{value:this.value,name:this.name}),this.addOpenListeners(),this.showNoResults=!this.getAllOptions()?.length,await JN(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:M,options:N}=_N(this,"select.show",{dir:"ltr"});await PN(this.popup.popup,M,N),this.currentOption&&ND(this.currentOption,this.listbox,"vertical","auto"),this.emit("nile-after-show",{value:this.value,name:this.name})}else{this.emit("nile-hide",{value:this.value,name:this.name}),this.searchValue="",this.filterOptions(this.searchValue),this.removeOpenListeners(),await JN(this);const{keyframes:M,options:N}=_N(this,"select.hide",{dir:"ltr"});await PN(this.popup.popup,M,N),this.listbox.hidden=!0,this.popup.active=!1,this.emit("nile-after-hide",{value:this.value,name:this.name})}}async show(){if(!this.open&&!this.disabled)return this.open=!0,iD(this,"nile-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,iD(this,"nile-after-hide");this.open=!1}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.valueInput.reportValidity()}setCustomValidity(M){this.valueInput.setCustomValidity(M),this.formControlController.updateValidity()}focus(M){this.displayInput.focus(M)}blur(){this.displayInput.blur()}onInputChange(M){M.stopPropagation()}calculateWidthOfSelectTagsDiv(){if(this.shadowRoot){const M=this.shadowRoot.querySelector("div.select__tags");if(M instanceof HTMLElement){return M.offsetWidth-70}}}calculateTotalWidthOfTags(){this.maxOptionsVisible!==1/0&&(this.oldMaxOptionsVisible=this.maxOptionsVisible),this.maxOptionsVisible=1/0,setTimeout((()=>{let M=[];if(this.shadowRoot){this.shadowRoot.querySelectorAll("nile-tag").forEach((N=>{N instanceof HTMLElement&&M.push(N.offsetWidth)}))}if(this.value.length!==M.length)return;const N=this.calculateWidthOfSelectTagsDiv();if(!N)return;let D=0,i=0;for(let j=0;j<M.length;j++)if(D+=M[j],D>N){i=j;break}this.maxOptionsVisible=i}),1)}render(){const M=this.hasSlotController.test("label");this.hasSlotController.test("help-text");const N=this.hasSlotController.test("label-suffix"),D=this.hasSlotController.test("custom-select"),i=!!this.label||!!M,j=this.clearable&&!this.disabled&&this.value.length>0,t=this.placeholder&&0===this.value.length,I=!!this.helpText,z=!!this.errorMessage,u=this.selectedOptions[0]?this.getOptionPrefix(this.selectedOptions[0]):"";return EM`
|
@@ -5087,6 +5042,19 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
5087
5042
|
gap: 4px 7px;
|
5088
5043
|
}
|
5089
5044
|
|
5045
|
+
.day-names {
|
5046
|
+
flex-wrap: nowrap;
|
5047
|
+
}
|
5048
|
+
|
5049
|
+
|
5050
|
+
@media not all and (min-resolution: .001dpcm) {
|
5051
|
+
@supports (-webkit-appearance:none)
|
5052
|
+
{ .day-names, .days {
|
5053
|
+
column-gap: 6px;
|
5054
|
+
}
|
5055
|
+
}
|
5056
|
+
}
|
5057
|
+
|
5090
5058
|
.days {
|
5091
5059
|
height: auto;
|
5092
5060
|
padding: 0 12px 12px 12px;
|
@@ -7210,7 +7178,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
7210
7178
|
flex-direction: column;
|
7211
7179
|
justify-items: strecth;
|
7212
7180
|
background-color: var(--nile-colors-white-base);
|
7213
|
-
|
7181
|
+
outline: solid var(--border-width) var(--border-color);
|
7214
7182
|
border-radius: var(--border-radius);
|
7215
7183
|
min-width: 273px;
|
7216
7184
|
max-width: 350px;
|
@@ -7253,7 +7221,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
7253
7221
|
.card:hover {
|
7254
7222
|
box-shadow: 0px 4px 8px -2px rgba(16, 24, 40, 0.1),
|
7255
7223
|
0px 2px 4px -2px rgba(16, 24, 40, 0.06);
|
7256
|
-
|
7224
|
+
outline: solid 1px var(--border-color);
|
7257
7225
|
}
|
7258
7226
|
`;M.NileCard=class extends kN{constructor(){super(...arguments),this.hasSlotController=new oN(this,"footer")}render(){return EM`
|
7259
7227
|
<div
|