@duetds/components 5.3.5 → 5.4.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/hydrate/index.js +45 -9
- package/lib/cjs/duet-action-button.cjs.entry.js +24 -6
- package/lib/cjs/duet-alert.cjs.entry.js +1 -1
- package/lib/cjs/duet-badge.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
- package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
- package/lib/cjs/duet-button_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-caption_4.cjs.entry.js +2 -2
- package/lib/cjs/duet-card.cjs.entry.js +2 -2
- package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
- package/lib/cjs/duet-choice_2.cjs.entry.js +2 -2
- package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
- package/lib/cjs/duet-combobox.cjs.entry.js +1 -1
- package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
- package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
- package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-editable-table_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
- package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
- package/lib/cjs/duet-footer.cjs.entry.js +1 -1
- package/lib/cjs/duet-grid_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-header_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-hero.cjs.entry.js +1 -1
- package/lib/cjs/duet-icon.cjs.entry.js +2 -2
- package/lib/cjs/duet-input_2.cjs.entry.js +21 -4
- package/lib/cjs/duet-layout.cjs.entry.js +1 -1
- package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-modal.cjs.entry.js +2 -2
- package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
- package/lib/cjs/duet-pagination_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-progress.cjs.entry.js +1 -1
- package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
- package/lib/cjs/duet-scrollable_3.cjs.entry.js +1 -1
- package/lib/cjs/duet-select.cjs.entry.js +1 -1
- package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
- package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
- package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
- package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
- package/lib/cjs/duet-tray.cjs.entry.js +1 -1
- package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
- package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
- package/lib/cjs/duet.cjs.js +2 -2
- package/lib/cjs/{focus-utils-84c29960.js → focus-utils-7c1832b2.js} +1 -1
- package/lib/cjs/{index-772cc42f.js → index-63f324e3.js} +1 -1
- package/lib/cjs/loader.cjs.js +2 -2
- package/lib/cjs/{token-utils-50a1f7e2.js → token-utils-fef5b4eb.js} +1 -0
- package/lib/collection/components/duet-action-button/duet-action-button.js +44 -8
- package/lib/collection/components/duet-collapsible/duet-collapsible.js +1 -1
- package/lib/collection/components/duet-input/duet-input.js +21 -3
- package/lib/collection/components/duet-upload/duet-upload.js +1 -1
- package/lib/collection/utils/token-utils.js +1 -1
- package/lib/custom-elements-bundle/index.js +46 -12
- package/lib/duet/duet.esm.js +1 -1
- package/lib/duet/duet.js +1 -1
- package/lib/duet/{p-bacb27a1.js → p-03957a48.js} +1 -1
- package/lib/duet/p-0416a99f.entry.js +4 -0
- package/lib/duet/p-0b3f7f25.entry.js +4 -0
- package/lib/duet/{p-b74364d3.entry.js → p-0d8f88c8.entry.js} +1 -1
- package/lib/duet/p-0f69bf5d.entry.js +4 -0
- package/lib/duet/{p-8c282db8.system.js → p-0f6e4db9.system.js} +1 -1
- package/lib/duet/{p-89f53f18.system.entry.js → p-128ee483.system.entry.js} +1 -1
- package/lib/duet/{p-8f74030a.entry.js → p-14acc501.entry.js} +1 -1
- package/lib/duet/{p-8708f306.system.entry.js → p-19cac237.system.entry.js} +1 -1
- package/lib/duet/{p-442f1dd5.entry.js → p-1dec0f2c.entry.js} +1 -1
- package/lib/duet/{p-a818e289.entry.js → p-21d74fec.entry.js} +1 -1
- package/lib/duet/{p-7de54632.entry.js → p-23a1875c.entry.js} +1 -1
- package/lib/duet/{p-8eb6610c.system.entry.js → p-2522f85c.system.entry.js} +1 -1
- package/lib/duet/{p-64a691e3.entry.js → p-282ee56b.entry.js} +1 -1
- package/lib/duet/{p-ba0a4b7e.system.entry.js → p-30153133.system.entry.js} +1 -1
- package/lib/duet/{p-35d6061d.system.entry.js → p-347a4bb8.system.entry.js} +1 -1
- package/lib/duet/{p-3d27e5ed.system.entry.js → p-355fd4fc.system.entry.js} +1 -1
- package/lib/duet/{p-4903478e.entry.js → p-3b06dacd.entry.js} +1 -1
- package/lib/duet/{p-b88b18c3.entry.js → p-3bdc0b4e.entry.js} +1 -1
- package/lib/duet/{p-909aaac4.entry.js → p-40d4bc49.entry.js} +1 -1
- package/lib/duet/{p-ce276fc8.js → p-413df442.js} +1 -1
- package/lib/duet/{p-c0d98307.system.entry.js → p-426854f8.system.entry.js} +1 -1
- package/lib/duet/{p-8a472df4.system.entry.js → p-46f6dea4.system.entry.js} +1 -1
- package/lib/duet/{p-4fd4ddda.entry.js → p-4b50c47b.entry.js} +1 -1
- package/lib/duet/{p-16bc9a7e.system.entry.js → p-538ca1e8.system.entry.js} +1 -1
- package/lib/duet/{p-86a47942.entry.js → p-56081d74.entry.js} +1 -1
- package/lib/duet/{p-01ccafd3.system.entry.js → p-568fe563.system.entry.js} +2 -2
- package/lib/duet/{p-e36b95e0.system.entry.js → p-5d5c0181.system.entry.js} +1 -1
- package/lib/duet/{p-ff94713b.entry.js → p-5fea867d.entry.js} +1 -1
- package/lib/duet/p-6002f3d2.system.js +4 -0
- package/lib/duet/{p-12b8cb2f.system.entry.js → p-62352bbe.system.entry.js} +1 -1
- package/lib/duet/{p-e40b610d.entry.js → p-671453a4.entry.js} +1 -1
- package/lib/duet/{p-631054f3.system.js → p-67cbfa71.system.js} +1 -1
- package/lib/duet/{p-b972e7b7.system.entry.js → p-6944e2d1.system.entry.js} +1 -1
- package/lib/duet/{p-4e8f57dd.entry.js → p-6aece7e2.entry.js} +1 -1
- package/lib/duet/{p-e980faf9.system.entry.js → p-6f073ee3.system.entry.js} +1 -1
- package/lib/duet/{p-0b426a83.system.entry.js → p-70886ae8.system.entry.js} +1 -1
- package/lib/duet/{p-411bec39.system.entry.js → p-723b036a.system.entry.js} +1 -1
- package/lib/duet/{p-fab89c9d.system.entry.js → p-767767ad.system.entry.js} +1 -1
- package/lib/duet/{p-f9045aab.system.entry.js → p-768141d2.system.entry.js} +2 -2
- package/lib/duet/{p-dfa92326.entry.js → p-77b7fbcd.entry.js} +1 -1
- package/lib/duet/{p-8fa7559b.system.entry.js → p-7ad2c618.system.entry.js} +1 -1
- package/lib/duet/{p-05ff2672.entry.js → p-7df06bf2.entry.js} +1 -1
- package/lib/duet/{p-ea806947.entry.js → p-86575e21.entry.js} +1 -1
- package/lib/duet/p-86ed3c73.system.entry.js +4 -0
- package/lib/duet/{p-1717ed62.entry.js → p-8717227c.entry.js} +1 -1
- package/lib/duet/{p-d06f9b6c.entry.js → p-87738b6e.entry.js} +1 -1
- package/lib/duet/{p-e6fdaa31.entry.js → p-8d175e68.entry.js} +1 -1
- package/lib/duet/{p-b48811b5.entry.js → p-8fb5f933.entry.js} +1 -1
- package/lib/duet/{p-32dd246d.entry.js → p-9062ca61.entry.js} +1 -1
- package/lib/duet/{p-9071d4e1.system.entry.js → p-909a229b.system.entry.js} +1 -1
- package/lib/duet/{p-b787e777.system.entry.js → p-909b6b44.system.entry.js} +1 -1
- package/lib/duet/{p-97bb6fdd.system.entry.js → p-967eb38f.system.entry.js} +1 -1
- package/lib/duet/{p-0d188b2d.entry.js → p-a2b29846.entry.js} +1 -1
- package/lib/duet/{p-0f144788.entry.js → p-a903df4e.entry.js} +1 -1
- package/lib/duet/{p-c4b6bf46.entry.js → p-a93fca8b.entry.js} +1 -1
- package/lib/duet/{p-2d58c660.system.entry.js → p-b263653d.system.entry.js} +1 -1
- package/lib/duet/{p-43c1dcf5.entry.js → p-b2680be5.entry.js} +1 -1
- package/lib/duet/{p-3f1e781d.system.entry.js → p-b34d417d.system.entry.js} +1 -1
- package/lib/duet/{p-2553a64a.entry.js → p-b5fc4eee.entry.js} +1 -1
- package/lib/duet/{p-c60f00e7.system.entry.js → p-b98bb109.system.entry.js} +1 -1
- package/lib/duet/{p-f2dab640.system.entry.js → p-bdbb5c7d.system.entry.js} +1 -1
- package/lib/duet/{p-1a8dfe6e.system.entry.js → p-bf0efbe9.system.entry.js} +1 -1
- package/lib/duet/{p-9027d0a4.system.entry.js → p-c2fe4072.system.entry.js} +1 -1
- package/lib/duet/{p-c9f704c9.entry.js → p-c5bd7c30.entry.js} +1 -1
- package/lib/duet/{p-7dfe1c16.entry.js → p-c83e1e74.entry.js} +1 -1
- package/lib/duet/{p-6dd1cf98.entry.js → p-c90ab5d7.entry.js} +1 -1
- package/lib/duet/{p-3f50d9bd.system.entry.js → p-c9453dc6.system.entry.js} +1 -1
- package/lib/duet/{p-56ae348b.entry.js → p-c993f95a.entry.js} +1 -1
- package/lib/duet/p-cb64979e.system.entry.js +4 -0
- package/lib/duet/{p-20f4d5d2.system.entry.js → p-cbd51090.system.entry.js} +1 -1
- package/lib/duet/{p-c069f560.entry.js → p-cd8b61fd.entry.js} +1 -1
- package/lib/duet/{p-100b6a91.entry.js → p-ce8ddf05.entry.js} +1 -1
- package/lib/duet/{p-fdaaa3ad.entry.js → p-d243054f.entry.js} +1 -1
- package/lib/duet/{p-8b7adbf6.system.entry.js → p-da59200a.system.entry.js} +1 -1
- package/lib/duet/{p-e00170a2.system.entry.js → p-da62b929.system.entry.js} +1 -1
- package/lib/duet/{p-e908bfdc.system.entry.js → p-da9aa2cc.system.entry.js} +1 -1
- package/lib/duet/p-de3c0f4d.js +4 -0
- package/lib/duet/{p-5184e972.system.entry.js → p-e15ae3b1.system.entry.js} +1 -1
- package/lib/duet/{p-4dcbaccf.system.entry.js → p-e2628b7c.system.entry.js} +1 -1
- package/lib/duet/{p-f301004d.entry.js → p-e74db103.entry.js} +1 -1
- package/lib/duet/{p-815f4a10.system.entry.js → p-ea4e6d02.system.entry.js} +1 -1
- package/lib/duet/{p-7382c47e.system.entry.js → p-ec34f321.system.entry.js} +1 -1
- package/lib/duet/{p-85c68d48.system.entry.js → p-ec96f020.system.entry.js} +1 -1
- package/lib/duet/{p-36924c8f.entry.js → p-ed9cc88f.entry.js} +1 -1
- package/lib/duet/{p-4260e8b5.system.entry.js → p-efcc198f.system.entry.js} +1 -1
- package/lib/duet/{p-083e39cc.entry.js → p-f2aeef65.entry.js} +1 -1
- package/lib/duet/{p-923b03a6.system.entry.js → p-f3e72c0f.system.entry.js} +1 -1
- package/lib/duet/{p-cdba4c82.entry.js → p-f63f1511.entry.js} +1 -1
- package/lib/duet/{p-acaedb00.system.js → p-f86937f0.system.js} +1 -1
- package/lib/duet/{p-634fda0f.entry.js → p-fd7f32f7.entry.js} +1 -1
- package/lib/esm/duet-action-button.entry.js +24 -6
- package/lib/esm/duet-alert.entry.js +1 -1
- package/lib/esm/duet-badge.entry.js +1 -1
- package/lib/esm/duet-breadcrumb.entry.js +1 -1
- package/lib/esm/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm/duet-button_2.entry.js +2 -2
- package/lib/esm/duet-caption_4.entry.js +2 -2
- package/lib/esm/duet-card.entry.js +2 -2
- package/lib/esm/duet-checkbox.entry.js +1 -1
- package/lib/esm/duet-choice_2.entry.js +2 -2
- package/lib/esm/duet-collapsible.entry.js +2 -2
- package/lib/esm/duet-combobox.entry.js +1 -1
- package/lib/esm/duet-cookie-consent.entry.js +1 -1
- package/lib/esm/duet-date-picker.entry.js +2 -2
- package/lib/esm/duet-divider_2.entry.js +1 -1
- package/lib/esm/duet-editable-table_3.entry.js +1 -1
- package/lib/esm/duet-empty-state.entry.js +1 -1
- package/lib/esm/duet-fieldset.entry.js +1 -1
- package/lib/esm/duet-footer.entry.js +1 -1
- package/lib/esm/duet-grid_2.entry.js +1 -1
- package/lib/esm/duet-header_2.entry.js +1 -1
- package/lib/esm/duet-hero.entry.js +1 -1
- package/lib/esm/duet-icon.entry.js +2 -2
- package/lib/esm/duet-input_2.entry.js +21 -4
- package/lib/esm/duet-layout.entry.js +1 -1
- package/lib/esm/duet-list_2.entry.js +1 -1
- package/lib/esm/duet-modal.entry.js +2 -2
- package/lib/esm/duet-notification_2.entry.js +1 -1
- package/lib/esm/duet-number-input.entry.js +1 -1
- package/lib/esm/duet-pagination_2.entry.js +1 -1
- package/lib/esm/duet-progress.entry.js +1 -1
- package/lib/esm/duet-radio_2.entry.js +1 -1
- package/lib/esm/duet-range-slider.entry.js +1 -1
- package/lib/esm/duet-scrollable_3.entry.js +1 -1
- package/lib/esm/duet-select.entry.js +1 -1
- package/lib/esm/duet-step_2.entry.js +1 -1
- package/lib/esm/duet-textarea.entry.js +1 -1
- package/lib/esm/duet-toggle.entry.js +1 -1
- package/lib/esm/duet-tooltip.entry.js +1 -1
- package/lib/esm/duet-tray.entry.js +1 -1
- package/lib/esm/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm/duet-visually-hidden.entry.js +1 -1
- package/lib/esm/duet.js +2 -2
- package/lib/esm/{focus-utils-07c543df.js → focus-utils-4ca66786.js} +1 -1
- package/lib/esm/{index-bcca1cb8.js → index-d5956898.js} +1 -1
- package/lib/esm/loader.js +2 -2
- package/lib/esm/{token-utils-1f9435bc.js → token-utils-df78f4d8.js} +1 -1
- package/lib/esm-es5/duet-action-button.entry.js +2 -2
- package/lib/esm-es5/duet-alert.entry.js +1 -1
- package/lib/esm-es5/duet-badge.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
- package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
- package/lib/esm-es5/duet-button_2.entry.js +1 -1
- package/lib/esm-es5/duet-caption_4.entry.js +1 -1
- package/lib/esm-es5/duet-card.entry.js +1 -1
- package/lib/esm-es5/duet-checkbox.entry.js +1 -1
- package/lib/esm-es5/duet-choice_2.entry.js +1 -1
- package/lib/esm-es5/duet-collapsible.entry.js +2 -2
- package/lib/esm-es5/duet-combobox.entry.js +1 -1
- package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
- package/lib/esm-es5/duet-date-picker.entry.js +1 -1
- package/lib/esm-es5/duet-divider_2.entry.js +1 -1
- package/lib/esm-es5/duet-editable-table_3.entry.js +1 -1
- package/lib/esm-es5/duet-empty-state.entry.js +1 -1
- package/lib/esm-es5/duet-fieldset.entry.js +1 -1
- package/lib/esm-es5/duet-footer.entry.js +1 -1
- package/lib/esm-es5/duet-grid_2.entry.js +1 -1
- package/lib/esm-es5/duet-header_2.entry.js +1 -1
- package/lib/esm-es5/duet-hero.entry.js +1 -1
- package/lib/esm-es5/duet-icon.entry.js +1 -1
- package/lib/esm-es5/duet-input_2.entry.js +1 -1
- package/lib/esm-es5/duet-layout.entry.js +1 -1
- package/lib/esm-es5/duet-list_2.entry.js +1 -1
- package/lib/esm-es5/duet-modal.entry.js +1 -1
- package/lib/esm-es5/duet-notification_2.entry.js +1 -1
- package/lib/esm-es5/duet-number-input.entry.js +1 -1
- package/lib/esm-es5/duet-pagination_2.entry.js +1 -1
- package/lib/esm-es5/duet-progress.entry.js +1 -1
- package/lib/esm-es5/duet-radio_2.entry.js +1 -1
- package/lib/esm-es5/duet-range-slider.entry.js +1 -1
- package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
- package/lib/esm-es5/duet-select.entry.js +1 -1
- package/lib/esm-es5/duet-step_2.entry.js +1 -1
- package/lib/esm-es5/duet-textarea.entry.js +2 -2
- package/lib/esm-es5/duet-toggle.entry.js +1 -1
- package/lib/esm-es5/duet-tooltip.entry.js +1 -1
- package/lib/esm-es5/duet-tray.entry.js +1 -1
- package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
- package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
- package/lib/esm-es5/duet.js +1 -1
- package/lib/esm-es5/{focus-utils-07c543df.js → focus-utils-4ca66786.js} +1 -1
- package/lib/esm-es5/{index-bcca1cb8.js → index-d5956898.js} +1 -1
- package/lib/esm-es5/loader.js +1 -1
- package/lib/esm-es5/token-utils-df78f4d8.js +4 -0
- package/lib/types/components/duet-action-button/duet-action-button.d.ts +12 -4
- package/lib/types/components/duet-input/duet-input.d.ts +2 -1
- package/lib/types/components/duet-upload/duet-upload.d.ts +1 -2
- package/lib/types/components.d.ts +13 -5
- package/lib/types/utils/token-utils.d.ts +1 -0
- package/package.json +5 -5
- package/lib/duet/p-35159c88.system.entry.js +0 -4
- package/lib/duet/p-61507bc8.entry.js +0 -4
- package/lib/duet/p-6190e2d6.system.js +0 -4
- package/lib/duet/p-661f842b.entry.js +0 -4
- package/lib/duet/p-9cca0bb4.js +0 -4
- package/lib/duet/p-9df4bfa0.system.entry.js +0 -4
- package/lib/duet/p-dbb2579c.entry.js +0 -4
- package/lib/esm-es5/token-utils-1f9435bc.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function a(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function u(t){try{s(n.next(t))}catch(e){o(e)}}function r(t){try{s(n["throw"](t))}catch(e){o(e)}}function s(t){t.done?i(t.value):a(t.value).then(u,r)}s((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,u;return u={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function r(t){return function(e){return s([t,e])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,a&&(o=u[0]&2?a["return"]:u[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,u[1])).done)return o;if(a=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;a=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(u[0]===6&&i.label<o[1]){i.label=o[1];o=u;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(u);break}if(o[2])i.ops.pop();i.trys.pop();continue}u=e.call(t,i)}catch(r){u=[6,r];a=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bcca1cb8.js";import{f as formSearch}from"./form-search-ea8e19ae.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{c as cleanValue,r as resetCursor}from"./input-utils-de45e099.js";import{f as isEscapeKey}from"./keyboard-utils-88ea1007.js";import{g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var formEmail={title:"form-email",tags:"form email",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M12 23.999c-3.205 0-6.218-1.248-8.484-3.514S.001 15.206.001 12.001s1.248-6.218 3.514-8.485C5.782 1.25 8.795.001 12 .001s6.218 1.248 8.485 3.514A11.92 11.92 0 0 1 24 12v2.25A3.754 3.754 0 0 1 20.25 18a3.77 3.77 0 0 1-3.48-2.365A6.009 6.009 0 0 1 12 18c-3.308 0-6-2.692-6-6s2.692-6 6-6 6 2.692 6 6v2.25c0 1.241 1.009 2.25 2.25 2.25s2.25-1.009 2.25-2.25V12c0-2.804-1.092-5.441-3.075-7.424A10.433 10.433 0 0 0 12 1.501c-2.804 0-5.441 1.092-7.424 3.075S1.501 9.196 1.501 12c0 2.805 1.092 5.441 3.075 7.424s4.619 3.074 7.423 3.074c2.257 0 4.494-.746 6.299-2.1a.749.749 0 1 1 .9 1.199A12.049 12.049 0 0 1 12 23.999zM12 7.5c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5z"/></svg>'};var duetInputCss='*.sc-duet-input,*.sc-duet-input::after,*.sc-duet-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-input-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-input-h:last-child,.sc-duet-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-input-h{width:100% !important}.duet-m-0.sc-duet-input-h{margin:0 !important}duet-tooltip.sc-duet-input{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-input{position:relative;top:4px;right:auto}}duet-caption.sc-duet-input:not(:last-of-type){margin-bottom:0}.duet-input-placeholder.sc-duet-input{position:absolute;top:-9px;left:9px;z-index:200;display:block;width:auto;max-width:60%;padding:0 0.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:white}.duet-input-icon.sc-duet-input{position:absolute;top:50%;right:16px;z-index:200;width:20px;height:20px;font-size:0;line-height:normal;color:#00294d;pointer-events:none;transform:translateY(-50%)}.duet-theme-turva.sc-duet-input .duet-input-icon.sc-duet-input{color:#171c3a}.duet-input-container.sc-duet-input{position:relative;width:100%;height:100%}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input{position:relative;z-index:250}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input{position:absolute;top:-24px;right:0;min-width:48px;min-height:48px}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-input .duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input:active{opacity:0.75;transition:none}.duet-input-container.has-clear.has-icon.sc-duet-input .duet-input-clear-icon.sc-duet-input{top:-24px;right:24px}.duet-input.sc-duet-input{position:relative;z-index:100;display:block !important;width:100% !important;min-width:8rem;max-width:initial !important;height:auto !important;padding:12px 14px !important;margin:initial !important;margin-bottom:initial !important;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400 !important;font-variant-numeric:tabular-nums;line-height:1.5 !important;color:#00294d !important;cursor:initial !important;background:white !important;background-clip:initial !important;border:1px solid #909599 !important;border-radius:4px !important;box-shadow:initial !important;transition:box-shadow 150ms ease, border 150ms ease !important}.duet-input.is-number.sc-duet-input{padding-right:112px !important}.duet-input.is-date.sc-duet-input{padding-right:64px !important}.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#de2362 !important}.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#e02a0d !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#e02a0d !important}.has-icon.sc-duet-input .duet-input.sc-duet-input{padding-right:48px !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a !important;border-color:#747475 !important}.duet-input.sc-duet-input::-ms-clear{display:none}.duet-input.sc-duet-input::-webkit-contacts-auto-fill-button{display:none !important}.duet-input.sc-duet-input::-webkit-input-placeholder{color:#657787;opacity:1 !important;transition:color 300ms ease}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-webkit-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfcfd1}.duet-input.sc-duet-input::-moz-placeholder{color:#657787;opacity:1 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-moz-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfcfd1}.duet-input.sc-duet-input:-ms-input-placeholder{color:#657787}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:-ms-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfcfd1}.duet-input[disabled].sc-duet-input{color:#00294d !important;cursor:text !important;background:#f5f8fa !important;border-color:#f5f8fa !important;box-shadow:none !important;opacity:1 !important;-webkit-text-fill-color:#00294d !important}.duet-theme-turva.sc-duet-input .duet-input[disabled].sc-duet-input{color:#171c3a !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important;-webkit-text-fill-color:#171c3a !important}.duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #909599 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #747475 !important}.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus{border-color:#0077b3 !important;outline:0;box-shadow:0 0 0 1px #0077b3 !important;transition:none}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus{border-color:#171c3a !important;box-shadow:0 0 0 1px #171c3a !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#171c3a}.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#0077b3}.duet-input[type=search].sc-duet-input:not(:placeholder-shown):focus+.duet-input-icon.sc-duet-input{display:none}.duet-input.sc-duet-input:not(:focus):not(:hover):invalid{box-shadow:none !important}.duet-input[type=number].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=number].sc-duet-input::-webkit-outer-spin-button,.duet-input[type=time].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=time].sc-duet-input::-webkit-outer-spin-button{display:none;margin:0;-webkit-appearance:none}.duet-input.sc-duet-input::-webkit-search-cancel-button{margin-right:-28px}.duet-input-help.sc-duet-input{display:block;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.875rem;font-weight:400;line-height:1.25;color:#657787;border-radius:4px}.duet-input-help.sc-duet-input span.sc-duet-input{display:block;margin-top:8px}.duet-theme-turva.sc-duet-input .duet-input-help.sc-duet-input{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#747475}.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#e02a0d}.duet-label-hidden.sc-duet-input duet-label.sc-duet-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-input-relative.sc-duet-input{position:relative;width:100%}.duet-input-variation-button.sc-duet-input{position:relative;width:100%}.duet-input-variation-button.sc-duet-input .duet-input-relative.sc-duet-input{display:flex;flex-direction:row;flex-wrap:nowrap;align-content:center;align-items:center;justify-content:flex-start;width:auto}.duet-input-variation-button.sc-duet-input .duet-input-relative.sc-duet-input duet-button.sc-duet-input{z-index:250;margin-bottom:0}.duet-input-variation-button.sc-duet-input .duet-input-relative.sc-duet-input .duet-input.sc-duet-input{border-right-width:0 !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}';var icons={search:formSearch,email:formEmail};var DuetInput=function(){function t(t){var e=this;registerInstance(this,t);this.duetInput=createEvent(this,"duetInput",7);this.duetChange=createEvent(this,"duetChange",3);this.duetBlur=createEvent(this,"duetBlur",7);this.duetClear=createEvent(this,"duetClear",7);this.duetFocus=createEvent(this,"duetFocus",7);this.inputId=createID("DuetInput");this.clearId=createID("DuetInputClear");this.labelId=createID("DuetLabel");this.topCaptionId=createID("DuetCaptionTop");this.topCaptionPlaceholderId=createID("DuetCaptionPlaceholderTop");this.errorId=createID("DuetError");this.disallowPatternRegex=null;this.clearLabel=getLocaleString({en:"Clear",fi:"Tyhjennä",sv:"Rensa"});this.accessibleDescribedBy="";this.accessibleHasPopup=undefined;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.debounce=0;this.clear=false;this.echoPlaceholder=false;this.theme="";this.expand=false;this.disabled=false;this.margin="auto";this.required=false;this.type="text";this.variation="default";this.label="label";this.error="";this.labelHidden=false;this.numericKeyboard=false;this.component="input";this.autoComplete="on";this.disallowPattern=null;this.tooltip="";this.tooltipDirection="auto";this.onInput=function(t){if(e.disallowPatternRegex){cleanValue(e.nativeInput,e.disallowPatternRegex)}e.value=e.nativeInput.value||"";e.duetInput.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.onBlur=function(t){e.duetBlur.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.onFocus=function(t){e.duetFocus.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.onClear=function(t){e.duetFocus.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.getDescribedBy=function(){var t="";if(e.isCaptionVisible&&e.topCaptionId){t=e.topCaptionId;if(e.accessibleDescribedBy){t+=" "+e.accessibleDescribedBy}}else if(e.accessibleDescribedBy.length>0){t=e.accessibleDescribedBy}else{t=undefined}return t};this.handleClearClick=function(t){var i=e.clearInput();e.onClear(t);return i};this.keyHandler=function(t){if(isEscapeKey(t)&&e.clear){e.handleClearClick(t)}return t}}t.prototype.disallowedPatternChange=function(){this.disallowPatternRegex=this.disallowPattern?new RegExp(this.disallowPattern,"g"):null};t.prototype.valueChanged=function(){var t=this;var e;if(((e=this===null||this===void 0?void 0:this.nativeInput)===null||e===void 0?void 0:e.value)!==this.value){var i=resetCursor(this.nativeInput);this.nativeInput.value=this.value;i()}this.isCaptionVisible=!!this.caption;var n=function(){return t.duetChange.emit({value:t.value,component:"duet-input"})};if(this.debounce===0){n()}else{clearTimeout(this.timeoutId);this.timeoutId=setTimeout(n,this.debounce)}};t.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.disallowedPatternChange();this.isCaptionVisible=!!this.caption};t.prototype.setFocus=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.nativeInput){this.nativeInput.focus(t)}return[2]}))}))};t.prototype.resetCursor=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){if(this.nativeInput){t=resetCursor(this.nativeInput);this.nativeInput.value=this.value;t()}return[2]}))}))};t.prototype.clearInput=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput){this.nativeInput.value="";this.value=""}return[2]}))}))};t.prototype.render=function(){var t;var e=this;var i=this.identifier||this.inputId;var n={};if(this.numericKeyboard){n.inputmode="numeric"}if(this.pattern&&this.type!=="tel"){n.pattern=this.pattern}else if(!this.pattern&&this.type==="tel"){n.pattern="[0-9+ ]+"}return h(Host,{class:{"duet-expand":this.expand,"duet-m-0":this.margin==="none"},onKeyUp:function(t){return e.keyHandler(t)}},h("div",{class:(t={"duet-input-container":true,"duet-theme-turva":this.theme==="turva"},t["duet-input-variation-".concat(this.variation)]=true,t["duet-label-hidden"]=this.labelHidden,t["duet-input-top-caption-shown"]=this.isCaptionVisible,t["has-icon"]=!!this.icon||this.type!=="text"&&this.type!=="tel"&&this.type!=="password",t["has-error"]=!!this.error,t["has-clear"]=this.clear,t)},h("duet-label",{theme:this.theme==="turva"?"turva":"default",class:{"duet-has-tooltip":!!this.tooltip},margin:this.isCaptionVisible?"small":"auto",id:this.labelId,for:i},this.label),this.tooltip&&h("duet-tooltip",{direction:this.tooltipDirection,accessibleInputLabel:this.label},this.tooltip),this.caption&&h("duet-caption",{id:this.topCaptionId,size:"medium"},this.caption),h("div",{class:"duet-input-relative"},this.placeholder&&this.echoPlaceholder&&this.value&&h("duet-caption",{id:this.topCaptionPlaceholderId,class:"duet-input-placeholder",margin:"none",size:"small"},this.placeholder),h("input",Object.assign({ref:function(t){return e.nativeInput=t},onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,type:this.type,class:{"duet-input":true,disabled:this.disabled,"is-number":this.component==="number","is-date":this.component==="date"},value:this.value,disabled:this.disabled,"aria-invalid":this.error?"true":"false","aria-labelledby":this.accessibleLabelledBy?"".concat(this.labelId," ").concat(this.errorId," ").concat(this.accessibleLabelledBy):"".concat(this.labelId," ").concat(this.errorId),"aria-controls":this.accessibleControls,"aria-autocomplete":this.accessibleAutocomplete,"aria-activedescendant":this.accessibleActiveDescendant,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,"aria-expanded":this.accessibleExpanded,"aria-haspopup":this.accessibleHasPopup,"aria-owns":this.accessibleOwns,"aria-describedby":this.getDescribedBy(),placeholder:this.placeholder,spellcheck:"false",minlength:this.minlength,maxlength:this.maxlength,autocomplete:this.autoComplete,required:this.required,role:this.role,name:this.name,id:i},n)),!this.icon&&this.type!=="text"&&this.type!=="tel"&&this.type!=="password"&&this.variation!=="button"&&h("div",{class:"duet-input-icon"},h("duet-icon",{margin:"none",size:"small",icon:icons[this.type].svg,color:"currentColor"})),this.clear&&this.value&&h("div",{class:"duet-input-clear-icon"},h("button",{onClick:this.handleClearClick,id:this.clearId,"aria-label":this.clearLabel,"aria-keyshortcuts":"Escape"},h("duet-icon",{margin:"none",size:"xx-small",name:"activity-close",color:"currentColor"}))),this.icon&&this.variation!=="button"&&h("div",{class:"duet-input-icon"},h("duet-icon",{margin:"none",size:"small",name:this.icon,color:"currentColor"})),this.variation==="button"&&h("slot",{name:"button"}),h("slot",null)),h("span",{class:"duet-input-help",id:this.errorId,"aria-live":"assertive","aria-relevant":"additions removals"},this.error&&h("span",{class:"duet-input-error"},this.error))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disallowPattern:["disallowedPatternChange"],value:["valueChanged"]}},enumerable:false,configurable:true});return t}();DuetInput.style=duetInputCss;var duetLabelCss='*.sc-duet-label,*.sc-duet-label::after,*.sc-duet-label::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-label-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;position:relative;z-index:100;display:inline-flex;width:auto;margin-top:8px !important;line-height:1.25;cursor:default}.duet-p-0.sc-duet-label-h{padding:0 !important}.duet-m-0.sc-duet-label-h{margin:0 !important}.duet-m-0.sc-duet-label-h{margin-bottom:0 !important}.duet-small-margin.sc-duet-label-h{margin-top:8px !important;margin-bottom:4px !important}.duet-has-tooltip.sc-duet-label-h{padding-right:48px}@media (min-width: 48em){.duet-has-tooltip.sc-duet-label-h{padding-right:0}}label.sc-duet-label{margin:0;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:600 !important;line-height:1.25;color:#00294d;text-align:left;word-break:break-word}label.sc-duet-label span.sc-duet-label{font-size:1rem;font-weight:600 !important;word-break:break-word}.duet-label-small.sc-duet-label-h label.sc-duet-label{font-size:0.875rem}.duet-label-small.sc-duet-label-h label.sc-duet-label span.sc-duet-label{font-size:0.875rem}.duet-theme-turva.sc-duet-label-h label.sc-duet-label{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}';var DuetLabel=function(){function t(t){registerInstance(this,t);this.theme="";this.margin="auto";this.size="medium"}t.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};t.prototype.render=function(){return h(Host,{class:{"duet-label":true,"duet-label-small":this.size==="small","duet-theme-turva":this.theme==="turva","duet-small-margin":this.margin==="small","duet-m-0":this.margin==="none"}},h("label",{htmlFor:this.for},h("span",null,h("slot",null))))};return t}();DuetLabel.style=duetLabelCss;export{DuetInput as duet_input,DuetLabel as duet_label};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-d5956898.js";import{f as formSearch}from"./form-search-ea8e19ae.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{c as cleanValue,r as resetCursor}from"./input-utils-de45e099.js";import{f as isEscapeKey}from"./keyboard-utils-88ea1007.js";import{g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var formEmail={title:"form-email",tags:"form email",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M12 23.999c-3.205 0-6.218-1.248-8.484-3.514S.001 15.206.001 12.001s1.248-6.218 3.514-8.485C5.782 1.25 8.795.001 12 .001s6.218 1.248 8.485 3.514A11.92 11.92 0 0 1 24 12v2.25A3.754 3.754 0 0 1 20.25 18a3.77 3.77 0 0 1-3.48-2.365A6.009 6.009 0 0 1 12 18c-3.308 0-6-2.692-6-6s2.692-6 6-6 6 2.692 6 6v2.25c0 1.241 1.009 2.25 2.25 2.25s2.25-1.009 2.25-2.25V12c0-2.804-1.092-5.441-3.075-7.424A10.433 10.433 0 0 0 12 1.501c-2.804 0-5.441 1.092-7.424 3.075S1.501 9.196 1.501 12c0 2.805 1.092 5.441 3.075 7.424s4.619 3.074 7.423 3.074c2.257 0 4.494-.746 6.299-2.1a.749.749 0 1 1 .9 1.199A12.049 12.049 0 0 1 12 23.999zM12 7.5c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5z"/></svg>'};var duetInputCss='*.sc-duet-input,*.sc-duet-input::after,*.sc-duet-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-input-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;text-align:left;vertical-align:bottom}.sc-duet-input-h:last-child,.sc-duet-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-input-h{width:100% !important}.duet-m-0.sc-duet-input-h{margin:0 !important}duet-tooltip.sc-duet-input{position:absolute;top:12px;right:0}@media (min-width: 48em){duet-tooltip.sc-duet-input{position:relative;top:4px;right:auto}}duet-caption.sc-duet-input:not(:last-of-type){margin-bottom:0}.duet-input-placeholder.sc-duet-input{position:absolute;top:-9px;left:9px;z-index:200;display:block;width:auto;max-width:60%;padding:0 0.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:white}.duet-input-icon.sc-duet-input{position:absolute;top:50%;right:16px;z-index:200;width:20px;height:20px;font-size:0;line-height:normal;color:#00294d;pointer-events:none;transform:translateY(-50%)}.duet-theme-turva.sc-duet-input .duet-input-icon.sc-duet-input{color:#171c3a}.duet-input-container.sc-duet-input{position:relative;width:100%;height:100%}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input{position:relative;z-index:250}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input{position:absolute;top:-24px;right:0;min-width:48px;min-height:48px}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input:focus{outline:0;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-input .duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-input-container.has-clear.sc-duet-input .duet-input-clear-icon.sc-duet-input button.sc-duet-input:active{opacity:0.75;transition:none}.duet-input-container.has-clear.has-icon.sc-duet-input .duet-input-clear-icon.sc-duet-input{top:-24px;right:24px}.duet-input.sc-duet-input{position:relative;z-index:100;display:block !important;width:100% !important;min-width:8rem;max-width:initial !important;height:auto !important;padding:12px 14px !important;margin:initial !important;margin-bottom:initial !important;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400 !important;font-variant-numeric:tabular-nums;line-height:1.5 !important;color:#00294d !important;cursor:initial !important;background:white !important;background-clip:initial !important;border:1px solid #909599 !important;border-radius:4px !important;box-shadow:initial !important;transition:box-shadow 150ms ease, border 150ms ease !important}.duet-input.is-number.sc-duet-input{padding-right:112px !important}.duet-input.is-date.sc-duet-input{padding-right:64px !important}.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#de2362 !important}.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#de2362 !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input{border-color:#e02a0d !important}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input+.duet-input-icon.sc-duet-input{color:#e02a0d !important}.has-icon.sc-duet-input .duet-input.sc-duet-input{padding-right:48px !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a !important;border-color:#747475 !important}.duet-input.sc-duet-input::-ms-clear{display:none}.duet-input.sc-duet-input::-webkit-contacts-auto-fill-button{display:none !important}.duet-input.sc-duet-input::-webkit-input-placeholder{color:#657787;opacity:1 !important;transition:color 300ms ease}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-webkit-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-webkit-input-placeholder{color:#cfcfd1}.duet-input.sc-duet-input::-moz-placeholder{color:#657787;opacity:1 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input::-moz-placeholder{color:#747475}.duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus::-moz-placeholder{color:#cfcfd1}.duet-input.sc-duet-input:-ms-input-placeholder{color:#657787}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:-ms-input-placeholder{color:#747475}.duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfd2d4}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus:-ms-input-placeholder{color:#cfcfd1}.duet-input[disabled].sc-duet-input{color:#00294d !important;cursor:text !important;background:#f5f8fa !important;border-color:#f5f8fa !important;box-shadow:none !important;opacity:1 !important;-webkit-text-fill-color:#00294d !important}.duet-theme-turva.sc-duet-input .duet-input[disabled].sc-duet-input{color:#171c3a !important;background:#f5f5f7 !important;border-color:#f5f5f7 !important;-webkit-text-fill-color:#171c3a !important}.duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #909599 !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #747475 !important}.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:hover:not(:disabled){box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus{border-color:#0077b3 !important;outline:0;box-shadow:0 0 0 1px #0077b3 !important;transition:none}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus{border-color:#171c3a !important;box-shadow:0 0 0 1px #171c3a !important}.duet-theme-turva.sc-duet-input .duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#171c3a}.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input.sc-duet-input:focus{box-shadow:0 0 0 1px #e02a0d}.duet-input.sc-duet-input:focus+.duet-input-icon.sc-duet-input{color:#0077b3}.duet-input[type=search].sc-duet-input:not(:placeholder-shown):focus+.duet-input-icon.sc-duet-input{display:none}.duet-input.sc-duet-input:not(:focus):not(:hover):invalid{box-shadow:none !important}.duet-input[type=number].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=number].sc-duet-input::-webkit-outer-spin-button,.duet-input[type=time].sc-duet-input::-webkit-inner-spin-button,.duet-input[type=time].sc-duet-input::-webkit-outer-spin-button{display:none;margin:0;-webkit-appearance:none}.duet-input.sc-duet-input::-webkit-search-cancel-button{margin-right:-28px}.duet-input-help.sc-duet-input{display:block;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.875rem;font-weight:400;line-height:1.25;color:#657787;border-radius:4px}.duet-input-help.sc-duet-input span.sc-duet-input{display:block;margin-top:8px}.duet-theme-turva.sc-duet-input .duet-input-help.sc-duet-input{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#747475}.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#de2362}.duet-theme-turva.has-error.sc-duet-input .duet-input-help.sc-duet-input{color:#e02a0d}.duet-label-hidden.sc-duet-input duet-label.sc-duet-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-input-relative.sc-duet-input{position:relative;width:100%}.duet-input-variation-button.sc-duet-input{position:relative;width:100%}.duet-input-variation-button.sc-duet-input .duet-input-relative.sc-duet-input{display:flex;flex-direction:row;flex-wrap:nowrap;align-content:center;align-items:center;justify-content:flex-start;width:auto}.duet-input-variation-button.sc-duet-input .duet-input-relative.sc-duet-input duet-button.sc-duet-input{z-index:250;margin-bottom:0}.duet-input-variation-button.sc-duet-input .duet-input-relative.sc-duet-input .duet-input.sc-duet-input{border-right-width:0 !important;border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}';var icons={search:formSearch,email:formEmail};var DuetInput=function(){function t(t){var e=this;registerInstance(this,t);this.duetInput=createEvent(this,"duetInput",7);this.duetChange=createEvent(this,"duetChange",3);this.duetBlur=createEvent(this,"duetBlur",7);this.duetClear=createEvent(this,"duetClear",7);this.duetFocus=createEvent(this,"duetFocus",7);this.inputId=createID("DuetInput");this.clearId=createID("DuetInputClear");this.labelId=createID("DuetLabel");this.topCaptionId=createID("DuetCaptionTop");this.topCaptionPlaceholderId=createID("DuetCaptionPlaceholderTop");this.errorId=createID("DuetError");this.disallowPatternRegex=null;this.clearLabel=getLocaleString({en:"Clear",fi:"Tyhjennä",sv:"Rensa"});this.timeAnnouncement=getLocaleString({en:"Time",fi:"Aika",sv:"Tid"});this.accessibleDescribedBy="";this.accessibleHasPopup=undefined;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.debounce=0;this.clear=false;this.echoPlaceholder=false;this.theme="";this.expand=false;this.disabled=false;this.margin="auto";this.required=false;this.type="text";this.variation="default";this.label="label";this.error="";this.labelHidden=false;this.numericKeyboard=false;this.component="input";this.autoComplete="on";this.disallowPattern=null;this.tooltip="";this.tooltipDirection="auto";this.onInput=function(t){if(e.disallowPatternRegex){cleanValue(e.nativeInput,e.disallowPatternRegex)}e.value=e.nativeInput.value||"";e.duetInput.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.onBlur=function(t){e.duetBlur.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.onFocus=function(t){e.duetFocus.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.onClear=function(t){e.duetFocus.emit({originalEvent:t,value:e.value,component:"duet-input"})};this.getDescribedBy=function(){var t="";if(e.isCaptionVisible&&e.topCaptionId){t=e.topCaptionId;if(e.accessibleDescribedBy){t+=" "+e.accessibleDescribedBy}}else if(e.accessibleDescribedBy.length>0){t=e.accessibleDescribedBy}else{t=undefined}return t};this.handleClearClick=function(t){var i=e.clearInput();e.onClear(t);return i};this.keyHandler=function(t){if(isEscapeKey(t)&&e.clear){e.handleClearClick(t)}return t}}t.prototype.disallowedPatternChange=function(){this.disallowPatternRegex=this.disallowPattern?new RegExp(this.disallowPattern,"g"):null};t.prototype.valueChanged=function(){var t=this;var e;if(((e=this===null||this===void 0?void 0:this.nativeInput)===null||e===void 0?void 0:e.value)!==this.value){var i=resetCursor(this.nativeInput);this.nativeInput.value=this.value;i()}this.isCaptionVisible=!!this.caption;var n=function(){return t.duetChange.emit({value:t.value,component:"duet-input"})};if(this.debounce===0){n()}else{clearTimeout(this.timeoutId);this.timeoutId=setTimeout(n,this.debounce)}};t.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.disallowedPatternChange();this.isCaptionVisible=!!this.caption};t.prototype.setFocus=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.nativeInput){this.nativeInput.focus(t)}return[2]}))}))};t.prototype.resetCursor=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){if(this.nativeInput){t=resetCursor(this.nativeInput);this.nativeInput.value=this.value;t()}return[2]}))}))};t.prototype.clearInput=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.nativeInput){this.nativeInput.value="";this.value=""}return[2]}))}))};t.prototype.render=function(){var t;var e=this;var i=this.identifier||this.inputId;var n={};if(this.numericKeyboard){n.inputmode="numeric"}if(this.pattern&&this.type!=="tel"){n.pattern=this.pattern}else if(!this.pattern&&this.type==="tel"){n.pattern="[0-9+ ]+"}var a;if(this.value){a=new Date;try{a.setHours(Number(this.value.slice(0,2)),Number(this.value.slice(3,5)),0,0)}catch(o){a=undefined}}return h(Host,{class:{"duet-expand":this.expand,"duet-m-0":this.margin==="none"},onKeyUp:function(t){return e.keyHandler(t)}},this.type==="time"&&h("duet-visually-hidden",{"aria-live":"polite","aria-atomic":"true"},a?"".concat(this.timeAnnouncement," ").concat(a.toLocaleTimeString()):""),h("div",{class:(t={"duet-input-container":true,"duet-theme-turva":this.theme==="turva"},t["duet-input-variation-".concat(this.variation)]=true,t["duet-label-hidden"]=this.labelHidden,t["duet-input-top-caption-shown"]=this.isCaptionVisible,t["has-icon"]=!!this.icon||this.type!=="text"&&this.type!=="tel"&&this.type!=="password"&&this.type!=="time",t["has-error"]=!!this.error,t["has-clear"]=this.clear,t)},h("duet-label",{theme:this.theme==="turva"?"turva":"default",class:{"duet-has-tooltip":!!this.tooltip},margin:this.isCaptionVisible?"small":"auto",id:this.labelId,for:i},this.label),this.tooltip&&h("duet-tooltip",{direction:this.tooltipDirection,accessibleInputLabel:this.label},this.tooltip),this.caption&&h("duet-caption",{id:this.topCaptionId,size:"medium"},this.caption),h("div",{class:"duet-input-relative"},this.placeholder&&this.echoPlaceholder&&(this.value||this.type==="time")&&h("duet-caption",{id:this.topCaptionPlaceholderId,class:"duet-input-placeholder",margin:"none",size:"small"},this.placeholder),h("input",Object.assign({ref:function(t){return e.nativeInput=t},onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,type:this.type,class:{"duet-input":true,disabled:this.disabled,"is-number":this.component==="number","is-date":this.component==="date"},value:this.value,disabled:this.disabled,"aria-invalid":this.error?"true":"false","aria-labelledby":this.accessibleLabelledBy?"".concat(this.labelId," ").concat(this.errorId," ").concat(this.accessibleLabelledBy):"".concat(this.labelId," ").concat(this.errorId),"aria-controls":this.accessibleControls,"aria-autocomplete":this.accessibleAutocomplete,"aria-activedescendant":this.accessibleActiveDescendant,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,"aria-expanded":this.accessibleExpanded,"aria-haspopup":this.accessibleHasPopup,"aria-owns":this.accessibleOwns,"aria-describedby":this.getDescribedBy(),placeholder:this.placeholder,spellcheck:"false",minlength:this.minlength,maxlength:this.maxlength,autocomplete:this.autoComplete,required:this.required,role:this.role,name:this.name,id:i},n)),!this.icon&&this.type!=="text"&&this.type!=="tel"&&this.type!=="password"&&this.type!=="time"&&this.variation!=="button"&&h("div",{class:"duet-input-icon"},h("duet-icon",{margin:"none",size:"small",icon:icons[this.type].svg,color:"currentColor"})),this.clear&&this.value&&h("div",{class:"duet-input-clear-icon"},h("button",{onClick:this.handleClearClick,id:this.clearId,"aria-label":this.clearLabel,"aria-keyshortcuts":"Escape"},h("duet-icon",{margin:"none",size:"xx-small",name:"activity-close",color:"currentColor"}))),this.icon&&this.variation!=="button"&&h("div",{class:"duet-input-icon"},h("duet-icon",{margin:"none",size:"small",name:this.icon,color:"currentColor"})),this.variation==="button"&&h("slot",{name:"button"}),h("slot",null)),h("span",{class:"duet-input-help",id:this.errorId,"aria-live":"assertive","aria-relevant":"additions removals"},this.error&&h("span",{class:"duet-input-error"},this.error))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disallowPattern:["disallowedPatternChange"],value:["valueChanged"]}},enumerable:false,configurable:true});return t}();DuetInput.style=duetInputCss;var duetLabelCss='*.sc-duet-label,*.sc-duet-label::after,*.sc-duet-label::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-label-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:12px !important;position:relative;z-index:100;display:inline-flex;width:auto;margin-top:8px !important;line-height:1.25;cursor:default}.duet-p-0.sc-duet-label-h{padding:0 !important}.duet-m-0.sc-duet-label-h{margin:0 !important}.duet-m-0.sc-duet-label-h{margin-bottom:0 !important}.duet-small-margin.sc-duet-label-h{margin-top:8px !important;margin-bottom:4px !important}.duet-has-tooltip.sc-duet-label-h{padding-right:48px}@media (min-width: 48em){.duet-has-tooltip.sc-duet-label-h{padding-right:0}}label.sc-duet-label{margin:0;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:600 !important;line-height:1.25;color:#00294d;text-align:left;word-break:break-word}label.sc-duet-label span.sc-duet-label{font-size:1rem;font-weight:600 !important;word-break:break-word}.duet-label-small.sc-duet-label-h label.sc-duet-label{font-size:0.875rem}.duet-label-small.sc-duet-label-h label.sc-duet-label span.sc-duet-label{font-size:0.875rem}.duet-theme-turva.sc-duet-label-h label.sc-duet-label{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}';var DuetLabel=function(){function t(t){registerInstance(this,t);this.theme="";this.margin="auto";this.size="medium"}t.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};t.prototype.render=function(){return h(Host,{class:{"duet-label":true,"duet-label-small":this.size==="small","duet-theme-turva":this.theme==="turva","duet-small-margin":this.margin==="small","duet-m-0":this.margin==="none"}},h("label",{htmlFor:this.for},h("span",null,h("slot",null))))};return t}();DuetLabel.style=duetLabelCss;export{DuetInput as duet_input,DuetLabel as duet_label};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-d5956898.js";import{i as isInternetExplorer}from"./is-internet-explorer-62b3bdbd.js";var duetLayoutCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;flex:1 0 auto;width:100%}:host(.duet-middle){display:flex}:host(.duet-middle) .duet-layout{padding:36px 28px !important}@media (min-width: 36em){:host(.duet-middle) .duet-layout{padding:48px 36px !important}}@media (min-width: 62em){:host(.duet-middle) .duet-layout{padding:56px !important}}:host(.duet-ie){height:100%}:host(.duet-middle.duet-ie){height:auto}.duet-layout{position:relative;padding:0 16px;margin:48px auto 36px}@media (min-width: 36em){.duet-layout{margin-top:72px}}.duet-layout.duet-layout-has-top{margin-top:0}.duet-layout.duet-m-0{margin-top:0 !important;margin-bottom:0 !important}.duet-layout.duet-center{display:flex;align-items:center;justify-content:center;width:100%;max-width:888px}@media (min-width: 36em){.duet-layout.duet-center{padding:0 48px}}@media (min-width: 48em){.duet-layout.duet-center{padding:0 72px}}@media (min-width: 62em){.duet-layout.duet-center{width:100%}}@media (min-width: 36em){.duet-layout{padding:0 28px}}@media (min-width: 62em){.duet-layout{display:flex;flex-direction:row;padding:0 56px;margin-bottom:48px}}@media (min-width: 76.25em){.duet-layout{max-width:1110px;padding:0}}.duet-main,.duet-sidebar,.duet-layout-top,.duet-layout-bottom{display:block;width:100%}.duet-layout-top{position:relative;display:block;width:100%;margin:72px auto 0}.duet-layout-top.duet-m-0{margin-top:0 !important;margin-bottom:0 !important}.duet-layout-top .duet-layout-top-wrapper{padding:0 20px;margin:0 auto}@media (min-width: 36em){.duet-layout-top .duet-layout-top-wrapper{padding:0 28px}}@media (min-width: 62em){.duet-layout-top .duet-layout-top-wrapper{padding:0 56px}}@media (min-width: 76.25em){.duet-layout-top .duet-layout-top-wrapper{max-width:1110px;padding:0}}.duet-center .duet-layout-top-wrapper{max-width:888px}@media (min-width: 36em){.duet-center .duet-layout-top-wrapper{padding:0 48px}}@media (min-width: 48em){.duet-center .duet-layout-top-wrapper{padding:0 72px}}@media (min-width: 62em){.duet-main{min-width:600px;margin:0 auto}.has-sidebar .duet-main{max-width:734px;margin-right:20px}}@media (min-width: 62em){.duet-sidebar{min-width:256px;max-width:356px}}@media (min-width: 62em){.duet-sidebar-container{width:auto;max-width:356px}}@media (min-width: 62em){.duet-sidebar-container.has-tabs{margin-top:89px}}@media (min-width: 62em){.duet-sidebar-container.sticky{position:sticky}.duet-sidebar-container.sticky.with-links{top:calc(3rem + 20px)}.duet-sidebar-container.sticky.without-links{top:calc(4rem + 20px)}}";var DuetLayout=function(){function t(t){registerInstance(this,t);this.hasSidebar=false;this.hasTop=false;this.sticky=false;this.margin="auto";this.stickyDistance="with-links";this.center=false;this.tabs=false;this.middle=false}t.prototype.componentWillLoad=function(){this.hasSidebar=!!this.element.querySelector("[slot='sidebar']");this.hasTop=!!this.element.querySelector("[slot='top']");if(!this.element.querySelector("[slot='main']")){console.warn("[DUET WARNING]: Nothing passed to <duet-layout> named slots. Please use one of 'main', 'sidebar' or 'top' to display contents.")}};t.prototype.render=function(){var t;return h(Host,{class:{"duet-middle":this.middle,"duet-ie":isInternetExplorer()}},this.hasTop&&h("div",{class:{"duet-layout-top":true,"duet-m-0":this.margin==="none","duet-center":this.center}},h("div",{class:"duet-layout-top-wrapper"},h("slot",{name:"top"}))),h("div",{class:{"duet-layout":true,"duet-layout-has-top":this.hasTop,"has-sidebar":this.hasSidebar,"duet-m-0":this.margin==="none","duet-center":this.center}},h("main",{class:"duet-main"},h("slot",{name:"main"})),this.hasSidebar&&h("aside",{class:"duet-sidebar"},h("div",{class:(t={"duet-sidebar-container":true,"has-tabs":this.tabs,sticky:this.sticky},t[this.stickyDistance]=this.sticky,t)},h("slot",{name:"sidebar"})))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();DuetLayout.style=duetLayoutCss;export{DuetLayout as duet_layout};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function r(t){try{d(n.next(t))}catch(e){a(e)}}function s(t){try{d(n["throw"](t))}catch(e){a(e)}}function d(t){t.done?i(t.value):o(t.value).then(r,s)}d((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(t){return function(e){return d([t,e])}}function d(r){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,o&&(a=r[0]&2?o["return"]:r[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,r[1])).done)return a;if(o=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){i.label=r[1];break}if(r[0]===6&&i.label<a[1]){i.label=a[1];a=r;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(r);break}if(a[2])i.ops.pop();i.trys.pop();continue}r=e.call(t,i)}catch(s){r=[6,s];o=0}finally{n=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,h,g as getElement,H as Host}from"./index-
|
|
4
|
+
*/import{r as registerInstance,h,g as getElement,H as Host}from"./index-d5956898.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{w as watchForOptions}from"./watch-options-dd55bce8.js";var duetListCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-list-component{margin-bottom:16px !important;width:100%}.duet-list-component.duet-p-0{padding:0 !important}.duet-list-component.duet-m-0{margin:0 !important}";var DuetList=function(){function t(t){registerInstance(this,t);this.theme="";this.margin="auto";this.padding="auto";this.mobile="left";this.breakpoint="small";this.variation="default";this.labelWidth="30"}t.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){t=this.element;this.mutationO=watchForOptions(t,"duet-list-item",(function(){e.updateListItems()}));this.updateListItems();return[2]}))}))};t.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}};t.prototype.toggleClass=function(t,e,i){if(i){t.classList.add(e)}else{t.classList.remove(e)}};t.prototype.updateListItems=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){t=Array.from(this.element.querySelectorAll("duet-list-item"));t.forEach((function(t){t.classList.add("duet-list-width-".concat(e.labelWidth));t.classList.add("duet-list-variation-".concat(e.variation));e.toggleClass(t,"duet-p-0",e.padding==="none");e.toggleClass(t,"duet-list-mobile-center",e.mobile==="center");e.toggleClass(t,"duet-list-breakpoint-large",e.breakpoint==="large");e.toggleClass(t,"duet-list-striped",e.variation==="striped");e.toggleClass(t,"duet-theme-turva",e.theme==="turva")}));return[2]}))}))};t.prototype.render=function(){return h("dl",{class:{"duet-list-component":true,"duet-m-0":this.margin==="none"}},h("slot",null))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{theme:["updateListItems"],padding:["updateListItems"],mobile:["updateListItems"],breakpoint:["updateListItems"],variation:["updateListItems"],labelWidth:["updateListItems"]}},enumerable:false,configurable:true});return t}();DuetList.style=duetListCss;var duetListItemCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:flex;flex-flow:row;width:100%;overflow:visible;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-style:normal;font-weight:400;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d}@media (max-width: 35.9375em){:host{flex-wrap:wrap}}:host dt,:host dd{margin-inline-start:0;-webkit-hyphens:auto;hyphens:auto;text-align:left;word-break:break-all;word-break:break-word}@media (max-width: 35.9375em){:host dt,:host dd{flex:inherit;flex-basis:100% !important;width:100%;padding-bottom:4px !important}}:host dt{padding:16px !important;font-weight:600}@media (max-width: 35.9375em){:host dt{padding-bottom:4px !important}}.duet-theme-turva :host dt{font-weight:700}:host dd{padding:16px !important;margin-left:auto;text-align:left}@media (max-width: 35.9375em){:host dd{padding-top:0 !important}}:host(:not(.duet-list-striped)) dt{padding:8px !important;padding-left:0 !important}@media (max-width: 35.9375em){:host(:not(.duet-list-striped)) dt{padding-bottom:4px !important}}:host(:not(.duet-list-striped)) dd{padding:8px !important;padding-left:0 !important}@media (max-width: 35.9375em){:host(:not(.duet-list-striped)) dd{padding-top:0 !important}}:host(.duet-theme-turva){font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}:host(.duet-list-striped:nth-child(odd)) dt,:host(.duet-list-striped:nth-child(odd)) dd{background:#f5f8fa}:host(.duet-list-striped.duet-theme-turva:nth-child(odd)) dt,:host(.duet-list-striped.duet-theme-turva:nth-child(odd)) dd{background:#f5f5f7}:host(.duet-list-width-30) dt{flex-basis:33%}:host(.duet-list-width-30) dd{flex-basis:67%}:host(.duet-list-width-50) dt{flex-basis:47%}:host(.duet-list-width-50) dd{flex-basis:53%}:host(.duet-list-width-70) dt{flex-basis:65%}:host(.duet-list-width-70) dd{flex-basis:35%}:host(.duet-p-0) dt,:host(.duet-p-0) dd{padding-top:0 !important;padding-bottom:4px !important}@media (max-width: 35.9375em){:host(.duet-list-mobile-center) dt,:host(.duet-list-mobile-center) dd{text-align:center}}@media (max-width: 61.9375em){:host(.duet-list-breakpoint-large){flex-wrap:wrap}:host(.duet-list-breakpoint-large) dt,:host(.duet-list-breakpoint-large) dd{flex:inherit;flex-basis:100% !important;width:100%;padding-bottom:4px !important}:host(.duet-list-breakpoint-large) dd{padding-top:0 !important}}:host(.duet-list-breakpoint-large.duet-list-striped) dd{padding-bottom:16px !important}@media (max-width: 61.9375em){:host(.duet-list-breakpoint-large.duet-list-mobile-center) dt,:host(.duet-list-breakpoint-large.duet-list-mobile-center) dd{text-align:center !important}}';var DuetListItem=function(){function t(t){registerInstance(this,t)}t.prototype.render=function(){return h(Host,null,h("dt",null,h("slot",{name:"label"})),h("dd",null,h("slot",{name:"value"})))};return t}();DuetListItem.style=duetListItemCss;export{DuetList as duet_list,DuetListItem as duet_list_item};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function a(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function d(e){try{s(o.next(e))}catch(t){n(t)}}function l(e){try{s(o["throw"](e))}catch(t){n(t)}}function s(e){e.done?i(e.value):a(e.value).then(d,l)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,a,n,d;return d={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(d[Symbol.iterator]=function(){return this}),d;function l(e){return function(t){return s([e,t])}}function s(d){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,a&&(n=d[0]&2?a["return"]:d[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,d[1])).done)return n;if(a=0,n)d=[d[0]&2,n.value];switch(d[0]){case 0:case 1:n=d;break;case 4:i.label++;return{value:d[1],done:false};case 5:i.label++;a=d[1];d=[0];continue;case 7:d=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(d[0]===6||d[0]===2)){i=0;continue}if(d[0]===3&&(!n||d[1]>n[0]&&d[1]<n[3])){i.label=d[1];break}if(d[0]===6&&i.label<n[1]){i.label=n[1];n=d;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(d);break}if(n[2])i.ops.pop();i.trys.pop();continue}d=t.call(e,i)}catch(l){d=[6,l];a=0}finally{o=n=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-d5956898.js";import{d as disableBodyScroll,e as enableBodyScroll}from"./bodyScrollLock.es6-61b5e9a4.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{f as focusElement,F as FocusGuard}from"./focus-utils-4ca66786.js";import{f as isEscapeKey}from"./keyboard-utils-88ea1007.js";import{a as getLanguage,g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var duetModalCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:900;max-height:100vh;overflow-y:auto;visibility:hidden;background:rgba(0, 41, 77, 0.85);opacity:0;transition:300ms ease;transition-delay:200ms}.duet-modal-overlay.duet-theme-turva{background:rgba(23, 28, 58, 0.85)}.duet-modal-overlay.duet-modal-active{visibility:visible;opacity:1;transition:300ms ease;transition-delay:0s}.duet-modal-overlay.duet-disable-transitions{transition:none}::slotted(img){width:100%}.duet-modal-inner{display:flex;align-items:center;width:100%;min-height:100%;padding:20px 16px}@media (min-width: 36em){.duet-modal-inner{padding:48px 16px}}@media (max-width: 35.9375em){.duet-modal-inner.duet-modal-large{padding-right:0;padding-left:0}}.duet-modal{position:relative;width:100%;max-width:686px;margin:auto;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-weight:400;font-variant-numeric:tabular-nums;line-height:1.5;color:#00294d;background:white;border-radius:4px;opacity:0;transition:300ms ease;transition-delay:0ms;transform:scale(0.96)}.duet-theme-turva .duet-modal{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}.duet-modal-active .duet-modal{opacity:1;transition:300ms ease;transition-delay:200ms;transform:none}.duet-disable-transitions .duet-modal{transition:none}.duet-modal.small{max-width:545px}.duet-modal.large{max-width:100%}@media (min-width: 36em){.duet-modal.large{max-width:1110px}}.duet-modal:focus{outline:0}.duet-modal-body{width:100%;padding:36px 28px}.duet-modal-body.duet-modal-gutter-small{padding:36px 20px}.duet-modal-body.duet-modal-gutter-large{padding:48px 36px}@media (max-width: 22.5em){.duet-modal-body{padding:36px 20px}.duet-modal-body.duet-modal-gutter-large{padding:48px 28px}}@media (max-width: 35.9375em){.duet-modal-body{padding:36px 20px}.duet-modal-body.duet-modal-gutter-large{padding:48px 36px}}@media (min-width: 36em){.duet-modal-body{padding:36px}.duet-modal-body.duet-modal-gutter-large{padding:28px 72px}}@media (min-width: 48em){.duet-modal-body{padding:36px 72px}.duet-modal-body.duet-modal-gutter-large{padding:36px 72px}}@media (min-width: 76.25em){.duet-modal-body{padding:36px 48px 48px}.duet-modal-body.duet-modal-gutter-large{padding:48px 94px}.small .duet-modal-body{padding:36px 48px}}.duet-modal-header{text-align:center}.duet-modal-close{position:absolute;top:12px;right:12px}.duet-modal-heading{width:100%;padding-right:60px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1.25rem;font-style:normal;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.25;color:#00294d;text-decoration:none;text-overflow:ellipsis;letter-spacing:-0.01rem;white-space:nowrap}.duet-modal-heading.duet-p-0{padding:0 !important}.duet-modal-heading.duet-m-0{margin:0 !important}';var TRANSITION_MS=600;var DuetModal=function(){function e(e){registerInstance(this,e);this.duetOpen=createEvent(this,"duetOpen",7);this.duetClose=createEvent(this,"duetClose",7);this.duetBeforeClose=createEvent(this,"duetBeforeClose",7);var t,i;this.modalId=createID("DuetModal");this.slotDefaultId=createID("DuetModal-default-slot");this.isAndroidDevice=((i=(t=navigator===null||navigator===void 0?void 0:navigator.userAgent)===null||t===void 0?void 0:t.toLowerCase())===null||i===void 0?void 0:i.indexOf("android"))>-1||null;this.isSafariBrowser=/^((?!chrome|android).)*safari/i.test(navigator===null||navigator===void 0?void 0:navigator.userAgent);this.handleAndroidResizeEvents=function(){if(document.activeElement.tagName=="INPUT"){window.setTimeout((function(){var e;try{(e=document===null||document===void 0?void 0:document.activeElement)===null||e===void 0?void 0:e.scrollIntoViewIfNeeded(true)}catch(t){}}),100)}};this.open=false;this.language=getLanguage();this.accessibleCloseLabelDefaults={fi:"Sulje ikkuna",sv:"Stäng fönstret",en:"Close the dialog"};this.accessibleCloseLabel=getLocaleString(this.accessibleCloseLabelDefaults,this.language);this.size="medium";this.accessibleDetails=undefined;this.accessibleDescription=undefined;this.gutterSize="medium";this.theme="";this.heading="";this.headingLevel="h3";this.icon="";this.color="";this.active=false;this.closeOnBlur=false}e.prototype.openChanged=function(){var e=this;if(this.open){if(this.modalEl&&this.modalEl.scrollTop){this.modalEl.scrollTop=0}this.focusedElBeforeOpen=document.activeElement;disableBodyScroll(this.modalEl,{reserveScrollBarGap:true});setTimeout((function(){e.buttonEl.setFocus()}),TRANSITION_MS);setTimeout((function(){e.modalEl.classList.add("duet-disable-transitions")}),TRANSITION_MS+200);if(this.isAndroidDevice){window.addEventListener("resize",this.handleAndroidResizeEvents)}this.duetOpen.emit()}else{this.modalEl.classList.remove("duet-disable-transitions");enableBodyScroll(this.modalEl);this.duetClose.emit();setTimeout((function(){focusElement(e.focusedElBeforeOpen)}),TRANSITION_MS);if(this.isAndroidDevice){window.removeEventListener("resize",this.handleAndroidResizeEvents)}}};e.prototype.activeChanged=function(){this.open=this.active};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.componentDidLoad=function(){if(this.active){this.open=true;this.modalEl.classList.add("duet-disable-transitions")}};e.prototype.disconnectedCallback=function(){enableBodyScroll(this.modalEl)};e.prototype.handleKeyUp=function(e){if(this.open){if(isEscapeKey(e)){this.closeModal(e)}}};e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.open=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.open=false;return[2]}))}))};e.prototype.closeModal=function(e){var t=this;this.duetBeforeClose.emit({originalEvent:e,component:"duet-modal"});if(!e.defaultPrevented){setTimeout((function(){t.hide()}),1)}};e.prototype.render=function(){var e;var t=this;var i="primary";var o="secondary";if(this.theme==="turva"){i="primary-turva";o="secondary-turva"}return h("div",{ref:function(e){return t.modalEl=e},"aria-labelledby":this.heading?this.modalId:false,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,"aria-describedby":this.accessibleDescribedBy?"".concat(this.slotDefaultId," ").concat(this.accessibleDescribedBy):this.slotDefaultId,role:"dialog","aria-modal":this.isSafariBrowser?false:true,tabindex:"-1","aria-flowto":this.slotDefaultId,class:{"duet-modal-overlay":true,"duet-theme-turva":this.theme==="turva","duet-modal-active":this.open}},h(FocusGuard,{moveFocusTo:this.buttonEl}),h("div",{class:{"duet-modal-inner":true,"duet-modal-large":this.size==="large"},role:"document",onClick:function(e){if(t.closeOnBlur){t.closeModal(e)}}},h("div",{class:(e={"duet-modal":true},e[this.size]=true,e),onClick:function(e){if(t.closeOnBlur){e.stopPropagation()}}},h("duet-spacer",null),h("div",{class:"duet-modal-close"},h("duet-button",{ref:function(e){return t.buttonEl=e},variation:"plain",accessibleLabel:this.accessibleCloseLabel,color:o,iconSize:"large",icon:"navigation-close",iconOnly:true,margin:"none",theme:this.theme,onClick:function(e){return t.closeModal(e)},fixed:true})),h("div",{class:{"duet-modal-body":true,"duet-modal-gutter-small":this.gutterSize==="small","duet-modal-gutter-medium":this.gutterSize==="medium","duet-modal-gutter-large":this.gutterSize==="large"}},h("div",{class:"duet-modal-header"},h("span",{class:"duet-modal-inner-slot-top"},h("slot",{name:"top"})),this.icon&&h("duet-icon",{name:this.icon,size:"xx-large",color:this.color||i}),this.heading&&h("duet-heading",{level:this.headingLevel,theme:this.theme,id:this.modalId},this.heading)),h("span",{class:"duet-modal-inner-slot-default",id:this.slotDefaultId},h("slot",null))))),h(FocusGuard,{moveFocusTo:this.buttonEl}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{open:["openChanged"],active:["activeChanged"]}},enumerable:false,configurable:true});return e}();DuetModal.style=duetModalCss;export{DuetModal as duet_modal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function n(e){try{s(o.next(e))}catch(t){a(t)}}function d(e){try{s(o["throw"](e))}catch(t){a(t)}}function s(e){e.done?i(e.value):r(e.value).then(n,d)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,n;return n={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function d(e){return function(t){return s([e,t])}}function s(n){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,r&&(a=n[0]&2?r["return"]:n[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;if(r=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;r=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){i.label=n[1];break}if(n[0]===6&&i.label<a[1]){i.label=a[1];a=n;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(n);break}if(a[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(d){n=[6,d];r=0}finally{o=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,h,g as getElement}from"./index-bcca1cb8.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{a as getLanguage,g as getLocaleString}from"./language-utils-bf701d37.js";import{a as actionArrowDownSmall}from"./action-arrow-down-small-82273dc8.js";import"./string-utils-5954f458.js";var duetNotificationCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";var DuetNotification=function(){function e(e){registerInstance(this,e);this.language=getLanguage();this.accessibleLabelUnreadDefaults={en:"Unread",fi:"Lukematon",sv:"Oläst"};this.accessibleLabelUnread=getLocaleString(this.accessibleLabelUnreadDefaults,this.language);this.url="#";this.date="";this.highlight=false;this.external=false;this.theme=""}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.linkElement.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",{role:"listitem",class:{"duet-notification":true,"duet-notification-highlight":this.highlight,"duet-theme-turva":this.theme==="turva"}},h("a",{ref:function(t){return e.linkElement=t},href:this.url,target:this.external?"_blank":"_self"},h("div",{class:"duet-notification-container"},h("div",{class:"duet-notification-badge-container"},this.highlight&&h("div",{class:"duet-notification-badge"},h("duet-visually-hidden",null,this.accessibleLabelUnread,":"))),h("div",{class:"duet-notification-content"},h("slot",null)),h("div",{class:"duet-notification-date"},this.date))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetNotification.style=duetNotificationCss;var duetNotificationDrawerCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background-color:white;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a;background-color:white;border-color:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:"";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:white;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:white;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}';var ESC_KEY=27;var DuetNotificationDrawer=function(){function e(e){var t=this;registerInstance(this,e);this.isOpen=false;this.icon="";this.label="Label";this.language=getLanguage();this.accessibleLabelNotificationsDefaults={en:"No notifications",fi:"Ei ilmoituksia",sv:"Inga notifikationer"};this.accessibleLabelNotifications=getLocaleString(this.accessibleLabelNotificationsDefaults);this.badge=false;this.theme="";this.direction="left";this.handleKeyDown=function(e){if(t.isOpen&&e.keyCode===ESC_KEY){t.close()}};this.toggleMenu=function(e){e.stopPropagation();t.isOpen?t.close():t.open()};this.updateNotificationState=function(){t.hasNotifications=t.element.children.length>0}}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.updateNotificationState()};e.prototype.connectedCallback=function(){this.observer=new MutationObserver(this.updateNotificationState);this.observer.observe(this.element,{childList:true})};e.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null};e.prototype.handleClickFocusOutside=function(e){var t=e.target;if(this.isOpen&&!this.element.contains(t)){this.close(false)}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.drawerButtonEl.focus(e);return[2]}))}))};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.closest("duet-header");if(e){e.closeMenus()}this.isOpen=true;this.drawerContentEl.scrollTop=0;return[2]}))}))};e.prototype.close=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isOpen=false;if(e){this.setFocus({preventScroll:true})}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",{class:{"duet-drawer":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:this.handleKeyDown},h("button",{ref:function(t){return e.drawerButtonEl=t},type:"button",class:"duet-drawer-toggle",id:"duet-drawer-toggle","aria-controls":"duet-drawer-content","aria-expanded":this.isOpen?"true":"false",onClick:this.toggleMenu},this.icon&&h("div",{class:"duet-drawer-icon"},h("duet-icon",{margin:"none",size:"x-small",name:this.icon,color:"currentColor"}),this.badge&&h("div",{class:"duet-drawer-badge"})),h("span",{class:"duet-drawer-label"},this.label),h("div",{class:"duet-drawer-caret"},h("duet-icon",{margin:"none",size:"auto",icon:actionArrowDownSmall.svg,color:"currentColor"}))),h("div",{id:"duet-drawer-content",class:{"duet-drawer-content":true,"duet-drawer-right":this.direction==="right","duet-drawer-left":this.direction==="left","duet-drawer-open":this.isOpen},ref:function(t){return e.drawerContentEl=t}},this.hasNotifications?h("div",{role:"list"},h("slot",null)):h("duet-empty-state",{size:"small"},h("duet-paragraph",{size:"small",margin:"none"},this.accessibleLabelNotifications))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetNotificationDrawer.style=duetNotificationDrawerCss;export{DuetNotification as duet_notification,DuetNotificationDrawer as duet_notification_drawer};
|
|
4
|
+
*/import{r as registerInstance,h,g as getElement}from"./index-d5956898.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{a as getLanguage,g as getLocaleString}from"./language-utils-bf701d37.js";import{a as actionArrowDownSmall}from"./action-arrow-down-small-82273dc8.js";import"./string-utils-5954f458.js";var duetNotificationCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-notification{display:block;padding:16px;color:#00294d;cursor:pointer;border-bottom:1px solid #e1e3e6;transition:300ms ease}:host(:last-of-type) .duet-notification{border-bottom:0}.duet-notification.duet-theme-turva{color:#171c3a;border-bottom-color:#e4e4e6}.duet-notification.duet-notification-highlight{font-weight:600;background:#f3f9fc}.duet-notification.duet-notification-highlight.duet-theme-turva{background:#fcf3f4}@media (min-width: 62em){.duet-notification:hover{background:#f3f9fc}.duet-notification:hover.duet-theme-turva{background:#fcf3f4}}.duet-notification a{text-decoration:none}.duet-notification a:focus{outline:0}:host(.user-is-tabbing) .duet-notification:focus-within{z-index:1;box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-notification:focus-within.duet-theme-turva{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-notification-container{position:relative;display:flex}.duet-notification-badge-container{position:relative;width:16px}.duet-notification-badge{position:absolute;top:6px;left:-2px;width:8px;height:8px;background:#0077b3;border-radius:50%}.duet-theme-turva .duet-notification-badge{background:#c60c30}.duet-notification-content{flex:1}.duet-notification-date{position:absolute;top:2px;right:0;width:96px;font-size:0.75rem;font-weight:600;line-height:1.25;color:#657787;text-align:right;text-transform:uppercase}@media (max-width: 35.9375em){.duet-notification-date{width:auto}}.duet-theme-turva .duet-notification-date{color:#444445}::slotted(duet-heading){padding-right:80px !important}::slotted(duet-paragraph){margin-bottom:2px !important}";var DuetNotification=function(){function e(e){registerInstance(this,e);this.language=getLanguage();this.accessibleLabelUnreadDefaults={en:"Unread",fi:"Lukematon",sv:"Oläst"};this.accessibleLabelUnread=getLocaleString(this.accessibleLabelUnreadDefaults,this.language);this.url="#";this.date="";this.highlight=false;this.external=false;this.theme=""}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.linkElement.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",{role:"listitem",class:{"duet-notification":true,"duet-notification-highlight":this.highlight,"duet-theme-turva":this.theme==="turva"}},h("a",{ref:function(t){return e.linkElement=t},href:this.url,target:this.external?"_blank":"_self"},h("div",{class:"duet-notification-container"},h("div",{class:"duet-notification-badge-container"},this.highlight&&h("div",{class:"duet-notification-badge"},h("duet-visually-hidden",null,this.accessibleLabelUnread,":"))),h("div",{class:"duet-notification-content"},h("slot",null)),h("div",{class:"duet-notification-date"},this.date))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetNotification.style=duetNotificationCss;var duetNotificationDrawerCss='*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.duet-drawer{position:relative}@media (min-width: 62em){.duet-drawer{display:inline-block}}.duet-drawer-toggle{position:relative;display:flex;align-items:center;width:100%;height:48px;padding:0 20px;overflow:hidden;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;font-variant-numeric:tabular-nums;line-height:48px;color:#00294d;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background-color:white;border-bottom:1px solid #e1e3e6;border-radius:0;-webkit-appearance:none;appearance:none}@media (min-width: 62em){.duet-drawer-toggle{z-index:200;width:auto;max-width:200px;padding:0 30px 0 12px;overflow:hidden;font-size:0.875rem;line-height:4rem;border:0;border-radius:4px;transition:border 300ms ease}}.duet-theme-turva .duet-drawer-toggle{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a;background-color:white;border-color:#e4e4e6}.duet-drawer-toggle:active{opacity:0.75}.duet-drawer-toggle:focus{outline:0}:host(.user-is-tabbing) .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}:host(.user-is-tabbing) .duet-theme-turva .duet-drawer-toggle:focus{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-drawer-toggle:hover{color:#004d80}.duet-theme-turva .duet-drawer-toggle:hover{color:#444445}.duet-drawer-toggle::after{display:none !important}@media (min-width: 62em){.duet-drawer-toggle::after{position:absolute;top:auto;bottom:0;left:0;display:block !important;width:100%;height:3px;content:"";background:#0077b3;transition:300ms ease;transform:translateY(3px)}.duet-theme-turva .duet-drawer-toggle::after{background:#c60c30}}.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{color:#004d80;border-bottom:1px solid #f5f8fa;border-radius:0}.duet-theme-turva .duet-drawer-toggle[aria-expanded=true],.duet-theme-turva .duet-drawer-toggle[aria-expanded=true]:hover{color:#444445;border-color:#f5f5f7}@media (min-width: 62em){.duet-drawer-toggle[aria-expanded=true],.duet-drawer-toggle[aria-expanded=true]:hover{border:0}.duet-drawer-toggle[aria-expanded=true]::after,.duet-drawer-toggle[aria-expanded=true]:hover::after{left:0;width:100%;transform:translateY(0)}}.duet-drawer-icon{position:relative;display:inline-flex;min-width:12px;margin-right:12px;font-size:0;line-height:normal;vertical-align:baseline}@media (min-width: 62em){.duet-drawer-icon{margin-right:8px}}.duet-drawer-label{line-height:1}.duet-drawer-caret{position:absolute;top:50%;right:20px;display:flex;width:10px;height:10px;margin-left:8px;line-height:normal;pointer-events:none;transition:300ms ease;transform:translateY(-50%);transform-origin:50% 50%}@media (min-width: 62em){.duet-drawer-caret{right:16px;width:7px;height:7px}}.duet-drawer-caret duet-icon{width:10px}.duet-drawer-toggle[aria-expanded=true] .duet-drawer-caret{transform:translateY(-50%) rotate(180deg)}.duet-drawer-badge{position:absolute;top:0;right:0;display:inline-block;width:6px;height:6px;background:#f7b228;border-radius:50%;box-shadow:0 0 0 1px #c18b1f}.duet-theme-turva .duet-drawer-badge{background:#faa40f}.duet-drawer-content{display:none;background-color:white;border-bottom:1px solid #e1e3e6}.duet-drawer-content:focus{outline:0}.duet-theme-turva .duet-drawer-content{background-color:white;border-color:#e1e3e6}@media (min-width: 62em){.duet-drawer-content{position:absolute;top:100%;z-index:600;display:block;width:450px;max-height:420px;padding-left:0;overflow-y:auto;visibility:hidden;background-color:white;border:1px solid #e1e3e6;border-radius:4px;border-top-left-radius:0;border-top-right-radius:0;box-shadow:0 4px 10px 0 rgba(0, 41, 77, 0.15);opacity:0;transition:300ms ease;transform:scale(0.95) translateZ(0) translateY(-10px);transform-origin:50% 0;scrollbar-width:none}.duet-drawer-content::-webkit-scrollbar{display:none}.duet-theme-turva .duet-drawer-content{background-color:white}.duet-drawer-content.duet-drawer-left{right:0}.duet-drawer-content.duet-drawer-right{left:0}}.duet-drawer-content.duet-drawer-open{display:block}@media (min-width: 62em){.duet-drawer-content.duet-drawer-open{visibility:visible;opacity:1;transform:scale(1) translateZ(0) translateY(0)}}';var ESC_KEY=27;var DuetNotificationDrawer=function(){function e(e){var t=this;registerInstance(this,e);this.isOpen=false;this.icon="";this.label="Label";this.language=getLanguage();this.accessibleLabelNotificationsDefaults={en:"No notifications",fi:"Ei ilmoituksia",sv:"Inga notifikationer"};this.accessibleLabelNotifications=getLocaleString(this.accessibleLabelNotificationsDefaults);this.badge=false;this.theme="";this.direction="left";this.handleKeyDown=function(e){if(t.isOpen&&e.keyCode===ESC_KEY){t.close()}};this.toggleMenu=function(e){e.stopPropagation();t.isOpen?t.close():t.open()};this.updateNotificationState=function(){t.hasNotifications=t.element.children.length>0}}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);this.updateNotificationState()};e.prototype.connectedCallback=function(){this.observer=new MutationObserver(this.updateNotificationState);this.observer.observe(this.element,{childList:true})};e.prototype.disconnectedCallback=function(){this.observer.disconnect();this.observer=null};e.prototype.handleClickFocusOutside=function(e){var t=e.target;if(this.isOpen&&!this.element.contains(t)){this.close(false)}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.drawerButtonEl.focus(e);return[2]}))}))};e.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.closest("duet-header");if(e){e.closeMenus()}this.isOpen=true;this.drawerContentEl.scrollTop=0;return[2]}))}))};e.prototype.close=function(e){if(e===void 0){e=true}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.isOpen=false;if(e){this.setFocus({preventScroll:true})}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",{class:{"duet-drawer":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:this.handleKeyDown},h("button",{ref:function(t){return e.drawerButtonEl=t},type:"button",class:"duet-drawer-toggle",id:"duet-drawer-toggle","aria-controls":"duet-drawer-content","aria-expanded":this.isOpen?"true":"false",onClick:this.toggleMenu},this.icon&&h("div",{class:"duet-drawer-icon"},h("duet-icon",{margin:"none",size:"x-small",name:this.icon,color:"currentColor"}),this.badge&&h("div",{class:"duet-drawer-badge"})),h("span",{class:"duet-drawer-label"},this.label),h("div",{class:"duet-drawer-caret"},h("duet-icon",{margin:"none",size:"auto",icon:actionArrowDownSmall.svg,color:"currentColor"}))),h("div",{id:"duet-drawer-content",class:{"duet-drawer-content":true,"duet-drawer-right":this.direction==="right","duet-drawer-left":this.direction==="left","duet-drawer-open":this.isOpen},ref:function(t){return e.drawerContentEl=t}},this.hasNotifications?h("div",{role:"list"},h("slot",null)):h("duet-empty-state",{size:"small"},h("duet-paragraph",{size:"small",margin:"none"},this.accessibleLabelNotifications))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetNotificationDrawer.style=duetNotificationDrawerCss;export{DuetNotification as duet_notification,DuetNotificationDrawer as duet_notification_drawer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,n,a){function u(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function r(e){try{l(a.next(e))}catch(t){i(t)}}function s(e){try{l(a["throw"](e))}catch(t){i(t)}}function l(e){e.done?n(e.value):u(e.value).then(r,s)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,u,i,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(e){return function(t){return l([e,t])}}function l(r){if(a)throw new TypeError("Generator is already executing.");while(n)try{if(a=1,u&&(i=r[0]&2?u["return"]:r[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,r[1])).done)return i;if(u=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:n.label++;return{value:r[1],done:false};case 5:n.label++;u=r[1];r=[0];continue;case 7:r=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){n=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){n.label=r[1];break}if(r[0]===6&&n.label<i[1]){n.label=i[1];i=r;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(r);break}if(i[2])n.ops.pop();n.trys.pop();continue}r=t.call(e,n)}catch(s){r=[6,s];u=0}finally{a=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bcca1cb8.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{a as isArrowRightKey,b as isArrowUpKey,c as isArrowDownKey,d as isArrowLeftKey,e as isBackspaceKey}from"./keyboard-utils-88ea1007.js";import{a as getLanguage,b as getLocale,g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var actionAdd={title:"action-add",tags:"action add plus",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M12 24a.75.75 0 0 1-.75-.75v-10.5H.75a.75.75 0 0 1 0-1.5h10.5V.75a.75.75 0 0 1 1.5 0v10.5h10.5a.75.75 0 0 1 0 1.5h-10.5v10.5A.75.75 0 0 1 12 24z"/></svg>'};var actionSubtract={title:"action-subtract",tags:"action subtract minus remove delete cancel",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M.75 12.788a.75.75 0 0 1 0-1.5h22.5a.75.75 0 0 1 0 1.5z"/></svg>'};function SafeParseFloat(e,t){var n;if(typeof e==="string"){var a=e.replace("−","-").replace("‐","-").replace("−","-").replace("–","-").replace("—","-");if(t){a=ConvertToEnUS(a,t,false)}a=a.replace(/\s+/g,"");a=a.replace(/(?!^-?\d*\.{0,1}\d+$)/g,"");n=parseFloat(a)}if(typeof e==="number"){n=parseFloat(String(e))}if(!isNaN(Number(n))){return Number(n)}if(e===null||e===undefined){return null}throw new Error("Invalid value passed to SafeParseFloat")}function ConvertToEnUS(e,t,n){if(n===void 0){n=false}var a;var u=new Intl.NumberFormat(t).format(1/2).replace(/[0-9]/g,"");var i=new Intl.NumberFormat("en-US").format(1/2).replace(/[0-9]/g,"");var r=new Intl.NumberFormat(t).format(1e3).replace(/[0-9]/g,"");var s=new Intl.NumberFormat("en-US").format(1e3).replace(/[0-9]/g,"");a=e.replace(u,"DECIMALSEPARATOR");if(n){a=a.replace(r,"THOUSANDSEPARATOR")}else{a=a.replace(r,"")}a=a.replace("DECIMALSEPARATOR",i);a=a.replace("THOUSANDSEPARATOR",s);return a}var roundTo=function(e,t){return Math.round(e/t)*t};var clamp=function(e,t,n){return Math.min(Math.max(e,t),n)};var duetNumberInputCss='*.sc-duet-number-input,*.sc-duet-number-input::after,*.sc-duet-number-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-number-input-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;line-height:1.25;text-align:left;vertical-align:bottom}.sc-duet-number-input-h:last-child,.sc-duet-number-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-number-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-number-input-h{width:100% !important}.duet-m-0.sc-duet-number-input-h{margin:0 !important}.duet-number-container.sc-duet-number-input{position:relative;width:100%}.duet-number-buttons.sc-duet-number-input{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;width:96px;height:calc(100% - 2px)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input{position:relative;display:inline-flex;align-items:center;justify-content:center;width:50%;height:100%;text-align:center;cursor:pointer;background:transparent;-webkit-appearance:none;appearance:none}.duet-number-buttons.sc-duet-number-input .duet-number-button[aria-disabled=true].sc-duet-number-input,.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:disabled{pointer-events:none}.duet-number-buttons.sc-duet-number-input .duet-number-button[aria-disabled=true].sc-duet-number-input duet-icon.sc-duet-number-input,.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:disabled duet-icon.sc-duet-number-input{opacity:0.4}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:active duet-icon.sc-duet-number-input{transform:translateY(1px)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{outline:0}.user-is-tabbing.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{z-index:2;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva .user-is-tabbing.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{box-shadow:0 0 0 2px #171c3a}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type{border-left:1px solid #cfd2d4}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:"";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type{border-top-right-radius:4px;border-bottom-right-radius:4px}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type::before{position:absolute;top:20%;left:0;width:1px;height:60%;content:"";background:#e1e3e6}.duet-theme-turva.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type::before{background:linear-gradient(to left, rgba(207, 207, 209, 0.2) 0%, rgba(207, 207, 209, 0.2) 1px, rgba(207, 207, 209, 0.1) 1px, rgba(207, 207, 209, 0) 100%)}.duet-theme-turva.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type::before{background:#e4e4e6}';var DuetNumberInput=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",3);this.duetInput=createEvent(this,"duetInput",3);this.duetBlur=createEvent(this,"duetBlur",7);this.duetFocus=createEvent(this,"duetFocus",7);this.inputId=createID("DuetInput");this.language=getLanguage();this.locale=getLocale(this.language).locale;this.unit=getLocale(this.language).money;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLiveDefaults={fi:"{current} euroa valittuna",en:"{current} euros selected",sv:"{current} euro valt"};this.accessibleLive=getLocaleString(this.accessibleLiveDefaults,this.language);this.accessibleLiveEnabled=true;this.accessibleAddDefaults={fi:"Lisää summaan",en:"Add to the amount",sv:"Lägg till beloppet"};this.accessibleAdd=getLocaleString(this.accessibleAddDefaults,this.language);this.accessibleSubtractDefaults={fi:"Vähennä summasta",en:"Subtract from the amount",sv:"Dra från beloppet"};this.accessibleSubtract=getLocaleString(this.accessibleSubtractDefaults,this.language);this.theme="";this.margin="auto";this.expand=false;this.min=0;this.labelDefaults={fi:"Nimilappu",en:"Label",sv:"Etikett"};this.label=getLocaleString(this.labelDefaults,this.language);this.labelHidden=false;this.max=1e6;this.error="";this.tooltip="";this.step=5e3;this.rounding=true;this.disabled=false;this.required=false;this.handleFocus=function(){t.focusedValue=t.value};this.handleKeyDown=function(e){if(isArrowRightKey(e)||isArrowUpKey(e)){t.add(e)}else if(isArrowDownKey(e)||isArrowLeftKey(e)){t.subtract(e)}else if(isBackspaceKey(e)){t.clearValue()}};this.handleChange=function(e){var n=e.target;if(n&&n.value){var a=SafeParseFloat(n.value,t.locale);if(isNaN(a)||a==null){a=t.min||0}t.setValue(a);t.duetInput.emit({component:"duet-number-input",originalEvent:e,value:SafeParseFloat(t.value,t.locale).toString(),valueAsNumber:a})}else{t.duetInput.emit({component:"duet-number-input",originalEvent:e,value:null,valueAsNumber:null})}};this.handleBlur=function(e){var n=e.target;if(!n){return}if(n.value){var a=SafeParseFloat(n.value,t.locale);if(t.rounding){a=roundTo(a,t.step)}a=clamp(a,t.min,t.max);if(a!==SafeParseFloat(t.value,t.locale)||a!==SafeParseFloat(t.focusedValue,t.locale)){t.setValue(a);t.emitChange(e)}}t.duetChange.emit({originalEvent:e,value:null,valueAsNumber:null,component:"duet-number-input"})};this.emitChange=function(e){var n=SafeParseFloat(t.value,t.locale);t.duetChange.emit({originalEvent:e,value:n.toString(),valueAsNumber:n,component:"duet-number-input"})};this.localizeValue=function(e){return e.toLocaleString(t.locale)};this.setValue=function(e){t.value=t.localizeValue(e);t.duetInputElement.value="".concat(t.value," ").concat(t.unit)};this.add=function(e){if(e){e.preventDefault()}var n=SafeParseFloat(t.value,t.locale);if(n===t.max){return}var a=n==null?t.min:n+t.step;if(a%t.step!==0){var u=a%t.step;a-=u}var i=clamp(a,t.min,t.max);t.value=t.localizeValue(i);t.emitChange(e)};this.subtract=function(e){if(e){e.preventDefault()}var n=SafeParseFloat(t.value,t.locale);if(n===t.min){return}var a=n-t.step;if(a%t.step!==0){var u=t.step-a%t.step;a+=u}a=clamp(a,t.min,t.max);t.value=t.localizeValue(a);t.emitChange(e)}}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);if(this.value){this.value=this.localizeValue(SafeParseFloat(this.value,this.locale))}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.duetInputElement.setFocus(e);return[2]}))}))};e.prototype.clearValue=function(){this.value=null;this.duetInputElement.value=""};e.prototype.formatAnnouncement=function(){var e=SafeParseFloat(this.value,this.locale);if(e==null){return""}return this.accessibleLive.replace("{current}",e.toString(10))};e.prototype.render=function(){var e=this;var t=this.identifier||this.inputId;var n="".concat(this.localizeValue(this.max)," ").concat(this.unit).length;var a=SafeParseFloat(this.value,this.locale);return h(Host,{class:{"duet-theme-turva":this.theme==="turva","duet-expand":this.expand,"duet-m-0":this.margin==="none"}},h("div",{class:"duet-number-container"},h("duet-input",{ref:function(t){return e.duetInputElement=t},onDuetChange:function(t){return e.handleChange(t)},onDuetFocus:this.handleFocus,onDuetBlur:function(t){return e.handleBlur(t)},onKeyDown:function(t){return e.handleKeyDown(t)},label:this.label,value:this.value?"".concat(this.value," ").concat(this.unit):"",error:this.error,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":a!=null?a:"",maxlength:n,name:this.name,component:"number",required:this.required,disabled:this.disabled,role:this.role,labelHidden:this.labelHidden,tooltip:this.tooltip,identifier:t,theme:this.theme,margin:"none",expand:true,numericKeyboard:true,autoComplete:"off",type:"text",accessibleActiveDescendant:this.accessibleActiveDescendant,accessibleLabelledBy:this.accessibleLabelledBy,accessibleDescription:this.accessibleDescription,accessibleDetails:this.accessibleDetails,accessibleControls:this.accessibleControls,accessibleOwns:this.accessibleOwns,accessibleDescribedBy:this.accessibleDescribedBy},h("div",{class:{"duet-number-buttons":true,"duet-no-label":this.labelHidden}},h("button",{"aria-controls":t,disabled:this.disabled,"aria-disabled":a==null||a===this.min?"true":"false",class:"duet-number-button duet-number-button-subtract",onClick:this.subtract,type:"button"},h("duet-visually-hidden",null,this.accessibleSubtract," ",this.step),h("duet-icon",{icon:actionSubtract.svg,size:"small",margin:"none",color:this.theme==="turva"?"secondary-turva":"secondary"})),h("button",{"aria-controls":t,disabled:this.disabled,"aria-disabled":a===this.max?"true":"false",class:"duet-number-button duet-number-button-add",onClick:this.add,type:"button"},h("duet-visually-hidden",null,this.accessibleAdd," ",this.step),h("duet-icon",{icon:actionAdd.svg,size:"small",margin:"none",color:this.theme==="turva"?"secondary-turva":"secondary"})))),this.accessibleLiveEnabled&&h("duet-visually-hidden",{"aria-live":"polite","aria-atomic":"true","aria-relevant":"all"},this.formatAnnouncement())))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetNumberInput.style=duetNumberInputCss;export{DuetNumberInput as duet_number_input};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-d5956898.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{a as isArrowRightKey,b as isArrowUpKey,c as isArrowDownKey,d as isArrowLeftKey,e as isBackspaceKey}from"./keyboard-utils-88ea1007.js";import{a as getLanguage,b as getLocale,g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var actionAdd={title:"action-add",tags:"action add plus",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M12 24a.75.75 0 0 1-.75-.75v-10.5H.75a.75.75 0 0 1 0-1.5h10.5V.75a.75.75 0 0 1 1.5 0v10.5h10.5a.75.75 0 0 1 0 1.5h-10.5v10.5A.75.75 0 0 1 12 24z"/></svg>'};var actionSubtract={title:"action-subtract",tags:"action subtract minus remove delete cancel",svg:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" role="img"><path d="M.75 12.788a.75.75 0 0 1 0-1.5h22.5a.75.75 0 0 1 0 1.5z"/></svg>'};function SafeParseFloat(e,t){var n;if(typeof e==="string"){var a=e.replace("−","-").replace("‐","-").replace("−","-").replace("–","-").replace("—","-");if(t){a=ConvertToEnUS(a,t,false)}a=a.replace(/\s+/g,"");a=a.replace(/(?!^-?\d*\.{0,1}\d+$)/g,"");n=parseFloat(a)}if(typeof e==="number"){n=parseFloat(String(e))}if(!isNaN(Number(n))){return Number(n)}if(e===null||e===undefined){return null}throw new Error("Invalid value passed to SafeParseFloat")}function ConvertToEnUS(e,t,n){if(n===void 0){n=false}var a;var u=new Intl.NumberFormat(t).format(1/2).replace(/[0-9]/g,"");var i=new Intl.NumberFormat("en-US").format(1/2).replace(/[0-9]/g,"");var r=new Intl.NumberFormat(t).format(1e3).replace(/[0-9]/g,"");var s=new Intl.NumberFormat("en-US").format(1e3).replace(/[0-9]/g,"");a=e.replace(u,"DECIMALSEPARATOR");if(n){a=a.replace(r,"THOUSANDSEPARATOR")}else{a=a.replace(r,"")}a=a.replace("DECIMALSEPARATOR",i);a=a.replace("THOUSANDSEPARATOR",s);return a}var roundTo=function(e,t){return Math.round(e/t)*t};var clamp=function(e,t,n){return Math.min(Math.max(e,t),n)};var duetNumberInputCss='*.sc-duet-number-input,*.sc-duet-number-input::after,*.sc-duet-number-input::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-number-input-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:16px !important;margin-bottom:12px !important;display:inline-flex;width:100%;min-width:calc(33.333% - 8px);max-width:100%;line-height:1.25;text-align:left;vertical-align:bottom}.sc-duet-number-input-h:last-child,.sc-duet-number-input-h:last-of-type{margin-right:0 !important}@media (min-width: 36em){.sc-duet-number-input-h{width:calc(50% - 16px - 3px)}}.duet-expand.sc-duet-number-input-h{width:100% !important}.duet-m-0.sc-duet-number-input-h{margin:0 !important}.duet-number-container.sc-duet-number-input{position:relative;width:100%}.duet-number-buttons.sc-duet-number-input{-webkit-user-select:none;user-select:none;position:absolute;top:1px;right:1px;z-index:200;width:96px;height:calc(100% - 2px)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input{position:relative;display:inline-flex;align-items:center;justify-content:center;width:50%;height:100%;text-align:center;cursor:pointer;background:transparent;-webkit-appearance:none;appearance:none}.duet-number-buttons.sc-duet-number-input .duet-number-button[aria-disabled=true].sc-duet-number-input,.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:disabled{pointer-events:none}.duet-number-buttons.sc-duet-number-input .duet-number-button[aria-disabled=true].sc-duet-number-input duet-icon.sc-duet-number-input,.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:disabled duet-icon.sc-duet-number-input{opacity:0.4}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:active duet-icon.sc-duet-number-input{transform:translateY(1px)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{outline:0}.user-is-tabbing.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{z-index:2;box-shadow:0 0 0 2px #0077b3}.duet-theme-turva .user-is-tabbing.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:focus{box-shadow:0 0 0 2px #171c3a}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type{border-left:1px solid #cfd2d4}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type::before{position:absolute;top:0;left:-6px;width:6px;height:100%;content:"";background:linear-gradient(to left, rgba(207, 210, 212, 0.2) 0%, rgba(207, 210, 212, 0.2) 1px, rgba(207, 210, 212, 0.1) 1px, rgba(207, 210, 212, 0) 100%)}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type{border-top-right-radius:4px;border-bottom-right-radius:4px}.duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type::before{position:absolute;top:20%;left:0;width:1px;height:60%;content:"";background:#e1e3e6}.duet-theme-turva.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:first-of-type::before{background:linear-gradient(to left, rgba(207, 207, 209, 0.2) 0%, rgba(207, 207, 209, 0.2) 1px, rgba(207, 207, 209, 0.1) 1px, rgba(207, 207, 209, 0) 100%)}.duet-theme-turva.sc-duet-number-input-h .duet-number-buttons.sc-duet-number-input .duet-number-button.sc-duet-number-input:last-of-type::before{background:#e4e4e6}';var DuetNumberInput=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",3);this.duetInput=createEvent(this,"duetInput",3);this.duetBlur=createEvent(this,"duetBlur",7);this.duetFocus=createEvent(this,"duetFocus",7);this.inputId=createID("DuetInput");this.language=getLanguage();this.locale=getLocale(this.language).locale;this.unit=getLocale(this.language).money;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLiveDefaults={fi:"{current} euroa valittuna",en:"{current} euros selected",sv:"{current} euro valt"};this.accessibleLive=getLocaleString(this.accessibleLiveDefaults,this.language);this.accessibleLiveEnabled=true;this.accessibleAddDefaults={fi:"Lisää summaan",en:"Add to the amount",sv:"Lägg till beloppet"};this.accessibleAdd=getLocaleString(this.accessibleAddDefaults,this.language);this.accessibleSubtractDefaults={fi:"Vähennä summasta",en:"Subtract from the amount",sv:"Dra från beloppet"};this.accessibleSubtract=getLocaleString(this.accessibleSubtractDefaults,this.language);this.theme="";this.margin="auto";this.expand=false;this.min=0;this.labelDefaults={fi:"Nimilappu",en:"Label",sv:"Etikett"};this.label=getLocaleString(this.labelDefaults,this.language);this.labelHidden=false;this.max=1e6;this.error="";this.tooltip="";this.step=5e3;this.rounding=true;this.disabled=false;this.required=false;this.handleFocus=function(){t.focusedValue=t.value};this.handleKeyDown=function(e){if(isArrowRightKey(e)||isArrowUpKey(e)){t.add(e)}else if(isArrowDownKey(e)||isArrowLeftKey(e)){t.subtract(e)}else if(isBackspaceKey(e)){t.clearValue()}};this.handleChange=function(e){var n=e.target;if(n&&n.value){var a=SafeParseFloat(n.value,t.locale);if(isNaN(a)||a==null){a=t.min||0}t.setValue(a);t.duetInput.emit({component:"duet-number-input",originalEvent:e,value:SafeParseFloat(t.value,t.locale).toString(),valueAsNumber:a})}else{t.duetInput.emit({component:"duet-number-input",originalEvent:e,value:null,valueAsNumber:null})}};this.handleBlur=function(e){var n=e.target;if(!n){return}if(n.value){var a=SafeParseFloat(n.value,t.locale);if(t.rounding){a=roundTo(a,t.step)}a=clamp(a,t.min,t.max);if(a!==SafeParseFloat(t.value,t.locale)||a!==SafeParseFloat(t.focusedValue,t.locale)){t.setValue(a);t.emitChange(e)}}t.duetChange.emit({originalEvent:e,value:null,valueAsNumber:null,component:"duet-number-input"})};this.emitChange=function(e){var n=SafeParseFloat(t.value,t.locale);t.duetChange.emit({originalEvent:e,value:n.toString(),valueAsNumber:n,component:"duet-number-input"})};this.localizeValue=function(e){return e.toLocaleString(t.locale)};this.setValue=function(e){t.value=t.localizeValue(e);t.duetInputElement.value="".concat(t.value," ").concat(t.unit)};this.add=function(e){if(e){e.preventDefault()}var n=SafeParseFloat(t.value,t.locale);if(n===t.max){return}var a=n==null?t.min:n+t.step;if(a%t.step!==0){var u=a%t.step;a-=u}var i=clamp(a,t.min,t.max);t.value=t.localizeValue(i);t.emitChange(e)};this.subtract=function(e){if(e){e.preventDefault()}var n=SafeParseFloat(t.value,t.locale);if(n===t.min){return}var a=n-t.step;if(a%t.step!==0){var u=t.step-a%t.step;a+=u}a=clamp(a,t.min,t.max);t.value=t.localizeValue(a);t.emitChange(e)}}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);if(this.value){this.value=this.localizeValue(SafeParseFloat(this.value,this.locale))}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.duetInputElement.setFocus(e);return[2]}))}))};e.prototype.clearValue=function(){this.value=null;this.duetInputElement.value=""};e.prototype.formatAnnouncement=function(){var e=SafeParseFloat(this.value,this.locale);if(e==null){return""}return this.accessibleLive.replace("{current}",e.toString(10))};e.prototype.render=function(){var e=this;var t=this.identifier||this.inputId;var n="".concat(this.localizeValue(this.max)," ").concat(this.unit).length;var a=SafeParseFloat(this.value,this.locale);return h(Host,{class:{"duet-theme-turva":this.theme==="turva","duet-expand":this.expand,"duet-m-0":this.margin==="none"}},h("div",{class:"duet-number-container"},h("duet-input",{ref:function(t){return e.duetInputElement=t},onDuetChange:function(t){return e.handleChange(t)},onDuetFocus:this.handleFocus,onDuetBlur:function(t){return e.handleBlur(t)},onKeyDown:function(t){return e.handleKeyDown(t)},label:this.label,value:this.value?"".concat(this.value," ").concat(this.unit):"",error:this.error,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":a!=null?a:"",maxlength:n,name:this.name,component:"number",required:this.required,disabled:this.disabled,role:this.role,labelHidden:this.labelHidden,tooltip:this.tooltip,identifier:t,theme:this.theme,margin:"none",expand:true,numericKeyboard:true,autoComplete:"off",type:"text",accessibleActiveDescendant:this.accessibleActiveDescendant,accessibleLabelledBy:this.accessibleLabelledBy,accessibleDescription:this.accessibleDescription,accessibleDetails:this.accessibleDetails,accessibleControls:this.accessibleControls,accessibleOwns:this.accessibleOwns,accessibleDescribedBy:this.accessibleDescribedBy},h("div",{class:{"duet-number-buttons":true,"duet-no-label":this.labelHidden}},h("button",{"aria-controls":t,disabled:this.disabled,"aria-disabled":a==null||a===this.min?"true":"false",class:"duet-number-button duet-number-button-subtract",onClick:this.subtract,type:"button"},h("duet-visually-hidden",null,this.accessibleSubtract," ",this.step),h("duet-icon",{icon:actionSubtract.svg,size:"small",margin:"none",color:this.theme==="turva"?"secondary-turva":"secondary"})),h("button",{"aria-controls":t,disabled:this.disabled,"aria-disabled":a===this.max?"true":"false",class:"duet-number-button duet-number-button-add",onClick:this.add,type:"button"},h("duet-visually-hidden",null,this.accessibleAdd," ",this.step),h("duet-icon",{icon:actionAdd.svg,size:"small",margin:"none",color:this.theme==="turva"?"secondary-turva":"secondary"})))),this.accessibleLiveEnabled&&h("duet-visually-hidden",{"aria-live":"polite","aria-atomic":"true","aria-relevant":"all"},this.formatAnnouncement())))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetNumberInput.style=duetNumberInputCss;export{DuetNumberInput as duet_number_input};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function a(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function s(e){try{l(n.next(e))}catch(t){r(t)}}function o(e){try{l(n["throw"](e))}catch(t){r(t)}}function l(e){e.done?i(e.value):a(e.value).then(s,o)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,a,r,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,a&&(r=s[0]&2?a["return"]:s[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;if(a=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;a=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(o){s=[6,o];a=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-bcca1cb8.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{d as debounce}from"./js-utils-52e0944c.js";import{j as isArrowKey,k as isNumber,d as isArrowLeftKey,b as isArrowUpKey,a as isArrowRightKey,c as isArrowDownKey,l as isMinusKey,m as isPlusKey}from"./keyboard-utils-88ea1007.js";import{g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var shouldDisplayNavigation=function(e,t,i){if(e*2>t/i){return false}return true};var duetPaginationCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-pagination-nav{position:relative}.duet-pagination ::part(button){border:0}.duet-pagination,.duet-pagination li{display:flex;flex-wrap:wrap;gap:0.1rem;align-items:center}.duet-pagination-item-is-active .duet-pagination-page-number{border-bottom-color:inherit;border-bottom-style:solid;border-bottom-width:2px}.duet-pagination duet-button{width:30px;min-width:36px;font-weight:600;text-decoration:none;border-left-width:0}.duet-pagination-overlay{position:absolute;top:1rem;z-index:300;width:100%;text-align:center}.duet-pagination.duet-pagination-is-dimmed{opacity:0.5}";var DuetPagination=function(){function e(e){var t=this;registerInstance(this,e);this.duetPageChange=createEvent(this,"duetPageChange",3);this.listId=createID("duet-pagination-list");this.numbersStore="";this.totalPages=10;this.internalSectionIndex=0;this.theme="";this.jumpString="...";this.variation="default";this.accessibleDescribedBy=undefined;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLabelsDefaults={en:{next_page:"Next page",previous_page:"Previous page",first_page:"First page",last_page:"Last page",jump_to:"Jump to page",go_to:"Go to page",description:"You may use arrow keys to select page number, or enter a page number when this element is in focus to jump to a page",pagination_label:"Pagination, choose a number to jump to a page",prev_section:"Show previous {0} page numbers, screen reader user should use arrowkeys to navigate",next_section:"Show next {0} page numbers, screen reader user should use arrowkeys to navigate"},fi:{next_page:"Seuraava sivu",previous_page:"Edellinen sivu",first_page:"Ensimmäinen sivu",last_page:"Viimeinen sivu",jump_to:"Siirry sivulle",go_to:"Siirry sivulle",description:"Voit käyttää nuolinäppäimiä sivunumeron valitsemiseen, tai kirjoittaa sivunumeron, jos tämä elementti on aktiivinen, siirtymään sivulle",pagination_label:"Sivutus, valitse sivunumero siirtyäksesi sivulle",prev_section:"Näytä edelliset {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",next_section:"Näytä seuraavat {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi"},sv:{next_page:"Nästa sida",previous_page:"Föregående sida",first_page:"Första sidan",last_page:"Sista sidan",jump_to:"Hoppa till sida",go_to:"Hoppa till sida",description:"Du kan använda piltangenterna för att välja sida, eller skriva in sida när elementet är i fokus för att hoppa till en sida",pagination_label:"Sidutning, välj en siffra för att hoppa till en sida",prev_section:"Visa föregående {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",next_section:"Visa nästa {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera"}};this.accessibleLabels=getLocaleString(this.accessibleLabelsDefaults);this.take=5;this.visibleItems=5;this.total=1e3;this.ariaControls="";this.current=1;this.actionChain=function(e,i){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!(e===0))return[3,1];this.current=1;return[3,3];case 1:if(!(i!==e))return[3,3];t=Math.ceil(e/this.visibleItems)-1;if(!(t!==this.internalSectionIndex))return[3,3];this.internalSectionIndex=t;return[4,this.setFocus()];case 2:n.sent();n.label=3;case 3:return[2,true]}}))}))};this.emitPageEvent=debounce((function(e,i){var n=Number(i||t.current);t.duetPageChange.emit({component:"duet-pagination",from:n*t.take,to:n*t.take+t.take,current:n,take:t.take,type:"page",originalEvent:e})}),100);this.getEnteredNumber=debounce((function(e){t.emitPageEvent(e,t.numbersStore);t.current=Number(t.numbersStore);t.numbersStore="";t.duetPageChange.emit({component:"duet-pagination",from:t.current*t.take,to:t.current*t.take+t.take,current:t.current,take:t.take,type:"jump",originalEvent:e})}),500)}e.prototype.watchPropTotalHandler=function(){this.calculatePageTake();return true};e.prototype.watchStateHandler=function(e,t){return this.actionChain(e,t)};e.prototype.componentWillLoad=function(){this.internalSectionIndex=Math.ceil(this.current/this.visibleItems)-1;this.calculatePageTake();inheritGlobalTheme(this)};e.prototype.componentWillRender=function(){if(this.internalSectionIndex!==0&&this.internalSectionIndex!==this.totalPages){this.calculatePageTake()}};e.prototype.componentDidRender=function(){this.setFocus()};e.prototype.calculatePageTake=function(){this.totalPages=Math.ceil(this.total/this.take)};e.prototype.onMouseHandler=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){e.preventDefault();e.stopPropagation();this.current=this.current+t;this.emitPageEvent(e);return[2]}))}))};e.prototype.onKeyboardDown=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){t=this.current;if(isArrowLeftKey(e)||isArrowUpKey(e)){t--}if(isArrowRightKey(e)||isArrowDownKey(e)){t++}if(isArrowKey(e)){if(t<=this.totalPages){this.current=t;this.emitPageEvent(e)}}if(isNumber(e)&&this.shouldDisplayNavigation()){this.numbersStore=this.numbersStore+e.key;if(Number(this.numbersStore)>this.totalPages){this.numbersStore=this.totalPages+""}this.getEnteredNumber(e)}return[2]}))}))};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(i){switch(i.label){case 0:e=this.nativeNav.querySelector("li.duet-pagination-item-is-active duet-button");t=e;if(!t)return[3,2];return[4,e.setFocus()];case 1:t=i.sent();i.label=2;case 2:t;return[2]}}))}))};e.prototype.pageClickHandler=function(e){e.preventDefault();var t=Number(e.target.getAttribute("data-id"));this.current=t;this.emitPageEvent({},t)};e.prototype.sectionClickHandler=function(e,t){e.preventDefault();var i=this.internalSectionIndex+t;var n=this.take*this.visibleItems;if(i*n>this.total){i=this.internalSectionIndex}var a=i;this.internalSectionIndex=a>=0?a:0};e.prototype.jumpToStart=function(e){e.preventDefault();this.internalSectionIndex=0;this.current=1;this.emitPageEvent(e)};e.prototype.jumpToEnd=function(e){e.preventDefault();this.internalSectionIndex=Math.ceil(this.totalPages/this.take-1);this.current=this.totalPages;this.emitPageEvent(e)};e.prototype.renderPageNumbers=function(){var e=this;var t=[];var i=this.internalSectionIndex*this.visibleItems;do{i++;if(i>this.totalPages){break}t.push(h("li",{class:{"duet-pagination-item":true,"duet-pagination-item-is-active":i===this.current},role:"menuitem"},h("duet-button",{class:{"duet-pagination-link":true},color:i!==this.current?"secondary":"primary","data-id":i,"center-text":true,variation:"plain",margin:"none",accessibleLabel:"".concat(this.accessibleLabels.go_to," ").concat(i),onClick:function(t){return e.pageClickHandler(t)}},h("div",{class:"duet-pagination-page-number","aria-hidden":true},i))))}while(i<this.visibleItems+this.internalSectionIndex*this.visibleItems);return t};e.prototype.shouldDisplayNavigation=function(){if(this.variation!=="compact"){return shouldDisplayNavigation(this.visibleItems,this.total,this.take)}return false};e.prototype.render=function(){var e;var t=this;return h(Host,{onKeyDown:function(e){return t.onKeyboardDown(e)}},h("nav",{role:"navigation","aria-labelledby":this.accessibleLabelledBy?"".concat(this.accessibleLabelledBy," ").concat(this.listId):this.listId,"aria-describedby":this.accessibleDescribedBy?"".concat(this.accessibleDescribedBy," ").concat(this.listId):this.listId,"aria-descriptions":this.accessibleDescription,"aria-details":this.accessibleDetails,ref:function(e){return t.nativeNav=e},"aria-controls":this.ariaControls,class:(e={"duet-pagination-nav":true},e["duet-pagination-variation-".concat(this.variation)]=true,e)},this.numbersStore!==""&&h("div",{"aria-live":"assertive","aria-relevant":"text",class:"duet-pagination-overlay","aria-label":"".concat(this.accessibleLabels.jump_to," ").concat(this.numbersStore),part:"navigation-overlay"},h("duet-badge",null,"jump to page : ",this.numbersStore)),h("ol",{id:this.listId,class:{"duet-pagination":true,"duet-pagination-is-dimmed":this.numbersStore!==""},role:"menubar","aria-label":this.accessibleLabels.pagination_label,"aria-description":this.accessibleLabels.description},h("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-first":true},role:"menuitem",part:"navigation-arrow"},h("duet-action-button",{disabled:this.internalSectionIndex===0&&this.current<=1,"data-direction":"back",onClick:function(e){return t.onMouseHandler(e,-1)},"aria-label":this.accessibleLabels.previous_page,"icon-name":"action-arrow-left-small"})),this.internalSectionIndex!==0&&this.shouldDisplayNavigation()&&h(Fragment,null,h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-back","center-text":"true",variation:"plain",color:"secondary",margin:"none",accessibleLabel:this.accessibleLabels.first_page,onClick:function(e){return t.jumpToStart(e)}},h("div",{class:"duet-pagination-page-number"},"1"))),h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-back","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.prev_section.replace("{0}","".concat(this.visibleItems)),onClick:function(e){return t.sectionClickHandler(e,-1)}},h("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"...")))),this.renderPageNumbers(),this.internalSectionIndex*(this.visibleItems+2)<this.totalPages&&this.shouldDisplayNavigation()&&h(Fragment,null,h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.next_section.replace("{0}","".concat(this.visibleItems)),onClick:function(e){return t.sectionClickHandler(e,1)}},h("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"..."))),h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.last_page,onClick:function(e){return t.jumpToEnd(e)}},h("div",{class:"duet-pagination-page-number"},this.totalPages)))),h("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-last":true},role:"menuitem",part:"navigation-arrow"},h("duet-action-button",{disabled:this.current===this.totalPages&&this.internalSectionIndex===Math.ceil(this.totalPages/this.visibleItems)-1,class:"duet-date-dialog-next","aria-label":this.accessibleLabels.next_page,onClick:function(e){return t.onMouseHandler(e,1)},"icon-name":"action-arrow-right-small"})))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{total:["watchPropTotalHandler"],current:["watchStateHandler"]}},enumerable:false,configurable:true});return e}();DuetPagination.style=duetPaginationCss;var duetRangeStepperCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-range-stepper{display:flex;flex-wrap:wrap;gap:0;align-items:baseline;justify-content:center;min-width:30px;min-height:30px;font-weight:600;text-decoration:none;border-left-width:0}.duet-range-stepper{white-space:nowrap}.duet-range-stepper .duet-range-step-counter{font-weight:600;color:#00294d}.duet-range-stepper ::part(button){border:0}";var DuetRangeStepper=function(){function e(e){var t=this;registerInstance(this,e);this.duetRangeStepUpdate=createEvent(this,"duetRangeStepUpdate",7);this.leftBn=createID("duetRangeStepper-left");this.rightBn=createID("duetRangeStepper-right");this.theme="";this.stepIndex=1;this.stepSize=50;this.total=1e3;this.ariaLabelsDefaults={en:{next_increment:"Next range increment",previous_increment:"Previous range increment",x_of_y:"{0}–{1} of {2}"},fi:{next_increment:"Seuraava välillä",previous_increment:"Edellinen välillä",x_of_y:"{0}–{1} / {2}"},sv:{next_increment:"Nästa intervall",previous_increment:"Föregående intervall",x_of_y:"{0}–{1} av {2}"}};this.ariaLabels=getLocaleString(this.ariaLabelsDefaults);this.ariaControls="";this.handleClick=function(e,i){e.preventDefault();t.increment(i);t.handleStepClick(e)}}e.prototype.watchStepIndexStateHandler=function(e){if(e<=1){this.leftBnRef.setAttribute("disabled","");this.rightBnRef.focus()}else{this.leftBnRef.removeAttribute("disabled")}if(e>=this.total/this.stepSize){this.rightBnRef.setAttribute("disabled","");this.leftBnRef.focus()}else{this.rightBnRef.removeAttribute("disabled")}};e.prototype.watchStepSizeStateHandler=function(e,t){if(e!==t){if(this.stepIndex*e>this.total){this.stepIndex=this.total/e}}};e.prototype.handleStepClick=function(e){var t=this.stepIndex*this.stepSize-this.stepSize;this.duetRangeStepUpdate.emit({originalEvent:e,component:"duet-range-stepper",from:t,to:this.getTo(),index:this.stepIndex})};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.componentDidLoad=function(){this.watchStepIndexStateHandler(this.stepIndex)};e.prototype.increment=function(e){var t=this.stepIndex+e;if(t<=0){this.stepIndex=1}else{if(t*this.stepSize<this.total+this.stepSize){this.stepIndex=t}else if(t*this.stepSize>this.total+this.stepSize){this.stepIndex=Math.floor(this.total/this.stepSize)}}};e.prototype.getTo=function(){var e=this.stepIndex*this.stepSize;var t=e>this.total?this.total:e;return t};e.prototype.generateStepSize=function(){var e=Math.floor((this.stepIndex-1)*this.stepSize);if(e===0){e=1}var t=Math.floor(this.stepIndex*this.stepSize);return this.ariaLabels.x_of_y.replace("{0}",String(e)).replace("{1}",String(t)).replace("{2}",String(this.total))};e.prototype.onKeyboardDown=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){t=this.stepIndex;i=1;if(isArrowLeftKey(e)||isArrowUpKey(e)||isMinusKey(e)){t--;i=-1;this.leftBnRef.focus()}if(isArrowRightKey(e)||isArrowDownKey(e)||isPlusKey(e)){t++;i=1}if(isArrowKey(e)){if(t>0&&t*this.stepSize<=this.total){this.handleClick(e,i)}}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",{class:{"duet-range-stepper":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:function(t){return e.onKeyboardDown(t)},"aria-controls":this.ariaControls},h("span",{class:"duet-range-step-counter",part:"range-numbers"},this.generateStepSize()),h("duet-action-button",{class:"duet-range-step-button duet-range-step-minus",onClick:function(t){return e.handleClick(t,-1)},id:this.leftBn,"aria-label":this.ariaLabels.previous_increment,ref:function(t){return e.leftBnRef=t},part:"navigation-arrow",iconName:"action-arrow-left-small"}),h("duet-action-button",{class:"duet-range-step-button duet-range-step-plus",onClick:function(t){return e.handleClick(t,1)},"aria-label":this.ariaLabels.next_increment,id:this.rightBn,ref:function(t){return e.rightBnRef=t},part:"navigation-arrow",iconName:"action-arrow-right-small"}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stepIndex:["watchStepIndexStateHandler"],stepSize:["watchStepSizeStateHandler"]}},enumerable:false,configurable:true});return e}();DuetRangeStepper.style=duetRangeStepperCss;export{DuetPagination as duet_pagination,DuetRangeStepper as duet_range_stepper};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-d5956898.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{d as debounce}from"./js-utils-52e0944c.js";import{j as isArrowKey,k as isNumber,d as isArrowLeftKey,b as isArrowUpKey,a as isArrowRightKey,c as isArrowDownKey,l as isMinusKey,m as isPlusKey}from"./keyboard-utils-88ea1007.js";import{g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var shouldDisplayNavigation=function(e,t,i){if(e*2>t/i){return false}return true};var duetPaginationCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-pagination-nav{position:relative}.duet-pagination ::part(button){border:0}.duet-pagination,.duet-pagination li{display:flex;flex-wrap:wrap;gap:0.1rem;align-items:center}.duet-pagination-item-is-active .duet-pagination-page-number{border-bottom-color:inherit;border-bottom-style:solid;border-bottom-width:2px}.duet-pagination duet-button{width:30px;min-width:36px;font-weight:600;text-decoration:none;border-left-width:0}.duet-pagination-overlay{position:absolute;top:1rem;z-index:300;width:100%;text-align:center}.duet-pagination.duet-pagination-is-dimmed{opacity:0.5}";var DuetPagination=function(){function e(e){var t=this;registerInstance(this,e);this.duetPageChange=createEvent(this,"duetPageChange",3);this.listId=createID("duet-pagination-list");this.numbersStore="";this.totalPages=10;this.internalSectionIndex=0;this.theme="";this.jumpString="...";this.variation="default";this.accessibleDescribedBy=undefined;this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLabelsDefaults={en:{next_page:"Next page",previous_page:"Previous page",first_page:"First page",last_page:"Last page",jump_to:"Jump to page",go_to:"Go to page",description:"You may use arrow keys to select page number, or enter a page number when this element is in focus to jump to a page",pagination_label:"Pagination, choose a number to jump to a page",prev_section:"Show previous {0} page numbers, screen reader user should use arrowkeys to navigate",next_section:"Show next {0} page numbers, screen reader user should use arrowkeys to navigate"},fi:{next_page:"Seuraava sivu",previous_page:"Edellinen sivu",first_page:"Ensimmäinen sivu",last_page:"Viimeinen sivu",jump_to:"Siirry sivulle",go_to:"Siirry sivulle",description:"Voit käyttää nuolinäppäimiä sivunumeron valitsemiseen, tai kirjoittaa sivunumeron, jos tämä elementti on aktiivinen, siirtymään sivulle",pagination_label:"Sivutus, valitse sivunumero siirtyäksesi sivulle",prev_section:"Näytä edelliset {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi",next_section:"Näytä seuraavat {0} sivunumerot, käyttäjän pitää käyttää nuolinäppäimiä navigoidaksesi"},sv:{next_page:"Nästa sida",previous_page:"Föregående sida",first_page:"Första sidan",last_page:"Sista sidan",jump_to:"Hoppa till sida",go_to:"Hoppa till sida",description:"Du kan använda piltangenterna för att välja sida, eller skriva in sida när elementet är i fokus för att hoppa till en sida",pagination_label:"Sidutning, välj en siffra för att hoppa till en sida",prev_section:"Visa föregående {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera",next_section:"Visa nästa {0} sidnummer, skrivbordsläsare ska använda piltangenterna för att navigera"}};this.accessibleLabels=getLocaleString(this.accessibleLabelsDefaults);this.take=5;this.visibleItems=5;this.total=1e3;this.ariaControls="";this.current=1;this.actionChain=function(e,i){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!(e===0))return[3,1];this.current=1;return[3,3];case 1:if(!(i!==e))return[3,3];t=Math.ceil(e/this.visibleItems)-1;if(!(t!==this.internalSectionIndex))return[3,3];this.internalSectionIndex=t;return[4,this.setFocus()];case 2:n.sent();n.label=3;case 3:return[2,true]}}))}))};this.emitPageEvent=debounce((function(e,i){var n=Number(i||t.current);t.duetPageChange.emit({component:"duet-pagination",from:n*t.take,to:n*t.take+t.take,current:n,take:t.take,type:"page",originalEvent:e})}),100);this.getEnteredNumber=debounce((function(e){t.emitPageEvent(e,t.numbersStore);t.current=Number(t.numbersStore);t.numbersStore="";t.duetPageChange.emit({component:"duet-pagination",from:t.current*t.take,to:t.current*t.take+t.take,current:t.current,take:t.take,type:"jump",originalEvent:e})}),500)}e.prototype.watchPropTotalHandler=function(){this.calculatePageTake();return true};e.prototype.watchStateHandler=function(e,t){return this.actionChain(e,t)};e.prototype.componentWillLoad=function(){this.internalSectionIndex=Math.ceil(this.current/this.visibleItems)-1;this.calculatePageTake();inheritGlobalTheme(this)};e.prototype.componentWillRender=function(){if(this.internalSectionIndex!==0&&this.internalSectionIndex!==this.totalPages){this.calculatePageTake()}};e.prototype.componentDidRender=function(){this.setFocus()};e.prototype.calculatePageTake=function(){this.totalPages=Math.ceil(this.total/this.take)};e.prototype.onMouseHandler=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){e.preventDefault();e.stopPropagation();this.current=this.current+t;this.emitPageEvent(e);return[2]}))}))};e.prototype.onKeyboardDown=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){t=this.current;if(isArrowLeftKey(e)||isArrowUpKey(e)){t--}if(isArrowRightKey(e)||isArrowDownKey(e)){t++}if(isArrowKey(e)){if(t<=this.totalPages){this.current=t;this.emitPageEvent(e)}}if(isNumber(e)&&this.shouldDisplayNavigation()){this.numbersStore=this.numbersStore+e.key;if(Number(this.numbersStore)>this.totalPages){this.numbersStore=this.totalPages+""}this.getEnteredNumber(e)}return[2]}))}))};e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(i){switch(i.label){case 0:e=this.nativeNav.querySelector("li.duet-pagination-item-is-active duet-button");t=e;if(!t)return[3,2];return[4,e.setFocus()];case 1:t=i.sent();i.label=2;case 2:t;return[2]}}))}))};e.prototype.pageClickHandler=function(e){e.preventDefault();var t=Number(e.target.getAttribute("data-id"));this.current=t;this.emitPageEvent({},t)};e.prototype.sectionClickHandler=function(e,t){e.preventDefault();var i=this.internalSectionIndex+t;var n=this.take*this.visibleItems;if(i*n>this.total){i=this.internalSectionIndex}var a=i;this.internalSectionIndex=a>=0?a:0};e.prototype.jumpToStart=function(e){e.preventDefault();this.internalSectionIndex=0;this.current=1;this.emitPageEvent(e)};e.prototype.jumpToEnd=function(e){e.preventDefault();this.internalSectionIndex=Math.ceil(this.totalPages/this.take-1);this.current=this.totalPages;this.emitPageEvent(e)};e.prototype.renderPageNumbers=function(){var e=this;var t=[];var i=this.internalSectionIndex*this.visibleItems;do{i++;if(i>this.totalPages){break}t.push(h("li",{class:{"duet-pagination-item":true,"duet-pagination-item-is-active":i===this.current},role:"menuitem"},h("duet-button",{class:{"duet-pagination-link":true},color:i!==this.current?"secondary":"primary","data-id":i,"center-text":true,variation:"plain",margin:"none",accessibleLabel:"".concat(this.accessibleLabels.go_to," ").concat(i),onClick:function(t){return e.pageClickHandler(t)}},h("div",{class:"duet-pagination-page-number","aria-hidden":true},i))))}while(i<this.visibleItems+this.internalSectionIndex*this.visibleItems);return t};e.prototype.shouldDisplayNavigation=function(){if(this.variation!=="compact"){return shouldDisplayNavigation(this.visibleItems,this.total,this.take)}return false};e.prototype.render=function(){var e;var t=this;return h(Host,{onKeyDown:function(e){return t.onKeyboardDown(e)}},h("nav",{role:"navigation","aria-labelledby":this.accessibleLabelledBy?"".concat(this.accessibleLabelledBy," ").concat(this.listId):this.listId,"aria-describedby":this.accessibleDescribedBy?"".concat(this.accessibleDescribedBy," ").concat(this.listId):this.listId,"aria-descriptions":this.accessibleDescription,"aria-details":this.accessibleDetails,ref:function(e){return t.nativeNav=e},"aria-controls":this.ariaControls,class:(e={"duet-pagination-nav":true},e["duet-pagination-variation-".concat(this.variation)]=true,e)},this.numbersStore!==""&&h("div",{"aria-live":"assertive","aria-relevant":"text",class:"duet-pagination-overlay","aria-label":"".concat(this.accessibleLabels.jump_to," ").concat(this.numbersStore),part:"navigation-overlay"},h("duet-badge",null,"jump to page : ",this.numbersStore)),h("ol",{id:this.listId,class:{"duet-pagination":true,"duet-pagination-is-dimmed":this.numbersStore!==""},role:"menubar","aria-label":this.accessibleLabels.pagination_label,"aria-description":this.accessibleLabels.description},h("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-first":true},role:"menuitem",part:"navigation-arrow"},h("duet-action-button",{disabled:this.internalSectionIndex===0&&this.current<=1,"data-direction":"back",onClick:function(e){return t.onMouseHandler(e,-1)},"aria-label":this.accessibleLabels.previous_page,"icon-name":"action-arrow-left-small"})),this.internalSectionIndex!==0&&this.shouldDisplayNavigation()&&h(Fragment,null,h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-back","center-text":"true",variation:"plain",color:"secondary",margin:"none",accessibleLabel:this.accessibleLabels.first_page,onClick:function(e){return t.jumpToStart(e)}},h("div",{class:"duet-pagination-page-number"},"1"))),h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-back","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.prev_section.replace("{0}","".concat(this.visibleItems)),onClick:function(e){return t.sectionClickHandler(e,-1)}},h("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"...")))),this.renderPageNumbers(),this.internalSectionIndex*(this.visibleItems+2)<this.totalPages&&this.shouldDisplayNavigation()&&h(Fragment,null,h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-section"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-dots-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.next_section.replace("{0}","".concat(this.visibleItems)),onClick:function(e){return t.sectionClickHandler(e,1)}},h("div",{class:"duet-pagination-page-number","aria-hidden":"true"},"..."))),h("li",{class:"duet-pagination-item",role:"menuitem",part:"navigation-jump"},h("duet-button",{class:"duet-pagination-link duet-pagination-link-jump-forward","center-text":"true",color:"secondary",variation:"plain",margin:"none",accessibleLabel:this.accessibleLabels.last_page,onClick:function(e){return t.jumpToEnd(e)}},h("div",{class:"duet-pagination-page-number"},this.totalPages)))),h("li",{class:{"duet-pagination-page-button":true,"duet-pagination-button-last":true},role:"menuitem",part:"navigation-arrow"},h("duet-action-button",{disabled:this.current===this.totalPages&&this.internalSectionIndex===Math.ceil(this.totalPages/this.visibleItems)-1,class:"duet-date-dialog-next","aria-label":this.accessibleLabels.next_page,onClick:function(e){return t.onMouseHandler(e,1)},"icon-name":"action-arrow-right-small"})))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{total:["watchPropTotalHandler"],current:["watchStateHandler"]}},enumerable:false,configurable:true});return e}();DuetPagination.style=duetPaginationCss;var duetRangeStepperCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:inline-block;margin:0 auto}.duet-range-stepper{display:flex;flex-wrap:wrap;gap:0;align-items:baseline;justify-content:center;min-width:30px;min-height:30px;font-weight:600;text-decoration:none;border-left-width:0}.duet-range-stepper{white-space:nowrap}.duet-range-stepper .duet-range-step-counter{font-weight:600;color:#00294d}.duet-range-stepper ::part(button){border:0}";var DuetRangeStepper=function(){function e(e){var t=this;registerInstance(this,e);this.duetRangeStepUpdate=createEvent(this,"duetRangeStepUpdate",7);this.leftBn=createID("duetRangeStepper-left");this.rightBn=createID("duetRangeStepper-right");this.theme="";this.stepIndex=1;this.stepSize=50;this.total=1e3;this.ariaLabelsDefaults={en:{next_increment:"Next range increment",previous_increment:"Previous range increment",x_of_y:"{0}–{1} of {2}"},fi:{next_increment:"Seuraava välillä",previous_increment:"Edellinen välillä",x_of_y:"{0}–{1} / {2}"},sv:{next_increment:"Nästa intervall",previous_increment:"Föregående intervall",x_of_y:"{0}–{1} av {2}"}};this.ariaLabels=getLocaleString(this.ariaLabelsDefaults);this.ariaControls="";this.handleClick=function(e,i){e.preventDefault();t.increment(i);t.handleStepClick(e)}}e.prototype.watchStepIndexStateHandler=function(e){if(e<=1){this.leftBnRef.setAttribute("disabled","");this.rightBnRef.focus()}else{this.leftBnRef.removeAttribute("disabled")}if(e>=this.total/this.stepSize){this.rightBnRef.setAttribute("disabled","");this.leftBnRef.focus()}else{this.rightBnRef.removeAttribute("disabled")}};e.prototype.watchStepSizeStateHandler=function(e,t){if(e!==t){if(this.stepIndex*e>this.total){this.stepIndex=this.total/e}}};e.prototype.handleStepClick=function(e){var t=this.stepIndex*this.stepSize-this.stepSize;this.duetRangeStepUpdate.emit({originalEvent:e,component:"duet-range-stepper",from:t,to:this.getTo(),index:this.stepIndex})};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.componentDidLoad=function(){this.watchStepIndexStateHandler(this.stepIndex)};e.prototype.increment=function(e){var t=this.stepIndex+e;if(t<=0){this.stepIndex=1}else{if(t*this.stepSize<this.total+this.stepSize){this.stepIndex=t}else if(t*this.stepSize>this.total+this.stepSize){this.stepIndex=Math.floor(this.total/this.stepSize)}}};e.prototype.getTo=function(){var e=this.stepIndex*this.stepSize;var t=e>this.total?this.total:e;return t};e.prototype.generateStepSize=function(){var e=Math.floor((this.stepIndex-1)*this.stepSize);if(e===0){e=1}var t=Math.floor(this.stepIndex*this.stepSize);return this.ariaLabels.x_of_y.replace("{0}",String(e)).replace("{1}",String(t)).replace("{2}",String(this.total))};e.prototype.onKeyboardDown=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){t=this.stepIndex;i=1;if(isArrowLeftKey(e)||isArrowUpKey(e)||isMinusKey(e)){t--;i=-1;this.leftBnRef.focus()}if(isArrowRightKey(e)||isArrowDownKey(e)||isPlusKey(e)){t++;i=1}if(isArrowKey(e)){if(t>0&&t*this.stepSize<=this.total){this.handleClick(e,i)}}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",{class:{"duet-range-stepper":true,"duet-theme-turva":this.theme==="turva"},onKeyDown:function(t){return e.onKeyboardDown(t)},"aria-controls":this.ariaControls},h("span",{class:"duet-range-step-counter",part:"range-numbers"},this.generateStepSize()),h("duet-action-button",{class:"duet-range-step-button duet-range-step-minus",onClick:function(t){return e.handleClick(t,-1)},id:this.leftBn,"aria-label":this.ariaLabels.previous_increment,ref:function(t){return e.leftBnRef=t},part:"navigation-arrow",iconName:"action-arrow-left-small"}),h("duet-action-button",{class:"duet-range-step-button duet-range-step-plus",onClick:function(t){return e.handleClick(t,1)},"aria-label":this.ariaLabels.next_increment,id:this.rightBn,ref:function(t){return e.rightBnRef=t},part:"navigation-arrow",iconName:"action-arrow-right-small"}))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stepIndex:["watchStepIndexStateHandler"],stepSize:["watchStepSizeStateHandler"]}},enumerable:false,configurable:true});return e}();DuetRangeStepper.style=duetRangeStepperCss;export{DuetPagination as duet_pagination,DuetRangeStepper as duet_range_stepper};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built with Duet Design System
|
|
3
3
|
*/
|
|
4
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-
|
|
4
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-d5956898.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{g as getLocaleString}from"./language-utils-bf701d37.js";import"./string-utils-5954f458.js";var duetProgressCss="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;width:100%;height:inherit}.duet-progress{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%;min-height:1px;}.duet-progress .progress-bar{position:relative;display:block;width:100%;height:inherit;min-height:1px;background-color:#f3f9fc;border-radius:0;box-shadow:none}.duet-theme-turva .duet-progress .progress-bar{background-color:#fcf3f4}.duet-progress .progress-bar>span{display:block;height:inherit;text-indent:-9999px;background-color:#0077b3;border-radius:0}.duet-theme-turva .duet-progress .progress-bar>span{background-color:#c60c30}.duet-progress progress[value]{display:flex;width:100%;height:inherit;min-height:1px;color:#0077b3;border:0 none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.duet-theme-turva .duet-progress progress[value]{color:#c60c30}.duet-progress progress[value]::-webkit-progress-bar{background-color:#f3f9fc;border-radius:0}.duet-theme-turva .duet-progress progress[value]::-webkit-progress-bar{background-color:#fcf3f4}.duet-progress progress[value]::-webkit-progress-value{background-color:#0077b3;background-size:35px 20px, 100% 100%, 100% 100%;border-radius:0;-webkit-animation:animate-stripes 5s linear infinite;animation:animate-stripes 5s linear infinite}.duet-theme-turva .duet-progress progress[value]::-webkit-progress-value{background-color:#c60c30}.duet-progress progress[value] ::-moz-progress-bar{background-color:#f3f9fc}.duet-theme-turva .duet-progress progress[value] ::-moz-progress-bar{background-color:#fcf3f4}";var DuetProgress=function(){function e(e){registerInstance(this,e);this.progressId=createID("DuetProgress");this.progressLabelId=createID("DuetProgressLabel");this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.accessibleLabelUploadDefaults={fi:["lähetys valmis","lähetys käynnissä"],sv:["Uppladdningen är klar","Uppladdning pågår"],en:["upload completed","upload in progress"]};this.accessibleLabelUpload=getLocaleString(this.accessibleLabelUploadDefaults);this.progress=0;this.height="10px";this.theme=""}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.render=function(){return h(Host,null,h("div",{"aria-live":this.accessibleLabel?"polite":"off","aria-hidden":this.accessibleLabel?"false":"true","aria-atomic":"true",style:{height:this.height},id:this.progressId,class:{"duet-progress":true,"duet-progress-done":this.progress===100,"duet-progress-start":this.progress===0,"duet-progress-inprogress":this.progress<99&&this.progress!==0,"duet-theme-turva":this.theme==="turva"}},h("duet-visually-hidden",null,h("label",{htmlFor:this.progressLabelId},this.progress!==0&&h("span",null,this.accessibleLabel,", ",this.accessibleLabelUpload[this.progress<99?1:0]))),this.caption&&h("div",{class:"duet-progress-caption"},h("span",null,this.caption)),h("progress",{id:this.progressLabelId,"aria-describedby":this.accessibleDescribedBy,"aria-labelledby":this.accessibleLabelledBy,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,role:"progressbar",value:this.progress,max:"100","aria-valuemin":"0","aria-valuemax":"100"},h("div",{class:"progress-bar"},h("span",{style:{width:"".concat(this.progress,"%;")}},"Progress: ",this.progress,"%")))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetProgress.style=duetProgressCss;export{DuetProgress as duet_progress};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function a(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function n(e){try{s(o.next(e))}catch(t){r(t)}}function d(e){try{s(o["throw"](e))}catch(t){r(t)}}function s(e){e.done?i(e.value):a(e.value).then(n,d)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,a,r,n;return n={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function d(e){return function(t){return s([e,t])}}function s(n){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,a&&(r=n[0]&2?a["return"]:n[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,n[1])).done)return r;if(a=0,r)n=[n[0]&2,r.value];switch(n[0]){case 0:case 1:r=n;break;case 4:i.label++;return{value:n[1],done:false};case 5:i.label++;a=n[1];n=[0];continue;case 7:n=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(n[0]===6||n[0]===2)){i=0;continue}if(n[0]===3&&(!r||n[1]>r[0]&&n[1]<r[3])){i.label=n[1];break}if(n[0]===6&&i.label<r[1]){i.label=r[1];r=n;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(n);break}if(r[2])i.ops.pop();i.trys.pop();continue}n=t.call(e,i)}catch(d){n=[6,d];a=0}finally{o=r=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* Built with Duet Design System
|
|
4
|
-
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-bcca1cb8.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{f as findCheckedOption,w as watchForOptions}from"./watch-options-dd55bce8.js";var duetRadioCss='*.sc-duet-radio,*.sc-duet-radio::after,*.sc-duet-radio::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:28px !important;margin-bottom:12px !important;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-radio-h:last-child,.sc-duet-radio-h:last-of-type{margin-right:0 !important}.vertical.sc-duet-radio-h{margin-right:0 !important}.horizontal.sc-duet-radio-h{margin-bottom:0 !important;width:auto}.horizontal.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}@media (min-width: 48em){.horizontal-responsive.sc-duet-radio-h{margin-right:28px !important;margin-bottom:0 !important;width:auto}.horizontal-responsive.sc-duet-radio-h:last-child,.horizontal-responsive.sc-duet-radio-h:last-of-type{margin-right:0 !important}.horizontal-responsive.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}}.duet-m-0.sc-duet-radio-h{margin:0 !important}.sc-duet-radio-h:last-child:not(:only-child){margin-right:0 !important;margin-bottom:0 !important}.duet-label.sc-duet-radio{position:relative;z-index:100;display:flex;width:100%;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#00294d;cursor:pointer;background:transparent}.duet-theme-turva.sc-duet-radio .duet-label.sc-duet-radio{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}.duet-label.sc-duet-radio span.sc-duet-radio{flex-grow:1;font-size:1rem}.duet-label-hidden.sc-duet-radio .duet-label.sc-duet-radio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-radio-container.sc-duet-radio{position:relative;width:100%;height:100%}.duet-radio.sc-duet-radio{padding:14px !important;position:absolute;top:0;left:0;z-index:200;width:100%;height:100%;cursor:pointer;opacity:0}.duet-radio.sc-duet-radio+label.sc-duet-radio::before{z-index:100;flex-shrink:0;width:20px;height:20px;margin:2px 10px 1px 1px;content:"";background:white;border:1px solid #00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio+label.sc-duet-radio::before{border-color:#171c3a}.duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{position:absolute;top:6px;left:5px;z-index:200;flex-shrink:0;width:12px;height:12px;content:"";background:#00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{background:#171c3a}.duet-radio[disabled].sc-duet-radio{cursor:default}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#747475}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfd2d4}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfcfd1}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::before{border:1px solid #657787}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#747475;border-color:#747475}';var DuetRadio=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",7);this.duetFocus=createEvent(this,"duetFocus",7);this.duetBlur=createEvent(this,"duetBlur",7);this.radioId=createID("DuetRadio");this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.margin="auto";this.theme="";this.disabled=false;this.required=false;this.blockEvents=false;this.label="label";this.onClick=function(e){e.stopPropagation()};this.onChange=function(e){t.checked=e.target.value;if(t.checked&&!t.blockEvents){t.duetChange.emit({originalEvent:e,checked:t.checked,value:t.value,component:"duet-radio"})}};this.onBlur=function(e){t.duetBlur.emit({originalEvent:e,checked:t.checked,value:t.value,component:"duet-radio"})};this.onFocus=function(e){t.duetFocus.emit({originalEvent:e,checked:t.checked,value:t.value,component:"duet-radio"})}}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);if(this.value===undefined){this.value=this.identifier}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.nativeInput.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.identifier||this.radioId;return h(Host,{onClick:this.onClick,class:{horizontal:this.groupDirection==="horizontal"&&!this.groupResponsive,"horizontal-responsive":this.groupDirection==="horizontal"&&this.groupResponsive,"duet-m-0":this.margin==="none"}},h("div",{class:{"duet-radio-container":true,"duet-theme-turva":this.theme==="turva"}},h("input",{type:"radio",onFocus:this.onFocus,onBlur:this.onBlur,onChange:this.onChange,value:this.value,tabindex:this.accessibleIndex,class:{"duet-radio":true,disabled:this.disabled||this.groupDisabled},checked:this.checked,disabled:this.disabled||this.groupDisabled,required:this.required,"aria-controls":this.accessibleControls,"aria-activedescendant":this.accessibleActiveDescendant,"aria-owns":this.accessibleOwns,"aria-describedby":this.accessibleDescribedBy,"aria-labelledby":this.accessibleLabelledBy,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,role:this.role,name:this.name,id:t,ref:function(t){return e.nativeInput=t}}),h("label",{class:"duet-label",htmlFor:t},h("span",null,this.label))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetRadio.style=duetRadioCss;var duetRadioGroupCss="*.sc-duet-radio-group,*.sc-duet-radio-group::after,*.sc-duet-radio-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-radio-group-h .duet-radio-group.sc-duet-radio-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-radio-group-h .duet-radio-group.sc-duet-radio-group{display:flex}}.horizontal.sc-duet-radio-group-h .duet-radio-group.duet-no-stacking.sc-duet-radio-group{display:flex}.deut-radio-group.sc-duet-radio-group{width:100%}";var DuetRadioGroup=function(){function e(e){var t=this;registerInstance(this,e);this.direction="vertical";this.margin="auto";this.theme="";this.error="";this.tooltip="";this.tooltipDirection="auto";this.label="Label";this.labelHidden=false;this.caption="";this.responsive=false;this.onSelect=function(e){var i=e.target;if(i){t.value=i.value}e.cancelBubble=true}}e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var i=this;return __generator(this,(function(o){switch(o.label){case 0:e=this.element;if(!(this.value===undefined))return[3,2];t=findCheckedOption(e,"duet-radio");if(!(t!==undefined))return[3,2];return[4,t.componentOnReady()];case 1:o.sent();if(this.value===undefined){this.value=t.value}o.label=2;case 2:this.mutationO=watchForOptions(e,"duet-radio",(function(e){if(e!==undefined){e.componentOnReady().then((function(){i.value=e.value}))}else{i.updateRadios()}}));this.updateRadios();return[2]}}))}))};e.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.updateRadios=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,a,r;return __generator(this,(function(n){e=Array.from(this.element.querySelectorAll("duet-radio"));t=this.value;i=false;for(o=0,a=e;o<a.length;o++){r=a[o];r.name=this.name;r.groupDisabled=this.disabled;r.groupDirection=this.direction;r.groupResponsive=this.responsive;if(!i&&r.value===t){i=true;r.checked=true}else{r.checked=false}}if(!i){this.value=undefined}return[2]}))}))};e.prototype.render=function(){return h(Host,{onDuetChange:this.onSelect,class:{horizontal:this.direction==="horizontal"}},h("duet-fieldset",{label:this.label,labelHidden:this.labelHidden,caption:this.caption,error:this.error,margin:this.margin,theme:this.theme},this.tooltip&&h("duet-tooltip",{slot:"tooltip",direction:this.tooltipDirection,accessibleInputLabel:this.label},this.tooltip),h("div",{class:{"duet-radio-group":true,"duet-no-stacking":!this.responsive}},h("slot",null))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{name:["updateRadios"],value:["updateRadios"],disabled:["updateRadios"],direction:["updateRadios"],responsive:["updateRadios"]}},enumerable:false,configurable:true});return e}();DuetRadioGroup.style=duetRadioGroupCss;export{DuetRadio as duet_radio,DuetRadioGroup as duet_radio_group};
|
|
4
|
+
*/import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-d5956898.js";import{i as inheritGlobalTheme}from"./themeable-component-cb76be7c.js";import{c as createID}from"./create-id-981107da.js";import{f as findCheckedOption,w as watchForOptions}from"./watch-options-dd55bce8.js";var duetRadioCss='*.sc-duet-radio,*.sc-duet-radio::after,*.sc-duet-radio::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-right:28px !important;margin-bottom:12px !important;display:inline-flex;width:100%;vertical-align:bottom;-webkit-tap-highlight-color:transparent}.sc-duet-radio-h:last-child,.sc-duet-radio-h:last-of-type{margin-right:0 !important}.vertical.sc-duet-radio-h{margin-right:0 !important}.horizontal.sc-duet-radio-h{margin-bottom:0 !important;width:auto}.horizontal.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}@media (min-width: 48em){.horizontal-responsive.sc-duet-radio-h{margin-right:28px !important;margin-bottom:0 !important;width:auto}.horizontal-responsive.sc-duet-radio-h:last-child,.horizontal-responsive.sc-duet-radio-h:last-of-type{margin-right:0 !important}.horizontal-responsive.sc-duet-radio-h .duet-label.sc-duet-radio span.sc-duet-radio{max-width:100%}}.duet-m-0.sc-duet-radio-h{margin:0 !important}.sc-duet-radio-h:last-child:not(:only-child){margin-right:0 !important;margin-bottom:0 !important}.duet-label.sc-duet-radio{position:relative;z-index:100;display:flex;width:100%;font-family:"localtapiola-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#00294d;cursor:pointer;background:transparent}.duet-theme-turva.sc-duet-radio .duet-label.sc-duet-radio{font-family:"turva-sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:#171c3a}.duet-label.sc-duet-radio span.sc-duet-radio{flex-grow:1;font-size:1rem}.duet-label-hidden.sc-duet-radio .duet-label.sc-duet-radio{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}.duet-radio-container.sc-duet-radio{position:relative;width:100%;height:100%}.duet-radio.sc-duet-radio{padding:14px !important;position:absolute;top:0;left:0;z-index:200;width:100%;height:100%;cursor:pointer;opacity:0}.duet-radio.sc-duet-radio+label.sc-duet-radio::before{z-index:100;flex-shrink:0;width:20px;height:20px;margin:2px 10px 1px 1px;content:"";background:white;border:1px solid #00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio+label.sc-duet-radio::before{border-color:#171c3a}.duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(0, 119, 179, 0.3), 0 0 0 1px #0077b3}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:focus+label.sc-duet-radio::before{box-shadow:0 0 0 4px rgba(23, 28, 58, 0.2), 0 0 0 1px #171c3a}.duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{position:absolute;top:6px;left:5px;z-index:200;flex-shrink:0;width:12px;height:12px;content:"";background:#00294d;border-radius:50%}.duet-theme-turva.sc-duet-radio .duet-radio.sc-duet-radio:checked+label.sc-duet-radio::after{background:#171c3a}.duet-radio[disabled].sc-duet-radio{cursor:default}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio{color:#747475}.duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfd2d4}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio+label.sc-duet-radio::before{border-color:#cfcfd1}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::before{border:1px solid #657787}.duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#657787}.duet-theme-turva.sc-duet-radio .duet-radio[disabled].sc-duet-radio:checked+label.sc-duet-radio::after{background:#747475;border-color:#747475}';var DuetRadio=function(){function e(e){var t=this;registerInstance(this,e);this.duetChange=createEvent(this,"duetChange",7);this.duetFocus=createEvent(this,"duetFocus",7);this.duetBlur=createEvent(this,"duetBlur",7);this.radioId=createID("DuetRadio");this.accessibleDetails=undefined;this.accessibleLabelledBy=undefined;this.accessibleDescription=undefined;this.margin="auto";this.theme="";this.disabled=false;this.required=false;this.blockEvents=false;this.label="label";this.onClick=function(e){e.stopPropagation()};this.onChange=function(e){t.checked=e.target.value;if(t.checked&&!t.blockEvents){t.duetChange.emit({originalEvent:e,checked:t.checked,value:t.value,component:"duet-radio"})}};this.onBlur=function(e){t.duetBlur.emit({originalEvent:e,checked:t.checked,value:t.value,component:"duet-radio"})};this.onFocus=function(e){t.duetFocus.emit({originalEvent:e,checked:t.checked,value:t.value,component:"duet-radio"})}}e.prototype.componentWillLoad=function(){inheritGlobalTheme(this);if(this.value===undefined){this.value=this.identifier}};e.prototype.setFocus=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.nativeInput.focus(e);return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.identifier||this.radioId;return h(Host,{onClick:this.onClick,class:{horizontal:this.groupDirection==="horizontal"&&!this.groupResponsive,"horizontal-responsive":this.groupDirection==="horizontal"&&this.groupResponsive,"duet-m-0":this.margin==="none"}},h("div",{class:{"duet-radio-container":true,"duet-theme-turva":this.theme==="turva"}},h("input",{type:"radio",onFocus:this.onFocus,onBlur:this.onBlur,onChange:this.onChange,value:this.value,tabindex:this.accessibleIndex,class:{"duet-radio":true,disabled:this.disabled||this.groupDisabled},checked:this.checked,disabled:this.disabled||this.groupDisabled,required:this.required,"aria-controls":this.accessibleControls,"aria-activedescendant":this.accessibleActiveDescendant,"aria-owns":this.accessibleOwns,"aria-describedby":this.accessibleDescribedBy,"aria-labelledby":this.accessibleLabelledBy,"aria-details":this.accessibleDetails,"aria-description":this.accessibleDescription,role:this.role,name:this.name,id:t,ref:function(t){return e.nativeInput=t}}),h("label",{class:"duet-label",htmlFor:t},h("span",null,this.label))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DuetRadio.style=duetRadioCss;var duetRadioGroupCss="*.sc-duet-radio-group,*.sc-duet-radio-group::after,*.sc-duet-radio-group::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-radio-group-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%}.horizontal.sc-duet-radio-group-h .duet-radio-group.sc-duet-radio-group{display:block}@media (min-width: 48em){.horizontal.sc-duet-radio-group-h .duet-radio-group.sc-duet-radio-group{display:flex}}.horizontal.sc-duet-radio-group-h .duet-radio-group.duet-no-stacking.sc-duet-radio-group{display:flex}.deut-radio-group.sc-duet-radio-group{width:100%}";var DuetRadioGroup=function(){function e(e){var t=this;registerInstance(this,e);this.direction="vertical";this.margin="auto";this.theme="";this.error="";this.tooltip="";this.tooltipDirection="auto";this.label="Label";this.labelHidden=false;this.caption="";this.responsive=false;this.onSelect=function(e){var i=e.target;if(i){t.value=i.value}e.cancelBubble=true}}e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var i=this;return __generator(this,(function(o){switch(o.label){case 0:e=this.element;if(!(this.value===undefined))return[3,2];t=findCheckedOption(e,"duet-radio");if(!(t!==undefined))return[3,2];return[4,t.componentOnReady()];case 1:o.sent();if(this.value===undefined){this.value=t.value}o.label=2;case 2:this.mutationO=watchForOptions(e,"duet-radio",(function(e){if(e!==undefined){e.componentOnReady().then((function(){i.value=e.value}))}else{i.updateRadios()}}));this.updateRadios();return[2]}}))}))};e.prototype.disconnectedCallback=function(){if(this.mutationO){this.mutationO.disconnect();this.mutationO=undefined}};e.prototype.componentWillLoad=function(){inheritGlobalTheme(this)};e.prototype.updateRadios=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,a,r;return __generator(this,(function(n){e=Array.from(this.element.querySelectorAll("duet-radio"));t=this.value;i=false;for(o=0,a=e;o<a.length;o++){r=a[o];r.name=this.name;r.groupDisabled=this.disabled;r.groupDirection=this.direction;r.groupResponsive=this.responsive;if(!i&&r.value===t){i=true;r.checked=true}else{r.checked=false}}if(!i){this.value=undefined}return[2]}))}))};e.prototype.render=function(){return h(Host,{onDuetChange:this.onSelect,class:{horizontal:this.direction==="horizontal"}},h("duet-fieldset",{label:this.label,labelHidden:this.labelHidden,caption:this.caption,error:this.error,margin:this.margin,theme:this.theme},this.tooltip&&h("duet-tooltip",{slot:"tooltip",direction:this.tooltipDirection,accessibleInputLabel:this.label},this.tooltip),h("div",{class:{"duet-radio-group":true,"duet-no-stacking":!this.responsive}},h("slot",null))))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{name:["updateRadios"],value:["updateRadios"],disabled:["updateRadios"],direction:["updateRadios"],responsive:["updateRadios"]}},enumerable:false,configurable:true});return e}();DuetRadioGroup.style=duetRadioGroupCss;export{DuetRadio as duet_radio,DuetRadioGroup as duet_radio_group};
|