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

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 (73) hide show
  1. package/dist/cjs/app-globals-6f6b30a8.js.map +1 -1
  2. package/dist/cjs/ontario-accordion_44.cjs.entry.js +19 -7
  3. package/dist/cjs/ontario-accordion_44.cjs.entry.js.map +1 -1
  4. package/dist/collection/components/ontario-date-input/test/ontario-date-input.spec.js +58 -0
  5. package/dist/collection/components/ontario-date-input/test/ontario-date-input.spec.js.map +1 -1
  6. package/dist/collection/components/ontario-date-input/utils/date-validation-utils.js +14 -4
  7. package/dist/collection/components/ontario-date-input/utils/date-validation-utils.js.map +1 -1
  8. package/dist/collection/fonts/open-sans-400/LICENSE.txt +0 -0
  9. package/dist/collection/fonts/open-sans-400/open-sans-400.eot +0 -0
  10. package/dist/collection/fonts/open-sans-400/open-sans-400.svg +0 -0
  11. package/dist/collection/fonts/open-sans-400/open-sans-400.ttf +0 -0
  12. package/dist/collection/fonts/open-sans-400/open-sans-400.woff +0 -0
  13. package/dist/collection/fonts/open-sans-400/open-sans-400.woff2 +0 -0
  14. package/dist/collection/fonts/open-sans-700/LICENSE.txt +0 -0
  15. package/dist/collection/fonts/open-sans-700/open-sans-700.eot +0 -0
  16. package/dist/collection/fonts/open-sans-700/open-sans-700.svg +0 -0
  17. package/dist/collection/fonts/open-sans-700/open-sans-700.ttf +0 -0
  18. package/dist/collection/utils/helper/utils.js +4 -2
  19. package/dist/collection/utils/helper/utils.js.map +1 -1
  20. package/dist/collection/utils/helper/utils.spec.js +99 -1
  21. package/dist/collection/utils/helper/utils.spec.js.map +1 -1
  22. package/dist/components/ontario-date-input.js +13 -3
  23. package/dist/components/ontario-date-input.js.map +1 -1
  24. package/dist/components/ontario-header.js +2 -2
  25. package/dist/components/utils.js +4 -2
  26. package/dist/components/utils.js.map +1 -1
  27. package/dist/esm/app-globals-70748594.js.map +1 -1
  28. package/dist/esm/ontario-accordion_44.entry.js +19 -7
  29. package/dist/esm/ontario-accordion_44.entry.js.map +1 -1
  30. package/dist/esm/polyfills/core-js.js +0 -0
  31. package/dist/esm/polyfills/dom.js +0 -0
  32. package/dist/esm/polyfills/es5-html-element.js +0 -0
  33. package/dist/esm/polyfills/index.js +0 -0
  34. package/dist/esm/polyfills/system.js +0 -0
  35. package/dist/ontario-design-system-components/fonts/open-sans-400/LICENSE.txt +0 -0
  36. package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.eot +0 -0
  37. package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.svg +0 -0
  38. package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.ttf +0 -0
  39. package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.woff +0 -0
  40. package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.woff2 +0 -0
  41. package/dist/ontario-design-system-components/fonts/open-sans-700/LICENSE.txt +0 -0
  42. package/dist/ontario-design-system-components/fonts/open-sans-700/open-sans-700.eot +0 -0
  43. package/dist/ontario-design-system-components/fonts/open-sans-700/open-sans-700.svg +0 -0
  44. package/dist/ontario-design-system-components/fonts/open-sans-700/open-sans-700.ttf +0 -0
  45. package/dist/ontario-design-system-components/ontario-design-system-components.esm.js +1 -1
  46. package/dist/ontario-design-system-components/p-103a233b.js.map +1 -1
  47. package/dist/ontario-design-system-components/{p-9c3a1be9.entry.js → p-ac4e76b2.entry.js} +8 -6
  48. package/dist/ontario-design-system-components/p-ac4e76b2.entry.js.map +1 -0
  49. package/dist/types/components/ontario-date-input/utils/date-validation-utils.d.ts +14 -0
  50. package/package.json +3 -3
  51. package/src/components/ontario-date-input/test/ontario-date-input.spec.tsx +76 -0
  52. package/src/components/ontario-date-input/utils/date-validation-utils.ts +18 -4
  53. package/src/config.json +1 -4
  54. package/src/utils/helper/utils.spec.ts +127 -1
  55. package/src/utils/helper/utils.ts +4 -2
  56. package/www/build/ontario-design-system-components.esm.js +1 -1
  57. package/www/build/p-103a233b.js.map +1 -1
  58. package/www/build/{p-9c3a1be9.entry.js → p-ac4e76b2.entry.js} +8 -6
  59. package/www/build/p-ac4e76b2.entry.js.map +1 -0
  60. package/www/build/{p-84035ac3.js → p-c9a9b857.js} +1 -1
  61. package/www/fonts/open-sans-400/LICENSE.txt +0 -0
  62. package/www/fonts/open-sans-400/open-sans-400.eot +0 -0
  63. package/www/fonts/open-sans-400/open-sans-400.svg +0 -0
  64. package/www/fonts/open-sans-400/open-sans-400.ttf +0 -0
  65. package/www/fonts/open-sans-400/open-sans-400.woff +0 -0
  66. package/www/fonts/open-sans-400/open-sans-400.woff2 +0 -0
  67. package/www/fonts/open-sans-700/LICENSE.txt +0 -0
  68. package/www/fonts/open-sans-700/open-sans-700.eot +0 -0
  69. package/www/fonts/open-sans-700/open-sans-700.svg +0 -0
  70. package/www/fonts/open-sans-700/open-sans-700.ttf +0 -0
  71. package/www/index.html +2 -2
  72. package/dist/ontario-design-system-components/p-9c3a1be9.entry.js.map +0 -1
  73. package/www/build/p-9c3a1be9.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"ontario-date-input.js","mappings":";;;;;;;;;;;AAmBO,MAAM,KAAK,GAAoC,CAAC,EACtD,EAAE,EACF,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,eAAe,EACf,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,KAAK,GAChB;IACA,MAAM,gBAAgB,GAAG,CAAC,KAAY;;QACrC,MAAM,QAAQ,GAAG,MAAA,MAAC,KAAK,CAAC,MAA2B,0CAAE,KAAK,mCAAI,EAAE,CAAC;QACjE,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KACxB,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAAY;;QACtC,MAAM,QAAQ,GAAG,MAAA,MAAC,KAAK,CAAC,MAA2B,0C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-date-input/components/input.tsx","src/components/ontario-date-input/constants/date-input-constants.ts","src/components/ontario-date-input/utils/date-validation-utils.ts","src/components/ontario-date-input/utils/date-options-utils.ts","src/components/ontario-date-input/ontario-date-input.scss?tag=ontario-date-input&encapsulation=shadow","src/components/ontario-date-input/ontario-date-input.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\nimport { DateInputFieldType } from '../ontario-date-input-interface';\nimport { Input as CommonInput } from '../../../utils/common/input/input';\n\nexport type InputProps = {\n\tid: string;\n\ttype: DateInputFieldType;\n\tlabel: string;\n\taccessibilityLabel: string;\n\terror?: boolean;\n\tonInput: (value: string, fieldType: DateInputFieldType) => void;\n\tonChange: (value: string, fieldType: DateInputFieldType) => void;\n\tonBlur: (fieldType: DateInputFieldType) => void;\n\tonFocus: (fieldType: DateInputFieldType) => void;\n\tplaceholder?: string;\n\trequired?: boolean;\n\tariaDescribedBy?: string;\n};\n\nexport const Input: FunctionalComponent<InputProps> = ({\n\tid,\n\ttype,\n\tlabel,\n\taccessibilityLabel,\n\tplaceholder,\n\tonInput,\n\tonChange,\n\tonFocus,\n\tonBlur,\n\tariaDescribedBy,\n\terror = false,\n\trequired = false,\n}) => {\n\tconst handleInputInput = (event: Event) => {\n\t\tconst newValue = (event.target as HTMLInputElement)?.value ?? '';\n\t\tonInput(newValue, type);\n\t};\n\n\tconst handleInputChange = (event: Event) => {\n\t\tconst newValue = (event.target as HTMLInputElement)?.value ?? '';\n\t\tonChange(newValue, type);\n\t};\n\n\tconst handleInputFocus = () => {\n\t\tonFocus(type);\n\t};\n\n\tconst handleInputBlur = () => {\n\t\tonBlur(type);\n\t};\n\n\treturn (\n\t\t<div class={`ontario-date__group-input ${error ? 'ontario-date--error' : ''}`}>\n\t\t\t<label htmlFor={id}>\n\t\t\t\t{label}\n\t\t\t\t<span class=\"ontario-show-for-sr\">({accessibilityLabel})</span>\n\t\t\t</label>\n\t\t\t<CommonInput\n\t\t\t\tclassName=\"ontario-input ontario-input--4-char-width\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tinputMode=\"numeric\"\n\t\t\t\tid={id}\n\t\t\t\trequired={!!required}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonInput={handleInputInput}\n\t\t\t\tonChange={handleInputChange}\n\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\tariaInvalid={error}\n\t\t\t\tariaDescribedBy={ariaDescribedBy}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","export const DAY_MIN_VALUE = 1;\nexport const DAY_MAX_VALUE = 31;\nexport const MONTH_MIN_VALUE = 1;\nexport const MONTH_MAX_VALUE = 12;\nexport const YEAR_MIN_VALUE = 999;\nexport const YEAR_MAX_VALUE = 9999;\n","import {\n\tDAY_MIN_VALUE,\n\tDAY_MAX_VALUE,\n\tMONTH_MIN_VALUE,\n\tMONTH_MAX_VALUE,\n\tYEAR_MIN_VALUE,\n\tYEAR_MAX_VALUE,\n} from '../constants';\nimport { DateValidatorReturnType } from '../ontario-date-input-interface';\nimport { isNumber, isEmpty } from '../../../utils/helper/utils';\nimport { Translations } from '../../../translations';\n/*\n * Day field should be a number, not negative, no greater than “31”\n */\nconst isInvalidDay = (value: string) => {\n\tif (!isNumber(value)) {\n\t\treturn true;\n\t}\n\n\tconst day = Number(value);\n\n\treturn day < DAY_MIN_VALUE || day > DAY_MAX_VALUE;\n};\n\n/*\n * Month field should be a number, not negative, no greater than “12”\n */\nconst isInvalidMonth = (value: string) => {\n\tif (!isNumber(value)) {\n\t\treturn true;\n\t}\n\n\tconst month = Number(value);\n\n\treturn month < MONTH_MIN_VALUE || month > MONTH_MAX_VALUE;\n};\n\n/*\n * Year field should be a number, not negative, at length at least 4 digits\n */\nconst isInvalidYear = (value: string, minYear: number = YEAR_MIN_VALUE, maxYear: number = YEAR_MAX_VALUE) => {\n\tif (!isNumber(value)) {\n\t\treturn true;\n\t}\n\n\tconst year = Number(value);\n\n\treturn year <= minYear || year > maxYear;\n};\n\ntype GetDateErrorArg = {\n\tdayValue: string;\n\tmonthValue: string;\n\tyearValue: string;\n\terrorMessages: Translations['dateInput']['error']['en'];\n\tminYear?: number;\n\tmaxYear?: number;\n\tdayVisible: boolean;\n\tmonthVisible: boolean;\n\tyearVisible: boolean;\n};\n/**\n * Helper function to get error message for birthdate validation\n */\nexport const getDateErrorMessage = ({\n\tdayValue,\n\tmonthValue,\n\tyearValue,\n\terrorMessages,\n\tminYear,\n\tmaxYear,\n\tdayVisible,\n\tmonthVisible,\n\tyearVisible,\n}: GetDateErrorArg): DateValidatorReturnType => {\n\tconst {\n\t\temptyDay,\n\t\temptyMonth,\n\t\temptyYear,\n\t\temptyDayAndMonth,\n\t\temptyDayAndYear,\n\t\temptyMonthAndYear,\n\t\tinvalidDate,\n\t\tinvalidDay,\n\t\tinvalidMonth,\n\t\tinvalidYear,\n\t} = errorMessages;\n\n\tlet error = '';\n\tlet dayInvalid = false;\n\tlet monthInvalid = false;\n\tlet yearInvalid = false;\n\n\tconst isDayEmpty = dayVisible && isEmpty(dayValue);\n\tconst isMonthEmpty = monthVisible && isEmpty(monthValue);\n\tconst isYearEmpty = yearVisible && isEmpty(yearValue);\n\t/*\n\t * If one ore more fields are valid but others are empty:\n\t * 1 field empty:\n\t * Day as empty - “Enter the day.”\n\t * Month as empty - “Enter the month.”\n\t * Year as empty - “Enter the year.”\n\t * 2 fields empty:\n\t * Month and day empty - “Enter the month and day.”\n\t * Year and day empty - “Enter the year and day.”\n\t * Year and month empty - “Enter the year and month.”\n\t */\n\tif (isDayEmpty && isMonthEmpty && isYearEmpty) {\n\t\terror = invalidDate;\n\t\tdayInvalid = true;\n\t\tmonthInvalid = true;\n\t\tyearInvalid = true;\n\t} else if (isDayEmpty && isMonthEmpty) {\n\t\terror = emptyDayAndMonth;\n\t\tdayInvalid = true;\n\t\tmonthInvalid = true;\n\t} else if (isDayEmpty && isYearEmpty) {\n\t\terror = emptyDayAndYear;\n\t\tdayInvalid = true;\n\t\tyearInvalid = true;\n\t} else if (isMonthEmpty && isYearEmpty) {\n\t\terror = emptyMonthAndYear;\n\t\tyearInvalid = true;\n\t\tmonthInvalid = true;\n\t} else if (isDayEmpty) {\n\t\terror = emptyDay;\n\t\tdayInvalid = true;\n\t} else if (isMonthEmpty) {\n\t\terror = emptyMonth;\n\t\tmonthInvalid = true;\n\t} else if (isYearEmpty) {\n\t\terror = emptyYear;\n\t\tyearInvalid = true;\n\t}\n\n\tconst isDayInvalid = dayVisible && isInvalidDay(dayValue);\n\tconst isMonthInvalid = monthVisible && isInvalidMonth(monthValue);\n\tconst isYearInvalid = yearVisible && isInvalidYear(yearValue, minYear, maxYear);\n\t/*\n\t * If only one error, specify where the error occurs\n\t * E.g. “Enter a valid day.”, “Enter a valid month.” Or “Enter a valid year.”\n\t * If 2 or more fields have error (or all 3), say “Enter a valid date.”\n\t * If one or more fields are invalid but the others are empty say: “Enter a valid date.”\n\t */\n\tif (isEmpty(error)) {\n\t\tif (isDayInvalid && isMonthInvalid && isYearInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tdayInvalid = true;\n\t\t\tmonthInvalid = true;\n\t\t\tyearInvalid = true;\n\t\t} else if (isDayInvalid && isMonthInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tdayInvalid = true;\n\t\t\tmonthInvalid = true;\n\t\t} else if (isDayInvalid && isYearInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tdayInvalid = true;\n\t\t\tyearInvalid = true;\n\t\t} else if (isMonthInvalid && isYearInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tmonthInvalid = true;\n\t\t\tyearInvalid = true;\n\t\t} else if (isYearInvalid) {\n\t\t\terror = invalidYear;\n\t\t\tyearInvalid = true;\n\t\t} else if (isMonthInvalid) {\n\t\t\terror = invalidMonth;\n\t\t\tmonthInvalid = true;\n\t\t} else if (isDayInvalid) {\n\t\t\terror = invalidDay;\n\t\t\tdayInvalid = true;\n\t\t}\n\t}\n\n\treturn { errorMessage: error, dayInvalid, monthInvalid, yearInvalid };\n};\n","import { DateInputFieldType } from '../ontario-date-input-interface';\n\nexport const getVisibleDateFields = (dateOptions: Array<DateInputFieldType>) => {\n\tconst dayVisible = dateOptions.includes('day');\n\tconst monthVisible = dateOptions.includes('month');\n\tconst yearVisible = dateOptions.includes('year');\n\n\treturn { dayVisible, monthVisible, yearVisible };\n};\n","@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/4-elements/_global.elements.scss';\n@use '../../styles/form.scss';\n@forward '../../utils/components/error-message/error-message';\n\n.ontario-date__group {\n\tdisplay: flex;\n\n\tlabel {\n\t\tfont-weight: fontWeights.$ontario-font-weights-semi-bold;\n\t}\n\n\tinput {\n\t\tmargin-top: spacing.$spacing-4;\n\t}\n}\n\n.ontario-date__group-input {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-right: spacing.$spacing-5;\n}\n\n.ontario-date--error {\n\tinput {\n\t\tborder: 0.125rem solid colours.$ontario-colour-alert;\n\t}\n}\n","import { Component, EventEmitter, Element, Watch, Event, Prop, h, State, Listen, AttachInternals } from '@stencil/core';\nimport { v4 as uuid } from 'uuid';\nimport { Language } from '../../utils/common/language-types';\nimport { validateLanguage } from '../../utils/validation/validation-functions';\nimport { translations, Translations } from '../../translations';\nimport { Input } from './components';\nimport { getDateErrorMessage, getVisibleDateFields } from './utils';\nimport { DateInputFieldType, DateInputPlaceholder, DateValidatorReturnType } from './ontario-date-input-interface';\nimport { ErrorMessage } from '../../utils/components/error-message/error-message';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\nimport { ConsoleType } from '../../utils/console-message/console-message.enum';\nimport { InputCaption } from '../../utils/common/input-caption/input-caption';\nimport { Caption } from '../../utils/common/input-caption/caption.interface';\nimport { emitEvent } from '../../utils/events/event-handler';\n\n@Component({\n\ttag: 'ontario-date-input',\n\tstyleUrl: 'ontario-date-input.scss',\n\tshadow: true,\n\tformAssociated: true,\n})\nexport class OntarioDateInput {\n\t@Element() element: HTMLElement;\n\t@AttachInternals() internals: ElementInternals;\n\n\t/**\n\t * The language of the component.\n\t * This is used for translations, and is by default set through event listeners checking for a language property from the header. If none are passed, it will default to English.\n\t */\n\t@Prop({ mutable: true }) language?: Language;\n\n\t/**\n\t * A boolean value to determine whether or not the date input is required.\n\t *\n\t * This is optional. If no prop is passed, it will default to `false`.\n\t */\n\t@Prop() required?: boolean = false;\n\n\t/**\n\t * An object value used to set the placeholder text for the day, month and year input fields. Any combination of the three input fields (i.e day, month, year)\n\t * of the date component can be overridden.\n\t *\n\t * This is optional. If no prop is passed, it will not display any placeholder text.\n\t */\n\t@Prop() placeholder?: DateInputPlaceholder | string;\n\n\t/**\n\t * The text to display as the input label\n\t *\n\t * @example\n\t * <ontario-date-input\n\t * caption='{\n\t * \"captionText\": \"Exact Date\",\n\t * \"captionType\": \"heading\",\n\t * }\n\t * required=\"true\"\n\t * ...>\n\t * </ontario-date-input>\n\t */\n\t@Prop() caption: Caption | string;\n\n\t/**\n\t * The unique identifier of the input. This is optional - if no ID is passed, one will be generated.\n\t */\n\t@Prop({ mutable: true }) elementId?: string;\n\n\t/**\n\t * A number value indicating minimum value allowed for year input field of the date component.\n\t *\n\t * This is optional. If no prop is passed, it will default to `999`.\n\t */\n\t@Prop() minYear?: number;\n\n\t/**\n\t * A number value indicating maximum value allowed for year input field of the date component.\n\t *\n\t * This is optional. If no prop is passed, it will default to `9999`.\n\t */\n\t@Prop() maxYear?: number;\n\n\t/**\n\t * Used to include the ontario-hint-text component for the date input group.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() hintText?: string;\n\n\t/**\n\t * An array value used to display date options. For example, only the day and month fields can be displayed by\n\t * specifying the dateOptions as `[\"day\", \"month\"]`, etc.\n\t *\n\t * This is optional. If no prop for `dateOptions` is passed, it will default to `[\"day\", \"month\", \"year\"]`.\n\t */\n\t@Prop() dateOptions?: string | Array<DateInputFieldType> = ['day', 'month', 'year'];\n\n\t/**\n\t * A function used to override internal date validation logic, which takes three arguments (i.e day, month and year) and returns\n\t * an object of type `DateValidatorReturnType`\n\t *\n\t * This is optional. If no prop for `dateValidator` is passed, it will default to internal validation function to validate\n\t * the date input.\n\t */\n\t@Prop() dateValidator?: (day: string, month: string, year: string) => DateValidatorReturnType;\n\n\t/**\n\t * Emitted when an `input` event occurs within the component.\n\t */\n\t@Event() inputOnInput: EventEmitter<{\n\t\tvalue: string;\n\t\tfieldType: 'day' | 'month' | 'year';\n\t}>;\n\n\t/**\n\t * Emitted when a `change` event occurs within the component.\n\t */\n\t@Event() inputOnChange: EventEmitter<{\n\t\tvalue: string;\n\t\tfieldType: 'day' | 'month' | 'year';\n\t}>;\n\n\t/**\n\t * Emitted when a keyboard input event occurs when an input has lost focus.\n\t */\n\t@Event() inputOnBlur: EventEmitter<'day' | 'month' | 'year'>;\n\n\t/**\n\t * Emitted when a keyboard input event occurs when an input has gained focus.\n\t */\n\t@Event() inputOnFocus: EventEmitter<'day' | 'month' | 'year'>;\n\n\t/**\n\t * Emitted when an error message is reported to the component.\n\t */\n\t@Event() inputErrorOccurred: EventEmitter<{ inputId: string; errorMessage: string }>;\n\n\t@Watch('errorMessage')\n\tbroadcastInputErrorOccurredEvent() {\n\t\t// Emit event to notify anyone who wants to listen for errors occurring\n\t\tthis.inputErrorOccurred.emit({ inputId: this.getId(), errorMessage: this.errorMessage ?? '' });\n\t}\n\n\t/**\n\t * 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.\n\t */\n\t@Listen('setAppLanguage', { target: 'window' })\n\thandleSetAppLanguage(event: CustomEvent<Language>) {\n\t\tif (!this.language) {\n\t\t\tthis.language = validateLanguage(event);\n\t\t}\n\t}\n\n\t@Listen('headerLanguageToggled', { target: 'window' })\n\thandleHeaderLanguageToggled(event: CustomEvent<Language>) {\n\t\tthis.language = validateLanguage(event);\n\t}\n\n\t@Listen('blur', { capture: true })\n\thandleComponentBlur() {\n\t\tconst { day, month, year, minYear, maxYear, dateValidator, dateOptionsState } = this;\n\t\tconst { dayVisible, monthVisible, yearVisible } = getVisibleDateFields(dateOptionsState);\n\n\t\t// if user has not interacted with the component, skip validation\n\t\tif (!this.isDateTyped) {\n\t\t\treturn;\n\t\t}\n\t\tconst errorMessages = translations.dateInput.error[this.getLanguage()];\n\t\tconst { dayInvalid, monthInvalid, yearInvalid, errorMessage } = dateValidator\n\t\t\t? dateValidator(day, month, year)\n\t\t\t: getDateErrorMessage({\n\t\t\t\t\tdayValue: day,\n\t\t\t\t\tmonthValue: month,\n\t\t\t\t\tyearValue: year,\n\t\t\t\t\terrorMessages,\n\t\t\t\t\tminYear,\n\t\t\t\t\tmaxYear,\n\t\t\t\t\tdayVisible,\n\t\t\t\t\tmonthVisible,\n\t\t\t\t\tyearVisible,\n\t\t\t });\n\n\t\tthis.dayInvalid = dayInvalid;\n\t\tthis.monthInvalid = monthInvalid;\n\t\tthis.yearInvalid = yearInvalid;\n\t\tthis.errorMessage = errorMessage;\n\t}\n\n\t@State() private translations: Translations = translations;\n\t@State() private captionState: InputCaption;\n\n\t@State() private isDateTyped: boolean = false;\n\t@State() private dayInvalid: boolean = false;\n\t@State() private monthInvalid: boolean = false;\n\t@State() private yearInvalid: boolean = false;\n\t@State() private errorMessage: string | undefined;\n\n\t@State() private day: string = '';\n\t@State() private month: string = '';\n\t@State() private year: string = '';\n\n\t@State() private placeholderState: DateInputPlaceholder;\n\t@State() private dateOptionsState: Array<DateInputFieldType>;\n\n\t/**\n\t * Watch for changes to the `caption` prop.\n\t *\n\t * The caption will be run through the InputCaption constructor to convert it to the correct format, and set the result to the `captionState` state.\n\t * @param newValue: Caption | string\n\t */\n\t@Watch('caption')\n\tprivate updateCaptionState(newValue: Caption | string) {\n\t\tthis.captionState = new InputCaption(\n\t\t\tthis.element.tagName,\n\t\t\tnewValue,\n\t\t\ttranslations,\n\t\t\tthis.language,\n\t\t\ttrue,\n\t\t\tthis.required,\n\t\t);\n\t}\n\n\t/**\n\t * Watch for changes in the `language` prop to render either the English or French translations\n\t */\n\t@Watch('language')\n\tupdateLanguage() {\n\t\tthis.updateCaptionState(this.caption);\n\t}\n\n\tprivate processPlaceholder() {\n\t\tthis.parseOptions(this.placeholder);\n\t}\n\n\tprivate processDateOptions() {\n\t\tthis.parseOptions(this.dateOptions);\n\t}\n\n\tprivate parseOptions(options: any) {\n\t\tconst isString = typeof options === 'string';\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tif (options === this.placeholder) {\n\t\t\t\tthis.placeholderState = isString ? JSON.parse(options) : options;\n\t\t\t} else if (options === this.dateOptions) {\n\t\t\t\tthis.dateOptionsState = isString ? JSON.parse(options) : options;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addRegularText(' failed to parse props for ')\n\t\t\t\t.addMonospaceText('<ontario-date-input>')\n\t\t\t\t.addRegularText(' in ')\n\t\t\t\t.addMonospaceText('parseOptions()')\n\t\t\t\t.addRegularText(' method \\n ')\n\t\t\t\t.addMonospaceText(error.stack)\n\t\t\t\t.printMessage(ConsoleType.Error);\n\t\t}\n\t}\n\n\tprivate isInvalidDate = () => {\n\t\treturn this.dayInvalid || this.monthInvalid || this.yearInvalid;\n\t};\n\n\tprivate resetErrorState = () => {\n\t\tif (!this.isInvalidDate()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.dayInvalid = false;\n\t\tthis.monthInvalid = false;\n\t\tthis.yearInvalid = false;\n\t\tthis.errorMessage = '';\n\t};\n\n\tprivate updateDateState = (value: string, inputFieldType: DateInputFieldType) => {\n\t\tswitch (inputFieldType) {\n\t\t\tcase 'day':\n\t\t\t\tthis.day = value;\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\tthis.month = value;\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t\tthis.year = value;\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tprivate handleDateUpdates = (value: string, fieldType: DateInputFieldType) => {\n\t\t// set boolean indicating user interaction with the component for validation\n\t\tif (!this.isDateTyped) {\n\t\t\tthis.isDateTyped = true;\n\t\t}\n\n\t\t// reset error state when user starts typing\n\t\tthis.resetErrorState();\n\n\t\t// update date state\n\t\tthis.updateDateState(value, fieldType);\n\n\t\t// TODO: verify are all the values numbers?\n\t\tif (this.year && this.month && this.day) {\n\t\t\tconst desiredDate = new Date(\n\t\t\t\tDate.UTC(parseInt(this.year), parseInt(this.month) - 1, parseInt(this.day), 0, 0, 0, 0),\n\t\t\t);\n\t\t\tthis.internals?.setFormValue?.(desiredDate.toISOString());\n\t\t}\n\t};\n\n\tprivate handleDateInput = (value: string, fieldType: DateInputFieldType) => {\n\t\tthis.handleDateUpdates(value, fieldType);\n\n\t\t// emit date change event\n\t\tthis.inputOnInput.emit({ value, fieldType });\n\t};\n\n\tprivate handleDateChanged = (value: string, fieldType: DateInputFieldType) => {\n\t\tthis.handleDateUpdates(value, fieldType);\n\n\t\t// emit date change event\n\t\tthis.inputOnChange.emit({ value, fieldType });\n\n\t\t// emit change event\n\t\temitEvent(this.element, 'change', { value, fieldType });\n\t};\n\n\tprivate handleDateFocus = (fieldType: DateInputFieldType) => {\n\t\t// emit date field focus event\n\t\tthis.inputOnFocus.emit(fieldType);\n\t};\n\n\tprivate handleDateBlur = (fieldType: DateInputFieldType) => {\n\t\t// emit date field focus event\n\t\tthis.inputOnBlur.emit(fieldType);\n\t};\n\n\tprivate getLanguage(): Language {\n\t\treturn this.language ?? 'en';\n\t}\n\n\tprivate getCaption(): Caption | string {\n\t\tconst language = this.getLanguage();\n\t\tconst captionText = translations.dateInput.caption[language];\n\n\t\treturn this.caption ?? { captionText, captionType: 'default' };\n\t}\n\n\tprivate getId(): string {\n\t\treturn this.elementId ?? '';\n\t}\n\n\tprivate getHintTextId(): string {\n\t\treturn `date-input-hint-${this.getId()}`;\n\t}\n\n\tprivate getInputIds() {\n\t\tconst id = this.getId();\n\n\t\tconst dayId = `day-${id}`;\n\t\tconst monthId = `month-${id}`;\n\t\tconst yearId = `year-${id}`;\n\n\t\treturn { dayId, monthId, yearId };\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.processPlaceholder();\n\t\tthis.processDateOptions();\n\n\t\tthis.updateCaptionState(this.getCaption());\n\t\tthis.elementId = this.elementId ?? uuid();\n\n\t\tthis.language = validateLanguage(this.language) as Language;\n\t}\n\n\trender() {\n\t\tconst { dateOptionsState, required, translations, hintText, placeholderState } = this;\n\t\tconst language = this.getLanguage();\n\t\tconst dateStrings = translations.dateInput;\n\t\tconst placeholderText = placeholderState ?? {};\n\t\tconst { dayVisible, monthVisible, yearVisible } = getVisibleDateFields(dateOptionsState);\n\t\tconst { dayId, monthId, yearId } = this.getInputIds();\n\t\tconst hintTextId = this.getHintTextId();\n\n\t\treturn (\n\t\t\t<div class=\"ontario-form-group\">\n\t\t\t\t<fieldset role=\"group\" class=\"ontario-fieldset\">\n\t\t\t\t\t{this.captionState.getCaption()}\n\t\t\t\t\t{!!hintText && (\n\t\t\t\t\t\t<p id={hintTextId} class=\"ontario-hint\">\n\t\t\t\t\t\t\t{hintText}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t\t<ErrorMessage message={this.errorMessage} error={this.isInvalidDate()} />\n\t\t\t\t\t<div class=\"ontario-date__group\">\n\t\t\t\t\t\t{yearVisible && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={yearId}\n\t\t\t\t\t\t\t\ttype=\"year\"\n\t\t\t\t\t\t\t\tlabel={dateStrings.year.label[language]}\n\t\t\t\t\t\t\t\taccessibilityLabel={dateStrings.year.accessibility[language]}\n\t\t\t\t\t\t\t\trequired={!!required}\n\t\t\t\t\t\t\t\terror={this.yearInvalid}\n\t\t\t\t\t\t\t\tplaceholder={placeholderText.year}\n\t\t\t\t\t\t\t\tonInput={this.handleDateInput}\n\t\t\t\t\t\t\t\tonChange={this.handleDateChanged}\n\t\t\t\t\t\t\t\tonBlur={this.handleDateBlur}\n\t\t\t\t\t\t\t\tonFocus={this.handleDateFocus}\n\t\t\t\t\t\t\t\tariaDescribedBy={hintTextId}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{monthVisible && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={monthId}\n\t\t\t\t\t\t\t\ttype=\"month\"\n\t\t\t\t\t\t\t\tlabel={dateStrings.month.label[language]}\n\t\t\t\t\t\t\t\taccessibilityLabel={dateStrings.month.accessibility[language]}\n\t\t\t\t\t\t\t\trequired={!!required}\n\t\t\t\t\t\t\t\terror={this.monthInvalid}\n\t\t\t\t\t\t\t\tplaceholder={placeholderText.month}\n\t\t\t\t\t\t\t\tonInput={this.handleDateInput}\n\t\t\t\t\t\t\t\tonChange={this.handleDateChanged}\n\t\t\t\t\t\t\t\tonBlur={this.handleDateBlur}\n\t\t\t\t\t\t\t\tonFocus={this.handleDateFocus}\n\t\t\t\t\t\t\t\tariaDescribedBy={hintTextId}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{dayVisible && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={dayId}\n\t\t\t\t\t\t\t\ttype=\"day\"\n\t\t\t\t\t\t\t\tlabel={dateStrings.day.label[language]}\n\t\t\t\t\t\t\t\taccessibilityLabel={dateStrings.day.accessibility[language]}\n\t\t\t\t\t\t\t\trequired={!!required}\n\t\t\t\t\t\t\t\terror={this.dayInvalid}\n\t\t\t\t\t\t\t\tplaceholder={placeholderText.day}\n\t\t\t\t\t\t\t\tonInput={this.handleDateInput}\n\t\t\t\t\t\t\t\tonChange={this.handleDateChanged}\n\t\t\t\t\t\t\t\tonBlur={this.handleDateBlur}\n\t\t\t\t\t\t\t\tonFocus={this.handleDateFocus}\n\t\t\t\t\t\t\t\tariaDescribedBy={hintTextId}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
