wj-elements 0.4.2 → 0.4.3

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 (36) hide show
  1. package/dist/base-path.js.map +1 -1
  2. package/dist/packages/wje-accordion-item/accordion-item.element.d.ts +2 -2
  3. package/dist/packages/wje-avatar/service/service.d.ts +0 -1
  4. package/dist/packages/wje-breadcrumb/breadcrumb.element.d.ts +1 -2
  5. package/dist/packages/wje-carousel/carousel.element.d.ts +6 -6
  6. package/dist/packages/wje-copy-button/copy-button.element.d.ts +5 -3
  7. package/dist/packages/wje-element/element.d.ts +1 -1
  8. package/dist/packages/wje-input/input.element.d.ts +1 -0
  9. package/dist/{popup.element-DklicGea.js → popup.element-C8-g3WLs.js} +3 -3
  10. package/dist/{popup.element-DklicGea.js.map → popup.element-C8-g3WLs.js.map} +1 -1
  11. package/dist/wje-accordion-item.js.map +1 -1
  12. package/dist/wje-avatar.js.map +1 -1
  13. package/dist/wje-breadcrumb.js +0 -1
  14. package/dist/wje-breadcrumb.js.map +1 -1
  15. package/dist/wje-carousel.js +6 -6
  16. package/dist/wje-carousel.js.map +1 -1
  17. package/dist/wje-copy-button.js +21 -12
  18. package/dist/wje-copy-button.js.map +1 -1
  19. package/dist/wje-dropdown.js +1 -1
  20. package/dist/wje-element.js +1 -1
  21. package/dist/wje-element.js.map +1 -1
  22. package/dist/wje-file-upload.js +0 -1
  23. package/dist/wje-file-upload.js.map +1 -1
  24. package/dist/wje-input.js +50 -6
  25. package/dist/wje-input.js.map +1 -1
  26. package/dist/wje-master.js +1 -1
  27. package/dist/wje-options.js +15 -2
  28. package/dist/wje-options.js.map +1 -1
  29. package/dist/wje-popup.js +1 -1
  30. package/dist/wje-select.js +14 -3
  31. package/dist/wje-select.js.map +1 -1
  32. package/dist/wje-tab.js.map +1 -1
  33. package/dist/wje-tooltip.js +1 -1
  34. package/package.json +5 -4
  35. package/dist/custom-elements.json +0 -21140
  36. package/dist/web-types.json +0 -3842
