@adyen/bento-vue2 1.48.0 → 1.49.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/index.d.ts +195 -170
- 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/dialog-page.css +1 -1
- package/dist/assets/file-uploader.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/checkbox.js +2 -2
- package/dist/chunks/{action-bar.CSgrrcK0.js → action-bar.pYOeP8WX.js} +4 -4
- package/dist/chunks/{action-bar.CSgrrcK0.js.map → action-bar.pYOeP8WX.js.map} +1 -1
- package/dist/chunks/{base-modal.47Xa68h9.js → base-modal.8kcvtFRx.js} +2 -2
- package/dist/chunks/{base-modal.47Xa68h9.js.map → base-modal.8kcvtFRx.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.D13mJiKO.js → button-actions-with-menu.BxWulRXh.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.D13mJiKO.js.map → button-actions-with-menu.BxWulRXh.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BXfJo9NR.js → checkbox-group.4TiIcnc7.js} +4 -4
- package/dist/chunks/{checkbox-group.BXfJo9NR.js.map → checkbox-group.4TiIcnc7.js.map} +1 -1
- package/dist/chunks/{checkbox.BEHpJDrF.js → checkbox.CE9NdY0R.js} +3 -3
- package/dist/chunks/{checkbox.BEHpJDrF.js.map → checkbox.CE9NdY0R.js.map} +1 -1
- package/dist/chunks/{code-snippet.CUx6b252.js → code-snippet.DSsZWtwa.js} +5 -5
- package/dist/chunks/{code-snippet.CUx6b252.js.map → code-snippet.DSsZWtwa.js.map} +1 -1
- package/dist/chunks/{controls-group.C3RDqB9H.js → controls-group.BnDPMaGI.js} +2 -2
- package/dist/chunks/{controls-group.C3RDqB9H.js.map → controls-group.BnDPMaGI.js.map} +1 -1
- package/dist/chunks/{copy.adSQlAOY.js → copy.DMlIj53I.js} +3 -3
- package/dist/chunks/{copy.adSQlAOY.js.map → copy.DMlIj53I.js.map} +1 -1
- package/dist/chunks/currency.B1F9YOIx.js.map +1 -1
- package/dist/chunks/{dashboard-section.q1XXEUZc.js → dashboard-section.DzMn8yDZ.js} +3 -3
- package/dist/chunks/{dashboard-section.q1XXEUZc.js.map → dashboard-section.DzMn8yDZ.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CpVP3VDL.js → dashed-underline.COTMts4l.js} +3 -3
- package/dist/chunks/{dashed-underline.CpVP3VDL.js.map → dashed-underline.COTMts4l.js.map} +1 -1
- package/dist/chunks/{data-grid-template.kCxfVaW7.js → data-grid-template.BPBneEHq.js} +2 -2
- package/dist/chunks/{data-grid-template.kCxfVaW7.js.map → data-grid-template.BPBneEHq.js.map} +1 -1
- package/dist/chunks/{data-grid.DgxC3G4n.js → data-grid.iqFUbiZy.js} +670 -664
- package/dist/chunks/data-grid.iqFUbiZy.js.map +1 -0
- package/dist/chunks/{date-picker.DqsQJ7P7.js → date-picker.C68IAqHR.js} +3 -3
- package/dist/chunks/{date-picker.DqsQJ7P7.js.map → date-picker.C68IAqHR.js.map} +1 -1
- package/dist/chunks/{date-range-picker.VZlIz83o.js → date-range-picker.dcQRDNS7.js} +6 -6
- package/dist/chunks/{date-range-picker.VZlIz83o.js.map → date-range-picker.dcQRDNS7.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.BLAjuup5.js → dropdown-tag.DhENnOHT.js} +3 -3
- package/dist/chunks/{dropdown-tag.BLAjuup5.js.map → dropdown-tag.DhENnOHT.js.map} +1 -1
- package/dist/chunks/{dropdown.DWgwNFNB.js → dropdown.BBHNOorv.js} +5 -5
- package/dist/chunks/{dropdown.DWgwNFNB.js.map → dropdown.BBHNOorv.js.map} +1 -1
- package/dist/chunks/{error-message.Da-p1QIA.js → error-message.xTNEaNn8.js} +2 -2
- package/dist/chunks/{error-message.Da-p1QIA.js.map → error-message.xTNEaNn8.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.DT7GsNqI.js → file-uploader.mLUYQnz1.js} +325 -316
- package/dist/chunks/{file-uploader.DT7GsNqI.js.map → file-uploader.mLUYQnz1.js.map} +1 -1
- package/dist/chunks/{filter-bar.D2YR4Tpz.js → filter-bar.CFcu6P8H.js} +16 -17
- package/dist/chunks/{filter-bar.D2YR4Tpz.js.map → filter-bar.CFcu6P8H.js.map} +1 -1
- package/dist/chunks/{focus-trap.CGypVwG6.js → focus-trap._RrLaKlq.js} +6 -3
- package/dist/chunks/{focus-trap.CGypVwG6.js.map → focus-trap._RrLaKlq.js.map} +1 -1
- package/dist/chunks/{header.D5MLt9hG.js → header.BeS6ktqU.js} +3 -3
- package/dist/chunks/{header.D5MLt9hG.js.map → header.BeS6ktqU.js.map} +1 -1
- package/dist/chunks/{index.D8ivUe7P.js → index.CU8GKq4C.js} +8 -7
- package/dist/chunks/{index.D8ivUe7P.js.map → index.CU8GKq4C.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.CO0mky_N.js → info-icon-with-popover.yeIoJzhj.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.CO0mky_N.js.map → info-icon-with-popover.yeIoJzhj.js.map} +1 -1
- package/dist/chunks/{info-icon.0d0GzDe2.js → info-icon.C4_l0WAf.js} +3 -3
- package/dist/chunks/{info-icon.0d0GzDe2.js.map → info-icon.C4_l0WAf.js.map} +1 -1
- package/dist/chunks/{input-field-password.CQtzruQM.js → input-field-password.Dez8haIj.js} +5 -5
- package/dist/chunks/{input-field-password.CQtzruQM.js.map → input-field-password.Dez8haIj.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.DWKZy2-k.js → input-field-phone-number.CPTonsjM.js} +2 -2
- package/dist/chunks/{input-field-phone-number.DWKZy2-k.js.map → input-field-phone-number.CPTonsjM.js.map} +1 -1
- package/dist/chunks/{input-field.3V5IblWw.js → input-field.lEMEBT7J.js} +3 -3
- package/dist/chunks/{input-field.3V5IblWw.js.map → input-field.lEMEBT7J.js.map} +1 -1
- package/dist/chunks/inspector.types.BtgXpTC7.js +101 -0
- package/dist/chunks/inspector.types.BtgXpTC7.js.map +1 -0
- package/dist/chunks/{layout-row.BfS-cPky.js → layout-row.CHwDU8yK.js} +7 -7
- package/dist/chunks/{layout-row.BfS-cPky.js.map → layout-row.CHwDU8yK.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.XbvBQqlt.js → listbox-option-tag.BJBWnC2r.js} +2 -2
- package/dist/chunks/{listbox-option-tag.XbvBQqlt.js.map → listbox-option-tag.BJBWnC2r.js.map} +1 -1
- package/dist/chunks/{menu.DYopJZ12.js → menu.lbODB0y3.js} +2 -2
- package/dist/chunks/{menu.DYopJZ12.js.map → menu.lbODB0y3.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.Pp5mp7hD.js → modal-fullscreen.Dz3kSuTz.js} +2 -2
- package/dist/chunks/{modal-fullscreen.Pp5mp7hD.js.map → modal-fullscreen.Dz3kSuTz.js.map} +1 -1
- package/dist/chunks/{modal.CCjAy7Hv.js → modal.DV55hSPn.js} +2 -2
- package/dist/chunks/{modal.CCjAy7Hv.js.map → modal.DV55hSPn.js.map} +1 -1
- package/dist/chunks/{pagination.8g4bC4tv.js → pagination.CuJ-P2bO.js} +2 -2
- package/dist/chunks/{pagination.8g4bC4tv.js.map → pagination.CuJ-P2bO.js.map} +1 -1
- package/dist/chunks/{popover.C-LwO38X.js → popover.BQGNMbQN.js} +2 -2
- package/dist/chunks/{popover.C-LwO38X.js.map → popover.BQGNMbQN.js.map} +1 -1
- package/dist/chunks/{popper-container.B1iB2ovW.js → popper-container.CsW4R0-t.js} +2 -2
- package/dist/chunks/{popper-container.B1iB2ovW.js.map → popper-container.CsW4R0-t.js.map} +1 -1
- package/dist/chunks/{promo-banner.DS0_aROF.js → promo-banner.BNXfyv3h.js} +6 -6
- package/dist/chunks/{promo-banner.DS0_aROF.js.map → promo-banner.BNXfyv3h.js.map} +1 -1
- package/dist/chunks/{radio-group.1z-IZvLU.js → radio-group.CUgib4vp.js} +4 -4
- package/dist/chunks/{radio-group.1z-IZvLU.js.map → radio-group.CUgib4vp.js.map} +1 -1
- package/dist/chunks/{search-bar.Bu12OC-l.js → search-bar.Dk-GuqgF.js} +3 -3
- package/dist/chunks/{search-bar.Bu12OC-l.js.map → search-bar.Dk-GuqgF.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CLDlWCXX.js → secondary-nav.DC2GrGaQ.js} +3 -3
- package/dist/chunks/{secondary-nav.CLDlWCXX.js.map → secondary-nav.DC2GrGaQ.js.map} +1 -1
- package/dist/chunks/{segmented-control.BJIlas0M.js → segmented-control.BxCcPbKd.js} +2 -2
- package/dist/chunks/{segmented-control.BJIlas0M.js.map → segmented-control.BxCcPbKd.js.map} +1 -1
- package/dist/chunks/{selection-card-group.usHcqYKO.js → selection-card-group.B-YY-iKp.js} +4 -4
- package/dist/chunks/{selection-card-group.usHcqYKO.js.map → selection-card-group.B-YY-iKp.js.map} +1 -1
- package/dist/chunks/{sidepanel.C_ff-PEn.js → sidepanel.Dp6dKRnq.js} +2 -2
- package/dist/chunks/{sidepanel.C_ff-PEn.js.map → sidepanel.Dp6dKRnq.js.map} +1 -1
- package/dist/chunks/{structured-list-item.TC8mVrrA.js → structured-list-item.DrY71Ndc.js} +4 -4
- package/dist/chunks/{structured-list-item.TC8mVrrA.js.map → structured-list-item.DrY71Ndc.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.A11AzfH0.js → summary-grid-item-custom.CXs6AMS4.js} +4 -4
- package/dist/chunks/{summary-grid-item-custom.A11AzfH0.js.map → summary-grid-item-custom.CXs6AMS4.js.map} +1 -1
- package/dist/chunks/{tag.3fthBtwc.js → tag.CevG31iQ.js} +2 -2
- package/dist/chunks/{tag.3fthBtwc.js.map → tag.CevG31iQ.js.map} +1 -1
- package/dist/chunks/{textarea.CpXux8qX.js → textarea.DHbXaxdU.js} +2 -2
- package/dist/chunks/{textarea.CpXux8qX.js.map → textarea.DHbXaxdU.js.map} +1 -1
- package/dist/chunks/{timeline-item.Ca9RJt0z.js → timeline-item.C4HOsaEG.js} +4 -4
- package/dist/chunks/{timeline-item.Ca9RJt0z.js.map → timeline-item.C4HOsaEG.js.map} +1 -1
- package/dist/chunks/{tooltip.R2sqydIE.js → tooltip.Bu8o7uyZ.js} +2 -2
- package/dist/chunks/{tooltip.R2sqydIE.js.map → tooltip.Bu8o7uyZ.js.map} +1 -1
- package/dist/chunks/{tutorial.Cc0tv59x.js → tutorial.BWWTUI9f.js} +4 -4
- package/dist/chunks/{tutorial.Cc0tv59x.js.map → tutorial.BWWTUI9f.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.C24AnZ-w.js → use-cached-selected-values.C5gHa-dC.js} +2 -2
- package/dist/chunks/{use-cached-selected-values.C24AnZ-w.js.map → use-cached-selected-values.C5gHa-dC.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +42 -42
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +8 -8
- package/dist/layout.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +1 -0
- package/dist/styles/bento-light.css +1 -0
- package/dist/styles/bento.css +1 -0
- package/dist/styles/legacy.css +1 -0
- package/dist/styles/styleguide.css +1 -0
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +31 -3
- package/package.json +4 -4
- package/dist/chunks/data-grid.DgxC3G4n.js.map +0 -1
- package/dist/chunks/inspector.types.GOl_-hXm.js +0 -70
- package/dist/chunks/inspector.types.GOl_-hXm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-snippet.CUx6b252.js","sources":["../../src/components/code-snippet/highlight.ts","../../src/components/code-snippet/code-snippet.types.ts","../../../../node_modules/.pnpm/codemirror-lang-csv@0.1.1/node_modules/codemirror-lang-csv/dist/index.js","../../src/components/code-snippet/utils/get-lang-loader.ts","../../src/components/code-snippet/utils/indent-same-as-line-before-extension.ts","../../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 CSV = 'csv',\n}\n\nexport enum BentoCodeSnippetEvent {\n ACTION = 'action',\n CHANGE = 'change',\n}\n","import { LRParser } from '@lezer/lr';\nimport { LRLanguage, LanguageSupport } from '@codemirror/language';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"nQVQPOOOOQO'#Ce'#CeOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_\",\n stateData: \"g~OWOS~OQPORPOSPO~OQRSR~\",\n goto: \"eYPPPPPZPPPaQRORSRTQOR\",\n nodeNames: \"⚠ Program String Separator Value\",\n maxTerm: 9,\n skippedNodes: [0],\n repeatNodeCount: 1,\n tokenData: \"'Y~RZOYtYZ!cZrtrs!hs|t|}'T}!]t!]!^'T!^;'St;'S;=`!]<%lOt~yUS~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~!`P;=`<%lt~!hOW~~!m]S~OY!hYZ#fZr!hrs%Ss|!h|}#f}!]!h!]!^#f!^#O!h#O#P%m#P;'S!h;'S;=`&}<%lO!h~#iVOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|<%lO#f~$TOQ~~$WRO;'S#f;'S;=`$a;=`O#f~$dWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l#f<%lO#f~%PP;=`<%l#f~%ZUQ~S~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~%rYS~OY!hYZ#fZ|!h|}#f}!]!h!]!^#f!^;'S!h;'S;=`&b;=`<%l#f<%lO!h~&eWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l!h<%lO#f~'QP;=`<%l!h~'YOR~\",\n tokenizers: [0],\n topRules: {\"Program\":[0,1]},\n tokenPrec: 18\n});\n\nconst csvLanguage = LRLanguage.define({\n parser: parser.configure({\n props: [\n styleTags({\n Separator: tags.separator,\n Value: tags.string,\n String: tags.string,\n LineComment: tags.lineComment,\n \"( )\": tags.paren,\n }),\n ],\n }),\n});\nfunction csv() {\n return new LanguageSupport(csvLanguage);\n}\n\nexport { csv, csvLanguage };\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';\nimport { csv } from 'codemirror-lang-csv';\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 [BentoCodeSnippetSupportedLanguage.CSV]: csv,\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","parser","LRParser","csvLanguage","LRLanguage","styleTags","csv","LanguageSupport","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"],"mappings":";;;;;;;;;;;;;;AAUA,MAAAA,KAAA;AAAA,EAAyB,KAAAC;AAAA,EAChB,QAAAC;AAAA,EACG,OAAAC;AAAA,EACD,MAAAC;AAAA,EACD,SAAA;AA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AAAA,MACA,iBAAAO;AAAA,MACA,eAAAb;AAAA,MACA,QAAAQ;AAAA,MACA,kBAAAZ;AAAA,MACA,WAAAoC;AAAA,MACA,iBAAA9B;AAAA;AAAA,MACA,sBAAAH;AAAA,MAGA,iBAAA+B;AAAA,MACA,SAAAD;AAAA;AAAA,MACA,GAAAnC;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[2]}
|
|
1
|
+
{"version":3,"file":"code-snippet.DSsZWtwa.js","sources":["../../src/components/code-snippet/highlight.ts","../../src/components/code-snippet/code-snippet.types.ts","../../../../node_modules/.pnpm/codemirror-lang-csv@0.1.1/node_modules/codemirror-lang-csv/dist/index.js","../../src/components/code-snippet/utils/get-lang-loader.ts","../../src/components/code-snippet/utils/indent-same-as-line-before-extension.ts","../../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 CSV = 'csv',\n}\n\nexport enum BentoCodeSnippetEvent {\n ACTION = 'action',\n CHANGE = 'change',\n}\n","import { LRParser } from '@lezer/lr';\nimport { LRLanguage, LanguageSupport } from '@codemirror/language';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"nQVQPOOOOQO'#Ce'#CeOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_\",\n stateData: \"g~OWOS~OQPORPOSPO~OQRSR~\",\n goto: \"eYPPPPPZPPPaQRORSRTQOR\",\n nodeNames: \"⚠ Program String Separator Value\",\n maxTerm: 9,\n skippedNodes: [0],\n repeatNodeCount: 1,\n tokenData: \"'Y~RZOYtYZ!cZrtrs!hs|t|}'T}!]t!]!^'T!^;'St;'S;=`!]<%lOt~yUS~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~!`P;=`<%lt~!hOW~~!m]S~OY!hYZ#fZr!hrs%Ss|!h|}#f}!]!h!]!^#f!^#O!h#O#P%m#P;'S!h;'S;=`&}<%lO!h~#iVOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|<%lO#f~$TOQ~~$WRO;'S#f;'S;=`$a;=`O#f~$dWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l#f<%lO#f~%PP;=`<%l#f~%ZUQ~S~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~%rYS~OY!hYZ#fZ|!h|}#f}!]!h!]!^#f!^;'S!h;'S;=`&b;=`<%l#f<%lO!h~&eWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l!h<%lO#f~'QP;=`<%l!h~'YOR~\",\n tokenizers: [0],\n topRules: {\"Program\":[0,1]},\n tokenPrec: 18\n});\n\nconst csvLanguage = LRLanguage.define({\n parser: parser.configure({\n props: [\n styleTags({\n Separator: tags.separator,\n Value: tags.string,\n String: tags.string,\n LineComment: tags.lineComment,\n \"( )\": tags.paren,\n }),\n ],\n }),\n});\nfunction csv() {\n return new LanguageSupport(csvLanguage);\n}\n\nexport { csv, csvLanguage };\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';\nimport { csv } from 'codemirror-lang-csv';\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 [BentoCodeSnippetSupportedLanguage.CSV]: csv,\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","parser","LRParser","csvLanguage","LRLanguage","styleTags","csv","LanguageSupport","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"],"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,EAAA,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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ed as s } from "vue";
|
|
2
2
|
import { d as c, B as b } from "./typography.J1v_SPG3.js";
|
|
3
|
-
import { F as u } from "./error-message.
|
|
3
|
+
import { F as u } from "./error-message.xTNEaNn8.js";
|
|
4
4
|
import { n as _ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import "../assets/controls-group.css";
|
|
6
6
|
const f = {}, m = /* @__PURE__ */ d({
|
|
@@ -78,4 +78,4 @@ const B = g.exports;
|
|
|
78
78
|
export {
|
|
79
79
|
B as C
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=controls-group.
|
|
81
|
+
//# sourceMappingURL=controls-group.BnDPMaGI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls-group.
|
|
1
|
+
{"version":3,"file":"controls-group.BnDPMaGI.js","sources":["../../src/components/internal/controls-group/controls-group.vue"],"sourcesContent":["<template>\n <fieldset\n class=\"b-controls-group\"\n :class=\"conditionalClasses\"\n :form=\"form\"\n :disabled=\"disabled\"\n :aria-describedby=\"ariaAttributes['aria-describedby']\"\n >\n <legend class=\"b-controls-group__label-container\" :class=\"legendConditionalClasses\">\n <field-label\n v-if=\"label\"\n class=\"b-controls-group__label\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography v-if=\"description\" class=\"b-controls-group__description\" el=\"span\">\n {{ description }}\n </bento-typography>\n </legend>\n <slot />\n </fieldset>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useAttrs } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { FieldLabel } from '@/components/internal/field-label';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const attrs = useAttrs();\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * The name of the component to cite when throwing a depreacte error.\n */\n componentName: { type: String, required: true },\n\n /**\n * Sets all child controls of the <fieldset> as disabled.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * The value of the id attribute of a <form> element the <fieldset> is to part of, even if it is not inside the form itself.\n */\n form: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * The label is shown when `hideLabel` is set to `true` or if `description` is passed\n */\n label: { type: String, required: true },\n\n /**\n * Indicates the field is optional.\n */\n optional: { 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 const ariaAttributes = computed(() => ({\n 'aria-describedby': attrs['aria-describedby']?.toString() as string,\n }));\n\n const conditionalClasses = computed(() => ({\n 'b-controls-group--disabled': props.disabled,\n }));\n\n const legendConditionalClasses = computed(() => {\n const isLabelAndDescriptionPresent = props.label && props.description;\n const shouldShowLabel = isLabelAndDescriptionPresent || props.hideLabel === false;\n\n return {\n 'b-controls-group__label-container--hidden': !shouldShowLabel,\n };\n });\n\n // eslint-disable-next-line eqeqeq -- Needs to show deprecate message when hideLabel is not set and no description available\n const hasNoPropsDefined = !props.description && props.hideLabel == undefined;\n if (hasNoPropsDefined) {\n deprecate(\n `${props.componentName}: The property \\`label\\` will always be rendered by default.`,\n `After version 2.0.0, the label will be shown by default.\n To continue hiding the label set \\`:hide-label=\"true\"\\`. Up until version 2.0.0, to display the label set \\`hide-label=\"false\"\\`.\n \\`label\\` will always be rendered when \\`description\\` is passed alongside with \\`label\\``,\n `2.0.0`\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A controls group components should be used whenever it is necessary to group a set of controls (i.e. radio buttons or checkboxes)\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * @example\n * import { ControlsGroup, BentoCheckbox, BentoRadioButton } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { ControlsGroup, BentoRadioButton },\n * template: `\n * <controls-group\n * label=\"Your group label\"\n * description=\"Description\"\n * >\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * </bento-radio-button>\n * <bento-radio-button\n * value=\"inputRadio\"\n * >\n * Another label text\n * </bento-radio-button>\n * </controls-group>\n * `\n * };\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/controls-group/controls-group.scss\" />\n"],"names":["__default__","attrs","useAttrs","ariaAttributes","computed","_a","conditionalClasses","props","legendConditionalClasses","hasNoPropsDefined","deprecate"],"mappings":";;;;;AA8II,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/GAC,IAAAC,EAAA,GAkDAC,IAAAC,EAAA,MAAA;;AAAA;AAAA,QAAuC,qBAAAC,IAAAJ,EAAA,kBAAA,MAAA,gBAAAI,EAAA;AAAA,MACqB;AAAA,KAAA,GAG5DC,IAAAF,EAAA,OAAA;AAAA,MAA2C,8BAAAG,EAAA;AAAA,IACH,EAAA,GAGxCC,IAAAJ,EAAA,OAII;AAAA,MAAO,6CAAA,EAHPG,EAAA,SAAAA,EAAA,eACAA,EAAA,cAAA;AAAA,IAGkD,EAClD,GAIJE,IAAA,CAAAF,EAAA,eAAAA,EAAA,aAAA;AACA,WAAAE,KACIC;AAAA,MAAA,GAAAH,EAAA,aAAA;AAAA,MAC0B;AAAA,MACtB;AAAA,IAGA;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as v, ref as i, computed as s } from "vue";
|
|
2
2
|
import { B as _ } from "./button.CdAFZa4V.js";
|
|
3
|
-
import { d as f } from "./popper-container.
|
|
3
|
+
import { d as f } from "./popper-container.CsW4R0-t.js";
|
|
4
4
|
import { u as y } from "./i18n.BQkEbtPM.js";
|
|
5
5
|
import { n as c } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
-
import { B as C } from "./tooltip.
|
|
6
|
+
import { B as C } from "./tooltip.Bu8o7uyZ.js";
|
|
7
7
|
import "../assets/copy.css";
|
|
8
8
|
var r = /* @__PURE__ */ ((o) => (o.DEFAULT = "default", o.COPYING = "copying", o.ERROR = "error", o))(r || {});
|
|
9
9
|
let a = 0;
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
A as C,
|
|
126
126
|
r as a
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=copy.
|
|
128
|
+
//# sourceMappingURL=copy.DMlIj53I.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.
|
|
1
|
+
{"version":3,"file":"copy.DMlIj53I.js","sources":["../../src/components/internal/copy/copy.types.ts","../../../../node_modules/.pnpm/@adyen+ui-assets-icons-16@4.1.0_vue@2.7.16/node_modules/@adyen/ui-assets-icons-16/dist/vue/copy.vue","../../src/components/internal/copy/copy.vue"],"sourcesContent":["import type { BentoButton } from '../../button';\n\nexport enum CopyTooltipState {\n DEFAULT = 'default',\n COPYING = 'copying',\n ERROR = 'error',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\nexport type BentoCopyButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M3.5 1.25C2.25736 1.25 1.25 2.25736 1.25 3.5V8.5C1.25 9.74264 2.25736 10.75 3.5 10.75H5.25V12.5C5.25 13.7426 6.25736 14.75 7.5 14.75H12.5C13.7426 14.75 14.75 13.7426 14.75 12.5V7.5C14.75 6.25736 13.7426 5.25 12.5 5.25H10.75V3.5C10.75 2.25736 9.74264 1.25 8.5 1.25H3.5ZM9.25 5.25H7.5C6.25736 5.25 5.25 6.25736 5.25 7.5V9.25H3.5C3.08579 9.25 2.75 8.91421 2.75 8.5V3.5C2.75 3.08579 3.08579 2.75 3.5 2.75H8.5C8.91421 2.75 9.25 3.08579 9.25 3.5V5.25ZM6.75 12.5V7.5C6.75 7.08579 7.08579 6.75 7.5 6.75H12.5C12.9142 6.75 13.25 7.08579 13.25 7.5V12.5C13.25 12.9142 12.9142 13.25 12.5 13.25H7.5C7.08579 13.25 6.75 12.9142 6.75 12.5Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <div class=\"b-copy\" @mouseleave=\"resetText\" @focusout=\"resetText\">\n <span v-if=\"$slots.default\" v-bento-tooltip-directive:[tooltipPosition]=\"copyText\" @click=\"onClickCopy\">\n <slot />\n </span>\n <bento-button\n v-else\n v-bento-tooltip-directive:[tooltipPosition]=\"copyText\"\n v-bind=\"button\"\n @click=\"onClickCopy\"\n >\n <template #iconLeft>\n <copy-icon :svg-title=\"svgTitle\" />\n </template>\n <template v-if=\"buttonText\" #default>\n {{ buttonText }}\n </template>\n </bento-button>\n <div v-if=\"showScreenReaderAlert\" role=\"alert\" class=\"b-copy__screen-reader-alert\">{{ t('copied') }}</div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoButton } from '@/components/button';\n import { PopperContainerPosition } from '@/components/popper-container';\n import { BentoTooltipDirective } from '@/directives';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoCopyButtonProps, CopyTooltipState } from './copy.types';\n import CopyIcon from '@adyen/ui-assets-icons-16/vue/copy';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * An internal button component that copies text to the user's clipboard.\n *\n * @example\n * import { Copy } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { Copy },\n * template: `\n * <copy :text=\"textToCopy\" />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'copy',\n components: { BentoButton, CopyIcon },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoCopyButtonProps>,\n default: () =>\n ({\n variant: 'tertiary',\n } as BentoCopyButtonProps),\n },\n\n /**\n * Sets the button text of the copy button.\n */\n buttonText: {\n type: String,\n default: undefined,\n },\n\n /**\n * Defines the string that will get copied to the clipboard\n */\n text: {\n type: String,\n required: true,\n },\n\n /**\n * Position the tooltip should take if space is available. Defaults to 'top'\n */\n tooltipPosition: {\n type: String as PropType<PopperContainerPosition>,\n default: PopperContainerPosition.TOP,\n },\n },\n setup(props) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const copyState = ref<CopyTooltipState>(CopyTooltipState.DEFAULT);\n\n const showScreenReaderAlert = ref(false);\n const onClickCopy = async () => {\n try {\n await navigator.clipboard.writeText(props.text);\n copyState.value = CopyTooltipState.COPYING;\n showScreenReaderAlert.value = true;\n } catch (e) {\n copyState.value = CopyTooltipState.ERROR;\n }\n };\n\n const resetText = () => {\n copyState.value = CopyTooltipState.DEFAULT;\n showScreenReaderAlert.value = false;\n };\n\n const copyText = computed(() => {\n switch (copyState.value) {\n case CopyTooltipState.COPYING:\n return t('copied');\n case CopyTooltipState.ERROR:\n return t('copyFailed');\n case CopyTooltipState.DEFAULT:\n default:\n return t('copy');\n }\n });\n\n const svgTitle = computed(() => (props?.buttonText ? undefined : t('copy')));\n\n return {\n copyText,\n onClickCopy,\n resetText,\n showScreenReaderAlert,\n svgTitle,\n\n // Translations\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./copy.scss\" />\n"],"names":["CopyTooltipState","CopyTooltipState2","uuid","_sfc_main$1","_sfc_main","defineComponent","messages","BentoButton","CopyIcon","BentoTooltipDirective","PopperContainerPosition","props","useI18n","copyState","ref","showScreenReaderAlert","onCl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AA;AAAA,IAAA,GAGAG,IAAAC,EAAA,MAAA;AACA,cAAAN,EAAA,OAAA;AAAA,QAAA,KAAAb,EAAA;AAEA,iBAAA,EAAA,QAAA;AAAA,QAAA,KAAAA,EAAA;AAEA,iBAAA,EAAA,YAAA;AAAA,QAAA,KAAAA,EAAA;AAAA,QACA;AAEA,iBAAA,EAAA,MAAA;AAAA,MAAA;AAAA,IACA,CAAA,GAGAoB,IAAAD,EAAA,MAAAR,KAAA,QAAAA,EAAA,aAAA,SAAA,EAAA,MAAA,CAAA;AAEA,WAAA;AAAA,MAAA,UAAAO;AAAA,MACA,aAAAF;AAAA,MACA,WAAAC;AAAA,MACA,uBAAAF;AAAA,MACA,UAAAK;AAAA;AAAA,MACA;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.B1F9YOIx.js","sources":["../../src/utils/ts/currency/countries-list.ts","../../src/utils/ts/currency/currency.ts","../../src/components/currency/currency.types.ts","../../src/components/currency/currency.vue"],"sourcesContent":["/**\n * Contains mapping configuration between currency code and exponent for amount in the corresponding currency.\n * Since the majority of the currencies have an exponent equal to 2, they are not listed here.\n * https://docs.adyen.com/development-resources/currency-codes\n * @type {Array}\n * @internal\n */\nexport const currencyExponentMap = [\n {\n exponent: 0,\n currencies: [\n 'CVE',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n ],\n },\n {\n exponent: 1,\n currencies: ['MRO'],\n },\n {\n exponent: 3,\n currencies: ['BHD', 'IQD', 'JOD', 'KWD', 'LYD', 'OMR', 'TND'],\n },\n];\n","import { CurrencyAmount, CurrencyOptions, NumberFormatOptionsResult } from './currency.types';\nimport { currencyExponentMap } from './countries-list';\n\n/**\n * Returns exponent for specified currency code.\n */\nexport const getExponent = (currencyCode: string): number =>\n currencyExponentMap.find(obj => obj.currencies.includes(currencyCode))?.exponent ?? 2;\n\n/**\n * Converts passed amount from regular to minor units, based on currency exponent\n */\nexport const getMinorUnitsAmount = (amount: CurrencyAmount): number => {\n const exponent = getExponent(amount.currency);\n const value = Number(amount.value);\n\n return Math.round(value * 10 ** exponent);\n};\n\n/**\n * Returns normalized amount value from minor units as decimal point number (when exponent is more than zero).\n */\nexport const getNormalizedAmount = (amount: CurrencyAmount, exponent: number) =>\n // Amount is in minor units and have to be converted to number with fraction digits\n // return (amount.value * 100) / 10 ** exp;\n amount.value / 10 ** exponent;\n\n/**\n * /**\n * Prepares amount to be rendered by Intl.NumberFormat function.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat\n *\n * It enables language-sensitive number formatting.\n * Adds currency symbol and ISO code based on provided options\n * The result of execution - is a configuration object that is used in 'getLocalizedCurrencyValue' function\n *\n * @param amount - the value and currency to format.\n * @param options - the formatting options that are passed to the Intl.NumberFormat function.\n * @param majorUnits - if set to true, then currency major units will be used instead of minor ones\n */\nexport function getNumberFormatOptions(\n amount: CurrencyAmount,\n options: CurrencyOptions = {},\n majorUnits = false\n): NumberFormatOptionsResult {\n // Exponent is based on currency, if not specified explicitly.\n const exp = options?.exponent ?? getExponent(amount.currency);\n // Minor Units have to be retrieved from component passed amount\n const minorAmount = majorUnits ? getMinorUnitsAmount(amount) : amount.value;\n const amountInMinorUnits: CurrencyAmount = { ...amount, value: minorAmount };\n // Amount is in minor units and have to be converted to number with fraction digits\n const value = getNormalizedAmount(amountInMinorUnits, exp);\n // This is the requirement for currency component - to remove currency symbol for negative values\n const style = value < 0 ? 'decimal' : options?.style || 'currency';\n // If optionalFractions is true, numbers will not contain fraction digits when they are zero (e.g. 100.00 will be 100)\n const minimumFractionDigits = options?.optionalFractions ? 0 : exp;\n // If highPrecision is true, numbers can contain 10 fraction digits (highest precision in Adyen is about 5)\n const maximumFractionDigits = options?.highPrecision ? 10 : exp;\n\n return {\n value,\n format: {\n style,\n currency: amount.currency,\n currencyDisplay: 'symbol',\n minimumFractionDigits,\n maximumFractionDigits,\n },\n };\n}\n\n/**\n * Get a formatted and localised currency string given an amount and currency type.\n *\n * @param amountValue - the amount of the currency.\n * @param currency - the ISO 4217 currency code.\n * @param majorUnits - if set to true, then currency major units will be used instead of minor ones\n */\nexport const getLocalizedCurrencyValue = (amountValue: string, currency: string, majorUnits?: boolean): string => {\n const amount: CurrencyAmount = { value: parseFloat(amountValue), currency };\n const numberFormatOptions = getNumberFormatOptions(amount, { style: 'decimal' }, majorUnits);\n // TODO replace hardcoded locale with dynamic one, when i18n strategy is defined\n const formatter = new Intl.NumberFormat('en-US', numberFormatOptions.format as Intl.NumberFormatOptions);\n\n return formatter.format(numberFormatOptions.value);\n};\n","export interface BentoCurrencyProps {\n /**\n * Currency code based on the ISO 4217 standard\n */\n currency?: BentoCurrencyISOCode | `${BentoCurrencyISOCode}`;\n\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Accepts currency value in major units instead of minor ones\n */\n majorUnits?: boolean;\n\n /**\n * Currency value to be formatted\n */\n value?: number;\n}\n\nexport enum BentoCurrencyISOCode {\n AFA = 'AFA',\n ALL = 'ALL',\n DZD = 'DZD',\n AOA = 'AOA',\n ARS = 'ARS',\n AMD = 'AMD',\n AWG = 'AWG',\n AUD = 'AUD',\n AZN = 'AZN',\n BSD = 'BSD',\n BHD = 'BHD',\n BDT = 'BDT',\n BBD = 'BBD',\n BYR = 'BYR',\n BEF = 'BEF',\n BZD = 'BZD',\n BMD = 'BMD',\n BTN = 'BTN',\n BTC = 'BTC',\n BOB = 'BOB',\n BAM = 'BAM',\n BWP = 'BWP',\n BRL = 'BRL',\n GBP = 'GBP',\n BND = 'BND',\n BGN = 'BGN',\n BIF = 'BIF',\n KHR = 'KHR',\n CAD = 'CAD',\n CVE = 'CVE',\n KYD = 'KYD',\n XOF = 'XOF',\n XAF = 'XAF',\n XPF = 'XPF',\n CLP = 'CLP',\n CLF = 'CLF',\n CNY = 'CNY',\n COP = 'COP',\n KMF = 'KMF',\n CDF = 'CDF',\n CRC = 'CRC',\n HRK = 'HRK',\n CUC = 'CUC',\n CZK = 'CZK',\n DKK = 'DKK',\n DJF = 'DJF',\n DOP = 'DOP',\n XCD = 'XCD',\n EGP = 'EGP',\n ERN = 'ERN',\n EEK = 'EEK',\n ETB = 'ETB',\n EUR = 'EUR',\n FKP = 'FKP',\n FJD = 'FJD',\n GMD = 'GMD',\n GEL = 'GEL',\n DEM = 'DEM',\n GHS = 'GHS',\n GIP = 'GIP',\n GRD = 'GRD',\n GTQ = 'GTQ',\n GNF = 'GNF',\n GYD = 'GYD',\n HTG = 'HTG',\n HNL = 'HNL',\n HKD = 'HKD',\n HUF = 'HUF',\n ISK = 'ISK',\n INR = 'INR',\n IDR = 'IDR',\n IRR = 'IRR',\n IQD = 'IQD',\n ILS = 'ILS',\n ITL = 'ITL',\n JMD = 'JMD',\n JPY = 'JPY',\n JOD = 'JOD',\n KZT = 'KZT',\n KES = 'KES',\n KWD = 'KWD',\n KGS = 'KGS',\n LAK = 'LAK',\n LVL = 'LVL',\n LBP = 'LBP',\n LSL = 'LSL',\n LRD = 'LRD',\n LYD = 'LYD',\n LTC = 'LTC',\n LTL = 'LTL',\n MOP = 'MOP',\n MKD = 'MKD',\n MGA = 'MGA',\n MWK = 'MWK',\n MYR = 'MYR',\n MVR = 'MVR',\n MRO = 'MRO',\n MUR = 'MUR',\n MXN = 'MXN',\n MDL = 'MDL',\n MNT = 'MNT',\n MAD = 'MAD',\n MZM = 'MZM',\n MMK = 'MMK',\n NAD = 'NAD',\n NPR = 'NPR',\n ANG = 'ANG',\n TWD = 'TWD',\n NZD = 'NZD',\n NIO = 'NIO',\n NGN = 'NGN',\n KPW = 'KPW',\n NOK = 'NOK',\n OMR = 'OMR',\n PKR = 'PKR',\n PAB = 'PAB',\n PGK = 'PGK',\n PYG = 'PYG',\n PEN = 'PEN',\n PHP = 'PHP',\n PLN = 'PLN',\n QAR = 'QAR',\n RON = 'RON',\n RUB = 'RUB',\n RWF = 'RWF',\n SVC = 'SVC',\n WST = 'WST',\n STD = 'STD',\n SAR = 'SAR',\n RSD = 'RSD',\n SCR = 'SCR',\n SLL = 'SLL',\n SGD = 'SGD',\n SKK = 'SKK',\n SBD = 'SBD',\n SOS = 'SOS',\n ZAR = 'ZAR',\n KRW = 'KRW',\n SSP = 'SSP',\n XDR = 'XDR',\n LKR = 'LKR',\n SHP = 'SHP',\n SDG = 'SDG',\n SRD = 'SRD',\n SZL = 'SZL',\n SEK = 'SEK',\n CHF = 'CHF',\n SYP = 'SYP',\n TJS = 'TJS',\n TZS = 'TZS',\n THB = 'THB',\n TOP = 'TOP',\n TTD = 'TTD',\n TND = 'TND',\n TRY = 'TRY',\n TMT = 'TMT',\n UGX = 'UGX',\n UAH = 'UAH',\n AED = 'AED',\n UYU = 'UYU',\n USD = 'USD',\n UZS = 'UZS',\n VUV = 'VUV',\n VEF = 'VEF',\n VND = 'VND',\n YER = 'YER',\n ZMK = 'ZMK',\n ZWL = 'ZWL',\n}\n","<template>\n <div class=\"b-currency\">\n <bento-typography v-if=\"!disableTypography\" class=\"b-currency__amount\" el=\"span\" variant=\"body\" strong>\n {{ formattedCurrency }} {{ currency }}\n </bento-typography>\n <template v-else>{{ formattedCurrency }} {{ currency }}</template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { getLocalizedCurrencyValue } from '@/utils/ts/currency/currency';\n import { BentoTypography } from '@/components/typography';\n import { BentoCurrencyISOCode, BentoCurrencyProps } from './currency.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const slots = useSlots();\n\n const props = defineProps({\n currency: { default: BentoCurrencyISOCode.EUR },\n disableTypography: { type: Boolean, default: false },\n majorUnits: { type: Boolean, default: false },\n value: { default: undefined }\n});\n\n const formattedCurrency = computed<string>(() => {\n const value = props.value || getSlotText(slots)('default');\n return getLocalizedCurrencyValue(value as string, props.currency, props.majorUnits);\n });\n\n onMounted(() => {\n if (getSlotText(slots)('default')) {\n deprecate(\n 'BentoCurrency \"default\" slot',\n `The use of \"default\" slot in \"BentoCurrency\" is no longer supported as it causes issues with dynamic content.\n Use the \"value\" property instead.\n <bento-currency :value=\"12345.67\" currency=\"USD\" major-units=\"false\" />`,\n '2.0.0'\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency component is used to display a formatted currency value.\n *\n * @example\n * import { BentoCurrency, BentoCurrencyISOCode } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCurrency },\n * template: `\n * <bento-currency\n * :currency=\"BentoCurrencyISOCode.USD\"\n * :value=\"76.33\"\n * />\n * `\n * }\n */\n export default {\n name: 'bento-currency',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./currency.scss\" />\n"],"names":["currencyExponentMap","getExponent","currencyCode","_a","obj","getMinorUnitsAmount","amount","exponent","value","getNormalizedAmount","getNumberFormatOptions","options","majorUnits","exp","minorAmount","amountInMinorUnits","style","minimumFractionDigits","maximumFractionDigits","getLocalizedCurrencyValue","amountValue","currency","numberFormatOptions","BentoCurrencyISOCode","BentoCurrencyISOCode2","__default__","slots","useSlots","formattedCurrency","computed","props","getSlotText","onMounted","deprecate"],"mappings":";;;;;AAOO,MAAAA,IAAA;AAAA,EAA4B;AAAA,IAC/B,UAAA;AAAA,IACc,YAAA;AAAA,MACE;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACJ;AAAA,EACJ;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,KAAA;AAAA,EACQ;AAAA,EACtB;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A,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OACAA,EAAA,MAAA,OAxKQA,IAAAD,KAAA,CAAA,CAAA;ACuCR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;iBA9CAC,IAAAC,EAAA,GASAC,IAAAC,EAAA,MAAA;AACI,YAAArB,IAAAsB,EAAA,SAAAC,EAAAL,CAAA,EAAA,SAAA;AACA,aAAAP,EAAAX,GAAAsB,EAAA,UAAAA,EAAA,UAAA;AAAA,IAAkF,CAAA;AAGtF,WAAAE,EAAA,MAAA;AACI,MAAAD,EAAAL,CAAA,EAAA,SAAA,KACIO;AAAA,QAAA;AAAA,QACI;AAAA;AAAA;AAAA,QACA;AAAA,MAGA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"currency.B1F9YOIx.js","sources":["../../src/utils/ts/currency/countries-list.ts","../../src/utils/ts/currency/currency.ts","../../../core/src/components/currency/currency.types.ts","../../src/components/currency/currency.vue"],"sourcesContent":["/**\n * Contains mapping configuration between currency code and exponent for amount in the corresponding currency.\n * Since the majority of the currencies have an exponent equal to 2, they are not listed here.\n * https://docs.adyen.com/development-resources/currency-codes\n * @type {Array}\n * @internal\n */\nexport const currencyExponentMap = [\n {\n exponent: 0,\n currencies: [\n 'CVE',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n ],\n },\n {\n exponent: 1,\n currencies: ['MRO'],\n },\n {\n exponent: 3,\n currencies: ['BHD', 'IQD', 'JOD', 'KWD', 'LYD', 'OMR', 'TND'],\n },\n];\n","import { CurrencyAmount, CurrencyOptions, NumberFormatOptionsResult } from './currency.types';\nimport { currencyExponentMap } from './countries-list';\n\n/**\n * Returns exponent for specified currency code.\n */\nexport const getExponent = (currencyCode: string): number =>\n currencyExponentMap.find(obj => obj.currencies.includes(currencyCode))?.exponent ?? 2;\n\n/**\n * Converts passed amount from regular to minor units, based on currency exponent\n */\nexport const getMinorUnitsAmount = (amount: CurrencyAmount): number => {\n const exponent = getExponent(amount.currency);\n const value = Number(amount.value);\n\n return Math.round(value * 10 ** exponent);\n};\n\n/**\n * Returns normalized amount value from minor units as decimal point number (when exponent is more than zero).\n */\nexport const getNormalizedAmount = (amount: CurrencyAmount, exponent: number) =>\n // Amount is in minor units and have to be converted to number with fraction digits\n // return (amount.value * 100) / 10 ** exp;\n amount.value / 10 ** exponent;\n\n/**\n * /**\n * Prepares amount to be rendered by Intl.NumberFormat function.\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat\n *\n * It enables language-sensitive number formatting.\n * Adds currency symbol and ISO code based on provided options\n * The result of execution - is a configuration object that is used in 'getLocalizedCurrencyValue' function\n *\n * @param amount - the value and currency to format.\n * @param options - the formatting options that are passed to the Intl.NumberFormat function.\n * @param majorUnits - if set to true, then currency major units will be used instead of minor ones\n */\nexport function getNumberFormatOptions(\n amount: CurrencyAmount,\n options: CurrencyOptions = {},\n majorUnits = false\n): NumberFormatOptionsResult {\n // Exponent is based on currency, if not specified explicitly.\n const exp = options?.exponent ?? getExponent(amount.currency);\n // Minor Units have to be retrieved from component passed amount\n const minorAmount = majorUnits ? getMinorUnitsAmount(amount) : amount.value;\n const amountInMinorUnits: CurrencyAmount = { ...amount, value: minorAmount };\n // Amount is in minor units and have to be converted to number with fraction digits\n const value = getNormalizedAmount(amountInMinorUnits, exp);\n // This is the requirement for currency component - to remove currency symbol for negative values\n const style = value < 0 ? 'decimal' : options?.style || 'currency';\n // If optionalFractions is true, numbers will not contain fraction digits when they are zero (e.g. 100.00 will be 100)\n const minimumFractionDigits = options?.optionalFractions ? 0 : exp;\n // If highPrecision is true, numbers can contain 10 fraction digits (highest precision in Adyen is about 5)\n const maximumFractionDigits = options?.highPrecision ? 10 : exp;\n\n return {\n value,\n format: {\n style,\n currency: amount.currency,\n currencyDisplay: 'symbol',\n minimumFractionDigits,\n maximumFractionDigits,\n },\n };\n}\n\n/**\n * Get a formatted and localised currency string given an amount and currency type.\n *\n * @param amountValue - the amount of the currency.\n * @param currency - the ISO 4217 currency code.\n * @param majorUnits - if set to true, then currency major units will be used instead of minor ones\n */\nexport const getLocalizedCurrencyValue = (amountValue: string, currency: string, majorUnits?: boolean): string => {\n const amount: CurrencyAmount = { value: parseFloat(amountValue), currency };\n const numberFormatOptions = getNumberFormatOptions(amount, { style: 'decimal' }, majorUnits);\n // TODO replace hardcoded locale with dynamic one, when i18n strategy is defined\n const formatter = new Intl.NumberFormat('en-US', numberFormatOptions.format as Intl.NumberFormatOptions);\n\n return formatter.format(numberFormatOptions.value);\n};\n","export interface BentoCurrencyProps {\n /**\n * Currency code based on the ISO 4217 standard\n */\n currency?: BentoCurrencyISOCode | `${BentoCurrencyISOCode}`;\n\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Accepts currency value in major units instead of minor ones\n */\n majorUnits?: boolean;\n\n /**\n * Currency value to be formatted\n */\n value?: number;\n}\n\nexport enum BentoCurrencyISOCode {\n AFA = 'AFA',\n ALL = 'ALL',\n DZD = 'DZD',\n AOA = 'AOA',\n ARS = 'ARS',\n AMD = 'AMD',\n AWG = 'AWG',\n AUD = 'AUD',\n AZN = 'AZN',\n BSD = 'BSD',\n BHD = 'BHD',\n BDT = 'BDT',\n BBD = 'BBD',\n BYR = 'BYR',\n BEF = 'BEF',\n BZD = 'BZD',\n BMD = 'BMD',\n BTN = 'BTN',\n BTC = 'BTC',\n BOB = 'BOB',\n BAM = 'BAM',\n BWP = 'BWP',\n BRL = 'BRL',\n GBP = 'GBP',\n BND = 'BND',\n BGN = 'BGN',\n BIF = 'BIF',\n KHR = 'KHR',\n CAD = 'CAD',\n CVE = 'CVE',\n KYD = 'KYD',\n XOF = 'XOF',\n XAF = 'XAF',\n XPF = 'XPF',\n CLP = 'CLP',\n CLF = 'CLF',\n CNY = 'CNY',\n COP = 'COP',\n KMF = 'KMF',\n CDF = 'CDF',\n CRC = 'CRC',\n HRK = 'HRK',\n CUC = 'CUC',\n CZK = 'CZK',\n DKK = 'DKK',\n DJF = 'DJF',\n DOP = 'DOP',\n XCD = 'XCD',\n EGP = 'EGP',\n ERN = 'ERN',\n EEK = 'EEK',\n ETB = 'ETB',\n EUR = 'EUR',\n FKP = 'FKP',\n FJD = 'FJD',\n GMD = 'GMD',\n GEL = 'GEL',\n DEM = 'DEM',\n GHS = 'GHS',\n GIP = 'GIP',\n GRD = 'GRD',\n GTQ = 'GTQ',\n GNF = 'GNF',\n GYD = 'GYD',\n HTG = 'HTG',\n HNL = 'HNL',\n HKD = 'HKD',\n HUF = 'HUF',\n ISK = 'ISK',\n INR = 'INR',\n IDR = 'IDR',\n IRR = 'IRR',\n IQD = 'IQD',\n ILS = 'ILS',\n ITL = 'ITL',\n JMD = 'JMD',\n JPY = 'JPY',\n JOD = 'JOD',\n KZT = 'KZT',\n KES = 'KES',\n KWD = 'KWD',\n KGS = 'KGS',\n LAK = 'LAK',\n LVL = 'LVL',\n LBP = 'LBP',\n LSL = 'LSL',\n LRD = 'LRD',\n LYD = 'LYD',\n LTC = 'LTC',\n LTL = 'LTL',\n MOP = 'MOP',\n MKD = 'MKD',\n MGA = 'MGA',\n MWK = 'MWK',\n MYR = 'MYR',\n MVR = 'MVR',\n MRO = 'MRO',\n MUR = 'MUR',\n MXN = 'MXN',\n MDL = 'MDL',\n MNT = 'MNT',\n MAD = 'MAD',\n MZM = 'MZM',\n MMK = 'MMK',\n NAD = 'NAD',\n NPR = 'NPR',\n ANG = 'ANG',\n TWD = 'TWD',\n NZD = 'NZD',\n NIO = 'NIO',\n NGN = 'NGN',\n KPW = 'KPW',\n NOK = 'NOK',\n OMR = 'OMR',\n PKR = 'PKR',\n PAB = 'PAB',\n PGK = 'PGK',\n PYG = 'PYG',\n PEN = 'PEN',\n PHP = 'PHP',\n PLN = 'PLN',\n QAR = 'QAR',\n RON = 'RON',\n RUB = 'RUB',\n RWF = 'RWF',\n SVC = 'SVC',\n WST = 'WST',\n STD = 'STD',\n SAR = 'SAR',\n RSD = 'RSD',\n SCR = 'SCR',\n SLL = 'SLL',\n SGD = 'SGD',\n SKK = 'SKK',\n SBD = 'SBD',\n SOS = 'SOS',\n ZAR = 'ZAR',\n KRW = 'KRW',\n SSP = 'SSP',\n XDR = 'XDR',\n LKR = 'LKR',\n SHP = 'SHP',\n SDG = 'SDG',\n SRD = 'SRD',\n SZL = 'SZL',\n SEK = 'SEK',\n CHF = 'CHF',\n SYP = 'SYP',\n TJS = 'TJS',\n TZS = 'TZS',\n THB = 'THB',\n TOP = 'TOP',\n TTD = 'TTD',\n TND = 'TND',\n TRY = 'TRY',\n TMT = 'TMT',\n UGX = 'UGX',\n UAH = 'UAH',\n AED = 'AED',\n UYU = 'UYU',\n USD = 'USD',\n UZS = 'UZS',\n VUV = 'VUV',\n VEF = 'VEF',\n VND = 'VND',\n YER = 'YER',\n ZMK = 'ZMK',\n ZWL = 'ZWL',\n}\n","<template>\n <div class=\"b-currency\">\n <bento-typography v-if=\"!disableTypography\" class=\"b-currency__amount\" el=\"span\" variant=\"body\" strong>\n {{ formattedCurrency }} {{ currency }}\n </bento-typography>\n <template v-else>{{ formattedCurrency }} {{ currency }}</template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { getLocalizedCurrencyValue } from '@/utils/ts/currency/currency';\n import { BentoTypography } from '@/components/typography';\n import { BentoCurrencyISOCode, BentoCurrencyProps } from './currency.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { deprecate } from '@/utils/ts/deprecate';\n\n const slots = useSlots();\n\n const props = defineProps({\n currency: { default: BentoCurrencyISOCode.EUR },\n disableTypography: { type: Boolean, default: false },\n majorUnits: { type: Boolean, default: false },\n value: { default: undefined }\n});\n\n const formattedCurrency = computed<string>(() => {\n const value = props.value || getSlotText(slots)('default');\n return getLocalizedCurrencyValue(value as string, props.currency, props.majorUnits);\n });\n\n onMounted(() => {\n if (getSlotText(slots)('default')) {\n deprecate(\n 'BentoCurrency \"default\" slot',\n `The use of \"default\" slot in \"BentoCurrency\" is no longer supported as it causes issues with dynamic content.\n Use the \"value\" property instead.\n <bento-currency :value=\"12345.67\" currency=\"USD\" major-units=\"false\" />`,\n '2.0.0'\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency component is used to display a formatted currency value.\n *\n * @example\n * import { BentoCurrency, BentoCurrencyISOCode } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCurrency },\n * template: `\n * <bento-currency\n * :currency=\"BentoCurrencyISOCode.USD\"\n * :value=\"76.33\"\n * />\n * `\n * }\n */\n export default {\n name: 'bento-currency',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./currency.scss\" />\n"],"names":["currencyExponentMap","getExponent","currencyCode","_a","obj","getMinorUnitsAmount","amount","exponent","value","getNormalizedAmount","getNumberFormatOptions","options","majorUnits","exp","minorAmount","amountInMinorUnits","style","minimumFractionDigits","maximumFractionDigits","getLocalizedCurrencyValue","amountValue","currency","numberFormatOptions","BentoCurrencyISOCode","BentoCurrencyISOCode2","__default__","slots","useSlots","formattedCurrency","computed","props","getSlotText","onMounted","deprecate"],"mappings":";;;;;AAOO,MAAAA,IAAA;AAAA,EAA4B;AAAA,IAC/B,UAAA;AAAA,IACc,YAAA;AAAA,MACE;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACA;AAAA,EACJ;AAAA,EACJ;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,KAAA;AAAA,EACQ;AAAA,EACtB;AAAA,IACA,UAAA;AAAA,IACc,YAAA,CAAA,OAAA,OAAA,OAAA,OAAA,OAAA,OAAA,KAAA;AAAA,EACkD;AAEpE,GC9BOC,IAAA,CAAAC,MAAA;;AAAA,WAAAC,IAAAH,EAAA,KAAA,CAAAI,MAAAA,EAAA,WAAA,SAAAF,CAAA,CAAA,MAAA,gBAAAC,EAAA,aAAA;AAAA,GAMME,IAAA,CAAAC,MAAA;AACT,QAAAC,IAAAN,EAAAK,EAAA,QAAA,GACAE,IAAA,OAAAF,EAAA,KAAA;AAEA,SAAA,KAAA,MAAAE,IAAA,MAAAD,CAAA;AACJ,GAKaE,IAAA,CAAAH,GAAAC;AAAA;AAAA;AAAA,EAA+CD,EAAA,QAAA,MAAAC;AAAA;AAkBrD,SAAAG,EAAAJ,GAAAK,IAAA,CAAA,GAAAC,IAAA,IAAA;AAMH,QAAAC,KAAAF,KAAA,gBAAAA,EAAA,aAAAV,EAAAK,EAAA,QAAA,GAEAQ,IAAAF,IAAAP,EAAAC,CAAA,IAAAA,EAAA,OACAS,IAAA,EAAA,GAAAT,GA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AA,OAxKQA,IAAAD,KAAA,CAAA,CAAA;ACuCR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;iBA9CAC,IAAAC,EAAA,GASAC,IAAAC,EAAA,MAAA;AACI,YAAArB,IAAAsB,EAAA,SAAAC,EAAAL,CAAA,EAAA,SAAA;AACA,aAAAP,EAAAX,GAAAsB,EAAA,UAAAA,EAAA,UAAA;AAAA,IAAkF,CAAA;AAGtF,WAAAE,EAAA,MAAA;AACI,MAAAD,EAAAL,CAAA,EAAA,SAAA,KACIO;AAAA,QAAA;AAAA,QACI;AAAA;AAAA;AAAA,QACA;AAAA,MAGA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as C, useSlots as T, ref as d, computed as l, watch as m, onUnmounted as R, onMounted as x } from "vue";
|
|
2
|
-
import { B as y } from "./header.
|
|
2
|
+
import { B as y } from "./header.BeS6ktqU.js";
|
|
3
3
|
import { a as I, B as H } from "./tabs.5zgaD1k3.js";
|
|
4
|
-
import {
|
|
4
|
+
import { c as P } from "./index.CU8GKq4C.js";
|
|
5
5
|
import { o as W } from "./resize.Bqks3WUm.js";
|
|
6
6
|
import { u as S } from "./use-has-slot.C9lQZ6nz.js";
|
|
7
7
|
import { n as k } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
@@ -102,4 +102,4 @@ export {
|
|
|
102
102
|
st as a,
|
|
103
103
|
tt as d
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=dashboard-section.
|
|
105
|
+
//# sourceMappingURL=dashboard-section.DzMn8yDZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-section.q1XXEUZc.js","sources":["../../src/templates/dashboard-template/dashboard-template.vue","../../src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n class=\"b-dashboard-template__tabs\"\n :class=\"dashboardTabsConditionalClasses\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = defineProps({\n header: null,\n tabs: { default: undefined },\n stickyTabs: { type: Boolean, default: false },\n stickyFilters: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const isTabsPinned = ref(false);\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTabsConditionalClasses = computed(() => ({\n 'b-dashboard-template__tabs--sticky': props.stickyTabs,\n 'b-dashboard-template__tabs--show-border': props.stickyTabs && isTabsPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n (tabsRef.value.tablistwrapper.$el as HTMLDivElement).style.top = `${tabsPosition.value}px`;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n if (hasStickyTabs.value) {\n isTabsPinned.value =\n (tabsRef.value.tablistwrapper.$el as HTMLDivElement)?.getBoundingClientRect().top ===\n tabsPosition.value;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = defineProps({\n header: null,\n halfWidth: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","isTabsPinned","tabsPosition","hasStickyFilters","computed","props","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTabsConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","onMounted"],"mappings":";;;;;;;;;AAuJI,MAAAA,IAAA,CAAA;;;;;;;;;;iBAhGAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,EAAA;AACA,QAAAG,IAAA;AACA,UAAAC,IAAAJ,EAAA,EAAA,GACAK,IAAAL,EAAA,CAAA,GAEAM,IAAAC,EAAA,MAAAN,EAAA,SAAAO,EAAA,aAAA,GACAC,IAAAF,EAAA,MAAAR,EAAA,SAAAS,EAAA,UAAA,GAEAE,IAAAH,EAAA,OAAA;AAAA,MAA2D,yCAAAC,EAAA;AAAA,M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A;AACI,MAAArB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;sBC7CvCsB,IAAA,CAAA;;;;;;;;iBAzCA9B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA+B,IAAAnB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAmB,EAAA,MAAA;AACI,WAAA9B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAW,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dashboard-section.DzMn8yDZ.js","sources":["../../src/templates/dashboard-template/dashboard-template.vue","../../src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n class=\"b-dashboard-template__tabs\"\n :class=\"dashboardTabsConditionalClasses\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = defineProps({\n header: null,\n tabs: { default: undefined },\n stickyTabs: { type: Boolean, default: false },\n stickyFilters: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const isTabsPinned = ref(false);\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTabsConditionalClasses = computed(() => ({\n 'b-dashboard-template__tabs--sticky': props.stickyTabs,\n 'b-dashboard-template__tabs--show-border': props.stickyTabs && isTabsPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n (tabsRef.value.tablistwrapper.$el as HTMLDivElement).style.top = `${tabsPosition.value}px`;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n if (hasStickyTabs.value) {\n isTabsPinned.value =\n (tabsRef.value.tablistwrapper.$el as HTMLDivElement)?.getBoundingClientRect().top ===\n tabsPosition.value;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = defineProps({\n header: null,\n halfWidth: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","isTabsPinned","tabsPosition","hasStickyFilters","computed","props","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTabsConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","onMounted"],"mappings":";;;;;;;;;AAuJI,MAAAA,IAAA,CAAA;;;;;;;;;;iBAhGAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,EAAA;AACA,QAAAG,IAAA;AACA,UAAAC,IAAAJ,EAAA,EAAA,GACAK,IAAAL,EAAA,CAAA,GAEAM,IAAAC,EAAA,MAAAN,EAAA,SAAAO,EAAA,aAAA,GACAC,IAAAF,EAAA,MAAAR,EAAA,SAAAS,EAAA,UAAA,GAEAE,IAAAH,EAAA,OAAA;AAAA,MAA2D,yCAAAC,EAAA;AAAA,MACR,8CAAAF,EAAA,SAAA,CAAAG,EAAA,SAAAP,EAAA;AAAA,IAEuB,EAAA,GAG1ES,IAAAJ,EAAA,OAAA;AAAA,MAAwD,sCAAAC,EAAA;AAAA,MACR,2CAAAA,EAAA,cAAAJ,EAAA;AAAA,IACgC,EAAA,GAGhFQ,IAAAL,EAAA,OAAA;AAAA,MAA8D,6CAAAC,EAAA,cAAAA,EAAA;AAAA,IACa,EAAA,GAG3EK,IAAAN,EAAA,MAAA,OAAA,KAAAZ,CAAA,EAAA,OAAA,CAAAmB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;;AAAA,eAAAC,KAAAC,IAAAV,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAU,EAAAF,OAAA,gBAAAC,EAAA,UAAA,OAAAD,IAAA,CAAA;AAAA,OAEA,EAAA,GAAAG,EAAA,IAAAC,EAAA;AAEA,WAAAC;AAAA,MAAA,MAAApB,EAAA;AAAA,MACqB,MAAA;AAEb,QAAA,CAAAE,KAAAF,EAAA,UACIE,IAAAmB,EAAArB,EAAA,OAAA,MAAA;AACI,cAAAA,EAAA,SAAAQ,EAAA,OAAA;AACI,kBAAAc,IAAAtB,EAAA,MAAA;AACA,YAAAI,EAAA,QAAAC,EAAA,QAAAiB,IAAA,GACAxB,EAAA,MAAA,eAAA,IAAA,MAAA,MAAA,GAAAM,EAAA,KAAA;AAAA,UAAsF;AAAA,QAC1F,CAAA;AAAA,MAER;AAAA,IACJ,GAGJgB;AAAA,MAAA,MAAAF,EAAA;AAAA,MACY,MAAA;;AAEJ,QAAAb,EAAA,UACIJ,EAAA,UAAAgB,IAAAjB,EAAA,UAAA,gBAAAiB,EAAA,wBAAA,SAAA,IAEJT,EAAA,UACIL,EAAA,UAAAa,IAAAlB,EAAA,MAAA,eAAA,QAAA,gBAAAkB,EAAA,wBAAA,SAAAZ,EAAA;AAAA,MAGJ;AAAA,IACJ,GAGJmB,EAAA,MAAA;AACI,MAAArB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;sBC7CvCsB,IAAA,CAAA;;;;;;;;iBAzCA9B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA+B,IAAAnB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAmB,EAAA,MAAA;AACI,WAAA9B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAW,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as h, useSlots as P, ref as p, computed as d, watch as T } from "vue";
|
|
2
|
-
import { B as O } from "./popover.
|
|
2
|
+
import { B as O } from "./popover.BQGNMbQN.js";
|
|
3
3
|
import { B as x } from "./typography.J1v_SPG3.js";
|
|
4
4
|
import { u as B } from "./use-has-slot.C9lQZ6nz.js";
|
|
5
|
-
import { B as g } from "./tooltip.
|
|
5
|
+
import { B as g } from "./tooltip.Bu8o7uyZ.js";
|
|
6
6
|
import { n as I } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
7
7
|
import "../assets/dashed-underline.css";
|
|
8
8
|
const b = {}, S = /* @__PURE__ */ h({
|
|
@@ -56,4 +56,4 @@ const U = C.exports;
|
|
|
56
56
|
export {
|
|
57
57
|
U as d
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=dashed-underline.
|
|
59
|
+
//# sourceMappingURL=dashed-underline.COTMts4l.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashed-underline.
|
|
1
|
+
{"version":3,"file":"dashed-underline.COTMts4l.js","sources":["../../src/components/dashed-underline/dashed-underline.vue"],"sourcesContent":["<template>\n <span\n ref=\"element\"\n v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\"\n class=\"b-dashed-underline\"\n tabindex=\"0\"\n @mouseenter=\"openPopover\"\n @mouseleave=\"closePopover\"\n @focus=\"infoIconOnFocus\"\n @focusout=\"infoIconOnFocusOut\"\n >\n <slot></slot>\n <bento-popover\n v-if=\"element && hasPopover\"\n :open=\"isOpen\"\n :target-element=\"element\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n fit-content\n disable-focus-trap\n >\n <slot name=\"popover-content\">\n <bento-typography>\n {{ popoverText }}\n </bento-typography>\n </slot>\n </bento-popover>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\n import { computed, ref, useSlots, watch } from 'vue';\n import { BentoPopover, type BentoPopoverPositions } from '@/components/popover';\n import {\n type BentoTooltipPosition,\n BentoTooltipDirective as vBentoTooltipDirective,\n } from '@/directives/tooltip/index';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n\n const CLOSING_POPOVER_DELAY_MS = 200;\n\n const props = defineProps({\n popoverText: { default: null },\n popoverPosition: { default: 'top' },\n tooltipText: { default: null },\n tooltipPosition: { default: 'top' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const element = ref<HTMLSpanElement>(null);\n const isOpen = ref(false);\n\n const closingTimeOutId = ref();\n\n const openPopover = () => {\n isOpen.value = true;\n if (closingTimeOutId.value) {\n clearTimeout(closingTimeOutId.value);\n }\n };\n\n const closePopover = () => {\n // We want to delay closing for a couple of seconds so\n // it doesn't flicker if a user hovers over the icon and then inside the popover.\n const timeOutId = setTimeout(() => {\n isOpen.value = false;\n }, CLOSING_POPOVER_DELAY_MS);\n closingTimeOutId.value = timeOutId;\n };\n\n const infoIconOnFocus = () => {\n openPopover();\n };\n\n /**\n * Only close popover on blur if the newly focus element is not a child of this element\n * @param e - the event that contains the newly focused element\n */\n const infoIconOnFocusOut = (e: FocusEvent) => {\n if (!element.value || !(e?.relatedTarget instanceof Element) || !element.value.contains(e.relatedTarget)) {\n closePopover();\n }\n };\n\n const hasPopover = computed(() => props.popoverText || hasSlot('popover-content'));\n\n const shouldShowTooltipPopoverError = computed(() => !props.tooltipText && !hasPopover.value);\n\n watch(\n shouldShowTooltipPopoverError,\n value => {\n if (value) {\n throw new Error(\n 'BentoDashedUnderline requires either a tooltip or a popover to be configured. Check the docs for more info.'\n );\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * The dashed underline serves as a visual cue to indicate that additional information is available for\n * a specific word or phrase without adding an icon.\n *\n * @example\n * import { BentoDashedUnderline } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashedUnderline },\n * template: `\n * <bento-dashed-underline>\n * annotated text\n * </bento-dashed-underline>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashed-underline.scss\" />\n"],"names":["__default__","CLOSING_POPOVER_DELAY_MS","slots","useSlots","hasSlot","useHasSlot","element","ref","isOpen","closingTimeOutId","openPopover","closePopover","timeOutId","infoIconOnFocus","infoIconOnFocusOut","e","hasPopover","computed","props","shouldShowTooltipPopoverError","watch","value"],"mappings":";;;;;;;AAyHI,MAAAA,IAAA,CAAA;;;;;;;;;;iBAjFAC,IAAA,KASAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GAEAE,IAAAF,EAAA,GAEAG,IAAA,MAAA;AACI,MAAAF,EAAA,QAAA,IACAC,EAAA,SACI,aAAAA,EAAA,KAAA;AAAA,IACJ,GAGJE,IAAA,MAAA;AAGI,YAAAC,IAAA,WAAA,MAAA;AACI,QAAAJ,EAAA,QAAA;AAAA,MAAe,GAAAP,CAAA;AAEnB,MAAAQ,EAAA,QAAAG;AAAA,IAAyB,GAG7BC,IAAA,MAAA;AACI,MAAAH,EAAA;AAAA,IAAY,GAOhBI,IAAA,CAAAC,MAAA;AACI,OAAA,CAAAT,EAAA,SAAA,GAAAS,KAAA,gBAAAA,EAAA,0BAAA,YAAA,CAAAT,EAAA,MAAA,SAAAS,EAAA,aAAA,MACIJ,EAAA;AAAA,IACJ,GAGJK,IAAAC,EAAA,MAAAC,EAAA,eAAAd,EAAA,iBAAA,CAAA,GAEAe,IAAAF,EAAA,MAAA,CAAAC,EAAA,eAAA,CAAAF,EAAA,KAAA;AAEA,WAAAI;AAAA,MAAAD;AAAA,MACI,CAAAE,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as m, useSlots as u, ref as T, computed as b, provide as v, toRef as y } from "vue";
|
|
2
|
-
import { B as C } from "./header.
|
|
2
|
+
import { B as C } from "./header.BeS6ktqU.js";
|
|
3
3
|
import { a as g, B as R } from "./tabs.5zgaD1k3.js";
|
|
4
4
|
import { u as I } from "./use-has-slot.C9lQZ6nz.js";
|
|
5
5
|
import { D as S } from "./data-grid-template.keys.2_AkxuNT.js";
|
|
@@ -66,4 +66,4 @@ const N = G.exports;
|
|
|
66
66
|
export {
|
|
67
67
|
N as d
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=data-grid-template.
|
|
69
|
+
//# sourceMappingURL=data-grid-template.BPBneEHq.js.map
|
package/dist/chunks/{data-grid-template.kCxfVaW7.js.map → data-grid-template.BPBneEHq.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-template.
|
|
1
|
+
{"version":3,"file":"data-grid-template.BPBneEHq.js","sources":["../../src/templates/data-grid-template/data-grid-template.vue"],"sourcesContent":["<template>\n <main class=\"b-data-grid-template b-data-grid-template--sticky-tabs\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-data-grid-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('additionalContent')\" class=\"b-data-grid-template__additional-content\">\n <slot name=\"additionalContent\" />\n </div>\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n class=\"b-data-grid-template__tabs\"\n @update:active-tab-index=\"emitTabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <slot :name=\"`tab-${index + 1}`\" />\n </bento-tab>\n </bento-tabs>\n <slot v-else />\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, Ref, ref, toRef, UnwrapRef, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useHasSlot } from '@/composables';\n import { DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY } from './data-grid-template.keys';\n import type {\n BentoDataGridTemplateDataGrid,\n BentoDataGridTemplateHeader,\n BentoDataGridTemplateTabs,\n } from './data-grid-template.types';\n\n const props = defineProps({\n /**\n * The header that goes to the top of the template\n */\n header: {\n type: Object as PropType<BentoDataGridTemplateHeader>,\n required: true,\n },\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currently active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs: {\n type: Object as PropType<BentoDataGridTemplateTabs>,\n default: undefined,\n },\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs: {\n type: Boolean,\n default: false,\n },\n });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"update:tabs\"]);\n\n const tabsRef = ref(null);\n\n const computedTabsRef = computed(() => tabsRef.value?.$refs?.tablist);\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const emitTabs = (newActiveTabIndex: number) => {\n emit('update:tabs', { ...props.tabs, activeTabIndex: newActiveTabIndex });\n };\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const registerDatagridInDataGridTemplate: BentoDataGridTemplateDataGrid = () => {\n const isDataGridTemplate = true;\n const stickyTabs: Ref<boolean> = toRef(props, 'stickyTabs');\n const tabsRef: Ref<UnwrapRef<HTMLDivElement>> | null = computedTabsRef;\n\n // return values to the Tab component\n return { isDataGridTemplate, stickyTabs, tabsRef };\n };\n\n provide(DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY, registerDatagridInDataGridTemplate);\n</script>\n\n<script lang=\"ts\">\n /**\n * The data grid template is a restrictive, full-page data grid used to display information from a data set.\n * You can use this data grid template when your user needs a clear overview of data or a way of organizing and analyzing the data in their own way.\n * This data grid template shouldn’t be confused with the data grid.\n *\n * @example\n * import { BentoDataGridTemplate } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDataGridTemplate },\n * template: `\n * // If you want to display multiple data grids in the same page (they will be rendered in different tabs)\n * <bento-data-grid-template>\n * <template #tab-1><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 1\"/></template>\n * <template #tab-2><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 2\"/></template>\n * </bento-data-grid-template>\n * // Alternatively, if you only want to pass one data grid to your template:\n * <bento-data-grid-template>\n * <template #default><bento-data-grid v-bind=\"your-data-grid-args\"/></template>\n * </bento-data-grid-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./data-grid-template.scss\" />\n"],"names":["__default__","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","computedTabsRef","computed","_b","_a","tabsSlots","el","emitTabs","newActiveTabIndex","emit","props","getTabTitle","index","registerDatagridInDataGridTemplate","toRef","provide","DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY"],"mappings":";;;;;;;AAqHI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArDAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAIAI,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,MAAA;;AAAA,cAAAC,KAAAC,IAAAL,EAAA,UAAA,gBAAAK,EAAA,UAAA,gBAAAD,EAAA;AAAA,KAAA,GAEAE,IAAAH,EAAA,MAAA,OAAA,KAAAP,CAAA,EAAA,OAAA,CAAAW,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;AACI,MAAAC,EAAA,eAAA,EAAA,GAAAC,EAAA,MAAA,gBAAAF,EAAA,CAAA;AAAA,IAAwE,GAG5EG,IAAA,CAAAC,MAAA;;AAAA,eAAAT,KAAAC,IAAAM,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAN,EAAAQ,OAAA,gBAAAT,EAAA,UAAA,OAAAS,IAAA,CAAA;AAAA,OAEAC,IAAA,OAMI,EAAA,wBAAA,YAJAC,EAAAJ,GAAA,YAAA,GAIA,SAHAT,EAGA;AAGJ,WAAAc,EAAAC,GAAAH,CAAA;;;;;;;;;;;;;;;;;;;"}
|