@fui-org/fui-cli 2.1.3 → 2.2.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 +27 -7
- package/dist/fui-qrb1j9jz.js +397 -0
- package/dist/fui.js +1 -1
- package/package.json +1 -1
- package/skills/fui/SKILL.md +143 -38
- package/skills/fui/agents/fui-builder.md +62 -0
- package/skills/fui/agents/fui-tester.md +77 -0
- package/skills/{fui-skill → fui}/assets/projectdefaultstyle.css +489 -489
- package/skills/{fui-skill → fui}/examples/component.vue +162 -162
- package/skills/{fui-skill → fui}/references/INDEX.md +5 -4
- package/skills/{fui-skill → fui}/references/advanced-techniques.md +170 -168
- package/skills/{fui-skill → fui}/references/component-design.md +2 -2
- package/skills/{fui-skill → fui}/references/component-quickref.md +78 -78
- package/skills/{fui-skill → fui}/references/component-table.md +287 -287
- package/skills/{fui-skill → fui}/references/components-dialog.md +191 -191
- package/skills/{fui-skill → fui}/references/components-display.md +141 -141
- package/skills/{fui-skill → fui}/references/components-echart.md +316 -316
- package/skills/{fui-skill → fui}/references/components-input.md +335 -335
- package/skills/{fui-skill → fui}/references/controls-patterns.md +2 -2
- package/skills/{fui-skill → fui}/references/controls-styling-vocabulary.md +173 -173
- package/skills/{fui-skill → fui}/references/db-workflow.md +9 -9
- package/skills/{fui-skill → fui}/references/default-function.md +456 -456
- package/skills/{fui-skill → fui}/references/design-modes.md +57 -57
- package/skills/{fui-skill → fui}/references/echart-templates.md +489 -489
- package/skills/{fui-skill → fui}/references/fastproject.md +99 -99
- package/skills/{fui-skill → fui}/references/fullstack-workflow.md +314 -313
- package/skills/{fui-skill → fui}/references/module-data-patterns.md +117 -117
- package/skills/{fui-skill → fui}/references/module-json-anatomy.md +132 -132
- package/skills/{fui-skill → fui}/references/module-structure.md +144 -144
- package/skills/{fui-skill → fui}/references/new-session.md +1 -2
- package/skills/{fui-skill → fui}/references/pdfmake.md +60 -60
- package/skills/{fui-skill → fui}/references/permission-system.md +1 -1
- package/skills/{fui-skill → fui}/references/platform-architecture.md +269 -269
- package/skills/{fui-skill → fui}/references/project-config.md +303 -303
- package/skills/{fui-skill → fui}/references/project-provisioning.md +4 -4
- package/skills/{fui-skill → fui}/references/script-map.md +262 -262
- package/skills/{fui-skill → fui}/references/sql-clr-functions.md +225 -225
- package/skills/{fui-skill → fui}/references/system-design.md +2 -2
- package/skills/{fui-skill → fui}/references/tapi-permission-patterns.md +156 -156
- package/skills/{fui-skill → fui}/references/tapi-reference.md +474 -474
- package/skills/fui/references/team-run.md +141 -0
- package/skills/fui/references/tools-registry.md +211 -0
- package/skills/{fui-skill → fui}/references/ui-crosswindow-patterns.md +321 -321
- package/skills/{fui-skill → fui}/references/ui-dialog-patterns.md +255 -255
- package/skills/{fui-skill → fui}/references/ui-layout-patterns.md +176 -176
- package/skills/{fui-skill → fui}/references/ui-patterns.md +303 -303
- package/skills/{fui-skill → fui}/references/ui-screenshot-review.md +95 -95
- package/skills/{fui-skill → fui}/references/ui-table-cell-patterns.md +318 -318
- package/skills/{fui-skill → fui}/references/verification.md +11 -11
- package/skills/{fui-skill → fui}/references/watcher-patterns.md +163 -163
- package/skills/{fui-skill → fui}/references/websocket-realtime.md +271 -271
- package/skills/{fui-skill → fui}/scripts/component-3.0.js +2715 -2715
- package/skills/{fui-skill → fui}/scripts/component.js +3147 -3147
- package/skills/{fui-skill → fui}/scripts/componentTable-3.0.js +1038 -1038
- package/skills/{fui-skill → fui}/scripts/componentTable.js +891 -891
- package/skills/{fui-skill → fui}/scripts/defaultfunction-3.0.js +866 -866
- package/skills/{fui-skill → fui}/scripts/defaultfunction.js +1051 -1051
- package/skills/{fui-skill → fui}/scripts/fastproject-3.0.js +870 -870
- package/skills/{fui-skill → fui}/scripts/fastproject.js +828 -828
- package/skills/fui-target/hooks/register.tsx +2 -0
- package/skills/fui-target/types/index.d.ts +1 -0
- package/dist/fui-hk5frcn2.js +0 -381
- package/skills/fui-skill/SKILL.md +0 -139
- package/skills/fui-skill/references/tools-registry.md +0 -84
- /package/skills/{fui-skill → fui}/assets/projectdefaultstyle-3.0.css +0 -0
- /package/skills/{fui-skill → fui}/design-md/airbnb/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/airbnb/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/airtable/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/airtable/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/apple/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/apple/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/asu/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/asu/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/binance/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/binance/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/bmw/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/bmw/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/bmw-m/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/bmw-m/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/bugatti/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/bugatti/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/cal/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/cal/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/claude/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/claude/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/clay/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/clay/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/clickhouse/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/clickhouse/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/cohere/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/cohere/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/coinbase/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/coinbase/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/composio/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/composio/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/cursor/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/cursor/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/elevenlabs/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/elevenlabs/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/expo/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/expo/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/ferrari/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/ferrari/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/figma/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/figma/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/framer/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/framer/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/fui/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/hashicorp/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/hashicorp/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/ibm/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/ibm/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/intercom/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/intercom/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/kraken/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/kraken/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/lamborghini/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/lamborghini/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/linear.app/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/linear.app/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/lovable/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/lovable/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mastercard/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mastercard/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/meta/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/meta/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/minimax/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/minimax/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mintlify/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mintlify/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/miro/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/miro/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mistral.ai/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mistral.ai/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mongodb/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/mongodb/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/nike/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/nike/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/notion/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/notion/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/nvidia/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/nvidia/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/ollama/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/ollama/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/opencode.ai/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/opencode.ai/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/pinterest/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/pinterest/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/playstation/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/playstation/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/posthog/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/posthog/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/raycast/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/raycast/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/renault/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/renault/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/replicate/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/replicate/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/resend/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/resend/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/revolut/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/revolut/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/runwayml/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/runwayml/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/sanity/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/sanity/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/sentry/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/sentry/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/shopify/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/shopify/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/slack/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/spacex/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/spacex/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/spotify/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/spotify/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/starbucks/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/starbucks/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/stripe/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/stripe/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/supabase/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/supabase/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/superhuman/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/superhuman/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/tesla/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/tesla/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/theverge/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/theverge/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/together.ai/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/together.ai/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/uber/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/uber/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/vercel/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/vercel/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/vodafone/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/vodafone/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/voltagent/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/voltagent/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/warp/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/warp/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/webflow/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/webflow/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/wired/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/wired/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/wise/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/wise/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/x.ai/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/x.ai/README.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/zapier/DESIGN.md +0 -0
- /package/skills/{fui-skill → fui}/design-md/zapier/README.md +0 -0
- /package/skills/{fui-skill → fui}/examples/f-table-patterns.json +0 -0
- /package/skills/{fui-skill → fui}/examples/module-patterns.json +0 -0
- /package/skills/{fui-skill → fui}/examples/project-patterns.json +0 -0
- /package/skills/{fui-skill → fui}/references/coding-standards.md +0 -0
- /package/skills/{fui-skill → fui}/references/db-table-design.md +0 -0
- /package/skills/{fui-skill → fui}/references/fsheet.md +0 -0
- /package/skills/{fui-skill → fui}/references/tapi-file-api.md +0 -0
- /package/skills/{fui-skill → fui}/references/ui-templates.md +0 -0
- /package/skills/{fui-skill → fui}/scripts/fechart.js +0 -0
- /package/skills/{fui-skill → fui}/scripts/fsheet.js +0 -0
|
@@ -1,262 +1,262 @@
|
|
|
1
|
-
# FUI Script Map
|
|
2
|
-
|
|
3
|
-
> Owns: **bundled libraries (§0) and the FUI script source map — which function lives in which file/line**. Function usage: [default-function.md](default-function.md). Read framework sources with `fui library <name>`.
|
|
4
|
-
|
|
5
|
-
> **File by framework** — check `_moduleInfo.json.Framework` (`"V2"` or `"V3"`):
|
|
6
|
-
>
|
|
7
|
-
> | Content | V2 file | V3 file |
|
|
8
|
-
> | --------------------------------------------- | -------------------------------- | -------------------------------- |
|
|
9
|
-
> | Core engine (action, API, layout) | `scripts/fastproject.js` | `scripts/fastproject-3.0.js` |
|
|
10
|
-
> | Utilities (router, export, auth, WS) | `scripts/defaultfunction.js` | `scripts/defaultfunction-3.0.js` |
|
|
11
|
-
> | Component registry (`f-*`, dialog, editor...) | `scripts/component.js` | `scripts/component-3.0.js` |
|
|
12
|
-
> | Table system (`f-table`, `t-*`) | `scripts/componentTable.js` | `scripts/componentTable-3.0.js` |
|
|
13
|
-
> | Chart (`f-echart`) | `scripts/fechart.js` | `scripts/fechart.js` |
|
|
14
|
-
> | Input sheet (`f-sheet`) | `scripts/fsheet.js` (shared, §5) | `scripts/fsheet.js` (shared, §5) |
|
|
15
|
-
|
|
16
|
-
FUI conventions:
|
|
17
|
-
|
|
18
|
-
- Metadata is `module.json` (not `controls.json`).
|
|
19
|
-
- Call action logic via `CALL(vueData.actionName)` or the Action Protocol.
|
|
20
|
-
- `controls` layout is always `container > rows > cols`.
|
|
21
|
-
- JSON events use `v-on:...` (not `@...`).
|
|
22
|
-
- Literal forcing (`` ` `` or `'...'`) is for Action `IN` mapping, not normal static component props.
|
|
23
|
-
|
|
24
|
-
## 0) Bundled libraries (FUI V2)
|
|
25
|
-
|
|
26
|
-
Auto-loaded into **every** module — no import needed; use them instead of equivalents. **Never add a CDN** for any of them — re-adding causes conflicts.
|
|
27
|
-
|
|
28
|
-
> ⛔ **Applies ONLY to `HTMLOnly=false`.** `HTMLOnly: true` modules get nothing preloaded (no Vue, Vuetify, jQuery, lodash, MDI, `projectdefaultstyle.css`); there CDNs are **required**: see [module-structure.md §HTMLOnly=true:
|
|
29
|
-
|
|
30
|
-
CSS: Roboto · Material Design Icons (`mdi-*`) · Vuetify · vue-toast-notification · jquery-confirm · FUI projectdefaultstyle.css
|
|
31
|
-
|
|
32
|
-
| Global | Library | Use |
|
|
33
|
-
| ---------------------------- | ---------------------- | -------------------------------------------- |
|
|
34
|
-
| `$`, `jQuery` | jQuery 3.6.0 | DOM, AJAX |
|
|
35
|
-
| `$.confirm()` / `$.dialog()` | jquery-confirm | Styled dialogs (instead of `window.confirm`) |
|
|
36
|
-
| `_` | Lodash 4.17 | Array/object utils |
|
|
37
|
-
| `moment` | Moment.js (vi) | Dates, Vietnamese locale preset |
|
|
38
|
-
| `numeral` | Numeral.js | Number/currency format |
|
|
39
|
-
| `Vue.$toast` | vue-toast-notification | Toasts |
|
|
40
|
-
|
|
41
|
-
FUI JS (loaded after the above): `defaultfunction.js` (`jsonToExcel`, `pushRouter`, `openWindow`, `CALL`, `confirm`, `showMessage`, ...) · `component.js` (all `f-*`: `f-table`, `f-form`, `f-echart`, ...) · `componentTable.js` (table helpers) · `fastproject.js` (bootstrapper).
|
|
42
|
-
|
|
43
|
-
```js
|
|
44
|
-
// Toast thông báo
|
|
45
|
-
Vue.$toast.success("Lưu thành công", { position: "top" });
|
|
46
|
-
Vue.$toast.error("Có lỗi xảy ra", { position: "top" });
|
|
47
|
-
|
|
48
|
-
// Dialog xác nhận (FUI wrapper — dùng hàm confirm() từ defaultfunction.js)
|
|
49
|
-
confirm({
|
|
50
|
-
title: "Xác nhận xóa",
|
|
51
|
-
message: "Bạn có chắc muốn xóa không?",
|
|
52
|
-
action: function () {
|
|
53
|
-
/* xử lý khi OK */
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Dialog thông báo (FUI wrapper)
|
|
58
|
-
showMessage({ title: "Thông báo", message: "Đã lưu thành công" });
|
|
59
|
-
|
|
60
|
-
// Lodash — dùng trong script.js / vueData
|
|
61
|
-
_.find(vueData.list, { id: 5 });
|
|
62
|
-
_.groupBy(vueData.data, "loai");
|
|
63
|
-
_.sumBy(items, "soLuong");
|
|
64
|
-
_.cloneDeep(vueData.formData);
|
|
65
|
-
_.debounce(fn, 300);
|
|
66
|
-
|
|
67
|
-
// Moment — format ngày
|
|
68
|
-
moment(val).format("DD/MM/YYYY");
|
|
69
|
-
moment(val).format("DD/MM/YYYY HH:mm");
|
|
70
|
-
moment().subtract(7, "days").format("YYYY-MM-DD");
|
|
71
|
-
|
|
72
|
-
// Numeral — format số
|
|
73
|
-
numeral(value).format("0,0"); // 1,234,567
|
|
74
|
-
numeral(value).format("0,0.0"); // 1,234,567.8
|
|
75
|
-
numeral(_.sumBy(items, key)).format("0,0"); // tổng cột trong bảng
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
> `f-*` needing extra JS/CSS: [component-quickref.md](component-quickref.md) §Components needing JS/CSS imports.
|
|
79
|
-
|
|
80
|
-
## 1) scripts/fastproject.js — V3: fastproject-3.0.js
|
|
81
|
-
|
|
82
|
-
Core engine: init module, build DOM from `module.json.controls`, run actions, map data, call APIs.
|
|
83
|
-
|
|
84
|
-
Init: `$(document).ready` → `loadModuleInfo()` (merge config, read URL/user info) → `createModuleDom()` (`runAction($moduleUI.data)` + render controls) → `createWatch()` (watchers from `$moduleUI.watch`) → Vue mounts.
|
|
85
|
-
|
|
86
|
-
| Line | Function | Purpose |
|
|
87
|
-
| ---: | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
-
| 65 | `buildParamURL()` | Query string → `vueData` |
|
|
89
|
-
| 77 | `loadModuleInfo()` | Load project/module config, user info |
|
|
90
|
-
| 122 | `createModuleDom()` | Main layout, render controls, init watch |
|
|
91
|
-
| 210 | `buildModuleUI(controlsList, target)` | Recursive UI from JSON controls |
|
|
92
|
-
| 233 | `buildControl(controlsList, flex, target)` | One control: attr/event/import |
|
|
93
|
-
| 299 | `addImport(importArr)` | Load control script/css deps |
|
|
94
|
-
| 310 | `createWatch_Data(obj)` | Init watch data |
|
|
95
|
-
| 320 | `createWatch(obj)` | Attach watchers from `watch` |
|
|
96
|
-
| 345 | `buildVisualValForObj(controlAttr, target)` | Bind dynamic values into attrs |
|
|
97
|
-
| 373 | `runAction(obj, includeData)` | Action engine (object/array) |
|
|
98
|
-
| 407 | `vueAction(objAction, includeData, callBack)` | One action (IF/API/CALL/EXE/...) |
|
|
99
|
-
| 485 | `mapData(map, target, src, includeData)` | Map data between objects |
|
|
100
|
-
| 527 | `defProp(obj)` | Normalize object props for context |
|
|
101
|
-
| 537 | `bindData(obj)` | Resolve dynamic string/object |
|
|
102
|
-
| 542 | `getVueData(key, src)` | Value by path (`vueData.x.y`, `item.x`, template...). Literal forcing is for `IN` mapping; static props without `:` are already plain strings. |
|
|
103
|
-
| 578 | `setValue(target, key, value, srcData, index)` | Set by path on object/window |
|
|
104
|
-
| 612 | `bindDataToString(str, data)` | Resolve template string |
|
|
105
|
-
| 619 | `templateCompiled(str, data)` | Compile lodash-style template |
|
|
106
|
-
| 624 | `getWindowData(value)` | Read window/iframe context |
|
|
107
|
-
| 638 | `setWindowData(key, value)` | Write window/iframe context |
|
|
108
|
-
| 657 | `runFunction(obj, callback)` | Call declared JS function |
|
|
109
|
-
| 665 | `tableActionEvent(ctrl)` | Table/control action events |
|
|
110
|
-
| 687 | `callAPI(objApi, callBack, includeData)` | API call (`IN/OUT/CALLBACK`) |
|
|
111
|
-
| 743 | `loginFUN()` | Login/redirect |
|
|
112
|
-
| 761 | `errorMess(code, message)` | Standard error display |
|
|
113
|
-
|
|
114
|
-
## 2) scripts/defaultfunction.js — V3: defaultfunction-3.0.js
|
|
115
|
-
|
|
116
|
-
Shared utilities (router, messaging, transform, AJAX, export, auth, websocket).
|
|
117
|
-
|
|
118
|
-
| Line | Function | Purpose |
|
|
119
|
-
| ---: | ------------------------------------------------------ | ------------------------------------- |
|
|
120
|
-
| 35 | `extractHostname(url)` | Hostname |
|
|
121
|
-
| 53 | `getDomainWithoutSubdomain(url)` | Root domain |
|
|
122
|
-
| 62 | `loadScripts(scriptsArray, callbackFunc)` | Load scripts, then callback |
|
|
123
|
-
| 75 | `pushRouter(router)` | Push browser history |
|
|
124
|
-
| 82 | `CALL(obj, includeData)` | Alias of `runAction(...)` |
|
|
125
|
-
| 86 | `windowSendMessage(window, cmd, data)` | `postMessage` to parent/window/iframe |
|
|
126
|
-
| 100 | `appCommand(cmdData)` | Command to native wrapper (RN/WebKit) |
|
|
127
|
-
| 106 | `buildHeader(obj, mapCol)` | Table headers from data/column map |
|
|
128
|
-
| 130 | `fillData(obj)` | Map source → destination |
|
|
129
|
-
| 162 | `groupBy(arrayObj, groupField, sumArr)` | Group + sum columns |
|
|
130
|
-
| 188 | `chartDataBuild(obj)` | Generic chart data |
|
|
131
|
-
| 219 | `chartQABuild(obj)` | QA/report chart data |
|
|
132
|
-
| 239 | `confirm(obj)` | Confirm dialog |
|
|
133
|
-
| 259 | `showMessage(obj)` | Message dialog/toast |
|
|
134
|
-
| 283 | `rightTest(rightObject)` | Check user rights |
|
|
135
|
-
| 301 | `openWindow(obj)` | FUI popup/dialog window |
|
|
136
|
-
| 326 | `redirect(obj, query)` | Navigate by URL/config |
|
|
137
|
-
| 339 | `reload()` | Reload page |
|
|
138
|
-
| 343 | `findInArray(obj)` | Find by value condition |
|
|
139
|
-
| 348 | `fixURL(url)` | Normalize URL (prepend API domain) |
|
|
140
|
-
| 354 | `stringAttrToJson(str, removeVueEvent)` | HTML attr string → JSON |
|
|
141
|
-
| 371 | `json_data_parse(obj, level)` | Parse `json_data:` fields recursively |
|
|
142
|
-
| 407 | `ajaxCALL(URL, DATA, callBack, errorCallBack, header)` | AJAX POST |
|
|
143
|
-
| 449 | `capacityText(numb)` | Bytes → KB/MB |
|
|
144
|
-
| 454 | `generateID()` | Random ID |
|
|
145
|
-
| 467 | `printPDF(obj)` | PDF via `pdfMake` |
|
|
146
|
-
| 499 | `colorLib(color)` | Color utils |
|
|
147
|
-
| 645 | `transparentize(value, opacity)` | Alpha color |
|
|
148
|
-
| 650 | `jsonToExcel(Obj)` | JSON → Excel |
|
|
149
|
-
| 746 | `copyToClipboard(textToCopy)` | Clipboard |
|
|
150
|
-
| 770 | `fileNameClear(fname)` | Sanitize file name |
|
|
151
|
-
| 775 | `hashCode(s)` | String hash |
|
|
152
|
-
| 785 | `getCookie(cname)` | Read cookie |
|
|
153
|
-
| 800 | `setCookie(name, value, days, domain)` | Set cookie |
|
|
154
|
-
| 814 | `logout(cookiesName, domain, url)` | Clear cookies, logout/redirect |
|
|
155
|
-
| 827 | `webSocketJoinGroup(groupObj, timeout, callBackFunc)` | Join WS group |
|
|
156
|
-
| 851 | `webSocketConnection(wsURL, WS, wsState)` | Create/keep WS connection |
|
|
157
|
-
| 892 | `webSocket_Send(obj)` | Send over WS |
|
|
158
|
-
|
|
159
|
-
> **Real-time (SignalR)** — required imports, `data[]` group declaration, send/receive, full `module.json`: [websocket-realtime.md](websocket-realtime.md).
|
|
160
|
-
|
|
161
|
-
## 3) scripts/component.js — V3: component-3.0.js
|
|
162
|
-
|
|
163
|
-
Base `f-*` and business components. Also holds `defaultControlAttr` (default attrs per `el`). Many need external imports (CKEditor, pdfMake, cropper, chart, ...).
|
|
164
|
-
|
|
165
|
-
| Line | Component | Purpose |
|
|
166
|
-
| ---: | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
167
|
-
| 304 | `f-label` | Formatted label/text |
|
|
168
|
-
| 319 | `f-box` | Simple box/card |
|
|
169
|
-
| 377 | `f-header` | Light section header |
|
|
170
|
-
| 386 | `f-title` | Title |
|
|
171
|
-
| 395 | `f-radiobox` | Radio group |
|
|
172
|
-
| 425 | `f-menu` | Menu/navigation |
|
|
173
|
-
| 472 | `f-search` | Search input |
|
|
174
|
-
| 536 | `f-button` | Button |
|
|
175
|
-
| 607 | `f-slider` | Slider |
|
|
176
|
-
| 618 | `f-file-upload` | File upload |
|
|
177
|
-
| 768 | `f-qrcode` | QR render |
|
|
178
|
-
| 843 | `f-qrcode-reader` | QR scan |
|
|
179
|
-
| 914 | `f-image-update` | Crop/rotate/upload image dialog |
|
|
180
|
-
| 1161 | `f-date` | Date picker |
|
|
181
|
-
| 1434 | `f-time` | Time picker |
|
|
182
|
-
| 1639 | `f-time-counter` | Counter/countdown/clock |
|
|
183
|
-
| 1775 | `fp-profile` | Header profile menu |
|
|
184
|
-
| 2020 | `header-bar` | Main header bar |
|
|
185
|
-
| 2277 | `f-chart` | Legacy Chart.js (props `data`/`type`/`options`). Use `f-echart` — [components-echart.md](components-echart.md) |
|
|
186
|
-
| 2389 | `f-window` | Dynamic window/dialog host |
|
|
187
|
-
| 2453 | `f-editor` | WYSIWYG (CKEditor) |
|
|
188
|
-
| 2591 | `f-editor-dialog` | Fullscreen editor dialog |
|
|
189
|
-
| 2687 | `f-dialog` | Dialog built from `controls` |
|
|
190
|
-
| 2899 | `f-pdfmake` | PDF viewer via `printPDF` |
|
|
191
|
-
| 2934 | `f-excel-reader` | Excel/CSV → object array: sheet pick, skip N rows, key names, size limit; XLSX lazy-loaded. [components-input.md](components-input.md) |
|
|
192
|
-
|
|
193
|
-
## 4) scripts/componentTable.js — V3: componentTable-3.0.js (§4b)
|
|
194
|
-
|
|
195
|
-
| Line | Component | Purpose |
|
|
196
|
-
| ---: | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
197
|
-
| 1 | `f-table` | The only data table (CRUD and readonly): search, select, CRUD (`update-api`, `update-form`), export, auto headers when `headers` omitted, sum row/line via `sumFormat` (object/string), `:height` |
|
|
198
|
-
| 416 | `t-html` | HTML cell |
|
|
199
|
-
| 420 | `t-label` | Text cell |
|
|
200
|
-
| 424 | `t-num` | Number cell |
|
|
201
|
-
| 442 | `t-time` | Time cell |
|
|
202
|
-
| 452 | `t-boolean` | Bool icon/color |
|
|
203
|
-
| 473 | `t-check` | Checkbox cell |
|
|
204
|
-
| 501 | `t-text` | Inline text input |
|
|
205
|
-
| 523 | `t-select` | Inline select |
|
|
206
|
-
| 544 | `t-combobox` | Inline combobox |
|
|
207
|
-
| 616 | `t-menu` | Action menu cell |
|
|
208
|
-
| 654 | `t-link` | Link / open-dialog cell |
|
|
209
|
-
| 678 | `t-button` | Action button cell |
|
|
210
|
-
|
|
211
|
-
**`f-table` `:height`** — computed `heightNum`/`tableHeight` + `updateFillHeight()`: empty = grows with rows; `<=0` = measures real `getBoundingClientRect()`, fills to screen bottom leaving `abs(n)` px (`window.resize` listener); `>0` = fixed px.
|
|
212
|
-
|
|
213
|
-
## 4b) scripts/componentTable-3.0.js
|
|
214
|
-
|
|
215
|
-
**V3** (Vue 3 + Vuetify 3) of the same components, PascalCase names (`FTable`, `THtml`, `TNum`, ...). Module framework (`_moduleInfo.json`) picks the file.
|
|
216
|
-
|
|
217
|
-
When editing **both** files:
|
|
218
|
-
|
|
219
|
-
- Lifecycle: V3 `beforeUnmount` (components declare both to run on V2 and V3).
|
|
220
|
-
- Classes: V3 `text-primary` / `text-subtitle-1` / `text-caption` vs V2 `primary--text` / `subtitle-1` / `caption`; `v-btn outlined` (V2) → `variant="outlined"` (V3).
|
|
221
|
-
- `v-data-table` scroll wrapper: V2 `.v-data-table__wrapper`, V3 `.v-table__wrapper`.
|
|
222
|
-
- Names bound directly in a V3 template **must not start with `_`** (proxy `has` trap) — use a suffix, e.g. `hideDefaultFooter_cacl`.
|
|
223
|
-
- `f-table` `headers`: V2 `{ text, value }`, V3 `{ title, key }`; slot `body.append` gets `{ headers }` (V2) / `{ columns }` (V3).
|
|
224
|
-
|
|
225
|
-
Verify V3
|
|
226
|
-
|
|
227
|
-
## 5) scripts/fsheet.js — shared V2 + V3
|
|
228
|
-
|
|
229
|
-
Whole `f-sheet` in **one file** for V2 and V3 (declares both `beforeDestroy` and `beforeUnmount`); not split by framework.
|
|
230
|
-
|
|
231
|
-
Required imports (from `component.js` `defaultControlAttr["f-sheet"].import`), **in this order**:
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
/include/ag-grid/ag-grid-community.min.js
|
|
235
|
-
/include/ag-grid/fsheet.js
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
| Content | Notes |
|
|
239
|
-
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
240
|
-
| `Vue.component('FSheet', {...})` | Main component — props/columns/API: [fsheet.md](fsheet.md) |
|
|
241
|
-
| 4 cell renderers (`fsHtmlCellRenderer`/`fsLinkCellRenderer`/`fsButtonCellRenderer`/`fsMenuCellRenderer`) | = `f-table`'s `t-html`/`t-link`/`t-button`/`t-menu` — [fsheet.md](fsheet.md) |
|
|
242
|
-
| Custom range selection + fill handle + TSV clipboard | AG Grid Community lacks Cell Selection (Enterprise), so f-sheet drives it and applies AG Grid classes (`.ag-cell-range-*`, `.ag-selection-fill-*`, `.ag-fill-handle`) |
|
|
243
|
-
|
|
244
|
-
`:height` has the same 3 modes (auto-grow / fill to bottom / fixed px) — [fsheet.md](fsheet.md) §`:height`.
|
|
245
|
-
|
|
246
|
-
Verify `fsheet.js`: `fui component preview` (isolated `f-sheet` with sample data, no push) or `fui module simulate --render` (in a real module) — both real browser, no extra harness.
|
|
247
|
-
|
|
248
|
-
## 6) Lookup by task
|
|
249
|
-
|
|
250
|
-
> Files listed are V2; for **V3** use the matching `-3.0` file.
|
|
251
|
-
|
|
252
|
-
| Task | Open first | Look at |
|
|
253
|
-
| ------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
254
|
-
| Layout renders wrong | `fastproject.js` | `buildModuleUI`, `buildControl`, `bindData` |
|
|
255
|
-
| Action not running / wrong branch | `fastproject.js` | `runAction`, `vueAction`, `mapData`, `getVueData` |
|
|
256
|
-
| API returns no `OUT` | `fastproject.js` + `defaultfunction.js` | `callAPI`, `fixURL`, `ajaxCALL` |
|
|
257
|
-
| Table Add/Edit/Delete fails | `componentTable.js` | `f-table` + `update-api`, `update-form` |
|
|
258
|
-
| Dynamic dialog not binding | `component.js` | `f-dialog`, `buildModuleUI` (fastproject) |
|
|
259
|
-
| Image upload/crop/save | `component.js` | `f-image-update` |
|
|
260
|
-
| Excel/PDF export | `defaultfunction.js` + `component.js` | `jsonToExcel`, `printPDF`, `f-pdfmake`, `f-excel-reader` |
|
|
261
|
-
| Login/rights/menu | `fastproject.js` + `defaultfunction.js` | `loadModuleInfo`, `loginFUN`, `rightTest` |
|
|
262
|
-
| `f-sheet` missing / "FSheet is not defined" | `fsheet.js` (shared V2+V3) | Missing import — [component-quickref.md](component-quickref.md) or [fsheet.md](fsheet.md) |
|
|
1
|
+
# FUI Script Map
|
|
2
|
+
|
|
3
|
+
> Owns: **bundled libraries (§0) and the FUI script source map — which function lives in which file/line**. Function usage: [default-function.md](default-function.md). Read framework sources with `fui library <name>`.
|
|
4
|
+
|
|
5
|
+
> **File by framework** — check `_moduleInfo.json.Framework` (`"V2"` or `"V3"`):
|
|
6
|
+
>
|
|
7
|
+
> | Content | V2 file | V3 file |
|
|
8
|
+
> | --------------------------------------------- | -------------------------------- | -------------------------------- |
|
|
9
|
+
> | Core engine (action, API, layout) | `scripts/fastproject.js` | `scripts/fastproject-3.0.js` |
|
|
10
|
+
> | Utilities (router, export, auth, WS) | `scripts/defaultfunction.js` | `scripts/defaultfunction-3.0.js` |
|
|
11
|
+
> | Component registry (`f-*`, dialog, editor...) | `scripts/component.js` | `scripts/component-3.0.js` |
|
|
12
|
+
> | Table system (`f-table`, `t-*`) | `scripts/componentTable.js` | `scripts/componentTable-3.0.js` |
|
|
13
|
+
> | Chart (`f-echart`) | `scripts/fechart.js` | `scripts/fechart.js` |
|
|
14
|
+
> | Input sheet (`f-sheet`) | `scripts/fsheet.js` (shared, §5) | `scripts/fsheet.js` (shared, §5) |
|
|
15
|
+
|
|
16
|
+
FUI conventions:
|
|
17
|
+
|
|
18
|
+
- Metadata is `module.json` (not `controls.json`).
|
|
19
|
+
- Call action logic via `CALL(vueData.actionName)` or the Action Protocol.
|
|
20
|
+
- `controls` layout is always `container > rows > cols`.
|
|
21
|
+
- JSON events use `v-on:...` (not `@...`).
|
|
22
|
+
- Literal forcing (`` ` `` or `'...'`) is for Action `IN` mapping, not normal static component props.
|
|
23
|
+
|
|
24
|
+
## 0) Bundled libraries (FUI V2)
|
|
25
|
+
|
|
26
|
+
Auto-loaded into **every** module — no import needed; use them instead of equivalents. **Never add a CDN** for any of them — re-adding causes conflicts.
|
|
27
|
+
|
|
28
|
+
> ⛔ **Applies ONLY to `HTMLOnly=false`.** `HTMLOnly: true` modules get nothing preloaded (no Vue, Vuetify, jQuery, lodash, MDI, `projectdefaultstyle.css`); there CDNs are **required**: see [module-structure.md §"HTMLOnly=true: no library is embedded"](module-structure.md).
|
|
29
|
+
|
|
30
|
+
CSS: Roboto · Material Design Icons (`mdi-*`) · Vuetify · vue-toast-notification · jquery-confirm · FUI projectdefaultstyle.css
|
|
31
|
+
|
|
32
|
+
| Global | Library | Use |
|
|
33
|
+
| ---------------------------- | ---------------------- | -------------------------------------------- |
|
|
34
|
+
| `$`, `jQuery` | jQuery 3.6.0 | DOM, AJAX |
|
|
35
|
+
| `$.confirm()` / `$.dialog()` | jquery-confirm | Styled dialogs (instead of `window.confirm`) |
|
|
36
|
+
| `_` | Lodash 4.17 | Array/object utils |
|
|
37
|
+
| `moment` | Moment.js (vi) | Dates, Vietnamese locale preset |
|
|
38
|
+
| `numeral` | Numeral.js | Number/currency format |
|
|
39
|
+
| `Vue.$toast` | vue-toast-notification | Toasts |
|
|
40
|
+
|
|
41
|
+
FUI JS (loaded after the above): `defaultfunction.js` (`jsonToExcel`, `pushRouter`, `openWindow`, `CALL`, `confirm`, `showMessage`, ...) · `component.js` (all `f-*`: `f-table`, `f-form`, `f-echart`, ...) · `componentTable.js` (table helpers) · `fastproject.js` (bootstrapper).
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
// Toast thông báo
|
|
45
|
+
Vue.$toast.success("Lưu thành công", { position: "top" });
|
|
46
|
+
Vue.$toast.error("Có lỗi xảy ra", { position: "top" });
|
|
47
|
+
|
|
48
|
+
// Dialog xác nhận (FUI wrapper — dùng hàm confirm() từ defaultfunction.js)
|
|
49
|
+
confirm({
|
|
50
|
+
title: "Xác nhận xóa",
|
|
51
|
+
message: "Bạn có chắc muốn xóa không?",
|
|
52
|
+
action: function () {
|
|
53
|
+
/* xử lý khi OK */
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Dialog thông báo (FUI wrapper)
|
|
58
|
+
showMessage({ title: "Thông báo", message: "Đã lưu thành công" });
|
|
59
|
+
|
|
60
|
+
// Lodash — dùng trong script.js / vueData
|
|
61
|
+
_.find(vueData.list, { id: 5 });
|
|
62
|
+
_.groupBy(vueData.data, "loai");
|
|
63
|
+
_.sumBy(items, "soLuong");
|
|
64
|
+
_.cloneDeep(vueData.formData);
|
|
65
|
+
_.debounce(fn, 300);
|
|
66
|
+
|
|
67
|
+
// Moment — format ngày
|
|
68
|
+
moment(val).format("DD/MM/YYYY");
|
|
69
|
+
moment(val).format("DD/MM/YYYY HH:mm");
|
|
70
|
+
moment().subtract(7, "days").format("YYYY-MM-DD");
|
|
71
|
+
|
|
72
|
+
// Numeral — format số
|
|
73
|
+
numeral(value).format("0,0"); // 1,234,567
|
|
74
|
+
numeral(value).format("0,0.0"); // 1,234,567.8
|
|
75
|
+
numeral(_.sumBy(items, key)).format("0,0"); // tổng cột trong bảng
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> `f-*` needing extra JS/CSS: [component-quickref.md](component-quickref.md) §Components needing JS/CSS imports.
|
|
79
|
+
|
|
80
|
+
## 1) scripts/fastproject.js — V3: fastproject-3.0.js
|
|
81
|
+
|
|
82
|
+
Core engine: init module, build DOM from `module.json.controls`, run actions, map data, call APIs.
|
|
83
|
+
|
|
84
|
+
Init: `$(document).ready` → `loadModuleInfo()` (merge config, read URL/user info) → `createModuleDom()` (`runAction($moduleUI.data)` + render controls) → `createWatch()` (watchers from `$moduleUI.watch`) → Vue mounts.
|
|
85
|
+
|
|
86
|
+
| Line | Function | Purpose |
|
|
87
|
+
| ---: | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| 65 | `buildParamURL()` | Query string → `vueData` |
|
|
89
|
+
| 77 | `loadModuleInfo()` | Load project/module config, user info |
|
|
90
|
+
| 122 | `createModuleDom()` | Main layout, render controls, init watch |
|
|
91
|
+
| 210 | `buildModuleUI(controlsList, target)` | Recursive UI from JSON controls |
|
|
92
|
+
| 233 | `buildControl(controlsList, flex, target)` | One control: attr/event/import |
|
|
93
|
+
| 299 | `addImport(importArr)` | Load control script/css deps |
|
|
94
|
+
| 310 | `createWatch_Data(obj)` | Init watch data |
|
|
95
|
+
| 320 | `createWatch(obj)` | Attach watchers from `watch` |
|
|
96
|
+
| 345 | `buildVisualValForObj(controlAttr, target)` | Bind dynamic values into attrs |
|
|
97
|
+
| 373 | `runAction(obj, includeData)` | Action engine (object/array) |
|
|
98
|
+
| 407 | `vueAction(objAction, includeData, callBack)` | One action (IF/API/CALL/EXE/...) |
|
|
99
|
+
| 485 | `mapData(map, target, src, includeData)` | Map data between objects |
|
|
100
|
+
| 527 | `defProp(obj)` | Normalize object props for context |
|
|
101
|
+
| 537 | `bindData(obj)` | Resolve dynamic string/object |
|
|
102
|
+
| 542 | `getVueData(key, src)` | Value by path (`vueData.x.y`, `item.x`, template...). Literal forcing is for `IN` mapping; static props without `:` are already plain strings. |
|
|
103
|
+
| 578 | `setValue(target, key, value, srcData, index)` | Set by path on object/window |
|
|
104
|
+
| 612 | `bindDataToString(str, data)` | Resolve template string |
|
|
105
|
+
| 619 | `templateCompiled(str, data)` | Compile lodash-style template |
|
|
106
|
+
| 624 | `getWindowData(value)` | Read window/iframe context |
|
|
107
|
+
| 638 | `setWindowData(key, value)` | Write window/iframe context |
|
|
108
|
+
| 657 | `runFunction(obj, callback)` | Call declared JS function |
|
|
109
|
+
| 665 | `tableActionEvent(ctrl)` | Table/control action events |
|
|
110
|
+
| 687 | `callAPI(objApi, callBack, includeData)` | API call (`IN/OUT/CALLBACK`) |
|
|
111
|
+
| 743 | `loginFUN()` | Login/redirect |
|
|
112
|
+
| 761 | `errorMess(code, message)` | Standard error display |
|
|
113
|
+
|
|
114
|
+
## 2) scripts/defaultfunction.js — V3: defaultfunction-3.0.js
|
|
115
|
+
|
|
116
|
+
Shared utilities (router, messaging, transform, AJAX, export, auth, websocket).
|
|
117
|
+
|
|
118
|
+
| Line | Function | Purpose |
|
|
119
|
+
| ---: | ------------------------------------------------------ | ------------------------------------- |
|
|
120
|
+
| 35 | `extractHostname(url)` | Hostname |
|
|
121
|
+
| 53 | `getDomainWithoutSubdomain(url)` | Root domain |
|
|
122
|
+
| 62 | `loadScripts(scriptsArray, callbackFunc)` | Load scripts, then callback |
|
|
123
|
+
| 75 | `pushRouter(router)` | Push browser history |
|
|
124
|
+
| 82 | `CALL(obj, includeData)` | Alias of `runAction(...)` |
|
|
125
|
+
| 86 | `windowSendMessage(window, cmd, data)` | `postMessage` to parent/window/iframe |
|
|
126
|
+
| 100 | `appCommand(cmdData)` | Command to native wrapper (RN/WebKit) |
|
|
127
|
+
| 106 | `buildHeader(obj, mapCol)` | Table headers from data/column map |
|
|
128
|
+
| 130 | `fillData(obj)` | Map source → destination |
|
|
129
|
+
| 162 | `groupBy(arrayObj, groupField, sumArr)` | Group + sum columns |
|
|
130
|
+
| 188 | `chartDataBuild(obj)` | Generic chart data |
|
|
131
|
+
| 219 | `chartQABuild(obj)` | QA/report chart data |
|
|
132
|
+
| 239 | `confirm(obj)` | Confirm dialog |
|
|
133
|
+
| 259 | `showMessage(obj)` | Message dialog/toast |
|
|
134
|
+
| 283 | `rightTest(rightObject)` | Check user rights |
|
|
135
|
+
| 301 | `openWindow(obj)` | FUI popup/dialog window |
|
|
136
|
+
| 326 | `redirect(obj, query)` | Navigate by URL/config |
|
|
137
|
+
| 339 | `reload()` | Reload page |
|
|
138
|
+
| 343 | `findInArray(obj)` | Find by value condition |
|
|
139
|
+
| 348 | `fixURL(url)` | Normalize URL (prepend API domain) |
|
|
140
|
+
| 354 | `stringAttrToJson(str, removeVueEvent)` | HTML attr string → JSON |
|
|
141
|
+
| 371 | `json_data_parse(obj, level)` | Parse `json_data:` fields recursively |
|
|
142
|
+
| 407 | `ajaxCALL(URL, DATA, callBack, errorCallBack, header)` | AJAX POST |
|
|
143
|
+
| 449 | `capacityText(numb)` | Bytes → KB/MB |
|
|
144
|
+
| 454 | `generateID()` | Random ID |
|
|
145
|
+
| 467 | `printPDF(obj)` | PDF via `pdfMake` |
|
|
146
|
+
| 499 | `colorLib(color)` | Color utils |
|
|
147
|
+
| 645 | `transparentize(value, opacity)` | Alpha color |
|
|
148
|
+
| 650 | `jsonToExcel(Obj)` | JSON → Excel |
|
|
149
|
+
| 746 | `copyToClipboard(textToCopy)` | Clipboard |
|
|
150
|
+
| 770 | `fileNameClear(fname)` | Sanitize file name |
|
|
151
|
+
| 775 | `hashCode(s)` | String hash |
|
|
152
|
+
| 785 | `getCookie(cname)` | Read cookie |
|
|
153
|
+
| 800 | `setCookie(name, value, days, domain)` | Set cookie |
|
|
154
|
+
| 814 | `logout(cookiesName, domain, url)` | Clear cookies, logout/redirect |
|
|
155
|
+
| 827 | `webSocketJoinGroup(groupObj, timeout, callBackFunc)` | Join WS group |
|
|
156
|
+
| 851 | `webSocketConnection(wsURL, WS, wsState)` | Create/keep WS connection |
|
|
157
|
+
| 892 | `webSocket_Send(obj)` | Send over WS |
|
|
158
|
+
|
|
159
|
+
> **Real-time (SignalR)** — required imports, `data[]` group declaration, send/receive, full `module.json`: [websocket-realtime.md](websocket-realtime.md).
|
|
160
|
+
|
|
161
|
+
## 3) scripts/component.js — V3: component-3.0.js
|
|
162
|
+
|
|
163
|
+
Base `f-*` and business components. Also holds `defaultControlAttr` (default attrs per `el`). Many need external imports (CKEditor, pdfMake, cropper, chart, ...).
|
|
164
|
+
|
|
165
|
+
| Line | Component | Purpose |
|
|
166
|
+
| ---: | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
167
|
+
| 304 | `f-label` | Formatted label/text |
|
|
168
|
+
| 319 | `f-box` | Simple box/card |
|
|
169
|
+
| 377 | `f-header` | Light section header |
|
|
170
|
+
| 386 | `f-title` | Title |
|
|
171
|
+
| 395 | `f-radiobox` | Radio group |
|
|
172
|
+
| 425 | `f-menu` | Menu/navigation |
|
|
173
|
+
| 472 | `f-search` | Search input |
|
|
174
|
+
| 536 | `f-button` | Button |
|
|
175
|
+
| 607 | `f-slider` | Slider |
|
|
176
|
+
| 618 | `f-file-upload` | File upload |
|
|
177
|
+
| 768 | `f-qrcode` | QR render |
|
|
178
|
+
| 843 | `f-qrcode-reader` | QR scan |
|
|
179
|
+
| 914 | `f-image-update` | Crop/rotate/upload image dialog |
|
|
180
|
+
| 1161 | `f-date` | Date picker |
|
|
181
|
+
| 1434 | `f-time` | Time picker |
|
|
182
|
+
| 1639 | `f-time-counter` | Counter/countdown/clock |
|
|
183
|
+
| 1775 | `fp-profile` | Header profile menu |
|
|
184
|
+
| 2020 | `header-bar` | Main header bar |
|
|
185
|
+
| 2277 | `f-chart` | Legacy Chart.js (props `data`/`type`/`options`). Use `f-echart` — [components-echart.md](components-echart.md) |
|
|
186
|
+
| 2389 | `f-window` | Dynamic window/dialog host |
|
|
187
|
+
| 2453 | `f-editor` | WYSIWYG (CKEditor) |
|
|
188
|
+
| 2591 | `f-editor-dialog` | Fullscreen editor dialog |
|
|
189
|
+
| 2687 | `f-dialog` | Dialog built from `controls` |
|
|
190
|
+
| 2899 | `f-pdfmake` | PDF viewer via `printPDF` |
|
|
191
|
+
| 2934 | `f-excel-reader` | Excel/CSV → object array: sheet pick, skip N rows, key names, size limit; XLSX lazy-loaded. [components-input.md](components-input.md) |
|
|
192
|
+
|
|
193
|
+
## 4) scripts/componentTable.js — V3: componentTable-3.0.js (§4b)
|
|
194
|
+
|
|
195
|
+
| Line | Component | Purpose |
|
|
196
|
+
| ---: | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
197
|
+
| 1 | `f-table` | The only data table (CRUD and readonly): search, select, CRUD (`update-api`, `update-form`), export, auto headers when `headers` omitted, sum row/line via `sumFormat` (object/string), `:height` |
|
|
198
|
+
| 416 | `t-html` | HTML cell |
|
|
199
|
+
| 420 | `t-label` | Text cell |
|
|
200
|
+
| 424 | `t-num` | Number cell |
|
|
201
|
+
| 442 | `t-time` | Time cell |
|
|
202
|
+
| 452 | `t-boolean` | Bool icon/color |
|
|
203
|
+
| 473 | `t-check` | Checkbox cell |
|
|
204
|
+
| 501 | `t-text` | Inline text input |
|
|
205
|
+
| 523 | `t-select` | Inline select |
|
|
206
|
+
| 544 | `t-combobox` | Inline combobox |
|
|
207
|
+
| 616 | `t-menu` | Action menu cell |
|
|
208
|
+
| 654 | `t-link` | Link / open-dialog cell |
|
|
209
|
+
| 678 | `t-button` | Action button cell |
|
|
210
|
+
|
|
211
|
+
**`f-table` `:height`** — computed `heightNum`/`tableHeight` + `updateFillHeight()`: empty = grows with rows; `<=0` = measures real `getBoundingClientRect()`, fills to screen bottom leaving `abs(n)` px (`window.resize` listener); `>0` = fixed px.
|
|
212
|
+
|
|
213
|
+
## 4b) scripts/componentTable-3.0.js
|
|
214
|
+
|
|
215
|
+
**V3** (Vue 3 + Vuetify 3) of the same components, PascalCase names (`FTable`, `THtml`, `TNum`, ...). Module framework (`_moduleInfo.json`) picks the file.
|
|
216
|
+
|
|
217
|
+
When editing **both** files:
|
|
218
|
+
|
|
219
|
+
- Lifecycle: V3 `beforeUnmount` (components declare both to run on V2 and V3).
|
|
220
|
+
- Classes: V3 `text-primary` / `text-subtitle-1` / `text-caption` vs V2 `primary--text` / `subtitle-1` / `caption`; `v-btn outlined` (V2) → `variant="outlined"` (V3).
|
|
221
|
+
- `v-data-table` scroll wrapper: V2 `.v-data-table__wrapper`, V3 `.v-table__wrapper`.
|
|
222
|
+
- Names bound directly in a V3 template **must not start with `_`** (proxy `has` trap) — use a suffix, e.g. `hideDefaultFooter_cacl`.
|
|
223
|
+
- `f-table` `headers`: V2 `{ text, value }`, V3 `{ title, key }`; slot `body.append` gets `{ headers }` (V2) / `{ columns }` (V3).
|
|
224
|
+
|
|
225
|
+
Verify V3 behavior with `fui module simulate --render` on a V3 module, or `fui component preview` for one component.
|
|
226
|
+
|
|
227
|
+
## 5) scripts/fsheet.js — shared V2 + V3
|
|
228
|
+
|
|
229
|
+
Whole `f-sheet` in **one file** for V2 and V3 (declares both `beforeDestroy` and `beforeUnmount`); not split by framework.
|
|
230
|
+
|
|
231
|
+
Required imports (from `component.js` `defaultControlAttr["f-sheet"].import`), **in this order**:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
/include/ag-grid/ag-grid-community.min.js
|
|
235
|
+
/include/ag-grid/fsheet.js
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
| Content | Notes |
|
|
239
|
+
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
240
|
+
| `Vue.component('FSheet', {...})` | Main component — props/columns/API: [fsheet.md](fsheet.md) |
|
|
241
|
+
| 4 cell renderers (`fsHtmlCellRenderer`/`fsLinkCellRenderer`/`fsButtonCellRenderer`/`fsMenuCellRenderer`) | = `f-table`'s `t-html`/`t-link`/`t-button`/`t-menu` — [fsheet.md](fsheet.md) |
|
|
242
|
+
| Custom range selection + fill handle + TSV clipboard | AG Grid Community lacks Cell Selection (Enterprise), so f-sheet drives it and applies AG Grid classes (`.ag-cell-range-*`, `.ag-selection-fill-*`, `.ag-fill-handle`) |
|
|
243
|
+
|
|
244
|
+
`:height` has the same 3 modes (auto-grow / fill to bottom / fixed px) — [fsheet.md](fsheet.md) §`:height`.
|
|
245
|
+
|
|
246
|
+
Verify `fsheet.js`: `fui component preview` (isolated `f-sheet` with sample data, no push) or `fui module simulate --render` (in a real module) — both real browser, no extra harness.
|
|
247
|
+
|
|
248
|
+
## 6) Lookup by task
|
|
249
|
+
|
|
250
|
+
> Files listed are V2; for **V3** use the matching `-3.0` file.
|
|
251
|
+
|
|
252
|
+
| Task | Open first | Look at |
|
|
253
|
+
| ------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
254
|
+
| Layout renders wrong | `fastproject.js` | `buildModuleUI`, `buildControl`, `bindData` |
|
|
255
|
+
| Action not running / wrong branch | `fastproject.js` | `runAction`, `vueAction`, `mapData`, `getVueData` |
|
|
256
|
+
| API returns no `OUT` | `fastproject.js` + `defaultfunction.js` | `callAPI`, `fixURL`, `ajaxCALL` |
|
|
257
|
+
| Table Add/Edit/Delete fails | `componentTable.js` | `f-table` + `update-api`, `update-form` |
|
|
258
|
+
| Dynamic dialog not binding | `component.js` | `f-dialog`, `buildModuleUI` (fastproject) |
|
|
259
|
+
| Image upload/crop/save | `component.js` | `f-image-update` |
|
|
260
|
+
| Excel/PDF export | `defaultfunction.js` + `component.js` | `jsonToExcel`, `printPDF`, `f-pdfmake`, `f-excel-reader` |
|
|
261
|
+
| Login/rights/menu | `fastproject.js` + `defaultfunction.js` | `loadModuleInfo`, `loginFUN`, `rightTest` |
|
|
262
|
+
| `f-sheet` missing / "FSheet is not defined" | `fsheet.js` (shared V2+V3) | Missing import — [component-quickref.md](component-quickref.md) or [fsheet.md](fsheet.md) |
|