agent-docs 1.2.0 → 1.3.1
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/.husky/pre-commit +2 -0
- package/PLAN.md +7 -6
- package/README.md +4 -0
- package/docs/A4DWORKFLOWS.md +30 -23
- package/docs/LIGHTNINGBASECOMPONENTS.md +485 -0
- package/docs/LWCHTMLTEMPLATES.md +334 -0
- package/docs/PMD.md +279 -749
- package/docs/PRETTIER.md +1 -39
- package/docs/XPATH31.md +2 -0
- package/package.json +2 -1
package/PLAN.md
CHANGED
|
@@ -607,7 +607,7 @@ Standard MIT license with copyright holder: starch-uk
|
|
|
607
607
|
|
|
608
608
|
- Name: `agent-docs`
|
|
609
609
|
- Type: module
|
|
610
|
-
- Version: `1.
|
|
610
|
+
- Version: `1.0.0`
|
|
611
611
|
- Scripts: `format`, `format:fix`, `format:check`, `postinstall`
|
|
612
612
|
- Dev dependencies: `prettier`
|
|
613
613
|
- Engines: Node.js >= 20.0.0
|
|
@@ -646,11 +646,12 @@ The plan should:
|
|
|
646
646
|
APEXDOC.md, CML.md, CODEANALYZER.md, CONTEXTDEFINITIONS.md, ESLINT.md,
|
|
647
647
|
ESLINTJSDOC.md, FIELDSERVICE.md, GRAPHBINARY.md, GRAPHENGINE.md, GRAPHML.md,
|
|
648
648
|
GRAPHSON.md, GREMLIN.md, GRYO.md, HUSKY.md, JEST.md, JORJE.md, JSDOC.md,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
`1.0.0` (or appropriate
|
|
652
|
-
|
|
653
|
-
going forward using the same
|
|
649
|
+
LIGHTNINGBASECOMPONENTS.md, LWCHTMLTEMPLATES.md, PMD.md, PNPM.md, PRETTIER.md,
|
|
650
|
+
PRETTIERAPEX.md, REVENUETRANSACTIONMANAGEMENT.md, TINKERPOP.md, VITEST.md,
|
|
651
|
+
XPATH31.md) need to be initialized with version `1.0.0` (or appropriate
|
|
652
|
+
version based on their current state) when the versioning system is first
|
|
653
|
+
implemented. These existing docs will be tracked going forward using the same
|
|
654
|
+
semver system.
|
|
654
655
|
- Describe how scripts can help with versioning by:
|
|
655
656
|
- Reading markdown files and detecting headers/sections
|
|
656
657
|
- Comparing current state with the latest commit in `main` branch
|
package/README.md
CHANGED
|
@@ -101,6 +101,10 @@ structured format optimized for AI agent consumption:
|
|
|
101
101
|
- **[JEST.md](docs/JEST.md)** - Jest testing framework reference
|
|
102
102
|
- **[JORJE.md](docs/JORJE.md)** - Jorje Apex parser reference
|
|
103
103
|
- **[JSDOC.md](docs/JSDOC.md)** - JSDoc documentation generator reference
|
|
104
|
+
- **[LIGHTNINGBASECOMPONENTS.md](docs/LIGHTNINGBASECOMPONENTS.md)** - Lightning
|
|
105
|
+
Base Components reference
|
|
106
|
+
- **[LWCHTMLTEMPLATES.md](docs/LWCHTMLTEMPLATES.md)** - LWC HTML Templates
|
|
107
|
+
reference
|
|
104
108
|
- **[PMD.md](docs/PMD.md)** - PMD static analysis tool reference (includes Apex
|
|
105
109
|
AST reference and suppressing warnings)
|
|
106
110
|
- **[PNPM.md](docs/PNPM.md)** - pnpm package manager reference
|
package/docs/A4DWORKFLOWS.md
CHANGED
|
@@ -4,20 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
Workflows are reusable `.md` files defining multi-step Salesforce dev tasks.
|
|
7
|
+
Workflows are reusable `.md` files defining multi-step Salesforce dev tasks.
|
|
8
|
+
Invoke with `/[workflow-name.md]` in chat.
|
|
8
9
|
|
|
9
|
-
**Benefits:** Automation, consistency, error reduction, time savings, team
|
|
10
|
+
**Benefits:** Automation, consistency, error reduction, time savings, team
|
|
11
|
+
sharing.
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
13
15
|
## Creating & Managing
|
|
14
16
|
|
|
15
|
-
| Action
|
|
16
|
-
|
|
17
|
-
| Access
|
|
18
|
-
| Scope
|
|
19
|
-
| Create
|
|
20
|
-
| Storage | Workspace: `.a4drules/workflows/` folder
|
|
17
|
+
| Action | Method |
|
|
18
|
+
| ------- | -------------------------------------------------- |
|
|
19
|
+
| Access | Click **Rules & Workflows** (justice icon) in chat |
|
|
20
|
+
| Scope | Choose **Global** or **Workspace** workflows |
|
|
21
|
+
| Create | Click **+** |
|
|
22
|
+
| Storage | Workspace: `.a4drules/workflows/` folder |
|
|
21
23
|
|
|
22
24
|
Interface allows: view active workflows, toggle on/off, add/delete.
|
|
23
25
|
|
|
@@ -25,7 +27,8 @@ Interface allows: view active workflows, toggle on/off, add/delete.
|
|
|
25
27
|
|
|
26
28
|
## Workflow Capabilities
|
|
27
29
|
|
|
28
|
-
- **Built-in tools:** `ask_followup_question`, `read_file`, `search_files`,
|
|
30
|
+
- **Built-in tools:** `ask_followup_question`, `read_file`, `search_files`,
|
|
31
|
+
`new_task`
|
|
29
32
|
- **CLI tools:** `sf` (Salesforce CLI), `git`
|
|
30
33
|
- **External:** MCP tool calls
|
|
31
34
|
- **Chaining:** Sequential action execution
|
|
@@ -34,13 +37,13 @@ Interface allows: view active workflows, toggle on/off, add/delete.
|
|
|
34
37
|
|
|
35
38
|
## Common Workflow Types
|
|
36
39
|
|
|
37
|
-
| Type
|
|
38
|
-
|
|
39
|
-
| Deployment
|
|
40
|
-
| Testing
|
|
41
|
-
| Release
|
|
42
|
-
| Component
|
|
43
|
-
| Integration | Set up/validate external integrations
|
|
40
|
+
| Type | Purpose |
|
|
41
|
+
| ----------- | --------------------------------------- |
|
|
42
|
+
| Deployment | Deploy/validate components across orgs |
|
|
43
|
+
| Testing | Run test suites, analyze results |
|
|
44
|
+
| Release | Package, validate, deploy releases |
|
|
45
|
+
| Component | Create/test/deploy Lightning components |
|
|
46
|
+
| Integration | Set up/validate external integrations |
|
|
44
47
|
|
|
45
48
|
---
|
|
46
49
|
|
|
@@ -54,7 +57,7 @@ You have access to the `sf` terminal command. Deploy components following this p
|
|
|
54
57
|
<question>Which components to deploy and to which org?</question>
|
|
55
58
|
<options>["Specific files/folders", "All local changes", "Specific metadata types"]</options>
|
|
56
59
|
</ask_followup_question>
|
|
57
|
-
|
|
60
|
+
|
|
58
61
|
sf org display --target-org <target-org>
|
|
59
62
|
|
|
60
63
|
2. **Pre-Deployment Validation**
|
|
@@ -81,6 +84,7 @@ You have access to the `sf` terminal command. Deploy components following this p
|
|
|
81
84
|
## SF CLI Quick Reference
|
|
82
85
|
|
|
83
86
|
### Org Commands
|
|
87
|
+
|
|
84
88
|
```bash
|
|
85
89
|
sf org list # List authorized orgs
|
|
86
90
|
sf org display --target-org <alias> # Display org info
|
|
@@ -88,6 +92,7 @@ sf config set target-org <alias> # Set default org
|
|
|
88
92
|
```
|
|
89
93
|
|
|
90
94
|
### Deployment
|
|
95
|
+
|
|
91
96
|
```bash
|
|
92
97
|
sf project deploy start --target-org <alias> # Deploy
|
|
93
98
|
sf project deploy start --dry-run --target-org <alias> # Validate only
|
|
@@ -96,6 +101,7 @@ sf project retrieve start --target-org <alias> # Retrieve metadata
|
|
|
96
101
|
```
|
|
97
102
|
|
|
98
103
|
### Testing
|
|
104
|
+
|
|
99
105
|
```bash
|
|
100
106
|
sf apex test run --target-org <alias> --code-coverage --result-format human
|
|
101
107
|
sf apex test run --class-names "Test1,Test2" --target-org <alias>
|
|
@@ -103,6 +109,7 @@ sf apex test report --target-org <alias>
|
|
|
103
109
|
```
|
|
104
110
|
|
|
105
111
|
### Data
|
|
112
|
+
|
|
106
113
|
```bash
|
|
107
114
|
sf data query --query "SELECT Id FROM Account LIMIT 10" --target-org <alias>
|
|
108
115
|
sf data import tree --plan data/plan.json --target-org <alias>
|
|
@@ -113,9 +120,9 @@ sf data export tree --query "SELECT Id FROM Account" --target-org <alias>
|
|
|
113
120
|
|
|
114
121
|
## Custom Workflow Ideas
|
|
115
122
|
|
|
116
|
-
| Workflow
|
|
117
|
-
|
|
118
|
-
| **Release**
|
|
119
|
-
| **New Component**
|
|
120
|
-
| **Integration Test** | Validate credentials → Test endpoints → Check error handling → Generate reports
|
|
121
|
-
| **Code Quality**
|
|
123
|
+
| Workflow | Key Steps |
|
|
124
|
+
| -------------------- | ---------------------------------------------------------------------------------------- |
|
|
125
|
+
| **Release** | Gather merged changes → Build changelog → Bump version → Create/validate package |
|
|
126
|
+
| **New Component** | Create folder structure → Generate boilerplate files → Set up Jest tests → Deploy to dev |
|
|
127
|
+
| **Integration Test** | Validate credentials → Test endpoints → Check error handling → Generate reports |
|
|
128
|
+
| **Code Quality** | Run PMD analysis → Check accessibility → Validate naming → Generate reports |
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
# Lightning Base Components
|
|
2
|
+
|
|
3
|
+
> **Version**: 1.0.0
|
|
4
|
+
|
|
5
|
+
## Guidelines
|
|
6
|
+
|
|
7
|
+
- Prefer base components over custom HTML - built-in SLDS, a11y, less
|
|
8
|
+
maintenance
|
|
9
|
+
- A11y: Always provide accessible names via `label`, `aria-label`,
|
|
10
|
+
`alternative-text`
|
|
11
|
+
- Events: `onclick` (buttons), `onchange`/`onselect` (inputs/menus),
|
|
12
|
+
`onstatuschange` (flows), `onuploadfinished` (files), `onscan`/`onerror`
|
|
13
|
+
(barcode)
|
|
14
|
+
- Nav: Use `lightning/navigation` not `href`
|
|
15
|
+
- Style: SLDS utilities + `--slds-c-*` CSS vars. Avoid internal overrides
|
|
16
|
+
- Files: Guest uploads via org prefs. `file-field-name`/`value` for guests,
|
|
17
|
+
`record-id` for auth users
|
|
18
|
+
- Limits: combobox no multi-select/autocomplete; barcode/click-to-dial no
|
|
19
|
+
iFrames; carousel max 6 images; flow restrictions on LWR+custom components
|
|
20
|
+
|
|
21
|
+
## ValidityState & Validation
|
|
22
|
+
|
|
23
|
+
**ValidityState props** (all boolean): `valid`, `valueMissing`, `typeMismatch`,
|
|
24
|
+
`patternMismatch`, `tooLong`, `tooShort`, `rangeOverflow`, `rangeUnderflow`,
|
|
25
|
+
`stepMismatch`, `badInput`, `customError`
|
|
26
|
+
|
|
27
|
+
**Methods**: `setCustomValidity(msg)`, `reportValidity()`, `checkValidity()`
|
|
28
|
+
|
|
29
|
+
**Custom messages**: `message-when-value-missing`, `message-when-type-mismatch`,
|
|
30
|
+
`message-when-pattern-mismatch`, `message-when-too-long`,
|
|
31
|
+
`message-when-too-short`, `message-when-range-overflow`,
|
|
32
|
+
`message-when-range-underflow`, `message-when-step-mismatch`,
|
|
33
|
+
`message-when-bad-input`
|
|
34
|
+
|
|
35
|
+
Start w/ LDS components for built-in validation. Client+server validation
|
|
36
|
+
together.
|
|
37
|
+
|
|
38
|
+
## Components
|
|
39
|
+
|
|
40
|
+
**Legend**: `*` = required, `|` = options, `→` = returns
|
|
41
|
+
|
|
42
|
+
### lightning-accordion-section
|
|
43
|
+
|
|
44
|
+
Nest in `lightning-accordion`
|
|
45
|
+
|
|
46
|
+
- `class`, `heading-level` (1-6), `label`, `name`\*
|
|
47
|
+
- Slots: default, `actions`
|
|
48
|
+
- ARIA: `role="listitem"`, `aria-expanded`, `aria-controls`
|
|
49
|
+
- Event: `onactive`
|
|
50
|
+
|
|
51
|
+
### lightning-alert (lightning/alert)
|
|
52
|
+
|
|
53
|
+
`LightningAlert.open(config)` → Promise
|
|
54
|
+
|
|
55
|
+
- `label`, `message`\*, `theme`
|
|
56
|
+
(default|shade|inverse|alt-inverse|success|info|warning|error|offline),
|
|
57
|
+
`variant` (header|headerless)
|
|
58
|
+
- ARIA: `role="alertdialog"`, focus trap
|
|
59
|
+
|
|
60
|
+
### lightning-avatar
|
|
61
|
+
|
|
62
|
+
- `alternative-text`\* (if informational), `class`, `fallback-icon-name`
|
|
63
|
+
(standard/custom only), `initials`, `src`, `variant` (circle|square)
|
|
64
|
+
- Initials+fallback: initials show w/ icon bg color
|
|
65
|
+
|
|
66
|
+
### lightning-badge
|
|
67
|
+
|
|
68
|
+
- `class`, `icon-name`, `icon-position` (end|start), `label`
|
|
69
|
+
- No links/nested elements. Use `slds-theme_*` for colors
|
|
70
|
+
|
|
71
|
+
### lightning-barcode-scanner
|
|
72
|
+
|
|
73
|
+
Mobile only, no iFrames
|
|
74
|
+
|
|
75
|
+
- `disabled`, `disabled-alternative-text`, `disabled-icon-src`,
|
|
76
|
+
`enable-continuous-scan`, `enabled-alternative-text`, `enabled-icon-src`,
|
|
77
|
+
`icon-size`
|
|
78
|
+
- Events: `onerror`, `onscan` → `event.detail.scannedBarcodes`
|
|
79
|
+
|
|
80
|
+
### lightning-breadcrumb
|
|
81
|
+
|
|
82
|
+
Nest in `lightning-breadcrumbs`
|
|
83
|
+
|
|
84
|
+
- `class`, `href` (defaults "#"), `label`\*, `name`
|
|
85
|
+
- Event: `onclick` (use w/ lightning/navigation)
|
|
86
|
+
|
|
87
|
+
### lightning-breadcrumbs
|
|
88
|
+
|
|
89
|
+
- `class`
|
|
90
|
+
- Slots: `lightning-breadcrumb`
|
|
91
|
+
- ARIA: `role="navigation"`, last item `aria-current="page"`
|
|
92
|
+
|
|
93
|
+
### lightning-button
|
|
94
|
+
|
|
95
|
+
- `accesskey`, `aria-atomic`, `aria-controls`, `aria-describedby`,
|
|
96
|
+
`aria-expanded`, `aria-haspopup`, `aria-label`, `aria-labelledby`,
|
|
97
|
+
`aria-live`, `class`, `disabled`, `disable-animation`, `icon-name` (utility),
|
|
98
|
+
`icon-position` (end|start), `label`\*, `stretch`, `tabindex`, `title`, `type`
|
|
99
|
+
(button|reset|submit), `variant`
|
|
100
|
+
(base|brand|brand-outline|destructive|destructive-text|inverse|neutral|success)
|
|
101
|
+
- Event: `onclick`
|
|
102
|
+
- Use button-icon for icon-only. Min 44x44px mobile
|
|
103
|
+
|
|
104
|
+
### lightning-button-group
|
|
105
|
+
|
|
106
|
+
- `class`
|
|
107
|
+
- Slots: `lightning-button*`
|
|
108
|
+
|
|
109
|
+
### lightning-button-icon-stateful
|
|
110
|
+
|
|
111
|
+
- `accesskey`, `alternative-text`, `aria-atomic`, `aria-controls`,
|
|
112
|
+
`aria-describedby`, `aria-expanded`, `aria-haspopup`, `aria-label`_,
|
|
113
|
+
`aria-live`, `class`, `disabled`, `icon-name`_ (utility), `selected`, `size`,
|
|
114
|
+
`variant` (border|border-filled|border-inverse)
|
|
115
|
+
- ARIA: `aria-pressed`
|
|
116
|
+
- Event: `onclick`
|
|
117
|
+
|
|
118
|
+
### lightning-button-menu
|
|
119
|
+
|
|
120
|
+
- `alternative-text`, `class`, `disabled`, `icon-name`, `icon-size`, `is-draft`,
|
|
121
|
+
`draft-alternative-text`, `is-loading`, `loading-state-alternative-text`,
|
|
122
|
+
`label`, `menu-alignment`, `size`, `tooltip`, `title`, `variant`
|
|
123
|
+
(bare|bare-inverse|border|border-filled|border-inverse|container)
|
|
124
|
+
- Slots: `lightning-menu-item`, `lightning-menu-divider`,
|
|
125
|
+
`lightning-menu-subheader`
|
|
126
|
+
- ARIA: `aria-haspopup="true"`, `aria-expanded`
|
|
127
|
+
- Events: `onclose`, `onopen`, `onselect`
|
|
128
|
+
|
|
129
|
+
### lightning-button-stateful
|
|
130
|
+
|
|
131
|
+
- `accesskey`, `aria-*` (same as button), `class`, `disabled`, `icon-name`
|
|
132
|
+
(utility), `label-when-hover`, `label-when-off`, `label-when-on`, `selected`,
|
|
133
|
+
`tabindex`, `variant` (brand|destructive|inverse|neutral|success|text)
|
|
134
|
+
- ARIA: `aria-pressed`, `aria-live="polite"`
|
|
135
|
+
- Event: `onclick` (toggle selected)
|
|
136
|
+
|
|
137
|
+
### lightning-card
|
|
138
|
+
|
|
139
|
+
- `class`, `icon-name`, `title`
|
|
140
|
+
- Slots: `actions`, `footer`, `title`, default
|
|
141
|
+
|
|
142
|
+
### lightning-carousel
|
|
143
|
+
|
|
144
|
+
Max 6 images
|
|
145
|
+
|
|
146
|
+
- `class`, `disable-auto-refresh`, `disable-auto-scroll`, `scroll-duration`
|
|
147
|
+
- Slots: `lightning-carousel-image`
|
|
148
|
+
- ARIA: indicators `role="tablist"`
|
|
149
|
+
|
|
150
|
+
### lightning-carousel-image
|
|
151
|
+
|
|
152
|
+
- `alternative-text`, `description`, `header`, `href`, `src`\*
|
|
153
|
+
|
|
154
|
+
### lightning-click-to-dial
|
|
155
|
+
|
|
156
|
+
Lightning Experience only, no iFrames. Requires Open CTI `enableClickToDial`
|
|
157
|
+
|
|
158
|
+
- `record-id`, `value` (phone)
|
|
159
|
+
- Event: `onclicktodial`
|
|
160
|
+
|
|
161
|
+
### lightning-combobox
|
|
162
|
+
|
|
163
|
+
No multi-select/autocomplete. Mobile issues - consider HTML `<select>`
|
|
164
|
+
|
|
165
|
+
- `autocomplete`, `class`, `label`_, `message-when-value-missing`, `options`_
|
|
166
|
+
[{value,label,description?}], `required`, `validity`, `value`, `variant`
|
|
167
|
+
(label-hidden)
|
|
168
|
+
- Events: `onchange` → `event.detail.selectedValue`, `onopen`
|
|
169
|
+
|
|
170
|
+
### lightning-dynamic-icon
|
|
171
|
+
|
|
172
|
+
- `alternative-text` (provide on small screens), `type`\*
|
|
173
|
+
(ellie|eq|score|strength|trend|waffle)
|
|
174
|
+
|
|
175
|
+
### lightning-file-upload
|
|
176
|
+
|
|
177
|
+
Max 25 files, 2GB each. Guest: create `*fileupload__c` field
|
|
178
|
+
|
|
179
|
+
- `accept`, `class`, `file-field-name`, `file-field-value`, `label`, `record-id`
|
|
180
|
+
- Event: `onuploadfinished` → `event.detail.files` [{name,documentId}]
|
|
181
|
+
|
|
182
|
+
### lightning-flow
|
|
183
|
+
|
|
184
|
+
Custom components unsupported on LWR
|
|
185
|
+
|
|
186
|
+
- `flow-api-name`\*, `flow-input-variables`, `flow-finish-behavior`
|
|
187
|
+
(NONE|RESTART)
|
|
188
|
+
- Event: `onstatuschange` → status, outputVariables
|
|
189
|
+
|
|
190
|
+
### lightning-formatted-address
|
|
191
|
+
|
|
192
|
+
Format by user locale. Links Google Maps
|
|
193
|
+
|
|
194
|
+
- `city`, `country`, `disabled`, `latitude`, `longitude`, `postal-code`,
|
|
195
|
+
`province`, `show-static-map`, `street`, `variant` (plain)
|
|
196
|
+
|
|
197
|
+
### lightning-formatted-email
|
|
198
|
+
|
|
199
|
+
- `bcc`, `body`, `cc`, `disable-linkify`, `hide-icon`, `label`, `subject`,
|
|
200
|
+
`value`
|
|
201
|
+
|
|
202
|
+
### lightning-formatted-location
|
|
203
|
+
|
|
204
|
+
- `latitude`_, `longitude`_
|
|
205
|
+
|
|
206
|
+
### lightning-formatted-number
|
|
207
|
+
|
|
208
|
+
User locale
|
|
209
|
+
|
|
210
|
+
- `currency-code`, `currency-display-as` (code|name|symbol), `format-style`
|
|
211
|
+
(currency|decimal|percent|percent-fixed), `maximum-fraction-digits`,
|
|
212
|
+
`maximum-significant-digits`, `minimum-fraction-digits`,
|
|
213
|
+
`minimum-significant-digits`, `value`\*
|
|
214
|
+
|
|
215
|
+
### lightning-formatted-rich-text
|
|
216
|
+
|
|
217
|
+
- `disable-linkify`, `value`
|
|
218
|
+
- Supported: a, div, p, h1-h6, strong, em, ul, ol, li, table, img, etc.
|
|
219
|
+
|
|
220
|
+
### lightning-formatted-time
|
|
221
|
+
|
|
222
|
+
- `value`\* (ISO8601)
|
|
223
|
+
|
|
224
|
+
### lightning-input
|
|
225
|
+
|
|
226
|
+
- `accept`, `aria-describedby`, `aria-labelledby`, `autocomplete`, `checked`,
|
|
227
|
+
`class`, `date-aria-describedby`, `date-aria-labelledby`, `disabled`,
|
|
228
|
+
`field-level-help`, `files`, `label`_, `max`, `maxlength`,
|
|
229
|
+
`message-when-_`(all validation msgs),`min`, `minlength`, `multiple`, `name`, `pattern`, `placeholder`, `readonly`, `required`, `step`, `time-aria-describedby`, `time-aria-labelledby`, `type`(checkbox|checkbox-button|color|date|datetime|datetime-local|email|file|number|password|search|tel|text|time|toggle|url),`validity`, `value`, `variant`
|
|
230
|
+
(label-hidden|label-inline|label-stacked|standard)
|
|
231
|
+
- Events: `onblur`, `onchange`, `onfocus`, `oninput`
|
|
232
|
+
|
|
233
|
+
### lightning-input-field
|
|
234
|
+
|
|
235
|
+
- `field-name`\*, `required`, `value`, `variant`
|
|
236
|
+
- Event: `onchange`
|
|
237
|
+
|
|
238
|
+
### lightning-input-location
|
|
239
|
+
|
|
240
|
+
Validates lat -90/90, lon -180/180
|
|
241
|
+
|
|
242
|
+
- `city`, `country`, `latitude`, `longitude`, `postal-code`, `province`,
|
|
243
|
+
`street`
|
|
244
|
+
- Event: `onchange` → lat, lon
|
|
245
|
+
|
|
246
|
+
### lightning-layout-item
|
|
247
|
+
|
|
248
|
+
- `flexibility`, `large-device-size` (1-12), `medium-device-size`, `padding`,
|
|
249
|
+
`size`, `small-device-size`
|
|
250
|
+
|
|
251
|
+
### lightning-map
|
|
252
|
+
|
|
253
|
+
- `center`, `list-view`, `map-markers`\*, `markers-title`,
|
|
254
|
+
`show-footer-address`, `zoom-level`
|
|
255
|
+
|
|
256
|
+
### lightning-menu-divider
|
|
257
|
+
|
|
258
|
+
- `variant` (compact|default)
|
|
259
|
+
|
|
260
|
+
### lightning-menu-item
|
|
261
|
+
|
|
262
|
+
- `accesskey`, `checked`, `class`, `draft-alternative-text`, `href`,
|
|
263
|
+
`icon-name`, `icon-type` (color|standard), `is-draft`, `label`,
|
|
264
|
+
`prefix-icon-name`, `tabindex`, `target`, `value`
|
|
265
|
+
- Selection via parent `onselect`
|
|
266
|
+
|
|
267
|
+
### lightning-menu-subheader
|
|
268
|
+
|
|
269
|
+
- `label`\*
|
|
270
|
+
|
|
271
|
+
### lightning-modal (lightning/modal)
|
|
272
|
+
|
|
273
|
+
Extend `LightningModal`
|
|
274
|
+
|
|
275
|
+
- `description`, `disableClose`, `label`\*, `size` (full|large|medium|small)
|
|
276
|
+
- ARIA: focus trap
|
|
277
|
+
- Events bubble to opener
|
|
278
|
+
|
|
279
|
+
### lightning-modal-body/footer
|
|
280
|
+
|
|
281
|
+
Slots: default
|
|
282
|
+
|
|
283
|
+
### lightning-modal-header
|
|
284
|
+
|
|
285
|
+
- `icon-assistive-text`, `icon-name`, `label`\*
|
|
286
|
+
|
|
287
|
+
### lightning-omnistudio-flexcard
|
|
288
|
+
|
|
289
|
+
- `flexcard-name`\*, `input`, `record-id`
|
|
290
|
+
|
|
291
|
+
### lightning-omnistudio-omniscript
|
|
292
|
+
|
|
293
|
+
- `input`, `record-id`, `script-name`\*
|
|
294
|
+
|
|
295
|
+
### lightning-output-field
|
|
296
|
+
|
|
297
|
+
- `field-name`\*, `record-id`, `variant` (label-hidden|standard)
|
|
298
|
+
|
|
299
|
+
### lightning-pill
|
|
300
|
+
|
|
301
|
+
3 clickable areas: icon/avatar, label, remove btn
|
|
302
|
+
|
|
303
|
+
- `class`, `has-error`, `href`, `label`, `name`, `variant` (link|plain)
|
|
304
|
+
- Slots: default (icon/avatar)
|
|
305
|
+
- Events: `onclick`, `onremove`
|
|
306
|
+
|
|
307
|
+
### lightning-pill-container
|
|
308
|
+
|
|
309
|
+
- `class`, `is-collapsible`, `is-expanded`, `items`\*, `single-line`, `variant`
|
|
310
|
+
(bare|standard)
|
|
311
|
+
- Event: `onitemremove` → item, index
|
|
312
|
+
|
|
313
|
+
### lightning-progress-bar
|
|
314
|
+
|
|
315
|
+
- `size` (large|medium|small|x-large), `value`\* (0-100), `variant`
|
|
316
|
+
(circular|circular-with-label|light)
|
|
317
|
+
|
|
318
|
+
### lightning-progress-indicator
|
|
319
|
+
|
|
320
|
+
- `class`, `current-step`, `type` (horizontal|vertical), `variant` (base|path)
|
|
321
|
+
- Slots: `lightning-progress-step`
|
|
322
|
+
|
|
323
|
+
### lightning-progress-ring
|
|
324
|
+
|
|
325
|
+
- `direction` (clockwise|counterclockwise), `value`\* (0-100), `variant`
|
|
326
|
+
(active-step|base|base-autocomplete|expired|warning)
|
|
327
|
+
|
|
328
|
+
### lightning-prompt (lightning/prompt)
|
|
329
|
+
|
|
330
|
+
`LightningPrompt.open()` → Promise
|
|
331
|
+
|
|
332
|
+
- `defaultValue`, `label`\*, `message`, `options`, `variant` (header|headerless)
|
|
333
|
+
|
|
334
|
+
### lightning-quick-action-panel
|
|
335
|
+
|
|
336
|
+
- `object-api-name`_, `quick-action-api-name`, `record-id`_
|
|
337
|
+
- Event: `onquickactionmenu`
|
|
338
|
+
|
|
339
|
+
### lightning-record-edit-form
|
|
340
|
+
|
|
341
|
+
Uses LDS. Shows first validation error
|
|
342
|
+
|
|
343
|
+
- `class`, `layout-type` (Compact|Full), `mode` (edit|readonly),
|
|
344
|
+
`object-api-name`, `record-id`
|
|
345
|
+
- Events: `onerror`, `onload`, `onsubmit`, `onsuccess`
|
|
346
|
+
|
|
347
|
+
### lightning-relative-date-time
|
|
348
|
+
|
|
349
|
+
- `class`, `options`, `value`\*
|
|
350
|
+
|
|
351
|
+
### lightning-rich-text-toolbar-button
|
|
352
|
+
|
|
353
|
+
- `class`, `disabled`, `icon-name`, `pressed`, `value`
|
|
354
|
+
|
|
355
|
+
### lightning-rich-text-toolbar-button-group
|
|
356
|
+
|
|
357
|
+
Slots: `lightning-rich-text-toolbar-button`
|
|
358
|
+
|
|
359
|
+
### lightning-select
|
|
360
|
+
|
|
361
|
+
- `class`, `disabled`, `field-level-help`, `label`\*,
|
|
362
|
+
`message-when-value-missing`, `multiple`, `options` [{value,label,disabled?}],
|
|
363
|
+
`required`, `size`, `validity`, `value`, `variant`
|
|
364
|
+
- Event: `onchange` → `event.detail.value`
|
|
365
|
+
|
|
366
|
+
### lightning-slider
|
|
367
|
+
|
|
368
|
+
Use onchange not onblur (Safari). Values clamped to min/max
|
|
369
|
+
|
|
370
|
+
- `class`, `disabled`, `label`, `max` (100), `min` (0), `step`, `type`
|
|
371
|
+
(horizontal|vertical), `value`
|
|
372
|
+
- Event: `onchange`
|
|
373
|
+
|
|
374
|
+
### lightning-spinner
|
|
375
|
+
|
|
376
|
+
- `variant` (brand|inverse|default)
|
|
377
|
+
- Use w/ `if:true`
|
|
378
|
+
|
|
379
|
+
### lightning-tab
|
|
380
|
+
|
|
381
|
+
Lazy loaded. Only query active/prev-active content
|
|
382
|
+
|
|
383
|
+
- `class`, `end-icon-alternative-text`, `end-icon-name`, `icon-assistive-text`,
|
|
384
|
+
`icon-name`, `label`\*, `show-error-indicator`
|
|
385
|
+
- Event: `onactive`
|
|
386
|
+
|
|
387
|
+
### lightning-textarea
|
|
388
|
+
|
|
389
|
+
- `aria-describedby`, `aria-labelledby`, `autocomplete`, `class`, `disabled`,
|
|
390
|
+
`label`_, `maxlength`,
|
|
391
|
+
`message-when-_`, `minlength`, `placeholder`, `read-only`, `required`, `validity`, `value`, `variant`
|
|
392
|
+
- Events: `onblur`, `onchange`, `onfocus`
|
|
393
|
+
|
|
394
|
+
### lightning-tile
|
|
395
|
+
|
|
396
|
+
- `class`, `label`\*
|
|
397
|
+
- Slots: `media`, default
|
|
398
|
+
- Event: `onactiontriggered`
|
|
399
|
+
|
|
400
|
+
### lightning-toast (lightning/toast)
|
|
401
|
+
|
|
402
|
+
`Toast.show()` → Promise
|
|
403
|
+
|
|
404
|
+
- `label`\*, `labelLinks`, `message`, `messageLinks`, `mode`
|
|
405
|
+
(dismissible|sticky), `variant` (error|info|success|warning)
|
|
406
|
+
|
|
407
|
+
### lightning-toast-container (lightning/toastContainer)
|
|
408
|
+
|
|
409
|
+
One per page. Ctrl+F6/Cmd+F6 nav
|
|
410
|
+
|
|
411
|
+
- `containerPosition` (absolute|fixed), `maxToasts` (3), `toastPosition`
|
|
412
|
+
(bottom-center|bottom-left|bottom-right|top-center|top-left|top-right)
|
|
413
|
+
|
|
414
|
+
### lightning-tree
|
|
415
|
+
|
|
416
|
+
- `class`, `header`, `items`\*
|
|
417
|
+
- Event: `onselect` → name
|
|
418
|
+
|
|
419
|
+
### lightning-tree-grid
|
|
420
|
+
|
|
421
|
+
Set `sortable:true` on columns for sorting
|
|
422
|
+
|
|
423
|
+
- `class`, `columns`_, `data`, `expanded-rows`, `hide-checkbox-column`,
|
|
424
|
+
`key-field`_, `max-column-width`, `min-column-width`,
|
|
425
|
+
`resize-column-disabled`, `selected-rows`, `show-row-number-column`, `variant`
|
|
426
|
+
- Events: `onrowaction`, `onrowselection`, `onsort`
|
|
427
|
+
|
|
428
|
+
### lightning-vertical-navigation
|
|
429
|
+
|
|
430
|
+
- `class`, `selected-item`
|
|
431
|
+
- Slots: `lightning-vertical-navigation-item*`
|
|
432
|
+
- Events: `onbeforeselect`, `onselect`
|
|
433
|
+
|
|
434
|
+
### lightning-vertical-navigation-item
|
|
435
|
+
|
|
436
|
+
- `badge`, `class`, `href`, `icon-name`, `label`\*, `name`
|
|
437
|
+
- Event: `onselect`
|
|
438
|
+
|
|
439
|
+
### lightning-vertical-navigation-item-badge
|
|
440
|
+
|
|
441
|
+
- `class`, `label`, `variant` (default|inverse|lightest)
|
|
442
|
+
|
|
443
|
+
### lightning-vertical-navigation-item-icon
|
|
444
|
+
|
|
445
|
+
- `alternative-text`, `class`, `icon-name`, `position` (end|start)
|
|
446
|
+
|
|
447
|
+
## Patterns
|
|
448
|
+
|
|
449
|
+
### Validation
|
|
450
|
+
|
|
451
|
+
```js
|
|
452
|
+
// Check validity
|
|
453
|
+
if (!this.template.querySelector('lightning-input').checkValidity()) {
|
|
454
|
+
this.template.querySelector('lightning-input').reportValidity();
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Styling
|
|
459
|
+
|
|
460
|
+
```html
|
|
461
|
+
<lightning-button class="slds-m-left_small"></lightning-button>
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
```css
|
|
465
|
+
--slds-c-button-color-background
|
|
466
|
+
--slds-c-button-text-color
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Navigation
|
|
470
|
+
|
|
471
|
+
```js
|
|
472
|
+
import { NavigationMixin } from 'lightning/navigation';
|
|
473
|
+
this[NavigationMixin.Navigate]({
|
|
474
|
+
type: 'standard__recordPage',
|
|
475
|
+
attributes: { recordId, actionName: 'view' },
|
|
476
|
+
});
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Events
|
|
480
|
+
|
|
481
|
+
```js
|
|
482
|
+
handleChange(event) {
|
|
483
|
+
const value = event.detail.value; // or .selectedValue
|
|
484
|
+
}
|
|
485
|
+
```
|