worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
1
node_modules/@mui/material/useLazyRipple/index.d.ts
generated
vendored
Normal file
1
node_modules/@mui/material/useLazyRipple/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default } from "./useLazyRipple.js";
|
||||
14
node_modules/@mui/material/useLazyRipple/index.js
generated
vendored
Normal file
14
node_modules/@mui/material/useLazyRipple/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
'use client';
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _useLazyRipple.default;
|
||||
}
|
||||
});
|
||||
var _useLazyRipple = _interopRequireDefault(require("./useLazyRipple"));
|
||||
32
node_modules/@mui/material/useLazyRipple/useLazyRipple.d.ts
generated
vendored
Normal file
32
node_modules/@mui/material/useLazyRipple/useLazyRipple.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import * as React from 'react';
|
||||
import { TouchRippleActions } from "../ButtonBase/TouchRipple.js";
|
||||
type ControlledPromise<T = unknown> = Promise<T> & {
|
||||
resolve: Function;
|
||||
reject: Function;
|
||||
};
|
||||
/**
|
||||
* Lazy initialization container for the Ripple instance. This improves
|
||||
* performance by delaying mounting the ripple until it's needed.
|
||||
*/
|
||||
export declare class LazyRipple {
|
||||
/** React ref to the ripple instance */
|
||||
ref: React.RefObject<TouchRippleActions | null>;
|
||||
/** If the ripple component should be mounted */
|
||||
shouldMount: boolean;
|
||||
/** Promise that resolves when the ripple component is mounted */
|
||||
private mounted;
|
||||
/** If the ripple component has been mounted */
|
||||
private didMount;
|
||||
/** React state hook setter */
|
||||
private setShouldMount;
|
||||
static create(): LazyRipple;
|
||||
static use(): LazyRipple;
|
||||
constructor();
|
||||
mount(): ControlledPromise<unknown>;
|
||||
mountEffect: () => void;
|
||||
start(...args: Parameters<TouchRippleActions['start']>): void;
|
||||
stop(...args: Parameters<TouchRippleActions['stop']>): void;
|
||||
pulsate(...args: Parameters<TouchRippleActions['pulsate']>): void;
|
||||
}
|
||||
export default function useLazyRipple(): LazyRipple;
|
||||
export {};
|
||||
94
node_modules/@mui/material/useLazyRipple/useLazyRipple.js
generated
vendored
Normal file
94
node_modules/@mui/material/useLazyRipple/useLazyRipple.js
generated
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
"use strict";
|
||||
'use client';
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.LazyRipple = void 0;
|
||||
exports.default = useLazyRipple;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
||||
/**
|
||||
* Lazy initialization container for the Ripple instance. This improves
|
||||
* performance by delaying mounting the ripple until it's needed.
|
||||
*/
|
||||
class LazyRipple {
|
||||
/** React ref to the ripple instance */
|
||||
|
||||
/** If the ripple component should be mounted */
|
||||
|
||||
/** Promise that resolves when the ripple component is mounted */
|
||||
|
||||
/** If the ripple component has been mounted */
|
||||
|
||||
/** React state hook setter */
|
||||
|
||||
static create() {
|
||||
return new LazyRipple();
|
||||
}
|
||||
static use() {
|
||||
/* eslint-disable */
|
||||
const ripple = (0, _useLazyRef.default)(LazyRipple.create).current;
|
||||
const [shouldMount, setShouldMount] = React.useState(false);
|
||||
ripple.shouldMount = shouldMount;
|
||||
ripple.setShouldMount = setShouldMount;
|
||||
React.useEffect(ripple.mountEffect, [shouldMount]);
|
||||
/* eslint-enable */
|
||||
|
||||
return ripple;
|
||||
}
|
||||
constructor() {
|
||||
this.ref = {
|
||||
current: null
|
||||
};
|
||||
this.mounted = null;
|
||||
this.didMount = false;
|
||||
this.shouldMount = false;
|
||||
this.setShouldMount = null;
|
||||
}
|
||||
mount() {
|
||||
if (!this.mounted) {
|
||||
this.mounted = createControlledPromise();
|
||||
this.shouldMount = true;
|
||||
this.setShouldMount(this.shouldMount);
|
||||
}
|
||||
return this.mounted;
|
||||
}
|
||||
mountEffect = () => {
|
||||
if (this.shouldMount && !this.didMount) {
|
||||
if (this.ref.current !== null) {
|
||||
this.didMount = true;
|
||||
this.mounted.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* Ripple API */
|
||||
|
||||
start(...args) {
|
||||
this.mount().then(() => this.ref.current?.start(...args));
|
||||
}
|
||||
stop(...args) {
|
||||
this.mount().then(() => this.ref.current?.stop(...args));
|
||||
}
|
||||
pulsate(...args) {
|
||||
this.mount().then(() => this.ref.current?.pulsate(...args));
|
||||
}
|
||||
}
|
||||
exports.LazyRipple = LazyRipple;
|
||||
function useLazyRipple() {
|
||||
return LazyRipple.use();
|
||||
}
|
||||
function createControlledPromise() {
|
||||
let resolve;
|
||||
let reject;
|
||||
const p = new Promise((resolveFn, rejectFn) => {
|
||||
resolve = resolveFn;
|
||||
reject = rejectFn;
|
||||
});
|
||||
p.resolve = resolve;
|
||||
p.reject = reject;
|
||||
return p;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue