Browse Source

feat(gui-v2): add password toggle icon

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2860/head
Pranav C 2 years ago
parent
commit
f3bea4d8d7
  1. 19
      packages/nc-gui-v2/components/smartsheet-toolbar/SharedViewList.vue

19
packages/nc-gui-v2/components/smartsheet-toolbar/SharedViewList.vue

@ -1,5 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from '#imports' import { onMounted } from '#imports'
import MdiVisibilityOnIcon from '~icons/mdi/visibility'
import MdiVisibilityOffIcon from '~icons/mdi/visibility-off'
const { view, $api, meta } = useSmartsheetStoreOrThrow() const { view, $api, meta } = useSmartsheetStoreOrThrow()
@ -48,7 +50,6 @@ const test = (t) => console.log(t)
<!-- View Link --> <!-- View Link -->
<a-table-column key="title" :title="$t('labels.viewLink')" data-index="title"> <a-table-column key="title" :title="$t('labels.viewLink')" data-index="title">
<template #default="{ record }"> <template #default="{ record }">
<div @click="test(rest)">click</div>
<!-- <nuxt-link :to="sharedViewUrl(currentView)"> <!-- <nuxt-link :to="sharedViewUrl(currentView)">
{{ `${dashboardUrl}#${sharedViewUrl(currentView)}` }} {{ `${dashboardUrl}#${sharedViewUrl(currentView)}` }}
</nuxt-link> --> </nuxt-link> -->
@ -56,15 +57,17 @@ const test = (t) => console.log(t)
</a-table-column> </a-table-column>
<!-- Password --> <!-- Password -->
<a-table-column key="password" :title="$t('labels.password')" data-index="title"> <a-table-column key="password" :title="$t('labels.password')" data-index="title">
<template #default="{ text }"> <template #default="{ text, record }">
{{ text }} <div class="flex align-center items-center gap-1">
<!-- <span>{{ currentView.showPassword ? currentView.password : '***************************' }}</span> <span class="h-min">{{ record.showPassword ? text : '***************************' }}</span>
<v-icon small @click="$set(currentView, 'showPassword', !currentView.showPassword)"> <component
{{ currentView.showPassword ? 'visibility_off' : 'visibility' }} :is="record.showPassword ? MdiVisibilityOffIcon : MdiVisibilityOnIcon"
</v-icon> --> @click="record.showPassword = !record.showPassword"
/>
</div>
</template> </template>
</a-table-column> </a-table-column>
<!-- Password --> <!-- Todo: i18n -->
<a-table-column key="meta" title="Download allowed" data-index="title"> <a-table-column key="meta" title="Download allowed" data-index="title">
<template #default="{ text }"> <template #default="{ text }">
{{ text }} {{ text }}

Loading…
Cancel
Save