@mcurros2/microm 1.1.64-0 → 1.1.66-0

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
@@ -2075,6 +2075,7 @@ $a1f6b3ef69eb7cc7$var$_MicroMClient_API_URL = new WeakMap(), $a1f6b3ef69eb7cc7$v
2075
2075
  abort_signal = null;
2076
2076
  if ($a1f6b3ef69eb7cc7$var$__classPrivateFieldGet(this, $a1f6b3ef69eb7cc7$var$_MicroMClient_REDIRECT_ON_401, "f")) {
2077
2077
  if (error.status === 401) {
2078
+ console.warn(`${route} 401, redirecting to login page: ${$a1f6b3ef69eb7cc7$var$__classPrivateFieldGet(this, $a1f6b3ef69eb7cc7$var$_MicroMClient_REDIRECT_ON_401, "f")}`);
2078
2079
  yield this.localLogoff();
2079
2080
  window.location.href = $a1f6b3ef69eb7cc7$var$__classPrivateFieldGet(this, $a1f6b3ef69eb7cc7$var$_MicroMClient_REDIRECT_ON_401, "f");
2080
2081
  }
@@ -47904,15 +47905,19 @@ function $611d924da195f578$export$166f000a4c5cc84a(props) {
47904
47905
  const [stepValidating, setStepValidating] = (0, $b4te3$react.useState)(false);
47905
47906
  const [stepValid, setStepValid] = (0, $b4te3$react.useState)(Array(steps.length).fill(false));
47906
47907
  const activeStepItem = steps[activeStep];
47907
- const validateCurrentStepFields = ()=>{
47908
+ const validateCurrentStepFields = (0, $b4te3$react.useCallback)(()=>{
47908
47909
  const currentStep = steps[activeStep];
47909
47910
  if (currentStep.validateFields) {
47910
47911
  const validationResults = currentStep.validateFields.map((field)=>formAPI.form.validateField(field));
47911
47912
  return validationResults.every((result)=>result.hasError === false);
47912
47913
  }
47913
47914
  return true;
47914
- };
47915
- const nextStep = (event)=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
47915
+ }, [
47916
+ activeStep,
47917
+ formAPI.form,
47918
+ steps
47919
+ ]);
47920
+ const nextStep = (0, $b4te3$react.useCallback)((event)=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
47916
47921
  event.preventDefault();
47917
47922
  const currentStep = steps[activeStep];
47918
47923
  let isValid = validateCurrentStepFields();
@@ -47949,8 +47954,15 @@ function $611d924da195f578$export$166f000a4c5cc84a(props) {
47949
47954
  if (activeStep < steps.length - 1) setActiveStep((current)=>current + 1);
47950
47955
  else if (formMode === "view") setActiveStep(steps.length); // Completed step
47951
47956
  }
47952
- });
47953
- const prevStep = (event)=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
47957
+ }), [
47958
+ activeStep,
47959
+ formMode,
47960
+ onNextStep,
47961
+ stepValid,
47962
+ steps,
47963
+ validateCurrentStepFields
47964
+ ]);
47965
+ const prevStep = (0, $b4te3$react.useCallback)((event)=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
47954
47966
  event.preventDefault();
47955
47967
  let isValid = true;
47956
47968
  if (activeStep > 0) {
@@ -47966,42 +47978,21 @@ function $611d924da195f578$export$166f000a4c5cc84a(props) {
47966
47978
  }
47967
47979
  if (isValid) setActiveStep((current)=>current - 1);
47968
47980
  }
47969
- });
47970
- const handleStepClick = (stepIndex)=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
47981
+ }), [
47982
+ activeStep,
47983
+ onPrevStep,
47984
+ steps
47985
+ ]);
47986
+ const handleStepClick = (0, $b4te3$react.useCallback)((stepIndex)=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
47971
47987
  if (stepIndex < activeStep) setActiveStep(stepIndex);
47972
47988
  else if (allowStepClickForward) {
47973
47989
  const isValid = validateCurrentStepFields();
47974
47990
  if (isValid) setActiveStep(stepIndex);
47975
47991
  }
47976
- });
47977
- (0, $b4te3$react.useEffect)(()=>{
47978
- setStepValid((prev)=>{
47979
- const newStepValid = [
47980
- ...prev
47981
- ];
47982
- newStepValid[activeStep] = false;
47983
- return newStepValid;
47984
- });
47985
- }, [
47986
- activeStep
47987
- ]);
47988
- (0, $b4te3$react.useEffect)(()=>{
47989
- if (!status.error && !status.loading && status.data) {
47990
- const dbstat = status.data;
47991
- if (!(dbstat === null || dbstat === void 0 ? void 0 : dbstat.Failed)) setActiveStep(steps.length); // Completed step
47992
- }
47993
- }, [
47994
- status.data,
47995
- status.error,
47996
- status.loading,
47997
- steps.length
47998
- ]);
47999
- (0, $b4te3$react.useEffect)(()=>{
48000
- if (activeStep === steps.length && onCompleted) onCompleted();
48001
- }, [
47992
+ }), [
48002
47993
  activeStep,
48003
- onCompleted,
48004
- steps.length
47994
+ allowStepClickForward,
47995
+ validateCurrentStepFields
48005
47996
  ]);
