wj-elements 0.1.151 → 0.1.152
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/packages/index.d.ts +104 -0
- package/dist/packages/localize/localize.d.ts +17 -0
- package/dist/packages/translations/en-gb.d.ts +18 -0
- package/dist/packages/translations/sk-sk.d.ts +13 -0
- package/dist/packages/utils/animations.d.ts +2 -0
- package/dist/packages/utils/date.d.ts +1 -0
- package/dist/packages/utils/element-utils.d.ts +46 -0
- package/dist/packages/utils/event.d.ts +67 -0
- package/dist/packages/utils/localize.d.ts +4 -0
- package/dist/packages/utils/permissions-api.d.ts +34 -0
- package/dist/packages/utils/utils.d.ts +1 -0
- package/dist/packages/utils/wje-import-firefox.d.ts +0 -0
- package/dist/packages/utils/wje-import.d.ts +0 -0
- package/dist/packages/wje-accordion/accordion.d.ts +2 -0
- package/dist/packages/wje-accordion/accordion.element.d.ts +72 -0
- package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
- package/dist/packages/wje-accordion-item/accordion-item.d.ts +2 -0
- package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +40 -0
- package/dist/packages/wje-animation/animation.d.ts +2 -0
- package/dist/packages/wje-animation/animation.element.d.ts +158 -0
- package/dist/packages/wje-animation/animation.test.d.ts +1 -0
- package/dist/packages/wje-aside/aside.d.ts +2 -0
- package/dist/packages/wje-aside/aside.element.d.ts +31 -0
- package/dist/packages/wje-avatar/avatar.d.ts +2 -0
- package/dist/packages/wje-avatar/avatar.element.d.ts +76 -0
- package/dist/packages/wje-avatar/avatar.test.d.ts +1 -0
- package/dist/packages/wje-avatar/service/service.d.ts +40 -0
- package/dist/packages/wje-badge/badge.d.ts +2 -0
- package/dist/packages/wje-badge/badge.element.d.ts +35 -0
- package/dist/packages/wje-badge/badge.test.d.ts +1 -0
- package/dist/packages/wje-breadcrumb/breadcrumb.d.ts +2 -0
- package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +80 -0
- package/dist/packages/wje-breadcrumbs/breadcrumbs.d.ts +2 -0
- package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +97 -0
- package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +1 -0
- package/dist/packages/wje-button/button.d.ts +2 -0
- package/dist/packages/wje-button/button.element.d.ts +173 -0
- package/dist/packages/wje-button/button.test.d.ts +1 -0
- package/dist/packages/wje-button-group/button-group.d.ts +2 -0
- package/dist/packages/wje-button-group/button-group.element.d.ts +39 -0
- package/dist/packages/wje-card/card.d.ts +2 -0
- package/dist/packages/wje-card/card.element.d.ts +29 -0
- package/dist/packages/wje-card-content/card-content.d.ts +2 -0
- package/dist/packages/wje-card-content/card-content.element.d.ts +22 -0
- package/dist/packages/wje-card-controls/card-controls.d.ts +2 -0
- package/dist/packages/wje-card-controls/card-controls.element.d.ts +23 -0
- package/dist/packages/wje-card-header/card-header.d.ts +2 -0
- package/dist/packages/wje-card-header/card-header.element.d.ts +22 -0
- package/dist/packages/wje-card-subtitle/card-subtitle.d.ts +2 -0
- package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +30 -0
- package/dist/packages/wje-card-title/card-title.d.ts +2 -0
- package/dist/packages/wje-card-title/card-title.element.d.ts +32 -0
- package/dist/packages/wje-carousel/carousel.d.ts +2 -0
- package/dist/packages/wje-carousel/carousel.element.d.ts +146 -0
- package/dist/packages/wje-carousel-item/carousel-item.d.ts +2 -0
- package/dist/packages/wje-carousel-item/carousel-item.element.d.ts +38 -0
- package/dist/packages/wje-checkbox/checkbox.d.ts +2 -0
- package/dist/packages/wje-checkbox/checkbox.element.d.ts +171 -0
- package/dist/packages/wje-chip/chip.d.ts +2 -0
- package/dist/packages/wje-chip/chip.element.d.ts +30 -0
- package/dist/packages/wje-col/col.d.ts +2 -0
- package/dist/packages/wje-col/col.element.d.ts +16 -0
- package/dist/packages/wje-color-picker/color-picker.d.ts +2 -0
- package/dist/packages/wje-color-picker/color-picker.element.d.ts +187 -0
- package/dist/packages/wje-color-picker/color-picker.test.d.ts +1 -0
- package/dist/packages/wje-container/container.d.ts +2 -0
- package/dist/packages/wje-container/container.element.d.ts +31 -0
- package/dist/packages/wje-copy-button/copy-button.d.ts +2 -0
- package/dist/packages/wje-copy-button/copy-button.element.d.ts +89 -0
- package/dist/packages/wje-copy-button/service/service.d.ts +12 -0
- package/dist/packages/wje-dialog/dialog.d.ts +2 -0
- package/dist/packages/wje-dialog/dialog.element.d.ts +116 -0
- package/dist/packages/wje-divider/divider.d.ts +2 -0
- package/dist/packages/wje-divider/divider.element.d.ts +32 -0
- package/dist/packages/wje-dropdown/dropdown.d.ts +2 -0
- package/dist/packages/wje-dropdown/dropdown.element.d.ts +85 -0
- package/dist/packages/wje-element/element.d.ts +316 -0
- package/dist/packages/wje-element/service/universal-service.d.ts +18 -0
- package/dist/packages/wje-file-upload/file-upload.d.ts +2 -0
- package/dist/packages/wje-file-upload/file-upload.element.d.ts +191 -0
- package/dist/packages/wje-file-upload/service/service.d.ts +70 -0
- package/dist/packages/wje-file-upload-item/file-upload-item.d.ts +2 -0
- package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +66 -0
- package/dist/packages/wje-footer/footer.d.ts +2 -0
- package/dist/packages/wje-footer/footer.element.d.ts +28 -0
- package/dist/packages/wje-form/form.d.ts +2 -0
- package/dist/packages/wje-form/form.element.d.ts +28 -0
- package/dist/packages/wje-format-digital/format-digital.d.ts +2 -0
- package/dist/packages/wje-format-digital/format-digital.element.d.ts +87 -0
- package/dist/packages/wje-format-digital/format-digital.test.d.ts +1 -0
- package/dist/packages/wje-grid/grid.d.ts +2 -0
- package/dist/packages/wje-grid/grid.element.d.ts +26 -0
- package/dist/packages/wje-header/header.d.ts +2 -0
- package/dist/packages/wje-header/header.element.d.ts +35 -0
- package/dist/packages/wje-icon/icon.d.ts +2 -0
- package/dist/packages/wje-icon/icon.element.d.ts +40 -0
- package/dist/packages/wje-icon/service/service.d.ts +11 -0
- package/dist/packages/wje-icon-picker/icon-picker.d.ts +2 -0
- package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +197 -0
- package/dist/packages/wje-img/img.d.ts +2 -0
- package/dist/packages/wje-img/img.element.d.ts +117 -0
- package/dist/packages/wje-img-comparer/img-comparer.d.ts +2 -0
- package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +60 -0
- package/dist/packages/wje-img-comparer/service/service.d.ts +1 -0
- package/dist/packages/wje-infinite-scroll/infinite-scroll.d.ts +2 -0
- package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +173 -0
- package/dist/packages/wje-input/input.d.ts +2 -0
- package/dist/packages/wje-input/input.element.d.ts +204 -0
- package/dist/packages/wje-input-file/input-file.d.ts +2 -0
- package/dist/packages/wje-input-file/input-file.element.d.ts +50 -0
- package/dist/packages/wje-item/item.d.ts +2 -0
- package/dist/packages/wje-item/item.element.d.ts +68 -0
- package/dist/packages/wje-kanban/kanban.d.ts +2 -0
- package/dist/packages/wje-kanban/kanban.element.d.ts +183 -0
- package/dist/packages/wje-label/label.d.ts +2 -0
- package/dist/packages/wje-label/label.element.d.ts +34 -0
- package/dist/packages/wje-level-indicator/level-indicator.d.ts +2 -0
- package/dist/packages/wje-level-indicator/level-indicator.element.d.ts +91 -0
- package/dist/packages/wje-list/list.d.ts +2 -0
- package/dist/packages/wje-list/list.element.d.ts +31 -0
- package/dist/packages/wje-main/main.d.ts +2 -0
- package/dist/packages/wje-main/main.element.d.ts +30 -0
- package/dist/packages/wje-masonry/masonry.d.ts +2 -0
- package/dist/packages/wje-masonry/masonry.element.d.ts +114 -0
- package/dist/packages/wje-masonry/service/service.d.ts +32 -0
- package/dist/packages/wje-menu/menu.d.ts +2 -0
- package/dist/packages/wje-menu/menu.element.d.ts +47 -0
- package/dist/packages/wje-menu-button/menu-button.d.ts +2 -0
- package/dist/packages/wje-menu-button/menu-button.element.d.ts +34 -0
- package/dist/packages/wje-menu-item/menu-item.d.ts +2 -0
- package/dist/packages/wje-menu-item/menu-item.element.d.ts +139 -0
- package/dist/packages/wje-menu-label/menu-label.d.ts +2 -0
- package/dist/packages/wje-menu-label/menu-label.element.d.ts +39 -0
- package/dist/packages/wje-option/option.d.ts +2 -0
- package/dist/packages/wje-option/option.element.d.ts +59 -0
- package/dist/packages/wje-options/options.d.ts +2 -0
- package/dist/packages/wje-options/options.element.d.ts +183 -0
- package/dist/packages/wje-orgchart/orgchart.d.ts +2 -0
- package/dist/packages/wje-orgchart/orgchart.element.d.ts +24 -0
- package/dist/packages/wje-orgchart-group/orgchart-group.d.ts +2 -0
- package/dist/packages/wje-orgchart-group/orgchart-group.element.d.ts +28 -0
- package/dist/packages/wje-orgchart-item/orgchart-item.d.ts +2 -0
- package/dist/packages/wje-orgchart-item/orgchart-item.element.d.ts +49 -0
- package/dist/packages/wje-pagination/pagination.d.ts +2 -0
- package/dist/packages/wje-pagination/pagination.element.d.ts +166 -0
- package/dist/packages/wje-pagination/pagination.test.d.ts +1 -0
- package/dist/packages/wje-pagination/service/service.d.ts +9 -0
- package/dist/packages/wje-panel/panel.d.ts +2 -0
- package/dist/packages/wje-panel/panel.element.d.ts +34 -0
- package/dist/packages/wje-popup/popup.d.ts +2 -0
- package/dist/packages/wje-popup/popup.element.d.ts +93 -0
- package/dist/packages/wje-progress-bar/progress-bar.d.ts +2 -0
- package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +96 -0
- package/dist/packages/wje-qr-code/qr-code.d.ts +2 -0
- package/dist/packages/wje-qr-code/qr-code.element.d.ts +33 -0
- package/dist/packages/wje-radio/radio.d.ts +2 -0
- package/dist/packages/wje-radio/radio.element.d.ts +53 -0
- package/dist/packages/wje-radio-group/radio-group.d.ts +2 -0
- package/dist/packages/wje-radio-group/radio-group.element.d.ts +137 -0
- package/dist/packages/wje-rate/rate.d.ts +2 -0
- package/dist/packages/wje-rate/rate.element.d.ts +156 -0
- package/dist/packages/wje-relative-time/relative-time.d.ts +2 -0
- package/dist/packages/wje-relative-time/relative-time.element.d.ts +55 -0
- package/dist/packages/wje-relative-time/relative-time.test.d.ts +1 -0
- package/dist/packages/wje-reorder/reorder.d.ts +2 -0
- package/dist/packages/wje-reorder/reorder.element.d.ts +119 -0
- package/dist/packages/wje-reorder-dropzone/reorder-dropzone.d.ts +2 -0
- package/dist/packages/wje-reorder-dropzone/reorder-dropzone.element.d.ts +23 -0
- package/dist/packages/wje-reorder-handle/reorder-handle.d.ts +2 -0
- package/dist/packages/wje-reorder-handle/reorder-handle.element.d.ts +75 -0
- package/dist/packages/wje-reorder-item/reorder-item.d.ts +2 -0
- package/dist/packages/wje-reorder-item/reorder-item.element.d.ts +24 -0
- package/dist/packages/wje-route/route.d.ts +2 -0
- package/dist/packages/wje-route/route.element.d.ts +22 -0
- package/dist/packages/wje-router/router.d.ts +2 -0
- package/dist/packages/wje-router/router.element.d.ts +39 -0
- package/dist/packages/wje-router-link/router-link.d.ts +2 -0
- package/dist/packages/wje-router-link/router-link.element.d.ts +31 -0
- package/dist/packages/wje-router-outlet/router-outlet.d.ts +2 -0
- package/dist/packages/wje-router-outlet/router-outlet.element.d.ts +15 -0
- package/dist/packages/wje-row/row.d.ts +2 -0
- package/dist/packages/wje-row/row.element.d.ts +23 -0
- package/dist/packages/wje-select/select.d.ts +2 -0
- package/dist/packages/wje-select/select.element.d.ts +315 -0
- package/dist/packages/wje-slider/slider.d.ts +2 -0
- package/dist/packages/wje-slider/slider.element.d.ts +103 -0
- package/dist/packages/wje-split-view/service/service.d.ts +1 -0
- package/dist/packages/wje-split-view/split-view.d.ts +2 -0
- package/dist/packages/wje-split-view/split-view.element.d.ts +66 -0
- package/dist/packages/wje-status/status.d.ts +2 -0
- package/dist/packages/wje-status/status.element.d.ts +26 -0
- package/dist/packages/wje-step/step.d.ts +2 -0
- package/dist/packages/wje-step/step.element.d.ts +23 -0
- package/dist/packages/wje-stepper/stepper.d.ts +2 -0
- package/dist/packages/wje-stepper/stepper.element.d.ts +78 -0
- package/dist/packages/wje-store/default-store-actions.d.ts +25 -0
- package/dist/packages/wje-store/pubsub.d.ts +21 -0
- package/dist/packages/wje-store/store.d.ts +153 -0
- package/dist/packages/wje-tab/tab.d.ts +2 -0
- package/dist/packages/wje-tab/tab.element.d.ts +41 -0
- package/dist/packages/wje-tab-group/tab-group.d.ts +2 -0
- package/dist/packages/wje-tab-group/tab-group.element.d.ts +67 -0
- package/dist/packages/wje-tab-panel/tab-panel.d.ts +2 -0
- package/dist/packages/wje-tab-panel/tab-panel.element.d.ts +23 -0
- package/dist/packages/wje-textarea/textarea.d.ts +2 -0
- package/dist/packages/wje-textarea/textarea.element.d.ts +176 -0
- package/dist/packages/wje-thumbnail/thumbnail.d.ts +2 -0
- package/dist/packages/wje-thumbnail/thumbnail.element.d.ts +31 -0
- package/dist/packages/wje-timeline/timeline.d.ts +2 -0
- package/dist/packages/wje-timeline/timeline.element.d.ts +25 -0
- package/dist/packages/wje-timeline-item/timeline-item.d.ts +2 -0
- package/dist/packages/wje-timeline-item/timeline-item.element.d.ts +27 -0
- package/dist/packages/wje-toast/toast.d.ts +2 -0
- package/dist/packages/wje-toast/toast.element.d.ts +173 -0
- package/dist/packages/wje-toast/toast.test.d.ts +1 -0
- package/dist/packages/wje-toggle/toggle.d.ts +2 -0
- package/dist/packages/wje-toggle/toggle.element.d.ts +65 -0
- package/dist/packages/wje-toolbar/toolbar.d.ts +2 -0
- package/dist/packages/wje-toolbar/toolbar.element.d.ts +39 -0
- package/dist/packages/wje-toolbar-action/toolbar-action.d.ts +2 -0
- package/dist/packages/wje-toolbar-action/toolbar-action.element.d.ts +35 -0
- package/dist/packages/wje-tooltip/tooltip.d.ts +2 -0
- package/dist/packages/wje-tooltip/tooltip.element.d.ts +71 -0
- package/dist/packages/wje-tree/tree.d.ts +2 -0
- package/dist/packages/wje-tree/tree.element.d.ts +104 -0
- package/dist/packages/wje-tree/tree.test.d.ts +1 -0
- package/dist/packages/wje-tree-item/tree-item.d.ts +2 -0
- package/dist/packages/wje-tree-item/tree-item.element.d.ts +155 -0
- package/dist/packages/wje-tree-item/tree-item.test.d.ts +1 -0
- package/dist/packages/wje-visually-hidden/visually-hidden.d.ts +2 -0
- package/dist/packages/wje-visually-hidden/visually-hidden.element.d.ts +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { default as WJElement } from '../wje-element/element.js';
|
|
2
|
+
/**
|
|
3
|
+
* `InfiniteScroll` is a custom web component that represents an infinite scroll.
|
|
4
|
+
* It extends from `WJElement`.
|
|
5
|
+
* @summary This element allows users to scroll through a potentially infinite amount of content.
|
|
6
|
+
* @documentation https://elements.webjet.sk/components/infinite-scroll
|
|
7
|
+
* @status stable
|
|
8
|
+
* @augments {WJElement}
|
|
9
|
+
* @csspart loader - The loader part of the infinite scroll.
|
|
10
|
+
* @slot - The default slot for the infinite scroll.
|
|
11
|
+
* @cssproperty [--wje-infinite-scroll-width=100%] - Sets the width of the infinite scroll container. his property determines how wide the infinite scroll area will be relative to its parent element. Accepts any valid CSS width value, such as percentages (`%`), pixels (`px`), or viewport units (`vw`). The default value is `100%`, which makes it span the full width of its container.
|
|
12
|
+
* @cssproperty [--wje-infinite-scroll-height=300px] - Defines the height of the infinite scroll container. This property specifies how tall the infinite scroll area should be. Accepts any valid CSS height value, such as pixels (`px`), percentages (`%`), or viewport units (`vh`). The default value is `300px`, providing a fixed height suitable for most use cases.
|
|
13
|
+
* //@fires wje-infinite-scroll:click-item - Event fired when an item is clicked.
|
|
14
|
+
* @tag wje-infinite-scroll
|
|
15
|
+
*/
|
|
16
|
+
export default class InfiniteScroll extends WJElement {
|
|
17
|
+
/**
|
|
18
|
+
* Returns the CSS styles for the component.
|
|
19
|
+
* @static
|
|
20
|
+
* @returns {CSSStyleSheet}
|
|
21
|
+
*/
|
|
22
|
+
static get cssStyleSheet(): CSSStyleSheet;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the list of attributes to observe for changes.
|
|
25
|
+
* @static
|
|
26
|
+
* @returns {Array<string>}
|
|
27
|
+
*/
|
|
28
|
+
static get observedAttributes(): string[];
|
|
29
|
+
totalPages: number;
|
|
30
|
+
isLoading: any[];
|
|
31
|
+
_response: {};
|
|
32
|
+
iterate: Element;
|
|
33
|
+
_infiniteScrollTemplate: any;
|
|
34
|
+
_abortController: AbortController;
|
|
35
|
+
_signal: AbortSignal;
|
|
36
|
+
/**
|
|
37
|
+
* Dependencies of the InfiniteScroll component.
|
|
38
|
+
* @param value
|
|
39
|
+
*/
|
|
40
|
+
set infiniteScrollTemplate(value: null);
|
|
41
|
+
/**
|
|
42
|
+
* Getter for the infiniteScrollTemplate property.
|
|
43
|
+
* @returns {null}
|
|
44
|
+
*/
|
|
45
|
+
get infiniteScrollTemplate(): null;
|
|
46
|
+
/**
|
|
47
|
+
* Dependencies of the InfiniteScroll component.
|
|
48
|
+
* @param value
|
|
49
|
+
*/
|
|
50
|
+
set response(value: any);
|
|
51
|
+
/**
|
|
52
|
+
* Getter for the response property.
|
|
53
|
+
* @returns {*|{}}
|
|
54
|
+
*/
|
|
55
|
+
get response(): any;
|
|
56
|
+
/**
|
|
57
|
+
* Dependencies of the InfiniteScroll component.
|
|
58
|
+
* @param value
|
|
59
|
+
*/
|
|
60
|
+
set objectName(value: string);
|
|
61
|
+
get objectName(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Prepares the component for updates before it is drawn.
|
|
64
|
+
* This method handles the removal of templates for iteration, adjusts the height styling of the component,
|
|
65
|
+
* and manages abort signals for loading operations.
|
|
66
|
+
* @returns {void} No return value.
|
|
67
|
+
*/
|
|
68
|
+
beforeDraw(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Creates and returns a document fragment containing the structure for an infinite scroll component.
|
|
71
|
+
* The structure includes native elements, slots for customization, and optional loading content.
|
|
72
|
+
* @returns {DocumentFragment} The document fragment containing the component's DOM structure.
|
|
73
|
+
*/
|
|
74
|
+
draw(): DocumentFragment;
|
|
75
|
+
loadingEl: HTMLDivElement;
|
|
76
|
+
endingEl: HTMLSlotElement;
|
|
77
|
+
/**
|
|
78
|
+
* Called after the component has been drawn.
|
|
79
|
+
*/
|
|
80
|
+
afterDraw(): Promise<void>;
|
|
81
|
+
queryParams: any;
|
|
82
|
+
size: any;
|
|
83
|
+
currentPage: number;
|
|
84
|
+
_loading: Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Attaches a scroll event listener to the current object.
|
|
87
|
+
* The `scrollEvent` function binds the `onScroll` method to the 'scroll' event
|
|
88
|
+
* of the current object. This enables handling of scroll events for
|
|
89
|
+
* specific functionality such as updating UI elements, loading content dynamically,
|
|
90
|
+
* or tracking user interaction with scrollable content.
|
|
91
|
+
*/
|
|
92
|
+
scrollEvent: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* A function that removes the scroll event listener from the current context.
|
|
95
|
+
* This function is used to unbind the `onScroll` event listener
|
|
96
|
+
* from the `scroll` event of the current object. It ensures that
|
|
97
|
+
* the scroll event no longer triggers the `onScroll` handler.
|
|
98
|
+
* @function
|
|
99
|
+
*/
|
|
100
|
+
unScrollEvent: () => void;
|
|
101
|
+
/**
|
|
102
|
+
* A scroll event handler function that checks the scroll position and triggers loading additional content
|
|
103
|
+
* when the user scrolls near the bottom of the page.
|
|
104
|
+
* Properties accessed:
|
|
105
|
+
* - `scrollTop`: The number of pixels that the content of an element is scrolled vertically.
|
|
106
|
+
* - `scrollHeight`: The total height of the element's content.
|
|
107
|
+
* - `clientHeight`: The inner height of the element in pixels, including padding but excluding borders and scrollbars.
|
|
108
|
+
* Conditions:
|
|
109
|
+
* - Determines if the scroll position is within 300 pixels of the bottom of the element.
|
|
110
|
+
* - Verifies that the current page number is less than or equal to the total number of pages.
|
|
111
|
+
* - Checks if the current page is already in the loading state.
|
|
112
|
+
* Actions:
|
|
113
|
+
* - Increments the current page number when the conditions are met.
|
|
114
|
+
* - Initiates loading for the next page by calling the `loadPages` function.
|
|
115
|
+
* @param {Event} e The scroll event object.
|
|
116
|
+
*/
|
|
117
|
+
onScroll: (e: Event) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Fetches the pages from the server.
|
|
120
|
+
* @param {number} page The page number.
|
|
121
|
+
* @returns {Promise<object>} The response from the server.
|
|
122
|
+
*/
|
|
123
|
+
getPages(page: number): Promise<object>;
|
|
124
|
+
/**
|
|
125
|
+
* Hides the loader.
|
|
126
|
+
*/
|
|
127
|
+
hideLoader(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Displays the loader element by adding the 'show' class to its class list.
|
|
130
|
+
* This method is useful for indicating a loading or processing state in the UI.
|
|
131
|
+
* @returns {void} No return value.
|
|
132
|
+
*/
|
|
133
|
+
showLoader(): void;
|
|
134
|
+
/**
|
|
135
|
+
* Checks if there are more pages to load.
|
|
136
|
+
* @param {number} page The page number.
|
|
137
|
+
* @returns {boolean} Whether there are more pages to load.
|
|
138
|
+
*/
|
|
139
|
+
hasMorePages(page: number): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Loads the pages.
|
|
142
|
+
* @param {number} page The page number.
|
|
143
|
+
*/
|
|
144
|
+
loadPages(page: number): Promise<void>;
|
|
145
|
+
parser: DOMParser;
|
|
146
|
+
placementObj: any;
|
|
147
|
+
/**
|
|
148
|
+
* Converts a data item into an HTML element based on a template.
|
|
149
|
+
* This function takes a data item, interpolates it into a predefined template,
|
|
150
|
+
* parses the resulting HTML string, and returns the first child element of the parsed HTML content.
|
|
151
|
+
* @param {object} item The data object to interpolate into the HTML template.
|
|
152
|
+
* @returns {Element} The first child element generated from the interpolated HTML string.
|
|
153
|
+
*/
|
|
154
|
+
dataToHtml: (item: object) => Element;
|
|
155
|
+
/**
|
|
156
|
+
* A custom implementation of the forEach method designed to iterate over an array of data,
|
|
157
|
+
* transform each item into an HTML element, and append the element to a specified placement object.
|
|
158
|
+
* Additionally, it adds an event listener to each generated element for handling click events.
|
|
159
|
+
* @param {Array} data An array of items to process. Each item is transformed into an HTML element
|
|
160
|
+
* and appended to the placement object specified in the context of `this`.
|
|
161
|
+
*/
|
|
162
|
+
customForeach: (data: any[]) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Interpolates a string template with values from the provided parameters object.
|
|
165
|
+
* The template contains placeholders in the format `{{key}}` or `{{key.subkey}}`,
|
|
166
|
+
* which are replaced with the corresponding values from the `params` object.
|
|
167
|
+
* Placeholders support dot notation for accessing nested properties within the `params` object.
|
|
168
|
+
* @param {string} template The string template containing placeholders to be replaced.
|
|
169
|
+
* @param {object} params The object containing key-value pairs used for substitution in the template.
|
|
170
|
+
* @returns {string} A string with all placeholders replaced by their respective values from the `params` object.
|
|
171
|
+
*/
|
|
172
|
+
interpolate: (template: string, params: object) => string;
|
|
173
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { default as WJElement } from '../wje-element/element.js';
|
|
2
|
+
/**
|
|
3
|
+
* @summary This class represents a custom input element. It extends the WJElement class and provides additional functionality for handling input.
|
|
4
|
+
* @documentation https://elements.webjet.sk/components/input
|
|
5
|
+
* @status stable
|
|
6
|
+
* @augments WJElement
|
|
7
|
+
* @csspart native - The native part.
|
|
8
|
+
* @csspart wrapper - The wrapper part.
|
|
9
|
+
* @csspart input - The input part.
|
|
10
|
+
* @csspart clear - The clear part.
|
|
11
|
+
* @slot start - Slot for content at the start of the input.
|
|
12
|
+
* @slot end - Slot for content at the end of the input.
|
|
13
|
+
* @cssproperty [--wje-input-font-family=var(--wje-font-family)] - Defines the font family for the input text.
|
|
14
|
+
* @cssproperty [--wje-input-background-color=var(--wje-background)] - Specifies the background color of the input field.
|
|
15
|
+
* @cssproperty [--wje-input-color=var(--wje-color)] - Sets the text color within the input field.
|
|
16
|
+
* @cssproperty [--wje-input-color-invalid=var(--wje-color-danger)] - Changes the text color when the input value is invalid.
|
|
17
|
+
* @cssproperty [--wje-input-border-color=var(--wje-border-color)] - Defines the border color of the input field.
|
|
18
|
+
* @cssproperty [--wje-input-border-color-focus=var(--wje-color-primary)] - Specifies the border color when the input is focused.
|
|
19
|
+
* @cssproperty [--wje-input-border-width=1px] - Sets the width of the input border.
|
|
20
|
+
* @cssproperty [--wje-input-border-style=solid] - Defines the border style of the input (e.g., solid, dashed).
|
|
21
|
+
* @cssproperty [--wje-input-border-radius=4px] - Specifies the border radius, creating rounded corners.
|
|
22
|
+
* @cssproperty [--wje-input-margin-bottom=.5rem] - Adds spacing below the input field.
|
|
23
|
+
* @cssproperty [--wje-input-line-height=20px] - Sets the line height of the text within the input field.
|
|
24
|
+
* @cssproperty [--wje-input-slot-padding-inline=.5rem] - Controls the padding on the left and right of the input slot content.
|
|
25
|
+
* // @fires wje-input:input - Dispatched when the input value changes.
|
|
26
|
+
* // @fires wje-input:clear - Dispatched when the input is cleared.
|
|
27
|
+
*/
|
|
28
|
+
export default class Input extends WJElement {
|
|
29
|
+
/**
|
|
30
|
+
* Getter for the cssStyleSheet attribute.
|
|
31
|
+
* @returns {CSSStyleSheet} The CSS style sheet of the input element.
|
|
32
|
+
*/
|
|
33
|
+
static get cssStyleSheet(): CSSStyleSheet;
|
|
34
|
+
/**
|
|
35
|
+
* Getter for the observedAttributes attribute of the input element.
|
|
36
|
+
* @returns {Array} The attributes to observe for changes.
|
|
37
|
+
*/
|
|
38
|
+
static get observedAttributes(): any[];
|
|
39
|
+
/**
|
|
40
|
+
* Whether the input is associated with a form.
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
*/
|
|
43
|
+
static formAssociated: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Setter for the invalid attribute.
|
|
46
|
+
* @param {boolean} isInvalid Whether the input is invalid.
|
|
47
|
+
*/
|
|
48
|
+
set invalid(isInvalid: boolean);
|
|
49
|
+
/**
|
|
50
|
+
* Getter for the invalid attribute.
|
|
51
|
+
* @returns {boolean} Whether the attribute is present.
|
|
52
|
+
*/
|
|
53
|
+
get invalid(): boolean;
|
|
54
|
+
pristine: boolean;
|
|
55
|
+
internals: ElementInternals;
|
|
56
|
+
observer: MutationObserver;
|
|
57
|
+
observeFunction: (mutations: any) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Setter for the value attribute.
|
|
60
|
+
* @param {string} value The value to set.
|
|
61
|
+
*/
|
|
62
|
+
set value(value: string);
|
|
63
|
+
/**
|
|
64
|
+
* Getter for the value attribute.
|
|
65
|
+
* @returns {string} The value of the attribute.
|
|
66
|
+
*/
|
|
67
|
+
get value(): string;
|
|
68
|
+
_value: string;
|
|
69
|
+
/**
|
|
70
|
+
* Getter for the customErrorDisplay attribute.
|
|
71
|
+
* @returns {boolean} Whether the attribute is present.
|
|
72
|
+
*/
|
|
73
|
+
get customErrorDisplay(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Getter for the validateOnChange attribute.
|
|
76
|
+
* @returns {boolean} Whether the attribute is present.
|
|
77
|
+
*/
|
|
78
|
+
get validateOnChange(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Getter for the form attribute.
|
|
81
|
+
* @returns {HTMLFormElement} The form the input is associated with.
|
|
82
|
+
*/
|
|
83
|
+
get form(): HTMLFormElement;
|
|
84
|
+
/**
|
|
85
|
+
* Getter for the name attribute.
|
|
86
|
+
* @returns {string} The name of the input element.
|
|
87
|
+
*/
|
|
88
|
+
get name(): string;
|
|
89
|
+
/**
|
|
90
|
+
* Getter for the type attribute.
|
|
91
|
+
* @returns {string} The type of the input element.
|
|
92
|
+
*/
|
|
93
|
+
get type(): string;
|
|
94
|
+
/**
|
|
95
|
+
* Getter for the validity attribute.
|
|
96
|
+
* @returns {ValidityState} The validity state of the input.
|
|
97
|
+
*/
|
|
98
|
+
get validity(): ValidityState;
|
|
99
|
+
/**
|
|
100
|
+
* Getter for the validationMessage attribute.
|
|
101
|
+
* @returns {string} The validation message of the input element.
|
|
102
|
+
*/
|
|
103
|
+
get validationMessage(): string;
|
|
104
|
+
/**
|
|
105
|
+
* Getter for the willValidate attribute.
|
|
106
|
+
* @returns {boolean} Whether the input will be validated.
|
|
107
|
+
*/
|
|
108
|
+
get willValidate(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* @summary Setter for the defaultValue attribute.
|
|
111
|
+
* This method sets the 'value' attribute of the custom input element to the provided value.
|
|
112
|
+
* The 'value' attribute represents the default value of the input element.
|
|
113
|
+
* @param {string} value The value to set as the default value.
|
|
114
|
+
*/
|
|
115
|
+
set defaultValue(value: string);
|
|
116
|
+
/**
|
|
117
|
+
* @summary Getter for the defaultValue attribute.
|
|
118
|
+
* This method retrieves the 'value' attribute of the custom input element.
|
|
119
|
+
* The 'value' attribute represents the default value of the input element.
|
|
120
|
+
* If the 'value' attribute is not set, it returns an empty string.
|
|
121
|
+
* @returns {string} The default value of the input element.
|
|
122
|
+
*/
|
|
123
|
+
get defaultValue(): string;
|
|
124
|
+
beforeDraw(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Draws the input element.
|
|
127
|
+
* @returns {DocumentFragment} The drawn input.
|
|
128
|
+
*/
|
|
129
|
+
draw(): DocumentFragment;
|
|
130
|
+
clear: HTMLElement;
|
|
131
|
+
native: HTMLDivElement;
|
|
132
|
+
labelElement: HTMLLabelElement;
|
|
133
|
+
input: HTMLInputElement;
|
|
134
|
+
errorMessage: HTMLDivElement;
|
|
135
|
+
/**
|
|
136
|
+
* Runs after the input is drawn to the DOM.
|
|
137
|
+
*/
|
|
138
|
+
afterDraw(): void;
|
|
139
|
+
/**
|
|
140
|
+
* @summary Displays the validation message for the input.
|
|
141
|
+
* If the input has a slot named 'error', it sets the text content of the element with attribute 'error-message' inside the slot to the validation message.
|
|
142
|
+
* If the input does not have an 'error' slot, it sets the text content of the errorMessage property to the validation message.
|
|
143
|
+
*/
|
|
144
|
+
showInvalidMessage(): void;
|
|
145
|
+
/**
|
|
146
|
+
* @summary Validates the input.
|
|
147
|
+
* This method checks the validity state of the input. If the input is not valid, it iterates over the validity state object.
|
|
148
|
+
* For each invalid state, it constructs an attribute name and checks if the input has this attribute.
|
|
149
|
+
* If the input has the attribute, it sets the validation error to the state and the error message to the attribute value.
|
|
150
|
+
* If the input does not have the attribute, it sets the error message to the default validation message of the input.
|
|
151
|
+
* It then sets the validity in the form internals to an object with the validation error as key and true as value, and the error message.
|
|
152
|
+
* If the input is valid, it sets the validity in the form internals to an empty object.
|
|
153
|
+
*/
|
|
154
|
+
validateInput(): void;
|
|
155
|
+
validationError: string;
|
|
156
|
+
/**
|
|
157
|
+
* @summary Propagates the validation state of the input.
|
|
158
|
+
* This method sets the 'invalid' property of the input based on its 'pristine' state and its internal validity state.
|
|
159
|
+
* If the input is invalid and the 'customErrorDisplay' property is true, it dispatches an 'invalid' event.
|
|
160
|
+
*/
|
|
161
|
+
propagateValidation(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Checks whether the input has a slot.
|
|
164
|
+
* @param {HTMLElement} el The element to check.
|
|
165
|
+
* @param {string} slotName The name of the slot to check for.
|
|
166
|
+
* @returns {boolean} Whether the input has the slot.
|
|
167
|
+
*/
|
|
168
|
+
hasSlot(el: HTMLElement, slotName?: string): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* @summary Callback function that is called when the custom element is associated with a form.
|
|
171
|
+
* This function adds an event listener to the form's submit event, which validates the input and propagates the validation.
|
|
172
|
+
* @param {HTMLFormElement} form The form the custom element is associated with.
|
|
173
|
+
*/
|
|
174
|
+
formAssociatedCallback(form: HTMLFormElement): void;
|
|
175
|
+
/**
|
|
176
|
+
* The formResetCallback method is a built-in lifecycle callback that gets called when a form gets reset.
|
|
177
|
+
* This method is responsible for resetting the value of the custom input element to its default value.
|
|
178
|
+
* It also resets the form value and validity state in the form internals.
|
|
179
|
+
* @function
|
|
180
|
+
*/
|
|
181
|
+
formResetCallback(): void;
|
|
182
|
+
/**
|
|
183
|
+
* The formStateRestoreCallback method is a built-in lifecycle callback that gets called when the state of a form-associated custom element is restored.
|
|
184
|
+
* This method is responsible for restoring the value of the custom input element to its saved state.
|
|
185
|
+
* It also restores the form value and validity state in the form internals to their saved states.
|
|
186
|
+
* @param {object} state The saved state of the custom input element.
|
|
187
|
+
* @function
|
|
188
|
+
*/
|
|
189
|
+
formStateRestoreCallback(state: object): void;
|
|
190
|
+
/**
|
|
191
|
+
* The formStateSaveCallback method is a built-in lifecycle callback that gets called when the state of a form-associated custom element is saved.
|
|
192
|
+
* This method is responsible for saving the value of the custom input element.
|
|
193
|
+
* @returns {object} The saved state of the custom input element.
|
|
194
|
+
* @function
|
|
195
|
+
*/
|
|
196
|
+
formStateSaveCallback(): object;
|
|
197
|
+
/**
|
|
198
|
+
* The formDisabledCallback method is a built-in lifecycle callback that gets called when the disabled state of a form-associated custom element changes.
|
|
199
|
+
* This method is not implemented yet.
|
|
200
|
+
* @param {boolean} disabled The new disabled state of the custom input element.
|
|
201
|
+
* @function
|
|
202
|
+
*/
|
|
203
|
+
formDisabledCallback(disabled: boolean): void;
|
|
204
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as WJElement } from '../wje-element/element.js';
|
|
2
|
+
/**
|
|
3
|
+
* `InputFile` is a custom web component that represents a file input.
|
|
4
|
+
* @summary This element represents a file input.
|
|
5
|
+
* @documentation https://elements.webjet.sk/components/input-file
|
|
6
|
+
* @status stable
|
|
7
|
+
* @augments {WJElement}
|
|
8
|
+
* @csspart native - The native file input wrapper.
|
|
9
|
+
* @csspart input - The text input.
|
|
10
|
+
* @csspart file-input - The file input element.
|
|
11
|
+
* // @fires wje-input-file:change - Event fired when the file input changes.
|
|
12
|
+
* @tag wje-input-file
|
|
13
|
+
*/
|
|
14
|
+
export default class InputFile extends WJElement {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the CSS stylesheet.
|
|
17
|
+
* @static
|
|
18
|
+
* @returns {object} styles
|
|
19
|
+
*/
|
|
20
|
+
static get cssStyleSheet(): any;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the observed attributes.
|
|
23
|
+
* @static
|
|
24
|
+
* @returns {Array} An empty array
|
|
25
|
+
*/
|
|
26
|
+
static get observedAttributes(): any[];
|
|
27
|
+
_value: string;
|
|
28
|
+
/**
|
|
29
|
+
* @summary Sets the value of the input file.
|
|
30
|
+
* @param {string} value The value to set for the input file.
|
|
31
|
+
*/
|
|
32
|
+
set value(value: string);
|
|
33
|
+
/**
|
|
34
|
+
* Gets the value of the input file.
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
get value(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Draws the component.
|
|
40
|
+
* @returns {object} Document fragment
|
|
41
|
+
*/
|
|
42
|
+
draw(): object;
|
|
43
|
+
native: HTMLDivElement;
|
|
44
|
+
input: HTMLElement;
|
|
45
|
+
fileInput: HTMLInputElement;
|
|
46
|
+
/**
|
|
47
|
+
* After draw method for the InputFile class.
|
|
48
|
+
*/
|
|
49
|
+
afterDraw(): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { default as WJElement } from '../wje-element/element.js';
|
|
2
|
+
/**
|
|
3
|
+
* `Item` is a custom web component that represents an item.
|
|
4
|
+
* @summary This element represents an item.
|
|
5
|
+
* @documentation https://elements.webjet.sk/components/item
|
|
6
|
+
* @status stable
|
|
7
|
+
* @augments {WJElement}
|
|
8
|
+
* @csspart native - The native part
|
|
9
|
+
* @csspart inner - The inner part
|
|
10
|
+
* @slot start - The start slot
|
|
11
|
+
* @slot end - The end slot
|
|
12
|
+
* @slot error - The error slot
|
|
13
|
+
* @slot helper - The helper slot
|
|
14
|
+
* @cssproperty [--wje-item-background=var(--wje-background)] - Sets the background color of the item. Accepts any valid CSS color value.
|
|
15
|
+
* @cssproperty [--wje-item-color=var(--wje-color)] - Defines the text color for the item. Accepts any valid CSS color value.
|
|
16
|
+
* @cssproperty [--wje-item-padding-start=var(--wje-padding)] - Specifies the left padding of the item. Accepts any valid CSS length.
|
|
17
|
+
* @cssproperty [--wje-item-padding-end=var(--wje-padding)] - Specifies the right padding of the item. Accepts any valid CSS length.
|
|
18
|
+
* @cssproperty [--wje-item-padding-top=var(--wje-padding)] - Specifies the top padding of the item. Accepts any valid CSS length.
|
|
19
|
+
* @cssproperty [--wje-item-padding-bottom=var(--wje-padding)] - Specifies the bottom padding of the item. Accepts any valid CSS length.
|
|
20
|
+
* @cssproperty [--wje-item-inner-padding-start=var(--wje-padding)] - Specifies the left inner padding of the item. Accepts any valid CSS length.
|
|
21
|
+
* @cssproperty [--wje-item-inner-padding-end=var(--wje-padding)] - Specifies the right inner padding of the item. Accepts any valid CSS length.
|
|
22
|
+
* @cssproperty [--wje-item-inner-padding-top=var(--wje-padding)] - Specifies the top inner padding of the item. Accepts any valid CSS length.
|
|
23
|
+
* @cssproperty [--wje-item-inner-padding-bottom=var(--wje-padding)] - Specifies the bottom inner padding of the item. Accepts any valid CSS length.
|
|
24
|
+
* @cssproperty [--wje-item-border-radius=var(--wje-border-radius)] - Defines the border radius, providing rounded corners for the item.
|
|
25
|
+
* @cssproperty [--wje-item-border-width=var(--wje-border-width)] - Sets the border width of the item. Accepts any valid CSS length.
|
|
26
|
+
* @cssproperty [--wje-item-border-style=var(--wje-border-style)] - Specifies the style of the border, such as `solid`, `dashed`, or `dotted`.
|
|
27
|
+
* @cssproperty [--wje-item-border-color=var(--wje-border-color)] - Defines the color of the item's border. Accepts any valid CSS color value.
|
|
28
|
+
* @cssproperty [--wje-item-min-height=var(--wje-min-height)] - Sets the minimum height of the item to ensure consistent layout.
|
|
29
|
+
* @cssproperty [--wje-item-transition=var(--wje-transition)] - Specifies the transition effects for the item, such as for hover or focus states.
|
|
30
|
+
* @cssproperty [--wje-item-inner-box-shadow=var(--wje-box-shadow)] - Adds a shadow effect inside the item for a 3D appearance.
|
|
31
|
+
* @tag wje-item
|
|
32
|
+
*/
|
|
33
|
+
export default class Item extends WJElement {
|
|
34
|
+
/**
|
|
35
|
+
* Returns the CSS styles for the component.
|
|
36
|
+
* @static
|
|
37
|
+
* @returns {object} styles
|
|
38
|
+
*/
|
|
39
|
+
static get cssStyleSheet(): any;
|
|
40
|
+
labelColorStyles: {};
|
|
41
|
+
itemStyles: Map<any, any>;
|
|
42
|
+
inheritedAriaAttributes: {};
|
|
43
|
+
multipleInputs: boolean;
|
|
44
|
+
focusable: boolean;
|
|
45
|
+
button: boolean;
|
|
46
|
+
detailIcon: string;
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
counter: boolean;
|
|
49
|
+
routerDirection: string;
|
|
50
|
+
type: string;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the CSS styles for the component.
|
|
53
|
+
* @returns {boolean}
|
|
54
|
+
*/
|
|
55
|
+
isClickable(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Draws the component for the item.
|
|
58
|
+
* @returns {DocumentFragment}
|
|
59
|
+
*/
|
|
60
|
+
draw(): DocumentFragment;
|
|
61
|
+
/**
|
|
62
|
+
* Determines if the given element or any of its ancestors matches the specified selector.
|
|
63
|
+
* @param {string} selector The CSS selector to match against the element's ancestors.
|
|
64
|
+
* @param {HTMLElement} el The element from which to start the search.
|
|
65
|
+
* @returns {boolean} - Returns `true` if the element or one of its ancestors matches the selector; otherwise, `false`.
|
|
66
|
+
*/
|
|
67
|
+
hostContext: (selector: string, el: HTMLElement) => boolean;
|
|
68
|
+
}
|