@descope/web-components-ui 1.0.69 → 1.0.70

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.
package/dist/index.esm.js CHANGED
@@ -420,6 +420,57 @@ const draggableMixin = (superclass) =>
420
420
  }
421
421
  };
422
422
 
423
+ const componentNameValidationMixin = (superclass) =>
424
+ class ComponentNameValidationMixinClass extends superclass {
425
+ #checkComponentName() {
426
+ const currentComponentName = this.shadowRoot.host.tagName.toLowerCase();
427
+
428
+ if (!superclass.componentName) {
429
+ throw Error(
430
+ `component name is not defined on super class, make sure you have a static get for "componentName"`
431
+ );
432
+ }
433
+
434
+ if (currentComponentName !== superclass.componentName) {
435
+ throw Error(
436
+ `component name mismatch, expected "${superclass.componentName}", current "${currentComponentName}"`
437
+ );
438
+ }
439
+ }
440
+
441
+ connectedCallback() {
442
+ super.connectedCallback?.();
443
+ if (this.shadowRoot.isConnected) {
444
+ this.#checkComponentName();
445
+ }
446
+ }
447
+ };
448
+
449
+ const hoverableMixin =
450
+ (superclass) =>
451
+ class HoverableMixinClass extends superclass {
452
+ #boundOnMouseOver = this.#onMouseOver.bind(this)
453
+
454
+ #onMouseOver(e) {
455
+ this.setAttribute('hover', 'true');
456
+ e.target.addEventListener(
457
+ 'mouseleave',
458
+ () => this.shadowRoot.host.removeAttribute('hover'),
459
+ { once: true }
460
+ );
461
+ }
462
+
463
+ connectedCallback() {
464
+ super.connectedCallback?.();
465
+
466
+ const baseElement = this.shadowRoot.querySelector(
467
+ this.baseSelector
468
+ );
469
+
470
+ baseElement.addEventListener('mouseover', this.#boundOnMouseOver);
471
+ }
472
+ };
473
+
423
474
  const createBaseClass = ({ componentName, baseSelector = '' }) => {
424
475
  class DescopeBaseClass extends HTMLElement {
425
476
  static get componentName() {
@@ -829,57 +880,6 @@ const proxyInputMixin = (superclass) =>
829
880
  }
830
881
  };
831
882
 
832
- const componentNameValidationMixin = (superclass) =>
833
- class ComponentNameValidationMixinClass extends superclass {
834
- #checkComponentName() {
835
- const currentComponentName = this.shadowRoot.host.tagName.toLowerCase();
836
-
837
- if (!superclass.componentName) {
838
- throw Error(
839
- `component name is not defined on super class, make sure you have a static get for "componentName"`
840
- );
841
- }
842
-
843
- if (currentComponentName !== superclass.componentName) {
844
- throw Error(
845
- `component name mismatch, expected "${superclass.componentName}", current "${currentComponentName}"`
846
- );
847
- }
848
- }
849
-
850
- connectedCallback() {
851
- super.connectedCallback?.();
852
- if (this.shadowRoot.isConnected) {
853
- this.#checkComponentName();
854
- }
855
- }
856
- };
857
-
858
- const hoverableMixin =
859
- (superclass) =>
860
- class HoverableMixinClass extends superclass {
861
- #boundOnMouseOver = this.#onMouseOver.bind(this)
862
-
863
- #onMouseOver(e) {
864
- this.setAttribute('hover', 'true');
865
- e.target.addEventListener(
866
- 'mouseleave',
867
- () => this.shadowRoot.host.removeAttribute('hover'),
868
- { once: true }
869
- );
870
- }
871
-
872
- connectedCallback() {
873
- super.connectedCallback?.();
874
-
875
- const baseElement = this.shadowRoot.querySelector(
876
- this.baseSelector
877
- );
878
-
879
- baseElement.addEventListener('mouseover', this.#boundOnMouseOver);
880
- }
881
- };
882
-
883
883
  const events = [
884
884
  'blur',
885
885
  'focus',