@fui-org/fui-cli 1.3.1 → 2.0.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.
Files changed (111) hide show
  1. package/README.md +19 -3
  2. package/dist/fui-bmg5pnmq.js +379 -0
  3. package/dist/fui.js +1 -1
  4. package/package.json +7 -6
  5. package/skills/fui/SKILL.md +9 -41
  6. package/skills/fui-skill/SKILL.md +95 -225
  7. package/skills/fui-skill/assets/projectdefaultstyle-3.0.css +555 -0
  8. package/skills/fui-skill/assets/projectdefaultstyle.css +207 -235
  9. package/skills/fui-skill/references/INDEX.md +105 -137
  10. package/skills/fui-skill/references/advanced-techniques.md +76 -68
  11. package/skills/fui-skill/references/coding-standards.md +56 -56
  12. package/skills/fui-skill/references/component-design.md +166 -173
  13. package/skills/fui-skill/references/component-quickref.md +61 -60
  14. package/skills/fui-skill/references/component-table.md +128 -117
  15. package/skills/fui-skill/references/components-dialog.md +55 -56
  16. package/skills/fui-skill/references/components-display.md +24 -30
  17. package/skills/fui-skill/references/components-echart.md +186 -261
  18. package/skills/fui-skill/references/components-input.md +72 -96
  19. package/skills/fui-skill/references/controls-patterns.md +196 -342
  20. package/skills/fui-skill/references/controls-styling-vocabulary.md +130 -97
  21. package/skills/fui-skill/references/db-table-design.md +24 -28
  22. package/skills/fui-skill/references/db-workflow.md +191 -390
  23. package/skills/fui-skill/references/default-function.md +169 -128
  24. package/skills/fui-skill/references/design-modes.md +35 -63
  25. package/skills/fui-skill/references/echart-templates.md +204 -196
  26. package/skills/fui-skill/references/fastproject.md +62 -60
  27. package/skills/fui-skill/references/fsheet.md +109 -124
  28. package/skills/fui-skill/references/fullstack-workflow.md +90 -128
  29. package/skills/fui-skill/references/module-data-patterns.md +31 -40
  30. package/skills/fui-skill/references/module-json-anatomy.md +47 -52
  31. package/skills/fui-skill/references/module-structure.md +80 -196
  32. package/skills/fui-skill/references/new-session.md +49 -51
  33. package/skills/fui-skill/references/pdfmake.md +17 -17
  34. package/skills/fui-skill/references/permission-system.md +89 -108
  35. package/skills/fui-skill/references/platform-architecture.md +128 -153
  36. package/skills/fui-skill/references/project-config.md +102 -134
  37. package/skills/fui-skill/references/project-provisioning.md +139 -244
  38. package/skills/fui-skill/references/script-map.md +208 -242
  39. package/skills/fui-skill/references/sql-clr-functions.md +98 -97
  40. package/skills/fui-skill/references/system-design.md +63 -88
  41. package/skills/fui-skill/references/tapi-file-api.md +46 -52
  42. package/skills/fui-skill/references/tapi-permission-patterns.md +51 -53
  43. package/skills/fui-skill/references/tapi-reference.md +132 -207
  44. package/skills/fui-skill/references/tools-registry.md +84 -460
  45. package/skills/fui-skill/references/ui-crosswindow-patterns.md +79 -75
  46. package/skills/fui-skill/references/ui-dialog-patterns.md +98 -72
  47. package/skills/fui-skill/references/ui-layout-patterns.md +26 -26
  48. package/skills/fui-skill/references/ui-patterns.md +71 -83
  49. package/skills/fui-skill/references/ui-screenshot-review.md +63 -62
  50. package/skills/fui-skill/references/ui-table-cell-patterns.md +61 -59
  51. package/skills/fui-skill/references/ui-templates.md +16 -23
  52. package/skills/fui-skill/references/verification.md +236 -246
  53. package/skills/fui-skill/references/watcher-patterns.md +30 -63
  54. package/skills/fui-skill/references/websocket-realtime.md +83 -66
  55. package/skills/fui-skill/scripts/component-3.0.js +298 -131
  56. package/skills/fui-skill/scripts/component.js +277 -271
  57. package/skills/fui-skill/scripts/componentTable-3.0.js +182 -53
  58. package/skills/fui-skill/scripts/componentTable.js +171 -49
  59. package/skills/fui-skill/scripts/defaultfunction-3.0.js +88 -3
  60. package/skills/fui-skill/scripts/defaultfunction.js +88 -3
  61. package/skills/fui-skill/scripts/fsheet.js +38 -0
  62. package/dist/fui-x7kph78r.js +0 -420
  63. package/skills/fui-skill/README.md +0 -112
  64. package/skills/fui-skill/metadata.json +0 -75
  65. package/skills/fui-skill-cli/SKILL.md +0 -139
  66. package/skills/fui-skill-cli/references/INDEX.md +0 -110
  67. package/skills/fui-skill-cli/references/advanced-techniques.md +0 -168
  68. package/skills/fui-skill-cli/references/coding-standards.md +0 -112
  69. package/skills/fui-skill-cli/references/component-design.md +0 -448
  70. package/skills/fui-skill-cli/references/component-quickref.md +0 -78
  71. package/skills/fui-skill-cli/references/component-table.md +0 -248
  72. package/skills/fui-skill-cli/references/components-dialog.md +0 -191
  73. package/skills/fui-skill-cli/references/components-display.md +0 -141
  74. package/skills/fui-skill-cli/references/components-echart.md +0 -316
  75. package/skills/fui-skill-cli/references/components-input.md +0 -335
  76. package/skills/fui-skill-cli/references/controls-patterns.md +0 -701
  77. package/skills/fui-skill-cli/references/controls-styling-vocabulary.md +0 -137
  78. package/skills/fui-skill-cli/references/db-table-design.md +0 -73
  79. package/skills/fui-skill-cli/references/db-workflow.md +0 -288
  80. package/skills/fui-skill-cli/references/default-function.md +0 -425
  81. package/skills/fui-skill-cli/references/design-modes.md +0 -57
  82. package/skills/fui-skill-cli/references/echart-templates.md +0 -489
  83. package/skills/fui-skill-cli/references/fastproject.md +0 -99
  84. package/skills/fui-skill-cli/references/fsheet.md +0 -203
  85. package/skills/fui-skill-cli/references/fullstack-workflow.md +0 -313
  86. package/skills/fui-skill-cli/references/module-data-patterns.md +0 -117
  87. package/skills/fui-skill-cli/references/module-json-anatomy.md +0 -132
  88. package/skills/fui-skill-cli/references/module-structure.md +0 -141
  89. package/skills/fui-skill-cli/references/new-session.md +0 -85
  90. package/skills/fui-skill-cli/references/pdfmake.md +0 -60
  91. package/skills/fui-skill-cli/references/permission-system.md +0 -150
  92. package/skills/fui-skill-cli/references/platform-architecture.md +0 -269
  93. package/skills/fui-skill-cli/references/project-config.md +0 -303
  94. package/skills/fui-skill-cli/references/project-provisioning.md +0 -278
  95. package/skills/fui-skill-cli/references/script-map.md +0 -262
  96. package/skills/fui-skill-cli/references/sql-clr-functions.md +0 -225
  97. package/skills/fui-skill-cli/references/system-design.md +0 -89
  98. package/skills/fui-skill-cli/references/tapi-file-api.md +0 -185
  99. package/skills/fui-skill-cli/references/tapi-permission-patterns.md +0 -156
  100. package/skills/fui-skill-cli/references/tapi-reference.md +0 -474
  101. package/skills/fui-skill-cli/references/tools-registry.md +0 -84
  102. package/skills/fui-skill-cli/references/ui-crosswindow-patterns.md +0 -321
  103. package/skills/fui-skill-cli/references/ui-dialog-patterns.md +0 -255
  104. package/skills/fui-skill-cli/references/ui-layout-patterns.md +0 -176
  105. package/skills/fui-skill-cli/references/ui-patterns.md +0 -303
  106. package/skills/fui-skill-cli/references/ui-screenshot-review.md +0 -95
  107. package/skills/fui-skill-cli/references/ui-table-cell-patterns.md +0 -318
  108. package/skills/fui-skill-cli/references/ui-templates.md +0 -22
  109. package/skills/fui-skill-cli/references/verification.md +0 -236
  110. package/skills/fui-skill-cli/references/watcher-patterns.md +0 -163
  111. package/skills/fui-skill-cli/references/websocket-realtime.md +0 -271
