@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.
- package/dist/cjs/app-globals-6f6b30a8.js.map +1 -1
- package/dist/cjs/ontario-accordion_44.cjs.entry.js +19 -7
- package/dist/cjs/ontario-accordion_44.cjs.entry.js.map +1 -1
- package/dist/collection/components/ontario-date-input/test/ontario-date-input.spec.js +58 -0
- package/dist/collection/components/ontario-date-input/test/ontario-date-input.spec.js.map +1 -1
- package/dist/collection/components/ontario-date-input/utils/date-validation-utils.js +14 -4
- package/dist/collection/components/ontario-date-input/utils/date-validation-utils.js.map +1 -1
- package/dist/collection/fonts/open-sans-400/LICENSE.txt +0 -0
- package/dist/collection/fonts/open-sans-400/open-sans-400.eot +0 -0
- package/dist/collection/fonts/open-sans-400/open-sans-400.svg +0 -0
- package/dist/collection/fonts/open-sans-400/open-sans-400.ttf +0 -0
- package/dist/collection/fonts/open-sans-400/open-sans-400.woff +0 -0
- package/dist/collection/fonts/open-sans-400/open-sans-400.woff2 +0 -0
- package/dist/collection/fonts/open-sans-700/LICENSE.txt +0 -0
- package/dist/collection/fonts/open-sans-700/open-sans-700.eot +0 -0
- package/dist/collection/fonts/open-sans-700/open-sans-700.svg +0 -0
- package/dist/collection/fonts/open-sans-700/open-sans-700.ttf +0 -0
- package/dist/collection/utils/helper/utils.js +4 -2
- package/dist/collection/utils/helper/utils.js.map +1 -1
- package/dist/collection/utils/helper/utils.spec.js +99 -1
- package/dist/collection/utils/helper/utils.spec.js.map +1 -1
- package/dist/components/ontario-date-input.js +13 -3
- package/dist/components/ontario-date-input.js.map +1 -1
- package/dist/components/ontario-header.js +2 -2
- package/dist/components/utils.js +4 -2
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/app-globals-70748594.js.map +1 -1
- package/dist/esm/ontario-accordion_44.entry.js +19 -7
- package/dist/esm/ontario-accordion_44.entry.js.map +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-400/LICENSE.txt +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.eot +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.svg +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.ttf +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.woff +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-400/open-sans-400.woff2 +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-700/LICENSE.txt +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-700/open-sans-700.eot +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-700/open-sans-700.svg +0 -0
- package/dist/ontario-design-system-components/fonts/open-sans-700/open-sans-700.ttf +0 -0
- package/dist/ontario-design-system-components/ontario-design-system-components.esm.js +1 -1
- package/dist/ontario-design-system-components/p-103a233b.js.map +1 -1
- package/dist/ontario-design-system-components/{p-9c3a1be9.entry.js → p-ac4e76b2.entry.js} +8 -6
- package/dist/ontario-design-system-components/p-ac4e76b2.entry.js.map +1 -0
- package/dist/types/components/ontario-date-input/utils/date-validation-utils.d.ts +14 -0
- package/package.json +3 -3
- package/src/components/ontario-date-input/test/ontario-date-input.spec.tsx +76 -0
- package/src/components/ontario-date-input/utils/date-validation-utils.ts +18 -4
- package/src/config.json +1 -4
- package/src/utils/helper/utils.spec.ts +127 -1
- package/src/utils/helper/utils.ts +4 -2
- package/www/build/ontario-design-system-components.esm.js +1 -1
- package/www/build/p-103a233b.js.map +1 -1
- package/www/build/{p-9c3a1be9.entry.js → p-ac4e76b2.entry.js} +8 -6
- package/www/build/p-ac4e76b2.entry.js.map +1 -0
- package/www/build/{p-84035ac3.js → p-c9a9b857.js} +1 -1
- package/www/fonts/open-sans-400/LICENSE.txt +0 -0
- package/www/fonts/open-sans-400/open-sans-400.eot +0 -0
- package/www/fonts/open-sans-400/open-sans-400.svg +0 -0
- package/www/fonts/open-sans-400/open-sans-400.ttf +0 -0
- package/www/fonts/open-sans-400/open-sans-400.woff +0 -0
- package/www/fonts/open-sans-400/open-sans-400.woff2 +0 -0
- package/www/fonts/open-sans-700/LICENSE.txt +0 -0
- package/www/fonts/open-sans-700/open-sans-700.eot +0 -0
- package/www/fonts/open-sans-700/open-sans-700.svg +0 -0
- package/www/fonts/open-sans-700/open-sans-700.ttf +0 -0
- package/www/index.html +2 -2
- package/dist/ontario-design-system-components/p-9c3a1be9.entry.js.map +0 -1
- package/www/build/p-9c3a1be9.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"app-globals-6f6b30a8.js","mappings":";;;;AAEAA,aAAO,CAAC,CAAC,GAAG;;;IAGX,OAAQ,GAAW,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC,CAAC;;;;ACLS,MAAC,aAAa,GAAGC;;;;","names":["setMode","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 '/
|
|
1
|
+
{"file":"app-globals-6f6b30a8.js","mappings":";;;;AAEAA,aAAO,CAAC,CAAC,GAAG;;;IAGX,OAAQ,GAAW,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC,CAAC;;;;ACLS,MAAC,aAAa,GAAGC;;;;","names":["setMode","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}
|
|
@@ -771,7 +771,8 @@ function removeObjectsBySpecificKey(objects, key, value) {
|
|
|
771
771
|
* @returns {boolean}
|
|
772
772
|
*/
|
|
773
773
|
function isNumber(value) {
|
|
774
|
-
|
|
774
|
+
if (value === undefined || value === null) return false;
|
|
775
|
+
return isNaN(Number(value)) === false;
|
|
775
776
|
}
|
|
776
777
|
function isEmpty(str) {
|
|
777
778
|
return !str || (str === null || str === void 0 ? void 0 : str.length) <= 0;
|
|
@@ -784,7 +785,8 @@ function isEmpty(str) {
|
|
|
784
785
|
* @returns {string[]}
|
|
785
786
|
*/
|
|
786
787
|
function retrieveEnumKeys(enumObject) {
|
|
787
|
-
|
|
788
|
+
if (enumObject === undefined || enumObject === null) return new Array(0);
|
|
789
|
+
return Object.keys(enumObject).filter((key) => !isNumber(key));
|
|
788
790
|
}
|
|
789
791
|
/**
|
|
790
792
|
* 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
|
-
*
|
|
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
|
|
2618
|
+
return year < minYear || year > maxYear;
|
|
2607
2619
|
};
|
|
2608
2620
|
/**
|
|
2609
2621
|
* Helper function to get error message for birthdate validation
|
|
@@ -3992,8 +4004,8 @@ const OntarioHeaderDefaultData = {
|
|
|
3992
4004
|
fr: fr,
|
|
3993
4005
|
};
|
|
3994
4006
|
|
|
3995
|
-
const ONTARIO_HEADER_API_URL_EN = '
|
|
3996
|
-
const ONTARIO_HEADER_API_URL_FR = '
|
|
4007
|
+
const ONTARIO_HEADER_API_URL_EN = '';
|
|
4008
|
+
const ONTARIO_HEADER_API_URL_FR = '';
|
|
3997
4009
|
const config = {
|
|
3998
4010
|
ONTARIO_HEADER_API_URL_EN: ONTARIO_HEADER_API_URL_EN,
|
|
3999
4011
|
ONTARIO_HEADER_API_URL_FR: ONTARIO_HEADER_API_URL_FR,
|