定制 khauto/laravel-ui-helper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

khauto/laravel-ui-helper

Composer 安装命令:

composer require khauto/laravel-ui-helper

包简介

Laravel JS helper package for table grouping, sticky headers, and date formatting.

README 文档

README

Author: Md Khairul Hasib
Package: khauto/laravel-ui-helper
Version: 1.0.0

A lightweight Laravel front-end utility script to enhance UI experience.
Includes built-in helpers for form indicators, sticky table headers, date formatting, and dynamic table row grouping — all powered by jQuery.

🚀 Installation

Install the package via Composer:

composer require khauto/laravel-ui-helper

⚙️ Setup

After installation, include the JavaScript helper in your main layout file (e.g. app.blade.php or layouts/app.blade.php):

<script src="{{ asset('vendor/khauto/laravel-ui-helper/ui-helper.js') }}"></script>

Ensure that jQuery and jQuery UI (for datepicker) are loaded before this script.

Example:

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
<script src="{{ asset('vendor/khauto/laravel-ui-helper/ui-helper.js') }}"></script>

🧩 Features

1. Required Field Star

Automatically adds a red * star next to elements marked with .RequiredStar.

<label class="RequiredStar">Name</label>

➡ Output: **Name ***

2. Sticky Table Headers

Keeps table headers visible while scrolling.

<table class="sticky-table" id="exampleTable">
    <thead id="exampleTableHeader">
        <tr><th>Name</th><th>Amount</th></tr>
    </thead>
    <tbody>
        <tr><td>John</td><td>100</td></tr>
        ...
    </tbody>
</table>

When scrolling, the header remains visible until the table ends.

3. Date Formatting Helpers

convertDate(date)

Converts a JavaScript date to dd-mm-yyyy.

convertDate('2025-10-13'); // returns "13-10-2025"

viewDateFormat(date)

Converts a date string (yyyy-mm-dd or dd-mm-yyyy) into a user-friendly dd/mm/yy format using jQuery UI datepicker.

viewDateFormat('2025-10-13'); // returns "13/10/25"

4. Group Table Rows

Merges table rows that have the same content in a given column (like Excel cell grouping).

Example:

groupTableRow('sales-table', [0, 1]);

Parameters:

  • tableClass: the CSS class of your table.
  • columnIndexArray: array of column indexes to group (e.g. [0, 1]).
  • ignoreRowArray (optional): custom text labels to ignore while grouping (default: ["Opening Balance", "Sub Total", "Total", "TOTAL", "SUB TOTAL"]).

Example Table:

<table class="sales-table">
  <tr><td>Product A</td><td>Dhaka</td></tr>
  <tr><td>Product A</td><td>Dhaka</td></tr>
  <tr><td>Product B</td><td>Chittagong</td></tr>
</table>

➡ After running groupTableRow('sales-table', [0, 1]),
rows with duplicate “Product A / Dhaka” will merge automatically with proper rowspan.

📦 Functions Summary

Function Description
convertDate(date) Converts JS date to dd-mm-yyyy
viewDateFormat(date) Formats date for UI (dd/mm/yy)
isRowIgnore(row, ignoreList) Checks if a table row should be ignored
groupTableRow(class, indexArray, ignoreArray) Groups rows with identical cell content
$('.RequiredStar') Appends red * for required fields
.sticky-table Makes table header sticky on scroll

🧰 Dependencies

📄 License

This package is open-source under the MIT license.

👨‍💻 Author

Md Khairul Hasib
📧 hasib.dev.bd@gmail.com
🌐 GitHub: @khauto

💡 Laravel UI Helper is a small front-end utility meant to make your Blade templates cleaner and UI interactions smoother.

khauto/laravel-ui-helper 适用场景与选型建议

khauto/laravel-ui-helper 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 khauto/laravel-ui-helper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 khauto/laravel-ui-helper 我们能提供哪些服务?
定制开发 / 二次开发

基于 khauto/laravel-ui-helper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 19
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-12