เอกสาร
DocumentSheet
An issued document, such as a receipt, as it prints: Sarabun on white, the logo and title at the top, the stamp, its lines and the total. Colour appears only in the stamp. The first issue is the original, and every reprint is a copy.
ใช้แสดงเอกสารที่ออกแล้วตามที่พิมพ์ เช่น ใบเสร็จ ใช้ฟอนต์ Sarabun บนพื้นขาว มีสีเฉพาะตรายาง ออกครั้งแรกเป็นต้นฉบับ พิมพ์ซ้ำทุกครั้งเป็นสำเนา Stamp ใช้กับเอกสารเท่านั้น สถานะของรายการบนหน้าจอใช้ Badge
import { DocumentSheet, Stamp } from "@bsru/ui";ตัวอย่าง
ใบเสร็จ ต้นฉบับและสำเนา
lines คือรายละเอียดตามลำดับ total แสดงใต้เส้นหนา stamp เป็น original เมื่อออกครั้งแรก และ copy เมื่อพิมพ์ซ้ำ ลองสลับครั้งที่พิมพ์

ใบเสร็จรับเงินอิเล็กทรอนิกส์
เอกสารจำลอง ใช้เพื่อการทดสอบเท่านั้น
- เลขที่
- RC-2570-0001
- ผู้ชำระ
- นางสาวนักศึกษา ทดสอบ
- รายการ
- ค่าบำรุงหอพัก ภาคเรียนที่ 1/2570
- ชำระโดย
- QR Code
รวมเงิน4,500.00 บาท
<DocumentSheet
title="ใบเสร็จรับเงินอิเล็กทรอนิกส์"
subtitle="เอกสารจำลอง ใช้เพื่อการทดสอบเท่านั้น"
logo={{ src: logo.src, alt: "" }}
stamp={isReprint ? "copy" : "original"}
lines={[
{ label: "เลขที่", value: "RC-2570-0001", numeric: true },
{ label: "ผู้ชำระ", value: "นางสาวนักศึกษา ทดสอบ" },
{ label: "รายการ", value: "ค่าบำรุงหอพัก ภาคเรียนที่ 1/2570" },
{ label: "ชำระโดย", value: "QR Code" },
]}
total={{ label: "รวมเงิน", value: "4,500.00 บาท" }}
/>| Prop | ค่าในตัวอย่างนี้ | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|
| title* จำเป็น | "ใบเสร็จรับเงินอิเล็กทรอนิกส์" | string | The document's name, such as ใบเสร็จรับเงินอิเล็กทรอนิกส์. |
| subtitle | "เอกสารจำลอง ใช้เพื่อการทดสอบเท่านั้น" | string | A line under the title, such as the issuing unit. |
| stamp | "original" | "original" | "copy" ค่าที่ใช้ได้: "original""copy" | original for the first issue, copy for a reprint. Leave it out for a draft. |
| lines* จำเป็น | รายการ 4 รายการ[
{ label: "เลขที่", value: "RC-2570-0001", numeric: true },
{ label: "ผู้ชำระ", value: "นางสาวนักศึกษา ทดสอบ" },
{ label: "รายการ", value: "ค่าบำรุงหอพัก ภาคเรียนที่ 1/2570" },
{ label: "ชำระโดย", value: "QR Code" },
] | readonly DocumentLine[] | The document's details, in order. |
| total | { label: "รวมเงิน", value: "4,500.00 บาท" } | { label: string; value: string } | The total under a heavy rule, such as รวมเงิน and 4,500.00 บาท. |
ตรายางอย่างเดียว
Stamp ใช้คำในภาษาของหน้าจอเมื่อไม่ส่ง label
<Stamp kind="original" />
<Stamp kind="copy" />| Prop | ค่า 1 | ค่า 2 | ชนิดข้อมูล | คำอธิบาย |
|---|---|---|---|---|
| kind* จำเป็น | "original" | "copy" | "original" | "copy" ค่าที่ใช้ได้: "original""copy" | original the first time a document is issued, copy for a reprint. |
props ทั้งหมด
ตัวอย่างด้านบนใช้ props เพียงบางตัว ตารางนี้แสดงทุกตัวที่คอมโพเนนต์รับ พร้อมค่าเริ่มต้นและค่าที่ใช้ได้
DocumentSheet
An issued document, such as a receipt, as it prints: Sarabun on white, the logo and title at the top, the stamp, its lines and the total. Colour appears only in the stamp. The first issue is the original, and every reprint is a copy.
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| title* จำเป็น | string | — | The document's name, such as ใบเสร็จรับเงินอิเล็กทรอนิกส์. |
| subtitle | string | — | A line under the title, such as the issuing unit. |
| logo | { src: string; alt: string } | — | The university's seal. Its alt text can be empty, because the title names the document. |
| stamp | "original" | "copy" | — | original for the first issue, copy for a reprint. Leave it out for a draft. |
| lines* จำเป็น | readonly DocumentLine[] | — | The document's details, in order. |
| total | { label: string; value: string } | — | The total under a heavy rule, such as รวมเงิน and 4,500.00 บาท. |
| className | string | — | A width for the sheet, such as max-w-2xl. |
Stamp
The stamp on an issued document: Original the first time it's issued, and Copy on every reprint. Use it only on documents, never for a record's status on screen.
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| kind* จำเป็น | "original" | "copy" | — | original the first time a document is issued, copy for a reprint. |
| label | string | — | The stamp's word. Defaults to ต้นฉบับ or สำเนา, in the screen language. |
ชนิดข้อมูล
DocumentLine
One line of a DocumentSheet.
| ชื่อ | ชนิดข้อมูล | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| label* จำเป็น | string | — | The line's name, such as เลขที่. |
| value* จำเป็น | string | — | Its value, formatted by the screen, such as RC-2570-0001. |
| numeric | boolean | — | Lines figures up in columns, for numbers and dates. |
ข้อควรปฏิบัติ
- เอกสารที่ออกแล้วแก้ไขไม่ได้ พิมพ์ซ้ำได้เป็นสำเนาเท่านั้น
- ตราของมหาวิทยาลัยมี alt ว่างได้ เพราะชื่อเอกสารบอกแล้วว่าเป็นอะไร
ซอร์สโค้ด: ui/src/marks.tsx