wj-elements 0.1.194 → 0.1.196

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.
@@ -52,11 +52,18 @@ export default class Dropdown extends WJElement {
52
52
  */
53
53
  draw(): DocumentFragment;
54
54
  anchorSlot: HTMLSlotElement;
55
- popupHideCallback: () => void;
55
+ popupHideCallback: (e: any) => void;
56
56
  /**
57
57
  * Adds event listeners for the mouseenter and mouseleave events.
58
58
  */
59
59
  afterDraw(): void;
60
+ /**
61
+ * @summary Toggles the dropdown element between active and inactive states.
62
+ * Calls the `onOpen` method if the element is currently inactive,
63
+ * and calls the `onClose` method if the element is currently active.
64
+ * @param {Event} e The event object.
65
+ */
66
+ toggleCallback: (e: Event) => void;
60
67
  /**
61
68
  * @summary Returns the content to be displayed before showing the dropdown.
62
69
  * @returns {any} The content to be displayed.
@@ -66,13 +73,6 @@ export default class Dropdown extends WJElement {
66
73
  * This method is called after the dropdown is shown.
67
74
  */
68
75
  afterShow(): void;
69
- /**
70
- * @summary Toggles the dropdown element between active and inactive states.
71
- * Calls the `onOpen` method if the element is currently inactive,
72
- * and calls the `onClose` method if the element is currently active.
73
- * @param {Event} e The event object.
74
- */
75
- toggleCallback: (e: Event) => void;
76
76
  /**
77
77
  * Open the popup element.
78
78
  * @param {object} e
@@ -80,5 +80,5 @@ export default class Dropdown extends WJElement {
80
80
  onOpen: (e: object) => void;
81
81
  beforeClose: () => void;
82
82
  afterClose: () => void;
83
- onClose: (e: any) => void;
83
+ onClose: () => void;
84
84
  }
@@ -33,13 +33,9 @@ class Dropdown extends WJElement {
33
33
  this.popup.hide();
34
34
  }
35
35
  });
36
- __publicField(this, "popupHideCallback", () => {
36
+ __publicField(this, "popupHideCallback", (e) => {
37
37
  if (this.classList.contains("active")) {
38
- this.classList.remove("active");
39
- event.dispatchCustomEvent(this, "wje-dropdown:close", {
40
- bubbles: true,
41
- detail: { target: this }
42
- });
38
+ this.toggleCallback(e);
43
39
  }
44
40
  });
45
41
  /**
@@ -49,10 +45,11 @@ class Dropdown extends WJElement {
49
45
  * @param {Event} e The event object.
50
46
  */
51
47
  __publicField(this, "toggleCallback", (e) => {
52
- e.stopPropagation();
53
48
  if (this.classList.contains("active")) {
54
- this.onClose(e);
49
+ e.stopPropagation();
50
+ this.onClose();
55
51
  } else {
52
+ e.stopPropagation();
56
53
  this.onOpen(e);
57
54
  }
58
55
  });
@@ -61,7 +58,6 @@ class Dropdown extends WJElement {
61
58
  * @param {object} e
62
59
  */
63
60
  __publicField(this, "onOpen", (e) => {
64
- e.stopPropagation();
65
61
  this.classList.add("active");
66
62
  Promise.resolve(this.beforeShow(this)).then((res) => {
67
63
  if (!this.classList.contains("active")) {
@@ -82,8 +78,7 @@ class Dropdown extends WJElement {
82
78
  });
83
79
  __publicField(this, "afterClose", () => {
84
80
  });
85
- __publicField(this, "onClose", (e) => {
86
- e.stopPropagation();
81
+ __publicField(this, "onClose", () => {
87
82
  this.classList.remove("active");
88
83
  Promise.resolve(this.beforeClose(this)).then((res) => {
89
84
  if (this.classList.contains("active")) {
@@ -1 +1 @@
1
- {"version":3,"file":"wje-dropdown.js","sources":["../packages/wje-dropdown/dropdown.element.js","../packages/wje-dropdown/dropdown.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Popup from '../wje-popup/popup.element.js';\n\n/**\n * `Dropdown` is a custom element that displays a dropdown menu.\n * @summary This element represents a dropdown menu.\n * @documentation https://elements.webjet.sk/components/dropdown\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the dropdown.\n * @slot trigger - The slot for the trigger of the dropdown.\n * @slot - The default slot for the dropdown.\n * // @fires wje-dropdown:open - Event fired when the dropdown is opened.\n * // @fires wje-dropdown:close - Event fired when the dropdown is closed.\n * @tag wje-dropdown\n */\nexport default class Dropdown extends WJElement {\n /**\n * Creates an instance of Dropdown.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * The placement of the dropdown.\n * @type {{\"wje-popup\": Popup}}\n */\n dependencies = {\n 'wje-popup': Popup,\n };\n\n /**\n * Sets the placement of the dropdown.\n * @param value\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Gets the placement of the dropdown.\n * @returns {string|string}\n */\n get trigger() {\n return this.getAttribute('trigger') || 'click';\n }\n\n /**\n * Sets the placement of the dropdown.\n * @type {string}\n */\n className = 'Dropdown';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active'];\n }\n\n /**\n * Callback function to handle other dropdowns being opened. Close the dropdown if it is not the target and collapse is enabled.\n * @param {Event} e The event object.\n */\n otherDropdownOpennedCallback = (e) => {\n if (e.detail.detail.target !== this) {\n this.classList.remove('active');\n this.popup.hide();\n }\n };\n\n /**\n * Sets up the attributes for the dropdown.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Removes the popup element.\n */\n beforeDraw() {\n this.popup?.remove();\n this.popup = null;\n }\n\n /**\n * Draws the dropdown element and returns the created document fragment.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n this.classList.add('wje-placement', 'wje-' + this.placement || 'wje-start');\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-dropdown');\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('content', this.tooltip);\n\n let anchorSlot = document.createElement('slot');\n anchorSlot.setAttribute('name', 'trigger');\n anchorSlot.setAttribute('slot', 'anchor');\n\n let slot = document.createElement('slot');\n\n let popup = document.createElement('wje-popup');\n popup.setAttribute('placement', this.placement);\n popup.setAttribute('offset', this.offset);\n popup.setAttribute('part', 'popup');\n\n popup.appendChild(anchorSlot);\n popup.appendChild(slot);\n\n // if(this.trigger === \"click\")\n popup.setAttribute('manual', '');\n\n native.appendChild(popup);\n\n fragment.appendChild(native);\n\n this.popup = popup;\n this.anchorSlot = anchorSlot;\n\n return fragment;\n }\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDisconnect() {\n event.removeListener(this, 'mouseenter', null, this.onOpen);\n event.removeListener(this, 'mouseleave', null, this.onClose);\n event.removeListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n event.removeListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n }\n\n popupHideCallback = () => {\n if (this.classList.contains('active')) {\n this.classList.remove('active');\n\n event.dispatchCustomEvent(this, 'wje-dropdown:close', {\n bubbles: true,\n detail: { target: this },\n });\n }\n };\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDraw() {\n event.addListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n if (this.trigger !== 'click') {\n event.addListener(this, 'mouseenter', null, this.onOpen);\n event.addListener(this, 'mouseleave', null, this.onClose);\n } else {\n event.addListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n }\n\n if (this.hasAttribute('collapsible')) {\n event.addListener(\n Array.from(this.querySelectorAll('wje-menu-item')),\n 'click',\n 'wje-menu-item:click',\n this.onClose\n );\n }\n }\n\n /**\n * @summary Returns the content to be displayed before showing the dropdown.\n * @returns {any} The content to be displayed.\n */\n beforeShow() {\n return this.content;\n }\n\n /**\n * This method is called after the dropdown is shown.\n */\n afterShow() {\n // Do nothing\n }\n\n /**\n * @summary Toggles the dropdown element between active and inactive states.\n * Calls the `onOpen` method if the element is currently inactive,\n * and calls the `onClose` method if the element is currently active.\n * @param {Event} e The event object.\n */\n toggleCallback = (e) => {\n e.stopPropagation();\n\n if (this.classList.contains('active')) {\n this.onClose(e);\n } else {\n this.onOpen(e);\n }\n };\n\n /**\n * Open the popup element.\n * @param {object} e\n */\n onOpen = (e) => {\n e.stopPropagation();\n\n this.classList.add('active');\n Promise.resolve(this.beforeShow(this))\n .then((res) => {\n if (!this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.show(true); // Show tooltip\n\n event.dispatchCustomEvent(this, 'wje-dropdown:open', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterShow(this));\n })\n .catch((error) => {\n // ak je nejaka chyba tak to len zatvorime\n this.classList.remove('active');\n this.popup.hide(true);\n });\n };\n\n beforeClose = () => {\n // Do nothing\n };\n\n afterClose = () => {\n // Do nothing\n };\n\n onClose = (e) => {\n e.stopPropagation();\n\n this.classList.remove('active');\n Promise.resolve(this.beforeClose(this))\n .then((res) => {\n if (this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.hide(true); // Show tooltip\n\n event.dispatchCustomEvent(this, 'wje-dropdown:close', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterClose(this));\n })\n .catch((error) => {\n this.classList.add('active');\n this.popup.show(true);\n });\n };\n}\n","import Dropdown from './dropdown.element.js';\n\nexport default Dropdown;\n\nDropdown.define('wje-dropdown', Dropdown);\n"],"names":[],"mappings":";;;;;;AAgBe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,cAAc;AACV,UAAO;AAOX;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACX,aAAa;AAAA,IAChB;AAsBD;AAAA;AAAA;AAAA;AAAA,qCAAY;AAcZ;AAAA;AAAA;AAAA;AAAA,wDAA+B,CAAC,MAAM;AAClC,UAAI,EAAE,OAAO,OAAO,WAAW,MAAM;AACjC,aAAK,UAAU,OAAO,QAAQ;AAC9B,aAAK,MAAM,KAAM;AAAA,MAC7B;AAAA,IACK;AAsED,6CAAoB,MAAM;AACtB,UAAI,KAAK,UAAU,SAAS,QAAQ,GAAG;AACnC,aAAK,UAAU,OAAO,QAAQ;AAE9B,cAAM,oBAAoB,MAAM,sBAAsB;AAAA,UAClD,SAAS;AAAA,UACT,QAAQ,EAAE,QAAQ,KAAM;AAAA,QACxC,CAAa;AAAA,MACb;AAAA,IACK;AA8CD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0CAAiB,CAAC,MAAM;AACpB,QAAE,gBAAiB;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AAE/B,WAAO,YAAY,KAAK;AAExB,aAAS,YAAY,MAAM;AAE3B,SAAK,QAAQ;AACb,SAAK,aAAa;AAElB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,UAAM,eAAe,MAAM,cAAc,MAAM,KAAK,MAAM;AAC1D,UAAM,eAAe,MAAM,cAAc,MAAM,KAAK,OAAO;AAC3D,UAAM,eAAe,KAAK,YAAY,SAAS,MAAM,KAAK,gBAAgB,EAAE,SAAS,KAAI,CAAE;AAC3F,UAAM,eAAe,MAAM,kBAAkB,MAAM,KAAK,iBAAiB;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY;AACR,UAAM,YAAY,MAAM,kBAAkB,MAAM,KAAK,iBAAiB;AAEtE,QAAI,KAAK,YAAY,SAAS;AAC1B,YAAM,YAAY,MAAM,cAAc,MAAM,KAAK,MAAM;AACvD,YAAM,YAAY,MAAM,cAAc,MAAM,KAAK,OAAO;AAAA,IACpE,OAAe;AACH,YAAM,YAAY,KAAK,YAAY,SAAS,MAAM,KAAK,gBAAgB,EAAE,SAAS,KAAI,CAAE;AAAA,IACpG;AAEQ,QAAI,KAAK,aAAa,aAAa,GAAG;AAClC,YAAM;AAAA,QACF,MAAM,KAAK,KAAK,iBAAiB,eAAe,CAAC;AAAA,QACjD;AAAA,QACA;AAAA,QACA,KAAK;AAAA,MACR;AAAA,IACb;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,aAAa;AACT,WAAO,KAAK;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKI,YAAY;AAAA,EAEhB;AAgFA;ACzQA,SAAS,OAAO,gBAAgB,QAAQ;"}
1
+ {"version":3,"file":"wje-dropdown.js","sources":["../packages/wje-dropdown/dropdown.element.js","../packages/wje-dropdown/dropdown.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport Popup from '../wje-popup/popup.element.js';\n\n/**\n * `Dropdown` is a custom element that displays a dropdown menu.\n * @summary This element represents a dropdown menu.\n * @documentation https://elements.webjet.sk/components/dropdown\n * @status stable\n * @augments {WJElement}\n * @csspart native - The native part of the dropdown.\n * @slot trigger - The slot for the trigger of the dropdown.\n * @slot - The default slot for the dropdown.\n * // @fires wje-dropdown:open - Event fired when the dropdown is opened.\n * // @fires wje-dropdown:close - Event fired when the dropdown is closed.\n * @tag wje-dropdown\n */\nexport default class Dropdown extends WJElement {\n /**\n * Creates an instance of Dropdown.\n * @class\n */\n constructor() {\n super();\n }\n\n /**\n * The placement of the dropdown.\n * @type {{\"wje-popup\": Popup}}\n */\n dependencies = {\n 'wje-popup': Popup,\n };\n\n /**\n * Sets the placement of the dropdown.\n * @param value\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Gets the placement of the dropdown.\n * @returns {string|string}\n */\n get trigger() {\n return this.getAttribute('trigger') || 'click';\n }\n\n /**\n * Sets the placement of the dropdown.\n * @type {string}\n */\n className = 'Dropdown';\n\n /**\n * Getter for the CSS stylesheet.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['active'];\n }\n\n /**\n * Callback function to handle other dropdowns being opened. Close the dropdown if it is not the target and collapse is enabled.\n * @param {Event} e The event object.\n */\n otherDropdownOpennedCallback = (e) => {\n if (e.detail.detail.target !== this) {\n this.classList.remove('active');\n this.popup.hide();\n }\n };\n\n /**\n * Sets up the attributes for the dropdown.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Removes the popup element.\n */\n beforeDraw() {\n this.popup?.remove();\n this.popup = null;\n }\n\n /**\n * Draws the dropdown element and returns the created document fragment.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n this.classList.add('wje-placement', 'wje-' + this.placement || 'wje-start');\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-dropdown');\n\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('content', this.tooltip);\n\n let anchorSlot = document.createElement('slot');\n anchorSlot.setAttribute('name', 'trigger');\n anchorSlot.setAttribute('slot', 'anchor');\n\n let slot = document.createElement('slot');\n\n let popup = document.createElement('wje-popup');\n popup.setAttribute('placement', this.placement);\n popup.setAttribute('offset', this.offset);\n popup.setAttribute('part', 'popup');\n\n popup.appendChild(anchorSlot);\n popup.appendChild(slot);\n\n // if(this.trigger === \"click\")\n popup.setAttribute('manual', '');\n\n native.appendChild(popup);\n\n fragment.appendChild(native);\n\n this.popup = popup;\n this.anchorSlot = anchorSlot;\n\n return fragment;\n }\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDisconnect() {\n event.removeListener(this, 'mouseenter', null, this.onOpen);\n event.removeListener(this, 'mouseleave', null, this.onClose);\n event.removeListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n event.removeListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n }\n\n popupHideCallback = (e) => {\n if (this.classList.contains('active')) {\n this.toggleCallback(e);\n }\n };\n\n /**\n * Adds event listeners for the mouseenter and mouseleave events.\n */\n afterDraw() {\n event.addListener(this, 'wje-popup:hide', null, this.popupHideCallback);\n\n if (this.trigger !== 'click') {\n event.addListener(this, 'mouseenter', null, this.onOpen);\n event.addListener(this, 'mouseleave', null, this.onClose);\n } else {\n event.addListener(this.anchorSlot, 'click', null, this.toggleCallback, { capture: true });\n }\n\n if (this.hasAttribute('collapsible')) {\n event.addListener(\n Array.from(this.querySelectorAll('wje-menu-item')),\n 'click',\n 'wje-menu-item:click',\n this.onClose\n );\n }\n }\n\n /**\n * @summary Toggles the dropdown element between active and inactive states.\n * Calls the `onOpen` method if the element is currently inactive,\n * and calls the `onClose` method if the element is currently active.\n * @param {Event} e The event object.\n */\n toggleCallback = (e) => {\n if (this.classList.contains('active')) {\n e.stopPropagation();\n this.onClose();\n } else {\n e.stopPropagation();\n this.onOpen(e);\n }\n };\n\n /**\n * @summary Returns the content to be displayed before showing the dropdown.\n * @returns {any} The content to be displayed.\n */\n beforeShow() {\n return this.content;\n }\n\n /**\n * This method is called after the dropdown is shown.\n */\n afterShow() {\n // Do nothing\n }\n\n /**\n * Open the popup element.\n * @param {object} e\n */\n onOpen = (e) => {\n this.classList.add('active');\n Promise.resolve(this.beforeShow(this))\n .then((res) => {\n if (!this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.show(true); // Show tooltip\n\n event.dispatchCustomEvent(this, 'wje-dropdown:open', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterShow(this));\n })\n .catch((error) => {\n // ak je nejaka chyba tak to len zatvorime\n this.classList.remove('active');\n this.popup.hide(true);\n });\n };\n\n beforeClose = () => {\n // Do nothing\n };\n\n afterClose = () => {\n // Do nothing\n };\n\n onClose = () => {\n this.classList.remove('active');\n Promise.resolve(this.beforeClose(this))\n .then((res) => {\n if (this.classList.contains('active')) {\n throw new Error('beforeShow method returned false or not string');\n }\n\n this.popup.hide(true); // Show tooltip\n\n event.dispatchCustomEvent(this, 'wje-dropdown:close', {\n bubbles: true,\n detail: { target: this },\n });\n\n Promise.resolve(this.afterClose(this));\n })\n .catch((error) => {\n this.classList.add('active');\n this.popup.show(true);\n });\n };\n}\n","import Dropdown from './dropdown.element.js';\n\nexport default Dropdown;\n\nDropdown.define('wje-dropdown', Dropdown);\n"],"names":[],"mappings":";;;;;;AAgBe,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,cAAc;AACV,UAAO;AAOX;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACX,aAAa;AAAA,IAChB;AAsBD;AAAA;AAAA;AAAA;AAAA,qCAAY;AAcZ;AAAA;AAAA;AAAA;AAAA,wDAA+B,CAAC,MAAM;AAClC,UAAI,EAAE,OAAO,OAAO,WAAW,MAAM;AACjC,aAAK,UAAU,OAAO,QAAQ;AAC9B,aAAK,MAAM,KAAM;AAAA,MAC7B;AAAA,IACK;AAsED,6CAAoB,CAAC,MAAM;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
227
  }
228
228
  return clonedNode;
229
229
  });
230
- const newOrder = orderElements.map((el) => el.innerText.trim());
230
+ const newOrder = newOrderElements.map((el) => el.innerText.trim());
231
231
  this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);
232
232
  document.body.style.userSelect = "";
233
233
  }
@@ -267,10 +267,10 @@ class Reorder extends WJElement {
267
267
  * // @fires wje-reorder:change - Dispatched when the reordering is completed.
268
268
  * The event includes details about the initial position, the new position, and the new order.
269
269
  */
270
- dispatchChange(from, to, order, orderElements2) {
270
+ dispatchChange(from, to, order, orderElements) {
271
271
  this.dispatchEvent(
272
272
  new CustomEvent("wje-reorder:change", {
273
- detail: { from, to, order, orderElements: orderElements2 }
273
+ detail: { from, to, order, orderElements }
274
274
  })
275
275
  );
276
276
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wje-reorder.js","sources":["../packages/wje-reorder/reorder.element.js","../packages/wje-reorder/reorder.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Reorder` is a custom web component that represents a reorder.\n * It extends from `WJElement`.\n * @summary This element represents a reorder.\n * @documentation https://elements.webjet.sk/components/reorder\n * @status stable\n * @augments WJElement\n * @csspart native - The native part of the reorder.\n * @slot - The default slot for the reorder.\n * // @fires wje-reorder:change - Event fired when the reorder is changed.\n * @tag wje-reorder\n */\n\nexport default class Reorder extends WJElement {\n /**\n * Creates an instance of Select.\n * @class\n */\n constructor() {\n super();\n this.dragEl = null;\n this.items = [];\n this.originalIndex = null;\n this.isDragging = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.cloneEl = null;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Select';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component after it is connected to the DOM.\n * @returns {DocumentFragment}\n */\n draw() {\n const fragment = document.createDocumentFragment();\n\n const container = document.createElement('div');\n container.classList.add('container');\n container.setAttribute('part', 'native');\n\n const slot = document.createElement('slot');\n slot.classList.add('reorder-items');\n\n container.appendChild(slot);\n\n fragment.appendChild(container);\n\n this.container = container;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n const items = this.querySelectorAll('wje-reorder-item');\n const dropZones = this.querySelectorAll('wje-reorder-dropzone');\n this.container.classList.add(this.hasAttribute('reverse') ? 'reversed' : 'basic');\n\n if (dropZones) {\n dropZones.forEach((dropZone) => {\n this.container.classList.remove('container');\n this.container.classList.add('container-w-dropzones');\n });\n }\n\n if (items) {\n items.forEach((item) => {\n const handles = item.querySelectorAll('[slot=handle]');\n const draggableElement = handles.length > 0 ? handles : [item];\n\n draggableElement.forEach((element) => {\n this.attachEventListeners(element);\n });\n });\n }\n }\n\n /**\n * Attaches event listeners to the element.\n * @param element\n */\n attachEventListeners(element) {\n element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n element.addEventListener('touchstart', this.touchStart.bind(this), false);\n element.addEventListener('dragstart', this.dragStart.bind(this), false);\n }\n\n /**\n * Handles the mouse down event.\n * @param {object} e\n */\n mouseDown(e) {\n this.startDragging(e.clientX, e.clientY, e.currentTarget);\n document.addEventListener('mousemove', this.mouseMove.bind(this), false);\n document.addEventListener('mouseup', this.mouseUp.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Handles the touch start event.\n * @param e\n */\n touchStart(e) {\n const touch = e.touches[0];\n this.startDragging(touch.clientX, touch.clientY, e.currentTarget);\n document.addEventListener('touchmove', this.touchMove.bind(this), false);\n document.addEventListener('touchend', this.touchEnd.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Initializes the dragging process for a reorderable item.\n * @param {number} clientX The x-coordinate of the mouse pointer when the drag starts.\n * @param {number} clientY The y-coordinate of the mouse pointer when the drag starts.\n * @param {HTMLElement} target The target element where the drag event originated.\n */\n startDragging(clientX, clientY, target) {\n if (this.hasAttribute('disabled')) {\n return;\n }\n\n this.isDragging = true;\n this.dragEl = target.closest('wje-reorder-item');\n\n this.createClone();\n\n this.dragEl.style.opacity = '0.3';\n\n const rect = this.dragEl.getBoundingClientRect();\n this.offsetX = clientX - rect.left;\n this.offsetY = clientY - rect.top;\n\n this.dragEl.classList.add('dragging');\n\n this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl);\n this.originalParent = this.dragEl.parentNode;\n }\n\n /**\n * Handles the mouse move event.\n * @param e\n */\n mouseMove(e) {\n if (!this.isDragging) return;\n this.moveElement(e.pageX, e.pageY);\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${e.pageX - this.offsetX}px`;\n this.cloneEl.style.top = `${e.pageY - this.offsetY}px`;\n }\n }\n\n /**\n * Handles the `touchmove` event and updates the position of the dragged element.\n * @param {TouchEvent} e The touch event containing touch position data.\n */\n touchMove(e) {\n if (!this.isDragging) return;\n const touch = e.touches[0];\n this.moveElement(touch.pageX, touch.pageY);\n }\n\n /**\n * Updates the position of the dragged element and handles reordering logic based on the mouse position.\n * @param {number} pageX The x-coordinate of the mouse pointer relative to the viewport during the move event.\n * @param {number} pageY The y-coordinate of the mouse pointer relative to the viewport during the move event.\n */\n moveElement(pageX, pageY) {\n const scrollX = window.scrollX || document.documentElement.scrollLeft;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const adjustedPageX = pageX - scrollX;\n const adjustedPageY = pageY - scrollY;\n\n this.dragEl.style.left = `${adjustedPageX}px`;\n this.dragEl.style.top = `${adjustedPageY}px`;\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${adjustedPageX}px`;\n this.cloneEl.style.top = `${adjustedPageY}px`;\n }\n\n const items = this.querySelectorAll('wje-reorder-item');\n items.forEach((item) => {\n if (item === this.dragEl) return;\n\n const boundingBox = item.getBoundingClientRect();\n const mouseY = adjustedPageY - boundingBox.top;\n const mouseYPercent = (mouseY / boundingBox.height) * 100;\n\n if (mouseYPercent > 30 && this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item.nextSibling);\n } else if (mouseYPercent < 30 && !this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item);\n }\n });\n }\n\n /**\n * Handles the mouse up event.\n */\n mouseUp() {\n this.stopDragging();\n document.removeEventListener('mousemove', this.mouseMove.bind(this), false);\n document.removeEventListener('mouseup', this.mouseUp.bind(this), false);\n\n if (this.cloneEl) {\n this.cloneEl.remove();\n this.cloneEl = null;\n }\n\n if (this.dragEl) {\n this.dragEl.style.opacity = '1';\n }\n }\n\n /**\n * Handles the touch end event.\n */\n touchEnd() {\n this.stopDragging();\n document.removeEventListener('touchmove', this.touchMove.bind(this), false);\n document.removeEventListener('touchend', this.touchEnd.bind(this), false);\n }\n\n /**\n * Stops dragging the element.\n */\n stopDragging() {\n if (!this.isDragging) return;\n\n this.isDragging = false;\n this.dragEl.classList.remove('dragging');\n this.dragEl.style.left = '';\n this.dragEl.style.top = '';\n\n const parent = this.dragEl.parentNode;\n const newIndex = Array.from(parent.children).indexOf(this.dragEl);\n\n const newOrderElements = Array.from(parent.children).map((el) => {\n const clonedNode = el.cloneNode(true);\n const handle = clonedNode.querySelector('.handle');\n if (handle) {\n handle.remove();\n }\n return clonedNode;\n });\n\n const newOrder = orderElements.map(el => el.innerText.trim());\n\n this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);\n\n document.body.style.userSelect = '';\n }\n\n /**\n * Prevents the default behavior of the `dragstart` event.\n * @param {DragEvent} e The drag event triggered when a drag operation starts.\n */\n dragStart(e) {\n e.preventDefault();\n }\n\n /**\n * Creates a clone of the element.\n */\n createClone() {\n this.cloneEl = this.dragEl.cloneNode(true);\n this.cloneEl.style.position = 'absolute';\n this.cloneEl.style.pointerEvents = 'none';\n this.cloneEl.style.visibility = 'visible';\n\n document.body.appendChild(this.cloneEl);\n }\n\n /**\n * Checks if the dragged element is moving down.\n * @param droppedElement\n * @returns {boolean}\n */\n isMovingDown(droppedElement) {\n const parent = droppedElement.parentNode;\n const dragIndex = Array.from(parent.children).indexOf(this.dragEl);\n const dropIndex = Array.from(parent.children).indexOf(droppedElement);\n\n return dragIndex < dropIndex;\n }\n\n /**\n * Dispatches a custom event to signal that a reordering operation has occurred.\n * @param {number} from The original index of the dragged item.\n * @param {number} to The new index of the dragged item after reordering.\n * @param {Array<number>} order The updated order of items after the reordering.\n * // @fires wje-reorder:change - Dispatched when the reordering is completed.\n * The event includes details about the initial position, the new position, and the new order.\n */\n dispatchChange(from, to, order, orderElements) {\n this.dispatchEvent(\n new CustomEvent('wje-reorder:change', {\n detail: { from, to, order, orderElements },\n })\n );\n }\n}\n","import Reorder from './reorder.element.js';\n\nexport default Reorder;\n\nReorder.define('wje-reorder', Reorder);\n"],"names":["orderElements"],"mappings":";;;;;AAgBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C,cAAc;AACV,UAAO;AAcX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAbR,SAAK,SAAS;AACd,SAAK,QAAQ,CAAE;AACf,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,UAAM,WAAW,SAAS,uBAAwB;AAElD,UAAM,YAAY,SAAS,cAAc,KAAK;AA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,QAAQ,MAAM,aAAa;AAEhC,aAAS,KAAK,YAAY,KAAK,OAAO;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,aAAa,gBAAgB;AACzB,UAAM,SAAS,eAAe;AAC9B,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,KAAK,MAAM;AACjE,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,cAAc;AAEpE,WAAO,YAAY;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,eAAe,MAAM,IAAI,OAAOA,gBAAe;AAC3C,SAAK;AAAA,MACD,IAAI,YAAY,sBAAsB;AAAA,QAClC,QAAQ,EAAE,MAAM,IAAI,OAAO,eAAAA,eAAe;AAAA,MAC7C,CAAA;AAAA,IACJ;AAAA,EACT;AACA;AC9UA,QAAQ,OAAO,eAAe,OAAO;"}
1
+ {"version":3,"file":"wje-reorder.js","sources":["../packages/wje-reorder/reorder.element.js","../packages/wje-reorder/reorder.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Reorder` is a custom web component that represents a reorder.\n * It extends from `WJElement`.\n * @summary This element represents a reorder.\n * @documentation https://elements.webjet.sk/components/reorder\n * @status stable\n * @augments WJElement\n * @csspart native - The native part of the reorder.\n * @slot - The default slot for the reorder.\n * // @fires wje-reorder:change - Event fired when the reorder is changed.\n * @tag wje-reorder\n */\n\nexport default class Reorder extends WJElement {\n /**\n * Creates an instance of Select.\n * @class\n */\n constructor() {\n super();\n this.dragEl = null;\n this.items = [];\n this.originalIndex = null;\n this.isDragging = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.cloneEl = null;\n }\n\n /**\n * The class name for the component.\n * @type {string}\n */\n className = 'Select';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component after it is connected to the DOM.\n * @returns {DocumentFragment}\n */\n draw() {\n const fragment = document.createDocumentFragment();\n\n const container = document.createElement('div');\n container.classList.add('container');\n container.setAttribute('part', 'native');\n\n const slot = document.createElement('slot');\n slot.classList.add('reorder-items');\n\n container.appendChild(slot);\n\n fragment.appendChild(container);\n\n this.container = container;\n\n return fragment;\n }\n\n /**\n * Adds event listeners after the component is drawn.\n */\n afterDraw() {\n const items = this.querySelectorAll('wje-reorder-item');\n const dropZones = this.querySelectorAll('wje-reorder-dropzone');\n this.container.classList.add(this.hasAttribute('reverse') ? 'reversed' : 'basic');\n\n if (dropZones) {\n dropZones.forEach((dropZone) => {\n this.container.classList.remove('container');\n this.container.classList.add('container-w-dropzones');\n });\n }\n\n if (items) {\n items.forEach((item) => {\n const handles = item.querySelectorAll('[slot=handle]');\n const draggableElement = handles.length > 0 ? handles : [item];\n\n draggableElement.forEach((element) => {\n this.attachEventListeners(element);\n });\n });\n }\n }\n\n /**\n * Attaches event listeners to the element.\n * @param element\n */\n attachEventListeners(element) {\n element.addEventListener('mousedown', this.mouseDown.bind(this), false);\n element.addEventListener('touchstart', this.touchStart.bind(this), false);\n element.addEventListener('dragstart', this.dragStart.bind(this), false);\n }\n\n /**\n * Handles the mouse down event.\n * @param {object} e\n */\n mouseDown(e) {\n this.startDragging(e.clientX, e.clientY, e.currentTarget);\n document.addEventListener('mousemove', this.mouseMove.bind(this), false);\n document.addEventListener('mouseup', this.mouseUp.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Handles the touch start event.\n * @param e\n */\n touchStart(e) {\n const touch = e.touches[0];\n this.startDragging(touch.clientX, touch.clientY, e.currentTarget);\n document.addEventListener('touchmove', this.touchMove.bind(this), false);\n document.addEventListener('touchend', this.touchEnd.bind(this), false);\n document.body.style.userSelect = 'none';\n }\n\n /**\n * Initializes the dragging process for a reorderable item.\n * @param {number} clientX The x-coordinate of the mouse pointer when the drag starts.\n * @param {number} clientY The y-coordinate of the mouse pointer when the drag starts.\n * @param {HTMLElement} target The target element where the drag event originated.\n */\n startDragging(clientX, clientY, target) {\n if (this.hasAttribute('disabled')) {\n return;\n }\n\n this.isDragging = true;\n this.dragEl = target.closest('wje-reorder-item');\n\n this.createClone();\n\n this.dragEl.style.opacity = '0.3';\n\n const rect = this.dragEl.getBoundingClientRect();\n this.offsetX = clientX - rect.left;\n this.offsetY = clientY - rect.top;\n\n this.dragEl.classList.add('dragging');\n\n this.originalIndex = [...this.dragEl.parentNode.children].indexOf(this.dragEl);\n this.originalParent = this.dragEl.parentNode;\n }\n\n /**\n * Handles the mouse move event.\n * @param e\n */\n mouseMove(e) {\n if (!this.isDragging) return;\n this.moveElement(e.pageX, e.pageY);\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${e.pageX - this.offsetX}px`;\n this.cloneEl.style.top = `${e.pageY - this.offsetY}px`;\n }\n }\n\n /**\n * Handles the `touchmove` event and updates the position of the dragged element.\n * @param {TouchEvent} e The touch event containing touch position data.\n */\n touchMove(e) {\n if (!this.isDragging) return;\n const touch = e.touches[0];\n this.moveElement(touch.pageX, touch.pageY);\n }\n\n /**\n * Updates the position of the dragged element and handles reordering logic based on the mouse position.\n * @param {number} pageX The x-coordinate of the mouse pointer relative to the viewport during the move event.\n * @param {number} pageY The y-coordinate of the mouse pointer relative to the viewport during the move event.\n */\n moveElement(pageX, pageY) {\n const scrollX = window.scrollX || document.documentElement.scrollLeft;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const adjustedPageX = pageX - scrollX;\n const adjustedPageY = pageY - scrollY;\n\n this.dragEl.style.left = `${adjustedPageX}px`;\n this.dragEl.style.top = `${adjustedPageY}px`;\n\n if (this.cloneEl) {\n this.cloneEl.style.left = `${adjustedPageX}px`;\n this.cloneEl.style.top = `${adjustedPageY}px`;\n }\n\n const items = this.querySelectorAll('wje-reorder-item');\n items.forEach((item) => {\n if (item === this.dragEl) return;\n\n const boundingBox = item.getBoundingClientRect();\n const mouseY = adjustedPageY - boundingBox.top;\n const mouseYPercent = (mouseY / boundingBox.height) * 100;\n\n if (mouseYPercent > 30 && this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item.nextSibling);\n } else if (mouseYPercent < 30 && !this.isMovingDown(item)) {\n item.parentNode.insertBefore(this.dragEl, item);\n }\n });\n }\n\n /**\n * Handles the mouse up event.\n */\n mouseUp() {\n this.stopDragging();\n document.removeEventListener('mousemove', this.mouseMove.bind(this), false);\n document.removeEventListener('mouseup', this.mouseUp.bind(this), false);\n\n if (this.cloneEl) {\n this.cloneEl.remove();\n this.cloneEl = null;\n }\n\n if (this.dragEl) {\n this.dragEl.style.opacity = '1';\n }\n }\n\n /**\n * Handles the touch end event.\n */\n touchEnd() {\n this.stopDragging();\n document.removeEventListener('touchmove', this.touchMove.bind(this), false);\n document.removeEventListener('touchend', this.touchEnd.bind(this), false);\n }\n\n /**\n * Stops dragging the element.\n */\n stopDragging() {\n if (!this.isDragging) return;\n\n this.isDragging = false;\n this.dragEl.classList.remove('dragging');\n this.dragEl.style.left = '';\n this.dragEl.style.top = '';\n\n const parent = this.dragEl.parentNode;\n const newIndex = Array.from(parent.children).indexOf(this.dragEl);\n\n const newOrderElements = Array.from(parent.children).map((el) => {\n const clonedNode = el.cloneNode(true);\n const handle = clonedNode.querySelector('.handle');\n if (handle) {\n handle.remove();\n }\n return clonedNode;\n });\n\n const newOrder = newOrderElements.map(el => el.innerText.trim());\n\n this.dispatchChange(this.originalIndex, newIndex, newOrder, newOrderElements);\n\n document.body.style.userSelect = '';\n }\n\n /**\n * Prevents the default behavior of the `dragstart` event.\n * @param {DragEvent} e The drag event triggered when a drag operation starts.\n */\n dragStart(e) {\n e.preventDefault();\n }\n\n /**\n * Creates a clone of the element.\n */\n createClone() {\n this.cloneEl = this.dragEl.cloneNode(true);\n this.cloneEl.style.position = 'absolute';\n this.cloneEl.style.pointerEvents = 'none';\n this.cloneEl.style.visibility = 'visible';\n\n document.body.appendChild(this.cloneEl);\n }\n\n /**\n * Checks if the dragged element is moving down.\n * @param droppedElement\n * @returns {boolean}\n */\n isMovingDown(droppedElement) {\n const parent = droppedElement.parentNode;\n const dragIndex = Array.from(parent.children).indexOf(this.dragEl);\n const dropIndex = Array.from(parent.children).indexOf(droppedElement);\n\n return dragIndex < dropIndex;\n }\n\n /**\n * Dispatches a custom event to signal that a reordering operation has occurred.\n * @param {number} from The original index of the dragged item.\n * @param {number} to The new index of the dragged item after reordering.\n * @param {Array<number>} order The updated order of items after the reordering.\n * // @fires wje-reorder:change - Dispatched when the reordering is completed.\n * The event includes details about the initial position, the new position, and the new order.\n */\n dispatchChange(from, to, order, orderElements) {\n this.dispatchEvent(\n new CustomEvent('wje-reorder:change', {\n detail: { from, to, order, orderElements },\n })\n );\n }\n}\n","import Reorder from './reorder.element.js';\n\nexport default Reorder;\n\nReorder.define('wje-reorder', Reorder);\n"],"names":[],"mappings":";;;;;AAgBe,MAAM,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3C,cAAc;AACV,UAAO;AAcX;AAAA;AAAA;AAAA;AAAA,qCAAY;AAbR,SAAK,SAAS;AACd,SAAK,QAAQ,CAAE;AACf,SAAK,gBAAgB;AACrB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,WAAW,qBAAqB;AAC5B,WAAO,CAAE;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA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O,UAAU,IAAI;AACzC,SAAK,QAAQ,MAAM,WAAW;AAC9B,SAAK,QAAQ,MAAM,gBAAgB;AACnC,SAAK,QAAQ,MAAM,aAAa;AAEhC,aAAS,KAAK,YAAY,KAAK,OAAO;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,aAAa,gBAAgB;AACzB,UAAM,SAAS,eAAe;AAC9B,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,KAAK,MAAM;AACjE,UAAM,YAAY,MAAM,KAAK,OAAO,QAAQ,EAAE,QAAQ,cAAc;AAEpE,WAAO,YAAY;AAAA,EAC3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUI,eAAe,MAAM,IAAI,OAAO,eAAe;AAC3C,SAAK;AAAA,MACD,IAAI,YAAY,sBAAsB;AAAA,QAClC,QAAQ,EAAE,MAAM,IAAI,OAAO,cAAe;AAAA,MAC7C,CAAA;AAAA,IACJ;AAAA,EACT;AACA;AC9UA,QAAQ,OAAO,eAAe,OAAO;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
4
- "version": "0.1.194",
4
+ "version": "0.1.196",
5
5
  "homepage": "https://github.com/lencys/wj-elements",
6
6
  "author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
7
7
  "license": "MIT",