@ongov/ontario-design-system-component-library 4.3.0 → 5.0.0-alpha.1

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 (148) hide show
  1. package/dist/cjs/index-88d5cf20.js +2 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{ontario-accordion_43.cjs.entry.js → ontario-accordion_44.cjs.entry.js} +738 -296
  4. package/dist/cjs/ontario-accordion_44.cjs.entry.js.map +1 -0
  5. package/dist/cjs/ontario-design-system-components.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -0
  7. package/dist/collection/components/ontario-card/ontario-card-types.js +29 -2
  8. package/dist/collection/components/ontario-card/ontario-card-types.js.map +1 -1
  9. package/dist/collection/components/ontario-card/ontario-card.css +257 -31
  10. package/dist/collection/components/ontario-card/ontario-card.js +104 -80
  11. package/dist/collection/components/ontario-card/ontario-card.js.map +1 -1
  12. package/dist/collection/components/ontario-card/test/ontario-cards.spec.js +23 -13
  13. package/dist/collection/components/ontario-card/test/ontario-cards.spec.js.map +1 -1
  14. package/dist/collection/components/ontario-header/ontario-header.js +17 -3
  15. package/dist/collection/components/ontario-header/ontario-header.js.map +1 -1
  16. package/dist/collection/components/ontario-header/service-ontario-header.css +0 -3
  17. package/dist/collection/components/ontario-header/test/ontario-header.spec.js +3 -3
  18. package/dist/collection/components/ontario-header/test/ontario-header.spec.js.map +1 -1
  19. package/dist/collection/components/ontario-language-toggle/ontario-language-toggle.js +193 -47
  20. package/dist/collection/components/ontario-language-toggle/ontario-language-toggle.js.map +1 -1
  21. package/dist/collection/components/ontario-language-toggle/test/ontario-language-toggle.spec.js +16 -3
  22. package/dist/collection/components/ontario-language-toggle/test/ontario-language-toggle.spec.js.map +1 -1
  23. package/dist/collection/components/ontario-search-box/assets/ontario-icon-close.svg +1 -0
  24. package/dist/collection/components/ontario-search-box/assets/ontario-logo--mobile.svg +6 -0
  25. package/dist/collection/components/ontario-search-box/ontario-search-box.css +823 -0
  26. package/dist/collection/components/ontario-search-box/ontario-search-box.js +584 -0
  27. package/dist/collection/components/ontario-search-box/ontario-search-box.js.map +1 -0
  28. package/dist/collection/components/ontario-search-box/test/ontario-search-box.e2e.js +20 -0
  29. package/dist/collection/components/ontario-search-box/test/ontario-search-box.e2e.js.map +1 -0
  30. package/dist/collection/components/ontario-search-box/test/ontario-search-box.spec.js +19 -0
  31. package/dist/collection/components/ontario-search-box/test/ontario-search-box.spec.js.map +1 -0
  32. package/dist/collection/components/ontario-step-indicator/ontario-step-indicator.js +5 -5
  33. package/dist/collection/components/ontario-table/ontario-table.js +5 -5
  34. package/dist/collection/components/ontario-textarea/ontario-textarea.js +3 -3
  35. package/dist/collection/i18n/global.i18n.json +172 -162
  36. package/dist/collection/utils/common/input/input.js +3 -0
  37. package/dist/collection/utils/common/input/input.js.map +1 -1
  38. package/dist/collection/utils/common/input-caption/input-caption.js +5 -3
  39. package/dist/collection/utils/common/input-caption/input-caption.js.map +1 -1
  40. package/dist/collection/utils/common/language-types.js +1 -1
  41. package/dist/collection/utils/common/language-types.js.map +1 -1
  42. package/dist/collection/utils/helper/utils-types.js +2 -0
  43. package/dist/collection/utils/helper/utils-types.js.map +1 -0
  44. package/dist/collection/utils/helper/utils.js +26 -0
  45. package/dist/collection/utils/helper/utils.js.map +1 -1
  46. package/dist/components/error-message.js +1 -324
  47. package/dist/components/error-message.js.map +1 -1
  48. package/dist/components/event-handler.js +330 -0
  49. package/dist/components/event-handler.js.map +1 -0
  50. package/dist/components/global.i18n.js +184 -173
  51. package/dist/components/global.i18n.js.map +1 -1
  52. package/dist/components/input.js +3 -0
  53. package/dist/components/input.js.map +1 -1
  54. package/dist/components/ontario-card.js +118 -66
  55. package/dist/components/ontario-card.js.map +1 -1
  56. package/dist/components/ontario-checkboxes.js +2 -1
  57. package/dist/components/ontario-checkboxes.js.map +1 -1
  58. package/dist/components/ontario-date-input.js +2 -1
  59. package/dist/components/ontario-date-input.js.map +1 -1
  60. package/dist/components/ontario-dropdown-list.js +2 -1
  61. package/dist/components/ontario-dropdown-list.js.map +1 -1
  62. package/dist/components/ontario-header.js +13 -7
  63. package/dist/components/ontario-header.js.map +1 -1
  64. package/dist/components/ontario-icon-search2.js +6 -0
  65. package/dist/components/ontario-icon-search2.js.map +1 -0
  66. package/dist/components/ontario-input.js +2 -1
  67. package/dist/components/ontario-input.js.map +1 -1
  68. package/dist/components/ontario-language-toggle2.js +180 -37
  69. package/dist/components/ontario-language-toggle2.js.map +1 -1
  70. package/dist/components/ontario-radio-buttons.js +2 -1
  71. package/dist/components/ontario-radio-buttons.js.map +1 -1
  72. package/dist/components/ontario-search-box.d.ts +11 -0
  73. package/dist/components/ontario-search-box.js +269 -0
  74. package/dist/components/ontario-search-box.js.map +1 -0
  75. package/dist/components/ontario-step-indicator.js +5 -5
  76. package/dist/components/ontario-table.js +5 -5
  77. package/dist/components/ontario-textarea.js +5 -4
  78. package/dist/components/ontario-textarea.js.map +1 -1
  79. package/dist/components/utils.js +28 -0
  80. package/dist/components/utils.js.map +1 -1
  81. package/dist/esm/index-603026f7.js +2 -2
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/esm/{ontario-accordion_43.entry.js → ontario-accordion_44.entry.js} +738 -296
  84. package/dist/esm/ontario-accordion_44.entry.js.map +1 -0
  85. package/dist/esm/ontario-design-system-components.js +1 -1
  86. package/dist/ontario-design-system-components/i18n/global.i18n.json +172 -162
  87. package/dist/ontario-design-system-components/ontario-design-system-components.esm.js +1 -1
  88. package/dist/ontario-design-system-components/ontario-design-system-components.esm.js.map +1 -1
  89. package/dist/ontario-design-system-components/{p-cff41424.entry.js → p-9c3a1be9.entry.js} +2204 -1918
  90. package/dist/ontario-design-system-components/p-9c3a1be9.entry.js.map +1 -0
  91. package/dist/types/components/ontario-card/ontario-card-types.d.ts +4 -4
  92. package/dist/types/components/ontario-card/ontario-card.d.ts +40 -29
  93. package/dist/types/components/ontario-header/ontario-header.d.ts +13 -2
  94. package/dist/types/components/ontario-language-toggle/ontario-language-toggle.d.ts +75 -8
  95. package/dist/types/components/ontario-search-box/ontario-search-box.d.ts +180 -0
  96. package/dist/types/components.d.ts +211 -22
  97. package/dist/types/utils/common/input/input.d.ts +2 -1
  98. package/dist/types/utils/common/input-caption/input-caption.d.ts +7 -1
  99. package/dist/types/utils/common/language-types.d.ts +2 -1
  100. package/dist/types/utils/helper/utils-types.d.ts +2 -0
  101. package/dist/types/utils/helper/utils.d.ts +21 -0
  102. package/package.json +3 -3
  103. package/src/components/ontario-card/ontario-card-types.tsx +33 -4
  104. package/src/components/ontario-card/ontario-card.scss +59 -38
  105. package/src/components/ontario-card/ontario-card.tsx +98 -70
  106. package/src/components/ontario-card/readme.md +57 -27
  107. package/src/components/ontario-card/test/__snapshots__/ontario-cards.spec.tsx.snap +66 -0
  108. package/src/components/ontario-card/test/ontario-cards.spec.tsx +27 -13
  109. package/src/components/ontario-card-collection/readme.md +13 -13
  110. package/src/components/ontario-checkbox/ontario-checkboxes.scss +0 -1
  111. package/src/components/ontario-header/ontario-header.tsx +13 -4
  112. package/src/components/ontario-header/service-ontario-header.scss +0 -4
  113. package/src/components/ontario-header/test/ontario-header.spec.tsx +3 -3
  114. package/src/components/ontario-hint-text/readme.md +2 -0
  115. package/src/components/ontario-language-toggle/ontario-language-toggle.tsx +192 -45
  116. package/src/components/ontario-language-toggle/readme.md +10 -10
  117. package/src/components/ontario-language-toggle/test/__snapshots__/ontario-language-toggle.spec.tsx.snap +1 -1
  118. package/src/components/ontario-language-toggle/test/ontario-language-toggle.spec.tsx +17 -3
  119. package/src/components/ontario-radio-buttons/ontario-radio-buttons.scss +0 -1
  120. package/src/components/ontario-search-box/assets/ontario-icon-close.svg +1 -0
  121. package/src/components/ontario-search-box/assets/ontario-logo--mobile.svg +6 -0
  122. package/src/components/ontario-search-box/ontario-search-box.scss +141 -0
  123. package/src/components/ontario-search-box/ontario-search-box.tsx +341 -0
  124. package/src/components/ontario-search-box/readme.md +132 -0
  125. package/src/components/ontario-search-box/test/__snapshots__/ontario-search-box.spec.tsx.snap +35 -0
  126. package/src/components/ontario-search-box/test/ontario-search-box.e2e.ts +21 -0
  127. package/src/components/ontario-search-box/test/ontario-search-box.spec.tsx +22 -0
  128. package/src/components.d.ts +211 -22
  129. package/src/french.html +37 -0
  130. package/src/index.html +292 -38
  131. package/src/translations/global.i18n.json +172 -162
  132. package/src/utils/common/input/input.tsx +4 -1
  133. package/src/utils/common/input-caption/input-caption.tsx +9 -3
  134. package/src/utils/common/language-types.ts +2 -1
  135. package/src/utils/helper/utils-types.ts +2 -0
  136. package/src/utils/helper/utils.ts +30 -0
  137. package/www/build/ontario-design-system-components.esm.js +1 -1
  138. package/www/build/ontario-design-system-components.esm.js.map +1 -1
  139. package/www/build/{p-b61db0f6.js → p-84035ac3.js} +1 -1
  140. package/www/build/{p-cff41424.entry.js → p-9c3a1be9.entry.js} +2204 -1918
  141. package/www/build/p-9c3a1be9.entry.js.map +1 -0
  142. package/www/french.html +37 -0
  143. package/www/i18n/global.i18n.json +172 -162
  144. package/www/index.html +266 -38
  145. package/dist/cjs/ontario-accordion_43.cjs.entry.js.map +0 -1
  146. package/dist/esm/ontario-accordion_43.entry.js.map +0 -1
  147. package/dist/ontario-design-system-components/p-cff41424.entry.js.map +0 -1
  148. package/www/build/p-cff41424.entry.js.map +0 -1
@@ -1,8 +1,8 @@
1
- export declare const CardTypes: readonly ['basic', 'image', 'title', 'horizontal'];
2
- export declare const HeaderTypes: readonly ['default', 'light', 'dark'];
1
+ export declare const Layouts: readonly ['vertical', 'horizontal'];
3
2
  export declare const HorizontalImagePositionTypes: readonly ['left', 'right'];
4
3
  export declare const HorizontalImageSizeTypes: readonly ['one-fourth', 'one-third'];
5
- export type CardType = (typeof CardTypes)[number];
6
- export type HeaderType = (typeof HeaderTypes)[number];
4
+ export type Layout = (typeof Layouts)[number];
7
5
  export type HorizontalImagePositionType = (typeof HorizontalImagePositionTypes)[number];
8
6
  export type HorizontalImageSizeType = (typeof HorizontalImageSizeTypes)[number];
7
+ export declare const HeaderColours: string[];
8
+ export type HeaderColour = (typeof HeaderColours)[number];
@@ -1,4 +1,4 @@
1
- import { CardType, HeaderType, HorizontalImagePositionType, HorizontalImageSizeType } from './ontario-card-types';
1
+ import { HeaderColour, HorizontalImagePositionType, HorizontalImageSizeType, Layout } from './ontario-card-types';
2
2
  export declare class OntarioCard {
3
3
  host: HTMLElement;
4
4
  /**
@@ -32,18 +32,18 @@ export declare class OntarioCard {
32
32
  */
33
33
  cardLink?: string;
34
34
  /**
35
- * The type of card to render.
35
+ * The layout oritnetation of the card.
36
36
  *
37
- * If no type is passed, it will default to 'basic'.
37
+ * If no type is passed, it will default to 'vertical'.
38
38
  *
39
39
  */
40
- cardType: CardType;
40
+ layout?: Layout;
41
41
  /**
42
- * The type of header to render.
42
+ * Set the card's header colour.
43
43
  *
44
- * If no type is passed, it will default to 'default'.
44
+ * This is optional.
45
45
  */
46
- headerType: HeaderType;
46
+ headerColour?: HeaderColour;
47
47
  /**
48
48
  * The position of the image when the card-type is set to 'horizontal'.
49
49
  *
@@ -87,43 +87,54 @@ export declare class OntarioCard {
87
87
  ariaLabelText?: string;
88
88
  /**
89
89
  * Mutable variable, for internal use only.
90
- * Set the card's type depending on validation result.
90
+ * Set the card's layout depending on validation result.
91
91
  */
92
- private cardTypeState;
92
+ private layoutState;
93
93
  /**
94
- * Mutable variable, for internal use only.
95
- * Set the card's header type depending on validation result.
94
+ * Watch for changes to the `layout` property for validation purposes.
95
+ *
96
+ * If the user input doesn't match one of the array values then `layout` will be set to its default (`vertical`).
97
+ * If a match is found in one of the array values then `layoutState` will be set to the matching array key value.
96
98
  */
97
- private headerTypeState;
99
+ validateLayout(): void;
98
100
  /**
99
- * Watch for changes to the `cardType` property for validation purposes.
101
+ * Watch for changes to the `headerColour` property for validation purposes.
100
102
  *
101
- * If the user input doesn't match one of the array values then `cardType` will be set to its default (`basic`).
102
- * If a match is found in one of the array values then `cardType` will be set to the matching array key value.
103
+ * If the user input doesn't match one of the array values then `headerColour` will be kept empty ('').
104
+ * If a match is found in one of the array values then `headerColour` will be set to the matching array key value.
103
105
  */
104
- validateCardType(): void;
106
+ validateHeaderColour(): void;
105
107
  /**
106
- * Watch for changes to the `headerType` property for validation purposes.
107
- *
108
- * If the user input doesn't match one of the array values then `headerType` will be set to its default (`default`).
109
- * If a match is found in one of the array values then `headerType` will be set to the matching array key value.
108
+ * Print the invalid `layout` prop warning message.
109
+ */
110
+ private warnDefaultLayout;
111
+ /**
112
+ * Print the invalid `headerColour` prop warning message.
110
113
  */
111
- validateHeaderType(): void;
114
+ private warnDefaultHeaderColour;
112
115
  /**
113
- * Print the invalid `cardType` prop warning message.
114
- * @returns default type (basic).
116
+ * Returns the top level classes of the card.
117
+ *
118
+ * @returns {string}
115
119
  */
116
- private warnDefaultCardType;
120
+ private getCardClasses;
117
121
  /**
118
- * Print the invalid `headerType` prop warning message.
119
- * @returns default type (default).
122
+ * Returns the heading classes of the card.
123
+ *
124
+ * @returns {string}
120
125
  */
121
- private warnDefaultHeaderType;
126
+ private getCardHeadingClasses;
122
127
  /**
123
- * @returns the classes of the ontario cards based off the `cardType` and `headerType`.
128
+ * Returns the url that the card links to.
129
+ *
130
+ * @returns {string}
124
131
  */
125
- private getClass;
126
132
  private getHref;
133
+ /**
134
+ * Component life cycle hook.
135
+ *
136
+ * https://stenciljs.com/docs/component-lifecycle#connectedcallback
137
+ */
127
138
  componentWillLoad(): void;
128
139
  render(): any;
129
140
  }
@@ -153,9 +153,20 @@ export declare class OntarioHeader {
153
153
  */
154
154
  handleClick(event: any): void;
155
155
  /**
156
- * This listens for the `setAppLanguage` event sent from the test language toggler when it is is connected to the DOM. It is used for the initial language when the input component loads.
156
+ * This listens for the `setAppLanguage` event sent from the language toggle when it is is connected to the DOM.
157
+ * It is used for the initial language when the input component loads.
157
158
  */
158
- handleSetAppLanguage(event: CustomEvent<Language>): void;
159
+ handleSetAppLanguage(event: CustomEvent<Language> | Language): void;
160
+ /**
161
+ * This listens for the `headerLanguageToggled` event sent from the language toggle when it is is connected to the DOM.
162
+ * It is used for changing the component language after the language toggle has been activated.
163
+ */
164
+ handleLanguageToggle(
165
+ event: CustomEvent<{
166
+ oldLanguage: Language;
167
+ newLanguage: Language;
168
+ }>,
169
+ ): void;
159
170
  /**
160
171
  * Logic to handle the menu toggling
161
172
  */
@@ -2,7 +2,14 @@ import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { Language } from '../../utils/common/language-types';
3
3
  import { HeaderLanguageToggleEventDetails } from '../../utils/events/common-events.interface';
4
4
  export declare class OntarioLanguageToggle {
5
- language: Language | string;
5
+ /**
6
+ * The language of the component.
7
+ *
8
+ * In most cases, the language toggle should be the source of truth for determining the site language.
9
+ *
10
+ * Only pass a language value here if necessary.
11
+ */
12
+ language?: Language;
6
13
  /**
7
14
  * The size of the language toggle button.
8
15
  *
@@ -23,17 +30,77 @@ export declare class OntarioLanguageToggle {
23
30
  customLanguageToggle?: (event: globalThis.Event) => void;
24
31
  translations: any;
25
32
  /**
26
- * An event to set the Document's HTML lang property, and emit the toggled language to other components.
33
+ * Internal state used as the source of truth for component language.
27
34
  */
28
- setAppLanguage: EventEmitter<string>;
29
- setAppLanguageHandler(): void;
35
+ private languageState;
30
36
  /**
31
- * An event that emits to other components that the language toggle button has been toggled.
37
+ * Internal state used to render the text on the language toggle UI.
38
+ */
39
+ private oppositeLanguageLabel;
40
+ /**
41
+ * Updates the language and languageState props when changes to the language prop are detected.
32
42
  */
33
- headerLanguageToggled: EventEmitter<HeaderLanguageToggleEventDetails>;
34
- handleHeaderLanguageToggled(language: string, event?: globalThis.Event): void;
35
43
  updateLanguage(): void;
36
- updateHTMLLang: (lang: string) => void;
44
+ /**
45
+ * Event that fires during the setAppLanguageHandler() method.
46
+ *
47
+ * The event contains the current language (after language logic has already occurred).
48
+ */
49
+ setAppLanguage: EventEmitter<Language>;
50
+ /**
51
+ * Event that fires when the language toggle is pressed/clicked.
52
+ *
53
+ * The event contains the oldLanguage along with the newLanguage.
54
+ */
55
+ headerLanguageToggled: EventEmitter<HeaderLanguageToggleEventDetails>;
56
+ /**
57
+ * This function sets the languageState (if not already set).
58
+ *
59
+ * It also emits the setAppLanguage() event, updates the component language label, and
60
+ * updates the <html> tag lang attribute with the languageState value.
61
+ *
62
+ * It gets called by the connectedCallback() component lifecycle hook, and by the
63
+ * updateLanguage() method, which is fired on the watch for the language prop.
64
+ */
65
+ private setAppLanguageHandler;
66
+ /**
67
+ * An event that emits to other components that the language toggle button has been toggled.
68
+ *
69
+ * @param {Language} oldLanguage - The language prior to the language toggle being pressed.
70
+ * @param {globalThis.Event} event - event that triggered the function (e.g. onclick).
71
+ */
72
+ private handleHeaderLanguageToggled;
73
+ /**
74
+ * Prints a warning message to the console about using an incorrect language for the component.
75
+ *
76
+ * @param {string} lang - The incorrect language that was received.
77
+ * @param {string} type - prop/document | Where the incorrect language is coming from.
78
+ */
79
+ private showLanguageWarning;
80
+ /**
81
+ * Returns abbreviated text for the opposite language.
82
+ *
83
+ * @returns {Language}
84
+ */
85
+ private getOppositeLanguageAbbrievation;
86
+ /**
87
+ * Returns full word text for the opposite language.
88
+ *
89
+ * @returns {string}
90
+ */
91
+ private getOppositeLanguageFullWord;
92
+ private updateHTMLLang;
93
+ /**
94
+ * Component life cycle hook.
95
+ *
96
+ * https://stenciljs.com/docs/component-lifecycle#connectedcallback
97
+ */
37
98
  connectedCallback(): void;
99
+ /**
100
+ * Component life cycle hook.
101
+ *
102
+ * https://stenciljs.com/docs/component-lifecycle#componentdidload
103
+ */
104
+ componentDidLoad(): void;
38
105
  render(): any;
39
106
  }
@@ -0,0 +1,180 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { Language } from '../../utils/common/language-types';
3
+ import { Hint } from '../../utils/common/common.interface';
4
+ import {
5
+ InputFocusBlurEvent,
6
+ InputInteractionEvent,
7
+ InputInputEvent,
8
+ } from '../../utils/events/event-handler.interface';
9
+ import { Caption } from '../../utils/common/input-caption/caption.interface';
10
+ export declare class OntarioSearchBox {
11
+ element: HTMLElement;
12
+ internals: ElementInternals;
13
+ /**
14
+ * This Ref is used get a direct reference to the hint text element
15
+ */
16
+ private hintTextRef?;
17
+ /**
18
+ * This Ref is used get a direct reference to the search input element
19
+ */
20
+ private inputFieldRef?;
21
+ /**
22
+ * The language of the component.
23
+ * This is used for translations. If none is passed, it will default to English.
24
+ */
25
+ language?: Language;
26
+ /**
27
+ * The unique identifier of the search-box component. This is optional - if no ID is passed, one will be generated.
28
+ */
29
+ elementId?: string;
30
+ /**
31
+ * The value of the search term.
32
+ * This is optional.
33
+ */
34
+ value?: string;
35
+ /**
36
+ * The text to display as the input label
37
+ *
38
+ * @example
39
+ * <ontario-search-box
40
+ *      caption='{
41
+ "captionText": "Search directory",
42
+ "captionType": "default"
43
+ }'
44
+ required = "true"
45
+ >
46
+ </ontario-search-box>
47
+ */
48
+ caption: Caption | string;
49
+ /**
50
+ * This is used to determine whether the dropdown list is required or not.
51
+ * This prop gets passed to the InputCaption utility to display either an optional or required flag in the label.
52
+ * If no prop is set, it will default to false (optional).
53
+ */
54
+ required?: boolean;
55
+ /**
56
+ * This Function to perform a search operation.
57
+ * This function will be called when the search submit button is triggered.
58
+ * The value argument is used for as search term to use for the search operation. This parameter is optional.
59
+ * The performSearch prop can be set dynamically using JavaScript, allowing you to define custom search functionality when the search form is submitted.
60
+ *
61
+ * @example
62
+ * <ontario-search-box
63
+ * id="ontario-search-box"
64
+ * caption='Search directory'
65
+ * ></ontario-search-box>
66
+ *
67
+ * <script>
68
+ * window.addEventListener('load', () => {
69
+ * const searchBox = document.getElementById('ontario-search-box');
70
+ * searchBox.performSearch = async (value) => {
71
+ * console.log('Performing search with value:', value);
72
+ * };
73
+ * });
74
+ * </script>
75
+ */
76
+ performSearch?: (value?: string) => Promise<void>;
77
+ /**
78
+ * Used to include the ontario-hint-text component for the search-box.
79
+ * This is optional.
80
+ */
81
+ hintText?: string | Hint;
82
+ /**
83
+ * Used to add a custom function to the input onInput event.
84
+ */
85
+ customOnInput?: (event: globalThis.Event) => void;
86
+ /**
87
+ * Used to add a custom function to the input onChange event.
88
+ */
89
+ customOnChange?: (event: globalThis.Event) => void;
90
+ /**
91
+ * Used to add a custom function to the input onBlur event.
92
+ */
93
+ customOnBlur?: (event: globalThis.Event) => void;
94
+ /**
95
+ * Used to add a custom function to the input onFocus event.
96
+ */
97
+ customOnFocus?: (event: globalThis.Event) => void;
98
+ /**
99
+ * Emitted when the search is submitted.
100
+ * Below is an example on how to hook into the event to get the event details.
101
+ *
102
+ * @example
103
+ * <script>
104
+ * document.getElementById('ontario-search-box').addEventListener('searchOnSubmit', (event) => {
105
+ * const searchValue = event.detail;
106
+ * console.log('Search submitted with value:', searchValue);
107
+ * };
108
+ * </script>
109
+ */
110
+ searchOnSubmit: EventEmitter<string>;
111
+ /**
112
+ * Emitted when a input  occurs when an input has been changed.
113
+ */
114
+ inputOnInput: EventEmitter<InputInputEvent>;
115
+ /**
116
+ * Emitted when a keyboard input or mouse event occurs when an input has been changed.
117
+ */
118
+ inputOnChange: EventEmitter<InputInteractionEvent>;
119
+ /**
120
+ * Emitted when a keyboard input event occurs when an input has lost focus.
121
+ */
122
+ inputOnBlur: EventEmitter<InputFocusBlurEvent>;
123
+ /**
124
+ * Emitted when a keyboard input event occurs when an input has gained focus.
125
+ */
126
+ inputOnFocus: EventEmitter<InputFocusBlurEvent>;
127
+ /**
128
+ * The hint text options are re-assigned to the internalHintText array.
129
+ */
130
+ private internalHintText;
131
+ /**
132
+ * Instantiate an InputCaption object for internal logic use
133
+ */
134
+ private captionState;
135
+ /**
136
+ * Used for the `aria-describedby` value of the dropdown list. This will match with the id of the hint text.
137
+ */
138
+ hintTextId: string | null | undefined;
139
+ /**
140
+ * Watch for changes to the `hintText` prop.
141
+ *
142
+ * If a `hintText` prop is passed, the `constructHintTextObject` function will convert it to the correct format, and set the result to the `internalHintText` state.
143
+ */
144
+ private parseHintText;
145
+ /**
146
+ * Watch for changes to the `caption` prop.
147
+ *
148
+ * The caption will be run through the InputCaption constructor to convert it to the correct format, and set the result to the `captionState` state.
149
+ * @param newValue: Caption | string
150
+ */
151
+ private updateCaptionState;
152
+ /**
153
+ * Watch for changes to the `language` prop to render either the English or French translations
154
+ */
155
+ updateLanguage(): void;
156
+ /**
157
+ * If a `hintText` prop is passed, the id generated from it will be set to the internal `hintTextId` state to match with the select `aria-describedBy` attribute.
158
+ */
159
+ componentDidLoad(): Promise<void>;
160
+ componentWillLoad(): void;
161
+ /**
162
+ * Function to handle input events and the information pertaining to the input to emit.
163
+ */
164
+ private handleEvent;
165
+ /**
166
+ * handleSearch function is called when the search submit button is clicked
167
+ */
168
+ handleSearch(event: MouseEvent): Promise<void>;
169
+ getId(): string;
170
+ private getValue;
171
+ /**
172
+ *This function ensures that the focus returns to the search input field when the reset button is clicked.
173
+ */
174
+ private setFocus;
175
+ /**
176
+ * when the reset button is clicked this function gets called
177
+ */
178
+ handleFocus: () => void;
179
+ render(): any;
180
+ }