ts-glitter 18.7.7 → 18.7.9

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 CHANGED
@@ -131,7 +131,7 @@ export class Entry {
131
131
  }
132
132
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
133
133
  console.log(`Entry-time:`, window.renderClock.stop());
134
- glitter.share.editerVersion = 'V_18.7.7';
134
+ glitter.share.editerVersion = 'V_18.7.9';
135
135
  glitter.share.start = new Date();
136
136
  const vm = { appConfig: [] };
137
137
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -131,7 +131,7 @@ export class Entry {
131
131
  }
132
132
  (window as any).renderClock = (window as any).renderClock ?? createClock();
133
133
  console.log(`Entry-time:`, (window as any).renderClock.stop());
134
- glitter.share.editerVersion = 'V_18.7.7';
134
+ glitter.share.editerVersion = 'V_18.7.9';
135
135
  glitter.share.start = new Date();
136
136
  const vm = { appConfig: [] };
137
137
  (window as any).saasConfig = {
@@ -1441,82 +1441,58 @@ ${BgWidget.grayNote('未輸入則參照預設')}
1441
1441
  <div class="col-12 col-md-4 p-0 p-md-2">
1442
1442
  <div
1443
1443
  class="w-100 position-relative main-card"
1444
- style="padding: 24px 32px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
1444
+ style="padding: 24px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
1445
1445
  >
1446
- ${(() => {
1447
- if (dd.custom) {
1448
- return html `
1449
- <div
1450
- class="position-absolute d-flex"
1451
- style="cursor:pointer;right:15px;top:15px;gap:5px;"
1452
- >
1453
- ${BgWidget.customButton({
1454
- button: {
1455
- color: 'gray',
1456
- size: 'sm',
1457
- },
1458
- text: {
1459
- name: `物流設定`,
1460
- },
1461
- event: gvc.event(() => {
1462
- updateCustomShipment({
1463
- function: 'replace',
1464
- data: vm.data.custom_delivery.find((d1) => {
1465
- return dd.value === d1.id;
1466
- }),
1467
- });
1468
- }),
1469
- })}
1470
- ${BgWidget.customButton({
1471
- button: {
1472
- color: 'gray',
1473
- size: 'sm',
1474
- },
1475
- text: {
1476
- name: `運費設定`,
1477
- },
1478
- event: gvc.event(() => {
1479
- const vm = {
1480
- gvc: gvc,
1481
- key: dd.value,
1482
- save_event: () => {
1483
- return new Promise((resolve, reject) => {
1484
- resolve(true);
1485
- });
1486
- },
1487
- };
1488
- BgWidget.settingDialog({
1489
- gvc: gvc,
1490
- width: 1200,
1491
- height: document.body.clientHeight - 100,
1492
- title: `『 ${dd.title} 』運費設定`,
1493
- d_main_style: document.body.clientWidth < 768 ? 'padding:0px !important;' : ``,
1494
- innerHTML: (gvc) => {
1495
- vm.gvc = gvc;
1496
- return ShoppingShipmentSetting.main(vm);
1497
- },
1498
- footer_html: gvc => {
1499
- return [
1500
- BgWidget.cancel(gvc.event(() => {
1501
- gvc.closeDialog();
1502
- })),
1503
- BgWidget.save(gvc.event(() => {
1504
- vm.save_event().then(() => { });
1505
- })),
1506
- ].join('');
1507
- },
1508
- });
1509
- }),
1510
- })}
1446
+
1447
+ <div
1448
+ style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex;"
1449
+ >
1450
+ <div style="min-width: 46px;max-width: 46px;">
1451
+ ${dd.type === 'font_awesome' ? dd.src : html ` <img src="${dd.src}" />`}
1452
+ </div>
1453
+ <div
1454
+ style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
1455
+ >
1456
+ <div class="tx_normal">${dd.title}</div>
1457
+ <div class="d-flex align-items-center" style="gap:4px;">
1458
+ <div class="tx_normal">
1459
+ ${vm.data.support.find((d1) => {
1460
+ return dd.value === d1;
1461
+ })
1462
+ ? `開啟`
1463
+ : `關閉`}
1511
1464
  </div>
1512
- `;
1465
+ <div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
1466
+ <input
1467
+ class="form-check-input"
1468
+ type="checkbox"
1469
+ onchange="${gvc.event((e, event) => {
1470
+ if (vm.data.support.find((d1) => {
1471
+ return dd.value === d1;
1472
+ })) {
1473
+ vm.data.support = vm.data.support.filter((d1) => {
1474
+ return dd.value !== d1;
1475
+ });
1513
1476
  }
1514
1477
  else {
1515
- return html ` <div
1516
- class="position-absolute fw-500 d-flex"
1517
- style="cursor:pointer;right:15px;top:15px;gap:5px;"
1518
- >
1519
- ${BgWidget.customButton({
1478
+ vm.data.support.push(dd.value);
1479
+ }
1480
+ save();
1481
+ gvc.notifyDataChange(id);
1482
+ })}"
1483
+ ${vm.data.support.find((d1) => {
1484
+ return dd.value === d1;
1485
+ })
1486
+ ? `checked`
1487
+ : ``}
1488
+ />
1489
+ </div>
1490
+ </div>
1491
+ </div>
1492
+ </div>
1493
+ <div class="w-100 border-top pt-3 mt-n2">
1494
+ ${(() => {
1495
+ let button_action = [BgWidget.customButton({
1520
1496
  button: {
1521
1497
  color: 'gray',
1522
1498
  size: 'sm',
@@ -1561,7 +1537,7 @@ ${[
1561
1537
  </div>`);
1562
1538
  }
1563
1539
  view.push(html ` <div class="d-flex flex-column" style="gap:5px;">
1564
- ${[
1540
+ ${[
1565
1541
  ` <div class="tx_normal">物流配送說明</div>`,
1566
1542
  BgWidget.richTextEditor({
1567
1543
  gvc: gvc,
@@ -1572,7 +1548,7 @@ ${[
1572
1548
  title: '物流配送說明',
1573
1549
  }),
1574
1550
  ].join('')}
1575
- </div>`);
1551
+ </div>`);
1576
1552
  return `<div class="w-100 d-flex flex-column" style="gap:5px;">${view.join(`<div class="w-100 border-bottom my-2"></div>`)}</div>`;
1577
1553
  },
1578
1554
  footer_html: gvc => {
@@ -1598,96 +1574,126 @@ ${[
1598
1574
  },
1599
1575
  });
1600
1576
  })),
1601
- })}
1602
- ${BgWidget.customButton({
1603
- button: {
1604
- color: 'gray',
1605
- size: 'sm',
1606
- },
1607
- text: {
1608
- name: `運費設定`,
1609
- },
1610
- event: gvc.event(() => {
1611
- const vm = {
1612
- gvc: gvc,
1613
- key: dd.value,
1614
- save_event: () => {
1615
- return new Promise((resolve, reject) => {
1616
- resolve(true);
1617
- });
1618
- },
1619
- };
1620
- BgWidget.settingDialog({
1621
- gvc: gvc,
1622
- width: 1200,
1623
- height: document.body.clientHeight - 100,
1624
- title: `『 ${dd.title} 』運費設定`,
1625
- d_main_style: document.body.clientWidth < 768 ? 'padding:0px !important;' : ``,
1626
- innerHTML: (gvc) => {
1627
- vm.gvc = gvc;
1628
- return ShoppingShipmentSetting.main(vm);
1629
- },
1630
- footer_html: gvc => {
1631
- return [
1632
- BgWidget.cancel(gvc.event(() => {
1633
- gvc.closeDialog();
1634
- })),
1635
- BgWidget.save(gvc.event(() => {
1636
- vm.save_event().then(() => { });
1637
- })),
1638
- ].join('');
1639
- },
1640
- });
1641
- }),
1642
- })}
1643
- </div>`;
1644
- }
1645
- })()}
1646
- <div
1647
- style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex;padding-top:22px;"
1648
- >
1649
- <div style="min-width: 46px;max-width: 46px;">
1650
- ${dd.type === 'font_awesome' ? dd.src : html ` <img src="${dd.src}" />`}
1651
- </div>
1652
- <div
1653
- style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
1654
- >
1655
- <div class="tx_normal">${dd.title}</div>
1656
- <div class="d-flex align-items-center" style="gap:4px;">
1657
- <div class="tx_normal">
1658
- ${vm.data.support.find((d1) => {
1659
- return dd.value === d1;
1660
- })
1661
- ? `開啟`
1662
- : `關閉`}
1577
+ })];
1578
+ if (dd.custom) {
1579
+ button_action = button_action.concat([BgWidget.customButton({
1580
+ button: {
1581
+ color: 'gray',
1582
+ size: 'sm',
1583
+ },
1584
+ text: {
1585
+ name: `自訂表單`,
1586
+ },
1587
+ event: gvc.event(() => {
1588
+ updateCustomShipment({
1589
+ function: 'replace',
1590
+ data: vm.data.custom_delivery.find((d1) => {
1591
+ return dd.value === d1.id;
1592
+ }),
1593
+ });
1594
+ }),
1595
+ }), BgWidget.customButton({
1596
+ button: {
1597
+ color: 'gray',
1598
+ size: 'sm',
1599
+ },
1600
+ text: {
1601
+ name: `運費設定`,
1602
+ },
1603
+ event: gvc.event(() => {
1604
+ const vm = {
1605
+ gvc: gvc,
1606
+ key: dd.value,
1607
+ save_event: () => {
1608
+ return new Promise((resolve, reject) => {
1609
+ resolve(true);
1610
+ });
1611
+ },
1612
+ };
1613
+ BgWidget.settingDialog({
1614
+ gvc: gvc,
1615
+ width: 1200,
1616
+ height: document.body.clientHeight - 100,
1617
+ title: `『 ${dd.title} 』運費設定`,
1618
+ d_main_style: document.body.clientWidth < 768 ? 'padding:0px !important;' : ``,
1619
+ innerHTML: (gvc) => {
1620
+ vm.gvc = gvc;
1621
+ return ShoppingShipmentSetting.main(vm);
1622
+ },
1623
+ footer_html: gvc => {
1624
+ return [
1625
+ BgWidget.cancel(gvc.event(() => {
1626
+ gvc.closeDialog();
1627
+ })),
1628
+ BgWidget.save(gvc.event(() => {
1629
+ vm.save_event().then(() => { });
1630
+ })),
1631
+ ].join('');
1632
+ },
1633
+ });
1634
+ }),
1635
+ })]);
1636
+ return html `
1637
+ <div
1638
+ class="d-flex"
1639
+ style="cursor:pointer;gap:5px;"
1640
+ >
1641
+ <div class="flex-fill"></div>
1642
+ ${button_action.join('')}
1663
1643
  </div>
1664
- <div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
1665
- <input
1666
- class="form-check-input"
1667
- type="checkbox"
1668
- onchange="${gvc.event((e, event) => {
1669
- if (vm.data.support.find((d1) => {
1670
- return dd.value === d1;
1671
- })) {
1672
- vm.data.support = vm.data.support.filter((d1) => {
1673
- return dd.value !== d1;
1674
- });
1644
+ `;
1675
1645
  }
