oa-componentbook 0.18.321 → 0.18.323
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/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/index.js +7 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +2 -1
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +257 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/package.json +2 -2
|
@@ -12,13 +12,14 @@ var _Elevation = _interopRequireDefault(require("./Elevation"));
|
|
|
12
12
|
var _GridLayout = _interopRequireDefault(require("./GridLayout"));
|
|
13
13
|
var _SpacingScales = _interopRequireDefault(require("./SpacingScales"));
|
|
14
14
|
var _Typographies = _interopRequireDefault(require("./Typographies"));
|
|
15
|
+
var _commonStyles = _interopRequireDefault(require("./commonStyles"));
|
|
15
16
|
require("antd/dist/reset.css");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
function GlobalCss(_ref) {
|
|
18
19
|
let {
|
|
19
20
|
children
|
|
20
21
|
} = _ref;
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_BorderRadius.default, null), /*#__PURE__*/_react.default.createElement(_SpacingScales.default, null), /*#__PURE__*/_react.default.createElement(_ColorVariables.default, null), /*#__PURE__*/_react.default.createElement(_Elevation.default, null), /*#__PURE__*/_react.default.createElement(_GridLayout.default, null), /*#__PURE__*/_react.default.createElement(_Typographies.default, null), children);
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_BorderRadius.default, null), /*#__PURE__*/_react.default.createElement(_SpacingScales.default, null), /*#__PURE__*/_react.default.createElement(_ColorVariables.default, null), /*#__PURE__*/_react.default.createElement(_Elevation.default, null), /*#__PURE__*/_react.default.createElement(_GridLayout.default, null), /*#__PURE__*/_react.default.createElement(_commonStyles.default, null), /*#__PURE__*/_react.default.createElement(_Typographies.default, null), children);
|
|
22
23
|
}
|
|
23
24
|
GlobalCss.propTypes = {
|
|
24
25
|
children: _propTypes.default.node.isRequired
|
|
@@ -21,5 +21,5 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
21
21
|
// TODO: Figure out a way to make this work with storybook.
|
|
22
22
|
// Can be used to wrap the entire application, to make these styles available to every component
|
|
23
23
|
|
|
24
|
-
const GridLayout = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.container {\n max-width: 1154px;\n margin: 0 auto;\n padding: 0 16px;\n}\n\n.container-fluid {\n width: 100%;\n padding: 0 16px;\n}\n\n.row {\n display: flex;\n flex-direction: column;\n}\n\n.gutter {\n padding: 0 24px 0 0;\n}\n\n.row::after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.col-xs-1 {\n width: 8.33333%;\n}\n\n.col-xs-2 {\n width: 16.66667%;\n}\n\n.col-xs-3 {\n width: 25%;\n}\n\n.col-xs-4 {\n width: 33.33333%;\n}\n\n.col-xs-5 {\n width: 41.66667%;\n}\n\n.col-xs-6 {\n width: 50%;\n}\n\n.col-xs-7 {\n width: 58.33333%;\n}\n\n.col-xs-8 {\n width: 66.66667%;\n}\n\n.col-xs-9 {\n width: 75%;\n}\n\n.col-xs-10 {\n width: 83.33333%;\n}\n\n.col-xs-11 {\n width: 91.66667%;\n}\n\n.col-xs-12 {\n width: 100%;\n}\n\n@media (min-width: 768px) {\n .row {\n flex-direction: row;\n }\n\n .col-sm-1 {\n width: 8.33333%;\n }\n\n .col-sm-2 {\n width: 16.66667%;\n }\n\n .col-sm-3 {\n width: 25%;\n }\n\n .col-sm-4 {\n width: 33.33333%;\n }\n\n .col-sm-5 {\n width: 41.66667%;\n }\n\n .col-sm-6 {\n width: 50%;\n }\n\n .col-sm-7 {\n width: 58.33333%;\n }\n\n .col-sm-8 {\n width: 66.66667%;\n }\n\n .col-sm-9 {\n width: 75%;\n }\n\n .col-sm-10 {\n width: 83.33333%;\n }\n\n .col-sm-11 {\n width: 91.66667%;\n }\n\n .col-sm-12 {\n width: 100%;\n }\n}\n\n@media (min-width: 768px) {\n .col-md-1 {\n width: 8.33333%;\n }\n\n .col-md-2 {\n width: 16.66667%;\n }\n\n .col-md-3 {\n width: 25%;\n }\n\n .col-md-4 {\n width: 33.33333%;\n float: left;\n }\n\n .col-md-5 {\n width: 41.66667%;\n }\n\n .col-md-6 {\n width: 50%;\n }\n\n .col-md-7 {\n width: 58.33333%;\n }\n\n .col-md-8 {\n width: 66.66667%;\n }\n\n .col-md-9 {\n width: 75%;\n }\n\n .col-md-10 {\n width: 83.33333%;\n }\n\n .col-md-11 {\n width: 91.66667%;\n }\n\n .col-md-12 {\n width: 100%;\n }\n}\n\n/* Large Devices (desktops) */\n@media (min-width: 992px) {\n .gutter {\n padding: 0 24px 0 0;\n }\n\n .col-lg-1 {\n width: 8.33333%;\n }\n\n .col-lg-2 {\n width: 16.66667%;\n }\n\n .col-lg-3 {\n width: 25%;\n }\n\n .col-lg-4 {\n width: 33.33333%;\n }\n\n .col-lg-5 {\n width: 41.66667%;\n }\n\n .col-lg-6 {\n width: 50%;\n }\n\n .col-lg-7 {\n width: 58.33333%;\n }\n\n .col-lg-8 {\n width: 66.66667%;\n }\n\n .col-lg-9 {\n width: 75%;\n }\n\n .col-lg-10 {\n width: 83.33333%;\n }\n\n .col-lg-11 {\n width: 91.66667%;\n }\n\n .col-lg-12 {\n width: 100%;\n }\n}\n.ant-modal .ant-modal-content {\n padding: 24px 24px 32px;\n border-radius: 12px;\n }\n .ant-select-dropdown .ant-select-item{\n min-height: auto !important;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice-message{\n margin-bottom: 0 !important;\n }\n .ant-notification .ant-notification-notice-wrapper{\n background: transparent;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice-close{\n position: inherit !important;\n width: 24px !important;\n height: 24px !important;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice-closable .ant-notification-notice-message {\n padding-inline-end: 0px !important;\n}\n .ant-notification-notice-close > button{\n width: 24px !important;\n height: 24px !important;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice {\n display: flex;\n align-items: center;\n gap: 12px;\n justify-content: space-between;\n }\n @media (max-width: 372px) {\n .ant-picker-date-panel .ant-picker-body{\n padding: 8px !important;\n }\n }\n@media (max-width: 600px) {\n .ant-drawer .ant-drawer-header,.ant-drawer .ant-drawer-body{\n padding: 16px !important;\n }\n .ant-drawer .ant-drawer-footer {\n padding: 12px 16px;\n }\n .ant-picker-dropdown .ant-picker-date-panel{\n width: 100%;\n }\n .ant-picker-dropdown .ant-picker-time-panel-column {\n overflow-y: auto;\n}\n.ant-picker-dropdown .ant-picker-time-panel-column::-webkit-scrollbar {\n width: 2px;\n }\n\n .ant-modal-root .ant-modal-wrap {\n position: fixed;\n overflow: inherit;\n }\n .ant-modal-root .ant-modal-centered .ant-modal{\n vertical-align: middle;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100% !important;\n max-width: 100%!important;\n // transform-origin: bottom !important;\n //animation-duration: 0s !important;\n animation-name: slideUp;\n animation-duration: 0.2s;\n transition: .3s ease-in-out;\n animation-timing-function: ease-in;\n }\n @keyframes slideUp {\n 0%,\n 50% {\n transform: translateY(100%);\n opacity: 0;\n }\n \n 60%,\n 100% {\n transform: translateY(0);\n opacity: 1;\n \n }\n }\n .ant-modal .ant-modal-content {\n bottom: -8px;\n left: 0;\n position: absolute;\n right: 0;\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n .ant-modal .ant-modal-body{\n max-height: calc(90vh - 126px);\n overflow: auto;\n padding-right: 16px;\n }\n .ant-modal-footer{\n padding-right: 16px !important;\n }\n .ant-modal .ant-modal-content{\n padding: 24px 16px 32px;\n padding-right: 0;\n }\n}\n@media (min-width: 1200px) {\n .gutter {\n padding: 0 32px 0 0;\n }\n\n .col-xl-1 {\n width: 8.33333%;\n }\n \n .col-xl-2 {\n width: 16.66667%;\n }\n\n .col-xl-3 {\n width: 25%;\n }\n\n .col-xl-4 {\n width: 33.33333%;\n }\n\n .col-xl-5 {\n width: 41.66667%;\n }\n\n .col-xl-6 {\n width: 50%;\n }\n\n .col-xl-7 {\n width: 58.33333%;\n }\n\n .col-xl-8 {\n width: 66.66667%;\n }\n\n .col-xl-9 {\n width: 75%;\n }\n\n .col-xl-10 {\n width: 83.33333%;\n }\n\n .col-xl-11 {\n width: 91.66667%;\n }\n\n .col-xl-12 {\n width: 100%;\n }\n \n}\n\n.ant-dropdown .ant-dropdown-menu .ant-dropdown-menu-item{\n padding: 12px 24px;\n}\n.ant-dropdown-menu{\n min-width: 256px;\n top: 4px;\n}\n.ant-space-item span{\n line-height: 0 !important;\n display: flex;\n}\n\n\n.ant-select-dropdown{border-radius: 4px; padding:8px 0 !important;\n background: var(--color-primary-background) ;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);}\n\n\n\n .ant-select-dropdown .ant-select-item { \n min-height: auto;\n padding: 12px 16px;\n color: var(--color-primary-content) ;\n line-height: 20px;\n border-radius: 0px;\n}\n\n.label-date-dropdown {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 16px;\n}\n\n.ant-select-dropdown .ant-select-item-option-active span{ color: var(--color-primary) !important;}\n.ant-picker-range {opacity: 0;}\n.ant-picker-dropdown-range { padding: 0; }\n\n.fadeImg{\n position: relative;\n width: 100%;\n max-height: 300px;\n overflow-x: auto;\n}\n.overLayImg{\n background: rgb(0 0 0 / 40%);\n border-radius: 12px 12px 0px 0px;\n overflow: hidden;\n}\n \n .OaTooltip .ant-tooltip-inner{\n padding: 24px 16px;\n background: #fff;\n color: #212121;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n width: 348px;\n border-radius: 12px;\n }\n .OaTooltip .ant-tooltip-arrow:before{\n background: #fff !important;\n }\n .OaFooterBtn{\n display: flex;\n justify-content: end;\n }\n .OaTooltip{\n max-width: 348px !important;\n }\n.paddingBot .ant-drawer-body{\n padding-bottom: 100px !important;\n}\n.react-transform-component,.react-transform-wrapper,.react-transform-component > div{\n width: 100%;\n}\n.ascCollapse .ant-collapse-arrow{\n transform: rotate(90deg);\n color: var(--color-primary) !important;\n font-size: 14px !important;\n}\n.gappingIcons{\n display: flex;\n gap: 16px;\n}\n.imageZoom .ant-modal-body > div{\n height: 350px;\n overflow-y: auto;\n margin: 30px 0px 0px;\n padding: 0px 8px 0 0;;\n \n}\n/* width */\n.imageZoom ::-webkit-scrollbar {\n width: 8px;\n height: 100px;\n border-radius: 8px;\n}\n\n/* Track */\n.imageZoom ::-webkit-scrollbar-track {\n background: #f6f6f6; \n border-radius: 8px;\n}\n \n/* Handle */\n.imageZoom ::-webkit-scrollbar-thumb {\n background: #888; \n border-radius: 8px;\n height: 100px;\n}\n\n/* Handle on hover */\n.imageZoom ::-webkit-scrollbar-thumb:hover {\n background: #555; \n}\n .modalImg{\n width: 100%;\n }\n.overflowScroll{\n position: relative;\n}\n.ascCollapse .ant-collapse-header{\n border-radius: 4px !important;\n background: var(--color-secondary-background);\n}\n.ascCollapse,.ant-collapse{\n overflow: hidden;\n}\n.ascCollapse .totalVal{\n display: flex;\n gap: 12px;\n}\n.ascCollapse.ant-collapse-item-active .ant-collapse-arrow{\n transform: rotate(180deg) !important;\n}.mobilesIcons li.ant-dropdown-menu-item > svg {\n display: none\n}\n .ant-notification-notice-close svg{\n font-size: 24px !important;\n height: auto;\n }\n @media only screen and (max-width: 574px) {\n .ant-steps-item-tail{\n inset-inline-start: 78px !important;\n \n }\n}\n @media only screen and (max-width: 480px) {\n .ant-steps-item-tail{\n inset-inline-start: 60px !important;\n \n }\n}\n@media only screen and (max-width: 600px) {\n \n .ant-picker-dropdown .ant-picker-date-panel .ant-picker-body {\n padding: 8px;\n }\n .ant-picker-dropdown { width: 100%; left: 0 !important; }\n .mobilesIcons li.ant-dropdown-menu-item > svg {\n display: block;\n}\n.imageZoom .ant-modal-body>div{\n height: auto;\n overflow-y: auto;\n}\n.imageZoom .ant-modal-footer{\n padding-right: 16px !important;\n}\n .fadeImg{\n max-height: auto;\n }\n .ant-picker-dropdown .ant-picker-date-panel .ant-picker-content th {\n width: 24px; font-size: 12px; font-weight: bold; }\n\n .ant-picker-dropdown .ant-picker-content th {\n height: 24px;\n }\n .ant-picker-dropdown .ant-picker-content td {\n font-size: 12px;\n }\n .ant-picker-dropdown .ant-picker-date-panel .ant-picker-content {\n width: 100%;\n }\n\n}\n\n\n.ant-picker .ant-picker-clear{\n font-size: 20px;\n}\n \n"])));
|
|
24
|
+
const GridLayout = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.container {\n max-width: 1154px;\n margin: 0 auto;\n padding: 0 16px;\n}\n\n.container-fluid {\n width: 100%;\n padding: 0 16px;\n}\n\n.row {\n display: flex;\n flex-direction: column;\n}\n\n.gutter {\n padding: 0 24px 0 0;\n}\n\n.row::after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.col-xs-1 {\n width: 8.33333%;\n}\n\n.col-xs-2 {\n width: 16.66667%;\n}\n\n.col-xs-3 {\n width: 25%;\n}\n\n.col-xs-4 {\n width: 33.33333%;\n}\n\n.col-xs-5 {\n width: 41.66667%;\n}\n\n.col-xs-6 {\n width: 50%;\n}\n\n.col-xs-7 {\n width: 58.33333%;\n}\n\n.col-xs-8 {\n width: 66.66667%;\n}\n\n.col-xs-9 {\n width: 75%;\n}\n\n.col-xs-10 {\n width: 83.33333%;\n}\n\n.col-xs-11 {\n width: 91.66667%;\n}\n\n.col-xs-12 {\n width: 100%;\n}\n\n@media (min-width: 768px) {\n .row {\n flex-direction: row;\n }\n\n .col-sm-1 {\n width: 8.33333%;\n }\n\n .col-sm-2 {\n width: 16.66667%;\n }\n\n .col-sm-3 {\n width: 25%;\n }\n\n .col-sm-4 {\n width: 33.33333%;\n }\n\n .col-sm-5 {\n width: 41.66667%;\n }\n\n .col-sm-6 {\n width: 50%;\n }\n\n .col-sm-7 {\n width: 58.33333%;\n }\n\n .col-sm-8 {\n width: 66.66667%;\n }\n\n .col-sm-9 {\n width: 75%;\n }\n\n .col-sm-10 {\n width: 83.33333%;\n }\n\n .col-sm-11 {\n width: 91.66667%;\n }\n\n .col-sm-12 {\n width: 100%;\n }\n}\n\n@media (min-width: 768px) {\n .col-md-1 {\n width: 8.33333%;\n }\n\n .col-md-2 {\n width: 16.66667%;\n }\n\n .col-md-3 {\n width: 25%;\n }\n\n .col-md-4 {\n width: 33.33333%;\n float: left;\n }\n\n .col-md-5 {\n width: 41.66667%;\n }\n\n .col-md-6 {\n width: 50%;\n }\n\n .col-md-7 {\n width: 58.33333%;\n }\n\n .col-md-8 {\n width: 66.66667%;\n }\n\n .col-md-9 {\n width: 75%;\n }\n\n .col-md-10 {\n width: 83.33333%;\n }\n\n .col-md-11 {\n width: 91.66667%;\n }\n\n .col-md-12 {\n width: 100%;\n }\n}\n\n/* Large Devices (desktops) */\n@media (min-width: 992px) {\n .gutter {\n padding: 0 24px 0 0;\n }\n\n .col-lg-1 {\n width: 8.33333%;\n }\n\n .col-lg-2 {\n width: 16.66667%;\n }\n\n .col-lg-3 {\n width: 25%;\n }\n\n .col-lg-4 {\n width: 33.33333%;\n }\n\n .col-lg-5 {\n width: 41.66667%;\n }\n\n .col-lg-6 {\n width: 50%;\n }\n\n .col-lg-7 {\n width: 58.33333%;\n }\n\n .col-lg-8 {\n width: 66.66667%;\n }\n\n .col-lg-9 {\n width: 75%;\n }\n\n .col-lg-10 {\n width: 83.33333%;\n }\n\n .col-lg-11 {\n width: 91.66667%;\n }\n\n .col-lg-12 {\n width: 100%;\n }\n} \n \n\n@media (min-width: 1200px) {\n .gutter {\n padding: 0 32px 0 0;\n }\n\n .col-xl-1 {\n width: 8.33333%;\n }\n \n .col-xl-2 {\n width: 16.66667%;\n }\n\n .col-xl-3 {\n width: 25%;\n }\n\n .col-xl-4 {\n width: 33.33333%;\n }\n\n .col-xl-5 {\n width: 41.66667%;\n }\n\n .col-xl-6 {\n width: 50%;\n }\n\n .col-xl-7 {\n width: 58.33333%;\n }\n\n .col-xl-8 {\n width: 66.66667%;\n }\n\n .col-xl-9 {\n width: 75%;\n }\n\n .col-xl-10 {\n width: 83.33333%;\n }\n\n .col-xl-11 {\n width: 91.66667%;\n }\n\n .col-xl-12 {\n width: 100%;\n }\n \n}\n"])));
|
|
25
25
|
var _default = exports.default = GridLayout;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = require("styled-components");
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
+
const CommonStyles = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-modal .ant-modal-content {\n padding: 24px 24px 32px;\n border-radius: 12px;\n }\n .ant-select-dropdown .ant-select-item{\n min-height: auto !important;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice-message{\n margin-bottom: 0 !important;\n }\n .ant-notification .ant-notification-notice-wrapper{\n background: transparent;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice-close{\n position: inherit !important;\n width: 24px !important;\n height: 24px !important;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice-closable .ant-notification-notice-message {\n padding-inline-end: 0px !important;\n}\n .ant-notification-notice-close > button{\n width: 24px !important;\n height: 24px !important;\n }\n .ant-notification .ant-notification-notice-wrapper .ant-notification-notice {\n display: flex;\n align-items: center;\n gap: 12px;\n justify-content: space-between;\n }\n @media (max-width: 372px) {\n .ant-picker-date-panel .ant-picker-body{\n padding: 8px !important;\n }\n }\n@media (max-width: 600px) {\n .ant-drawer .ant-drawer-header,.ant-drawer .ant-drawer-body{\n padding: 16px !important;\n }\n .ant-drawer .ant-drawer-footer {\n padding: 12px 16px;\n }\n .ant-picker-dropdown .ant-picker-date-panel{\n width: 100%;\n }\n .ant-picker-dropdown .ant-picker-time-panel-column {\n overflow-y: auto;\n}\n.ant-picker-dropdown .ant-picker-time-panel-column::-webkit-scrollbar {\n width: 2px;\n }\n\n .ant-modal-root .ant-modal-wrap {\n position: fixed;\n overflow: inherit;\n }\n .ant-modal-root .ant-modal-centered .ant-modal{\n vertical-align: middle;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100% !important;\n max-width: 100%!important;\n // transform-origin: bottom !important;\n //animation-duration: 0s !important;\n animation-name: slideUp;\n animation-duration: 0.2s;\n transition: .3s ease-in-out;\n animation-timing-function: ease-in;\n }\n @keyframes slideUp {\n 0%,\n 50% {\n transform: translateY(100%);\n opacity: 0;\n }\n \n 60%,\n 100% {\n transform: translateY(0);\n opacity: 1;\n \n }\n }\n .ant-modal .ant-modal-content {\n bottom: -8px;\n left: 0;\n position: absolute;\n right: 0;\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n .ant-modal .ant-modal-body{\n max-height: calc(90vh - 126px);\n overflow: auto;\n padding-right: 16px;\n }\n .ant-modal-footer{\n padding-right: 16px !important;\n }\n .ant-modal .ant-modal-content{\n padding: 24px 16px 32px;\n padding-right: 0;\n }\n}\n\n.ant-dropdown .ant-dropdown-menu .ant-dropdown-menu-item{\n padding: 12px 24px;\n}\n.ant-dropdown-menu{\n min-width: 256px;\n top: 4px;\n}\n.ant-space-item span{\n line-height: 0 !important;\n display: flex;\n}\n.ant-select-dropdown{border-radius: 4px; padding:8px 0 !important;\n background: var(--color-primary-background) ;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);}\n\n.ant-select-dropdown .ant-select-item { \n min-height: auto;\n padding: 12px 16px;\n color: var(--color-primary-content) ;\n line-height: 20px;\n border-radius: 0px;\n}\n\n.label-date-dropdown {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 16px;\n}\n\n.ant-select-dropdown .ant-select-item-option-active span{ color: var(--color-primary) !important;}\n.ant-picker-range {opacity: 0;}\n.ant-picker-dropdown-range { padding: 0; }\n\n.fadeImg{\n position: relative;\n width: 100%;\n max-height: 300px;\n overflow-x: auto;\n}\n.overLayImg{\n background: rgb(0 0 0 / 40%);\n border-radius: 12px 12px 0px 0px;\n overflow: hidden;\n}\n \n.OaTooltip .ant-tooltip-inner{\n padding: 24px 16px;\n background: #fff;\n color: #212121;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n width: 348px;\n border-radius: 12px;\n}\n.OaTooltip .ant-tooltip-arrow:before{\n background: #fff !important;\n}\n.OaFooterBtn{\n display: flex;\n justify-content: end;\n}\n.OaTooltip{\n max-width: 348px !important;\n}\n.paddingBot .ant-drawer-body{\n padding-bottom: 100px !important;\n}\n.react-transform-component,.react-transform-wrapper,.react-transform-component > div{\n width: 100%;\n}\n.ascCollapse .ant-collapse-arrow{\n transform: rotate(90deg);\n color: var(--color-primary) !important;\n font-size: 14px !important;\n}\n.gappingIcons{\n display: flex;\n gap: 16px;\n}\n.imageZoom .ant-modal-body > div{\n height: 350px;\n overflow-y: auto;\n margin: 30px 0px 0px;\n padding: 0px 8px 0 0;;\n \n}\n/* width */\n.imageZoom ::-webkit-scrollbar {\n width: 8px;\n height: 100px;\n border-radius: 8px;\n}\n\n/* Track */\n.imageZoom ::-webkit-scrollbar-track {\n background: #f6f6f6; \n border-radius: 8px;\n}\n \n/* Handle */\n.imageZoom ::-webkit-scrollbar-thumb {\n background: #888; \n border-radius: 8px;\n height: 100px;\n}\n\n/* Handle on hover */\n.imageZoom ::-webkit-scrollbar-thumb:hover {\n background: #555; \n}\n .modalImg{\n width: 100%;\n }\n.overflowScroll{\n position: relative;\n}\n.ascCollapse .ant-collapse-header{\n border-radius: 4px !important;\n background: var(--color-secondary-background);\n}\n.ascCollapse,.ant-collapse{\n overflow: hidden;\n}\n.ascCollapse .totalVal{\n display: flex;\n gap: 12px;\n}\n.ascCollapse.ant-collapse-item-active .ant-collapse-arrow{\n transform: rotate(180deg) !important;\n}.mobilesIcons li.ant-dropdown-menu-item > svg {\n display: none\n}\n .ant-notification-notice-close svg{\n font-size: 24px !important;\n height: auto;\n }\n @media only screen and (max-width: 574px) {\n .ant-steps-item-tail{\n inset-inline-start: 78px !important;\n \n }\n}\n @media only screen and (max-width: 480px) {\n .ant-steps-item-tail{\n inset-inline-start: 60px !important;\n \n }\n}\n@media only screen and (max-width: 600px) {\n \n .ant-picker-dropdown .ant-picker-date-panel .ant-picker-body {\n padding: 8px;\n }\n .ant-picker-dropdown { width: 100%; left: 0 !important; }\n .mobilesIcons li.ant-dropdown-menu-item > svg {\n display: block;\n}\n.imageZoom .ant-modal-body>div{\n height: auto;\n overflow-y: auto;\n}\n.imageZoom .ant-modal-footer{\n padding-right: 16px !important;\n}\n .fadeImg{\n max-height: auto;\n }\n .ant-picker-dropdown .ant-picker-date-panel .ant-picker-content th {\n width: 24px; font-size: 12px; font-weight: bold; }\n\n .ant-picker-dropdown .ant-picker-content th {\n height: 24px;\n }\n .ant-picker-dropdown .ant-picker-content td {\n font-size: 12px;\n }\n .ant-picker-dropdown .ant-picker-date-panel .ant-picker-content {\n width: 100%;\n }\n\n}\n.ant-picker .ant-picker-clear{\n font-size: 20px;\n}\n"])));
|
|
11
|
+
var _default = exports.default = CommonStyles;
|
package/build/index.js
CHANGED
|
@@ -353,6 +353,12 @@ Object.defineProperty(exports, "GridLayout", {
|
|
|
353
353
|
return _GridLayout.default;
|
|
354
354
|
}
|
|
355
355
|
});
|
|
356
|
+
Object.defineProperty(exports, "ImageCarouselWidget", {
|
|
357
|
+
enumerable: true,
|
|
358
|
+
get: function get() {
|
|
359
|
+
return _ImageCarouselWidget.default;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
356
362
|
Object.defineProperty(exports, "KeyValueWidget", {
|
|
357
363
|
enumerable: true,
|
|
358
364
|
get: function get() {
|
|
@@ -633,6 +639,7 @@ var _ServiceCard = _interopRequireDefault(require("./widgets/oa-widget-serviceca
|
|
|
633
639
|
var _CustomProgressBar = _interopRequireDefault(require("./components/oa-component-progress-bar/CustomProgressBar"));
|
|
634
640
|
var _CustomHeaderWidget = _interopRequireDefault(require("./widgets/oa-widget-header/CustomHeaderWidget"));
|
|
635
641
|
var _CustomPinPatternCaptureWidget = _interopRequireDefault(require("./widgets/oa-widget-input-pattern-pin/CustomPinPatternCaptureWidget"));
|
|
642
|
+
var _ImageCarouselWidget = _interopRequireDefault(require("./widgets/oa-widget-image-carousel/ImageCarouselWidget"));
|
|
636
643
|
var _CustomFormWidget = _interopRequireDefault(require("./widgets/oa-widget-form/CustomFormWidget"));
|
|
637
644
|
var _DateDropDown = _interopRequireDefault(require("./widgets/oa-widget-date-dropdown/DateDropDown"));
|
|
638
645
|
var _CustomRating = _interopRequireDefault(require("./components/oa-component-rating/CustomRating"));
|
|
@@ -82,7 +82,8 @@ function AddSparePartCollapseWidget(_ref) {
|
|
|
82
82
|
setActiveKey(Array.from(initialSelectedItems).map(String)); // Set initially selected items as active keys
|
|
83
83
|
}, [selectedItems]);
|
|
84
84
|
(0, _react.useEffect)(() => {
|
|
85
|
-
|
|
85
|
+
var _selectedItems$map$fi, _items$filter;
|
|
86
|
+
const sortedItems = [...((_selectedItems$map$fi = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(item => items && items.find(i => i.id === item.scopeId)).filter(Boolean)) !== null && _selectedItems$map$fi !== void 0 ? _selectedItems$map$fi : []), ...((_items$filter = items === null || items === void 0 ? void 0 : items.filter(item => !selectedItems.some(selected => selected.scopeId === item.id))) !== null && _items$filter !== void 0 ? _items$filter : [])];
|
|
86
87
|
setFilteredItems(sortedItems);
|
|
87
88
|
}, [items, selectedItems]);
|
|
88
89
|
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
require("core-js/modules/es.promise.js");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _icons = require("@ant-design/icons");
|
|
15
|
+
var _TouchAppRounded = _interopRequireDefault(require("@material-ui/icons/TouchAppRounded"));
|
|
16
|
+
var _reactZoomPanPinch = require("react-zoom-pan-pinch");
|
|
17
|
+
var _Fullscreen = _interopRequireDefault(require("@material-ui/icons/Fullscreen"));
|
|
18
|
+
var _ArrowForwardRounded = _interopRequireDefault(require("@material-ui/icons/ArrowForwardRounded"));
|
|
19
|
+
var _ArrowBackRounded = _interopRequireDefault(require("@material-ui/icons/ArrowBackRounded"));
|
|
20
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
21
|
+
var _CustomModal = _interopRequireDefault(require("../../components/oa-component-modal/CustomModal"));
|
|
22
|
+
var _styles = require("./styles");
|
|
23
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
24
|
+
var _CustomLoader = _interopRequireDefault(require("../../components/oa-component-loader/CustomLoader"));
|
|
25
|
+
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
26
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
29
|
+
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 && Object.prototype.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; }
|
|
30
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
34
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
35
|
+
/**
|
|
36
|
+
* ImageCarouselWidget is a component that displays images in a carousel and allows zooming and switching between original and heatmap images.
|
|
37
|
+
* @param {object} props The props passed to the component
|
|
38
|
+
* @param {array} [props.images={}] An object with keys representing image types and values as arrays of images
|
|
39
|
+
* @param {boolean} [props.visible=false] Whether the modal is visible
|
|
40
|
+
* @param {function} [props.onClose] A function that is called when the modal is closed
|
|
41
|
+
* @returns {object} A React component
|
|
42
|
+
*/
|
|
43
|
+
function ImageCarouselWidget(_ref) {
|
|
44
|
+
let {
|
|
45
|
+
images = [],
|
|
46
|
+
visible,
|
|
47
|
+
onClose,
|
|
48
|
+
headingSuffixText,
|
|
49
|
+
typeToNamemapping,
|
|
50
|
+
s3DownloadApiUrl,
|
|
51
|
+
initialImageType
|
|
52
|
+
} = _ref;
|
|
53
|
+
const [currentIndex, setCurrentIndex] = (0, _react.useState)(0);
|
|
54
|
+
const [showHeatmap, setShowHeatmap] = (0, _react.useState)(initialImageType === 'heatmap');
|
|
55
|
+
const [fullscreen, setFullscreen] = (0, _react.useState)(false);
|
|
56
|
+
const [imageUrls, setImageUrls] = (0, _react.useState)([]);
|
|
57
|
+
const [loading, setLoading] = (0, _react.useState)(false);
|
|
58
|
+
const carouselRef = _react.default.useRef(null);
|
|
59
|
+
|
|
60
|
+
// Fetch image URL by UUID
|
|
61
|
+
const fetchImageUrl = uuid => fetch("".concat(s3DownloadApiUrl).concat(uuid)).then(response => response.json()).then(data => {
|
|
62
|
+
var _data$data;
|
|
63
|
+
return data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.downloadUrl;
|
|
64
|
+
}) // Assuming the API response has `src` key for the image URL
|
|
65
|
+
.catch(error => {
|
|
66
|
+
console.error('Error fetching image URL:', error);
|
|
67
|
+
return ''; // Return an empty string if there's an error
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Fetch image URLs for all grouped images
|
|
71
|
+
(0, _react.useEffect)(() => {
|
|
72
|
+
const fetchImages = async () => {
|
|
73
|
+
setLoading(true);
|
|
74
|
+
const urls = await Promise.all(images.map(async img => {
|
|
75
|
+
const imageSrcUrl = await fetchImageUrl(showHeatmap ? img.heatmapDocId : img.originalDocId); // Fetch URL for the image
|
|
76
|
+
return _objectSpread(_objectSpread({}, img), showHeatmap ? {
|
|
77
|
+
heatmapImageUrl: imageSrcUrl
|
|
78
|
+
} : {
|
|
79
|
+
originalImageUrl: imageSrcUrl
|
|
80
|
+
});
|
|
81
|
+
}));
|
|
82
|
+
console.log(urls);
|
|
83
|
+
setImageUrls(urls);
|
|
84
|
+
setLoading(false);
|
|
85
|
+
};
|
|
86
|
+
fetchImages();
|
|
87
|
+
}, [images === null || images === void 0 ? void 0 : images.length]);
|
|
88
|
+
|
|
89
|
+
// Enter fullscreen for the whole document
|
|
90
|
+
const enterFullscreen = () => {
|
|
91
|
+
if (document.documentElement.requestFullscreen) {
|
|
92
|
+
document.documentElement.requestFullscreen();
|
|
93
|
+
} else if (document.documentElement.mozRequestFullScreen) {
|
|
94
|
+
// Firefox
|
|
95
|
+
document.documentElement.mozRequestFullScreen();
|
|
96
|
+
} else if (document.documentElement.webkitRequestFullscreen) {
|
|
97
|
+
// Chrome, Safari, Opera
|
|
98
|
+
document.documentElement.webkitRequestFullscreen();
|
|
99
|
+
} else if (document.documentElement.msRequestFullscreen) {
|
|
100
|
+
// IE/Edge
|
|
101
|
+
document.documentElement.msRequestFullscreen();
|
|
102
|
+
}
|
|
103
|
+
setFullscreen(true);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// Exit fullscreen
|
|
107
|
+
const exitFullscreen = () => {
|
|
108
|
+
if (document.exitFullscreen) {
|
|
109
|
+
document.exitFullscreen();
|
|
110
|
+
} else if (document.mozCancelFullScreen) {
|
|
111
|
+
// Firefox
|
|
112
|
+
document.mozCancelFullScreen();
|
|
113
|
+
} else if (document.webkitExitFullscreen) {
|
|
114
|
+
// Chrome, Safari and Opera
|
|
115
|
+
document.webkitExitFullscreen();
|
|
116
|
+
} else if (document.msExitFullscreen) {
|
|
117
|
+
// IE/Edge
|
|
118
|
+
document.msExitFullscreen();
|
|
119
|
+
}
|
|
120
|
+
setFullscreen(false);
|
|
121
|
+
};
|
|
122
|
+
const handleFullscreenToggle = () => {
|
|
123
|
+
if (fullscreen) {
|
|
124
|
+
exitFullscreen();
|
|
125
|
+
} else {
|
|
126
|
+
enterFullscreen();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const handleImageChange = newIndex => {
|
|
130
|
+
setCurrentIndex(newIndex);
|
|
131
|
+
};
|
|
132
|
+
const handleShowHeatmap = async () => {
|
|
133
|
+
const currentViewType = !showHeatmap; // Toggle the current view mode (show heatmap or not)
|
|
134
|
+
setLoading(true);
|
|
135
|
+
|
|
136
|
+
// Fetching URLs for all images based on the new view mode
|
|
137
|
+
const updatedImages = await Promise.all(imageUrls.map(async img => {
|
|
138
|
+
var _img$heatmapImageUrl, _img$originalImageUrl;
|
|
139
|
+
// Check if the image is already fetched
|
|
140
|
+
const isImageAlreadyFetched = currentViewType && ((_img$heatmapImageUrl = img.heatmapImageUrl) === null || _img$heatmapImageUrl === void 0 ? void 0 : _img$heatmapImageUrl.length) > 0 || !currentViewType && ((_img$originalImageUrl = img.originalImageUrl) === null || _img$originalImageUrl === void 0 ? void 0 : _img$originalImageUrl.length) > 0;
|
|
141
|
+
// Fetch the image URL only if it's not already fetched
|
|
142
|
+
if (!isImageAlreadyFetched) {
|
|
143
|
+
const imageSrcUrl = await fetchImageUrl(currentViewType ? img.heatmapDocId : img.originalDocId);
|
|
144
|
+
// Return the updated image object with the appropriate URL
|
|
145
|
+
return _objectSpread(_objectSpread({}, img), currentViewType ? {
|
|
146
|
+
heatmapImageUrl: imageSrcUrl
|
|
147
|
+
} : {
|
|
148
|
+
originalImageUrl: imageSrcUrl
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
// If image is already fetched, return it as is
|
|
152
|
+
return img;
|
|
153
|
+
}));
|
|
154
|
+
|
|
155
|
+
// Update state with the new image URLs
|
|
156
|
+
setImageUrls(updatedImages);
|
|
157
|
+
setLoading(false);
|
|
158
|
+
setShowHeatmap(currentViewType); // Toggle the view mode
|
|
159
|
+
};
|
|
160
|
+
const currentImage = imageUrls[currentIndex];
|
|
161
|
+
|
|
162
|
+
// Conditionally hide the buttons when on the first or last image
|
|
163
|
+
const isFirstImage = currentIndex === 0;
|
|
164
|
+
const isLastImage = currentIndex === imageUrls.length - 1;
|
|
165
|
+
return /*#__PURE__*/_react.default.createElement(_styles.ImageCarouselModalStyle, null, /*#__PURE__*/_react.default.createElement(_styles.GlobalStyleForImageCarousel, null), /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
166
|
+
open: visible,
|
|
167
|
+
onCancel: onClose,
|
|
168
|
+
footer: null,
|
|
169
|
+
className: fullscreen ? 'fullscreenModal imageCarouselModalStyle' : 'imageCarouselModalStyle'
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomLoader.default, {
|
|
171
|
+
spinning: loading
|
|
172
|
+
}, !fullscreen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
173
|
+
className: "type-t2-700",
|
|
174
|
+
color: "primary-content"
|
|
175
|
+
}, typeToNamemapping && typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] ? typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] : currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType, ' ', headingSuffixText), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
176
|
+
className: "type-b3-400",
|
|
177
|
+
color: "negative"
|
|
178
|
+
}, currentImage === null || currentImage === void 0 ? void 0 : currentImage.rejectReason)), /*#__PURE__*/_react.default.createElement("div", {
|
|
179
|
+
className: "margin-top-24 margin-bottom-12"
|
|
180
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
181
|
+
onClick: handleShowHeatmap,
|
|
182
|
+
type: "text-only",
|
|
183
|
+
label: showHeatmap ? 'View Original Image' : 'View Heatmap Image'
|
|
184
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.ImageCarouselModalStyle, null, /*#__PURE__*/_react.default.createElement(_antd.Carousel, {
|
|
185
|
+
ref: carouselRef,
|
|
186
|
+
afterChange: handleImageChange,
|
|
187
|
+
dots: true,
|
|
188
|
+
infinite: true
|
|
189
|
+
}, imageUrls.map(img => /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
className: "carouselItem",
|
|
191
|
+
key: img.imageType
|
|
192
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
193
|
+
className: "imageCarouselIconZoom"
|
|
194
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
195
|
+
icon: _Fullscreen.default,
|
|
196
|
+
onClick: handleFullscreenToggle
|
|
197
|
+
})), /*#__PURE__*/_react.default.createElement("img", {
|
|
198
|
+
src: showHeatmap ? img.heatmapImageUrl : img.originalImageUrl,
|
|
199
|
+
alt: img.imageType,
|
|
200
|
+
style: {
|
|
201
|
+
width: '100%',
|
|
202
|
+
objectFit: 'contain'
|
|
203
|
+
}
|
|
204
|
+
})))), window.innerWidth > 600 && /*#__PURE__*/_react.default.createElement(_styles.CarouselButtons, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
205
|
+
className: "sliderArrowSection"
|
|
206
|
+
}, !isFirstImage && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
207
|
+
color: "primary-content",
|
|
208
|
+
className: "leftArrow",
|
|
209
|
+
size: 24,
|
|
210
|
+
icon: _ArrowBackRounded.default,
|
|
211
|
+
onClick: () => carouselRef.current.prev()
|
|
212
|
+
}), !isLastImage && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
213
|
+
color: "primary-content",
|
|
214
|
+
className: "rightArrow",
|
|
215
|
+
size: 24,
|
|
216
|
+
icon: _ArrowForwardRounded.default,
|
|
217
|
+
onClick: () => carouselRef.current.next()
|
|
218
|
+
}))))), fullscreen && /*#__PURE__*/_react.default.createElement(_styles.FullscreenZoom, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
219
|
+
className: "type-t2-700",
|
|
220
|
+
color: "primary-background"
|
|
221
|
+
}, typeToNamemapping && typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] ? typeToNamemapping[currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType] : currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType, ' ', headingSuffixText), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
222
|
+
className: "type-b3-400",
|
|
223
|
+
color: "primary-background"
|
|
224
|
+
}, currentImage === null || currentImage === void 0 ? void 0 : currentImage.rejectReason)), /*#__PURE__*/_react.default.createElement(_styles.CloseButtonStyle, null, /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, {
|
|
225
|
+
onClick: handleFullscreenToggle
|
|
226
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.ZoomImgBox, null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, null, /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformComponent, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
227
|
+
src: showHeatmap ? currentImage === null || currentImage === void 0 ? void 0 : currentImage.heatmapImageUrl : currentImage === null || currentImage === void 0 ? void 0 : currentImage.originalImageUrl,
|
|
228
|
+
alt: currentImage === null || currentImage === void 0 ? void 0 : currentImage.imageType
|
|
229
|
+
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
+
className: "pinchZoom"
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
232
|
+
className: "margin-right-16"
|
|
233
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
234
|
+
icon: _TouchAppRounded.default,
|
|
235
|
+
size: 20,
|
|
236
|
+
color: "primary-background"
|
|
237
|
+
})), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
238
|
+
className: "type-b2-400",
|
|
239
|
+
color: "primary-background"
|
|
240
|
+
}, "Pinch in/out to zoom"))))));
|
|
241
|
+
}
|
|
242
|
+
ImageCarouselWidget.propTypes = {
|
|
243
|
+
images: _propTypes.default.array.isRequired,
|
|
244
|
+
visible: _propTypes.default.bool.isRequired,
|
|
245
|
+
onClose: _propTypes.default.func.isRequired,
|
|
246
|
+
headingSuffixText: _propTypes.default.string,
|
|
247
|
+
typeToNamemapping: _propTypes.default.object,
|
|
248
|
+
s3DownloadApiUrl: _propTypes.default.string,
|
|
249
|
+
initialImageType: _propTypes.default.string
|
|
250
|
+
};
|
|
251
|
+
ImageCarouselWidget.defaultProps = {
|
|
252
|
+
headingSuffixText: 'Damage',
|
|
253
|
+
typeToNamemapping: {},
|
|
254
|
+
s3DownloadApiUrl: '',
|
|
255
|
+
initialImageType: 'heatmap'
|
|
256
|
+
};
|
|
257
|
+
var _default = exports.default = ImageCarouselWidget;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.ZoomImgBox = exports.PinchZoom = exports.ImageCarouselWidgetStyle = exports.ImageCarouselModalStyle = exports.GlobalStyleForImageCarousel = exports.FullscreenZoom = exports.CloseButtonStyle = exports.CarouselStyle = exports.CarouselButtons = void 0;
|
|
9
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
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 && Object.prototype.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; }
|
|
13
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
+
var _default = exports.default = {};
|
|
15
|
+
const ImageCarouselWidgetStyle = exports.ImageCarouselWidgetStyle = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n\n\n"])));
|
|
16
|
+
const CarouselStyle = exports.CarouselStyle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\n"])));
|
|
17
|
+
const ZoomImgBox = exports.ZoomImgBox = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\nheight: calc(100vh - 150px);\n display: flex;\n align-items: center;\n justify-content: center; margin-bottom: 12px;\n\n"])));
|
|
18
|
+
const PinchZoom = exports.PinchZoom = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
|
|
19
|
+
const CloseButtonStyle = exports.CloseButtonStyle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: #fff;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -12px;\n right: 0;\n cursor: pointer\n"])));
|
|
20
|
+
const FullscreenZoom = exports.FullscreenZoom = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .pinchZoom{ \n display: flex;\n justify-content: center;\n align-items: center;\n\n .closeBtn{background: #fff;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -12px;\n right: 0;\n cursor: pointer;\n}\n}\n"])));
|
|
21
|
+
const ImageCarouselModalStyle = exports.ImageCarouselModalStyle = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n\n.ant-carousel{ background:#F6F6F6; max-width:550px; padding:24px 48px 56px 48px; border-radius:16px;}\n\n\n\n.ant-carousel .slick-dots li {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-inline: 4px;\n padding: 0;\n text-align: center;\n text-indent: -999px;\n vertical-align: top;\n}\n\n.ant-carousel .slick-dots li button {\n width: 10px;\n height: 10px;\n background: #959595;\n border: 0;\n opacity: 1;\n border-radius: 50%;\n}\n\n.ant-carousel .slick-dots li.slick-active button {background: #014FC5 !important;}\n.carouselItem{ display: flex !important;\n align-items: center;\n justify-content: center;}\n\n\n @media only screen and (max-width: 600px) {\n .imageCarouselIconZoom{display:flex !important;}\n .ant-carousel{ background: no-repeat;\n max-width: none;\n padding: 0;\n border-radius: 0;}\n\n}\n\n\n\n.imageCarouselIconZoom{background: #fff; display: none;\n border-radius: 4px;\n width: 24px;\n height: 24px;\n justify-content: center;\n align-items: center; right: 8px;\n position: absolute;\n top: 8px; z-index:9;\n}\n.imageCarouselIconZoom svg{font-size:20px !important; margin-top:3px;}\n.imageCarouselIconZoom button{ height: auto;\n line-height: normal;}\n.carouselItem {position: relative;}\n.carouselItem img{border-radius:8px;}\n\n.ant-carousel .slick-dots-bottom { bottom: -30px;}\n.carouselItem{height:100%};\n.slick-slide > div{height:100%;}\n.fullscreenModal .ant-modal-close{display:none;}\n.closeBtn{background: #fff;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -12px;\n right: 0;\n cursor: pointer;}\n\n .zoomImgBox{display:block;}\n\n"])));
|
|
22
|
+
const GlobalStyleForImageCarousel = exports.GlobalStyleForImageCarousel = (0, _styledComponents.createGlobalStyle)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n\n.imageCarouselModalStyle .ant-modal-body{max-height: none; height:100%;}\n.fullscreenModal .ant-modal-content{background:#000;}\n.fullscreenModal .ant-modal-close{display:none;}\n.ant-modal{ width:auto !important;}\n\n\n@media only screen and (max-width: 600px) {\n .imageCarouselModalStyle .ant-modal-content {top: 0; border-radius: 0px;}\n .slick-slide{height:calc(100vh - 210px) !important; background:#000; border-radius:8px;}\n\n}\n"])));
|
|
23
|
+
const CarouselButtons = exports.CarouselButtons = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\n.sliderArrowSection{position: absolute;\n top: 57%;\n width: 100%;}\n\n .leftArrow {\n position: absolute;\n left: 6px;\n top: 0;\n}\n .rightArrow{position: absolute;\n right: 6px;\n top: 0;}\n\n\n"])));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oa-componentbook",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.323",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Reusable components",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-markdown": "^8.0.7",
|
|
28
28
|
"react-pattern-lock": "^12.0.12",
|
|
29
29
|
"react-pdf": "^5.3.0",
|
|
30
|
-
"react-zoom-pan-pinch": "^3.
|
|
30
|
+
"react-zoom-pan-pinch": "^3.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/cli": "^7.22.9",
|