ts-glitter 13.8.0 → 13.8.1
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.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +2 -1
- package/lowcode/glitterBundle/module/html-generate.js +14 -0
- package/lowcode/glitterBundle/module/html-generate.ts +54 -29
- package/lowcode/glitterBundle/plugins/editor-elem.js +24 -18
- package/lowcode/glitterBundle/plugins/editor-elem.ts +30 -25
- package/lowcode/jspage/function-page/setting_editor.ts +2 -1
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -59,7 +59,7 @@ export class Entry {
|
|
|
59
59
|
}
|
|
60
60
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
61
61
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
62
|
-
glitter.share.editerVersion = "V_13.8.
|
|
62
|
+
glitter.share.editerVersion = "V_13.8.1";
|
|
63
63
|
glitter.share.start = (new Date());
|
|
64
64
|
const vm = {
|
|
65
65
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {ShareDialog} from "./glitterBundle/dialog/ShareDialog.js";
|
|
|
9
9
|
|
|
10
10
|
export class Entry {
|
|
11
11
|
public static onCreate(glitter: Glitter) {
|
|
12
|
+
|
|
12
13
|
glitter.share.top_inset = 0
|
|
13
14
|
glitter.share.bottom_inset = 0
|
|
14
15
|
glitter.share.reload_code_hash = function () {
|
|
@@ -59,7 +60,7 @@ export class Entry {
|
|
|
59
60
|
}
|
|
60
61
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
61
62
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
62
|
-
glitter.share.editerVersion = "V_13.8.
|
|
63
|
+
glitter.share.editerVersion = "V_13.8.1";
|
|
63
64
|
glitter.share.start = (new Date());
|
|
64
65
|
const vm: {
|
|
65
66
|
appConfig: any;
|
|
@@ -2220,6 +2220,20 @@ transform: translateY(5px);
|
|
|
2220
2220
|
glitter.htmlGenerate.loadScript(glitter, preloadJS, 'clickEvent');
|
|
2221
2221
|
});
|
|
2222
2222
|
}
|
|
2223
|
+
static renderComponent(cf) {
|
|
2224
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
2225
|
+
(window.glitterInitialHelper).getPageData({
|
|
2226
|
+
tag: cf.tag,
|
|
2227
|
+
appName: cf.appName
|
|
2228
|
+
}, (d2) => {
|
|
2229
|
+
resolve(new cf.gvc.glitter.htmlGenerate(d2.response.result[0].config, [], cf.subData).render(cf.gvc, {
|
|
2230
|
+
class: ``,
|
|
2231
|
+
style: ``,
|
|
2232
|
+
page_config: d2.response.result[0].page_config,
|
|
2233
|
+
}));
|
|
2234
|
+
});
|
|
2235
|
+
}));
|
|
2236
|
+
}
|
|
2223
2237
|
}
|
|
2224
2238
|
HtmlGenerate.share = {};
|
|
2225
2239
|
HtmlGenerate.isEditMode = isEditMode;
|
|
@@ -352,7 +352,7 @@ export class HtmlGenerate {
|
|
|
352
352
|
${data.style}
|
|
353
353
|
})()`);
|
|
354
354
|
} else if (data.dataType === 'triggerEvent') {
|
|
355
|
-
return
|
|
355
|
+
return ``
|
|
356
356
|
// return glitter.promiseValue(
|
|
357
357
|
// new Promise(async (resolve, reject) => {
|
|
358
358
|
// resolve(
|
|
@@ -718,14 +718,14 @@ ${obj.gvc.bindView({
|
|
|
718
718
|
dd.formData = dd.formData ?? formData;
|
|
719
719
|
dd.event = (key: string, subData: any) => {
|
|
720
720
|
return new Promise(async (resolve, reject) => {
|
|
721
|
-
if((window as any).glitter.getUrlParameter('cms') === 'true'){
|
|
722
|
-
const dialog=new ShareDialog((window.parent as any).glitter)
|
|
723
|
-
if(key==='success'){
|
|
724
|
-
dialog.successMessage({text:subData.title})
|
|
725
|
-
}else if (key==='error'){
|
|
726
|
-
dialog.errorMessage({text:subData.title})
|
|
727
|
-
}else if (key==='loading'){
|
|
728
|
-
dialog.dataLoading({visible:(subData.visible) ?? true,text:subData.title})
|
|
721
|
+
if ((window as any).glitter.getUrlParameter('cms') === 'true') {
|
|
722
|
+
const dialog = new ShareDialog((window.parent as any).glitter)
|
|
723
|
+
if (key === 'success') {
|
|
724
|
+
dialog.successMessage({text: subData.title})
|
|
725
|
+
} else if (key === 'error') {
|
|
726
|
+
dialog.errorMessage({text: subData.title})
|
|
727
|
+
} else if (key === 'loading') {
|
|
728
|
+
dialog.dataLoading({visible: (subData.visible) ?? true, text: subData.title})
|
|
729
729
|
}
|
|
730
730
|
resolve(true)
|
|
731
731
|
return
|
|
@@ -2177,11 +2177,11 @@ ${e.line}
|
|
|
2177
2177
|
option: option.concat(
|
|
2178
2178
|
(() => {
|
|
2179
2179
|
if (root && isEditMode()) {
|
|
2180
|
-
if((window.parent as any).document.body.clientWidth<800){
|
|
2181
|
-
return
|
|
2180
|
+
if ((window.parent as any).document.body.clientWidth < 800) {
|
|
2181
|
+
return [
|
|
2182
2182
|
{
|
|
2183
|
-
key:'onclick',
|
|
2184
|
-
value:gvc.event((e,event)=>{
|
|
2183
|
+
key: 'onclick',
|
|
2184
|
+
value: gvc.event((e, event) => {
|
|
2185
2185
|
HtmlGenerate.selectWidget({
|
|
2186
2186
|
gvc: gvc,
|
|
2187
2187
|
widget: widget,
|
|
@@ -2189,10 +2189,11 @@ ${e.line}
|
|
|
2189
2189
|
event: event,
|
|
2190
2190
|
glitter: (window.parent as any).glitter,
|
|
2191
2191
|
});
|
|
2192
|
+
|
|
2192
2193
|
function loop(item: any) {
|
|
2193
2194
|
|
|
2194
|
-
if(item[0] && item[0].tagName.toLowerCase()==='li'){
|
|
2195
|
-
if(item[0].children[0] && (!item[0].children[0].className.includes('active_F2F2F2'))){
|
|
2195
|
+
if (item[0] && item[0].tagName.toLowerCase() === 'li') {
|
|
2196
|
+
if (item[0].children[0] && (!item[0].children[0].className.includes('active_F2F2F2'))) {
|
|
2196
2197
|
item[0].children[0].style.background = '#F2F2F2';
|
|
2197
2198
|
}
|
|
2198
2199
|
}
|
|
@@ -2200,7 +2201,8 @@ ${e.line}
|
|
|
2200
2201
|
loop(item.parent())
|
|
2201
2202
|
}
|
|
2202
2203
|
}
|
|
2203
|
-
|
|
2204
|
+
|
|
2205
|
+
if ((window.parent as any).document.querySelector(`.it-${widget.id}`)) {
|
|
2204
2206
|
loop((window.parent as any).glitter.$(`.it-${widget.id}`).parent());
|
|
2205
2207
|
(window.parent as any).document.querySelector(`.it-${widget.id}`).style.background = '#F2F2F2';
|
|
2206
2208
|
}
|
|
@@ -2215,10 +2217,11 @@ ${e.line}
|
|
|
2215
2217
|
value: gvc.event((e, event) => {
|
|
2216
2218
|
($(e).children('.editorChild').children('.copy-btn') as any).show();
|
|
2217
2219
|
($(e).children('.editorChild').children('.plus_bt') as any).show();
|
|
2220
|
+
|
|
2218
2221
|
function loop(item: any) {
|
|
2219
2222
|
|
|
2220
|
-
if(item[0] && item[0].tagName.toLowerCase()==='li'){
|
|
2221
|
-
if(item[0].children[0] && (!item[0].children[0].className.includes('active_F2F2F2'))){
|
|
2223
|
+
if (item[0] && item[0].tagName.toLowerCase() === 'li') {
|
|
2224
|
+
if (item[0].children[0] && (!item[0].children[0].className.includes('active_F2F2F2'))) {
|
|
2222
2225
|
item[0].children[0].style.background = '#F2F2F2';
|
|
2223
2226
|
}
|
|
2224
2227
|
}
|
|
@@ -2226,7 +2229,8 @@ ${e.line}
|
|
|
2226
2229
|
loop(item.parent())
|
|
2227
2230
|
}
|
|
2228
2231
|
}
|
|
2229
|
-
|
|
2232
|
+
|
|
2233
|
+
if ((window.parent as any).document.querySelector(`.it-${widget.id}`)) {
|
|
2230
2234
|
loop((window.parent as any).glitter.$(`.it-${widget.id}`).parent());
|
|
2231
2235
|
(window.parent as any).document.querySelector(`.it-${widget.id}`).style.background = '#F2F2F2';
|
|
2232
2236
|
}
|
|
@@ -2243,9 +2247,10 @@ ${e.line}
|
|
|
2243
2247
|
// };
|
|
2244
2248
|
($(e).children('.editorChild').children('.copy-btn') as any).hide();
|
|
2245
2249
|
($(e).children('.editorChild').children('.plus_bt') as any).hide();
|
|
2250
|
+
|
|
2246
2251
|
function loop(item: any) {
|
|
2247
|
-
if(item[0] && item[0].tagName.toLowerCase()==='li'){
|
|
2248
|
-
if(item[0].children[0] && (!item[0].children[0].className.includes('active_F2F2F2'))){
|
|
2252
|
+
if (item[0] && item[0].tagName.toLowerCase() === 'li') {
|
|
2253
|
+
if (item[0].children[0] && (!item[0].children[0].className.includes('active_F2F2F2'))) {
|
|
2249
2254
|
item[0].children[0].style.background = 'none';
|
|
2250
2255
|
}
|
|
2251
2256
|
}
|
|
@@ -2253,7 +2258,8 @@ ${e.line}
|
|
|
2253
2258
|
loop(item.parent())
|
|
2254
2259
|
}
|
|
2255
2260
|
}
|
|
2256
|
-
|
|
2261
|
+
|
|
2262
|
+
if ((window.parent as any).document.querySelector(`.it-${widget.id}`)) {
|
|
2257
2263
|
loop((window.parent as any).glitter.$(`.it-${widget.id}`).parent());
|
|
2258
2264
|
(window.parent as any).document.querySelector(`.it-${widget.id}`).style.removeProperty('background');
|
|
2259
2265
|
}
|
|
@@ -2368,7 +2374,7 @@ ${e.line}
|
|
|
2368
2374
|
try {
|
|
2369
2375
|
glitter.share.editorViewModel.selectItem = dd;
|
|
2370
2376
|
Storage.page_setting_item = 'layout';
|
|
2371
|
-
(glitter.pageConfig[glitter.pageConfig.length - 1] as any).gvc.notifyDataChange(['top_sm_bar','left_sm_bar','item-editor-select']);
|
|
2377
|
+
(glitter.pageConfig[glitter.pageConfig.length - 1] as any).gvc.notifyDataChange(['top_sm_bar', 'left_sm_bar', 'item-editor-select']);
|
|
2372
2378
|
gvc.glitter.$('.editorItemActive').removeClass('editorItemActive');
|
|
2373
2379
|
gvc.glitter.$(`.editor_it_${widgetComponentID}`).addClass('editorItemActive');
|
|
2374
2380
|
Storage.lastSelect = dd.id;
|
|
@@ -2496,8 +2502,8 @@ background: white;
|
|
|
2496
2502
|
`
|
|
2497
2503
|
} else {
|
|
2498
2504
|
function getPlusAndPasteView(dir: number) {
|
|
2499
|
-
if((window.parent as any).document.body.clientWidth<800){
|
|
2500
|
-
return
|
|
2505
|
+
if ((window.parent as any).document.body.clientWidth < 800) {
|
|
2506
|
+
return ``
|
|
2501
2507
|
}
|
|
2502
2508
|
const detID = cf.gvc.glitter.getUUID()
|
|
2503
2509
|
const plusID = cf.gvc.glitter.getUUID()
|
|
@@ -2611,12 +2617,12 @@ transform: translateY(5px);
|
|
|
2611
2617
|
}
|
|
2612
2618
|
|
|
2613
2619
|
return html`
|
|
2614
|
-
${cf.gvc.glitter.document.body.clientWidth>800 ? `<div
|
|
2620
|
+
${cf.gvc.glitter.document.body.clientWidth > 800 ? `<div
|
|
2615
2621
|
class="position-absolute align-items-center justify-content-center px-3 fw-500 fs-6 badge_it"
|
|
2616
2622
|
style="height:22px;left:-2px;top:-22px;background: linear-gradient(143deg, #FFB400 -22.7%, #FF6C02 114.57%);color:white;white-space: nowrap;"
|
|
2617
2623
|
>
|
|
2618
2624
|
${cf.label}
|
|
2619
|
-
</div
|
|
2625
|
+
</div>` : ``}
|
|
2620
2626
|
<div
|
|
2621
2627
|
class="position-absolute fs-1 plus_bt"
|
|
2622
2628
|
style="left:50%;transform: translateX(-50%);height:20px;top:${(Storage.view_type === 'mobile')
|
|
@@ -2662,7 +2668,7 @@ transform: translateY(5px);
|
|
|
2662
2668
|
|
|
2663
2669
|
},
|
|
2664
2670
|
divCreate: {
|
|
2665
|
-
class: `editorChild editor_it_${cf.id} ${(cf.gvc.glitter.htmlGenerate.hover_items.indexOf(cf.id) !== -1 && !isIdeaMode()) || ((window.parent as any).glitter.share.editorViewModel.selectItem===cf.widget) ? `editorItemActive` : ``} position-absolute w-100 h-100`,
|
|
2671
|
+
class: `editorChild editor_it_${cf.id} ${(cf.gvc.glitter.htmlGenerate.hover_items.indexOf(cf.id) !== -1 && !isIdeaMode()) || ((window.parent as any).glitter.share.editorViewModel.selectItem === cf.widget) ? `editorItemActive` : ``} position-absolute w-100 h-100`,
|
|
2666
2672
|
style: `z-index: 99999;top:0px;left:0px;`,
|
|
2667
2673
|
option: [],
|
|
2668
2674
|
},
|
|
@@ -2711,7 +2717,7 @@ transform: translateY(5px);
|
|
|
2711
2717
|
container_items.rerenderReplaceElem()
|
|
2712
2718
|
}
|
|
2713
2719
|
glitter.share.editorViewModel.selectItem = undefined;
|
|
2714
|
-
gvc.notifyDataChange(['right_NAV', 'MainEditorLeft','item-editor-select']);
|
|
2720
|
+
gvc.notifyDataChange(['right_NAV', 'MainEditorLeft', 'item-editor-select']);
|
|
2715
2721
|
callback();
|
|
2716
2722
|
}
|
|
2717
2723
|
},
|
|
@@ -2756,8 +2762,27 @@ transform: translateY(5px);
|
|
|
2756
2762
|
glitter.htmlGenerate.loadScript(glitter, preloadJS, 'clickEvent');
|
|
2757
2763
|
});
|
|
2758
2764
|
}
|
|
2765
|
+
|
|
2766
|
+
public static renderComponent(cf: {
|
|
2767
|
+
appName: string, tag: string, gvc: GVC,subData:any
|
|
2768
|
+
}) {
|
|
2769
|
+
return new Promise(async (resolve, reject) => {
|
|
2770
|
+
((window as any).glitterInitialHelper).getPageData({
|
|
2771
|
+
tag: cf.tag,
|
|
2772
|
+
appName: cf.appName
|
|
2773
|
+
}, (d2: any) => {
|
|
2774
|
+
resolve( new cf.gvc.glitter.htmlGenerate(d2.response.result[0].config, [], cf.subData).render(cf.gvc, {
|
|
2775
|
+
class: ``,
|
|
2776
|
+
style: ``,
|
|
2777
|
+
page_config: d2.response.result[0].page_config,
|
|
2778
|
+
}))
|
|
2779
|
+
})
|
|
2780
|
+
})
|
|
2781
|
+
}
|
|
2759
2782
|
}
|
|
2760
2783
|
|
|
2784
|
+
|
|
2785
|
+
|
|
2761
2786
|
function isIdeaAble(widget: any) {
|
|
2762
2787
|
try {
|
|
2763
2788
|
return (window as any).glitter.getUrlParameter('type') === 'find_idea' && widget && widget.ideable;
|
|
@@ -585,24 +585,30 @@ export class EditorElem {
|
|
|
585
585
|
};
|
|
586
586
|
});
|
|
587
587
|
}
|
|
588
|
-
return (
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
588
|
+
return obj.gvc.bindView(() => {
|
|
589
|
+
const codeID = obj.gvc.glitter.getUUID();
|
|
590
|
+
return {
|
|
591
|
+
bind: codeID,
|
|
592
|
+
view: () => {
|
|
593
|
+
return (html ` <div class="d-flex">
|
|
594
|
+
${obj.title ? EditorElem.h3(obj.title) : ''}
|
|
595
|
+
<div
|
|
596
|
+
class="d-flex align-items-center justify-content-center"
|
|
597
|
+
style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
|
|
598
|
+
onclick="${obj.gvc.event(() => {
|
|
599
|
+
EditorElem.openEditorDialog(obj.gvc, (gvc) => {
|
|
600
|
+
return getComponent(gvc, window.innerHeight - 100);
|
|
601
|
+
}, () => {
|
|
602
|
+
obj.gvc.notifyDataChange(codeID);
|
|
603
|
+
});
|
|
604
|
+
})}"
|
|
605
|
+
>
|
|
606
|
+
<i class="fa-solid fa-expand"></i>
|
|
607
|
+
</div>
|
|
608
|
+
</div>` + getComponent(obj.gvc, obj.height));
|
|
609
|
+
},
|
|
610
|
+
};
|
|
611
|
+
});
|
|
606
612
|
}
|
|
607
613
|
static pageEditor(cf) {
|
|
608
614
|
const href = new URL(location.href);
|
|
@@ -619,31 +619,36 @@ export class EditorElem {
|
|
|
619
619
|
};
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
622
|
+
return obj.gvc.bindView(() => {
|
|
623
|
+
const codeID=obj.gvc.glitter.getUUID()
|
|
624
|
+
return {
|
|
625
|
+
bind: codeID,
|
|
626
|
+
view: () => {
|
|
627
|
+
return (
|
|
628
|
+
html` <div class="d-flex">
|
|
629
|
+
${obj.title ? EditorElem.h3(obj.title) : ''}
|
|
630
|
+
<div
|
|
631
|
+
class="d-flex align-items-center justify-content-center"
|
|
632
|
+
style="height:36px;width:36px;border-radius:10px;cursor:pointer;color:#151515;"
|
|
633
|
+
onclick="${obj.gvc.event(() => {
|
|
634
|
+
EditorElem.openEditorDialog(
|
|
635
|
+
obj.gvc,
|
|
636
|
+
(gvc: GVC) => {
|
|
637
|
+
return getComponent(gvc, window.innerHeight - 100);
|
|
638
|
+
},
|
|
639
|
+
() => {
|
|
640
|
+
obj.gvc.notifyDataChange(codeID);
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
})}"
|
|
644
|
+
>
|
|
645
|
+
<i class="fa-solid fa-expand"></i>
|
|
646
|
+
</div>
|
|
647
|
+
</div>` + getComponent(obj.gvc, obj.height)
|
|
648
|
+
);
|
|
649
|
+
},
|
|
650
|
+
};
|
|
651
|
+
})
|
|
647
652
|
}
|
|
648
653
|
|
|
649
654
|
public static pageEditor(cf: { page: string; width: number; height: number; par: { key: string; value: string }[] }) {
|
|
@@ -722,7 +722,8 @@ export class Setting_editor {
|
|
|
722
722
|
url.searchParams.set('appName', items[parseInt(index)].appName);
|
|
723
723
|
url.searchParams.set('cms', 'true');
|
|
724
724
|
url.searchParams.set('page', page);
|
|
725
|
-
|
|
725
|
+
|
|
726
|
+
|
|
726
727
|
// ((window as any).glitterInitialHelper).getPageData({
|
|
727
728
|
// tag: page,
|
|
728
729
|
// appName: items[parseInt(index)].appName
|