0.8.9 • Published 9 months ago

@xniffing/request-queue v0.8.9

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

@xniffing/request-queue

A customizable web component for managing and displaying order requests in a queue format, perfect for restaurants and food delivery services.

npm version

Features

  • 📱 Responsive design
  • 🔄 Real-time status updates
  • 🔍 Search functionality
  • 📊 Detailed order information display
  • 💳 Payment status tracking
  • 📝 Order notes support
  • 🕒 Scheduled delivery times
  • 💶 VAT calculations
  • 🎨 Customizable styling

Installation

NPM

npm install @xniffing/request-queue

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xniffing/request-queue/dist/request-queue.css">
<script src="https://cdn.jsdelivr.net/npm/@xniffing/request-queue"></script>

Usage

  1. Add the component to your HTML:
<peaceui-request-queue id="requestQueue"></peaceui-request-queue>
  1. Initialize with data:
const requestsData = [
  {
    id: 1,
    expanded: false,
    customerName: 'John Doe',
    orderDateTime: '2024-03-20T00:48:00',
    scheduledDateTime: '2024-03-20T01:30:00',
    status: 'Pending',
    items: [
      {
        quantity: 1,
        name: 'Product Name',
        variant: 'Variant',
        price: 10.00
      }
    ],
    subtotal: 10.00,
    vatRate: 23,
    vatAmount: 2.30,
    total: 12.30,
    phone: '123456789',
    email: 'john@example.com',
    address: '123 Main St',
    postalCode: '12345',
    locality: 'City',
    paymentMethod: 'Credit Card',
    paymentStatus: 'Paid',
    notes: 'Delivery instructions',
    fiscalNumber: '123456789'
  }
];

// Dispatch update event
const event = new CustomEvent('update-requests', {
  detail: JSON.stringify(requestsData),
  bubbles: true,
  composed: true
});
document.getElementById('requestQueue').dispatchEvent(event);

Events

Input Events

  • update-requests: Update the queue with new request data
    detail: JSON.stringify(requestsData)

Output Events

  • status-update: Emitted when a request status changes
    detail: {
      requestId: number,
      newStatus: string
    }

Data Structure

Request Object

interface Request {
  id: number;
  expanded: boolean;
  customerName: string;
  orderDateTime: string;
  scheduledDateTime: string | null;
  status: 'Pending' | 'Accepted' | 'Rejected';
  items: OrderItem[];
  subtotal: number;
  vatRate: number;
  vatAmount: number;
  total: number;
  phone: string;
  email: string;
  address: string;
  postalCode: string;
  locality: string;
  paymentMethod: string;
  paymentStatus: 'Paid' | 'Pending';
  notes: string;
  fiscalNumber: string;
}

interface OrderItem {
  quantity: number;
  name: string;
  variant?: string;
  price: number;
}

Styling

The component comes with default styling but can be customized using CSS variables or overriding the following classes:

  • .tag: Style for status and payment tags
  • .tag-container: Container for tags
  • .search-bar: Search input container
  • .form-control: Form input styling

Browser Support

  • Chrome (and Chromium-based browsers)
  • Firefox
  • Safari
  • Edge

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Support

For support, please open an issue in the GitHub repository or contact support email.

0.8.9

9 months ago

0.8.5

9 months ago

0.8.7

9 months ago

0.8.6

9 months ago

0.8.4

9 months ago

0.7.1

9 months ago

0.5.0

9 months ago

0.7.0

9 months ago

0.5.1

9 months ago

0.4.20

9 months ago

0.4.19

9 months ago

0.4.17

9 months ago

0.4.18

9 months ago

0.4.15

9 months ago

0.4.16

9 months ago

0.4.14

9 months ago

0.8.1

9 months ago

0.8.0

9 months ago

0.8.3

9 months ago

0.8.2

9 months ago

0.4.9

9 months ago

0.4.8

9 months ago

0.3.13

10 months ago

0.4.10

9 months ago

0.4.13

9 months ago

0.4.11

9 months ago

0.4.12

9 months ago

0.4.7

9 months ago

0.4.6

9 months ago

0.4.0

9 months ago

0.4.3

9 months ago

0.3.12

10 months ago

0.3.11

10 months ago

0.3.10

10 months ago

0.3.9

10 months ago

0.3.8

10 months ago

0.3.7

10 months ago

0.3.6

10 months ago

0.3.5

10 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.3.2

10 months ago

0.3.0

10 months ago

0.3.1

10 months ago

0.2.9

10 months ago

0.2.8

10 months ago

0.2.7

10 months ago

0.2.5

10 months ago

0.2.6

10 months ago

0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.1.8

10 months ago

0.1.6

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.0.8

10 months ago

0.1.0

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago