@sme.up/ketchup 11.0.0-SNAPSHOT-20241031094059 → 11.0.0-SNAPSHOT-20241031153116

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 (34) hide show
  1. package/dist/cjs/ketchup.cjs.js +1 -1
  2. package/dist/cjs/kup-autocomplete_28.cjs.entry.js +1 -1
  3. package/dist/cjs/kup-autocomplete_28.cjs.entry.js.map +1 -1
  4. package/dist/cjs/kup-input-panel.cjs.entry.js +78 -44
  5. package/dist/cjs/kup-input-panel.cjs.entry.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/kup-input-panel/kup-input-panel-declarations.js.map +1 -1
  8. package/dist/collection/components/kup-input-panel/kup-input-panel.js +103 -44
  9. package/dist/collection/components/kup-input-panel/kup-input-panel.js.map +1 -1
  10. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +3 -3
  11. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js.map +1 -1
  12. package/dist/components/kup-autocomplete2.js +1 -1
  13. package/dist/components/kup-autocomplete2.js.map +1 -1
  14. package/dist/components/kup-input-panel.js +79 -44
  15. package/dist/components/kup-input-panel.js.map +1 -1
  16. package/dist/esm/ketchup.js +1 -1
  17. package/dist/esm/kup-autocomplete_28.entry.js +1 -1
  18. package/dist/esm/kup-autocomplete_28.entry.js.map +1 -1
  19. package/dist/esm/kup-input-panel.entry.js +78 -44
  20. package/dist/esm/kup-input-panel.entry.js.map +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/ketchup/ketchup.esm.js +1 -1
  23. package/dist/ketchup/ketchup.esm.js.map +1 -1
  24. package/dist/ketchup/p-3e5a1fca.entry.js +2 -0
  25. package/dist/ketchup/p-3e5a1fca.entry.js.map +1 -0
  26. package/dist/ketchup/{p-cbf20461.entry.js → p-e036c5cd.entry.js} +2 -2
  27. package/dist/ketchup/{p-cbf20461.entry.js.map → p-e036c5cd.entry.js.map} +1 -1
  28. package/dist/types/components/kup-input-panel/kup-input-panel-declarations.d.ts +1 -0
  29. package/dist/types/components/kup-input-panel/kup-input-panel.d.ts +6 -1
  30. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +1 -1
  31. package/dist/types/components.d.ts +14 -4
  32. package/package.json +1 -1
  33. package/dist/ketchup/p-63683279.entry.js +0 -2
  34. package/dist/ketchup/p-63683279.entry.js.map +0 -1
@@ -152,6 +152,7 @@ const KupInputPanel = class {
152
152
  this.optionsHandler = null;
153
153
  this.customButtonClickHandler = null;
154
154
  this.checkValidObjCallback = null;
155
+ this.checkValidValueCallback = null;
155
156
  this.inputPanelCells = [];
156
157
  this.tabSelected = null;
157
158
  }
@@ -237,7 +238,7 @@ const KupInputPanel = class {
237
238
  h("p", null, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.EMPTY_DATA)),
238
239
  ]
239
240
  : this.inputPanelCells.map((inputPanelCell) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_renderRow).call(this, inputPanelCell));
240
- return (h(Host, { key: '0c92e26e6d89325589f9700d82ac282784a1ad91' }, h("style", { key: 'b211108726b3ebd7f283981588a7f57372c224ce' }, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: 'af20b02f77a9b4613acdd0750c6550ec5f7bee9d', id: componentWrapperId }, inputPanelContent)));
241
+ return (h(Host, { key: '25adc3d7d9a7cf6e33403fd574e07d607142a80e' }, h("style", { key: '2757cf9cf64d9934091fd2bfc2960110abd2795a' }, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: '5a89038f088aed371238fee56d3ad20c8bb9eaee', id: componentWrapperId }, inputPanelContent)));
241
242
  }
242
243
  disconnectedCallback() {
243
244
  __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.unregister(this);
@@ -623,8 +624,10 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
623
624
  }
624
625
  return null;
625
626
  }, _KupInputPanel_CHIAdapter = function _KupInputPanel_CHIAdapter(_options, _fieldLabel, currentValue, cell, id) {
626
- var _a;
627
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
627
+ var _a, _b;
628
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
629
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
630
+ cell.mandatory) {
628
631
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_checkOnBlurEvent).call(this, cell, id);
629
632
  }
