@xmesh/system-design 0.0.4 → 0.0.6
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/README.md +2 -1
- package/custom-elements.json +18382 -0
- package/dist/lit/components/alert/index.d.ts +5 -0
- package/dist/lit/components/alert/index.js +8 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +1 -0
- package/dist/lit/components/app-bar/index.js +4 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +5 -0
- package/dist/lit/components/artifact/index.js +14 -10
- package/dist/lit/components/artifact/index.styles.js +180 -0
- package/dist/lit/components/autocomplete/index.d.ts +5 -0
- package/dist/lit/components/autocomplete/index.js +11 -2
- package/dist/lit/components/autocomplete/index.styles.js +185 -0
- package/dist/lit/components/avatar/index.d.ts +1 -0
- package/dist/lit/components/avatar/index.js +4 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +1 -0
- package/dist/lit/components/avatar-group/index.js +4 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +1 -0
- package/dist/lit/components/badge/index.js +4 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.js +8 -9
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +1 -0
- package/dist/lit/components/breadcrumbs/index.js +5 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +4 -0
- package/dist/lit/components/bubble/index.js +14 -11
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +1 -0
- package/dist/lit/components/button/index.js +6 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +1 -0
- package/dist/lit/components/card/index.js +4 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +6 -0
- package/dist/lit/components/chat/index.js +15 -10
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +1 -0
- package/dist/lit/components/checkbox/index.js +7 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +5 -0
- package/dist/lit/components/chip/index.js +8 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +4 -0
- package/dist/lit/components/chip-group/index.js +7 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +1 -0
- package/dist/lit/components/code/index.js +4 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +6 -0
- package/dist/lit/components/composer/index.js +15 -10
- package/dist/lit/components/composer/index.styles.js +562 -0
- package/dist/lit/components/data-table/index.css +18 -0
- package/dist/lit/components/data-table/index.d.ts +30 -0
- package/dist/lit/components/data-table/index.js +120 -34
- package/dist/lit/components/data-table/index.styles.js +198 -0
- package/dist/lit/components/date-range/index.d.ts +4 -0
- package/dist/lit/components/date-range/index.js +7 -2
- package/dist/lit/components/date-range/index.styles.js +338 -0
- package/dist/lit/components/dialog/index.d.ts +4 -0
- package/dist/lit/components/dialog/index.js +7 -2
- package/dist/lit/components/dialog/index.styles.js +138 -0
- package/dist/lit/components/divider/index.d.ts +1 -0
- package/dist/lit/components/divider/index.js +4 -2
- package/dist/lit/components/divider/index.styles.js +41 -0
- package/dist/lit/components/empty-state/index.d.ts +1 -0
- package/dist/lit/components/empty-state/index.js +4 -2
- package/dist/lit/components/empty-state/index.styles.js +83 -0
- package/dist/lit/components/expansion-panel/index.d.ts +5 -0
- package/dist/lit/components/expansion-panel/index.js +8 -2
- package/dist/lit/components/expansion-panel/index.styles.js +134 -0
- package/dist/lit/components/field/index.d.ts +4 -0
- package/dist/lit/components/field/index.js +9 -4
- package/dist/lit/components/field/index.styles.js +237 -0
- package/dist/lit/components/file-input/index.d.ts +4 -0
- package/dist/lit/components/file-input/index.js +10 -4
- package/dist/lit/components/file-input/index.styles.js +271 -0
- package/dist/lit/components/form/index.d.ts +4 -0
- package/dist/lit/components/form/index.js +7 -2
- package/dist/lit/components/form/index.styles.js +43 -0
- package/dist/lit/components/grid/index.d.ts +1 -0
- package/dist/lit/components/grid/index.js +4 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +1 -0
- package/dist/lit/components/kbd/index.js +4 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +4 -0
- package/dist/lit/components/list/index.js +7 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +1 -0
- package/dist/lit/components/list-item/index.js +4 -2
- package/dist/lit/components/list-item/index.styles.js +133 -0
- package/dist/lit/components/menu/index.d.ts +8 -0
- package/dist/lit/components/menu/index.js +11 -3
- package/dist/lit/components/menu/index.styles.js +108 -0
- package/dist/lit/components/multi-select/index.css +156 -0
- package/dist/lit/components/multi-select/index.d.ts +70 -0
- package/dist/lit/components/multi-select/index.js +497 -0
- package/dist/lit/components/multi-select/index.styles.js +170 -0
- package/dist/lit/components/navigation-drawer/index.d.ts +4 -0
- package/dist/lit/components/navigation-drawer/index.js +7 -2
- package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
- package/dist/lit/components/overlay/index.d.ts +5 -0
- package/dist/lit/components/overlay/index.js +8 -2
- package/dist/lit/components/overlay/index.styles.js +185 -0
- package/dist/lit/components/pagination/index.d.ts +17 -0
- package/dist/lit/components/pagination/index.js +53 -8
- package/dist/lit/components/pagination/index.styles.js +116 -0
- package/dist/lit/components/popover/index.d.ts +5 -0
- package/dist/lit/components/popover/index.js +8 -2
- package/dist/lit/components/popover/index.styles.js +48 -0
- package/dist/lit/components/primitives/index.js +8 -9
- package/dist/lit/components/primitives/index.styles.js +518 -0
- package/dist/lit/components/progress/index.d.ts +1 -0
- package/dist/lit/components/progress/index.js +4 -2
- package/dist/lit/components/progress/index.styles.js +157 -0
- package/dist/lit/components/radio-group/index.d.ts +5 -0
- package/dist/lit/components/radio-group/index.js +10 -6
- package/dist/lit/components/radio-group/index.styles.js +192 -0
- package/dist/lit/components/select/index.d.ts +4 -0
- package/dist/lit/components/select/index.js +10 -2
- package/dist/lit/components/select/index.styles.js +165 -0
- package/dist/lit/components/sidebar-item/index.js +8 -9
- package/dist/lit/components/sidebar-item/index.styles.js +147 -0
- package/dist/lit/components/skeleton/index.d.ts +1 -0
- package/dist/lit/components/skeleton/index.js +4 -2
- package/dist/lit/components/skeleton/index.styles.js +95 -0
- package/dist/lit/components/slider/index.d.ts +5 -0
- package/dist/lit/components/slider/index.js +11 -4
- package/dist/lit/components/slider/index.styles.js +185 -0
- package/dist/lit/components/snackbar/index.d.ts +4 -0
- package/dist/lit/components/snackbar/index.js +14 -10
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +1 -0
- package/dist/lit/components/stack/index.js +4 -2
- package/dist/lit/components/stack/index.styles.js +55 -0
- package/dist/lit/components/switch/index.d.ts +1 -0
- package/dist/lit/components/switch/index.js +7 -4
- package/dist/lit/components/switch/index.styles.js +140 -0
- package/dist/lit/components/table/index.d.ts +1 -0
- package/dist/lit/components/table/index.js +4 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +4 -0
- package/dist/lit/components/tabs/index.js +8 -4
- package/dist/lit/components/tabs/index.styles.js +130 -0
- package/dist/lit/components/text-field/index.d.ts +1 -0
- package/dist/lit/components/text-field/index.js +7 -2
- package/dist/lit/components/text-field/index.styles.js +104 -0
- package/dist/lit/components/textarea/index.d.ts +1 -0
- package/dist/lit/components/textarea/index.js +7 -2
- package/dist/lit/components/textarea/index.styles.js +69 -0
- package/dist/lit/components/tooltip/index.d.ts +1 -0
- package/dist/lit/components/tooltip/index.js +4 -2
- package/dist/lit/components/tooltip/index.styles.js +51 -0
- package/dist/lit/components/validation/index.d.ts +6 -0
- package/dist/lit/components/validation/index.js +15 -10
- package/dist/lit/components/validation/index.styles.js +400 -0
- package/dist/lit/index.d.ts +1 -0
- package/dist/lit/index.js +1 -0
- package/dist/react/XmAlert.d.ts +99 -0
- package/dist/react/XmAlert.js +47 -0
- package/dist/react/XmAppBar.d.ts +59 -0
- package/dist/react/XmAppBar.js +34 -0
- package/dist/react/XmArtifact.d.ts +113 -0
- package/dist/react/XmArtifact.js +48 -0
- package/dist/react/XmArtifactChip.d.ts +56 -0
- package/dist/react/XmArtifactChip.js +32 -0
- package/dist/react/XmAutocomplete.d.ts +153 -0
- package/dist/react/XmAutocomplete.js +70 -0
- package/dist/react/XmAvatar.d.ts +71 -0
- package/dist/react/XmAvatar.js +40 -0
- package/dist/react/XmAvatarGroup.d.ts +59 -0
- package/dist/react/XmAvatarGroup.js +34 -0
- package/dist/react/XmBadge.d.ts +67 -0
- package/dist/react/XmBadge.js +38 -0
- package/dist/react/XmBrandGlyph.d.ts +46 -0
- package/dist/react/XmBrandGlyph.js +24 -0
- package/dist/react/XmBrandMark.d.ts +71 -0
- package/dist/react/XmBrandMark.js +40 -0
- package/dist/react/XmBreadcrumbs.d.ts +56 -0
- package/dist/react/XmBreadcrumbs.js +32 -0
- package/dist/react/XmBubble.d.ts +69 -0
- package/dist/react/XmBubble.js +38 -0
- package/dist/react/XmBubbleActions.d.ts +59 -0
- package/dist/react/XmBubbleActions.js +34 -0
- package/dist/react/XmBubbleGroup.d.ts +82 -0
- package/dist/react/XmBubbleGroup.js +38 -0
- package/dist/react/XmButton.d.ts +89 -0
- package/dist/react/XmButton.js +48 -0
- package/dist/react/XmCard.d.ts +59 -0
- package/dist/react/XmCard.js +34 -0
- package/dist/react/XmChatShell.d.ts +110 -0
- package/dist/react/XmChatShell.js +48 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +60 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +48 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +36 -0
- package/dist/react/XmCode.d.ts +55 -0
- package/dist/react/XmCode.js +32 -0
- package/dist/react/XmComposer.d.ts +123 -0
- package/dist/react/XmComposer.js +56 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +66 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +42 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +41 -0
- package/dist/react/XmDivider.d.ts +55 -0
- package/dist/react/XmDivider.js +32 -0
- package/dist/react/XmEmptyState.d.ts +61 -0
- package/dist/react/XmEmptyState.js +34 -0
- package/dist/react/XmExpansionPanel.d.ts +101 -0
- package/dist/react/XmExpansionPanel.js +49 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +70 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +50 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +38 -0
- package/dist/react/XmGrid.d.ts +59 -0
- package/dist/react/XmGrid.js +34 -0
- package/dist/react/XmKbd.d.ts +46 -0
- package/dist/react/XmKbd.js +24 -0
- package/dist/react/XmList.d.ts +83 -0
- package/dist/react/XmList.js +38 -0
- package/dist/react/XmListItem.d.ts +67 -0
- package/dist/react/XmListItem.js +38 -0
- package/dist/react/XmMenu.d.ts +98 -0
- package/dist/react/XmMenu.js +46 -0
- package/dist/react/XmMenuItem.d.ts +63 -0
- package/dist/react/XmMenuItem.js +36 -0
- package/dist/react/XmMultiSelect.d.ts +161 -0
- package/dist/react/XmMultiSelect.js +74 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +42 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +56 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +58 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +42 -0
- package/dist/react/XmProgress.d.ts +75 -0
- package/dist/react/XmProgress.js +42 -0
- package/dist/react/XmRadio.d.ts +88 -0
- package/dist/react/XmRadio.js +42 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +58 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +70 -0
- package/dist/react/XmSidebarItem.d.ts +75 -0
- package/dist/react/XmSidebarItem.js +42 -0
- package/dist/react/XmSkeleton.d.ts +71 -0
- package/dist/react/XmSkeleton.js +40 -0
- package/dist/react/XmSlider.d.ts +160 -0
- package/dist/react/XmSlider.js +76 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +51 -0
- package/dist/react/XmStack.d.ts +71 -0
- package/dist/react/XmStack.js +40 -0
- package/dist/react/XmSwitch.d.ts +136 -0
- package/dist/react/XmSwitch.js +58 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +38 -0
- package/dist/react/XmTabPanel.d.ts +55 -0
- package/dist/react/XmTabPanel.js +32 -0
- package/dist/react/XmTable.d.ts +57 -0
- package/dist/react/XmTable.js +32 -0
- package/dist/react/XmTabs.d.ts +82 -0
- package/dist/react/XmTabs.js +38 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +62 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +66 -0
- package/dist/react/XmTooltip.d.ts +67 -0
- package/dist/react/XmTooltip.js +38 -0
- package/dist/react/index.d.ts +59 -0
- package/dist/react/index.js +59 -0
- package/dist/react/react-utils.js +67 -0
- package/package.json +37 -9
- package/styles/_base-typography.css +86 -0
- package/styles/_primitives.css +54 -0
- package/styles/_reset.css +58 -0
- package/styles/base.css +23 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +979 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmChip as XmChipElement } from "../lit/components/chip/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A generic type for strongly typing custom events with their targets
|
|
6
|
+
* @template T - The type of the event target (extends EventTarget)
|
|
7
|
+
* @template D - The type of the detail payload for the custom event
|
|
8
|
+
*/
|
|
9
|
+
type TypedEvent<T extends EventTarget, E = Event> = E & {
|
|
10
|
+
target: T;
|
|
11
|
+
};
|
|
12
|
+
/** `XmChip` component event */
|
|
13
|
+
export type XmChipElementEvent<E = Event> = TypedEvent<XmChipElement, E>;
|
|
14
|
+
|
|
15
|
+
export type { XmChipElement };
|
|
16
|
+
|
|
17
|
+
export interface XmChipProps extends Pick<
|
|
18
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
19
|
+
| "children"
|
|
20
|
+
| "dir"
|
|
21
|
+
| "hidden"
|
|
22
|
+
| "id"
|
|
23
|
+
| "lang"
|
|
24
|
+
| "slot"
|
|
25
|
+
| "style"
|
|
26
|
+
| "title"
|
|
27
|
+
| "translate"
|
|
28
|
+
| "onClick"
|
|
29
|
+
| "onFocus"
|
|
30
|
+
| "onBlur"
|
|
31
|
+
> {
|
|
32
|
+
/** undefined */
|
|
33
|
+
selected?: boolean;
|
|
34
|
+
|
|
35
|
+
/** undefined */
|
|
36
|
+
removable?: boolean;
|
|
37
|
+
|
|
38
|
+
/** undefined */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
|
|
41
|
+
/** undefined */
|
|
42
|
+
value?: XmChipElement["value"];
|
|
43
|
+
|
|
44
|
+
/** undefined */
|
|
45
|
+
size?: XmChipElement["size"];
|
|
46
|
+
|
|
47
|
+
/** undefined */
|
|
48
|
+
category?: XmChipElement["category"];
|
|
49
|
+
|
|
50
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
51
|
+
className?: string;
|
|
52
|
+
|
|
53
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
54
|
+
exportparts?: string;
|
|
55
|
+
|
|
56
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
57
|
+
htmlFor?: string;
|
|
58
|
+
|
|
59
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
60
|
+
key?: number | string;
|
|
61
|
+
|
|
62
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
63
|
+
part?: string;
|
|
64
|
+
|
|
65
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
66
|
+
ref?: React.Ref<XmChipElement>;
|
|
67
|
+
|
|
68
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
69
|
+
tabIndex?: number;
|
|
70
|
+
|
|
71
|
+
/** Fired when the chip is activated. */
|
|
72
|
+
onXmChipActivate?: (event: XmChipElementEvent) => void;
|
|
73
|
+
|
|
74
|
+
/** Fired when the chip's remove affordance is activated. */
|
|
75
|
+
onXmChipRemove?: (event: XmChipElementEvent) => void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
*
|
|
81
|
+
* ## Attributes & Properties
|
|
82
|
+
*
|
|
83
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
84
|
+
*
|
|
85
|
+
* - `value`: undefined
|
|
86
|
+
* - `size`: undefined
|
|
87
|
+
* - `selected`: undefined
|
|
88
|
+
* - `removable`: undefined
|
|
89
|
+
* - `disabled`: undefined
|
|
90
|
+
* - `category`: undefined
|
|
91
|
+
*
|
|
92
|
+
* ## Events
|
|
93
|
+
*
|
|
94
|
+
* Events that will be emitted by the component.
|
|
95
|
+
*
|
|
96
|
+
* - `xm-chip-activate`: Fired when the chip is activated.
|
|
97
|
+
* - `xm-chip-remove`: Fired when the chip's remove affordance is activated.
|
|
98
|
+
*/
|
|
99
|
+
export const XmChip: React.ForwardRefExoticComponent<XmChipProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/chip/index.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmChip = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
selected,
|
|
9
|
+
removable,
|
|
10
|
+
disabled,
|
|
11
|
+
value,
|
|
12
|
+
size,
|
|
13
|
+
category,
|
|
14
|
+
className,
|
|
15
|
+
exportparts,
|
|
16
|
+
htmlFor,
|
|
17
|
+
part,
|
|
18
|
+
tabIndex,
|
|
19
|
+
onXmChipActivate,
|
|
20
|
+
onXmChipRemove,
|
|
21
|
+
...restProps
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
/** Event listeners - run once */
|
|
25
|
+
useEventListener(ref, "xm-chip-activate", props.onXmChipActivate);
|
|
26
|
+
useEventListener(ref, "xm-chip-remove", props.onXmChipRemove);
|
|
27
|
+
|
|
28
|
+
return React.createElement(
|
|
29
|
+
"xm-chip",
|
|
30
|
+
{
|
|
31
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
32
|
+
...restProps,
|
|
33
|
+
value: value,
|
|
34
|
+
size: size,
|
|
35
|
+
category: category,
|
|
36
|
+
class: className,
|
|
37
|
+
exportparts: exportparts,
|
|
38
|
+
for: htmlFor ?? props["for"],
|
|
39
|
+
part: part,
|
|
40
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
41
|
+
selected: selected ? true : undefined,
|
|
42
|
+
removable: removable ? true : undefined,
|
|
43
|
+
disabled: disabled ? true : undefined,
|
|
44
|
+
style: { ...props.style },
|
|
45
|
+
},
|
|
46
|
+
props.children,
|
|
47
|
+
);
|
|
48
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmChipGroup as XmChipGroupElement } from "../lit/components/chip-group/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A generic type for strongly typing custom events with their targets
|
|
6
|
+
* @template T - The type of the event target (extends EventTarget)
|
|
7
|
+
* @template D - The type of the detail payload for the custom event
|
|
8
|
+
*/
|
|
9
|
+
type TypedEvent<T extends EventTarget, E = Event> = E & {
|
|
10
|
+
target: T;
|
|
11
|
+
};
|
|
12
|
+
/** `XmChipGroup` component event */
|
|
13
|
+
export type XmChipGroupElementEvent<E = Event> = TypedEvent<
|
|
14
|
+
XmChipGroupElement,
|
|
15
|
+
E
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type { XmChipGroupElement };
|
|
19
|
+
|
|
20
|
+
export interface XmChipGroupProps extends Pick<
|
|
21
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
22
|
+
| "children"
|
|
23
|
+
| "dir"
|
|
24
|
+
| "hidden"
|
|
25
|
+
| "id"
|
|
26
|
+
| "lang"
|
|
27
|
+
| "slot"
|
|
28
|
+
| "style"
|
|
29
|
+
| "title"
|
|
30
|
+
| "translate"
|
|
31
|
+
| "onClick"
|
|
32
|
+
| "onFocus"
|
|
33
|
+
| "onBlur"
|
|
34
|
+
> {
|
|
35
|
+
/** undefined */
|
|
36
|
+
multiple?: boolean;
|
|
37
|
+
|
|
38
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
39
|
+
className?: string;
|
|
40
|
+
|
|
41
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
42
|
+
exportparts?: string;
|
|
43
|
+
|
|
44
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
45
|
+
htmlFor?: string;
|
|
46
|
+
|
|
47
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
48
|
+
key?: number | string;
|
|
49
|
+
|
|
50
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
51
|
+
part?: string;
|
|
52
|
+
|
|
53
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
54
|
+
ref?: React.Ref<XmChipGroupElement>;
|
|
55
|
+
|
|
56
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
57
|
+
tabIndex?: number;
|
|
58
|
+
|
|
59
|
+
/** Fired on commit with the new value in `detail`. */
|
|
60
|
+
onChange?: (event: XmChipGroupElementEvent) => void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* ## Attributes & Properties
|
|
67
|
+
*
|
|
68
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
69
|
+
*
|
|
70
|
+
* - `multiple`: undefined
|
|
71
|
+
* - `value`: undefined (property only)
|
|
72
|
+
*
|
|
73
|
+
* ## Events
|
|
74
|
+
*
|
|
75
|
+
* Events that will be emitted by the component.
|
|
76
|
+
*
|
|
77
|
+
* - `change`: Fired on commit with the new value in `detail`.
|
|
78
|
+
*/
|
|
79
|
+
export const XmChipGroup: React.ForwardRefExoticComponent<XmChipGroupProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/chip-group/index.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmChipGroup = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
multiple,
|
|
9
|
+
className,
|
|
10
|
+
exportparts,
|
|
11
|
+
htmlFor,
|
|
12
|
+
part,
|
|
13
|
+
tabIndex,
|
|
14
|
+
onChange,
|
|
15
|
+
...restProps
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
/** Event listeners - run once */
|
|
19
|
+
useEventListener(ref, "change", props.onChange);
|
|
20
|
+
|
|
21
|
+
return React.createElement(
|
|
22
|
+
"xm-chip-group",
|
|
23
|
+
{
|
|
24
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
25
|
+
...restProps,
|
|
26
|
+
class: className,
|
|
27
|
+
exportparts: exportparts,
|
|
28
|
+
for: htmlFor ?? props["for"],
|
|
29
|
+
part: part,
|
|
30
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
31
|
+
multiple: multiple ? true : undefined,
|
|
32
|
+
style: { ...props.style },
|
|
33
|
+
},
|
|
34
|
+
props.children,
|
|
35
|
+
);
|
|
36
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { XmCode as XmCodeElement } from "../lit/components/code/index.js";
|
|
3
|
+
|
|
4
|
+
export type { XmCodeElement };
|
|
5
|
+
|
|
6
|
+
export interface XmCodeProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** undefined */
|
|
22
|
+
block?: boolean;
|
|
23
|
+
|
|
24
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
25
|
+
className?: string;
|
|
26
|
+
|
|
27
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
28
|
+
exportparts?: string;
|
|
29
|
+
|
|
30
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
31
|
+
htmlFor?: string;
|
|
32
|
+
|
|
33
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
34
|
+
key?: number | string;
|
|
35
|
+
|
|
36
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
37
|
+
part?: string;
|
|
38
|
+
|
|
39
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
40
|
+
ref?: React.Ref<XmCodeElement>;
|
|
41
|
+
|
|
42
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
43
|
+
tabIndex?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* ## Attributes & Properties
|
|
50
|
+
*
|
|
51
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
52
|
+
*
|
|
53
|
+
* - `block`: undefined
|
|
54
|
+
*/
|
|
55
|
+
export const XmCode: React.ForwardRefExoticComponent<XmCodeProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/code/index.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmCode = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
block,
|
|
9
|
+
className,
|
|
10
|
+
exportparts,
|
|
11
|
+
htmlFor,
|
|
12
|
+
part,
|
|
13
|
+
tabIndex,
|
|
14
|
+
...restProps
|
|
15
|
+
} = props;
|
|
16
|
+
|
|
17
|
+
return React.createElement(
|
|
18
|
+
"xm-code",
|
|
19
|
+
{
|
|
20
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
21
|
+
...restProps,
|
|
22
|
+
class: className,
|
|
23
|
+
exportparts: exportparts,
|
|
24
|
+
for: htmlFor ?? props["for"],
|
|
25
|
+
part: part,
|
|
26
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
27
|
+
block: block ? true : undefined,
|
|
28
|
+
style: { ...props.style },
|
|
29
|
+
},
|
|
30
|
+
props.children,
|
|
31
|
+
);
|
|
32
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
XmComposer as XmComposerElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../lit/components/composer/index.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A generic type for strongly typing custom events with their targets
|
|
9
|
+
* @template T - The type of the event target (extends EventTarget)
|
|
10
|
+
* @template D - The type of the detail payload for the custom event
|
|
11
|
+
*/
|
|
12
|
+
type TypedEvent<T extends EventTarget, E = Event> = E & {
|
|
13
|
+
target: T;
|
|
14
|
+
};
|
|
15
|
+
/** `XmComposer` component event */
|
|
16
|
+
export type XmComposerElementEvent<E = Event> = TypedEvent<
|
|
17
|
+
XmComposerElement,
|
|
18
|
+
E
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export type { XmComposerElement, CustomEvent };
|
|
22
|
+
|
|
23
|
+
export interface XmComposerProps extends Pick<
|
|
24
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
25
|
+
| "children"
|
|
26
|
+
| "dir"
|
|
27
|
+
| "hidden"
|
|
28
|
+
| "id"
|
|
29
|
+
| "lang"
|
|
30
|
+
| "slot"
|
|
31
|
+
| "style"
|
|
32
|
+
| "title"
|
|
33
|
+
| "translate"
|
|
34
|
+
| "onClick"
|
|
35
|
+
| "onFocus"
|
|
36
|
+
| "onBlur"
|
|
37
|
+
> {
|
|
38
|
+
/** undefined */
|
|
39
|
+
initialFocus?: boolean;
|
|
40
|
+
|
|
41
|
+
/** undefined */
|
|
42
|
+
processing?: boolean;
|
|
43
|
+
|
|
44
|
+
/** undefined */
|
|
45
|
+
showAttachments?: boolean;
|
|
46
|
+
|
|
47
|
+
/** undefined */
|
|
48
|
+
initialValue?: XmComposerElement["initialValue"];
|
|
49
|
+
|
|
50
|
+
/** undefined */
|
|
51
|
+
thinkingLabel?: XmComposerElement["thinkingLabel"];
|
|
52
|
+
|
|
53
|
+
/** undefined */
|
|
54
|
+
maxChars?: XmComposerElement["maxChars"];
|
|
55
|
+
|
|
56
|
+
/** undefined */
|
|
57
|
+
counterAt?: XmComposerElement["counterAt"];
|
|
58
|
+
|
|
59
|
+
/** undefined */
|
|
60
|
+
placeholder?: XmComposerElement["placeholder"];
|
|
61
|
+
|
|
62
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
63
|
+
className?: string;
|
|
64
|
+
|
|
65
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
66
|
+
exportparts?: string;
|
|
67
|
+
|
|
68
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
69
|
+
htmlFor?: string;
|
|
70
|
+
|
|
71
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
72
|
+
key?: number | string;
|
|
73
|
+
|
|
74
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
75
|
+
part?: string;
|
|
76
|
+
|
|
77
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
78
|
+
ref?: React.Ref<XmComposerElement>;
|
|
79
|
+
|
|
80
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
81
|
+
tabIndex?: number;
|
|
82
|
+
|
|
83
|
+
/** Fired when the value changes (`detail.value`). */
|
|
84
|
+
onValueChange?: (event: XmComposerElementEvent) => void;
|
|
85
|
+
|
|
86
|
+
/** Fired when the attachment set changes. */
|
|
87
|
+
onAttachmentsChange?: (event: XmComposerElementEvent) => void;
|
|
88
|
+
|
|
89
|
+
/** Fired when the action is cancelled. */
|
|
90
|
+
onCancel?: (event: XmComposerElementEvent) => void;
|
|
91
|
+
|
|
92
|
+
/** Fired when the user sends the composed content. */
|
|
93
|
+
onSend?: (event: XmComposerElementEvent) => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
*
|
|
99
|
+
* ## Attributes & Properties
|
|
100
|
+
*
|
|
101
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
102
|
+
*
|
|
103
|
+
* - `initial-value`/`initialValue`: undefined
|
|
104
|
+
* - `initial-focus`/`initialFocus`: undefined
|
|
105
|
+
* - `processing`: undefined
|
|
106
|
+
* - `thinking-label`/`thinkingLabel`: undefined
|
|
107
|
+
* - `max-chars`/`maxChars`: undefined
|
|
108
|
+
* - `counter-at`/`counterAt`: undefined
|
|
109
|
+
* - `placeholder`: undefined
|
|
110
|
+
* - `show-attachments`/`showAttachments`: undefined
|
|
111
|
+
* - `value`: undefined (property only)
|
|
112
|
+
* - `attachments`: undefined (property only)
|
|
113
|
+
*
|
|
114
|
+
* ## Events
|
|
115
|
+
*
|
|
116
|
+
* Events that will be emitted by the component.
|
|
117
|
+
*
|
|
118
|
+
* - `value-change`: Fired when the value changes (`detail.value`).
|
|
119
|
+
* - `attachments-change`: Fired when the attachment set changes.
|
|
120
|
+
* - `cancel`: Fired when the action is cancelled.
|
|
121
|
+
* - `send`: Fired when the user sends the composed content.
|
|
122
|
+
*/
|
|
123
|
+
export const XmComposer: React.ForwardRefExoticComponent<XmComposerProps>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../lit/components/composer/index.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const XmComposer = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
initialFocus,
|
|
9
|
+
processing,
|
|
10
|
+
showAttachments,
|
|
11
|
+
initialValue,
|
|
12
|
+
thinkingLabel,
|
|
13
|
+
maxChars,
|
|
14
|
+
counterAt,
|
|
15
|
+
placeholder,
|
|
16
|
+
className,
|
|
17
|
+
exportparts,
|
|
18
|
+
htmlFor,
|
|
19
|
+
part,
|
|
20
|
+
tabIndex,
|
|
21
|
+
onValueChange,
|
|
22
|
+
onAttachmentsChange,
|
|
23
|
+
onCancel,
|
|
24
|
+
onSend,
|
|
25
|
+
...restProps
|
|
26
|
+
} = props;
|
|
27
|
+
|
|
28
|
+
/** Event listeners - run once */
|
|
29
|
+
useEventListener(ref, "value-change", props.onValueChange);
|
|
30
|
+
useEventListener(ref, "attachments-change", props.onAttachmentsChange);
|
|
31
|
+
useEventListener(ref, "cancel", props.onCancel);
|
|
32
|
+
useEventListener(ref, "send", props.onSend);
|
|
33
|
+
|
|
34
|
+
return React.createElement(
|
|
35
|
+
"xm-composer",
|
|
36
|
+
{
|
|
37
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
38
|
+
...restProps,
|
|
39
|
+
"initial-value": initialValue ?? props["initial-value"],
|
|
40
|
+
"thinking-label": thinkingLabel ?? props["thinking-label"],
|
|
41
|
+
"max-chars": maxChars ?? props["max-chars"],
|
|
42
|
+
"counter-at": counterAt ?? props["counter-at"],
|
|
43
|
+
placeholder: placeholder,
|
|
44
|
+
class: className,
|
|
45
|
+
exportparts: exportparts,
|
|
46
|
+
for: htmlFor ?? props["for"],
|
|
47
|
+
part: part,
|
|
48
|
+
tabindex: tabIndex ?? props["tabindex"],
|
|
49
|
+
"initial-focus": initialFocus ? true : undefined,
|
|
50
|
+
processing: processing ? true : undefined,
|
|
51
|
+
"show-attachments": showAttachments ? true : undefined,
|
|
52
|
+
style: { ...props.style },
|
|
53
|
+
},
|
|
54
|
+
props.children,
|
|
55
|
+
);
|
|
56
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
XmDataTable as XmDataTableElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../lit/components/data-table/index.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A generic type for strongly typing custom events with their targets
|
|
9
|
+
* @template T - The type of the event target (extends EventTarget)
|
|
10
|
+
* @template D - The type of the detail payload for the custom event
|
|
11
|
+
*/
|
|
12
|
+
type TypedEvent<T extends EventTarget, E = Event> = E & {
|
|
13
|
+
target: T;
|
|
14
|
+
};
|
|
15
|
+
/** `XmDataTable` component event */
|
|
16
|
+
export type XmDataTableElementEvent<E = Event> = TypedEvent<
|
|
17
|
+
XmDataTableElement,
|
|
18
|
+
E
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export type { XmDataTableElement, CustomEvent };
|
|
22
|
+
|
|
23
|
+
export interface XmDataTableProps extends Pick<
|
|
24
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
25
|
+
| "children"
|
|
26
|
+
| "dir"
|
|
27
|
+
| "hidden"
|
|
28
|
+
| "id"
|
|
29
|
+
| "lang"
|
|
30
|
+
| "slot"
|
|
31
|
+
| "style"
|
|
32
|
+
| "title"
|
|
33
|
+
| "translate"
|
|
34
|
+
| "onClick"
|
|
35
|
+
| "onFocus"
|
|
36
|
+
| "onBlur"
|
|
37
|
+
> {
|
|
38
|
+
/** undefined */
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
|
|
41
|
+
/** Server/controlled mode (AD-14): the consumer owns sort + paging. The table
|
|
42
|
+
renders `rows` verbatim, never sorts/slices a copy, derives the page count
|
|
43
|
+
from `total-items` (not `rows.length`), and emits intents only. */
|
|
44
|
+
server?: boolean;
|
|
45
|
+
|
|
46
|
+
/** Make rows clickable — emits xm-data-table-row-click (AD-15). */
|
|
47
|
+
rowClick?: boolean;
|
|
48
|
+
|
|
49
|
+
/** undefined */
|
|
50
|
+
pageSize?: XmDataTableElement["pageSize"];
|
|
51
|
+
|
|
52
|
+
/** undefined */
|
|
53
|
+
emptyHeading?: XmDataTableElement["emptyHeading"];
|
|
54
|
+
|
|
55
|
+
/** undefined */
|
|
56
|
+
emptyText?: XmDataTableElement["emptyText"];
|
|
57
|
+
|
|
58
|
+
/** Total item count for server-mode paging (pages = ceil(total-items/page-size)). */
|
|
59
|
+
totalItems?: XmDataTableElement["totalItems"];
|
|
60
|
+
|
|
61
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
62
|
+
className?: string;
|
|
63
|
+
|
|
64
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
65
|
+
exportparts?: string;
|
|
66
|
+
|
|
67
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
68
|
+
htmlFor?: string;
|
|
69
|
+
|
|
70
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
71
|
+
key?: number | string;
|
|
72
|
+
|
|
73
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
74
|
+
part?: string;
|
|
75
|
+
|
|
76
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
77
|
+
ref?: React.Ref<XmDataTableElement>;
|
|
78
|
+
|
|
79
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
80
|
+
tabIndex?: number;
|
|
81
|
+
|
|
82
|
+
/** Controlled sort indicator for server mode (`{ key, direction }`); reflected,
|
|
83
|
+
never reordered locally. */
|
|
84
|
+
sort?: XmDataTableElement["sort"];
|
|
85
|
+
|
|
86
|
+
/** Fired when the page changes (`detail.page`). */
|
|
87
|
+
onXmDataTablePageChange?: (event: XmDataTableElementEvent) => void;
|
|
88
|
+
|
|
89
|
+
/** Fired when the sort changes (`detail.key`, `detail.direction`). */
|
|
90
|
+
onXmDataTableSortChange?: (event: XmDataTableElementEvent) => void;
|
|
91
|
+
|
|
92
|
+
/** Fired when a clickable row is activated (`detail.row`, `detail.index`). */
|
|
93
|
+
onXmDataTableRowClick?: (event: XmDataTableElementEvent) => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
*
|
|
99
|
+
* ## Attributes & Properties
|
|
100
|
+
*
|
|
101
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
102
|
+
*
|
|
103
|
+
* - `loading`: undefined
|
|
104
|
+
* - `page-size`/`pageSize`: undefined
|
|
105
|
+
* - `empty-heading`/`emptyHeading`: undefined
|
|
106
|
+
* - `empty-text`/`emptyText`: undefined
|
|
107
|
+
* - `server`: Server/controlled mode (AD-14): the consumer owns sort + paging. The table
|
|
108
|
+
* renders `rows` verbatim, never sorts/slices a copy, derives the page count
|
|
109
|
+
* from `total-items` (not `rows.length`), and emits intents only.
|
|
110
|
+
* - `total-items`/`totalItems`: Total item count for server-mode paging (pages = ceil(total-items/page-size)).
|
|
111
|
+
* - `row-click`/`rowClick`: Make rows clickable — emits xm-data-table-row-click (AD-15).
|
|
112
|
+
* - `columns`: undefined (property only)
|
|
113
|
+
* - `rows`: undefined (property only)
|
|
114
|
+
* - `sort`: Controlled sort indicator for server mode (`{ key, direction }`); reflected,
|
|
115
|
+
* never reordered locally. (property only)
|
|
116
|
+
*
|
|
117
|
+
* ## Events
|
|
118
|
+
*
|
|
119
|
+
* Events that will be emitted by the component.
|
|
120
|
+
*
|
|
121
|
+
* - `xm-data-table-page-change`: Fired when the page changes (`detail.page`).
|
|
122
|
+
* - `xm-data-table-sort-change`: Fired when the sort changes (`detail.key`, `detail.direction`).
|
|
123
|
+
* - `xm-data-table-row-click`: Fired when a clickable row is activated (`detail.row`, `detail.index`).
|
|
124
|
+
*/
|
|
125
|
+
export const XmDataTable: React.ForwardRefExoticComponent<XmDataTableProps>;
|