ts-glitter 21.4.4 → 21.4.6

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 (39) hide show
  1. package/lowcode/Entry.js +18 -18
  2. package/lowcode/Entry.ts +18 -19
  3. package/lowcode/backend-manager/bg-product.js +8 -6
  4. package/lowcode/backend-manager/bg-product.ts +17 -15
  5. package/lowcode/backend-manager/bg-recommend.js +16 -5
  6. package/lowcode/backend-manager/bg-recommend.ts +15 -5
  7. package/lowcode/backend-manager/bg-widget.js +160 -160
  8. package/lowcode/backend-manager/bg-widget.ts +169 -166
  9. package/lowcode/cms-plugin/POS-setting.js +75 -23
  10. package/lowcode/cms-plugin/POS-setting.ts +87 -30
  11. package/lowcode/cms-plugin/menus-setting.js +165 -37
  12. package/lowcode/cms-plugin/menus-setting.ts +144 -21
  13. package/lowcode/cms-plugin/module/order-excel.js +8 -8
  14. package/lowcode/cms-plugin/module/order-excel.ts +10 -10
  15. package/lowcode/cms-plugin/module/stock-excel.js +184 -0
  16. package/lowcode/cms-plugin/module/stock-excel.ts +205 -0
  17. package/lowcode/cms-plugin/module/vendor-excel.js +375 -0
  18. package/lowcode/cms-plugin/module/vendor-excel.ts +450 -0
  19. package/lowcode/cms-plugin/order/order-module.js +6 -4
  20. package/lowcode/cms-plugin/order/order-module.ts +16 -14
  21. package/lowcode/cms-plugin/pos-pages/models.ts +6 -2
  22. package/lowcode/cms-plugin/pos-pages/products-page.js +589 -469
  23. package/lowcode/cms-plugin/pos-pages/products-page.ts +657 -491
  24. package/lowcode/cms-plugin/shopping-product-setting.js +7 -10
  25. package/lowcode/cms-plugin/shopping-product-setting.ts +12 -10
  26. package/lowcode/cms-plugin/shopping-setting-basic.js +2 -5
  27. package/lowcode/cms-plugin/shopping-setting-basic.ts +2 -5
  28. package/lowcode/cms-plugin/stock-history.js +39 -26
  29. package/lowcode/cms-plugin/stock-history.ts +58 -49
  30. package/lowcode/cms-plugin/stock-vendors.js +18 -13
  31. package/lowcode/cms-plugin/stock-vendors.ts +31 -16
  32. package/lowcode/glitterBundle/html-component/global-widget.js +162 -136
  33. package/lowcode/glitterBundle/html-component/global-widget.ts +430 -382
  34. package/lowcode/public-components/blogs/blogs-01.js +22 -9
  35. package/lowcode/public-components/blogs/blogs-01.ts +28 -14
  36. package/package.json +1 -1
  37. package/src/api-public/services/schedule.js +6 -1
  38. package/src/api-public/services/schedule.js.map +1 -1
  39. package/src/api-public/services/schedule.ts +4 -1
@@ -2705,58 +2705,58 @@ ${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}</textarea
2705
2705
  const height = (_b = obj.height) !== null && _b !== void 0 ? _b : 500;
2706
2706
  const closeHeight = 56;
