1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00
twbs--bootstrap/js/dist/popover.js.map
2022-05-13 19:44:01 +03:00

1 line
No EOL
4 KiB
Text

{"version":3,"file":"popover.js","sources":["../src/popover.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.2.0-beta1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { defineJQueryPlugin } from './util/index'\nimport Tooltip from './tooltip'\n\n/**\n * Constants\n */\n\nconst NAME = 'popover'\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\nconst Default = {\n ...Tooltip.Default,\n placement: 'right',\n offset: [0, 8],\n trigger: 'click',\n content: '',\n template: '<div class=\"popover\" role=\"tooltip\">' +\n '<div class=\"popover-arrow\"></div>' +\n '<h3 class=\"popover-header\"></h3>' +\n '<div class=\"popover-body\"></div>' +\n '</div>'\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content: '(null|string|element|function)'\n}\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Overrides\n _isWithContent() {\n return this._getTitle() || this._getContent()\n }\n\n // Private\n _getContentForTemplate() {\n return {\n [SELECTOR_TITLE]: this._getTitle(),\n [SELECTOR_CONTENT]: this._getContent()\n }\n }\n\n _getContent() {\n return this._resolvePossibleFunction(this._config.content)\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n"],"names":["NAME","SELECTOR_TITLE","SELECTOR_CONTENT","Default","Tooltip","placement","offset","trigger","content","template","DefaultType","Popover","_isWithContent","_getTitle","_getContent","_getContentForTemplate","_resolvePossibleFunction","_config","jQueryInterface","config","each","data","getOrCreateInstance","TypeError","defineJQueryPlugin"],"mappings":";;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EAKA;EACA;EACA;;EAEA,MAAMA,IAAI,GAAG,SAAb,CAAA;EAEA,MAAMC,cAAc,GAAG,iBAAvB,CAAA;EACA,MAAMC,gBAAgB,GAAG,eAAzB,CAAA;EAEA,MAAMC,OAAO,GAAG,EACd,GAAGC,wBAAO,CAACD,OADG;EAEdE,EAAAA,SAAS,EAAE,OAFG;EAGdC,EAAAA,MAAM,EAAE,CAAC,CAAD,EAAI,CAAJ,CAHM;EAIdC,EAAAA,OAAO,EAAE,OAJK;EAKdC,EAAAA,OAAO,EAAE,EALK;EAMdC,EAAAA,QAAQ,EAAE,sCACE,GAAA,mCADF,GAEE,kCAFF,GAGE,kCAHF,GAIA,QAAA;EAVI,CAAhB,CAAA;EAaA,MAAMC,WAAW,GAAG,EAClB,GAAGN,wBAAO,CAACM,WADO;EAElBF,EAAAA,OAAO,EAAE,gCAAA;EAFS,CAApB,CAAA;EAKA;EACA;EACA;;EAEA,MAAMG,OAAN,SAAsBP,wBAAtB,CAA8B;EAC5B;EACkB,EAAA,WAAPD,OAAO,GAAG;EACnB,IAAA,OAAOA,OAAP,CAAA;EACD,GAAA;;EAEqB,EAAA,WAAXO,WAAW,GAAG;EACvB,IAAA,OAAOA,WAAP,CAAA;EACD,GAAA;;EAEc,EAAA,WAAJV,IAAI,GAAG;EAChB,IAAA,OAAOA,IAAP,CAAA;EACD,GAZ2B;;;EAe5BY,EAAAA,cAAc,GAAG;EACf,IAAA,OAAO,IAAKC,CAAAA,SAAL,EAAoB,IAAA,IAAA,CAAKC,WAAL,EAA3B,CAAA;EACD,GAjB2B;;;EAoB5BC,EAAAA,sBAAsB,GAA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