@@ -1 +1 @@
1
- {"version":3,"file":"base-path.js","sources":["../packages/utils/base-path.js"],"sourcesContent":["let basePath = '';\n\nfunction resolveBasePathFromModuleUrl() {\n if (typeof import.meta?.url !== 'string' || import.meta.url === '') {\n return '';\n }\n\n try {\n return new URL(/* @vite-ignore */ '.', import.meta.url).href;\n } catch {\n return '';\n }\n}\n\n/**\n * Sets the base path for the application.\n * @param {string} path The base path to be set.\n * @returns {void} This function does not return anything.\n */\nexport function setBasePath(path) {\n basePath = path;\n}\n\n/**\n * Returns the base path of the application, optionally appending a specified relative path.\n * If the base path has not been set, it determines the base path from the first script element\n * with a `base-path` attribute or generates it based on the current script location.\n * @param {string} [appendedPath] The relative path to append to the base path. Defaults to an empty string.\n * @returns {string} The complete base path, with the appended relative path if specified.\n */\nexport function getBasePath(appendedPath = '') {\n if (!basePath) {\n const scripts = [...document.getElementsByTagName('script')];\n const basePathScript = scripts.find(script => script.hasAttribute('data-base-path'));\n\n if (basePathScript) {\n setBasePath(basePathScript.dataset.basePath || '');\n } else {\n setBasePath(resolveBasePathFromModuleUrl());\n }\n }\n\n const subPath = appendedPath.replace(/^\\//, '');\n\n return basePath.replace(/\\/$/, '') + (appendedPath ? '/' + subPath : '');\n}\n"],"names":[],"mappings":"AAAA,IAAI,WAAW;AAEf,SAAS,+BAA+B;AAFxC;AAGE,MAAI,SAAO,wCAAa,SAAQ,YAAY,YAAY,QAAQ,IAAI;AAClE,WAAO;AAAA,EACT;AAEA,MAAI;AACF,WAAO,IAAI;AAAA;AAAA,MAAuB;AAAA,MAAK,YAAY;AAAA,IAAG,EAAE;AAAA,EAC1D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOO,SAAS,YAAY,MAAM;AAChC,aAAW;AACb;AASO,SAAS,YAAY,eAAe,IAAI;AAC7C,MAAI,CAAC,UAAU;AACb,UAAM,UAAU,CAAC,GAAG,SAAS,qBAAqB,QAAQ,CAAC;AAC3D,UAAM,iBAAiB,QAAQ,KAAK,YAAU,OAAO,aAAa,gBAAgB,CAAC;AAEnF,QAAI,gBAAgB;AAClB,kBAAY,eAAe,QAAQ,YAAa,EAAE;AAAA,IACpD,OAAO;AACL,kBAAY,6BAA4B,CAAE;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,UAAU,aAAa,QAAQ,OAAO,EAAE;AAE9C,SAAO,SAAS,QAAQ,OAAO,EAAE,KAAK,eAAe,MAAM,UAAU;AACvE;"}
1
+ {"version":3,"file":"base-path.js","sources":["../packages/utils/base-path.js"],"sourcesContent":["let basePath = '';\n\nfunction resolveBasePathFromModuleUrl() {\n if (typeof import.meta?.url !== 'string' || import.meta.url === '') {\n return '';\n }\n\n try {\n // eslint-disable-next-line jsdoc/no-bad-blocks\n return new URL(/* @vite-ignore */ '.', import.meta.url).href;\n } catch {\n return '';\n }\n}\n\n/**\n * Sets the base path for the application.\n * @param {string} path The base path to be set.\n * @returns {void} This function does not return anything.\n */\nexport function setBasePath(path) {\n basePath = path;\n}\n\n/**\n * Returns the base path of the application, optionally appending a specified relative path.\n * If the base path has not been set, it determines the base path from the first script element\n * with a `base-path` attribute or generates it based on the current script location.\n * @param {string} [appendedPath] The relative path to append to the base path. Defaults to an empty string.\n * @returns {string} The complete base path, with the appended relative path if specified.\n */\nexport function getBasePath(appendedPath = '') {\n if (!basePath) {\n const scripts = [...document.getElementsByTagName('script')];\n const basePathScript = scripts.find(script => script.hasAttribute('data-base-path'));\n\n if (basePathScript) {\n setBasePath(basePathScript.dataset.basePath || '');\n } else {\n setBasePath(resolveBasePathFromModuleUrl());\n }\n }\n\n const subPath = appendedPath.replace(/^\\//, '');\n\n return basePath.replace(/\\/$/, '') + (appendedPath ? '/' + subPath : '');\n}\n"],"names":[],"mappings":"AAAA,IAAI,WAAW;AAEf,SAAS,+BAA+B;AAFxC;AAGE,MAAI,SAAO,wCAAa,SAAQ,YAAY,YAAY,QAAQ,IAAI;AAClE,WAAO;AAAA,EACT;AAEA,MAAI;AAEF,WAAO,IAAI;AAAA;AAAA,MAAuB;AAAA,MAAK,YAAY;AAAA,IAAG,EAAE;AAAA,EAC1D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOO,SAAS,YAAY,MAAM;AAChC,aAAW;AACb;AASO,SAAS,YAAY,eAAe,IAAI;AAC7C,MAAI,CAAC,UAAU;AACb,UAAM,UAAU,CAAC,GAAG,SAAS,qBAAqB,QAAQ,CAAC;AAC3D,UAAM,iBAAiB,QAAQ,KAAK,YAAU,OAAO,aAAa,gBAAgB,CAAC;AAEnF,QAAI,gBAAgB;AAClB,kBAAY,eAAe,QAAQ,YAAa,EAAE;AAAA,IACpD,OAAO;AACL,kBAAY,6BAA4B,CAAE;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,UAAU,aAAa,QAAQ,OAAO,EAAE;AAE9C,SAAO,SAAS,QAAQ,OAAO,EAAE,KAAK,eAAe,MAAM,UAAU;AACvE;"}
@@ -24,8 +24,8 @@ import { default as WJElement } from '../wje-element/element.js';
24
24
  * @cssproperty [--wje-accordion-headline-color=var(--wje-color-contrast-11)] - Text color of the headline area.
