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
48
node_modules/@mui/x-date-pickers/hooks/useParsedFormat.js
generated
vendored
Normal file
48
node_modules/@mui/x-date-pickers/hooks/useParsedFormat.js
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
"use strict";
|
||||
'use client';
|
||||
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.useParsedFormat = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _RtlProvider = require("@mui/system/RtlProvider");
|
||||
var _usePickerAdapter = require("./usePickerAdapter");
|
||||
var _buildSectionsFromFormat = require("../internals/hooks/useField/buildSectionsFromFormat");
|
||||
var _useField = require("../internals/hooks/useField/useField.utils");
|
||||
var _usePickerTranslations = require("./usePickerTranslations");
|
||||
var _useNullablePickerContext = require("../internals/hooks/useNullablePickerContext");
|
||||
/**
|
||||
* Returns the parsed format to be rendered in the field when there is no value or in other parts of the Picker.
|
||||
* This format is localized (for example `AAAA` for the year with the French locale) and cannot be parsed by your date library.
|
||||
* @param {object} The parameters needed to build the placeholder.
|
||||
* @param {string} params.format Format to parse.
|
||||
* @returns
|
||||
*/
|
||||
const useParsedFormat = (parameters = {}) => {
|
||||
const pickerContext = (0, _useNullablePickerContext.useNullablePickerContext)();
|
||||
const adapter = (0, _usePickerAdapter.usePickerAdapter)();
|
||||
const isRtl = (0, _RtlProvider.useRtl)();
|
||||
const translations = (0, _usePickerTranslations.usePickerTranslations)();
|
||||
const localizedDigits = React.useMemo(() => (0, _useField.getLocalizedDigits)(adapter), [adapter]);
|
||||
const {
|
||||
format = pickerContext?.fieldFormat ?? adapter.formats.fullDate
|
||||
} = parameters;
|
||||
return React.useMemo(() => {
|
||||
const sections = (0, _buildSectionsFromFormat.buildSectionsFromFormat)({
|
||||
adapter,
|
||||
format,
|
||||
formatDensity: 'dense',
|
||||
isRtl,
|
||||
shouldRespectLeadingZeros: true,
|
||||
localeText: translations,
|
||||
localizedDigits,
|
||||
date: null,
|
||||
// TODO v9: Make sure we still don't reverse in `buildSectionsFromFormat` when using `useParsedFormat`.
|
||||
enableAccessibleFieldDOMStructure: false
|
||||
});
|
||||
return sections.map(section => `${section.startSeparator}${section.placeholder}${section.endSeparator}`).join('');
|
||||
}, [adapter, isRtl, translations, localizedDigits, format]);
|
||||
};
|
||||
exports.useParsedFormat = useParsedFormat;
|
||||
Loading…
Add table
Add a link
Reference in a new issue