@dr.pogodin/react-utils 1.31.2 → 1.33.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.
Files changed (40) hide show
  1. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +15 -2
  2. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  3. package/build/development/shared/components/selectors/CustomDropdown/index.js +3 -2
  4. package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  5. package/build/development/shared/components/selectors/index.js +13 -0
  6. package/build/development/shared/components/selectors/index.js.map +1 -1
  7. package/build/development/web.bundle.js +5 -5
  8. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js +1 -1
  9. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  10. package/build/production/shared/components/selectors/CustomDropdown/index.js +2 -2
  11. package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  12. package/build/production/shared/components/selectors/index.js +1 -1
  13. package/build/production/shared/components/selectors/index.js.map +1 -1
  14. package/build/production/web.bundle.js +1 -1
  15. package/build/production/web.bundle.js.map +1 -1
  16. package/build/types-code/shared/components/selectors/index.d.ts +1 -0
  17. package/config/webpack/app-base.js +9 -0
  18. package/config/webpack/lib-base.js +9 -0
  19. package/package.json +19 -19
  20. package/src/shared/components/selectors/CustomDropdown/Options/index.tsx +18 -2
  21. package/src/shared/components/selectors/CustomDropdown/index.tsx +6 -2
  22. package/src/shared/components/selectors/index.ts +7 -0
  23. package/build/types-scss/__tests__/js/config/publicPath support/__assets__/style.scss.d.ts +0 -1
  24. package/build/types-scss/__tests__/js/config/stylename-generation/__assets__/MockPackageA/TestComponent/style.scss.d.ts +0 -1
  25. package/build/types-scss/__tests__/js/config/stylename-generation/__assets__/MockPackageB/TestComponent/style.scss.d.ts +0 -1
  26. package/build/types-scss/__tests__/js/config/stylename-generation/__assets__/style.scss.d.ts +0 -1
  27. package/build/types-scss/__tests__/js/shared/components/NavLink/styles.scss.d.ts +0 -1
  28. package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/ComponentA/style.scss.d.ts +0 -1
  29. package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/ComponentB/style.scss.d.ts +0 -1
  30. package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/ComponentC/style.scss.d.ts +0 -1
  31. package/build/types-scss/__tests__/js/shared/utils/splitComponent/__assets__/SampleScene/style.scss.d.ts +0 -1
  32. package/build/types-scss/__tests__/ts/config/publicPath support/__assets__/style.scss.d.ts +0 -1
  33. package/build/types-scss/__tests__/ts/config/stylename-generation/__assets__/MockPackageA/TestComponent/style.scss.d.ts +0 -1
  34. package/build/types-scss/__tests__/ts/config/stylename-generation/__assets__/MockPackageB/TestComponent/style.scss.d.ts +0 -1
  35. package/build/types-scss/__tests__/ts/config/stylename-generation/__assets__/style.scss.d.ts +0 -1
  36. package/build/types-scss/__tests__/ts/shared/components/NavLink/styles.scss.d.ts +0 -1
  37. package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/ComponentA/style.scss.d.ts +0 -1
  38. package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/ComponentB/style.scss.d.ts +0 -1
  39. package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/ComponentC/style.scss.d.ts +0 -1
  40. package/build/types-scss/__tests__/ts/shared/utils/splitComponent/__assets__/SampleScene/style.scss.d.ts +0 -1
