Skip to content

Commit

Permalink
fix constants export (declare on docs instead)
Browse files Browse the repository at this point in the history
fix ref on FieldHelpText h
  • Loading branch information
carsoli committed Jan 11, 2024
1 parent 66ab8d5 commit 5406dc5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
10 changes: 7 additions & 3 deletions packages/documentation/pages/usage/components/form-fields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,13 @@ import { TimeConversion } from '@metatypes/units'
import cloneDeep from 'lodash/cloneDeep'
import { computed, defineComponent, ref } from 'vue'
import { useRouter } from '../../..//hooks/use-router'
import { ISO8601, ISO8601_SECONDS } from '../../../../kotti-ui/source/constants'
import { getLast, today } from '../../../utilities/date'
import { useRouter } from '../../../hooks/use-router'
import {
getLast,
today,
ISO8601,
ISO8601_SECONDS,
} from '../../../utilities/date'
import {
createActions,
createRemoteUpload,
Expand Down
7 changes: 4 additions & 3 deletions packages/documentation/utilities/date.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import x from '@3yourmind/kotti-ui'
import { ISO8601 } from '@3yourmind/kotti-ui/source/constants'
import dayjs from 'dayjs'
import type { ManipulateType } from 'dayjs'

export const ISO8601 = 'YYYY-MM-DD' as const
export const ISO8601_SECONDS = 'YYYY-MM-DD HH:mm:ss' as const

/**
* Returns formatted today's date. Default template is ISO8601.
* @param templateFormat dayjs compatible datetime format string
Expand All @@ -20,4 +21,4 @@ export const today = (templateFormat: string = ISO8601): string =>
export const getLast = (
unit: ManipulateType,
templateFormat: string = ISO8601,
) => dayjs().subtract(1, unit).format(templateFormat)
): string => dayjs().subtract(1, unit).format(templateFormat)
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const useSelectTippy = <T>(
},
theme: 'light-border',
trigger: 'click focusin',
triggerTarget: triggerTargets ? triggerTargets.value : undefined,
triggerTarget: triggerTargets?.value ?? undefined,
})),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export default defineComponent({
'i',
{
class: 'yoco',
ref: 'helpTextTriggerRef',
ref: helpTextTriggerRef,
},
[Yoco.Icon.CIRCLE_QUESTION],
),
h(
'div',
{
ref: 'helpTextContentRef',
ref: helpTextContentRef,
},
props.helpTextSlot.length > 0
? props.helpTextSlot
Expand Down

0 comments on commit 5406dc5

Please sign in to comment.