js: list add canDrag, onDraging & onDraged
This commit is contained in:
parent
fc94230df2
commit
1e7637a1dc
@ -68,7 +68,7 @@ var Mutable = /** @class */ (function () {
|
|||||||
*/
|
*/
|
||||||
var __uniqueId__ = 0;
|
var __uniqueId__ = 0;
|
||||||
function uniqueId(prefix) {
|
function uniqueId(prefix) {
|
||||||
return "__" + prefix + "_" + __uniqueId__++ + "__";
|
return "__".concat(prefix, "_").concat(__uniqueId__++, "__");
|
||||||
}
|
}
|
||||||
|
|
||||||
function toString(message) {
|
function toString(message) {
|
||||||
@ -92,11 +92,6 @@ function toString(message) {
|
|||||||
}
|
}
|
||||||
function log() {
|
function log() {
|
||||||
var arguments$1 = arguments;
|
var arguments$1 = arguments;
|
||||||
|
|
||||||
var args = [];
|
|
||||||
for (var _i = 0; _i < arguments.length; _i++) {
|
|
||||||
args[_i] = arguments$1[_i];
|
|
||||||
}
|
|
||||||
var out = "";
|
var out = "";
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -108,11 +103,6 @@ function log() {
|
|||||||
}
|
}
|
||||||
function loge() {
|
function loge() {
|
||||||
var arguments$1 = arguments;
|
var arguments$1 = arguments;
|
||||||
|
|
||||||
var message = [];
|
|
||||||
for (var _i = 0; _i < arguments.length; _i++) {
|
|
||||||
message[_i] = arguments$1[_i];
|
|
||||||
}
|
|
||||||
var out = "";
|
var out = "";
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -124,11 +114,6 @@ function loge() {
|
|||||||
}
|
}
|
||||||
function logw() {
|
function logw() {
|
||||||
var arguments$1 = arguments;
|
var arguments$1 = arguments;
|
||||||
|
|
||||||
var message = [];
|
|
||||||
for (var _i = 0; _i < arguments.length; _i++) {
|
|
||||||
message[_i] = arguments$1[_i];
|
|
||||||
}
|
|
||||||
var out = "";
|
var out = "";
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -177,11 +162,11 @@ var __values$5 = (undefined && undefined.__values) || function(o) {
|
|||||||
function Property(target, propKey) {
|
function Property(target, propKey) {
|
||||||
Object.defineProperty(target, propKey, {
|
Object.defineProperty(target, propKey, {
|
||||||
get: function () {
|
get: function () {
|
||||||
return Reflect.get(this, "__prop__" + propKey, this);
|
return Reflect.get(this, "__prop__".concat(propKey), this);
|
||||||
},
|
},
|
||||||
set: function (v) {
|
set: function (v) {
|
||||||
var oldV = Reflect.get(this, "__prop__" + propKey, this);
|
var oldV = Reflect.get(this, "__prop__".concat(propKey), this);
|
||||||
Reflect.set(this, "__prop__" + propKey, v, this);
|
Reflect.set(this, "__prop__".concat(propKey), v, this);
|
||||||
if (oldV !== v) {
|
if (oldV !== v) {
|
||||||
Reflect.apply(this.onPropertyChanged, this, [propKey, oldV, v]);
|
Reflect.apply(this.onPropertyChanged, this, [propKey, oldV, v]);
|
||||||
}
|
}
|
||||||
@ -191,11 +176,11 @@ function Property(target, propKey) {
|
|||||||
function InconsistProperty(target, propKey) {
|
function InconsistProperty(target, propKey) {
|
||||||
Object.defineProperty(target, propKey, {
|
Object.defineProperty(target, propKey, {
|
||||||
get: function () {
|
get: function () {
|
||||||
return Reflect.get(this, "__prop__" + propKey, this);
|
return Reflect.get(this, "__prop__".concat(propKey), this);
|
||||||
},
|
},
|
||||||
set: function (v) {
|
set: function (v) {
|
||||||
var oldV = Reflect.get(this, "__prop__" + propKey, this);
|
var oldV = Reflect.get(this, "__prop__".concat(propKey), this);
|
||||||
Reflect.set(this, "__prop__" + propKey, v, this);
|
Reflect.set(this, "__prop__".concat(propKey), v, this);
|
||||||
Reflect.apply(this.onPropertyChanged, this, [propKey, oldV, v]);
|
Reflect.apply(this.onPropertyChanged, this, [propKey, oldV, v]);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -359,11 +344,6 @@ var View = /** @class */ (function () {
|
|||||||
};
|
};
|
||||||
View.prototype.responseCallback = function (id) {
|
View.prototype.responseCallback = function (id) {
|
||||||
var arguments$1 = arguments;
|
var arguments$1 = arguments;
|
||||||
|
|
||||||
var args = [];
|
|
||||||
for (var _i = 1; _i < arguments.length; _i++) {
|
|
||||||
args[_i - 1] = arguments$1[_i];
|
|
||||||
}
|
|
||||||
var f = this.id2Callback(id);
|
var f = this.id2Callback(id);
|
||||||
if (f instanceof Function) {
|
if (f instanceof Function) {
|
||||||
var argumentsList = [];
|
var argumentsList = [];
|
||||||
@ -373,7 +353,7 @@ var View = /** @class */ (function () {
|
|||||||
return Reflect.apply(f, this, argumentsList);
|
return Reflect.apply(f, this, argumentsList);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
loge("Cannot find callback:" + id + " for " + JSON.stringify(this.toModel()));
|
loge("Cannot find callback:".concat(id, " for ").concat(JSON.stringify(this.toModel())));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
View.prototype.toModel = function () {
|
View.prototype.toModel = function () {
|
||||||
@ -714,7 +694,7 @@ var Group = /** @class */ (function (_super) {
|
|||||||
this.addChild(e);
|
this.addChild(e);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
loge("Not allowed to add " + typeof e);
|
loge("Not allowed to add ".concat(typeof e));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Object.defineProperty(Group.prototype, "innerElement", {
|
Object.defineProperty(Group.prototype, "innerElement", {
|
||||||
@ -1229,7 +1209,7 @@ var Panel = /** @class */ (function () {
|
|||||||
|
|
||||||
var v = this.retrospectView(viewIds);
|
var v = this.retrospectView(viewIds);
|
||||||
if (v === undefined) {
|
if (v === undefined) {
|
||||||
loge("Cannot find view for " + viewIds);
|
loge("Cannot find view for ".concat(viewIds));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var argumentsList = [callbackId];
|
var argumentsList = [callbackId];
|
||||||
@ -1431,7 +1411,7 @@ var Color = /** @class */ (function () {
|
|||||||
}
|
}
|
||||||
Color.parse = function (str) {
|
Color.parse = function (str) {
|
||||||
if (!str.startsWith("#")) {
|
if (!str.startsWith("#")) {
|
||||||
throw new Error("Parse color error with " + str);
|
throw new Error("Parse color error with ".concat(str));
|
||||||
}
|
}
|
||||||
var val = parseInt(str.substr(1), 16);
|
var val = parseInt(str.substr(1), 16);
|
||||||
if (str.length === 7) {
|
if (str.length === 7) {
|
||||||
@ -1441,7 +1421,7 @@ var Color = /** @class */ (function () {
|
|||||||
return new Color(val);
|
return new Color(val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error("Parse color error with " + str);
|
throw new Error("Parse color error with ".concat(str));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Color.safeParse = function (str, defVal) {
|
Color.safeParse = function (str, defVal) {
|
||||||
@ -2244,7 +2224,7 @@ var MainBundleResource = /** @class */ (function (_super) {
|
|||||||
var BundleResource = /** @class */ (function (_super) {
|
var BundleResource = /** @class */ (function (_super) {
|
||||||
__extends$f(BundleResource, _super);
|
__extends$f(BundleResource, _super);
|
||||||
function BundleResource(bundleName, fileName) {
|
function BundleResource(bundleName, fileName) {
|
||||||
return _super.call(this, "bundle", bundleName + "://" + fileName) || this;
|
return _super.call(this, "bundle", "".concat(bundleName, "://").concat(fileName)) || this;
|
||||||
}
|
}
|
||||||
return BundleResource;
|
return BundleResource;
|
||||||
}(iOSResource));
|
}(iOSResource));
|
||||||
@ -2527,7 +2507,7 @@ var List = /** @class */ (function (_super) {
|
|||||||
List.prototype.getItem = function (itemIdx) {
|
List.prototype.getItem = function (itemIdx) {
|
||||||
var view = this.renderItem(itemIdx);
|
var view = this.renderItem(itemIdx);
|
||||||
view.superview = this;
|
view.superview = this;
|
||||||
this.cachedViews.set("" + itemIdx, view);
|
this.cachedViews.set("".concat(itemIdx), view);
|
||||||
return view;
|
return view;
|
||||||
};
|
};
|
||||||
List.prototype.renderBunchedItems = function (start, length) {
|
List.prototype.renderBunchedItems = function (start, length) {
|
||||||
@ -2587,6 +2567,18 @@ var List = /** @class */ (function (_super) {
|
|||||||
Property,
|
Property,
|
||||||
__metadata$a("design:type", Boolean)
|
__metadata$a("design:type", Boolean)
|
||||||
], List.prototype, "bounces", void 0);
|
], List.prototype, "bounces", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Boolean)
|
||||||
|
], List.prototype, "canDrag", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Function)
|
||||||
|
], List.prototype, "onDragging", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Function)
|
||||||
|
], List.prototype, "onDragged", void 0);
|
||||||
return List;
|
return List;
|
||||||
}(Superview));
|
}(Superview));
|
||||||
function list(config) {
|
function list(config) {
|
||||||
@ -2661,7 +2653,7 @@ var Slider = /** @class */ (function (_super) {
|
|||||||
Slider.prototype.getItem = function (itemIdx) {
|
Slider.prototype.getItem = function (itemIdx) {
|
||||||
var view = this.renderPage(itemIdx);
|
var view = this.renderPage(itemIdx);
|
||||||
view.superview = this;
|
view.superview = this;
|
||||||
this.cachedViews.set("" + itemIdx, view);
|
this.cachedViews.set("".concat(itemIdx), view);
|
||||||
return view;
|
return view;
|
||||||
};
|
};
|
||||||
Slider.prototype.renderBunchedItems = function (start, length) {
|
Slider.prototype.renderBunchedItems = function (start, length) {
|
||||||
@ -3025,7 +3017,7 @@ exports.jsx = void 0;
|
|||||||
Reflect.set(e, "innerElement", children, e);
|
Reflect.set(e, "innerElement", children, e);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error("Do not support " + constructor.name + " for " + children);
|
throw new Error("Do not support ".concat(constructor.name, " for ").concat(children));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return e;
|
return e;
|
||||||
@ -3143,7 +3135,7 @@ var FlowLayout = /** @class */ (function (_super) {
|
|||||||
FlowLayout.prototype.getItem = function (itemIdx) {
|
FlowLayout.prototype.getItem = function (itemIdx) {
|
||||||
var view = this.renderItem(itemIdx);
|
var view = this.renderItem(itemIdx);
|
||||||
view.superview = this;
|
view.superview = this;
|
||||||
this.cachedViews.set("" + itemIdx, view);
|
this.cachedViews.set("".concat(itemIdx), view);
|
||||||
return view;
|
return view;
|
||||||
};
|
};
|
||||||
FlowLayout.prototype.renderBunchedItems = function (start, length) {
|
FlowLayout.prototype.renderBunchedItems = function (start, length) {
|
||||||
@ -3824,7 +3816,7 @@ function navbar(context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function internalScheme(context, panelClass) {
|
function internalScheme(context, panelClass) {
|
||||||
return "_internal_://export?class=" + encodeURIComponent(panelClass.name) + "&context=" + context.id;
|
return "_internal_://export?class=".concat(encodeURIComponent(panelClass.name), "&context=").concat(context.id);
|
||||||
}
|
}
|
||||||
function navigator(context) {
|
function navigator(context) {
|
||||||
var moduleName = "navigator";
|
var moduleName = "navigator";
|
||||||
@ -3864,9 +3856,9 @@ function transformRequest(request) {
|
|||||||
if (request.params !== undefined) {
|
if (request.params !== undefined) {
|
||||||
var queryStrings = [];
|
var queryStrings = [];
|
||||||
for (var key in request.params) {
|
for (var key in request.params) {
|
||||||
queryStrings.push(key + "=" + encodeURIComponent(request.params[key]));
|
queryStrings.push("".concat(key, "=").concat(encodeURIComponent(request.params[key])));
|
||||||
}
|
}
|
||||||
request.url = "" + request.url + (url.indexOf('?') >= 0 ? '&' : '?') + queryStrings.join('&');
|
request.url = "".concat(request.url).concat(url.indexOf('?') >= 0 ? '&' : '?').concat(queryStrings.join('&'));
|
||||||
}
|
}
|
||||||
if (typeof request.data === 'object') {
|
if (typeof request.data === 'object') {
|
||||||
request.data = JSON.stringify(request.data);
|
request.data = JSON.stringify(request.data);
|
||||||
@ -4142,7 +4134,7 @@ function animate(context) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return function (args) {
|
return function (args) {
|
||||||
return Promise.reject("Cannot find panel in Context:" + context.id);
|
return Promise.reject("Cannot find panel in Context:".concat(context.id));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1953,6 +1953,18 @@ __decorate$a([
|
|||||||
Property,
|
Property,
|
||||||
__metadata$a("design:type", Boolean)
|
__metadata$a("design:type", Boolean)
|
||||||
], List.prototype, "bounces", void 0);
|
], List.prototype, "bounces", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Boolean)
|
||||||
|
], List.prototype, "canDrag", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Function)
|
||||||
|
], List.prototype, "onDragging", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Function)
|
||||||
|
], List.prototype, "onDragged", void 0);
|
||||||
function list(config) {
|
function list(config) {
|
||||||
const ret = new List;
|
const ret = new List;
|
||||||
ret.apply(config);
|
ret.apply(config);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3481,6 +3481,18 @@ __decorate$a([
|
|||||||
Property,
|
Property,
|
||||||
__metadata$a("design:type", Boolean)
|
__metadata$a("design:type", Boolean)
|
||||||
], List.prototype, "bounces", void 0);
|
], List.prototype, "bounces", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Boolean)
|
||||||
|
], List.prototype, "canDrag", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Function)
|
||||||
|
], List.prototype, "onDragging", void 0);
|
||||||
|
__decorate$a([
|
||||||
|
Property,
|
||||||
|
__metadata$a("design:type", Function)
|
||||||
|
], List.prototype, "onDragged", void 0);
|
||||||
function list(config) {
|
function list(config) {
|
||||||
const ret = new List;
|
const ret = new List;
|
||||||
ret.apply(config);
|
ret.apply(config);
|
||||||
|
27
doric-js/index.d.ts
vendored
27
doric-js/index.d.ts
vendored
@ -763,6 +763,9 @@ declare module 'doric/lib/src/widget/list' {
|
|||||||
* Take effect only on iOS
|
* Take effect only on iOS
|
||||||
*/
|
*/
|
||||||
bounces?: boolean;
|
bounces?: boolean;
|
||||||
|
canDrag?: boolean;
|
||||||
|
onDragging?: (from: number, to: number) => void;
|
||||||
|
onDragged?: (from: number, to: number) => void;
|
||||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||||
animated?: boolean;
|
animated?: boolean;
|
||||||
}): Promise<any>;
|
}): Promise<any>;
|
||||||
@ -1211,11 +1214,11 @@ declare module 'doric/lib/src/native/navigator' {
|
|||||||
export function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
|
export function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
|
||||||
export function navigator(context: BridgeContext): {
|
export function navigator(context: BridgeContext): {
|
||||||
push: (source: string | ClassType<Panel>, config?: {
|
push: (source: string | ClassType<Panel>, config?: {
|
||||||
alias?: string | undefined;
|
alias?: string;
|
||||||
animated?: boolean | undefined;
|
animated?: boolean;
|
||||||
extra?: object | undefined;
|
extra?: object;
|
||||||
singlePage?: boolean | undefined;
|
singlePage?: boolean;
|
||||||
} | undefined) => Promise<any>;
|
}) => Promise<any>;
|
||||||
pop: (animated?: boolean) => Promise<any>;
|
pop: (animated?: boolean) => Promise<any>;
|
||||||
popSelf: (animated?: boolean) => Promise<any>;
|
popSelf: (animated?: boolean) => Promise<any>;
|
||||||
popToRoot: (animated?: boolean) => Promise<any>;
|
popToRoot: (animated?: boolean) => Promise<any>;
|
||||||
@ -1246,19 +1249,19 @@ declare module 'doric/lib/src/native/network' {
|
|||||||
}
|
}
|
||||||
export function network(context: BridgeContext): {
|
export function network(context: BridgeContext): {
|
||||||
request: (config: IRequest) => Promise<IResponse>;
|
request: (config: IRequest) => Promise<IResponse>;
|
||||||
get: (url: string, config?: IRequest | undefined) => Promise<IResponse>;
|
get: (url: string, config?: IRequest) => Promise<IResponse>;
|
||||||
post: (url: string, data?: string | object | undefined, config?: IRequest | undefined) => Promise<IResponse>;
|
post: (url: string, data?: object | string, config?: IRequest) => Promise<IResponse>;
|
||||||
put: (url: string, data?: string | object | undefined, config?: IRequest | undefined) => Promise<IResponse>;
|
put: (url: string, data?: object | string, config?: IRequest) => Promise<IResponse>;
|
||||||
delete: (url: string, data?: string | object | undefined, config?: IRequest | undefined) => Promise<IResponse>;
|
delete: (url: string, data?: object | string, config?: IRequest) => Promise<IResponse>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'doric/lib/src/native/storage' {
|
declare module 'doric/lib/src/native/storage' {
|
||||||
import { BridgeContext } from "doric/lib/src/runtime/global";
|
import { BridgeContext } from "doric/lib/src/runtime/global";
|
||||||
export function storage(context: BridgeContext): {
|
export function storage(context: BridgeContext): {
|
||||||
setItem: (key: string, value: string, zone?: string | undefined) => Promise<any>;
|
setItem: (key: string, value: string, zone?: string) => Promise<any>;
|
||||||
getItem: (key: string, zone?: string | undefined) => Promise<string>;
|
getItem: (key: string, zone?: string) => Promise<string>;
|
||||||
remove: (key: string, zone?: string | undefined) => Promise<any>;
|
remove: (key: string, zone?: string) => Promise<any>;
|
||||||
clear: (zone: string) => Promise<any>;
|
clear: (zone: string) => Promise<any>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
10
doric-js/lib/src/native/navigator.d.ts
vendored
10
doric-js/lib/src/native/navigator.d.ts
vendored
@ -4,11 +4,11 @@ import { ClassType } from "../util/types";
|
|||||||
export declare function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
|
export declare function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
|
||||||
export declare function navigator(context: BridgeContext): {
|
export declare function navigator(context: BridgeContext): {
|
||||||
push: (source: string | ClassType<Panel>, config?: {
|
push: (source: string | ClassType<Panel>, config?: {
|
||||||
alias?: string | undefined;
|
alias?: string;
|
||||||
animated?: boolean | undefined;
|
animated?: boolean;
|
||||||
extra?: object | undefined;
|
extra?: object;
|
||||||
singlePage?: boolean | undefined;
|
singlePage?: boolean;
|
||||||
} | undefined) => Promise<any>;
|
}) => Promise<any>;
|
||||||
pop: (animated?: boolean) => Promise<any>;
|
pop: (animated?: boolean) => Promise<any>;
|
||||||
popSelf: (animated?: boolean) => Promise<any>;
|
popSelf: (animated?: boolean) => Promise<any>;
|
||||||
popToRoot: (animated?: boolean) => Promise<any>;
|
popToRoot: (animated?: boolean) => Promise<any>;
|
||||||
|
8
doric-js/lib/src/native/network.d.ts
vendored
8
doric-js/lib/src/native/network.d.ts
vendored
@ -20,8 +20,8 @@ export interface IResponse {
|
|||||||
}
|
}
|
||||||
export declare function network(context: BridgeContext): {
|
export declare function network(context: BridgeContext): {
|
||||||
request: (config: IRequest) => Promise<IResponse>;
|
request: (config: IRequest) => Promise<IResponse>;
|
||||||
get: (url: string, config?: IRequest | undefined) => Promise<IResponse>;
|
get: (url: string, config?: IRequest) => Promise<IResponse>;
|
||||||
post: (url: string, data?: string | object | undefined, config?: IRequest | undefined) => Promise<IResponse>;
|
post: (url: string, data?: object | string, config?: IRequest) => Promise<IResponse>;
|
||||||
put: (url: string, data?: string | object | undefined, config?: IRequest | undefined) => Promise<IResponse>;
|
put: (url: string, data?: object | string, config?: IRequest) => Promise<IResponse>;
|
||||||
delete: (url: string, data?: string | object | undefined, config?: IRequest | undefined) => Promise<IResponse>;
|
delete: (url: string, data?: object | string, config?: IRequest) => Promise<IResponse>;
|
||||||
};
|
};
|
||||||
|
6
doric-js/lib/src/native/storage.d.ts
vendored
6
doric-js/lib/src/native/storage.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
import { BridgeContext } from "../runtime/global";
|
import { BridgeContext } from "../runtime/global";
|
||||||
export declare function storage(context: BridgeContext): {
|
export declare function storage(context: BridgeContext): {
|
||||||
setItem: (key: string, value: string, zone?: string | undefined) => Promise<any>;
|
setItem: (key: string, value: string, zone?: string) => Promise<any>;
|
||||||
getItem: (key: string, zone?: string | undefined) => Promise<string>;
|
getItem: (key: string, zone?: string) => Promise<string>;
|
||||||
remove: (key: string, zone?: string | undefined) => Promise<any>;
|
remove: (key: string, zone?: string) => Promise<any>;
|
||||||
clear: (zone: string) => Promise<any>;
|
clear: (zone: string) => Promise<any>;
|
||||||
};
|
};
|
||||||
|
3
doric-js/lib/src/widget/list.d.ts
vendored
3
doric-js/lib/src/widget/list.d.ts
vendored
@ -36,6 +36,9 @@ export declare class List extends Superview {
|
|||||||
* Take effect only on iOS
|
* Take effect only on iOS
|
||||||
*/
|
*/
|
||||||
bounces?: boolean;
|
bounces?: boolean;
|
||||||
|
canDrag?: boolean;
|
||||||
|
onDragging?: (from: number, to: number) => void;
|
||||||
|
onDragged?: (from: number, to: number) => void;
|
||||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||||
animated?: boolean;
|
animated?: boolean;
|
||||||
}): Promise<any>;
|
}): Promise<any>;
|
||||||
|
@ -134,6 +134,18 @@ __decorate([
|
|||||||
Property,
|
Property,
|
||||||
__metadata("design:type", Boolean)
|
__metadata("design:type", Boolean)
|
||||||
], List.prototype, "bounces", void 0);
|
], List.prototype, "bounces", void 0);
|
||||||
|
__decorate([
|
||||||
|
Property,
|
||||||
|
__metadata("design:type", Boolean)
|
||||||
|
], List.prototype, "canDrag", void 0);
|
||||||
|
__decorate([
|
||||||
|
Property,
|
||||||
|
__metadata("design:type", Function)
|
||||||
|
], List.prototype, "onDragging", void 0);
|
||||||
|
__decorate([
|
||||||
|
Property,
|
||||||
|
__metadata("design:type", Function)
|
||||||
|
], List.prototype, "onDragged", void 0);
|
||||||
export function list(config) {
|
export function list(config) {
|
||||||
const ret = new List;
|
const ret = new List;
|
||||||
ret.apply(config);
|
ret.apply(config);
|
||||||
|
@ -81,6 +81,15 @@ export class List extends Superview {
|
|||||||
@Property
|
@Property
|
||||||
bounces?: boolean
|
bounces?: boolean
|
||||||
|
|
||||||
|
@Property
|
||||||
|
canDrag?: boolean
|
||||||
|
|
||||||
|
@Property
|
||||||
|
onDragging?: (from: number, to: number) => void
|
||||||
|
|
||||||
|
@Property
|
||||||
|
onDragged?: (from: number, to: number) => void
|
||||||
|
|
||||||
scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean, }) {
|
scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean, }) {
|
||||||
const animated = config?.animated
|
const animated = config?.animated
|
||||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, }) as Promise<any>
|
return this.nativeChannel(context, 'scrollToItem')({ index, animated, }) as Promise<any>
|
||||||
|
Reference in New Issue
Block a user