Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 4724a2e

Browse files
committed
feat: update components
1 parent 2024423 commit 4724a2e

File tree

29 files changed

+7876
-92
lines changed

29 files changed

+7876
-92
lines changed

components.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ declare module 'vue' {
175175
onClick?: () => any
176176
vSlots?: {
177177
[eleName: string]: JSX.Element
178-
}
178+
},
179+
value?: unknown
179180
}
180181
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
"ts-jest": "^26.5.0",
149149
"ts-node": "^9.0.0",
150150
"typescript": "^4.1.3",
151-
"vite": "^2.4.0",
151+
"vite": "^2.5.10",
152152
"vite-plugin-components": "^0.8.3",
153153
"vite-plugin-mdx-vue": "^1.1.3",
154154
"vite-plugin-pages": "^0.9.2",

packages/c-form-control/src/c-form-control.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ import { CFormControlProps, CFormControlProviderContext, useFormControlProvider,
2020
* `select`, `textarea`, etc.
2121
*/
2222

23+
export const formControlProps = {
24+
isRequired: Boolean as PropType<CFormControlProps['isRequired']>,
25+
isDisabled: Boolean as PropType<CFormControlProps['isDisabled']>,
26+
isInvalid: Boolean as PropType<CFormControlProps['isInvalid']>,
27+
isReadOnly: Boolean as PropType<CFormControlProps['isReadOnly']>,
28+
label: String as PropType<CFormControlProps['label']>,
29+
id: String as PropType<CFormControlProps['id']>,
30+
}
31+
2332
export const CFormControl: ComponentWithProps<
2433
DeepPartial<CFormControlProps>
2534
> = defineComponent({
@@ -28,12 +37,7 @@ DeepPartial<CFormControlProps>
2837
type: [Object, String] as PropType<DOMElements>,
2938
default: 'div',
3039
},
31-
isRequired: Boolean as PropType<CFormControlProps['isRequired']>,
32-
isDisabled: Boolean as PropType<CFormControlProps['isDisabled']>,
33-
isInvalid: Boolean as PropType<CFormControlProps['isInvalid']>,
34-
isReadOnly: Boolean as PropType<CFormControlProps['isReadOnly']>,
35-
label: String as PropType<CFormControlProps['label']>,
36-
id: String as PropType<CFormControlProps['id']>,
40+
...formControlProps
3741
},
3842
setup(_props, { slots, attrs }) {
3943
const { as, ...props } = toRefs(_props)

0 commit comments

Comments
 (0)