uc-dev 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +79 -0
  3. package/out/cli.js +8162 -0
  4. package/out/lib/processes/templates/js.tpt.code +7 -0
  5. package/out/lib/processes/templates/js.tpt.designer +101 -0
  6. package/out/lib/processes/templates/js.tpt.style +36 -0
  7. package/out/lib/processes/templates/js.uc.code +15 -0
  8. package/out/lib/processes/templates/js.uc.designer +103 -0
  9. package/out/lib/processes/templates/js.uc.style +5 -0
  10. package/out/lib/processes/templates/t.resources +26 -0
  11. package/out/lib/processes/templates/ts.resources +55 -0
  12. package/out/lib/processes/templates/ts.tpt.code +7 -0
  13. package/out/lib/processes/templates/ts.tpt.designer +77 -0
  14. package/out/lib/processes/templates/ts.tpt.dynamic +12 -0
  15. package/out/lib/processes/templates/ts.tpt.style +36 -0
  16. package/out/lib/processes/templates/ts.uc.code +10 -0
  17. package/out/lib/processes/templates/ts.uc.designer +89 -0
  18. package/out/lib/processes/templates/ts.uc.dynamic +12 -0
  19. package/out/lib/processes/templates/ts.uc.dynamicByHtml +16 -0
  20. package/out/lib/processes/templates/ts.uc.style +5 -0
  21. package/out/utils/inquiry/templates/.vscode/json.settings +17 -0
  22. package/out/utils/inquiry/templates/electron/html.renderer +11 -0
  23. package/out/utils/inquiry/templates/electron/sample1/form.uc.html.tp +54 -0
  24. package/out/utils/inquiry/templates/electron/sample1/form.uc.scss.tp +95 -0
  25. package/out/utils/inquiry/templates/electron/ts.main +44 -0
  26. package/out/utils/inquiry/templates/electron/ts.preload +3 -0
  27. package/out/utils/inquiry/templates/electron/ts.renderer +5 -0
  28. package/out/utils/inquiry/templates/electron/ts.resx +50 -0
  29. package/out/utils/inquiry/templates/js.ucconfig +108 -0
  30. package/out/utils/inquiry/templates/typescript/json.tsconfig +39 -0
  31. package/package.json +36 -0
