@logimaxx/kgrid 0.2.3
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/AGENTS.md +9 -0
- package/LICENSE +34 -0
- package/NOTICE.md +24 -0
- package/README.md +151 -0
- package/dist/kgrid.js +2051 -0
- package/dist/kgrid.min.js +2 -0
- package/docs/ai-guide.md +273 -0
- package/docs/api.md +191 -0
- package/docs/configuration.md +337 -0
- package/docs/field-types.md +92 -0
- package/docs/integration.md +81 -0
- package/docs/table-shell.md +110 -0
- package/integrations/kgrid-plugin-demo-select.js +99 -0
- package/integrations/kgrid-widgets.js +136 -0
- package/integrations/maxxops.example.js +16 -0
- package/package.json +57 -0
- package/src/cells.js +113 -0
- package/src/config.js +59 -0
- package/src/configure.js +136 -0
- package/src/constants.js +113 -0
- package/src/data-body.js +99 -0
- package/src/dom.js +123 -0
- package/src/events.js +100 -0
- package/src/field-types-builtins.js +25 -0
- package/src/field-types.js +228 -0
- package/src/filters.js +394 -0
- package/src/init.js +199 -0
- package/src/insert-row.js +172 -0
- package/src/interaction.js +43 -0
- package/src/labels.js +49 -0
- package/src/table-shell.js +152 -0
- package/styles/table.css +201 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# KGrid — notes for AI assistants
|
|
2
|
+
|
|
3
|
+
**Proprietary (Logimaxx System SRL, Sergiu Voicu).** Maintainer: sergiu@logimaxx.ro — https://logimaxx.ro. Do not suggest open-sourcing, public npm publish, or MIT licensing unless explicitly requested. Branding: [NOTICE.md](NOTICE.md).
|
|
4
|
+
|
|
5
|
+
When changing this repository or integrating **@logimaxx/kgrid** in another app, read:
|
|
6
|
+
|
|
7
|
+
**[docs/ai-guide.md](docs/ai-guide.md)** — integration checklist, config shape, DOM/CSS contract, pitfalls.
|
|
8
|
+
|
|
9
|
+
Human docs: [README.md](README.md), [docs/](docs/).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Proprietary License — KGrid
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024–2026 Logimaxx System SRL. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Author: Sergiu Voicu (sergiu@logimaxx.ro)
|
|
6
|
+
|
|
7
|
+
This software and associated documentation files (the "Software") are the
|
|
8
|
+
proprietary property of Logimaxx System SRL. The Software includes @logimaxx/kgrid and all
|
|
9
|
+
source, build artifacts, styles, and documentation in this repository.
|
|
10
|
+
|
|
11
|
+
GRANT OF LICENSE
|
|
12
|
+
|
|
13
|
+
You may use, copy, and modify the Software only if you have received explicit
|
|
14
|
+
written permission from Logimaxx (for example: employment, contractor agreement,
|
|
15
|
+
partner agreement, or commercial license). Unless such permission is granted,
|
|
16
|
+
no license is granted to you.
|
|
17
|
+
|
|
18
|
+
RESTRICTIONS
|
|
19
|
+
|
|
20
|
+
Without prior written consent from Logimaxx, you must not:
|
|
21
|
+
|
|
22
|
+
- Use the Software for any purpose
|
|
23
|
+
- Copy, distribute, or sublicense the Software or any derivative work
|
|
24
|
+
- Publish the Software or make it available to third parties
|
|
25
|
+
- Remove or alter copyright or proprietary notices
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
30
|
+
LOGIMAXX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
31
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
32
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
33
|
+
|
|
34
|
+
For licensing inquiries: sergiu@logimaxx.ro — https://logimaxx.ro
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# KGrid — notice
|
|
2
|
+
|
|
3
|
+
**@logimaxx/kgrid** — declarative data table for [KViews](https://github.com/logimaxx/kviews.js) (filter, sort, paging, inline CRUD).
|
|
4
|
+
|
|
5
|
+
## Proprietary software
|
|
6
|
+
|
|
7
|
+
Copyright © 2024–2026 **Logimaxx System SRL**. All rights reserved.
|
|
8
|
+
|
|
9
|
+
Use, copy, modification, and distribution require explicit written permission from Logimaxx. See [LICENSE](LICENSE).
|
|
10
|
+
|
|
11
|
+
## Maintainer
|
|
12
|
+
|
|
13
|
+
| | |
|
|
14
|
+
|---|---|
|
|
15
|
+
| **Author** | Sergiu Voicu |
|
|
16
|
+
| **Company** | Logimaxx System SRL |
|
|
17
|
+
| **Website** | [logimaxx.ro](https://logimaxx.ro) |
|
|
18
|
+
| **Email** | [sergiu@logimaxx.ro](mailto:sergiu@logimaxx.ro) |
|
|
19
|
+
|
|
20
|
+
For **licensing**, **security reports**, and **partnership** inquiries, use the email above or your existing Logimaxx business contact.
|
|
21
|
+
|
|
22
|
+
## Stack
|
|
23
|
+
|
|
24
|
+
KGrid is part of the Logimaxx front-end stack for rapid business applications, alongside open-source [**KViews**](https://github.com/logimaxx/kviews.js) and related tooling.
|
package/README.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# KGrid
|
|
2
|
+
|
|
3
|
+
**KGrid** is a declarative data table (JSON configuration) built on [KViews](https://github.com/logimaxx/kviews.js). It supports filtering, sorting, paging, and inline create/update/delete.
|
|
4
|
+
|
|
5
|
+
> **Proprietary — Logimaxx System SRL.** This repository is not open source. Use, copy, and distribution require explicit permission. See [LICENSE](LICENSE) and [NOTICE.md](NOTICE.md).
|
|
6
|
+
|
|
7
|
+
Global entry point: `window.KGrid`
|
|
8
|
+
|
|
9
|
+
## Requirements (peer dependencies)
|
|
10
|
+
|
|
11
|
+
| Dependency | Required | Notes |
|
|
12
|
+
|------------|----------|--------|
|
|
13
|
+
| [jQuery](https://jquery.com/) | Yes | `>= 3.7.0` |
|
|
14
|
+
| [@logimaxx/kviews](https://github.com/logimaxx/kviews.js) | Yes | JSON:API collections, Handlebars templates |
|
|
15
|
+
| Handlebars | Yes (via KViews) | Display templates — use simple `{{field}}` syntax |
|
|
16
|
+
| Custom input types | Optional | `configure({ customInputTypes })` + optional `integrations/kgrid-widgets.js` |
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
Access is limited to authorized Logimaxx projects (private registry, granted GitHub access, or local path).
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Private registry or scoped install (as configured by your organization)
|
|
24
|
+
npm install @logimaxx/kgrid @logimaxx/kviews jquery
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Private Git dependency (requires repository access):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install github:logimaxx/kgrid#main
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Local development:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install file:../kgrid
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<link rel="stylesheet" href="node_modules/@logimaxx/kgrid/styles/table.css">
|
|
43
|
+
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
|
44
|
+
<script src="node_modules/@logimaxx/kviews/dist/kviews.min.js"></script>
|
|
45
|
+
<script src="node_modules/@logimaxx/kgrid/dist/kgrid.js"></script>
|
|
46
|
+
<script src="your-app/kgrid-config.js"></script>
|
|
47
|
+
|
|
48
|
+
<div id="products-grid"></div>
|
|
49
|
+
<script>
|
|
50
|
+
KGrid.init(document.getElementById("products-grid"), { url: "/api/products", /* ... */ });
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
KGrid **generates the table markup** from an HTML template (`KGrid.TABLE_SHELL_TEMPLATE` in `src/table-shell.js`). You provide an empty container, `styles/table.css`, and optionally Bootstrap + Font Awesome for paging/sort icons.
|
|
55
|
+
|
|
56
|
+
### Host configuration (`kgrid-config.js`)
|
|
57
|
+
|
|
58
|
+
Call `KGrid.configure()` **before** mounting any table:
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
KGrid.configure({
|
|
62
|
+
log: console.log.bind(console),
|
|
63
|
+
onError: function (err) { console.error(err); },
|
|
64
|
+
confirm: function (msg, ok, cancel) {
|
|
65
|
+
if (confirm(msg)) ok(); else if (cancel) cancel();
|
|
66
|
+
},
|
|
67
|
+
deleteConfirm: function (context, ok, cancel) {
|
|
68
|
+
if (confirm("Delete this row?")) ok(); else if (cancel) cancel();
|
|
69
|
+
},
|
|
70
|
+
// Optional: ES module apps
|
|
71
|
+
// kviews: KViews,
|
|
72
|
+
// customInputTypes: { select2: KGrid.select2(fn), … } — see docs/integration.md
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
KViews is resolved from `configure({ kviews })`, `window.KViews`, or `KGrid.init(host, { kviews, ... })`.
|
|
77
|
+
|
|
78
|
+
### Standalone init
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
const grid = await KGrid.init(document.getElementById("table-host"), {
|
|
82
|
+
url: "/api/products",
|
|
83
|
+
type: "products",
|
|
84
|
+
columns: [/* ... */],
|
|
85
|
+
});
|
|
86
|
+
// grid.instance, grid.setInteraction("edit"), grid.filterForm, …
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Documentation
|
|
90
|
+
|
|
91
|
+
| Guide | Description |
|
|
92
|
+
|-------|-------------|
|
|
93
|
+
| [AI integration guide](docs/ai-guide.md) | For Cursor/Copilot when using KGrid in other projects |
|
|
94
|
+
| [Configuration reference](docs/configuration.md) | Table options, columns, filters, features |
|
|
95
|
+
| [API reference](docs/api.md) | `KGrid` methods and grid instance API |
|
|
96
|
+
| [Integration guide](docs/integration.md) | `configure()`, KViews, plugins |
|
|
97
|
+
| [Field types](docs/field-types.md) | Native, built-in, plugins (select2, autosuggest, custom) |
|
|
98
|
+
| [Table shell template](docs/table-shell.md) | HTML template, placeholders, custom markup |
|
|
99
|
+
|
|
100
|
+
## API overview
|
|
101
|
+
|
|
102
|
+
| Symbol | Description |
|
|
103
|
+
|--------|-------------|
|
|
104
|
+
| `KGrid.configure(opts)` | Host hooks (`deleteConfirm`, `kviews`, `customInputTypes`, …) |
|
|
105
|
+
| `KGrid.init(host, opts)` | Empty host or existing `<table>`; returns grid API |
|
|
106
|
+
| `KGrid.TABLE_SHELL_TEMPLATE` | Default table HTML (editable) |
|
|
107
|
+
| `KGrid.hasActionColumn(opts)` | Whether a trailing row-actions column is rendered |
|
|
108
|
+
| `KGrid.registerFieldType(name, plugin)` | Custom filter/insert/update widgets |
|
|
109
|
+
| `grid.setInteraction('view' \| 'edit')` | View (data only, full width) or edit (inputs + action buttons) |
|
|
110
|
+
| `grid.instance` | KViews collection |
|
|
111
|
+
| `grid.filterForm` | Programmatic filters |
|
|
112
|
+
|
|
113
|
+
## Demo
|
|
114
|
+
|
|
115
|
+
In-memory JSON:API server + full CRUD UI:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install
|
|
119
|
+
npm run build
|
|
120
|
+
npm run demo # → http://localhost:5173/demo/ (API: /api/products)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
See [demo/README.md](demo/README.md).
|
|
124
|
+
|
|
125
|
+
## Build & test
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm run build # → dist/kgrid.js, dist/kgrid.min.js
|
|
129
|
+
npm test # vitest
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## About Logimaxx
|
|
133
|
+
|
|
134
|
+
| | |
|
|
135
|
+
|---|---|
|
|
136
|
+
| **Product** | KGrid (`@logimaxx/kgrid`) — proprietary |
|
|
137
|
+
| **Company** | [Logimaxx System SRL](https://logimaxx.ro) |
|
|
138
|
+
| **Author** | Sergiu Voicu — [sergiu@logimaxx.ro](mailto:sergiu@logimaxx.ro) |
|
|
139
|
+
| **Stack** | Works with open-source [KViews](https://github.com/logimaxx/kviews.js) |
|
|
140
|
+
|
|
141
|
+
Full notice and contact details: [NOTICE.md](NOTICE.md).
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
Proprietary. Copyright © Logimaxx System SRL. All rights reserved. See [LICENSE](LICENSE).
|
|
146
|
+
|
|
147
|
+
| Document | Purpose |
|
|
148
|
+
|----------|---------|
|
|
149
|
+
| [NOTICE.md](NOTICE.md) | Company, author, contact |
|
|
150
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Internal contribution guidelines |
|
|
151
|
+
| [SECURITY.md](SECURITY.md) | Vulnerability reporting |
|