@scaleflex/widget-common 0.0.1
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/CHANGELOG.md +8056 -0
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/style.css +952 -0
- package/dist/style.min.css +1 -0
- package/lib/ApprovalStatus/ApprovalStatus.styled.js +21 -0
- package/lib/ApprovalStatus/index.js +104 -0
- package/lib/AssetPreview.js +53 -0
- package/lib/AutoSuggest.js +166 -0
- package/lib/Avatar/Avatar.styled.js +25 -0
- package/lib/Avatar/index.js +83 -0
- package/lib/AvatarWithStatus/AvatarWithStatus.styled.js +12 -0
- package/lib/AvatarWithStatus/index.js +30 -0
- package/lib/BackButton.js +46 -0
- package/lib/BackdropOverlay.js +77 -0
- package/lib/BadgeButton.js +35 -0
- package/lib/BaseButton.js +36 -0
- package/lib/Button.js +29 -0
- package/lib/Carousel/Carousel.styled.js +19 -0
- package/lib/Carousel/index.js +136 -0
- package/lib/Checkbox.js +55 -0
- package/lib/CloseButton.js +46 -0
- package/lib/ColorPicker/ColorPicker.styled.js +29 -0
- package/lib/ColorPicker/index.js +117 -0
- package/lib/ColorPickerModal/ColorPickerModal.styled.js +17 -0
- package/lib/ColorPickerModal/index.js +103 -0
- package/lib/DatePicker/MyDatePicker.js +350 -0
- package/lib/DatePicker/index.js +1 -0
- package/lib/DatePicker/index.scss +254 -0
- package/lib/DropFilesWindow.js +45 -0
- package/lib/FilterItem/FilterItem.styled.js +42 -0
- package/lib/FilterItem/index.js +48 -0
- package/lib/FilterPopup/FilterPopup.styled.js +16 -0
- package/lib/FilterPopup/index.js +85 -0
- package/lib/FormControl.js +25 -0
- package/lib/FormGroup.js +18 -0
- package/lib/FormHelperText.js +29 -0
- package/lib/IconLabeledButton.js +32 -0
- package/lib/Image/Image.styled.js +16 -0
- package/lib/Image/index.js +95 -0
- package/lib/ImagePreview/ImagePreview.styled.js +19 -0
- package/lib/ImagePreview/index.js +198 -0
- package/lib/InputAndLabel.js +77 -0
- package/lib/InputGroupTime.js +6 -0
- package/lib/InputLabel.js +18 -0
- package/lib/ItemButtonOverlay/ItemButtonOverlay.styled.js +33 -0
- package/lib/ItemButtonOverlay/index.js +23 -0
- package/lib/ItemHoverTopOptions.js +58 -0
- package/lib/LoaderView/LoaderView.styled.js +37 -0
- package/lib/LoaderView/index.js +32 -0
- package/lib/MetaData/FilterMetadataFields.js +115 -0
- package/lib/MetaData/FilterMetadataFields.styled.js +16 -0
- package/lib/MetaData/MetaDataField.js +246 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldBooleanType.js +36 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldDateType.js +53 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldMultiSelectType.js +71 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldNumericType.js +45 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldSelectType.js +69 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldTagsType.js +143 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldTextType.js +42 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldTextareaType.js +72 -0
- package/lib/MetaData/MetaDataFieldTypes/MetaDataFieldTypes.styled.js +57 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataAttachmentsFieldType/AttachmentsAssetsMetadataAccordion.styled.js +95 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataAttachmentsFieldType/MetadataAttachmentsAction.js +188 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataAttachmentsFieldType/MetadataAttachmentsFieldType.constants.js +48 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataAttachmentsFieldType/MetadataAttachmentsInfo.js +93 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataAttachmentsFieldType/index.js +116 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataFieldUriType.js +71 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataGeoPointField/MetadataGeoPointField.styled.js +8 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataGeoPointField/constants.js +10 -0
- package/lib/MetaData/MetaDataFieldTypes/MetadataGeoPointField/index.js +135 -0
- package/lib/MetaData/MetaDataFieldTypes/index.js +9 -0
- package/lib/MetaData/MetaDataFieldTypes.hooks.js +53 -0
- package/lib/OverlayCard/OverlayCard.styled.js +8 -0
- package/lib/OverlayCard/index.js +28 -0
- package/lib/PoweredBy.js +12 -0
- package/lib/Radiobox.js +63 -0
- package/lib/RegionalVariantsFilters/RegionalVariantFilters.styled.js +17 -0
- package/lib/RegionalVariantsFilters/index.js +160 -0
- package/lib/SVGUrlToElement.js +73 -0
- package/lib/SearchGroup/SearchGroup.styled.js +93 -0
- package/lib/SearchGroup/index.js +293 -0
- package/lib/Spinner.js +40 -0
- package/lib/SuggestedSelectInput/SuggestedSelectInput.styled.js +57 -0
- package/lib/SuggestedSelectInput/index.js +238 -0
- package/lib/SuggestedTagsInput/SuggestedTagsInput.js +295 -0
- package/lib/SuggestedTagsInput/SuggestedTagsInput.styled.js +83 -0
- package/lib/SuggestedTagsInput/SuggestedTagsInput.utils.js +15 -0
- package/lib/SuggestedTagsInput/SuggestedTagsInputSkeleton.js +14 -0
- package/lib/Tabs.js +62 -0
- package/lib/ToggleButton/ToggleButton.styled.js +16 -0
- package/lib/ToggleButton/index.js +16 -0
- package/lib/Transitions/SlideTransition.js +24 -0
- package/lib/Transitions/TransitionWrapper.js +83 -0
- package/lib/Transitions/Transitions.styled.js +8 -0
- package/lib/Transitions/index.js +2 -0
- package/lib/Transitions/transitions.scss +49 -0
- package/lib/Typography/Typography.js +47 -0
- package/lib/Typography/Typography.mixin.js +46 -0
- package/lib/Typography/Typography.styled.js +18 -0
- package/lib/Typography/index.js +3 -0
- package/lib/Typography/types/index.js +1 -0
- package/lib/Typography/types/variant.js +9 -0
- package/lib/UploadFileFloatyLabel/UploadFileFloatyLabel.mixin.js +23 -0
- package/lib/UploadFileFloatyLabel/UploadFileFloatyLabel.styled.js +24 -0
- package/lib/UploadFileFloatyLabel/index.js +12 -0
- package/lib/UsersAutocomplete/Tag.js +25 -0
- package/lib/UsersAutocomplete/Tag.styled.js +35 -0
- package/lib/UsersAutocomplete/UsersAutocomplete.styled.js +94 -0
- package/lib/UsersAutocomplete/index.js +303 -0
- package/lib/VirtualGrid/VirtualGrid.styled.js +33 -0
- package/lib/VirtualGrid/VirtualGrid.utils.js +38 -0
- package/lib/VirtualGrid/VirtualGridItem.js +15 -0
- package/lib/VirtualGrid/index.js +248 -0
- package/lib/VirtualList/VirtualListItem.js +14 -0
- package/lib/VirtualList/index.js +105 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/useDebounce.js +24 -0
- package/lib/hooks/useInputWithLocaleNumber.js +115 -0
- package/lib/hooks/useIsUnMountedRef.js +12 -0
- package/lib/hooks/useKeyboardNavigation.js +60 -0
- package/lib/hooks/useUpdateEffect.js +19 -0
- package/lib/index.js +36 -0
- package/lib/style.scss +1079 -0
- package/package.json +32 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");.filerobot-Explorer-assets-picker-modal{z-index:100000}.filerobot-common-BaseButton{align-items:center;border:0;border-radius:2px;cursor:pointer;display:flex;font-weight:500;justify-content:center;outline:none;padding:8px 12px;position:relative;transition:all .1s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none}.filerobot-common-BaseButton span[role=container]{align-items:center;display:flex;z-index:4}@media (max-width:636px){.filerobot-common-BaseButton{min-height:28px;min-width:32px;padding:2px 6px}.filerobot-common-BaseButton span:not[role=container]{display:none}}.filerobot-common-BaseButton:before{background:#d9dde0;border-radius:15px 2px 15px 5px;content:"";height:100%;opacity:0;position:absolute;transition:width .07s ease-in-out,border-radius .15s ease-in-out;width:0}.filerobot-common-BaseButton:not(:disabled):active{opacity:1}.filerobot-common-BaseButton:not(:disabled):active:before{border-radius:inherit;opacity:1;width:100%}.filerobot-common-BaseButton:disabled{color:#bbb;fill:#bbb;background:rgba(79,98,118,.7);cursor:not-allowed;opacity:.8}.filerobot-common-BaseButton:disabled *,.filerobot-common-BaseButton:disabled:before{background:none;fill:currentColor;color:currentColor}.filerobot-common-BaseButton-auto:not(disabled) :focus,.filerobot-common-BaseButton-auto:not(disabled) :hover{background:#eff3f6}.filerobot-common-BaseButton-auto:not(disabled) :focus *,.filerobot-common-BaseButton-auto:not(disabled) :hover *{color:#5d6d7e;fill:#5d6d7e}.filerobot-common-BaseButton-transparent{background:transparent;color:#5d6d7e}.filerobot-common-BaseButton-transparent:not(:disabled):focus,.filerobot-common-BaseButton-transparent:not(:disabled):hover{background:#eff3f6}.filerobot-common-BaseButton-transparent:not(:disabled):focus svg *,.filerobot-common-BaseButton-transparent:not(:disabled):hover svg *{color:#5d6d7e;fill:#5d6d7e}.filerobot-common-BaseButton-transparent:not(:disabled):focus *,.filerobot-common-BaseButton-transparent:not(:disabled):hover *{color:#5d6d7e}.filerobot-common-BaseButton-primary{background:#4d4e4e;color:#fff}.filerobot-common-BaseButton-primary:not(:disabled):hover{filter:brightness(1.1)}.filerobot-common-BaseButton-accent{background:#6879eb;color:#fff}.filerobot-common-BaseButton-accent:not(:disabled):hover{filter:brightness(1.1)}.filerobot-common-BaseButton-accent:before{background:#4958bc}.filerobot-common-BaseButton-secondary{background:#768184;color:#fff}.filerobot-common-BaseButton-secondary:not(:disabled):hover{filter:brightness(1.1)}.filerobot-common-BaseButton-activeSecondary{background:#e9eef2;color:#5d6d7e}.filerobot-common-BaseButton-small{font-size:12px;padding:2px 6px}.filerobot-common-BaseButton-small.filerobot-common-LabeledIconButton img{max-height:12px;max-width:12px;min-height:12px;min-width:12px}.filerobot-common-BaseButton-small.filerobot-common-LabeledIconButton span:not([role=container]){margin-left:4px}.filerobot-common-BaseButton-medium{font-size:15px;line-height:16px}.filerobot-common-BaseButton-medium.filerobot-common-LabeledIconButton img{max-height:12px;max-width:12px;min-height:12px;min-width:12px}.filerobot-common-BaseButton-large{font-size:17px;padding:8px 14px}.filerobot-common-BaseButton-large.filerobot-common-LabeledIconButton img{max-height:16px;max-width:16px;min-height:16px;min-width:16px}.filerobot-common-BaseButton-fullWidth{font-size:17px;width:100%}.filerobot-common-BaseButton-fullWidth.filerobot-common-LabeledIconButton img,.filerobot-common-BaseButton-fullWidth.filerobot-common-LabeledIconButton svg{max-height:16px;max-width:16px;min-height:16px;min-width:16px}.filerobot-common-BaseButton-fullWidth.filerobot-common-LabeledIconButton span:not([role=container]){margin-left:8px}.filerobot-common-LabeledIconButton-label{margin-left:4px}.filerobot-common-BadgeButton{margin-right:4px;padding:8px 12px}.filerobot-common-BadgeButton .filerobot-common-BadgeButton-badgeContent{align-items:center;background:#fff;border-radius:50%;color:#6879eb;display:inline-flex;font-size:10px;font-weight:500;height:14px;justify-content:center;margin-left:4px;width:14px}.filerobot-common-BadgeButton-activeSecondary .filerobot-common-BadgeButton-badgeContent{background:#5d6d7e;color:#fff}.filerobot-common-BackCloseButton{align-items:center;display:flex}.filerobot-common-BackCloseButton-button{padding:6px}.filerobot-common-BackCloseButton-buttonMargin{margin:0 6px}.filerobot-common-BackCloseButton-divider{height:22px}.filerobot-common-BackdropOverlay{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1199}.filerobot-common-verticalDivider{background:#dfe7ed;width:1px}.filerobot-common-Radio-wrapper{align-items:center;cursor:pointer;display:inline-flex;padding:8px 0}.filerobot-common-Radio-wrapper:first-child{padding-top:0}.filerobot-common-Radio-wrapper:last-child{padding-bottom:0}.filerobot-common-Radio{display:inline-block;padding-right:8px}.filerobot-common-Radio-label{color:#37414b;font-size:16px;line-height:18px}.filerobot-common-FormGroup:not(:last-child){margin-bottom:16px}.filerobot-common-FormControl-inline{display:flex}.filerobot-common-FormControl-with-hint{margin-bottom:0}.filerobot-common-FormControl-error,.filerobot-common-FormControl-error .SfxFormHint-root,.filerobot-common-FormControl-error .SfxLabel-root,.filerobot-common-FormControl-error .filerobot-common-FormHelperText,.filerobot-common-FormControl-error .filerobot-common-InputLabel{color:#e85b46}.filerobot-common-FormControl-error:not(:has([data-valid=true])) .SfxInput-root,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Input,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Select,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Textarea{background:#fff;border-color:#e85b46;color:#e85b46;outline-color:#e85b46}.filerobot-common-FormControl-error:not(:has([data-valid=true])) .SfxInput-root:focus,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .SfxInput-root:focus-within,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .SfxInput-root:hover,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Input:focus,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Input:focus-within,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Input:hover,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Select:focus,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Select:focus-within,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Select:hover,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Textarea:focus,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Textarea:focus-within,.filerobot-common-FormControl-error:not(:has([data-valid=true])) .filerobot-common-Textarea:hover{border:1px solid #e85b46;outline:none}.filerobot-common-InputLabel{align-items:center;color:#768184;display:flex;font-size:12px;font-weight:400;margin-bottom:3px}.filerobot-common-FormHelperText{color:#768184;font-size:10px;margin-top:3px}.filerobot-common-FormHelperText-medium{font-size:14px}.filerobot-common-FormHelperText-no-margin{margin:0}.filerobot-common-autoSuggest{position:relative}.filerobot-common-autoSuggest-list-wrapper{position:absolute;z-index:11111111111111}.suggestions-list{background-color:#fff;border:1px solid #ddd;border-radius:2px;font-size:14px;list-style:none;margin-left:125px;margin-top:0;max-height:200px;overflow-x:hidden;overflow-y:scroll;padding-left:0}.suggestions-list li{font-size:1rem;padding:.5rem}.suggestions-tags{display:inline-flex;flex-wrap:wrap;list-style:none;margin:0;padding:0;width:100%}.suggestions-tags li{align-items:center;background:transparent;border:1px dashed #5d6d7e;border-radius:2px;color:#5d6d7e;display:flex;font-family:Roboto;font-size:14px;font-weight:400;line-height:16.4px;list-style:none;margin:0 8px 8px 0;max-height:24px;padding:4px 12px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.suggestions-tags li:hover .filerobot-c-icon{display:block}.suggestions-tags li .filerobot-c-icon{color:#fff;display:none;height:6px;position:absolute;right:3px;top:3px;width:6px}.suggestions-tags li button{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;border-radius:50%;color:#768184;cursor:pointer;display:inline-flex;font-size:12px;height:15px;justify-content:center;line-height:0;margin-left:8px;padding:0;transform:rotate(45deg);width:15px}.no-suggestions{color:#999;padding:.5rem}.suggestions-title{align-items:center;display:flex;font-size:12px;font-weight:400;padding:4px 0}.suggestions-title svg{margin-right:4px}.post-upload-suggestion{margin-left:0;width:100%}.suggestion-active,.suggestions li:hover{background:#5d6d7e;border:1px solid #5d6d7e;color:#fff;cursor:pointer}.suggestion-loading{align-items:center;display:flex;font-size:1rem;height:100px;justify-content:center}.filerobot-common-Checkbox,.filerobot-common-Checkbox-wrapper{align-items:center;cursor:pointer;display:flex}.filerobot-common-Checkbox{background:#f8fafb;border:1px solid #dfe7ed;border-radius:1px;justify-content:center;margin-right:12px;max-height:16px;max-width:16px;min-height:16px;min-width:16px;outline:none;text-align:center}.filerobot-common-Checkbox-label{font-size:12px;line-height:14px;max-width:calc(100% - 16px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filerobot-common-Tabs-wrapper{display:flex;padding-left:12px;width:92%}.filerobot-common-Tabs{align-items:center;background-color:#f8fafb;border-bottom:1px solid #dfe7ed;border-top:1px solid #dfe7ed;display:flex}.filerobot-common-Tabs-panel{font-size:12px;margin-bottom:-1px;position:relative}.filerobot-common-Tabs-panel>input[type=radio]{left:-200vw;position:absolute}.filerobot-common-Tabs-panel .bottom-line{background:#6879eb;bottom:0;display:none;height:1px;left:7px;position:absolute;right:7px}.filerobot-common-Tabs-panel>label{border:1px solid transparent;border-top-left-radius:.1rem;border-top-right-radius:.1rem;color:#5d6d7e;cursor:pointer;display:flex;padding:7px;position:relative}.filerobot-common-Tabs-panel>label>svg{height:12px;margin-right:8px;width:12px}.filerobot-common-Tabs-panel:first-child>label{padding-left:0}.filerobot-common-Tabs-panel:first-child>label+.bottom-line{left:0}.filerobot-common-Tabs-panel>input:checked+label{color:#6879eb}.filerobot-common-Tabs-panel>input:checked+label+.bottom-line{display:block}.filerobot-common-Tabs .subtabs-wrapper{padding:12px 0}.filerobot-common-inputAndLabel{margin-bottom:16px}.filerobot-common-inputAndLabel-form-group{margin-bottom:19px}.filerobot-common-inputAndLabel-input-header{font-size:14px;font-weight:400;line-height:16px;margin-bottom:3px}.filerobot-common-inputAndLabel-header-links-label{align-items:center;color:#768a9f;display:flex}.filerobot-common-inputAndLabel-input-text-wrapper{position:relative;width:100%}.filerobot-common-inputAndLabel-input-text-wrapper input[type=time]::-webkit-calendar-picker-indicator{cursor:pointer;display:block;height:20px;margin-top:2px;opacity:0;width:20px;z-index:2}.filerobot-common-inputAndLabel-input-text-wrapper-disable-icon input[type=date]::-webkit-calendar-picker-indicator{display:none}.filerobot-common-inputAndLabel-input-icon{cursor:pointer;margin:6px;position:absolute;right:0;top:0}.filerobot-common-inputAndLabel-input-text{background-color:#fff;border:1px solid #ccd6de;border-radius:4px;cursor:auto;font-family:Roboto;font-size:16px;font-weight:400;line-height:18px;padding:10px 16px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}.filerobot-common-inputAndLabel-input-text:focus{background-color:#fff!important;border:1px solid #6879eb;outline:none}.filerobot-common-inputAndLabel-input-text:hover{background-color:#eff3f6}.filerobot-common-Spinner{align-items:center;display:flex;justify-content:center;margin-right:6px}.filerobot-common-Spinner svg{animation:rotating-spinner 2s linear infinite}.filerobot-common-Spinner-noMargin{margin:0}.filerobot-common-Spinner-filledCentered{height:100%;margin:0;padding:8px;width:100%}.filerobot-common-Spinner-spinnerContainer{align-items:center;display:flex;height:100%;justify-content:center;overflow:hidden;padding:2px;width:100%}.filerobot-common-Spinner-spinnerContainer svg{height:30px;width:30px}@keyframes rotating-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.filerobot-common-ItemHoverTopOptions{align-items:flex-start;border-radius:inherit;bottom:0;display:flex;justify-content:flex-end;padding:2px 4px 2px 24px;pointer-events:none;position:absolute;right:3%;top:4%;transition:all .1s ease-in-out;visibility:hidden;width:100%;z-index:3}.filerobot-common-ItemHoverTopOptions button{background:rgba(79,98,118,.7);border-radius:50%;height:auto;height:24px;margin:0 2px;min-height:16px;min-width:12px;padding:4px 7px;pointer-events:auto;transition:all .1s ease-in-out;width:24px}.filerobot-common-ItemHoverTopOptions button svg *{color:#fff;fill:#fff}.filerobot-common-ItemHoverTopOptions button:hover{background:#37414b}.filerobot-common-ItemHoverTopOptions button:hover svg *{fill:#dfe7ed;color:#dfe7ed}:hover>.filerobot-common-ItemHoverTopOptions{visibility:visible}.filerobot-common-ItemHoverTopOptions-disableHover{display:flex;visibility:visible}.filerobot-common-ItemHoverTopOptions-disableHover:hover{background:none}.filerobot-common-DropFilesHereHint{background-color:hsla(0,0%,100%,.9);bottom:0;color:#768184;font-size:24px;height:100%;left:0;line-height:28px;pointer-events:none;position:absolute;right:0;text-align:center;top:0;visibility:hidden;width:100%;z-index:2000}.filerobot-common-DropFilesHereHint-inner{align-items:center;border:1px dashed #5282db;border-radius:3px;bottom:7px;display:flex;flex-direction:column;justify-content:center;left:7px;position:absolute;right:7px;top:7px}.filerobot-common-DropFilesHereHint-inner svg{animation:moving 2s ease infinite;margin-bottom:25px}@keyframes moving{0%,to{transform:scale(1) translate(0)}50%{transform:scale(1.1) translateY(-10px)}}[data-filerobot-theme=dark] .filerobot-common-DropFilesHereHint{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%2302BAF2' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");border-color:#02baf2;color:#bbb}.filerobot-common-DropFilesTarget *{pointer-events:none}.filerobot-common-DropFilesHereHint-visible{visibility:visible}.filerobot-common-Search .filerobot-c-separator{height:70%;margin:0}.filerobot-common-Search-searchButton{cursor:pointer;height:100%;padding:10px 12px 12px}.filerobot-common-Search{align-items:center;background:#fff;border:1px solid #dfe7ed;border-radius:4px;display:flex;height:40px;position:relative;white-space:nowrap}.filerobot-common-Search:active,.filerobot-common-Search:focus-within{background-color:#fff!important}.filerobot-common-Search:active .filerobot-common-Search-searchInput,.filerobot-common-Search:focus-within .filerobot-common-Search-searchInput{background-color:#fff!important}.filerobot-common-Search-searchInput{align-items:center;border:none;box-sizing:border-box;display:flex;flex-grow:1;font-size:14px;height:-moz-fit-content;height:fit-content;margin:6px 0;min-width:24px;outline:none;width:100%}.filerobot-common-Search-searchInput button{height:100%}.filerobot-common-Search-searchInput .filerobot-common-TopBar-input-fragment{display:inherit;height:inherit;width:inherit}.filerobot-common-Search-searchInput:focus{outline:none}[data-filerobot-theme=dark] .filerobot-common-Search-searchInput{background-color:#1f1f1f;color:#fff}.filerobot-common-Search-searchInput::-moz-placeholder{color:#a9b6c2;font-size:14px;font-style:normal;font-weight:400}.filerobot-common-Search-searchInput::placeholder{color:#a9b6c2;font-size:14px;font-style:normal;font-weight:400}.filerobot-common-Search-searchAndAppendedOptions{align-items:center;display:flex;height:100%}.filerobot-common-Search-searchAndFiltersInputs{align-items:center;display:flex;flex-grow:1;height:100%;max-height:100%;overflow:auto hidden;position:relative;white-space:nowrap;-ms-overflow-style:none}.filerobot-common-PoweredBy-label{background-color:#f8fafb;border:1px solid #dfe7ed;border-bottom:0;border-radius:0;border-top-left-radius:40px;bottom:0;color:#778285;font-size:10px;margin-right:-1px;padding:4px 14px;position:absolute;right:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1001}.filerobot-common-secondaryTxt{color:#939393;font-size:12px;line-height:14px}.filerobot-TransitionWrapper{--translateX:0;--translateY-shown:0;--translateY-hidden:-105%;background:#fff;display:none;overflow-y:hidden;position:absolute;top:0}.filerobot-TransitionWrapper.--applied{display:block;height:100%;width:100%;z-index:1002}.filerobot-transition-slideDownUp-enter{opacity:.01;transform:translate3d(var(--translateX),var(--translateY-hidden),0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.filerobot-transition-slideDownUp-enter.filerobot-transition-slideDownUp-enter-active,.filerobot-transition-slideDownUp-leave{opacity:1;transform:translate3d(var(--translateX),var(--translateY-shown),0)}.filerobot-transition-slideDownUp-leave{transition:transform .25s ease-in-out,opacity .25s ease-in-out}.filerobot-transition-slideDownUp-leave.filerobot-transition-slideDownUp-leave-active{opacity:.01;transform:translate3d(var(--translateX),var(--translateY-hidden),0)}.filerobot-common-datePicker{position:relative}.filerobot-common-datePicker *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.filerobot-common-datePicker-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.filerobot-common-datePicker-input{overflow:hidden}.filerobot-common-datePicker-input input{cursor:pointer}.filerobot-common-datePicker-input input:focus{outline:none}.filerobot-common-datePicker-container{background:#fff;border-radius:4px;box-shadow:10px 10px 40px rgba(0,0,0,.2);max-height:240px;min-height:200px;overflow:hidden;padding:12px;position:absolute;width:215px;z-index:11111111111111}.filerobot-common-datePicker-container-head{align-items:center;display:flex}.filerobot-common-datePicker-container-head-body{float:left;height:100%;width:120px}.filerobot-common-datePicker-container-head-body-year{color:#5d6d7e;float:left;font-size:27px;font-weight:200px;height:30px;text-align:center;width:100%}.filerobot-common-datePicker-container-head-body-month{color:#5d6d7e;float:left;font-size:13px;font-weight:200px;height:15px;text-align:center;width:100%}.filerobot-common-datePicker-container-head-button{box-sizing:border-box;height:100%;position:relative;width:45px}.filerobot-common-datePicker-container-head-button-inner{background:#f4f4f4;border-radius:2px;float:left;height:25px;left:50%;line-height:35px;margin-left:-17px;margin-top:-17px;position:absolute;text-align:center;top:50%;width:25px}.filerobot-common-datePicker-container-head-button-inner:hover>span{border-color:#555!important}.filerobot-common-datePicker-container-head-button-inner:hover{background:#eee;cursor:pointer}.filerobot-common-datePicker-calendar{height:100%;width:100%}.filerobot-common-datePicker-calendar-body,.filerobot-common-datePicker-calendar-day,.filerobot-common-datePicker-calendar-day span,.filerobot-common-datePicker-calendar-day-container{box-sizing:border-box;display:block;float:left;position:relative}.filerobot-common-datePicker-calendar-body{height:250px;width:100%}.filerobot-common-datePicker-calendar-day{height:10%;width:14%}.filerobot-common-datePicker-calendar-day-container{color:#37414b;font-size:12px;font-weight:300;height:100%;text-align:center;width:100%}.filerobot-common-datePicker-calendar-day-container span{border-radius:2px;font-weight:400;height:25px;left:50%;line-height:30px;margin-left:-15px;margin-top:-15px;top:50%;width:25px}.filerobot-common-datePicker-calendar-day-container span:hover{background:#e9eef2;cursor:pointer}.filerobot-common-datePicker-calendar-day.disabled{pointer-events:none}.filerobot-common-datePicker-calendar-day.disabled .filerobot-common-datePicker-calendar-day-container span{background:#fff!important;color:#ddd}.filerobot-common-datePicker-calendar-day.highlight .filerobot-common-datePicker-calendar-day-container span{background:#5d6d7e}.filerobot-common-datePicker-calendar-day.highlight-green .filerobot-common-datePicker-calendar-day-container span{background:#4958bc;color:#fff}.filerobot-common-datePicker-calendar-head{display:flex;height:20px;margin-bottom:5px;margin-top:2px;width:100%}.filerobot-common-datePicker-calendar-head-name{color:#5d6d7e;font-size:9px;font-weight:700;height:30px;line-height:30px;text-align:center;width:14.285%}.mdpchbi-left-arrow,.mdpchbi-left-arrows,.mdpchbi-left-arrows:after,.mdpchbi-right-arrow,.mdpchbi-right-arrows,.mdpchbi-right-arrows:after{border-bottom:2px solid #888;border-left:2px solid #888;display:block;float:left;height:6px;position:absolute;width:6px}.mdpchbi-left-arrow,.mdpchbi-left-arrows,.mdpchbi-right-arrow,.mdpchbi-right-arrows{left:50%;margin-left:-2px;margin-top:-4px;top:50%;transform:rotate(45deg)}.mdpchbi-right-arrow,.mdpchbi-right-arrows{margin-left:-4px;transform:rotate(225deg)}.mdpchbi-left-arrows:after,.mdpchbi-right-arrows:after{content:""}.mdpchbi-left-arrows{margin-left:-5px}.mdpchbi-right-arrows{margin-left:-2px}.mdpchbi-left-arrows:after,.mdpchbi-right-arrows:after{left:3px;top:-5px}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
|
+
import { FV, PC } from '@scaleflex/widget-common';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n", ";\n display: flex;\n align-items: center;\n gap: ", ";\n width: 100%;\n color: ", ";\n"])), function (_ref) {
|
|
6
|
+
var fontVariant = _ref.fontVariant,
|
|
7
|
+
font = _ref.theme.typography.font;
|
|
8
|
+
return font[fontVariant || FV.LabelLarge];
|
|
9
|
+
}, function (_ref2) {
|
|
10
|
+
var gap = _ref2.gap;
|
|
11
|
+
return "".concat(gap, "px");
|
|
12
|
+
}, function (_ref3) {
|
|
13
|
+
var theme = _ref3.theme;
|
|
14
|
+
return theme.palette[PC.TextPrimary];
|
|
15
|
+
});
|
|
16
|
+
var Label = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n"])));
|
|
17
|
+
var Styled = {
|
|
18
|
+
Container: Container,
|
|
19
|
+
Label: Label
|
|
20
|
+
};
|
|
21
|
+
export default Styled;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
|
+
import { Success, Round, Clock, Cross2, Remove, QuestionMarkOutline } from '@scaleflex/icons';
|
|
15
|
+
import { APPROVAL_STATUSES } from '@scaleflex/widget-utils/lib/constants';
|
|
16
|
+
import { useTheme } from '@scaleflex/ui/theme/hooks';
|
|
17
|
+
import { PC } from '@scaleflex/widget-common';
|
|
18
|
+
import { useCore } from '@scaleflex/widget-core/lib/hooks';
|
|
19
|
+
import lowercaseFirstLetter from '@scaleflex/widget-utils/lib/lowercaseFirstLetter';
|
|
20
|
+
import CustomDate from '@scaleflex/widget-utils/lib/CustomDate';
|
|
21
|
+
import Styled from './ApprovalStatus.styled.js';
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
var ApprovalStatus = function ApprovalStatus(_ref) {
|
|
24
|
+
var statusCode = _ref.statusCode,
|
|
25
|
+
_ref$showLabel = _ref.showLabel,
|
|
26
|
+
showLabel = _ref$showLabel === void 0 ? true : _ref$showLabel,
|
|
27
|
+
_ref$showIcon = _ref.showIcon,
|
|
28
|
+
showIcon = _ref$showIcon === void 0 ? true : _ref$showIcon,
|
|
29
|
+
_ref$size = _ref.size,
|
|
30
|
+
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
31
|
+
_ref$gap = _ref.gap,
|
|
32
|
+
gap = _ref$gap === void 0 ? 6 : _ref$gap,
|
|
33
|
+
_ref$longLabel = _ref.longLabel,
|
|
34
|
+
longLabel = _ref$longLabel === void 0 ? false : _ref$longLabel,
|
|
35
|
+
labelFontVariant = _ref.labelFontVariant,
|
|
36
|
+
renderActions = _ref.renderActions,
|
|
37
|
+
i18n = _ref.i18n,
|
|
38
|
+
date = _ref.date;
|
|
39
|
+
var theme = useTheme();
|
|
40
|
+
var _useCore = useCore(),
|
|
41
|
+
language = _useCore.opts.language;
|
|
42
|
+
var _useMemo = useMemo(function () {
|
|
43
|
+
switch (statusCode) {
|
|
44
|
+
case APPROVAL_STATUSES.APPROVED:
|
|
45
|
+
case APPROVAL_STATUSES.PRE_APPROVED:
|
|
46
|
+
return [function (iconProps) {
|
|
47
|
+
return /*#__PURE__*/_jsx(Success, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
48
|
+
color: theme.palette[PC.Success]
|
|
49
|
+
}));
|
|
50
|
+
}, i18n(longLabel ? 'approvalsStatusApprovedLongLabel' : 'approvalsStatusApprovedLabel')];
|
|
51
|
+
case APPROVAL_STATUSES.REFUSED:
|
|
52
|
+
case APPROVAL_STATUSES.PRE_REFUSED:
|
|
53
|
+
case APPROVAL_STATUSES.REJECTED:
|
|
54
|
+
return [function (iconProps) {
|
|
55
|
+
return /*#__PURE__*/_jsx(Cross2, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
56
|
+
color: theme.palette[PC.Error]
|
|
57
|
+
}));
|
|
58
|
+
}, i18n(longLabel ? 'approvalsStatusRejectedLongLabel' : 'approvalsStatusRejectedLabel')];
|
|
59
|
+
case APPROVAL_STATUSES.PENDING:
|
|
60
|
+
return [function (iconProps) {
|
|
61
|
+
return /*#__PURE__*/_jsx(Clock, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
62
|
+
color: theme.palette[PC.IconsPrimary]
|
|
63
|
+
}));
|
|
64
|
+
}, i18n(longLabel ? 'approvalsStatusPendingLongLabel' : 'approvalsStatusPendingLabel')];
|
|
65
|
+
case APPROVAL_STATUSES.CANCELLED:
|
|
66
|
+
case APPROVAL_STATUSES.CANCELED:
|
|
67
|
+
return [function (iconProps) {
|
|
68
|
+
return /*#__PURE__*/_jsx(Remove, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
69
|
+
color: theme.palette[PC.IconsSecondary]
|
|
70
|
+
}));
|
|
71
|
+
}, i18n(longLabel ? 'approvalsStatusCanceledLongLabel' : 'approvalsStatusCanceledLabel')];
|
|
72
|
+
case APPROVAL_STATUSES.NO_RESPONSE:
|
|
73
|
+
return [function (iconProps) {
|
|
74
|
+
return /*#__PURE__*/_jsx(QuestionMarkOutline, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
75
|
+
color: theme.palette[PC.IconsPrimary]
|
|
76
|
+
}));
|
|
77
|
+
}, i18n('approvalsStatusNoRespond')];
|
|
78
|
+
default:
|
|
79
|
+
return [function (iconProps) {
|
|
80
|
+
return /*#__PURE__*/_jsx(Round, _objectSpread(_objectSpread({}, iconProps), {}, {
|
|
81
|
+
color: theme.palette[PC.BackgroundGrey]
|
|
82
|
+
}));
|
|
83
|
+
}, i18n('approvalsStatusNoneLabel')];
|
|
84
|
+
}
|
|
85
|
+
}, [statusCode]),
|
|
86
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
87
|
+
Icon = _useMemo2[0],
|
|
88
|
+
label = _useMemo2[1];
|
|
89
|
+
if (!showIcon && !showLabel) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return /*#__PURE__*/_jsxs(Styled.Container, {
|
|
93
|
+
fontVariant: labelFontVariant,
|
|
94
|
+
gap: gap,
|
|
95
|
+
children: [showIcon && Icon && /*#__PURE__*/_jsx(Icon, {
|
|
96
|
+
size: size
|
|
97
|
+
}), showLabel && /*#__PURE__*/_jsxs(Styled.Label, {
|
|
98
|
+
children: [label, date && " ".concat(lowercaseFirstLetter(i18n('approvalsOnDateLabel', {
|
|
99
|
+
date: new CustomDate(date).getFormattedDate(language)
|
|
100
|
+
})))]
|
|
101
|
+
}), typeof renderActions === 'function' && renderActions()]
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
export default ApprovalStatus;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["file", "getItemIcon", "filePreviewToggle", "isDevEnv", "viewLayout", "noImgTransformations", "container", "lazyloading", "isSmallSizePreview"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import { LAYOUTS_IDS } from '@scaleflex/widget-utils/lib/constants';
|
|
11
|
+
import isImage from '@scaleflex/widget-utils/lib/isImage';
|
|
12
|
+
import checkIfPngSvgGIF from '@scaleflex/widget-utils/lib/checkIfPngSvgGIF';
|
|
13
|
+
import getFileExtension from '@scaleflex/widget-utils/lib/getFileExtension';
|
|
14
|
+
import isTransparencySupported from '@scaleflex/widget-utils/lib/isTransparencySupported';
|
|
15
|
+
import ImagePreview from './ImagePreview';
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
var AssetPreview = function AssetPreview(_ref) {
|
|
18
|
+
var _file$size, _file$info, _file$info2;
|
|
19
|
+
var file = _ref.file,
|
|
20
|
+
getItemIcon = _ref.getItemIcon,
|
|
21
|
+
filePreviewToggle = _ref.filePreviewToggle,
|
|
22
|
+
isDevEnv = _ref.isDevEnv,
|
|
23
|
+
viewLayout = _ref.viewLayout,
|
|
24
|
+
_ref$noImgTransformat = _ref.noImgTransformations,
|
|
25
|
+
noImgTransformations = _ref$noImgTransformat === void 0 ? false : _ref$noImgTransformat,
|
|
26
|
+
container = _ref.container,
|
|
27
|
+
lazyloading = _ref.lazyloading,
|
|
28
|
+
_ref$isSmallSizePrevi = _ref.isSmallSizePreview,
|
|
29
|
+
isSmallSizePreview = _ref$isSmallSizePrevi === void 0 ? false : _ref$isSmallSizePrevi,
|
|
30
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
var extension = getFileExtension(file);
|
|
32
|
+
var isPngSvgGif = checkIfPngSvgGIF(extension);
|
|
33
|
+
return /*#__PURE__*/_jsx(ImagePreview, _objectSpread({
|
|
34
|
+
size: file === null || file === void 0 ? void 0 : (_file$size = file.size) === null || _file$size === void 0 ? void 0 : _file$size.bytes,
|
|
35
|
+
file: file,
|
|
36
|
+
thumbnailUrl: file === null || file === void 0 ? void 0 : (_file$info = file.info) === null || _file$info === void 0 ? void 0 : _file$info.thumbnail,
|
|
37
|
+
previewUrl: file === null || file === void 0 ? void 0 : (_file$info2 = file.info) === null || _file$info2 === void 0 ? void 0 : _file$info2.preview,
|
|
38
|
+
srcUrl: getItemIcon(),
|
|
39
|
+
onDoubleClick: filePreviewToggle,
|
|
40
|
+
parentIsList: viewLayout === LAYOUTS_IDS.LIST,
|
|
41
|
+
isImage: isImage(file),
|
|
42
|
+
isPngSvgGif: isPngSvgGif,
|
|
43
|
+
extension: extension,
|
|
44
|
+
noImgTransformations: noImgTransformations,
|
|
45
|
+
isDevEnv: isDevEnv,
|
|
46
|
+
container: container,
|
|
47
|
+
lazyloading: lazyloading,
|
|
48
|
+
isTransparencySupported: isTransparencySupported(file),
|
|
49
|
+
isRemoteUpload: file === null || file === void 0 ? void 0 : file.isRemote,
|
|
50
|
+
isSmallSizePreview: isSmallSizePreview
|
|
51
|
+
}, props));
|
|
52
|
+
};
|
|
53
|
+
export default AssetPreview;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { InfoOutline } from '@scaleflex/icons';
|
|
9
|
+
import { InputAndLabel, BackdropOverlay, Spinner } from './';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
var AutoSuggest = function AutoSuggest(props) {
|
|
12
|
+
var _props$val, _props$suggestions;
|
|
13
|
+
var _useState = useState(0),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
activeSuggestion = _useState2[0],
|
|
16
|
+
setActiveSuggestion = _useState2[1];
|
|
17
|
+
var _useState3 = useState([]),
|
|
18
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
19
|
+
filteredSuggestions = _useState4[0],
|
|
20
|
+
setFilteredSuggestions = _useState4[1];
|
|
21
|
+
var _useState5 = useState(false),
|
|
22
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
23
|
+
showSuggestions = _useState6[0],
|
|
24
|
+
setShowSuggestions = _useState6[1];
|
|
25
|
+
var _useState7 = useState((_props$val = props.val) !== null && _props$val !== void 0 ? _props$val : ''),
|
|
26
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
27
|
+
value = _useState8[0],
|
|
28
|
+
setValue = _useState8[1];
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
if (props.onMount) {
|
|
31
|
+
props.onMount('/');
|
|
32
|
+
setShowSuggestions(true);
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
setValue(props.val);
|
|
37
|
+
}, [props.val]);
|
|
38
|
+
var suggestionChoose = function suggestionChoose(e) {
|
|
39
|
+
setActiveSuggestion(0);
|
|
40
|
+
setFilteredSuggestions([]);
|
|
41
|
+
setShowSuggestions(false);
|
|
42
|
+
setValue(e.currentTarget.innerText);
|
|
43
|
+
if (props.onChoose) {
|
|
44
|
+
props.onChoose(e);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var suggestionListChange = function suggestionListChange(e) {
|
|
48
|
+
props.getParentPosition(e);
|
|
49
|
+
var input = e !== null && e !== void 0 && e.target ? e.target.value : e;
|
|
50
|
+
var data = props.handleInput ? props.handleInput(e) : [];
|
|
51
|
+
var filteredSuggestions = data === null || data === void 0 ? void 0 : data.filter(function (sugg) {
|
|
52
|
+
return sugg.toLowerCase().indexOf(input.toLowerCase()) > -1;
|
|
53
|
+
});
|
|
54
|
+
setActiveSuggestion(0);
|
|
55
|
+
setFilteredSuggestions(filteredSuggestions);
|
|
56
|
+
setShowSuggestions(true);
|
|
57
|
+
setValue(input);
|
|
58
|
+
};
|
|
59
|
+
var closeSuggestion = function closeSuggestion() {
|
|
60
|
+
setShowSuggestions(false);
|
|
61
|
+
};
|
|
62
|
+
var toggleSuggestion = function toggleSuggestion(e) {
|
|
63
|
+
props.getParentPosition(e);
|
|
64
|
+
setShowSuggestions(!showSuggestions);
|
|
65
|
+
};
|
|
66
|
+
var suggestionListKeyDown = function suggestionListKeyDown(e) {
|
|
67
|
+
if (props.onListKeyDown) {
|
|
68
|
+
props.onListKeyDown(e);
|
|
69
|
+
} else if (e.keyCode === 13) {
|
|
70
|
+
if (props.onKeyEnter) {
|
|
71
|
+
props.onKeyEnter(e);
|
|
72
|
+
}
|
|
73
|
+
setActiveSuggestion(0);
|
|
74
|
+
setShowSuggestions(false);
|
|
75
|
+
setValue(props.clearValue ? '' : filteredSuggestions[activeSuggestion]);
|
|
76
|
+
} else if (e.key === 'Backspace' && !value) {
|
|
77
|
+
if (props.onKeyBackSpace) {
|
|
78
|
+
props.onKeyBackSpace();
|
|
79
|
+
}
|
|
80
|
+
} else if (e.keyCode === 38) {
|
|
81
|
+
// User pressed the up arrow
|
|
82
|
+
if (activeSuggestion === 0) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setActiveSuggestion(activeSuggestion - 1);
|
|
86
|
+
// User pressed the down arrow
|
|
87
|
+
} else if (e.keyCode === 40) {
|
|
88
|
+
if (activeSuggestion - 1 === (filteredSuggestions === null || filteredSuggestions === void 0 ? void 0 : filteredSuggestions.length)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
setActiveSuggestion(activeSuggestion + 1);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var renderLoading = function renderLoading() {
|
|
95
|
+
return /*#__PURE__*/_jsx("div", {
|
|
96
|
+
className: props.postUpload ? 'suggestions post-upload-suggestion suggestion-loading' : 'suggestions suggestion-loading',
|
|
97
|
+
children: /*#__PURE__*/_jsx(Spinner, {})
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
var renderOptionTags = function renderOptionTags() {
|
|
101
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
102
|
+
className: "suggestions-title",
|
|
103
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
104
|
+
children: props.i18n('subTabSuggestedTagsLabel')
|
|
105
|
+
}), /*#__PURE__*/_jsx(InfoOutline, {
|
|
106
|
+
color: props.iconPrimaryColor
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
var renderSuggestionList = function renderSuggestionList(suggestions) {
|
|
111
|
+
return /*#__PURE__*/_jsx("ul", {
|
|
112
|
+
className: props.postUpload ? "suggestions post-upload-suggestion suggestions-".concat(props.isTags ? 'tags' : 'list') : 'suggestions',
|
|
113
|
+
children: suggestions.map(function (suggestion, index) {
|
|
114
|
+
var className;
|
|
115
|
+
|
|
116
|
+
// Flag the active suggestion with a class
|
|
117
|
+
if (index === activeSuggestion) {
|
|
118
|
+
className = 'suggestion-active';
|
|
119
|
+
}
|
|
120
|
+
return /*#__PURE__*/_jsx("li", {
|
|
121
|
+
className: className,
|
|
122
|
+
onClick: suggestionChoose,
|
|
123
|
+
children: suggestion
|
|
124
|
+
}, suggestion);
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// if we want to update suggestion from props
|
|
130
|
+
var suggestions = ((_props$suggestions = props.suggestions) === null || _props$suggestions === void 0 ? void 0 : _props$suggestions.length) > 0 ? props.suggestions : filteredSuggestions;
|
|
131
|
+
var suggestionsListComponent;
|
|
132
|
+
if (value) {
|
|
133
|
+
if (props.loadSuggestion) {
|
|
134
|
+
suggestionsListComponent = renderLoading();
|
|
135
|
+
} else {
|
|
136
|
+
if (suggestions !== null && suggestions !== void 0 && suggestions.length && showSuggestions) {
|
|
137
|
+
suggestionsListComponent = /*#__PURE__*/_jsxs("div", {
|
|
138
|
+
className: "filerobot-common-autoSuggest-list-wrapper".concat(props.listClasses ? " ".concat(props.listClasses) : ''),
|
|
139
|
+
style: {
|
|
140
|
+
bottom: 17
|
|
141
|
+
},
|
|
142
|
+
children: [props.isTags && renderOptionTags(), renderSuggestionList(suggestions)]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
148
|
+
children: [showSuggestions && /*#__PURE__*/_jsx(BackdropOverlay, {
|
|
149
|
+
onClick: closeSuggestion
|
|
150
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
151
|
+
className: "filerobot-common-autoSuggest",
|
|
152
|
+
children: [/*#__PURE__*/_jsx(InputAndLabel, {
|
|
153
|
+
item: props.label,
|
|
154
|
+
type: "text",
|
|
155
|
+
autoComplete: "off",
|
|
156
|
+
value: value,
|
|
157
|
+
onKeyDown: suggestionListKeyDown,
|
|
158
|
+
onInput: suggestionListChange,
|
|
159
|
+
onClick: toggleSuggestion,
|
|
160
|
+
i18n: props.i18n,
|
|
161
|
+
icon: props.icon
|
|
162
|
+
}), suggestionsListComponent]
|
|
163
|
+
})]
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
export default AutoSuggest;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { PC, FV } from '@scaleflex/widget-common';
|
|
5
|
+
var Avatar = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n\n position: relative;\n display: flex;\n width: ", "px;\n height: ", "px;\n justify-content: center;\n align-items: center;\n text-align: center;\n border-radius: 50%;\n flex-shrink: 0;\n\n ", "\n\n > img {\n max-width: 100%;\n max-height: 100%;\n border-radius: 50%;\n }\n"])), function (_ref) {
|
|
6
|
+
var labelSize = _ref.labelSize,
|
|
7
|
+
font = _ref.theme.typography.font;
|
|
8
|
+
return font[labelSize === 'sm' ? FV.LabelLargeEmphasis : FV.LabelExtraLargeEmphasis];
|
|
9
|
+
}, function (_ref2) {
|
|
10
|
+
var _ref2$size = _ref2.size,
|
|
11
|
+
size = _ref2$size === void 0 ? 42 : _ref2$size;
|
|
12
|
+
return size;
|
|
13
|
+
}, function (_ref3) {
|
|
14
|
+
var _ref3$size = _ref3.size,
|
|
15
|
+
size = _ref3$size === void 0 ? 42 : _ref3$size;
|
|
16
|
+
return size;
|
|
17
|
+
}, function (_ref4) {
|
|
18
|
+
var isImage = _ref4.isImage,
|
|
19
|
+
palette = _ref4.theme.palette;
|
|
20
|
+
return !isImage && "\n background: ".concat(palette[PC.Accent_0_8_Overlay], ";\n color: ").concat(palette[PC.AccentStateless], ";\n ");
|
|
21
|
+
});
|
|
22
|
+
var Styled = {
|
|
23
|
+
Avatar: Avatar
|
|
24
|
+
};
|
|
25
|
+
export default Styled;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { useTheme } from '@scaleflex/ui/theme/hooks';
|
|
9
|
+
import User from '@scaleflex/icons/user';
|
|
10
|
+
import { Image, PC } from '@scaleflex/widget-common';
|
|
11
|
+
import getCloudimagePrefixedUrl from '@scaleflex/widget-utils/lib/getCloudimagePrefixedUrl';
|
|
12
|
+
import Styled from './Avatar.styled';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* How to use?
|
|
16
|
+
*
|
|
17
|
+
* - Usual case:
|
|
18
|
+
* <Avatar photo={userPhoto} name={userNameOrEmail} />
|
|
19
|
+
*
|
|
20
|
+
* - Small avatar case:
|
|
21
|
+
* <Avatar photo={userPhoto} size={16} iconSize={7.5} />
|
|
22
|
+
*
|
|
23
|
+
* - Team avatar case:
|
|
24
|
+
* <Avatar photo={teamPhoto} Icon={Group} />
|
|
25
|
+
* OR if you don't need team image
|
|
26
|
+
* <Avatar Icon={Group} />
|
|
27
|
+
*/
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
var Avatar = function Avatar(_ref) {
|
|
30
|
+
var name = _ref.name,
|
|
31
|
+
photo = _ref.photo,
|
|
32
|
+
label = _ref.label,
|
|
33
|
+
renderExtraBlock = _ref.renderExtraBlock,
|
|
34
|
+
_ref$labelSize = _ref.labelSize,
|
|
35
|
+
labelSize = _ref$labelSize === void 0 ? 'md' : _ref$labelSize,
|
|
36
|
+
_ref$DefaultIcon = _ref.DefaultIcon,
|
|
37
|
+
DefaultIcon = _ref$DefaultIcon === void 0 ? User : _ref$DefaultIcon,
|
|
38
|
+
_ref$iconSize = _ref.iconSize,
|
|
39
|
+
iconSize = _ref$iconSize === void 0 ? 18 : _ref$iconSize,
|
|
40
|
+
Icon = _ref.Icon,
|
|
41
|
+
_ref$size = _ref.size,
|
|
42
|
+
size = _ref$size === void 0 ? 42 : _ref$size;
|
|
43
|
+
var theme = useTheme();
|
|
44
|
+
var _useState = useState(false),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
hasPhotoLoadError = _useState2[0],
|
|
47
|
+
setHasPhotoLoadError = _useState2[1];
|
|
48
|
+
var renderLabel = function renderLabel() {
|
|
49
|
+
var _name$match;
|
|
50
|
+
if (Icon) return /*#__PURE__*/_jsx(Icon, {
|
|
51
|
+
color: theme.palette[PC.AccentStateless],
|
|
52
|
+
size: iconSize
|
|
53
|
+
});
|
|
54
|
+
if (label) return label;
|
|
55
|
+
if (name) return (_name$match = name.match(/\w/)) === null || _name$match === void 0 ? void 0 : _name$match[0];
|
|
56
|
+
return /*#__PURE__*/_jsx(DefaultIcon, {
|
|
57
|
+
color: theme.palette[PC.AccentStateless],
|
|
58
|
+
size: iconSize
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
return /*#__PURE__*/_jsxs(Styled.Avatar, {
|
|
62
|
+
isImage: Boolean(!hasPhotoLoadError && photo),
|
|
63
|
+
labelSize: labelSize,
|
|
64
|
+
size: size,
|
|
65
|
+
children: [!hasPhotoLoadError && photo ? /*#__PURE__*/_jsx(Image, {
|
|
66
|
+
src: getCloudimagePrefixedUrl(photo, {
|
|
67
|
+
params: {
|
|
68
|
+
w: size * 2,
|
|
69
|
+
h: size * 2,
|
|
70
|
+
func: 'crop'
|
|
71
|
+
}
|
|
72
|
+
}),
|
|
73
|
+
alt: "Photo",
|
|
74
|
+
onError: function onError() {
|
|
75
|
+
return setHasPhotoLoadError(true);
|
|
76
|
+
},
|
|
77
|
+
onLoad: function onLoad() {
|
|
78
|
+
return setHasPhotoLoadError(false);
|
|
79
|
+
}
|
|
80
|
+
}) : renderLabel(), typeof renderExtraBlock === 'function' && renderExtraBlock()]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
export default Avatar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { PC } from '@scaleflex/widget-common';
|
|
5
|
+
var AvatarStatus = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: -5px;\n right: -4px;\n width: 20px;\n height: 20px;\n background: ", ";\n border-radius: 50%;\n padding: 3px;\n"])), function (_ref) {
|
|
6
|
+
var palette = _ref.theme.palette;
|
|
7
|
+
return palette[PC.BackgroundStateless];
|
|
8
|
+
});
|
|
9
|
+
var Styled = {
|
|
10
|
+
AvatarStatus: AvatarStatus
|
|
11
|
+
};
|
|
12
|
+
export default Styled;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Avatar from '@scaleflex/widget-common/lib/Avatar';
|
|
2
|
+
import Styled from './AvatarWithStatus.styled';
|
|
3
|
+
import ApprovalStatus from '../ApprovalStatus';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
var AvatarWithStatus = function AvatarWithStatus(_ref) {
|
|
6
|
+
var photo = _ref.photo,
|
|
7
|
+
name = _ref.name,
|
|
8
|
+
status = _ref.status,
|
|
9
|
+
label = _ref.label,
|
|
10
|
+
_ref$labelSize = _ref.labelSize,
|
|
11
|
+
labelSize = _ref$labelSize === void 0 ? 'md' : _ref$labelSize,
|
|
12
|
+
i18n = _ref.i18n;
|
|
13
|
+
return /*#__PURE__*/_jsx(Avatar, {
|
|
14
|
+
photo: photo,
|
|
15
|
+
name: name,
|
|
16
|
+
label: label,
|
|
17
|
+
labelSize: labelSize,
|
|
18
|
+
renderExtraBlock: function renderExtraBlock() {
|
|
19
|
+
return status && /*#__PURE__*/_jsx(Styled.AvatarStatus, {
|
|
20
|
+
children: /*#__PURE__*/_jsx(ApprovalStatus, {
|
|
21
|
+
size: 14,
|
|
22
|
+
statusCode: status,
|
|
23
|
+
showLabel: false,
|
|
24
|
+
i18n: i18n
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export default AvatarWithStatus;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["onClick", "hideDivider", "noMargin", "iconPrimaryColor", "dividerStyles"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import { GoBack } from '@scaleflex/icons';
|
|
11
|
+
import { IconLabeledButton } from './';
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
var baseClass = 'filerobot-common-BackCloseButton';
|
|
14
|
+
var BackButton = function BackButton(_ref) {
|
|
15
|
+
var onClick = _ref.onClick,
|
|
16
|
+
_ref$hideDivider = _ref.hideDivider,
|
|
17
|
+
hideDivider = _ref$hideDivider === void 0 ? false : _ref$hideDivider,
|
|
18
|
+
_ref$noMargin = _ref.noMargin,
|
|
19
|
+
noMargin = _ref$noMargin === void 0 ? false : _ref$noMargin,
|
|
20
|
+
iconPrimaryColor = _ref.iconPrimaryColor,
|
|
21
|
+
dividerStyles = _ref.dividerStyles,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
return !hideDivider ? /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
24
|
+
className: baseClass
|
|
25
|
+
}, rest), {}, {
|
|
26
|
+
children: [/*#__PURE__*/_jsx(IconLabeledButton, {
|
|
27
|
+
icon: /*#__PURE__*/_jsx(GoBack, {
|
|
28
|
+
color: iconPrimaryColor
|
|
29
|
+
}),
|
|
30
|
+
classes: "".concat(baseClass, "-button").concat(noMargin ? '' : " ".concat(baseClass, "-buttonMargin")),
|
|
31
|
+
onClick: onClick
|
|
32
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
33
|
+
className: "filerobot-common-verticalDivider ".concat(baseClass, "-divider"),
|
|
34
|
+
style: _objectSpread({
|
|
35
|
+
marginLeft: noMargin ? 6 : undefined
|
|
36
|
+
}, dividerStyles)
|
|
37
|
+
})]
|
|
38
|
+
})) : /*#__PURE__*/_jsx(IconLabeledButton, _objectSpread({
|
|
39
|
+
icon: /*#__PURE__*/_jsx(GoBack, {
|
|
40
|
+
color: iconPrimaryColor
|
|
41
|
+
}),
|
|
42
|
+
classes: "".concat(baseClass, "-button").concat(noMargin ? '' : " ".concat(baseClass, "-buttonMargin")),
|
|
43
|
+
onClick: onClick
|
|
44
|
+
}, rest));
|
|
45
|
+
};
|
|
46
|
+
export default BackButton;
|