@forgerock/login-widget 1.0.0-beta.15 → 1.0.0-beta.16

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/index.js CHANGED
@@ -23112,7 +23112,7 @@ function get_each_context$7(ctx, list, i) {
23112
23112
  return child_ctx;
23113
23113
  }
23114
23114
 
23115
- // (40:0) {#if labelOrder === 'first'}
23115
+ // (39:0) {#if labelOrder === 'first'}
23116
23116
  function create_if_block_1$a(ctx) {
23117
23117
  let label_1;
23118
23118
  let current;
@@ -23160,7 +23160,7 @@ function create_if_block_1$a(ctx) {
23160
23160
  };
23161
23161
  }
23162
23162
 
23163
- // (41:2) <Label {key} classes={`${labelClasses}`}>
23163
+ // (40:2) <Label {key} classes={`${labelClasses}`}>
23164
23164
  function create_default_slot_1$b(ctx) {
23165
23165
  let t;
23166
23166
 
@@ -23180,7 +23180,7 @@ function create_default_slot_1$b(ctx) {
23180
23180
  };
23181
23181
  }
23182
23182
 
23183
- // (55:2) {#each options as option}
23183
+ // (54:2) {#each options as option}
23184
23184
  function create_each_block$7(ctx) {
23185
23185
  let option;
23186
23186
  let t0_value = /*option*/ ctx[15].text + "";
@@ -23221,7 +23221,7 @@ function create_each_block$7(ctx) {
23221
23221
  };
23222
23222
  }
23223
23223
 
23224
- // (62:0) {#if labelOrder === 'last'}
23224
+ // (61:0) {#if labelOrder === 'last'}
23225
23225
  function create_if_block$g(ctx) {
23226
23226
  let label_1;
23227
23227
  let current;
@@ -23274,7 +23274,7 @@ function create_if_block$g(ctx) {
23274
23274
  };
23275
23275
  }
23276
23276
 
23277
- // (63:2) <Label {key} classes={`${shouldDisplayOption ? labelClasses : 'tw_sr-only'}`}>
23277
+ // (62:2) <Label {key} classes={`${shouldDisplayOption ? labelClasses : 'tw_sr-only'}`}>
23278
23278
  function create_default_slot$i(ctx) {
23279
23279
  let t;
23280
23280
 
@@ -23513,8 +23513,6 @@ function instance$E($$self, $$props, $$invalidate) {
23513
23513
  // Check if text is same as label
23514
23514
  $$invalidate(10, shouldDisplayOption = !(label === selectedOption?.text));
23515
23515
 
23516
- console.log(shouldDisplayOption);
23517
-
23518
23516
  // Continue with calling onChange parameter
23519
23517
  onChange(event);
23520
23518
  }
@@ -27401,8 +27399,8 @@ class Eye_icon extends SvelteComponent {
27401
27399
 
27402
27400
  function create_default_slot_1$8(ctx) {
27403
27401
  let current;
27404
- const default_slot_template = /*#slots*/ ctx[14].default;
27405
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[15], null);
27402
+ const default_slot_template = /*#slots*/ ctx[15].default;
27403
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[16], null);
27406
27404
 
27407
27405
  return {
27408
27406
  c() {
@@ -27417,15 +27415,15 @@ function create_default_slot_1$8(ctx) {
27417
27415
  },
27418
27416
  p(ctx, dirty) {
27419
27417
  if (default_slot) {
27420
- if (default_slot.p && (!current || dirty & /*$$scope*/ 32768)) {
27418
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 65536)) {
27421
27419
  update_slot_base(
27422
27420
  default_slot,
27423
27421
  default_slot_template,
27424
27422
  ctx,
27425
- /*$$scope*/ ctx[15],
27423
+ /*$$scope*/ ctx[16],
27426
27424
  !current
27427
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[15])
27428
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[15], dirty, null),
27425
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[16])
27426
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[16], dirty, null),
27429
27427
  null
27430
27428
  );
27431
27429
  }
