{"version":3,"sources":["webpack:///scripts/plugin--trigger-event--d79a5025763da1c10519.js","webpack:///./client/src/core/plugins/jquery__trigger-event/plugin.js"],"names":["webpackJsonpHairCare","D:\\a\\1\\s\\node_modules\\babel-loader\\lib\\index.js??ref--12-0!D:\\a\\1\\s\\node_modules\\eslint-loader\\index.js??ref--12-1!D:\\a\\1\\s\\client\\src\\core\\plugins\\jquery__trigger-event\\plugin.js","module","exports","__webpack_require__","_interopRequireDefault","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","_jquery2","_jquery","_debug2","_debug","_lib2","_lib","log","TriggerEvent","element","options","this","$element","events","event","split","selectors","selectTarget","targetSelector","watch","value","on","triggerAll","bind","forEach","trigger","using","trim","triggeredEvent","CustomEvent","bubbles","cancelable","dispatchEvent","DEFAULTS","PLUGIN_NAME"],"mappings":"AAAAA,sBAAsB,0BAEhBC,4MACA,SAAUC,EAAQC,EAASC,GAEjC,YAkDA,SAASC,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GAEvF,QAASG,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAjDhH,GAAIC,GAAe,WAAc,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE,GAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,SAAWF,KAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAAiB,MAAO,UAAUR,EAAae,EAAYC,GAAiJ,MAA9HD,IAAYZ,EAAiBH,EAAYiB,UAAWF,GAAiBC,GAAab,EAAiBH,EAAagB,GAAqBhB,MCoBhiB,yBDeIkB,EAAWxB,EAAuByB,GCZtC,yLDgBIC,EAAU1B,EAAuB2B,GCfrC,8LDmBIC,EAAQ5B,EAAuB6B,GClBnC,gNAGMC,GAAM,aADQ,wBAGpBA,GAAI,YD0BJ,ICxBMC,G,WACL,WAAYC,EAASC,GAAS,UAC7BH,EAAI,UAAWE,GACfF,EAAI,UAAWG,GACfC,KAAKF,QAAUA,EACfE,KAAKD,QAAUA,EACfC,KAAKC,UAAW,aAAEH,GAClBE,KAAKE,OAASF,KAAKD,QAAQI,MAAMC,MAAM,KAEvCJ,KAAKxB,OAASwB,KAAKK,UAAUC,aAC5BN,KAAKD,QAAQQ,eACbP,KAAKC,UAGNL,EAAI,QAASI,KAAKF,SAClBE,KAAKQ,QD0DN,MAhCAlC,GAAauB,IACZX,IAAK,QACLuB,MAAO,WCxBPT,KAAKC,SAASS,GAAGV,KAAKD,QAAQW,GAAIV,KAAKW,WAAWC,KAAKZ,UD4BvDd,IAAK,aACLuB,MAAO,WCzBPT,KAAKE,OAAOW,QAAQb,KAAKc,QAAQF,KAAKZ,UD6BtCd,IAAK,UACLuB,MAAO,SC3BAN,GACP,IAAKH,KAAKxB,OAAOG,OAEhB,MADAiB,qBAAsBI,KAAKD,QAAQQ,eAAnC,2BACO,CAIR,IAA0B,UAAtBP,KAAKD,QAAQgB,MAChBf,KAAKxB,OAAOsC,QAAQX,EAAMa,YACpB,CACN,GAAMC,GAAiB,GAAIC,aAAYf,EAAMa,QAC5CG,SAAS,EACTC,YAAY,GAGbpB,MAAKxB,OAAO,GAAG6C,cAAcJ,QDgCxBpB,IC3BRA,GAAayB,UACZZ,GAAI,QACJH,eAAgB,SAChBQ,MAAO,WAGR,aAAOQ,cAAa1B","file":"scripts/plugin--trigger-event--d79a5025763da1c10519.js","sourcesContent":["webpackJsonpHairCare([\"plugin--trigger-event\"],{\n\n/***/ \"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--12-0!D:\\\\a\\\\1\\\\s\\\\node_modules\\\\eslint-loader\\\\index.js??ref--12-1!D:\\\\a\\\\1\\\\s\\\\client\\\\src\\\\core\\\\plugins\\\\jquery__trigger-event\\\\plugin.js\":\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*\r\n Trigger Event\r\n \r\n Triggers a specified event on a target element\r\n \r\n ### Html Attributes\r\n \r\n ```\r\n \tdata-trigger-event\r\n \tdata-trigger-event--on=\"event on this element\"\r\n \tdata-trigger-event--target-selector=\"target element selector\"\r\n \tdata-trigger-event--event=\"event to trigger on target element\"\r\n ```\r\n \r\n Markup:\r\n
\r\n \r\n \r\n */\n\n\n/* global $:true */\n\n\nvar _jquery = __webpack_require__(\"external \\\"jQuery\\\"\");\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _debug = __webpack_require__(\"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--12-0!D:\\\\a\\\\1\\\\s\\\\node_modules\\\\eslint-loader\\\\index.js??ref--12-1!D:\\\\a\\\\1\\\\s\\\\node_modules\\\\debug\\\\src\\\\browser.js\");\n\nvar _debug2 = _interopRequireDefault(_debug);\n\nvar _lib = __webpack_require__(\"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--12-0!D:\\\\a\\\\1\\\\s\\\\node_modules\\\\eslint-loader\\\\index.js??ref--12-1!D:\\\\a\\\\1\\\\s\\\\client\\\\src\\\\core\\\\plugins\\\\lib\\\\index.js\");\n\nvar _lib2 = _interopRequireDefault(_lib);\n\nvar _index = __webpack_require__(\"D:\\\\a\\\\1\\\\s\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js??ref--12-0!D:\\\\a\\\\1\\\\s\\\\node_modules\\\\eslint-loader\\\\index.js??ref--12-1!D:\\\\a\\\\1\\\\s\\\\client\\\\src\\\\core\\\\plugins\\\\jquery__trigger-event\\\\index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MODULE_NAME = 'plugins/trigger-event';\nvar log = (0, _debug2.default)(MODULE_NAME);\n\nlog('registerd');\n\nvar TriggerEvent = function () {\n\tfunction TriggerEvent(element, options) {\n\t\t_classCallCheck(this, TriggerEvent);\n\n\t\tlog('element', element);\n\t\tlog('options', options);\n\t\tthis.element = element;\n\t\tthis.options = options;\n\t\tthis.$element = (0, _jquery2.default)(element);\n\t\tthis.events = this.options.event.split(',');\n\n\t\tthis.target = this.selectors.selectTarget(this.options.targetSelector, this.$element);\n\n\t\tlog('ready', this.element);\n\t\tthis.watch();\n\t}\n\n\t_createClass(TriggerEvent, [{\n\t\tkey: 'watch',\n\t\tvalue: function watch() {\n\t\t\tthis.$element.on(this.options.on, this.triggerAll.bind(this));\n\t\t}\n\t}, {\n\t\tkey: 'triggerAll',\n\t\tvalue: function triggerAll() {\n\t\t\tthis.events.forEach(this.trigger.bind(this));\n\t\t}\n\t}, {\n\t\tkey: 'trigger',\n\t\tvalue: function trigger(event) {\n\t\t\tif (!this.target.length) {\n\t\t\t\tlog('Event target: \"' + this.options.targetSelector + '\" not found. Aborting.');\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// opt into using legacy jQuery event\n\t\t\tif (this.options.using == \"jquery\") {\n\t\t\t\tthis.target.trigger(event.trim());\n\t\t\t} else {\n\t\t\t\tvar triggeredEvent = new CustomEvent(event.trim(), {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcancelable: true\n\t\t\t\t\t// detail: {}\n\t\t\t\t});\n\t\t\t\tthis.target[0].dispatchEvent(triggeredEvent);\n\t\t\t}\n\t\t}\n\t}]);\n\n\treturn TriggerEvent;\n}();\n\nTriggerEvent.DEFAULTS = {\n\ton: 'click',\n\ttargetSelector: '(self)',\n\tusing: 'native'\n};\n\n(0, _lib2.default)(_index.PLUGIN_NAME, TriggerEvent);\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// scripts/plugin--trigger-event--d79a5025763da1c10519.js","/*\r\nTrigger Event\r\n\r\nTriggers a specified event on a target element\r\n\r\n### Html Attributes\r\n\r\n```\r\n\tdata-trigger-event\r\n\tdata-trigger-event--on=\"event on this element\"\r\n\tdata-trigger-event--target-selector=\"target element selector\"\r\n\tdata-trigger-event--event=\"event to trigger on target element\"\r\n```\r\n\r\nMarkup:\r\n\r\n\r\n\r\n*/\r\nimport $ from 'jquery';\r\n\r\n/* global $:true */\r\nimport debug from 'debug';\r\nimport plugin from '@core/plugins/lib';\r\nimport { ELEMENT_SELECTOR, PLUGIN_NAME } from './index';\r\n\r\nconst MODULE_NAME = 'plugins/trigger-event';\r\nconst log = debug(MODULE_NAME);\r\n\r\nlog('registerd');\r\n\r\nclass TriggerEvent {\r\n\tconstructor(element, options) {\r\n\t\tlog('element', element);\r\n\t\tlog('options', options);\r\n\t\tthis.element = element;\r\n\t\tthis.options = options;\r\n\t\tthis.$element = $(element);\r\n\t\tthis.events = this.options.event.split(',');\r\n\r\n\t\tthis.target = this.selectors.selectTarget(\r\n\t\t\tthis.options.targetSelector,\r\n\t\t\tthis.$element\r\n\t\t);\r\n\r\n\t\tlog('ready', this.element);\r\n\t\tthis.watch();\r\n\t}\r\n\r\n\twatch() {\r\n\t\tthis.$element.on(this.options.on, this.triggerAll.bind(this));\r\n\t}\r\n\r\n\ttriggerAll(){\r\n\t\tthis.events.forEach(this.trigger.bind(this));\r\n\t}\r\n\r\n\ttrigger(event) {\r\n\t\tif (!this.target.length) {\r\n\t\t\tlog(`Event target: \"${this.options.targetSelector}\" not found. Aborting.`);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// opt into using legacy jQuery event\r\n\t\tif (this.options.using == \"jquery\") {\r\n\t\t\tthis.target.trigger(event.trim());\r\n\t\t} else {\r\n\t\t\tconst triggeredEvent = new CustomEvent(event.trim(), {\r\n\t\t\t\tbubbles: true,\r\n\t\t\t\tcancelable: true,\r\n\t\t\t\t// detail: {}\r\n\t\t\t});\r\n\t\t\tthis.target[0].dispatchEvent(triggeredEvent);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTriggerEvent.DEFAULTS = {\r\n\ton: 'click',\r\n\ttargetSelector: '(self)',\r\n\tusing: 'native'\r\n};\r\n\r\nplugin(PLUGIN_NAME, TriggerEvent);\r\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/core/plugins/jquery__trigger-event/plugin.js"],"sourceRoot":""}