@@ -1,33 +1,36 @@
1
1
  # FUI Coding Standards
2
2
 
3
- > File này sở hữu: **chuẩn code chung: đặt tên, quy ước `<style scoped>` trong `.vue` (scope thủ công), cấm backtick trong `<template>`, reusable API**. Quy tắc thiết kế component chi tiết xem [component-design.md](component-design.md).
3
+ > Owns: **general code standards: naming, `<style scoped>` in `.vue` (manual scoping), no backticks in `<template>`, reusable APIs**. Detailed component design rules: [component-design.md](component-design.md).
4
4
 
5
- ## 1. Naming Conventions
5
+ ## 1. Naming
6
6
 
7
7
  ### Components (`components/`)
8
- - **Prefix**: Use `uc-` (User Component) for custom module components to distinguish from standard FUI components (`f-`, `t-`).
9
- - **Format**: Kebab-case (e.g., `uc-trangthai-sukien.vue`, `uc-user-profile.vue`).
10
- - **Props**: Use camelCase in script, kebab-case in templates (e.g., `userProfile` -> `:user-profile`).
11
- - **Prefer reusable APIs**: Default to generic props, emits, and slots so the component can be reused across modules or screens.
12
- - **Avoid overfitting names**: Prefer neutral contracts like `items`, `value`, `label`, `loading`, `readonly`, `disabled`, `options`, `config` unless the business domain truly requires a specific prop name.
13
- - **Push orchestration upward**: Keep API calls, route changes, and page-specific coordination in `module.json` or the parent when possible. Let the component focus on presentation and local interaction.
14
- - **Emit upward**: Prefer `$emit(...)` for `input`, `change`, `select`, `submit`, `remove`, or explicit action events rather than mutating parent-owned state.
8
+
9
+ - **Prefix** `uc-` (User Component) for custom components, distinct from standard FUI `f-`, `t-`.
10
+ - **Kebab-case** file names (e.g. `uc-trangthai-sukien.vue`, `uc-user-profile.vue`).
11
+ - **Props**: camelCase in script, kebab-case in templates (`userProfile` -> `:user-profile`).
12
+ - **Reusable APIs**: default to generic props, emits and slots so the component works across modules/screens.
13
+ - **No overfitted names**: prefer neutral contracts (`items`, `value`, `label`, `loading`, `readonly`, `disabled`, `options`, `config`) unless the domain truly needs a specific name.
14
+ - **Push orchestration up**: API calls, route changes and page coordination stay in `module.json` or the parent; the component handles presentation and local interaction.
15
+ - **Emit up**: prefer `$emit(...)` for `input`, `change`, `select`, `submit`, `remove` or explicit action events over mutating parent-owned state.
15
16
 
16
17
  ### CSS Classes
17
- - **`<style scoped>` in `.vue` is allowed** (saved server-side as `ComCSS`), but `scoped` has **no real scoping effect** — FUI only concatenates `ComCSS` from every component in the module into one global stylesheet (`ComponentCSSBuild()`), no AST transform, no `data-v-xxxx` attribute injection. **Every selector must be manually scoped**: give the component's root template element a unique class matching the component name (kebab-case, e.g. `uc-invoice-list`), then write every rule as a descendant selector starting from that class (`.uc-invoice-list__title`, never a bare `.title`). See [component-design.md](component-design.md) for a full example.
18
- - **Style Placement**: Component-local CSS → `<style scoped>` in the `.vue` file (with manual scoping above). Module-wide CSS → `style.css` (publish via `module_publish_css`). `header.html` is still valid for CSS but no longer the only option.
19
- - **Vuetify Utilities**: Prioritize Vuetify helper classes (e.g., `ma-2`, `pa-0`, `d-flex`, `primary--text`).
20
- - **Custom Classes**: Use meaningful prefixed names (e.g., `ep-hero`, `ep-field-grid`). Avoid generic names like `.box` or `.red`.
21
- - **State Classes**: Use descriptive names for state (e.g., `.is-active`, `.has-error`).
18
+
19
+ - **`<style scoped>` in `.vue` is allowed** (saved server-side as `ComCSS`) but `scoped` has **no real effect** — FUI just concatenates every component's `ComCSS` in the module into one global stylesheet (`ComponentCSSBuild()`): no AST transform, no `data-v-xxxx`. **Scope every selector manually**: give the root template element a unique class matching the component name (kebab-case, e.g. `uc-invoice-list`) and write every rule under it (`.uc-invoice-list__title`, never bare `.title`). Full example: [component-design.md](component-design.md).
20
+ - **Placement**: component CSS → `<style scoped>` in the `.vue` (manually scoped). Module-wide CSS → `style.css` (publish with `fui module publish css`). `header.html` still works for CSS but is no longer the only option.
21
+ - **Vuetify utilities first** (`ma-2`, `pa-0`, `d-flex`, `primary--text`).
22
+ - **Custom classes**: meaningful prefixed names (`ep-hero`, `ep-field-grid`); avoid generic `.box`, `.red`.
23
+ - **State classes**: descriptive (`.is-active`, `.has-error`).
22
24
 
23
25
  ### Action Keys (`module.json`)
24
- - **API Actions**: Predix with `api` (e.g., `apiGetDSSuKien`, `apiUpdateUser`).
25
- - **Event Handlers**: Prefix with `handle` (e.g., `handleOpenReport`, `handleSubmit`).
26
- - **Dialog Actions**: Prefix with verb (e.g., `openUploadDialog`, `closeSettings`).
27
26
 
28
- ## 2. Menu Configuration (`set.menu`)
27
+ - **API actions**: prefix `api` (`apiGetDSSuKien`, `apiUpdateUser`).
28
+ - **Event handlers**: prefix `handle` (`handleOpenReport`, `handleSubmit`).
29
+ - **Dialog actions**: prefix a verb (`openUploadDialog`, `closeSettings`).
30
+
31
+ ## 2. Menu (`set.menu`)
29
32
 
30
- Define the application menu in the `set` object of `module.json`.
33
+ Define the app menu in `module.json`'s `set` object.
31
34
 
32
35
  ```json
33
36
  "menu": [
@@ -58,55 +61,52 @@ Define the application menu in the `set` object of `module.json`.
58
61
 
59
62
  ## 3. Project Structure
60
63
 
61
- - **Canonical module structure**: Follow [module-structure.md](module-structure.md) as the default module layout in both workspace and chat contexts. In workspace-aware environments, apply it to real local files. In chat contexts, use it to virtualize the same module structure in the response.
62
- - **Required core files**: Keep `_info.json` and `module.json` at module root.
63
- - **`components/`**: Only place `.vue` files here. Do not sub-folder unless strictly necessary (FUI auto-scans this root).
64
- - **`components/_components.json`**: Maintain component registry when using `uc-*` components.
65
- - **`header.html`**: Still valid for CSS, but component CSS should prefer `<style scoped>` in the `.vue` (manually scoped) and module-wide CSS should prefer `style.css`.
66
- - **`module.json`**: Keep this file clean. Move large static lists to the database or separate JSON files if supported.
64
+ - **Canonical layout**: follow [module-structure.md](module-structure.md) in workspace and chat contexts — real local files with workspace access; in chat, mirror the same structure in the response.
65
+ - **Required**: `_info.json` and `module.json` at module root.
66
+ - **`components/`**: only `.vue` files; no subfolders unless strictly necessary (FUI scans this root).
67
+ - **`components/_components.json`**: keep the registry when using `uc-*` components.
68
+ - **`header.html`**: still valid for CSS, but prefer manually scoped `<style scoped>` in `.vue` for component CSS and `style.css` for module-wide CSS.
69
+ - **`module.json`**: keep clean; move large static lists to the DB or separate JSON files if supported.
67
70
 
68
71
  ## 4. Best Practices
69
72
 
70
- - **Data Binding**: Avoid complex logic in JSON attributes. Use computed properties in components or simpler `vueData` structures.
71
- - **Event Handling**: Use `CALL(vueData.actionName)` for all complex interactions. Avoid inline JS like `vueData.count++` for anything beyond simple toggles.
72
- - **Mobile Responsiveness**: Always configure `configForm.xs` and `configForm.md` for responsive form widths.
73
+ - **Data binding**: no complex logic in JSON attributes; use computed properties in components or simpler `vueData` structures.
74
+ - **Events**: use `CALL(vueData.actionName)` for complex interactions; inline JS like `vueData.count++` only for simple toggles.
75
+ - **Responsive**: always set `configForm.xs` and `configForm.md` for form widths.
73
76
 
74
77
  ## 5. Component Registration (`_components.json`)
75
78
 
76
- Components are registered using an **upsert pattern**:
79
+ **Upsert pattern:**
77
80
 
78
- - **New component** (before publish): Only `comName` is required. Do NOT manually assign `comID`.
79
- ```json
80
- [
81
- { "comName": "hr-employee-profile" }
82
- ]
83
- ```
84
- - **After publish & sync**: The server auto-assigns `comID`. The file gets updated on sync:
85
- ```json
86
- [
87
- { "comID": 7813, "comName": "hr-employee-profile" }
88
- ]
89
- ```
81
+ - **New component** (before publish): only `comName`. Do NOT assign `comID`.
82
+ ```json
83
+ [{ "comName": "hr-employee-profile" }]
84
+ ```
85
+ - **After publish & sync**: the server assigns `comID`; sync updates the file:
86
+ ```json
87
+ [{ "comID": 7813, "comName": "hr-employee-profile" }]
88
+ ```
90
89
 
91
- > **Rule**: Never manually create or modify `comID`. It is server-generated.
90
+ > **Rule**: never create or modify `comID` manually — it is server-generated.
92
91
 
93
92
  ## 6. Vue Component Design
94
93
 
95
- Xem toàn bộ quy tắc thiết kế `uc-*.vue` component tại [component-design.md](component-design.md), bao gồm:
96
- - Không dùng `components: {}` để đăng ký
97
- - `<style scoped>` trong file `.vue` phải tự scope thủ công (xem mục CSS Classes ở trên)
98
- - Không dùng backtick trong `<template>`
99
- - Không dùng `v-dialog` — dùng cấu trúc `v-overlay` thay thế
100
- - Cấu trúc bắt buộc cho dialog component
94
+ Full `uc-*.vue` rules in [component-design.md](component-design.md), including:
95
+
96
+ - No `components: {}` registration
97
+ - `<style scoped>` in `.vue` must be manually scoped (see CSS Classes)
98
+ - No backticks in `<template>`
99
+ - No `v-dialog` — use the `v-overlay` structure
100
+ - Required structure for dialog components
101
101
 
102
102
  ## 7. Complex Module Architecture
103
103
 
104
- When a module's `module.json` controls exceed ~200 lines:
104
+ When `module.json` controls exceed ~200 lines:
105
105
 
106
- - **Extract to Vue component**: Move the UI into a `.vue` component. Keep `module.json` lean (data/API only + a single component call in `controls`).
107
- - **Props binding**: Pass all data from `module.json` via props. Use kebab-case for prop names in templates (`:nhan-vien="nhanVien"`).
108
- - **Design for reuse first**: Before naming props or methods, check whether the component can be expressed as a generic list, card, dialog body, filter panel, summary block, or form section reused by other modules.
109
- - **Configurable states**: Expose loading, empty, disabled, and readonly behavior through props or slots instead of hardcoding one workflow.
110
- - **Sticky headers**: When combining multiple sticky elements (e.g., hero + tabs), wrap them in **one parent div** with `position: sticky` instead of making each element sticky individually.
111
- - **Tab navigation vs Accordion**: For 5+ sections of data, prefer horizontal `v-tabs` over `v-expansion-panels`. Tabs show one section at a time, reduce cognitive overload, and support swipe gestures on mobile.
112
- - **Swipe gestures**: Attach `touchstart`/`touchend` listeners on the **outermost wrapper** (not on content area) so swipe works regardless of content height.
106
+ - **Extract to a Vue component**: move UI into a `.vue`; `module.json` keeps data/API plus one component call in `controls`.
107
+ - **Props binding**: pass all data from `module.json` via props, kebab-case in templates (`:nhan-vien="nhanVien"`).
108
+ - **Design for reuse first**: before naming props/methods, check whether it can be a generic list, card, dialog body, filter panel, summary block or form section reusable elsewhere.
109
+ - **Configurable states**: expose loading, empty, disabled, readonly via props or slots, not a hardcoded workflow.
110
+ - **Sticky headers**: for multiple sticky elements (e.g. hero + tabs), wrap them in **one parent div** with `position: sticky`, not each element.
111
+ - **Tabs vs accordion**: 5+ sections → horizontal `v-tabs` over `v-expansion-panels` (one section at a time, less overload, swipe on mobile).
112
+ - **Swipe gestures**: attach `touchstart`/`touchend` on the **outermost wrapper** (not the content area) so swipe works regardless of content height.