@spfx-fast/sharepoint-ui 0.4.2 → 0.4.3
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/AGENTS.md +23 -3
- package/QUICKSTART.md +133 -0
- package/README.md +3 -1
- package/components.json +168 -28
- package/dist/appearance.js +4 -4
- package/dist/elements/alert.js +26 -2
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/button.js +1 -1
- package/dist/elements/carousel.js +5 -2
- package/dist/elements/color-picker.js +1 -1
- package/dist/elements/combobox.js +5 -5
- package/dist/elements/data-grid-model.d.ts +3 -0
- package/dist/elements/data-grid.d.ts +2 -1
- package/dist/elements/data-grid.js +19 -10
- package/dist/elements/date-picker.js +1 -1
- package/dist/elements/dialog.js +1 -1
- package/dist/elements/file-upload.js +1 -1
- package/dist/elements/floating-position.d.ts +10 -0
- package/dist/elements/floating-position.js +53 -0
- package/dist/elements/info.js +1 -1
- package/dist/elements/input.js +2 -2
- package/dist/elements/link.js +1 -1
- package/dist/elements/message-bar.js +33 -5
- package/dist/elements/nav.js +4 -1
- package/dist/elements/overflow.d.ts +1 -0
- package/dist/elements/overflow.js +2 -2
- package/dist/elements/popover.js +1 -1
- package/dist/elements/rating.js +3 -3
- package/dist/elements/rich-text-editor.d.ts +15 -1
- package/dist/elements/rich-text-editor.js +938 -79
- package/dist/elements/search.js +3 -10
- package/dist/elements/select.js +2 -2
- package/dist/elements/shared.d.ts +4 -1
- package/dist/elements/shared.js +14 -1
- package/dist/elements/sharepoint-field-basic-controls.d.ts +1 -0
- package/dist/elements/sharepoint-field-basic-controls.js +14 -0
- package/dist/elements/sharepoint-fields.d.ts +29 -0
- package/dist/elements/sharepoint-fields.js +460 -0
- package/dist/elements/spin-button.js +2 -2
- package/dist/elements/tag-picker.js +29 -11
- package/dist/elements/textarea.js +2 -2
- package/dist/elements/toaster.js +2 -1
- package/dist/elements/tooltip.js +18 -1
- package/dist/elements/tree.js +1 -1
- package/dist/elements.d.ts +3 -2
- package/dist/elements.js +4 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +4 -2
- package/dist/react.d.ts +142 -10
- package/dist/react.js +306 -46
- package/dist/sharepoint-fields.d.ts +135 -0
- package/dist/sharepoint-fields.js +402 -0
- package/dist/theme.d.ts +9 -1
- package/dist/theme.js +78 -1
- package/package.json +11 -2
- package/skills/sharepoint-ui/SKILL.md +1 -1
- package/skills/sharepoint-ui/references/sharepoint-patterns.md +1 -1
package/AGENTS.md
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Use this page as the short route from a SharePoint task to a working component. The library is designed for SPFx 1.24 and React 18, but its custom elements can be used without React.
|
|
4
4
|
|
|
5
|
+
For the predictable cross-component pattern and copy-ready Tooltip/Persona composition, start with [`QUICKSTART.md`](./QUICKSTART.md). Component pages and their linked JSON slices supply the exact component-specific props, slots, and callback signatures.
|
|
6
|
+
|
|
5
7
|
## Pick the smallest entry point
|
|
6
8
|
|
|
7
9
|
- In an SPFx React web part, import the React adapter from `@spfx-fast/sharepoint-ui/react` and import only the components used.
|
|
8
10
|
- In plain HTML or another framework, import a leaf definition such as `@spfx-fast/sharepoint-ui/elements/button`, then call `defineButton()` once. For native form labels, use `createLabel()` from `@spfx-fast/sharepoint-ui/elements/label`; it returns a real `<label>` so `htmlFor`/`for` association works.
|
|
9
11
|
- `defineSharePointUIElements()` registers the full current catalog; use it only when the whole catalog is needed.
|
|
12
|
+
- Set `brandColor` in `SharePointUIProvider` theme data to derive matching accent, focus, selection, surface, hover, and border tokens. Explicit design tokens override the derived values; the theme API also has a framework-free `@spfx-fast/sharepoint-ui/theme` entry point.
|
|
10
13
|
|
|
11
14
|
For temporary feedback, mount one `Toaster` near the app root and dispatch from descendants with `useToastController()`. For a controller outside the Toaster subtree or when an app has multiple toast regions, set `toasterId` on the target Toaster and pass the same ID to `useToastController(toasterId)`. The controller supports both `updateToast(id, update)` and Fluent's `updateToast({ toastId, content, ...options })` form. Use a permanent status surface as well when the information must remain available after the toast expires.
|
|
12
15
|
|
|
@@ -33,7 +36,7 @@ Use `ContextMenu` for commands attached to a surface: right-click its trigger, o
|
|
|
33
36
|
|
|
34
37
|
Use `SearchBox` for a free-form query, not `ComboBox` when users are choosing from suggestions. It supports controlled `value` or initial `defaultValue`, `onValueChange`, Enter submission through `onSearch`, and a localized clear button. The custom element participates in form value/reset and required validation.
|
|
35
38
|
|
|
36
|
-
Use `Nav` for app destinations: `NavItem` and `NavSubItem` preserve native anchor navigation when given `href`; `NavCategoryItem` only expands/collapses its category. Any of these accepts an `Avatar` through `avatar={<Avatar name="Team" image={photoUrl} size={28} />}`; the React adapter marks it decorative so the item text stays the accessible name. Direct custom elements use `slot="avatar"` and should mark the Avatar `decorative`. Keep destination activation and category disclosure separate. `selectedValue`/`openCategories` are controlled; use `defaultSelectedValue`/`defaultOpenCategories` for initial state. `multiple` allows several categories open. Items follow normal Tab and native Enter/Space behavior. At 640px and below Nav becomes a 44px menu button with a theme-derived drawer at the logical start; Escape, outside click, and destination selection dismiss it. Use controlled `open`/`onOpenChange` or `defaultOpen`, and localize `openLabel`/`closeLabel` or provider strings `navigationMenu`/`navigationClose`. Set
|
|
39
|
+
Use `Nav` for app destinations: `NavItem` and `NavSubItem` preserve native anchor navigation when given `href`; `NavCategoryItem` only expands/collapses its category. Any of these accepts an `Avatar` through `avatar={<Avatar name="Team" image={photoUrl} size={28} />}`; the React adapter marks it decorative so the item text stays the accessible name. Direct custom elements use `slot="avatar"` and should mark the Avatar `decorative`. Keep destination activation and category disclosure separate. `selectedValue`/`openCategories` are controlled; use `defaultSelectedValue`/`defaultOpenCategories` for initial state. `multiple` allows several categories open. Items follow normal Tab and native Enter/Space behavior. At 640px and below Nav becomes a 44px menu button with a theme-derived drawer at the logical start; Escape, outside click, and destination selection dismiss it. Use controlled `open`/`onOpenChange` or `defaultOpen`, and localize `openLabel`/`closeLabel` or provider strings `navigationMenu`/`navigationClose`. Set the provider `lang`; it derives LTR/RTL, and an explicit `dir` overrides that choice. The desktop rail defaults to 260px (`--spui-nav-width`).
|
|
37
40
|
|
|
38
41
|
For a Fluent-shaped application shell, compose `NavDrawer` with `NavDrawerHeader`, `NavDrawerBody`, and `NavDrawerFooter`; choose `type="overlay"` or `type="inline"`. Its default `tabbable={false}` follows roving arrow navigation; opt into `tabbable` when each destination should be a Tab stop. Use `selectedCategoryValue`/`defaultSelectedCategoryValue` for the selected category and the Fluent callback names `onNavItemSelect`/`onNavCategoryItemToggle` when sharing code with Fluent. `AppItem` is a destination, `AppItemStatic` is decorative identity text, and `SplitNavItem` keeps its primary destination independent from optional action, menu, and toggle buttons; add matching tooltip slots for accessible labels. Connect `Hamburger.onClick` to the owning controlled `open` state.
|
|
39
42
|
|
|
@@ -146,11 +149,14 @@ For a people stack with named overflow details, compose `AvatarGroupItem` childr
|
|
|
146
149
|
- React refs are supported on 157 catalogued adapters and target the rendered root element (normally the custom-element host; `InfoLabel` targets its `span`; standalone `Option`/`OptionGroup` render a `div` outside a ComboBox). `Input` and `TextArea` refs also expose `focus()` and `select()`. `npm run verify:react-refs` checks every ref-enabled catalog entry in Chromium.
|
|
147
150
|
- Override CSS variables for broad design changes and `::part(...)` for one component detail. Fonts inherit through `--spui-font-family`.
|
|
148
151
|
- In tests, prefer role/name queries and stable user-visible semantics. Add `data-testid` to the component host only when semantics are insufficient; custom elements accept it directly, and React adapters forward it to the host. Avoid selectors based on shadow DOM internals or generated IDs.
|
|
149
|
-
- Set `lang`
|
|
152
|
+
- Set `lang` for content language; `SharePointUIProvider` derives `dir` from it. Set `dir` only when the region's direction should override its language. Supply localized provider strings for every built-in label used by the page.
|
|
150
153
|
- Use the `fluent`, `ios`, `windows`, or `linux` base appearance. The no-host-theme accent fallback is stone (`DEFAULT_ACCENT`, `#78716c`); SharePoint semantic theme colors override it when provided. Accent hover, focus fallback, and glass tint derive from the active accent. `glass` derives surface and spacing from its selected base appearance and theme.
|
|
151
154
|
|
|
152
155
|
## Data and rich text
|
|
153
156
|
|
|
157
|
+
- For metadata-driven React forms, render `<SharePointField field={field} value={values[name]} onValueChange={...} options={lookupOptions[name]} />` from `@spfx-fast/sharepoint-ui/react`. It selects the matching control, applies accessible field labels and constraints, and supports rich-text Notes. The host supplies Lookup/User options from an authorized data source; built-in Choice values come from SharePoint metadata. For custom layouts, use `getSharePointFieldAdapter(field)` and render its recipe explicitly. Use `serializeSharePointFieldValues(fields, valuesByInternalName)` for one PATCH body: omitted values stay untouched, `null` clears optional fields, and invalid or unknown values throw. It validates supplied values only; new-item forms must include every required value. `getSharePointListItemUrl(webUrl, listId, itemId)` constructs the item endpoint; the host still owns authorization, ETag, and REST entity-type metadata. The adapter's `required`, `readOnly`, `step`, `min`, `max`, and `maxLength` metadata should drive the UI. Generic and focused serializers reject read-only or empty required values and enforce configured numeric precision and bounds. URL recipes expose `urlFormat` (`hyperlink` or `picture`) for record views. Use `getSharePointNextPageUrl(webUrl, nextLink)` to safely follow same-origin OData pages. `getSharePointLookupOptionsUrl(field, sourceWebUrl)` builds lookup requests. These helpers validate and shape data but do not send requests or replace SharePoint permissions and server validation; people search remains tenant-authorized app work.
|
|
158
|
+
|
|
159
|
+
- Forward SharePoint adapter `min`, `max`, and `maxLength` to matching controls when present. The serializers enforce those numeric bounds and text limits too; SharePoint remains the final validator.
|
|
154
160
|
- Use `ColorPicker` when users need a theme-aware color choice. Its `value` is `#RRGGBB`, `alpha` is `0`–`1`, and `onValueChange(value, alpha)` receives both values. Pass `colors` for app-specific swatches; tenant accent, success, warning, and danger swatches are included by default. The element submits `#RRGGBB` or `#RRGGBBAA` as a native form value.
|
|
155
161
|
|
|
156
162
|
- Use `Table` for compact composable rows and `DataGrid` for virtualized/editable data. Compose `TableHeader`, `TableBody`, `TableRow`, `TableHeaderCell`, and `TableCell`; use `TableSelectionCell` for selection, `TableCellLayout`/`TableCellActions` for concise record content, `TableResizeHandle` for consumer-controlled width, and `createTableColumn` for reusable column definitions. Sorting and resizing emit requests: keep that state in the host and pass it back through `sortDirection` or `value`.
|
|
@@ -163,10 +169,24 @@ For a people stack with named overflow details, compose `AvatarGroupItem` childr
|
|
|
163
169
|
- For framework-neutral Tree, import `defineTree` from `@spfx-fast/sharepoint-ui/elements/tree`, assign `items`, `expandedKeys`, and `selectedKeys` properties, and listen for `spui-tree-expanded-change` and `spui-tree-selection-change`.
|
|
164
170
|
- Localize React defaults with `SharePointUIProvider` strings: `Tree`/`FlatTree` use `treeLabel`, `treeToggleLabel`, `treeEmptyMessage`; `Toolbar`, `Breadcrumb`, and `MenuBar` use their matching `*Label` strings; `SplitButton`, `Hamburger`, and `SplitNavItem` use `splitButtonMenuLabel`, `navigationToggle`, and `splitNavItemActionLabel`; virtualized lists use `virtualizerLabel`; row selection and resize handles use `dataGridSelectRow` and `tableResizeHandle`. Explicit labels take precedence. Direct custom elements use their `label`/`aria-label` attributes.
|
|
165
171
|
- Use `Tag` inside a labelled `TagGroup` for filters and selected values. A dismissible React Tag calls `onDismiss(value, label)`; update the parent array to remove it. Semantic colors and `brand` appearance derive from the active SharePoint theme. For framework-neutral use, import `defineTag` and `defineTagGroup` from `@spfx-fast/sharepoint-ui/elements/tags` and listen for `spui-dismiss`.
|
|
166
|
-
- Use `TagPicker` when users need to search and select multiple values. Supply unique stable option values, a visible label, and controlled `selectedValues`/`onChange`; disabled options cannot be selected. Its `name` submits repeated values in native forms. For framework-neutral use, import `defineTagPicker` from `@spfx-fast/sharepoint-ui/elements/tag-picker`, assign the `value` array, and listen for `spui-change`.
|
|
172
|
+
- Use `TagPicker` when users need to search and select multiple values. Supply unique stable option values, a visible label, and controlled `selectedValues`/`onChange`; disabled options cannot be selected. Its popup flips and sizes within the viewport and clipping ancestors, including SharePoint sections; set `positioning` for placement, alignment, fallback, offset, or explicit boundary control. Its `name` submits repeated values in native forms. For framework-neutral use, import `defineTagPicker` from `@spfx-fast/sharepoint-ui/elements/tag-picker`, assign the `value` array, and listen for `spui-change`.
|
|
167
173
|
- Use `Rating` for a labelled star score. `value` is controlled; `defaultValue` initializes an uncontrolled rating. Use `step={0.5}` for half stars, set `max` for the scale, and provide `itemLabel` when the radio option labels need custom localization.
|
|
168
174
|
- For framework-neutral `spui-virtual-list`, assign `items`, `renderItem`, and `itemKey` after importing `defineVirtualList`. Set `axis="horizontal"` or its `axis` property, `item-size`/`itemSize` for the estimated width or height, and `measure-items`/`measureItems` to track rendered sizes. `row-height` remains the vertical compatibility alias. Set `--spui-list-width` for a horizontal viewport; direction follows inherited `dir`, including logical RTL scrolling. Use `scrollToIndex(index, "start" | "center" | "end", behavior)` for programmatic navigation.
|
|
169
175
|
- `RichTextEditor` emits allowlist-normalized HTML. Store it in a SharePoint rich-text field and render it back through the editor or another sanitizer-aware view; do not inject saved HTML with raw `innerHTML`. After inserting a table, click a cell to enable row/column insertion and deletion; table removal is available from any selected cell. Editing controls disable for merged cells so row/column changes cannot corrupt their spans. Localize the toolbar through `SharePointUIProvider.strings` (for example, `richTextInsertRowBelow` and `richTextDeleteTable`).
|
|
176
|
+
- Pass a SharePoint multiline field's metadata as React `field={column}` so the editor derives the maximum content mode the field can store. `RichText: false` selects plain text; `RestrictedMode: true` removes enhanced rich actions; `RichTextMode: "Compatible"` selects compatible rich formatting; `"FullHtml"` selects the broad sanitized HTML mode. Explicit `contentMode` may narrow but never exceed that capability ceiling; `allowHyperlink={false}` can further disable links, but cannot override `AllowHyperlink: false`. For framework-neutral custom elements, spread `getRichTextEditorFieldOptions(column)` instead. If no restrictions are available, the editor keeps the broad sanitized HTML mode.
|
|
177
|
+
- Connect the editor's `linkPicker` to the SPFx app's existing page/file picker; this keeps tenant-specific picker dependencies out of the UI package. Return `null` on cancel, otherwise map the selected item's absolute URL and optional label into `RichTextEditorLink`. The editor validates the URL and leaves it for review before Apply.
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
import { RichTextEditor, type RichTextEditorLink } from "@spfx-fast/sharepoint-ui/react";
|
|
181
|
+
|
|
182
|
+
const linkPicker = async (current: RichTextEditorLink | null) => {
|
|
183
|
+
const selected = await pageFilePicker.open({ initialUrl: current?.href });
|
|
184
|
+
return selected ? { href: selected.url, text: selected.name, title: selected.name } : null;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
<RichTextEditor value={html} onValueChange={setHtml} linkPicker={linkPicker}
|
|
188
|
+
onLinkPickerError={error => console.error("SharePoint link picker failed", error)} />
|
|
189
|
+
```
|
|
170
190
|
- Persist through `SPHttpClient` in the web part. Include loading, saved, and error states, and verify important writes by reading the item back.
|
|
171
191
|
|
|
172
192
|
## Before handing off a web part
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# SharePoint UI quickstart
|
|
2
|
+
|
|
3
|
+
Install `@spfx-fast/sharepoint-ui`. Use the component page’s React export, properties, slots, and callback table as the source of truth.
|
|
4
|
+
|
|
5
|
+
## React in an SPFx web part
|
|
6
|
+
|
|
7
|
+
Wrap the web part view once. Pass the current page culture; the provider applies the locale and text direction. Keep SharePoint reads, writes, and business rules in the web part.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Button, SharePointUIProvider, ViewCard } from "@spfx-fast/sharepoint-ui/react";
|
|
11
|
+
|
|
12
|
+
type Request = { id: number; title: string; status: string };
|
|
13
|
+
|
|
14
|
+
export function RequestList({
|
|
15
|
+
requests,
|
|
16
|
+
locale,
|
|
17
|
+
openRequest,
|
|
18
|
+
}: {
|
|
19
|
+
requests: Request[];
|
|
20
|
+
locale: string;
|
|
21
|
+
openRequest: (id: number) => void;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<SharePointUIProvider lang={locale}>
|
|
25
|
+
{requests.map(request => (
|
|
26
|
+
<ViewCard key={request.id} kind="list-item" title={request.title} description={request.status}>
|
|
27
|
+
<Button slot="actions" onClick={() => openRequest(request.id)}>Open</Button>
|
|
28
|
+
</ViewCard>
|
|
29
|
+
))}
|
|
30
|
+
</SharePointUIProvider>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
In the web part, pass `this.context.pageContext.cultureInfo.currentUICultureName` as `locale`. For a single control, import its React export from `/react`; import only what the view uses.
|
|
36
|
+
|
|
37
|
+
Set `brandColor` on the provider theme to derive a coordinated accent, focus, selection, surface, hover, and border palette. Explicit design tokens override the derived values; see the [theme guide](https://vystartasv.github.io/sharepoint-ui/guides/theming-and-direction/).
|
|
38
|
+
|
|
39
|
+
## The shared component pattern
|
|
40
|
+
|
|
41
|
+
- Every React adapter is a named export from `@spfx-fast/sharepoint-ui/react`. React imports register the element automatically; do not call `defineX()` in React.
|
|
42
|
+
- Put `SharePointUIProvider` once around the view. Theme, font, locale, direction, and provider strings flow to descendants.
|
|
43
|
+
- Compose components with children. Use a named slot or a component-specific prop only when its page documents one; the `Slots` table shows the exact names.
|
|
44
|
+
- When an API has controlled state, pass its state prop and update it in the documented callback. `defaultX` supplies initial state where supported. State names and callback arguments are component-specific; copy them from that component’s page rather than guessing.
|
|
45
|
+
- Styling and host attributes belong on the component host. Use inherited theme tokens, documented CSS custom properties or `::part` hooks; do not target shadow-DOM internals.
|
|
46
|
+
- Keep labels, accessible names, and app behavior in the host view. The component handles its documented interaction and reports changes; the web part handles SharePoint data and persistence.
|
|
47
|
+
|
|
48
|
+
Use composition like this:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { Avatar, Button, Persona, Tooltip } from "@spfx-fast/sharepoint-ui/react";
|
|
52
|
+
|
|
53
|
+
export function RequestActions({ openRequest, photoUrl }: { openRequest: () => void; photoUrl: string }) {
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<Tooltip content="Opens the request details">
|
|
57
|
+
<Button onClick={openRequest}>Open request</Button>
|
|
58
|
+
</Tooltip>
|
|
59
|
+
<Persona
|
|
60
|
+
name="Ada Lovelace"
|
|
61
|
+
primaryText="Ada Lovelace"
|
|
62
|
+
secondaryText="Engineering"
|
|
63
|
+
avatar={<Avatar name="Ada Lovelace" image={photoUrl} decorative />}
|
|
64
|
+
/>
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`Tooltip` uses its children as the trigger and its `content` as the tooltip. `Persona` accepts identity text directly and an optional composed `Avatar`. Other components follow the same import, provider, children, and host-styling rules; use their own page for their specific props, slots, and callback signatures. For Tooltip controlled visibility, use `open` with `onOpenChange`; `visible` and `onVisibleChange` remain compatibility aliases.
|
|
71
|
+
|
|
72
|
+
For a responsive command shelf, let `Overflow` move lower-priority actions into its menu. `useStoredOverflowCompactMode` remembers a per-browser compact spacing choice; include the app and site in its key so separate workspaces do not share a setting:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { Button, Overflow, OverflowItem, ToggleButton, useStoredOverflowCompactMode } from "@spfx-fast/sharepoint-ui/react";
|
|
76
|
+
|
|
77
|
+
function RequestCommands({ siteId }: { siteId: string }) {
|
|
78
|
+
const { compact, setCompact } = useStoredOverflowCompactMode(`requests:${siteId}`);
|
|
79
|
+
return <>
|
|
80
|
+
<ToggleButton pressed={compact} onPressedChange={setCompact}>Compact commands</ToggleButton>
|
|
81
|
+
<Overflow label="Request actions" density={compact ? "compact" : "comfortable"}>
|
|
82
|
+
<OverflowItem id="open" priority={2}><Button>Open</Button></OverflowItem>
|
|
83
|
+
<OverflowItem id="share" priority={1}><Button>Share</Button></OverflowItem>
|
|
84
|
+
</Overflow>
|
|
85
|
+
</>;
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For custom elements, set `density="compact"` on `<spui-overflow>` and persist the toggle with the app's preferred storage. Token-sized controls remain at least 44px tall on coarse-pointer devices; explicit component sizes stay in effect.
|
|
90
|
+
|
|
91
|
+
## Another framework or plain HTML
|
|
92
|
+
|
|
93
|
+
Import only the component’s leaf factory, register it once, then use its documented custom-element tag:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
import { defineButton } from "@spfx-fast/sharepoint-ui/elements/button";
|
|
97
|
+
|
|
98
|
+
defineButton();
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```html
|
|
102
|
+
<spui-button appearance="primary">Open</spui-button>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## SPFx 1.24 Copilot UX components
|
|
106
|
+
|
|
107
|
+
For a Copilot surface that reads SharePoint data, updates the visible-state context, and saves through `SPHttpClient`, use the [SPFx CLI template](https://github.com/vystartasv/sharepoint-ui/tree/main/templates/spfx-fast-copilot-access-review) or the [complete tenant-connected example](https://github.com/vystartasv/sharepoint-ui/tree/main/examples/spfx124-copilot-ux). Both are framework-free and import only the custom elements they use.
|
|
108
|
+
|
|
109
|
+
For a metadata-driven form, use `<SharePointField>` from `/react` or `<spui-sharepoint-field>` without React. Both select the control from SharePoint metadata, apply accessible labels and field rules, and support rich-text Notes. Load Lookup/User options in the host; Choice values come from field metadata. For custom elements, register once and set object data as properties:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { defineSharePointField } from "@spfx-fast/sharepoint-ui/elements/sharepoint-fields";
|
|
113
|
+
|
|
114
|
+
defineSharePointField();
|
|
115
|
+
const control = document.querySelector("spui-sharepoint-field")!;
|
|
116
|
+
control.field = column;
|
|
117
|
+
control.value = item[column.InternalName];
|
|
118
|
+
control.options = lookupOptions;
|
|
119
|
+
control.addEventListener("spui-field-value-change", event => updateDraft(event.detail.field, event.detail.value));
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For custom layouts, request definitions with `getSharePointFieldMetadataUrl(webUrl, listId)` and inspect each `getSharePointFieldAdapter(field)` recipe. Use `serializeSharePointFieldValues(fields, valuesByInternalName)` to assemble a PATCH body: omitted values stay untouched and `null` clears optional fields. New-item forms must include every required value. `getSharePointListItemUrl(webUrl, listId, itemId)` builds a validated item endpoint; the host supplies authorization, ETag, and REST entity-type metadata. Generic and focused serializers reject empty required values and read-only writes, enforce configured numeric precision and bounds, and reject values over the configured text length. `getSharePointNextPageUrl(webUrl, nextLink)` safely resolves same-origin OData paging links; `getSharePointLookupOptionsUrl(field, sourceWebUrl)` builds lookup requests. The app supplies authorized fetches, people search, permissions, and persistence.
|
|
123
|
+
|
|
124
|
+
Forward adapter `min`, `max`, and `maxLength` to matching controls when present. The serializers enforce numeric bounds and text lengths too; SharePoint remains the final validator.
|
|
125
|
+
|
|
126
|
+
## Build from a component page
|
|
127
|
+
|
|
128
|
+
1. Copy the React export or custom-element tag and its property/slot table.
|
|
129
|
+
2. Use the matching component JSON slice linked from that page for exact types and callbacks.
|
|
130
|
+
3. Use the shared `agentContract` included in every component JSON slice, then follow that component’s exact state props, callbacks, and slots.
|
|
131
|
+
4. Keep app state and persistence in the host; connect documented callbacks to it.
|
|
132
|
+
|
|
133
|
+
The same pattern applies across components. Add `SharePointUIProvider` once at the view root for React; custom elements inherit theme and direction from their host context. Each component slice links to its module event inventory. `detailPropertiesComplete` tells whether the listed event detail keys are exhaustive. Events are module-scoped: when several tags share a module, check the event target before handling them. Use the [component conventions guide](https://vystartasv.github.io/sharepoint-ui/guides/component-patterns/) for human-readable composition examples and the component page plus its JSON slice for exact APIs.
|
package/README.md
CHANGED
|
@@ -32,8 +32,10 @@ defineButton();
|
|
|
32
32
|
<spui-button appearance="primary">Save</spui-button>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
**Docs
|
|
35
|
+
**Docs:** [component catalog](https://vystartasv.github.io/sharepoint-ui/) · **Agent quickstart:** [build from a component page](https://vystartasv.github.io/sharepoint-ui/agents/QUICKSTART.md) · **Agent references:** [instructions and API slices](https://vystartasv.github.io/sharepoint-ui/agents/)
|
|
36
36
|
|
|
37
37
|
The docs cover theming, RTL, accessibility, forms, rich-text persistence, and every component. See [AGENTS.md](./AGENTS.md) for agent guidance and [components.json](./components.json) for the API catalog.
|
|
38
38
|
|
|
39
|
+
For framework-independent theme helpers, import from `@spfx-fast/sharepoint-ui/theme`. Set `brandColor` in `SharePointUIDesignTheme` to derive coordinated accent, focus, selection, surface, hover, and border colors.
|
|
40
|
+
|
|
39
41
|
[MIT License](./LICENSE)
|
package/components.json
CHANGED
|
@@ -340,15 +340,39 @@
|
|
|
340
340
|
"host className/style"
|
|
341
341
|
],
|
|
342
342
|
"reactSignature": "{ children, selectedValue, defaultSelectedValue, selectedValues, defaultSelectedValues, selectionMode = \"single\", layout = \"grid\", size = \"medium\", shape = \"square\", spacing = \"medium\", focusMode = \"arrow\", columns = 6, onSelectionChange, ...props }: SwatchPickerProps",
|
|
343
|
-
"reactRefType": "HTMLElement"
|
|
343
|
+
"reactRefType": "HTMLElement",
|
|
344
|
+
"relatedReactApis": [
|
|
345
|
+
{
|
|
346
|
+
"name": "useSavedSwatchPalettes(store)",
|
|
347
|
+
"description": "Load, save, remove, and refresh named palettes through a stable host-owned store. Use the app's SharePoint data service for tenant-wide persistence; the hook adds no network or storage dependency. See the saved palettes guide for a complete React recipe."
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "SwatchPaletteStore",
|
|
351
|
+
"description": "Implement list, save, and remove with the app's current persistence service. Keep the store object stable across React renders."
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"name": "SavedSwatchPalette",
|
|
355
|
+
"description": "A named palette record with an id and color entries containing value, color, and optional label."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "SharePointThemeSwatches",
|
|
359
|
+
"description": "Compose inside SwatchPicker to render every color in the nearest SharePointUIProvider theme palette. Pass palette to override the provider palette, or labelForColor to localize accessible color names."
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "getSharePointThemeColorPresets(palette, labelForKey?)",
|
|
363
|
+
"description": "Framework-neutral helper that maps every non-empty SharePoint palette entry, including custom tenant keys, to named swatch data."
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "SharePointThemeColorPreset",
|
|
367
|
+
"description": "A named palette key, controlled value, CSS color, and accessible label."
|
|
368
|
+
}
|
|
369
|
+
]
|
|
344
370
|
},
|
|
345
371
|
"react": "SwatchPicker",
|
|
346
372
|
"tag": "spui-swatch-picker",
|
|
347
373
|
"define": "defineSwatchPicker",
|
|
348
374
|
"summary": "Render accessible color and image swatches as a keyboard-operable single- or multi-selection grid or row.",
|
|
349
|
-
"highValueAdditions": [
|
|
350
|
-
"Offer reusable named theme-color presets alongside caller-defined palettes."
|
|
351
|
-
]
|
|
375
|
+
"highValueAdditions": []
|
|
352
376
|
},
|
|
353
377
|
{
|
|
354
378
|
"module": "swatch-picker",
|
|
@@ -449,7 +473,13 @@
|
|
|
449
473
|
"module": "overflow",
|
|
450
474
|
"category": "actions",
|
|
451
475
|
"api": {
|
|
452
|
-
"reactSignature": "{ children, label, minimumVisible = 0, overflowDirection = \"end\", overflowAxis = \"horizontal\", hasHiddenItems = false, overflowContent, padding = 10, onOverflowChange, onOverflowItemSelect, ...props }: ElementProps & { children?: React.ReactNode; label?: string; minimumVisible?: number; overflowDirection?: \"start\" | \"end\"; overflowAxis?: OverflowAxis; hasHiddenItems?: boolean; overflowContent?: React.ReactNode; padding?: number; onOverflowChange?: (event: null, data: OverflowState) => void; onOverflowItemSelect?: (id: string) => void }",
|
|
476
|
+
"reactSignature": "{ children, label, minimumVisible = 0, overflowDirection = \"end\", overflowAxis = \"horizontal\", density = \"comfortable\", hasHiddenItems = false, overflowContent, padding = 10, onOverflowChange, onOverflowItemSelect, ...props }: ElementProps & { children?: React.ReactNode; label?: string; minimumVisible?: number; overflowDirection?: \"start\" | \"end\"; overflowAxis?: OverflowAxis; density?: OverflowDensity; hasHiddenItems?: boolean; overflowContent?: React.ReactNode; padding?: number; onOverflowChange?: (event: null, data: OverflowState) => void; onOverflowItemSelect?: (id: string) => void }",
|
|
477
|
+
"relatedReactApis": [
|
|
478
|
+
{
|
|
479
|
+
"name": "useStoredOverflowCompactMode(storageKey, defaultCompact?)",
|
|
480
|
+
"description": "Persist this browser's compact command-shelf choice; use the returned compact value as Overflow density and setCompact or toggleCompact from a ToggleButton. Scope storageKey to the app and SharePoint site. Custom-element consumers can set density=compact directly and persist it with their own preference store."
|
|
481
|
+
}
|
|
482
|
+
],
|
|
453
483
|
"callbackProps": [
|
|
454
484
|
"onOverflowChange",
|
|
455
485
|
"onOverflowItemSelect"
|
|
@@ -465,10 +495,8 @@
|
|
|
465
495
|
"named ::part hooks"
|
|
466
496
|
]
|
|
467
497
|
},
|
|
468
|
-
"summary": "Keep priority actions visible as space changes
|
|
469
|
-
"highValueAdditions": [
|
|
470
|
-
"Add a priority-aware responsive command shelf with group labels and persisted compact mode."
|
|
471
|
-
]
|
|
498
|
+
"summary": "Keep priority actions visible as space changes, move the rest into a menu, and let a stored user preference switch the shelf to compact spacing.",
|
|
499
|
+
"highValueAdditions": []
|
|
472
500
|
},
|
|
473
501
|
{
|
|
474
502
|
"react": "OverflowProvider",
|
|
@@ -586,7 +614,8 @@
|
|
|
586
614
|
"motion accepts slide attraction physics: { kind: \"slide\", duration?: number }; duration follows Embla’s 20–60 recommendation"
|
|
587
615
|
],
|
|
588
616
|
"highValueAdditions": [
|
|
589
|
-
"Enable drag with keyboard-equivalent announcements and preserve end padding when slides are centered."
|
|
617
|
+
"Enable drag with keyboard-equivalent announcements and preserve end padding when slides are centered.",
|
|
618
|
+
"Use CarouselNav appearance=thumbnails with CarouselNavImageButton for a horizontally scrollable image-preview strip."
|
|
590
619
|
],
|
|
591
620
|
"reactRefType": "HTMLElement"
|
|
592
621
|
},
|
|
@@ -918,8 +947,11 @@
|
|
|
918
947
|
"default",
|
|
919
948
|
"leading",
|
|
920
949
|
"eyebrow",
|
|
950
|
+
"title",
|
|
951
|
+
"subtitle",
|
|
952
|
+
"description",
|
|
921
953
|
"status",
|
|
922
|
-
"
|
|
954
|
+
"actions"
|
|
923
955
|
],
|
|
924
956
|
"styling": [
|
|
925
957
|
"SharePointUIProvider tokens",
|
|
@@ -1452,6 +1484,37 @@
|
|
|
1452
1484
|
},
|
|
1453
1485
|
"summary": "Edit a single-line value with an accessible label and controlled change events."
|
|
1454
1486
|
},
|
|
1487
|
+
{
|
|
1488
|
+
"react": "SharePointField",
|
|
1489
|
+
"tag": "spui-sharepoint-field",
|
|
1490
|
+
"define": "defineSharePointField",
|
|
1491
|
+
"module": "sharepoint-fields",
|
|
1492
|
+
"category": "forms",
|
|
1493
|
+
"summary": "Render SharePoint field metadata with accessible controls in React or as a framework-free custom element.",
|
|
1494
|
+
"api": {
|
|
1495
|
+
"reactSignature": "{ field, value, defaultValue, options: providedOptions, onValueChange, disabled = false, hint, validationMessage, renderUnsupported, addChoiceLabel = \"Add another choice\", emptyOptionLabel = \"Select an option\", className, style, ...hostProps }: SharePointFieldProps",
|
|
1496
|
+
"callbackProps": [
|
|
1497
|
+
"onValueChange"
|
|
1498
|
+
],
|
|
1499
|
+
"slots": [],
|
|
1500
|
+
"styling": [
|
|
1501
|
+
"SharePointUIProvider tokens",
|
|
1502
|
+
"Field label, hint, and validation states",
|
|
1503
|
+
"id, ARIA, data attributes, className, and style"
|
|
1504
|
+
],
|
|
1505
|
+
"customElementProperties": [
|
|
1506
|
+
"field",
|
|
1507
|
+
"value",
|
|
1508
|
+
"defaultValue",
|
|
1509
|
+
"options",
|
|
1510
|
+
"onValueChange",
|
|
1511
|
+
"renderUnsupported"
|
|
1512
|
+
],
|
|
1513
|
+
"customElementEvents": [
|
|
1514
|
+
"spui-field-value-change"
|
|
1515
|
+
]
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1455
1518
|
{
|
|
1456
1519
|
"react": "SearchBox",
|
|
1457
1520
|
"tag": "spui-search-box",
|
|
@@ -1487,7 +1550,7 @@
|
|
|
1487
1550
|
"module": "text",
|
|
1488
1551
|
"category": "typography",
|
|
1489
1552
|
"api": {
|
|
1490
|
-
"reactSignature": "{ as = \"span\", size = 300, weight, font = \"base\", align = \"start\", italic = false, underline = false, strikethrough = false, truncate = false, wrap = true, block = false, children, ...props }: TextProps",
|
|
1553
|
+
"reactSignature": "{ as = \"span\", size = 300, weight, font = \"base\", align = \"start\", italic = false, underline = false, strikethrough = false, truncate = false, wrap = true, block = false, children, style, ...props }: TextProps",
|
|
1491
1554
|
"callbackProps": [],
|
|
1492
1555
|
"slots": [
|
|
1493
1556
|
"default"
|
|
@@ -1817,7 +1880,7 @@
|
|
|
1817
1880
|
"registered": false,
|
|
1818
1881
|
"note": "Uses a native HTML label to preserve browser label association and click-to-focus behavior; createLabel returns an HTMLLabelElement for non-React consumers.",
|
|
1819
1882
|
"api": {
|
|
1820
|
-
"reactSignature": "{ htmlFor, size = \"medium\", weight = \"regular\", required = false, disabled = false, children, style, ...props }:
|
|
1883
|
+
"reactSignature": "{ htmlFor, size = \"medium\", weight = \"regular\", required = false, disabled = false, children, style, ...props }: LabelProps",
|
|
1821
1884
|
"reactRefType": "HTMLLabelElement",
|
|
1822
1885
|
"callbackProps": [],
|
|
1823
1886
|
"slots": [
|
|
@@ -1976,6 +2039,10 @@
|
|
|
1976
2039
|
"api": {
|
|
1977
2040
|
"reactSignature": "inputProps: ComboBoxProps",
|
|
1978
2041
|
"relatedReactApis": [
|
|
2042
|
+
{
|
|
2043
|
+
"name": "ComboBoxProps.requiredMessage",
|
|
2044
|
+
"description": "Sets the native form validation message; defaults to SharePointUIProvider.strings.required."
|
|
2045
|
+
},
|
|
1979
2046
|
{
|
|
1980
2047
|
"name": "ComboBoxProps.selectedLabel",
|
|
1981
2048
|
"description": "In multiselect mode, names the selected-options group; defaults to SharePointUIProvider.strings.selectedOptionsLabel."
|
|
@@ -2240,14 +2307,69 @@
|
|
|
2240
2307
|
"api": {
|
|
2241
2308
|
"reactSignature": "inputProps: RichTextEditorProps",
|
|
2242
2309
|
"relatedReactApis": [
|
|
2310
|
+
{
|
|
2311
|
+
"name": "RichTextEditorProps.field",
|
|
2312
|
+
"description": "Pass SharePoint Note metadata directly; the editor derives its capability ceiling. contentMode and allowHyperlink may narrow that ceiling, but cannot enable features the field forbids."
|
|
2313
|
+
},
|
|
2314
|
+
{
|
|
2315
|
+
"name": "RichTextEditorProps.contentMode",
|
|
2316
|
+
"description": "Choose plain, restricted, rich, or sanitized html output. With field metadata, this prop may narrow but cannot exceed the destination field's capabilities. Omit it for field-derived mode or unconstrained sanitized html."
|
|
2317
|
+
},
|
|
2318
|
+
{
|
|
2319
|
+
"name": "getRichTextEditorFieldOptions(field)",
|
|
2320
|
+
"description": "Maps SharePoint RichText, RestrictedMode, RichTextMode, and AllowHyperlink metadata to editor capabilities. Explicit restrictions are preserved; missing restrictions default to sanitized html. React consumers can pass field={metadata} directly."
|
|
2321
|
+
},
|
|
2243
2322
|
{
|
|
2244
2323
|
"name": "RichTextEditorProps.editorLabel",
|
|
2245
2324
|
"description": "Accessible name used when no aria-label or visible label is supplied; defaults to SharePointUIProvider.strings.richTextEditorLabel."
|
|
2325
|
+
},
|
|
2326
|
+
{
|
|
2327
|
+
"name": "RichTextEditorProps color labels",
|
|
2328
|
+
"description": "SharePointUIProvider.strings.richTextTextColor, richTextHighlightColor, richTextCustomColor, richTextThemeAccent, richTextFontFamily, richTextFontSize, and colorSwatch localize color and font controls and their palette labels. These are available for compatible-rich and FullHtml fields; restricted/plain fields hide them. Safe inline font/color styles are sanitized before values are emitted."
|
|
2329
|
+
},
|
|
2330
|
+
{
|
|
2331
|
+
"name": "RichTextEditorProps.onValueChange",
|
|
2332
|
+
"description": "Receives sanitized HTML after edits. With a controlled value prop, update that prop from this callback; the editor preserves its live selection while React applies the committed value."
|
|
2333
|
+
},
|
|
2334
|
+
{
|
|
2335
|
+
"name": "RichTextEditorProps.onImageUpload",
|
|
2336
|
+
"description": "Upload the selected file and return its URL string, or return { src, alt } to provide meaningful image alternative text. The object form requires alt; use alt: \"\" only for decorative images. String results use filename-based alternative text."
|
|
2337
|
+
},
|
|
2338
|
+
{
|
|
2339
|
+
"name": "RichTextEditor mobile selection",
|
|
2340
|
+
"description": "On touch devices, press and hold text to use the browser's native selection handles. The editor does not force blur or refocus during the gesture; toolbar formatting uses the saved range."
|
|
2341
|
+
},
|
|
2342
|
+
{
|
|
2343
|
+
"name": "RichTextEditorProps.onImageUploadError",
|
|
2344
|
+
"description": "Receives the failed image filename and error when the application-managed upload fails or returns an unsafe URL."
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
"name": "RichTextEditorProps.linkPicker",
|
|
2348
|
+
"description": "Opens the host application's SharePoint picker with the current link, then fills the editor for review before the user applies it. Return null to cancel."
|
|
2349
|
+
},
|
|
2350
|
+
{
|
|
2351
|
+
"name": "RichTextEditorProps.onLinkPickerError",
|
|
2352
|
+
"description": "Receives an error when the host-provided SharePoint link picker fails."
|
|
2353
|
+
},
|
|
2354
|
+
{
|
|
2355
|
+
"name": "SharePointUIProvider.strings.richTextLink*",
|
|
2356
|
+
"description": "Customize the link editor's accessible name, field labels, action labels, picker states, and validation messages for the active language."
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
"name": "SharePointUIProvider.strings.richText*",
|
|
2360
|
+
"description": "Localize the text-style menu, block names, formatting buttons, table actions, link editor, image controls, and required message."
|
|
2361
|
+
},
|
|
2362
|
+
{
|
|
2363
|
+
"name": "RichTextEditor full HTML formatting",
|
|
2364
|
+
"description": "Subscript, superscript, and left/center/right/justified paragraph alignment are available only when the effective contentMode is html. Localize them with SharePointUIProvider.strings.richTextSubscript, richTextSuperscript, richTextAlignLeft, richTextAlignCenter, richTextAlignRight, and richTextAlignJustify."
|
|
2246
2365
|
}
|
|
2247
2366
|
],
|
|
2248
2367
|
"callbackProps": [
|
|
2249
2368
|
"onValueChange",
|
|
2250
|
-
"onImageUpload"
|
|
2369
|
+
"onImageUpload",
|
|
2370
|
+
"onImageUploadError",
|
|
2371
|
+
"linkPicker",
|
|
2372
|
+
"onLinkPickerError"
|
|
2251
2373
|
],
|
|
2252
2374
|
"slots": [],
|
|
2253
2375
|
"styling": [
|
|
@@ -2258,7 +2380,10 @@
|
|
|
2258
2380
|
],
|
|
2259
2381
|
"reactRefType": "HTMLElement"
|
|
2260
2382
|
},
|
|
2261
|
-
"summary": "Edit sanitized
|
|
2383
|
+
"summary": "Edit sanitized content with block styles, font family and size, text and highlight colors where the SharePoint field permits them, lists, tables, safe links, and host-managed images. Field metadata selects plain, restricted, compatible-rich, or FullHtml behavior.",
|
|
2384
|
+
"highValueAdditions": [
|
|
2385
|
+
"Preview SharePoint page titles and destination details before inserting internal links."
|
|
2386
|
+
]
|
|
2262
2387
|
},
|
|
2263
2388
|
{
|
|
2264
2389
|
"react": "Spinner",
|
|
@@ -2396,7 +2521,7 @@
|
|
|
2396
2521
|
],
|
|
2397
2522
|
"reactRefType": "HTMLElement"
|
|
2398
2523
|
},
|
|
2399
|
-
"summary": "
|
|
2524
|
+
"summary": "Stack related status messages with optional entry, exit, and reflow motion."
|
|
2400
2525
|
},
|
|
2401
2526
|
{
|
|
2402
2527
|
"react": "MessageBarTitle",
|
|
@@ -3149,6 +3274,7 @@
|
|
|
3149
3274
|
"onMultiSortChange",
|
|
3150
3275
|
"onFilterValueChange",
|
|
3151
3276
|
"onCellEdit",
|
|
3277
|
+
"onCellEditError",
|
|
3152
3278
|
"validateCellEdit",
|
|
3153
3279
|
"getRowHeight",
|
|
3154
3280
|
"onCellsEdit",
|
|
@@ -3166,7 +3292,7 @@
|
|
|
3166
3292
|
"editing": {
|
|
3167
3293
|
"columnOptions": "editable?: boolean; editType?: text | number | date",
|
|
3168
3294
|
"activation": "Enter, F2, or double-click",
|
|
3169
|
-
"commit": "Enter or focus leaving the editor; async onCellEdit errors keep the editor open",
|
|
3295
|
+
"commit": "Enter or focus leaving the editor; async onCellEdit errors keep the editor open and call onCellEditError",
|
|
3170
3296
|
"cancel": "Escape",
|
|
3171
3297
|
"validation": "validateCellEdit returns an accessible error message",
|
|
3172
3298
|
"persistence": "Callback receives row id, column id, previous value, new value, and item. The host owns SharePoint persistence and should supply refreshed items after save."
|
|
@@ -3505,8 +3631,12 @@
|
|
|
3505
3631
|
"module": "tag-picker",
|
|
3506
3632
|
"category": "form",
|
|
3507
3633
|
"api": {
|
|
3508
|
-
"reactSignature": "{ children, label, selectedLabel, selectedOptions, defaultSelectedOptions, selectedValues, defaultSelectedValues, inputValue, open, defaultOpen, positioning, disableAutoFocus = false, inline = false, noPopover = false, disabled, onOpenChange, onOptionSelect, onInputValueChange, onChange, ...props }: TagPickerProps",
|
|
3634
|
+
"reactSignature": "{ children, label, selectedLabel, requiredMessage, selectedOptions, defaultSelectedOptions, selectedValues, defaultSelectedValues, inputValue, open, defaultOpen, positioning, disableAutoFocus = false, inline = false, noPopover = false, disabled, onOpenChange, onOptionSelect, onInputValueChange, onChange, ...props }: TagPickerProps",
|
|
3509
3635
|
"relatedReactApis": [
|
|
3636
|
+
{
|
|
3637
|
+
"name": "TagPickerProps.requiredMessage",
|
|
3638
|
+
"description": "Sets the native form validation message; defaults to SharePointUIProvider.strings.required."
|
|
3639
|
+
},
|
|
3510
3640
|
{
|
|
3511
3641
|
"name": "TagPickerProps.selectedLabel",
|
|
3512
3642
|
"description": "Names the selected-options group; defaults to SharePointUIProvider.strings.selectedOptionsLabel."
|
|
@@ -3517,7 +3647,7 @@
|
|
|
3517
3647
|
},
|
|
3518
3648
|
{
|
|
3519
3649
|
"name": "TagPickerProps.positioning",
|
|
3520
|
-
"description": "Positions the options surface
|
|
3650
|
+
"description": "Positions and sizes the options surface within viewport or clipping-ancestor boundaries; supports placement, alignment, fallbacks, offsets, and custom bounds."
|
|
3521
3651
|
},
|
|
3522
3652
|
{
|
|
3523
3653
|
"name": "TagPickerProps.disableAutoFocus",
|
|
@@ -3542,10 +3672,9 @@
|
|
|
3542
3672
|
],
|
|
3543
3673
|
"reactRefType": "HTMLElement"
|
|
3544
3674
|
},
|
|
3545
|
-
"summary": "Search, choose, and remove multiple values with keyboard
|
|
3675
|
+
"summary": "Search, choose, and remove multiple values with keyboard, native form support, and popup placement that adapts to SharePoint sections.",
|
|
3546
3676
|
"highValueAdditions": [
|
|
3547
|
-
"Add composed control, input, selected-tag group, and list primitives while preserving the single state engine."
|
|
3548
|
-
"Position the options surface against viewport and clipping ancestors, including SharePoint sections."
|
|
3677
|
+
"Add composed control, input, selected-tag group, and list primitives while preserving the single state engine."
|
|
3549
3678
|
]
|
|
3550
3679
|
},
|
|
3551
3680
|
{
|
|
@@ -3703,7 +3832,13 @@
|
|
|
3703
3832
|
"module": "rating",
|
|
3704
3833
|
"category": "forms",
|
|
3705
3834
|
"api": {
|
|
3706
|
-
"reactSignature": "{ value, defaultValue = 0, max = 5, step = 1, size = \"extra-large\", color = \"neutral\", label, itemLabel, iconFilled, iconOutline, fullValueInput, halfValueInput, name, disabled = false, readOnly = false, required = false, onChange, ...props }: RatingProps",
|
|
3835
|
+
"reactSignature": "{ value, defaultValue = 0, max = 5, step = 1, size = \"extra-large\", color = \"neutral\", label, requiredMessage, itemLabel, iconFilled, iconOutline, fullValueInput, halfValueInput, name, disabled = false, readOnly = false, required = false, onChange, ...props }: RatingProps",
|
|
3836
|
+
"relatedReactApis": [
|
|
3837
|
+
{
|
|
3838
|
+
"name": "RatingProps.requiredMessage",
|
|
3839
|
+
"description": "Sets the native form validation message; defaults to SharePointUIProvider.strings.required."
|
|
3840
|
+
}
|
|
3841
|
+
],
|
|
3707
3842
|
"callbackProps": [
|
|
3708
3843
|
"itemLabel",
|
|
3709
3844
|
"onChange"
|
|
@@ -4896,7 +5031,7 @@
|
|
|
4896
5031
|
"module": "nav",
|
|
4897
5032
|
"category": "navigation",
|
|
4898
5033
|
"api": {
|
|
4899
|
-
"reactSignature": "{ children, label = \"Navigation\", selectedValue, defaultSelectedValue, selectedCategoryValue, defaultSelectedCategoryValue, openCategories, defaultOpenCategories = [], open, defaultOpen, collapsed, defaultCollapsed, collapsible = false, multiple = true, density = \"medium\", openLabel, closeLabel, onItemSelect, onCategoryToggle, onNavItemSelect, onNavCategoryItemToggle, onOpenChange, onCollapsedChange, onClick, onClickCapture, onKeyDown, onKeyDownCapture, onKeyUp, onKeyUpCapture, onKeyPress, onKeyPressCapture, onFocus, onFocusCapture, onBlur, onBlurCapture, onAuxClick, onAuxClickCapture, onContextMenu, onContextMenuCapture, onDoubleClick, onDoubleClickCapture, onMouseDown, onMouseDownCapture, onMouseMove, onMouseMoveCapture, onMouseOut, onMouseOutCapture, onMouseOver, onMouseOverCapture, onMouseUp, onMouseUpCapture, onGotPointerCapture, onGotPointerCaptureCapture, onLostPointerCapture, onLostPointerCaptureCapture, onPointerCancel, onPointerCancelCapture, onPointerDown, onPointerDownCapture, onPointerMove, onPointerMoveCapture, onPointerOut, onPointerOutCapture, onPointerOver, onPointerOverCapture, onPointerUp, onPointerUpCapture, onMouseEnter, onMouseLeave, onPointerEnter, onPointerLeave, ...props }: Omit<ElementProps, \"onSelect\" | \"onClick\" | \"onClickCapture\"> & { onClick?: React.MouseEventHandler<HTMLElement>; onClickCapture?: React.MouseEventHandler<HTMLElement>; children?: React.ReactNode; label?: string; selectedValue?: string | null; defaultSelectedValue?: string | null; selectedCategoryValue?: string | null; defaultSelectedCategoryValue?: string | null; openCategories?: readonly string[]; defaultOpenCategories?: readonly string[]; open?: boolean; defaultOpen?: boolean; collapsed?: boolean; defaultCollapsed?: boolean; collapsible?: boolean; multiple?: boolean; density?: \"small\" | \"medium\" | \"large\"; tabbable?: boolean | \"true\" | \"false\"; openLabel?: string; closeLabel?: string; onItemSelect?: (value: string, href: string | null, label: string) => void; onCategoryToggle?: (value: string, open: boolean, openCategories: string[]) => void; onNavItemSelect?: (event: SharePointUIEvent, data: NavReactItemSelectData) => void; onNavCategoryItemToggle?: (event: SharePointUIEvent, data: NavReactCategoryToggleData) => void; onOpenChange?: (open: boolean) => void; onCollapsedChange?: (collapsed: boolean) => void }",
|
|
5034
|
+
"reactSignature": "{ children, label = \"Navigation\", selectedValue, defaultSelectedValue, selectedCategoryValue, defaultSelectedCategoryValue, openCategories, defaultOpenCategories = [], open, defaultOpen, collapsed, defaultCollapsed, fullWidth = false, collapsible = false, multiple = true, density = \"medium\", openLabel, closeLabel, onItemSelect, onCategoryToggle, onNavItemSelect, onNavCategoryItemToggle, onOpenChange, onCollapsedChange, onClick, onClickCapture, onKeyDown, onKeyDownCapture, onKeyUp, onKeyUpCapture, onKeyPress, onKeyPressCapture, onFocus, onFocusCapture, onBlur, onBlurCapture, onAuxClick, onAuxClickCapture, onContextMenu, onContextMenuCapture, onDoubleClick, onDoubleClickCapture, onMouseDown, onMouseDownCapture, onMouseMove, onMouseMoveCapture, onMouseOut, onMouseOutCapture, onMouseOver, onMouseOverCapture, onMouseUp, onMouseUpCapture, onGotPointerCapture, onGotPointerCaptureCapture, onLostPointerCapture, onLostPointerCaptureCapture, onPointerCancel, onPointerCancelCapture, onPointerDown, onPointerDownCapture, onPointerMove, onPointerMoveCapture, onPointerOut, onPointerOutCapture, onPointerOver, onPointerOverCapture, onPointerUp, onPointerUpCapture, onMouseEnter, onMouseLeave, onPointerEnter, onPointerLeave, ...props }: Omit<ElementProps, \"onSelect\" | \"onClick\" | \"onClickCapture\"> & { onClick?: React.MouseEventHandler<HTMLElement>; onClickCapture?: React.MouseEventHandler<HTMLElement>; children?: React.ReactNode; label?: string; selectedValue?: string | null; defaultSelectedValue?: string | null; selectedCategoryValue?: string | null; defaultSelectedCategoryValue?: string | null; openCategories?: readonly string[]; defaultOpenCategories?: readonly string[]; open?: boolean; defaultOpen?: boolean; collapsed?: boolean; defaultCollapsed?: boolean; fullWidth?: boolean; collapsible?: boolean; multiple?: boolean; density?: \"small\" | \"medium\" | \"large\"; tabbable?: boolean | \"true\" | \"false\"; openLabel?: string; closeLabel?: string; onItemSelect?: (value: string, href: string | null, label: string) => void; onCategoryToggle?: (value: string, open: boolean, openCategories: string[]) => void; onNavItemSelect?: (event: SharePointUIEvent, data: NavReactItemSelectData) => void; onNavCategoryItemToggle?: (event: SharePointUIEvent, data: NavReactCategoryToggleData) => void; onOpenChange?: (open: boolean) => void; onCollapsedChange?: (collapsed: boolean) => void }",
|
|
4900
5035
|
"callbackProps": [
|
|
4901
5036
|
"onItemSelect",
|
|
4902
5037
|
"onCategoryToggle",
|
|
@@ -5398,7 +5533,7 @@
|
|
|
5398
5533
|
"host className/style",
|
|
5399
5534
|
"named ::part hooks"
|
|
5400
5535
|
],
|
|
5401
|
-
"reactSignature": "{ children, label, appearance, slot = \"navigation\", ...props }: ElementProps & { children?: React.ReactNode; label?: string; appearance?: \"brand\"; slot?: string }",
|
|
5536
|
+
"reactSignature": "{ children, label, appearance, slot = \"navigation\", ...props }: ElementProps & { children?: React.ReactNode; label?: string; appearance?: \"brand\" | \"thumbnails\"; slot?: string }",
|
|
5402
5537
|
"slots": [
|
|
5403
5538
|
"navigation buttons"
|
|
5404
5539
|
],
|
|
@@ -5407,11 +5542,11 @@
|
|
|
5407
5542
|
"react": "CarouselNav",
|
|
5408
5543
|
"tag": "spui-carousel-nav",
|
|
5409
5544
|
"define": "defineCarouselNav",
|
|
5410
|
-
"signature": "{ children, label, appearance, ...props }: ElementProps & { children?: React.ReactNode; label?: string; appearance?: \"brand\" }",
|
|
5545
|
+
"signature": "{ children, label, appearance, ...props }: ElementProps & { children?: React.ReactNode; label?: string; appearance?: \"brand\" | \"thumbnails\" }",
|
|
5411
5546
|
"slots": [
|
|
5412
5547
|
"navigation buttons"
|
|
5413
5548
|
],
|
|
5414
|
-
"summary": "Group carousel position buttons with RTL-aware roving keyboard focus."
|
|
5549
|
+
"summary": "Group carousel position buttons with RTL-aware roving keyboard focus; use the scrollable thumbnails appearance with image buttons for gallery navigation."
|
|
5415
5550
|
},
|
|
5416
5551
|
{
|
|
5417
5552
|
"module": "carousel",
|
|
@@ -5422,7 +5557,8 @@
|
|
|
5422
5557
|
"SharePointUIProvider tokens",
|
|
5423
5558
|
"CSS custom properties",
|
|
5424
5559
|
"host className/style",
|
|
5425
|
-
"named ::part hooks"
|
|
5560
|
+
"named ::part hooks",
|
|
5561
|
+
"appearance: brand or thumbnails"
|
|
5426
5562
|
],
|
|
5427
5563
|
"reactSignature": "{ children, index, label, selected = false, disabled = false, ...props }: ElementProps & { children?: React.ReactNode; index: number; label?: string; selected?: boolean; disabled?: boolean }",
|
|
5428
5564
|
"slots": [
|
|
@@ -5806,8 +5942,12 @@
|
|
|
5806
5942
|
}
|
|
5807
5943
|
],
|
|
5808
5944
|
"agentContract": {
|
|
5945
|
+
"composition": "Import named components from @spfx-fast/sharepoint-ui/react. Put one SharePointUIProvider around the view. Compose with children by default; use only the slots and component props listed for that component.",
|
|
5809
5946
|
"reactProps": "Each component entry exposes its React parameter signature; callback props describe emitted value/state changes.",
|
|
5947
|
+
"state": "State props, initial default props, callback names, and callback arguments vary by component. Follow that component's signature and callbackProps; update controlled state in its callback.",
|
|
5810
5948
|
"slots": "Use the listed slots for content. Prefer ViewCard over custom markup for common SharePoint records.",
|
|
5949
|
+
"customElements": "Import the component's define function from @spfx-fast/sharepoint-ui/elements/{module} and register it once. Set objects and callbacks as DOM properties. For event names and statically visible detail keys, use the source module's event inventory at https://vystartasv.github.io/sharepoint-ui/agents/events/{module}.json; it is module-scoped, so check event.target when composed tags emit events.",
|
|
5950
|
+
"styling": "Theme, typography, locale, and direction inherit from SharePointUIProvider. Style the host with tokens, documented CSS variables, or ::part hooks; do not target shadow-DOM internals.",
|
|
5811
5951
|
"localization": "Set lang and dir from the host language. SPFx uses pageContext.cultureInfo.currentUICultureName and isRightToLeft. Supply SharePointUIProvider strings for built-in control labels.",
|
|
5812
5952
|
"theme": "Call applySharePointTheme at the SPFx web-part boundary; it forwards SharePoint palette, semantic colors, effects, spacing, font ramps, and default font styles as --spui-* variables. React can use SharePointUIProvider appearance and density (compact, comfortable, touch), theme.brandColor for derived accent/state roles, fluentTokens for raw Fluent variables, theme for typed semantic/design roles, and tokens for direct --spui-* overrides. Nested providers merge semantic groups and inherit density. Explicit theme roles override generated brand roles; direct tokens and element inline styles override these. Hex brand colors derive an AA-aware black-or-white on-accent foreground; set colors.accentForeground for other CSS color formats. CSS custom properties and ::part hooks remain public styling surfaces.",
|
|
5813
5953
|
"persistence": "Keep SharePoint reads and writes in the web part or its service; controls expose values and do not persist data.",
|