@aurodesignsystem-dev/auro-formkit 0.0.0-pr647.2 → 0.0.0-pr647.4

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.
Files changed (51) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +1 -0
  2. package/components/bibtemplate/dist/index.js +12 -0
  3. package/components/bibtemplate/dist/registered.js +12 -0
  4. package/components/checkbox/demo/api.min.js +4 -3
  5. package/components/checkbox/demo/index.min.js +4 -3
  6. package/components/checkbox/dist/index.js +4 -3
  7. package/components/checkbox/dist/registered.js +4 -3
  8. package/components/combobox/demo/api.md +27 -27
  9. package/components/combobox/demo/api.min.js +160 -327
  10. package/components/combobox/demo/index.html +1 -0
  11. package/components/combobox/demo/index.min.js +158 -325
  12. package/components/combobox/dist/auro-combobox.d.ts +5 -18
  13. package/components/combobox/dist/index.js +119 -201
  14. package/components/combobox/dist/registered.js +119 -201
  15. package/components/counter/demo/api.min.js +88 -7
  16. package/components/counter/demo/index.min.js +88 -7
  17. package/components/counter/dist/index.js +88 -7
  18. package/components/counter/dist/registered.js +88 -7
  19. package/components/datepicker/demo/api.min.js +92 -10
  20. package/components/datepicker/demo/index.min.js +92 -10
  21. package/components/datepicker/dist/index.js +92 -10
  22. package/components/datepicker/dist/registered.js +92 -10
  23. package/components/dropdown/demo/api.min.js +72 -4
  24. package/components/dropdown/demo/index.min.js +72 -4
  25. package/components/dropdown/dist/auro-dropdownBib.d.ts +8 -0
  26. package/components/dropdown/dist/index.js +72 -4
  27. package/components/dropdown/dist/registered.js +72 -4
  28. package/components/input/demo/api.min.js +4 -3
  29. package/components/input/demo/index.min.js +4 -3
  30. package/components/input/dist/index.js +4 -3
  31. package/components/input/dist/registered.js +4 -3
  32. package/components/menu/demo/api.md +11 -11
  33. package/components/menu/demo/api.min.js +39 -124
  34. package/components/menu/demo/index.min.js +39 -124
  35. package/components/menu/dist/auro-menu-utils.d.ts +0 -8
  36. package/components/menu/dist/auro-menu.d.ts +3 -8
  37. package/components/menu/dist/index.d.ts +1 -1
  38. package/components/menu/dist/index.js +40 -84
  39. package/components/menu/dist/registered.js +39 -124
  40. package/components/radio/demo/api.min.js +4 -3
  41. package/components/radio/demo/index.min.js +4 -3
  42. package/components/radio/dist/index.js +4 -3
  43. package/components/radio/dist/registered.js +4 -3
  44. package/components/select/demo/api.js +2 -0
  45. package/components/select/demo/api.md +96 -38
  46. package/components/select/demo/api.min.js +215 -217
  47. package/components/select/demo/index.min.js +201 -215
  48. package/components/select/dist/auro-select.d.ts +14 -14
  49. package/components/select/dist/index.js +161 -90
  50. package/components/select/dist/registered.js +161 -90
  51. package/package.json +3 -3
@@ -34,6 +34,7 @@ export class AuroBibtemplate extends LitElement {
34
34
  * @returns {void}
35
35
  */
36
36
  exposeCssParts(): void;
37
+ firstUpdated(changedProperties: any): void;
37
38
  render(): import("lit-html").TemplateResult;
38
39
  }
39
40
  import { LitElement } from "lit";
@@ -816,6 +816,18 @@ class AuroBibtemplate extends LitElement {
816
816
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
817
817
  }
818
818
 
819
+ firstUpdated(changedProperties) {
820
+ super.firstUpdated(changedProperties);
821
+
822
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
823
+ bubbles: true,
824
+ composed: true,
825
+ detail: {
826
+ element: this
827
+ }
828
+ }));
829
+ }
830
+
819
831
  // function that renders the HTML and CSS into the scope of the component