25
25
  * @cssproperty [--wje-accordion-content-color=var(--wje-color-contrast-6)] - Text color of the expandable content area.
26
26
  * @cssproperty [--wje-accordion-marker-rotate=0deg] - Rotation applied to the toggle marker icon.
27
- * @fires wje-accordion-item:open - Dispatched when the item is expanded.
28
- * @fires wje-accordion-item:close - Dispatched when the item is collapsed.
27
+ * // @fires wje-accordion-item:open - Dispatched when the item is expanded.
28
+ * // @fires wje-accordion-item:close - Dispatched when the item is collapsed.
29
29
  * @tag wje-accordion-item
30
30
  */
31
31
  export default class AccordionItem extends WJElement {
@@ -21,7 +21,6 @@ export function getHsl(text: string, s?: number, l?: number): string;
21
21
  * Generates background and text HSL colors for avatars based on input text.
22
22
  * The text color is a darker, more saturated variant of the background color
23
23
  * to ensure sufficient contrast while keeping the same hue.
24
- *
25
24
  * @param {string} text The input text (e.g. initials or name).
26
25
  * @returns {{ background: string, color: string }}
27
26
  */
@@ -55,9 +55,8 @@ export default class Breadcrumb extends WJElement {
55
55
  * @param {string} name The name of the attribute that was changed.
56
56
  * @param {string|null} oldValue The previous value of the attribute before it was changed. Null if the attribute was not previously set.
57
57
  * @param {string|null} newValue The new value of the attribute after it was changed. Null if the attribute was removed.
58
- * @returns {boolean} Returns false to signal no default behavior is implemented.
59
58
  */
60
- attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): boolean;
59
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
61
60
  active: boolean;
62
61
  syncAria(): void;
63
62
  /**
@@ -88,9 +88,9 @@ export default class Carousel extends WJElement {
88
88
  * Returns the interaction scroll behavior for UI controls.
89
89
  * Continuous multi-slide loops use instant snapping to avoid blank edge states
90
90
  * while the browser is still animating a previous smooth scroll.
91
- * @returns {ScrollBehavior|string}
91
+ * @returns {string}
92
92
  */
93
- getControlBehavior(): ScrollBehavior | string;
93
+ getControlBehavior(): string;
94
94
  /**
95
95
  * Sets up the IntersectionObserver for the Carousel.
96
96
  */
@@ -138,9 +138,9 @@ export default class Carousel extends WJElement {
138
138
  /**
139
139
  * Scrolls the carousel to a visual slide index.
140
140
  * @param {number} vIndex
141
- * @param {ScrollBehavior|string} behavior
141
+ * @param {string} behavior
142
142
  */
143
- scrollToVisualIndex(vIndex: number, behavior?: ScrollBehavior | string): void;
143
+ scrollToVisualIndex(vIndex: number, behavior?: string): void;
144
144
  snapRestoreFrame: any;
145
145
  /**
146
146
  * Goes to the next slide.
@@ -192,9 +192,9 @@ export default class Carousel extends WJElement {
192
192
  * @returns {Array}
193
193
  */
194
194
  getSlidesWithClones(): any[];
195
- /** Maps logical index -> visual index (accounts for leading clone when loop=true) */
195
+ /** Maps logical index to visual index, including leading clones when loop is enabled. */
196
196
  getVisualIndexForLogical(index: any): any;
197
- /** Maps visual index -> logical index (handles clones at 0 and last when loop=true) */
197
+ /** Maps visual index to logical index, including edge clones when loop is enabled. */
198
198
  getLogicalIndexForVisual(vIndex: any): any;
199
199
  /**
200
200
  * Returns the maximum logical slide index that can still render a full viewport.
@@ -8,6 +8,9 @@ import { default as WJElement } from '../wje-element/element.js';
8
8
  * @status stable
9
9
  * @augments WJElement
10
10
  * @attribute {string} for - The id of the element to copy content from.
11
+ * @attribute {string} label - Accessible label for the button. Also used as fallback tooltip text when the `tooltip` attribute is present without a value.
12
+ * @attribute {string} label-success - Text displayed in the tooltip after a successful copy. Used only when the `tooltip` attribute is present.
13
+ * @attribute {string} tooltip - Enables the tooltip. When set to a string, the value is used as the default tooltip content.
11
14
  * @attribute {string} value - The text to be copied.
12
15
  * @slot - This is a default/unnamed slot.
13
16
  * @csspart button - Styles the button element.
@@ -43,8 +46,8 @@ export default class CopyButton extends WJElement {
43
46
  * @returns {DocumentFragment} The created document fragment.
44
47
  */
45
48
  draw(): DocumentFragment;
49
+ _tooltipElement: HTMLElement;
46
50
  icon: HTMLElement;
47
- tooltip: HTMLElement;
48
51
  /**
49
52
  * Adds event listeners for the click, focus, and blur events.
50
53
  */
@@ -76,9 +79,8 @@ export default class CopyButton extends WJElement {
76
79
  /**
77
80
  * Handles the copied event.
78
81
  * You can override this method to customize the behavior when the text is copied.
79
- * @param {Event} e The event object.
80
82
  */
81
- copied: (e: Event) => void;
83
+ copied: () => void;
82
84
  /**
83
85
  * Copies the specified text or node.
84
86
  * @param {HTMLElement} button The button element.
@@ -130,7 +130,7 @@ export default class WJElement extends HTMLElement {
130
130
  /**
131
131
  * Sets ARIA state via attributes.
132
132
  * Accepts camelCase keys without the "aria" prefix, plus "role".
133
- * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' })
133
+ * Example: setAriaState({ role: 'tab', selected: true, controls: 'panel-1' }).
134
134
  * @param {object} state
135
135
  */
136
136
  setAriaState(state?: object): void;
@@ -166,4 +166,5 @@ export default class Input extends FormAssociatedElement {
166
166
  * @returns {boolean} Whether the input has the slot.
167
167
  */
168
168
  hasSlot(el: HTMLElement, slotName?: string): boolean;
169
+ #private;
169
170
  }
@@ -1693,7 +1693,7 @@ class Popup extends WJElement {
1693
1693
  for (const n of defNodes) {
1694
1694
  const ph = document.createComment("wje-portal-default");
1695
1695
  this._defPlaceholders.push({ node: n, ph });
1696
- n.parentNode && n.parentNode.insertBefore(ph, n.nextSibling);
1696
+ if (n.parentNode) n.parentNode.insertBefore(ph, n.nextSibling);
1697
1697
  this._portalContainer.append(n);
1698
1698
  }
1699
1699
  const arrowNodes = (this.slotArrow instanceof HTMLSlotElement ? this.slotArrow.assignedNodes({ flatten: true }) : []).filter((n) => n && n.nodeType === Node.ELEMENT_NODE || n && n.nodeType === Node.TEXT_NODE);
@@ -1701,7 +1701,7 @@ class Popup extends WJElement {
1701
1701
  for (const n of arrowNodes) {
1702
1702
  const ph = document.createComment("wje-portal-arrow");
1703
1703
  this._arrowPlaceholders.push({ node: n, ph });
1704
- n.parentNode && n.parentNode.insertBefore(ph, n.nextSibling);
1704
+ if (n.parentNode) n.parentNode.insertBefore(ph, n.nextSibling);
1705
1705
  this._portalContainer.append(n);
1706
1706
  }
1707
1707
  this._floatingEl = this._portalNative;
@@ -1898,4 +1898,4 @@ class Popup extends WJElement {
1898
1898
  export {
1899
1899
  Popup as P
1900
1900
  };
1901
- //# sourceMappingURL=popup.element-DklicGea.js.map
1901
+ //# sourceMappingURL=popup.element-C8-g3WLs.js.map