@logosphere-ui/core 0.0.0-alpha.5 → 0.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1204 -0
- package/dist/AGENTS.md +1204 -0
- package/dist/accordion-CYuCj7nB.cjs +21 -0
- package/dist/accordion-cDabqwu6.js +96 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +4 -0
- package/dist/atoms/Badge/badge.d.ts +1 -1
- package/dist/atoms/Button/button.d.ts +5 -3
- package/dist/atoms/Checkbox/checkbox.d.ts +13 -3
- package/dist/atoms/FormField/formfield.d.ts +12 -0
- package/dist/atoms/Slider/index.d.ts +1 -0
- package/dist/atoms/Slider/slider.d.ts +54 -0
- package/dist/badge-BhINg1p5.js +72 -0
- package/dist/badge-CKSG_MyA.cjs +13 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb-BOuCLUJh.cjs +12 -0
- package/dist/breadcrumb-BeJqq-5C.js +41 -0
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-CVkIa7M0.js +58 -0
- package/dist/button-vdNReBMi.cjs +10 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-C71sj3Ki.js +652 -0
- package/dist/calendar-DZJM5Tyu.cjs +88 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +4 -0
- package/dist/{card-CUhlTJyJ.js → card-C7xXMV3h.js} +26 -25
- package/dist/card-DmQRNKtk.cjs +43 -0
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/chatbot-BAou4THb.cjs +183 -0
- package/dist/chatbot-BRfqXYYt.js +564 -0
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +2 -2
- package/dist/checkbox-BAbPDN6x.cjs +53 -0
- package/dist/checkbox-CTfbav6M.js +152 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-D4DwnC37.cjs +26 -0
- package/dist/chip-group-DzfOd6Vw.js +89 -0
- package/dist/chip-group.cjs +1 -0
- package/dist/chip-group.js +4 -0
- package/dist/collapse-CbRE8ABx.cjs +47 -0
- package/dist/collapse-DY6SJ9jS.js +141 -0
- package/dist/collapse.cjs +1 -0
- package/dist/collapse.js +4 -0
- package/dist/combobox-BAa3UAQs.cjs +113 -0
- package/dist/combobox-BR05Tgfd.js +460 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/datepicker-BFYWQRrJ.js +382 -0
- package/dist/datepicker-BWE4qDJM.cjs +85 -0
- package/dist/datepicker.cjs +1 -1
- package/dist/datepicker.js +2 -2
- package/dist/{download-manager-A4fOxGWJ.js → download-manager-BPg-6Qfg.js} +4 -4
- package/dist/download-manager-DDeTYRPs.cjs +97 -0
- package/dist/download-manager.cjs +1 -1
- package/dist/download-manager.js +1 -1
- package/dist/drawer-CRu4G2zu.cjs +32 -0
- package/dist/drawer-DhuBPWHP.js +114 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.js +4 -0
- package/dist/formfield-JXiv9mvJ.cjs +33 -0
- package/dist/formfield-ss2mFweu.js +161 -0
- package/dist/formfield.cjs +1 -1
- package/dist/formfield.js +1 -1
- package/dist/icon.cjs +1 -0
- package/dist/icon.js +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +65 -32
- package/dist/index.umd.js +1613 -521
- package/dist/input-DyLKo7h6.cjs +60 -0
- package/dist/input-N3Z8D7q1.js +278 -0
- package/dist/input-group-C6sA1lzj.cjs +5 -0
- package/dist/input-group-DUPlrpug.js +66 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.js +4 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/left-menu.cjs +1 -0
- package/dist/left-menu.js +5 -0
- package/dist/leftmenu-DiKo8iud.cjs +120 -0
- package/dist/leftmenu-DlU_G4Sj.js +373 -0
- package/dist/modal-g3KbWncV.cjs +84 -0
- package/dist/modal-vSjEpYrG.js +250 -0
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/molecules/Accordion/accordion.d.ts +42 -0
- package/dist/molecules/Accordion/index.d.ts +2 -0
- package/dist/molecules/Chip/chip-group.d.ts +29 -0
- package/dist/molecules/Chip/index.d.ts +2 -0
- package/dist/molecules/Collapse/collapse.d.ts +42 -0
- package/dist/molecules/Collapse/index.d.ts +2 -0
- package/dist/molecules/Input/input.d.ts +24 -1
- package/dist/molecules/InputGroup/index.d.ts +1 -0
- package/dist/molecules/InputGroup/input-group.d.ts +40 -0
- package/dist/molecules/Pagination/index.d.ts +1 -0
- package/dist/molecules/Pagination/pagination.d.ts +60 -0
- package/dist/molecules/Popover/popover.d.ts +5 -0
- package/dist/molecules/SplitButton/index.d.ts +2 -0
- package/dist/molecules/SplitButton/split-button.d.ts +53 -0
- package/dist/molecules/Stepper/index.d.ts +2 -0
- package/dist/molecules/Stepper/stepper.d.ts +34 -0
- package/dist/molecules/Textarea/text-area.d.ts +5 -2
- package/dist/molecules/TimePicker/index.d.ts +2 -0
- package/dist/molecules/TimePicker/timepicker.d.ts +62 -0
- package/dist/organisms/Calendar/calendar.d.ts +54 -0
- package/dist/organisms/Calendar/index.d.ts +1 -0
- package/dist/organisms/Calendar/shared.d.ts +9 -0
- package/dist/organisms/Chatbot/chatbot.d.ts +10 -1
- package/dist/organisms/Chatbot/index.d.ts +1 -1
- package/dist/organisms/Combobox/combobox.d.ts +39 -0
- package/dist/organisms/DatePicker/datepicker.d.ts +35 -33
- package/dist/organisms/Drawer/drawer.d.ts +30 -0
- package/dist/organisms/Drawer/index.d.ts +1 -0
- package/dist/organisms/LeftMenu/index.d.ts +2 -0
- package/dist/organisms/LeftMenu/leftmenu-types.d.ts +24 -0
- package/dist/organisms/LeftMenu/leftmenu.d.ts +60 -0
- package/dist/organisms/Modal/modal.d.ts +29 -4
- package/dist/organisms/Tab/tab.d.ts +13 -1
- package/dist/organisms/Toast/index.d.ts +2 -0
- package/dist/organisms/Toast/toast-container.d.ts +42 -0
- package/dist/organisms/Toast/toast.d.ts +48 -0
- package/dist/organisms/TreeMenu/index.d.ts +1 -0
- package/dist/organisms/TreeMenu/tree-menu.d.ts +59 -0
- package/dist/pagination-CjXvpE2j.js +360 -0
- package/dist/pagination-Nnzacqdo.cjs +169 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.js +4 -0
- package/dist/popover-CrXUbUR-.cjs +30 -0
- package/dist/popover-M5ZcS5rj.js +161 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/shared/icons/index.d.ts +1 -0
- package/dist/shared/types/button.types.d.ts +7 -0
- package/dist/slider-DSRs5uhl.cjs +108 -0
- package/dist/slider-ntLRajQa.js +280 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.js +4 -0
- package/dist/split-button-BdBweoip.js +177 -0
- package/dist/split-button-BpffPlVg.cjs +63 -0
- package/dist/split-button.cjs +1 -0
- package/dist/split-button.js +4 -0
- package/dist/stepper-CZhwgLNp.js +122 -0
- package/dist/stepper-ZOMaU6aZ.cjs +52 -0
- package/dist/stepper.cjs +1 -0
- package/dist/stepper.js +4 -0
- package/dist/styles/main.css +186 -182
- package/dist/switch-Do6SCkPJ.cjs +17 -0
- package/dist/switch-uYVuohJ-.js +68 -0
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/tab-BvRVHpWs.cjs +41 -0
- package/dist/tab-Byh4UgFB.js +204 -0
- package/dist/tab.cjs +1 -1
- package/dist/tab.js +1 -1
- package/dist/text-area-1rALZ0iy.js +239 -0
- package/dist/text-area-D_TYL4_q.cjs +51 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timepicker-B9l6HN-d.js +320 -0
- package/dist/timepicker-Bpf2d4Nn.cjs +119 -0
- package/dist/timepicker.cjs +1 -0
- package/dist/timepicker.js +4 -0
- package/dist/toast-container-C5qYjInG.js +274 -0
- package/dist/toast-container-D2dyP20J.cjs +64 -0
- package/dist/toast.cjs +1 -0
- package/dist/toast.js +6 -0
- package/dist/tree-menu-BZ7aBC7R.js +237 -0
- package/dist/tree-menu-DDQ_DYl7.cjs +78 -0
- package/dist/tree-menu.cjs +1 -0
- package/dist/tree-menu.js +4 -0
- package/dist/ui-icon-BeR-PaPg.js +75 -0
- package/dist/ui-icon-DWl7I5BQ.cjs +22 -0
- package/package.json +104 -15
- package/dist/badge-BbhaO73N.cjs +0 -13
- package/dist/badge-DE7Tgd8Z.js +0 -71
- package/dist/breadcrumb-B-4yqoJZ.js +0 -41
- package/dist/breadcrumb-Cop-B1J7.cjs +0 -12
- package/dist/button-C1EwOosO.js +0 -58
- package/dist/button-CDRccsk9.cjs +0 -10
- package/dist/card-n8ka8Zk-.cjs +0 -43
- package/dist/chatbot-Da_itUdJ.cjs +0 -160
- package/dist/chatbot-zkxngMRH.js +0 -481
- package/dist/checkbox-7Rb3WKGx.js +0 -119
- package/dist/checkbox-CdDTRdKV.cjs +0 -37
- package/dist/combobox-BJbI-Tgi.js +0 -268
- package/dist/combobox-pmE7bgEL.cjs +0 -99
- package/dist/datepicker-DFJx45C-.js +0 -750
- package/dist/datepicker-b9JGTTMx.cjs +0 -115
- package/dist/download-manager-BSIMTGaK.cjs +0 -97
- package/dist/formfield-D_7NFFoe.cjs +0 -27
- package/dist/formfield-d8fp9FTV.js +0 -118
- package/dist/input-BcnI1w3_.cjs +0 -46
- package/dist/input-Bj_7u8Iv.js +0 -192
- package/dist/modal-Bfc6WQSL.js +0 -110
- package/dist/modal-DQ8VFL-P.cjs +0 -39
- package/dist/popover-B7tCqk3R.js +0 -140
- package/dist/popover-C2p5Pmts.cjs +0 -30
- package/dist/switch-Cpl53nRW.js +0 -64
- package/dist/switch-Rnnn10bn.cjs +0 -17
- package/dist/tab-BKdN4xAz.js +0 -176
- package/dist/tab-DcjAlXzU.cjs +0 -40
- package/dist/text-area-BkHdLnZj.cjs +0 -44
- package/dist/text-area-CC24lj8v.js +0 -204
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./toast";
|
|
3
|
+
import type { ToastActionConfig, ToastType } from "./toast";
|
|
4
|
+
export type ToastOptions = {
|
|
5
|
+
id?: string;
|
|
6
|
+
type?: ToastType;
|
|
7
|
+
title?: string;
|
|
8
|
+
text: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
closeable?: boolean;
|
|
11
|
+
autoDismiss?: boolean;
|
|
12
|
+
duration?: number;
|
|
13
|
+
action?: ToastActionConfig;
|
|
14
|
+
};
|
|
15
|
+
export declare class LogosphereToastContainer extends LitElement {
|
|
16
|
+
static styles: import("lit").CSSResult[];
|
|
17
|
+
private visibleToasts;
|
|
18
|
+
private queuedToasts;
|
|
19
|
+
show(options: ToastOptions): string;
|
|
20
|
+
close(id: string): void;
|
|
21
|
+
clear(): void;
|
|
22
|
+
private dequeue;
|
|
23
|
+
private toToast;
|
|
24
|
+
private createId;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
export declare class ToastService {
|
|
28
|
+
private static container?;
|
|
29
|
+
static show(options: ToastOptions): string;
|
|
30
|
+
static success(options: Omit<ToastOptions, "type">): string;
|
|
31
|
+
static danger(options: Omit<ToastOptions, "type">): string;
|
|
32
|
+
static warning(options: Omit<ToastOptions, "type">): string;
|
|
33
|
+
static info(options: Omit<ToastOptions, "type">): string;
|
|
34
|
+
static close(id: string): void;
|
|
35
|
+
static clear(): void;
|
|
36
|
+
private static getContainer;
|
|
37
|
+
}
|
|
38
|
+
declare global {
|
|
39
|
+
interface HTMLElementTagNameMap {
|
|
40
|
+
"logosphere-toast-container": LogosphereToastContainer;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "../../shared/icons/ui-icon";
|
|
3
|
+
import "../../atoms/Button/button";
|
|
4
|
+
export type ToastType = "success" | "danger" | "warning" | "info";
|
|
5
|
+
export type ToastActionConfig = {
|
|
6
|
+
okayLabel?: string;
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
onOkay?: () => void;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
closeOnAction?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare class LogosphereToast extends LitElement {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
type: ToastType;
|
|
15
|
+
title: string;
|
|
16
|
+
text: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
closeable: boolean;
|
|
19
|
+
duration: number;
|
|
20
|
+
autoDismiss: boolean;
|
|
21
|
+
action?: ToastActionConfig;
|
|
22
|
+
private isClosing;
|
|
23
|
+
private remainingMs;
|
|
24
|
+
private startedAt;
|
|
25
|
+
private timerId?;
|
|
26
|
+
private closeTimerId?;
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
30
|
+
close(reason?: "manual" | "auto"): void;
|
|
31
|
+
private get canAutoDismiss();
|
|
32
|
+
private get resolvedTitle();
|
|
33
|
+
private get resolvedText();
|
|
34
|
+
private get resolvedIcon();
|
|
35
|
+
private get hasActions();
|
|
36
|
+
private onActionClick;
|
|
37
|
+
private clearTimer;
|
|
38
|
+
private startTimer;
|
|
39
|
+
private pauseTimer;
|
|
40
|
+
private resumeTimer;
|
|
41
|
+
private restartTimer;
|
|
42
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
43
|
+
}
|
|
44
|
+
declare global {
|
|
45
|
+
interface HTMLElementTagNameMap {
|
|
46
|
+
"logosphere-toast": LogosphereToast;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tree-menu";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import "../../atoms/Badge/badge";
|
|
3
|
+
import "../../molecules/Popover/popover";
|
|
4
|
+
import "../../shared/icons/ui-icon";
|
|
5
|
+
import type { MenuBadge } from "../LeftMenu/leftmenu-types";
|
|
6
|
+
export type { MenuBadge as TreeMenuBadge };
|
|
7
|
+
export interface TreeMenuItem {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
iconName?: string;
|
|
13
|
+
badges?: MenuBadge[];
|
|
14
|
+
children?: TreeMenuItem[];
|
|
15
|
+
onClick?: (item: TreeMenuItem) => void;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare class TreeMenu extends LitElement {
|
|
19
|
+
static styles: import("lit").CSSResult[];
|
|
20
|
+
items: TreeMenuItem[];
|
|
21
|
+
expandedIds: string[];
|
|
22
|
+
expandOnLabelClick: boolean;
|
|
23
|
+
chevronPosition: "left" | "right";
|
|
24
|
+
showLabels: boolean;
|
|
25
|
+
leading: boolean;
|
|
26
|
+
iconSize: number;
|
|
27
|
+
private _expandedSet;
|
|
28
|
+
private _overflowedLabelIds;
|
|
29
|
+
private _resizeObserver?;
|
|
30
|
+
private _overflowMeasureFrame;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
34
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
35
|
+
private _scheduleOverflowedLabelSync;
|
|
36
|
+
private _syncOverflowedLabels;
|
|
37
|
+
private _setsEqual;
|
|
38
|
+
private _hasActiveDescendant;
|
|
39
|
+
private _isExpanded;
|
|
40
|
+
private _emitToggle;
|
|
41
|
+
private _emitItemClick;
|
|
42
|
+
private _emitNodeClick;
|
|
43
|
+
private _setExpanded;
|
|
44
|
+
private _toggle;
|
|
45
|
+
private _handleItemClick;
|
|
46
|
+
private _handleRowKeydown;
|
|
47
|
+
private _renderRootIcon;
|
|
48
|
+
private _renderLeading;
|
|
49
|
+
private _renderBadges;
|
|
50
|
+
private _renderLabel;
|
|
51
|
+
private _renderChevron;
|
|
52
|
+
private _renderNode;
|
|
53
|
+
render(): TemplateResult<1>;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface HTMLElementTagNameMap {
|
|
57
|
+
"logosphere-tree-menu": TreeMenu;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { LitElement as h, unsafeCSS as b, css as v, html as i, nothing as l } from "lit";
|
|
2
|
+
import { property as o, state as f, query as _ } from "lit/decorators.js";
|
|
3
|
+
import { live as y } from "lit/directives/live.js";
|
|
4
|
+
import "./ui-icon-BeR-PaPg.js";
|
|
5
|
+
import "./combobox-BR05Tgfd.js";
|
|
6
|
+
const m = ":host{display:block;width:100%}.pagination{display:flex;align-items:center;justify-content:space-between;padding:var(--pagination-padding, var(--spacing-4) var(--spacing-6));background-color:var(--pagination-bg, var(--color-body-bg));border-top:1px solid var(--color-border);font-family:var(--font-family-base);gap:var(--spacing-4)}.pagination--justify-end{justify-content:flex-end}.pagination--justify-start{justify-content:flex-start}.pagination--justify-center{justify-content:center}.pagination__nav{display:flex;align-items:center;gap:var(--spacing-1)}.pagination__nav-group{display:flex;align-items:center}.pagination__btn{display:flex;align-items:center;justify-content:center;padding:var(--spacing-2);border:none;background:transparent;border-radius:var(--radius-base);cursor:pointer;color:var(--pagination-color, var(--color-secondary));transition:background-color .15s ease,color .15s ease,opacity .15s ease}.pagination__btn:hover:not(:disabled){background-color:var(--pagination-item-bg-hover, var(--color-body-bg-hover))}.pagination__btn:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.pagination__btn:disabled{opacity:.4;cursor:not-allowed}.pagination__btn--icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:var(--spacing-2);border:1px solid var(--color-border);background-color:var(--pagination-item-bg, var(--color-body-bg));border-radius:var(--radius-base);cursor:pointer;color:var(--pagination-color, var(--color-secondary));transition:background-color .15s ease,border-color .15s ease,opacity .15s ease}.pagination__btn--icon:hover:not(:disabled){background-color:var(--pagination-item-bg-hover, var(--color-body-bg-hover));border-color:var(--color-border-hover)}.pagination__btn--icon:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.pagination__btn--icon:disabled{opacity:.4;cursor:not-allowed}.pagination__btn--text{display:flex;align-items:center;justify-content:center;gap:var(--spacing-1);height:32px;min-width:100px;padding:var(--spacing-1) var(--spacing-3);border:1px solid var(--color-border);background-color:var(--pagination-item-bg, var(--color-body-bg));border-radius:var(--radius-base);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);color:var(--pagination-color, var(--color-secondary));cursor:pointer;transition:all .15s ease}.pagination__btn--text:hover:not(:disabled){background-color:var(--pagination-item-bg-hover, var(--color-body-bg-hover));border-color:var(--color-border-hover)}.pagination__btn--text:disabled{color:var(--pagination-color-disabled, var(--color-secondary-disabled));cursor:not-allowed}.pagination__btn--number{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:var(--spacing-1) var(--spacing-3);border:1px solid var(--color-border);background-color:var(--pagination-item-bg, var(--color-body-bg));border-radius:var(--radius-base);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);color:var(--pagination-color, var(--color-secondary));cursor:pointer;transition:all .15s ease}.pagination__btn--number:hover:not(:disabled):not(.pagination__btn--active){background-color:var(--pagination-item-bg-hover, var(--color-body-bg-hover))}.pagination__btn--active{background-color:var(--pagination-active-bg, var(--color-secondary));border-color:var(--pagination-active-bg, var(--color-secondary));color:var(--pagination-active-color, white);font-weight:var(--font-weight-semibold)}.pagination__btn--ellipsis{border:none;background:transparent;cursor:default;min-width:32px}.pagination__btn--ellipsis:hover{background:transparent}.pagination__input-container{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px}.pagination__input{width:100%;height:100%;min-width:32px;padding:0;border:1px solid var(--color-border);border-radius:var(--radius-base);background-color:var(--pagination-item-bg, var(--color-body-bg));font-size:var(--font-size-sm);font-weight:var(--font-weight-regular);color:var(--color-body-text);text-align:center;outline:none;transition:border-color .15s ease}.pagination__input:focus{border-color:var(--color-primary)}.pagination__input::-webkit-outer-spin-button,.pagination__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.pagination__input[type=number]{-moz-appearance:textfield}.pagination__separator{font-size:var(--font-size-xs);font-weight:var(--font-weight-regular);color:var(--color-tertiary);line-height:18px;letter-spacing:-.12px;margin-right:var(--spacing-1)}.pagination__info{display:flex;align-items:center;gap:var(--spacing-2)}.pagination__page-info{display:flex;align-items:center;gap:var(--spacing-1);font-size:var(--font-size-xs);line-height:18px;letter-spacing:-.12px}.pagination__page-info-text{color:var(--pagination-color, var(--color-secondary))}.pagination__page-info-separator{color:var(--color-tertiary)}.pagination__total{display:flex;align-items:center;gap:var(--spacing-1);font-size:var(--font-size-xs);line-height:18px;letter-spacing:-.12px}.pagination__total-separator{color:var(--color-tertiary)}.pagination__total-text{color:var(--pagination-color, var(--color-secondary))}.pagination__page-size{display:flex;align-items:center}@media(max-width:768px){.pagination{flex-wrap:wrap;gap:var(--spacing-3);padding:var(--pagination-padding, var(--spacing-3) var(--spacing-4))}.pagination__btn--text{min-width:80px;font-size:var(--font-size-xs)}}@media(max-width:480px){.pagination__nav,.pagination__info{flex-wrap:wrap;justify-content:center}}";
|
|
7
|
+
var x = Object.defineProperty, n = (u, t, a, r) => {
|
|
8
|
+
for (var s = void 0, p = u.length - 1, g; p >= 0; p--)
|
|
9
|
+
(g = u[p]) && (s = g(t, a, s) || s);
|
|
10
|
+
return s && x(t, a, s), s;
|
|
11
|
+
};
|
|
12
|
+
const d = class d extends h {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.variant = "default", this.page = 1, this.pageSize = 25, this.total = 0, this.pageSizeOptions = [10, 25, 50, 100], this.showPageSize = !0, this.showTotal = !0, this.disabled = !1, this.prevLabel = "Önceki", this.nextLabel = "Sonraki", this.pageLabel = "Sayfa", this.perPageLabel = "/ sayfa", this.totalLabel = "kayıt", this.inputValue = "1", this.goFirst = () => {
|
|
15
|
+
this.canGoPrev && this.goToPage(1);
|
|
16
|
+
}, this.goPrev = () => {
|
|
17
|
+
this.canGoPrev && this.goToPage(this.page - 1);
|
|
18
|
+
}, this.goNext = () => {
|
|
19
|
+
this.canGoNext && this.goToPage(this.page + 1);
|
|
20
|
+
}, this.goLast = () => {
|
|
21
|
+
this.canGoNext && this.goToPage(this.totalPages);
|
|
22
|
+
}, this.handleInputChange = (t) => {
|
|
23
|
+
const a = t.target;
|
|
24
|
+
this.inputValue = a.value;
|
|
25
|
+
}, this.handleInputBlur = () => {
|
|
26
|
+
const t = parseInt(this.inputValue, 10);
|
|
27
|
+
isNaN(t) ? this.inputValue = String(this.page) : this.goToPage(t);
|
|
28
|
+
}, this.handleInputKeydown = (t) => {
|
|
29
|
+
t.key === "Enter" && t.target.blur();
|
|
30
|
+
}, this.handlePageSizeChange = (t) => {
|
|
31
|
+
const a = t.detail?.value?.[0];
|
|
32
|
+
if (a) {
|
|
33
|
+
const r = a.value;
|
|
34
|
+
r !== this.pageSize && (this.pageSize = r, this.page = 1, this.emitPageChange());
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
get totalPages() {
|
|
39
|
+
return Math.max(1, Math.ceil(this.total / this.pageSize));
|
|
40
|
+
}
|
|
41
|
+
get canGoPrev() {
|
|
42
|
+
return this.page > 1 && !this.disabled;
|
|
43
|
+
}
|
|
44
|
+
get canGoNext() {
|
|
45
|
+
return this.page < this.totalPages && !this.disabled;
|
|
46
|
+
}
|
|
47
|
+
firstUpdated() {
|
|
48
|
+
this.updateComboboxSelection();
|
|
49
|
+
}
|
|
50
|
+
updated(t) {
|
|
51
|
+
super.updated(t), t.has("page") && (this.inputValue = String(this.page)), t.has("pageSize") && this.updateComboboxSelection();
|
|
52
|
+
}
|
|
53
|
+
updateComboboxSelection() {
|
|
54
|
+
this._combobox && this.showPageSize && this._combobox.setSelected(this.selectedPageSizeItem);
|
|
55
|
+
}
|
|
56
|
+
emitPageChange() {
|
|
57
|
+
this.dispatchEvent(new CustomEvent("page-change", {
|
|
58
|
+
bubbles: !0,
|
|
59
|
+
composed: !0,
|
|
60
|
+
detail: {
|
|
61
|
+
page: this.page,
|
|
62
|
+
pageSize: this.pageSize,
|
|
63
|
+
totalPages: this.totalPages
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
goToPage(t) {
|
|
68
|
+
const a = Math.max(1, Math.min(t, this.totalPages));
|
|
69
|
+
a !== this.page && (this.page = a, this.emitPageChange());
|
|
70
|
+
}
|
|
71
|
+
get pageSizeItems() {
|
|
72
|
+
return this.pageSizeOptions.map((t) => ({
|
|
73
|
+
label: `${t} ${this.perPageLabel}`,
|
|
74
|
+
value: t
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
get selectedPageSizeItem() {
|
|
78
|
+
return [{ label: `${this.pageSize} ${this.perPageLabel}`, value: this.pageSize }];
|
|
79
|
+
}
|
|
80
|
+
getPageNumbers() {
|
|
81
|
+
const t = [], a = this.totalPages, r = this.page, s = 1;
|
|
82
|
+
if (a <= 7)
|
|
83
|
+
for (let p = 1; p <= a; p++) t.push(p);
|
|
84
|
+
else {
|
|
85
|
+
t.push(1), r > 3 && t.push("ellipsis");
|
|
86
|
+
const p = Math.max(2, r - s), g = Math.min(a - 1, r + s);
|
|
87
|
+
for (let c = p; c <= g; c++)
|
|
88
|
+
t.includes(c) || t.push(c);
|
|
89
|
+
r < a - 2 && t.push("ellipsis"), t.includes(a) || t.push(a);
|
|
90
|
+
}
|
|
91
|
+
return t;
|
|
92
|
+
}
|
|
93
|
+
renderNavButtons(t = !1) {
|
|
94
|
+
const a = t ? "pagination__btn--icon" : "pagination__btn";
|
|
95
|
+
return i`
|
|
96
|
+
<div class="pagination__nav-group">
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
class="${a}"
|
|
100
|
+
?disabled=${!this.canGoPrev}
|
|
101
|
+
@click=${this.goFirst}
|
|
102
|
+
aria-label="İlk sayfa"
|
|
103
|
+
>
|
|
104
|
+
<ui-icon name="uil-angle-double-left" size="16"></ui-icon>
|
|
105
|
+
</button>
|
|
106
|
+
<button
|
|
107
|
+
type="button"
|
|
108
|
+
class="${a}"
|
|
109
|
+
?disabled=${!this.canGoPrev}
|
|
110
|
+
@click=${this.goPrev}
|
|
111
|
+
aria-label="Önceki sayfa"
|
|
112
|
+
>
|
|
113
|
+
<ui-icon name="uil-angle-left" size="16"></ui-icon>
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
renderNavButtonsAfter(t = !1) {
|
|
119
|
+
const a = t ? "pagination__btn--icon" : "pagination__btn";
|
|
120
|
+
return i`
|
|
121
|
+
<div class="pagination__nav-group">
|
|
122
|
+
<button
|
|
123
|
+
type="button"
|
|
124
|
+
class="${a}"
|
|
125
|
+
?disabled=${!this.canGoNext}
|
|
126
|
+
@click=${this.goNext}
|
|
127
|
+
aria-label="Sonraki sayfa"
|
|
128
|
+
>
|
|
129
|
+
<ui-icon name="uil-angle-right" size="16"></ui-icon>
|
|
130
|
+
</button>
|
|
131
|
+
<button
|
|
132
|
+
type="button"
|
|
133
|
+
class="${a}"
|
|
134
|
+
?disabled=${!this.canGoNext}
|
|
135
|
+
@click=${this.goLast}
|
|
136
|
+
aria-label="Son sayfa"
|
|
137
|
+
>
|
|
138
|
+
<ui-icon name="uil-angle-double-right" size="16"></ui-icon>
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
`;
|
|
142
|
+
}
|
|
143
|
+
renderPageInput() {
|
|
144
|
+
return i`
|
|
145
|
+
<div class="pagination__input-container">
|
|
146
|
+
<input
|
|
147
|
+
type="number"
|
|
148
|
+
class="pagination__input"
|
|
149
|
+
.value=${y(this.inputValue)}
|
|
150
|
+
min="1"
|
|
151
|
+
max=${this.totalPages}
|
|
152
|
+
?disabled=${this.disabled}
|
|
153
|
+
@input=${this.handleInputChange}
|
|
154
|
+
@blur=${this.handleInputBlur}
|
|
155
|
+
@keydown=${this.handleInputKeydown}
|
|
156
|
+
aria-label="Sayfa numarası"
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
<span class="pagination__separator">/ ${this.totalPages}</span>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
renderPrevNextButtons() {
|
|
163
|
+
return i`
|
|
164
|
+
<button
|
|
165
|
+
type="button"
|
|
166
|
+
class="pagination__btn--text"
|
|
167
|
+
?disabled=${!this.canGoPrev}
|
|
168
|
+
@click=${this.goPrev}
|
|
169
|
+
>
|
|
170
|
+
<ui-icon name="uil-angle-left" size="16"></ui-icon>
|
|
171
|
+
${this.prevLabel}
|
|
172
|
+
</button>
|
|
173
|
+
<button
|
|
174
|
+
type="button"
|
|
175
|
+
class="pagination__btn--text"
|
|
176
|
+
?disabled=${!this.canGoNext}
|
|
177
|
+
@click=${this.goNext}
|
|
178
|
+
>
|
|
179
|
+
${this.nextLabel}
|
|
180
|
+
<ui-icon name="uil-angle-right" size="16"></ui-icon>
|
|
181
|
+
</button>
|
|
182
|
+
`;
|
|
183
|
+
}
|
|
184
|
+
renderPageInfo() {
|
|
185
|
+
return i`
|
|
186
|
+
<div class="pagination__page-info">
|
|
187
|
+
<span class="pagination__page-info-text">${this.pageLabel} ${this.page}</span>
|
|
188
|
+
<span class="pagination__page-info-separator">/</span>
|
|
189
|
+
<span class="pagination__page-info-text">${this.totalPages}</span>
|
|
190
|
+
</div>
|
|
191
|
+
`;
|
|
192
|
+
}
|
|
193
|
+
renderNumberButtons() {
|
|
194
|
+
const t = this.getPageNumbers();
|
|
195
|
+
return i`
|
|
196
|
+
${t.map(
|
|
197
|
+
(a, r) => a === "ellipsis" ? i`
|
|
198
|
+
<span
|
|
199
|
+
class="pagination__btn--number pagination__btn--ellipsis"
|
|
200
|
+
key="ellipsis-${r}"
|
|
201
|
+
>...</span>
|
|
202
|
+
` : i`
|
|
203
|
+
<button
|
|
204
|
+
type="button"
|
|
205
|
+
class="pagination__btn--number ${a === this.page ? "pagination__btn--active" : ""}"
|
|
206
|
+
?disabled=${this.disabled}
|
|
207
|
+
@click=${() => this.goToPage(a)}
|
|
208
|
+
aria-label="Sayfa ${a}"
|
|
209
|
+
aria-current=${a === this.page ? "page" : l}
|
|
210
|
+
>
|
|
211
|
+
${a}
|
|
212
|
+
</button>
|
|
213
|
+
`
|
|
214
|
+
)}
|
|
215
|
+
`;
|
|
216
|
+
}
|
|
217
|
+
renderPageSizeDropdown() {
|
|
218
|
+
return this.showPageSize ? i`
|
|
219
|
+
<div class="pagination__page-size">
|
|
220
|
+
<logosphere-combobox
|
|
221
|
+
.items=${this.pageSizeItems}
|
|
222
|
+
.disabled=${this.disabled}
|
|
223
|
+
.clearable=${!1}
|
|
224
|
+
optionLabel="label"
|
|
225
|
+
optionValue="value"
|
|
226
|
+
placeholder=""
|
|
227
|
+
@change=${this.handlePageSizeChange}
|
|
228
|
+
></logosphere-combobox>
|
|
229
|
+
</div>
|
|
230
|
+
` : l;
|
|
231
|
+
}
|
|
232
|
+
renderTotalInfo() {
|
|
233
|
+
return this.showTotal ? i`
|
|
234
|
+
<div class="pagination__total">
|
|
235
|
+
<span class="pagination__total-separator">/</span>
|
|
236
|
+
<span class="pagination__total-text">${this.total} ${this.totalLabel}</span>
|
|
237
|
+
</div>
|
|
238
|
+
` : l;
|
|
239
|
+
}
|
|
240
|
+
renderDefault() {
|
|
241
|
+
return i`
|
|
242
|
+
<div class="pagination__nav">
|
|
243
|
+
${this.renderNavButtons()}
|
|
244
|
+
${this.renderPageInput()}
|
|
245
|
+
${this.renderNavButtonsAfter()}
|
|
246
|
+
</div>
|
|
247
|
+
<div class="pagination__info">
|
|
248
|
+
${this.renderPageSizeDropdown()}
|
|
249
|
+
${this.renderTotalInfo()}
|
|
250
|
+
</div>
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
253
|
+
renderPrevNext() {
|
|
254
|
+
return i`
|
|
255
|
+
<div class="pagination__nav" style="gap: 8px;">
|
|
256
|
+
${this.renderPrevNextButtons()}
|
|
257
|
+
</div>
|
|
258
|
+
<div class="pagination__info">
|
|
259
|
+
${this.renderPageInfo()}
|
|
260
|
+
</div>
|
|
261
|
+
`;
|
|
262
|
+
}
|
|
263
|
+
renderPrevNextInverted() {
|
|
264
|
+
return i`
|
|
265
|
+
<div class="pagination__info">
|
|
266
|
+
${this.renderPageInfo()}
|
|
267
|
+
</div>
|
|
268
|
+
<div class="pagination__nav" style="gap: 8px;">
|
|
269
|
+
${this.renderPrevNextButtons()}
|
|
270
|
+
</div>
|
|
271
|
+
`;
|
|
272
|
+
}
|
|
273
|
+
renderPrevNextOnly() {
|
|
274
|
+
return i`
|
|
275
|
+
<div class="pagination__nav" style="gap: 8px; margin-left: auto;">
|
|
276
|
+
${this.renderPrevNextButtons()}
|
|
277
|
+
</div>
|
|
278
|
+
`;
|
|
279
|
+
}
|
|
280
|
+
renderNumberButtonsVariant() {
|
|
281
|
+
return i`
|
|
282
|
+
<div class="pagination__nav">
|
|
283
|
+
${this.renderNavButtons(!0)}
|
|
284
|
+
${this.renderNumberButtons()}
|
|
285
|
+
${this.renderNavButtonsAfter(!0)}
|
|
286
|
+
</div>
|
|
287
|
+
<div class="pagination__info">
|
|
288
|
+
${this.renderPageSizeDropdown()}
|
|
289
|
+
${this.renderTotalInfo()}
|
|
290
|
+
</div>
|
|
291
|
+
`;
|
|
292
|
+
}
|
|
293
|
+
render() {
|
|
294
|
+
const t = this.variant === "prev-next-only" ? "pagination--justify-end" : "";
|
|
295
|
+
return i`
|
|
296
|
+
<nav
|
|
297
|
+
class="pagination ${t}"
|
|
298
|
+
role="navigation"
|
|
299
|
+
aria-label="Sayfalama"
|
|
300
|
+
>
|
|
301
|
+
${this.variant === "default" ? this.renderDefault() : l}
|
|
302
|
+
${this.variant === "prev-next" ? this.renderPrevNext() : l}
|
|
303
|
+
${this.variant === "prev-next-inverted" ? this.renderPrevNextInverted() : l}
|
|
304
|
+
${this.variant === "prev-next-only" ? this.renderPrevNextOnly() : l}
|
|
305
|
+
${this.variant === "number-buttons" ? this.renderNumberButtonsVariant() : l}
|
|
306
|
+
</nav>
|
|
307
|
+
`;
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
d.styles = [v`${b(m)}`];
|
|
311
|
+
let e = d;
|
|
312
|
+
n([
|
|
313
|
+
o({ type: String })
|
|
314
|
+
], e.prototype, "variant");
|
|
315
|
+
n([
|
|
316
|
+
o({ type: Number })
|
|
317
|
+
], e.prototype, "page");
|
|
318
|
+
n([
|
|
319
|
+
o({ type: Number })
|
|
320
|
+
], e.prototype, "pageSize");
|
|
321
|
+
n([
|
|
322
|
+
o({ type: Number })
|
|
323
|
+
], e.prototype, "total");
|
|
324
|
+
n([
|
|
325
|
+
o({ type: Array })
|
|
326
|
+
], e.prototype, "pageSizeOptions");
|
|
327
|
+
n([
|
|
328
|
+
o({ type: Boolean })
|
|
329
|
+
], e.prototype, "showPageSize");
|
|
330
|
+
n([
|
|
331
|
+
o({ type: Boolean })
|
|
332
|
+
], e.prototype, "showTotal");
|
|
333
|
+
n([
|
|
334
|
+
o({ type: Boolean })
|
|
335
|
+
], e.prototype, "disabled");
|
|
336
|
+
n([
|
|
337
|
+
o({ type: String })
|
|
338
|
+
], e.prototype, "prevLabel");
|
|
339
|
+
n([
|
|
340
|
+
o({ type: String })
|
|
341
|
+
], e.prototype, "nextLabel");
|
|
342
|
+
n([
|
|
343
|
+
o({ type: String })
|
|
344
|
+
], e.prototype, "pageLabel");
|
|
345
|
+
n([
|
|
346
|
+
o({ type: String })
|
|
347
|
+
], e.prototype, "perPageLabel");
|
|
348
|
+
n([
|
|
349
|
+
o({ type: String })
|
|
350
|
+
], e.prototype, "totalLabel");
|
|
351
|
+
n([
|
|
352
|
+
f()
|
|
353
|
+
], e.prototype, "inputValue");
|
|
354
|
+
n([
|
|
355
|
+
_("logosphere-combobox")
|
|
356
|
+
], e.prototype, "_combobox");
|
|
357
|
+
customElements.get("logosphere-pagination") || customElements.define("logosphere-pagination", e);
|
|
358
|
+
export {
|
|
359
|
+
e as P
|
|
360
|
+
};
|