wj-elements 0.1.199 → 0.1.201

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.
Files changed (238) hide show
  1. package/dist/packages/index.d.ts +107 -0
  2. package/dist/packages/internals/form-associated-element.d.ts +143 -0
  3. package/dist/packages/localize/localize.d.ts +47 -0
  4. package/dist/packages/translations/en-gb.d.ts +18 -0
  5. package/dist/packages/translations/sk-sk.d.ts +13 -0
  6. package/dist/packages/utils/animations.d.ts +2 -0
  7. package/dist/packages/utils/base-path.d.ts +14 -0
  8. package/dist/packages/utils/date.d.ts +2 -0
  9. package/dist/packages/utils/element-utils.d.ts +46 -0
  10. package/dist/packages/utils/event.d.ts +67 -0
  11. package/dist/packages/utils/icon-library.d.ts +3 -0
  12. package/dist/packages/utils/localize.d.ts +4 -0
  13. package/dist/packages/utils/permissions.d.ts +40 -0
  14. package/dist/packages/utils/universal-service.d.ts +18 -0
  15. package/dist/packages/utils/utils.d.ts +1 -0
  16. package/dist/packages/wje-accordion/accordion.d.ts +2 -0
  17. package/dist/packages/wje-accordion/accordion.element.d.ts +72 -0
  18. package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
  19. package/dist/packages/wje-accordion-item/accordion-item.d.ts +2 -0
  20. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +40 -0
  21. package/dist/packages/wje-animation/animation.d.ts +2 -0
  22. package/dist/packages/wje-animation/animation.element.d.ts +158 -0
  23. package/dist/packages/wje-animation/animation.test.d.ts +1 -0
  24. package/dist/packages/wje-aside/aside.d.ts +2 -0
  25. package/dist/packages/wje-aside/aside.element.d.ts +31 -0
  26. package/dist/packages/wje-avatar/avatar.d.ts +2 -0
  27. package/dist/packages/wje-avatar/avatar.element.d.ts +76 -0
  28. package/dist/packages/wje-avatar/avatar.test.d.ts +1 -0
  29. package/dist/packages/wje-avatar/service/service.d.ts +40 -0
  30. package/dist/packages/wje-badge/badge.d.ts +2 -0
  31. package/dist/packages/wje-badge/badge.element.d.ts +35 -0
  32. package/dist/packages/wje-badge/badge.test.d.ts +1 -0
  33. package/dist/packages/wje-breadcrumb/breadcrumb.d.ts +2 -0
  34. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +80 -0
  35. package/dist/packages/wje-breadcrumbs/breadcrumbs.d.ts +2 -0
  36. package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +97 -0
  37. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +1 -0
  38. package/dist/packages/wje-button/button.d.ts +2 -0
  39. package/dist/packages/wje-button/button.element.d.ts +204 -0
  40. package/dist/packages/wje-button/button.test.d.ts +1 -0
  41. package/dist/packages/wje-button-group/button-group.d.ts +2 -0
  42. package/dist/packages/wje-button-group/button-group.element.d.ts +96 -0
  43. package/dist/packages/wje-card/card.d.ts +2 -0
  44. package/dist/packages/wje-card/card.element.d.ts +29 -0
  45. package/dist/packages/wje-card-content/card-content.d.ts +2 -0
  46. package/dist/packages/wje-card-content/card-content.element.d.ts +22 -0
  47. package/dist/packages/wje-card-controls/card-controls.d.ts +2 -0
  48. package/dist/packages/wje-card-controls/card-controls.element.d.ts +23 -0
  49. package/dist/packages/wje-card-header/card-header.d.ts +2 -0
  50. package/dist/packages/wje-card-header/card-header.element.d.ts +22 -0
  51. package/dist/packages/wje-card-subtitle/card-subtitle.d.ts +2 -0
  52. package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +30 -0
  53. package/dist/packages/wje-card-title/card-title.d.ts +2 -0
  54. package/dist/packages/wje-card-title/card-title.element.d.ts +32 -0
  55. package/dist/packages/wje-carousel/carousel.d.ts +2 -0
  56. package/dist/packages/wje-carousel/carousel.element.d.ts +146 -0
  57. package/dist/packages/wje-carousel-item/carousel-item.d.ts +2 -0
  58. package/dist/packages/wje-carousel-item/carousel-item.element.d.ts +38 -0
  59. package/dist/packages/wje-checkbox/checkbox.d.ts +2 -0
  60. package/dist/packages/wje-checkbox/checkbox.element.d.ts +99 -0
  61. package/dist/packages/wje-chip/chip.d.ts +2 -0
  62. package/dist/packages/wje-chip/chip.element.d.ts +64 -0
  63. package/dist/packages/wje-col/col.d.ts +2 -0
  64. package/dist/packages/wje-col/col.element.d.ts +16 -0
  65. package/dist/packages/wje-color-picker/color-picker.d.ts +2 -0
  66. package/dist/packages/wje-color-picker/color-picker.element.d.ts +187 -0
  67. package/dist/packages/wje-color-picker/color-picker.test.d.ts +1 -0
  68. package/dist/packages/wje-container/container.d.ts +2 -0
  69. package/dist/packages/wje-container/container.element.d.ts +31 -0
  70. package/dist/packages/wje-copy-button/copy-button.d.ts +2 -0
  71. package/dist/packages/wje-copy-button/copy-button.element.d.ts +89 -0
  72. package/dist/packages/wje-copy-button/service/service.d.ts +12 -0
  73. package/dist/packages/wje-dialog/dialog.d.ts +2 -0
  74. package/dist/packages/wje-dialog/dialog.element.d.ts +127 -0
  75. package/dist/packages/wje-divider/divider.d.ts +2 -0
  76. package/dist/packages/wje-divider/divider.element.d.ts +32 -0
  77. package/dist/packages/wje-dropdown/dropdown.d.ts +2 -0
  78. package/dist/packages/wje-dropdown/dropdown.element.d.ts +84 -0
  79. package/dist/packages/wje-element/element.d.ts +306 -0
  80. package/dist/packages/wje-file-upload/file-upload.d.ts +2 -0
  81. package/dist/packages/wje-file-upload/file-upload.element.d.ts +191 -0
  82. package/dist/packages/wje-file-upload/service/service.d.ts +70 -0
  83. package/dist/packages/wje-file-upload-item/file-upload-item.d.ts +2 -0
  84. package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +68 -0
  85. package/dist/packages/wje-footer/footer.d.ts +2 -0
  86. package/dist/packages/wje-footer/footer.element.d.ts +28 -0
  87. package/dist/packages/wje-form/form.d.ts +2 -0
  88. package/dist/packages/wje-form/form.element.d.ts +28 -0
  89. package/dist/packages/wje-format-digital/format-digital.d.ts +2 -0
  90. package/dist/packages/wje-format-digital/format-digital.element.d.ts +83 -0
  91. package/dist/packages/wje-format-digital/format-digital.test.d.ts +1 -0
  92. package/dist/packages/wje-grid/grid.d.ts +2 -0
  93. package/dist/packages/wje-grid/grid.element.d.ts +26 -0
  94. package/dist/packages/wje-header/header.d.ts +2 -0
  95. package/dist/packages/wje-header/header.element.d.ts +35 -0
  96. package/dist/packages/wje-icon/icon.d.ts +2 -0
  97. package/dist/packages/wje-icon/icon.element.d.ts +40 -0
  98. package/dist/packages/wje-icon/service/library.d.ts +3 -0
  99. package/dist/packages/wje-icon/service/service.d.ts +11 -0
  100. package/dist/packages/wje-icon-picker/icon-picker.d.ts +2 -0
  101. package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +187 -0
  102. package/dist/packages/wje-img/img.d.ts +2 -0
  103. package/dist/packages/wje-img/img.element.d.ts +118 -0
  104. package/dist/packages/wje-img-comparer/img-comparer.d.ts +2 -0
  105. package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +60 -0
  106. package/dist/packages/wje-img-comparer/service/service.d.ts +1 -0
  107. package/dist/packages/wje-infinite-scroll/infinite-scroll.d.ts +2 -0
  108. package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +172 -0
  109. package/dist/packages/wje-input/input.d.ts +2 -0
  110. package/dist/packages/wje-input/input.element.d.ts +159 -0
  111. package/dist/packages/wje-input-file/input-file.d.ts +2 -0
  112. package/dist/packages/wje-input-file/input-file.element.d.ts +50 -0
  113. package/dist/packages/wje-item/item.d.ts +2 -0
  114. package/dist/packages/wje-item/item.element.d.ts +68 -0
  115. package/dist/packages/wje-kanban/kanban.d.ts +2 -0
  116. package/dist/packages/wje-kanban/kanban.element.d.ts +182 -0
  117. package/dist/packages/wje-label/label.d.ts +2 -0
  118. package/dist/packages/wje-label/label.element.d.ts +34 -0
  119. package/dist/packages/wje-level-indicator/level-indicator.d.ts +2 -0
  120. package/dist/packages/wje-level-indicator/level-indicator.element.d.ts +91 -0
  121. package/dist/packages/wje-list/list.d.ts +2 -0
  122. package/dist/packages/wje-list/list.element.d.ts +31 -0
  123. package/dist/packages/wje-main/main.d.ts +2 -0
  124. package/dist/packages/wje-main/main.element.d.ts +30 -0
  125. package/dist/packages/wje-masonry/masonry.d.ts +2 -0
  126. package/dist/packages/wje-masonry/masonry.element.d.ts +114 -0
  127. package/dist/packages/wje-masonry/service/service.d.ts +32 -0
  128. package/dist/packages/wje-menu/menu.d.ts +2 -0
  129. package/dist/packages/wje-menu/menu.element.d.ts +47 -0
  130. package/dist/packages/wje-menu-button/menu-button.d.ts +2 -0
  131. package/dist/packages/wje-menu-button/menu-button.element.d.ts +34 -0
  132. package/dist/packages/wje-menu-item/menu-item.d.ts +2 -0
  133. package/dist/packages/wje-menu-item/menu-item.element.d.ts +158 -0
  134. package/dist/packages/wje-menu-label/menu-label.d.ts +2 -0
  135. package/dist/packages/wje-menu-label/menu-label.element.d.ts +39 -0
  136. package/dist/packages/wje-option/option.d.ts +2 -0
  137. package/dist/packages/wje-option/option.element.d.ts +95 -0
  138. package/dist/packages/wje-options/options.d.ts +2 -0
  139. package/dist/packages/wje-options/options.element.d.ts +232 -0
  140. package/dist/packages/wje-orgchart/orgchart.d.ts +2 -0
  141. package/dist/packages/wje-orgchart/orgchart.element.d.ts +24 -0
  142. package/dist/packages/wje-orgchart-group/orgchart-group.d.ts +2 -0
  143. package/dist/packages/wje-orgchart-group/orgchart-group.element.d.ts +28 -0
  144. package/dist/packages/wje-orgchart-item/orgchart-item.d.ts +2 -0
  145. package/dist/packages/wje-orgchart-item/orgchart-item.element.d.ts +49 -0
  146. package/dist/packages/wje-pagination/pagination.d.ts +2 -0
  147. package/dist/packages/wje-pagination/pagination.element.d.ts +166 -0
  148. package/dist/packages/wje-pagination/pagination.test.d.ts +1 -0
  149. package/dist/packages/wje-pagination/service/service.d.ts +9 -0
  150. package/dist/packages/wje-panel/panel.d.ts +2 -0
  151. package/dist/packages/wje-panel/panel.element.d.ts +34 -0
  152. package/dist/packages/wje-popup/popup.d.ts +2 -0
  153. package/dist/packages/wje-popup/popup.element.d.ts +94 -0
  154. package/dist/packages/wje-progress-bar/progress-bar.d.ts +2 -0
  155. package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +96 -0
  156. package/dist/packages/wje-qr-code/qr-code.d.ts +2 -0
  157. package/dist/packages/wje-qr-code/qr-code.element.d.ts +33 -0
  158. package/dist/packages/wje-radio/radio.d.ts +2 -0
  159. package/dist/packages/wje-radio/radio.element.d.ts +64 -0
  160. package/dist/packages/wje-radio-group/radio-group.d.ts +2 -0
  161. package/dist/packages/wje-radio-group/radio-group.element.d.ts +61 -0
  162. package/dist/packages/wje-rate/rate.d.ts +2 -0
  163. package/dist/packages/wje-rate/rate.element.d.ts +156 -0
  164. package/dist/packages/wje-relative-time/relative-time.d.ts +2 -0
  165. package/dist/packages/wje-relative-time/relative-time.element.d.ts +55 -0
  166. package/dist/packages/wje-relative-time/relative-time.test.d.ts +1 -0
  167. package/dist/packages/wje-reorder/reorder.d.ts +2 -0
  168. package/dist/packages/wje-reorder/reorder.element.d.ts +119 -0
  169. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.d.ts +2 -0
  170. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.element.d.ts +23 -0
  171. package/dist/packages/wje-reorder-handle/reorder-handle.d.ts +2 -0
  172. package/dist/packages/wje-reorder-handle/reorder-handle.element.d.ts +84 -0
  173. package/dist/packages/wje-reorder-item/reorder-item.d.ts +2 -0
  174. package/dist/packages/wje-reorder-item/reorder-item.element.d.ts +24 -0
  175. package/dist/packages/wje-route/route.d.ts +2 -0
  176. package/dist/packages/wje-route/route.element.d.ts +22 -0
  177. package/dist/packages/wje-router/router.d.ts +2 -0
  178. package/dist/packages/wje-router/router.element.d.ts +39 -0
  179. package/dist/packages/wje-router-link/router-link.d.ts +2 -0
  180. package/dist/packages/wje-router-link/router-link.element.d.ts +31 -0
  181. package/dist/packages/wje-router-outlet/router-outlet.d.ts +2 -0
  182. package/dist/packages/wje-router-outlet/router-outlet.element.d.ts +16 -0
  183. package/dist/packages/wje-row/row.d.ts +2 -0
  184. package/dist/packages/wje-row/row.element.d.ts +23 -0
  185. package/dist/packages/wje-select/select.d.ts +2 -0
  186. package/dist/packages/wje-select/select.element.d.ts +358 -0
  187. package/dist/packages/wje-slider/slider.d.ts +2 -0
  188. package/dist/packages/wje-slider/slider.element.d.ts +103 -0
  189. package/dist/packages/wje-sliding-container/sliding-container.d.ts +2 -0
  190. package/dist/packages/wje-sliding-container/sliding-container.element.d.ts +265 -0
  191. package/dist/packages/wje-split-view/service/service.d.ts +1 -0
  192. package/dist/packages/wje-split-view/split-view.d.ts +2 -0
  193. package/dist/packages/wje-split-view/split-view.element.d.ts +65 -0
  194. package/dist/packages/wje-status/status.d.ts +2 -0
  195. package/dist/packages/wje-status/status.element.d.ts +26 -0
  196. package/dist/packages/wje-step/step.d.ts +2 -0
  197. package/dist/packages/wje-step/step.element.d.ts +23 -0
  198. package/dist/packages/wje-stepper/stepper.d.ts +2 -0
  199. package/dist/packages/wje-stepper/stepper.element.d.ts +80 -0
  200. package/dist/packages/wje-store/default-store-actions.d.ts +25 -0
  201. package/dist/packages/wje-store/pubsub.d.ts +22 -0
  202. package/dist/packages/wje-store/store.d.ts +153 -0
  203. package/dist/packages/wje-tab/tab.d.ts +2 -0
  204. package/dist/packages/wje-tab/tab.element.d.ts +66 -0
  205. package/dist/packages/wje-tab-group/tab-group.d.ts +2 -0
  206. package/dist/packages/wje-tab-group/tab-group.element.d.ts +107 -0
  207. package/dist/packages/wje-tab-panel/tab-panel.d.ts +2 -0
  208. package/dist/packages/wje-tab-panel/tab-panel.element.d.ts +23 -0
  209. package/dist/packages/wje-textarea/textarea.d.ts +2 -0
  210. package/dist/packages/wje-textarea/textarea.element.d.ts +89 -0
  211. package/dist/packages/wje-thumbnail/thumbnail.d.ts +2 -0
  212. package/dist/packages/wje-thumbnail/thumbnail.element.d.ts +31 -0
  213. package/dist/packages/wje-timeline/timeline.d.ts +2 -0
  214. package/dist/packages/wje-timeline/timeline.element.d.ts +25 -0
  215. package/dist/packages/wje-timeline-item/timeline-item.d.ts +2 -0
  216. package/dist/packages/wje-timeline-item/timeline-item.element.d.ts +27 -0
  217. package/dist/packages/wje-toast/toast.d.ts +2 -0
  218. package/dist/packages/wje-toast/toast.element.d.ts +173 -0
  219. package/dist/packages/wje-toast/toast.test.d.ts +1 -0
  220. package/dist/packages/wje-toggle/toggle.d.ts +2 -0
  221. package/dist/packages/wje-toggle/toggle.element.d.ts +65 -0
  222. package/dist/packages/wje-toolbar/toolbar.d.ts +2 -0
  223. package/dist/packages/wje-toolbar/toolbar.element.d.ts +39 -0
  224. package/dist/packages/wje-toolbar-action/toolbar-action.d.ts +2 -0
  225. package/dist/packages/wje-toolbar-action/toolbar-action.element.d.ts +35 -0
  226. package/dist/packages/wje-tooltip/tooltip.d.ts +2 -0
  227. package/dist/packages/wje-tooltip/tooltip.element.d.ts +77 -0
  228. package/dist/packages/wje-tree/tree.d.ts +2 -0
  229. package/dist/packages/wje-tree/tree.element.d.ts +105 -0
  230. package/dist/packages/wje-tree/tree.test.d.ts +1 -0
  231. package/dist/packages/wje-tree-item/tree-item.d.ts +2 -0
  232. package/dist/packages/wje-tree-item/tree-item.element.d.ts +155 -0
  233. package/dist/packages/wje-tree-item/tree-item.test.d.ts +1 -0
  234. package/dist/packages/wje-visually-hidden/visually-hidden.d.ts +2 -0
  235. package/dist/packages/wje-visually-hidden/visually-hidden.element.d.ts +29 -0
  236. package/dist/wje-reorder-handle.js +38 -26
  237. package/dist/wje-reorder-handle.js.map +1 -1
  238. package/package.json +1 -1