1
+ {"file":"ontario-date-input.js","mappings":";;;;;;;;;;;AAmBO,MAAM,KAAK,GAAoC,CAAC,EACtD,EAAE,EACF,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,eAAe,EACf,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,KAAK,GAChB;IACA,MAAM,gBAAgB,GAAG,CAAC,KAAY;;QACrC,MAAM,QAAQ,GAAG,MAAA,MAAC,KAAK,CAAC,MAA2B,0CAAE,KAAK,mCAAI,EAAE,CAAC;QACjE,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KACxB,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAAY;;QACtC,MAAM,QAAQ,GAAG,MAAA,MAAC,KAAK,CAAC,MAA2B,0CAAE,KAAK,mCAAI,EAAE,CAAC;QACjE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KACzB,CAAC;IAEF,MAAM,gBAAgB,GAAG;QACxB,OAAO,CAAC,IAAI,CAAC,CAAC;KACd,CAAC;IAEF,MAAM,eAAe,GAAG;QACvB,MAAM,CAAC,IAAI,CAAC,CAAC;KACb,CAAC;IAEF,QACC,WAAK,KAAK,EAAE,6BAA6B,KAAK,GAAG,qBAAqB,GAAG,EAAE,EAAE;QAC5E,aAAO,OAAO,EAAE,EAAE;YAChB,KAAK;YACN,YAAM,KAAK,EAAC,qBAAqB;;gBAAG,kBAA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AC,KAAK,EAClC,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,MAAM,EAAE,IAAI,CAAC,cAAc,EAC3B,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,eAAe,EAAE,UAAU,GAC1B,CACF,EACA,UAAU,KACV,EAAC,KAAK,IACL,EAAE,EAAE,KAAK,EACT,IAAI,EAAC,KAAK,EACV,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACtC,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,EAC3D,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,KAAK,EAAE,IAAI,CAAC,UAAU,EACtB,WAAW,EAAE,eAAe,CAAC,GAAG,EAChC,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,MAAM,EAAE,IAAI,CAAC,cAAc,EAC3B,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,eAAe,EAAE,UAAU,GAC1B,CACF,CACI,CACI,CACN,EACL;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CommonInput","OntarioDateInput","uuid"],"sources":["src/components/ontario-date-input/components/input.tsx","src/components/ontario-date-input/constants/date-input-constants.ts","src/components/ontario-date-input/utils/date-validation-utils.ts","src/components/ontario-date-input/utils/date-options-utils.ts","src/components/ontario-date-input/ontario-date-input.scss?tag=ontario-date-input&encapsulation=shadow","src/components/ontario-date-input/ontario-date-input.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\nimport { DateInputFieldType } from '../ontario-date-input-interface';\nimport { Input as CommonInput } from '../../../utils/common/input/input';\n\nexport type InputProps = {\n\tid: string;\n\ttype: DateInputFieldType;\n\tlabel: string;\n\taccessibilityLabel: string;\n\terror?: boolean;\n\tonInput: (value: string, fieldType: DateInputFieldType) => void;\n\tonChange: (value: string, fieldType: DateInputFieldType) => void;\n\tonBlur: (fieldType: DateInputFieldType) => void;\n\tonFocus: (fieldType: DateInputFieldType) => void;\n\tplaceholder?: string;\n\trequired?: boolean;\n\tariaDescribedBy?: string;\n};\n\nexport const Input: FunctionalComponent<InputProps> = ({\n\tid,\n\ttype,\n\tlabel,\n\taccessibilityLabel,\n\tplaceholder,\n\tonInput,\n\tonChange,\n\tonFocus,\n\tonBlur,\n\tariaDescribedBy,\n\terror = false,\n\trequired = false,\n}) => {\n\tconst handleInputInput = (event: Event) => {\n\t\tconst newValue = (event.target as HTMLInputElement)?.value ?? '';\n\t\tonInput(newValue, type);\n\t};\n\n\tconst handleInputChange = (event: Event) => {\n\t\tconst newValue = (event.target as HTMLInputElement)?.value ?? '';\n\t\tonChange(newValue, type);\n\t};\n\n\tconst handleInputFocus = () => {\n\t\tonFocus(type);\n\t};\n\n\tconst handleInputBlur = () => {\n\t\tonBlur(type);\n\t};\n\n\treturn (\n\t\t<div class={`ontario-date__group-input ${error ? 'ontario-date--error' : ''}`}>\n\t\t\t<label htmlFor={id}>\n\t\t\t\t{label}\n\t\t\t\t<span class=\"ontario-show-for-sr\">({accessibilityLabel})</span>\n\t\t\t</label>\n\t\t\t<CommonInput\n\t\t\t\tclassName=\"ontario-input ontario-input--4-char-width\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tinputMode=\"numeric\"\n\t\t\t\tid={id}\n\t\t\t\trequired={!!required}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonInput={handleInputInput}\n\t\t\t\tonChange={handleInputChange}\n\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\tariaInvalid={error}\n\t\t\t\tariaDescribedBy={ariaDescribedBy}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","export const DAY_MIN_VALUE = 1;\nexport const DAY_MAX_VALUE = 31;\nexport const MONTH_MIN_VALUE = 1;\nexport const MONTH_MAX_VALUE = 12;\nexport const YEAR_MIN_VALUE = 999;\nexport const YEAR_MAX_VALUE = 9999;\n","import {\n\tDAY_MIN_VALUE,\n\tDAY_MAX_VALUE,\n\tMONTH_MIN_VALUE,\n\tMONTH_MAX_VALUE,\n\tYEAR_MIN_VALUE,\n\tYEAR_MAX_VALUE,\n} from '../constants';\nimport { DateValidatorReturnType } from '../ontario-date-input-interface';\nimport { isNumber, isEmpty } from '../../../utils/helper/utils';\nimport { Translations } from '../../../translations';\n/*\n * Day field should be a number, not negative, no greater than “31”\n */\nconst isInvalidDay = (value: string) => {\n\tif (!isNumber(value)) {\n\t\treturn true;\n\t}\n\n\tconst day = Number(value);\n\n\treturn day < DAY_MIN_VALUE || day > DAY_MAX_VALUE;\n};\n\n/*\n * Month field should be a number, not negative, no greater than “12”\n */\nconst isInvalidMonth = (value: string) => {\n\tif (!isNumber(value)) {\n\t\treturn true;\n\t}\n\n\tconst month = Number(value);\n\n\treturn month < MONTH_MIN_VALUE || month > MONTH_MAX_VALUE;\n};\n\n/**\n * Valid value year against minimum and maximum year range (defaulted if not provided.)\n *\n * Year field should be a number and not written out; it has no concept of positive and negative.\n *\n * Suggestion:\n * - `< 0` B.C.E.\n * - `>= 0` A.C.E.\n *\n * @param value value to check for validity\n * @param minYear minimum valid year to validate against\n * @param maxYear maximum valid year to validate against\n */\nexport const isInvalidYear = (\n\tvalue: string | number,\n\tminYear: number = YEAR_MIN_VALUE,\n\tmaxYear: number = YEAR_MAX_VALUE,\n) => {\n\tif (!isNumber(value)) {\n\t\treturn true;\n\t}\n\n\tconst year = Number(value);\n\n\treturn year < minYear || year > maxYear;\n};\n\ntype GetDateErrorArg = {\n\tdayValue: string;\n\tmonthValue: string;\n\tyearValue: string;\n\terrorMessages: Translations['dateInput']['error']['en'];\n\tminYear?: number;\n\tmaxYear?: number;\n\tdayVisible: boolean;\n\tmonthVisible: boolean;\n\tyearVisible: boolean;\n};\n/**\n * Helper function to get error message for birthdate validation\n */\nexport const getDateErrorMessage = ({\n\tdayValue,\n\tmonthValue,\n\tyearValue,\n\terrorMessages,\n\tminYear,\n\tmaxYear,\n\tdayVisible,\n\tmonthVisible,\n\tyearVisible,\n}: GetDateErrorArg): DateValidatorReturnType => {\n\tconst {\n\t\temptyDay,\n\t\temptyMonth,\n\t\temptyYear,\n\t\temptyDayAndMonth,\n\t\temptyDayAndYear,\n\t\temptyMonthAndYear,\n\t\tinvalidDate,\n\t\tinvalidDay,\n\t\tinvalidMonth,\n\t\tinvalidYear,\n\t} = errorMessages;\n\n\tlet error = '';\n\tlet dayInvalid = false;\n\tlet monthInvalid = false;\n\tlet yearInvalid = false;\n\n\tconst isDayEmpty = dayVisible && isEmpty(dayValue);\n\tconst isMonthEmpty = monthVisible && isEmpty(monthValue);\n\tconst isYearEmpty = yearVisible && isEmpty(yearValue);\n\t/*\n\t * If one ore more fields are valid but others are empty:\n\t * 1 field empty:\n\t * Day as empty - “Enter the day.”\n\t * Month as empty - “Enter the month.”\n\t * Year as empty - “Enter the year.”\n\t * 2 fields empty:\n\t * Month and day empty - “Enter the month and day.”\n\t * Year and day empty - “Enter the year and day.”\n\t * Year and month empty - “Enter the year and month.”\n\t */\n\tif (isDayEmpty && isMonthEmpty && isYearEmpty) {\n\t\terror = invalidDate;\n\t\tdayInvalid = true;\n\t\tmonthInvalid = true;\n\t\tyearInvalid = true;\n\t} else if (isDayEmpty && isMonthEmpty) {\n\t\terror = emptyDayAndMonth;\n\t\tdayInvalid = true;\n\t\tmonthInvalid = true;\n\t} else if (isDayEmpty && isYearEmpty) {\n\t\terror = emptyDayAndYear;\n\t\tdayInvalid = true;\n\t\tyearInvalid = true;\n\t} else if (isMonthEmpty && isYearEmpty) {\n\t\terror = emptyMonthAndYear;\n\t\tyearInvalid = true;\n\t\tmonthInvalid = true;\n\t} else if (isDayEmpty) {\n\t\terror = emptyDay;\n\t\tdayInvalid = true;\n\t} else if (isMonthEmpty) {\n\t\terror = emptyMonth;\n\t\tmonthInvalid = true;\n\t} else if (isYearEmpty) {\n\t\terror = emptyYear;\n\t\tyearInvalid = true;\n\t}\n\n\tconst isDayInvalid = dayVisible && isInvalidDay(dayValue);\n\tconst isMonthInvalid = monthVisible && isInvalidMonth(monthValue);\n\tconst isYearInvalid = yearVisible && isInvalidYear(yearValue, minYear, maxYear);\n\t/*\n\t * If only one error, specify where the error occurs\n\t * E.g. “Enter a valid day.”, “Enter a valid month.” Or “Enter a valid year.”\n\t * If 2 or more fields have error (or all 3), say “Enter a valid date.”\n\t * If one or more fields are invalid but the others are empty say: “Enter a valid date.”\n\t */\n\tif (isEmpty(error)) {\n\t\tif (isDayInvalid && isMonthInvalid && isYearInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tdayInvalid = true;\n\t\t\tmonthInvalid = true;\n\t\t\tyearInvalid = true;\n\t\t} else if (isDayInvalid && isMonthInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tdayInvalid = true;\n\t\t\tmonthInvalid = true;\n\t\t} else if (isDayInvalid && isYearInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tdayInvalid = true;\n\t\t\tyearInvalid = true;\n\t\t} else if (isMonthInvalid && isYearInvalid) {\n\t\t\terror = invalidDate;\n\t\t\tmonthInvalid = true;\n\t\t\tyearInvalid = true;\n\t\t} else if (isYearInvalid) {\n\t\t\terror = invalidYear;\n\t\t\tyearInvalid = true;\n\t\t} else if (isMonthInvalid) {\n\t\t\terror = invalidMonth;\n\t\t\tmonthInvalid = true;\n\t\t} else if (isDayInvalid) {\n\t\t\terror = invalidDay;\n\t\t\tdayInvalid = true;\n\t\t}\n\t}\n\n\treturn { errorMessage: error, dayInvalid, monthInvalid, yearInvalid };\n};\n","import { DateInputFieldType } from '../ontario-date-input-interface';\n\nexport const getVisibleDateFields = (dateOptions: Array<DateInputFieldType>) => {\n\tconst dayVisible = dateOptions.includes('day');\n\tconst monthVisible = dateOptions.includes('month');\n\tconst yearVisible = dateOptions.includes('year');\n\n\treturn { dayVisible, monthVisible, yearVisible };\n};\n","@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/4-elements/_global.elements.scss';\n@use '../../styles/form.scss';\n@forward '../../utils/components/error-message/error-message';\n\n.ontario-date__group {\n\tdisplay: flex;\n\n\tlabel {\n\t\tfont-weight: fontWeights.$ontario-font-weights-semi-bold;\n\t}\n\n\tinput {\n\t\tmargin-top: spacing.$spacing-4;\n\t}\n}\n\n.ontario-date__group-input {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin-right: spacing.$spacing-5;\n}\n\n.ontario-date--error {\n\tinput {\n\t\tborder: 0.125rem solid colours.$ontario-colour-alert;\n\t}\n}\n","import { Component, EventEmitter, Element, Watch, Event, Prop, h, State, Listen, AttachInternals } from '@stencil/core';\nimport { v4 as uuid } from 'uuid';\nimport { Language } from '../../utils/common/language-types';\nimport { validateLanguage } from '../../utils/validation/validation-functions';\nimport { translations, Translations } from '../../translations';\nimport { Input } from './components';\nimport { getDateErrorMessage, getVisibleDateFields } from './utils';\nimport { DateInputFieldType, DateInputPlaceholder, DateValidatorReturnType } from './ontario-date-input-interface';\nimport { ErrorMessage } from '../../utils/components/error-message/error-message';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\nimport { ConsoleType } from '../../utils/console-message/console-message.enum';\nimport { InputCaption } from '../../utils/common/input-caption/input-caption';\nimport { Caption } from '../../utils/common/input-caption/caption.interface';\nimport { emitEvent } from '../../utils/events/event-handler';\n\n@Component({\n\ttag: 'ontario-date-input',\n\tstyleUrl: 'ontario-date-input.scss',\n\tshadow: true,\n\tformAssociated: true,\n})\nexport class OntarioDateInput {\n\t@Element() element: HTMLElement;\n\t@AttachInternals() internals: ElementInternals;\n\n\t/**\n\t * The language of the component.\n\t * This is used for translations, and is by default set through event listeners checking for a language property from the header. If none are passed, it will default to English.\n\t */\n\t@Prop({ mutable: true }) language?: Language;\n\n\t/**\n\t * A boolean value to determine whether or not the date input is required.\n\t *\n\t * This is optional. If no prop is passed, it will default to `false`.\n\t */\n\t@Prop() required?: boolean = false;\n\n\t/**\n\t * An object value used to set the placeholder text for the day, month and year input fields. Any combination of the three input fields (i.e day, month, year)\n\t * of the date component can be overridden.\n\t *\n\t * This is optional. If no prop is passed, it will not display any placeholder text.\n\t */\n\t@Prop() placeholder?: DateInputPlaceholder | string;\n\n\t/**\n\t * The text to display as the input label\n\t *\n\t * @example\n\t * <ontario-date-input\n\t * caption='{\n\t * \"captionText\": \"Exact Date\",\n\t * \"captionType\": \"heading\",\n\t * }\n\t * required=\"true\"\n\t * ...>\n\t * </ontario-date-input>\n\t */\n\t@Prop() caption: Caption | string;\n\n\t/**\n\t * The unique identifier of the input. This is optional - if no ID is passed, one will be generated.\n\t */\n\t@Prop({ mutable: true }) elementId?: string;\n\n\t/**\n\t * A number value indicating minimum value allowed for year input field of the date component.\n\t *\n\t * This is optional. If no prop is passed, it will default to `999`.\n\t */\n\t@Prop() minYear?: number;\n\n\t/**\n\t * A number value indicating maximum value allowed for year input field of the date component.\n\t *\n\t * This is optional. If no prop is passed, it will default to `9999`.\n\t */\n\t@Prop() maxYear?: number;\n\n\t/**\n\t * Used to include the ontario-hint-text component for the date input group.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() hintText?: string;\n\n\t/**\n\t * An array value used to display date options. For example, only the day and month fields can be displayed by\n\t * specifying the dateOptions as `[\"day\", \"month\"]`, etc.\n\t *\n\t * This is optional. If no prop for `dateOptions` is passed, it will default to `[\"day\", \"month\", \"year\"]`.\n\t */\n\t@Prop() dateOptions?: string | Array<DateInputFieldType> = ['day', 'month', 'year'];\n\n\t/**\n\t * A function used to override internal date validation logic, which takes three arguments (i.e day, month and year) and returns\n\t * an object of type `DateValidatorReturnType`\n\t *\n\t * This is optional. If no prop for `dateValidator` is passed, it will default to internal validation function to validate\n\t * the date input.\n\t */\n\t@Prop() dateValidator?: (day: string, month: string, year: string) => DateValidatorReturnType;\n\n\t/**\n\t * Emitted when an `input` event occurs within the component.\n\t */\n\t@Event() inputOnInput: EventEmitter<{\n\t\tvalue: string;\n\t\tfieldType: 'day' | 'month' | 'year';\n\t}>;\n\n\t/**\n\t * Emitted when a `change` event occurs within the component.\n\t */\n\t@Event() inputOnChange: EventEmitter<{\n\t\tvalue: string;\n\t\tfieldType: 'day' | 'month' | 'year';\n\t}>;\n\n\t/**\n\t * Emitted when a keyboard input event occurs when an input has lost focus.\n\t */\n\t@Event() inputOnBlur: EventEmitter<'day' | 'month' | 'year'>;\n\n\t/**\n\t * Emitted when a keyboard input event occurs when an input has gained focus.\n\t */\n\t@Event() inputOnFocus: EventEmitter<'day' | 'month' | 'year'>;\n\n\t/**\n\t * Emitted when an error message is reported to the component.\n\t */\n\t@Event() inputErrorOccurred: EventEmitter<{ inputId: string; errorMessage: string }>;\n\n\t@Watch('errorMessage')\n\tbroadcastInputErrorOccurredEvent() {\n\t\t// Emit event to notify anyone who wants to listen for errors occurring\n\t\tthis.inputErrorOccurred.emit({ inputId: this.getId(), errorMessage: this.errorMessage ?? '' });\n\t}\n\n\t/**\n\t * 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.\n\t */\n\t@Listen('setAppLanguage', { target: 'window' })\n\thandleSetAppLanguage(event: CustomEvent<Language>) {\n\t\tif (!this.language) {\n\t\t\tthis.language = validateLanguage(event);\n\t\t}\n\t}\n\n\t@Listen('headerLanguageToggled', { target: 'window' })\n\thandleHeaderLanguageToggled(event: CustomEvent<Language>) {\n\t\tthis.language = validateLanguage(event);\n\t}\n\n\t@Listen('blur', { capture: true })\n\thandleComponentBlur() {\n\t\tconst { day, month, year, minYear, maxYear, dateValidator, dateOptionsState } = this;\n\t\tconst { dayVisible, monthVisible, yearVisible } = getVisibleDateFields(dateOptionsState);\n\n\t\t// if user has not interacted with the component, skip validation\n\t\tif (!this.isDateTyped) {\n\t\t\treturn;\n\t\t}\n\t\tconst errorMessages = translations.dateInput.error[this.getLanguage()];\n\t\tconst { dayInvalid, monthInvalid, yearInvalid, errorMessage } = dateValidator\n\t\t\t? dateValidator(day, month, year)\n\t\t\t: getDateErrorMessage({\n\t\t\t\t\tdayValue: day,\n\t\t\t\t\tmonthValue: month,\n\t\t\t\t\tyearValue: year,\n\t\t\t\t\terrorMessages,\n\t\t\t\t\tminYear,\n\t\t\t\t\tmaxYear,\n\t\t\t\t\tdayVisible,\n\t\t\t\t\tmonthVisible,\n\t\t\t\t\tyearVisible,\n\t\t\t });\n\n\t\tthis.dayInvalid = dayInvalid;\n\t\tthis.monthInvalid = monthInvalid;\n\t\tthis.yearInvalid = yearInvalid;\n\t\tthis.errorMessage = errorMessage;\n\t}\n\n\t@State() private translations: Translations = translations;\n\t@State() private captionState: InputCaption;\n\n\t@State() private isDateTyped: boolean = false;\n\t@State() private dayInvalid: boolean = false;\n\t@State() private monthInvalid: boolean = false;\n\t@State() private yearInvalid: boolean = false;\n\t@State() private errorMessage: string | undefined;\n\n\t@State() private day: string = '';\n\t@State() private month: string = '';\n\t@State() private year: string = '';\n\n\t@State() private placeholderState: DateInputPlaceholder;\n\t@State() private dateOptionsState: Array<DateInputFieldType>;\n\n\t/**\n\t * Watch for changes to the `caption` prop.\n\t *\n\t * The caption will be run through the InputCaption constructor to convert it to the correct format, and set the result to the `captionState` state.\n\t * @param newValue: Caption | string\n\t */\n\t@Watch('caption')\n\tprivate updateCaptionState(newValue: Caption | string) {\n\t\tthis.captionState = new InputCaption(\n\t\t\tthis.element.tagName,\n\t\t\tnewValue,\n\t\t\ttranslations,\n\t\t\tthis.language,\n\t\t\ttrue,\n\t\t\tthis.required,\n\t\t);\n\t}\n\n\t/**\n\t * Watch for changes in the `language` prop to render either the English or French translations\n\t */\n\t@Watch('language')\n\tupdateLanguage() {\n\t\tthis.updateCaptionState(this.caption);\n\t}\n\n\tprivate processPlaceholder() {\n\t\tthis.parseOptions(this.placeholder);\n\t}\n\n\tprivate processDateOptions() {\n\t\tthis.parseOptions(this.dateOptions);\n\t}\n\n\tprivate parseOptions(options: any) {\n\t\tconst isString = typeof options === 'string';\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tif (options === this.placeholder) {\n\t\t\t\tthis.placeholderState = isString ? JSON.parse(options) : options;\n\t\t\t} else if (options === this.dateOptions) {\n\t\t\t\tthis.dateOptionsState = isString ? JSON.parse(options) : options;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addRegularText(' failed to parse props for ')\n\t\t\t\t.addMonospaceText('<ontario-date-input>')\n\t\t\t\t.addRegularText(' in ')\n\t\t\t\t.addMonospaceText('parseOptions()')\n\t\t\t\t.addRegularText(' method \\n ')\n\t\t\t\t.addMonospaceText(error.stack)\n\t\t\t\t.printMessage(ConsoleType.Error);\n\t\t}\n\t}\n\n\tprivate isInvalidDate = () => {\n\t\treturn this.dayInvalid || this.monthInvalid || this.yearInvalid;\n\t};\n\n\tprivate resetErrorState = () => {\n\t\tif (!this.isInvalidDate()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.dayInvalid = false;\n\t\tthis.monthInvalid = false;\n\t\tthis.yearInvalid = false;\n\t\tthis.errorMessage = '';\n\t};\n\n\tprivate updateDateState = (value: string, inputFieldType: DateInputFieldType) => {\n\t\tswitch (inputFieldType) {\n\t\t\tcase 'day':\n\t\t\t\tthis.day = value;\n\t\t\t\tbreak;\n\t\t\tcase 'month':\n\t\t\t\tthis.month = value;\n\t\t\t\tbreak;\n\t\t\tcase 'year':\n\t\t\t\tthis.year = value;\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tprivate handleDateUpdates = (value: string, fieldType: DateInputFieldType) => {\n\t\t// set boolean indicating user interaction with the component for validation\n\t\tif (!this.isDateTyped) {\n\t\t\tthis.isDateTyped = true;\n\t\t}\n\n\t\t// reset error state when user starts typing\n\t\tthis.resetErrorState();\n\n\t\t// update date state\n\t\tthis.updateDateState(value, fieldType);\n\n\t\t// TODO: verify are all the values numbers?\n\t\tif (this.year && this.month && this.day) {\n\t\t\tconst desiredDate = new Date(\n\t\t\t\tDate.UTC(parseInt(this.year), parseInt(this.month) - 1, parseInt(this.day), 0, 0, 0, 0),\n\t\t\t);\n\t\t\tthis.internals?.setFormValue?.(desiredDate.toISOString());\n\t\t}\n\t};\n\n\tprivate handleDateInput = (value: string, fieldType: DateInputFieldType) => {\n\t\tthis.handleDateUpdates(value, fieldType);\n\n\t\t// emit date change event\n\t\tthis.inputOnInput.emit({ value, fieldType });\n\t};\n\n\tprivate handleDateChanged = (value: string, fieldType: DateInputFieldType) => {\n\t\tthis.handleDateUpdates(value, fieldType);\n\n\t\t// emit date change event\n\t\tthis.inputOnChange.emit({ value, fieldType });\n\n\t\t// emit change event\n\t\temitEvent(this.element, 'change', { value, fieldType });\n\t};\n\n\tprivate handleDateFocus = (fieldType: DateInputFieldType) => {\n\t\t// emit date field focus event\n\t\tthis.inputOnFocus.emit(fieldType);\n\t};\n\n\tprivate handleDateBlur = (fieldType: DateInputFieldType) => {\n\t\t// emit date field focus event\n\t\tthis.inputOnBlur.emit(fieldType);\n\t};\n\n\tprivate getLanguage(): Language {\n\t\treturn this.language ?? 'en';\n\t}\n\n\tprivate getCaption(): Caption | string {\n\t\tconst language = this.getLanguage();\n\t\tconst captionText = translations.dateInput.caption[language];\n\n\t\treturn this.caption ?? { captionText, captionType: 'default' };\n\t}\n\n\tprivate getId(): string {\n\t\treturn this.elementId ?? '';\n\t}\n\n\tprivate getHintTextId(): string {\n\t\treturn `date-input-hint-${this.getId()}`;\n\t}\n\n\tprivate getInputIds() {\n\t\tconst id = this.getId();\n\n\t\tconst dayId = `day-${id}`;\n\t\tconst monthId = `month-${id}`;\n\t\tconst yearId = `year-${id}`;\n\n\t\treturn { dayId, monthId, yearId };\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.processPlaceholder();\n\t\tthis.processDateOptions();\n\n\t\tthis.updateCaptionState(this.getCaption());\n\t\tthis.elementId = this.elementId ?? uuid();\n\n\t\tthis.language = validateLanguage(this.language) as Language;\n\t}\n\n\trender() {\n\t\tconst { dateOptionsState, required, translations, hintText, placeholderState } = this;\n\t\tconst language = this.getLanguage();\n\t\tconst dateStrings = translations.dateInput;\n\t\tconst placeholderText = placeholderState ?? {};\n\t\tconst { dayVisible, monthVisible, yearVisible } = getVisibleDateFields(dateOptionsState);\n\t\tconst { dayId, monthId, yearId } = this.getInputIds();\n\t\tconst hintTextId = this.getHintTextId();\n\n\t\treturn (\n\t\t\t<div class=\"ontario-form-group\">\n\t\t\t\t<fieldset role=\"group\" class=\"ontario-fieldset\">\n\t\t\t\t\t{this.captionState.getCaption()}\n\t\t\t\t\t{!!hintText && (\n\t\t\t\t\t\t<p id={hintTextId} class=\"ontario-hint\">\n\t\t\t\t\t\t\t{hintText}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t\t<ErrorMessage message={this.errorMessage} error={this.isInvalidDate()} />\n\t\t\t\t\t<div class=\"ontario-date__group\">\n\t\t\t\t\t\t{yearVisible && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={yearId}\n\t\t\t\t\t\t\t\ttype=\"year\"\n\t\t\t\t\t\t\t\tlabel={dateStrings.year.label[language]}\n\t\t\t\t\t\t\t\taccessibilityLabel={dateStrings.year.accessibility[language]}\n\t\t\t\t\t\t\t\trequired={!!required}\n\t\t\t\t\t\t\t\terror={this.yearInvalid}\n\t\t\t\t\t\t\t\tplaceholder={placeholderText.year}\n\t\t\t\t\t\t\t\tonInput={this.handleDateInput}\n\t\t\t\t\t\t\t\tonChange={this.handleDateChanged}\n\t\t\t\t\t\t\t\tonBlur={this.handleDateBlur}\n\t\t\t\t\t\t\t\tonFocus={this.handleDateFocus}\n\t\t\t\t\t\t\t\tariaDescribedBy={hintTextId}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{monthVisible && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={monthId}\n\t\t\t\t\t\t\t\ttype=\"month\"\n\t\t\t\t\t\t\t\tlabel={dateStrings.month.label[language]}\n\t\t\t\t\t\t\t\taccessibilityLabel={dateStrings.month.accessibility[language]}\n\t\t\t\t\t\t\t\trequired={!!required}\n\t\t\t\t\t\t\t\terror={this.monthInvalid}\n\t\t\t\t\t\t\t\tplaceholder={placeholderText.month}\n\t\t\t\t\t\t\t\tonInput={this.handleDateInput}\n\t\t\t\t\t\t\t\tonChange={this.handleDateChanged}\n\t\t\t\t\t\t\t\tonBlur={this.handleDateBlur}\n\t\t\t\t\t\t\t\tonFocus={this.handleDateFocus}\n\t\t\t\t\t\t\t\tariaDescribedBy={hintTextId}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{dayVisible && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tid={dayId}\n\t\t\t\t\t\t\t\ttype=\"day\"\n\t\t\t\t\t\t\t\tlabel={dateStrings.day.label[language]}\n\t\t\t\t\t\t\t\taccessibilityLabel={dateStrings.day.accessibility[language]}\n\t\t\t\t\t\t\t\trequired={!!required}\n\t\t\t\t\t\t\t\terror={this.dayInvalid}\n\t\t\t\t\t\t\t\tplaceholder={placeholderText.day}\n\t\t\t\t\t\t\t\tonInput={this.handleDateInput}\n\t\t\t\t\t\t\t\tonChange={this.handleDateChanged}\n\t\t\t\t\t\t\t\tonBlur={this.handleDateBlur}\n\t\t\t\t\t\t\t\tonFocus={this.handleDateFocus}\n\t\t\t\t\t\t\t\tariaDescribedBy={hintTextId}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
@@ -134,8 +134,8 @@ const OntarioHeaderDefaultData = {
134
134
  fr: fr,
135
135
  };
136
136
 
137
- const ONTARIO_HEADER_API_URL_EN = 'https://www.ontario.ca/system/menu/main/linkset';
138
- const ONTARIO_HEADER_API_URL_FR = 'https://www.ontario.ca/system/menu/main-fr/linkset';
137
+ const ONTARIO_HEADER_API_URL_EN = '';
138
+ const ONTARIO_HEADER_API_URL_FR = '';
139
139
  const config = {
140
140
  ONTARIO_HEADER_API_URL_EN: ONTARIO_HEADER_API_URL_EN,
141
141
  ONTARIO_HEADER_API_URL_FR: ONTARIO_HEADER_API_URL_FR,
@@ -53,7 +53,8 @@ function removeObjectsBySpecificKey(objects, key, value) {
53
53
  * @returns {boolean}
54
54
  */
55
55
  function isNumber(value) {
56
- return isNaN(Number(value)) === true;
56
+ if (value === undefined || value === null) return false;
57
+ return isNaN(Number(value)) === false;
57
58
  }
58
59
  function isEmpty(str) {
59
60
  return !str || (str === null || str === void 0 ? void 0 : str.length) <= 0;
@@ -66,7 +67,8 @@ function isEmpty(str) {
66
67
  * @returns {string[]}
67
68
  */
68
69
  function retrieveEnumKeys(enumObject) {
69
- return Object.keys(enumObject).filter(isNumber);
70
+ if (enumObject === undefined || enumObject === null) return new Array(0);
71
+ return Object.keys(enumObject).filter((key) => !isNumber(key));
70
72
  }
71
73
  /**
72
74
  * Prints an array as a comma delimited list, with the last element being preceded by a conjunction.
@@ -1 +1 @@
1
- {"file":"utils.js","mappings":"SAMgB,qBAAqB,CAAI,GAAQ,EAAE,GAAY;IAC9D,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACtB,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,MAAM,EAAE;YAC7C,KAAK,E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AAC,CAAC;IACH,OAAO,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;SAOgB,QAAQ,CAAC,KAAsB;IAC9C,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;AACtC,CAAC;SAEe,OAAO,CAAC,GAA8B;IACrD,OAAO,CAAC,GAAG,IAAI,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,KAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;SAOgB,gBAAgB,CAAC,UAAkB;IAClD,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;SASgB,UAAU,CAAC,GAAe,EAAE,kBAA+B,KAAK;IAC/E,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CACrB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,eAAe,GAAG,CAAC,GAAG,KAAK,CAChG,CAAC;AACH,CAAC;AAED;;;;;;;;;SASgB,kBAAkB;IACjC,OAAO,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD;;;;","names":[],"sources":["src/utils/helper/utils.ts"],"sourcesContent":["import { Conjunction } from './utils-types';\n\nexport function format(first: string | undefined, middle: string | undefined, last: string | undefined): string {\n\treturn (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n\nexport function hasMultipleTrueValues<T>(arr: T[], key: keyof T): boolean {\n\tlet count = 0;\n\n\tfor (const obj of arr) {\n\t\tif (obj[key] === true || obj[key] === 'true') {\n\t\t\tcount++;\n\t\t\tif (count > 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport function extractValuesByKey<T>(objects: T[], key: keyof T): Array<T[keyof T]> {\n\treturn objects.map((obj) => obj[key]);\n}\n\nexport function organizeObjectKeys(data: any[], columns: string[]): any[] {\n\treturn data.map((item) => {\n\t\tconst newData: any = {};\n\t\tconst otherKeys: any = {};\n\n\t\t// Iterate through each key in the item\n\t\tObject.keys(item).forEach((key) => {\n\t\t\tif (key === 'data') {\n\t\t\t\t// Organize keys in the 'data' object\n\t\t\t\tcolumns.forEach((column) => {\n\t\t\t\t\tif (column in item.data) {\n\t\t\t\t\t\tnewData[column] = item.data[column];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Preserve other keys\n\t\t\t\totherKeys[key] = item[key];\n\t\t\t}\n\t\t});\n\n\t\treturn { data: newData, ...otherKeys };\n\t});\n}\n\nexport function removeObjectsBySpecificKey<T>(objects: T[], key: keyof T, value: boolean | 'true'): [T[], T[]] {\n\tconst removedObjects: T[] = [];\n\tconst filteredObjects = objects.filter((obj) => {\n\t\tif (obj[key] === value) {\n\t\t\tremovedObjects.push(obj);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\treturn [filteredObjects, removedObjects];\n}\n\n/**\n * Takes an input value and determines whether or not it is a number.\n *\n * @param {string | number} value - The value you would like to test against.\n *\n * @returns {boolean}\n */\nexport function isNumber(value: string | number): boolean {\n\treturn isNaN(Number(value)) === true;\n}\n\nexport function isEmpty(str: string | undefined | null): boolean {\n\treturn !str || str?.length <= 0;\n}\n\n/**\n * Retrieves the keys from an enum and lists them in an array.\n *\n * @param {object} enumObject - The enum you wish to get the keys of.\n *\n * @returns {string[]}\n */\nexport function retrieveEnumKeys(enumObject: object): string[] {\n\treturn Object.keys(enumObject).filter(isNumber);\n}\n\n/**\n * Prints an array as a comma delimited list, with the last element being preceded by a conjunction.\n * As per ontario.ca content guidelines, there is no Oxford comma.\n *\n * @param {Array<any>} arr - The array that you wish to print.\n * @param {Conjunction} conjunctionType - Whether you want the sentence to end with 'and value.' or 'or value.'\n *\n * @returns {string}\n */\nexport function printArray(arr: Array<any>, conjunctionType: Conjunction = 'and'): string {\n\treturn [...arr].reduce(\n\t\t(text, value, i, array) => text + (i < array.length - 1 ? ', ' : ` ${conjunctionType} `) + value,\n\t);\n}\n\n/**\n * Grabs the HTML element of the page.\n *\n * More targetted than document.documentElement as the documentElement could\n * in theory be any element that is the top level. e.g. <div> if the page is not\n * set up to be semantically correct.\n *\n * @returns {HTMLElement}\n */\nexport function getRootHTMLElement(): HTMLElement {\n\treturn document.getElementsByTagName('html')[0];\n}\n"],"version":3}
1
+ {"file":"utils.js","mappings":"SAMgB,qBAAqB,CAAI,GAAQ,EAAE,GAAY;IAC9D,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACtB,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,MAAM,EAAE;YAC7C,KAAK,EAAE,CAAC;YACR,IAAI,KAAK,GAAG,CAAC,EAAE;gBACd,OAAO,IAAI,CAAC;aACZ;SACD;KACD;IAED,OAAO,KAAK,CAAC;AACd,CAAC;SAEe,kBAAkB,CAAI,OAAY,EAAE,GAAY;IAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;SAEe,kBAAkB,CAAC,IAAW,EAAE,OAAiB;IAChE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI;QACpB,MAAM,OAAO,GAAQ,EAAE,CAAC;QACxB,MAAM,SAAS,GAAQ,EAAE,CAAC;;QAG1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG;YAC7B,IAAI,GAAG,KAAK,MAAM,EAAE;;gBAEnB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM;oBACtB,IAAI,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CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;;SASgB,UAAU,CAAC,GAAe,EAAE,kBAA+B,KAAK;IAC/E,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CACrB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,eAAe,GAAG,CAAC,GAAG,KAAK,CAChG,CAAC;AACH,CAAC;AAED;;;;;;;;;SASgB,kBAAkB;IACjC,OAAO,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD;;;;","names":[],"sources":["src/utils/helper/utils.ts"],"sourcesContent":["import { Conjunction } from './utils-types';\n\nexport function format(first: string | undefined, middle: string | undefined, last: string | undefined): string {\n\treturn (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n\nexport function hasMultipleTrueValues<T>(arr: T[], key: keyof T): boolean {\n\tlet count = 0;\n\n\tfor (const obj of arr) {\n\t\tif (obj[key] === true || obj[key] === 'true') {\n\t\t\tcount++;\n\t\t\tif (count > 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport function extractValuesByKey<T>(objects: T[], key: keyof T): Array<T[keyof T]> {\n\treturn objects.map((obj) => obj[key]);\n}\n\nexport function organizeObjectKeys(data: any[], columns: string[]): any[] {\n\treturn data.map((item) => {\n\t\tconst newData: any = {};\n\t\tconst otherKeys: any = {};\n\n\t\t// Iterate through each key in the item\n\t\tObject.keys(item).forEach((key) => {\n\t\t\tif (key === 'data') {\n\t\t\t\t// Organize keys in the 'data' object\n\t\t\t\tcolumns.forEach((column) => {\n\t\t\t\t\tif (column in item.data) {\n\t\t\t\t\t\tnewData[column] = item.data[column];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Preserve other keys\n\t\t\t\totherKeys[key] = item[key];\n\t\t\t}\n\t\t});\n\n\t\treturn { data: newData, ...otherKeys };\n\t});\n}\n\nexport function removeObjectsBySpecificKey<T>(objects: T[], key: keyof T, value: boolean | 'true'): [T[], T[]] {\n\tconst removedObjects: T[] = [];\n\tconst filteredObjects = objects.filter((obj) => {\n\t\tif (obj[key] === value) {\n\t\t\tremovedObjects.push(obj);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\treturn [filteredObjects, removedObjects];\n}\n\n/**\n * Takes an input value and determines whether or not it is a number.\n *\n * @param {string | number} value - The value you would like to test against.\n *\n * @returns {boolean}\n */\nexport function isNumber(value: string | number): boolean {\n\tif (value === undefined || value === null) return false;\n\treturn isNaN(Number(value)) === false;\n}\n\nexport function isEmpty(str: string | undefined | null): boolean {\n\treturn !str || str?.length <= 0;\n}\n\n/**\n * Retrieves the keys from an enum and lists them in an array.\n *\n * @param {object} enumObject - The enum you wish to get the keys of.\n *\n * @returns {string[]}\n */\nexport function retrieveEnumKeys(enumObject: object): string[] {\n\tif (enumObject === undefined || enumObject === null) return new Array<string>(0);\n\treturn Object.keys(enumObject).filter((key) => !isNumber(key));\n}\n\n/**\n * Prints an array as a comma delimited list, with the last element being preceded by a conjunction.\n * As per ontario.ca content guidelines, there is no Oxford comma.\n *\n * @param {Array<any>} arr - The array that you wish to print.\n * @param {Conjunction} conjunctionType - Whether you want the sentence to end with 'and value.' or 'or value.'\n *\n * @returns {string}\n */\nexport function printArray(arr: Array<any>, conjunctionType: Conjunction = 'and'): string {\n\treturn [...arr].reduce(\n\t\t(text, value, i, array) => text + (i < array.length - 1 ? ', ' : ` ${conjunctionType} `) + value,\n\t);\n}\n\n/**\n * Grabs the HTML element of the page.\n *\n * More targetted than document.documentElement as the documentElement could\n * in theory be any element that is the top level. e.g. <div> if the page is not\n * set up to be semantically correct.\n *\n * @returns {HTMLElement}\n */\nexport function getRootHTMLElement(): HTMLElement {\n\treturn document.getElementsByTagName('html')[0];\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"app-globals-70748594.js","mappings":";;AAEA,OAAO,CAAC,CAAC,GAAG;;;IAGX,OAAQ,GAAW,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC,CAAC;;;;ACLS,MAAC,aAAa,GAAGA;;;;","names":["appGlobalScript"],"sources":["src/global.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { setMode } from '@stencil/core';\n\nsetMode((elm) => {\n\t// NOTE: you can write whatever you want here - it's up to you. This\n\t// function must return one of the style \"modes\" defined in step 1.\n\treturn (elm as any).type;\n});\n","import appGlobalScript from '/builds/design-system/design-system/web-components/ontario-design-system-components/packages/ontario-design-system-component-library/src/global.ts';\nexport const globalScripts = appGlobalScript;\n"],"version":3}
1
+ {"file":"app-globals-70748594.js","mappings":";;AAEA,OAAO,CAAC,CAAC,GAAG;;;IAGX,OAAQ,GAAW,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC,CAAC;;;;ACLS,MAAC,aAAa,GAAGA;;;;","names":["appGlobalScript"],"sources":["src/global.ts","@stencil/core/internal/app-globals"],"sourcesContent":["import { setMode } from '@stencil/core';\n\nsetMode((elm) => {\n\t// NOTE: you can write whatever you want here - it's up to you. This\n\t// function must return one of the style \"modes\" defined in step 1.\n\treturn (elm as any).type;\n});\n","import appGlobalScript from '/home/runner/work/ontario-design-system/ontario-design-system/packages/ontario-design-system-component-library/src/global.ts';\nexport const globalScripts = appGlobalScript;\n"],"version":3}
@@ -781,7 +781,8 @@ function removeObjectsBySpecificKey(objects, key, value) {
781
781
  * @returns {boolean}
782
782
  */
783
783
  function isNumber(value) {
784
- return isNaN(Number(value)) === true;
784
+ if (value === undefined || value === null) return false;
785
+ return isNaN(Number(value)) === false;
785
786
  }
786
787
  function isEmpty(str) {
787
788
  return !str || (str === null || str === void 0 ? void 0 : str.length) <= 0;
@@ -794,7 +795,8 @@ function isEmpty(str) {
794
795
  * @returns {string[]}
795
796
  */
796
797
  function retrieveEnumKeys(enumObject) {
797
- return Object.keys(enumObject).filter(isNumber);
798
+ if (enumObject === undefined || enumObject === null) return new Array(0);
799
+ return Object.keys(enumObject).filter((key) => !isNumber(key));
798
800
  }
799
801
  /**
800
802
  * Prints an array as a comma delimited list, with the last element being preceded by a conjunction.
@@ -2595,15 +2597,25 @@ const isInvalidMonth = (value) => {
2595
2597
  const month = Number(value);
2596
2598
  return month < MONTH_MIN_VALUE || month > MONTH_MAX_VALUE;
2597
2599
  };
2598
- /*
2599
- * Year field should be a number, not negative, at length at least 4 digits
2600
+ /**
2601
+ * Valid value year against minimum and maximum year range (defaulted if not provided.)
2602
+ *
2603
+ * Year field should be a number and not written out; it has no concept of positive and negative.
2604
+ *
2605
+ * Suggestion:
2606
+ * - `< 0` B.C.E.
2607
+ * - `>= 0` A.C.E.
2608
+ *
2609
+ * @param value value to check for validity
2610
+ * @param minYear minimum valid year to validate against
2611
+ * @param maxYear maximum valid year to validate against
2600
2612
  */
2601
2613
  const isInvalidYear = (value, minYear = YEAR_MIN_VALUE, maxYear = YEAR_MAX_VALUE) => {
2602
2614
  if (!isNumber(value)) {
2603
2615
  return true;
2604
2616
  }
2605
2617
  const year = Number(value);
2606
- return year <= minYear || year > maxYear;
2618
+ return year < minYear || year > maxYear;
2607
2619
  };
2608
2620
  /**
2609
2621
  * Helper function to get error message for birthdate validation
@@ -3972,8 +3984,8 @@ const OntarioHeaderDefaultData = {
3972
3984
  fr: fr,
3973
3985
  };
3974
3986
 
3975
- const ONTARIO_HEADER_API_URL_EN = 'https://www.ontario.ca/system/menu/main/linkset';
3976
- const ONTARIO_HEADER_API_URL_FR = 'https://www.ontario.ca/system/menu/main-fr/linkset';
3987
+ const ONTARIO_HEADER_API_URL_EN = '';
3988
+ const ONTARIO_HEADER_API_URL_FR = '';
3977
3989
  const config = {
3978
3990
  ONTARIO_HEADER_API_URL_EN: ONTARIO_HEADER_API_URL_EN,
3979
3991
  ONTARIO_HEADER_API_URL_FR: ONTARIO_HEADER_API_URL_FR,