@trendyol/baklava 3.0.0-beta.3 → 3.0.0-beta.31
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/README.md +4 -3
- package/dist/baklava-react.d.ts +88 -0
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava-vue.d.ts +11 -0
- package/dist/baklava.d.ts +11 -0
- package/dist/baklava.d.ts.map +1 -1
- package/dist/baklava.js +1 -1
- package/dist/{chunk-MACM4RPG.js → chunk-2GQCCDR3.js} +2 -2
- package/dist/chunk-2LP7VYJJ.js +20 -0
- package/dist/chunk-2LP7VYJJ.js.map +7 -0
- package/dist/{chunk-3QXRSN5E.js → chunk-4BZSILLM.js} +2 -2
- package/dist/{chunk-JZ3S4JFA.js → chunk-4T26H7PC.js} +2 -2
- package/dist/{chunk-X2KXJYXQ.js → chunk-5MOOXA2X.js} +6 -6
- package/dist/{chunk-X2KXJYXQ.js.map → chunk-5MOOXA2X.js.map} +2 -2
- package/dist/{chunk-LYOZ36IH.js → chunk-5TPDRTCU.js} +2 -2
- package/dist/chunk-6BSYS2G5.js +31 -0
- package/dist/chunk-6BSYS2G5.js.map +7 -0
- package/dist/{chunk-QXFCLEZB.js → chunk-73RGV4UX.js} +2 -2
- package/dist/chunk-7QNX2GPS.js +24 -0
- package/dist/chunk-7QNX2GPS.js.map +7 -0
- package/dist/chunk-B7ZEUBIV.js +63 -0
- package/dist/chunk-B7ZEUBIV.js.map +7 -0
- package/dist/chunk-C4DOPHMG.js +2 -0
- package/dist/chunk-C4DOPHMG.js.map +7 -0
- package/dist/chunk-C4GIIUCS.js +26 -0
- package/dist/chunk-C4GIIUCS.js.map +7 -0
- package/dist/chunk-CYLRPJKP.js +6 -0
- package/dist/chunk-CYLRPJKP.js.map +7 -0
- package/dist/chunk-DIS2PGBH.js +2 -0
- package/dist/chunk-DIS2PGBH.js.map +7 -0
- package/dist/{chunk-2YD3I4BZ.js → chunk-DZ77A43H.js} +6 -6
- package/dist/chunk-DZ77A43H.js.map +7 -0
- package/dist/chunk-EG7U7PM3.js +11 -0
- package/dist/chunk-EG7U7PM3.js.map +7 -0
- package/dist/{chunk-MG23TBA3.js → chunk-FQBDGFMR.js} +4 -4
- package/dist/{chunk-VXYXKLNG.js → chunk-FVBGMXMC.js} +2 -2
- package/dist/chunk-HYB2HRRX.js +11 -0
- package/dist/{chunk-L6BUT2FV.js.map → chunk-HYB2HRRX.js.map} +3 -3
- package/dist/chunk-HZ6A5QFC.js +2 -0
- package/dist/chunk-HZ6A5QFC.js.map +7 -0
- package/dist/{chunk-PWZJTYMH.js → chunk-IZTTP5LH.js} +2 -2
- package/dist/chunk-KOWS266A.js +77 -0
- package/dist/chunk-KOWS266A.js.map +7 -0
- package/dist/chunk-KPWKBI57.js +11 -0
- package/dist/chunk-KPWKBI57.js.map +7 -0
- package/dist/{chunk-OSNB4BPE.js → chunk-MND5TXTF.js} +2 -2
- package/dist/chunk-NGJM4NWA.js +4 -0
- package/dist/chunk-NGJM4NWA.js.map +7 -0
- package/dist/chunk-P7J47Z2J.js +107 -0
- package/dist/chunk-P7J47Z2J.js.map +7 -0
- package/dist/{chunk-YCHZB54C.js → chunk-Q6MAW2EF.js} +2 -2
- package/dist/{chunk-XLRX2X2I.js → chunk-QF4LGACD.js} +2 -2
- package/dist/{chunk-HULHLSIH.js → chunk-RQEU3SZQ.js} +4 -4
- package/dist/chunk-STMCW2R6.js +8 -0
- package/dist/chunk-STMCW2R6.js.map +7 -0
- package/dist/chunk-TRWCD65K.js +34 -0
- package/dist/chunk-TRWCD65K.js.map +7 -0
- package/dist/chunk-UCLJCOUS.js +5 -0
- package/dist/chunk-UCLJCOUS.js.map +7 -0
- package/dist/chunk-VJRVHJVZ.js +2 -0
- package/dist/chunk-VJRVHJVZ.js.map +7 -0
- package/dist/chunk-VU6LRFZR.js +26 -0
- package/dist/chunk-VU6LRFZR.js.map +7 -0
- package/dist/chunk-WEEGH2F4.js +2 -0
- package/dist/chunk-WEEGH2F4.js.map +7 -0
- package/dist/{chunk-57IOXMBV.js → chunk-WQTBAXMP.js} +5 -5
- package/dist/{chunk-PLUCMBSD.js → chunk-WXWKIQAK.js} +2 -2
- package/dist/{chunk-UERDT3VQ.js → chunk-X67Z2G2H.js} +4 -4
- package/dist/chunk-XDUIVR6I.js +2 -0
- package/dist/chunk-XDUIVR6I.js.map +7 -0
- package/dist/chunk-Y7B25ZG3.js +16 -0
- package/dist/chunk-Y7B25ZG3.js.map +7 -0
- package/dist/components/accordion-group/accordion/bl-accordion.d.ts +41 -0
- package/dist/components/accordion-group/accordion/bl-accordion.d.ts.map +1 -0
- package/dist/components/accordion-group/accordion/bl-accordion.js +2 -0
- package/dist/components/accordion-group/accordion/bl-accordion.js.map +7 -0
- package/dist/components/accordion-group/accordion/bl-accordion.test.d.ts +2 -0
- package/dist/components/accordion-group/accordion/bl-accordion.test.d.ts.map +1 -0
- package/dist/components/accordion-group/bl-accordion-group.d.ts +14 -0
- package/dist/components/accordion-group/bl-accordion-group.d.ts.map +1 -0
- package/dist/components/accordion-group/bl-accordion-group.js +2 -0
- package/dist/components/accordion-group/bl-accordion-group.js.map +7 -0
- package/dist/components/accordion-group/bl-accordion-group.test.d.ts +2 -0
- package/dist/components/accordion-group/bl-accordion-group.test.d.ts.map +1 -0
- package/dist/components/alert/bl-alert.js +1 -1
- package/dist/components/badge/bl-badge.js +1 -1
- package/dist/components/button/bl-button.d.ts +1 -0
- package/dist/components/button/bl-button.d.ts.map +1 -1
- package/dist/components/button/bl-button.js +1 -1
- package/dist/components/calendar/bl-calendar.constant.d.ts +13 -0
- package/dist/components/calendar/bl-calendar.constant.d.ts.map +1 -0
- package/dist/components/calendar/bl-calendar.constant.js +2 -0
- package/dist/components/calendar/bl-calendar.constant.js.map +7 -0
- package/dist/components/calendar/bl-calendar.d.ts +81 -0
- package/dist/components/calendar/bl-calendar.d.ts.map +1 -0
- package/dist/components/calendar/bl-calendar.js +2 -0
- package/dist/components/calendar/bl-calendar.js.map +7 -0
- package/dist/components/calendar/bl-calendar.types.d.ts +15 -0
- package/dist/components/calendar/bl-calendar.types.d.ts.map +1 -0
- package/dist/components/calendar/bl-calendar.types.js +1 -0
- package/dist/components/calendar/bl-calendar.types.js.map +7 -0
- package/dist/components/checkbox-group/bl-checkbox-group.d.ts +29 -2
- package/dist/components/checkbox-group/bl-checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.d.ts +15 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
- package/dist/components/dialog/bl-dialog.d.ts +7 -0
- package/dist/components/dialog/bl-dialog.d.ts.map +1 -1
- package/dist/components/dialog/bl-dialog.js +1 -1
- package/dist/components/dialog/bl-dialog.stories.d.ts +5 -0
- package/dist/components/dialog/bl-dialog.stories.d.ts.map +1 -1
- package/dist/components/dialog/bl-dialog.stories.js +46 -10
- package/dist/components/dialog/bl-dialog.stories.js.map +3 -3
- package/dist/components/drawer/bl-drawer.d.ts +7 -0
- package/dist/components/drawer/bl-drawer.d.ts.map +1 -1
- package/dist/components/drawer/bl-drawer.js +1 -1
- package/dist/components/dropdown/bl-dropdown.js +1 -1
- package/dist/components/dropdown/group/bl-dropdown-group.js +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.d.ts +1 -0
- package/dist/components/dropdown/item/bl-dropdown-item.d.ts.map +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
- package/dist/components/icon/bl-icon.js +1 -1
- package/dist/components/icon/icon-list.d.ts +1 -2
- package/dist/components/icon/icon-list.d.ts.map +1 -1
- package/dist/components/icon/icon-list.js +1 -1
- package/dist/components/icon/icon-list.js.map +4 -4
- package/dist/components/input/bl-input.d.ts +4 -0
- package/dist/components/input/bl-input.d.ts.map +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/notification/bl-notification.js +1 -1
- package/dist/components/notification/card/bl-notification-card.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/popover/bl-popover.d.ts.map +1 -1
- package/dist/components/popover/bl-popover.js +1 -1
- package/dist/components/progress-indicator/bl-progress-indicator.js +1 -1
- package/dist/components/radio-group/bl-radio-group.js +1 -1
- package/dist/components/radio-group/radio/bl-radio.js +1 -1
- package/dist/components/select/bl-select.d.ts +5 -0
- package/dist/components/select/bl-select.d.ts.map +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/dist/components/select/option/bl-select-option.js +1 -1
- package/dist/components/spinner/bl-spinner.d.ts +34 -0
- package/dist/components/spinner/bl-spinner.d.ts.map +1 -0
- package/dist/components/spinner/bl-spinner.js +2 -0
- package/dist/components/spinner/bl-spinner.js.map +7 -0
- package/dist/components/spinner/bl-spinner.test.d.ts +2 -0
- package/dist/components/spinner/bl-spinner.test.d.ts.map +1 -0
- package/dist/components/split-button/bl-split-button.d.ts +105 -0
- package/dist/components/split-button/bl-split-button.d.ts.map +1 -0
- package/dist/components/split-button/bl-split-button.js +2 -0
- package/dist/components/split-button/bl-split-button.js.map +7 -0
- package/dist/components/split-button/bl-split-button.test.d.ts +2 -0
- package/dist/components/split-button/bl-split-button.test.d.ts.map +1 -0
- package/dist/components/switch/bl-switch.js +1 -1
- package/dist/components/tab-group/bl-tab-group.js +1 -1
- package/dist/components/tab-group/tab/bl-tab.js +1 -1
- package/dist/components/tab-group/tab-panel/bl-tab-panel.js +1 -1
- package/dist/components/table/bl-table.d.ts +120 -0
- package/dist/components/table/bl-table.d.ts.map +1 -0
- package/dist/components/table/bl-table.js +2 -0
- package/dist/components/table/bl-table.js.map +7 -0
- package/dist/components/table/bl-table.test.d.ts +6 -0
- package/dist/components/table/bl-table.test.d.ts.map +1 -0
- package/dist/components/table/table-body/bl-table-body.d.ts +19 -0
- package/dist/components/table/table-body/bl-table-body.d.ts.map +1 -0
- package/dist/components/table/table-body/bl-table-body.js +2 -0
- package/dist/components/table/table-body/bl-table-body.js.map +7 -0
- package/dist/components/table/table-body/bl-table-body.test.d.ts +2 -0
- package/dist/components/table/table-body/bl-table-body.test.d.ts.map +1 -0
- package/dist/components/table/table-cell/bl-table-cell.d.ts +35 -0
- package/dist/components/table/table-cell/bl-table-cell.d.ts.map +1 -0
- package/dist/components/table/table-cell/bl-table-cell.js +2 -0
- package/dist/components/table/table-cell/bl-table-cell.js.map +7 -0
- package/dist/components/table/table-cell/bl-table-cell.test.d.ts +2 -0
- package/dist/components/table/table-cell/bl-table-cell.test.d.ts.map +1 -0
- package/dist/components/table/table-header/bl-table-header.d.ts +22 -0
- package/dist/components/table/table-header/bl-table-header.d.ts.map +1 -0
- package/dist/components/table/table-header/bl-table-header.js +2 -0
- package/dist/components/table/table-header/bl-table-header.js.map +7 -0
- package/dist/components/table/table-header/bl-table-header.test.d.ts +2 -0
- package/dist/components/table/table-header/bl-table-header.test.d.ts.map +1 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.d.ts +43 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.d.ts.map +1 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.js +2 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.js.map +7 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.test.d.ts +2 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.test.d.ts.map +1 -0
- package/dist/components/table/table-row/bl-table-row.d.ts +31 -0
- package/dist/components/table/table-row/bl-table-row.d.ts.map +1 -0
- package/dist/components/table/table-row/bl-table-row.js +2 -0
- package/dist/components/table/table-row/bl-table-row.js.map +7 -0
- package/dist/components/table/table-row/bl-table-row.test.d.ts +2 -0
- package/dist/components/table/table-row/bl-table-row.test.d.ts.map +1 -0
- package/dist/components/textarea/bl-textarea.js +1 -1
- package/dist/components/tooltip/bl-tooltip.d.ts +7 -1
- package/dist/components/tooltip/bl-tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/bl-tooltip.js +1 -1
- package/dist/custom-elements.json +1899 -686
- package/dist/localization.d.ts +1 -0
- package/dist/localization.d.ts.map +1 -1
- package/dist/localization.js +1 -1
- package/dist/localization.js.map +1 -1
- package/dist/utilities/elements.d.ts +1 -0
- package/dist/utilities/elements.d.ts.map +1 -1
- package/dist/utilities/style-to-px-converter.test.d.ts +2 -0
- package/dist/utilities/style-to-px-converter.test.d.ts.map +1 -0
- package/dist/utilities/style-to-px.converter.d.ts +2 -0
- package/dist/utilities/style-to-px.converter.d.ts.map +1 -0
- package/package.json +10 -1
- package/dist/assets/academy.svg +0 -3
- package/dist/assets/account.svg +0 -3
- package/dist/assets/add_note.svg +0 -4
- package/dist/assets/add_part.svg +0 -6
- package/dist/assets/add_photo.svg +0 -4
- package/dist/assets/add_product.svg +0 -5
- package/dist/assets/alert.svg +0 -3
- package/dist/assets/announcement.svg +0 -4
- package/dist/assets/archive.svg +0 -3
- package/dist/assets/arrow_down.svg +0 -3
- package/dist/assets/arrow_left.svg +0 -3
- package/dist/assets/arrow_right.svg +0 -3
- package/dist/assets/arrow_up.svg +0 -3
- package/dist/assets/attach.svg +0 -3
- package/dist/assets/award.svg +0 -6
- package/dist/assets/back.svg +0 -3
- package/dist/assets/back_fill.svg +0 -3
- package/dist/assets/badge.svg +0 -5
- package/dist/assets/barcode.svg +0 -3
- package/dist/assets/bill.svg +0 -3
- package/dist/assets/book.svg +0 -3
- package/dist/assets/browser.svg +0 -3
- package/dist/assets/burger.svg +0 -3
- package/dist/assets/calendar.svg +0 -5
- package/dist/assets/camera.svg +0 -3
- package/dist/assets/camera_off.svg +0 -4
- package/dist/assets/campaign.svg +0 -3
- package/dist/assets/change.svg +0 -4
- package/dist/assets/change_fill.svg +0 -3
- package/dist/assets/chart.svg +0 -5
- package/dist/assets/chatbot.svg +0 -3
- package/dist/assets/check.svg +0 -3
- package/dist/assets/check_fill.svg +0 -3
- package/dist/assets/clock.svg +0 -3
- package/dist/assets/close.svg +0 -3
- package/dist/assets/close_fill.svg +0 -3
- package/dist/assets/code.svg +0 -3
- package/dist/assets/coin.svg +0 -3
- package/dist/assets/compass.svg +0 -3
- package/dist/assets/complain.svg +0 -3
- package/dist/assets/confetti.svg +0 -9
- package/dist/assets/copy.svg +0 -3
- package/dist/assets/copy_checked.svg +0 -3
- package/dist/assets/coupon.svg +0 -3
- package/dist/assets/delete.svg +0 -4
- package/dist/assets/desktop.svg +0 -3
- package/dist/assets/desktop_filled.svg +0 -4
- package/dist/assets/dialog.svg +0 -3
- package/dist/assets/disable.svg +0 -3
- package/dist/assets/dislike.svg +0 -3
- package/dist/assets/document.svg +0 -3
- package/dist/assets/document_search.svg +0 -4
- package/dist/assets/donation.svg +0 -4
- package/dist/assets/download.svg +0 -5
- package/dist/assets/drag_and_drop.svg +0 -3
- package/dist/assets/edit.svg +0 -4
- package/dist/assets/excel.svg +0 -3
- package/dist/assets/exit.svg +0 -5
- package/dist/assets/expand.svg +0 -8
- package/dist/assets/export.svg +0 -3
- package/dist/assets/express.svg +0 -3
- package/dist/assets/express_delivery.svg +0 -6
- package/dist/assets/express_furniture.svg +0 -6
- package/dist/assets/external_link.svg +0 -4
- package/dist/assets/external_share.svg +0 -7
- package/dist/assets/eye_off.svg +0 -4
- package/dist/assets/eye_on.svg +0 -3
- package/dist/assets/facebook.svg +0 -3
- package/dist/assets/filter.svg +0 -3
- package/dist/assets/finance_accounting.svg +0 -3
- package/dist/assets/fire.svg +0 -3
- package/dist/assets/flag.svg +0 -3
- package/dist/assets/flash.svg +0 -3
- package/dist/assets/flash_fill.svg +0 -3
- package/dist/assets/forward.svg +0 -3
- package/dist/assets/full_size.svg +0 -3
- package/dist/assets/gift.svg +0 -6
- package/dist/assets/global_export.svg +0 -3
- package/dist/assets/globe.svg +0 -5
- package/dist/assets/go_forward.svg +0 -3
- package/dist/assets/graphic.svg +0 -3
- package/dist/assets/graphic_decrease.svg +0 -3
- package/dist/assets/group_of_people.svg +0 -8
- package/dist/assets/growth.svg +0 -3
- package/dist/assets/hamburger_menu.svg +0 -5
- package/dist/assets/handshake.svg +0 -4
- package/dist/assets/happy.svg +0 -3
- package/dist/assets/heart.svg +0 -3
- package/dist/assets/heart_fill.svg +0 -3
- package/dist/assets/heartbeat.svg +0 -3
- package/dist/assets/help.svg +0 -3
- package/dist/assets/history.svg +0 -3
- package/dist/assets/home.svg +0 -3
- package/dist/assets/hourglass.svg +0 -3
- package/dist/assets/image.svg +0 -5
- package/dist/assets/incognito.svg +0 -4
- package/dist/assets/info.svg +0 -3
- package/dist/assets/instagram.svg +0 -3
- package/dist/assets/label.svg +0 -3
- package/dist/assets/left_sided_arrow.svg +0 -3
- package/dist/assets/light_bulb.svg +0 -3
- package/dist/assets/like.svg +0 -3
- package/dist/assets/link.svg +0 -3
- package/dist/assets/listing.svg +0 -3
- package/dist/assets/live_monitor.svg +0 -3
- package/dist/assets/live_support.svg +0 -3
- package/dist/assets/loading.svg +0 -4
- package/dist/assets/lock.svg +0 -4
- package/dist/assets/magic_wand.svg +0 -3
- package/dist/assets/mail.svg +0 -3
- package/dist/assets/mail_opened.svg +0 -3
- package/dist/assets/map.svg +0 -4
- package/dist/assets/market.svg +0 -13
- package/dist/assets/market_order_back.svg +0 -3
- package/dist/assets/market_order_cancel.svg +0 -3
- package/dist/assets/market_order_change.svg +0 -3
- package/dist/assets/market_order_check.svg +0 -3
- package/dist/assets/market_processing.svg +0 -7
- package/dist/assets/meal_bag.svg +0 -4
- package/dist/assets/medal.svg +0 -5
- package/dist/assets/message.svg +0 -3
- package/dist/assets/metric_decrease.svg +0 -4
- package/dist/assets/metric_increase.svg +0 -4
- package/dist/assets/metric_minus.svg +0 -4
- package/dist/assets/microphone.svg +0 -3
- package/dist/assets/microphone_off.svg +0 -12
- package/dist/assets/minus.svg +0 -3
- package/dist/assets/minus_fill.svg +0 -3
- package/dist/assets/mobile.svg +0 -3
- package/dist/assets/mobile_fill.svg +0 -3
- package/dist/assets/mobile_settings.svg +0 -5
- package/dist/assets/money.svg +0 -4
- package/dist/assets/money_transfer.svg +0 -3
- package/dist/assets/motorcycle.svg +0 -3
- package/dist/assets/motorcycle_check.svg +0 -3
- package/dist/assets/new_store.svg +0 -3
- package/dist/assets/normal.svg +0 -3
- package/dist/assets/notice.svg +0 -7
- package/dist/assets/notification.svg +0 -3
- package/dist/assets/offers.svg +0 -5
- package/dist/assets/order.svg +0 -3
- package/dist/assets/order_back.svg +0 -3
- package/dist/assets/order_box.svg +0 -3
- package/dist/assets/order_boxes.svg +0 -14
- package/dist/assets/order_cancel.svg +0 -4
- package/dist/assets/order_check.svg +0 -3
- package/dist/assets/order_return.svg +0 -6
- package/dist/assets/order_settings.svg +0 -6
- package/dist/assets/order_time.svg +0 -4
- package/dist/assets/order_tracking.svg +0 -3
- package/dist/assets/paper.svg +0 -3
- package/dist/assets/partial_approve.svg +0 -6
- package/dist/assets/pause.svg +0 -3
- package/dist/assets/pause_fill.svg +0 -3
- package/dist/assets/people.svg +0 -3
- package/dist/assets/phone.svg +0 -3
- package/dist/assets/phone_settings.svg +0 -4
- package/dist/assets/photo.svg +0 -3
- package/dist/assets/photo_off.svg +0 -3
- package/dist/assets/pie_chart.svg +0 -4
- package/dist/assets/pie_chart_report.svg +0 -3
- package/dist/assets/pin.svg +0 -3
- package/dist/assets/play.svg +0 -3
- package/dist/assets/play_fill.svg +0 -3
- package/dist/assets/plus.svg +0 -3
- package/dist/assets/plus_fill.svg +0 -3
- package/dist/assets/preview.svg +0 -4
- package/dist/assets/price_settings.svg +0 -4
- package/dist/assets/print.svg +0 -3
- package/dist/assets/product.svg +0 -3
- package/dist/assets/profile.svg +0 -3
- package/dist/assets/profile_check.svg +0 -5
- package/dist/assets/profile_star.svg +0 -3
- package/dist/assets/puzzle.svg +0 -3
- package/dist/assets/qr.svg +0 -6
- package/dist/assets/report.svg +0 -4
- package/dist/assets/review.svg +0 -3
- package/dist/assets/right_sided_arrow.svg +0 -3
- package/dist/assets/rocket.svg +0 -4
- package/dist/assets/rotate.svg +0 -3
- package/dist/assets/sad.svg +0 -3
- package/dist/assets/save.svg +0 -4
- package/dist/assets/search.svg +0 -8
- package/dist/assets/send.svg +0 -3
- package/dist/assets/send_mail.svg +0 -6
- package/dist/assets/services.svg +0 -4
- package/dist/assets/settings.svg +0 -7
- package/dist/assets/share.svg +0 -5
- package/dist/assets/shopping_bag.svg +0 -8
- package/dist/assets/shopping_bag_add.svg +0 -3
- package/dist/assets/shopping_bag_back.svg +0 -9
- package/dist/assets/shopping_bag_cancel.svg +0 -9
- package/dist/assets/shopping_bag_discount.svg +0 -3
- package/dist/assets/shopping_bag_return.svg +0 -10
- package/dist/assets/sorting.svg +0 -4
- package/dist/assets/sound_off.svg +0 -4
- package/dist/assets/sound_on.svg +0 -3
- package/dist/assets/split_money.svg +0 -4
- package/dist/assets/star.svg +0 -3
- package/dist/assets/star_double.svg +0 -4
- package/dist/assets/star_fill.svg +0 -3
- package/dist/assets/star_triple.svg +0 -3
- package/dist/assets/stop.svg +0 -3
- package/dist/assets/stop_fill.svg +0 -3
- package/dist/assets/store.svg +0 -3
- package/dist/assets/store_performance.svg +0 -4
- package/dist/assets/suitcase.svg +0 -3
- package/dist/assets/support.svg +0 -3
- package/dist/assets/target.svg +0 -5
- package/dist/assets/ticket.svg +0 -3
- package/dist/assets/translation.svg +0 -3
- package/dist/assets/truck.svg +0 -6
- package/dist/assets/turn_back.svg +0 -3
- package/dist/assets/turn_back_fill.svg +0 -3
- package/dist/assets/two_sided_arrow.svg +0 -3
- package/dist/assets/unlock.svg +0 -4
- package/dist/assets/upload.svg +0 -5
- package/dist/assets/user_management.svg +0 -3
- package/dist/assets/vacation_mode.svg +0 -4
- package/dist/assets/very_happy.svg +0 -3
- package/dist/assets/very_sad.svg +0 -3
- package/dist/assets/wallet.svg +0 -3
- package/dist/assets/warehouse.svg +0 -3
- package/dist/assets/warning.svg +0 -3
- package/dist/assets/youtube.svg +0 -3
- package/dist/assets/zoom_in.svg +0 -3
- package/dist/assets/zoom_out.svg +0 -3
- package/dist/chunk-2YD3I4BZ.js.map +0 -7
- package/dist/chunk-3B64VOWB.js +0 -2
- package/dist/chunk-3B64VOWB.js.map +0 -7
- package/dist/chunk-6H54TTNK.js +0 -20
- package/dist/chunk-6H54TTNK.js.map +0 -7
- package/dist/chunk-A4RJP5R7.js +0 -23
- package/dist/chunk-A4RJP5R7.js.map +0 -7
- package/dist/chunk-AAGDUS7G.js +0 -11
- package/dist/chunk-AAGDUS7G.js.map +0 -7
- package/dist/chunk-DJOD4BTL.js +0 -2
- package/dist/chunk-DJOD4BTL.js.map +0 -7
- package/dist/chunk-GHYIIGW6.js +0 -110
- package/dist/chunk-GHYIIGW6.js.map +0 -7
- package/dist/chunk-L6BUT2FV.js +0 -11
- package/dist/chunk-Q7LYRUYQ.js +0 -21
- package/dist/chunk-Q7LYRUYQ.js.map +0 -7
- package/dist/chunk-QY5DKRF5.js +0 -26
- package/dist/chunk-QY5DKRF5.js.map +0 -7
- package/dist/chunk-UP2BMLLI.js +0 -33
- package/dist/chunk-UP2BMLLI.js.map +0 -7
- package/dist/chunk-WPMIVZ4A.js +0 -23
- package/dist/chunk-WPMIVZ4A.js.map +0 -7
- package/dist/chunk-YML6L24Q.js +0 -5
- package/dist/chunk-YML6L24Q.js.map +0 -7
- /package/dist/{chunk-MACM4RPG.js.map → chunk-2GQCCDR3.js.map} +0 -0
- /package/dist/{chunk-3QXRSN5E.js.map → chunk-4BZSILLM.js.map} +0 -0
- /package/dist/{chunk-JZ3S4JFA.js.map → chunk-4T26H7PC.js.map} +0 -0
- /package/dist/{chunk-LYOZ36IH.js.map → chunk-5TPDRTCU.js.map} +0 -0
- /package/dist/{chunk-QXFCLEZB.js.map → chunk-73RGV4UX.js.map} +0 -0
- /package/dist/{chunk-MG23TBA3.js.map → chunk-FQBDGFMR.js.map} +0 -0
- /package/dist/{chunk-VXYXKLNG.js.map → chunk-FVBGMXMC.js.map} +0 -0
- /package/dist/{chunk-PWZJTYMH.js.map → chunk-IZTTP5LH.js.map} +0 -0
- /package/dist/{chunk-OSNB4BPE.js.map → chunk-MND5TXTF.js.map} +0 -0
- /package/dist/{chunk-YCHZB54C.js.map → chunk-Q6MAW2EF.js.map} +0 -0
- /package/dist/{chunk-XLRX2X2I.js.map → chunk-QF4LGACD.js.map} +0 -0
- /package/dist/{chunk-HULHLSIH.js.map → chunk-RQEU3SZQ.js.map} +0 -0
- /package/dist/{chunk-57IOXMBV.js.map → chunk-WQTBAXMP.js.map} +0 -0
- /package/dist/{chunk-PLUCMBSD.js.map → chunk-WXWKIQAK.js.map} +0 -0
- /package/dist/{chunk-UERDT3VQ.js.map → chunk-X67Z2G2H.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/dropdown/bl-dropdown.css", "../src/components/dropdown/bl-dropdown.ts", "../src/components/dropdown/item/bl-dropdown-item.css", "../src/components/dropdown/item/bl-dropdown-item.ts", "../src/components/split-button/bl-split-button.css", "../src/components/split-button/bl-split-button.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{position:relative;display:inline-block}:host([kind=\"neutral\"]) bl-popover{--bl-popover-border-color:var(--bl-color-neutral-darker)}:host([kind=\"success\"]) bl-popover{--bl-popover-border-color:var(--bl-color-success)}:host([kind=\"danger\"]) bl-popover{--bl-popover-border-color:var(--bl-color-danger)}.popover-content{display:flex;flex-direction:column;gap:var(--bl-size-xs)}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../button/bl-button\";\nimport BlButton, { ButtonSize, ButtonVariant, ButtonKind } from \"../button/bl-button\";\nimport BlPopover from \"../popover/bl-popover\";\nimport style from \"./bl-dropdown.css\";\nimport BlDropdownItem, { blDropdownItemTag } from \"./item/bl-dropdown-item\";\n\nexport const blDropdownTag = \"bl-dropdown\";\n\n/**\n * @tag bl-dropdown\n * @summary Baklava Dropdown component\n */\n@customElement(blDropdownTag)\nexport default class BlDropdown extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\"bl-popover\")\n private _popover: BlPopover;\n\n @query(\"bl-button\")\n private _button: BlButton;\n\n @state() private _isPopoverOpen = false;\n\n /**\n * Sets the dropdown button label\n */\n @property({ type: String, reflect: true })\n label: string;\n\n /**\n * Sets the dropdown button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = \"primary\";\n\n /**\n * Sets the dropdown button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the dropdown button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Fires when dropdown opened\n */\n @event(\"bl-dropdown-open\") private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when dropdown closed\n */\n @event(\"bl-dropdown-close\") private onClose: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"keydown\", this.handleKeyDown);\n }\n\n firstUpdated() {\n // `_button` will be undefined during the initial render.\n // To ensure proper rendering, we set `_popover.target` after the template has been created.\n this._popover.target = this._button;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n private _handleClick() {\n !this._isPopoverOpen && !this.disabled ? this.open() : this.close();\n }\n\n private focusedOptionIndex = -1;\n\n private handleKeyDown(event: KeyboardEvent) {\n // Next action\n if ([\"ArrowDown\", \"ArrowRight\"].includes(event.key)) {\n this.focusedOptionIndex++;\n\n // Previous action\n } else if ([\"ArrowUp\", \"ArrowLeft\"].includes(event.key)) {\n this.focusedOptionIndex--;\n // Select action\n } else if (event.key === \"Escape\") {\n this.focusedOptionIndex = -1;\n this.close();\n return;\n } else {\n // Other keys are not our interest here\n return;\n }\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.options.length - 1)\n );\n\n this.options[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n\n get options(): BlDropdownItem[] {\n return [...this.querySelectorAll(blDropdownItemTag)];\n }\n\n open() {\n this._isPopoverOpen = true;\n this._popover.show();\n this.onOpen(\"Dropdown opened!\");\n }\n\n close() {\n this._isPopoverOpen = false;\n this._popover.visible && this._popover.hide();\n this.onClose(\"Dropdown closed!\");\n }\n\n render(): TemplateResult {\n return html`<bl-button\n dropdown\n .active=${this.opened}\n ?disabled=${this.disabled}\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n @bl-click=\"${this._handleClick}\"\n >\n ${this.label}\n </bl-button>\n <bl-popover fit-size placement=\"bottom-start\" @bl-popover-hide=\"${this.close}\"\n ><div class=\"popover-content\">\n <slot></slot></div\n ></bl-popover> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blDropdownTag]: BlDropdown;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{width:100%;--bl-button-display:block;--bl-button-justify:start}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, TemplateResult } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport \"../../button/bl-button\";\nimport BlButton from \"../../button/bl-button\";\nimport { BaklavaIcon } from \"../../icon/icon-list\";\nimport type BlSplitButton from \"../../split-button/bl-split-button\";\nimport { blSplitButtonTag } from \"../../split-button/bl-split-button\";\nimport type BlDropdown from \"../bl-dropdown\";\nimport { blDropdownTag } from \"../bl-dropdown\";\nimport type BlDropdownGroup from \"../group/bl-dropdown-group\";\nimport { blDropdownGroupTag } from \"../group/bl-dropdown-group\";\nimport style from \"./bl-dropdown-item.css\";\n\nexport const blDropdownItemTag = \"bl-dropdown-item\";\n\n/**\n * @tag bl-dropdown-item\n * @summary Baklava Dropdown Item component\n */\n@customElement(blDropdownItemTag)\nexport default class BlDropdownItem extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n\n @property({ type: String })\n icon?: BaklavaIcon;\n\n @event(\"bl-dropdown-item-click\") private onClick: EventDispatcher<string>;\n\n private _handleClick() {\n this.BlDropdownField?.close();\n this.BlSplitButtonField?.close();\n this.onClick(\"Action clicked!\");\n }\n\n @query(\"[role=menuitem]\") private menuElement: BlButton;\n\n /**\n * Focuses this action\n */\n focus() {\n this.menuElement.focus();\n }\n\n private BlDropdownGroupField: BlDropdownGroup | null;\n private BlDropdownField: BlDropdown | null;\n private BlSplitButtonField: BlSplitButton | null;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.BlDropdownGroupField = this.closest<BlDropdownGroup>(blDropdownGroupTag);\n this.BlDropdownField = this.closest<BlDropdown>(blDropdownTag);\n this.BlSplitButtonField = this.closest<BlSplitButton>(blSplitButtonTag);\n\n if (!this.BlDropdownField && !this.BlDropdownGroupField && !this.BlSplitButtonField) {\n console.warn(\n `bl-dropdown-item is designed to be used inside a ${blDropdownGroupTag}, ${blDropdownTag} or ${blSplitButtonTag}`,\n this\n );\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n\n render(): TemplateResult {\n return html`<bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"${ifDefined(this.icon)}\"\n role=\"menuitem\"\n @click=\"${this._handleClick}\"\n ><slot></slot>\n </bl-button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blDropdownItemTag]: BlDropdownItem;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{position:relative;display:inline-block}:host([kind=\"neutral\"]) bl-popover{--bl-popover-border-color:var(--bl-color-neutral-darker)}:host([kind=\"success\"]) bl-popover{--bl-popover-border-color:var(--bl-color-success)}:host([kind=\"danger\"]) bl-popover{--bl-popover-border-color:var(--bl-color-danger)}.split-button-container{display:flex}.split-main-button{width:100%;--bl-border-radius-m:calc(var(--bl-size-xs) / 2) 0 0 calc(var(--bl-size-xs) / 2)}.split-main-button:focus{--bl-border-radius-l:calc(var(--bl-size-m) / 2) 0 0 calc(var(--bl-size-m) / 2)}.dropdown-button{--bl-border-radius-m:0 calc(var(--bl-size-xs) / 2) calc(var(--bl-size-xs) / 2) 0}.dropdown-button:focus{--bl-border-radius-l:0 calc(var(--bl-size-m) / 2) calc(var(--bl-size-m) / 2) 0}:host([variant=\"secondary\"]) .dropdown-button{left:-1px}:host([dropdown-disabled][variant=\"secondary\"]) .dropdown-button{left:0}.split-divider{display:block;height:var(--bl-size-2xl);width:1px;background-color:var(--bl-color-neutral-full)}:host([variant=\"secondary\"]) .split-divider{display:none}:host([size=\"small\"]) .split-divider{height:var(--bl-size-xl)}:host([size=\"large\"]) .split-divider{height:var(--bl-size-3xl)}:host([dropdown-disabled][disabled]) .split-divider{display:block;background-color:var(--bl-color-neutral-lighter)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { ReferenceElement } from \"@floating-ui/core\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../button/bl-button\";\nimport { TargetType } from \"../button/bl-button\";\nimport { ButtonSize, ButtonVariant, ButtonKind } from \"../button/bl-button\";\nimport BlButton from \"../button/bl-button\";\nimport BlDropdownItem, { blDropdownItemTag } from \"../dropdown/item/bl-dropdown-item\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport BlPopover from \"../popover/bl-popover\";\nimport style from \"./bl-split-button.css\";\n\nexport const blSplitButtonTag = \"bl-split-button\";\n\n/**\n * @tag bl-split-button\n * @summary Baklava Split Button component\n */\n\n@customElement(blSplitButtonTag)\nexport default class BlSplitButton extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\"#split-button-container\") private trigger: ReferenceElement;\n\n @query(\"bl-popover\")\n private _popover: BlPopover;\n\n @query(\"#split-main-button\")\n private mainButton: BlButton;\n\n @query(\"#dropdown-button\")\n private dropdownButton: BlButton;\n\n @state() private _isPopoverOpen = false;\n\n /**\n * Sets the split button label\n */\n @property({ type: String, reflect: true })\n label: string;\n\n /**\n * Sets the split button variant\n */\n @property({ type: String, reflect: true })\n variant: Exclude<ButtonVariant, \"tertiary\"> = \"primary\";\n\n /**\n * Sets the split button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the split button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Set link url. If set, split main button will be rendered as anchor tag.\n */\n @property({ type: String, reflect: true })\n href: string;\n\n /**\n * Sets main button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets loading state of button\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets the button label for loading status.\n */\n @property({ type: String, attribute: \"loading-label\" })\n loadingLabel: string;\n\n /**\n * Sets dropdown button as disabled\n */\n @property({ attribute: \"dropdown-disabled\", type: Boolean })\n dropdownDisabled = false;\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n @property({ type: String })\n icon?: BaklavaIcon;\n\n /**\n * Sets the anchor target. Used when `href` is set.\n */\n @property({ type: String })\n target?: TargetType = \"_self\";\n\n /**\n * Sets the type of the button. Set `submit` to use button as the submitter of parent form.\n */\n @property({ type: String })\n type: \"submit\";\n\n /**\n * Sets button to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the associated form of the button. Use when `type` is set to `submit` and button is not inside the target form.\n */\n @property({ type: String })\n form: HTMLFormElement | string;\n\n /**\n * Fires when dropdown opened\n */\n @event(\"bl-dropdown-open\") private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when dropdown closed\n */\n @event(\"bl-dropdown-close\") private onClose: EventDispatcher<string>;\n\n /**\n * Fires when main button click\n */\n @event(\"bl-click\") private onClick: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keydown\", this.handleKeyDown);\n }\n\n firstUpdated() {\n // To ensure proper rendering, we set `_popover.target` after the template has been created.\n this._popover.target = this.trigger;\n this.dropdownButton.addEventListener(\"bl-click\", e => e.stopPropagation());\n this.mainButton.addEventListener(\"bl-click\", e => e.stopPropagation());\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n private _handleClick() {\n !this._isPopoverOpen && !this.dropdownDisabled ? this.open() : this.close();\n }\n\n private _handlePrimaryClick() {\n this.onClick(\"Click event fired!\");\n }\n\n private focusedOptionIndex = -1;\n\n private handleKeyDown(event: KeyboardEvent) {\n // Next action\n if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowRight\"].includes(event.key)) {\n this.focusedOptionIndex++;\n // Previous action\n } else if (this._isPopoverOpen && [\"ArrowUp\", \"ArrowLeft\"].includes(event.key)) {\n this.focusedOptionIndex--;\n // Select action\n } else if (this._isPopoverOpen && event.key === \"Escape\") {\n this.focusedOptionIndex = -1;\n this.close();\n return;\n } else {\n // Other keys are not our interest here\n return;\n }\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.options.length - 1)\n );\n\n this.options[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n\n get options(): BlDropdownItem[] {\n return [...this.querySelectorAll(blDropdownItemTag)];\n }\n\n open() {\n this._isPopoverOpen = true;\n this._popover.show();\n this.onOpen(\"Dropdown opened!\");\n }\n\n close() {\n if (!this._isPopoverOpen) {\n return;\n }\n\n this._isPopoverOpen = false;\n this._popover.visible && this._popover.hide();\n this.onClose(\"Dropdown closed!\");\n }\n\n render(): TemplateResult {\n return html` <div class=\"split-button-container\" id=\"split-button-container\">\n <bl-button\n id=\"split-main-button\"\n class=\"split-main-button\"\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n loading-label=\"${ifDefined(this.loadingLabel)}\"\n icon=\"${ifDefined(this.icon)}\"\n href=\"${ifDefined(this.type)}\"\n ?disabled=\"${this.disabled}\"\n ?loading=\"${this.loading}\"\n type=\"${this.type}\"\n target=\"${ifDefined(this.target)}\"\n form=\"${ifDefined(this.form)}\"\n ?autofocus=\"${this.autofocus}\"\n @bl-click=\"${this._handlePrimaryClick}\"\n >\n ${this.label}\n </bl-button>\n <div class=\"split-divider\"></div>\n <bl-button\n id=\"dropdown-button\"\n class=\"dropdown-button\"\n .active=\"${this.opened}\"\n icon=\"${this.opened ? \"arrow_up\" : \"arrow_down\"}\"\n ?disabled=\"${this.dropdownDisabled}\"\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n ?loading=\"${this.loading}\"\n label=\"split-dropdown-button\"\n @bl-click=\"${this._handleClick}\"\n >\n </bl-button>\n <bl-popover fit-size placement=\"bottom-start\" @bl-popover-hide=\"${this.close}\">\n <div class=\"popover-content\">\n <slot></slot>\n </div>\n </bl-popover>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blSplitButtonTag]: BlSplitButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "8QACO,IAAMA,EAASC,+XACfC,EAAQF,ECOR,IAAMG,EAAgB,cAORC,EAArB,cAAwCC,CAAW,CAAnD,kCAWW,KAAQ,eAAiB,GAYlC,aAAyB,UAMzB,UAAmB,UAMnB,UAAmB,SAMnB,cAAW,GAoCX,KAAQ,mBAAqB,GA5E7B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAkDA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,KAAK,iBAAiB,UAAW,K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CAAC,GAjFPH,EAkFnB,sBAMAO,EAAA,CADCJ,EAAS,CAAE,KAAM,MAAO,CAAC,GAvFPH,EAwFnB,oBAMAO,EAAA,CADCJ,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA7FvBH,EA8FnB,yBAMAO,EAAA,CADCJ,EAAS,CAAE,KAAM,MAAO,CAAC,GAnGPH,EAoGnB,oBAKmCO,EAAA,CAAlCH,EAAM,kBAAkB,GAzGNJ,EAyGgB,sBAKCO,EAAA,CAAnCH,EAAM,mBAAmB,GA9GPJ,EA8GiB,uBAKTO,EAAA,CAA1BH,EAAM,UAAU,GAnHEJ,EAmHQ,uBAnHRA,EAArBO,EAAA,CADCJ,EAAcJ,CAAgB,GACVC",
|
|
6
|
+
"names": ["styles", "i", "bl_dropdown_default", "blDropdownTag", "BlDropdown", "s", "bl_dropdown_default", "event", "blDropdownItemTag", "x", "__decorateClass", "i", "t", "e", "styles", "i", "bl_dropdown_item_default", "blDropdownItemTag", "BlDropdownItem", "s", "bl_dropdown_item_default", "_a", "_b", "blDropdownGroupTag", "blDropdownTag", "blSplitButtonTag", "x", "__decorateClass", "e", "event", "i", "styles", "i", "bl_split_button_default", "blSplitButtonTag", "BlSplitButton", "s", "bl_split_button_default", "e", "event", "blDropdownItemTag", "x", "__decorateClass", "i", "t"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u}from"./chunk-VJRVHJVZ.js";import{a as n}from"./chunk-DIS2PGBH.js";import{a as c,b as h}from"./chunk-5MOOXA2X.js";import{a,b,f as d}from"./chunk-4OT5AMS5.js";import{d as l}from"./chunk-IZ2LK5GK.js";var f=a`:host{display:table-row}:host([checked]),:host([checked]) ::slotted(bl-table-cell){background-color:var(--bl-color-primary-contrast)}:host([disabled]),:host([disabled]) ::slotted(bl-table-cell){background-color:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}:host(:not([checked], [disabled]).__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell),:host(:not([checked], [disabled]):hover),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell){background-color:var(--bl-color-tertiary-background)}:host ::slotted(*:first-child){border-left:none}:host ::slotted(*:last-child){border-right:none}:host(:first-child) ::slotted(bl-table-header-cell){border-top:none;border-right:none}:host(:first-child) ::slotted(bl-table-header-cell:first-child){border-top-left-radius:var(--bl-size-3xs)}:host(:first-child) ::slotted(bl-table-header-cell:last-child){border-top-right-radius:var(--bl-size-3xs);border-right:1px}:host(:last-child) ::slotted(bl-table-cell){border-bottom:none}:host(:first-child) ::slotted(bl-table-cell){border-top:none}:host(:last-child) ::slotted(bl-table-cell:first-child){border-bottom-left-radius:var(--bl-size-3xs)}:host(:last-child) ::slotted(bl-table-cell:last-child){border-bottom-right-radius:var(--bl-size-3xs)}:host([sticky-first-column]) ::slotted(bl-table-header-cell:first-child),:host([sticky-first-column]) ::slotted(bl-table-cell:first-child){position:sticky;z-index:2;left:0}:host([sticky-last-column]) ::slotted(bl-table-header-cell:last-child),:host([sticky-last-column]) ::slotted(bl-table-cell:last-child){position:sticky;z-index:2;right:0}`,m=f;var y="bl-table-row",e=class extends d{constructor(){super(...arguments);this.selectionKey=""}static get styles(){return[m]}connectedCallback(){super.connectedCallback(),!this.closest(n)&&!this.closest(u)&&console.warn("bl-table-row is designed to be used inside a bl-table-header or bl-table-body",this)}updated(t){super.updated(t),this.removeAttribute("checked"),this.removeAttribute("disabled"),this.removeAttribute("sticky-first-column"),this.removeAttribute("sticky-last-column"),this.stickyFirstColumn&&this.setAttribute("sticky-first-column","true"),this.stickyLastColumn&&this.setAttribute("sticky-last-column","true"),this.checked?this.setAttribute("checked","true"):this.disabled&&this.setAttribute("disabled","true"),t.has("selectionKey")&&this.updateComplete.then(()=>{var s,r,o,i;Array.from(this.querySelectorAll("bl-table-header-cell,bl-table-cell")).map(p=>{p.requestUpdate()}),(s=this._table)!=null&&s.multiple&&((r=this._table)!=null&&r.selectable)&&((i=(o=this._table)==null?void 0:o.querySelector("bl-table-header-cell"))==null||i.requestUpdate())})}get _table(){return this.closest("bl-table")}get _firstTableCell(){return this.querySelector("bl-table-cell")}get disabled(){var t;return!!((t=this._firstTableCell)!=null&&t.disabled)}get checked(){var t;return!!((t=this._table)!=null&&t.isRowSelected(this.selectionKey))}get stickyFirstColumn(){var t;return!!((t=this._table)!=null&&t.isFirstColumnSticky())}get stickyLastColumn(){var t;return!!((t=this._table)!=null&&t.isLastColumnSticky())}render(){return b`<slot></slot>`}};l([h({type:String,reflect:!0,attribute:"selection-key"})],e.prototype,"selectionKey",2),e=l([c(y)],e);export{y as a,e as b};
|
|
2
|
+
//# sourceMappingURL=chunk-C4DOPHMG.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/table/table-row/bl-table-row.css", "../src/components/table/table-row/bl-table-row.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:table-row}:host([checked]),:host([checked]) ::slotted(bl-table-cell){background-color:var(--bl-color-primary-contrast)}:host([disabled]),:host([disabled]) ::slotted(bl-table-cell){background-color:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}:host(:not([checked], [disabled]).__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell),:host(:not([checked], [disabled]):hover),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell){background-color:var(--bl-color-tertiary-background)}:host ::slotted(*:first-child){border-left:none}:host ::slotted(*:last-child){border-right:none}:host(:first-child) ::slotted(bl-table-header-cell){border-top:none;border-right:none}:host(:first-child) ::slotted(bl-table-header-cell:first-child){border-top-left-radius:var(--bl-size-3xs)}:host(:first-child) ::slotted(bl-table-header-cell:last-child){border-top-right-radius:var(--bl-size-3xs);border-right:1px}:host(:last-child) ::slotted(bl-table-cell){border-bottom:none}:host(:first-child) ::slotted(bl-table-cell){border-top:none}:host(:last-child) ::slotted(bl-table-cell:first-child){border-bottom-left-radius:var(--bl-size-3xs)}:host(:last-child) ::slotted(bl-table-cell:last-child){border-bottom-right-radius:var(--bl-size-3xs)}:host([sticky-first-column]) ::slotted(bl-table-header-cell:first-child),:host([sticky-first-column]) ::slotted(bl-table-cell:first-child){position:sticky;z-index:2;left:0}:host([sticky-last-column]) ::slotted(bl-table-header-cell:last-child),:host([sticky-last-column]) ::slotted(bl-table-cell:last-child){position:sticky;z-index:2;right:0}`;\nexport default styles;\n", "import { html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { CSSResultGroup } from \"lit/development\";\nimport \"element-internals-polyfill\";\nimport \"../../checkbox-group/checkbox/bl-checkbox\";\nimport { blTableBodyTag } from \"../table-body/bl-table-body\";\nimport type BlTableBody from \"../table-body/bl-table-body\";\nimport BlTableCell from \"../table-cell/bl-table-cell\";\nimport BlTableHeaderCell from \"../table-header-cell/bl-table-header-cell\";\nimport { blTableHeaderTag } from \"../table-header/bl-table-header\";\nimport type BlTableHeader from \"../table-header/bl-table-header\";\nimport style from \"../table-row/bl-table-row.css\";\n\nexport const blTableRowTag = \"bl-table-row\";\n\n/**\n * @tag bl-table-row\n * @summary Baklava Table component\n */\n@customElement(blTableRowTag)\nexport default class BlTableRow extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * selection key for table row\n */\n @property({ type: String, reflect: true, attribute: \"selection-key\" })\n selectionKey: string = \"\";\n\n connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.closest<BlTableHeader>(blTableHeaderTag) &&\n !this.closest<BlTableBody>(blTableBodyTag)\n ) {\n console.warn(\n \"bl-table-row is designed to be used inside a bl-table-header or bl-table-body\",\n this\n );\n }\n }\n\n updated(_changedProperties: PropertyValues) {\n super.updated(_changedProperties);\n this.removeAttribute(\"checked\");\n this.removeAttribute(\"disabled\");\n this.removeAttribute(\"sticky-first-column\");\n this.removeAttribute(\"sticky-last-column\");\n\n if (this.stickyFirstColumn) {\n this.setAttribute(\"sticky-first-column\", \"true\");\n }\n if (this.stickyLastColumn) {\n this.setAttribute(\"sticky-last-column\", \"true\");\n }\n if (this.checked) {\n this.setAttribute(\"checked\", \"true\");\n } else if (this.disabled) {\n this.setAttribute(\"disabled\", \"true\");\n }\n if (_changedProperties.has(\"selectionKey\")) {\n this.updateComplete.then(() => {\n Array.from(this.querySelectorAll(\"bl-table-header-cell,bl-table-cell\")).map(com => {\n (com as BlTableHeaderCell | BlTableCell).requestUpdate();\n });\n\n if (this._table?.multiple && this._table?.selectable) {\n this._table?.querySelector(\"bl-table-header-cell\")?.requestUpdate();\n }\n });\n }\n }\n\n private get _table() {\n return this.closest(\"bl-table\");\n }\n\n private get _firstTableCell() {\n return this.querySelector(\"bl-table-cell\");\n }\n get disabled() {\n return !!this._firstTableCell?.disabled;\n }\n\n get checked() {\n return !!this._table?.isRowSelected(this.selectionKey);\n }\n\n get stickyFirstColumn() {\n return !!this._table?.isFirstColumnSticky();\n }\n\n get stickyLastColumn() {\n return !!this._table?.isLastColumnSticky();\n }\n\n render(): TemplateResult {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blTableRowTag]: BlTableRow;\n }\n}\n"],
|
|
5
|
+
"mappings": "mNACO,IAAMA,EAASC,koDACfC,EAAQF,ECWR,IAAMG,EAAgB,eAORC,EAArB,cAAwCC,CAAW,CAAnD,kCASE,kBAAuB,GARvB,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAQA,mBAA0B,CACxB,MAAM,kBAAkB,EAEtB,CAAC,KAAK,QAAuBC,CAAgB,GAC7C,CAAC,KAAK,QAAqBC,CAAc,GAEzC,QAAQ,KACN,gFACA,IACF,CAEJ,CAEA,QAAQC,EAAoC,CAC1C,MAAM,QAAQA,CAAkB,EAChC,KAAK,gBAAgB,SAAS,EAC9B,KA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AM,UAAW,eAAgB,CAAC,GARlDb,EASnB,4BATmBA,EAArBY,EAAA,CADCC,EAAcd,CAAa,GACPC",
|
|
6
|
+
"names": ["styles", "i", "bl_table_row_default", "blTableRowTag", "BlTableRow", "s", "bl_table_row_default", "blTableHeaderTag", "blTableBodyTag", "_changedProperties", "_a", "_b", "_c", "_d", "com", "x", "__decorateClass", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{a as l}from"./chunk-GRL4DWKG.js";import{a as p,b as n,c as m,e as b}from"./chunk-5MOOXA2X.js";import{a as c,b as i,f as h}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var u=d=>{let o=d.match(/^(\d+(\.\d+)?)(.*)$/);if(!o)return null;let e=parseFloat(o[1]),a=o[3],s;switch(a){case"px":s=e;break;case"vw":s=e*window.innerWidth/100;break;case"%":s=e*window.innerWidth/100;break;default:s=null;break}return s};var f=c`.drawer{box-sizing:border-box;position:fixed;display:flex;top:0;right:-100%;bottom:0;width:var(--bl-drawer-current-width, 424px);padding:var(--bl-size-xl);padding-top:max(env(safe-area-inset-top), var(--bl-size-xl));padding-right:max(env(safe-area-inset-right), var(--bl-size-xl));padding-bottom:max(env(safe-area-inset-bottom), var(--bl-size-xl));background:var(--bl-color-neutral-full);box-shadow:var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);transition:right var(--bl-drawer-animation-duration, 0.25s);z-index:var(--bl-index-sticky)}:host([open]) .drawer{right:0}iframe{height:100%;width:100%;border:none}.container{display:flex;flex-direction:column;gap:var(--bl-size-xl);flex:1;width:100%}header{display:flex;justify-content:space-between;align-items:baseline;gap:var(--bl-size-2xs);background-color:white}header .header-buttons{display:flex;gap:var(--bl-size-xl);margin-left:auto}header h2{font:var(--bl-font-title-1-medium);color:var(--bl-color-neutral-darker);overflow:hidden;margin:0;padding:0}.content{flex:1;overflow-y:scroll}.iframe-content{flex:1}`,w=f;var t=class extends h{constructor(){super(...arguments);this.open=!1;this.width="424px";this.domExistence=!1}static get styles(){return[w]}connectedCallback(){super.connectedCallback(),window==null||window.addEventListener("bl-drawer-open",e=>{e.target!==this&&this.closeDrawer()}),this.resizeDrawerWidth(),window==null||window.addEventListener("resize",()=>this.resizeDrawerWidth()),window==null||window.addEventListener("load",()=>this.resizeDrawerWidth())}disconnectedCallback(){super.disconnectedCallback(),window==null||window.removeEventListener("resize",()=>this.resizeDrawerWidth()),window==null||window.addEventListener("load",()=>this.resizeDrawerWidth())}updated(e){e.has("open")&&this.toggleDialogHandler(),e.has("width")&&this.resizeDrawerWidth()}resizeDrawerWidth(){let e=u(this.width),a=!e||e<100?"424px":this.width;e&&((window==null?void 0:window.innerWidth)<e?this.style.setProperty("--bl-drawer-current-width","calc(100vw - 24px)"):this.style.setProperty("--bl-drawer-current-width",a))}toggleDialogHandler(){this.open?(this.domExistenceSchedule&&clearTimeout(this.domExistenceSchedule),this.domExistence=!0,window.setTimeout(()=>{this.embedUrl&&this._drawerIframe&&(this._drawerIframe.src=this.embedUrl)}),this.onOpen("")):(this.domExistenceSchedule=window.setTimeout(()=>{this.domExistence=!1},1e3),this.onClose(""))}closeDrawer(){this.open=!1}renderContent(){let e=this.embedUrl?i`<iframe id="drawer-iframe" src=${this.embedUrl}></iframe>`:i`<slot></slot>`;return i`<section class=${this.embedUrl?"iframe-content":"content"}>
|
|
2
|
+
${e}
|
|
3
|
+
</section>`}renderContainer(){let e=this.caption?i`<h2 id="drawer-caption">${this.caption}</h2>`:"",a=this.externalLink?i`<bl-button
|
|
4
|
+
icon="external_link"
|
|
5
|
+
variant="tertiary"
|
|
6
|
+
kind="neutral"
|
|
7
|
+
size="small"
|
|
8
|
+
href="${this.externalLink}"
|
|
9
|
+
target="_blank"
|
|
10
|
+
></bl-button>`:"";return i`<div class="container">
|
|
11
|
+
<header>
|
|
12
|
+
${e}
|
|
13
|
+
<div class="header-buttons">
|
|
14
|
+
${a}
|
|
15
|
+
<bl-button
|
|
16
|
+
@click="${this.closeDrawer}"
|
|
17
|
+
icon="close"
|
|
18
|
+
size="small"
|
|
19
|
+
variant="tertiary"
|
|
20
|
+
kind="neutral"
|
|
21
|
+
></bl-button>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
${this.renderContent()}
|
|
25
|
+
</div>`}render(){return this.domExistence?i`<div class="drawer">${this.renderContainer()}</div>`:i``}};r([n({type:Boolean,reflect:!0})],t.prototype,"open",2),r([n({type:String})],t.prototype,"caption",2),r([n({type:String,attribute:"embed-url"})],t.prototype,"embedUrl",2),r([n({type:String,attribute:"external-link"})],t.prototype,"externalLink",2),r([n({type:String,attribute:"width"})],t.prototype,"width",2),r([l("bl-drawer-open")],t.prototype,"onOpen",2),r([l("bl-drawer-close")],t.prototype,"onClose",2),r([b("#drawer-iframe")],t.prototype,"_drawerIframe",2),r([m()],t.prototype,"domExistence",2),t=r([p("bl-drawer")],t);export{t as a};
|
|
26
|
+
//# sourceMappingURL=chunk-C4GIIUCS.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utilities/style-to-px.converter.ts", "../src/components/drawer/bl-drawer.css", "../src/components/drawer/bl-drawer.ts"],
|
|
4
|
+
"sourcesContent": ["export const styleToPixelConverter = (styleValue: string): number | null => {\n const match = styleValue.match(/^(\\d+(\\.\\d+)?)(.*)$/);\n\n if (!match) return null;\n\n const value = parseFloat(match[1]);\n const unit = match[3];\n\n let styleInPixel: number | null;\n\n switch (unit) {\n case \"px\":\n styleInPixel = value;\n break;\n case \"vw\":\n styleInPixel = (value * window.innerWidth) / 100;\n break;\n case \"%\":\n styleInPixel = (value * window.innerWidth) / 100;\n break;\n default:\n styleInPixel = null;\n break;\n }\n return styleInPixel;\n};\n", "import {css} from 'lit';\nexport const styles = css`.drawer{box-sizing:border-box;position:fixed;display:flex;top:0;right:-100%;bottom:0;width:var(--bl-drawer-current-width, 424px);padding:var(--bl-size-xl);padding-top:max(env(safe-area-inset-top), var(--bl-size-xl));padding-right:max(env(safe-area-inset-right), var(--bl-size-xl));padding-bottom:max(env(safe-area-inset-bottom), var(--bl-size-xl));background:var(--bl-color-neutral-full);box-shadow:var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);transition:right var(--bl-drawer-animation-duration, 0.25s);z-index:var(--bl-index-sticky)}:host([open]) .drawer{right:0}iframe{height:100%;width:100%;border:none}.container{display:flex;flex-direction:column;gap:var(--bl-size-xl);flex:1;width:100%}header{display:flex;justify-content:space-between;align-items:baseline;gap:var(--bl-size-2xs);background-color:white}header .header-buttons{display:flex;gap:var(--bl-size-xl);margin-left:auto}header h2{font:var(--bl-font-title-1-medium);color:var(--bl-color-neutral-darker);overflow:hidden;margin:0;padding:0}.content{flex:1;overflow-y:scroll}.iframe-content{flex:1}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { styleToPixelConverter } from \"../../utilities/style-to-px.converter\";\nimport \"../button/bl-button\";\nimport style from \"./bl-drawer.css\";\n\n/**\n * @tag bl-drawer\n * @summary Baklava Drawer component\n *\n * @cssproperty [--bl-drawer-animation-duration=250ms] Drawer slide in animation duration\n */\n\n@customElement(\"bl-drawer\")\nexport default class BlDrawer extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets drawer open-close status\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Sets the drawer title\n */\n @property({ type: String })\n caption?: string;\n\n /**\n * Sets the drawer embed url for iframe\n */\n @property({ type: String, attribute: \"embed-url\" })\n embedUrl?: string;\n\n /**\n * Sets the drawer external link\n */\n @property({ type: String, attribute: \"external-link\" })\n externalLink?: string;\n\n /**\n * Sets the drawer width\n */\n @property({ type: String, attribute: \"width\" })\n width: string = \"424px\";\n\n /**\n * Fires when the drawer is opened\n */\n @event(\"bl-drawer-open\") private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when the drawer is closed\n */\n @event(\"bl-drawer-close\") private onClose: EventDispatcher<string>;\n\n @query(\"#drawer-iframe\")\n _drawerIframe: HTMLIFrameElement;\n\n connectedCallback() {\n super.connectedCallback();\n window?.addEventListener(\"bl-drawer-open\", event => {\n if (event.target !== this) this.closeDrawer();\n });\n this.resizeDrawerWidth();\n\n window?.addEventListener(\"resize\", () => this.resizeDrawerWidth());\n window?.addEventListener(\"load\", () => this.resizeDrawerWidth());\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n window?.removeEventListener(\"resize\", () => this.resizeDrawerWidth());\n window?.addEventListener(\"load\", () => this.resizeDrawerWidth());\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has(\"open\")) {\n this.toggleDialogHandler();\n }\n\n if (changedProperties.has(\"width\")) {\n this.resizeDrawerWidth();\n }\n }\n\n private domExistenceSchedule: number;\n\n private resizeDrawerWidth() {\n const drawerWidth = styleToPixelConverter(this.width);\n\n const newWidth = !drawerWidth || drawerWidth < 100 ? \"424px\" : this.width;\n\n if (drawerWidth) {\n if (window?.innerWidth < drawerWidth) {\n this.style.setProperty(\"--bl-drawer-current-width\", \"calc(100vw - 24px)\");\n } else {\n this.style.setProperty(\"--bl-drawer-current-width\", newWidth);\n }\n }\n }\n\n private toggleDialogHandler() {\n if (this.open) {\n if (this.domExistenceSchedule) {\n clearTimeout(this.domExistenceSchedule);\n }\n this.domExistence = true;\n window.setTimeout(() => {\n if (this.embedUrl && this._drawerIframe) {\n this._drawerIframe.src = this.embedUrl;\n }\n });\n // FIXME: Allow events without payload\n this.onOpen(\"\");\n } else {\n // Give some time for exit animation\n this.domExistenceSchedule = window.setTimeout(() => {\n this.domExistence = false;\n }, 1000);\n\n // FIXME: Allow events without payload\n this.onClose(\"\");\n }\n }\n\n @state() private domExistence = false;\n\n private closeDrawer() {\n this.open = false;\n }\n\n private renderContent() {\n const content = this.embedUrl\n ? html`<iframe id=\"drawer-iframe\" src=${this.embedUrl}></iframe>`\n : html`<slot></slot>`;\n\n return html`<section class=${this.embedUrl ? \"iframe-content\" : \"content\"}>\n ${content}\n </section>`;\n }\n\n private renderContainer() {\n const title = this.caption ? html`<h2 id=\"drawer-caption\">${this.caption}</h2>` : \"\";\n const external_button = this.externalLink\n ? html`<bl-button\n icon=\"external_link\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n href=\"${this.externalLink}\"\n target=\"_blank\"\n ></bl-button>`\n : \"\";\n\n return html`<div class=\"container\">\n <header>\n ${title}\n <div class=\"header-buttons\">\n ${external_button}\n <bl-button\n @click=\"${this.closeDrawer}\"\n icon=\"close\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n ></bl-button>\n </div>\n </header>\n ${this.renderContent()}\n </div>`;\n }\n\n render(): TemplateResult {\n if (this.domExistence) {\n return html`<div class=\"drawer\">${this.renderContainer()}</div>`;\n } else {\n return html``;\n }\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-drawer\": BlDrawer;\n }\n}\n"],
|
|
5
|
+
"mappings": "mMAAO,IAAMA,EAAyBC,GAAsC,CAC1E,IAAMC,EAAQD,EAAW,MAAM,qBAAqB,EAEpD,GAAI,CAACC,EAAO,OAAO,KAEnB,IAAMC,EAAQ,WAAWD,EAAM,CAAC,CAAC,EAC3BE,EAAOF,EAAM,CAAC,EAEhBG,EAEJ,OAAQD,EAAM,CACZ,IAAK,KACHC,EAAeF,EACf,MACF,IAAK,KACHE,EAAgBF,EAAQ,OAAO,WAAc,IAC7C,MACF,IAAK,IACHE,EAAgBF,EAAQ,OAAO,WAAc,IAC7C,MACF,QACEE,EAAe,KACf,KACJ,CACA,OAAOA,CACT,ECxBO,IAAMC,EAASC,mjCACfC,EAAQF,ECcf,IAAqBG,EAArB,cAAsCC,CAAW,CAAjD,kCASE,UAAO,GAwBP,WAAgB,QA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AAOA,mBAAsB,KAAK,SAAW,iBAAmB;AAAA,QAC5DD;AAAA,eAEN,CAEQ,iBAAkB,CACxB,IAAME,EAAQ,KAAK,QAAUD,4BAA+B,KAAK,eAAiB,GAC5EE,EAAkB,KAAK,aACzBF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKU,KAAK;AAAA;AAAA,uBAGf,GAEJ,OAAOA;AAAA;AAAA,UAEDC;AAAA;AAAA,YAEEC;AAAA;AAAA,sBAEU,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQnB,KAAK,cAAc;AAAA,WAEzB,CAEA,QAAyB,CACvB,OAAI,KAAK,aACAF,wBAA2B,KAAK,gBAAgB,UAEhDA,GAEX,CACF,EAhKEG,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARvBb,EASnB,oBAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAdPb,EAenB,uBAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,GApB/Bb,EAqBnB,wBAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GA1BnCb,EA2BnB,4BAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,OAAQ,CAAC,GAhC3Bb,EAiCnB,qBAKiCY,EAAA,CAAhCT,EAAM,gBAAgB,GAtCJH,EAsCc,sBAKCY,EAAA,CAAjCT,EAAM,iBAAiB,GA3CLH,EA2Ce,uBAGlCY,EAAA,CADCE,EAAM,gBAAgB,GA7CJd,EA8CnB,6BAqEiBY,EAAA,CAAhBG,EAAM,GAnHYf,EAmHF,4BAnHEA,EAArBY,EAAA,CADCC,EAAc,WAAW,GACLb",
|
|
6
|
+
"names": ["styleToPixelConverter", "styleValue", "match", "value", "unit", "styleInPixel", "styles", "i", "bl_drawer_default", "BlDrawer", "s", "bl_drawer_default", "event", "changedProperties", "drawerWidth", "styleToPixelConverter", "newWidth", "content", "x", "title", "external_button", "__decorateClass", "e", "i", "t"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as i,b as r}from"./chunk-5MOOXA2X.js";import{a as o,b as l,f as s}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var n=o`:host{cursor:wait;display:inline-flex;align-items:center}.spinner{animation:spin 1s linear infinite}:host([overlay]){position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:rgba(39 49 66 / 70%);z-index:10}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,a=n;var c="bl-spinner",e=class extends s{constructor(){super(...arguments);this.size="var(--bl-font-size-m)";this.disabled=!1;this.overlay=!1;this.color="var(--bl-color-primary)"}static get styles(){return[a]}render(){return l`<bl-icon
|
|
2
|
+
class="spinner"
|
|
3
|
+
name="loading"
|
|
4
|
+
style="color: ${this.disabled?"var(--bl-color-neutral-light)":this.color}; font-size: ${this.size};"
|
|
5
|
+
></bl-icon>`}};t([r({type:String,reflect:!0})],e.prototype,"size",2),t([r({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([r({type:Boolean,reflect:!0})],e.prototype,"overlay",2),t([r({type:String,reflect:!0})],e.prototype,"color",2),e=t([i(c)],e);export{c as a,e as b};
|
|
6
|
+
//# sourceMappingURL=chunk-CYLRPJKP.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/spinner/bl-spinner.css", "../src/components/spinner/bl-spinner.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{cursor:wait;display:inline-flex;align-items:center}.spinner{animation:spin 1s linear infinite}:host([overlay]){position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:rgba(39 49 66 / 70%);z-index:10}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport \"../icon/bl-icon\";\nimport style from \"./bl-spinner.css\";\n\nexport const blSpinnerTag = \"bl-spinner\";\n/**\n * @tag bl-spinner\n * @summary Baklava Spinner component\n *\n */\n@customElement(blSpinnerTag)\nexport default class BlSpinner extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the spinner size\n */\n @property({ type: String, reflect: true })\n size = \"var(--bl-font-size-m)\";\n\n /**\n * Sets the disabled state for spinner\n */\n @property({ type: Boolean, reflect: true })\n disabled? = false;\n\n /**\n * Sets the overlay state for spinner\n */\n @property({ type: Boolean, reflect: true })\n overlay? = false;\n\n /**\n * Sets the color of the spinner\n */\n @property({ type: String, reflect: true })\n color: string = \"var(--bl-color-primary)\";\n\n render(): TemplateResult {\n return html`<bl-icon\n class=\"spinner\"\n name=\"loading\"\n style=\"color: ${this.disabled\n ? \"var(--bl-color-neutral-light)\"\n : this.color}; font-size: ${this.size};\"\n ></bl-icon>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blSpinnerTag]: BlSpinner;\n }\n}\n"],
|
|
5
|
+
"mappings": "6IACO,IAAMA,EAASC,gWACfC,EAAQF,ECGR,IAAMG,EAAe,aAOPC,EAArB,cAAuC,CAAW,CAAlD,kCASE,UAAO,wBAMP,cAAY,GAMZ,aAAW,GAMX,WAAgB,0BA1BhB,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA0BA,QAAyB,CACvB,OAAOC;AAAA;AAAA;AAAA,sBAGW,KAAK,SACjB,gCACA,KAAK,qBAAqB,KAAK;AAAA,gBAEvC,CACF,EA7BEC,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GARtBJ,EASnB,oBAMAG,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAdvBJ,EAenB,wBAMAG,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GApBvBJ,EAqBnB,uBAMAG,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GA1BtBJ,EA2BnB,qBA3BmBA,EAArBG,EAAA,CADCC,EAAcL,CAAY,GACNC",
|
|
6
|
+
"names": ["styles", "i", "bl_spinner_default", "blSpinnerTag", "BlSpinner", "bl_spinner_default", "x", "__decorateClass", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-STMCW2R6.js";import{a as r,b as a}from"./chunk-5MOOXA2X.js";import{a as o,b as l,f as s}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-IZ2LK5GK.js";var n=o`:host{display:table-header-group}:host([sticky]){position:sticky;top:0;left:0;right:0;z-index:3;transition:top 0.05s ease;box-shadow:0 8px 16px 0 rgb(39 49 66 / 10%)}:host([sticky])::after{content:"";display:block;position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--bl-color-neutral-lighter)}`,p=n;var b="bl-table-header",t=class extends s{constructor(){super(...arguments);this.sticky=!1}static get styles(){return[p]}connectedCallback(){super.connectedCallback(),this.closest(i)||console.warn("bl-table-header is designed to be used inside a bl-table",this)}render(){return l`<slot></slot> `}};e([a({type:Boolean,reflect:!0})],t.prototype,"sticky",2),t=e([r(b)],t);export{b as a,t as b};
|
|
2
|
+
//# sourceMappingURL=chunk-DIS2PGBH.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/table/table-header/bl-table-header.css", "../src/components/table/table-header/bl-table-header.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:table-header-group}:host([sticky]){position:sticky;top:0;left:0;right:0;z-index:3;transition:top 0.05s ease;box-shadow:0 8px 16px 0 rgb(39 49 66 / 10%)}:host([sticky])::after{content:\"\";display:block;position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--bl-color-neutral-lighter)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport \"element-internals-polyfill\";\nimport { blTableTag } from \"../bl-table\";\nimport type BlTable from \"../bl-table\";\nimport style from \"../table-header/bl-table-header.css\";\n\nexport const blTableHeaderTag = \"bl-table-header\";\n\n/**\n * @tag bl-table-header\n * @summary Baklava Table component\n */\n@customElement(blTableHeaderTag)\nexport default class BlTableHeader extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n /**\n * Set table header as sticky\n */\n @property({ type: Boolean, reflect: true })\n sticky = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n if (!this.closest<BlTable>(blTableTag)) {\n console.warn(\"bl-table-header is designed to be used inside a bl-table\", this);\n }\n }\n\n render(): TemplateResult {\n return html`<slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blTableHeaderTag]: BlTableHeader;\n }\n}\n"],
|
|
5
|
+
"mappings": "qLACO,IAAMA,EAASC,0TACfC,EAAQF,ECKR,IAAMG,EAAmB,kBAOXC,EAArB,cAA2C,CAAW,CAAtD,kCAQE,YAAS,GAPT,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAOA,mBAA0B,CACxB,MAAM,kBAAkB,EACnB,KAAK,QAAiBC,CAAU,GACnC,QAAQ,KAAK,2DAA4D,IAAI,CAEjF,CAEA,QAAyB,CACvB,OAAOC,iBACT,CACF,EAZEC,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAPvBL,EAQnB,sBARmBA,EAArBI,EAAA,CADCC,EAAcN,CAAgB,GACVC",
|
|
6
|
+
"names": ["styles", "i", "bl_table_header_default", "blTableHeaderTag", "BlTableHeader", "bl_table_header_default", "blTableTag", "x", "__decorateClass", "e"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-MND5TXTF.js";import{c as m}from"./chunk-EG7U7PM3.js";import{a as g}from"./chunk-XDUIVR6I.js";import{a as u}from"./chunk-VU6LRFZR.js";import{a as p}from"./chunk-6LT7O7T2.js";import{a as r}from"./chunk-DINNT5P2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as v,b as i,c,e as b}from"./chunk-5MOOXA2X.js";import{a as h,b as l,f as d}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var S=h`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-neutral-lighter);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--autofill-bg-color:var(--bl-color-primary-contrast);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-neutral-full);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size="large"]) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size="small"]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:none;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(
|
|
2
2
|
var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding) -
|
|
3
3
|
var(--border-size)
|
|
4
4
|
) 0 calc(
|
|
@@ -13,11 +13,11 @@ import{a as f}from"./chunk-OSNB4BPE.js";import{a as m}from"./chunk-AAGDUS7G.js";
|
|
|
13
13
|
*/box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);/**
|
|
14
14
|
* Some browsers doesn't allow setting background-color
|
|
15
15
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill
|
|
16
|
-
*/box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-right:var(--label-padding)}bl-icon:not(.reveal-icon),::slotted(bl-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name="eye_on"]{display:inline-block}.password-visible bl-icon[name="eye_on"]{display:none}.password-visible bl-icon[name="eye_off"]{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out 0.4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;left:calc(var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding));right:calc(var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`,y=S;var C={date:"calendar","datetime-local":"calendar",month:"calendar",week:"calendar",time:"clock",search:"search"},e=class extends g(d){constructor(){super(...arguments);this.type="text";this.value="";this.required=!1;this.autofocus=!1;this.size="medium";this.disabled=!1;this.readonly=!1;this.labelFixed=!1;this.onKeydown=a=>{a.code==="Enter"&&this.form&&u(this.form)};this.dirty=!1;this.passwordVisible=!1;this.inputId=Math.random().toString(36).substring(2)}static get styles(){return[y]}set customInvalidText(a){this._customInvalidText=a,this.setValue(this.value)}get customInvalidText(){return this._customInvalidText}connectedCallback(){var a;super.connectedCallback(),this.addEventListener("keydown",this.onKeydown),(a=this.form)==null||a.addEventListener("submit",()=>{this.reportValidity()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeydown)}textVisibilityToggle(){this.passwordVisible=!this.passwordVisible}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.validationTarget.showPicker()}validityCallback(){var a;return this.onInvalid(this.internals.validity),this.customInvalidText||((a=this.validationTarget)==null?void 0:a.validationMessage)}async forceCustomError(){await this.updateComplete,this.validationTarget.setCustomValidity(this.customInvalidText||"An error occurred"),this.setValue(this.value),this.reportValidity()}async clearCustomError(){await this.updateComplete,this.validationTarget.setCustomValidity(""),this.setValue(this.value),this.reportValidity()}reportValidity(){return this.dirty=!0,this.requestUpdate(),this.checkValidity()}inputHandler(a){let o=a.target.value;this.value=o,this.onInput(o)}changeHandler(a){let o=a.target.value;this.dirty=!0,this.value=o,this.onChange(o)}firstUpdated(){this.setValue(this.value),this.icon||(this.icon=C[this.type])}async updated(a){a.size>0&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}render(){let a=this.checkValidity()?"":l`<p id="errorMessage" aria-live="polite" class="invalid-text">
|
|
16
|
+
*/box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-right:var(--label-padding)}bl-icon:not(.reveal-icon),::slotted(bl-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name="eye_on"]{display:inline-block}.password-visible bl-icon[name="eye_on"]{display:none}.password-visible bl-icon[name="eye_off"]{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out 0.4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;left:calc(var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding));right:calc(var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`,y=S;var C={date:"calendar","datetime-local":"calendar",month:"calendar",week:"calendar",time:"clock",search:"search"},e=class extends g(d){constructor(){super(...arguments);this.type="text";this.value="";this.required=!1;this.loading=!1;this.autofocus=!1;this.size="medium";this.disabled=!1;this.readonly=!1;this.labelFixed=!1;this.onKeydown=a=>{a.code==="Enter"&&this.form&&setTimeout(()=>{a.defaultPrevented||u(this.form)})};this.dirty=!1;this.passwordVisible=!1;this.inputId=Math.random().toString(36).substring(2)}static get styles(){return[y]}set customInvalidText(a){this._customInvalidText=a,this.setValue(this.value)}get customInvalidText(){return this._customInvalidText}connectedCallback(){var a;super.connectedCallback(),this.addEventListener("keydown",this.onKeydown),(a=this.form)==null||a.addEventListener("submit",()=>{this.reportValidity()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeydown)}textVisibilityToggle(){this.passwordVisible=!this.passwordVisible}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.validationTarget.showPicker()}validityCallback(){var a;return this.onInvalid(this.internals.validity),this.customInvalidText||((a=this.validationTarget)==null?void 0:a.validationMessage)}async forceCustomError(){await this.updateComplete,this.validationTarget.setCustomValidity(this.customInvalidText||"An error occurred"),this.setValue(this.value),this.reportValidity()}async clearCustomError(){await this.updateComplete,this.validationTarget.setCustomValidity(""),this.setValue(this.value),this.reportValidity()}reportValidity(){return this.dirty=!0,this.requestUpdate(),this.checkValidity()}inputHandler(a){let o=a.target.value;this.value=o,this.onInput(o)}changeHandler(a){let o=a.target.value;this.dirty=!0,this.value=o,this.onChange(o)}firstUpdated(){this.setValue(this.value),this.icon||(this.icon=C[this.type])}async updated(a){a.size>0&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}render(){let a=this.checkValidity()?"":l`<p id="errorMessage" aria-live="polite" class="invalid-text">
|
|
17
17
|
${this.validationMessage}
|
|
18
18
|
</p>`,o=this.helpText?l`<p id="helpText" class="help-text">${this.helpText}</p>`:"",x=l`
|
|
19
19
|
<slot name="icon">
|
|
20
|
-
${this.icon?l`<bl-icon name="${this.icon}"></bl-icon>`:l`<bl-icon class="error-icon" name="alert"></bl-icon>`}
|
|
20
|
+
${this.loading&&this.type==="search"&&this.value!==""&&this.value!==null?l`<bl-spinner></bl-spinner>`:this.icon?l`<bl-icon name="${this.icon}"></bl-icon>`:l`<bl-icon class="error-icon" name="alert"></bl-icon>`}
|
|
21
21
|
</slot>
|
|
22
22
|
`,w=this.label?l`<label for=${this.inputId}>${this.label}</label>`:"",s=this.type==="password",k=s?l`<bl-button
|
|
23
23
|
size="small"
|
|
@@ -29,7 +29,7 @@ import{a as f}from"./chunk-OSNB4BPE.js";import{a as m}from"./chunk-AAGDUS7G.js";
|
|
|
29
29
|
>
|
|
30
30
|
<bl-icon class="reveal-icon" slot="icon" name="eye_on"></bl-icon>
|
|
31
31
|
<bl-icon class="reveal-icon" slot="icon" name="eye_off"></bl-icon>
|
|
32
|
-
</bl-button>`:"",z=this.icon||this._hasIconSlot
|
|
32
|
+
</bl-button>`:"",z=this.icon||this._hasIconSlot,T={wrapper:!0,dirty:this.dirty,invalid:!this.checkValidity(),"has-icon":s||z||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""},$=this.passwordVisible?"text":"password",V=s?$:this.type;return l`<div class=${p(T)}>
|
|
33
33
|
${w}
|
|
34
34
|
<fieldset class="input-wrapper">
|
|
35
35
|
<legend><span>${this.label}</span></legend>
|
|
@@ -59,5 +59,5 @@ import{a as f}from"./chunk-OSNB4BPE.js";import{a as m}from"./chunk-AAGDUS7G.js";
|
|
|
59
59
|
<div class="icon">${k} ${x}</div>
|
|
60
60
|
</fieldset>
|
|
61
61
|
<div class="hint">${a} ${o}</div>
|
|
62
|
-
</div>`}};e.shadowRootOptions={...d.shadowRootOptions,delegatesFocus:!0},e.formControlValidators=f,t([b("input")],e.prototype,"validationTarget",2),t([i({reflect:!0})],e.prototype,"name",2),t([i({reflect:!0})],e.prototype,"type",2),t([i({reflect:!0})],e.prototype,"label",2),t([i({reflect:!0})],e.prototype,"placeholder",2),t([i({reflect:!0})],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"required",2),t([i({type:Number,reflect:!0})],e.prototype,"minlength",2),t([i({type:Number,reflect:!0})],e.prototype,"maxlength",2),t([i({reflect:!0})],e.prototype,"min",2),t([i({reflect:!0})],e.prototype,"max",2),t([i({type:String,reflect:!0})],e.prototype,"pattern",2),t([i({type:Number,reflect:!0})],e.prototype,"step",2),t([i({type:String,reflect:!0})],e.prototype,"autocomplete",2),t([i({type:String,reflect:!0})],e.prototype,"inputmode",2),t([i({type:Boolean,reflect:!0})],e.prototype,"autofocus",2),t([i({type:String,reflect:!0})],e.prototype,"icon",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0})],e.prototype,"readonly",2),t([i({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),t([i({type:String,attribute:"invalid-text",reflect:!0})],e.prototype,"customInvalidText",1),t([i({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),t([n("bl-change")],e.prototype,"onChange",2),t([n("bl-input")],e.prototype,"onInput",2),t([n("bl-invalid")],e.prototype,"onInvalid",2),t([c()],e.prototype,"dirty",2),t([c()],e.prototype,"passwordVisible",2),e=t([v("bl-input")],e);export{e as a};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
</div>`}};e.shadowRootOptions={...d.shadowRootOptions,delegatesFocus:!0},e.formControlValidators=f,t([b("input")],e.prototype,"validationTarget",2),t([i({reflect:!0})],e.prototype,"name",2),t([i({reflect:!0})],e.prototype,"type",2),t([i({reflect:!0})],e.prototype,"label",2),t([i({reflect:!0})],e.prototype,"placeholder",2),t([i({reflect:!0})],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"required",2),t([i({type:Number,reflect:!0})],e.prototype,"minlength",2),t([i({type:Number,reflect:!0})],e.prototype,"maxlength",2),t([i({reflect:!0})],e.prototype,"min",2),t([i({type:Boolean,reflect:!0})],e.prototype,"loading",2),t([i({reflect:!0})],e.prototype,"max",2),t([i({type:String,reflect:!0})],e.prototype,"pattern",2),t([i({type:Number,reflect:!0})],e.prototype,"step",2),t([i({type:String,reflect:!0})],e.prototype,"autocomplete",2),t([i({type:String,reflect:!0})],e.prototype,"inputmode",2),t([i({type:Boolean,reflect:!0})],e.prototype,"autofocus",2),t([i({type:String,reflect:!0})],e.prototype,"icon",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0})],e.prototype,"readonly",2),t([i({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),t([i({type:String,attribute:"invalid-text",reflect:!0})],e.prototype,"customInvalidText",1),t([i({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),t([n("bl-change")],e.prototype,"onChange",2),t([n("bl-input")],e.prototype,"onInput",2),t([n("bl-invalid")],e.prototype,"onInvalid",2),t([c()],e.prototype,"dirty",2),t([c()],e.prototype,"passwordVisible",2),e=t([v("bl-input")],e);export{e as a};
|
|
63
|
+
//# sourceMappingURL=chunk-DZ77A43H.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/input/bl-input.css", "../src/components/input/bl-input.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-neutral-lighter);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--autofill-bg-color:var(--bl-color-primary-contrast);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-neutral-full);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size=\"large\"]) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size=\"small\"]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:none;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding) -\n var(--border-size)\n ) 0 calc(\n var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding) -\n var(--border-size)\n );background-color:var(--background-color);border-radius:var(--bl-size-3xs);margin:0;width:0;min-width:100%}:host([disabled]) .wrapper{cursor:not-allowed;--background-color:var(--bl-color-neutral-lightest);--text-color:var(--bl-color-neutral-light)}.wrapper:has(input:autofill){--background-color:var(--autofill-bg-color)}.wrapper:has(input:-webkit-autofill){--background-color:var(--autofill-bg-color)}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;max-width:max-content;transition:all ease-in 0.1s;font:var(--input-font);top:var(--padding-vertical);left:var(--bl-input-padding-start, var(--padding-horizontal));right:var(--bl-input-padding-end, var(--padding-horizontal));pointer-events:none;color:var(--bl-color-neutral-light)}.has-icon label{right:calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) + var(--icon-size) +\n var(--padding-vertical)\n )}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}input{width:100%;align-self:stretch;outline:0;border:0;padding:0 0 0 var(--label-padding);font:var(--input-font);color:var(--text-color);-webkit-text-fill-color:var(--text-color);background-color:transparent}input::-webkit-credentials-auto-fill-button{color:red}:where(.wrapper:focus-within, .wrapper.has-value) input{padding-left:var(--label-padding)}input:disabled{cursor:not-allowed}input::-webkit-calendar-picker-indicator{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);/**\n * Some browsers doesn't allow setting background-color\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill\n */box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);/**\n * Some browsers doesn't allow setting background-color\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill\n */box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-right:var(--label-padding)}bl-icon:not(.reveal-icon),::slotted(bl-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name=\"eye_on\"]{display:inline-block}.password-visible bl-icon[name=\"eye_on\"]{display:none}.password-visible bl-icon[name=\"eye_off\"]{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out 0.4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;left:calc(var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding));right:calc(var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult, PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { FormControlMixin } from \"@open-wc/form-control\";\nimport { submit } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { innerInputValidators } from \"../../utilities/form-control\";\nimport \"../button/bl-button\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport style from \"./bl-input.css\";\n\nexport type InputType =\n | \"text\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"month\"\n | \"week\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"url\"\n | \"search\";\n\nconst inputTypeIcons: Partial<Record<InputType, BaklavaIcon>> = {\n \"date\": \"calendar\",\n \"datetime-local\": \"calendar\",\n \"month\": \"calendar\",\n \"week\": \"calendar\",\n \"time\": \"clock\",\n \"search\": \"search\",\n};\n\nexport type InputSize = \"small\" | \"medium\" | \"large\";\n/**\n * @tag bl-input\n * @summary Baklava Input component\n *\n * @cssproperty [--bl-input-padding-start] Sets the padding start\n * @cssproperty [--bl-input-padding-end] Sets the padding end\n */\n@customElement(\"bl-input\")\nexport default class BlInput extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = innerInputValidators;\n\n @query(\"input\")\n validationTarget: HTMLInputElement;\n\n /**\n * Sets name of the input\n */\n @property({ reflect: true })\n name?: string;\n\n /**\n * Type of the input. It's used to set `type` attribute of native input inside.\n */\n @property({ reflect: true })\n type: InputType = \"text\";\n\n /**\n * Sets label of the input\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets placeholder of the input\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets initial value of the input\n */\n @property({ reflect: true })\n value = \"\";\n\n /**\n * Makes input a mandatory field\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Sets minimum length of the input\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets maximum length of the input\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets the minimum acceptable value for the input\n */\n @property({ reflect: true })\n min?: number | string;\n\n /**\n * Sets the loading value for the input\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets the maximum acceptable value for the input\n */\n @property({ reflect: true })\n max?: number | string;\n\n /**\n * Sets a regex pattern form the input validation\n */\n @property({ type: String, reflect: true })\n pattern?: string;\n\n /**\n * Sets the increase and decrease step to a `number` input\n */\n @property({ type: Number, reflect: true })\n step?: number;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: string;\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: \"none\" | \"text\" | \"decimal\" | \"numeric\" | \"tel\" | \"search\" | \"email\" | \"url\";\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the custom icon name. `bl-icon` component is used to show an icon\n */\n @property({ type: String, reflect: true })\n icon?: BaklavaIcon;\n\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Disables the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Makes the input readonly.\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Overrides error message. This message will override default error messages\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n set customInvalidText(value: string) {\n this._customInvalidText = value;\n this.setValue(this.value);\n }\n\n get customInvalidText(): string {\n return this._customInvalidText;\n }\n\n private _customInvalidText: string;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Fires when an alteration to the element's value is committed by the user. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.\n */\n @event(\"bl-change\") private onChange: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event(\"bl-input\") private onInput: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event(\"bl-invalid\") private onInvalid: EventDispatcher<ValidityState>;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this.onKeydown);\n\n this.form?.addEventListener(\"submit\", () => {\n this.reportValidity();\n });\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\"keydown\", this.onKeydown);\n }\n\n private onKeydown = (event: KeyboardEvent): void => {\n if (event.code === \"Enter\" && this.form) {\n setTimeout(() => {\n if (!event.defaultPrevented) {\n submit(this.form);\n }\n });\n }\n };\n\n @state() private dirty = false;\n\n @state() private passwordVisible = false;\n\n private textVisibilityToggle() {\n this.passwordVisible = !this.passwordVisible;\n }\n\n showPicker() {\n if (\"showPicker\" in HTMLInputElement.prototype) {\n this.validationTarget.showPicker();\n }\n }\n\n validityCallback(): string | void {\n this.onInvalid(this.internals.validity);\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n /**\n * Force to set input as in invalid state.\n */\n async forceCustomError() {\n await this.updateComplete;\n this.validationTarget.setCustomValidity(this.customInvalidText || \"An error occurred\");\n this.setValue(this.value);\n this.reportValidity();\n }\n\n /**\n * Clear forced invalid state\n */\n async clearCustomError() {\n await this.updateComplete;\n this.validationTarget.setCustomValidity(\"\");\n this.setValue(this.value);\n this.reportValidity();\n }\n\n reportValidity() {\n this.dirty = true;\n this.requestUpdate();\n return this.checkValidity();\n }\n\n private inputHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.value = value;\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.dirty = true;\n this.value = value;\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n if (!this.icon) this.icon = inputTypeIcons[this.type];\n }\n\n protected async updated(changedProperties: PropertyValues) {\n if (changedProperties.size > 0) {\n this.setValue(this.value);\n\n await this.validationComplete;\n\n this.requestUpdate();\n }\n }\n\n private inputId = Math.random().toString(36).substring(2);\n\n private get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n const helpMessage = this.helpText\n ? html`<p id=\"helpText\" class=\"help-text\">${this.helpText}</p>`\n : \"\";\n\n const icon = html`\n <slot name=\"icon\">\n ${this.loading && this.type === \"search\" && this.value !== \"\" && this.value !== null\n ? html`<bl-spinner></bl-spinner>`\n : this.icon\n ? html`<bl-icon name=\"${this.icon}\"></bl-icon>`\n : html`<bl-icon class=\"error-icon\" name=\"alert\"></bl-icon>`}\n </slot>\n `;\n\n const label = this.label ? html`<label for=${this.inputId}>${this.label}</label>` : \"\";\n const passwordInput = this.type === \"password\";\n\n const revealButton = passwordInput\n ? html`<bl-button\n size=\"small\"\n kind=\"neutral\"\n variant=\"tertiary\"\n class=\"${classMap({\n \"reveal-button\": true,\n \"password-visible\": this.passwordVisible,\n })}\"\n aria-label=\"Toggle password reveal\"\n @bl-click=\"${this.textVisibilityToggle}\"\n >\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_on\"></bl-icon>\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_off\"></bl-icon>\n </bl-button>`\n : \"\";\n\n const hasCustomIcon = this.icon || this._hasIconSlot;\n const classes = {\n \"wrapper\": true,\n \"dirty\": this.dirty,\n \"invalid\": !this.checkValidity(),\n \"has-icon\": passwordInput || hasCustomIcon || (this.dirty && !this.checkValidity()),\n \"has-value\": this.value !== null && this.value !== \"\",\n };\n\n const passwordType = this.passwordVisible ? \"text\" : \"password\";\n const inputType = passwordInput ? passwordType : this.type;\n\n return html`<div class=${classMap(classes)}>\n ${label}\n <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <input\n id=${this.inputId}\n type=${inputType}\n .value=${live(this.value)}\n inputmode=\"${ifDefined(this.inputmode)}\"\n ?autofocus=${this.autofocus}\n autocomplete=\"${ifDefined(this.autocomplete)}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n maxlength=\"${ifDefined(this.maxlength)}\"\n min=\"${ifDefined(this.min)}\"\n max=\"${ifDefined(this.max)}\"\n pattern=\"${ifDefined(this.pattern)}\"\n step=\"${ifDefined(this.step)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n aria-invalid=${this.checkValidity() ? \"false\" : \"true\"}\n aria-describedby=${ifDefined(this.helpText ? \"helpText\" : undefined)}\n aria-errormessage=${ifDefined(this.checkValidity() ? undefined : \"errorMessage\")}\n />\n <div class=\"icon\">${revealButton} ${icon}</div>\n </fieldset>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-input\": BlInput;\n }\n}\n"],
|
|
5
|
+
"mappings": "8aACO,IAAMA,EAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uoEAgBfC,EAAQF,ECYf,IAAMG,EAA0D,CAC9D,KAAQ,WACR,iBAAkB,WAClB,MAAS,WACT,KAAQ,WACR,KAAQ,QACR,OAAU,QACZ,EAWqBC,EAArB,cAAqCC,EAAiBC,CAAU,CAAE,CAAlE,kCAqBE,UAAkB,OAkBlB,WAAQ,GAMR,cAAW,GAwBX,aAAU,GAoCV,eAAY,GAYZ,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,gBAAa,GAoDb,KAAQ,UAAaC,GAA+B,CAC9CA,EAAM,OAAS,SAAW,KAAK,MACjC,WAAW,IAAM,CACVA,EAAM,kBACTC,EAAO,KAAK,IAAI,CAEpB,CAAC,CAEL,EAES,KAAQ,MAAQ,GAEhB,KAAQ,gBAAkB,GAyEnC,KAAQ,QAAU,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,EA/QxD,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA0IA,IAAI,kBAAkBC,EAAe,CACnC,KAAK,mBAAqBA,EAC1B,KAAK,SAAS,KAAK,KAAK,CAC1B,CAEA,IAAI,mBA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,UAAW,YAAa,QAAS,EAAK,CAAC,GA3J9CzB,EA4JnB,wBAK4BuB,EAAA,CAA3BpB,EAAM,WAAW,GAjKCH,EAiKS,wBAKDuB,EAAA,CAA1BpB,EAAM,UAAU,GAtKEH,EAsKQ,uBAKEuB,EAAA,CAA5BpB,EAAM,YAAY,GA3KAH,EA2KU,yBA0BZuB,EAAA,CAAhBG,EAAM,GArMY1B,EAqMF,qBAEAuB,EAAA,CAAhBG,EAAM,GAvMY1B,EAuMF,+BAvMEA,EAArBuB,EAAA,CADCE,EAAc,UAAU,GACJzB",
|
|
6
|
+
"names": ["styles", "i", "bl_input_default", "inputTypeIcons", "BlInput", "FormControlMixin", "s", "event", "submit", "bl_input_default", "value", "_a", "changedProperties", "invalidMessage", "x", "helpMessage", "icon", "label", "passwordInput", "revealButton", "o", "hasCustomIcon", "classes", "passwordType", "inputType", "l", "innerInputValidators", "__decorateClass", "i", "e", "t"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as l,d as g}from"./chunk-AYJMIZZ3.js";import{a as n,b as o,c as u}from"./chunk-7GK5LKBV.js";import{c as a,d as s}from"./chunk-4OT5AMS5.js";var h={attribute:"required",key:"valueMissing",message:"Please fill out this field",isValid(e,t){let r=!0;return(e.hasAttribute("required")||e.required)&&!t&&(r=!1),r}};var m={attribute:"maxlength",key:"tooLong",message(e,t){let r=t||"";return`Please use no more than ${e.maxLength} characters (you are currently using ${r.length} characters).`},isValid(e,t){return e.maxLength?!(t&&e.maxLength<t.length):!0}};var x=o(class extends u{constructor(e){if(super(e),e.type!==n.PROPERTY&&e.type!==n.ATTRIBUTE&&e.type!==n.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!l(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===a||t===s)return t;let r=e.element,i=e.name;if(e.type===n.PROPERTY){if(t===r[i])return a}else if(e.type===n.BOOLEAN_ATTRIBUTE){if(!!t===r.hasAttribute(i))return a}else if(e.type===n.ATTRIBUTE&&r.getAttribute(i)===t+"")return a;return g(e),t}});export{h as a,m as b,x as c};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
lit-html/directives/live.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2020 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*)
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-EG7U7PM3.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@open-wc/form-control/src/validators.ts", "../node_modules/lit-html/src/directives/live.ts"],
|
|
4
|
+
"sourcesContent": ["import { Validator } from './index.js';\nimport { FormControlInterface, FormValue } from './types.js';\n\nexport const requiredValidator: Validator = {\n attribute: 'required',\n key: 'valueMissing',\n message: 'Please fill out this field',\n isValid(instance: HTMLElement & { required: boolean }, value: FormValue): boolean {\n let valid = true;\n\n if ((instance.hasAttribute('required') || instance.required) && !value) {\n valid = false;\n }\n\n return valid;\n }\n};\n\nexport const programmaticValidator: Validator = {\n attribute: 'error',\n message(instance: HTMLElement & { error: string }): string {\n return instance.error;\n },\n isValid(instance: HTMLElement & { error: string }): boolean {\n return !instance.error;\n }\n};\n\nexport const minLengthValidator: Validator = {\n attribute: 'minlength',\n key: 'tooShort',\n message(instance: FormControlInterface & { minLength: number }, value: FormValue): string {\n const _value = value as string || '';\n return `Please use at least ${instance.minLength} characters (you are currently using ${_value.length} characters).`;\n },\n isValid(instance: HTMLElement & { minLength: number }, value: string): boolean {\n /** If no value is provided, this validator should return true */\n if (!value) {\n return true;\n }\n\n if (!!value && instance.minLength > value.length) {\n return false;\n }\n\n return true;\n }\n};\n\nexport const maxLengthValidator: Validator = {\n attribute: 'maxlength',\n key: 'tooLong',\n message(\n instance: FormControlInterface & { maxLength: number },\n value: FormValue\n ): string {\n const _value = value as string || '';\n return `Please use no more than ${instance.maxLength} characters (you are currently using ${_value.length} characters).`;\n },\n isValid(\n instance: HTMLElement & { maxLength: number },\n value: string\n ): boolean {\n /** If maxLength isn't set, this is valid */\n if (!instance.maxLength) {\n return true;\n }\n\n if (!!value && instance.maxLength < value.length) {\n return false;\n }\n\n return true;\n }\n};\n\nexport const patternValidator: Validator = {\n attribute: 'pattern',\n key: 'patternMismatch',\n message: 'Please match the requested format',\n isValid(instance: HTMLElement & { pattern: string }, value: string): boolean {\n /** If no value is provided, this validator should return true */\n if (!value || !instance.pattern) {\n return true;\n }\n\n const regExp = new RegExp(instance.pattern);\n return !!regExp.exec(value);\n }\n};\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange, nothing} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\nimport {isSingleExpression, setCommittedValue} from '../directive-helpers.js';\n\nclass LiveDirective extends Directive {\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n !(\n partInfo.type === PartType.PROPERTY ||\n partInfo.type === PartType.ATTRIBUTE ||\n partInfo.type === PartType.BOOLEAN_ATTRIBUTE\n )\n ) {\n throw new Error(\n 'The `live` directive is not allowed on child or event bindings'\n );\n }\n if (!isSingleExpression(partInfo)) {\n throw new Error('`live` bindings can only contain a single expression');\n }\n }\n\n render(value: unknown) {\n return value;\n }\n\n override update(part: AttributePart, [value]: DirectiveParameters<this>) {\n if (value === noChange || value === nothing) {\n return value;\n }\n const element = part.element;\n const name = part.name;\n\n if (part.type === PartType.PROPERTY) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (value === (element as any)[name]) {\n return noChange;\n }\n } else if (part.type === PartType.BOOLEAN_ATTRIBUTE) {\n if (!!value === element.hasAttribute(name)) {\n return noChange;\n }\n } else if (part.type === PartType.ATTRIBUTE) {\n if (element.getAttribute(name) === String(value)) {\n return noChange;\n }\n }\n // Resets the part's value, causing its dirty-check to fail so that it\n // always sets the value.\n setCommittedValue(part);\n return value;\n }\n}\n\n/**\n * Checks binding values against live DOM values, instead of previously bound\n * values, when determining whether to update the value.\n *\n * This is useful for cases where the DOM value may change from outside of\n * lit-html, such as with a binding to an `<input>` element's `value` property,\n * a content editable elements text, or to a custom element that changes it's\n * own properties or attributes.\n *\n * In these cases if the DOM value changes, but the value set through lit-html\n * bindings hasn't, lit-html won't know to update the DOM value and will leave\n * it alone. If this is not what you want--if you want to overwrite the DOM\n * value with the bound value no matter what--use the `live()` directive:\n *\n * ```js\n * html`<input .value=${live(x)}>`\n * ```\n *\n * `live()` performs a strict equality check against the live DOM value, and if\n * the new value is equal to the live value, does nothing. This means that\n * `live()` should not be used when the binding will cause a type conversion. If\n * you use `live()` with an attribute binding, make sure that only strings are\n * passed in, or the binding will update every render.\n */\nexport const live = directive(LiveDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {LiveDirective};\n"],
|
|
5
|
+
"mappings": "oJAGO,IAAMA,EAA+B,CAC1C,UAAW,WACX,IAAK,eACL,QAAS,6BACT,QAAQC,EAA+CC,EAAgB,CACrE,IAAIC,EAAQ,GAEZ,OAAKF,EAAS,aAAa,UAAU,GAAKA,EAAS,WAAa,CAACC,IAC/DC,EAAQ,IAGHA,CACT,GAkCK,IAAMC,EAAgC,CAC3C,UAAW,YACX,IAAK,UACL,QACEC,EACAC,EAAgB,CAEhB,IAAMC,EAASD,GAAmB,GAClC,MAAO,2BAA2BD,EAAS,iDAAiDE,EAAO,qBACrG,EACA,QACEF,EACAC,EAAa,CAGb,OAAKD,EAAS,UAIV,EAAEC,GAASD,EAAS,UAAYC,EAAM,QAHjC,EAQX,OCkBWE,EAAOC,EA3EpB,cAA4BC,CAAAA,CAC1BC,YAAYC,EAAAA,CAEV,GADAC,MAAMD,CAAAA,EAGFA,EAASE,OAASC,EAASC,UAC3BJ,EAASE,OAASC,EAASE,WAC3BL,EAASE,OAASC,EAASG,kBAG7B,MAAUC,MACR,gEAAA,EAGJ,GAAA,CAAKC,EAAmBR,CAAAA,EACtB,MAAUO,MAAM,sDAAA,CAEnB,CAEDE,OAAOC,EAAAA,CACL,OAAOA,CACR,CAEQC,OAAOC,EAAAA,CAAsBF,CAAAA,EAAAA,CACpC,GAAIA,IAAUG,GAAYH,IAAUI,EAClC,OAAOJ,EAET,IAAMK,EAAUH,EAAKG,QACfC,EAAOJ,EAAKI,KAElB,GAAIJ,EAAKV,OAASC,EAASC,UAEzB,GAAIM,IAAWK,EAAgBC,CAAAA,EAC7B,OAAOH,UAEAD,EAAKV,OAASC,EAASG,mBAChC,GAAA,CAAA,CAAMI,IAAUK,EAAQE,aAAaD,CAAAA,EACnC,OAAOH,UAEAD,EAAKV,OAASC,EAASE,WAC5BU,EAAQG,aAAaF,CAAAA,IAAiBN,EAAPS,GACjC,OAAON,EAMX,OADAO,EAAkBR,CAAAA,EACXF,CACR,CAAA,CAAA",
|
|
6
|
+
"names": ["requiredValidator", "instance", "value", "valid", "maxLengthValidator", "instance", "value", "_value", "live", "directive", "Directive", "constructor", "partInfo", "super", "type", "PartType", "PROPERTY", "ATTRIBUTE", "BOOLEAN_ATTRIBUTE", "Error", "isSingleExpression", "render", "value", "update", "part", "noChange", "nothing", "element", "name", "hasAttribute", "getAttribute", "String", "setCommittedValue"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as b}from"./chunk-DINNT5P2.js";import{a as d}from"./chunk-GRL4DWKG.js";import{a as h,b as a}from"./chunk-5MOOXA2X.js";import{a as s,b as c,f as n}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var p=s`:host{display:inline-block;cursor:pointer;vertical-align:middle}span{display:inline-block}.switch{--track-height:var(--bl-size-xl);--track-width:var(--bl-size-4xl);--thumb-offset:var(--bl-size-4xs);--thumb-height:calc(var(--track-height) - calc(2 * var(--thumb-offset)));--thumb-width:var(--thumb-height);/* TODO: use predefined animation duration once it is ready */--animation-duration:var(--bl-switch-animation-duration, 300ms);--switch-color:var(--bl-switch-color-off, var(--bl-color-neutral-lighter));background-color:var(--switch-color);border-radius:var(--bl-border-radius-pill);height:var(--track-height);transition-property:background-color;transition-duration:var(--animation-duration);width:var(--track-width)}.switch::before{content:"";display:inline-block;background-color:white;border-radius:var(--bl-border-radius-circle);height:var(--thumb-height);left:var(--thumb-offset);position:relative;top:var(--thumb-offset);transition:transform;transition-duration:var(--animation-duration);width:var(--thumb-width)}label{display:flex;gap:var(--bl-size-2xs);color:var(--bl-color-neutral-darker);font:var(--bl-font-title-3);cursor:pointer;user-select:none;line-height:normal;align-items:center;margin-block:0}.label{overflow-wrap:anywhere}:host([disabled]) .label{color:var(--bl-color-neutral-light);border:1px solid var(--bl-color-neutral-lighter)}:host([checked]) .label,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .label,:host(:hover) .label{color:var(--bl-color-primary)}:host([checked]) .switch{--switch-color:var(--bl-switch-color-on, var(--bl-switch-color, var(--bl-color-primary)))}:host([checked]) .switch::before{transform:translateX(
|
|
2
2
|
calc(var(--track-width) - var(--thumb-width) - calc(2 * var(--thumb-offset)))
|
|
3
3
|
)}:host([disabled]) .switch{opacity:0.5}:host([disabled]){cursor:not-allowed}.switch:focus-visible{position:relative;outline:none}.switch:focus-visible::after{border:2px solid var(--switch-color);border-radius:var(--bl-border-radius-pill);content:"";position:absolute;inset:-3px}`,u=p;var m="bl-switch",e=class extends n{constructor(){super(...arguments);this.checked=!1;this.disabled=!1}static get styles(){return[u]}toggle(){this.disabled||(this.checked=!this.checked,this.onToggle(this.checked))}handleKeyDown(t){(t.code==="Enter"||t.code==="Space")&&(this.toggle(),t.preventDefault())}render(){var o,i,l;let t=(l=(i=this.ariaLabel)!=null?i:(o=this.attributes.getNamedItem("aria-label"))==null?void 0:o.value)!=null?l:void 0;return c`
|
|
4
4
|
<label @click=${this.toggle}>
|
|
@@ -9,10 +9,10 @@ import{a as d}from"./chunk-DINNT5P2.js";import{a as b}from"./chunk-GRL4DWKG.js";
|
|
|
9
9
|
aria-checked=${this.checked}
|
|
10
10
|
aria-readonly=${!!this.disabled}
|
|
11
11
|
@keydown=${this.handleKeyDown}
|
|
12
|
-
aria-label=${
|
|
12
|
+
aria-label=${b(t)}
|
|
13
13
|
tabindex="0"
|
|
14
14
|
>
|
|
15
15
|
</span>
|
|
16
16
|
</label>
|
|
17
|
-
`}};r([a({type:Boolean,reflect:!0})],e.prototype,"checked",2),r([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),r([
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
`}};r([a({type:Boolean,reflect:!0})],e.prototype,"checked",2),r([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),r([d("bl-switch-toggle")],e.prototype,"onToggle",2),e=r([h(m)],e);export{m as a,e as b};
|
|
18
|
+
//# sourceMappingURL=chunk-FQBDGFMR.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-XDUIVR6I.js";import{a as v}from"./chunk-6LT7O7T2.js";import{a as i}from"./chunk-GRL4DWKG.js";import{a as c,b as a,c as u,e as m}from"./chunk-5MOOXA2X.js";import{a as s,b as n,f as d}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var y=s`:host{display:block}fieldset{border:none;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-neutral-darker)}.options{display:flex;flex-flow:var(--bl-radio-direction, column) wrap;align-items:var(--bl-radio-group-cross-axis-item-alignment, normal);align-content:var(--bl-radio-group-cross-axis-content-alignment, normal);justify-content:var(--bl-radio-group-main-axis-content-alignment, normal);gap:var(--bl-size-m);margin-block:var(--bl-size-xs)}`,f=y;var h="bl-radio-group",p="bl-radio-change",r=class extends g(d){constructor(){super(...arguments);this.value="";this.required=!1;this.focusedOptionIndex=0}static get styles(){return[f]}get options(){return[...this.querySelectorAll(b)]}get availableOptions(){return this.options.filter(e=>!e.disabled)}updated(e){e.has("value")&&(this.setValue(this.value),this.onChange(this.value))}handleOptionChecked(e){let o=e.target;this.setValue(o.value),this.onChange(o.value)}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if([" "].includes(e.key)){this.availableOptions[this.focusedOptionIndex].select();return}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}connectedCallback(){super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown)}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}render(){return n`<fieldset role="radiogroup" aria-labelledby="label" aria-required=${this.required}>
|
|
2
2
|
<legend id="label">${this.label}</legend>
|
|
3
3
|
<div class="options" @bl-checked=${this.handleOptionChecked}>
|
|
4
4
|
<slot></slot>
|
|
@@ -14,4 +14,4 @@ import{a as g}from"./chunk-DJOD4BTL.js";import{a as v}from"./chunk-6LT7O7T2.js";
|
|
|
14
14
|
>
|
|
15
15
|
<p id="label"><slot></slot></p>
|
|
16
16
|
</div>`}};t([a()],l.prototype,"name",2),t([a()],l.prototype,"value",2),t([a({type:Boolean,reflect:!0})],l.prototype,"disabled",2),t([u()],l.prototype,"selected",2),t([i("bl-checked")],l.prototype,"onChecked",2),t([i("bl-focus")],l.prototype,"onFocus",2),t([i("bl-blur")],l.prototype,"onBlur",2),t([m("[role=radio]")],l.prototype,"radioElement",2),l=t([c(b)],l);export{b as a,W as b,l as c,h as d,p as e,r as f};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-FVBGMXMC.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as m}from"./chunk-GRL4DWKG.js";import{a as u}from"./chunk-3USCFSFQ.js";import{b as g}from"./chunk-7GK5LKBV.js";import{a as d,b as f,c as v}from"./chunk-5MOOXA2X.js";import{a as c,b as h,f as p}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-IZ2LK5GK.js";var o=class extends u{};o.directiveName="unsafeSVG",o.resultType=2;var x=g(o);var y="https://cdn.jsdelivr.net/npm/@trendyol/baklava-icons@latest/icons";function G(s){y=s}function E(){return y}var k=c`:host{display:inline-block}:host div{display:flex;align-items:stretch;width:1em;height:1em;min-width:1em;min-height:1em;overflow:hidden;transform:translateZ(0)}:host svg{width:1em;height:1em}`,b=k;var l=new Map,t=class extends p{static get styles(){return[b]}get name(){return this._iconName}set name(n){n!==this._iconName&&(this._iconName=n,this.load())}async load(){let a=`${E()}/${this.name}.svg`;l.has(a)||l.set(a,fetch(a));try{let i=await l.get(a),r=i==null?void 0:i.clone();r!=null&&r.ok?(this.svg=await r.text(),this.onLoad(`${this.name} icon loaded`),this.requestUpdate()):this.onError(`${this.name} icon failed to load`)}catch(i){this.onError(`${this.name} icon failed to load [${i}]`)}}render(){return h`<div aria-hidden="true">${x(this.svg)}</div>`}};e([f()],t.prototype,"name",1),e([m("bl-load")],t.prototype,"onLoad",2),e([m("bl-error")],t.prototype,"onError",2),e([v()],t.prototype,"svg",2),t=e([d("bl-icon")],t);export{G as a,E as b,t as c};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
lit-html/directives/unsafe-svg.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*)
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-HYB2HRRX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/lit-html/src/directives/unsafe-svg.ts", "../src/utilities/asset-paths.ts", "../src/components/icon/bl-icon.css", "../src/components/icon/bl-icon.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {directive} from '../directive.js';\nimport {UnsafeHTMLDirective} from './unsafe-html.js';\n\nconst SVG_RESULT = 2;\n\nclass UnsafeSVGDirective extends UnsafeHTMLDirective {\n static override directiveName = 'unsafeSVG';\n static override resultType = SVG_RESULT;\n}\n\n/**\n * Renders the result as SVG, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeSVG = directive(UnsafeSVGDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {UnsafeSVGDirective};\n", "let iconPath = \"
|
|
5
|
-
"mappings": "4QAWA,IAAMA,EAAN,cAAiCC,CAAAA,CAAAA,EACfD,EAAaE,cAAG,YAChBF,EAAUG,WAJT,EAAA,IAiBNC,EAAYC,EAAUL,CAAAA,EC1BnC,IAAIM,EAAW,
|
|
6
|
-
"names": ["UnsafeSVGDirective", "UnsafeHTMLDirective", "directiveName", "resultType", "unsafeSVG", "directive", "iconPath", "setIconPath", "path", "getIconPath", "
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {directive} from '../directive.js';\nimport {UnsafeHTMLDirective} from './unsafe-html.js';\n\nconst SVG_RESULT = 2;\n\nclass UnsafeSVGDirective extends UnsafeHTMLDirective {\n static override directiveName = 'unsafeSVG';\n static override resultType = SVG_RESULT;\n}\n\n/**\n * Renders the result as SVG, rather than text.\n *\n * The values `undefined`, `null`, and `nothing`, will all result in no content\n * (empty string) being rendered.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeSVG = directive(UnsafeSVGDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {UnsafeSVGDirective};\n", "let iconPath = \"https://cdn.jsdelivr.net/npm/@trendyol/baklava-icons@latest/icons\";\n\nexport function setIconPath(path: string) {\n iconPath = path;\n}\n\nexport function getIconPath() {\n return iconPath;\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{display:inline-block}:host div{display:flex;align-items:stretch;width:1em;height:1em;min-width:1em;min-height:1em;overflow:hidden;transform:translateZ(0)}:host svg{width:1em;height:1em}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport { getIconPath } from \"../../utilities/asset-paths\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport style from \"./bl-icon.css\";\nimport { BaklavaIcon } from \"./icon-list\";\n\nconst requestMap = new Map<string, Promise<Response>>();\n\n/**\n * @tag bl-icon\n * @summary Baklava Icon component\n *\n * @cssproperty [font-size] Setting size of icon. Default is current font size in DOM place\n * @cssproperty [color=currentColor] Setting color of icon\n */\n@customElement(\"bl-icon\")\nexport default class BlIcon extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n private _iconName: BaklavaIcon;\n\n /**\n * Name of the icon to show\n */\n @property()\n get name(): BaklavaIcon {\n return this._iconName;\n }\n\n set name(value: BaklavaIcon) {\n if (value !== this._iconName) {\n this._iconName = value;\n this.load();\n }\n }\n\n /**\n * Fires when SVG icon loaded\n */\n @event(\"bl-load\") private onLoad: EventDispatcher<string>;\n\n /**\n * Fires when SVG icon failed to load\n */\n @event(\"bl-error\") private onError: EventDispatcher<string>;\n\n @state() private svg: string;\n\n async load() {\n const iconPath = getIconPath();\n const fileUrl = `${iconPath}/${this.name}.svg`;\n\n if (!requestMap.has(fileUrl)) {\n requestMap.set(fileUrl, fetch(fileUrl));\n }\n\n try {\n const iconRequest = await requestMap.get(fileUrl);\n const res = iconRequest?.clone();\n\n if (res?.ok) {\n this.svg = await res.text();\n this.onLoad(`${this.name} icon loaded`);\n this.requestUpdate();\n } else {\n this.onError(`${this.name} icon failed to load`);\n }\n } catch (error) {\n this.onError(`${this.name} icon failed to load [${error}]`);\n }\n }\n\n render(): TemplateResult {\n return html`<div aria-hidden=\"true\">${unsafeSVG(this.svg)}</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-icon\": BlIcon;\n }\n}\n"],
|
|
5
|
+
"mappings": "4QAWA,IAAMA,EAAN,cAAiCC,CAAAA,CAAAA,EACfD,EAAaE,cAAG,YAChBF,EAAUG,WAJT,EAAA,IAiBNC,EAAYC,EAAUL,CAAAA,EC1BnC,IAAIM,EAAW,oEAER,SAASC,EAAYC,EAAc,CACxCF,EAAWE,CACb,CAEO,SAASC,GAAc,CAC5B,OAAOH,CACT,CCPO,IAAMI,EAASC,mMACfC,EAAQF,ECMf,IAAMG,EAAa,IAAI,IAUFC,EAArB,cAAoCC,CAAW,CAC7C,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAQA,IAAI,MAAoB,CACtB,OAAO,KAAK,SACd,CAEA,IAAI,KAAKC,EAAoB,CACvBA,IAAU,KAAK,YACjB,KAAK,UAAYA,EACjB,KAAK,KAAK,EAEd,CAcA,MAAM,MAAO,CAEX,IAAMC,EAAU,GADCC,EAAY,KACE,KAAK,WAE/BN,EAAW,IAAIK,CAAO,GACzBL,EAAW,IAAIK,EAAS,MAAMA,CAAO,CAAC,EAGxC,GAAI,CACF,IAAME,EAAc,MAAMP,EAAW,IAAIK,CAAO,EAC1CG,EAAMD,GAAA,YAAAA,EAAa,QAErBC,GAAA,MAAAA,EAAK,IACP,KAAK,IAAM,MAAMA,EAAI,KAAK,EAC1B,KAAK,OAAO,GAAG,KAAK,kBAAkB,EACtC,KAAK,cAAc,GAEnB,KAAK,QAAQ,GAAG,KAAK,0BAA0B,CAEnD,OAASC,EAAP,CACA,KAAK,QAAQ,GAAG,KAAK,6BAA6BA,IAAQ,CAC5D,CACF,CAEA,QAAyB,CACvB,OAAOC,4BAA+BC,EAAU,KAAK,GAAG,SAC1D,CACF,EAlDMC,EAAA,CADHC,EAAS,GAVSZ,EAWf,oBAcsBW,EAAA,CAAzBE,EAAM,SAAS,GAzBGb,EAyBO,sBAKCW,EAAA,CAA1BE,EAAM,UAAU,GA9BEb,EA8BQ,uBAEVW,EAAA,CAAhBG,EAAM,GAhCYd,EAgCF,mBAhCEA,EAArBW,EAAA,CADCC,EAAc,SAAS,GACHZ",
|
|
6
|
+
"names": ["UnsafeSVGDirective", "UnsafeHTMLDirective", "directiveName", "resultType", "unsafeSVG", "directive", "iconPath", "setIconPath", "path", "getIconPath", "styles", "i", "bl_icon_default", "requestMap", "BlIcon", "s", "bl_icon_default", "value", "fileUrl", "getIconPath", "iconRequest", "res", "error", "x", "o", "__decorateClass", "e", "event", "t"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";let m=new WeakMap,w=new WeakMap,g=new WeakMap,u=new WeakMap,x=new WeakMap,Q=new WeakMap,T=new WeakMap,f=new WeakMap,X=new WeakMap,b=new WeakMap,L=new WeakMap,N=new WeakMap,O=new WeakMap,R=new WeakMap,E=new WeakMap,v={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},Y=(e,t)=>{for(let a in v){t[a]=null;let r=null,i=v[a];Object.defineProperty(t,a,{get(){return r},set(s){r=s,e.isConnected?e.setAttribute(i,s):b.set(e,t)}})}};function H(e){let t=u.get(e),{form:a}=t;U(e,a,t),z(e,t.labels)}let D=(e,t=!1)=>{let a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return u.has(s)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=a.nextNode(),i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&S(r,e.disabled),r=a.nextNode()},P={attributes:!0,attributeFilter:["disabled"]},W=new MutationObserver(e=>{for(let t of e){let a=t.target;a.constructor.formAssociated?S(a,a.hasAttribute("disabled")):a.localName==="fieldset"&&D(a)}});function F(e){e.forEach(t=>{let{addedNodes:a,removedNodes:r}=t,i=Array.from(a),s=Array.from(r);i.forEach(n=>{if(u.has(n)&&n.constructor.formAssociated&&H(n),b.has(n)){let l=b.get(n);Object.keys(v).filter(o=>l[o]!==null).forEach(o=>{n.setAttribute(v[o],l[o])}),b.delete(n)}if(E.has(n)){let l=E.get(n);n.setAttribute("internals-valid",l.validity.valid.toString()),n.setAttribute("internals-invalid",(!l.validity.valid).toString()),n.setAttribute("aria-invalid",(!l.validity.valid).toString()),E.delete(n)}if(n.localName==="form"){let l=f.get(n),d=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(c){return u.has(c)&&!(l&&l.has(c))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),o=d.nextNode();for(;o;)H(o),o=d.nextNode()}n.localName==="fieldset"&&(W.observe(n,P),D(n,!0))}),s.forEach(n=>{let l=u.get(n);l&&g.get(l)&&_(l),T.has(n)&&T.get(n).disconnect()})})}function Z(e){e.forEach(t=>{let{removedNodes:a}=t;a.forEach(r=>{let i=O.get(t.target);u.has(r)&&q(r),i.disconnect()})})}let j=e=>{let t=new MutationObserver(Z);t.observe(e,{childList:!0}),O.set(e,t)};new MutationObserver(F);let C={childList:!0,subtree:!0},S=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},_=e=>{g.get(e).forEach(a=>{a.remove()}),g.set(e,[])},$=(e,t)=>{let a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),g.get(t).push(a),a},tt=(e,t)=>{g.set(t,[]),W.observe(e,P)},z=(e,t)=>{if(t.length){Array.from(t).forEach(r=>r.addEventListener("click",e.click.bind(e)));let a=t[0].id;t[0].id||(a=`${t[0].htmlFor}_Label`,t[0].id=a),e.setAttribute("aria-labelledby",a)}},M=e=>{let t=Array.from(e.elements).filter(s=>!s.tagName.includes("-")&&s.validity).map(s=>s.validity.valid),a=f.get(e)||[],r=Array.from(a).filter(s=>s.isConnected).map(s=>u.get(s).validity.valid),i=[...t,...r].includes(!1);e.toggleAttribute("internals-invalid",i),e.toggleAttribute("internals-valid",!i)},et=e=>{M(I(e.target))},at=e=>{M(I(e.target))},rt=e=>{let t=":is(:is(button, input)[type=submit], button:not([type])):not([disabled])",a=`${t}:not([form])`;e.id&&(a+=`,${t}[form='${e.id}']`),e.addEventListener("click",r=>{if(r.target.closest(a)){let s=f.get(e);if(e.noValidate)return;s.size&&Array.from(s).reverse().map(d=>u.get(d).reportValidity()).includes(!1)&&r.preventDefault()}})},it=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(a=>{a.constructor.formAssociated&&a.formResetCallback&&a.formResetCallback.apply(a)})},U=(e,t,a)=>{if(t){let r=f.get(t);if(r)r.add(e);else{let i=new Set;i.add(e),f.set(t,i),rt(t),t.addEventListener("reset",it),t.addEventListener("input",et),t.addEventListener("change",at)}Q.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),M(t)}},I=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=I(t)),t},h=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},K=(e,t,a)=>{let r=f.get(e);return r&&r.size&&r.forEach(i=>{u.get(i)[a]()||(t=!1)}),t},q=e=>{if(e.constructor.formAssociated){let t=u.get(e),{labels:a,form:r}=t;z(e,a),U(e,r,t)}};class nt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}let st=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ot=(e,t,a)=>(e.valid=lt(t),Object.keys(t).forEach(r=>e[r]=t[r]),a&&M(a),e),lt=e=>{let t=!0;for(let a in e)a!=="valid"&&e[a]!==!1&&(t=!1);return t},V=new WeakMap;class k extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");V.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);let a=super.add(t),r=V.get(this);return r.toggleAttribute(`state${t}`,!0),r.part&&r.part.add(`state${t}`),a}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){let a=super.delete(t),r=V.get(this);return r.toggleAttribute(`state${t}`,!1),r.part&&r.part.remove(`state${t}`),a}}function B(e,t,a,r){if(a==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?r:a==="a"?r.call(e):r?r.value:t.get(e)}function ct(e,t,a,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,a):i?i.value=a:t.set(e,a),a}var y;class dt{constructor(t){y.set(this,void 0),ct(this,y,t,"f");for(let a=0;a<t.length;a++){let r=t[a];this[a]=r,r.hasAttribute("name")&&(this[r.getAttribute("name")]=r)}Object.freeze(this)}get length(){return B(this,y,"f").length}[(y=new WeakMap,Symbol.iterator)](){return B(this,y,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}class G{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");let a=t.getRootNode(),r=new nt;this.states=new k(t),m.set(this,t),w.set(this,r),u.set(t,this),Y(t,this),tt(t,this),Object.seal(this),q(t),a instanceof DocumentFragment&&j(a)}checkValidity(){let t=m.get(this);if(h(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=w.get(this);if(!a.valid){let r=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(r)}return a.valid}get form(){let t=m.get(this);h(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let a;return t.constructor.formAssociated===!0&&(a=I(t)),a}get labels(){let t=m.get(this);h(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");let a=t.getAttribute("id"),r=t.getRootNode();return r&&a?r.querySelectorAll(`[for="${a}"]`):[]}reportValidity(){let t=m.get(this);if(h(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=this.checkValidity(),r=N.get(this);if(r&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!a&&r&&(t.focus(),r.focus()),a}setFormValue(t){let a=m.get(this);if(h(a,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),_(this),t!=null&&!(t instanceof FormData)){if(a.getAttribute("name")){let r=$(a,this);r.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([r,i])=>{if(typeof i=="string"){let s=$(a,this);s.name=r,s.value=i}});X.set(a,t)}setValidity(t,a,r){let i=m.get(this);if(h(i,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");N.set(this,r);let s=w.get(this),n={};for(let o in t)n[o]=t[o];Object.keys(n).length===0&&st(s);let l={...s,...n};delete l.valid;let{valid:d}=ot(s,l,this.form);if(!d&&!a)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");x.set(this,d?"":a),i.isConnected?(i.toggleAttribute("internals-invalid",!d),i.toggleAttribute("internals-valid",d),i.setAttribute("aria-invalid",`${!d}`)):E.set(i,this)}get shadowRoot(){let t=m.get(this),a=L.get(t);return a||null}get validationMessage(){let t=m.get(this);return h(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),x.get(this)}get validity(){let t=m.get(this);return h(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),w.get(this)}get willValidate(){let t=m.get(this);return h(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function ut(){if(!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);let a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(r=>r in a.internals)}if(ut()){if(!window.CustomStateSet){window.CustomStateSet=k;let e=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(...t){let a=e.call(this,t);return a.states=new k(this),a}}}else{let t=function(...o){let c=i.apply(this,o),p=new MutationObserver(F);return L.set(this,c),window.ShadyDOM?p.observe(this,C):p.observe(c,C),T.set(this,p),c},a=function(...o){let c=n.apply(this,o);return K(this,c,"checkValidity")},r=function(...o){let c=l.apply(this,o);return K(this,c,"reportValidity")};window.ElementInternals=G;let e=customElements.define;customElements.define=function(o,c,p){if(c.formAssociated){let A=c.prototype.connectedCallback;c.prototype.connectedCallback=function(){R.has(this)||(R.set(this,!0),this.hasAttribute("disabled")&&S(this,!0)),A!=null&&A.apply(this)}}e.apply(customElements,[o,c,p])},HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new G(this)};let i=Element.prototype.attachShadow;Element.prototype.attachShadow=t,new MutationObserver(F).observe(document.documentElement,C);let n=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=a;let l=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;let{get:d}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...o){let c=d.call(this,...o),p=Array.from(f.get(this)||[]);if(p.length===0)return c;let A=Array.from(c).concat(p).sort((J,mt)=>J.compareDocumentPosition?J.compareDocumentPosition(mt)&2?1:-1:0);return new dt(A)}}),window.CustomStateSet||(window.CustomStateSet=k)}})();
|
|
2
|
+
//# sourceMappingURL=chunk-HZ6A5QFC.js.map
|