@spfx-fast/sharepoint-ui 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/QUICKSTART.md +13 -128
- package/README.md +19 -26
- package/components.json +240 -5834
- package/dist/accordion.d.ts +11 -0
- package/dist/accordion.js +4 -0
- package/dist/alert.d.ts +3 -0
- package/dist/alert.js +4 -0
- package/dist/attachment-list.d.ts +15 -0
- package/dist/attachment-list.js +14 -0
- package/dist/avatar-group.d.ts +12 -0
- package/dist/avatar-group.js +7 -0
- package/dist/avatar.d.ts +6 -0
- package/dist/avatar.js +5 -0
- package/dist/badge.d.ts +3 -0
- package/dist/badge.js +4 -0
- package/dist/breadcrumb.d.ts +10 -0
- package/dist/breadcrumb.js +9 -0
- package/dist/button-group.d.ts +6 -0
- package/dist/button-group.js +4 -0
- package/dist/button.d.ts +3 -0
- package/dist/button.js +4 -0
- package/dist/card.d.ts +3 -0
- package/dist/card.js +4 -0
- package/dist/carousel.d.ts +11 -0
- package/dist/carousel.js +6 -0
- package/dist/checkbox.d.ts +3 -0
- package/dist/checkbox.js +4 -0
- package/dist/combobox.d.ts +9 -0
- package/dist/combobox.js +6 -0
- package/dist/command-bar.d.ts +6 -0
- package/dist/command-bar.js +4 -0
- package/dist/copy-button.d.ts +7 -0
- package/dist/copy-button.js +19 -0
- package/dist/data-grid.d.ts +25 -0
- package/dist/data-grid.js +39 -0
- package/dist/date-range-picker.d.ts +12 -0
- package/dist/date-range-picker.js +4 -0
- package/dist/dialog.d.ts +9 -0
- package/dist/dialog.js +21 -0
- package/dist/divider.d.ts +3 -0
- package/dist/divider.js +4 -0
- package/dist/drawer.d.ts +6 -0
- package/dist/drawer.js +5 -0
- package/dist/empty-state.d.ts +7 -0
- package/dist/empty-state.js +5 -0
- package/dist/field.d.ts +15 -0
- package/dist/field.js +11 -0
- package/dist/file-dropzone.d.ts +15 -0
- package/dist/file-dropzone.js +21 -0
- package/dist/filter-bar.d.ts +9 -0
- package/dist/filter-bar.js +9 -0
- package/dist/image.d.ts +5 -0
- package/dist/image.js +4 -0
- package/dist/index.d.ts +68 -78
- package/dist/index.js +60 -68
- package/dist/input.d.ts +3 -0
- package/dist/input.js +4 -0
- package/dist/label.d.ts +3 -0
- package/dist/label.js +4 -0
- package/dist/link.d.ts +3 -0
- package/dist/link.js +9 -0
- package/dist/list-view.d.ts +29 -0
- package/dist/list-view.js +14 -0
- package/dist/list.d.ts +6 -0
- package/dist/list.js +5 -0
- package/dist/lookup-picker.d.ts +12 -0
- package/dist/lookup-picker.js +4 -0
- package/dist/menu.d.ts +6 -0
- package/dist/menu.js +4 -0
- package/dist/nav.d.ts +12 -0
- package/dist/nav.js +4 -0
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.js +5 -0
- package/dist/person-picker.d.ts +13 -0
- package/dist/person-picker.js +4 -0
- package/dist/persona.d.ts +7 -0
- package/dist/persona.js +5 -0
- package/dist/popover.d.ts +6 -0
- package/dist/popover.js +4 -0
- package/dist/progress-bar.d.ts +5 -0
- package/dist/progress-bar.js +5 -0
- package/dist/radio-group.d.ts +6 -0
- package/dist/radio-group.js +4 -0
- package/dist/radio.d.ts +3 -0
- package/dist/radio.js +4 -0
- package/dist/rating.d.ts +8 -0
- package/dist/rating.js +5 -0
- package/dist/react.d.ts +1 -4715
- package/dist/react.js +1 -7097
- package/dist/select.d.ts +3 -0
- package/dist/select.js +4 -0
- package/dist/sharepoint-field.d.ts +18 -0
- package/dist/sharepoint-field.js +54 -0
- package/dist/skeleton.d.ts +6 -0
- package/dist/skeleton.js +9 -0
- package/dist/spinner.d.ts +5 -0
- package/dist/spinner.js +4 -0
- package/dist/swatch-picker.d.ts +17 -0
- package/dist/swatch-picker.js +11 -0
- package/dist/switch.d.ts +3 -0
- package/dist/switch.js +4 -0
- package/dist/table.d.ts +6 -0
- package/dist/table.js +4 -0
- package/dist/tabs.d.ts +14 -0
- package/dist/tabs.js +30 -0
- package/dist/tag-group.d.ts +6 -0
- package/dist/tag-group.js +4 -0
- package/dist/tag-picker.d.ts +12 -0
- package/dist/tag-picker.js +4 -0
- package/dist/tag.d.ts +7 -0
- package/dist/tag.js +5 -0
- package/dist/text.d.ts +5 -0
- package/dist/text.js +4 -0
- package/dist/textarea.d.ts +3 -0
- package/dist/textarea.js +4 -0
- package/dist/theme.d.ts +15 -175
- package/dist/theme.js +36 -239
- package/dist/toast.d.ts +9 -0
- package/dist/toast.js +12 -0
- package/dist/tree.d.ts +13 -0
- package/dist/tree.js +9 -0
- package/dist/view-card.d.ts +8 -0
- package/dist/view-card.js +4 -0
- package/dist/view-switcher.d.ts +13 -0
- package/dist/view-switcher.js +7 -0
- package/dist/virtual-list.d.ts +11 -0
- package/dist/virtual-list.js +25 -0
- package/measurements.json +365 -0
- package/package.json +14 -46
- package/src/theme.css +125 -0
- package/AGENTS.md +0 -231
- package/dist/appearance.d.ts +0 -6
- package/dist/appearance.js +0 -217
- package/dist/elements/accordion.d.ts +0 -9
- package/dist/elements/accordion.js +0 -338
- package/dist/elements/alert.d.ts +0 -2
- package/dist/elements/alert.js +0 -86
- package/dist/elements/avatar-group-primitives.d.ts +0 -3
- package/dist/elements/avatar-group-primitives.js +0 -189
- package/dist/elements/avatar-group.d.ts +0 -2
- package/dist/elements/avatar-group.js +0 -110
- package/dist/elements/avatar.d.ts +0 -4
- package/dist/elements/avatar.js +0 -251
- package/dist/elements/badge.d.ts +0 -8
- package/dist/elements/badge.js +0 -182
- package/dist/elements/breadcrumb.d.ts +0 -4
- package/dist/elements/breadcrumb.js +0 -233
- package/dist/elements/button-group.d.ts +0 -1
- package/dist/elements/button-group.js +0 -20
- package/dist/elements/button-variants.d.ts +0 -6
- package/dist/elements/button-variants.js +0 -339
- package/dist/elements/button.d.ts +0 -5
- package/dist/elements/button.js +0 -233
- package/dist/elements/card-primitives.d.ts +0 -3
- package/dist/elements/card-primitives.js +0 -83
- package/dist/elements/card.d.ts +0 -5
- package/dist/elements/card.js +0 -213
- package/dist/elements/carousel.d.ts +0 -92
- package/dist/elements/carousel.js +0 -1115
- package/dist/elements/color-picker.d.ts +0 -24
- package/dist/elements/color-picker.js +0 -1004
- package/dist/elements/combobox.d.ts +0 -1
- package/dist/elements/combobox.js +0 -1012
- package/dist/elements/data-grid-model.d.ts +0 -120
- package/dist/elements/data-grid-model.js +0 -294
- package/dist/elements/data-grid.d.ts +0 -30
- package/dist/elements/data-grid.js +0 -1576
- package/dist/elements/date-picker.d.ts +0 -1
- package/dist/elements/date-picker.js +0 -486
- package/dist/elements/dialog.d.ts +0 -23
- package/dist/elements/dialog.js +0 -409
- package/dist/elements/divider.d.ts +0 -2
- package/dist/elements/divider.js +0 -66
- package/dist/elements/drawer.d.ts +0 -3
- package/dist/elements/drawer.js +0 -308
- package/dist/elements/field-composition.d.ts +0 -26
- package/dist/elements/field-composition.js +0 -133
- package/dist/elements/field.d.ts +0 -1
- package/dist/elements/field.js +0 -67
- package/dist/elements/file-upload.d.ts +0 -6
- package/dist/elements/file-upload.js +0 -211
- package/dist/elements/floating-position.d.ts +0 -36
- package/dist/elements/floating-position.js +0 -92
- package/dist/elements/image.d.ts +0 -28
- package/dist/elements/image.js +0 -38
- package/dist/elements/info.d.ts +0 -9
- package/dist/elements/info.js +0 -102
- package/dist/elements/input.d.ts +0 -5
- package/dist/elements/input.js +0 -255
- package/dist/elements/label.d.ts +0 -15
- package/dist/elements/label.js +0 -56
- package/dist/elements/link.d.ts +0 -1
- package/dist/elements/link.js +0 -92
- package/dist/elements/list.d.ts +0 -19
- package/dist/elements/list.js +0 -297
- package/dist/elements/menu.d.ts +0 -33
- package/dist/elements/menu.js +0 -1103
- package/dist/elements/message-bar.d.ts +0 -10
- package/dist/elements/message-bar.js +0 -327
- package/dist/elements/nav.d.ts +0 -32
- package/dist/elements/nav.js +0 -794
- package/dist/elements/overflow.d.ts +0 -10
- package/dist/elements/overflow.js +0 -218
- package/dist/elements/persona.d.ts +0 -3
- package/dist/elements/persona.js +0 -125
- package/dist/elements/popover.d.ts +0 -77
- package/dist/elements/popover.js +0 -840
- package/dist/elements/progress-bar.d.ts +0 -4
- package/dist/elements/progress-bar.js +0 -82
- package/dist/elements/radio-group.d.ts +0 -1
- package/dist/elements/radio-group.js +0 -303
- package/dist/elements/rating-display.d.ts +0 -2
- package/dist/elements/rating-display.js +0 -125
- package/dist/elements/rating.d.ts +0 -2
- package/dist/elements/rating.js +0 -206
- package/dist/elements/rich-text-editor.d.ts +0 -32
- package/dist/elements/rich-text-editor.js +0 -1367
- package/dist/elements/search.d.ts +0 -3
- package/dist/elements/search.js +0 -200
- package/dist/elements/select.d.ts +0 -6
- package/dist/elements/select.js +0 -291
- package/dist/elements/shared.d.ts +0 -22
- package/dist/elements/shared.js +0 -409
- package/dist/elements/sharepoint-field-basic-controls.d.ts +0 -1
- package/dist/elements/sharepoint-field-basic-controls.js +0 -14
- package/dist/elements/sharepoint-fields.d.ts +0 -29
- package/dist/elements/sharepoint-fields.js +0 -460
- package/dist/elements/skeleton.d.ts +0 -6
- package/dist/elements/skeleton.js +0 -91
- package/dist/elements/slider.d.ts +0 -1
- package/dist/elements/slider.js +0 -248
- package/dist/elements/spin-button.d.ts +0 -7
- package/dist/elements/spin-button.js +0 -499
- package/dist/elements/spinner.d.ts +0 -4
- package/dist/elements/spinner.js +0 -124
- package/dist/elements/swatch-picker.d.ts +0 -5
- package/dist/elements/swatch-picker.js +0 -363
- package/dist/elements/table.d.ts +0 -21
- package/dist/elements/table.js +0 -261
- package/dist/elements/tabs.d.ts +0 -1
- package/dist/elements/tabs.js +0 -276
- package/dist/elements/tag-picker.d.ts +0 -29
- package/dist/elements/tag-picker.js +0 -715
- package/dist/elements/tags.d.ts +0 -21
- package/dist/elements/tags.js +0 -421
- package/dist/elements/teaching-popover.d.ts +0 -32
- package/dist/elements/teaching-popover.js +0 -412
- package/dist/elements/text.d.ts +0 -9
- package/dist/elements/text.js +0 -75
- package/dist/elements/textarea.d.ts +0 -1
- package/dist/elements/textarea.js +0 -182
- package/dist/elements/toast.d.ts +0 -25
- package/dist/elements/toast.js +0 -337
- package/dist/elements/toaster.d.ts +0 -6
- package/dist/elements/toaster.js +0 -357
- package/dist/elements/toggle.d.ts +0 -2
- package/dist/elements/toggle.js +0 -246
- package/dist/elements/toolbar.d.ts +0 -12
- package/dist/elements/toolbar.js +0 -381
- package/dist/elements/tooltip.d.ts +0 -76
- package/dist/elements/tooltip.js +0 -527
- package/dist/elements/tree-model.d.ts +0 -19
- package/dist/elements/tree-model.js +0 -34
- package/dist/elements/tree.d.ts +0 -5
- package/dist/elements/tree.js +0 -273
- package/dist/elements/view-card.d.ts +0 -2
- package/dist/elements/view-card.js +0 -78
- package/dist/elements/virtual-list.d.ts +0 -41
- package/dist/elements/virtual-list.js +0 -369
- package/dist/elements.d.ts +0 -73
- package/dist/elements.js +0 -210
- package/dist/sharepoint-fields.d.ts +0 -135
- package/dist/sharepoint-fields.js +0 -402
- package/dist/virtualizer-hooks.d.ts +0 -80
- package/dist/virtualizer-hooks.js +0 -253
- package/scripts/generate-token-index.mjs +0 -43
- package/scripts/sync-component-catalog-signatures.mjs +0 -55
- package/scripts/validate-component-catalog.mjs +0 -44
- package/skills/sharepoint-ui/SKILL.md +0 -12
- package/skills/sharepoint-ui/references/choosing-components.md +0 -20
- package/skills/sharepoint-ui/references/sharepoint-patterns.md +0 -17
- package/tokens.json +0 -3777
package/dist/elements/tags.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type TagAppearance = "filled" | "outline" | "brand";
|
|
2
|
-
export type TagShape = "rounded" | "circular";
|
|
3
|
-
export type TagSize = "extra-small" | "small" | "medium";
|
|
4
|
-
export type InteractionTagSelectData = {
|
|
5
|
-
value: string;
|
|
6
|
-
selected: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type TagGroupSelectData = {
|
|
9
|
-
event: Event;
|
|
10
|
-
type: "click";
|
|
11
|
-
value: string;
|
|
12
|
-
selectedValues: string[];
|
|
13
|
-
};
|
|
14
|
-
export interface SharePointTagGroupElement extends HTMLElement {
|
|
15
|
-
selectedValues: string[];
|
|
16
|
-
}
|
|
17
|
-
export declare function defineTag(): void;
|
|
18
|
-
export declare function defineTagGroup(): void;
|
|
19
|
-
export declare function defineInteractionTagPrimary(): void;
|
|
20
|
-
export declare function defineInteractionTagSecondary(): void;
|
|
21
|
-
export declare function defineInteractionTag(): void;
|
package/dist/elements/tags.js
DELETED
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import { base } from "./shared.js";
|
|
2
|
-
export function defineTag() {
|
|
3
|
-
if (customElements.get("spui-tag"))
|
|
4
|
-
return;
|
|
5
|
-
class SpuiTag extends HTMLElement {
|
|
6
|
-
static observedAttributes = ["dismissible", "dismiss-label", "label", "disabled", "selected"];
|
|
7
|
-
connectedCallback() {
|
|
8
|
-
if (!this.shadowRoot)
|
|
9
|
-
this.render();
|
|
10
|
-
this.updateDismissButton();
|
|
11
|
-
}
|
|
12
|
-
attributeChangedCallback() { if (this.isConnected)
|
|
13
|
-
this.updateDismissButton(); }
|
|
14
|
-
updateDismissButton() {
|
|
15
|
-
const root = this.shadowRoot;
|
|
16
|
-
if (!root)
|
|
17
|
-
return;
|
|
18
|
-
let button = root.querySelector("button");
|
|
19
|
-
if (!this.hasAttribute("dismissible")) {
|
|
20
|
-
button?.remove();
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (!button) {
|
|
24
|
-
button = document.createElement("button");
|
|
25
|
-
button.type = "button";
|
|
26
|
-
button.className = "dismiss";
|
|
27
|
-
button.addEventListener("click", event => this.dispatchEvent(new CustomEvent("spui-dismiss", { detail: { value: this.getAttribute("value") ?? "", label: this.getAttribute("label") ?? this.textContent?.trim() ?? "", originalEvent: event }, bubbles: true, composed: true })));
|
|
28
|
-
const icon = document.createElement("slot");
|
|
29
|
-
icon.name = "dismiss-icon";
|
|
30
|
-
const fallback = document.createElement("span");
|
|
31
|
-
fallback.setAttribute("aria-hidden", "true");
|
|
32
|
-
fallback.textContent = "×";
|
|
33
|
-
icon.append(fallback);
|
|
34
|
-
button.append(icon);
|
|
35
|
-
root.append(button);
|
|
36
|
-
}
|
|
37
|
-
button.disabled = this.hasAttribute("disabled");
|
|
38
|
-
const primary = root.querySelector(".primary-text");
|
|
39
|
-
const primaryText = primary?.assignedNodes({ flatten: true }).map(node => node.textContent ?? "").join("").trim();
|
|
40
|
-
button.setAttribute("aria-label", `${this.getAttribute("dismiss-label") || "Remove"} ${this.getAttribute("label") || primaryText || this.textContent?.trim() || "tag"}`);
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
const shadow = this.attachShadow({ mode: "open" });
|
|
44
|
-
const style = document.createElement("style");
|
|
45
|
-
style.textContent = `${base}:host{box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;max-width:100%;border:1px solid var(--spui-tag-border,var(--spui-base-stroke,var(--spui-ui-stroke,var(--spui-semantic-control-border,#8a8886))));border-radius:var(--spui-control-radius,4px);background:var(--spui-tag-background,color-mix(in srgb,var(--spui-base-accent,var(--spui-ui-accent,#0078d4)) 30%,var(--spui-base-surface,var(--spui-ui-surface,#fff))));color:var(--spui-tag-color,var(--spui-ui-text,var(--spui-semantic-body-text,#323130)));font-size:var(--spui-tag-font-size,13px);font-weight:500;line-height:1.25;white-space:nowrap}:host([size=extra-small]){min-height:18px;padding-block:1px;padding-inline:6px;font-size:10px}:host([size=small]){min-height:22px;padding-block:2px;padding-inline:7px;font-size:11px}:host(:not([size]),[size=medium]){min-height:28px;padding-block:4px;padding-inline:9px}:host([size=large]){min-height:34px;padding-block:6px;padding-inline:12px;font-size:14px}:host([shape=circular]){border-radius:999px}:host([appearance=outline]){background:var(--spui-base-surface,var(--spui-ui-surface,#fff))}:host([appearance=brand]){border-color:color-mix(in srgb,var(--spui-ui-accent,var(--spui-semantic-accent,#0078d4)) 64%,var(--spui-base-surface,var(--spui-ui-surface,#fff)));background:color-mix(in srgb,var(--spui-ui-accent,var(--spui-semantic-accent,#0078d4)) 42%,var(--spui-base-surface,var(--spui-ui-surface,#fff)))}:host([selected]){border-color:var(--spui-ui-accent,var(--spui-semantic-accent,#0078d4));background:color-mix(in srgb,var(--spui-ui-accent,var(--spui-semantic-accent,#0078d4)) 16%,var(--spui-ui-surface,#fff))}:host([disabled]){opacity:.55}.media,.icon{display:inline-flex;align-items:center;justify-content:center;flex:none}.text{display:grid;gap:2px;min-width:0}.label{min-width:0;overflow:hidden;text-overflow:ellipsis}.secondary{overflow:hidden;color:var(--spui-ui-muted,var(--spui-semantic-body-subtext,#616161));font-size:.9em;text-overflow:ellipsis}.dismiss{display:inline-grid;place-items:center;flex:none;width:20px;height:20px;margin-inline-end:-5px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;font-size:17px;line-height:1;cursor:pointer}.dismiss:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.dismiss:focus-visible{outline:2px solid var(--spui-focus-ring,var(--spui-ui-accent,#0078d4));outline-offset:1px}.dismiss:disabled{cursor:not-allowed}.media[hidden],.icon[hidden],.secondary[hidden]{display:none}@media(forced-colors:active){:host{border-color:CanvasText}:host([selected]){outline:1px solid Highlight}.dismiss:focus-visible{outline-color:Highlight}}`;
|
|
46
|
-
style.textContent += `:host([color=success]){--spui-tag-tone:var(--spui-ui-success,#107c10)}:host([color=warning]){--spui-tag-tone:var(--spui-ui-warning,#835b00)}:host([color=danger]){--spui-tag-tone:var(--spui-ui-danger,#b10e1c)}:host([color=informative]){--spui-tag-tone:var(--spui-ui-info,var(--spui-ui-accent,#0078d4))}:host([color=success]),:host([color=warning]),:host([color=danger]),:host([color=informative]){--spui-tag-foreground:color-mix(in srgb,var(--spui-tag-tone) 40%,var(--spui-ui-text,#242424) 60%);color:var(--spui-tag-foreground);border-color:var(--spui-tag-foreground)}:host([color=success]:not([appearance=outline]):not([selected])),:host([color=warning]:not([appearance=outline]):not([selected])),:host([color=danger]:not([appearance=outline]):not([selected])),:host([color=informative]:not([appearance=outline]):not([selected])){background:color-mix(in srgb,var(--spui-tag-tone) 12%,var(--spui-base-surface,var(--spui-ui-surface,#fff)))}:host([color=success][appearance=brand]:not([selected])),:host([color=warning][appearance=brand]:not([selected])),:host([color=danger][appearance=brand]:not([selected])),:host([color=informative][appearance=brand]:not([selected])){background:color-mix(in srgb,var(--spui-tag-tone) 24%,var(--spui-base-surface,var(--spui-ui-surface,#fff)))}`;
|
|
47
|
-
style.textContent += `:host([selected][color=success]),:host([selected][color=warning]),:host([selected][color=danger]),:host([selected][color=informative]){color:var(--spui-selection-foreground,var(--spui-ui-text,#242424));border-color:var(--spui-selection-foreground,var(--spui-ui-text,#242424))}@media(forced-colors:active){:host([color=success]),:host([color=warning]),:host([color=danger]),:host([color=informative]){color:CanvasText;border-color:CanvasText;background:Canvas}:host([selected][color=success]),:host([selected][color=warning]),:host([selected][color=danger]),:host([selected][color=informative]){outline:1px solid Highlight}}`;
|
|
48
|
-
const media = document.createElement("span");
|
|
49
|
-
media.className = "media";
|
|
50
|
-
media.hidden = true;
|
|
51
|
-
const mediaSlot = document.createElement("slot");
|
|
52
|
-
mediaSlot.name = "media";
|
|
53
|
-
media.append(mediaSlot);
|
|
54
|
-
const icon = document.createElement("span");
|
|
55
|
-
icon.className = "icon";
|
|
56
|
-
icon.hidden = true;
|
|
57
|
-
const iconSlot = document.createElement("slot");
|
|
58
|
-
iconSlot.name = "icon";
|
|
59
|
-
icon.append(iconSlot);
|
|
60
|
-
const text = document.createElement("span");
|
|
61
|
-
text.className = "text";
|
|
62
|
-
const label = document.createElement("span");
|
|
63
|
-
label.className = "label";
|
|
64
|
-
label.part.add("label");
|
|
65
|
-
const primarySlot = document.createElement("slot");
|
|
66
|
-
primarySlot.name = "primary-text";
|
|
67
|
-
const defaultSlot = document.createElement("slot");
|
|
68
|
-
label.append(primarySlot);
|
|
69
|
-
primarySlot.append(defaultSlot);
|
|
70
|
-
const secondary = document.createElement("span");
|
|
71
|
-
secondary.className = "secondary";
|
|
72
|
-
secondary.hidden = true;
|
|
73
|
-
secondary.part.add("secondary-text");
|
|
74
|
-
const secondarySlot = document.createElement("slot");
|
|
75
|
-
secondarySlot.name = "secondary-text";
|
|
76
|
-
secondary.append(secondarySlot);
|
|
77
|
-
text.append(label, secondary);
|
|
78
|
-
for (const [slot, container] of [[mediaSlot, media], [iconSlot, icon], [secondarySlot, secondary]]) {
|
|
79
|
-
slot.addEventListener("slotchange", () => { container.hidden = !slot.assignedNodes({ flatten: true }).length; this.updateDismissButton(); });
|
|
80
|
-
}
|
|
81
|
-
primarySlot.addEventListener("slotchange", () => this.updateDismissButton());
|
|
82
|
-
defaultSlot.addEventListener("slotchange", () => this.updateDismissButton());
|
|
83
|
-
shadow.append(style, media, icon, text);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
customElements.define("spui-tag", SpuiTag);
|
|
87
|
-
}
|
|
88
|
-
export function defineTagGroup() {
|
|
89
|
-
if (customElements.get("spui-tag-group"))
|
|
90
|
-
return;
|
|
91
|
-
class SpuiTagGroup extends HTMLElement {
|
|
92
|
-
static observedAttributes = ["orientation", "label", "selected-values", "default-selected-values", "disabled", "dismissible", "appearance", "size", "role"];
|
|
93
|
-
observer;
|
|
94
|
-
values = [];
|
|
95
|
-
controlled = false;
|
|
96
|
-
initialized = false;
|
|
97
|
-
syncing = false;
|
|
98
|
-
childBase = new WeakMap();
|
|
99
|
-
childApplied = new WeakMap();
|
|
100
|
-
get selectedValues() { return [...this.values]; }
|
|
101
|
-
set selectedValues(value) {
|
|
102
|
-
this.controlled = true;
|
|
103
|
-
this.values = Array.isArray(value) ? value.map(String) : [];
|
|
104
|
-
this.initialized = true;
|
|
105
|
-
this.sync();
|
|
106
|
-
}
|
|
107
|
-
connectedCallback() {
|
|
108
|
-
if (!this.shadowRoot)
|
|
109
|
-
this.render();
|
|
110
|
-
if (!this.hasAttribute("role"))
|
|
111
|
-
this.setAttribute("role", "toolbar");
|
|
112
|
-
if (!this.hasAttribute("aria-label") && this.hasAttribute("label"))
|
|
113
|
-
this.setAttribute("aria-label", this.getAttribute("label"));
|
|
114
|
-
if (!this.initialized) {
|
|
115
|
-
const defaults = this.readValues(this.getAttribute("default-selected-values"));
|
|
116
|
-
this.values = this.readValues(this.getAttribute("selected-values") ?? JSON.stringify(defaults));
|
|
117
|
-
this.controlled = this.hasAttribute("selected-values");
|
|
118
|
-
this.initialized = true;
|
|
119
|
-
}
|
|
120
|
-
this.addEventListener("spui-tag-select", this.onTagSelect);
|
|
121
|
-
this.addEventListener("spui-dismiss", this.onTagDismiss);
|
|
122
|
-
this.addEventListener("keydown", this.onKeyDown);
|
|
123
|
-
this.observer?.disconnect();
|
|
124
|
-
this.observer = new MutationObserver(() => this.sync());
|
|
125
|
-
this.observer.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ["disabled", "dismissible", "appearance", "size", "selected", "value"] });
|
|
126
|
-
this.sync();
|
|
127
|
-
}
|
|
128
|
-
disconnectedCallback() {
|
|
129
|
-
this.observer?.disconnect();
|
|
130
|
-
this.removeEventListener("spui-tag-select", this.onTagSelect);
|
|
131
|
-
this.removeEventListener("spui-dismiss", this.onTagDismiss);
|
|
132
|
-
this.removeEventListener("keydown", this.onKeyDown);
|
|
133
|
-
}
|
|
134
|
-
attributeChangedCallback(name) {
|
|
135
|
-
if (!this.isConnected)
|
|
136
|
-
return;
|
|
137
|
-
if (name === "selected-values") {
|
|
138
|
-
this.controlled = this.hasAttribute("selected-values");
|
|
139
|
-
if (this.controlled)
|
|
140
|
-
this.values = this.readValues(this.getAttribute("selected-values"));
|
|
141
|
-
}
|
|
142
|
-
this.sync();
|
|
143
|
-
}
|
|
144
|
-
render() {
|
|
145
|
-
const shadow = this.attachShadow({ mode: "open" });
|
|
146
|
-
const style = document.createElement("style");
|
|
147
|
-
style.textContent = `${base}:host{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spui-tag-group-gap,8px);min-width:0}:host([orientation=vertical]){flex-direction:column;align-items:stretch}:host(:focus-visible){outline:2px solid var(--spui-focus-ring,var(--spui-ui-accent,#0078d4));outline-offset:2px}@media(forced-colors:active){:host(:focus-visible){outline-color:Highlight}}`;
|
|
148
|
-
const slot = document.createElement("slot");
|
|
149
|
-
shadow.append(style, slot);
|
|
150
|
-
}
|
|
151
|
-
readValues(raw) {
|
|
152
|
-
if (!raw)
|
|
153
|
-
return [];
|
|
154
|
-
try {
|
|
155
|
-
const value = JSON.parse(raw);
|
|
156
|
-
return Array.isArray(value) ? value.map(String) : [];
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
return raw.split(",").map(value => value.trim()).filter(Boolean);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
sync() {
|
|
163
|
-
if (!this.isConnected || this.syncing)
|
|
164
|
-
return;
|
|
165
|
-
this.syncing = true;
|
|
166
|
-
try {
|
|
167
|
-
if (this.hasAttribute("label") && !this.hasAttribute("aria-label"))
|
|
168
|
-
this.setAttribute("aria-label", this.getAttribute("label"));
|
|
169
|
-
this.setAttribute("aria-disabled", String(this.hasAttribute("disabled")));
|
|
170
|
-
const children = [...this.querySelectorAll("spui-tag,spui-interaction-tag")].filter(child => child.closest("spui-tag-group") === this);
|
|
171
|
-
const groupDefaults = ["disabled", "dismissible", "appearance", "size"];
|
|
172
|
-
for (const [index, child] of children.entries()) {
|
|
173
|
-
if (!child.hasAttribute("value"))
|
|
174
|
-
child.setAttribute("value", `spui-tag-group-${index + 1}`);
|
|
175
|
-
let baseState = this.childBase.get(child);
|
|
176
|
-
let applied = this.childApplied.get(child);
|
|
177
|
-
if (!baseState) {
|
|
178
|
-
baseState = Object.fromEntries([...groupDefaults, "selected"].map(name => [name, child.getAttribute(name)]));
|
|
179
|
-
this.childBase.set(child, baseState);
|
|
180
|
-
applied = {};
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
for (const name of [...groupDefaults, "selected"])
|
|
184
|
-
if (child.getAttribute(name) !== applied?.[name])
|
|
185
|
-
baseState[name] = child.getAttribute(name);
|
|
186
|
-
}
|
|
187
|
-
const next = {};
|
|
188
|
-
for (const name of groupDefaults) {
|
|
189
|
-
let value = baseState[name] ?? null;
|
|
190
|
-
if (name === "disabled" && this.hasAttribute("disabled"))
|
|
191
|
-
value = "";
|
|
192
|
-
else if (name === "dismissible" && value === null && this.hasAttribute("dismissible"))
|
|
193
|
-
value = "";
|
|
194
|
-
else if (name === "appearance" && value === null)
|
|
195
|
-
value = this.getAttribute("appearance");
|
|
196
|
-
else if (name === "size" && value === null)
|
|
197
|
-
value = this.getAttribute("size");
|
|
198
|
-
next[name] = value;
|
|
199
|
-
}
|
|
200
|
-
const selected = (baseState.selected === "" || this.values.includes(child.getAttribute("value"))) ? "" : null;
|
|
201
|
-
next.selected = selected;
|
|
202
|
-
for (const name of [...groupDefaults, "selected"]) {
|
|
203
|
-
const value = next[name];
|
|
204
|
-
if (value === null) {
|
|
205
|
-
if (child.hasAttribute(name))
|
|
206
|
-
child.removeAttribute(name);
|
|
207
|
-
}
|
|
208
|
-
else if (child.getAttribute(name) !== value)
|
|
209
|
-
child.setAttribute(name, value);
|
|
210
|
-
}
|
|
211
|
-
this.childApplied.set(child, next);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
finally {
|
|
215
|
-
this.syncing = false;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
onTagSelect = (event) => {
|
|
219
|
-
if (this.hasAttribute("disabled") || event.defaultPrevented) {
|
|
220
|
-
event.preventDefault();
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
const value = String(event.detail?.value ?? "");
|
|
224
|
-
const next = this.values.includes(value) ? this.values.filter(item => item !== value) : [...this.values, value];
|
|
225
|
-
if (!this.controlled)
|
|
226
|
-
this.values = next;
|
|
227
|
-
this.sync();
|
|
228
|
-
this.dispatchEvent(new CustomEvent("spui-selection-change", { bubbles: true, composed: true, detail: { event: event.detail?.originalEvent ?? event, type: "click", value, selectedValues: next } }));
|
|
229
|
-
};
|
|
230
|
-
onTagDismiss = (event) => {
|
|
231
|
-
if (this.hasAttribute("disabled")) {
|
|
232
|
-
event.preventDefault();
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
this.dispatchEvent(new CustomEvent("spui-tag-dismiss", { bubbles: true, composed: true, detail: { value: String(event.detail?.value ?? ""), sourceEvent: event.detail?.originalEvent ?? event } }));
|
|
236
|
-
};
|
|
237
|
-
focusableItems() {
|
|
238
|
-
const result = [];
|
|
239
|
-
const visit = (root) => {
|
|
240
|
-
for (const node of root.querySelectorAll("button,a[href],[tabindex]")) {
|
|
241
|
-
if (!node.hasAttribute("disabled") && node.tabIndex >= 0 && node.getClientRects().length)
|
|
242
|
-
result.push(node);
|
|
243
|
-
}
|
|
244
|
-
for (const node of root.querySelectorAll("*")) {
|
|
245
|
-
if (node.shadowRoot)
|
|
246
|
-
visit(node.shadowRoot);
|
|
247
|
-
if (node instanceof HTMLSlotElement)
|
|
248
|
-
for (const assigned of node.assignedElements({ flatten: true }))
|
|
249
|
-
visit(assigned);
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
for (const child of this.querySelectorAll("spui-tag,spui-interaction-tag"))
|
|
253
|
-
if (child.closest("spui-tag-group") === this)
|
|
254
|
-
visit(child.shadowRoot ?? child);
|
|
255
|
-
return [...new Set(result)];
|
|
256
|
-
}
|
|
257
|
-
onKeyDown = (event) => {
|
|
258
|
-
const items = this.focusableItems();
|
|
259
|
-
if (!items.length)
|
|
260
|
-
return;
|
|
261
|
-
const active = event.composedPath().find((node) => node instanceof HTMLElement && items.includes(node));
|
|
262
|
-
const from = active ? items.indexOf(active) : -1;
|
|
263
|
-
let next = -1;
|
|
264
|
-
if (event.key === "Home")
|
|
265
|
-
next = 0;
|
|
266
|
-
else if (event.key === "End")
|
|
267
|
-
next = items.length - 1;
|
|
268
|
-
else if (event.key === "ArrowDown" || event.key === (getComputedStyle(this).direction === "rtl" ? "ArrowLeft" : "ArrowRight"))
|
|
269
|
-
next = (from + 1 + items.length) % items.length;
|
|
270
|
-
else if (event.key === "ArrowUp" || event.key === (getComputedStyle(this).direction === "rtl" ? "ArrowRight" : "ArrowLeft"))
|
|
271
|
-
next = (from - 1 + items.length) % items.length;
|
|
272
|
-
if (next >= 0) {
|
|
273
|
-
event.preventDefault();
|
|
274
|
-
items[next].focus();
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
customElements.define("spui-tag-group", SpuiTagGroup);
|
|
279
|
-
}
|
|
280
|
-
export function defineInteractionTagPrimary() {
|
|
281
|
-
if (customElements.get("spui-interaction-tag-primary"))
|
|
282
|
-
return;
|
|
283
|
-
class SpuiInteractionTagPrimary extends HTMLElement {
|
|
284
|
-
static observedAttributes = ["disabled", "selected", "has-secondary-action", "size"];
|
|
285
|
-
button;
|
|
286
|
-
connectedCallback() { if (!this.shadowRoot)
|
|
287
|
-
this.render(); this.sync(); }
|
|
288
|
-
attributeChangedCallback() { this.sync(); }
|
|
289
|
-
render() {
|
|
290
|
-
const shadow = this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
291
|
-
const style = document.createElement("style");
|
|
292
|
-
style.textContent = `${base}:host{display:inline-flex;min-width:0}button{box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;min-width:0;min-height:28px;padding:4px 10px;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;text-align:start;cursor:pointer}button:hover{background:color-mix(in srgb,currentColor 8%,transparent)}button:focus-visible{position:relative;z-index:1;outline:2px solid var(--spui-focus-ring,var(--spui-ui-accent,var(--spui-semantic-focus-border,var(--colorStrokeFocus2,#0078d4))));outline-offset:1px}:host([disabled]) button{cursor:not-allowed}:host([has-secondary-action]) button{padding-inline-end:4px}:host([size=small]) button{min-height:22px;padding-block:2px}:host([size=extra-small]) button{min-height:18px;padding-block:1px;font-size:12px}.media:empty,.icon:empty,.secondary:empty{display:none}.media,.icon,.secondary{display:inline-flex;align-items:center;flex:none}.text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button[aria-pressed=true]{font-weight:600}@media(forced-colors:active){button:focus-visible{outline-color:Highlight}}`;
|
|
293
|
-
const button = document.createElement("button");
|
|
294
|
-
button.type = "button";
|
|
295
|
-
button.part.add("button");
|
|
296
|
-
const media = document.createElement("span");
|
|
297
|
-
media.className = "media";
|
|
298
|
-
media.append(Object.assign(document.createElement("slot"), { name: "media" }));
|
|
299
|
-
const icon = document.createElement("span");
|
|
300
|
-
icon.className = "icon";
|
|
301
|
-
icon.append(Object.assign(document.createElement("slot"), { name: "icon" }));
|
|
302
|
-
const text = document.createElement("span");
|
|
303
|
-
text.className = "text";
|
|
304
|
-
const primaryText = document.createElement("slot");
|
|
305
|
-
primaryText.name = "primary-text";
|
|
306
|
-
primaryText.append(document.createElement("slot"));
|
|
307
|
-
text.append(primaryText);
|
|
308
|
-
const secondary = document.createElement("span");
|
|
309
|
-
secondary.className = "secondary";
|
|
310
|
-
secondary.append(Object.assign(document.createElement("slot"), { name: "secondary-text" }));
|
|
311
|
-
button.append(media, icon, text, secondary);
|
|
312
|
-
button.addEventListener("click", event => {
|
|
313
|
-
const owner = this.closest("spui-interaction-tag");
|
|
314
|
-
if (owner)
|
|
315
|
-
owner.dispatchEvent(new CustomEvent("spui-tag-select", { bubbles: true, composed: true, cancelable: true, detail: { value: owner.getAttribute("value") ?? "", selected: owner.hasAttribute("selected"), originalEvent: event } }));
|
|
316
|
-
});
|
|
317
|
-
this.button = button;
|
|
318
|
-
shadow.append(style, button);
|
|
319
|
-
}
|
|
320
|
-
sync() {
|
|
321
|
-
if (!this.button)
|
|
322
|
-
return;
|
|
323
|
-
this.button.disabled = this.hasAttribute("disabled");
|
|
324
|
-
if (this.hasAttribute("selected"))
|
|
325
|
-
this.button.setAttribute("aria-pressed", String(this.getAttribute("selected") !== "false"));
|
|
326
|
-
else
|
|
327
|
-
this.button.removeAttribute("aria-pressed");
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
customElements.define("spui-interaction-tag-primary", SpuiInteractionTagPrimary);
|
|
331
|
-
}
|
|
332
|
-
export function defineInteractionTagSecondary() {
|
|
333
|
-
if (customElements.get("spui-interaction-tag-secondary"))
|
|
334
|
-
return;
|
|
335
|
-
class SpuiInteractionTagSecondary extends HTMLElement {
|
|
336
|
-
static observedAttributes = ["disabled", "label", "remove-label"];
|
|
337
|
-
button;
|
|
338
|
-
connectedCallback() { if (!this.shadowRoot)
|
|
339
|
-
this.render(); this.sync(); }
|
|
340
|
-
attributeChangedCallback() { this.sync(); }
|
|
341
|
-
render() {
|
|
342
|
-
const shadow = this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
343
|
-
const style = document.createElement("style");
|
|
344
|
-
style.textContent = `${base}:host{display:inline-flex;flex:none}button{display:grid;place-items:center;width:26px;min-height:28px;padding:0;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;cursor:pointer}button:hover{background:color-mix(in srgb,currentColor 10%,transparent)}button:focus-visible{position:relative;z-index:1;outline:2px solid var(--spui-focus-ring,var(--spui-ui-accent,var(--spui-semantic-focus-border,var(--colorStrokeFocus2,#0078d4))));outline-offset:1px}:host([disabled]) button{cursor:not-allowed}.mark{font-size:17px;line-height:1}@media(forced-colors:active){button:focus-visible{outline-color:Highlight}}`;
|
|
345
|
-
const button = document.createElement("button");
|
|
346
|
-
button.type = "button";
|
|
347
|
-
button.part.add("button");
|
|
348
|
-
button.innerHTML = '<span class="mark" aria-hidden="true">×</span><slot></slot>';
|
|
349
|
-
button.addEventListener("click", event => {
|
|
350
|
-
const owner = this.closest("spui-interaction-tag");
|
|
351
|
-
if (owner)
|
|
352
|
-
owner.dispatchEvent(new CustomEvent("spui-dismiss", { bubbles: true, composed: true, cancelable: true, detail: { value: owner.getAttribute("value") ?? "", originalEvent: event } }));
|
|
353
|
-
});
|
|
354
|
-
this.button = button;
|
|
355
|
-
shadow.append(style, button);
|
|
356
|
-
}
|
|
357
|
-
sync() {
|
|
358
|
-
if (!this.button)
|
|
359
|
-
return;
|
|
360
|
-
this.button.disabled = this.hasAttribute("disabled");
|
|
361
|
-
const owner = this.closest("spui-interaction-tag");
|
|
362
|
-
const label = this.getAttribute("label") ?? `${this.getAttribute("remove-label") ?? "Remove"} ${owner?.getAttribute("label") ?? owner?.getAttribute("value") ?? "tag"}`;
|
|
363
|
-
this.button.setAttribute("aria-label", label);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
customElements.define("spui-interaction-tag-secondary", SpuiInteractionTagSecondary);
|
|
367
|
-
}
|
|
368
|
-
export function defineInteractionTag() {
|
|
369
|
-
defineInteractionTagPrimary();
|
|
370
|
-
defineInteractionTagSecondary();
|
|
371
|
-
if (customElements.get("spui-interaction-tag"))
|
|
372
|
-
return;
|
|
373
|
-
class SpuiInteractionTag extends HTMLElement {
|
|
374
|
-
static observedAttributes = ["appearance", "disabled", "selected", "shape", "size", "value"];
|
|
375
|
-
observer;
|
|
376
|
-
connectedCallback() {
|
|
377
|
-
this.style.display ||= "inline-flex";
|
|
378
|
-
this.style.alignItems ||= "center";
|
|
379
|
-
this.style.maxWidth ||= "100%";
|
|
380
|
-
this.observer?.disconnect();
|
|
381
|
-
this.observer = new MutationObserver(() => this.sync());
|
|
382
|
-
this.observer.observe(this, { childList: true });
|
|
383
|
-
this.sync();
|
|
384
|
-
}
|
|
385
|
-
disconnectedCallback() { this.observer?.disconnect(); }
|
|
386
|
-
attributeChangedCallback() { this.sync(); }
|
|
387
|
-
sync() {
|
|
388
|
-
this.style.border ||= "1px solid var(--spui-tag-border,var(--spui-ui-stroke,var(--spui-semantic-body-divider,var(--colorNeutralStroke2,#8a8886))))";
|
|
389
|
-
this.style.borderRadius = this.getAttribute("shape") === "circular" ? "999px" : "var(--spui-control-radius,8px)";
|
|
390
|
-
this.style.background = this.getAttribute("appearance") === "outline" ? "var(--spui-ui-surface,var(--spui-semantic-card-background,var(--colorNeutralBackground1,#fff)))" : this.getAttribute("appearance") === "brand" ? "color-mix(in srgb,var(--spui-ui-accent,var(--spui-semantic-primary-button-background,var(--colorBrandBackground,#78716c))) 22%,var(--spui-ui-surface,var(--spui-semantic-card-background,var(--colorNeutralBackground1,#fff))))" : "color-mix(in srgb,var(--spui-ui-accent,var(--spui-semantic-primary-button-background,var(--colorBrandBackground,#78716c))) 12%,var(--spui-ui-surface,var(--spui-semantic-card-background,var(--colorNeutralBackground1,#fff))))";
|
|
391
|
-
this.style.color = "var(--spui-ui-text,var(--spui-semantic-body-text,var(--colorNeutralForeground1,inherit)))";
|
|
392
|
-
this.style.fontFamily = "var(--spui-font-family,inherit)";
|
|
393
|
-
this.toggleAttribute("data-selected", this.hasAttribute("selected"));
|
|
394
|
-
const primary = this.querySelector("spui-interaction-tag-primary");
|
|
395
|
-
const secondary = this.querySelector("spui-interaction-tag-secondary");
|
|
396
|
-
if (primary)
|
|
397
|
-
for (const name of ["disabled", "selected", "appearance", "shape", "size"]) {
|
|
398
|
-
if (this.hasAttribute(name))
|
|
399
|
-
primary.setAttribute(name, this.getAttribute(name));
|
|
400
|
-
else
|
|
401
|
-
primary.removeAttribute(name);
|
|
402
|
-
}
|
|
403
|
-
if (primary) {
|
|
404
|
-
const explicit = primary.hasAttribute("data-spui-explicit-has-secondary-action") || (primary.hasAttribute("has-secondary-action") && !primary.hasAttribute("data-spui-generated-has-secondary-action"));
|
|
405
|
-
if (secondary || explicit)
|
|
406
|
-
primary.setAttribute("has-secondary-action", "");
|
|
407
|
-
else
|
|
408
|
-
primary.removeAttribute("has-secondary-action");
|
|
409
|
-
primary.toggleAttribute("data-spui-generated-has-secondary-action", Boolean(secondary) && !explicit);
|
|
410
|
-
}
|
|
411
|
-
if (secondary)
|
|
412
|
-
for (const name of ["disabled", "appearance", "shape", "size"]) {
|
|
413
|
-
if (this.hasAttribute(name))
|
|
414
|
-
secondary.setAttribute(name, this.getAttribute(name));
|
|
415
|
-
else
|
|
416
|
-
secondary.removeAttribute(name);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
customElements.define("spui-interaction-tag", SpuiInteractionTag);
|
|
421
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export type TeachingPopoverAnnouncementFunction = (newValue: string) => string;
|
|
2
|
-
export type TeachingPopoverCarouselValueChangeType = "click" | "keydown" | "programmatic";
|
|
3
|
-
export type TeachingPopoverCarouselValueChangeDetail = {
|
|
4
|
-
value?: string;
|
|
5
|
-
event?: Event;
|
|
6
|
-
type: TeachingPopoverCarouselValueChangeType;
|
|
7
|
-
currentPage?: number;
|
|
8
|
-
totalPages?: number;
|
|
9
|
-
};
|
|
10
|
-
export type TeachingPopoverFinishDetail = {
|
|
11
|
-
value?: string;
|
|
12
|
-
event?: Event;
|
|
13
|
-
type: "click";
|
|
14
|
-
};
|
|
15
|
-
export type TeachingPopoverAnnouncementDetail = {
|
|
16
|
-
value: string;
|
|
17
|
-
message: string;
|
|
18
|
-
currentPage: number;
|
|
19
|
-
totalPages: number;
|
|
20
|
-
};
|
|
21
|
-
export interface SharePointTeachingPopoverCarouselElement extends HTMLElement {
|
|
22
|
-
value: string;
|
|
23
|
-
defaultValue: string;
|
|
24
|
-
announcement?: TeachingPopoverAnnouncementFunction;
|
|
25
|
-
}
|
|
26
|
-
declare global {
|
|
27
|
-
interface HTMLElementTagNameMap {
|
|
28
|
-
"spui-teaching-popover-carousel": SharePointTeachingPopoverCarouselElement;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/** Register the framework-neutral TeachingPopover and its composable guided-tour parts. */
|
|
32
|
-
export declare function defineTeachingPopover(): void;
|