Merge pull request #1001 from ONLYOFFICE/feature/fix-bug-reactjs
Feature/fix bug reactjs
This commit is contained in:
commit
f06ee2f5db
|
@ -45,7 +45,7 @@ const StandartColors = ({ options, standartColors, onColorClick, curColor }) =>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
const CustomColors = ({ options, customColors, onColorClick, curColor }) => {
|
const CustomColors = ({ options, customColors, isTypeColors, onColorClick, curColor }) => {
|
||||||
const colors = customColors.length > 0 ? customColors : [];
|
const colors = customColors.length > 0 ? customColors : [];
|
||||||
const emptyItems = [];
|
const emptyItems = [];
|
||||||
if (colors.length < options.customcolors) {
|
if (colors.length < options.customcolors) {
|
||||||
|
@ -64,7 +64,7 @@ const CustomColors = ({ options, customColors, onColorClick, curColor }) => {
|
||||||
{colors && colors.length > 0 && colors.map((color, index) => {
|
{colors && colors.length > 0 && colors.map((color, index) => {
|
||||||
return(
|
return(
|
||||||
<a key={`dc-${index}`}
|
<a key={`dc-${index}`}
|
||||||
className={curColor && curColor === color && index === indexCurColor ? 'active' : ''}
|
className={curColor && curColor === color && index === indexCurColor && !isTypeColors ? 'active' : ''}
|
||||||
style={{background: `#${color}`}}
|
style={{background: `#${color}`}}
|
||||||
onClick={() => {onColorClick(color)}}
|
onClick={() => {onColorClick(color)}}
|
||||||
></a>
|
></a>
|
||||||
|
@ -100,6 +100,7 @@ const ThemeColorPalette = props => {
|
||||||
themeColors[row].push(effect);
|
themeColors[row].push(effect);
|
||||||
});
|
});
|
||||||
const standartColors = Common.Utils.ThemeColor.getStandartColors();
|
const standartColors = Common.Utils.ThemeColor.getStandartColors();
|
||||||
|
let isTypeColors = standartColors.some( value => value === curColor );
|
||||||
// custom color
|
// custom color
|
||||||
let customColors = props.customColors;
|
let customColors = props.customColors;
|
||||||
if (customColors.length < 1) {
|
if (customColors.length < 1) {
|
||||||
|
@ -120,7 +121,7 @@ const ThemeColorPalette = props => {
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem className='dynamic-colors'>
|
<ListItem className='dynamic-colors'>
|
||||||
<div>{ _t.textCustomColors }</div>
|
<div>{ _t.textCustomColors }</div>
|
||||||
<CustomColors options={options} customColors={customColors} onColorClick={props.changeColor} curColor={curColor}/>
|
<CustomColors options={options} isTypeColors={isTypeColors} customColors={customColors} onColorClick={props.changeColor} curColor={curColor}/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -239,6 +239,7 @@ const EditImage = props => {
|
||||||
const storeFocusObjects = props.storeFocusObjects;
|
const storeFocusObjects = props.storeFocusObjects;
|
||||||
const imageObject = storeFocusObjects.imageObject;
|
const imageObject = storeFocusObjects.imageObject;
|
||||||
const pluginGuid = imageObject.asc_getPluginGuid();
|
const pluginGuid = imageObject.asc_getPluginGuid();
|
||||||
|
const wrapType = props.storeImageSettings.getWrapType(imageObject);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
@ -254,9 +255,9 @@ const EditImage = props => {
|
||||||
onReplaceByFile: props.onReplaceByFile,
|
onReplaceByFile: props.onReplaceByFile,
|
||||||
onReplaceByUrl: props.onReplaceByUrl
|
onReplaceByUrl: props.onReplaceByUrl
|
||||||
}}></ListItem>
|
}}></ListItem>
|
||||||
<ListItem title={_t.textReorder} link='/edit-image-reorder/' routeProps={{
|
{ wrapType !== 'inline' && <ListItem title={_t.textReorder} link='/edit-image-reorder/' routeProps={{
|
||||||
onReorder: props.onReorder
|
onReorder: props.onReorder
|
||||||
}}></ListItem>
|
}}></ListItem> }
|
||||||
</List>
|
</List>
|
||||||
<List className="buttons-list">
|
<List className="buttons-list">
|
||||||
<ListButton className='button-fill button-raised' title={_t.textActualSize} onClick={() => {props.onDefaulSize()}}/>
|
<ListButton className='button-fill button-raised' title={_t.textActualSize} onClick={() => {props.onDefaulSize()}}/>
|
||||||
|
@ -266,7 +267,7 @@ const EditImage = props => {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditImageContainer = inject("storeFocusObjects")(observer(EditImage));
|
const EditImageContainer = inject("storeFocusObjects", "storeImageSettings")(observer(EditImage));
|
||||||
const PageWrapContainer = inject("storeFocusObjects", "storeImageSettings")(observer(PageWrap));
|
const PageWrapContainer = inject("storeFocusObjects", "storeImageSettings")(observer(PageWrap));
|
||||||
const PageReplaceContainer = inject("storeFocusObjects")(observer(PageReplace));
|
const PageReplaceContainer = inject("storeFocusObjects")(observer(PageReplace));
|
||||||
const PageReorderContainer = inject("storeFocusObjects")(observer(PageReorder));
|
const PageReorderContainer = inject("storeFocusObjects")(observer(PageReorder));
|
||||||
|
|
|
@ -506,9 +506,8 @@ const EditShape = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const _t = t('Edit', {returnObjects: true});
|
const _t = t('Edit', {returnObjects: true});
|
||||||
const canFill = props.storeFocusObjects.shapeObject.get_ShapeProperties().get_CanFill();
|
const canFill = props.storeFocusObjects.shapeObject.get_ShapeProperties().get_CanFill();
|
||||||
const storeShapeSettings = props.storeShapeSettings;
|
|
||||||
const shapeObject = props.storeFocusObjects.shapeObject;
|
const shapeObject = props.storeFocusObjects.shapeObject;
|
||||||
const wrapType = storeShapeSettings.getWrapType(shapeObject);
|
const wrapType = props.storeShapeSettings.getWrapType(shapeObject);
|
||||||
|
|
||||||
let disableRemove = !!props.storeFocusObjects.paragraphObject;
|
let disableRemove = !!props.storeFocusObjects.paragraphObject;
|
||||||
|
|
||||||
|
@ -537,9 +536,9 @@ const EditShape = props => {
|
||||||
<ListItem title={_t.textReplace} link='/edit-shape-replace/' routeProps={{
|
<ListItem title={_t.textReplace} link='/edit-shape-replace/' routeProps={{
|
||||||
onReplace: props.onReplace
|
onReplace: props.onReplace
|
||||||
}}></ListItem>
|
}}></ListItem>
|
||||||
<ListItem disabled={wrapType === 'inline' ? true : false } title={_t.textReorder} link='/edit-shape-reorder/' routeProps={{
|
{ wrapType !== 'inline' && <ListItem title={_t.textReorder} link='/edit-shape-reorder/' routeProps={{
|
||||||
onReorder: props.onReorder
|
onReorder: props.onReorder
|
||||||
}}></ListItem>
|
}}></ListItem> }
|
||||||
</List>
|
</List>
|
||||||
<List className="buttons-list">
|
<List className="buttons-list">
|
||||||
<ListButton title={_t.textRemoveShape} onClick={() => {props.onRemoveShape()}} className={`button-red button-fill button-raised${disableRemove ? ' disabled' : ''}`} />
|
<ListButton title={_t.textRemoveShape} onClick={() => {props.onRemoveShape()}} className={`button-red button-fill button-raised${disableRemove ? ' disabled' : ''}`} />
|
||||||
|
|
|
@ -119,13 +119,13 @@ const PageAdditionalFormatting = props => {
|
||||||
</List>
|
</List>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={t('Edit.textLetterSpacing')}>
|
<ListItem title={t('Edit.textLetterSpacing')}>
|
||||||
{!isAndroid && <div slot='after-start'>{letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()}</div>}
|
{!isAndroid && <div slot='after-start'>{(Number.isInteger(letterSpacing) ? letterSpacing : letterSpacing.toFixed(2)) + ' ' + Common.Utils.Metric.getCurrentMetricName()}</div>}
|
||||||
<div slot='after'>
|
<div slot='after'>
|
||||||
<Segmented>
|
<Segmented>
|
||||||
<Button outline className='decrement item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, true)}}>
|
<Button outline className='decrement item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, true)}}>
|
||||||
{isAndroid ? <Icon icon="icon-expand-down"></Icon> : ' - '}
|
{isAndroid ? <Icon icon="icon-expand-down"></Icon> : ' - '}
|
||||||
</Button>
|
</Button>
|
||||||
{isAndroid && <label>{letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()}</label>}
|
{isAndroid && <label>{(Number.isInteger(letterSpacing) ? letterSpacing : letterSpacing.toFixed(2)) + ' ' + Common.Utils.Metric.getCurrentMetricName()}</label>}
|
||||||
<Button outline className='increment item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, false)}}>
|
<Button outline className='increment item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, false)}}>
|
||||||
{isAndroid ? <Icon icon="icon-expand-up"></Icon> : ' + '}
|
{isAndroid ? <Icon icon="icon-expand-up"></Icon> : ' + '}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -377,13 +377,13 @@ const PageAdditionalFormatting = props => {
|
||||||
</List>
|
</List>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={_t.textLetterSpacing}>
|
<ListItem title={_t.textLetterSpacing}>
|
||||||
{!isAndroid && <div slot='after-start'>{Number(letterSpacing).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName()}</div>}
|
{!isAndroid && <div slot='after-start'>{(Number.isInteger(letterSpacing) ? letterSpacing : letterSpacing.toFixed(2)) + ' ' + Common.Utils.Metric.getCurrentMetricName()}</div>}
|
||||||
<div slot='after'>
|
<div slot='after'>
|
||||||
<Segmented>
|
<Segmented>
|
||||||
<Button outline className='decrement item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, true)}}>
|
<Button outline className='decrement item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, true)}}>
|
||||||
{isAndroid ? <Icon icon="icon-expand-down"></Icon> : ' - '}
|
{isAndroid ? <Icon icon="icon-expand-down"></Icon> : ' - '}
|
||||||
</Button>
|
</Button>
|
||||||
{isAndroid && <label>{Number(letterSpacing).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName()}</label>}
|
{isAndroid && <label>{(Number.isInteger(letterSpacing) ? letterSpacing : letterSpacing.toFixed(2)) + ' ' + Common.Utils.Metric.getCurrentMetricName()}</label>}
|
||||||
<Button outline className='increment item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, false)}}>
|
<Button outline className='increment item-link' onClick={() => {props.changeLetterSpacing(letterSpacing, false)}}>
|
||||||
{isAndroid ? <Icon icon="icon-expand-up"></Icon> : ' + '}
|
{isAndroid ? <Icon icon="icon-expand-up"></Icon> : ' + '}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -63,6 +63,7 @@ const FilterOptionsController = () => {
|
||||||
const onClearFilter = () => {
|
const onClearFilter = () => {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
if(api) api.asc_clearFilter();
|
if(api) api.asc_clearFilter();
|
||||||
|
setCheckSort('');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDeleteFilter = () => {
|
const onDeleteFilter = () => {
|
||||||
|
@ -79,21 +80,17 @@ const FilterOptionsController = () => {
|
||||||
const setClearDisable = (config) => {
|
const setClearDisable = (config) => {
|
||||||
let arr = config.asc_getValues();
|
let arr = config.asc_getValues();
|
||||||
let lenCheck = arr.filter((item) => item.visible == true).length;
|
let lenCheck = arr.filter((item) => item.visible == true).length;
|
||||||
lenCheck == arr.length ? setIsValid(true) : setIsValid(false)
|
lenCheck == arr.length ? setIsValid(true) : setIsValid(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const setDataFilterCells = (config) => {
|
const setDataFilterCells = (config) => {
|
||||||
function isNumeric(value) {
|
|
||||||
return !isNaN(parseFloat(value)) && isFinite(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
let value = null,
|
let value = null,
|
||||||
isnumber = null,
|
isnumber = null,
|
||||||
arrCells = [];
|
arrCells = [];
|
||||||
|
|
||||||
config.asc_getValues().forEach((item, index) => {
|
config.asc_getValues().forEach((item, index) => {
|
||||||
value = item.asc_getText();
|
value = item.asc_getText();
|
||||||
isnumber = isNumeric(value);
|
isnumber = !isNaN(parseFloat(value)) && isFinite(value);
|
||||||
|
|
||||||
arrCells.push({
|
arrCells.push({
|
||||||
id : index,
|
id : index,
|
||||||
|
@ -111,12 +108,7 @@ const FilterOptionsController = () => {
|
||||||
const onUpdateCell = (id, state) => {
|
const onUpdateCell = (id, state) => {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
|
||||||
if ( id == 'all' ) {
|
id == 'all' ? listVal.forEach(item => item.check = state) : listVal[id].check = state;
|
||||||
listVal.forEach(item => item.check = state);
|
|
||||||
} else {
|
|
||||||
listVal[id].check = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
setListValue([...listVal]);
|
setListValue([...listVal]);
|
||||||
|
|
||||||
if ( listVal.some(item => item.check) ) {
|
if ( listVal.some(item => item.check) ) {
|
||||||
|
|
|
@ -84,3 +84,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item-input-wrap {
|
||||||
|
input[type = number] {
|
||||||
|
-moz-appearance: textfield;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue