Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions POS/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ declare module 'vue' {
PartialPayments: typeof import('./src/components/partials/PartialPayments.vue')['default']
PaymentDialog: typeof import('./src/components/sale/PaymentDialog.vue')['default']
PhoneInput: typeof import('./src/components/common/PhoneInput.vue')['default']
POSDialog: typeof import('./src/components/common/POSDialog.vue')['default']
POSFooter: typeof import('./src/components/common/POSFooter.vue')['default']
POSHeader: typeof import('./src/components/pos/POSHeader.vue')['default']
POSSettings: typeof import('./src/components/settings/POSSettings.vue')['default']
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/ShiftClosingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@
</template>

<script setup>
import { Button, Dialog, FeatherIcon, Input } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, FeatherIcon, Input } from "frappe-ui"
import { computed, onBeforeUnmount, reactive, ref, watch } from "vue"
import { storeToRefs } from "pinia"
import { useShift, shiftState } from "../composables/useShift"
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/ShiftOpeningDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@
</template>

<script setup>
import { Button, Dialog, Input } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, Input } from "frappe-ui"
import { createResource } from "frappe-ui"
import { computed, ref, watch } from "vue"
import { useShift } from "../composables/useShift"
Expand Down
47 changes: 47 additions & 0 deletions POS/src/components/common/POSDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<Dialog v-bind="$attrs">
<template v-if="$slots.body" #body>
<div class="pos-dialog-interactive-area" @pointerdown.stop @dragstart.prevent>
<slot name="body" />
</div>
</template>

<template v-if="$slots['body-title']" #body-title>
<slot name="body-title" />
</template>

<template v-if="$slots['body-content']" #body-content>
<div class="pos-dialog-interactive-area" @pointerdown.stop @dragstart.prevent>
<slot name="body-content" />
</div>
</template>

<template v-if="$slots.actions" #actions="slotProps">
<div class="pos-dialog-interactive-area" @pointerdown.stop @dragstart.prevent>
<slot name="actions" v-bind="slotProps" />
</div>
</template>
</Dialog>
</template>

<script setup>
import { Dialog } from "frappe-ui"

defineOptions({
inheritAttrs: false,
})
</script>

<style scoped>
.pos-dialog-interactive-area {
-webkit-user-select: none;
user-select: none;
}

.pos-dialog-interactive-area :deep(input),
.pos-dialog-interactive-area :deep(textarea),
.pos-dialog-interactive-area :deep([contenteditable="true"]) {
-webkit-user-select: text;
user-select: text;
}
</style>
4 changes: 2 additions & 2 deletions POS/src/components/invoices/InvoiceDetailDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ import { DEFAULT_CURRENCY, formatCurrency as formatCurrencyUtil } from "@/utils/
import { getInvoiceStatusColor } from "@/utils/invoice"
import { logger } from "@/utils/logger"
import { hydrateLocalOnlyInvoice, isLocalOnlyInvoiceName } from "@/utils/printInvoice"
import { Button, Dialog, call } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, call } from "frappe-ui"
import { ref, watch, nextTick, computed } from "vue"

const log = logger.create('InvoiceDetailDialog')
Expand Down Expand Up @@ -411,4 +412,3 @@ function handlePrint() {
emit("print-invoice", invoiceData.value)
}
</script>

3 changes: 2 additions & 1 deletion POS/src/components/sale/BatchSerialDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
</template>

<script setup>
import { Button, Dialog, createResource } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, createResource } from "frappe-ui"
import { computed, ref, watch } from "vue"
import { useSerialNumberStore } from "@/stores/serialNumber"
import { usePOSCartStore } from "@/stores/posCart"
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/CouponDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@

<script setup>
import { DEFAULT_CURRENCY, formatCurrency as formatCurrencyUtil } from "@/utils/currency"
import { Button, Dialog, Input, createResource } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, Input, createResource } from "frappe-ui"
import { ref, watch } from "vue"
import { useInvoice } from "@/composables/useInvoice"
import { useToast } from "@/composables/useToast"
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/CreateCustomerDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ import { usePOSPermissions } from "@/composables/usePermissions"
import { useToast } from "@/composables/useToast"
import { useCountriesStore } from "@/stores/countries"
import { logger } from "@/utils/logger"
import { Button, Dialog, Input, createResource } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, Input, createResource } from "frappe-ui"
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue"

