@mantine/hooks
Advanced tools
Comparing version 1.2.0-alpha.4 to 1.2.0-alpha.5
@@ -5,2 +5,4 @@ 'use strict'; | ||
var randomId = require('./utils/random-id/random-id.js'); | ||
var upperFirst = require('./utils/upper-first/upper-first.js'); | ||
var useClickOutside = require('./use-click-outside/use-click-outside.js'); | ||
@@ -26,2 +28,4 @@ var useClipboard = require('./use-clipboard/use-clipboard.js'); | ||
exports.randomId = randomId.randomId; | ||
exports.upperFirst = upperFirst.upperFirst; | ||
exports.useClickOutside = useClickOutside.useClickOutside; | ||
@@ -28,0 +32,0 @@ exports.useClipboard = useClipboard.useClipboard; |
@@ -6,5 +6,5 @@ 'use strict'; | ||
var react = require('react'); | ||
var utils = require('@mantine/utils'); | ||
var randomId = require('../utils/random-id/random-id.js'); | ||
function useId(id, generateId = utils.randomId) { | ||
function useId(id, generateId = randomId.randomId) { | ||
const generatedId = react.useRef(generateId()); | ||
@@ -11,0 +11,0 @@ return id || generatedId.current; |
@@ -0,1 +1,3 @@ | ||
export { randomId } from './utils/random-id/random-id.js'; | ||
export { upperFirst } from './utils/upper-first/upper-first.js'; | ||
export { useClickOutside } from './use-click-outside/use-click-outside.js'; | ||
@@ -2,0 +4,0 @@ export { useClipboard } from './use-clipboard/use-clipboard.js'; |
import { useRef } from 'react'; | ||
import { randomId } from '@mantine/utils'; | ||
import { randomId } from '../utils/random-id/random-id.js'; | ||
@@ -4,0 +4,0 @@ function useId(id, generateId = randomId) { |
@@ -0,1 +1,2 @@ | ||
export * from './utils'; | ||
export { useClickOutside } from './use-click-outside/use-click-outside'; | ||
@@ -2,0 +3,0 @@ export { useClipboard } from './use-clipboard/use-clipboard'; |
@@ -7,2 +7,10 @@ (function (global, factory) { | ||
function randomId() { | ||
return `mantine-${Math.random().toString(36).substr(2, 9)}`; | ||
} | ||
function upperFirst(value) { | ||
return typeof value !== "string" ? "" : value.charAt(0).toUpperCase() + value.slice(1); | ||
} | ||
function useClickOutside(handler, events = ["mousedown", "touchstart"]) { | ||
@@ -383,6 +391,2 @@ const ref = react.useRef(); | ||
function randomId() { | ||
return `mantine-${Math.random().toString(36).substr(2, 9)}`; | ||
} | ||
function useId(id, generateId = randomId) { | ||
@@ -569,2 +573,4 @@ const generatedId = react.useRef(generateId()); | ||
exports.randomId = randomId; | ||
exports.upperFirst = upperFirst; | ||
exports.useClickOutside = useClickOutside; | ||
@@ -571,0 +577,0 @@ exports.useClipboard = useClipboard; |
{ | ||
"name": "@mantine/hooks", | ||
"version": "1.2.0-alpha.4", | ||
"version": "1.2.0-alpha.5", | ||
"main": "cjs/index.js", | ||
@@ -13,3 +13,4 @@ "module": "esm/index.js", | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": {} | ||
} |
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
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
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
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
220256
150
2014