@stacksjs/defaults 0.70.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +2 -0
- package/package.json +20 -0
- package/resources/assets/fonts/013717e9.woff +0 -0
- package/resources/assets/fonts/03355817.woff2 +0 -0
- package/resources/assets/fonts/0380de7e.woff2 +0 -0
- package/resources/assets/fonts/0ba5d32a.woff +0 -0
- package/resources/assets/fonts/0bd57ddf.woff2 +0 -0
- package/resources/assets/fonts/19de0a60.woff2 +0 -0
- package/resources/assets/fonts/20b87e84.woff +0 -0
- package/resources/assets/fonts/4bbc67e1.woff +0 -0
- package/resources/assets/fonts/576fb0d7.woff +0 -0
- package/resources/assets/fonts/5ea10ee5.woff2 +0 -0
- package/resources/assets/fonts/6413fc0a.woff +0 -0
- package/resources/assets/fonts/72c114cf.woff +0 -0
- package/resources/assets/fonts/73c57e73.woff2 +0 -0
- package/resources/assets/fonts/813dca6c.woff +0 -0
- package/resources/assets/fonts/8a9b0995.woff2 +0 -0
- package/resources/assets/fonts/90b4832f.woff +0 -0
- package/resources/assets/fonts/9394ab85.woff2 +0 -0
- package/resources/assets/fonts/9b3c7d7f.woff2 +0 -0
- package/resources/assets/fonts/Monaco.ttf +0 -0
- package/resources/assets/fonts/b1b36d74.woff +0 -0
- package/resources/assets/fonts/b5d74798.woff2 +0 -0
- package/resources/assets/fonts/b9f81a4d.woff +0 -0
- package/resources/assets/fonts/c9784008.woff2 +0 -0
- package/resources/assets/fonts/cf692227.woff +0 -0
- package/resources/assets/fonts/d1c6ab51.woff2 +0 -0
- package/resources/assets/fonts/e2eb62fc.woff +0 -0
- package/resources/assets/fonts/fe21f8d8.woff2 +0 -0
- package/resources/assets/fonts/nps/CampmateScript-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/NPS_2026-variable.woff2 +0 -0
- package/resources/assets/fonts/nps/RedwoodSerif-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/SequoiaSans-Regular.woff2 +0 -0
- package/resources/assets/fonts/nps/Switchback-Regular.woff2 +0 -0
- package/resources/assets/images/app-icon.png +0 -0
- package/resources/assets/images/bg-img.png +0 -0
- package/resources/assets/images/park-ridge.svg +15 -0
- package/resources/assets/images/topography.svg +1 -0
- package/resources/assets/scripts/main.ts +2153 -0
- package/resources/assets/styles/README.md +19 -0
- package/resources/assets/styles/docs/main.css +1 -0
- package/resources/assets/styles/docs/overrides.css +1 -0
- package/resources/assets/styles/docs/vars.css +8 -0
- package/resources/assets/styles/main.css +1419 -0
- package/resources/components/Button.stx +70 -0
- package/resources/components/Buttons/BaseButton.stx +39 -0
- package/resources/components/Buttons/Counter.stx +28 -0
- package/resources/components/Buttons/ToggleDark.stx +11 -0
- package/resources/components/Container.stx +10 -0
- package/resources/components/Dashboard/.gitkeep +0 -0
- package/resources/components/Dashboard/Auth/ForgotPassword.stx +127 -0
- package/resources/components/Dashboard/Auth/Login.stx +212 -0
- package/resources/components/Dashboard/Auth/Register.stx +306 -0
- package/resources/components/Dashboard/Avatar.stx +123 -0
- package/resources/components/Dashboard/Billing/ActivePlan.stx +57 -0
- package/resources/components/Dashboard/Billing/CardBrands.stx +32 -0
- package/resources/components/Dashboard/Billing/CardForm.stx +34 -0
- package/resources/components/Dashboard/Billing/OneTimePayment.stx +28 -0
- package/resources/components/Dashboard/Billing/PaymentForm.stx +33 -0
- package/resources/components/Dashboard/Billing/PaymentMethod.stx +66 -0
- package/resources/components/Dashboard/Billing/PaymentMethodList.stx +52 -0
- package/resources/components/Dashboard/Billing/Plans.stx +136 -0
- package/resources/components/Dashboard/Buttons/AppButton.stx +48 -0
- package/resources/components/Dashboard/Buttons/IconButton.stx +20 -0
- package/resources/components/Dashboard/Card.stx +78 -0
- package/resources/components/Dashboard/Chart.stx +75 -0
- package/resources/components/Dashboard/CodeEditor.stx +41 -0
- package/resources/components/Dashboard/Commerce/BulkActionBar.stx +70 -0
- package/resources/components/Dashboard/Commerce/CategoriesTable.stx +133 -0
- package/resources/components/Dashboard/Commerce/CouponsTable.stx +161 -0
- package/resources/components/Dashboard/Commerce/CustomersTable.stx +142 -0
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +80 -0
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +85 -0
- package/resources/components/Dashboard/Commerce/Delivery/DriversTable.stx +99 -0
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +92 -0
- package/resources/components/Dashboard/Commerce/Delivery/LicenseTemplatesTable.stx +88 -0
- package/resources/components/Dashboard/Commerce/Delivery/Pagination.stx +122 -0
- package/resources/components/Dashboard/Commerce/Delivery/SearchFilter.stx +23 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +80 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +59 -0
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +71 -0
- package/resources/components/Dashboard/Commerce/Delivery/TabNavigation.stx +36 -0
- package/resources/components/Dashboard/Commerce/Forms/CouponsForm.stx +191 -0
- package/resources/components/Dashboard/Commerce/OrdersTable.stx +131 -0
- package/resources/components/Dashboard/Commerce/ProductsTable.stx +170 -0
- package/resources/components/Dashboard/CreateRecordModal.stx +363 -0
- package/resources/components/Dashboard/DashboardLayout.stx +155 -0
- package/resources/components/Dashboard/Deployments/ActivityFeed.stx +54 -0
- package/resources/components/Dashboard/Deployments/DeployScript.stx +23 -0
- package/resources/components/Dashboard/Deployments/DeploymentHistory.stx +97 -0
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +94 -0
- package/resources/components/Dashboard/Deployments/LiveTerminalOutput.stx +18 -0
- package/resources/components/Dashboard/Elements/Dropdown.stx +57 -0
- package/resources/components/Dashboard/Email/EmailActivityChart.stx +111 -0
- package/resources/components/Dashboard/Email/EmailCompose.stx +72 -0
- package/resources/components/Dashboard/Email/EmailDetail.stx +105 -0
- package/resources/components/Dashboard/Email/EmailList.stx +117 -0
- package/resources/components/Dashboard/Email/EmailSearch.stx +40 -0
- package/resources/components/Dashboard/Email/EmailSidebar.stx +133 -0
- package/resources/components/Dashboard/GlobalSearch.stx +124 -0
- package/resources/components/Dashboard/MobileSidebar.stx +47 -0
- package/resources/components/Dashboard/Modals/BaseModal.stx +50 -0
- package/resources/components/Dashboard/Modals/Popups/Alert.stx +112 -0
- package/resources/components/Dashboard/Modals/Popups/Toast.stx +70 -0
- package/resources/components/Dashboard/Modals/ToastWrapper.stx +35 -0
- package/resources/components/Dashboard/Monitoring/ErrorDetailModal.stx +228 -0
- package/resources/components/Dashboard/Monitoring/ErrorsTable.stx +184 -0
- package/resources/components/Dashboard/Navbar.stx +194 -0
- package/resources/components/Dashboard/NavbarModern.stx +188 -0
- package/resources/components/Dashboard/NotificationErrorModal.stx +105 -0
- package/resources/components/Dashboard/NotificationStatusBadge.stx +20 -0
- package/resources/components/Dashboard/Pagination.stx +90 -0
- package/resources/components/Dashboard/Queue/QueueTable.stx +127 -0
- package/resources/components/Dashboard/Settings/Forms/AIForm.stx +126 -0
- package/resources/components/Dashboard/Settings/Forms/AnalyticsForm.stx +52 -0
- package/resources/components/Dashboard/Settings/Forms/AppForm.stx +157 -0
- package/resources/components/Dashboard/Settings/Forms/CLIForm.stx +66 -0
- package/resources/components/Dashboard/Settings/Forms/CacheForm.stx +253 -0
- package/resources/components/Dashboard/Settings/Forms/CloudForm.stx +441 -0
- package/resources/components/Dashboard/Settings/Forms/DNSForm.stx +307 -0
- package/resources/components/Dashboard/Settings/Forms/DatabaseForm.stx +168 -0
- package/resources/components/Dashboard/Settings/Forms/EmailForm.stx +100 -0
- package/resources/components/Dashboard/Settings/Forms/FileSystemForm.stx +259 -0
- package/resources/components/Dashboard/Settings/Forms/HashingForm.stx +119 -0
- package/resources/components/Dashboard/Settings/Forms/LibraryForm.stx +389 -0
- package/resources/components/Dashboard/Settings/Forms/QueueForm.stx +219 -0
- package/resources/components/Dashboard/Settings/Forms/SearchEngineForm.stx +48 -0
- package/resources/components/Dashboard/Settings/Forms/SecurityForm.stx +143 -0
- package/resources/components/Dashboard/Settings/Forms/ServicesForm.stx +194 -0
- package/resources/components/Dashboard/Settings/Forms/StorageForm.stx +191 -0
- package/resources/components/Dashboard/Settings/Forms/TeamsForm.stx +33 -0
- package/resources/components/Dashboard/Settings/SettingsFormManager.stx +181 -0
- package/resources/components/Dashboard/SettingsHeader.stx +88 -0
- package/resources/components/Dashboard/SettingsSidebar.stx +234 -0
- package/resources/components/Dashboard/Sidebar.stx +23 -0
- package/resources/components/Dashboard/SidebarModern.stx +249 -0
- package/resources/components/Dashboard/Skeleton/LoadingCard.stx +15 -0
- package/resources/components/Dashboard/Skeleton/LoadingDetails.stx +26 -0
- package/resources/components/Dashboard/Table.stx +82 -0
- package/resources/components/Dashboard/TerminalContainer.stx +97 -0
- package/resources/components/Dashboard/Tooltip.stx +166 -0
- package/resources/components/Dashboard/Transaction/index.stx +88 -0
- package/resources/components/Dashboard/UI/ActivityTable.stx +54 -0
- package/resources/components/Dashboard/UI/Avatar.stx +102 -0
- package/resources/components/Dashboard/UI/Badge.stx +66 -0
- package/resources/components/Dashboard/UI/Button.stx +73 -0
- package/resources/components/Dashboard/UI/Card.stx +51 -0
- package/resources/components/Dashboard/UI/ChartCard.stx +36 -0
- package/resources/components/Dashboard/UI/Checkbox.stx +74 -0
- package/resources/components/Dashboard/UI/ConfirmDialog.stx +74 -0
- package/resources/components/Dashboard/UI/DataTable.stx +45 -0
- package/resources/components/Dashboard/UI/Dropdown.stx +72 -0
- package/resources/components/Dashboard/UI/DropdownItem.stx +80 -0
- package/resources/components/Dashboard/UI/EmptyState.stx +50 -0
- package/resources/components/Dashboard/UI/FilterBar.stx +48 -0
- package/resources/components/Dashboard/UI/Input.stx +77 -0
- package/resources/components/Dashboard/UI/Modal.stx +75 -0
- package/resources/components/Dashboard/UI/PageHeader.stx +69 -0
- package/resources/components/Dashboard/UI/PageLayout.stx +84 -0
- package/resources/components/Dashboard/UI/Pagination.stx +126 -0
- package/resources/components/Dashboard/UI/QuickLinks.stx +31 -0
- package/resources/components/Dashboard/UI/RouterLink.stx +31 -0
- package/resources/components/Dashboard/UI/Select.stx +84 -0
- package/resources/components/Dashboard/UI/ServiceHealth.stx +38 -0
- package/resources/components/Dashboard/UI/StatsCard.stx +79 -0
- package/resources/components/Dashboard/UI/Table.stx +143 -0
- package/resources/components/Dashboard/UI/Tabs.stx +45 -0
- package/resources/components/Dashboard/UI/Textarea.stx +93 -0
- package/resources/components/Dashboard/UI/Toggle.stx +84 -0
- package/resources/components/Dashboard/UI/WindowControls.stx +135 -0
- package/resources/components/Dashboard/Widget.stx +89 -0
- package/resources/components/Dashboard/WindowControls.stx +119 -0
- package/resources/components/Dashboard/index.ts +106 -0
- package/resources/components/Docs/Demo/ComboboxCode.md +114 -0
- package/resources/components/Docs/Demo/ComboboxDemo.stx +91 -0
- package/resources/components/Docs/Demo/DialogCode.md +42 -0
- package/resources/components/Docs/Demo/DialogDemo.stx +76 -0
- package/resources/components/Docs/Demo/DocsPlayground.stx +39 -0
- package/resources/components/Docs/Demo/DropdownCode.md +109 -0
- package/resources/components/Docs/Demo/DropdownDemo.stx +82 -0
- package/resources/components/Docs/Demo/Hero.stx +100 -0
- package/resources/components/Docs/Demo/ListboxCode.md +87 -0
- package/resources/components/Docs/Demo/ListboxDemo.stx +59 -0
- package/resources/components/Docs/Demo/NotificationCode.md +173 -0
- package/resources/components/Docs/Demo/NotificationDemo.stx +99 -0
- package/resources/components/Docs/Demo/PopoverCode.md +161 -0
- package/resources/components/Docs/Demo/PopoverDemo.stx +96 -0
- package/resources/components/Docs/Demo/RadioGroupCode.md +98 -0
- package/resources/components/Docs/Demo/RadioGroupDemo.stx +53 -0
- package/resources/components/Docs/Demo/StepperCode.md +216 -0
- package/resources/components/Docs/Demo/StepperDemo.stx +137 -0
- package/resources/components/Docs/Demo/SwitchCode.md +24 -0
- package/resources/components/Docs/Demo/SwitchDemo.stx +28 -0
- package/resources/components/Docs/Home.stx +7 -0
- package/resources/components/Docs/HomeContributors.stx +23 -0
- package/resources/components/Docs/HomeSponsors.stx +17 -0
- package/resources/components/Docs/HomeTeam.stx +18 -0
- package/resources/components/Docs/TeamMember.stx +79 -0
- package/resources/components/Email/EmailButton.stx +32 -0
- package/resources/components/Email/EmailDivider.stx +20 -0
- package/resources/components/Email/EmailImage.stx +24 -0
- package/resources/components/Email/EmailLayout.stx +55 -0
- package/resources/components/Email/EmailLink.stx +22 -0
- package/resources/components/Email/EmailSection.stx +20 -0
- package/resources/components/Email/EmailText.stx +30 -0
- package/resources/components/Forum/ForumBreadcrumb.stx +38 -0
- package/resources/components/Forum/ForumCategory.stx +16 -0
- package/resources/components/Forum/ForumCategoryItem.stx +46 -0
- package/resources/components/Forum/ForumLayout.stx +36 -0
- package/resources/components/Forum/ForumPagination.stx +39 -0
- package/resources/components/Forum/ForumPost.stx +71 -0
- package/resources/components/Forum/ForumReplyForm.stx +76 -0
- package/resources/components/Forum/ForumSidebar.stx +86 -0
- package/resources/components/Forum/ForumTopicItem.stx +77 -0
- package/resources/components/Forum/ForumTopicList.stx +23 -0
- package/resources/components/HelloWorld.stx +253 -0
- package/resources/components/Logo.stx +10 -0
- package/resources/components/Marketing/CallToAction.stx +30 -0
- package/resources/components/Marketing/ComingSoon.stx +155 -0
- package/resources/components/Marketing/Faqs.stx +99 -0
- package/resources/components/Marketing/Feature.stx +32 -0
- package/resources/components/Marketing/Fields.stx +28 -0
- package/resources/components/Marketing/Footer.stx +33 -0
- package/resources/components/Marketing/Header.stx +51 -0
- package/resources/components/Marketing/Hero.stx +46 -0
- package/resources/components/Marketing/Layout.stx +26 -0
- package/resources/components/Marketing/NavLink.stx +13 -0
- package/resources/components/Marketing/Plan.stx +43 -0
- package/resources/components/Marketing/Pricing.stx +120 -0
- package/resources/components/Marketing/PrimaryFeatures.stx +80 -0
- package/resources/components/Marketing/PrimaryFeatures2.stx +98 -0
- package/resources/components/Marketing/SecondaryFeatures.stx +80 -0
- package/resources/components/Marketing/Testimonials.stx +120 -0
- package/resources/components/Pagination.stx +149 -0
- package/resources/components/Playground.stx +9 -0
- package/resources/components/README.md +87 -0
- package/resources/components/Storefront/AnnouncementBar.stx +17 -0
- package/resources/components/Storefront/CartDrawer.stx +227 -0
- package/resources/components/Storefront/CheckoutSteps.stx +50 -0
- package/resources/components/Storefront/Footer.stx +81 -0
- package/resources/components/Storefront/Header.stx +66 -0
- package/resources/components/Storefront/OrderSummary.stx +79 -0
- package/resources/components/Storefront/ProductCard.stx +63 -0
- package/resources/components/Storefront/ProductGallery.stx +88 -0
- package/resources/components/Storefront/QuantitySelector.stx +97 -0
- package/resources/components/index.ts +13 -0
- package/resources/emails/email-verification.stx +46 -0
- package/resources/emails/layouts/base.html +113 -0
- package/resources/emails/password-changed.stx +55 -0
- package/resources/emails/password-reset.stx +43 -0
- package/resources/emails/subscription-confirmation.stx +99 -0
- package/resources/emails/welcome.stx +48 -0
- package/resources/functions/README.md +28 -0
- package/resources/functions/counter.ts +13 -0
- package/resources/functions/dark.ts +4 -0
- package/resources/functions/dashboard/analytics.ts +238 -0
- package/resources/functions/dashboard/config-io.ts +316 -0
- package/resources/functions/dashboard/data.ts +375 -0
- package/resources/functions/dashboard/library.ts +250 -0
- package/resources/functions/dashboard/sidebar.ts +537 -0
- package/resources/functions/dashboard/system.ts +150 -0
- package/resources/layouts/403.stx +188 -0
- package/resources/layouts/404.stx +34 -0
- package/resources/layouts/README.md +14 -0
- package/resources/layouts/dashboard/default.stx +20 -0
- package/resources/layouts/dashboard/guest.stx +10 -0
- package/resources/layouts/default.stx +3 -0
- package/resources/layouts/maintenance.stx +11 -0
- package/resources/layouts/storefront.stx +73 -0
- package/resources/layouts/system-tray/default.stx +3 -0
- package/resources/modules/.gitkeep +0 -0
- package/resources/plugins/.gitkeep +0 -0
- package/resources/plugins/preloader.ts +308 -0
- package/resources/types/README.md +3 -0
- package/resources/views/cart.stx +149 -0
- package/resources/views/checkout/contact.stx +101 -0
- package/resources/views/checkout/payment.stx +114 -0
- package/resources/views/checkout/shipping.stx +120 -0
- package/resources/views/coming-soon.stx +9 -0
- package/resources/views/dashboard/custom-page.stx +45 -0
- package/resources/views/dashboard/index.stx +24 -0
- package/resources/views/emails/welcome.stx +0 -0
- package/resources/views/errors/tester.stx +26 -0
- package/resources/views/index.stx +2865 -0
- package/resources/views/orders/[id].stx +130 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface CouponsTableProps {
|
|
3
|
+
coupons?: any[]
|
|
4
|
+
searchQuery?: string
|
|
5
|
+
statusFilter?: string
|
|
6
|
+
sortBy?: string
|
|
7
|
+
sortOrder?: string
|
|
8
|
+
currentPage?: number
|
|
9
|
+
itemsPerPage?: number
|
|
10
|
+
statuses?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { coupons = [], searchQuery = '', statusFilter = '', sortBy = 'code', sortOrder = 'asc', currentPage = 1, itemsPerPage = 10, statuses = ['Active', 'Expired', 'Scheduled'] } = defineProps<CouponsTableProps>()
|
|
14
|
+
|
|
15
|
+
function getStatus(status) {
|
|
16
|
+
const statusStr = Array.isArray(status) ? status[0] : status
|
|
17
|
+
return statusStr || 'N/A'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getStatusClass(status) {
|
|
21
|
+
const statusStr = Array.isArray(status) ? status[0] : status
|
|
22
|
+
switch (statusStr) {
|
|
23
|
+
case 'Active':
|
|
24
|
+
return 'bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-900/30 dark:text-green-400'
|
|
25
|
+
case 'Expired':
|
|
26
|
+
return 'bg-gray-50 text-gray-700 ring-1 ring-inset ring-gray-600/20 dark:bg-neutral-900/30 dark:text-neutral-400'
|
|
27
|
+
case 'Scheduled':
|
|
28
|
+
return 'bg-blue-50 text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-900/30 dark:text-blue-400'
|
|
29
|
+
default:
|
|
30
|
+
return 'bg-gray-50 text-gray-700 ring-1 ring-inset ring-gray-600/20 dark:bg-neutral-900/30 dark:text-neutral-400'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
<!-- Coupons table -->
|
|
35
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
36
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
37
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
38
|
+
<tr>
|
|
39
|
+
<th scope="col" class="pl-6 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
40
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="code">
|
|
41
|
+
Coupon Code
|
|
42
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
43
|
+
@if(sortBy == 'code')
|
|
44
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
45
|
+
@else
|
|
46
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
47
|
+
@endif
|
|
48
|
+
</span>
|
|
49
|
+
</button>
|
|
50
|
+
</th>
|
|
51
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Type</th>
|
|
52
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
53
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="discount_value">
|
|
54
|
+
Value
|
|
55
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
56
|
+
@if(sortBy == 'discount_value')
|
|
57
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
58
|
+
@else
|
|
59
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
60
|
+
@endif
|
|
61
|
+
</span>
|
|
62
|
+
</button>
|
|
63
|
+
</th>
|
|
64
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Min Order Amount</th>
|
|
65
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
66
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="usage_count">
|
|
67
|
+
Usage
|
|
68
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
69
|
+
@if(sortBy == 'usage_count')
|
|
70
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
71
|
+
@else
|
|
72
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
73
|
+
@endif
|
|
74
|
+
</span>
|
|
75
|
+
</button>
|
|
76
|
+
</th>
|
|
77
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
78
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="end_date">
|
|
79
|
+
Expiry
|
|
80
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
81
|
+
@if(sortBy == 'end_date')
|
|
82
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
83
|
+
@else
|
|
84
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
85
|
+
@endif
|
|
86
|
+
</span>
|
|
87
|
+
</button>
|
|
88
|
+
</th>
|
|
89
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Status</th>
|
|
90
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
91
|
+
<span class="sr-only">Actions</span>
|
|
92
|
+
</th>
|
|
93
|
+
</tr>
|
|
94
|
+
</thead>
|
|
95
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
96
|
+
@foreach(coupons as coupon)
|
|
97
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
98
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
99
|
+
{{ coupon.code }}
|
|
100
|
+
</td>
|
|
101
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
102
|
+
{{ coupon.discount_type }}
|
|
103
|
+
</td>
|
|
104
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
105
|
+
{{ coupon.discount_type == 'Percentage' ? coupon.discount_value + '%' : '$' + coupon.discount_value.toFixed(2) }}
|
|
106
|
+
</td>
|
|
107
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
108
|
+
{{ coupon.min_order_amount > 0 ? '$' + coupon.min_order_amount.toFixed(2) : 'None' }}
|
|
109
|
+
</td>
|
|
110
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
111
|
+
{{ coupon.usage_count }} / {{ coupon.usage_limit }}
|
|
112
|
+
</td>
|
|
113
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
114
|
+
{{ coupon.end_date }}
|
|
115
|
+
</td>
|
|
116
|
+
<td class="px-3 py-3.5 text-sm whitespace-nowrap">
|
|
117
|
+
<span class="inline-flex items-center rounded-md px-2 py-1 text-xs font-medium {{ getStatusClass(coupon.status) }}">
|
|
118
|
+
{{ getStatus(coupon.status) }}
|
|
119
|
+
</span>
|
|
120
|
+
</td>
|
|
121
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
122
|
+
<div class="flex items-center justify-end space-x-2">
|
|
123
|
+
<button
|
|
124
|
+
type="button"
|
|
125
|
+
class="text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 duration-150 transition-colors"
|
|
126
|
+
data-action="view"
|
|
127
|
+
data-coupon-id="{{ coupon.id }}"
|
|
128
|
+
>
|
|
129
|
+
<div class="h-5 w-5 i-hugeicons-view"></div>
|
|
130
|
+
</button>
|
|
131
|
+
<button
|
|
132
|
+
type="button"
|
|
133
|
+
class="text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 duration-150 transition-colors"
|
|
134
|
+
data-action="edit"
|
|
135
|
+
data-coupon-id="{{ coupon.id }}"
|
|
136
|
+
>
|
|
137
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
138
|
+
</button>
|
|
139
|
+
<button
|
|
140
|
+
type="button"
|
|
141
|
+
class="text-red-400 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300 duration-150 transition-colors"
|
|
142
|
+
title="Delete coupon"
|
|
143
|
+
data-action="delete"
|
|
144
|
+
data-coupon-id="{{ coupon.id }}"
|
|
145
|
+
>
|
|
146
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
147
|
+
</button>
|
|
148
|
+
</div>
|
|
149
|
+
</td>
|
|
150
|
+
</tr>
|
|
151
|
+
@endforeach
|
|
152
|
+
@if(coupons.length == 0)
|
|
153
|
+
<tr>
|
|
154
|
+
<td colspan="8" class="px-6 py-3.5 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
155
|
+
No coupons found matching your criteria
|
|
156
|
+
</td>
|
|
157
|
+
</tr>
|
|
158
|
+
@endif
|
|
159
|
+
</tbody>
|
|
160
|
+
</table>
|
|
161
|
+
</div>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface CustomersTableProps {
|
|
3
|
+
customers?: any[]
|
|
4
|
+
searchQuery?: string
|
|
5
|
+
statusFilter?: string
|
|
6
|
+
sortBy?: string
|
|
7
|
+
sortOrder?: string
|
|
8
|
+
currentPage?: number
|
|
9
|
+
itemsPerPage?: number
|
|
10
|
+
statuses?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { customers = [], searchQuery = '', statusFilter = '', sortBy = 'name', sortOrder = 'asc', currentPage = 1, itemsPerPage = 10, statuses = ['Active', 'Inactive'] } = defineProps<CustomersTableProps>()
|
|
14
|
+
|
|
15
|
+
function getStatusClass(status) {
|
|
16
|
+
const statusStr = Array.isArray(status) ? status[0] : status
|
|
17
|
+
switch (statusStr) {
|
|
18
|
+
case 'Active':
|
|
19
|
+
return 'bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-900/30 dark:text-green-400'
|
|
20
|
+
case 'Inactive':
|
|
21
|
+
return 'bg-gray-50 text-gray-700 ring-1 ring-inset ring-gray-600/20 dark:bg-neutral-900/30 dark:text-neutral-400'
|
|
22
|
+
default:
|
|
23
|
+
return 'bg-gray-50 text-gray-700 ring-1 ring-inset ring-gray-600/20 dark:bg-neutral-900/30 dark:text-neutral-400'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
<!-- Customers table -->
|
|
28
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
29
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
30
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
31
|
+
<tr>
|
|
32
|
+
<th scope="col" class="pl-6 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
33
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="name">
|
|
34
|
+
Customer
|
|
35
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
36
|
+
@if(sortBy == 'name')
|
|
37
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
38
|
+
@else
|
|
39
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
40
|
+
@endif
|
|
41
|
+
</span>
|
|
42
|
+
</button>
|
|
43
|
+
</th>
|
|
44
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Contact</th>
|
|
45
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
46
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="total_spent">
|
|
47
|
+
Total Spent
|
|
48
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
49
|
+
@if(sortBy == 'total_spent')
|
|
50
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
51
|
+
@else
|
|
52
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
53
|
+
@endif
|
|
54
|
+
</span>
|
|
55
|
+
</button>
|
|
56
|
+
</th>
|
|
57
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
58
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="last_order">
|
|
59
|
+
Last Order
|
|
60
|
+
<span class="group-hover:visible flex-none ml-2 text-stone-400 rounded group-focus-visible">
|
|
61
|
+
@if(sortBy == 'last_order')
|
|
62
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
63
|
+
@else
|
|
64
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
65
|
+
@endif
|
|
66
|
+
</span>
|
|
67
|
+
</button>
|
|
68
|
+
</th>
|
|
69
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Status</th>
|
|
70
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
71
|
+
<span class="sr-only">Actions</span>
|
|
72
|
+
</th>
|
|
73
|
+
</tr>
|
|
74
|
+
</thead>
|
|
75
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
76
|
+
@foreach(customers as customer)
|
|
77
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
78
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
79
|
+
<div class="flex items-center">
|
|
80
|
+
<img src="{{ customer.avatar }}" alt="" class="flex-shrink-0 h-10 w-10 rounded-full">
|
|
81
|
+
<div class="ml-4">
|
|
82
|
+
<div>{{ customer.name }}</div>
|
|
83
|
+
<div class="text-stone-500 text-xs dark:text-neutral-400">ID: {{ customer.id }}</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</td>
|
|
87
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 dark:text-neutral-300">
|
|
88
|
+
<div>{{ customer.email }}</div>
|
|
89
|
+
<div>{{ customer.phone }}</div>
|
|
90
|
+
</td>
|
|
91
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
92
|
+
${{ (customer.total_spent || 0).toFixed(2) }}
|
|
93
|
+
</td>
|
|
94
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
95
|
+
{{ customer.last_order || 'Never' }}
|
|
96
|
+
</td>
|
|
97
|
+
<td class="px-3 py-3.5 text-sm whitespace-nowrap">
|
|
98
|
+
<span class="inline-flex items-center rounded-md px-2 py-1 text-xs font-medium {{ getStatusClass(customer.status) }}">
|
|
99
|
+
{{ customer.status }}
|
|
100
|
+
</span>
|
|
101
|
+
</td>
|
|
102
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
103
|
+
<div class="flex items-center justify-end space-x-2">
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
class="text-stone-400 dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400 duration-150 transition-colors"
|
|
107
|
+
data-action="view"
|
|
108
|
+
data-customer-id="{{ customer.id }}"
|
|
109
|
+
>
|
|
110
|
+
<div class="h-5 w-5 i-hugeicons-view"></div>
|
|
111
|
+
</button>
|
|
112
|
+
<button
|
|
113
|
+
type="button"
|
|
114
|
+
class="text-stone-400 dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400 duration-150 transition-colors"
|
|
115
|
+
data-action="edit"
|
|
116
|
+
data-customer-id="{{ customer.id }}"
|
|
117
|
+
>
|
|
118
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
119
|
+
</button>
|
|
120
|
+
<button
|
|
121
|
+
type="button"
|
|
122
|
+
class="text-red-400 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300 duration-150 transition-colors"
|
|
123
|
+
title="Delete customer"
|
|
124
|
+
data-action="delete"
|
|
125
|
+
data-customer-id="{{ customer.id }}"
|
|
126
|
+
>
|
|
127
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
128
|
+
</button>
|
|
129
|
+
</div>
|
|
130
|
+
</td>
|
|
131
|
+
</tr>
|
|
132
|
+
@endforeach
|
|
133
|
+
@if(customers.length == 0)
|
|
134
|
+
<tr>
|
|
135
|
+
<td colspan="7" class="px-6 py-8 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
136
|
+
No customers found matching your criteria
|
|
137
|
+
</td>
|
|
138
|
+
</tr>
|
|
139
|
+
@endif
|
|
140
|
+
</tbody>
|
|
141
|
+
</table>
|
|
142
|
+
</div>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface DeliveryRoutesTableProps {
|
|
3
|
+
routes?: any[]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { routes = [] } = defineProps<DeliveryRoutesTableProps>()
|
|
7
|
+
|
|
8
|
+
function formatDate(date) {
|
|
9
|
+
if (!date) return 'N/A'
|
|
10
|
+
const dateObj = typeof date === 'string' ? new Date(date) : date
|
|
11
|
+
return dateObj.toLocaleDateString('en-US', {
|
|
12
|
+
year: 'numeric',
|
|
13
|
+
month: 'short',
|
|
14
|
+
day: 'numeric'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
19
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
20
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
21
|
+
<tr>
|
|
22
|
+
<th scope="col" class="pl-6 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Route ID</th>
|
|
23
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Driver</th>
|
|
24
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Vehicle</th>
|
|
25
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Stops</th>
|
|
26
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Delivery Time</th>
|
|
27
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Total Distance</th>
|
|
28
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-right text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Last Active</th>
|
|
29
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5 text-right">
|
|
30
|
+
<span class="sr-only">Actions</span>
|
|
31
|
+
</th>
|
|
32
|
+
</tr>
|
|
33
|
+
</thead>
|
|
34
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
35
|
+
@foreach(routes as route)
|
|
36
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
37
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
38
|
+
{{ route.id }}
|
|
39
|
+
</td>
|
|
40
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
41
|
+
{{ route.driver }}
|
|
42
|
+
</td>
|
|
43
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
44
|
+
{{ route.vehicle }}
|
|
45
|
+
</td>
|
|
46
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
47
|
+
{{ route.stops }}
|
|
48
|
+
</td>
|
|
49
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
50
|
+
{{ route.delivery_time }} hours
|
|
51
|
+
</td>
|
|
52
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
53
|
+
{{ route.total_distance }} km
|
|
54
|
+
</td>
|
|
55
|
+
<td class="px-4 py-3.5 text-right text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
56
|
+
{{ formatDate(route.last_active) }}
|
|
57
|
+
</td>
|
|
58
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
59
|
+
<button type="button" class="mr-2 p-2 text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 border border-transparent rounded-md hover:border-blue-200 dark:hover:border-blue-800 duration-150 transition-colors" data-action="view-map" data-route-id="{{ route.id }}" title="View Map">
|
|
60
|
+
<div class="h-5 w-5 i-hugeicons-route-02"></div>
|
|
61
|
+
</button>
|
|
62
|
+
<button type="button" class="mr-2 p-2 text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 border border-transparent rounded-md hover:border-blue-200 dark:hover:border-blue-800 duration-150 transition-colors" title="Edit" data-action="edit" data-route-id="{{ route.id }}">
|
|
63
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
64
|
+
</button>
|
|
65
|
+
<button type="button" class="p-2 text-stone-400 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 border border-transparent rounded-md hover:border-red-200 dark:hover:border-red-800 duration-150 transition-colors" title="Delete" data-action="delete" data-route-id="{{ route.id }}">
|
|
66
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
67
|
+
</button>
|
|
68
|
+
</td>
|
|
69
|
+
</tr>
|
|
70
|
+
@endforeach
|
|
71
|
+
@if(routes.length == 0)
|
|
72
|
+
<tr>
|
|
73
|
+
<td colspan="8" class="px-6 py-3.5 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
74
|
+
No delivery routes found
|
|
75
|
+
</td>
|
|
76
|
+
</tr>
|
|
77
|
+
@endif
|
|
78
|
+
</tbody>
|
|
79
|
+
</table>
|
|
80
|
+
</div>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface DigitalDeliveryTableProps {
|
|
3
|
+
methods?: any[]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { methods = [] } = defineProps<DigitalDeliveryTableProps>()
|
|
7
|
+
|
|
8
|
+
function statusVariant(status) {
|
|
9
|
+
return String(status || '').toLowerCase() === 'active' ? 'success' : 'default'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function uppercaseFirstLetter(status) {
|
|
13
|
+
return status.charAt(0).toUpperCase() + status.slice(1)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function formatLimit(value) {
|
|
17
|
+
return value !== null && value !== undefined ? value.toString() : 'Unlimited'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function formatExpiry(days) {
|
|
21
|
+
return days !== null && days !== undefined ? `${days} days` : 'Never expires'
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
25
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
26
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
27
|
+
<tr>
|
|
28
|
+
<th scope="col" class="pl-6 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Name</th>
|
|
29
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Description</th>
|
|
30
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Download Limit</th>
|
|
31
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Expiry Days</th>
|
|
32
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Requires Login</th>
|
|
33
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Automatic Delivery</th>
|
|
34
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Status</th>
|
|
35
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
36
|
+
<span class="sr-only">Actions</span>
|
|
37
|
+
</th>
|
|
38
|
+
</tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
41
|
+
@foreach(methods as method)
|
|
42
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
43
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
44
|
+
{{ method.name }}
|
|
45
|
+
</td>
|
|
46
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
47
|
+
{{ method.description }}
|
|
48
|
+
</td>
|
|
49
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
50
|
+
{{ formatLimit(method.download_limit) }}
|
|
51
|
+
</td>
|
|
52
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
53
|
+
{{ formatExpiry(method.expiry_days) }}
|
|
54
|
+
</td>
|
|
55
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
56
|
+
{{ method.requires_login ? 'Yes' : 'No' }}
|
|
57
|
+
</td>
|
|
58
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
59
|
+
{{ method.automatic_delivery ? 'Yes' : 'No' }}
|
|
60
|
+
</td>
|
|
61
|
+
<td class="px-4 py-3.5 text-sm whitespace-nowrap">
|
|
62
|
+
<Badge variant="{{ statusVariant(method.status) }}" size="sm">
|
|
63
|
+
{{ uppercaseFirstLetter(method.status) }}
|
|
64
|
+
</Badge>
|
|
65
|
+
</td>
|
|
66
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
67
|
+
<button type="button" class="mr-2 p-2 text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 border border-transparent rounded-md hover:border-blue-200 dark:hover:border-blue-800 duration-150 transition-colors" title="Edit" data-action="edit" data-method-id="{{ method.id }}">
|
|
68
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
69
|
+
</button>
|
|
70
|
+
<button type="button" class="p-2 text-stone-400 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 border border-transparent rounded-md hover:border-red-200 dark:hover:border-red-800 duration-150 transition-colors" title="Delete" data-action="delete" data-method-id="{{ method.id }}">
|
|
71
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
72
|
+
</button>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
@endforeach
|
|
76
|
+
@if(methods.length == 0)
|
|
77
|
+
<tr>
|
|
78
|
+
<td colspan="8" class="px-6 py-3.5 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
79
|
+
No digital delivery methods found
|
|
80
|
+
</td>
|
|
81
|
+
</tr>
|
|
82
|
+
@endif
|
|
83
|
+
</tbody>
|
|
84
|
+
</table>
|
|
85
|
+
</div>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface DriversTableProps {
|
|
3
|
+
drivers?: any[]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { drivers = [] } = defineProps<DriversTableProps>()
|
|
7
|
+
|
|
8
|
+
function formatDate(date) {
|
|
9
|
+
if (!date) return 'N/A'
|
|
10
|
+
const dateObj = typeof date === 'string' ? new Date(date) : date
|
|
11
|
+
return dateObj.toLocaleDateString('en-US', {
|
|
12
|
+
year: 'numeric',
|
|
13
|
+
month: 'short',
|
|
14
|
+
day: 'numeric'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getStatusClass(status) {
|
|
19
|
+
switch (status) {
|
|
20
|
+
case 'Active':
|
|
21
|
+
return 'bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-900/30 dark:text-green-400'
|
|
22
|
+
case 'On Delivery':
|
|
23
|
+
return 'bg-blue-50 text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-900/30 dark:text-blue-400'
|
|
24
|
+
case 'On Break':
|
|
25
|
+
return 'bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20 dark:bg-yellow-900/30 dark:text-yellow-400'
|
|
26
|
+
default:
|
|
27
|
+
return 'bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-900/30 dark:text-red-400'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
32
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
33
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
34
|
+
<tr>
|
|
35
|
+
<th scope="col" class="pl-6 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">ID</th>
|
|
36
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Name</th>
|
|
37
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Phone</th>
|
|
38
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Vehicle</th>
|
|
39
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">License</th>
|
|
40
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Status</th>
|
|
41
|
+
<th scope="col" class="px-4 py-3.5 font-semibold text-left text-right text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Last Active</th>
|
|
42
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
43
|
+
<span class="sr-only">Actions</span>
|
|
44
|
+
</th>
|
|
45
|
+
</tr>
|
|
46
|
+
</thead>
|
|
47
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
48
|
+
@foreach(drivers as driver)
|
|
49
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
50
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
51
|
+
{{ driver.id }}
|
|
52
|
+
</td>
|
|
53
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
54
|
+
<div class="flex items-center">
|
|
55
|
+
<div class="flex-shrink-0 h-10 w-10">
|
|
56
|
+
<img
|
|
57
|
+
src="{{ driver.avatar || 'https://carefreeagency-eliinova.s3.amazonaws.com/images/avatar/default.svg' }}"
|
|
58
|
+
alt=""
|
|
59
|
+
class="h-10 w-10 rounded-full"
|
|
60
|
+
>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="ml-4">
|
|
63
|
+
<div class="font-medium text-stone-800 dark:text-white">{{ driver.name }}</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</td>
|
|
67
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
68
|
+
{{ driver.phone }}
|
|
69
|
+
</td>
|
|
70
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
71
|
+
{{ driver.vehicle_number }}
|
|
72
|
+
</td>
|
|
73
|
+
<td class="px-4 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
74
|
+
{{ driver.license }}
|
|
75
|
+
</td>
|
|
76
|
+
<td class="px-4 py-3.5 text-sm whitespace-nowrap">
|
|
77
|
+
<span class="inline-flex items-center rounded-md px-2 py-1 text-xs font-medium {{ getStatusClass(driver.status) }}">
|
|
78
|
+
{{ driver.status }}
|
|
79
|
+
</span>
|
|
80
|
+
</td>
|
|
81
|
+
<td class="px-4 py-3.5 text-right text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
82
|
+
{{ formatDate(driver.last_active) }}
|
|
83
|
+
</td>
|
|
84
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
85
|
+
<button type="button" class="mr-2 p-2 text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 border border-transparent rounded-md hover:border-blue-200 dark:hover:border-blue-800 duration-150 transition-colors" data-action="view-routes" data-driver-id="{{ driver.id }}" title="View Routes">
|
|
86
|
+
<div class="h-5 w-5 i-hugeicons-route-02"></div>
|
|
87
|
+
</button>
|
|
88
|
+
<button type="button" class="mr-2 p-2 text-stone-400 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 border border-transparent rounded-md hover:border-blue-200 dark:hover:border-blue-800 duration-150 transition-colors" title="Edit" data-action="edit" data-driver-id="{{ driver.id }}">
|
|
89
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
90
|
+
</button>
|
|
91
|
+
<button type="button" class="p-2 text-stone-400 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 border border-transparent rounded-md hover:border-red-200 dark:hover:border-red-800 duration-150 transition-colors" title="Delete" data-action="delete" data-driver-id="{{ driver.id }}">
|
|
92
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
93
|
+
</button>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
@endforeach
|
|
97
|
+
</tbody>
|
|
98
|
+
</table>
|
|
99
|
+
</div>
|