mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
8
core/src/components.d.ts
vendored
8
core/src/components.d.ts
vendored
@@ -1044,6 +1044,10 @@ declare global {
|
||||
* Close all of the sliding items in the list. Items can also be closed from the [List](../../list/List).
|
||||
*/
|
||||
'closeOpened': () => boolean;
|
||||
/**
|
||||
* If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
*/
|
||||
'disabled': boolean;
|
||||
/**
|
||||
* Get the amount the item is open in pixels.
|
||||
*/
|
||||
@@ -4666,6 +4670,10 @@ declare global {
|
||||
}
|
||||
|
||||
export interface IonItemSlidingAttributes extends HTMLAttributes {
|
||||
/**
|
||||
* If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
*/
|
||||
'disabled'?: boolean;
|
||||
/**
|
||||
* Emitted when the sliding position changes.
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, QueueApi, State } from '@stencil/core';
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, QueueApi, State, Watch } from '@stencil/core';
|
||||
|
||||
import { Gesture, GestureDetail } from '../../interface';
|
||||
|
||||
@@ -47,6 +47,17 @@ export class ItemSliding {
|
||||
|
||||
@Prop({ context: 'queue' }) queue!: QueueApi;
|
||||
|
||||
/**
|
||||
* If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
*/
|
||||
@Prop() disabled = false;
|
||||
@Watch('disabled')
|
||||
disabledChanged() {
|
||||
if (this.gesture) {
|
||||
this.gesture.setDisabled(this.disabled);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emitted when the sliding position changes.
|
||||
*/
|
||||
@@ -69,7 +80,7 @@ export class ItemSliding {
|
||||
onMove: this.onDragMove.bind(this),
|
||||
onEnd: this.onDragEnd.bind(this),
|
||||
});
|
||||
this.gesture.setDisabled(false);
|
||||
this.disabledChanged();
|
||||
}
|
||||
|
||||
componentDidUnload() {
|
||||
|
||||
@@ -29,6 +29,24 @@ Options can be expanded to take up the full width of the item if you swipe past
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
||||
If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
||||
If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
#### ionDrag
|
||||
|
||||
Reference in New Issue
Block a user