mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
style: rax-render
This commit is contained in:
parent
a8ffb0d773
commit
00a10e8b65
@ -2,6 +2,7 @@
|
||||
node_modules
|
||||
build
|
||||
dist
|
||||
demo
|
||||
es
|
||||
lib
|
||||
.*
|
||||
|
||||
9
packages/rax-render/.eslintrc.js
Normal file
9
packages/rax-render/.eslintrc.js
Normal file
@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
extends: 'eslint-config-ali/typescript/react',
|
||||
rules: {
|
||||
'no-proto': 1,
|
||||
'no-new-func': 1,
|
||||
'no-shadow': 1,
|
||||
'@typescript-eslint/no-unused-vars': 1,
|
||||
}
|
||||
}
|
||||
@ -43,6 +43,7 @@ export default class BaseEngine extends Component {
|
||||
messages: PropTypes.object,
|
||||
__appHelper: PropTypes.object,
|
||||
__components: PropTypes.object,
|
||||
// eslint-disable-next-line react/no-unused-prop-types
|
||||
__componentsMap: PropTypes.object,
|
||||
__ctx: PropTypes.object,
|
||||
__schema: PropTypes.object,
|
||||
@ -293,7 +294,6 @@ export default class BaseEngine extends Component {
|
||||
__schema: schema,
|
||||
__appHelper: appHelper,
|
||||
__components: components,
|
||||
// __componentsMap: componentsMap,
|
||||
}
|
||||
: {};
|
||||
if (engine && engine.props.designMode) {
|
||||
@ -334,9 +334,8 @@ export default class BaseEngine extends Component {
|
||||
}
|
||||
props.__id = schema.id;
|
||||
|
||||
let Child = null;
|
||||
if (!isFileSchema(schema) && schema.children) {
|
||||
Child = this.__createVirtualDom(
|
||||
this.__createVirtualDom(
|
||||
isJSExpression(schema.children) ? parseExpression(schema.children, self) : schema.children,
|
||||
self,
|
||||
{
|
||||
@ -460,7 +459,7 @@ export default class BaseEngine extends Component {
|
||||
return checkProps(function () {
|
||||
const args = {};
|
||||
if (Array.isArray(params) && params.length) {
|
||||
params.map((item, idx) => {
|
||||
params.forEach((item, idx) => {
|
||||
if (typeof item === 'string') {
|
||||
args[item] = arguments[idx];
|
||||
} else if (item && typeof item === 'object') {
|
||||
|
||||
@ -61,7 +61,7 @@ export default class CompEngine extends BaseEngine {
|
||||
debug(`comp.componentWillUnmount - ${this.props.__schema.fileName}`);
|
||||
}
|
||||
|
||||
async componentDidCatch(e) {
|
||||
async componentDidCatch() {
|
||||
super.componentDidCatch(...arguments);
|
||||
debug(`comp.componentDidCatch - ${this.props.__schema.fileName}`);
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ export default class PageEngine extends BaseEngine {
|
||||
debug(`page.render - ${__schema.fileName}`);
|
||||
|
||||
const {
|
||||
id, className, style, autoLoading, defaultHeight = 300, loading,
|
||||
id, className, style,
|
||||
} = this.__parseData(__schema.props);
|
||||
|
||||
const { Page } = __components;
|
||||
@ -89,9 +89,6 @@ export default class PageEngine extends BaseEngine {
|
||||
<AppContext.Consumer>
|
||||
{(context) => {
|
||||
this.context = context;
|
||||
{
|
||||
/* this.__generateCtx(currCtx); */
|
||||
}
|
||||
this.__render();
|
||||
return (
|
||||
<AppContext.Provider
|
||||
|
||||
@ -40,7 +40,7 @@ export default class TempEngine extends BaseEngine {
|
||||
debug(`temp.componentDidMount - ${this.props.__schema.fileName}`);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState, snapshot) {
|
||||
componentDidUpdate() {
|
||||
debug(`temp.componentDidUpdate - ${this.props.__schema.fileName}`);
|
||||
}
|
||||
|
||||
|
||||
@ -4,10 +4,6 @@ import { createElement, Component } from 'rax';
|
||||
|
||||
export default function (Comp) {
|
||||
return class CompWrapper extends Component {
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
}
|
||||
|
||||
render() {
|
||||
return createElement(Comp, {
|
||||
...this.props,
|
||||
|
||||
@ -159,7 +159,7 @@ export default class DataHelper {
|
||||
const afterRequest = this.appHelper && this.appHelper.utils && this.appHelper.utils.afterRequest;
|
||||
const csrfInput = document.getElementById('_csrf_token');
|
||||
const _tb_token_ = csrfInput && csrfInput.value;
|
||||
asyncDataList.map(req => {
|
||||
asyncDataList.forEach(req => {
|
||||
const { id, type, options } = req;
|
||||
if (!id || !type) return;
|
||||
if (type === 'doServer') {
|
||||
@ -272,6 +272,7 @@ export default class DataHelper {
|
||||
}
|
||||
|
||||
fetchOne(type, options) {
|
||||
// eslint-disable-next-line prefer-const
|
||||
let { uri, method = 'GET', headers, params, ...otherProps } = options;
|
||||
otherProps = otherProps || {};
|
||||
switch (type) {
|
||||
|
||||
@ -50,8 +50,6 @@ const EXPRESSION_TYPE = {
|
||||
JSSLOT: 'JSSlot',
|
||||
};
|
||||
const EXPRESSION_REG = /^\{\{(\{.*\}|.*?)\}\}$/;
|
||||
const hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
||||
const REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
||||
const debug = Debug('utils:index');
|
||||
|
||||
const ENV = {
|
||||
@ -180,6 +178,7 @@ export function fillObj(receiver = {}, ...suppliers) {
|
||||
|
||||
// 中划线转驼峰
|
||||
export function toHump(name) {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
return name.replace(/\-(\w)/g, (all, letter) => letter.toUpperCase());
|
||||
}
|
||||
// 驼峰转中划线
|
||||
@ -525,7 +524,7 @@ export function addCssTag(id, content) {
|
||||
|
||||
// 注册快捷
|
||||
export function registShortCuts(config, appHelper) {
|
||||
const keyboardFilter = (keymaster.filter = (event) => {
|
||||
keymaster.filter = (event) => {
|
||||
const eTarget = event.target || event.srcElement;
|
||||
const { tagName } = eTarget;
|
||||
const isInput = !!(tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA');
|
||||
@ -541,7 +540,8 @@ export function registShortCuts(config, appHelper) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
const keyboardFilter = keymaster.filter;
|
||||
|
||||
const ideMessage = appHelper.utils && appHelper.utils.ideMessage;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user