@scania/tegel-angular-17 1.28.1 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components.module.mjs +58 -0
- package/esm2022/lib/directives/tds-dropdown-value-accessor.mjs +36 -0
- package/esm2022/lib/directives/tds-radio-value-accessor.mjs +41 -0
- package/esm2022/lib/stencil-generated/angular-component-lib/utils.mjs +59 -0
- package/esm2022/lib/stencil-generated/boolean-value-accessor.mjs +39 -0
- package/esm2022/lib/stencil-generated/components.mjs +2070 -0
- package/esm2022/lib/stencil-generated/index.mjs +86 -0
- package/esm2022/lib/stencil-generated/number-value-accessor.mjs +40 -0
- package/esm2022/lib/stencil-generated/text-value-accessor.mjs +35 -0
- package/esm2022/lib/stencil-generated/value-accessor.mjs +40 -0
- package/esm2022/public-api.mjs +12 -0
- package/esm2022/scania-tegel-angular-17.mjs +5 -0
- package/fesm2022/scania-tegel-angular-17.mjs +2399 -0
- package/fesm2022/scania-tegel-angular-17.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components.module.d.ts +12 -0
- package/{src/lib/directives/tds-dropdown-value-accessor.ts → lib/directives/tds-dropdown-value-accessor.d.ts} +5 -18
- package/lib/directives/tds-radio-value-accessor.d.ts +13 -0
- package/lib/stencil-generated/angular-component-lib/utils.d.ts +9 -0
- package/lib/stencil-generated/boolean-value-accessor.d.ts +9 -0
- package/lib/stencil-generated/components.d.ts +1002 -0
- package/lib/stencil-generated/index.d.ts +2 -0
- package/lib/stencil-generated/number-value-accessor.d.ts +9 -0
- package/lib/stencil-generated/text-value-accessor.d.ts +8 -0
- package/lib/stencil-generated/value-accessor.d.ts +18 -0
- package/package.json +17 -4
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/ng-package.json +0 -7
- package/src/lib/components.module.ts +0 -35
- package/src/lib/directives/tds-radio-value-accessor.ts +0 -29
- package/src/lib/stencil-generated/angular-component-lib/utils.ts +0 -65
- package/src/lib/stencil-generated/boolean-value-accessor.ts +0 -28
- package/src/lib/stencil-generated/components.ts +0 -2063
- package/src/lib/stencil-generated/index.ts +0 -87
- package/src/lib/stencil-generated/number-value-accessor.ts +0 -29
- package/src/lib/stencil-generated/text-value-accessor.ts +0 -24
- package/src/lib/stencil-generated/value-accessor.ts +0 -39
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as d from './components';
|
|
2
|
+
export declare const DIRECTIVES: (typeof d.TdsAccordion | typeof d.TdsAccordionItem | typeof d.TdsBadge | typeof d.TdsBanner | typeof d.TdsBlock | typeof d.TdsBodyCell | typeof d.TdsBreadcrumb | typeof d.TdsBreadcrumbs | typeof d.TdsButton | typeof d.TdsCard | typeof d.TdsCheckbox | typeof d.TdsChip | typeof d.TdsCoreHeaderItem | typeof d.TdsDatetime | typeof d.TdsDivider | typeof d.TdsDropdown | typeof d.TdsDropdownOption | typeof d.TdsFolderTab | typeof d.TdsFolderTabs | typeof d.TdsFooter | typeof d.TdsFooterGroup | typeof d.TdsFooterItem | typeof d.TdsHeader | typeof d.TdsHeaderBrandSymbol | typeof d.TdsHeaderCell | typeof d.TdsHeaderDropdown | typeof d.TdsHeaderDropdownList | typeof d.TdsHeaderDropdownListItem | typeof d.TdsHeaderDropdownListUser | typeof d.TdsHeaderHamburger | typeof d.TdsHeaderItem | typeof d.TdsHeaderLauncher | typeof d.TdsHeaderLauncherButton | typeof d.TdsHeaderLauncherGrid | typeof d.TdsHeaderLauncherGridItem | typeof d.TdsHeaderLauncherGridTitle | typeof d.TdsHeaderLauncherList | typeof d.TdsHeaderLauncherListItem | typeof d.TdsHeaderLauncherListTitle | typeof d.TdsHeaderTitle | typeof d.TdsIcon | typeof d.TdsInlineTab | typeof d.TdsInlineTabs | typeof d.TdsLink | typeof d.TdsMessage | typeof d.TdsModal | typeof d.TdsNavigationTab | typeof d.TdsNavigationTabs | typeof d.TdsPopoverCanvas | typeof d.TdsPopoverCore | typeof d.TdsPopoverMenu | typeof d.TdsPopoverMenuItem | typeof d.TdsRadioButton | typeof d.TdsSideMenu | typeof d.TdsSideMenuCloseButton | typeof d.TdsSideMenuCollapseButton | typeof d.TdsSideMenuDropdown | typeof d.TdsSideMenuDropdownList | typeof d.TdsSideMenuDropdownListItem | typeof d.TdsSideMenuItem | typeof d.TdsSideMenuOverlay | typeof d.TdsSideMenuUser | typeof d.TdsSideMenuUserImage | typeof d.TdsSideMenuUserLabel | typeof d.TdsSlider | typeof d.TdsSpinner | typeof d.TdsStep | typeof d.TdsStepper | typeof d.TdsTable | typeof d.TdsTableBody | typeof d.TdsTableBodyInputWrapper | typeof d.TdsTableBodyRow | typeof d.TdsTableBodyRowExpandable | typeof d.TdsTableFooter | typeof d.TdsTableHeader | typeof d.TdsTableHeaderInputWrapper | typeof d.TdsTableToolbar | typeof d.TdsTextField | typeof d.TdsTextarea | typeof d.TdsToast | typeof d.TdsToggle | typeof d.TdsTooltip)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ValueAccessor } from './value-accessor';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class NumericValueAccessor extends ValueAccessor {
|
|
5
|
+
constructor(el: ElementRef);
|
|
6
|
+
registerOnChange(fn: (_: number | null) => void): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NumericValueAccessor, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NumericValueAccessor, "tds-slider", never, {}, {}, never, never, false, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ValueAccessor } from './value-accessor';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TextValueAccessor extends ValueAccessor {
|
|
5
|
+
constructor(el: ElementRef);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextValueAccessor, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TextValueAccessor, "tds-text-field, tds-textarea, tds-datetime", never, {}, {}, never, never, false, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ValueAccessor implements ControlValueAccessor {
|
|
5
|
+
protected el: ElementRef;
|
|
6
|
+
private onChange;
|
|
7
|
+
private onTouched;
|
|
8
|
+
protected lastValue: any;
|
|
9
|
+
constructor(el: ElementRef);
|
|
10
|
+
writeValue(value: any): void;
|
|
11
|
+
handleChangeEvent(value: any): void;
|
|
12
|
+
_handleBlurEvent(): void;
|
|
13
|
+
registerOnChange(fn: (value: any) => void): void;
|
|
14
|
+
registerOnTouched(fn: () => void): void;
|
|
15
|
+
setDisabledState(isDisabled: boolean): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessor, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueAccessor, never, never, {}, {}, never, never, false, never>;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scania/tegel-angular-17",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "Angular wrappers for Tegel package using Angular 17 and above",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": ">=17.0.0",
|
|
7
7
|
"@angular/core": ">=17.0.0",
|
|
8
|
-
"@scania/tegel": "^1.
|
|
8
|
+
"@scania/tegel": "^1.29.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"tslib": "^2.3.0"
|
|
12
12
|
},
|
|
13
|
-
"sideEffects": false
|
|
14
|
-
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"module": "fesm2022/scania-tegel-angular-17.mjs",
|
|
15
|
+
"typings": "index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./package.json": {
|
|
18
|
+
"default": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"esm2022": "./esm2022/scania-tegel-angular-17.mjs",
|
|
23
|
+
"esm": "./esm2022/scania-tegel-angular-17.mjs",
|
|
24
|
+
"default": "./fesm2022/scania-tegel-angular-17.mjs"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/ng-package.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
2
|
-
import { defineCustomElements } from '@scania/tegel/loader';
|
|
3
|
-
import { DIRECTIVES } from './stencil-generated';
|
|
4
|
-
import { TextValueAccessor } from './stencil-generated/text-value-accessor';
|
|
5
|
-
import { BooleanValueAccessor } from './stencil-generated/boolean-value-accessor';
|
|
6
|
-
import { NumericValueAccessor } from './stencil-generated/number-value-accessor';
|
|
7
|
-
import { TdsRadioValueAccessor } from './directives/tds-radio-value-accessor';
|
|
8
|
-
import { TdsDropdownValueAccessor } from './directives/tds-dropdown-value-accessor';
|
|
9
|
-
|
|
10
|
-
@NgModule({
|
|
11
|
-
declarations: [
|
|
12
|
-
...DIRECTIVES,
|
|
13
|
-
BooleanValueAccessor,
|
|
14
|
-
NumericValueAccessor,
|
|
15
|
-
TextValueAccessor,
|
|
16
|
-
TdsRadioValueAccessor,
|
|
17
|
-
TdsDropdownValueAccessor,
|
|
18
|
-
],
|
|
19
|
-
exports: [
|
|
20
|
-
...DIRECTIVES,
|
|
21
|
-
BooleanValueAccessor,
|
|
22
|
-
NumericValueAccessor,
|
|
23
|
-
TextValueAccessor,
|
|
24
|
-
TdsRadioValueAccessor,
|
|
25
|
-
TdsDropdownValueAccessor,
|
|
26
|
-
],
|
|
27
|
-
providers: [
|
|
28
|
-
{
|
|
29
|
-
provide: APP_INITIALIZER,
|
|
30
|
-
useFactory: () => defineCustomElements,
|
|
31
|
-
multi: true,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
})
|
|
35
|
-
export class TegelModule {}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Directive } from '@angular/core';
|
|
2
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
import { ValueAccessor } from '../stencil-generated/value-accessor';
|
|
5
|
-
/**
|
|
6
|
-
* A custom value accessor for the tds-radio-button and tds-chip of type radio. It extends the default ValueAccessor that is auto-generated by Stencil
|
|
7
|
-
* Stencil offers an autogenerated radio value accessor but does not currently work as expected.
|
|
8
|
-
* An issue was submitted to their repository: https://github.com/ionic-team/stencil-ds-output-targets/issues/434
|
|
9
|
-
* If the issue is ever fixed this value accessor can be replaced with the one auto-generated by Stencil.
|
|
10
|
-
*/
|
|
11
|
-
@Directive({
|
|
12
|
-
/* tslint:disable-next-line:directive-selector */
|
|
13
|
-
selector: 'tds-radio-button, tds-chip[type="radio"]',
|
|
14
|
-
host: {
|
|
15
|
-
'(tdsChange)': 'handleChangeEvent($event.target.value)',
|
|
16
|
-
},
|
|
17
|
-
providers: [
|
|
18
|
-
{
|
|
19
|
-
provide: NG_VALUE_ACCESSOR,
|
|
20
|
-
useExisting: TdsRadioValueAccessor,
|
|
21
|
-
multi: true,
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
})
|
|
25
|
-
export class TdsRadioValueAccessor extends ValueAccessor {
|
|
26
|
-
writeValue(value: any) {
|
|
27
|
-
this.el.nativeElement.checked = value === this.el.nativeElement.value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
import { fromEvent } from 'rxjs';
|
|
4
|
-
|
|
5
|
-
export const proxyInputs = (Cmp: any, inputs: string[]) => {
|
|
6
|
-
const Prototype = Cmp.prototype;
|
|
7
|
-
inputs.forEach((item) => {
|
|
8
|
-
Object.defineProperty(Prototype, item, {
|
|
9
|
-
get() {
|
|
10
|
-
return this.el[item];
|
|
11
|
-
},
|
|
12
|
-
set(val: any) {
|
|
13
|
-
this.z.runOutsideAngular(() => (this.el[item] = val));
|
|
14
|
-
},
|
|
15
|
-
/**
|
|
16
|
-
* In the event that proxyInputs is called
|
|
17
|
-
* multiple times re-defining these inputs
|
|
18
|
-
* will cause an error to be thrown. As a result
|
|
19
|
-
* we set configurable: true to indicate these
|
|
20
|
-
* properties can be changed.
|
|
21
|
-
*/
|
|
22
|
-
configurable: true,
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const proxyMethods = (Cmp: any, methods: string[]) => {
|
|
28
|
-
const Prototype = Cmp.prototype;
|
|
29
|
-
methods.forEach((methodName) => {
|
|
30
|
-
Prototype[methodName] = function () {
|
|
31
|
-
const args = arguments;
|
|
32
|
-
return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const proxyOutputs = (instance: any, el: any, events: string[]) => {
|
|
38
|
-
events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const defineCustomElement = (tagName: string, customElement: any) => {
|
|
42
|
-
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
43
|
-
customElements.define(tagName, customElement);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// tslint:disable-next-line: only-arrow-functions
|
|
48
|
-
export function ProxyCmp(opts: { defineCustomElementFn?: () => void; inputs?: any; methods?: any }) {
|
|
49
|
-
const decorator = function (cls: any) {
|
|
50
|
-
const { defineCustomElementFn, inputs, methods } = opts;
|
|
51
|
-
|
|
52
|
-
if (defineCustomElementFn !== undefined) {
|
|
53
|
-
defineCustomElementFn();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (inputs) {
|
|
57
|
-
proxyInputs(cls, inputs);
|
|
58
|
-
}
|
|
59
|
-
if (methods) {
|
|
60
|
-
proxyMethods(cls, methods);
|
|
61
|
-
}
|
|
62
|
-
return cls;
|
|
63
|
-
};
|
|
64
|
-
return decorator;
|
|
65
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Directive, ElementRef } from '@angular/core';
|
|
2
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
import { ValueAccessor } from './value-accessor';
|
|
5
|
-
|
|
6
|
-
@Directive({
|
|
7
|
-
/* tslint:disable-next-line:directive-selector */
|
|
8
|
-
selector: 'tds-checkbox, tds-chip[type="checkbox"], tds-toggle',
|
|
9
|
-
host: {
|
|
10
|
-
'(tdsChange)': 'handleChangeEvent($event.target.checked)',
|
|
11
|
-
'(tdsToggle)': 'handleChangeEvent($event.target.checked)'
|
|
12
|
-
},
|
|
13
|
-
providers: [
|
|
14
|
-
{
|
|
15
|
-
provide: NG_VALUE_ACCESSOR,
|
|
16
|
-
useExisting: BooleanValueAccessor,
|
|
17
|
-
multi: true
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
})
|
|
21
|
-
export class BooleanValueAccessor extends ValueAccessor {
|
|
22
|
-
constructor(el: ElementRef) {
|
|
23
|
-
super(el);
|
|
24
|
-
}
|
|
25
|
-
writeValue(value: any) {
|
|
26
|
-
this.el.nativeElement.checked = this.lastValue = value == null ? false : value;
|
|
27
|
-
}
|
|
28
|
-
}
|