@@ -27446,7 +27444,7 @@ function create_default_slot_1$8(ctx) {
27446
27444
  };
27447
27445
  }
27448
27446
 
27449
- // (59:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
27447
+ // (69:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
27450
27448
  function create_default_slot$f(ctx) {
27451
27449
  let t;
27452
27450
  let current;
@@ -27476,7 +27474,7 @@ function create_default_slot$f(ctx) {
27476
27474
  };
27477
27475
  }
27478
27476
 
27479
- // (53:2)
27477
+ // (63:2)
27480
27478
  function create_input_button_slot$1(ctx) {
27481
27479
  let button;
27482
27480
  let eyeicon;
@@ -27507,7 +27505,7 @@ function create_input_button_slot$1(ctx) {
27507
27505
  current = true;
27508
27506
 
27509
27507
  if (!mounted) {
27510
- dispose = listen(button, "click", /*toggleVisibility*/ ctx[10]);
27508
+ dispose = listen(button, "click", /*toggleVisibility*/ ctx[11]);
27511
27509
  mounted = true;
27512
27510
  }
27513
27511
  },
@@ -27515,7 +27513,7 @@ function create_input_button_slot$1(ctx) {
27515
27513
  const eyeicon_changes = {};
27516
27514
  if (dirty & /*isVisible*/ 64) eyeicon_changes.visible = /*isVisible*/ ctx[6];
27517
27515
 
27518
- if (dirty & /*$$scope*/ 32768) {
27516
+ if (dirty & /*$$scope*/ 65536) {
27519
27517
  eyeicon_changes.$$scope = { dirty, ctx };
27520
27518
  }
27521
27519
 
@@ -27543,18 +27541,16 @@ function create_fragment$q(ctx) {
27543
27541
  let input;
27544
27542
  let current;
27545
27543
 
27546
- input = new /*Input*/ ctx[8]({
27544
+ input = new /*Input*/ ctx[9]({
27547
27545
  props: {
27548
27546
  forceValidityFailure: /*forceValidityFailure*/ ctx[0],
27549
27547
  isFirstInvalidInput: false,
27550
27548
  hasRightIcon: true,
27551
27549
  key: `${/*key*/ ctx[3]}-confirm`,
27552
27550
  label: interpolate('confirmPassword', null, 'Confirm Password'),
27553
- message: /*isInvalid*/ ctx[1]
27554
- ? interpolate('passwordConfirmationError', null, 'Passwords do not match')
27555
- : undefined,
27556
- onChange: /*onChangeWrapper*/ ctx[9],
27557
- isInvalid: /*isInvalid*/ ctx[1],
27551
+ message: /*message*/ ctx[8],
27552
+ onChange: /*onChangeWrapper*/ ctx[10],
27553
+ isInvalid: /*passwordsDoNotMatch*/ ctx[1],
27558
27554
  isRequired: /*isRequired*/ ctx[2],
27559
27555
  showMessage: /*showMessage*/ ctx[4],
27560
27556
  type: /*type*/ ctx[7],
@@ -27581,12 +27577,8 @@ function create_fragment$q(ctx) {
27581
27577
  const input_changes = {};
27582
27578
  if (dirty & /*forceValidityFailure*/ 1) input_changes.forceValidityFailure = /*forceValidityFailure*/ ctx[0];
27583
27579
  if (dirty & /*key*/ 8) input_changes.key = `${/*key*/ ctx[3]}-confirm`;
27584
-
27585
- if (dirty & /*isInvalid*/ 2) input_changes.message = /*isInvalid*/ ctx[1]
27586
- ? interpolate('passwordConfirmationError', null, 'Passwords do not match')
27587
- : undefined;
27588
-
27589
- if (dirty & /*isInvalid*/ 2) input_changes.isInvalid = /*isInvalid*/ ctx[1];
27580
+ if (dirty & /*message*/ 256) input_changes.message = /*message*/ ctx[8];
27581
+ if (dirty & /*passwordsDoNotMatch*/ 2) input_changes.isInvalid = /*passwordsDoNotMatch*/ ctx[1];
27590
27582
  if (dirty & /*isRequired*/ 4) input_changes.isRequired = /*isRequired*/ ctx[2];
27591
27583
  if (dirty & /*showMessage*/ 16) input_changes.showMessage = /*showMessage*/ ctx[4];
27592
27584
  if (dirty & /*type*/ 128) input_changes.type = /*type*/ ctx[7];
@@ -27595,7 +27587,7 @@ function create_fragment$q(ctx) {
27595
27587
  ? /*value*/ ctx[5]
27596
27588
  : '';
27597
27589
 
27598
- if (dirty & /*$$scope, isVisible*/ 32832) {
27590
+ if (dirty & /*$$scope, isVisible*/ 65600) {
27599
27591
  input_changes.$$scope = { dirty, ctx };
27600
27592
  }
27601
27593
 
@@ -27619,8 +27611,8 @@ function create_fragment$q(ctx) {
27619
27611
  function instance$q($$self, $$props, $$invalidate) {
27620
27612
  let { $$slots: slots = {}, $$scope } = $$props;
27621
27613
  let { forceValidityFailure = false } = $$props;
27622
- let { isInvalid = false } = $$props;
27623
- let { isRequired = true } = $$props;
27614
+ let { passwordsDoNotMatch = false } = $$props;
27615
+ let { isRequired = false } = $$props;
27624
27616
  let { key } = $$props;
27625
27617
  let { onChange } = $$props;
27626
27618
  let { resetValue } = $$props;
@@ -27630,6 +27622,7 @@ function instance$q($$self, $$props, $$invalidate) {
27630
27622
  let isVisible = false;
27631
27623
  let type = 'password';
27632
27624
  let value;
27625
+ let message = '';
27633
27626
 
27634
27627
  function onChangeWrapper(event) {
27635
27628
  $$invalidate(5, value = event.target?.value);
@@ -27648,36 +27641,45 @@ function instance$q($$self, $$props, $$invalidate) {
27648
27641
 
27649
27642
  $$self.$$set = $$props => {
27650
27643
  if ('forceValidityFailure' in $$props) $$invalidate(0, forceValidityFailure = $$props.forceValidityFailure);
27651
- if ('isInvalid' in $$props) $$invalidate(1, isInvalid = $$props.isInvalid);
27644
+ if ('passwordsDoNotMatch' in $$props) $$invalidate(1, passwordsDoNotMatch = $$props.passwordsDoNotMatch);
27652
27645
  if ('isRequired' in $$props) $$invalidate(2, isRequired = $$props.isRequired);
27653
27646
  if ('key' in $$props) $$invalidate(3, key = $$props.key);
27654
- if ('onChange' in $$props) $$invalidate(11, onChange = $$props.onChange);
27655
- if ('resetValue' in $$props) $$invalidate(12, resetValue = $$props.resetValue);
27656
- if ('style' in $$props) $$invalidate(13, style = $$props.style);
27647
+ if ('onChange' in $$props) $$invalidate(12, onChange = $$props.onChange);
27648
+ if ('resetValue' in $$props) $$invalidate(13, resetValue = $$props.resetValue);
27649
+ if ('style' in $$props) $$invalidate(14, style = $$props.style);
27657
27650
  if ('showMessage' in $$props) $$invalidate(4, showMessage = $$props.showMessage);
27658
- if ('$$scope' in $$props) $$invalidate(15, $$scope = $$props.$$scope);
27651
+ if ('$$scope' in $$props) $$invalidate(16, $$scope = $$props.$$scope);
27659
27652
  };
27660
27653
 
27661
27654
  $$self.$$.update = () => {
27662
- if ($$self.$$.dirty & /*resetValue, onChange, value*/ 6176) {
27655
+ if ($$self.$$.dirty & /*resetValue, onChange, value, passwordsDoNotMatch, isRequired*/ 12326) {
27663
27656
  {
27664
27657
  if (resetValue) {
27665
27658
  $$invalidate(5, value = undefined);
27666
27659
  onChange(value);
27667
27660
  }
27661
+
27662
+ if (passwordsDoNotMatch) {
27663
+ $$invalidate(8, message = interpolate('passwordConfirmationError', null, 'Passwords do not match'));
27664
+ } else if (isRequired) {
27665
+ $$invalidate(8, message = interpolate('requiredField', null, 'This field is required'));
27666
+ } else {
27667
+ $$invalidate(8, message = '');
27668
+ }
27668
27669
  }
27669
27670
  }
27670
27671
  };
27671
27672
 
27672
27673
  return [
27673
27674
  forceValidityFailure,
27674
- isInvalid,
27675
+ passwordsDoNotMatch,
27675
27676
  isRequired,
27676
27677
  key,
27677
27678
  showMessage,
27678
27679
  value,
27679
27680
  isVisible,
27680
27681
  type,
27682
+ message,
27681
27683
  Input,
27682
27684
  onChangeWrapper,
27683
27685
  toggleVisibility,
@@ -27695,12 +27697,12 @@ class Confirm_input extends SvelteComponent {
27695
27697
 
27696
27698
  init(this, options, instance$q, create_fragment$q, safe_not_equal, {
27697
27699
  forceValidityFailure: 0,
27698
- isInvalid: 1,
27700
+ passwordsDoNotMatch: 1,
27699
27701
  isRequired: 2,
27700
27702
  key: 3,
27701
- onChange: 11,
27702
- resetValue: 12,
27703
- style: 13,
27703
+ onChange: 12,
27704
+ resetValue: 13,
27705
+ style: 14,
27704
27706
  showMessage: 4
27705
27707
  });
27706
27708
  }
@@ -27856,8 +27858,9 @@ function create_if_block$a(ctx) {
27856
27858
  confirminput = new Confirm_input({
27857
27859
  props: {
27858
27860
  forceValidityFailure: /*doPasswordsMatch*/ ctx[9] === false,
27859
- isInvalid: /*doPasswordsMatch*/ ctx[9] === false,
27861
+ passwordsDoNotMatch: /*doPasswordsMatch*/ ctx[9] === false,
27860
27862
  key: /*key*/ ctx[0],
27863
+ isRequired: /*value*/ ctx[7].length > 0,
27861
27864
  onChange: /*confirmInput*/ ctx[15],
27862
27865
  resetValue: /*resetValue*/ ctx[11],
27863
27866
  showMessage: /*doPasswordsMatch*/ ctx[9] === false,
@@ -27876,8 +27879,9 @@ function create_if_block$a(ctx) {
27876
27879
  p(ctx, dirty) {
27877
27880
  const confirminput_changes = {};
27878
27881
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.forceValidityFailure = /*doPasswordsMatch*/ ctx[9] === false;
27879
- if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.isInvalid = /*doPasswordsMatch*/ ctx[9] === false;
27882
+ if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.passwordsDoNotMatch = /*doPasswordsMatch*/ ctx[9] === false;
27880
27883
  if (dirty & /*key*/ 1) confirminput_changes.key = /*key*/ ctx[0];
27884
+ if (dirty & /*value*/ 128) confirminput_changes.isRequired = /*value*/ ctx[7].length > 0;
27881
27885
  if (dirty & /*resetValue*/ 2048) confirminput_changes.resetValue = /*resetValue*/ ctx[11];
27882
27886
  if (dirty & /*doPasswordsMatch*/ 512) confirminput_changes.showMessage = /*doPasswordsMatch*/ ctx[9] === false;
27883
27887
  if (dirty & /*style*/ 16) confirminput_changes.style = /*style*/ ctx[4];