package.js.dist.orange-navbar.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boosted Show documentation
Show all versions of boosted Show documentation
Orange Boosted with Bootstrap is a Bootstrap based, Orange branded accessible and ergonomic components library.
The newest version!
{"version":3,"file":"orange-navbar.js","sources":["../src/orange-navbar.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Boosted orange-navbar.js\n * Licensed under MIT (https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'orangenavbar'\nconst DATA_KEY = 'bs.orangenavbar'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_SCROLL_DATA_API = `scroll${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst SELECTOR_STICKY_TOP = 'header.sticky-top'\n\n/**\n * Class definition\n */\n\nclass OrangeNavbar extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME\n }\n\n // Static\n static enableMinimizing(el) {\n // The minimized behavior works only if your header has .sticky-top (fixed-top will be sticky without minimizing)\n if (window.scrollY > 0) {\n el.classList.add('header-minimized')\n } else {\n el.classList.remove('header-minimized')\n }\n }\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = OrangeNavbar.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 * Data API implementation\n */\n\nEventHandler.on(window, EVENT_SCROLL_DATA_API, () => {\n for (const el of SelectorEngine.find(SELECTOR_STICKY_TOP)) {\n OrangeNavbar.enableMinimizing(el)\n }\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n for (const el of SelectorEngine.find(SELECTOR_STICKY_TOP)) {\n OrangeNavbar.enableMinimizing(el)\n }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(OrangeNavbar)\n\nexport default OrangeNavbar\n"],"names":["NAME","DATA_KEY","EVENT_KEY","DATA_API_KEY","EVENT_SCROLL_DATA_API","EVENT_LOAD_DATA_API","SELECTOR_STICKY_TOP","OrangeNavbar","BaseComponent","enableMinimizing","el","window","scrollY","classList","add","remove","jQueryInterface","config","each","data","getOrCreateInstance","TypeError","EventHandler","on","SelectorEngine","find","defineJQueryPlugin"],"mappings":";;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;;;EAOA;EACA;EACA;;EAEA,MAAMA,IAAI,GAAG,cAAc,CAAA;EAC3B,MAAMC,QAAQ,GAAG,iBAAiB,CAAA;EAClC,MAAMC,SAAS,GAAI,CAAGD,CAAAA,EAAAA,QAAS,CAAC,CAAA,CAAA;EAChC,MAAME,YAAY,GAAG,WAAW,CAAA;EAChC,MAAMC,qBAAqB,GAAI,CAAA,MAAA,EAAQF,SAAU,CAAA,EAAEC,YAAa,CAAC,CAAA,CAAA;EACjE,MAAME,mBAAmB,GAAI,CAAA,IAAA,EAAMH,SAAU,CAAA,EAAEC,YAAa,CAAC,CAAA,CAAA;EAC7D,MAAMG,mBAAmB,GAAG,mBAAmB,CAAA;;EAE/C;EACA;EACA;;EAEA,MAAMC,YAAY,SAASC,aAAa,CAAC;EACvC;IACA,WAAWR,IAAIA,GAAG;EAChB,IAAA,OAAOA,IAAI,CAAA;EACb,GAAA;;EAEA;IACA,OAAOS,gBAAgBA,CAACC,EAAE,EAAE;EAC1B;EACA,IAAA,IAAIC,MAAM,CAACC,OAAO,GAAG,CAAC,EAAE;EACtBF,MAAAA,EAAE,CAACG,SAAS,CAACC,GAAG,CAAC,kBAAkB,CAAC,CAAA;EACtC,KAAC,MAAM;EACL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