ts-glitter 21.4.0 → 21.4.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 +18 -1
- package/lowcode/Entry.ts +19 -1
- package/lowcode/api/pageConfig.js +29 -10
- package/lowcode/api/pageConfig.ts +43 -11
- package/lowcode/backend-manager/bg-blog.js +5 -0
- package/lowcode/backend-manager/bg-blog.ts +5 -0
- package/lowcode/cms-plugin/menus-setting.js +15 -6
- package/lowcode/cms-plugin/menus-setting.ts +23 -6
- package/lowcode/cms-plugin/module/user-excel.js +11 -5
- package/lowcode/cms-plugin/module/user-excel.ts +11 -5
- package/lowcode/cms-plugin/shopping-discount-setting.js +236 -234
- package/lowcode/cms-plugin/shopping-discount-setting.ts +137 -134
- package/lowcode/cms-plugin/third-party-line.js +34 -0
- package/lowcode/cms-plugin/third-party-line.ts +34 -0
- package/lowcode/editor-components/global-editor.js +60 -0
- package/lowcode/editor-components/global-editor.ts +65 -0
- package/lowcode/editor-components/global-widget/bridge.js +40 -34
- package/lowcode/editor-components/global-widget/bridge.ts +42 -34
- package/lowcode/glitterBundle/html-component/global-widget.js +265 -170
- package/lowcode/glitterBundle/html-component/global-widget.ts +264 -159
- package/lowcode/index.html +1 -1
- package/lowcode/jspage/function-page/tool-setting.js +9 -1
- package/lowcode/jspage/function-page/tool-setting.ts +9 -1
- package/lowcode/jspage/main.js +78 -16
- package/lowcode/jspage/main.ts +108 -22
- package/lowcode/official_view_component/official/component.js +17 -10
- package/lowcode/official_view_component/official/component.ts +38 -27
- package/lowcode/public-components/blogs/blogs-01.js +200 -140
- package/lowcode/public-components/blogs/blogs-01.ts +232 -145
- package/lowcode/public-components/checkout/index.js +1 -1
- package/lowcode/public-components/checkout/index.ts +1 -1
- package/lowcode/public-components/headers/head-initial.ts +1 -1
- package/lowcode/public-components/headers/sy-02.js +1 -0
- package/lowcode/public-components/headers/sy-02.ts +1 -0
- package/lowcode/public-components/headers/sy-03.js +1 -0
- package/lowcode/public-components/headers/sy-03.ts +1 -0
- package/lowcode/public-components/headers/sy-04.js +1 -0
- package/lowcode/public-components/headers/sy-04.ts +1 -0
- package/lowcode/public-components/headers/sy-05.js +1 -0
- package/lowcode/public-components/headers/sy-05.ts +1 -0
- package/lowcode/public-components/product/product-detail.js +2 -2
- package/lowcode/public-components/product/product-detail.ts +4 -4
- package/lowcode/public-components/terms-related/index.ts +1 -0
- package/lowcode/public-components/user-manager/um-login.js +7 -1
- package/lowcode/public-components/user-manager/um-login.ts +8 -1
- package/package.json +1 -1
- package/src/api-public/models/glitter-finance.js +1 -2
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/services/checkout-event.js +1 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +1 -0
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/user.js +4 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +4 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/controllers/template.js +2 -2
- package/src/controllers/template.js.map +1 -1
- package/src/controllers/template.ts +5 -2
- package/src/firebase/message.js +1 -2
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +1 -2
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/index.ts +1 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/run.js +1 -2
- package/src/run.js.map +1 -1
- package/src/seo-config.d.ts +1 -1
- package/src/seo-config.js +13 -12
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +18 -12
- package/src/services/app.d.ts +2 -1
- package/src/services/app.js +4 -2
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +5 -2
- package/src/services/backend-service.js +7 -17
- package/src/services/backend-service.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/seo.d.ts +2 -1
- package/src/services/seo.js +7 -4
- package/src/services/seo.js.map +1 -1
- package/src/services/seo.ts +7 -4
- package/src/services/ses.js +1 -2
- package/src/services/ses.js.map +1 -1
- package/src/services/template.d.ts +3 -1
- package/src/services/template.js +55 -34
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +68 -35
- package/nxv0ptv53w.json +0 -1
- package/omr85cp878.json +0 -1
|
@@ -954,55 +954,56 @@ export class ShoppingDiscountSetting {
|
|
|
954
954
|
.map(str => html`<div>${str}</div>`)
|
|
955
955
|
.join(BgWidget.horizontalLine())
|
|
956
956
|
),
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
957
|
+
...(['shipment_free', 'add_on_items', 'giveaway'].includes(voucherData.reBackType)) ? []:[
|
|
958
|
+
BgWidget.mainCard(
|
|
959
|
+
gvc.bindView(() => {
|
|
960
|
+
const id = glitter.getUUID();
|
|
961
|
+
const originForType = String(voucherData.for);
|
|
962
|
+
voucherData.forKey = voucherData.forKey ?? [];
|
|
963
|
+
let defKeys: any = {
|
|
964
|
+
collection: JSON.parse(JSON.stringify(voucherData.forKey)),
|
|
965
|
+
product: JSON.parse(JSON.stringify(voucherData.forKey)),
|
|
966
|
+
manager_tag: JSON.parse(JSON.stringify(voucherData.forKey)),
|
|
967
|
+
};
|
|
967
968
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
969
|
+
return {
|
|
970
|
+
bind: id,
|
|
971
|
+
dataList: [
|
|
972
|
+
{ obj: voucherData, key: 'method' },
|
|
973
|
+
{ obj: voucherData, key: 'reBackType' },
|
|
974
|
+
],
|
|
975
|
+
view: () => {
|
|
976
|
+
return [
|
|
977
|
+
...(() => {
|
|
978
|
+
if (['shipment_free', 'add_on_items', 'giveaway'].includes(voucherData.reBackType)) {
|
|
979
|
+
return [];
|
|
980
|
+
}
|
|
980
981
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
982
|
+
const valueInput = (obj: { startText?: string; endText?: string }) => {
|
|
983
|
+
return BgWidget.editeInput({
|
|
984
|
+
gvc: gvc,
|
|
985
|
+
type: 'number',
|
|
986
|
+
divStyle: 'width:150px;',
|
|
987
|
+
title: '',
|
|
988
|
+
default: voucherData.value,
|
|
989
|
+
placeHolder: '',
|
|
990
|
+
callback: text => {
|
|
991
|
+
const texInt = parseInt(text, 10);
|
|
992
|
+
if (voucherData.method === 'percent' && (texInt > 100 || texInt < 0)) {
|
|
993
|
+
dialog.infoMessage({ text: '數值需介於0~100' });
|
|
994
|
+
gvc.notifyDataChange(id);
|
|
995
|
+
gvc.notifyDataChange(pageVM.countingID);
|
|
996
|
+
} else {
|
|
997
|
+
voucherData.value = text;
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
startText: obj.startText,
|
|
1001
|
+
endText: obj.endText,
|
|
1002
|
+
});
|
|
1003
|
+
};
|
|
1003
1004
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1005
|
+
return [
|
|
1006
|
+
html` <div>
|
|
1006
1007
|
<div class="tx_700">折扣金額</div>
|
|
1007
1008
|
${BgWidget.mbContainer(18)}
|
|
1008
1009
|
${BgWidget.multiCheckboxContainer(
|
|
@@ -1028,15 +1029,15 @@ export class ShoppingDiscountSetting {
|
|
|
1028
1029
|
{ single: true }
|
|
1029
1030
|
)}
|
|
1030
1031
|
</div>`,
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1032
|
+
];
|
|
1033
|
+
})(),
|
|
1034
|
+
...(() => {
|
|
1035
|
+
if (voucherData.trigger === 'distribution') {
|
|
1036
|
+
return [];
|
|
1037
|
+
}
|
|
1037
1038
|
|
|
1038
|
-
|
|
1039
|
-
|
|
1039
|
+
return [
|
|
1040
|
+
html`
|
|
1040
1041
|
<div class="tx_700">套用至</div>
|
|
1041
1042
|
${BgWidget.mbContainer(18)}
|
|
1042
1043
|
${EditorElem.radio({
|
|
@@ -1074,35 +1075,35 @@ export class ShoppingDiscountSetting {
|
|
|
1074
1075
|
<div class="tx_normal">標籤列表</div>
|
|
1075
1076
|
</div>
|
|
1076
1077
|
${BgWidget.grayButton(
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1078
|
+
'選擇標籤',
|
|
1079
|
+
gvc.event(() => {
|
|
1080
|
+
BgProduct.useProductTags({
|
|
1081
|
+
gvc,
|
|
1082
|
+
config_key: 'product_manager_tags',
|
|
1083
|
+
def:
|
|
1084
|
+
originForType === 'manager_tag' && voucherData.forKey
|
|
1085
|
+
? voucherData.forKey.map(item => `${item}`)
|
|
1086
|
+
: [],
|
|
1087
|
+
callback: async value => {
|
|
1088
|
+
voucherData.forKey = value;
|
|
1089
|
+
defKeys.manager_tag = value;
|
|
1090
|
+
subVM.dataList = value;
|
|
1091
|
+
gvc.notifyDataChange(subVM.id);
|
|
1092
|
+
},
|
|
1093
|
+
});
|
|
1094
|
+
}),
|
|
1095
|
+
{ textStyle: 'font-weight: 400;' }
|
|
1096
|
+
)}
|
|
1096
1097
|
</div>
|
|
1097
1098
|
${obj.gvc.map(
|
|
1098
|
-
|
|
1099
|
-
|
|
1099
|
+
subVM.dataList.map((opt, index) => {
|
|
1100
|
+
return html` <div
|
|
1100
1101
|
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1101
1102
|
>
|
|
1102
1103
|
<span class="tx_normal">${index + 1}. #${opt}</span>
|
|
1103
1104
|
</div>`;
|
|
1104
|
-
|
|
1105
|
-
|
|
1105
|
+
})
|
|
1106
|
+
)}
|
|
1106
1107
|
</div>
|
|
1107
1108
|
`;
|
|
1108
1109
|
},
|
|
@@ -1131,35 +1132,35 @@ export class ShoppingDiscountSetting {
|
|
|
1131
1132
|
<div class="tx_normal">分類列表</div>
|
|
1132
1133
|
</div>
|
|
1133
1134
|
${BgWidget.grayButton(
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1135
|
+
'選擇分類',
|
|
1136
|
+
gvc.event(() => {
|
|
1137
|
+
BgProduct.collectionsDialog({
|
|
1138
|
+
gvc: gvc,
|
|
1139
|
+
default: voucherData.forKey ?? [],
|
|
1140
|
+
callback: async value => {
|
|
1141
|
+
voucherData.forKey = value;
|
|
1142
|
+
defKeys.collection = value;
|
|
1143
|
+
subVM.dataList = await BgProduct.getCollectiosOpts(value);
|
|
1144
|
+
subVM.loading = true;
|
|
1145
|
+
gvc.notifyDataChange(subVM.id);
|
|
1146
|
+
},
|
|
1147
|
+
});
|
|
1148
|
+
}),
|
|
1149
|
+
{ textStyle: 'font-weight: 400;' }
|
|
1150
|
+
)}
|
|
1150
1151
|
</div>
|
|
1151
1152
|
${obj.gvc.map(
|
|
1152
|
-
|
|
1153
|
-
|
|
1153
|
+
subVM.dataList.map((opt: OptionsItem, index) => {
|
|
1154
|
+
return html` <div
|
|
1154
1155
|
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1155
1156
|
>
|
|
1156
1157
|
<span class="tx_normal">${index + 1}. ${opt.value}</span>
|
|
1157
1158
|
${opt.note
|
|
1158
|
-
|
|
1159
|
-
|
|
1159
|
+
? html` <span class="tx_gray_12 ms-2">${opt.note}</span> `
|
|
1160
|
+
: ''}
|
|
1160
1161
|
</div>`;
|
|
1161
|
-
|
|
1162
|
-
|
|
1162
|
+
})
|
|
1163
|
+
)}
|
|
1163
1164
|
</div>
|
|
1164
1165
|
`;
|
|
1165
1166
|
},
|
|
@@ -1207,45 +1208,45 @@ export class ShoppingDiscountSetting {
|
|
|
1207
1208
|
<div class="tx_normal">商品列表</div>
|
|
1208
1209
|
</div>
|
|
1209
1210
|
${BgWidget.grayButton(
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1211
|
+
'選擇商品',
|
|
1212
|
+
gvc.event(() => {
|
|
1213
|
+
BgProduct.productsDialog({
|
|
1214
|
+
gvc: gvc,
|
|
1215
|
+
default: voucherData.forKey ?? [],
|
|
1216
|
+
callback: async value => {
|
|
1217
|
+
voucherData.forKey = value;
|
|
1218
|
+
defKeys.product = value;
|
|
1219
|
+
subVM.dataList = await BgProduct.getProductOpts(
|
|
1220
|
+
voucherData.forKey
|
|
1221
|
+
);
|
|
1222
|
+
subVM.loading = true;
|
|
1223
|
+
gvc.notifyDataChange(subVM.id);
|
|
1224
|
+
},
|
|
1225
|
+
});
|
|
1226
|
+
}),
|
|
1227
|
+
{ textStyle: 'font-weight: 400;' }
|
|
1228
|
+
)}
|
|
1228
1229
|
</div>
|
|
1229
1230
|
${subVM.dataList
|
|
1230
|
-
|
|
1231
|
-
|
|
1231
|
+
.map((opt: OptionsItem, index) => {
|
|
1232
|
+
return html` <div
|
|
1232
1233
|
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1233
1234
|
>
|
|
1234
1235
|
<span class="tx_normal">${index + 1}.</span>
|
|
1235
1236
|
${BgWidget.validImageBox({
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1237
|
+
gvc: gvc,
|
|
1238
|
+
image: opt.image,
|
|
1239
|
+
width: 40,
|
|
1240
|
+
})}
|
|
1240
1241
|
<div class="tx_normal ${opt.note ? 'mb-1' : ''}">
|
|
1241
1242
|
${opt.value}
|
|
1242
1243
|
</div>
|
|
1243
1244
|
${opt.note
|
|
1244
|
-
|
|
1245
|
-
|
|
1245
|
+
? html` <div class="tx_gray_12">${opt.note}</div> `
|
|
1246
|
+
: ''}
|
|
1246
1247
|
</div>`;
|
|
1247
|
-
|
|
1248
|
-
|
|
1248
|
+
})
|
|
1249
|
+
.join(``)}
|
|
1249
1250
|
</div>
|
|
1250
1251
|
`;
|
|
1251
1252
|
},
|
|
@@ -1276,13 +1277,15 @@ export class ShoppingDiscountSetting {
|
|
|
1276
1277
|
}
|
|
1277
1278
|
})()}
|
|
1278
1279
|
`,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1280
|
+
];
|
|
1281
|
+
})(),
|
|
1282
|
+
].join(BgWidget.horizontalLine());
|
|
1283
|
+
},
|
|
1284
|
+
};
|
|
1285
|
+
})
|
|
1286
|
+
)
|
|
1287
|
+
]
|
|
1288
|
+
,
|
|
1286
1289
|
['giveaway', 'add_on_items'].includes(voucherData.reBackType)
|
|
1287
1290
|
? BgWidget.mainCard(rebackProduct())
|
|
1288
1291
|
: '',
|
|
@@ -23,11 +23,14 @@ export class ThirdPartyLine {
|
|
|
23
23
|
id: '',
|
|
24
24
|
secret: '',
|
|
25
25
|
message_token: '',
|
|
26
|
+
support_scope: []
|
|
26
27
|
},
|
|
27
28
|
};
|
|
28
29
|
ApiUser.getPublicConfig(key, 'manager').then((dd) => {
|
|
30
|
+
var _a;
|
|
29
31
|
vm.loading = false;
|
|
30
32
|
dd.response.value && (vm.data = dd.response.value);
|
|
33
|
+
vm.data.support_scope = (_a = vm.data.support_scope) !== null && _a !== void 0 ? _a : [];
|
|
31
34
|
gvc.notifyDataChange(id);
|
|
32
35
|
});
|
|
33
36
|
return {
|
|
@@ -79,6 +82,37 @@ export class ThirdPartyLine {
|
|
|
79
82
|
vm.data.message_token = text;
|
|
80
83
|
},
|
|
81
84
|
}),
|
|
85
|
+
BgWidget.inlineCheckBox({
|
|
86
|
+
title: 'LINE登入請求額外資料',
|
|
87
|
+
gvc: gvc,
|
|
88
|
+
def: vm.data.support_scope,
|
|
89
|
+
array: [
|
|
90
|
+
{
|
|
91
|
+
value: 'phone',
|
|
92
|
+
title: '電話',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: '地址',
|
|
96
|
+
value: 'address',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: '真實姓名',
|
|
100
|
+
value: 'real_name',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: '性別',
|
|
104
|
+
value: 'gender',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: '生日',
|
|
108
|
+
value: 'birthdate',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
callback: (array) => {
|
|
112
|
+
vm.data.support_scope = array;
|
|
113
|
+
},
|
|
114
|
+
type: 'multiple',
|
|
115
|
+
}),
|
|
82
116
|
html `<div
|
|
83
117
|
onclick="${gvc.event(() => {
|
|
84
118
|
const dialog = new ShareDialog(gvc.glitter);
|
|
@@ -18,6 +18,7 @@ export class ThirdPartyLine {
|
|
|
18
18
|
id: string;
|
|
19
19
|
secret: string;
|
|
20
20
|
message_token: string;
|
|
21
|
+
support_scope:string[]
|
|
21
22
|
};
|
|
22
23
|
} = {
|
|
23
24
|
loading: true,
|
|
@@ -26,12 +27,14 @@ export class ThirdPartyLine {
|
|
|
26
27
|
id: '',
|
|
27
28
|
secret: '',
|
|
28
29
|
message_token: '',
|
|
30
|
+
support_scope:[]
|
|
29
31
|
},
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
ApiUser.getPublicConfig(key, 'manager').then((dd) => {
|
|
33
35
|
vm.loading = false;
|
|
34
36
|
dd.response.value && (vm.data = dd.response.value);
|
|
37
|
+
vm.data.support_scope=vm.data.support_scope ?? [];
|
|
35
38
|
gvc.notifyDataChange(id);
|
|
36
39
|
});
|
|
37
40
|
|
|
@@ -86,6 +89,37 @@ export class ThirdPartyLine {
|
|
|
86
89
|
vm.data.message_token = text;
|
|
87
90
|
},
|
|
88
91
|
}),
|
|
92
|
+
BgWidget.inlineCheckBox({
|
|
93
|
+
title: 'LINE登入請求額外資料',
|
|
94
|
+
gvc: gvc,
|
|
95
|
+
def: vm.data.support_scope,
|
|
96
|
+
array: [
|
|
97
|
+
{
|
|
98
|
+
value: 'phone',
|
|
99
|
+
title: '電話',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: '地址',
|
|
103
|
+
value: 'address',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: '真實姓名',
|
|
107
|
+
value: 'real_name',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
title: '性別',
|
|
111
|
+
value: 'gender',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '生日',
|
|
115
|
+
value: 'birthdate',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
callback: (array: any) => {
|
|
119
|
+
vm.data.support_scope=array;
|
|
120
|
+
},
|
|
121
|
+
type: 'multiple',
|
|
122
|
+
}),
|
|
89
123
|
html`<div
|
|
90
124
|
onclick="${gvc.event(() => {
|
|
91
125
|
const dialog = new ShareDialog(gvc.glitter);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ToolSetting } from '../jspage/function-page/tool-setting.js';
|
|
2
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
3
|
+
export class GlobalEditor {
|
|
4
|
+
static main(obj) {
|
|
5
|
+
var _a;
|
|
6
|
+
const gvc = obj.gvc;
|
|
7
|
+
const glitter = gvc.glitter;
|
|
8
|
+
if ([
|
|
9
|
+
...glitter.share._global_component
|
|
10
|
+
.filter((dd) => {
|
|
11
|
+
return dd.template_config.tag.includes('標頭元件');
|
|
12
|
+
})
|
|
13
|
+
.map((dd) => {
|
|
14
|
+
return dd.tag;
|
|
15
|
+
}),
|
|
16
|
+
].includes(obj.widget.data.tag)) {
|
|
17
|
+
obj.widget.header_refer = (_a = obj.widget.header_refer) !== null && _a !== void 0 ? _a : 'def';
|
|
18
|
+
const c_view = [`<div class="mx-2 ">
|
|
19
|
+
|
|
20
|
+
${[`<div class="mx-n2 border-top"></div>`,
|
|
21
|
+
`<div class="fw-500 mb-2 mt-2">標頭樣式</div>`,
|
|
22
|
+
BgWidget.select({
|
|
23
|
+
gvc: gvc,
|
|
24
|
+
callback: (text) => {
|
|
25
|
+
obj.widget.header_refer = text;
|
|
26
|
+
glitter.share.selectEditorItem();
|
|
27
|
+
},
|
|
28
|
+
default: obj.widget.header_refer,
|
|
29
|
+
options: [
|
|
30
|
+
{
|
|
31
|
+
key: 'custom',
|
|
32
|
+
value: '自定義標頭樣式',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: 'def',
|
|
36
|
+
value: '全站預設樣式',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
})
|
|
40
|
+
].join('')}</div>`];
|
|
41
|
+
if (obj.widget.header_refer !== 'def') {
|
|
42
|
+
c_view.push(ToolSetting.item({
|
|
43
|
+
gvc: gvc,
|
|
44
|
+
dd: {
|
|
45
|
+
title: '標頭選單',
|
|
46
|
+
tag: '標頭元件',
|
|
47
|
+
hint: ``,
|
|
48
|
+
toggle: true,
|
|
49
|
+
},
|
|
50
|
+
}));
|
|
51
|
+
c_view.push(obj.append);
|
|
52
|
+
}
|
|
53
|
+
return c_view.join('');
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return obj.append;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
window.glitter.setModule(import.meta.url, GlobalEditor);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { GVC } from '../glitterBundle/GVController.js';
|
|
2
|
+
import { ToolSetting } from '../jspage/function-page/tool-setting.js';
|
|
3
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
4
|
+
|
|
5
|
+
export class GlobalEditor {
|
|
6
|
+
public static main(obj: { gvc: GVC; widget: any; append: string }) {
|
|
7
|
+
const gvc: GVC = obj.gvc;
|
|
8
|
+
const glitter = gvc.glitter;
|
|
9
|
+
if (
|
|
10
|
+
[
|
|
11
|
+
...glitter.share._global_component
|
|
12
|
+
.filter((dd: any) => {
|
|
13
|
+
return dd.template_config.tag.includes('標頭元件');
|
|
14
|
+
})
|
|
15
|
+
.map((dd: any) => {
|
|
16
|
+
return dd.tag;
|
|
17
|
+
}),
|
|
18
|
+
].includes(obj.widget.data.tag)
|
|
19
|
+
) {
|
|
20
|
+
obj.widget.header_refer=obj.widget.header_refer??'def'
|
|
21
|
+
const c_view = [`<div class="mx-2 ">
|
|
22
|
+
|
|
23
|
+
${[`<div class="mx-n2 border-top"></div>`,
|
|
24
|
+
`<div class="fw-500 mb-2 mt-2">標頭樣式</div>`,
|
|
25
|
+
BgWidget.select({
|
|
26
|
+
gvc: gvc,
|
|
27
|
+
callback: (text: any) => {
|
|
28
|
+
obj.widget.header_refer = text;
|
|
29
|
+
glitter.share.selectEditorItem();
|
|
30
|
+
},
|
|
31
|
+
default: obj.widget.header_refer,
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
key: 'custom',
|
|
35
|
+
value: '自定義標頭樣式',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'def',
|
|
39
|
+
value: '全站預設樣式',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
})
|
|
43
|
+
].join('')
|
|
44
|
+
}</div>`];
|
|
45
|
+
if(obj.widget.header_refer !== 'def'){
|
|
46
|
+
c_view.push(ToolSetting.item({
|
|
47
|
+
gvc: gvc,
|
|
48
|
+
dd: {
|
|
49
|
+
title: '標頭選單',
|
|
50
|
+
tag: '標頭元件',
|
|
51
|
+
hint: ``,
|
|
52
|
+
toggle: true,
|
|
53
|
+
},
|
|
54
|
+
}))
|
|
55
|
+
c_view.push(obj.append)
|
|
56
|
+
}
|
|
57
|
+
return c_view.join('')
|
|
58
|
+
} else {
|
|
59
|
+
return obj.append;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
(window as any).glitter.setModule(import.meta.url, GlobalEditor);
|