@@ -28,7 +28,16 @@ const Options = /*#__PURE__*/(0, _react.forwardRef)(({
28
28
  }, ref) => {
29
29
  const opsRef = (0, _react.useRef)(null);
30
30
  (0, _react.useImperativeHandle)(ref, () => ({
31
- measure: () => opsRef.current?.getBoundingClientRect()
31
+ measure: () => {
32
+ const e = opsRef.current?.parentElement;
33
+ if (!e) return undefined;
34
+ const rect = opsRef.current?.getBoundingClientRect();
35
+ const style = window.getComputedStyle(e);
36
+ const mBottom = parseFloat(style.marginBottom);
37
+ const mTop = parseFloat(style.marginTop);
38
+ rect.height += mBottom + mTop;
39
+ return rect;
40
+ }
32
41
  }), []);
33
42
  const optionNodes = [];
34
43
  for (let i = 0; i < options.length; ++i) {
@@ -37,10 +46,14 @@ const Options = /*#__PURE__*/(0, _react.forwardRef)(({
37
46
  const [iValue, iName] = (0, _common.optionValueName)(option);
38
47
  optionNodes.push( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
39
48
  className: optionClass,
40
- onClick: () => onChange(iValue),
49
+ onClick: e => {
50
+ onChange(iValue);
51
+ e.stopPropagation();
52
+ },
41
53
  onKeyDown: e => {
42
54
  if (e.key === 'Enter') {
43
55
  onChange(iValue);
56
+ e.stopPropagation();
44
57
  }
45
58
  },
46
59
  role: "button",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_Modal","_common","_jsxRuntime","S","areEqual","a","b","left","top","width","Options","forwardRef","containerClass","containerStyle","filter","onCancel","onChange","optionClass","options","ref","opsRef","useRef","useImperativeHandle","measure","current","getBoundingClientRect","optionNodes","i","length","option","iValue","iName","optionValueName","push","jsx","className","onClick","onKeyDown","e","key","role","tabIndex","children","BaseModal","cancelOnScrolling","dontDisableScrolling","theme","ad","hoc","container","context","overlay","propTypes","PT","string","isRequired","shape","number","func","optionsValidator","defaultProps","undefined","_default","exports","default"],"sources":["../../../../../../../src/shared/components/selectors/CustomDropdown/Options/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport { BaseModal } from 'components/Modal';\n\nimport S from './style.scss';\n\nimport {\n type OptionT,\n type OptionsT,\n optionsValidator,\n optionValueName,\n} from '../../common';\n\nexport type ContainerPosT = {\n left: number;\n top: number;\n width: number;\n};\n\nexport function areEqual(a?: ContainerPosT, b?: ContainerPosT): boolean {\n return a?.left === b?.left && a?.top === b?.top && a?.width === b?.width;\n}\n\nexport type RefT = {\n measure: () => DOMRect | undefined;\n};\n\ntype PropsT = {\n containerClass: string;\n containerStyle?: ContainerPosT;\n filter?: (item: OptionT<React.ReactNode> | string) => boolean;\n optionClass: string;\n options: OptionsT<React.ReactNode>;\n onCancel: () => void;\n onChange: (value: string) => void;\n};\n\nconst Options = forwardRef<RefT, PropsT>(({\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options,\n}, ref) => {\n const opsRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => ({\n measure: () => opsRef.current?.getBoundingClientRect(),\n }), []);\n\n const optionNodes: React.ReactNode[] = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n optionNodes.push(\n <div\n className={optionClass}\n onClick={() => onChange(iValue)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onChange(iValue);\n }\n }}\n key={iValue}\n role=\"button\"\n tabIndex={0}\n >\n {iName}\n </div>,\n );\n }\n }\n\n return (\n <BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n cancelOnScrolling\n containerStyle={containerStyle}\n dontDisableScrolling\n onCancel={onCancel}\n theme={{\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: S.overlay,\n }}\n >\n <div ref={opsRef}>{optionNodes}</div>\n </BaseModal>\n );\n});\n\nOptions.propTypes = {\n containerClass: PT.string.isRequired,\n\n containerStyle: PT.shape({\n left: PT.number.isRequired,\n top: PT.number.isRequired,\n width: PT.number.isRequired,\n }),\n\n filter: PT.func,\n onCancel: PT.func.isRequired,\n onChange: PT.func.isRequired,\n optionClass: PT.string.isRequired,\n options: optionsValidator.isRequired,\n};\n\nOptions.defaultProps = {\n containerStyle: undefined,\n filter: undefined,\n};\n\nexport default Options;\n"],"mappings":";;;;;;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kBAAE,CAACK,IAAI,CAACH,UAAU;EAC5BtC,WAAW,EAAEoC,kBAAE,CAACC,MAAM,CAACC,UAAU;EACjCrC,OAAO,EAAEyC,wBAAgB,CAACJ;AAC5B,CAAC;AAED7C,OAAO,CAACkD,YAAY,GAAG;EACrB/C,cAAc,EAAEgD,SAAS;EACzB/C,MAAM,EAAE+C;AACV,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEatD,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_Modal","_common","_jsxRuntime","S","areEqual","a","b","left","top","width","Options","forwardRef","containerClass","containerStyle","filter","onCancel","onChange","optionClass","options","ref","opsRef","useRef","useImperativeHandle","measure","e","current","parentElement","undefined","rect","getBoundingClientRect","style","window","getComputedStyle","mBottom","parseFloat","marginBottom","mTop","marginTop","height","optionNodes","i","length","option","iValue","iName","optionValueName","push","jsx","className","onClick","stopPropagation","onKeyDown","key","role","tabIndex","children","BaseModal","cancelOnScrolling","dontDisableScrolling","theme","ad","hoc","container","context","overlay","propTypes","PT","string","isRequired","shape","number","func","optionsValidator","defaultProps","_default","exports","default"],"sources":["../../../../../../../src/shared/components/selectors/CustomDropdown/Options/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport { BaseModal } from 'components/Modal';\n\nimport S from './style.scss';\n\nimport {\n type OptionT,\n type OptionsT,\n optionsValidator,\n optionValueName,\n} from '../../common';\n\nexport type ContainerPosT = {\n left: number;\n top: number;\n width: number;\n};\n\nexport function areEqual(a?: ContainerPosT, b?: ContainerPosT): boolean {\n return a?.left === b?.left && a?.top === b?.top && a?.width === b?.width;\n}\n\nexport type RefT = {\n measure: () => DOMRect | undefined;\n};\n\ntype PropsT = {\n containerClass: string;\n containerStyle?: ContainerPosT;\n filter?: (item: OptionT<React.ReactNode> | string) => boolean;\n optionClass: string;\n options: OptionsT<React.ReactNode>;\n onCancel: () => void;\n onChange: (value: string) => void;\n};\n\nconst Options = forwardRef<RefT, PropsT>(({\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options,\n}, ref) => {\n const opsRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => ({\n measure: () => {\n const e = opsRef.current?.parentElement;\n if (!e) return undefined;\n\n const rect = opsRef.current?.getBoundingClientRect();\n const style = window.getComputedStyle(e);\n const mBottom = parseFloat(style.marginBottom);\n const mTop = parseFloat(style.marginTop);\n\n rect.height += mBottom + mTop;\n\n return rect;\n },\n }), []);\n\n const optionNodes: React.ReactNode[] = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n optionNodes.push(\n <div\n className={optionClass}\n onClick={(e) => {\n onChange(iValue);\n e.stopPropagation();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onChange(iValue);\n e.stopPropagation();\n }\n }}\n key={iValue}\n role=\"button\"\n tabIndex={0}\n >\n {iName}\n </div>,\n );\n }\n }\n\n return (\n <BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n cancelOnScrolling\n containerStyle={containerStyle}\n dontDisableScrolling\n onCancel={onCancel}\n theme={{\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: S.overlay,\n }}\n >\n <div ref={opsRef}>{optionNodes}</div>\n </BaseModal>\n );\n});\n\nOptions.propTypes = {\n containerClass: PT.string.isRequired,\n\n containerStyle: PT.shape({\n left: PT.number.isRequired,\n top: PT.number.isRequired,\n width: PT.number.isRequired,\n }),\n\n filter: PT.func,\n onCancel: PT.func.isRequired,\n onChange: PT.func.isRequired,\n optionClass: PT.string.isRequired,\n options: optionsValidator.isRequired,\n};\n\nOptions.defaultProps = {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AT,QAAA,eAEF,IAAArD,WAAA,CAAA6C,GAAA;MAAK5B,GAAG,EAAEC,MAAO;MAAAmC,QAAA,EAAEhB;IAAW,CAAM;EAAC,CAC5B,CAAC;AAEhB,CAAC,CAAC;AAEF7B,OAAO,CAACuD,SAAS,GAAG;EAClBrD,cAAc,EAAEsD,kBAAE,CAACC,MAAM,CAACC,UAAU;EAEpCvD,cAAc,EAAEqD,kBAAE,CAACG,KAAK,CAAC;IACvB9D,IAAI,EAAE2D,kBAAE,CAACI,MAAM,CAACF,UAAU;IAC1B5D,GAAG,EAAE0D,kBAAE,CAACI,MAAM,CAACF,UAAU;IACzB3D,KAAK,EAAEyD,kBAAE,CAACI,MAAM,CAACF;EACnB,CAAC,CAAC;EAEFtD,MAAM,EAAEoD,kBAAE,CAACK,IAAI;EACfxD,QAAQ,EAAEmD,kBAAE,CAACK,IAAI,CAACH,UAAU;EAC5BpD,QAAQ,EAAEkD,kBAAE,CAACK,IAAI,CAACH,UAAU;EAC5BnD,WAAW,EAAEiD,kBAAE,CAACC,MAAM,CAACC,UAAU;EACjClD,OAAO,EAAEsD,wBAAgB,CAACJ;AAC5B,CAAC;AAED1D,OAAO,CAAC+D,YAAY,GAAG;EACrB5D,cAAc,EAAEc,SAAS;EACzBb,MAAM,EAAEa;AACV,CAAC;AAAC,IAAA+C,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEalE,OAAO","ignoreList":[]}
@@ -69,7 +69,7 @@ const BaseCustomDropdown = ({
69
69
  cancelAnimationFrame(id);
70
70
  };
71
71
  }, [active]);
72
- const openList = () => {
72
+ const openList = e => {
73
73
  const view = window.visualViewport;
74
74
  const rect = dropdownRef.current.getBoundingClientRect();
75
75
  setActive(true);
@@ -85,6 +85,7 @@ const BaseCustomDropdown = ({
85
85
  top: view?.height || 0,
86
86
  width: rect.width
87
87
  });
88
+ e.stopPropagation();
88
89
  };
89
90
  let selected = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
90
91
  children: "\u200C"
@@ -115,7 +116,7 @@ const BaseCustomDropdown = ({
115
116
  className: theme.dropdown,
116
117
  onClick: openList,
117
118
  onKeyDown: e => {
118
- if (e.key === 'Enter') openList();
119
+ if (e.key === 'Enter') openList(e);
119
120
  },
120
121
  ref: dropdownRef,
121
122
  role: "listbox",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_reactThemes","_Options","_interopRequireWildcard","_common","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultTheme","BaseCustomDropdown","filter","label","onChange","options","theme","value","Error","active","setActive","useState","dropdownRef","useRef","opsRef","opsPos","setOpsPos","upward","setUpward","useEffect","undefined","id","cb","anchor","current","getBoundingClientRect","opsRect","measure","fitsDown","bottom","height","window","visualViewport","fitsUp","top","up","pos","left","width","now","areEqual","requestAnimationFrame","cancelAnimationFrame","openList","view","rect","selected","jsx","Fragment","children","length","option","iValue","iName","optionValueName","containerClassName","container","opsContainerClass","select","jsxs","className","dropdown","onClick","onKeyDown","key","ref","role","tabIndex","arrow","containerClass","containerStyle","onCancel","newValue","optionClass","ThemedCustomDropdown","themed","validThemeKeys","propTypes","PT","func","node","arrayOf","optionValidator","isRequired","themeType","string","defaultProps","_default","exports"],"sources":["../../../../../../src/shared/components/selectors/CustomDropdown/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { useEffect, useRef, useState } from 'react';\n\nimport themed from '@dr.pogodin/react-themes';\n\nimport Options, { type ContainerPosT, type RefT, areEqual } from './Options';\n\nimport defaultTheme from './theme.scss';\n\nimport {\n type PropsT,\n optionValidator,\n optionValueName,\n validThemeKeys,\n} from '../common';\n\nconst BaseCustomDropdown: React.FunctionComponent<\nPropsT<React.ReactNode, (value: string) => void>\n> = ({\n filter,\n label,\n onChange,\n options,\n theme,\n value,\n}) => {\n if (!options) throw Error('Internal error');\n\n const [active, setActive] = useState(false);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const opsRef = useRef<RefT>(null);\n\n const [opsPos, setOpsPos] = useState<ContainerPosT>();\n const [upward, setUpward] = useState(false);\n\n useEffect(() => {\n if (!active) return undefined;\n\n let id: number;\n const cb = () => {\n const anchor = dropdownRef.current?.getBoundingClientRect();\n const opsRect = opsRef.current?.measure();\n if (anchor && opsRect) {\n const fitsDown = anchor.bottom + opsRect.height\n < (window.visualViewport?.height ?? 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n\n const up = !fitsDown && fitsUp;\n setUpward(up);\n\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width,\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width,\n };\n\n setOpsPos((now) => (areEqual(now, pos) ? now : pos));\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n\n const openList = () => {\n const view = window.visualViewport;\n const rect = dropdownRef.current!.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: view?.width || 0,\n top: view?.height || 0,\n width: rect.width,\n });\n };\n\n let selected: React.ReactNode = <>&zwnj;</>;\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n\n return (\n <div className={containerClassName}>\n {label === undefined ? null : (\n <div className={theme.label}>{label}</div>\n )}\n <div\n className={theme.dropdown}\n onClick={openList}\n onKeyDown={(e) => {\n if (e.key === 'Enter') openList();\n }}\n ref={dropdownRef}\n role=\"listbox\"\n tabIndex={0}\n >\n {selected}\n <div className={theme.arrow} />\n </div>\n {\n active ? (\n <Options\n containerClass={opsContainerClass}\n containerStyle={opsPos}\n onCancel={() => {\n setActive(false);\n }}\n onChange={(newValue) => {\n setActive(false);\n if (onChange) onChange(newValue);\n }}\n optionClass={theme.option || ''}\n options={options}\n ref={opsRef}\n />\n ) : null\n }\n </div>\n );\n};\n\nconst ThemedCustomDropdown = themed(\n BaseCustomDropdown,\n 'CustomDropdown',\n validThemeKeys,\n defaultTheme,\n);\n\nBaseCustomDropdown.propTypes = {\n filter: PT.func,\n label: PT.node,\n onChange: PT.func,\n options: PT.arrayOf(optionValidator.isRequired),\n theme: ThemedCustomDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nBaseCustomDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined,\n};\n\nexport default ThemedCustomDropdown;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,QAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAIA,IAAAK,OAAA,GAAAL,OAAA;AAKmB,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,C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,CAAE;MACFC,WAAW,EAAEnE,KAAK,CAAC6C,MAAM,IAAI,EAAG;MAChC9C,OAAO,EAAEA,OAAQ;MACjB4D,GAAG,EAAEnD;IAAO,CACb,CAAC,GACA,IAAI;EAAA,CAEP,CAAC;AAEV,CAAC;AAED,MAAM4D,oBAAoB,GAAG,IAAAC,oBAAM,EACjC1E,kBAAkB,EAClB,gBAAgB,EAChB2E,sBAAc,EACd5E,YACF,CAAC;AAEDC,kBAAkB,CAAC4E,SAAS,GAAG;EAC7B3E,MAAM,EAAE4E,kBAAE,CAACC,IAAI;EACf5E,KAAK,EAAE2E,kBAAE,CAACE,IAAI;EACd5E,QAAQ,EAAE0E,kBAAE,CAACC,IAAI;EACjB1E,OAAO,EAAEyE,kBAAE,CAACG,OAAO,CAACC,uBAAe,CAACC,UAAU,CAAC;EAC/C7E,KAAK,EAAEoE,oBAAoB,CAACU,SAAS,CAACD,UAAU;EAChD5E,KAAK,EAAEuE,kBAAE,CAACO;AACZ,CAAC;AAEDpF,kBAAkB,CAACqF,YAAY,GAAG;EAChCpF,MAAM,EAAEkB,SAAS;EACjBjB,KAAK,EAAEiB,SAAS;EAChBhB,QAAQ,EAAEgB,SAAS;EACnBf,OAAO,EAAE,EAAE;EACXE,KAAK,EAAEa;AACT,CAAC;AAAC,IAAAmE,QAAA,GAAAC,OAAA,CAAAtG,OAAA,GAEawF,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_reactThemes","_Options","_interopRequireWildcard","_common","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultTheme","BaseCustomDropdown","filter","label","onChange","options","theme","value","Error","active","setActive","useState","dropdownRef","useRef","opsRef","opsPos","setOpsPos","upward","setUpward","useEffect","undefined","id","cb","anchor","current","getBoundingClientRect","opsRect","measure","fitsDown","bottom","height","window","visualViewport","fitsUp","top","up","pos","left","width","now","areEqual","requestAnimationFrame","cancelAnimationFrame","openList","view","rect","stopPropagation","selected","jsx","Fragment","children","length","option","iValue","iName","optionValueName","containerClassName","container","opsContainerClass","select","jsxs","className","dropdown","onClick","onKeyDown","key","ref","role","tabIndex","arrow","containerClass","containerStyle","onCancel","newValue","optionClass","ThemedCustomDropdown","themed","validThemeKeys","propTypes","PT","func","node","arrayOf","optionValidator","isRequired","themeType","string","defaultProps","_default","exports"],"sources":["../../../../../../src/shared/components/selectors/CustomDropdown/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { useEffect, useRef, useState } from 'react';\n\nimport themed from '@dr.pogodin/react-themes';\n\nimport Options, { type ContainerPosT, type RefT, areEqual } from './Options';\n\nimport defaultTheme from './theme.scss';\n\nimport {\n type PropsT,\n optionValidator,\n optionValueName,\n validThemeKeys,\n} from '../common';\n\nconst BaseCustomDropdown: React.FunctionComponent<\nPropsT<React.ReactNode, (value: string) => void>\n> = ({\n filter,\n label,\n onChange,\n options,\n theme,\n value,\n}) => {\n if (!options) throw Error('Internal error');\n\n const [active, setActive] = useState(false);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const opsRef = useRef<RefT>(null);\n\n const [opsPos, setOpsPos] = useState<ContainerPosT>();\n const [upward, setUpward] = useState(false);\n\n useEffect(() => {\n if (!active) return undefined;\n\n let id: number;\n const cb = () => {\n const anchor = dropdownRef.current?.getBoundingClientRect();\n const opsRect = opsRef.current?.measure();\n if (anchor && opsRect) {\n const fitsDown = anchor.bottom + opsRect.height\n < (window.visualViewport?.height ?? 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n\n const up = !fitsDown && fitsUp;\n setUpward(up);\n\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width,\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width,\n };\n\n setOpsPos((now) => (areEqual(now, pos) ? now : pos));\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n\n const openList = (\n e: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement>,\n ) => {\n const view = window.visualViewport;\n const rect = dropdownRef.current!.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: view?.width || 0,\n top: view?.height || 0,\n width: rect.width,\n });\n\n e.stopPropagation();\n };\n\n let selected: React.ReactNode = <>&zwnj;</>;\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n\n return (\n <div className={containerClassName}>\n {label === undefined ? null : (\n <div className={theme.label}>{label}</div>\n )}\n <div\n className={theme.dropdown}\n onClick={openList}\n onKeyDown={(e) => {\n if (e.key === 'Enter') openList(e);\n }}\n ref={dropdownRef}\n role=\"listbox\"\n tabIndex={0}\n >\n {selected}\n <div className={theme.arrow} />\n </div>\n {\n active ? (\n <Options\n containerClass={opsContainerClass}\n containerStyle={opsPos}\n onCancel={() => {\n setActive(false);\n }}\n onChange={(newValue) => {\n setActive(false);\n if (onChange) onChange(newValue);\n }}\n optionClass={theme.option || ''}\n options={options}\n ref={opsRef}\n />\n ) : null\n }\n </div>\n );\n};\n\nconst ThemedCustomDropdown = themed(\n BaseCustomDropdown,\n 'CustomDropdown',\n validThemeKeys,\n defaultTheme,\n);\n\nBaseCustomDropdown.propTypes = {\n filter: PT.func,\n label: PT.node,\n onChange: PT.func,\n options: PT.arrayOf(optionValidator.isRequired),\n theme: ThemedCustomDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nBaseCustomDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined,\n};\n\nexport default ThemedCustomDropdown;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,QAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAIA,IAAAK,OAAA,GAAAL,OAAA;AAKmB,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,G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EACjB3E,OAAO,EAAE0E,kBAAE,CAACG,OAAO,CAACC,uBAAe,CAACC,UAAU,CAAC;EAC/C9E,KAAK,EAAEqE,oBAAoB,CAACU,SAAS,CAACD,UAAU;EAChD7E,KAAK,EAAEwE,kBAAE,CAACO;AACZ,CAAC;AAEDrF,kBAAkB,CAACsF,YAAY,GAAG;EAChCrF,MAAM,EAAEkB,SAAS;EACjBjB,KAAK,EAAEiB,SAAS;EAChBhB,QAAQ,EAAEgB,SAAS;EACnBf,OAAO,EAAE,EAAE;EACXE,KAAK,EAAEa;AACT,CAAC;AAAC,IAAAoE,QAAA,GAAAC,OAAA,CAAAvG,OAAA,GAEayF,oBAAoB","ignoreList":[]}
@@ -22,7 +22,20 @@ Object.defineProperty(exports, "Switch", {
22
22
  return _Switch.default;
23
23
  }
24
24
  });
25
+ Object.defineProperty(exports, "optionValidator", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _common.optionValidator;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "optionsValidator", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _common.optionsValidator;
35
+ }
36
+ });
25
37
  var _CustomDropdown = _interopRequireDefault(require("./CustomDropdown"));
26
38
  var _NativeDropdown = _interopRequireDefault(require("./NativeDropdown"));
27
39
  var _Switch = _interopRequireDefault(require("./Switch"));
40
+ var _common = require("./common");
28
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_CustomDropdown","_interopRequireDefault","require","_NativeDropdown","_Switch"],"sources":["../../../../../src/shared/components/selectors/index.ts"],"sourcesContent":["export { default as CustomDropdown } from './CustomDropdown';\nexport { default as Dropdown } from './NativeDropdown';\nexport { default as Switch } from './Switch';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_CustomDropdown","_interopRequireDefault","require","_NativeDropdown","_Switch","_common"],"sources":["../../../../../src/shared/components/selectors/index.ts"],"sourcesContent":["export { default as CustomDropdown } from './CustomDropdown';\nexport { default as Dropdown } from './NativeDropdown';\nexport { default as Switch } from './Switch';\n\nexport {\n type OptionT,\n type OptionsT,\n optionValidator,\n optionsValidator,\n} from './common';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA","ignoreList":[]}
@@ -46,7 +46,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
46
46
  \**********************/
47
47
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
48
48
 
49
- eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Button; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Checkbox; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Dropdown; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ GlobalStateProvider: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.GlobalStateProvider; },\n/* harmony export */ Input: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Input; },\n/* harmony export */ JU: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.JU; },\n/* harmony export */ Link: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Link; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.MetaTags; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Modal; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.NavLink; },\n/* harmony export */ PT: function() { return /* reexport module object */ prop_types__WEBPACK_IMPORTED_MODULE_3__; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.PageLayout; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.TextArea; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Throbber; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.WithTooltip; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.YouTubeVideo; },\n/* harmony export */ api: function() { return /* reexport default from dynamic */ axios__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ client: function() { return /* binding */ client; },\n/* harmony export */ config: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ getGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getGlobalState; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ newAsyncDataEnvelope: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.newAsyncDataEnvelope; },\n/* harmony export */ server: function() { return /* binding */ server; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ themed: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ useAsyncCollection: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncCollection; },\n/* harmony export */ useAsyncData: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncData; },\n/* harmony export */ useGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState; },\n/* harmony export */ webpack: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ withGlobalStateType: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.withGlobalStateType; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.ts\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"axios\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.ts\");\n\n\nconst server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\nconst client = server ? undefined : (__webpack_require__(/*! ./client */ \"./src/client/index.tsx\")[\"default\"]);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.ts?");
49
+ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Button; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Checkbox; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Dropdown; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ GlobalStateProvider: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.GlobalStateProvider; },\n/* harmony export */ Input: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Input; },\n/* harmony export */ JU: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.JU; },\n/* harmony export */ Link: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Link; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.MetaTags; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Modal; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.NavLink; },\n/* harmony export */ PT: function() { return /* reexport module object */ prop_types__WEBPACK_IMPORTED_MODULE_3__; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.PageLayout; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.TextArea; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Throbber; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.WithTooltip; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.YouTubeVideo; },\n/* harmony export */ api: function() { return /* reexport default from dynamic */ axios__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ client: function() { return /* binding */ client; },\n/* harmony export */ config: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ getGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getGlobalState; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ newAsyncDataEnvelope: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.newAsyncDataEnvelope; },\n/* harmony export */ optionValidator: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.optionValidator; },\n/* harmony export */ optionsValidator: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.optionsValidator; },\n/* harmony export */ server: function() { return /* binding */ server; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ themed: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ useAsyncCollection: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncCollection; },\n/* harmony export */ useAsyncData: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncData; },\n/* harmony export */ useGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState; },\n/* harmony export */ webpack: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ withGlobalStateType: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.withGlobalStateType; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.ts\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"axios\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.ts\");\n\n\nconst server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\nconst client = server ? undefined : (__webpack_require__(/*! ./client */ \"./src/client/index.tsx\")[\"default\"]);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.ts?");
50
50
 