const log = logger.create("CreateCustomerDialog")
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/CustomerDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@

<script setup>
import { useCustomerSearchStore } from "@/stores/customerSearch"
import { Button, Dialog } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button } from "frappe-ui"
import { storeToRefs } from "pinia"
import { computed, onMounted, ref, watch } from "vue"
import CreateCustomerDialog from "./CreateCustomerDialog.vue"
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/DraftInvoicesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ import { clearAllDrafts, deleteDraft, getAllDrafts } from "@/utils/draftManager"
import { printInvoiceCustom } from "@/utils/printInvoice"
import { useToast } from "@/composables/useToast"
import { usePOSShiftStore } from "@/stores/posShift"
import { Button, Dialog } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button } from "frappe-ui"
import { onMounted, ref, watch } from "vue"

const { showSuccess, showError } = useToast()
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/InvoiceHistoryDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
import { useToast } from "@/composables/useToast"
import { DEFAULT_CURRENCY, DEFAULT_LOCALE, formatCurrency as formatCurrencyUtil } from "@/utils/currency"
import { getInvoiceStatusColor } from "@/utils/invoice"
import { Button, Dialog, Input, createResource } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, Input, createResource } from "frappe-ui"
import { computed, ref, watch } from "vue"
import ReturnInvoiceDialog from "./ReturnInvoiceDialog.vue"

Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/ItemSelectionDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@

<script setup>
import { DEFAULT_CURRENCY, formatCurrency as formatCurrencyUtil } from "@/utils/currency"
import { Button, Dialog } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button } from "frappe-ui"
import { createResource } from "frappe-ui"
import { computed, nextTick, ref, watch } from "vue"
import TranslatedHTML from "../common/TranslatedHTML.vue"
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/OffersDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
<script setup>
import { usePOSOffersStore } from "@/stores/posOffers"
import { DEFAULT_CURRENCY, DEFAULT_LOCALE, formatCurrency as formatCurrencyUtil } from "@/utils/currency"
import { Button, Dialog } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button } from "frappe-ui"
import { computed, ref, watch } from "vue"

// Use Pinia stores
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/OfflineInvoicesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@

<script setup>
import { DEFAULT_CURRENCY, formatCurrency as formatCurrencyUtil } from "@/utils/currency"
import { Button, Dialog } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button } from "frappe-ui"
import { computed, ref, watch } from "vue"

const props = defineProps({
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/PaymentDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,8 @@ import {
import { getPaymentIcon } from "@/utils/payment"
import { offlineWorker } from "@/utils/offline/workerClient"
import { logger } from "@/utils/logger"
import { Dialog, createResource, call } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { createResource, call } from "frappe-ui"
import { computed, ref, watch, nextTick } from "vue"
import { useToast } from "@/composables/useToast"
import { useLongPress } from "@/composables/useLongPress"
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/ReturnInvoiceDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,8 @@ import {
roundCurrency,
} from "@/utils/currency"
import { getInvoiceStatusColor } from "@/utils/invoice"
import { Button, Dialog, FeatherIcon, createResource } from "frappe-ui"
import Dialog from "@/components/common/POSDialog.vue"
import { Button, FeatherIcon, createResource } from "frappe-ui"
import { computed, onMounted, onUnmounted, reactive, ref, watch } from "vue"

const { showSuccess, showError, showWarning } = useToast()
Expand Down
3 changes: 2 additions & 1 deletion POS/src/components/sale/WarehouseAvailabilityDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@
* Translations: All user-facing strings use __() for i18n
*/
import { ref, computed, watch, nextTick } from 'vue'
import { call, Dialog } from 'frappe-ui'
import Dialog from "@/components/common/POSDialog.vue"
import { call } from 'frappe-ui'
import { __ } from '@/utils/translation'

const props = defineProps({
Expand Down
3 changes: 2 additions & 1 deletion POS/src/pages/POSSale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,8 @@ import {
} from "@/utils/printInvoice";
import { qzConnected, connect as qzConnect, disconnect as qzDisconnect } from "@/utils/qzTray";

import { Button, Dialog, createResource } from "frappe-ui";
import Dialog from "@/components/common/POSDialog.vue";
import { Button, createResource } from "frappe-ui";
import { call } from "@/utils/apiWrapper";
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
import { useToast } from "@/composables/useToast";
Expand Down