@mirai/core 0.4.253 → 0.4.254
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.
|
@@ -42,21 +42,17 @@ const EventManager = () => {
|
|
|
42
42
|
commissionCode
|
|
43
43
|
};
|
|
44
44
|
if (calendar !== null && calendar !== void 0 && calendar.length && (calendar === null || calendar === void 0 ? void 0 : calendar.length) === 2) next.finder = {
|
|
45
|
-
...finder,
|
|
46
45
|
calendar
|
|
47
46
|
};
|
|
48
47
|
if (occupation !== null && occupation !== void 0 && occupation.length) next.finder = {
|
|
49
|
-
...finder,
|
|
50
48
|
...next.finder,
|
|
51
49
|
occupation
|
|
52
50
|
};
|
|
53
51
|
if (promocode !== undefined && promocode !== null) next.finder = {
|
|
54
|
-
...finder,
|
|
55
52
|
...next.finder,
|
|
56
53
|
promocode
|
|
57
54
|
};
|
|
58
55
|
if (placeId) next.finder = {
|
|
59
|
-
...finder,
|
|
60
56
|
...next.finder,
|
|
61
57
|
place: tags === null || tags === void 0 ? void 0 : (_tags$options = tags.options) === null || _tags$options === void 0 ? void 0 : _tags$options.find(function () {
|
|
62
58
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventManager.js","names":["_dataSources","require","_react","_EventManager","_helpers","EventManager","value","finder","origin","tags","set","useStore","useEffect","Event","subscribe","COMPONENTS_EVENT","FINDER_FIELD_CHANGE","handleFinderFieldChange","EVENT","SET_STORE","handleSetStore","unsubscribe","publish","FINDER_CHANGE","_tags$options","chainSelectorValue","placeId","calendar","hsri","commissionCode","occupation","promocode","arguments","length","undefined","next","place","options","find","exports"],"sources":["../../../src/contexts/EventManager/EventManager.jsx"],"sourcesContent":["import { Event, useStore } from '@mirai/data-sources';\nimport { useEffect } from 'react';\n\nimport { EVENT } from './EventManager.constants';\nimport { EVENT as COMPONENTS_EVENT } from '../../components/helpers';\n\nconst EventManager = () => {\n const { value: { finder = {}, origin = {}, tags = {} } = {}, set } = useStore();\n\n useEffect(() => {\n Event.subscribe(COMPONENTS_EVENT.FINDER_FIELD_CHANGE, handleFinderFieldChange);\n Event.subscribe(EVENT.SET_STORE, handleSetStore);\n\n return () => {\n Event.unsubscribe(COMPONENTS_EVENT.FINDER_FIELD_CHANGE, handleFinderFieldChange);\n Event.unsubscribe(EVENT.SET_STORE, handleSetStore);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [finder, origin]);\n\n const handleFinderFieldChange = (value) => Event.publish(EVENT.FINDER_CHANGE, value);\n\n const handleSetStore = ({\n chainSelectorValue: placeId,\n calendar,\n hsri: commissionCode,\n occupation,\n promocode,\n } = {}) => {\n let next = {};\n\n if (commissionCode) next.origin = { ...origin, commissionCode };\n if (calendar?.length && calendar?.length === 2) next.finder = {
|
|
1
|
+
{"version":3,"file":"EventManager.js","names":["_dataSources","require","_react","_EventManager","_helpers","EventManager","value","finder","origin","tags","set","useStore","useEffect","Event","subscribe","COMPONENTS_EVENT","FINDER_FIELD_CHANGE","handleFinderFieldChange","EVENT","SET_STORE","handleSetStore","unsubscribe","publish","FINDER_CHANGE","_tags$options","chainSelectorValue","placeId","calendar","hsri","commissionCode","occupation","promocode","arguments","length","undefined","next","place","options","find","exports"],"sources":["../../../src/contexts/EventManager/EventManager.jsx"],"sourcesContent":["import { Event, useStore } from '@mirai/data-sources';\nimport { useEffect } from 'react';\n\nimport { EVENT } from './EventManager.constants';\nimport { EVENT as COMPONENTS_EVENT } from '../../components/helpers';\n\nconst EventManager = () => {\n const { value: { finder = {}, origin = {}, tags = {} } = {}, set } = useStore();\n\n useEffect(() => {\n Event.subscribe(COMPONENTS_EVENT.FINDER_FIELD_CHANGE, handleFinderFieldChange);\n Event.subscribe(EVENT.SET_STORE, handleSetStore);\n\n return () => {\n Event.unsubscribe(COMPONENTS_EVENT.FINDER_FIELD_CHANGE, handleFinderFieldChange);\n Event.unsubscribe(EVENT.SET_STORE, handleSetStore);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [finder, origin]);\n\n const handleFinderFieldChange = (value) => Event.publish(EVENT.FINDER_CHANGE, value);\n\n const handleSetStore = ({\n chainSelectorValue: placeId,\n calendar,\n hsri: commissionCode,\n occupation,\n promocode,\n } = {}) => {\n let next = {};\n\n if (commissionCode) next.origin = { ...origin, commissionCode };\n if (calendar?.length && calendar?.length === 2) next.finder = { calendar };\n if (occupation?.length) next.finder = { ...next.finder, occupation };\n if (promocode !== undefined && promocode !== null) next.finder = { ...next.finder, promocode };\n if (placeId) next.finder = { ...next.finder, place: tags?.options?.find(({ value } = {}) => value === placeId) };\n\n set(next);\n };\n\n return null;\n};\n\nexport { EventManager };\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEA,MAAMI,YAAY,GAAGA,CAAA,KAAM;EACzB,MAAM;IAAEC,KAAK,EAAE;MAAEC,MAAM,GAAG,CAAC,CAAC;MAAEC,MAAM,GAAG,CAAC,CAAC;MAAEC,IAAI,GAAG,CAAC;IAAE,CAAC,GAAG,CAAC,CAAC;IAAEC;EAAI,CAAC,GAAG,IAAAC,qBAAQ,EAAC,CAAC;EAE/E,IAAAC,gBAAS,EAAC,MAAM;IACdC,kBAAK,CAACC,SAAS,CAACC,cAAgB,CAACC,mBAAmB,EAAEC,uBAAuB,CAAC;IAC9EJ,kBAAK,CAACC,SAAS,CAACI,mBAAK,CAACC,SAAS,EAAEC,cAAc,CAAC;IAEhD,OAAO,MAAM;MACXP,kBAAK,CAACQ,WAAW,CAACN,cAAgB,CAACC,mBAAmB,EAAEC,uBAAuB,CAAC;MAChFJ,kBAAK,CAACQ,WAAW,CAACH,mBAAK,CAACC,SAAS,EAAEC,cAAc,CAAC;IACpD,CAAC;IACD;EACF,CAAC,EAAE,CAACb,MAAM,EAAEC,MAAM,CAAC,CAAC;EAEpB,MAAMS,uBAAu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