Skip to content

Commit

Permalink
Small fixes to fragment hider UI
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Aug 13, 2023
1 parent e5997e8 commit c87c9e6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
10 changes: 9 additions & 1 deletion resources/openbim-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -94754,6 +94754,9 @@ class AttributeQueryUI extends SimpleUIComponent {
constructor(components) {
super(components, `<div class="flex gap-x-2"></div>`);
this.negate = new Dropdown(components);
const negateClass = this.negate.domElement.classList;
negateClass.remove("w-full");
negateClass.add("min-w-[4.5rem]");
this.negate.label = "Sign";
this.negate.addOption("A", "NOT A");
this.negate.value = "A";
Expand Down Expand Up @@ -94840,7 +94843,7 @@ class QueryGroupUI extends SimpleUIComponent {
}
}
constructor(components) {
super(components, `<div class="flex flex-col gap-y-3 p-3 border border-solid border-ifcjs-120 rounded-md"></div>`);
super(components, `<div class="flex flex-col gap-y-3 p-3 border border-solid border-ifcjs-120 bg-ifcjs-100 rounded-md"></div>`);
this.operator = new Dropdown(components);
this.operator.visible = false;
this.operator.label = null;
Expand Down Expand Up @@ -95011,6 +95014,9 @@ class IfcPropertiesFinder extends Component {
const groups = JSON.parse(serialized);
this.uiElement.query.query = groups;
}
deleteCache() {
localStorage.removeItem(this._localStorageID);
}
setUI() {
const mainButton = this.uiElement.main;
this.uiElement.queryWindow = new FloatingWindow(this._components);
Expand Down Expand Up @@ -96539,6 +96545,7 @@ class FragmentHider extends Component {
tooltip: "Visibility filters",
});
mainButton.onclick = () => {
this.hideAllFinders();
mainWindow.visible = !mainWindow.visible;
};
const topButtonContainerHtml = `<div class="flex"></div>`;
Expand Down Expand Up @@ -96688,6 +96695,7 @@ class FragmentHider extends Component {
found.styleCard.dispose();
found.deleteButton.dispose();
found.name.dispose();
found.finder.deleteCache();
found.finder.dispose();
found.visible.dispose();
found.enabled.dispose();
Expand Down
4 changes: 4 additions & 0 deletions resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,10 @@ html {
min-width: 300px;
}

.min-w-\[4\.5rem\]{
min-width: 4.5rem;
}

.max-w-xs{
max-width: 20rem;
}
Expand Down
4 changes: 3 additions & 1 deletion src/fragments/FragmentHider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class FragmentHider extends Component<void> implements Disposable, UI {
});

mainButton.onclick = () => {
this.hideAllFinders();
mainWindow.visible = !mainWindow.visible;
};

Expand Down Expand Up @@ -255,6 +256,7 @@ export class FragmentHider extends Component<void> implements Disposable, UI {
found.styleCard.dispose();
found.deleteButton.dispose();
found.name.dispose();
found.finder.deleteCache();
found.finder.dispose();
found.visible.dispose();
found.enabled.dispose();
Expand All @@ -264,7 +266,7 @@ export class FragmentHider extends Component<void> implements Disposable, UI {
this.update();
}

private hideAllFinders(excludeID: string) {
private hideAllFinders(excludeID?: string) {
for (const id in this._filterCards) {
const { finder } = this._filterCards[id];
const window = finder.uiElement.queryWindow;
Expand Down
4 changes: 4 additions & 0 deletions src/ifc/IfcPropertiesFinder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ export class IfcPropertiesFinder extends Component<null> implements UI {
this.uiElement.query.query = groups;
}

deleteCache() {
localStorage.removeItem(this._localStorageID);
}

private setUI() {
const mainButton = this.uiElement.main;
this.uiElement.queryWindow = new FloatingWindow(this._components);
Expand Down
3 changes: 3 additions & 0 deletions src/ifc/IfcPropertiesFinder/src/attribute-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export class AttributeQueryUI extends SimpleUIComponent {
super(components, `<div class="flex gap-x-2"></div>`);

this.negate = new Dropdown(components);
const negateClass = this.negate.domElement.classList;
negateClass.remove("w-full");
negateClass.add("min-w-[4.5rem]");
this.negate.label = "Sign";
this.negate.addOption("A", "NOT A");
this.negate.value = "A";
Expand Down
2 changes: 1 addition & 1 deletion src/ifc/IfcPropertiesFinder/src/query-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class QueryGroupUI extends SimpleUIComponent {
constructor(components: Components) {
super(
components,
`<div class="flex flex-col gap-y-3 p-3 border border-solid border-ifcjs-120 rounded-md"></div>`
`<div class="flex flex-col gap-y-3 p-3 border border-solid border-ifcjs-120 bg-ifcjs-100 rounded-md"></div>`
);

this.operator = new Dropdown(components);
Expand Down

0 comments on commit c87c9e6

Please sign in to comment.