@adyen/bento-vue3 1.42.0 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell/data-grid-cell.vue.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-row/data-grid-row.vue.d.ts +1 -350
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-selector/use-selector.d.ts +3 -2
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +33 -1
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/typography.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.C1Vu3qJu.js → action-bar.COQrEUYU.js} +2 -2
- package/dist/chunks/{action-bar.C1Vu3qJu.js.map → action-bar.COQrEUYU.js.map} +1 -1
- package/dist/chunks/{checkbox-group.C5IweVVx.js → checkbox-group.BUmkYc2R.js} +2 -2
- package/dist/chunks/{checkbox-group.C5IweVVx.js.map → checkbox-group.BUmkYc2R.js.map} +1 -1
- package/dist/chunks/{checkbox.B72ok3Yu.js → checkbox.L94hTcPY.js} +15 -15
- package/dist/chunks/{checkbox.B72ok3Yu.js.map → checkbox.L94hTcPY.js.map} +1 -1
- package/dist/chunks/{code-snippet.CiOcZKKH.js → code-snippet.DbUGxmYi.js} +2 -2
- package/dist/chunks/{code-snippet.CiOcZKKH.js.map → code-snippet.DbUGxmYi.js.map} +1 -1
- package/dist/chunks/{dashboard-section.BCc8HoQG.js → dashboard-section.YU5gKDEJ.js} +2 -2
- package/dist/chunks/{dashboard-section.BCc8HoQG.js.map → dashboard-section.YU5gKDEJ.js.map} +1 -1
- package/dist/chunks/data-grid.DgPWs1hH.js +3374 -0
- package/dist/chunks/data-grid.DgPWs1hH.js.map +1 -0
- package/dist/chunks/{date-range-picker.C9Ht_Egi.js → date-range-picker.DjPmRy0E.js} +201 -198
- package/dist/chunks/date-range-picker.DjPmRy0E.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Bc4qxPRN.js → dropdown-tag.BKDmDRSv.js} +2 -2
- package/dist/chunks/{dropdown-tag.Bc4qxPRN.js.map → dropdown-tag.BKDmDRSv.js.map} +1 -1
- package/dist/chunks/{dropdown.BqkUB1So.js → dropdown.DpjMobyf.js} +2 -2
- package/dist/chunks/{dropdown.BqkUB1So.js.map → dropdown.DpjMobyf.js.map} +1 -1
- package/dist/chunks/es6.b4enG1py.js.map +1 -1
- package/dist/chunks/{filter-bar.DVLYNNwQ.js → filter-bar.BwJTrH5U.js} +9 -9
- package/dist/chunks/filter-bar.BwJTrH5U.js.map +1 -0
- package/dist/chunks/index.lHdwuJAx.js +366 -0
- package/dist/chunks/index.lHdwuJAx.js.map +1 -0
- package/dist/chunks/{input-field-password.BA0EpVMY.js → input-field-password.DxNS4MmO.js} +3 -3
- package/dist/chunks/{input-field-password.BA0EpVMY.js.map → input-field-password.DxNS4MmO.js.map} +1 -1
- package/dist/chunks/{input-field.CWMgbw48.js → input-field.BQKEQIZd.js} +2 -2
- package/dist/chunks/{input-field.CWMgbw48.js.map → input-field.BQKEQIZd.js.map} +1 -1
- package/dist/chunks/{layout-row.iTtAEvD2.js → layout-row.DcyZ3DP3.js} +2 -2
- package/dist/chunks/{layout-row.iTtAEvD2.js.map → layout-row.DcyZ3DP3.js.map} +1 -1
- package/dist/chunks/{pagination.DrWx8K01.js → pagination.C34l_EYf.js} +2 -2
- package/dist/chunks/{pagination.DrWx8K01.js.map → pagination.C34l_EYf.js.map} +1 -1
- package/dist/chunks/{promo-banner.oUapgyV-.js → promo-banner.CzR9ri5v.js} +2 -2
- package/dist/chunks/{promo-banner.oUapgyV-.js.map → promo-banner.CzR9ri5v.js.map} +1 -1
- package/dist/chunks/{search-bar.DDePObYJ.js → search-bar.Dy0dBek2.js} +3 -3
- package/dist/chunks/{search-bar.DDePObYJ.js.map → search-bar.Dy0dBek2.js.map} +1 -1
- package/dist/chunks/{secondary-nav.ysDOs9J9.js → secondary-nav.DYFnrUIK.js} +3 -3
- package/dist/chunks/{secondary-nav.ysDOs9J9.js.map → secondary-nav.DYFnrUIK.js.map} +1 -1
- package/dist/chunks/{selection-card-group.pUl1EuFV.js → selection-card-group.BY8o4PYF.js} +10 -10
- package/dist/chunks/{selection-card-group.pUl1EuFV.js.map → selection-card-group.BY8o4PYF.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DWVHnlNN.js → use-cached-selected-values.BOZK76mN.js} +7 -4
- package/dist/chunks/{use-cached-selected-values.DWVHnlNN.js.map → use-cached-selected-values.BOZK76mN.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/index.js +19 -19
- package/dist/input-field-password.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/layout.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/styles/bento-dark.css +3 -0
- package/dist/styles/bento-light.css +3 -0
- package/dist/styles/bento.css +3 -0
- package/dist/styles/legacy.css +3 -0
- package/dist/styles/styleguide.css +3 -0
- package/dist/web-types.json +1 -1
- package/package.json +5 -3
- package/dist/chunks/data-grid.eX0SZIFQ.js +0 -3174
- package/dist/chunks/data-grid.eX0SZIFQ.js.map +0 -1
- package/dist/chunks/date-range-picker.C9Ht_Egi.js.map +0 -1
- package/dist/chunks/filter-bar.DVLYNNwQ.js.map +0 -1
- package/dist/chunks/index.Cwtxz7pr.js +0 -344
- package/dist/chunks/index.Cwtxz7pr.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.b-typography[data-v-830be35d]{scrollbar-color:var(--b-color-background-quaternary) transparent;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-variant-numeric:var(--b-text-font-variant-numeric)}.b-typography[data-v-830be35d],.b-typography[data-v-830be35d]:before,.b-typography[data-v-830be35d]:after{box-sizing:border-box}.b-typography[data-v-830be35d] *,.b-typography[data-v-830be35d] *:before,.b-typography[data-v-830be35d] *:after{box-sizing:border-box}.b-typography[data-v-830be35d] ::-webkit-scrollbar{height:14px;width:14px}.b-typography[data-v-830be35d] ::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:var(--b-color-background-quaternary);border:3px solid transparent;border-radius:var(--b-border-radius-l)}.b-typography--rich-text[data-v-830be35d]>:first-child{margin-top:0}.b-typography--rich-text[data-v-830be35d] h1{font-family:var(--b-text-title-l-font-family);font-size:var(--b-text-title-l-mobile-font-size);font-size:clamp(var(--b-text-title-l-mobile-font-size),.44vw + 18.34px,var(--b-text-title-l-font-size));font-weight:var(--b-text-title-l-font-weight);letter-spacing:var(--b-text-title-l-letter-spacing);line-height:clamp(var(--b-text-title-l-mobile-line-height),.44vw + 28.34px,var(--b-text-title-l-line-height))}.b-typography--rich-text[data-v-830be35d] h2{font-family:var(--b-text-title-m-font-family);font-size:clamp(var(--b-text-title-m-mobile-font-size),.22vw + 17.17px,var(--b-text-title-m-font-size));font-weight:var(--b-text-title-m-font-weight);letter-spacing:var(--b-text-title-m-letter-spacing);line-height:clamp(var(--b-text-title-m-mobile-line-height),.22vw + 27.17px,var(--b-text-title-m-line-height))}.b-typography--rich-text[data-v-830be35d] h3{font-family:var(--b-text-title-font-family);font-size:clamp(var(--b-text-title-mobile-font-size),16px,var(--b-text-title-font-size));font-weight:var(--b-text-title-font-weight);letter-spacing:var(--b-text-title-letter-spacing);line-height:clamp(var(--b-text-title-mobile-line-height),26px,var(--b-text-title-line-height))}.b-typography--rich-text[data-v-830be35d] h4,.b-typography--rich-text[data-v-830be35d] h5,.b-typography--rich-text[data-v-830be35d] h6{font-family:var(--b-text-body-font-family);font-size:var(--b-text-body-font-size);font-weight:var(--b-text-body-font-weight);letter-spacing:var(--b-text-body-letter-spacing);line-height:var(--b-text-body-line-height);font-weight:var(--b-text-rich-text-heading-font-weight)}.b-typography--rich-text[data-v-830be35d] h1,.b-typography--rich-text[data-v-830be35d] h2,.b-typography--rich-text[data-v-830be35d] h3,.b-typography--rich-text[data-v-830be35d] h4,.b-typography--rich-text[data-v-830be35d] h5,.b-typography--rich-text[data-v-830be35d] h6{margin:var(--b-text-rich-text-heading-margin)}.b-typography--rich-text[data-v-830be35d] p{margin:var(--b-text-rich-text-paragraph-margin)}.b-typography--rich-text[data-v-830be35d] ul,.b-typography--rich-text[data-v-830be35d] ol{margin:0;padding-left:var(--b-text-rich-text-list-padding-left)}.b-typography--rich-text[data-v-830be35d] li{margin:var(--b-text-rich-text-list-margin)}.b-typography--rich-text[data-v-830be35d] ul li{list-style-type:disc}.b-typography--rich-text[data-v-830be35d] pre{background-color:var(--b-text-rich-text-code-background-color);font-family:var(--b-text-rich-text-code-font-family);font-weight:var(--b-text-rich-text-code-font-weight);line-height:var(--b-text-rich-text-pre-line-height);margin:var(--b-text-rich-text-pre-margin);padding:var(--b-text-rich-text-pre-padding)}.b-typography--rich-text[data-v-830be35d] code{background-color:var(--b-text-rich-text-code-background-color);font-family:var(--b-text-rich-text-code-font-family);font-weight:var(--b-text-rich-text-code-font-weight)}.b-typography--rich-text[data-v-830be35d] mark{background-color:var(--b-text-rich-text-mark-background-color)}.b-typography--rich-text[data-v-830be35d] blockquote{font-style:italic;font-weight:var(--b-text-rich-text-blockquote-font-weight);margin:var(--b-text-rich-text-blockquote-margin)}.b-typography--rich-text[data-v-830be35d] table{border-collapse:collapse;border-spacing:0;line-height:var(--b-text-rich-text-table-line-height);margin:var(--b-text-rich-text-table-margin);text-align:left}.b-typography--rich-text[data-v-830be35d] table th{font-weight:var(--b-text-rich-text-table-header-font-weight)}.b-typography--rich-text[data-v-830be35d] table th,.b-typography--rich-text[data-v-830be35d] table td{border:var(--b-text-rich-text-table-border);padding:var(--b-text-rich-text-table-padding)}.b-typography--rich-text[data-v-830be35d] table caption{font-style:italic;line-height:var(--b-text-rich-text-table-caption-line-height);margin:var(--b-text-rich-text-table-caption-margin);text-align:left}.b-typography--rich-text.b-typography--caption[data-v-830be35d] p{margin:var(--b-text-rich-text-caption-paragraph-margin)}.b-typography--rich-text.b-typography--caption[data-v-830be35d] ul,.b-typography--rich-text.b-typography--caption[data-v-830be35d] ol{padding-left:var(--b-text-rich-text-caption-list-padding-left)}.b-typography--rich-text.b-typography--caption[data-v-830be35d] li{margin:var(--b-text-rich-text-caption-list-margin)}.b-typography--rich-text.b-typography--caption[data-v-830be35d] blockquote{margin:var(--b-text-rich-text-caption-blockquote-margin)}.b-typography--rich-text.b-typography--caption[data-v-830be35d] table th,.b-typography--rich-text.b-typography--caption[data-v-830be35d] table td{padding:var(--b-text-rich-text-caption-table-padding)}.b-typography--rich-text.b-typography--caption[data-v-830be35d] pre{line-height:var(--b-text-rich-text-caption-pre-line-height)}.b-typography--caption[data-v-830be35d]{font-family:var(--b-text-caption-font-family);font-size:var(--b-text-caption-font-size);font-weight:var(--b-text-caption-font-weight);letter-spacing:var(--b-text-caption-letter-spacing);line-height:var(--b-text-caption-line-height)}.b-typography--caption-wide[data-v-830be35d]{line-height:var(--b-text-caption-wide-line-height)}.b-typography--caption-stronger[data-v-830be35d]{font-weight:var(--b-text-caption-stronger-font-weight)}.b-typography--body[data-v-830be35d]{font-family:var(--b-text-body-font-family);font-size:var(--b-text-body-font-size);font-weight:var(--b-text-body-font-weight);letter-spacing:var(--b-text-body-letter-spacing);line-height:var(--b-text-body-line-height)}.b-typography--body-wide[data-v-830be35d]{line-height:var(--b-text-body-wide-line-height)}.b-typography--body-stronger[data-v-830be35d]{font-weight:var(--b-text-body-stronger-font-weight)}.b-typography--body-strongest[data-v-830be35d]{font-weight:var(--b-text-body-strongest-font-weight)}.b-typography--subtitle[data-v-830be35d]{font-family:var(--b-text-subtitle-font-family);font-size:var(--b-text-subtitle-font-size);font-weight:var(--b-text-subtitle-font-weight);letter-spacing:var(--b-text-subtitle-letter-spacing);line-height:var(--b-text-subtitle-line-height)}.b-typography--subtitle-stronger[data-v-830be35d]{font-weight:var(--b-text-subtitle-stronger-font-weight)}.b-typography--title[data-v-830be35d]{font-family:var(--b-text-title-font-family);font-size:clamp(var(--b-text-title-mobile-font-size),16px,var(--b-text-title-font-size));font-weight:var(--b-text-title-font-weight);letter-spacing:var(--b-text-title-letter-spacing);line-height:clamp(var(--b-text-title-mobile-line-height),26px,var(--b-text-title-line-height))}.b-typography--title-m[data-v-830be35d]{font-family:var(--b-text-title-m-font-family);font-size:clamp(var(--b-text-title-m-mobile-font-size),.22vw + 17.17px,var(--b-text-title-m-font-size));font-weight:var(--b-text-title-m-font-weight);letter-spacing:var(--b-text-title-m-letter-spacing);line-height:clamp(var(--b-text-title-m-mobile-line-height),.22vw + 27.17px,var(--b-text-title-m-line-height))}.b-typography--title-l[data-v-830be35d]{font-family:var(--b-text-title-l-font-family);font-size:var(--b-text-title-l-mobile-font-size);font-size:clamp(var(--b-text-title-l-mobile-font-size),.44vw + 18.34px,var(--b-text-title-l-font-size));font-weight:var(--b-text-title-l-font-weight);letter-spacing:var(--b-text-title-l-letter-spacing);line-height:clamp(var(--b-text-title-l-mobile-line-height),.44vw + 28.34px,var(--b-text-title-l-line-height))}
|
|
1
|
+
.b-typography[data-v-830be35d]{scrollbar-color:var(--b-color-background-quaternary) transparent;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-variant-numeric:var(--b-text-font-variant-numeric)}.b-typography[data-v-830be35d],.b-typography[data-v-830be35d]:before,.b-typography[data-v-830be35d]:after{box-sizing:border-box}.b-typography[data-v-830be35d] *,.b-typography[data-v-830be35d] *:before,.b-typography[data-v-830be35d] *:after{box-sizing:border-box}.b-typography[data-v-830be35d] ::-webkit-scrollbar{height:14px;width:14px}.b-typography[data-v-830be35d] ::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:var(--b-color-background-quaternary);border:3px solid transparent;border-radius:var(--b-border-radius-l)}.b-typography--rich-text[data-v-830be35d]>:first-child{margin-top:0}.b-typography--rich-text h1[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h1{font-family:var(--b-text-title-l-font-family);font-size:var(--b-text-title-l-mobile-font-size);font-size:clamp(var(--b-text-title-l-mobile-font-size),.44vw + 18.34px,var(--b-text-title-l-font-size));font-weight:var(--b-text-title-l-font-weight);letter-spacing:var(--b-text-title-l-letter-spacing);line-height:clamp(var(--b-text-title-l-mobile-line-height),.44vw + 28.34px,var(--b-text-title-l-line-height))}.b-typography--rich-text h2[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h2{font-family:var(--b-text-title-m-font-family);font-size:clamp(var(--b-text-title-m-mobile-font-size),.22vw + 17.17px,var(--b-text-title-m-font-size));font-weight:var(--b-text-title-m-font-weight);letter-spacing:var(--b-text-title-m-letter-spacing);line-height:clamp(var(--b-text-title-m-mobile-line-height),.22vw + 27.17px,var(--b-text-title-m-line-height))}.b-typography--rich-text h3[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h3{font-family:var(--b-text-title-font-family);font-size:clamp(var(--b-text-title-mobile-font-size),16px,var(--b-text-title-font-size));font-weight:var(--b-text-title-font-weight);letter-spacing:var(--b-text-title-letter-spacing);line-height:clamp(var(--b-text-title-mobile-line-height),26px,var(--b-text-title-line-height))}.b-typography--rich-text h4[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h4,.b-typography--rich-text h5[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h5,.b-typography--rich-text h6[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h6{font-family:var(--b-text-body-font-family);font-size:var(--b-text-body-font-size);font-weight:var(--b-text-body-font-weight);letter-spacing:var(--b-text-body-letter-spacing);line-height:var(--b-text-body-line-height);font-weight:var(--b-text-rich-text-heading-font-weight)}.b-typography--rich-text h1[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h1,.b-typography--rich-text h2[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h2,.b-typography--rich-text h3[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h3,.b-typography--rich-text h4[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h4,.b-typography--rich-text h5[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h5,.b-typography--rich-text h6[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] h6{margin:var(--b-text-rich-text-heading-margin)}.b-typography--rich-text p[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] p{margin:var(--b-text-rich-text-paragraph-margin)}.b-typography--rich-text ul[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] ul,.b-typography--rich-text ol[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] ol{margin:0;padding-left:var(--b-text-rich-text-list-padding-left)}.b-typography--rich-text li[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] li{margin:var(--b-text-rich-text-list-margin)}.b-typography--rich-text ul li[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] ul li{list-style-type:disc}.b-typography--rich-text pre[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] pre{background-color:var(--b-text-rich-text-code-background-color);font-family:var(--b-text-rich-text-code-font-family);font-weight:var(--b-text-rich-text-code-font-weight);line-height:var(--b-text-rich-text-pre-line-height);margin:var(--b-text-rich-text-pre-margin);padding:var(--b-text-rich-text-pre-padding)}.b-typography--rich-text code[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] code{background-color:var(--b-text-rich-text-code-background-color);font-family:var(--b-text-rich-text-code-font-family);font-weight:var(--b-text-rich-text-code-font-weight)}.b-typography--rich-text mark[data-v-830be35d]{background-color:var(--b-text-rich-text-mark-background-color)}.b-typography--rich-text[data-v-830be35d] mark{background-color:var(--b-text-rich-text-mark-background-color)}.b-typography--rich-text blockquote[data-v-830be35d],.b-typography--rich-text[data-v-830be35d] blockquote{font-style:italic;font-weight:var(--b-text-rich-text-blockquote-font-weight);margin:var(--b-text-rich-text-blockquote-margin)}.b-typography--rich-text table[data-v-830be35d]{border-collapse:collapse;border-spacing:0;line-height:var(--b-text-rich-text-table-line-height);margin:var(--b-text-rich-text-table-margin);text-align:left}.b-typography--rich-text table th[data-v-830be35d]{font-weight:var(--b-text-rich-text-table-header-font-weight)}.b-typography--rich-text table th[data-v-830be35d],.b-typography--rich-text table td[data-v-830be35d]{border:var(--b-text-rich-text-table-border);padding:var(--b-text-rich-text-table-padding)}.b-typography--rich-text table caption[data-v-830be35d]{font-style:italic;line-height:var(--b-text-rich-text-table-caption-line-height);margin:var(--b-text-rich-text-table-caption-margin);text-align:left}.b-typography--rich-text[data-v-830be35d] table{border-collapse:collapse;border-spacing:0;line-height:var(--b-text-rich-text-table-line-height);margin:var(--b-text-rich-text-table-margin);text-align:left}.b-typography--rich-text[data-v-830be35d] table th{font-weight:var(--b-text-rich-text-table-header-font-weight)}.b-typography--rich-text[data-v-830be35d] table th,.b-typography--rich-text[data-v-830be35d] table td{border:var(--b-text-rich-text-table-border);padding:var(--b-text-rich-text-table-padding)}.b-typography--rich-text[data-v-830be35d] table caption{font-style:italic;line-height:var(--b-text-rich-text-table-caption-line-height);margin:var(--b-text-rich-text-table-caption-margin);text-align:left}.b-typography--rich-text.b-typography--caption p[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] p{margin:var(--b-text-rich-text-caption-paragraph-margin)}.b-typography--rich-text.b-typography--caption ul[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] ul,.b-typography--rich-text.b-typography--caption ol[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] ol{padding-left:var(--b-text-rich-text-caption-list-padding-left)}.b-typography--rich-text.b-typography--caption li[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] li{margin:var(--b-text-rich-text-caption-list-margin)}.b-typography--rich-text.b-typography--caption blockquote[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] blockquote{margin:var(--b-text-rich-text-caption-blockquote-margin)}.b-typography--rich-text.b-typography--caption table th[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] table th,.b-typography--rich-text.b-typography--caption table td[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] table td{padding:var(--b-text-rich-text-caption-table-padding)}.b-typography--rich-text.b-typography--caption pre[data-v-830be35d],.b-typography--rich-text.b-typography--caption[data-v-830be35d] pre{line-height:var(--b-text-rich-text-caption-pre-line-height)}.b-typography--caption[data-v-830be35d]{font-family:var(--b-text-caption-font-family);font-size:var(--b-text-caption-font-size);font-weight:var(--b-text-caption-font-weight);letter-spacing:var(--b-text-caption-letter-spacing);line-height:var(--b-text-caption-line-height)}.b-typography--caption-wide[data-v-830be35d]{line-height:var(--b-text-caption-wide-line-height)}.b-typography--caption-stronger[data-v-830be35d]{font-weight:var(--b-text-caption-stronger-font-weight)}.b-typography--body[data-v-830be35d]{font-family:var(--b-text-body-font-family);font-size:var(--b-text-body-font-size);font-weight:var(--b-text-body-font-weight);letter-spacing:var(--b-text-body-letter-spacing);line-height:var(--b-text-body-line-height)}.b-typography--body-wide[data-v-830be35d]{line-height:var(--b-text-body-wide-line-height)}.b-typography--body-stronger[data-v-830be35d]{font-weight:var(--b-text-body-stronger-font-weight)}.b-typography--body-strongest[data-v-830be35d]{font-weight:var(--b-text-body-strongest-font-weight)}.b-typography--subtitle[data-v-830be35d]{font-family:var(--b-text-subtitle-font-family);font-size:var(--b-text-subtitle-font-size);font-weight:var(--b-text-subtitle-font-weight);letter-spacing:var(--b-text-subtitle-letter-spacing);line-height:var(--b-text-subtitle-line-height)}.b-typography--subtitle-stronger[data-v-830be35d]{font-weight:var(--b-text-subtitle-stronger-font-weight)}.b-typography--title[data-v-830be35d]{font-family:var(--b-text-title-font-family);font-size:clamp(var(--b-text-title-mobile-font-size),16px,var(--b-text-title-font-size));font-weight:var(--b-text-title-font-weight);letter-spacing:var(--b-text-title-letter-spacing);line-height:clamp(var(--b-text-title-mobile-line-height),26px,var(--b-text-title-line-height))}.b-typography--title-m[data-v-830be35d]{font-family:var(--b-text-title-m-font-family);font-size:clamp(var(--b-text-title-m-mobile-font-size),.22vw + 17.17px,var(--b-text-title-m-font-size));font-weight:var(--b-text-title-m-font-weight);letter-spacing:var(--b-text-title-m-letter-spacing);line-height:clamp(var(--b-text-title-m-mobile-line-height),.22vw + 27.17px,var(--b-text-title-m-line-height))}.b-typography--title-l[data-v-830be35d]{font-family:var(--b-text-title-l-font-family);font-size:var(--b-text-title-l-mobile-font-size);font-size:clamp(var(--b-text-title-l-mobile-font-size),.44vw + 18.34px,var(--b-text-title-l-font-size));font-weight:var(--b-text-title-l-font-weight);letter-spacing:var(--b-text-title-l-letter-spacing);line-height:clamp(var(--b-text-title-l-mobile-line-height),.44vw + 28.34px,var(--b-text-title-l-line-height))}
|
package/dist/checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as t, a } from "./chunks/checkbox.
|
|
1
|
+
import { B as t, a } from "./chunks/checkbox.L94hTcPY.js";
|
|
2
2
|
import { C as x } from "./chunks/checkbox-input.D8ZUqd4m.js";
|
|
3
|
-
import { c as B, B as c } from "./chunks/checkbox-group.
|
|
3
|
+
import { c as B, B as c } from "./chunks/checkbox-group.BUmkYc2R.js";
|
|
4
4
|
export {
|
|
5
5
|
t as BentoCheckbox,
|
|
6
6
|
a as BentoCheckboxEvent,
|
|
@@ -4,7 +4,7 @@ import { B as D } from "./typography.DNzU41ah.js";
|
|
|
4
4
|
import { B as J } from "./button-actions-with-menu.Bn7Kdx4v.js";
|
|
5
5
|
import { C as Z } from "./cross.OvPfvoqX.js";
|
|
6
6
|
import { u as j } from "./i18n.CPGoe9tN.js";
|
|
7
|
-
import { u as q } from "./index.
|
|
7
|
+
import { u as q } from "./index.lHdwuJAx.js";
|
|
8
8
|
import { P as Y } from "./popover.D9Zw4w9l.js";
|
|
9
9
|
import { B as $ } from "./button-actions.Bjfo46Q_.js";
|
|
10
10
|
import { _ as H } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
@@ -199,4 +199,4 @@ const N = {
|
|
|
199
199
|
export {
|
|
200
200
|
fe as B
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=action-bar.
|
|
202
|
+
//# sourceMappingURL=action-bar.COQrEUYU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.C1Vu3qJu.js","sources":["../../../vue2/src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event emitted when the user click the close button\n */\n (e: 'close'): void;\n (e: 'cancel'): void;\n (e: 'save'): void;\n }>();\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","props","__props","emit","__emit","t","tc","useI18n","label","computed","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqPIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;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;AAAA,MAC5B;AAAA,QACA,OAAAE,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAAF,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJ4B,IAAA,YAAA;AACI,YAAAC,EAAA,GACAjB,EAAA,QAAAL,EAAA,MAAA,cAAA,KAAA,OAAAO,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAc,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAjB,EAAA,QAAAL,EAAA,MAAA,cAAA,MAAAO,EAAA,QAAA,MACIA,EAAA,SAAA,GACAgB,EAAA;AAAA,IACJ;AAIJ,WAAAb;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAmB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAtB,EAAA;AACI;AAEJ,cAAA0B,IAAAF,IAAAC;AACA,QAAApB,EAAA,QAAA,MACIE,EAAA,QAAA,IAAiCmB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"action-bar.COQrEUYU.js","sources":["../../../vue2/src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits<{\n /**\n * Event emitted when the user click the close button\n */\n (e: 'close'): void;\n (e: 'cancel'): void;\n (e: 'save'): void;\n }>();\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","props","__props","emit","__emit","t","tc","useI18n","label","computed","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqPIA,KAAA;AAAA,EAAe,MAAA,EAA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AAF,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAAE,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAAF,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJ4B,IAAA,YAAA;AACI,YAAAC,EAAA,GACAjB,EAAA,QAAAL,EAAA,MAAA,cAAA,KAAA,OAAAO,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAc,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAjB,EAAA,QAAAL,EAAA,MAAA,cAAA,MAAAO,EAAA,QAAA,MACIA,EAAA,SAAA,GACAgB,EAAA;AAAA,IACJ;AAIJ,WAAAb;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAmB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAtB,EAAA;AACI;AAEJ,cAAA0B,IAAAF,IAAAC;AACA,QAAApB,EAAA,QAAA,MACIE,EAAA,QAAA,IAAiCmB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as B, toRef as I, computed as l, watch as y, ref as T, resolveComponent as m, openBlock as n, createElementBlock as v, createVNode as N, normalizeClass as V, withCtx as s, Fragment as w, renderList as O, createBlock as E, createSlots as A, createTextVNode as k, toDisplayString as S, renderSlot as G, mergeProps as L, createCommentVNode as _ } from "vue";
|
|
2
|
-
import { B as U, a as d } from "./checkbox.
|
|
2
|
+
import { B as U, a as d } from "./checkbox.L94hTcPY.js";
|
|
3
3
|
import { g as P } from "./generate-uid.D-HFI38h.js";
|
|
4
4
|
import { d as R } from "./typography.DNzU41ah.js";
|
|
5
5
|
import { u as q } from "./use-form-layout-loading.D3lALhtC.js";
|
|
@@ -189,4 +189,4 @@ export {
|
|
|
189
189
|
i as B,
|
|
190
190
|
ee as c
|
|
191
191
|
};
|
|
192
|
-
//# sourceMappingURL=checkbox-group.
|
|
192
|
+
//# sourceMappingURL=checkbox-group.BUmkYc2R.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-group.C5IweVVx.js","sources":["../../../core/src/components/checkbox-group/checkbox-group.types.ts","../../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["import type { BentoCheckboxTag } from '@/core/components/checkbox/checkbox.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\ninterface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n tag?: BentoCheckboxTag;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n :tag=\"item.tag\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasContentSlot('content')\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import {\n BentoCheckboxGroupItems,\n BentoCheckboxGroupVariant,\n } from '@/core/components/checkbox-group/checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '@/core/components/checkbox/checkbox.types';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-checkbox-group';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: COMPONENT_NAME,\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit, slots }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for\n // vue3 named scoped slots\n const hasContentSlot = name => !!slots[name];\n const shouldShowSlotsError = computed(() => hasContentSlot('content') && props.variant !== 'vertical');\n\n watch(\n shouldShowSlotsError,\n newValue => {\n if (newValue) {\n throw new Error('The content slot is only available for the vertical checkbox group layout');\n }\n },\n { immediate: true }\n );\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n COMPONENT_NAME,\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n hasContentSlot,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox-group/checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","COMPONENT_NAME","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","slots","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","hasContentSlot","name","shouldShowSlotsError","watch","newValue","inputValue","ref","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","_ctx","hideLabel","label","optional","required","Fragment","renderList","item","createBlock","_component_bento_checkbox","disabled","createSlots","withCtx","createTextVNode","toDisplayString","renderSlot","mergeProps","_component_error_message","createCommentVNode"],"mappings":";;;;;;;;;AAKY,IAAAA,IAAA,k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AA,CAAA;AAAA,UA6BgC,GAAA;AAAA,QAAA,GAAA;AAAA,UA7BhCA,EAAA,cAAA;AAAA,YAAA,MAAA;AAAA,YAAA,IAAAK,EAAA,MAAA;AAAA,cAAAC,EAAAC,EAAAP,EAAA,WAAA,GAAA,CAAA;AAAA,YAAA,CAAA;AAAA,YAAA,KAAA;AAAA,UAAA,IAAA;AAAA;YA+BoB,MAAA;AAAA,YAAA,IAAAK,EAAA,MAAA;AAAA,cA/BpBG,EAAAf,EAAA,QAAA,WAAAgB,EAAA,EAAA,SAAA,GAAA,GAAAT,CAAA,GAAA,QAAA,EAAA;AAAA,YAAA,CAAA;AAAA,YAAA,KAAA;AAAA,UAAA,IAAA;AAAA,gIAAA,GAAA,GAAA;AAAA,MAAA,CAAA;AAAA,MAoCkBrB,GAAAA;AAAAA,IAAAA,GAAAA,GAAAA,CAAAA,oBAAAA,kBAAAA,SAAAA,eAAAA,YAAAA,QAAAA,cAAAA,SAAAA,YAAAA,YAAAA,cAAAA,CAAAA;AAAAA,IAIRc,EAAA,+BAAAH,EAAA,GAAAW,EAAAS,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAAjB,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA,MAvClB,OAAA;AAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAkB,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"checkbox-group.BUmkYc2R.js","sources":["../../../core/src/components/checkbox-group/checkbox-group.types.ts","../../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["import type { BentoCheckboxTag } from '@/core/components/checkbox/checkbox.types';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\ninterface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n tag?: BentoCheckboxTag;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n :tag=\"item.tag\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasContentSlot('content')\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import {\n BentoCheckboxGroupItems,\n BentoCheckboxGroupVariant,\n } from '@/core/components/checkbox-group/checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '@/core/components/checkbox/checkbox.types';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-checkbox-group';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: COMPONENT_NAME,\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit, slots }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for\n // vue3 named scoped slots\n const hasContentSlot = name => !!slots[name];\n const shouldShowSlotsError = computed(() => hasContentSlot('content') && props.variant !== 'vertical');\n\n watch(\n shouldShowSlotsError,\n newValue => {\n if (newValue) {\n throw new Error('The content slot is only available for the vertical checkbox group layout');\n }\n },\n { immediate: true }\n );\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n COMPONENT_NAME,\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n hasContentSlot,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox-group/checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","COMPONENT_NAME","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","slots","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","hasContentSlot","name","shouldShowSlotsError","watch","newValue","inputValue","ref","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","_ctx","hideLabel","label","optional","required","Fragment","renderList","item","createBlock","_component_bento_checkbox","disabled","createSlots","withCtx","createTextVNode","toDisplayString","renderSlot","mergeProps","_component_error_message","createCommentVNode"],"mappings":";;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACwDR,MAAAE,IAAA,wBAqBAC,IAAAC,EAAA;AAAA,EAA+B,MAAAF;AAAA,EACrB,YAAA,EAAA,eAAAG,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACmD,OAAA,EAAA,MAAA,aAAA;AAAA,EAC7B,OAAA;AAAA;AAAA;AAAA;AAAA,IACrB,aAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAIwC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKD,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKE,QAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN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AAA,YAAAA,QAAAA,cAAAA,SAAAA,YAAAA,YAAAA,cAAAA,CAAAA;AAAAA,IAIRc,EAAA,+BAAAH,EAAA,GAAAW,EAAAS,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAAjB,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA,MAvClB,OAAA;AAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAkB,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as Y, toRefs as I, computed as a, ref as K, resolveComponent as f, openBlock as r, createElementBlock as D, normalizeClass as Q, createVNode as W, mergeProps as T, createBlock as l, withCtx as s, createElementVNode as X, renderSlot as E, createTextVNode as U, toDisplayString as q, createCommentVNode as n } from "vue";
|
|
2
2
|
import { B as Z } from "./typography.DNzU41ah.js";
|
|
3
|
-
import {
|
|
4
|
-
import { u as x } from "./use-
|
|
5
|
-
import {
|
|
6
|
-
import { g as N } from "./generate-uid.D-HFI38h.js";
|
|
3
|
+
import { u as G } from "./use-default-slot-validator.O02rzsob.js";
|
|
4
|
+
import { u as x } from "./use-has-slot.B7eQSabc.js";
|
|
5
|
+
import { g as L } from "./generate-uid.D-HFI38h.js";
|
|
7
6
|
import { g as A } from "./get-slot-text.D5WBGjic.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { B as
|
|
7
|
+
import { u as ee } from "./i18n.CPGoe9tN.js";
|
|
8
|
+
import { u as ae } from "./aria-label.CaUURpnB.js";
|
|
9
|
+
import { B as oe } from "./tag.xvqrfTwk.js";
|
|
10
|
+
import { a as re, C as N } from "./checkbox-input.D8ZUqd4m.js";
|
|
11
11
|
import { E as te } from "./error-message.BYXS0kUN.js";
|
|
12
12
|
import { _ as le } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
13
|
import "../assets/checkbox.css";
|
|
@@ -32,9 +32,9 @@ const M = {
|
|
|
32
32
|
name: "bento-checkbox",
|
|
33
33
|
i18n: { messages: M },
|
|
34
34
|
components: {
|
|
35
|
-
BentoTag:
|
|
35
|
+
BentoTag: oe,
|
|
36
36
|
BentoTypography: Z,
|
|
37
|
-
CheckboxInput:
|
|
37
|
+
CheckboxInput: re,
|
|
38
38
|
ErrorMessage: te
|
|
39
39
|
},
|
|
40
40
|
model: { prop: "modelValue" },
|
|
@@ -103,22 +103,22 @@ const M = {
|
|
|
103
103
|
},
|
|
104
104
|
emits: [d.UPDATE, d.INPUT],
|
|
105
105
|
setup(e, { attrs: _, emit: h, slots: t }) {
|
|
106
|
-
const { t: y } =
|
|
107
|
-
|
|
106
|
+
const { t: y } = ee({ messages: M }), g = L("description"), i = L("error"), o = x(t), { disabled: u, indeterminate: v, modelValue: k, readonly: P, value: w } = I(e), V = A(t)("default"), $ = A(t)("description");
|
|
107
|
+
G("bento-checkbox", t.default, t.description);
|
|
108
108
|
const c = a(() => Array.isArray(k.value)), S = a(() => c.value ? k.value.some((m) => m === w.value) : k.value), b = a(() => v.value), R = a(
|
|
109
109
|
() => !e.disabled && !e.readonly && (e.hasError || !!e.errorMessage)
|
|
110
110
|
), C = a(() => !e.disabled && !e.readonly && !!e.errorMessage), p = a(() => o("content")), B = a(() => (b == null ? void 0 : b.value) || (S == null ? void 0 : S.value)), j = a(
|
|
111
111
|
() => (p == null ? void 0 : p.value) && (c == null ? void 0 : c.value) && (B == null ? void 0 : B.value)
|
|
112
112
|
), z = a(
|
|
113
113
|
() => `${C.value ? i : ""} ${V && $ ? g : ""}`.trim() || null
|
|
114
|
-
), F = K(_["aria-label"]), { ariaLabel: H } = I(e), J =
|
|
114
|
+
), F = K(_["aria-label"]), { ariaLabel: H } = I(e), J = ae({
|
|
115
115
|
ariaLabel: F.value,
|
|
116
116
|
// TODO: take this line away when the aria-label props is removed
|
|
117
117
|
label: H,
|
|
118
118
|
defaultFallback: o("default") ? A(t)("default") : y("checkbox")
|
|
119
119
|
}), O = a(() => ({
|
|
120
|
-
[`b-checkbox--${
|
|
121
|
-
[`b-checkbox--${
|
|
120
|
+
[`b-checkbox--${N.DISABLED}`]: u.value,
|
|
121
|
+
[`b-checkbox--${N.READONLY}`]: P.value
|
|
122
122
|
}));
|
|
123
123
|
return {
|
|
124
124
|
// Values
|
|
@@ -235,4 +235,4 @@ export {
|
|
|
235
235
|
Be as B,
|
|
236
236
|
d as a
|
|
237
237
|
};
|
|
238
|
-
//# sourceMappingURL=checkbox.
|
|
238
|
+
//# sourceMappingURL=checkbox.L94hTcPY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.B72ok3Yu.js","sources":["../../../core/src/components/checkbox/checkbox.types.ts","../../../vue2/src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '@/core/components/tag/tag.types';\nimport type {\n CheckboxInputType as BentoCheckboxType,\n MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/core/components/internal/checkbox-input/checkbox-input.types';\nimport { CheckboxInputState as BentoCheckboxState } from '@/core/components/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\">\n <checkbox-input\n ref=\"input\"\n v-bind=\"$attrs\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n BentoCheckboxTag,\n BentoCheckboxType,\n BentoMultiCheckboxType,\n } from '@/core/components/checkbox/checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { BentoCheckboxGroupItems } from '@/core/components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default') ? (getSlotText(slots)('default') as string) : t('checkbox'),\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n\n // Methods\n hasSlot,\n onChange,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox/checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","computedAriaLabel","useAriaLabel","conditionalClass","CheckboxInputState","newValue","normalizeClass","_ctx","createVNode","_component_checkbox_input","mergeProps","openBlock","createElementBlock","_hoisted_1","createBlock","_component_bento_typography","createElementVNode","createTextVNode","toDisplayString","required","createCommentVNode","_component_bento_tag","tag","renderSlot","_component_error_message"],"mappings":";;;;;;;;;;;;;AASY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;GC4ERE,KAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,MAAA,EAAA,UAAAC,EAAA;AAAA,EACW,YAAA;AAAA,IACL,UAAAC;AAAA,IACR,iBAAAC;AAAA,IACA,eAAAC;AAA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EAAAC,GAAA;AAAA,QANG,KAAA;AAAA,QACb,IAAAR,EAAA;AAAA,QACF,OAAA;AAAA,QACI,IAAA;AAAA,QA/BvB,SAAA;AAAA,MAAA,GAAA;AAAA;UAAAgB,EAAAhB,EAAA,QAAA,eAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA,CAAA;AAAA,QAAA,GAAA;AAAA,MAAA,GAAA,GAAA,CAAA,IAAA,CAAA,KAAAa,EAAA,IAAA,EAAA;AAAA,MAmCuGb,EAAA,0BAAAI,EAAA,GAAAG,EAAAU,GAAA;AAAA,QAAlC,KAAA;AAAA,QAAG,IAAAjB,EAAA;AAAA,QAnCxE,iBAAAA,EAAA;AAAA,MAAA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAa,EAAA,IAAA,EAAA;AAAA,MAuC+Bb,EAAA,wBAAAI,EAAA,GAAAG,EAAAC,GAAA;AAAA,QAFsD,KAAA;AAAA,QAAI,OAAA;AAAA,QAAc,IAAA;AAAA,QArCvG,SAAA;AAAA,MAAA,GAAA;AAAA;UAAAQ,EAAAhB,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA,CAAA;AAAA,QAAA,GAAA;AAAA,MAAA,CAAA,KAAAa,EAAA,IAAA,EAAA;AAAA,IAAA,CAAA,KAAAA,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"checkbox.L94hTcPY.js","sources":["../../../core/src/components/checkbox/checkbox.types.ts","../../../vue2/src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '@/core/components/tag/tag.types';\nimport type {\n CheckboxInputType as BentoCheckboxType,\n MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/core/components/internal/checkbox-input/checkbox-input.types';\nimport { CheckboxInputState as BentoCheckboxState } from '@/core/components/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\">\n <checkbox-input\n ref=\"input\"\n v-bind=\"$attrs\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('required') }})</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n BentoCheckboxTag,\n BentoCheckboxType,\n BentoMultiCheckboxType,\n } from '@/core/components/checkbox/checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { BentoCheckboxGroupItems } from '@/core/components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default') ? (getSlotText(slots)('default') as string) : t('checkbox'),\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n\n // Methods\n hasSlot,\n onChange,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/checkbox/checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","computedAriaLabel","useAriaLabel","conditionalClass","CheckboxInputState","newValue","normalizeClass","_ctx","createVNode","_component_checkbox_input","mergeProps","openBlock","createElementBlock","_hoisted_1","createBlock","_component_bento_typography","createElementVNode","createTextVNode","toDisplayString","required","createCommentVNode","_component_bento_tag","tag","renderSlot","_component_error_message"],"mappings":";;;;;;;;;;;;;AASY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;GC4ERE,KAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,MAAA,EAAA,UAAAC,EAAA;AAAA,EACW,YAAA;AAAA,IACL,UAAAC;AAAA,IACR,iBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,EACA;AAAA,EACJ,OAAA,EAAA,MAAA,aAAA;AAAA,EAC4B,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACrB,WAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAOsC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKC,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKE,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKF,eAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASK,YAAA;AAAA,MAQnC,MAAA,CAAA,SAAA,KAAA;AAAA,MACa,SAAA;AAAA,IACZ;AAAA;AAAA;AAAA;AAAA,IACb,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAK0C,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAK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AAA;AAAA,QAAA,GAAA;AAAA,MAAA,CAAA,KAAAa,EAAA,IAAA,EAAA;AAAA,IAAA,CAAA,KAAAA,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as Y, ref as v, computed as h, shallowRef as x, onMounted as F, watch as K, watchEffect as q, resolveComponent as i, openBlock as o, createElementBlock as _, normalizeClass as D, createElementVNode as C, createBlock as g, mergeProps as Q, createCommentVNode as c, createVNode as N, withCtx as f, createTextVNode as R, toDisplayString as O, renderSlot as Z, normalizeProps as ee, guardReactiveProps as ne } from "vue";
|
|
2
2
|
import { s as te, H as ae, t as n, j as oe, x as ie, a as se, b as le, p as re, E as ce, h as de, k as ge, i as pe, c as $, d as J, l as ue, e as me, C as H } from "./codemirror.BlV6WO5w.js";
|
|
3
3
|
import { B as be, a as he, b as fe, c as ye } from "./es6.b4enG1py.js";
|
|
4
|
-
import { B as ve } from "./dropdown.
|
|
4
|
+
import { B as ve } from "./dropdown.DpjMobyf.js";
|
|
5
5
|
import { B as _e } from "./button.pwNCxwPu.js";
|
|
6
6
|
import { B as Ce } from "./typography.DNzU41ah.js";
|
|
7
7
|
import "./events.FNmSWp_P.js";
|
|
@@ -389,4 +389,4 @@ export {
|
|
|
389
389
|
y as b,
|
|
390
390
|
on as c
|
|
391
391
|
};
|
|
392
|
-
//# sourceMappingURL=code-snippet.
|
|
392
|
+
//# sourceMappingURL=code-snippet.DbUGxmYi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-snippet.CiOcZKKH.js","sources":["../../../vue2/src/components/code-snippet/highlight.ts","../../../vue2/src/components/code-snippet/code-snippet.types.ts","../../../vue2/src/components/code-snippet/utils/get-lang-loader.ts","../../../vue2/src/components/code-snippet/utils/indent-same-as-line-before-extension.ts","../../../vue2/src/components/code-snippet/code-snippet.vue"],"sourcesContent":["import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { tags as t } from '@lezer/highlight';\nimport {\n BCodeSnippetCodeAreaHighlightBlue,\n BCodeSnippetCodeAreaHighlightGreen,\n BCodeSnippetCodeAreaHighlightOrange,\n BCodeSnippetCodeAreaHighlightRed,\n} from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { BentoCodeSnippetSupportedLanguage } from './code-snippet.types';\n\nconst lightThemeColors = {\n red: BCodeSnippetCodeAreaHighlightRed,\n orange: BCodeSnippetCodeAreaHighlightOrange,\n green: BCodeSnippetCodeAreaHighlightGreen,\n blue: BCodeSnippetCodeAreaHighlightBlue,\n invalid: '#ffffff',\n};\n\nconst highlightStyle = (colors, language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) =>\n HighlightStyle.define([\n {\n tag: t.keyword,\n color: colors.red,\n },\n {\n tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName],\n color: colors.green,\n },\n {\n tag: [t.function(t.variableName), t.labelName],\n color: colors.blue,\n },\n {\n tag: [t.color, t.constant(t.name), t.standard(t.name)],\n color: colors.red,\n },\n {\n tag: [t.definition(t.name), ...(language !== 'json' ? [t.separator] : [])],\n color: colors.red,\n },\n {\n tag: [t.typeName, t.className, t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace],\n color: colors.orange,\n },\n {\n tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)],\n color: colors.blue,\n },\n {\n tag: [t.meta, t.comment],\n color: colors.orange,\n },\n {\n tag: t.strong,\n fontWeight: 'bold',\n },\n {\n tag: t.emphasis,\n fontStyle: 'italic',\n },\n {\n tag: t.strikethrough,\n textDecoration: 'line-through',\n },\n {\n tag: t.link,\n color: colors.orange,\n textDecoration: 'underline',\n },\n {\n tag: t.heading,\n fontWeight: 'bold',\n color: colors.blue,\n },\n {\n tag: [t.atom, t.bool, t.special(t.variableName)],\n color: colors.red,\n },\n {\n tag: [t.processingInstruction, t.string, t.inserted],\n color: colors.blue,\n },\n {\n tag: t.invalid,\n color: colors.invalid,\n },\n ]);\n\nexport const lightThemeHighlight = (\n language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`\n) => syntaxHighlighting(highlightStyle(lightThemeColors, language));\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetVariant {\n INLINE = 'inline',\n SINGLELINE = 'singleline',\n MULTILINE = 'multiline',\n}\n\n// These supported types need to be kept in line with the ones in packages/vue2/src/components/code-snippet/composables/useLanguage.ts function and vice-versa\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetSupportedLanguage {\n JSON = 'json',\n XML = 'xml',\n JAVA = 'java',\n JAVASCRIPT = 'javascript',\n PYTHON = 'python',\n}\n\nexport enum BentoCodeSnippetEvent {\n ACTION = 'action',\n CHANGE = 'change',\n}\n","import { BentoCodeSnippetSupportedLanguage } from '@/components/code-snippet/code-snippet.types';\nimport { json } from '@codemirror/lang-json';\nimport { xml } from '@codemirror/lang-xml';\nimport { javascript } from '@codemirror/lang-javascript';\nimport { java } from '@codemirror/lang-java';\nimport { python } from '@codemirror/lang-python';\n\n/**\n * TODO: This should be handled with dynamic imports,\n * without relying on importing every single language/package available.\n * These supported types need to be kept in line with the ones in packages/vue2/src/components/code-snippet/code-snippet.types.ts enum\n */\nconst importsMap = {\n [BentoCodeSnippetSupportedLanguage.JSON]: json,\n [BentoCodeSnippetSupportedLanguage.XML]: xml,\n [BentoCodeSnippetSupportedLanguage.JAVASCRIPT]: javascript,\n [BentoCodeSnippetSupportedLanguage.JAVA]: java,\n [BentoCodeSnippetSupportedLanguage.PYTHON]: python,\n};\n\n/**\n * Returns a language loder for `CodeMirror`.\n * Supported languages: json, xml, javascript & java\n *\n * @param language Language to be used\n * @returns Language configuration loader to be used in codemirror\n */\nexport const getLangLoader = (language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) => {\n const loadLang = async () => importsMap[language];\n\n return loadLang;\n};\n","import { EditorSelection, type EditorState, type SelectionRange } from '@codemirror/state';\n\n/**\n * Calculate indentation for a new line based on line before it.\n * @param state - The editor state\n * @param line - the selection range, in this case one line\n * @returns the indentation string to be pre-pended on a new line.\n */\nconst getIndentation = (state: EditorState, line: SelectionRange) => {\n const currentLine = state.doc.lineAt(line.from);\n const indentMatch = /^\\s*/.exec(currentLine.text);\n return indentMatch ? indentMatch[0] : '';\n};\n\n/**\n * This extension to codemirror will, upon pressing the 'Enter' key, indent the new line\n * the same as the line before it.\n */\nexport const INDENT_SAME_AS_LINE_BEFORE = {\n key: 'Enter',\n run: ({ state, dispatch }) => {\n const changes = state.changeByRange(range => {\n const indentation = getIndentation(state, range);\n const newText = `\\n${indentation}`;\n return {\n changes: { from: range.from, to: range.to, insert: newText },\n range: EditorSelection.cursor(range.from + newText.length),\n };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: 'input' }));\n return true;\n },\n};\n\nexport default INDENT_SAME_AS_LINE_BEFORE;\n","<template>\n <div class=\"b-code-snippet\" :class=\"conditionalClasses\">\n <section v-if=\"!isInlineVariant\" class=\"b-code-snippet__action-bar\">\n <div class=\"b-code-snippet__action-bar--start\">\n <bento-dropdown\n v-if=\"availableLanguages.length > 0\"\n v-model=\"selectedLanguage\"\n v-bind=\"$props\"\n :disabled=\"availableLanguages.length === 1\"\n :items=\"availableLanguages\"\n class=\"b-code-snippet__language-picker\"\n @input=\"handleChangeLanguage\"\n />\n <bento-typography el=\"span\" stronger>\n {{ displayedLang }}\n </bento-typography>\n </div>\n <div class=\"b-code-snippet__action-bar--end\">\n <bento-loading-indicator v-if=\"loading\" />\n <copy v-if=\"currentContents !== null\" class=\"b-structured-list__icon\" :text=\"currentContents\" />\n <bento-button\n v-if=\"expandable\"\n variant=\"tertiary\"\n condensed\n :aria-label=\"t('expand')\"\n @click=\"showModal = true\"\n >\n <template #iconLeft>\n <expand-icon />\n </template>\n </bento-button>\n <bento-button v-if=\"actionable\" variant=\"primary\" tertiary condensed @click=\"onActionClicked\">\n <template #iconLeft>\n <bento-typography el=\"span\" class=\"b-code-snippet__action-button\">\n {{ runText }}\n </bento-typography>\n </template>\n </bento-button>\n </div>\n </section>\n <code v-if=\"content || editable\" class=\"b-code-snippet__code-area\">\n <div ref=\"container\" class=\"b-code-snippet__code-area-content\" :class=\"codeAreaContentConditionalClasses\" />\n </code>\n <section v-else>\n <slot name=\"empty-state\">\n <!-- TODO: switch with empty-state component when ready -->\n <div class=\"b-code-snippet__empty-state\">{{ t('nothingToDisplay') }}</div>\n </slot>\n </section>\n <base-modal\n v-if=\"expandable\"\n class=\"b-code-snippet__modal\"\n :hide-close-button=\"true\"\n :custom-padding=\"'0px'\"\n :is-dismissible=\"true\"\n :is-open=\"showModal\"\n size=\"large\"\n @close-modal=\"showModal = false\"\n >\n <template #content>\n <bento-code-snippet v-bind=\"{ ...$props, expandable: false }\" />\n </template>\n </base-modal>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref, shallowRef, watch, watchEffect } from 'vue';\n import { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view';\n import { Compartment, EditorState } from '@codemirror/state';\n import { history, indentWithTab } from '@codemirror/commands';\n import { lightThemeHighlight } from './highlight';\n import { getLangLoader, INDENT_SAME_AS_LINE_BEFORE } from './utils';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { BentoTooltipDirective } from '@/directives';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { useI18n } from '@/utils/ts/i18n';\n import { Copy } from '@/internal';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import {\n BentoCodeSnippetEvent,\n BentoCodeSnippetSupportedLanguage,\n BentoCodeSnippetVariant,\n } from '@/components/code-snippet/code-snippet.types';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A code-snippet is a container to display code in a readable way.\n * Come with added functionalities like syntax highlighting, editing and actioning the code\n *\n * @example\n * import { BentoCodeSnippet } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCodeSnippet },\n * template: `\n * <bento-code-snippet :variant=\"BentoCodeSnippetVariant.MULTILINE\" content=\"{ example: 1234 }\" />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-code-snippet',\n components: {\n BentoTypography,\n BentoButton,\n BentoDropdown,\n Copy,\n BaseModal,\n BentoLoadingIndicator,\n ExpandIcon,\n },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Defines the variant of code-snippet\n */\n variant: {\n type: String as PropType<BentoCodeSnippetVariant | `${BentoCodeSnippetVariant}`>,\n default: BentoCodeSnippetVariant.MULTILINE,\n validator: (value: BentoCodeSnippetVariant) => Object.values(BentoCodeSnippetVariant).includes(value),\n },\n /**\n * Language name for syntax highlighting rules\n */\n lang: {\n type: String as PropType<BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`>,\n default: BentoCodeSnippetSupportedLanguage.JSON,\n validator: (value: BentoCodeSnippetSupportedLanguage) =>\n Object.values(BentoCodeSnippetSupportedLanguage).includes(value),\n },\n /**\n * Label to show in the action-bar, describing the language\n */\n langLabel: {\n type: String,\n default: null,\n },\n /**\n * The code content\n */\n content: {\n type: String,\n default: '',\n },\n /**\n * Allows editing of the code-snippet content by the user\n */\n editable: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays a button that when clicked will emit an action event\n * Leaves to the parent component the logic of what to do with it\n */\n actionable: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays a button that can expand the codeblock into a modal to easily\n * view large blocks of code.\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays a button that when clicked will emit a run event\n * Leaves to the parent component the logic of what to do with it\n */\n actionableText: {\n type: String,\n default: 'run',\n },\n /**\n * Toggles the loading indicator within the action bar\n */\n loading: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoCodeSnippetEvent.ACTION, BentoCodeSnippetEvent.CHANGE],\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // language\n const selectedLanguage = ref<string | null>(null);\n const availableLanguages = []; // TODO: implement\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const handleChangeLanguage = () => {};\n const displayedLang = computed(() => props.langLabel ?? props.lang.toUpperCase());\n\n const isInlineVariant = computed(() => props.variant === BentoCodeSnippetVariant.INLINE);\n\n const conditionalClasses = computed(() => ({\n 'b-code-snippet--inline': isInlineVariant.value,\n 'b-code-snippet--scrollable': !isInlineVariant.value,\n }));\n\n const codeAreaContentConditionalClasses = computed(() => ({\n 'b-code-snippet__code-area-content--editable': props.editable,\n }));\n\n const loadLang = getLangLoader(props.lang);\n\n const container = shallowRef<HTMLDivElement>();\n const editor = shallowRef<EditorView>();\n const languageConf = new Compartment();\n const editorTheme = new Compartment();\n const editorReadOnly = new Compartment();\n\n const currentContents = ref(null);\n const contentLength = ref(0);\n\n onMounted(async () => {\n const language = await loadLang();\n\n // alongside the updateListener plugin it acts as a watcher of changes to the editor state\n currentContents.value = props.content;\n const updateCurrentContents = ({ state }) => {\n currentContents.value = state.doc.toString();\n };\n\n const extensions = [\n highlightActiveLine(),\n keymap.of([indentWithTab, INDENT_SAME_AS_LINE_BEFORE]),\n languageConf.of(language()),\n editorTheme.of(lightThemeHighlight(props.lang)),\n\n editorReadOnly.of(EditorState.readOnly.of(!props.editable)),\n EditorView.updateListener.of(content => updateCurrentContents(content)),\n ];\n\n if (props.variant === 'multiline') {\n extensions.push([lineNumbers(), history()]);\n }\n\n const state = EditorState.create({\n doc: props.content,\n extensions: [...extensions],\n });\n contentLength.value = state.doc.length;\n\n editor.value = new EditorView({\n state,\n parent: container.value,\n });\n });\n watch(\n () => props.content,\n () => {\n if (props.content !== currentContents.value) {\n const upcomingContentLength = props.content.length;\n editor.value.dispatch({\n changes: {\n from: 0,\n to: contentLength.value,\n insert: props.content,\n },\n });\n contentLength.value = upcomingContentLength;\n }\n }\n );\n\n const runText = computed(() => t(props.actionableText as 'run'));\n const onActionClicked = () => {\n emit(BentoCodeSnippetEvent.ACTION, currentContents.value);\n };\n\n watchEffect(() => {\n if (currentContents.value !== null) {\n emit(BentoCodeSnippetEvent.CHANGE, currentContents.value);\n }\n });\n\n const showModal = ref(false);\n\n return {\n // Values\n availableLanguages,\n codeAreaContentConditionalClasses,\n conditionalClasses,\n container,\n currentContents,\n displayedLang,\n editor,\n selectedLanguage,\n showModal,\n isInlineVariant,\n\n // Methods\n handleChangeLanguage,\n onActionClicked,\n runText,\n\n // Translations\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./code-snippet.scss\"></style>\n"],"names":["lightThemeColors","BCodeSnippetCodeAreaHighlightRed","BCodeSnippetCodeAreaHighlightOrange","BCodeSnippetCodeAreaHighlightGreen","BCodeSnippetCodeAreaHighlightBlue","highlightStyle","colors","language","HighlightStyle","tags","lightThemeHighlight","syntaxHighlighting","BentoCodeSnippetVariant","BentoCodeSnippetVariant2","BentoCodeSnippetSupportedLanguage","BentoCodeSnippetSupportedLanguage2","BentoCodeSnippetEvent","BentoCodeSnippetEvent2","importsMap","json","xml","javascript","java","python","getLangLoader","getIndentation","state","line","currentLine","indentMatch","INDENT_SAME_AS_LINE_BEFORE","dispatch","changes","range","newText","EditorSelection","_sfc_main","defineComponent","messages","BentoTypography","BentoButton","BentoDropdown","Copy","BaseModal","BentoLoadingIndicator","ExpandIcon","BentoTooltipDirective","value","props","emit","t","useI18n","selectedLanguage","ref","availableLanguages","handleChangeLanguage","displayedLang","computed","isInlineVariant","conditionalClasses","codeAreaContentConditionalClasses","loadLang","container","shallowRef","editor","languageConf","Compartment","editorTheme","editorReadOnly","currentContents","contentLength","onMounted","updateCurrentContents","state2","extensions","highlightActiveLine","keymap","indentWithTab","EditorState","EditorView","content","lineNumbers","history","watch","upcomingContentLength","runText","onActionClicked","watchEffect","showModal","_hoisted_3","_ctx","createCommentVNode","openBlock","createElementBlock","_hoisted_1","createElementVNode","_hoisted_2","createBlock","_component_bento_dropdown","mergeProps","_cache","$event","createVNode","_component_bento_typography","createTextVNode","toDisplayString","_component_bento_loading_indicator","_component_copy","_component_bento_button","_component_expand_icon","_hoisted_4","renderSlot","expandable","_component_base_modal","_component_bento_code_snippet","normalizeProps","guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAAA,KAAA;AAAA,EAAyB,KAAAC;AAAA,EAChB,QAAAC;AAAA,EACG,OAAAC;AAAA,EACD,MAAAC;AAAA,EACD,SAAA;AAEV,GAEAC,KAAA,CAAAC,GAAAC,MAAAC,GAAA,OAAA;AAAA,EAC0B;AAAA,IAClB,KAAAC,EAAA;AAAA,IACW,OAAAH,EAAA;AAAA,EACO;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,MAAAA,EAAA,SAAAA,EAAA,WAAAA,EAAA,cAAAA,EAAA,SAAA;AAAA,IACqE,OAAAH,EAAA;AAAA,EACnD;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,SAAAA,EAAA,YAAA,GAAAA,EAAA,SAAA;AAAA,IACiD,OAAAH,EAAA;AAAA,EAC/B;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,OAAAA,EAAA,SAAAA,EAAA,IAAA,GAAAA,EAAA,SAAAA,EAAA,IAAA,CAAA;AAAA,IACyD,OAAAH,EAAA;AAAA,EACvC;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,WAAAA,EAAA,IAAA,GAAA,GAAAF,MAAA,SAAA,CAAAE,EAAA,SAAA,IAAA,CAAA,CAAA;AAAA,IAC6E,OAAAH,EAAA;AAAA,EAC3D;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,UAAAA,EAAA,WAAAA,EAAA,QAAAA,EAAA,SAAAA,EAAA,YAAAA,EAAA,UAAAA,EAAA,MAAAA,EAAA,SAAA;AAAA,IACqG,OA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AAA,MAED,cAAAU,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAX,EAAA,YAAA;AAAA,IACyD,GAAA;AAAA;QA5DhFY,EAAAY,GAAAC,GAAAC,GAAA,EAAA,GAAA1B,EAAA,QAAA,YAAA,GAAA,CAAA,CAAA,GAAA,MAAA,EAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,SAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"code-snippet.DbUGxmYi.js","sources":["../../../vue2/src/components/code-snippet/highlight.ts","../../../vue2/src/components/code-snippet/code-snippet.types.ts","../../../vue2/src/components/code-snippet/utils/get-lang-loader.ts","../../../vue2/src/components/code-snippet/utils/indent-same-as-line-before-extension.ts","../../../vue2/src/components/code-snippet/code-snippet.vue"],"sourcesContent":["import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { tags as t } from '@lezer/highlight';\nimport {\n BCodeSnippetCodeAreaHighlightBlue,\n BCodeSnippetCodeAreaHighlightGreen,\n BCodeSnippetCodeAreaHighlightOrange,\n BCodeSnippetCodeAreaHighlightRed,\n} from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { BentoCodeSnippetSupportedLanguage } from './code-snippet.types';\n\nconst lightThemeColors = {\n red: BCodeSnippetCodeAreaHighlightRed,\n orange: BCodeSnippetCodeAreaHighlightOrange,\n green: BCodeSnippetCodeAreaHighlightGreen,\n blue: BCodeSnippetCodeAreaHighlightBlue,\n invalid: '#ffffff',\n};\n\nconst highlightStyle = (colors, language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) =>\n HighlightStyle.define([\n {\n tag: t.keyword,\n color: colors.red,\n },\n {\n tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName],\n color: colors.green,\n },\n {\n tag: [t.function(t.variableName), t.labelName],\n color: colors.blue,\n },\n {\n tag: [t.color, t.constant(t.name), t.standard(t.name)],\n color: colors.red,\n },\n {\n tag: [t.definition(t.name), ...(language !== 'json' ? [t.separator] : [])],\n color: colors.red,\n },\n {\n tag: [t.typeName, t.className, t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace],\n color: colors.orange,\n },\n {\n tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)],\n color: colors.blue,\n },\n {\n tag: [t.meta, t.comment],\n color: colors.orange,\n },\n {\n tag: t.strong,\n fontWeight: 'bold',\n },\n {\n tag: t.emphasis,\n fontStyle: 'italic',\n },\n {\n tag: t.strikethrough,\n textDecoration: 'line-through',\n },\n {\n tag: t.link,\n color: colors.orange,\n textDecoration: 'underline',\n },\n {\n tag: t.heading,\n fontWeight: 'bold',\n color: colors.blue,\n },\n {\n tag: [t.atom, t.bool, t.special(t.variableName)],\n color: colors.red,\n },\n {\n tag: [t.processingInstruction, t.string, t.inserted],\n color: colors.blue,\n },\n {\n tag: t.invalid,\n color: colors.invalid,\n },\n ]);\n\nexport const lightThemeHighlight = (\n language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`\n) => syntaxHighlighting(highlightStyle(lightThemeColors, language));\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetVariant {\n INLINE = 'inline',\n SINGLELINE = 'singleline',\n MULTILINE = 'multiline',\n}\n\n// These supported types need to be kept in line with the ones in packages/vue2/src/components/code-snippet/composables/useLanguage.ts function and vice-versa\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetSupportedLanguage {\n JSON = 'json',\n XML = 'xml',\n JAVA = 'java',\n JAVASCRIPT = 'javascript',\n PYTHON = 'python',\n}\n\nexport enum BentoCodeSnippetEvent {\n ACTION = 'action',\n CHANGE = 'change',\n}\n","import { BentoCodeSnippetSupportedLanguage } from '@/components/code-snippet/code-snippet.types';\nimport { json } from '@codemirror/lang-json';\nimport { xml } from '@codemirror/lang-xml';\nimport { javascript } from '@codemirror/lang-javascript';\nimport { java } from '@codemirror/lang-java';\nimport { python } from '@codemirror/lang-python';\n\n/**\n * TODO: This should be handled with dynamic imports,\n * without relying on importing every single language/package available.\n * These supported types need to be kept in line with the ones in packages/vue2/src/components/code-snippet/code-snippet.types.ts enum\n */\nconst importsMap = {\n [BentoCodeSnippetSupportedLanguage.JSON]: json,\n [BentoCodeSnippetSupportedLanguage.XML]: xml,\n [BentoCodeSnippetSupportedLanguage.JAVASCRIPT]: javascript,\n [BentoCodeSnippetSupportedLanguage.JAVA]: java,\n [BentoCodeSnippetSupportedLanguage.PYTHON]: python,\n};\n\n/**\n * Returns a language loder for `CodeMirror`.\n * Supported languages: json, xml, javascript & java\n *\n * @param language Language to be used\n * @returns Language configuration loader to be used in codemirror\n */\nexport const getLangLoader = (language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) => {\n const loadLang = async () => importsMap[language];\n\n return loadLang;\n};\n","import { EditorSelection, type EditorState, type SelectionRange } from '@codemirror/state';\n\n/**\n * Calculate indentation for a new line based on line before it.\n * @param state - The editor state\n * @param line - the selection range, in this case one line\n * @returns the indentation string to be pre-pended on a new line.\n */\nconst getIndentation = (state: EditorState, line: SelectionRange) => {\n const currentLine = state.doc.lineAt(line.from);\n const indentMatch = /^\\s*/.exec(currentLine.text);\n return indentMatch ? indentMatch[0] : '';\n};\n\n/**\n * This extension to codemirror will, upon pressing the 'Enter' key, indent the new line\n * the same as the line before it.\n */\nexport const INDENT_SAME_AS_LINE_BEFORE = {\n key: 'Enter',\n run: ({ state, dispatch }) => {\n const changes = state.changeByRange(range => {\n const indentation = getIndentation(state, range);\n const newText = `\\n${indentation}`;\n return {\n changes: { from: range.from, to: range.to, insert: newText },\n range: EditorSelection.cursor(range.from + newText.length),\n };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: 'input' }));\n return true;\n },\n};\n\nexport default INDENT_SAME_AS_LINE_BEFORE;\n","<template>\n <div class=\"b-code-snippet\" :class=\"conditionalClasses\">\n <section v-if=\"!isInlineVariant\" class=\"b-code-snippet__action-bar\">\n <div class=\"b-code-snippet__action-bar--start\">\n <bento-dropdown\n v-if=\"availableLanguages.length > 0\"\n v-model=\"selectedLanguage\"\n v-bind=\"$props\"\n :disabled=\"availableLanguages.length === 1\"\n :items=\"availableLanguages\"\n class=\"b-code-snippet__language-picker\"\n @input=\"handleChangeLanguage\"\n />\n <bento-typography el=\"span\" stronger>\n {{ displayedLang }}\n </bento-typography>\n </div>\n <div class=\"b-code-snippet__action-bar--end\">\n <bento-loading-indicator v-if=\"loading\" />\n <copy v-if=\"currentContents !== null\" class=\"b-structured-list__icon\" :text=\"currentContents\" />\n <bento-button\n v-if=\"expandable\"\n variant=\"tertiary\"\n condensed\n :aria-label=\"t('expand')\"\n @click=\"showModal = true\"\n >\n <template #iconLeft>\n <expand-icon />\n </template>\n </bento-button>\n <bento-button v-if=\"actionable\" variant=\"primary\" tertiary condensed @click=\"onActionClicked\">\n <template #iconLeft>\n <bento-typography el=\"span\" class=\"b-code-snippet__action-button\">\n {{ runText }}\n </bento-typography>\n </template>\n </bento-button>\n </div>\n </section>\n <code v-if=\"content || editable\" class=\"b-code-snippet__code-area\">\n <div ref=\"container\" class=\"b-code-snippet__code-area-content\" :class=\"codeAreaContentConditionalClasses\" />\n </code>\n <section v-else>\n <slot name=\"empty-state\">\n <!-- TODO: switch with empty-state component when ready -->\n <div class=\"b-code-snippet__empty-state\">{{ t('nothingToDisplay') }}</div>\n </slot>\n </section>\n <base-modal\n v-if=\"expandable\"\n class=\"b-code-snippet__modal\"\n :hide-close-button=\"true\"\n :custom-padding=\"'0px'\"\n :is-dismissible=\"true\"\n :is-open=\"showModal\"\n size=\"large\"\n @close-modal=\"showModal = false\"\n >\n <template #content>\n <bento-code-snippet v-bind=\"{ ...$props, expandable: false }\" />\n </template>\n </base-modal>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref, shallowRef, watch, watchEffect } from 'vue';\n import { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view';\n import { Compartment, EditorState } from '@codemirror/state';\n import { history, indentWithTab } from '@codemirror/commands';\n import { lightThemeHighlight } from './highlight';\n import { getLangLoader, INDENT_SAME_AS_LINE_BEFORE } from './utils';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { BentoTooltipDirective } from '@/directives';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { useI18n } from '@/utils/ts/i18n';\n import { Copy } from '@/internal';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import {\n BentoCodeSnippetEvent,\n BentoCodeSnippetSupportedLanguage,\n BentoCodeSnippetVariant,\n } from '@/components/code-snippet/code-snippet.types';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * A code-snippet is a container to display code in a readable way.\n * Come with added functionalities like syntax highlighting, editing and actioning the code\n *\n * @example\n * import { BentoCodeSnippet } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCodeSnippet },\n * template: `\n * <bento-code-snippet :variant=\"BentoCodeSnippetVariant.MULTILINE\" content=\"{ example: 1234 }\" />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-code-snippet',\n components: {\n BentoTypography,\n BentoButton,\n BentoDropdown,\n Copy,\n BaseModal,\n BentoLoadingIndicator,\n ExpandIcon,\n },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Defines the variant of code-snippet\n */\n variant: {\n type: String as PropType<BentoCodeSnippetVariant | `${BentoCodeSnippetVariant}`>,\n default: BentoCodeSnippetVariant.MULTILINE,\n validator: (value: BentoCodeSnippetVariant) => Object.values(BentoCodeSnippetVariant).includes(value),\n },\n /**\n * Language name for syntax highlighting rules\n */\n lang: {\n type: String as PropType<BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`>,\n default: BentoCodeSnippetSupportedLanguage.JSON,\n validator: (value: BentoCodeSnippetSupportedLanguage) =>\n Object.values(BentoCodeSnippetSupportedLanguage).includes(value),\n },\n /**\n * Label to show in the action-bar, describing the language\n */\n langLabel: {\n type: String,\n default: null,\n },\n /**\n * The code content\n */\n content: {\n type: String,\n default: '',\n },\n /**\n * Allows editing of the code-snippet content by the user\n */\n editable: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays a button that when clicked will emit an action event\n * Leaves to the parent component the logic of what to do with it\n */\n actionable: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays a button that can expand the codeblock into a modal to easily\n * view large blocks of code.\n */\n expandable: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays a button that when clicked will emit a run event\n * Leaves to the parent component the logic of what to do with it\n */\n actionableText: {\n type: String,\n default: 'run',\n },\n /**\n * Toggles the loading indicator within the action bar\n */\n loading: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoCodeSnippetEvent.ACTION, BentoCodeSnippetEvent.CHANGE],\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // language\n const selectedLanguage = ref<string | null>(null);\n const availableLanguages = []; // TODO: implement\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const handleChangeLanguage = () => {};\n const displayedLang = computed(() => props.langLabel ?? props.lang.toUpperCase());\n\n const isInlineVariant = computed(() => props.variant === BentoCodeSnippetVariant.INLINE);\n\n const conditionalClasses = computed(() => ({\n 'b-code-snippet--inline': isInlineVariant.value,\n 'b-code-snippet--scrollable': !isInlineVariant.value,\n }));\n\n const codeAreaContentConditionalClasses = computed(() => ({\n 'b-code-snippet__code-area-content--editable': props.editable,\n }));\n\n const loadLang = getLangLoader(props.lang);\n\n const container = shallowRef<HTMLDivElement>();\n const editor = shallowRef<EditorView>();\n const languageConf = new Compartment();\n const editorTheme = new Compartment();\n const editorReadOnly = new Compartment();\n\n const currentContents = ref(null);\n const contentLength = ref(0);\n\n onMounted(async () => {\n const language = await loadLang();\n\n // alongside the updateListener plugin it acts as a watcher of changes to the editor state\n currentContents.value = props.content;\n const updateCurrentContents = ({ state }) => {\n currentContents.value = state.doc.toString();\n };\n\n const extensions = [\n highlightActiveLine(),\n keymap.of([indentWithTab, INDENT_SAME_AS_LINE_BEFORE]),\n languageConf.of(language()),\n editorTheme.of(lightThemeHighlight(props.lang)),\n\n editorReadOnly.of(EditorState.readOnly.of(!props.editable)),\n EditorView.updateListener.of(content => updateCurrentContents(content)),\n ];\n\n if (props.variant === 'multiline') {\n extensions.push([lineNumbers(), history()]);\n }\n\n const state = EditorState.create({\n doc: props.content,\n extensions: [...extensions],\n });\n contentLength.value = state.doc.length;\n\n editor.value = new EditorView({\n state,\n parent: container.value,\n });\n });\n watch(\n () => props.content,\n () => {\n if (props.content !== currentContents.value) {\n const upcomingContentLength = props.content.length;\n editor.value.dispatch({\n changes: {\n from: 0,\n to: contentLength.value,\n insert: props.content,\n },\n });\n contentLength.value = upcomingContentLength;\n }\n }\n );\n\n const runText = computed(() => t(props.actionableText as 'run'));\n const onActionClicked = () => {\n emit(BentoCodeSnippetEvent.ACTION, currentContents.value);\n };\n\n watchEffect(() => {\n if (currentContents.value !== null) {\n emit(BentoCodeSnippetEvent.CHANGE, currentContents.value);\n }\n });\n\n const showModal = ref(false);\n\n return {\n // Values\n availableLanguages,\n codeAreaContentConditionalClasses,\n conditionalClasses,\n container,\n currentContents,\n displayedLang,\n editor,\n selectedLanguage,\n showModal,\n isInlineVariant,\n\n // Methods\n handleChangeLanguage,\n onActionClicked,\n runText,\n\n // Translations\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./code-snippet.scss\"></style>\n"],"names":["lightThemeColors","BCodeSnippetCodeAreaHighlightRed","BCodeSnippetCodeAreaHighlightOrange","BCodeSnippetCodeAreaHighlightGreen","BCodeSnippetCodeAreaHighlightBlue","highlightStyle","colors","language","HighlightStyle","tags","lightThemeHighlight","syntaxHighlighting","BentoCodeSnippetVariant","BentoCodeSnippetVariant2","BentoCodeSnippetSupportedLanguage","BentoCodeSnippetSupportedLanguage2","BentoCodeSnippetEvent","BentoCodeSnippetEvent2","importsMap","json","xml","javascript","java","python","getLangLoader","getIndentation","state","line","currentLine","indentMatch","INDENT_SAME_AS_LINE_BEFORE","dispatch","changes","range","newText","EditorSelection","_sfc_main","defineComponent","messages","BentoTypography","BentoButton","BentoDropdown","Copy","BaseModal","BentoLoadingIndicator","ExpandIcon","BentoTooltipDirective","value","props","emit","t","useI18n","selectedLanguage","ref","availableLanguages","handleChangeLanguage","displayedLang","computed","isInlineVariant","conditionalClasses","codeAreaContentConditionalClasses","loadLang","container","shallowRef","editor","languageConf","Compartment","editorTheme","editorReadOnly","currentContents","contentLength","onMounted","updateCurrentContents","state2","extensions","highlightActiveLine","keymap","indentWithTab","EditorState","EditorView","content","lineNumbers","history","watch","upcomingContentLength","runText","onActionClicked","watchEffect","showModal","_hoisted_3","_ctx","createCommentVNode","openBlock","createElementBlock","_hoisted_1","createElementVNode","_hoisted_2","createBlock","_component_bento_dropdown","mergeProps","_cache","$event","createVNode","_component_bento_typography","createTextVNode","toDisplayString","_component_bento_loading_indicator","_component_copy","_component_bento_button","_component_expand_icon","_hoisted_4","renderSlot","expandable","_component_base_modal","_component_bento_code_snippet","normalizeProps","guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAAA,KAAA;AAAA,EAAyB,KAAAC;AAAA,EAChB,QAAAC;AAAA,EACG,OAAAC;AAAA,EACD,MAAAC;AAAA,EACD,SAAA;AAEV,GAEAC,KAAA,CAAAC,GAAAC,MAAAC,GAAA,OAAA;AAAA,EAC0B;AAAA,IAClB,KAAAC,EAAA;AAAA,IACW,OAAAH,EAAA;AAAA,EACO;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,MAAAA,EAAA,SAAAA,EAAA,WAAAA,EAAA,cAAAA,EAAA,SAAA;AAAA,IACq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A,CAAA;AAAA,cAAA,CAAA;AAAA;YAAA,CAAA;AAAA,UAAA,CAAA;AAAA,UAAA,GAAA;AAAA,QAAA,GAAA,GAAA,CAAA,SAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,MAAA,CAAA;AAAA,IAAA,CAAA;AAAA,IAwCQD,EAAA,WAAAA,EAAA,YAAAE,EAAA,GAAAC,EAAA,QAAAiB,IAAA;AAAA,MACwBf,EAAA,OAAA;AAAA,QAAO,KAAA;AAAA;;;MAKmDgB,EAAArB,EAAA,QAAA,eAAA,CAAA,GAAA,MAAA;AAAA;MAIxEsB,GAAAA,EAAAA;AAAAA,IAAAA,CAAAA;AAAAA,IAlDlBtB,EAAA,cAAAE,EAAA,GAAAK,EAAAgB,GAAA;AAAA,MAmDyC,KAAA;AAAA,MAC5B,OAAA;AAAA,MACA,qBAAA;AAAA,MACgB,kBAAA;AAAA,MACPzB,kBAAAA;AAAAA,MACE,WAAAE,EAAA;AAAA,MACA,MAAA;AAAA,MAED,cAAAU,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAX,EAAA,YAAA;AAAA,IACyD,GAAA;AAAA;QA5DhFY,EAAAY,GAAAC,GAAAC,GAAA,EAAA,GAAA1B,EAAA,QAAA,YAAA,GAAA,CAAA,CAAA,GAAA,MAAA,EAAA;AAAA,MAAA,CAAA;AAAA,MAAA,GAAA;AAAA,IAAA,GAAA,GAAA,CAAA,SAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as F, useSlots as R, ref as _, computed as d, watch as g, onUnmounted as O, openBlock as a, createElementBlock as i, createVNode as B, unref as s, mergeProps as H, createSlots as P, withCtx as h, renderSlot as l, createElementVNode as p, normalizeClass as f, createCommentVNode as W, createBlock as I, Fragment as U, renderList as q, onMounted as A } from "vue";
|
|
2
2
|
import { B as E } from "./header.C0NBlBJv.js";
|
|
3
3
|
import { a as G, B as J } from "./tabs.B3DGxpmI.js";
|
|
4
|
-
import { b as K } from "./index.
|
|
4
|
+
import { b as K } from "./index.lHdwuJAx.js";
|
|
5
5
|
import { o as Q } from "./resize.Bqks3WUm.js";
|
|
6
6
|
import { u as N } from "./use-has-slot.B7eQSabc.js";
|
|
7
7
|
import { _ as V } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
@@ -164,4 +164,4 @@ export {
|
|
|
164
164
|
mt as a,
|
|
165
165
|
vt as d
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=dashboard-section.
|
|
167
|
+
//# sourceMappingURL=dashboard-section.YU5gKDEJ.js.map
|