Skip to content

Commit

Permalink
chore: fix typecheck & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Dec 26, 2023
1 parent 89a89c4 commit e2d768c
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 596 deletions.
1 change: 1 addition & 0 deletions examples/threejs/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const props = reactive<BUIProps>({
{
title: 'Hierarchy',
type: 'tree',
// @ts-expect-error scene mount
data: scene,
},
],
Expand Down
5 changes: 4 additions & 1 deletion histoire.setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineSetupVue3 } from '@histoire/plugin-vue'
import './packages/blender-ui/client/styles/index.scss'
import './packages/blender-ui/dist/icons.css'

// import './packages/blender-ui/dist/icons.css'
import './histoire/styles/index.css'
import { mountCssVarsRootStyle } from './packages/blender-ui/client/styles/icons'

export const setupVue3 = defineSetupVue3((_handler) => {
mountCssVarsRootStyle()
// addWrapper(GlobalWrapper)
})
2 changes: 1 addition & 1 deletion packages/blender-ui/client/components/BApp.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { bCssVars } from '../styles/icons'
import type { BPanelProps, CommonPanel, TreePanel } from '../../types'
import type { BPanelProps } from '../../types'
import { BNumberField, BPanel, BProperty, BSelectMenu, BTree } from './index'
defineProps<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import { ref } from 'vue'
import BCheckbox from './BCheckbox.vue'
const value = ref(false)
Expand Down
48 changes: 24 additions & 24 deletions packages/blender-ui/client/utils/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function createBUI({
throw new Error(`Panel "${name}" not found`)

return {
add<K extends string | number | symbol>(obj: Record<K, number | string | object>, property: K, min?: number, max?: number, step?: number) {
add<K extends string>(obj: Record<K, number>, property: K, min?: number, max?: number, step?: number) {
const propertyOptions: PropertyOptions = {
object: obj,
property,
Expand All @@ -90,7 +90,7 @@ export function createBUI({
// },
}

if (!panel.type)
if (panel.type === 'common')
panel.properties.push(propertyOptions)

function label(text: string) {
Expand All @@ -104,30 +104,30 @@ export function createBUI({
name: label,
}
},
}
},

addVector(obj: {
x: number
y: number
z: number
}) {
const x = this.add(obj, 'x')
const y = this.add(obj, 'y')
const z = this.add(obj, 'z')

function labels(arr: string[]) {
x.label(arr[0])
y.label(arr[1])
z.label(arr[2])
}
addVector(obj: {
x: number
y: number
z: number
}) {
const x = this.add(obj, 'x')
const y = this.add(obj, 'y')
const z = this.add(obj, 'z')

function labels(arr: string[]) {
x.label(arr[0])
y.label(arr[1])
z.label(arr[2])
}

return {
/**
* alias of names
*/
labels,
names: labels,
return {
/**
* alias of names
*/
labels,
names: labels,
}
},
}
},
}
Expand Down
Loading

0 comments on commit e2d768c

Please sign in to comment.