@beeq/angular 1.8.0 → 1.8.1
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/beeq.module.d.ts +15 -0
- package/directives/angular-component-lib/utils.d.ts +9 -0
- package/directives/boolean-value-accessor.d.ts +9 -0
- package/directives/components.d.ts +2042 -0
- package/directives/index.d.ts +2 -0
- package/directives/number-value-accessor.d.ts +9 -0
- package/directives/radio-value-accessor.d.ts +8 -0
- package/directives/select-value-accessor.d.ts +8 -0
- package/directives/text-value-accessor.d.ts +8 -0
- package/directives/value-accessor.d.ts +18 -0
- package/esm2022/beeq-angular.mjs +5 -0
- package/esm2022/beeq.module.mjs +59 -0
- package/esm2022/directives/angular-component-lib/utils.mjs +59 -0
- package/esm2022/directives/boolean-value-accessor.mjs +38 -0
- package/esm2022/directives/components.mjs +2705 -0
- package/esm2022/directives/index.mjs +46 -0
- package/esm2022/directives/number-value-accessor.mjs +40 -0
- package/esm2022/directives/radio-value-accessor.mjs +35 -0
- package/esm2022/directives/select-value-accessor.mjs +35 -0
- package/esm2022/directives/text-value-accessor.mjs +35 -0
- package/esm2022/directives/value-accessor.mjs +40 -0
- package/esm2022/index.mjs +14 -0
- package/esm2022/standalone/beeq-angular-standalone.mjs +5 -0
- package/esm2022/standalone/directives/angular-component-lib/utils.mjs +59 -0
- package/esm2022/standalone/directives/boolean-value-accessor.mjs +38 -0
- package/esm2022/standalone/directives/components.mjs +1264 -0
- package/esm2022/standalone/directives/number-value-accessor.mjs +40 -0
- package/esm2022/standalone/directives/radio-value-accessor.mjs +35 -0
- package/esm2022/standalone/directives/select-value-accessor.mjs +35 -0
- package/esm2022/standalone/directives/text-value-accessor.mjs +35 -0
- package/esm2022/standalone/directives/value-accessor.mjs +40 -0
- package/esm2022/standalone/index.mjs +10 -0
- package/fesm2022/beeq-angular-standalone.mjs +1491 -0
- package/fesm2022/beeq-angular-standalone.mjs.map +1 -0
- package/fesm2022/beeq-angular.mjs +3027 -0
- package/fesm2022/beeq-angular.mjs.map +1 -0
- package/{standalone/src/index.ts → index.d.ts} +1 -4
- package/package.json +24 -5
- package/standalone/directives/angular-component-lib/utils.d.ts +9 -0
- package/standalone/directives/boolean-value-accessor.d.ts +9 -0
- package/standalone/directives/components.d.ts +776 -0
- package/standalone/directives/number-value-accessor.d.ts +9 -0
- package/standalone/directives/radio-value-accessor.d.ts +8 -0
- package/standalone/directives/select-value-accessor.d.ts +8 -0
- package/standalone/directives/text-value-accessor.d.ts +8 -0
- package/standalone/directives/value-accessor.d.ts +18 -0
- package/standalone/index.d.ts +6 -0
- package/eslint.config.js +0 -45
- package/jest.config.ts +0 -21
- package/ng-package.json +0 -8
- package/project.json +0 -41
- package/scripts/fix-value-accessor-path.ts +0 -94
- package/src/beeq.module.ts +0 -41
- package/src/directives/angular-component-lib/utils.ts +0 -65
- package/src/directives/boolean-value-accessor.ts +0 -27
- package/src/directives/components.ts +0 -2621
- package/src/directives/index.ts +0 -47
- package/src/directives/number-value-accessor.ts +0 -29
- package/src/directives/radio-value-accessor.ts +0 -24
- package/src/directives/select-value-accessor.ts +0 -24
- package/src/directives/text-value-accessor.ts +0 -24
- package/src/directives/value-accessor.ts +0 -39
- package/src/index.ts +0 -15
- package/src/test-setup.ts +0 -1
- package/standalone/ng-package.json +0 -5
- package/standalone/src/directives/angular-component-lib/utils.ts +0 -65
- package/standalone/src/directives/boolean-value-accessor.ts +0 -27
- package/standalone/src/directives/components.ts +0 -1479
- package/standalone/src/directives/index.ts +0 -47
- package/standalone/src/directives/number-value-accessor.ts +0 -29
- package/standalone/src/directives/radio-value-accessor.ts +0 -24
- package/standalone/src/directives/select-value-accessor.ts +0 -24
- package/standalone/src/directives/text-value-accessor.ts +0 -24
- package/standalone/src/directives/value-accessor.ts +0 -39
- package/tsconfig.json +0 -19
- package/tsconfig.lib.json +0 -12
- package/tsconfig.lib.prod.json +0 -18
- package/tsconfig.spec.json +0 -10
package/src/directives/index.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
];
|
|
@@ -1,29 +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: '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
|
-
]
|
|
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
|
-
}
|
|
@@ -1,24 +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: '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
|
-
]
|
|
19
|
-
})
|
|
20
|
-
export class RadioValueAccessor extends ValueAccessor {
|
|
21
|
-
constructor(el: ElementRef) {
|
|
22
|
-
super(el);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,24 +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: '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
|
-
]
|
|
19
|
-
})
|
|
20
|
-
export class SelectValueAccessor extends ValueAccessor {
|
|
21
|
-
constructor(el: ElementRef) {
|
|
22
|
-
super(el);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,24 +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: '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
|
-
]
|
|
19
|
-
})
|
|
20
|
-
export class TextValueAccessor extends ValueAccessor {
|
|
21
|
-
constructor(el: ElementRef) {
|
|
22
|
-
super(el);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* -------------------------------------------------------------------------- */
|
|
2
|
-
/* DIRECTIVES */
|
|
3
|
-
/* -------------------------------------------------------------------------- */
|
|
4
|
-
export { BooleanValueAccessor } from './directives/boolean-value-accessor';
|
|
5
|
-
export { NumericValueAccessor } from './directives/number-value-accessor';
|
|
6
|
-
export { RadioValueAccessor } from './directives/radio-value-accessor';
|
|
7
|
-
export { SelectValueAccessor } from './directives/select-value-accessor';
|
|
8
|
-
export { TextValueAccessor } from './directives/text-value-accessor';
|
|
9
|
-
|
|
10
|
-
export * from './directives/components';
|
|
11
|
-
|
|
12
|
-
/* -------------------------------------------------------------------------- */
|
|
13
|
-
/* PACKAGE MODULE */
|
|
14
|
-
/* -------------------------------------------------------------------------- */
|
|
15
|
-
export { BeeQModule } from './beeq.module';
|
package/src/test-setup.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'jest-preset-angular/setup-jest';
|
|
@@ -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,27 +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: 'bq-checkbox, bq-switch',
|
|
9
|
-
host: {
|
|
10
|
-
'(bqChange)': 'handleChangeEvent($event.target.checked)'
|
|
11
|
-
},
|
|
12
|
-
providers: [
|
|
13
|
-
{
|
|
14
|
-
provide: NG_VALUE_ACCESSOR,
|
|
15
|
-
useExisting: BooleanValueAccessor,
|
|
16
|
-
multi: true
|
|
17
|
-
}
|
|
18
|
-
],standalone: true
|
|
19
|
-
})
|
|
20
|
-
export class BooleanValueAccessor extends ValueAccessor {
|
|
21
|
-
constructor(el: ElementRef) {
|
|
22
|
-
super(el);
|
|
23
|
-
}
|
|
24
|
-
override writeValue(value: any) {
|
|
25
|
-
this.el.nativeElement.checked = this.lastValue = value == null ? false : value;
|
|
26
|
-
}
|
|
27
|
-
}
|