Skip to content

Commit

Permalink
chore(deps)
Browse files Browse the repository at this point in the history
MaximBalaganskiy committed Apr 26, 2024
1 parent 7c9f10b commit 9e5af1d
Showing 31 changed files with 818 additions and 807 deletions.
2 changes: 1 addition & 1 deletion .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"reject": ["@material/*"]
"reject": ["@material/*", "eslint"]
}
1,161 changes: 595 additions & 566 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -58,10 +58,10 @@
"update-versions": "npm run update-versions:root && lage run update-versions --scope @aurelia-mdc-web/*"
},
"devDependencies": {
"@aurelia/router": "^2.0.0-beta.14",
"@aurelia/validation": "^2.0.0-beta.14",
"@aurelia/validation-html": "^2.0.0-beta.14",
"@aurelia/webpack-loader": "^2.0.0-beta.14",
"@aurelia/router": "^2.0.0-beta.15",
"@aurelia/validation": "^2.0.0-beta.15",
"@aurelia/validation-html": "^2.0.0-beta.15",
"@aurelia/webpack-loader": "^2.0.0-beta.15",
"@material/banner": "^14.0.0",
"@material/button": "^14.0.0",
"@material/card": "^14.0.0",
@@ -101,29 +101,29 @@
"@material/tooltip": "^14.0.0",
"@material/top-app-bar": "^14.0.0",
"@material/typography": "^14.0.0",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"aurelia": "^2.0.0-beta.14",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"aurelia": "^2.0.0-beta.15",
"autoprefixer": "^10.4.19",
"concurrently": "^8.2.2",
"conventional-changelog-cli": "^4.1.0",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
"css-loader": "^7.1.1",
"cssnano": "^6.1.2",
"cssnano": "^7.0.0",
"eslint": "^8.56.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-import": "^2.29.1",
"highlight.js": "^11.9.0",
"html-loader": "^5.0.0",
"html-webpack-plugin": "^5.6.0",
"lage": "^2.7.13",
"lage": "^2.7.14",
"merge2": "^1.4.1",
"postcss-loader": "^8.1.1",
"raw-loader": "^4.0.2",
"rimraf": "^5.0.5",
"sass": "^1.75.0",
"sass-loader": "^14.2.0",
"sass-loader": "^14.2.1",
"selfsigned": "^2.4.1",
"source-map-loader": "^5.0.0",
"style-loader": "^4.0.0",
@@ -139,4 +139,4 @@
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
}
}
}
2 changes: 0 additions & 2 deletions packages/app/src/views/api-viewer/api-viewer.ts
Original file line number Diff line number Diff line change
@@ -105,8 +105,6 @@ declare module 'typedoc' {

@route({ path: 'api' })
export class ApiViewer {
constructor(@IRouter private router: IRouter) { }

classesApi?: NavigationItem[];

load(parameters: Record<string, unknown>, ri: RoutingInstruction) {
2 changes: 2 additions & 0 deletions packages/app/src/views/banner/inline/inline.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { MdcSnackbarService } from '@aurelia-mdc-web/snackbar';
import { CloseReason, MDCBannerCloseEventDetail } from '@material/banner';
import { inject } from 'aurelia';

@inject(MdcSnackbarService)
export class Inline {
constructor(private snackbarService: MdcSnackbarService) { }

2 changes: 0 additions & 2 deletions packages/app/src/views/component-viewer/component-viewer.ts
Original file line number Diff line number Diff line change
@@ -16,8 +16,6 @@ export interface IComponentTemplate {
}

export class ComponentViewer {
constructor(@IRouter public router: IRouter) { }

examples: string;
api = 'api-viewer';
template: IComponentTemplate;
2 changes: 2 additions & 0 deletions packages/app/src/views/data-table/pagination/pagination.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { MdcSnackbarService } from '@aurelia-mdc-web/snackbar';
import { inject } from 'aurelia';

@inject(MdcSnackbarService)
export class Pagination {
constructor(private snackbarService: MdcSnackbarService) { }

5 changes: 3 additions & 2 deletions packages/app/src/views/lookup/validation/validation.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { IValidationController } from '@aurelia/validation-html';
import { IValidationRules } from '@aurelia/validation';
import { newInstanceForScope } from '@aurelia/kernel';
import { newInstanceForScope, resolve } from '@aurelia/kernel';

interface IOption {
id: number;
name: string;
}

export class Validation {
constructor(@newInstanceForScope(IValidationController) private controller: IValidationController, @IValidationRules private rules: IValidationRules) {
constructor(private controller: IValidationController = resolve(newInstanceForScope(IValidationController)),
private rules: IValidationRules = resolve(IValidationRules)) {
this.rules.on(Validation).ensure(x => x.value).required();
}

3 changes: 2 additions & 1 deletion packages/app/src/views/root/root.ts
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ import { IRouter, IRouteableComponent, IRoute } from '@aurelia/router';
import { TreeView } from '../tree-view/tree-view';
import { Banner } from '../banner/banner';
import { SegmentedButton } from '../segmented-button/segmented-button';
import { resolve } from 'aurelia';

const routeDefs: IRoute[] = [
{ id: 'home', path: 'home', title: 'Home', component: Home, data: { divider: 'true' } },
@@ -79,7 +80,7 @@ const routeDefs: IRoute[] = [
];

export class Root implements IRouteableComponent {
constructor(@IRouter private router: IRouter) { }
constructor(private router: IRouter = resolve(IRouter)) { }

githubSvg = githubSvg;

6 changes: 3 additions & 3 deletions packages/app/src/views/select/validation/validation.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { IValidationController } from '@aurelia/validation-html';
import { IValidationRules } from '@aurelia/validation';
import { newInstanceForScope } from '@aurelia/kernel';
import { newInstanceForScope, resolve } from '@aurelia/kernel';
import { MdcSnackbarService } from '@aurelia-mdc-web/snackbar';

export class Validation {
constructor(@newInstanceForScope(IValidationController) private validationController: IValidationController,
@IValidationRules private rules: IValidationRules, private snackbarService: MdcSnackbarService) {
constructor(private validationController: IValidationController = resolve(newInstanceForScope(IValidationController)),
private rules: IValidationRules = resolve(IValidationRules), private snackbarService: MdcSnackbarService = resolve(MdcSnackbarService)) {
this.rules.on(Validation).ensure(x => x.validatedValue).required().then()
.satisfies(x => x.id !== 1).withMessage('No cats')
.satisfies(x => x.id !== 1).withMessage('please');
2 changes: 2 additions & 0 deletions packages/app/src/views/tabs/dynamic/dynamic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { MDCTabBarActivatedEvent } from '@material/tab-bar';
import { MdcSnackbarService } from '@aurelia-mdc-web/snackbar';
import { inject } from 'aurelia';

@inject(MdcSnackbarService)
export class Dynamic {
constructor(private snackbarService: MdcSnackbarService) { }

9 changes: 0 additions & 9 deletions packages/app/src/views/text-field/text-field-examples.ts
Original file line number Diff line number Diff line change
@@ -41,15 +41,6 @@ import { Types } from './types/types';
import { Validation } from './validation/validation';

export class TextFieldExamples {
// constructor(validationControllerFactory: ValidationControllerFactory, private snackbarService: MdcSnackbarService) {
// this.validationController = validationControllerFactory.createForCurrentScope();
// this.rules = ValidationRules
// .ensure<TextFieldExamples, string>(x => x.valueStr).required()
// .satisfies(x => !x.startsWith('erro')).withMessage('cannot start with "erro"')
// .satisfies(x => !x.startsWith('error')).withMessage('cannot start with "error"')
// .rules;
// }

counterHtml = counterHtml;
densityHtml = densityHtml;
densityScss = densityScss;
8 changes: 4 additions & 4 deletions packages/app/src/views/text-field/validation/validation.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { IValidationController } from '@aurelia/validation-html';
import { IValidationRules } from '@aurelia/validation';
import { newInstanceForScope } from '@aurelia/kernel';
import { newInstanceForScope, resolve } from '@aurelia/kernel';
import { MdcSnackbarService } from '@aurelia-mdc-web/snackbar';

export class Validation {
constructor(
@newInstanceForScope(IValidationController) private validationController: IValidationController,
@IValidationRules private rules: IValidationRules,
private snackbarService: MdcSnackbarService
private validationController: IValidationController = resolve(newInstanceForScope(IValidationController)),
private rules: IValidationRules = resolve(IValidationRules),
private snackbarService: MdcSnackbarService = resolve(MdcSnackbarService)
) {
this.rules.on(Validation).ensure(x => x.valueStr).required()
.satisfies(x => !x.startsWith('erro')).withMessage('cannot start with "erro"')
59 changes: 29 additions & 30 deletions packages/chips/src/mdc-chip/mdc-chip.ts
Original file line number Diff line number Diff line change
@@ -21,43 +21,42 @@ let chipId = 0;
*/
@inject(Element)
@customElement({ name: 'mdc-chip', template })
@processContent(MdcChip.processContent)
@processContent(function processContent(node: INode, platform: IPlatform) {
const element = node as HTMLElement;

const primaryAction = element.querySelector('[as-element="mdc-chip-action"]:not([trailing])');
if (primaryAction) {
primaryAction.setAttribute('au-slot', 'primary-action');
primaryAction.remove();
}

const trailingAction = element.querySelector('[as-element="mdc-chip-action"][trailing]');
if (trailingAction) {
trailingAction.setAttribute('au-slot', trailingAction.hasAttribute('non-navigable') ? 'non-navigable-trailing-action' : 'trailing-action');
trailingAction.remove();
}

const template = platform.document.createElement('template');
template.setAttribute('au-slot', '');
template.innerHTML = element.innerHTML;
element.innerHTML = '';
element.appendChild(template);

if (primaryAction) {
element.appendChild(primaryAction);
}
if (trailingAction) {
element.appendChild(trailingAction);
}
}
)
export class MdcChip extends MdcComponent<MDCChipFoundation> {
constructor(root: IMdcChipElement) {
super(root);
defineMdcChipElementApis(this.root);
this.root.id = `mdc-chip-${++chipId}`;
}

static processContent(node: INode, platform: IPlatform) {
const element = node as HTMLElement;

const primaryAction = element.querySelector('[as-element="mdc-chip-action"]:not([trailing])');
if (primaryAction) {
primaryAction.setAttribute('au-slot', 'primary-action');
primaryAction.remove();
}

const trailingAction = element.querySelector('[as-element="mdc-chip-action"][trailing]');
if (trailingAction) {
trailingAction.setAttribute('au-slot', trailingAction.hasAttribute('non-navigable') ? 'non-navigable-trailing-action' : 'trailing-action');
trailingAction.remove();
}

const template = platform.document.createElement('template');
template.setAttribute('au-slot', '');
template.innerHTML = element.innerHTML;
element.innerHTML = '';
element.appendChild(template);

if (primaryAction) {
element.appendChild(primaryAction);
}
if (trailingAction) {
element.appendChild(trailingAction);
}
}

_selected: boolean;
/**
* @return Whether the chip is selected.
71 changes: 35 additions & 36 deletions packages/data-table/src/mdc-data-table.ts
Original file line number Diff line number Diff line change
@@ -28,48 +28,47 @@ const NAVIGATION_EVENT = 'mdcdatatable:navigation';
*/
@inject(Element)
@customElement({ name: 'mdc-data-table', template })
@processContent(MdcDataTable.processContent)
export class MdcDataTable extends MdcComponent<MDCDataTableFoundation> implements EventListenerObject {
static processContent(node: INode, platform: IPlatform) {
const element = node as HTMLElement;
const table = element.querySelector('table');
if (!table) {
throw new Error('Have you forgotten the <table> tag in you data table markup?');
}
table.classList.add('mdc-data-table__table');
table.setAttribute('aria-label', '${ariaLabel}');
@processContent(function processContent(node: INode, platform: IPlatform) {
const element = node as HTMLElement;
const table = element.querySelector('table');
if (!table) {
throw new Error('Have you forgotten the <table> tag in you data table markup?');
}
table.classList.add('mdc-data-table__table');
table.setAttribute('aria-label', '${ariaLabel}');

const headerRow = element.querySelector('thead>tr');
if (!headerRow) {
throw new Error('Have you forgotten the <thead><tr> tags in you data table markup?');
}
headerRow.classList.add(cssClasses.HEADER_ROW);
headerRow.setAttribute('ref', 'headerRow');
const headerCells = headerRow.querySelectorAll<HTMLElement>('th');
for (const th of Array.from(headerCells)) {
th.classList.add(cssClasses.HEADER_CELL);
th.classList.toggle('mdc-data-table__header-cell--numeric', th.hasAttribute('numeric'));
th.setAttribute('role', 'columnheader');
th.setAttribute('scope', 'col');
}
const headerRow = element.querySelector('thead>tr');
if (!headerRow) {
throw new Error('Have you forgotten the <thead><tr> tags in you data table markup?');
}
headerRow.classList.add(cssClasses.HEADER_ROW);
headerRow.setAttribute('ref', 'headerRow');
const headerCells = headerRow.querySelectorAll<HTMLElement>('th');
for (const th of Array.from(headerCells)) {
th.classList.add(cssClasses.HEADER_CELL);
th.classList.toggle('mdc-data-table__header-cell--numeric', th.hasAttribute('numeric'));
th.setAttribute('role', 'columnheader');
th.setAttribute('scope', 'col');
}

const tbody = element.querySelector('tbody');
if (!tbody) {
throw new Error('Have you forgotten the <tbody> tag in you data table markup?');
}
tbody.classList.add(cssClasses.CONTENT);
tbody.setAttribute('ref', 'content');
const tbody = element.querySelector('tbody');
if (!tbody) {
throw new Error('Have you forgotten the <tbody> tag in you data table markup?');
}
tbody.classList.add(cssClasses.CONTENT);
tbody.setAttribute('ref', 'content');

const paginationTotalSlot = element.querySelector('[au-slot="pagination-total"]');
paginationTotalSlot?.remove();
const paginationTotalSlot = element.querySelector('[au-slot="pagination-total"]');
paginationTotalSlot?.remove();

defaultSlotProcessContent(node, platform);
defaultSlotProcessContent(node, platform);

if (paginationTotalSlot) {
element.appendChild(paginationTotalSlot);
}
if (paginationTotalSlot) {
element.appendChild(paginationTotalSlot);
}

}
)
export class MdcDataTable extends MdcComponent<MDCDataTableFoundation> implements EventListenerObject {
header: HTMLElement;
content: HTMLElement;

4 changes: 2 additions & 2 deletions packages/dialog/src/mdc-dialog-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MdcDialog } from './mdc-dialog';
import Aurelia, { CustomAttribute, IAurelia } from 'aurelia';
import Aurelia, { CustomAttribute, IAurelia, resolve } from 'aurelia';
import { MDCDialogCloseEvent, strings } from '@material/dialog';
import { CustomElement } from '@aurelia/runtime-html';
import { Constructable } from '@aurelia/kernel';
@@ -21,7 +21,7 @@ interface IMdcDialogBindingContext {

/** Service to open MDC dialogs */
export class MdcDialogService {
constructor(@IAurelia private readonly au: Aurelia) { }
constructor(private readonly au: Aurelia = resolve(IAurelia)) { }

/** Opens the dialog specified in the options */
async open<T extends { loading: (params: any) => any }>(options: IMdcDialogOptions<T>) {
3 changes: 2 additions & 1 deletion packages/list/src/index.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import { MdcListItemLeading } from './mdc-list-item/mdc-list-item-leading';
import { MdcListItemTrailing } from './mdc-list-item/mdc-list-item-trailing';
import { MdcListItemPrimaryText } from './mdc-list-item-primary-text';
import { MdcListItemSecondaryText } from './mdc-list-item-secondary-text';
import { MdcListItemOverlineText } from './mdc-list-item-overline-text';
import { EnhanceMdcListItem } from './mdc-list-item/enhance-mdc-list-item';
import { MdcDeprecatedList } from './mdc-deprecated-list/mdc-deprecated-list';
import { MdcDeprecatedListItem } from './mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item';
@@ -20,7 +21,7 @@ import { MdcDeprecatedListDivider } from './mdc-deprecated-list/mdc-deprecated-l

export {
MdcList, MdcListDivider, MdcListGroup, MdcListGroupSubheader, MdcListItem, MdcListItemLeading, MdcListItemTrailing, IMdcListItemElement,
MdcListItemPrimaryText, MdcListItemSecondaryText, IMdcListActionEventDetail, IMdcListActionEvent, IMdcListElement,
MdcListItemPrimaryText, MdcListItemSecondaryText, MdcListItemOverlineText, IMdcListActionEventDetail, IMdcListActionEvent, IMdcListElement,
MdcDeprecatedList,
MdcDeprecatedListItem,
MdcDeprecatedListItemPrimaryText,
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { customAttribute } from 'aurelia';
import { customAttribute, inject } from 'aurelia';

/**
* Optional. The first tile in the row (in LTR languages, the first column of the list item). Typically an icon or image.
* @selector [mdc-deprecated-list-item-graphic]
*/
@inject(Element)
@customAttribute('mdc-deprecated-list-item-graphic')
export class MdcDeprecatedListItemGraphic {
constructor(private root: Element) { }
Loading

0 comments on commit 9e5af1d

Please sign in to comment.