wj-elements 0.2.0-alpha.4 → 0.2.0-alpha.5

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 (243) hide show
  1. package/dist/packages/wje-sliding-container/sliding-container.element.d.ts +2 -2
  2. package/dist/wje-file-upload.js +1 -0
  3. package/dist/wje-file-upload.js.map +1 -1
  4. package/package.json +1 -1
  5. package/dist/index.d.ts +0 -107
  6. package/dist/internals/form-associated-element.d.ts +0 -143
  7. package/dist/localize/localize.d.ts +0 -48
  8. package/dist/translations/en-gb.d.ts +0 -18
  9. package/dist/translations/sk-sk.d.ts +0 -13
  10. package/dist/utils/animations.d.ts +0 -2
  11. package/dist/utils/base-path.d.ts +0 -14
  12. package/dist/utils/date.d.ts +0 -2
  13. package/dist/utils/element-utils.d.ts +0 -46
  14. package/dist/utils/event.d.ts +0 -67
  15. package/dist/utils/icon-library.d.ts +0 -3
  16. package/dist/utils/localize.d.ts +0 -4
  17. package/dist/utils/permissions.d.ts +0 -40
  18. package/dist/utils/universal-service.d.ts +0 -18
  19. package/dist/utils/utils.d.ts +0 -1
  20. package/dist/wje-accordion/accordion.d.ts +0 -2
  21. package/dist/wje-accordion/accordion.element.d.ts +0 -72
  22. package/dist/wje-accordion/accordion.test.d.ts +0 -0
  23. package/dist/wje-accordion-item/accordion-item.d.ts +0 -2
  24. package/dist/wje-accordion-item/accordion-item.element.d.ts +0 -40
  25. package/dist/wje-animation/animation.d.ts +0 -2
  26. package/dist/wje-animation/animation.element.d.ts +0 -158
  27. package/dist/wje-aside/aside.d.ts +0 -2
  28. package/dist/wje-aside/aside.element.d.ts +0 -31
  29. package/dist/wje-avatar/avatar.d.ts +0 -2
  30. package/dist/wje-avatar/avatar.element.d.ts +0 -76
  31. package/dist/wje-avatar/avatar.test.d.ts +0 -1
  32. package/dist/wje-avatar/service/service.d.ts +0 -52
  33. package/dist/wje-badge/badge.d.ts +0 -2
  34. package/dist/wje-badge/badge.element.d.ts +0 -35
  35. package/dist/wje-badge/badge.test.d.ts +0 -1
  36. package/dist/wje-breadcrumb/breadcrumb.d.ts +0 -2
  37. package/dist/wje-breadcrumb/breadcrumb.element.d.ts +0 -98
  38. package/dist/wje-breadcrumbs/breadcrumbs.d.ts +0 -2
  39. package/dist/wje-breadcrumbs/breadcrumbs.element.d.ts +0 -105
  40. package/dist/wje-breadcrumbs/breadcrumbs.test.d.ts +0 -1
  41. package/dist/wje-button/button.d.ts +0 -2
  42. package/dist/wje-button/button.element.d.ts +0 -204
  43. package/dist/wje-button/button.test.d.ts +0 -1
  44. package/dist/wje-button-group/button-group.d.ts +0 -2
  45. package/dist/wje-button-group/button-group.element.d.ts +0 -96
  46. package/dist/wje-card/card.d.ts +0 -2
  47. package/dist/wje-card/card.element.d.ts +0 -31
  48. package/dist/wje-card-content/card-content.d.ts +0 -2
  49. package/dist/wje-card-content/card-content.element.d.ts +0 -22
  50. package/dist/wje-card-controls/card-controls.d.ts +0 -2
  51. package/dist/wje-card-controls/card-controls.element.d.ts +0 -23
  52. package/dist/wje-card-header/card-header.d.ts +0 -2
  53. package/dist/wje-card-header/card-header.element.d.ts +0 -22
  54. package/dist/wje-card-subtitle/card-subtitle.d.ts +0 -2
  55. package/dist/wje-card-subtitle/card-subtitle.element.d.ts +0 -30
  56. package/dist/wje-card-title/card-title.d.ts +0 -2
  57. package/dist/wje-card-title/card-title.element.d.ts +0 -32
  58. package/dist/wje-carousel/carousel.d.ts +0 -2
  59. package/dist/wje-carousel/carousel.element.d.ts +0 -154
  60. package/dist/wje-carousel-item/carousel-item.d.ts +0 -2
  61. package/dist/wje-carousel-item/carousel-item.element.d.ts +0 -38
  62. package/dist/wje-checkbox/checkbox.d.ts +0 -2
  63. package/dist/wje-checkbox/checkbox.element.d.ts +0 -100
  64. package/dist/wje-chip/chip.d.ts +0 -2
  65. package/dist/wje-chip/chip.element.d.ts +0 -76
  66. package/dist/wje-chip/chip.test.d.ts +0 -1
  67. package/dist/wje-col/col.d.ts +0 -2
  68. package/dist/wje-col/col.element.d.ts +0 -16
  69. package/dist/wje-color-picker/color-picker.d.ts +0 -2
  70. package/dist/wje-color-picker/color-picker.element.d.ts +0 -230
  71. package/dist/wje-color-picker/color-picker.test.d.ts +0 -1
  72. package/dist/wje-container/container.d.ts +0 -2
  73. package/dist/wje-container/container.element.d.ts +0 -31
  74. package/dist/wje-copy-button/copy-button.d.ts +0 -2
  75. package/dist/wje-copy-button/copy-button.element.d.ts +0 -89
  76. package/dist/wje-copy-button/service/service.d.ts +0 -12
  77. package/dist/wje-dialog/dialog.d.ts +0 -2
  78. package/dist/wje-dialog/dialog.element.d.ts +0 -132
  79. package/dist/wje-divider/divider.d.ts +0 -2
  80. package/dist/wje-divider/divider.element.d.ts +0 -32
  81. package/dist/wje-dropdown/dropdown.d.ts +0 -2
  82. package/dist/wje-dropdown/dropdown.element.d.ts +0 -108
  83. package/dist/wje-element/element.d.ts +0 -341
  84. package/dist/wje-file-upload/file-upload.d.ts +0 -2
  85. package/dist/wje-file-upload/file-upload.element.d.ts +0 -191
  86. package/dist/wje-file-upload/service/service.d.ts +0 -70
  87. package/dist/wje-file-upload-item/file-upload-item.d.ts +0 -2
  88. package/dist/wje-file-upload-item/file-upload-item.element.d.ts +0 -68
  89. package/dist/wje-footer/footer.d.ts +0 -2
  90. package/dist/wje-footer/footer.element.d.ts +0 -28
  91. package/dist/wje-form/form.d.ts +0 -2
  92. package/dist/wje-form/form.element.d.ts +0 -28
  93. package/dist/wje-format-digital/format-digital.d.ts +0 -2
  94. package/dist/wje-format-digital/format-digital.element.d.ts +0 -83
  95. package/dist/wje-format-digital/format-digital.test.d.ts +0 -1
  96. package/dist/wje-grid/grid.d.ts +0 -2
  97. package/dist/wje-grid/grid.element.d.ts +0 -26
  98. package/dist/wje-header/header.d.ts +0 -2
  99. package/dist/wje-header/header.element.d.ts +0 -35
  100. package/dist/wje-icon/icon.d.ts +0 -2
  101. package/dist/wje-icon/icon.element.d.ts +0 -40
  102. package/dist/wje-icon/service/library.d.ts +0 -3
  103. package/dist/wje-icon/service/service.d.ts +0 -11
  104. package/dist/wje-icon-picker/icon-picker.d.ts +0 -2
  105. package/dist/wje-icon-picker/icon-picker.element.d.ts +0 -210
  106. package/dist/wje-img/img.d.ts +0 -2
  107. package/dist/wje-img/img.element.d.ts +0 -118
  108. package/dist/wje-img-comparer/img-comparer.d.ts +0 -2
  109. package/dist/wje-img-comparer/img-comparer.element.d.ts +0 -60
  110. package/dist/wje-img-comparer/service/service.d.ts +0 -1
  111. package/dist/wje-infinite-scroll/infinite-scroll.d.ts +0 -2
  112. package/dist/wje-infinite-scroll/infinite-scroll.element.d.ts +0 -173
  113. package/dist/wje-input/input.d.ts +0 -2
  114. package/dist/wje-input/input.element.d.ts +0 -159
  115. package/dist/wje-input-file/input-file.d.ts +0 -2
  116. package/dist/wje-input-file/input-file.element.d.ts +0 -50
  117. package/dist/wje-item/item.d.ts +0 -2
  118. package/dist/wje-item/item.element.d.ts +0 -68
  119. package/dist/wje-kanban/kanban.d.ts +0 -2
  120. package/dist/wje-kanban/kanban.element.d.ts +0 -182
  121. package/dist/wje-label/label.d.ts +0 -2
  122. package/dist/wje-label/label.element.d.ts +0 -34
  123. package/dist/wje-level-indicator/level-indicator.d.ts +0 -2
  124. package/dist/wje-level-indicator/level-indicator.element.d.ts +0 -91
  125. package/dist/wje-list/list.d.ts +0 -2
  126. package/dist/wje-list/list.element.d.ts +0 -31
  127. package/dist/wje-main/main.d.ts +0 -2
  128. package/dist/wje-main/main.element.d.ts +0 -30
  129. package/dist/wje-masonry/masonry.d.ts +0 -2
  130. package/dist/wje-masonry/masonry.element.d.ts +0 -114
  131. package/dist/wje-masonry/service/service.d.ts +0 -32
  132. package/dist/wje-menu/menu.d.ts +0 -2
  133. package/dist/wje-menu/menu.element.d.ts +0 -47
  134. package/dist/wje-menu-button/menu-button.d.ts +0 -2
  135. package/dist/wje-menu-button/menu-button.element.d.ts +0 -34
  136. package/dist/wje-menu-item/menu-item.d.ts +0 -2
  137. package/dist/wje-menu-item/menu-item.element.d.ts +0 -161
  138. package/dist/wje-menu-label/menu-label.d.ts +0 -2
  139. package/dist/wje-menu-label/menu-label.element.d.ts +0 -39
  140. package/dist/wje-option/option.d.ts +0 -2
  141. package/dist/wje-option/option.element.d.ts +0 -95
  142. package/dist/wje-options/options.d.ts +0 -2
  143. package/dist/wje-options/options.element.d.ts +0 -232
  144. package/dist/wje-orgchart/orgchart.d.ts +0 -2
  145. package/dist/wje-orgchart/orgchart.element.d.ts +0 -24
  146. package/dist/wje-orgchart-group/orgchart-group.d.ts +0 -2
  147. package/dist/wje-orgchart-group/orgchart-group.element.d.ts +0 -28
  148. package/dist/wje-orgchart-item/orgchart-item.d.ts +0 -2
  149. package/dist/wje-orgchart-item/orgchart-item.element.d.ts +0 -49
  150. package/dist/wje-pagination/pagination.d.ts +0 -2
  151. package/dist/wje-pagination/pagination.element.d.ts +0 -178
  152. package/dist/wje-pagination/pagination.test.d.ts +0 -1
  153. package/dist/wje-pagination/service/service.d.ts +0 -9
  154. package/dist/wje-panel/panel.d.ts +0 -2
  155. package/dist/wje-panel/panel.element.d.ts +0 -34
  156. package/dist/wje-popup/popup.d.ts +0 -2
  157. package/dist/wje-popup/popup.element.d.ts +0 -145
  158. package/dist/wje-progress-bar/progress-bar.d.ts +0 -2
  159. package/dist/wje-progress-bar/progress-bar.element.d.ts +0 -96
  160. package/dist/wje-qr-code/qr-code.d.ts +0 -2
  161. package/dist/wje-qr-code/qr-code.element.d.ts +0 -33
  162. package/dist/wje-radio/radio.d.ts +0 -2
  163. package/dist/wje-radio/radio.element.d.ts +0 -64
  164. package/dist/wje-radio-group/radio-group.d.ts +0 -2
  165. package/dist/wje-radio-group/radio-group.element.d.ts +0 -61
  166. package/dist/wje-rate/rate.d.ts +0 -2
  167. package/dist/wje-rate/rate.element.d.ts +0 -156
  168. package/dist/wje-relative-time/relative-time.d.ts +0 -2
  169. package/dist/wje-relative-time/relative-time.element.d.ts +0 -55
  170. package/dist/wje-relative-time/relative-time.test.d.ts +0 -1
  171. package/dist/wje-reorder/reorder.d.ts +0 -2
  172. package/dist/wje-reorder/reorder.element.d.ts +0 -119
  173. package/dist/wje-reorder-dropzone/reorder-dropzone.d.ts +0 -2
  174. package/dist/wje-reorder-dropzone/reorder-dropzone.element.d.ts +0 -23
  175. package/dist/wje-reorder-handle/reorder-handle.d.ts +0 -2
  176. package/dist/wje-reorder-handle/reorder-handle.element.d.ts +0 -84
  177. package/dist/wje-reorder-item/reorder-item.d.ts +0 -2
  178. package/dist/wje-reorder-item/reorder-item.element.d.ts +0 -24
  179. package/dist/wje-route/route.d.ts +0 -2
  180. package/dist/wje-route/route.element.d.ts +0 -22
  181. package/dist/wje-router/router.d.ts +0 -2
  182. package/dist/wje-router/router.element.d.ts +0 -43
  183. package/dist/wje-router-link/router-link.d.ts +0 -2
  184. package/dist/wje-router-link/router-link.element.d.ts +0 -31
  185. package/dist/wje-router-outlet/router-outlet.d.ts +0 -2
  186. package/dist/wje-router-outlet/router-outlet.element.d.ts +0 -16
  187. package/dist/wje-row/row.d.ts +0 -2
  188. package/dist/wje-row/row.element.d.ts +0 -23
  189. package/dist/wje-select/select.d.ts +0 -2
  190. package/dist/wje-select/select.element.d.ts +0 -386
  191. package/dist/wje-select/select.test.d.ts +0 -1
  192. package/dist/wje-slider/slider.d.ts +0 -2
  193. package/dist/wje-slider/slider.element.d.ts +0 -103
  194. package/dist/wje-sliding-container/sliding-container.d.ts +0 -2
  195. package/dist/wje-sliding-container/sliding-container.element.d.ts +0 -265
  196. package/dist/wje-split-view/service/service.d.ts +0 -1
  197. package/dist/wje-split-view/split-view.d.ts +0 -2
  198. package/dist/wje-split-view/split-view.element.d.ts +0 -65
  199. package/dist/wje-status/status.d.ts +0 -2
  200. package/dist/wje-status/status.element.d.ts +0 -26
  201. package/dist/wje-step/step.d.ts +0 -2
  202. package/dist/wje-step/step.element.d.ts +0 -23
  203. package/dist/wje-stepper/stepper.d.ts +0 -2
  204. package/dist/wje-stepper/stepper.element.d.ts +0 -125
  205. package/dist/wje-store/default-store-actions.d.ts +0 -25
  206. package/dist/wje-store/pubsub.d.ts +0 -22
  207. package/dist/wje-store/store.d.ts +0 -153
  208. package/dist/wje-tab/tab.d.ts +0 -2
  209. package/dist/wje-tab/tab.element.d.ts +0 -66
  210. package/dist/wje-tab-group/tab-group.d.ts +0 -2
  211. package/dist/wje-tab-group/tab-group.element.d.ts +0 -131
  212. package/dist/wje-tab-group/tab-group.test.d.ts +0 -1
  213. package/dist/wje-tab-panel/tab-panel.d.ts +0 -2
  214. package/dist/wje-tab-panel/tab-panel.element.d.ts +0 -23
  215. package/dist/wje-textarea/textarea.d.ts +0 -2
  216. package/dist/wje-textarea/textarea.element.d.ts +0 -89
  217. package/dist/wje-thumbnail/thumbnail.d.ts +0 -2
  218. package/dist/wje-thumbnail/thumbnail.element.d.ts +0 -31
  219. package/dist/wje-timeline/timeline.d.ts +0 -2
  220. package/dist/wje-timeline/timeline.element.d.ts +0 -25
  221. package/dist/wje-timeline-item/timeline-item.d.ts +0 -2
  222. package/dist/wje-timeline-item/timeline-item.element.d.ts +0 -27
  223. package/dist/wje-toast/toast.d.ts +0 -2
  224. package/dist/wje-toast/toast.element.d.ts +0 -173
  225. package/dist/wje-toast/toast.test.d.ts +0 -1
  226. package/dist/wje-toggle/toggle.d.ts +0 -2
  227. package/dist/wje-toggle/toggle.element.d.ts +0 -81
  228. package/dist/wje-toggle/toggle.test.d.ts +0 -1
  229. package/dist/wje-toolbar/toolbar.d.ts +0 -2
  230. package/dist/wje-toolbar/toolbar.element.d.ts +0 -39
  231. package/dist/wje-toolbar-action/toolbar-action.d.ts +0 -2
  232. package/dist/wje-toolbar-action/toolbar-action.element.d.ts +0 -35
  233. package/dist/wje-tooltip/tooltip.d.ts +0 -2
  234. package/dist/wje-tooltip/tooltip.element.d.ts +0 -77
  235. package/dist/wje-tree/tree.d.ts +0 -2
  236. package/dist/wje-tree/tree.element.d.ts +0 -105
  237. package/dist/wje-tree/tree.test.d.ts +0 -1
  238. package/dist/wje-tree-item/tree-item.d.ts +0 -2
  239. package/dist/wje-tree-item/tree-item.element.d.ts +0 -155
  240. package/dist/wje-tree-item/tree-item.test.d.ts +0 -1
  241. package/dist/wje-visually-hidden/visually-hidden.d.ts +0 -2
  242. package/dist/wje-visually-hidden/visually-hidden.element.d.ts +0 -29
  243. /package/dist/{wje-animation/animation.test.d.ts → packages/wje-file-upload/file-upload.test.d.ts} +0 -0
