@aquera/nile-elements 1.5.6 → 1.5.7
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 +6 -0
- package/dist/index.js +110 -31
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +4 -2
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js +1 -1
- package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.css.esm.js +7 -3
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- 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 +7 -0
- package/dist/nile-calendar/nile-calendar.esm.js +6 -5
- package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.css.esm.js +1 -0
- package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +3 -0
- package/dist/nile-code-editor/nile-code-editor.esm.js +1 -0
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +8 -2
- package/dist/nile-icon/icons/svg/close.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/close.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/close.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.cjs.js +1 -1
- package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.css.esm.js +11 -1
- package/dist/nile-input/nile-input.esm.js +2 -0
- package/dist/nile-link/nile-link.css.cjs.js +1 -1
- package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
- package/dist/nile-link/nile-link.css.esm.js +5 -3
- package/dist/nile-radio/nile-radio.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.cjs.js.map +1 -1
- package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
- package/dist/nile-radio/nile-radio.css.esm.js +2 -2
- package/dist/nile-radio/nile-radio.esm.js +2 -2
- package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +6 -0
- package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.cjs.js +1 -1
- package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.esm.js +21 -5
- package/dist/nile-select/nile-select.esm.js +6 -6
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +4 -3
- package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.css.esm.js +9 -2
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +3 -3
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +13 -3
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +5 -5
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +2 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-button/nile-button.css.js +7 -3
- package/dist/src/nile-button/nile-button.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +7 -0
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +6 -5
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.css.js +1 -0
- package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.css.js +3 -0
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.js +1 -0
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.test.js +6 -6
- package/dist/src/nile-detail/nile-detail.test.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js +6 -0
- package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/close.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/close.js +1 -1
- package/dist/src/nile-icon/icons/svg/close.js.map +1 -1
- package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js +1 -1
- package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js +5 -5
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.js.map +1 -1
- package/dist/src/nile-input/nile-input.css.js +11 -1
- package/dist/src/nile-input/nile-input.css.js.map +1 -1
- package/dist/src/nile-input/nile-input.js +2 -0
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-link/nile-link.css.js +3 -1
- package/dist/src/nile-link/nile-link.css.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.css.js +2 -2
- package/dist/src/nile-radio/nile-radio.css.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.js +15 -1
- package/dist/src/nile-radio/nile-radio.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.js +8 -0
- package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +6 -0
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +8 -3
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
- package/dist/src/nile-select/nile-select.css.js +21 -5
- package/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.js +2 -2
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.css.js +9 -2
- package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js +13 -3
- package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.js +2 -2
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-auto-complete/nile-auto-complete.css.ts +2 -0
- package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
- package/src/nile-button/nile-button.css.ts +7 -3
- package/src/nile-calendar/nile-calendar.css.ts +7 -0
- package/src/nile-calendar/nile-calendar.ts +6 -5
- package/src/nile-chip/nile-chip.css.ts +1 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +3 -0
- package/src/nile-code-editor/nile-code-editor.ts +1 -0
- package/src/nile-detail/nile-detail.test.ts +6 -6
- package/src/nile-filter-chip/nile-filter-chip.css.ts +6 -0
- package/src/nile-icon/icons/svg/close.ts +1 -1
- package/src/nile-inline-sidebar-group/nile-inline-sidebar-group.test.ts +1 -1
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.test.ts +5 -5
- package/src/nile-input/nile-input.css.ts +11 -1
- package/src/nile-input/nile-input.ts +2 -0
- package/src/nile-link/nile-link.css.ts +3 -1
- package/src/nile-radio/nile-radio.css.ts +2 -2
- package/src/nile-radio/nile-radio.ts +17 -3
- package/src/nile-radio-group/nile-radio-group.ts +6 -0
- package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +6 -0
- package/src/nile-rich-text-editor/nile-rich-text-editor.ts +8 -3
- package/src/nile-select/nile-select.css.ts +21 -5
- package/src/nile-select/nile-select.ts +2 -2
- package/src/nile-slide-toggle/nile-slide-toggle.ts +1 -0
- package/src/nile-textarea/nile-textarea.css.ts +9 -2
- package/src/nile-virtual-select/nile-virtual-select.css.ts +13 -3
- package/src/nile-virtual-select/nile-virtual-select.ts +2 -2
- package/web-test-runner.config.mjs +6 -3
package/package.json
CHANGED
|
@@ -231,7 +231,7 @@ export class NileAutoComplete extends NileElement {
|
|
|
231
231
|
? html`
|
|
232
232
|
<label class="nile-auto-complete__label">${this.label}</label>
|
|
233
233
|
`: nothing}
|
|
234
|
-
<nile-dropdown class="nile-dropdown--input" ?open=${this.isDropdownOpen} ?stay-open-on-select=${this.noDropdownClose} noOpenOnCLick exportparts="input, base">
|
|
234
|
+
<nile-dropdown ?disabled=${this.disabled} class="nile-dropdown--input" ?open=${this.isDropdownOpen} ?stay-open-on-select=${this.noDropdownClose} noOpenOnCLick exportparts="input, base">
|
|
235
235
|
<nile-input class="nile-auto-complete--input"
|
|
236
236
|
?no-border=${this.noBorder}
|
|
237
237
|
?no-outline=${this.noOutline}
|
|
@@ -124,6 +124,8 @@ export const styles = css`
|
|
|
124
124
|
cursor: not-allowed;
|
|
125
125
|
color: var(--nile-colors-white-base, var(--ng-colors-border-neutral));
|
|
126
126
|
box-shadow: none;
|
|
127
|
+
border-width: var(--nile-border-width-1, var(--ng-border-width-1));
|
|
128
|
+
border-style: var(--nile-border-style-solid, var(--ng-border-style-solid));
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
.button--standard.button--primary.button--disabled:hover,
|
|
@@ -152,7 +154,7 @@ export const styles = css`
|
|
|
152
154
|
|
|
153
155
|
.button--standard.button--secondary:hover:not(.button--disabled) {
|
|
154
156
|
background-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-primary-hover));
|
|
155
|
-
border-color: var(--nile-colors-neutral-
|
|
157
|
+
border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-primary));
|
|
156
158
|
color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-hover));
|
|
157
159
|
}
|
|
158
160
|
|
|
@@ -167,6 +169,8 @@ export const styles = css`
|
|
|
167
169
|
border-color: var(--nile-colors-neutral-400, var(--ng-colors-border-disabled-subtle));
|
|
168
170
|
color: var(--nile-colors-neutral-700, var(--ng-colors-fg-disabled));
|
|
169
171
|
cursor: not-allowed;
|
|
172
|
+
border-width: var(--nile-border-width-1, var(--ng-border-width-1));
|
|
173
|
+
border-style: var(--nile-border-style-solid, var(--ng-border-style-solid));
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
.button--standard.button--secondary.button--disabled:hover,
|
|
@@ -229,13 +233,13 @@ export const styles = css`
|
|
|
229
233
|
|
|
230
234
|
.button--standard.button--ghost:hover:not(.button--disabled) {
|
|
231
235
|
background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-primary-hover));
|
|
232
|
-
border-color: var(--nile-
|
|
236
|
+
border-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-primary));
|
|
233
237
|
color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-hover));
|
|
234
238
|
}
|
|
235
239
|
|
|
236
240
|
.button--standard.button--ghost:active:not(.button--disabled) {
|
|
237
241
|
background-color: var(--nile-colors-neutral-400, var(--ng-colors-bg-primary));
|
|
238
|
-
border-color: var(--nile-
|
|
242
|
+
border-color: var(--nile-colors-neutral-700, var(--ng-colors-bg-primary));
|
|
239
243
|
color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));
|
|
240
244
|
}
|
|
241
245
|
|
|
@@ -327,6 +327,11 @@ export const styles = css`
|
|
|
327
327
|
flex-direction: column;
|
|
328
328
|
gap: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
329
329
|
}
|
|
330
|
+
:host([disabled]) .unit-container {
|
|
331
|
+
user-select: none;
|
|
332
|
+
-webkit-user-select: none;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
}
|
|
330
335
|
|
|
331
336
|
.unit-group {
|
|
332
337
|
display: flex;
|
|
@@ -600,6 +605,8 @@ export const styles = css`
|
|
|
600
605
|
|
|
601
606
|
:host([disabled]) .calendar-container {
|
|
602
607
|
background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
|
|
608
|
+
user-select: none;
|
|
609
|
+
-webkit-user-select: none;
|
|
603
610
|
}
|
|
604
611
|
|
|
605
612
|
:host([disabled]) .day_name {
|
|
@@ -278,8 +278,8 @@ private handleEndDateInput(event: CustomEvent): void {
|
|
|
278
278
|
})}>
|
|
279
279
|
<div class="calendar-switcher" part="calendar-switcher">
|
|
280
280
|
<nile-tab-group centered @nile-tab-show="${this.onTypeChange}" value="${this.type}">
|
|
281
|
-
<nile-tab slot="nav" panel="absolute" tabindex="0">Absolute</nile-tab>
|
|
282
|
-
<nile-tab slot="nav" panel="relative" tabindex="0">Relative</nile-tab>
|
|
281
|
+
<nile-tab slot="nav" panel="absolute" tabindex="${this.disabled ? '-1' : '0'}">Absolute</nile-tab>
|
|
282
|
+
<nile-tab slot="nav" panel="relative" tabindex="${this.disabled ? '-1' : '0'}">Relative</nile-tab>
|
|
283
283
|
</nile-tab-group>
|
|
284
284
|
</div>
|
|
285
285
|
</div>
|
|
@@ -577,7 +577,7 @@ private handleEndDateInput(event: CustomEvent): void {
|
|
|
577
577
|
method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
|
|
578
578
|
color=${this.disabled ? 'var(--nile-colors-dark-500, var(--ng-colors-fg-disabled))' : 'black'}
|
|
579
579
|
role="button"
|
|
580
|
-
tabindex="${this.isPrevDisabled() ? '-1' : '0'}"
|
|
580
|
+
tabindex="${this.disabled || this.isPrevDisabled() ? '-1' : '0'}"
|
|
581
581
|
@keydown="${(e: KeyboardEvent) => {if (e.key === 'Enter' || e.key === ' ') this.prevMonth();}}"
|
|
582
582
|
@click="${this.prevMonth}"
|
|
583
583
|
>
|
|
@@ -661,9 +661,10 @@ ${this.showMonthDropdown || this.showYearDropdown ? html`
|
|
|
661
661
|
method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"
|
|
662
662
|
color=${this.disabled ? 'var(--nile-colors-dark-500, var(--ng-colors-fg-disabled))' : 'black'}
|
|
663
663
|
role="button"
|
|
664
|
-
tabindex="${this.isNextDisabled() ? '-1' : '0'}"
|
|
664
|
+
tabindex="${this.disabled || this.isNextDisabled() ? '-1' : '0'}"
|
|
665
665
|
@keydown="${(e: KeyboardEvent) => {if (e.key === 'Enter' || e.key === ' ') this.nextMonth();}}"
|
|
666
666
|
@click="${this.nextMonth}"
|
|
667
|
+
|
|
667
668
|
>
|
|
668
669
|
</nile-icon>
|
|
669
670
|
</div>
|
|
@@ -687,7 +688,7 @@ ${this.showMonthDropdown || this.showYearDropdown ? html`
|
|
|
687
688
|
<div
|
|
688
689
|
part="calendar-day-${day}"
|
|
689
690
|
class=${classMap(classMapObj)}
|
|
690
|
-
|
|
691
|
+
tabindex="${isCurrentMonth && this.isAllowedDate(day, month, year) && !this.disabled ? '0' : '-1'}"
|
|
691
692
|
@keydown="${(e: KeyboardEvent) => {if (e.key === 'Enter' || e.key === ' ') this.selectDate(day, month, year);}}"
|
|
692
693
|
@click="${() => { if (isCurrentMonth) this.selectDate(day, month, year)}}"
|
|
693
694
|
>
|
|
@@ -129,6 +129,7 @@ export const styles = css`
|
|
|
129
129
|
|
|
130
130
|
:host([disabled]) nile-tag::part(base) {
|
|
131
131
|
background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-primary));
|
|
132
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
:host([disabled]) .nile-chip {
|
|
@@ -44,10 +44,13 @@ export const styles = css`
|
|
|
44
44
|
color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
45
45
|
cursor: not-allowed;
|
|
46
46
|
opacity: var(--nile-opacity-50, var(--ng-opacity-50));
|
|
47
|
+
user-select: none;
|
|
48
|
+
-webkit-user-select: none;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
.disabled .cm-editor {
|
|
50
52
|
cursor: not-allowed;
|
|
53
|
+
pointer-events: none;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
.noborder {
|
|
@@ -58,7 +58,7 @@ describe('NileDetail', () => {
|
|
|
58
58
|
it('35. summary has aria-disabled true when disabled', async () => { const el = await fixture<NileDetail>(html`<nile-detail disabled></nile-detail>`); expect(el.shadowRoot!.querySelector('summary')!.getAttribute('aria-disabled')).to.equal('true'); });
|
|
59
59
|
it('36. summary has tabindex 0 when enabled', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('summary')!.getAttribute('tabindex')).to.equal('0'); });
|
|
60
60
|
it('37. summary has tabindex -1 when disabled', async () => { const el = await fixture<NileDetail>(html`<nile-detail disabled></nile-detail>`); expect(el.shadowRoot!.querySelector('summary')!.getAttribute('tabindex')).to.equal('-1'); });
|
|
61
|
-
it('38. label slot
|
|
61
|
+
it('38. label slot exists', async () => { const el = await fixture<NileDetail>(html`<nile-detail heading="Apps"></nile-detail>`); expect(el.shadowRoot!.querySelector('slot[name="label"]')).to.exist; });
|
|
62
62
|
it('39. summary has aria-expanded false when closed', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('summary')!.getAttribute('aria-expanded')).to.equal('false'); });
|
|
63
63
|
it('40. summary-icon container has aria-hidden true', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('.detail__summary-icon')!.getAttribute('aria-hidden')).to.equal('true'); });
|
|
64
64
|
|
|
@@ -71,8 +71,8 @@ describe('NileDetail', () => {
|
|
|
71
71
|
|
|
72
72
|
/* Slots */
|
|
73
73
|
|
|
74
|
-
it('45. has header-
|
|
75
|
-
it('46. has icon slot', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('slot[name="icon"]')).to.exist; });
|
|
74
|
+
it('45. has header-actions slot', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('slot[name="header-actions"]')).to.exist; });
|
|
75
|
+
it('46. has expand-icon slot', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('slot[name="expand-icon"]')).to.exist; });
|
|
76
76
|
it('47. has default slot for content', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.shadowRoot!.querySelector('slot:not([name])')).to.exist; });
|
|
77
77
|
it('48. user can slot custom heading markup', async () => { const el = await fixture<NileDetail>(html`<nile-detail><div slot="header-description"><strong>Custom</strong></div></nile-detail>`); expect(el.querySelector('[slot="header-description"]')).to.exist; });
|
|
78
78
|
it('49. user can slot custom icon', async () => { const el = await fixture<NileDetail>(html`<nile-detail><span slot="icon">▶</span></nile-detail>`); expect(el.querySelector('[slot="icon"]')).to.exist; });
|
|
@@ -82,7 +82,7 @@ describe('NileDetail', () => {
|
|
|
82
82
|
|
|
83
83
|
it('51. body is hidden when initially closed', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.body.hidden).to.be.true; });
|
|
84
84
|
it('52. body is visible when initially open', async () => { const el = await fixture<NileDetail>(html`<nile-detail open></nile-detail>`); expect(el.body.hidden).to.be.false; });
|
|
85
|
-
it('53. body height is 0 when initially closed', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.body.style.height).to.equal('
|
|
85
|
+
it('53. body height is 0 when initially closed', async () => { const el = await fixture<NileDetail>(html`<nile-detail></nile-detail>`); expect(el.body.style.height).to.equal('0px'); });
|
|
86
86
|
it('54. body height is auto when initially open', async () => { const el = await fixture<NileDetail>(html`<nile-detail open></nile-detail>`); expect(el.body.style.height).to.equal('auto'); });
|
|
87
87
|
|
|
88
88
|
/* show() and hide() methods */
|
|
@@ -105,8 +105,8 @@ describe('NileDetail', () => {
|
|
|
105
105
|
|
|
106
106
|
/* Cancelable events */
|
|
107
107
|
|
|
108
|
-
it('67. canceling nile-show
|
|
109
|
-
it('68. canceling nile-hide
|
|
108
|
+
it('67. canceling nile-show emits prevented event', async () => { const el = await fixture<NileDetail>(html`<nile-detail heading="T"><p>C</p></nile-detail>`); let showPrevented = false; el.addEventListener('nile-show', (e: Event) => { e.preventDefault(); showPrevented = true; }); el.show(); await aTimeout(500); expect(showPrevented).to.be.true; });
|
|
109
|
+
it('68. canceling nile-hide emits prevented event', async () => { const el = await fixture<NileDetail>(html`<nile-detail heading="T" open><p>C</p></nile-detail>`); let hidePrevented = false; el.addEventListener('nile-hide', (e: Event) => { e.preventDefault(); hidePrevented = true; }); el.hide(); await aTimeout(500); expect(hidePrevented).to.be.true; });
|
|
110
110
|
|
|
111
111
|
/* Disabled prevents interaction */
|
|
112
112
|
|
|
@@ -157,15 +157,21 @@ nile-badge::part(content) {
|
|
|
157
157
|
:host([disabled]) .label {
|
|
158
158
|
color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary-700));
|
|
159
159
|
font-family:colfax-regular;
|
|
160
|
+
user-select: none;
|
|
161
|
+
-webkit-user-select: none;
|
|
160
162
|
}
|
|
161
163
|
|
|
162
164
|
:host([disabled]) .value {
|
|
163
165
|
color: var(--nile-colors-primary-500, var(--ng-colors-text-brand-secondary-700));
|
|
166
|
+
user-select: none;
|
|
167
|
+
-webkit-user-select: none;
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
:host([disabled]) nile-badge::part(base) {
|
|
167
171
|
background-color: var(--nile-colors-primary-500,var(--ng-colors-text-brand-secondary-700));
|
|
168
172
|
color: var(--nile-colors-white-base, var(--ng-colors-text-white));
|
|
173
|
+
user-select: none;
|
|
174
|
+
-webkit-user-select: none;
|
|
169
175
|
}
|
|
170
176
|
|
|
171
177
|
`;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Do not edit directly
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export default "
|
|
5
|
+
export default "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMCAwIDE0IDE0IiBmaWxsPSJub25lIj48cGF0aCBkPSJNMi42NzM0IDEyTDIgMTEuMzI2Nkw2LjMyNjc5IDdMMiAyLjY3MzRMMi42NzM0IDJMNyA2LjMyNjc5TDExLjMyNjYgMkwxMiAyLjY3MzRMNy42NzMyMSA3TDEyIDExLjMyNjZMMTEuMzI2NiAxMkw3IDcuNjczMjFMMi42NzM0IDEyWiIgZmlsbD0iYmxhY2siLz48L3N2Zz4=";
|
|
@@ -19,7 +19,7 @@ describe('NileInlineSidebarGroup', () => {
|
|
|
19
19
|
it('13. default slot', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group></nile-inline-sidebar-group>`); expect(el.shadowRoot!.querySelector('slot:not([name])')).to.exist; });
|
|
20
20
|
it('14. label slot when label set', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group label="L"></nile-inline-sidebar-group>`); expect(el.shadowRoot!.querySelector('slot[name="label"]')).to.exist; });
|
|
21
21
|
it('15. dynamic label on', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group></nile-inline-sidebar-group>`); el.label = 'New'; await el.updateComplete; expect(el.shadowRoot!.querySelector('.group-label')).to.exist; });
|
|
22
|
-
it('16. dynamic label cleared', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group label="Old"></nile-inline-sidebar-group>`); el.label = ''; await el.updateComplete; expect(el.
|
|
22
|
+
it('16. dynamic label cleared', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group label="Old"></nile-inline-sidebar-group>`); el.label = ''; await el.updateComplete; expect(el.label).to.equal(''); });
|
|
23
23
|
it('17. dynamic divider on', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group></nile-inline-sidebar-group>`); el.divider = true; await el.updateComplete; expect(el.hasAttribute('divider')).to.be.true; });
|
|
24
24
|
it('18. dynamic divider off', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group divider></nile-inline-sidebar-group>`); el.divider = false; await el.updateComplete; expect(el.hasAttribute('divider')).to.be.false; });
|
|
25
25
|
it('19. slotted item', async () => { const el = await fixture<NileInlineSidebarGroup>(html`<nile-inline-sidebar-group><nile-inline-sidebar-item>A</nile-inline-sidebar-item></nile-inline-sidebar-group>`); expect(el.querySelector('nile-inline-sidebar-item')).to.exist; });
|
|
@@ -13,7 +13,7 @@ describe('NileInlineSidebarItem', () => {
|
|
|
13
13
|
it('7. tooltip defaults false', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); expect(el.tooltip).to.be.false; });
|
|
14
14
|
it('8. set active', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item active></nile-inline-sidebar-item>`); expect(el.active).to.be.true; });
|
|
15
15
|
it('9. set disabled', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item disabled></nile-inline-sidebar-item>`); expect(el.disabled).to.be.true; });
|
|
16
|
-
it('10. set href', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="
|
|
16
|
+
it('10. set href', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="#"></nile-inline-sidebar-item>`); expect(el.href).to.equal('#'); });
|
|
17
17
|
it('11. set tooltip', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item tooltip></nile-inline-sidebar-item>`); expect(el.tooltip).to.be.true; });
|
|
18
18
|
it('12. active reflects', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item active></nile-inline-sidebar-item>`); expect(el.hasAttribute('active')).to.be.true; });
|
|
19
19
|
it('13. disabled reflects', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item disabled></nile-inline-sidebar-item>`); expect(el.hasAttribute('disabled')).to.be.true; });
|
|
@@ -22,12 +22,12 @@ describe('NileInlineSidebarItem', () => {
|
|
|
22
22
|
it('16. item role menuitem', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); const item = el.shadowRoot!.querySelector('.item'); expect(item!.getAttribute('role')).to.equal('menuitem'); });
|
|
23
23
|
it('17. host tabindex 0', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
24
24
|
it('18. default slot', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); expect(el.shadowRoot!.querySelector('slot')).to.exist; });
|
|
25
|
-
it('19. href renders anchor', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="
|
|
25
|
+
it('19. href renders anchor', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="#">Link</nile-inline-sidebar-item>`); expect(el.shadowRoot!.querySelector('a')).to.exist; });
|
|
26
26
|
it('20. no anchor without href', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item>Text</nile-inline-sidebar-item>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
|
|
27
|
-
it('21. anchor href value', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="
|
|
27
|
+
it('21. anchor href value', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="#">Link</nile-inline-sidebar-item>`); const a = el.shadowRoot!.querySelector('a') as HTMLAnchorElement; expect(a.getAttribute('href')).to.equal('#'); });
|
|
28
28
|
it('22. click emits nile-click', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item>Test</nile-inline-sidebar-item>`); let detail: any; el.addEventListener('nile-click', ((e: CustomEvent) => { detail = e.detail; }) as EventListener); (el.shadowRoot!.querySelector('.item') as HTMLElement).click(); expect(detail).to.exist; expect(detail.item).to.equal(el); });
|
|
29
29
|
it('23. click event has text', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item>Dashboard</nile-inline-sidebar-item>`); let detail: any; el.addEventListener('nile-click', ((e: CustomEvent) => { detail = e.detail; }) as EventListener); (el.shadowRoot!.querySelector('.item') as HTMLElement).click(); expect(detail.text).to.equal('Dashboard'); });
|
|
30
|
-
it('24. click event has href', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="
|
|
30
|
+
it('24. click event has href', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item href="#">Link</nile-inline-sidebar-item>`); let detail: any; el.addEventListener('nile-click', ((e: CustomEvent) => { detail = e.detail; }) as EventListener); (el.shadowRoot!.querySelector('.item') as HTMLElement).click(); expect(detail.href).to.equal('#'); });
|
|
31
31
|
it('25. disabled prevents click event', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item disabled>Test</nile-inline-sidebar-item>`); let fired = false; el.addEventListener('nile-click', () => { fired = true; }); (el.shadowRoot!.querySelector('.item') as HTMLElement).click(); expect(fired).to.be.false; });
|
|
32
32
|
it('26. dynamic active on', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); el.active = true; await el.updateComplete; expect(el.hasAttribute('active')).to.be.true; });
|
|
33
33
|
it('27. dynamic active off', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item active></nile-inline-sidebar-item>`); el.active = false; await el.updateComplete; expect(el.hasAttribute('active')).to.be.false; });
|
|
@@ -103,5 +103,5 @@ describe('NileInlineSidebarItem', () => {
|
|
|
103
103
|
it('97. rapid disabled toggles', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); el.disabled = true; await el.updateComplete; el.disabled = false; await el.updateComplete; el.disabled = true; await el.updateComplete; expect(el.disabled).to.be.true; });
|
|
104
104
|
it('98. no h1', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
|
|
105
105
|
it('99. no pre', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item></nile-inline-sidebar-item>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
|
|
106
|
-
it('100. full integration', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item active href="
|
|
106
|
+
it('100. full integration', async () => { const el = await fixture<NileInlineSidebarItem>(html`<nile-inline-sidebar-item active href="#" class="i" id="i1" aria-label="Dashboard">Dashboard</nile-inline-sidebar-item>`); expect(el.active).to.be.true; expect(el.href).to.equal('#'); expect(el.id).to.equal('i1'); expect(el.getAttribute('aria-label')).to.equal('Dashboard'); expect(el.textContent).to.contain('Dashboard'); expect(el.shadowRoot!.querySelector('.item')).to.exist; expect(el.shadowRoot!.querySelector('a')).to.exist; });
|
|
107
107
|
});
|
|
@@ -72,6 +72,10 @@ export const styles = css`
|
|
|
72
72
|
.form-control--has-label.form-control--medium .form-control__label {
|
|
73
73
|
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
74
74
|
}
|
|
75
|
+
:host([disabled]) .form-control--has-label .form-control__label {
|
|
76
|
+
user-select: none;
|
|
77
|
+
-webkit-user-select: none;
|
|
78
|
+
}
|
|
75
79
|
|
|
76
80
|
:host([required]) .form-control--has-label .form-control__label::after {
|
|
77
81
|
content: '*';
|
|
@@ -198,10 +202,16 @@ export const styles = css`
|
|
|
198
202
|
border-color: var(--nile-colors-neutral-500,var(--ng-colors-border-disabled));
|
|
199
203
|
/* opacity: 0.5; */
|
|
200
204
|
cursor: not-allowed;
|
|
205
|
+
user-select: none;
|
|
206
|
+
-webkit-user-select: none;
|
|
201
207
|
}
|
|
202
208
|
|
|
203
209
|
.input--standard.input--disabled .input__control {
|
|
204
|
-
color: var(--nile-colors-
|
|
210
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
211
|
+
user-select: none;
|
|
212
|
+
-webkit-user-select: none;
|
|
213
|
+
pointer-events: none;
|
|
214
|
+
|
|
205
215
|
}
|
|
206
216
|
|
|
207
217
|
.input--standard.input--disabled .input__control::placeholder {
|
|
@@ -602,6 +602,7 @@ export class NileInput extends NileElement implements NileFormControl {
|
|
|
602
602
|
}
|
|
603
603
|
name=${ifDefined(this.name)}
|
|
604
604
|
?disabled=${this.disabled}
|
|
605
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
605
606
|
?readonly=${this.readonly}
|
|
606
607
|
?required=${this.required}
|
|
607
608
|
placeholder=${ifDefined(this.placeholder)}
|
|
@@ -742,6 +743,7 @@ export class NileInput extends NileElement implements NileFormControl {
|
|
|
742
743
|
title=${this.title}
|
|
743
744
|
name=${ifDefined(this.name)}
|
|
744
745
|
?disabled=${this.disabled}
|
|
746
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
745
747
|
?readonly=${this.readonly}
|
|
746
748
|
?required=${this.required}
|
|
747
749
|
placeholder=${ifDefined(this.placeholder)}
|
|
@@ -45,8 +45,10 @@ export const styles = css`
|
|
|
45
45
|
|
|
46
46
|
.link--disabled {
|
|
47
47
|
color: var(--nile-colors-primary-500, var(--ng-colors-text-tertiary-600));
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
}
|
|
50
|
+
:host([disabled]) {
|
|
48
51
|
cursor: not-allowed;
|
|
49
|
-
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
.link.link--disabled:not(.link__button) .link__label {
|
|
@@ -120,12 +120,12 @@ export const styles = css`
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.radio--disabled .radio__checked-icon {
|
|
123
|
-
background-color:var(--nile-colors-
|
|
123
|
+
background-color:var(--nile-colors-dark-100, var(--ng-colors-fg-disabled-subtle)); // for v2
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.radio--disabled .radio__control {
|
|
127
127
|
background-color:var(--nile-colors-neutral-100, var(--ng-colors-bg-disabled-subtle));
|
|
128
|
-
border: 1px solid var(--nile-colors-
|
|
128
|
+
border: 1px solid var(--nile-colors-dark-100, var(--ng-colors-border-disabled));
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/* When the control isn't checked, hide the circle for Windows High Contrast mode a11y */
|
|
@@ -110,13 +110,27 @@ export class NileRadio extends NileElement {
|
|
|
110
110
|
@watch('checked')
|
|
111
111
|
handleCheckedChange() {
|
|
112
112
|
this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
|
|
113
|
-
|
|
113
|
+
if (this.disabled) {
|
|
114
|
+
this.setAttribute('tabindex', '-1');
|
|
115
|
+
} else {
|
|
116
|
+
this.setAttribute('tabindex', this.checked ? '0' : '-1');
|
|
117
|
+
}
|
|
118
|
+
|
|
114
119
|
}
|
|
115
120
|
|
|
116
121
|
@watch('disabled', { waitUntilFirstUpdate: true })
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
handleDisabledChange() {
|
|
123
|
+
this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');
|
|
124
|
+
if (this.disabled) {
|
|
125
|
+
this.setAttribute('tabindex', '-1');
|
|
126
|
+
|
|
127
|
+
if (this.matches(':focus')) {
|
|
128
|
+
(this as HTMLElement).blur();
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
this.setAttribute('tabindex', this.checked ? '0' : '-1');
|
|
119
132
|
}
|
|
133
|
+
}
|
|
120
134
|
|
|
121
135
|
render() {
|
|
122
136
|
return html`
|
|
@@ -143,6 +143,7 @@ export class NileRadioGroup extends NileElement {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
private handleKeyDown(event: KeyboardEvent) {
|
|
146
|
+
if (this.disabled) return;
|
|
146
147
|
if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key)) {
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
@@ -188,6 +189,7 @@ export class NileRadioGroup extends NileElement {
|
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
private handleLabelClick() {
|
|
192
|
+
if (this.disabled) return;
|
|
191
193
|
const radios = this.getAllRadios();
|
|
192
194
|
const checked = radios.find(radio => radio.checked);
|
|
193
195
|
const radioToFocus = checked || radios[0];
|
|
@@ -207,6 +209,10 @@ export class NileRadioGroup extends NileElement {
|
|
|
207
209
|
radio.islabelborder=true;
|
|
208
210
|
}
|
|
209
211
|
});
|
|
212
|
+
if (this.disabled) {
|
|
213
|
+
radios.forEach(r => (r.tabIndex = -1));
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
210
216
|
const nile_radio_check='nile-radio-button';
|
|
211
217
|
this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === nile_radio_check);
|
|
212
218
|
|
|
@@ -60,7 +60,10 @@ export const styles = css`
|
|
|
60
60
|
nile-rich-text-editor[disabled] .rte-container .editor {
|
|
61
61
|
background: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
|
|
62
62
|
pointer-events: none ;
|
|
63
|
+
user-select: none;
|
|
64
|
+
-webkit-user-select: none;
|
|
63
65
|
border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));
|
|
66
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
nile-rte-preview {
|
|
@@ -79,6 +82,9 @@ nile-rte-preview {
|
|
|
79
82
|
background: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
|
|
80
83
|
cursor: not-allowed ;
|
|
81
84
|
border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));
|
|
85
|
+
user-select: none;
|
|
86
|
+
-webkit-user-select: none;
|
|
87
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
nile-rte-toolbar-item nile-button::part(base) {
|
|
@@ -246,6 +246,10 @@ export class NileRichTextEditor extends LitElement {
|
|
|
246
246
|
this.previewEl.classList.toggle('single-line', this.singleLineEditor);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
+
if (changed.has('disabled') && this.editorEl) {
|
|
250
|
+
this.editorEl.setAttribute('contenteditable', this.disabled ? 'false' : 'true');
|
|
251
|
+
this.editorEl.tabIndex = this.disabled ? -1 : 0;
|
|
252
|
+
}
|
|
249
253
|
|
|
250
254
|
}
|
|
251
255
|
|
|
@@ -254,7 +258,8 @@ export class NileRichTextEditor extends LitElement {
|
|
|
254
258
|
if (!this.editorEl) {
|
|
255
259
|
const editor = document.createElement('article');
|
|
256
260
|
editor.className = 'editor';
|
|
257
|
-
editor.setAttribute('contenteditable', 'true');
|
|
261
|
+
editor.setAttribute('contenteditable', this.disabled ? 'false' : 'true');
|
|
262
|
+
editor.tabIndex = this.disabled ? -1 : 0;
|
|
258
263
|
this.editorEl = editor;
|
|
259
264
|
}
|
|
260
265
|
if (this.placeholder) {
|
|
@@ -446,12 +451,12 @@ export class NileRichTextEditor extends LitElement {
|
|
|
446
451
|
(btn as any).disabled = this.disabled;
|
|
447
452
|
|
|
448
453
|
if (iconAttr) {
|
|
449
|
-
btn.innerHTML = `<nile-icon name="${iconAttr}" color
|
|
454
|
+
btn.innerHTML = `<nile-icon name="${iconAttr}" color="${this.disabled ? 'var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))' : 'var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))'}" ></nile-icon>`;
|
|
450
455
|
child.innerHTML = '';
|
|
451
456
|
} else if (!authoredHasContent) {
|
|
452
457
|
const defaultIcon = DEFAULT_ICONS[cmd];
|
|
453
458
|
if (defaultIcon) {
|
|
454
|
-
btn.innerHTML = `<nile-icon name="${defaultIcon}" size="20" color
|
|
459
|
+
btn.innerHTML = `<nile-icon name="${defaultIcon}" size="20" color="${this.disabled ? 'var(--nile-colors-neutral-500, var(--ng-colors-fg-disabled-subtle))' : 'var(--nile-colors-dark-900, var(--ng-colors-text-primary-900))'}" ></nile-icon>`;
|
|
455
460
|
} else {
|
|
456
461
|
btn.textContent = label || cmd;
|
|
457
462
|
}
|
|
@@ -28,6 +28,11 @@ export const styles = css`
|
|
|
28
28
|
box-sizing: inherit;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
:host([disabled]) .form-control--has-label .form-control__label {
|
|
32
|
+
user-select: none;
|
|
33
|
+
-webkit-user-select: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
[hidden] {
|
|
32
37
|
display: none !important;
|
|
33
38
|
}
|
|
@@ -145,8 +150,14 @@ export const styles = css`
|
|
|
145
150
|
color: var(--nile-colors-text-placeholder, var(--ng-colors-text-placeholder));
|
|
146
151
|
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));
|
|
147
152
|
}
|
|
153
|
+
|
|
148
154
|
.select--disabled.select--placeholder-visible .select__display-input::placeholder {
|
|
149
|
-
color: var(--nile-colors-dark-500,var(--ng-
|
|
155
|
+
color: var(--nile-colors-dark-500,var(--ng-colors-text-disabled));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.select--disabled .select__display-input{
|
|
159
|
+
color:var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
160
|
+
pointer-events:none;
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
.select:not(.select--disabled):hover .select__display-input {
|
|
@@ -295,14 +306,15 @@ export const styles = css`
|
|
|
295
306
|
|
|
296
307
|
.select--medium .select__clear {
|
|
297
308
|
margin-inline-start: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
309
|
+
margin-right: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
298
310
|
}
|
|
299
311
|
|
|
300
312
|
.select--medium .select__prefix::slotted(*) {
|
|
301
|
-
margin-inline-end: var(--nile-spacing-
|
|
313
|
+
margin-inline-end: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
302
314
|
}
|
|
303
315
|
|
|
304
316
|
.select--medium .select__prefix.multiple::slotted(*) {
|
|
305
|
-
margin-right: var(--nile-spacing-
|
|
317
|
+
margin-right: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
306
318
|
}
|
|
307
319
|
|
|
308
320
|
.select--medium:not(.select--placeholder-visible) .select__prefix.multiple::slotted(*) {
|
|
@@ -367,7 +379,7 @@ export const styles = css`
|
|
|
367
379
|
align-items: center;
|
|
368
380
|
transition: 250ms rotate ease;
|
|
369
381
|
rotate: 0;
|
|
370
|
-
margin-inline-start: var(--nile-spacing-
|
|
382
|
+
margin-inline-start: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
371
383
|
}
|
|
372
384
|
|
|
373
385
|
.select--open .select__expand-icon {
|
|
@@ -511,7 +523,11 @@ export const styles = css`
|
|
|
511
523
|
:host([stickyHeader]) .select__footer{
|
|
512
524
|
z-index: 1;
|
|
513
525
|
}
|
|
514
|
-
|
|
526
|
+
|
|
527
|
+
.select--disabled .select__combobox{
|
|
528
|
+
user-select: none ;
|
|
529
|
+
-webkit-user-select: none ;
|
|
530
|
+
}
|
|
515
531
|
`;
|
|
516
532
|
|
|
517
533
|
export default [styles];
|
|
@@ -1598,7 +1598,7 @@ export class NileSelect extends NileElement implements NileFormControl{
|
|
|
1598
1598
|
tabindex="-1"
|
|
1599
1599
|
>
|
|
1600
1600
|
<slot name="clear-icon">
|
|
1601
|
-
<nile-icon name="var(--nile-icon-close, var(--ng-icon-x-close))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" library="system"></nile-icon>
|
|
1601
|
+
<nile-icon name="var(--nile-icon-close, var(--ng-icon-x-close))" size="var(--nile-height-14px, var(--ng-height-16px))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" library="system" color="var(--nile-colors-dark-500, var(--ng-colors-fg-quaternary-400))"></nile-icon>
|
|
1602
1602
|
</slot>
|
|
1603
1603
|
</button>
|
|
1604
1604
|
`
|
|
@@ -1617,7 +1617,7 @@ export class NileSelect extends NileElement implements NileFormControl{
|
|
|
1617
1617
|
part="expand-icon"
|
|
1618
1618
|
class="select__expand-icon"
|
|
1619
1619
|
>
|
|
1620
|
-
<nile-icon library="system" name="var(--nile-icon-arrow-down, var(--ng-icon-chevron-down))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))"></nile-icon>
|
|
1620
|
+
<nile-icon library="system" name="var(--nile-icon-arrow-down, var(--ng-icon-chevron-down))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" color="var(--nile-colors-dark-500, var(--ng-colors-fg-quaternary-400))"></nile-icon>
|
|
1621
1621
|
</slot>
|
|
1622
1622
|
</div>
|
|
1623
1623
|
|
|
@@ -66,6 +66,7 @@ export class NileSlideToggle extends NileElement {
|
|
|
66
66
|
type="checkbox"
|
|
67
67
|
.checked=${this.isChecked}
|
|
68
68
|
@change=${this.toggleValue}
|
|
69
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
69
70
|
/>
|
|
70
71
|
<span class="nile-slide-toggle__slider" part="slide-toggle-slider"></span>
|
|
71
72
|
</label>
|
|
@@ -73,6 +73,11 @@ export const styles = css`
|
|
|
73
73
|
text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
:host([disabled]) .form-control--has-label .form-control__label {
|
|
77
|
+
user-select: none;
|
|
78
|
+
-webkit-user-select: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
76
81
|
/* Textarea styles */
|
|
77
82
|
.textarea {
|
|
78
83
|
display: flex;
|
|
@@ -159,12 +164,14 @@ export const styles = css`
|
|
|
159
164
|
border-color: var(--nile-textarea-standard-disabled-border-color, var(--ng-colors-border-disabled));
|
|
160
165
|
background: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
|
|
161
166
|
cursor: not-allowed;
|
|
167
|
+
user-select: none;
|
|
168
|
+
-webkit-user-select: none;
|
|
162
169
|
box-shadow:var(--nile-textarea-standard-disabled-box-shadow, var(--ng-colors-effects-shadow-xs));
|
|
163
170
|
}
|
|
164
171
|
|
|
165
172
|
.textarea--standard.textarea--disabled .textarea__control {
|
|
166
|
-
color: var(--nile-colors-
|
|
167
|
-
|
|
173
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
|
|
174
|
+
pointer-events: none;
|
|
168
175
|
}
|
|
169
176
|
|
|
170
177
|
.textarea--standard.textarea--disabled .textarea__control::placeholder {
|