@vc-shell/vc-app-skill 2.0.0-alpha.31 → 2.0.0-alpha.33
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/CHANGELOG.md +19 -0
- package/package.json +1 -1
- package/runtime/VERSION +1 -1
- package/runtime/agents/migration-agent.md +83 -0
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/composables/bladeContext/index.docs.md +111 -0
- package/runtime/knowledge/docs/core/composables/useBladeForm/useBladeForm.docs.md +167 -0
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +305 -0
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +83 -0
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +116 -0
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +1 -1
- package/runtime/knowledge/docs/ui/components/atoms/vc-card/vc-card.docs.md +4 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +4 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +5 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +7 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +30 -0
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +28 -0
- package/runtime/knowledge/migration-prompts/blade-form-migration.md +246 -0
- package/runtime/knowledge/migration-prompts/blade-props-migration.md +195 -0
- package/runtime/knowledge/migration-prompts/notifications-migration.md +218 -0
- package/runtime/knowledge/migration-prompts/nswag-migration.md +248 -0
- package/runtime/knowledge/migration-prompts/widgets-migration.md +157 -0
- package/runtime/vc-app.md +126 -0
- package/runtime/knowledge/docs/core/constants/constants.docs.md +0 -185
- /package/runtime/knowledge/docs/shell/{pages → auth}/ChangePasswordPage/change-password-page.docs.md +0 -0
package/runtime/vc-app.md
CHANGED
|
@@ -53,6 +53,7 @@ Parse `$ARGUMENTS` to determine the subcommand:
|
|
|
53
53
|
| `generate ...` | Section: `/vc-app generate` |
|
|
54
54
|
| `promote <moduleName>` | Section: `/vc-app promote` |
|
|
55
55
|
| `design ...` | Section: `/vc-app design` |
|
|
56
|
+
| `migrate` | Section: `/vc-app migrate` |
|
|
56
57
|
| empty / `help` / `--help` | Section: Help |
|
|
57
58
|
|
|
58
59
|
If no arguments match, show the help section.
|
|
@@ -73,6 +74,7 @@ Commands:
|
|
|
73
74
|
/vc-app generate Generate a full UI module from intent (list/details blades, composables, locales)
|
|
74
75
|
/vc-app promote <name> Transition a prototype module from mock data to real API client
|
|
75
76
|
/vc-app design [prompt] Generate a full application from a free-text description (multi-module)
|
|
77
|
+
/vc-app migrate Migrate existing app to latest @vc-shell/framework (CLI + AI)
|
|
76
78
|
|
|
77
79
|
Examples:
|
|
78
80
|
/vc-app create
|
|
@@ -1415,3 +1417,127 @@ Additional context:
|
|
|
1415
1417
|
```
|
|
1416
1418
|
|
|
1417
1419
|
The agent will read its own instruction file, load any required knowledge/pattern files, execute its generation rules, perform its self-check, and report back.
|
|
1420
|
+
|
|
1421
|
+
---
|
|
1422
|
+
|
|
1423
|
+
## /vc-app migrate
|
|
1424
|
+
|
|
1425
|
+
Fully automatic migration to the latest @vc-shell/framework version. Runs the CLI migrator for mechanical transforms, installs updated dependencies, then uses AI to complete manual migrations.
|
|
1426
|
+
|
|
1427
|
+
### Step 1: Pre-flight checks
|
|
1428
|
+
|
|
1429
|
+
1. Verify `@vc-shell/framework` exists in package.json (dependencies or devDependencies). If not found, stop: "This doesn't appear to be a vc-shell project."
|
|
1430
|
+
2. Run `git status --porcelain` — if output is non-empty, warn: "You have uncommitted changes. Commit or stash before migrating." Ask user to confirm before proceeding.
|
|
1431
|
+
3. Read current framework version from package.json for display.
|
|
1432
|
+
|
|
1433
|
+
### Step 2: Run CLI migrator
|
|
1434
|
+
|
|
1435
|
+
Resolve the migrate CLI binary. Run this shell snippet and use the result:
|
|
1436
|
+
|
|
1437
|
+
```bash
|
|
1438
|
+
if [ -n "$VC_SHELL_MIGRATE_CLI" ] && [ -f "$VC_SHELL_MIGRATE_CLI" ]; then
|
|
1439
|
+
echo "node $VC_SHELL_MIGRATE_CLI"
|
|
1440
|
+
elif [ -f "./node_modules/@vc-shell/migrate/dist/cli.js" ]; then
|
|
1441
|
+
echo "node ./node_modules/@vc-shell/migrate/dist/cli.js"
|
|
1442
|
+
else
|
|
1443
|
+
echo "npx @vc-shell/migrate"
|
|
1444
|
+
fi
|
|
1445
|
+
```
|
|
1446
|
+
|
|
1447
|
+
Priority:
|
|
1448
|
+
1. **Env override:** `VC_SHELL_MIGRATE_CLI` env var
|
|
1449
|
+
2. **Project node_modules:** `./node_modules/@vc-shell/migrate/dist/cli.js`
|
|
1450
|
+
3. **npx fallback:** `npx @vc-shell/migrate`
|
|
1451
|
+
|
|
1452
|
+
Run:
|
|
1453
|
+
|
|
1454
|
+
```bash
|
|
1455
|
+
{resolved_migrate_command} --update-deps
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
Display the output to the user. If the command fails, stop and show the error.
|
|
1459
|
+
|
|
1460
|
+
### Step 3: Install dependencies
|
|
1461
|
+
|
|
1462
|
+
Run:
|
|
1463
|
+
|
|
1464
|
+
```bash
|
|
1465
|
+
yarn install
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
If yarn fails (version conflicts, missing packages), stop and show the error. Dependencies must resolve before AI migration can type-check.
|
|
1469
|
+
|
|
1470
|
+
### Step 4: Parse migration report
|
|
1471
|
+
|
|
1472
|
+
Read `MIGRATION_REPORT.md` from project root.
|
|
1473
|
+
|
|
1474
|
+
Parse the "Manual Migration Required" section. Extract each topic heading and the affected files listed under it.
|
|
1475
|
+
|
|
1476
|
+
Map topic headings to migration prompt files and pattern files:
|
|
1477
|
+
|
|
1478
|
+
| Report Heading contains | Migration Prompt | Pattern |
|
|
1479
|
+
|---|---|---|
|
|
1480
|
+
| Widget | `{KNOWLEDGE_BASE}/migration-prompts/widgets-migration.md` | `{KNOWLEDGE_BASE}/patterns/blade-widget.md` |
|
|
1481
|
+
| Form Management / useBladeForm | `{KNOWLEDGE_BASE}/migration-prompts/blade-form-migration.md` | `{KNOWLEDGE_BASE}/patterns/form-validation.md` |
|
|
1482
|
+
| Injection Key | `{KNOWLEDGE_BASE}/migration-prompts/blade-props-migration.md` | `{KNOWLEDGE_BASE}/patterns/blade-navigation.md` |
|
|
1483
|
+
| NSwag / DTO / Clone-then-mutate | `{KNOWLEDGE_BASE}/migration-prompts/nswag-migration.md` | — |
|
|
1484
|
+
| Reusable Blade Components | `{KNOWLEDGE_BASE}/migration-prompts/blade-props-migration.md` | `{KNOWLEDGE_BASE}/patterns/child-blade-flow.md` |
|
|
1485
|
+
| Notification | `{KNOWLEDGE_BASE}/migration-prompts/notifications-migration.md` | `{KNOWLEDGE_BASE}/patterns/signalr-notifications.md` |
|
|
1486
|
+
|
|
1487
|
+
Build the `topics` array for the migration-agent, including only topics that appear in the report.
|
|
1488
|
+
|
|
1489
|
+
### Step 5: Dispatch migration-agent
|
|
1490
|
+
|
|
1491
|
+
If there are topics to process, dispatch the migration-agent subagent:
|
|
1492
|
+
|
|
1493
|
+
**Agent:** `{SKILL_DIR}/agents/migration-agent.md`
|
|
1494
|
+
|
|
1495
|
+
**Input:**
|
|
1496
|
+
|
|
1497
|
+
```json
|
|
1498
|
+
{
|
|
1499
|
+
"cwd": "<project root>",
|
|
1500
|
+
"reportPath": "<path to MIGRATION_REPORT.md>",
|
|
1501
|
+
"topics": [
|
|
1502
|
+
{
|
|
1503
|
+
"name": "<topic name>",
|
|
1504
|
+
"affectedFiles": ["src/path/to/file.vue"],
|
|
1505
|
+
"migrationPromptPath": "<absolute path to migration prompt>",
|
|
1506
|
+
"patternPath": "<absolute path to pattern file or null>"
|
|
1507
|
+
}
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
```
|
|
1511
|
+
|
|
1512
|
+
### Step 6: Type-check verification
|
|
1513
|
+
|
|
1514
|
+
After migration-agent completes, run:
|
|
1515
|
+
|
|
1516
|
+
```bash
|
|
1517
|
+
npx vue-tsc --noEmit
|
|
1518
|
+
```
|
|
1519
|
+
|
|
1520
|
+
If there are remaining TypeScript errors:
|
|
1521
|
+
1. Show the errors to the user
|
|
1522
|
+
2. Attempt to fix iteratively — read each error, fix the file, re-check (max 3 rounds)
|
|
1523
|
+
|
|
1524
|
+
### Step 7: Update report and summarize
|
|
1525
|
+
|
|
1526
|
+
Update `MIGRATION_REPORT.md`:
|
|
1527
|
+
- For each topic the agent successfully completed, add ✅ to the heading
|
|
1528
|
+
- Add a "Completed by AI" section listing what was done
|
|
1529
|
+
|
|
1530
|
+
Print summary to user:
|
|
1531
|
+
|
|
1532
|
+
```
|
|
1533
|
+
Migration complete!
|
|
1534
|
+
|
|
1535
|
+
Mechanical (CLI): {N} files
|
|
1536
|
+
AI-assisted: {M} files across {T} topics
|
|
1537
|
+
Remaining issues: {R} (see MIGRATION_REPORT.md)
|
|
1538
|
+
|
|
1539
|
+
Next steps:
|
|
1540
|
+
1. Review the changes: git diff
|
|
1541
|
+
2. Run: yarn build
|
|
1542
|
+
3. Test the application
|
|
1543
|
+
```
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
# Framework Constants
|
|
2
|
-
|
|
3
|
-
Default values and configuration constants exported from `@vc-shell/framework` via `core/constants/index.ts`.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Magic numbers scattered across a codebase make maintenance difficult and create inconsistencies. The vc-shell framework centralizes all layout dimensions, timing values, breakpoints, z-index layers, and component default props into a single constants module.
|
|
8
|
-
|
|
9
|
-
These constants are organized into three categories:
|
|
10
|
-
- **Top-level exports** -- standalone constants like `FALLBACK_BLADE_ID`
|
|
11
|
-
- **`UI_CONSTANTS`** -- layout, timing, and threshold values used by the framework's UI layer
|
|
12
|
-
- **`COMPONENT_DEFAULTS`** -- default prop values for each component type, accessible via `getComponentDefaults()`
|
|
13
|
-
- **`languageToCountryMap`** -- locale-to-country code mapping for flag resolution
|
|
14
|
-
|
|
15
|
-
All constants are importable from `@vc-shell/framework`.
|
|
16
|
-
|
|
17
|
-
## Top-Level Exports
|
|
18
|
-
|
|
19
|
-
| Constant | Value | Description |
|
|
20
|
-
|----------|-------|-------------|
|
|
21
|
-
| `FALLBACK_BLADE_ID` | `"fallback-blade-id"` | Default blade identifier when no ID is provided |
|
|
22
|
-
|
|
23
|
-
## UI Constants (`UI_CONSTANTS`)
|
|
24
|
-
|
|
25
|
-
Centralized magic numbers for layout, timing, and thresholds.
|
|
26
|
-
|
|
27
|
-
| Key | Value | Description |
|
|
28
|
-
|-----|-------|-------------|
|
|
29
|
-
| `GRID_COLUMNS` | `12` | Dashboard grid column count |
|
|
30
|
-
| `CELL_HEIGHT` | `80` | Dashboard cell height (px) |
|
|
31
|
-
| `WIDGET_GAP` | `20` | Dashboard widget gap (px) |
|
|
32
|
-
| `DEBOUNCE_DEFAULT_MS` | `500` | Default debounce delay |
|
|
33
|
-
| `HOVER_DELAY_MS` | `200` | Hover intent delay |
|
|
34
|
-
| `TOOLTIP_DELAY_MS` | `300` | Tooltip show delay |
|
|
35
|
-
| `RESIZE_DEBOUNCE_MS` | `100` | Window resize debounce |
|
|
36
|
-
| `ANIMATION_DURATION_MS` | `200` | Default animation duration |
|
|
37
|
-
| `TRANSITION_DURATION_MS` | `150` | Default CSS transition duration |
|
|
38
|
-
| `DRAG_THRESHOLD_PX` | `3` | Min px movement to start drag |
|
|
39
|
-
| `MAX_COLLISION_ITERATIONS` | `50` | Grid collision resolution limit |
|
|
40
|
-
| `MIN_COLUMN_WIDTH_PX` | `15` | Minimum table column width |
|
|
41
|
-
| `OVERFLOW_THRESHOLD` | `100` | Overflow detection threshold (px) |
|
|
42
|
-
| `PAGINATION_VISIBLE_PAGES` | `5` | Visible page buttons in paginator |
|
|
43
|
-
| `PAGINATION_EDGE_PAGES` | `3` | Edge page buttons shown |
|
|
44
|
-
| `TABLE_ROW_HEIGHT` | `48` | Table row height (px) |
|
|
45
|
-
| `TABLE_HEADER_HEIGHT` | `56` | Table header height (px) |
|
|
46
|
-
| `DEFAULT_MAXLENGTH` | `1024` | Default input maxlength |
|
|
47
|
-
| `DEFAULT_TEXTAREA_ROWS` | `3` | Default textarea rows |
|
|
48
|
-
| `MENU_COLLAPSED_WIDTH` | `76` | Sidebar collapsed width (px) |
|
|
49
|
-
| `MENU_EXPANDED_WIDTH` | `246` | Sidebar expanded width (px) |
|
|
50
|
-
| `MENU_ITEM_HEIGHT` | `38` | Menu item height (px) |
|
|
51
|
-
| `Z_INDEX.DROPDOWN` | `100` | Dropdown z-index |
|
|
52
|
-
| `Z_INDEX.TOOLTIP` | `9999` | Tooltip z-index |
|
|
53
|
-
| `Z_INDEX.POPUP` | `10000` | Popup z-index |
|
|
54
|
-
| `Z_INDEX.MODAL` | `10001` | Modal z-index |
|
|
55
|
-
| `Z_INDEX.DRAG` | `1000` | Drag overlay z-index |
|
|
56
|
-
| `Z_INDEX.SIDEBAR` | `50` | Sidebar z-index |
|
|
57
|
-
| `Z_INDEX.HEADER` | `40` | Header z-index |
|
|
58
|
-
| `BREAKPOINTS.XS` | `0` | Extra small breakpoint |
|
|
59
|
-
| `BREAKPOINTS.SM` | `576` | Small breakpoint |
|
|
60
|
-
| `BREAKPOINTS.MD` | `768` | Medium breakpoint |
|
|
61
|
-
| `BREAKPOINTS.LG` | `992` | Large breakpoint |
|
|
62
|
-
| `BREAKPOINTS.XL` | `1200` | Extra large breakpoint |
|
|
63
|
-
| `BREAKPOINTS.XXL` | `1400` | Extra extra large breakpoint |
|
|
64
|
-
|
|
65
|
-
## Component Defaults (`COMPONENT_DEFAULTS`)
|
|
66
|
-
|
|
67
|
-
Default prop values per component type. Access via `getComponentDefaults(name)`.
|
|
68
|
-
|
|
69
|
-
| Component | Property | Default | Description |
|
|
70
|
-
|-----------|----------|---------|-------------|
|
|
71
|
-
| `input` | `maxlength` | `1024` | Max input length |
|
|
72
|
-
| `input` | `debounce` | `0` | Input debounce (ms) |
|
|
73
|
-
| `input` | `type` | `"text"` | Input type attribute |
|
|
74
|
-
| `input` | `autocomplete` | `"off"` | Autocomplete attribute |
|
|
75
|
-
| `select` | `debounce` | `500` | Search debounce (ms) |
|
|
76
|
-
| `select` | `pageSize` | `20` | Items per page |
|
|
77
|
-
| `select` | `searchable` | `true` | Enable search |
|
|
78
|
-
| `select` | `clearable` | `true` | Show clear button |
|
|
79
|
-
| `table` | `pageSize` | `20` | Rows per page |
|
|
80
|
-
| `table` | `pageSizes` | `[10, 20, 50, 100]` | Page size options |
|
|
81
|
-
| `table` | `selectable` | `false` | Row selection |
|
|
82
|
-
| `table` | `multiselect` | `false` | Multi-row selection |
|
|
83
|
-
| `table` | `stickyHeader` | `true` | Sticky header |
|
|
84
|
-
| `pagination` | `pageSize` | `20` | Default page size |
|
|
85
|
-
| `pagination` | `visiblePages` | `5` | Visible page buttons |
|
|
86
|
-
| `textarea` | `rows` | `3` | Default rows |
|
|
87
|
-
| `textarea` | `maxlength` | `4096` | Max textarea length |
|
|
88
|
-
| `editor` | `minHeight` | `200` | Editor min height (px) |
|
|
89
|
-
| `editor` | `maxHeight` | `500` | Editor max height (px) |
|
|
90
|
-
| `tooltip` | `delay` | `300` | Show delay (ms) |
|
|
91
|
-
| `tooltip` | `placement` | `"top"` | Default placement |
|
|
92
|
-
| `modal` | `closeOnEscape` | `true` | Close on Esc key |
|
|
93
|
-
| `modal` | `closeOnOverlayClick` | `true` | Close on backdrop click |
|
|
94
|
-
| `notification` | `duration` | `5000` | Auto-dismiss (ms) |
|
|
95
|
-
| `notification` | `position` | `"top-right"` | Toast position |
|
|
96
|
-
| `dashboard` | `columns` | `12` | Grid columns |
|
|
97
|
-
| `dashboard` | `rowHeight` | `80` | Row height (px) |
|
|
98
|
-
| `dashboard` | `gap` | `20` | Widget gap (px) |
|
|
99
|
-
|
|
100
|
-
## Locale Constants (`languageToCountryMap`)
|
|
101
|
-
|
|
102
|
-
A `Record<string, string>` mapping ISO 639-1 language codes to ISO 3166-1 alpha-2 country codes. Contains 57 entries (e.g. `"en" -> "us"`, `"de" -> "de"`, `"ja" -> "jp"`). Used for flag icon resolution and locale fallback.
|
|
103
|
-
|
|
104
|
-
| Helper | Signature | Description |
|
|
105
|
-
|--------|-----------|-------------|
|
|
106
|
-
| `getComponentDefaults` | `<K extends keyof ComponentDefaults>(componentName: K) => ComponentDefaults[K]` | Type-safe accessor for component default values |
|
|
107
|
-
|
|
108
|
-
## Usage Examples
|
|
109
|
-
|
|
110
|
-
### Using UI constants in a composable
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
import { UI_CONSTANTS } from "@vc-shell/framework";
|
|
114
|
-
|
|
115
|
-
function useCustomDebounce() {
|
|
116
|
-
// Use the framework's standard debounce delay
|
|
117
|
-
const debouncedSearch = useDebounceFn(
|
|
118
|
-
(query: string) => performSearch(query),
|
|
119
|
-
UI_CONSTANTS.DEBOUNCE_DEFAULT_MS,
|
|
120
|
-
);
|
|
121
|
-
return { debouncedSearch };
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Using component defaults
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
import { getComponentDefaults } from "@vc-shell/framework";
|
|
129
|
-
|
|
130
|
-
// Get all default props for a select component
|
|
131
|
-
const selectDefaults = getComponentDefaults("select");
|
|
132
|
-
console.log(selectDefaults.debounce); // 500
|
|
133
|
-
console.log(selectDefaults.pageSize); // 20
|
|
134
|
-
console.log(selectDefaults.searchable); // true
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Using z-index layers in custom components
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
import { UI_CONSTANTS } from "@vc-shell/framework";
|
|
141
|
-
|
|
142
|
-
// Ensure custom dropdowns sit at the right z-index layer
|
|
143
|
-
const dropdownStyle = computed(() => ({
|
|
144
|
-
zIndex: UI_CONSTANTS.Z_INDEX.DROPDOWN,
|
|
145
|
-
}));
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Using breakpoints for responsive logic
|
|
149
|
-
|
|
150
|
-
```typescript
|
|
151
|
-
import { UI_CONSTANTS } from "@vc-shell/framework";
|
|
152
|
-
|
|
153
|
-
const isMobile = computed(() =>
|
|
154
|
-
windowWidth.value < UI_CONSTANTS.BREAKPOINTS.MD,
|
|
155
|
-
);
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Using the language-to-country map
|
|
159
|
-
|
|
160
|
-
```typescript
|
|
161
|
-
import { languageToCountryMap } from "@vc-shell/framework";
|
|
162
|
-
|
|
163
|
-
function getFlagUrl(locale: string): string {
|
|
164
|
-
const country = languageToCountryMap[locale] ?? "us";
|
|
165
|
-
return `https://flagcdn.com/w20/${country}.png`;
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Tip: Override Defaults at the Component Level
|
|
170
|
-
|
|
171
|
-
Component defaults serve as fallback values. Any prop explicitly set on a component instance takes precedence over `COMPONENT_DEFAULTS`. You do not need to modify the constants to change behavior for a single instance:
|
|
172
|
-
|
|
173
|
-
```vue
|
|
174
|
-
<!-- Uses default pageSize of 20 -->
|
|
175
|
-
<VcDataTable :items="items" :columns="columns" />
|
|
176
|
-
|
|
177
|
-
<!-- Overrides to 50 rows per page -->
|
|
178
|
-
<VcDataTable :items="items" :columns="columns" :page-size="50" />
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Related
|
|
182
|
-
|
|
183
|
-
- `framework/core/constants/ui.ts` -- UI_CONSTANTS definition
|
|
184
|
-
- `framework/core/constants/defaults.ts` -- COMPONENT_DEFAULTS and getComponentDefaults
|
|
185
|
-
- `framework/core/constants/locale.ts` -- languageToCountryMap
|
/package/runtime/knowledge/docs/shell/{pages → auth}/ChangePasswordPage/change-password-page.docs.md
RENAMED
|
File without changes
|