@descope/web-components-ui 1.102.0 → 1.103.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
@@ -4462,7 +4462,6 @@ const createDynamicDataMixin$1 =
4462
4462
  slotName,
4463
4463
  rerenderAttrsList = [],
4464
4464
  targetSelector,
4465
- sortFn
4466
4465
  }) =>
4467
4466
  (superclass) =>
4468
4467
  class DynamicDataMixinClass extends superclass {
@@ -4502,7 +4501,7 @@ const createDynamicDataMixin$1 =
4502
4501
 
4503
4502
  set data(value) {
4504
4503
  if (this.#validateSchema(value)) {
4505
- this.#data = sortFn ? value.sort(sortFn) : value;
4504
+ this.#data = value;
4506
4505
  this.#renderItems();
4507
4506
  }
4508
4507
  }
@@ -24040,8 +24039,6 @@ var collapsibleContainer$1 = /*#__PURE__*/Object.freeze({
24040
24039
  vars: vars$2
24041
24040
  });
24042
24041
 
24043
- const sortData = (a, b) => a.value.localeCompare(b.value);
24044
-
24045
24042
  const componentName = getComponentName('recovery-codes');
24046
24043
 
24047
24044
  const itemRenderer = ({ value }, _, ref) => {
@@ -24056,6 +24053,10 @@ class RawRecoveryCodes extends createBaseClass({
24056
24053
  componentName,
24057
24054
  baseSelector: ':host > div',
24058
24055
  }) {
24056
+ static get observedAttributes() {
24057
+ return ['readonly'];
24058
+ }
24059
+
24059
24060
  constructor() {
24060
24061
  super();
24061
24062
 
@@ -24068,6 +24069,10 @@ class RawRecoveryCodes extends createBaseClass({
24068
24069
  </div>
24069
24070
  `;
24070
24071
 
24072
+ this.list = this.shadowRoot.querySelector('.list');
24073
+ this.icon = this.shadowRoot.querySelector('.icon');
24074
+ this.iconWrapper = this.shadowRoot.querySelector('.icon-wrapper');
24075
+
24071
24076
  injectStyle(
24072
24077
  `
24073
24078
  :host {
@@ -24092,14 +24097,17 @@ class RawRecoveryCodes extends createBaseClass({
24092
24097
  content: '\\02022';
24093
24098
  transform: translateY(-0.06em);
24094
24099
  }
24095
- vaadin-icon {
24100
+ .icon-wrapper {
24101
+ align-self: flex-start;
24102
+ }
24103
+ .icon {
24096
24104
  cursor: pointer;
24097
24105
  }
24098
- .copied {
24106
+ .icon.copied {
24099
24107
  cursor: initial;
24100
24108
  }
24101
- .icon-wrapper {
24102
- align-self: flex-start;
24109
+ .icon.readonly {
24110
+ pointer-events: none;
24103
24111
  }
24104
24112
  `,
24105
24113
  this,
@@ -24117,9 +24125,6 @@ class RawRecoveryCodes extends createBaseClass({
24117
24125
  init() {
24118
24126
  super.init();
24119
24127
 
24120
- this.list = this.shadowRoot.querySelector('.list');
24121
- this.icon = this.shadowRoot.querySelector('.icon');
24122
- this.iconWrapper = this.shadowRoot.querySelector('.icon-wrapper');
24123
24128
 
24124
24129
  this.icon.addEventListener('click', this.onCopy.bind(this));
24125
24130
 
@@ -24141,6 +24146,20 @@ class RawRecoveryCodes extends createBaseClass({
24141
24146
  this.icon.classList.remove('copied');
24142
24147
  }, 5000);
24143
24148
  }
24149
+
24150
+ onReadOnly(isReadOnly) {
24151
+ this.icon.classList.toggle('readonly', isReadOnly);
24152
+ }
24153
+
24154
+ attributeChangedCallback(attrName, oldValue, newValue) {
24155
+ super.attributeChangedCallback?.(attrName, oldValue, newValue);
24156
+
24157
+ if (newValue !== oldValue) {
24158
+ if (attrName === 'readonly') {
24159
+ this.onReadOnly(newValue === 'true');
24160
+ }
24161
+ }
24162
+ }
24144
24163
  }
24145
24164
 
24146
24165
  const RecoveryCodesClass = compose(
@@ -24165,8 +24184,7 @@ const RecoveryCodesClass = compose(
24165
24184
  createDynamicDataMixin$1({
24166
24185
  itemRenderer,
24167
24186
  rerenderAttrsList: ['variant', 'mode'],
24168
- targetSelector: '.list',
24169
- sortFn: sortData
24187
+ targetSelector: '.list'
24170
24188
  }),
24171
24189
  draggableMixin,
24172
24190
  componentNameValidationMixin,