quang 20.2.3 → 20.3.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/components/autocomplete/README.md +27 -2
- package/components/autocomplete/index.d.ts +1 -1
- package/components/checkbox/README.md +27 -2
- package/components/checkbox/index.d.ts +1 -1
- package/components/date/README.md +40 -350
- package/components/date/index.d.ts +1 -1
- package/components/input/README.md +33 -2
- package/components/input/index.d.ts +1 -1
- package/components/select/README.md +48 -6
- package/components/select/index.d.ts +1 -1
- package/components/shared/index.d.ts +2 -1
- package/components/wysiwyg/README.md +46 -8
- package/components/wysiwyg/index.d.ts +1 -1
- package/fesm2022/quang-components-autocomplete.mjs +2 -2
- package/fesm2022/quang-components-autocomplete.mjs.map +1 -1
- package/fesm2022/quang-components-checkbox.mjs +3 -2
- package/fesm2022/quang-components-checkbox.mjs.map +1 -1
- package/fesm2022/quang-components-date.mjs +3 -2
- package/fesm2022/quang-components-date.mjs.map +1 -1
- package/fesm2022/quang-components-input.mjs +4 -3
- package/fesm2022/quang-components-input.mjs.map +1 -1
- package/fesm2022/quang-components-select.mjs +3 -2
- package/fesm2022/quang-components-select.mjs.map +1 -1
- package/fesm2022/quang-components-shared.mjs +3 -1
- package/fesm2022/quang-components-shared.mjs.map +1 -1
- package/fesm2022/quang-components-wysiwyg.mjs +3 -2
- package/fesm2022/quang-components-wysiwyg.mjs.map +1 -1
- package/package.json +31 -31
|
@@ -82,6 +82,7 @@ The component supports the following input types, each with specific behaviors a
|
|
|
82
82
|
- `showHidePasswordButton`: `boolean` — Shows/hides the password toggle button. Default: `true`. **Only applies to**: `password`
|
|
83
83
|
- `buttonClass`: `string` — Additional CSS classes for the password toggle button. **Only applies to**: `password`
|
|
84
84
|
|
|
85
|
+
|
|
85
86
|
### Universal Inputs
|
|
86
87
|
|
|
87
88
|
- `isReadonly`: `boolean` — Makes the input read-only
|
|
@@ -89,10 +90,12 @@ The component supports the following input types, each with specific behaviors a
|
|
|
89
90
|
- `componentPlaceholder`: `string` — Placeholder text (supports i18n keys)
|
|
90
91
|
- `componentTabIndex`: `number` — Tab index for accessibility
|
|
91
92
|
- `componentClass`: `string` — Additional CSS classes for the input element
|
|
92
|
-
- `errorMap`: `
|
|
93
|
+
- `errorMap`: `ErrorData[]` — Validation error messages
|
|
93
94
|
- `successMessage`: `string` — Success message text
|
|
94
|
-
- `helpMessage`: `string` — Help text displayed below the input
|
|
95
|
+
- `helpMessage`: `string` — Help text displayed as a tooltip or below the input
|
|
96
|
+
- `helpMessageTooltip`: `boolean` — If true, help message is shown as a tooltip (with icon); if false, help message is shown inline below the input. Default: `false`
|
|
95
97
|
- `formControl`: `FormControl` — Angular reactive form control
|
|
98
|
+
- Tooltip icon projection: to display the tooltip icon, use `<ng-content select="[help-icon]" />` in the component template.
|
|
96
99
|
|
|
97
100
|
## Outputs
|
|
98
101
|
|
|
@@ -112,6 +115,34 @@ The component supports the following input types, each with specific behaviors a
|
|
|
112
115
|
/>
|
|
113
116
|
```
|
|
114
117
|
|
|
118
|
+
### Help Message as Tooltip
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<quang-input
|
|
122
|
+
[errorMap]="errors()"
|
|
123
|
+
componentLabel="form.label.input"
|
|
124
|
+
componentType="text"
|
|
125
|
+
[helpMessage]="'form.help.input'"
|
|
126
|
+
[helpMessageTooltip]="true"
|
|
127
|
+
formControlName="testInput"
|
|
128
|
+
>
|
|
129
|
+
<svg-icon src="assets/icons/svg/help.svg" help-icon />
|
|
130
|
+
</quang-input>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Help Message Inline
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<quang-input
|
|
137
|
+
[errorMap]="errors()"
|
|
138
|
+
componentLabel="form.label.input"
|
|
139
|
+
componentType="text"
|
|
140
|
+
[helpMessage]="'form.help.input'"
|
|
141
|
+
[helpMessageTooltip]="false"
|
|
142
|
+
formControlName="testInput"
|
|
143
|
+
/>
|
|
144
|
+
```
|
|
145
|
+
|
|
115
146
|
### Password Input with Toggle
|
|
116
147
|
|
|
117
148
|
```html
|
|
@@ -17,7 +17,7 @@ declare class QuangInputComponent extends QuangBaseComponent<string | number> {
|
|
|
17
17
|
constructor();
|
|
18
18
|
onTogglePasswordVisibility(): void;
|
|
19
19
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangInputComponent, never>;
|
|
20
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangInputComponent, "quang-input", never, { "componentType": { "alias": "componentType"; "required": true; "isSignal": true; }; "maxLengthText": { "alias": "maxLengthText"; "required": false; "isSignal": true; }; "minLengthText": { "alias": "minLengthText"; "required": false; "isSignal": true; }; "minNumber": { "alias": "minNumber"; "required": false; "isSignal": true; }; "maxNumber": { "alias": "maxNumber"; "required": false; "isSignal": true; }; "componentStep": { "alias": "componentStep"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "buttonClass": { "alias": "buttonClass"; "required": false; "isSignal": true; }; "showHidePasswordButton": { "alias": "showHidePasswordButton"; "required": false; "isSignal": true; }; }, {}, never, ["[hide-password]", "[show-password]"], true, never>;
|
|
20
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangInputComponent, "quang-input", never, { "componentType": { "alias": "componentType"; "required": true; "isSignal": true; }; "maxLengthText": { "alias": "maxLengthText"; "required": false; "isSignal": true; }; "minLengthText": { "alias": "minLengthText"; "required": false; "isSignal": true; }; "minNumber": { "alias": "minNumber"; "required": false; "isSignal": true; }; "maxNumber": { "alias": "maxNumber"; "required": false; "isSignal": true; }; "componentStep": { "alias": "componentStep"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "buttonClass": { "alias": "buttonClass"; "required": false; "isSignal": true; }; "showHidePasswordButton": { "alias": "showHidePasswordButton"; "required": false; "isSignal": true; }; }, {}, never, ["[help-icon]", "[hide-password]", "[show-password]"], true, never>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export { QuangInputComponent };
|
|
@@ -2,16 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
The `QuangSelectComponent` supports single or multiple selections from a dropdown list.
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
## Input
|
|
6
7
|
|
|
7
|
-
- `selectOptions`: `SelectOption[]`
|
|
8
|
-
- `selectionMode`: `'single' | 'multiple'`
|
|
8
|
+
- `selectOptions`: `SelectOption[]` — Array of options to display in the dropdown (required)
|
|
9
|
+
- `selectionMode`: `'single' | 'multiple'` — Selection mode (default: 'single')
|
|
9
10
|
|
|
10
|
-
All standard inputs inherited from `QuangBaseComponent`:
|
|
11
|
+
All standard inputs inherited from `QuangBaseComponent`:
|
|
12
|
+
- `isReadonly`: `boolean` — Makes the select read-only
|
|
13
|
+
- `componentLabel`: `string` — Label text (supports i18n keys)
|
|
14
|
+
- `componentPlaceholder`: `string` — Placeholder text (supports i18n keys)
|
|
15
|
+
- `componentTabIndex`: `number` — Tab index for accessibility
|
|
16
|
+
- `componentClass`: `string` — Additional CSS classes
|
|
17
|
+
- `errorMap`: `ErrorData[]` — Validation error messages
|
|
18
|
+
- `successMessage`: `string` — Success message text
|
|
19
|
+
- `helpMessage`: `string` — Help text displayed below the select
|
|
20
|
+
- `helpMessageTooltip`: `boolean` — If true, displays help message as a tooltip (with projected icon); if false, displays help message inline below the select. Default: `false`
|
|
21
|
+
- `formControl`: `FormControl` — Angular reactive form control
|
|
22
|
+
- Tooltip icon projection: to display the tooltip icon, use `<ng-content select="[help-icon]" />` in the component template.
|
|
11
23
|
|
|
12
24
|
## Output
|
|
13
25
|
|
|
14
|
-
All standard outputs inherited from `QuangBaseComponent`:
|
|
26
|
+
- All standard outputs inherited from `QuangBaseComponent`:
|
|
27
|
+
- `componentBlur`: emitted when the select loses focus
|
|
28
|
+
|
|
15
29
|
|
|
16
30
|
## Usage
|
|
17
31
|
|
|
@@ -23,7 +37,8 @@ All standard outputs inherited from `QuangBaseComponent`: `componentBlur`
|
|
|
23
37
|
componentLabel="form.label.select"
|
|
24
38
|
componentPlaceholder="Select an option"
|
|
25
39
|
formControlName="testInput"
|
|
26
|
-
selectionMode="single"
|
|
40
|
+
selectionMode="single"
|
|
41
|
+
>
|
|
27
42
|
</quang-select>
|
|
28
43
|
```
|
|
29
44
|
|
|
@@ -35,10 +50,37 @@ All standard outputs inherited from `QuangBaseComponent`: `componentBlur`
|
|
|
35
50
|
componentLabel="form.label.multipleSelect"
|
|
36
51
|
componentPlaceholder="Select multiple options"
|
|
37
52
|
formControlName="testInputMultiple"
|
|
38
|
-
selectionMode="multiple"
|
|
53
|
+
selectionMode="multiple"
|
|
54
|
+
>
|
|
55
|
+
</quang-select>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Inline Help Message
|
|
59
|
+
```html
|
|
60
|
+
<quang-select
|
|
61
|
+
[selectOptions]="stringList"
|
|
62
|
+
componentLabel="form.label.select"
|
|
63
|
+
helpMessage="form.help.select"
|
|
64
|
+
[helpMessageTooltip]="false"
|
|
65
|
+
formControlName="testInput"
|
|
66
|
+
>
|
|
39
67
|
</quang-select>
|
|
40
68
|
```
|
|
41
69
|
|
|
70
|
+
### Tooltip Help Message
|
|
71
|
+
```html
|
|
72
|
+
<quang-select
|
|
73
|
+
[selectOptions]="stringList"
|
|
74
|
+
componentLabel="form.label.select"
|
|
75
|
+
helpMessage="form.help.select"
|
|
76
|
+
[helpMessageTooltip]="true"
|
|
77
|
+
formControlName="testInput"
|
|
78
|
+
>
|
|
79
|
+
<span help-icon class="ms-1"><i class="fas fa-question-circle"></i></span>
|
|
80
|
+
</quang-select>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
42
84
|
## QuangTranslationService Integration
|
|
43
85
|
|
|
44
86
|
The component supports automatic translation of all labels, help messages, and error messages through `QuangTranslationService`.
|
|
@@ -28,7 +28,7 @@ declare class QuangSelectComponent extends QuangBaseComponent<string | number |
|
|
|
28
28
|
onChangedHandler(value: string | number | string[] | number[] | null): void;
|
|
29
29
|
onMouseLeaveCallback(): void;
|
|
30
30
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangSelectComponent, never>;
|
|
31
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangSelectComponent, "quang-select", never, { "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "optionListMaxHeight": { "alias": "optionListMaxHeight"; "required": false; "isSignal": true; }; "selectOptions": { "alias": "selectOptions"; "required": true; "isSignal": true; }; "scrollBehaviorOnOpen": { "alias": "scrollBehaviorOnOpen"; "required": false; "isSignal": true; }; "translateValue": { "alias": "translateValue"; "required": false; "isSignal": true; }; "nullOption": { "alias": "nullOption"; "required": false; "isSignal": true; }; "autoSelectSingleOption": { "alias": "autoSelectSingleOption"; "required": false; "isSignal": true; }; }, {}, never,
|
|
31
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangSelectComponent, "quang-select", never, { "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "optionListMaxHeight": { "alias": "optionListMaxHeight"; "required": false; "isSignal": true; }; "selectOptions": { "alias": "selectOptions"; "required": true; "isSignal": true; }; "scrollBehaviorOnOpen": { "alias": "scrollBehaviorOnOpen"; "required": false; "isSignal": true; }; "translateValue": { "alias": "translateValue"; "required": false; "isSignal": true; }; "nullOption": { "alias": "nullOption"; "required": false; "isSignal": true; }; "autoSelectSingleOption": { "alias": "autoSelectSingleOption"; "required": false; "isSignal": true; }; }, {}, never, ["[help-icon]"], true, never>;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export { QuangSelectComponent };
|
|
@@ -24,6 +24,7 @@ declare abstract class QuangBaseComponent<T = any> implements ControlValueAccess
|
|
|
24
24
|
successMessage: _angular_core.InputSignal<string>;
|
|
25
25
|
helpMessage: _angular_core.InputSignal<string>;
|
|
26
26
|
formControl: _angular_core.InputSignal<FormControl<any> | undefined>;
|
|
27
|
+
helpMessageTooltip: _angular_core.InputSignal<boolean>;
|
|
27
28
|
componentBlur: _angular_core.OutputEmitterRef<void>;
|
|
28
29
|
_value: _angular_core.WritableSignal<T | null>;
|
|
29
30
|
_isRequired: _angular_core.WritableSignal<boolean>;
|
|
@@ -54,7 +55,7 @@ declare abstract class QuangBaseComponent<T = any> implements ControlValueAccess
|
|
|
54
55
|
checkFormErrors(): void;
|
|
55
56
|
ngAfterViewInit(): void;
|
|
56
57
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangBaseComponent<any>, never>;
|
|
57
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<QuangBaseComponent<any>, never, never, { "componentId": { "alias": "componentId"; "required": false; "isSignal": true; }; "isReadonly": { "alias": "isReadonly"; "required": false; "isSignal": true; }; "componentTabIndex": { "alias": "componentTabIndex"; "required": false; "isSignal": true; }; "componentClass": { "alias": "componentClass"; "required": false; "isSignal": true; }; "componentLabel": { "alias": "componentLabel"; "required": false; "isSignal": true; }; "componentPlaceholder": { "alias": "componentPlaceholder"; "required": false; "isSignal": true; }; "errorMap": { "alias": "errorMap"; "required": false; "isSignal": true; }; "successMessage": { "alias": "successMessage"; "required": false; "isSignal": true; }; "helpMessage": { "alias": "helpMessage"; "required": false; "isSignal": true; }; "formControl": { "alias": "formControl"; "required": false; "isSignal": true; }; }, { "componentBlur": "componentBlur"; }, never, never, true, never>;
|
|
58
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<QuangBaseComponent<any>, never, never, { "componentId": { "alias": "componentId"; "required": false; "isSignal": true; }; "isReadonly": { "alias": "isReadonly"; "required": false; "isSignal": true; }; "componentTabIndex": { "alias": "componentTabIndex"; "required": false; "isSignal": true; }; "componentClass": { "alias": "componentClass"; "required": false; "isSignal": true; }; "componentLabel": { "alias": "componentLabel"; "required": false; "isSignal": true; }; "componentPlaceholder": { "alias": "componentPlaceholder"; "required": false; "isSignal": true; }; "errorMap": { "alias": "errorMap"; "required": false; "isSignal": true; }; "successMessage": { "alias": "successMessage"; "required": false; "isSignal": true; }; "helpMessage": { "alias": "helpMessage"; "required": false; "isSignal": true; }; "formControl": { "alias": "formControl"; "required": false; "isSignal": true; }; "helpMessageTooltip": { "alias": "helpMessageTooltip"; "required": false; "isSignal": true; }; }, { "componentBlur": "componentBlur"; }, never, never, true, never>;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
interface SelectOption {
|
|
@@ -2,24 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
The `QuangWysiwygComponent` is a rich text editor based on [SunEditor](https://github.com/JiHong88/SunEditor), offering a wide range of formatting options for creating and editing HTML content.
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
## Input
|
|
6
7
|
|
|
7
|
-
- `wysiwygOptions`: `object`
|
|
8
|
-
- `minHeight`: `string | undefined`
|
|
9
|
-
- `highlightColor`: `boolean`
|
|
10
|
-
- `isReadonly`: `boolean`
|
|
11
|
-
- `onImageUploadError`: `(errorMessage: any, result: any, core: any) => boolean`
|
|
12
|
-
- `onFileDrop`: `(e: any, cleanData: any, maxCharCount: any, core: any) => boolean`
|
|
8
|
+
- `wysiwygOptions`: `object` — Configuration options for the editor (required)
|
|
9
|
+
- `minHeight`: `string | undefined` — Minimum height for the editor area (default: '200px')
|
|
10
|
+
- `highlightColor`: `boolean` — Show/hide the highlight color button in toolbar (default: true)
|
|
11
|
+
- `isReadonly`: `boolean` — If true, the editor is readonly
|
|
12
|
+
- `onImageUploadError`: `(errorMessage: any, result: any, core: any) => boolean` — Callback for image upload errors
|
|
13
|
+
- `onFileDrop`: `(e: any, cleanData: any, maxCharCount: any, core: any) => boolean` — Callback for file drop events
|
|
13
14
|
- Toolbar button toggles (all `boolean`, default: `true`): `font`, `fontSize`, `formatBlock`, `paragraphStyle`, `blockquote`, `bold`, `underline`, `italic`, `strike`, `fontColor`, `textStyle`, `removeFormat`, `align`, `list`, `table`, `link`, `image`, `fullScreen`, `showBlocks`
|
|
14
15
|
|
|
15
|
-
All standard inputs inherited from `QuangBaseComponent`:
|
|
16
|
+
All standard inputs inherited from `QuangBaseComponent`:
|
|
17
|
+
- `componentLabel`: `string` — Label text (supports i18n keys)
|
|
18
|
+
- `componentPlaceholder`: `string` — Placeholder text (supports i18n keys)
|
|
19
|
+
- `componentTabIndex`: `number` — Tab index for accessibility
|
|
20
|
+
- `componentClass`: `string` — Additional CSS classes
|
|
21
|
+
- `errorMap`: `ErrorData[]` — Validation error messages
|
|
22
|
+
- `successMessage`: `string` — Success message text
|
|
23
|
+
- `helpMessage`: `string` — Help text displayed below the editor
|
|
24
|
+
- `helpMessageTooltip`: `boolean` — If true, displays help message as a tooltip (with projected icon); if false, displays help message inline below the editor. Default: `false`
|
|
25
|
+
- `formControl`: `FormControl` — Angular reactive form control
|
|
26
|
+
- Tooltip icon projection: to display the tooltip icon, use `<ng-content select="[help-icon]" />` in the component template.
|
|
16
27
|
|
|
17
28
|
## Output
|
|
18
29
|
|
|
19
|
-
All standard outputs inherited from `QuangBaseComponent`:
|
|
30
|
+
- All standard outputs inherited from `QuangBaseComponent`:
|
|
31
|
+
- `componentBlur`: emitted when the editor loses focus
|
|
32
|
+
|
|
20
33
|
|
|
21
34
|
## Usage
|
|
22
35
|
|
|
36
|
+
### Basic Editor
|
|
23
37
|
```html
|
|
24
38
|
<quang-wysiwyg
|
|
25
39
|
[errorMap]="errors()"
|
|
@@ -34,6 +48,30 @@ All standard outputs inherited from `QuangBaseComponent`: `componentBlur`
|
|
|
34
48
|
/>
|
|
35
49
|
```
|
|
36
50
|
|
|
51
|
+
### Inline Help Message
|
|
52
|
+
```html
|
|
53
|
+
<quang-wysiwyg
|
|
54
|
+
[wysiwygOptions]="wysiwygOptions"
|
|
55
|
+
componentLabel="form.label.wysiwyg"
|
|
56
|
+
helpMessage="form.help.wysiwyg"
|
|
57
|
+
[helpMessageTooltip]="false"
|
|
58
|
+
formControlName="testInput"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Tooltip Help Message
|
|
63
|
+
```html
|
|
64
|
+
<quang-wysiwyg
|
|
65
|
+
[wysiwygOptions]="wysiwygOptions"
|
|
66
|
+
componentLabel="form.label.wysiwyg"
|
|
67
|
+
helpMessage="form.help.wysiwyg"
|
|
68
|
+
[helpMessageTooltip]="true"
|
|
69
|
+
formControlName="testInput"
|
|
70
|
+
>
|
|
71
|
+
<span help-icon class="ms-1"><i class="fas fa-question-circle"></i></span>
|
|
72
|
+
</quang-wysiwyg>
|
|
73
|
+
```
|
|
74
|
+
|
|
37
75
|
### Note
|
|
38
76
|
|
|
39
77
|
Remember to import:
|
|
@@ -44,7 +44,7 @@ declare class QuangWysiwygComponent extends QuangBaseComponent<string> implement
|
|
|
44
44
|
onChangedHandler(value: string): void;
|
|
45
45
|
getButtonList(): string[];
|
|
46
46
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangWysiwygComponent, never>;
|
|
47
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangWysiwygComponent, "quang-wysiwyg", never, { "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "font": { "alias": "font"; "required": false; "isSignal": true; }; "fontSize": { "alias": "fontSize"; "required": false; "isSignal": true; }; "formatBlock": { "alias": "formatBlock"; "required": false; "isSignal": true; }; "paragraphStyle": { "alias": "paragraphStyle"; "required": false; "isSignal": true; }; "blockquote": { "alias": "blockquote"; "required": false; "isSignal": true; }; "bold": { "alias": "bold"; "required": false; "isSignal": true; }; "underline": { "alias": "underline"; "required": false; "isSignal": true; }; "italic": { "alias": "italic"; "required": false; "isSignal": true; }; "strike": { "alias": "strike"; "required": false; "isSignal": true; }; "fontColor": { "alias": "fontColor"; "required": false; "isSignal": true; }; "highlightColor": { "alias": "highlightColor"; "required": false; "isSignal": true; }; "textStyle": { "alias": "textStyle"; "required": false; "isSignal": true; }; "removeFormat": { "alias": "removeFormat"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "list": { "alias": "list"; "required": false; "isSignal": true; }; "table": { "alias": "table"; "required": false; "isSignal": true; }; "link": { "alias": "link"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "fullScreen": { "alias": "fullScreen"; "required": false; "isSignal": true; }; "showBlocks": { "alias": "showBlocks"; "required": false; "isSignal": true; }; "onImageUploadError": { "alias": "onImageUploadError"; "required": false; "isSignal": true; }; "onFileDrop": { "alias": "onFileDrop"; "required": false; "isSignal": true; }; "wysiwygOptions": { "alias": "wysiwygOptions"; "required": false; "isSignal": true; }; }, {}, never,
|
|
47
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangWysiwygComponent, "quang-wysiwyg", never, { "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "font": { "alias": "font"; "required": false; "isSignal": true; }; "fontSize": { "alias": "fontSize"; "required": false; "isSignal": true; }; "formatBlock": { "alias": "formatBlock"; "required": false; "isSignal": true; }; "paragraphStyle": { "alias": "paragraphStyle"; "required": false; "isSignal": true; }; "blockquote": { "alias": "blockquote"; "required": false; "isSignal": true; }; "bold": { "alias": "bold"; "required": false; "isSignal": true; }; "underline": { "alias": "underline"; "required": false; "isSignal": true; }; "italic": { "alias": "italic"; "required": false; "isSignal": true; }; "strike": { "alias": "strike"; "required": false; "isSignal": true; }; "fontColor": { "alias": "fontColor"; "required": false; "isSignal": true; }; "highlightColor": { "alias": "highlightColor"; "required": false; "isSignal": true; }; "textStyle": { "alias": "textStyle"; "required": false; "isSignal": true; }; "removeFormat": { "alias": "removeFormat"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "list": { "alias": "list"; "required": false; "isSignal": true; }; "table": { "alias": "table"; "required": false; "isSignal": true; }; "link": { "alias": "link"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "fullScreen": { "alias": "fullScreen"; "required": false; "isSignal": true; }; "showBlocks": { "alias": "showBlocks"; "required": false; "isSignal": true; }; "onImageUploadError": { "alias": "onImageUploadError"; "required": false; "isSignal": true; }; "onFileDrop": { "alias": "onFileDrop"; "required": false; "isSignal": true; }; "wysiwygOptions": { "alias": "wysiwygOptions"; "required": false; "isSignal": true; }; }, {}, never, ["[help-icon]"], true, never>;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export { QuangWysiwygComponent };
|
|
@@ -274,7 +274,7 @@ class QuangAutocompleteComponent extends QuangBaseComponent {
|
|
|
274
274
|
provide: QuangOptionListComponent,
|
|
275
275
|
multi: false,
|
|
276
276
|
},
|
|
277
|
-
], viewQueries: [{ propertyName: "optionList", first: true, predicate: ["optionList"], descendants: true, isSignal: true }, { propertyName: "selectInput", first: true, predicate: ["selectInput"], descendants: true, isSignal: true }, { propertyName: "chipContainer", first: true, predicate: ["chipContainer"], descendants: true, isSignal: true }, { propertyName: "autocompleteContainer", first: true, predicate: ["autocompleteContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}
|
|
277
|
+
], viewQueries: [{ propertyName: "optionList", first: true, predicate: ["optionList"], descendants: true, isSignal: true }, { propertyName: "selectInput", first: true, predicate: ["selectInput"], descendants: true, isSignal: true }, { propertyName: "chipContainer", first: true, predicate: ["chipContainer"], descendants: true, isSignal: true }, { propertyName: "autocompleteContainer", first: true, predicate: ["autocompleteContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block;--chip-max-length: none}.autocomplete-container{margin-bottom:1rem;position:relative}.chip:has(.btn-chip:disabled):hover{filter:unset;cursor:unset}.container-wrap{display:flex;flex-wrap:wrap;gap:.5rem}.container-wrap.horizontal{display:flex}.container-wrap.horizontal .chip-container{max-width:70%;margin-bottom:0;margin-left:.5rem;flex-wrap:nowrap;white-space:nowrap;overflow-x:auto;position:absolute;align-items:center}.container-wrap.horizontal .chip-container .chip{white-space:nowrap}.container-wrap.horizontal input{min-width:30%;flex:1 1 0;width:auto;border:none}.container-wrap.horizontal input:focus-visible{outline:none}.chip{display:flex;justify-content:space-between;align-items:center;padding:.25rem .5rem;border-radius:16px;color:var(--bs-btn-color);background-color:rgba(var(--bs-primary-rgb),.1);border-width:1px;border-style:solid;border-color:var(--bs-primary-border-subtle);height:2rem}.chip p{margin:0;max-width:var(--chip-max-length);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chip .btn-chip{text-align:end;padding:0;min-width:unset}.chip .btn-chip:hover{opacity:80%}.chip .btn-chip:active{border-color:transparent}.chip .btn-chip svg{color:var(--bs-primary);vertical-align:sub}.chip:has(.btn-chip:focus-visible){border-width:2px;filter:brightness(80%)}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QuangOptionListComponent, selector: "quang-option-list", inputs: ["selectionMode", "optionListMaxHeight", "selectOptions", "selectButtonRef", "_value", "_isDisabled", "componentClass", "componentLabel", "componentTabIndex", "translateValue", "nullOption", "scrollBehaviorOnOpen", "parentType", "parentID"], outputs: ["changedHandler", "blurHandler"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: QuangTooltipDirective, selector: "[quangTooltip]", inputs: ["quangTooltip", "showMethod"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
278
278
|
}
|
|
279
279
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: QuangAutocompleteComponent, decorators: [{
|
|
280
280
|
type: Component,
|
|
@@ -288,7 +288,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
288
288
|
provide: QuangOptionListComponent,
|
|
289
289
|
multi: false,
|
|
290
290
|
},
|
|
291
|
-
], template: "<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}
|
|
291
|
+
], template: "<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block;--chip-max-length: none}.autocomplete-container{margin-bottom:1rem;position:relative}.chip:has(.btn-chip:disabled):hover{filter:unset;cursor:unset}.container-wrap{display:flex;flex-wrap:wrap;gap:.5rem}.container-wrap.horizontal{display:flex}.container-wrap.horizontal .chip-container{max-width:70%;margin-bottom:0;margin-left:.5rem;flex-wrap:nowrap;white-space:nowrap;overflow-x:auto;position:absolute;align-items:center}.container-wrap.horizontal .chip-container .chip{white-space:nowrap}.container-wrap.horizontal input{min-width:30%;flex:1 1 0;width:auto;border:none}.container-wrap.horizontal input:focus-visible{outline:none}.chip{display:flex;justify-content:space-between;align-items:center;padding:.25rem .5rem;border-radius:16px;color:var(--bs-btn-color);background-color:rgba(var(--bs-primary-rgb),.1);border-width:1px;border-style:solid;border-color:var(--bs-primary-border-subtle);height:2rem}.chip p{margin:0;max-width:var(--chip-max-length);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chip .btn-chip{text-align:end;padding:0;min-width:unset}.chip .btn-chip:hover{opacity:80%}.chip .btn-chip:active{border-color:transparent}.chip .btn-chip svg{color:var(--bs-primary);vertical-align:sub}.chip:has(.btn-chip:focus-visible){border-width:2px;filter:brightness(80%)}\n"] }]
|
|
292
292
|
}], ctorParameters: () => [] });
|
|
293
293
|
|
|
294
294
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-components-autocomplete.mjs","sources":["../../../projects/quang/components/autocomplete/autocomplete.component.ts","../../../projects/quang/components/autocomplete/autocomplete.component.html","../../../projects/quang/components/autocomplete/quang-components-autocomplete.ts"],"sourcesContent":["import { NgClass, NgStyle } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n effect,\n forwardRef,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { QuangTooltipDirective } from 'quang/overlay/tooltip'\nimport { Subject, Subscription, debounceTime, distinctUntilChanged } from 'rxjs'\n\nimport {\n OptionListParentType,\n QuangBaseComponent,\n QuangOptionListComponent,\n SelectOption,\n} from 'quang/components/shared'\n\n@Component({\n selector: 'quang-autocomplete',\n imports: [TranslocoPipe, NgClass, QuangOptionListComponent, NgStyle, QuangTooltipDirective],\n templateUrl: './autocomplete.component.html',\n styleUrl: './autocomplete.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangAutocompleteComponent),\n multi: true,\n },\n {\n provide: QuangOptionListComponent,\n multi: false,\n },\n ],\n})\n/**\n * Autocomplete component for providing suggestion options {@link SelectOption} as the user types.\n *\n * @usageNotes\n * This component displays a list of filtered options based on user input.\n * It allows users to select an option from the suggestions and emits the event `selectedOption` when an option is selected.\n *\n * `searchTextDebounce` is by default set to 300ms.\n */\nexport class QuangAutocompleteComponent extends QuangBaseComponent<string | number | string[] | number[]> {\n // the form can't be a random text but must be one of the options if this is false\n syncFormWithText = input<boolean>(false)\n\n optionListMaxHeight = input<string>('200px')\n\n selectOptions = input.required<SelectOption[]>()\n\n translateValue = input<boolean>(true)\n\n scrollBehaviorOnOpen = input<ScrollBehavior>('smooth')\n\n /**\n * Only emits the value without saving it in ngControl\n */\n emitOnly = input<boolean>(false)\n\n multiple = input<boolean>(false)\n\n /**\n * Set the maximum length in characters of the single chip.\n */\n chipMaxLength = input<number>(0)\n\n multiSelectDisplayMode = input<'vertical' | 'horizontal'>('vertical')\n\n optionList = viewChild<QuangOptionListComponent>('optionList')\n\n _showOptions = signal<boolean | null>(null)\n\n _inputValue = signal<string>('')\n\n _optionHideTimeout = signal<any | undefined>(undefined)\n\n _chipList = signal<string[]>([])\n\n _selectedOptions = signal<SelectOption[]>([])\n\n inputValue$ = new Subject<string>()\n\n selectOptionsChange = toObservable(this.selectOptions)\n .pipe(takeUntilDestroyed())\n .subscribe(() => {\n const value = this._value()\n if (!this.multiple() && !this._inputValue()) {\n this.setInputValue()\n } else if (this.multiple() && Array.isArray(value) && value.length > 0) {\n for (const valueElement of value) {\n this.onSelectValue(valueElement)\n }\n }\n })\n\n _filteredOptions = computed<SelectOption[]>(() => {\n const text = this._inputValue()\n if (this.multiple()) {\n return this.filterOptions(text).filter((x) => !this._chipList().some((chip) => chip === x.value))\n } else {\n return text?.length ? this.filterOptions(text) : this.selectOptions()\n }\n })\n\n selectedOption = output<string | number | null>()\n\n searchTextChange = output<string>()\n\n searchTextDebounce = input<number>(300)\n\n internalFilterOptions = input<boolean>(true)\n\n readonly ParentType = OptionListParentType.AUTOCOMPLETE\n\n formValueChange$: Subscription | undefined = undefined\n\n private readonly selectInput = viewChild<ElementRef>('selectInput')\n private readonly chipContainer = viewChild<ElementRef>('chipContainer')\n private readonly autocompleteContainer = viewChild<ElementRef>('autocompleteContainer')\n\n inputHeight = signal<number>(0)\n\n private readonly onChangeSelectInput = effect(() => {\n const selectInput = this.selectInput()\n if (selectInput) {\n this.inputHeight.set(selectInput?.nativeElement?.getBoundingClientRect().height)\n selectInput.nativeElement.addEventListener('keydown', (e: KeyboardEvent) => {\n if (this.multiple() && this._chipList().length > 0 && !this._inputValue()?.length && e.key === 'Backspace') {\n e.preventDefault()\n // this.deleteChip(this._chipList()[this._chipList().length - 1])\n const chipContainer = this.chipContainer()?.nativeElement\n if (chipContainer) {\n const chips = chipContainer.querySelectorAll('.chip button.btn-chip')\n if (chips.length > 0) {\n const focusChip = chips[chips.length - 1]\n focusChip.focus()\n focusChip.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Backspace') {\n event.preventDefault()\n this.deleteChip(this._chipList()[this._chipList().length - 1])\n selectInput.nativeElement.focus()\n } else {\n event.preventDefault()\n }\n })\n }\n }\n }\n })\n }\n })\n\n constructor() {\n super()\n this.inputValue$\n .pipe(takeUntilDestroyed(), debounceTime(this.searchTextDebounce()), distinctUntilChanged())\n .subscribe((value) => {\n if (value !== this._inputValue()) {\n this.searchTextChange.emit(value?.toString() || '')\n if (this.syncFormWithText()) {\n this.onValueChange(value, false)\n }\n }\n this._inputValue.set(value?.toString() || '')\n if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {\n this._ngControl()?.control?.patchValue(null)\n }\n })\n toObservable(this._showOptions)\n .pipe(takeUntilDestroyed())\n .subscribe((data) => {\n if (!data && data !== null) {\n this.checkInputValue()\n }\n })\n }\n\n override setupFormControl(): void {\n super.setupFormControl()\n const formControl = this._ngControl()?.control\n if (this.formValueChange$) {\n this.formValueChange$.unsubscribe()\n this.formValueChange$ = undefined\n }\n if (formControl) {\n this.formValueChange$ = formControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {\n if (!this.syncFormWithText() && !value) {\n this._inputValue.set('')\n }\n })\n }\n }\n\n showOptionVisibility(): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n this._optionHideTimeout.set(null)\n }\n this._showOptions.set(true)\n }\n\n hideOptionVisibility(skipTimeout = false): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n }\n this._optionHideTimeout.set(\n setTimeout(\n () => {\n this._showOptions.set(false)\n },\n skipTimeout ? 0 : 50\n )\n )\n }\n\n onChangeInput(value: any): void {\n this.showOptionVisibility()\n this.inputValue$.next(value.target?.value)\n }\n\n filterOptions(value: string): SelectOption[] {\n const options = this.selectOptions()\n if (this.internalFilterOptions()) {\n return options.filter((x) => x.label.toLowerCase().includes(value.toLowerCase()))\n }\n return options\n }\n\n override onChangedHandler(value: string | number | string[] | number[]): void {\n super.onChangedHandler(value)\n this.setInputValue()\n }\n\n onValueChange(value: string | number, hideOptions = true): void {\n if (this.multiple()) {\n this.onSelectValue(value)\n this.onChangedHandler(this._chipList())\n if (this._chipList().some((x) => x === value)) {\n this.inputValue$.next('')\n }\n } else {\n this.onChangedHandler(value)\n if (hideOptions) {\n this.hideOptionVisibility()\n }\n this.selectedOption.emit(value)\n }\n }\n\n checkInputValue(): void {\n const option = this.selectOptions().find((x) => x.label.toLowerCase() === this._inputValue()?.toLowerCase())\n if (!this.multiple()) {\n if (option?.value === this._value()) return\n if (option) {\n this.onChangedHandler(option.value ?? '')\n } else if (!this.syncFormWithText()) {\n this.onChangedHandler('')\n }\n }\n }\n\n override writeValue(val: string | number | string[] | number[]): void {\n super.writeValue(val)\n this.setInputValue(true)\n if (Array.isArray(val)) {\n val.forEach((x) => {\n this.onSelectValue(x)\n })\n }\n }\n\n onBlurInput(event: FocusEvent) {\n if ((event?.relatedTarget as HTMLDivElement)?.id !== this.optionList()?.optionListContainer()?.nativeElement?.id)\n this.onBlurHandler()\n }\n\n override onBlurHandler() {\n setTimeout(() => {\n this.hideOptionVisibility()\n if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {\n this._ngControl()?.control?.patchValue(null)\n }\n super.onBlurHandler()\n }, 100)\n }\n\n onBlurOptionList(event: any): void {\n if (event) this.hideOptionVisibility()\n }\n\n setInputValue(resetOnMiss = false) {\n this._inputValue.set(\n this.selectOptions().find((x) => x.value === this._value())?.label ?? (resetOnMiss ? '' : this._inputValue())\n )\n if (!this.syncFormWithText()) this.inputValue$.next(this._inputValue() ?? '')\n }\n\n getDescription(chip: any): string {\n const valueChip = this.selectOptions().find((x) => x.value === chip)\n return valueChip ? valueChip.label.toString() : ''\n }\n\n onSelectValue(value: any): void {\n const newChip = this.selectOptions().find((x) => x.value === value)\n if (newChip && !this._chipList().some((x) => x === newChip?.value)) {\n this.createChipList(newChip)\n this._selectedOptions.update((list) => [...list, newChip])\n }\n }\n\n /**\n * remove chip from chips list\n * @param chipValue chip to delete\n */\n deleteChip(chipValue: any): void {\n const stringChipValue = chipValue?.toString()\n const i = this._chipList()?.findIndex((x) => x.toString() === stringChipValue)\n if (i >= 0) {\n const currentList = this._chipList()\n if (Array.isArray(currentList) && currentList.length > 0) {\n this._chipList.update((list) => (list as string[]).filter((_, index) => index !== i))\n this.onChangedHandler(this._chipList())\n }\n }\n }\n\n createChipList(chip: any): void {\n if (chip) {\n this._chipList.update((list) => [...list, chip.value])\n }\n }\n}\n","<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label\"\n >\n {{ componentLabel() | transloco }}\n <span [hidden]=\"!_isRequired()\">*</span>\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA8CA;;;;;;;;AAQG;AACG,MAAO,0BAA2B,SAAQ,kBAAyD,CAAA;AA8GvG,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AA7GT,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAU,KAAK,CAAC;AAExC,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAS,OAAO,CAAC;AAE5C,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAkB;AAEhD,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAU,IAAI,CAAC;AAErC,QAAA,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAAiB,QAAQ,CAAC;AAEtD;;AAEG;AACH,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC;AAEhC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC;AAEhC;;AAEG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAS,CAAC,CAAC;AAEhC,QAAA,IAAA,CAAA,sBAAsB,GAAG,KAAK,CAA4B,UAAU,CAAC;AAErE,QAAA,IAAA,CAAA,UAAU,GAAG,SAAS,CAA2B,YAAY,CAAC;AAE9D,QAAA,IAAA,CAAA,YAAY,G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,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,qBAAqB,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FA0B/E,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBA5BtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,WACrB,CAAC,aAAa,EAAE,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,qBAAqB,CAAC,EAAA,eAAA,EAG1E,uBAAuB,CAAC,MAAM,EAEpC,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,gCAAgC,CAAC;AACzD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,wBAAwB;AACjC,4BAAA,KAAK,EAAE,KAAK;AACb,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,2vHAAA,EAAA,MAAA,EAAA,CAAA,kyCAAA,CAAA,EAAA;;;AE5CH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"quang-components-autocomplete.mjs","sources":["../../../projects/quang/components/autocomplete/autocomplete.component.ts","../../../projects/quang/components/autocomplete/autocomplete.component.html","../../../projects/quang/components/autocomplete/quang-components-autocomplete.ts"],"sourcesContent":["import { NgClass, NgStyle } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n effect,\n forwardRef,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { QuangTooltipDirective } from 'quang/overlay/tooltip'\nimport { Subject, Subscription, debounceTime, distinctUntilChanged } from 'rxjs'\n\nimport {\n OptionListParentType,\n QuangBaseComponent,\n QuangOptionListComponent,\n SelectOption,\n} from 'quang/components/shared'\n\n@Component({\n selector: 'quang-autocomplete',\n imports: [TranslocoPipe, NgClass, QuangOptionListComponent, NgStyle, QuangTooltipDirective],\n templateUrl: './autocomplete.component.html',\n styleUrl: './autocomplete.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangAutocompleteComponent),\n multi: true,\n },\n {\n provide: QuangOptionListComponent,\n multi: false,\n },\n ],\n})\n/**\n * Autocomplete component for providing suggestion options {@link SelectOption} as the user types.\n *\n * @usageNotes\n * This component displays a list of filtered options based on user input.\n * It allows users to select an option from the suggestions and emits the event `selectedOption` when an option is selected.\n *\n * `searchTextDebounce` is by default set to 300ms.\n */\nexport class QuangAutocompleteComponent extends QuangBaseComponent<string | number | string[] | number[]> {\n // the form can't be a random text but must be one of the options if this is false\n syncFormWithText = input<boolean>(false)\n\n optionListMaxHeight = input<string>('200px')\n\n selectOptions = input.required<SelectOption[]>()\n\n translateValue = input<boolean>(true)\n\n scrollBehaviorOnOpen = input<ScrollBehavior>('smooth')\n\n /**\n * Only emits the value without saving it in ngControl\n */\n emitOnly = input<boolean>(false)\n\n multiple = input<boolean>(false)\n\n /**\n * Set the maximum length in characters of the single chip.\n */\n chipMaxLength = input<number>(0)\n\n multiSelectDisplayMode = input<'vertical' | 'horizontal'>('vertical')\n\n optionList = viewChild<QuangOptionListComponent>('optionList')\n\n _showOptions = signal<boolean | null>(null)\n\n _inputValue = signal<string>('')\n\n _optionHideTimeout = signal<any | undefined>(undefined)\n\n _chipList = signal<string[]>([])\n\n _selectedOptions = signal<SelectOption[]>([])\n\n inputValue$ = new Subject<string>()\n\n selectOptionsChange = toObservable(this.selectOptions)\n .pipe(takeUntilDestroyed())\n .subscribe(() => {\n const value = this._value()\n if (!this.multiple() && !this._inputValue()) {\n this.setInputValue()\n } else if (this.multiple() && Array.isArray(value) && value.length > 0) {\n for (const valueElement of value) {\n this.onSelectValue(valueElement)\n }\n }\n })\n\n _filteredOptions = computed<SelectOption[]>(() => {\n const text = this._inputValue()\n if (this.multiple()) {\n return this.filterOptions(text).filter((x) => !this._chipList().some((chip) => chip === x.value))\n } else {\n return text?.length ? this.filterOptions(text) : this.selectOptions()\n }\n })\n\n selectedOption = output<string | number | null>()\n\n searchTextChange = output<string>()\n\n searchTextDebounce = input<number>(300)\n\n internalFilterOptions = input<boolean>(true)\n\n readonly ParentType = OptionListParentType.AUTOCOMPLETE\n\n formValueChange$: Subscription | undefined = undefined\n\n private readonly selectInput = viewChild<ElementRef>('selectInput')\n private readonly chipContainer = viewChild<ElementRef>('chipContainer')\n private readonly autocompleteContainer = viewChild<ElementRef>('autocompleteContainer')\n\n inputHeight = signal<number>(0)\n\n private readonly onChangeSelectInput = effect(() => {\n const selectInput = this.selectInput()\n if (selectInput) {\n this.inputHeight.set(selectInput?.nativeElement?.getBoundingClientRect().height)\n selectInput.nativeElement.addEventListener('keydown', (e: KeyboardEvent) => {\n if (this.multiple() && this._chipList().length > 0 && !this._inputValue()?.length && e.key === 'Backspace') {\n e.preventDefault()\n // this.deleteChip(this._chipList()[this._chipList().length - 1])\n const chipContainer = this.chipContainer()?.nativeElement\n if (chipContainer) {\n const chips = chipContainer.querySelectorAll('.chip button.btn-chip')\n if (chips.length > 0) {\n const focusChip = chips[chips.length - 1]\n focusChip.focus()\n focusChip.addEventListener('keydown', (event: KeyboardEvent) => {\n if (event.key === 'Backspace') {\n event.preventDefault()\n this.deleteChip(this._chipList()[this._chipList().length - 1])\n selectInput.nativeElement.focus()\n } else {\n event.preventDefault()\n }\n })\n }\n }\n }\n })\n }\n })\n\n constructor() {\n super()\n this.inputValue$\n .pipe(takeUntilDestroyed(), debounceTime(this.searchTextDebounce()), distinctUntilChanged())\n .subscribe((value) => {\n if (value !== this._inputValue()) {\n this.searchTextChange.emit(value?.toString() || '')\n if (this.syncFormWithText()) {\n this.onValueChange(value, false)\n }\n }\n this._inputValue.set(value?.toString() || '')\n if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {\n this._ngControl()?.control?.patchValue(null)\n }\n })\n toObservable(this._showOptions)\n .pipe(takeUntilDestroyed())\n .subscribe((data) => {\n if (!data && data !== null) {\n this.checkInputValue()\n }\n })\n }\n\n override setupFormControl(): void {\n super.setupFormControl()\n const formControl = this._ngControl()?.control\n if (this.formValueChange$) {\n this.formValueChange$.unsubscribe()\n this.formValueChange$ = undefined\n }\n if (formControl) {\n this.formValueChange$ = formControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {\n if (!this.syncFormWithText() && !value) {\n this._inputValue.set('')\n }\n })\n }\n }\n\n showOptionVisibility(): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n this._optionHideTimeout.set(null)\n }\n this._showOptions.set(true)\n }\n\n hideOptionVisibility(skipTimeout = false): void {\n if (this._optionHideTimeout()) {\n clearTimeout(this._optionHideTimeout())\n }\n this._optionHideTimeout.set(\n setTimeout(\n () => {\n this._showOptions.set(false)\n },\n skipTimeout ? 0 : 50\n )\n )\n }\n\n onChangeInput(value: any): void {\n this.showOptionVisibility()\n this.inputValue$.next(value.target?.value)\n }\n\n filterOptions(value: string): SelectOption[] {\n const options = this.selectOptions()\n if (this.internalFilterOptions()) {\n return options.filter((x) => x.label.toLowerCase().includes(value.toLowerCase()))\n }\n return options\n }\n\n override onChangedHandler(value: string | number | string[] | number[]): void {\n super.onChangedHandler(value)\n this.setInputValue()\n }\n\n onValueChange(value: string | number, hideOptions = true): void {\n if (this.multiple()) {\n this.onSelectValue(value)\n this.onChangedHandler(this._chipList())\n if (this._chipList().some((x) => x === value)) {\n this.inputValue$.next('')\n }\n } else {\n this.onChangedHandler(value)\n if (hideOptions) {\n this.hideOptionVisibility()\n }\n this.selectedOption.emit(value)\n }\n }\n\n checkInputValue(): void {\n const option = this.selectOptions().find((x) => x.label.toLowerCase() === this._inputValue()?.toLowerCase())\n if (!this.multiple()) {\n if (option?.value === this._value()) return\n if (option) {\n this.onChangedHandler(option.value ?? '')\n } else if (!this.syncFormWithText()) {\n this.onChangedHandler('')\n }\n }\n }\n\n override writeValue(val: string | number | string[] | number[]): void {\n super.writeValue(val)\n this.setInputValue(true)\n if (Array.isArray(val)) {\n val.forEach((x) => {\n this.onSelectValue(x)\n })\n }\n }\n\n onBlurInput(event: FocusEvent) {\n if ((event?.relatedTarget as HTMLDivElement)?.id !== this.optionList()?.optionListContainer()?.nativeElement?.id)\n this.onBlurHandler()\n }\n\n override onBlurHandler() {\n setTimeout(() => {\n this.hideOptionVisibility()\n if (!this._inputValue()?.length && !this.emitOnly() && !this.multiple()) {\n this._ngControl()?.control?.patchValue(null)\n }\n super.onBlurHandler()\n }, 100)\n }\n\n onBlurOptionList(event: any): void {\n if (event) this.hideOptionVisibility()\n }\n\n setInputValue(resetOnMiss = false) {\n this._inputValue.set(\n this.selectOptions().find((x) => x.value === this._value())?.label ?? (resetOnMiss ? '' : this._inputValue())\n )\n if (!this.syncFormWithText()) this.inputValue$.next(this._inputValue() ?? '')\n }\n\n getDescription(chip: any): string {\n const valueChip = this.selectOptions().find((x) => x.value === chip)\n return valueChip ? valueChip.label.toString() : ''\n }\n\n onSelectValue(value: any): void {\n const newChip = this.selectOptions().find((x) => x.value === value)\n if (newChip && !this._chipList().some((x) => x === newChip?.value)) {\n this.createChipList(newChip)\n this._selectedOptions.update((list) => [...list, newChip])\n }\n }\n\n /**\n * remove chip from chips list\n * @param chipValue chip to delete\n */\n deleteChip(chipValue: any): void {\n const stringChipValue = chipValue?.toString()\n const i = this._chipList()?.findIndex((x) => x.toString() === stringChipValue)\n if (i >= 0) {\n const currentList = this._chipList()\n if (Array.isArray(currentList) && currentList.length > 0) {\n this._chipList.update((list) => (list as string[]).filter((_, index) => index !== i))\n this.onChangedHandler(this._chipList())\n }\n }\n }\n\n createChipList(chip: any): void {\n if (chip) {\n this._chipList.update((list) => [...list, chip.value])\n }\n }\n}\n","<div\n [ngStyle]=\"{ '--chip-max-length': chipMaxLength() ? chipMaxLength() + 'ch' : 'none' }\"\n #autocompleteContainer\n class=\"autocomplete-container\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <div\n [ngClass]=\"multiSelectDisplayMode() === 'horizontal' ? 'horizontal form-control' : ''\"\n #chipContainer\n class=\"container-wrap\"\n >\n @if (multiple() && _chipList().length > 0) {\n @for (chip of _chipList(); track $index) {\n @if (getDescription(chip)) {\n <div\n [quangTooltip]=\"chipMaxLength() ? getDescription(chip) : ''\"\n class=\"chip chip-hover\"\n >\n <p [ngClass]=\"{ 'm-0': isReadonly() || _isDisabled() }\">\n {{ getDescription(chip) }}\n </p>\n @if (!isReadonly() && !_isDisabled()) {\n <button\n [tabIndex]=\"$index + 1\"\n (click)=\"deleteChip(chip)\"\n class=\"btn btn-chip\"\n type=\"button\"\n >\n <svg\n class=\"ionicon\"\n fill=\"currentColor\"\n height=\"24\"\n viewBox=\"0 0 512 512\"\n width=\"24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M368 368L144 144M368 144L144 368\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"32\"\n />\n </svg>\n </button>\n }\n </div>\n }\n }\n }\n\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [class.form-control]=\"multiSelectDisplayMode() !== 'horizontal'\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled() || isReadonly()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_inputValue()\"\n (blur)=\"onBlurInput($event)\"\n (input)=\"onChangeInput($event)\"\n (mousedown)=\"showOptionVisibility()\"\n #selectInput\n autocomplete=\"off\"\n type=\"text\"\n />\n </div>\n @if (_showOptions()) {\n <quang-option-list\n [_isDisabled]=\"_isDisabled()\"\n [_value]=\"_value()\"\n [componentClass]=\"componentClass()\"\n [componentLabel]=\"componentLabel()\"\n [componentTabIndex]=\"componentTabIndex()\"\n [nullOption]=\"false\"\n [optionListMaxHeight]=\"optionListMaxHeight()\"\n [parentID]=\"componentId()\"\n [parentType]=\"ParentType\"\n [scrollBehaviorOnOpen]=\"scrollBehaviorOnOpen()\"\n [selectButtonRef]=\"autocompleteContainer\"\n [selectOptions]=\"_filteredOptions()\"\n [translateValue]=\"translateValue()\"\n (blurHandler)=\"onBlurOptionList($event)\"\n (changedHandler)=\"onValueChange($event)\"\n #optionList\n selectionMode=\"single\"\n />\n }\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA8CA;;;;;;;;AAQG;AACG,MAAO,0BAA2B,SAAQ,kBAAyD,CAAA;AA8GvG,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AA7GT,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,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C,CAAC;AACzD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,wBAAwB;AACjC,4BAAA,KAAK,EAAE,KAAK;AACb,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,wgIAAA,EAAA,MAAA,EAAA,CAAA,kyCAAA,CAAA,EAAA;;;AE5CH;;AAEG;;;;"}
|
|
@@ -3,6 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { input, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { TranslocoPipe } from '@jsverse/transloco';
|
|
6
|
+
import { QuangTooltipDirective } from 'quang/overlay/tooltip';
|
|
6
7
|
import { QuangBaseComponent } from 'quang/components/shared';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -32,7 +33,7 @@ class QuangCheckboxComponent extends QuangBaseComponent {
|
|
|
32
33
|
useExisting: forwardRef(() => QuangCheckboxComponent),
|
|
33
34
|
multi: true,
|
|
34
35
|
},
|
|
35
|
-
], usesInheritance: true, ngImport: i0, template: "<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n
|
|
36
|
+
], usesInheritance: true, ngImport: i0, template: "<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [attr.role]=\"checkType() === 'checkbox' ? 'checkbox' : 'switch'\"\n [checked]=\"_value()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n class=\"form-check-input {{ _isDisabled() ? '' : 'cursor-pointer' }}\"\n type=\"checkbox\"\n />\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block}.label-top{display:flex;flex-direction:column}.label-top input{margin:unset;float:unset}.label-bottom{display:flex;flex-direction:column-reverse}.label-bottom input{margin:unset;float:unset}.label-right{flex-direction:row-reverse;justify-content:start}.label-right label{margin-left:.5rem;margin-bottom:0;align-self:center}.label-left{flex-direction:row}.label-left label{margin-bottom:0;align-self:center}.toggle-wrapper{display:flex;padding-left:unset}.toggle-wrapper label{display:block}.toggle-wrapper input{margin-left:unset;width:3em;height:1.5em}.direction-row{flex-direction:row}.direction-row .form-label{margin-right:.5rem}.direction-reverse-row{flex-direction:row-reverse;justify-content:start}.direction-reverse-row input{margin-right:.5rem}.direction-column{flex-direction:column}.cursor-pointer{cursor:pointer}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: QuangTooltipDirective, selector: "[quangTooltip]", inputs: ["quangTooltip", "showMethod"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
37
|
}
|
|
37
38
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: QuangCheckboxComponent, decorators: [{
|
|
38
39
|
type: Component,
|
|
@@ -42,7 +43,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
42
43
|
useExisting: forwardRef(() => QuangCheckboxComponent),
|
|
43
44
|
multi: true,
|
|
44
45
|
},
|
|
45
|
-
], imports: [TranslocoPipe, NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n
|
|
46
|
+
], imports: [TranslocoPipe, NgClass, QuangTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [attr.role]=\"checkType() === 'checkbox' ? 'checkbox' : 'switch'\"\n [checked]=\"_value()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n class=\"form-check-input {{ _isDisabled() ? '' : 'cursor-pointer' }}\"\n type=\"checkbox\"\n />\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n", styles: [":host{display:block}.label-top{display:flex;flex-direction:column}.label-top input{margin:unset;float:unset}.label-bottom{display:flex;flex-direction:column-reverse}.label-bottom input{margin:unset;float:unset}.label-right{flex-direction:row-reverse;justify-content:start}.label-right label{margin-left:.5rem;margin-bottom:0;align-self:center}.label-left{flex-direction:row}.label-left label{margin-bottom:0;align-self:center}.toggle-wrapper{display:flex;padding-left:unset}.toggle-wrapper label{display:block}.toggle-wrapper input{margin-left:unset;width:3em;height:1.5em}.direction-row{flex-direction:row}.direction-row .form-label{margin-right:.5rem}.direction-reverse-row{flex-direction:row-reverse;justify-content:start}.direction-reverse-row input{margin-right:.5rem}.direction-column{flex-direction:column}.cursor-pointer{cursor:pointer}\n"] }]
|
|
46
47
|
}] });
|
|
47
48
|
|
|
48
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quang-components-checkbox.mjs","sources":["../../../projects/quang/components/checkbox/checkbox.component.ts","../../../projects/quang/components/checkbox/checkbox.component.html","../../../projects/quang/components/checkbox/quang-components-checkbox.ts"],"sourcesContent":["import { NgClass } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, forwardRef, input } from '@angular/core'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type LabelPosition = 'top' | 'left' | 'right' | 'bottom'\n\n@Component({\n selector: 'quang-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangCheckboxComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgClass],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Checkbox component for rendering a `checkbox` or a `toggle` switch.\n *\n * @usageNotes\n * This component can be configured to display as a standard checkbox or as a toggle switch,\n * depending on the `checkType` input property.\n *\n * The component label can be aligned in {@link LabelPosition} by setting the `labelPosition` input property.\n */\nexport class QuangCheckboxComponent extends QuangBaseComponent<boolean> {\n labelPosition = input<LabelPosition>('top')\n\n checkType = input.required<'checkbox' | 'toggle'>()\n\n removeMargin = input<boolean>(false)\n\n override onChangedEventHandler($event: Event) {\n const inputElement = $event.target as HTMLInputElement\n this.onChangedHandler(inputElement.checked)\n }\n}\n","<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n
|
|
1
|
+
{"version":3,"file":"quang-components-checkbox.mjs","sources":["../../../projects/quang/components/checkbox/checkbox.component.ts","../../../projects/quang/components/checkbox/checkbox.component.html","../../../projects/quang/components/checkbox/quang-components-checkbox.ts"],"sourcesContent":["import { NgClass } from '@angular/common'\nimport { ChangeDetectionStrategy, Component, forwardRef, input } from '@angular/core'\nimport { NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { TranslocoPipe } from '@jsverse/transloco'\nimport { QuangTooltipDirective } from 'quang/overlay/tooltip'\n\nimport { QuangBaseComponent } from 'quang/components/shared'\n\nexport type LabelPosition = 'top' | 'left' | 'right' | 'bottom'\n\n@Component({\n selector: 'quang-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => QuangCheckboxComponent),\n multi: true,\n },\n ],\n imports: [TranslocoPipe, NgClass, QuangTooltipDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/**\n * Checkbox component for rendering a `checkbox` or a `toggle` switch.\n *\n * @usageNotes\n * This component can be configured to display as a standard checkbox or as a toggle switch,\n * depending on the `checkType` input property.\n *\n * The component label can be aligned in {@link LabelPosition} by setting the `labelPosition` input property.\n */\nexport class QuangCheckboxComponent extends QuangBaseComponent<boolean> {\n labelPosition = input<LabelPosition>('top')\n\n checkType = input.required<'checkbox' | 'toggle'>()\n\n removeMargin = input<boolean>(false)\n\n override onChangedEventHandler($event: Event) {\n const inputElement = $event.target as HTMLInputElement\n this.onChangedHandler(inputElement.checked)\n }\n}\n","<div\n [class.form-check-reverse]=\"labelPosition() === 'left' && checkType() === 'checkbox'\"\n [class.form-switch]=\"checkType() === 'toggle'\"\n [class.label-bottom]=\"labelPosition() === 'bottom'\"\n [class.label-left]=\"labelPosition() === 'left' && checkType() === 'toggle'\"\n [class.label-right]=\"labelPosition() === 'right' && checkType() === 'toggle'\"\n [class.label-top]=\"labelPosition() === 'top'\"\n [class.toggle-wrapper]=\"checkType() === 'toggle'\"\n [ngClass]=\"{ 'mb-3': !removeMargin(), 'form-check': !removeMargin() }\"\n>\n @if (componentLabel()) {\n <label\n [htmlFor]=\"componentId()\"\n class=\"form-label d-flex gap-2\"\n >\n <div>\n <span>{{ componentLabel() | transloco }}</span>\n <span [hidden]=\"!_isRequired()\">*</span>\n </div>\n @if (helpMessage() && helpMessageTooltip()) {\n <div [quangTooltip]=\"helpMessage() | transloco\">\n <ng-content select=\"[help-icon]\" />\n </div>\n }\n </label>\n }\n <input\n [attr.required]=\"getIsRequiredControl()\"\n [attr.role]=\"checkType() === 'checkbox' ? 'checkbox' : 'switch'\"\n [checked]=\"_value()\"\n [class.is-invalid]=\"_showErrors()\"\n [class.is-valid]=\"_showSuccess()\"\n [disabled]=\"_isDisabled()\"\n [id]=\"componentId()\"\n [ngClass]=\"componentClass()\"\n [placeholder]=\"componentPlaceholder() | transloco\"\n [readOnly]=\"isReadonly()\"\n [tabIndex]=\"componentTabIndex()\"\n [value]=\"_value()\"\n (blur)=\"onBlurHandler()\"\n (input)=\"onChangedEventHandler($event)\"\n class=\"form-check-input {{ _isDisabled() ? '' : 'cursor-pointer' }}\"\n type=\"checkbox\"\n />\n <div class=\"valid-feedback\">\n {{ successMessage() | transloco }}\n </div>\n <div class=\"invalid-feedback\">\n {{ _currentErrorMessage() | transloco: _currentErrorMessageExtraData() }}\n </div>\n @if (helpMessage() && !helpMessageTooltip()) {\n <small\n [hidden]=\"_showSuccess() || _showErrors()\"\n aria-live=\"assertive\"\n class=\"form-text text-muted\"\n >\n {{ helpMessage() | transloco }}\n </small>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAyBA;;;;;;;;AAQG;AACG,MAAO,sBAAuB,SAAQ,kBAA2B,CAAA;AAvBvE,IAAA,WAAA,GAAA;;AAwBE,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAgB,KAAK,CAAC;AAE3C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAyB;AAEnD,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,KAAK,CAAC;AAMrC;AAJU,IAAA,qBAAqB,CAAC,MAAa,EAAA;AAC1C,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,MAA0B;AACtD,QAAA,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC;;8GATlC,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,E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