@corva/ui 3.76.0-11 → 3.76.0-13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/componentsV2/DatePicker/utils.tsx"],"sourcesContent":["export type DatePickerType = 'date' | 'dateTime' | 'month';\n\nexport type DatePickerValue<IsRange extends boolean | undefined = false> = IsRange extends\n | undefined\n | false\n ? Date | undefined\n : [Date, Date] | undefined;\n\nexport type DatePickerChangeHandler<IsRange extends boolean | undefined = false> = (\n value: DatePickerValue<IsRange>\n) => void;\n\n// startDate - initial state, no start date selected\n// endDate - start done, no end date selected\nexport type RangeSelectionStep = 'startDate' | 'endDate';\n\nexport const DefaultFormatByType: Record<DatePickerType, string> = {\n date: 'DD MMM YYYY',\n dateTime: 'DD MMM YYYY hh:mm A',\n month: 'MMMM YYYY',\n};\n\nexport const DefaultFormatByTypeRange: Record<DatePickerType, string> = {\n date: 'DD/MM/YYYY',\n dateTime: 'DD/MM/YYYY hh:mm A',\n month: 'MMM YYYY',\n};\n\nexport const getDefaultFormat = (type: DatePickerType, range?: boolean) => {\n const map = range ? DefaultFormatByTypeRange : DefaultFormatByType;\n return map[type];\n};\n\nconst NumericLetters = ['D', 'M', 'Y', 'h', 'm', 's', 'S'];\nconst AllLetters = [...NumericLetters, 'A'];\nconst GetSeparatorRegex = new RegExp(`^([^${AllLetters.join('')}]+)`, 'gi');\n\n// These formats should be composed only of `AllLetters` as placeholders only\nexport const InputAutocompleteFormats: Record<DatePickerType, string> = {\n month: 'MM/YYYY',\n date: 'DD/MM/YYYY',\n dateTime: 'DD/MM/YYYY hh:mm A',\n};\n\nexport const InputParseFormats: Record<DatePickerType, string[]> = {\n month: [InputAutocompleteFormats.month, 'MMMM YYYY', 'MMM YYYY'],\n date: [InputAutocompleteFormats.date, 'D/M/YYYY'],\n dateTime: [InputAutocompleteFormats.dateTime, 'D/M/YYYY hh:mm A'],\n};\n\nconst isDigit = (symbol?: string) => symbol?.match(/\\d/);\n\nconst isInFormatSoFar = (format: string, value: string) => {\n if (value.length <= format.length) {\n const valueArr = value.split('');\n\n return valueArr.every((valueChar, pos) => {\n const formatChar = format[pos];\n\n if (NumericLetters.includes(formatChar)) {\n return isDigit(valueChar);\n }\n\n if (formatChar === 'A') {\n const lcChar = valueChar.toLocaleLowerCase();\n return lcChar === 'a' || lcChar === 'p';\n }\n\n return formatChar === valueChar;\n });\n }\n\n return false;\n};\n\nconst getSeparator = (format: string, startIndex: number) => {\n return format.substring(startIndex).match(GetSeparatorRegex)?.[0] || '';\n};\n\nexport const autocompleteValue = ({\n value,\n type,\n range,\n prevValue,\n}: {\n type: DatePickerType;\n range?: boolean;\n value: string;\n prevValue: string;\n}) => {\n const formatPart = InputAutocompleteFormats[type];\n const format = range ? `${formatPart} - ${formatPart}` : formatPart;\n\n const preparedValue = value.toLocaleLowerCase().replace(/([ap])m/gi, '$1');\n\n if (\n value.length <= prevValue.length ||\n !isInFormatSoFar(format, preparedValue) ||\n format.length <= preparedValue.length\n ) {\n return value;\n }\n\n // Only autocomplete if user types something\n // Check if conforms to format so far\n // Adding separators if needed\n const separator = getSeparator(format, preparedValue.length);\n\n return `${value}${separator}`;\n};\n\nexport const isSameMonth = (a?: Date, b?: Date) =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n\nexport const isSameDay = (a?: Date, b?: Date) => isSameMonth(a, b) && a?.getDate() === b?.getDate();\n\nexport const getMinDate = (a?: Date, b?: Date) => {\n if (a && b) {\n return a < b ? a : b;\n }\n\n return a || b;\n};\n\nexport const getMaxDate = (a?: Date, b?: Date) => {\n if (a && b) {\n return a > b ? a : b;\n }\n\n return a || b;\n};\n\nexport const MonthOptions = [\n { id: 1, title: 'Jan', fullTitle: 'January' },\n { id: 2, title: 'Feb', fullTitle: 'February' },\n { id: 3, title: 'Mar', fullTitle: 'March' },\n { id: 4, title: 'Apr', fullTitle: 'April' },\n { id: 5, title: 'May', fullTitle: 'May' },\n { id: 6, title: 'Jun', fullTitle: 'June' },\n { id: 7, title: 'Jul', fullTitle: 'July' },\n { id: 8, title: 'Aug', fullTitle: 'August' },\n { id: 9, title: 'Sep', fullTitle: 'September' },\n { id: 10, title: 'Oct', fullTitle: 'October' },\n { id: 11, title: 'Nov', fullTitle: 'November' },\n { id: 12, title: 'Dec', fullTitle: 'December' },\n];\n\nexport type DatePickerCalendarView = 'year' | 'month';\n\nexport const getDateWithSameTime = (date: Date, timeDate?: Date) =>\n new Date(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n timeDate?.getHours() || 0,\n timeDate?.getMinutes() || 0,\n timeDate?.getSeconds() || 0\n );\n"],"names":["DefaultFormatByType","date","dateTime","month","DefaultFormatByTypeRange","getDefaultFormat","type","range","NumericLetters","AllLetters","concat","GetSeparatorRegex","RegExp","join","InputAutocompleteFormats","InputParseFormats","autocompleteValue","_ref","value","prevValue","formatPart","format","preparedValue","toLocaleLowerCase","replace","length","split","every","valueChar","pos","symbol","formatChar","includes","match","lcChar","isInFormatSoFar","separator","startIndex","_format$substring$mat","substring","getSeparator","isSameMonth","a","b","getFullYear","getMonth","isSameDay","getDate","getMinDate","getMaxDate","MonthOptions","id","title","fullTitle","getDateWithSameTime","timeDate","Date","getHours","getMinutes","getSeconds"],"mappings":"AAgBO,IAAMA,EAAsD,CACjEC,KAAM,cACNC,SAAU,sBACVC,MAAO,aAGIC,EAA2D,CACtEH,KAAM,aACNC,SAAU,qBACVC,MAAO,YAGIE,EAAmB,SAACC,EAAsBC,GAErD,OADYA,EAAQH,EAA2BJ,GACpCM,EACb,EAEME,EAAiB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,KAChDC,EAAU,GAAAC,OAAOF,EAAc,CAAE,MACjCG,EAAoB,IAAIC,OAAcH,OAAAA,OAAAA,EAAWI,KAAK,IAAG,OAAO,MAGzDC,EAA2D,CACtEX,MAAO,UACPF,KAAM,aACNC,SAAU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EAAGK,cAAcJ,aAAAA,EAAAA,EAAGI,UAAS,EAEtFC,EAAa,SAACN,EAAUC,GACnC,OAAID,GAAKC,EACAD,EAAIC,EAAID,EAAIC,EAGdD,GAAKC,CACd,EAEaM,EAAa,SAACP,EAAUC,GACnC,OAAID,GAAKC,EACAD,EAAIC,EAAID,EAAIC,EAGdD,GAAKC,CACd,EAEaO,EAAe,CAC1B,CAAEC,GAAI,EAAGC,MAAO,MAAOC,UAAW,WAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,YAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,SAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,SAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,OAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,QAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,QAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,UAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,aAClC,CAAEF,GAAI,GAAIC,MAAO,MAAOC,UAAW,WACnC,CAAEF,GAAI,GAAIC,MAAO,MAAOC,UAAW,YACnC,CAAEF,GAAI,GAAIC,MAAO,MAAOC,UAAW,aAKxBC,EAAsB,SAACrD,EAAYsD,GAAe,OAC7D,IAAIC,KACFvD,EAAK2C,cACL3C,EAAK4C,WACL5C,EAAK8C,WACLQ,aAAAA,EAAAA,EAAUE,aAAc,GACxBF,aAAAA,EAAAA,EAAUG,eAAgB,GAC1BH,aAAQ,EAARA,EAAUI,eAAgB,EAC3B"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/componentsV2/DatePicker/utils.tsx"],"sourcesContent":["export type DatePickerType = 'date' | 'dateTime' | 'month';\n\nexport type DatePickerValue<IsRange extends boolean | undefined = false> = IsRange extends\n | undefined\n | false\n ? Date | undefined\n : [Date, Date] | undefined;\n\nexport type DatePickerChangeHandler<IsRange extends boolean | undefined = false> = (\n value: DatePickerValue<IsRange>\n) => void;\n\n// startDate - initial state, no start date selected\n// endDate - start done, no end date selected\nexport type RangeSelectionStep = 'startDate' | 'endDate';\n\nexport const DefaultFormatByType: Record<DatePickerType, string> = {\n date: 'MMM DD YYYY',\n dateTime: 'MMM DD YYYY hh:mm A',\n month: 'MMMM YYYY',\n};\n\nexport const DefaultFormatByTypeRange: Record<DatePickerType, string> = {\n date: 'MM/DD/YYYY',\n dateTime: 'MM/DD/YYYY hh:mm A',\n month: 'MMM YYYY',\n};\n\nexport const getDefaultFormat = (type: DatePickerType, range?: boolean) => {\n const map = range ? DefaultFormatByTypeRange : DefaultFormatByType;\n return map[type];\n};\n\nconst NumericLetters = ['D', 'M', 'Y', 'h', 'm', 's', 'S'];\nconst AllLetters = [...NumericLetters, 'A'];\nconst GetSeparatorRegex = new RegExp(`^([^${AllLetters.join('')}]+)`, 'gi');\n\n// These formats should be composed only of `AllLetters` as placeholders only\nexport const InputAutocompleteFormats: Record<DatePickerType, string> = {\n month: 'MM/YYYY',\n date: 'MM/DD/YYYY',\n dateTime: 'MM/DD/YYYY hh:mm A',\n};\n\nexport const InputParseFormats: Record<DatePickerType, string[]> = {\n month: [InputAutocompleteFormats.month, 'MMMM YYYY', 'MMM YYYY'],\n date: [InputAutocompleteFormats.date, 'M/D/YYYY'],\n dateTime: [InputAutocompleteFormats.dateTime, 'M/D/YYYY hh:mm A'],\n};\n\nconst isDigit = (symbol?: string) => symbol?.match(/\\d/);\n\nconst isInFormatSoFar = (format: string, value: string) => {\n if (value.length <= format.length) {\n const valueArr = value.split('');\n\n return valueArr.every((valueChar, pos) => {\n const formatChar = format[pos];\n\n if (NumericLetters.includes(formatChar)) {\n return isDigit(valueChar);\n }\n\n if (formatChar === 'A') {\n const lcChar = valueChar.toLocaleLowerCase();\n return lcChar === 'a' || lcChar === 'p';\n }\n\n return formatChar === valueChar;\n });\n }\n\n return false;\n};\n\nconst getSeparator = (format: string, startIndex: number) => {\n return format.substring(startIndex).match(GetSeparatorRegex)?.[0] || '';\n};\n\nexport const autocompleteValue = ({\n value,\n type,\n range,\n prevValue,\n}: {\n type: DatePickerType;\n range?: boolean;\n value: string;\n prevValue: string;\n}) => {\n const formatPart = InputAutocompleteFormats[type];\n const format = range ? `${formatPart} - ${formatPart}` : formatPart;\n\n const preparedValue = value.toLocaleLowerCase().replace(/([ap])m/gi, '$1');\n\n if (\n value.length <= prevValue.length ||\n !isInFormatSoFar(format, preparedValue) ||\n format.length <= preparedValue.length\n ) {\n return value;\n }\n\n // Only autocomplete if user types something\n // Check if conforms to format so far\n // Adding separators if needed\n const separator = getSeparator(format, preparedValue.length);\n\n return `${value}${separator}`;\n};\n\nexport const isSameMonth = (a?: Date, b?: Date) =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n\nexport const isSameDay = (a?: Date, b?: Date) => isSameMonth(a, b) && a?.getDate() === b?.getDate();\n\nexport const getMinDate = (a?: Date, b?: Date) => {\n if (a && b) {\n return a < b ? a : b;\n }\n\n return a || b;\n};\n\nexport const getMaxDate = (a?: Date, b?: Date) => {\n if (a && b) {\n return a > b ? a : b;\n }\n\n return a || b;\n};\n\nexport const MonthOptions = [\n { id: 1, title: 'Jan', fullTitle: 'January' },\n { id: 2, title: 'Feb', fullTitle: 'February' },\n { id: 3, title: 'Mar', fullTitle: 'March' },\n { id: 4, title: 'Apr', fullTitle: 'April' },\n { id: 5, title: 'May', fullTitle: 'May' },\n { id: 6, title: 'Jun', fullTitle: 'June' },\n { id: 7, title: 'Jul', fullTitle: 'July' },\n { id: 8, title: 'Aug', fullTitle: 'August' },\n { id: 9, title: 'Sep', fullTitle: 'September' },\n { id: 10, title: 'Oct', fullTitle: 'October' },\n { id: 11, title: 'Nov', fullTitle: 'November' },\n { id: 12, title: 'Dec', fullTitle: 'December' },\n];\n\nexport type DatePickerCalendarView = 'year' | 'month';\n\nexport const getDateWithSameTime = (date: Date, timeDate?: Date) =>\n new Date(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n timeDate?.getHours() || 0,\n timeDate?.getMinutes() || 0,\n timeDate?.getSeconds() || 0\n );\n"],"names":["DefaultFormatByType","date","dateTime","month","DefaultFormatByTypeRange","getDefaultFormat","type","range","NumericLetters","AllLetters","concat","GetSeparatorRegex","RegExp","join","InputAutocompleteFormats","InputParseFormats","autocompleteValue","_ref","value","prevValue","formatPart","format","preparedValue","toLocaleLowerCase","replace","length","split","every","valueChar","pos","symbol","formatChar","includes","match","lcChar","isInFormatSoFar","separator","startIndex","_format$substring$mat","substring","getSeparator","isSameMonth","a","b","getFullYear","getMonth","isSameDay","getDate","getMinDate","getMaxDate","MonthOptions","id","title","fullTitle","getDateWithSameTime","timeDate","Date","getHours","getMinutes","getSeconds"],"mappings":"AAgBO,IAAMA,EAAsD,CACjEC,KAAM,cACNC,SAAU,sBACVC,MAAO,aAGIC,EAA2D,CACtEH,KAAM,aACNC,SAAU,qBACVC,MAAO,YAGIE,EAAmB,SAACC,EAAsBC,GAErD,OADYA,EAAQH,EAA2BJ,GACpCM,EACb,EAEME,EAAiB,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,KAChDC,EAAU,GAAAC,OAAOF,EAAc,CAAE,MACjCG,EAAoB,IAAIC,OAAcH,OAAAA,OAAAA,EAAWI,KAAK,IAAG,OAAO,MAGzDC,EAA2D,CACtEX,MAAO,UACPF,KAAM,aACNC,SAAU,sBAGCa,EAAsD,CACjEZ,MAAO,CAACW,EAAyBX,MAAO,YAAa,YACrDF,KAAM,CAACa,EAAyBb,KAAM,YACtCC,SAAU,CAACY,EAAyBZ,SAAU,qBAgCnCc,EAAoB,SAU3BC,GAAA,IATJC,IAAAA,MACAZ,IAAAA,KACAC,IAAAA,MACAY,IAAAA,UAOMC,EAAaN,EAAyBR,GACtCe,EAASd,EAAK,GAAAG,OAAMU,EAAgBA,OAAAA,OAAAA,GAAeA,EAEnDE,EAAgBJ,EAAMK,oBAAoBC,QAAQ,YAAa,MAErE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EAAGC,MAAO,MAAOC,UAAW,SAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,SAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,OAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,QAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,QAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,UAClC,CAAEF,GAAI,EAAGC,MAAO,MAAOC,UAAW,aAClC,CAAEF,GAAI,GAAIC,MAAO,MAAOC,UAAW,WACnC,CAAEF,GAAI,GAAIC,MAAO,MAAOC,UAAW,YACnC,CAAEF,GAAI,GAAIC,MAAO,MAAOC,UAAW,aAKxBC,EAAsB,SAACrD,EAAYsD,GAAe,OAC7D,IAAIC,KACFvD,EAAK2C,cACL3C,EAAK4C,WACL5C,EAAK8C,WACLQ,aAAAA,EAAAA,EAAUE,aAAc,GACxBF,aAAAA,EAAAA,EAAUG,eAAgB,GAC1BH,aAAQ,EAARA,EAAUI,eAAgB,EAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/componentsV2/Modal/Modal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAM/D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC3D,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,kBAAkB,KAAK,IAAI,CAAC;IAC/E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAuDF,eAAO,MAAM,KAAK,UAAW,UAAU,4CAOtC,CAAC"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/componentsV2/Modal/Modal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAM/D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAC3D,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,GAAG,kBAAkB,KAAK,IAAI,CAAC;IAC/E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAwDF,eAAO,MAAM,KAAK,UAAW,UAAU,4CAOtC,CAAC"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/objectWithoutProperties";import{Modal as r}from"@material-ui/core";import{useCallback as t}from"react";import n from"classnames";import{useDelayedDcFullscreenElemOpen as s}from"../../effects/useDelayedDcFullscreenElemOpen.js";import{useIsInsideDcFullscreenElem as c,IsInsideDcFullscreenElemProvider as i}from"../../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import{useIsInsideIsolatedDcApp as p}from"../../components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import{ModalWindow as l}from"../ModalWindow/ModalWindow.js";import{MODAL_ROOT_CLASS as a}from"./constants.js";import m from"./Modal.scss.js";import{jsx as u}from"react/jsx-runtime";var f=["open","onClose","size","showCloseButton","closeOnBackdropClick","closeOnEscape"],d=["open"];function O(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function b(o){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?O(Object(t),!0).forEach((function(r){e(o,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}var v=function(e){var s=e.open,c=e.onClose,i=e.size,p=void 0===i?"medium":i,d=e.showCloseButton,O=void 0===d||d,v=e.closeOnBackdropClick,j=void 0===v||v,C=e.closeOnEscape,y=void 0===C||C,D=o(e,f),P=t((function(e,o){c&&("backdropClick"===o&&j&&c("backdropClick"),"escapeKeyDown"===o&&y&&c("escapeKey"))}),[c,j,y]),h=t((function(){null==c||c("closeButtonClick")}),[c]);return u(r,{open:s,className:n(a,m.root),onClose:P,children:u(l,b(b({},D),{},{onClose:h,showCloseButton:O,size:p}))})},j=function(e){var r=e.open,t=o(e,d),n=s({isOpen:r},!0).delayedIsOpen;return u(i,{children:u(v,b({open:n},t))})},C=function(e){var o=p(),r=c();return u(o&&!r?j:v,b({},e))};export{C as Modal};
1
+ import e from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/objectWithoutProperties";import{Modal as r}from"@material-ui/core";import{useCallback as t}from"react";import n from"classnames";import{useDelayedDcFullscreenElemOpen as s}from"../../effects/useDelayedDcFullscreenElemOpen.js";import{useIsInsideDcFullscreenElem as c,IsInsideDcFullscreenElemProvider as i}from"../../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import{useIsInsideIsolatedDcApp as p}from"../../components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import{ModalWindow as l}from"../ModalWindow/ModalWindow.js";import{MODAL_ROOT_CLASS as a}from"./constants.js";import m from"./Modal.scss.js";import{jsx as u}from"react/jsx-runtime";var f=["open","onClose","size","showCloseButton","closeOnBackdropClick","closeOnEscape"],d=["open"];function O(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function b(o){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?O(Object(t),!0).forEach((function(r){e(o,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}var v=function(e){var s=e.open,c=e.onClose,i=e.size,p=void 0===i?"medium":i,d=e.showCloseButton,O=void 0===d||d,v=e.closeOnBackdropClick,j=void 0===v||v,C=e.closeOnEscape,y=void 0===C||C,D=o(e,f),P=t((function(e,o){c&&("backdropClick"===o&&j&&c("backdropClick"),"escapeKeyDown"===o&&y&&c("escapeKey"))}),[c,j,y]),h=t((function(){null==c||c("closeButtonClick")}),[c]);return u(r,{open:s,className:n(a,m.root),onClose:P,disableEnforceFocus:!0,children:u(l,b(b({},D),{},{onClose:h,showCloseButton:O,size:p}))})},j=function(e){var r=e.open,t=o(e,d),n=s({isOpen:r},!0).delayedIsOpen;return u(i,{children:u(v,b({open:n},t))})},C=function(e){var o=p(),r=c();return u(o&&!r?j:v,b({},e))};export{C as Modal};
2
2
  //# sourceMappingURL=Modal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../../src/componentsV2/Modal/Modal.tsx"],"sourcesContent":["// TODO Move these hooks to better place so the imports won't be as hideous\nimport { Modal as MuiModal, ModalProps as MuiModalProps } from '@material-ui/core';\nimport { useCallback } from 'react';\nimport classNames from 'classnames';\n\nimport { useDelayedDcFullscreenElemOpen } from '../../effects/useDelayedDcFullscreenElemOpen';\nimport {\n IsInsideDcFullscreenElemProvider,\n useIsInsideDcFullscreenElem,\n} from '../../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider';\nimport { useIsInsideIsolatedDcApp } from '../../components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider';\nimport { ModalWindow, ModalWindowProps } from '../ModalWindow';\n\nimport { MODAL_ROOT_CLASS } from './constants';\n\nimport styles from './Modal.scss';\n\nexport type ModalProps = Omit<ModalWindowProps, 'onClose'> & {\n open: boolean;\n onClose?: (reason: 'backdropClick' | 'escapeKey' | 'closeButtonClick') => void;\n closeOnBackdropClick?: boolean;\n closeOnEscape?: boolean;\n};\n\nconst ActualModal = ({\n open,\n onClose,\n size = 'medium',\n showCloseButton = true,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n ...restProps\n}: ModalProps) => {\n const modalCloseHandler = useCallback<Required<MuiModalProps>['onClose']>(\n (_event, reason) => {\n if (onClose) {\n if (reason === 'backdropClick' && closeOnBackdropClick) {\n onClose('backdropClick');\n }\n if (reason === 'escapeKeyDown' && closeOnEscape) {\n onClose('escapeKey');\n }\n }\n },\n [onClose, closeOnBackdropClick, closeOnEscape]\n );\n\n const closeButtonClickHandler = useCallback(() => {\n onClose?.('closeButtonClick');\n }, [onClose]);\n\n return (\n <MuiModal\n open={open}\n className={classNames(MODAL_ROOT_CLASS, styles.root)}\n onClose={modalCloseHandler}\n >\n <ModalWindow\n {...restProps}\n onClose={closeButtonClickHandler}\n showCloseButton={showCloseButton}\n size={size}\n />\n </MuiModal>\n );\n};\n\nconst DcModal = ({ open: openProp, ...otherProps }: ModalProps) => {\n const { delayedIsOpen } = useDelayedDcFullscreenElemOpen({ isOpen: openProp }, true);\n\n return (\n <IsInsideDcFullscreenElemProvider>\n <ActualModal open={delayedIsOpen} {...otherProps} />\n </IsInsideDcFullscreenElemProvider>\n );\n};\n\nexport const Modal = (props: ModalProps) => {\n const isInsideDcApp = useIsInsideIsolatedDcApp();\n const isInsideDcFullscreenElem = useIsInsideDcFullscreenElem();\n\n const ModalComponent = isInsideDcApp && !isInsideDcFullscreenElem ? DcModal : ActualModal;\n\n return <ModalComponent {...props} />;\n};\n"],"names":["ActualModal","_ref","open","onClose","_ref$size","size","_ref$showCloseButton","showCloseButton","_ref$closeOnBackdropC","closeOnBackdropClick","_ref$closeOnEscape","closeOnEscape","restProps","_objectWithoutProperties","_excluded","modalCloseHandler","useCallback","_event","reason","closeButtonClickHandler","_jsx","MuiModal","className","classNames","MODAL_ROOT_CLASS","styles","root","children","ModalWindow","_objectSpread","DcModal","_ref2","openProp","otherProps","_excluded2","delayedIsOpen","useDelayedDcFullscreenElemOpen","isOpen","IsInsideDcFullscreenElemProvider","Modal","props","isInsideDcApp","useIsInsideIsolatedDcApp","isInsideDcFullscreenElem","useIsInsideDcFullscreenElem"],"mappings":"q/CAwBA,IAAMA,EAAc,SAQFC,GAAA,IAPhBC,IAAAA,KACAC,IAAAA,QAAOC,EAAAH,EACPI,KAAAA,aAAO,SAAQD,EAAAE,EAAAL,EACfM,gBAAAA,cAAsBD,EAAAE,EAAAP,EACtBQ,qBAAAA,cAA2BD,EAAAE,EAAAT,EAC3BU,cAAAA,cAAoBD,EACjBE,EAASC,EAAAZ,EAAAa,GAENC,EAAoBC,GACxB,SAACC,EAAQC,GACHf,IACa,kBAAXe,GAA8BT,GAChCN,EAAQ,iBAEK,kBAAXe,GAA8BP,GAChCR,EAAQ,aAGb,GACD,CAACA,EAASM,EAAsBE,IAG5BQ,EAA0BH,GAAY,WAC1Cb,SAAAA,EAAU,mBACZ,GAAG,CAACA,IAEJ,OACEiB,EAACC,EAAQ,CACPnB,KAAMA,EACNoB,UAAWC,EAAWC,EAAkBC,EAAOC,MAC/CvB,QAASY,EAAkBY,SAE3BP,EAACQ,EAAWC,EAAAA,EAAA,GACNjB,GAAS,GAAA,CACbT,QAASgB,EACTZ,gBAAiBA,EACjBF,KAAMA,MAId,EAEMyB,EAAU,SAAmDC,GAAA,IAA1CC,IAAN9B,KAAmB+B,EAAUpB,EAAAkB,EAAAG,GACtCC,EAAkBC,EAA+B,CAAEC,OAAQL,IAAY,GAAvEG,cAER,OACEf,EAACkB,EAAgC,CAAAX,SAC/BP,EAACpB,EAAW6B,EAAA,CAAC3B,KAAMiC,GAAmBF,KAG5C,EAEaM,EAAQ,SAACC,GACpB,IAAMC,EAAgBC,IAChBC,EAA2BC,IAIjC,OAAOxB,EAFgBqB,IAAkBE,EAA2Bb,EAAU9B,EAEnDwC,EAAAA,CAAAA,EAAAA,GAC7B"}
