@descope/web-components-ui 1.38.0 → 1.39.0

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
@@ -1064,25 +1064,10 @@ const createStyleMixin$1 =
1064
1064
 
1065
1065
  const draggableMixin$1 = (superclass) =>
1066
1066
  class DraggableMixinClass extends superclass {
1067
- #styleEle = null;
1068
-
1069
- static get observedAttributes() {
1070
- const superAttrs = superclass.observedAttributes || [];
1071
- return [...superAttrs, 'draggable'];
1072
- }
1073
-
1074
1067
  constructor() {
1075
1068
  super();
1076
1069
 
1077
- injectStyle(`* { cursor: inherit!important }`, this);
1078
- }
1079
-
1080
- #handleDraggableStyle(isDraggable) {
1081
- if (isDraggable) {
1082
- this.shadowRoot.appendChild(this.#styleEle);
1083
- } else {
1084
- this.#styleEle.remove();
1085
- }
1070
+ injectStyle(`:host([draggable="true"]) * { cursor: inherit!important }`, this);
1086
1071
  }
1087
1072
 
1088
1073
  get isDraggable() {
@@ -1115,13 +1100,6 @@ const draggableMixin$1 = (superclass) =>
1115
1100
 
1116
1101
  super.init?.();
1117
1102
  }
1118
-
1119
- attributeChangedCallback(attrName, oldValue, newValue) {
1120
- super.attributeChangedCallback?.(attrName, oldValue, newValue);
1121
- if (attrName === 'draggable') {
1122
- this.#handleDraggableStyle(newValue === 'true');
1123
- }
1124
- }
1125
1103
  };
1126
1104
 
1127
1105
  const componentNameValidationMixin$1 = (superclass) =>
@@ -3288,26 +3266,10 @@ const createStyleMixin =
3288
3266
 
3289
3267
  const draggableMixin = (superclass) =>
3290
3268
  class DraggableMixinClass extends superclass {
3291
- #styleEle = null;
3292
-
3293
- static get observedAttributes() {
3294
- const superAttrs = superclass.observedAttributes || [];
3295
- return [...superAttrs, 'draggable'];
3296
- }
3297
-
3298
3269
  constructor() {
3299
3270
  super();
3300
3271
 
3301
- this.#styleEle = document.createElement('style');
3302
- this.#styleEle.innerText = `* { cursor: inherit!important }`;
3303
- }
3304
-
3305
- #handleDraggableStyle(isDraggable) {
3306
- if (isDraggable) {
3307
- this.shadowRoot.appendChild(this.#styleEle);
3308
- } else {
3309
- this.#styleEle.remove();
3310
- }
3272
+ injectStyle(`:host([draggable="true"]) * { cursor: inherit!important }`, this);
3311
3273
  }
3312
3274
 
3313
3275
  get isDraggable() {
@@ -3325,9 +3287,8 @@ const draggableMixin = (superclass) =>
3325
3287
  this.baseElement.setAttribute('tabindex', '-1');
3326
3288
 
3327
3289
  const onComplete = () => {
3328
- prevTabIndex
3329
- ? this.baseElement.setAttribute('tabindex', prevTabIndex)
3330
- : this.baseElement.removeAttribute('tabindex');
3290
+ if (prevTabIndex) this.baseElement.setAttribute('tabindex', prevTabIndex);
3291
+ else this.baseElement.removeAttribute('tabindex');
3331
3292
 
3332
3293
  e.target.removeEventListener('mouseup', onComplete);
3333
3294
  e.target.removeEventListener('dragend', onComplete);
@@ -3340,13 +3301,6 @@ const draggableMixin = (superclass) =>
3340
3301
 
3341
3302
  super.init?.();
3342
3303
  }
3343
-
3344
- attributeChangedCallback(attrName, oldValue, newValue) {
3345
- super.attributeChangedCallback?.(attrName, oldValue, newValue);
3346
- if (attrName === 'draggable') {
3347
- this.#handleDraggableStyle(newValue === 'true');
3348
- }
3349
- }
3350
3304
  };
3351
3305
 
3352
3306
  const componentNameValidationMixin = (superclass) =>