@dreamcommerce/aurora 2.17.8 → 2.17.9-2
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.
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_select/index.js +2 -0
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_select/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/hoc/select/index.js +7 -1
- package/build/cjs/packages/aurora/src/components/dropdown/hoc/select/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/image_picker/index.js +1 -1
- package/build/cjs/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/modal/hoc/absolute_modal/index.js +5 -5
- package/build/cjs/packages/aurora/src/components/modal/hoc/absolute_modal/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/modal/hoc/relative_modal/index.js +5 -5
- package/build/cjs/packages/aurora/src/components/modal/hoc/relative_modal/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal.js +106 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js +21 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js +31 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modals_wrapper.js +66 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modals_wrapper.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/constants.js +25 -0
- package/build/cjs/packages/aurora/src/components/modal_new/constants.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/context.js +21 -0
- package/build/cjs/packages/aurora/src/components/modal_new/context.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/css_classes.js +42 -0
- package/build/cjs/packages/aurora/src/components/modal_new/css_classes.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals.js +119 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals_context.js +19 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals_context.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/index.js +45 -0
- package/build/cjs/packages/aurora/src/components/modal_new/index.js.map +1 -0
- package/build/cjs/packages/aurora/src/css/dropdown/main.module.less.js +1 -1
- package/build/cjs/packages/aurora/src/css/modal_new/main.module.less.js +34 -0
- package/build/cjs/packages/aurora/src/css/modal_new/main.module.less.js.map +1 -0
- package/build/cjs/packages/aurora/src/index.js +55 -49
- package/build/cjs/packages/aurora/src/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/hoc/control_select/index.js +2 -0
- package/build/esm/packages/aurora/src/components/controls/hoc/control_select/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/hoc/select/index.js +7 -1
- package/build/esm/packages/aurora/src/components/dropdown/hoc/select/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/types.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/image_picker/index.js +1 -1
- package/build/esm/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.d.ts +1 -1
- package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.js +5 -5
- package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/modal/hoc/relative_modal/index.js +5 -5
- package/build/esm/packages/aurora/src/components/modal/hoc/relative_modal/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.js +97 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.js +13 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.js +23 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.js +57 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/constants.d.ts +14 -0
- package/build/esm/packages/aurora/src/components/modal_new/constants.js +17 -0
- package/build/esm/packages/aurora/src/components/modal_new/constants.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/context.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/context.js +17 -0
- package/build/esm/packages/aurora/src/components/modal_new/context.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/css_classes.d.ts +18 -0
- package/build/esm/packages/aurora/src/components/modal_new/css_classes.js +21 -0
- package/build/esm/packages/aurora/src/components/modal_new/css_classes.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.d.ts +12 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.js +115 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.js +15 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/index.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/modal_new/index.js +37 -0
- package/build/esm/packages/aurora/src/components/modal_new/index.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/types.d.ts +33 -0
- package/build/esm/packages/aurora/src/components/modal_new/types.js +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/types.js.map +1 -0
- package/build/esm/packages/aurora/src/css/dropdown/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/css/modal_new/main.module.less.js +30 -0
- package/build/esm/packages/aurora/src/css/modal_new/main.module.less.js.map +1 -0
- package/build/esm/packages/aurora/src/index.d.ts +4 -1
- package/build/esm/packages/aurora/src/index.js +3 -0
- package/build/esm/packages/aurora/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@ var ControlSelect = function ControlSelect(_ref) {
|
|
|
42
42
|
isDisabled = _ref.isDisabled,
|
|
43
43
|
onChange = _ref.onChange,
|
|
44
44
|
onToggle = _ref.onToggle,
|
|
45
|
+
onSearch = _ref.onSearch,
|
|
45
46
|
errors = _ref.errors,
|
|
46
47
|
hint = _ref.hint,
|
|
47
48
|
placeholder = _ref.placeholder,
|
|
@@ -76,6 +77,7 @@ var ControlSelect = function ControlSelect(_ref) {
|
|
|
76
77
|
onChange: onChange,
|
|
77
78
|
onToggle: onToggle,
|
|
78
79
|
onScroll: onScroll,
|
|
80
|
+
onSearch: onSearch,
|
|
79
81
|
innerAdditionalContent: innerAdditionalContent,
|
|
80
82
|
hasCloseIcon: hasCloseIcon
|
|
81
83
|
}))), /*#__PURE__*/React__default['default'].createElement(index['default'].Errors, null), additionalInfo && /*#__PURE__*/React__default['default'].createElement(index['default'].AdditionalInfo, null, additionalInfo));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -6,8 +6,8 @@ var React = require('react');
|
|
|
6
6
|
var useTranslation = require('../../../../../../external/react-i18next/dist/es/useTranslation.js');
|
|
7
7
|
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
8
8
|
var utilities$1 = require('@dreamcommerce/utilities');
|
|
9
|
-
var reactDom = require('react-dom');
|
|
10
9
|
var classnames = require('classnames');
|
|
10
|
+
var reactDom = require('react-dom');
|
|
11
11
|
var main_module$3 = require('../../../css/icons/main.module.less.js');
|
|
12
12
|
var index = require('../context/index.js');
|
|
13
13
|
var responsive_breakpoints = require('../../../constants/responsive_breakpoints.js');
|
|
@@ -52,6 +52,7 @@ var Select = function Select(_ref) {
|
|
|
52
52
|
defaultCloseOnClick = _ref$defaultCloseOnCl === void 0 ? true : _ref$defaultCloseOnCl,
|
|
53
53
|
onToggle = _ref.onToggle,
|
|
54
54
|
onChange = _ref.onChange,
|
|
55
|
+
onSearch = _ref.onSearch,
|
|
55
56
|
portalContainer = _ref.portalContainer,
|
|
56
57
|
placeholder = _ref.placeholder,
|
|
57
58
|
onScroll = _ref.onScroll,
|
|
@@ -104,6 +105,11 @@ var Select = function Select(_ref) {
|
|
|
104
105
|
* hook which resets options list to default on close if select has search and it was used
|
|
105
106
|
*/
|
|
106
107
|
|
|
108
|
+
use_set_options_on_close.useSetOptionsOnClose(isWithSearch, isOpen, setOptionsList, options);
|
|
109
|
+
/**
|
|
110
|
+
* hook which debounces search results
|
|
111
|
+
*/
|
|
112
|
+
|
|
107
113
|
use_set_options_on_close.useSetOptionsOnClose(isWithSearch, isOpen, setOptionsList, options);
|
|
108
114
|
React.useEffect(function () {
|
|
109
115
|
setOptionsList(options);
|
|
@@ -125,7 +131,7 @@ var Select = function Select(_ref) {
|
|
|
125
131
|
portalContainer: portalContainer
|
|
126
132
|
}, isWithSearch && /*#__PURE__*/React__default['default'].createElement(index$1['default'].Search, {
|
|
127
133
|
onKeyUp: function onKeyUp(ev) {
|
|
128
|
-
return utilities.handleSearchKeyUp(ev, options, setOptionsList);
|
|
134
|
+
return onSearch ? onSearch === null || onSearch === void 0 ? void 0 : onSearch(ev.target.value) : utilities.handleSearchKeyUp(ev, options, setOptionsList);
|
|
129
135
|
}
|
|
130
136
|
}), /*#__PURE__*/React__default['default'].createElement(index$1['default'].List, {
|
|
131
137
|
isWithGroups: isWithGroups,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -6,8 +6,8 @@ var React = require('react');
|
|
|
6
6
|
var useTranslation = require('../../../../../external/react-i18next/dist/es/useTranslation.js');
|
|
7
7
|
var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
8
8
|
var constants = require('../file_picker/constants.js');
|
|
9
|
-
var reactJss_esm = require('../../../../../external/react-jss/dist/react-jss.esm.js');
|
|
10
9
|
var classnames = require('classnames');
|
|
10
|
+
var reactJss_esm = require('../../../../../external/react-jss/dist/react-jss.esm.js');
|
|
11
11
|
var errors_list = require('../controls/components/errors_list.js');
|
|
12
12
|
var utils = require('../file_picker/utils.js');
|
|
13
13
|
var use_file_picker = require('../file_picker/use_file_picker.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAqE;AAClG;AACA;AACA,2BAA2B,yDAA6D;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAqE;AAClG;AACA;AACA;AACA,2BAA2B,yDAA6D;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
-
var reactDom = require('react-dom');
|
|
8
|
-
var reactJss_esm = require('../../../../../../../external/react-jss/dist/react-jss.esm.js');
|
|
9
|
-
var main_module = require('../../../../css/modal/main.module.less.js');
|
|
10
|
-
var modal = require('../../components/modal.js');
|
|
11
7
|
var utilities = require('../../utilities.js');
|
|
12
8
|
var constants = require('../../constants.js');
|
|
13
|
-
var
|
|
9
|
+
var main_module = require('../../../../css/modal/main.module.less.js');
|
|
10
|
+
var modal = require('../../components/modal.js');
|
|
14
11
|
var classnames = require('classnames');
|
|
12
|
+
var reactDom = require('react-dom');
|
|
13
|
+
var reactJss_esm = require('../../../../../../../external/react-jss/dist/react-jss.esm.js');
|
|
14
|
+
var use_resize = require('../../../../hooks/use_resize.js');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+DAAmE;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var _rollupPluginBabelHelpers = require('../../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
-
var reactDom = require('react-dom');
|
|
8
|
-
var reactJss_esm = require('../../../../../../../external/react-jss/dist/react-jss.esm.js');
|
|
9
|
-
var main_module = require('../../../../css/modal/main.module.less.js');
|
|
10
|
-
var modal = require('../../components/modal.js');
|
|
11
7
|
var utilities = require('../../utilities.js');
|
|
12
8
|
var constants = require('../../constants.js');
|
|
13
|
-
var
|
|
9
|
+
var main_module = require('../../../../css/modal/main.module.less.js');
|
|
10
|
+
var modal = require('../../components/modal.js');
|
|
14
11
|
var classnames = require('classnames');
|
|
12
|
+
var reactDom = require('react-dom');
|
|
13
|
+
var reactJss_esm = require('../../../../../../../external/react-jss/dist/react-jss.esm.js');
|
|
14
|
+
var use_resize = require('../../../../hooks/use_resize.js');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+DAAmE;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var classnames = require('classnames');
|
|
8
|
+
var reactDom = require('react-dom');
|
|
9
|
+
var constants = require('../../constants.js');
|
|
10
|
+
var css_classes = require('../../css_classes.js');
|
|
11
|
+
var main_module = require('../../../../css/modal_new/main.module.less.js');
|
|
12
|
+
var modal_footer = require('./modal_footer.js');
|
|
13
|
+
var modal_header = require('./modal_header.js');
|
|
14
|
+
var use_modals_context = require('../../hooks/use_modals_context.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
20
|
+
|
|
21
|
+
var ModalNew = function ModalNew(_ref) {
|
|
22
|
+
var name = _ref.name,
|
|
23
|
+
hideAllModalsOnClose = _ref.hideAllModalsOnClose,
|
|
24
|
+
_ref$animationDirecti = _ref.animationDirection,
|
|
25
|
+
animationDirection = _ref$animationDirecti === void 0 ? constants.MODAL_ANIMATION_DIRECTIONS.top : _ref$animationDirecti,
|
|
26
|
+
header = _ref.header,
|
|
27
|
+
footer = _ref.footer,
|
|
28
|
+
children = _ref.children;
|
|
29
|
+
|
|
30
|
+
var _useState = React.useState(false),
|
|
31
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
32
|
+
visibleClass = _useState2[0],
|
|
33
|
+
setVisibleClass = _useState2[1];
|
|
34
|
+
|
|
35
|
+
var _useModalsContext = use_modals_context.useModalsContext(),
|
|
36
|
+
modalsManagerContainerSelector = _useModalsContext.modalsManagerContainerSelector,
|
|
37
|
+
addModal = _useModalsContext.addModal,
|
|
38
|
+
getModal = _useModalsContext.getModal,
|
|
39
|
+
hideModal = _useModalsContext.hideModal,
|
|
40
|
+
hideAllModals = _useModalsContext.hideAllModals;
|
|
41
|
+
|
|
42
|
+
var $modalsManagerContainer = document.querySelector(modalsManagerContainerSelector);
|
|
43
|
+
var modal = getModal(name);
|
|
44
|
+
|
|
45
|
+
var _useState3 = React.useState(false),
|
|
46
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
47
|
+
renderModal = _useState4[0],
|
|
48
|
+
setRenderModal = _useState4[1];
|
|
49
|
+
|
|
50
|
+
React.useEffect(function () {
|
|
51
|
+
addModal({
|
|
52
|
+
name: name,
|
|
53
|
+
visibilityState: constants.MODAL_VISIBILITY_STATE.none,
|
|
54
|
+
animationDirection: animationDirection
|
|
55
|
+
});
|
|
56
|
+
}, []);
|
|
57
|
+
React.useEffect(function () {
|
|
58
|
+
var showModalTimeout;
|
|
59
|
+
var hideModalTimeout;
|
|
60
|
+
|
|
61
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.visibilityState) === constants.MODAL_VISIBILITY_STATE.visible) {
|
|
62
|
+
setRenderModal(true);
|
|
63
|
+
showModalTimeout = setTimeout(function () {
|
|
64
|
+
setVisibleClass(true);
|
|
65
|
+
}, constants.MODAL_SLIDE_FADE_DURATION);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.visibilityState) === constants.MODAL_VISIBILITY_STATE.hidden) {
|
|
69
|
+
setVisibleClass(false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.visibilityState) === constants.MODAL_VISIBILITY_STATE.none) {
|
|
73
|
+
setVisibleClass(false);
|
|
74
|
+
hideModalTimeout = setTimeout(function () {
|
|
75
|
+
setRenderModal(false);
|
|
76
|
+
}, constants.MODAL_SLIDE_FADE_DURATION);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return function () {
|
|
80
|
+
clearTimeout(showModalTimeout);
|
|
81
|
+
clearTimeout(hideModalTimeout);
|
|
82
|
+
};
|
|
83
|
+
}, [modal]);
|
|
84
|
+
|
|
85
|
+
var handleCloseModal = function handleCloseModal() {
|
|
86
|
+
hideAllModalsOnClose ? hideAllModals() : hideModal(name);
|
|
87
|
+
(header === null || header === void 0 ? void 0 : header.closeAction) && header.closeAction();
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var modalClassNames = classnames__default['default'](main_module['default'][css_classes.cssModal], _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, main_module['default'][css_classes.cssModalShow], visibleClass), main_module['default'][css_classes.cssModalHide], !visibleClass), main_module['default'][css_classes.cssModalAnimationTop], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.top), main_module['default'][css_classes.cssModalAnimationRight], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.right), main_module['default'][css_classes.cssModalAnimationBottom], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.bottom), main_module['default'][css_classes.cssModalAnimationLeft], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.left));
|
|
91
|
+
if (!$modalsManagerContainer) return null;
|
|
92
|
+
return renderModal ? /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
93
|
+
id: name,
|
|
94
|
+
className: modalClassNames
|
|
95
|
+
}, header && /*#__PURE__*/React__default['default'].createElement(modal_header.ModalHeader, {
|
|
96
|
+
content: header.content,
|
|
97
|
+
closeAction: handleCloseModal
|
|
98
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
99
|
+
className: "".concat(main_module['default'][css_classes.cssModalContent])
|
|
100
|
+
}, children), footer && /*#__PURE__*/React__default['default'].createElement(modal_footer.ModalFooter, {
|
|
101
|
+
content: footer.content
|
|
102
|
+
})), $modalsManagerContainer) : null;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.ModalNew = ModalNew;
|
|
106
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var css_classes = require('../../css_classes.js');
|
|
7
|
+
var main_module = require('../../../../css/modal_new/main.module.less.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
14
|
+
var content = _ref.content;
|
|
15
|
+
return /*#__PURE__*/React__default['default'].createElement("footer", {
|
|
16
|
+
className: main_module['default'][css_classes.cssModalFooter]
|
|
17
|
+
}, content);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.ModalFooter = ModalFooter;
|
|
21
|
+
//# sourceMappingURL=modal_footer.js.map
|
package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var icon_close = require('../../../../assets/icon_close.js');
|
|
7
|
+
var css_classes = require('../../css_classes.js');
|
|
8
|
+
var main_module = require('../../../../css/modal_new/main.module.less.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
|
|
14
|
+
var ModalHeader = function ModalHeader(_ref) {
|
|
15
|
+
var _ref$content = _ref.content,
|
|
16
|
+
content = _ref$content === void 0 ? '' : _ref$content,
|
|
17
|
+
closeAction = _ref.closeAction;
|
|
18
|
+
return /*#__PURE__*/React__default['default'].createElement("header", {
|
|
19
|
+
className: main_module['default'][css_classes.cssModalHeader]
|
|
20
|
+
}, /*#__PURE__*/React__default['default'].createElement("h3", {
|
|
21
|
+
className: main_module['default'][css_classes.cssModalHeaderTitle]
|
|
22
|
+
}, content), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
23
|
+
className: main_module['default'][css_classes.cssModalHeaderActions]
|
|
24
|
+
}, closeAction && /*#__PURE__*/React__default['default'].createElement(icon_close['default'], {
|
|
25
|
+
onClick: closeAction,
|
|
26
|
+
className: main_module['default'][css_classes.cssModalHeaderCloseIcon]
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.ModalHeader = ModalHeader;
|
|
31
|
+
//# sourceMappingURL=modal_header.js.map
|
package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var classnames = require('classnames');
|
|
8
|
+
var reactDom = require('react-dom');
|
|
9
|
+
var constants = require('../constants.js');
|
|
10
|
+
var css_classes = require('../css_classes.js');
|
|
11
|
+
var main_module = require('../../../css/modal_new/main.module.less.js');
|
|
12
|
+
var use_modals_context = require('../hooks/use_modals_context.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
18
|
+
|
|
19
|
+
var ModalsWrapper = function ModalsWrapper(_ref) {
|
|
20
|
+
var children = _ref.children;
|
|
21
|
+
|
|
22
|
+
var _useState = React.useState(false),
|
|
23
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
24
|
+
showWrapper = _useState2[0],
|
|
25
|
+
setShowWrapper = _useState2[1];
|
|
26
|
+
|
|
27
|
+
var _useState3 = React.useState(false),
|
|
28
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
29
|
+
visibleClass = _useState4[0],
|
|
30
|
+
setVisibleClass = _useState4[1];
|
|
31
|
+
|
|
32
|
+
var _useModalsContext = use_modals_context.useModalsContext(),
|
|
33
|
+
openedModals = _useModalsContext.openedModals;
|
|
34
|
+
|
|
35
|
+
React.useEffect(function () {
|
|
36
|
+
var showWrapperTimeout;
|
|
37
|
+
|
|
38
|
+
if (openedModals.length) {
|
|
39
|
+
setShowWrapper(true);
|
|
40
|
+
setVisibleClass(true);
|
|
41
|
+
} else {
|
|
42
|
+
setVisibleClass(false);
|
|
43
|
+
showWrapperTimeout = setTimeout(function () {
|
|
44
|
+
setShowWrapper(false);
|
|
45
|
+
}, constants.MODALS_WRAPPER_BACKDROP_FADE_DURATION);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return function () {
|
|
49
|
+
return clearTimeout(showWrapperTimeout);
|
|
50
|
+
};
|
|
51
|
+
}, [openedModals]);
|
|
52
|
+
var modalsWrapperBackdropClassNames = classnames__default['default'](main_module['default'][css_classes.cssModalsManagerWrapperBackdrop], _rollupPluginBabelHelpers.defineProperty({}, main_module['default'][css_classes.cssModalsManagerWrapperBackdropShow], visibleClass));
|
|
53
|
+
return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
54
|
+
className: "".concat(main_module['default'][css_classes.cssModalsManager])
|
|
55
|
+
}, showWrapper && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
56
|
+
className: "".concat(main_module['default'][css_classes.cssModalsManagerWrapper])
|
|
57
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
58
|
+
className: modalsWrapperBackdropClassNames
|
|
59
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
60
|
+
id: constants.MODALS_CONTENT_ID,
|
|
61
|
+
className: "".concat(main_module['default'][css_classes.cssModalsManagerWrapperContent])
|
|
62
|
+
})), children), document.body);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
exports.ModalsWrapper = ModalsWrapper;
|
|
66
|
+
//# sourceMappingURL=modals_wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var MODALS_CONTENT_ID = 'modals-content';
|
|
6
|
+
var MODALS_WRAPPER_BACKDROP_FADE_DURATION = 300;
|
|
7
|
+
var MODAL_SLIDE_FADE_DURATION = 200;
|
|
8
|
+
var MODAL_ANIMATION_DIRECTIONS = {
|
|
9
|
+
top: 'top',
|
|
10
|
+
right: 'right',
|
|
11
|
+
bottom: 'bottom',
|
|
12
|
+
left: 'left'
|
|
13
|
+
};
|
|
14
|
+
var MODAL_VISIBILITY_STATE = {
|
|
15
|
+
none: 'none',
|
|
16
|
+
hidden: 'hidden',
|
|
17
|
+
visible: 'visible'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.MODALS_CONTENT_ID = MODALS_CONTENT_ID;
|
|
21
|
+
exports.MODALS_WRAPPER_BACKDROP_FADE_DURATION = MODALS_WRAPPER_BACKDROP_FADE_DURATION;
|
|
22
|
+
exports.MODAL_ANIMATION_DIRECTIONS = MODAL_ANIMATION_DIRECTIONS;
|
|
23
|
+
exports.MODAL_SLIDE_FADE_DURATION = MODAL_SLIDE_FADE_DURATION;
|
|
24
|
+
exports.MODAL_VISIBILITY_STATE = MODAL_VISIBILITY_STATE;
|
|
25
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
var ModalsManagerContext = /*#__PURE__*/React.createContext({
|
|
8
|
+
modalsManagerContainerSelector: '',
|
|
9
|
+
addModal: function addModal() {},
|
|
10
|
+
updateModal: function updateModal() {},
|
|
11
|
+
getModal: function getModal() {
|
|
12
|
+
return undefined;
|
|
13
|
+
},
|
|
14
|
+
showModal: function showModal() {},
|
|
15
|
+
hideModal: function hideModal() {},
|
|
16
|
+
hideAllModals: function hideAllModals() {},
|
|
17
|
+
openedModals: []
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
exports.ModalsManagerContext = ModalsManagerContext;
|
|
21
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cssModalsManager = 'modals-manager';
|
|
6
|
+
var cssModalsManagerWrapper = 'modals-manager__wrapper';
|
|
7
|
+
var cssModalsManagerWrapperBackdrop = 'modals-manager__wrapper-backdrop';
|
|
8
|
+
var cssModalsManagerWrapperBackdropShow = 'modals-manager__wrapper-backdrop_show';
|
|
9
|
+
var cssModalsManagerWrapperContent = 'modals-manager__wrapper-content';
|
|
10
|
+
var cssModal = 'modal';
|
|
11
|
+
var cssModalHeader = 'modal__header';
|
|
12
|
+
var cssModalHeaderTitle = 'modal__header-title';
|
|
13
|
+
var cssModalHeaderActions = 'modal__header-actions';
|
|
14
|
+
var cssModalHeaderCloseIcon = 'modal__header-close-icon';
|
|
15
|
+
var cssModalShow = 'modal_show';
|
|
16
|
+
var cssModalHide = 'modal_hide';
|
|
17
|
+
var cssModalAnimationTop = 'modal_animation-top';
|
|
18
|
+
var cssModalAnimationRight = 'modal_animation-right';
|
|
19
|
+
var cssModalAnimationBottom = 'modal_animation-bottom';
|
|
20
|
+
var cssModalAnimationLeft = 'modal_animation-left';
|
|
21
|
+
var cssModalContent = 'modal__content';
|
|
22
|
+
var cssModalFooter = 'modal__footer';
|
|
23
|
+
|
|
24
|
+
exports.cssModal = cssModal;
|
|
25
|
+
exports.cssModalAnimationBottom = cssModalAnimationBottom;
|
|
26
|
+
exports.cssModalAnimationLeft = cssModalAnimationLeft;
|
|
27
|
+
exports.cssModalAnimationRight = cssModalAnimationRight;
|
|
28
|
+
exports.cssModalAnimationTop = cssModalAnimationTop;
|
|
29
|
+
exports.cssModalContent = cssModalContent;
|
|
30
|
+
exports.cssModalFooter = cssModalFooter;
|
|
31
|
+
exports.cssModalHeader = cssModalHeader;
|
|
32
|
+
exports.cssModalHeaderActions = cssModalHeaderActions;
|
|
33
|
+
exports.cssModalHeaderCloseIcon = cssModalHeaderCloseIcon;
|
|
34
|
+
exports.cssModalHeaderTitle = cssModalHeaderTitle;
|
|
35
|
+
exports.cssModalHide = cssModalHide;
|
|
36
|
+
exports.cssModalShow = cssModalShow;
|
|
37
|
+
exports.cssModalsManager = cssModalsManager;
|
|
38
|
+
exports.cssModalsManagerWrapper = cssModalsManagerWrapper;
|
|
39
|
+
exports.cssModalsManagerWrapperBackdrop = cssModalsManagerWrapperBackdrop;
|
|
40
|
+
exports.cssModalsManagerWrapperBackdropShow = cssModalsManagerWrapperBackdropShow;
|
|
41
|
+
exports.cssModalsManagerWrapperContent = cssModalsManagerWrapperContent;
|
|
42
|
+
//# sourceMappingURL=css_classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var constants = require('../constants.js');
|
|
8
|
+
|
|
9
|
+
var useModals = function useModals() {
|
|
10
|
+
var _useState = React.useState([]),
|
|
11
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
12
|
+
modalsStack = _useState2[0],
|
|
13
|
+
setModalsStack = _useState2[1];
|
|
14
|
+
|
|
15
|
+
var _useState3 = React.useState([]),
|
|
16
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
17
|
+
openedModals = _useState4[0],
|
|
18
|
+
setOpenedModals = _useState4[1];
|
|
19
|
+
|
|
20
|
+
var modalsManagerContainerSelector = "#".concat(constants.MODALS_CONTENT_ID);
|
|
21
|
+
|
|
22
|
+
var addModal = function addModal(modal) {
|
|
23
|
+
setModalsStack(function (stack) {
|
|
24
|
+
var modalNameAlreadyExist = stack.some(function (stackModal) {
|
|
25
|
+
return stackModal.name === modal.name;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (modalNameAlreadyExist) {
|
|
29
|
+
return _rollupPluginBabelHelpers.toConsumableArray(stack);
|
|
30
|
+
} else {
|
|
31
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(stack), [modal]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var updateModal = function updateModal(modal) {
|
|
37
|
+
setModalsStack(function (previousStack) {
|
|
38
|
+
var updatedStack = previousStack.map(function (stackModal) {
|
|
39
|
+
return stackModal.name === modal.name ? _rollupPluginBabelHelpers.objectSpread2({}, modal) : stackModal;
|
|
40
|
+
});
|
|
41
|
+
return updatedStack;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var getModal = function getModal(modalName) {
|
|
46
|
+
return modalsStack.find(function (stackModal) {
|
|
47
|
+
return stackModal.name === modalName;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var showModal = function showModal(modalName) {
|
|
52
|
+
setOpenedModals(function (modals) {
|
|
53
|
+
setVisibleState(modals, constants.MODAL_VISIBILITY_STATE.hidden);
|
|
54
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(modals), [modalName]);
|
|
55
|
+
});
|
|
56
|
+
setVisibleState(modalName, constants.MODAL_VISIBILITY_STATE.visible);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var hideModal = function hideModal(modalName) {
|
|
60
|
+
setOpenedModals(function (modals) {
|
|
61
|
+
var secondToLastItem = modals[modals.length - 2];
|
|
62
|
+
setVisibleState(secondToLastItem, constants.MODAL_VISIBILITY_STATE.visible);
|
|
63
|
+
return modals.filter(function (modal) {
|
|
64
|
+
return modal !== modalName;
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
setVisibleState(modalName, constants.MODAL_VISIBILITY_STATE.none);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var hideAllModals = function hideAllModals() {
|
|
71
|
+
setOpenedModals([]);
|
|
72
|
+
setVisibleStatesToNone();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var setVisibleState = function setVisibleState(modalName, state) {
|
|
76
|
+
if (typeof modalName === 'string') {
|
|
77
|
+
setModalsStack(function (prevState) {
|
|
78
|
+
return prevState.map(function (modal) {
|
|
79
|
+
return modal.name === modalName ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, modal), {}, {
|
|
80
|
+
visibilityState: state
|
|
81
|
+
}) : modal;
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
setModalsStack(function (prevState) {
|
|
86
|
+
return prevState.map(function (modal) {
|
|
87
|
+
if (!modalName) return modal;
|
|
88
|
+
return modalName.includes(modal.name) ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, modal), {}, {
|
|
89
|
+
visibilityState: state
|
|
90
|
+
}) : modal;
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var setVisibleStatesToNone = function setVisibleStatesToNone() {
|
|
97
|
+
setModalsStack(function (prevState) {
|
|
98
|
+
return prevState.map(function (modal) {
|
|
99
|
+
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, modal), {}, {
|
|
100
|
+
visibilityState: constants.MODAL_VISIBILITY_STATE.none
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
modalsManagerContainerSelector: modalsManagerContainerSelector,
|
|
108
|
+
addModal: addModal,
|
|
109
|
+
updateModal: updateModal,
|
|
110
|
+
getModal: getModal,
|
|
111
|
+
showModal: showModal,
|
|
112
|
+
hideModal: hideModal,
|
|
113
|
+
hideAllModals: hideAllModals,
|
|
114
|
+
openedModals: openedModals
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.default = useModals;
|
|
119
|
+
//# sourceMappingURL=use_modals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var context = require('../context.js');
|
|
7
|
+
|
|
8
|
+
function useModalsContext() {
|
|
9
|
+
var context$1 = React.useContext(context.ModalsManagerContext);
|
|
10
|
+
|
|
11
|
+
if (Object.keys(context$1).length === 0 && context$1.constructor === Object) {
|
|
12
|
+
throw new Error("Modal component cannot be rendered outside the ModalWrapper component");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return context$1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.useModalsContext = useModalsContext;
|
|
19
|
+
//# sourceMappingURL=use_modals_context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|