630
633
  return CHIAdapter(currentValue);
@@ -665,7 +668,7 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
665
668
  }
666
669
  return Object.assign({ label: cell.value, fun: cell.fun }, cell.data);
667
670
  }, _KupInputPanel_CMBandACPAdapter = function _KupInputPanel_CMBandACPAdapter(rawOptions, fieldLabel, currentValue, cell, id) {
668
- var _a;
671
+ var _a, _b;
669
672
  const configCMandACP = CMBandACPAdapter(currentValue, fieldLabel, []);
670
673
  if (cell.fun) {
671
674
  const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);
@@ -688,14 +691,18 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
688
691
  configCMandACP.data['kup-list'].data =
689
692
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_optionsTreeComboAdapter).call(this, rawOptions, currentValue);
690
693
  }
691
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
694
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
695
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
696
+ cell.mandatory) {
692
697
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_checkOnBlurEvent).call(this, cell, id);
693
698
  }
694
699
  return configCMandACP;
695
700
  }, _KupInputPanel_CHKAdapter = function _KupInputPanel_CHKAdapter(_options, fieldLabel, currentValue, cell, id) {
696
- var _a;
701
+ var _a, _b;
697
702
  let data = CHKAdapter(currentValue, fieldLabel);
698
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
703
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
704
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
705
+ cell.mandatory) {
699
706
  return Object.assign(Object.assign({}, data), { onBlur: () => {
700
707
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_checkOnBlurProp).call(this, cell, id);
701
708
  } });
@@ -714,8 +721,10 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
714
721
  initialValue: currentValue,
715
722
  };
716
723
  }, _KupInputPanel_ITXAdapter = function _KupInputPanel_ITXAdapter(_options, fieldLabel, _currentValue, cell, id) {
717
- var _a;
718
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
724
+ var _a, _b;
725
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
726
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
727
+ cell.mandatory) {
719
728
  return {
720
729
  label: fieldLabel,
721
730
  onBlur: () => {
@@ -725,9 +734,11 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
725
734
  }
726
735
  return { label: fieldLabel };
727
736
  }, _KupInputPanel_RADAdapter = function _KupInputPanel_RADAdapter(options, _fieldLabel, currentValue, cell, id) {
728
- var _a;
737
+ var _a, _b;
729
738
  let data = RADAdapter(currentValue, options);
730
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
739
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
740
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
741
+ cell.mandatory) {
731
742
  return Object.assign(Object.assign({}, data), { onBlur: () => {
732
743
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_checkOnBlurProp).call(this, cell, id);
733
744
  } });
@@ -736,8 +747,10 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
736
747
  }, _KupInputPanel_SWTAdapter = function _KupInputPanel_SWTAdapter(_options, fieldLabel, currentValue) {
737
748
  return SWTAdapter(currentValue, fieldLabel);
738
749
  }, _KupInputPanel_DateAdapter = function _KupInputPanel_DateAdapter(_options, fieldLabel, currentValue, cell, id) {
739
- var _a;
740
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
750
+ var _a, _b;
751
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
752
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
753
+ cell.mandatory) {
741
754
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_checkOnBlurEvent).call(this, cell, id);
742
755
  }
743
756
  return {
@@ -749,8 +762,10 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
749
762
  initialValue: currentValue,
750
763
  };
751
764
  }, _KupInputPanel_ObjectAdapter = function _KupInputPanel_ObjectAdapter(_options, fieldLabel, currentValue, cell, id) {
752
- var _a;
753
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
765
+ var _a, _b;
766
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
767
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
768
+ cell.mandatory) {
754
769
  return {
755
770
  initialValue: currentValue || '',
756
771
  label: fieldLabel || ' ',
@@ -766,8 +781,10 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
766
781
  value: currentValue || '',
767
782
  };
768
783
  }, _KupInputPanel_TimeAdapter = function _KupInputPanel_TimeAdapter(_options, fieldLabel, _currentValue, cell, id) {
769
- var _a;
770
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
784
+ var _a, _b;
785
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
786
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
787
+ cell.mandatory) {
771
788
  __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_checkOnBlurEvent).call(this, cell, id);
772
789
  }
773
790
  return {
@@ -778,8 +795,10 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
778
795
  },
779
796
  };
