@seniorsistemas/angular-components 19.9.8 → 19.9.9
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/card/lib/card/card.component.d.ts +6 -2
- package/country-phone-picker/lib/country-phone-picker/country-phone-picker.component.d.ts +0 -1
- package/datepicker/README.md +6 -2
- package/datepicker/lib/datepicker/date-segment-input.d.ts +7 -1
- package/datepicker/lib/datepicker/datepicker.component.d.ts +137 -3
- package/dialog/lib/src/dialog/services/dialog.service.d.ts +2 -0
- package/esm2022/accordion/lib/accordion/components/accordion-panel/accordion-panel.component.mjs +3 -3
- package/esm2022/autocomplete/lib/autocomplete/autocomplete.component.mjs +8 -3
- package/esm2022/autocomplete/lib/autocomplete/components/autocomplete-chip/autocomplete-chip.component.mjs +4 -3
- package/esm2022/breadcrumb/lib/breadcrumb/breadcrumb.component.mjs +3 -3
- package/esm2022/breadcrumb/lib/dynamic-breadcrumb/dynamic-breadcrumb.component.mjs +4 -2
- package/esm2022/button/lib/button/button.component.mjs +3 -3
- package/esm2022/card/lib/card/card.component.mjs +13 -5
- package/esm2022/checkbox/lib/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/checkbox-list/lib/checkbox-list/checkbox-list.component.mjs +3 -3
- package/esm2022/chips/lib/chips/chip-item/chip-item.component.mjs +3 -3
- package/esm2022/chips/lib/chips/chips/chips.component.mjs +3 -3
- package/esm2022/code-editor/lib/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.mjs +3 -2
- package/esm2022/collapse-link/lib/collapse-link/collapse-link.component.mjs +3 -3
- package/esm2022/country-phone-picker/lib/country-phone-picker/country-phone-picker.component.mjs +14 -9
- package/esm2022/datepicker/lib/datepicker/date-segment-input.mjs +19 -2
- package/esm2022/datepicker/lib/datepicker/datepicker.component.mjs +405 -38
- package/esm2022/dialog/lib/src/dialog/dialog.component.mjs +3 -3
- package/esm2022/dialog/lib/src/dialog/services/dialog.service.mjs +13 -1
- package/esm2022/drawer/lib/drawer/drawer.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/password/password-field.component.mjs +3 -3
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/text/text-field.component.mjs +3 -3
- package/esm2022/editor/lib/editor/editor.component.mjs +3 -3
- package/esm2022/editor/lib/editor/toolbar-button/editor-toolbar-button.component.mjs +3 -3
- package/esm2022/fieldset/lib/fieldset/fieldset.component.mjs +3 -3
- package/esm2022/file-picker/lib/file-picker/file-picker.component.mjs +3 -3
- package/esm2022/gantt/lib/gantt/components/gantt/bar.mjs +2 -1
- package/esm2022/gantt/lib/gantt/gantt.component.mjs +3 -3
- package/esm2022/global-search/lib/global-search/global-search.component.mjs +16 -25
- package/esm2022/grid-menu/lib/grid-menu/components/grid-menu-item/grid-menu-item.component.mjs +3 -3
- package/esm2022/input-text/lib/input-text/input-text.directive.mjs +3 -3
- package/esm2022/lib/locale/fallback.mjs +40 -13
- package/esm2022/navigation-button/lib/navigation-button/navigation-button.component.mjs +3 -3
- package/esm2022/object-card/lib/object-card/object-card.component.mjs +3 -3
- package/esm2022/paginator/lib/paginator/paginator.component.mjs +3 -3
- package/esm2022/pin-code-field/lib/pin-code-field/pin-code-field.component.mjs +3 -3
- package/esm2022/radio-button/lib/radio-button/radio-button.component.mjs +4 -10
- package/esm2022/rating-scale/lib/rating-scale/rating-scale.component.mjs +3 -3
- package/esm2022/select/lib/select/select.component.mjs +3 -3
- package/esm2022/select-button/lib/select-button/components/select-button-item/select-button-item.component.mjs +3 -3
- package/esm2022/shared/lib/accessibility/datepicker-no-period-tab.directive.mjs +6 -6
- package/esm2022/side-sheet/lib/side-sheet/side-sheet.component.mjs +3 -3
- package/esm2022/slider/lib/slider/slider.component.mjs +67 -65
- package/esm2022/slider/lib/slider/slider.module.mjs +2 -2
- package/esm2022/split-button/lib/split-button/split-button.component.mjs +3 -3
- package/esm2022/star-rating/star-rating/star-rating.component.mjs +3 -3
- package/esm2022/stepper/lib/stepper/stepper.component.mjs +3 -3
- package/esm2022/switch/lib/switch/switch.component.mjs +5 -19
- package/esm2022/tabs/lib/tabs/tabs.component.mjs +3 -3
- package/esm2022/text-area/lib/text-area/text-area.component.mjs +3 -3
- package/esm2022/thumbnail/lib/thumbnail/thumbnail.component.mjs +10 -3
- package/esm2022/thumbnails/lib/thumbnails/components/thumbnail-item/thumbnail-item.component.mjs +3 -3
- package/esm2022/tiered-menu/lib/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.mjs +3 -3
- package/esm2022/tiered-menu/lib/tiered-menu/services/tiered-menu.global.service.mjs +4 -3
- package/esm2022/tile/lib/tile/tile.component.mjs +3 -3
- package/esm2022/tree/lib/tree/components/tree-node-item/tree-node-item.component.mjs +20 -3
- package/esm2022/workspace-switch/lib/workspace-switch/workspace-switch.component.mjs +3 -3
- package/fesm2022/seniorsistemas-angular-components-accordion.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-accordion.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-autocomplete.mjs +10 -5
- package/fesm2022/seniorsistemas-angular-components-autocomplete.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-breadcrumb.mjs +5 -3
- package/fesm2022/seniorsistemas-angular-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-button.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-card.mjs +12 -4
- package/fesm2022/seniorsistemas-angular-components-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-checkbox-list.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-checkbox-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-checkbox.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-chips.mjs +4 -4
- package/fesm2022/seniorsistemas-angular-components-chips.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-code-editor.mjs +2 -1
- package/fesm2022/seniorsistemas-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-collapse-link.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-collapse-link.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-country-phone-picker.mjs +13 -8
- package/fesm2022/seniorsistemas-angular-components-country-phone-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-datepicker.mjs +422 -38
- package/fesm2022/seniorsistemas-angular-components-datepicker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dialog.mjs +14 -2
- package/fesm2022/seniorsistemas-angular-components-dialog.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +12 -12
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-editor.mjs +4 -4
- package/fesm2022/seniorsistemas-angular-components-editor.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-fieldset.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-fieldset.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-file-picker.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-file-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-gantt.mjs +3 -2
- package/fesm2022/seniorsistemas-angular-components-gantt.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-global-search.mjs +14 -23
- package/fesm2022/seniorsistemas-angular-components-global-search.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-grid-menu.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-grid-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-input-text.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-input-text.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-navigation-button.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-navigation-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-object-card.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-object-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-paginator.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-paginator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-pin-code-field.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-pin-code-field.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-radio-button.mjs +3 -9
- package/fesm2022/seniorsistemas-angular-components-radio-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-rating-scale.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-rating-scale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select-button.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-shared.mjs +5 -5
- package/fesm2022/seniorsistemas-angular-components-shared.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-side-sheet.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-side-sheet.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-slider.mjs +67 -65
- package/fesm2022/seniorsistemas-angular-components-slider.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-split-button.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-split-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-star-rating.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-star-rating.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-stepper.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-switch.mjs +4 -18
- package/fesm2022/seniorsistemas-angular-components-switch.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tabs.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-tabs.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-thumbnail.mjs +9 -2
- package/fesm2022/seniorsistemas-angular-components-thumbnail.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-thumbnails.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-thumbnails.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tiered-menu.mjs +5 -4
- package/fesm2022/seniorsistemas-angular-components-tiered-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tile.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-tile.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tree.mjs +20 -3
- package/fesm2022/seniorsistemas-angular-components-tree.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-workspace-switch.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-workspace-switch.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components.mjs +39 -12
- package/fesm2022/seniorsistemas-angular-components.mjs.map +1 -1
- package/global-search/lib/global-search/global-search.component.d.ts +7 -3
- package/package.json +1 -1
- package/radio-button/lib/radio-button/radio-button.component.d.ts +0 -1
- package/slider/lib/slider/slider.component.d.ts +25 -7
- package/styles.css +5 -0
- package/switch/lib/switch/switch.component.d.ts +0 -2
- package/thumbnail/lib/thumbnail/thumbnail.component.d.ts +1 -0
- package/tree/lib/tree/components/tree-node-item/tree-node-item.component.d.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-fieldset.mjs","sources":["../../projects/angular-components/fieldset/src/lib/fieldset/fieldset.component.ts","../../projects/angular-components/fieldset/src/lib/fieldset/fieldset.component.html","../../projects/angular-components/fieldset/src/lib/fieldset/fieldset.module.ts","../../projects/angular-components/fieldset/src/seniorsistemas-angular-components-fieldset.ts"],"sourcesContent":["import { animate, AnimationEvent, state, style, transition, trigger } from '@angular/animations';\r\nimport {\r\n AfterViewInit,\r\n Component,\r\n computed,\r\n contentChildren,\r\n EventEmitter,\r\n input,\r\n model,\r\n Output,\r\n signal,\r\n} from '@angular/core';\r\n\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { InteractiveContentDirective } from '@seniorsistemas/angular-components/interactive-content';\r\nimport { TemplateDirective } from '@seniorsistemas/angular-components/template';\r\nimport { FieldSetToggle } from './fieldset.models';\r\n\r\n/**\r\n * @description Componente de fieldset com legenda, ícone configurável e suporte a\r\n * toggle (recolher/expandir) com animação. Suporta templates personalizados via\r\n * diretiva `TemplateDirective`, com os tipos `'header'` (substitui a legenda) e\r\n * `'body'` (conteúdo do fieldset).\r\n *\r\n * Prefira declarar o conteúdo em `sTemplate=\"body\"` em vez de projetá-lo direto:\r\n * o `ng-content` é instanciado pelo componente pai mesmo com o fieldset recolhido,\r\n * disparando o `ngOnInit` dos filhos prematuramente. O template de corpo só é\r\n * instanciado quando o fieldset está de fato ativo, e é obrigatório para que\r\n * `destroyOnHide` funcione.\r\n *\r\n * @example\r\n * ```html\r\n * <s-fieldset legend=\"Dados pessoais\" [toggleable]=\"true\">\r\n * <ng-template sTemplate=\"body\">\r\n * <p>Conteúdo do fieldset</p>\r\n * </ng-template>\r\n * </s-fieldset>\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-fieldset',\r\n templateUrl: './fieldset.component.html',\r\n styles: [':host { display: block; }'],\r\n animations: [\r\n trigger('toggleAnimation', [\r\n transition(':enter', [\r\n style({ opacity: 0, height: 0 }),\r\n animate('300ms ease-out', style({ opacity: 1, height: '*' })),\r\n ]),\r\n transition(':leave', [\r\n style({ opacity: 1, height: '*' }),\r\n animate('300ms ease-in', style({ opacity: 0, height: 0 })),\r\n ]),\r\n state('open', style({ opacity: 1, height: '*' })),\r\n state('closed', style({ opacity: 0, height: 0 })),\r\n transition('open <=> closed', animate('300ms ease')),\r\n ]),\r\n ],\r\n standalone: true,\r\n imports: [InteractiveContentDirective, NgTemplateOutlet],\r\n})\r\nexport class FieldsetComponent implements AfterViewInit {\r\n /** @description Texto exibido como título do fieldset. @default '' */\r\n legend = input('');\r\n /** @description Habilita o botão de toggle que permite recolher e expandir o conteúdo. @default false */\r\n toggleable = input(false);\r\n /** @description Classe de ícone exibida ao lado da legenda (ex.: `'fas fa-cog'`). @default '' */\r\n icon = input('');\r\n /** @description Quando `true`, remove o conteúdo do DOM ao recolher o fieldset. @default false */\r\n destroyOnHide = input(false);\r\n\r\n templateDirectives = contentChildren(TemplateDirective);\r\n headerTemplate = computed(() => {\r\n return this.templateDirectives()?.find((template) => template.type === 'header')?.template;\r\n });\r\n\r\n bodyTemplate = computed(() => {\r\n return this.templateDirectives()?.find((template) => template.type === 'body')?.template;\r\n });\r\n /** @description Emitido imediatamente antes da animação de toggle iniciar, com o estado atual. */\r\n @Output() beforeToggle = new EventEmitter<FieldSetToggle>();\r\n /** @description Emitido após a animação de toggle concluir, com o novo estado. */\r\n @Output() afterToggle = new EventEmitter<FieldSetToggle>();\r\n\r\n active = model(true);\r\n\r\n /** @description `true` quando a animação de fechamento já terminou, aplicando `overflow-hidden` ao conteúdo. */\r\n protected collapsed = signal(false);\r\n\r\n ngAfterViewInit() {\r\n const hasBodyTemplate = this.bodyTemplate();\r\n if (!hasBodyTemplate && this.destroyOnHide()) {\r\n console.warn(\r\n 'FieldsetComponent: O uso de destroyOnHide=true requer um template de corpo definido com sTemplate=\"body\".',\r\n );\r\n }\r\n }\r\n\r\n protected toggleActive(originalEvent: PointerEvent | KeyboardEvent) {\r\n if (!this.toggleable()) {\r\n return;\r\n }\r\n this.beforeToggle.next({ collapsed: this.active(), originalEvent });\r\n this.active.set(!this.active());\r\n this.afterToggle.next({ collapsed: this.active(), originalEvent });\r\n }\r\n\r\n protected onToggleAnimationDone(event: AnimationEvent) {\r\n this.collapsed.set(event.toState === 'closed');\r\n }\r\n}\r\n","<fieldset\r\n class=\"mb-[10px] min-h-[4.5em] w-full min-w-0 rounded-xbig border border-grayscale-20 bg-grayscale-0 px-2 py-1.5\"\r\n>\r\n <legend\r\n class=\"ml-4 flex select-none items-center gap-1 px-1 font-open-sans text-sm font-bold text-grayscale-90\"\r\n [class.cursor-pointer]=\"toggleable()\"\r\n (sInteractiveContent)=\"toggleActive($event)\"\r\n >\r\n @if (toggleable()) {\r\n @if (active()) {\r\n <i class=\"fas fa-minus\"></i>\r\n } @else {\r\n <i class=\"fas fa-plus\"></i>\r\n }\r\n }\r\n @let _headerTemplate = headerTemplate();\r\n @if (_headerTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_headerTemplate\"></ng-container>\r\n } @else {\r\n @if (icon()) {\r\n <i [class]=\"icon()\"></i>\r\n }\r\n {{ legend() }}\r\n }\r\n </legend>\r\n @if (destroyOnHide() ? (toggleable() ? active() : true) : true) {\r\n <div\r\n [@toggleAnimation]=\"destroyOnHide() ? null : active() ? 'open' : 'closed'\"\r\n (@toggleAnimation.done)=\"onToggleAnimationDone($event)\"\r\n [class.overflow-hidden]=\"collapsed()\"\r\n >\r\n @let _bodyTemplate = bodyTemplate();\r\n @if (_bodyTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_bodyTemplate\"></ng-container>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n </div>\r\n }\r\n</fieldset>\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { FieldsetComponent } from './fieldset.component';\r\n\r\n@NgModule({\r\n imports: [FieldsetComponent],\r\n exports: [FieldsetComponent],\r\n})\r\nexport class FieldsetModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAuBU,iBAAiB,CAAA;;AAE1B,IAAA,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;;AAEnB,IAAA,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;;AAE1B,IAAA,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;;AAEjB,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAE7B,IAAA,kBAAkB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AACxD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAK;QAC3B,OAAO,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,EAAE,QAAQ,CAAC;AAC/F,KAAC,CAAC,CAAC;AAEH,IAAA,YAAY,GAAG,QAAQ,CAAC,MAAK;QACzB,OAAO,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC;AAC7F,KAAC,CAAC,CAAC;;AAEO,IAAA,YAAY,GAAG,IAAI,YAAY,EAAkB,CAAC;;AAElD,IAAA,WAAW,GAAG,IAAI,YAAY,EAAkB,CAAC;AAE3D,IAAA,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;;AAGX,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,eAAe,GAAA;AACX,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,Y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CAAC,EAAE,CAAC,CAAC;6BAC7D,CAAC;AACF,4BAAA,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AACjD,4BAAA,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AACjD,4BAAA,UAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;yBACvD,CAAC;AACL,qBAAA,EAAA,UAAA,EACW,IAAI,EACP,OAAA,EAAA,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,6iDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,CAAA;8BAqB9C,YAAY,EAAA,CAAA;sBAArB,MAAM;gBAEG,WAAW,EAAA,CAAA;sBAApB,MAAM;;;ME5EE,cAAc,CAAA;wGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,OAAA,EAAA,CAHb,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;yGAElB,cAAc,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-fieldset.mjs","sources":["../../projects/angular-components/fieldset/src/lib/fieldset/fieldset.component.ts","../../projects/angular-components/fieldset/src/lib/fieldset/fieldset.component.html","../../projects/angular-components/fieldset/src/lib/fieldset/fieldset.module.ts","../../projects/angular-components/fieldset/src/seniorsistemas-angular-components-fieldset.ts"],"sourcesContent":["import { animate, AnimationEvent, state, style, transition, trigger } from '@angular/animations';\r\nimport {\r\n AfterViewInit,\r\n Component,\r\n computed,\r\n contentChildren,\r\n EventEmitter,\r\n input,\r\n model,\r\n Output,\r\n signal,\r\n} from '@angular/core';\r\n\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { InteractiveContentDirective } from '@seniorsistemas/angular-components/interactive-content';\r\nimport { TemplateDirective } from '@seniorsistemas/angular-components/template';\r\nimport { FieldSetToggle } from './fieldset.models';\r\n\r\n/**\r\n * @description Componente de fieldset com legenda, ícone configurável e suporte a\r\n * toggle (recolher/expandir) com animação. Suporta templates personalizados via\r\n * diretiva `TemplateDirective`, com os tipos `'header'` (substitui a legenda) e\r\n * `'body'` (conteúdo do fieldset).\r\n *\r\n * Prefira declarar o conteúdo em `sTemplate=\"body\"` em vez de projetá-lo direto:\r\n * o `ng-content` é instanciado pelo componente pai mesmo com o fieldset recolhido,\r\n * disparando o `ngOnInit` dos filhos prematuramente. O template de corpo só é\r\n * instanciado quando o fieldset está de fato ativo, e é obrigatório para que\r\n * `destroyOnHide` funcione.\r\n *\r\n * @example\r\n * ```html\r\n * <s-fieldset legend=\"Dados pessoais\" [toggleable]=\"true\">\r\n * <ng-template sTemplate=\"body\">\r\n * <p>Conteúdo do fieldset</p>\r\n * </ng-template>\r\n * </s-fieldset>\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-fieldset',\r\n templateUrl: './fieldset.component.html',\r\n styles: [':host { display: block; }'],\r\n animations: [\r\n trigger('toggleAnimation', [\r\n transition(':enter', [\r\n style({ opacity: 0, height: 0 }),\r\n animate('300ms ease-out', style({ opacity: 1, height: '*' })),\r\n ]),\r\n transition(':leave', [\r\n style({ opacity: 1, height: '*' }),\r\n animate('300ms ease-in', style({ opacity: 0, height: 0 })),\r\n ]),\r\n state('open', style({ opacity: 1, height: '*' })),\r\n state('closed', style({ opacity: 0, height: 0 })),\r\n transition('open <=> closed', animate('300ms ease')),\r\n ]),\r\n ],\r\n standalone: true,\r\n imports: [InteractiveContentDirective, NgTemplateOutlet],\r\n})\r\nexport class FieldsetComponent implements AfterViewInit {\r\n /** @description Texto exibido como título do fieldset. @default '' */\r\n legend = input('');\r\n /** @description Habilita o botão de toggle que permite recolher e expandir o conteúdo. @default false */\r\n toggleable = input(false);\r\n /** @description Classe de ícone exibida ao lado da legenda (ex.: `'fas fa-cog'`). @default '' */\r\n icon = input('');\r\n /** @description Quando `true`, remove o conteúdo do DOM ao recolher o fieldset. @default false */\r\n destroyOnHide = input(false);\r\n\r\n templateDirectives = contentChildren(TemplateDirective);\r\n headerTemplate = computed(() => {\r\n return this.templateDirectives()?.find((template) => template.type === 'header')?.template;\r\n });\r\n\r\n bodyTemplate = computed(() => {\r\n return this.templateDirectives()?.find((template) => template.type === 'body')?.template;\r\n });\r\n /** @description Emitido imediatamente antes da animação de toggle iniciar, com o estado atual. */\r\n @Output() beforeToggle = new EventEmitter<FieldSetToggle>();\r\n /** @description Emitido após a animação de toggle concluir, com o novo estado. */\r\n @Output() afterToggle = new EventEmitter<FieldSetToggle>();\r\n\r\n active = model(true);\r\n\r\n /** @description `true` quando a animação de fechamento já terminou, aplicando `overflow-hidden` ao conteúdo. */\r\n protected collapsed = signal(false);\r\n\r\n ngAfterViewInit() {\r\n const hasBodyTemplate = this.bodyTemplate();\r\n if (!hasBodyTemplate && this.destroyOnHide()) {\r\n console.warn(\r\n 'FieldsetComponent: O uso de destroyOnHide=true requer um template de corpo definido com sTemplate=\"body\".',\r\n );\r\n }\r\n }\r\n\r\n protected toggleActive(originalEvent: PointerEvent | KeyboardEvent) {\r\n if (!this.toggleable()) {\r\n return;\r\n }\r\n this.beforeToggle.next({ collapsed: this.active(), originalEvent });\r\n this.active.set(!this.active());\r\n this.afterToggle.next({ collapsed: this.active(), originalEvent });\r\n }\r\n\r\n protected onToggleAnimationDone(event: AnimationEvent) {\r\n this.collapsed.set(event.toState === 'closed');\r\n }\r\n}\r\n","<fieldset\r\n class=\"mb-[10px] min-h-[4.5em] w-full min-w-0 rounded-xbig border border-grayscale-20 bg-grayscale-0 px-2 py-1.5\"\r\n>\r\n <legend\r\n class=\"ml-4 flex select-none items-center gap-1 rounded-medium px-1 font-open-sans text-sm font-bold text-grayscale-90 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\r\n [class.cursor-pointer]=\"toggleable()\"\r\n (sInteractiveContent)=\"toggleActive($event)\"\r\n [focusable]=\"toggleable()\"\r\n >\r\n @if (toggleable()) {\r\n @if (active()) {\r\n <i class=\"fas fa-minus\"></i>\r\n } @else {\r\n <i class=\"fas fa-plus\"></i>\r\n }\r\n }\r\n @let _headerTemplate = headerTemplate();\r\n @if (_headerTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_headerTemplate\"></ng-container>\r\n } @else {\r\n @if (icon()) {\r\n <i [class]=\"icon()\"></i>\r\n }\r\n {{ legend() }}\r\n }\r\n </legend>\r\n @if (destroyOnHide() ? (toggleable() ? active() : true) : true) {\r\n <div\r\n [@toggleAnimation]=\"destroyOnHide() ? null : active() ? 'open' : 'closed'\"\r\n (@toggleAnimation.done)=\"onToggleAnimationDone($event)\"\r\n [class.overflow-hidden]=\"collapsed()\"\r\n >\r\n @let _bodyTemplate = bodyTemplate();\r\n @if (_bodyTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_bodyTemplate\"></ng-container>\r\n } @else {\r\n <ng-content></ng-content>\r\n }\r\n </div>\r\n }\r\n</fieldset>\r\n","import { NgModule } from '@angular/core';\r\n\r\nimport { FieldsetComponent } from './fieldset.component';\r\n\r\n@NgModule({\r\n imports: [FieldsetComponent],\r\n exports: [FieldsetComponent],\r\n})\r\nexport class FieldsetModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"m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K,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AACjD,4BAAA,UAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;yBACvD,CAAC;AACL,qBAAA,EAAA,UAAA,EACW,IAAI,EACP,OAAA,EAAA,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,gvDAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,CAAA;8BAqB9C,YAAY,EAAA,CAAA;sBAArB,MAAM;gBAEG,WAAW,EAAA,CAAA;sBAApB,MAAM;;;ME5EE,cAAc,CAAA;wGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAd,cAAc,EAAA,OAAA,EAAA,CAHb,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;yGAElB,cAAc,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -297,7 +297,7 @@ class FilePickerComponent {
|
|
|
297
297
|
removalVersion: '20.0.0',
|
|
298
298
|
},
|
|
299
299
|
},
|
|
300
|
-
], viewQueries: [{ propertyName: "inputUpload", first: true, predicate: ["inputUpload"], descendants: true }, { propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }], hostDirectives: [{ directive: i1.DeprecatedSelectorDirective }], ngImport: i0, template: "<div\n [id]=\"id\"\n class=\"file-picker\"\n>\n <div class=\"file-picker-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formControl?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"file-picker-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"file-picker-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"file-picker-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"file-picker-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [sTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [sTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n </div>\n <div\n class=\"file-picker-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formControl?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".file-picker .file-picker-choose{position:relative;margin:15px 0;width:max-content}.file-picker input[type=file]{display:none}.file-picker-list{border:1px solid #ccc}.file-picker-list-file:not(:first-child){border-top:1px solid #ccc}.file-picker-list .file-picker-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.file-picker-list .file-picker-list-file .file-picker-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.file-picker-list .file-picker-list-file .file-picker-list-file-name .file-picker-list-file-name-date{font-size:.75rem;color:#999}.file-picker-list .file-picker-list-file .file-picker-list-file-name>a{cursor:pointer;text-decoration:none}.file-picker-list .file-picker-list-file .file-picker-list-file-status{align-self:center}.file-picker-list .file-picker-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-check{color:#0c9348;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-times{color:#c13018;font-size:12px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin-top:15px;align-self:center;width:100%}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action{text-decoration:none;color:#428bca}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action:hover,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :focus,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :visited{text-decoration:none}@media (min-width: 768px){.file-picker-list .file-picker-list-file{flex-wrap:nowrap}.file-picker-list .file-picker-list-file .file-picker-list-file-name{width:auto;flex-grow:2}.file-picker-list .file-picker-list-file .file-picker-list-file-status{margin:0 15px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin:0;width:auto}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor", "menuAriaLabel", "ariaLabel"], outputs: ["clicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ProgressBarComponent, selector: "s-progressbar", inputs: ["value", "activeColor", "numberFormatOptions", "targetValue", "label", "targetLabel", "showValue", "mode"] }, { kind: "directive", type: TooltipDirective, selector: "[sTooltip]", inputs: ["sTooltip", "tooltipPosition", "showDelay", "displayTime", "tooltipEvent", "escape", "visible", "mobileBehavior", "focusedInputRef", "checkTruncatedText"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
300
|
+
], viewQueries: [{ propertyName: "inputUpload", first: true, predicate: ["inputUpload"], descendants: true }, { propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true }], hostDirectives: [{ directive: i1.DeprecatedSelectorDirective }], ngImport: i0, template: "<div\n [id]=\"id\"\n class=\"file-picker\"\n>\n <div class=\"file-picker-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formControl?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"file-picker-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"file-picker-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"file-picker-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"file-picker-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [sTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [sTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n </div>\n <div\n class=\"file-picker-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formControl?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".file-picker .file-picker-choose{position:relative;margin:15px 0;width:max-content}.file-picker input[type=file]{display:none}.file-picker-list{border:1px solid #ccc}.file-picker-list-file:not(:first-child){border-top:1px solid #ccc}.file-picker-list .file-picker-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.file-picker-list .file-picker-list-file .file-picker-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.file-picker-list .file-picker-list-file .file-picker-list-file-name .file-picker-list-file-name-date{font-size:.75rem;color:#999}.file-picker-list .file-picker-list-file .file-picker-list-file-name>a{cursor:pointer;text-decoration:none}.file-picker-list .file-picker-list-file .file-picker-list-file-status{align-self:center}.file-picker-list .file-picker-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-check{color:#0c9348;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-times{color:#c13018;font-size:12px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin-top:15px;align-self:center;width:100%}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action{text-decoration:none;color:#428bca}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action:hover,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :focus,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :visited{text-decoration:none}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action:focus-visible{border-radius:2px;outline:2px solid var(--s-focus-ring-color);outline-offset:3px}@media (min-width: 768px){.file-picker-list .file-picker-list-file{flex-wrap:nowrap}.file-picker-list .file-picker-list-file .file-picker-list-file-name{width:auto;flex-grow:2}.file-picker-list .file-picker-list-file .file-picker-list-file-status{margin:0 15px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin:0;width:auto}}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "s-button", inputs: ["id", "label", "tooltip", "tooltipPosition", "iconClass", "rightIconClass", "caret", "styleClass", "baseZIndex", "disabled", "auxiliary", "type", "priority", "menuOptions", "size", "slide", "animation", "badge", "iconColor", "menuAriaLabel", "ariaLabel"], outputs: ["clicked"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ProgressBarComponent, selector: "s-progressbar", inputs: ["value", "activeColor", "numberFormatOptions", "targetValue", "label", "targetLabel", "showValue", "mode"] }, { kind: "directive", type: TooltipDirective, selector: "[sTooltip]", inputs: ["sTooltip", "tooltipPosition", "showDelay", "displayTime", "tooltipEvent", "escape", "visible", "mobileBehavior", "focusedInputRef", "checkTruncatedText"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
301
301
|
}
|
|
302
302
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FilePickerComponent, decorators: [{
|
|
303
303
|
type: Component,
|
|
@@ -310,7 +310,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
310
310
|
removalVersion: '20.0.0',
|
|
311
311
|
},
|
|
312
312
|
},
|
|
313
|
-
], standalone: true, imports: [ButtonComponent, NgTemplateOutlet, ProgressBarComponent, TooltipDirective, TranslatePipe], template: "<div\n [id]=\"id\"\n class=\"file-picker\"\n>\n <div class=\"file-picker-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formControl?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"file-picker-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"file-picker-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"file-picker-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"file-picker-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [sTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [sTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n </div>\n <div\n class=\"file-picker-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formControl?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".file-picker .file-picker-choose{position:relative;margin:15px 0;width:max-content}.file-picker input[type=file]{display:none}.file-picker-list{border:1px solid #ccc}.file-picker-list-file:not(:first-child){border-top:1px solid #ccc}.file-picker-list .file-picker-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.file-picker-list .file-picker-list-file .file-picker-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.file-picker-list .file-picker-list-file .file-picker-list-file-name .file-picker-list-file-name-date{font-size:.75rem;color:#999}.file-picker-list .file-picker-list-file .file-picker-list-file-name>a{cursor:pointer;text-decoration:none}.file-picker-list .file-picker-list-file .file-picker-list-file-status{align-self:center}.file-picker-list .file-picker-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-check{color:#0c9348;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-times{color:#c13018;font-size:12px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin-top:15px;align-self:center;width:100%}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action{text-decoration:none;color:#428bca}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action:hover,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :focus,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :visited{text-decoration:none}@media (min-width: 768px){.file-picker-list .file-picker-list-file{flex-wrap:nowrap}.file-picker-list .file-picker-list-file .file-picker-list-file-name{width:auto;flex-grow:2}.file-picker-list .file-picker-list-file .file-picker-list-file-status{margin:0 15px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin:0;width:auto}}\n"] }]
|
|
313
|
+
], standalone: true, imports: [ButtonComponent, NgTemplateOutlet, ProgressBarComponent, TooltipDirective, TranslatePipe], template: "<div\n [id]=\"id\"\n class=\"file-picker\"\n>\n <div class=\"file-picker-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formControl?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"file-picker-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"file-picker-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"file-picker-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"file-picker-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [sTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [sTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n </div>\n <div\n class=\"file-picker-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formControl?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n", styles: [".file-picker .file-picker-choose{position:relative;margin:15px 0;width:max-content}.file-picker input[type=file]{display:none}.file-picker-list{border:1px solid #ccc}.file-picker-list-file:not(:first-child){border-top:1px solid #ccc}.file-picker-list .file-picker-list-file{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:15px}.file-picker-list .file-picker-list-file .file-picker-list-file-name{display:flex;flex-direction:column;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.file-picker-list .file-picker-list-file .file-picker-list-file-name .file-picker-list-file-name-date{font-size:.75rem;color:#999}.file-picker-list .file-picker-list-file .file-picker-list-file-name>a{cursor:pointer;text-decoration:none}.file-picker-list .file-picker-list-file .file-picker-list-file-status{align-self:center}.file-picker-list .file-picker-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-check{color:#0c9348;font-size:12px}.file-picker-list .file-picker-list-file .fas.fa-times{color:#c13018;font-size:12px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin-top:15px;align-self:center;width:100%}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action{text-decoration:none;color:#428bca}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action:hover,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :focus,.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action :visited{text-decoration:none}.file-picker-list .file-picker-list-file .file-picker-list-file-actions a.file-picker-list-file-actions-action:focus-visible{border-radius:2px;outline:2px solid var(--s-focus-ring-color);outline-offset:3px}@media (min-width: 768px){.file-picker-list .file-picker-list-file{flex-wrap:nowrap}.file-picker-list .file-picker-list-file .file-picker-list-file-name{width:auto;flex-grow:2}.file-picker-list .file-picker-list-file .file-picker-list-file-status{margin:0 15px}.file-picker-list .file-picker-list-file .file-picker-list-file-actions{margin:0;width:auto}}\n"] }]
|
|
314
314
|
}], propDecorators: { inputUpload: [{
|
|
315
315
|
type: ViewChild,
|
|
316
316
|
args: ['inputUpload', { static: false }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-file-picker.mjs","sources":["../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.service.ts","../../projects/angular-components/file-picker/src/lib/file-picker/models/file-picker-permissions.ts","../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.component.ts","../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.component.html","../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.module.ts","../../projects/angular-components/file-picker/src/seniorsistemas-angular-components-file-picker.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { CustomHttpClient } from '@seniorsistemas/angular-components/common';\n\nimport { ListBlobMetadataRequest, ListBlobMetadataResponse } from './models/list-blob-metadata';\n\n@Injectable()\nexport class FilePickerService {\n private BASE_URL_FIELD_CUSTOMIZATION = 'platform/field_customization';\n private TOKEN = new AbortController();\n\n public async getMetadataCustomField<T>(request: ListBlobMetadataRequest): Promise<ListBlobMetadataResponse> {\n return CustomHttpClient.post(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, {\n signal: this.TOKEN.signal,\n });\n }\n}\n","export type FilePickerPermissions = 'add' | 'read' | 'remove';\n\nexport const ALL_PERMISSIONS: FilePickerPermissions[] = ['add', 'read', 'remove'];\n","import {\r\n AfterContentInit,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n inject,\r\n} from '@angular/core';\r\nimport { FormControl } from '@angular/forms';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\n\r\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\r\nimport { DEPRECATED_CONFIG } from '@seniorsistemas/angular-components/common/deprecated-selector';\r\nimport { DeprecatedSelectorDirective } from '@seniorsistemas/angular-components/common/deprecated-selector';\r\nimport { Breakpoints, isNullOrUndefined } from '@seniorsistemas/angular-components/utils';\r\nimport moment from 'moment';\r\nimport { Subject } from 'rxjs';\r\n\r\nimport { FilePickerService } from './file-picker.service';\r\nimport { FileDto } from './models/file-dto';\r\nimport { ALL_PERMISSIONS, FilePickerPermissions } from './models/file-picker-permissions';\r\nimport { ListBlobMetadataResponse } from './models/list-blob-metadata';\r\nimport { UploadError } from './models/uploadError';\r\nimport { ButtonComponent } from '@seniorsistemas/angular-components/button';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { ProgressBarComponent } from '@seniorsistemas/angular-components/progressbar';\r\nimport { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';\r\n\r\n/**\r\n * @description Componente de upload de arquivos com suporte a seleção múltipla,\r\n * validação de tipo/tamanho, controle de permissões (adicionar, ler, remover),\r\n * download e cancelamento de uploads em andamento.\r\n *\r\n * @example\r\n * ```html\r\n * <s-file-picker\r\n * [multiple]=\"true\"\r\n * accept=\"application/pdf\"\r\n * [maxFileSize]=\"5242880\"\r\n * [files]=\"arquivos\"\r\n * (uploadHandler)=\"onUpload($event)\"\r\n * (removeFile)=\"onRemove($event)\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-file-picker, s-file-upload',\r\n templateUrl: './file-picker.component.html',\r\n styleUrls: ['./file-picker.component.scss'],\r\n hostDirectives: [DeprecatedSelectorDirective],\r\n providers: [\r\n {\r\n provide: DEPRECATED_CONFIG,\r\n useValue: {\r\n oldSelector: 's-file-upload',\r\n newSelector: 's-file-picker',\r\n removalVersion: '20.0.0',\r\n },\r\n },\r\n ],\r\n standalone: true,\r\n imports: [ButtonComponent, NgTemplateOutlet, ProgressBarComponent, TooltipDirective, TranslatePipe],\r\n})\r\nexport class FilePickerComponent implements OnInit, OnDestroy, AfterContentInit {\r\n private readonly sanitizer = inject(DomSanitizer);\r\n private readonly filePickerService = inject(FilePickerService);\r\n private readonly translate = inject(TranslateService);\r\n\r\n public static nextId = 0;\r\n\r\n public ADD_PERMISSION: FilePickerPermissions = 'add';\r\n public READ_PERMISSION: FilePickerPermissions = 'read';\r\n public REMOVE_PERMISSION: FilePickerPermissions = 'remove';\r\n\r\n @ViewChild('inputUpload', { static: false })\r\n private readonly inputUpload: ElementRef | null = null;\r\n\r\n @ViewChild('anchor', { static: false })\r\n private readonly anchor: ElementRef | null = null;\r\n\r\n /** @description Identificador do componente no DOM. Gerado automaticamente se não informado. */\r\n @Input()\r\n public id = `s-file-picker-${FilePickerComponent.nextId++}`;\r\n\r\n /** @description Rótulo do botão de seleção de arquivo. */\r\n @Input()\r\n public chooseLabel?: string;\r\n\r\n /** @description Rótulo do botão de remoção de arquivo. */\r\n @Input()\r\n public removeLabel?: string;\r\n\r\n /** @description Rótulo do botão de cancelamento de upload. */\r\n @Input()\r\n public cancelLabel?: string;\r\n\r\n /** @description Texto do tooltip exibido após upload bem-sucedido. */\r\n @Input()\r\n public successTooltip?: string;\r\n\r\n /** @description Permite selecionar múltiplos arquivos ao mesmo tempo. */\r\n @Input()\r\n public multiple?: boolean;\r\n\r\n /** @description Tipos MIME aceitos pelo seletor de arquivo (ex.: `'application/pdf,image/*'`). */\r\n @Input()\r\n public accept?: string;\r\n\r\n /** @description Lista de extensões de arquivo aceitas para validação (ex.: `['.pdf', '.docx']`). @default [] */\r\n @Input()\r\n public supportedExtensions: string[] = [];\r\n\r\n /** @description Label ARIA para o nome do arquivo, para leitores de tela. */\r\n @Input()\r\n public ariaLabelFileName?: string;\r\n\r\n /** @description Tamanho máximo por arquivo em bytes. */\r\n @Input()\r\n public maxFileSize?: number;\r\n\r\n /** @description Tamanho máximo combinado de todos os arquivos em bytes. */\r\n @Input()\r\n public maxCombinedFileSize?: number;\r\n\r\n /** @description Número máximo de arquivos que podem ser selecionados. */\r\n @Input()\r\n public fileLimit?: number;\r\n\r\n /** @description Label ARIA para a barra de progresso do upload. */\r\n @Input()\r\n public ariaLabelProgress?: string;\r\n\r\n /** @description Label ARIA para o ícone de sucesso. */\r\n @Input()\r\n public ariaLabelSuccess?: string;\r\n\r\n /** @description Label ARIA para mensagens de erro de validação. */\r\n @Input()\r\n public ariaLabelError?: string;\r\n\r\n /** @description Label ARIA para o botão de remoção de arquivo. */\r\n @Input()\r\n public ariaLabelRemove?: string;\r\n\r\n /** @description FormControl externo vinculado ao componente para controle de estado. */\r\n @Input()\r\n public formControl?: FormControl;\r\n\r\n /** @description Desabilita todas as interações do componente. @default false */\r\n @Input()\r\n public disabled = false;\r\n\r\n /** @description Exibe a data de upload de cada arquivo. @default false */\r\n @Input()\r\n public showFileUploadDate: boolean = false;\r\n\r\n /** @description Lista de permissões habilitadas no componente: `'add'`, `'read'`, `'remove'`. @default ALL_PERMISSIONS */\r\n @Input()\r\n public permissions: FilePickerPermissions[] = ALL_PERMISSIONS;\r\n\r\n /**\r\n * @description Lista de arquivos já enviados a serem exibidos no componente.\r\n * Ao atribuir, os arquivos são processados e suas URLs são geradas para preview.\r\n */\r\n @Input()\r\n public set files(files: FileDto[]) {\r\n if (!files || files?.length === 0) {\r\n this._files = [];\r\n return;\r\n }\r\n if (this.showFileUploadDate && files[0]?.objectId) {\r\n this.getUploadDate(files);\r\n }\r\n this._files = files.map((file) => {\r\n file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));\r\n return file;\r\n });\r\n }\r\n\r\n /** @description Emitido quando o usuário seleciona arquivos válidos para upload. */\r\n @Output()\r\n public uploadHandler: EventEmitter<{ files: FileDto[] }> = new EventEmitter();\r\n\r\n /** @description Emitido quando o usuário remove um arquivo da lista. */\r\n @Output()\r\n public removeFile: EventEmitter<{ file: File }> = new EventEmitter();\r\n\r\n /** @description Emitido quando o usuário cancela um upload em andamento. Emite o índice do arquivo cancelado. */\r\n @Output()\r\n public cancelUpload: EventEmitter<number> = new EventEmitter();\r\n\r\n /** @description Emitido quando o usuário clica para baixar um arquivo. */\r\n @Output()\r\n public downloadFile: EventEmitter<{ index: number; anchor: ElementRef }> = new EventEmitter();\r\n\r\n /** @description Emitido quando um arquivo não passa na validação de tipo, tamanho ou limite. */\r\n @Output()\r\n public validateErrors: EventEmitter<UploadError> = new EventEmitter();\r\n\r\n private _files: FileDto[] = [];\r\n private readonly ngUsubscribe: Subject<void> = new Subject();\r\n public isSmallDevice = false;\r\n public inputValue = '';\r\n public modifiedDate?: string;\r\n\r\n public ngOnInit(): void {\r\n this.supportedExtensions = this.supportedExtensions.map((extension) =>\r\n extension.replace('.', '').toLowerCase(),\r\n );\r\n }\r\n\r\n public ngOnDestroy() {\r\n this.ngUsubscribe.next();\r\n this.ngUsubscribe.complete();\r\n }\r\n\r\n public ngAfterContentInit() {\r\n this.update();\r\n }\r\n\r\n @HostListener('window:resize')\r\n public onResize() {\r\n this.update();\r\n }\r\n\r\n public _onInputFileSelect($event: Event): void {\r\n const eventTargetFiles = ($event.target as HTMLInputElement)?.files as FileList;\r\n const dataTransferFiles = ($event as DragEvent).dataTransfer?.files as FileList;\r\n const files: FileDto[] = Array.from(dataTransferFiles ? dataTransferFiles : eventTargetFiles);\r\n this.onFileSelect(files);\r\n }\r\n\r\n public onFileSelect(files: FileDto[]): void {\r\n const newFiles: FileDto[] = [];\r\n\r\n if (!this.multiple) {\r\n this.files = [];\r\n }\r\n\r\n if (this.isFileLimitExceeded(files)) {\r\n this.validateErrors.emit({\r\n files,\r\n validation: 'maxFileLimit',\r\n });\r\n this.clearFileInput();\r\n return;\r\n }\r\n\r\n if (this.isFileCombinedSizeExceeded(files)) {\r\n this.validateErrors.emit({\r\n files: files,\r\n validation: 'maxCombinedFileSize',\r\n });\r\n this.clearFileInput();\r\n return;\r\n }\r\n\r\n for (const file of files) {\r\n if (this.isUnsupportedFileExtension(file)) {\r\n this.validateErrors.emit({\r\n files: [file],\r\n validation: 'unsupportedExtension',\r\n });\r\n continue;\r\n }\r\n\r\n if (this.isFileSizeExceeded(file)) {\r\n this.validateErrors.emit({\r\n files: [file],\r\n validation: 'maxFileSize',\r\n });\r\n continue;\r\n }\r\n\r\n newFiles.push(file);\r\n }\r\n\r\n if (newFiles.length) {\r\n this.files = this.files.concat(newFiles);\r\n this.uploadHandler.emit({\r\n files: newFiles,\r\n });\r\n }\r\n\r\n this.clearFileInput();\r\n }\r\n\r\n public onRemoveFile(file: FileDto): void {\r\n const fileIndex = this.files.indexOf(file);\r\n const removedFiles = this.files.splice(fileIndex, 1);\r\n\r\n if (removedFiles.length) {\r\n this.removeFile.emit({ file });\r\n }\r\n }\r\n\r\n public onCancelUpload(index: number) {\r\n const removedFiles = this.files.splice(index, 1);\r\n\r\n if (removedFiles.length) {\r\n this.cancelUpload.emit(index);\r\n }\r\n\r\n this.clearFileInput();\r\n }\r\n\r\n public onDowloadFile(index: number) {\r\n if (isNullOrUndefined(this.anchor)) return;\r\n\r\n this.downloadFile.emit({\r\n index,\r\n anchor: this.anchor,\r\n });\r\n }\r\n\r\n public get files(): FileDto[] {\r\n return this._files;\r\n }\r\n\r\n public formatFileSize(size: number): string {\r\n if (size === 0) {\r\n return '0 Bytes';\r\n }\r\n const k = 1024;\r\n const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB'];\r\n const i = Math.floor(Math.log(size) / Math.log(k));\r\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\r\n }\r\n\r\n private update() {\r\n const windowWidth = window.innerWidth;\r\n this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;\r\n }\r\n\r\n private isFileLimitExceeded(files: FileDto[]) {\r\n if (!this.fileLimit) {\r\n return false;\r\n }\r\n return this.files.length + files.length > this.fileLimit;\r\n }\r\n\r\n private isFileCombinedSizeExceeded(files: File[]): boolean {\r\n if (!this.maxCombinedFileSize) {\r\n return false;\r\n }\r\n\r\n const filesList = [...files, ...this.files];\r\n\r\n const combinedSize = filesList.reduce((combinedSize, file) => combinedSize + file.size, 0);\r\n\r\n return combinedSize > this.maxCombinedFileSize;\r\n }\r\n\r\n private isFileSizeExceeded(file: File): boolean {\r\n if (!this.maxFileSize) {\r\n return false;\r\n }\r\n return file.size > this.maxFileSize;\r\n }\r\n\r\n private isUnsupportedFileExtension(file: File) {\r\n if (this.supportedExtensions?.length) {\r\n const extension = file.name.split('.').pop()?.toLowerCase() ?? '';\r\n\r\n return !this.supportedExtensions.includes(extension);\r\n }\r\n return false;\r\n }\r\n\r\n private clearFileInput() {\r\n if (isNullOrUndefined(this.inputUpload?.nativeElement)) return;\r\n\r\n this.inputUpload.nativeElement.value = null;\r\n }\r\n\r\n private getUploadDate(blobFile: FileDto[]): void {\r\n if (!blobFile) {\r\n return;\r\n }\r\n\r\n this.filePickerService\r\n .getMetadataCustomField({ objectId: blobFile[0].objectId ?? '' })\r\n .then((metadata) => this.setModifiedDate(metadata));\r\n }\r\n\r\n private setModifiedDate(metadata: ListBlobMetadataResponse): void {\r\n const hour = moment(metadata.modified).format('HH');\r\n const minutes = moment(metadata.modified).format('mm');\r\n const day = moment(metadata.modified).format('DD');\r\n const month = moment(metadata.modified).format('MM');\r\n const fullYear = moment(metadata.modified).format('YYYY');\r\n\r\n this.modifiedDate = this.translate.instant('platform.angular_components.date_modified_custom_blob', {\r\n hour,\r\n minutes,\r\n day,\r\n month,\r\n fullYear,\r\n });\r\n }\r\n}\r\n","<div\n [id]=\"id\"\n class=\"file-picker\"\n>\n <div class=\"file-picker-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formControl?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"file-picker-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"file-picker-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"file-picker-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"file-picker-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [sTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [sTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n </div>\n <div\n class=\"file-picker-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formControl?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n","import { NgModule } from '@angular/core';\r\n\r\nimport { FilePickerComponent } from './file-picker.component';\r\nimport { FilePickerService } from './file-picker.service';\r\n\r\n@NgModule({\r\n imports: [FilePickerComponent],\r\n providers: [FilePickerService],\r\n exports: [FilePickerComponent],\r\n})\r\nexport class FilePickerModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAOa,iBAAiB,CAAA;IAClB,4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C,eAAe,CAAA;;;MExNpB,gBAAgB,CAAA;wGAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAhB,gBAAgB,EAAA,OAAA,EAAA,CAJf,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAEnB,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAEpB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAHd,SAAA,EAAA,CAAC,iBAAiB,CAAC,YADpB,mBAAmB,CAAA,EAAA,CAAA,CAAA;;4FAIpB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,SAAS,EAAE,CAAC,iBAAiB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-file-picker.mjs","sources":["../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.service.ts","../../projects/angular-components/file-picker/src/lib/file-picker/models/file-picker-permissions.ts","../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.component.ts","../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.component.html","../../projects/angular-components/file-picker/src/lib/file-picker/file-picker.module.ts","../../projects/angular-components/file-picker/src/seniorsistemas-angular-components-file-picker.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { CustomHttpClient } from '@seniorsistemas/angular-components/common';\n\nimport { ListBlobMetadataRequest, ListBlobMetadataResponse } from './models/list-blob-metadata';\n\n@Injectable()\nexport class FilePickerService {\n private BASE_URL_FIELD_CUSTOMIZATION = 'platform/field_customization';\n private TOKEN = new AbortController();\n\n public async getMetadataCustomField<T>(request: ListBlobMetadataRequest): Promise<ListBlobMetadataResponse> {\n return CustomHttpClient.post(`${this.BASE_URL_FIELD_CUSTOMIZATION}/queries/getFileMetadata`, request, {\n signal: this.TOKEN.signal,\n });\n }\n}\n","export type FilePickerPermissions = 'add' | 'read' | 'remove';\n\nexport const ALL_PERMISSIONS: FilePickerPermissions[] = ['add', 'read', 'remove'];\n","import {\r\n AfterContentInit,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n inject,\r\n} from '@angular/core';\r\nimport { FormControl } from '@angular/forms';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\n\r\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\r\nimport { DEPRECATED_CONFIG } from '@seniorsistemas/angular-components/common/deprecated-selector';\r\nimport { DeprecatedSelectorDirective } from '@seniorsistemas/angular-components/common/deprecated-selector';\r\nimport { Breakpoints, isNullOrUndefined } from '@seniorsistemas/angular-components/utils';\r\nimport moment from 'moment';\r\nimport { Subject } from 'rxjs';\r\n\r\nimport { FilePickerService } from './file-picker.service';\r\nimport { FileDto } from './models/file-dto';\r\nimport { ALL_PERMISSIONS, FilePickerPermissions } from './models/file-picker-permissions';\r\nimport { ListBlobMetadataResponse } from './models/list-blob-metadata';\r\nimport { UploadError } from './models/uploadError';\r\nimport { ButtonComponent } from '@seniorsistemas/angular-components/button';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { ProgressBarComponent } from '@seniorsistemas/angular-components/progressbar';\r\nimport { TooltipDirective } from '@seniorsistemas/angular-components/tooltip';\r\n\r\n/**\r\n * @description Componente de upload de arquivos com suporte a seleção múltipla,\r\n * validação de tipo/tamanho, controle de permissões (adicionar, ler, remover),\r\n * download e cancelamento de uploads em andamento.\r\n *\r\n * @example\r\n * ```html\r\n * <s-file-picker\r\n * [multiple]=\"true\"\r\n * accept=\"application/pdf\"\r\n * [maxFileSize]=\"5242880\"\r\n * [files]=\"arquivos\"\r\n * (uploadHandler)=\"onUpload($event)\"\r\n * (removeFile)=\"onRemove($event)\" />\r\n * ```\r\n *\r\n * @category Inputs\r\n */\r\n@Component({\r\n selector: 's-file-picker, s-file-upload',\r\n templateUrl: './file-picker.component.html',\r\n styleUrls: ['./file-picker.component.scss'],\r\n hostDirectives: [DeprecatedSelectorDirective],\r\n providers: [\r\n {\r\n provide: DEPRECATED_CONFIG,\r\n useValue: {\r\n oldSelector: 's-file-upload',\r\n newSelector: 's-file-picker',\r\n removalVersion: '20.0.0',\r\n },\r\n },\r\n ],\r\n standalone: true,\r\n imports: [ButtonComponent, NgTemplateOutlet, ProgressBarComponent, TooltipDirective, TranslatePipe],\r\n})\r\nexport class FilePickerComponent implements OnInit, OnDestroy, AfterContentInit {\r\n private readonly sanitizer = inject(DomSanitizer);\r\n private readonly filePickerService = inject(FilePickerService);\r\n private readonly translate = inject(TranslateService);\r\n\r\n public static nextId = 0;\r\n\r\n public ADD_PERMISSION: FilePickerPermissions = 'add';\r\n public READ_PERMISSION: FilePickerPermissions = 'read';\r\n public REMOVE_PERMISSION: FilePickerPermissions = 'remove';\r\n\r\n @ViewChild('inputUpload', { static: false })\r\n private readonly inputUpload: ElementRef | null = null;\r\n\r\n @ViewChild('anchor', { static: false })\r\n private readonly anchor: ElementRef | null = null;\r\n\r\n /** @description Identificador do componente no DOM. Gerado automaticamente se não informado. */\r\n @Input()\r\n public id = `s-file-picker-${FilePickerComponent.nextId++}`;\r\n\r\n /** @description Rótulo do botão de seleção de arquivo. */\r\n @Input()\r\n public chooseLabel?: string;\r\n\r\n /** @description Rótulo do botão de remoção de arquivo. */\r\n @Input()\r\n public removeLabel?: string;\r\n\r\n /** @description Rótulo do botão de cancelamento de upload. */\r\n @Input()\r\n public cancelLabel?: string;\r\n\r\n /** @description Texto do tooltip exibido após upload bem-sucedido. */\r\n @Input()\r\n public successTooltip?: string;\r\n\r\n /** @description Permite selecionar múltiplos arquivos ao mesmo tempo. */\r\n @Input()\r\n public multiple?: boolean;\r\n\r\n /** @description Tipos MIME aceitos pelo seletor de arquivo (ex.: `'application/pdf,image/*'`). */\r\n @Input()\r\n public accept?: string;\r\n\r\n /** @description Lista de extensões de arquivo aceitas para validação (ex.: `['.pdf', '.docx']`). @default [] */\r\n @Input()\r\n public supportedExtensions: string[] = [];\r\n\r\n /** @description Label ARIA para o nome do arquivo, para leitores de tela. */\r\n @Input()\r\n public ariaLabelFileName?: string;\r\n\r\n /** @description Tamanho máximo por arquivo em bytes. */\r\n @Input()\r\n public maxFileSize?: number;\r\n\r\n /** @description Tamanho máximo combinado de todos os arquivos em bytes. */\r\n @Input()\r\n public maxCombinedFileSize?: number;\r\n\r\n /** @description Número máximo de arquivos que podem ser selecionados. */\r\n @Input()\r\n public fileLimit?: number;\r\n\r\n /** @description Label ARIA para a barra de progresso do upload. */\r\n @Input()\r\n public ariaLabelProgress?: string;\r\n\r\n /** @description Label ARIA para o ícone de sucesso. */\r\n @Input()\r\n public ariaLabelSuccess?: string;\r\n\r\n /** @description Label ARIA para mensagens de erro de validação. */\r\n @Input()\r\n public ariaLabelError?: string;\r\n\r\n /** @description Label ARIA para o botão de remoção de arquivo. */\r\n @Input()\r\n public ariaLabelRemove?: string;\r\n\r\n /** @description FormControl externo vinculado ao componente para controle de estado. */\r\n @Input()\r\n public formControl?: FormControl;\r\n\r\n /** @description Desabilita todas as interações do componente. @default false */\r\n @Input()\r\n public disabled = false;\r\n\r\n /** @description Exibe a data de upload de cada arquivo. @default false */\r\n @Input()\r\n public showFileUploadDate: boolean = false;\r\n\r\n /** @description Lista de permissões habilitadas no componente: `'add'`, `'read'`, `'remove'`. @default ALL_PERMISSIONS */\r\n @Input()\r\n public permissions: FilePickerPermissions[] = ALL_PERMISSIONS;\r\n\r\n /**\r\n * @description Lista de arquivos já enviados a serem exibidos no componente.\r\n * Ao atribuir, os arquivos são processados e suas URLs são geradas para preview.\r\n */\r\n @Input()\r\n public set files(files: FileDto[]) {\r\n if (!files || files?.length === 0) {\r\n this._files = [];\r\n return;\r\n }\r\n if (this.showFileUploadDate && files[0]?.objectId) {\r\n this.getUploadDate(files);\r\n }\r\n this._files = files.map((file) => {\r\n file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));\r\n return file;\r\n });\r\n }\r\n\r\n /** @description Emitido quando o usuário seleciona arquivos válidos para upload. */\r\n @Output()\r\n public uploadHandler: EventEmitter<{ files: FileDto[] }> = new EventEmitter();\r\n\r\n /** @description Emitido quando o usuário remove um arquivo da lista. */\r\n @Output()\r\n public removeFile: EventEmitter<{ file: File }> = new EventEmitter();\r\n\r\n /** @description Emitido quando o usuário cancela um upload em andamento. Emite o índice do arquivo cancelado. */\r\n @Output()\r\n public cancelUpload: EventEmitter<number> = new EventEmitter();\r\n\r\n /** @description Emitido quando o usuário clica para baixar um arquivo. */\r\n @Output()\r\n public downloadFile: EventEmitter<{ index: number; anchor: ElementRef }> = new EventEmitter();\r\n\r\n /** @description Emitido quando um arquivo não passa na validação de tipo, tamanho ou limite. */\r\n @Output()\r\n public validateErrors: EventEmitter<UploadError> = new EventEmitter();\r\n\r\n private _files: FileDto[] = [];\r\n private readonly ngUsubscribe: Subject<void> = new Subject();\r\n public isSmallDevice = false;\r\n public inputValue = '';\r\n public modifiedDate?: string;\r\n\r\n public ngOnInit(): void {\r\n this.supportedExtensions = this.supportedExtensions.map((extension) =>\r\n extension.replace('.', '').toLowerCase(),\r\n );\r\n }\r\n\r\n public ngOnDestroy() {\r\n this.ngUsubscribe.next();\r\n this.ngUsubscribe.complete();\r\n }\r\n\r\n public ngAfterContentInit() {\r\n this.update();\r\n }\r\n\r\n @HostListener('window:resize')\r\n public onResize() {\r\n this.update();\r\n }\r\n\r\n public _onInputFileSelect($event: Event): void {\r\n const eventTargetFiles = ($event.target as HTMLInputElement)?.files as FileList;\r\n const dataTransferFiles = ($event as DragEvent).dataTransfer?.files as FileList;\r\n const files: FileDto[] = Array.from(dataTransferFiles ? dataTransferFiles : eventTargetFiles);\r\n this.onFileSelect(files);\r\n }\r\n\r\n public onFileSelect(files: FileDto[]): void {\r\n const newFiles: FileDto[] = [];\r\n\r\n if (!this.multiple) {\r\n this.files = [];\r\n }\r\n\r\n if (this.isFileLimitExceeded(files)) {\r\n this.validateErrors.emit({\r\n files,\r\n validation: 'maxFileLimit',\r\n });\r\n this.clearFileInput();\r\n return;\r\n }\r\n\r\n if (this.isFileCombinedSizeExceeded(files)) {\r\n this.validateErrors.emit({\r\n files: files,\r\n validation: 'maxCombinedFileSize',\r\n });\r\n this.clearFileInput();\r\n return;\r\n }\r\n\r\n for (const file of files) {\r\n if (this.isUnsupportedFileExtension(file)) {\r\n this.validateErrors.emit({\r\n files: [file],\r\n validation: 'unsupportedExtension',\r\n });\r\n continue;\r\n }\r\n\r\n if (this.isFileSizeExceeded(file)) {\r\n this.validateErrors.emit({\r\n files: [file],\r\n validation: 'maxFileSize',\r\n });\r\n continue;\r\n }\r\n\r\n newFiles.push(file);\r\n }\r\n\r\n if (newFiles.length) {\r\n this.files = this.files.concat(newFiles);\r\n this.uploadHandler.emit({\r\n files: newFiles,\r\n });\r\n }\r\n\r\n this.clearFileInput();\r\n }\r\n\r\n public onRemoveFile(file: FileDto): void {\r\n const fileIndex = this.files.indexOf(file);\r\n const removedFiles = this.files.splice(fileIndex, 1);\r\n\r\n if (removedFiles.length) {\r\n this.removeFile.emit({ file });\r\n }\r\n }\r\n\r\n public onCancelUpload(index: number) {\r\n const removedFiles = this.files.splice(index, 1);\r\n\r\n if (removedFiles.length) {\r\n this.cancelUpload.emit(index);\r\n }\r\n\r\n this.clearFileInput();\r\n }\r\n\r\n public onDowloadFile(index: number) {\r\n if (isNullOrUndefined(this.anchor)) return;\r\n\r\n this.downloadFile.emit({\r\n index,\r\n anchor: this.anchor,\r\n });\r\n }\r\n\r\n public get files(): FileDto[] {\r\n return this._files;\r\n }\r\n\r\n public formatFileSize(size: number): string {\r\n if (size === 0) {\r\n return '0 Bytes';\r\n }\r\n const k = 1024;\r\n const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB'];\r\n const i = Math.floor(Math.log(size) / Math.log(k));\r\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\r\n }\r\n\r\n private update() {\r\n const windowWidth = window.innerWidth;\r\n this.isSmallDevice = windowWidth <= Breakpoints.SM_MAX;\r\n }\r\n\r\n private isFileLimitExceeded(files: FileDto[]) {\r\n if (!this.fileLimit) {\r\n return false;\r\n }\r\n return this.files.length + files.length > this.fileLimit;\r\n }\r\n\r\n private isFileCombinedSizeExceeded(files: File[]): boolean {\r\n if (!this.maxCombinedFileSize) {\r\n return false;\r\n }\r\n\r\n const filesList = [...files, ...this.files];\r\n\r\n const combinedSize = filesList.reduce((combinedSize, file) => combinedSize + file.size, 0);\r\n\r\n return combinedSize > this.maxCombinedFileSize;\r\n }\r\n\r\n private isFileSizeExceeded(file: File): boolean {\r\n if (!this.maxFileSize) {\r\n return false;\r\n }\r\n return file.size > this.maxFileSize;\r\n }\r\n\r\n private isUnsupportedFileExtension(file: File) {\r\n if (this.supportedExtensions?.length) {\r\n const extension = file.name.split('.').pop()?.toLowerCase() ?? '';\r\n\r\n return !this.supportedExtensions.includes(extension);\r\n }\r\n return false;\r\n }\r\n\r\n private clearFileInput() {\r\n if (isNullOrUndefined(this.inputUpload?.nativeElement)) return;\r\n\r\n this.inputUpload.nativeElement.value = null;\r\n }\r\n\r\n private getUploadDate(blobFile: FileDto[]): void {\r\n if (!blobFile) {\r\n return;\r\n }\r\n\r\n this.filePickerService\r\n .getMetadataCustomField({ objectId: blobFile[0].objectId ?? '' })\r\n .then((metadata) => this.setModifiedDate(metadata));\r\n }\r\n\r\n private setModifiedDate(metadata: ListBlobMetadataResponse): void {\r\n const hour = moment(metadata.modified).format('HH');\r\n const minutes = moment(metadata.modified).format('mm');\r\n const day = moment(metadata.modified).format('DD');\r\n const month = moment(metadata.modified).format('MM');\r\n const fullYear = moment(metadata.modified).format('YYYY');\r\n\r\n this.modifiedDate = this.translate.instant('platform.angular_components.date_modified_custom_blob', {\r\n hour,\r\n minutes,\r\n day,\r\n month,\r\n fullYear,\r\n });\r\n }\r\n}\r\n","<div\n [id]=\"id\"\n class=\"file-picker\"\n>\n <div class=\"file-picker-choose\">\n <input\n #inputUpload\n [id]=\"id + 'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"_onInputFileSelect($event)\"\n />\n @if (permissions.includes(ADD_PERMISSION)) {\n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel || 'platform.angular_components.attach_files' | translate\"\n (clicked)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formControl?.disabled || fileLimit === files.length\"\n [auxiliary]=\"false\"\n >\n </s-button>\n }\n </div>\n\n @if (files.length) {\n <section\n [id]=\"id + 'fileupload-list'\"\n class=\"file-picker-list\"\n role=\"grid\"\n >\n @for (file of files; track file; let i = $index) {\n <div\n class=\"file-picker-list-file\"\n role=\"row\"\n >\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"flex flex-grow items-center justify-between overflow-hidden text-ellipsis text-nowrap\"\n role=\"gridcell\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n (permissions.includes(READ_PERMISSION) && file.savedFile) || file.progress === 100\n ? descriptionUrl\n : description;\n context: {\n $implicit: file,\n index: i,\n }\n \"\n >\n </ng-container>\n\n <span>{{ formatFileSize(file.size) }}</span>\n\n @if (modifiedDate) {\n <span class=\"file-picker-list-file-name-date\">{{ modifiedDate }}</span>\n }\n </div>\n <div\n class=\"file-picker-list-file-status\"\n role=\"gridcell\"\n >\n @if (file.isUploading && !isSmallDevice) {\n <div class=\"w-64\">\n <s-progressbar\n [value]=\"file.progress ?? 0\"\n [showValue]=\"false\"\n activeColor=\"blue\"\n ></s-progressbar>\n </div>\n }\n\n @if (file.isUploading && isSmallDevice) {\n <span\n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"\n ariaLabelProgress || 'platform.angular_components.loading_file' | translate\n \"\n >\n </span>\n }\n\n @if (!file.isUploading && !file.error && file.progress === 100) {\n <span\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"\n ariaLabelSuccess ||\n successTooltip ||\n 'platform.angular_components.file_attached_successfully' | translate\n \"\n [sTooltip]=\"\n successTooltip || 'platform.angular_components.file_attached_successfully'\n | translate\n \"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n\n @if (file.error?.message) {\n <span\n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [sTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n [escape]=\"true\"\n >\n </span>\n }\n </div>\n <div\n class=\"file-picker-list-file-actions\"\n role=\"gridcell\"\n >\n @if (file.isUploading) {\n <a\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\"\n >\n {{ cancelLabel || 'platform.angular_components.cancel' | translate }}\n </a>\n }\n\n @if (\n permissions.includes(REMOVE_PERMISSION) &&\n !file.isUploading &&\n !(disabled || !!formControl?.disabled)\n ) {\n <a\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"file-picker-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"\n ariaLabelRemove || removeLabel || 'platform.angular_components.remove' | translate\n \"\n >\n {{ removeLabel || 'platform.angular_components.remove' | translate }}\n </a>\n }\n </div>\n </div>\n }\n </section>\n }\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i=\"index\"\n>\n <div class=\"flex justify-between\">\n <div>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"break-words focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\n >{{ file.name }}\n </a>\n <a\n style=\"display: none\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor\n >\n </a>\n </div>\n </div>\n</ng-template>\n\n<ng-template\n #description\n let-file\n>\n <div class=\"flex justify-between\">\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\"\n class=\"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--s-focus-ring-color,#0090ff)]\"\n >\n {{ file.name }}\n </span>\n </div>\n</ng-template>\n\n","import { NgModule } from '@angular/core';\r\n\r\nimport { FilePickerComponent } from './file-picker.component';\r\nimport { FilePickerService } from './file-picker.service';\r\n\r\n@NgModule({\r\n imports: [FilePickerComponent],\r\n providers: [FilePickerService],\r\n exports: [FilePickerComponent],\r\n})\r\nexport class FilePickerModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAOa,iBAAiB,CAAA;IAClB,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,IAAA,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAE/B,MAAM,sBAAsB,CAAI,OAAgC,EAAA;QACnE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAA,EAAG,IAAI,CAAC,4BAA4B,CAAA,wBAAA,CAA0B,EAAE,OAAO,EAAE;AAClG,YAAA,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;AAC5B,SAAA,CAAC,CAAC;KACN;wGARQ,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA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AAA,EAAA,gBAAgB,EAHd,SAAA,EAAA,CAAC,iBAAiB,CAAC,YADpB,mBAAmB,CAAA,EAAA,CAAA,CAAA;;4FAIpB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,mBAAmB,CAAC;oBAC9B,SAAS,EAAE,CAAC,iBAAiB,CAAC;oBAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;AACjC,iBAAA,CAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -438,6 +438,7 @@ class Bar {
|
|
|
438
438
|
this._group = createSVG('g', {
|
|
439
439
|
class: 'bar-wrapper ' + (this.task.custom_class || ''),
|
|
440
440
|
'data-id': this.task.id,
|
|
441
|
+
tabindex: '0',
|
|
441
442
|
});
|
|
442
443
|
this._barGroup = createSVG('g', {
|
|
443
444
|
class: 'bar-group',
|
|
@@ -1710,11 +1711,11 @@ class GanttComponent {
|
|
|
1710
1711
|
});
|
|
1711
1712
|
}
|
|
1712
1713
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GanttComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1713
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GanttComponent, isStandalone: true, selector: "s-gantt", inputs: { columnTitle: "columnTitle", multipleTaskPerLine: "multipleTaskPerLine", showSideTable: "showSideTable", viewMode: "viewMode", tasks: "tasks", marginBeforeStart: "marginBeforeStart", marginAfterEnd: "marginAfterEnd", allowMovement: "allowMovement", hasPopup: "hasPopup", containerWidth: "containerWidth", fullWidth: "fullWidth", showOnlyHours: "showOnlyHours", showOnlyDays: "showOnlyDays" }, outputs: { taskClicked: "taskClicked", taskDateChanged: "taskDateChanged", viewChanged: "viewChanged" }, viewQueries: [{ propertyName: "outer", first: true, predicate: ["outer"], descendants: true }, { propertyName: "side", first: true, predicate: ["side"], descendants: true }, { propertyName: "ganttSvg", first: true, predicate: ["ganttSvg"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"outer\" #outer>\n <div #side>\n @if(showSideTable) {\n <gantt-side-table\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle ?? ''\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n }\n </div>\n <svg #ganttSvg></svg>\n</div>\n", styles: [".outer{display:flex;justify-content:center;align-items:flex-start;align-content:center;flex-wrap:nowrap;flex-direction:row}\n", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(2n){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease;-webkit-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:none}.gantt .bar-wrapper:hover .bar,.gantt .bar-wrapper.active .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:flex;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}\n"], dependencies: [{ kind: "component", type: SideTableComponent, selector: "gantt-side-table", inputs: ["columnTitle", "tasks", "multipleTaskPerLine"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1714
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GanttComponent, isStandalone: true, selector: "s-gantt", inputs: { columnTitle: "columnTitle", multipleTaskPerLine: "multipleTaskPerLine", showSideTable: "showSideTable", viewMode: "viewMode", tasks: "tasks", marginBeforeStart: "marginBeforeStart", marginAfterEnd: "marginAfterEnd", allowMovement: "allowMovement", hasPopup: "hasPopup", containerWidth: "containerWidth", fullWidth: "fullWidth", showOnlyHours: "showOnlyHours", showOnlyDays: "showOnlyDays" }, outputs: { taskClicked: "taskClicked", taskDateChanged: "taskDateChanged", viewChanged: "viewChanged" }, viewQueries: [{ propertyName: "outer", first: true, predicate: ["outer"], descendants: true }, { propertyName: "side", first: true, predicate: ["side"], descendants: true }, { propertyName: "ganttSvg", first: true, predicate: ["ganttSvg"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"outer\" #outer>\n <div #side>\n @if(showSideTable) {\n <gantt-side-table\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle ?? ''\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n }\n </div>\n <svg #ganttSvg></svg>\n</div>\n", styles: [".outer{display:flex;justify-content:center;align-items:flex-start;align-content:center;flex-wrap:nowrap;flex-direction:row}\n", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(2n){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease;-webkit-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:none}.gantt .bar-wrapper:focus-visible{outline:2px solid var(--s-focus-ring-color);outline-offset:3px}.gantt .bar-wrapper:hover .bar,.gantt .bar-wrapper.active .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:flex;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}\n"], dependencies: [{ kind: "component", type: SideTableComponent, selector: "gantt-side-table", inputs: ["columnTitle", "tasks", "multipleTaskPerLine"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1714
1715
|
}
|
|
1715
1716
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GanttComponent, decorators: [{
|
|
1716
1717
|
type: Component,
|
|
1717
|
-
args: [{ selector: 's-gantt', encapsulation: ViewEncapsulation.None, standalone: true, imports: [SideTableComponent], template: "<div class=\"outer\" #outer>\n <div #side>\n @if(showSideTable) {\n <gantt-side-table\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle ?? ''\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n }\n </div>\n <svg #ganttSvg></svg>\n</div>\n", styles: [".outer{display:flex;justify-content:center;align-items:flex-start;align-content:center;flex-wrap:nowrap;flex-direction:row}\n", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(2n){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease;-webkit-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:none}.gantt .bar-wrapper:hover .bar,.gantt .bar-wrapper.active .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:flex;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}\n"] }]
|
|
1718
|
+
args: [{ selector: 's-gantt', encapsulation: ViewEncapsulation.None, standalone: true, imports: [SideTableComponent], template: "<div class=\"outer\" #outer>\n <div #side>\n @if(showSideTable) {\n <gantt-side-table\n [tasks]=\"tasks\"\n [columnTitle]=\"columnTitle ?? ''\"\n [multipleTaskPerLine]=\"multipleTaskPerLine\">\n </gantt-side-table>\n }\n </div>\n <svg #ganttSvg></svg>\n</div>\n", styles: [".outer{display:flex;justify-content:center;align-items:flex-start;align-content:center;flex-wrap:nowrap;flex-direction:row}\n", ".gantt{border:1px solid #e0e0e0}.gantt .weekend-highlight{fill:#b8c2cc;opacity:.5;stroke:#ebeff2;stroke-width:1}.gantt .grid-background{fill:none}.gantt .grid-header,.gantt .grid-row{fill:#fff}.gantt .grid-row:nth-child(2n){fill:#f5f5f5}.gantt .row-line{stroke:#ebeff2}.gantt .tick{stroke:#e0e0e0;stroke-width:.4}.gantt .tick.thick{stroke:#428bca;stroke-width:2}.gantt .today-highlight{fill:#ffe979;opacity:.5}.gantt .arrow{fill:none;stroke:#666;stroke-width:1.4}.gantt .bar{opacity:.8;stroke:#8d99a6;stroke-width:0;transition:stroke-width .3s ease;-webkit-user-select:none;user-select:none}.gantt .bar-invalid{fill:transparent;stroke:#8d99a6;stroke-dasharray:5;stroke-width:1}.gantt .bar-invalid~.bar-label{fill:#555}.gantt .bar-label{fill:#fff;text-anchor:middle;font-size:12px;font-weight:lighter}.gantt .bar-label.big{fill:#555;text-anchor:start}.gantt .bar-wrapper{cursor:pointer;outline:none}.gantt .bar-wrapper:focus-visible{outline:2px solid var(--s-focus-ring-color);outline-offset:3px}.gantt .bar-wrapper:hover .bar,.gantt .bar-wrapper.active .bar{opacity:1}.gantt .bar-wrapper.active .bar{stroke:#212533;stroke-width:2}.gantt .lower-text,.gantt .upper-text{font-size:12px;text-anchor:middle}.gantt .upper-text{fill:#555}.gantt .lower-text{fill:#333}.gantt .hide{display:none}.gantt-container{border-left:1px solid #e0e0e0;font-size:12px;overflow:auto;position:relative}.gantt-container .title-1{fill:#999;font-size:12px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .title-2{fill:#333;font-size:14px;font-weight:400;line-height:150%;text-anchor:middle}.gantt-container .popup-wrapper{left:0;position:absolute;top:0}.gantt-container .popup-wrapper .popup{background:#0e1119;border-radius:2px;color:#fff;padding:8px;font-family:\"Open Sans\" sans-serif;line-height:150%;font-weight:400}.gantt-container .popup-wrapper .popup .wrp-title{border-bottom:1px solid #525966;padding-bottom:10px}.gantt-container .popup-wrapper .popup .wrp-title .title{font-size:14px}.gantt-container .popup-wrapper .popup .wrp-subtitle{color:#dfe2e5;padding-top:10px;display:flex;align-items:center}.gantt-container .popup-wrapper .popup .wrp-subtitle .icon{margin-right:10px}.gantt-container .popup-wrapper .popup .wrp-subtitle .subtitle{font-size:12px}.gantt-container .popup-wrapper .popup .pointer{border:6px solid transparent;border-top-color:#0e1119;height:6px;margin-left:-4px;position:absolute}\n"] }]
|
|
1718
1719
|
}], propDecorators: { columnTitle: [{
|
|
1719
1720
|
type: Input
|
|
1720
1721
|
}], multipleTaskPerLine: [{
|