Added Statistics calculation
Statistics now show calculated values
This commit is contained in:
parent
fe87374e47
commit
fc0f69dacb
2147 changed files with 141321 additions and 39 deletions
52
node_modules/@mui/x-date-pickers/internals/utils/createStepNavigation.js
generated
vendored
Normal file
52
node_modules/@mui/x-date-pickers/internals/utils/createStepNavigation.js
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.DEFAULT_STEP_NAVIGATION = void 0;
|
||||
exports.createStepNavigation = createStepNavigation;
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
const DEFAULT_STEP_NAVIGATION = exports.DEFAULT_STEP_NAVIGATION = {
|
||||
hasNextStep: false,
|
||||
hasSeveralSteps: false,
|
||||
goToNextStep: () => {},
|
||||
areViewsInSameStep: () => true
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an object that determines whether there is a next step and allows to go to the next step.
|
||||
* @param {CreateStepNavigationParameters<TStep>} parameters The parameters of the createStepNavigation function
|
||||
* @returns {CreateStepNavigationReturnValue} The return value of the createStepNavigation function
|
||||
*/
|
||||
function createStepNavigation(parameters) {
|
||||
const {
|
||||
steps,
|
||||
isViewMatchingStep,
|
||||
onStepChange
|
||||
} = parameters;
|
||||
return parametersBis => {
|
||||
if (steps == null) {
|
||||
return DEFAULT_STEP_NAVIGATION;
|
||||
}
|
||||
const currentStepIndex = steps.findIndex(step => isViewMatchingStep(parametersBis.view, step));
|
||||
const nextStep = currentStepIndex === -1 || currentStepIndex === steps.length - 1 ? null : steps[currentStepIndex + 1];
|
||||
return {
|
||||
hasNextStep: nextStep != null,
|
||||
hasSeveralSteps: steps.length > 1,
|
||||
goToNextStep: () => {
|
||||
if (nextStep == null) {
|
||||
return;
|
||||
}
|
||||
onStepChange((0, _extends2.default)({}, parametersBis, {
|
||||
step: nextStep
|
||||
}));
|
||||
},
|
||||
areViewsInSameStep: (viewA, viewB) => {
|
||||
const stepA = steps.find(step => isViewMatchingStep(viewA, step));
|
||||
const stepB = steps.find(step => isViewMatchingStep(viewB, step));
|
||||
return stepA === stepB;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue