Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
7a14415
refactor: header to work with 3.0 navigation
nmerget Feb 15, 2023
bb619cb
refactor: header and navigation to work for frameworks
nmerget Feb 16, 2023
bdd68c2
fix: issues for header and drawer in vanilla-showcase
nmerget Feb 17, 2023
b580f95
fix: issue with readmde
nmerget Feb 17, 2023
005de48
Merge branch 'main' into refactor-header
nmerget Feb 17, 2023
b0925bd
fix: issue with patternhub
nmerget Feb 17, 2023
7eb997f
Merge branch 'main' into refactor-header
nmerget Feb 17, 2023
3fdd69f
fix: issues with header.scss
nmerget Feb 17, 2023
aac02d9
fix: issues with dialog open with button
nmerget Feb 17, 2023
07b5020
fix: issues with dialog open with button
nmerget Feb 17, 2023
c40af38
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Feb 17, 2023
50b50e8
fix: issues with header component
nmerget Feb 17, 2023
dae876a
fix: issues with tests
nmerget Feb 20, 2023
18d556b
Merge branch 'main' into refactor-header
nmerget Feb 20, 2023
e4df26f
Merge branch 'main' into refactor-header
nmerget Feb 21, 2023
458c1cb
fix: add comments
nmerget Feb 27, 2023
0424305
Merge branch 'main' into refactor-header
nmerget Mar 2, 2023
2e0adfb
chore: update from main
nmerget Mar 17, 2023
9803f0e
Merge branch 'main' into refactor-header
mfranzke Mar 17, 2023
8bf3f88
refactor: update drawer
nmerget Mar 17, 2023
4df396b
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jun 22, 2023
00efac6
chore: update from main
nmerget Jun 22, 2023
d158737
fix: issues for vue and angular
nmerget Jun 22, 2023
c13f65d
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jun 29, 2023
ed22c24
Test mobile navigation (#1201)
nmerget Jun 29, 2023
ef8c7a1
chore: update patternhub with new navigation
nmerget Jun 30, 2023
72df0fb
fix: issue with readme for components
nmerget Jun 30, 2023
9052e24
fix: issue with power apps
nmerget Jun 30, 2023
77b9e01
Merge branch 'main' into refactor-header
nmerget Jun 30, 2023
a5852f1
chore: update scss for navigation
nmerget Jul 4, 2023
81900d1
chore: removed unused code
nmerget Jul 4, 2023
c681dc2
chore: update navigation-item to work with button
nmerget Jul 4, 2023
c9fd7d9
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 4, 2023
9983bc9
chore: update from main
nmerget Jul 4, 2023
50bef21
fix: issue with vue router-link
nmerget Jul 4, 2023
4ac289b
chore: update example and docs for main-navigation
nmerget Jul 4, 2023
745bdf5
chore: update from develop
nmerget Jul 6, 2023
d04a310
chore: update snapshots
nmerget Jul 6, 2023
8aeb590
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 7, 2023
6f5b5f7
chore: update snapshots and documentation
nmerget Jul 7, 2023
9df7d1a
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 7, 2023
e967028
fix: add fixedHeight for navigation-item tests
nmerget Jul 7, 2023
74f95bb
chore: update from main
nmerget Jul 10, 2023
9b1daf0
fix: enabled keyboard navigation for navigation
nmerget Jul 10, 2023
ec07a0e
chore: use correct aria for disabled
nmerget Jul 10, 2023
a3fa3f2
Merge branch 'main' into refactor-header
nmerget Jul 10, 2023
129ba68
refactor: rename showSubNavigation property
nmerget Jul 10, 2023
55c96d4
Merge remote-tracking branch 'origin/refactor-header' into refactor-h…
nmerget Jul 10, 2023
1f93723
chore: update from main
nmerget Jul 11, 2023
cfe1dc9
fix: navigation for patternhub
nmerget Jul 11, 2023
a12d834
fix: navigation for patternhub
nmerget Jul 11, 2023
90d338a
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 12, 2023
062d125
fix: issues with main-navigation.lite.tsx
nmerget Jul 12, 2023
7b28305
feat: add screen mixin to control "force-mobile" for header
nmerget Jul 12, 2023
27639c1
Merge branch 'main' into refactor-header
nmerget Jul 12, 2023
19fd1a1
fix: issue with documentation
nmerget Jul 12, 2023
d7a7405
Merge branch 'main' into refactor-header
mfranzke Jul 14, 2023
2c60eb3
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 17, 2023
f236a62
fix: issue with navigation chevron
nmerget Jul 17, 2023
0a79cb3
Merge branch 'main' into refactor-header
nmerget Jul 17, 2023
eee27bb
fix: issue with navigation for patternhub
nmerget Jul 17, 2023
c794117
fix: issue navigation for patternhub
nmerget Jul 17, 2023
ccaf22b
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 17, 2023
93c31e7
chore: update snapshots
nmerget Jul 17, 2023
42df86e
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 18, 2023
37edd6c
Merge branch 'main' into refactor-header
nmerget Jul 18, 2023
f4c85f0
chore: update snapshots
nmerget Jul 18, 2023
452b18d
Merge remote-tracking branch 'origin/refactor-header' into refactor-h…
nmerget Jul 18, 2023
a006544
Merge branch 'main' into refactor-header
mfranzke Jul 18, 2023
ebaea9c
Merge branch 'main' into refactor-header
nmerget Jul 19, 2023
a604f5e
chore: update chevron animation for header
nmerget Jul 19, 2023
1706afa
feat: add fadein for page to handle layout shifts
nmerget Jul 19, 2023
7f66b9b
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 19, 2023
cdd588a
Merge branch 'main' into refactor-header
mfranzke Jul 20, 2023
d1bd302
fix: issue with fadeIn prop
nmerget Jul 21, 2023
8e7363b
Merge remote-tracking branch 'origin/refactor-header' into refactor-h…
nmerget Jul 21, 2023
93c18e9
Update README.md
mfranzke Jul 21, 2023
85b86d6
Update packages/components/src/components/brand/brand.lite.tsx
nmerget Jul 31, 2023
da344be
Update packages/components/src/components/brand/brand.lite.tsx
nmerget Jul 31, 2023
580e7f5
Update packages/components/src/components/brand/brand.scss
nmerget Jul 31, 2023
1010a30
fix: issues from PR
nmerget Jul 31, 2023
ff748cb
fix: issues from PR
nmerget Jul 31, 2023
a367a91
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Jul 31, 2023
f6e1ec8
chore: update from main
nmerget Jul 31, 2023
f515201
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Aug 1, 2023
7babea2
chore: update from main
nmerget Aug 1, 2023
14f4af8
chore: update dos for header and simplified directives
nmerget Aug 1, 2023
00f2a2f
chore: update package-lock.json
nmerget Aug 1, 2023
134c256
chore: update snapshots
nmerget Aug 1, 2023
395560c
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Aug 2, 2023
7d72766
Merge branch 'main' into refactor-header
mfranzke Aug 10, 2023
1a7fbbc
refactor: regenerated lock file
mfranzke Aug 10, 2023
ba01645
Update packages/components/src/components/brand/brand.scss
nmerget Aug 10, 2023
1986898
fix: issue with media screen mixin
nmerget Aug 11, 2023
ba7b6e7
Update packages/components/src/components/header/header.scss
nmerget Aug 11, 2023
50c9092
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Aug 11, 2023
5316e56
Merge remote-tracking branch 'origin/refactor-header' into refactor-h…
nmerget Aug 11, 2023
e4b71cd
fix: issue with documentation for header
nmerget Aug 11, 2023
f7dade5
Merge branch 'main' into refactor-header
mfranzke Aug 11, 2023
6e1b7ca
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Aug 14, 2023
985f5c4
chore: update snapshots
nmerget Aug 14, 2023
a521631
chore: update snapshots & comments
nmerget Aug 14, 2023
d3cdb89
Merge branch 'main' into refactor-header
nmerget Aug 14, 2023
319b6e5
fix: issue with data-hide-on="desktop" for burger-menu-button
nmerget Aug 14, 2023
28e6f99
Merge branch 'main' into refactor-header
nmerget Aug 15, 2023
9862dee
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Aug 16, 2023
04f0013
chore: update from main
nmerget Aug 16, 2023
52e7961
Merge branch 'main' of github.com:db-ui/mono into refactor-header
nmerget Aug 16, 2023
366fe1b
Merge branch 'main' into refactor-header
nmerget Aug 17, 2023
c2ddfce
Update navigation-item.scss
mfranzke Aug 17, 2023
b600d17
Update packages/components/src/components/main-navigation/docs/HTML.md
nmerget Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4,443 changes: 2,872 additions & 1,571 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
inject: true
to: src/styles/db-ui-components.scss
after: angular-workaround
skip_if: db<%= name %>
---
db<%= name %>,
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
inject: true
to: src/styles/db-ui-components.scss
append: true
prepend: true
skip_if: components/<%= name %>
---
@use "../components/<%= name %>/<%= name %>" as *;
2 changes: 1 addition & 1 deletion packages/components/_templates/mitosis/new/readme.ejs.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
to: src/components/<%= name %>/README.md
---
How to use DB<%= h.changeCase.pascal(name) %>
# How to use DB<%= h.changeCase.pascal(name) %>

## Angular

Expand Down
9 changes: 7 additions & 2 deletions packages/components/mitosis.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ module.exports = {
attributeChangedCallback(test, json) {
const properties =
json?.meta?.useMetadata?.component?.properties?.map(
(prop) => prop.name
(prop) => prop.name.toLowerCase()
) || [];
return (
'this.props[name] = newValue;\n' +
'const foundProp = this.componentProps.find(prop=> prop.toLowerCase() === name);\n' +
"if (newValue === 'false') {\n" +
'\t\t\tdelete this.props[foundProp];\n' +
'\t\t} else {\n' +
'\t\t\tthis.props[foundProp] = newValue;\n' +
'\t\t}' +
' this.update();' +
'}' +
'static get observedAttributes() {\n' +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DBDrawer, DBDrawerModule } from './drawer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Directive } from '@angular/core';

@Directive({
selector: '[dbActionBar]'
})
export class ActionBarDirective {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Directive } from '@angular/core';

@Directive({
selector: '[dbMetaNavigation]'
})
export class MetaNavigationDirective {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Directive } from '@angular/core';

@Directive({
selector: '[dbNavigation]'
})
export class NavigationDirective {}
1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build:mitosis": "mitosis build",
"build:mv-styles": "cpr src build -o -f \"(.ts|.tsx|.md)$\"",
"build:sass": "sass build --no-source-map --load-path=node_modules/ --load-path=../../node_modules/",
"build:z-directives": "cpr overrides/angular ../../output/angular -o",
"build:z-post": "node scripts/post-build/index.js",
"build:z2-docs": "react-docgen ../../output/react/src/components/**/*.tsx -o ../../output/docs.json -i *.spec.tsx",
"copy-output": "npm-run-all copy:*",
Expand Down
108 changes: 105 additions & 3 deletions packages/components/scripts/post-build/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* global?:{from:string,to:string}[],
* angular?:{from:string,to:string}[],
* react?:{from:string,to:string}[],
* vue?:{from:string,to:string}[]
* vue?:{from:string,to:string}[],
* webComponents?:{from:string,to:string}[]
* },
* config?:{
* vue?:{
Expand All @@ -16,6 +17,30 @@
* }]}
*/
const getComponents = () => [
{
name: 'drawer',
defaultStylePath: 'components/drawer/drawer-web-component.css',
overwrites: {
global: [
{ from: '(event) => handleClose', to: '() => handleClose' },
{ from: 'handleClose(event)', to: 'handleClose(event: any)' }
],
angular: [
{
from: 'this.dialogRef.nativeElement',
to: 'this.dialogRef?.nativeElement'
}
],
vue: [
{
from: 'import { DBDrawerState, DBDrawerProps } from "./model";',
to: ''
}
],
webComponents: [{ from: '__prev.find', to: '!!__prev.find' }]
}
},

{
name: 'infotext',
defaultStylePath: 'components/infotext/infotext.css',
Expand Down Expand Up @@ -78,13 +103,90 @@ const getComponents = () => [
},
{
name: 'header',
defaultStylePath: 'components/header/header.css',
defaultStylePath: 'components/header/header-web-component.css',
overwrites: {
global: [
{
from: '(event) => toggle()',
to: '() => toggle()'
},
{
from: '(event) => toggle()',
to: '() => toggle()'
}
],
angular: [
{ from: '(close)', to: '(onClose)' },
{
from: '<ng-content select="[action-bar]">',
to: '<ng-content *ngTemplateOutlet="dbActionBar">'
},
{
from: '<ng-content select="[meta-navigation]">',
to: '<ng-content *ngTemplateOutlet="dbMetaNavigation">'
},
{
from: '<ng-content>',
to: '<ng-content *ngTemplateOutlet="dbNavigation">'
},
{
from: '<ng-content select="[action-bar]">',
to: '<ng-content *ngTemplateOutlet="dbActionBar">'
},
{
from: '<ng-content select="[meta-navigation]">',
to: '<ng-content *ngTemplateOutlet="dbMetaNavigation">'
},
{
from: '<ng-content>',
to: '<ng-content *ngTemplateOutlet="dbNavigation">'
},
{
from: 'export class DBHeader {\n',
to:
'export class DBHeader {\n' +
'\t@ContentChild(ActionBarDirective, { read: TemplateRef }) dbActionBar: any;\n' +
'\t@ContentChild(NavigationDirective, { read: TemplateRef }) dbNavigation: any;\n' +
'\t@ContentChild(MetaNavigationDirective, { read: TemplateRef }) dbMetaNavigation: any;\n'
},
{
from: 'import { NgModule } from "@angular/core";',
to:
"import { NgModule, ContentChild, TemplateRef } from '@angular/core';\t\n" +
"import { ActionBarDirective } from './action-bar.directive';\n" +
"import { NavigationDirective } from './navigation.directive';\n" +
"import { MetaNavigationDirective } from './meta-navigation.directive';"
}
],
vue: [
{
from: 'import { DBHeaderState, DBHeaderProps } from "./model";',
to: ''
}
],
webComponents: [
{
from: '<slot></slot>',
to: '<slot name="navigation-mobile"></slot>'
},
{
from: 'name="meta-navigation"',
to: 'name="meta-navigation-mobile"'
},
{
from: 'name="action-bar"',
to: 'name="action-bar-mobile"'
},
{
from:
' el.removeEventListener("close", this.onDbDrawerDbHeaderClose);\n' +
' el.addEventListener("close", this.onDbDrawerDbHeaderClose);',
to: 'el.props.onClose = this.onDbDrawerDbHeaderClose;'
},
{
from: 'if(this.props.drawerOpen) el.setAttribute("open", this.props.drawerOpen);',
to: ' el.setAttribute("open", Boolean(this.props.drawerOpen));'
}
]
}
},
Expand Down Expand Up @@ -138,7 +240,7 @@ const getComponents = () => [
},
{
name: 'divider',
defaultStylePath: 'components/divider/divider.css',
defaultStylePath: 'components/divider/divider-web-component.css',
overwrites: {
vue: [
{
Expand Down
22 changes: 15 additions & 7 deletions packages/components/scripts/post-build/web-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ const workaroundAttributes = (lines) => {

module.exports = () => {
for (const component of Components) {
const filePath = `../../output/webcomponent/src/components/${component.name}/${component.name}.ts`;
const fixImports = {
files: `../../output/webcomponent/src/components/${component.name}/${component.name}.ts`,
files: filePath,
processor(input) {
let lines = input
.split('\n')
Expand All @@ -88,19 +89,26 @@ module.exports = () => {
};

const defaultStyleUrl = {
files: `../../output/webcomponent/src/components/${component.name}/${component.name}.ts`,
files: filePath,
from: 'this.state = {',
to: `this.state = {stylePath: "${component.defaultStylePath}",`
};

try {
Replace.sync(fixImports);
Replace.sync(defaultStyleUrl);
if (
Fse.pathExistsSync(
`../../output/webcomponent/src/components/${component.name}/${component.name}.ts`
)
) {

if (component?.overwrites?.webComponents) {
for (const over of component.overwrites.webComponents) {
Replace.sync({
files: filePath,
from: over.from,
to: over.to
});
}
}

if (Fse.pathExistsSync(filePath)) {
Fse.moveSync(
`../../output/webcomponent/src/components/${component.name}/${component.name}.ts`,
`../../output/webcomponent/src/components/${component.name}/${component.name}.js`
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/brand/brand.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export default function DBBrand(props: DBBrandProps) {
/>
</Show>
<Show when={props.anchorChildren}>
<>{props.children}</>
<strong class="db-brand-title">{props.children}</strong>
</Show>
</a>
<Show when={!props.anchorChildren}>
<>{props.children}</>
<strong class="db-brand-title">{props.children}</strong>
</Show>
</div>
);
Expand Down
7 changes: 4 additions & 3 deletions packages/components/src/components/brand/brand.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
}
}

.db-brand-title {
display: contents;
}

.db-logo {
height: $db-sizing-sm;
@media screen and (min-width: $db-screens-m) {
height: $db-sizing-md;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "divider";
2 changes: 1 addition & 1 deletion packages/components/src/components/divider/divider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

&[data-variant="vertical"] {
height: auto;
height: 100%;
width: to-rem(1);

&:not([data-margin="none"]) {
Expand Down
13 changes: 13 additions & 0 deletions packages/components/src/components/drawer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# How to use DBDrawer

## Angular

TODO

## React

TODO

## Vue

TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use "@db-ui/foundations/build/scss/helpers/functions" as *;
@import "../../styles/dialog-init";
@import "drawer";

.db-drawer {
.db-drawer-container {
.db-drawer-header {
height: to-rem(32);
}
}
}
Loading