Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"packages/components/src/components/**/*.spec.tsx",
"packages/components/src/components/tag/tag.spec.tsx",
"**/**config.ts",
"**/navigation-items.ts",
"packages/foundations/assets/icons/functional/fonts/sources/*.json"
],
"absolute": true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Here is an overview of all components you can use:
| Floating-Button | 02 - Action | ❌ | ❌ |
| Footer | 01 - Layout | ❌ | ✅ |
| Grid | 01 - Layout | ❌ | ✅ |
| Header | 01 - Layout | | ✅ |
| Header | 01 - Layout | Beta | ✅ |
| [Icons](packages/components/src/components/icon) | 04 - Data-Display | Beta | ✅ |
| Image | 04 - Data-Display | ❌ | ✅ |
| Indicator | 04 - Data-Display | ❌ | ❌ |
Expand Down
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 0 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 { DBMainNavigation, DBMainNavigationModule } from './main-navigation';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DBSubNavigation, DBSubNavigationModule } from './sub-navigation';
3 changes: 2 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
"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/ --future-deprecation=import",
"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",
"compile:angular": "mitosis build -c mitosis-angular.config.js && node -e \"require('./scripts/post-build/angular.js')(true)\" && cpr ../../output/tmp/angular/src ../../output/angular/src -o",
"compile:angular": "mitosis build -c mitosis-angular.config.js && node -e \"require('./scripts/post-build/angular.js')(true)\" && npm run build:z-directives && cpr ../../output/tmp/angular/src ../../output/angular/src -o",
"compile:react": "mitosis build -c mitosis-react.config.js && node -e \"require('./scripts/post-build/react.js')(true)\" && cpr ../../output/tmp/react/src ../../output/react/src -o",
"compile:vue": "mitosis build -c mitosis-vue.config.js && node -e \"require('./scripts/post-build/vue.js')(true)\" && cpr ../../output/tmp/vue/vue3/src ../../output/vue/vue3/src -o",
"copy-output": "npm-run-all copy:*",
Expand Down
86 changes: 77 additions & 9 deletions packages/components/scripts/post-build/angular.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Replace = require('replace-in-file');
const FS = require('node:fs');
const { components } = require('./components');
const { runReplacements } = require('../utils');
const { runReplacements, getComponentName } = require('../utils');

const changeFile = (component, input) => {
return input
Expand Down Expand Up @@ -38,18 +39,17 @@ const changeFile = (component, input) => {
*
* @param {*} replacements
* @param {*} componentName
* @param {*} upperComponentName
* @param {*} valueAccessor 'checked' | 'value' [adopt if needed]
*/
const setControlValueAccessorReplacements = (
replacements,
componentName,
upperComponentName,
valueAccessor
) => {
// for native angular support (e.g. reactive forms) we have to implement
// the ControlValueAccessor interface with all impacts :/
const upperComponentName = `DB${
componentName.charAt(0).toUpperCase() + componentName.slice(1)
}`;

replacements.push({
from: '} from "@angular/core";',
Expand Down Expand Up @@ -105,9 +105,71 @@ const setControlValueAccessorReplacements = (
});
};

/**
* It's not possible to use <ng-content> multiple times in a component.
* In Angular, you have to use a directive for this...
* This is a workaround to replace it in the file.
* @param replacements
* @param componentName {string}
* @param upperComponentName {string}
* @param directives {{name:string, ngContentName?:string}[]}
*/
const setDirectiveReplacements = (
replacements,
componentName,
upperComponentName,
directives
) => {
for (const directive of directives) {
// Add ng-content multiple times to overwrite all
for (let i = 0; i < 4; i++) {
replacements.push({
from: `<ng-content${
directive.ngContentName
? ` select="[${directive.ngContentName}]"`
: ''
}>`,
to: `<ng-content *ngTemplateOutlet="db${directive.name}">`
});
}

replacements.push({
from: `export class ${upperComponentName} {\n`,
to:
`export class ${upperComponentName} {\n` +
`\t@ContentChild(${directive.name}Directive, { read: TemplateRef }) db${directive.name}: any;\n`
});

replacements.push({
from: 'import { NgModule } from "@angular/core";',
to:
'import { NgModule } from "@angular/core";\n' +
`import { ${directive.name}Directive } from './${directive.name}.directive';\n`
});

FS.writeFileSync(
`../../output/angular/src/components/${componentName}/${directive.name}.directive.ts`,
'/* Angular cannot handle multiple slots with the same name, we need to use Directives for this. */\n' +
"import { Directive } from '@angular/core';" +
`
@Directive({
\tselector: '[db${directive.name}]'
})
export class ${directive.name}Directive {}
`
);
}

replacements.push({
from: 'import { NgModule } from "@angular/core";',
to: "import { NgModule, ContentChild, TemplateRef } from '@angular/core';"
});
};

module.exports = (tmp) => {
for (const component of components) {
const componentName = component.name;
const upperComponentName = `DB${getComponentName(component.name)}`;
const file = `../../${
tmp ? 'output/tmp' : 'output'
}/angular/src/components/${componentName}/${componentName}.ts`;
Expand All @@ -118,18 +180,24 @@ module.exports = (tmp) => {

const replacements = [];

if (
component.config &&
component.config.angular &&
component.config.angular.controlValueAccessor
) {
if (component.config?.angular?.controlValueAccessor) {
setControlValueAccessorReplacements(
replacements,
componentName,
upperComponentName,
component.config.angular.controlValueAccessor // value / checked / ...
);
}

if (component.config?.angular?.directives?.length > 0) {
setDirectiveReplacements(
replacements,
componentName,
upperComponentName,
component.config.angular.directives
);
}

try {
Replace.sync(options);
runReplacements(replacements, component, 'angular', file);
Expand Down
Loading