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.
Files changed (232) hide show
  1. package/dist/packages/index.d.ts +104 -0
  2. package/dist/packages/localize/localize.d.ts +17 -0
  3. package/dist/packages/translations/en-gb.d.ts +18 -0
  4. package/dist/packages/translations/sk-sk.d.ts +13 -0
  5. package/dist/packages/utils/animations.d.ts +2 -0
  6. package/dist/packages/utils/date.d.ts +1 -0
  7. package/dist/packages/utils/element-utils.d.ts +46 -0
  8. package/dist/packages/utils/event.d.ts +67 -0
  9. package/dist/packages/utils/localize.d.ts +4 -0
  10. package/dist/packages/utils/permissions-api.d.ts +34 -0
  11. package/dist/packages/utils/utils.d.ts +1 -0
  12. package/dist/packages/utils/wje-import-firefox.d.ts +0 -0
  13. package/dist/packages/utils/wje-import.d.ts +0 -0
  14. package/dist/packages/wje-accordion/accordion.d.ts +2 -0
  15. package/dist/packages/wje-accordion/accordion.element.d.ts +72 -0
  16. package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
  17. package/dist/packages/wje-accordion-item/accordion-item.d.ts +2 -0
  18. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +40 -0
  19. package/dist/packages/wje-animation/animation.d.ts +2 -0
  20. package/dist/packages/wje-animation/animation.element.d.ts +158 -0
  21. package/dist/packages/wje-animation/animation.test.d.ts +1 -0
  22. package/dist/packages/wje-aside/aside.d.ts +2 -0
  23. package/dist/packages/wje-aside/aside.element.d.ts +31 -0
  24. package/dist/packages/wje-avatar/avatar.d.ts +2 -0
  25. package/dist/packages/wje-avatar/avatar.element.d.ts +76 -0
  26. package/dist/packages/wje-avatar/avatar.test.d.ts +1 -0
  27. package/dist/packages/wje-avatar/service/service.d.ts +40 -0
  28. package/dist/packages/wje-badge/badge.d.ts +2 -0
  29. package/dist/packages/wje-badge/badge.element.d.ts +35 -0
  30. package/dist/packages/wje-badge/badge.test.d.ts +1 -0
  31. package/dist/packages/wje-breadcrumb/breadcrumb.d.ts +2 -0
  32. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +80 -0
  33. package/dist/packages/wje-breadcrumbs/breadcrumbs.d.ts +2 -0
  34. package/dist/packages/wje-breadcrumbs/breadcrumbs.element.d.ts +97 -0
  35. package/dist/packages/wje-breadcrumbs/breadcrumbs.test.d.ts +1 -0
  36. package/dist/packages/wje-button/button.d.ts +2 -0
  37. package/dist/packages/wje-button/button.element.d.ts +173 -0
  38. package/dist/packages/wje-button/button.test.d.ts +1 -0
  39. package/dist/packages/wje-button-group/button-group.d.ts +2 -0
  40. package/dist/packages/wje-button-group/button-group.element.d.ts +39 -0
  41. package/dist/packages/wje-card/card.d.ts +2 -0
  42. package/dist/packages/wje-card/card.element.d.ts +29 -0
  43. package/dist/packages/wje-card-content/card-content.d.ts +2 -0
  44. package/dist/packages/wje-card-content/card-content.element.d.ts +22 -0
  45. package/dist/packages/wje-card-controls/card-controls.d.ts +2 -0
  46. package/dist/packages/wje-card-controls/card-controls.element.d.ts +23 -0
  47. package/dist/packages/wje-card-header/card-header.d.ts +2 -0
  48. package/dist/packages/wje-card-header/card-header.element.d.ts +22 -0
  49. package/dist/packages/wje-card-subtitle/card-subtitle.d.ts +2 -0
  50. package/dist/packages/wje-card-subtitle/card-subtitle.element.d.ts +30 -0
  51. package/dist/packages/wje-card-title/card-title.d.ts +2 -0
  52. package/dist/packages/wje-card-title/card-title.element.d.ts +32 -0
  53. package/dist/packages/wje-carousel/carousel.d.ts +2 -0
  54. package/dist/packages/wje-carousel/carousel.element.d.ts +146 -0
  55. package/dist/packages/wje-carousel-item/carousel-item.d.ts +2 -0
  56. package/dist/packages/wje-carousel-item/carousel-item.element.d.ts +38 -0
  57. package/dist/packages/wje-checkbox/checkbox.d.ts +2 -0
  58. package/dist/packages/wje-checkbox/checkbox.element.d.ts +171 -0
  59. package/dist/packages/wje-chip/chip.d.ts +2 -0
  60. package/dist/packages/wje-chip/chip.element.d.ts +30 -0
  61. package/dist/packages/wje-col/col.d.ts +2 -0
  62. package/dist/packages/wje-col/col.element.d.ts +16 -0
  63. package/dist/packages/wje-color-picker/color-picker.d.ts +2 -0
  64. package/dist/packages/wje-color-picker/color-picker.element.d.ts +187 -0
  65. package/dist/packages/wje-color-picker/color-picker.test.d.ts +1 -0
  66. package/dist/packages/wje-container/container.d.ts +2 -0
  67. package/dist/packages/wje-container/container.element.d.ts +31 -0
  68. package/dist/packages/wje-copy-button/copy-button.d.ts +2 -0
  69. package/dist/packages/wje-copy-button/copy-button.element.d.ts +89 -0
  70. package/dist/packages/wje-copy-button/service/service.d.ts +12 -0
  71. package/dist/packages/wje-dialog/dialog.d.ts +2 -0
  72. package/dist/packages/wje-dialog/dialog.element.d.ts +116 -0
  73. package/dist/packages/wje-divider/divider.d.ts +2 -0
  74. package/dist/packages/wje-divider/divider.element.d.ts +32 -0
  75. package/dist/packages/wje-dropdown/dropdown.d.ts +2 -0
  76. package/dist/packages/wje-dropdown/dropdown.element.d.ts +85 -0
  77. package/dist/packages/wje-element/element.d.ts +316 -0
  78. package/dist/packages/wje-element/service/universal-service.d.ts +18 -0
  79. package/dist/packages/wje-file-upload/file-upload.d.ts +2 -0
  80. package/dist/packages/wje-file-upload/file-upload.element.d.ts +191 -0
  81. package/dist/packages/wje-file-upload/service/service.d.ts +70 -0
  82. package/dist/packages/wje-file-upload-item/file-upload-item.d.ts +2 -0
  83. package/dist/packages/wje-file-upload-item/file-upload-item.element.d.ts +66 -0
  84. package/dist/packages/wje-footer/footer.d.ts +2 -0
  85. package/dist/packages/wje-footer/footer.element.d.ts +28 -0
  86. package/dist/packages/wje-form/form.d.ts +2 -0
  87. package/dist/packages/wje-form/form.element.d.ts +28 -0
  88. package/dist/packages/wje-format-digital/format-digital.d.ts +2 -0
  89. package/dist/packages/wje-format-digital/format-digital.element.d.ts +87 -0
  90. package/dist/packages/wje-format-digital/format-digital.test.d.ts +1 -0
  91. package/dist/packages/wje-grid/grid.d.ts +2 -0
  92. package/dist/packages/wje-grid/grid.element.d.ts +26 -0
  93. package/dist/packages/wje-header/header.d.ts +2 -0
  94. package/dist/packages/wje-header/header.element.d.ts +35 -0
  95. package/dist/packages/wje-icon/icon.d.ts +2 -0
  96. package/dist/packages/wje-icon/icon.element.d.ts +40 -0
  97. package/dist/packages/wje-icon/service/service.d.ts +11 -0
  98. package/dist/packages/wje-icon-picker/icon-picker.d.ts +2 -0
  99. package/dist/packages/wje-icon-picker/icon-picker.element.d.ts +197 -0
  100. package/dist/packages/wje-img/img.d.ts +2 -0
  101. package/dist/packages/wje-img/img.element.d.ts +117 -0
  102. package/dist/packages/wje-img-comparer/img-comparer.d.ts +2 -0
  103. package/dist/packages/wje-img-comparer/img-comparer.element.d.ts +60 -0
  104. package/dist/packages/wje-img-comparer/service/service.d.ts +1 -0
  105. package/dist/packages/wje-infinite-scroll/infinite-scroll.d.ts +2 -0
  106. package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +173 -0
  107. package/dist/packages/wje-input/input.d.ts +2 -0
  108. package/dist/packages/wje-input/input.element.d.ts +204 -0
  109. package/dist/packages/wje-input-file/input-file.d.ts +2 -0
  110. package/dist/packages/wje-input-file/input-file.element.d.ts +50 -0
  111. package/dist/packages/wje-item/item.d.ts +2 -0
  112. package/dist/packages/wje-item/item.element.d.ts +68 -0
  113. package/dist/packages/wje-kanban/kanban.d.ts +2 -0
  114. package/dist/packages/wje-kanban/kanban.element.d.ts +183 -0
  115. package/dist/packages/wje-label/label.d.ts +2 -0
  116. package/dist/packages/wje-label/label.element.d.ts +34 -0
  117. package/dist/packages/wje-level-indicator/level-indicator.d.ts +2 -0
  118. package/dist/packages/wje-level-indicator/level-indicator.element.d.ts +91 -0
  119. package/dist/packages/wje-list/list.d.ts +2 -0
  120. package/dist/packages/wje-list/list.element.d.ts +31 -0
  121. package/dist/packages/wje-main/main.d.ts +2 -0
  122. package/dist/packages/wje-main/main.element.d.ts +30 -0
  123. package/dist/packages/wje-masonry/masonry.d.ts +2 -0
  124. package/dist/packages/wje-masonry/masonry.element.d.ts +114 -0
  125. package/dist/packages/wje-masonry/service/service.d.ts +32 -0
  126. package/dist/packages/wje-menu/menu.d.ts +2 -0
  127. package/dist/packages/wje-menu/menu.element.d.ts +47 -0
  128. package/dist/packages/wje-menu-button/menu-button.d.ts +2 -0
  129. package/dist/packages/wje-menu-button/menu-button.element.d.ts +34 -0
  130. package/dist/packages/wje-menu-item/menu-item.d.ts +2 -0
  131. package/dist/packages/wje-menu-item/menu-item.element.d.ts +139 -0
  132. package/dist/packages/wje-menu-label/menu-label.d.ts +2 -0
  133. package/dist/packages/wje-menu-label/menu-label.element.d.ts +39 -0
  134. package/dist/packages/wje-option/option.d.ts +2 -0
  135. package/dist/packages/wje-option/option.element.d.ts +59 -0
  136. package/dist/packages/wje-options/options.d.ts +2 -0
  137. package/dist/packages/wje-options/options.element.d.ts +183 -0
  138. package/dist/packages/wje-orgchart/orgchart.d.ts +2 -0
  139. package/dist/packages/wje-orgchart/orgchart.element.d.ts +24 -0
  140. package/dist/packages/wje-orgchart-group/orgchart-group.d.ts +2 -0
  141. package/dist/packages/wje-orgchart-group/orgchart-group.element.d.ts +28 -0
  142. package/dist/packages/wje-orgchart-item/orgchart-item.d.ts +2 -0
  143. package/dist/packages/wje-orgchart-item/orgchart-item.element.d.ts +49 -0
  144. package/dist/packages/wje-pagination/pagination.d.ts +2 -0
  145. package/dist/packages/wje-pagination/pagination.element.d.ts +166 -0
  146. package/dist/packages/wje-pagination/pagination.test.d.ts +1 -0
  147. package/dist/packages/wje-pagination/service/service.d.ts +9 -0
  148. package/dist/packages/wje-panel/panel.d.ts +2 -0
  149. package/dist/packages/wje-panel/panel.element.d.ts +34 -0
  150. package/dist/packages/wje-popup/popup.d.ts +2 -0
  151. package/dist/packages/wje-popup/popup.element.d.ts +93 -0
  152. package/dist/packages/wje-progress-bar/progress-bar.d.ts +2 -0
  153. package/dist/packages/wje-progress-bar/progress-bar.element.d.ts +96 -0
  154. package/dist/packages/wje-qr-code/qr-code.d.ts +2 -0
  155. package/dist/packages/wje-qr-code/qr-code.element.d.ts +33 -0
  156. package/dist/packages/wje-radio/radio.d.ts +2 -0
  157. package/dist/packages/wje-radio/radio.element.d.ts +53 -0
  158. package/dist/packages/wje-radio-group/radio-group.d.ts +2 -0
  159. package/dist/packages/wje-radio-group/radio-group.element.d.ts +137 -0
  160. package/dist/packages/wje-rate/rate.d.ts +2 -0
  161. package/dist/packages/wje-rate/rate.element.d.ts +156 -0
  162. package/dist/packages/wje-relative-time/relative-time.d.ts +2 -0
  163. package/dist/packages/wje-relative-time/relative-time.element.d.ts +55 -0
  164. package/dist/packages/wje-relative-time/relative-time.test.d.ts +1 -0
  165. package/dist/packages/wje-reorder/reorder.d.ts +2 -0
  166. package/dist/packages/wje-reorder/reorder.element.d.ts +119 -0
  167. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.d.ts +2 -0
  168. package/dist/packages/wje-reorder-dropzone/reorder-dropzone.element.d.ts +23 -0
  169. package/dist/packages/wje-reorder-handle/reorder-handle.d.ts +2 -0
  170. package/dist/packages/wje-reorder-handle/reorder-handle.element.d.ts +75 -0
  171. package/dist/packages/wje-reorder-item/reorder-item.d.ts +2 -0
  172. package/dist/packages/wje-reorder-item/reorder-item.element.d.ts +24 -0
  173. package/dist/packages/wje-route/route.d.ts +2 -0
  174. package/dist/packages/wje-route/route.element.d.ts +22 -0
  175. package/dist/packages/wje-router/router.d.ts +2 -0
  176. package/dist/packages/wje-router/router.element.d.ts +39 -0
  177. package/dist/packages/wje-router-link/router-link.d.ts +2 -0
  178. package/dist/packages/wje-router-link/router-link.element.d.ts +31 -0
  179. package/dist/packages/wje-router-outlet/router-outlet.d.ts +2 -0
  180. package/dist/packages/wje-router-outlet/router-outlet.element.d.ts +15 -0
  181. package/dist/packages/wje-row/row.d.ts +2 -0
  182. package/dist/packages/wje-row/row.element.d.ts +23 -0
  183. package/dist/packages/wje-select/select.d.ts +2 -0
  184. package/dist/packages/wje-select/select.element.d.ts +315 -0
  185. package/dist/packages/wje-slider/slider.d.ts +2 -0
  186. package/dist/packages/wje-slider/slider.element.d.ts +103 -0
  187. package/dist/packages/wje-split-view/service/service.d.ts +1 -0
  188. package/dist/packages/wje-split-view/split-view.d.ts +2 -0
  189. package/dist/packages/wje-split-view/split-view.element.d.ts +66 -0
  190. package/dist/packages/wje-status/status.d.ts +2 -0
  191. package/dist/packages/wje-status/status.element.d.ts +26 -0
  192. package/dist/packages/wje-step/step.d.ts +2 -0
  193. package/dist/packages/wje-step/step.element.d.ts +23 -0
  194. package/dist/packages/wje-stepper/stepper.d.ts +2 -0
  195. package/dist/packages/wje-stepper/stepper.element.d.ts +78 -0
  196. package/dist/packages/wje-store/default-store-actions.d.ts +25 -0
  197. package/dist/packages/wje-store/pubsub.d.ts +21 -0
  198. package/dist/packages/wje-store/store.d.ts +153 -0
  199. package/dist/packages/wje-tab/tab.d.ts +2 -0
  200. package/dist/packages/wje-tab/tab.element.d.ts +41 -0
  201. package/dist/packages/wje-tab-group/tab-group.d.ts +2 -0
  202. package/dist/packages/wje-tab-group/tab-group.element.d.ts +67 -0
  203. package/dist/packages/wje-tab-panel/tab-panel.d.ts +2 -0
  204. package/dist/packages/wje-tab-panel/tab-panel.element.d.ts +23 -0
  205. package/dist/packages/wje-textarea/textarea.d.ts +2 -0
  206. package/dist/packages/wje-textarea/textarea.element.d.ts +176 -0
  207. package/dist/packages/wje-thumbnail/thumbnail.d.ts +2 -0
  208. package/dist/packages/wje-thumbnail/thumbnail.element.d.ts +31 -0
  209. package/dist/packages/wje-timeline/timeline.d.ts +2 -0
  210. package/dist/packages/wje-timeline/timeline.element.d.ts +25 -0
  211. package/dist/packages/wje-timeline-item/timeline-item.d.ts +2 -0
  212. package/dist/packages/wje-timeline-item/timeline-item.element.d.ts +27 -0
  213. package/dist/packages/wje-toast/toast.d.ts +2 -0
  214. package/dist/packages/wje-toast/toast.element.d.ts +173 -0
  215. package/dist/packages/wje-toast/toast.test.d.ts +1 -0
  216. package/dist/packages/wje-toggle/toggle.d.ts +2 -0
  217. package/dist/packages/wje-toggle/toggle.element.d.ts +65 -0
  218. package/dist/packages/wje-toolbar/toolbar.d.ts +2 -0
  219. package/dist/packages/wje-toolbar/toolbar.element.d.ts +39 -0
  220. package/dist/packages/wje-toolbar-action/toolbar-action.d.ts +2 -0
  221. package/dist/packages/wje-toolbar-action/toolbar-action.element.d.ts +35 -0
  222. package/dist/packages/wje-tooltip/tooltip.d.ts +2 -0
  223. package/dist/packages/wje-tooltip/tooltip.element.d.ts +71 -0
  224. package/dist/packages/wje-tree/tree.d.ts +2 -0
  225. package/dist/packages/wje-tree/tree.element.d.ts +104 -0
  226. package/dist/packages/wje-tree/tree.test.d.ts +1 -0
  227. package/dist/packages/wje-tree-item/tree-item.d.ts +2 -0
  228. package/dist/packages/wje-tree-item/tree-item.element.d.ts +155 -0
  229. package/dist/packages/wje-tree-item/tree-item.test.d.ts +1 -0
  230. package/dist/packages/wje-visually-hidden/visually-hidden.d.ts +2 -0
  231. package/dist/packages/wje-visually-hidden/visually-hidden.element.d.ts +29 -0
  232. package/package.json +1 -1