@@ -0,0 +1,7 @@
1
+ import { <?=designer.className?> } from '<?=src.designer.rootPathSkippingExtension?>';
2
+ export class <?=codefile.className?> extends <?=designer.className?> {
3
+ constructor() {
4
+ super(arguments);
5
+
6
+ }
7
+ }
@@ -0,0 +1,101 @@
1
+ <?php let designer = sources.ts_tpt.designer; ?>
2
+ <?php for(let i=0;i<designer.importer.classes.length;i++){ let $rw=designer.importer.classes[i];
3
+ ?>import { <?= $rw.names.map(s=>s.asText).join(',') ?> } from "<?=$rw.url?>";
4
+ <?php } ?>
5
+ <?php
6
+ const $templates = designer.templetes;
7
+ ?>
8
+
9
+
10
+ <?php $templates.forEach($tpt=>{ ?>
11
+ /**
12
+ * @typedef <?=$tpt.name?>$ElementMAP
13
+ <?php for(let i=0;i<$tpt.controls.length;i++){ let $rw=$tpt.controls[i]; ?>
14
+ * @prop {<?=$rw.proto?><?=$rw.generic?>} <?=$rw.nameQT?>
15
+ <?php } ?>
16
+ */
17
+
18
+ class <?=$tpt.name?>$TemplateNode extends TemplateNode{
19
+ /**
20
+ * @param {Template} tpt
21
+ */
22
+ constructor(tpt) { super(tpt); }
23
+ /**
24
+ * @param {HTMLElement} elementHT
25
+ * @returns {<?=$tpt.name?>$ElementMAP}
26
+ */
27
+ getAllControls(elementHT) {
28
+ return this.extended.getAllControls(undefined,elementHT);
29
+ }
30
+ }
31
+ <?php }); ?>
32
+
33
+
34
+ /**
35
+ * @typedef dMap_<?=src.name?>
36
+ <?php $templates.forEach($tpt=>{ ?>
37
+ * @prop {<?=$tpt.name?>$ElementMAP} <?=$tpt.name?>
38
+ <?php }); ?>
39
+ */
40
+ /** @type {dMap_<?=src.name?>} */
41
+ export const cMap_<?=src.name?>= {};
42
+
43
+ export class <?=designer.className ?> extends <?= designer.baseClassName ?> {
44
+ <?php $templates.forEach($tpt=>{ ?>
45
+ /** @<?=$rw.scope?> @type {<?=$tpt.name?>$TemplateNode} */
46
+ <?=$tpt.name?>;
47
+ <?php }); ?>
48
+
49
+ <?php _DESIGNER(false); ?>
50
+
51
+ <?php _DESIGNER(true); ?>
52
+ }
53
+
54
+ <?php
55
+ function _DESIGNER(isAsync = false){
56
+ $initializecomponent = isAsync ? 'initializecomponentAsync':'initializecomponent';
57
+ $generateTPT = isAsync ? 'generateTPTAsync':'generateTPT';
58
+ $Create = isAsync ? 'CreateAsync':'Create';
59
+ $async = isAsync ? ' async ':'';
60
+ $await = isAsync ? ' await ':'';
61
+ ?>
62
+ /**
63
+ * @param {ITptOptions} pera
64
+ * @returns {<?=src.name?>}
65
+ */
66
+ static <?= $async ?> <?= $Create ?>(pera) {
67
+ return <?= $await ?> intenseGenerator.<?= $generateTPT ?>(<?=src.name?>, pera);
68
+ }
69
+ /**
70
+ * @param {ITptOptions} fargs
71
+ */
72
+ <?=$initializecomponent ?> = <?= $async ?> (fargs) => {
73
+ if(fargs.MakeEmptyTemplate)return;
74
+ fargs.guid = "<?= designer.cssGuid ?>";
75
+ fargs.htmlContent = ResourceManage.getContent("<?= designer.htmlGuid ?>");
76
+ fargs.cssContent = ResourceManage.getContent("<?= designer.cssGuid ?>");
77
+
78
+
79
+
80
+ this.extended.initializebase(fargs);
81
+ let oot = this.extended.resource;
82
+ let tpts = oot.templates;
83
+
84
+ <?php $templates.forEach($tpt=>{ ?>
85
+ this.<?=$tpt.name ?> = new <?=$tpt.name ?>$TemplateNode(this);
86
+ tpts.<?=$tpt.name ?>.accessKey = '<?=$tpt.name ?>';
87
+ tpts.<?=$tpt.name ?>.objectKey = `${fargs.guid}#<?=$tpt.name ?>`;
88
+ this.<?=$tpt.name ?>.extended.initializecomponent(fargs,tpts.<?=$tpt.name ?>);
89
+ this.<?=$tpt.name?>.extended.takeoff();
90
+ <?php }); ?>
91
+
92
+ if (oot.outerCssContents.trim() != '')
93
+ this.pushTemplateCss(oot.outerCssContents,fargs.guid);
94
+
95
+ delete this.initializecomponent;
96
+ delete this.initializecomponentAsync;
97
+ delete this.extended.initializebase;
98
+ }
99
+ <?php
100
+ }
101
+ ?>
@@ -0,0 +1,36 @@
1
+ #header{
2
+
3
+ }
4
+ #primary{
5
+
6
+ }
7
+ #footer{
8
+
9
+ }
10
+
11
+ /* USAGE
12
+ // COMMON FOR ALL
13
+ &{
14
+ overflow: hidden; height: max-content;
15
+ display:block;
16
+ }
17
+
18
+ // HEADER TEMPLATE STYLES
19
+ #header{
20
+ & { background-color: green; }
21
+ item b { color: yellow; .... }
22
+ ...
23
+ }
24
+ // PRIMARY TEMPLATE STYLES
25
+ #primary{
26
+ & { background-color: green; }
27
+ item b { color: yellow; .... }
28
+ ...
29
+ }
30
+ // FOOTER TEMPLATE STYLES
31
+ #footer{
32
+ & { background-color: green; }
33
+ item b { color: yellow; .... }
34
+ ...
35
+ }
36
+ */
@@ -0,0 +1,15 @@
1
+ import { <?=designer.className?> } from '<?=designerFilePath?>';
2
+ export class <?=codefile.className?> extends <?=designer.className?>{
3
+ /*constructor() { super(); this.initializecomponent(arguments, this); }*/
4
+ /**
5
+ * USE
6
+ * $(params){
7
+ * //...
8
+ * } METHOD TO DECLARE YOUR `constructor`
9
+ * THIS METHOD CALLED AFTER COMPLETE INITIALIZATION WITH ARGUMENTS PASSED in static `Create` Method
10
+ */
11
+ async $(){
12
+
13
+ }
14
+ }
15
+
@@ -0,0 +1,103 @@
1
+ <?php const $designer = sources.ts_uc.designer; ?>
2
+ <?php $designer.importer.classes.forEach($rw=>{
3
+ ?> import { <?= $rw.names.map(s=>s.asText).join(',') ?> } from "<?=$rw.url?>";
4
+ <?php }); ?>
5
+
6
+ export class <?=$designer.className ?> extends <?= $designer.baseClassName ?> {
7
+ /**
8
+ * @param {<?=$designer.getterFunk ?>} id
9
+ **/
10
+ get(id) {
11
+ return this.ucExtends.find(`[id="${id}"]`)[0];
12
+ }
13
+ <?php $designer.controls.forEach($rw => {
14
+ switch($rw.type){
15
+ case "none": ?>
16
+ /** @<?=$rw.scope?> @type {<?=$rw.proto?><?=$rw.generic?>} */
17
+ <?=$rw.nameQT?>;<?php
18
+ break;
19
+ case ".tpt": ?>
20
+ /** @<?=$rw.scope?> @type {import('<?=$rw.codeFilePath?>').<?=$rw.src.name?>} */
21
+ <?=$rw.nameQT?>; <?php
22
+ break;
23
+ case ".uc": ?>
24
+ /** @<?=$rw.scope?> @type {import('<?=$rw.codeFilePath?>').<?=$rw.src.name?>} */
25
+ <?=$rw.nameQT?>; <?php
26
+ break;
27
+ }
28
+ }); ?>
29
+
30
+ constructor(){ super(); }
31
+
32
+ <?php _DESIGNER(false) ?>
33
+
34
+ <?php _DESIGNER(true) ?>
35
+ }
36
+
37
+ <?php
38
+ function _DESIGNER(isAsync = false){
39
+ $initializecomponent = isAsync ? 'initializecomponentAsync':'initializecomponent';
40
+ $generateUC = isAsync ? 'generateUCAsync':'generateUC';
41
+ $Create = isAsync ? 'CreateAsync':'Create';
42
+ $async = isAsync ? ' async ':'';
43
+ $await = isAsync ? ' await ':'';
44
+ ?>
45
+ /**
46
+ * Creates <?=$designer.className ?>.
47
+ * @param {IUcOptions} pera
48
+ * @param {any[]} args
49
+ * @returns {<?=src.name?>}
50
+ */
51
+ static <?= $async ?> <?= $Create ?>(pera, ...args) {
52
+ return (<?= $await ?> intenseGenerator.<?= $generateUC ?>(<?=src.name ?>, pera, ...args));
53
+ }
54
+ /**
55
+ * Initializes component
56
+ * This method deletes itself after first execution.
57
+ * @param {IUcOptions} args
58
+ * @param {<?=src.name?>} form
59
+ */
60
+ <?= $async ?> <?= $initializecomponent ?>(args, form){
61
+ const ucExt = this.ucExtends;
62
+ args.guid = "<?= $designer.guid ?>";
63
+ args.htmlContent = ResourceManage.getContent("<?= $designer.htmlGuid ?>");
64
+ args.cssContent = ResourceManage.getContent("<?= $designer.cssGuid ?>");
65
+
66
+ ucExt.initializecomponent(args);
67
+ const CONTROLS = ucExt.controls;
68
+
69
+ <?php $designer.controls.forEach($rw => {
70
+ switch($rw.type){ ?>
71
+ <?php case "none": ?>
72
+ this<?=$rw.nameThis?> = CONTROLS<?=$rw.nameThis?>;<?php break; ?>
73
+ <?php case ".tpt": ?>
74
+
75
+ this<?=$rw.nameThis ?> =<?= $await ?> <?=$rw.importedClassName?>.<?= $Create ?>({
76
+ parentUc: this,
77
+ accessName:"<?=$rw.name?>" ,
78
+ elementHT :CONTROLS<?=$rw.nameThis?>
79
+ });
80
+ <?php break; ?>
81
+ <?php case ".uc": ?>
82
+
83
+ this<?=$rw.nameThis?> =<?= $await ?> <?=$rw.importedClassName?>.<?= $Create ?>({
84
+ parentUc : this,
85
+ mode:args.mode,
86
+ accessName:"<?=$rw.name?>" ,
87
+ targetElement : CONTROLS<?=$rw.nameThis?>
88
+ });
89
+ this<?=$rw.nameThis ?>.ucExtends.show({decision : 'replace'});
90
+ <?php break;
91
+ }
92
+ });
93
+ ?>
94
+
95
+ if(args.events?.beforeFinalize!=undefined) args.events?.beforeFinalize(form);
96
+ ucExt.finalizeInit(args);
97
+ delete this.initializecomponent;
98
+ delete this.initializecomponentAsync;
99
+ ucExt.takeoff();
100
+ }
101
+
102
+ <?php }
103
+ ?>
@@ -0,0 +1,5 @@
1
+ &{
2
+ position: absolute; display:block; height: max-content; width: max-content;
3
+ background-color: white;
4
+ border:solid 1px black;
5
+ }
@@ -0,0 +1,26 @@
1
+ import { Assembly } from "<?= importPath ?>";
2
+ declare module "<?= declareClassPath ?>" {
3
+ export interface ResourceNamedRegistry{
4
+ <?php
5
+ const onlyAlias = resources.filter(s => s.name && s.name != "");
6
+ for (const res of onlyAlias) { ?>
7
+ <?= res.name ?> : <?= res.source ?>,
8
+ <?php } ?>
9
+ }
10
+
11
+ export interface TPPackage {
12
+ <?php for (const [pkg,vers] of Object.entries(PACKAGE_LIST)) { ?>
13
+ "<?= pkg ?>": "", <?php
14
+ } ?>
15
+ }
16
+
17
+
18
+ export interface AssemblyRegistry{
19
+ <?= mainProject.name ?> : Assembly
20
+ }
21
+ export interface ResourceKeyRegistry {
22
+ <?php for (const res of resources) { ?>
23
+ <?= res.guid ?>: <?= res.source ?>,
24
+ <?php } ?>
25
+ }
26
+ }
@@ -0,0 +1,55 @@
1
+ import { UserResource, ResourceStorage, Assembly, AssemblyManager } from "<?= importPath ?>";
2
+
3
+ declare module "<?= declareClassPath ?>" {
4
+ export interface ResourceNamedRegistry{
5
+ <?php
6
+ const onlyAlias = resources.filter(s => s.name && s.name != "");
7
+ for (const res of onlyAlias) { ?>
8
+ <?= res.name ?> : <?= res.source ?>,
9
+ <?php } ?>
10
+ }
11
+
12
+ export interface TPPackage {
13
+ <?php for (const [pkg,vers] of Object.entries(PACKAGE_LIST)) { ?>
14
+ "<?= pkg ?>": "", <?php
15
+ } ?>
16
+ }
17
+
18
+
19
+ export interface AssemblyRegistry{
20
+ <?= mainProject.name ?> : Assembly
21
+ }
22
+ export interface ResourceKeyRegistry {
23
+ <?php for (const res of resources) { ?>
24
+ <?= res.guid ?>: <?= res.source ?>,
25
+ <?php } ?>
26
+ }
27
+ }
28
+ const Resources:UserResource[] = [
29
+ <?php for (const res of resources) { ?>
30
+ { guid: <?= res.guid ?>, <?php
31
+ if(res.isGlobalCss === true){ ?> isGlobalCss : true, <?php }
32
+ if(res.name && res.name!=''){ ?> name : <?= res.name ?>, <?php }
33
+
34
+ ?> project: "<?= res.project ?>", source: <?= res.source ?>, type: "<?= res.type ?>", encrypt:<?= res.encrypt ?>, content: <?= res.content ?> }, <?php } ?>
35
+ ];
36
+ ResourceStorage.bulkRegister(Resources);
37
+
38
+ ResourceStorage.RuntimeProps['importmap'] = ResourceStorage.RuntimeProps['importmap'] ?? ResourceStorage.getContent("<?= mainProject.importMapGuid ?>");
39
+ <?php if(mainProject.mainHtmlGuid!=undefined){ ?>
40
+ ResourceStorage.RuntimeProps['htmlcontent'] = ResourceStorage.RuntimeProps['htmlcontent'] ?? ResourceStorage.getContent("<?= mainProject.mainHtmlGuid ?>");
41
+ <?php } ?>
42
+
43
+ <?php
44
+ for (const res of projectList) {
45
+ if (res.importResource == true) { ?>
46
+ await import(<?= res.resourceRelativePath ?>);<?php
47
+ }
48
+ } ?>
49
+
50
+ AssemblyManager.Register({
51
+ name: <?= mainProject.name ?>,
52
+ guid: "<?= mainProject.guid ?>",
53
+ cssGuid: <?= mainProject.cssGuid ?>,
54
+ ucConfigGuid: <?= mainProject.ucConfigGuid ?>
55
+ });
@@ -0,0 +1,7 @@
1
+ import { <?=designer.className?> } from '<?=designerFilePath?>';
2
+ export class <?=codefile.className?> extends <?=designer.className?> {
3
+ constructor() {
4
+ super(arguments);
5
+
6
+ }
7
+ }
@@ -0,0 +1,77 @@
1
+ <?php let designer = sources.ts_tpt.designer; ?>
2
+ <?php for(let i=0;i<designer.importer.classes.length;i++){ let $rw=designer.importer.classes[i];
3
+ ?>import { <?= $rw.names.map(s=>s.asText).join(',') ?> } from "<?=$rw.url?>";
4
+ <?php } ?>
5
+ <?php
6
+ const $templates = designer.templetes;
7
+ ?>
8
+
9
+
10
+ <?php $templates.forEach($tpt=>{ ?>
11
+ type <?=$tpt.name?>$ElementMAP = { <?php for(let i=0;i<$tpt.controls.length;i++){ let $rw=$tpt.controls[i]; ?>
12
+ <?=$rw.nameQT?> : <?=$rw.proto?><?=$rw.generic?>,<?php } ?>}
13
+ class <?=$tpt.name?>$TemplateNode extends TemplateNode{
14
+ constructor(tpt:Template) { super(tpt); }
15
+
16
+ getAllControls(elementHT?: HTMLElement) {
17
+ return this.extended.getAllControls(undefined,elementHT) as <?=$tpt.name?>$ElementMAP;
18
+ }
19
+ }
20
+ <?php }); ?>
21
+
22
+ export const cMap_<?=src.name?>: {
23
+ <?php $templates.forEach($tpt=>{ ?>
24
+ <?=$tpt.name?>?: <?=$tpt.name?>$ElementMAP;
25
+ <?php }); ?>
26
+ } = {};
27
+
28
+ export class <?=designer.className ?> extends <?= designer.baseClassName ?> {
29
+
30
+ <?php $templates.forEach($tpt=>{
31
+ ?> public&nbsp;<?=$tpt.name?>:<?=$tpt.name?>$TemplateNode;
32
+ <?php }); ?>
33
+
34
+ <?php _DESIGNER(false); ?>
35
+
36
+ <?php _DESIGNER(true); ?>
37
+ }
38
+
39
+ <?php
40
+ function _DESIGNER(isAsync = false){
41
+ $initializecomponent = isAsync ? 'initializecomponentAsync':'initializecomponent';
42
+ $generateTPT = isAsync ? 'generateTPTAsync':'generateTPT';
43
+ $Create = isAsync ? 'CreateAsync':'Create';
44
+ $async = isAsync ? ' async ':'';
45
+ $await = isAsync ? ' await ':'';
46
+ ?>
47
+ static <?= $async ?> <?= $Create ?>(pera: ITptOptions) {
48
+ return <?= $await ?> intenseGenerator.<?= $generateTPT ?>(<?=src.name?>, pera) as <?=src.name?>;
49
+ }
50
+ <?=$initializecomponent ?>? = <?= $async ?> (fargs:ITptOptions) => {
51
+ if(fargs.MakeEmptyTemplate)return;
52
+ fargs.guid = "<?= designer.guid ?>";
53
+ fargs.htmlContent = ResourceManage.getContent("<?= designer.htmlGuid ?>");
54
+ fargs.cssContent = ResourceManage.getContent("<?= designer.cssGuid ?>");
55
+
56
+ this.extended.initializebase(fargs);
57
+ let oot = this.extended.resource;
58
+ let tpts = oot.templates;
59
+
60
+ <?php $templates.forEach($tpt=>{ ?>
61
+ this.<?=$tpt.name ?> = new <?=$tpt.name ?>$TemplateNode(this);
62
+ tpts.<?=$tpt.name ?>.accessKey = '<?=$tpt.name ?>';
63
+ tpts.<?=$tpt.name ?>.objectKey = `${fargs.guid}#<?=$tpt.name ?>`;
64
+ this.<?=$tpt.name ?>.extended.initializecomponent(fargs,tpts.<?=$tpt.name ?>);
65
+ this.<?=$tpt.name?>.extended.takeoff();
66
+ <?php }); ?>
67
+
68
+ if (oot.outerCssContents.trim() != '')
69
+ this.pushTemplateCss(oot.outerCssContents,fargs.guid as any);
70
+
71
+ delete this.initializecomponent;
72
+ delete this.initializecomponentAsync;
73
+ delete this.extended.initializebase;
74
+ }
75
+ <?php
76
+ }
77
+ ?>
@@ -0,0 +1,12 @@
1
+ import { HTMLx } from "uc-control/out/lib/WrapperHelper.js";
2
+ export default function () {
3
+ let fcontent =
4
+ HTMLx.Wrapper([{
5
+ "x-caption": 'Form',
6
+ "<childs>": [
7
+
8
+ ]
9
+ }],
10
+ );
11
+ return fcontent;
12
+ }
@@ -0,0 +1,36 @@
1
+ #header{
2
+
3
+ }
4
+ #primary{
5
+
6
+ }
7
+ #footer{
8
+
9
+ }
10
+
11
+ /* USAGE
12
+ // COMMON FOR ALL
13
+ &{
14
+ overflow: hidden; height: max-content;
15
+ display:block;
16
+ }
17
+
18
+ // HEADER TEMPLATE STYLES
19
+ #header{
20
+ & { background-color: green; }
21
+ item b { color: yellow; .... }
22
+ ...
23
+ }
24
+ // PRIMARY TEMPLATE STYLES
25
+ #primary{
26
+ & { background-color: green; }
27
+ item b { color: yellow; .... }
28
+ ...
29
+ }
30
+ // FOOTER TEMPLATE STYLES
31
+ #footer{
32
+ & { background-color: green; }
33
+ item b { color: yellow; .... }
34
+ ...
35
+ }
36
+ */
@@ -0,0 +1,10 @@
1
+ <?php let code = sources.ts_uc.code; ?>
2
+ import { <?=code.designerClassName?> } from '<?=code.designerFilePath?>';
3
+ export class <?=code.className?> extends <?=code.designerClassName?>{
4
+ /**
5
+ * CALLED AFTER COMPLETE INITIALIZATION WITH ARGUMENTS PASSED in static `Create` Method
6
+ */
7
+ async $() { // USE THIS METHOD TO DECLARE YOUR `constructor`
8
+
9
+ }
10
+ }
@@ -0,0 +1,89 @@
1
+ <?php const $designer = sources.ts_uc.designer; ?>
2
+ <?php $designer.importer.classes.forEach($rw=>{
3
+ ?> import { <?= $rw.names.map(s=>s.asText).join(',') ?> } from "<?=$rw.url?>";
4
+ <?php }); ?>
5
+
6
+ export class <?=$designer.className ?> extends <?= $designer.baseClassName ?> {
7
+
8
+ get(id:<?=$designer.getterFunk ?>) {
9
+ return this.ucExtends.find(`[id="${id}"]`)[0];
10
+ }
11
+ <?php $designer.controls.forEach($rw => {
12
+ switch($rw.type){
13
+ case "none": ?>
14
+ <?=$rw.scope?>&nbsp;<?=$rw.nameQT?>!: <?=$rw.proto?><?=$rw.generic?>;
15
+ <?php break;
16
+ case ".tpt": ?>
17
+ <?=$rw.scope?>&nbsp;<?=$rw.nameQT?>!: import('<?=$rw.codeFilePath?>').<?=$rw.src.name?>;
18
+ <?php break;
19
+ case ".uc": ?>
20
+ <?=$rw.scope?>&nbsp;<?=$rw.nameQT?>!: import('<?=$rw.codeFilePath?>').<?=$rw.src.name?>;
21
+ <?php break;
22
+ }
23
+ }); ?>
24
+
25
+ constructor(){ super(); }
26
+
27
+ <?php _DESIGNER(false) ?>
28
+
29
+ <?php _DESIGNER(true) ?>
30
+ }
31
+
32
+ <?php
33
+ function _DESIGNER(isAsync = false){
34
+ $initializecomponent = isAsync ? 'initializecomponentAsync':'initializecomponent';
35
+ $generateUC = isAsync ? 'generateUCAsync':'generateUC';
36
+ $Create = isAsync ? 'CreateAsync':'Create';
37
+ $async = isAsync ? ' async ':'';
38
+ $await = isAsync ? ' await ':'';
39
+ ?>
40
+
41
+ static <?= $async ?> <?= $Create ?>(pera: IUcOptions, ...args: any[]) {
42
+ return (<?= $await ?> intenseGenerator.<?= $generateUC ?>(<?=src.name ?>, pera, ...args)) as <?=src.name?>;
43
+ }
44
+
45
+ <?= $async ?> <?= $initializecomponent ?>?(args: IUcOptions, form: <?=src.name?>){
46
+ const ucExt = this.ucExtends;
47
+ args.guid = "<?= $designer.guid ?>";
48
+ args.htmlContent = ResourceManage.getContent("<?= $designer.htmlGuid ?>");
49
+ args.cssContent = ResourceManage.getContent("<?= $designer.cssGuid ?>");
50
+
51
+ ucExt.initializecomponent(args);
52
+ const CONTROLS = ucExt.controls;
53
+
54
+ <?php $designer.controls.forEach($rw => {
55
+ switch($rw.type){ ?>
56
+ <?php case "none": ?>
57
+ this<?=$rw.nameThis?> = CONTROLS<?=$rw.nameThis?> as unknown as <?=$rw.proto?>;<?php break; ?>
58
+ <?php case ".tpt": ?>
59
+
60
+ this<?=$rw.nameThis ?> =<?= $await ?> <?=$rw.importedClassName?>.<?= $Create ?>({
61
+ parentUc: this,
62
+ accessName:"<?=$rw.name?>" ,
63
+ elementHT :CONTROLS<?=$rw.nameThis?> as any
64
+ });
65
+ <?php break; ?>
66
+ <?php case ".uc": ?>
67
+
68
+ this<?=$rw.nameThis?> =<?= $await ?> <?=$rw.importedClassName?>.<?= $Create ?>({
69
+ parentUc : this,
70
+ mode:args.mode,
71
+ accessName:"<?=$rw.name?>" ,
72
+ targetElement : CONTROLS<?=$rw.nameThis?> as any
73
+ });
74
+ this<?=$rw.nameThis ?>.ucExtends.show({decision : 'replace'});
75
+ <?php break;
76
+ }
77
+ });
78
+ ?>
79
+
80
+ if(args.events?.beforeFinalize!=undefined) args.events?.beforeFinalize(form);
81
+ ucExt.finalizeInit(args);
82
+ delete this.initializecomponent;
83
+ delete this.initializecomponentAsync;
84
+ ucExt.takeoff();
85
+ }
86
+
87
+ <?php
88
+ }
89
+ ?>
@@ -0,0 +1,12 @@
1
+ import { HTMLx } from "uc-control/out/lib/WrapperHelper.js";
2
+ import ucWinFrame$dynamic from "uc-control/out/renderer/controls/ucWinFrame.uc.html.js";
3
+ export default HTMLx.Design({
4
+ dynamicFilePath: import.meta.url,
5
+ htmlSource() {
6
+ return HTMLx.Wrapper({ "x-caption": 'Form1' },
7
+ HTMLx.Usercontrol('winFrame1', ucWinFrame$dynamic, import.meta.url, {},
8
+ HTMLx.Tag('div', {}, 'Hello. There')
9
+ )
10
+ )
11
+ },
12
+ })
@@ -0,0 +1,16 @@
1
+ <?php
2
+ function pushElement(node){
3
+ ?>
4
+ HTMLx.Tag("<?= node.nodeName ?>", { <?php for (const [attr, val] of Object.entries(node.props)) { ?> "<?= attr ?>" : <?= JSON.stringify(val) ?> as any,<?php } ?> }, <?php
5
+ node.children.forEach(child => {
6
+ if(child.type=='text'){
7
+ ?> <?= JSON.stringify(child.value) ?>, <?php
8
+ }else if (child.type=='element'){
9
+ ?><?= pushElement(child) ?>, <?php
10
+ }
11
+ }); ?> )<?php }
12
+ ?>import { HTMLx } from "uc-control/out/lib/WrapperHelper.js";
13
+ export default function () {
14
+ let fcontent = <?= pushElement(this) ?>;
15
+ return fcontent;
16
+ }
@@ -0,0 +1,5 @@
1
+ &{
2
+ position: relative;
3
+ display:block; width: 800px; height: 500px;
4
+ background-color: #aeaeae;
5
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "javascript.suggest.paths": true,
3
+ "javascript.preferences.useAliasesForRenames": false,
4
+ "typescript.preferences.useAliasesForRenames": false,
5
+ "typescript.updateImportsOnFileMove.enabled": "never",
6
+ "javascript.updateImportsOnFileMove.enabled": "never",
7
+ "javascript.preferences.importModuleSpecifier": "relative",
8
+ "typescript.preferences.importModuleSpecifier": "relative",
9
+ "typescript.preferences.importModuleSpecifierEnding": "js",
10
+ "explorer.fileNesting.enabled": true,
11
+ "explorer.fileNesting.patterns": {
12
+ "package.json": "ucconfig.js,.babelrc,vite.config.ts,electron.vite.config.js,LICENSE,ucconfig.json,tsconfig.build.json, jsconfig.json, package-lock.json, .browserslistrc, .dockerignore, .editorconfig, .env, .eslintignore, .eslintrc., .gitignore, .graphqlrc., .nvmrc, .prettierignore, .prettierrc.*, README.md, babel.config.json, cypress.json, jest.config.ts, jest.preset.js, nx.json, package.json, tsconfig.base.json, tsconfig.json, workspace.json, yarn.lock, vercel.json, netlify.toml, pnpm-lock.yaml",
13
+ "*.uc.ts": "${capture}.uc.*",
14
+ "*.tpt.ts": "${capture}.tpt.*",
15
+ "*.ts": "${capture}.js,${capture}.js.map",
16
+ },
17
+ }
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
7
+ <script type="module" src="<?= indexFilePath ?>"></script>
8
+ </head>
9
+ <body>
10
+ </body>
11
+ </html>