@fui-org/fui-cli 1.3.2 → 2.1.0
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/README.md +21 -3
- package/dist/fui-cx180e19.js +379 -0
- package/dist/fui.js +1 -1
- package/package.json +3 -6
- package/skills/fui/SKILL.md +9 -41
- package/skills/fui-skill/SKILL.md +95 -225
- package/skills/fui-skill/assets/projectdefaultstyle-3.0.css +555 -0
- package/skills/fui-skill/assets/projectdefaultstyle.css +207 -235
- package/skills/fui-skill/references/INDEX.md +105 -137
- package/skills/fui-skill/references/advanced-techniques.md +76 -68
- package/skills/fui-skill/references/coding-standards.md +56 -56
- package/skills/fui-skill/references/component-design.md +166 -173
- package/skills/fui-skill/references/component-quickref.md +61 -60
- package/skills/fui-skill/references/component-table.md +128 -117
- package/skills/fui-skill/references/components-dialog.md +55 -56
- package/skills/fui-skill/references/components-display.md +24 -30
- package/skills/fui-skill/references/components-echart.md +186 -261
- package/skills/fui-skill/references/components-input.md +72 -96
- package/skills/fui-skill/references/controls-patterns.md +196 -342
- package/skills/fui-skill/references/controls-styling-vocabulary.md +130 -97
- package/skills/fui-skill/references/db-table-design.md +24 -28
- package/skills/fui-skill/references/db-workflow.md +191 -390
- package/skills/fui-skill/references/default-function.md +169 -128
- package/skills/fui-skill/references/design-modes.md +35 -63
- package/skills/fui-skill/references/echart-templates.md +204 -196
- package/skills/fui-skill/references/fastproject.md +62 -60
- package/skills/fui-skill/references/fsheet.md +109 -124
- package/skills/fui-skill/references/fullstack-workflow.md +90 -128
- package/skills/fui-skill/references/module-data-patterns.md +31 -40
- package/skills/fui-skill/references/module-json-anatomy.md +47 -52
- package/skills/fui-skill/references/module-structure.md +80 -196
- package/skills/fui-skill/references/new-session.md +49 -51
- package/skills/fui-skill/references/pdfmake.md +17 -17
- package/skills/fui-skill/references/permission-system.md +89 -108
- package/skills/fui-skill/references/platform-architecture.md +128 -153
- package/skills/fui-skill/references/project-config.md +102 -134
- package/skills/fui-skill/references/project-provisioning.md +139 -244
- package/skills/fui-skill/references/script-map.md +208 -242
- package/skills/fui-skill/references/sql-clr-functions.md +98 -97
- package/skills/fui-skill/references/system-design.md +63 -88
- package/skills/fui-skill/references/tapi-file-api.md +46 -52
- package/skills/fui-skill/references/tapi-permission-patterns.md +51 -53
- package/skills/fui-skill/references/tapi-reference.md +132 -207
- package/skills/fui-skill/references/tools-registry.md +84 -460
- package/skills/fui-skill/references/ui-crosswindow-patterns.md +79 -75
- package/skills/fui-skill/references/ui-dialog-patterns.md +98 -72
- package/skills/fui-skill/references/ui-layout-patterns.md +26 -26
- package/skills/fui-skill/references/ui-patterns.md +71 -83
- package/skills/fui-skill/references/ui-screenshot-review.md +63 -62
- package/skills/fui-skill/references/ui-table-cell-patterns.md +61 -59
- package/skills/fui-skill/references/ui-templates.md +16 -23
- package/skills/fui-skill/references/verification.md +236 -246
- package/skills/fui-skill/references/watcher-patterns.md +30 -63
- package/skills/fui-skill/references/websocket-realtime.md +83 -66
- package/skills/fui-skill/scripts/component-3.0.js +298 -131
- package/skills/fui-skill/scripts/component.js +277 -271
- package/skills/fui-skill/scripts/componentTable-3.0.js +182 -53
- package/skills/fui-skill/scripts/componentTable.js +171 -49
- package/skills/fui-skill/scripts/defaultfunction-3.0.js +88 -3
- package/skills/fui-skill/scripts/defaultfunction.js +88 -3
- package/skills/fui-skill/scripts/fsheet.js +38 -0
- package/skills/fui-target/.claude-plugin/plugin.json +6 -0
- package/skills/fui-target/hooks/hooks.json +1 -0
- package/skills/fui-target/hooks/register.tsx +71 -0
- package/skills/fui-target/types/index.d.ts +7 -0
- package/dist/fui-y8an39cn.js +0 -420
- package/skills/fui-skill/README.md +0 -112
- package/skills/fui-skill/metadata.json +0 -75
- package/skills/fui-skill-cli/SKILL.md +0 -139
- package/skills/fui-skill-cli/references/INDEX.md +0 -110
- package/skills/fui-skill-cli/references/advanced-techniques.md +0 -168
- package/skills/fui-skill-cli/references/coding-standards.md +0 -112
- package/skills/fui-skill-cli/references/component-design.md +0 -448
- package/skills/fui-skill-cli/references/component-quickref.md +0 -78
- package/skills/fui-skill-cli/references/component-table.md +0 -248
- package/skills/fui-skill-cli/references/components-dialog.md +0 -191
- package/skills/fui-skill-cli/references/components-display.md +0 -141
- package/skills/fui-skill-cli/references/components-echart.md +0 -316
- package/skills/fui-skill-cli/references/components-input.md +0 -335
- package/skills/fui-skill-cli/references/controls-patterns.md +0 -701
- package/skills/fui-skill-cli/references/controls-styling-vocabulary.md +0 -137
- package/skills/fui-skill-cli/references/db-table-design.md +0 -73
- package/skills/fui-skill-cli/references/db-workflow.md +0 -288
- package/skills/fui-skill-cli/references/default-function.md +0 -425
- package/skills/fui-skill-cli/references/design-modes.md +0 -57
- package/skills/fui-skill-cli/references/echart-templates.md +0 -489
- package/skills/fui-skill-cli/references/fastproject.md +0 -99
- package/skills/fui-skill-cli/references/fsheet.md +0 -203
- package/skills/fui-skill-cli/references/fullstack-workflow.md +0 -313
- package/skills/fui-skill-cli/references/module-data-patterns.md +0 -117
- package/skills/fui-skill-cli/references/module-json-anatomy.md +0 -132
- package/skills/fui-skill-cli/references/module-structure.md +0 -141
- package/skills/fui-skill-cli/references/new-session.md +0 -85
- package/skills/fui-skill-cli/references/pdfmake.md +0 -60
- package/skills/fui-skill-cli/references/permission-system.md +0 -150
- package/skills/fui-skill-cli/references/platform-architecture.md +0 -269
- package/skills/fui-skill-cli/references/project-config.md +0 -303
- package/skills/fui-skill-cli/references/project-provisioning.md +0 -278
- package/skills/fui-skill-cli/references/script-map.md +0 -262
- package/skills/fui-skill-cli/references/sql-clr-functions.md +0 -225
- package/skills/fui-skill-cli/references/system-design.md +0 -89
- package/skills/fui-skill-cli/references/tapi-file-api.md +0 -185
- package/skills/fui-skill-cli/references/tapi-permission-patterns.md +0 -156
- package/skills/fui-skill-cli/references/tapi-reference.md +0 -474
- package/skills/fui-skill-cli/references/tools-registry.md +0 -84
- package/skills/fui-skill-cli/references/ui-crosswindow-patterns.md +0 -321
- package/skills/fui-skill-cli/references/ui-dialog-patterns.md +0 -255
- package/skills/fui-skill-cli/references/ui-layout-patterns.md +0 -176
- package/skills/fui-skill-cli/references/ui-patterns.md +0 -303
- package/skills/fui-skill-cli/references/ui-screenshot-review.md +0 -95
- package/skills/fui-skill-cli/references/ui-table-cell-patterns.md +0 -318
- package/skills/fui-skill-cli/references/ui-templates.md +0 -22
- package/skills/fui-skill-cli/references/verification.md +0 -236
- package/skills/fui-skill-cli/references/watcher-patterns.md +0 -163
- package/skills/fui-skill-cli/references/websocket-realtime.md +0 -271
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
# module.json Anatomy —
|
|
1
|
+
# module.json Anatomy — data · watch · controls · set
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Owns: **the 4 `module.json` blocks (data/watch/controls/set) — roles, interaction, structure checklist**. Action/control syntax: [controls-patterns.md](controls-patterns.md).
|
|
4
4
|
|
|
5
|
-
`module.json`
|
|
6
|
-
|
|
7
|
-
> Cơ chế nền tảng (runtime đọc module.json thế nào): [platform-architecture.md](platform-architecture.md). Pattern UI thực tế (ưu tiên cao, đã tinh chỉnh qua thực chiến): [ui-patterns.md](ui-patterns.md).
|
|
5
|
+
`module.json` describes one FUI page with exactly **4 top-level blocks**. Runtime internals: [platform-architecture.md](platform-architecture.md). Battle-tested UI patterns (high priority): [ui-patterns.md](ui-patterns.md).
|
|
8
6
|
|
|
9
7
|
```json
|
|
10
8
|
{
|
|
11
|
-
"data":
|
|
12
|
-
"watch":
|
|
13
|
-
"controls": [
|
|
14
|
-
"set":
|
|
9
|
+
"data": [/* state + action */],
|
|
10
|
+
"watch": {/* observer → action */},
|
|
11
|
+
"controls": [/* layout UI: container > rows > cols */],
|
|
12
|
+
"set": {/* override config trang (tùy chọn) */}
|
|
15
13
|
}
|
|
16
14
|
```
|
|
17
15
|
|
|
18
|
-
Runtime
|
|
16
|
+
Runtime order: `runAction(data)` → `buildModuleUI(controls)` → attach `watch` → merge `set` into page config. All state lives in `vueData`.
|
|
19
17
|
|
|
20
18
|
---
|
|
21
19
|
|
|
22
|
-
## 1. `data` —
|
|
23
|
-
|
|
24
|
-
**Là gì:** một **mảng**. FUI xử lý tuần tự từ trên xuống khi trang load.
|
|
20
|
+
## 1. `data` — state init + action definitions
|
|
25
21
|
|
|
26
|
-
**
|
|
22
|
+
An **array**, processed top to bottom on page load. Three element kinds:
|
|
27
23
|
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
| Named action | Key
|
|
32
|
-
| Auto-startup | `{ "API": ... }`
|
|
24
|
+
| Object kind | Recognized by | Effect |
|
|
25
|
+
| ------------ | ------------------------------------------------ | ----------------------------------- |
|
|
26
|
+
| State init | No action key (`API`/`CALL`/`IF`...) | Creates reactive var in `vueData` |
|
|
27
|
+
| Named action | Key = function name, value = action object | Reusable action (invoke via `CALL`) |
|
|
28
|
+
| Auto-startup | Standalone `{ "API": ... }` or `{ "CALL": ... }` | **Runs immediately** on load |
|
|
33
29
|
|
|
34
30
|
```json
|
|
35
31
|
"data": [
|
|
@@ -41,15 +37,15 @@ Runtime chạy: `runAction(data)` → `buildModuleUI(controls)` → gắn `watch
|
|
|
41
37
|
]
|
|
42
38
|
```
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
Named actions are callable from `watch`, `controls` or other actions; trailing auto-startup = initial page data.
|
|
45
41
|
|
|
46
|
-
|
|
42
|
+
Details: `data[]` declaration + value resolution (string/var/backtick/`{{ }}`/deep key, auto-run, named action, `v_old`) → **[module-data-patterns.md](module-data-patterns.md)**; action engine → [controls-patterns.md](controls-patterns.md); real-world data layout → [ui-patterns.md](ui-patterns.md) §1–2.
|
|
47
43
|
|
|
48
44
|
---
|
|
49
45
|
|
|
50
|
-
## 2. `watch` —
|
|
46
|
+
## 2. `watch` — state change → run action
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
An **object** `{ "varName": action }`; action runs when the var changes.
|
|
53
49
|
|
|
54
50
|
```json
|
|
55
51
|
"watch": {
|
|
@@ -59,18 +55,17 @@ Runtime chạy: `runAction(data)` → `buildModuleUI(controls)` → gắn `watch
|
|
|
59
55
|
}
|
|
60
56
|
```
|
|
61
57
|
|
|
62
|
-
**
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
- **`deep-watch`**: theo dõi thay đổi sâu bên trong object/array (runtime hỗ trợ key `deep-watch`).
|
|
58
|
+
- **Cascading filter**: one watch per filter dropdown → table reloads on change.
|
|
59
|
+
- Multiple actions for one var → use an **array**.
|
|
60
|
+
- **`deep-watch`**: tracks nested changes inside object/array (runtime supports the `deep-watch` key).
|
|
66
61
|
|
|
67
|
-
|
|
62
|
+
Details: [watcher-patterns.md](watcher-patterns.md) (v_old, deep-watch, cascading), [ui-patterns.md](ui-patterns.md) §3.
|
|
68
63
|
|
|
69
64
|
---
|
|
70
65
|
|
|
71
|
-
## 3. `controls` —
|
|
66
|
+
## 3. `controls` — UI layout (mandatory grid container > rows > cols)
|
|
72
67
|
|
|
73
|
-
|
|
68
|
+
An **array** of containers. Runtime builds `container (v-container)` → `rows (v-layout)` → `cols` → each item is a **Control Object**.
|
|
74
69
|
|
|
75
70
|
```json
|
|
76
71
|
"controls": [
|
|
@@ -83,25 +78,25 @@ Runtime chạy: `runAction(data)` → `buildModuleUI(controls)` → gắn `watch
|
|
|
83
78
|
]
|
|
84
79
|
```
|
|
85
80
|
|
|
86
|
-
|
|
81
|
+
Control Object keys:
|
|
87
82
|
|
|
88
|
-
| Key
|
|
89
|
-
|
|
90
|
-
| `el`
|
|
91
|
-
| `attr`
|
|
92
|
-
| `w`
|
|
93
|
-
| `col`
|
|
94
|
-
| `innerHTML` |
|
|
83
|
+
| Key | Role |
|
|
84
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `el` | Tag/component: `div`, `v-*` (Vuetify), `f-*`/`t-*` (FUI), `uc-*` (custom) |
|
|
86
|
+
| `attr` | Attributes/directives (`class`, `style`, `v-model`, `v-on:click`) — **use `v-on:click`, NOT `@click`** |
|
|
87
|
+
| `w` | Column width: `1–12` (grid) or `>= 25` (px, **requires `col: { "class": "shrink" }`**). Never 13–24. Required for every item in `cols` |
|
|
88
|
+
| `col` | Wrapping grid column config (`class`, `style`, `v-if`) |
|
|
89
|
+
| `innerHTML` | Content: string (supports `{{ }}`) or array of nested Control Objects |
|
|
95
90
|
|
|
96
|
-
|
|
91
|
+
Mandatory: always start with the grid wrapper; nest via `innerHTML` (array), never `children`; put dialogs in a container with `prop: "hidden-container"`.
|
|
97
92
|
|
|
98
|
-
|
|
93
|
+
Details: structure & grid → [controls-patterns.md](controls-patterns.md) §6; **allowed class/prop/style (don't invent styles)** → [controls-styling-vocabulary.md](controls-styling-vocabulary.md); picking components → [component-quickref.md](component-quickref.md); layout/table/dialog patterns → [ui-patterns.md](ui-patterns.md), [ui-table-cell-patterns.md](ui-table-cell-patterns.md), [ui-dialog-patterns.md](ui-dialog-patterns.md), [ui-layout-patterns.md](ui-layout-patterns.md).
|
|
99
94
|
|
|
100
95
|
---
|
|
101
96
|
|
|
102
|
-
## 4. `set` —
|
|
97
|
+
## 4. `set` — per-page config override (optional)
|
|
103
98
|
|
|
104
|
-
|
|
99
|
+
An **object** overriding project config for this page. Runtime merges `project.json` then `set` (module wins) — see [platform-architecture.md](platform-architecture.md) §2.1.
|
|
105
100
|
|
|
106
101
|
```json
|
|
107
102
|
"set": {
|
|
@@ -110,13 +105,13 @@ Runtime chạy: `runAction(data)` → `buildModuleUI(controls)` → gắn `watch
|
|
|
110
105
|
}
|
|
111
106
|
```
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
Declare only fields differing from the project. Common: `title`, `menu: false` (hide header — sub-window/landing), `menuLeft` (own sidebar), `apiDomain` (different backend for this page). Normal pages **need no `set`**.
|
|
114
109
|
|
|
115
|
-
|
|
110
|
+
Full property list: [project-config.md](project-config.md).
|
|
116
111
|
|
|
117
112
|
---
|
|
118
113
|
|
|
119
|
-
##
|
|
114
|
+
## How the 4 blocks interact
|
|
120
115
|
|
|
121
116
|
```
|
|
122
117
|
URL ?param ──► vueData[param] (inject trước khi data chạy)
|
|
@@ -126,12 +121,12 @@ watch ──► state đổi → chạy action → cập nhật state kh
|
|
|
126
121
|
set ──► quyết định khung trang (title/menu/apiDomain) bao quanh controls
|
|
127
122
|
```
|
|
128
123
|
|
|
129
|
-
|
|
124
|
+
Typical loop: user acts on `controls` → state changes → `watch` fires → `API` action in `data` → `OUT` updates state → `controls` re-render.
|
|
130
125
|
|
|
131
|
-
## Checklist
|
|
126
|
+
## Checklist
|
|
132
127
|
|
|
133
|
-
1. `data[]`: state
|
|
134
|
-
2. `watch`:
|
|
135
|
-
3. `controls`:
|
|
136
|
-
4. `set`:
|
|
137
|
-
5.
|
|
128
|
+
1. `data[]`: state first → named actions → `{ "CALL": ... }` auto-startup last
|
|
129
|
+
2. `watch`: every filter/dropdown has a watch → reload
|
|
130
|
+
3. `controls`: start with grid wrapper; `w` on every item; dialogs in `hidden-container`; `v-on:click` not `@click`
|
|
131
|
+
4. `set`: only when the page differs from project defaults
|
|
132
|
+
5. Reference state as `vueData.` in controls/attr; valid JSON (no trailing commas)
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
# Module Structure
|
|
1
|
+
# Module Structure
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Owns: project/module tree, per-file duties, `_moduleInfo.json`/`mTitle`, `HTMLOnly`, default meta tags. `uc-*.vue` rules: [component-design.md](component-design.md); `module.json` content: [controls-patterns.md](controls-patterns.md). _(Tier A — loaded with `fui skill get`.)_
|
|
4
4
|
|
|
5
|
-
Use
|
|
5
|
+
Use when creating, refactoring or reviewing a module. With workspace access it is the real folder layout; in chat, use it to organize the response without assuming files exist.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- In chat or agent-chat contexts, use it to virtualize the same module structure and organize the response, without assuming the files already exist on disk.
|
|
7
|
+
## Local Structure
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
The workspace is organized at two levels: **project** and **module**.
|
|
13
|
-
|
|
14
|
-
### Project-level (root of a checked-out project)
|
|
9
|
+
### Project-level
|
|
15
10
|
|
|
16
11
|
```text
|
|
17
12
|
{projectId}/
|
|
@@ -22,20 +17,23 @@ The workspace is organized at two levels: **project** and **module**.
|
|
|
22
17
|
|-- components/ # Project-scope Vue components
|
|
23
18
|
| |-- _components.json # Component registry
|
|
24
19
|
| `-- uc-*.vue # Project-level custom components
|
|
20
|
+
|-- _db/ # Local DB workspace (see db-workflow.md)
|
|
21
|
+
| |-- _connections.json # v2 registry; key = friendly connectionName/folder
|
|
22
|
+
| `-- {connectionName}/ # schema.json + stored-procedure .sql files
|
|
25
23
|
|-- modules/ # All modules in this project
|
|
26
24
|
| |-- _modules.json # Module list metadata
|
|
27
25
|
| `-- {moduleId}/ # One folder per module (see module-level below)
|
|
28
26
|
`-- skills/ # FUI skill files (auto-copied on checkout)
|
|
29
27
|
```
|
|
30
28
|
|
|
31
|
-
### Module-level (
|
|
29
|
+
### Module-level (`modules/{moduleId}/`)
|
|
32
30
|
|
|
33
31
|
```text
|
|
34
32
|
{moduleId}/
|
|
35
33
|
|-- _moduleInfo.json # Required: module metadata + mTitle (page title) + HTMLOnly
|
|
36
34
|
|-- module.json # Required: data/watch/controls/set (unused when HTMLOnly=true)
|
|
37
35
|
|-- script.js # Recommended: helper logic for FUN/EXE/chart/transform
|
|
38
|
-
|-- style.css # Optional: module-wide CSS (published via
|
|
36
|
+
|-- style.css # Optional: module-wide CSS (published via fui module publish css)
|
|
39
37
|
|-- header.html # Full <head> content: <link>, <style>, <script> tags
|
|
40
38
|
|-- body.html # HTMLOnly=false: supplementary body HTML
|
|
41
39
|
| # HTMLOnly=true: entire page content (custom HTML/Vue app)
|
|
@@ -46,215 +44,101 @@ The workspace is organized at two levels: **project** and **module**.
|
|
|
46
44
|
`-- uc-*.vue # Custom components (prefix uc-)
|
|
47
45
|
```
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
When working without local workspace access:
|
|
52
|
-
|
|
53
|
-
1. Present this tree as the canonical module layout, not as a claimed filesystem state.
|
|
54
|
-
2. Return file contents in separate code blocks or clearly labeled sections.
|
|
55
|
-
3. Ask the user to paste `_moduleInfo.json`, `module.json`, `script.js`, or component files when a review or patch depends on existing code.
|
|
56
|
-
4. Scope recommendations to the files actually provided instead of inventing unseen surrounding files.
|
|
57
|
-
|
|
58
|
-
## Required vs Optional
|
|
59
|
-
|
|
60
|
-
1. Required (module-level):
|
|
61
|
-
- `_moduleInfo.json`
|
|
62
|
-
- `module.json`
|
|
63
|
-
|
|
64
|
-
2. Recommended:
|
|
65
|
-
- `script.js`
|
|
66
|
-
- `imports/_imports.json`
|
|
67
|
-
|
|
68
|
-
3. Optional by use-case:
|
|
69
|
-
- `header.html`
|
|
70
|
-
- `body.html`
|
|
71
|
-
- `style.css`
|
|
72
|
-
- `components/` (with `_components.json` and `uc-*.vue`)
|
|
73
|
-
|
|
74
|
-
## File Responsibilities
|
|
75
|
-
|
|
76
|
-
### module.json (core)
|
|
77
|
-
- Keep all runtime config in `data`, `watch`, `controls`, `set`.
|
|
78
|
-
- Keep `controls` under FUI grid wrapper (`container > rows > cols`).
|
|
79
|
-
- Keep business actions in `data` and trigger with `CALL`.
|
|
80
|
-
- **When `HTMLOnly=true`: leave this file empty (`data:[], watch:{}, controls:[], set:{}`). The FUI runtime does not use it.**
|
|
81
|
-
- **JSON content patterns** (data[], watch, controls, actions, dialogs, navigation): see [`examples/module-patterns.json`](../examples/module-patterns.json)
|
|
82
|
-
- **f-table props and header types**: see [`examples/f-table-patterns.json`](../examples/f-table-patterns.json)
|
|
83
|
-
|
|
84
|
-
### script.js (helper logic)
|
|
85
|
-
- Move complex transforms, chart builders, debounce helpers, parsing logic here.
|
|
86
|
-
- Expose functions for `FUN` actions or template helpers.
|
|
87
|
-
- Avoid large inline `EXE` blocks in `module.json` when reusable function is possible.
|
|
88
|
-
|
|
89
|
-
### style.css (module-wide CSS)
|
|
90
|
-
- CSS not tied to a single component — shared/global rules for the module.
|
|
91
|
-
- Published via `module_publish_css` (mirrors `script.js`/`module_publish_script`); does not auto-clear on `module_publish_html` if left empty.
|
|
92
|
-
- Component-local CSS belongs in the component's own `<style scoped>` (see [component-design.md](component-design.md)), not here.
|
|
93
|
-
|
|
94
|
-
### _moduleInfo.json (metadata)
|
|
95
|
-
- Keep `ProjectID`, `ModuleID`, `ModuleName`, `Framework` accurate.
|
|
96
|
-
- Contains `mTitle` (page title). To update the module's page title, edit the `mTitle` field in `_moduleInfo.json`. This value is sent to the server as `title` when publishing via `module_publish_html`.
|
|
97
|
-
- Contains `HTMLOnly` (boolean). **Read this first before deciding how to structure the module.**
|
|
98
|
-
|
|
99
|
-
### header.html (head content)
|
|
100
|
-
- Contains everything that goes **inside** the `<head>` tag — do NOT include the `<head>` wrapper itself.
|
|
101
|
-
- Can contain: `<link>` CSS imports, `<style>` blocks, `<script>` imports, `<meta>` tags.
|
|
102
|
-
- Do NOT put a `<title>` tag here — page title is managed via `mTitle` in `_moduleInfo.json`.
|
|
103
|
-
- **Default meta tags — already present on every FUI page, do NOT repeat them in header.html:**
|
|
104
|
-
```html
|
|
105
|
-
<meta charset="UTF-8"/>
|
|
106
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"/>
|
|
107
|
-
```
|
|
108
|
-
These defaults affect UI design decisions: `user-scalable=no, maximum-scale=1` means users **cannot pinch-zoom** — fonts/buttons must be readable and tappable at natural size on mobile; `width=device-width, initial-scale=1` makes Vuetify breakpoints behave per real device CSS pixels; `viewport-fit=cover` lets the page extend into the iOS notch/home-indicator area — fullscreen/`HTMLOnly` layouts touching top/bottom edges need `env(safe-area-inset-*)` padding.
|
|
109
|
-
- For `HTMLOnly=false`: typically only CSS (`<link>` and `<style>`). Framework and project-level scripts are injected automatically by the server.
|
|
110
|
-
- For `HTMLOnly=true`: **you must bring your own runtime** — see [HTMLOnly=true: KHÔNG có thư viện nào được nhúng sẵn](#htmlonlytrue-không-có-thư-viện-nào-được-nhúng-sẵn) below before writing a single tag.
|
|
111
|
-
|
|
112
|
-
### body.html (body content)
|
|
113
|
-
- Contains everything that goes **inside** the `<body>` tag — do NOT include the `<body>` wrapper itself.
|
|
114
|
-
- **When `HTMLOnly=false`**: supplementary HTML rendered alongside the FUI Vue runtime. Usually empty or minimal.
|
|
115
|
-
- **When `HTMLOnly=true`**: the **entire page content**. Can be plain HTML or a fully custom Vue app (own `<div id="app">`, own `<v-app>`, etc.). The FUI default Vue mount point is hidden in this mode.
|
|
116
|
-
- Both `header.html` and `body.html` store only the **inner content** (no wrapper tags). The server strips wrappers automatically on save, and the publish tool does the same preprocessing.
|
|
117
|
-
|
|
118
|
-
### imports/_imports.json (module imports)
|
|
119
|
-
- Declares module-scope JS/CSS import files.
|
|
120
|
-
- Each entry: `{ name, type, contentType, fileID, scope, sort }`.
|
|
121
|
-
- `sort` — thứ tự load. **Khi thêm import mới: đặt `sort` từ 40 trở lên** (40, 50, 60...). Giá trị nhỏ (1–39) dành cho import hệ thống/framework được load trước — không dùng để tránh xung đột.
|
|
122
|
-
- Only module-scope imports are stored here (project-scope imports are at `{projectId}/imports/_imports.json`).
|
|
123
|
-
|
|
124
|
-
### components/_components.json
|
|
125
|
-
- Register `uc-*` components.
|
|
126
|
-
- Follow upsert rule:
|
|
127
|
-
- Before publish: may only have `comName`.
|
|
128
|
-
- After publish/sync: `comID` is server-managed.
|
|
129
|
-
- Do not handcraft random `comID`.
|
|
130
|
-
|
|
131
|
-
### components/uc-*.vue
|
|
132
|
-
- Use `uc-` prefix for custom components.
|
|
133
|
-
- Keep component-specific UI complexity here instead of bloating `module.json`.
|
|
134
|
-
- Prefer reusable component contracts: props for input, emits for output, slots for extensibility.
|
|
135
|
-
- Avoid baking page-specific API calls or route logic into the component unless that coupling is intentional and unavoidable.
|
|
136
|
-
- `<style scoped>` blocks are allowed, but `scoped` has no real scoping effect — every selector must be manually prefixed with a unique class matching the component name. See [component-design.md](component-design.md) for the full rule and example.
|
|
137
|
-
- Never use backtick template strings inside the component `<template>`.
|
|
138
|
-
|
|
139
|
-
### _projectInfo.json (project metadata)
|
|
140
|
-
- Saved at project root on checkout (`{projectId}/_projectInfo.json`).
|
|
141
|
-
- Contains `ProjectID`, `ProjectName`, `GroupName`, `Framework`, `pDomain`, `fetchedAt`.
|
|
142
|
-
- Read-only for module editing — do not modify.
|
|
143
|
-
|
|
144
|
-
### project.json (project config)
|
|
145
|
-
- Contains a single `data` object — project-level defaults for all modules: `apiDomain`, `login`, `userInfo`, `menu`, `menuLeft`, `menuStyle`, `menuComponent`, `domainSetting`, etc.
|
|
146
|
-
- **Relationship with `module.json` `set`**: runtime merges `project.json data` + `module.json set`, with module values taking priority. A module only needs to declare fields that differ from the project default.
|
|
147
|
-
- See [project-config.md](project-config.md) for full field reference, menu item structure, and `right` permission rules.
|
|
148
|
-
|
|
149
|
-
## Naming and Prefix Rules
|
|
150
|
-
|
|
151
|
-
1. Module folder name:
|
|
152
|
-
- Use the same module ID naming used by project conventions.
|
|
153
|
-
|
|
154
|
-
2. Custom component file:
|
|
155
|
-
- Use `uc-*.vue` kebab-case.
|
|
156
|
-
|
|
157
|
-
3. Component usage in `module.json`:
|
|
158
|
-
- Use `el: "uc-..."` for custom components.
|
|
159
|
-
- Keep prop binding in `attr` with kebab-case prop names.
|
|
47
|
+
Required: `_moduleInfo.json`, `module.json`. Recommended: `script.js`, `imports/_imports.json`. Optional: `header.html`, `body.html`, `style.css`, `components/`.
|
|
160
48
|
|
|
161
|
-
##
|
|
49
|
+
## Chat Without Workspace
|
|
162
50
|
|
|
163
|
-
|
|
51
|
+
- Present the tree as canonical layout, not actual disk state; return each file in its own labeled code block.
|
|
52
|
+
- Ask the user to paste `_moduleInfo.json`, `module.json`, `script.js` or components when a review/patch depends on them. Scope advice to provided files; never invent unseen ones.
|
|
164
53
|
|
|
165
|
-
|
|
54
|
+
## File Duties
|
|
166
55
|
|
|
167
|
-
|
|
168
|
-
- `body.html` is supplementary HTML rendered in the body alongside the Vue controls (often empty).
|
|
169
|
-
- `header.html` typically contains CSS only (`<link>`, `<style>`). Framework and project-level scripts are auto-injected by the server.
|
|
170
|
-
- Vue components (`uc-*.vue`) are fully supported.
|
|
171
|
-
- `script.js` exposes helper functions used by `FUN`/`EXE` actions.
|
|
56
|
+
**module.json** — all runtime config in `data`, `watch`, `controls`, `set`; `controls` inside grid wrapper (`container > rows > cols`); business actions in `data`, triggered by `CALL`. Patterns: [`examples/module-patterns.json`](../examples/module-patterns.json); f-table props/header types: [`examples/f-table-patterns.json`](../examples/f-table-patterns.json).
|
|
172
57
|
|
|
173
|
-
|
|
58
|
+
**script.js** — complex transforms, chart builders, debounce, parsing; expose functions for `FUN`/`EXE` and template helpers. Prefer a reusable function over large inline `EXE`.
|
|
174
59
|
|
|
175
|
-
-
|
|
176
|
-
- `body.html` is the **entire page content**. The developer has full control — can write plain HTML or a completely custom Vue app (own `<div id="app">`, own `<v-app>`, own Vue instance).
|
|
177
|
-
- Do NOT attempt to use FUI's `controls`/`data`/`watch` JSON system — it has no effect.
|
|
178
|
-
- Use this mode for: standalone tools, custom editors, pages that need their own runtime or layout that doesn't fit the FUI grid system.
|
|
179
|
-
- **Full-height layout**: nếu trang có `menu` hiển thị (không phải `set.menu: false`), thanh menu chiếm 48px cố định — mọi CSS `height: 100vh` hay `calc(100vh - Npx)` trên container gốc phải cộng thêm 48px vào phần trừ. Xem [project-config.md](project-config.md) §menu.
|
|
60
|
+
**style.css** — module-wide CSS not tied to one component. Publish with `fui module publish css`; an empty file is not auto-cleared by `fui module publish html`. Component-local CSS goes in the component's `<style scoped>`.
|
|
180
61
|
|
|
181
|
-
|
|
62
|
+
**\_moduleInfo.json** — keep `ProjectID`, `ModuleID`, `ModuleName`, `Framework` accurate. `mTitle` is the page title (edit it here; sent as `title` by `fui module publish html`). Read `HTMLOnly` before structuring anything.
|
|
63
|
+
|
|
64
|
+
**header.html** — inner `<head>` content only (`<link>`, `<style>`, `<script>`, `<meta>`); no wrapper, no `<title>` (use `mTitle`). `HTMLOnly=false`: usually CSS only; server injects framework and project scripts. `HTMLOnly=true`: bring your own runtime — read [HTMLOnly=true: no library is embedded](#htmlonlytrue-no-library-is-embedded) first. These meta tags are on every page — never repeat them:
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<meta charset="UTF-8" />
|
|
68
|
+
<meta
|
|
69
|
+
name="viewport"
|
|
70
|
+
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"
|
|
71
|
+
/>
|
|
72
|
+
```
|
|
182
73
|
|
|
183
|
-
|
|
184
|
-
|
|
74
|
+
- No pinch-zoom → fonts/buttons must be readable and tappable at natural size on mobile.
|
|
75
|
+
- Vuetify breakpoints follow real device CSS pixels.
|
|
76
|
+
- `viewport-fit=cover` → fullscreen/`HTMLOnly` layouts touching top/bottom need `env(safe-area-inset-*)` padding (iOS notch/home indicator).
|
|
185
77
|
|
|
186
|
-
|
|
78
|
+
**body.html** — inner `<body>` content only. `HTMLOnly=false`: supplementary HTML beside the Vue runtime, usually empty. `HTMLOnly=true`: the whole page (plain HTML or own Vue app with own `<div id="app">`/`<v-app>`); FUI's default mount point is hidden. Server and publish command strip `<head>`/`<body>` wrappers.
|
|
187
79
|
|
|
188
|
-
|
|
189
|
-
2. StyleCSS **cấp module** (`style.css` + `<style>` của `uc-*.vue` cấp module),
|
|
190
|
-
3. bundle `moduledata` (`$moduleUI` + `script.js` + component cấp module).
|
|
80
|
+
**imports/\_imports.json** — module-scope JS/CSS imports; entry `{ name, type, contentType, fileID, scope, sort }`. `sort` = load order: new imports use **>= 40** (40, 50, 60…); 1–39 is reserved for system/framework. Project-scope imports live in `{projectId}/imports/_imports.json`.
|
|
191
81
|
|
|
192
|
-
|
|
82
|
+
**components/\_components.json** — registers `uc-*`. Before publish an entry may hold only `comName`; `comID` is server-managed after publish/sync. Never invent `comID`.
|
|
193
83
|
|
|
194
|
-
|
|
195
|
-
|---|---|
|
|
196
|
-
| Framework V2/V3 — `vue.global.min.js`, `vuetify*.js/css`, `fastproject*.js`, `component*.js`, `defaultfunction*.js` | `Vue is not defined`, `<v-btn>` không render, `f-*`/`t-*` không tồn tại |
|
|
197
|
-
| jQuery, lodash (`_`), `moment`/`dayjs`, `numeral`, `jquery-confirm` | `$ is not defined`, `_ is not defined` |
|
|
198
|
-
| Roboto, Material Design Icons (`mdi-*`) | chữ sai font, icon thành ô vuông trống |
|
|
199
|
-
| `projectdata` bundle — `$projectData`, `$projectGroupSetting`, component cấp **project** | `apiDomain`/`menu`/`login` đều undefined; `uc-*` cấp project là unknown element |
|
|
200
|
-
| StyleCSS cấp **project**, `projectdefaultstyle.css` | mất toàn bộ class dùng chung của project (kể cả `.shrink`) |
|
|
201
|
-
| `<div id="fastProjectAPP">` | không có mount point sẵn — bạn phải tự dựng gốc trong `body.html` |
|
|
84
|
+
**components/uc-\*.vue** — `uc-` prefix, kebab-case. Hold component UI complexity here, not in `module.json`. Contract: props in, emits out, slots to extend. No page-specific API/route logic unless the coupling is intentional and unavoidable. `scoped` does not really scope: prefix every selector with a unique class matching the component name ([component-design.md](component-design.md)). No backtick template strings in `<template>`.
|
|
202
85
|
|
|
203
|
-
**
|
|
204
|
-
|
|
86
|
+
**\_projectInfo.json** — written on checkout (`ProjectID`, `ProjectName`, `GroupName`, `Framework`, `pDomain`, `fetchedAt`). Read-only.
|
|
87
|
+
|
|
88
|
+
**project.json** — one `data` object of project defaults (`apiDomain`, `login`, `userInfo`, `menu`, `menuLeft`, `menuStyle`, `menuComponent`, `domainSetting`, …). Runtime merges it with `module.json` `set`; module wins, so declare only differences. Fields, menu items, `right` rules: [project-config.md](project-config.md).
|
|
89
|
+
|
|
90
|
+
## Naming
|
|
91
|
+
|
|
92
|
+
- Module folder: project's module ID convention.
|
|
93
|
+
- Use a component in `module.json` via `el: "uc-..."`, props in `attr` with kebab-case names.
|
|
94
|
+
|
|
95
|
+
## HTMLOnly Mode
|
|
205
96
|
|
|
206
|
-
|
|
207
|
-
nó hiện ra trong `file_import_list` và trong báo cáo `module_simulate({renderUI:true})`;
|
|
208
|
-
- hoặc viết thẳng `<link>`/`<script>` vào `header.html` — tự do hơn, nhưng không tool nào liệt kê
|
|
209
|
-
được cho bạn.
|
|
97
|
+
Boolean in `_moduleInfo.json`. **Check it first.**
|
|
210
98
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
99
|
+
- **false (default)**: runtime reads `module.json` and bootstraps Vue; `uc-*.vue` and `script.js` helpers fully supported.
|
|
100
|
+
- **true**: `module.json` ignored — keep it `data:[], watch:{}, controls:[], set:{}`; FUI `controls`/`data`/`watch` have no effect. `body.html` is the entire page. Use for standalone tools, custom editors, pages needing their own runtime or a non-grid layout.
|
|
101
|
+
- **Full-height**: if the menu shows (not `set.menu: false`) it takes a fixed 48px — subtract 48px more from any root `height: 100vh` / `calc(100vh - Npx)`. See [project-config.md](project-config.md) §menu.
|
|
214
102
|
|
|
215
|
-
|
|
216
|
-
framework, bỏ projectdata, bỏ `#fastProjectAPP`) và in một dòng cảnh báo nói rõ điều đó — nên nếu
|
|
217
|
-
bạn quên khai một thư viện, ảnh render sẽ hỏng y hệt trang thật thay vì đẹp giả tạo.
|
|
103
|
+
#### HTMLOnly=true: no library is embedded
|
|
218
104
|
|
|
219
|
-
|
|
105
|
+
Most common mistake; it shows **no error while writing**, only a blank page after deploy. The server emits just three things:
|
|
220
106
|
|
|
221
|
-
|
|
107
|
+
1. this module's imports (`{moduleId}/imports/_imports.json`),
|
|
108
|
+
2. module-level StyleCSS (`style.css` + `<style>` of module-level `uc-*.vue`),
|
|
109
|
+
3. the `moduledata` bundle (`$moduleUI` + `script.js` + module-level components).
|
|
222
110
|
|
|
223
|
-
|
|
224
|
-
- `_moduleInfo.json`
|
|
225
|
-
- `module.json`
|
|
226
|
-
- `script.js`
|
|
227
|
-
- `imports/_imports.json`
|
|
111
|
+
Not embedded, even if the project declares them:
|
|
228
112
|
|
|
229
|
-
|
|
113
|
+
| Missing | Symptom |
|
|
114
|
+
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
115
|
+
| Framework V2/V3 — `vue.global.min.js`, `vuetify*.js/css`, `fastproject*.js`, `component*.js`, `defaultfunction*.js` | `Vue is not defined`, `<v-btn>` not rendered, no `f-*`/`t-*` |
|
|
116
|
+
| jQuery, lodash (`_`), `moment`/`dayjs`, `numeral`, `jquery-confirm` | `$ is not defined`, `_ is not defined` |
|
|
117
|
+
| Roboto, Material Design Icons (`mdi-*`) | wrong font, icons as empty boxes |
|
|
118
|
+
| `projectdata` bundle — `$projectData`, `$projectGroupSetting`, project-level components | `apiDomain`/`menu`/`login` undefined; project `uc-*` unknown |
|
|
119
|
+
| Project-level StyleCSS, `projectdefaultstyle.css` | shared project classes gone (incl. `.shrink`) |
|
|
120
|
+
| `<div id="fastProjectAPP">` | no mount point — build your own root in `body.html` |
|
|
230
121
|
|
|
231
|
-
|
|
122
|
+
**Declare every needed library in each HTMLOnly module**; project-level declarations do not help. Either:
|
|
232
123
|
|
|
233
|
-
|
|
234
|
-
- `
|
|
235
|
-
- `script.js` for conversion/chart utilities
|
|
236
|
-
- `components/uc-*.vue` for chart/table dashboard presentation
|
|
237
|
-
- `header.html` for module-scoped and component-scoped CSS
|
|
124
|
+
- `fui import new` into the module's `imports/_imports.json` with `--sort` >= 40 (see `fui import new --help`) — preferred: visible in `fui import list` and the `fui module simulate --render` report; or
|
|
125
|
+
- raw `<link>`/`<script>` in `header.html` — flexible, but no command lists them.
|
|
238
126
|
|
|
239
|
-
|
|
127
|
+
**[script-map.md](script-map.md) does not apply here**: its "already bundled, no duplicate CDN" list is for `HTMLOnly=false` only. In HTMLOnly the CDN is required, not a duplicate.
|
|
240
128
|
|
|
241
|
-
|
|
129
|
+
`fui module simulate --render` renders HTMLOnly modules exactly like production (no framework, projectdata or `#fastProjectAPP`) and warns so; a missing library breaks the screenshot like the real page.
|
|
242
130
|
|
|
243
|
-
|
|
244
|
-
- `_moduleInfo.json` (with `HTMLOnly: true`)
|
|
245
|
-
- `module.json` (empty skeleton only)
|
|
246
|
-
- `header.html` for all CSS + JS library imports
|
|
247
|
-
- `body.html` for the entire page — plain HTML or a self-contained Vue app
|
|
131
|
+
## Patterns
|
|
248
132
|
|
|
249
|
-
|
|
133
|
+
- **A — simple**: `_moduleInfo.json`, `module.json`, `script.js`, `imports/_imports.json`; no `components/` unless needed.
|
|
134
|
+
- **B — dashboard/report (recommended)**: `module.json` filters + action orchestration; `script.js` conversion/chart utils; `components/uc-*.vue` chart/table presentation; `header.html` module/component CSS. Keeps large `module.json` maintainable.
|
|
135
|
+
- **C — HTMLOnly page**: `_moduleInfo.json` (`HTMLOnly: true`), empty `module.json` skeleton, `header.html` all CSS + JS libraries, `body.html` whole page (plain HTML or self-contained Vue app); `components/`/`script.js` only if needed.
|
|
250
136
|
|
|
251
|
-
## Review Checklist
|
|
137
|
+
## Review Checklist
|
|
252
138
|
|
|
253
|
-
1.
|
|
254
|
-
2.
|
|
255
|
-
3.
|
|
256
|
-
4.
|
|
257
|
-
5.
|
|
258
|
-
6.
|
|
259
|
-
7. Are imports declared in `imports/_imports.json`?
|
|
260
|
-
8. Do `header.html` and `body.html` contain only inner content (no `<head>`/`<body>` wrapper tags)?
|
|
139
|
+
1. `HTMLOnly` checked first (decides which files matter).
|
|
140
|
+
2. false: valid `data/watch/controls/set`? true: `module.json` empty, all content in `body.html`?
|
|
141
|
+
3. Heavy logic in `script.js`, not oversized `EXE`?
|
|
142
|
+
4. Custom UI in `components/uc-*.vue`, registered in `_components.json`?
|
|
143
|
+
5. Imports in `imports/_imports.json`?
|
|
144
|
+
6. `header.html`/`body.html` inner content only (no `<head>`/`<body>`)?
|