@sixbell-telco/sdk 1.6.0 → 2.1.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/CHANGELOG.md +260 -711
- package/README.md +337 -278
- package/_index.css +3 -3
- package/components/accordion/accordion-item/accordion-item.component.d.ts +3 -4
- package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +29 -2
- package/components/audio-player/services/audio.service.d.ts +14 -14
- package/components/audio-player/src/audio-player.component.d.ts +7 -3
- package/components/audio-player/volume-control/volume-control.component.d.ts +28 -1
- package/components/button/src/button.component.d.ts +46 -1
- package/components/countdown/src/countdown.component.d.ts +1 -1
- package/components/data-table/data-table-empty-actions/data-table-empty-actions.component.d.ts +5 -0
- package/components/data-table/public-api.d.ts +1 -0
- package/components/data-table/src/data-table.component.d.ts +11 -3
- package/components/dialog/src/dialog.component.d.ts +51 -5
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +2 -1
- package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +37 -1
- package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +33 -1
- package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +33 -1
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +53 -2
- package/components/dropdown/src/dropdown.component.d.ts +2 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +2 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +33 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +33 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +33 -1
- package/components/dropdown-menu/src/directives/dropdown-menu.directive.d.ts +1 -3
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +4 -4
- package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +33 -1
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -1
- package/components/dual-list/src/dual-list.component.d.ts +4 -2
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +53 -8
- package/components/file-upload/file-uploader/file-uploader.component.d.ts +40 -9
- package/components/forms/checkbox/src/checkbox.component.d.ts +46 -2
- package/components/forms/combobox/src/combobox.component.d.ts +40 -5
- package/components/forms/date-picker/src/date-picker.component.d.ts +11 -1
- package/components/forms/form-group/README.md +114 -0
- package/components/forms/form-group/index.d.ts +5 -0
- package/components/forms/form-group/public-api.d.ts +1 -0
- package/components/forms/form-group/src/form-group.component.d.ts +150 -0
- package/components/forms/form-item/README.md +17 -0
- package/components/forms/form-item/index.d.ts +5 -0
- package/components/forms/form-item/public-api.d.ts +1 -0
- package/components/forms/form-item/src/form-item.component.d.ts +5 -0
- package/components/forms/input/src/input.component.d.ts +45 -2
- package/components/forms/radio/src/radio.component.d.ts +46 -2
- package/components/forms/range/src/range.component.d.ts +38 -1
- package/components/forms/select/src/select.component.d.ts +40 -5
- package/components/forms/switch/src/switch.component.d.ts +46 -2
- package/components/forms/textarea/src/textarea.component.d.ts +62 -12
- package/components/forms/toggle/src/toggle.component.d.ts +46 -1
- package/components/link/src/link.component.d.ts +0 -3
- package/components/overlay/overlay-content/overlay-content.component.d.ts +2 -1
- package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +37 -5
- package/components/overlay/src/overlay.component.d.ts +4 -5
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +37 -1
- package/components/tab/directives/tab-content/tab-content.directive.d.ts +5 -6
- package/components/tab/directives/tab-header/tab-header.directive.d.ts +2 -2
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +36 -4
- package/components/table/table-empty-actions/table-empty-actions.component.d.ts +5 -0
- package/components/table/table-header-checkbox/table-header-checkbox.component.d.ts +5 -11
- package/components/table/table-row-checkbox/table-row-checkbox.component.d.ts +5 -11
- package/components/toast/toast-message/toast-message.component.d.ts +42 -1
- package/components/tooltip/src/tooltip.component.d.ts +10 -1
- package/components/wizard/services/wizard.service.d.ts +5 -5
- package/components/wizard/wizard-marker/wizard-marker.component.d.ts +2 -3
- package/directives/auto-focus/public-api.d.ts +1 -1
- package/directives/auto-focus/src/{autofocus.directive.d.ts → auto-focus.directive.d.ts} +9 -15
- package/directives/click-outside/src/click-outside.directive.d.ts +1 -3
- package/directives/only-numbers/public-api.d.ts +6 -1
- package/directives/only-numbers/src/only-numbers.directive.d.ts +36 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +6 -9
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +133 -51
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +78 -4
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +53 -27
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +82 -12
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +166 -13
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +68 -24
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +283 -16
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +12 -9
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +151 -10
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +69 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +96 -19
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +15 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-group.mjs +159 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-group.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +20 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +62 -6
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +69 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +57 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +91 -20
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +80 -6
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +131 -13
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +69 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +2 -7
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +94 -42
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +71 -10
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +5 -9
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +131 -47
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +69 -4
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +15 -3
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +29 -49
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-click-outside.mjs +7 -10
- package/fesm2022/sixbell-telco-sdk-directives-click-outside.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +48 -17
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs +339 -0
- package/fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-sync.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-sync.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +1062 -730
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +350 -267
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +55 -46
- package/utils/runtime-config/README.md +235 -0
- package/utils/{resource-loader → runtime-config}/index.d.ts +1 -1
- package/utils/runtime-config/public-api.d.ts +5 -0
- package/utils/runtime-config/src/http-client.d.ts +11 -0
- package/utils/runtime-config/src/runtime-config-loader.d.ts +23 -0
- package/utils/runtime-config/src/runtime-config-store.d.ts +11 -0
- package/utils/runtime-config/src/runtime-update-adapter.d.ts +15 -0
- package/utils/runtime-config/src/types.d.ts +66 -0
- package/utils/theme/README.md +324 -986
- package/utils/theme/public-api.d.ts +4 -4
- package/utils/theme/src/constants.d.ts +6 -12
- package/utils/theme/src/models/theme.d.ts +46 -173
- package/utils/theme/src/providers/theme.provider.d.ts +0 -10
- package/utils/theme/src/providers/theme.provider.types.d.ts +16 -15
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +16 -12
- package/utils/theme/src/theme-dom/theme-dom.service.d.ts +10 -3
- package/utils/theme/src/theme.service.d.ts +24 -27
- package/utils/theme/src/utils/utils.d.ts +2 -10
- package/utils/translation/README.md +170 -1390
- package/utils/translation/public-api.d.ts +3 -3
- package/utils/translation/src/constants.d.ts +7 -9
- package/utils/translation/src/models/translation.d.ts +9 -10
- package/utils/translation/src/providers/translation.provider.d.ts +17 -28
- package/utils/translation/src/providers/translation.provider.types.d.ts +13 -6
- package/utils/translation/src/translation-dom/translation-dom.service.d.ts +2 -3
- package/utils/translation/src/translation.service.d.ts +37 -9
- package/directives/only-numbers/src/just-numbers.directive.d.ts +0 -9
- package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs +0 -1222
- package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs.map +0 -1
- package/utils/resource-loader/README.md +0 -460
- package/utils/resource-loader/public-api.d.ts +0 -1
- package/utils/resource-loader/src/cache/index.d.ts +0 -2
- package/utils/resource-loader/src/cache/layers/factory.d.ts +0 -38
- package/utils/resource-loader/src/cache/layers/index.d.ts +0 -3
- package/utils/resource-loader/src/cache/layers/indexed-db-cache.d.ts +0 -118
- package/utils/resource-loader/src/cache/layers/local-storage-cache.d.ts +0 -86
- package/utils/resource-loader/src/cache/layers/memory-cache.d.ts +0 -76
- package/utils/resource-loader/src/cache/types.d.ts +0 -107
- package/utils/resource-loader/src/config/index.d.ts +0 -1
- package/utils/resource-loader/src/config/load-config.d.ts +0 -32
- package/utils/resource-loader/src/constants.d.ts +0 -38
- package/utils/resource-loader/src/http/index.d.ts +0 -1
- package/utils/resource-loader/src/http/retryable-client.d.ts +0 -43
- package/utils/resource-loader/src/index.d.ts +0 -1
- package/utils/resource-loader/src/resource-loader.d.ts +0 -67
- package/utils/resource-loader/src/types.d.ts +0 -152
- package/utils/resource-loader/src/utils/cache-validator.d.ts +0 -72
- package/utils/resource-loader/src/utils/helpers.d.ts +0 -15
- package/utils/resource-loader/src/utils/index.d.ts +0 -2
- package/utils/theme/src/providers/constants.d.ts +0 -7
- package/utils/translation/src/providers/constants.d.ts +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, output, signal, computed, effect, Component } from '@angular/core';
|
|
2
|
+
import { input, model, output, signal, computed, inject, DestroyRef, viewChild, effect, afterRenderEffect, Component } from '@angular/core';
|
|
3
3
|
import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
@@ -99,6 +99,16 @@ class TextareaComponent {
|
|
|
99
99
|
* Label displayed above the textarea
|
|
100
100
|
*/
|
|
101
101
|
label = input(null);
|
|
102
|
+
/**
|
|
103
|
+
* Whether to show optional indicator
|
|
104
|
+
* @defaultValue false
|
|
105
|
+
*/
|
|
106
|
+
showOptional = input(false);
|
|
107
|
+
/**
|
|
108
|
+
* Optional indicator text (translation key or literal)
|
|
109
|
+
* @defaultValue 'sdk.formFields.optional'
|
|
110
|
+
*/
|
|
111
|
+
optionalText = input('sdk.formFields.optional');
|
|
102
112
|
/**
|
|
103
113
|
* HTML name attribute for the textarea
|
|
104
114
|
*/
|
|
@@ -166,8 +176,22 @@ class TextareaComponent {
|
|
|
166
176
|
onControlTouch = () => { };
|
|
167
177
|
/**
|
|
168
178
|
* Event emitted on Enter key press
|
|
179
|
+
* @deprecated Use keyDownEnter or triggered instead. This output will be removed in the next major.
|
|
169
180
|
*/
|
|
170
181
|
enterPressed = output();
|
|
182
|
+
/**
|
|
183
|
+
* Stop event propagation for activation events
|
|
184
|
+
* @defaultValue false
|
|
185
|
+
*/
|
|
186
|
+
stopPropagation = input(false);
|
|
187
|
+
/**
|
|
188
|
+
* Event emitted on Enter keydown
|
|
189
|
+
*/
|
|
190
|
+
keyDownEnter = output();
|
|
191
|
+
/**
|
|
192
|
+
* Event emitted on activation (Enter)
|
|
193
|
+
*/
|
|
194
|
+
triggered = output();
|
|
171
195
|
/**
|
|
172
196
|
* Debounce time in milliseconds for valueDebounced output
|
|
173
197
|
* @defaultValue 500
|
|
@@ -180,12 +204,49 @@ class TextareaComponent {
|
|
|
180
204
|
/** @internal */
|
|
181
205
|
debounceAction$ = new Subject();
|
|
182
206
|
/** @internal */
|
|
183
|
-
debounceTimeEffect = effect(() => {
|
|
184
|
-
this.debounceAction$.next(this.debounceTime());
|
|
185
|
-
});
|
|
186
|
-
/** @internal */
|
|
187
207
|
value$ = toObservable(this.value);
|
|
208
|
+
/** @internal */
|
|
209
|
+
destroyRef = inject(DestroyRef);
|
|
210
|
+
/** @internal */
|
|
211
|
+
counterBarRef = viewChild('counterBarRef');
|
|
212
|
+
/** @internal */
|
|
213
|
+
counterHeightPx = signal(0);
|
|
214
|
+
/** @internal */
|
|
215
|
+
counterObserver = signal(null);
|
|
188
216
|
constructor() {
|
|
217
|
+
// Emit debounce time changes to the action subject
|
|
218
|
+
effect(() => {
|
|
219
|
+
this.debounceAction$.next(this.debounceTime());
|
|
220
|
+
});
|
|
221
|
+
this.destroyRef.onDestroy(() => {
|
|
222
|
+
const observer = this.counterObserver();
|
|
223
|
+
if (observer)
|
|
224
|
+
observer.disconnect();
|
|
225
|
+
});
|
|
226
|
+
afterRenderEffect(() => {
|
|
227
|
+
const counterRef = this.counterBarRef();
|
|
228
|
+
const currentObserver = this.counterObserver();
|
|
229
|
+
if (!this.maxCharacters() || !counterRef?.nativeElement) {
|
|
230
|
+
if (currentObserver) {
|
|
231
|
+
currentObserver.disconnect();
|
|
232
|
+
this.counterObserver.set(null);
|
|
233
|
+
}
|
|
234
|
+
this.counterHeightPx.set(0);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (currentObserver)
|
|
238
|
+
return;
|
|
239
|
+
const observer = new ResizeObserver((entries) => {
|
|
240
|
+
const entry = entries[0];
|
|
241
|
+
this.counterHeightPx.set(Math.ceil(entry.contentRect.height));
|
|
242
|
+
});
|
|
243
|
+
const counter = counterRef.nativeElement;
|
|
244
|
+
if (!(counter instanceof Element))
|
|
245
|
+
return;
|
|
246
|
+
observer.observe(counter);
|
|
247
|
+
this.counterObserver.set(observer);
|
|
248
|
+
this.counterHeightPx.set(Math.ceil(counter.getBoundingClientRect().height));
|
|
249
|
+
});
|
|
189
250
|
this.setupDebounce();
|
|
190
251
|
}
|
|
191
252
|
/**
|
|
@@ -223,10 +284,42 @@ class TextareaComponent {
|
|
|
223
284
|
* Computed character counter error classes
|
|
224
285
|
*/
|
|
225
286
|
errorClassMaxCharacters = computed(() => {
|
|
226
|
-
return cn('
|
|
287
|
+
return cn('text-base-content ease-ease-out-back grow-0 transition-colors duration-300', {
|
|
227
288
|
'text-error ease-ease-out-back transition-colors duration-300': this.invalidMaxCharacters(),
|
|
289
|
+
'text-inherit': !this.invalidMaxCharacters(),
|
|
228
290
|
});
|
|
229
291
|
});
|
|
292
|
+
/**
|
|
293
|
+
* @internal
|
|
294
|
+
* Wrapper classes for textarea layout
|
|
295
|
+
*/
|
|
296
|
+
wrapperClass = computed(() => {
|
|
297
|
+
const baseClass = this.validationClass();
|
|
298
|
+
const gridRowsClass = this.maxCharacters() ? 'grid-rows-[minmax(0,1fr)_auto]' : '';
|
|
299
|
+
const disabledClass = this.disabled()
|
|
300
|
+
? '!border-base-300 !bg-base-300 !text-base-content/40 !placeholder-base-content/20 cursor-not-allowed'
|
|
301
|
+
: '';
|
|
302
|
+
return cn(baseClass, 'grid w-full gap-0', gridRowsClass, disabledClass);
|
|
303
|
+
});
|
|
304
|
+
/**
|
|
305
|
+
* @internal
|
|
306
|
+
* Wrapper height to accommodate counter
|
|
307
|
+
*/
|
|
308
|
+
wrapperHeight = computed(() => {
|
|
309
|
+
if (!this.maxCharacters())
|
|
310
|
+
return null;
|
|
311
|
+
const height = this.counterHeightPx();
|
|
312
|
+
return `calc(100% + ${height}px)`;
|
|
313
|
+
});
|
|
314
|
+
/**
|
|
315
|
+
* @internal
|
|
316
|
+
* Background bar behind the counter
|
|
317
|
+
*/
|
|
318
|
+
counterBarClass = computed(() => {
|
|
319
|
+
const baseClass = this.invalidMaxCharacters() ? 'text-error' : 'text-base-content';
|
|
320
|
+
const backgroundClass = this.disabled() ? '!bg-base-300 !text-base-content/40' : 'bg-base-100';
|
|
321
|
+
return cn('pointer-events-none row-start-2 flex w-full items-center justify-end', baseClass, backgroundClass);
|
|
322
|
+
});
|
|
230
323
|
// ControlValueAccessor methods
|
|
231
324
|
writeValue(obj) {
|
|
232
325
|
this.value.set(obj);
|
|
@@ -247,11 +340,27 @@ class TextareaComponent {
|
|
|
247
340
|
handleChange() {
|
|
248
341
|
this.onControlChange(this.value());
|
|
249
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* @internal
|
|
345
|
+
* Handles click activation
|
|
346
|
+
*/
|
|
347
|
+
handleClick(event) {
|
|
348
|
+
if (this.disabled())
|
|
349
|
+
return;
|
|
350
|
+
if (this.stopPropagation()) {
|
|
351
|
+
event.stopPropagation();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
250
354
|
/**
|
|
251
355
|
* @internal
|
|
252
356
|
* Handles Enter key press
|
|
253
357
|
*/
|
|
254
|
-
handleEnter() {
|
|
358
|
+
handleEnter(event) {
|
|
359
|
+
if (this.stopPropagation()) {
|
|
360
|
+
event.stopPropagation();
|
|
361
|
+
}
|
|
362
|
+
this.keyDownEnter.emit(event);
|
|
363
|
+
this.triggered.emit();
|
|
255
364
|
this.enterPressed.emit(this.value());
|
|
256
365
|
this.onControlChange(this.value());
|
|
257
366
|
}
|
|
@@ -302,19 +411,28 @@ class TextareaComponent {
|
|
|
302
411
|
*/
|
|
303
412
|
setupDebounce() {
|
|
304
413
|
this.debounceAction$
|
|
305
|
-
.pipe(switchMap((time) => this.value$.pipe(skip(1), debounceTime(time), distinctUntilChanged())), takeUntilDestroyed())
|
|
306
|
-
.subscribe(
|
|
307
|
-
|
|
414
|
+
.pipe(switchMap((time) => this.value$.pipe(skip(1), debounceTime(time), distinctUntilChanged())), takeUntilDestroyed(this.destroyRef))
|
|
415
|
+
.subscribe({
|
|
416
|
+
next: (value) => {
|
|
417
|
+
try {
|
|
418
|
+
this.valueDebounced.emit(`${value}`);
|
|
419
|
+
}
|
|
420
|
+
catch {
|
|
421
|
+
// Component destroyed, suppressing NG0953 error
|
|
422
|
+
// This can happen if debounce emits after component teardown
|
|
423
|
+
// Silently ignore
|
|
424
|
+
}
|
|
425
|
+
},
|
|
308
426
|
});
|
|
309
427
|
}
|
|
310
428
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
311
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TextareaComponent, isStandalone: true, selector: "st-textarea", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", blurred: "blurred", value: "valueChange", enterPressed: "enterPressed", valueDebounced: "valueDebounced" }, providers: [
|
|
429
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TextareaComponent, isStandalone: true, selector: "st-textarea", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", blurred: "blurred", value: "valueChange", enterPressed: "enterPressed", keyDownEnter: "keyDownEnter", triggered: "triggered", valueDebounced: "valueDebounced" }, providers: [
|
|
312
430
|
{
|
|
313
431
|
provide: NG_VALUE_ACCESSOR,
|
|
314
432
|
useExisting: TextareaComponent,
|
|
315
433
|
multi: true,
|
|
316
434
|
},
|
|
317
|
-
], ngImport: i0, template: "@let labelVar = label();\n\n<fieldset class=\"
|
|
435
|
+
], viewQueries: [{ propertyName: "counterBarRef", first: true, predicate: ["counterBarRef"], descendants: true, isSignal: true }], ngImport: i0, template: "@let labelVar = label();\n\n<fieldset class=\"font-body block text-xs\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 text-pretty\">\n\t\t\t<span>{{ labelVar }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-medium\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div #wrapperRef [class]=\"wrapperClass()\" [style.height]=\"wrapperHeight()\">\n\t\t<textarea\n\t\t\tclass=\"placeholder-base-placeholder w-full grow resize-none bg-transparent outline-hidden\"\n\t\t\t[class.min-h-0]=\"maxCharacters()\"\n\t\t\t[class.cursor-not-allowed]=\"disabled()\"\n\t\t\t[attr.rows]=\"rows()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[readOnly]=\"readonly()\"\n\t\t></textarea>\n\t\t@if (maxCharacters()) {\n\t\t\t<div #counterBarRef [class]=\"counterBarClass()\">\n\t\t\t\t<div [class]=\"errorClassMaxCharacters()\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyFontWeight]=\"'normal'\" tyColor=\"inherit\">\n\t\t\t\t\t\t{{ 'sdk.textarea.maxCharacters' | translate: { current: value().length, max: maxCharacters() } }}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t</div>\n\n\t<ng-content></ng-content>\n\n\t<!-- Hidden label for accessibility -->\n\t<label class=\"sr-only\" [for]=\"name()\">{{ labelVar }}</label>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
318
436
|
}
|
|
319
437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
320
438
|
type: Component,
|
|
@@ -324,7 +442,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
324
442
|
useExisting: TextareaComponent,
|
|
325
443
|
multi: true,
|
|
326
444
|
},
|
|
327
|
-
], template: "@let labelVar = label();\n\n<fieldset class=\"
|
|
445
|
+
], template: "@let labelVar = label();\n\n<fieldset class=\"font-body block text-xs\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 text-pretty\">\n\t\t\t<span>{{ labelVar }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-medium\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div #wrapperRef [class]=\"wrapperClass()\" [style.height]=\"wrapperHeight()\">\n\t\t<textarea\n\t\t\tclass=\"placeholder-base-placeholder w-full grow resize-none bg-transparent outline-hidden\"\n\t\t\t[class.min-h-0]=\"maxCharacters()\"\n\t\t\t[class.cursor-not-allowed]=\"disabled()\"\n\t\t\t[attr.rows]=\"rows()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[readOnly]=\"readonly()\"\n\t\t></textarea>\n\t\t@if (maxCharacters()) {\n\t\t\t<div #counterBarRef [class]=\"counterBarClass()\">\n\t\t\t\t<div [class]=\"errorClassMaxCharacters()\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyFontWeight]=\"'normal'\" tyColor=\"inherit\">\n\t\t\t\t\t\t{{ 'sdk.textarea.maxCharacters' | translate: { current: value().length, max: maxCharacters() } }}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t</div>\n\n\t<ng-content></ng-content>\n\n\t<!-- Hidden label for accessibility -->\n\t<label class=\"sr-only\" [for]=\"name()\">{{ labelVar }}</label>\n</fieldset>\n" }]
|
|
328
446
|
}], ctorParameters: () => [] });
|
|
329
447
|
|
|
330
448
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-textarea.mjs","sources":["../../../projects/sdk/components/forms/textarea/src/textarea.component.ts","../../../projects/sdk/components/forms/textarea/src/textarea.component.html","../../../projects/sdk/components/forms/textarea/sixbell-telco-sdk-components-forms-textarea.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Component, computed, effect, input, model, output, signal } from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\nimport { debounceTime, distinctUntilChanged, skip, startWith, Subject, switchMap } from 'rxjs';\n\n/**\n * @internal\n * Generates base textarea classes with style variants\n */\nconst textareaComponent = cva(\n\t[\n\t\t'font-body',\n\t\t'text-pretty',\n\t\t'font-body',\n\t\t'leading-normal',\n\t\t'input',\n\t\t'placeholder:placeholder-base-placeholder',\n\t\t'leading-normal',\n\t\t'grow',\n\t\t'textarea',\n\t\t'w-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: ['textarea-primary'],\n\t\t\t\tsecondary: ['textarea-secondary'],\n\t\t\t\ttertiary: ['textarea-tertiary'],\n\t\t\t\taccent: ['textarea-accent'],\n\t\t\t\tinfo: ['textarea-info'],\n\t\t\t\tsuccess: ['textarea-success'],\n\t\t\t\twarning: ['textarea-warning'],\n\t\t\t\terror: ['textarea-error'],\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\txs: ['textarea-xs'],\n\t\t\t\tsm: ['textarea-sm'],\n\t\t\t\tmd: ['textarea-md'],\n\t\t\t\tlg: ['textarea-lg'],\n\t\t\t\txl: ['textarea-xl'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'secondary',\n\t\t\tsize: 'md',\n\t\t},\n\t},\n);\n\n/** Possible textarea style variants */\nexport type textareaVariantProps = 'primary' | 'secondary' | 'tertiary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | null | undefined;\n\n/** Possible textarea size variants */\nexport type textareaSizeProps = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null | undefined;\n\n/** Configuration object for textarea styling */\nexport type textareaProps = {\n\tvariant?: textareaVariantProps;\n\tsize?: textareaSizeProps;\n};\n\n/**\n * A customizable textarea component with form integration and validation features\n *\n * @remarks\n * Supports character counting, debounced input, and automatic validation styling.\n * Implements ControlValueAccessor for Angular form compatibility.\n *\n * @example\n * ```html\n * <!-- Basic textarea usage -->\n * <st-textarea\n * [(value)]=\"description\"\n * label=\"Description\"\n * maxCharacters=\"500\"\n * ></st-textarea>\n * ```\n *\n * @example\n * ```html\n * <!-- Reactive form integration -->\n * <st-textarea\n * [parentForm]=\"userForm\"\n * formControlName=\"bio\"\n * variant=\"primary\"\n * debounceTime=\"300\"\n * ></st-textarea>\n * ```\n */\n@Component({\n\tselector: 'st-textarea',\n\timports: [FormsModule, TypographyDirective, TranslatePipe],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: TextareaComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './textarea.component.html',\n})\nexport class TextareaComponent {\n\t/**\n\t * Textarea style variant\n\t * @defaultValue 'secondary'\n\t */\n\tvariant = input<textareaVariantProps>();\n\n\t/**\n\t * Textarea size variant\n\t * @defaultValue 'md'\n\t */\n\tsize = input<textareaSizeProps>();\n\n\t/**\n\t * Whether to use ghost (transparent) styling\n\t * @defaultValue false\n\t */\n\tghost = input<boolean>(false);\n\n\t/**\n\t * Label displayed above the textarea\n\t */\n\tlabel = input<string | null>(null);\n\n\t/**\n\t * HTML name attribute for the textarea\n\t */\n\tname = input<string | null>(null);\n\n\t/**\n\t * Placeholder text when empty\n\t */\n\tplaceholder = input<string>('');\n\n\t/**\n\t * Number of visible text rows\n\t * @defaultValue 3\n\t */\n\trows = input<string | number>(3);\n\n\t/**\n\t * Whether the textarea is readonly\n\t * @defaultValue false\n\t */\n\treadonly = input<boolean>(false);\n\n\t/**\n\t * Whether the textarea is disabled\n\t * @defaultValue false\n\t */\n\tdisabled = model<boolean>(false);\n\n\t/**\n\t * Event emitted on textarea blur\n\t */\n\tblurred = output<string>();\n\n\t/** @internal */\n\tprivate blurTrigger = signal(0);\n\n\t/**\n\t * Two-way bindable textarea value\n\t */\n\tvalue = model<string>('');\n\n\t/**\n\t * Maximum allowed character count\n\t * @defaultValue 0 (unlimited)\n\t */\n\tmaxCharacters = input<number>(0);\n\n\t/**\n\t * Whether current value exceeds maxCharacters\n\t * @internal\n\t */\n\tinvalidMaxCharacters = computed<boolean>(() => this.value().length > this.maxCharacters());\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t/**\n\t * @internal\n\t * Gets associated form control\n\t */\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor implementation\n\t/** @internal */\n\tprivate onControlChange: any = () => {};\n\t/** @internal */\n\tprivate onControlTouch: any = () => {};\n\n\t/**\n\t * Event emitted on Enter key press\n\t */\n\tenterPressed = output<string>();\n\n\t/**\n\t * Debounce time in milliseconds for valueDebounced output\n\t * @defaultValue 500\n\t */\n\tdebounceTime = input(500);\n\n\t/**\n\t * Event emitted after debounce time when value changes\n\t */\n\tvalueDebounced = output<string>();\n\n\t/** @internal */\n\tprivate debounceAction$ = new Subject<number>();\n\t/** @internal */\n\tprivate debounceTimeEffect = effect(() => {\n\t\tthis.debounceAction$.next(this.debounceTime());\n\t});\n\t/** @internal */\n\tprivate value$ = toObservable(this.value);\n\n\tconstructor() {\n\t\tthis.setupDebounce();\n\t}\n\n\t/**\n\t * @internal\n\t * Computed base textarea classes\n\t */\n\tcomponentClass = computed(() => {\n\t\treturn cn(\n\t\t\ttextareaComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'textarea-ghost': this.ghost() },\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed error state classes\n\t */\n\terrorClass = computed(() => {\n\t\treturn cn(\n\t\t\ttextareaComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'textarea-ghost': this.ghost() },\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed success state classes\n\t */\n\tsuccessClass = computed(() => {\n\t\treturn cn(\n\t\t\ttextareaComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'textarea-ghost': this.ghost() },\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed character counter error classes\n\t */\n\terrorClassMaxCharacters = computed(() => {\n\t\treturn cn('grow-0 text-base-content ease-ease-out-back transition-colors duration-300', {\n\t\t\t'text-error ease-ease-out-back transition-colors duration-300': this.invalidMaxCharacters(),\n\t\t});\n\t});\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles input changes\n\t */\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Enter key press\n\t */\n\thandleEnter() {\n\t\tthis.enterPressed.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles blur event\n\t */\n\thandleBlur() {\n\t\tthis.blurred.emit(this.value());\n\t\tthis.onControlTouch();\n\t\tthis.blurTrigger.update((v) => v + 1);\n\t}\n\n\t/** @internal */\n\tprivate formControl = computed(() => this.parentForm()?.get(this.formControlName()) as FormControl | null);\n\t/** @internal */\n\tprivate formControl$ = toObservable(this.formControl);\n\t/** @internal */\n\tprivate statusChanges$ = this.formControl$.pipe(switchMap((control) => control?.statusChanges.pipe(startWith(control.status)) || []));\n\t/** @internal */\n\tprivate stateChanges$ = this.formControl$.pipe(switchMap((control) => control?.valueChanges.pipe(startWith(control.value)) || []));\n\t/** @internal */\n\tprivate statusSignal = toSignal(this.statusChanges$);\n\t/** @internal */\n\tprivate stateSignal = toSignal(this.stateChanges$);\n\n\t/**\n\t * @internal\n\t * Computed validation classes based on form state\n\t */\n\tvalidationClass = computed(() => {\n\t\tconst control = this.formControl();\n\t\tconst trigger = this.blurTrigger();\n\n\t\tif (!control) return this.componentClass();\n\n\t\tconst isTouched = control.touched || trigger > 0;\n\t\tthis.statusSignal();\n\t\tthis.stateSignal();\n\n\t\tif (control.dirty || isTouched) {\n\t\t\tif (control.invalid) return this.errorClass();\n\t\t\tif (control.valid) return this.successClass();\n\t\t}\n\n\t\treturn this.componentClass();\n\t});\n\n\t/**\n\t * @internal\n\t * Sets up debounce mechanism for value changes\n\t */\n\tprivate setupDebounce() {\n\t\tthis.debounceAction$\n\t\t\t.pipe(\n\t\t\t\tswitchMap((time: number) => this.value$.pipe(skip(1), debounceTime(time), distinctUntilChanged())),\n\t\t\t\ttakeUntilDestroyed(),\n\t\t\t)\n\t\t\t.subscribe((value) => {\n\t\t\t\tthis.valueDebounced.emit(`${value}`);\n\t\t\t});\n\t}\n}\n","@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body pt-0 text-pretty\">{{ labelVar }}</legend>\n\t}\n\n\t<textarea\n\t\t[class]=\"validationClass()\"\n\t\t[attr.rows]=\"rows()\"\n\t\t[attr.name]=\"name()\"\n\t\t[attr.placeholder]=\"placeholder()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t[readOnly]=\"readonly()\"\n\t></textarea>\n\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t@if (maxCharacters()) {\n\t\t\t<div [class]=\"errorClassMaxCharacters()\">\n\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyFontWeight]=\"'normal'\" tyColor=\"inherit\">\n\t\t\t\t\t{{ 'sdk.textarea.maxCharacters' | translate: { current: value().length, max: maxCharacters() } }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t}\n\t</div>\n\n\t<!-- Hidden label for accessibility -->\n\t<label class=\"sr-only\" [for]=\"name()\">{{ labelVar }}</label>\n</fieldset>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAUA;;;AAGG;AACH,MAAM,iBAAiB,GAAG,GAAG,CAC5B;IACC,WAAW;IACX,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,OAAO;IACP,0CAA0C;IAC1C,gBAAgB;IAChB,MAAM;IACN,UAAU;IACV,QAAQ;CACR,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,kBAAkB,CAAC;YAC7B,SAAS,EAAE,CAAC,oBAAoB,CAAC;YACjC,QAAQ,EAAE,CAAC,mBAAmB,CAAC;YAC/B,MAAM,EAAE,CAAC,iBAAiB,CAAC;YAC3B,IAAI,EAAE,CAAC,eAAe,CAAC;YACvB,OAAO,EAAE,CAAC,kBAAkB,CAAC;YAC7B,OAAO,EAAE,CAAC,k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AAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mBAAmB,wHAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAU7C,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAZ7B,SAAS;+BACC,aAAa,EAAA,OAAA,EACd,CAAC,WAAW,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAC/C,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAmB,iBAAA;AAC9B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,0iCAAA,EAAA;;;AExGF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-textarea.mjs","sources":["../../../projects/sdk/components/forms/textarea/src/textarea.component.ts","../../../projects/sdk/components/forms/textarea/src/textarea.component.html","../../../projects/sdk/components/forms/textarea/sixbell-telco-sdk-components-forms-textarea.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n\tafterRenderEffect,\n\tComponent,\n\tcomputed,\n\tDestroyRef,\n\teffect,\n\tElementRef,\n\tinject,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\nimport { debounceTime, distinctUntilChanged, skip, startWith, Subject, switchMap } from 'rxjs';\n\n/**\n * @internal\n * Generates base textarea classes with style variants\n */\nconst textareaComponent = cva(\n\t[\n\t\t'font-body',\n\t\t'text-pretty',\n\t\t'font-body',\n\t\t'leading-normal',\n\t\t'input',\n\t\t'placeholder:placeholder-base-placeholder',\n\t\t'leading-normal',\n\t\t'grow',\n\t\t'textarea',\n\t\t'w-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: ['textarea-primary'],\n\t\t\t\tsecondary: ['textarea-secondary'],\n\t\t\t\ttertiary: ['textarea-tertiary'],\n\t\t\t\taccent: ['textarea-accent'],\n\t\t\t\tinfo: ['textarea-info'],\n\t\t\t\tsuccess: ['textarea-success'],\n\t\t\t\twarning: ['textarea-warning'],\n\t\t\t\terror: ['textarea-error'],\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\txs: ['textarea-xs'],\n\t\t\t\tsm: ['textarea-sm'],\n\t\t\t\tmd: ['textarea-md'],\n\t\t\t\tlg: ['textarea-lg'],\n\t\t\t\txl: ['textarea-xl'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'secondary',\n\t\t\tsize: 'md',\n\t\t},\n\t},\n);\n\n/** Possible textarea style variants */\nexport type textareaVariantProps = 'primary' | 'secondary' | 'tertiary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | null | undefined;\n\n/** Possible textarea size variants */\nexport type textareaSizeProps = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null | undefined;\n\n/** Configuration object for textarea styling */\nexport type textareaProps = {\n\tvariant?: textareaVariantProps;\n\tsize?: textareaSizeProps;\n};\n\n/**\n * A customizable textarea component with form integration and validation features\n *\n * @remarks\n * Supports character counting, debounced input, and automatic validation styling.\n * Implements ControlValueAccessor for Angular form compatibility.\n *\n * @example\n * ```html\n * <!-- Basic textarea usage -->\n * <st-textarea\n * [(value)]=\"description\"\n * label=\"Description\"\n * maxCharacters=\"500\"\n * ></st-textarea>\n * ```\n *\n * @example\n * ```html\n * <!-- Reactive form integration -->\n * <st-textarea\n * [parentForm]=\"userForm\"\n * formControlName=\"bio\"\n * variant=\"primary\"\n * debounceTime=\"300\"\n * ></st-textarea>\n * ```\n */\n@Component({\n\tselector: 'st-textarea',\n\timports: [FormsModule, TypographyDirective, TranslatePipe],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: TextareaComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './textarea.component.html',\n})\nexport class TextareaComponent {\n\t/**\n\t * Textarea style variant\n\t * @defaultValue 'secondary'\n\t */\n\tvariant = input<textareaVariantProps>();\n\n\t/**\n\t * Textarea size variant\n\t * @defaultValue 'md'\n\t */\n\tsize = input<textareaSizeProps>();\n\n\t/**\n\t * Whether to use ghost (transparent) styling\n\t * @defaultValue false\n\t */\n\tghost = input<boolean>(false);\n\n\t/**\n\t * Label displayed above the textarea\n\t */\n\tlabel = input<string | null>(null);\n\n\t/**\n\t * Whether to show optional indicator\n\t * @defaultValue false\n\t */\n\tshowOptional = input<boolean>(false);\n\n\t/**\n\t * Optional indicator text (translation key or literal)\n\t * @defaultValue 'sdk.formFields.optional'\n\t */\n\toptionalText = input<string>('sdk.formFields.optional');\n\n\t/**\n\t * HTML name attribute for the textarea\n\t */\n\tname = input<string | null>(null);\n\n\t/**\n\t * Placeholder text when empty\n\t */\n\tplaceholder = input<string>('');\n\n\t/**\n\t * Number of visible text rows\n\t * @defaultValue 3\n\t */\n\trows = input<string | number>(3);\n\n\t/**\n\t * Whether the textarea is readonly\n\t * @defaultValue false\n\t */\n\treadonly = input<boolean>(false);\n\n\t/**\n\t * Whether the textarea is disabled\n\t * @defaultValue false\n\t */\n\tdisabled = model<boolean>(false);\n\n\t/**\n\t * Event emitted on textarea blur\n\t */\n\tblurred = output<string>();\n\n\t/** @internal */\n\tprivate readonly blurTrigger = signal(0);\n\n\t/**\n\t * Two-way bindable textarea value\n\t */\n\tvalue = model<string>('');\n\n\t/**\n\t * Maximum allowed character count\n\t * @defaultValue 0 (unlimited)\n\t */\n\tmaxCharacters = input<number>(0);\n\n\t/**\n\t * Whether current value exceeds maxCharacters\n\t * @internal\n\t */\n\tinvalidMaxCharacters = computed<boolean>(() => this.value().length > this.maxCharacters());\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t/**\n\t * @internal\n\t * Gets associated form control\n\t */\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor implementation\n\t/** @internal */\n\tprivate onControlChange: any = () => {};\n\t/** @internal */\n\tprivate onControlTouch: any = () => {};\n\n\t/**\n\t * Event emitted on Enter key press\n\t * @deprecated Use keyDownEnter or triggered instead. This output will be removed in the next major.\n\t */\n\tenterPressed = output<string>();\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input<boolean>(false);\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (Enter)\n\t */\n\ttriggered = output<void>();\n\n\t/**\n\t * Debounce time in milliseconds for valueDebounced output\n\t * @defaultValue 500\n\t */\n\tdebounceTime = input(500);\n\n\t/**\n\t * Event emitted after debounce time when value changes\n\t */\n\tvalueDebounced = output<string>();\n\n\t/** @internal */\n\tprivate readonly debounceAction$ = new Subject<number>();\n\t/** @internal */\n\tprivate readonly value$ = toObservable(this.value);\n\t/** @internal */\n\tprivate readonly destroyRef = inject(DestroyRef);\n\t/** @internal */\n\tprivate readonly counterBarRef = viewChild<ElementRef<HTMLDivElement>>('counterBarRef');\n\t/** @internal */\n\tprivate readonly counterHeightPx = signal(0);\n\t/** @internal */\n\tprivate readonly counterObserver = signal<ResizeObserver | null>(null);\n\n\tconstructor() {\n\t\t// Emit debounce time changes to the action subject\n\t\teffect(() => {\n\t\t\tthis.debounceAction$.next(this.debounceTime());\n\t\t});\n\n\t\tthis.destroyRef.onDestroy(() => {\n\t\t\tconst observer = this.counterObserver();\n\t\t\tif (observer) observer.disconnect();\n\t\t});\n\n\t\tafterRenderEffect(() => {\n\t\t\tconst counterRef = this.counterBarRef();\n\t\t\tconst currentObserver = this.counterObserver();\n\n\t\t\tif (!this.maxCharacters() || !counterRef?.nativeElement) {\n\t\t\t\tif (currentObserver) {\n\t\t\t\t\tcurrentObserver.disconnect();\n\t\t\t\t\tthis.counterObserver.set(null);\n\t\t\t\t}\n\t\t\t\tthis.counterHeightPx.set(0);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (currentObserver) return;\n\n\t\t\tconst observer = new ResizeObserver((entries) => {\n\t\t\t\tconst entry = entries[0];\n\t\t\t\tthis.counterHeightPx.set(Math.ceil(entry.contentRect.height));\n\t\t\t});\n\n\t\t\tconst counter = counterRef.nativeElement;\n\t\t\tif (!(counter instanceof Element)) return;\n\t\t\tobserver.observe(counter);\n\t\t\tthis.counterObserver.set(observer);\n\t\t\tthis.counterHeightPx.set(Math.ceil(counter.getBoundingClientRect().height));\n\t\t});\n\n\t\tthis.setupDebounce();\n\t}\n\n\t/**\n\t * @internal\n\t * Computed base textarea classes\n\t */\n\tcomponentClass = computed(() => {\n\t\treturn cn(\n\t\t\ttextareaComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'textarea-ghost': this.ghost() },\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed error state classes\n\t */\n\terrorClass = computed(() => {\n\t\treturn cn(\n\t\t\ttextareaComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'textarea-ghost': this.ghost() },\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed success state classes\n\t */\n\tsuccessClass = computed(() => {\n\t\treturn cn(\n\t\t\ttextareaComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'textarea-ghost': this.ghost() },\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed character counter error classes\n\t */\n\terrorClassMaxCharacters = computed(() => {\n\t\treturn cn('text-base-content ease-ease-out-back grow-0 transition-colors duration-300', {\n\t\t\t'text-error ease-ease-out-back transition-colors duration-300': this.invalidMaxCharacters(),\n\t\t\t'text-inherit': !this.invalidMaxCharacters(),\n\t\t});\n\t});\n\n\t/**\n\t * @internal\n\t * Wrapper classes for textarea layout\n\t */\n\twrapperClass = computed(() => {\n\t\tconst baseClass = this.validationClass();\n\t\tconst gridRowsClass = this.maxCharacters() ? 'grid-rows-[minmax(0,1fr)_auto]' : '';\n\t\tconst disabledClass = this.disabled()\n\t\t\t? '!border-base-300 !bg-base-300 !text-base-content/40 !placeholder-base-content/20 cursor-not-allowed'\n\t\t\t: '';\n\t\treturn cn(baseClass, 'grid w-full gap-0', gridRowsClass, disabledClass);\n\t});\n\n\t/**\n\t * @internal\n\t * Wrapper height to accommodate counter\n\t */\n\twrapperHeight = computed(() => {\n\t\tif (!this.maxCharacters()) return null;\n\t\tconst height = this.counterHeightPx();\n\t\treturn `calc(100% + ${height}px)`;\n\t});\n\n\t/**\n\t * @internal\n\t * Background bar behind the counter\n\t */\n\tcounterBarClass = computed(() => {\n\t\tconst baseClass = this.invalidMaxCharacters() ? 'text-error' : 'text-base-content';\n\t\tconst backgroundClass = this.disabled() ? '!bg-base-300 !text-base-content/40' : 'bg-base-100';\n\t\treturn cn('pointer-events-none row-start-2 flex w-full items-center justify-end', baseClass, backgroundClass);\n\t});\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles input changes\n\t */\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles click activation\n\t */\n\thandleClick(event: MouseEvent): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Enter key press\n\t */\n\thandleEnter(event: Event) {\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t\tthis.triggered.emit();\n\t\tthis.enterPressed.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles blur event\n\t */\n\thandleBlur() {\n\t\tthis.blurred.emit(this.value());\n\t\tthis.onControlTouch();\n\t\tthis.blurTrigger.update((v) => v + 1);\n\t}\n\n\t/** @internal */\n\tprivate readonly formControl = computed(() => this.parentForm()?.get(this.formControlName()) as FormControl | null);\n\t/** @internal */\n\tprivate readonly formControl$ = toObservable(this.formControl);\n\t/** @internal */\n\tprivate readonly statusChanges$ = this.formControl$.pipe(switchMap((control) => control?.statusChanges.pipe(startWith(control.status)) || []));\n\t/** @internal */\n\tprivate readonly stateChanges$ = this.formControl$.pipe(switchMap((control) => control?.valueChanges.pipe(startWith(control.value)) || []));\n\t/** @internal */\n\tprivate readonly statusSignal = toSignal(this.statusChanges$);\n\t/** @internal */\n\tprivate readonly stateSignal = toSignal(this.stateChanges$);\n\n\t/**\n\t * @internal\n\t * Computed validation classes based on form state\n\t */\n\tvalidationClass = computed(() => {\n\t\tconst control = this.formControl();\n\t\tconst trigger = this.blurTrigger();\n\n\t\tif (!control) return this.componentClass();\n\n\t\tconst isTouched = control.touched || trigger > 0;\n\t\tthis.statusSignal();\n\t\tthis.stateSignal();\n\n\t\tif (control.dirty || isTouched) {\n\t\t\tif (control.invalid) return this.errorClass();\n\t\t\tif (control.valid) return this.successClass();\n\t\t}\n\n\t\treturn this.componentClass();\n\t});\n\n\t/**\n\t * @internal\n\t * Sets up debounce mechanism for value changes\n\t */\n\tprivate setupDebounce() {\n\t\tthis.debounceAction$\n\t\t\t.pipe(\n\t\t\t\tswitchMap((time: number) => this.value$.pipe(skip(1), debounceTime(time), distinctUntilChanged())),\n\t\t\t\ttakeUntilDestroyed(this.destroyRef),\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (value) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.valueDebounced.emit(`${value}`);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Component destroyed, suppressing NG0953 error\n\t\t\t\t\t\t// This can happen if debounce emits after component teardown\n\t\t\t\t\t\t// Silently ignore\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n","@let labelVar = label();\n\n<fieldset class=\"font-body block text-xs\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 text-pretty\">\n\t\t\t<span>{{ labelVar }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-medium\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\n\t<div #wrapperRef [class]=\"wrapperClass()\" [style.height]=\"wrapperHeight()\">\n\t\t<textarea\n\t\t\tclass=\"placeholder-base-placeholder w-full grow resize-none bg-transparent outline-hidden\"\n\t\t\t[class.min-h-0]=\"maxCharacters()\"\n\t\t\t[class.cursor-not-allowed]=\"disabled()\"\n\t\t\t[attr.rows]=\"rows()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[readOnly]=\"readonly()\"\n\t\t></textarea>\n\t\t@if (maxCharacters()) {\n\t\t\t<div #counterBarRef [class]=\"counterBarClass()\">\n\t\t\t\t<div [class]=\"errorClassMaxCharacters()\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyFontWeight]=\"'normal'\" tyColor=\"inherit\">\n\t\t\t\t\t\t{{ 'sdk.textarea.maxCharacters' | translate: { current: value().length, max: maxCharacters() } }}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t</div>\n\n\t<ng-content></ng-content>\n\n\t<!-- Hidden label for accessibility -->\n\t<label class=\"sr-only\" [for]=\"name()\">{{ labelVar }}</label>\n</fieldset>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAuBA;;;AAGG;AACH,MAAM,iBAAiB,GAAG,GAAG,CAC5B;IACC,WAAW;IACX,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,OAAO;IACP,0CAA0C;IAC1C,gBAAgB;IAChB,MAAM;IACN,UAAU;IACV,QAAQ;CACR,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,kBAAkB,CAAC;YA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-160,6 +160,14 @@ class ToggleComponent {
|
|
|
160
160
|
label = input('');
|
|
161
161
|
name = input(null);
|
|
162
162
|
value = model(false);
|
|
163
|
+
/**
|
|
164
|
+
* Parent form group for reactive forms
|
|
165
|
+
*/
|
|
166
|
+
parentForm = input(null);
|
|
167
|
+
/**
|
|
168
|
+
* Form control name for reactive forms
|
|
169
|
+
*/
|
|
170
|
+
formControlName = input('');
|
|
163
171
|
// ControlValueAccessor attributes
|
|
164
172
|
onControlChange = () => { };
|
|
165
173
|
onControlTouch = () => { };
|
|
@@ -180,6 +188,27 @@ class ToggleComponent {
|
|
|
180
188
|
}
|
|
181
189
|
// Change handler
|
|
182
190
|
valueUpdated = output();
|
|
191
|
+
/**
|
|
192
|
+
* Stop event propagation for activation events
|
|
193
|
+
* @defaultValue false
|
|
194
|
+
*/
|
|
195
|
+
stopPropagation = input(false);
|
|
196
|
+
/**
|
|
197
|
+
* Event emitted on click
|
|
198
|
+
*/
|
|
199
|
+
clicked = output();
|
|
200
|
+
/**
|
|
201
|
+
* Event emitted on Enter keydown
|
|
202
|
+
*/
|
|
203
|
+
keyDownEnter = output();
|
|
204
|
+
/**
|
|
205
|
+
* Event emitted on Space keydown
|
|
206
|
+
*/
|
|
207
|
+
keyDownSpace = output();
|
|
208
|
+
/**
|
|
209
|
+
* Event emitted on activation (click or keyboard)
|
|
210
|
+
*/
|
|
211
|
+
triggered = output();
|
|
183
212
|
handleChange() {
|
|
184
213
|
this.onControlChange(this.value());
|
|
185
214
|
this.valueUpdated.emit(this.value());
|
|
@@ -188,6 +217,43 @@ class ToggleComponent {
|
|
|
188
217
|
handleBlur() {
|
|
189
218
|
this.onControlTouch();
|
|
190
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* @internal
|
|
222
|
+
* Handle click activation
|
|
223
|
+
*/
|
|
224
|
+
handleClick(event) {
|
|
225
|
+
if (this.disabled())
|
|
226
|
+
return;
|
|
227
|
+
if (this.stopPropagation()) {
|
|
228
|
+
event.stopPropagation();
|
|
229
|
+
}
|
|
230
|
+
this.clicked.emit(event);
|
|
231
|
+
this.triggered.emit();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @internal
|
|
235
|
+
* Handle Enter key activation
|
|
236
|
+
*/
|
|
237
|
+
handleKeyDownEnter(event) {
|
|
238
|
+
if (this.disabled())
|
|
239
|
+
return;
|
|
240
|
+
if (this.stopPropagation()) {
|
|
241
|
+
event.stopPropagation();
|
|
242
|
+
}
|
|
243
|
+
this.keyDownEnter.emit(event);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @internal
|
|
247
|
+
* Handle Space key activation
|
|
248
|
+
*/
|
|
249
|
+
handleKeyDownSpace(event) {
|
|
250
|
+
if (this.disabled())
|
|
251
|
+
return;
|
|
252
|
+
if (this.stopPropagation()) {
|
|
253
|
+
event.stopPropagation();
|
|
254
|
+
}
|
|
255
|
+
this.keyDownSpace.emit(event);
|
|
256
|
+
}
|
|
191
257
|
// classes
|
|
192
258
|
componentClass = computed(() => {
|
|
193
259
|
const baseVariant = this.variant() ?? 'primary';
|
|
@@ -200,13 +266,13 @@ class ToggleComponent {
|
|
|
200
266
|
}));
|
|
201
267
|
});
|
|
202
268
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
203
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.0", type: ToggleComponent, isStandalone: true, selector: "st-toggle", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", valueUpdated: "valueUpdated" }, providers: [
|
|
269
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.0", type: ToggleComponent, isStandalone: true, selector: "st-toggle", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", valueUpdated: "valueUpdated", clicked: "clicked", keyDownEnter: "keyDownEnter", keyDownSpace: "keyDownSpace", triggered: "triggered" }, providers: [
|
|
204
270
|
{
|
|
205
271
|
provide: NG_VALUE_ACCESSOR,
|
|
206
272
|
useExisting: ToggleComponent,
|
|
207
273
|
multi: true,
|
|
208
274
|
},
|
|
209
|
-
], ngImport: i0, template: "@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button
|
|
275
|
+
], ngImport: i0, template: "@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button\n\t\t[class]=\"componentClass()\"\n\t\t(click)=\"handleToggle(); handleClick($event)\"\n\t\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\t\t[disabled]=\"disabledVar\"\n\t>\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\">\n\t\t\t{{ label() }}\n\t\t</span>\n\t</button>\n</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
210
276
|
}
|
|
211
277
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
212
278
|
type: Component,
|
|
@@ -216,7 +282,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
216
282
|
useExisting: ToggleComponent,
|
|
217
283
|
multi: true,
|
|
218
284
|
},
|
|
219
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button
|
|
285
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button\n\t\t[class]=\"componentClass()\"\n\t\t(click)=\"handleToggle(); handleClick($event)\"\n\t\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\t\t[disabled]=\"disabledVar\"\n\t>\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\">\n\t\t\t{{ label() }}\n\t\t</span>\n\t</button>\n</label>\n" }]
|
|
220
286
|
}] });
|
|
221
287
|
|
|
222
288
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-toggle.mjs","sources":["../../../projects/sdk/components/forms/toggle/src/toggle.component.ts","../../../projects/sdk/components/forms/toggle/src/toggle.component.html","../../../projects/sdk/components/forms/toggle/sixbell-telco-sdk-components-forms-toggle.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\nimport { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nexport const toggleComponent = cva(\n\t[\n\t\t'text-pretty',\n\t\t'font-body',\n\t\t'leading-normal',\n\t\t'grid',\n\t\t'place-content-center',\n\t\t'rounded-full',\n\t\t'border-[1px]',\n\t\t'border-solid',\n\t\t'transition-colors',\n\t\t'focus-visible:outline',\n\t\t'focus-visible:outline-2',\n\t\t'focus-visible:outline-offset-2',\n\t\t'active:transition-[color, scale, color, background-color, border-color, outline-color, text-decoration-color, fill, stroke]',\n\t\t'active:hover:scale-95',\n\t\t'active:hover:animate-pop',\n\t\t'active:hover:ease-out',\n\t\t'active:hover:animate-duration-0',\n\t\t'active:hover:animate-fill-mode-backwards',\n\t\t'active:focus:scale-95',\n\t\t'active:focus:animate-pop',\n\t\t'active:focus:ease-out',\n\t\t'active:focus:animate-duration-0',\n\t\t'active:focus:animate-fill-mode-backwards',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-primary',\n\t\t\t\t\t'hover:bg-primary/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-primary/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-primary',\n\t\t\t\t\t'hover:active:focus-visible:outline-primary',\n\t\t\t\t\t'hover:active:text-primary-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'primary-toggled': ['bg-primary', 'border-primary', 'text-primary-content', 'hover:bg-primary/40', 'cursor-pointer'],\n\t\t\t\t'primary-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\tsecondary: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-secondary',\n\t\t\t\t\t'hover:bg-secondary/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-secondary/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-secondary',\n\t\t\t\t\t'hover:active:focus-visible:outline-secondary',\n\t\t\t\t\t'hover:active:text-secondary-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'secondary-toggled': ['bg-secondary', 'border-secondary', 'text-secondary-content', 'hover:bg-secondary/40', 'cursor-pointer'],\n\t\t\t\t'secondary-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\tsuccess: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-success',\n\t\t\t\t\t'hover:bg-success/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-success/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-success',\n\t\t\t\t\t'hover:active:focus-visible:outline-success',\n\t\t\t\t\t'hover:active:text-success-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'success-toggled': ['bg-success', 'border-success', 'text-success-content', 'hover:bg-success/40', 'cursor-pointer'],\n\t\t\t\t'success-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\terror: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-error',\n\t\t\t\t\t'hover:bg-error/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-error/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-error',\n\t\t\t\t\t'hover:active:focus-visible:outline-error',\n\t\t\t\t\t'hover:active:text-error-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'error-toggled': ['bg-error', 'border-error', 'text-error-content', 'hover:bg-error/40', 'cursor-pointer'],\n\t\t\t\t'error-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\twarning: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-warning',\n\t\t\t\t\t'hover:bg-warning/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-warning/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-warning',\n\t\t\t\t\t'hover:active:focus-visible:outline-warning',\n\t\t\t\t\t'hover:active:text-warning-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'warning-toggled': ['bg-warning', 'border-warning', 'text-warning-content', 'hover:bg-warning/40', 'cursor-pointer'],\n\t\t\t\t'warning-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\tinfo: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-info',\n\t\t\t\t\t'hover:bg-info/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-info/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-info',\n\t\t\t\t\t'hover:active:focus-visible:outline-info',\n\t\t\t\t\t'hover:active:text-primary-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'info-toggled': ['bg-info', 'border-info', 'text-info-content', 'hover:bg-info/40', 'cursor-pointer'],\n\t\t\t\t'info-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\taccent: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-accent',\n\t\t\t\t\t'hover:bg-accent/40',\n\t\t\t\t\t'hover:text-base-content/100',\n\t\t\t\t\t'hover:active:bg-accent',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-accent',\n\t\t\t\t\t'hover:active:focus-visible:outline-accent',\n\t\t\t\t\t'hover:active:text-accent-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'accent-toggled': ['bg-accent', 'border-accent', 'text-accent-content', 'hover:bg-accent/40', 'cursor-pointer'],\n\t\t\t\t'accent-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tsm: ['h-10', 'w-10'],\n\t\t\t\tmd: ['h-11', 'w-11'],\n\t\t\t\tlg: ['h-12', 'w-12'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'secondary',\n\t\t\tsize: 'sm',\n\t\t},\n\t},\n);\n\nexport type ToggleVariantProps =\n\t| 'primary'\n\t| 'primary-toggled'\n\t| 'primary-disabled'\n\t| 'secondary'\n\t| 'secondary-toggled'\n\t| 'secondary-disabled'\n\t| 'success'\n\t| 'success-toggled'\n\t| 'success-disabled'\n\t| 'error'\n\t| 'error-toggled'\n\t| 'error-disabled'\n\t| 'warning'\n\t| 'warning-toggled'\n\t| 'warning-disabled'\n\t| 'info'\n\t| 'info-toggled'\n\t| 'info-disabled'\n\t| 'accent'\n\t| 'accent-toggled'\n\t| 'accent-disabled'\n\t| null\n\t| undefined;\nexport type ToggleSizeProps = 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type ToggleProps = {\n\tvariant?: ToggleVariantProps;\n\tsize?: ToggleSizeProps;\n};\n\n@Component({\n\tselector: 'st-toggle',\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: ToggleComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './toggle.component.html',\n\tstyles: '',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToggleComponent {\n\t// Base checkbox properties\n\tvariant = input<ToggleVariantProps>();\n\tsize = input<ToggleSizeProps>();\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\n\tvalue = model<boolean>(false);\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\thandleToggle() {\n\t\tthis.value.set(!this.value());\n\t\tthis.handleChange();\n\t}\n\n\t// Change handler\n\tvalueUpdated = output<boolean>();\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.valueUpdated.emit(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// classes\n\tcomponentClass = computed(() => {\n\t\tconst baseVariant = this.variant() ?? 'primary';\n\t\tconst variantSuffix = this.disabled() ? '-disabled' : this.value() ? '-toggled' : '';\n\t\tconst variant = (variantSuffix ? `${baseVariant}${variantSuffix}` : baseVariant) as ToggleVariantProps;\n\n\t\treturn cn(\n\t\t\ttoggleComponent({\n\t\t\t\tvariant,\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t});\n}\n","@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button [class]=\"componentClass()\" (click)=\"handleToggle()\" [disabled]=\"disabledVar\">\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\">\n\t\t\t{{ label() }}\n\t\t</span>\n\t</button>\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;AAOO,MAAM,eAAe,GAAG,GAAG,CACjC;IACC,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,MAAM;IACN,sBAAsB;IACtB,cAAc;IACd,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,uBAAuB;IACvB,yBAAyB;IACzB,gCAAgC;IAChC,6HAA6H;IAC7H,uBAAuB;IACvB,0BAA0B;IAC1B,uBAAuB;IACvB,iCAAiC;IACjC,0CAA0C;IAC1C,uBAAuB;IACvB,0BAA0B;IAC1B,uBAAuB;IACvB,iCAAiC;IACjC,0CAA0C;CAC1C,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE;gBACR,kBAAkB;gBAClB,mBAAmB;gBACnB,sBAAsB;gBACtB,qBAAqB;gBACrB,yBAAyB;gBACzB,6BAA6B;gBAC7B,iCAAiC;gBACjC,qCAAqC;gBACrC,4CAA4C;gBAC5C,mCAAmC;gBACnC,gBAAgB;AAChB,aAAA;YACD,iBAAiB,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,gBAAgB,CAAC;AACpH,YAAA,kBAAkB,EAAE,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,oBAAoB,CAAC;AACzF,YAAA,SAAS,EAAE;gBACV,kBAAkB;gBAClB,mBAAmB;gBACnB,wBAAwB;gBACxB,uBAAuB;gBACvB,yBAAyB;gBACzB,+BAA+B;gBAC/B,iCAAiC;gBACjC,uCAAuC;gBACvC,8CAA8C;g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A,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,SAAA,EAAA,cAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAY9B,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,WACZ,CAAC,WAAW,EAAE,mBAAmB,CAAC,EAChC,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAiB,eAAA;AAC5B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0hBAAA,EAAA;;;AEvMhD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-toggle.mjs","sources":["../../../projects/sdk/components/forms/toggle/src/toggle.component.ts","../../../projects/sdk/components/forms/toggle/src/toggle.component.html","../../../projects/sdk/components/forms/toggle/sixbell-telco-sdk-components-forms-toggle.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\nimport { FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nexport const toggleComponent = cva(\n\t[\n\t\t'text-pretty',\n\t\t'font-body',\n\t\t'leading-normal',\n\t\t'grid',\n\t\t'place-content-center',\n\t\t'rounded-full',\n\t\t'border-[1px]',\n\t\t'border-solid',\n\t\t'transition-colors',\n\t\t'focus-visible:outline',\n\t\t'focus-visible:outline-2',\n\t\t'focus-visible:outline-offset-2',\n\t\t'active:transition-[color, scale, color, background-color, border-color, outline-color, text-decoration-color, fill, stroke]',\n\t\t'active:hover:scale-95',\n\t\t'active:hover:animate-pop',\n\t\t'active:hover:ease-out',\n\t\t'active:hover:animate-duration-0',\n\t\t'active:hover:animate-fill-mode-backwards',\n\t\t'active:focus:scale-95',\n\t\t'active:focus:animate-pop',\n\t\t'active:focus:ease-out',\n\t\t'active:focus:animate-duration-0',\n\t\t'active:focus:animate-fill-mode-backwards',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-primary',\n\t\t\t\t\t'hover:bg-primary/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-primary/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-primary',\n\t\t\t\t\t'hover:active:focus-visible:outline-primary',\n\t\t\t\t\t'hover:active:text-primary-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'primary-toggled': ['bg-primary', 'border-primary', 'text-primary-content', 'hover:bg-primary/40', 'cursor-pointer'],\n\t\t\t\t'primary-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\tsecondary: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-secondary',\n\t\t\t\t\t'hover:bg-secondary/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-secondary/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-secondary',\n\t\t\t\t\t'hover:active:focus-visible:outline-secondary',\n\t\t\t\t\t'hover:active:text-secondary-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'secondary-toggled': ['bg-secondary', 'border-secondary', 'text-secondary-content', 'hover:bg-secondary/40', 'cursor-pointer'],\n\t\t\t\t'secondary-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\tsuccess: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-success',\n\t\t\t\t\t'hover:bg-success/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-success/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-success',\n\t\t\t\t\t'hover:active:focus-visible:outline-success',\n\t\t\t\t\t'hover:active:text-success-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'success-toggled': ['bg-success', 'border-success', 'text-success-content', 'hover:bg-success/40', 'cursor-pointer'],\n\t\t\t\t'success-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\terror: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-error',\n\t\t\t\t\t'hover:bg-error/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-error/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-error',\n\t\t\t\t\t'hover:active:focus-visible:outline-error',\n\t\t\t\t\t'hover:active:text-error-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'error-toggled': ['bg-error', 'border-error', 'text-error-content', 'hover:bg-error/40', 'cursor-pointer'],\n\t\t\t\t'error-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\twarning: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-warning',\n\t\t\t\t\t'hover:bg-warning/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-warning/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-warning',\n\t\t\t\t\t'hover:active:focus-visible:outline-warning',\n\t\t\t\t\t'hover:active:text-warning-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'warning-toggled': ['bg-warning', 'border-warning', 'text-warning-content', 'hover:bg-warning/40', 'cursor-pointer'],\n\t\t\t\t'warning-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\tinfo: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-info',\n\t\t\t\t\t'hover:bg-info/40',\n\t\t\t\t\t'hover:text-base-content',\n\t\t\t\t\t'hover:active:bg-info/100',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-info',\n\t\t\t\t\t'hover:active:focus-visible:outline-info',\n\t\t\t\t\t'hover:active:text-primary-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'info-toggled': ['bg-info', 'border-info', 'text-info-content', 'hover:bg-info/40', 'cursor-pointer'],\n\t\t\t\t'info-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t\taccent: [\n\t\t\t\t\t'border-secondary',\n\t\t\t\t\t'text-base-content',\n\t\t\t\t\t'hover:border-accent',\n\t\t\t\t\t'hover:bg-accent/40',\n\t\t\t\t\t'hover:text-base-content/100',\n\t\t\t\t\t'hover:active:bg-accent',\n\t\t\t\t\t'focus-visible:outline-secondary',\n\t\t\t\t\t'hover:focus-visible:outline-accent',\n\t\t\t\t\t'hover:active:focus-visible:outline-accent',\n\t\t\t\t\t'hover:active:text-accent-content',\n\t\t\t\t\t'cursor-pointer',\n\t\t\t\t],\n\t\t\t\t'accent-toggled': ['bg-accent', 'border-accent', 'text-accent-content', 'hover:bg-accent/40', 'cursor-pointer'],\n\t\t\t\t'accent-disabled': ['border-secondary/50', 'text-base-content/50', 'cursor-not-allowed'],\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tsm: ['h-10', 'w-10'],\n\t\t\t\tmd: ['h-11', 'w-11'],\n\t\t\t\tlg: ['h-12', 'w-12'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'secondary',\n\t\t\tsize: 'sm',\n\t\t},\n\t},\n);\n\nexport type ToggleVariantProps =\n\t| 'primary'\n\t| 'primary-toggled'\n\t| 'primary-disabled'\n\t| 'secondary'\n\t| 'secondary-toggled'\n\t| 'secondary-disabled'\n\t| 'success'\n\t| 'success-toggled'\n\t| 'success-disabled'\n\t| 'error'\n\t| 'error-toggled'\n\t| 'error-disabled'\n\t| 'warning'\n\t| 'warning-toggled'\n\t| 'warning-disabled'\n\t| 'info'\n\t| 'info-toggled'\n\t| 'info-disabled'\n\t| 'accent'\n\t| 'accent-toggled'\n\t| 'accent-disabled'\n\t| null\n\t| undefined;\nexport type ToggleSizeProps = 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type ToggleProps = {\n\tvariant?: ToggleVariantProps;\n\tsize?: ToggleSizeProps;\n};\n\n@Component({\n\tselector: 'st-toggle',\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: ToggleComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './toggle.component.html',\n\tstyles: '',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToggleComponent {\n\t// Base checkbox properties\n\tvariant = input<ToggleVariantProps>();\n\tsize = input<ToggleSizeProps>();\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\n\tvalue = model<boolean>(false);\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\thandleToggle() {\n\t\tthis.value.set(!this.value());\n\t\tthis.handleChange();\n\t}\n\n\t// Change handler\n\tvalueUpdated = output<boolean>();\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input<boolean>(false);\n\n\t/**\n\t * Event emitted on click\n\t */\n\tclicked = output<MouseEvent>();\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on Space keydown\n\t */\n\tkeyDownSpace = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (click or keyboard)\n\t */\n\ttriggered = output<void>();\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.valueUpdated.emit(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t/**\n\t * @internal\n\t * Handle click activation\n\t */\n\thandleClick(event: MouseEvent): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.clicked.emit(event);\n\t\tthis.triggered.emit();\n\t}\n\n\t/**\n\t * @internal\n\t * Handle Enter key activation\n\t */\n\thandleKeyDownEnter(event: Event): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t}\n\n\t/**\n\t * @internal\n\t * Handle Space key activation\n\t */\n\thandleKeyDownSpace(event: Event): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownSpace.emit(event as KeyboardEvent);\n\t}\n\n\t// classes\n\tcomponentClass = computed(() => {\n\t\tconst baseVariant = this.variant() ?? 'primary';\n\t\tconst variantSuffix = this.disabled() ? '-disabled' : this.value() ? '-toggled' : '';\n\t\tconst variant = (variantSuffix ? `${baseVariant}${variantSuffix}` : baseVariant) as ToggleVariantProps;\n\n\t\treturn cn(\n\t\t\ttoggleComponent({\n\t\t\t\tvariant,\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t});\n}\n","@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button\n\t\t[class]=\"componentClass()\"\n\t\t(click)=\"handleToggle(); handleClick($event)\"\n\t\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\t\t[disabled]=\"disabledVar\"\n\t>\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\">\n\t\t\t{{ label() }}\n\t\t</span>\n\t</button>\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;AAOO,MAAM,eAAe,GAAG,GAAG,CACjC;IACC,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,MAAM;IACN,sBAAsB;IACtB,cAAc;IACd,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,uBAAuB;IACvB,yBAAyB;IACzB,gCAAg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