2707
2707
  obj.gvc.addStyle(`
2708
- .box-container-${text} {
2709
- position: relative;
2710
- height: ${closeHeight}px;
2711
- border: 1px solid #ddd;
2712
- border-radius: 10px;
2713
- overflow-y: hidden;
2714
- transition: height 0.3s ease-out;
2715
- }
2716
- .box-container-${text}.open-box {
2717
- max-height: ${height}px;
2718
- height: ${height}px;
2719
- overflow-y: auto;
2720
- }
2721
- .box-navbar-${text} {
2722
- position: sticky;
2723
- top: 0;
2724
- min-height: 20px;
2725
- background-color: #fff;
2726
- z-index: 10;
2727
- display: flex;
2728
- padding: 15px 20px;
2729
- align-items: flex-start;
2730
- justify-content: space-between;
2731
- cursor: pointer;
2732
- }
2733
- .arrow-icon-${text} {
2734
- color: #393939 !important;
2735
- box-shadow: none !important;
2736
- background-color: #fff !important;
2737
- background-image: url(${BgWidget.arrowDownDataImage('#000')}) !important;
2738
- background-repeat: no-repeat;
2739
- cursor: pointer;
2740
- height: 1rem;
2741
- border: 0;
2742
- margin-top: 0.35rem;
2743
- transition: transform 0.3s;
2744
- }
2745
- .arrow-icon-${text}.open-box {
2746
- margin-top: 0.15rem;
2747
- transform: rotate(180deg);
2748
- }
2749
- .box-inside-${text} {
2750
- padding: 0 1.5rem 1.5rem;
2751
- overflow-y: auto;
2752
- }
2708
+ .box-container-${text} {
2709
+ position: relative;
2710
+ height: ${closeHeight}px;
2711
+ border: 1px solid #ddd;
2712
+ border-radius: 10px;
2713
+ overflow-y: hidden;
2714
+ transition: height 0.3s ease-out;
2715
+ }
2716
+ .box-container-${text}.open-box {
2717
+ max-height: ${height}px;
2718
+ height: ${height}px;
2719
+ overflow-y: auto;
2720
+ }
2721
+ .box-navbar-${text} {
2722
+ position: sticky;
2723
+ top: 0;
2724
+ min-height: 20px;
2725
+ background-color: #fff;
2726
+ z-index: 10;
2727
+ display: flex;
2728
+ padding: 15px 20px;
2729
+ align-items: flex-start;
2730
+ justify-content: space-between;
2731
+ cursor: pointer;
2732
+ }
2733
+ .arrow-icon-${text} {
2734
+ color: #393939 !important;
2735
+ box-shadow: none !important;
2736
+ background-color: #fff !important;
2737
+ background-image: url(${BgWidget.arrowDownDataImage('#000')}) !important;
2738
+ background-repeat: no-repeat;
2739
+ cursor: pointer;
2740
+ height: 1rem;
2741
+ border: 0;
2742
+ margin-top: 0.35rem;
2743
+ transition: transform 0.3s;
2744
+ }
2745
+ .arrow-icon-${text}.open-box {
2746
+ margin-top: 0.15rem;
2747
+ transform: rotate(180deg);
2748
+ }
2749
+ .box-inside-${text} {
2750
+ padding: 0 1.5rem 1.5rem;
2751
+ overflow-y: auto;
2752
+ }
2753
2753
 
2754
- @media (max-width: 768px) {
2755
- .box-inside-${text} {
2756
- padding: 1rem;
2757
- }
2758
- }
2759
- `);
2754
+ @media (max-width: 768px) {
2755
+ .box-inside-${text} {
2756
+ padding: 1rem;
2757
+ }
2758
+ }
2759
+ `);
2760
2760
  return obj.gvc.bindView({
2761
2761
  bind: bvid,
2762
2762
  view: () => {
@@ -2942,74 +2942,28 @@ ${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}</textarea
2942
2942
  let tagList = [];
2943
2943
  let search = '';
2944
2944
  let selectTags = def || [];
2945
+ gvc.addStyle(`
2946
+ .select-tag-dialog {
2947
+ margin-top: 1px;
2948
+ border: 8px solid #fff;
2949
+ outline: 1px solid #aeaeae;
2950
+ height: 300px;
2951
+ width: 100%;
2952
+ border-radius: 5px;
2953
+ position: absolute;
2954
+ top: 0;
2955
+ background-color: #fff;
2956
+ border-radius: 5px;
2957
+ overflow: auto;
2958
+ }
2959
+ `);
2945
2960
  return gvc.bindView({
2946
2961
  bind: id,
2947
2962
  view: () => {
2948
2963
  if (loading) {
2949
2964
  return '';
2950
2965
  }
2951
- if (show) {
2952
- return html `<div
2953
- style="margin-top: 1px;border: 8px solid #fff; outline: 1px solid #aeaeae; height: 300px; width: 100%; border-radius: 5px; position: absolute; top: 0; background-color: #fff; border-radius: 5px; overflow: auto;"
2954
- >
2955
- <div class="position-relative">
2956
- <div
2957
- class="w-100 d-flex align-items-center gap-1 position-sticky mb-1"
2958
- style="top: 0; background-color: #fff;"
2959
- >
2960
- <div class="w-100">
2961
- <i
2962
- class="fa-regular fa-magnifying-glass"
2963
- style="font-size: 18px; color: #A0A0A0; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);"
2964
- aria-hidden="true"
2965
- ></i>
2966
- <input
2967
- class="form-control h-100"
2968
- style="border-radius: 10px; border: 1px solid #DDD; padding-left: 50px; height: 100%;"
2969
- placeholder="${placeholder}"
2970
- onchange="${gvc.event(e => {
2971
- search = `${e.value}`.trim();
2972
- gvc.notifyDataChange(id);
2973
- })}"
2974
- value="${search}"
2975
- />
2976
- </div>
2977
- ${this.customButton({
2978
- button: {
2979
- color: 'black',
2980
- size: 'md',
2981
- },
2982
- text: {
2983
- name: '確認',
2984
- style: 'font-size: 14px;',
2985
- },
2986
- event: gvc.event(() => {
2987
- show = false;
2988
- gvc.notifyDataChange(id);
2989
- callback(selectTags);
2990
- }),
2991
- })}
2992
- </div>
2993
- <div class="p-2">
2994
- ${this.multiCheckboxContainer(gvc, tagList.filter(tag => tag.name.toLowerCase().includes(search.toLowerCase())), selectTags, text => {
2995
- if (search) {
2996
- selectTags = [
2997
- ...new Set(selectTags
2998
- .filter(tag => {
2999
- return !tag.toLowerCase().includes(search.toLowerCase());
3000
- })
3001
- .concat(text)),
3002
- ];
3003
- }
3004
- else {
3005
- selectTags = text;
3006
- }
3007
- }, { single: false })}
3008
- </div>
3009
- </div>
3010
- </div>`;
3011
- }
3012
- else {
2966
+ if (!show) {
3013
2967
  return html `<div