51
51
  /***/ }),
52
52
 
@@ -196,7 +196,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prop
196
196
  \****************************************/
197
197
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
198
198
 
199
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _Button__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _Checkbox__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.Dropdown; },\n/* harmony export */ Input: function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ Link: function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _TextArea__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectors */ \"./src/shared/components/selectors/index.ts\");\n/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Button */ \"./src/shared/components/Button/index.tsx\");\n/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Checkbox */ \"./src/shared/components/Checkbox/index.tsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.tsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.tsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.tsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.tsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.tsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.tsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.tsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./YouTubeVideo */ \"./src/shared/components/YouTubeVideo/index.tsx\");\n/* harmony import */ var _TextArea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./TextArea */ \"./src/shared/components/TextArea/index.tsx\");\n/**\n * Just an aggregation of all exported components into a single module.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/index.ts?");
199
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _Button__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _Checkbox__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.Dropdown; },\n/* harmony export */ Input: function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ Link: function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _TextArea__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ optionValidator: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.optionValidator; },\n/* harmony export */ optionsValidator: function() { return /* reexport safe */ _selectors__WEBPACK_IMPORTED_MODULE_0__.optionsValidator; }\n/* harmony export */ });\n/* harmony import */ var _selectors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selectors */ \"./src/shared/components/selectors/index.ts\");\n/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Button */ \"./src/shared/components/Button/index.tsx\");\n/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Checkbox */ \"./src/shared/components/Checkbox/index.tsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.tsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.tsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.tsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.tsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.tsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.tsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.tsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./YouTubeVideo */ \"./src/shared/components/YouTubeVideo/index.tsx\");\n/* harmony import */ var _TextArea__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./TextArea */ \"./src/shared/components/TextArea/index.tsx\");\n/**\n * Just an aggregation of all exported components into a single module.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/index.ts?");
200
200
 
