@beeq/angular 1.8.0-beta.8 → 1.8.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.
Files changed (79) hide show
  1. package/README.md +32 -15
  2. package/eslint.config.js +45 -0
  3. package/jest.config.ts +21 -0
  4. package/ng-package.json +8 -0
  5. package/package.json +20 -39
  6. package/project.json +41 -0
  7. package/scripts/fix-value-accessor-path.ts +94 -0
  8. package/src/beeq.module.ts +41 -0
  9. package/src/directives/angular-component-lib/utils.ts +65 -0
  10. package/src/directives/boolean-value-accessor.ts +27 -0
  11. package/src/directives/components.ts +2621 -0
  12. package/src/directives/index.ts +47 -0
  13. package/src/directives/number-value-accessor.ts +29 -0
  14. package/src/directives/radio-value-accessor.ts +24 -0
  15. package/src/directives/select-value-accessor.ts +24 -0
  16. package/src/directives/text-value-accessor.ts +24 -0
  17. package/src/directives/value-accessor.ts +39 -0
  18. package/src/index.ts +15 -0
  19. package/src/test-setup.ts +1 -0
  20. package/standalone/ng-package.json +5 -0
  21. package/standalone/src/directives/angular-component-lib/utils.ts +65 -0
  22. package/standalone/src/directives/boolean-value-accessor.ts +27 -0
  23. package/standalone/src/directives/components.ts +1479 -0
  24. package/standalone/src/directives/index.ts +47 -0
  25. package/standalone/src/directives/number-value-accessor.ts +29 -0
  26. package/standalone/src/directives/radio-value-accessor.ts +24 -0
  27. package/standalone/src/directives/select-value-accessor.ts +24 -0
  28. package/standalone/src/directives/text-value-accessor.ts +24 -0
  29. package/standalone/src/directives/value-accessor.ts +39 -0
  30. package/{index.d.ts → standalone/src/index.ts} +4 -1
  31. package/tsconfig.json +19 -0
  32. package/tsconfig.lib.json +12 -0
  33. package/tsconfig.lib.prod.json +18 -0
  34. package/tsconfig.spec.json +10 -0
  35. package/beeq.module.d.ts +0 -15
  36. package/directives/angular-component-lib/utils.d.ts +0 -9
  37. package/directives/boolean-value-accessor.d.ts +0 -9
  38. package/directives/components.d.ts +0 -784
  39. package/directives/index.d.ts +0 -2
  40. package/directives/number-value-accessor.d.ts +0 -9
  41. package/directives/radio-value-accessor.d.ts +0 -8
  42. package/directives/select-value-accessor.d.ts +0 -8
  43. package/directives/text-value-accessor.d.ts +0 -8
  44. package/directives/value-accessor.d.ts +0 -18
  45. package/esm2022/beeq-angular.mjs +0 -5
  46. package/esm2022/beeq.module.mjs +0 -59
  47. package/esm2022/directives/angular-component-lib/utils.mjs +0 -59
  48. package/esm2022/directives/boolean-value-accessor.mjs +0 -38
  49. package/esm2022/directives/components.mjs +0 -1221
  50. package/esm2022/directives/index.mjs +0 -46
  51. package/esm2022/directives/number-value-accessor.mjs +0 -40
  52. package/esm2022/directives/radio-value-accessor.mjs +0 -35
  53. package/esm2022/directives/select-value-accessor.mjs +0 -35
  54. package/esm2022/directives/text-value-accessor.mjs +0 -35
  55. package/esm2022/directives/value-accessor.mjs +0 -42
  56. package/esm2022/index.mjs +0 -14
  57. package/esm2022/standalone/beeq-angular-standalone.mjs +0 -5
  58. package/esm2022/standalone/directives/angular-component-lib/utils.mjs +0 -59
  59. package/esm2022/standalone/directives/boolean-value-accessor.mjs +0 -38
  60. package/esm2022/standalone/directives/components.mjs +0 -1349
  61. package/esm2022/standalone/directives/number-value-accessor.mjs +0 -40
  62. package/esm2022/standalone/directives/radio-value-accessor.mjs +0 -35
  63. package/esm2022/standalone/directives/select-value-accessor.mjs +0 -35
  64. package/esm2022/standalone/directives/text-value-accessor.mjs +0 -35
  65. package/esm2022/standalone/directives/value-accessor.mjs +0 -42
  66. package/esm2022/standalone/index.mjs +0 -10
  67. package/fesm2022/beeq-angular-standalone.mjs +0 -1578
  68. package/fesm2022/beeq-angular-standalone.mjs.map +0 -1
  69. package/fesm2022/beeq-angular.mjs +0 -1545
  70. package/fesm2022/beeq-angular.mjs.map +0 -1
  71. package/standalone/directives/angular-component-lib/utils.d.ts +0 -9
  72. package/standalone/directives/boolean-value-accessor.d.ts +0 -9
  73. package/standalone/directives/components.d.ts +0 -784
  74. package/standalone/directives/number-value-accessor.d.ts +0 -9
  75. package/standalone/directives/radio-value-accessor.d.ts +0 -8
  76. package/standalone/directives/select-value-accessor.d.ts +0 -8
  77. package/standalone/directives/text-value-accessor.d.ts +0 -8
  78. package/standalone/directives/value-accessor.d.ts +0 -18
  79. package/standalone/index.d.ts +0 -6
