@gov-design-system-ce/components 0.0.35 → 0.0.37
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/core.cjs.js +1 -1
- package/dist/cjs/{form-62c6a8c6.js → form-8c6daa83.js} +8 -8
- package/dist/cjs/form-8c6daa83.js.map +1 -0
- package/dist/cjs/gov-app.cjs.entry.js +1190 -637
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-badge.cjs.entry.js +1 -1
- package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +1 -1
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +62 -0
- package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +35 -7
- package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +6 -6
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +5 -1
- package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +13 -8
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +10 -3
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizzard-item.cjs.entry.js +13 -15
- package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +1 -1
- package/dist/cjs/index-29ac07f6.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +3 -0
- package/dist/collection/components/gov-accordion/gov-accordion.css +3 -0
- package/dist/collection/components/gov-alert/gov-alert.css +3 -0
- package/dist/collection/components/gov-app/gov-app.css +3 -0
- package/dist/collection/components/gov-app/gov-app.js +10 -8
- package/dist/collection/components/gov-app/gov-app.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.css +3 -0
- package/dist/collection/components/gov-attachments/gov-attachments.css +3 -0
- package/dist/collection/components/gov-backdrop/gov-backdrop.css +3 -0
- package/dist/collection/components/gov-badge/gov-badge.css +6 -3
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +3 -0
- package/dist/collection/components/gov-button/gov-button.css +3 -3
- package/dist/collection/components/gov-card/gov-card.css +3 -0
- package/dist/collection/components/gov-container/gov-container.css +3 -0
- package/dist/collection/components/gov-control-group/constants.js +7 -0
- package/dist/collection/components/gov-control-group/constants.js.map +1 -0
- package/dist/collection/components/gov-control-group/gov-control-group.css +268 -0
- package/dist/collection/components/gov-control-group/gov-control-group.js +137 -0
- package/dist/collection/components/gov-control-group/gov-control-group.js.map +1 -0
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +3 -0
- package/dist/collection/components/gov-empty/gov-empty.css +3 -0
- package/dist/collection/components/gov-error-code/gov-error-code.css +3 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +3 -0
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +3 -0
- package/dist/collection/components/gov-form/control/gov-form-control.css +3 -0
- package/dist/collection/components/gov-form/control/gov-form-control.js +35 -10
- package/dist/collection/components/gov-form/control/gov-form-control.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.css +10 -0
- package/dist/collection/components/gov-form/group/gov-form-group.css +3 -0
- package/dist/collection/components/gov-form/input/constants.js +1 -1
- package/dist/collection/components/gov-form/input/constants.js.map +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.css +103 -50
- package/dist/collection/components/gov-form/input/gov-form-input.js +9 -9
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.css +3 -0
- package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.js.map +1 -1
- package/dist/collection/components/gov-form/message/gov-form-message.css +3 -0
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +103 -50
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +3 -0
- package/dist/collection/components/gov-form/radio/gov-form-radio.css +3 -0
- package/dist/collection/components/gov-form/search/constants.js +3 -0
- package/dist/collection/components/gov-form/search/constants.js.map +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.css +9 -1
- package/dist/collection/components/gov-form/search/gov-form-search.js +30 -0
- package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.css +103 -50
- package/dist/collection/components/gov-form/select/gov-form-select.js +12 -5
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.css +3 -0
- package/dist/collection/components/gov-grid/gov-grid-item.css +3 -0
- package/dist/collection/components/gov-grid/gov-grid.css +3 -0
- package/dist/collection/components/gov-icon/gov-icon.css +3 -0
- package/dist/collection/components/gov-layout/gov-layout-column.css +3 -0
- package/dist/collection/components/gov-layout/gov-layout.css +3 -0
- package/dist/collection/components/gov-loading/loading/gov-loading.css +3 -0
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +3 -0
- package/dist/collection/components/gov-message/gov-message.css +3 -0
- package/dist/collection/components/gov-modal/gov-modal.css +3 -0
- package/dist/collection/components/gov-nav/gov-nav-item.css +3 -0
- package/dist/collection/components/gov-nav/gov-nav.css +3 -0
- package/dist/collection/components/gov-pagination/gov-pagination.css +3 -0
- package/dist/collection/components/gov-pagination/gov-pagination.js +19 -3
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.css +3 -0
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +3 -0
- package/dist/collection/components/gov-side-nav/gov-side-nav.css +3 -0
- package/dist/collection/components/gov-spacer/gov-spacer.css +3 -0
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +3 -0
- package/dist/collection/components/gov-statsbar/gov-statsbar.css +3 -0
- package/dist/collection/components/gov-stepper/gov-stepper-item.css +3 -0
- package/dist/collection/components/gov-stepper/gov-stepper.css +3 -0
- package/dist/collection/components/gov-tabs/gov-tabs-item.css +3 -0
- package/dist/collection/components/gov-tabs/gov-tabs.css +3 -0
- package/dist/collection/components/gov-tile/container/gov-tiles.css +3 -0
- package/dist/collection/components/gov-tile/gov-tile.css +3 -0
- package/dist/collection/components/gov-toast/gov-toast.css +3 -0
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +3 -0
- package/dist/collection/components/gov-tooltip/gov-tooltip.css +3 -0
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.css +3 -0
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.js +29 -36
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +1 -1
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.types.js +2 -0
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.types.js.map +1 -0
- package/dist/collection/components/gov-wizzard/gov-wizzard.css +3 -0
- package/dist/collection/pages/Button.js +41 -0
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/ControlGroup.js +324 -0
- package/dist/collection/pages/ControlGroup.js.map +1 -0
- package/dist/collection/pages/Forms.js +369 -206
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Pagination.js +2 -2
- package/dist/collection/pages/Pagination.js.map +1 -1
- package/dist/collection/pages/Tooltip.js +24 -0
- package/dist/collection/pages/Tooltip.js.map +1 -1
- package/dist/components/form.js +16 -16
- package/dist/components/form.js.map +1 -1
- package/dist/components/gov-app.js +1190 -637
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-badge2.js +1 -1
- package/dist/components/gov-badge2.js.map +1 -1
- package/dist/components/gov-button2.js +1 -1
- package/dist/components/gov-button2.js.map +1 -1
- package/dist/components/gov-control-group.d.ts +11 -0
- package/dist/components/gov-control-group.js +75 -0
- package/dist/components/gov-control-group.js.map +1 -0
- package/dist/components/gov-form-control.js +35 -7
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-input2.js +5 -5
- package/dist/components/gov-form-input2.js.map +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-search.js +8 -2
- package/dist/components/gov-form-search.js.map +1 -1
- package/dist/components/gov-form-select2.js +12 -7
- package/dist/components/gov-form-select2.js.map +1 -1
- package/dist/components/gov-icon2.js +1 -1
- package/dist/components/gov-pagination.js +10 -3
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-wizzard-item.js +14 -17
- package/dist/components/gov-wizzard-item.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-00c4dc0d.entry.js +2 -0
- package/dist/core/p-00c4dc0d.entry.js.map +1 -0
- package/dist/core/p-06e938d7.entry.js +2 -0
- package/dist/core/p-06e938d7.entry.js.map +1 -0
- package/dist/core/{p-d14130ac.entry.js → p-1bdec1f4.entry.js} +2 -2
- package/dist/core/{p-e3b56738.entry.js → p-227a9e9b.entry.js} +2 -2
- package/dist/core/p-3a69322b.entry.js +2 -0
- package/dist/core/p-3a69322b.entry.js.map +1 -0
- package/dist/core/p-61af5a2c.js +2 -0
- package/dist/core/p-61af5a2c.js.map +1 -0
- package/dist/core/{p-fe1ee53b.entry.js → p-63ef7826.entry.js} +2 -2
- package/dist/core/p-63ef7826.entry.js.map +1 -0
- package/dist/core/p-6dc65816.entry.js +2 -0
- package/dist/core/p-6dc65816.entry.js.map +1 -0
- package/dist/core/{p-d1275fa8.entry.js → p-9584f413.entry.js} +2 -2
- package/dist/core/p-9584f413.entry.js.map +1 -0
- package/dist/core/p-9bd90cc4.entry.js +2 -0
- package/dist/core/p-9bd90cc4.entry.js.map +1 -0
- package/dist/core/{p-d9b4bc20.entry.js → p-9fbee429.entry.js} +2 -2
- package/dist/core/p-9fbee429.entry.js.map +1 -0
- package/dist/core/{p-d37f03e0.entry.js → p-bbbc4e43.entry.js} +2 -2
- package/dist/core/{p-a8ef7292.entry.js → p-c289af04.entry.js} +2 -2
- package/dist/core/p-c289af04.entry.js.map +1 -0
- package/dist/core/p-c39004f5.entry.js +2 -0
- package/dist/core/p-c39004f5.entry.js.map +1 -0
- package/dist/core/{p-5a2a9cde.entry.js → p-c69cd34e.entry.js} +2 -2
- package/dist/core/p-cc9e9a31.entry.js +2 -0
- package/dist/core/{p-a423b62a.entry.js.map → p-cc9e9a31.entry.js.map} +1 -1
- package/dist/core/p-ef7a1780.entry.js +2 -0
- package/dist/core/p-ef7a1780.entry.js.map +1 -0
- package/dist/core/p-fd555dce.entry.js +2 -0
- package/dist/core/{p-35aadeeb.entry.js.map → p-fd555dce.entry.js.map} +1 -1
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +1 -1
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/{form-613741a5.js → form-cd65d95e.js} +8 -8
- package/dist/esm/form-cd65d95e.js.map +1 -0
- package/dist/esm/gov-app.entry.js +1190 -637
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-badge.entry.js +1 -1
- package/dist/esm/gov-badge.entry.js.map +1 -1
- package/dist/esm/gov-button.entry.js +1 -1
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-control-group.entry.js +58 -0
- package/dist/esm/gov-control-group.entry.js.map +1 -0
- package/dist/esm/gov-form-checkbox.entry.js +1 -1
- package/dist/esm/gov-form-control.entry.js +35 -7
- package/dist/esm/gov-form-control.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +2 -2
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-input.entry.js +6 -6
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +2 -2
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +1 -1
- package/dist/esm/gov-form-search.entry.js +5 -1
- package/dist/esm/gov-form-search.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +13 -8
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js +10 -3
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-wizzard-item.entry.js +13 -15
- package/dist/esm/gov-wizzard-item.entry.js.map +1 -1
- package/dist/esm/index-b010bfb4.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +1531 -880
- package/dist/types/components/gov-app/gov-app.d.ts +9 -8
- package/dist/types/components/gov-control-group/constants.d.ts +7 -0
- package/dist/types/components/gov-control-group/gov-control-group.d.ts +29 -0
- package/dist/types/components/gov-form/control/gov-form-control.d.ts +2 -1
- package/dist/types/components/gov-form/input/constants.d.ts +1 -1
- package/dist/types/components/gov-form/input/gov-form-input.d.ts +1 -2
- package/dist/types/components/gov-form/search/constants.d.ts +4 -0
- package/dist/types/components/gov-form/search/gov-form-search.d.ts +5 -0
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +2 -0
- package/dist/types/components/gov-pagination/gov-pagination.d.ts +1 -0
- package/dist/types/components/gov-wizzard/gov-wizzard-item.d.ts +7 -8
- package/dist/types/components/gov-wizzard/gov-wizzard-item.types.d.ts +4 -0
- package/dist/types/components.d.ts +61 -5
- package/dist/types/pages/ControlGroup.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/form-62c6a8c6.js.map +0 -1
- package/dist/core/p-0a300d3e.entry.js +0 -2
- package/dist/core/p-0a300d3e.entry.js.map +0 -1
- package/dist/core/p-35aadeeb.entry.js +0 -2
- package/dist/core/p-37f6b4ef.entry.js +0 -2
- package/dist/core/p-37f6b4ef.entry.js.map +0 -1
- package/dist/core/p-7e524b49.js +0 -2
- package/dist/core/p-7e524b49.js.map +0 -1
- package/dist/core/p-a423b62a.entry.js +0 -2
- package/dist/core/p-a825183a.entry.js +0 -2
- package/dist/core/p-a825183a.entry.js.map +0 -1
- package/dist/core/p-a8ef7292.entry.js.map +0 -1
- package/dist/core/p-bbc765ca.entry.js +0 -2
- package/dist/core/p-bbc765ca.entry.js.map +0 -1
- package/dist/core/p-d1275fa8.entry.js.map +0 -1
- package/dist/core/p-d9b4bc20.entry.js.map +0 -1
- package/dist/core/p-e4bb6114.entry.js +0 -2
- package/dist/core/p-e4bb6114.entry.js.map +0 -1
- package/dist/core/p-e6904513.entry.js +0 -2
- package/dist/core/p-e6904513.entry.js.map +0 -1
- package/dist/core/p-fe1ee53b.entry.js.map +0 -1
- package/dist/esm/form-613741a5.js.map +0 -1
- /package/dist/core/{p-d14130ac.entry.js.map → p-1bdec1f4.entry.js.map} +0 -0
- /package/dist/core/{p-e3b56738.entry.js.map → p-227a9e9b.entry.js.map} +0 -0
- /package/dist/core/{p-d37f03e0.entry.js.map → p-bbbc4e43.entry.js.map} +0 -0
- /package/dist/core/{p-5a2a9cde.entry.js.map → p-c69cd34e.entry.js.map} +0 -0
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
/*
|
|
82
82
|
- Variables - Colors
|
|
83
83
|
*/
|
|
84
|
+
/*
|
|
85
|
+
- Variables - Control Group
|
|
86
|
+
*/
|
|
84
87
|
/*
|
|
85
88
|
- Variables - Cookiebar
|
|
86
89
|
*/
|
|
@@ -227,7 +230,6 @@
|
|
|
227
230
|
width: 100%;
|
|
228
231
|
gap: 0.5rem;
|
|
229
232
|
align-items: center;
|
|
230
|
-
border: var(--gov-form-input-border-width, 0.0625rem solid var(--gov-color-secondary-700));
|
|
231
233
|
border-radius: var(--gov-border-radius, 0.1875rem);
|
|
232
234
|
background-color: var(--gov-form-bg-color, var(--gov-color-neutral-white));
|
|
233
235
|
}
|
|
@@ -257,4 +259,10 @@
|
|
|
257
259
|
.gov-form-search__button {
|
|
258
260
|
flex: 0 0 auto;
|
|
259
261
|
margin: 0.1875rem 0.1875rem 0.1875rem 0;
|
|
262
|
+
}
|
|
263
|
+
.gov-form-search[variant=primary] {
|
|
264
|
+
border: var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600));
|
|
265
|
+
}
|
|
266
|
+
.gov-form-search[variant=secondary] {
|
|
267
|
+
border: var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700));
|
|
260
268
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
2
|
import { FormSearchClass } from './constants';
|
|
3
3
|
export class GovFormSearch {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.variant = 'secondary';
|
|
6
|
+
}
|
|
4
7
|
render() {
|
|
5
8
|
return (h(Host, { class: FormSearchClass.root }, h("span", { class: FormSearchClass.input }, h("slot", { name: "input" })), h("span", { class: FormSearchClass.button }, h("slot", { name: "button" }))));
|
|
6
9
|
}
|
|
@@ -15,6 +18,33 @@ export class GovFormSearch {
|
|
|
15
18
|
"$": ["gov-form-search.css"]
|
|
16
19
|
};
|
|
17
20
|
}
|
|
21
|
+
static get properties() {
|
|
22
|
+
return {
|
|
23
|
+
"variant": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"mutable": false,
|
|
26
|
+
"complexType": {
|
|
27
|
+
"original": "FormSearchVariantType",
|
|
28
|
+
"resolved": "\"primary\" | \"secondary\"",
|
|
29
|
+
"references": {
|
|
30
|
+
"FormSearchVariantType": {
|
|
31
|
+
"location": "import",
|
|
32
|
+
"path": "./constants"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": false,
|
|
37
|
+
"optional": false,
|
|
38
|
+
"docs": {
|
|
39
|
+
"tags": [],
|
|
40
|
+
"text": "Style variation of the form input."
|
|
41
|
+
},
|
|
42
|
+
"attribute": "variant",
|
|
43
|
+
"reflect": false,
|
|
44
|
+
"defaultValue": "'secondary'"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
18
48
|
static get elementRef() { return "host"; }
|
|
19
49
|
}
|
|
20
50
|
//# sourceMappingURL=gov-form-search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-search.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/search/gov-form-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"gov-form-search.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/search/gov-form-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,eAAe,EAAyB,MAAM,aAAa,CAAA;AAKpE,MAAM,OAAO,aAAa;;mBAKyB,WAAW;;EAE7D,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,eAAe,CAAC,IAAI;MAChC,YAAM,KAAK,EAAE,eAAe,CAAC,KAAK;QACjC,YAAM,IAAI,EAAC,OAAO,GAAG,CACf;MACP,YAAM,KAAK,EAAE,eAAe,CAAC,MAAM;QAClC,YAAM,IAAI,EAAC,QAAQ,GAAG,CAChB,CACD,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { FormSearchClass, FormSearchVariantType } from './constants'\n@Component({\n\ttag: 'gov-form-search',\n\tstyleUrl: 'gov-form-search.scss',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant: FormSearchVariantType = 'secondary'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root}>\n\t\t\t\t<span class={FormSearchClass.input}>\n\t\t\t\t\t<slot name=\"input\" />\n\t\t\t\t</span>\n\t\t\t\t<span class={FormSearchClass.button}>\n\t\t\t\t\t<slot name=\"button\" />\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
|
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
/*
|
|
82
82
|
- Variables - Colors
|
|
83
83
|
*/
|
|
84
|
+
/*
|
|
85
|
+
- Variables - Control Group
|
|
86
|
+
*/
|
|
84
87
|
/*
|
|
85
88
|
- Variables - Cookiebar
|
|
86
89
|
*/
|
|
@@ -242,10 +245,8 @@
|
|
|
242
245
|
.gov-form-select select,
|
|
243
246
|
.gov-form-select textarea {
|
|
244
247
|
width: 100%;
|
|
245
|
-
border: var(--gov-form-input-border-width, 0.0625rem solid var(--gov-color-secondary-700));
|
|
246
248
|
border-radius: var(--gov-border-radius, 0.1875rem);
|
|
247
249
|
background-color: var(--gov-form-bg-color, var(--gov-color-neutral-white));
|
|
248
|
-
color: var(--gov-form-input-color, var(--gov-color-secondary-700));
|
|
249
250
|
font-family: var(--gov-font-family, "Roboto", sans-serif);
|
|
250
251
|
}
|
|
251
252
|
.gov-form-select input:focus,
|
|
@@ -282,7 +283,6 @@
|
|
|
282
283
|
top: 50%;
|
|
283
284
|
display: flex;
|
|
284
285
|
justify-content: center;
|
|
285
|
-
color: var(--gov-form-input-icon-color, var(--gov-color-primary));
|
|
286
286
|
transform: translateY(-50%);
|
|
287
287
|
pointer-events: none;
|
|
288
288
|
}
|
|
@@ -292,59 +292,38 @@
|
|
|
292
292
|
.gov-form-select *[slot=right-icon] {
|
|
293
293
|
right: 0;
|
|
294
294
|
}
|
|
295
|
-
[
|
|
296
|
-
|
|
295
|
+
[size=s].gov-form-select {
|
|
296
|
+
font-weight: var(--gov-text-s-font-weight);
|
|
297
|
+
font-size: var(--gov-text-s-font-size);
|
|
298
|
+
line-height: var(--gov-text-s-line-height);
|
|
299
|
+
letter-spacing: var(--gov-text-s-letter-spacing);
|
|
300
|
+
gap: 0.5rem var(--gov-form-input-core-s-icon-size, 1rem);
|
|
297
301
|
}
|
|
298
|
-
[
|
|
299
|
-
[
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
background: var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));
|
|
307
|
-
color: var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));
|
|
308
|
-
}
|
|
309
|
-
[disabled=""].gov-form-select *[slot=left-icon],
|
|
310
|
-
[disabled=""].gov-form-select *[slot=right-icon], [disabled=true i].gov-form-select *[slot=left-icon],
|
|
311
|
-
[disabled=true i].gov-form-select *[slot=right-icon], [disabled="1"].gov-form-select *[slot=left-icon],
|
|
312
|
-
[disabled="1"].gov-form-select *[slot=right-icon] {
|
|
313
|
-
color: var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));
|
|
314
|
-
}
|
|
315
|
-
[invalid=""].gov-form-select input,
|
|
316
|
-
[invalid=""].gov-form-select select,
|
|
317
|
-
[invalid=""].gov-form-select textarea, [invalid=true i].gov-form-select input,
|
|
318
|
-
[invalid=true i].gov-form-select select,
|
|
319
|
-
[invalid=true i].gov-form-select textarea, [invalid="1"].gov-form-select input,
|
|
320
|
-
[invalid="1"].gov-form-select select,
|
|
321
|
-
[invalid="1"].gov-form-select textarea {
|
|
322
|
-
border-color: var(--gov-form-state-color-error, var(--gov-color-error));
|
|
323
|
-
color: var(--gov-form-state-color-error, var(--gov-color-error));
|
|
302
|
+
[size=s].gov-form-select input,
|
|
303
|
+
[size=s].gov-form-select select {
|
|
304
|
+
font-weight: var(--gov-text-s-font-weight);
|
|
305
|
+
font-size: var(--gov-text-s-font-size);
|
|
306
|
+
line-height: var(--gov-text-s-line-height);
|
|
307
|
+
letter-spacing: var(--gov-text-s-letter-spacing);
|
|
308
|
+
height: var(--gov-form-input-core-s-height, 2rem);
|
|
309
|
+
padding: var(--gov-form-input-core-s-padding, 0.25rem 0.75rem);
|
|
324
310
|
}
|
|
325
|
-
[
|
|
326
|
-
|
|
311
|
+
[size=s].gov-form-select *[slot=left-icon],
|
|
312
|
+
[size=s].gov-form-select *[slot=right-icon] {
|
|
313
|
+
width: var(--gov-form-input-core-s-icon-size, 1rem);
|
|
314
|
+
height: var(--gov-form-input-core-s-icon-size, 1rem);
|
|
327
315
|
}
|
|
328
|
-
[
|
|
329
|
-
|
|
330
|
-
[invalid=""].gov-form-select textarea::placeholder, [invalid=true i].gov-form-select input::placeholder,
|
|
331
|
-
[invalid=true i].gov-form-select select::placeholder,
|
|
332
|
-
[invalid=true i].gov-form-select textarea::placeholder, [invalid="1"].gov-form-select input::placeholder,
|
|
333
|
-
[invalid="1"].gov-form-select select::placeholder,
|
|
334
|
-
[invalid="1"].gov-form-select textarea::placeholder {
|
|
335
|
-
color: var(--gov-form-state-color-error, var(--gov-color-error-300));
|
|
316
|
+
[size=s].gov-form-select *[slot=left-icon] {
|
|
317
|
+
left: calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2);
|
|
336
318
|
}
|
|
337
|
-
[
|
|
338
|
-
|
|
339
|
-
[invalid=true i].gov-form-select *[slot=right-icon], [invalid="1"].gov-form-select *[slot=left-icon],
|
|
340
|
-
[invalid="1"].gov-form-select *[slot=right-icon] {
|
|
341
|
-
color: var(--gov-form-state-color-error, var(--gov-color-error));
|
|
319
|
+
[size=s].gov-form-select *[slot=left-icon] ~ input {
|
|
320
|
+
padding-left: var(--gov-form-input-core-s-icon-padding, 2rem);
|
|
342
321
|
}
|
|
343
|
-
[
|
|
344
|
-
|
|
322
|
+
[size=s].gov-form-select *[slot=right-icon] {
|
|
323
|
+
right: calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2);
|
|
345
324
|
}
|
|
346
|
-
[
|
|
347
|
-
|
|
325
|
+
[size=s].gov-form-select *[slot=right-icon] ~ input, [size=s].gov-form-select *[slot=right-icon] ~ select {
|
|
326
|
+
padding-right: var(--gov-form-input-core-s-icon-padding, 2rem);
|
|
348
327
|
}
|
|
349
328
|
[size=m].gov-form-select {
|
|
350
329
|
font-weight: var(--gov-text-m-font-weight);
|
|
@@ -445,6 +424,80 @@
|
|
|
445
424
|
[size=xl].gov-form-select *[slot=right-icon] ~ input, [size=xl].gov-form-select *[slot=right-icon] ~ select {
|
|
446
425
|
padding-right: var(--gov-form-input-core-xl-icon-padding, 3rem);
|
|
447
426
|
}
|
|
427
|
+
[variant=primary].gov-form-select input,
|
|
428
|
+
[variant=primary].gov-form-select select,
|
|
429
|
+
[variant=primary].gov-form-select textarea {
|
|
430
|
+
color: var(--gov-form-input-color-primary, var(--gov-color-secondary-700));
|
|
431
|
+
border: var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600));
|
|
432
|
+
}
|
|
433
|
+
[variant=primary].gov-form-select *[slot=left-icon],
|
|
434
|
+
[variant=primary].gov-form-select *[slot=right-icon] {
|
|
435
|
+
color: var(--gov-form-input-icon-color-primary, var(--gov-color-primary));
|
|
436
|
+
}
|
|
437
|
+
[variant=secondary].gov-form-select input,
|
|
438
|
+
[variant=secondary].gov-form-select select,
|
|
439
|
+
[variant=secondary].gov-form-select textarea {
|
|
440
|
+
color: var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));
|
|
441
|
+
border: var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700));
|
|
442
|
+
}
|
|
443
|
+
[variant=secondary].gov-form-select *[slot=left-icon],
|
|
444
|
+
[variant=secondary].gov-form-select *[slot=right-icon] {
|
|
445
|
+
color: var(--gov-form-input-icon-color-secondary, var(--gov-color-primary));
|
|
446
|
+
}
|
|
447
|
+
[disabled=""].gov-form-select, [disabled=true i].gov-form-select, [disabled="1"].gov-form-select {
|
|
448
|
+
pointer-events: none;
|
|
449
|
+
}
|
|
450
|
+
[disabled=""].gov-form-select input,
|
|
451
|
+
[disabled=""].gov-form-select select,
|
|
452
|
+
[disabled=""].gov-form-select textarea, [disabled=true i].gov-form-select input,
|
|
453
|
+
[disabled=true i].gov-form-select select,
|
|
454
|
+
[disabled=true i].gov-form-select textarea, [disabled="1"].gov-form-select input,
|
|
455
|
+
[disabled="1"].gov-form-select select,
|
|
456
|
+
[disabled="1"].gov-form-select textarea {
|
|
457
|
+
border-color: var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));
|
|
458
|
+
background: var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));
|
|
459
|
+
color: var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));
|
|
460
|
+
}
|
|
461
|
+
[disabled=""].gov-form-select *[slot=left-icon],
|
|
462
|
+
[disabled=""].gov-form-select *[slot=right-icon], [disabled=true i].gov-form-select *[slot=left-icon],
|
|
463
|
+
[disabled=true i].gov-form-select *[slot=right-icon], [disabled="1"].gov-form-select *[slot=left-icon],
|
|
464
|
+
[disabled="1"].gov-form-select *[slot=right-icon] {
|
|
465
|
+
color: var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));
|
|
466
|
+
}
|
|
467
|
+
[invalid=""].gov-form-select input,
|
|
468
|
+
[invalid=""].gov-form-select select,
|
|
469
|
+
[invalid=""].gov-form-select textarea, [invalid=true i].gov-form-select input,
|
|
470
|
+
[invalid=true i].gov-form-select select,
|
|
471
|
+
[invalid=true i].gov-form-select textarea, [invalid="1"].gov-form-select input,
|
|
472
|
+
[invalid="1"].gov-form-select select,
|
|
473
|
+
[invalid="1"].gov-form-select textarea {
|
|
474
|
+
border-color: var(--gov-form-state-color-error, var(--gov-color-error));
|
|
475
|
+
color: var(--gov-form-state-color-error, var(--gov-color-error));
|
|
476
|
+
}
|
|
477
|
+
[invalid=""].gov-form-select input::-moz-placeholder, [invalid=""].gov-form-select select::-moz-placeholder, [invalid=""].gov-form-select textarea::-moz-placeholder, [invalid=true i].gov-form-select input::-moz-placeholder, [invalid=true i].gov-form-select select::-moz-placeholder, [invalid=true i].gov-form-select textarea::-moz-placeholder, [invalid="1"].gov-form-select input::-moz-placeholder, [invalid="1"].gov-form-select select::-moz-placeholder, [invalid="1"].gov-form-select textarea::-moz-placeholder {
|
|
478
|
+
color: var(--gov-form-state-color-error, var(--gov-color-error-300));
|
|
479
|
+
}
|
|
480
|
+
[invalid=""].gov-form-select input::placeholder,
|
|
481
|
+
[invalid=""].gov-form-select select::placeholder,
|
|
482
|
+
[invalid=""].gov-form-select textarea::placeholder, [invalid=true i].gov-form-select input::placeholder,
|
|
483
|
+
[invalid=true i].gov-form-select select::placeholder,
|
|
484
|
+
[invalid=true i].gov-form-select textarea::placeholder, [invalid="1"].gov-form-select input::placeholder,
|
|
485
|
+
[invalid="1"].gov-form-select select::placeholder,
|
|
486
|
+
[invalid="1"].gov-form-select textarea::placeholder {
|
|
487
|
+
color: var(--gov-form-state-color-error, var(--gov-color-error-300));
|
|
488
|
+
}
|
|
489
|
+
[invalid=""].gov-form-select *[slot=left-icon],
|
|
490
|
+
[invalid=""].gov-form-select *[slot=right-icon], [invalid=true i].gov-form-select *[slot=left-icon],
|
|
491
|
+
[invalid=true i].gov-form-select *[slot=right-icon], [invalid="1"].gov-form-select *[slot=left-icon],
|
|
492
|
+
[invalid="1"].gov-form-select *[slot=right-icon] {
|
|
493
|
+
color: var(--gov-form-state-color-error, var(--gov-color-error));
|
|
494
|
+
}
|
|
495
|
+
[success=""].gov-form-select *[slot=right-icon], [success=true i].gov-form-select *[slot=right-icon], [success="1"].gov-form-select *[slot=right-icon] {
|
|
496
|
+
color: var(--gov-form-state-color-success, var(--gov-color-success));
|
|
497
|
+
}
|
|
498
|
+
[success=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [success=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [success="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow) {
|
|
499
|
+
display: none;
|
|
500
|
+
}
|
|
448
501
|
|
|
449
502
|
.gov-form-select {
|
|
450
503
|
background: none;
|
|
@@ -36,6 +36,9 @@ export class GovFormSelect {
|
|
|
36
36
|
watchDisabled() {
|
|
37
37
|
this.passControlAttrs();
|
|
38
38
|
}
|
|
39
|
+
watchValue() {
|
|
40
|
+
this.markSelectedValue();
|
|
41
|
+
}
|
|
39
42
|
passControlAttrs() {
|
|
40
43
|
this.f.passAttrToControl("size", this.size);
|
|
41
44
|
this.f.passAttrToControl("disabled", toBoolAttr(this.disabled));
|
|
@@ -45,11 +48,7 @@ export class GovFormSelect {
|
|
|
45
48
|
componentWillLoad() {
|
|
46
49
|
this.validateVariant(this.variant);
|
|
47
50
|
this.validateSize(this.size);
|
|
48
|
-
this.
|
|
49
|
-
if (option.value === this.value) {
|
|
50
|
-
option.setAttribute("selected", "true");
|
|
51
|
-
}
|
|
52
|
-
});
|
|
51
|
+
this.markSelectedValue();
|
|
53
52
|
this.passControlAttrs();
|
|
54
53
|
this.f.passAttrToLabel("required", String(this.required));
|
|
55
54
|
}
|
|
@@ -59,6 +58,11 @@ export class GovFormSelect {
|
|
|
59
58
|
await this.validateWcag();
|
|
60
59
|
}
|
|
61
60
|
}
|
|
61
|
+
markSelectedValue() {
|
|
62
|
+
this.host.querySelectorAll("option").forEach((option) => {
|
|
63
|
+
option.setAttribute("selected", toBoolAttr(option.value === this.value));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
62
66
|
render() {
|
|
63
67
|
return (h(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot("prefix") && h("slot", { name: "prefix" }), h("span", { class: "element" }, h("gov-icon", { slot: "right-icon", name: "chevron-down" }), h("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null))), this.h.hasSlot("sufix") && h("slot", { name: "sufix" })));
|
|
64
68
|
}
|
|
@@ -528,6 +532,9 @@ export class GovFormSelect {
|
|
|
528
532
|
}, {
|
|
529
533
|
"propName": "size",
|
|
530
534
|
"methodName": "watchDisabled"
|
|
535
|
+
}, {
|
|
536
|
+
"propName": "value",
|
|
537
|
+
"methodName": "watchValue"
|
|
531
538
|
}];
|
|
532
539
|
}
|
|
533
540
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/select/gov-form-select.tsx"],"names":[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,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACjE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;EAClG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport {\n\tFormSelectClass,\n\tFormSelectSizes,\n\tFormSelectSizesType,\n\tFormSelectVariants,\n\tFormSelectVariantType,\n} from \"./constants\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { FormSelectEvent } from \"./gov-form-select.types\"\n\n@Component({\n\ttag: \"gov-form-select\",\n\tstyleUrl: \"gov-form-select.scss\",\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID(\"GovSelect\")\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = \"m\"\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a related component’s visually focused element.\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"select\")\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.host.querySelectorAll(\"option\").forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute(\"selected\", \"true\")\n\t\t\t}\n\t\t})\n\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t{this.h.hasSlot(\"prefix\") && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<gov-icon slot=\"right-icon\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</select>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagActiveDescendant, \"wcag-active-descendant\", FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, \"wcag-controls\", FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/select/gov-form-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE5G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACxF,OAAO,EACN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AAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;EAClG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport {\n\tFormSelectClass,\n\tFormSelectSizes,\n\tFormSelectSizesType,\n\tFormSelectVariants,\n\tFormSelectVariantType,\n} from \"./constants\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { FormSelectEvent } from \"./gov-form-select.types\"\n\n@Component({\n\ttag: \"gov-form-select\",\n\tstyleUrl: \"gov-form-select.scss\",\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID(\"GovSelect\")\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = \"m\"\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a related component’s visually focused element.\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch(\"value\")\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"select\")\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll(\"option\").forEach((option: HTMLOptionElement) => {\n\t\t\toption.setAttribute(\"selected\", toBoolAttr(option.value === this.value))\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t{this.h.hasSlot(\"prefix\") && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<gov-icon slot=\"right-icon\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</select>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagActiveDescendant, \"wcag-active-descendant\", FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, \"wcag-controls\", FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"]}
|
|
@@ -14,7 +14,7 @@ export class GovPagination {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
this.type = "button";
|
|
16
16
|
this.current = 1;
|
|
17
|
-
this.total =
|
|
17
|
+
this.total = 0;
|
|
18
18
|
this.inverse = undefined;
|
|
19
19
|
this.size = "m";
|
|
20
20
|
this.variant = "primary";
|
|
@@ -38,6 +38,9 @@ export class GovPagination {
|
|
|
38
38
|
validateVariant(newValue) {
|
|
39
39
|
validateProp(PaginationVariants, newValue, PaginationClass.root);
|
|
40
40
|
}
|
|
41
|
+
recalculate() {
|
|
42
|
+
this.recalculatePagination(this.current);
|
|
43
|
+
}
|
|
41
44
|
componentWillLoad() {
|
|
42
45
|
this.recalculatePagination(this.current);
|
|
43
46
|
this.validateSize(this.size);
|
|
@@ -80,7 +83,7 @@ export class GovPagination {
|
|
|
80
83
|
const ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined);
|
|
81
84
|
return (h("gov-button", { href: this.prepareLinkUrl(page), variant: this.variant, size: this.size, type: "base", disabled: isDisabled, "on-gov-click": (e) => this.onClickHandler(e, page), "wcag-label": page > -1 ? this.wcagPageLabel + " " + page : undefined, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
82
85
|
};
|
|
83
|
-
return (h(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("ul", { class: PaginationClass.list }, h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }))), this.type == "select" ? (h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", variant: this.variant, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (h(Fragment, null, this.pagination.pages.map(page => (h("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page)))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", variant: this.variant, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, h("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: false }, page)))))))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" })))))));
|
|
86
|
+
return (h(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("ul", { class: PaginationClass.list }, h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }))), this.type == "select" ? (h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", variant: this.variant, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (h(Fragment, null, this.pagination.pages.map(page => (h("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page)))), this.pagination.totalPages ? (h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", variant: this.variant, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, h("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: false }, page))))))) : null)), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" })))))));
|
|
84
87
|
}
|
|
85
88
|
onClickHandler(e, page) {
|
|
86
89
|
e.stopPropagation();
|
|
@@ -184,7 +187,8 @@ export class GovPagination {
|
|
|
184
187
|
"text": "Total count of entries"
|
|
185
188
|
},
|
|
186
189
|
"attribute": "total",
|
|
187
|
-
"reflect": false
|
|
190
|
+
"reflect": false,
|
|
191
|
+
"defaultValue": "0"
|
|
188
192
|
},
|
|
189
193
|
"inverse": {
|
|
190
194
|
"type": "boolean",
|
|
@@ -433,6 +437,18 @@ export class GovPagination {
|
|
|
433
437
|
}, {
|
|
434
438
|
"propName": "variant",
|
|
435
439
|
"methodName": "validateVariant"
|
|
440
|
+
}, {
|
|
441
|
+
"propName": "current",
|
|
442
|
+
"methodName": "recalculate"
|
|
443
|
+
}, {
|
|
444
|
+
"propName": "total",
|
|
445
|
+
"methodName": "recalculate"
|
|
446
|
+
}, {
|
|
447
|
+
"propName": "pageSize",
|
|
448
|
+
"methodName": "recalculate"
|
|
449
|
+
}, {
|
|
450
|
+
"propName": "maxPages",
|
|
451
|
+
"methodName": "recalculate"
|
|
436
452
|
}];
|
|
437
453
|
}
|
|
438
454
|
}
|