diff --git a/models/all/src/version.json b/models/all/src/version.json index e8364c8f59..b5f2c03606 100644 --- a/models/all/src/version.json +++ b/models/all/src/version.json @@ -1 +1 @@ -{ "major": 0, "minor": 6, "patch": 120 } \ No newline at end of file +{ "major": 0, "minor": 6, "patch": 120 } diff --git a/packages/theme/styles/_colors.scss b/packages/theme/styles/_colors.scss index 63a38c407c..01892a6b8a 100644 --- a/packages/theme/styles/_colors.scss +++ b/packages/theme/styles/_colors.scss @@ -144,6 +144,7 @@ --theme-editbox-focus-color: rgba(255, 255, 255, .04); --theme-editbox-focus-border: #5190EC; + --theme-editbox-default-focus-border: #205DC2; // Light --theme-tablist-color: rgba(0, 0, 0, .02); --theme-tablist-plain-color: #2A64C4; // Light --theme-tablist-plain-divider: rgba(255, 255, 255, .07); // Light invert @@ -339,6 +340,7 @@ --theme-editbox-focus-color: rgba(0, 0, 0, .08); --theme-editbox-focus-border: #5190EC; + --theme-editbox-default-focus-border: #205DC2; --theme-tablist-color: rgba(0, 0, 0, .02); --theme-tablist-plain-color: #2A64C4; --theme-tablist-plain-divider: rgba(0, 0, 0, .07); diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index e664471549..dd2dd67bd1 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -265,8 +265,11 @@ input.search { .justify-center { justify-content: center; } .justify-stretch { justify-content: stretch; } .items-baseline { align-items: baseline; } +.items-start { align-items: flex-start; } .items-center { align-items: center; } -.self-end { align-self: end; } +.items-stretch { align-items: stretch; } +.self-start { align-self: flex-start; } +.self-end { align-self: flex-end; } .flex-gap-4 { gap: 1rem; } .flex-gap-3 { gap: .75rem; } @@ -465,6 +468,7 @@ input.search { .ml-2 { margin-left: .5rem; } .ml-3 { margin-left: .75rem; } .ml-4 { margin-left: 1rem; } +.ml-5-5 { margin-left: 1.375rem; } .ml-6 { margin-left: 1.5rem; } .ml-8 { margin-left: 2rem; } .ml-10 { margin-left: 2.5rem; } @@ -524,6 +528,7 @@ input.search { .pl-2 { padding-left: .5rem; } .pl-3 { padding-left: .75rem; } .pl-4 { padding-left: 1rem; } +.pl-5-5 { padding-left: 1.375rem; } .pl-7 { padding-left: 1.75rem; } .pl-8 { padding-left: 2rem; } .pl-9 { padding-left: 2.25rem; } @@ -534,10 +539,12 @@ input.search { .pr-4 { padding-right: 1rem; } .pr-8 { padding-right: 2rem; } .pr-24 { padding-right: 6rem; } +.pt-1 { padding-top: .25rem; } .pt-2 { padding-top: .5rem; } .pt-3 { padding-top: .75rem; } .pt-4 { padding-top: 1rem; } .pt-6 { padding-top: 1.5rem; } +.pb-0-5 { padding-bottom: .125rem; } .pb-1 { padding-bottom: .25rem !important; } .pb-2 { padding-bottom: .5rem; } .pb-3 { padding-bottom: .75rem; } @@ -550,6 +557,7 @@ input.search { .px-4 { padding: 0 1rem; } .px-6 { padding: 0 1.5rem; } .px-10 { padding: 0 2.5rem; } +.py-0-5 { padding: 0.125rem 0; } .py-1 { padding: 0.25rem 0; } .py-4 { padding: 1rem 0; } .py-8 { padding: 2rem 0; } @@ -560,6 +568,7 @@ input.search { .p-2 { padding: .5rem; } .p-3 { padding: .75rem; } .p-4 { padding: 1rem; } +.p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; } .p-10 { padding: 2.5rem; } @@ -568,6 +577,8 @@ input.search { .step-lr25 + .step-lr25 { margin-left: .25rem; } .step-lr75 + .step-lr75 { margin-left: .75rem; } +.step-tb25 + .step-tb25 { margin-top: .25rem; } +.step-tb375 + .step-tb375 { margin-top: .375rem; } .step-tb75 + .step-tb75 { margin-top: .75rem; } .step-tb-6 + .step-tb-6 { margin-top: 1.5rem; } .step-tb-12 + .step-tb-12 { margin-top: 3rem; } @@ -640,6 +651,7 @@ input.search { .h-18 { height: 4.5rem; } .h-50 { height: 12.5rem; } .h-60 { height: 15.0rem; } +.w-min { width: min-content; } .w-full { width: 100%; } .w-2 { width: .5rem; } .w-4 { width: 1rem; } @@ -659,6 +671,7 @@ input.search { .min-w-4 { min-width: 1rem; } .min-w-8 { min-width: 2rem; } .min-w-9 { min-width: 2.25rem; } +.min-w-12 { min-width: 3rem; } .min-w-60 { min-width: 15rem; } .min-w-80 { min-width: 20rem; } .min-w-100 { min-width: 25rem; } @@ -669,6 +682,7 @@ input.search { .min-h-4 { min-height: 1rem; } .min-h-5 { min-height: 1.25rem; } .min-h-7 { min-height: 1.75rem; } +.min-h-8 { min-height: 2rem; } .min-h-30 { min-height: 7.5rem; } .min-h-60 { min-height: 15rem; } .max-w-2 { max-width: .5rem; } @@ -786,6 +800,7 @@ a.no-line { user-select: none; } .text-xs { font-size: .625rem; } +.text-11px { font-size: .6875rem; } .text-sm { font-size: .75rem; } .text-md { font-size: .8125rem; } .text-normal { font-size: var(--body-font-size); } diff --git a/packages/theme/styles/button.scss b/packages/theme/styles/button.scss index 0534c809d2..e68b365f88 100644 --- a/packages/theme/styles/button.scss +++ b/packages/theme/styles/button.scss @@ -27,7 +27,7 @@ font-size: .8125rem; &.only-icon { width: 1.75rem; } } - &.medium { + &.medium:not(.stepper) { height: 2rem; &.only-icon { width: 2rem; } } @@ -59,6 +59,7 @@ &.short { max-width: 8.5rem; } &.accent { font-weight: 500; } &.sh-no-shape { border-radius: .25rem; } + &.sh-round-sm { border-radius: .375rem; } &.sh-round { border-radius: .5rem; } &.sh-round2 { border-radius: .75rem; } &.sh-circle { border-radius: 1rem; } @@ -89,7 +90,8 @@ &.jf-center { justify-content: center; } &.only-icon { flex-shrink: 0 !important; - padding: 0; + + &:not(.stepper) { padding: 0; } } &.regular { @@ -133,7 +135,7 @@ } } } - &.ghost { + &.ghost, &.stepper { &:hover { background-color: var(--theme-button-hovered); } &:active { background-color: var(--theme-button-pressed); } &.selected { background-color: var(--highlight-select); } @@ -265,6 +267,14 @@ background-color: var(--theme-button-contrast-disabled); } } + &.stepper { + padding: 0; + width: 1rem; + height: .8125rem; + min-width: 1rem; + + &:focus { box-shadow: 0 0 0 1px var(--accented-button-outline); } + } &.notSelected { color: var(--theme-dark-color); diff --git a/packages/theme/styles/common.scss b/packages/theme/styles/common.scss index bef1bd5f41..2723514475 100644 --- a/packages/theme/styles/common.scss +++ b/packages/theme/styles/common.scss @@ -403,6 +403,7 @@ &:not(.withMargins) { margin: 0 !important; } + &.x0-5 { height: .125rem; } &.x1-5 { height: .375rem; } &.x2 { height: .5rem; } &.x3 { height: .75rem; } diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index ecdaab50c3..8fa86252e2 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -788,6 +788,41 @@ } } +/* Option */ +.antiOption { + position: relative; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 .25rem; + height: 2rem; + min-width: 0; + font-size: .8125rem; + border-radius: .375rem; + outline: none; + z-index: 1; + + .tools { opacity: 0; } + + &.leftPadding { padding-left: 0.625rem; } + &::before { + position: absolute; + top: -.125rem; + bottom: -.125rem; + left: -.125rem; + right: -.125rem; + border: 1px solid var(--theme-editbox-default-focus-border); + border-radius: .5rem; + z-index: -1; + } + &:hover { + background-color: var(--theme-button-hovered); + + .tools { opacity: 1; } + } + &:focus-within::before, &:focus::before { content: ''; } +} + /* Wraps */ .antiWrapper { position: relative; diff --git a/packages/theme/styles/editors.scss b/packages/theme/styles/editors.scss new file mode 100644 index 0000000000..1a2228ed31 --- /dev/null +++ b/packages/theme/styles/editors.scss @@ -0,0 +1,97 @@ +.antiEditBox { + display: inline-flex; + flex-direction: column; + align-items: flex-start; + min-width: 0; + + .large-style { + font-weight: 400; + font-size: 1.25rem; + } + .small-style { + font-weight: 400; + font-size: 0.75rem; + } + .search-style { + font-weight: 400; + padding: 0.625rem 0.75rem; + } + .underline { + font-weight: 500; + + input { + padding: 0.25rem 0.5rem; + background-color: var(--theme-editbox-focus-color); + border-radius: 0.25rem; + + &:focus { box-shadow: 0 0 0 1px var(--theme-editbox-focus-border); } + } + } + .focusable:not(.default, .default-large, .ghost, .ghost-large) { + margin: 0 -0.75rem; + padding: 0.625rem 0.75rem; + width: calc(100% + 1.5rem); + border-radius: 0.25rem; + transition: border-color 0.15s ease-in-out; + + &:focus-within { box-shadow: 0 0 0 1px var(--theme-editbox-focus-border); } + } + + input { + margin: 0; + padding: 0; + min-width: 0; + color: var(--theme-caption-color); + border: none; + border-radius: 2px; + + &::-webkit-contacts-auto-fill-button, + &::-webkit-credentials-auto-fill-button { + visibility: hidden; + display: none !important; + pointer-events: none; + height: 0; + width: 0; + margin: 0; + } + &.number::-webkit-outer-spin-button, + &.number::-webkit-inner-spin-button { -webkit-appearance: none; } + } + input[type='number'] { -moz-appearance: textfield; } + &.uppercase .hidden-text, + &.uppercase input { text-transform: uppercase; } + + .default, .ghost { + font-weight: 400; + font-size: .8125rem; + } + .default-large, .ghost-large { + font-weight: 500; + font-size: 1rem; + } + .default, .ghost { padding: 0.3125rem 0.5rem; } + .default-large, .ghost-large { padding: 0.4375rem 0.5rem; } + .default, .ghost, .default-large, .ghost-large { + box-sizing: border-box; + line-height: 1.25rem; + border-radius: .375rem; + border: 1px solid transparent; + + input { + color: inherit; + + &::placeholder { color: var(--theme-darker-color); } + } + &:hover { background-color: var(--theme-button-hovered); } + &.focusable:focus-within { + background-color: var(--theme-button-focused); + border-color: var(--theme-editbox-default-focus-border); + } + &.disabled { + color: var(--theme-dark-color); + background-color: transparent; + border-color: var(--theme-divider-color); + } + } + .default, .default-large { border-color: var(--theme-divider-color); } +} diff --git a/packages/theme/styles/global.scss b/packages/theme/styles/global.scss index 1227ae872f..3117780afc 100644 --- a/packages/theme/styles/global.scss +++ b/packages/theme/styles/global.scss @@ -17,6 +17,7 @@ @import "./_layouts.scss"; @import "./common.scss"; @import "./button.scss"; +@import "./editors.scss"; @import "./components.scss"; @import "./dialogs.scss"; @import "./popups.scss"; diff --git a/packages/theme/styles/popups.scss b/packages/theme/styles/popups.scss index eea2361c7c..27faf42724 100644 --- a/packages/theme/styles/popups.scss +++ b/packages/theme/styles/popups.scss @@ -222,6 +222,7 @@ .ap-space { flex-shrink: 0; height: .25rem; + &.x1-5 { height: .375rem; } &.x2 { height: .5rem; } &.x3 { height: .75rem; } } @@ -255,11 +256,13 @@ cursor: pointer; &:not(.separator) { - margin: 0 .5rem; min-height: 2.25rem; border-radius: .25rem; } - &:not(.separator, .withComp) { padding: .25rem .5rem; } + &:not(.separator, .noMargin) { + margin-left: .5rem; + margin-right: .5rem; + } &.withComp { display: flex; align-items: center; @@ -340,6 +343,21 @@ &.halfMargin { margin: .25rem 0; } } } + &:not(.thinStyle) .ap-menuItem:not(.separator, .withComp) { padding: .25rem .5rem; } + &.thinStyle { + border-radius: .75rem; + + .ap-menuItem:not(.separator) { + padding: 0 .5rem; + min-height: 2rem; + font-size: .8125rem; + border-radius: .375rem; + } + .ap-menuItem:not(.separator, .noMargin) { + margin-left: .375rem; + margin-right: .375rem; + } + } .ap-check { flex-shrink: 0; margin-left: 1rem; diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index 25f6c1528a..45c40bb6da 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -9,6 +9,9 @@ "Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}", "Months": "{months, plural, =0 {this month} =1 {a month ago} other {# months ago}}", "Years": "{years, plural, =0 {this year} =1 {a year ago} other {# years ago}}", + "MinutesShort": "{value}m", + "HoursShort": "{value}h", + "DaysShort": "{value}d", "ShowMore": "Show more", "ShowLess": "Show less", "Search": "Search", diff --git a/packages/ui/lang/ru.json b/packages/ui/lang/ru.json index 9cf8af2297..0a16530a39 100644 --- a/packages/ui/lang/ru.json +++ b/packages/ui/lang/ru.json @@ -9,6 +9,9 @@ "Days": "{days, plural, =0 {сегодня} =1 {вчера} one {# день назад} few {# дня назад} other {# дней назад}}", "Months": "{months, plural, =0 {в этом месяце} =1 {месяц назад} one {# месяц назад} few {# месяца назад} other {# месяцев назад}}", "Years": "{years, plural, =0 {в этом году} =1 {год назад} one {# год назад} few {# год назад} other {# лет назад}}", + "MinutesShort": "{value}м", + "HoursShort": "{value}ч", + "DaysShort": "{value}д", "ShowMore": "Показать больше", "ShowLess": "Показать меньше", "Search": "Поиск", diff --git a/packages/ui/src/components/EditBox.svelte b/packages/ui/src/components/EditBox.svelte index a821ecdea3..17c1957da9 100644 --- a/packages/ui/src/components/EditBox.svelte +++ b/packages/ui/src/components/EditBox.svelte @@ -133,7 +133,7 @@
&ast{/if}
{/if} -
+
{#if icon}
@@ -205,78 +205,3 @@ {/if}
- - diff --git a/packages/ui/src/components/ListView.svelte b/packages/ui/src/components/ListView.svelte index 2c8162f5cc..6dbd8aa7b4 100644 --- a/packages/ui/src/components/ListView.svelte +++ b/packages/ui/src/components/ListView.svelte @@ -20,6 +20,7 @@ export let count: number export let addClass: string | undefined = undefined export let noScroll: boolean = false + export let kind: 'default' | 'thin' = 'default' const refs: HTMLElement[] = [] @@ -60,7 +61,7 @@ {#if count}
{ dispatch('changeContent') @@ -95,6 +96,15 @@ min-width: 0; border-radius: 0.25rem; } + &.thin { + .list-item { + margin: 0 0.375rem; + border-radius: 0.375rem; + } + .list-item + .list-item { + margin-top: 0.375rem; + } + } .selection { background-color: var(--theme-popup-hover); } diff --git a/packages/ui/src/components/NumberInput.svelte b/packages/ui/src/components/NumberInput.svelte index ce91957659..afb2f11c56 100644 --- a/packages/ui/src/components/NumberInput.svelte +++ b/packages/ui/src/components/NumberInput.svelte @@ -23,6 +23,7 @@ import { floorFractionDigits } from '../utils' import DownOutline from './icons/DownOutline.svelte' import UpOutline from './icons/UpOutline.svelte' + import Button from './Button.svelte' export let maxWidth: string | undefined = undefined export let value: number = 0 @@ -145,13 +146,9 @@ on:keypress on:blur /> -
-
value++}> - -
-
value--}> - -
+
+
@@ -161,9 +158,9 @@ display: inline-flex; flex-direction: column; align-items: flex-start; + padding: 0rem 0.125rem 0 0.5rem; + border: 1px solid var(--theme-divider-color); border-radius: 0.375rem; - border: 1px solid var(--theme-table-border-color); - padding: 0rem 0.5rem; input { margin: 0; @@ -181,6 +178,9 @@ width: 0; margin: 0; } + &:disabled { + color: var(--theme-darker-color); + } &.number::-webkit-outer-spin-button, &.number::-webkit-inner-spin-button { diff --git a/packages/ui/src/components/TimeShiftPresenter.svelte b/packages/ui/src/components/TimeShiftPresenter.svelte index 9d86b59777..26a5c27730 100644 --- a/packages/ui/src/components/TimeShiftPresenter.svelte +++ b/packages/ui/src/components/TimeShiftPresenter.svelte @@ -19,17 +19,27 @@ import { DAY, HOUR, MINUTE } from '../types' export let value: number + export let exact: boolean = false let time: string = '' async function formatTime (value: number) { if (value > 0) { - if (value < HOUR) { - time = await translate(ui.string.MinutesAfter, { minutes: Math.floor(value / MINUTE) }, $themeStore.language) - } else if (value < DAY) { - time = await translate(ui.string.HoursAfter, { hours: Math.floor(value / HOUR) }, $themeStore.language) + if (exact) { + const d = Math.floor(value / DAY) + time = d ? await translate(ui.string.DaysShort, { value: d }, $themeStore.language) : '' + const h = Math.floor((value - d * DAY) / HOUR) + time += h ? ` ${await translate(ui.string.HoursShort, { value: h }, $themeStore.language)}` : '' + const m = Math.floor((value - d * DAY - h * HOUR) / MINUTE) + time += m ? ` ${await translate(ui.string.MinutesShort, { value: m }, $themeStore.language)}` : '' } else { - time = await translate(ui.string.DaysAfter, { days: Math.floor(value / DAY) }, $themeStore.language) + if (value < HOUR) { + time = await translate(ui.string.MinutesAfter, { minutes: Math.floor(value / MINUTE) }, $themeStore.language) + } else if (value < DAY) { + time = await translate(ui.string.HoursAfter, { hours: Math.floor(value / HOUR) }, $themeStore.language) + } else { + time = await translate(ui.string.DaysAfter, { days: Math.floor(value / DAY) }, $themeStore.language) + } } } else { const abs = Math.abs(value) diff --git a/packages/ui/src/components/calendar/TimeInputBox.svelte b/packages/ui/src/components/calendar/TimeInputBox.svelte index 39ae2c766f..c8533b37e9 100644 --- a/packages/ui/src/components/calendar/TimeInputBox.svelte +++ b/packages/ui/src/components/calendar/TimeInputBox.svelte @@ -142,7 +142,7 @@ selected = index === 0 ? edits[1].id : edits[index - 1].id } if (ev.code === 'ArrowRight' && edits[index].el) { - selected = index === 4 ? edits[0].id : edits[index + 1].id + selected = index === 1 ? edits[0].id : edits[index + 1].id } if (ev.code === 'Tab') { if (ed === 'min') dispatch('save') diff --git a/packages/ui/src/components/icons/Close.svelte b/packages/ui/src/components/icons/Close.svelte index 3d1b11bb98..30ae93d76f 100644 --- a/packages/ui/src/components/icons/Close.svelte +++ b/packages/ui/src/components/icons/Close.svelte @@ -3,8 +3,8 @@ export let fill: string = 'currentColor' - + diff --git a/packages/ui/src/components/icons/MoreH.svelte b/packages/ui/src/components/icons/MoreH.svelte index 01463d628d..98f32623c1 100644 --- a/packages/ui/src/components/icons/MoreH.svelte +++ b/packages/ui/src/components/icons/MoreH.svelte @@ -3,8 +3,14 @@ const fill: string = 'currentColor' - - - - + + + + diff --git a/packages/ui/src/components/icons/MoreV.svelte b/packages/ui/src/components/icons/MoreV.svelte index a32c6bbffc..c963ec166e 100644 --- a/packages/ui/src/components/icons/MoreV.svelte +++ b/packages/ui/src/components/icons/MoreV.svelte @@ -3,8 +3,14 @@ const fill: string = 'currentColor' - - - - + + + + diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index 1f7eabd42a..46b5de84ca 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -34,6 +34,9 @@ export const uis = plugin(uiId, { Days: '' as IntlString, Months: '' as IntlString, Years: '' as IntlString, + MinutesShort: '' as IntlString, + HoursShort: '' as IntlString, + DaysShort: '' as IntlString, ShowMore: '' as IntlString, ShowLess: '' as IntlString, Search: '' as IntlString, diff --git a/packages/ui/src/types.ts b/packages/ui/src/types.ts index 7ff0bc7636..d52ec3993f 100644 --- a/packages/ui/src/types.ts +++ b/packages/ui/src/types.ts @@ -139,17 +139,28 @@ export type ButtonKind = | 'list' | 'list-header' | 'contrast' + | 'stepper' export type ButtonSize = 'inline' | 'x-small' | 'small' | 'medium' | 'large' | 'x-large' export type ButtonShape = | 'rectangle' | 'rectangle-left' | 'rectangle-right' | 'circle' + | 'round-sm' | 'round' | 'round2' | 'filter' | undefined -export type EditStyle = 'editbox' | 'large-style' | 'small-style' | 'search-style' | 'underline' +export type EditStyle = + | 'editbox' + | 'large-style' + | 'small-style' + | 'search-style' + | 'underline' + | 'default' + | 'ghost' + | 'default-large' + | 'ghost-large' export interface PopupPositionElement { getBoundingClientRect: () => DOMRect position?: { diff --git a/plugins/calendar-assets/assets/icons.svg b/plugins/calendar-assets/assets/icons.svg index 4be7670c90..4d82c9e473 100644 --- a/plugins/calendar-assets/assets/icons.svg +++ b/plugins/calendar-assets/assets/icons.svg @@ -19,22 +19,22 @@ - - - - + + + + - - - - - + + + + + - - - + + + - - + + diff --git a/plugins/calendar-assets/lang/en.json b/plugins/calendar-assets/lang/en.json index 4837498170..580cc303be 100644 --- a/plugins/calendar-assets/lang/en.json +++ b/plugins/calendar-assets/lang/en.json @@ -76,6 +76,8 @@ "AddParticipants": "Add participants", "Sync": "Synchronization", "Busy": "Busy", - "AddReminder": "Add reminder" + "AddReminder": "Add reminder", + "SeeAllNumberParticipants": "{value, plural, other {See all # participants}}", + "SeeAllNumberReminders": "{value, plural, other {See all # reminders}}" } } \ No newline at end of file diff --git a/plugins/calendar-assets/lang/ru.json b/plugins/calendar-assets/lang/ru.json index 1ff2a93f27..2a9d85c755 100644 --- a/plugins/calendar-assets/lang/ru.json +++ b/plugins/calendar-assets/lang/ru.json @@ -76,6 +76,8 @@ "AddParticipants": "Добавить участников", "Sync": "Синхронизация", "Busy": "Занято", - "AddReminder": "Добавить напоминание" + "AddReminder": "Добавить напоминание", + "SeeAllNumberParticipants": "{value, plural, other {Увидеть всех # участников}}", + "SeeAllNumberReminders": "{value, plural, other {Просмотреть все # напоминаний}}" } } \ No newline at end of file diff --git a/plugins/calendar-resources/src/components/AddParticipant.svelte b/plugins/calendar-resources/src/components/AddParticipant.svelte index 7c863e3b6d..49e9c094c1 100644 --- a/plugins/calendar-resources/src/components/AddParticipant.svelte +++ b/plugins/calendar-resources/src/components/AddParticipant.svelte @@ -33,6 +33,7 @@ export let focusable: boolean = false export let disabled: boolean = false export let excluded: Ref[] = [] + export let fullSize: boolean = false const dispatch = createEventDispatcher() @@ -163,7 +164,8 @@
{ input.focus() @@ -181,7 +183,7 @@ }} >
-
+
- - diff --git a/plugins/calendar-resources/src/components/CreateEvent.svelte b/plugins/calendar-resources/src/components/CreateEvent.svelte index 96ef2d70d7..85cc824a77 100644 --- a/plugins/calendar-resources/src/components/CreateEvent.svelte +++ b/plugins/calendar-resources/src/components/CreateEvent.svelte @@ -17,15 +17,15 @@ import { Person, PersonAccount } from '@hcengineering/contact' import { Class, Doc, Ref, getCurrentAccount } from '@hcengineering/core' import presentation, { getClient } from '@hcengineering/presentation' - import { Button, CheckBox, EditBox, Icon, IconClose, Label, showPopup } from '@hcengineering/ui' + import { Button, EditBox, Icon, IconClose, showPopup, IconMoreH } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import calendar from '../plugin' import { saveUTC } from '../utils' import EventParticipants from './EventParticipants.svelte' import EventTimeEditor from './EventTimeEditor.svelte' - import RRulePresenter from './RRulePresenter.svelte' import ReccurancePopup from './ReccurancePopup.svelte' import EventReminders from './EventReminders.svelte' + import EventTimeExtraButton from './EventTimeExtraButton.svelte' export let attachedTo: Ref = calendar.ids.NoAttached export let attachedToClass: Ref> = calendar.class.Event @@ -36,6 +36,7 @@ const now = new Date() const defaultDuration = 60 * 60 * 1000 const allDayDuration = 24 * 60 * 60 * 1000 - 1 + // const offsetTZ = new Date().getTimezoneOffset() * 60 * 1000 let startDate = date === undefined ? now.getTime() : withTime ? date.getTime() : date.setHours(now.getHours(), now.getMinutes()) @@ -118,117 +119,83 @@ } -
+
- -
-
- -
- {#if !allDay && rules.length === 0} -
-
(allDay = true)}> -
-
-
-
-
-
- {:else} -
-
- -
-
- -
-
- - {#if rules.length > 0} - - {:else} -
-
- {/if} +
+
-
-
+
+ + +
+
-
-
-
- - +
+
+ +
-
-
+
-
-
+
diff --git a/plugins/calendar-resources/src/components/EditEvent.svelte b/plugins/calendar-resources/src/components/EditEvent.svelte index 25dbe29beb..6d08ab340d 100644 --- a/plugins/calendar-resources/src/components/EditEvent.svelte +++ b/plugins/calendar-resources/src/components/EditEvent.svelte @@ -17,17 +17,17 @@ import { Person } from '@hcengineering/contact' import { DocumentUpdate, Ref } from '@hcengineering/core' import presentation, { getClient } from '@hcengineering/presentation' - import { Button, CheckBox, DAY, EditBox, Icon, IconClose, Label, closePopup, showPopup } from '@hcengineering/ui' + import { Button, DAY, EditBox, Icon, IconClose, IconMoreH, closePopup, showPopup } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import calendar from '../plugin' import { isReadOnly, saveUTC } from '../utils' import EventParticipants from './EventParticipants.svelte' import EventTimeEditor from './EventTimeEditor.svelte' - import RRulePresenter from './RRulePresenter.svelte' import ReccurancePopup from './ReccurancePopup.svelte' import UpdateRecInstancePopup from './UpdateRecInstancePopup.svelte' import { deepEqual } from 'fast-equals' import EventReminders from './EventReminders.svelte' + import EventTimeExtraButton from './EventTimeExtraButton.svelte' export let object: Event $: readOnly = isReadOnly(object) @@ -207,124 +207,94 @@ } -
+
- -
-
- -
- {#if !allDay && rules.length === 0} -
- -
(allDay = true)}> -
-
-
- {#if rules.length > 0} - -
-
- {/if} -
- {:else} -
-
- -
-
- -
- {#if rules.length > 0} - -
- - {#if rules.length > 0} - - {:else} -
- {/if} -
- {/if} +
+
-
-
+
+ + +
+
-
-
-
- - +
+
+ +
-
+
-
+
+{#if allParticipants.length} + + {#if needShort && !shown} + {#each shortParticipants as p, i} + { + if (p.participant) removeParticipant(p.participant) + }} + on:removeExtParticipant={() => { + if (p.externalParticipant) removeExtParticipant(p.externalParticipant) + }} + /> + {/each} + +
+
+ { + if (event.detail !== undefined) removeParticipant(event.detail) + }} + on:removeExtParticipant={(event) => { + if (event.detail !== undefined) removeExtParticipant(event.detail) + }} + /> + {:else} + {#each allParticipants as p, i} + { + if (p.participant) removeParticipant(p.participant) + }} + on:removeExtParticipant={() => { + if (p.externalParticipant) removeExtParticipant(p.externalParticipant) + }} + /> + {/each} + {/if} +
+ +{/if} diff --git a/plugins/calendar-resources/src/components/EventReminderItem.svelte b/plugins/calendar-resources/src/components/EventReminderItem.svelte new file mode 100644 index 0000000000..0c7631903b --- /dev/null +++ b/plugins/calendar-resources/src/components/EventReminderItem.svelte @@ -0,0 +1,47 @@ + + + + +
+ +
+
+
diff --git a/plugins/calendar-resources/src/components/EventReminders.svelte b/plugins/calendar-resources/src/components/EventReminders.svelte index 684819b867..f09aea568d 100644 --- a/plugins/calendar-resources/src/components/EventReminders.svelte +++ b/plugins/calendar-resources/src/components/EventReminders.svelte @@ -13,14 +13,20 @@ // limitations under the License. --> -
+
- +
-{#each reminders as reminder, i} -
- -
-
+ { + if (event.detail) edit(event.detail, reminders[reminders.length - 1], reminders.length - 1) + }} + on:remove={() => remove(reminders.length - 1)} /> -
-
-{/each} - - + {:else} + {#each reminders as reminder, i} + { + if (event.detail) edit(event.detail, reminder, i) + }} + on:remove={() => remove(i)} + /> + {/each} + {/if} +
+ +{/if} diff --git a/plugins/calendar-resources/src/components/EventTimeEditor.svelte b/plugins/calendar-resources/src/components/EventTimeEditor.svelte index ce58f03392..1a85a4cd4a 100644 --- a/plugins/calendar-resources/src/components/EventTimeEditor.svelte +++ b/plugins/calendar-resources/src/components/EventTimeEditor.svelte @@ -43,26 +43,27 @@ } -
- - {#if sameDate} - -
- -
- - {:else} - -
- -
- - {/if} +
+
+ +
+ +
+ +
+
diff --git a/plugins/calendar-resources/src/components/EventTimeExtraButton.svelte b/plugins/calendar-resources/src/components/EventTimeExtraButton.svelte new file mode 100644 index 0000000000..662218775e --- /dev/null +++ b/plugins/calendar-resources/src/components/EventTimeExtraButton.svelte @@ -0,0 +1,91 @@ + + + +{#if !allDay && rules.length === 0} +
+ +
(allDay = true)}> +
+
+
+ {#if !noRepeat} + +
dispatch('repeat')}> +
+ {/if} +
+{:else} +
+ dispatch('allday')} /> +
+
+ + +
+ {#if !noRepeat} +
+ + +
+ {/if} +{/if} diff --git a/plugins/calendar-resources/src/components/ParticipantsPopup.svelte b/plugins/calendar-resources/src/components/ParticipantsPopup.svelte index 459d70a6cb..8ed35e0300 100644 --- a/plugins/calendar-resources/src/components/ParticipantsPopup.svelte +++ b/plugins/calendar-resources/src/components/ParticipantsPopup.svelte @@ -57,18 +57,20 @@ } -
+
+
- + {@const doc = participants[item]} -
select(doc)}> +
select(doc)}>
+
diff --git a/plugins/calendar-resources/src/components/RRulePresenter.svelte b/plugins/calendar-resources/src/components/RRulePresenter.svelte index b79991b3fb..1701db5837 100644 --- a/plugins/calendar-resources/src/components/RRulePresenter.svelte +++ b/plugins/calendar-resources/src/components/RRulePresenter.svelte @@ -56,14 +56,14 @@