201
201
  /***/ }),
202
202
 
@@ -206,7 +206,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
206
206
  \**************************************************************************/
207
207
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
208
208
 
209
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ areEqual: function() { return /* binding */ areEqual; }\n/* harmony export */ });\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/selectors/CustomDropdown/Options/style.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\nfunction areEqual(a, b) {\n return (a === null || a === void 0 ? void 0 : a.left) === (b === null || b === void 0 ? void 0 : b.left) && (a === null || a === void 0 ? void 0 : a.top) === (b === null || b === void 0 ? void 0 : b.top) && (a === null || a === void 0 ? void 0 : a.width) === (b === null || b === void 0 ? void 0 : b.width);\n}\nconst Options = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((_ref, ref) => {\n let {\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options\n } = _ref;\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(ref, () => ({\n measure: () => {\n var _opsRef$current;\n return (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.getBoundingClientRect();\n }\n }), []);\n const optionNodes = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_4__.optionValueName)(option);\n optionNodes.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: optionClass,\n onClick: () => onChange(iValue),\n onKeyDown: e => {\n if (e.key === 'Enter') {\n onChange(iValue);\n }\n },\n role: \"button\",\n tabIndex: 0,\n children: iName\n }, iValue));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Modal__WEBPACK_IMPORTED_MODULE_2__.BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n , {\n cancelOnScrolling: true,\n containerStyle: containerStyle,\n dontDisableScrolling: true,\n onCancel: onCancel,\n theme: {\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: _style_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"].overlay\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n ref: opsRef,\n children: optionNodes\n })\n });\n});\nOptions.propTypes = {\n containerClass: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,\n containerStyle: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({\n left: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,\n top: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,\n width: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired\n }),\n filter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),\n onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,\n onChange: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,\n optionClass: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,\n options: _common__WEBPACK_IMPORTED_MODULE_4__.optionsValidator.isRequired\n};\nOptions.defaultProps = {\n containerStyle: undefined,\n filter: undefined\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Options);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/index.tsx?");
209
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ areEqual: function() { return /* binding */ areEqual; }\n/* harmony export */ });\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/selectors/CustomDropdown/Options/style.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\nfunction areEqual(a, b) {\n return (a === null || a === void 0 ? void 0 : a.left) === (b === null || b === void 0 ? void 0 : b.left) && (a === null || a === void 0 ? void 0 : a.top) === (b === null || b === void 0 ? void 0 : b.top) && (a === null || a === void 0 ? void 0 : a.width) === (b === null || b === void 0 ? void 0 : b.width);\n}\nconst Options = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((_ref, ref) => {\n let {\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options\n } = _ref;\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(ref, () => ({\n measure: () => {\n var _opsRef$current, _opsRef$current2;\n const e = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.parentElement;\n if (!e) return undefined;\n const rect = (_opsRef$current2 = opsRef.current) === null || _opsRef$current2 === void 0 ? void 0 : _opsRef$current2.getBoundingClientRect();\n const style = window.getComputedStyle(e);\n const mBottom = parseFloat(style.marginBottom);\n const mTop = parseFloat(style.marginTop);\n rect.height += mBottom + mTop;\n return rect;\n }\n }), []);\n const optionNodes = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_4__.optionValueName)(option);\n optionNodes.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: optionClass,\n onClick: e => {\n onChange(iValue);\n e.stopPropagation();\n },\n onKeyDown: e => {\n if (e.key === 'Enter') {\n onChange(iValue);\n e.stopPropagation();\n }\n },\n role: \"button\",\n tabIndex: 0,\n children: iName\n }, iValue));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Modal__WEBPACK_IMPORTED_MODULE_2__.BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n , {\n cancelOnScrolling: true,\n containerStyle: containerStyle,\n dontDisableScrolling: true,\n onCancel: onCancel,\n theme: {\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: _style_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"].overlay\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n ref: opsRef,\n children: optionNodes\n })\n });\n});\nOptions.propTypes = {\n containerClass: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,\n containerStyle: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({\n left: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,\n top: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,\n width: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired\n }),\n filter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),\n onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,\n onChange: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,\n optionClass: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,\n options: _common__WEBPACK_IMPORTED_MODULE_4__.optionsValidator.isRequired\n};\nOptions.defaultProps = {\n containerStyle: undefined,\n filter: undefined\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Options);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/index.tsx?");
210
210
 
211
211
  /***/ }),
212
212
 
@@ -216,7 +216,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
216
216
  \******************************************************************/
217
217
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
218
218
 
