@sebgroup/green-core 3.25.2 → 3.26.0
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/components/checkbox/checkbox-group/checkbox-group.component.js +4 -2
- package/components/checkbox/checkbox.component.js +11 -0
- package/components/datepicker/date-part-spinner.d.ts +4 -0
- package/components/datepicker/date-part-spinner.js +6 -0
- package/components/datepicker/datepicker.component.d.ts +1 -0
- package/components/datepicker/datepicker.component.js +92 -57
- package/components/datepicker/datepicker.styles.js +4 -0
- package/components/dropdown/dropdown.component.js +13 -1
- package/components/dropdown/option.component.js +1 -0
- package/components/filter-chips/filter-chips.component.js +1 -0
- package/components/form/form-control.d.ts +5 -0
- package/components/form/form-control.js +7 -0
- package/components/input/input.component.js +7 -2
- package/components/radio/radio-group/radio-group.component.js +8 -2
- package/components/radio/radio.component.d.ts +9 -0
- package/components/radio/radio.component.js +9 -3
- package/components/select/select.component.js +40 -13
- package/components/select/select.styles.js +4 -0
- package/components/switch/switch.component.js +22 -4
- package/components/switch/switch.styles.js +34 -0
- package/components/table/table.component.js +2 -1
- package/components/textarea/textarea.component.js +6 -1
- package/custom-elements.json +21811 -21306
- package/gds-element.js +1 -1
- package/generated/mcp/button/api.md +1 -0
- package/generated/mcp/checkbox/api.md +1 -0
- package/generated/mcp/checkbox-group/api.md +1 -0
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/datepicker/api.md +1 -0
- package/generated/mcp/dropdown/api.md +1 -0
- package/generated/mcp/fab/api.md +1 -0
- package/generated/mcp/filter-chips/api.md +1 -0
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/input/api.md +1 -0
- package/generated/mcp/radio/api.md +1 -0
- package/generated/mcp/radio-group/api.md +1 -0
- package/generated/mcp/switch/api.md +1 -0
- package/generated/mcp/textarea/api.md +1 -0
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/alert/index.d.ts +2 -2
- package/generated/react/avatar/index.d.ts +2 -2
- package/generated/react/avatar-group/index.d.ts +2 -2
- package/generated/react/backdrop/index.d.ts +2 -2
- package/generated/react/badge/index.d.ts +2 -2
- package/generated/react/blur/index.d.ts +2 -2
- package/generated/react/breadcrumb/index.d.ts +2 -2
- package/generated/react/breadcrumbs/index.d.ts +2 -2
- package/generated/react/button/index.d.ts +3 -2
- package/generated/react/calendar/index.d.ts +2 -2
- package/generated/react/card/index.d.ts +2 -2
- package/generated/react/card-linked/index.d.ts +2 -2
- package/generated/react/card-pattern-01/index.d.ts +2 -2
- package/generated/react/checkbox/index.d.ts +3 -2
- package/generated/react/checkbox-group/index.d.ts +3 -2
- package/generated/react/coachmark/index.d.ts +2 -2
- package/generated/react/context-menu/index.d.ts +2 -2
- package/generated/react/datepicker/index.d.ts +3 -2
- package/generated/react/details/index.d.ts +2 -2
- package/generated/react/dialog/index.d.ts +2 -2
- package/generated/react/div/index.d.ts +2 -2
- package/generated/react/divider/index.d.ts +2 -2
- package/generated/react/dropdown/index.d.ts +3 -2
- package/generated/react/fab/index.d.ts +3 -2
- package/generated/react/filter-chip/index.d.ts +2 -2
- package/generated/react/filter-chips/index.d.ts +3 -2
- package/generated/react/flex/index.d.ts +2 -2
- package/generated/react/form-summary/index.d.ts +2 -2
- package/generated/react/formatted-account/index.d.ts +2 -2
- package/generated/react/formatted-date/index.d.ts +2 -2
- package/generated/react/formatted-number/index.d.ts +2 -2
- package/generated/react/grid/index.d.ts +2 -2
- package/generated/react/grouped-list/index.d.ts +2 -2
- package/generated/react/icons/icon-ai/index.d.ts +2 -2
- package/generated/react/icons/icon-airplane-up/index.d.ts +2 -2
- package/generated/react/icons/icon-archive/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-bottom-top/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-box-left/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-box-left-alt/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-box-right/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-down/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-inbox/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-left/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-left-right/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-out-of-box/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-right/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-right-circle/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-right-down-circle/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-right-up-circle/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-rotate-clockwise/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-rotate-counter-clockwise/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-rotate-left-right/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-rotate-right-left/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-share-left/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-share-right/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-split/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-up/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-wall-down/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-wall-left/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-wall-right/index.d.ts +2 -2
- package/generated/react/icons/icon-arrow-wall-up/index.d.ts +2 -2
- package/generated/react/icons/icon-arrows-repeat-right/index.d.ts +2 -2
- package/generated/react/icons/icon-asterisk/index.d.ts +2 -2
- package/generated/react/icons/icon-at/index.d.ts +2 -2
- package/generated/react/icons/icon-back/index.d.ts +2 -2
- package/generated/react/icons/icon-backward/index.d.ts +2 -2
- package/generated/react/icons/icon-bag/index.d.ts +2 -2
- package/generated/react/icons/icon-bank/index.d.ts +2 -2
- package/generated/react/icons/icon-banknote/index.d.ts +2 -2
- package/generated/react/icons/icon-banknote-2/index.d.ts +2 -2
- package/generated/react/icons/icon-barcode/index.d.ts +2 -2
- package/generated/react/icons/icon-bars-three/index.d.ts +2 -2
- package/generated/react/icons/icon-bars-two/index.d.ts +2 -2
- package/generated/react/icons/icon-basket/index.d.ts +2 -2
- package/generated/react/icons/icon-battery-loading/index.d.ts +2 -2
- package/generated/react/icons/icon-bell/index.d.ts +2 -2
- package/generated/react/icons/icon-block/index.d.ts +2 -2
- package/generated/react/icons/icon-book/index.d.ts +2 -2
- package/generated/react/icons/icon-bookmark/index.d.ts +2 -2
- package/generated/react/icons/icon-bookmark-check/index.d.ts +2 -2
- package/generated/react/icons/icon-bookmark-delete/index.d.ts +2 -2
- package/generated/react/icons/icon-bookmark-plus/index.d.ts +2 -2
- package/generated/react/icons/icon-bookmark-remove/index.d.ts +2 -2
- package/generated/react/icons/icon-books/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-app-store/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-apple-music/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-bankid/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-chrome/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-facebook/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-figma/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-firefox/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-github/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-green/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-instagram/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-linkedin/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-play-store/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-rss-feed/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-seb/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-spotify/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-storybook/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-swish-word/index.d.ts +2 -2
- package/generated/react/icons/icon-brand-x/index.d.ts +2 -2
- package/generated/react/icons/icon-brush/index.d.ts +2 -2
- package/generated/react/icons/icon-bubble-annotation/index.d.ts +2 -2
- package/generated/react/icons/icon-bubbles/index.d.ts +2 -2
- package/generated/react/icons/icon-buildings/index.d.ts +2 -2
- package/generated/react/icons/icon-bullet-list/index.d.ts +2 -2
- package/generated/react/icons/icon-calculator/index.d.ts +2 -2
- package/generated/react/icons/icon-calendar/index.d.ts +2 -2
- package/generated/react/icons/icon-calendar-check/index.d.ts +2 -2
- package/generated/react/icons/icon-calendar-repeat/index.d.ts +2 -2
- package/generated/react/icons/icon-calender-add/index.d.ts +2 -2
- package/generated/react/icons/icon-call/index.d.ts +2 -2
- package/generated/react/icons/icon-car/index.d.ts +2 -2
- package/generated/react/icons/icon-carussel/index.d.ts +2 -2
- package/generated/react/icons/icon-chain-link/index.d.ts +2 -2
- package/generated/react/icons/icon-chain-link-broken/index.d.ts +2 -2
- package/generated/react/icons/icon-chart-two/index.d.ts +2 -2
- package/generated/react/icons/icon-checklist/index.d.ts +2 -2
- package/generated/react/icons/icon-checkmark/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-bottom/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-double-down/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-double-left/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-double-right/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-double-up/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-down-small/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-grabber-vertical/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-grabber-vertical-reversed/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-left/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-left-small/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-right/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-right-small/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-top/index.d.ts +2 -2
- package/generated/react/icons/icon-chevron-top-small/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-ban/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-check/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-dots/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-info/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-minus/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-placeholder-on/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-plus/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-questionmark/index.d.ts +2 -2
- package/generated/react/icons/icon-circle-x/index.d.ts +2 -2
- package/generated/react/icons/icon-circles-three/index.d.ts +2 -2
- package/generated/react/icons/icon-clock/index.d.ts +2 -2
- package/generated/react/icons/icon-cloud-download/index.d.ts +2 -2
- package/generated/react/icons/icon-cloud-upload/index.d.ts +2 -2
- package/generated/react/icons/icon-cloudy-sun/index.d.ts +2 -2
- package/generated/react/icons/icon-code/index.d.ts +2 -2
- package/generated/react/icons/icon-code-brackets/index.d.ts +2 -2
- package/generated/react/icons/icon-compass-round/index.d.ts +2 -2
- package/generated/react/icons/icon-cookies/index.d.ts +2 -2
- package/generated/react/icons/icon-copy/index.d.ts +2 -2
- package/generated/react/icons/icon-credit-card/index.d.ts +2 -2
- package/generated/react/icons/icon-credit-card-add/index.d.ts +2 -2
- package/generated/react/icons/icon-cross-large/index.d.ts +2 -2
- package/generated/react/icons/icon-cross-small/index.d.ts +2 -2
- package/generated/react/icons/icon-cup-hot/index.d.ts +2 -2
- package/generated/react/icons/icon-cursor/index.d.ts +2 -2
- package/generated/react/icons/icon-details/index.d.ts +2 -2
- package/generated/react/icons/icon-devices/index.d.ts +2 -2
- package/generated/react/icons/icon-direction/index.d.ts +2 -2
- package/generated/react/icons/icon-dollar/index.d.ts +2 -2
- package/generated/react/icons/icon-dot-grid-one-horizontal/index.d.ts +2 -2
- package/generated/react/icons/icon-dot-grid-one-vertical/index.d.ts +2 -2
- package/generated/react/icons/icon-dot-grid-three/index.d.ts +2 -2
- package/generated/react/icons/icon-dot-grid-two/index.d.ts +2 -2
- package/generated/react/icons/icon-email/index.d.ts +2 -2
- package/generated/react/icons/icon-emoji-angry/index.d.ts +2 -2
- package/generated/react/icons/icon-emoji-neutral/index.d.ts +2 -2
- package/generated/react/icons/icon-emoji-sad/index.d.ts +2 -2
- package/generated/react/icons/icon-emoji-smile/index.d.ts +2 -2
- package/generated/react/icons/icon-emoji-smiley/index.d.ts +2 -2
- package/generated/react/icons/icon-euro/index.d.ts +2 -2
- package/generated/react/icons/icon-expand/index.d.ts +2 -2
- package/generated/react/icons/icon-eye-open/index.d.ts +2 -2
- package/generated/react/icons/icon-eye-slash/index.d.ts +2 -2
- package/generated/react/icons/icon-fashion/index.d.ts +2 -2
- package/generated/react/icons/icon-fast-forward/index.d.ts +2 -2
- package/generated/react/icons/icon-file-bend/index.d.ts +2 -2
- package/generated/react/icons/icon-file-chart/index.d.ts +2 -2
- package/generated/react/icons/icon-file-text/index.d.ts +2 -2
- package/generated/react/icons/icon-files/index.d.ts +2 -2
- package/generated/react/icons/icon-filter/index.d.ts +2 -2
- package/generated/react/icons/icon-flag/index.d.ts +2 -2
- package/generated/react/icons/icon-floppy-disk/index.d.ts +2 -2
- package/generated/react/icons/icon-focus/index.d.ts +2 -2
- package/generated/react/icons/icon-folder/index.d.ts +2 -2
- package/generated/react/icons/icon-folder-add-right/index.d.ts +2 -2
- package/generated/react/icons/icon-fullscreen/index.d.ts +2 -2
- package/generated/react/icons/icon-gift/index.d.ts +2 -2
- package/generated/react/icons/icon-globus/index.d.ts +2 -2
- package/generated/react/icons/icon-graduate-cap/index.d.ts +2 -2
- package/generated/react/icons/icon-green-power/index.d.ts +2 -2
- package/generated/react/icons/icon-group/index.d.ts +2 -2
- package/generated/react/icons/icon-growth/index.d.ts +2 -2
- package/generated/react/icons/icon-headphones/index.d.ts +2 -2
- package/generated/react/icons/icon-heart/index.d.ts +2 -2
- package/generated/react/icons/icon-heart-beat/index.d.ts +2 -2
- package/generated/react/icons/icon-history/index.d.ts +2 -2
- package/generated/react/icons/icon-home-energy-one/index.d.ts +2 -2
- package/generated/react/icons/icon-home-energy-two/index.d.ts +2 -2
- package/generated/react/icons/icon-home-open/index.d.ts +2 -2
- package/generated/react/icons/icon-home-roof/index.d.ts +2 -2
- package/generated/react/icons/icon-horizontal-alignment-bottom/index.d.ts +2 -2
- package/generated/react/icons/icon-hourglass/index.d.ts +2 -2
- package/generated/react/icons/icon-images/index.d.ts +2 -2
- package/generated/react/icons/icon-inbox-empty/index.d.ts +2 -2
- package/generated/react/icons/icon-industry/index.d.ts +2 -2
- package/generated/react/icons/icon-jpg/index.d.ts +2 -2
- package/generated/react/icons/icon-key/index.d.ts +2 -2
- package/generated/react/icons/icon-knife-spoon/index.d.ts +2 -2
- package/generated/react/icons/icon-lab/index.d.ts +2 -2
- package/generated/react/icons/icon-law/index.d.ts +2 -2
- package/generated/react/icons/icon-leisure/index.d.ts +2 -2
- package/generated/react/icons/icon-light-bulb-simple/index.d.ts +2 -2
- package/generated/react/icons/icon-lightning/index.d.ts +2 -2
- package/generated/react/icons/icon-line-chart-four/index.d.ts +2 -2
- package/generated/react/icons/icon-line-chart-one/index.d.ts +2 -2
- package/generated/react/icons/icon-line-chart-three/index.d.ts +2 -2
- package/generated/react/icons/icon-line-chart-two/index.d.ts +2 -2
- package/generated/react/icons/icon-lock/index.d.ts +2 -2
- package/generated/react/icons/icon-macbook-air/index.d.ts +2 -2
- package/generated/react/icons/icon-magnifying-glass/index.d.ts +2 -2
- package/generated/react/icons/icon-map-pin/index.d.ts +2 -2
- package/generated/react/icons/icon-megaphone/index.d.ts +2 -2
- package/generated/react/icons/icon-menu-sidebar/index.d.ts +2 -2
- package/generated/react/icons/icon-mic-off/index.d.ts +2 -2
- package/generated/react/icons/icon-mic-on/index.d.ts +2 -2
- package/generated/react/icons/icon-minimize/index.d.ts +2 -2
- package/generated/react/icons/icon-minus-large/index.d.ts +2 -2
- package/generated/react/icons/icon-minus-small/index.d.ts +2 -2
- package/generated/react/icons/icon-money-hand/index.d.ts +2 -2
- package/generated/react/icons/icon-moneybag/index.d.ts +2 -2
- package/generated/react/icons/icon-moon/index.d.ts +2 -2
- package/generated/react/icons/icon-mute/index.d.ts +2 -2
- package/generated/react/icons/icon-newspaper/index.d.ts +2 -2
- package/generated/react/icons/icon-office/index.d.ts +2 -2
- package/generated/react/icons/icon-page-add/index.d.ts +2 -2
- package/generated/react/icons/icon-paper-plane-top-right/index.d.ts +2 -2
- package/generated/react/icons/icon-paperclip/index.d.ts +2 -2
- package/generated/react/icons/icon-pause/index.d.ts +2 -2
- package/generated/react/icons/icon-pdf/index.d.ts +2 -2
- package/generated/react/icons/icon-pencil-sign/index.d.ts +2 -2
- package/generated/react/icons/icon-pencil-sparkle/index.d.ts +2 -2
- package/generated/react/icons/icon-pencil-wave/index.d.ts +2 -2
- package/generated/react/icons/icon-pension/index.d.ts +2 -2
- package/generated/react/icons/icon-people/index.d.ts +2 -2
- package/generated/react/icons/icon-people-a11y/index.d.ts +2 -2
- package/generated/react/icons/icon-people-add/index.d.ts +2 -2
- package/generated/react/icons/icon-people-added/index.d.ts +2 -2
- package/generated/react/icons/icon-people-circle/index.d.ts +2 -2
- package/generated/react/icons/icon-people-copy/index.d.ts +2 -2
- package/generated/react/icons/icon-people-profile/index.d.ts +2 -2
- package/generated/react/icons/icon-people-remove/index.d.ts +2 -2
- package/generated/react/icons/icon-percent/index.d.ts +2 -2
- package/generated/react/icons/icon-phone/index.d.ts +2 -2
- package/generated/react/icons/icon-pie-chart/index.d.ts +2 -2
- package/generated/react/icons/icon-piggy-bank/index.d.ts +2 -2
- package/generated/react/icons/icon-pin/index.d.ts +2 -2
- package/generated/react/icons/icon-pinch/index.d.ts +2 -2
- package/generated/react/icons/icon-play/index.d.ts +2 -2
- package/generated/react/icons/icon-play-circle/index.d.ts +2 -2
- package/generated/react/icons/icon-plus-large/index.d.ts +2 -2
- package/generated/react/icons/icon-plus-small/index.d.ts +2 -2
- package/generated/react/icons/icon-png/index.d.ts +2 -2
- package/generated/react/icons/icon-poop/index.d.ts +2 -2
- package/generated/react/icons/icon-postcard/index.d.ts +2 -2
- package/generated/react/icons/icon-pound/index.d.ts +2 -2
- package/generated/react/icons/icon-power/index.d.ts +2 -2
- package/generated/react/icons/icon-power-plant/index.d.ts +2 -2
- package/generated/react/icons/icon-printer/index.d.ts +2 -2
- package/generated/react/icons/icon-push/index.d.ts +2 -2
- package/generated/react/icons/icon-qr-code/index.d.ts +2 -2
- package/generated/react/icons/icon-rainy/index.d.ts +2 -2
- package/generated/react/icons/icon-raising-hand/index.d.ts +2 -2
- package/generated/react/icons/icon-reading-list/index.d.ts +2 -2
- package/generated/react/icons/icon-receipt-bill/index.d.ts +2 -2
- package/generated/react/icons/icon-receiption-bell/index.d.ts +2 -2
- package/generated/react/icons/icon-record/index.d.ts +2 -2
- package/generated/react/icons/icon-refund/index.d.ts +2 -2
- package/generated/react/icons/icon-robot/index.d.ts +2 -2
- package/generated/react/icons/icon-rocket/index.d.ts +2 -2
- package/generated/react/icons/icon-run-shortcut/index.d.ts +2 -2
- package/generated/react/icons/icon-safari/index.d.ts +2 -2
- package/generated/react/icons/icon-satellite/index.d.ts +2 -2
- package/generated/react/icons/icon-school/index.d.ts +2 -2
- package/generated/react/icons/icon-scissors/index.d.ts +2 -2
- package/generated/react/icons/icon-search-menu/index.d.ts +2 -2
- package/generated/react/icons/icon-settings-gear/index.d.ts +2 -2
- package/generated/react/icons/icon-settings-slider-hor/index.d.ts +2 -2
- package/generated/react/icons/icon-settings-slider-ver/index.d.ts +2 -2
- package/generated/react/icons/icon-shapes/index.d.ts +2 -2
- package/generated/react/icons/icon-share/index.d.ts +2 -2
- package/generated/react/icons/icon-shield/index.d.ts +2 -2
- package/generated/react/icons/icon-shield-checked/index.d.ts +2 -2
- package/generated/react/icons/icon-shield-crossed/index.d.ts +2 -2
- package/generated/react/icons/icon-shopping-bag/index.d.ts +2 -2
- package/generated/react/icons/icon-signature/index.d.ts +2 -2
- package/generated/react/icons/icon-smartwatch/index.d.ts +2 -2
- package/generated/react/icons/icon-solar/index.d.ts +2 -2
- package/generated/react/icons/icon-sort/index.d.ts +2 -2
- package/generated/react/icons/icon-sort-ascending/index.d.ts +2 -2
- package/generated/react/icons/icon-sort-descending/index.d.ts +2 -2
- package/generated/react/icons/icon-sort-down/index.d.ts +2 -2
- package/generated/react/icons/icon-sort-up/index.d.ts +2 -2
- package/generated/react/icons/icon-square-arrow-top-right/index.d.ts +2 -2
- package/generated/react/icons/icon-square-behind-square/index.d.ts +2 -2
- package/generated/react/icons/icon-square-grid-circle/index.d.ts +2 -2
- package/generated/react/icons/icon-square-placeholder/index.d.ts +2 -2
- package/generated/react/icons/icon-star/index.d.ts +2 -2
- package/generated/react/icons/icon-store/index.d.ts +2 -2
- package/generated/react/icons/icon-sun/index.d.ts +2 -2
- package/generated/react/icons/icon-sunset-arrow-down/index.d.ts +2 -2
- package/generated/react/icons/icon-tag/index.d.ts +2 -2
- package/generated/react/icons/icon-target-arrow/index.d.ts +2 -2
- package/generated/react/icons/icon-television/index.d.ts +2 -2
- package/generated/react/icons/icon-tennis/index.d.ts +2 -2
- package/generated/react/icons/icon-text-edit/index.d.ts +2 -2
- package/generated/react/icons/icon-thermostat/index.d.ts +2 -2
- package/generated/react/icons/icon-thumbs-down/index.d.ts +2 -2
- package/generated/react/icons/icon-thumbs-up/index.d.ts +2 -2
- package/generated/react/icons/icon-ticket/index.d.ts +2 -2
- package/generated/react/icons/icon-trading-view-candles/index.d.ts +2 -2
- package/generated/react/icons/icon-trash-can/index.d.ts +2 -2
- package/generated/react/icons/icon-tree/index.d.ts +2 -2
- package/generated/react/icons/icon-trending-five/index.d.ts +2 -2
- package/generated/react/icons/icon-trending-four/index.d.ts +2 -2
- package/generated/react/icons/icon-trending-one/index.d.ts +2 -2
- package/generated/react/icons/icon-trending-three/index.d.ts +2 -2
- package/generated/react/icons/icon-trending-two/index.d.ts +2 -2
- package/generated/react/icons/icon-triangle-exclamation/index.d.ts +2 -2
- package/generated/react/icons/icon-truck/index.d.ts +2 -2
- package/generated/react/icons/icon-umbrella-security/index.d.ts +2 -2
- package/generated/react/icons/icon-unlocked/index.d.ts +2 -2
- package/generated/react/icons/icon-volume-full/index.d.ts +2 -2
- package/generated/react/icons/icon-volume-half/index.d.ts +2 -2
- package/generated/react/icons/icon-volume-off/index.d.ts +2 -2
- package/generated/react/icons/icon-wallet/index.d.ts +2 -2
- package/generated/react/icons/icon-warning-sign/index.d.ts +2 -2
- package/generated/react/icons/icon-wifi-full/index.d.ts +2 -2
- package/generated/react/icons/icon-youtube/index.d.ts +2 -2
- package/generated/react/icons/icon-zap/index.d.ts +2 -2
- package/generated/react/icons/icon-zoom-in/index.d.ts +2 -2
- package/generated/react/icons/icon-zoom-out/index.d.ts +2 -2
- package/generated/react/img/index.d.ts +2 -2
- package/generated/react/index.d.ts +3 -3
- package/generated/react/index.js +3 -3
- package/generated/react/input/index.d.ts +3 -2
- package/generated/react/link/index.d.ts +2 -2
- package/generated/react/list/index.d.ts +2 -2
- package/generated/react/list-item/index.d.ts +2 -2
- package/generated/react/list-item-pattern-01/index.d.ts +2 -2
- package/generated/react/mask/index.d.ts +2 -2
- package/generated/react/menu-button/index.d.ts +2 -2
- package/generated/react/menu-heading/index.d.ts +2 -2
- package/generated/react/menu-item/index.d.ts +2 -2
- package/generated/react/option/index.d.ts +2 -2
- package/generated/react/pagination/index.d.ts +2 -2
- package/generated/react/popover/index.d.ts +2 -2
- package/generated/react/radio/index.d.ts +3 -2
- package/generated/react/radio-group/index.d.ts +3 -2
- package/generated/react/rich-text/index.d.ts +2 -2
- package/generated/react/segment/index.d.ts +2 -2
- package/generated/react/segmented-control/index.d.ts +2 -2
- package/generated/react/select/index.d.ts +3 -2
- package/generated/react/sensitive-account/index.d.ts +2 -2
- package/generated/react/sensitive-date/index.d.ts +2 -2
- package/generated/react/sensitive-number/index.d.ts +2 -2
- package/generated/react/signal/index.d.ts +2 -2
- package/generated/react/slider/index.d.ts +2 -2
- package/generated/react/spinner/index.d.ts +2 -2
- package/generated/react/switch/index.d.ts +3 -2
- package/generated/react/tab/index.d.ts +2 -2
- package/generated/react/tab-panel/index.d.ts +2 -2
- package/generated/react/table/index.d.ts +2 -2
- package/generated/react/tabs/index.d.ts +2 -2
- package/generated/react/text/index.d.ts +2 -2
- package/generated/react/textarea/index.d.ts +3 -2
- package/generated/react/theme/index.d.ts +2 -2
- package/generated/react/video/index.d.ts +2 -2
- package/package.json +1 -1
- package/patterns/list-item-pattern-01/list-item-pattern-01.component.js +1 -0
- package/primitives/field-base/field-base.component.d.ts +4 -0
- package/primitives/field-base/field-base.component.js +40 -8
- package/primitives/field-base/field-base.styles.js +6 -1
- package/primitives/field-base/field-base.trans.styles.scss.js +1 -1
- package/shared-styles/rbcb-toggle.style.js +25 -3
- package/shared-styles/rbcb-toggle.template.d.ts +1 -0
- package/shared-styles/rbcb-toggle.template.js +2 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -11,8 +11,8 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
11
11
|
import { GdsFormControlFooter } from "../../../primitives/form-control-footer/form-control-footer.component.js";
|
|
12
12
|
import { GdsFormControlHeader } from "../../../primitives/form-control-header/form-control-header.component.js";
|
|
13
13
|
import { gdsCustomElement, html } from "../../../scoping.js";
|
|
14
|
-
import { ariaForwarding } from "../../../utils/decorators/aria-forwarding.js";
|
|
15
14
|
import { observeLightDOM } from "../../../utils/decorators/index.js";
|
|
15
|
+
import { ariaForwarding } from "../../../utils/decorators/aria-forwarding.js";
|
|
16
16
|
import { watch } from "../../../utils/decorators/watch.js";
|
|
17
17
|
import {
|
|
18
18
|
withLayoutChildProps,
|
|
@@ -34,6 +34,7 @@ let CheckboxGroup = class extends GdsFormControlElement {
|
|
|
34
34
|
this.checkboxes.forEach((checkbox) => {
|
|
35
35
|
checkbox.invalid = this.invalid;
|
|
36
36
|
checkbox.errorMessage = this.errorMessage;
|
|
37
|
+
checkbox.readonly = this.readonly || checkbox.readonly;
|
|
37
38
|
});
|
|
38
39
|
});
|
|
39
40
|
}
|
|
@@ -187,7 +188,8 @@ __decorateClass([
|
|
|
187
188
|
], CheckboxGroup.prototype, "_handleValueChange", 1);
|
|
188
189
|
__decorateClass([
|
|
189
190
|
watch("invalid"),
|
|
190
|
-
watch("errorMessage")
|
|
191
|
+
watch("errorMessage"),
|
|
192
|
+
watch("readonly")
|
|
191
193
|
], CheckboxGroup.prototype, "_handleGroupInvalidChange", 1);
|
|
192
194
|
__decorateClass([
|
|
193
195
|
observeLightDOM({
|
|
@@ -28,6 +28,11 @@ let GdsCheckbox = class extends GdsFormControlElement {
|
|
|
28
28
|
this.indeterminate = false;
|
|
29
29
|
this.disabled = false;
|
|
30
30
|
__privateAdd(this, _handleInputChange, () => {
|
|
31
|
+
if (this.readonly) {
|
|
32
|
+
this._elCheckbox.checked = this.checked;
|
|
33
|
+
this._elCheckbox.indeterminate = this.indeterminate;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
31
36
|
if (this.indeterminate) {
|
|
32
37
|
this.indeterminate = false;
|
|
33
38
|
this.checked = false;
|
|
@@ -62,6 +67,7 @@ let GdsCheckbox = class extends GdsFormControlElement {
|
|
|
62
67
|
?disabled=${this.disabled}
|
|
63
68
|
.indeterminate=${this.indeterminate}
|
|
64
69
|
aria-invalid=${this.invalid}
|
|
70
|
+
aria-readonly=${this.readonly}
|
|
65
71
|
aria-describedby="message supporting-text"
|
|
66
72
|
id="checkbox-input"
|
|
67
73
|
@change=${__privateGet(this, _handleInputChange)}
|
|
@@ -83,6 +89,7 @@ let GdsCheckbox = class extends GdsFormControlElement {
|
|
|
83
89
|
checked: this.checked,
|
|
84
90
|
indeterminate: this.indeterminate,
|
|
85
91
|
disabled: this.disabled,
|
|
92
|
+
readonly: this.readonly,
|
|
86
93
|
invalid: this.invalid
|
|
87
94
|
})}
|
|
88
95
|
</gds-toggle-control-base>
|
|
@@ -99,6 +106,10 @@ let GdsCheckbox = class extends GdsFormControlElement {
|
|
|
99
106
|
_GdsCheckbox_instances = new WeakSet();
|
|
100
107
|
toggleChecked_fn = function(e) {
|
|
101
108
|
if (this.disabled || e.target instanceof HTMLLabelElement) return;
|
|
109
|
+
if (this.readonly) {
|
|
110
|
+
this._elCheckbox.focus();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
102
113
|
if (this.indeterminate) {
|
|
103
114
|
this.indeterminate = false;
|
|
104
115
|
} else {
|
|
@@ -12,6 +12,10 @@ export declare class GdsDatePartSpinner extends GdsElement {
|
|
|
12
12
|
length: number;
|
|
13
13
|
min: number;
|
|
14
14
|
max: number;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the spinner is read-only. Keeps it focusable but blocks value changes.
|
|
17
|
+
*/
|
|
18
|
+
readonly: boolean;
|
|
15
19
|
displayValue: string;
|
|
16
20
|
protected createRenderRoot(): this;
|
|
17
21
|
connectedCallback(): void;
|
|
@@ -18,6 +18,7 @@ let GdsDatePartSpinner = class extends GdsElement {
|
|
|
18
18
|
this.length = 2;
|
|
19
19
|
this.min = 0;
|
|
20
20
|
this.max = Number.MAX_SAFE_INTEGER;
|
|
21
|
+
this.readonly = false;
|
|
21
22
|
this.displayValue = __privateMethod(this, _GdsDatePartSpinner_instances, formatNumber_fn).call(this, this.value, this.length);
|
|
22
23
|
__privateAdd(this, _inputBuffer, "");
|
|
23
24
|
__privateAdd(this, _increment, () => {
|
|
@@ -51,6 +52,7 @@ let GdsDatePartSpinner = class extends GdsElement {
|
|
|
51
52
|
__privateAdd(this, _handleWheel, (e) => {
|
|
52
53
|
e.stopPropagation();
|
|
53
54
|
e.preventDefault();
|
|
55
|
+
if (this.readonly) return;
|
|
54
56
|
if (e.deltaY > 0) {
|
|
55
57
|
__privateGet(this, _decrement).call(this);
|
|
56
58
|
} else {
|
|
@@ -58,6 +60,7 @@ let GdsDatePartSpinner = class extends GdsElement {
|
|
|
58
60
|
}
|
|
59
61
|
});
|
|
60
62
|
__privateAdd(this, _handleKeyDown, (e) => {
|
|
63
|
+
if (this.readonly) return;
|
|
61
64
|
let handled = false;
|
|
62
65
|
if (e.key === "ArrowUp") {
|
|
63
66
|
__privateGet(this, _increment).call(this);
|
|
@@ -160,6 +163,9 @@ __decorateClass([
|
|
|
160
163
|
__decorateClass([
|
|
161
164
|
property({ type: Number, attribute: "aria-valuemax" })
|
|
162
165
|
], GdsDatePartSpinner.prototype, "max", 2);
|
|
166
|
+
__decorateClass([
|
|
167
|
+
property({ type: Boolean, reflect: true })
|
|
168
|
+
], GdsDatePartSpinner.prototype, "readonly", 2);
|
|
163
169
|
__decorateClass([
|
|
164
170
|
state()
|
|
165
171
|
], GdsDatePartSpinner.prototype, "displayValue", 2);
|
|
@@ -137,6 +137,7 @@ declare class Datepicker extends GdsFormControlElement<Date> {
|
|
|
137
137
|
private _elFieldAsync;
|
|
138
138
|
private _elSpinners;
|
|
139
139
|
private _elField;
|
|
140
|
+
private _elReadonlyValue?;
|
|
140
141
|
constructor();
|
|
141
142
|
connectedCallback(): void;
|
|
142
143
|
focus(options?: FocusOptions): void;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.H2T4A5YY.js";
|
|
8
|
-
var _utcHours, _focusedMonthOverride, _focusedYearOverride, _Datepicker_instances, defaultFocusedDate_get, _valueOnOpen, shouldShowFooter_fn, renderBackToValidRangeButton_fn, updateOutOfRangeAction_fn, normalizeDate_fn, focusDate_fn, isDateSelectable_fn, nearestSelectableDate_fn, shouldShowTodayButton_fn, getSpinnerLabel_fn, getMinSpinnerValue_fn, getMaxSpinnerValue_fn, getLocalizedPlaceholder_fn, getSpinnerValue_fn, dispatchChangeEvent_fn, dispatchInputEvent_fn, _handleSpinnerFocus, _handleClipboardCopy, _handleClipboardPaste, _handleFieldClick, _handleCalendarChange, _handleMonthChange, _handleYearChange, _handleIncrementFocusedMonth, _handleDecrementFocusedMonth, _handleCalendarFocusChange, _handlePopoverStateChange, _handleSpinnerKeydown, parseDateFormat_fn, _handleSpinnerChange, _spinnerState, years_get, isValueOutsideRange_get;
|
|
8
|
+
var _utcHours, _focusedMonthOverride, _focusedYearOverride, _Datepicker_instances, defaultFocusedDate_get, _valueOnOpen, shouldShowFooter_fn, renderReadonlyValue_fn, renderSpinners_fn, renderBackToValidRangeButton_fn, updateOutOfRangeAction_fn, normalizeDate_fn, focusDate_fn, isDateSelectable_fn, nearestSelectableDate_fn, shouldShowTodayButton_fn, getSpinnerLabel_fn, getMinSpinnerValue_fn, getMaxSpinnerValue_fn, getLocalizedPlaceholder_fn, getSpinnerValue_fn, dispatchChangeEvent_fn, dispatchInputEvent_fn, _handleSpinnerFocus, _handleClipboardCopy, _handleClipboardPaste, _handleFieldClick, _handleCalendarChange, _handleMonthChange, _handleYearChange, _handleIncrementFocusedMonth, _handleDecrementFocusedMonth, _handleCalendarFocusChange, formattedDisplayValue_get, _handlePopoverStateChange, _handleSpinnerKeydown, parseDateFormat_fn, _handleSpinnerChange, _spinnerState, years_get, isValueOutsideRange_get;
|
|
9
9
|
import { localized, msg } from "@lit/localize";
|
|
10
10
|
import { nothing } from "lit";
|
|
11
11
|
import { property, query, queryAll, queryAsync, state } from "lit/decorators.js";
|
|
@@ -17,6 +17,7 @@ import { addDays, isSameDay, lastDayOfMonth, setHours } from "date-fns";
|
|
|
17
17
|
import { GdsButton } from "../../components/button/button.component.js";
|
|
18
18
|
import { GdsDropdown } from "../../components/dropdown/dropdown.component.js";
|
|
19
19
|
import { GdsFlex } from "../../components/flex/flex.component.js";
|
|
20
|
+
import { GdsFieldBase } from "../../primitives/field-base/field-base.component.js";
|
|
20
21
|
import { gdsCustomElement, html } from "../../scoping.js";
|
|
21
22
|
import formControlHostStyle from "../../shared-styles/form-control-host.style.js";
|
|
22
23
|
import { tokens } from "../../tokens.style.js";
|
|
@@ -79,34 +80,37 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
79
80
|
e.clipboardData?.setData("text/plain", this.displayValue);
|
|
80
81
|
});
|
|
81
82
|
__privateAdd(this, _handleClipboardPaste, (e) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
this._elFieldAsync.then((field) => {
|
|
84
|
+
if (e.currentTarget !== field) return;
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
if (this.readonly) return;
|
|
87
|
+
const pasted = e.clipboardData?.getData("text/plain");
|
|
88
|
+
if (!pasted) return;
|
|
89
|
+
let pastedDate = /* @__PURE__ */ new Date("-");
|
|
90
|
+
const invalid = "Invalid Date";
|
|
91
|
+
const parts = pasted.split(this._dateFormatLayout.delimiter);
|
|
92
|
+
if (parts.length === 3) {
|
|
93
|
+
const layout = this._dateFormatLayout.layout;
|
|
94
|
+
const year = parseInt(parts[layout.findIndex((f) => f.token === "y")]);
|
|
95
|
+
const month = parseInt(parts[layout.findIndex((f) => f.token === "m")]) - 1;
|
|
96
|
+
const day = parseInt(parts[layout.findIndex((f) => f.token === "d")]);
|
|
97
|
+
if (!isNaN(year) && !isNaN(month) && !isNaN(day)) {
|
|
98
|
+
pastedDate = /* @__PURE__ */ new Date(`${year}-${month + 1}-${day}`);
|
|
99
|
+
}
|
|
96
100
|
}
|
|
97
|
-
}
|
|
98
|
-
if (pastedDate.toString() === invalid) {
|
|
99
|
-
pastedDate = new Date(pasted);
|
|
100
101
|
if (pastedDate.toString() === invalid) {
|
|
101
|
-
|
|
102
|
+
pastedDate = new Date(pasted);
|
|
103
|
+
if (pastedDate.toString() === invalid) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
102
106
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
this.value = pastedDate;
|
|
108
|
+
__privateMethod(this, _Datepicker_instances, dispatchChangeEvent_fn).call(this);
|
|
109
|
+
__privateMethod(this, _Datepicker_instances, dispatchInputEvent_fn).call(this);
|
|
110
|
+
});
|
|
107
111
|
});
|
|
108
112
|
__privateAdd(this, _handleFieldClick, (e) => {
|
|
109
|
-
this.
|
|
113
|
+
this._getValidityAnchor()?.focus();
|
|
110
114
|
});
|
|
111
115
|
__privateAdd(this, _handleCalendarChange, (e) => {
|
|
112
116
|
e.stopPropagation();
|
|
@@ -150,6 +154,10 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
150
154
|
});
|
|
151
155
|
__privateAdd(this, _handlePopoverStateChange, async (e) => {
|
|
152
156
|
if (e.target !== e.currentTarget) return;
|
|
157
|
+
if (this.readonly && e.detail.open) {
|
|
158
|
+
e.preventDefault();
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
153
161
|
this.open = e.detail.open;
|
|
154
162
|
if (e.detail.reason === "close") {
|
|
155
163
|
const calValue = (await this._elCalendar).value;
|
|
@@ -248,7 +256,7 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
248
256
|
* Get a string representation of the currently displayed value in the input field. The formatting will match the dateformat attribute.
|
|
249
257
|
*/
|
|
250
258
|
get displayValue() {
|
|
251
|
-
return this
|
|
259
|
+
return __privateGet(this, _Datepicker_instances, formattedDisplayValue_get);
|
|
252
260
|
}
|
|
253
261
|
/**
|
|
254
262
|
* A reference to a date cell element (<td>) inside the shadow root of the calendar primitive.
|
|
@@ -297,7 +305,12 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
297
305
|
class="size-${this.size}"
|
|
298
306
|
.showExtendedSupportingText="${this.showExtendedSupportingText}"
|
|
299
307
|
>
|
|
300
|
-
<label
|
|
308
|
+
<label
|
|
309
|
+
id="label"
|
|
310
|
+
for=${this.readonly ? "datepicker-value" : "spinner-0"}
|
|
311
|
+
slot="label"
|
|
312
|
+
>${this.label}</label
|
|
313
|
+
>
|
|
301
314
|
${when(
|
|
302
315
|
this.supportingText.length > 0,
|
|
303
316
|
() => html`<span slot="supporting-text" id="supporting-text">
|
|
@@ -320,41 +333,14 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
320
333
|
<gds-field-base
|
|
321
334
|
.size=${this.size}
|
|
322
335
|
.disabled=${this.disabled}
|
|
336
|
+
.readonly=${this.readonly}
|
|
323
337
|
.invalid=${this.invalid}
|
|
324
338
|
@click=${__privateGet(this, _handleFieldClick)}
|
|
325
339
|
@copy=${__privateGet(this, _handleClipboardCopy)}
|
|
326
340
|
@paste=${__privateGet(this, _handleClipboardPaste)}
|
|
327
341
|
id="field"
|
|
328
342
|
>
|
|
329
|
-
|
|
330
|
-
${join(
|
|
331
|
-
map(
|
|
332
|
-
this._dateFormatLayout.layout,
|
|
333
|
-
(f, i) => html`<gds-date-part-spinner
|
|
334
|
-
id="spinner-${i}"
|
|
335
|
-
aria-invalid="${this.invalid}"
|
|
336
|
-
class="spinner"
|
|
337
|
-
.length=${f.token === "y" ? 4 : 2}
|
|
338
|
-
.value=${__privateMethod(this, _Datepicker_instances, getSpinnerValue_fn).call(this, f.name)}
|
|
339
|
-
aria-valuemin=${__privateMethod(this, _Datepicker_instances, getMinSpinnerValue_fn).call(this, f.name)}
|
|
340
|
-
aria-valuemax=${__privateMethod(this, _Datepicker_instances, getMaxSpinnerValue_fn).call(this, f.name)}
|
|
341
|
-
aria-label=${__privateMethod(this, _Datepicker_instances, getSpinnerLabel_fn).call(this, f.name)}
|
|
342
|
-
aria-describedby="supporting-text supporting-text-slot sub-label-slot message"
|
|
343
|
-
data-max-width=${__privateMethod(this, _Datepicker_instances, getMaxSpinnerValue_fn).call(this, f.name).toString().length}
|
|
344
|
-
@keydown=${__privateGet(this, _handleSpinnerKeydown)}
|
|
345
|
-
@change=${(e) => __privateGet(this, _handleSpinnerChange).call(this, e.detail.value, f.name)}
|
|
346
|
-
@focus=${__privateGet(this, _handleSpinnerFocus)}
|
|
347
|
-
@touchend=${(e) => {
|
|
348
|
-
this.open = true;
|
|
349
|
-
e.preventDefault();
|
|
350
|
-
}}
|
|
351
|
-
></gds-date-part-spinner>`
|
|
352
|
-
),
|
|
353
|
-
html`<span class="separator"
|
|
354
|
-
>${this._dateFormatLayout.delimiter}</span
|
|
355
|
-
>`
|
|
356
|
-
)}
|
|
357
|
-
</div>
|
|
343
|
+
${this.readonly ? __privateMethod(this, _Datepicker_instances, renderReadonlyValue_fn).call(this) : __privateMethod(this, _Datepicker_instances, renderSpinners_fn).call(this)}
|
|
358
344
|
<gds-button
|
|
359
345
|
id="calendar-button"
|
|
360
346
|
slot="action"
|
|
@@ -366,7 +352,7 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
366
352
|
aria-expanded=${this.open}
|
|
367
353
|
aria-controls="calendar-popover"
|
|
368
354
|
aria-describedby="label"
|
|
369
|
-
.disabled=${this.disabled}
|
|
355
|
+
.disabled=${this.disabled || this.readonly}
|
|
370
356
|
>
|
|
371
357
|
${when(
|
|
372
358
|
this.size === "small",
|
|
@@ -540,7 +526,7 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
540
526
|
`;
|
|
541
527
|
}
|
|
542
528
|
_getValidityAnchor() {
|
|
543
|
-
return this._elSpinners[0];
|
|
529
|
+
return this.readonly ? this._elReadonlyValue || this._elField : this._elSpinners[0];
|
|
544
530
|
}
|
|
545
531
|
_handleOutOfRangeChange() {
|
|
546
532
|
__privateMethod(this, _Datepicker_instances, updateOutOfRangeAction_fn).call(this);
|
|
@@ -584,6 +570,48 @@ _valueOnOpen = new WeakMap();
|
|
|
584
570
|
shouldShowFooter_fn = function() {
|
|
585
571
|
return !this.plain;
|
|
586
572
|
};
|
|
573
|
+
renderReadonlyValue_fn = function() {
|
|
574
|
+
return html`<div
|
|
575
|
+
id="datepicker-value"
|
|
576
|
+
class="spinners readonly-value"
|
|
577
|
+
aria-describedby="supporting-text supporting-text-slot sub-label-slot message"
|
|
578
|
+
aria-invalid="${this.invalid}"
|
|
579
|
+
tabindex="0"
|
|
580
|
+
>
|
|
581
|
+
${__privateGet(this, _Datepicker_instances, formattedDisplayValue_get)}
|
|
582
|
+
</div>`;
|
|
583
|
+
};
|
|
584
|
+
renderSpinners_fn = function() {
|
|
585
|
+
return html`<div class="spinners">
|
|
586
|
+
${join(
|
|
587
|
+
map(
|
|
588
|
+
this._dateFormatLayout.layout,
|
|
589
|
+
(f, i) => html`<gds-date-part-spinner
|
|
590
|
+
id="spinner-${i}"
|
|
591
|
+
aria-invalid="${this.invalid}"
|
|
592
|
+
class="spinner"
|
|
593
|
+
.length=${f.token === "y" ? 4 : 2}
|
|
594
|
+
.value=${__privateGet(this, _spinnerState)[f.name]}
|
|
595
|
+
aria-valuemin=${__privateMethod(this, _Datepicker_instances, getMinSpinnerValue_fn).call(this, f.name)}
|
|
596
|
+
aria-valuemax=${__privateMethod(this, _Datepicker_instances, getMaxSpinnerValue_fn).call(this, f.name)}
|
|
597
|
+
aria-label=${__privateMethod(this, _Datepicker_instances, getSpinnerLabel_fn).call(this, f.name)}
|
|
598
|
+
aria-describedby="supporting-text supporting-text-slot sub-label-slot message"
|
|
599
|
+
data-max-width=${__privateMethod(this, _Datepicker_instances, getMaxSpinnerValue_fn).call(this, f.name).toString().length}
|
|
600
|
+
@keydown=${__privateGet(this, _handleSpinnerKeydown)}
|
|
601
|
+
@change=${(e) => __privateGet(this, _handleSpinnerChange).call(this, e.detail.value, f.name)}
|
|
602
|
+
@focus=${__privateGet(this, _handleSpinnerFocus)}
|
|
603
|
+
@touchend=${(e) => {
|
|
604
|
+
this.open = true;
|
|
605
|
+
e.preventDefault();
|
|
606
|
+
}}
|
|
607
|
+
></gds-date-part-spinner>`
|
|
608
|
+
),
|
|
609
|
+
html`<span class="separator"
|
|
610
|
+
>${this._dateFormatLayout.delimiter}</span
|
|
611
|
+
>`
|
|
612
|
+
)}
|
|
613
|
+
</div>`;
|
|
614
|
+
};
|
|
587
615
|
renderBackToValidRangeButton_fn = function() {
|
|
588
616
|
if (!this._outOfRangeAction) return nothing;
|
|
589
617
|
const isAfterMax = this._outOfRangeAction === "max";
|
|
@@ -730,6 +758,9 @@ _handleYearChange = new WeakMap();
|
|
|
730
758
|
_handleIncrementFocusedMonth = new WeakMap();
|
|
731
759
|
_handleDecrementFocusedMonth = new WeakMap();
|
|
732
760
|
_handleCalendarFocusChange = new WeakMap();
|
|
761
|
+
formattedDisplayValue_get = function() {
|
|
762
|
+
return this._dateFormatLayout.layout.map((part) => __privateGet(this, _spinnerState)[part.name]).join(this._dateFormatLayout.delimiter);
|
|
763
|
+
};
|
|
733
764
|
_handlePopoverStateChange = new WeakMap();
|
|
734
765
|
_handleSpinnerKeydown = new WeakMap();
|
|
735
766
|
/**
|
|
@@ -863,6 +894,9 @@ __decorateClass([
|
|
|
863
894
|
__decorateClass([
|
|
864
895
|
query("#field")
|
|
865
896
|
], Datepicker.prototype, "_elField", 2);
|
|
897
|
+
__decorateClass([
|
|
898
|
+
query("#datepicker-value")
|
|
899
|
+
], Datepicker.prototype, "_elReadonlyValue", 2);
|
|
866
900
|
__decorateClass([
|
|
867
901
|
watch(["value", "min", "max", "open", "_focusedMonth", "_focusedYear"])
|
|
868
902
|
], Datepicker.prototype, "_handleOutOfRangeChange", 1);
|
|
@@ -891,6 +925,7 @@ GdsDatepicker = __decorateClass([
|
|
|
891
925
|
GdsButton,
|
|
892
926
|
GdsDropdown,
|
|
893
927
|
GdsCalendar,
|
|
928
|
+
GdsFieldBase,
|
|
894
929
|
GdsPopover,
|
|
895
930
|
IconCalendar,
|
|
896
931
|
IconCalenderAdd,
|
|
@@ -9,6 +9,7 @@ var _optionElements, _Dropdown_instances, shouldShowFooter_fn, _renderCombobox,
|
|
|
9
9
|
import { localized, msg, str } from "@lit/localize";
|
|
10
10
|
import { nothing } from "lit";
|
|
11
11
|
import { property, query } from "lit/decorators.js";
|
|
12
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
12
13
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
13
14
|
import { when } from "lit/directives/when.js";
|
|
14
15
|
import { flip, offset } from "@floating-ui/dom";
|
|
@@ -77,10 +78,12 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
77
78
|
aria-required="${this.required}"
|
|
78
79
|
aria-disabled="${this.disabled}"
|
|
79
80
|
.value=${this.value}
|
|
81
|
+
?readonly=${this.readonly}
|
|
80
82
|
@click=${(e) => {
|
|
81
83
|
e.stopImmediatePropagation();
|
|
82
84
|
}}
|
|
83
85
|
@input=${(e) => {
|
|
86
|
+
if (this.readonly) return;
|
|
84
87
|
__privateMethod(this, _Dropdown_instances, commitSelection_fn).call(this, e.target.value, {
|
|
85
88
|
emitChange: false
|
|
86
89
|
});
|
|
@@ -88,6 +91,7 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
88
91
|
__privateGet(this, _dispatchUISateEvent).call(this, true, "show") && (this.open = true);
|
|
89
92
|
}}
|
|
90
93
|
@keydown=${(e) => {
|
|
94
|
+
if (this.readonly) return;
|
|
91
95
|
if (e.key === "ArrowDown") {
|
|
92
96
|
e.preventDefault();
|
|
93
97
|
__privateGet(this, _dispatchUISateEvent).call(this, true, "show") && (this.open = true);
|
|
@@ -116,6 +120,7 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
116
120
|
aria-invalid="${this.invalid}"
|
|
117
121
|
aria-required="${this.required}"
|
|
118
122
|
aria-disabled="${this.disabled}"
|
|
123
|
+
aria-readonly="${this.readonly}"
|
|
119
124
|
>
|
|
120
125
|
<slot name="trigger">
|
|
121
126
|
<span>${unsafeHTML(this.displayValue)}</span>
|
|
@@ -151,6 +156,10 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
151
156
|
composed: false
|
|
152
157
|
}));
|
|
153
158
|
__privateAdd(this, _handlePopoverStateChange, (e) => {
|
|
159
|
+
if (this.readonly && e.detail.open) {
|
|
160
|
+
e.preventDefault();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
154
163
|
if (__privateGet(this, _dispatchUISateEvent).call(this, e.detail.open, e.detail.reason)) {
|
|
155
164
|
this.open = e.detail.open;
|
|
156
165
|
}
|
|
@@ -389,6 +398,7 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
389
398
|
<gds-field-base
|
|
390
399
|
.size=${this.size}
|
|
391
400
|
.disabled=${this.disabled}
|
|
401
|
+
.readonly=${this.readonly}
|
|
392
402
|
.invalid=${this.invalid}
|
|
393
403
|
slot="trigger"
|
|
394
404
|
id="field"
|
|
@@ -408,7 +418,7 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
408
418
|
>`
|
|
409
419
|
)}
|
|
410
420
|
${when(
|
|
411
|
-
this.clearable && !this.disabled && (Array.isArray(this.value) ? this.value.length > 0 : Boolean(this.value)),
|
|
421
|
+
this.clearable && !this.disabled && !this.readonly && (Array.isArray(this.value) ? this.value.length > 0 : Boolean(this.value)),
|
|
412
422
|
() => html`<gds-button
|
|
413
423
|
id="clear-btn"
|
|
414
424
|
rank="tertiary"
|
|
@@ -426,6 +436,8 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
426
436
|
() => __privateGet(this, _renderTriggerButton).call(this)
|
|
427
437
|
)}
|
|
428
438
|
<gds-icon-chevron-bottom
|
|
439
|
+
class="chevron"
|
|
440
|
+
color=${ifDefined(this.readonly ? "disabled-01" : void 0)}
|
|
429
441
|
size=${this.size === "small" ? "m" : "l"}
|
|
430
442
|
slot="action"
|
|
431
443
|
></gds-icon-chevron-bottom>
|
|
@@ -56,6 +56,11 @@ export declare abstract class GdsFormControlElement<ValueT = any> extends GdsEle
|
|
|
56
56
|
* If the input is Disabled
|
|
57
57
|
*/
|
|
58
58
|
disabled: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* If the control is read-only. Unlike `disabled`, a read-only control remains focusable and its
|
|
61
|
+
* value is still submitted with the form, but the user cannot modify it.
|
|
62
|
+
*/
|
|
63
|
+
readonly: boolean;
|
|
59
64
|
/**
|
|
60
65
|
* The form element that the form control is associated with.
|
|
61
66
|
*/
|
|
@@ -18,6 +18,7 @@ class GdsFormControlElement extends GdsElement {
|
|
|
18
18
|
this.label = "";
|
|
19
19
|
this.name = "";
|
|
20
20
|
this.disabled = false;
|
|
21
|
+
this.readonly = false;
|
|
21
22
|
try {
|
|
22
23
|
__privateSet(this, _internals, this.attachInternals());
|
|
23
24
|
} catch (e) {
|
|
@@ -187,6 +188,12 @@ __decorateClass([
|
|
|
187
188
|
reflect: true
|
|
188
189
|
})
|
|
189
190
|
], GdsFormControlElement.prototype, "disabled", 2);
|
|
191
|
+
__decorateClass([
|
|
192
|
+
property({
|
|
193
|
+
type: Boolean,
|
|
194
|
+
reflect: true
|
|
195
|
+
})
|
|
196
|
+
], GdsFormControlElement.prototype, "readonly", 2);
|
|
190
197
|
__decorateClass([
|
|
191
198
|
watch("value", { waitUntilFirstUpdate: true })
|
|
192
199
|
], GdsFormControlElement.prototype, "__handleValueChange", 1);
|
|
@@ -51,10 +51,12 @@ let Input = class extends GdsFormControlElement {
|
|
|
51
51
|
__privateAdd(this, _charCounterComputed, this.charCounterCallback(this));
|
|
52
52
|
__privateAdd(this, _isOpeningFilePicker, false);
|
|
53
53
|
__privateAdd(this, _handleOnInput, (e) => {
|
|
54
|
+
if (this.readonly) return;
|
|
54
55
|
const element = e.target;
|
|
55
56
|
this.value = element.value;
|
|
56
57
|
});
|
|
57
58
|
__privateAdd(this, _handleOnChange, (e) => {
|
|
59
|
+
if (this.readonly) return;
|
|
58
60
|
const element = e.target;
|
|
59
61
|
this.value = element.value;
|
|
60
62
|
this.dispatchStandardEvent("change", {
|
|
@@ -64,7 +66,7 @@ let Input = class extends GdsFormControlElement {
|
|
|
64
66
|
});
|
|
65
67
|
__privateAdd(this, _handleOnKeyDown, (e) => {
|
|
66
68
|
if (e.key !== "Enter") return;
|
|
67
|
-
if (this.disabled) return;
|
|
69
|
+
if (this.disabled || this.readonly) return;
|
|
68
70
|
if (e.isComposing) return;
|
|
69
71
|
if (e.repeat) return;
|
|
70
72
|
if (this.type === "file") {
|
|
@@ -82,6 +84,7 @@ let Input = class extends GdsFormControlElement {
|
|
|
82
84
|
});
|
|
83
85
|
__privateAdd(this, _handleFieldClick, (e) => {
|
|
84
86
|
if (this.type === "file") {
|
|
87
|
+
if (this.readonly) return;
|
|
85
88
|
const clickedNativeInput = e.composedPath().includes(this.elInput);
|
|
86
89
|
if (!clickedNativeInput) {
|
|
87
90
|
__privateMethod(this, _Input_instances, openFilePickerOnce_fn).call(this);
|
|
@@ -215,6 +218,7 @@ let Input = class extends GdsFormControlElement {
|
|
|
215
218
|
<gds-field-base
|
|
216
219
|
.size=${this.size}
|
|
217
220
|
.disabled=${this.disabled}
|
|
221
|
+
.readonly=${this.readonly}
|
|
218
222
|
.invalid=${this.invalid}
|
|
219
223
|
@click=${__privateGet(this, _handleFieldClick)}
|
|
220
224
|
id="field"
|
|
@@ -283,6 +287,7 @@ renderNativeInput_fn = function() {
|
|
|
283
287
|
.value=${live(this.value ?? "")}
|
|
284
288
|
id="input"
|
|
285
289
|
?disabled=${this.disabled}
|
|
290
|
+
?readonly=${this.readonly}
|
|
286
291
|
aria-describedby="supporting-text extended-supporting-text sub-label message"
|
|
287
292
|
aria-invalid=${this.invalid}
|
|
288
293
|
aria-errormessage="message"
|
|
@@ -306,7 +311,7 @@ renderNativeInput_fn = function() {
|
|
|
306
311
|
`;
|
|
307
312
|
};
|
|
308
313
|
renderClearButton_fn = function() {
|
|
309
|
-
if (this.clearable && (this.value?.length || 0) > 0)
|
|
314
|
+
if (this.clearable && !this.readonly && (this.value?.length || 0) > 0)
|
|
310
315
|
return html`<gds-button
|
|
311
316
|
size="${this.size === "small" ? "xs" : "small"}"
|
|
312
317
|
rank="tertiary"
|
|
@@ -76,6 +76,7 @@ let RadioGroup = class extends GdsFormControlElement {
|
|
|
76
76
|
radio.size = this.size;
|
|
77
77
|
radio.invalid = this.invalid;
|
|
78
78
|
radio.errorMessage = this.errorMessage;
|
|
79
|
+
radio.readonly = this.readonly || radio.readonly;
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
render() {
|
|
@@ -91,6 +92,7 @@ let RadioGroup = class extends GdsFormControlElement {
|
|
|
91
92
|
aria-labelledby="group-label"
|
|
92
93
|
aria-describedby="supporting-text extended-supporting-text footer"
|
|
93
94
|
aria-invalid=${this.invalid}
|
|
95
|
+
aria-readonly=${this.readonly}
|
|
94
96
|
>
|
|
95
97
|
${__privateMethod(this, _RadioGroup_instances, renderRadioGroupContents_fn).call(this)}
|
|
96
98
|
</div>`;
|
|
@@ -137,6 +139,7 @@ dispatchChangeEvents_fn = function() {
|
|
|
137
139
|
};
|
|
138
140
|
handleRadioChange_fn = function(e) {
|
|
139
141
|
e.stopPropagation();
|
|
142
|
+
if (this.readonly) return;
|
|
140
143
|
const radio = e.target;
|
|
141
144
|
this.value = radio.value;
|
|
142
145
|
this._syncRadioStates();
|
|
@@ -144,7 +147,9 @@ handleRadioChange_fn = function(e) {
|
|
|
144
147
|
};
|
|
145
148
|
handleKeyDown_fn = function(e) {
|
|
146
149
|
if (!this._isConnected) return;
|
|
147
|
-
const radios = this.radios.filter(
|
|
150
|
+
const radios = this.radios.filter(
|
|
151
|
+
(radio) => !radio.disabled && !radio.readonly
|
|
152
|
+
);
|
|
148
153
|
if (radios.length === 0) return;
|
|
149
154
|
let currentIndex = radios.findIndex(
|
|
150
155
|
(radio) => document.activeElement === radio
|
|
@@ -251,7 +256,8 @@ __decorateClass([
|
|
|
251
256
|
], RadioGroup.prototype, "_handleValueChange", 1);
|
|
252
257
|
__decorateClass([
|
|
253
258
|
watch("invalid"),
|
|
254
|
-
watch("errorMessage")
|
|
259
|
+
watch("errorMessage"),
|
|
260
|
+
watch("readonly")
|
|
255
261
|
], RadioGroup.prototype, "_syncRadioStates", 1);
|
|
256
262
|
RadioGroup = __decorateClass([
|
|
257
263
|
ariaForwarding({
|
|
@@ -28,6 +28,15 @@ export declare class GdsRadio extends GdsElement {
|
|
|
28
28
|
* Whether the radio button is disabled or not.
|
|
29
29
|
*/
|
|
30
30
|
disabled: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the radio button is read-only. Unlike `disabled`, the radio button stays
|
|
33
|
+
* focusable, but its checked state cannot be changed by the user.
|
|
34
|
+
*
|
|
35
|
+
* Normally set on the parent `gds-radio-group`, which cascades it down to every radio
|
|
36
|
+
* and excludes read-only radios from arrow-key navigation. Can also be set directly on
|
|
37
|
+
* a standalone radio outside of a group.
|
|
38
|
+
*/
|
|
39
|
+
readonly: boolean;
|
|
31
40
|
/**
|
|
32
41
|
* Whether the radio button is invalid or not.
|
|
33
42
|
*/
|