1
+ {"version":3,"file":"Modal.js","sources":["../../../src/componentsV2/Modal/Modal.tsx"],"sourcesContent":["// TODO Move these hooks to better place so the imports won't be as hideous\nimport { Modal as MuiModal, ModalProps as MuiModalProps } from '@material-ui/core';\nimport { useCallback } from 'react';\nimport classNames from 'classnames';\n\nimport { useDelayedDcFullscreenElemOpen } from '../../effects/useDelayedDcFullscreenElemOpen';\nimport {\n IsInsideDcFullscreenElemProvider,\n useIsInsideDcFullscreenElem,\n} from '../../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider';\nimport { useIsInsideIsolatedDcApp } from '../../components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider';\nimport { ModalWindow, ModalWindowProps } from '../ModalWindow';\n\nimport { MODAL_ROOT_CLASS } from './constants';\n\nimport styles from './Modal.scss';\n\nexport type ModalProps = Omit<ModalWindowProps, 'onClose'> & {\n open: boolean;\n onClose?: (reason: 'backdropClick' | 'escapeKey' | 'closeButtonClick') => void;\n closeOnBackdropClick?: boolean;\n closeOnEscape?: boolean;\n};\n\nconst ActualModal = ({\n open,\n onClose,\n size = 'medium',\n showCloseButton = true,\n closeOnBackdropClick = true,\n closeOnEscape = true,\n ...restProps\n}: ModalProps) => {\n const modalCloseHandler = useCallback<Required<MuiModalProps>['onClose']>(\n (_event, reason) => {\n if (onClose) {\n if (reason === 'backdropClick' && closeOnBackdropClick) {\n onClose('backdropClick');\n }\n if (reason === 'escapeKeyDown' && closeOnEscape) {\n onClose('escapeKey');\n }\n }\n },\n [onClose, closeOnBackdropClick, closeOnEscape]\n );\n\n const closeButtonClickHandler = useCallback(() => {\n onClose?.('closeButtonClick');\n }, [onClose]);\n\n return (\n <MuiModal\n open={open}\n className={classNames(MODAL_ROOT_CLASS, styles.root)}\n onClose={modalCloseHandler}\n disableEnforceFocus\n >\n <ModalWindow\n {...restProps}\n onClose={closeButtonClickHandler}\n showCloseButton={showCloseButton}\n size={size}\n />\n </MuiModal>\n );\n};\n\nconst DcModal = ({ open: openProp, ...otherProps }: ModalProps) => {\n const { delayedIsOpen } = useDelayedDcFullscreenElemOpen({ isOpen: openProp }, true);\n\n return (\n <IsInsideDcFullscreenElemProvider>\n <ActualModal open={delayedIsOpen} {...otherProps} />\n </IsInsideDcFullscreenElemProvider>\n );\n};\n\nexport const Modal = (props: ModalProps) => {\n const isInsideDcApp = useIsInsideIsolatedDcApp();\n const isInsideDcFullscreenElem = useIsInsideDcFullscreenElem();\n\n const ModalComponent = isInsideDcApp && !isInsideDcFullscreenElem ? DcModal : ActualModal;\n\n return <ModalComponent {...props} />;\n};\n"],"names":["ActualModal","_ref","open","onClose","_ref$size","size","_ref$showCloseButton","showCloseButton","_ref$closeOnBackdropC","closeOnBackdropClick","_ref$closeOnEscape","closeOnEscape","restProps","_objectWithoutProperties","_excluded","modalCloseHandler","useCallback","_event","reason","closeButtonClickHandler","_jsx","MuiModal","className","classNames","MODAL_ROOT_CLASS","styles","root","disableEnforceFocus","children","ModalWindow","_objectSpread","DcModal","_ref2","openProp","otherProps","_excluded2","delayedIsOpen","useDelayedDcFullscreenElemOpen","isOpen","IsInsideDcFullscreenElemProvider","Modal","props","isInsideDcApp","useIsInsideIsolatedDcApp","isInsideDcFullscreenElem","useIsInsideDcFullscreenElem"],"mappings":"q/CAwBA,IAAMA,EAAc,SAQFC,GAAA,IAPhBC,IAAAA,KACAC,IAAAA,QAAOC,EAAAH,EACPI,KAAAA,aAAO,SAAQD,EAAAE,EAAAL,EACfM,gBAAAA,cAAsBD,EAAAE,EAAAP,EACtBQ,qBAAAA,cAA2BD,EAAAE,EAAAT,EAC3BU,cAAAA,cAAoBD,EACjBE,EAASC,EAAAZ,EAAAa,GAENC,EAAoBC,GACxB,SAACC,EAAQC,GACHf,IACa,kBAAXe,GAA8BT,GAChCN,EAAQ,iBAEK,kBAAXe,GAA8BP,GAChCR,EAAQ,aAGb,GACD,CAACA,EAASM,EAAsBE,IAG5BQ,EAA0BH,GAAY,WAC1Cb,SAAAA,EAAU,mBACZ,GAAG,CAACA,IAEJ,OACEiB,EAACC,EAAQ,CACPnB,KAAMA,EACNoB,UAAWC,EAAWC,EAAkBC,EAAOC,MAC/CvB,QAASY,EACTY,qBAAmB,EAAAC,SAEnBR,EAACS,EAAWC,EAAAA,EAAA,GACNlB,GAAS,GAAA,CACbT,QAASgB,EACTZ,gBAAiBA,EACjBF,KAAMA,MAId,EAEM0B,EAAU,SAAmDC,GAAA,IAA1CC,IAAN/B,KAAmBgC,EAAUrB,EAAAmB,EAAAG,GACtCC,EAAkBC,EAA+B,CAAEC,OAAQL,IAAY,GAAvEG,cAER,OACEhB,EAACmB,EAAgC,CAAAX,SAC/BR,EAACpB,EAAW8B,EAAA,CAAC5B,KAAMkC,GAAmBF,KAG5C,EAEaM,EAAQ,SAACC,GACpB,IAAMC,EAAgBC,IAChBC,EAA2BC,IAIjC,OAAOzB,EAFgBsB,IAAkBE,EAA2Bb,EAAU/B,EAEnDyC,EAAAA,CAAAA,EAAAA,GAC7B"}