219
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options */ \"./src/shared/components/selectors/CustomDropdown/Options/index.tsx\");\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/CustomDropdown/theme.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\n\nconst BaseCustomDropdown = _ref => {\n let {\n filter,\n label,\n onChange,\n options,\n theme,\n value\n } = _ref;\n if (!options) throw Error('Internal error');\n const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n const dropdownRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n const [opsPos, setOpsPos] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();\n const [upward, setUpward] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {\n if (!active) return undefined;\n let id;\n const cb = () => {\n var _dropdownRef$current, _opsRef$current;\n const anchor = (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect();\n const opsRect = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.measure();\n if (anchor && opsRect) {\n var _window$visualViewpor, _window$visualViewpor2;\n const fitsDown = anchor.bottom + opsRect.height < ((_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 ? void 0 : _window$visualViewpor2.height) !== null && _window$visualViewpor !== void 0 ? _window$visualViewpor : 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n const up = !fitsDown && fitsUp;\n setUpward(up);\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width\n };\n setOpsPos(now => (0,_Options__WEBPACK_IMPORTED_MODULE_3__.areEqual)(now, pos) ? now : pos);\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n const openList = () => {\n const view = window.visualViewport;\n const rect = dropdownRef.current.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: (view === null || view === void 0 ? void 0 : view.width) || 0,\n top: (view === null || view === void 0 ? void 0 : view.height) || 0,\n width: rect.width\n });\n };\n let selected = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {\n children: \"\\u200C\"\n });\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_5__.optionValueName)(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(\"div\", {\n className: containerClassName,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(\"div\", {\n className: theme.dropdown,\n onClick: openList,\n onKeyDown: e => {\n if (e.key === 'Enter') openList();\n },\n ref: dropdownRef,\n role: \"listbox\",\n tabIndex: 0,\n children: [selected, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(\"div\", {\n className: theme.arrow\n })]\n }), active ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Options__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n containerClass: opsContainerClass,\n containerStyle: opsPos,\n onCancel: () => {\n setActive(false);\n },\n onChange: newValue => {\n setActive(false);\n if (onChange) onChange(newValue);\n },\n optionClass: theme.option || '',\n options: options,\n ref: opsRef\n }) : null]\n });\n};\nconst ThemedCustomDropdown = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default()(BaseCustomDropdown, 'CustomDropdown', _common__WEBPACK_IMPORTED_MODULE_5__.validThemeKeys, _theme_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\nBaseCustomDropdown.propTypes = {\n filter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),\n label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),\n onChange: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),\n options: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf(_common__WEBPACK_IMPORTED_MODULE_5__.optionValidator.isRequired),\n theme: ThemedCustomDropdown.themeType.isRequired,\n value: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)\n};\nBaseCustomDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ThemedCustomDropdown);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/index.tsx?");
219
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options */ \"./src/shared/components/selectors/CustomDropdown/Options/index.tsx\");\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/CustomDropdown/theme.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\n\nconst BaseCustomDropdown = _ref => {\n let {\n filter,\n label,\n onChange,\n options,\n theme,\n value\n } = _ref;\n if (!options) throw Error('Internal error');\n const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n const dropdownRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n const [opsPos, setOpsPos] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();\n const [upward, setUpward] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {\n if (!active) return undefined;\n let id;\n const cb = () => {\n var _dropdownRef$current, _opsRef$current;\n const anchor = (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect();\n const opsRect = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.measure();\n if (anchor && opsRect) {\n var _window$visualViewpor, _window$visualViewpor2;\n const fitsDown = anchor.bottom + opsRect.height < ((_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 ? void 0 : _window$visualViewpor2.height) !== null && _window$visualViewpor !== void 0 ? _window$visualViewpor : 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n const up = !fitsDown && fitsUp;\n setUpward(up);\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width\n };\n setOpsPos(now => (0,_Options__WEBPACK_IMPORTED_MODULE_3__.areEqual)(now, pos) ? now : pos);\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n const openList = e => {\n const view = window.visualViewport;\n const rect = dropdownRef.current.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: (view === null || view === void 0 ? void 0 : view.width) || 0,\n top: (view === null || view === void 0 ? void 0 : view.height) || 0,\n width: rect.width\n });\n e.stopPropagation();\n };\n let selected = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.Fragment, {\n children: \"\\u200C\"\n });\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_5__.optionValueName)(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(\"div\", {\n className: containerClassName,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(\"div\", {\n className: theme.dropdown,\n onClick: openList,\n onKeyDown: e => {\n if (e.key === 'Enter') openList(e);\n },\n ref: dropdownRef,\n role: \"listbox\",\n tabIndex: 0,\n children: [selected, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(\"div\", {\n className: theme.arrow\n })]\n }), active ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Options__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n containerClass: opsContainerClass,\n containerStyle: opsPos,\n onCancel: () => {\n setActive(false);\n },\n onChange: newValue => {\n setActive(false);\n if (onChange) onChange(newValue);\n },\n optionClass: theme.option || '',\n options: options,\n ref: opsRef\n }) : null]\n });\n};\nconst ThemedCustomDropdown = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default()(BaseCustomDropdown, 'CustomDropdown', _common__WEBPACK_IMPORTED_MODULE_5__.validThemeKeys, _theme_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\nBaseCustomDropdown.propTypes = {\n filter: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),\n label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),\n onChange: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),\n options: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf(_common__WEBPACK_IMPORTED_MODULE_5__.optionValidator.isRequired),\n theme: ThemedCustomDropdown.themeType.isRequired,\n value: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)\n};\nBaseCustomDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ThemedCustomDropdown);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/index.tsx?");
220
220
 
221
221
  /***/ }),
222
222
 
@@ -256,7 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
256
256
  \**************************************************/
257
257
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
258
258
 
259
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _CustomDropdown__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _NativeDropdown__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _Switch__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _CustomDropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CustomDropdown */ \"./src/shared/components/selectors/CustomDropdown/index.tsx\");\n/* harmony import */ var _NativeDropdown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NativeDropdown */ \"./src/shared/components/selectors/NativeDropdown/index.tsx\");\n/* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Switch */ \"./src/shared/components/selectors/Switch/index.tsx\");\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/index.ts?");
259
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _CustomDropdown__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _NativeDropdown__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _Switch__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ optionValidator: function() { return /* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_3__.optionValidator; },\n/* harmony export */ optionsValidator: function() { return /* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_3__.optionsValidator; }\n/* harmony export */ });\n/* harmony import */ var _CustomDropdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CustomDropdown */ \"./src/shared/components/selectors/CustomDropdown/index.tsx\");\n/* harmony import */ var _NativeDropdown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NativeDropdown */ \"./src/shared/components/selectors/NativeDropdown/index.tsx\");\n/* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Switch */ \"./src/shared/components/selectors/Switch/index.tsx\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common */ \"./src/shared/components/selectors/common.ts\");\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/index.ts?");
260
260
 
261
261
  /***/ }),
262
262
 
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.areEqual=areEqual;exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _Modal=require("../../../Modal");var _common=require("../../common");var _jsxRuntime=require("react/jsx-runtime");const S={"overlay":"jKsMKG"};function areEqual(a,b){return a?.left===b?.left&&a?.top===b?.top&&a?.width===b?.width}const Options=/*#__PURE__*/(0,_react.forwardRef)(({containerClass,containerStyle,filter,onCancel,onChange,optionClass,options},ref)=>{const opsRef=(0,_react.useRef)(null);(0,_react.useImperativeHandle)(ref,()=>({measure:()=>opsRef.current?.getBoundingClientRect()}),[]);const optionNodes=[];for(let i=0;i<options.length;++i){const option=options[i];if(!filter||filter(option)){const[iValue,iName]=(0,_common.optionValueName)(option);optionNodes.push(/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:optionClass,onClick:()=>onChange(iValue),onKeyDown:e=>{if(e.key==="Enter"){onChange(iValue)}},role:"button",tabIndex:0,children:iName},iValue))}}return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Modal.BaseModal// Closes the dropdown (cancels the selection) on any page scrolling attempt.
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.areEqual=areEqual;exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _Modal=require("../../../Modal");var _common=require("../../common");var _jsxRuntime=require("react/jsx-runtime");const S={"overlay":"jKsMKG"};function areEqual(a,b){return a?.left===b?.left&&a?.top===b?.top&&a?.width===b?.width}const Options=/*#__PURE__*/(0,_react.forwardRef)(({containerClass,containerStyle,filter,onCancel,onChange,optionClass,options},ref)=>{const opsRef=(0,_react.useRef)(null);(0,_react.useImperativeHandle)(ref,()=>({measure:()=>{const e=opsRef.current?.parentElement;if(!e)return undefined;const rect=opsRef.current?.getBoundingClientRect();const style=window.getComputedStyle(e);const mBottom=parseFloat(style.marginBottom);const mTop=parseFloat(style.marginTop);rect.height+=mBottom+mTop;return rect}}),[]);const optionNodes=[];for(let i=0;i<options.length;++i){const option=options[i];if(!filter||filter(option)){const[iValue,iName]=(0,_common.optionValueName)(option);optionNodes.push(/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:optionClass,onClick:e=>{onChange(iValue);e.stopPropagation()},onKeyDown:e=>{if(e.key==="Enter"){onChange(iValue);e.stopPropagation()}},role:"button",tabIndex:0,children:iName},iValue))}}return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Modal.BaseModal// Closes the dropdown (cancels the selection) on any page scrolling attempt.
2
2
  // This is the same native <select> elements do on scrolling, and at least for
3
3
  // now we have no reason to deal with complications needed to support open
