feat: add invoice builder with line detail, address, and person picker.
Enrich invoice line items and previews, migrate several CRM surfaces to Ant, and wire shared money/picker helpers.
This commit is contained in:
@@ -23,7 +23,7 @@ Legacy CRM UI (`components/ui/*`, `.crm-*`, `.btn` / `.field` in `styles/`) rema
|
||||
**No raw** `<input>`, `<select>`, `<textarea>`, or `<button>` may remain in the View **or** in those consumed child components. Prefer native Ant equivalents (`a-select` / `mode="multiple|tags"` / `a-time-picker` / …) over custom pickers when logic allows; if domain logic is required (e.g. Jalali), convert that child file to Ant chrome (`a-input` + `a-popover`, etc.) instead of leaving raw HTML. Do **not** leave legacy `UiInput` / `UiSelect` / `UiButton` / `UiField` / `UiTextarea` in the View or those children.
|
||||
|
||||
3. **Ant-only UI on migrated pages**
|
||||
On a migrated page, build controls with Ant Design Vue (`a-button`, `a-form`, `a-table`, `a-card`, …) and `@ant-design/icons-vue`. Do **not** introduce new usage of `UiButton`, `UiInput`, `.btn`, `.field`, or ad-hoc HTML form controls for the same job.
|
||||
On a migrated page, build controls with Ant Design Vue (`a-button`, `a-form`, `a-table`, `a-card`, …) and icons via `@/icons/ant-bridge` (Vuesax glyphs behind Ant-shaped `*Outlined` names). Do **not** import `@ant-design/icons-vue` directly. Do **not** introduce new usage of `UiButton`, `UiInput`, `.btn`, `.field`, or ad-hoc HTML form controls for the same job.
|
||||
|
||||
4. **Ban manual CSS for layout/look**
|
||||
On migrated pages:
|
||||
@@ -59,7 +59,7 @@ Legacy CRM UI (`components/ui/*`, `.crm-*`, `.btn` / `.field` in `styles/`) rema
|
||||
Visual tokens (primary, radius, `controlHeight`, padding/margin scale, shadows, Form/Card overrides) live only in `antdTheme.ts`. Do not fork theme objects inside views.
|
||||
|
||||
10. **Icons**
|
||||
Use `@ant-design/icons-vue` on migrated pages. Do not expand `UiIcon` for Ant pages.
|
||||
Canonical pack is **Vuesax linear** (`apps/web/src/icons/vuesax-linear.json`), rendered by `VsIcon`. On migrated pages import Ant-shaped names from `@/icons/ant-bridge` (never `@ant-design/icons-vue`). Legacy `UiIcon` also maps to Vuesax — do not expand it for new Ant pages; use `ant-bridge` instead.
|
||||
|
||||
11. **Isolation guarantee**
|
||||
Infrastructure PRs (deps, vite plugin, theme, App `ConfigProvider`) must not change behavior of unmigrated pages. No `ant-design-vue/dist/reset.css` (or similar global reset) unless explicitly approved — it can break legacy CSS.
|
||||
|
||||
@@ -35,7 +35,8 @@ Also read and obey [`.cursor/rules/antd-strict-governance.mdc`](../../rules/antd
|
||||
|
||||
| Piece | Location |
|
||||
|---|---|
|
||||
| Dependency | `ant-design-vue` ^4, `@ant-design/icons-vue`, `unplugin-vue-components` in `@mento/web` |
|
||||
| Dependency | `ant-design-vue` ^4, `@ant-design/icons-vue` (dep only; app code uses bridge), `unplugin-vue-components` in `@mento/web` |
|
||||
| Icons | Canonical = Vuesax via `@/icons/ant-bridge` (Ant `*Outlined` API → `VsIcon`). Never import `@ant-design/icons-vue` in app code. |
|
||||
| Vite plugin | `apps/web/vite.config.ts` — `Components` + `AntDesignVueResolver` |
|
||||
| Theme | `apps/web/src/theme/antdTheme.ts` (`controlHeight: 36`) |
|
||||
| RTL + locale + theme + StyleProvider | `apps/web/src/App.vue` — `<a-style-provider hash-priority="high">` wrapping `<a-config-provider direction="rtl" :locale="faIR" :theme="antdTheme">` (mandatory so legacy `main.css` cannot override Ant) |
|
||||
@@ -56,7 +57,7 @@ Also read and obey [`.cursor/rules/antd-strict-governance.mdc`](../../rules/antd
|
||||
- Modal/Drawer → `a-modal` / `a-drawer`
|
||||
- Table → `a-table` (columns via Ant API)
|
||||
- Page chrome → `a-card`, title + `a-space`, layout via `a-row`/`a-col`
|
||||
- Icons → `@ant-design/icons-vue`
|
||||
- Icons → `import { … } from '@/icons/ant-bridge'` (Vuesax; never `@ant-design/icons-vue`)
|
||||
5. Remove page-local CSS that only existed to skin the old controls.
|
||||
6. Keep business logic, API calls, and router behavior intact.
|
||||
7. Grep-verify zero hits for `<input|<select|<textarea|<button|UiInput|UiSelect|UiField|UiTextarea|UiButton` in the View + converted children.
|
||||
@@ -73,6 +74,7 @@ Also read and obey [`.cursor/rules/antd-strict-governance.mdc`](../../rules/antd
|
||||
## Anti-patterns (reject)
|
||||
|
||||
- Importing both `UiButton` and `a-button` on the same migrated page
|
||||
- Importing icons from `@ant-design/icons-vue` instead of `@/icons/ant-bridge`
|
||||
- Adding `ant-design-vue/dist/reset.css` “to fix spacing”
|
||||
- Editing `components/ui` to “look more like Ant”
|
||||
- `size="small|middle|large"` on Ant controls
|
||||
|
||||
Reference in New Issue
Block a user