-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hosts drafts #442
hosts drafts #442
Changes from 4 commits
1dae36c
fc1eb29
5d60f59
bf828f9
4e6660c
d4531af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,10 +44,10 @@ watch(() => props.setMinDate, (val) => { minDate.value = val || null }) | |
</div> | ||
</template> | ||
<style lang="scss"> | ||
@import '@vuepic/vue-datepicker/dist/main.css'; | ||
@import 'tailwindcss/base'; | ||
@import 'tailwindcss/components'; | ||
@import 'tailwindcss/utilities'; | ||
@use '@vuepic/vue-datepicker/dist/main.css' as *; | ||
@use 'tailwindcss/base' as *; | ||
@use 'tailwindcss/components' as *; | ||
@use 'tailwindcss/utilities' as *; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @import depreciated |
||
|
||
.connect-date-picker { | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,15 @@ onMounted(() => { | |
if (countryIso2.value !== undefined) { | ||
selectCountry(countryIso2.value) | ||
} else if (countryCallingCode.value) { | ||
selectedCountry.value = { | ||
callingCode: `+${countryCallingCode.value}` | ||
// Set a country based on the calling code if available | ||
const iso2 = search(countryCallingCode.value)[0]?.iso2 | ||
if (iso2) { | ||
selectCountry(iso2) | ||
} else { | ||
selectedCountry.value = { | ||
callingCode: countryCallingCode.value, | ||
label: `+${countryCallingCode.value}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when loading from a draft we need this because the api doesn't save the iso2 for the phone number. Was resulting in weird functionality when re-editing an existing person with a phone number |
||
} | ||
} | ||
} | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,14 @@ defineProps<{ | |
</p> | ||
</slot> | ||
</div> | ||
<UButton | ||
:label="button.label" | ||
:color="button.colour || 'primary'" | ||
:icon="button.icon" | ||
@click="button.action()" | ||
/> | ||
<div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrapped the button in a div to prevent it growing with the width of the row |
||
<UButton | ||
:label="button.label" | ||
:color="button.colour || 'primary'" | ||
:icon="button.icon" | ||
@click="button.action()" | ||
/> | ||
</div> | ||
</div> | ||
<slot /> | ||
</div> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alternatively we could just have these in a util like before. I like this a bit more because I think it's clearer where the 'buttonControl' functionality lives |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { ConnectBtnControl } from '#imports' | ||
|
||
export const useButtonControl = () => { | ||
const route = useRoute() | ||
|
||
function setButtonControl (buttonControl: ConnectBtnControl) { | ||
route.meta.buttonControl = buttonControl | ||
} | ||
|
||
function getButtonControl (): ConnectBtnControl { | ||
return route.meta.buttonControl as ConnectBtnControl | ||
} | ||
|
||
function handleButtonLoading (reset: boolean, buttonGrp?: 'left' | 'right', buttonIndex?: number) { | ||
// set button control for loading / disabling buttons on submit or save or reset to default | ||
const updateButtonGrp = (buttonArray: ConnectBtnControlItem[], grp: 'left' | 'right') => { | ||
for (const [index, element] of buttonArray.entries()) { | ||
if (reset) { | ||
element.disabled = false | ||
element.loading = false | ||
} else { | ||
element.loading = (grp === buttonGrp) && index === buttonIndex | ||
element.disabled = !element.loading | ||
} | ||
} | ||
} | ||
const buttonControl = getButtonControl() | ||
// update left buttons with loading / disabled as required | ||
updateButtonGrp(buttonControl.leftButtons, 'left') | ||
// update right buttons with loading / disabled as required | ||
updateButtonGrp(buttonControl.rightButtons, 'right') | ||
} | ||
|
||
return { | ||
getButtonControl, | ||
setButtonControl, | ||
handleButtonLoading | ||
} | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved to composable |
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was able to remove this and build successfully (there was some weird issue before where we needed this component defined in each layer otherwise it would give a build error) |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with 3 extra buttons I needed to update the styling for smaller screens
example: