@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.
- package/README.md +19 -3
- package/dist/fui-bmg5pnmq.js +379 -0
- package/dist/fui.js +1 -1
- package/package.json +7 -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/dist/fui-x7kph78r.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,33 +1,36 @@
|
|
|
1
1
|
# FUI Coding Standards
|
|
2
2
|
|
|
3
|
-
>
|
|
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
|
|
5
|
+
## 1. Naming
|
|
6
6
|
|
|
7
7
|
### Components (`components/`)
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
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
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
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
|
-
|
|
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
|
|
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
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
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
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
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
|
-
|
|
79
|
+
**Upsert pattern:**
|
|
77
80
|
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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**:
|
|
90
|
+
> **Rule**: never create or modify `comID` manually — it is server-generated.
|
|
92
91
|
|
|
93
92
|
## 6. Vue Component Design
|
|
94
93
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
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
|
|
104
|
+
When `module.json` controls exceed ~200 lines:
|
|
105
105
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
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.
|