Merged PR 169: Fix bugs with flex + Disable obnoxious swals + Add selector text + Sort SVG scss to different files

- Disable PushBehavior and set it in a different file
- Fix behviors when parent === undefined
- Fix flex behavrios when using anchors
- Fix siblings not applying flex to theirs children on container delete
- Fix flex behavior when using anchors
- Enable flex by default
- Disable obnoxious swals
- Add selector text
- Sort SVG scss to different files

Others: Add some todos
This commit is contained in:
Eric Nguyen 2022-08-26 13:59:03 +00:00
parent a718268972
commit 3f58c5ba5e
15 changed files with 208 additions and 134 deletions

View file

@ -9,7 +9,6 @@
import Swal from 'sweetalert2';
import { IContainerModel } from '../../../Interfaces/IContainerModel';
import { ISizePointer } from '../../../Interfaces/ISizePointer';
import { PushContainers } from './FlexBehaviors';
/**
* "Transform the container into a rigid body"
@ -24,7 +23,6 @@ export function ApplyRigidBody(
container: IContainerModel
): IContainerModel {
container = constraintBodyInsideParent(container);
container = PushContainers(container);
container = constraintBodyInsideUnallocatedWidth(container);
return container;
}
@ -118,7 +116,7 @@ function constraintBodyInsideSpace(
export function constraintBodyInsideUnallocatedWidth(
container: IContainerModel
): IContainerModel {
if (container.parent === null) {
if (container.parent === null || container.parent === undefined) {
return container;
}
@ -177,14 +175,14 @@ export function constraintBodyInsideUnallocatedWidth(
if (availableWidth === undefined) {
console.warn(`Container ${container.properties.id} cannot fit in any space due to its minimum width being to large. Consequently, its rigid body property is disabled.`);
Swal.fire({
position: 'top-end',
title: `Container ${container.properties.id} cannot fit!`,
text: 'Its rigid body property is now disabled. Change its the minimum width or free the parent container.',
timerProgressBar: true,
showConfirmButton: false,
timer: 5000
});
// Swal.fire({
// position: 'top-end',
// title: `Container ${container.properties.id} cannot fit!`,
// text: 'Its rigid body property is now disabled. Change its the minimum width or free the parent container.',
// timerProgressBar: true,
// showConfirmButton: false,
// timer: 5000
// });
return container;
}