Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Update bindings (#124)
Browse files Browse the repository at this point in the history
* fix: 'type_' -> 'type'

* feat: add `autoFocus` prop to textfield

* version packages
  • Loading branch information
Jaeho Lee authored Jan 16, 2023
1 parent f6d0322 commit 53918a5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/modern-suns-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@greenlabs/formula-components": patch
"@greenlabs/rescript-formula-components": patch
---

- type 바인딩 오류 수정
- TextField `autoFocus` prop 추가
4 changes: 2 additions & 2 deletions packages/components-rescript/__tests__/Formula_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ let textTextTab = () => {
title="텍스트 "
value="b"
badge={{
type_: #countSimple,
_type: #countSimple,
value: 9,
}}
/>
<TextTab.Trigger
value="c"
badge={{
type_: #simple,
_type: #simple,
}}>
<Icon.ArrowDownLineBold />
</TextTab.Trigger>
Expand Down
4 changes: 2 additions & 2 deletions packages/components-rescript/src/Formula__Button.res
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Container = {
@module("@greenlabs/formula-components") @react.component
external make: (
// React Synthetic Events
@as("type") ~type_: string=?,
~_type: string=?,
~onClick: ReactEvent.Mouse.t => unit=?,
// Formula Button Props
~color: color,
Expand All @@ -48,7 +48,7 @@ module Icon = {
@module("@greenlabs/formula-components") @react.component
external make: (
// React Synthetic Events
@as("type") ~type_: string=?,
~_type: string=?,
~onClick: ReactEvent.Mouse.t => unit=?,
// Formula Button Props
~color: color,
Expand Down
2 changes: 2 additions & 0 deletions packages/components-rescript/src/Formula__TextField.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type renderInputProps<'a> = {
minLength?: int,
maxLength?: int,
pattern?: string,
autoFocus?: bool,
onChange?: ReactEvent.Form.t => unit,
onFocus?: ReactEvent.Focus.t => unit,
onBlur?: ReactEvent.Focus.t => unit,
Expand Down Expand Up @@ -53,6 +54,7 @@ external make: (
~inputMode: inputMode=?,
~required: bool=?,
~form: string=?,
~autoFocus: bool=?,
~onChange: ReactEvent.Form.t => unit=?,
~onFocus: ReactEvent.Focus.t => unit=?,
~onBlur: ReactEvent.Focus.t => unit=?,
Expand Down
2 changes: 1 addition & 1 deletion packages/components-rescript/src/Formula__TextTab.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module List = {

module Trigger = {
type badgeType = {
type_: [#count | #simple | #countSimple],
@as("type") _type: [#count | #simple | #countSimple],
value?: int,
}

Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type inputProps = {
pattern?: InputAttributes["pattern"]
required?: InputAttributes["required"]
form?: InputAttributes["form"]
autoFocus?: InputAttributes["autoFocus"]
type?: "text" | "password" | "search" | "tel"
}

Expand Down Expand Up @@ -120,6 +121,7 @@ export const TextField = React.forwardRef<InputElement, TextFieldProps>(
onFocus,
required,
form,
autoFocus,
options = {
hideClearButton: false,
showHintOnFocusOnly: false,
Expand Down Expand Up @@ -180,6 +182,7 @@ export const TextField = React.forwardRef<InputElement, TextFieldProps>(
inputMode,
required,
form,
autoFocus,
onInput,
onKeyDown,
onKeyUp,
Expand Down

0 comments on commit 53918a5

Please sign in to comment.