@duyluonganduin/acl-web-components 0.0.48 → 0.0.49
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/dist/acl-web-components.cjs +1 -1
- package/dist/acl-web-components.d.ts +461 -0
- package/dist/acl-web-components.iife.js +707 -192
- package/dist/acl-web-components.js +115 -105
- package/dist/{anduin-date-picker-BHLmPYcA.cjs → anduin-table-BfJZTehD.cjs} +694 -179
- package/dist/{anduin-date-picker-oFZyH03y.js → anduin-table-q8DvvGim.js} +2704 -1601
- package/dist/jsx.d.ts +44 -0
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts +447 -0
- package/dist/react.js +186 -161
- package/package.json +1 -1
package/dist/jsx.d.ts
CHANGED
|
@@ -699,6 +699,50 @@ declare module 'react' {
|
|
|
699
699
|
/** Matches `anduin-field-label`'s `for` */
|
|
700
700
|
inputid?: string
|
|
701
701
|
}
|
|
702
|
+
|
|
703
|
+
// ── anduin-table ──────────────────────────────────────────────────────
|
|
704
|
+
// `columns`, `data`, and `selectedRows` are structured values — set them
|
|
705
|
+
// as properties (via a ref, or the `Table` React wrapper), not attributes.
|
|
706
|
+
'anduin-table': Base & {
|
|
707
|
+
/** 'fit-data' | 'fit-columns' | 'fit-data-fill' | 'fit-data-stretch' | 'fit-data-table' */
|
|
708
|
+
layout?: string
|
|
709
|
+
/** 'basic' | 'virtual' (default: 'basic'). 'virtual' needs a bounded height. */
|
|
710
|
+
'render-mode'?: string
|
|
711
|
+
/** Row height in px; virtual mode requires every row to match it */
|
|
712
|
+
'row-height'?: string
|
|
713
|
+
/** CSS height, e.g. `80vh` */
|
|
714
|
+
height?: string
|
|
715
|
+
/** CSS max-height, e.g. `600px` */
|
|
716
|
+
'max-height'?: string
|
|
717
|
+
/** CSS min-height */
|
|
718
|
+
'min-height'?: string
|
|
719
|
+
/** Render without column headings */
|
|
720
|
+
'hide-header'?: boolean
|
|
721
|
+
/** Cover the table with a loading indicator */
|
|
722
|
+
loading?: boolean
|
|
723
|
+
/** 'unselectable' | 'clickable' | 'selectable' | 'selectable-by-clicking' | 'selectable-by-dragging' */
|
|
724
|
+
selectable?: string
|
|
725
|
+
/** Field holding each row's unique id (default: 'id') */
|
|
726
|
+
'index-column'?: string
|
|
727
|
+
/** Table-wide horizontal alignment: 'left' | 'center' | 'right' */
|
|
728
|
+
'column-align'?: string
|
|
729
|
+
/** Table-wide vertical alignment: 'top' | 'middle' | 'bottom' */
|
|
730
|
+
'column-vertical-align'?: string
|
|
731
|
+
/** Field the table is sorted by */
|
|
732
|
+
'sort-field'?: string
|
|
733
|
+
/** 'asc' | 'desc' (default: 'asc') */
|
|
734
|
+
'sort-direction'?: string
|
|
735
|
+
/** Treat `data` as a tree of nested rows */
|
|
736
|
+
'data-tree'?: boolean
|
|
737
|
+
/** Field holding a row's children in tree mode (default: 'children') */
|
|
738
|
+
'tree-children-field'?: string
|
|
739
|
+
/** Pixels of indentation per tree level (default: 20) */
|
|
740
|
+
'tree-child-indent'?: string
|
|
741
|
+
/** Group rows by this field */
|
|
742
|
+
'group-by'?: string
|
|
743
|
+
/** Drag a column edge to resize; on by default. Pass "false" to disable. */
|
|
744
|
+
'resizable-columns'?: string
|
|
745
|
+
}
|
|
702
746
|
}
|
|
703
747
|
}
|
|
704
748
|
}
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("@lit/react"),e=require("./anduin-date-picker-BHLmPYcA.cjs"),t=a.createComponent({react:n,tagName:"anduin-spinner",elementClass:e.AnduinSpinner}),o=a.createComponent({react:n,tagName:"anduin-sparkle-spinner",elementClass:e.AnduinSparkleSpinner}),i=a.createComponent({react:n,tagName:"anduin-icon",elementClass:e.AnduinIcon}),r=a.createComponent({react:n,tagName:"anduin-badge",elementClass:e.AnduinBadge}),s=a.createComponent({react:n,tagName:"anduin-badge-count",elementClass:e.AnduinBadgeCount}),l=a.createComponent({react:n,tagName:"anduin-button",elementClass:e.AnduinButton}),C=a.createComponent({react:n,tagName:"anduin-callout",elementClass:e.AnduinCallout}),d=a.createComponent({react:n,tagName:"anduin-divider",elementClass:e.AnduinDivider}),c=a.createComponent({react:n,tagName:"anduin-dot",elementClass:e.AnduinDot}),m=a.createComponent({react:n,tagName:"anduin-progress",elementClass:e.AnduinProgress}),u=a.createComponent({react:n,tagName:"anduin-skeleton",elementClass:e.AnduinSkeleton}),E=a.createComponent({react:n,tagName:"anduin-loading-state",elementClass:e.AnduinLoadingState}),g=a.createComponent({react:n,tagName:"anduin-field",elementClass:e.AnduinField}),A=a.createComponent({react:n,tagName:"anduin-field-label",elementClass:e.AnduinFieldLabel}),N=a.createComponent({react:n,tagName:"anduin-field-description",elementClass:e.AnduinFieldDescription}),p=a.createComponent({react:n,tagName:"anduin-field-error",elementClass:e.AnduinFieldError}),T=a.createComponent({react:n,tagName:"anduin-field-group",elementClass:e.AnduinFieldGroup}),_=a.createComponent({react:n,tagName:"anduin-radio",elementClass:e.AnduinRadio,events:{onChange:e.RADIO_CHANGE}}),G=a.createComponent({react:n,tagName:"anduin-radio-group",elementClass:e.AnduinRadioGroup,events:{onChange:e.RADIO_GROUP_CHANGE}}),S=a.createComponent({react:n,tagName:"anduin-checkbox",elementClass:e.AnduinCheckbox,events:{onChange:e.CHECKBOX_CHANGE}}),R=a.createComponent({react:n,tagName:"anduin-input",elementClass:e.AnduinInput,events:{onChange:e.INPUT_CHANGE,onClear:e.INPUT_CLEAR}}),b=a.createComponent({react:n,tagName:"anduin-textarea",elementClass:e.AnduinTextarea,events:{onChange:e.TEXTAREA_CHANGE}}),I=a.createComponent({react:n,tagName:"anduin-popover",elementClass:e.AnduinPopover,events:{onOpenChange:e.POPOVER_OPEN_CHANGE}}),O=a.createComponent({react:n,tagName:"anduin-popover-close",elementClass:e.AnduinPopoverClose}),L=a.createComponent({react:n,tagName:"anduin-menu",elementClass:e.AnduinMenu}),D=a.createComponent({react:n,tagName:"anduin-menu-item",elementClass:e.AnduinMenuItem}),P=a.createComponent({react:n,tagName:"anduin-modal",elementClass:e.AnduinModal,events:{onClose:e.MODAL_CLOSE_EVENT,onAfterClose:e.MODAL_AFTER_CLOSE_EVENT}}),H=a.createComponent({react:n,tagName:"anduin-modal-close",elementClass:e.AnduinModalClose}),v=a.createComponent({react:n,tagName:"anduin-tabs",elementClass:e.AnduinTabs,events:{onChange:e.TAB_CHANGE}}),M=a.createComponent({react:n,tagName:"anduin-tabs-list",elementClass:e.AnduinTabsList}),U=a.createComponent({react:n,tagName:"anduin-tab-trigger",elementClass:e.AnduinTabTrigger}),F=a.createComponent({react:n,tagName:"anduin-tab-content",elementClass:e.AnduinTabContent}),h=a.createComponent({react:n,tagName:"anduin-tag",elementClass:e.AnduinTag}),V=a.createComponent({react:n,tagName:"anduin-tag-close",elementClass:e.AnduinTagClose,events:{onClick:e.TAG_CLOSE_CLICK}}),B=a.createComponent({react:n,tagName:"anduin-toggle-group",elementClass:e.AnduinToggleGroup,events:{onChange:e.TOGGLE_GROUP_CHANGE}}),W=a.createComponent({react:n,tagName:"anduin-toggle-group-item",elementClass:e.AnduinToggleGroupItem,events:{onChange:e.TOGGLE_GROUP_ITEM_CHANGE,onSelect:e.TOGGLE_GROUP_ITEM_SELECT,onDeselect:e.TOGGLE_GROUP_ITEM_DESELECT}}),k=a.createComponent({react:n,tagName:"anduin-tooltip",elementClass:e.AnduinTooltip}),w=a.createComponent({react:n,tagName:"anduin-tooltip-trigger",elementClass:e.AnduinTooltipTrigger}),f=a.createComponent({react:n,tagName:"anduin-tooltip-content",elementClass:e.AnduinTooltipContent}),K=a.createComponent({react:n,tagName:"anduin-well",elementClass:e.AnduinWell}),z=a.createComponent({react:n,tagName:"anduin-well-close",elementClass:e.AnduinWellClose,events:{onClick:e.WELL_CLOSE_CLICK}}),x=a.createComponent({react:n,tagName:"anduin-avatar",elementClass:e.AnduinAvatar}),X=a.createComponent({react:n,tagName:"anduin-file-icon",elementClass:e.AnduinFileIcon}),q=a.createComponent({react:n,tagName:"anduin-toast",elementClass:e.AnduinToast}),Z=a.createComponent({react:n,tagName:"anduin-toaster",elementClass:e.AnduinToaster}),y=a.createComponent({react:n,tagName:"anduin-dropdown",elementClass:e.AnduinDropdown,events:{onChange:e.DROPDOWN_CHANGE}}),j=a.createComponent({react:n,tagName:"anduin-drawer",elementClass:e.AnduinDrawer,events:{onClose:e.DRAWER_CLOSE_EVENT,onAfterClose:e.DRAWER_AFTER_CLOSE_EVENT}}),J=a.createComponent({react:n,tagName:"anduin-drawer-close",elementClass:e.AnduinDrawerClose}),Q=a.createComponent({react:n,tagName:"anduin-switcher",elementClass:e.AnduinSwitcher,events:{onChange:e.SWITCHER_CHANGE}}),Y=a.createComponent({react:n,tagName:"anduin-suggestion",elementClass:e.AnduinSuggestion,events:{onChange:e.SUGGESTION_CHANGE,onSelect:e.SUGGESTION_SELECT,onClear:e.SUGGESTION_CLEAR}}),$=a.createComponent({react:n,tagName:"anduin-navigation",elementClass:e.AnduinNavigation,events:{onChange:e.NAVIGATION_CHANGE}}),ee=a.createComponent({react:n,tagName:"anduin-navigation-item",elementClass:e.AnduinNavigationItem}),ne=a.createComponent({react:n,tagName:"anduin-resizable-panel-group",elementClass:e.AnduinResizablePanelGroup}),ae=a.createComponent({react:n,tagName:"anduin-resizable-panel",elementClass:e.AnduinResizablePanel}),te=a.createComponent({react:n,tagName:"anduin-resizable-handle",elementClass:e.AnduinResizableHandle,events:{onResize:e.RESIZE_EVENT}}),oe=a.createComponent({react:n,tagName:"anduin-pagination",elementClass:e.AnduinPagination,events:{onValueChange:e.PAGINATION_CHANGE}}),ie=a.createComponent({react:n,tagName:"anduin-pagination-first-page",elementClass:e.AnduinPaginationFirstPage}),re=a.createComponent({react:n,tagName:"anduin-pagination-last-page",elementClass:e.AnduinPaginationLastPage}),se=a.createComponent({react:n,tagName:"anduin-sidebar",elementClass:e.AnduinSidebar}),le=a.createComponent({react:n,tagName:"anduin-sidebar-content",elementClass:e.AnduinSidebarContent}),Ce=a.createComponent({react:n,tagName:"anduin-sidebar-header",elementClass:e.AnduinSidebarHeader}),de=a.createComponent({react:n,tagName:"anduin-sidebar-footer",elementClass:e.AnduinSidebarFooter}),ce=a.createComponent({react:n,tagName:"anduin-sidebar-group",elementClass:e.AnduinSidebarGroup}),me=a.createComponent({react:n,tagName:"anduin-sidebar-group-label",elementClass:e.AnduinSidebarGroupLabel}),ue=a.createComponent({react:n,tagName:"anduin-sidebar-menu",elementClass:e.AnduinSidebarMenu}),Ee=a.createComponent({react:n,tagName:"anduin-sidebar-menu-item",elementClass:e.AnduinSidebarMenuItem,events:{onSelect:e.SIDEBAR_SELECT}}),ge=a.createComponent({react:n,tagName:"anduin-sidebar-action",elementClass:e.AnduinSidebarAction}),Ae=a.createComponent({react:n,tagName:"anduin-sidebar-badge",elementClass:e.AnduinSidebarBadge}),Ne=a.createComponent({react:n,tagName:"anduin-sidebar-separator",elementClass:e.AnduinSidebarSeparator}),pe=a.createComponent({react:n,tagName:"anduin-timeline",elementClass:e.AnduinTimeline}),Te=a.createComponent({react:n,tagName:"anduin-timeline-item",elementClass:e.AnduinTimelineItem}),_e=a.createComponent({react:n,tagName:"anduin-timeline-date",elementClass:e.AnduinTimelineDate}),Ge=a.createComponent({react:n,tagName:"anduin-timeline-title",elementClass:e.AnduinTimelineTitle}),Se=a.createComponent({react:n,tagName:"anduin-timeline-group",elementClass:e.AnduinTimelineGroup}),Re=a.createComponent({react:n,tagName:"anduin-timeline-label",elementClass:e.AnduinTimelineLabel}),be=a.createComponent({react:n,tagName:"anduin-calendar",elementClass:e.AnduinCalendar,events:{onValueChange:e.CALENDAR_CHANGE}}),Ie=a.createComponent({react:n,tagName:"anduin-date-range",elementClass:e.AnduinDateRange,events:{onChange:e.DATE_RANGE_CHANGE}}),Oe=a.createComponent({react:n,tagName:"anduin-date-range-default",elementClass:e.AnduinDateRangeDefault}),Le=a.createComponent({react:n,tagName:"anduin-date-range-start",elementClass:e.AnduinDateRangeStart}),De=a.createComponent({react:n,tagName:"anduin-date-range-end",elementClass:e.AnduinDateRangeEnd}),Pe=a.createComponent({react:n,tagName:"anduin-date-input",elementClass:e.AnduinDateInput,events:{onValueChange:e.DATE_INPUT_CHANGE}}),He=a.createComponent({react:n,tagName:"anduin-date-picker",elementClass:e.AnduinDatePicker,events:{onValueChange:e.DATE_PICKER_CHANGE}});exports.CALENDAR_CHANGE=e.CALENDAR_CHANGE;exports.CHECKBOX_CHANGE=e.CHECKBOX_CHANGE;exports.DATE_INPUT_CHANGE=e.DATE_INPUT_CHANGE;exports.DATE_PICKER_CHANGE=e.DATE_PICKER_CHANGE;exports.DATE_RANGE_CHANGE=e.DATE_RANGE_CHANGE;exports.DRAWER_AFTER_CLOSE_EVENT=e.DRAWER_AFTER_CLOSE_EVENT;exports.DRAWER_CLOSE_EVENT=e.DRAWER_CLOSE_EVENT;exports.DROPDOWN_CHANGE=e.DROPDOWN_CHANGE;exports.INPUT_CHANGE=e.INPUT_CHANGE;exports.INPUT_CLEAR=e.INPUT_CLEAR;exports.MENU_ITEM_CLICK=e.MENU_ITEM_CLICK;exports.MODAL_AFTER_CLOSE_EVENT=e.MODAL_AFTER_CLOSE_EVENT;exports.MODAL_CLOSE_EVENT=e.MODAL_CLOSE_EVENT;exports.NAVIGATION_CHANGE=e.NAVIGATION_CHANGE;exports.PAGINATION_CHANGE=e.PAGINATION_CHANGE;exports.POPOVER_OPEN_CHANGE=e.POPOVER_OPEN_CHANGE;exports.RADIO_CHANGE=e.RADIO_CHANGE;exports.RADIO_GROUP_CHANGE=e.RADIO_GROUP_CHANGE;exports.RESIZE_EVENT=e.RESIZE_EVENT;exports.SIDEBAR_SELECT=e.SIDEBAR_SELECT;exports.SUGGESTION_CHANGE=e.SUGGESTION_CHANGE;exports.SUGGESTION_CLEAR=e.SUGGESTION_CLEAR;exports.SUGGESTION_SELECT=e.SUGGESTION_SELECT;exports.SWITCHER_CHANGE=e.SWITCHER_CHANGE;exports.TAB_CHANGE=e.TAB_CHANGE;exports.TAG_CLOSE_CLICK=e.TAG_CLOSE_CLICK;exports.TEXTAREA_CHANGE=e.TEXTAREA_CHANGE;exports.TOGGLE_GROUP_CHANGE=e.TOGGLE_GROUP_CHANGE;exports.TOGGLE_GROUP_ITEM_CHANGE=e.TOGGLE_GROUP_ITEM_CHANGE;exports.TOGGLE_GROUP_ITEM_DESELECT=e.TOGGLE_GROUP_ITEM_DESELECT;exports.TOGGLE_GROUP_ITEM_SELECT=e.TOGGLE_GROUP_ITEM_SELECT;exports.WELL_CLOSE_CLICK=e.WELL_CLOSE_CLICK;exports.Avatar=x;exports.Badge=r;exports.BadgeCount=s;exports.Button=l;exports.Calendar=be;exports.Callout=C;exports.Checkbox=S;exports.DateInput=Pe;exports.DatePicker=He;exports.DateRange=Ie;exports.DateRangeDefault=Oe;exports.DateRangeEnd=De;exports.DateRangeStart=Le;exports.Divider=d;exports.Dot=c;exports.Drawer=j;exports.DrawerClose=J;exports.Dropdown=y;exports.Field=g;exports.FieldDescription=N;exports.FieldError=p;exports.FieldGroup=T;exports.FieldLabel=A;exports.FileIcon=X;exports.Icon=i;exports.Input=R;exports.LoadingState=E;exports.Menu=L;exports.MenuItem=D;exports.Modal=P;exports.ModalClose=H;exports.Navigation=$;exports.NavigationItem=ee;exports.Pagination=oe;exports.PaginationFirstPage=ie;exports.PaginationLastPage=re;exports.Popover=I;exports.PopoverClose=O;exports.Progress=m;exports.Radio=_;exports.RadioGroup=G;exports.ResizableHandle=te;exports.ResizablePanel=ae;exports.ResizablePanelGroup=ne;exports.Sidebar=se;exports.SidebarAction=ge;exports.SidebarBadge=Ae;exports.SidebarContent=le;exports.SidebarFooter=de;exports.SidebarGroup=ce;exports.SidebarGroupLabel=me;exports.SidebarHeader=Ce;exports.SidebarMenu=ue;exports.SidebarMenuItem=Ee;exports.SidebarSeparator=Ne;exports.Skeleton=u;exports.SparkleSpinner=o;exports.Spinner=t;exports.Suggestion=Y;exports.Switcher=Q;exports.TabContent=F;exports.TabTrigger=U;exports.Tabs=v;exports.TabsList=M;exports.Tag=h;exports.TagClose=V;exports.Textarea=b;exports.Timeline=pe;exports.TimelineDate=_e;exports.TimelineGroup=Se;exports.TimelineItem=Te;exports.TimelineLabel=Re;exports.TimelineTitle=Ge;exports.Toast=q;exports.Toaster=Z;exports.ToggleGroup=B;exports.ToggleGroupItem=W;exports.Tooltip=k;exports.TooltipContent=f;exports.TooltipTrigger=w;exports.Well=K;exports.WellClose=z;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("@lit/react"),e=require("./anduin-table-BfJZTehD.cjs"),t=a.createComponent({react:n,tagName:"anduin-spinner",elementClass:e.AnduinSpinner}),o=a.createComponent({react:n,tagName:"anduin-sparkle-spinner",elementClass:e.AnduinSparkleSpinner}),i=a.createComponent({react:n,tagName:"anduin-icon",elementClass:e.AnduinIcon}),r=a.createComponent({react:n,tagName:"anduin-badge",elementClass:e.AnduinBadge}),C=a.createComponent({react:n,tagName:"anduin-badge-count",elementClass:e.AnduinBadgeCount}),s=a.createComponent({react:n,tagName:"anduin-button",elementClass:e.AnduinButton}),l=a.createComponent({react:n,tagName:"anduin-callout",elementClass:e.AnduinCallout}),c=a.createComponent({react:n,tagName:"anduin-divider",elementClass:e.AnduinDivider}),d=a.createComponent({react:n,tagName:"anduin-dot",elementClass:e.AnduinDot}),m=a.createComponent({react:n,tagName:"anduin-progress",elementClass:e.AnduinProgress}),E=a.createComponent({react:n,tagName:"anduin-skeleton",elementClass:e.AnduinSkeleton}),u=a.createComponent({react:n,tagName:"anduin-loading-state",elementClass:e.AnduinLoadingState}),A=a.createComponent({react:n,tagName:"anduin-field",elementClass:e.AnduinField}),g=a.createComponent({react:n,tagName:"anduin-field-label",elementClass:e.AnduinFieldLabel}),N=a.createComponent({react:n,tagName:"anduin-field-description",elementClass:e.AnduinFieldDescription}),T=a.createComponent({react:n,tagName:"anduin-field-error",elementClass:e.AnduinFieldError}),_=a.createComponent({react:n,tagName:"anduin-field-group",elementClass:e.AnduinFieldGroup}),p=a.createComponent({react:n,tagName:"anduin-radio",elementClass:e.AnduinRadio,events:{onChange:e.RADIO_CHANGE}}),G=a.createComponent({react:n,tagName:"anduin-radio-group",elementClass:e.AnduinRadioGroup,events:{onChange:e.RADIO_GROUP_CHANGE}}),L=a.createComponent({react:n,tagName:"anduin-checkbox",elementClass:e.AnduinCheckbox,events:{onChange:e.CHECKBOX_CHANGE}}),S=a.createComponent({react:n,tagName:"anduin-input",elementClass:e.AnduinInput,events:{onChange:e.INPUT_CHANGE,onClear:e.INPUT_CLEAR}}),O=a.createComponent({react:n,tagName:"anduin-textarea",elementClass:e.AnduinTextarea,events:{onChange:e.TEXTAREA_CHANGE}}),R=a.createComponent({react:n,tagName:"anduin-popover",elementClass:e.AnduinPopover,events:{onOpenChange:e.POPOVER_OPEN_CHANGE}}),I=a.createComponent({react:n,tagName:"anduin-popover-close",elementClass:e.AnduinPopoverClose}),b=a.createComponent({react:n,tagName:"anduin-menu",elementClass:e.AnduinMenu}),D=a.createComponent({react:n,tagName:"anduin-menu-item",elementClass:e.AnduinMenuItem}),P=a.createComponent({react:n,tagName:"anduin-modal",elementClass:e.AnduinModal,events:{onClose:e.MODAL_CLOSE_EVENT,onAfterClose:e.MODAL_AFTER_CLOSE_EVENT}}),H=a.createComponent({react:n,tagName:"anduin-modal-close",elementClass:e.AnduinModalClose}),v=a.createComponent({react:n,tagName:"anduin-tabs",elementClass:e.AnduinTabs,events:{onChange:e.TAB_CHANGE}}),B=a.createComponent({react:n,tagName:"anduin-tabs-list",elementClass:e.AnduinTabsList}),M=a.createComponent({react:n,tagName:"anduin-tab-trigger",elementClass:e.AnduinTabTrigger}),U=a.createComponent({react:n,tagName:"anduin-tab-content",elementClass:e.AnduinTabContent}),F=a.createComponent({react:n,tagName:"anduin-tag",elementClass:e.AnduinTag}),W=a.createComponent({react:n,tagName:"anduin-tag-close",elementClass:e.AnduinTagClose,events:{onClick:e.TAG_CLOSE_CLICK}}),h=a.createComponent({react:n,tagName:"anduin-toggle-group",elementClass:e.AnduinToggleGroup,events:{onChange:e.TOGGLE_GROUP_CHANGE}}),V=a.createComponent({react:n,tagName:"anduin-toggle-group-item",elementClass:e.AnduinToggleGroupItem,events:{onChange:e.TOGGLE_GROUP_ITEM_CHANGE,onSelect:e.TOGGLE_GROUP_ITEM_SELECT,onDeselect:e.TOGGLE_GROUP_ITEM_DESELECT}}),w=a.createComponent({react:n,tagName:"anduin-tooltip",elementClass:e.AnduinTooltip}),k=a.createComponent({react:n,tagName:"anduin-tooltip-trigger",elementClass:e.AnduinTooltipTrigger}),K=a.createComponent({react:n,tagName:"anduin-tooltip-content",elementClass:e.AnduinTooltipContent}),f=a.createComponent({react:n,tagName:"anduin-well",elementClass:e.AnduinWell}),z=a.createComponent({react:n,tagName:"anduin-well-close",elementClass:e.AnduinWellClose,events:{onClick:e.WELL_CLOSE_CLICK}}),X=a.createComponent({react:n,tagName:"anduin-avatar",elementClass:e.AnduinAvatar}),x=a.createComponent({react:n,tagName:"anduin-file-icon",elementClass:e.AnduinFileIcon}),Z=a.createComponent({react:n,tagName:"anduin-toast",elementClass:e.AnduinToast}),q=a.createComponent({react:n,tagName:"anduin-toaster",elementClass:e.AnduinToaster}),y=a.createComponent({react:n,tagName:"anduin-dropdown",elementClass:e.AnduinDropdown,events:{onChange:e.DROPDOWN_CHANGE}}),j=a.createComponent({react:n,tagName:"anduin-drawer",elementClass:e.AnduinDrawer,events:{onClose:e.DRAWER_CLOSE_EVENT,onAfterClose:e.DRAWER_AFTER_CLOSE_EVENT}}),J=a.createComponent({react:n,tagName:"anduin-drawer-close",elementClass:e.AnduinDrawerClose}),Q=a.createComponent({react:n,tagName:"anduin-switcher",elementClass:e.AnduinSwitcher,events:{onChange:e.SWITCHER_CHANGE}}),Y=a.createComponent({react:n,tagName:"anduin-suggestion",elementClass:e.AnduinSuggestion,events:{onChange:e.SUGGESTION_CHANGE,onSelect:e.SUGGESTION_SELECT,onClear:e.SUGGESTION_CLEAR}}),$=a.createComponent({react:n,tagName:"anduin-navigation",elementClass:e.AnduinNavigation,events:{onChange:e.NAVIGATION_CHANGE}}),ee=a.createComponent({react:n,tagName:"anduin-navigation-item",elementClass:e.AnduinNavigationItem}),ne=a.createComponent({react:n,tagName:"anduin-resizable-panel-group",elementClass:e.AnduinResizablePanelGroup}),ae=a.createComponent({react:n,tagName:"anduin-resizable-panel",elementClass:e.AnduinResizablePanel}),te=a.createComponent({react:n,tagName:"anduin-resizable-handle",elementClass:e.AnduinResizableHandle,events:{onResize:e.RESIZE_EVENT}}),oe=a.createComponent({react:n,tagName:"anduin-pagination",elementClass:e.AnduinPagination,events:{onValueChange:e.PAGINATION_CHANGE}}),ie=a.createComponent({react:n,tagName:"anduin-pagination-first-page",elementClass:e.AnduinPaginationFirstPage}),re=a.createComponent({react:n,tagName:"anduin-pagination-last-page",elementClass:e.AnduinPaginationLastPage}),Ce=a.createComponent({react:n,tagName:"anduin-sidebar",elementClass:e.AnduinSidebar}),se=a.createComponent({react:n,tagName:"anduin-sidebar-content",elementClass:e.AnduinSidebarContent}),le=a.createComponent({react:n,tagName:"anduin-sidebar-header",elementClass:e.AnduinSidebarHeader}),ce=a.createComponent({react:n,tagName:"anduin-sidebar-footer",elementClass:e.AnduinSidebarFooter}),de=a.createComponent({react:n,tagName:"anduin-sidebar-group",elementClass:e.AnduinSidebarGroup}),me=a.createComponent({react:n,tagName:"anduin-sidebar-group-label",elementClass:e.AnduinSidebarGroupLabel}),Ee=a.createComponent({react:n,tagName:"anduin-sidebar-menu",elementClass:e.AnduinSidebarMenu}),ue=a.createComponent({react:n,tagName:"anduin-sidebar-menu-item",elementClass:e.AnduinSidebarMenuItem,events:{onSelect:e.SIDEBAR_SELECT}}),Ae=a.createComponent({react:n,tagName:"anduin-sidebar-action",elementClass:e.AnduinSidebarAction}),ge=a.createComponent({react:n,tagName:"anduin-sidebar-badge",elementClass:e.AnduinSidebarBadge}),Ne=a.createComponent({react:n,tagName:"anduin-sidebar-separator",elementClass:e.AnduinSidebarSeparator}),Te=a.createComponent({react:n,tagName:"anduin-timeline",elementClass:e.AnduinTimeline}),_e=a.createComponent({react:n,tagName:"anduin-timeline-item",elementClass:e.AnduinTimelineItem}),pe=a.createComponent({react:n,tagName:"anduin-timeline-date",elementClass:e.AnduinTimelineDate}),Ge=a.createComponent({react:n,tagName:"anduin-timeline-title",elementClass:e.AnduinTimelineTitle}),Le=a.createComponent({react:n,tagName:"anduin-timeline-group",elementClass:e.AnduinTimelineGroup}),Se=a.createComponent({react:n,tagName:"anduin-timeline-label",elementClass:e.AnduinTimelineLabel}),Oe=a.createComponent({react:n,tagName:"anduin-calendar",elementClass:e.AnduinCalendar,events:{onValueChange:e.CALENDAR_CHANGE}}),Re=a.createComponent({react:n,tagName:"anduin-date-range",elementClass:e.AnduinDateRange,events:{onChange:e.DATE_RANGE_CHANGE}}),Ie=a.createComponent({react:n,tagName:"anduin-date-range-default",elementClass:e.AnduinDateRangeDefault}),be=a.createComponent({react:n,tagName:"anduin-date-range-start",elementClass:e.AnduinDateRangeStart}),De=a.createComponent({react:n,tagName:"anduin-date-range-end",elementClass:e.AnduinDateRangeEnd}),Pe=a.createComponent({react:n,tagName:"anduin-date-input",elementClass:e.AnduinDateInput,events:{onValueChange:e.DATE_INPUT_CHANGE}}),He=a.createComponent({react:n,tagName:"anduin-date-picker",elementClass:e.AnduinDatePicker,events:{onValueChange:e.DATE_PICKER_CHANGE}}),ve=a.createComponent({react:n,tagName:"anduin-table",elementClass:e.AnduinTable,events:{onSort:e.TABLE_SORT,onColumnClick:e.TABLE_COLUMN_CLICK,onRowClick:e.TABLE_ROW_CLICK,onSelectionChange:e.TABLE_SELECTION_CHANGE,onCellContextMenu:e.TABLE_CELL_CONTEXT_MENU,onRowExpand:e.TABLE_ROW_EXPAND,onRowCollapse:e.TABLE_ROW_COLLAPSE,onGroupToggle:e.TABLE_GROUP_TOGGLE,onColumnResize:e.TABLE_COLUMN_RESIZE}});exports.CALENDAR_CHANGE=e.CALENDAR_CHANGE;exports.CHECKBOX_CHANGE=e.CHECKBOX_CHANGE;exports.DATE_INPUT_CHANGE=e.DATE_INPUT_CHANGE;exports.DATE_PICKER_CHANGE=e.DATE_PICKER_CHANGE;exports.DATE_RANGE_CHANGE=e.DATE_RANGE_CHANGE;exports.DRAWER_AFTER_CLOSE_EVENT=e.DRAWER_AFTER_CLOSE_EVENT;exports.DRAWER_CLOSE_EVENT=e.DRAWER_CLOSE_EVENT;exports.DROPDOWN_CHANGE=e.DROPDOWN_CHANGE;exports.INPUT_CHANGE=e.INPUT_CHANGE;exports.INPUT_CLEAR=e.INPUT_CLEAR;exports.MENU_ITEM_CLICK=e.MENU_ITEM_CLICK;exports.MODAL_AFTER_CLOSE_EVENT=e.MODAL_AFTER_CLOSE_EVENT;exports.MODAL_CLOSE_EVENT=e.MODAL_CLOSE_EVENT;exports.NAVIGATION_CHANGE=e.NAVIGATION_CHANGE;exports.PAGINATION_CHANGE=e.PAGINATION_CHANGE;exports.POPOVER_OPEN_CHANGE=e.POPOVER_OPEN_CHANGE;exports.RADIO_CHANGE=e.RADIO_CHANGE;exports.RADIO_GROUP_CHANGE=e.RADIO_GROUP_CHANGE;exports.RESIZE_EVENT=e.RESIZE_EVENT;exports.SIDEBAR_SELECT=e.SIDEBAR_SELECT;exports.SUGGESTION_CHANGE=e.SUGGESTION_CHANGE;exports.SUGGESTION_CLEAR=e.SUGGESTION_CLEAR;exports.SUGGESTION_SELECT=e.SUGGESTION_SELECT;exports.SWITCHER_CHANGE=e.SWITCHER_CHANGE;exports.TABLE_CELL_CONTEXT_MENU=e.TABLE_CELL_CONTEXT_MENU;exports.TABLE_COLUMN_CLICK=e.TABLE_COLUMN_CLICK;exports.TABLE_COLUMN_RESIZE=e.TABLE_COLUMN_RESIZE;exports.TABLE_GROUP_TOGGLE=e.TABLE_GROUP_TOGGLE;exports.TABLE_ROW_CLICK=e.TABLE_ROW_CLICK;exports.TABLE_ROW_COLLAPSE=e.TABLE_ROW_COLLAPSE;exports.TABLE_ROW_EXPAND=e.TABLE_ROW_EXPAND;exports.TABLE_SELECTION_CHANGE=e.TABLE_SELECTION_CHANGE;exports.TABLE_SORT=e.TABLE_SORT;exports.TAB_CHANGE=e.TAB_CHANGE;exports.TAG_CLOSE_CLICK=e.TAG_CLOSE_CLICK;exports.TEXTAREA_CHANGE=e.TEXTAREA_CHANGE;exports.TOGGLE_GROUP_CHANGE=e.TOGGLE_GROUP_CHANGE;exports.TOGGLE_GROUP_ITEM_CHANGE=e.TOGGLE_GROUP_ITEM_CHANGE;exports.TOGGLE_GROUP_ITEM_DESELECT=e.TOGGLE_GROUP_ITEM_DESELECT;exports.TOGGLE_GROUP_ITEM_SELECT=e.TOGGLE_GROUP_ITEM_SELECT;exports.WELL_CLOSE_CLICK=e.WELL_CLOSE_CLICK;exports.Avatar=X;exports.Badge=r;exports.BadgeCount=C;exports.Button=s;exports.Calendar=Oe;exports.Callout=l;exports.Checkbox=L;exports.DateInput=Pe;exports.DatePicker=He;exports.DateRange=Re;exports.DateRangeDefault=Ie;exports.DateRangeEnd=De;exports.DateRangeStart=be;exports.Divider=c;exports.Dot=d;exports.Drawer=j;exports.DrawerClose=J;exports.Dropdown=y;exports.Field=A;exports.FieldDescription=N;exports.FieldError=T;exports.FieldGroup=_;exports.FieldLabel=g;exports.FileIcon=x;exports.Icon=i;exports.Input=S;exports.LoadingState=u;exports.Menu=b;exports.MenuItem=D;exports.Modal=P;exports.ModalClose=H;exports.Navigation=$;exports.NavigationItem=ee;exports.Pagination=oe;exports.PaginationFirstPage=ie;exports.PaginationLastPage=re;exports.Popover=R;exports.PopoverClose=I;exports.Progress=m;exports.Radio=p;exports.RadioGroup=G;exports.ResizableHandle=te;exports.ResizablePanel=ae;exports.ResizablePanelGroup=ne;exports.Sidebar=Ce;exports.SidebarAction=Ae;exports.SidebarBadge=ge;exports.SidebarContent=se;exports.SidebarFooter=ce;exports.SidebarGroup=de;exports.SidebarGroupLabel=me;exports.SidebarHeader=le;exports.SidebarMenu=Ee;exports.SidebarMenuItem=ue;exports.SidebarSeparator=Ne;exports.Skeleton=E;exports.SparkleSpinner=o;exports.Spinner=t;exports.Suggestion=Y;exports.Switcher=Q;exports.TabContent=U;exports.TabTrigger=M;exports.Table=ve;exports.Tabs=v;exports.TabsList=B;exports.Tag=F;exports.TagClose=W;exports.Textarea=O;exports.Timeline=Te;exports.TimelineDate=pe;exports.TimelineGroup=Le;exports.TimelineItem=_e;exports.TimelineLabel=Se;exports.TimelineTitle=Ge;exports.Toast=Z;exports.Toaster=q;exports.ToggleGroup=h;exports.ToggleGroupItem=V;exports.Tooltip=w;exports.TooltipContent=K;exports.TooltipTrigger=k;exports.Well=f;exports.WellClose=z;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import { nothing } from 'lit';
|
|
4
|
+
import { PropertyValues } from 'lit';
|
|
4
5
|
import { ReactWebComponent } from '@lit/react';
|
|
5
6
|
import { TemplateResult } from 'lit-html';
|
|
6
7
|
|
|
@@ -1022,6 +1023,229 @@ declare class AnduinTabContent extends LitElement {
|
|
|
1022
1023
|
render(): TemplateResult<1>;
|
|
1023
1024
|
}
|
|
1024
1025
|
|
|
1026
|
+
/**
|
|
1027
|
+
* anduin-table — displays tabular data with sorting, frozen columns, row
|
|
1028
|
+
* selection, tree data, grouping, and virtual scrolling.
|
|
1029
|
+
*
|
|
1030
|
+
* Columns and data are set as JS properties rather than attributes, because
|
|
1031
|
+
* both are structured values:
|
|
1032
|
+
*
|
|
1033
|
+
* @example
|
|
1034
|
+
* const table = document.querySelector('anduin-table')
|
|
1035
|
+
* table.columns = [
|
|
1036
|
+
* { type: 'selection' },
|
|
1037
|
+
* { field: 'fullName', title: 'Full name', isSortable: true, isFrozen: true },
|
|
1038
|
+
* { field: 'email', title: 'Email address', width: 220 },
|
|
1039
|
+
* { field: 'address.city', title: 'City' },
|
|
1040
|
+
* ]
|
|
1041
|
+
* table.data = employees
|
|
1042
|
+
*
|
|
1043
|
+
* Layout, height, loading, and selection behaviour are plain attributes:
|
|
1044
|
+
*
|
|
1045
|
+
* @example
|
|
1046
|
+
* <anduin-table layout="fit-columns" max-height="480px" selectable="selectable">
|
|
1047
|
+
* <div slot="empty">No employees found</div>
|
|
1048
|
+
* </anduin-table>
|
|
1049
|
+
*/
|
|
1050
|
+
declare class AnduinTable extends LitElement {
|
|
1051
|
+
static styles: CSSResult;
|
|
1052
|
+
/** The columns to render, in display order. Set as a property, not an attribute. */
|
|
1053
|
+
columns: TableAnyColumn<any>[];
|
|
1054
|
+
/** The rows to render. Set as a property, not an attribute. */
|
|
1055
|
+
data: any[];
|
|
1056
|
+
/** How column widths are resolved. */
|
|
1057
|
+
layout: TableLayout;
|
|
1058
|
+
/** `virtual` only paints rows inside the viewport, and needs a bounded height. */
|
|
1059
|
+
renderMode: TableRenderMode;
|
|
1060
|
+
/** Row height in pixels. Virtual mode requires every row to be this tall. */
|
|
1061
|
+
rowHeight: number;
|
|
1062
|
+
/** CSS height for the table, e.g. `80vh`. */
|
|
1063
|
+
height: string;
|
|
1064
|
+
/** CSS max-height for the table, e.g. `600px`. */
|
|
1065
|
+
maxHeight: string;
|
|
1066
|
+
/** CSS min-height for the table. */
|
|
1067
|
+
minHeight: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* Let users drag a column's right edge to resize it, and double-click that
|
|
1070
|
+
* edge to put the column back on automatic width. On by default, matching the
|
|
1071
|
+
* reference table. Turn it off table-wide with `resizable-columns="false"`, or
|
|
1072
|
+
* per column with `isResizable: false`.
|
|
1073
|
+
*/
|
|
1074
|
+
resizableColumns: boolean;
|
|
1075
|
+
/** Present the table as a plain list, with no column headings. */
|
|
1076
|
+
hideHeader: boolean;
|
|
1077
|
+
/** Cover the table with a loading indicator. Slot `loading` to replace it. */
|
|
1078
|
+
loading: boolean;
|
|
1079
|
+
/** How rows respond to being clicked. */
|
|
1080
|
+
selectable: TableSelectableMode;
|
|
1081
|
+
/** The field holding each row's unique id. Falls back to the row's position. */
|
|
1082
|
+
indexColumn: string;
|
|
1083
|
+
/** Table-wide horizontal alignment. A column's own `align` wins. */
|
|
1084
|
+
columnAlign: TableAlign;
|
|
1085
|
+
/** Table-wide vertical alignment. A column's own `verticalAlign` wins. */
|
|
1086
|
+
columnVerticalAlign: TableVerticalAlign;
|
|
1087
|
+
/** The field currently sorted by. Set it to sort the table initially. */
|
|
1088
|
+
sortField: string;
|
|
1089
|
+
/** Direction of the current sort. */
|
|
1090
|
+
sortDirection: TableSortDirection;
|
|
1091
|
+
/** Treat `data` as a tree, reading each row's children from `tree-children-field`. */
|
|
1092
|
+
dataTree: boolean;
|
|
1093
|
+
/** The field holding a row's child rows in tree mode. */
|
|
1094
|
+
treeChildrenField: string;
|
|
1095
|
+
/** Pixels of indentation per tree level. */
|
|
1096
|
+
treeChildIndent: number;
|
|
1097
|
+
/** Group rows by this field. Rows sharing a value are collected under a heading. */
|
|
1098
|
+
groupBy: string;
|
|
1099
|
+
/** The currently selected rows. Assign to control the selection from outside. */
|
|
1100
|
+
selectedRows: any[];
|
|
1101
|
+
/** Decides whether a row's checkbox is disabled. */
|
|
1102
|
+
isRowDisabled?: (data: any) => boolean;
|
|
1103
|
+
/** Decides whether a tree row starts out expanded. */
|
|
1104
|
+
onStartExpanded?: (data: any) => boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Extra tokens for a row, for highlighting rows by their data. They are added
|
|
1107
|
+
* both as classes and as `part` names, so a consumer can reach them from
|
|
1108
|
+
* outside the shadow root — including for hover and other states:
|
|
1109
|
+
*
|
|
1110
|
+
* anduin-table::part(overdue) { background: var(--color-danger-1); }
|
|
1111
|
+
* anduin-table::part(overdue):hover { background: var(--color-danger-2); }
|
|
1112
|
+
*/
|
|
1113
|
+
rowClass?: (data: any, index: number) => string;
|
|
1114
|
+
/** Renders a group heading. Defaults to `value (count)`. */
|
|
1115
|
+
renderGroupHeader?: (value: unknown, count: number, rows: any[]) => unknown;
|
|
1116
|
+
/** Keys of the tree rows the user has expanded. */
|
|
1117
|
+
private expandedKeys;
|
|
1118
|
+
/** Keys of the groups the user has collapsed. Groups start expanded. */
|
|
1119
|
+
private collapsedGroups;
|
|
1120
|
+
/** Scroll offset driving the virtual window. Named to avoid HTMLElement.scrollTop. */
|
|
1121
|
+
private virtualScrollTop;
|
|
1122
|
+
/** Height of the virtual viewport, tracked so the window stays filled. */
|
|
1123
|
+
private viewportHeight;
|
|
1124
|
+
/** Whether the table is scrolled away from its left edge. */
|
|
1125
|
+
private scrolledX;
|
|
1126
|
+
/** Whether there is still content to the right of the viewport. */
|
|
1127
|
+
private scrollableXEnd;
|
|
1128
|
+
/** Widths the user has dragged columns to, keyed by column. */
|
|
1129
|
+
private resizedWidths;
|
|
1130
|
+
/** The column currently being dragged, for the handle's active styling. */
|
|
1131
|
+
private resizingKey;
|
|
1132
|
+
/** Anchor row for shift-click and shift-drag range selection. */
|
|
1133
|
+
private rangeAnchorKey;
|
|
1134
|
+
/** True while a shift-drag range selection is in progress. */
|
|
1135
|
+
private isDraggingRange;
|
|
1136
|
+
/** Rows selected when the current drag began, so the drag can be re-applied. */
|
|
1137
|
+
private dragBaseKeys;
|
|
1138
|
+
/** Whether the current drag is adding to or removing from the selection. */
|
|
1139
|
+
private dragSelects;
|
|
1140
|
+
private resizeObserver?;
|
|
1141
|
+
/** Rows expanded automatically, so `onStartExpanded` only applies once per key. */
|
|
1142
|
+
private autoExpandedKeys;
|
|
1143
|
+
/** In-flight column drag: where it started and how wide the column was then. */
|
|
1144
|
+
private resizeDrag;
|
|
1145
|
+
/** rAF handle, so a drag repaints once per frame instead of once per pointer event. */
|
|
1146
|
+
private resizeFrame;
|
|
1147
|
+
/**
|
|
1148
|
+
* Selection keys for the current render pass. Recomputing the set per cell
|
|
1149
|
+
* would make rendering quadratic in the row count, which virtual mode exists
|
|
1150
|
+
* to avoid. Refreshed in `willUpdate`.
|
|
1151
|
+
*/
|
|
1152
|
+
private renderSelectedKeys;
|
|
1153
|
+
/** Selectable rows for the current render pass, for the header's checkbox. */
|
|
1154
|
+
private renderSelectableRows;
|
|
1155
|
+
/** The sorted, flattened, grouped row list. Rebuilt only when its inputs change. */
|
|
1156
|
+
private cachedRenderRows;
|
|
1157
|
+
private rowsDirty;
|
|
1158
|
+
connectedCallback(): void;
|
|
1159
|
+
disconnectedCallback(): void;
|
|
1160
|
+
firstUpdated(): void;
|
|
1161
|
+
/**
|
|
1162
|
+
* Scrolling a virtual table re-renders on every frame, but only the visible
|
|
1163
|
+
* window changes — the row list itself does not. Rebuild it only when one of
|
|
1164
|
+
* its actual inputs changes, so scrolling stays cheap at 10k+ rows.
|
|
1165
|
+
*/
|
|
1166
|
+
willUpdate(changed: PropertyValues): void;
|
|
1167
|
+
updated(changed: PropertyValues): void;
|
|
1168
|
+
private get scrollEl();
|
|
1169
|
+
/** A stable identity for a row, used for selection and expansion state. */
|
|
1170
|
+
private keyFor;
|
|
1171
|
+
private get selectedKeySet();
|
|
1172
|
+
private rowIsDisabled;
|
|
1173
|
+
/**
|
|
1174
|
+
* Frozen columns stick to whichever edge they are nearest: a leading run of
|
|
1175
|
+
* frozen columns pins left, a trailing run pins right. An explicit
|
|
1176
|
+
* `isFrozen: 'left' | 'right'` overrides that.
|
|
1177
|
+
*/
|
|
1178
|
+
private get frozenSides();
|
|
1179
|
+
/** Measures header widths and pins each frozen column at the right offset. */
|
|
1180
|
+
private applyFrozenOffsets;
|
|
1181
|
+
private get sortedColumn();
|
|
1182
|
+
private sortRows;
|
|
1183
|
+
private onHeaderClick;
|
|
1184
|
+
/** Sorts, flattens the tree, and inserts group headings. */
|
|
1185
|
+
private buildRenderRows;
|
|
1186
|
+
private buildFlatRows;
|
|
1187
|
+
private buildGroupedRows;
|
|
1188
|
+
private isExpanded;
|
|
1189
|
+
private toggleTreeRow;
|
|
1190
|
+
private toggleGroup;
|
|
1191
|
+
/** Expands every tree row that has children. */
|
|
1192
|
+
expandAll(): void;
|
|
1193
|
+
/** Collapses every tree row. */
|
|
1194
|
+
collapseAll(): void;
|
|
1195
|
+
/** Every selectable row currently on screen, in visual order. */
|
|
1196
|
+
private get selectableRows();
|
|
1197
|
+
private commitSelection;
|
|
1198
|
+
private setRowSelected;
|
|
1199
|
+
private toggleAllRows;
|
|
1200
|
+
/** Selects (or clears) every row between the anchor and `row`, inclusive. */
|
|
1201
|
+
private selectRange;
|
|
1202
|
+
private onRowMouseDown;
|
|
1203
|
+
private onRowMouseEnter;
|
|
1204
|
+
private onWindowMouseUp;
|
|
1205
|
+
private onRowClick;
|
|
1206
|
+
private onCellContextMenu;
|
|
1207
|
+
private onScroll;
|
|
1208
|
+
private syncHorizontalScrollState;
|
|
1209
|
+
/**
|
|
1210
|
+
* Sizing for one column's header and body cells.
|
|
1211
|
+
*
|
|
1212
|
+
* `fit-data-stretch` hands all the slack to the final column, so that one is
|
|
1213
|
+
* given `width: 100%` instead of its own width. Everywhere else an explicit
|
|
1214
|
+
* `width` is pinned with a matching max-width: under `table-layout: auto` a
|
|
1215
|
+
* bare `width` is only a suggestion, and long content would blow past it.
|
|
1216
|
+
*/
|
|
1217
|
+
/** A stable identity for a column, used to remember a dragged width. */
|
|
1218
|
+
private columnKey;
|
|
1219
|
+
/** The width to lay a column out at: a dragged width beats the configured one. */
|
|
1220
|
+
private widthFor;
|
|
1221
|
+
/**
|
|
1222
|
+
* True for the final column under fit-data-stretch, which absorbs the slack.
|
|
1223
|
+
* Dragging that column opts it out — the user asked for a specific width, and
|
|
1224
|
+
* stretching would immediately overrule them.
|
|
1225
|
+
*/
|
|
1226
|
+
private isStretchColumn;
|
|
1227
|
+
/** Marks how a column is sized, so the layout CSS can treat the cases apart. */
|
|
1228
|
+
private sizingClass;
|
|
1229
|
+
private cellStyle;
|
|
1230
|
+
private isColumnResizable;
|
|
1231
|
+
private onResizeStart;
|
|
1232
|
+
private onResizeMove;
|
|
1233
|
+
private onResizeEnd;
|
|
1234
|
+
/** Double-clicking the handle puts the column back on automatic width. */
|
|
1235
|
+
private onResizeReset;
|
|
1236
|
+
/** Clears every dragged width, putting all columns back on automatic sizing. */
|
|
1237
|
+
resetColumnWidths(): void;
|
|
1238
|
+
private alignClass;
|
|
1239
|
+
private renderHeaderCell;
|
|
1240
|
+
private renderCell;
|
|
1241
|
+
private get firstDataColumnIndex();
|
|
1242
|
+
private renderRow;
|
|
1243
|
+
private renderGroupRow;
|
|
1244
|
+
private get columnCount();
|
|
1245
|
+
private renderPlaceholder;
|
|
1246
|
+
render(): TemplateResult<1>;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1025
1249
|
declare class AnduinTabs extends LitElement {
|
|
1026
1250
|
static styles: CSSResult;
|
|
1027
1251
|
defaultValue: string;
|
|
@@ -1561,6 +1785,229 @@ export declare const TAB_CHANGE = "anduin-tab:change";
|
|
|
1561
1785
|
|
|
1562
1786
|
export declare const TabContent: ReactWebComponent<AnduinTabContent, {}>;
|
|
1563
1787
|
|
|
1788
|
+
export declare const Table: ReactWebComponent<AnduinTable, {
|
|
1789
|
+
onSort: string;
|
|
1790
|
+
onColumnClick: string;
|
|
1791
|
+
onRowClick: string;
|
|
1792
|
+
onSelectionChange: string;
|
|
1793
|
+
onCellContextMenu: string;
|
|
1794
|
+
onRowExpand: string;
|
|
1795
|
+
onRowCollapse: string;
|
|
1796
|
+
onGroupToggle: string;
|
|
1797
|
+
onColumnResize: string;
|
|
1798
|
+
}>;
|
|
1799
|
+
|
|
1800
|
+
/** Fired on right-click over a data cell, so consumers can open their own menu. */
|
|
1801
|
+
export declare const TABLE_CELL_CONTEXT_MENU = "anduin-table:cell-context-menu";
|
|
1802
|
+
|
|
1803
|
+
/** Fired when any column header is clicked, sortable or not. */
|
|
1804
|
+
export declare const TABLE_COLUMN_CLICK = "anduin-table:column-click";
|
|
1805
|
+
|
|
1806
|
+
/** Fired when a column is resized by dragging, or reset by double-click. */
|
|
1807
|
+
export declare const TABLE_COLUMN_RESIZE = "anduin-table:column-resize";
|
|
1808
|
+
|
|
1809
|
+
/** Fired when a group header is expanded or collapsed. */
|
|
1810
|
+
export declare const TABLE_GROUP_TOGGLE = "anduin-table:group-toggle";
|
|
1811
|
+
|
|
1812
|
+
/** Fired when a data row is clicked. */
|
|
1813
|
+
export declare const TABLE_ROW_CLICK = "anduin-table:row-click";
|
|
1814
|
+
|
|
1815
|
+
/** Fired when a tree row is collapsed. */
|
|
1816
|
+
export declare const TABLE_ROW_COLLAPSE = "anduin-table:row-collapse";
|
|
1817
|
+
|
|
1818
|
+
/** Fired when a tree row is expanded. */
|
|
1819
|
+
export declare const TABLE_ROW_EXPAND = "anduin-table:row-expand";
|
|
1820
|
+
|
|
1821
|
+
/** Fired whenever the set of selected rows changes. */
|
|
1822
|
+
export declare const TABLE_SELECTION_CHANGE = "anduin-table:selection-change";
|
|
1823
|
+
|
|
1824
|
+
/** Fired when a sortable column header is activated. */
|
|
1825
|
+
export declare const TABLE_SORT = "anduin-table:sort";
|
|
1826
|
+
|
|
1827
|
+
/** Horizontal alignment of a column's content. */
|
|
1828
|
+
export declare type TableAlign = 'left' | 'center' | 'right';
|
|
1829
|
+
|
|
1830
|
+
/** Any entry accepted by the `columns` property. */
|
|
1831
|
+
export declare type TableAnyColumn<T = unknown> = TableColumn<T> | TableSelectionColumn<T>;
|
|
1832
|
+
|
|
1833
|
+
/** `detail` of `anduin-table:cell-context-menu`. */
|
|
1834
|
+
export declare interface TableCellContextMenuDetail<T = unknown> {
|
|
1835
|
+
data: T;
|
|
1836
|
+
key: string;
|
|
1837
|
+
index: number;
|
|
1838
|
+
column: TableColumn<T>;
|
|
1839
|
+
/** Viewport coordinates of the click, for positioning a menu. */
|
|
1840
|
+
x: number;
|
|
1841
|
+
y: number;
|
|
1842
|
+
originalEvent: MouseEvent;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
/** What `renderCell` receives. */
|
|
1846
|
+
export declare interface TableCellRenderProps<T = unknown> {
|
|
1847
|
+
/** The row's underlying model. */
|
|
1848
|
+
data: T;
|
|
1849
|
+
/** The value at `column.field`, resolved through dot notation. */
|
|
1850
|
+
value: unknown;
|
|
1851
|
+
/** Index of the row in the sorted, flattened row list. */
|
|
1852
|
+
rowIndex: number;
|
|
1853
|
+
/** The column being rendered. */
|
|
1854
|
+
column: TableColumn<T>;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* A column definition.
|
|
1859
|
+
*
|
|
1860
|
+
* `renderCell` / `renderHeader` may return anything Lit can render: a string, a
|
|
1861
|
+
* number, a DOM `Node`, or a Lit `TemplateResult`. Returning a `Node` is the
|
|
1862
|
+
* portable choice for consumers that are not using Lit themselves.
|
|
1863
|
+
*/
|
|
1864
|
+
export declare interface TableColumn<T = unknown> {
|
|
1865
|
+
/** The model property this column shows. Supports dot notation (`address.city`). */
|
|
1866
|
+
field: string;
|
|
1867
|
+
/** The column heading. */
|
|
1868
|
+
title?: string;
|
|
1869
|
+
/** Column width in pixels. */
|
|
1870
|
+
width?: number;
|
|
1871
|
+
/** Lower bound for the column's width in pixels. */
|
|
1872
|
+
minWidth?: number;
|
|
1873
|
+
/** Show a sort control in the header and let users sort by this column. */
|
|
1874
|
+
isSortable?: boolean;
|
|
1875
|
+
/** Stick the column to the left or right edge while the table scrolls sideways. */
|
|
1876
|
+
isFrozen?: TableFrozen;
|
|
1877
|
+
/** Horizontal alignment for this column, overriding the table-wide default. */
|
|
1878
|
+
align?: TableAlign;
|
|
1879
|
+
/** Vertical alignment for this column, overriding the table-wide default. */
|
|
1880
|
+
verticalAlign?: TableVerticalAlign;
|
|
1881
|
+
/** Horizontal alignment for the header cell. Defaults to `align`. */
|
|
1882
|
+
headerAlign?: TableAlign;
|
|
1883
|
+
/** Hide the cell's content until its row is hovered, selected, or focused. */
|
|
1884
|
+
showOnRowHover?: boolean;
|
|
1885
|
+
/** Let users drag this column's edge to resize it. Defaults to the table's setting. */
|
|
1886
|
+
isResizable?: boolean;
|
|
1887
|
+
/** Renders the cell body. Defaults to the raw value at `field`. */
|
|
1888
|
+
renderCell?: (props: TableCellRenderProps<T>) => unknown;
|
|
1889
|
+
/** Renders the header body. Defaults to `title`. */
|
|
1890
|
+
renderHeader?: (props: TableHeaderRenderProps<T>) => unknown;
|
|
1891
|
+
/** Compares two rows. Return <0, 0, or >0. Defaults to comparing `field`. */
|
|
1892
|
+
sortWith?: (sorter: TableColumnSorter<T>) => number;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
/** `detail` of `anduin-table:column-resize`. */
|
|
1896
|
+
export declare interface TableColumnResizeDetail<T = unknown> {
|
|
1897
|
+
column: TableAnyColumn<T>;
|
|
1898
|
+
field: string;
|
|
1899
|
+
/** The column's new width in pixels, or null when it was reset to automatic. */
|
|
1900
|
+
width: number | null;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
/** What a column's `sortWith` receives. Either side may be missing. */
|
|
1904
|
+
export declare interface TableColumnSorter<T = unknown> {
|
|
1905
|
+
a: T | undefined;
|
|
1906
|
+
b: T | undefined;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/** Which edge a frozen column sticks to. `true` picks the edge from its position. */
|
|
1910
|
+
export declare type TableFrozen = boolean | 'left' | 'right';
|
|
1911
|
+
|
|
1912
|
+
/** `detail` of `anduin-table:group-toggle`. */
|
|
1913
|
+
export declare interface TableGroupToggleDetail<T = unknown> {
|
|
1914
|
+
value: unknown;
|
|
1915
|
+
rows: T[];
|
|
1916
|
+
expanded: boolean;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
/** What `renderHeader` receives. */
|
|
1920
|
+
export declare interface TableHeaderRenderProps<T = unknown> {
|
|
1921
|
+
column: TableColumn<T>;
|
|
1922
|
+
/** The column's current sort direction, or null when it is not sorted. */
|
|
1923
|
+
sortDirection: TableSortDirection | null;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* How column widths are resolved.
|
|
1928
|
+
* - `fit-data` size columns to their content (default)
|
|
1929
|
+
* - `fit-columns` size columns to divide up the table's width exactly
|
|
1930
|
+
* - `fit-data-fill` size to content, but rows always span the full width
|
|
1931
|
+
* - `fit-data-stretch` size to content, stretching the last column
|
|
1932
|
+
* - `fit-data-table` size to content, shrinking the table to their total
|
|
1933
|
+
*/
|
|
1934
|
+
export declare type TableLayout = 'fit-data' | 'fit-columns' | 'fit-data-fill' | 'fit-data-stretch' | 'fit-data-table';
|
|
1935
|
+
|
|
1936
|
+
/** Render mode. `virtual` only paints the rows inside the viewport. */
|
|
1937
|
+
export declare type TableRenderMode = 'basic' | 'virtual';
|
|
1938
|
+
|
|
1939
|
+
/** `detail` of `anduin-table:row-click`. */
|
|
1940
|
+
export declare interface TableRowClickDetail<T = unknown> {
|
|
1941
|
+
data: T;
|
|
1942
|
+
key: string;
|
|
1943
|
+
index: number;
|
|
1944
|
+
originalEvent: MouseEvent;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
/** `detail` of `anduin-table:row-expand` and `anduin-table:row-collapse`. */
|
|
1948
|
+
export declare interface TableRowExpandDetail<T = unknown> {
|
|
1949
|
+
data: T;
|
|
1950
|
+
key: string;
|
|
1951
|
+
expanded: boolean;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
/**
|
|
1955
|
+
* How rows respond to being clicked.
|
|
1956
|
+
* - `unselectable` rows cannot be selected
|
|
1957
|
+
* - `clickable` rows report clicks but never select (default)
|
|
1958
|
+
* - `selectable` clicking a row toggles its selection
|
|
1959
|
+
* - `selectable-by-clicking` click, then shift-click, to select a range
|
|
1960
|
+
* - `selectable-by-dragging` shift and drag across rows to select a range
|
|
1961
|
+
*/
|
|
1962
|
+
export declare type TableSelectableMode = 'unselectable' | 'clickable' | 'selectable' | 'selectable-by-clicking' | 'selectable-by-dragging';
|
|
1963
|
+
|
|
1964
|
+
/** What the selection column's `renderCell` receives. */
|
|
1965
|
+
export declare interface TableSelectionCellRenderProps<T = unknown> {
|
|
1966
|
+
data: T;
|
|
1967
|
+
isChecked: boolean;
|
|
1968
|
+
isDisabled: boolean;
|
|
1969
|
+
onChange: (checked: boolean) => void;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/** `detail` of `anduin-table:selection-change`. */
|
|
1973
|
+
export declare interface TableSelectionChangeDetail<T = unknown> {
|
|
1974
|
+
selectedRows: T[];
|
|
1975
|
+
selectedKeys: string[];
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* A checkbox column. Put it in `columns` wherever the checkboxes should appear —
|
|
1980
|
+
* usually first. It carries the same layout options as a normal column.
|
|
1981
|
+
*/
|
|
1982
|
+
export declare interface TableSelectionColumn<T = unknown> extends Omit<TableColumn<T>, 'field' | 'renderCell' | 'renderHeader' | 'sortWith' | 'isSortable'> {
|
|
1983
|
+
type: 'selection';
|
|
1984
|
+
field?: string;
|
|
1985
|
+
/** Replaces the row checkbox, e.g. with an anduin-switcher. */
|
|
1986
|
+
renderCell?: (props: TableSelectionCellRenderProps<T>) => unknown;
|
|
1987
|
+
/** Replaces the header checkbox, e.g. with a "Select all" button. */
|
|
1988
|
+
renderHeader?: (props: TableSelectionHeaderRenderProps) => unknown;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
/** What the selection column's `renderHeader` receives. */
|
|
1992
|
+
export declare interface TableSelectionHeaderRenderProps {
|
|
1993
|
+
areAllRowsSelected: boolean;
|
|
1994
|
+
hasSelectedRow: boolean;
|
|
1995
|
+
onChange: (checked: boolean) => void;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/** `detail` of `anduin-table:sort`. */
|
|
1999
|
+
export declare interface TableSortDetail<T = unknown> {
|
|
2000
|
+
field: string;
|
|
2001
|
+
direction: TableSortDirection | null;
|
|
2002
|
+
column: TableColumn<T>;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
/** Sort direction of the currently sorted column. */
|
|
2006
|
+
export declare type TableSortDirection = 'asc' | 'desc';
|
|
2007
|
+
|
|
2008
|
+
/** Vertical alignment of a column's content within its row. */
|
|
2009
|
+
export declare type TableVerticalAlign = 'top' | 'middle' | 'bottom';
|
|
2010
|
+
|
|
1564
2011
|
export declare const Tabs: ReactWebComponent<AnduinTabs, {
|
|
1565
2012
|
onChange: string;
|
|
1566
2013
|
}>;
|