@ongov/ontario-design-system-component-library 4.3.1-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/index-88d5cf20.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{ontario-accordion_43.cjs.entry.js → ontario-accordion_44.cjs.entry.js} +358 -85
- package/dist/cjs/ontario-accordion_44.cjs.entry.js.map +1 -0
- package/dist/cjs/ontario-design-system-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ontario-card/ontario-card-types.js +29 -2
- package/dist/collection/components/ontario-card/ontario-card-types.js.map +1 -1
- package/dist/collection/components/ontario-card/ontario-card.css +252 -34
- package/dist/collection/components/ontario-card/ontario-card.js +102 -78
- package/dist/collection/components/ontario-card/ontario-card.js.map +1 -1
- package/dist/collection/components/ontario-card/test/ontario-cards.spec.js +23 -13
- package/dist/collection/components/ontario-card/test/ontario-cards.spec.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/components/ontario-header/service-ontario-header.css +0 -3
- package/dist/collection/components/ontario-search-box/assets/ontario-icon-close.svg +1 -0
- package/dist/collection/components/ontario-search-box/assets/ontario-logo--mobile.svg +6 -0
- package/dist/collection/components/ontario-search-box/ontario-search-box.css +823 -0
- package/dist/collection/components/ontario-search-box/ontario-search-box.js +584 -0
- package/dist/collection/components/ontario-search-box/ontario-search-box.js.map +1 -0
- package/dist/collection/components/ontario-search-box/test/ontario-search-box.e2e.js +20 -0
- package/dist/collection/components/ontario-search-box/test/ontario-search-box.e2e.js.map +1 -0
- package/dist/collection/components/ontario-search-box/test/ontario-search-box.spec.js +19 -0
- package/dist/collection/components/ontario-search-box/test/ontario-search-box.spec.js.map +1 -0
- package/dist/collection/components/ontario-step-indicator/ontario-step-indicator.js +5 -5
- package/dist/collection/components/ontario-table/ontario-table.js +5 -5
- package/dist/collection/components/ontario-textarea/ontario-textarea.js +3 -3
- 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/common/input/input.js +3 -0
- package/dist/collection/utils/common/input/input.js.map +1 -1
- package/dist/collection/utils/common/input-caption/input-caption.js +5 -3
- package/dist/collection/utils/common/input-caption/input-caption.js.map +1 -1
- 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/error-message.js +1 -324
- package/dist/components/error-message.js.map +1 -1
- package/dist/components/event-handler.js +330 -0
- package/dist/components/event-handler.js.map +1 -0
- package/dist/components/input.js +3 -0
- package/dist/components/input.js.map +1 -1
- package/dist/components/ontario-card.js +116 -64
- package/dist/components/ontario-card.js.map +1 -1
- package/dist/components/ontario-checkboxes.js +2 -1
- package/dist/components/ontario-checkboxes.js.map +1 -1
- package/dist/components/ontario-date-input.js +15 -4
- package/dist/components/ontario-date-input.js.map +1 -1
- package/dist/components/ontario-dropdown-list.js +2 -1
- package/dist/components/ontario-dropdown-list.js.map +1 -1
- package/dist/components/ontario-header.js +4 -6
- package/dist/components/ontario-header.js.map +1 -1
- package/dist/components/ontario-icon-search2.js +6 -0
- package/dist/components/ontario-icon-search2.js.map +1 -0
- package/dist/components/ontario-input.js +2 -1
- package/dist/components/ontario-input.js.map +1 -1
- package/dist/components/ontario-radio-buttons.js +2 -1
- package/dist/components/ontario-radio-buttons.js.map +1 -1
- package/dist/components/ontario-search-box.d.ts +11 -0
- package/dist/components/ontario-search-box.js +269 -0
- package/dist/components/ontario-search-box.js.map +1 -0
- package/dist/components/ontario-step-indicator.js +5 -5
- package/dist/components/ontario-table.js +5 -5
- package/dist/components/ontario-textarea.js +5 -4
- package/dist/components/ontario-textarea.js.map +1 -1
- 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/index-603026f7.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{ontario-accordion_43.entry.js → ontario-accordion_44.entry.js} +358 -85
- package/dist/esm/ontario-accordion_44.entry.js.map +1 -0
- package/dist/esm/ontario-design-system-components.js +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/ontario-design-system-components.esm.js.map +1 -1
- package/dist/ontario-design-system-components/p-103a233b.js.map +1 -1
- package/dist/ontario-design-system-components/{p-abe58ec9.entry.js → p-ac4e76b2.entry.js} +1927 -1728
- package/dist/ontario-design-system-components/p-ac4e76b2.entry.js.map +1 -0
- package/dist/types/components/ontario-card/ontario-card-types.d.ts +4 -4
- package/dist/types/components/ontario-card/ontario-card.d.ts +40 -29
- package/dist/types/components/ontario-date-input/utils/date-validation-utils.d.ts +14 -0
- package/dist/types/components/ontario-search-box/ontario-search-box.d.ts +180 -0
- package/dist/types/components.d.ts +199 -16
- package/dist/types/utils/common/input/input.d.ts +2 -1
- package/dist/types/utils/common/input-caption/input-caption.d.ts +7 -1
- package/package.json +3 -3
- package/src/components/ontario-card/ontario-card-types.tsx +33 -4
- package/src/components/ontario-card/ontario-card.scss +54 -40
- package/src/components/ontario-card/ontario-card.tsx +94 -68
- package/src/components/ontario-card/readme.md +57 -27
- package/src/components/ontario-card/test/__snapshots__/ontario-cards.spec.tsx.snap +66 -0
- package/src/components/ontario-card/test/ontario-cards.spec.tsx +27 -13
- package/src/components/ontario-card-collection/readme.md +13 -13
- package/src/components/ontario-checkbox/ontario-checkboxes.scss +0 -1
- 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/components/ontario-header/service-ontario-header.scss +0 -4
- package/src/components/ontario-hint-text/readme.md +2 -0
- package/src/components/ontario-radio-buttons/ontario-radio-buttons.scss +0 -1
- package/src/components/ontario-search-box/assets/ontario-icon-close.svg +1 -0
- package/src/components/ontario-search-box/assets/ontario-logo--mobile.svg +6 -0
- package/src/components/ontario-search-box/ontario-search-box.scss +141 -0
- package/src/components/ontario-search-box/ontario-search-box.tsx +341 -0
- package/src/components/ontario-search-box/readme.md +132 -0
- package/src/components/ontario-search-box/test/__snapshots__/ontario-search-box.spec.tsx.snap +35 -0
- package/src/components/ontario-search-box/test/ontario-search-box.e2e.ts +21 -0
- package/src/components/ontario-search-box/test/ontario-search-box.spec.tsx +22 -0
- package/src/components.d.ts +199 -16
- package/src/config.json +1 -4
- package/src/index.html +287 -52
- package/src/utils/common/input/input.tsx +4 -1
- package/src/utils/common/input-caption/input-caption.tsx +9 -3
- 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/ontario-design-system-components.esm.js.map +1 -1
- package/www/build/p-103a233b.js.map +1 -1
- package/www/build/{p-abe58ec9.entry.js → p-ac4e76b2.entry.js} +1927 -1728
- package/www/build/p-ac4e76b2.entry.js.map +1 -0
- package/www/build/{p-fdc9ab6d.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 +261 -52
- package/dist/cjs/ontario-accordion_43.cjs.entry.js.map +0 -1
- package/dist/esm/ontario-accordion_43.entry.js.map +0 -1
- package/dist/ontario-design-system-components/p-abe58ec9.entry.js.map +0 -1
- package/www/build/p-abe58ec9.entry.js.map +0 -1
package/src/index.html
CHANGED
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
<li><a href="#text-inputs">Text inputs</a></li>
|
|
63
63
|
<li><a href="#date-input">Date input</a></li>
|
|
64
64
|
<li><a href="#step-indicator">Step indicator</a></li>
|
|
65
|
+
<li><a href="#search-box">Search Box</a></li>
|
|
65
66
|
<li><a href="#form">Form example</a></li>
|
|
66
67
|
</ol>
|
|
67
68
|
<hr />
|
|
@@ -176,58 +177,280 @@
|
|
|
176
177
|
<div>
|
|
177
178
|
<h2 id="card">Card Collection & Card</h2>
|
|
178
179
|
<div>
|
|
180
|
+
<h3>Basic cards (no images)</h3>
|
|
179
181
|
<ontario-card-collection cards-per-row="4">
|
|
180
|
-
<ontario-card-collection cards-per-row="2">
|
|
181
|
-
<ontario-card
|
|
182
|
-
card-type="horizonal"
|
|
183
|
-
label="Card Title 1"
|
|
184
|
-
image="https://picsum.photos/200/300"
|
|
185
|
-
card-link="https://google.ca"
|
|
186
|
-
horizontal-image-position-type="left"
|
|
187
|
-
horizontal-image-size-type="one-fourth"
|
|
188
|
-
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
189
|
-
>
|
|
190
|
-
</ontario-card>
|
|
191
|
-
<ontario-card
|
|
192
|
-
card-type="horizonal"
|
|
193
|
-
label="Card Title 2"
|
|
194
|
-
image="https://picsum.photos/200/300"
|
|
195
|
-
horizontal-image-position-type="left"
|
|
196
|
-
horizontal-image-size-type="one-fourth"
|
|
197
|
-
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
198
|
-
>
|
|
199
|
-
</ontario-card>
|
|
200
|
-
</ontario-card-collection>
|
|
201
182
|
<ontario-card
|
|
202
|
-
|
|
203
|
-
label="Card Title
|
|
204
|
-
|
|
183
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
184
|
+
label="Card Title 1"
|
|
185
|
+
>
|
|
186
|
+
</ontario-card>
|
|
187
|
+
<ontario-card
|
|
188
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
189
|
+
header-colour="sky"
|
|
190
|
+
label="Card Title 2"
|
|
191
|
+
>
|
|
192
|
+
</ontario-card>
|
|
193
|
+
<ontario-card label="Card Title 3"> </ontario-card>
|
|
194
|
+
<ontario-card header-colour="sky" label="Card Title 4"> </ontario-card>
|
|
195
|
+
</ontario-card-collection>
|
|
196
|
+
|
|
197
|
+
<h3>Basic cards with 4:3 images</h3>
|
|
198
|
+
<ontario-card-collection cards-per-row="4">
|
|
199
|
+
<ontario-card
|
|
200
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
201
|
+
image="https://picsum.photos/300/225"
|
|
202
|
+
label="Card Title 1"
|
|
203
|
+
>
|
|
204
|
+
</ontario-card>
|
|
205
|
+
<ontario-card
|
|
206
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
207
|
+
image="https://picsum.photos/300/225"
|
|
208
|
+
header-colour="sky"
|
|
209
|
+
label="Card Title 2"
|
|
210
|
+
>
|
|
211
|
+
</ontario-card>
|
|
212
|
+
<ontario-card image="https://picsum.photos/300/225" label="Card Title 3"> </ontario-card>
|
|
213
|
+
<ontario-card header-colour="sky" image="https://picsum.photos/300/225" label="Card Title 4">
|
|
214
|
+
</ontario-card>
|
|
215
|
+
</ontario-card-collection>
|
|
216
|
+
|
|
217
|
+
<h3>Basic cards with 16:9 images</h3>
|
|
218
|
+
<ontario-card-collection cards-per-row="4">
|
|
219
|
+
<ontario-card
|
|
220
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
221
|
+
image="https://picsum.photos/300/169"
|
|
222
|
+
label="Card Title 1"
|
|
223
|
+
>
|
|
224
|
+
</ontario-card>
|
|
225
|
+
<ontario-card
|
|
226
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
227
|
+
image="https://picsum.photos/300/169"
|
|
228
|
+
header-colour="sky"
|
|
229
|
+
label="Card Title 2"
|
|
230
|
+
>
|
|
231
|
+
</ontario-card>
|
|
232
|
+
<ontario-card image="https://picsum.photos/300/169" label="Card Title 3"> </ontario-card>
|
|
233
|
+
<ontario-card header-colour="sky" image="https://picsum.photos/300/169" label="Card Title 4">
|
|
234
|
+
</ontario-card>
|
|
235
|
+
</ontario-card-collection>
|
|
236
|
+
|
|
237
|
+
<h3>Basic cards with 2:1 images</h3>
|
|
238
|
+
<ontario-card-collection cards-per-row="4">
|
|
239
|
+
<ontario-card
|
|
240
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
241
|
+
image="https://picsum.photos/300/150"
|
|
242
|
+
label="Card Title 1"
|
|
243
|
+
>
|
|
244
|
+
</ontario-card>
|
|
245
|
+
<ontario-card
|
|
246
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
247
|
+
image="https://picsum.photos/300/150"
|
|
248
|
+
header-colour="sky"
|
|
249
|
+
label="Card Title 2"
|
|
250
|
+
>
|
|
251
|
+
</ontario-card>
|
|
252
|
+
<ontario-card image="https://picsum.photos/300/150" label="Card Title 3"> </ontario-card>
|
|
253
|
+
<ontario-card header-colour="sky" image="https://picsum.photos/300/150" label="Card Title 4">
|
|
254
|
+
</ontario-card>
|
|
255
|
+
</ontario-card-collection>
|
|
256
|
+
|
|
257
|
+
<h3>Horizontal cards with left align 9:16 images (one-fourth size)</h3>
|
|
258
|
+
<ontario-card-collection cards-per-row="4">
|
|
259
|
+
<ontario-card
|
|
260
|
+
layout="horizontal"
|
|
261
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
262
|
+
image="https://picsum.photos/169/300"
|
|
205
263
|
horizontal-image-position-type="left"
|
|
206
264
|
horizontal-image-size-type="one-fourth"
|
|
265
|
+
label="Card Title 1"
|
|
266
|
+
>
|
|
267
|
+
</ontario-card>
|
|
268
|
+
<ontario-card
|
|
269
|
+
layout="horizontal"
|
|
207
270
|
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
271
|
+
image="https://picsum.photos/169/300"
|
|
272
|
+
header-colour="sky"
|
|
273
|
+
horizontal-image-position-type="left"
|
|
274
|
+
horizontal-image-size-type="one-fourth"
|
|
275
|
+
label="Card Title 2"
|
|
208
276
|
>
|
|
209
277
|
</ontario-card>
|
|
210
278
|
<ontario-card
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
image="
|
|
279
|
+
layout="horizontal"
|
|
280
|
+
image="https://picsum.photos/169/300"
|
|
281
|
+
horizontal-image-position-type="left"
|
|
282
|
+
horizontal-image-size-type="one-fourth"
|
|
283
|
+
label="Card Title 3"
|
|
284
|
+
>
|
|
285
|
+
</ontario-card>
|
|
286
|
+
<ontario-card
|
|
287
|
+
layout="horizontal"
|
|
288
|
+
header-colour="sky"
|
|
289
|
+
image="https://picsum.photos/169/300"
|
|
214
290
|
horizontal-image-position-type="left"
|
|
215
291
|
horizontal-image-size-type="one-fourth"
|
|
292
|
+
label="Card Title 4"
|
|
293
|
+
>
|
|
294
|
+
</ontario-card>
|
|
295
|
+
</ontario-card-collection>
|
|
296
|
+
|
|
297
|
+
<h3>Horizontal cards with left align 9:16 images (one-third size)</h3>
|
|
298
|
+
<ontario-card-collection cards-per-row="4">
|
|
299
|
+
<ontario-card
|
|
300
|
+
layout="horizontal"
|
|
216
301
|
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
302
|
+
image="https://picsum.photos/169/300"
|
|
303
|
+
horizontal-image-position-type="left"
|
|
304
|
+
horizontal-image-size-type="one-third"
|
|
305
|
+
label="Card Title 1"
|
|
217
306
|
>
|
|
218
307
|
</ontario-card>
|
|
219
308
|
<ontario-card
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
image="https://picsum.photos/
|
|
309
|
+
layout="horizontal"
|
|
310
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
311
|
+
image="https://picsum.photos/169/300"
|
|
312
|
+
header-colour="sky"
|
|
223
313
|
horizontal-image-position-type="left"
|
|
314
|
+
horizontal-image-size-type="one-third"
|
|
315
|
+
label="Card Title 2"
|
|
316
|
+
>
|
|
317
|
+
</ontario-card>
|
|
318
|
+
<ontario-card
|
|
319
|
+
layout="horizontal"
|
|
320
|
+
image="https://picsum.photos/169/300"
|
|
321
|
+
horizontal-image-position-type="left"
|
|
322
|
+
horizontal-image-size-type="one-third"
|
|
323
|
+
label="Card Title 3"
|
|
324
|
+
>
|
|
325
|
+
</ontario-card>
|
|
326
|
+
<ontario-card
|
|
327
|
+
layout="horizontal"
|
|
328
|
+
header-colour="sky"
|
|
329
|
+
image="https://picsum.photos/169/300"
|
|
330
|
+
horizontal-image-position-type="left"
|
|
331
|
+
horizontal-image-size-type="one-third"
|
|
332
|
+
label="Card Title 4"
|
|
333
|
+
>
|
|
334
|
+
</ontario-card>
|
|
335
|
+
</ontario-card-collection>
|
|
336
|
+
|
|
337
|
+
<h3>Horizontal cards with right align 9:16 images (one-fourth size)</h3>
|
|
338
|
+
<ontario-card-collection cards-per-row="4">
|
|
339
|
+
<ontario-card
|
|
340
|
+
layout="horizontal"
|
|
341
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
342
|
+
image="https://picsum.photos/169/300"
|
|
343
|
+
horizontal-image-position-type="right"
|
|
224
344
|
horizontal-image-size-type="one-fourth"
|
|
345
|
+
label="Card Title 1"
|
|
346
|
+
>
|
|
347
|
+
</ontario-card>
|
|
348
|
+
<ontario-card
|
|
349
|
+
layout="horizontal"
|
|
350
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
351
|
+
image="https://picsum.photos/169/300"
|
|
352
|
+
header-colour="sky"
|
|
353
|
+
horizontal-image-position-type="right"
|
|
354
|
+
horizontal-image-size-type="one-fourth"
|
|
355
|
+
label="Card Title 2"
|
|
356
|
+
>
|
|
357
|
+
</ontario-card>
|
|
358
|
+
<ontario-card
|
|
359
|
+
layout="horizontal"
|
|
360
|
+
image="https://picsum.photos/169/300"
|
|
361
|
+
horizontal-image-position-type="right"
|
|
362
|
+
horizontal-image-size-type="one-fourth"
|
|
363
|
+
label="Card Title 3"
|
|
364
|
+
>
|
|
365
|
+
</ontario-card>
|
|
366
|
+
<ontario-card
|
|
367
|
+
layout="horizontal"
|
|
368
|
+
header-colour="sky"
|
|
369
|
+
image="https://picsum.photos/169/300"
|
|
370
|
+
horizontal-image-position-type="right"
|
|
371
|
+
horizontal-image-size-type="one-fourth"
|
|
372
|
+
label="Card Title 4"
|
|
373
|
+
>
|
|
374
|
+
</ontario-card>
|
|
375
|
+
</ontario-card-collection>
|
|
376
|
+
|
|
377
|
+
<h3>Horizontal cards with right align 9:16 images (one-third size)</h3>
|
|
378
|
+
<ontario-card-collection cards-per-row="4">
|
|
379
|
+
<ontario-card
|
|
380
|
+
layout="horizontal"
|
|
381
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
382
|
+
image="https://picsum.photos/169/300"
|
|
383
|
+
horizontal-image-position-type="right"
|
|
384
|
+
horizontal-image-size-type="one-third"
|
|
385
|
+
label="Card Title 1"
|
|
386
|
+
>
|
|
387
|
+
</ontario-card>
|
|
388
|
+
<ontario-card
|
|
389
|
+
layout="horizontal"
|
|
390
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
391
|
+
image="https://picsum.photos/169/300"
|
|
392
|
+
header-colour="sky"
|
|
393
|
+
horizontal-image-position-type="right"
|
|
394
|
+
horizontal-image-size-type="one-third"
|
|
395
|
+
label="Card Title 2"
|
|
396
|
+
>
|
|
397
|
+
</ontario-card>
|
|
398
|
+
<ontario-card
|
|
399
|
+
layout="horizontal"
|
|
400
|
+
image="https://picsum.photos/169/300"
|
|
401
|
+
horizontal-image-position-type="right"
|
|
402
|
+
horizontal-image-size-type="one-third"
|
|
403
|
+
label="Card Title 3"
|
|
404
|
+
>
|
|
405
|
+
</ontario-card>
|
|
406
|
+
<ontario-card
|
|
407
|
+
layout="horizontal"
|
|
408
|
+
header-colour="sky"
|
|
409
|
+
image="https://picsum.photos/169/300"
|
|
410
|
+
horizontal-image-position-type="right"
|
|
411
|
+
horizontal-image-size-type="one-third"
|
|
412
|
+
label="Card Title 4"
|
|
413
|
+
>
|
|
414
|
+
</ontario-card>
|
|
415
|
+
</ontario-card-collection>
|
|
416
|
+
|
|
417
|
+
<h3>Edge cases</h3>
|
|
418
|
+
<ontario-card-collection cards-per-row="4">
|
|
419
|
+
<ontario-card
|
|
420
|
+
header-colour="orange"
|
|
421
|
+
label="Card Title 1 Card Title 1 Card Title 1"
|
|
422
|
+
image="https://picsum.photos/200/300"
|
|
423
|
+
>
|
|
424
|
+
</ontario-card>
|
|
425
|
+
<ontario-card
|
|
426
|
+
header-colour="sky"
|
|
427
|
+
label="Card Title 2"
|
|
428
|
+
image="https://picsum.photos/200/300"
|
|
225
429
|
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
226
430
|
>
|
|
227
431
|
</ontario-card>
|
|
228
432
|
<ontario-card
|
|
229
|
-
|
|
230
|
-
|
|
433
|
+
label="Card Title 3"
|
|
434
|
+
image="https://picsum.photos/200/300"
|
|
435
|
+
description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"
|
|
436
|
+
>
|
|
437
|
+
</ontario-card>
|
|
438
|
+
</ontario-card-collection>
|
|
439
|
+
|
|
440
|
+
<ontario-card-collection cards-per-row="4">
|
|
441
|
+
<ontario-card
|
|
442
|
+
layout="horizontal"
|
|
443
|
+
header-colour="orange"
|
|
444
|
+
label="Card Title 1 Card Title 1 Card Title 1"
|
|
445
|
+
image="https://picsum.photos/200/300"
|
|
446
|
+
horizontal-image-position-type="left"
|
|
447
|
+
horizontal-image-size-type="one-third"
|
|
448
|
+
>
|
|
449
|
+
</ontario-card>
|
|
450
|
+
<ontario-card
|
|
451
|
+
layout="horizontal"
|
|
452
|
+
header-colour="sky"
|
|
453
|
+
label="Card Title 2"
|
|
231
454
|
image="https://picsum.photos/200/300"
|
|
232
455
|
horizontal-image-position-type="left"
|
|
233
456
|
horizontal-image-size-type="one-fourth"
|
|
@@ -235,8 +458,8 @@
|
|
|
235
458
|
>
|
|
236
459
|
</ontario-card>
|
|
237
460
|
<ontario-card
|
|
238
|
-
|
|
239
|
-
label="Card Title
|
|
461
|
+
layout="horizontal"
|
|
462
|
+
label="Card Title 3"
|
|
240
463
|
image="https://picsum.photos/200/300"
|
|
241
464
|
horizontal-image-position-type="left"
|
|
242
465
|
horizontal-image-size-type="one-fourth"
|
|
@@ -942,6 +1165,36 @@
|
|
|
942
1165
|
number-of-steps="5"
|
|
943
1166
|
></ontario-step-indicator>
|
|
944
1167
|
</div>
|
|
1168
|
+
<hr />
|
|
1169
|
+
|
|
1170
|
+
<!-- Search box -->
|
|
1171
|
+
<script>
|
|
1172
|
+
window.addEventListener('load', () => {
|
|
1173
|
+
console.log('Loaded Search Box Event Listener');
|
|
1174
|
+
const searchBox = document.getElementById('ontario-search-box');
|
|
1175
|
+
searchBox.performSearch = async ($value) => {
|
|
1176
|
+
console.log('Performing search with value:', $value);
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
searchBox.addEventListener('searchOnSubmit', (event) => {
|
|
1180
|
+
console.log('Search Event:', event);
|
|
1181
|
+
});
|
|
1182
|
+
});
|
|
1183
|
+
</script>
|
|
1184
|
+
|
|
1185
|
+
<div>
|
|
1186
|
+
<h2 id="search-box">Search box</h2>
|
|
1187
|
+
<ontario-search-box
|
|
1188
|
+
id="ontario-search-box"
|
|
1189
|
+
caption='{
|
|
1190
|
+
"captionText": "Search directory",
|
|
1191
|
+
"captionType": "default"
|
|
1192
|
+
}'
|
|
1193
|
+
hint-text="Search by employee name or organization name."
|
|
1194
|
+
></ontario-search-box>
|
|
1195
|
+
</div>
|
|
1196
|
+
|
|
1197
|
+
<hr />
|
|
945
1198
|
<div>
|
|
946
1199
|
<!-- Form -->
|
|
947
1200
|
<form id="sample-form">
|
|
@@ -1208,24 +1461,6 @@
|
|
|
1208
1461
|
<ontario-back-to-top />
|
|
1209
1462
|
|
|
1210
1463
|
<script>
|
|
1211
|
-
const changeLanguage = (e) => {
|
|
1212
|
-
e.preventDefault();
|
|
1213
|
-
let header = document.getElementById('ontarioHeader');
|
|
1214
|
-
header.customLanguageToggle = () => {
|
|
1215
|
-
setTimeout(() => {
|
|
1216
|
-
window.location.href = '/french.html';
|
|
1217
|
-
console.log(header);
|
|
1218
|
-
console.log('Lang switch');
|
|
1219
|
-
}, 5000);
|
|
1220
|
-
};
|
|
1221
|
-
};
|
|
1222
|
-
|
|
1223
|
-
window.addEventListener('load', changeLanguage);
|
|
1224
|
-
|
|
1225
|
-
function testFunction() {
|
|
1226
|
-
alert('HELLO WORLD!');
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
1464
|
function activateHeaderType(headerType) {
|
|
1230
1465
|
const ontarioHeaderElement = document.querySelector('ontario-header');
|
|
1231
1466
|
ontarioHeaderElement.type = headerType;
|
|
@@ -18,7 +18,8 @@ export type InputProps = {
|
|
|
18
18
|
onChange?: ((event: Event) => void) | undefined;
|
|
19
19
|
onBlur?: ((event: Event) => void) | undefined;
|
|
20
20
|
onFocus?: ((event: Event) => void) | undefined;
|
|
21
|
-
|
|
21
|
+
onClick?: ((event: Event) => void) | undefined;
|
|
22
|
+
ref?: (el: HTMLInputElement) => HTMLElement;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const Input: FunctionalComponent<InputProps> = ({
|
|
@@ -36,6 +37,7 @@ export const Input: FunctionalComponent<InputProps> = ({
|
|
|
36
37
|
onChange,
|
|
37
38
|
onBlur,
|
|
38
39
|
onFocus,
|
|
40
|
+
onClick,
|
|
39
41
|
ariaInvalid,
|
|
40
42
|
ariaDescribedBy,
|
|
41
43
|
ref,
|
|
@@ -58,6 +60,7 @@ export const Input: FunctionalComponent<InputProps> = ({
|
|
|
58
60
|
onChange={onChange}
|
|
59
61
|
onBlur={onBlur}
|
|
60
62
|
onFocus={onFocus}
|
|
63
|
+
onClick={onClick}
|
|
61
64
|
inputMode={inputMode}
|
|
62
65
|
ref={ref}
|
|
63
66
|
aria-invalid={ariaInvalid}
|
|
@@ -76,20 +76,26 @@ export class InputCaption implements CaptionInfo {
|
|
|
76
76
|
/**
|
|
77
77
|
* Return the `<label>` element for text inputs
|
|
78
78
|
* @param captionFor Set the `htmlFor` attribute
|
|
79
|
+
* @param hasHintExpander Indicate whether the component the label is for has a hint expander or not
|
|
80
|
+
* @param disableRequiredFlag Disable the required/optional label text _(only use in highly special cases)_
|
|
79
81
|
* @returns element containing the caption for the input
|
|
80
82
|
*/
|
|
81
|
-
getCaption = (
|
|
83
|
+
getCaption = (
|
|
84
|
+
captionFor?: string | undefined,
|
|
85
|
+
hasHintExpander: boolean = false,
|
|
86
|
+
disableRequiredFlag: boolean = false,
|
|
87
|
+
): HTMLElement => {
|
|
82
88
|
const captionText = this.captionText && this.captionText.toLowerCase();
|
|
83
89
|
const captionContent = this.isLegend ? (
|
|
84
90
|
<legend class={this.getClass()}>
|
|
85
91
|
{this.captionType === 'heading' ? <h1>{this.captionText}</h1> : this.captionText}
|
|
86
|
-
{this.getRequiredFlagElement()}
|
|
92
|
+
{!disableRequiredFlag && this.getRequiredFlagElement()}
|
|
87
93
|
{hasHintExpander && this.getHintExpanderAccessibilityText(captionText, false)}
|
|
88
94
|
</legend>
|
|
89
95
|
) : (
|
|
90
96
|
<label htmlFor={captionFor} class={this.getClass()}>
|
|
91
97
|
{this.captionText}
|
|
92
|
-
{this.getRequiredFlagElement()}
|
|
98
|
+
{!disableRequiredFlag && this.getRequiredFlagElement()}
|
|
93
99
|
{hasHintExpander && this.getHintExpanderAccessibilityText(captionText, false)}
|
|
94
100
|
</label>
|
|
95
101
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { format } from './utils';
|
|
1
|
+
import { format, isNumber, retrieveEnumKeys } from './utils';
|
|
2
2
|
|
|
3
3
|
describe('format', () => {
|
|
4
4
|
it('returns empty string for no names defined', () => {
|
|
@@ -17,3 +17,129 @@ describe('format', () => {
|
|
|
17
17
|
expect(format('Joseph', 'Quincy', 'Publique')).toEqual('Joseph Quincy Publique');
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
+
|
|
21
|
+
describe('isNumber', () => {
|
|
22
|
+
it('should return false if value is undefined', () => {
|
|
23
|
+
const value: any = undefined;
|
|
24
|
+
|
|
25
|
+
const result = isNumber(value);
|
|
26
|
+
expect(result).toEqual(false);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should return false if value that is null', () => {
|
|
30
|
+
const value: any = null;
|
|
31
|
+
|
|
32
|
+
const result = isNumber(value);
|
|
33
|
+
expect(result).toEqual(false);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should return true if value is a number', () => {
|
|
37
|
+
const value: number = 2000;
|
|
38
|
+
|
|
39
|
+
const result = isNumber(value);
|
|
40
|
+
expect(result).toEqual(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should return true if value is a number as a string', () => {
|
|
44
|
+
const value: string = '2000';
|
|
45
|
+
|
|
46
|
+
const result = isNumber(value);
|
|
47
|
+
expect(result).toEqual(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should return false if value is not a number string', () => {
|
|
51
|
+
const value: string = 'two-thousand';
|
|
52
|
+
|
|
53
|
+
const result = isNumber(value);
|
|
54
|
+
expect(result).toEqual(false);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('isNumber', () => {
|
|
59
|
+
it('should return false if value is undefined', () => {
|
|
60
|
+
const value: any = undefined;
|
|
61
|
+
|
|
62
|
+
const result = isNumber(value);
|
|
63
|
+
expect(result).toEqual(false);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should return false if value that is null', () => {
|
|
67
|
+
const value: any = null;
|
|
68
|
+
|
|
69
|
+
const result = isNumber(value);
|
|
70
|
+
expect(result).toEqual(false);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should return true if value is a number', () => {
|
|
74
|
+
const value: number = 2000;
|
|
75
|
+
|
|
76
|
+
const result = isNumber(value);
|
|
77
|
+
expect(result).toEqual(true);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should return true if value is a number as a string', () => {
|
|
81
|
+
const value: string = '2000';
|
|
82
|
+
|
|
83
|
+
const result = isNumber(value);
|
|
84
|
+
expect(result).toEqual(true);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should return false if value is not a number string', () => {
|
|
88
|
+
const value: string = 'two-thousand';
|
|
89
|
+
|
|
90
|
+
const result = isNumber(value);
|
|
91
|
+
expect(result).toEqual(false);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
enum ColourEnumNumeric {
|
|
96
|
+
RED,
|
|
97
|
+
ORANGE,
|
|
98
|
+
YELLOW,
|
|
99
|
+
GREEN,
|
|
100
|
+
BLUE,
|
|
101
|
+
INDIGO,
|
|
102
|
+
VIOLET,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
enum ColourEnumString {
|
|
106
|
+
'red' = 'Red',
|
|
107
|
+
'orange' = 'Orange',
|
|
108
|
+
'yellow' = 'Yellow',
|
|
109
|
+
'green' = 'Green',
|
|
110
|
+
'blue' = 'Blue',
|
|
111
|
+
'indigo' = 'Indigo',
|
|
112
|
+
'violet' = 'Violet',
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
describe('retrieveEnumKeys', () => {
|
|
116
|
+
it('should return empty array if enumObject is undefined', () => {
|
|
117
|
+
const expectedResult = new Array<string>(0);
|
|
118
|
+
const enumObject: any = undefined;
|
|
119
|
+
|
|
120
|
+
const result = retrieveEnumKeys(enumObject);
|
|
121
|
+
expect(result).toEqual(expectedResult);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should return empty array if enumObject is null', () => {
|
|
125
|
+
const expectedResult = new Array<string>(0);
|
|
126
|
+
const enumObject: any = null;
|
|
127
|
+
|
|
128
|
+
const result = retrieveEnumKeys(enumObject);
|
|
129
|
+
expect(result).toEqual(expectedResult);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('should return keys from numerical enum', () => {
|
|
133
|
+
const expectedResult = ['RED', 'ORANGE', 'YELLOW', 'GREEN', 'BLUE', 'INDIGO', 'VIOLET'];
|
|
134
|
+
|
|
135
|
+
const result = retrieveEnumKeys(ColourEnumNumeric);
|
|
136
|
+
expect(result).toEqual(expectedResult);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should return keys from string enum', () => {
|
|
140
|
+
const expectedResult = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'];
|
|
141
|
+
|
|
142
|
+
const result = retrieveEnumKeys(ColourEnumString);
|
|
143
|
+
expect(result).toEqual(expectedResult);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
@@ -67,7 +67,8 @@ export function removeObjectsBySpecificKey<T>(objects: T[], key: keyof T, value:
|
|
|
67
67
|
* @returns {boolean}
|
|
68
68
|
*/
|
|
69
69
|
export function isNumber(value: string | number): boolean {
|
|
70
|
-
|
|
70
|
+
if (value === undefined || value === null) return false;
|
|
71
|
+
return isNaN(Number(value)) === false;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export function isEmpty(str: string | undefined | null): boolean {
|
|
@@ -82,7 +83,8 @@ export function isEmpty(str: string | undefined | null): boolean {
|
|
|
82
83
|
* @returns {string[]}
|
|
83
84
|
*/
|
|
84
85
|
export function retrieveEnumKeys(enumObject: object): string[] {
|
|
85
|
-
|
|
86
|
+
if (enumObject === undefined || enumObject === null) return new Array<string>(0);
|
|
87
|
+
return Object.keys(enumObject).filter((key) => !isNumber(key));
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
/**
|