Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chakra-ui/vue-utils

Package Overview
Dependencies
Maintainers
3
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/vue-utils - npm Package Compare versions

Comparing version 0.1.0-alpha.6 to 0.1.0-alpha.7

dist/chakra-ui-vue-utils.cjs.d.ts

12

CHANGELOG.md
# @chakra-ui/vue-utils
## 0.1.0-alpha.7
### Minor Changes
- chore: parity release
## 0.1.0-alpha.6
### Patch Changes
### Minor Changes
- Mock release
- [#108](https://github.com/chakra-ui/chakra-ui-vue-next/pull/108) [`a7df008`](https://github.com/chakra-ui/chakra-ui-vue-next/commit/a7df008af57158fbd9240645d4177cf862ca764d) Thanks [@codebender828](https://github.com/codebender828)! - Create form control and input components
* [#91](https://github.com/chakra-ui/chakra-ui-vue-next/pull/91) [`64ec694`](https://github.com/chakra-ui/chakra-ui-vue-next/commit/64ec694a67bf0932ad8d7569cf4347cd1da48513) Thanks [@codebender828](https://github.com/codebender828)! - Create `CFormControl` component
## 0.1.0-alpha.5

@@ -10,0 +18,0 @@

2

index.ts

@@ -1,1 +0,1 @@

export * from './src'
export * from "./src"
{
"name": "@chakra-ui/vue-utils",
"version": "0.1.0-alpha.6",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"typings": "dist/types/index.d.ts",
"version": "0.1.0-alpha.7",
"main": "dist/chakra-ui-vue-utils.cjs.js",
"module": "dist/chakra-ui-vue-utils.esm.js",
"description": "Chakra UI Vue | Utils module",

@@ -12,13 +10,13 @@ "repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/utils",

"license": "MIT",
"exports": {
".": {
"require": "./dist/chakra-ui-vue-utils.cjs.js",
"default": "./dist/chakra-ui-vue-utils.esm.js"
}
},
"scripts": {
"build": "rimraf ./dist && concurrently yarn:build:*",
"build:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps",
"build:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
"watch": "yarn:watch:*",
"watch:esm": "cross-env BABEL_ENV=esm babel src --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps --watch",
"watch:cjs": "cross-env BABEL_ENV=cjs babel src --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps --watch",
"watch:types": "cross-env tsc --emitDeclarationOnly --declaration --declarationDir dist/types --watch --incremental"
"clean": "rimraf dist"
},
"dependencies": {
"@chakra-ui/utils": "^1.8.2",
"css-box-model": "1.2.1",

@@ -30,4 +28,11 @@ "lodash.mergewith": "^4.6.2",

"@types/lodash.mergewith": "^4.6.6",
"@types/object-assign": "4.0.30"
"@types/object-assign": "4.0.30",
"vue": "^3.2.24"
},
"peerDependencies": {
"vue": "^3.1.4"
},
"publishConfig": {
"access": "public"
}
}
}

@@ -20,7 +20,7 @@ interface IChildNode extends ChildNode {

export function getSelector(node: HTMLElement) {
const id = node.getAttribute('id')
const id = node.getAttribute("id")
if (id) return '#' + id
if (id) return "#" + id
let path = ''
let path = ""

@@ -32,8 +32,8 @@ while (node) {

if (!parent) {
path = name + ' > ' + path
path = name + " > " + path
continue
}
if (node.getAttribute('id')) {
path = '#' + node.getAttribute('id') + ' > ' + path
if (node.getAttribute("id")) {
path = "#" + node.getAttribute("id") + " > " + path
break

@@ -57,7 +57,7 @@ }

const index = sameTagSiblings.indexOf(node)
name += ':nth-of-type(' + (index + 1) + ')'
name += ":nth-of-type(" + (index + 1) + ")"
}
if (path) {
path = name + ' > ' + path
path = name + " > " + path
} else {

@@ -64,0 +64,0 @@ path = name

@@ -9,5 +9,5 @@ import {

UnwrapRef,
} from 'vue'
import { debounce } from './timers'
import { MaybeRef } from './types'
} from "vue"
import { debounce } from "./timers"
import { MaybeRef } from "./types"

@@ -14,0 +14,0 @@ /**

@@ -1,7 +0,7 @@

export * from './vue-utils'
export * from './layout'
export * from './dom'
export * from './dom-query'
export * from './types'
export * from './timers'
export * from './props'
export * from "./vue-utils"
export * from "./layout"
export * from "./dom"
export * from "./dom-query"
export * from "./types"
export * from "./timers"
export * from "./props"
export function orient(options: {
orientation?: 'vertical' | 'horizontal'
orientation?: "vertical" | "horizontal"
vertical: any

@@ -8,3 +8,3 @@ horizontal: any

if (!orientation) return {}
return orientation === 'vertical' ? vertical : horizontal
return orientation === "vertical" ? vertical : horizontal
}

@@ -1,9 +0,9 @@

import { DOMElements, ThemingProps } from '@chakra-ui/vue-system'
import { PropType } from 'vue'
import { DOMElements, ThemingProps } from "@chakra-ui/vue-system"
import { PropType } from "vue"
export const vueThemingProps = {
colorScheme: String as PropType<ThemingProps['colorScheme']>,
variant: String as PropType<ThemingProps['variant']>,
size: String as PropType<ThemingProps['size']>,
styleConfig: String as PropType<ThemingProps['styleConfig']>,
colorScheme: String as PropType<ThemingProps["colorScheme"]>,
variant: String as PropType<ThemingProps["variant"]>,
size: String as PropType<ThemingProps["size"]>,
styleConfig: String as PropType<ThemingProps["styleConfig"]>,
}

@@ -18,5 +18,5 @@

ThemingProps,
'colorScheme' | 'variant' | 'size' | 'styleConfig'
"colorScheme" | "variant" | "size" | "styleConfig"
> {
as: DOMElements | 'router-link' | 'nuxt-link'
as: DOMElements | "router-link" | "nuxt-link"
}

@@ -1,2 +0,3 @@

import { ComputedRef, Ref } from 'vue'
import { ComputedRef, Ref, VNodeProps } from "vue"
import { TemplateRef } from "./dom"

@@ -11,1 +12,6 @@ /**

export type MaybeRef<T> = T | Ref<T> | ComputedRef<T>
/** VNodeProps Object */
export interface MergedVNodeProps extends VNodeProps {
ref: TemplateRef | ((el: TemplateRef | null) => void)
}

@@ -1,3 +0,3 @@

import { isFunction, isObject } from '@chakra-ui/utils'
import { inject, InjectionKey, provide, isVNode, Slots, VNode } from 'vue'
import { isFunction, isObject } from "@chakra-ui/utils"
import { inject, InjectionKey, provide, isVNode, Slots, VNode } from "vue"

@@ -30,3 +30,3 @@ export interface CreateContextOptions {

strict = true,
errorMessage = 'useContext: `context` is undefined. Seems you forgot to wrap component within the Provider',
errorMessage = "useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",
name,

@@ -78,3 +78,3 @@ } = options

) {
const validComponentTypes = ['function', 'object']
const validComponentTypes = ["function", "object"]
if (!validComponentTypes.includes(typeof subject)) return false

@@ -85,6 +85,6 @@

// Is object component with render function
if (typeof subject?.render === 'function' && isVNode(subject.render()))
if (typeof subject?.render === "function" && isVNode(subject.render()))
return true
// Is object component with setup function
else if (typeof subject?.setup === 'function') return true
else if (typeof subject?.setup === "function") return true
}

@@ -91,0 +91,0 @@

@@ -1,8 +0,8 @@

import { render, waitMs, screen } from '@chakra-ui/vue-test-utils/src'
import { defineComponent, h, nextTick, onMounted } from 'vue'
import { useRef } from '../src/dom'
import { render, waitMs, screen } from "@chakra-ui/vue-test-utils/src"
import { defineComponent, h, nextTick, onMounted } from "vue"
import { useRef } from "../src/dom"
const ExampleComponent = defineComponent({
setup(_, { slots }) {
return () => h('button', {}, () => slots?.default?.())
return () => h("button", {}, () => slots?.default?.())
},

@@ -41,16 +41,16 @@ })

it('`useDOMRef` should bind components to template elements', async () => {
it("`useDOMRef` should bind components to template elements", async () => {
renderComponent()
await waitMs(500)
expect(screen.getByTestId('divElement')).toBe(_containerEl)
expect(screen.getByTestId('buttonComponent')).toBe(_componentEl)
expect(screen.getByTestId("divElement")).toBe(_containerEl)
expect(screen.getByTestId("buttonComponent")).toBe(_componentEl)
})
it('`useDOMRef` should bind components to render function elements', async () => {
it("`useDOMRef` should bind components to render function elements", async () => {
renderComponent()
await waitMs(500)
expect(screen.getByTestId('divElement')).toBe(_containerEl)
expect(screen.getByTestId('buttonComponent')).toBe(_componentEl)
expect(screen.getByTestId("divElement")).toBe(_containerEl)
expect(screen.getByTestId("buttonComponent")).toBe(_componentEl)
})

@@ -1,3 +0,3 @@

it('should be truthy', () => {
it("should be truthy", () => {
expect(1).toBe(1)
})

@@ -1,4 +0,4 @@

import { createContext } from '@chakra-ui/vue-utils/src'
import { defineComponent, h } from 'vue'
import { render } from '@chakra-ui/vue-test-utils/src'
import { createContext } from "@chakra-ui/vue-utils/src"
import { defineComponent, h } from "vue"
import { render } from "@chakra-ui/vue-test-utils/src"

@@ -10,5 +10,5 @@ interface ExampleContext {

const [ExampleProvider, useExampleContext] = createContext<ExampleContext>({
name: 'ExampleContext',
name: "ExampleContext",
errorMessage:
'useContext: `context` is undefined. Seems you forgot to wrap component within the Provider',
"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",
})

@@ -19,3 +19,3 @@

const { example } = useExampleContext()
return () => h('div', `injected: ${example}`)
return () => h("div", `injected: ${example}`)
},

@@ -26,6 +26,6 @@ })

// disable console.warn
jest.spyOn(console, 'warn').mockImplementation(() => {})
jest.spyOn(console, "warn").mockImplementation(() => {})
})
it('should provide and inject a context', () => {
it("should provide and inject a context", () => {
const { getByText } = render({

@@ -39,3 +39,3 @@ components: { ExampleComponent },

setup() {
ExampleProvider({ example: 'works' })
ExampleProvider({ example: "works" })
},

@@ -46,3 +46,3 @@ })

it('should throw an error when there is no provider', () => {
it("should throw an error when there is no provider", () => {
expect(() => {

@@ -55,4 +55,4 @@ render({

}).toThrowError(
'useContext: `context` is undefined. Seems you forgot to wrap component within the Provider'
"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider"
)
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc