merge: take origin/main for conflicting Vue files (main priority)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 5.5
parent
5cf721f91e
commit
387c5c1676
@@ -6,7 +6,7 @@ import {
|
||||
ClockCircleOutlined,
|
||||
LeftOutlined,
|
||||
RightOutlined,
|
||||
} from '@/icons/ant-bridge';
|
||||
} from '@ant-design/icons-vue';
|
||||
import {
|
||||
addJalaliMonths,
|
||||
dateToJalali,
|
||||
@@ -58,6 +58,8 @@ const hourColRef = ref<HTMLElement | null>(null);
|
||||
const minuteColRef = ref<HTMLElement | null>(null);
|
||||
const top = ref(0);
|
||||
const left = ref(0);
|
||||
/** بالای مودال Ant (حدود ۱۰۰۰) تا تقویم پشت پنجره نماند */
|
||||
const popupZ = ref(120);
|
||||
const todayJ = dateToJalali(new Date());
|
||||
const cursor = ref<{ jy: number; jm: number }>({ jy: todayJ.jy, jm: todayJ.jm });
|
||||
const draftHour = ref(9);
|
||||
@@ -325,16 +327,32 @@ function place() {
|
||||
const panel = panelRef.value;
|
||||
if (!trigger) return;
|
||||
const rect = trigger.getBoundingClientRect();
|
||||
const width = panel?.offsetWidth || (props.mode === 'time' ? (isMobile.value ? 340 : 280) : 320);
|
||||
const height = panel?.offsetHeight || (props.mode === 'time' ? (isMobile.value ? 460 : 320) : 360);
|
||||
const width =
|
||||
panel?.offsetWidth ||
|
||||
(props.mode === 'time' ? (isMobile.value ? 340 : 280) : 328);
|
||||
const height =
|
||||
panel?.offsetHeight ||
|
||||
(props.mode === 'time' ? (isMobile.value ? 460 : 320) : 340);
|
||||
const margin = 8;
|
||||
let nextLeft = rect.left;
|
||||
if (getComputedStyle(document.documentElement).direction === 'rtl') {
|
||||
nextLeft = rect.right - width;
|
||||
}
|
||||
nextLeft = Math.min(Math.max(8, nextLeft), window.innerWidth - width - 8);
|
||||
let nextTop = rect.bottom + 8;
|
||||
if (nextTop + height > window.innerHeight - 8) {
|
||||
nextTop = Math.max(8, rect.top - height - 8);
|
||||
nextLeft = Math.min(
|
||||
Math.max(margin, nextLeft),
|
||||
Math.max(margin, window.innerWidth - width - margin),
|
||||
);
|
||||
const spaceBelow = window.innerHeight - rect.bottom - margin * 2;
|
||||
const spaceAbove = rect.top - margin * 2;
|
||||
let nextTop: number;
|
||||
if (height <= spaceBelow) {
|
||||
nextTop = rect.bottom + margin;
|
||||
} else if (height <= spaceAbove) {
|
||||
nextTop = rect.top - height - margin;
|
||||
} else if (spaceBelow >= spaceAbove) {
|
||||
nextTop = Math.max(margin, window.innerHeight - height - margin);
|
||||
} else {
|
||||
nextTop = margin;
|
||||
}
|
||||
left.value = nextLeft;
|
||||
top.value = nextTop;
|
||||
@@ -360,6 +378,7 @@ async function show() {
|
||||
calView.value = props.startView;
|
||||
clockFace.value = 'hour';
|
||||
syncViewport();
|
||||
liftAboveOverlays();
|
||||
open.value = true;
|
||||
await nextTick();
|
||||
place();
|
||||
@@ -554,7 +573,7 @@ onBeforeUnmount(() => {
|
||||
'is-desktop': !isMobile,
|
||||
}"
|
||||
role="dialog"
|
||||
:style="{ top: `${top}px`, left: `${left}px` }"
|
||||
:style="{ top: `${top}px`, left: `${left}px`, zIndex: popupZ }"
|
||||
>
|
||||
<header v-if="mode !== 'time'" class="nav">
|
||||
<a-button type="text" class="nav-btn" :aria-label="navLabels.forward" @click="navStep(1)">
|
||||
@@ -742,7 +761,7 @@ onBeforeUnmount(() => {
|
||||
>
|
||||
پاک کردن
|
||||
</a-button>
|
||||
<a-button type="primary" class="done" @click="hide">تأیید</a-button>
|
||||
<a-button type="primary" @click="hide">تأیید</a-button>
|
||||
</footer>
|
||||
</div>
|
||||
</Teleport>
|
||||
@@ -867,10 +886,11 @@ onBeforeUnmount(() => {
|
||||
.panel {
|
||||
position: fixed;
|
||||
z-index: 120;
|
||||
box-sizing: border-box;
|
||||
width: min(20.5rem, calc(100vw - 16px));
|
||||
max-height: calc(100vh - 16px);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
/* تقویم باید یکجا دیده شود؛ اسکرول داخل پنل گیجکننده است */
|
||||
max-height: none;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
border-radius: var(--radius);
|
||||
box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
|
||||
@@ -878,6 +898,13 @@ onBeforeUnmount(() => {
|
||||
font-family: IRANSans, Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
@media (max-height: 420px) {
|
||||
.panel {
|
||||
max-height: calc(100vh - 16px);
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-time {
|
||||
width: min(22.5rem, calc(100vw - 16px));
|
||||
}
|
||||
@@ -909,45 +936,40 @@ onBeforeUnmount(() => {
|
||||
|
||||
.pick-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 0.35rem;
|
||||
padding: 0.25rem 0;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.pick-cell) {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 44px;
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
.panel :deep(.pick-cell.ant-btn) {
|
||||
width: 100% !important;
|
||||
min-width: 0 !important;
|
||||
height: 44px !important;
|
||||
padding-inline: 0 !important;
|
||||
border-radius: var(--radius);
|
||||
color: #0f172a;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.pick-cell.today) {
|
||||
.panel :deep(.pick-cell.today) {
|
||||
box-shadow: inset 0 0 0 1px #99f6e4;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.pick-cell.on),
|
||||
.panel :deep(.ant-btn.pick-cell:hover) {
|
||||
.panel :deep(.pick-cell.on),
|
||||
.panel :deep(.pick-cell.ant-btn:hover) {
|
||||
background: #0d9488;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.nav-btn) {
|
||||
.nav-btn {
|
||||
width: 32px;
|
||||
min-width: 32px;
|
||||
height: 32px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
background: #f1f5f9;
|
||||
color: #0f766e;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -960,6 +982,7 @@ onBeforeUnmount(() => {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
gap: 0.15rem;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@@ -970,40 +993,43 @@ onBeforeUnmount(() => {
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.day) {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 34px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
.panel :deep(.day.ant-btn) {
|
||||
width: 100% !important;
|
||||
min-width: 0 !important;
|
||||
height: 34px !important;
|
||||
padding: 0 !important;
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
background: none;
|
||||
color: #0f172a;
|
||||
font: inherit;
|
||||
font-size: 0.82rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.day.mute) {
|
||||
.panel :deep(.day.ant-btn > span) {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.panel :deep(.day.mute) {
|
||||
color: #cbd5e1;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.day.today) {
|
||||
.panel :deep(.day.today) {
|
||||
box-shadow: inset 0 0 0 1px #99f6e4;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.day.on),
|
||||
.panel :deep(.ant-btn.day:hover) {
|
||||
.panel :deep(.day.on),
|
||||
.panel :deep(.day.ant-btn:hover) {
|
||||
background: #0d9488;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.day.mute:hover) {
|
||||
.panel :deep(.day.mute:hover) {
|
||||
background: #f1f5f9;
|
||||
color: #64748b;
|
||||
}
|
||||
@@ -1033,11 +1059,9 @@ onBeforeUnmount(() => {
|
||||
margin-bottom: 0.85rem;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.md-chip) {
|
||||
.md-chip {
|
||||
min-width: 5.1rem;
|
||||
height: 4.1rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
background: #f1f5f9;
|
||||
@@ -1050,7 +1074,7 @@ onBeforeUnmount(() => {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.md-chip.on) {
|
||||
.md-chip.on {
|
||||
background: #ccfbf1;
|
||||
color: #0f766e;
|
||||
box-shadow: inset 0 0 0 2px #99f6e4;
|
||||
@@ -1124,11 +1148,10 @@ onBeforeUnmount(() => {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.md-tick) {
|
||||
.md-tick {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 36px;
|
||||
min-width: 36px;
|
||||
height: 36px;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
@@ -1145,12 +1168,12 @@ onBeforeUnmount(() => {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.md-tick.inner) {
|
||||
.md-tick.inner {
|
||||
font-size: 0.74rem;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.md-tick.on) {
|
||||
.md-tick.on {
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -1199,12 +1222,9 @@ onBeforeUnmount(() => {
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.col-item) {
|
||||
.col-item {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 36px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: var(--radius);
|
||||
background: transparent;
|
||||
@@ -1215,11 +1235,11 @@ onBeforeUnmount(() => {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.col-item:hover) {
|
||||
.col-item:hover {
|
||||
background: #e2e8f0;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.col-item.on) {
|
||||
.col-item.on {
|
||||
background: #0d9488;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -1231,8 +1251,28 @@ onBeforeUnmount(() => {
|
||||
margin-top: 0.7rem;
|
||||
}
|
||||
|
||||
.panel :deep(.ant-btn.done) {
|
||||
.link,
|
||||
.done {
|
||||
border: 0;
|
||||
background: none;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: #0f766e;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.done {
|
||||
margin-inline-start: auto;
|
||||
background: #14b8a6;
|
||||
color: #fff;
|
||||
border-radius: var(--radius);
|
||||
padding: 0.4rem 0.8rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.panel.is-mobile .time-box {
|
||||
|
||||
Reference in New Issue
Block a user