mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
chore(packages): move the packages to root
This commit is contained in:
69
core/src/components/select-option/readme.md
Normal file
69
core/src/components/select-option/readme.md
Normal file
@ -0,0 +1,69 @@
|
||||
# ion-select-option
|
||||
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
||||
If true, the user cannot interact with the select option. Defaults to `false`.
|
||||
|
||||
|
||||
#### selected
|
||||
|
||||
boolean
|
||||
|
||||
If true, the element is selected.
|
||||
|
||||
|
||||
#### value
|
||||
|
||||
|
||||
|
||||
The text value of the option.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
||||
If true, the user cannot interact with the select option. Defaults to `false`.
|
||||
|
||||
|
||||
#### selected
|
||||
|
||||
boolean
|
||||
|
||||
If true, the element is selected.
|
||||
|
||||
|
||||
#### value
|
||||
|
||||
|
||||
|
||||
The text value of the option.
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
#### ionSelectOptionDidLoad
|
||||
|
||||
Emitted when the select option loads.
|
||||
|
||||
|
||||
#### ionSelectOptionDidUnload
|
||||
|
||||
Emitted when the select option unloads.
|
||||
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
*Built with [StencilJS](https://stenciljs.com/)*
|
||||
70
core/src/components/select-option/select-option.tsx
Normal file
70
core/src/components/select-option/select-option.tsx
Normal file
@ -0,0 +1,70 @@
|
||||
import { Component, Element, Event, EventEmitter, Prop } from '@stencil/core';
|
||||
|
||||
|
||||
@Component({
|
||||
tag: 'ion-select-option',
|
||||
host: {
|
||||
theme: 'select-option'
|
||||
}
|
||||
})
|
||||
export class SelectOption {
|
||||
id: string;
|
||||
|
||||
@Element() el: HTMLElement;
|
||||
|
||||
/**
|
||||
* If true, the user cannot interact with the select option. Defaults to `false`.
|
||||
*/
|
||||
@Prop() disabled = false;
|
||||
|
||||
/**
|
||||
* If true, the element is selected.
|
||||
*/
|
||||
@Prop({ mutable: true }) selected = false;
|
||||
|
||||
/**
|
||||
* The text value of the option.
|
||||
*/
|
||||
@Prop({ mutable: true }) value: string|null = null;
|
||||
|
||||
/**
|
||||
* Emitted when the select option loads.
|
||||
*/
|
||||
@Event() ionSelectOptionDidLoad: EventEmitter;
|
||||
|
||||
/**
|
||||
* Emitted when the select option unloads.
|
||||
*/
|
||||
@Event() ionSelectOptionDidUnload: EventEmitter;
|
||||
|
||||
constructor() {
|
||||
this.id = 'ion-selopt-' + (selectOptionIds++);
|
||||
}
|
||||
|
||||
componentWillLoad() {
|
||||
this.value = this.value || this.el.textContent;
|
||||
}
|
||||
|
||||
componentDidLoad() {
|
||||
this.ionSelectOptionDidLoad.emit();
|
||||
}
|
||||
|
||||
componentDidUnload() {
|
||||
this.ionSelectOptionDidUnload.emit();
|
||||
}
|
||||
|
||||
hostData() {
|
||||
return {
|
||||
'role': 'option',
|
||||
'id': this.id
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export interface HTMLIonSelectOptionElementEvent extends CustomEvent {
|
||||
target: HTMLIonSelectOptionElement;
|
||||
}
|
||||
|
||||
let selectOptionIds = 0;
|
||||
Reference in New Issue
Block a user