780
797
  }, _KupInputPanel_NumberAdapter = function _KupInputPanel_NumberAdapter(_options, fieldLabel, _currentValue, cell, id) {
781
- var _a;
782
- if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) || cell.mandatory) {
798
+ var _a, _b;
799
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) ||
800
+ ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) ||
801
+ cell.mandatory) {
783
802
  return {
784
803
  label: fieldLabel,
785
804
  onBlur: () => {
@@ -895,8 +914,8 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
895
914
  (_a = __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_optionsTreeComboAdapter).call(this, options, currentValue)) !== null && _a !== void 0 ? _a : [];
896
915
  detail.comp.refresh();
897
916
  });
898
- }, _KupInputPanel_checkOnBlurProp = function _KupInputPanel_checkOnBlurProp(cell, id) {
899
- var _a;
917
+ }, _KupInputPanel_checkOnBlurProp = async function _KupInputPanel_checkOnBlurProp(cell, id) {
918
+ var _a, _b;
900
919
  const currCell = __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getCell).call(this, id);
901
920
  // Required cell check
902
921
  if (cell.mandatory) {
@@ -905,22 +924,29 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
905
924
  null
906
925
  : // else set the error message
907
926
  __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.REQUIRED_VALUE));
908
- }
909
- if (!currCell.value) {
910
- return;
927
+ if (!currCell.value) {
928
+ return;
929
+ }
911
930
  }
912
931
  // Valid object check
913
- if ((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) {
914
- this.checkValidObjCallback({
932
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) && currCell.value) {
933
+ const { valid } = await this.checkValidObjCallback({
915
934
  obj: cell.obj,
916
935
  currentState: __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_reverseMapCells).call(this),
917
936
  fun: cell.fun,
918
- }).then(({ valid }) => {
919
- __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_setCellError).call(this, id, valid
920
- ? // If it's a valid object remove the error message
921
- null
922
- : // else set the error message
923
- __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.INVALID_VALUE));
937
+ });
938
+ if (valid) {
939
+ __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_setCellError).call(this, id, null);
940
+ }
941
+ else {
942
+ __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_setCellError).call(this, id, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.INVALID_VALUE));
943
+ return;
944
+ }
945
+ }
946
+ if ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) {
947
+ this.checkValidValueCallback({
948
+ before: Object.assign({}, __classPrivateFieldGet(this, _KupInputPanel_originalData, "f")),
949
+ after: __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_reverseMapCells).call(this),
924
950
  });
925
951
  }
926
952
  }, _KupInputPanel_checkOnBlurEvent = function _KupInputPanel_checkOnBlurEvent(cell, id) {
@@ -928,8 +954,8 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
928
954
  if (!evName) {
929
955
  return;
930
956
  }
931
- const handler = (e) => {
932
- var _a;
957
+ const handler = async (e) => {
958
+ var _a, _b;
933
959
  if (e.detail.id !== id) {
934
960
  return;
935
961
  }
@@ -941,21 +967,29 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_optionsAdapterMap = ne
941
967
  : // else set the error message
942
968
  __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.REQUIRED_VALUE);
943
969
  e.detail.comp.refresh();
944
- }
945
- if (!e.detail.value) {
946
- return;
970
+ if (!e.detail.value) {
971
+ return;
972
+ }
947
973
  }
948
974
  // Valid object check
949
- if ((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) {
950
- this.checkValidObjCallback({
975
+ if (((_a = cell.inputSettings) === null || _a === void 0 ? void 0 : _a.checkObject) && e.detail.value) {
976
+ const { valid } = await this.checkValidObjCallback({
951
977
  obj: cell.obj,
952
978
  currentState: __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_reverseMapCells).call(this),
953
979
  fun: cell.fun,
954
- }).then(({ valid }) => {
955
- e.detail.comp.error = valid
956
- ? null
957
- : __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.INVALID_VALUE);
958
- e.detail.comp.refresh();
980
+ });
981
+ e.detail.comp.error = valid
982
+ ? null
983
+ : __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.INVALID_VALUE);
984
+ e.detail.comp.refresh();
985
+ if (!valid) {
986
+ return;
987
+ }
988
+ }
989
+ if ((_b = cell.inputSettings) === null || _b === void 0 ? void 0 : _b.checkValueOnExit) {
990
+ this.checkValidValueCallback({
991
+ before: Object.assign({}, __classPrivateFieldGet(this, _KupInputPanel_originalData, "f")),
992
+ after: __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_reverseMapCells).call(this),
959
993
  });
960
994
  }
961
995
  };