@@ -0,0 +1,316 @@
1
+ import { UniversalService } from './service/universal-service.js';
2
+ import { defaultStoreActions } from '../wje-store/store.js';
3
+ import { WjePermissionsApi } from '../utils/permissions-api.js';
4
+ import { WjElementUtils } from '../utils/element-utils.js';
5
+ import { event } from '../utils/event.js';
6
+ export default class WJElement extends HTMLElement {
7
+ /**
8
+ * Processes and combines two templates into one.
9
+ * @param pTemplate The primary template.
10
+ * @param inputTemplate The secondary template.
11
+ * @returns The combined template.
12
+ */
13
+ static processTemplates: (pTemplate: any, inputTemplate: any) => HTMLTemplateElement;
14
+ /**
15
+ * Defines a custom element if not already defined.
16
+ * @param name The name of the custom element.
17
+ * @param [elementConstructor] The constructor for the custom element.
18
+ * @param [options] Additional options for defining the element.
19
+ */
20
+ static define(name: any, elementConstructor?: typeof WJElement, options?: {}): void;
21
+ isAttached: boolean;
22
+ service: UniversalService;
23
+ rendering: boolean;
24
+ _dependencies: {};
25
+ /**
26
+ * @typedef {CREATED | ATTACHED | BEGINING | START | DRAWING | DONE | DISCONNECTED} DrawingStatus
27
+ * @property {number} CREATED - The component has been created.
28
+ * @property {number} ATTACHED - The component has been attached to the DOM.
29
+ * @property {number} BEGINING - The component is beginning to draw.
30
+ * @property {number} START - The component has started drawing.
31
+ * @property {number} DRAWING - The component is drawing.
32
+ * @property {number} DONE - The component has finished drawing.
33
+ * @property {number} DISCONNECTED - The component has been disconnected from the DOM.
34
+ */
35
+ drawingStatuses: {
36
+ CREATED: number;
37
+ ATTACHED: number;
38
+ BEGINING: number;
39
+ START: number;
40
+ DRAWING: number;
41
+ DONE: number;
42
+ DISCONNECTED: number;
43
+ };
44
+ drawingStatus: number;
45
+ isInitializing: boolean;
46
+ /**
47
+ * Sets the value of the 'permission' attribute.
48
+ * @param {string[]} value The value to set for the 'permission' attribute.
49
+ */
50
+ set permission(value: string[]);
51
+ /**
52
+ * Gets the value of the 'permission-check' attribute.
53
+ * @returns {string[]} The value of the 'permission' attribute.
54
+ */
55
+ get permission(): string[];
56
+ /**
57
+ * Sets the 'permission-check' attribute.
58
+ * @param {boolean} value The value to set for the 'permission-check' attribute.
59
+ */
60
+ set isPermissionCheck(value: boolean);
61
+ /**
62
+ * Checks if the 'permission-check' attribute is present.
63
+ * @returns {boolean} True if the 'permission-check' attribute is present.
64
+ */
65
+ get isPermissionCheck(): boolean;
66
+ set noShow(value: boolean);
67
+ /**
68
+ * Checks if the 'show' attribute is present.
69
+ * @returns {boolean} True if the 'show' attribute is present.
70
+ */
71
+ get noShow(): boolean;
72
+ /**
73
+ * Sets the 'shadow' attribute.
74
+ * @param {string} value The value to set for the 'shadow' attribute.
75
+ */
76
+ set isShadowRoot(value: string);
77
+ get isShadowRoot(): string;
78
+ /**
79
+ * Checks if the 'shadow' attribute is present.
80
+ * @returns {boolean} True if the 'shadow' attribute is present.
81
+ */
82
+ get hasShadowRoot(): boolean;
83
+ /**
84
+ * Gets the value of the 'shadow' attribute or 'open' if not set.
85
+ * @returns {string} The value of the 'shadow' attribute or 'open'.
86
+ */
87
+ get shadowType(): string;
88
+ /**
89
+ * Gets the rendering context, either the shadow root or the component itself.
90
+ * @returns The rendering context.
91
+ */
92
+ get context(): any;
93
+ /**
94
+ * Gets the store instance.
95
+ * @returns {object} The store instance.
96
+ */
97
+ get store(): any;
98
+ /**
99
+ * @typedef {object} ArrayActions
100
+ * @property {Function} addAction - Adds an item to the array.
101
+ * @property {Function} deleteAction - Deletes an item from the array.
102
+ * @property {Function} loadAction - Loads an array.
103
+ * @property {Function} updateAction - Updates an item in the array.
104
+ * @property {Function} addManyAction - Adds many items to the array.
105
+ */
106
+ /**
107
+ * @typedef {object} ObjectActions
108
+ * @property {Function} addAction - Replace old object with new object
109
+ * @property {Function} deleteAction - Delete item based on key
110
+ * @property {Function} updateAction - Update item based on key
111
+ */
112
+ /**
113
+ * Gets the default store actions.
114
+ * @returns The default store actions for arrays and objects.
115
+ */
116
+ get defaultStoreActions(): typeof defaultStoreActions;
117
+ /**
118
+ * Gets the classes to be removed after the component is connected.
119
+ * @returns An array of class names to remove.
120
+ */
121
+ get removeClassAfterConnect(): string[];
122
+ /**
123
+ * Sets the component dependencies.
124
+ * @param value The dependencies to set.
125
+ */
126
+ set dependencies(value: {});
127
+ /**
128
+ * Gets the component dependencies.
129
+ * @returns The component dependencies.
130
+ */
131
+ get dependencies(): {};
132
+ /**
133
+ * Defines component dependencies by registering custom elements.
134
+ */
135
+ defineDependencies(): void;
136
+ /**
137
+ * Hook for extending behavior before drawing the component.
138
+ * @param context The rendering context, usually the element's shadow root or main DOM element.
139
+ * @param appStoreObj The global application store for managing state.
140
+ * @param params Additional parameters or attributes for rendering the component.
141
+ */
142
+ beforeDraw(context: any, appStoreObj: any, params: any): void;
143
+ /**
144
+ * Renders the component within the provided context.
145
+ * @param context The rendering context, usually the element's shadow root or main DOM element.
146
+ * @param appStoreObj
147
+ * @param params Additional parameters or attributes for rendering the component.
148
+ * @returns This implementation does not render anything and returns `null`.
149
+ * @description
150
+ * The `draw` method is responsible for rendering the component's content.
151
+ * Override this method in subclasses to define custom rendering logic.
152
+ * @example
153
+ * class MyComponent extends WJElement {
154
+ * draw(context, appStoreObj, params) {
155
+ * const div = document.createElement('div');
156
+ * div.textContent = 'Hello, world!';
157
+ * context.appendChild(div);
158
+ * }
159
+ * }
160
+ */
161
+ draw(context: any, appStoreObj: any, params: any): any;
162
+ /**
163
+ * Renders the component within the provided context.
164
+ * @param context The rendering context, usually the element's shadow root or main DOM element.
165
+ * @param appStore The global application store for managing state.
166
+ * @param params Additional parameters or attributes for rendering the component.
167
+ * @returns This implementation does not render anything and returns `null`.
168
+ * @description
169
+ * The `draw` method is responsible for rendering the component's content.
170
+ * Override this method in subclasses to define custom rendering logic.
171
+ * @example
172
+ * class MyComponent extends WJElement {
173
+ * draw(context, appStore, params) {
174
+ * const div = document.createElement('div');
175
+ * div.textContent = 'Hello, world!';
176
+ * context.appendChild(div);
177
+ * }
178
+ * }
179
+ */
180
+ draw(context: any, appStore: any, params: any): any;
181
+ /**
182
+ * Hook for extending behavior after drawing the component.
183
+ * @param context The rendering context, usually the element's shadow root or main DOM element.
184
+ * @param appStoreObj The global application store for managing state.
185
+ * @param params Additional parameters or attributes for rendering the component.
186
+ */
187
+ afterDraw(context: any, appStoreObj: any, params: any): void;
188
+ /**
189
+ * Refreshes the update promise for rendering lifecycle management.
190
+ */
191
+ refreshUpdatePromise(): void;
192
+ updateComplete: Promise<any>;
193
+ finisPromise: (value: any) => void;
194
+ rejectPromise: (reason?: any) => void;
195
+ /**
196
+ * Lifecycle method invoked when the component is connected to the DOM.
197
+ */
198
+ connectedCallback(): void;
199
+ renderPromise: Promise<any> | Promise<void>;
200
+ /**
201
+ * Initializes the component, setting up attributes and rendering.
202
+ * @param [force] Whether to force initialization.
203
+ * @returns A promise that resolves when initialization is complete.
204
+ */
205
+ initWjElement: (force?: boolean) => Promise<any>;
206
+ /**
207
+ * Sets up attributes and event listeners for the component.
208
+ * This method retrieves all custom events defined for the component
209
+ * and adds event listeners for each of them. When an event is triggered,
210
+ * it calls the corresponding method on the host element.
211
+ */
212
+ setupAttributes(): void;
213
+ /**
214
+ * Hook for extending behavior before disconnecting the component.
215
+ */
216
+ beforeDisconnect(): void;
217
+ /**
218
+ * Hook for extending behavior after disconnecting the component.
219
+ */
220
+ afterDisconnect(): void;
221
+ /**
222
+ * Hook for extending behavior before redrawing the component.
223
+ */
224
+ beforeRedraw(): void;
225
+ /**
226
+ * Cleans up resources and event listeners for the component.
227
+ */
228
+ componentCleanup(): void;
229
+ /**
230
+ * Lifecycle method invoked when the component is disconnected from the DOM.
231
+ */
232
+ disconnectedCallback(): void;
233
+ processCurrentRenderPromise(): Promise<void>;
234
+ /**
235
+ * Enqueues an update to the component.
236
+ * @returns A promise that resolves when the update is complete.
237
+ */
238
+ enqueueUpdate(): Promise<void>;
239
+ /**
240
+ * Lifecycle method invoked when an observed attribute changes.
241
+ * @param name The name of the attribute that changed.
242
+ * @param old The old value of the attribute.
243
+ * @param newName The new value of the attribute.
244
+ */
245
+ attributeChangedCallback(name: any, old: any, newName: any): void;
246
+ refresh(): void;
247
+ /**
248
+ * Refreshes the component by reinitializing it if it is in a drawing state.
249
+ * This method checks if the component's drawing status is at least in the START state.
250
+ * If so, it performs the following steps:
251
+ * 1. Calls the `beforeRedraw` hook if defined.
252
+ * 2. Calls the `beforeDisconnect` hook if defined.
253
+ * 3. Refreshes the update promise to manage the rendering lifecycle.
254
+ * 4. Calls the `afterDisconnect` hook if defined.
255
+ * 5. Reinitializes the component by calling `initWjElement` with `true` to force initialization.
256
+ * If the component is not in a drawing state, it simply returns a resolved promise.
257
+ * @returns {Promise<void>} A promise that resolves when the refresh is complete.
258
+ */
259
+ _refresh(): Promise<void>;
260
+ /**
261
+ * Displays the component's content, optionally forcing a re-render.
262
+ * @param [force] Whether to force a re-render.
263
+ * @returns A promise that resolves when the display is complete.
264
+ */
265
+ display(force?: boolean): Promise<any>;
266
+ template: any;
267
+ /**
268
+ * Renders the component's content.
269
+ */
270
+ render(): Promise<void>;
271
+ /**
272
+ * Sanitizes a given name by converting it from kebab-case to camelCase.
273
+ * @param {string} name The name in kebab-case format (e.g., "example-name").
274
+ * @returns {string} The sanitized name in camelCase format (e.g., "exampleName").
275
+ * @example
276
+ * // Returns 'exampleName'
277
+ * sanitizeName('example-name');
278
+ * @example
279
+ * // Returns 'myCustomComponent'
280
+ * sanitizeName('my-custom-component');
281
+ */
282
+ sanitizeName(name: string): string;
283
+ /**
284
+ * Checks if a property on an object has a getter or setter method defined.
285
+ * @param {object} obj The object on which the property is defined.
286
+ * @param {string} property The name of the property to check.
287
+ * @returns {object} An object indicating the presence of getter and setter methods.
288
+ * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.
289
+ * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.
290
+ * @example
291
+ * const obj = {
292
+ * get name() { return 'value'; },
293
+ * set name(val) { console.log(val); }
294
+ * };
295
+ * // Returns { hasGetter: [Function: get name], hasSetter: [Function: set name] }
296
+ * checkGetterSetter(obj, 'name');
297
+ * @example
298
+ * const obj = { prop: 42 };
299
+ * // Returns { hasGetter: null, hasSetter: null }
300
+ * checkGetterSetter(obj, 'prop');
301
+ */
302
+ checkGetterSetter(obj: object, property: string): object;
303
+ /**
304
+ * Sets up property accessors for the component's attributes.
305
+ */
306
+ setUpAccessors(): void;
307
+ /**
308
+ * Resolves the rendering process of the component.
309
+ * @returns A promise that resolves when rendering is complete.
310
+ * @private
311
+ */
312
+ private _resolveRender;
313
+ params: any;
314
+ }
315
+ export let __esModule: string;
316
+ export { WjePermissionsApi, WjElementUtils, event };
@@ -0,0 +1,18 @@
1
+ export class UniversalService {
2
+ constructor(props?: {});
3
+ _store: any;
4
+ findByKey: (attrName: any, key: any, keyValue: any) => any;
5
+ findById: (attrName: any, id: any) => any;
6
+ findAttributeValue: (attrName: any) => any;
7
+ update: (data: any, action: any) => void;
8
+ add: (data: any, action: any) => void;
9
+ _save(url: any, data: any, action: any, dispatchMethod: any, method: any): any;
10
+ _get(url: any, action: any, dispatchMethod: any, signal: any): any;
11
+ put(url: any, data: any, action: any, dispatchMethod?: boolean): any;
12
+ post(url: any, data: any, action: any, dispatchMethod?: boolean): any;
13
+ delete(url: any, data: any, action: any, dispatchMethod?: boolean): any;
14
+ get(url: any, action: any, dispatchMethod?: boolean): any;
15
+ dispatch(promise: any, dispatchMethod: any, action: any): any;
16
+ loadPromise: (url: any, action: any, method?: string, data?: string, permissionCallBack?: () => void) => Promise<any>;
17
+ loadOnePromise: (url: any, action: any) => Promise<any>;
18
+ }
@@ -0,0 +1,2 @@
1
+ import { default as FileUpload } from './file-upload.element.js';
2
+ export default FileUpload;
@@ -0,0 +1,191 @@
1
+ import { default as WJElement } from '../wje-element/element.js';
2
+ import { Localizer } from '../utils/localize.js';
3
+ /**
4
+ * @summary FileUpload is a custom web component for uploading files.
5
+ * It extends from WJElement and provides functionalities for file upload.
6
+ * @documentation https://elements.webjet.sk/components/file-upload
7
+ * @status stable
8
+ * @augments WJElement
9
+ * @slot - This is a default/unnamed slot.
10
+ * @csspart native - The native file upload part.
11
+ * @csspart file-list - The file list part.
12
+ * @csspart upload-button - The label part.
13
+ * @event change - Fires when the file input changes.
14
+ * @event drop - Fires when a file is dropped into the component.
15
+ * @attribute {string} accepted-types - The accepted file types for upload.
16
+ * @attribute {number} chunk-size - The chunk size for file upload.
17
+ * @attribute {number} max-file-size - The maximum file size for upload.
18
+ * @attribute {string} upload-url - The URL to set as the upload URL.
19
+ * @attribute {boolean} auto-process-files - The auto process files attribute.
20
+ * @attribute {boolean} no-upload-button - The no upload button attribute.
21
+ * @tag wje-file-upload
22
+ */
23
+ export default class FileUpload extends WJElement {
24
+ /**
25
+ * Getter for cssStyleSheet.
26
+ * @returns {string} The CSS styles for the component.
27
+ */
28
+ static get cssStyleSheet(): string;
29
+ /**
30
+ * Getter for observedAttributes.
31
+ * @returns {Array} An empty array as no attributes are observed.
32
+ */
33
+ static get observedAttributes(): any[];
34
+ localizer: Localizer;
35
+ _uploadedFiles: any[];
36
+ _queuedFiles: any[];
37
+ /**
38
+ * Dependencies for the FileUpload component.
39
+ * @type {object}
40
+ */
41
+ dependencies: object;
42
+ /**
43
+ * Setter for acceptedTypes attribute.
44
+ * @param {string} value The accepted file types for upload.
45
+ */
46
+ set acceptedTypes(value: string);
47
+ /**
48
+ * Getter for acceptedTypes attribute.
49
+ * @returns {string} The accepted file types for upload.
50
+ */
51
+ get acceptedTypes(): string;
52
+ /**
53
+ * Setter for chunkSize attribute.
54
+ * @param {number} value The chunk size for file upload.
55
+ */
56
+ set chunkSize(value: number);
57
+ /**
58
+ * Getter for chunkSize attribute.
59
+ * @returns {number} The chunk size for file upload.
60
+ */
61
+ get chunkSize(): number;
62
+ /**
63
+ * Setter for maxFileSize attribute.
64
+ * @param {number} value The maximum file size for upload.
65
+ */
66
+ set maxFileSize(value: number);
67
+ /**
68
+ * Getter for maxFileSize attribute.
69
+ * @returns {number} The maximum file size for upload.
70
+ */
71
+ get maxFileSize(): number;
72
+ /**
73
+ * Setter for label attribute.
74
+ * @param {string} value The URL to set as the upload URL.
75
+ */
76
+ set uploadUrl(value: string);
77
+ /**
78
+ * Gets the upload URL for the file upload element.
79
+ * @returns {string} The upload URL for the file upload element.
80
+ */
81
+ get uploadUrl(): string;
82
+ /**
83
+ * Sets the autoProcessFiles attribute.
84
+ * @param value
85
+ */
86
+ set autoProcessFiles(value: any);
87
+ /**
88
+ * Gets the autoProcessFiles attribute.
89
+ * @returns {any|boolean}
90
+ */
91
+ get autoProcessFiles(): any;
92
+ /**
93
+ * Sets the noUploadButton attribute.
94
+ * @param value
95
+ */
96
+ set noUploadButton(value: boolean);
97
+ /**
98
+ * Gets the noUploadButton attribute.
99
+ * @returns {boolean}
100
+ */
101
+ get noUploadButton(): boolean;
102
+ /**
103
+ * Sets the uploaded files.
104
+ * @param value
105
+ */
106
+ set uploadedFiles(value: []);
107
+ /**
108
+ * Return the uploaded files.
109
+ * @returns {[]}
110
+ */
111
+ get uploadedFiles(): [];
112
+ /**
113
+ * Sets the to-chunk attribute.
114
+ * @param value
115
+ */
116
+ set toChunk(value: boolean);
117
+ /**
118
+ * Gets the to-chunk attribute.
119
+ * @returns {boolean}
120
+ */
121
+ get toChunk(): boolean;
122
+ beforeDraw(): void;
123
+ uploadFunction: Function;
124
+ /**
125
+ * Method to draw the component on the screen.
126
+ * @returns {DocumentFragment} The fragment containing the component.
127
+ */
128
+ draw(): DocumentFragment;
129
+ button: HTMLElement;
130
+ native: HTMLDivElement;
131
+ fileList: HTMLSlotElement;
132
+ fileInput: HTMLInputElement;
133
+ /**
134
+ * Method to perform actions after the component is drawn.
135
+ */
136
+ afterDraw(): void;
137
+ /**
138
+ * Method to handle form submission.
139
+ * @param {Event} event The form submission event.
140
+ */
141
+ handleSubmit(event: Event): void;
142
+ /**
143
+ * Method to handle file drop event.
144
+ * @param {Event} event The file drop event object.
145
+ */
146
+ handleDrop: (event: Event) => void;
147
+ /**
148
+ * Method to handle file input change event.
149
+ * @param {Event} event The file input change event object.
150
+ */
151
+ handleInputChange: (event: Event) => void;
152
+ /**
153
+ * Method to add files to the queue.
154
+ * @param files
155
+ */
156
+ addFilesToQueue(files: any): void;
157
+ /**
158
+ * Method to upload files.
159
+ */
160
+ uploadFiles(): void;
161
+ /**
162
+ * Method to create an upload promise.
163
+ * @param file
164
+ * @returns {Promise<unknown>}
165
+ */
166
+ createUploadPromise: (file: any) => Promise<unknown>;
167
+ /**
168
+ * Method to create a preview for the file.
169
+ * @param {File} file The file for which the preview is to be created.
170
+ * @param {FileReader} reader The FileReader instance to read the file.
171
+ * @returns {HTMLElement} The created preview.
172
+ */
173
+ createPreview(file: File, reader: FileReader): HTMLElement;
174
+ /**
175
+ * Method to create a thumbnail for the file.
176
+ * @param {File} file The file for which the thumbnail is to be created.
177
+ * @param {FileReader} reader The FileReader instance to read the file.
178
+ * @returns {HTMLElement} The created thumbnail.
179
+ */
180
+ createThumbnail(file: File, reader: FileReader): HTMLElement;
181
+ /**
182
+ * Method to validate the files.
183
+ * @param {File} file The file to be validated.
184
+ * TODO: alowed types a size limit by malo byt cez attributy
185
+ */
186
+ assertFilesValid(file: File): void;
187
+ /**
188
+ * Method to reset the form state.
189
+ */
190
+ resetFormState(): void;
191
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Retrieves the icon name for a given file type.
3
+ * @param {string} type The file type or category (e.g., "pdf", "image", "folder").
4
+ * @returns {string} The name of the icon associated with the file type.
5
+ * @example
6
+ * getFileTypeIcon('pdf'); // Returns the icon name for PDF files.
7
+ * getFileTypeIcon('folder'); // Returns 'folder'.
8
+ */
9
+ export function getFileTypeIcon(type: string): string;
10
+ /**
11
+ * Checks if a given file matches any of the accepted file types.
12
+ * @param {File} file The file to validate.
13
+ * @param {string|string[]} acceptedFileTypes A comma-separated string or an array of accepted MIME types or file extensions.
14
+ * @returns {boolean} Returns `true` if the file type is valid, otherwise `false`.
15
+ * @throws {Error} Throws an error if `acceptedFileTypes` is empty.
16
+ * @example
17
+ * const file = new File([""], "example.png", { type: "image/png" });
18
+ * const isValid = isValidFileType(file, "image/*,application/pdf");
19
+ * console.log(isValid); // true
20
+ * @example
21
+ * const file = new File([""], "example.txt", { type: "text/plain" });
22
+ * const isValid = isValidFileType(file, ["text/plain", "application/json"]);
23
+ * console.log(isValid); // true
24
+ */
25
+ export function isValidFileType(file: File, acceptedFileTypes: string | string[]): boolean;
26
+ /**
27
+ * Uploads a file in chunks using `XMLHttpRequest`, allowing for progress tracking.
28
+ * @param {File} file The file to be uploaded.
29
+ * @param {number} chunkSize The size of each chunk in bytes.
30
+ * @param {HTMLElement} preview The element used to display upload progress.
31
+ */
32
+ export function uploadFile(file: File, chunkSize: number, preview: HTMLElement): void;
33
+ /**
34
+ * Returns a function for uploading files either in chunks or as a whole file, based on the provided options.
35
+ * @param {string} url The URL to which the file will be uploaded.
36
+ * @param {number} [chunkSize] The size of each chunk in bytes when uploading in chunks (default is 1MB).
37
+ * @param {boolean} [wholeFile] Whether to upload the file as a whole. If `true`, the entire file is uploaded at once.
38
+ * @returns {Function} A function that takes a file and a preview element as arguments and uploads the file.
39
+ * @example
40
+ * // Upload a file in chunks
41
+ * const uploadInChunks = upload('/upload', 1024 * 512); // 512KB chunks
42
+ * uploadInChunks(file, previewElement);
43
+ * @example
44
+ * // Upload a whole file
45
+ * const uploadWhole = upload('/upload', undefined, true);
46
+ * uploadWhole(file, previewElement);
47
+ */
48
+ export function upload(url: string, chunkSize?: number, wholeFile?: boolean): Function;
49
+ /**
50
+ * Uploads a file in chunks to a specified URL, allowing for progress tracking and resuming in case of errors.
51
+ * @param {string} url The URL to which the file chunks will be uploaded.
52
+ * @param {File} file The file to be uploaded in chunks.
53
+ * @param {HTMLElement} preview The element used to display upload progress.
54
+ * @param {number} [chunkSize] The size of each chunk in bytes (default is 1MB).
55
+ * @returns {Promise<object>} Resolves with the response of the last chunk uploaded, parsed as JSON.
56
+ * @throws {Error} - Throws an error if a chunk fails to upload.
57
+ */
58
+ export function uploadFileInChunks(url: string, file: File, preview: HTMLElement, chunkSize?: number): Promise<object>;
59
+ /**
60
+ * Uploads a file to a specified URL using a `POST` request and updates the preview element with the uploaded file size.
61
+ * @param {string} url The URL to which the file will be uploaded.
62
+ * @param {File} file The file to be uploaded.
63
+ * @param {HTMLElement} preview The element that displays the upload preview. It will be updated with the file size.
64
+ * @returns {Promise<{data: object, file: File}>} - A promise that resolves with the server response and the uploaded file.
65
+ * @throws {Error} - Logs an error to the console if the request fails.
66
+ */
67
+ export function uploadWholeFile(url: string, file: File, preview: HTMLElement): Promise<{
68
+ data: object;
69
+ file: File;
70
+ }>;
@@ -0,0 +1,2 @@
1
+ import { default as FileUploadItem } from './file-upload-item.element.js';
2
+ export default FileUploadItem;
@@ -0,0 +1,66 @@
1
+ import { default as WJElement } from '../wje-element/element.js';
2
+ import { Localizer } from '../utils/localize.js';
3
+ /**
4
+ * @summary This element allows users to upload files.
5
+ * `FileUploadItem` is a custom web component that represents a file upload item.
6
+ * It extends from `WJElement` and uses the `Localizer` utility for localization.
7
+ * @documentation https://elements.webjet.sk/components/file-upload
8
+ * @status stable
9
+ * @augments WJElement
10
+ * @csspart button - The delete button part
11
+ * @csspart image - The image part
12
+ * @csspart name - The name part
13
+ * @csspart size - The size part
14
+ * @slot img - Slot for the image
15
+ * @slot action - Slot for the action buttons
16
+ * @cssproperty --primary-color - The primary color of the file upload item.
17
+ * //@fires wje-button:click - Dispatches when the delete button is clicked
18
+ * @tag wje-file-upload
19
+ */
20
+ export default class FileUploadItem 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(): string[];
33
+ localizer: Localizer;
34
+ set size(value: string);
35
+ get size(): string;
36
+ /**
37
+ * Dependencies for the component.
38
+ * @type {object}
39
+ */
40
+ dependencies: object;
41
+ /**
42
+ * Handles updates to the attributes of a custom element whenever one of the observed attributes is changed.
43
+ * Updates the related elements based on the changed attribute and its new value.
44
+ * @param {string} name The name of the attribute being changed.
45
+ * @param {string | null} oldValue The previous value of the attribute before the change, or null if the attribute was not previously set.
46
+ * @param {string | null} newValue The new value of the attribute after the change, or null if the attribute is being removed.
47
+ * @returns {void} Does not return a value.
48
+ */
49
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
50
+ /**
51
+ * Method to draw the component on the screen.
52
+ * @returns {DocumentFragment} The fragment containing the component.
53
+ */
54
+ draw(): DocumentFragment;
55
+ button: HTMLElement;
56
+ uploadedEl: HTMLElement;
57
+ sliderEl: HTMLElement;
58
+ /**
59
+ * Called after the component has been drawn.
60
+ */
61
+ afterDraw(): void;
62
+ /**
63
+ * Handles the delete action.
64
+ */
65
+ onDelete: () => void;
66
+ }
@@ -0,0 +1,2 @@
1
+ import { default as Footer } from './footer.element.js';
2
+ export default Footer;