3014
2968
  class="h-100"
3015
2969
  onclick="${gvc.event(() => {
@@ -3024,20 +2978,69 @@ ${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}</textarea
3024
2978
  ></i>
3025
2979
  <div
3026
2980
  class="form-control h-100"
3027
- style="border-radius: 10px; border: 1px solid #DDD; padding-left: 50px; height: 100%; color: #aeaeae; ${selectTags.length >
3028
- 0 && false
3029
- ? 'padding: 0.3rem 3rem;'
3030
- : ''}"
2981
+ style="border-radius: 10px; border: 1px solid #DDD; padding-left: 50px; height: 100%; color: #aeaeae;"
3031
2982
  >
3032
2983
  ${placeholder}
3033
- <!-- ${selectTags.length > 0
3034
- ? html `<div class="d-flex flex-wrap gap-2">
3035
- ${selectTags.map(item => this.normalInsignia(`#${item}`)).join('')}
3036
- </div>`
3037
- : placeholder} -->
3038
2984
  </div>
3039
2985
  </div>`;
3040
2986
  }
2987
+ return html `<div class="select-tag-dialog">
2988
+ <div class="position-relative">
2989
+ <div
2990
+ class="w-100 d-flex align-items-center gap-1 position-sticky mb-1 top-0"
2991
+ style="background-color: #fff;"
2992
+ >
2993
+ <div class="w-100">
2994
+ <i
2995
+ class="fa-regular fa-magnifying-glass"
2996
+ style="font-size: 18px; color: #A0A0A0; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);"
2997
+ aria-hidden="true"
2998
+ ></i>
2999
+ <input
3000
+ class="form-control h-100"
3001
+ style="border-radius: 10px; border: 1px solid #DDD; padding-left: 50px; height: 100%;"
3002
+ placeholder="${placeholder}"
3003
+ onchange="${gvc.event(e => {
3004
+ search = `${e.value}`.trim();
3005
+ gvc.notifyDataChange(id);
3006
+ })}"
3007
+ value="${search}"
3008
+ />
3009
+ </div>
3010
+ ${this.customButton({
3011
+ button: {
3012
+ color: 'black',
3013
+ size: 'md',
3014
+ },
3015
+ text: {
3016
+ name: '確認',
3017
+ style: 'font-size: 14px;',
3018
+ },
3019
+ event: gvc.event(() => {
3020
+ show = false;
3021
+ gvc.notifyDataChange(id);
3022
+ callback(selectTags);
3023
+ }),
3024
+ })}
3025
+ </div>
3026
+ <div class="p-2">
3027
+ ${this.multiCheckboxContainer(gvc, tagList.filter(tag => tag.name.toLowerCase().includes(search.toLowerCase())), selectTags, text => {
3028
+ if (search) {
3029
+ selectTags = [
3030
+ ...new Set(selectTags
3031
+ .filter(tag => {
3032
+ return !tag.toLowerCase().includes(search.toLowerCase());
3033
+ })
3034
+ .concat(text)),
3035
+ ];
3036
+ }
3037
+ else {
3038
+ selectTags = text;
3039
+ }
3040
+ }, { single: false })}
3041
+ </div>
3042
+ </div>
3043
+ </div>`;
3041
3044
  },
