seeder-st2110-components 1.5.5 → 1.5.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.
package/dist/index.js CHANGED
@@ -2983,6 +2983,10 @@ const Preset = _ref => {
2983
2983
  savePreset,
2984
2984
  removePreset,
2985
2985
  loadPreset,
2986
+ onLoadSuccess,
2987
+ // 加载成功后的回调
2988
+ onLoadError,
2989
+ // 加载失败后的回调
2986
2990
  // 字段配置
2987
2991
  fields = {
2988
2992
  name: {
@@ -3117,10 +3121,20 @@ const Preset = _ref => {
3117
3121
  setTimeout(() => {
3118
3122
  modalInstance.destroy();
3119
3123
  AntdMessage.success(texts.successText);
3124
+
3125
+ // 加载成功的外部回调
3126
+ if (onLoadSuccess) {
3127
+ onLoadSuccess(loadData);
3128
+ }
3120
3129
  }, 1000);
3121
3130
  } catch (error) {
3122
3131
  console.error('Failed to load preset:', error);
3123
3132
  modalInstance.destroy();
3133
+
3134
+ // 加载失败的外部回调
3135
+ if (onLoadError) {
3136
+ onLoadError(error, loadData);
3137
+ }
3124
3138
  }
3125
3139
  }, [loadPreset, texts, AntdMessage]);
3126
3140
  const handleSave = react.useCallback(async () => {