@react-md/utils
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
declare const _default: { | ||
"rmd-utils-ios-scroll-momentum": boolean; | ||
"rmd-utils-swappable-positions": string; | ||
"rmd-utils-swappable-positions": string[]; | ||
"rmd-utils-swappable-position-prefixes": string[]; | ||
"rmd-utils-skip-validation": boolean; | ||
@@ -5,0 +6,0 @@ }; |
@@ -6,5 +6,6 @@ "use strict"; | ||
"rmd-utils-ios-scroll-momentum": true, | ||
"rmd-utils-swappable-positions": "top right bottom left", | ||
"rmd-utils-swappable-positions": ["top", "right", "bottom", "left"], | ||
"rmd-utils-swappable-position-prefixes": ["border", "margin", "padding"], | ||
"rmd-utils-skip-validation": true, | ||
}; | ||
//# sourceMappingURL=scssVariables.js.map |
export * from "./delegateEvent"; | ||
export * from "./touches"; | ||
export * from "./omit"; | ||
export * from "./hooks"; | ||
export * from "./positioning"; | ||
export { default as unitToNumber } from "./unitToNumber"; | ||
export { default as applyRef } from "./applyRef"; | ||
export { default as useToggle } from "./useToggle"; | ||
//# sourceMappingURL=index.js.map |
import findSizingContainer from "./findSizingContainer"; | ||
function determineBestHorizontalPosition(position, left, vw, threshold) { | ||
if (position !== "auto") { | ||
// if the position waas actually set to something other than auto, trust that they already | ||
// if the position was actually set to something other than auto, trust that they already | ||
// have verified it can fit in the viewport. | ||
@@ -31,2 +31,4 @@ return position; | ||
return "100%"; | ||
case "center": | ||
return "50%"; | ||
default: | ||
@@ -33,0 +35,0 @@ return "0"; |
@@ -28,4 +28,4 @@ /** | ||
var fontSize = parseFloat(window.getComputedStyle(el).fontSize || fontSizeFallback + "px"); | ||
return parseFloat(unit) * fontSize; | ||
return parsed * fontSize; | ||
} | ||
//# sourceMappingURL=unitToNumber.js.map |
@@ -9,3 +9,2 @@ "use strict"; | ||
__export(require("./omit")); | ||
__export(require("./hooks")); | ||
__export(require("./positioning")); | ||
@@ -16,2 +15,4 @@ var unitToNumber_1 = require("./unitToNumber"); | ||
exports.applyRef = applyRef_1.default; | ||
var useToggle_1 = require("./useToggle"); | ||
exports.useToggle = useToggle_1.default; | ||
//# sourceMappingURL=index.js.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
if (position !== "auto") { | ||
// if the position waas actually set to something other than auto, trust that they already | ||
// if the position was actually set to something other than auto, trust that they already | ||
// have verified it can fit in the viewport. | ||
@@ -37,2 +37,4 @@ return position; | ||
return "100%"; | ||
case "center": | ||
return "50%"; | ||
default: | ||
@@ -39,0 +41,0 @@ return "0"; |
@@ -30,5 +30,5 @@ "use strict"; | ||
var fontSize = parseFloat(window.getComputedStyle(el).fontSize || fontSizeFallback + "px"); | ||
return parseFloat(unit) * fontSize; | ||
return parsed * fontSize; | ||
} | ||
exports.default = unitToNumber; | ||
//# sourceMappingURL=unitToNumber.js.map |
{ | ||
"name": "@react-md/utils", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "General utils for react-md.", | ||
@@ -36,3 +36,3 @@ "scripts": { | ||
}, | ||
"gitHead": "cc5de21740e62c1fd5da8f832f562c48eb028717" | ||
"gitHead": "9197bcdf38df3cff304499431696dc8e950b4b17" | ||
} |
@@ -6,3 +6,2 @@ export * from "./delegateEvent"; | ||
export * from "./hooks"; | ||
export * from "./positioning"; | ||
@@ -12,2 +11,4 @@ export { default as unitToNumber } from "./unitToNumber"; | ||
export { default as useToggle } from "./useToggle"; | ||
export * from "./types.d"; |
@@ -17,3 +17,3 @@ import { Maybe } from "../types.d"; | ||
if (position !== "auto") { | ||
// if the position waas actually set to something other than auto, trust that they already | ||
// if the position was actually set to something other than auto, trust that they already | ||
// have verified it can fit in the viewport. | ||
@@ -53,2 +53,4 @@ return position; | ||
return "100%"; | ||
case "center": | ||
return "50%"; | ||
default: | ||
@@ -55,0 +57,0 @@ return "0"; |
/** this is an auto-generated file from @react-md/dev-utils */ | ||
export default { | ||
"rmd-utils-ios-scroll-momentum": true, | ||
"rmd-utils-swappable-positions": "top right bottom left", | ||
"rmd-utils-swappable-positions": ["top", "right", "bottom", "left"], | ||
"rmd-utils-swappable-position-prefixes": ["border", "margin", "padding"], | ||
"rmd-utils-skip-validation": true, | ||
}; |
@@ -13,1 +13,11 @@ import { Ref } from "react"; | ||
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | ||
/** | ||
* This type allows you to require at least one of the provided keys. This is super helpful | ||
* for things like `aria-label` or `aria-labelledby` when it's required for a11y. | ||
*/ | ||
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick< | ||
T, | ||
Exclude<keyof T, Keys> | ||
> & | ||
{ [K in Keys]-?: Required<Pick<T, K>> }[Keys]; |
@@ -39,3 +39,3 @@ export interface UnitToNumberOptions { | ||
return parseFloat(unit) * fontSize; | ||
return parsed * fontSize; | ||
} |
export * from "./delegateEvent"; | ||
export * from "./touches"; | ||
export * from "./omit"; | ||
export * from "./hooks"; | ||
export * from "./positioning"; | ||
export { default as unitToNumber } from "./unitToNumber"; | ||
export { default as applyRef } from "./applyRef"; | ||
export { default as useToggle } from "./useToggle"; | ||
export * from "./types.d"; |
@@ -16,2 +16,2 @@ /** | ||
*/ | ||
export default function findSizingContainer(el: HTMLElement | null): HTMLElement | null; | ||
export default function findSizingContainer(el: HTMLElement | null): import("..").Maybe<HTMLElement, null>; |
@@ -13,1 +13,11 @@ import { Ref } from "react"; | ||
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | ||
/** | ||
* This type allows you to require at least one of the provided keys. This is super helpful | ||
* for things like `aria-label` or `aria-labelledby` when it's required for a11y. | ||
*/ | ||
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick< | ||
T, | ||
Exclude<keyof T, Keys> | ||
> & | ||
{ [K in Keys]-?: Required<Pick<T, K>> }[Keys]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
146988
102
2447