Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
kewcoder committed Nov 14, 2023
1 parent f1ff9ba commit 7840faa
Show file tree
Hide file tree
Showing 29 changed files with 1,366 additions and 1,312 deletions.
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
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
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
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
@@ -1,4 +1,3 @@

import ComplexCalendar from "./OcComplexCalendar.vue";
import { Theme } from "@/orchidui";
import dayjs from "dayjs";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { Dropdown, Input } from "@/orchidui";
import { ComplexCalendar } from '@/orchidui/ComplexCalendar'
import { ComplexCalendar } from "@/orchidui/ComplexCalendar";
import { ref } from "vue";
import dayjs from "dayjs";
Expand Down 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,9 +70,7 @@ 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 @@ -33,7 +33,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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Theme } from "@/orchidui";
import TextEditor from './OcTextEditor.vue'
import TextEditor from "./OcTextEditor.vue";
import { ref } from "vue";

export default {
Expand Down
6 changes: 3 additions & 3 deletions packages/@orchidui-vue/src/Form/TextEditor/OcTextEditor.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import Quill from 'quill'
import Quill from "quill";
import { QuillEditor } from "./QuillEditor";
import { onMounted, ref } from "vue";
Expand All @@ -23,7 +23,7 @@ Size.whitelist = props.fontSizes.map((f) => f.value);
Quill.register(Size, true);
const id = ref(crypto.randomUUID().replace(/[^a-zA-Z]+/g, ""));
const localValue = ref(props.modelValue ?? '');
const localValue = ref(props.modelValue ?? "");
const isUndoActive = ref(false);
const isRedoActive = ref(false);
const isBoldActive = ref(false);
Expand Down Expand Up @@ -349,7 +349,7 @@ onMounted(() => {
</template>
<style lang="scss">
@import url('./snow.css');
@import url("./snow.css");
.ql-container {
@apply rounded-b text-base;
}
Expand Down
Loading

0 comments on commit 7840faa

Please sign in to comment.