@@ -0,0 +1,47 @@
1
+
2
+ import * as d from './components';
3
+
4
+ export const DIRECTIVES = [
5
+ d.BqAccordion,
6
+ d.BqAccordionGroup,
7
+ d.BqAlert,
8
+ d.BqAvatar,
9
+ d.BqBadge,
10
+ d.BqBreadcrumb,
11
+ d.BqBreadcrumbItem,
12
+ d.BqButton,
13
+ d.BqCard,
14
+ d.BqCheckbox,
15
+ d.BqDatePicker,
16
+ d.BqDialog,
17
+ d.BqDivider,
18
+ d.BqDrawer,
19
+ d.BqDropdown,
20
+ d.BqEmptyState,
21
+ d.BqIcon,
22
+ d.BqInput,
23
+ d.BqNotification,
24
+ d.BqOption,
25
+ d.BqOptionGroup,
26
+ d.BqOptionList,
27
+ d.BqPageTitle,
28
+ d.BqPanel,
29
+ d.BqProgress,
30
+ d.BqRadio,
31
+ d.BqRadioGroup,
32
+ d.BqSelect,
33
+ d.BqSideMenu,
34
+ d.BqSideMenuItem,
35
+ d.BqSlider,
36
+ d.BqSpinner,
37
+ d.BqStatus,
38
+ d.BqStepItem,
39
+ d.BqSteps,
40
+ d.BqSwitch,
41
+ d.BqTab,
42
+ d.BqTabGroup,
43
+ d.BqTag,
44
+ d.BqTextarea,
45
+ d.BqToast,
46
+ d.BqTooltip
47
+ ];
@@ -0,0 +1,29 @@
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: 'bq-input[type="number"], bq-slider:not[type="range"]',
9
+ host: {
10
+ '(bqChange)': 'handleChangeEvent($event.target.value)'
11
+ },
12
+ providers: [
13
+ {
14
+ provide: NG_VALUE_ACCESSOR,
15
+ useExisting: NumericValueAccessor,
16
+ multi: true
17
+ }
18
+ ],standalone: true
19
+ })
20
+ export class NumericValueAccessor extends ValueAccessor {
21
+ constructor(el: ElementRef) {
22
+ super(el);
23
+ }
24
+ override registerOnChange(fn: (_: number | null) => void) {
25
+ super.registerOnChange(value => {
26
+ fn(value === '' ? null : parseFloat(value));
27
+ });
28
+ }
29
+ }
@@ -0,0 +1,24 @@
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: 'bq-radio-group',
9
+ host: {
10
+ '(bqChange)': 'handleChangeEvent($event.target.value)'
11
+ },
12
+ providers: [
13
+ {
14
+ provide: NG_VALUE_ACCESSOR,
15
+ useExisting: RadioValueAccessor,
16
+ multi: true
17
+ }
18
+ ],standalone: true
19
+ })
20
+ export class RadioValueAccessor extends ValueAccessor {
21
+ constructor(el: ElementRef) {
22
+ super(el);
23
+ }
24
+ }
@@ -0,0 +1,24 @@
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: 'bq-select',
9
+ host: {
10
+ '(bqChange)': 'handleChangeEvent($event.target.value)'
11
+ },
12
+ providers: [
13
+ {
14
+ provide: NG_VALUE_ACCESSOR,
15
+ useExisting: SelectValueAccessor,
16
+ multi: true
17
+ }
18
+ ],standalone: true
19
+ })
20
+ export class SelectValueAccessor extends ValueAccessor {
21
+ constructor(el: ElementRef) {
22
+ super(el);
23
+ }
24
+ }
@@ -0,0 +1,24 @@
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: 'bq-date-picker, bq-input:not[type="number"], bq-slider[type="range", bq-textarea',
9
+ host: {
10
+ '(bqChange)': 'handleChangeEvent($event.target.value)'
11
+ },
12
+ providers: [
13
+ {
14
+ provide: NG_VALUE_ACCESSOR,
15
+ useExisting: TextValueAccessor,
16
+ multi: true
17
+ }
18
+ ],standalone: true
19
+ })
20
+ export class TextValueAccessor extends ValueAccessor {
21
+ constructor(el: ElementRef) {
22
+ super(el);
23
+ }
24
+ }
@@ -0,0 +1,39 @@
1
+ import { Directive, ElementRef, HostListener } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+
4
+ @Directive({})
5
+ export class ValueAccessor implements ControlValueAccessor {
6
+
7
+ private onChange: (value: any) => void = () => {/**/};
8
+ private onTouched: () => void = () => {/**/};
9
+ protected lastValue: any;
10
+
11
+ constructor(protected el: ElementRef) {}
12
+
13
+ writeValue(value: any) {
14
+ this.el.nativeElement.value = this.lastValue = value == null ? '' : value;
15
+ }
16
+
17
+ handleChangeEvent(value: any) {
18
+ if (value !== this.lastValue) {
19
+ this.lastValue = value;
20
+ this.onChange(value);
21
+ }
22
+ }
23
+
24
+ @HostListener('focusout')
25
+ _handleBlurEvent() {
26
+ this.onTouched();
27
+ }
28
+
29
+ registerOnChange(fn: (value: any) => void) {
30
+ this.onChange = fn;
31
+ }
32
+ registerOnTouched(fn: () => void) {
33
+ this.onTouched = fn;
34
+ }
35
+
36
+ setDisabledState(isDisabled: boolean) {
37
+ this.el.nativeElement.disabled = isDisabled;
38
+ }
39
+ }
@@ -1,7 +1,10 @@
1
+ /* -------------------------------------------------------------------------- */
2
+ /* DIRECTIVES */
3
+ /* -------------------------------------------------------------------------- */
1
4
  export { BooleanValueAccessor } from './directives/boolean-value-accessor';
