Skip to content

Commit

Permalink
switch to individual imports for @nextcloud/vue
Browse files Browse the repository at this point in the history
Signed-off-by: dartcafe <github@dartcafe.de>
  • Loading branch information
dartcafe committed Oct 7, 2024
1 parent bab0d07 commit 3e5705d
Show file tree
Hide file tree
Showing 80 changed files with 154 additions and 105 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted } from 'vue'
import { NcContent } from '@nextcloud/vue'
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import '@nextcloud/dialogs/style.css'
import './assets/scss/colors.scss'
Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionChangeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

<script setup lang="ts">
import { computed } from 'vue'
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { emit } from '@nextcloud/event-bus'
import ListViewIcon from 'vue-material-design-icons/ViewListOutline.vue' // view-sequential-outline
import TableViewIcon from 'vue-material-design-icons/Table.vue' // view-comfy-outline
import { t } from '@nextcloud/l10n'
import { usePollStore, PollType, } from '../../../stores/poll.ts'
import { usePreferencesStore, ViewMode } from '../../../stores/preferences.ts'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'

const pollStore = usePollStore()
const preferencesStore = usePreferencesStore()
Expand Down
4 changes: 2 additions & 2 deletions src/components/Actions/modules/ActionDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import { ref, computed } from 'vue'
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
import RestoreIcon from 'vue-material-design-icons/Recycle.vue'
import LockIcon from 'vue-material-design-icons/Lock.vue'
Expand Down Expand Up @@ -97,7 +97,7 @@
<template>
<div class="">
<NcButton :name="computedTitle"
type="tertiary"
:type="ButtonType.Tertiary"
:aria-label="computedTitle">
<template #icon>
<RestoreIcon v-if="restore"
Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionDeleteOrphanedVotes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
-->

<script setup lang="ts">
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { t } from '@nextcloud/l10n'
import { useVotesStore } from '../../../stores/votes.ts'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js';

const votesStore = useVotesStore()
const caption = t('polls', 'Delete orphaned')
Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionOpenOptionsSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
-->

<script setup lang="ts">
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { emit } from '@nextcloud/event-bus'
import { t } from '@nextcloud/l10n'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js';

const caption = t('polls', 'Add some!')

Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionOpenSharesSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
-->

<script setup lang="ts">
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { emit } from '@nextcloud/event-bus'
import { t } from '@nextcloud/l10n'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js';

const caption = t('polls', 'Edit access')

Expand Down
6 changes: 4 additions & 2 deletions src/components/Actions/modules/ActionRegister.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
-->

<script setup lang="ts">
// '@nextcloud/vue/dist/Components/.js'
// /dist/Components/.js
import { ref } from 'vue'
import { NcModal, NcButton } from '@nextcloud/vue'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import PublicRegisterModal from '../../Public/PublicRegisterModal.vue'
import { t } from '@nextcloud/l10n'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js';

const caption = t('polls', 'Register')
const showRegistration = ref(false)
Expand Down
4 changes: 2 additions & 2 deletions src/components/Actions/modules/ActionSendConfirmed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<script setup lang="ts">
import { useRoute } from 'vue-router'
import { ref } from 'vue'
import { NcButton, NcModal } from '@nextcloud/vue'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import EmailCheckIcon from 'vue-material-design-icons/EmailCheck.vue' // view-comfy-outline
import { PollsAPI } from '../../../Api/index.js'
import { Logger } from '../../../helpers/index.ts'
import { t, n } from '@nextcloud/l10n'
import { StatusResults } from '../../../Types/index.ts'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'

const route = useRoute()
const showModal = ref(false)
Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionSortOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

<script setup lang="ts">
import { computed } from 'vue'
import { NcButton } from '@nextcloud/vue'
import SortByOriginalOrderIcon from 'vue-material-design-icons/FormatListBulletedSquare.vue'
import SortByRankIcon from 'vue-material-design-icons/FormatListNumbered.vue'
import SortByDateOptionIcon from 'vue-material-design-icons/SortClockAscendingOutline.vue'
import { t } from '@nextcloud/l10n'
import { useOptionsStore } from '../../../stores/options.ts'
import { usePollStore, PollType } from '../../../stores/poll.ts'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'