@@ -0,0 +1,187 @@
1
+ import { default as WJElement } from '../wje-element/element.js';
2
+ import { default as Input } from '../wje-input/input.js';
3
+ import { default as InfiniteScroll } from '../wje-infinite-scroll/infinite-scroll.js';
4
+ import { default as Tooltip } from '../wje-tooltip/tooltip.js';
5
+ import { default as Popup } from '../wje-popup/popup.js';
6
+ /**
7
+ * @summary This element allows users to pick an icon from a set of available options.
8
+ * `IconPicker` is a custom web component that represents an interactive icon picker. It features
9
+ * search functionality, infinite scrolling, and popup-based selection. The component is highly customizable
10
+ * and integrates seamlessly with other `WJElement` components.
11
+ * @documentation https://elements.webjet.sk/components/icon-picker
12
+ * @status stable
13
+ * @augments {WJElement}
14
+ * @attribute {string} icon - The selected icon's name.
15
+ * @attribute {number} size - The number of icons displayed per page in infinite scroll. Default is 60.
16
+ * @csspart native - The native part of the component.
17
+ * @csspart anchor - The part representing the anchor button displaying the selected icon.
18
+ * @csspart picker - The picker part containing the search and icon selection interface.
19
+ * @csspart input - The input part for searching icons.
20
+ * @cssproperty [--wje-color-picker-value=#ff0000] - The default color value.
21
+ * @cssproperty [--wje-color-picker-area=transparent] - The background color of the color picker area.
22
+ * @cssproperty [--wje-color-picker-swatch=transparent] - The background color of the swatch picker.
23
+ * @cssproperty [--wje-color-picker-size=1rem] - The size of the icons in the picker.
24
+ * @cssproperty [--wje-color-picker-radius=4px] - The border radius of the picker.
25
+ * @tag wje-icon-picker
26
+ */
27
+ export default class IconPicker extends WJElement {
28
+ /**
29
+ * Returns the CSS styles for the component.
30
+ * @static
31
+ * @returns {CSSStyleSheet}
32
+ */
33
+ static get cssStyleSheet(): CSSStyleSheet;
34
+ /**
35
+ * Returns the list of attributes to observe for changes.
36
+ * @static
37
+ * @returns {Array<string>}
38
+ */
39
+ static get observedAttributes(): Array<string>;
40
+ /**
41
+ * Dependencies of the IconPicker component.
42
+ * @property {object} dependencies
43
+ */
44
+ dependencies: {
45
+ 'wje-input': typeof Input;
46
+ 'wje-infinite-scroll': typeof InfiniteScroll;
47
+ 'wje-tooltip': typeof Tooltip;
48
+ 'wje-popup': typeof Popup;
49
+ };
50
+ /**
51
+ * Setter for the markerPosition property.
52
+ * @param {any} value The value to set.
53
+ */
54
+ set size(value: any);
55
+ /**
56
+ * Getter for the markerPosition property.
57
+ * @returns {any} size The value of the markerPosition property.
58
+ */
59
+ get size(): any;
60
+ /**
61
+ * Setter for the value property.
62
+ * @param value
63
+ */
64
+ set icon(value: string);
65
+ /**
66
+ * Getter for the value property.
67
+ * @returns {string}
68
+ */
69
+ get icon(): string;
70
+ /**
71
+ * Prepares the component before drawing.
72
+ */
73
+ beforeDraw(): Promise<void>;
74
+ tags: any[];
75
+ transformedObjects: any[];
76
+ index: any[];
77
+ /**
78
+ * Draws the component.
79
+ * @returns {DocumentFragment}
80
+ */
81
+ draw(): DocumentFragment;
82
+ popup: HTMLElement;
83
+ input: HTMLElement;
84
+ anchor: HTMLDivElement;
85
+ picker: HTMLDivElement;
86
+ infiniteScroll: InfiniteScroll;
87
+ /**
88
+ * Called after the component has been drawn.
89
+ */
90
+ afterDraw(): void;
91
+ value: any;
92
+ init: boolean;
93
+ /**
94
+ * Initializes the component.
95
+ */
96
+ initial(): void;
97
+ /**
98
+ * Converts an object of tags into a transformed array of objects, separating `filled` and `outline` styles.
99
+ * The function processes an input object containing tags, extracts its values,
100
+ * and for each tag that has both `filled` and `outline` styles, splits them into
101
+ * two separate objects. Tags without `filled` styles remain unchanged.
102
+ * @param {object} tags The input object containing tags as properties. Each property is an object with a `styles` key.
103
+ * @param {object} tags[].styles The styles object containing `filled` and/or `outline` styles.
104
+ * @param {object} [tags[].styles.outline] The outline style object, if present.
105
+ * @param {object} [tags[].styles.filled] The filled style object, if present.
106
+ * @returns {Array<object>} An array of transformed objects. Objects with both `filled` and `outline` styles are split into separate objects, each containing only one style.
107
+ * @example
108
+ * const tags = {
109
+ * hourglass: {
110
+ * styles: {
111
+ * outline: { ... },
112
+ * filled: { ... },
113
+ * }
114
+ * },
115
+ * clock: {
116
+ * styles: {
117
+ * outline: { ... },
118
+ * }
119
+ * }
120
+ * };
121
+ * const result = convertObject(tags);
122
+ * console.log(result);
123
+ * // [
124
+ * // { styles: { outline: { ... } } },
125
+ * // { styles: { filled: { ... } } },
126
+ * // { styles: { outline: { ... } } }
127
+ * // ]
128
+ */
129
+ convertObject: (tags?: {
130
+ styles: {
131
+ outline?: object;
132
+ filled?: object;
133
+ };
134
+ }) => Array<object>;
135
+ /**
136
+ * Converts an icon data object into an HTML element structure.
137
+ * This function creates a styled HTML element that represents an icon with a tooltip.
138
+ * The tooltip displays the name of the icon, and the icon itself is styled based on
139
+ * whether it uses the `filled` style.
140
+ * @param {object} data The icon data object.
141
+ * @returns {HTMLElement} A `div` element containing the icon wrapped in a `wje-tooltip`. The tooltip displays the icon name, and the `wje-icon` element represents the icon with attributes set according to the data.
142
+ * @example
143
+ * const iconData = {
144
+ * name: "hourglass",
145
+ * styles: {
146
+ * filled: { ... }
147
+ * }
148
+ * };
149
+ * const htmlElement = dataToHtml(iconData);
150
+ * document.body.appendChild(htmlElement);
151
+ *
152
+ * // The resulting structure:
153
+ * // <div class="icon-item">
154
+ * // <wje-tooltip content="hourglass">
155
+ * // <wje-icon name="hourglass" size="large" filled></wje-icon></wje-icon>
156
+ * // </wje-tooltip>
157
+ * // </div>
158
+ */
159
+ dataToHtml: (data: object) => HTMLElement;
160
+ /**
161
+ * Gets the category of the tags.
162
+ * @param {Array} tags The tags to get the category of.
163
+ * @returns {Array} The category of the tags.
164
+ */
165
+ getCategory(tags: any[]): any[];
166
+ /**
167
+ * Gets the tags.
168
+ * @returns {Promise<Array>} The tags of the component.
169
+ */
170
+ getTags(): Promise<any[]>;
171
+ /**
172
+ * Searches icons based on user input.
173
+ * This method handles the input event and filters the available icons based on the provided search string.
174
+ * The filtering is performed on an index that combines icon names and their tags.
175
+ * The results are then adjusted for infinite scrolling.
176
+ * @param {Event} e The input event (e.g., `wje-input:input`) containing the search query details.
177
+ */
178
+ searchIcon: (e: Event) => void;
179
+ /**
180
+ * Clears the icons container.
181
+ */
182
+ clearIconsContainer(): void;
183
+ /**
184
+ * Closes the component.
185
+ */
186
+ onClose: () => void;
187
+ }
@@ -0,0 +1,2 @@
1
+ import { default as Img } from './img.element.js';
2
+ export default Img;
@@ -0,0 +1,118 @@
1
+ import { default as WJElement } from '../wje-element/element.js';
2
+ /**
3
+ * @summary This element represents an image. `Img` is a custom web component that represents an image. It extends from `WJElement`.
4
+ * @documentation https://elements.webjet.sk/components/img
5
+ * @status stable
6
+ * @augments {WJElement}
7
+ * @cssproperty --img-width - The width of the image
8
+ * @cssproperty --img-height - The height of the image
9
+ * @property {string} src - The source URL of the image.
10
+ * @property {string} alt - The alternative text for the image.
11
+ * @property {string} fallout - The action to perform when an error occurs while loading the image. The value can be a function or a predefined action like 'delete'.
12
+ * @property {string} loader - The URL of the image loader to display while the image is loading.
13
+ * @tag wje-img
14
+ */
15
+ export default class Img extends WJElement {
16
+ /**
17
+ * Returns the CSS styles for the component.
18
+ * @static
19
+ * @returns {CSSStyleSheet}
20
+ */
21
+ static get cssStyleSheet(): CSSStyleSheet;
22
+ /**
23
+ * Returns the list of attributes to observe for changes.
24
+ * @static
25
+ * @returns {Array<string>}
26
+ */
27
+ static get observedAttributes(): Array<string>;
28
+ _fallout: boolean;
29
+ actions: {
30
+ delete: () => void;
31
+ log: () => void;
32
+ };
33
+ /**
34
+ * Sets the value of the `src` attribute for the element.
35
+ * @param {string} value The value to set for the `src` attribute.
36
+ */
37
+ set src(value: string);
38
+ /**
39
+ * Retrieves the value of the 'src' attribute from the element.
40
+ * @returns {string} The value of the 'src' attribute.
41
+ */
42
+ get src(): string;
43
+ /**
44
+ * Sets the value of the 'alt' attribute for the element.
45
+ * @param {string} value The new value to set for the 'alt' attribute.
46
+ */
47
+ set alt(value: string);
48
+ /**
49
+ * Retrieves the value of the 'alt' attribute for the current element.
50
+ * @returns {string|null} The value of the 'alt' attribute, or null if the attribute is not set.
51
+ */
52
+ get alt(): string | null;
53
+ /**
54
+ * Sets the fallout property. Updates the `fallout` attribute if the value is a string;
55
+ * otherwise, assigns the value to the `_fallout` property.
56
+ * @param {string|*} value The value to set for the fallout property. If a string, it will update the `fallout` attribute; for other types, it will assign it to the `_fallout` property.
57
+ */
58
+ set fallout(value: string | any);
59
+ /**
60
+ * Retrieves the value of the 'fallout' attribute if it exists, otherwise returns the internal `_fallout` property.
61
+ * @returns {string|null} The value of the 'fallout' attribute or the `_fallout` property if the attribute is not present. Returns null if no value is found.
62
+ */
63
+ get fallout(): string | null;
64
+ /**
65
+ * Sets the value of the loader attribute.
66
+ * @param {string} value The value to set for the loader attribute.
67
+ */
68
+ set loader(value: string);
69
+ /**
70
+ * Retrieves the value of the 'loader' attribute from the element.
71
+ * @returns {string|null} The value of the 'loader' attribute if set, otherwise null.
72
+ */
73
+ get loader(): string | null;
74
+ /**
75
+ * Creates and assembles a lazy-loaded image element within a document fragment.
76
+ * @returns {DocumentFragment} A document fragment containing the image element.
77
+ */
78
+ draw(): DocumentFragment;
79
+ native: HTMLImageElement;
80
+ /**
81
+ * Handles post-draw operations, such as setting up a lazy image loader using an IntersectionObserver.
82
+ * Observes when the target element becomes visible in the viewport and updates its source with the provided image source.
83
+ * Removes the `lazy` class once the image source is updated and unobserves the element.
84
+ * It also invokes the `onerrorFunc` method at the beginning to handle potential error scenarios.
85
+ * @returns {void} Does not return a value.
86
+ */
87
+ afterDraw(): void;
88
+ setAvatarInitials: (value?: boolean) => void;
89
+ /**
90
+ * Deletes the current image by calling the remove method.
91
+ * This function is typically used to trigger the removal of an image element
92
+ * or perform cleanup operations related to the image.
93
+ */
94
+ deleteImage: () => void;
95
+ /**
96
+ * Adds a new action to the internal actions object.
97
+ * @param {string} name The name of the action to be added.
98
+ * @param {Function} func The function representing the action logic.
99
+ * @returns {void} This method does not return a value.
100
+ */
101
+ addAction(name: string, func: Function): void;
102
+ /**
103
+ * Removes an action from the actions list if it exists.
104
+ * @param {string} name The name of the action to remove.
105
+ * @returns {void} Does not return a value.
106
+ */
107
+ removeAction(name: string): void;
108
+ /**
109
+ * Handles error scenarios by checking the `fallout` property and performing
110
+ * corresponding actions. If `fallout` is not defined, the function terminates
111
+ * early. Logs the active actions and attempts to assign an error handler
112
+ * based on the `fallout` value. If the `fallout` value does not correspond to
113
+ * a recognized action, it logs an error message.
114
+ * @function onerrorFunc
115
+ * @memberof Img
116
+ */
117
+ onerrorFunc: (img: any) => void;
118
+ }
@@ -0,0 +1,2 @@
1
+ import { default as ImgComparer } from './img-comparer.element.js';
2
+ export default ImgComparer;
@@ -0,0 +1,60 @@
1
+ import { default as WJElement } from '../wje-element/element.js';
2
+ import { default as Icon } from '../wje-icon/icon.js';
3
+ /**
4
+ * @summary This element allows users to compare two images. `ImgComparer` is a custom web component that represents an image comparer.
5
+ * It extends from `WJElement` and uses the `Icon` component.
6
+ * @documentation https://elements.webjet.sk/components/img-comparer
7
+ * @status stable
8
+ * @augments {WJElement}
9
+ * @slot before - The before image slot.
10
+ * @slot after - The after image slot.
11
+ * @csspart divider - The divider part.
12
+ * @cssproperty [--wje-img-compare-divider-area=12px] - The area of the divider. This is the size of the divider. Accepts any valid CSS size.
13
+ * @cssproperty [--wje-img-compare-divider-background=white] - Sets the background color of the divider in the image comparison component. Accepts any valid CSS color value (e.g., `red`, `#ff0000`, `rgba(255, 255, 255, 0.5)`). The default value is `white`, which ensures high contrast in most designs.
14
+ * @cssproperty [--wje-img-compare-divider-size=2px] - The size of the divider. This is the thickness of the divider. Accepts any valid CSS size.
15
+ * @cssproperty [--wje-img-compare-divider-left=50%] - The left position of the divider. This is the initial position of the divider.
16
+ * @cssproperty [--wje-img-compare-position=50%] - The position of the divider. This is the position of the divider.
17
+ * @cssproperty [--wje-img-compare-clip-path=inset(0 calc(100% - var(--wje-img-compare-position)) 0 0)] - The clip path of the divider. This is the clip path of the divider.
18
+ * @tag wje-img-comparer
19
+ */
20
+ export default class ImgComparer extends WJElement {
21
+ /**
22
+ * Returns the CSS styles for the component.
23
+ * @static
24
+ * @returns {CSSStyleSheet}
25
+ */
26
+ static get cssStyleSheet(): CSSStyleSheet;
27
+ /**
28
+ * Returns the list of attributes to observe for changes.
29
+ * @static
30
+ * @returns {Array<string>}
31
+ */
32
+ static get observedAttributes(): Array<string>;
33
+ /**
34
+ * Dependencies of the ImgComparer component.
35
+ * @property {object} dependencies
36
+ */
37
+ dependencies: {
38
+ 'wje-icon': typeof Icon;
39
+ };
40
+ /**
41
+ * Draws the component.
42
+ * @returns {DocumentFragment}
43
+ */
44
+ draw(): DocumentFragment;
45
+ native: HTMLDivElement;
46
+ /**
47
+ * Handles the drag event.
48
+ * @param {Event} e The event.
49
+ */
50
+ handleDrag: (e: Event) => void;
51
+ position: number;
52
+ /**
53
+ * Clamps a number between a minimum and maximum value.
54
+ * @param {number} num The number to clamp.
55
+ * @param {number} min The minimum value.
56
+ * @param {number} max The maximum value.
57
+ * @returns {number} The clamped number.
58
+ */
59
+ clamp: (num: number, min: number, max: number) => number;
60
+ }
@@ -0,0 +1 @@
1
+ export function drag(container: any, options: any): void;
@@ -0,0 +1,2 @@
1
+ import { default as InfiniteScroll } from './infinite-scroll.element.js';
2
+ export default InfiniteScroll;
@@ -0,0 +1,172 @@
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(): Array<string>;
29
+ totalPages: number;
30
+ isLoading: any[];
31
+ iterate: Element;
32
+ placementObj: this;
33
+ /**
34
+ * Dependencies of the InfiniteScroll component.
35
+ * @param value
36
+ */
37
+ set infiniteScrollTemplate(value: null);
38
+ /**
39
+ * Getter for the infiniteScrollTemplate property.
40
+ * @returns {null}
41
+ */
42
+ get infiniteScrollTemplate(): null;
43
+ /**
44
+ * Dependencies of the InfiniteScroll component.
45
+ * @param value
46
+ */
47
+ set response(value: any | {});
48
+ /**
49
+ * Getter for the response property.
50
+ * @returns {*|{}}
51
+ */
52
+ get response(): any | {};
53
+ /**
54
+ * Dependencies of the InfiniteScroll component.
55
+ * @param value
56
+ */
57
+ set objectName(value: string);
58
+ get objectName(): string;
59
+ /**
60
+ * Prepares the component for updates before it is drawn.
61
+ * This method handles the removal of templates for iteration, adjusts the height styling of the component,
62
+ * and manages abort signals for loading operations.
63
+ * @returns {void} No return value.
64
+ */
65
+ beforeDraw(): void;
66
+ /**
67
+ * Creates and returns a document fragment containing the structure for an infinite scroll component.
68
+ * The structure includes native elements, slots for customization, and optional loading content.
69
+ * @returns {DocumentFragment} The document fragment containing the component's DOM structure.
70
+ */
71
+ draw(): DocumentFragment;
72
+ loadingEl: HTMLDivElement;
73
+ endingEl: HTMLSlotElement;
74
+ /**
75
+ * Called after the component has been drawn.
76
+ */
77
+ afterDraw(): Promise<void>;
78
+ queryParams: any;
79
+ size: any;
80
+ currentPage: number;
81
+ /**
82
+ * Attaches a scroll event listener to the current object.
83
+ * The `scrollEvent` function binds the `onScroll` method to the 'scroll' event
84
+ * of the current object. This enables handling of scroll events for
85
+ * specific functionality such as updating UI elements, loading content dynamically,
86
+ * or tracking user interaction with scrollable content.
87
+ */
88
+ scrollEvent: () => void;
89
+ /**
90
+ * A function that removes the scroll event listener from the current context.
91
+ * This function is used to unbind the `onScroll` event listener
92
+ * from the `scroll` event of the current object. It ensures that
93
+ * the scroll event no longer triggers the `onScroll` handler.
94
+ * @function
95
+ */
96
+ unScrollEvent: () => void;
97
+ /**
98
+ * A scroll event handler function that checks the scroll position and triggers loading additional content
99
+ * when the user scrolls near the bottom of the page.
100
+ * Properties accessed:
101
+ * - `scrollTop`: The number of pixels that the content of an element is scrolled vertically.
102
+ * - `scrollHeight`: The total height of the element's content.
103
+ * - `clientHeight`: The inner height of the element in pixels, including padding but excluding borders and scrollbars.
104
+ * Conditions:
105
+ * - Determines if the scroll position is within 300 pixels of the bottom of the element.
106
+ * - Verifies that the current page number is less than or equal to the total number of pages.
107
+ * - Checks if the current page is already in the loading state.
108
+ * Actions:
109
+ * - Increments the current page number when the conditions are met.
110
+ * - Initiates loading for the next page by calling the `loadPages` function.
111
+ * @param {Event} e The scroll event object.
112
+ */
113
+ onScroll: (e: Event) => void;
114
+ /**
115
+ * Fetches the pages from the server.
116
+ * @param {number} page The page number.
117
+ * @returns {Promise<object>} The response from the server.
118
+ */
119
+ getPages(page: number): Promise<object>;
120
+ /**
121
+ * Hides the loader.
122
+ */
123
+ hideLoader(): void;
124
+ /**
125
+ * Displays the loader element by adding the 'show' class to its class list.
126
+ * This method is useful for indicating a loading or processing state in the UI.
127
+ * @returns {void} No return value.
128
+ */
129
+ showLoader(): void;
130
+ /**
131
+ * Checks if there are more pages to load.
132
+ * @param {number} page The page number.
133
+ * @returns {boolean} Whether there are more pages to load.
134
+ */
135
+ hasMorePages(page: number): boolean;
136
+ /**
137
+ * Loads the pages.
138
+ * @param {number} page The page number.
139
+ */
140
+ loadPages(page: number): Promise<void>;
141
+ parser: DOMParser;
142
+ compareFunction: (i: any, item: any) => boolean;
143
+ /**
144
+ * Converts a data item into an HTML element based on a template.
145
+ * This function takes a data item, interpolates it into a predefined template,
146
+ * parses the resulting HTML string, and returns the first child element of the parsed HTML content.
147
+ * @param {object} item The data object to interpolate into the HTML template.
148
+ * @returns {Element} The first child element generated from the interpolated HTML string.
149
+ */
150
+ dataToHtml: (item: object) => Element;
151
+ /**
152
+ * A custom implementation of the forEach method designed to iterate over an array of data,
153
+ * transform each item into an HTML element, and append the element to a specified placement object.
154
+ * Additionally, it adds an event listener to each generated element for handling click events.
155
+ * @param {Array} data An array of items to process. Each item is transformed into an HTML element
156
+ * and appended to the placement object specified in the context of `this`.
157
+ */
158
+ customForeach: (data: any[]) => void;
159
+ /**
160
+ * Interpolates a string template with values from the provided parameters object.
161
+ * The template contains placeholders in the format `{{key}}` or `{{key.subkey}}`,
162
+ * which are replaced with the corresponding values from the `params` object.
163
+ * Placeholders support dot notation for accessing nested properties within the `params` object.
164
+ * @param {string} template The string template containing placeholders to be replaced.
165
+ * @param {object} params The object containing key-value pairs used for substitution in the template.
166
+ * @returns {string} A string with all placeholders replaced by their respective values from the `params` object.
167
+ */
168
+ interpolate: (template: string, params: object) => string;
169
+ addItem(item: any, place?: string): void;
170
+ removeItem(item: any): void;
171
+ #private;
172
+ }
@@ -0,0 +1,2 @@
1
+ import { default as Input } from './input.element.js';
2
+ export default Input;