wj-elements 0.1.190 → 0.1.191

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.
@@ -27,7 +27,6 @@ class FormAssociatedElement extends WJElement {
27
27
  * @returns {string} The type of the input.
28
28
  */
29
29
  get type() {
30
- console.log("LOCAL NAME", this.localName, this.getAttribute("type"));
31
30
  return this.getAttribute("type");
32
31
  }
33
32
  /**
@@ -170,6 +169,11 @@ class FormAssociatedElement extends WJElement {
170
169
  }
171
170
  errorMessageEl.textContent = internals.validationMessage;
172
171
  }
172
+ /**
173
+ * Checks the validity of the input by invoking custom validation logic
174
+ * and then verifying against internal validation rules.
175
+ * @returns {boolean} Returns true if the input is valid according to both custom validation and internal validation rules, otherwise false.
176
+ */
173
177
  checkValidity() {
174
178
  this.validate();
175
179
  return this.internals.checkValidity();
@@ -239,4 +243,4 @@ __publicField(FormAssociatedElement, "formAssociated", true);
239
243
  export {
240
244
  FormAssociatedElement as F
241
245
  };
242
- //# sourceMappingURL=form-associated-element-CaIxmEod.js.map
246
+ //# sourceMappingURL=form-associated-element-o0UjvdUp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-associated-element-o0UjvdUp.js","sources":["../packages/internals/form-associated-element.js"],"sourcesContent":["import { default as WJElement, event } from \"../wje-element/element.js\";\n\nexport class FormAssociatedElement extends WJElement {\n static formAssociated = true;\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n /**\n * Sets the 'name' attribute to the given value.\n * @param {string} value The new value for the 'name' attribute.\n */\n set name(value) {\n this.setAttribute('name', value);\n }\n\n /**\n * Getter for the name attribute.\n * @returns {string} The name of the input.\n */\n get name() {\n return this.getAttribute('name');\n }\n\n /**\n * Getter for the type attribute.\n * @returns {string} The type of the input.\n */\n get type() {\n return this.getAttribute(\"type\");\n }\n\n /**\n * Sets or removes the 'required' attribute on the element.\n * @param {boolean} value If true, adds the 'required' attribute. If false, removes the 'required' attribute.\n */\n set required(value) {\n if (value) {\n this.setAttribute('required', '');\n } else {\n this.removeAttribute('required');\n }\n }\n\n /**\n * Checks if the 'required' attribute is present on the element.\n * @returns {boolean} `true` if the 'required' attribute is set, otherwise `false`.\n */\n get required() {\n return this.hasAttribute('required');\n }\n\n /**\n * Setter for the invalid attribute.\n * @param {boolean} isInvalid Whether the input is invalid.\n */\n set invalid(isInvalid) {\n if (isInvalid) this.setAttribute('invalid', '');\n else this.removeAttribute('invalid');\n }\n\n /**\n * Getter for the invalid attribute.\n * @returns {boolean} Whether the attribute is present.\n */\n get invalid() {\n return this.hasAttribute('invalid');\n }\n\n /**\n * Set checked attribute.\n * @param {boolean} value true if the toggle is checked, false otherwise\n */\n set disabled(value) {\n if (value) {\n this.setAttribute('disabled', '');\n } else {\n this.removeAttribute('disabled');\n }\n }\n\n /**\n * Get disabled attribute value.\n * @returns {boolean} true if the toggle is disabled, false otherwise\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n /**\n * Retrieves the form element associated with this object.\n * @returns {HTMLFormElement|null} The associated form element, or null if there isn't one.\n */\n get form() {\n return this.internals.form;\n }\n\n /**\n * Retrieves the validity state of the element by returning the validity object from the internal element.\n * The validity object provides information on whether the element satisfies its validation constraints.\n * @returns {ValidityState} The validity state object representing the element's validation constraints.\n */\n get validity() {\n return this.internals.validity;\n }\n\n /**\n * Retrieves the current validation message associated with the element.\n * @returns {string} The validation message that describes why the element's value fails validity checks.\n */\n get validationMessage() {\n return this.internals.validationMessage;\n }\n\n /**\n * Indicates whether the element is a candidate for constraint validation.\n * @returns {boolean} Returns true if the element will be validated during constraint validation, false otherwise.\n */\n get willValidate() {\n return this.internals.willValidate;\n }\n\n /**\n * Validates the input element associated with the component and updates its validity state\n * and error messages based on the user's input and the current validation rules.\n * @returns {void} This method does not return a value. It modifies the validity state\n * internally and sets appropriate validation messages.\n */\n validate() {\n const validState = this.input.validity;\n\n if (!validState.valid) {\n for (let state in validState) {\n const attr = `message-${state.toString()}`;\n\n if (validState[state]) {\n this.validationError = state.toString();\n let errorMessage = this.message;\n\n // TODO this take error messages based on lang from operating system of user should we implement custom translations based on app language ?\n if (!this.hasAttribute('message'))\n errorMessage = this.hasAttribute(attr) ? this.getAttribute(attr) : this.input.validationMessage;\n\n this.internals.setValidity({ [this.validationError]: true }, errorMessage, this.input);\n }\n }\n } else {\n this.internals.setValidity({});\n }\n }\n\n /**\n * Propagates a validation event based on the validity state of the component.\n *\n * This method checks the validity status of the component and emits a custom\n * event if the component is invalid. The event's name and additional details\n * can be specified.\n * @param {string} [eventName] The name of the event to dispatch when the component is invalid.\n * @param {object} [detail] Additional detail to include in the dispatched event.\n * @returns {void} This method does not return a value.\n */\n propagateValidation(eventName = 'invalid', detail = {}) {\n const internals = this.internals;\n\n this.invalid = !this.pristine && !internals.validity.valid;\n\n if (this.invalid) {\n event.dispatchCustomEvent(this, this.tagName.toLocaleLowerCase() + ':' + eventName, detail);\n }\n }\n\n /**\n * Displays an invalid message for the current element.\n * If an error message element does not exist within the designated slot,\n * it creates one and appends it to the slot. Updates the text content\n * of the error message element with the validation message from the\n * element's internals.\n * @returns {void} This method does not return any value.\n */\n showInvalidMessage() {\n const internals = this.internals;\n const slot = this.querySelector(\"[slot='error']\");\n let errorMessageEl = slot?.querySelector('[error-message]');\n\n if (!errorMessageEl) {\n const error = document.createElement('div');\n error.setAttribute('error-message', '');\n slot?.append(error);\n errorMessageEl = error;\n }\n\n errorMessageEl.textContent = internals.validationMessage;\n }\n\n /**\n * Checks the validity of the input by invoking custom validation logic\n * and then verifying against internal validation rules.\n * @returns {boolean} Returns true if the input is valid according to both custom validation and internal validation rules, otherwise false.\n */\n checkValidity() {\n // zavolá tvoju vlastnú validáciu pred kontrolou internals\n this.validate();\n return this.internals.checkValidity();\n }\n\n /**\n * Callback to handle the reset action for a form.\n * Resets the value of the form control to its default value, updates the form value, and clears any validity states.\n * @returns {void} Does not return a value.\n */\n formResetCallback() {\n this.value = this.defaultValue;\n this.internals.setFormValue(this.defaultValue);\n this.internals.setValidity({});\n }\n\n /**\n * Restores the form state by assigning the provided state value\n * and updating the internal form value and validity.\n * @param {object} state The state object containing the value to restore the form.\n * @param {*} state.value The value to set for the form element.\n * @returns {void} This method does not return any value.\n */\n formStateRestoreCallback(state) {\n this.value = state.value;\n this.internals.setFormValue(state.value);\n this.internals.setValidity({});\n }\n\n /**\n * Callback method to save the current state of a form.\n * This method captures and returns the form's value property.\n * @returns {object} An object containing the `value` property of the current form state.\n */\n formStateSaveCallback() {\n return {\n value: this.value\n };\n }\n\n /**\n * Toggles the disabled state of the component and updates corresponding attributes.\n * @param {boolean} disabled Indicates whether the form should be marked as disabled.\n * If true, the 'disabled' class is added, and the 'disabled' attribute is set.\n * If false, both the class and attribute are removed.\n * @returns {void}\n */\n formDisabledCallback(disabled) {\n this.native?.classList.toggle('disabled', disabled);\n this.toggleAttribute('disabled', disabled);\n }\n\n /**\n * A lifecycle callback that is executed when the element is associated with a form.\n * It updates the form's value field with the element's value and sets up an event\n * listener to perform validation and propagate it whenever the form is submitted.\n * @returns {void} Does not return any value.\n */\n formAssociatedCallback() {\n if (this.form) {\n this.internals.setFormValue(this.value);\n this.form?.addEventListener('submit', () => {\n this.validate();\n this.propagateValidation();\n });\n }\n }\n}"],"names":[],"mappings":";;;;;AAEO,MAAM,8BAA8B,UAAU;AAAA,EAGnD,cAAc;AACZ,UAAO;AACP,SAAK,YAAY,KAAK,gBAAiB;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,KAAK,OAAO;AACd,SAAK,aAAa,QAAQ,KAAK;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,OAAO;AACT,WAAO,KAAK,aAAa,MAAM;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,OAAO;AACT,WAAO,KAAK,aAAa,MAAM;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA;AAAA,EAME,IAAI,SAAS,OAAO;AAClB,QAAI,OAAO;AACT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AAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,yBAAyB,OAAO;AAC9B,SAAK,QAAQ,MAAM;AACnB,SAAK,UAAU,aAAa,MAAM,KAAK;AACvC,SAAK,UAAU,YAAY,EAAE;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOE,wBAAwB;AACtB,WAAO;AAAA,MACL,OAAO,KAAK;AAAA,IACb;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,qBAAqB,UAAU;;AAC7B,eAAK,WAAL,mBAAa,UAAU,OAAO,YAAY;AAC1C,SAAK,gBAAgB,YAAY,QAAQ;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQE,yBAAyB;;AACvB,QAAI,KAAK,MAAM;AACb,WAAK,UAAU,aAAa,KAAK,KAAK;AACtC,iBAAK,SAAL,mBAAW,iBAAiB,UAAU,MAAM;AAC1C,aAAK,SAAU;AACf,aAAK,oBAAqB;AAAA,MAClC;AAAA,IACA;AAAA,EACA;AACA;AA1QE,cADW,uBACJ,kBAAiB;"}
package/dist/light.css CHANGED
@@ -392,7 +392,7 @@
392
392
  --wje-input-label-display: block;
393
393
  --wje-input-label-margin: 0;
394
394
  --wje-input-label-padding: 0;
395
- --wje-input-label-line-height: 21px;
395
+ --wje-input-label-line-height: var(--wje-line-height-normal);
396
396
  --wje-input-label-font-size: var(--wje-font-size);
397
397
  --wje-input-required-symbol: '*';
398
398
 
@@ -96,6 +96,11 @@ export class FormAssociatedElement extends WJElement {
96
96
  * @returns {void} This method does not return any value.
97
97
  */
98
98
  showInvalidMessage(): void;
99
+ /**
100
+ * Checks the validity of the input by invoking custom validation logic
101
+ * and then verifying against internal validation rules.
102
+ * @returns {boolean} Returns true if the input is valid according to both custom validation and internal validation rules, otherwise false.
103
+ */
99
104
  checkValidity(): boolean;
100
105
  /**
101
106
  * Callback to handle the reset action for a form.
@@ -64,11 +64,6 @@ export class Select extends FormAssociatedElement {
64
64
  * @description A reference to the input element, initially null.
65
65
  */
66
66
  input: HTMLElement | null;
67
- /**
68
- * @type {HTMLElement|null}
69
- * @description A reference to the options wrapper element, initially null.
70
- */
71
- optionsWrapper: HTMLElement | null;
72
67
  /**
73
68
  * @type {HTMLElement|null}
74
69
  * @description A reference to the chips element, initially null.
@@ -85,7 +80,6 @@ export class Select extends FormAssociatedElement {
85
80
  */
86
81
  list: HTMLElement | null;
87
82
  _value: any[];
88
- _selected: any[];
89
83
  _selectedOptions: any[];
90
84
  /**
91
85
  * An object representing component dependencies with their respective classes.
@@ -112,26 +106,6 @@ export class Select extends FormAssociatedElement {
112
106
  'wje-options': typeof Options;
113
107
  'wje-checkbox': typeof Checkbox;
114
108
  };
115
- /**
116
- * Sets the label value.
117
- * @param {Array} value The selected value to set.
118
- */
119
- set selected(value: any[]);
120
- /**
121
- * Returns the selected value.
122
- * @returns {Array} The selected value.
123
- */
124
- get selected(): any[];
125
- /**
126
- * Sets the `validate-on-change` attribute on the element. When the attribute is present, it typically indicates that validation should occur when the value of the input changes.
127
- * @param {boolean} value A boolean indicating whether to enable or disable the `validate-on-change` attribute.
128
- */
129
- set validateOnChange(value: boolean);
130
- /**
131
- * Getter for the validateOnChange attribute.
132
- * @returns {boolean} Whether the attribute is present.
133
- */
134
- get validateOnChange(): boolean;
135
109
  /**
136
110
  * Sets the maximum number of options allowed.
137
111
  * @param { number | object} value The value to set as the maximum number of options.
@@ -231,79 +205,80 @@ export class Select extends FormAssociatedElement {
231
205
  */
232
206
  draw(): DocumentFragment;
233
207
  findEl: HTMLElement;
208
+ displayInput: HTMLInputElement;
234
209
  /**
235
- * Performs actions and binds events after the component's markup and state are initialized.
236
- * Actions include setting up event listeners, managing option elements, handling focus and blur behaviors,
237
- * synchronizing the selected options, and managing a find functionality for filtering options.
238
- * @returns {void} Does not return a value. The method operates by updating the state and behavior of the component.
210
+ * Executes post-render logic for the custom element.
211
+ * This includes validation, event listener registration, managing custom attributes, and
212
+ * handling options initialization for the component.
213
+ * @returns {void} This method does not return any value.
239
214
  */
240
215
  afterDraw(): void;
241
216
  pristine: boolean;
242
217
  /**
243
- * Handles the option change event.
244
- * @param {Event} e The event.
218
+ * Handles the change event for an option element within a select-like component.
219
+ * This method processes user interactions with options and updates the state of the component,
220
+ * including selection management, validation, and UI updates. Behavior differs based on
221
+ * whether the component supports multiple selections.
222
+ * Key functionality:
223
+ * - Prevents the default behavior, event propagation, and immediate propagation of the event.
224
+ * - Retrieves all options within the component.
225
+ * - If the component doesn't support multiple selection:
226
+ * - Marks only the clicked option as selected and deselects others.
227
+ * - Hides the option popup.
228
+ * - If the component supports multiple selection:
229
+ * - Processes the clicked option without deselecting others.
230
+ * - Updates the selected options and triggers validation.
231
+ * - Marks the form state as non-pristine.
232
+ * - Propagates the validation state to other relevant parts of the component or system.
233
+ * @param {Event} e The event object representing the option change interaction.
245
234
  */
246
235
  optionChange: (e: Event) => void;
247
236
  /**
248
- * Handles the selection and deselection of an option element.
249
- * @param {HTMLElement} option The option element that was clicked.
250
- * @param {boolean} [multiple] Indicates whether multiple selection is allowed.
237
+ * Handles the logic for processing the selection state of a clicked option element.
238
+ * @function processClickedOption
239
+ * @param {Element} option The option element that is clicked.
240
+ * @param {boolean} [multiple] A Boolean indicating whether multiple options can be selected. Defaults to false.
241
+ * Changes the selected state of the passed option and updates the selected options list.
242
+ * Checks if the option already has a "selected" attribute, toggles its state,
243
+ * and updates the internal selected options.
251
244
  */
252
- processClickedOption: (option: HTMLElement, multiple?: boolean) => void;
253
- /**
254
- * Filters out a specified option from the `selectedOptions` array.
255
- * This function removes an option from the `selectedOptions` array if its value
256
- * matches the value of the option provided as an argument. It allows for dynamically
257
- * updating the selected options by excluding the specified option.
258
- * @param {object} option The option to be removed from the `selectedOptions` array.
259
- * Should be an object containing a `value` property that is compared to the
260
- * `value` property of objects in the `selectedOptions` array.
261
- */
262
- filterOutOption: (option: object) => void;
245
+ processClickedOption: (option: Element, multiple?: boolean) => void;
263
246
  /**
264
247
  * Returns all the options as HTML.
265
248
  * @returns {NodeList} The options as HTML.
266
249
  */
267
250
  getAllOptions(): NodeList;
268
251
  /**
269
- * Handles the selection change.
270
- * @param {Element[]} options The option that changed.
271
- * @param {number} length The length of the selected options.
252
+ * Handles changes in the selection for a component, updating internal values, input fields,
253
+ * and visual presentation (like chips or slots) as per the given selection options.
254
+ * @param {Array|null} options The collection of selected option elements. If null, no options are selected.
255
+ * @param {number} length The total number of selected options.
256
+ * @returns {void}
272
257
  */
273
- selectionChanged(options?: Element[], length?: number): void;
258
+ selectionChanged(options?: any[] | null, length?: number): void;
274
259
  /**
275
- * Updates the selected options and their corresponding chips.
276
- * @param {boolean} [silence] Determines whether to suppress the "wje-select:change" event.
277
- * @returns {void}
278
- * @description
279
- * This method fetches the currently selected options and updates the `selectedOptions` array.
280
- * It clears and rebuilds the chips representing the selected items in the UI.
281
- * If the number of selected options reaches the maximum allowed (`maxOptions`), it stops updating the counter.
282
- * Optionally, it dispatches a custom event when the selection changes unless `silence` is set to `true`.
283
- * //@fires wje-select:change - Dispatched when the selection changes, unless `silence` is `true`.
284
- * @example
285
- * // Call the method and allow event dispatch
286
- * selections();
287
- * @example
288
- * // Call the method without dispatching the event
289
- * selections(true);
260
+ * Handles the logic for updating selections based on the current selected options,
261
+ * updating chips content, and dispatching change events if necessary.
262
+ * @param {boolean} [silence] If true, suppresses the dispatch of a custom change event.
263
+ * @returns {void} This method does not return a value.
290
264
  */
291
265
  selections(silence?: boolean): void;
292
266
  /**
293
- * Manages the display of a counter element to indicate the number of items exceeding the maximum allowed options.
294
- * - If the number of selected items equals the maximum allowed, the counter element is removed.
295
- * - If the counter element doesn't exist and the number of items exceeds the maximum, it is created and updated.
267
+ * Updates the counter element to reflect the current state of selected values relative to the maximum allowed options.
268
+ * If the maximum options are selected, the counter element is removed. If it does not already exist and needs to be displayed, it is created.
269
+ * @returns {void} Does not return a value.
296
270
  */
297
271
  counter(): void;
298
272
  /**
299
- * Returns a chip element.
300
- * @param {Element} option The option to get the chip for.
301
- * @returns {Element} The chip element.
273
+ * Creates and returns a chip element with specified properties and a label.
274
+ * @param {object} option The configuration object for the chip. Typically includes properties such as value and textContent to set up the chip's label and data.
275
+ * @returns {HTMLElement} The newly created chip element with a label and default properties.
302
276
  */
303
- getChip(option: Element): Element;
277
+ getChip(option: object): HTMLElement;
304
278
  /**
305
- * Handles the chip remove event.
306
- * @param {Event} e The event.
279
+ * Handles the removal of a chip element from the DOM and updates the related state.
280
+ * @param {Event} e The event object triggered by the chip removal action.
281
+ * The target of the event is expected to be the chip element itself.
307
282
  */
308
283
  removeChip: (e: Event) => void;
309
284
  /**
@@ -325,44 +300,59 @@ export class Select extends FormAssociatedElement {
325
300
  */
326
301
  htmlSelectedItem(item: any): any;
327
302
  /**
328
- * Adds an option to the select element.
329
- * @param {any} optionData The data for the option to be added.
330
- * @param {boolean} [silent] Whether to suppress any events triggered by the addition of the option.
331
- * @param {object} [map] The mapping object specifying the properties of the option data to be used for the value and text of the option.
303
+ * Adds a new option to the component.
304
+ * @param {object} optionData The data used to create the new option.
305
+ * @param {boolean} [silent] Whether the addition should trigger events or not.
306
+ * @param {object} [map] Mapping of keys to identify value and text in the optionData.
307
+ * @param {string} [map.value] The key in optionData that represents the value of the option.
308
+ * @param {string} [map.text] The key in optionData that represents the text of the option.
309
+ * @returns {void}
332
310
  */
333
- addOption(optionData: any, silent?: boolean, map?: object): void;
334
- /**
335
- * Adds options to the select element.
336
- * @param {Array | object} optionsData The options data to be added. Can be an array of objects or a single object.
337
- * @param {boolean} [silent] Indicates whether to trigger events when adding options. Default is false.
338
- * @param {object} [map] The mapping object that specifies the properties of the options data object. Default is { value: "value", text: "text" }.
311
+ addOption(optionData: object, silent?: boolean, map?: {
312
+ value?: string;
313
+ text?: string;
314
+ }): void;
315
+ /**
316
+ * Adds one or more options to a collection. If the input is an array, it adds each option within the array.
317
+ * Otherwise, it adds a single option.
318
+ * @param {Array | object} optionsData The data representing the options to be added. It can be a single object or an array of objects.
319
+ * @param {boolean} [silent] Optional flag to determine if events or notifications should be suppressed while adding options.
320
+ * @param {object} [map] An optional mapping object specifying how to map data properties to value and text for the options.
321
+ * @param {string} [map.value] The property in the optionsData that represents the value of the option.
322
+ * @param {string} [map.text] The property in the optionsData that represents the text of the option.
323
+ * @returns {void}
339
324
  */
340
- addOptions(optionsData: any[] | object, silent?: boolean, map?: object): void;
325
+ addOptions(optionsData: any[] | object, silent?: boolean, map?: {
326
+ value?: string;
327
+ text?: string;
328
+ }): void;
341
329
  /**
342
- * Selects an option with the specified value.
330
+ * Selects an option from the available options within the component.
343
331
  * @param {string} value The value of the option to be selected.
344
- * @param {boolean} [silent] Whether to suppress firing events.
332
+ * @param {boolean} [silent] Determines whether the selection should trigger notification or updates. Defaults to false.
333
+ * @returns {void} Does not return a value.
345
334
  */
346
335
  selectOption(value: string, silent?: boolean): void;
347
336
  /**
348
- * Selects one or multiple options in the select element.
349
- * @param {Array|any} values The value(s) of the option(s) to be selected.
350
- * @param {boolean} [silent] Whether to trigger the change event or not.
337
+ * Selects multiple options based on the provided values. If a single value is provided, it selects that option.
338
+ * If an array of values is provided, it iterates through the array and selects each option.
339
+ * @param {any|any[]} values A single value or an array of values to be selected.
340
+ * @param {boolean} [silent] Determines whether the selection action should occur silently without triggering other side effects or events.
341
+ * @returns {void} This method does not return a value.
351
342
  */
352
- selectOptions(values: any[] | any, silent?: boolean): void;
343
+ selectOptions(values: any | any[], silent?: boolean): void;
353
344
  /**
354
- * Clones and appends an icon from a template with slot "check" to the given option element.
355
- * @param {HTMLElement} option The target option element where the "check" icon will be added.
356
- * @returns {void}
345
+ * Clones and appends an icon with the "check" slot to the specified option element.
346
+ * @param {HTMLElement} option The target HTML element to which the cloned "check" icon will be appended.
347
+ * @returns {void} This method does not return a value, but it modifies the DOM by appending a cloned "check" icon to the provided option element.
357
348
  */
358
349
  optionCheckSlot(option: HTMLElement): void;
359
350
  /**
360
- * Checks if all elements in the `elements` array are present in the `options` array based on their `option` property.
361
- * @param {Array} elements The array of elements to check. Each element should have an `option` property.
362
- * @param {Array} options The array of options to verify against.
363
- * @returns {boolean} Returns true if all elements in the `elements` array are found within the `options` array, otherwise returns false.
351
+ * Clears all selected options and resets selections.
352
+ * The method ensures that all options are deselected, updates the internal state, validates the selections,
353
+ * propagates the validation status, and indicates invalid state if necessary.
354
+ * @returns {void} No value is returned by this method.
364
355
  */
365
- areAllElementsInOptions(elements: any[], options: any[]): boolean;
366
356
  clearSelections(): void;
367
357
  #private;
368
358
  }
@@ -382,7 +382,6 @@ class Button extends WJElement {
382
382
  });
383
383
  if (this.type === "submit") {
384
384
  event.addListener(this, "click", "wje-button:submit", () => {
385
- console.log("submit", this.internals_.form);
386
385
  event.dispatchCustomEvent(this.internals_.form, "submit", {});
387
386
  });
388
387
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wje-button.js","sources":["../packages/wje-button/button.element.js","../packages/wje-button/button.js"],"sourcesContent":["import { bindRouterLinks } from 'slick-router/middlewares/router-links.js';\n\nimport { bool } from '../utils/utils.js';\nimport { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport Icon from '../wje-icon/icon.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents Button element, extending the WJElement class.\n * @documentation https://elements.webjet.sk/components/button\n * @status stable\n * @augments WJElement\n * @dependency wje-icon\n * @slot - The button main content.\n * @slot icon - The button icon.\n * @slot caret - The button caret.\n * @slot start - The button start slot.\n * @slot end - The button end slot.\n * @slot toggle - The button toggle slot.\n * @csspart native - The component's native wrapper.\n * @cssproperty [--wje-button-background-color=transparent] - Background color of the component;\n * @cssproperty [--wje-button-border-color=--wje-color-contrast-4] - Border color of the component;\n * @cssproperty [--wje-button-color=--wje-color-contrast-11] - Color of the component;\n * @cssproperty [--wje-button-border-radius=--wje-border-radius-medium] - Border radius of the component;\n * @cssproperty [--wje-button-border-width=1px] - Border width of the component;\n * @cssproperty [--wje-button-border-style=solid] - Border style of the component;\n * @cssproperty [--wje-button-border-color=--wje-color-contrast-1] - Border color of the component;\n * @cssproperty [--wje-button-margin-inline=0] - Margin inline of the component;\n */\n\nexport default class Button extends WJElement {\n /**\n * Button constructor method.\n * @class\n */\n constructor() {\n super();\n\n this.internals_ = this.attachInternals();\n }\n\n /**\n * Dependencies of the Button element.\n * @type {object}\n */\n dependencies = {\n 'wje-icon': Icon,\n };\n\n /**\n * Properties of the element Button.\n * @param value\n */\n set color(value) {\n this.setAttribute('color', value || 'default');\n }\n\n /**\n * Get color of the Button element.\n * @returns {string|string}\n */\n get color() {\n return this.getAttribute('color') || 'default';\n }\n\n /**\n * Set variant of the Button element.\n * @param value\n */\n set caret(value) {\n this.setAttribute('caret', value);\n }\n\n /**\n * Get variant of the Button element.\n * @returns {boolean}\n */\n get caret() {\n return this.hasAttribute('caret');\n }\n\n /**\n * Sets the 'round' attribute on the element. If the value is true, the attribute is added;\n * otherwise, it is removed from the element.\n * @param {boolean} value A boolean indicating whether to set or remove the 'round' attribute.\n */\n set round(value) {\n if (value) {\n this.setAttribute('round', '');\n } else {\n this.removeAttribute('round');\n }\n }\n\n /**\n * Retrieves the value of the 'round' attribute as a boolean.\n * Checks if the 'round' attribute is present on the element.\n * @returns {boolean} True if the 'round' attribute exists, otherwise false.\n */\n get round() {\n return this.hasAttribute('round');\n }\n\n /**\n * Set variant of the Button element.\n * @param value\n */\n set tooltip(value) {\n this.setAttribute('tooltip', value);\n }\n\n /**\n * Get variant of the Button element.\n * @returns {boolean}\n */\n get tooltip() {\n return this.hasAttribute('tooltip');\n }\n\n /**\n * Set variant of the Button element.\n * @param value\n */\n set dialog(value) {\n this.setAttribute('dialog', value);\n }\n\n /**\n * Get variant of the Button element.\n * @returns {string|object}\n */\n get dialog() {\n return this.getAttribute('dialog');\n }\n\n /**\n * Set active state of the Button element.\n * @param {boolean} value The value to set\n */\n set active(value) {\n this.setAttribute('active', '');\n }\n\n /**\n * Get active state of the Button element.\n * @returns {boolean} active - The active state\n */\n get active() {\n return this.hasAttribute('active');\n }\n\n /**\n * Set disabled state of the Button element.\n * @param {boolean} value The value to set\n */\n set disabled(value) {\n this.removeAttribute('disabled');\n\n if (value) {\n this.setAttribute('disabled', '');\n }\n }\n\n /**\n * Get disabled state of the Button element.\n * @returns {boolean} disabled - The disabled state\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n /**\n * Set fill of the Button element.\n * @param {string} value The value to set\n */\n set fill(value) {\n this.setAttribute('fill', value);\n }\n\n /**\n * Get fill of the Button element.\n * @returns {string} fill - The fill value\n */\n get fill() {\n return this.getAttribute('fill') || 'solid';\n }\n\n /**\n * Set outline state of the Button element.\n * @param {boolean} value The value to set\n */\n set outline(value) {\n this.setAttribute('outline', '');\n }\n\n /**\n * Get outline state of the Button element.\n * @returns {boolean} outline - The outline state\n */\n get outline() {\n return this.hasAttribute('outline');\n }\n\n /**\n * Set stop propagation state of the Button element.\n * @param {boolean} value The value to set\n */\n set stopPropagation(value) {\n this.setAttribute('stop-propagation', bool(value));\n }\n\n /**\n * Get stop propagation state of the Button element.\n * @returns {boolean} stopPropagation - The stop propagation state\n */\n get stopPropagation() {\n return bool(this.getAttribute('stop-propagation'));\n }\n\n /**\n * Sets the value of the custom event attribute.\n * @param {string} value The value to be assigned to the custom event attribute.\n */\n set customEvent(value) {\n this.setAttribute('custom-event', value);\n }\n\n /**\n * Retrieves the value of the 'custom-event' attribute from the element.\n * @returns {string | null} The value of the 'custom-event' attribute, or null if the attribute is not set.\n */\n get customEvent() {\n return this.getAttribute('custom-event');\n }\n\n /**\n * Retrieves a mapped object containing custom event parameters extracted from the element's attributes.\n * Attributes considered are those that begin with 'custom-event-'.\n * The mapped object's keys are derived by removing the 'custom-event-' prefix from the attribute names,\n * and the values are the corresponding attribute values.\n * @returns {object} An object containing key-value pairs of custom event parameters.\n */\n get customEventParameters() {\n const attributes = Array.from(this.attributes).filter((attr) => attr.name.startsWith('custom-event-'));\n\n return attributes.reduce((acc, attr) => {\n const key = attr.name.replace('custom-event-', '');\n acc[key] = attr.value;\n\n return acc;\n }, {});\n }\n\n /**\n * Class name for the Button element\n * @type {string}\n */\n className = 'Button';\n\n /**\n * Get CSS stylesheet for the Button element.\n * @static\n * @returns {CSSStyleSheet} styles - The CSS stylesheet for the Button element.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Get observed attributes for the Button element.\n * @static\n * @returns {Array<string>} observedAttributes - The observed attributes array for the Button element.\n */\n static get observedAttributes() {\n return ['disabled', 'color'];\n }\n\n /**\n * @summary A static property that indicates whether the custom element is form-associated or not.\n * Form-associated custom elements are elements that can participate in form submission.\n * @type {boolean}\n */\n static formAssociated = true;\n\n /**\n * @summary Callback function that is called when the custom element is associated with a form.\n * This function sets the internal `_form` property to the associated form.\n * @param {HTMLFormElement} form The form the custom element is associated with.\n */\n formAssociatedCallback(form) {\n this._form = form;\n }\n\n /**\n * @summary Callback function that is called when the form-associated state of the custom element changes.\n * This function updates the 'disabled' attribute of the element based on the new state.\n * @param {boolean} disabled The new form-associated state.\n */\n formDisabledCallback(disabled) {\n if (disabled) {\n this.setAttribute('disabled', '');\n } else {\n this.removeAttribute('disabled');\n }\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draw method for the Button element.\n * @returns {object} fragment - The document fragment containing the drawn element.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement(this.hasAttribute('href') ? 'a' : 'button');\n if (this.hasAttribute('href')) {\n native.setAttribute('href', this.getAttribute('href'));\n } else {\n if (this.type === 'submit') {\n native.setAttribute('type', 'submit');\n }\n }\n\n native.classList.add('native-button');\n native.setAttribute('part', 'native');\n\n this.classList.remove('wje-button-disabled');\n\n if (this.disabled) native.classList.add('wje-button-disabled');\n\n if (this.variant) native.classList.add('wje-button-' + this.variant);\n\n if (this.hasAttribute('round')) native.classList.add('wje-button-round');\n\n if (this.hasAttribute('circle')) native.classList.add('wje-button-circle');\n\n if (this.outline) native.classList.add('wje-outline');\n\n if (this.fill) native.classList.add('wje-button-' + this.fill);\n\n if (this.size) native.classList.add('wje-button-' + this.size);\n\n if (\n (this.querySelectorAll('[slot=caret]').length < 1 && this.hasAttribute('caret')) ||\n this.hasAttribute('only-caret')\n ) {\n let i = document.createElement('wje-icon');\n i.style.setProperty('--wje-icon-size', '14px');\n i.setAttribute('slot', 'caret');\n i.setAttribute('name', 'chevron-down');\n i.setAttribute('part', 'caret');\n\n this.appendChild(i);\n }\n\n if (this.active) {\n this.classList.add('wje-active');\n let i = document.createElement('wje-icon');\n i.setAttribute('name', 'check');\n\n this.appendChild(i);\n }\n\n native.classList.add('wje-color-' + this.color, 'wje-color');\n\n let span = document.createElement('span');\n span.setAttribute('part', 'inner');\n span.classList.add('button-inner');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'icon-only');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n slot.setAttribute('name', 'start');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n slot.setAttribute('name', 'end');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n slot.setAttribute('name', 'caret');\n span.appendChild(slot);\n\n this.hasToggle = WjElementUtils.hasSlot(this, 'toggle');\n\n if (this.hasToggle) {\n this.slotToggle = document.createElement('slot');\n this.slotToggle.setAttribute('name', 'toggle');\n\n span.appendChild(this.slotToggle);\n }\n\n native.appendChild(span);\n\n if (this.tooltip) {\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('content', this.getAttribute('tooltip'));\n tooltip.setAttribute('placement', this.getAttribute('tooltip-placement') || 'top');\n tooltip.appendChild(native);\n\n fragment.appendChild(tooltip);\n } else {\n fragment.appendChild(native);\n }\n\n return fragment;\n }\n\n /**\n * After draw method for the Button element.\n */\n afterDraw() {\n if (this.hasAttribute('route')) {\n this.unbindRouterLinks = bindRouterLinks(this.parentElement, { selector: false });\n }\n\n // nastavenie toggle podla atributu, ak nie je nastaveny, tak sa zobrazi vzdy prvy element\n if (this.hasToggle) {\n if (this.toggle === 'off') {\n this.slotToggle.assignedNodes()[1].classList.add('show');\n this.setAttribute('value', 'off');\n } else {\n this.slotToggle.assignedNodes()[0].classList.add('show');\n this.setAttribute('value', 'on');\n }\n }\n\n if (this.hasAttribute('custom-event')) {\n event.addListener(this, 'click', null, this.#populateCustomEvent);\n }\n\n if (this.hasAttribute('dialog')) {\n event.addListener(this, 'click', null, this.eventDialogOpen);\n } else {\n event.addListener(this, 'click', 'wje-button:click', null); // { stopPropagation: this.stopPropagation } - zrusene kvoli dropdown kde som nevedel odchytit event click\n }\n\n if (this.hasToggle)\n event.addListener(this, 'click', 'wje-button:toggle', this.toggleStates, {\n stopPropagation: this.stopPropagation,\n });\n\n if (this.type === 'submit') {\n event.addListener(this, 'click', 'wje-button:submit', () => {\n console.log('submit', this.internals_.form);\n event.dispatchCustomEvent(this.internals_.form, 'submit', {});\n });\n }\n\n if (this.type === 'reset') {\n event.addListener(this, 'click', 'wje-button:reset', () => {\n this.internals_.form.reset();\n });\n }\n }\n\n /**\n * Before disconnect method for the Button element.\n */\n beforeDisconnect() {\n // remove all events from the button\n event.removeListener(this, 'click', null, this.eventDialogOpen);\n event.removeListener(this, 'click', 'wje-button:click', null);\n event.removeListener(this, 'click', 'wje-button:toggle', this.toggleStates);\n event.removeListener(this, 'click', null, this.#populateCustomEvent);\n event.removeListener(this, 'click', 'wje-button:submit', null);\n event.removeListener(this, 'click', 'wje-button:reset', null);\n\n this.removeEventListener('click', this.eventDialogOpen);\n this.unbindRouterLinks?.();\n }\n\n /**\n * Event dialog open method for the Button element.\n * @param {Event} e The event object\n */\n eventDialogOpen = (e) => {\n event.dispatchCustomEvent(this, this.dialog);\n };\n\n /**\n * Toggle states method for the Button element.\n */\n toggleStates = () => {\n const nodes = this.slotToggle.assignedNodes().filter((node) => node.nodeType === Node.ELEMENT_NODE);\n\n nodes.forEach((node, index) => {\n if (node.classList.contains('show')) {\n node.classList.remove('show');\n } else {\n node.classList.add('show');\n this.setAttribute('value', index === 0 ? 'on' : 'off');\n }\n });\n }\n\n /**\n * Dispatches a custom event with specified parameters.\n * This method uses the `customEvent` and `customEventParameters` properties\n * to create and dispatch a `CustomEvent`. The event is configured to be\n * composed and bubbles up through the DOM.\n * @returns {void} This method does not return a value.\n */\n #populateCustomEvent() {\n this.dispatchEvent(\n new CustomEvent(this.customEvent, { detail: this.customEventParameters, composed: true, bubbles: true })\n );\n }\n}\n","import Button from './button.element.js';\n\nexport default Button;\n\nButton.define('wje-button', Button);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA8Be,MAAM,eAAe,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1C,cAAc;AACV,UAAO;AANA;AAeX;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACX,YAAY;AAAA,IACf;AAkND;AAAA;AAAA;AAAA;AAAA,qCAAY;AAsOZ;AAAA;AAAA;AAAA;AAAA,2CAAkB,CAAC,MAAM;AACrB,YAAM,oBAAoB,MAAM,KAAK,MAAM;AAAA,IAC9C;AAKD;AAAA;AAAA;AAAA,wCAAe,MAAM;AACjB,YAAM,QAAQ,KAAK,WAAW,cAAa,EAAG,OAAO,CAAC,SAAS,KAAK,aAAa,KAAK,YAAY;AAElG,YAAM,QAAQ,CAAC,MAAM,UAAU;AAC3B,YAAI,KAAK,UAAU,SAAS,MAAM,GAAG;AACjC,eAAK,UAAU,OAAO,MAAM;AAAA,QAC5C,OAAmB;AACH,eAAK,UAAU,IAAI,MAAM;AACzB,eAAK,aAAa,SAAS,UAAU,IAAI,OAAO,KAAK;AAAA,QACrE;AAAA,MACA,CAAS;AAAA,IACT;AAndQ,SAAK,aAAa,KAAK,gBAAiB;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAcI,IAAI,MAAM,OAAO;AACb,SAAK,aAAa,SAAS,SAAS,SAAS;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;A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K,SAAS,UAAU;AACxB,YAAM,YAAY,MAAM,SAAS,qBAAqB,MAAM;AACxD,gBAAQ,IAAI,UAAU,KAAK,WAAW,IAAI;AAC1C,cAAM,oBAAoB,KAAK,WAAW,MAAM,UAAU,EAAE;AAAA,MAC5E,CAAa;AAAA,IACb;AAEQ,QAAI,KAAK,SAAS,SAAS;AACvB,YAAM,YAAY,MAAM,SAAS,oBAAoB,MAAM;AACvD,aAAK,WAAW,KAAK,MAAO;AAAA,MAC5C,CAAa;AAAA,IACb;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKI,mBAAmB;;AAEf,UAAM,eAAe,MAAM,SAAS,MAAM,KAAK,eAAe;AAC9D,UAAM,eAAe,MAAM,SAAS,oBAAoB,IAAI;AAC5D,UAAM,eAAe,MAAM,SAAS,qBAAqB,KAAK,YAAY;AAC1E,UAAM,eAAe,MAAM,SAAS,MAAM,sBAAK,0CAAoB;AACnE,UAAM,eAAe,MAAM,SAAS,qBAAqB,IAAI;AAC7D,UAAM,eAAe,MAAM,SAAS,oBAAoB,IAAI;AAE5D,SAAK,oBAAoB,SAAS,KAAK,eAAe;AACtD,eAAK,sBAAL;AAAA,EACR;AAsCA;AAzee;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoeX,yBAAoB,WAAG;AACnB,OAAK;AAAA,IACH,IAAI,YAAY,KAAK,aAAa,EAAE,QAAQ,KAAK,uBAAuB,UAAU,MAAM,SAAS,KAAM,CAAA;AAAA,EACxG;AACT;AAAA;AAAA;AAAA;AAAA;AAAA;AA5OI,cA5PiB,QA4PV,kBAAiB;ACtR5B,OAAO,OAAO,cAAc,MAAM;"}
1
+ {"version":3,"file":"wje-button.js","sources":["../packages/wje-button/button.element.js","../packages/wje-button/button.js"],"sourcesContent":["import { bindRouterLinks } from 'slick-router/middlewares/router-links.js';\n\nimport { bool } from '../utils/utils.js';\nimport { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport Icon from '../wje-icon/icon.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary This class represents Button element, extending the WJElement class.\n * @documentation https://elements.webjet.sk/components/button\n * @status stable\n * @augments WJElement\n * @dependency wje-icon\n * @slot - The button main content.\n * @slot icon - The button icon.\n * @slot caret - The button caret.\n * @slot start - The button start slot.\n * @slot end - The button end slot.\n * @slot toggle - The button toggle slot.\n * @csspart native - The component's native wrapper.\n * @cssproperty [--wje-button-background-color=transparent] - Background color of the component;\n * @cssproperty [--wje-button-border-color=--wje-color-contrast-4] - Border color of the component;\n * @cssproperty [--wje-button-color=--wje-color-contrast-11] - Color of the component;\n * @cssproperty [--wje-button-border-radius=--wje-border-radius-medium] - Border radius of the component;\n * @cssproperty [--wje-button-border-width=1px] - Border width of the component;\n * @cssproperty [--wje-button-border-style=solid] - Border style of the component;\n * @cssproperty [--wje-button-border-color=--wje-color-contrast-1] - Border color of the component;\n * @cssproperty [--wje-button-margin-inline=0] - Margin inline of the component;\n */\n\nexport default class Button extends WJElement {\n /**\n * Button constructor method.\n * @class\n */\n constructor() {\n super();\n\n this.internals_ = this.attachInternals();\n }\n\n /**\n * Dependencies of the Button element.\n * @type {object}\n */\n dependencies = {\n 'wje-icon': Icon,\n };\n\n /**\n * Properties of the element Button.\n * @param value\n */\n set color(value) {\n this.setAttribute('color', value || 'default');\n }\n\n /**\n * Get color of the Button element.\n * @returns {string|string}\n */\n get color() {\n return this.getAttribute('color') || 'default';\n }\n\n /**\n * Set variant of the Button element.\n * @param value\n */\n set caret(value) {\n this.setAttribute('caret', value);\n }\n\n /**\n * Get variant of the Button element.\n * @returns {boolean}\n */\n get caret() {\n return this.hasAttribute('caret');\n }\n\n /**\n * Sets the 'round' attribute on the element. If the value is true, the attribute is added;\n * otherwise, it is removed from the element.\n * @param {boolean} value A boolean indicating whether to set or remove the 'round' attribute.\n */\n set round(value) {\n if (value) {\n this.setAttribute('round', '');\n } else {\n this.removeAttribute('round');\n }\n }\n\n /**\n * Retrieves the value of the 'round' attribute as a boolean.\n * Checks if the 'round' attribute is present on the element.\n * @returns {boolean} True if the 'round' attribute exists, otherwise false.\n */\n get round() {\n return this.hasAttribute('round');\n }\n\n /**\n * Set variant of the Button element.\n * @param value\n */\n set tooltip(value) {\n this.setAttribute('tooltip', value);\n }\n\n /**\n * Get variant of the Button element.\n * @returns {boolean}\n */\n get tooltip() {\n return this.hasAttribute('tooltip');\n }\n\n /**\n * Set variant of the Button element.\n * @param value\n */\n set dialog(value) {\n this.setAttribute('dialog', value);\n }\n\n /**\n * Get variant of the Button element.\n * @returns {string|object}\n */\n get dialog() {\n return this.getAttribute('dialog');\n }\n\n /**\n * Set active state of the Button element.\n * @param {boolean} value The value to set\n */\n set active(value) {\n this.setAttribute('active', '');\n }\n\n /**\n * Get active state of the Button element.\n * @returns {boolean} active - The active state\n */\n get active() {\n return this.hasAttribute('active');\n }\n\n /**\n * Set disabled state of the Button element.\n * @param {boolean} value The value to set\n */\n set disabled(value) {\n this.removeAttribute('disabled');\n\n if (value) {\n this.setAttribute('disabled', '');\n }\n }\n\n /**\n * Get disabled state of the Button element.\n * @returns {boolean} disabled - The disabled state\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n /**\n * Set fill of the Button element.\n * @param {string} value The value to set\n */\n set fill(value) {\n this.setAttribute('fill', value);\n }\n\n /**\n * Get fill of the Button element.\n * @returns {string} fill - The fill value\n */\n get fill() {\n return this.getAttribute('fill') || 'solid';\n }\n\n /**\n * Set outline state of the Button element.\n * @param {boolean} value The value to set\n */\n set outline(value) {\n this.setAttribute('outline', '');\n }\n\n /**\n * Get outline state of the Button element.\n * @returns {boolean} outline - The outline state\n */\n get outline() {\n return this.hasAttribute('outline');\n }\n\n /**\n * Set stop propagation state of the Button element.\n * @param {boolean} value The value to set\n */\n set stopPropagation(value) {\n this.setAttribute('stop-propagation', bool(value));\n }\n\n /**\n * Get stop propagation state of the Button element.\n * @returns {boolean} stopPropagation - The stop propagation state\n */\n get stopPropagation() {\n return bool(this.getAttribute('stop-propagation'));\n }\n\n /**\n * Sets the value of the custom event attribute.\n * @param {string} value The value to be assigned to the custom event attribute.\n */\n set customEvent(value) {\n this.setAttribute('custom-event', value);\n }\n\n /**\n * Retrieves the value of the 'custom-event' attribute from the element.\n * @returns {string | null} The value of the 'custom-event' attribute, or null if the attribute is not set.\n */\n get customEvent() {\n return this.getAttribute('custom-event');\n }\n\n /**\n * Retrieves a mapped object containing custom event parameters extracted from the element's attributes.\n * Attributes considered are those that begin with 'custom-event-'.\n * The mapped object's keys are derived by removing the 'custom-event-' prefix from the attribute names,\n * and the values are the corresponding attribute values.\n * @returns {object} An object containing key-value pairs of custom event parameters.\n */\n get customEventParameters() {\n const attributes = Array.from(this.attributes).filter((attr) => attr.name.startsWith('custom-event-'));\n\n return attributes.reduce((acc, attr) => {\n const key = attr.name.replace('custom-event-', '');\n acc[key] = attr.value;\n\n return acc;\n }, {});\n }\n\n /**\n * Class name for the Button element\n * @type {string}\n */\n className = 'Button';\n\n /**\n * Get CSS stylesheet for the Button element.\n * @static\n * @returns {CSSStyleSheet} styles - The CSS stylesheet for the Button element.\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Get observed attributes for the Button element.\n * @static\n * @returns {Array<string>} observedAttributes - The observed attributes array for the Button element.\n */\n static get observedAttributes() {\n return ['disabled', 'color'];\n }\n\n /**\n * @summary A static property that indicates whether the custom element is form-associated or not.\n * Form-associated custom elements are elements that can participate in form submission.\n * @type {boolean}\n */\n static formAssociated = true;\n\n /**\n * @summary Callback function that is called when the custom element is associated with a form.\n * This function sets the internal `_form` property to the associated form.\n * @param {HTMLFormElement} form The form the custom element is associated with.\n */\n formAssociatedCallback(form) {\n this._form = form;\n }\n\n /**\n * @summary Callback function that is called when the form-associated state of the custom element changes.\n * This function updates the 'disabled' attribute of the element based on the new state.\n * @param {boolean} disabled The new form-associated state.\n */\n formDisabledCallback(disabled) {\n if (disabled) {\n this.setAttribute('disabled', '');\n } else {\n this.removeAttribute('disabled');\n }\n }\n\n /**\n * Setup attributes for the Button element.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draw method for the Button element.\n * @returns {object} fragment - The document fragment containing the drawn element.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement(this.hasAttribute('href') ? 'a' : 'button');\n if (this.hasAttribute('href')) {\n native.setAttribute('href', this.getAttribute('href'));\n } else {\n if (this.type === 'submit') {\n native.setAttribute('type', 'submit');\n }\n }\n\n native.classList.add('native-button');\n native.setAttribute('part', 'native');\n\n this.classList.remove('wje-button-disabled');\n\n if (this.disabled) native.classList.add('wje-button-disabled');\n\n if (this.variant) native.classList.add('wje-button-' + this.variant);\n\n if (this.hasAttribute('round')) native.classList.add('wje-button-round');\n\n if (this.hasAttribute('circle')) native.classList.add('wje-button-circle');\n\n if (this.outline) native.classList.add('wje-outline');\n\n if (this.fill) native.classList.add('wje-button-' + this.fill);\n\n if (this.size) native.classList.add('wje-button-' + this.size);\n\n if (\n (this.querySelectorAll('[slot=caret]').length < 1 && this.hasAttribute('caret')) ||\n this.hasAttribute('only-caret')\n ) {\n let i = document.createElement('wje-icon');\n i.style.setProperty('--wje-icon-size', '14px');\n i.setAttribute('slot', 'caret');\n i.setAttribute('name', 'chevron-down');\n i.setAttribute('part', 'caret');\n\n this.appendChild(i);\n }\n\n if (this.active) {\n this.classList.add('wje-active');\n let i = document.createElement('wje-icon');\n i.setAttribute('name', 'check');\n\n this.appendChild(i);\n }\n\n native.classList.add('wje-color-' + this.color, 'wje-color');\n\n let span = document.createElement('span');\n span.setAttribute('part', 'inner');\n span.classList.add('button-inner');\n\n let slot = document.createElement('slot');\n slot.setAttribute('name', 'icon-only');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n slot.setAttribute('name', 'start');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n slot.setAttribute('name', 'end');\n span.appendChild(slot);\n\n slot = document.createElement('slot');\n slot.setAttribute('name', 'caret');\n span.appendChild(slot);\n\n this.hasToggle = WjElementUtils.hasSlot(this, 'toggle');\n\n if (this.hasToggle) {\n this.slotToggle = document.createElement('slot');\n this.slotToggle.setAttribute('name', 'toggle');\n\n span.appendChild(this.slotToggle);\n }\n\n native.appendChild(span);\n\n if (this.tooltip) {\n let tooltip = document.createElement('wje-tooltip');\n tooltip.setAttribute('content', this.getAttribute('tooltip'));\n tooltip.setAttribute('placement', this.getAttribute('tooltip-placement') || 'top');\n tooltip.appendChild(native);\n\n fragment.appendChild(tooltip);\n } else {\n fragment.appendChild(native);\n }\n\n return fragment;\n }\n\n /**\n * After draw method for the Button element.\n */\n afterDraw() {\n if (this.hasAttribute('route')) {\n this.unbindRouterLinks = bindRouterLinks(this.parentElement, { selector: false });\n }\n\n // nastavenie toggle podla atributu, ak nie je nastaveny, tak sa zobrazi vzdy prvy element\n if (this.hasToggle) {\n if (this.toggle === 'off') {\n this.slotToggle.assignedNodes()[1].classList.add('show');\n this.setAttribute('value', 'off');\n } else {\n this.slotToggle.assignedNodes()[0].classList.add('show');\n this.setAttribute('value', 'on');\n }\n }\n\n if (this.hasAttribute('custom-event')) {\n event.addListener(this, 'click', null, this.#populateCustomEvent);\n }\n\n if (this.hasAttribute('dialog')) {\n event.addListener(this, 'click', null, this.eventDialogOpen);\n } else {\n event.addListener(this, 'click', 'wje-button:click', null); // { stopPropagation: this.stopPropagation } - zrusene kvoli dropdown kde som nevedel odchytit event click\n }\n\n if (this.hasToggle)\n event.addListener(this, 'click', 'wje-button:toggle', this.toggleStates, {\n stopPropagation: this.stopPropagation,\n });\n\n if (this.type === 'submit') {\n event.addListener(this, 'click', 'wje-button:submit', () => {\n event.dispatchCustomEvent(this.internals_.form, 'submit', {});\n });\n }\n\n if (this.type === 'reset') {\n event.addListener(this, 'click', 'wje-button:reset', () => {\n this.internals_.form.reset();\n });\n }\n }\n\n /**\n * Before disconnect method for the Button element.\n */\n beforeDisconnect() {\n // remove all events from the button\n event.removeListener(this, 'click', null, this.eventDialogOpen);\n event.removeListener(this, 'click', 'wje-button:click', null);\n event.removeListener(this, 'click', 'wje-button:toggle', this.toggleStates);\n event.removeListener(this, 'click', null, this.#populateCustomEvent);\n event.removeListener(this, 'click', 'wje-button:submit', null);\n event.removeListener(this, 'click', 'wje-button:reset', null);\n\n this.removeEventListener('click', this.eventDialogOpen);\n this.unbindRouterLinks?.();\n }\n\n /**\n * Event dialog open method for the Button element.\n * @param {Event} e The event object\n */\n eventDialogOpen = (e) => {\n event.dispatchCustomEvent(this, this.dialog);\n };\n\n /**\n * Toggle states method for the Button element.\n */\n toggleStates = () => {\n const nodes = this.slotToggle.assignedNodes().filter((node) => node.nodeType === Node.ELEMENT_NODE);\n\n nodes.forEach((node, index) => {\n if (node.classList.contains('show')) {\n node.classList.remove('show');\n } else {\n node.classList.add('show');\n this.setAttribute('value', index === 0 ? 'on' : 'off');\n }\n });\n }\n\n /**\n * Dispatches a custom event with specified parameters.\n * This method uses the `customEvent` and `customEventParameters` properties\n * to create and dispatch a `CustomEvent`. The event is configured to be\n * composed and bubbles up through the DOM.\n * @returns {void} This method does not return a value.\n */\n #populateCustomEvent() {\n this.dispatchEvent(\n new CustomEvent(this.customEvent, { detail: this.customEventParameters, composed: true, bubbles: true })\n );\n }\n}\n","import Button from './button.element.js';\n\nexport default Button;\n\nButton.define('wje-button', Button);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA8Be,MAAM,eAAe,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1C,cAAc;AACV,UAAO;AANA;AAeX;AAAA;AAAA;AAAA;AAAA,wCAAe;AAAA,MACX,YAAY;AAAA,IACf;AAkND;AAAA;AAAA;AAAA;AAAA,qCAAY;AAqOZ;AAAA;AAAA;AAAA;AAAA,2CAAkB,CAAC,MAAM;AACrB,YAAM,oBAAoB,MAAM,KAAK,MAAM;AAAA,IAC9C;AAKD;AAAA;AAAA;AAAA,wCAAe,MAAM;AACjB,YAAM,QAAQ,KAAK,WAAW,cAAa,EA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,OAAK;AAAA,IACH,IAAI,YAAY,KAAK,aAAa,EAAE,QAAQ,KAAK,uBAAuB,UAAU,MAAM,SAAS,KAAM,CAAA;AAAA,EACxG;AACT;AAAA;AAAA;AAAA;AAAA;AAAA;AA3OI,cA5PiB,QA4PV,kBAAiB;ACtR5B,OAAO,OAAO,cAAc,MAAM;"}
@@ -10,7 +10,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var _internalValue;
12
12
  import WJElement from "./wje-element.js";
13
- import { F as FormAssociatedElement } from "./form-associated-element-CaIxmEod.js";
13
+ import { F as FormAssociatedElement } from "./form-associated-element-o0UjvdUp.js";
14
14
  import { event } from "./event.js";
15
15
  const styles = "/*\n[ Checkbox ]\n*/\n\n:host {\n display: block;\n margin-top: var(--wje-checkbox-margin-top);\n margin-bottom: var(--wje-checkbox-margin-bottom);\n margin-inline: var(--wje-checkbox-margin-inline);\n line-height: 100%;\n padding-left: 0;\n\n label {\n display: flex;\n align-items: center;\n cursor: pointer;\n position: relative;\n padding-left: calc(var(--wje-checkbox-size) + 0.5rem);\n min-height: var(--wje-checkbox-size);\n margin-bottom: 0;\n &:before {\n content: '';\n position: absolute;\n width: var(--wje-checkbox-size);\n height: var(--wje-checkbox-size);\n left: 0;\n -webkit-box-sizing: inherit;\n box-sizing: border-box;\n background-color: var(--wje-color-contrast-0);\n border-width: 1px;\n border-style: solid;\n border-color: var(--wje-color-contrast-3);\n }\n }\n}\n\n.native-checkbox {\n label {\n &:hover {\n color: var(--wje-color-contrast-11);\n }\n\n &:before {\n border-radius: var(--wje-checkbox-border-radius);\n }\n }\n\n input[type='checkbox'] {\n position: absolute;\n margin: 0;\n z-index: -1;\n width: 16px;\n height: 16px;\n opacity: 0;\n display: none;\n & + label {\n &::after {\n content: '';\n position: absolute;\n left: 0;\n border-right: 0 solid transparent;\n border-bottom: 0 solid transparent;\n width: var(--wje-checkbox-size);\n height: var(--wje-checkbox-size);\n overflow: hidden;\n }\n }\n }\n\n input[type='checkbox']:checked + label::after {\n content: '';\n mask-image: var(--wje-checkbox-checkmark);\n mask-size: var(--wje-checkbox-size);\n background-color: var(--wje-color-primary-9);\n }\n\n /* Disabled */\n input[type='checkbox'][disabled] {\n & + label {\n cursor: not-allowed !important;\n color: var(--wje-color-contrast-8);\n opacity: 0.58;\n\n &:before {\n background: var(--wje-color-contrast-2);\n }\n &:after {\n background: transparent;\n }\n }\n }\n\n input[type='checkbox']:checked[disabled] {\n & + label {\n cursor: not-allowed !important;\n color: var(--wje-color-contrast-8);\n opacity: 0.58;\n\n &:before {\n background: var(--wje-color-contrast-2);\n }\n &:after {\n background: var(--wje-color-contrast-5);\n }\n }\n }\n\n /* Indeterminate */\n input[type='checkbox']:not(:checked):indeterminate {\n & + label {\n &:after {\n content: '';\n mask-image: var(--wje-checkbox-interminate);\n mask-size: var(--wje-checkbox-size);\n background-color: var(--wje-color-primary-9);\n }\n }\n }\n}\n\n:host([invalid]) {\n label{\n color: var(--wje-input-color-invalid);\n }\n}\n\nslot[name='error'] {\n display: none;\n}\n\n:host([invalid]) slot[name='error'] {\n display: block;\n}\n\n:host([variant='circle']) {\n label {\n &:after {\n border-radius: 99px;\n }\n\n &:before {\n border-radius: 99px;\n }\n }\n}\n\n:host([placement='end']) {\n label {\n padding-left: 0;\n padding-right: 26px;\n\n &:before {\n right: 0;\n left: auto;\n }\n }\n\n input[type='checkbox']:checked {\n & + label {\n position: relative;\n\n &::after {\n position: absolute;\n right: 0;\n left: auto;\n }\n }\n }\n}\n\nslot[name='error'] {\n display: none;\n max-width: 100%;\n min-width: auto;\n border-radius: 50px;\n top: 0;\n width: max-content;\n line-height: normal;\n position: static;\n background: transparent;\n padding: 0.25rem 0;\n left: auto;\n transform: none;\n color: var(--wje-input-color-invalid);\n font-size: 12px;\n}\n\n/*Colors*/\n\n:host([color='primary']) {\n input[type='checkbox']:checked + label::after,\n input[type='checkbox']:indeterminate + label:after {\n background-color: var(--wje-color-contrast-0);\n }\n :is(input[type='checkbox']:checked + label)::before,\n :is(input[type='checkbox']:indeterminate + label)::before {\n border-color: var(--wje-color-primary-9);\n background-color: var(--wje-color-primary-9);\n }\n}\n\n:host([color='complete']) {\n input[type='checkbox']:checked + label::after,\n input[type='checkbox']:indeterminate + label:after {\n background-color: var(--wje-color-contrast-0);\n }\n :is(input[type='checkbox']:checked + label)::before,\n :is(input[type='checkbox']:indeterminate + label)::before {\n border-color: var(--wje-color-complete-9);\n background-color: var(--wje-color-complete-9);\n }\n}\n\n:host([color='success']) {\n input[type='checkbox']:checked + label::after,\n input[type='checkbox']:indeterminate + label:after {\n background-color: var(--wje-color-contrast-0);\n }\n :is(input[type='checkbox']:checked + label)::before,\n :is(input[type='checkbox']:indeterminate + label)::before {\n border-color: var(--wje-color-success-9);\n background-color: var(--wje-color-success-9);\n }\n}\n\n:host([color='warning']) {\n input[type='checkbox']:checked + label::after,\n input[type='checkbox']:indeterminate + label:after {\n background-color: var(--wje-color-contrast-0);\n }\n :is(input[type='checkbox']:checked + label)::before,\n :is(input[type='checkbox']:indeterminate + label)::before {\n border-color: var(--wje-color-warning-9);\n background-color: var(--wje-color-warning-9);\n }\n}\n\n:host([color='danger']) {\n input[type='checkbox']:checked + label::after,\n input[type='checkbox']:indeterminate + label:after {\n background-color: var(--wje-color-contrast-0);\n }\n :is(input[type='checkbox']:checked + label)::before,\n :is(input[type='checkbox']:indeterminate + label)::before {\n border-color: var(--wje-color-danger-9);\n background-color: var(--wje-color-danger-9);\n }\n}\n\n:host([color='info']) {\n input[type='checkbox']:checked + label::after,\n input[type='checkbox']:indeterminate + label:after {\n background-color: var(--wje-color-contrast-0);\n }\n :is(input[type='checkbox']:checked + label)::before,\n :is(input[type='checkbox']:indeterminate + label)::before {\n border-color: var(--wje-color-info-9);\n background-color: var(--wje-color-info-9);\n }\n}\n";
16
16
  class Checkbox extends FormAssociatedElement {
@@ -549,7 +549,7 @@ resolveRender_fn = function() {
549
549
  __privateSet(this, _drawingStatus, this.drawingStatuses.DONE);
550
550
  resolve();
551
551
  }).catch((e) => {
552
- console.log(e);
552
+ console.error(e);
553
553
  });
554
554
  };
555
555
  /**