const pollStore = usePollStore()
const optionsStore = useOptionsStore()
Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionSwitchSafeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
-->

<script setup lang="ts">
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../../stores/poll.ts'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js';

const pollStore = usePollStore()
const caption = t('polls', 'Reveal them')
Expand Down
3 changes: 1 addition & 2 deletions src/components/Actions/modules/ActionToggleSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
-->

<script setup lang="ts">
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { emit } from '@nextcloud/event-bus'
import SidebarIcon from 'vue-material-design-icons/TextAccount.vue' // view-comfy-outline
import { t } from '@nextcloud/l10n'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js';

const caption = t('polls', 'Toggle Sidebar')
function clickAction() {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Activity/ActivityItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<script setup lang="ts">
import { computed } from 'vue'
import moment from '@nextcloud/moment'
import { NcUserBubble, NcRichText } from '@nextcloud/vue'
import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js'
import NcRichText from '@nextcloud/vue/dist/Components/NcRichText.js'
import { GuestBubble, SimpleLink } from '../../helpers/index.ts'

const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/modules/CardDiv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { NcNoteCard } from '@nextcloud/vue'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/modules/RadioGroupDiv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import { computed, PropType } from 'vue'
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'

export type CheckboxOption = {
value: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/CalendarPeek.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { computed, onMounted, ref, PropType } from 'vue'
import orderBy from 'lodash/orderBy'
import { NcPopover } from '@nextcloud/vue'
import NcPopover from '@nextcloud/vue/dist/Components/NcPopover.js'
import moment from '@nextcloud/moment'
import CalendarInfo from './CalendarInfo.vue'
import { CalendarAPI } from '../../Api/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Configuration/ConfigAllowComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../stores/poll.ts'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Configuration/ConfigAllowMayBe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../stores/poll.ts'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Configuration/ConfigAnonymous.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../stores/poll.ts'

Expand Down
6 changes: 5 additions & 1 deletion src/components/Configuration/ConfigAutoReminder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
-->

<script setup lang="ts">
import { NcActions, NcActionButton, NcPopover, NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcPopover from '@nextcloud/vue/dist/Components/NcPopover.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'

import InformationIcon from 'vue-material-design-icons/InformationVariant.vue'
import AutoReminderInformation from './AutoReminderInformation.vue'
import { t } from '@nextcloud/l10n'
Expand Down
4 changes: 3 additions & 1 deletion src/components/Configuration/ConfigClosing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<script setup lang="ts">
import { computed } from 'vue'
import moment from '@nextcloud/moment'
import { NcButton, NcDateTimePicker, NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcDateTimePicker from '@nextcloud/vue/dist/Components/NcDateTimePicker.js'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import OpenPollIcon from 'vue-material-design-icons/LockOpenVariant.vue'
import ClosePollIcon from 'vue-material-design-icons/Lock.vue'
import { t } from '@nextcloud/l10n'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Configuration/ConfigOptionLimit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import { computed } from 'vue'
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { InputDiv } from '../Base/index.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../stores/poll.ts'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Configuration/ConfigProposals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<script setup lang="ts">
import { computed } from 'vue'
import moment from '@nextcloud/moment'
import { NcCheckboxRadioSwitch, NcDateTimePicker } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcDateTimePicker from '@nextcloud/vue/dist/Components/NcDateTimePicker.js'
import { t } from '@nextcloud/l10n'
import { usePollStore, AllowProposals } from '../../stores/poll.ts'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Configuration/ConfigUseNo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../stores/poll.ts'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Configuration/ConfigVoteLimit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import { computed } from 'vue'
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { InputDiv } from '../Base/index.js'
import { t } from '@nextcloud/l10n'
import { usePollStore } from '../../stores/poll.ts'
Expand Down
4 changes: 2 additions & 2 deletions src/components/Create/CreateDlg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { showSuccess, showError } from '@nextcloud/dialogs'
import { NcButton } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { ConfigBox, RadioGroupDiv, InputDiv } from '../Base/index.js'
import SpeakerIcon from 'vue-material-design-icons/Bullhorn.vue'
import CheckIcon from 'vue-material-design-icons/Check.vue'
Expand Down Expand Up @@ -74,7 +74,7 @@
</template>
</NcButton>
<NcButton :disabled="titleEmpty"
type="primary"
:type="ButtonType.Primary"
@click="confirm">
<template #default>
{{ t('polls', 'Apply') }}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Export/ExportPoll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import { saveAs } from 'file-saver'
import DOMPurify from 'dompurify'
import { t } from '@nextcloud/l10n'
import { NcActions, NcActionButton } from '@nextcloud/vue'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import { showError } from '@nextcloud/dialogs'

import { usePollStore, PollType } from '../../stores/poll.ts'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Navigation/PollNavigationItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

<script setup lang="ts">
import { PropType } from 'vue'
import { NcActionButton, NcAppNavigationItem } from '@nextcloud/vue'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js'
import { t } from '@nextcloud/l10n'

import { useSessionStore } from '../../stores/session.ts'
Expand Down
4 changes: 2 additions & 2 deletions src/components/Options/OptionCloneDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<script setup lang="ts">
import { computed, ref, PropType } from 'vue'
import moment from '@nextcloud/moment'
import { NcButton, NcSelect } from '@nextcloud/vue'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import { InputDiv } from '../Base/index.js'
import { t } from '@nextcloud/l10n'
import { useOptionsStore, Option, Sequence } from '../../stores/options.ts'
import { dateUnits, DateUnitValue } from '../../constants/dateUnits.ts'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'

const optionsStore = useOptionsStore()

Expand Down
5 changes: 4 additions & 1 deletion src/components/Options/OptionsDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

<script setup lang="ts">
import { ref } from 'vue'
import { NcActions, NcActionButton, NcEmptyContent, NcModal } from '@nextcloud/vue'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import { t } from '@nextcloud/l10n'

import OptionCloneDate from './OptionCloneDate.vue'
Expand Down
7 changes: 4 additions & 3 deletions src/components/Options/OptionsDateAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import { showError, showSuccess } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import { NcButton, NcCheckboxRadioSwitch, NcDateTimePicker } from '@nextcloud/vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import NcDateTimePicker from '@nextcloud/vue/dist/Components/NcDateTimePicker.js'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'

import { useOptionsStore } from '../../stores/options.ts'

import { FlexSpacer } from '../Base/index.js'
import AddDateIcon from 'vue-material-design-icons/CalendarPlus.vue'
import CheckIcon from 'vue-material-design-icons/Check.vue'
import { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'

const optionsStore = useOptionsStore()
const props = defineProps({
Expand Down Expand Up @@ -283,7 +284,7 @@
{{ dateOption.text }}
</div>
<FlexSpacer />
<NcButton v-if="dateOption.option.duration >= 0 && !added" type="primary" @click="addOption">
<NcButton v-if="dateOption.option.duration >= 0 && !added" :type="ButtonType.Primary" @click="addOption">
{{ t('polls', 'Add') }}
</NcButton>
<CheckIcon v-if="added"
Expand Down
5 changes: 3 additions & 2 deletions src/components/Options/OptionsDateShift.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<script setup lang="ts">
import { ref } from 'vue'
import { t } from '@nextcloud/l10n'
import { NcButton, NcSelect } from '@nextcloud/vue'
import NcButton, { ButtonType } from '@nextcloud/vue/dist/Components/NcButton.js'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'

import { InputDiv } from '../Base/index.js'
import { dateUnits, DateUnitValue } from '../../constants/dateUnits.ts'
Expand Down Expand Up @@ -42,7 +43,7 @@
label="name" />
<NcButton class="submit"
:aria-label="t('polls', 'Submit')"
type="tertiary"
:type="ButtonType.Tertiary"
@click="shiftDates(shift)">
<template #icon>
<SubmitIcon />
Expand Down
4 changes: 3 additions & 1 deletion src/components/Options/OptionsText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

<script setup lang="ts">
import { t } from '@nextcloud/l10n'
import { NcActions, NcActionButton, NcEmptyContent } from '@nextcloud/vue'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import { Sortable } from "sortablejs-vue3"

import OptionItem from './OptionItem.vue'
Expand Down
Loading

0 comments on commit 3e5705d

Please sign in to comment.