@mui/x-date-pickers 7.0.0-alpha.5 → 7.0.0-alpha.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/CHANGELOG.md +226 -6
- package/PickersSectionList/PickersSectionList.d.ts +11 -0
- package/PickersSectionList/PickersSectionList.js +223 -0
- package/PickersSectionList/PickersSectionList.types.d.ts +56 -0
- package/PickersSectionList/index.d.ts +4 -0
- package/PickersSectionList/index.js +2 -0
- package/PickersSectionList/package.json +6 -0
- package/PickersSectionList/pickersSectionListClasses.d.ts +11 -0
- package/PickersSectionList/pickersSectionListClasses.js +6 -0
- package/index.d.ts +1 -0
- package/index.js +4 -1
- package/internals/components/{PickersTextField → PickersInput}/Outline.d.ts +1 -0
- package/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
- package/internals/components/PickersInput/PickersFilledInput.d.ts +3 -0
- package/internals/components/PickersInput/PickersFilledInput.js +166 -0
- package/internals/components/PickersInput/PickersInput.d.ts +15 -0
- package/internals/components/{PickersTextField → PickersInput}/PickersInput.js +78 -106
- package/internals/components/PickersInput/PickersInput.types.d.ts +60 -0
- package/internals/components/PickersInput/PickersOutlinedInput.d.ts +3 -0
- package/internals/components/PickersInput/PickersOutlinedInput.js +117 -0
- package/internals/components/PickersInput/PickersStandardInput.d.ts +3 -0
- package/internals/components/PickersInput/PickersStandardInput.js +123 -0
- package/internals/components/PickersInput/index.d.ts +4 -0
- package/internals/components/PickersInput/index.js +3 -0
- package/internals/components/PickersInput/pickersInputClasses.d.ts +84 -0
- package/internals/components/PickersInput/pickersInputClasses.js +18 -0
- package/internals/components/PickersTextField/PickersTextField.d.ts +1 -2
- package/internals/components/PickersTextField/PickersTextField.js +15 -6
- package/internals/components/PickersTextField/PickersTextField.types.d.ts +46 -3
- package/internals/components/PickersTextField/pickersTextFieldClasses.d.ts +0 -31
- package/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
- package/internals/hooks/useField/useField.js +8 -1
- package/legacy/PickersSectionList/PickersSectionList.js +230 -0
- package/legacy/PickersSectionList/index.js +2 -0
- package/legacy/PickersSectionList/pickersSectionListClasses.js +6 -0
- package/legacy/index.js +4 -1
- package/legacy/internals/components/{PickersTextField → PickersInput}/Outline.js +40 -22
- package/legacy/internals/components/PickersInput/PickersFilledInput.js +161 -0
- package/legacy/internals/components/{PickersTextField → PickersInput}/PickersInput.js +75 -90
- package/legacy/internals/components/PickersInput/PickersInput.types.js +1 -0
- package/legacy/internals/components/PickersInput/PickersOutlinedInput.js +110 -0
- package/legacy/internals/components/PickersInput/PickersStandardInput.js +117 -0
- package/legacy/internals/components/PickersInput/index.js +3 -0
- package/legacy/internals/components/PickersInput/pickersInputClasses.js +18 -0
- package/legacy/internals/components/PickersTextField/PickersTextField.js +16 -7
- package/legacy/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
- package/legacy/internals/hooks/useField/useField.js +8 -1
- package/legacy/locales/ruRU.js +1 -2
- package/locales/ruRU.js +1 -2
- package/modern/PickersSectionList/PickersSectionList.js +221 -0
- package/modern/PickersSectionList/PickersSectionList.types.js +1 -0
- package/modern/PickersSectionList/index.js +2 -0
- package/modern/PickersSectionList/pickersSectionListClasses.js +6 -0
- package/modern/index.js +4 -1
- package/modern/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
- package/modern/internals/components/PickersInput/PickersFilledInput.js +165 -0
- package/modern/internals/components/{PickersTextField → PickersInput}/PickersInput.js +78 -106
- package/modern/internals/components/PickersInput/PickersInput.types.js +1 -0
- package/modern/internals/components/PickersInput/PickersOutlinedInput.js +117 -0
- package/modern/internals/components/PickersInput/PickersStandardInput.js +123 -0
- package/modern/internals/components/PickersInput/index.js +3 -0
- package/modern/internals/components/PickersInput/pickersInputClasses.js +18 -0
- package/modern/internals/components/PickersTextField/PickersTextField.js +15 -6
- package/modern/internals/components/PickersTextField/pickersTextFieldClasses.js +3 -6
- package/modern/internals/hooks/useField/useField.js +8 -1
- package/modern/locales/ruRU.js +1 -2
- package/node/PickersSectionList/PickersSectionList.js +228 -0
- package/node/PickersSectionList/index.js +49 -0
- package/node/PickersSectionList/pickersSectionListClasses.js +14 -0
- package/node/index.js +13 -1
- package/node/internals/components/{PickersTextField → PickersInput}/Outline.js +35 -19
- package/node/internals/components/PickersInput/PickersFilledInput.js +174 -0
- package/node/internals/components/{PickersTextField → PickersInput}/PickersInput.js +80 -108
- package/node/internals/components/PickersInput/PickersInput.types.js +5 -0
- package/node/internals/components/PickersInput/PickersOutlinedInput.js +125 -0
- package/node/internals/components/PickersInput/PickersStandardInput.js +132 -0
- package/node/internals/components/PickersInput/index.js +32 -0
- package/node/internals/components/PickersInput/pickersInputClasses.js +29 -0
- package/node/internals/components/PickersTextField/PickersTextField.js +15 -6
- package/node/internals/components/PickersTextField/pickersTextFieldClasses.js +6 -9
- package/node/internals/hooks/useField/useField.js +8 -1
- package/node/locales/ruRU.js +1 -2
- package/package.json +4 -4
- package/internals/components/PickersTextField/PickersInput.d.ts +0 -3
- package/internals/components/PickersTextField/PickersInput.types.d.ts +0 -45
- /package/{internals/components/PickersTextField/PickersInput.types.js → PickersSectionList/PickersSectionList.types.js} +0 -0
- /package/{legacy/internals/components/PickersTextField → internals/components/PickersInput}/PickersInput.types.js +0 -0
- /package/{modern/internals/components/PickersTextField/PickersInput.types.js → legacy/PickersSectionList/PickersSectionList.types.js} +0 -0
- /package/node/{internals/components/PickersTextField/PickersInput.types.js → PickersSectionList/PickersSectionList.types.js} +0 -0
package/modern/locales/ruRU.js
CHANGED
|
@@ -42,8 +42,7 @@ const ruRUPickers = {
|
|
|
42
42
|
// Open picker labels
|
|
43
43
|
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите дату, выбрана дата ${utils.format(value, 'fullDate')}` : 'Выберите дату',
|
|
44
44
|
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Выберите время, выбрано время ${utils.format(value, 'fullTime')}` : 'Выберите время',
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
fieldClearLabel: 'Очистить значение',
|
|
47
46
|
// Table labels
|
|
48
47
|
timeTableLabel: 'выбрать время',
|
|
49
48
|
dateTableLabel: 'выбрать дату',
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PickersSectionListSectionSeparator = exports.PickersSectionListSectionContent = exports.PickersSectionListSection = exports.PickersSectionListRoot = exports.PickersSectionList = void 0;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _styled = _interopRequireDefault(require("@mui/system/styled"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _utils = require("@mui/base/utils");
|
|
14
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
16
|
+
var _pickersSectionListClasses = require("./pickersSectionListClasses");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const _excluded = ["slots", "slotProps", "elements", "sectionListRef"];
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
const PickersSectionListRoot = exports.PickersSectionListRoot = (0, _styled.default)('div', {
|
|
22
|
+
name: 'MuiPickersSectionList',
|
|
23
|
+
slot: 'Root',
|
|
24
|
+
overridesResolver: (props, styles) => styles.root
|
|
25
|
+
})({
|
|
26
|
+
direction: 'ltr /*! @noflip */',
|
|
27
|
+
outline: 'none'
|
|
28
|
+
});
|
|
29
|
+
const PickersSectionListSection = exports.PickersSectionListSection = (0, _styled.default)('span', {
|
|
30
|
+
name: 'MuiPickersSectionList',
|
|
31
|
+
slot: 'Section',
|
|
32
|
+
overridesResolver: (props, styles) => styles.section
|
|
33
|
+
})({});
|
|
34
|
+
const PickersSectionListSectionSeparator = exports.PickersSectionListSectionSeparator = (0, _styled.default)('span', {
|
|
35
|
+
name: 'MuiPickersSectionList',
|
|
36
|
+
slot: 'SectionSeparator',
|
|
37
|
+
overridesResolver: (props, styles) => styles.sectionSeparator
|
|
38
|
+
})({
|
|
39
|
+
whiteSpace: 'pre'
|
|
40
|
+
});
|
|
41
|
+
const PickersSectionListSectionContent = exports.PickersSectionListSectionContent = (0, _styled.default)('span', {
|
|
42
|
+
name: 'MuiPickersSectionList',
|
|
43
|
+
slot: 'SectionContent',
|
|
44
|
+
overridesResolver: (props, styles) => styles.sectionContent
|
|
45
|
+
})({
|
|
46
|
+
outline: 'none'
|
|
47
|
+
});
|
|
48
|
+
const useUtilityClasses = ownerState => {
|
|
49
|
+
const {
|
|
50
|
+
classes
|
|
51
|
+
} = ownerState;
|
|
52
|
+
const slots = {
|
|
53
|
+
root: ['root'],
|
|
54
|
+
section: ['section'],
|
|
55
|
+
sectionContent: ['sectionContent']
|
|
56
|
+
};
|
|
57
|
+
return (0, _composeClasses.default)(slots, _pickersSectionListClasses.getPickersSectionListUtilityClass, classes);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Demos:
|
|
61
|
+
*
|
|
62
|
+
* - [Custom field](https://mui.com/x/react-date-pickers/custom-field/)
|
|
63
|
+
*
|
|
64
|
+
* API:
|
|
65
|
+
*
|
|
66
|
+
* - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)
|
|
67
|
+
*/
|
|
68
|
+
function PickersSection(props) {
|
|
69
|
+
const {
|
|
70
|
+
slots,
|
|
71
|
+
slotProps,
|
|
72
|
+
element,
|
|
73
|
+
classes
|
|
74
|
+
} = props;
|
|
75
|
+
const Section = slots?.section ?? PickersSectionListSection;
|
|
76
|
+
const sectionProps = (0, _utils.useSlotProps)({
|
|
77
|
+
elementType: Section,
|
|
78
|
+
externalSlotProps: slotProps?.section,
|
|
79
|
+
externalForwardedProps: element.container,
|
|
80
|
+
className: classes.section,
|
|
81
|
+
ownerState: {}
|
|
82
|
+
});
|
|
83
|
+
const SectionContent = slots?.sectionContent ?? PickersSectionListSectionContent;
|
|
84
|
+
const sectionContentProps = (0, _utils.useSlotProps)({
|
|
85
|
+
elementType: SectionContent,
|
|
86
|
+
externalSlotProps: slotProps?.sectionContent,
|
|
87
|
+
externalForwardedProps: element.content,
|
|
88
|
+
additionalProps: {
|
|
89
|
+
suppressContentEditableWarning: true
|
|
90
|
+
},
|
|
91
|
+
className: classes.sectionContent,
|
|
92
|
+
ownerState: {}
|
|
93
|
+
});
|
|
94
|
+
const SectionSeparator = slots?.sectionSeparator ?? PickersSectionListSectionSeparator;
|
|
95
|
+
const sectionSeparatorBeforeProps = (0, _utils.useSlotProps)({
|
|
96
|
+
elementType: SectionSeparator,
|
|
97
|
+
externalSlotProps: slotProps?.sectionSeparator,
|
|
98
|
+
externalForwardedProps: element.before,
|
|
99
|
+
ownerState: {
|
|
100
|
+
position: 'before'
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const sectionSeparatorAfterProps = (0, _utils.useSlotProps)({
|
|
104
|
+
elementType: SectionSeparator,
|
|
105
|
+
externalSlotProps: slotProps?.sectionSeparator,
|
|
106
|
+
externalForwardedProps: element.after,
|
|
107
|
+
ownerState: {
|
|
108
|
+
position: 'after'
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Section, (0, _extends2.default)({}, sectionProps, {
|
|
112
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionSeparator, (0, _extends2.default)({}, sectionSeparatorBeforeProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionContent, (0, _extends2.default)({}, sectionContentProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionSeparator, (0, _extends2.default)({}, sectionSeparatorAfterProps))]
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
const PickersSectionList = exports.PickersSectionList = /*#__PURE__*/React.forwardRef(function PickersSectionList(props, ref) {
|
|
116
|
+
const {
|
|
117
|
+
slots,
|
|
118
|
+
slotProps,
|
|
119
|
+
elements,
|
|
120
|
+
sectionListRef
|
|
121
|
+
} = props,
|
|
122
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
123
|
+
const classes = useUtilityClasses(props);
|
|
124
|
+
const rootRef = React.useRef(null);
|
|
125
|
+
const handleRootRef = (0, _useForkRef.default)(ref, rootRef);
|
|
126
|
+
const getRoot = methodName => {
|
|
127
|
+
if (!rootRef.current) {
|
|
128
|
+
throw new Error(`MUI: Cannot call sectionListRef.${methodName} before the mount of the component`);
|
|
129
|
+
}
|
|
130
|
+
return rootRef.current;
|
|
131
|
+
};
|
|
132
|
+
React.useImperativeHandle(sectionListRef, () => ({
|
|
133
|
+
getRoot() {
|
|
134
|
+
return getRoot('getRoot');
|
|
135
|
+
},
|
|
136
|
+
getSectionContainer(index) {
|
|
137
|
+
const root = getRoot('getSectionContainer');
|
|
138
|
+
return root.querySelector(`.${_pickersSectionListClasses.pickersSectionListClasses.section}[data-sectionindex="${index}"]`);
|
|
139
|
+
},
|
|
140
|
+
getSectionContent(index) {
|
|
141
|
+
const root = getRoot('getSectionContent');
|
|
142
|
+
return root.querySelector(`.${_pickersSectionListClasses.pickersSectionListClasses.section}[data-sectionindex="${index}"] .${_pickersSectionListClasses.pickersSectionListClasses.sectionContent}`);
|
|
143
|
+
},
|
|
144
|
+
getSectionIndexFromDOMElement(element) {
|
|
145
|
+
const root = getRoot('getSectionIndexFromDOMElement');
|
|
146
|
+
if (element == null || !root.contains(element)) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
let sectionContainer = null;
|
|
150
|
+
if (element.classList.contains(_pickersSectionListClasses.pickersSectionListClasses.section)) {
|
|
151
|
+
sectionContainer = element;
|
|
152
|
+
} else if (element.classList.contains(_pickersSectionListClasses.pickersSectionListClasses.sectionContent)) {
|
|
153
|
+
sectionContainer = element.parentElement;
|
|
154
|
+
}
|
|
155
|
+
if (sectionContainer == null) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return Number(sectionContainer.dataset.sectionindex);
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
const Root = slots?.root ?? PickersSectionListRoot;
|
|
162
|
+
const rootProps = (0, _utils.useSlotProps)({
|
|
163
|
+
elementType: Root,
|
|
164
|
+
externalSlotProps: slotProps?.root,
|
|
165
|
+
externalForwardedProps: other,
|
|
166
|
+
additionalProps: {
|
|
167
|
+
ref: handleRootRef,
|
|
168
|
+
suppressContentEditableWarning: true
|
|
169
|
+
},
|
|
170
|
+
className: classes.root,
|
|
171
|
+
ownerState: {}
|
|
172
|
+
});
|
|
173
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({}, rootProps, {
|
|
174
|
+
children: rootProps.contentEditable ? elements.map(({
|
|
175
|
+
content,
|
|
176
|
+
before,
|
|
177
|
+
after
|
|
178
|
+
}) => `${before.children}${content.children}${after.children}`).join('') : /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
179
|
+
children: elements.map((element, elementIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)(PickersSection, {
|
|
180
|
+
slots: slots,
|
|
181
|
+
slotProps: slotProps,
|
|
182
|
+
element: element,
|
|
183
|
+
classes: classes
|
|
184
|
+
}, elementIndex))
|
|
185
|
+
})
|
|
186
|
+
}));
|
|
187
|
+
});
|
|
188
|
+
process.env.NODE_ENV !== "production" ? PickersSectionList.propTypes = {
|
|
189
|
+
// ----------------------------- Warning --------------------------------
|
|
190
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
191
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
192
|
+
// ----------------------------------------------------------------------
|
|
193
|
+
/**
|
|
194
|
+
* Override or extend the styles applied to the component.
|
|
195
|
+
*/
|
|
196
|
+
classes: _propTypes.default.object,
|
|
197
|
+
/**
|
|
198
|
+
* If true, the whole element is editable.
|
|
199
|
+
* Useful when all the sections are selected.
|
|
200
|
+
*/
|
|
201
|
+
contentEditable: _propTypes.default.bool.isRequired,
|
|
202
|
+
/**
|
|
203
|
+
* The elements to render.
|
|
204
|
+
* Each element contains the prop to edit a section of the value.
|
|
205
|
+
*/
|
|
206
|
+
elements: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
207
|
+
after: _propTypes.default.object.isRequired,
|
|
208
|
+
before: _propTypes.default.object.isRequired,
|
|
209
|
+
container: _propTypes.default.object.isRequired,
|
|
210
|
+
content: _propTypes.default.object.isRequired
|
|
211
|
+
})).isRequired,
|
|
212
|
+
sectionListRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
213
|
+
current: _propTypes.default.shape({
|
|
214
|
+
getRoot: _propTypes.default.func.isRequired,
|
|
215
|
+
getSectionContainer: _propTypes.default.func.isRequired,
|
|
216
|
+
getSectionContent: _propTypes.default.func.isRequired,
|
|
217
|
+
getSectionIndexFromDOMElement: _propTypes.default.func.isRequired
|
|
218
|
+
})
|
|
219
|
+
})]),
|
|
220
|
+
/**
|
|
221
|
+
* The props used for each component slot.
|
|
222
|
+
*/
|
|
223
|
+
slotProps: _propTypes.default.object,
|
|
224
|
+
/**
|
|
225
|
+
* Overridable component slots.
|
|
226
|
+
*/
|
|
227
|
+
slots: _propTypes.default.object
|
|
228
|
+
} : void 0;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Unstable_PickersSectionList", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _PickersSectionList.PickersSectionList;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Unstable_PickersSectionListRoot", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _PickersSectionList.PickersSectionListRoot;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Unstable_PickersSectionListSection", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _PickersSectionList.PickersSectionListSection;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "Unstable_PickersSectionListSectionContent", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _PickersSectionList.PickersSectionListSectionContent;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "Unstable_PickersSectionListSectionSeparator", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _PickersSectionList.PickersSectionListSectionSeparator;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "getPickersSectionListUtilityClass", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _pickersSectionListClasses.getPickersSectionListUtilityClass;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "pickersSectionListClasses", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _pickersSectionListClasses.pickersSectionListClasses;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var _PickersSectionList = require("./PickersSectionList");
|
|
49
|
+
var _pickersSectionListClasses = require("./pickersSectionListClasses");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getPickersSectionListUtilityClass = getPickersSectionListUtilityClass;
|
|
8
|
+
exports.pickersSectionListClasses = void 0;
|
|
9
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
10
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
11
|
+
function getPickersSectionListUtilityClass(slot) {
|
|
12
|
+
return (0, _generateUtilityClass.default)('MuiPickersSectionList', slot);
|
|
13
|
+
}
|
|
14
|
+
const pickersSectionListClasses = exports.pickersSectionListClasses = (0, _generateUtilityClasses.default)('MuiPickersSectionList', ['root', 'section', 'sectionContent']);
|
package/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers v7.0.0-alpha.
|
|
2
|
+
* @mui/x-date-pickers v7.0.0-alpha.6
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -391,6 +391,18 @@ Object.keys(_PickersCalendarHeader).forEach(function (key) {
|
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
393
|
});
|
|
394
|
+
var _PickersSectionList = require("./PickersSectionList");
|
|
395
|
+
Object.keys(_PickersSectionList).forEach(function (key) {
|
|
396
|
+
if (key === "default" || key === "__esModule") return;
|
|
397
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
398
|
+
if (key in exports && exports[key] === _PickersSectionList[key]) return;
|
|
399
|
+
Object.defineProperty(exports, key, {
|
|
400
|
+
enumerable: true,
|
|
401
|
+
get: function () {
|
|
402
|
+
return _PickersSectionList[key];
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
});
|
|
394
406
|
var _utils = require("./internals/utils/utils");
|
|
395
407
|
var _models = require("./models");
|
|
396
408
|
Object.keys(_models).forEach(function (key) {
|
|
@@ -13,22 +13,38 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
13
13
|
const _excluded = ["children", "className", "label"];
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
-
const OutlineRoot = (0, _styles.styled)('fieldset'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
const OutlineRoot = (0, _styles.styled)('fieldset', {
|
|
17
|
+
name: 'MuiPickersOutlinedInput',
|
|
18
|
+
slot: 'NotchedOutline',
|
|
19
|
+
overridesResolver: (props, styles) => styles.notchedOutline
|
|
20
|
+
})(({
|
|
21
|
+
theme
|
|
22
|
+
}) => {
|
|
23
|
+
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
24
|
+
return {
|
|
25
|
+
textAlign: 'left',
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
bottom: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
top: -5,
|
|
30
|
+
left: 0,
|
|
31
|
+
margin: 0,
|
|
32
|
+
padding: '0 8px',
|
|
33
|
+
pointerEvents: 'none',
|
|
34
|
+
borderRadius: 'inherit',
|
|
35
|
+
borderStyle: 'solid',
|
|
36
|
+
borderWidth: 1,
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
minWidth: '0%',
|
|
39
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
40
|
+
};
|
|
31
41
|
});
|
|
42
|
+
const OutlineLabel = (0, _styles.styled)('span')(({
|
|
43
|
+
theme
|
|
44
|
+
}) => ({
|
|
45
|
+
fontFamily: theme.typography.fontFamily,
|
|
46
|
+
fontSize: 'inherit'
|
|
47
|
+
}));
|
|
32
48
|
const OutlineLegend = (0, _styles.styled)('legend')(({
|
|
33
49
|
ownerState,
|
|
34
50
|
theme
|
|
@@ -87,17 +103,17 @@ function Outline(props) {
|
|
|
87
103
|
});
|
|
88
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(OutlineRoot, (0, _extends2.default)({
|
|
89
105
|
"aria-hidden": true,
|
|
90
|
-
className: className
|
|
91
|
-
ownerState: ownerState
|
|
106
|
+
className: className
|
|
92
107
|
}, other, {
|
|
108
|
+
ownerState: ownerState,
|
|
93
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OutlineLegend, {
|
|
94
110
|
ownerState: ownerState,
|
|
95
|
-
children: withLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
111
|
+
children: withLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(OutlineLabel, {
|
|
96
112
|
children: label
|
|
97
113
|
}) :
|
|
98
114
|
/*#__PURE__*/
|
|
99
115
|
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
100
|
-
(0, _jsxRuntime.jsx)(
|
|
116
|
+
(0, _jsxRuntime.jsx)(OutlineLabel, {
|
|
101
117
|
className: "notranslate",
|
|
102
118
|
children: "\u200B"
|
|
103
119
|
})
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PickersFilledInput = void 0;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _FormControl = require("@mui/material/FormControl");
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _utils = require("@mui/utils");
|
|
14
|
+
var _pickersInputClasses = require("./pickersInputClasses");
|
|
15
|
+
var _PickersInput = require("./PickersInput");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["label", "autoFocus", "ownerState"];
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
const FilledInputRoot = (0, _styles.styled)(_PickersInput.PickersInputRoot, {
|
|
21
|
+
name: 'MuiPickersFilledInput',
|
|
22
|
+
slot: 'Root',
|
|
23
|
+
overridesResolver: (props, styles) => styles.root
|
|
24
|
+
})(({
|
|
25
|
+
theme,
|
|
26
|
+
ownerState
|
|
27
|
+
}) => {
|
|
28
|
+
const light = theme.palette.mode === 'light';
|
|
29
|
+
const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
30
|
+
const backgroundColor = light ? 'rgba(0, 0, 0, 0.06)' : 'rgba(255, 255, 255, 0.09)';
|
|
31
|
+
const hoverBackground = light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.13)';
|
|
32
|
+
const disabledBackground = light ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)';
|
|
33
|
+
return (0, _extends2.default)({
|
|
34
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor,
|
|
35
|
+
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
36
|
+
borderTopRightRadius: (theme.vars || theme).shape.borderRadius,
|
|
37
|
+
transition: theme.transitions.create('background-color', {
|
|
38
|
+
duration: theme.transitions.duration.shorter,
|
|
39
|
+
easing: theme.transitions.easing.easeOut
|
|
40
|
+
}),
|
|
41
|
+
'&:hover': {
|
|
42
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.hoverBg : hoverBackground,
|
|
43
|
+
// Reset on touch devices, it doesn't add specificity
|
|
44
|
+
'@media (hover: none)': {
|
|
45
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[`&.${_pickersInputClasses.pickersFilledInputClasses.focused}`]: {
|
|
49
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
|
50
|
+
},
|
|
51
|
+
[`&.${_pickersInputClasses.pickersFilledInputClasses.disabled}`]: {
|
|
52
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.disabledBg : disabledBackground
|
|
53
|
+
}
|
|
54
|
+
}, !ownerState.disableUnderline && {
|
|
55
|
+
'&:after': {
|
|
56
|
+
borderBottom: `2px solid ${(theme.vars || theme).palette[ownerState.color || 'primary']?.main}`,
|
|
57
|
+
left: 0,
|
|
58
|
+
bottom: 0,
|
|
59
|
+
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
60
|
+
content: '""',
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
right: 0,
|
|
63
|
+
transform: 'scaleX(0)',
|
|
64
|
+
transition: theme.transitions.create('transform', {
|
|
65
|
+
duration: theme.transitions.duration.shorter,
|
|
66
|
+
easing: theme.transitions.easing.easeOut
|
|
67
|
+
}),
|
|
68
|
+
pointerEvents: 'none' // Transparent to the hover style.
|
|
69
|
+
},
|
|
70
|
+
[`&.${_pickersInputClasses.pickersFilledInputClasses.focused}:after`]: {
|
|
71
|
+
// translateX(0) is a workaround for Safari transform scale bug
|
|
72
|
+
// See https://github.com/mui/material-ui/issues/31766
|
|
73
|
+
transform: 'scaleX(1) translateX(0)'
|
|
74
|
+
},
|
|
75
|
+
[`&.${_pickersInputClasses.pickersFilledInputClasses.error}`]: {
|
|
76
|
+
'&:before, &:after': {
|
|
77
|
+
borderBottomColor: (theme.vars || theme).palette.error.main
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
'&:before': {
|
|
81
|
+
borderBottom: `1px solid ${theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})` : bottomLineColor}`,
|
|
82
|
+
left: 0,
|
|
83
|
+
bottom: 0,
|
|
84
|
+
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
85
|
+
content: '"\\00a0"',
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
right: 0,
|
|
88
|
+
transition: theme.transitions.create('border-bottom-color', {
|
|
89
|
+
duration: theme.transitions.duration.shorter
|
|
90
|
+
}),
|
|
91
|
+
pointerEvents: 'none' // Transparent to the hover style.
|
|
92
|
+
},
|
|
93
|
+
[`&:hover:not(.${_pickersInputClasses.pickersFilledInputClasses.disabled}, .${_pickersInputClasses.pickersFilledInputClasses.error}):before`]: {
|
|
94
|
+
borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`
|
|
95
|
+
},
|
|
96
|
+
[`&.${_pickersInputClasses.pickersFilledInputClasses.disabled}:before`]: {
|
|
97
|
+
borderBottomStyle: 'dotted'
|
|
98
|
+
}
|
|
99
|
+
}, ownerState.startAdornment && {
|
|
100
|
+
paddingLeft: 12
|
|
101
|
+
}, ownerState.endAdornment && {
|
|
102
|
+
paddingRight: 12
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
const FilledSectionsContainer = (0, _styles.styled)(_PickersInput.PickersInputSectionsContainer, {
|
|
106
|
+
name: 'MuiPickersFilledInput',
|
|
107
|
+
slot: 'sectionsContainer',
|
|
108
|
+
overridesResolver: (props, styles) => styles.sectionsContainer
|
|
109
|
+
})(({
|
|
110
|
+
ownerState
|
|
111
|
+
}) => (0, _extends2.default)({
|
|
112
|
+
paddingTop: 25,
|
|
113
|
+
paddingRight: 12,
|
|
114
|
+
paddingBottom: 8,
|
|
115
|
+
paddingLeft: 12
|
|
116
|
+
}, ownerState.size === 'small' && {
|
|
117
|
+
paddingTop: 21,
|
|
118
|
+
paddingBottom: 4
|
|
119
|
+
}, ownerState.startAdornment && {
|
|
120
|
+
paddingLeft: 0
|
|
121
|
+
}, ownerState.endAdornment && {
|
|
122
|
+
paddingRight: 0
|
|
123
|
+
}, ownerState.hiddenLabel && {
|
|
124
|
+
paddingTop: 16,
|
|
125
|
+
paddingBottom: 17
|
|
126
|
+
}, ownerState.hiddenLabel && ownerState.size === 'small' && {
|
|
127
|
+
paddingTop: 8,
|
|
128
|
+
paddingBottom: 9
|
|
129
|
+
}));
|
|
130
|
+
const useUtilityClasses = ownerState => {
|
|
131
|
+
const {
|
|
132
|
+
focused,
|
|
133
|
+
disabled,
|
|
134
|
+
error,
|
|
135
|
+
classes,
|
|
136
|
+
fullWidth,
|
|
137
|
+
color,
|
|
138
|
+
size,
|
|
139
|
+
endAdornment,
|
|
140
|
+
startAdornment
|
|
141
|
+
} = ownerState;
|
|
142
|
+
const slots = {
|
|
143
|
+
root: ['root', focused && !disabled && 'focused', disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', `color${(0, _utils.unstable_capitalize)(color)}`, size === 'small' && 'inputSizeSmall', Boolean(startAdornment) && 'adornedStart', Boolean(endAdornment) && 'adornedEnd'],
|
|
144
|
+
notchedOutline: ['notchedOutline'],
|
|
145
|
+
before: ['before'],
|
|
146
|
+
after: ['after'],
|
|
147
|
+
content: ['content'],
|
|
148
|
+
input: ['input']
|
|
149
|
+
};
|
|
150
|
+
return (0, _utils.unstable_composeClasses)(slots, _pickersInputClasses.getPickersFilledInputUtilityClass, classes);
|
|
151
|
+
};
|
|
152
|
+
const PickersFilledInput = exports.PickersFilledInput = /*#__PURE__*/React.forwardRef(function PickersFilledInput(props, ref) {
|
|
153
|
+
const {
|
|
154
|
+
label,
|
|
155
|
+
ownerState: ownerStateProp
|
|
156
|
+
} = props,
|
|
157
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
158
|
+
const muiFormControl = (0, _FormControl.useFormControl)();
|
|
159
|
+
const ownerState = (0, _extends2.default)({}, props, ownerStateProp, muiFormControl, {
|
|
160
|
+
color: muiFormControl?.color || 'primary'
|
|
161
|
+
});
|
|
162
|
+
const classes = useUtilityClasses(ownerState);
|
|
163
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PickersInput.PickersInput, (0, _extends2.default)({
|
|
164
|
+
slots: {
|
|
165
|
+
root: FilledInputRoot,
|
|
166
|
+
input: FilledSectionsContainer
|
|
167
|
+
}
|
|
168
|
+
}, other, {
|
|
169
|
+
label: label,
|
|
170
|
+
classes: classes,
|
|
171
|
+
ref: ref
|
|
172
|
+
}));
|
|
173
|
+
});
|
|
174
|
+
_PickersInput.PickersInput.muiName = 'Input';
|