Skip to content

Commit

Permalink
run format
Browse files Browse the repository at this point in the history
  • Loading branch information
kewcoder committed Nov 14, 2023
1 parent 055f6dd commit 9b34d7e
Show file tree
Hide file tree
Showing 27 changed files with 90 additions and 75 deletions.
4 changes: 2 additions & 2 deletions packages/@orchidui-vue/src/Builder/DataTable/OcDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ const displayFilterData = computed(() => {
!filterOptions
? 'w-full justify-end'
: isSearchExpanded
? 'md:w-fit w-full'
: ''
? 'md:w-fit w-full'
: ''
"
>
<FilterSearch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const pagination = computed(() => {
return [
...Array.from(
{ length: Math.min(totalVisible - 1, props.maxPage) },
(_, index) => index + 1
(_, index) => index + 1,
),
"...",
props.maxPage,
Expand All @@ -51,7 +51,7 @@ const pagination = computed(() => {
"...",
...Array.from(
{ length: totalVisible - 1 },
(_, index) => props.maxPage - (totalVisible - 2) + index
(_, index) => props.maxPage - (totalVisible - 2) + index,
),
];
}
Expand All @@ -76,7 +76,7 @@ const pagination = computed(() => {
@click="
$emit(
'update:modelValue',
modelValue > 1 ? modelValue - 1 : modelValue
modelValue > 1 ? modelValue - 1 : modelValue,
)
"
/>
Expand Down Expand Up @@ -106,7 +106,7 @@ const pagination = computed(() => {
@click="
$emit(
'update:modelValue',
modelValue < Number(maxPage) ? modelValue + 1 : Number(maxPage)
modelValue < Number(maxPage) ? modelValue + 1 : Number(maxPage),
)
"
/>
Expand Down
4 changes: 2 additions & 2 deletions packages/@orchidui-vue/src/DataDisplay/Table/OcTableCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const copyToClipboard = async (text) => {
isSelected
? 'block'
: isSimple
? ''
: 'md:hidden group-hover/row:block'
? ''
: 'md:hidden group-hover/row:block'
"
@update:model-value="$emit('selected')"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const OcAccordion = {
const isOpen = ref(false);
watch(
() => args.isExpandable,
(val) => (isOpen.value = args.isDisabled ? false : val)
(val) => (isOpen.value = args.isDisabled ? false : val),
);
return { isOpen, args };
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@orchidui-vue/src/Disclosure/Tabs/OcTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const isPillVariant = computed(() => props.variant === "pills");
? 'bg-oc-gray-200 text-oc-text-500'
: 'border-oc-primary-500 text-oc-text-500'
: isPillVariant
? 'text-oc-text-400'
: 'border-transparent text-oc-text-400',
? 'text-oc-text-400'
: 'border-transparent text-oc-text-400',
]"
@click="$emit('update:modelValue', tab.value)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const props = defineProps({
});
const isDropdownOpened = ref(false);
const activeMenu = computed(() =>
props.menus.find((menu) => menu.value === props.modelValue)
props.menus.find((menu) => menu.value === props.modelValue),
);
</script>
<template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const emit = defineEmits({
const isDropdownOpened = ref(false);
const isCopied = ref(false);
const hasDropdownOptions = computed(
() => props.primaryActions?.dropdownOptions
() => props.primaryActions?.dropdownOptions,
);
const copyToClipBoard = () => {
isCopied.value = true;
Expand Down
6 changes: 3 additions & 3 deletions packages/@orchidui-vue/src/Form/Button/OcButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const props = defineProps({
});
const isPressed = ref(false);
const isIconOnly = computed(
() => (props.leftIcon || props.rightIcon) && !props.label
() => (props.leftIcon || props.rightIcon) && !props.label,
);
const additionalAreaSize = computed(() => ({
default: "w-10 h-[36px]",
Expand Down Expand Up @@ -54,7 +54,7 @@ const showShadow = computed(
!props.isDisabled &&
!props.isLoading &&
!props.isActive &&
shadowContainer.value[props.variant]
shadowContainer.value[props.variant],
);
const buttonTypeClasses = computed(() => ({
Expand Down Expand Up @@ -86,7 +86,7 @@ const buttonSizeClasses = computed(() => ({
: "py-3 ") + " text-lg h-[44px]",
}));
const roundedClasses = computed(() =>
props.isRoundedFull ? "rounded-full" : "rounded"
props.isRoundedFull ? "rounded-full" : "rounded",
);
const iconSize = computed(() => ({
Expand Down
28 changes: 14 additions & 14 deletions packages/@orchidui-vue/src/Form/Calendar/OcCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const emit = defineEmits(["update:modelValue"]);
const selectedDate = ref(
props.type === "range"
? props.modelValue?.[0] || new Date()
: props.modelValue || new Date()
: props.modelValue || new Date(),
);
const selectedStartDate = ref(selectedDate.value);
Expand All @@ -47,23 +47,23 @@ const selectedEndDate = ref(
? props.modelValue?.[1] ||
new Date(
new Date(selectedStartDate.value).setDate(
selectedStartDate.value.getDate() + 2
)
selectedStartDate.value.getDate() + 2,
),
)
: null
: null,
);
const selectedStartDay = ref(
selectedStartDate.value?.getMonth() === selectedDate.value?.getMonth()
? selectedStartDate.value?.getDate()
: null
: null,
);
const selectedEndDay = ref(
props.type === "range"
? selectedEndDate.value?.getMonth() === selectedDate.value?.getMonth()
? selectedEndDate.value?.getDate()
: null
: null
: null,
);
const daysInMonth = computed(() => {
Expand All @@ -73,7 +73,7 @@ const daysInMonth = computed(() => {
const lastDay = new Date(
date?.getFullYear(),
date?.getMonth() + 1,
0
0,
).getDate();
return Array.from({ length: lastDay }, (_, i) => i + 1);
Expand Down Expand Up @@ -101,10 +101,10 @@ const selectDay = (day) => {
if (
props.type !== "range" ||
Math.abs(
currentMonth.getTime() - new Date(selectedEndDate.value).getTime()
currentMonth.getTime() - new Date(selectedEndDate.value).getTime(),
) >
Math.abs(
currentMonth.getTime() - new Date(selectedStartDate.value).getTime()
currentMonth.getTime() - new Date(selectedStartDate.value).getTime(),
)
) {
selectedStartDay.value = day;
Expand Down Expand Up @@ -141,7 +141,7 @@ const prevMonth = () => {
selectedDate.value = new Date(
selectedDate.value?.getFullYear(),
selectedDate.value?.getMonth() - 1,
1
1,
);
selectedStartDay.value =
Expand All @@ -157,7 +157,7 @@ const prevMonth = () => {
selectedStartDate.value = new Date(
selectedStartDate.value?.getFullYear(),
selectedStartDate.value?.getMonth() - 1,
1
1,
);
selectedStartDay.value = null;
}
Expand All @@ -169,7 +169,7 @@ const nextMonth = () => {
selectedDate.value = new Date(
selectedDate.value?.getFullYear(),
selectedDate.value?.getMonth() + 1,
1
1,
);
selectedStartDay.value =
selectedDate.value?.getMonth() === selectedStartDate.value?.getMonth()
Expand All @@ -184,7 +184,7 @@ const nextMonth = () => {
selectedStartDate.value = new Date(
selectedStartDate.value?.getFullYear(),
selectedStartDate.value?.getMonth() + 1,
1
1,
);
selectedStartDay.value = null;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ const doneSelecting = () => {
"update:modelValue",
props.type === "range"
? [selectedStartDate.value, selectedEndDate.value]
: new Date(selectedStartDate.value)
: new Date(selectedStartDate.value),
);
};
</script>
Expand Down
8 changes: 4 additions & 4 deletions packages/@orchidui-vue/src/Form/Checkbox/OcCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const onInput = () =>
? 'border-oc-primary-100 bg-oc-primary-100'
: 'border-oc-primary bg-oc-primary'
: isError
? 'border-oc-error'
: isDisabled
? 'bg-oc-primary-50 border-oc-primary-200'
: 'border-oc-primary-200',
? 'border-oc-error'
: isDisabled
? 'bg-oc-primary-50 border-oc-primary-200'
: 'border-oc-primary-200',
isError && modelValue && !isDisabled ? '!bg-oc-error ' : '',
isError && !isDisabled ? '!border-oc-error' : '',
isPartial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Default = {
const selectedCheckboxes = ref([]);
watch(
() => args.modelValue,
(val) => (selectedCheckboxes.value = val)
(val) => (selectedCheckboxes.value = val),
);
return { args, selectedCheckboxes };
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const toggleCheckbox = (value) => {
"update:modelValue",
isSelectedCheckbox(value)
? props.modelValue.filter((v) => v !== value)
: [...props.modelValue, value]
: [...props.modelValue, value],
);
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const isOpen = ref(false);
<Dropdown v-model="isOpen" position="bottom" class="w-full">
<Input
:model-value="`${dayjs(modelValue.start).format(formatDate)} - ${dayjs(
modelValue.end
modelValue.end,
).format(formatDate)}`"
icon="calendar"
readonly
Expand Down
2 changes: 1 addition & 1 deletion packages/@orchidui-vue/src/Form/LinkInput/OcLinkInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defineEmits({
const isDropdownOpened = ref(false);
const selectedLink = ref(props.links?.[0]?.value || "");
const selectedLinkProps = computed(() =>
props.links.find((link) => link.value === selectedLink.value)
props.links.find((link) => link.value === selectedLink.value),
);
</script>
Expand Down
6 changes: 3 additions & 3 deletions packages/@orchidui-vue/src/Form/PhoneInput/OcPhoneInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const query = ref("");
const filteredCountryCodes = computed(() =>
props.countryCodes
.filter((country) =>
country.country.toLowerCase().includes(query.value.toLowerCase())
country.country.toLowerCase().includes(query.value.toLowerCase()),
)
.sort((a, b) => a.country.localeCompare(b.country))
.sort((a, b) => a.country.localeCompare(b.country)),
);
const getCountryObject = (iso) =>
props.countryCodes.find(
(country) => country.iso.toLowerCase() === iso.toLowerCase()
(country) => country.iso.toLowerCase() === iso.toLowerCase(),
) || null;
const getCountryCode = (iso) => getCountryObject(iso)?.code || "";
Expand Down
6 changes: 3 additions & 3 deletions packages/@orchidui-vue/src/Form/Select/OcSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const emit = defineEmits({
});
const localValue = ref(
props.modelValue ? props.modelValue : props.multiple ? [] : ""
props.modelValue ? props.modelValue : props.multiple ? [] : "",
);
const query = ref("");
Expand All @@ -45,7 +45,7 @@ const filterOptions = (options, query) => {
for (const option of options) {
if (option.values) {
const filteredGroup = option.values.filter((subOption) =>
subOption.label.toLowerCase().includes(query.toLowerCase())
subOption.label.toLowerCase().includes(query.toLowerCase()),
);
if (filteredGroup.length > 0) {
Expand All @@ -64,7 +64,7 @@ const filterOptions = (options, query) => {
return filteredOptions;
};
const filterableOptions = computed(() =>
filterOptions(props.options, query.value)
filterOptions(props.options, query.value),
);
const selectOption = (option) => {
const result = props.multiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const zoom = (zoom) => cropper.value.zoom(zoom);

<style lang="scss">
.test {
background: url("./assets/empty-space.png"), lightgray 0 0% / 50px 50px repeat;
background:
url("./assets/empty-space.png"),
lightgray 0 0% / 50px 50px repeat;
}
.vue-simple-handler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const { currentFiles, onChangeFile, onDeleteFile } =
useUploadFileProgress(emit);
const videoUrl = computed(() =>
URL.createObjectURL(currentFiles.value?.[0].file)
URL.createObjectURL(currentFiles.value?.[0].file),
);
const currentFile = computed(() => currentFiles.value?.[0]);
onMounted(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@orchidui-vue/src/Form/Slider/OcSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const fillColor = () => {
"update:modelValue",
props.type === "range"
? [sliderOne.value?.value, sliderTwo.value?.value]
: sliderOne.value.value
: sliderOne.value.value,
);
};
const updateSlider = (value) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/@orchidui-vue/src/Form/TextEditor/QuillEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const QuillEditor = defineComponent({
required: false,
validator: (value) => {
if (typeof value === "string" && value !== "") {
return value.charAt(0) === "#"
return value.charAt(0) === "#";
}
return true;
},
Expand Down Expand Up @@ -139,7 +139,7 @@ export const QuillEditor = defineComponent({
if (props.id && props.id !== "") {
clientOptions.modules = {
toolbar: (() => {
return props.id
return props.id;
})(),
};
}
Expand Down
Loading

0 comments on commit 9b34d7e

Please sign in to comment.