@f-ewald/components 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/custom-elements.json +1345 -56
- package/dist/auto-scroll.d.ts +37 -0
- package/dist/auto-scroll.d.ts.map +1 -0
- package/dist/auto-scroll.js +100 -0
- package/dist/auto-scroll.js.map +1 -0
- package/dist/form-field.d.ts +39 -0
- package/dist/form-field.d.ts.map +1 -0
- package/dist/form-field.js +145 -0
- package/dist/form-field.js.map +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/load-more.d.ts +33 -0
- package/dist/load-more.d.ts.map +1 -0
- package/dist/load-more.js +82 -0
- package/dist/load-more.js.map +1 -0
- package/dist/percent-bar-chart.d.ts +32 -3
- package/dist/percent-bar-chart.d.ts.map +1 -1
- package/dist/percent-bar-chart.js +101 -36
- package/dist/percent-bar-chart.js.map +1 -1
- package/dist/scroll-to-bottom.d.ts +41 -0
- package/dist/scroll-to-bottom.d.ts.map +1 -0
- package/dist/scroll-to-bottom.js +189 -0
- package/dist/scroll-to-bottom.js.map +1 -0
- package/dist/scroll-to-top.d.ts +41 -0
- package/dist/scroll-to-top.d.ts.map +1 -0
- package/dist/scroll-to-top.js +189 -0
- package/dist/scroll-to-top.js.map +1 -0
- package/dist/ui-checkbox.d.ts +49 -0
- package/dist/ui-checkbox.d.ts.map +1 -0
- package/dist/ui-checkbox.js +228 -0
- package/dist/ui-checkbox.js.map +1 -0
- package/dist/utils/scroll.d.ts +9 -0
- package/dist/utils/scroll.d.ts.map +1 -0
- package/dist/utils/scroll.js +30 -0
- package/dist/utils/scroll.js.map +1 -0
- package/docs/auto-scroll.md +52 -0
- package/docs/form-field.md +63 -0
- package/docs/layouts/form-page.md +8 -4
- package/docs/load-more.md +43 -0
- package/docs/percent-bar-chart.md +19 -5
- package/docs/scroll-to-bottom.md +68 -0
- package/docs/scroll-to-top.md +59 -0
- package/docs/ui-checkbox.md +58 -0
- package/llms.txt +184 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export { RomanNumeral } from "./roman-numeral.js";
|
|
|
7
7
|
export { ConfirmDialog } from "./confirm-dialog.js";
|
|
8
8
|
export { ContentDivider } from "./content-divider.js";
|
|
9
9
|
export { ToastNotification, notifySuccess, notifyError, notifyInfo, } from "./toast-notification.js";
|
|
10
|
+
export { ScrollToBottom } from "./scroll-to-bottom.js";
|
|
11
|
+
export { ScrollToTop } from "./scroll-to-top.js";
|
|
10
12
|
export { SlidePanel } from "./slide-panel.js";
|
|
11
13
|
export { CopyLinkButton } from "./copy-link-button.js";
|
|
12
14
|
export { RelativeTime } from "./relative-time.js";
|
|
@@ -28,7 +30,10 @@ export { StatMeter } from "./stat-meter.js";
|
|
|
28
30
|
export { StatusPill } from "./status-pill.js";
|
|
29
31
|
export { EditableText } from "./editable-text.js";
|
|
30
32
|
export { LiveTimer } from "./live-timer.js";
|
|
33
|
+
export { LoadMore } from "./load-more.js";
|
|
31
34
|
export { ChatMessage, } from "./chat-message.js";
|
|
35
|
+
export { UiCheckbox } from "./ui-checkbox.js";
|
|
36
|
+
export { FormField } from "./form-field.js";
|
|
32
37
|
export { FormSelect } from "./form-select.js";
|
|
33
38
|
export { MultiSelect, } from "./multi-select.js";
|
|
34
39
|
export { DataTable } from "./data-table.js";
|
|
@@ -57,6 +62,7 @@ export { TextArea } from "./text-area.js";
|
|
|
57
62
|
export { LinkCard } from "./link-card.js";
|
|
58
63
|
export { CardGrid } from "./card-grid.js";
|
|
59
64
|
export { MarkdownView } from "./markdown-view.js";
|
|
65
|
+
export { AutoScroll } from "./auto-scroll.js";
|
|
60
66
|
export { formatDuration } from "./utils/duration.js";
|
|
61
67
|
export { tokens, tokenValues, darkTokenValues } from "./tokens.js";
|
|
62
68
|
export * from "./icons.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,GAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,GAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAsB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,mBAAmB,GAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAA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MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAyB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,WAAW,GAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,cAAc,YAAY,CAAC","sourcesContent":["export { AnimateConfetti } from \"./animate-confetti.js\";\nexport { GalleryItem } from \"./gallery-item.js\";\nexport { GalleryItemVariant } from \"./gallery-item-variant.js\";\nexport {\n PhotoGallery,\n type PhotoGalleryChangeReason,\n type PhotoGalleryObjectFit,\n type PhotoGallerySlideChangeDetail,\n} from \"./photo-gallery.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport { ContentDivider } from \"./content-divider.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { ButtonGroup, type ButtonGroupOption } from \"./button-group.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { StatMeter } from \"./stat-meter.js\";\nexport { StatusPill, type StatusPillColor } from \"./status-pill.js\";\nexport { EditableText } from \"./editable-text.js\";\nexport { LiveTimer } from \"./live-timer.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { FormSelect, type SelectOption } from \"./form-select.js\";\nexport {\n MultiSelect,\n type MultiSelectOption,\n type MultiSelectVariant,\n} from \"./multi-select.js\";\nexport { DataTable, type DataTableColumn } from \"./data-table.js\";\nexport { TileGrid } from \"./tile-grid.js\";\nexport { TreeView, type TreeNode } from \"./tree-view.js\";\nexport { PopoverPanel } from \"./popover-panel.js\";\nexport { DropdownButton, type DropdownOption } from \"./dropdown-button.js\";\nexport { IconButton } from \"./icon-button.js\";\nexport { KbdHint, type KbdPlatform } from \"./kbd-hint.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { AppShell, type SidebarToggleDetail } from \"./app-shell.js\";\nexport { AppSidebar } from \"./app-sidebar.js\";\nexport { ActionBar } from \"./action-bar.js\";\nexport { PageHeader } from \"./page-header.js\";\nexport { PaginationNav, type PageChangeDetail } from \"./pagination-nav.js\";\nexport { FormActions } from \"./form-actions.js\";\nexport { TimelineContainer } from \"./timeline-container.js\";\nexport { TimelineEntry } from \"./timeline-entry.js\";\nexport { CalendarEntry } from \"./calendar-entry.js\";\nexport { CalendarMonth } from \"./calendar-month.js\";\nexport { CalendarYear } from \"./calendar-year.js\";\nexport {\n KanbanBoard,\n type KanbanCardData,\n type KanbanColumnData,\n type KanbanCardMoveDetail,\n type KanbanCardOpenDetail,\n} from \"./kanban-board.js\";\nexport { KanbanColumn } from \"./kanban-column.js\";\nexport { KanbanCard } from \"./kanban-card.js\";\nexport { TextArea } from \"./text-area.js\";\nexport { LinkCard, type LinkCardStatus } from \"./link-card.js\";\nexport { CardGrid } from \"./card-grid.js\";\nexport { MarkdownView } from \"./markdown-view.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,GAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,O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AC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,WAAW,GAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,cAAc,YAAY,CAAC","sourcesContent":["export { AnimateConfetti } from \"./animate-confetti.js\";\nexport { GalleryItem } from \"./gallery-item.js\";\nexport { GalleryItemVariant } from \"./gallery-item-variant.js\";\nexport {\n PhotoGallery,\n type PhotoGalleryChangeReason,\n type PhotoGalleryObjectFit,\n type PhotoGallerySlideChangeDetail,\n} from \"./photo-gallery.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport { ContentDivider } from \"./content-divider.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { ScrollToBottom } from \"./scroll-to-bottom.js\";\nexport { ScrollToTop } from \"./scroll-to-top.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { ButtonGroup, type ButtonGroupOption } from \"./button-group.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { StatMeter } from \"./stat-meter.js\";\nexport { StatusPill, type StatusPillColor } from \"./status-pill.js\";\nexport { EditableText } from \"./editable-text.js\";\nexport { LiveTimer } from \"./live-timer.js\";\nexport { LoadMore } from \"./load-more.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { UiCheckbox } from \"./ui-checkbox.js\";\nexport { FormField } from \"./form-field.js\";\nexport { FormSelect, type SelectOption } from \"./form-select.js\";\nexport {\n MultiSelect,\n type MultiSelectOption,\n type MultiSelectVariant,\n} from \"./multi-select.js\";\nexport { DataTable, type DataTableColumn } from \"./data-table.js\";\nexport { TileGrid } from \"./tile-grid.js\";\nexport { TreeView, type TreeNode } from \"./tree-view.js\";\nexport { PopoverPanel } from \"./popover-panel.js\";\nexport { DropdownButton, type DropdownOption } from \"./dropdown-button.js\";\nexport { IconButton } from \"./icon-button.js\";\nexport { KbdHint, type KbdPlatform } from \"./kbd-hint.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { AppShell, type SidebarToggleDetail } from \"./app-shell.js\";\nexport { AppSidebar } from \"./app-sidebar.js\";\nexport { ActionBar } from \"./action-bar.js\";\nexport { PageHeader } from \"./page-header.js\";\nexport { PaginationNav, type PageChangeDetail } from \"./pagination-nav.js\";\nexport { FormActions } from \"./form-actions.js\";\nexport { TimelineContainer } from \"./timeline-container.js\";\nexport { TimelineEntry } from \"./timeline-entry.js\";\nexport { CalendarEntry } from \"./calendar-entry.js\";\nexport { CalendarMonth } from \"./calendar-month.js\";\nexport { CalendarYear } from \"./calendar-year.js\";\nexport {\n KanbanBoard,\n type KanbanCardData,\n type KanbanColumnData,\n type KanbanCardMoveDetail,\n type KanbanCardOpenDetail,\n} from \"./kanban-board.js\";\nexport { KanbanColumn } from \"./kanban-column.js\";\nexport { KanbanCard } from \"./kanban-card.js\";\nexport { TextArea } from \"./text-area.js\";\nexport { LinkCard, type LinkCardStatus } from \"./link-card.js\";\nexport { CardGrid } from \"./card-grid.js\";\nexport { MarkdownView } from \"./markdown-view.js\";\nexport { AutoScroll } from \"./auto-scroll.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./ui-button.js";
|
|
3
|
+
/**
|
|
4
|
+
* Click-to-load button for either end of a list. Fully property-driven: the
|
|
5
|
+
* consumer sets `loading` while a fetch is in flight and `exhausted` once
|
|
6
|
+
* there's nothing left to load; this component never fetches or manages
|
|
7
|
+
* state itself.
|
|
8
|
+
*
|
|
9
|
+
* @element load-more
|
|
10
|
+
* @fires load-more - The button was clicked while not `loading`/`exhausted`;
|
|
11
|
+
* detail: `{ direction }`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class LoadMore extends LitElement {
|
|
14
|
+
#private;
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
/** Which end of a list this instance loads more content for. */
|
|
17
|
+
direction: "top" | "bottom";
|
|
18
|
+
/** Consumer-managed busy flag, forwarded to the internal `ui-button`'s `busy`. */
|
|
19
|
+
loading: boolean;
|
|
20
|
+
/** Terminal "no more content" state: disables the button and swaps its label. */
|
|
21
|
+
exhausted: boolean;
|
|
22
|
+
/** Button text in the normal (loadable) state. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Button text shown once `exhausted` is true. */
|
|
25
|
+
exhaustedLabel: string;
|
|
26
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
"load-more": LoadMore;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=load-more.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-more.d.ts","sourceRoot":"","sources":["../src/load-more.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,gBAAgB,CAAC;AAGxB;;;;;;;;;GASG;AACH,qBACa,QAAS,SAAQ,UAAU;;IACtC,OAAgB,MAAM,4BAQpB;IAEF,gEAAgE;IACpD,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAY;IACnD,kFAAkF;IACrD,OAAO,UAAS;IAC7C,iFAAiF;IACpD,SAAS,UAAS;IAC/C,kDAAkD;IACtC,KAAK,SAAe;IAChC,kDAAkD;IACN,cAAc,SAAqB;IAStE,MAAM,yCAYd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import "./ui-button.js";
|
|
10
|
+
import { tokens } from "./tokens.js";
|
|
11
|
+
/**
|
|
12
|
+
* Click-to-load button for either end of a list. Fully property-driven: the
|
|
13
|
+
* consumer sets `loading` while a fetch is in flight and `exhausted` once
|
|
14
|
+
* there's nothing left to load; this component never fetches or manages
|
|
15
|
+
* state itself.
|
|
16
|
+
*
|
|
17
|
+
* @element load-more
|
|
18
|
+
* @fires load-more - The button was clicked while not `loading`/`exhausted`;
|
|
19
|
+
* detail: `{ direction }`.
|
|
20
|
+
*/
|
|
21
|
+
let LoadMore = class LoadMore extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/** Which end of a list this instance loads more content for. */
|
|
25
|
+
this.direction = "bottom";
|
|
26
|
+
/** Consumer-managed busy flag, forwarded to the internal `ui-button`'s `busy`. */
|
|
27
|
+
this.loading = false;
|
|
28
|
+
/** Terminal "no more content" state: disables the button and swaps its label. */
|
|
29
|
+
this.exhausted = false;
|
|
30
|
+
/** Button text in the normal (loadable) state. */
|
|
31
|
+
this.label = "Load more";
|
|
32
|
+
/** Button text shown once `exhausted` is true. */
|
|
33
|
+
this.exhaustedLabel = "No more results";
|
|
34
|
+
}
|
|
35
|
+
static { this.styles = [
|
|
36
|
+
tokens,
|
|
37
|
+
css `
|
|
38
|
+
:host {
|
|
39
|
+
display: block;
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
`,
|
|
43
|
+
]; }
|
|
44
|
+
#onClick() {
|
|
45
|
+
if (this.loading || this.exhausted)
|
|
46
|
+
return;
|
|
47
|
+
this.dispatchEvent(new CustomEvent("load-more", { detail: { direction: this.direction }, bubbles: true, composed: true }));
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return html `
|
|
51
|
+
<ui-button
|
|
52
|
+
type="button"
|
|
53
|
+
variant="secondary"
|
|
54
|
+
?busy=${this.loading}
|
|
55
|
+
?disabled=${this.exhausted}
|
|
56
|
+
@click=${() => this.#onClick()}
|
|
57
|
+
>
|
|
58
|
+
${this.exhausted ? this.exhaustedLabel : this.label}
|
|
59
|
+
</ui-button>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
__decorate([
|
|
64
|
+
property()
|
|
65
|
+
], LoadMore.prototype, "direction", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property({ type: Boolean })
|
|
68
|
+
], LoadMore.prototype, "loading", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
property({ type: Boolean })
|
|
71
|
+
], LoadMore.prototype, "exhausted", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
property()
|
|
74
|
+
], LoadMore.prototype, "label", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ attribute: "exhausted-label" })
|
|
77
|
+
], LoadMore.prototype, "exhaustedLabel", void 0);
|
|
78
|
+
LoadMore = __decorate([
|
|
79
|
+
customElement("load-more")
|
|
80
|
+
], LoadMore);
|
|
81
|
+
export { LoadMore };
|
|
82
|
+
//# sourceMappingURL=load-more.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-more.js","sourceRoot":"","sources":["../src/load-more.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AA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AAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAmB;AAEnC;IAAX,QAAQ,EAAE;uCAAqB;AAEY;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;gDAAoC;AApBpE,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA0CpB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport \"./ui-button.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * Click-to-load button for either end of a list. Fully property-driven: the\n * consumer sets `loading` while a fetch is in flight and `exhausted` once\n * there's nothing left to load; this component never fetches or manages\n * state itself.\n *\n * @element load-more\n * @fires load-more - The button was clicked while not `loading`/`exhausted`;\n * detail: `{ direction }`.\n */\n@customElement(\"load-more\")\nexport class LoadMore extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n text-align: center;\n }\n `,\n ];\n\n /** Which end of a list this instance loads more content for. */\n @property() direction: \"top\" | \"bottom\" = \"bottom\";\n /** Consumer-managed busy flag, forwarded to the internal `ui-button`'s `busy`. */\n @property({ type: Boolean }) loading = false;\n /** Terminal \"no more content\" state: disables the button and swaps its label. */\n @property({ type: Boolean }) exhausted = false;\n /** Button text in the normal (loadable) state. */\n @property() label = \"Load more\";\n /** Button text shown once `exhausted` is true. */\n @property({ attribute: \"exhausted-label\" }) exhaustedLabel = \"No more results\";\n\n #onClick(): void {\n if (this.loading || this.exhausted) return;\n this.dispatchEvent(\n new CustomEvent(\"load-more\", { detail: { direction: this.direction }, bubbles: true, composed: true }),\n );\n }\n\n override render() {\n return html`\n <ui-button\n type=\"button\"\n variant=\"secondary\"\n ?busy=${this.loading}\n ?disabled=${this.exhausted}\n @click=${() => this.#onClick()}\n >\n ${this.exhausted ? this.exhaustedLabel : this.label}\n </ui-button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"load-more\": LoadMore;\n }\n}\n"]}
|
|
@@ -2,12 +2,26 @@ import { LitElement } from "lit";
|
|
|
2
2
|
export interface PercentBarGroup {
|
|
3
3
|
key: string;
|
|
4
4
|
label: string;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The row's value. In `mode="percent"` (default) this is a 0-100
|
|
7
|
+
* percentage, scaled against a fixed domain. In `mode="value"` this is an
|
|
8
|
+
* arbitrary raw number, scaled against `max` (or the largest `value`
|
|
9
|
+
* across `groups` when `max` is unset).
|
|
10
|
+
*/
|
|
11
|
+
value: number;
|
|
6
12
|
color: string;
|
|
7
13
|
}
|
|
14
|
+
/** Whether `PercentBarGroup.value` is a 0-100 percentage or an arbitrary raw number. */
|
|
15
|
+
export type PercentBarMode = "percent" | "value";
|
|
16
|
+
/** Bars grow rightward as stacked rows, or upward as side-by-side columns. */
|
|
17
|
+
export type PercentBarOrientation = "horizontal" | "vertical";
|
|
8
18
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
19
|
+
* Bar chart for labeled rows, using D3's linear scale. Horizontal (default)
|
|
20
|
+
* renders stacked rows with bars growing rightward; `orientation="vertical"`
|
|
21
|
+
* renders side-by-side columns growing upward instead. `mode="percent"`
|
|
22
|
+
* (default) scales `value` against a fixed 0-100 domain and labels it with a
|
|
23
|
+
* `%` suffix; `mode="value"` scales it against `max` (or the largest `value`
|
|
24
|
+
* present) and formats it with `valueFormat`.
|
|
11
25
|
*
|
|
12
26
|
* @element percent-bar-chart
|
|
13
27
|
*/
|
|
@@ -15,13 +29,28 @@ export declare class PercentBarChart extends LitElement {
|
|
|
15
29
|
static styles: import("lit").CSSResult[];
|
|
16
30
|
/** Rows to render, one per group. */
|
|
17
31
|
groups: PercentBarGroup[];
|
|
32
|
+
/** Whether `value` is a 0-100 percentage (fixed domain) or an arbitrary number (domain from data/`max`). */
|
|
33
|
+
mode: PercentBarMode;
|
|
34
|
+
/** Bar direction: stacked rows growing rightward, or columns growing upward. */
|
|
35
|
+
orientation: PercentBarOrientation;
|
|
36
|
+
/** Explicit domain max for `mode="value"`; auto-computed from `groups` when unset. Ignored in `mode="percent"`. */
|
|
37
|
+
max?: number;
|
|
38
|
+
/** Formats a row's value for its label in `mode="value"`. Defaults to locale-formatted number. */
|
|
39
|
+
valueFormat: (value: number) => string;
|
|
18
40
|
private _width;
|
|
19
41
|
private _ro;
|
|
20
42
|
private readonly _gradIdBase;
|
|
21
43
|
/** Per-row gradient id, unique across instances and rows. */
|
|
22
44
|
private _gradId;
|
|
45
|
+
/** The row's value formatted for display, per the current `mode`. */
|
|
46
|
+
private _labelFor;
|
|
47
|
+
/** The scale domain's upper bound for the current `mode`. */
|
|
48
|
+
private _domainMax;
|
|
23
49
|
firstUpdated(): void;
|
|
24
50
|
disconnectedCallback(): void;
|
|
51
|
+
private _renderGradients;
|
|
52
|
+
private _renderHorizontal;
|
|
53
|
+
private _renderVertical;
|
|
25
54
|
render(): import("lit-html").TemplateResult<1>;
|
|
26
55
|
}
|
|
27
56
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percent-bar-chart.d.ts","sourceRoot":"","sources":["../src/percent-bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMjD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"percent-bar-chart.d.ts","sourceRoot":"","sources":["../src/percent-bar-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMjD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC;AACjD,8EAA8E;AAC9E,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,UAAU,CAAC;AAkB9D;;;;;;;;;GASG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,MAAM,4BA+BpB;IAEF,qCAAqC;IACL,MAAM,EAAE,eAAe,EAAE,CAAM;IAC/D,4GAA4G;IAChG,IAAI,EAAE,cAAc,CAAa;IAC7C,gFAAgF;IACpE,WAAW,EAAE,qBAAqB,CAAgB;IAC9D,mHAAmH;IACvF,GAAG,CAAC,EAAE,MAAM,CAAC;IACzC,kGAAkG;IAClE,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAC7C;IAEhB,OAAO,CAAC,MAAM,CAAK;IAE5B,OAAO,CAAC,GAAG,CAA+B;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6C;IAEzE,6DAA6D;IAC7D,OAAO,CAAC,OAAO;IAIf,qEAAqE;IACrE,OAAO,CAAC,SAAS;IAIjB,6DAA6D;IAC7D,OAAO,CAAC,UAAU;IAMT,YAAY,SAMpB;IAEQ,oBAAoB,SAI5B;IAED,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,eAAe;IA0Bd,MAAM,yCAmBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|
|
@@ -9,14 +9,25 @@ import { customElement, property, state } from "lit/decorators.js";
|
|
|
9
9
|
import { styleMap } from "lit/directives/style-map.js";
|
|
10
10
|
import { scaleLinear } from "d3-scale";
|
|
11
11
|
import { tokens } from "./tokens.js";
|
|
12
|
+
// Horizontal (row) layout.
|
|
12
13
|
const ROW_H = 20;
|
|
13
14
|
const LABEL_W = 56;
|
|
14
|
-
const
|
|
15
|
+
const VALUE_W = 36;
|
|
16
|
+
// Vertical (column) layout.
|
|
17
|
+
const COL_TRACK_H = 96;
|
|
18
|
+
const CAT_LABEL_H = 16;
|
|
19
|
+
const VALUE_LABEL_H = 14;
|
|
20
|
+
const MAX_BAR_W = 28;
|
|
21
|
+
const COL_GAP = 8;
|
|
15
22
|
const PAD = { top: 4, right: 4, bottom: 4, left: 4 };
|
|
16
23
|
let gradientIdCounter = 0;
|
|
17
24
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
25
|
+
* Bar chart for labeled rows, using D3's linear scale. Horizontal (default)
|
|
26
|
+
* renders stacked rows with bars growing rightward; `orientation="vertical"`
|
|
27
|
+
* renders side-by-side columns growing upward instead. `mode="percent"`
|
|
28
|
+
* (default) scales `value` against a fixed 0-100 domain and labels it with a
|
|
29
|
+
* `%` suffix; `mode="value"` scales it against `max` (or the largest `value`
|
|
30
|
+
* present) and formats it with `valueFormat`.
|
|
20
31
|
*
|
|
21
32
|
* @element percent-bar-chart
|
|
22
33
|
*/
|
|
@@ -25,6 +36,12 @@ let PercentBarChart = class PercentBarChart extends LitElement {
|
|
|
25
36
|
super(...arguments);
|
|
26
37
|
/** Rows to render, one per group. */
|
|
27
38
|
this.groups = [];
|
|
39
|
+
/** Whether `value` is a 0-100 percentage (fixed domain) or an arbitrary number (domain from data/`max`). */
|
|
40
|
+
this.mode = "percent";
|
|
41
|
+
/** Bar direction: stacked rows growing rightward, or columns growing upward. */
|
|
42
|
+
this.orientation = "horizontal";
|
|
43
|
+
/** Formats a row's value for its label in `mode="value"`. Defaults to locale-formatted number. */
|
|
44
|
+
this.valueFormat = (value) => value.toLocaleString();
|
|
28
45
|
this._width = 0;
|
|
29
46
|
this._ro = null;
|
|
30
47
|
this._gradIdBase = `percent-bar-grad-${gradientIdCounter++}`;
|
|
@@ -65,6 +82,18 @@ let PercentBarChart = class PercentBarChart extends LitElement {
|
|
|
65
82
|
_gradId(index) {
|
|
66
83
|
return `${this._gradIdBase}-${index}`;
|
|
67
84
|
}
|
|
85
|
+
/** The row's value formatted for display, per the current `mode`. */
|
|
86
|
+
_labelFor(value) {
|
|
87
|
+
return this.mode === "percent" ? `${value.toFixed(1)}%` : this.valueFormat(value);
|
|
88
|
+
}
|
|
89
|
+
/** The scale domain's upper bound for the current `mode`. */
|
|
90
|
+
_domainMax() {
|
|
91
|
+
if (this.mode === "percent")
|
|
92
|
+
return 100;
|
|
93
|
+
if (this.max !== undefined)
|
|
94
|
+
return this.max;
|
|
95
|
+
return Math.max(0.000001, ...this.groups.map((g) => g.value));
|
|
96
|
+
}
|
|
68
97
|
firstUpdated() {
|
|
69
98
|
this._ro = new ResizeObserver((entries) => {
|
|
70
99
|
const w = Math.floor(entries[0].contentRect.width);
|
|
@@ -78,59 +107,83 @@ let PercentBarChart = class PercentBarChart extends LitElement {
|
|
|
78
107
|
this._ro?.disconnect();
|
|
79
108
|
this._ro = null;
|
|
80
109
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return html ``;
|
|
84
|
-
const innerW = this._width - PAD.left - PAD.right;
|
|
85
|
-
const barMaxW = innerW - LABEL_W - PCT_W;
|
|
86
|
-
const svgH = PAD.top + this.groups.length * ROW_H + PAD.bottom;
|
|
87
|
-
const xScale = scaleLinear().domain([0, 100]).range([0, barMaxW]);
|
|
88
|
-
// CSS stop styles preserve every valid CSS color format while matching
|
|
89
|
-
// map-circle's 30% white/black vertical depth.
|
|
90
|
-
const rowFills = this.groups.map((g, i) => {
|
|
110
|
+
_renderGradients() {
|
|
111
|
+
return this.groups.map((g, i) => {
|
|
91
112
|
const color = g.color.trim();
|
|
92
113
|
const gradId = this._gradId(i);
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</linearGradient>
|
|
107
|
-
`,
|
|
108
|
-
};
|
|
114
|
+
return svg `
|
|
115
|
+
<linearGradient
|
|
116
|
+
id=${gradId}
|
|
117
|
+
x1="0"
|
|
118
|
+
y1="0"
|
|
119
|
+
x2="0"
|
|
120
|
+
y2="1"
|
|
121
|
+
style=${styleMap({ "--percent-bar-color": color })}
|
|
122
|
+
>
|
|
123
|
+
<stop class="gradient-start" offset="0%" />
|
|
124
|
+
<stop class="gradient-end" offset="100%" />
|
|
125
|
+
</linearGradient>
|
|
126
|
+
`;
|
|
109
127
|
});
|
|
110
|
-
|
|
128
|
+
}
|
|
129
|
+
_renderHorizontal() {
|
|
130
|
+
const innerW = this._width - PAD.left - PAD.right;
|
|
131
|
+
const barMaxW = innerW - LABEL_W - VALUE_W;
|
|
132
|
+
const svgH = PAD.top + this.groups.length * ROW_H + PAD.bottom;
|
|
133
|
+
const xScale = scaleLinear().domain([0, this._domainMax()]).range([0, barMaxW]);
|
|
111
134
|
const rows = this.groups.map((g, i) => {
|
|
112
135
|
const cy = PAD.top + i * ROW_H + ROW_H / 2;
|
|
113
|
-
const bw = Math.max(0, xScale(g.
|
|
136
|
+
const bw = Math.max(0, xScale(g.value));
|
|
114
137
|
return svg `
|
|
115
138
|
<text class="chart-label" x=${PAD.left} y=${cy} font-size="10"
|
|
116
139
|
text-anchor="start" dominant-baseline="middle">${g.label}</text>
|
|
117
140
|
<rect x=${PAD.left + LABEL_W} y=${cy - 5}
|
|
118
141
|
width=${bw} height="10" rx="5"
|
|
119
|
-
fill
|
|
142
|
+
fill="url(#${this._gradId(i)})" />
|
|
120
143
|
<text class="chart-label" x=${PAD.left + LABEL_W + barMaxW + 4} y=${cy} font-size="10"
|
|
121
|
-
text-anchor="start" dominant-baseline="middle">${g.
|
|
144
|
+
text-anchor="start" dominant-baseline="middle">${this._labelFor(g.value)}</text>
|
|
145
|
+
`;
|
|
146
|
+
});
|
|
147
|
+
return { svgH, content: rows };
|
|
148
|
+
}
|
|
149
|
+
_renderVertical() {
|
|
150
|
+
const innerW = this._width - PAD.left - PAD.right;
|
|
151
|
+
const n = this.groups.length;
|
|
152
|
+
const colSlotW = n > 0 ? innerW / n : 0;
|
|
153
|
+
const barW = Math.max(4, Math.min(MAX_BAR_W, colSlotW - COL_GAP));
|
|
154
|
+
const svgH = PAD.top + VALUE_LABEL_H + COL_TRACK_H + CAT_LABEL_H + PAD.bottom;
|
|
155
|
+
const yScale = scaleLinear().domain([0, this._domainMax()]).range([0, COL_TRACK_H]);
|
|
156
|
+
const cols = this.groups.map((g, i) => {
|
|
157
|
+
const cx = PAD.left + i * colSlotW + colSlotW / 2;
|
|
158
|
+
const barH = Math.max(0, yScale(g.value));
|
|
159
|
+
const barTop = PAD.top + VALUE_LABEL_H + (COL_TRACK_H - barH);
|
|
160
|
+
const catLabelY = PAD.top + VALUE_LABEL_H + COL_TRACK_H + CAT_LABEL_H - 4;
|
|
161
|
+
return svg `
|
|
162
|
+
<rect x=${cx - barW / 2} y=${barTop} width=${barW} height=${barH} rx=${barW / 2}
|
|
163
|
+
fill="url(#${this._gradId(i)})" />
|
|
164
|
+
<text class="chart-label" x=${cx} y=${barTop - 4} font-size="10"
|
|
165
|
+
text-anchor="middle">${this._labelFor(g.value)}</text>
|
|
166
|
+
<text class="chart-label" x=${cx} y=${catLabelY} font-size="10"
|
|
167
|
+
text-anchor="middle">${g.label}</text>
|
|
122
168
|
`;
|
|
123
169
|
});
|
|
170
|
+
return { svgH, content: cols };
|
|
171
|
+
}
|
|
172
|
+
render() {
|
|
173
|
+
if (this._width === 0 || this.groups.length === 0)
|
|
174
|
+
return html ``;
|
|
175
|
+
const { svgH, content } = this.orientation === "vertical" ? this._renderVertical() : this._renderHorizontal();
|
|
176
|
+
const ariaPrefix = this.mode === "percent" ? "Percentages" : "Values";
|
|
124
177
|
return html `
|
|
125
178
|
<svg
|
|
126
179
|
viewBox="0 0 ${this._width} ${svgH}"
|
|
127
180
|
width=${this._width}
|
|
128
181
|
height=${svgH}
|
|
129
182
|
role="img"
|
|
130
|
-
aria-label=${
|
|
183
|
+
aria-label=${`${ariaPrefix}: ${this.groups.map((g) => `${g.label} ${this._labelFor(g.value)}`).join(", ")}`}
|
|
131
184
|
>
|
|
132
|
-
<defs>${
|
|
133
|
-
${
|
|
185
|
+
<defs>${this._renderGradients()}</defs>
|
|
186
|
+
${content}
|
|
134
187
|
</svg>
|
|
135
188
|
`;
|
|
136
189
|
}
|
|
@@ -138,6 +191,18 @@ let PercentBarChart = class PercentBarChart extends LitElement {
|
|
|
138
191
|
__decorate([
|
|
139
192
|
property({ attribute: false })
|
|
140
193
|
], PercentBarChart.prototype, "groups", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property()
|
|
196
|
+
], PercentBarChart.prototype, "mode", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property()
|
|
199
|
+
], PercentBarChart.prototype, "orientation", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ type: Number })
|
|
202
|
+
], PercentBarChart.prototype, "max", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ attribute: false })
|
|
205
|
+
], PercentBarChart.prototype, "valueFormat", void 0);
|
|
141
206
|
__decorate([
|
|
142
207
|
state()
|
|
143
208
|
], PercentBarChart.prototype, "_width", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percent-bar-chart.js","sourceRoot":"","sources":["../src/percent-bar-chart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,MAAM,KAAK,GAAG,EAAE,CAAC;AACjB,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,KAAK,GAAG,EAAE,CAAC;AACjB,MAAM,GAAG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AAC,GAAG,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;YAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACtC,OAAO,GAAG,CAAA;sCACsB,GAAG,CAAC,IAAI,MAAM,EAAE;+DACS,CAAC,CAAC,KAAK;kBACpD,GAAG,CAAC,IAAI,GAAG,OAAO,MAAM,EAAE,GAAG,CAAC;sBAC1B,EAAE;qBACH,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;sCACC,GAAG,CAAC,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,CAAC,MAAM,EAAE;+DACf,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;OACxE,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;;uBAEQ,IAAI,CAAC,MAAM,IAAI,IAAI;gBAC1B,IAAI,CAAC,MAAM;iBACV,IAAI;;qBAEA,gBAAgB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;;gBAEvG,SAAS;UACf,IAAI;;KAET,CAAC;IACJ,CAAC;CACF,CAAA;AArFiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAAgC;AAC9C;IAAhB,KAAK,EAAE;+CAAoB;AApCjB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAwH3B","sourcesContent":["import { LitElement, css, html, svg } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { scaleLinear } from \"d3-scale\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface PercentBarGroup {\n key: string;\n label: string;\n pct: number;\n color: string;\n}\n\nconst ROW_H = 20;\nconst LABEL_W = 56;\nconst PCT_W = 36;\nconst PAD = { top: 4, right: 4, bottom: 4, left: 4 };\n\nlet gradientIdCounter = 0;\n\n/**\n * Horizontal bar chart for labeled percentage rows, using D3's linear scale.\n * Each group gets its own labeled row; bars are proportional to percentage of 100.\n *\n * @element percent-bar-chart\n */\n@customElement(\"percent-bar-chart\")\nexport class PercentBarChart extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n width: 100%;\n }\n svg {\n display: block;\n overflow: visible;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .chart-label {\n fill: var(--ui-text-muted, #64748b);\n }\n .gradient-start {\n stop-color: color-mix(in srgb, var(--percent-bar-color) 70%, #ffffff);\n }\n .gradient-end {\n stop-color: color-mix(in srgb, var(--percent-bar-color) 70%, #000000);\n }\n `,\n ];\n\n /** Rows to render, one per group. */\n @property({ attribute: false }) groups: PercentBarGroup[] = [];\n @state() private _width = 0;\n\n private _ro: ResizeObserver | null = null;\n private readonly _gradIdBase = `percent-bar-grad-${gradientIdCounter++}`;\n\n /** Per-row gradient id, unique across instances and rows. */\n private _gradId(index: number): string {\n return `${this._gradIdBase}-${index}`;\n }\n\n override firstUpdated() {\n this._ro = new ResizeObserver((entries) => {\n const w = Math.floor(entries[0].contentRect.width);\n if (w > 0 && w !== this._width) this._width = w;\n });\n this._ro.observe(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._ro?.disconnect();\n this._ro = null;\n }\n\n override render() {\n if (this._width === 0 || this.groups.length === 0) return html``;\n\n const innerW = this._width - PAD.left - PAD.right;\n const barMaxW = innerW - LABEL_W - PCT_W;\n const svgH = PAD.top + this.groups.length * ROW_H + PAD.bottom;\n\n const xScale = scaleLinear().domain([0, 100]).range([0, barMaxW]);\n\n // CSS stop styles preserve every valid CSS color format while matching\n // map-circle's 30% white/black vertical depth.\n const rowFills = this.groups.map((g, i) => {\n const color = g.color.trim();\n const gradId = this._gradId(i);\n return {\n fill: `url(#${gradId})`,\n gradient: svg`\n <linearGradient\n id=${gradId}\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n style=${styleMap({ \"--percent-bar-color\": color })}\n >\n <stop class=\"gradient-start\" offset=\"0%\" />\n <stop class=\"gradient-end\" offset=\"100%\" />\n </linearGradient>\n `,\n };\n });\n const gradients = rowFills.map((row) => row.gradient);\n\n const rows = this.groups.map((g, i) => {\n const cy = PAD.top + i * ROW_H + ROW_H / 2;\n const bw = Math.max(0, xScale(g.pct));\n return svg`\n <text class=\"chart-label\" x=${PAD.left} y=${cy} font-size=\"10\"\n text-anchor=\"start\" dominant-baseline=\"middle\">${g.label}</text>\n <rect x=${PAD.left + LABEL_W} y=${cy - 5}\n width=${bw} height=\"10\" rx=\"5\"\n fill=${rowFills[i].fill} />\n <text class=\"chart-label\" x=${PAD.left + LABEL_W + barMaxW + 4} y=${cy} font-size=\"10\"\n text-anchor=\"start\" dominant-baseline=\"middle\">${g.pct.toFixed(1)}%</text>\n `;\n });\n\n return html`\n <svg\n viewBox=\"0 0 ${this._width} ${svgH}\"\n width=${this._width}\n height=${svgH}\n role=\"img\"\n aria-label=${`Percentages: ${this.groups.map((group) => `${group.label} ${group.pct.toFixed(1)}%`).join(\", \")}`}\n >\n <defs>${gradients}</defs>\n ${rows}\n </svg>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"percent-bar-chart\": PercentBarChart;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"percent-bar-chart.js","sourceRoot":"","sources":["../src/percent-bar-chart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM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CAAA;;uBAEQ,IAAI,CAAC,MAAM,IAAI,IAAI;gBAC1B,IAAI,CAAC,MAAM;iBACV,IAAI;;qBAEA,GAAG,UAAU,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;;gBAEnG,IAAI,CAAC,gBAAgB,EAAE;UAC7B,OAAO;;KAEZ,CAAC;IACJ,CAAC;CACF,CAAA;AAxIiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CAAgC;AAEnD;IAAX,QAAQ,EAAE;6CAAkC;AAEjC;IAAX,QAAQ,EAAE;oDAAmD;AAElC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AAET;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDACN;AAER;IAAhB,KAAK,EAAE;+CAAoB;AA9CjB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA2K3B","sourcesContent":["import { LitElement, css, html, svg } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { scaleLinear } from \"d3-scale\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface PercentBarGroup {\n key: string;\n label: string;\n /**\n * The row's value. In `mode=\"percent\"` (default) this is a 0-100\n * percentage, scaled against a fixed domain. In `mode=\"value\"` this is an\n * arbitrary raw number, scaled against `max` (or the largest `value`\n * across `groups` when `max` is unset).\n */\n value: number;\n color: string;\n}\n\n/** Whether `PercentBarGroup.value` is a 0-100 percentage or an arbitrary raw number. */\nexport type PercentBarMode = \"percent\" | \"value\";\n/** Bars grow rightward as stacked rows, or upward as side-by-side columns. */\nexport type PercentBarOrientation = \"horizontal\" | \"vertical\";\n\n// Horizontal (row) layout.\nconst ROW_H = 20;\nconst LABEL_W = 56;\nconst VALUE_W = 36;\n\n// Vertical (column) layout.\nconst COL_TRACK_H = 96;\nconst CAT_LABEL_H = 16;\nconst VALUE_LABEL_H = 14;\nconst MAX_BAR_W = 28;\nconst COL_GAP = 8;\n\nconst PAD = { top: 4, right: 4, bottom: 4, left: 4 };\n\nlet gradientIdCounter = 0;\n\n/**\n * Bar chart for labeled rows, using D3's linear scale. Horizontal (default)\n * renders stacked rows with bars growing rightward; `orientation=\"vertical\"`\n * renders side-by-side columns growing upward instead. `mode=\"percent\"`\n * (default) scales `value` against a fixed 0-100 domain and labels it with a\n * `%` suffix; `mode=\"value\"` scales it against `max` (or the largest `value`\n * present) and formats it with `valueFormat`.\n *\n * @element percent-bar-chart\n */\n@customElement(\"percent-bar-chart\")\nexport class PercentBarChart extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n width: 100%;\n }\n svg {\n display: block;\n overflow: visible;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .chart-label {\n fill: var(--ui-text-muted, #64748b);\n }\n .gradient-start {\n stop-color: color-mix(in srgb, var(--percent-bar-color) 70%, #ffffff);\n }\n .gradient-end {\n stop-color: color-mix(in srgb, var(--percent-bar-color) 70%, #000000);\n }\n `,\n ];\n\n /** Rows to render, one per group. */\n @property({ attribute: false }) groups: PercentBarGroup[] = [];\n /** Whether `value` is a 0-100 percentage (fixed domain) or an arbitrary number (domain from data/`max`). */\n @property() mode: PercentBarMode = \"percent\";\n /** Bar direction: stacked rows growing rightward, or columns growing upward. */\n @property() orientation: PercentBarOrientation = \"horizontal\";\n /** Explicit domain max for `mode=\"value\"`; auto-computed from `groups` when unset. Ignored in `mode=\"percent\"`. */\n @property({ type: Number }) max?: number;\n /** Formats a row's value for its label in `mode=\"value\"`. Defaults to locale-formatted number. */\n @property({ attribute: false }) valueFormat: (value: number) => string = (value) =>\n value.toLocaleString();\n\n @state() private _width = 0;\n\n private _ro: ResizeObserver | null = null;\n private readonly _gradIdBase = `percent-bar-grad-${gradientIdCounter++}`;\n\n /** Per-row gradient id, unique across instances and rows. */\n private _gradId(index: number): string {\n return `${this._gradIdBase}-${index}`;\n }\n\n /** The row's value formatted for display, per the current `mode`. */\n private _labelFor(value: number): string {\n return this.mode === \"percent\" ? `${value.toFixed(1)}%` : this.valueFormat(value);\n }\n\n /** The scale domain's upper bound for the current `mode`. */\n private _domainMax(): number {\n if (this.mode === \"percent\") return 100;\n if (this.max !== undefined) return this.max;\n return Math.max(0.000001, ...this.groups.map((g) => g.value));\n }\n\n override firstUpdated() {\n this._ro = new ResizeObserver((entries) => {\n const w = Math.floor(entries[0].contentRect.width);\n if (w > 0 && w !== this._width) this._width = w;\n });\n this._ro.observe(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._ro?.disconnect();\n this._ro = null;\n }\n\n private _renderGradients() {\n return this.groups.map((g, i) => {\n const color = g.color.trim();\n const gradId = this._gradId(i);\n return svg`\n <linearGradient\n id=${gradId}\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n style=${styleMap({ \"--percent-bar-color\": color })}\n >\n <stop class=\"gradient-start\" offset=\"0%\" />\n <stop class=\"gradient-end\" offset=\"100%\" />\n </linearGradient>\n `;\n });\n }\n\n private _renderHorizontal() {\n const innerW = this._width - PAD.left - PAD.right;\n const barMaxW = innerW - LABEL_W - VALUE_W;\n const svgH = PAD.top + this.groups.length * ROW_H + PAD.bottom;\n const xScale = scaleLinear().domain([0, this._domainMax()]).range([0, barMaxW]);\n\n const rows = this.groups.map((g, i) => {\n const cy = PAD.top + i * ROW_H + ROW_H / 2;\n const bw = Math.max(0, xScale(g.value));\n return svg`\n <text class=\"chart-label\" x=${PAD.left} y=${cy} font-size=\"10\"\n text-anchor=\"start\" dominant-baseline=\"middle\">${g.label}</text>\n <rect x=${PAD.left + LABEL_W} y=${cy - 5}\n width=${bw} height=\"10\" rx=\"5\"\n fill=\"url(#${this._gradId(i)})\" />\n <text class=\"chart-label\" x=${PAD.left + LABEL_W + barMaxW + 4} y=${cy} font-size=\"10\"\n text-anchor=\"start\" dominant-baseline=\"middle\">${this._labelFor(g.value)}</text>\n `;\n });\n\n return { svgH, content: rows };\n }\n\n private _renderVertical() {\n const innerW = this._width - PAD.left - PAD.right;\n const n = this.groups.length;\n const colSlotW = n > 0 ? innerW / n : 0;\n const barW = Math.max(4, Math.min(MAX_BAR_W, colSlotW - COL_GAP));\n const svgH = PAD.top + VALUE_LABEL_H + COL_TRACK_H + CAT_LABEL_H + PAD.bottom;\n const yScale = scaleLinear().domain([0, this._domainMax()]).range([0, COL_TRACK_H]);\n\n const cols = this.groups.map((g, i) => {\n const cx = PAD.left + i * colSlotW + colSlotW / 2;\n const barH = Math.max(0, yScale(g.value));\n const barTop = PAD.top + VALUE_LABEL_H + (COL_TRACK_H - barH);\n const catLabelY = PAD.top + VALUE_LABEL_H + COL_TRACK_H + CAT_LABEL_H - 4;\n return svg`\n <rect x=${cx - barW / 2} y=${barTop} width=${barW} height=${barH} rx=${barW / 2}\n fill=\"url(#${this._gradId(i)})\" />\n <text class=\"chart-label\" x=${cx} y=${barTop - 4} font-size=\"10\"\n text-anchor=\"middle\">${this._labelFor(g.value)}</text>\n <text class=\"chart-label\" x=${cx} y=${catLabelY} font-size=\"10\"\n text-anchor=\"middle\">${g.label}</text>\n `;\n });\n\n return { svgH, content: cols };\n }\n\n override render() {\n if (this._width === 0 || this.groups.length === 0) return html``;\n\n const { svgH, content } =\n this.orientation === \"vertical\" ? this._renderVertical() : this._renderHorizontal();\n const ariaPrefix = this.mode === \"percent\" ? \"Percentages\" : \"Values\";\n\n return html`\n <svg\n viewBox=\"0 0 ${this._width} ${svgH}\"\n width=${this._width}\n height=${svgH}\n role=\"img\"\n aria-label=${`${ariaPrefix}: ${this.groups.map((g) => `${g.label} ${this._labelFor(g.value)}`).join(\", \")}`}\n >\n <defs>${this._renderGradients()}</defs>\n ${content}\n </svg>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"percent-bar-chart\": PercentBarChart;\n }\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Overlay button that appears once the page (or a given `target` container)
|
|
4
|
+
* has scrolled more than `threshold` pixels away from the bottom edge, and
|
|
5
|
+
* scrolls back to the bottom on click.
|
|
6
|
+
*
|
|
7
|
+
* With no `target` (default), the button is `position: fixed` to the
|
|
8
|
+
* viewport. When `target` is set, the button switches to `position:
|
|
9
|
+
* absolute` and expects to be placed as a descendant of a `position:
|
|
10
|
+
* relative` (or otherwise positioned) ancestor that establishes the visual
|
|
11
|
+
* bounds to float within — typically `target` itself, given `overflow-y:
|
|
12
|
+
* auto; position: relative`, so the button stays pinned to that container's
|
|
13
|
+
* own visible corner as its content scrolls, rather than floating over the
|
|
14
|
+
* whole page.
|
|
15
|
+
*
|
|
16
|
+
* @element scroll-to-bottom
|
|
17
|
+
* @fires scroll-to-bottom-triggered - The button was clicked, just before
|
|
18
|
+
* scrolling; detail: `{ target }`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ScrollToBottom extends LitElement {
|
|
21
|
+
#private;
|
|
22
|
+
static styles: import("lit").CSSResult[];
|
|
23
|
+
/** Scrollable container to control; `null` (default) scrolls `window`. */
|
|
24
|
+
target: HTMLElement | null;
|
|
25
|
+
/** Pixels scrolled away from the bottom before the button appears. */
|
|
26
|
+
threshold: number;
|
|
27
|
+
/** Visible button text, and its accessible name. */
|
|
28
|
+
label: string;
|
|
29
|
+
private _visible;
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
disconnectedCallback(): void;
|
|
32
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
33
|
+
protected updated(changed: PropertyValues): void;
|
|
34
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
"scroll-to-bottom": ScrollToBottom;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=scroll-to-bottom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-to-bottom.d.ts","sourceRoot":"","sources":["../src/scroll-to-bottom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAMjE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,cAAe,SAAQ,UAAU;;IAC5C,OAAgB,MAAM,4BA6EpB;IAEF,0EAA0E;IAC1C,MAAM,EAAE,WAAW,GAAG,IAAI,CAAQ;IAClE,sEAAsE;IAC1C,SAAS,SAAO;IAC5C,oDAAoD;IACxC,KAAK,SAAsB;IAE9B,OAAO,CAAC,QAAQ,CAAS;IAIzB,iBAAiB,IAAI,IAAI,CAGjC;IAEQ,oBAAoB,IAAI,IAAI,CAGpC;IAED,UAAmB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAU3D;IAED,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAExD;IA0BQ,MAAM,yCAOd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|