@lucca-front/ng 21.1.0-rc.1 → 21.1.0-rc.2
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/fesm2022/lucca-front-ng-api.mjs +45 -13
- package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-app-layout.mjs +2 -2
- package/fesm2022/lucca-front-ng-app-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-box.mjs +1 -1
- package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-icon.mjs +1 -1
- package/fesm2022/lucca-front-ng-bubble-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-button.mjs +1 -119
- package/fesm2022/lucca-front-ng-button.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs +13 -39
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-chip.mjs +3 -33
- package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-clear.mjs +2 -17
- package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-comment.mjs +18 -20
- package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-container.mjs +7 -5
- package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +2 -0
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-user.mjs +2 -2
- package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +6 -6
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core.mjs +3 -75
- package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +3 -3
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date.mjs +37 -5
- package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +20 -32
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-department.mjs +18 -2
- package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dialog.mjs +3 -3
- package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-divider.mjs +1 -10
- package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-empty-state.mjs +1 -17
- package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-establishment.mjs +66 -2
- package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-fancy-box.mjs +0 -12
- package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills.mjs +3 -3
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-footer.mjs +0 -3
- package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +7 -76
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-header.mjs +0 -3
- package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form.mjs +5 -19
- package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +8 -9
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +34 -51
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +40 -88
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-gauge.mjs +5 -28
- package/fesm2022/lucca-front-ng-gauge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-grid.mjs +3 -3
- package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-data.mjs +26 -31
- package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +0 -3
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-icon.mjs +1 -42
- package/fesm2022/lucca-front-ng-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-index-table.mjs +3 -3
- package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-inline-message.mjs +0 -12
- package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-link.mjs +0 -15
- package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listbox.mjs +6 -18
- package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listing.mjs +8 -37
- package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-main-layout.mjs +2 -8
- package/fesm2022/lucca-front-ng-main-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-mobile-push.mjs +10 -18
- package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-multi-select.mjs +9 -12
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-new-badge.mjs +0 -3
- package/fesm2022/lucca-front-ng-new-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-numeric-badge.mjs +1 -10
- package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-option.mjs +315 -203
- package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-page-header.mjs +0 -9
- package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-pagination.mjs +1 -25
- package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-plg-push.mjs +1 -7
- package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover.mjs +33 -1
- package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +9 -19
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-bar.mjs +5 -12
- package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-read-more.mjs +1 -16
- package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-resource-card.mjs +7 -7
- package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll-box.mjs +2 -5
- package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +3 -9
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control.mjs +1 -16
- package/fesm2022/lucca-front-ng-segmented-control.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +6 -21
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +12 -63
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sortable-list.mjs +1 -25
- package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-status-badge.mjs +0 -12
- package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tag.mjs +1 -7
- package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-time.mjs +16 -55
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tooltip.mjs +22 -6
- package/fesm2022/lucca-front-ng-tooltip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user.mjs +25 -9
- package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs +2 -32
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs.map +1 -1
- package/package.json +5 -7
- package/schematics/action-icon/index.js +5 -4
- package/schematics/action-icon/migration.js +4 -3
- package/schematics/action-icon/migration.spec.js +8 -8
- package/schematics/alignment-utilities/index.js +4 -3
- package/schematics/alignment-utilities/migration.spec.js +8 -8
- package/schematics/cdn-urls/index.js +4 -3
- package/schematics/cdn-urls/migration.js +9 -7
- package/schematics/cdn-urls/migration.spec.js +8 -8
- package/schematics/class-prefix/index.js +4 -3
- package/schematics/class-prefix/migration.spec.js +8 -8
- package/schematics/collection.json +0 -10
- package/schematics/color-text/index.js +4 -3
- package/schematics/color-text/migration.spec.js +8 -8
- package/schematics/component-path/index.js +4 -3
- package/schematics/component-path/migration.spec.js +8 -8
- package/schematics/empty-state-title/index.js +7 -5
- package/schematics/empty-state-title/migration.spec.js +5 -5
- package/schematics/lib/schematic.utils.js +0 -5
- package/schematics/lu-button/index.js +4 -3
- package/schematics/lu-button/migration.js +11 -5
- package/schematics/lu-button/migration.spec.js +5 -5
- package/schematics/lu-icon/index.js +4 -3
- package/schematics/lu-icon/migration.js +14 -8
- package/schematics/lu-icon/migration.spec.js +5 -5
- package/schematics/lu-select/index.js +4 -3
- package/schematics/lu-select/migration.js +21 -18
- package/schematics/lu-select/migration.spec.js +5 -5
- package/schematics/lu-select/util.js +19 -17
- package/schematics/lu-text-input/index.js +4 -3
- package/schematics/lu-text-input/migration.js +28 -22
- package/schematics/lu-text-input/migration.spec.js +5 -5
- package/schematics/new-icons/index.js +6 -5
- package/schematics/new-icons/migration.js +16 -11
- package/schematics/new-icons/migration.spec.js +8 -8
- package/schematics/palettes/index.js +4 -3
- package/schematics/palettes/migration.spec.js +8 -8
- package/schematics/tokens-radius/index.js +4 -3
- package/schematics/tokens-radius/migration.spec.js +8 -8
- package/schematics/tokens-spacing/index.js +4 -3
- package/schematics/tokens-spacing/migration.spec.js +8 -8
- package/schematics/tokens-typo/index.js +4 -3
- package/schematics/tokens-typo/migration.spec.js +8 -8
- package/src/components/cdk/_overlay.scss +0 -5
- package/src/definitions/option/_option-item.scss +0 -1
- package/types/lucca-front-ng-api.d.ts +19 -1
- package/types/lucca-front-ng-breadcrumbs.d.ts +1 -1
- package/types/lucca-front-ng-button.d.ts +1 -61
- package/types/lucca-front-ng-callout.d.ts +2 -32
- package/types/lucca-front-ng-chip.d.ts +2 -32
- package/types/lucca-front-ng-clear.d.ts +5 -20
- package/types/lucca-front-ng-comment.d.ts +11 -19
- package/types/lucca-front-ng-container.d.ts +4 -4
- package/types/lucca-front-ng-core-select.d.ts +1 -2
- package/types/lucca-front-ng-core.d.ts +3 -18
- package/types/lucca-front-ng-date.d.ts +19 -1
- package/types/lucca-front-ng-date2.d.ts +1 -2
- package/types/lucca-front-ng-department.d.ts +10 -1
- package/types/lucca-front-ng-divider.d.ts +0 -10
- package/types/lucca-front-ng-empty-state.d.ts +0 -16
- package/types/lucca-front-ng-establishment.d.ts +37 -1
- package/types/lucca-front-ng-fancy-box.d.ts +0 -12
- package/types/lucca-front-ng-footer.d.ts +0 -3
- package/types/lucca-front-ng-form-field.d.ts +4 -34
- package/types/lucca-front-ng-form-header.d.ts +0 -3
- package/types/lucca-front-ng-form.d.ts +5 -9
- package/types/lucca-front-ng-forms-phone-number-input.d.ts +0 -1
- package/types/lucca-front-ng-forms-rich-text-input.d.ts +0 -2
- package/types/lucca-front-ng-forms.d.ts +4 -16
- package/types/lucca-front-ng-gauge.d.ts +0 -25
- package/types/lucca-front-ng-grid.d.ts +1 -1
- package/types/lucca-front-ng-highlight-data.d.ts +15 -36
- package/types/lucca-front-ng-horizontal-navigation.d.ts +0 -3
- package/types/lucca-front-ng-icon.d.ts +1 -32
- package/types/lucca-front-ng-inline-message.d.ts +0 -12
- package/types/lucca-front-ng-link.d.ts +0 -15
- package/types/lucca-front-ng-listbox.d.ts +4 -16
- package/types/lucca-front-ng-listing.d.ts +2 -33
- package/types/lucca-front-ng-main-layout.d.ts +0 -6
- package/types/lucca-front-ng-mobile-push.d.ts +0 -7
- package/types/lucca-front-ng-new-badge.d.ts +0 -3
- package/types/lucca-front-ng-numeric-badge.d.ts +0 -9
- package/types/lucca-front-ng-option.d.ts +141 -78
- package/types/lucca-front-ng-page-header.d.ts +0 -9
- package/types/lucca-front-ng-pagination.d.ts +0 -24
- package/types/lucca-front-ng-plg-push.d.ts +0 -6
- package/types/lucca-front-ng-popover.d.ts +20 -1
- package/types/lucca-front-ng-popover2.d.ts +3 -5
- package/types/lucca-front-ng-progress-bar.d.ts +0 -9
- package/types/lucca-front-ng-read-more.d.ts +1 -16
- package/types/lucca-front-ng-resource-card.d.ts +0 -6
- package/types/lucca-front-ng-scroll-box.d.ts +1 -4
- package/types/lucca-front-ng-segmented-control-tabs.d.ts +1 -7
- package/types/lucca-front-ng-segmented-control.d.ts +1 -16
- package/types/lucca-front-ng-skeleton.d.ts +6 -61
- package/types/lucca-front-ng-sortable-list.d.ts +0 -24
- package/types/lucca-front-ng-status-badge.d.ts +0 -12
- package/types/lucca-front-ng-tag.d.ts +0 -6
- package/types/lucca-front-ng-time.d.ts +10 -16
- package/types/lucca-front-ng-tooltip.d.ts +11 -2
- package/types/lucca-front-ng-user.d.ts +11 -2
- package/types/lucca-front-ng-vertical-navigation.d.ts +0 -30
- package/fesm2022/lucca-front-ng-text-flow.mjs +0 -20
- package/fesm2022/lucca-front-ng-text-flow.mjs.map +0 -1
- package/schematics/lib/index.js +0 -29
- package/schematics/lu-container/index.js +0 -23
- package/schematics/lu-container/migration.js +0 -116
- package/schematics/lu-container/migration.spec.js +0 -23
- package/schematics/lu-container/schema.json +0 -23
- package/schematics/lu-loading/index.js +0 -23
- package/schematics/lu-loading/migration.js +0 -136
- package/schematics/lu-loading/migration.spec.js +0 -23
- package/schematics/lu-loading/schema.json +0 -28
- package/types/lucca-front-ng-text-flow.d.ts +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-forms-phone-number-input.mjs","sources":["../../../packages/ng/forms/phone-number-input/validators.ts","../../../packages/ng/forms/phone-number-input/phone-number-input.component.ts","../../../packages/ng/forms/phone-number-input/phone-number-input.component.html","../../../packages/ng/forms/phone-number-input/formatter.ts","../../../packages/ng/forms/phone-number-input/phone-number-format.pipe.ts","../../../packages/ng/forms/phone-number-input/lucca-front-ng-forms-phone-number-input.ts"],"sourcesContent":["import { AbstractControl } from '@angular/forms';\nimport { validatePhoneNumberLength, isValidPhoneNumber, CountryCode } from 'libphonenumber-js';\n\nexport class PhoneNumberValidators {\n\tstatic validPhoneNumber(control: AbstractControl<string>, countryCode?: CountryCode) {\n\t\tif (control.value) {\n\t\t\tconst reason = validatePhoneNumberLength(control.value, countryCode);\n\t\t\tif (reason) {\n\t\t\t\treturn { validPhoneNumber: reason };\n\t\t\t}\n\t\t\tif (!isValidPhoneNumber(control.value, countryCode)) {\n\t\t\t\treturn { validPhoneNumber: 'INVALID' };\n\t\t\t}\n\t\t}\n\t\t// Else, everything is fine !\n\t\treturn null;\n\t}\n}\n","import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, LOCALE_ID, output, signal, ViewEncapsulation } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { LuDisplayerDirective, LuOptionDirective } from '@lucca-front/ng/core-select';\nimport { InputDirective, ɵPresentationDisplayDefaultDirective } from '@lucca-front/ng/form-field';\nimport { LuSimpleSelectInputComponent } from '@lucca-front/ng/simple-select';\nimport { type CountryCallingCode, formatIncompletePhoneNumber, getCountries, getCountryCallingCode, getExampleNumber, parsePhoneNumber } from 'libphonenumber-js';\nimport examples from 'libphonenumber-js/mobile/examples';\nimport { CountryCode, E164Number } from './types';\nimport { PhoneNumberValidators } from './validators';\n\ninterface PrefixEntry {\n\tcountry: CountryCode;\n\tprefix: CountryCallingCode;\n\tname: string;\n}\n\ntype ParsePhoneNumberResult = {\n\tnumber: E164Number;\n\tcountry?: CountryCode;\n\tnationalNumber?: string;\n\tisValid: boolean;\n};\n\nfunction tryParsePhoneNumber(phoneNumber: string, countryCode?: CountryCode): ParsePhoneNumberResult {\n\ttry {\n\t\tconst parsedNumber = parsePhoneNumber(phoneNumber, countryCode);\n\t\treturn {\n\t\t\tcountry: parsedNumber.country,\n\t\t\tnumber: parsedNumber.number,\n\t\t\tnationalNumber: parsedNumber.formatNational(),\n\t\t\tisValid: parsedNumber.isValid(),\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tnumber: phoneNumber as E164Number,\n\t\t\tnationalNumber: phoneNumber,\n\t\t\tisValid: false,\n\t\t};\n\t}\n}\n\n@Component({\n\tselector: 'lu-phone-number-input',\n\timports: [LuSimpleSelectInputComponent, FormsModule, LuDisplayerDirective, LuOptionDirective, InputDirective, ɵPresentationDisplayDefaultDirective],\n\ttemplateUrl: './phone-number-input.component.html',\n\tstyleUrl: './phone-number-input.component.scss',\n\tencapsulation: ViewEncapsulation.None,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => PhoneNumberInputComponent),\n\t\t\tmulti: true,\n\t\t},\n\t\t{\n\t\t\tprovide: NG_VALIDATORS,\n\t\t\tuseExisting: forwardRef(() => PhoneNumberInputComponent),\n\t\t\tmulti: true,\n\t\t},\n\t],\n})\nexport class PhoneNumberInputComponent implements ControlValueAccessor, Validator {\n\t#locale = inject(LOCALE_ID);\n\n\treadonly label = input<string>();\n\n\treadonly autocomplete = input<'off' | 'tel'>();\n\n\t/**\n\t * Which countries should be shown? Defaults to empty array which means all of them.\n\t *\n\t * You can use CountryCode to make sure it's properly typed on your end, string is also accepted\n\t */\n\treadonly allowedCountries = input<ReadonlyArray<CountryCode | string>>([]);\n\n\treadonly noAutoPlaceholder = input<boolean>(false);\n\n\treadonly defaultCountryCode = input<CountryCode>(undefined, { alias: 'country' });\n\n\treadonly countryChange = output<CountryCode>();\n\n\treadonly currentValue = signal<string>('');\n\n\t#onChange?: (value: E164Number) => void;\n\n\t#onTouched?: () => void;\n\n\tdisabled = false;\n\n\t#displayNames = new Intl.DisplayNames(this.#locale, { type: 'region' });\n\n\tprefixEntries = getCountries()\n\t\t.map((country) => ({\n\t\t\tcountry,\n\t\t\tprefix: getCountryCallingCode(country),\n\t\t\tname: this.#displayNames.of(country),\n\t\t}))\n\t\t.sort((a, b) => a.name?.localeCompare(b.name));\n\n\treadonly #prefixEntries = computed(() => {\n\t\tconst whitelist = this.allowedCountries();\n\t\tif (whitelist.length === 0) {\n\t\t\treturn this.prefixEntries;\n\t\t}\n\t\treturn this.prefixEntries.filter((e) => whitelist.includes(e.country));\n\t});\n\n\tquery = signal('');\n\n\tprotected prefixesDisplay = computed(() => {\n\t\tconst query = this.query();\n\t\tif (query === '') {\n\t\t\treturn this.#prefixEntries();\n\t\t}\n\t\treturn this.#prefixEntries().filter((entry) => {\n\t\t\treturn entry.country.toLowerCase().includes(query.toLowerCase()) || `+${entry.prefix}`.includes(query) || entry.name?.toLowerCase().includes(query.toLowerCase());\n\t\t});\n\t});\n\n\tcountryCodeSelected = signal<CountryCode | undefined>(undefined);\n\n\tcountryCode = computed(() => this.countryCodeSelected() ?? this.defaultCountryCode());\n\n\tplaceholder = computed(() => {\n\t\tconst exampleNumber = this.noAutoPlaceholder() === false ? getExampleNumber(this.countryCode(), examples) : undefined;\n\t\treturn exampleNumber?.formatNational() ?? '';\n\t});\n\n\tdisplayedNumber = signal<string | undefined>(undefined);\n\n\treadonly prefixEntry = computed(() => this.#prefixEntries().find((p) => p.country === this.countryCode()));\n\n\tprotected getPrefixKey = (prefix: PrefixEntry) => prefix?.country;\n\n\tprotected prefixComparator = (a: PrefixEntry, b: PrefixEntry) => this.getPrefixKey(a) === this.getPrefixKey(b);\n\n\twriteValue(value: string): void {\n\t\ttry {\n\t\t\tif (value) {\n\t\t\t\tconst { country, number, nationalNumber } = tryParsePhoneNumber(value, this.countryCode());\n\t\t\t\tthis.displayedNumber.set(nationalNumber);\n\t\t\t\tthis.countryCodeSelected.set(country);\n\t\t\t\tif (value !== number) {\n\t\t\t\t\tthis.#onChange?.(number);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.displayedNumber.set(undefined);\n\t\t\t}\n\t\t} catch {\n\t\t\tthis.displayedNumber.set(value);\n\t\t}\n\t\tthis.currentValue.set(value);\n\t\tthis.formatNationalNumber();\n\t}\n\n\tregisterOnChange(fn: (value: E164Number) => void): void {\n\t\tthis.#onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.#onTouched = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tupdatePrefix(prefixEntry: PrefixEntry) {\n\t\tthis.countryCodeSelected.set(prefixEntry.country);\n\t\tthis.countryChange.emit(prefixEntry.country);\n\t\tthis.touched();\n\t\tthis.updateModel();\n\t\tthis.formatNationalNumber();\n\t}\n\n\tupdateNumber(number: string) {\n\t\tthis.displayedNumber.set(number);\n\t\tthis.updateModel();\n\t}\n\n\tupdateModel(): void {\n\t\tconst displayedNumber = this.displayedNumber();\n\t\tconst countryCode = this.countryCode();\n\n\t\ttry {\n\t\t\tconst { country, number } = tryParsePhoneNumber(displayedNumber, countryCode);\n\t\t\tif (country && country !== countryCode) {\n\t\t\t\tthis.countryCodeSelected.set(country);\n\t\t\t\tthis.countryChange.emit(country);\n\t\t\t}\n\t\t\tthis.#onChange?.(number);\n\t\t\treturn;\n\t\t} catch {\n\t\t\tthis.#onChange?.(displayedNumber as E164Number);\n\t\t}\n\t}\n\n\ttouched(): void {\n\t\tthis.#onTouched?.();\n\t}\n\n\tformatNationalNumber(): void {\n\t\tconst countryCode = this.countryCode();\n\t\tconst displayedNumber = this.displayedNumber();\n\t\ttry {\n\t\t\tconst { isValid, nationalNumber } = tryParsePhoneNumber(displayedNumber, countryCode);\n\t\t\tif (isValid) {\n\t\t\t\tthis.displayedNumber.set(nationalNumber);\n\t\t\t} else if (countryCode) {\n\t\t\t\tthis.displayedNumber.set(formatIncompletePhoneNumber(displayedNumber, countryCode));\n\t\t\t}\n\t\t} catch {\n\t\t\t// do nothing\n\t\t}\n\t}\n\n\tvalidate(control: AbstractControl<string, string>): ValidationErrors {\n\t\treturn PhoneNumberValidators.validPhoneNumber(control, this.countryCode());\n\t}\n}\n","<fieldset [disabled]=\"disabled\" class=\"phoneNumber-fieldset\">\n\t<legend>\n\t\t<span class=\"pr-u-mask\">{{ label() }}</span>\n\t</legend>\n\t<label>\n\t\t<span class=\"pr-u-mask\">Prefix</span>\n\t\t<lu-simple-select\n\t\t\tignorePresentation\n\t\t\t[options]=\"prefixesDisplay()\"\n\t\t\t[ngModel]=\"prefixEntry()\"\n\t\t\t(ngModelChange)=\"updatePrefix($event)\"\n\t\t\t[ngModelOptions]=\"{ standalone: true }\"\n\t\t\t[optionKey]=\"getPrefixKey\"\n\t\t\t[optionComparer]=\"prefixComparator\"\n\t\t\t(clueChange)=\"query.set($event)\"\n\t\t\tnoClueIcon\n\t\t\t#selectRef\n\t\t\tclass=\"phoneNumber-fieldset-select\"\n\t\t\t[autocomplete]=\"autocomplete() ? (autocomplete() === 'off' ? 'off' : 'tel-country-code') : null\"\n\t\t>\n\t\t\t<ng-container *luOption=\"let prefixOption; select: selectRef\"\n\t\t\t\t><img class=\"phoneNumber-option-flag\" src=\"https://cdn.lucca.fr/assets/misc/flags/{{ prefixOption.country }}.svg\" alt=\"\" />{{\n\t\t\t\t\tprefixOption.name\n\t\t\t\t}}\n\t\t\t\t(+{{ prefixOption.prefix }})\n\t\t\t</ng-container>\n\t\t\t<ng-container *luDisplayer=\"let prefixOption; select: selectRef\"\n\t\t\t\t><img\n\t\t\t\t\tsrc=\"https://cdn.lucca.fr/assets/misc/flags/{{ prefixOption.country }}.svg\"\n\t\t\t\t\talt=\"{{ prefixOption.country }} +{{ prefixOption.prefix }}\"\n\t\t\t\t\tclass=\"phoneNumber-countryCode-flag\"\n\t\t\t\t/>\n\t\t\t</ng-container>\n\t\t</lu-simple-select>\n\t</label>\n\t<label for=\"phoneNumberFieldsetTextfieldInput\" class=\"pr-u-mask\">Number</label>\n\t<div class=\"textField phoneNumber-fieldset-textfield\">\n\t\t<div class=\"textField-input\">\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"phoneNumberFieldsetTextfieldInput\"\n\t\t\t\t[ngModel]=\"displayedNumber()\"\n\t\t\t\t(ngModelChange)=\"updateNumber($event)\"\n\t\t\t\t[ngModelOptions]=\"{ standalone: true }\"\n\t\t\t\t(blur)=\"touched(); formatNationalNumber()\"\n\t\t\t\tluInput\n\t\t\t\tluInputStandalone\n\t\t\t\tclass=\"textField-input-value\"\n\t\t\t\t[attr.autocomplete]=\"autocomplete() ? (autocomplete() === 'off' ? 'off' : 'tel-national') : null\"\n\t\t\t\t[placeholder]=\"placeholder()\"\n\t\t\t/>\n\t\t</div>\n\t</div>\n</fieldset>\n\n<ng-container *luPresentationDisplayDefault>\n\t<a class=\"presentation-description-definition-link\" href=\"tel:{{ currentValue() }}\">{{ currentValue() }}</a>\n</ng-container>\n","import { E164Number, NumberFormat } from './types';\nimport { parsePhoneNumber } from 'libphonenumber-js';\n\nexport class PhoneNumberFormatter {\n\tstatic format(phoneNumber: E164Number, format: NumberFormat = 'NATIONAL'): string {\n\t\treturn parsePhoneNumber(phoneNumber).format(format);\n\t}\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PhoneNumberFormatter } from './formatter';\nimport { E164Number, NumberFormat } from './types';\n\n@Pipe({\n\tname: 'luPhoneNumberFormat',\n})\nexport class PhoneNumberFormatPipe implements PipeTransform {\n\ttransform(value: E164Number, format: NumberFormat = 'NATIONAL'): unknown {\n\t\treturn PhoneNumberFormatter.format(value, format);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵPresentationDisplayDefaultDirective"],"mappings":";;;;;;;;;;MAGa,qBAAqB,CAAA;AACjC,IAAA,OAAO,gBAAgB,CAAC,OAAgC,EAAE,WAAyB,EAAA;AAClF,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YAClB,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC;YACpE,IAAI,MAAM,EAAE;AACX,gBAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE;YACpC;YACA,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE;AACpD,gBAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE;YACvC;QACD;;AAEA,QAAA,OAAO,IAAI;IACZ;AACA;;ACMD,SAAS,mBAAmB,CAAC,WAAmB,EAAE,WAAyB,EAAA;AAC1E,IAAA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AW,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACpD;AACA;;MCAY,qBAAqB,CAAA;AACjC,IAAA,SAAS,CAAC,KAAiB,EAAE,MAAA,GAAuB,UAAU,EAAA;QAC7D,OAAO,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IAClD;8GAHY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACL,oBAAA,IAAI,EAAE,qBAAqB;AAC3B,iBAAA;;;ACND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-forms-phone-number-input.mjs","sources":["../../../packages/ng/forms/phone-number-input/validators.ts","../../../packages/ng/forms/phone-number-input/phone-number-input.component.ts","../../../packages/ng/forms/phone-number-input/phone-number-input.component.html","../../../packages/ng/forms/phone-number-input/formatter.ts","../../../packages/ng/forms/phone-number-input/phone-number-format.pipe.ts","../../../packages/ng/forms/phone-number-input/lucca-front-ng-forms-phone-number-input.ts"],"sourcesContent":["import { AbstractControl } from '@angular/forms';\nimport { validatePhoneNumberLength, isValidPhoneNumber, CountryCode } from 'libphonenumber-js';\n\nexport class PhoneNumberValidators {\n\tstatic validPhoneNumber(control: AbstractControl<string>, countryCode?: CountryCode) {\n\t\tif (control.value) {\n\t\t\tconst reason = validatePhoneNumberLength(control.value, countryCode);\n\t\t\tif (reason) {\n\t\t\t\treturn { validPhoneNumber: reason };\n\t\t\t}\n\t\t\tif (!isValidPhoneNumber(control.value, countryCode)) {\n\t\t\t\treturn { validPhoneNumber: 'INVALID' };\n\t\t\t}\n\t\t}\n\t\t// Else, everything is fine !\n\t\treturn null;\n\t}\n}\n","import { ChangeDetectionStrategy, Component, computed, forwardRef, inject, input, LOCALE_ID, output, signal, ViewEncapsulation } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator } from '@angular/forms';\nimport { LuDisplayerDirective, LuOptionDirective } from '@lucca-front/ng/core-select';\nimport { FormFieldComponent, InputDirective } from '@lucca-front/ng/form-field';\nimport { TextInputComponent } from '@lucca-front/ng/forms';\nimport { LuSimpleSelectInputComponent } from '@lucca-front/ng/simple-select';\nimport { type CountryCallingCode, formatIncompletePhoneNumber, getCountries, getCountryCallingCode, getExampleNumber, parsePhoneNumber } from 'libphonenumber-js';\nimport examples from 'libphonenumber-js/mobile/examples';\nimport { CountryCode, E164Number } from './types';\nimport { PhoneNumberValidators } from './validators';\n\ninterface PrefixEntry {\n\tcountry: CountryCode;\n\tprefix: CountryCallingCode;\n\tname: string;\n}\n\ntype ParsePhoneNumberResult = {\n\tnumber: E164Number;\n\tcountry?: CountryCode;\n\tnationalNumber?: string;\n\tisValid: boolean;\n};\n\nfunction tryParsePhoneNumber(phoneNumber: string, countryCode?: CountryCode): ParsePhoneNumberResult {\n\ttry {\n\t\tconst parsedNumber = parsePhoneNumber(phoneNumber, countryCode);\n\t\treturn {\n\t\t\tcountry: parsedNumber.country,\n\t\t\tnumber: parsedNumber.number,\n\t\t\tnationalNumber: parsedNumber.formatNational(),\n\t\t\tisValid: parsedNumber.isValid(),\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tnumber: phoneNumber as E164Number,\n\t\t\tnationalNumber: phoneNumber,\n\t\t\tisValid: false,\n\t\t};\n\t}\n}\n\n@Component({\n\tselector: 'lu-phone-number-input',\n\timports: [LuSimpleSelectInputComponent, TextInputComponent, FormsModule, LuDisplayerDirective, LuOptionDirective, InputDirective, FormFieldComponent],\n\ttemplateUrl: './phone-number-input.component.html',\n\tstyleUrl: './phone-number-input.component.scss',\n\tencapsulation: ViewEncapsulation.None,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => PhoneNumberInputComponent),\n\t\t\tmulti: true,\n\t\t},\n\t\t{\n\t\t\tprovide: NG_VALIDATORS,\n\t\t\tuseExisting: forwardRef(() => PhoneNumberInputComponent),\n\t\t\tmulti: true,\n\t\t},\n\t],\n})\nexport class PhoneNumberInputComponent implements ControlValueAccessor, Validator {\n\t#locale = inject(LOCALE_ID);\n\n\treadonly label = input<string>();\n\n\treadonly autocomplete = input<'off' | 'tel'>();\n\n\t/**\n\t * Which countries should be shown? Defaults to empty array which means all of them.\n\t *\n\t * You can use CountryCode to make sure it's properly typed on your end, string is also accepted\n\t */\n\treadonly allowedCountries = input<ReadonlyArray<CountryCode | string>>([]);\n\n\treadonly noAutoPlaceholder = input<boolean>(false);\n\n\treadonly defaultCountryCode = input<CountryCode>(undefined, { alias: 'country' });\n\n\treadonly countryChange = output<CountryCode>();\n\n\t#onChange?: (value: E164Number) => void;\n\n\t#onTouched?: () => void;\n\n\tdisabled = false;\n\n\t#displayNames = new Intl.DisplayNames(this.#locale, { type: 'region' });\n\n\tprefixEntries = getCountries()\n\t\t.map((country) => ({\n\t\t\tcountry,\n\t\t\tprefix: getCountryCallingCode(country),\n\t\t\tname: this.#displayNames.of(country),\n\t\t}))\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n\n\treadonly #prefixEntries = computed(() => {\n\t\tconst whitelist = this.allowedCountries();\n\t\tif (whitelist.length === 0) {\n\t\t\treturn this.prefixEntries;\n\t\t}\n\t\treturn this.prefixEntries.filter((e) => whitelist.includes(e.country));\n\t});\n\n\tquery = signal('');\n\n\tprotected prefixesDisplay = computed(() => {\n\t\tconst query = this.query();\n\t\tif (query === '') {\n\t\t\treturn this.#prefixEntries();\n\t\t}\n\t\treturn this.#prefixEntries().filter((entry) => {\n\t\t\treturn entry.country.toLowerCase().includes(query.toLowerCase()) || `+${entry.prefix}`.includes(query) || entry.name.toLowerCase().includes(query.toLowerCase());\n\t\t});\n\t});\n\n\tcountryCodeSelected = signal<CountryCode | undefined>(undefined);\n\n\tcountryCode = computed(() => this.countryCodeSelected() ?? this.defaultCountryCode());\n\n\tplaceholder = computed(() => {\n\t\tconst exampleNumber = this.noAutoPlaceholder() === false ? getExampleNumber(this.countryCode(), examples) : undefined;\n\t\treturn exampleNumber?.formatNational() ?? '';\n\t});\n\n\tdisplayedNumber = signal<string | undefined>(undefined);\n\n\treadonly prefixEntry = computed(() => this.#prefixEntries().find((p) => p.country === this.countryCode()));\n\n\tprotected getPrefixKey = (prefix: PrefixEntry) => prefix?.country;\n\n\tprotected prefixComparator = (a: PrefixEntry, b: PrefixEntry) => this.getPrefixKey(a) === this.getPrefixKey(b);\n\n\twriteValue(value: string): void {\n\t\ttry {\n\t\t\tif (value) {\n\t\t\t\tconst { country, number, nationalNumber } = tryParsePhoneNumber(value, this.countryCode());\n\t\t\t\tthis.displayedNumber.set(nationalNumber);\n\t\t\t\tthis.countryCodeSelected.set(country);\n\t\t\t\tif (value !== number) {\n\t\t\t\t\tthis.#onChange?.(number);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.displayedNumber.set(undefined);\n\t\t\t}\n\t\t} catch {\n\t\t\tthis.displayedNumber.set(value);\n\t\t}\n\t\tthis.formatNationalNumber();\n\t}\n\n\tregisterOnChange(fn: (value: E164Number) => void): void {\n\t\tthis.#onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.#onTouched = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tupdatePrefix(prefixEntry: PrefixEntry) {\n\t\tthis.countryCodeSelected.set(prefixEntry.country);\n\t\tthis.countryChange.emit(prefixEntry.country);\n\t\tthis.touched();\n\t\tthis.updateModel();\n\t\tthis.formatNationalNumber();\n\t}\n\n\tupdateNumber(number: string) {\n\t\tthis.displayedNumber.set(number);\n\t\tthis.updateModel();\n\t}\n\n\tupdateModel(): void {\n\t\tconst displayedNumber = this.displayedNumber();\n\t\tconst countryCode = this.countryCode();\n\n\t\ttry {\n\t\t\tconst { country, number } = tryParsePhoneNumber(displayedNumber, countryCode);\n\t\t\tif (country && country !== countryCode) {\n\t\t\t\tthis.countryCodeSelected.set(country);\n\t\t\t\tthis.countryChange.emit(country);\n\t\t\t}\n\t\t\tthis.#onChange?.(number);\n\t\t\treturn;\n\t\t} catch {\n\t\t\tthis.#onChange?.(displayedNumber as E164Number);\n\t\t}\n\t}\n\n\ttouched(): void {\n\t\tthis.#onTouched?.();\n\t}\n\n\tformatNationalNumber(): void {\n\t\tconst countryCode = this.countryCode();\n\t\tconst displayedNumber = this.displayedNumber();\n\t\ttry {\n\t\t\tconst { isValid, nationalNumber } = tryParsePhoneNumber(displayedNumber, countryCode);\n\t\t\tif (isValid) {\n\t\t\t\tthis.displayedNumber.set(nationalNumber);\n\t\t\t} else if (countryCode) {\n\t\t\t\tthis.displayedNumber.set(formatIncompletePhoneNumber(displayedNumber, countryCode));\n\t\t\t}\n\t\t} catch {\n\t\t\t// do nothing\n\t\t}\n\t}\n\n\tvalidate(control: AbstractControl<string, string>): ValidationErrors {\n\t\treturn PhoneNumberValidators.validPhoneNumber(control, this.countryCode());\n\t}\n}\n","<fieldset [disabled]=\"disabled\" class=\"phoneNumber-fieldset\">\n\t<legend>\n\t\t<span class=\"pr-u-mask\">{{ label() }}</span>\n\t</legend>\n\t<label>\n\t\t<span class=\"pr-u-mask\">Prefix</span>\n\t\t<lu-simple-select\n\t\t\t[options]=\"prefixesDisplay()\"\n\t\t\t[ngModel]=\"prefixEntry()\"\n\t\t\t(ngModelChange)=\"updatePrefix($event)\"\n\t\t\t[ngModelOptions]=\"{ standalone: true }\"\n\t\t\t[optionKey]=\"getPrefixKey\"\n\t\t\t[optionComparer]=\"prefixComparator\"\n\t\t\t(clueChange)=\"query.set($event)\"\n\t\t\tnoClueIcon\n\t\t\t#selectRef\n\t\t\tclass=\"phoneNumber-fieldset-select\"\n\t\t\t[autocomplete]=\"autocomplete() ? (autocomplete() === 'off' ? 'off' : 'tel-country-code') : null\"\n\t\t>\n\t\t\t<ng-container *luOption=\"let prefixOption; select: selectRef\"\n\t\t\t\t><img class=\"phoneNumber-option-flag\" src=\"https://cdn.lucca.fr/assets/misc/flags/{{ prefixOption.country }}.svg\" alt=\"\" />{{\n\t\t\t\t\tprefixOption.name\n\t\t\t\t}}\n\t\t\t\t(+{{ prefixOption.prefix }})\n\t\t\t</ng-container>\n\t\t\t<ng-container *luDisplayer=\"let prefixOption; select: selectRef\"\n\t\t\t\t><img\n\t\t\t\t\tsrc=\"https://cdn.lucca.fr/assets/misc/flags/{{ prefixOption.country }}.svg\"\n\t\t\t\t\talt=\"{{ prefixOption.country }} +{{ prefixOption.prefix }}\"\n\t\t\t\t\tclass=\"phoneNumber-countryCode-flag\"\n\t\t\t\t/>\n\t\t\t</ng-container>\n\t\t</lu-simple-select>\n\t</label>\n\t<label for=\"phoneNumberFieldsetTextfieldInput\" class=\"pr-u-mask\">Number</label>\n\t<div class=\"textField phoneNumber-fieldset-textfield\">\n\t\t<div class=\"textField-input\">\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"phoneNumberFieldsetTextfieldInput\"\n\t\t\t\t[ngModel]=\"displayedNumber()\"\n\t\t\t\t(ngModelChange)=\"updateNumber($event)\"\n\t\t\t\t[ngModelOptions]=\"{ standalone: true }\"\n\t\t\t\t(blur)=\"touched(); formatNationalNumber()\"\n\t\t\t\tluInput\n\t\t\t\tluInputStandalone\n\t\t\t\tclass=\"textField-input-value\"\n\t\t\t\t[attr.autocomplete]=\"autocomplete() ? (autocomplete() === 'off' ? 'off' : 'tel-national') : null\"\n\t\t\t\t[placeholder]=\"placeholder()\"\n\t\t\t/>\n\t\t</div>\n\t</div>\n</fieldset>\n","import { E164Number, NumberFormat } from './types';\nimport { parsePhoneNumber } from 'libphonenumber-js';\n\nexport class PhoneNumberFormatter {\n\tstatic format(phoneNumber: E164Number, format: NumberFormat = 'NATIONAL'): string {\n\t\treturn parsePhoneNumber(phoneNumber).format(format);\n\t}\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PhoneNumberFormatter } from './formatter';\nimport { E164Number, NumberFormat } from './types';\n\n@Pipe({\n\tname: 'luPhoneNumberFormat',\n})\nexport class PhoneNumberFormatPipe implements PipeTransform {\n\ttransform(value: E164Number, format: NumberFormat = 'NATIONAL'): unknown {\n\t\treturn PhoneNumberFormatter.format(value, format);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAGa,qBAAqB,CAAA;AACjC,IAAA,OAAO,gBAAgB,CAAC,OAAgC,EAAE,WAAyB,EAAA;AAClF,QAAA,IAAI,OAAO,CAAC,KAAK,EAAE;YAClB,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC;YACpE,IAAI,MAAM,EAAE;AACX,gBAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE;YACpC;YACA,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE;AACpD,gBAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE;YACvC;QACD;;AAEA,QAAA,OAAO,IAAI;IACZ;AACA;;ACOD,SAAS,mBAAmB,CAAC,WAAmB,EAAE,WAAyB,EAAA;AAC1E,IAAA,IAAI;QACH,MAAM,YAAY,GAAG,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC;QAC/D,OAAO;YACN,OAAO,EAAE,YAAY,CAAC,OAAO;YAC7B,MAAM,EAAE,YAAY,CAAC,MAAM;AAC3B,YAAA,cAAc,EAAE,YAAY,CAAC,cAAc,EAAE;AAC7C,YAAA,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE;SAC/B;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a;AACtB,4BAAA,WAAW,EAAE,UAAU,CAAC,+BAA+B,CAAC;AACxD,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,mmEAAA,EAAA,MAAA,EAAA,CAAA,gaAAA,CAAA,EAAA;;;MEzDW,oBAAoB,CAAA;AAChC,IAAA,OAAO,MAAM,CAAC,WAAuB,EAAE,SAAuB,UAAU,EAAA;QACvE,OAAO,gBAAgB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACpD;AACA;;MCAY,qBAAqB,CAAA;AACjC,IAAA,SAAS,CAAC,KAAiB,EAAE,MAAA,GAAuB,UAAU,EAAA;QAC7D,OAAO,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IAClD;8GAHY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACL,oBAAA,IAAI,EAAE,qBAAqB;AAC3B,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, input, booleanAttribute, viewChild, ElementRef, contentChildren, signal, computed,
|
|
2
|
+
import { InjectionToken, inject, input, booleanAttribute, viewChild, ElementRef, contentChildren, signal, computed, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, DestroyRef, ViewContainerRef, TemplateRef, viewChildren, effect } from '@angular/core';
|
|
3
3
|
import { ButtonComponent } from '@lucca-front/ng/button';
|
|
4
4
|
import { intlInputOptions } from '@lucca-front/ng/core';
|
|
5
5
|
import { IconComponent } from '@lucca-front/ng/icon';
|
|
6
6
|
import { LuTooltipTriggerDirective } from '@lucca-front/ng/tooltip';
|
|
7
|
-
import * as i1 from '@angular/common';
|
|
8
7
|
import { CommonModule } from '@angular/common';
|
|
9
|
-
import * as i1
|
|
8
|
+
import * as i1 from '@angular/forms';
|
|
10
9
|
import { NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule, FormGroup, Validators } from '@angular/forms';
|
|
11
10
|
import { registerHistory, createEmptyHistoryState } from '@lexical/history';
|
|
12
11
|
import { $isRootTextContentEmpty, $canShowPlaceholderCurry } from '@lexical/text';
|
|
13
12
|
import { mergeRegister, $getNearestNodeOfType } from '@lexical/utils';
|
|
14
|
-
import { FormFieldComponent, InputDirective
|
|
13
|
+
import { FormFieldComponent, InputDirective } from '@lucca-front/ng/form-field';
|
|
15
14
|
import { createEditor, $getRoot, $createTextNode, createCommand, $getSelection, $isRangeSelection, $isTextNode, $createParagraphNode, COMMAND_PRIORITY_NORMAL, SELECTION_CHANGE_COMMAND, INSERT_PARAGRAPH_COMMAND, DecoratorNode, TextNode, $getNodeByKey, FORMAT_TEXT_COMMAND } from 'lexical';
|
|
16
15
|
import { $isAtNodeEnd, $setBlocksType } from '@lexical/selection';
|
|
17
16
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
@@ -49,16 +48,6 @@ const INITIAL_UPDATE_TAG = 'initial-update';
|
|
|
49
48
|
const SKIP_DOM_SELECTION_TAG = 'skip-dom-selection';
|
|
50
49
|
const RICH_TEXT_PLUGIN_COMPONENT = new InjectionToken('RichTextPlugin');
|
|
51
50
|
class RichTextInputComponent {
|
|
52
|
-
#richTextFormatter;
|
|
53
|
-
#formField;
|
|
54
|
-
#customNodes;
|
|
55
|
-
#allPlugins;
|
|
56
|
-
#isTouched;
|
|
57
|
-
#onChange;
|
|
58
|
-
#onTouch;
|
|
59
|
-
#cleanup;
|
|
60
|
-
#focusedPlugin;
|
|
61
|
-
#editor;
|
|
62
51
|
constructor() {
|
|
63
52
|
this.#richTextFormatter = inject(RICH_TEXT_FORMATTER);
|
|
64
53
|
this.#formField = inject(FormFieldComponent, { optional: true });
|
|
@@ -66,8 +55,9 @@ class RichTextInputComponent {
|
|
|
66
55
|
this.disableSpellcheck = input(false, { ...(ngDevMode ? { debugName: "disableSpellcheck" } : {}), transform: booleanAttribute });
|
|
67
56
|
this.autoResize = input(false, { ...(ngDevMode ? { debugName: "autoResize" } : {}), transform: booleanAttribute });
|
|
68
57
|
this.hideToolbar = input(false, { ...(ngDevMode ? { debugName: "hideToolbar" } : {}), transform: booleanAttribute });
|
|
69
|
-
this.content = viewChild('content', {
|
|
70
|
-
|
|
58
|
+
this.content = viewChild.required('content', {
|
|
59
|
+
read: ElementRef,
|
|
60
|
+
});
|
|
71
61
|
this.pluginComponents = contentChildren(RICH_TEXT_PLUGIN_COMPONENT, { ...(ngDevMode ? { debugName: "pluginComponents" } : {}), descendants: true });
|
|
72
62
|
this.currentCanShowPlaceholder = signal(false, ...(ngDevMode ? [{ debugName: "currentCanShowPlaceholder" }] : []));
|
|
73
63
|
this.isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
@@ -78,17 +68,17 @@ class RichTextInputComponent {
|
|
|
78
68
|
this.#allPlugins = computed(() => this.#flattenPlugins(this.pluginComponents()), ...(ngDevMode ? [{ debugName: "#allPlugins" }] : []));
|
|
79
69
|
this.#isTouched = signal(false, ...(ngDevMode ? [{ debugName: "#isTouched" }] : []));
|
|
80
70
|
this.#focusedPlugin = 0;
|
|
81
|
-
effect(() => {
|
|
82
|
-
if (this.#formField?.presentation() && this.contentPresentation()) {
|
|
83
|
-
this.#editor?.setRootElement(this.contentPresentation()?.nativeElement);
|
|
84
|
-
this.#editor?.setEditable(false);
|
|
85
|
-
}
|
|
86
|
-
else if (this.content()) {
|
|
87
|
-
this.#editor?.setRootElement(this.content()?.nativeElement);
|
|
88
|
-
this.#editor?.setEditable(true);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
71
|
}
|
|
72
|
+
#richTextFormatter;
|
|
73
|
+
#formField;
|
|
74
|
+
#customNodes;
|
|
75
|
+
#allPlugins;
|
|
76
|
+
#isTouched;
|
|
77
|
+
#onChange;
|
|
78
|
+
#onTouch;
|
|
79
|
+
#cleanup;
|
|
80
|
+
#focusedPlugin;
|
|
81
|
+
#editor;
|
|
92
82
|
ngOnInit() {
|
|
93
83
|
this.#editor = createEditor({
|
|
94
84
|
theme: {
|
|
@@ -102,6 +92,7 @@ class RichTextInputComponent {
|
|
|
102
92
|
nodes: [...this.#customNodes()],
|
|
103
93
|
});
|
|
104
94
|
this.#cleanup = mergeRegister(this.#richTextFormatter.registerTextPlugin(this.#editor), registerHistory(this.#editor, createEmptyHistoryState(), 300), this.#editor.registerUpdateListener((payload) => this.#onEditorUpdate(payload)));
|
|
95
|
+
this.#editor.setRootElement(this.content().nativeElement);
|
|
105
96
|
this.pluginComponents().forEach((plugin) => plugin.setEditorInstance(this.#editor));
|
|
106
97
|
if (this.#allPlugins().length > 0) {
|
|
107
98
|
this.#allPlugins()[this.#focusedPlugin].tabindex?.set(0);
|
|
@@ -118,7 +109,7 @@ class RichTextInputComponent {
|
|
|
118
109
|
}, { tag: updateTags });
|
|
119
110
|
}
|
|
120
111
|
else if (!this.#editor?.getEditorState().isEmpty()) {
|
|
121
|
-
this.#editor
|
|
112
|
+
this.#editor.update(() => {
|
|
122
113
|
const root = $getRoot();
|
|
123
114
|
root.clear();
|
|
124
115
|
}, { tag: updateTags });
|
|
@@ -141,13 +132,13 @@ class RichTextInputComponent {
|
|
|
141
132
|
const nextFocusedPlugin = this.#focusedPlugin + direction < 0 ? plugins.length - 1 : (this.#focusedPlugin + direction) % plugins.length;
|
|
142
133
|
if (plugins[nextFocusedPlugin].tabindex()) {
|
|
143
134
|
plugins[this.#focusedPlugin].tabindex?.set(-1);
|
|
144
|
-
plugins[nextFocusedPlugin].tabindex
|
|
135
|
+
plugins[nextFocusedPlugin].tabindex.set(0);
|
|
145
136
|
}
|
|
146
137
|
this.#focusedPlugin = nextFocusedPlugin;
|
|
147
138
|
plugins[this.#focusedPlugin].focus();
|
|
148
139
|
}
|
|
149
140
|
focus() {
|
|
150
|
-
this.content()
|
|
141
|
+
this.content().nativeElement.focus();
|
|
151
142
|
}
|
|
152
143
|
touch() {
|
|
153
144
|
this.#isTouched.set(true);
|
|
@@ -164,9 +155,9 @@ class RichTextInputComponent {
|
|
|
164
155
|
});
|
|
165
156
|
}
|
|
166
157
|
#onEditorUpdate({ tags, dirtyElements }) {
|
|
167
|
-
const isComposing = this.#editor
|
|
158
|
+
const isComposing = this.#editor.isComposing();
|
|
168
159
|
if (!tags.has(INITIAL_UPDATE_TAG) && dirtyElements.size) {
|
|
169
|
-
this.#editor
|
|
160
|
+
this.#editor.read(() => {
|
|
170
161
|
let result = '';
|
|
171
162
|
// ignore empty nodes
|
|
172
163
|
if (!$isRootTextContentEmpty(isComposing, false)) {
|
|
@@ -176,7 +167,7 @@ class RichTextInputComponent {
|
|
|
176
167
|
this.#onChange?.(result);
|
|
177
168
|
});
|
|
178
169
|
}
|
|
179
|
-
const currentCanShowPlaceholder = this.#editor
|
|
170
|
+
const currentCanShowPlaceholder = this.#editor.getEditorState().read($canShowPlaceholderCurry(isComposing));
|
|
180
171
|
this.currentCanShowPlaceholder.set(currentCanShowPlaceholder);
|
|
181
172
|
}
|
|
182
173
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: RichTextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -186,20 +177,18 @@ class RichTextInputComponent {
|
|
|
186
177
|
useExisting: forwardRef(() => RichTextInputComponent),
|
|
187
178
|
multi: true,
|
|
188
179
|
},
|
|
189
|
-
], queries: [{ propertyName: "pluginComponents", predicate: RICH_TEXT_PLUGIN_COMPONENT, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, isSignal: true }
|
|
180
|
+
], queries: [{ propertyName: "pluginComponents", predicate: RICH_TEXT_PLUGIN_COMPONENT, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div class=\"richTextField\" [class.is-disabled]=\"isDisabled()\" [class.mod-autoResize]=\"autoResize()\">\n\t<div\n\t\t#content\n\t\tluInput\n\t\tclass=\"richTextField-content textFlow\"\n\t\trole=\"textbox\"\n\t\t[attr.contenteditable]=\"!isDisabled()\"\n\t\t[attr.aria-disabled]=\"isDisabled()\"\n\t\t[attr.aria-placeholder]=\"currentCanShowPlaceholder() ? placeholder() : null\"\n\t\t[attr.aria-labelledby]=\"formFieldId() + '-label'\"\n\t\t[attr.spellcheck]=\"!disableSpellcheck()\"\n\t\t(blur)=\"touch()\"\n\t></div>\n\t@if (currentCanShowPlaceholder()) {\n\t\t<div aria-hidden=\"true\" class=\"richTextField-content-placeholder\">{{ placeholder() }}</div>\n\t}\n\t<div\n\t\tclass=\"richTextField-toolbar\"\n\t\t[class.pr-u-displayNone]=\"hideToolbar()\"\n\t\t(keydown.arrowleft)=\"focusSiblingPlugin($event, -1)\"\n\t\t(keydown.arrowRight)=\"focusSiblingPlugin($event, 1)\"\n\t\trole=\"toolbar\"\n\t\t[attr.aria-labelledby]=\"formFieldId() + '-label'\"\n\t\t[attr.aria-controls]=\"formFieldId()\"\n\t>\n\t\t<ng-content />\n\t</div>\n</div>\n", styles: ["@layer components{.richTextField{--components-richTextField-borderColor: var(--pr-t-color-input-border);--components-richTextField-backgroundColor: var(--pr-t-color-input-background);--components-richTextField-color: var(--pr-t-color-input-text);--components-richTextField-toolbar-backgroundColor: var(--palettes-neutral-25);--components-richTextField-toolbar-display: block;--components-richTextField-resize: vertical;--components-richTextField-height: 3lh;--components-richTextField-minHeight: 2lh;--components-richTextField-maxHeight: 90dvh;--components-richTextField-placeholder-color: var(--pr-t-color-input-text-placeholder);display:flex;flex-direction:column;flex-grow:1;overflow:auto;background-color:var(--components-richTextField-backgroundColor);color:var(--components-richTextField-color);border-color:var(--components-richTextField-borderColor);border-style:solid;border-width:1px;border-radius:var(--pr-t-border-radius-input);resize:var(--components-richTextField-resize);min-block-size:calc(var(--components-richTextField-minHeight) + var(--pr-t-spacings-800) + var(--pr-t-spacings-25));max-block-size:var(--components-richTextField-maxHeight);block-size:calc(var(--components-richTextField-height) + var(--pr-t-spacings-800) + var(--pr-t-spacings-25))}.richTextField:has(.richTextField-toolbar-formatting):has(.richTextField-toolbar-chips){min-block-size:calc(var(--components-richTextField-minHeight) + var(--pr-t-spacings-800) + var(--pr-t-spacings-25) + var(--pr-t-spacings-600))}.richTextField:has(.richTextField-toolbar-formatting):has(.richTextField-toolbar-chips) .richTextField-toolbar-chips{border-block-start:1px solid var(--palettes-neutral-200);padding-block-start:var(--pr-t-spacings-100)}.richTextField:has(.richTextField-toolbar-formatting):has(.richTextField-toolbar-chips) .richTextField-toolbar-formatting{padding-block-end:var(--pr-t-spacings-100)}.richTextField-toolbar{display:var(--components-richTextField-toolbar-display);background-color:var(--components-richTextField-toolbar-backgroundColor);border-radius:0 0 var(--pr-t-border-radius-input) var(--pr-t-border-radius-input);padding:var(--pr-t-spacings-100);overflow:hidden;animation-name:fadeIn;animation-duration:var(--commons-animations-durations-fast);animation-delay:var(--commons-animations-durations-fast);opacity:0;flex-shrink:0;animation-fill-mode:forwards}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.richTextField-toolbar-formatting{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--pr-t-spacings-400);flex-shrink:0}.richTextField-toolbar-formatting:empty{display:none}.richTextField-toolbar-col{display:flex;flex-wrap:wrap;align-items:center;row-gap:var(--pr-t-spacings-100);margin-inline-start:calc(var(--pr-t-spacings-400) * -1)}.richTextField-toolbar-col-group{display:flex;flex-wrap:wrap;align-items:center}.richTextField-toolbar-col-group:not(:only-child){position:relative;margin-inline-start:var(--pr-t-spacings-400)}.richTextField-toolbar-col-group:not(:only-child):before{content:\"\";position:absolute;inset:var(--pr-t-spacings-100) auto var(--pr-t-spacings-100) calc(var(--pr-t-spacings-400) / -2);inline-size:2px;border-radius:var(--pr-t-border-radius-full);background-color:var(--palettes-neutral-300)}.richTextField-toolbar-col-group .richTextField-toolbar-col-group{display:contents}.richTextField-toolbar-chips{display:flex;flex-wrap:wrap;gap:var(--pr-t-spacings-50);padding-block-start:0;border-block-start:0}.richTextField-toolbar-chips-chip{border:0}.richTextField-toolbar-chips-chip:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField-content{padding:var(--pr-t-spacings-100);outline:none;overflow:auto;flex-grow:1}.richTextField-content-chip{vertical-align:middle}.richTextField-content-chip:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField-content-placeholder{position:absolute;pointer-events:none;padding:var(--pr-t-spacings-100);-webkit-user-select:none;user-select:none;color:var(--components-richTextField-placeholder-color)}}@layer mods{.richTextField:has(.richTextField-content:focus-visible){outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField:hover{--components-richTextField-borderColor: var(--pr-t-color-input-border-hover)}.richTextField:has(.richTextField-content[aria-invalid=true]){--components-richTextField-borderColor: var(--pr-t-color-input-border-critical);--components-richTextField-backgroundColor: var(--pr-t-color-input-background-critical);--components-richTextField-placeholder-color: var(--pr-t-color-input-text-placeholder-critical)}.richTextField:has(.richTextField-content[aria-invalid=true]):hover{--components-richTextField-borderColor: var(--pr-t-color-input-border-critical-hover)}.richTextField.is-disabled{--components-richTextField-backgroundColor: var(--pr-t-color-input-background-disabled);--components-richTextField-toolbar-backgroundColor: var(--pr-t-color-input-background-disabled);--components-richTextField-toolbar-display: none;--components-richTextField-color: var(--pr-t-color-input-text-disabled);--components-richTextField-borderColor: var(--pr-t-color-input-border)}.richTextField.mod-autoResize{--components-richTextField-minHeight: 3lh;--components-richTextField-height: auto;--components-richTextField-resize: none}}@layer mods{.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]{--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-700, var(--palettes-product-700))}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:hover{--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-600, var(--palettes-product-600))}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:active{--components-button-backgroundColor: var(--palettes-800, var(--palettes-product-800))}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:disabled{--components-button-color: var(--commons-disabled-background);--components-button-backgroundColor: var(--palettes-neutral-500)}}\n"], dependencies: [{ kind: "directive", type: InputDirective, selector: "[luInput]", inputs: ["luInputStandalone"] }, { kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
190
181
|
}
|
|
191
182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: RichTextInputComponent, decorators: [{
|
|
192
183
|
type: Component,
|
|
193
|
-
args: [{ selector: 'lu-rich-text-input', imports: [InputDirective, CommonModule
|
|
184
|
+
args: [{ selector: 'lu-rich-text-input', imports: [InputDirective, CommonModule], encapsulation: ViewEncapsulation.None, providers: [
|
|
194
185
|
{
|
|
195
186
|
provide: NG_VALUE_ACCESSOR,
|
|
196
187
|
useExisting: forwardRef(() => RichTextInputComponent),
|
|
197
188
|
multi: true,
|
|
198
189
|
},
|
|
199
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"richTextField\" [class.is-disabled]=\"isDisabled()\" [class.mod-autoResize]=\"autoResize()\">\n\t<div\n\t\t#content\n\t\tluInput\n\t\tclass=\"richTextField-content textFlow\"\n\t\trole=\"textbox\"\n\t\t[attr.contenteditable]=\"!isDisabled()\"\n\t\t[attr.aria-disabled]=\"isDisabled()\"\n\t\t[attr.aria-placeholder]=\"currentCanShowPlaceholder() ? placeholder() : null\"\n\t\t[attr.aria-labelledby]=\"formFieldId() + '-label'\"\n\t\t[attr.spellcheck]=\"!disableSpellcheck()\"\n\t\t(blur)=\"touch()\"\n\t></div>\n\t@if (currentCanShowPlaceholder()) {\n\t\t<div aria-hidden=\"true\" class=\"richTextField-content-placeholder\">{{ placeholder() }}</div>\n\t}\n\t<div\n\t\tclass=\"richTextField-toolbar\"\n\t\t[class.pr-u-displayNone]=\"hideToolbar()\"\n\t\t(keydown.arrowleft)=\"focusSiblingPlugin($event, -1)\"\n\t\t(keydown.arrowRight)=\"focusSiblingPlugin($event, 1)\"\n\t\trole=\"toolbar\"\n\t\t[attr.aria-labelledby]=\"formFieldId() + '-label'\"\n\t\t[attr.aria-controls]=\"formFieldId()\"\n\t>\n\t\t<ng-
|
|
200
|
-
}],
|
|
201
|
-
read: ElementRef,
|
|
202
|
-
}, isSignal: true }] }], contentPresentation: [{ type: i0.ViewChild, args: ['contentPresentation', { ...{
|
|
190
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"richTextField\" [class.is-disabled]=\"isDisabled()\" [class.mod-autoResize]=\"autoResize()\">\n\t<div\n\t\t#content\n\t\tluInput\n\t\tclass=\"richTextField-content textFlow\"\n\t\trole=\"textbox\"\n\t\t[attr.contenteditable]=\"!isDisabled()\"\n\t\t[attr.aria-disabled]=\"isDisabled()\"\n\t\t[attr.aria-placeholder]=\"currentCanShowPlaceholder() ? placeholder() : null\"\n\t\t[attr.aria-labelledby]=\"formFieldId() + '-label'\"\n\t\t[attr.spellcheck]=\"!disableSpellcheck()\"\n\t\t(blur)=\"touch()\"\n\t></div>\n\t@if (currentCanShowPlaceholder()) {\n\t\t<div aria-hidden=\"true\" class=\"richTextField-content-placeholder\">{{ placeholder() }}</div>\n\t}\n\t<div\n\t\tclass=\"richTextField-toolbar\"\n\t\t[class.pr-u-displayNone]=\"hideToolbar()\"\n\t\t(keydown.arrowleft)=\"focusSiblingPlugin($event, -1)\"\n\t\t(keydown.arrowRight)=\"focusSiblingPlugin($event, 1)\"\n\t\trole=\"toolbar\"\n\t\t[attr.aria-labelledby]=\"formFieldId() + '-label'\"\n\t\t[attr.aria-controls]=\"formFieldId()\"\n\t>\n\t\t<ng-content />\n\t</div>\n</div>\n", styles: ["@layer components{.richTextField{--components-richTextField-borderColor: var(--pr-t-color-input-border);--components-richTextField-backgroundColor: var(--pr-t-color-input-background);--components-richTextField-color: var(--pr-t-color-input-text);--components-richTextField-toolbar-backgroundColor: var(--palettes-neutral-25);--components-richTextField-toolbar-display: block;--components-richTextField-resize: vertical;--components-richTextField-height: 3lh;--components-richTextField-minHeight: 2lh;--components-richTextField-maxHeight: 90dvh;--components-richTextField-placeholder-color: var(--pr-t-color-input-text-placeholder);display:flex;flex-direction:column;flex-grow:1;overflow:auto;background-color:var(--components-richTextField-backgroundColor);color:var(--components-richTextField-color);border-color:var(--components-richTextField-borderColor);border-style:solid;border-width:1px;border-radius:var(--pr-t-border-radius-input);resize:var(--components-richTextField-resize);min-block-size:calc(var(--components-richTextField-minHeight) + var(--pr-t-spacings-800) + var(--pr-t-spacings-25));max-block-size:var(--components-richTextField-maxHeight);block-size:calc(var(--components-richTextField-height) + var(--pr-t-spacings-800) + var(--pr-t-spacings-25))}.richTextField:has(.richTextField-toolbar-formatting):has(.richTextField-toolbar-chips){min-block-size:calc(var(--components-richTextField-minHeight) + var(--pr-t-spacings-800) + var(--pr-t-spacings-25) + var(--pr-t-spacings-600))}.richTextField:has(.richTextField-toolbar-formatting):has(.richTextField-toolbar-chips) .richTextField-toolbar-chips{border-block-start:1px solid var(--palettes-neutral-200);padding-block-start:var(--pr-t-spacings-100)}.richTextField:has(.richTextField-toolbar-formatting):has(.richTextField-toolbar-chips) .richTextField-toolbar-formatting{padding-block-end:var(--pr-t-spacings-100)}.richTextField-toolbar{display:var(--components-richTextField-toolbar-display);background-color:var(--components-richTextField-toolbar-backgroundColor);border-radius:0 0 var(--pr-t-border-radius-input) var(--pr-t-border-radius-input);padding:var(--pr-t-spacings-100);overflow:hidden;animation-name:fadeIn;animation-duration:var(--commons-animations-durations-fast);animation-delay:var(--commons-animations-durations-fast);opacity:0;flex-shrink:0;animation-fill-mode:forwards}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.richTextField-toolbar-formatting{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--pr-t-spacings-400);flex-shrink:0}.richTextField-toolbar-formatting:empty{display:none}.richTextField-toolbar-col{display:flex;flex-wrap:wrap;align-items:center;row-gap:var(--pr-t-spacings-100);margin-inline-start:calc(var(--pr-t-spacings-400) * -1)}.richTextField-toolbar-col-group{display:flex;flex-wrap:wrap;align-items:center}.richTextField-toolbar-col-group:not(:only-child){position:relative;margin-inline-start:var(--pr-t-spacings-400)}.richTextField-toolbar-col-group:not(:only-child):before{content:\"\";position:absolute;inset:var(--pr-t-spacings-100) auto var(--pr-t-spacings-100) calc(var(--pr-t-spacings-400) / -2);inline-size:2px;border-radius:var(--pr-t-border-radius-full);background-color:var(--palettes-neutral-300)}.richTextField-toolbar-col-group .richTextField-toolbar-col-group{display:contents}.richTextField-toolbar-chips{display:flex;flex-wrap:wrap;gap:var(--pr-t-spacings-50);padding-block-start:0;border-block-start:0}.richTextField-toolbar-chips-chip{border:0}.richTextField-toolbar-chips-chip:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField-content{padding:var(--pr-t-spacings-100);outline:none;overflow:auto;flex-grow:1}.richTextField-content-chip{vertical-align:middle}.richTextField-content-chip:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField-content-placeholder{position:absolute;pointer-events:none;padding:var(--pr-t-spacings-100);-webkit-user-select:none;user-select:none;color:var(--components-richTextField-placeholder-color)}}@layer mods{.richTextField:has(.richTextField-content:focus-visible){outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField:hover{--components-richTextField-borderColor: var(--pr-t-color-input-border-hover)}.richTextField:has(.richTextField-content[aria-invalid=true]){--components-richTextField-borderColor: var(--pr-t-color-input-border-critical);--components-richTextField-backgroundColor: var(--pr-t-color-input-background-critical);--components-richTextField-placeholder-color: var(--pr-t-color-input-text-placeholder-critical)}.richTextField:has(.richTextField-content[aria-invalid=true]):hover{--components-richTextField-borderColor: var(--pr-t-color-input-border-critical-hover)}.richTextField.is-disabled{--components-richTextField-backgroundColor: var(--pr-t-color-input-background-disabled);--components-richTextField-toolbar-backgroundColor: var(--pr-t-color-input-background-disabled);--components-richTextField-toolbar-display: none;--components-richTextField-color: var(--pr-t-color-input-text-disabled);--components-richTextField-borderColor: var(--pr-t-color-input-border)}.richTextField.mod-autoResize{--components-richTextField-minHeight: 3lh;--components-richTextField-height: auto;--components-richTextField-resize: none}}@layer mods{.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]{--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-700, var(--palettes-product-700))}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:hover{--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-600, var(--palettes-product-600))}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:active{--components-button-backgroundColor: var(--palettes-800, var(--palettes-product-800))}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px}.richTextField-toolbar-button.button.mod-onlyIcon[aria-pressed=true]:disabled{--components-button-color: var(--commons-disabled-background);--components-button-backgroundColor: var(--palettes-neutral-500)}}\n"] }]
|
|
191
|
+
}], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disableSpellcheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSpellcheck", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], hideToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideToolbar", required: false }] }], content: [{ type: i0.ViewChild, args: ['content', { ...{
|
|
203
192
|
read: ElementRef,
|
|
204
193
|
}, isSignal: true }] }], pluginComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => RICH_TEXT_PLUGIN_COMPONENT), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
205
194
|
|
|
@@ -514,7 +503,7 @@ class ClearFormatComponent {
|
|
|
514
503
|
provide: RICH_TEXT_PLUGIN_COMPONENT,
|
|
515
504
|
useExisting: forwardRef(() => ClearFormatComponent),
|
|
516
505
|
},
|
|
517
|
-
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[luTooltip]=\"intl().clearFormat\"\n\tluTooltipOnlyForDisplay\n\t[attr.tabindex]=\"tabindex()\"\n\t[disabled]=\"isDisabled()\"\n\tclass=\"richTextField-toolbar-button\"\n>\n\t<lu-icon icon=\"formatClear\" [alt]=\"intl().clearFormat\" />\n</button>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton"] }, { kind: "component", type: IconComponent, selector: "lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
506
|
+
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[luTooltip]=\"intl().clearFormat\"\n\tluTooltipOnlyForDisplay\n\t[attr.tabindex]=\"tabindex()\"\n\t[disabled]=\"isDisabled()\"\n\tclass=\"richTextField-toolbar-button\"\n>\n\t<lu-icon icon=\"formatClear\" [alt]=\"intl().clearFormat\" />\n</button>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[prButton],a[prButton],button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton", "prButton"] }, { kind: "component", type: IconComponent, selector: "pr-icon,lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
518
507
|
}
|
|
519
508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ClearFormatComponent, decorators: [{
|
|
520
509
|
type: Component,
|
|
@@ -605,7 +594,7 @@ class HeadingsComponent {
|
|
|
605
594
|
provide: RICH_TEXT_PLUGIN_COMPONENT,
|
|
606
595
|
useExisting: forwardRef(() => HeadingsComponent),
|
|
607
596
|
},
|
|
608
|
-
], viewQueries: [{ propertyName: "element", first: true, predicate: ["selectRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<lu-form-field [label]=\"intl().headingsLabel\" size=\"S\" hiddenLabel class=\"mod-width20\">\n\t<lu-simple-select [options]=\"headingOptions()\" [formControl]=\"formControl\" #selectRef [inputTabindex]=\"tabindex()\">\n\t\t<ng-container *luOption=\"let heading; select: selectRef\">{{ headingLabels()[heading][0] }}</ng-container>\n\t</lu-simple-select>\n</lu-form-field>\n", dependencies: [{ kind: "component", type: LuSimpleSelectInputComponent, selector: "lu-simple-select", inputs: ["intl", "autocomplete"] }, { kind: "component", type: FormFieldComponent, selector: "lu-form-field", inputs: ["intl", "label", "hiddenLabel", "rolePresentationLabel", "inline", "statusControl", "tooltip", "tag", "AI", "iconAItooltip", "iconAIalt", "width", "invalid", "inlineMessage", "errorInlineMessage", "inlineMessageState", "size", "extraDescribedBy", "layout", "counter"
|
|
597
|
+
], viewQueries: [{ propertyName: "element", first: true, predicate: ["selectRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<lu-form-field [label]=\"intl().headingsLabel\" size=\"S\" hiddenLabel class=\"mod-width20\">\n\t<lu-simple-select [options]=\"headingOptions()\" [formControl]=\"formControl\" #selectRef [inputTabindex]=\"tabindex()\">\n\t\t<ng-container *luOption=\"let heading; select: selectRef\">{{ headingLabels()[heading][0] }}</ng-container>\n\t</lu-simple-select>\n</lu-form-field>\n", dependencies: [{ kind: "component", type: LuSimpleSelectInputComponent, selector: "lu-simple-select", inputs: ["intl", "autocomplete"] }, { kind: "component", type: FormFieldComponent, selector: "lu-form-field", inputs: ["intl", "label", "hiddenLabel", "rolePresentationLabel", "inline", "statusControl", "tooltip", "tag", "AI", "iconAItooltip", "iconAIalt", "width", "invalid", "inlineMessage", "errorInlineMessage", "inlineMessageState", "size", "extraDescribedBy", "layout", "counter"], outputs: ["rolePresentationLabelChange", "layoutChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: LuOptionDirective, selector: "[luOption]", inputs: ["luOptionSelect"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
609
598
|
}
|
|
610
599
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: HeadingsComponent, decorators: [{
|
|
611
600
|
type: Component,
|
|
@@ -639,7 +628,7 @@ class LinkDialogComponent {
|
|
|
639
628
|
this.dialogRef.close(undefined);
|
|
640
629
|
}
|
|
641
630
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LinkDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
642
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: LinkDialogComponent, isStandalone: true, selector: "lu-rich-text-plugin-link-dialog", inputs: { intl: { classPropertyName: "intl", publicName: "intl", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<lu-dialog>\n\t<form class=\"dialog-form\" (submit)=\"save()\" [formGroup]=\"formGroup\">\n\t\t<lu-dialog-content>\n\t\t\t<lu-form-field [label]=\"intl().linksHref\">\n\t\t\t\t<lu-text-input formControlName=\"href\" type=\"url\" [placeholder]=\"intl().linksPlaceholder\" />\n\t\t\t</lu-form-field>\n\t\t</lu-dialog-content>\n\t\t<lu-dialog-footer>\n\t\t\t@if (dialogData) {\n\t\t\t\t<div class=\"footer-content\">\n\t\t\t\t\t<button type=\"button\" luButton=\"ghost\" delete (click)=\"deleteLink()\">{{ intl().linksDelete }}</button>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<div class=\"footer-actions\">\n\t\t\t\t<button type=\"submit\" luButton>{{ intl().linksSubmit }}</button>\n\t\t\t\t<button type=\"button\" luButton=\"ghost\" luDialogDismiss>{{ intl().linksCancel }}</button>\n\t\t\t</div>\n\t\t</lu-dialog-footer>\n\t</form>\n</lu-dialog>\n", dependencies: [{ kind: "component", type: DialogComponent, selector: "lu-dialog", inputs: ["stacked"] }, { kind: "component", type: DialogContentComponent, selector: "lu-dialog-content" }, { kind: "component", type: DialogFooterComponent, selector: "lu-dialog-footer" }, { kind: "component", type: FormFieldComponent, selector: "lu-form-field", inputs: ["intl", "label", "hiddenLabel", "rolePresentationLabel", "inline", "statusControl", "tooltip", "tag", "AI", "iconAItooltip", "iconAIalt", "width", "invalid", "inlineMessage", "errorInlineMessage", "inlineMessageState", "size", "extraDescribedBy", "layout", "counter"
|
|
631
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: LinkDialogComponent, isStandalone: true, selector: "lu-rich-text-plugin-link-dialog", inputs: { intl: { classPropertyName: "intl", publicName: "intl", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<lu-dialog>\n\t<form class=\"dialog-form\" (submit)=\"save()\" [formGroup]=\"formGroup\">\n\t\t<lu-dialog-content>\n\t\t\t<lu-form-field [label]=\"intl().linksHref\">\n\t\t\t\t<lu-text-input formControlName=\"href\" type=\"url\" [placeholder]=\"intl().linksPlaceholder\" />\n\t\t\t</lu-form-field>\n\t\t</lu-dialog-content>\n\t\t<lu-dialog-footer>\n\t\t\t@if (dialogData) {\n\t\t\t\t<div class=\"footer-content\">\n\t\t\t\t\t<button type=\"button\" luButton=\"ghost\" delete (click)=\"deleteLink()\">{{ intl().linksDelete }}</button>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<div class=\"footer-actions\">\n\t\t\t\t<button type=\"submit\" luButton>{{ intl().linksSubmit }}</button>\n\t\t\t\t<button type=\"button\" luButton=\"ghost\" luDialogDismiss>{{ intl().linksCancel }}</button>\n\t\t\t</div>\n\t\t</lu-dialog-footer>\n\t</form>\n</lu-dialog>\n", dependencies: [{ kind: "component", type: DialogComponent, selector: "lu-dialog", inputs: ["stacked"] }, { kind: "component", type: DialogContentComponent, selector: "lu-dialog-content" }, { kind: "component", type: DialogFooterComponent, selector: "lu-dialog-footer" }, { kind: "component", type: FormFieldComponent, selector: "lu-form-field", inputs: ["intl", "label", "hiddenLabel", "rolePresentationLabel", "inline", "statusControl", "tooltip", "tag", "AI", "iconAItooltip", "iconAIalt", "width", "invalid", "inlineMessage", "errorInlineMessage", "inlineMessageState", "size", "extraDescribedBy", "layout", "counter"], outputs: ["rolePresentationLabelChange", "layoutChange"] }, { kind: "component", type: TextInputComponent, selector: "lu-text-input", inputs: ["intl", "mask", "placeholder", "autocomplete", "hasClearer", "hasSearchIcon", "valueAlignRight", "prefix", "suffix", "searchIcon", "type"], outputs: ["blur"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: ButtonComponent, selector: "button[prButton],a[prButton],button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton", "prButton"] }, { kind: "directive", type: DialogDismissDirective, selector: "[luDialogDismiss]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
643
632
|
}
|
|
644
633
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LinkDialogComponent, decorators: [{
|
|
645
634
|
type: Component,
|
|
@@ -859,7 +848,7 @@ class LinkComponent {
|
|
|
859
848
|
provide: RICH_TEXT_PLUGIN_COMPONENT,
|
|
860
849
|
useExisting: forwardRef(() => LinkComponent),
|
|
861
850
|
},
|
|
862
|
-
], viewQueries: [{ propertyName: "linkNodeTemplate", first: true, predicate: ["linkNodeTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[luTooltip]=\"intl().linksLabel\"\n\t[attr.aria-pressed]=\"active()\"\n\tluTooltipOnlyForDisplay\n\t[attr.tabindex]=\"tabindex()\"\n\t[disabled]=\"isDisabled()\"\n\tclass=\"richTextField-toolbar-button\"\n>\n\t<lu-icon icon=\"formatLink\" [alt]=\"intl().linksLabel\" />\n</button>\n\n<ng-template #linkNodeTemplate let-href=\"href\" let-title=\"title\" let-target=\"target\">\n\t<a [href]=\"href\" [title]=\"title\" [target]=\"target\" [luPopover2]=\"popover\" #trigger=\"luPopover2\"></a>\n\t<ng-template #popover>\n\t\t<div class=\"popover-contentOptional linkPopover\">\n\t\t\t<a [href]=\"href\" luLink external class=\"pr-u-ellipsis\">{{ href }}</a>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tluButton=\"ghost\"\n\t\t\t\tsize=\"XS\"\n\t\t\t\t(click)=\"trigger.close(); dispatchCommand()\"\n\t\t\t\t[luTooltip]=\"intl().linksLabel\"\n\t\t\t\tluTooltipOnlyForDisplay\n\t\t\t>\n\t\t\t\t<lu-icon icon=\"officePen\" [alt]=\"intl().linksLabel\" />\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tluButton=\"ghost\"\n\t\t\t\tsize=\"XS\"\n\t\t\t\t(click)=\"trigger.close(); deleteLink()\"\n\t\t\t\t[luTooltip]=\"intl().linksDelete\"\n\t\t\t\tluTooltipOnlyForDisplay\n\t\t\t>\n\t\t\t\t<lu-icon icon=\"trashDelete\" [alt]=\"intl().linksDelete\" />\n\t\t\t</button>\n\t\t</div>\n\t</ng-template>\n</ng-template>\n", styles: [".linkPopover{display:flex;justify-items:center;gap:var(--pr-t-spacings-50);max-width:20rem}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton"] }, { kind: "component", type: IconComponent, selector: "lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }, { kind: "directive", type: PopoverDirective, selector: "[luPopover2]", inputs: ["intl", "luPopover2", "luPopoverPosition", "
|
|
851
|
+
], viewQueries: [{ propertyName: "linkNodeTemplate", first: true, predicate: ["linkNodeTemplate"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[luTooltip]=\"intl().linksLabel\"\n\t[attr.aria-pressed]=\"active()\"\n\tluTooltipOnlyForDisplay\n\t[attr.tabindex]=\"tabindex()\"\n\t[disabled]=\"isDisabled()\"\n\tclass=\"richTextField-toolbar-button\"\n>\n\t<lu-icon icon=\"formatLink\" [alt]=\"intl().linksLabel\" />\n</button>\n\n<ng-template #linkNodeTemplate let-href=\"href\" let-title=\"title\" let-target=\"target\">\n\t<a [href]=\"href\" [title]=\"title\" [target]=\"target\" [luPopover2]=\"popover\" #trigger=\"luPopover2\"></a>\n\t<ng-template #popover>\n\t\t<div class=\"popover-contentOptional linkPopover\">\n\t\t\t<a [href]=\"href\" luLink external class=\"pr-u-ellipsis\">{{ href }}</a>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tluButton=\"ghost\"\n\t\t\t\tsize=\"XS\"\n\t\t\t\t(click)=\"trigger.close(); dispatchCommand()\"\n\t\t\t\t[luTooltip]=\"intl().linksLabel\"\n\t\t\t\tluTooltipOnlyForDisplay\n\t\t\t>\n\t\t\t\t<lu-icon icon=\"officePen\" [alt]=\"intl().linksLabel\" />\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tluButton=\"ghost\"\n\t\t\t\tsize=\"XS\"\n\t\t\t\t(click)=\"trigger.close(); deleteLink()\"\n\t\t\t\t[luTooltip]=\"intl().linksDelete\"\n\t\t\t\tluTooltipOnlyForDisplay\n\t\t\t>\n\t\t\t\t<lu-icon icon=\"trashDelete\" [alt]=\"intl().linksDelete\" />\n\t\t\t</button>\n\t\t</div>\n\t</ng-template>\n</ng-template>\n", styles: [".linkPopover{display:flex;justify-items:center;gap:var(--pr-t-spacings-50);max-width:20rem}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[prButton],a[prButton],button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton", "prButton"] }, { kind: "component", type: IconComponent, selector: "pr-icon,lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }, { kind: "directive", type: PopoverDirective, selector: "[luPopover2]", inputs: ["intl", "luPopover2", "luPopoverPosition", "luPopoverDisabled", "luPopoverTrigger", "customPositions", "luPopoverNoCloseButton", "luPopoverAnchor", "luPopoverOpenDelay", "luPopoverCloseDelay"], outputs: ["luPopoverTriggerChange", "luPopoverClosed", "luPopoverOpened"], exportAs: ["luPopover2"] }, { kind: "component", type: LinkComponent$1, selector: "a[luLink], button[luLink]", inputs: ["intl", "href", "luLink", "disabled", "decorationHover", "external"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
863
852
|
}
|
|
864
853
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LinkComponent, decorators: [{
|
|
865
854
|
type: Component,
|
|
@@ -944,7 +933,7 @@ class ListFormatComponent {
|
|
|
944
933
|
provide: RICH_TEXT_PLUGIN_COMPONENT,
|
|
945
934
|
useExisting: forwardRef(() => ListFormatComponent),
|
|
946
935
|
},
|
|
947
|
-
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[luTooltip]=\"tooltip()\"\n\tluTooltipOnlyForDisplay\n\t[attr.aria-pressed]=\"active()\"\n\t[attr.tabindex]=\"tabindex()\"\n\t[disabled]=\"isDisabled()\"\n\tclass=\"richTextField-toolbar-button\"\n>\n\t<lu-icon [icon]=\"icon()\" [alt]=\"tooltip()\" />\n</button>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton"] }, { kind: "component", type: IconComponent, selector: "lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
936
|
+
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[luTooltip]=\"tooltip()\"\n\tluTooltipOnlyForDisplay\n\t[attr.aria-pressed]=\"active()\"\n\t[attr.tabindex]=\"tabindex()\"\n\t[disabled]=\"isDisabled()\"\n\tclass=\"richTextField-toolbar-button\"\n>\n\t<lu-icon [icon]=\"icon()\" [alt]=\"tooltip()\" />\n</button>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[prButton],a[prButton],button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton", "prButton"] }, { kind: "component", type: IconComponent, selector: "pr-icon,lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
948
937
|
}
|
|
949
938
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ListFormatComponent, decorators: [{
|
|
950
939
|
type: Component,
|
|
@@ -1053,12 +1042,6 @@ class TagNode extends DecoratorNode {
|
|
|
1053
1042
|
}
|
|
1054
1043
|
createDOM(_config, editor) {
|
|
1055
1044
|
if (TagNode.#viewContainerRef) {
|
|
1056
|
-
if (!editor.isEditable()) {
|
|
1057
|
-
this.#componentRef?.destroy();
|
|
1058
|
-
const span = document.createElement('span');
|
|
1059
|
-
span.textContent = this.#tagDescription ?? this.#tagKey;
|
|
1060
|
-
return span;
|
|
1061
|
-
}
|
|
1062
1045
|
// Create the component
|
|
1063
1046
|
this.#componentRef = TagNode.#viewContainerRef.createComponent(ChipComponent);
|
|
1064
1047
|
// Set inputs on the component instance
|
|
@@ -1083,7 +1066,7 @@ class TagNode extends DecoratorNode {
|
|
|
1083
1066
|
throw new Error('ViewContainerRef is not set for TagNode. Ensure it is initialized before creating TagNode instances.');
|
|
1084
1067
|
}
|
|
1085
1068
|
updateDOM(prevNode, _dom, _config) {
|
|
1086
|
-
return this.#tagDescription !== prevNode.#tagDescription || this.#tagKey !== prevNode.#tagKey || this.#disabled !== prevNode.#disabled
|
|
1069
|
+
return this.#tagDescription !== prevNode.#tagDescription || this.#tagKey !== prevNode.#tagKey || this.#disabled !== prevNode.#disabled;
|
|
1087
1070
|
}
|
|
1088
1071
|
remove(preserveEmptyParent) {
|
|
1089
1072
|
super.remove(preserveEmptyParent);
|
|
@@ -1311,7 +1294,7 @@ class TextStyleComponent {
|
|
|
1311
1294
|
provide: RICH_TEXT_PLUGIN_COMPONENT,
|
|
1312
1295
|
useExisting: forwardRef(() => TextStyleComponent),
|
|
1313
1296
|
},
|
|
1314
|
-
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[attr.aria-pressed]=\"active()\"\n\t[luTooltip]=\"tooltip()\"\n\tluTooltipOnlyForDisplay\n\t[attr.tabindex]=\"tabindex()\"\n\tclass=\"richTextField-toolbar-button\"\n\t[disabled]=\"isDisabled()\"\n>\n\t<lu-icon [icon]=\"icon()\" [alt]=\"tooltip()\" />\n</button>\n", styles: ["@charset \"UTF-8\";@layer components{.button{--components-button-font: var(--pr-t-font-body-M);--components-button-borderRadius: var(--pr-t-border-radius-default);--components-button-paddingBlock: var(--pr-t-spacings-100);--components-button-paddingInline: var(--pr-t-spacings-150);--components-button-paddingBlockStart: var(--components-button-paddingBlock);--components-button-paddingBlockEnd: var(--components-button-paddingBlock);--components-button-paddingInlineStart: var(--components-button-paddingInline);--components-button-paddingInlineEnd: var(--components-button-paddingInline);--components-button-padding: var(--components-button-paddingBlockStart) var(--components-button-paddingInlineEnd) var(--components-button-paddingBlockEnd) var(--components-button-paddingInlineStart);--components-button-gap: var(--pr-t-spacings-100);--components-button-opacity: 1;--components-button-cursor: pointer;--components-button-pointerEvents: auto;--components-button-width: auto;--components-button-minWidth: none;--components-button-userSelect: auto;--components-button-boxShadow: var(--pr-t-elevation-shadow-button);--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-700, var(--palettes-product-700));--components-button-arrow-transform: none;--components-button-AI-background-opacity: 25%;--components-button-font-size: var(--pr-t-font-body-M-fontSize);--components-button-line-height: var(--pr-t-font-body-M-lineHeight);--icon-size: 1.5rem;background-color:var(--components-button-backgroundColor);box-shadow:var(--components-button-boxShadow);border-radius:var(--components-button-borderRadius);padding:var(--components-button-padding);transition-property:background-color,color,border-color,box-shadow;transition-duration:var(--commons-animations-durations-fast);inline-size:var(--components-button-width);min-inline-size:var(--components-button-minWidth);font:var(--components-button-font);font-size:var(--components-button-font-size);line-height:var(--components-button-line-height);font-weight:var(--pr-t-font-fontWeight-semibold);gap:var(--components-button-gap);pointer-events:var(--components-button-pointerEvents);-webkit-user-select:var(--components-button-userSelect);user-select:var(--components-button-userSelect);opacity:var(--components-button-opacity);cursor:var(--components-button-cursor);transition-timing-function:ease;display:inline-flex;align-items:center;justify-content:center;position:relative;text-decoration:none;vertical-align:middle;text-wrap:balance;text-align:center;border:0}.button,.button:is(a){color:var(--components-button-color)}.button .lucca-icon{display:block}.button .button-icon{--icon-size: 1.5rem}.button:not(.mod-outlined,.mod-outline) .numericBadge{--components-numericBadge-background: var(--palettes-200, var(--palettes-product-200));--components-numericBadge-color: var(--palettes-800, var(--palettes-product-800))}.button:hover{--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-800, var(--palettes-product-800))}.button:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px;border-radius:var(--components-button-borderRadius)}.button:active{--components-button-backgroundColor: var(--palettes-900, var(--palettes-product-900))}.button:disabled{--components-button-cursor: default;--components-button-color: var(--palettes-neutral-500);--components-button-backgroundColor: var(--commons-disabled-background);--components-button-pointerEvents: none}.button:disabled .numericBadge{--components-numericBadge-background: var(--palettes-neutral-200);--components-numericBadge-color: var(--palettes-neutral-500)}}@layer mods{.button.mod-AI:not(.invert){--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-neutral-200)}.button.mod-AI:not(.invert):hover{--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-300, var(--palettes-neutral-300));--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50)) }.button.mod-AI:not(.invert):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.button.mod-AI:not(.invert):focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:3px}.button.mod-AI:not(.invert):disabled{--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-boxShadow: 0 0 0 1px var(--palettes-neutral-100);--components-button-color: var(--pr-t-color-text-disabled)}.button.mod-AI:not(.invert):not(:disabled):before{content:\"\";pointer-events:none;position:absolute;inset:calc(var(--commons-divider-width) * -1);padding:var(--commons-divider-width);background-image:conic-gradient(from 135deg,var(--palettes-brand-400),var(--palettes-AI-500),var(--palettes-brand-400));border-radius:calc(var(--pr-t-border-radius-default) + var(--commons-divider-width));-webkit-mask:linear-gradient(var(--palettes-neutral-0)) content-box,linear-gradient(var(--palettes-neutral-0));mask:linear-gradient(var(--palettes-neutral-0)) content-box,linear-gradient(var(--palettes-neutral-0));-webkit-mask-composite:xor;mask-composite:exclude}.button.mod-AI:not(.invert):not(:disabled):not(.mod-invert) .lucca-icon{background-image:linear-gradient(135deg,var(--palettes-AI-600),var(--palettes-brand-500));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.button.mod-AI:not(.invert).mod-invert{--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-neutral-0);background-image:linear-gradient(-135deg,color-mix(in srgb,var(--palettes-AI-500) var(--components-button-AI-background-opacity),transparent),color-mix(in srgb,var(--palettes-brand-400) var(--components-button-AI-background-opacity),transparent))}.button.mod-AI:not(.invert).mod-invert:hover,.button.mod-AI:not(.invert).mod-invert:focus-visible{--components-button-AI-background-opacity: 15%;--components-button-color: var(--palettes-neutral-0)}.button.mod-AI:not(.invert).mod-invert:active{--components-button-AI-background-opacity: 5%}.button.mod-AI:not(.invert).is-success .lucca-icon{background-image:none}.button.mod-AI:not(.invert).is-success:before{content:none}.button.mod-AI:not(.invert).is-success:after{background-image:linear-gradient(135deg,var(--palettes-AI-600),var(--palettes-brand-500));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.button.mod-AI:not(.invert).is-loading .lucca-icon{background-image:none}.button.mod-AI:not(.invert).is-loading:before{content:none}.button.mod-block{--components-button-width: 100%}.button.mod-S{--icon-size: 1.25rem;--components-button-font: var(--pr-t-font-body-S);--components-button-paddingBlock: var(--pr-t-spacings-75);--components-button-paddingInline: var(--pr-t-spacings-100);--components-button-gap: var(--pr-t-spacings-75)}.button.mod-S .numericBadge{--components-numericBadge-size: 1.25rem;--components-numericBadge-borderRadius: var(--pr-t-border-radius-small);--components-numericBadge-font: var(--pr-t-font-body-XS);--components-numericBadge-fontSize: var(--pr-t-font-body-XS-fontSize);--components-numericBadge-lineHeight: var(--pr-t-font-body-XS-lineHeight)}.button.mod-S{--components-button-font-size: var(--pr-t-font-body-S-fontSize);--components-button-line-height: var(--pr-t-font-body-S-lineHeight)}.button.mod-XS{--icon-size: 1rem;--components-button-font: var(--pr-t-font-body-XS);--components-button-paddingBlock: var(--pr-t-spacings-50);--components-button-paddingInline: var(--pr-t-spacings-75);--components-button-gap: var(--pr-t-spacings-50);--components-button-borderRadius: var(--pr-t-border-radius-small)}.button.mod-XS .numericBadge{--components-numericBadge-size: 1rem;--components-numericBadge-borderRadius: var(--pr-t-border-radius-small);--components-numericBadge-font: var(--pr-t-font-body-XS);--components-numericBadge-fontSize: var(--pr-t-font-body-XS-fontSize);--components-numericBadge-lineHeight: var(--pr-t-font-body-XS-lineHeight)}.button.mod-XS{--components-button-font-size: var(--pr-t-font-body-XS-fontSize);--components-button-line-height: var(--pr-t-font-body-XS-lineHeight)}.button.mod-disclosure{--components-button-paddingInlineEnd: var(--pr-t-spacings-100)}.button.mod-disclosure .icon-arrowChevronBottom{transition-property:transform;transition-duration:var(--commons-animations-durations-fast);transform:var(--components-button-arrow-transform)}.button.mod-disclosure[aria-expanded=true]{--components-button-arrow-transform: rotate(-180deg)}.button.mod-outlined:where(:not(.is-success,.is-error)),.button.mod-outline:where(:not(.is-success,.is-error)){--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-neutral-200)}.button.mod-outlined:where(:not(.is-success,.is-error)):hover,.button.mod-outline:where(:not(.is-success,.is-error)):hover{--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-300, var(--palettes-neutral-300));--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50)) }.button.mod-outlined:where(:not(.is-success,.is-error)):active,.button.mod-outline:where(:not(.is-success,.is-error)):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.button.mod-outlined:where(:not(.is-success,.is-error)):focus-visible,.button.mod-outline:where(:not(.is-success,.is-error)):focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:3px}.button.mod-outlined:where(:not(.is-success,.is-error)):disabled,.button.mod-outline:where(:not(.is-success,.is-error)):disabled{--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-boxShadow: 0 0 0 1px var(--palettes-neutral-100);--components-button-color: var(--pr-t-color-text-disabled)}.button.mod-text:where(:not(.is-success,.is-error)),.button.mod-link:where(:not(.is-success,.is-error)),.button.mod-ghost:where(:not(.is-success,.is-error)){--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-boxShadow: none}.button.mod-text:where(:not(.is-success,.is-error)):hover,.button.mod-text:where(:not(.is-success,.is-error)):focus-visible,.button.mod-link:where(:not(.is-success,.is-error)):hover,.button.mod-link:where(:not(.is-success,.is-error)):focus-visible,.button.mod-ghost:where(:not(.is-success,.is-error)):hover,.button.mod-ghost:where(:not(.is-success,.is-error)):focus-visible{--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50))}.button.mod-text:where(:not(.is-success,.is-error)):active,.button.mod-link:where(:not(.is-success,.is-error)):active,.button.mod-ghost:where(:not(.is-success,.is-error)):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.button.mod-text:where(:not(.is-success,.is-error)):disabled,.button.mod-link:where(:not(.is-success,.is-error)):disabled,.button.mod-ghost:where(:not(.is-success,.is-error)):disabled{--components-button-backgroundColor: transparent;--components-button-color: var(--pr-t-color-text-disabled)}.button.mod-withIcon.mod-iconOnLeft{--components-button-paddingInlineStart: var(--pr-t-spacings-100)}.button.mod-withIcon.mod-iconOnLeft.mod-S{--components-button-paddingInlineStart: var(--pr-t-spacings-75)}.button.mod-withIcon.mod-iconOnLeft.mod-XS{--components-button-paddingInlineStart: var(--pr-t-spacings-50)}.button.mod-withIcon.mod-iconOnRight{--components-button-paddingInlineEnd: var(--pr-t-spacings-100)}.button.mod-withIcon.mod-iconOnRight.mod-S{--components-button-paddingInlineEnd: var(--pr-t-spacings-75)}.button.mod-withIcon.mod-iconOnRight.mod-XS{--components-button-paddingInlineEnd: var(--pr-t-spacings-50)}.button.mod-onlyIcon{--components-button-padding: var(--pr-t-spacings-100)}.button.mod-onlyIcon.mod-S{--components-button-padding: var(--pr-t-spacings-75)}.button.mod-onlyIcon.mod-XS{--components-button-padding: var(--pr-t-spacings-50)}.button:has(.numericBadge){--components-button-paddingInlineEnd: var(--pr-t-spacings-100)}.button:has(.numericBadge).mod-S{--components-button-paddingInlineEnd: var(--pr-t-spacings-75)}.button:has(.numericBadge).mod-XS{--components-button-paddingInlineEnd: var(--pr-t-spacings-50)}.button.mod-critical:hover,.button.mod-delete:hover{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-100)}.button.mod-critical:active,.button.mod-delete:active{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-200)}.button.mod-critical.mod-text:hover,.button.mod-critical.mod-text:focus-visible,.button.mod-critical.mod-link:hover,.button.mod-critical.mod-link:focus-visible,.button.mod-delete.mod-text:hover,.button.mod-delete.mod-text:focus-visible,.button.mod-delete.mod-link:hover,.button.mod-delete.mod-link:focus-visible{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-100)}.button.mod-critical.mod-text:active,.button.mod-critical.mod-link:active,.button.mod-delete.mod-text:active,.button.mod-delete.mod-link:active{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-200)}.button.mod-critical.mod-outlined:hover,.button.mod-critical.mod-outline:hover,.button.mod-delete.mod-outlined:hover,.button.mod-delete.mod-outline:hover{--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-error-400);--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-100)}.button.mod-critical.mod-outlined:focus-visible,.button.mod-critical.mod-outline:focus-visible,.button.mod-delete.mod-outlined:focus-visible,.button.mod-delete.mod-outline:focus-visible{--components-button-boxShadow: 0 0 0 var(--commons-divider-width) var(--palettes-error-400);--components-button-color: var(--palettes-error-700)}.button.mod-critical.mod-outlined:active,.button.mod-critical.mod-outline:active,.button.mod-delete.mod-outlined:active,.button.mod-delete.mod-outline:active{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-200)}.button.mod-inverted,.button.mod-invert{--components-button-color: var(--palettes-neutral-0)}.button.mod-inverted:hover,.button.mod-inverted:focus-visible,.button.mod-invert:hover,.button.mod-invert:focus-visible{--components-button-color: var(--palettes-neutral-0);--components-button-backgroundColor: var(--palettes-neutral-900)}.button.mod-inverted:active,.button.mod-invert:active{--components-button-backgroundColor: var(--palettes-neutral-700)}.button.mod-more{--components-button-minWidth: 2rem;--components-button-padding: 0}.button.mod-more:after{--icon-content: \"\\e97c\";font-weight:var(--pr-t-font-fontWeight-regular);display:inline-block;vertical-align:text-bottom;font-style:normal;font-family:var(--icon-fontFamily);content:var(--icon-content)/\"\";-webkit-font-smoothing:antialiased;text-transform:none;block-size:0;order:-1;vertical-align:text-top}.button.mod-more.mod-S{--components-button-minWidth: 1.75rem}.button.mod-more.mod-XS{--components-button-minWidth: 1.5rem}.button.is-loading,.button.loading{--components-button-pointerEvents: none;--components-button-color: transparent;--components-button-userSelect: none;--components-button-boxShadow: none;--components-button-backgroundColor: var(--palettes-500, var(--palettes-product-500));--commons-loading-frontground: var(--palettes-50, var(--palettes-product-50))}.button.is-loading:after,.button.loading:after{content:\"\";inline-size:var(--pr-t-font-body-M-lineHeight);block-size:var(--pr-t-font-body-M-lineHeight);border-radius:var(--pr-t-border-radius-full);line-height:.8rem;border-width:var(--commons-loading-borderWidth);inset:0;margin:auto;position:absolute;border-style:solid;animation-name:rotate;animation-duration:var(--commons-loading-speed);animation-timing-function:linear;animation-iteration-count:infinite;border-color:var(--commons-loading-frontground);border-block-start-color:transparent}.button.is-loading .numericBadge,.button.loading .numericBadge{--components-numericBadge-background: transparent;--components-numericBadge-color: transparent}.button.is-loading.mod-S:after,.button.loading.mod-S:after{content:\"\";inline-size:var(--pr-t-font-body-S-lineHeight);block-size:var(--pr-t-font-body-S-lineHeight);border-radius:var(--pr-t-border-radius-full);line-height:.8rem;border-width:var(--commons-loading-borderWidth);inset:0;margin:auto;position:absolute;border-style:solid;animation-name:rotate;animation-duration:var(--commons-loading-speed);animation-timing-function:linear;animation-iteration-count:infinite;border-color:var(--commons-loading-frontground);border-block-start-color:transparent}.button.is-loading.mod-XS:after,.button.loading.mod-XS:after{content:\"\";inline-size:var(--pr-t-font-body-XS-lineHeight);block-size:var(--pr-t-font-body-XS-lineHeight);border-radius:var(--pr-t-border-radius-full);line-height:.8rem;border-width:var(--commons-loading-borderWidth);inset:0;margin:auto;position:absolute;border-style:solid;animation-name:rotate;animation-duration:var(--commons-loading-speed);animation-timing-function:linear;animation-iteration-count:infinite;border-color:var(--commons-loading-frontground);border-block-start-color:transparent}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.button.is-loading.mod-XS,.button.loading.mod-XS{--commons-loading-borderWidth: 2px}.button.is-loading.mod-AI,.button.is-loading.mod-outlined,.button.loading.mod-AI,.button.loading.mod-outlined{--components-button-backgroundColor: var(--palettes-neutral-0);--commons-loading-frontground: var(--palettes-neutral-300);--components-button-boxShadow: 0 0 0 var(--commons-divider-width) var(--palettes-neutral-100)}.button.is-loading.mod-ghost,.button.loading.mod-ghost{--components-button-backgroundColor: var(--palettes-neutral-50);--commons-loading-frontground: var(--palettes-neutral-400)}.button.is-error,.button.error{animation-name:shake;animation-iteration-count:1;animation-duration:var(--commons-animations-durations-standard)}@keyframes shake{0%,to{transform:translateZ(0)}20%,60%{transform:translate3d(-3px,0,0)}40%,80%{transform:translate3d(3px,0,0)}}.button.is-success,.button.success{--components-button-backgroundColor: var(--palettes-500, var(--palettes-product-500));--components-button-color: transparent;--components-button-pointerEvents: none;--components-button-userSelect: none}.button.is-success:after,.button.success:after{--icon-content: \"\\e97d\";font-weight:var(--pr-t-font-fontWeight-regular);display:inline-block;vertical-align:text-bottom;font-style:normal;font-family:var(--icon-fontFamily);content:var(--icon-content)/\"\";-webkit-font-smoothing:antialiased;text-transform:none;color:var(--palettes-neutral-0);font-size:calc(1.5 * var(--pr-t-font-body-M-fontSize));block-size:var(--pr-t-font-body-M-lineHeight);inset:0;margin:auto;position:absolute}.button.is-success .numericBadge,.button.success .numericBadge{--components-numericBadge-background: transparent;--components-numericBadge-color: transparent}.button.is-success.mod-AI,.button.is-success.mod-outlined,.button.success.mod-AI,.button.success.mod-outlined{--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-boxShadow: 0 0 0 var(--commons-divider-width) var(--palettes-neutral-100)}.button.is-success.mod-AI:after,.button.is-success.mod-outlined:after,.button.success.mod-AI:after,.button.success.mod-outlined:after{color:var(--palettes-700, var(--palettes-product-700))}.button.is-success.mod-ghost,.button.success.mod-ghost{--components-button-backgroundColor: var(--palettes-neutral-50);--components-button-boxShadow: none}.button.is-success.mod-ghost:after,.button.success.mod-ghost:after{color:var(--palettes-700, var(--palettes-product-700))}.button.is-success.mod-S:after,.button.success.mod-S:after{font-size:var(--pr-t-font-body-S-lineHeight);block-size:var(--pr-t-font-body-S-lineHeight)}.button.is-success.mod-XS:after,.button.success.mod-XS:after{font-size:var(--pr-t-font-body-XS-lineHeight);block-size:var(--pr-t-font-body-XS-lineHeight)}.button.is-disabled,.button.disabled,.button[aria-disabled=true]{--components-button-cursor: default;--components-button-color: var(--pr-t-color-text-disabled);--components-button-backgroundColor: var(--commons-disabled-background);--components-button-pointerEvents: none}.button.is-disabled .numericBadge,.button.disabled .numericBadge,.button[aria-disabled=true] .numericBadge{--components-numericBadge-background: var(--palettes-neutral-200);--components-numericBadge-color: var(--palettes-neutral-500)}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton"] }, { kind: "component", type: IconComponent, selector: "lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1297
|
+
], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<button\n\t#element\n\tluButton=\"ghost\"\n\ttype=\"button\"\n\tsize=\"S\"\n\t(click)=\"dispatchCommand()\"\n\t[attr.aria-pressed]=\"active()\"\n\t[luTooltip]=\"tooltip()\"\n\tluTooltipOnlyForDisplay\n\t[attr.tabindex]=\"tabindex()\"\n\tclass=\"richTextField-toolbar-button\"\n\t[disabled]=\"isDisabled()\"\n>\n\t<lu-icon [icon]=\"icon()\" [alt]=\"tooltip()\" />\n</button>\n", styles: ["@charset \"UTF-8\";@layer components{.button{--components-button-font: var(--pr-t-font-body-M);--components-button-borderRadius: var(--pr-t-border-radius-default);--components-button-paddingBlock: var(--pr-t-spacings-100);--components-button-paddingInline: var(--pr-t-spacings-150);--components-button-paddingBlockStart: var(--components-button-paddingBlock);--components-button-paddingBlockEnd: var(--components-button-paddingBlock);--components-button-paddingInlineStart: var(--components-button-paddingInline);--components-button-paddingInlineEnd: var(--components-button-paddingInline);--components-button-padding: var(--components-button-paddingBlockStart) var(--components-button-paddingInlineEnd) var(--components-button-paddingBlockEnd) var(--components-button-paddingInlineStart);--components-button-gap: var(--pr-t-spacings-100);--components-button-opacity: 1;--components-button-cursor: pointer;--components-button-pointerEvents: auto;--components-button-width: auto;--components-button-minWidth: none;--components-button-userSelect: auto;--components-button-boxShadow: var(--pr-t-elevation-shadow-button);--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-700, var(--palettes-product-700));--components-button-arrow-transform: none;--components-button-AI-background-opacity: 25%;--components-button-font-size: var(--pr-t-font-body-M-fontSize);--components-button-line-height: var(--pr-t-font-body-M-lineHeight);--icon-size: 1.5rem;background-color:var(--components-button-backgroundColor);box-shadow:var(--components-button-boxShadow);border-radius:var(--components-button-borderRadius);padding:var(--components-button-padding);transition-property:background-color,color,border-color,box-shadow;transition-duration:var(--commons-animations-durations-fast);inline-size:var(--components-button-width);min-inline-size:var(--components-button-minWidth);font:var(--components-button-font);font-size:var(--components-button-font-size);line-height:var(--components-button-line-height);font-weight:var(--pr-t-font-fontWeight-semibold);gap:var(--components-button-gap);pointer-events:var(--components-button-pointerEvents);-webkit-user-select:var(--components-button-userSelect);user-select:var(--components-button-userSelect);opacity:var(--components-button-opacity);cursor:var(--components-button-cursor);transition-timing-function:ease;display:inline-flex;align-items:center;justify-content:center;position:relative;text-decoration:none;vertical-align:middle;text-wrap:balance;text-align:center;border:0}.button,.button:is(a){color:var(--components-button-color)}.button .lucca-icon{display:block}.button .button-icon{--icon-size: 1.5rem}.button:not(.mod-outlined,.mod-outline) .numericBadge{--components-numericBadge-background: var(--palettes-200, var(--palettes-product-200));--components-numericBadge-color: var(--palettes-800, var(--palettes-product-800))}.button:hover{--components-button-color: var(--palettes-0, var(--palettes-text, var(--palettes-product-0)));--components-button-backgroundColor: var(--palettes-800, var(--palettes-product-800))}.button:focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:2px;border-radius:var(--components-button-borderRadius)}.button:active{--components-button-backgroundColor: var(--palettes-900, var(--palettes-product-900))}.button:disabled{--components-button-cursor: default;--components-button-color: var(--palettes-neutral-500);--components-button-backgroundColor: var(--commons-disabled-background);--components-button-pointerEvents: none}.button:disabled .numericBadge{--components-numericBadge-background: var(--palettes-neutral-200);--components-numericBadge-color: var(--palettes-neutral-500)}}@layer mods{.button.mod-AI:not(.invert){--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-neutral-200)}.button.mod-AI:not(.invert):hover{--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-300, var(--palettes-neutral-300));--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50)) }.button.mod-AI:not(.invert):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.button.mod-AI:not(.invert):focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:3px}.button.mod-AI:not(.invert):disabled{--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-boxShadow: 0 0 0 1px var(--palettes-neutral-100);--components-button-color: var(--pr-t-color-text-disabled)}.button.mod-AI:not(.invert):not(:disabled):before{content:\"\";pointer-events:none;position:absolute;inset:calc(var(--commons-divider-width) * -1);padding:var(--commons-divider-width);background-image:conic-gradient(from 135deg,var(--palettes-brand-400),var(--palettes-AI-500),var(--palettes-brand-400));border-radius:calc(var(--pr-t-border-radius-default) + var(--commons-divider-width));-webkit-mask:linear-gradient(var(--palettes-neutral-0)) content-box,linear-gradient(var(--palettes-neutral-0));mask:linear-gradient(var(--palettes-neutral-0)) content-box,linear-gradient(var(--palettes-neutral-0));-webkit-mask-composite:xor;mask-composite:exclude}.button.mod-AI:not(.invert):not(:disabled):not(.mod-invert) .lucca-icon{background-image:linear-gradient(135deg,var(--palettes-AI-600),var(--palettes-brand-500));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.button.mod-AI:not(.invert).mod-invert{--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-neutral-0);background-image:linear-gradient(-135deg,color-mix(in srgb,var(--palettes-AI-500) var(--components-button-AI-background-opacity),transparent),color-mix(in srgb,var(--palettes-brand-400) var(--components-button-AI-background-opacity),transparent))}.button.mod-AI:not(.invert).mod-invert:hover,.button.mod-AI:not(.invert).mod-invert:focus-visible{--components-button-AI-background-opacity: 15%;--components-button-color: var(--palettes-neutral-0)}.button.mod-AI:not(.invert).mod-invert:active{--components-button-AI-background-opacity: 5%}.button.mod-AI:not(.invert).is-success .lucca-icon{background-image:none}.button.mod-AI:not(.invert).is-success:before{content:none}.button.mod-AI:not(.invert).is-success:after{background-image:linear-gradient(135deg,var(--palettes-AI-600),var(--palettes-brand-500));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.button.mod-AI:not(.invert).is-loading .lucca-icon{background-image:none}.button.mod-AI:not(.invert).is-loading:before{content:none}.button.mod-block{--components-button-width: 100%}.button.mod-S{--icon-size: 1.25rem;--components-button-font: var(--pr-t-font-body-S);--components-button-paddingBlock: var(--pr-t-spacings-75);--components-button-paddingInline: var(--pr-t-spacings-100);--components-button-gap: var(--pr-t-spacings-75)}.button.mod-S .numericBadge{--components-numericBadge-size: 1.25rem;--components-numericBadge-borderRadius: var(--pr-t-border-radius-small);--components-numericBadge-font: var(--pr-t-font-body-XS);--components-numericBadge-fontSize: var(--pr-t-font-body-XS-fontSize);--components-numericBadge-lineHeight: var(--pr-t-font-body-XS-lineHeight)}.button.mod-S{--components-button-font-size: var(--pr-t-font-body-S-fontSize);--components-button-line-height: var(--pr-t-font-body-S-lineHeight)}.button.mod-XS{--icon-size: 1rem;--components-button-font: var(--pr-t-font-body-XS);--components-button-paddingBlock: var(--pr-t-spacings-50);--components-button-paddingInline: var(--pr-t-spacings-75);--components-button-gap: var(--pr-t-spacings-50);--components-button-borderRadius: var(--pr-t-border-radius-small)}.button.mod-XS .numericBadge{--components-numericBadge-size: 1rem;--components-numericBadge-borderRadius: var(--pr-t-border-radius-small);--components-numericBadge-font: var(--pr-t-font-body-XS);--components-numericBadge-fontSize: var(--pr-t-font-body-XS-fontSize);--components-numericBadge-lineHeight: var(--pr-t-font-body-XS-lineHeight)}.button.mod-XS{--components-button-font-size: var(--pr-t-font-body-XS-fontSize);--components-button-line-height: var(--pr-t-font-body-XS-lineHeight)}.button.mod-disclosure{--components-button-paddingInlineEnd: var(--pr-t-spacings-100)}.button.mod-disclosure .icon-arrowChevronBottom{transition-property:transform;transition-duration:var(--commons-animations-durations-fast);transform:var(--components-button-arrow-transform)}.button.mod-disclosure[aria-expanded=true]{--components-button-arrow-transform: rotate(-180deg)}.button.mod-outlined:where(:not(.is-success,.is-error)),.button.mod-outline:where(:not(.is-success,.is-error)){--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-neutral-200)}.button.mod-outlined:where(:not(.is-success,.is-error)):hover,.button.mod-outline:where(:not(.is-success,.is-error)):hover{--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-300, var(--palettes-neutral-300));--components-button-color: var(--palettes-700, var(--palettes-neutral-700));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50)) }.button.mod-outlined:where(:not(.is-success,.is-error)):active,.button.mod-outline:where(:not(.is-success,.is-error)):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.button.mod-outlined:where(:not(.is-success,.is-error)):focus-visible,.button.mod-outline:where(:not(.is-success,.is-error)):focus-visible{outline:2px solid var(--palettes-product-700);outline-offset:3px}.button.mod-outlined:where(:not(.is-success,.is-error)):disabled,.button.mod-outline:where(:not(.is-success,.is-error)):disabled{--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-boxShadow: 0 0 0 1px var(--palettes-neutral-100);--components-button-color: var(--pr-t-color-text-disabled)}.button.mod-text:where(:not(.is-success,.is-error)),.button.mod-link:where(:not(.is-success,.is-error)),.button.mod-ghost:where(:not(.is-success,.is-error)){--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-boxShadow: none}.button.mod-text:where(:not(.is-success,.is-error)):hover,.button.mod-text:where(:not(.is-success,.is-error)):focus-visible,.button.mod-link:where(:not(.is-success,.is-error)):hover,.button.mod-link:where(:not(.is-success,.is-error)):focus-visible,.button.mod-ghost:where(:not(.is-success,.is-error)):hover,.button.mod-ghost:where(:not(.is-success,.is-error)):focus-visible{--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50))}.button.mod-text:where(:not(.is-success,.is-error)):active,.button.mod-link:where(:not(.is-success,.is-error)):active,.button.mod-ghost:where(:not(.is-success,.is-error)):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.button.mod-text:where(:not(.is-success,.is-error)):disabled,.button.mod-link:where(:not(.is-success,.is-error)):disabled,.button.mod-ghost:where(:not(.is-success,.is-error)):disabled{--components-button-backgroundColor: transparent;--components-button-color: var(--pr-t-color-text-disabled)}.button.mod-withIcon.mod-iconOnLeft{--components-button-paddingInlineStart: var(--pr-t-spacings-100)}.button.mod-withIcon.mod-iconOnLeft.mod-S{--components-button-paddingInlineStart: var(--pr-t-spacings-75)}.button.mod-withIcon.mod-iconOnLeft.mod-XS{--components-button-paddingInlineStart: var(--pr-t-spacings-50)}.button.mod-withIcon.mod-iconOnRight{--components-button-paddingInlineEnd: var(--pr-t-spacings-100)}.button.mod-withIcon.mod-iconOnRight.mod-S{--components-button-paddingInlineEnd: var(--pr-t-spacings-75)}.button.mod-withIcon.mod-iconOnRight.mod-XS{--components-button-paddingInlineEnd: var(--pr-t-spacings-50)}.button.mod-onlyIcon{--components-button-padding: var(--pr-t-spacings-100)}.button.mod-onlyIcon.mod-S{--components-button-padding: var(--pr-t-spacings-75)}.button.mod-onlyIcon.mod-XS{--components-button-padding: var(--pr-t-spacings-50)}.button:has(.numericBadge){--components-button-paddingInlineEnd: var(--pr-t-spacings-100)}.button:has(.numericBadge).mod-S{--components-button-paddingInlineEnd: var(--pr-t-spacings-75)}.button:has(.numericBadge).mod-XS{--components-button-paddingInlineEnd: var(--pr-t-spacings-50)}.button.mod-critical:hover,.button.mod-delete:hover{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-100)}.button.mod-critical:active,.button.mod-delete:active{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-200)}.button.mod-critical.mod-text:hover,.button.mod-critical.mod-text:focus-visible,.button.mod-critical.mod-link:hover,.button.mod-critical.mod-link:focus-visible,.button.mod-delete.mod-text:hover,.button.mod-delete.mod-text:focus-visible,.button.mod-delete.mod-link:hover,.button.mod-delete.mod-link:focus-visible{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-100)}.button.mod-critical.mod-text:active,.button.mod-critical.mod-link:active,.button.mod-delete.mod-text:active,.button.mod-delete.mod-link:active{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-200)}.button.mod-critical.mod-outlined:hover,.button.mod-critical.mod-outline:hover,.button.mod-delete.mod-outlined:hover,.button.mod-delete.mod-outline:hover{--components-button-boxShadow: var(--pr-t-elevation-shadow-button), 0 0 0 var(--commons-divider-width) var(--palettes-error-400);--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-100)}.button.mod-critical.mod-outlined:focus-visible,.button.mod-critical.mod-outline:focus-visible,.button.mod-delete.mod-outlined:focus-visible,.button.mod-delete.mod-outline:focus-visible{--components-button-boxShadow: 0 0 0 var(--commons-divider-width) var(--palettes-error-400);--components-button-color: var(--palettes-error-700)}.button.mod-critical.mod-outlined:active,.button.mod-critical.mod-outline:active,.button.mod-delete.mod-outlined:active,.button.mod-delete.mod-outline:active{--components-button-color: var(--palettes-error-700);--components-button-backgroundColor: var(--palettes-error-200)}.button.mod-inverted,.button.mod-invert{--components-button-color: var(--palettes-neutral-0)}.button.mod-inverted:hover,.button.mod-inverted:focus-visible,.button.mod-invert:hover,.button.mod-invert:focus-visible{--components-button-color: var(--palettes-neutral-0);--components-button-backgroundColor: var(--palettes-neutral-900)}.button.mod-inverted:active,.button.mod-invert:active{--components-button-backgroundColor: var(--palettes-neutral-700)}.button.mod-more{--components-button-minWidth: 2rem;--components-button-padding: 0}.button.mod-more:after{--icon-content: \"\\e97c\";font-weight:var(--pr-t-font-fontWeight-regular);display:inline-block;vertical-align:text-bottom;font-style:normal;font-family:var(--icon-fontFamily);content:var(--icon-content)/\"\";-webkit-font-smoothing:antialiased;text-transform:none;block-size:0;order:-1;vertical-align:text-top}.button.mod-more.mod-S{--components-button-minWidth: 1.75rem}.button.mod-more.mod-XS{--components-button-minWidth: 1.5rem}.button.is-loading,.button.loading{--components-button-pointerEvents: none;--components-button-color: transparent;--components-button-userSelect: none;--components-button-boxShadow: none;--components-button-backgroundColor: var(--palettes-500, var(--palettes-product-500));--commons-loading-frontground: var(--palettes-50, var(--palettes-product-50))}.button.is-loading:after,.button.loading:after{content:\"\";inline-size:var(--pr-t-font-body-M-lineHeight);block-size:var(--pr-t-font-body-M-lineHeight);border-radius:var(--pr-t-border-radius-full);line-height:.8rem;border-width:var(--commons-loading-borderWidth);inset:0;margin:auto;position:absolute;border-style:solid;animation-name:rotate;animation-duration:var(--commons-loading-speed);animation-timing-function:linear;animation-iteration-count:infinite;border-color:var(--commons-loading-frontground);border-block-start-color:transparent}.button.is-loading .numericBadge,.button.loading .numericBadge{--components-numericBadge-background: transparent;--components-numericBadge-color: transparent}.button.is-loading.mod-S:after,.button.loading.mod-S:after{content:\"\";inline-size:var(--pr-t-font-body-S-lineHeight);block-size:var(--pr-t-font-body-S-lineHeight);border-radius:var(--pr-t-border-radius-full);line-height:.8rem;border-width:var(--commons-loading-borderWidth);inset:0;margin:auto;position:absolute;border-style:solid;animation-name:rotate;animation-duration:var(--commons-loading-speed);animation-timing-function:linear;animation-iteration-count:infinite;border-color:var(--commons-loading-frontground);border-block-start-color:transparent}.button.is-loading.mod-XS:after,.button.loading.mod-XS:after{content:\"\";inline-size:var(--pr-t-font-body-XS-lineHeight);block-size:var(--pr-t-font-body-XS-lineHeight);border-radius:var(--pr-t-border-radius-full);line-height:.8rem;border-width:var(--commons-loading-borderWidth);inset:0;margin:auto;position:absolute;border-style:solid;animation-name:rotate;animation-duration:var(--commons-loading-speed);animation-timing-function:linear;animation-iteration-count:infinite;border-color:var(--commons-loading-frontground);border-block-start-color:transparent}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.button.is-loading.mod-XS,.button.loading.mod-XS{--commons-loading-borderWidth: 2px}.button.is-loading.mod-AI,.button.is-loading.mod-outlined,.button.loading.mod-AI,.button.loading.mod-outlined{--components-button-backgroundColor: var(--palettes-neutral-0);--commons-loading-frontground: var(--palettes-neutral-300);--components-button-boxShadow: 0 0 0 var(--commons-divider-width) var(--palettes-neutral-100)}.button.is-loading.mod-ghost,.button.loading.mod-ghost{--components-button-backgroundColor: var(--palettes-neutral-50);--commons-loading-frontground: var(--palettes-neutral-400)}.button.is-error,.button.error{animation-name:shake;animation-iteration-count:1;animation-duration:var(--commons-animations-durations-standard)}@keyframes shake{0%,to{transform:translateZ(0)}20%,60%{transform:translate3d(-3px,0,0)}40%,80%{transform:translate3d(3px,0,0)}}.button.is-success,.button.success{--components-button-backgroundColor: var(--palettes-500, var(--palettes-product-500));--components-button-color: transparent;--components-button-pointerEvents: none;--components-button-userSelect: none}.button.is-success:after,.button.success:after{--icon-content: \"\\e97d\";font-weight:var(--pr-t-font-fontWeight-regular);display:inline-block;vertical-align:text-bottom;font-style:normal;font-family:var(--icon-fontFamily);content:var(--icon-content)/\"\";-webkit-font-smoothing:antialiased;text-transform:none;color:var(--palettes-neutral-0);font-size:calc(1.5 * var(--pr-t-font-body-M-fontSize));block-size:var(--pr-t-font-body-M-lineHeight);inset:0;margin:auto;position:absolute}.button.is-success .numericBadge,.button.success .numericBadge{--components-numericBadge-background: transparent;--components-numericBadge-color: transparent}.button.is-success.mod-AI,.button.is-success.mod-outlined,.button.success.mod-AI,.button.success.mod-outlined{--components-button-backgroundColor: var(--palettes-neutral-0);--components-button-boxShadow: 0 0 0 var(--commons-divider-width) var(--palettes-neutral-100)}.button.is-success.mod-AI:after,.button.is-success.mod-outlined:after,.button.success.mod-AI:after,.button.success.mod-outlined:after{color:var(--palettes-700, var(--palettes-product-700))}.button.is-success.mod-ghost,.button.success.mod-ghost{--components-button-backgroundColor: var(--palettes-neutral-50);--components-button-boxShadow: none}.button.is-success.mod-ghost:after,.button.success.mod-ghost:after{color:var(--palettes-700, var(--palettes-product-700))}.button.is-success.mod-S:after,.button.success.mod-S:after{font-size:var(--pr-t-font-body-S-lineHeight);block-size:var(--pr-t-font-body-S-lineHeight)}.button.is-success.mod-XS:after,.button.success.mod-XS:after{font-size:var(--pr-t-font-body-XS-lineHeight);block-size:var(--pr-t-font-body-XS-lineHeight)}.button.is-disabled,.button.disabled,.button[aria-disabled=true]{--components-button-cursor: default;--components-button-color: var(--pr-t-color-text-disabled);--components-button-backgroundColor: var(--commons-disabled-background);--components-button-pointerEvents: none}.button.is-disabled .numericBadge,.button.disabled .numericBadge,.button[aria-disabled=true] .numericBadge{--components-numericBadge-background: var(--palettes-neutral-200);--components-numericBadge-color: var(--palettes-neutral-500)}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[prButton],a[prButton],button[luButton],a[luButton]", inputs: ["size", "block", "critical", "delete", "disclosure", "palette", "state", "luButton", "prButton"] }, { kind: "component", type: IconComponent, selector: "pr-icon,lu-icon", inputs: ["icon", "alt", "size", "color", "AI"] }, { kind: "directive", type: LuTooltipTriggerDirective, selector: "[luTooltip]", inputs: ["luTooltip", "luTooltipEnterDelay", "luTooltipLeaveDelay", "luTooltipDisabled", "luTooltipOnlyForDisplay", "luTooltipPosition", "luTooltipWhenEllipsis", "luTooltipAnchor", "id"], exportAs: ["luTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1315
1298
|
}
|
|
1316
1299
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: TextStyleComponent, decorators: [{
|
|
1317
1300
|
type: Component,
|