mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-24 01:07:50 +00:00
fix svelte checks for ui
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
9d24dc384e
commit
b0ade7564d
packages/ui/src
components
Button.svelteCheckBoxList.svelte.txtCheckBoxWithLabel.svelte.txtDialog.sveltePopup.sveltePopupInstance.sveltePopupItem.svelte.txtPopupMenu.svelte
index.tsinternal
plugins/chunter-resources/src/components
@ -22,7 +22,7 @@
|
||||
export let label: IntlString
|
||||
export let primary: boolean = false
|
||||
export let size: 'small' | 'medium' = 'medium'
|
||||
export let icon: Asset | AnySvelteComponent | undefined
|
||||
export let icon: Asset | AnySvelteComponent | undefined = undefined
|
||||
export let disabled: boolean = false
|
||||
export let loading: boolean = false
|
||||
export let transparent: boolean = false
|
||||
|
@ -20,7 +20,7 @@
|
||||
import Add from './icons/Add.svelte'
|
||||
|
||||
export let label: IntlString
|
||||
export let items: Array<Object>
|
||||
export let items: Array<{description: IntlString, done: boolean}>
|
||||
= [
|
||||
{ description: '15 minute phone call', done: true },
|
||||
{ description: 'Follow up email', done: false },
|
@ -29,6 +29,8 @@
|
||||
export let okAction: () => void
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
const cancel = 'Cancel' as IntlString
|
||||
</script>
|
||||
|
||||
<div class="dialog-container">
|
||||
@ -42,7 +44,7 @@
|
||||
</div>
|
||||
<div class="footer">
|
||||
<Button label={okLabel} primary />
|
||||
<Button label={'Cancel'} on:click={() => { dispatch('close') }} />
|
||||
<Button label={cancel} on:click={() => { dispatch('close') }} />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -16,19 +16,15 @@
|
||||
import { popupstore as modal } from '..'
|
||||
import PopupInstance from './PopupInstance.svelte'
|
||||
|
||||
// function close () {
|
||||
// console.log('closeX')
|
||||
// function handleKeydown (ev: KeyboardEvent) {
|
||||
// if (ev.key === 'Escape' && $modal.is) {
|
||||
// close()
|
||||
// }
|
||||
// }
|
||||
|
||||
function handleKeydown (ev: KeyboardEvent) {
|
||||
// if (ev.key === 'Escape' && $modal.is) {
|
||||
// close()
|
||||
// }
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<svelte:window on:keydown={handleKeydown} />
|
||||
<!-- <svelte:window on:keydown={handleKeydown} /> -->
|
||||
|
||||
{#each $modal as popup, i}
|
||||
<PopupInstance is={popup.is} props={popup.props} element={popup.element} onClose={popup.onClose} zIndex={(i+1) * 500}/>
|
||||
|
@ -22,7 +22,7 @@ import { closePopup } from '..'
|
||||
export let is: AnyComponent | AnySvelteComponent
|
||||
export let props: object
|
||||
export let element: PopupAlignment | undefined
|
||||
export let onClose: (result: any) => void | undefined
|
||||
export let onClose: ((result: any) => void) | undefined
|
||||
export let zIndex: number
|
||||
|
||||
let modalHTML: HTMLElement
|
||||
|
@ -66,10 +66,10 @@
|
||||
} else popup.style.left = `${rectT.left}px`
|
||||
}
|
||||
|
||||
const findNode = (el: Node, name: string): any => {
|
||||
const findNode = (el: HTMLElement, name: string): any => {
|
||||
while (el.parentNode !== null) {
|
||||
if (el.classList.contains(name)) return el
|
||||
el = el.parentNode
|
||||
el = el.parentNode as HTMLElement
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -1,3 +1,18 @@
|
||||
<!--
|
||||
// Copyright © 2020 Anticrm Platform Contributors.
|
||||
//
|
||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License. You may
|
||||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { getContext } from 'svelte'
|
||||
import FontSize from './icons/FontSize.svelte'
|
||||
@ -5,13 +20,11 @@
|
||||
const { currentFontSize, setFontSize } = getContext('fontsize')
|
||||
|
||||
const fontsizes = ['small-font', 'normal-font']
|
||||
let fsLabel = currentFontSize
|
||||
|
||||
let current = fontsizes.indexOf(currentFontSize)
|
||||
|
||||
function changeFontSize () {
|
||||
current++
|
||||
fsLabel = fontsizes[current % fontsizes.length]
|
||||
setFontSize(fontsizes[current % fontsizes.length])
|
||||
}
|
||||
</script>
|
||||
|
@ -40,15 +40,15 @@ export { default as Progress } from './components/Progress.svelte'
|
||||
export { default as Tabs } from './components/Tabs.svelte'
|
||||
export { default as ScrollBox } from './components/ScrollBox.svelte'
|
||||
export { default as PopupMenu } from './components/PopupMenu.svelte'
|
||||
export { default as PopupItem } from './components/PopupItem.svelte'
|
||||
// export { default as PopupItem } from './components/PopupItem.svelte'
|
||||
export { default as TextArea } from './components/TextArea.svelte'
|
||||
export { default as Section } from './components/Section.svelte'
|
||||
export { default as DatePicker } from './components/DatePicker.svelte'
|
||||
export { default as StylishEdit } from './components/StylishEdit.svelte'
|
||||
export { default as Grid } from './components/Grid.svelte'
|
||||
export { default as Row } from './components/Row.svelte'
|
||||
export { default as CheckBoxWithLabel } from './components/CheckBoxWithLabel.svelte'
|
||||
export { default as CheckBoxList } from './components/CheckBoxList.svelte'
|
||||
// export { default as CheckBoxWithLabel } from './components/CheckBoxWithLabel.svelte'
|
||||
// export { default as CheckBoxList } from './components/CheckBoxList.svelte.txt'
|
||||
export { default as EditWithIcon } from './components/EditWithIcon.svelte'
|
||||
export { default as Loading } from './components/Loading.svelte'
|
||||
export { default as Popup } from './components/Popup.svelte'
|
||||
@ -75,16 +75,16 @@ export function createApp (target: HTMLElement): SvelteComponent {
|
||||
}
|
||||
|
||||
interface CompAndProps {
|
||||
is: AnySvelteComponent | AnyComponent | undefined
|
||||
is: AnySvelteComponent | AnyComponent
|
||||
props: any
|
||||
element?: PopupAlignment
|
||||
onClose?: (result: any) => void
|
||||
}
|
||||
|
||||
export const store = writable<CompAndProps>({
|
||||
is: undefined,
|
||||
props: {},
|
||||
})
|
||||
// export const store = writable<CompAndProps>({
|
||||
// is: undefined,
|
||||
// props: {},
|
||||
// })
|
||||
|
||||
export const popupstore = writable<CompAndProps[]>([])
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { TextArea, EditBox, Dialog, ToggleWithLabel, Grid, Section, IconToDo, CheckBoxList } from '@anticrm/ui'
|
||||
import { TextArea, EditBox, Dialog, ToggleWithLabel, Grid, Section, IconToDo } from '@anticrm/ui'
|
||||
|
||||
import { getClient } from '@anticrm/presentation'
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
<TextArea label={chunter.string.ChannelDescription} bind:value={description}/>
|
||||
<ToggleWithLabel label={chunter.string.MakePrivate} description={chunter.string.MakePrivateDescription}/>
|
||||
</Grid>
|
||||
<Section icon={IconToDo} label={`To Do's`}>
|
||||
<!-- <Section icon={IconToDo} label={`To Do's`}>
|
||||
<CheckBoxList label={'Add a To Do'} editable />
|
||||
</Section>
|
||||
</Section> -->
|
||||
</Dialog>
|
||||
|
Loading…
Reference in New Issue
Block a user