|
| 1 | +import { |
| 2 | + ChangeDetectionStrategy, |
| 3 | + Component, |
| 4 | + ViewEncapsulation, |
| 5 | +} from '@angular/core'; |
| 6 | +import { DemoContainer } from '../../../../components/demo-container/demo-container'; |
| 7 | +import { ScSelectDisabledDemo } from './select-disabled-demo'; |
| 8 | + |
| 9 | +@Component({ |
| 10 | + selector: 'app-select-disabled-demo-container', |
| 11 | + imports: [DemoContainer, ScSelectDisabledDemo], |
| 12 | + template: ` |
| 13 | + <app-demo-container title="Disabled Select" [code]="code"> |
| 14 | + <app-select-disabled-demo /> |
| 15 | + </app-demo-container> |
| 16 | + `, |
| 17 | + host: { class: 'block' }, |
| 18 | + encapsulation: ViewEncapsulation.None, |
| 19 | + changeDetection: ChangeDetectionStrategy.OnPush, |
| 20 | +}) |
| 21 | +export class ScSelectDisabledDemoContainer { |
| 22 | + readonly code = `import { |
| 23 | + ChangeDetectionStrategy, |
| 24 | + Component, |
| 25 | + ViewEncapsulation, |
| 26 | +} from '@angular/core'; |
| 27 | +import { |
| 28 | + ScSelect, |
| 29 | + ScSelectItem, |
| 30 | + ScSelectList, |
| 31 | + ScSelectPopup, |
| 32 | + ScSelectPortal, |
| 33 | + ScSelectTrigger, |
| 34 | + ScSelectLabel, |
| 35 | +} from '@semantic-components/ui'; |
| 36 | +
|
| 37 | +@Component({ |
| 38 | + selector: 'app-select-disabled-demo', |
| 39 | + imports: [ |
| 40 | + ScSelect, |
| 41 | + ScSelectItem, |
| 42 | + ScSelectList, |
| 43 | + ScSelectPopup, |
| 44 | + ScSelectPortal, |
| 45 | + ScSelectTrigger, |
| 46 | + ScSelectLabel, |
| 47 | + ], |
| 48 | + template: \` |
| 49 | + <div |
| 50 | + scSelect |
| 51 | + #select="scSelect" |
| 52 | + placeholder="Select a fruit" |
| 53 | + aria-label="Fruit dropdown" |
| 54 | + disabled |
| 55 | + > |
| 56 | + <div scSelectTrigger> |
| 57 | + <span scSelectLabel> |
| 58 | + <span class="truncate">{{ select.label() }}</span> |
| 59 | + </span> |
| 60 | + </div> |
| 61 | + <ng-template scSelectPortal> |
| 62 | + <div scSelectPopup> |
| 63 | + <div scSelectList> |
| 64 | + <div scSelectItem value="Apple" label="Apple">Apple</div> |
| 65 | + <div scSelectItem value="Banana" label="Banana">Banana</div> |
| 66 | + <div scSelectItem value="Orange" label="Orange">Orange</div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + </ng-template> |
| 70 | + </div> |
| 71 | + \`, |
| 72 | + encapsulation: ViewEncapsulation.None, |
| 73 | + changeDetection: ChangeDetectionStrategy.OnPush, |
| 74 | +}) |
| 75 | +export class ScSelectDisabledDemo {}`; |
| 76 | +} |
0 commit comments