3042
3045
  divCreate: {
3043
3046
  class: 'w-100 position-relative search-tags-filter',
@@ -3049,10 +3052,7 @@ ${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}</textarea
3049
3052
  var _b, _c;
3050
3053
  if (dd.result && ((_c = (_b = dd.response) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.list)) {
3051
3054
  return dd.response.value.list.map((item) => {
3052
- return {
3053
- key: item,
3054
- name: `#${item}`,
3055
- };
3055
+ return { key: item, name: `#${item}` };
3056
3056
  });
3057
3057
  }
3058
3058
  return [];
@@ -3315,16 +3315,16 @@ ${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}</textarea
3315
3315
  def: JSON.parse(JSON.stringify(obj.default)),
3316
3316
  };
3317
3317
  obj.gvc.addStyle(`
3318
- .${vm.random}-opt {
3319
- background-color: white;
3320
- gap: 24px;
3321
- padding: 6px;
3322
- }
3323
- .${vm.random}-opt:hover {
3324
- border-radius: 5px;
3325
- background-color: #e8e8e8;
3326
- }
3327
- `);
3318
+ .${vm.random}-opt {
3319
+ background-color: white;
3320
+ gap: 24px;
3321
+ padding: 6px;
3322
+ }
3323
+ .${vm.random}-opt:hover {
3324
+ border-radius: 5px;
3325
+ background-color: #e8e8e8;
3326
+ }
3327
+ `);
3328
3328
  return obj.gvc.bindView({
3329
3329
  bind: vm.id,
3330
3330
  view: () => {
@@ -4284,31 +4284,31 @@ ${(_d = obj.default) !== null && _d !== void 0 ? _d : ''}</textarea
4284
4284
  })();
4285
4285
  const transX = obj.align === 'center' ? '-50%' : '0';
4286
4286
  obj.gvc.addStyle(`
4287
- .bounce-effect-${className} {
4288
- animation: bounce 0.5s alternate;
4289
- animation-iteration-count: 2;
4290
- position: fixed;
4291
- ${fixedStyle}
4292
- background-color: #393939;
4293
- opacity: 0.85;
4294
- color: white;
4295
- padding: 10px;
4296
- border-radius: 8px;
4297
- width: ${(_b = obj.width) !== null && _b !== void 0 ? _b : 120}px;
4298
- text-align: center;
4299
- z-index: 11;
4300
- transform: translateX(${transX});
4301
- }
4287
+ .bounce-effect-${className} {
4288
+ animation: bounce 0.5s alternate;
4289
+ animation-iteration-count: 2;
4290
+ position: fixed;
4291
+ ${fixedStyle}
4292
+ background-color: #393939;
4293
+ opacity: 0.85;
4294
+ color: white;
4295
+ padding: 10px;
4296
+ border-radius: 8px;
4297
+ width: ${(_b = obj.width) !== null && _b !== void 0 ? _b : 120}px;
4298
+ text-align: center;
4299
+ z-index: 11;
4300
+ transform: translateX(${transX});
4301
+ }
4302
4302
 
4303
- @keyframes bounce {
4304
- 0% {
4305
- transform: translate(${transX}, 0);
4306
- }
4307
- 100% {
4308
- transform: translate(${transX}, -6px);
4309
- }
4310
- }
4311
- `);
4303
+ @keyframes bounce {
4304
+ 0% {
4305
+ transform: translate(${transX}, 0);
4306
+ }
4307
+ 100% {
4308
+ transform: translate(${transX}, -6px);
4309
+ }
4310
+ }
4311
+ `);
4312
4312
  const htmlString = html ` <div class="bounce-effect-${className}">${obj.text}</div>`;
4313
4313
  obj.gvc.glitter.document.body.insertAdjacentHTML('beforeend', htmlString);
4314
4314
  setTimeout(() => {