@stacksjs/defaults 0.75.612 → 0.75.614
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/ai/skills/stacks-actions/SKILL.md +209 -1
- package/ai/skills/stacks-api/SKILL.md +1 -1
- package/ai/skills/stacks-buddy/SKILL.md +1 -1
- package/ai/skills/stacks-dashboard/SKILL.md +120 -9
- package/ai/skills/stacks-database/SKILL.md +4 -2
- package/ai/skills/stacks-email/SKILL.md +15 -0
- package/ai/skills/stacks-middleware/SKILL.md +4 -1
- package/ai/skills/stacks-native/CAPABILITIES.md +1 -1
- package/ai/skills/stacks-native/CATALOG.md +12 -12
- package/ai/skills/stacks-validation/SKILL.md +7 -0
- package/app/Actions/Dashboard/Models/ModelDestroyAction.ts +4 -47
- package/app/Actions/Dashboard/Models/ModelSaveAction.ts +257 -0
- package/app/Actions/Dashboard/Models/ModelStoreAction.ts +4 -31
- package/app/Actions/Dashboard/Models/ModelUpdateAction.ts +5 -61
- package/app/Actions/Dashboard/Models/model-related.ts +2 -3
- package/app/Actions/Dashboard/Models/model-row-writes.ts +188 -0
- package/app/Actions/Storefront/AddToCartAction.ts +12 -15
- package/app/Actions/Storefront/CheckoutContactAction.ts +18 -10
- package/app/Actions/Storefront/CheckoutShippingAction.ts +20 -10
- package/app/Actions/Storefront/PlaceOrderAction.ts +9 -12
- package/app/Actions/Storefront/UpdateCartItemAction.ts +11 -9
- package/app/Middleware/Abilities.ts +4 -3
- package/app/Middleware/Csrf.ts +10 -1
- package/app/Middleware/Throttle.ts +4 -4
- package/functions/dashboard-api.ts +9 -3
- package/functions/dashboard-model-bulk.ts +3 -3
- package/functions/dashboard-model-drafts.test.ts +122 -0
- package/functions/dashboard-model-drafts.ts +228 -0
- package/functions/dashboard-model-record.ts +1 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +5 -5
- package/resources/components/Dashboard/Analytics/AnalyticsPageHeader.stx +3 -13
- package/resources/components/Dashboard/App/RequestsOverview.stx +3 -20
- package/resources/components/Dashboard/App/SourceInventory.stx +1 -5
- package/resources/components/Dashboard/Auth/AccessTokenCreateDialog.stx +11 -28
- package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +9 -9
- package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +14 -14
- package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +5 -9
- package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +7 -7
- package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +3 -7
- package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +15 -15
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +5 -9
- package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +12 -15
- package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +4 -28
- package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +15 -15
- package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +3 -11
- package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +8 -9
- package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +3 -20
- package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +4 -4
- package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +14 -14
- package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +14 -24
- package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +5 -43
- package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +22 -38
- package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -33
- package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +16 -30
- package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +4 -28
- package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +15 -9
- package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +8 -9
- package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +14 -12
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +9 -11
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryDialog.stx +15 -9
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +11 -7
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodDialog.stx +14 -8
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +11 -17
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +18 -12
- package/resources/components/Dashboard/Commerce/PaymentRefundDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +5 -5
- package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +4 -8
- package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +5 -9
- package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +2 -10
- package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +14 -67
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +3 -18
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +23 -69
- package/resources/components/Dashboard/Content/AuthorEditorDialog.stx +4 -16
- package/resources/components/Dashboard/Content/BlogDashboard.stx +2 -19
- package/resources/components/Dashboard/Content/BlogPostEditorDialog.stx +31 -51
- package/resources/components/Dashboard/Content/CommentsDashboard.stx +1 -1
- package/resources/components/Dashboard/Content/ContentDashboard.stx +1 -11
- package/resources/components/Dashboard/Content/CreateFolderDialog.stx +1 -4
- package/resources/components/Dashboard/Content/FileManagerDashboard.stx +2 -2
- package/resources/components/Dashboard/Content/PageEditorDialog.stx +8 -17
- package/resources/components/Dashboard/Content/PostEditorDialog.stx +35 -45
- package/resources/components/Dashboard/Content/PostsDashboard.stx +1 -13
- package/resources/components/Dashboard/Content/SeoDashboard.stx +2 -20
- package/resources/components/Dashboard/Content/SeoEditorDialog.stx +4 -38
- package/resources/components/Dashboard/Content/TaxonomyEditorDialog.stx +8 -15
- package/resources/components/Dashboard/Data/ActivityLog.stx +1 -5
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +2 -11
- package/resources/components/Dashboard/Email/InboxMessageList.stx +1 -5
- package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +2 -16
- package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +6 -10
- package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -5
- package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -5
- package/resources/components/Dashboard/Jobs/JobHistory.stx +3 -12
- package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +57 -51
- package/resources/components/Dashboard/Library/ComponentsDashboard.stx +4 -14
- package/resources/components/Dashboard/Library/DependenciesDashboard.stx +2 -15
- package/resources/components/Dashboard/Library/PackagesDashboard.stx +1 -8
- package/resources/components/Dashboard/Library/SourceScaffoldDialog.stx +1 -12
- package/resources/components/Dashboard/Management/PermissionsDashboard.stx +3 -3
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +4 -4
- package/resources/components/Dashboard/Marketing/CampaignDeliveryDialog.stx +3 -5
- package/resources/components/Dashboard/Marketing/CampaignDialog.stx +59 -93
- package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +5 -5
- package/resources/components/Dashboard/Marketing/MarketingListDialog.stx +12 -26
- package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +4 -4
- package/resources/components/Dashboard/Marketing/RecoveryCampaignDialog.stx +12 -43
- package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +7 -41
- package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +5 -5
- package/resources/components/Dashboard/Models/ModelRecordEdit.stx +240 -28
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +7 -23
- package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -12
- package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +4 -27
- package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +4 -36
- package/resources/components/Dashboard/Operations/RecoveryDestinationDialog.stx +18 -47
- package/resources/components/Dashboard/Operations/RecoveryPolicyDialog.stx +24 -78
- package/resources/components/Dashboard/Operations/RecoveryRestoreDialog.stx +8 -19
- package/resources/components/Dashboard/Queries/QueryDashboard.stx +3 -21
- package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +2 -9
- package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -11
- package/resources/components/Dashboard/UI/Input.stx +50 -1
- package/resources/components/Dashboard/UI/SearchFilter.stx +27 -17
- package/resources/components/Dashboard/UI/Select.stx +4 -1
- package/resources/components/Dashboard/UI/Textarea.stx +16 -1
- package/resources/views/cart.stx +14 -0
- package/resources/views/checkout/contact.stx +15 -1
- package/resources/views/checkout/payment.stx +7 -0
- package/resources/views/checkout/shipping.stx +39 -5
- package/routes/dashboard-api.ts +2 -0
|
@@ -89,13 +89,13 @@ function errorMessages(): string[] {
|
|
|
89
89
|
<li :for="message in errorMessages()" :key="message">{{ message }}</li>
|
|
90
90
|
</ul>
|
|
91
91
|
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
<
|
|
92
|
+
<Input v-model:value="name" label="Name" :minLength="2" :maxLength="255" :required="true" />
|
|
93
|
+
<Input v-model:value="email" label="Email" type="email" :required="true" />
|
|
94
|
+
<Input v-model:value="phone" label="Phone (optional)" type="tel" :maxLength="50" />
|
|
95
|
+
<Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'Active', label: 'Active' }, { value: 'Inactive', label: 'Inactive' }]" />
|
|
96
|
+
<Input v-model:value="totalSpent" :label="'Recorded spend (' + currency() + ')'" type="number" min="0" :step="moneyInputStep(currency())" :required="true" />
|
|
97
|
+
<Input v-model:value="lastOrder" label="Last order" type="date" />
|
|
98
|
+
<div class="sm:col-span-2"><Input v-model:value="avatar" label="Avatar URL" type="url" placeholder="https://cdn.example.com/customers/avatar.jpg" :required="true" hint="Use a persisted HTTP asset URL. The dashboard uses initials when rendering the table." /></div>
|
|
99
99
|
</div>
|
|
100
100
|
</form>
|
|
101
101
|
<template #footer>
|
|
@@ -218,13 +218,9 @@ onMount(() => {
|
|
|
218
218
|
|
|
219
219
|
<section class="flex flex-col gap-3">
|
|
220
220
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4">
|
|
221
|
-
<
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
<input x-model="search" type="search" placeholder="Search names, email, or phone" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
225
|
-
</label>
|
|
226
|
-
<label><span class="sr-only">Customer status</span><select x-model="statusFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any status</option><option value="Active">Active</option><option value="Inactive">Inactive</option></select></label>
|
|
227
|
-
<label><span class="sr-only">Sort customers</span><select x-model="sort" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="name">Name</option><option value="spend-high">Highest spend</option><option value="recent-order">Most recent order</option><option value="newest">Newest record</option></select></label>
|
|
221
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search names, email, or phone" ariaLabel="Search customers" /></div>
|
|
222
|
+
<Select v-model:value="statusFilter" ariaLabel="Customer status" placeholder="" :options="[{ value: 'all', label: 'Any status' }, { value: 'Active', label: 'Active' }, { value: 'Inactive', label: 'Inactive' }]" />
|
|
223
|
+
<Select v-model:value="sort" ariaLabel="Sort customers" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'spend-high', label: 'Highest spend' }, { value: 'recent-order', label: 'Most recent order' }, { value: 'newest', label: 'Newest record' }]" />
|
|
228
224
|
</div>
|
|
229
225
|
|
|
230
226
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
@@ -84,8 +84,8 @@ effect(() => {
|
|
|
84
84
|
customerId.set(current?.customerId || '')
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
/** What the initial balance was just changed to, as the input reports it. */
|
|
88
|
+
function syncCurrentBalance(next: string): void {
|
|
89
89
|
if (currentBalance() === previousInitialBalance)
|
|
90
90
|
currentBalance.set(next)
|
|
91
91
|
previousInitialBalance = next
|
|
@@ -165,20 +165,20 @@ function errorMessages(): string[] {
|
|
|
165
165
|
<li :for="message in errorMessages()" :key="message">{{ message }}</li>
|
|
166
166
|
</ul>
|
|
167
167
|
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
|
168
|
-
<
|
|
169
|
-
<
|
|
170
|
-
<
|
|
168
|
+
<div class="sm:col-span-2"><Input v-model:value="code" label="Code" :maxLength="50" :required="true" :spellcheck="false" :monospace="true" class="uppercase" /></div>
|
|
169
|
+
<Input v-model:value="initialBalance" label="Initial balance" type="number" min="0" :step="moneyInputStep(currency())" :required="true" @input="syncCurrentBalance($event)" />
|
|
170
|
+
<Input v-model:value="currentBalance" label="Current balance" :max="initialBalance()" type="number" min="0" :step="moneyInputStep(currency())" :required="true" />
|
|
171
171
|
<p :if="balanceError()" class="sm:col-span-2 -mt-2 text-red-600 text-xs dark:text-red-400">{{ balanceError() }}</p>
|
|
172
|
-
<
|
|
173
|
-
<
|
|
174
|
-
<
|
|
175
|
-
<
|
|
176
|
-
<
|
|
177
|
-
<
|
|
178
|
-
<
|
|
179
|
-
<
|
|
180
|
-
<
|
|
181
|
-
<
|
|
172
|
+
<Input v-model:value="currency" label="Currency" :minLength="3" :maxLength="3" :required="true" :spellcheck="false" :monospace="true" class="uppercase" />
|
|
173
|
+
<Select v-model:value="status" label="Status" placeholder="" :options="[{ value: 'ACTIVE', label: 'Active' }, { value: 'USED', label: 'Used' }, { value: 'EXPIRED', label: 'Expired' }, { value: 'DEACTIVATED', label: 'Deactivated' }]" />
|
|
174
|
+
<Input v-model:value="recipientName" label="Recipient name" placeholder="Optional" />
|
|
175
|
+
<Input v-model:value="recipientEmail" label="Recipient email" type="email" placeholder="Optional" />
|
|
176
|
+
<div class="sm:col-span-2"><Textarea v-model:value="personalMessage" label="Personal message" :rows="3" placeholder="Optional" /></div>
|
|
177
|
+
<Input v-model:value="expiryDate" label="Expiry date" type="datetime-local" />
|
|
178
|
+
<Input v-model:value="lastUsedDate" label="Last used date" type="datetime-local" />
|
|
179
|
+
<Input v-model:value="purchaserId" label="Purchaser ID" placeholder="Optional" :monospace="true" />
|
|
180
|
+
<Input v-model:value="customerId" label="Customer ID" type="number" min="1" step="1" placeholder="Optional" />
|
|
181
|
+
<div class="sm:col-span-2"><Input v-model:value="templateId" label="Template ID" placeholder="Optional" :monospace="true" /></div>
|
|
182
182
|
<div class="grid gap-3 grid-cols-1 sm:col-span-2 sm:grid-cols-3">
|
|
183
183
|
<div class="p-3 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
184
184
|
<Toggle v-model:checked="isActive" label="Enabled" labelPosition="left" />
|
|
@@ -236,15 +236,11 @@ onMount(() => {
|
|
|
236
236
|
|
|
237
237
|
<section class="flex flex-col gap-3">
|
|
238
238
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-6">
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
<label><span class="sr-only">Gift card status</span><select x-model="statusFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All statuses</option><option value="ACTIVE">Active</option><option value="USED">Used</option><option value="EXPIRED">Expired</option><option value="DEACTIVATED">Deactivated</option></select></label>
|
|
245
|
-
<label><span class="sr-only">Gift card availability</span><select x-model="enabledFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any availability</option><option value="enabled">Enabled</option><option value="disabled">Disabled</option></select></label>
|
|
246
|
-
<label><span class="sr-only">Gift card delivery</span><select x-model="deliveryFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any delivery</option><option value="digital">Digital</option><option value="physical">Physical</option></select></label>
|
|
247
|
-
<label><span class="sr-only">Sort gift cards</span><select x-model="sort" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="newest">Newest</option><option value="code">Code</option><option value="balance">Highest balance</option><option value="expiry">Expiry date</option></select></label>
|
|
239
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search codes, recipients, or purchasers" ariaLabel="Search gift cards" /></div>
|
|
240
|
+
<Select v-model:value="statusFilter" ariaLabel="Gift card status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, { value: 'ACTIVE', label: 'Active' }, { value: 'USED', label: 'Used' }, { value: 'EXPIRED', label: 'Expired' }, { value: 'DEACTIVATED', label: 'Deactivated' }]" />
|
|
241
|
+
<Select v-model:value="enabledFilter" ariaLabel="Gift card availability" placeholder="" :options="[{ value: 'all', label: 'Any availability' }, { value: 'enabled', label: 'Enabled' }, { value: 'disabled', label: 'Disabled' }]" />
|
|
242
|
+
<Select v-model:value="deliveryFilter" ariaLabel="Gift card delivery" placeholder="" :options="[{ value: 'all', label: 'Any delivery' }, { value: 'digital', label: 'Digital' }, { value: 'physical', label: 'Physical' }]" />
|
|
243
|
+
<Select v-model:value="sort" ariaLabel="Sort gift cards" placeholder="" :options="[{ value: 'newest', label: 'Newest' }, { value: 'code', label: 'Code' }, { value: 'balance', label: 'Highest balance' }, { value: 'expiry', label: 'Expiry date' }]" />
|
|
248
244
|
</div>
|
|
249
245
|
|
|
250
246
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
@@ -9,7 +9,7 @@ const busy = useReactiveProp('busy', false)
|
|
|
9
9
|
const errors = useReactiveProp('errors', {} as Record<string, string>)
|
|
10
10
|
const emit = defineEmits(['submit', 'close'])
|
|
11
11
|
const name = state('')
|
|
12
|
-
const
|
|
12
|
+
const descriptionText = state('')
|
|
13
13
|
const country = state('')
|
|
14
14
|
const featured = state(false)
|
|
15
15
|
let hydrationKey = ''
|
|
@@ -25,7 +25,7 @@ effect(() => {
|
|
|
25
25
|
return
|
|
26
26
|
hydrationKey = key
|
|
27
27
|
name.set(current?.name || '')
|
|
28
|
-
|
|
28
|
+
descriptionText.set(current?.description || '')
|
|
29
29
|
country.set(current?.country || '')
|
|
30
30
|
featured.set(current?.featured || false)
|
|
31
31
|
})
|
|
@@ -35,7 +35,7 @@ function submit(): void {
|
|
|
35
35
|
return
|
|
36
36
|
emit('submit', {
|
|
37
37
|
manufacturer: name().trim(),
|
|
38
|
-
description:
|
|
38
|
+
description: descriptionText().trim(),
|
|
39
39
|
country: country().trim(),
|
|
40
40
|
featured: featured(),
|
|
41
41
|
})
|
|
@@ -58,18 +58,15 @@ function errorMessages(): string[] {
|
|
|
58
58
|
<li :for="message in errorMessages()" :key="message">{{ message }}</li>
|
|
59
59
|
</ul>
|
|
60
60
|
<div class="space-y-4">
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<span class="font-medium text-gray-700 text-sm dark:text-neutral-200">Country</span>
|
|
71
|
-
<input x-model="country" type="text" maxlength="100" required class="mt-1 px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
72
|
-
</label>
|
|
61
|
+
<div>
|
|
62
|
+
<Input v-model:value="name" label="Name" :maxLength="100" :required="true" />
|
|
63
|
+
</div>
|
|
64
|
+
<div>
|
|
65
|
+
<Textarea v-model:value="descriptionText" label="Description" :rows="4" :maxLength="2000" />
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<Input v-model:value="country" label="Country" :maxLength="100" :required="true" />
|
|
69
|
+
</div>
|
|
73
70
|
<div class="p-3 border border-gray-200 rounded-lg dark:border-neutral-700">
|
|
74
71
|
<Toggle v-model:checked="featured" label="Featured manufacturer" labelPosition="left" />
|
|
75
72
|
</div>
|
|
@@ -194,40 +194,16 @@ onMount(() => {
|
|
|
194
194
|
|
|
195
195
|
<section class="flex flex-col gap-3">
|
|
196
196
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-4">
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
<span class="h-4 w-4 i-hugeicons-search-01"></span>
|
|
201
|
-
</span>
|
|
202
|
-
<input x-model="search" type="search" placeholder="Search manufacturers" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
|
|
203
|
-
</label>
|
|
204
|
-
<label>
|
|
205
|
-
<span class="sr-only">Featured state</span>
|
|
206
|
-
<select x-model="featuredFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
|
|
207
|
-
<option value="all">All manufacturers</option>
|
|
208
|
-
<option value="featured">Featured only</option>
|
|
209
|
-
<option value="not-featured">Not featured</option>
|
|
210
|
-
</select>
|
|
211
|
-
</label>
|
|
212
|
-
<label>
|
|
213
|
-
<span class="sr-only">Country</span>
|
|
214
|
-
<select x-model="countryFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
|
|
215
|
-
<option value="all">All countries</option>
|
|
216
|
-
<option :for="country in countries()" :key="country" :value="country">{{ country }}</option>
|
|
217
|
-
</select>
|
|
218
|
-
</label>
|
|
197
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search manufacturers" ariaLabel="Search manufacturers" /></div>
|
|
198
|
+
<Select v-model:value="featuredFilter" ariaLabel="Featured state" placeholder="" :options="[{ value: 'all', label: 'All manufacturers' }, { value: 'featured', label: 'Featured only' }, { value: 'not-featured', label: 'Not featured' }]" />
|
|
199
|
+
<Select v-model:value="countryFilter" ariaLabel="Country" placeholder="" :options="[{ value: 'all', label: 'All countries' }, ...countries().map(country => ({ value: country, label: country }))]" />
|
|
219
200
|
</div>
|
|
220
201
|
|
|
221
202
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
222
203
|
<p class="text-gray-500 text-sm dark:text-neutral-400">{{ visibleRecords().length }} matching manufacturers</p>
|
|
223
204
|
<label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
|
|
224
205
|
Sort
|
|
225
|
-
<
|
|
226
|
-
<option value="name">Name</option>
|
|
227
|
-
<option value="products">Most products</option>
|
|
228
|
-
<option value="country">Country</option>
|
|
229
|
-
<option value="newest">Newest</option>
|
|
230
|
-
</select>
|
|
206
|
+
<Select v-model:value="sort" ariaLabel="Sort" size="sm" placeholder="" :options="[{ value: 'name', label: 'Name' }, { value: 'products', label: 'Most products' }, { value: 'country', label: 'Country' }, { value: 'newest', label: 'Newest' }]" />
|
|
231
207
|
</label>
|
|
232
208
|
</div>
|
|
233
209
|
|
|
@@ -179,23 +179,23 @@ function errorMessages(): string[] {
|
|
|
179
179
|
</ul>
|
|
180
180
|
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
|
181
181
|
<div class="block">
|
|
182
|
-
<
|
|
183
|
-
<
|
|
182
|
+
<Input v-model:value="customerQuery" label="Customer" type="search" name="customer_search" ariaLabel="Search customers by name or email" placeholder="Search by name or email" @input="searchCustomersSoon()" />
|
|
183
|
+
<div class="mt-2"><Select v-model:value="customerId" ariaLabel="Customer" placeholder="" :options="[{ value: '', label: 'Unassigned customer' }, ...customers().map(option => ({ value: option.id, label: option.label }))]" /></div>
|
|
184
184
|
<p :if="moreCustomersLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreCustomersLabel()"></p>
|
|
185
185
|
</div>
|
|
186
|
-
<
|
|
187
|
-
<
|
|
188
|
-
<
|
|
189
|
-
<
|
|
190
|
-
<
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
<
|
|
194
|
-
<
|
|
195
|
-
<
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
<
|
|
186
|
+
<Select v-model:value="status" label="Status" :required="true" placeholder="" :options="[...statuses().map(option => ({ value: option, label: label(option) }))]" />
|
|
187
|
+
<Select v-model:value="orderType" label="Order type" :required="true" placeholder="" :options="[...orderTypes().map(option => ({ value: option, label: label(option) }))]" />
|
|
188
|
+
<Input v-model:value="currency" label="Currency" :minLength="3" :maxLength="3" :required="true" :spellcheck="false" :monospace="true" class="uppercase" />
|
|
189
|
+
<Input v-model:value="totalAmount" label="Total amount" type="number" min="0" :step="moneyInputStep(currency())" :required="true" />
|
|
190
|
+
<Input v-model:value="taxAmount" label="Tax amount" type="number" min="0" :step="moneyInputStep(currency())" />
|
|
191
|
+
<Input v-model:value="discountAmount" label="Discount amount" type="number" min="0" :step="moneyInputStep(currency())" />
|
|
192
|
+
<Input v-model:value="deliveryFee" label="Delivery fee" type="number" min="0" :step="moneyInputStep(currency())" />
|
|
193
|
+
<Input v-model:value="tipAmount" label="Tip amount" type="number" min="0" :step="moneyInputStep(currency())" />
|
|
194
|
+
<Input v-model:value="estimatedDeliveryTime" label="Estimated delivery time" type="datetime-local" />
|
|
195
|
+
<Input v-model:value="couponId" label="Coupon relation ID" type="number" min="1" step="1" />
|
|
196
|
+
<Input v-model:value="appliedCouponId" label="Applied coupon reference" :monospace="true" />
|
|
197
|
+
<div class="sm:col-span-2"><Textarea v-model:value="deliveryAddress" label="Delivery address" :rows="3" /></div>
|
|
198
|
+
<div class="sm:col-span-2"><Textarea v-model:value="specialInstructions" label="Special instructions" :rows="3" /></div>
|
|
199
199
|
</div>
|
|
200
200
|
</form>
|
|
201
201
|
<template #footer>
|
|
@@ -256,14 +256,10 @@ onMount(() => {
|
|
|
256
256
|
|
|
257
257
|
<section class="flex flex-col gap-3">
|
|
258
258
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-5">
|
|
259
|
-
<
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
</label>
|
|
264
|
-
<label><span class="sr-only">Order status</span><select x-model="statusFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any status</option><option :for="option in statuses()" :key="option" :value="option">{{ label(option) }}</option></select></label>
|
|
265
|
-
<label><span class="sr-only">Order type</span><select x-model="typeFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any order type</option><option :for="option in orderTypes()" :key="option" :value="option">{{ label(option) }}</option></select></label>
|
|
266
|
-
<label><span class="sr-only">Sort orders</span><select x-model="sort" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="newest">Newest first</option><option value="oldest">Oldest first</option><option value="total-high">Highest total</option><option value="total-low">Lowest total</option></select></label>
|
|
259
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search order, customer, status, or address" ariaLabel="Search orders" /></div>
|
|
260
|
+
<Select v-model:value="statusFilter" ariaLabel="Order status" placeholder="" :options="[{ value: 'all', label: 'Any status' }, ...statuses().map(option => ({ value: option, label: label(option) }))]" />
|
|
261
|
+
<Select v-model:value="typeFilter" ariaLabel="Order type" placeholder="" :options="[{ value: 'all', label: 'Any order type' }, ...orderTypes().map(option => ({ value: option, label: label(option) }))]" />
|
|
262
|
+
<Select v-model:value="sort" ariaLabel="Sort orders" placeholder="" :options="[{ value: 'newest', label: 'Newest first' }, { value: 'oldest', label: 'Oldest first' }, { value: 'total-high', label: 'Highest total' }, { value: 'total-low', label: 'Lowest total' }]" />
|
|
267
263
|
</div>
|
|
268
264
|
|
|
269
265
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
@@ -52,8 +52,8 @@ function loadDashboard(): void {
|
|
|
52
52
|
void loadRange(range())
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function reloadSelectedRange(
|
|
56
|
-
void loadRange(
|
|
55
|
+
function reloadSelectedRange(next: string): void {
|
|
56
|
+
void loadRange(next as CommerceDashboardRange)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
onMount(() => {
|
|
@@ -68,15 +68,7 @@ onMount(() => {
|
|
|
68
68
|
<span :if="!loading()" class="h-4 w-4 i-hugeicons-refresh"></span>
|
|
69
69
|
Refresh
|
|
70
70
|
</Button>
|
|
71
|
-
<
|
|
72
|
-
<select id="commerce-dashboard-range" x-model="range" class="block pl-3 pr-10 py-2 text-gray-900 sm:leading-6 sm:text-sm dark:text-white dark:bg-neutral-800 border-0 ring-1 ring-gray-300 ring-inset rounded-md dark:ring-neutral-700 focus:ring-2 focus:ring-blue-600" @change="reloadSelectedRange($event)">
|
|
73
|
-
<option value="today">Today</option>
|
|
74
|
-
<option value="7d">Last 7 days</option>
|
|
75
|
-
<option value="30d">Last 30 days</option>
|
|
76
|
-
<option value="90d">Last 90 days</option>
|
|
77
|
-
<option value="year">Last year</option>
|
|
78
|
-
<option value="all">All time</option>
|
|
79
|
-
</select>
|
|
71
|
+
<Select v-model:value="range" id="commerce-dashboard-range" ariaLabel="Reporting range" placeholder="" :options="[{ value: 'today', label: 'Today' }, { value: '7d', label: 'Last 7 days' }, { value: '30d', label: 'Last 30 days' }, { value: '90d', label: 'Last 90 days' }, { value: 'year', label: 'Last year' }, { value: 'all', label: 'All time' }]" @change="reloadSelectedRange" />
|
|
80
72
|
</div>
|
|
81
73
|
</PageHeader>
|
|
82
74
|
|
|
@@ -185,19 +185,18 @@ onMount(() => {
|
|
|
185
185
|
|
|
186
186
|
<section class="flex flex-col gap-3">
|
|
187
187
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-5">
|
|
188
|
-
<
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
</label>
|
|
193
|
-
<label><span class="sr-only">Payment status</span><select x-model="statusFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All statuses</option><option :for="status in statuses()" :key="status" :value="status">{{ status }}</option></select></label>
|
|
194
|
-
<label><span class="sr-only">Payment method</span><select x-model="methodFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">All methods</option><option :for="method in methods()" :key="method" :value="method">{{ method }}</option></select></label>
|
|
195
|
-
<label><span class="sr-only">Payment time range</span><select x-model="timeRange" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="1">Last 24 hours</option><option value="7">Last 7 days</option><option value="30">Last 30 days</option><option value="90">Last 90 days</option><option value="365">Last year</option><option value="all">All time</option></select></label>
|
|
188
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search payments" ariaLabel="Search payments" /></div>
|
|
189
|
+
<Select v-model:value="statusFilter" ariaLabel="Payment status" placeholder="" :options="[{ value: 'all', label: 'All statuses' }, ...statuses().map(status => ({ value: status, label: status }))]" />
|
|
190
|
+
<Select v-model:value="methodFilter" ariaLabel="Payment method" placeholder="" :options="[{ value: 'all', label: 'All methods' }, ...methods().map(method => ({ value: method, label: method }))]" />
|
|
191
|
+
<Select v-model:value="timeRange" ariaLabel="Payment time range" placeholder="" :options="[{ value: '1', label: 'Last 24 hours' }, { value: '7', label: 'Last 7 days' }, { value: '30', label: 'Last 30 days' }, { value: '90', label: 'Last 90 days' }, { value: '365', label: 'Last year' }, { value: 'all', label: 'All time' }]" />
|
|
196
192
|
</div>
|
|
197
193
|
|
|
198
194
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
199
195
|
<p class="text-gray-500 text-sm dark:text-neutral-400">{{ matchingLabel() }}</p>
|
|
200
|
-
<label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
|
|
196
|
+
<label class="flex gap-2 items-center text-gray-500 text-sm dark:text-neutral-400">
|
|
197
|
+
Sort
|
|
198
|
+
<Select v-model:value="sort" ariaLabel="Sort" size="sm" placeholder="" :options="[{ value: 'newest', label: 'Newest' }, { value: 'oldest', label: 'Oldest' }, { value: 'amount', label: 'Highest amount' }, { value: 'status', label: 'Status' }]" />
|
|
199
|
+
</label>
|
|
201
200
|
</div>
|
|
202
201
|
|
|
203
202
|
<CommercePaymentsTable :sort-reset-key="sort()" :records="records()" :total="total()" :current-page="page()" :per-page="perPage()" :loading="loading()" @view="openDetails" @page-change="changePage" @page-size-change="changePageSize" @sort="changeSort" />
|
|
@@ -40,26 +40,9 @@ function sellable(product: CommercePosProduct): boolean {
|
|
|
40
40
|
|
|
41
41
|
<section class="min-w-0">
|
|
42
42
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 xl:grid-cols-4">
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<input x-model="search" type="search" placeholder="Search products, categories, or allergens" class="pl-9 pr-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" @input="emit('search', $event.target.value)" />
|
|
47
|
-
</label>
|
|
48
|
-
<label>
|
|
49
|
-
<span class="sr-only">Product category</span>
|
|
50
|
-
<select x-model="category" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" @change="emit('category', $event.target.value)">
|
|
51
|
-
<option value="all">Any category</option>
|
|
52
|
-
<option :for="option in categories()" :key="option.id" :value="option.id">{{ option.label }}</option>
|
|
53
|
-
</select>
|
|
54
|
-
</label>
|
|
55
|
-
<label>
|
|
56
|
-
<span class="sr-only">Product availability</span>
|
|
57
|
-
<select x-model="availability" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" @change="emit('availability', $event.target.value)">
|
|
58
|
-
<option value="sellable">Sellable products</option>
|
|
59
|
-
<option value="all">All products</option>
|
|
60
|
-
<option value="unavailable">Unavailable or sold out</option>
|
|
61
|
-
</select>
|
|
62
|
-
</label>
|
|
43
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search products, categories, or allergens" ariaLabel="Search point of sale products" @search="emit('search', $event)" /></div>
|
|
44
|
+
<Select v-model:value="category" ariaLabel="Product category" placeholder="" :options="[{ value: 'all', label: 'Any category' }, ...categories().map(option => ({ value: option.id, label: option.label }))]" @change="emit('category', $event)" />
|
|
45
|
+
<Select v-model:value="availability" ariaLabel="Product availability" placeholder="" :options="[{ value: 'sellable', label: 'Sellable products' }, { value: 'all', label: 'All products' }, { value: 'unavailable', label: 'Unavailable or sold out' }]" @change="emit('availability', $event)" />
|
|
63
46
|
</div>
|
|
64
47
|
|
|
65
48
|
<div :if="loading()" class="flex items-center justify-center mt-4 py-24 text-gray-500 text-sm dark:text-neutral-400 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700"><span class="mr-2 h-4 w-4 animate-spin i-hugeicons-loading-03"></span>Loading persisted products</div>
|
|
@@ -107,10 +107,10 @@ function submit(): void {
|
|
|
107
107
|
<div :if="error()" class="mb-4 p-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">{{ error() }}</div>
|
|
108
108
|
|
|
109
109
|
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
|
110
|
-
<div class="sm:col-span-2"><
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
<
|
|
110
|
+
<div class="sm:col-span-2"><Input v-model:value="customerQuery" label="Customer" type="search" name="customer_search" ariaLabel="Search customers by name, email or phone" placeholder="Search by name, email or phone" @input="searchCustomersSoon()" /><div class="mt-2"><Select v-model:value="customerId" ariaLabel="Customer" placeholder="" :options="[{ value: '', label: 'Guest sale' }, ...customers().map(customer => ({ value: customer.id, label: customer.label + (customer.email ? ' · ' + customer.email : '') }))]" /></div><p :if="moreCustomersLabel()" class="mt-1 text-gray-500 text-xs dark:text-neutral-400" :text="moreCustomersLabel()"></p></div>
|
|
111
|
+
<Select v-model:value="orderType" label="Order type" placeholder="" :options="[{ value: 'TAKEOUT', label: 'Takeout' }, { value: 'DINE_IN', label: 'Dine in' }]" />
|
|
112
|
+
<Select v-model:value="paymentMethod" label="Payment" placeholder="" :options="[...paymentMethods().map(method => ({ value: method.id, label: method.label }))]" />
|
|
113
|
+
<div class="sm:col-span-2"><Textarea v-model:value="specialInstructions" label="Order instructions" :rows="3" :maxLength="1000" placeholder="Optional instructions for the whole sale" /></div>
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
116
|
<dl class="mt-5 p-4 space-y-2 bg-gray-50 dark:bg-neutral-900/60 rounded-lg">
|
|
@@ -21,7 +21,7 @@ const errors = useReactiveProp('errors', {} as Record<string, string>)
|
|
|
21
21
|
const emit = defineEmits(['submit', 'close'])
|
|
22
22
|
const name = state('')
|
|
23
23
|
const slug = state('')
|
|
24
|
-
const
|
|
24
|
+
const descriptionText = state('')
|
|
25
25
|
// The price as typed, in major units ("19.99"). It is stored as integer
|
|
26
26
|
// minor units (1999), converted once in `productWritePayload`.
|
|
27
27
|
const price = state('')
|
|
@@ -51,7 +51,7 @@ effect(() => {
|
|
|
51
51
|
name.set(current?.name || '')
|
|
52
52
|
slug.set(current?.slug || '')
|
|
53
53
|
slugTouched = Boolean(current?.slug)
|
|
54
|
-
|
|
54
|
+
descriptionText.set(current?.description || '')
|
|
55
55
|
price.set(current ? minorToInput(current.price, currency()) : '')
|
|
56
56
|
imageUrl.set(current?.imageUrl || '')
|
|
57
57
|
isAvailable.set(current?.isAvailable ?? true)
|
|
@@ -119,7 +119,7 @@ function submit(): void {
|
|
|
119
119
|
emit('submit', productWritePayload({
|
|
120
120
|
name: name(),
|
|
121
121
|
slug: slugify(slug()),
|
|
122
|
-
description:
|
|
122
|
+
description: descriptionText(),
|
|
123
123
|
price: price(),
|
|
124
124
|
imageUrl: imageUrl(),
|
|
125
125
|
isAvailable: isAvailable(),
|
|
@@ -149,20 +149,20 @@ function errorMessages(): string[] {
|
|
|
149
149
|
<li :for="message in errorMessages()" :key="message">{{ message }}</li>
|
|
150
150
|
</ul>
|
|
151
151
|
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2">
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
<
|
|
152
|
+
<div class="sm:col-span-2"><Input v-model:value="name" label="Name" :maxLength="100" :required="true" /></div>
|
|
153
|
+
<div class="sm:col-span-2"><Input v-model:value="slug" label="Slug" :maxLength="255" :required="true" :spellcheck="false" :monospace="true" :hint="'The storefront address, /products/' + (slug() || 'slug') + '.'" @input="markSlugTouched" @blur="normalizeSlug" /></div>
|
|
154
|
+
<div class="sm:col-span-2"><Textarea v-model:value="descriptionText" label="Description" :rows="3" /></div>
|
|
155
|
+
<Input v-model:value="price" :label="'Price (' + currency() + ')'" type="number" min="0" :step="moneyInputStep(currency())" inputmode="decimal" :required="true" :error="price() !== '' ? priceError() : ''" />
|
|
156
|
+
<Input v-model:value="inventoryCount" label="Inventory count" type="number" min="0" step="1" :required="true" />
|
|
157
|
+
<Input v-model:value="preparationTime" label="Preparation time (minutes)" type="number" min="1" step="1" :required="true" />
|
|
158
158
|
<div class="self-end px-3 py-2 min-h-10 bg-gray-50 dark:bg-neutral-900/60 border border-gray-200 rounded-md dark:border-neutral-700">
|
|
159
159
|
<Toggle v-model:checked="isAvailable" label="Available for commerce" labelPosition="left" />
|
|
160
160
|
</div>
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
<
|
|
165
|
-
<
|
|
161
|
+
<Select v-model:value="categoryId" label="Category" placeholder="" :options="[{ value: '', label: 'Unassigned category' }, ...categories().map(option => ({ value: option.id, label: option.label }))]" />
|
|
162
|
+
<Select v-model:value="manufacturerId" label="Manufacturer" placeholder="" :options="[{ value: '', label: 'Unassigned manufacturer' }, ...manufacturers().map(option => ({ value: option.id, label: option.label }))]" />
|
|
163
|
+
<div class="sm:col-span-2"><Input v-model:value="imageUrl" label="Image URL" type="url" placeholder="Optional persisted asset URL" /></div>
|
|
164
|
+
<div class="sm:col-span-2"><Input v-model:value="allergens" label="Allergens" placeholder="Comma-separated, for example: Gluten, Soy" /></div>
|
|
165
|
+
<div class="sm:col-span-2"><Textarea v-model:value="nutritionalInfo" label="Nutritional information (JSON object)" :rows="4" :spellcheck="false" :monospace="true" :error="nutritionValid() ? '' : 'Enter a valid JSON object.'" /></div>
|
|
166
166
|
</div>
|
|
167
167
|
</form>
|
|
168
168
|
<template #footer>
|
|
@@ -220,14 +220,10 @@ onMount(() => {
|
|
|
220
220
|
|
|
221
221
|
<section class="flex flex-col gap-3">
|
|
222
222
|
<div class="grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-5">
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
</label>
|
|
228
|
-
<label><span class="sr-only">Product category</span><select x-model="categoryFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any category</option><option :for="option in categories()" :key="option.id" :value="option.id">{{ option.label }}</option></select></label>
|
|
229
|
-
<label><span class="sr-only">Product availability</span><select x-model="availabilityFilter" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="all">Any availability</option><option value="available">Available</option><option value="unavailable">Unavailable</option><option value="out-of-stock">Out of stock</option></select></label>
|
|
230
|
-
<label><span class="sr-only">Sort products</span><select x-model="sort" class="px-3 py-2 w-full text-gray-900 text-sm dark:text-white bg-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700"><option value="newest">Newest first</option><option value="oldest">Oldest first</option><option value="name">Name</option><option value="price-high">Highest price</option><option value="price-low">Lowest price</option><option value="inventory-high">Highest inventory</option></select></label>
|
|
223
|
+
<div class="sm:col-span-2"><SearchFilter v-model:searchValue="search" placeholder="Search name, category, manufacturer, or allergen" ariaLabel="Search products" /></div>
|
|
224
|
+
<Select v-model:value="categoryFilter" ariaLabel="Product category" placeholder="" :options="[{ value: 'all', label: 'Any category' }, ...categories().map(option => ({ value: option.id, label: option.label }))]" />
|
|
225
|
+
<Select v-model:value="availabilityFilter" ariaLabel="Product availability" placeholder="" :options="[{ value: 'all', label: 'Any availability' }, { value: 'available', label: 'Available' }, { value: 'unavailable', label: 'Unavailable' }, { value: 'out-of-stock', label: 'Out of stock' }]" />
|
|
226
|
+
<Select v-model:value="sort" ariaLabel="Sort products" placeholder="" :options="[{ value: 'newest', label: 'Newest first' }, { value: 'oldest', label: 'Oldest first' }, { value: 'name', label: 'Name' }, { value: 'price-high', label: 'Highest price' }, { value: 'price-low', label: 'Lowest price' }, { value: 'inventory-high', label: 'Highest inventory' }]" />
|
|
231
227
|
</div>
|
|
232
228
|
|
|
233
229
|
<div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|