import gulp from 'gulp';
import imagemin from 'gulp-imagemin';
export default () => (
gulp.src('src/images/*')
.pipe(imagemin())
.pipe(gulp.dest('dist/images'))
);
import * as React from "react";
import { DemoContainer } from "@mui/x-date-pickers/internals/demo";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import { DatePicker } from "@mui/x-date-pickers/DatePicker";
import { StaticDatePicker } from "@mui/x-date-pickers/StaticDatePicker";
import dayjs, { Dayjs } from "dayjs";
export default function BasicDatePicker() {
const [date, setDate] = React.useState<Dayjs | null>(dayjs());
const onDateChange = React.useCallback((value: Dayjs) => {
setDate(value);
}, []);
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={["DatePicker", "StaticDatePicker"]}>
<DatePicker<Dayjs>
value={date}
views={["month"]}
onChange={onDateChange}
/>
<StaticDatePicker<Dayjs>
value={date}
orientation="landscape"
onChange={onDateChange}
/>
</DemoContainer>
</LocalizationProvider>
);
}
window.open
необходимо предоставить разрешение на открытие окон.classes.bar
для элементов. А чтобы не городить такое `${classes.loader} js--loader`
можно использовать clsx или classnames. const toCamelCase = (string = '') => {
const value = (string.toLowerCase().match(/[a-z]+[0-9]*|[0-9]+/g) ?? [])
.map((x) => x.slice(0, 1).toUpperCase() + x.slice(1))
.join('');
return value.slice(0, 1).toLowerCase() + value.slice(1);
};
toCamelCase() // ''
toCamelCase('SOME_NAME_IVAN') // 'someNameIvan'
toCamelCase('my-super-key') // 'mySuperKey'
const formatContent = (element) => {
const text = element.textContent.replace(/\s*/g, '');
const number = parseFloat(text);
if (!Number.isNaN(number)) {
const formatted = number.toLocaleString('ru-RU');
if (element.dataset.formatted === text) {
return;
}
element.textContent = formatted;
element.dataset.formatted = formatted;
}
};
const mutationObserver = new MutationObserver(
(mutations) => mutations.forEach((mutation) => formatContent(mutation.target))
);
document.querySelectorAll('.t-calc').forEach((element) => {
formatContent(element);
mutationObserver.observe(element, { childList: true });
});