Browse Source

Merge branch 'develop' into refactor/webhooks

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
aeeeee06d5
  1. 2
      packages/nc-gui/components.d.ts
  2. 12
      packages/nc-gui/components/dashboard/TreeView.vue
  3. 47
      packages/nc-gui/components/general/EmojiIcons.vue
  4. 6
      packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue
  5. 1668
      packages/nc-gui/utils/iconUtils.ts

2
packages/nc-gui/components.d.ts vendored

@ -227,6 +227,7 @@ declare module '@vue/runtime-core' {
MdiReddit: typeof import('~icons/mdi/reddit')['default'] MdiReddit: typeof import('~icons/mdi/reddit')['default']
MdiRefresh: typeof import('~icons/mdi/refresh')['default'] MdiRefresh: typeof import('~icons/mdi/refresh')['default']
MdiReload: typeof import('~icons/mdi/reload')['default'] MdiReload: typeof import('~icons/mdi/reload')['default']
MdiReset: typeof import('~icons/mdi/reset')['default']
MdiRocketLaunchOutline: typeof import('~icons/mdi/rocket-launch-outline')['default'] MdiRocketLaunchOutline: typeof import('~icons/mdi/rocket-launch-outline')['default']
MdiScriptTextKeyOutline: typeof import('~icons/mdi/script-text-key-outline')['default'] MdiScriptTextKeyOutline: typeof import('~icons/mdi/script-text-key-outline')['default']
MdiScriptTextOutline: typeof import('~icons/mdi/script-text-outline')['default'] MdiScriptTextOutline: typeof import('~icons/mdi/script-text-outline')['default']
@ -288,6 +289,7 @@ declare module '@vue/runtime-core' {
PhTranslateThin: typeof import('~icons/ph/translate-thin')['default'] PhTranslateThin: typeof import('~icons/ph/translate-thin')['default']
PhUserPlusThin: typeof import('~icons/ph/user-plus-thin')['default'] PhUserPlusThin: typeof import('~icons/ph/user-plus-thin')['default']
PhUsersThreeThin: typeof import('~icons/ph/users-three-thin')['default'] PhUsersThreeThin: typeof import('~icons/ph/users-three-thin')['default']
PhXCircleLight: typeof import('~icons/ph/x-circle-light')['default']
RiLineHeight: typeof import('~icons/ri/line-height')['default'] RiLineHeight: typeof import('~icons/ri/line-height')['default']
RiTeamFill: typeof import('~icons/ri/team-fill')['default'] RiTeamFill: typeof import('~icons/ri/team-fill')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']

12
packages/nc-gui/components/dashboard/TreeView.vue

@ -654,7 +654,11 @@ const setIcon = async (icon: string, table: TableType) => {
</component> </component>
</div> </div>
<template v-if="isUIAllowed('tableIconCustomisation')" #overlay> <template v-if="isUIAllowed('tableIconCustomisation')" #overlay>
<GeneralEmojiIcons class="shadow bg-white p-2" @select-icon="setIcon($event, table)" /> <GeneralEmojiIcons
class="shadow bg-white p-2"
:show-reset="!!table.meta?.icon"
@select-icon="setIcon($event, table)"
/>
</template> </template>
</component> </component>
</div> </div>
@ -964,7 +968,11 @@ const setIcon = async (icon: string, table: TableType) => {
</component> </component>
</div> </div>
<template v-if="isUIAllowed('tableIconCustomisation')" #overlay> <template v-if="isUIAllowed('tableIconCustomisation')" #overlay>
<GeneralEmojiIcons class="shadow bg-white p-2" @select-icon="setIcon($event, table)" /> <GeneralEmojiIcons
class="shadow bg-white p-2"
:show-reset="!!table.meta?.icon"
@select-icon="setIcon($event, table)"
/>
</template> </template>
</component> </component>
</div> </div>

47
packages/nc-gui/components/general/EmojiIcons.vue

@ -3,6 +3,10 @@ import { Icon } from '@iconify/vue'
import InfiniteLoading from 'v3-infinite-loading' import InfiniteLoading from 'v3-infinite-loading'
import { emojiIcons } from '#imports' import { emojiIcons } from '#imports'
const props = defineProps<{
showReset?: boolean
}>()
const emit = defineEmits(['selectIcon']) const emit = defineEmits(['selectIcon'])
let search = $ref('') let search = $ref('')
@ -23,30 +27,39 @@ const load = () => {
} }
} }
const selectIcon = (icon: string) => { const selectIcon = (icon?: string) => {
search = '' search = ''
emit('selectIcon', `emojione:${icon}`) emit('selectIcon', icon && `emojione:${icon}`)
} }
</script> </script>
<template> <template>
<div class="p-1 w-[280px] h-[280px] flex flex-col gap-1 justify-start nc-emoji" data-testid="nc-emoji-container"> <div>
<div @click.stop> <div class="p-1 w-[280px] h-[280px] flex flex-col gap-1 justify-start nc-emoji" data-testid="nc-emoji-container">
<input <div @click.stop>
v-model="search" <input
data-testid="nc-emoji-filter" v-model="search"
class="p-1 text-xs border-1 w-full overflow-y-auto" data-testid="nc-emoji-filter"
placeholder="Search" class="p-1 text-xs border-1 w-full overflow-y-auto"
@input="toIndex = 60" placeholder="Search"
/> @input="toIndex = 60"
/>
</div>
<div class="flex gap-1 flex-wrap w-full flex-shrink overflow-y-auto scrollbar-thin-dull">
<div v-for="icon of filteredIcons" :key="icon" @click="selectIcon(icon)">
<span class="cursor-pointer nc-emoji-item">
<Icon class="text-xl iconify" :icon="`emojione:${icon}`"></Icon>
</span>
</div>
<InfiniteLoading @infinite="load"><span /></InfiniteLoading>
</div>
</div> </div>
<div class="flex gap-1 flex-wrap w-full flex-shrink overflow-y-auto scrollbar-thin-dull"> <div v-if="props.showReset" class="m-1">
<div v-for="icon of filteredIcons" :key="icon" @click="selectIcon(icon)"> <a-divider class="!my-2 w-full" />
<span class="cursor-pointer nc-emoji-item"> <div class="p-1 mt-1 cursor-pointer text-xs inline-block border-gray-200 border-1 rounded" @click="selectIcon()">
<Icon class="text-xl iconify" :icon="`emojione:${icon}`"></Icon> <PhXCircleLight class="text-sm" />
</span> Reset Icon
</div> </div>
<InfiniteLoading @infinite="load"><span /></InfiniteLoading>
</div> </div>
</div> </div>
</template> </template>

6
packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue

@ -183,7 +183,11 @@ function onStopEdit() {
</component> </component>
<template v-if="isUIAllowed('viewIconCustomisation')" #overlay> <template v-if="isUIAllowed('viewIconCustomisation')" #overlay>
<GeneralEmojiIcons class="shadow bg-white p-2" @select-icon="emits('selectIcon', $event)" /> <GeneralEmojiIcons
class="shadow bg-white p-2"
:show-reset="!!view.meta?.icon"
@select-icon="emits('selectIcon', $event)"
/>
</template> </template>
</a-dropdown> </a-dropdown>
</div> </div>

1668
packages/nc-gui/utils/iconUtils.ts

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save