0.8.9 • Published 3 months ago

@xniffing/request-queue v0.8.9

Weekly downloads
-
License
-
Repository
-
Last release
3 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

3 months ago

0.8.5

3 months ago

0.8.7

3 months ago

0.8.6

3 months ago

0.8.4

4 months ago

0.7.1

4 months ago

0.5.0

4 months ago

0.7.0

4 months ago

0.5.1

4 months ago

0.4.20

4 months ago

0.4.19

4 months ago

0.4.17

4 months ago

0.4.18

4 months ago

0.4.15

4 months ago

0.4.16

4 months ago

0.4.14

4 months ago

0.8.1

4 months ago

0.8.0

4 months ago

0.8.3

4 months ago

0.8.2

4 months ago

0.4.9

4 months ago

0.4.8

4 months ago

0.3.13

4 months ago

0.4.10

4 months ago

0.4.13

4 months ago

0.4.11

4 months ago

0.4.12

4 months ago

0.4.7

4 months ago

0.4.6

4 months ago

0.4.0

4 months ago

0.4.3

4 months ago

0.3.12

4 months ago

0.3.11

4 months ago

0.3.10

4 months ago

0.3.9

4 months ago

0.3.8

4 months ago

0.3.7

4 months ago

0.3.6

4 months ago

0.3.5

4 months ago

0.3.4

4 months ago

0.3.3

4 months ago

0.3.2

5 months ago

0.3.0

5 months ago

0.3.1

5 months ago

0.2.9

5 months ago

0.2.8

5 months ago

0.2.7

5 months ago

0.2.5

5 months ago

0.2.6

5 months ago

0.2.4

5 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.8

5 months ago

0.1.6

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.0.8

5 months ago

0.1.0

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago