This commit is contained in:
pengfei.zhou 2019-12-21 23:37:21 +08:00
parent 20ea0841bc
commit d0f1320656
27 changed files with 175 additions and 395 deletions

392
dist/Counter.js vendored
View File

@ -1,392 +0,0 @@
'use strict';
var doric = require('doric');
const colors = [
"#70a1ff",
"#7bed9f",
"#ff6b81",
"#a4b0be",
"#f0932b",
"#eb4d4b",
"#6ab04c",
"#e056fd",
"#686de0",
"#30336b",
].map(e => doric.Color.parse(e));
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
function box(idx = 0) {
return (new doric.Stack).also(it => {
it.width = it.height = 20;
it.backgroundColor = colors[idx || 0];
});
}
function label(str) {
return doric.text({
text: str,
textSize: 16,
});
}
let EffectsDemo = class EffectsDemo extends doric.Panel {
build(rootView) {
doric.scroller(doric.vlayout([
doric.hlayout([
doric.vlayout([
label("Origin view"),
box().apply({
width: 100,
height: 100
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Border"),
box().apply({
width: 100,
height: 100,
border: {
width: 5,
color: colors[3]
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Corner"),
box().apply({
width: 100,
height: 100,
corners: 10,
layoutConfig: doric.layoutConfig().just().configMargin({
bottom: 10
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Shadow"),
box().apply({
width: 100,
height: 100,
shadow: {
opacity: 1,
color: colors[1],
offsetX: 3,
offsetY: 3,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
bottom: 10
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
]).apply({ space: 20 }),
doric.hlayout([
doric.vlayout([
label("Border,Corner"),
box().apply({
width: 100,
height: 100,
border: {
width: 5,
color: colors[3]
},
corners: 10,
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Border,Shadow"),
box().apply({
width: 100,
height: 100,
border: {
width: 5,
color: colors[3]
},
shadow: {
opacity: 1,
color: colors[1],
offsetX: 3,
offsetY: 3,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
bottom: 10
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Corner,Shadow"),
box().apply({
width: 100,
height: 100,
corners: 10,
shadow: {
opacity: 1,
color: colors[1],
offsetX: 3,
offsetY: 3,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
bottom: 10
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Border,Corner,Shadow"),
box().apply({
width: 100,
height: 100,
border: {
width: 5,
color: colors[3]
},
corners: 10,
shadow: {
opacity: 1,
color: colors[1],
offsetX: 3,
offsetY: 3,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
]).apply({ space: 20 }),
doric.hlayout([
doric.vlayout([
label("Shadow"),
box().apply({
width: 100,
height: 100,
corners: 50,
shadow: {
opacity: 1,
color: colors[1],
offsetX: 0,
offsetY: 0,
radius: 10,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 10,
right: 10,
bottom: 10,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Shadow,offset"),
box().apply({
width: 100,
height: 100,
corners: 50,
shadow: {
opacity: 1,
color: colors[1],
offsetX: 5,
offsetY: 5,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 10,
right: 10,
bottom: 10,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Shadow,opacity"),
box().apply({
width: 100,
height: 100,
corners: 50,
shadow: {
opacity: 0.5,
color: colors[1],
offsetX: 5,
offsetY: 5,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 10,
right: 10,
bottom: 10,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Shadow,color"),
box().apply({
width: 100,
height: 100,
corners: 50,
shadow: {
opacity: 1,
color: colors[2],
offsetX: 5,
offsetY: 5,
radius: 5,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 10,
right: 10,
bottom: 10,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
]).apply({ space: 20 }),
doric.hlayout([
doric.vlayout([
label("Corner round"),
box().apply({
width: 100,
height: 100,
corners: 50,
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Corner left top"),
box().apply({
width: 100,
height: 100,
corners: {
leftTop: 50,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Corner right top"),
box().apply({
width: 100,
height: 100,
corners: {
rightTop: 50,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Corner left bottom"),
box().apply({
width: 100,
height: 100,
corners: {
leftBottom: 50,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
doric.vlayout([
label("Corner right bottom"),
box().apply({
width: 100,
height: 100,
corners: {
rightBottom: 50,
},
layoutConfig: doric.layoutConfig().just().configMargin({
left: 5,
right: 5,
bottom: 5,
})
}),
]).apply({
gravity: doric.Gravity.Center,
space: 10,
}),
]).apply({ space: 20 }),
]).also(it => {
it.space = 20;
})).also(it => {
it.layoutConfig = doric.layoutConfig().most();
}).in(rootView);
}
};
EffectsDemo = __decorate([
Entry
], EffectsDemo);
//# sourceMappingURL=EffectsDemo.js.map

1
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

140
doric-h5/dist/Counter.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -4276,9 +4276,17 @@ return __module.exports;
}
}
var ScaleType;
(function (ScaleType) {
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
})(ScaleType || (ScaleType = {}));
class DoricImageNode extends DoricViewNode {
build() {
return document.createElement('img');
const ret = document.createElement('img');
ret.style.objectFit = "fill";
return ret;
}
blendProps(v, propName, prop) {
switch (propName) {
@ -4290,9 +4298,33 @@ return __module.exports;
break;
case 'loadCallback':
v.onload = () => {
this.callJSResponse(prop);
this.callJSResponse(prop, {
width: v.width,
height: v.height
});
};
break;
case 'scaleType':
switch (prop) {
case ScaleType.ScaleToFill:
v.style.objectFit = "fill";
break;
case ScaleType.ScaleAspectFit:
v.style.objectFit = "contain";
break;
case ScaleType.ScaleAspectFill:
v.style.objectFit = "cover";
break;
}
break;
case 'isBlur':
if (prop) {
v.style.filter = 'blur(10px)';
}
else {
v.style.filter = '';
}
break;
default:
super.blendProps(v, propName, prop);
break;

1
doric-h5/dist/index.js.map vendored Normal file

File diff suppressed because one or more lines are too long