820
832
  render() {
821
833
  return html$1`
@@ -816,6 +816,18 @@ class AuroBibtemplate extends LitElement {
816
816
  this.setAttribute('exportparts', 'bibtemplate:dropdownBibTemplate');
817
817
  }
818
818
 
819
+ firstUpdated(changedProperties) {
820
+ super.firstUpdated(changedProperties);
821
+
822
+ this.dispatchEvent(new CustomEvent("auro-bibtemplate-connected", {
823
+ bubbles: true,
824
+ composed: true,
825
+ detail: {
826
+ element: this
827
+ }
828
+ }));
829
+ }
830
+
819
831
  // function that renders the HTML and CSS into the scope of the component
820
832
  render() {
821
833
  return html$1`
@@ -449,9 +449,10 @@ class DateFormatter {
449
449
  /**
450
450
  * Convert a date object to string format.
451
451
  * @param {Object} date - Date to convert to string.
452
- * @returns {Object} Returns the date as a string.
452
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
453
+ * @returns {String} Returns the date as a string.
453
454
  */
454
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
455
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
455
456
  year: "numeric",
456
457
  month: "2-digit",
457
458
  day: "2-digit",
@@ -643,7 +644,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
643
644
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
644
645
 
645
646
  // Get the date string of the date object we created from the string date
646
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
647
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
647
648
 
648
649
  // Guard Clause: Generated date matches date string input
649
650
  if (expectedDateStr !== actualDateStr) {
@@ -441,9 +441,10 @@ class DateFormatter {
441
441
  /**
442
442
  * Convert a date object to string format.
443
443
  * @param {Object} date - Date to convert to string.
444
- * @returns {Object} Returns the date as a string.
444
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
445
+ * @returns {String} Returns the date as a string.
445
446
  */
446
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
447
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
447
448
  year: "numeric",
448
449
  month: "2-digit",
449
450
  day: "2-digit",
@@ -635,7 +636,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
635
636
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
636
637
 
637
638
  // Get the date string of the date object we created from the string date
638
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
639
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
639
640
 
640
641
  // Guard Clause: Generated date matches date string input
641
642
  if (expectedDateStr !== actualDateStr) {
@@ -394,9 +394,10 @@ class DateFormatter {
394
394
  /**
395
395
  * Convert a date object to string format.
396
396
  * @param {Object} date - Date to convert to string.
397
- * @returns {Object} Returns the date as a string.
397
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
398
+ * @returns {String} Returns the date as a string.
398
399
  */
399
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
400
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
400
401
  year: "numeric",
401
402
  month: "2-digit",
402
403
  day: "2-digit",
@@ -588,7 +589,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
588
589
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
589
590
 
590
591
  // Get the date string of the date object we created from the string date
591
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
592
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
592
593
 
593
594
  // Guard Clause: Generated date matches date string input
594
595
  if (expectedDateStr !== actualDateStr) {
@@ -394,9 +394,10 @@ class DateFormatter {
394
394
  /**
395
395
  * Convert a date object to string format.
396
396
  * @param {Object} date - Date to convert to string.
397
- * @returns {Object} Returns the date as a string.
397
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
398
+ * @returns {String} Returns the date as a string.
398
399
  */
399
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
400
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
400
401
  year: "numeric",
401
402
  month: "2-digit",
402
403
  day: "2-digit",
@@ -588,7 +589,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
588
589
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
589
590
 
590
591
  // Get the date string of the date object we created from the string date
591
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
592
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
592
593
 
593
594
  // Guard Clause: Generated date matches date string input
594
595
  if (expectedDateStr !== actualDateStr) {
@@ -5,31 +5,31 @@
5
5
 
6
6
  ## Properties
7
7
 
8
- | Property | Attribute | Type | Default | Description |
9
- |---------------------------------|---------------------------------|------------------------|----------------|--------------------------------------------------|
10
- | [autoPlacement](#autoPlacement) | `autoPlacement` | `boolean` | | If declared, bib's position will be automatically calculated where to appear. |
11
- | [autocomplete](#autocomplete) | `autocomplete` | `string` | "false" | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
12
- | [checkmark](#checkmark) | `checkmark` | `boolean` | | When attribute is present auro-menu will apply checkmarks to selected options. |
13
- | [disabled](#disabled) | `disabled` | `boolean` | | If set, disables the combobox. |
14
- | [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
15
- | [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
16
- | [inputmode](#inputmode) | `inputmode` | `string` | | Exposes inputmode attribute for input. |
17
- | [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600 |
18
- | [noFilter](#noFilter) | `noFilter` | `boolean` | | If set, combobox will not filter menuoptions based in input. |
19
- | [noFlip](#noFlip) | `noFlip` | `boolean` | "false" | If declared, the bib will NOT flip to an alternate position<br />when there isn't enough space in the specified `placement`. |
20
- | [noValidate](#noValidate) | `noValidate` | `boolean` | | If set, disables auto-validation on blur. |
21
- | [offset](#offset) | `offset` | `number` | "0" | Gap between the trigger element and bib. |
22
- | [onDark](#onDark) | `onDark` | `boolean` | | If declared, onDark styles will be applied to the trigger. |
23
- | [optionSelected](#optionSelected) | `optionSelected` | `object` | | Specifies the current selected option. |
24
- | [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
25
- | [required](#required) | `required` | `boolean` | | Populates the `required` attribute on the input. Used for client-side validation. |
26
- | [setCustomValidity](#setCustomValidity) | `setCustomValidity` | `string` | | Sets a custom help text message to display for all validityStates. |
27
- | [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | `string` | | Custom help text message to display when validity = `customError`. |
28
- | [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | `string` | | Custom help text message to display when validity = `valueMissing`. |
29
- | [triggerIcon](#triggerIcon) | `triggerIcon` | `boolean` | | If set, the `icon` attribute will be applied to the trigger `auro-input` element. |
30
- | [type](#type) | `type` | `string` | | Applies the defined value as the type attribute on auro-input. |
31
- | [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
32
- | [value](#value) | `value` | `Array\|String<Array>` | | Value selected for the dropdown menu. |
8
+ | Property | Attribute | Type | Default | Description |
9
+ |---------------------------------|---------------------------------|---------------|----------------|--------------------------------------------------|
10
+ | [autoPlacement](#autoPlacement) | `autoPlacement` | `boolean` | | If declared, bib's position will be automatically calculated where to appear. |
11
+ | [autocomplete](#autocomplete) | `autocomplete` | `string` | "false" | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
12
+ | [checkmark](#checkmark) | `checkmark` | `boolean` | | When attribute is present auro-menu will apply checkmarks to selected options. |
13
+ | [disabled](#disabled) | `disabled` | `boolean` | | If set, disables the combobox. |
14
+ | [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
15
+ | [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
16
+ | [inputmode](#inputmode) | `inputmode` | `string` | | Exposes inputmode attribute for input. |
17
+ | [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600 |
18
+ | [noFilter](#noFilter) | `noFilter` | `boolean` | | If set, combobox will not filter menuoptions based in input. |
19
+ | [noFlip](#noFlip) | `noFlip` | `boolean` | "false" | If declared, the bib will NOT flip to an alternate position<br />when there isn't enough space in the specified `placement`. |
20
+ | [noValidate](#noValidate) | `noValidate` | `boolean` | | If set, disables auto-validation on blur. |
21
+ | [offset](#offset) | `offset` | `number` | "0" | Gap between the trigger element and bib. |
22
+ | [onDark](#onDark) | `onDark` | `boolean` | | If declared, onDark styles will be applied to the trigger. |
23
+ | [optionSelected](#optionSelected) | `optionSelected` | `HTMLElement` | | Specifies the current selected option. |
24
+ | [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
25
+ | [required](#required) | `required` | `boolean` | | Populates the `required` attribute on the input. Used for client-side validation. |
26
+ | [setCustomValidity](#setCustomValidity) | `setCustomValidity` | `string` | | Sets a custom help text message to display for all validityStates. |
27
+ | [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | `string` | | Custom help text message to display when validity = `customError`. |
28
+ | [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | `string` | | Custom help text message to display when validity = `valueMissing`. |
29
+ | [triggerIcon](#triggerIcon) | `triggerIcon` | `boolean` | | If set, the `icon` attribute will be applied to the trigger `auro-input` element. |
30
+ | [type](#type) | `type` | `string` | | Applies the defined value as the type attribute on auro-input. |
31
+ | [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
32
+ | [value](#value) | `value` | `string` | | Value selected for the dropdown menu. |
33
33
 
34
34
  ## Methods
35
35
 
@@ -684,11 +684,11 @@ export function valueExample() {
684
684
  const valueExample = document.querySelector('#valueExample');
685
685
 
686
686
  document.querySelector('#valueValidExampleBtn').addEventListener('click', () => {
687
- valueExample.value = ['Oranges'];
687
+ valueExample.value = 'Oranges';
688
688
  });
689
689
 
690
690
  document.querySelector('#valueInvalidExampleBtn').addEventListener('click', () => {
691
- valueExample.value = ['Dragon Fruit'];
691
+ valueExample.value = 'Dragon Fruit';
692
692
  });
693
693
 
694
694
  document.querySelector('#valueUndefinedExampleBtn').addEventListener('click', () => {