2
5
  export { NumericValueAccessor } from './directives/number-value-accessor';
3
6
  export { RadioValueAccessor } from './directives/radio-value-accessor';
4
7
  export { SelectValueAccessor } from './directives/select-value-accessor';
5
8
  export { TextValueAccessor } from './directives/text-value-accessor';
9
+
6
10
  export * from './directives/components';
7
- export { BeeQModule } from './beeq.module';
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "files": [],
4
+ "include": [],
5
+ "references": [
6
+ {
7
+ "path": "./tsconfig.lib.json"
8
+ },
9
+ {
10
+ "path": "./tsconfig.lib.prod.json"
11
+ },
12
+ {
13
+ "path": "./tsconfig.spec.json"
14
+ }
15
+ ],
16
+ "compilerOptions": {
17
+ "target": "es2020"
18
+ }
19
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "inlineSources": true,
8
+ "types": []
9
+ },
10
+ "exclude": ["src/test-setup.ts", "**/*.spec.ts", "jest.config.ts", "**/*.test.ts"],
11
+ "include": ["src/index.ts", "standalone/src/index.ts"]
12
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "./tsconfig.lib.json",
3
+ "angularCompilerOptions": {
4
+ "annotateForClosureCompiler": true,
5
+ "compilationMode": "partial",
6
+ "enableResourceInlining": true,
7
+ "flatModuleId": "@beeq/angular",
8
+ "flatModuleOutFile": "core.js",
9
+ "skipTemplateCodegen": true,
10
+ "strictMetadataEmit": true,
11
+ "strictTemplates": true
12
+ },
13
+ "compilerOptions": {
14
+ "declarationMap": false,
15
+ "removeComments": false,
16
+ "useDefineForClassFields": false
17
+ }
18
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "module": "commonjs",
6
+ "types": ["jest", "node"]
7
+ },
8
+ "files": ["src/test-setup.ts"],
9
+ "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
10
+ }
package/beeq.module.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "./directives/components";
4
- import * as i2 from "./directives/boolean-value-accessor";
5
- import * as i3 from "./directives/number-value-accessor";
6
- import * as i4 from "./directives/radio-value-accessor";
7
- import * as i5 from "./directives/select-value-accessor";
8
- import * as i6 from "./directives/text-value-accessor";
9
- import * as i7 from "@angular/common";
10
- export declare class BeeQModule {
11
- static forRoot(): ModuleWithProviders<BeeQModule>;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<BeeQModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<BeeQModule, [typeof i1.BqAccordion, typeof i1.BqAccordionGroup, typeof i1.BqAlert, typeof i1.BqAvatar, typeof i1.BqBadge, typeof i1.BqBreadcrumb, typeof i1.BqBreadcrumbItem, typeof i1.BqButton, typeof i1.BqCard, typeof i1.BqCheckbox, typeof i1.BqDatePicker, typeof i1.BqDialog, typeof i1.BqDivider, typeof i1.BqDrawer, typeof i1.BqDropdown, typeof i1.BqEmptyState, typeof i1.BqIcon, typeof i1.BqInput, typeof i1.BqNotification, typeof i1.BqOption, typeof i1.BqOptionGroup, typeof i1.BqOptionList, typeof i1.BqPageTitle, typeof i1.BqPanel, typeof i1.BqProgress, typeof i1.BqRadio, typeof i1.BqRadioGroup, typeof i1.BqSelect, typeof i1.BqSideMenu, typeof i1.BqSideMenuItem, typeof i1.BqSlider, typeof i1.BqSpinner, typeof i1.BqStatus, typeof i1.BqStepItem, typeof i1.BqSteps, typeof i1.BqSwitch, typeof i1.BqTab, typeof i1.BqTabGroup, typeof i1.BqTag, typeof i1.BqTextarea, typeof i1.BqToast, typeof i1.BqTooltip, typeof i2.BooleanValueAccessor, typeof i3.NumericValueAccessor, typeof i4.RadioValueAccessor, typeof i5.SelectValueAccessor, typeof i6.TextValueAccessor], [typeof i7.CommonModule], [typeof i1.BqAccordion, typeof i1.BqAccordionGroup, typeof i1.BqAlert, typeof i1.BqAvatar, typeof i1.BqBadge, typeof i1.BqBreadcrumb, typeof i1.BqBreadcrumbItem, typeof i1.BqButton, typeof i1.BqCard, typeof i1.BqCheckbox, typeof i1.BqDatePicker, typeof i1.BqDialog, typeof i1.BqDivider, typeof i1.BqDrawer, typeof i1.BqDropdown, typeof i1.BqEmptyState, typeof i1.BqIcon, typeof i1.BqInput, typeof i1.BqNotification, typeof i1.BqOption, typeof i1.BqOptionGroup, typeof i1.BqOptionList, typeof i1.BqPageTitle, typeof i1.BqPanel, typeof i1.BqProgress, typeof i1.BqRadio, typeof i1.BqRadioGroup, typeof i1.BqSelect, typeof i1.BqSideMenu, typeof i1.BqSideMenuItem, typeof i1.BqSlider, typeof i1.BqSpinner, typeof i1.BqStatus, typeof i1.BqStepItem, typeof i1.BqSteps, typeof i1.BqSwitch, typeof i1.BqTab, typeof i1.BqTabGroup, typeof i1.BqTag, typeof i1.BqTextarea, typeof i1.BqToast, typeof i1.BqTooltip, typeof i2.BooleanValueAccessor, typeof i3.NumericValueAccessor, typeof i4.RadioValueAccessor, typeof i5.SelectValueAccessor, typeof i6.TextValueAccessor]>;
14
- static ɵinj: i0.ɵɵInjectorDeclaration<BeeQModule>;
15
- }
@@ -1,9 +0,0 @@
1
- export declare const proxyInputs: (Cmp: any, inputs: string[]) => void;
2
- export declare const proxyMethods: (Cmp: any, methods: string[]) => void;
3
- export declare const proxyOutputs: (instance: any, el: any, events: string[]) => void;
4
- export declare const defineCustomElement: (tagName: string, customElement: any) => void;
5
- export declare function ProxyCmp(opts: {
6
- defineCustomElementFn?: () => void;
7
- inputs?: any;
8
- methods?: any;
9
- }): (cls: any) => any;
@@ -1,9 +0,0 @@
1
- import { ElementRef } from '@angular/core';
2
- import { ValueAccessor } from './value-accessor';
3
- import * as i0 from "@angular/core";
4
- export declare class BooleanValueAccessor extends ValueAccessor {
5
- constructor(el: ElementRef);
6
- writeValue(value: any): void;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<BooleanValueAccessor, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<BooleanValueAccessor, "bq-checkbox, bq-switch", never, {}, {}, never, never, false, never>;
9
- }