Skip to content

Commit

Permalink
feat(@dpc-sdp/ripple-ui-forms): adding component events
Browse files Browse the repository at this point in the history
  • Loading branch information
David Featherston committed Jul 5, 2023
1 parent b0bb73c commit 545c71d
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ watch(
id: props.id,
action: 'submit',
name: props.title,
label:
text:
props.schema?.find((field) => field?.key === 'actions')?.label ||
'Submit'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ const handleUpdate = (event) => {
...event,
id: props.id,
field: 'date',
label: props?.label,
value: `${internalDay.value}-${internalMonth.value}-${internalYear.value}`
label: props?.label
},
{ global: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const emit = defineEmits<{
}>()
const form: object = inject('form')
const { emitRplEvent } = useRippleEvent('rpl-form-input', emit)
const { emitRplEvent } = useRippleEvent('rpl-form-dropdown', emit)
const containerRef = ref(null)
const inputRef = ref(null)
Expand Down Expand Up @@ -173,7 +173,6 @@ const handleSelectOption = (optionValue) => {
'update',
{
action: 'select',
field: 'dropdown',
id: props.id,
label: props?.label,
value: newValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ const handleChange = () => {
id: props.id,
type: props.type,
label: props?.label,
value: props.value,
contextId: form?.id,
contextName: form?.name
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const emit = defineEmits<{
}>()
const form: object = inject('form')
const { emitRplEvent } = useRippleEvent('rpl-form-input', emit)
const { emitRplEvent } = useRippleEvent('rpl-form-option-buttons', emit)
const handleChange = (selectedId: string) => {
useFormkitFriendlyEventEmitter(props, emit, 'onChange', selectedId)
Expand All @@ -44,7 +44,6 @@ const handleChange = (selectedId: string) => {
'update',
{
action: 'select',
field: 'option-buttons',
id: props.id,
label: props?.label,
value: selectedId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const emit = defineEmits<{
}>()
const form: object = inject('form')
const { emitRplEvent } = useRippleEvent('rpl-form-input', emit)
const { emitRplEvent } = useRippleEvent('rpl-form-checkbox-group', emit)
const handleToggle = (selectedValue: string) => {
let newValue
Expand All @@ -59,7 +59,6 @@ const handleToggle = (selectedValue: string) => {
{
action: 'select',
id: props.id,
field: 'checkbox-group',
label: props?.label,
value: newValue,
contextId: form?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const emit = defineEmits<{
}>()
const form: object = inject('form')
const { emitRplEvent } = useRippleEvent('rpl-form-input', emit)
const { emitRplEvent } = useRippleEvent('rpl-form-option', emit)
const classes = computed(() => {
return ['rpl-form-option', `rpl-form-option--${props.variant}`]
Expand All @@ -61,7 +61,6 @@ const handleChange = (e: Event) => {
{
action: 'select',
id: props.id,
field: 'option',
type: props.type,
label: props?.label,
value: newValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const emit = defineEmits<{
}>()
const form: object = inject('form')
const { emitRplEvent } = useRippleEvent('rpl-form-input', emit)
const { emitRplEvent } = useRippleEvent('rpl-form-radio-group', emit)
const handleChange = (selectedValue: string) => {
useFormkitFriendlyEventEmitter(props, emit, 'onChange', selectedValue)
Expand All @@ -47,7 +47,6 @@ const handleChange = (selectedValue: string) => {
{
action: 'select',
id: props.id,
field: 'radio-group',
label: props?.label,
value: selectedValue,
contextId: form?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const emit = defineEmits<{
const form: object = inject('form')
const { emitRplEvent } = useRippleEvent('rpl-form-input', emit)
const { emitRplEvent } = useRippleEvent('rpl-form-textarea', emit)
const classes = computed(() => {
return {
Expand All @@ -61,10 +61,8 @@ const handleChange = () => {
'update',
{
action: 'exit',
field: 'textarea',
id: props.id,
label: props?.label,
value: props.value,
contextId: form?.id,
contextName: form?.name
},
Expand Down

0 comments on commit 545c71d

Please sign in to comment.