@stacksjs/defaults 0.75.528 → 0.75.535
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 +1 -1
- package/ai/skills/stacks-build/SKILL.md +1 -1
- package/ai/skills/stacks-dashboard/SKILL.md +2 -2
- package/ai/skills/stacks-database/SKILL.md +1 -1
- package/ai/skills/stacks-migrations/SKILL.md +2 -2
- package/ai/skills/stacks-native/CATALOG.md +4 -4
- package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +27 -15
- package/app/Actions/Dashboard/Commerce/CommerceCouponsExportAction.ts +45 -0
- package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +22 -12
- package/app/Actions/Dashboard/Commerce/CommerceCustomersExportAction.ts +44 -0
- package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +9 -29
- package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +7 -9
- package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +9 -8
- package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +7 -9
- package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +8 -20
- package/app/Actions/Dashboard/Commerce/commerce-coupon-list.test.ts +203 -0
- package/app/Actions/Dashboard/Commerce/commerce-coupon-list.ts +248 -0
- package/app/Actions/Dashboard/Commerce/commerce-customer-list.test.ts +183 -0
- package/app/Actions/Dashboard/Commerce/commerce-customer-list.ts +186 -0
- package/app/Actions/Dashboard/Commerce/commerce-customer-records.test.ts +1 -34
- package/app/Actions/Dashboard/Commerce/commerce-customer-records.ts +0 -11
- package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.test.ts +118 -0
- package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.ts +41 -0
- package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +17 -5
- package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +17 -3
- package/app/Actions/Dashboard/Commerce/commerce-print-device-list.test.ts +99 -0
- package/app/Actions/Dashboard/Commerce/commerce-print-device-list.ts +18 -0
- package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +5 -5
- package/app/Actions/Dashboard/Commerce/commerce-product-options.test.ts +81 -0
- package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.test.ts +99 -0
- package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.ts +18 -0
- package/app/Actions/Dashboard/Commerce/coupon-records.test.ts +1 -16
- package/app/Actions/Dashboard/Commerce/coupon-records.ts +6 -10
- package/app/Actions/Dashboard/Commerce/manufacturer-records.test.ts +5 -17
- package/app/Actions/Dashboard/Commerce/manufacturer-records.ts +0 -29
- package/app/Actions/Dashboard/Email/captured-mail.test.ts +16 -0
- package/app/Actions/Dashboard/Email/captured-mail.ts +9 -1
- package/app/Actions/Dashboard/Models/model-write.ts +36 -3
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +13 -58
- package/app/Actions/Dashboard/Notifications/notification-delivery-history.ts +74 -0
- package/app/Actions/SitemapAction.ts +3 -1
- package/app/Models/Notification.ts +3 -1
- package/app/Models/NotificationDelivery.ts +4 -0
- package/app/Models/User.ts +10 -1
- package/bootstrap.ts +10 -2
- package/functions/commerce/tax-types.ts +21 -0
- package/functions/dashboard-list.test.ts +16 -0
- package/functions/dashboard-list.ts +14 -6
- package/functions/dashboard-model-record.test.ts +139 -0
- package/functions/dashboard-model-record.ts +353 -0
- package/functions/monitoring/errors.ts +22 -103
- package/functions/notifications/deliveries.ts +7 -38
- package/functions/queries.ts +7 -10
- package/ide/vscode/package.json +1 -1
- package/package.json +5 -5
- package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +2 -2
- package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +22 -28
- package/resources/components/Dashboard/Analytics/EventAnalytics.stx +26 -34
- package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +29 -37
- package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +12 -16
- package/resources/components/Dashboard/Analytics/WebAnalyticsDashboard.stx +43 -53
- package/resources/components/Dashboard/App/RequestsOverview.stx +2 -1
- package/resources/components/Dashboard/App/SourceInventory.stx +2 -1
- package/resources/components/Dashboard/Auth/AccessTokens.stx +3 -5
- package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +9 -11
- package/resources/components/Dashboard/Billing/BillingSettings.stx +1 -1
- package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +4 -6
- package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceCategoriesTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceCategoryHierarchy.stx +3 -5
- package/resources/components/Dashboard/Commerce/CommerceCouponBreakdown.stx +17 -13
- package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +57 -85
- package/resources/components/Dashboard/Commerce/CommerceCouponsTable.stx +32 -9
- package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +49 -83
- package/resources/components/Dashboard/Commerce/CommerceCustomersTable.stx +32 -9
- package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +9 -15
- package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +35 -119
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +3 -5
- package/resources/components/Dashboard/Commerce/CommerceManufacturersTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +4 -4
- package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +42 -129
- package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceOverviewOrdersTable.stx +9 -11
- package/resources/components/Dashboard/Commerce/CommerceOverviewProductsTable.stx +5 -7
- package/resources/components/Dashboard/Commerce/CommerceOverviewStats.stx +14 -16
- package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -18
- package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +41 -120
- package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommercePosCart.stx +13 -15
- package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -19
- package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommercePosReceiptDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceProductDetailDashboard.stx +5 -5
- package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +41 -122
- package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +38 -122
- package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -4
- package/resources/components/Dashboard/Commerce/CommerceTaxesTable.stx +4 -3
- package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +3 -7
- package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +3 -5
- package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +4 -4
- package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +3 -5
- package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/CouriersTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +44 -52
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveriesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +4 -8
- package/resources/components/Dashboard/Commerce/PaymentDetailsDialog.stx +1 -3
- package/resources/components/Dashboard/Commerce/PrintDeviceBreakdown.stx +9 -15
- package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +3 -3
- package/resources/components/Dashboard/Commerce/PrintDevicesTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +3 -9
- package/resources/components/Dashboard/Commerce/PrintLogDetailsDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +4 -4
- package/resources/components/Dashboard/Commerce/PrintLogsTable.stx +8 -10
- package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +37 -109
- package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +38 -112
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +2 -2
- package/resources/components/Dashboard/Content/AuthorsDashboard.stx +4 -4
- package/resources/components/Dashboard/Content/BlogDashboard.stx +4 -4
- package/resources/components/Dashboard/Content/CommentsDashboard.stx +36 -83
- package/resources/components/Dashboard/Content/ContentDashboard.stx +12 -14
- package/resources/components/Dashboard/Content/ContentTaxonomyDashboard.stx +2 -2
- package/resources/components/Dashboard/Content/FileManagerDashboard.stx +8 -12
- package/resources/components/Dashboard/Content/FileStoragePanel.stx +6 -10
- package/resources/components/Dashboard/Content/FileUploadDialog.stx +1 -3
- package/resources/components/Dashboard/Content/PagesDashboard.stx +39 -78
- package/resources/components/Dashboard/Content/PostEditorDialog.stx +4 -8
- package/resources/components/Dashboard/Content/PostsDashboard.stx +44 -85
- package/resources/components/Dashboard/Content/SeoDashboard.stx +5 -4
- package/resources/components/Dashboard/Data/DataRecords.stx +140 -12
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +4 -4
- package/resources/components/Dashboard/Deployments/DeploymentTable.stx +3 -1
- package/resources/components/Dashboard/Elements/DropdownNavigation.stx +5 -7
- package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -3
- package/resources/components/Dashboard/Email/CapturedMailList.stx +18 -20
- package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +24 -28
- package/resources/components/Dashboard/Email/EmailSettingsList.stx +6 -8
- package/resources/components/Dashboard/Email/EmailSettingsNavigation.stx +10 -12
- package/resources/components/Dashboard/Email/EmailSidebar.stx +33 -37
- package/resources/components/Dashboard/Email/InboxMessageDetail.stx +1 -1
- package/resources/components/Dashboard/Email/InboxMessageList.stx +16 -18
- package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
- package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +2 -2
- package/resources/components/Dashboard/GlobalSearch.stx +19 -21
- package/resources/components/Dashboard/Home/DashboardHome.stx +8 -1
- package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +27 -13
- package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +46 -8
- package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
- package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
- package/resources/components/Dashboard/Jobs/JobHistory.stx +44 -57
- package/resources/components/Dashboard/Jobs/JobTable.stx +23 -25
- package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +1 -1
- package/resources/components/Dashboard/Library/ComponentsDashboard.stx +1 -1
- package/resources/components/Dashboard/Management/AssignmentDrawer.stx +5 -7
- package/resources/components/Dashboard/Management/PermissionsDashboard.stx +35 -43
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +11 -13
- package/resources/components/Dashboard/Marketing/CampaignDialog.stx +1 -3
- package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -2
- package/resources/components/Dashboard/Marketing/CampaignsTable.stx +2 -2
- package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
- package/resources/components/Dashboard/Marketing/MarketingListsTable.stx +2 -2
- package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +1 -3
- package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -2
- package/resources/components/Dashboard/Marketing/SocialPostsTable.stx +2 -2
- package/resources/components/Dashboard/Models/ModelRecordActions.stx +11 -2
- package/resources/components/Dashboard/Models/ModelRecordCreate.stx +193 -0
- package/resources/components/Dashboard/Models/ModelRecordDetail.stx +144 -0
- package/resources/components/Dashboard/Models/ModelRecordEdit.stx +176 -0
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +52 -186
- package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -4
- package/resources/components/Dashboard/Monitoring/ErrorDashboard.stx +47 -81
- package/resources/components/Dashboard/Monitoring/ErrorTable.stx +4 -2
- package/resources/components/Dashboard/NotFoundDashboard.stx +4 -4
- package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +43 -77
- package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +15 -17
- package/resources/components/Dashboard/Notifications/NotificationDeliveryTable.stx +1 -1
- package/resources/components/Dashboard/Operations/AuditDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/ChangeDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/IncidentDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/MigrationDashboard.stx +2 -2
- package/resources/components/Dashboard/Operations/RecoveryDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/SchedulerDashboard.stx +1 -1
- package/resources/components/Dashboard/Queries/QueryDashboard.stx +60 -86
- package/resources/components/Dashboard/Queries/QueryDetail.stx +5 -9
- package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +6 -8
- package/resources/components/Dashboard/Remote/RemoteConsole.stx +14 -20
- package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +48 -54
- package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +8 -8
- package/resources/components/Dashboard/Settings/SettingsDashboard.stx +43 -47
- package/resources/components/Dashboard/Teams/TeamInvitationDashboard.stx +2 -2
- package/resources/components/Dashboard/UI/ActivityTable.stx +2 -1
- package/resources/components/Dashboard/UI/Button.stx +15 -0
- package/resources/components/Dashboard/UI/MetricCards.stx +5 -7
- package/resources/components/Dashboard/UI/Pagination.stx +3 -5
- package/resources/components/Dashboard/UI/QuickLinks.stx +2 -2
- package/resources/components/Dashboard/UI/Select.stx +1 -0
- package/resources/components/Dashboard/UI/Table.stx +139 -96
- package/resources/components/Dashboard/UI/Tabs.stx +18 -20
- package/routes/dashboard-api.ts +2 -0
- package/routes/dashboard.ts +246 -253
- package/routes/storefront.ts +31 -0
- package/stx-components-plugin.ts +12 -1
- package/views/dashboard/content/categories/index.stx +1 -1
- package/views/dashboard/content/tags/index.stx +1 -1
- package/views/dashboard/layouts/default.stx +27 -12
- package/views/dashboard/models/[model]/[id]/edit.stx +8 -0
- package/views/dashboard/models/[model]/[id].stx +8 -0
- package/views/dashboard/models/[model]/create.stx +8 -0
- package/resources/components/Dashboard/CreateRecordModal.stx +0 -138
- package/resources/components/Dashboard/Models/EditRecordModal.stx +0 -81
|
@@ -47,6 +47,12 @@ import { parseDashboardDate } from '../../../../functions/dashboard-dates'
|
|
|
47
47
|
interface DashboardTableColumn {
|
|
48
48
|
key: string
|
|
49
49
|
label: string
|
|
50
|
+
/**
|
|
51
|
+
* What the header means, for a label a newcomer may not know (`TTL`, a tax
|
|
52
|
+
* code). The header wears it through `<abbr>`: shown on hover, read out by
|
|
53
|
+
* screen readers, and marked with a dotted underline so it is findable.
|
|
54
|
+
*/
|
|
55
|
+
description?: string
|
|
50
56
|
align?: 'left' | 'center' | 'right'
|
|
51
57
|
sortable?: boolean
|
|
52
58
|
/** Show a filter control for this column in the filter row. */
|
|
@@ -122,6 +128,11 @@ interface DashboardTableColumn {
|
|
|
122
128
|
*/
|
|
123
129
|
currencyKey?: string
|
|
124
130
|
width?: string
|
|
131
|
+
/**
|
|
132
|
+
* Classes for this column's cells. Not its header: a cell's look - a code
|
|
133
|
+
* font for numbers, a muted colour for timestamps - set the header in the
|
|
134
|
+
* same code font and colour, so `Members` read as code.
|
|
135
|
+
*/
|
|
125
136
|
class?: string
|
|
126
137
|
/** Hidden until switched on in the column menu. */
|
|
127
138
|
hidden?: boolean
|
|
@@ -156,8 +167,12 @@ interface DashboardTableRowAction {
|
|
|
156
167
|
action: string
|
|
157
168
|
/** Read out as "<label> <row[actionLabelKey]>", e.g. "Edit Kilogram". */
|
|
158
169
|
label: string
|
|
159
|
-
/**
|
|
160
|
-
|
|
170
|
+
/**
|
|
171
|
+
* Iconify class, e.g. `i-hugeicons-user-remove-01`. Not needed, and not
|
|
172
|
+
* used, for `view`, `edit` and `delete`: those take the dashboard's standard
|
|
173
|
+
* eye, pencil and trash, so the same action looks the same in every table.
|
|
174
|
+
*/
|
|
175
|
+
icon?: string
|
|
161
176
|
/** Colour class for the icon. Defaults to the usual blue. */
|
|
162
177
|
class?: string
|
|
163
178
|
/**
|
|
@@ -187,6 +202,10 @@ const emptyTitle = useReactiveProp('emptyTitle', 'No data')
|
|
|
187
202
|
const emptyDescription = useReactiveProp('emptyDescription', 'There are no items to display.')
|
|
188
203
|
const rowKey = useReactiveProp('rowKey', 'id')
|
|
189
204
|
const hoverable = useReactiveProp('hoverable', true)
|
|
205
|
+
// Its own border, corners and shadow. Off inside a container that already
|
|
206
|
+
// draws them, such as a `Card padding="none"`, which otherwise framed the
|
|
207
|
+
// table twice.
|
|
208
|
+
const framed = useReactiveProp('framed', true)
|
|
190
209
|
|
|
191
210
|
const searchable = useReactiveProp('searchable', false)
|
|
192
211
|
const searchPlaceholder = useReactiveProp('searchPlaceholder', 'Search')
|
|
@@ -457,6 +476,16 @@ const sorted = derived(() => {
|
|
|
457
476
|
/** Rows in the whole result: the server's count when it pages, else what is held. */
|
|
458
477
|
const totalRows = derived(() => (manualPagination() ? Math.max(0, Number(total()) || 0) : sorted().length))
|
|
459
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Whether the pager has anything to do. Rows that all fit on the smallest page
|
|
481
|
+
* size are already on screen, so "Showing 1-5 of 5", a page-size picker and a
|
|
482
|
+
* "1 / 1" between two disabled arrows were three controls for nothing.
|
|
483
|
+
*/
|
|
484
|
+
function needsPager(): boolean {
|
|
485
|
+
const smallest = Math.min(...pageSizeOptions(), pageSize())
|
|
486
|
+
return totalRows() > smallest
|
|
487
|
+
}
|
|
488
|
+
|
|
460
489
|
const pageCount = derived(() => (paginated() ? Math.max(1, Math.ceil(totalRows() / pageSize())) : 1))
|
|
461
490
|
|
|
462
491
|
// A filter that shortens the list must not strand the viewer on a page that
|
|
@@ -637,14 +666,26 @@ function alignClass(align: DashboardTableColumn['align']): string {
|
|
|
637
666
|
return 'text-left'
|
|
638
667
|
}
|
|
639
668
|
|
|
669
|
+
/**
|
|
670
|
+
* The outer columns' padding. A framed table keeps its own 24px left inset. An
|
|
671
|
+
* unframed one sits in a card whose title and search box are inset 20px, so
|
|
672
|
+
* its first and last columns match that instead of drifting 4px either way.
|
|
673
|
+
*/
|
|
674
|
+
function edgePadding(index: number): string {
|
|
675
|
+
const first = index === 0 && !selectable()
|
|
676
|
+
const last = index === visibleColumns().length - 1 && !hasRowActions()
|
|
677
|
+
const left = first ? (framed() ? 'pl-6' : 'pl-5') : 'pl-4'
|
|
678
|
+
const right = last && !framed() ? 'pr-5' : 'pr-4'
|
|
679
|
+
return `${left} ${right}`
|
|
680
|
+
}
|
|
681
|
+
|
|
640
682
|
function headerClass(column: DashboardTableColumn, index: number): string {
|
|
641
683
|
return [
|
|
642
|
-
index
|
|
643
|
-
'
|
|
684
|
+
edgePadding(index),
|
|
685
|
+
'font-semibold text-xs uppercase tracking-wider text-stone-500 dark:text-neutral-400',
|
|
644
686
|
compact() ? 'py-2' : 'py-3.5',
|
|
645
687
|
alignClass(column.align),
|
|
646
688
|
index === 0 && stickyFirstColumn() ? 'sticky left-0 z-20 bg-stone-50 dark:bg-neutral-800' : '',
|
|
647
|
-
column.class || '',
|
|
648
689
|
].filter(Boolean).join(' ')
|
|
649
690
|
}
|
|
650
691
|
|
|
@@ -702,14 +743,26 @@ function rowIsBusy(row: DashboardTableRow): boolean {
|
|
|
702
743
|
return rawValue(row, busyKey() || rowKey()) === value
|
|
703
744
|
}
|
|
704
745
|
|
|
746
|
+
/**
|
|
747
|
+
* The dashboard's three common row actions and how they look everywhere: an
|
|
748
|
+
* eye to view, a pencil to edit, a red trash can to delete. Tables had picked
|
|
749
|
+
* their own - two different pencils and two different bins across 40 tables.
|
|
750
|
+
*/
|
|
751
|
+
const STANDARD_ROW_ACTIONS: Record<string, { icon: string, class: string }> = {
|
|
752
|
+
view: { icon: 'i-hugeicons-view', class: 'text-neutral-500 dark:text-neutral-400' },
|
|
753
|
+
edit: { icon: 'i-hugeicons-pencil-edit-02', class: 'text-blue-500' },
|
|
754
|
+
delete: { icon: 'i-hugeicons-delete-02', class: 'text-red-500' },
|
|
755
|
+
}
|
|
756
|
+
|
|
705
757
|
function rowActionIconClass(action: DashboardTableRowAction): string {
|
|
706
|
-
|
|
758
|
+
const standard = STANDARD_ROW_ACTIONS[action.action]
|
|
759
|
+
return `block h-4 w-4 ${action.class || standard?.class || 'text-blue-500'} ${standard?.icon ?? action.icon ?? ''}`
|
|
707
760
|
}
|
|
708
761
|
|
|
709
762
|
function cellClass(column: DashboardTableColumn, index: number): string {
|
|
710
763
|
return [
|
|
711
|
-
index
|
|
712
|
-
'
|
|
764
|
+
edgePadding(index),
|
|
765
|
+
'text-sm text-stone-700 dark:text-neutral-200',
|
|
713
766
|
compact() ? 'py-2' : 'py-3.5',
|
|
714
767
|
alignClass(column.align),
|
|
715
768
|
column.type === 'number' || column.type === 'currency' ? 'tabular-nums' : '',
|
|
@@ -719,7 +772,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
719
772
|
}
|
|
720
773
|
</script>
|
|
721
774
|
|
|
722
|
-
<div class="overflow-hidden relative bg-white dark:bg-neutral-900 border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm">
|
|
775
|
+
<div class="overflow-hidden relative bg-white dark:bg-neutral-900" :class="framed() ? 'border border-stone-200/80 rounded-xl dark:border-neutral-700 shadow-sm' : ''">
|
|
723
776
|
<div :if="loading()" class="flex absolute inset-0 z-30 items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-sm" role="status">
|
|
724
777
|
<span aria-hidden="true" class="mr-2 h-5 w-5 text-blue-500 animate-spin i-hugeicons-loading-03"></span>
|
|
725
778
|
<span class="text-neutral-500 text-sm dark:text-neutral-400">Loading</span>
|
|
@@ -777,17 +830,15 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
777
830
|
:if="columnMenuOpen()"
|
|
778
831
|
class="absolute right-0 z-40 mt-1 p-2 w-52 bg-white dark:bg-neutral-800 border border-stone-200 rounded-lg dark:border-neutral-700 shadow-lg"
|
|
779
832
|
>
|
|
780
|
-
<
|
|
781
|
-
<
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
</label>
|
|
790
|
-
</template>
|
|
833
|
+
<label :for="column in columns()" class="flex gap-2 items-center px-2 py-1.5 text-neutral-700 text-sm dark:text-neutral-200 hover:bg-stone-50 dark:hover:bg-neutral-700 rounded cursor-pointer">
|
|
834
|
+
<input
|
|
835
|
+
type="checkbox"
|
|
836
|
+
:checked="!hiddenColumns().includes(column.key)"
|
|
837
|
+
@change="toggleColumn(column.key)"
|
|
838
|
+
class="h-3.5 w-3.5 text-blue-600 border-stone-300 rounded dark:border-neutral-600"
|
|
839
|
+
/>
|
|
840
|
+
{{ column.label }}
|
|
841
|
+
</label>
|
|
791
842
|
</div>
|
|
792
843
|
</div>
|
|
793
844
|
|
|
@@ -833,33 +884,35 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
833
884
|
/>
|
|
834
885
|
</th>
|
|
835
886
|
|
|
836
|
-
<
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
887
|
+
<th :for="(column, index) in visibleColumns()"
|
|
888
|
+
scope="col"
|
|
889
|
+
:class="headerClass(column, index)"
|
|
890
|
+
:style="column.width ? 'width: ' + column.width : undefined"
|
|
891
|
+
:aria-sort="ariaSort(column)"
|
|
892
|
+
>
|
|
893
|
+
{{-- `bare`: a header button fills its `<th>` and carries no box
|
|
894
|
+
of its own, so none of the sizes fit. It still comes through
|
|
895
|
+
`UI/Button` for the shared focus ring and disabled handling.
|
|
896
|
+
See stacksjs/stacks#2926. --}}
|
|
897
|
+
<Button
|
|
898
|
+
:if="column.sortable"
|
|
899
|
+
variant="bare"
|
|
900
|
+
:ariaLabel="sortLabel(column)"
|
|
901
|
+
class="inline-flex gap-1.5 items-center hover:text-stone-700 dark:hover:text-neutral-200"
|
|
902
|
+
@click="sort(column)"
|
|
842
903
|
>
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
@click="sort(column)"
|
|
853
|
-
>
|
|
854
|
-
<span>{{ column.label }}</span>
|
|
855
|
-
<span
|
|
856
|
-
aria-hidden="true"
|
|
857
|
-
:class="'h-3.5 w-3.5 ' + (sortKey() === column.key ? (sortDirection() === 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02') : 'opacity-30 i-hugeicons-arrow-up-down')"
|
|
858
|
-
></span>
|
|
859
|
-
</Button>
|
|
904
|
+
<abbr :if="column.description" :title="column.description" class="underline underline-offset-2 cursor-help decoration-dotted">{{ column.label }}</abbr>
|
|
905
|
+
<span :else>{{ column.label }}</span>
|
|
906
|
+
<span
|
|
907
|
+
aria-hidden="true"
|
|
908
|
+
:class="'h-3.5 w-3.5 ' + (sortKey() === column.key ? (sortDirection() === 'asc' ? 'i-hugeicons-arrow-up-02' : 'i-hugeicons-arrow-down-02') : 'opacity-30 i-hugeicons-arrow-up-down')"
|
|
909
|
+
></span>
|
|
910
|
+
</Button>
|
|
911
|
+
<span :else>
|
|
912
|
+
<abbr :if="column.description" :title="column.description" class="underline underline-offset-2 cursor-help decoration-dotted">{{ column.label }}</abbr>
|
|
860
913
|
<span :else>{{ column.label }}</span>
|
|
861
|
-
</
|
|
862
|
-
</
|
|
914
|
+
</span>
|
|
915
|
+
</th>
|
|
863
916
|
|
|
864
917
|
{{-- `$slots` only resolves as a standalone reference: inside a
|
|
865
918
|
compound expression like `$slots.actions || hasRowActions()` the
|
|
@@ -872,39 +925,34 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
872
925
|
<!-- Per-column filter row. -->
|
|
873
926
|
<tr :if="filterable()" class="border-stone-200/70 border-t dark:border-neutral-700">
|
|
874
927
|
<td :if="selectable()" class="pl-6 pr-2 py-2"></td>
|
|
875
|
-
<
|
|
876
|
-
<
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
>
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
|
|
897
|
-
/>
|
|
898
|
-
</td>
|
|
899
|
-
</template>
|
|
928
|
+
<td :for="(column, index) in visibleColumns()" :class="edgePadding(index) + ' py-2'">
|
|
929
|
+
<select
|
|
930
|
+
:if="column.filterable && column.filterOptions"
|
|
931
|
+
:aria-label="'Filter by ' + column.label"
|
|
932
|
+
:value="columnFilters()[column.key] || ''"
|
|
933
|
+
@change="setFilter(column.key, $event)"
|
|
934
|
+
class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
|
|
935
|
+
>
|
|
936
|
+
<option value="">All</option>
|
|
937
|
+
<option :for="option in column.filterOptions" :value="option">{{ option }}</option>
|
|
938
|
+
</select>
|
|
939
|
+
<input
|
|
940
|
+
:else-if="column.filterable"
|
|
941
|
+
type="text"
|
|
942
|
+
:aria-label="'Filter by ' + column.label"
|
|
943
|
+
:placeholder="column.label"
|
|
944
|
+
:value="columnFilters()[column.key] || ''"
|
|
945
|
+
@input="setFilter(column.key, $event)"
|
|
946
|
+
class="px-1.5 py-1 w-full text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
|
|
947
|
+
/>
|
|
948
|
+
</td>
|
|
900
949
|
<td :if="$slots.actions" class="px-4 py-2"></td>
|
|
901
950
|
<td :else-if="hasRowActions()" class="px-4 py-2"></td>
|
|
902
951
|
</tr>
|
|
903
952
|
</thead>
|
|
904
953
|
|
|
905
954
|
<tbody class="divide-stone-100 divide-y dark:divide-neutral-700">
|
|
906
|
-
<
|
|
907
|
-
<tr :class="rowClass(rowIndex)" :data-row-id="String(row[rowKey()])">
|
|
955
|
+
<tr :for="(row, rowIndex) in visibleRows()" :class="rowClass(rowIndex)" :data-row-id="String(row[rowKey()])">
|
|
908
956
|
<td :if="selectable()" class="pl-6 pr-2 w-12" :class="compact() ? 'py-2' : 'py-3.5'">
|
|
909
957
|
<input
|
|
910
958
|
type="checkbox"
|
|
@@ -915,33 +963,31 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
915
963
|
/>
|
|
916
964
|
</td>
|
|
917
965
|
|
|
918
|
-
<
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
<
|
|
925
|
-
<slot name="cell" :row="row" :column="column" :value="row[column.key]">
|
|
926
|
-
<span :if="column.type === 'badge' && hasBadge(row, column)" :class="badgeClass(row, column)">{{ badgeLabel(row, column) }}</span>
|
|
927
|
-
<span :if="column.type !== 'badge'">{{ displayValue(row, column) }}</span>
|
|
928
|
-
<p :if="subtitleValue(row, column)" class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ subtitleValue(row, column) }}</p>
|
|
929
|
-
</slot>
|
|
930
|
-
</template>
|
|
931
|
-
<template :else>
|
|
966
|
+
<td :for="(column, columnIndex) in visibleColumns()" :class="cellClass(column, columnIndex)">
|
|
967
|
+
{{-- No `$slots` here: it only resolves standalone, so the
|
|
968
|
+
compound condition this used to carry made every slotted
|
|
969
|
+
cell render nothing. The slot's own fallback covers the
|
|
970
|
+
"caller gave no slot" case instead. See stacksjs/stx#2098. --}}
|
|
971
|
+
<template :if="column.slotted || !hasSlottedColumns()">
|
|
972
|
+
<slot name="cell" :row="row" :column="column" :value="row[column.key]">
|
|
932
973
|
<span :if="column.type === 'badge' && hasBadge(row, column)" :class="badgeClass(row, column)">{{ badgeLabel(row, column) }}</span>
|
|
933
974
|
<span :if="column.type !== 'badge'">{{ displayValue(row, column) }}</span>
|
|
934
975
|
<p :if="subtitleValue(row, column)" class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ subtitleValue(row, column) }}</p>
|
|
935
|
-
</
|
|
936
|
-
</
|
|
937
|
-
|
|
976
|
+
</slot>
|
|
977
|
+
</template>
|
|
978
|
+
<template :else>
|
|
979
|
+
<span :if="column.type === 'badge' && hasBadge(row, column)" :class="badgeClass(row, column)">{{ badgeLabel(row, column) }}</span>
|
|
980
|
+
<span :if="column.type !== 'badge'">{{ displayValue(row, column) }}</span>
|
|
981
|
+
<p :if="subtitleValue(row, column)" class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">{{ subtitleValue(row, column) }}</p>
|
|
982
|
+
</template>
|
|
983
|
+
</td>
|
|
938
984
|
|
|
939
985
|
<td :if="$slots.actions" class="px-4 w-12" :class="compact() ? 'py-2' : 'py-3'">
|
|
940
986
|
<slot name="actions" :row="row" />
|
|
941
987
|
</td>
|
|
942
988
|
<td :else-if="hasRowActions()" class="px-4 w-12" :class="compact() ? 'py-2' : 'py-3'">
|
|
943
989
|
<div class="flex gap-1 justify-end">
|
|
944
|
-
<
|
|
990
|
+
<span :for="action in rowActions()" class="contents">
|
|
945
991
|
<Button
|
|
946
992
|
:if="showsRowAction(row, action)"
|
|
947
993
|
variant="ghost"
|
|
@@ -953,11 +999,10 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
953
999
|
>
|
|
954
1000
|
<span aria-hidden="true" :class="rowActionIconClass(action)"></span>
|
|
955
1001
|
</Button>
|
|
956
|
-
</
|
|
1002
|
+
</span>
|
|
957
1003
|
</div>
|
|
958
1004
|
</td>
|
|
959
1005
|
</tr>
|
|
960
|
-
</template>
|
|
961
1006
|
</tbody>
|
|
962
1007
|
</table>
|
|
963
1008
|
</div>
|
|
@@ -986,7 +1031,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
986
1031
|
</div>
|
|
987
1032
|
|
|
988
1033
|
<div
|
|
989
|
-
:if="paginated() &&
|
|
1034
|
+
:if="paginated() && needsPager()"
|
|
990
1035
|
class="flex flex-wrap gap-3 items-center justify-between px-4 py-3 bg-neutral-50/50 dark:bg-neutral-800/25 border-neutral-200 border-t dark:border-neutral-700"
|
|
991
1036
|
>
|
|
992
1037
|
<div class="flex gap-3 items-center text-neutral-500 text-sm dark:text-neutral-400">
|
|
@@ -998,9 +1043,7 @@ function cellClass(column: DashboardTableColumn, index: number): string {
|
|
|
998
1043
|
@change="changePageSize($event)"
|
|
999
1044
|
class="px-1.5 py-1 text-xs bg-white dark:bg-neutral-800 border border-stone-300 rounded dark:border-neutral-600"
|
|
1000
1045
|
>
|
|
1001
|
-
<
|
|
1002
|
-
<option :value="String(option)">{{ option }} / page</option>
|
|
1003
|
-
</template>
|
|
1046
|
+
<option :for="option in pageSizeOptions()" :value="String(option)">{{ option }} / page</option>
|
|
1004
1047
|
</select>
|
|
1005
1048
|
</label>
|
|
1006
1049
|
</div>
|
|
@@ -87,25 +87,23 @@ function badgeClass(tab: DashboardTab): string {
|
|
|
87
87
|
</script>
|
|
88
88
|
|
|
89
89
|
<div role="tablist" :class="'flex overflow-x-auto ' + (fullWidth() ? 'w-full ' : '') + containerClasses[variant()]">
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
<button :for="tab in tabs()"
|
|
91
|
+
type="button"
|
|
92
|
+
role="tab"
|
|
93
|
+
:aria-selected="String(activeTab() === tab.id)"
|
|
94
|
+
:aria-controls="tab.panelId || undefined"
|
|
95
|
+
:tabindex="activeTab() === tab.id ? 0 : -1"
|
|
96
|
+
:disabled="Boolean(tab.disabled)"
|
|
97
|
+
:class="tabClass(tab)"
|
|
98
|
+
@click="selectTab(tab)"
|
|
99
|
+
>
|
|
100
|
+
<span :if="tab.icon" :class="tab.icon + ' h-4 w-4'"></span>
|
|
101
|
+
<span>{{ tab.label }}</span>
|
|
102
|
+
<span
|
|
103
|
+
:if="tab.badge !== undefined"
|
|
104
|
+
:class="'inline-flex items-center justify-center px-1.5 h-5 min-w-[1.25rem] font-medium text-xs rounded-full ' + badgeClass(tab)"
|
|
100
105
|
>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
:if="tab.badge !== undefined"
|
|
105
|
-
:class="'inline-flex items-center justify-center px-1.5 h-5 min-w-[1.25rem] font-medium text-xs rounded-full ' + badgeClass(tab)"
|
|
106
|
-
>
|
|
107
|
-
{{ tab.badge }}
|
|
108
|
-
</span>
|
|
109
|
-
</button>
|
|
110
|
-
</template>
|
|
106
|
+
{{ tab.badge }}
|
|
107
|
+
</span>
|
|
108
|
+
</button>
|
|
111
109
|
</div>
|
package/routes/dashboard-api.ts
CHANGED
|
@@ -124,6 +124,7 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
|
|
|
124
124
|
guard(route.patch('/commerce/reviews/{id}', 'Actions/Commerce/ReviewUpdateAction'))
|
|
125
125
|
guard(route.delete('/commerce/reviews/{id}', 'Actions/Commerce/ReviewDestroyAction'))
|
|
126
126
|
guard(route.get('/commerce/coupons', 'Actions/Dashboard/Commerce/CommerceCouponsAction'))
|
|
127
|
+
guard(route.get('/commerce/coupons/export', 'Actions/Dashboard/Commerce/CommerceCouponsExportAction'))
|
|
127
128
|
guard(route.post('/commerce/coupons', 'Actions/Commerce/CouponStoreAction'))
|
|
128
129
|
guard(route.patch('/commerce/coupons/{id}', 'Actions/Commerce/CouponUpdateAction'))
|
|
129
130
|
guard(route.delete('/commerce/coupons/{id}', 'Actions/Commerce/CouponDestroyAction'))
|
|
@@ -137,6 +138,7 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
|
|
|
137
138
|
guard(route.patch('/commerce/categories/{id}', 'Actions/Commerce/Product/ProductCategoryUpdateAction'))
|
|
138
139
|
guard(route.delete('/commerce/categories/{id}', 'Actions/Commerce/Product/ProductCategoryDestroyAction'))
|
|
139
140
|
guard(route.get('/commerce/customers', 'Actions/Dashboard/Commerce/CommerceCustomersAction'))
|
|
141
|
+
guard(route.get('/commerce/customers/export', 'Actions/Dashboard/Commerce/CommerceCustomersExportAction'))
|
|
140
142
|
guard(route.post('/commerce/customers', 'Actions/Commerce/CustomerStoreAction'))
|
|
141
143
|
guard(route.patch('/commerce/customers/{id}', 'Actions/Commerce/CustomerUpdateAction'))
|
|
142
144
|
guard(route.delete('/commerce/customers/{id}', 'Actions/Commerce/CustomerDestroyAction'))
|