@@ -1,341 +0,0 @@
1
- import { UniversalService } from '../utils/universal-service.js';
2
- import { defaultStoreActions } from '../wje-store/store.js';
3
- import { Permissions } from '../utils/permissions.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
- service: UniversalService;
22
- _dependencies: {};
23
- /**
24
- * @typedef {object} DrawingStatuses
25
- * @property {number} CREATED - The component has been created.
26
- * @property {number} ATTACHED - The component has been attached to the DOM.
27
- * @property {number} BEGINING - The component is beginning to draw.
28
- * @property {number} START - The component has started drawing.
29
- * @property {number} DRAWING - The component is drawing.
30
- * @property {number} DONE - The component has finished drawing.
31
- * @property {number} DISCONNECTED - The component has been disconnected from the DOM.
32
- */
33
- /**
34
- * WJElement is a base class for custom web components with managed lifecycle, attribute/property sync,
35
- * permission-based visibility, and extensibility hooks.
36
- * @property {boolean} isAttached - True if the component is currently attached to the DOM.
37
- * @property {DrawingStatuses} drawingStatuses - Enum of possible drawing states.
38
- * @property {number} drawingStatus - Current drawing status (see drawingStatuses).
39
- * @property {boolean} _pristine - True if the component has not been updated since last render.
40
- * @property {boolean} isRendering - True if a render is currently in progress.
41
- * @property {number|null} rafId - ID of the scheduled animation frame for rendering, or null.
42
- * @property {string|null} originalVisibility - Stores the original CSS visibility before rendering.
43
- * @property {object} params - Stores the current attributes/properties for rendering.
44
- * @property {Promise<void>} updateComplete - Promise resolved when the current update/render is complete.
45
- * @property {string[]} permission - List of required permissions (from 'permission' attribute).
46
- * @property {boolean} isPermissionCheck - Whether permission checking is enabled (from 'permission-check' attribute).
47
- * @property {boolean} noShow - Whether the element should be hidden (from 'no-show' attribute).
48
- * @property {string|undefined} isShadowRoot - Value of the 'shadow' attribute, if present.
49
- * @property {boolean} hasShadowRoot - True if the 'shadow' attribute is present.
50
- * @property {string} shadowType - Type of shadow root ('open' by default).
51
- * @property {object} store - Reference to the global store instance.
52
- * @property {object} defaultStoreActions - Default store actions for arrays and objects.
53
- * @property {string[]|undefined} removeClassAfterConnect - Classes to remove after connect (from 'remove-class-after-connect' attribute).
54
- * @property {object} dependencies - Registered component dependencies.
55
- * @property {HTMLElement|ShadowRoot} context - The rendering context (shadow root or element itself).
56
- */
57
- drawingStatuses: {
58
- CREATED: number;
59
- ATTACHED: number;
60
- BEGINING: number;
61
- START: number;
62
- DRAWING: number;
63
- DONE: number;
64
- DISCONNECTED: number;
65
- };
66
- rafId: number;
67
- params: {};
68
- updateComplete: Promise<any>;
69
- finisPromise: (value: any) => void;
70
- rejectPromise: (reason?: any) => void;
71
- get drawingStatus(): number;
72
- /**
73
- * Sets the value of the 'permission' attribute.
74
- * @param {string[]} value The value to set for the 'permission' attribute.
75
- */
76
- set permission(value: string[]);
77
- /**
78
- * Gets the value of the 'permission-check' attribute.
79
- * @returns {string[]} The value of the 'permission' attribute.
80
- */
81
- get permission(): string[];
82
- /**
83
- * Sets the 'permission-check' attribute.
84
- * @param {boolean} value The value to set for the 'permission-check' attribute.
85
- */
86
- set isPermissionCheck(value: boolean);
87
- /**
88
- * Checks if the 'permission-check' attribute is present.
89
- * @returns {boolean} True if the 'permission-check' attribute is present.
90
- */
91
- get isPermissionCheck(): boolean;
92
- set noShow(value: boolean);
93
- /**
94
- * Checks if the 'show' attribute is present.
95
- * @returns {boolean} True if the 'show' attribute is present.
96
- */
97
- get noShow(): boolean;
98
- /**
99
- * Sets the 'shadow' attribute.
100
- * @param {string} value The value to set for the 'shadow' attribute.
101
- */
102
- set isShadowRoot(value: string);
103
- get isShadowRoot(): string;
104
- /**
105
- * Checks if the 'shadow' attribute is present.
106
- * @returns {boolean} True if the 'shadow' attribute is present.
107
- */
108
- get hasShadowRoot(): boolean;
109
- /**
110
- * Gets the value of the 'shadow' attribute or 'open' if not set.
111
- * @returns {string} The value of the 'shadow' attribute or 'open'.
112
- */
113
- get shadowType(): string;
114
- /**
115
- * Gets the rendering context, either the shadow root or the component itself.
116
- * @returns The rendering context.
117
- */
118
- get context(): any;
119
- /**
120
- * Gets the store instance.
121
- * @returns {object} The store instance.
122
- */
123
- get store(): object;
124
- /**
125
- * @typedef {object} ArrayActions
126
- * @property {Function} addAction - Adds an item to the array.
127
- * @property {Function} deleteAction - Deletes an item from the array.
128
- * @property {Function} loadAction - Loads an array.
129
- * @property {Function} updateAction - Updates an item in the array.
130
- * @property {Function} addManyAction - Adds many items to the array.
131
- */
132
- /**
133
- * @typedef {object} ObjectActions
134
- * @property {Function} addAction - Replace old object with new object
135
- * @property {Function} deleteAction - Delete item based on key
136
- * @property {Function} updateAction - Update item based on key
137
- */
138
- /**
139
- * Gets the default store actions.
140
- * @returns The default store actions for arrays and objects.
141
- */
142
- get defaultStoreActions(): typeof defaultStoreActions;
143
- /**
144
- * Gets the classes to be removed after the component is connected.
145
- * @returns An array of class names to remove.
146
- */
147
- get removeClassAfterConnect(): string[];
148
- /**
149
- * Sets the component dependencies.
150
- * @param value The dependencies to set.
151
- */
152
- set dependencies(value: {});
153
- /**
154
- * Gets the component dependencies.
155
- * @returns The component dependencies.
156
- */
157
- get dependencies(): {};
158
- /**
159
- * Defines component dependencies by registering custom elements.
160
- */
161
- defineDependencies(): void;
162
- /**
163
- * Hook for extending behavior before drawing the component.
164
- * @param context The rendering context, usually the element's shadow root or main DOM element.
165
- * @param appStoreObj The global application store for managing state.
166
- * @param params Additional parameters or attributes for rendering the component.
167
- */
168
- beforeDraw(context: any, appStoreObj: any, params: any): void;
169
- /**
170
- * Renders the component within the provided context.
171
- * @param context The rendering context, usually the element's shadow root or main DOM element.
172
- * @param appStoreObj
173
- * @param params Additional parameters or attributes for rendering the component.
174
- * @returns This implementation does not render anything and returns `null`.
175
- * @description
176
- * The `draw` method is responsible for rendering the component's content.
177
- * Override this method in subclasses to define custom rendering logic.
178
- * @example
179
- * class MyComponent extends WJElement {
180
- * draw(context, appStoreObj, params) {
181
- * const div = document.createElement('div');
182
- * div.textContent = 'Hello, world!';
183
- * context.appendChild(div);
184
- * }
185
- * }
186
- */
187
- draw(context: any, appStoreObj: any, params: any): any;
188
- /**
189
- * Renders the component within the provided context.
190
- * @param context The rendering context, usually the element's shadow root or main DOM element.
191
- * @param appStore The global application store for managing state.
192
- * @param params Additional parameters or attributes for rendering the component.
193
- * @returns This implementation does not render anything and returns `null`.
194
- * @description
195
- * The `draw` method is responsible for rendering the component's content.
196
- * Override this method in subclasses to define custom rendering logic.
197
- * @example
198
- * class MyComponent extends WJElement {
199
- * draw(context, appStore, params) {
200
- * const div = document.createElement('div');
201
- * div.textContent = 'Hello, world!';
202
- * context.appendChild(div);
203
- * }
204
- * }
205
- */
206
- draw(context: any, appStore: any, params: any): any;
207
- /**
208
- * Hook for extending behavior after drawing the component.
209
- * @param context The rendering context, usually the element's shadow root or main DOM element.
210
- * @param appStoreObj The global application store for managing state.
211
- * @param params Additional parameters or attributes for rendering the component.
212
- */
213
- afterDraw(context: any, appStoreObj: any, params: any): void;
214
- /**
215
- * Optional hook: return skeleton markup used while async draw is in progress.
216
- * Prefer declarative skeleton via `<div slot="skeleton">...</div>`.
217
- * Return: string | Node | DocumentFragment | null | Promise of those.
218
- */
219
- renderSkeleton(params: any): any;
220
- set skeletonDelay(value: number);
221
- /**
222
- * Retrieves the delay duration for the skeleton display, determining the value based on a hierarchy of overrides and defaults.
223
- * The method prioritizes in the following order:
224
- * 1. A finite number set as the `_wjSkeletonSlotClone` property.
225
- * 2. A valid numeric value from the `skeleton-delay` attribute.
226
- * 3. The `skeletonDelayMs` property, if defined with a finite number.
227
- * 4. A default value of 150 if none of the above are set.
228
- * @returns {number} The delay in milliseconds before the skeleton is displayed.
229
- */
230
- get skeletonDelay(): number;
231
- set skeletonMinDuration(value: number);
232
- /**
233
- * Retrieves the minimum duration for the skeleton animation.
234
- * The method checks for an internally stored finite value. If unavailable,
235
- * it retrieves the value from the 'skeleton-min-duration' attribute,
236
- * converts it to a number if possible, and uses it. If neither is valid,
237
- * a default duration of 300 is returned.
238
- * @returns {number} The minimum duration for the skeleton animation in milliseconds.
239
- */
240
- get skeletonMinDuration(): number;
241
- _wjSkeletonSlotClone: number | Node;
242
- set skeleton(value: boolean);
243
- get skeleton(): boolean;
244
- get skeletonDelayValue(): number;
245
- /**
246
- * Lifecycle method invoked when the component is connected to the DOM.
247
- */
248
- connectedCallback(): void;
249
- /**
250
- * Initializes the component, setting up attributes and rendering.
251
- * @param [force] Whether to force initialization.
252
- * @returns A promise that resolves when initialization is complete.
253
- */
254
- initWjElement: (force?: boolean) => Promise<any>;
255
- /**
256
- * Sets up attributes and event listeners for the component.
257
- * This method retrieves all custom events defined for the component
258
- * and adds event listeners for each of them. When an event is triggered,
259
- * it calls the corresponding method on the host element.
260
- */
261
- setupAttributes(): void;
262
- /**
263
- * Hook for extending behavior before disconnecting the component.
264
- */
265
- beforeDisconnect(): void;
266
- /**
267
- * Hook for extending behavior after disconnecting the component.
268
- */
269
- afterDisconnect(): void;
270
- /**
271
- * Hook for extending behavior before redrawing the component.
272
- */
273
- beforeRedraw(): void;
274
- /**
275
- * Cleans up resources and event listeners for the component.
276
- */
277
- componentCleanup(): void;
278
- /**
279
- * Lifecycle method invoked when the component is disconnected from the DOM.
280
- */
281
- disconnectedCallback(): void;
282
- /**
283
- * Lifecycle method invoked when an observed attribute changes.
284
- * @param name The name of the attribute that changed.
285
- * @param old The old value of the attribute.
286
- * @param newName The new value of the attribute.
287
- */
288
- attributeChangedCallback(name: any, old: any, newName: any): void;
289
- refresh(): void;
290
- stopRenderLoop(): void;
291
- /**
292
- * Displays the component's content, optionally forcing a re-render.
293
- * @param [force] Whether to force a re-render.
294
- * @returns A promise that resolves when the display is complete.
295
- */
296
- display(force?: boolean): Promise<void>;
297
- template: any;
298
- /**
299
- * Renders the content into the provided target context.
300
- * This method handles asynchronous rendering, processes the output from the `draw` method,
301
- * and appends the resulting content to the specified target context.
302
- * @returns {Promise<void>} A promise that resolves once the render operation is complete and the content is appended to the target context.
303
- * @param targetContext
304
- */
305
- render(targetContext?: any): Promise<void>;
306
- /**
307
- * Sanitizes a given name by converting it from kebab-case to camelCase.
308
- * @param {string} name The name in kebab-case format (e.g., "example-name").
309
- * @returns {string} The sanitized name in camelCase format (e.g., "exampleName").
310
- * @example
311
- * sanitizeName('example-name');
312
- * @example
313
- * sanitizeName('my-custom-component');
314
- */
315
- sanitizeName(name: string): string;
316
- /**
317
- * Checks if a property on an object has a getter or setter method defined.
318
- * @param {object} obj The object on which the property is defined.
319
- * @param {string} property The name of the property to check.
320
- * @returns {object} An object indicating the presence of getter and setter methods.
321
- * @property {Function|null} hasGetter The getter function if it exists, otherwise `null`.
322
- * @property {Function|null} hasSetter The setter function if it exists, otherwise `null`.
323
- * @example
324
- * const obj = {
325
- * get name() { return 'value'; },
326
- * set name(val) { console.log(val); }
327
- * };
328
- * checkGetterSetter(obj, 'name');
329
- * @example
330
- * const obj = { prop: 42 };
331
- * checkGetterSetter(obj, 'prop');
332
- */
333
- checkGetterSetter(obj: object, property: string): object;
334
- /**
335
- * Sets up property accessors for the component's attributes.
336
- */
337
- setUpAccessors(): void;
338
- #private;
339
- }
340
- export let __esModule: string;
341
- export { Permissions, WjElementUtils, event };
@@ -1,2 +0,0 @@
1
- import { default as FileUpload } from './file-upload.element.js';
2
- export default FileUpload;
@@ -1,191 +0,0 @@
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 | boolean);
87
- /**
88
- * Gets the autoProcessFiles attribute.
89
- * @returns {any|boolean}
90
- */
91
- get autoProcessFiles(): any | boolean;
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
- }
@@ -1,70 +0,0 @@
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
- }>;
@@ -1,2 +0,0 @@
1
- import { default as FileUploadItem } from './file-upload-item.element.js';
2
- export default FileUploadItem;
@@ -1,68 +0,0 @@
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(): Array<string>;
33
- localizer: Localizer;
34
- set isUploaded(value: boolean);
35
- get isUploaded(): boolean;
36
- set size(value: string);
37
- get size(): string;
38
- /**
39
- * Dependencies for the component.
40
- * @type {object}
41
- */
42
- dependencies: object;
43
- /**
44
- * Handles updates to the attributes of a custom element whenever one of the observed attributes is changed.
45
- * Updates the related elements based on the changed attribute and its new value.
46
- * @param {string} name The name of the attribute being changed.
47
- * @param {string | null} oldValue The previous value of the attribute before the change, or null if the attribute was not previously set.
48
- * @param {string | null} newValue The new value of the attribute after the change, or null if the attribute is being removed.
49
- * @returns {void} Does not return a value.
50
- */
51
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
52
- /**
53
- * Method to draw the component on the screen.
54
- * @returns {DocumentFragment} The fragment containing the component.
55
- */
56
- draw(): DocumentFragment;
57
- button: HTMLElement;
58
- uploadedEl: HTMLElement;
59
- sliderEl: HTMLElement;
60
- /**
61
- * Called after the component has been drawn.
62
- */
63
- afterDraw(): void;
64
- /**
65
- * Handles the delete action.
66
- */
67
- onDelete: () => void;
68
- }
@@ -1,2 +0,0 @@
1
- import { default as Footer } from './footer.element.js';
2
- export default Footer;