@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,191 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface CouponsFormProps {
|
|
3
|
+
show?: boolean
|
|
4
|
+
mode?: 'add' | 'edit'
|
|
5
|
+
coupon?: any
|
|
6
|
+
formData?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { show = false, mode = 'add', coupon = null, formData = { } = defineProps<CouponsFormProps>()
|
|
10
|
+
|
|
11
|
+
// Get today's date in YYYY-MM-DD format
|
|
12
|
+
const today = new Date().toISOString().split('T')[0]
|
|
13
|
+
const nextMonth = new Date()
|
|
14
|
+
nextMonth.setMonth(nextMonth.getMonth() + 1)
|
|
15
|
+
const nextMonthDate = nextMonth.toISOString().split('T')[0]
|
|
16
|
+
|
|
17
|
+
// Form default values
|
|
18
|
+
code: '',
|
|
19
|
+
discount_type: 'Percentage',
|
|
20
|
+
discount_value: 10,
|
|
21
|
+
min_order_amount: 0,
|
|
22
|
+
usage_limit: 100,
|
|
23
|
+
usage_count: 0,
|
|
24
|
+
start_date: today,
|
|
25
|
+
end_date: nextMonthDate,
|
|
26
|
+
status: 'Active'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const modalTitle = mode == 'add' ? 'Add New Coupon' : 'Edit Coupon'
|
|
30
|
+
const submitButtonText = mode == 'add' ? 'Add' : 'Update'
|
|
31
|
+
</script>
|
|
32
|
+
@if(show)
|
|
33
|
+
<div class="fixed inset-0 overflow-y-auto z-10">
|
|
34
|
+
<div class="flex items-end justify-center sm:items-center p-4 sm:p-0 min-h-full text-center">
|
|
35
|
+
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" data-action="close"></div>
|
|
36
|
+
|
|
37
|
+
<div class="overflow-hidden relative pb-4 pt-5 px-4 sm:my-8 sm:p-6 sm:max-w-lg sm:w-full text-left bg-white dark:bg-neutral-800 rounded-lg shadow-xl transition-all transform">
|
|
38
|
+
<div>
|
|
39
|
+
<div class="mt-3 sm:mt-5 text-center">
|
|
40
|
+
<h3 class="font-semibold leading-6 text-base text-gray-900 dark:text-white">{{ modalTitle }}</h3>
|
|
41
|
+
<div class="mt-4">
|
|
42
|
+
<div class="space-y-4">
|
|
43
|
+
<div>
|
|
44
|
+
<label for="coupon-code" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Coupon Code</label>
|
|
45
|
+
<div class="mt-2">
|
|
46
|
+
<input
|
|
47
|
+
type="text"
|
|
48
|
+
id="coupon-code"
|
|
49
|
+
name="code"
|
|
50
|
+
value="{{ coupon ? coupon.code : formData.code }}"
|
|
51
|
+
class="block py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white placeholder:text-gray-400 dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset shadow-sm"
|
|
52
|
+
placeholder="e.g. SUMMER20"
|
|
53
|
+
>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="grid gap-4 grid-cols-2">
|
|
58
|
+
<div>
|
|
59
|
+
<label for="coupon-type" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Type</label>
|
|
60
|
+
<div class="mt-2">
|
|
61
|
+
<select
|
|
62
|
+
id="coupon-type"
|
|
63
|
+
name="discount_type"
|
|
64
|
+
class="block py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset shadow-sm"
|
|
65
|
+
>
|
|
66
|
+
<option value="Percentage" {{ (coupon ? coupon.discount_type : formData.discount_type) == 'Percentage' ? 'selected' : '' }}>Percentage</option>
|
|
67
|
+
<option value="Fixed" {{ (coupon ? coupon.discount_type : formData.discount_type) == 'Fixed' ? 'selected' : '' }}>Fixed Amount</option>
|
|
68
|
+
</select>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div>
|
|
73
|
+
<label for="coupon-value" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Value</label>
|
|
74
|
+
<div class="mt-2">
|
|
75
|
+
<div class="relative rounded-md shadow-sm">
|
|
76
|
+
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
|
77
|
+
<span class="text-gray-500 sm:text-sm">%</span>
|
|
78
|
+
</div>
|
|
79
|
+
<input
|
|
80
|
+
type="number"
|
|
81
|
+
id="coupon-value"
|
|
82
|
+
name="discount_value"
|
|
83
|
+
value="{{ coupon ? coupon.discount_value : formData.discount_value }}"
|
|
84
|
+
class="block pl-7 py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white placeholder:text-gray-400 dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset"
|
|
85
|
+
>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="grid gap-4 grid-cols-2">
|
|
92
|
+
<div>
|
|
93
|
+
<label for="min-order-amount" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Min Order Amount</label>
|
|
94
|
+
<div class="mt-2">
|
|
95
|
+
<div class="relative rounded-md shadow-sm">
|
|
96
|
+
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
|
97
|
+
<span class="text-gray-500 sm:text-sm">$</span>
|
|
98
|
+
</div>
|
|
99
|
+
<input
|
|
100
|
+
type="number"
|
|
101
|
+
id="min-order-amount"
|
|
102
|
+
name="min_order_amount"
|
|
103
|
+
value="{{ coupon ? coupon.min_order_amount : formData.min_order_amount }}"
|
|
104
|
+
class="block pl-7 py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white placeholder:text-gray-400 dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset"
|
|
105
|
+
>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div>
|
|
111
|
+
<label for="usage-limit" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Usage Limit</label>
|
|
112
|
+
<div class="mt-2">
|
|
113
|
+
<input
|
|
114
|
+
type="number"
|
|
115
|
+
id="usage-limit"
|
|
116
|
+
name="usage_limit"
|
|
117
|
+
value="{{ coupon ? coupon.usage_limit : formData.usage_limit }}"
|
|
118
|
+
class="block py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white placeholder:text-gray-400 dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset shadow-sm"
|
|
119
|
+
>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div class="grid gap-4 grid-cols-2">
|
|
125
|
+
<div>
|
|
126
|
+
<label for="start-date" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Start Date</label>
|
|
127
|
+
<div class="mt-2">
|
|
128
|
+
<input
|
|
129
|
+
type="date"
|
|
130
|
+
id="start-date"
|
|
131
|
+
name="start_date"
|
|
132
|
+
value="{{ coupon ? coupon.start_date : formData.start_date }}"
|
|
133
|
+
class="block py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white placeholder:text-gray-400 dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset shadow-sm"
|
|
134
|
+
>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div>
|
|
139
|
+
<label for="end-date" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">End Date</label>
|
|
140
|
+
<div class="mt-2">
|
|
141
|
+
<input
|
|
142
|
+
type="date"
|
|
143
|
+
id="end-date"
|
|
144
|
+
name="end_date"
|
|
145
|
+
value="{{ coupon ? coupon.end_date : formData.end_date }}"
|
|
146
|
+
class="block py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white placeholder:text-gray-400 dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset shadow-sm"
|
|
147
|
+
>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div>
|
|
153
|
+
<label for="coupon-status" class="block font-medium leading-6 text-gray-900 text-left text-sm dark:text-neutral-200">Status</label>
|
|
154
|
+
<div class="mt-2">
|
|
155
|
+
<select
|
|
156
|
+
id="coupon-status"
|
|
157
|
+
name="status"
|
|
158
|
+
class="block py-1.5 w-full text-gray-900 sm:leading-6 sm:text-sm dark:text-white dark:bg-neutral-700 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 focus:ring-2 focus:ring-blue-600 focus:ring-inset shadow-sm"
|
|
159
|
+
>
|
|
160
|
+
<option value="Active" {{ (coupon ? coupon.status : formData.status) == 'Active' ? 'selected' : '' }}>Active</option>
|
|
161
|
+
<option value="Scheduled" {{ (coupon ? coupon.status : formData.status) == 'Scheduled' ? 'selected' : '' }}>Scheduled</option>
|
|
162
|
+
@if(mode == 'edit')
|
|
163
|
+
<option value="Expired" {{ coupon && coupon.status == 'Expired' ? 'selected' : '' }}>Expired</option>
|
|
164
|
+
@endif
|
|
165
|
+
</select>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="sm:grid sm:gap-3 sm:grid-cols-2 sm:grid-flow-row-dense mt-5 sm:mt-6">
|
|
173
|
+
<button
|
|
174
|
+
type="button"
|
|
175
|
+
class="inline-flex justify-center sm:col-start-2 px-3 py-2 w-full font-semibold text-sm text-white bg-blue-600 hover:bg-blue-500 rounded-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2 shadow-sm"
|
|
176
|
+
data-action="submit"
|
|
177
|
+
>
|
|
178
|
+
{{ submitButtonText }}
|
|
179
|
+
</button>
|
|
180
|
+
<button
|
|
181
|
+
type="button"
|
|
182
|
+
class="inline-flex justify-center sm:col-start-1 mt-3 px-3 py-2 sm:mt-0 w-full font-semibold text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-700 hover:bg-gray-50 dark:hover:bg-neutral-600 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-600 shadow-sm"
|
|
183
|
+
data-action="close"
|
|
184
|
+
>
|
|
185
|
+
Cancel
|
|
186
|
+
</button>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
@endif
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface OrdersTableProps {
|
|
3
|
+
orders?: 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 { orders = [], searchQuery = '', statusFilter = '', sortBy = 'id', sortOrder = 'desc', currentPage = 1, itemsPerPage = 10, statuses = ['Completed', 'Processing', 'Shipped', 'Cancelled', 'Refunded'] } = defineProps<OrdersTableProps>()
|
|
14
|
+
|
|
15
|
+
function getStatusClass(status) {
|
|
16
|
+
switch (status) {
|
|
17
|
+
case 'Completed':
|
|
18
|
+
return 'bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-900/30 dark:text-green-400'
|
|
19
|
+
case 'Processing':
|
|
20
|
+
return 'bg-blue-50 text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-900/30 dark:text-blue-400'
|
|
21
|
+
case 'Shipped':
|
|
22
|
+
return 'bg-yellow-50 text-yellow-700 ring-1 ring-inset ring-yellow-600/20 dark:bg-yellow-900/30 dark:text-yellow-400'
|
|
23
|
+
case 'Cancelled':
|
|
24
|
+
return 'bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-900/30 dark:text-red-400'
|
|
25
|
+
case 'Refunded':
|
|
26
|
+
return 'bg-purple-50 text-purple-700 ring-1 ring-inset ring-purple-600/20 dark:bg-purple-900/30 dark:text-purple-400'
|
|
27
|
+
default:
|
|
28
|
+
return 'bg-gray-50 text-gray-700 ring-1 ring-inset ring-gray-600/20 dark:bg-neutral-900/30 dark:text-neutral-400'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
<!-- Orders table -->
|
|
33
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
34
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
35
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
36
|
+
<tr>
|
|
37
|
+
<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">
|
|
38
|
+
Order ID
|
|
39
|
+
</th>
|
|
40
|
+
<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">
|
|
41
|
+
Customer Info
|
|
42
|
+
</th>
|
|
43
|
+
<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">
|
|
44
|
+
Date
|
|
45
|
+
</th>
|
|
46
|
+
<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">
|
|
47
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="total_amount">
|
|
48
|
+
Total
|
|
49
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
50
|
+
@if(sortBy == 'total_amount')
|
|
51
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
52
|
+
@else
|
|
53
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
54
|
+
@endif
|
|
55
|
+
</span>
|
|
56
|
+
</button>
|
|
57
|
+
</th>
|
|
58
|
+
<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>
|
|
59
|
+
<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>
|
|
60
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
61
|
+
<span class="sr-only">Actions</span>
|
|
62
|
+
</th>
|
|
63
|
+
</tr>
|
|
64
|
+
</thead>
|
|
65
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
66
|
+
@foreach(orders as order)
|
|
67
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
68
|
+
<td class="pl-6 pr-3 py-3.5 font-medium text-sm text-stone-800 whitespace-nowrap dark:text-white">
|
|
69
|
+
#{{ order.id }}
|
|
70
|
+
</td>
|
|
71
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 dark:text-neutral-300">
|
|
72
|
+
<div>Customer ID: {{ order.customer_id }}</div>
|
|
73
|
+
<div class="text-stone-400 text-xs dark:text-neutral-500">Order Type: {{ order.order_type }}</div>
|
|
74
|
+
</td>
|
|
75
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
76
|
+
{{ order.created_at || new Date().toLocaleDateString() }}
|
|
77
|
+
</td>
|
|
78
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
79
|
+
${{ order.total_amount.toFixed(2) }}
|
|
80
|
+
</td>
|
|
81
|
+
<td class="px-3 py-3.5 text-sm whitespace-nowrap">
|
|
82
|
+
<span class="inline-flex items-center rounded-md px-2 py-1 text-xs font-medium {{ getStatusClass(order.status) }}">
|
|
83
|
+
{{ order.status }}
|
|
84
|
+
</span>
|
|
85
|
+
</td>
|
|
86
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-300">
|
|
87
|
+
{{ order.order_type }}
|
|
88
|
+
</td>
|
|
89
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
90
|
+
<div class="flex items-center justify-end space-x-2">
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
class="text-stone-400 dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400 duration-150 transition-colors"
|
|
94
|
+
title="View order"
|
|
95
|
+
data-action="view"
|
|
96
|
+
data-order-id="{{ order.id }}"
|
|
97
|
+
>
|
|
98
|
+
<div class="h-5 w-5 i-hugeicons-view"></div>
|
|
99
|
+
</button>
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
class="text-stone-400 dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400 duration-150 transition-colors"
|
|
103
|
+
title="Edit order"
|
|
104
|
+
data-action="edit"
|
|
105
|
+
data-order-id="{{ order.id }}"
|
|
106
|
+
>
|
|
107
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
108
|
+
</button>
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
class="text-red-400 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300 duration-150 transition-colors"
|
|
112
|
+
title="Delete order"
|
|
113
|
+
data-action="delete"
|
|
114
|
+
data-order-id="{{ order.id }}"
|
|
115
|
+
>
|
|
116
|
+
<div class="h-5 w-5 i-hugeicons-waste"></div>
|
|
117
|
+
</button>
|
|
118
|
+
</div>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
@endforeach
|
|
122
|
+
@if(orders.length == 0)
|
|
123
|
+
<tr>
|
|
124
|
+
<td colspan="7" class="px-6 py-8 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
125
|
+
No orders found matching your criteria
|
|
126
|
+
</td>
|
|
127
|
+
</tr>
|
|
128
|
+
@endif
|
|
129
|
+
</tbody>
|
|
130
|
+
</table>
|
|
131
|
+
</div>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
interface ProductsTableProps {
|
|
3
|
+
products?: any[]
|
|
4
|
+
searchQuery?: string
|
|
5
|
+
categoryFilter?: string
|
|
6
|
+
sortBy?: string
|
|
7
|
+
sortOrder?: string
|
|
8
|
+
currentPage?: number
|
|
9
|
+
itemsPerPage?: number
|
|
10
|
+
categories?: any[]
|
|
11
|
+
selectedItems?: any[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const { products = [], searchQuery = '', categoryFilter = '', sortBy = 'name', sortOrder = 'asc', currentPage = 1, itemsPerPage = 10, categories = [], selectedItems = [] } = defineProps<ProductsTableProps>()
|
|
15
|
+
|
|
16
|
+
function isSelected(productId) {
|
|
17
|
+
return selectedItems.includes(productId)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function toggleSelect(productId) {
|
|
21
|
+
$emit('toggle-select', productId)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function toggleSelectAll() {
|
|
25
|
+
$emit('toggle-select-all')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const allSelected = products.length > 0 && products.every(p => selectedItems.includes(p.id))
|
|
29
|
+
|
|
30
|
+
function getStatusClass(isAvailable) {
|
|
31
|
+
switch (isAvailable) {
|
|
32
|
+
case 1:
|
|
33
|
+
return 'bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-900/30 dark:text-green-400'
|
|
34
|
+
case 0:
|
|
35
|
+
return 'bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-900/30 dark:text-red-400'
|
|
36
|
+
default:
|
|
37
|
+
return 'bg-gray-50 text-gray-700 ring-1 ring-inset ring-gray-600/20 dark:bg-neutral-900/30 dark:text-neutral-400'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getStatusText(isAvailable) {
|
|
42
|
+
return isAvailable === 1 ? 'Available' : 'Unavailable'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function formatDate(dateString) {
|
|
46
|
+
return new Date(dateString).toLocaleDateString()
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
<!-- Products table -->
|
|
50
|
+
<div class="overflow-hidden border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
51
|
+
<table class="min-w-full divide-stone-100 divide-y dark:divide-neutral-700">
|
|
52
|
+
<thead class="bg-stone-50/80 dark:bg-neutral-800">
|
|
53
|
+
<tr>
|
|
54
|
+
<th scope="col" class="pl-4 pr-1 py-3.5 w-10">
|
|
55
|
+
<input
|
|
56
|
+
type="checkbox"
|
|
57
|
+
class="h-4 w-4 text-blue-500 bg-white dark:bg-neutral-800 border-stone-300 rounded dark:border-neutral-600 focus:ring-blue-500/40 focus:ring-offset-0 cursor-pointer"
|
|
58
|
+
:checked="allSelected"
|
|
59
|
+
@change="toggleSelectAll"
|
|
60
|
+
/>
|
|
61
|
+
</th>
|
|
62
|
+
<th scope="col" class="pl-2 pr-3 py-3.5 font-semibold text-left text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
63
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="name">
|
|
64
|
+
Product
|
|
65
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
66
|
+
@if(sortBy == 'name')
|
|
67
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
68
|
+
@else
|
|
69
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
70
|
+
@endif
|
|
71
|
+
</span>
|
|
72
|
+
</button>
|
|
73
|
+
</th>
|
|
74
|
+
<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">Manufacturer</th>
|
|
75
|
+
<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">Category</th>
|
|
76
|
+
<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">
|
|
77
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="price">
|
|
78
|
+
Price
|
|
79
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
80
|
+
@if(sortBy == 'price')
|
|
81
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
82
|
+
@else
|
|
83
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
84
|
+
@endif
|
|
85
|
+
</span>
|
|
86
|
+
</button>
|
|
87
|
+
</th>
|
|
88
|
+
<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>
|
|
89
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-right text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">Inventory</th>
|
|
90
|
+
<th scope="col" class="px-3 py-3.5 font-semibold text-right text-stone-500 text-xs tracking-wider uppercase dark:text-neutral-400">
|
|
91
|
+
<button class="inline-flex items-center group" data-action="sort" data-column="created_at">
|
|
92
|
+
Created At
|
|
93
|
+
<span class="group-focus:visible group-hover:visible flex-none ml-2 text-stone-400 rounded">
|
|
94
|
+
@if(sortBy == 'created_at')
|
|
95
|
+
<div class="{{ sortOrder == 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02' }} h-3.5 w-3.5"></div>
|
|
96
|
+
@else
|
|
97
|
+
<div class="h-3.5 w-3.5 i-hugeicons-arrows-up-down"></div>
|
|
98
|
+
@endif
|
|
99
|
+
</span>
|
|
100
|
+
</button>
|
|
101
|
+
</th>
|
|
102
|
+
<th scope="col" class="relative pl-3 pr-6 py-3.5">
|
|
103
|
+
<span class="sr-only">Actions</span>
|
|
104
|
+
</th>
|
|
105
|
+
</tr>
|
|
106
|
+
</thead>
|
|
107
|
+
<tbody class="bg-white dark:bg-neutral-800 divide-stone-100 divide-y dark:divide-neutral-700">
|
|
108
|
+
@foreach(products as product)
|
|
109
|
+
<tr class="hover:bg-stone-50/50 dark:hover:bg-neutral-700/50 transition-colors">
|
|
110
|
+
<td class="pl-6 pr-3 py-3.5 text-sm whitespace-nowrap">
|
|
111
|
+
<div class="flex items-center">
|
|
112
|
+
<div class="flex-shrink-0 h-10 w-10">
|
|
113
|
+
<img src="{{ product.image_url }}" alt="{{ product.name }}" class="object-cover h-10 w-10 rounded-lg">
|
|
114
|
+
</div>
|
|
115
|
+
<div class="ml-4">
|
|
116
|
+
<div class="font-medium text-stone-800 dark:text-white">{{ product.name }}</div>
|
|
117
|
+
<div class="mt-1 text-stone-500 text-xs dark:text-neutral-400">
|
|
118
|
+
{{ product.description.substring(0, 50) }}{{ product.description.length > 50 ? '...' : '' }}
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</td>
|
|
123
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-400">
|
|
124
|
+
{{ product.manufacturer?.name || 'N/A' }}
|
|
125
|
+
</td>
|
|
126
|
+
<td class="px-3 py-3.5 text-sm text-stone-500 whitespace-nowrap dark:text-neutral-400">
|
|
127
|
+
{{ product.category?.name || 'N/A' }}
|
|
128
|
+
</td>
|
|
129
|
+
<td class="px-3 py-3.5 text-sm whitespace-nowrap">
|
|
130
|
+
<div class="font-medium text-stone-800 dark:text-white">${{ product.price.toFixed(2) }}</div>
|
|
131
|
+
</td>
|
|
132
|
+
<td class="px-3 py-3.5 text-sm whitespace-nowrap">
|
|
133
|
+
<span class="inline-flex items-center rounded-full px-2 py-1 text-xs font-medium {{ getStatusClass(product.is_available) }}">
|
|
134
|
+
{{ getStatusText(product.is_available) }}
|
|
135
|
+
</span>
|
|
136
|
+
</td>
|
|
137
|
+
<td class="px-3 py-3.5 text-right text-sm text-stone-500 whitespace-nowrap dark:text-neutral-400">{{ product.inventory_count }}</td>
|
|
138
|
+
<td class="px-3 py-3.5 text-right text-sm text-stone-500 whitespace-nowrap dark:text-neutral-400">{{ formatDate(product.created_at) }}</td>
|
|
139
|
+
<td class="relative pl-3 pr-6 py-3.5 font-medium text-right text-sm whitespace-nowrap">
|
|
140
|
+
<div class="flex items-center justify-end space-x-2">
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
class="text-stone-400 dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400 duration-150 transition-colors"
|
|
144
|
+
data-action="view"
|
|
145
|
+
data-product-id="{{ product.id }}"
|
|
146
|
+
>
|
|
147
|
+
<div class="h-5 w-5 i-hugeicons-view"></div>
|
|
148
|
+
</button>
|
|
149
|
+
<button
|
|
150
|
+
type="button"
|
|
151
|
+
class="text-stone-400 dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400 duration-150 transition-colors"
|
|
152
|
+
data-action="edit"
|
|
153
|
+
data-product-id="{{ product.id }}"
|
|
154
|
+
>
|
|
155
|
+
<div class="h-5 w-5 i-hugeicons-edit-01"></div>
|
|
156
|
+
</button>
|
|
157
|
+
</div>
|
|
158
|
+
</td>
|
|
159
|
+
</tr>
|
|
160
|
+
@endforeach
|
|
161
|
+
@if(products.length == 0)
|
|
162
|
+
<tr>
|
|
163
|
+
<td colspan="8" class="px-6 py-8 text-center text-sm text-stone-500 dark:text-neutral-400">
|
|
164
|
+
No products found matching your criteria
|
|
165
|
+
</td>
|
|
166
|
+
</tr>
|
|
167
|
+
@endif
|
|
168
|
+
</tbody>
|
|
169
|
+
</table>
|
|
170
|
+
</div>
|