1676
1646
  else {
1677
- vm.data.support.push(dd.value);
1647
+ button_action = button_action.concat([BgWidget.customButton({
1648
+ button: {
1649
+ color: 'gray',
1650
+ size: 'sm',
1651
+ },
1652
+ text: {
1653
+ name: `運費設定`,
1654
+ },
1655
+ event: gvc.event(() => {
1656
+ const vm = {
1657
+ gvc: gvc,
1658
+ key: dd.value,
1659
+ save_event: () => {
1660
+ return new Promise((resolve, reject) => {
1661
+ resolve(true);
1662
+ });
1663
+ },
1664
+ };
1665
+ BgWidget.settingDialog({
1666
+ gvc: gvc,
1667
+ width: 1200,
1668
+ height: document.body.clientHeight - 100,
1669
+ title: `『 ${dd.title} 』運費設定`,
1670
+ d_main_style: document.body.clientWidth < 768 ? 'padding:0px !important;' : ``,
1671
+ innerHTML: (gvc) => {
1672
+ vm.gvc = gvc;
1673
+ return ShoppingShipmentSetting.main(vm);
1674
+ },
1675
+ footer_html: gvc => {
1676
+ return [
1677
+ BgWidget.cancel(gvc.event(() => {
1678
+ gvc.closeDialog();
1679
+ })),
1680
+ BgWidget.save(gvc.event(() => {
1681
+ vm.save_event().then(() => { });
1682
+ })),
1683
+ ].join('');
1684
+ },
1685
+ });
1686
+ }),
1687
+ })]);
1688
+ return html ` <div
1689
+ class="d-flex"
1690
+ style="cursor:pointer;gap:5px;"
1691
+ >
1692
+ <div class="flex-fill"></div>
1693
+ ${button_action.join('')}
1694
+ </div>`;
1678
1695
  }
1679
- save();
1680
- gvc.notifyDataChange(id);
1681
- })}"
1682
- ${vm.data.support.find((d1) => {
1683
- return dd.value === d1;
1684
- })
1685
- ? `checked`
1686
- : ``}
1687
- />
1688
- </div>
1689
- </div>
1690
- </div>
1696
+ })()}
1691
1697
  </div>
1692
1698
  </div>
1693
1699
  </div>