ucbuilder
Version:
:Shree Ganeshay Namah: new way app design
75 lines • 3.21 kB
JavaScript
import { codeFileInfo, GetDeclaration } from "../build/codeFileInfo.js";
import { PathBridge } from "../build/pathBridge.js";
import { UcOptions, TptOptions } from "../common/enumAndMore.js";
import { objectOpt } from "../common/enumAndMore.js";
import { GetProject } from "../common/ipc/enumAndMore.js";
import { nodeFn } from "./nodeFn.js";
import { CssVariableHandler } from "./StylerRegs.js";
export class intenseGenerator {
static setCSS_globalVar(varList, _path) {
let rt = GetDeclaration(_path); //ProjectManage.getInfo(_path, getMetaUrl(_path, ProjectManage.projects));
//console.log(rt);
CssVariableHandler.SetCSSVarValue(varList, '' + rt.project['id'], 'g');
}
static generateUC(path, classObj, importMetaURL, pera, ...args) {
const param0 = objectOpt.copyProps(pera, UcOptions);
///console.log(path);
const prj = GetProject((importMetaURL ?? path), PathBridge.source, nodeFn.url);
const pref = prj.config.preference;
if (param0.cfInfo == undefined) {
param0.cfInfo = new codeFileInfo();
param0.cfInfo.parseUrl(path, pref.outDir, importMetaURL);
}
const toSend = [];
toSend.push(...args, param0);
const uc = (new (classObj)(...toSend));
uc['initializecomponent'](param0, uc);
if (uc['$'])
uc['$'](...args);
return uc;
}
static async generateUCAsync(path, classObj, importMetaURL, pera, ...args) {
let param0 = objectOpt.copyProps(pera, UcOptions);
// console.log(path);
// debugger;
const prj = GetProject((importMetaURL ?? path), PathBridge.source, nodeFn.url);
const pref = prj.config.preference;
if (param0.cfInfo == undefined) {
param0.cfInfo = new codeFileInfo();
param0.cfInfo.parseUrl(path, pref.outDir, importMetaURL);
}
let toSend = [];
toSend.push(...args, param0);
let uc = (new (classObj)(...toSend));
await uc['initializecomponentAsync'](param0, uc);
if (param0.events.afterInitlize != undefined)
await param0.events.afterInitlize(uc);
if (uc['$'])
await uc['$'](...args);
return uc;
}
static generateTPT(path, classObj, callerMetaUrl, pera, ...args) {
let param0 = Object.assign(pera, TptOptions);
param0.cfInfo = new codeFileInfo();
param0.cfInfo.parseUrl(path, 'out', callerMetaUrl);
let uc = (new (classObj)());
uc.extended.initializebase(param0);
uc['initializecomponent'](param0);
if (uc['$'])
uc['$'](...args);
return uc;
}
static async generateTPTAsync(path, classObj, callerMetaUrl, pera, ...args) {
let param0 = Object.assign(pera, TptOptions);
param0.cfInfo = new codeFileInfo();
param0.cfInfo.parseUrl(path, 'out', callerMetaUrl);
args.push(param0);
let uc = (new (classObj)());
uc.extended.initializebase(param0);
await uc['initializecomponentAsync'](param0);
if (uc['$'])
await uc['$'](...args);
return uc;
}
}
//# sourceMappingURL=intenseGenerator.js.map