Skip to content

Commit

Permalink
feat(4ps): inline edit
Browse files Browse the repository at this point in the history
  • Loading branch information
develite98 committed Jan 3, 2024
1 parent 2939a0e commit a893f98
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 26 deletions.
1 change: 1 addition & 0 deletions apps/mix-cms/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.3.1/css/flag-icon.min.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0" />

<link rel="manifest" href="manifest.webmanifest" />
<meta name="theme-color" content="#1976d2" />
Expand Down
11 changes: 1 addition & 10 deletions apps/mix-database/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!-- <link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-utilities.min.css"
/> -->

<link
href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.3.1/css/flag-icon.min.css"
rel="stylesheet"
/>

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0" />
<link rel="manifest" href="manifest.webmanifest" />
<meta name="theme-color" content="#1976d2" />
</head>
Expand Down
2 changes: 2 additions & 0 deletions apps/mix-kanban/src/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -11,6 +12,7 @@
href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.3.1/css/flag-icon.min.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0" />

<link rel="manifest" href="manifest.webmanifest" />
<meta name="theme-color" content="#1976d2" />
Expand Down
24 changes: 24 additions & 0 deletions libs/mix-lib/src/model/core/database.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,27 @@ export const DatabaseProviderDisplay: Record<
[DatabaseProvider.PostgreSQL]: 'Postgres Sql',
[DatabaseProvider.SQLITE]: 'Sql Lite',
};

export const DataTypeToAgCellEditor = (dataType: DataType) => {
switch (dataType) {
case DataType.Text:
case DataType.Icon:
case DataType.ImageUrl:
case DataType.VideoYoutube:
case DataType.Url:
case DataType.Password:
return 'agTextCellEditor';
case DataType.Integer:
case DataType.Double:
case DataType.Duration:
return 'agNumberCellEditor';
case DataType.Date:
return 'agDateCellEditor';
case DataType.DateTime:
return 'agDateCellEditor';
case DataType.MultilineText:
return 'agLargeTextCellEditor';
default:
return 'agTextCellEditor';
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@

&:hover {
opacity: 0.8;

.mix-icon {
font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
}

&:first-of-type {
Expand Down Expand Up @@ -126,6 +130,12 @@
&.--active,
&:hover {
background-color: var(--menu-active-color);

.side-menu__parent-container {
.mix-icon {
font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
}
}

&.--route-active {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import {
} from '@angular/core';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { MixDatabase, MixDynamicData, MixFilter } from '@mixcore/lib/model';
import {
DataTypeToAgCellEditor,
MixDatabase,
MixDynamicData,
MixFilter,
} from '@mixcore/lib/model';
import { MixApiFacadeService } from '@mixcore/share/api';
import {
BasicMixFilterComponent,
Expand Down Expand Up @@ -181,6 +186,7 @@ export class DatabaseDataComponent
dataType: x.dataType,
columnType: 'value',
},
cellEditor: DataTypeToAgCellEditor(x.dataType),
}
);
this.columnNames = s.db.columns.map((x) => x.displayName);
Expand Down
16 changes: 1 addition & 15 deletions libs/share-styles/src/styles/material-symbol.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/* fallback */
@font-face {
font-family: 'Material Symbols Outlined';
font-style: normal;
font-weight: 400;
src: url('./fonts/mat-symbol-400.woff2') format('woff2');
}

@font-face {
font-family: 'Material Symbols Outlined';
font-style: normal;
font-weight: 200;
src: url('./fonts/mat-symbol-200.woff2') format('woff2');
}

.material-symbols-outlined {
font-family: 'Material Symbols Outlined';
font-weight: normal;
Expand Down Expand Up @@ -43,4 +28,5 @@
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
8 changes: 8 additions & 0 deletions libs/share-styles/src/styles/tippy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,16 @@
align-items: center;
gap: 6px;

.mix-icon {
@apply text-gray-900;
}

&:hover {
background-color: var(--tui-base-02);

.mix-icon {
font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
}
}

Expand Down

0 comments on commit a893f98

Please sign in to comment.