48006
47997
  const buttons = (0, $b4te3$react.useMemo)(()=>!(hideNextAndBackWhenCompleted && activeStep === steps.length) && (0, $b4te3$reactjsxruntime.jsxs)((0, $b4te3$mantinecore.Group), {
48007
47998
  position: activeStep > 0 ? "apart" : "right",
@@ -48023,10 +48014,6 @@ function $611d924da195f578$export$166f000a4c5cc84a(props) {
48023
48014
  leftIcon: (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$tablericonsreact.IconCircleCheck), {
48024
48015
  size: "1.125rem"
48025
48016
  }),
48026
- onClick: ()=>$611d924da195f578$var$__awaiter(this, void 0, void 0, function*() {
48027
- console.log("stepperForm: submit clicked");
48028
- //await formAPI.handleSubmit()
48029
- }),
48030
48017
  display: formMode !== "view" && activeStep === steps.length - 1 ? "inline-block" : "none",
48031
48018
  children: activeStepItem.nextStepLabel || nextStepLabel
48032
48019
  }, "stepper-submit"),
@@ -48053,6 +48040,35 @@ function $611d924da195f578$export$166f000a4c5cc84a(props) {
48053
48040
  stepValidating,
48054
48041
  steps.length
48055
48042
  ]);
48043
+ (0, $b4te3$react.useEffect)(()=>{
48044
+ setStepValid((prev)=>{
48045
+ const newStepValid = [
48046
+ ...prev
48047
+ ];
48048
+ newStepValid[activeStep] = false;
48049
+ return newStepValid;
48050
+ });
48051
+ }, [
48052
+ activeStep
48053
+ ]);
48054
+ (0, $b4te3$react.useEffect)(()=>{
48055
+ if (!status.error && !status.loading && status.data) {
48056
+ const dbstat = status.data;
48057
+ if (!(dbstat === null || dbstat === void 0 ? void 0 : dbstat.Failed)) setActiveStep(steps.length); // Completed step
48058
+ }
48059
+ }, [
48060
+ status.data,
48061
+ status.error,
48062
+ status.loading,
48063
+ steps.length
48064
+ ]);
48065
+ (0, $b4te3$react.useEffect)(()=>{
48066
+ if (activeStep === steps.length && onCompleted) onCompleted();
48067
+ }, [
48068
+ activeStep,
48069
+ onCompleted,
48070
+ steps.length
48071
+ ]);
48056
48072
  return (0, $b4te3$reactjsxruntime.jsx)((0, $bHLhd.EntityForm), Object.assign({}, rest, {
48057
48073
  buttons: buttons,
48058
48074
  formAPI: formAPI,