4
4
  // dropdowns during the scrolling (that would need to re-position it in
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_Modal","_common","_jsxRuntime","S","areEqual","a","b","left","top","width","Options","forwardRef","containerClass","containerStyle","filter","onCancel","onChange","optionClass","options","ref","opsRef","useRef","useImperativeHandle","measure","current","getBoundingClientRect","optionNodes","i","length","option","iValue","iName","optionValueName","push","jsx","className","onClick","onKeyDown","e","key","role","tabIndex","children","BaseModal","cancelOnScrolling","dontDisableScrolling","theme","ad","hoc","container","context","overlay","propTypes","PT","string","isRequired","shape","number","func","optionsValidator","defaultProps","undefined","_default","exports","default"],"sources":["../../../../../../../src/shared/components/selectors/CustomDropdown/Options/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport { BaseModal } from 'components/Modal';\n\nimport S from './style.scss';\n\nimport {\n type OptionT,\n type OptionsT,\n optionsValidator,\n optionValueName,\n} from '../../common';\n\nexport type ContainerPosT = {\n left: number;\n top: number;\n width: number;\n};\n\nexport function areEqual(a?: ContainerPosT, b?: ContainerPosT): boolean {\n return a?.left === b?.left && a?.top === b?.top && a?.width === b?.width;\n}\n\nexport type RefT = {\n measure: () => DOMRect | undefined;\n};\n\ntype PropsT = {\n containerClass: string;\n containerStyle?: ContainerPosT;\n filter?: (item: OptionT<React.ReactNode> | string) => boolean;\n optionClass: string;\n options: OptionsT<React.ReactNode>;\n onCancel: () => void;\n onChange: (value: string) => void;\n};\n\nconst Options = forwardRef<RefT, PropsT>(({\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options,\n}, ref) => {\n const opsRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => ({\n measure: () => opsRef.current?.getBoundingClientRect(),\n }), []);\n\n const optionNodes: React.ReactNode[] = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n optionNodes.push(\n <div\n className={optionClass}\n onClick={() => onChange(iValue)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onChange(iValue);\n }\n }}\n key={iValue}\n role=\"button\"\n tabIndex={0}\n >\n {iName}\n </div>,\n );\n }\n }\n\n return (\n <BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n cancelOnScrolling\n containerStyle={containerStyle}\n dontDisableScrolling\n onCancel={onCancel}\n theme={{\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: S.overlay,\n }}\n >\n <div ref={opsRef}>{optionNodes}</div>\n </BaseModal>\n );\n});\n\nOptions.propTypes = {\n containerClass: PT.string.isRequired,\n\n containerStyle: PT.shape({\n left: PT.number.isRequired,\n top: PT.number.isRequired,\n width: PT.number.isRequired,\n }),\n\n filter: PT.func,\n onCancel: PT.func.isRequired,\n onChange: PT.func.isRequired,\n optionClass: PT.string.isRequired,\n options: optionsValidator.isRequired,\n};\n\nOptions.defaultProps = {\n containerStyle: undefined,\n filter: undefined,\n};\n\nexport default Options;\n"],"mappings":"0MAAA,IAAAA,UAAA,CAAAC,sBAAA,CAAAC,OAAA,gBACA,IAAAC,MAAA,CAAAD,OAAA,UAEA,IAAAE,MAAA,CAAAF,OAAA,mBAIA,IAAAG,OAAA,CAAAH,OAAA,iBAKsB,IAAAI,WAAA,CAAAJ,OAAA,4BAAAK,CAAA,sBAQf,QAAS,C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MAAM,CAAE+C,SACV,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEatD,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_Modal","_common","_jsxRuntime","S","areEqual","a","b","left","top","width","Options","forwardRef","containerClass","containerStyle","filter","onCancel","onChange","optionClass","options","ref","opsRef","useRef","useImperativeHandle","measure","e","current","parentElement","undefined","rect","getBoundingClientRect","style","window","getComputedStyle","mBottom","parseFloat","marginBottom","mTop","marginTop","height","optionNodes","i","length","option","iValue","iName","optionValueName","push","jsx","className","onClick","stopPropagation","onKeyDown","key","role","tabIndex","children","BaseModal","cancelOnScrolling","dontDisableScrolling","theme","ad","hoc","container","context","overlay","propTypes","PT","string","isRequired","shape","number","func","optionsValidator","defaultProps","_default","exports","default"],"sources":["../../../../../../../src/shared/components/selectors/CustomDropdown/Options/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\n\nimport { BaseModal } from 'components/Modal';\n\nimport S from './style.scss';\n\nimport {\n type OptionT,\n type OptionsT,\n optionsValidator,\n optionValueName,\n} from '../../common';\n\nexport type ContainerPosT = {\n left: number;\n top: number;\n width: number;\n};\n\nexport function areEqual(a?: ContainerPosT, b?: ContainerPosT): boolean {\n return a?.left === b?.left && a?.top === b?.top && a?.width === b?.width;\n}\n\nexport type RefT = {\n measure: () => DOMRect | undefined;\n};\n\ntype PropsT = {\n containerClass: string;\n containerStyle?: ContainerPosT;\n filter?: (item: OptionT<React.ReactNode> | string) => boolean;\n optionClass: string;\n options: OptionsT<React.ReactNode>;\n onCancel: () => void;\n onChange: (value: string) => void;\n};\n\nconst Options = forwardRef<RefT, PropsT>(({\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options,\n}, ref) => {\n const opsRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(ref, () => ({\n measure: () => {\n const e = opsRef.current?.parentElement;\n if (!e) return undefined;\n\n const rect = opsRef.current?.getBoundingClientRect();\n const style = window.getComputedStyle(e);\n const mBottom = parseFloat(style.marginBottom);\n const mTop = parseFloat(style.marginTop);\n\n rect.height += mBottom + mTop;\n\n return rect;\n },\n }), []);\n\n const optionNodes: React.ReactNode[] = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n optionNodes.push(\n <div\n className={optionClass}\n onClick={(e) => {\n onChange(iValue);\n e.stopPropagation();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onChange(iValue);\n e.stopPropagation();\n }\n }}\n key={iValue}\n role=\"button\"\n tabIndex={0}\n >\n {iName}\n </div>,\n );\n }\n }\n\n return (\n <BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n cancelOnScrolling\n containerStyle={containerStyle}\n dontDisableScrolling\n onCancel={onCancel}\n theme={{\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: S.overlay,\n }}\n >\n <div ref={opsRef}>{optionNodes}</div>\n </BaseModal>\n );\n});\n\nOptions.propTypes = {\n containerClass: PT.string.isRequired,\n\n containerStyle: PT.shape({\n left: PT.number.isRequired,\n top: PT.number.isRequired,\n width: PT.number.isRequired,\n }),\n\n filter: PT.func,\n onCancel: PT.func.isRequired,\n onChange: PT.func.isRequired,\n optionClass: PT.string.isRequired,\n options: optionsValidator.isRequired,\n};\n\nOptions.defaultProps = {\n containerStyle: undefined,\n filter: undefined,\n};\n\nexport default Options;\n"],"mappings":"0MAAA,IAAAA,UAAA,CAAAC,sBAAA,CAAAC,OAAA,gBACA,IAAAC,MAAA,CAAAD,OAAA,UAEA,IAAAE,MAAA,CAAAF,OAAA,mBAIA,IAAAG,OAAA,CAAAH,OAAA,iBAKsB,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ClBrD,cAAc,CAAEsD,kBAAE,CAACC,MAAM,CAACC,UAAU,CAEpCvD,cAAc,CAAEqD,kBAAE,CAACG,KAAK,CAAC,CACvB9D,IAAI,CAAE2D,kBAAE,CAACI,MAAM,CAACF,UAAU,CAC1B5D,GAAG,CAAE0D,kBAAE,CAACI,MAAM,CAACF,UAAU,CACzB3D,KAAK,CAAEyD,kBAAE,CAACI,MAAM,CAACF,UACnB,CAAC,CAAC,CAEFtD,MAAM,CAAEoD,kBAAE,CAACK,IAAI,CACfxD,QAAQ,CAAEmD,kBAAE,CAACK,IAAI,CAACH,UAAU,CAC5BpD,QAAQ,CAAEkD,kBAAE,CAACK,IAAI,CAACH,UAAU,CAC5BnD,WAAW,CAAEiD,kBAAE,CAACC,MAAM,CAACC,UAAU,CACjClD,OAAO,CAAEsD,wBAAgB,CAACJ,UAC5B,CAAC,CAED1D,OAAO,CAAC+D,YAAY,CAAG,CACrB5D,cAAc,CAAEc,SAAS,CACzBb,MAAM,CAAEa,SACV,CAAC,CAAC,IAAA+C,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEalE,OAAO","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _Options=_interopRequireWildcard(require("./Options"));var _common=require("../common");var _jsxRuntime=require("react/jsx-runtime");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}const defaultTheme={"context":"_9Tod5r","ad":"R58zIg","hoc":"O-Tp1i","container":"oQKv0Y","label":"YUPUNs","dropdown":"pNEyAA","option":"LD2Kzy","select":"LP5azC","arrow":"-wscve","active":"k2UDsV","upward":"HWRvu4"};const BaseCustomDropdown=({filter,label,onChange,options,theme,value})=>{if(!options)throw Error("Internal error");const[active,setActive]=(0,_react.useState)(false);const dropdownRef=(0,_react.useRef)(null);const opsRef=(0,_react.useRef)(null);const[opsPos,setOpsPos]=(0,_react.useState)();const[upward,setUpward]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(!active)return undefined;let id;const cb=()=>{const anchor=dropdownRef.current?.getBoundingClientRect();const opsRect=opsRef.current?.measure();if(anchor&&opsRect){const fitsDown=anchor.bottom+opsRect.height<(window.visualViewport?.height??0);const fitsUp=anchor.top-opsRect.height>0;const up=!fitsDown&&fitsUp;setUpward(up);const pos=up?{top:anchor.top-opsRect.height-1,left:anchor.left,width:anchor.width}:{left:anchor.left,top:anchor.bottom,width:anchor.width};setOpsPos(now=>(0,_Options.areEqual)(now,pos)?now:pos)}id=requestAnimationFrame(cb)};requestAnimationFrame(cb);return()=>{cancelAnimationFrame(id)}},[active]);const openList=()=>{const view=window.visualViewport;const rect=dropdownRef.current.getBoundingClientRect();setActive(true);// NOTE: This first opens the dropdown off-screen, where it is measured
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _Options=_interopRequireWildcard(require("./Options"));var _common=require("../common");var _jsxRuntime=require("react/jsx-runtime");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}const defaultTheme={"context":"_9Tod5r","ad":"R58zIg","hoc":"O-Tp1i","container":"oQKv0Y","label":"YUPUNs","dropdown":"pNEyAA","option":"LD2Kzy","select":"LP5azC","arrow":"-wscve","active":"k2UDsV","upward":"HWRvu4"};const BaseCustomDropdown=({filter,label,onChange,options,theme,value})=>{if(!options)throw Error("Internal error");const[active,setActive]=(0,_react.useState)(false);const dropdownRef=(0,_react.useRef)(null);const opsRef=(0,_react.useRef)(null);const[opsPos,setOpsPos]=(0,_react.useState)();const[upward,setUpward]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(!active)return undefined;let id;const cb=()=>{const anchor=dropdownRef.current?.getBoundingClientRect();const opsRect=opsRef.current?.measure();if(anchor&&opsRect){const fitsDown=anchor.bottom+opsRect.height<(window.visualViewport?.height??0);const fitsUp=anchor.top-opsRect.height>0;const up=!fitsDown&&fitsUp;setUpward(up);const pos=up?{top:anchor.top-opsRect.height-1,left:anchor.left,width:anchor.width}:{left:anchor.left,top:anchor.bottom,width:anchor.width};setOpsPos(now=>(0,_Options.areEqual)(now,pos)?now:pos)}id=requestAnimationFrame(cb)};requestAnimationFrame(cb);return()=>{cancelAnimationFrame(id)}},[active]);const openList=e=>{const view=window.visualViewport;const rect=dropdownRef.current.getBoundingClientRect();setActive(true);// NOTE: This first opens the dropdown off-screen, where it is measured
2
2
  // by an effect declared above, and then positioned below, or above
3
3
  // the original dropdown element, depending where it fits best
4
4
  // (if we first open it downward, it would flick if we immediately
5
5
  // move it above, at least with the current position update via local
6
6
  // react state, and not imperatively).
7
- setOpsPos({left:view?.width||0,top:view?.height||0,width:rect.width})};let selected=/*#__PURE__*/(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:"\u200C"});for(let i=0;i<options.length;++i){const option=options[i];if(!filter||filter(option)){const[iValue,iName]=(0,_common.optionValueName)(option);if(iValue===value){selected=iName;break}}}let containerClassName=theme.container;if(active)containerClassName+=` ${theme.active}`;let opsContainerClass=theme.select||"";if(upward){containerClassName+=` ${theme.upward}`;opsContainerClass+=` ${theme.upward}`}return/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:containerClassName,children:[label===undefined?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:theme.label,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:theme.dropdown,onClick:openList,onKeyDown:e=>{if(e.key==="Enter")openList()},ref:dropdownRef,role:"listbox",tabIndex:0,children:[selected,/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:theme.arrow})]}),active?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Options.default,{containerClass:opsContainerClass,containerStyle:opsPos,onCancel:()=>{setActive(false)},onChange:newValue=>{setActive(false);if(onChange)onChange(newValue)},optionClass:theme.option||"",options:options,ref:opsRef}):null]})};const ThemedCustomDropdown=(0,_reactThemes.default)(BaseCustomDropdown,"CustomDropdown",_common.validThemeKeys,defaultTheme);BaseCustomDropdown.propTypes={filter:_propTypes.default.func,label:_propTypes.default.node,onChange:_propTypes.default.func,options:_propTypes.default.arrayOf(_common.optionValidator.isRequired),theme:ThemedCustomDropdown.themeType.isRequired,value:_propTypes.default.string};BaseCustomDropdown.defaultProps={filter:undefined,label:undefined,onChange:undefined,options:[],value:undefined};var _default=exports.default=ThemedCustomDropdown;
7
+ setOpsPos({left:view?.width||0,top:view?.height||0,width:rect.width});e.stopPropagation()};let selected=/*#__PURE__*/(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:"\u200C"});for(let i=0;i<options.length;++i){const option=options[i];if(!filter||filter(option)){const[iValue,iName]=(0,_common.optionValueName)(option);if(iValue===value){selected=iName;break}}}let containerClassName=theme.container;if(active)containerClassName+=` ${theme.active}`;let opsContainerClass=theme.select||"";if(upward){containerClassName+=` ${theme.upward}`;opsContainerClass+=` ${theme.upward}`}return/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:containerClassName,children:[label===undefined?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:theme.label,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:theme.dropdown,onClick:openList,onKeyDown:e=>{if(e.key==="Enter")openList(e)},ref:dropdownRef,role:"listbox",tabIndex:0,children:[selected,/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:theme.arrow})]}),active?/*#__PURE__*/(0,_jsxRuntime.jsx)(_Options.default,{containerClass:opsContainerClass,containerStyle:opsPos,onCancel:()=>{setActive(false)},onChange:newValue=>{setActive(false);if(onChange)onChange(newValue)},optionClass:theme.option||"",options:options,ref:opsRef}):null]})};const ThemedCustomDropdown=(0,_reactThemes.default)(BaseCustomDropdown,"CustomDropdown",_common.validThemeKeys,defaultTheme);BaseCustomDropdown.propTypes={filter:_propTypes.default.func,label:_propTypes.default.node,onChange:_propTypes.default.func,options:_propTypes.default.arrayOf(_common.optionValidator.isRequired),theme:ThemedCustomDropdown.themeType.isRequired,value:_propTypes.default.string};BaseCustomDropdown.defaultProps={filter:undefined,label:undefined,onChange:undefined,options:[],value:undefined};var _default=exports.default=ThemedCustomDropdown;
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_reactThemes","_Options","_interopRequireWildcard","_common","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultTheme","BaseCustomDropdown","filter","label","onChange","options","theme","value","Error","active","setActive","useState","dropdownRef","useRef","opsRef","opsPos","setOpsPos","upward","setUpward","useEffect","undefined","id","cb","anchor","current","getBoundingClientRect","opsRect","measure","fitsDown","bottom","height","window","visualViewport","fitsUp","top","up","pos","left","width","now","areEqual","requestAnimationFrame","cancelAnimationFrame","openList","view","rect","selected","jsx","Fragment","children","length","option","iValue","iName","optionValueName","containerClassName","container","opsContainerClass","select","jsxs","className","dropdown","onClick","onKeyDown","key","ref","role","tabIndex","arrow","containerClass","containerStyle","onCancel","newValue","optionClass","ThemedCustomDropdown","themed","validThemeKeys","propTypes","PT","func","node","arrayOf","optionValidator","isRequired","themeType","string","defaultProps","_default","exports"],"sources":["../../../../../../src/shared/components/selectors/CustomDropdown/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { useEffect, useRef, useState } from 'react';\n\nimport themed from '@dr.pogodin/react-themes';\n\nimport Options, { type ContainerPosT, type RefT, areEqual } from './Options';\n\nimport defaultTheme from './theme.scss';\n\nimport {\n type PropsT,\n optionValidator,\n optionValueName,\n validThemeKeys,\n} from '../common';\n\nconst BaseCustomDropdown: React.FunctionComponent<\nPropsT<React.ReactNode, (value: string) => void>\n> = ({\n filter,\n label,\n onChange,\n options,\n theme,\n value,\n}) => {\n if (!options) throw Error('Internal error');\n\n const [active, setActive] = useState(false);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const opsRef = useRef<RefT>(null);\n\n const [opsPos, setOpsPos] = useState<ContainerPosT>();\n const [upward, setUpward] = useState(false);\n\n useEffect(() => {\n if (!active) return undefined;\n\n let id: number;\n const cb = () => {\n const anchor = dropdownRef.current?.getBoundingClientRect();\n const opsRect = opsRef.current?.measure();\n if (anchor && opsRect) {\n const fitsDown = anchor.bottom + opsRect.height\n < (window.visualViewport?.height ?? 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n\n const up = !fitsDown && fitsUp;\n setUpward(up);\n\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width,\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width,\n };\n\n setOpsPos((now) => (areEqual(now, pos) ? now : pos));\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n\n const openList = () => {\n const view = window.visualViewport;\n const rect = dropdownRef.current!.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: view?.width || 0,\n top: view?.height || 0,\n width: rect.width,\n });\n };\n\n let selected: React.ReactNode = <>&zwnj;</>;\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n\n return (\n <div className={containerClassName}>\n {label === undefined ? null : (\n <div className={theme.label}>{label}</div>\n )}\n <div\n className={theme.dropdown}\n onClick={openList}\n onKeyDown={(e) => {\n if (e.key === 'Enter') openList();\n }}\n ref={dropdownRef}\n role=\"listbox\"\n tabIndex={0}\n >\n {selected}\n <div className={theme.arrow} />\n </div>\n {\n active ? (\n <Options\n containerClass={opsContainerClass}\n containerStyle={opsPos}\n onCancel={() => {\n setActive(false);\n }}\n onChange={(newValue) => {\n setActive(false);\n if (onChange) onChange(newValue);\n }}\n optionClass={theme.option || ''}\n options={options}\n ref={opsRef}\n />\n ) : null\n }\n </div>\n );\n};\n\nconst ThemedCustomDropdown = themed(\n BaseCustomDropdown,\n 'CustomDropdown',\n validThemeKeys,\n defaultTheme,\n);\n\nBaseCustomDropdown.propTypes = {\n filter: PT.func,\n label: PT.node,\n onChange: PT.func,\n options: PT.arrayOf(optionValidator.isRequired),\n theme: ThemedCustomDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nBaseCustomDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined,\n};\n\nexport default ThemedCustomDropdown;\n"],"mappings":"gLAAA,IAAAA,UAAA,CAAAC,sBAAA,CAAAC,OAAA,gBACA,IAAAC,MAAA,CAAAD,OAAA,UAEA,IAAAE,YAAA,CAAAH,sBAAA,CAAAC,OAAA,8BAEA,IAAAG,QAAA,CAAAC,uBAAA,CAAAJ,OAAA,eAIA,IAAAK,OAAA,CAAAL,OAAA,cAKmB,IAAAM,WAAA,CAAAN,OAAA,+BAAAO,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,CAAAE,CAAA,KAAAF,OAAA,QAAAF,wBAAA,SAAAA,CAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,GAAAF,CAAA,WAAAJ,wBAAAI,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,SAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,MAAAQ,CAAA,EAAAC,SAAA,OAAAC,CAAA,CAAAC,MAAA,CAAAC,cAAA,EAAAD,MAAA,CAAAE,wBAAA,SAAAC,CAAA,IAAAd,CAAA,gBAAAc,CAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,CAAA,OAAAG,C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5E,QAAQ,CAAE0E,kBAAE,CAACC,IAAI,CACjB1E,OAAO,CAAEyE,kBAAE,CAACG,OAAO,CAACC,uBAAe,CAACC,UAAU,CAAC,CAC/C7E,KAAK,CAAEoE,oBAAoB,CAACU,SAAS,CAACD,UAAU,CAChD5E,KAAK,CAAEuE,kBAAE,CAACO,MACZ,CAAC,CAEDpF,kBAAkB,CAACqF,YAAY,CAAG,CAChCpF,MAAM,CAAEkB,SAAS,CACjBjB,KAAK,CAAEiB,SAAS,CAChBhB,QAAQ,CAAEgB,SAAS,CACnBf,OAAO,CAAE,EAAE,CACXE,KAAK,CAAEa,SACT,CAAC,CAAC,IAAAmE,QAAA,CAAAC,OAAA,CAAAtG,OAAA,CAEawF,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_react","_reactThemes","_Options","_interopRequireWildcard","_common","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultTheme","BaseCustomDropdown","filter","label","onChange","options","theme","value","Error","active","setActive","useState","dropdownRef","useRef","opsRef","opsPos","setOpsPos","upward","setUpward","useEffect","undefined","id","cb","anchor","current","getBoundingClientRect","opsRect","measure","fitsDown","bottom","height","window","visualViewport","fitsUp","top","up","pos","left","width","now","areEqual","requestAnimationFrame","cancelAnimationFrame","openList","view","rect","stopPropagation","selected","jsx","Fragment","children","length","option","iValue","iName","optionValueName","containerClassName","container","opsContainerClass","select","jsxs","className","dropdown","onClick","onKeyDown","key","ref","role","tabIndex","arrow","containerClass","containerStyle","onCancel","newValue","optionClass","ThemedCustomDropdown","themed","validThemeKeys","propTypes","PT","func","node","arrayOf","optionValidator","isRequired","themeType","string","defaultProps","_default","exports"],"sources":["../../../../../../src/shared/components/selectors/CustomDropdown/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { useEffect, useRef, useState } from 'react';\n\nimport themed from '@dr.pogodin/react-themes';\n\nimport Options, { type ContainerPosT, type RefT, areEqual } from './Options';\n\nimport defaultTheme from './theme.scss';\n\nimport {\n type PropsT,\n optionValidator,\n optionValueName,\n validThemeKeys,\n} from '../common';\n\nconst BaseCustomDropdown: React.FunctionComponent<\nPropsT<React.ReactNode, (value: string) => void>\n> = ({\n filter,\n label,\n onChange,\n options,\n theme,\n value,\n}) => {\n if (!options) throw Error('Internal error');\n\n const [active, setActive] = useState(false);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const opsRef = useRef<RefT>(null);\n\n const [opsPos, setOpsPos] = useState<ContainerPosT>();\n const [upward, setUpward] = useState(false);\n\n useEffect(() => {\n if (!active) return undefined;\n\n let id: number;\n const cb = () => {\n const anchor = dropdownRef.current?.getBoundingClientRect();\n const opsRect = opsRef.current?.measure();\n if (anchor && opsRect) {\n const fitsDown = anchor.bottom + opsRect.height\n < (window.visualViewport?.height ?? 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n\n const up = !fitsDown && fitsUp;\n setUpward(up);\n\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width,\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width,\n };\n\n setOpsPos((now) => (areEqual(now, pos) ? now : pos));\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n\n const openList = (\n e: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement>,\n ) => {\n const view = window.visualViewport;\n const rect = dropdownRef.current!.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: view?.width || 0,\n top: view?.height || 0,\n width: rect.width,\n });\n\n e.stopPropagation();\n };\n\n let selected: React.ReactNode = <>&zwnj;</>;\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n const [iValue, iName] = optionValueName(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n\n return (\n <div className={containerClassName}>\n {label === undefined ? null : (\n <div className={theme.label}>{label}</div>\n )}\n <div\n className={theme.dropdown}\n onClick={openList}\n onKeyDown={(e) => {\n if (e.key === 'Enter') openList(e);\n }}\n ref={dropdownRef}\n role=\"listbox\"\n tabIndex={0}\n >\n {selected}\n <div className={theme.arrow} />\n </div>\n {\n active ? (\n <Options\n containerClass={opsContainerClass}\n containerStyle={opsPos}\n onCancel={() => {\n setActive(false);\n }}\n onChange={(newValue) => {\n setActive(false);\n if (onChange) onChange(newValue);\n }}\n optionClass={theme.option || ''}\n options={options}\n ref={opsRef}\n />\n ) : null\n }\n </div>\n );\n};\n\nconst ThemedCustomDropdown = themed(\n BaseCustomDropdown,\n 'CustomDropdown',\n validThemeKeys,\n defaultTheme,\n);\n\nBaseCustomDropdown.propTypes = {\n filter: PT.func,\n label: PT.node,\n onChange: PT.func,\n options: PT.arrayOf(optionValidator.isRequired),\n theme: ThemedCustomDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nBaseCustomDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined,\n};\n\nexport default ThemedCustomDropdown;\n"],"mappings":"gLAAA,IAAAA,UAAA,CAAAC,sBAAA,CAAAC,OAAA,gBACA,IAAAC,MAAA,CAAAD,OAAA,UAEA,IAAAE,YAAA,CAAAH,sBAAA,CAAAC,OAAA,8BAEA,IAAAG,QAAA,CAAAC,uBAAA,CAAAJ,OAAA,eAIA,IAAAK,OAAA,CAAAL,OAAA,cAKmB,I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1,2 +1,2 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"CustomDropdown",{enumerable:true,get:function(){return _CustomDropdown.default}});Object.defineProperty(exports,"Dropdown",{enumerable:true,get:function(){return _NativeDropdown.default}});Object.defineProperty(exports,"Switch",{enumerable:true,get:function(){return _Switch.default}});var _CustomDropdown=_interopRequireDefault(require("./CustomDropdown"));var _NativeDropdown=_interopRequireDefault(require("./NativeDropdown"));var _Switch=_interopRequireDefault(require("./Switch"));
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"CustomDropdown",{enumerable:true,get:function(){return _CustomDropdown.default}});Object.defineProperty(exports,"Dropdown",{enumerable:true,get:function(){return _NativeDropdown.default}});Object.defineProperty(exports,"Switch",{enumerable:true,get:function(){return _Switch.default}});Object.defineProperty(exports,"optionValidator",{enumerable:true,get:function(){return _common.optionValidator}});Object.defineProperty(exports,"optionsValidator",{enumerable:true,get:function(){return _common.optionsValidator}});var _CustomDropdown=_interopRequireDefault(require("./CustomDropdown"));var _NativeDropdown=_interopRequireDefault(require("./NativeDropdown"));var _Switch=_interopRequireDefault(require("./Switch"));var _common=require("./common");
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_CustomDropdown","_interopRequireDefault","require","_NativeDropdown","_Switch"],"sources":["../../../../../src/shared/components/selectors/index.ts"],"sourcesContent":["export { default as CustomDropdown } from './CustomDropdown';\nexport { default as Dropdown } from './NativeDropdown';\nexport { default as Switch } from './Switch';\n"],"mappings":"sdAAA,IAAAA,eAAA,CAAAC,sBAAA,CAAAC,OAAA,sBACA,IAAAC,eAAA,CAAAF,sBAAA,CAAAC,OAAA,sBACA,IAAAE,OAAA,CAAAH,sBAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_CustomDropdown","_interopRequireDefault","require","_NativeDropdown","_Switch","_common"],"sources":["../../../../../src/shared/components/selectors/index.ts"],"sourcesContent":["export { default as CustomDropdown } from './CustomDropdown';\nexport { default as Dropdown } from './NativeDropdown';\nexport { default as Switch } from './Switch';\n\nexport {\n type OptionT,\n type OptionsT,\n optionValidator,\n optionsValidator,\n} from './common';\n"],"mappings":"4rBAAA,IAAAA,eAAA,CAAAC,sBAAA,CAAAC,OAAA,sBACA,IAAAC,eAAA,CAAAF,sBAAA,CAAAC,OAAA,sBACA,IAAAE,OAAA,CAAAH,sBAAA,CAAAC,OAAA,cAEA,IAAAG,OAAA,CAAAH,OAAA","ignoreList":[]}