Skip to content
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

fix external packages | fix text editor #72

Merged
merged 17 commits into from
Nov 14, 2023
Binary file modified bun.lockb
Binary file not shown.
9,374 changes: 3,828 additions & 5,546 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"type": "module",
"scripts": {
"dev": "storybook dev -p 6006",
"build-storybook": "storybook build -o public/storybook",
"build:storybook": "storybook build -o public/storybook",
"astro": "astro",
"dev:playground": "astro dev",
"build": "npm run build-storybook && astro build",
"preview": "astro build && npm run build-storybook && astro preview",
"build": "npm run build:storybook && astro build",
"preview": "astro build && npm run build:storybook && astro preview",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix packages",
"format": "prettier . --write",
"publish": "cd packages/@orchidui-vue && npm run build && npm version patch && npm publish"
},
"dependencies": {
"@astrojs/vue": "^3.0.3",
"@orchidui/vue": "^0.1.72",
"@orchidui/vue": "^0.1.125",
"@popperjs/core": "^2.11.8",
"@vueup/vue-quill": "^1.2.0",
"dayjs": "^1.11.10",
"flag-icons": "^6.11.1",
"quill": "^2.0.0-dev.4",
"replace-in-file": "^7.0.2",
"v-calendar": "^3.1.2",
"vue-advanced-cropper": "^2.8.8"
Expand Down
21 changes: 14 additions & 7 deletions packages/@orchidui-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orchidui/vue",
"version": "0.1.115",
"version": "0.1.132",
"type": "module",
"scripts": {
"build": "vite build",
Expand All @@ -24,6 +24,18 @@
".": {
"import": "./dist/index.js"
},
"./TextEditor": {
"import": "./dist/TextEditor.js"
},
"./ComplexCalendar": {
"import": "./dist/ComplexCalendar.js"
},
"./ComplexDatePicker": {
"import": "./dist/ComplexDatePicker.js"
},
"./SingleFileUpload": {
"import": "./dist/SingleFileUpload.js"
},
mykhailo-diakovych marked this conversation as resolved.
Show resolved Hide resolved
"./dist/style.css": {
"import": "./dist/style.css",
"require": "./dist/style.css"
Expand All @@ -32,10 +44,5 @@
"module": "./dist/index.js",
"files": [
"./dist"
],
"dependencies": {
"@popperjs/core": "^2.11.8",
"flag-icons": "^6.11.1",
"v-calendar": "^3.1.2"
}
]
}
3 changes: 3 additions & 0 deletions packages/@orchidui-vue/src/ComplexCalendar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ComplexCalendar from "./Form/ComplexCalendar/OcComplexCalendar.vue";

export { ComplexCalendar };
3 changes: 3 additions & 0 deletions packages/@orchidui-vue/src/ComplexDatePicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ComplexDatePicker from "./Form/ComplexDatePicker/OcComplexDatePicker.vue";

export { ComplexDatePicker };
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
PAYMENTS_SIDEBAR_GROUP,
POS_SIDEBAR_GROUP,
ONLINE_STORE_SIDEBAR_GROUP,
} from "./HitpaySidebar.js";
} from "./HitpaySidebar.sample.js";

export default {
component: Sidebar,
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import { ComplexCalendar, Dropdown, Input } from "@/orchidui";
import { Dropdown, Input } from "@/orchidui";
import ComplexCalendar from "../ComplexCalendar/OcComplexCalendar.vue";
import { ref } from "vue";
import dayjs from "dayjs";

Expand Down Expand Up @@ -41,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
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup>
import { Modal, Button } from "@/orchidui";
import { Cropper } from "vue-advanced-cropper";
import "vue-advanced-cropper/dist/style.css";
Expand Down 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

This file was deleted.

Loading