@memberjunction/ng-ui-components 6.2.1 → 6.3.0-edge.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/dist/lib/accordion/accordion-sections.component.d.ts +51 -0
- package/dist/lib/accordion/accordion-sections.component.d.ts.map +1 -0
- package/dist/lib/accordion/accordion-sections.component.js +138 -0
- package/dist/lib/accordion/accordion-sections.component.js.map +1 -0
- package/dist/lib/accordion/accordion.component.d.ts +53 -4
- package/dist/lib/accordion/accordion.component.d.ts.map +1 -1
- package/dist/lib/accordion/accordion.component.js +233 -68
- package/dist/lib/accordion/accordion.component.js.map +1 -1
- package/dist/lib/accordion/accordion.scss +76 -0
- package/dist/lib/combobox/combobox.component.d.ts +1 -1
- package/dist/lib/combobox/combobox.component.js +1 -1
- package/dist/lib/combobox/combobox.component.js.map +1 -1
- package/dist/lib/confirm-dialog/confirm-dialog.component.d.ts.map +1 -1
- package/dist/lib/confirm-dialog/confirm-dialog.component.js +6 -2
- package/dist/lib/confirm-dialog/confirm-dialog.component.js.map +1 -1
- package/dist/lib/datepicker/datepicker.component.d.ts +1 -1
- package/dist/lib/datepicker/datepicker.component.js +1 -1
- package/dist/lib/datepicker/datepicker.component.js.map +1 -1
- package/dist/lib/dialog/dialog.component.d.ts +15 -6
- package/dist/lib/dialog/dialog.component.d.ts.map +1 -1
- package/dist/lib/dialog/dialog.component.js +34 -13
- package/dist/lib/dialog/dialog.component.js.map +1 -1
- package/dist/lib/dialog/dialog.scss +82 -6
- package/dist/lib/dialog/dialog.service.d.ts +3 -3
- package/dist/lib/dialog/dialog.service.js +3 -3
- package/dist/lib/dialog/dialog.service.js.map +1 -1
- package/dist/lib/dropdown/dropdown.component.d.ts +0 -1
- package/dist/lib/dropdown/dropdown.component.d.ts.map +1 -1
- package/dist/lib/dropdown/dropdown.component.js +1 -2
- package/dist/lib/dropdown/dropdown.component.js.map +1 -1
- package/dist/lib/filter-panel/filter-panel.component.d.ts.map +1 -1
- package/dist/lib/filter-panel/filter-panel.component.js +5 -4
- package/dist/lib/filter-panel/filter-panel.component.js.map +1 -1
- package/dist/lib/input/chip.scss +1 -1
- package/dist/lib/input/input.scss +4 -4
- package/dist/lib/numeric-input/numeric-input.component.d.ts +1 -1
- package/dist/lib/numeric-input/numeric-input.component.js +1 -1
- package/dist/lib/numeric-input/numeric-input.component.js.map +1 -1
- package/dist/lib/progress-bar/progress-bar.component.d.ts +1 -1
- package/dist/lib/progress-bar/progress-bar.component.js +1 -1
- package/dist/lib/progress-bar/progress-bar.component.js.map +1 -1
- package/dist/lib/section-picker/section-picker.component.d.ts +108 -0
- package/dist/lib/section-picker/section-picker.component.d.ts.map +1 -0
- package/dist/lib/section-picker/section-picker.component.js +429 -0
- package/dist/lib/section-picker/section-picker.component.js.map +1 -0
- package/dist/lib/splitter/splitter.component.d.ts +2 -5
- package/dist/lib/splitter/splitter.component.d.ts.map +1 -1
- package/dist/lib/splitter/splitter.component.js +2 -5
- package/dist/lib/splitter/splitter.component.js.map +1 -1
- package/dist/lib/switch/switch.component.d.ts +1 -1
- package/dist/lib/switch/switch.component.js +1 -1
- package/dist/lib/switch/switch.component.js.map +1 -1
- package/dist/lib/viewport/phone-viewport.d.ts +15 -0
- package/dist/lib/viewport/phone-viewport.d.ts.map +1 -0
- package/dist/lib/viewport/phone-viewport.js +29 -0
- package/dist/lib/viewport/phone-viewport.js.map +1 -0
- package/dist/lib/window/window.component.d.ts +3 -3
- package/dist/lib/window/window.component.js +3 -3
- package/dist/lib/window/window.component.js.map +1 -1
- package/dist/lib/window/window.scss +43 -4
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../src/lib/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OA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EventEmitter,\n forwardRef,\n HostBinding,\n ElementRef,\n ViewChild,\n ContentChild,\n TemplateRef,\n OnDestroy,\n inject,\n ChangeDetectorRef\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { OverlayModule, ConnectedPosition } from '@angular/cdk/overlay';\nimport { MJNamedControlBase } from '../a11y/named-control.base';\nimport { WarnIfUnnamed } from '../a11y/unnamed-control-guard';\n\n/**\n * mj-dropdown — Dropdown select component using CDK Overlay.\n *\n * Replaces `<kendo-dropdownlist>`.\n *\n * Every dropdown needs an ACCESSIBLE NAME, or it announces as \"combobox, collapsed\" with no hint of\n * what it selects (WCAG 2.1 4.1.2). Use {@link AriaLabelledBy} when a visible label already exists —\n * `<label for>` cannot name a `div[role=combobox]` — and {@link AriaLabel} when none does.\n *\n * Escape with the list open closes the list and goes no further, so a dialog or popover around the\n * field stays open. With the list closed, Escape goes on to the host as usual.\n *\n * @example With a visible label (preferred)\n * ```html\n * <span id=\"persona-label\">Interview persona</span>\n * <mj-dropdown\n * AriaLabelledBy=\"persona-label\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\">\n * </mj-dropdown>\n * ```\n *\n * @example With no visible label\n * ```html\n * <mj-dropdown\n * AriaLabel=\"Interview persona\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\"\n * [Filterable]=\"true\"\n * (FilterChange)=\"onFilter($event)\">\n * </mj-dropdown>\n * ```\n */\n@Component({\n selector: 'mj-dropdown',\n standalone: true,\n imports: [NgTemplateOutlet, OverlayModule],\n template: `\n <div\n class=\"mj-dropdown\"\n #trigger\n cdkOverlayOrigin\n #overlayOrigin=\"cdkOverlayOrigin\"\n [class.mj-dropdown--open]=\"IsOpen\"\n [class.mj-dropdown--disabled]=\"IsDisabled\"\n role=\"combobox\"\n [attr.id]=\"InputId || null\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\"\n [attr.aria-describedby]=\"AriaDescribedBy || null\"\n [attr.aria-expanded]=\"IsOpen\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"IsOpen ? ListboxId : null\"\n [attr.aria-disabled]=\"IsDisabled ? 'true' : null\"\n [attr.tabindex]=\"IsDisabled ? -1 : 0\"\n (click)=\"Toggle()\"\n (keydown)=\"OnKeyDown($event)\"\n (blur)=\"OnBlur()\">\n <span class=\"mj-dropdown-value\" [class.mj-dropdown-placeholder]=\"!HasValue\">\n {{ DisplayText }}\n </span>\n <i class=\"fa-solid fa-chevron-down mj-dropdown-arrow\"></i>\n </div>\n\n <!--\n The overlay's own Escape close is off: it cancels the key but lets it go on to the page.\n OnOverlayKeyDown closes the list on Escape instead and stops the key there.\n -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"IsOpen\"\n [cdkConnectedOverlayPositions]=\"Positions\"\n [cdkConnectedOverlayWidth]=\"TriggerWidth\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n cdkConnectedOverlayBackdropClass=\"mj-dropdown-backdrop\"\n (backdropClick)=\"Close()\"\n (detach)=\"Close()\"\n (overlayKeydown)=\"OnOverlayKeyDown($event)\">\n <div class=\"mj-dropdown-panel\" role=\"listbox\"\n [attr.id]=\"ListboxId\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\">\n @if (Filterable) {\n <div class=\"mj-dropdown-filter-wrap\">\n <!--\n The word \"Filter\" lives in a hidden span rather than in a concatenated string so the\n AriaLabelledBy path can NAME this box from the same visible label that names the\n dropdown: aria-labelledby takes an ID LIST, so \"Filter\" plus the label's own text is\n composed by the accessibility tree without this component ever seeing that text.\n Without it, every filterable dropdown on a form named this way announces as an\n identical \"Filter options\".\n\n A hidden node that is DIRECTLY referenced by aria-labelledby is still included in the\n name (accname §4.1), so aria-hidden keeps the word out of the reading order without\n costing the composed name.\n -->\n <span class=\"mj-dropdown-sr-only\" aria-hidden=\"true\" [attr.id]=\"FilterWordId\">Filter</span>\n <input\n #filterInput\n class=\"mj-input mj-dropdown-filter\"\n type=\"text\"\n placeholder=\"Filter...\"\n [attr.aria-labelledby]=\"FilterLabelledBy\"\n [attr.aria-label]=\"FilterLabelledBy ? null : FilterLabel\"\n [value]=\"filterText\"\n (input)=\"OnFilterInput($event)\"\n (keydown)=\"OnKeyDown($event)\" />\n </div>\n }\n @if (DefaultItem != null) {\n <div\n class=\"mj-dropdown-option mj-dropdown-option--default\"\n [class.mj-dropdown-option--selected]=\"SelectedValue == null\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === -1\"\n role=\"option\"\n [attr.aria-selected]=\"SelectedValue == null\"\n (click)=\"SelectItem(null, $event)\">\n {{ GetItemText(DefaultItem) }}\n </div>\n }\n @for (item of FilteredItems; track TrackByIndex($index)) {\n <div\n class=\"mj-dropdown-option\"\n [class.mj-dropdown-option--selected]=\"IsItemSelected(item)\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === $index\"\n role=\"option\"\n [attr.aria-selected]=\"IsItemSelected(item)\"\n (click)=\"SelectItem(item, $event)\">\n @if (itemTemplate) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ GetItemText(item) }}\n }\n </div>\n }\n @if (FilteredItems.length === 0) {\n <div class=\"mj-dropdown-no-data\">No data found</div>\n }\n </div>\n </ng-template>\n `,\n styles: [`\n /*\n * Component-scoped ON PURPOSE, unlike the rest of this control's styling, which ships as a global\n * stylesheet the host application imports. A host that skips that import gets unstyled chrome —\n * survivable — but a hidden-word span that is not hidden renders its word as literal text in the\n * middle of the field. The rule that hides it therefore has to travel with the component.\n *\n * Not display:none or visibility:hidden — both remove the element from the accessibility tree,\n * which is the one thing this element exists to be in.\n */\n .mj-dropdown-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MJDropdownComponent),\n multi: true\n }]\n})\nexport class MJDropdownComponent extends MJNamedControlBase implements ControlValueAccessor, AfterViewInit, OnDestroy {\n @Input() Data: Record<string, unknown>[] | string[] | readonly unknown[] | null = [];\n @Input() TextField = '';\n @Input() ValueField = '';\n @Input() Filterable = false;\n @Input() ValuePrimitive = false;\n /**\n * Host-driven disable. Composed with Angular Forms' `setDisabledState()` into `IsDisabled`\n * (the actual gate) — see `syncDisabled`. A setter, not a bare field, because this input is\n * routinely bound to an expression that changes over the control's lifetime\n * (`[Disabled]=\"!draft.CompanyID\"`), and the gate has to follow it every time.\n */\n @Input()\n set Disabled(value: boolean) {\n this.disabledInput = value;\n this.syncDisabled();\n }\n get Disabled(): boolean {\n return this.disabledInput;\n }\n @Input() Placeholder = 'Select...';\n @Input() DefaultItem: Record<string, unknown> | string | null = null;\n\n @Output() FilterChange = new EventEmitter<string>();\n @Output() ValueChange = new EventEmitter<unknown>();\n\n @ContentChild('mjDropdownItem') ItemTemplate: TemplateRef<{ $implicit: unknown }> | null = null;\n\n /** @deprecated Use {@link ItemTemplate}. */\n get itemTemplate(): TemplateRef<{ $implicit: unknown }> | null {\n return this.ItemTemplate;\n }\n /** @deprecated Use {@link ItemTemplate}. */\n set itemTemplate(value: TemplateRef<{ $implicit: unknown }> | null) {\n this.ItemTemplate = value;\n }\n\n @ViewChild('trigger') private triggerEl!: ElementRef<HTMLElement>;\n @ViewChild('filterInput') private filterInputEl: ElementRef<HTMLInputElement> | undefined;\n\n @HostBinding('class.mj-dropdown-host') readonly hostClass = true;\n\n private cdr = inject(ChangeDetectorRef);\n\n /** This dropdown's id suffix — the shared named-control counter, kept under its own name. */\n readonly DropdownId = this.NamedControlId;\n\n /**\n * Id of the popup listbox, so the trigger can point `aria-controls` at it while open — the half of\n * the combobox pattern that makes \"collapsed/expanded\" refer to something a screen reader can\n * find. Generated per instance from the shared named-control counter.\n */\n get ListboxId(): string { return `mj-dropdown-listbox-${this.DropdownId}`; }\n\n /** Id of the hidden \"Filter\" word, composed into the filter box's name via an id list. */\n get FilterWordId(): string { return this.SecondaryWordId('filter-word'); }\n\n /** `aria-labelledby` for the filter box when a VISIBLE label names the dropdown. */\n get FilterLabelledBy(): string { return this.SecondaryLabelledBy('filter-word'); }\n\n /** `aria-label` for the filter box in the no-visible-label case. */\n get FilterLabel(): string { return this.SecondaryLabel('Filter', 'Filter options'); }\n\n IsOpen = false;\n /**\n * The single gate on `Toggle()` / `Open()` — true when EITHER the `Disabled` input or Angular\n * Forms says so. Never assign it directly; go through `syncDisabled()` so both sources are\n * always composed and a lock closes an open panel.\n */\n IsDisabled = false;\n HighlightedIndex = -1;\n SelectedValue: unknown = null;\n TriggerWidth = 0;\n\n filterText = '';\n\n Positions: ConnectedPosition[] = [\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }\n ];\n\n private onChange: (value: unknown) => void = () => {};\n private onTouched: () => void = () => {};\n\n /** Backing field for the `Disabled` input. */\n private disabledInput = false;\n /** The forms-driven disabled state, kept SEPARATE so neither source can stomp the other. */\n private formDisabled = false;\n\n /**\n * Recompute the gate from both of its sources. Called whenever either changes.\n *\n * `IsDisabled` is derived state, and the only thing that assigned it was `setDisabledState()`.\n * The forms-driven half was in fact fine — `setUpControl` also wires `registerOnDisabledChange`,\n * so that hook fires on every `control.disable()`/`enable()`, not just at registration. What had\n * no recompute path at all was the `Disabled` @Input: a plain field, so the gate froze at\n * whatever the first compose produced and every later change to the input was dropped.\n *\n * That is how a `[Disabled]=\"!draft.CompanyID\"` picker stayed dead for the life of the\n * component after the company was finally chosen.\n */\n private syncDisabled(): void {\n const disabled = this.disabledInput || this.formDisabled;\n if (disabled === this.IsDisabled) return;\n this.IsDisabled = disabled;\n // Becoming disabled while the panel is open would otherwise leave an interactive list\n // hanging off a control the user can no longer operate.\n if (disabled) this.resetPanelState();\n this.cdr.markForCheck();\n }\n\n get FilteredItems(): unknown[] {\n const data = (this.Data ?? []) as unknown[];\n if (!this.Filterable || !this.filterText) return data;\n const search = this.filterText.toLowerCase();\n return data.filter(item => this.GetItemText(item).toLowerCase().includes(search));\n }\n\n get HasValue(): boolean { return this.SelectedValue != null; }\n\n get DisplayText(): string {\n if (this.SelectedValue == null) {\n if (this.DefaultItem != null) return this.GetItemText(this.DefaultItem);\n return this.Placeholder;\n }\n if (this.ValuePrimitive && this.ValueField) {\n const found = ((this.Data ?? []) as unknown[]).find(item => this.GetItemValue(item) === this.SelectedValue);\n return found ? this.GetItemText(found) : String(this.SelectedValue);\n }\n return this.GetItemText(this.SelectedValue as Record<string, unknown> | string);\n }\n\n Toggle(): void {\n if (this.IsDisabled) return;\n this.IsOpen ? this.Close() : this.Open();\n }\n\n Open(): void {\n if (this.IsDisabled || this.IsOpen) return;\n this.TriggerWidth = this.triggerEl?.nativeElement.offsetWidth ?? 200;\n this.IsOpen = true;\n this.HighlightedIndex = this.getSelectedIndex();\n this.cdr.detectChanges();\n if (this.Filterable) setTimeout(() => this.filterInputEl?.nativeElement.focus(), 0);\n }\n\n Close(): void {\n if (!this.IsOpen) return;\n this.resetPanelState();\n this.cdr.detectChanges();\n }\n\n /**\n * Panel state only — no change detection. Split out of `Close()` because `syncDisabled()` can\n * run from an @Input setter, i.e. DURING the parent's change-detection pass, where a nested\n * `detectChanges()` re-enters CD and trips NG0100 on the parent's own bindings.\n */\n private resetPanelState(): void {\n this.IsOpen = false;\n this.filterText = '';\n this.HighlightedIndex = -1;\n }\n\n SelectItem(item: unknown | null, event?: Event): void {\n event?.stopPropagation();\n if (item == null) {\n this.SelectedValue = null;\n this.onChange(null);\n this.ValueChange.emit(null);\n } else if (this.ValuePrimitive && this.ValueField) {\n const value = this.GetItemValue(item);\n this.SelectedValue = value;\n this.onChange(value);\n this.ValueChange.emit(value);\n } else {\n this.SelectedValue = item;\n this.onChange(item);\n this.ValueChange.emit(item);\n }\n this.Close();\n }\n\n IsItemSelected(item: unknown): boolean {\n if (this.SelectedValue == null) return false;\n if (this.ValuePrimitive && this.ValueField) return this.GetItemValue(item) === this.SelectedValue;\n if (this.ValueField && typeof item === 'object' && typeof this.SelectedValue === 'object')\n return this.GetItemValue(item) === this.GetItemValue(this.SelectedValue);\n return item === this.SelectedValue;\n }\n\n OnFilterInput(event: Event): void {\n this.filterText = (event.target as HTMLInputElement).value;\n this.HighlightedIndex = 0;\n this.FilterChange.emit(this.filterText);\n }\n\n /**\n * Keys pressed in the field or in the filter box. Escape with the list open closes the list and\n * stops the key there (see `closeListOnEscape`). With the list closed, Escape is cancelled as\n * before and goes on to the host, so a dialog or popover around the field still closes on it.\n */\n OnKeyDown(event: KeyboardEvent): void {\n const items = this.FilteredItems;\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.IsOpen) this.Open();\n else this.HighlightedIndex = Math.min(this.HighlightedIndex + 1, items.length - 1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.IsOpen) this.HighlightedIndex = Math.max(this.HighlightedIndex - 1, 0);\n break;\n case 'Enter':\n event.preventDefault();\n if (this.IsOpen && this.HighlightedIndex >= 0 && this.HighlightedIndex < items.length)\n this.SelectItem(items[this.HighlightedIndex]);\n else if (!this.IsOpen) this.Open();\n break;\n case 'Escape':\n event.preventDefault();\n if (this.IsOpen) this.closeListOnEscape(event);\n break;\n case 'Tab':\n // The panel lives in the overlay, outside a parent dialog. Hand focus back to this\n // field and do not prevent the key, so the browser moves on from the field.\n if (this.IsOpen) {\n this.triggerEl?.nativeElement.focus();\n this.Close();\n }\n break;\n case 'Home': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = 0; } break;\n case 'End': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = items.length - 1; } break;\n }\n }\n\n /**\n * Keys the open list's overlay receives. The overlay listens on the page body, so this sees a\n * key that did not go through the field or the filter box, for example after a click inside the\n * panel moved focus to the page. Escape closes the list here too, by the same rule as\n * {@link OnKeyDown}; other keys are left alone.\n */\n OnOverlayKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.IsOpen) this.closeListOnEscape(event);\n }\n\n /**\n * Escape with the list open closes the list and nothing else (#5340). The key is cancelled and\n * stopped here, so it never reaches the page, where a host that closes on Escape (a dialog, a\n * popover) would close as well. Focus goes back to the field, since the filter box that may have\n * held it goes away with the list.\n */\n private closeListOnEscape(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerEl?.nativeElement.focus();\n this.Close();\n }\n\n OnBlur(): void { this.onTouched(); }\n\n ngAfterViewInit(): void { WarnIfUnnamed(this.triggerEl?.nativeElement, 'mj-dropdown'); }\n\n GetItemText(item: unknown): string {\n if (item == null) return '';\n if (typeof item === 'string') return item;\n if (this.TextField && typeof item === 'object') return String((item as Record<string, unknown>)[this.TextField] ?? '');\n return String(item);\n }\n\n GetItemValue(item: unknown): unknown {\n if (typeof item === 'string') return item;\n if (this.ValueField && typeof item === 'object' && item != null) return (item as Record<string, unknown>)[this.ValueField];\n return item;\n }\n\n TrackByIndex(index: number): number { return index; }\n\n writeValue(value: unknown): void { this.SelectedValue = value; }\n registerOnChange(fn: (value: unknown) => void): void { this.onChange = fn; }\n registerOnTouched(fn: () => void): void { this.onTouched = fn; }\n setDisabledState(isDisabled: boolean): void { this.formDisabled = isDisabled; this.syncDisabled(); }\n ngOnDestroy(): void { this.Close(); }\n\n private getSelectedIndex(): number {\n if (this.SelectedValue == null) return -1;\n return this.FilteredItems.findIndex(item => this.IsItemSelected(item));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dropdown.component.js","sour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kFAxC1B,mBAAmB","sourcesContent":["import {\n AfterViewInit,\n Component,\n Input,\n Output,\n EventEmitter,\n forwardRef,\n HostBinding,\n ElementRef,\n ViewChild,\n ContentChild,\n TemplateRef,\n OnDestroy,\n inject,\n ChangeDetectorRef\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { OverlayModule, ConnectedPosition } from '@angular/cdk/overlay';\nimport { MJNamedControlBase } from '../a11y/named-control.base';\nimport { WarnIfUnnamed } from '../a11y/unnamed-control-guard';\n\n/**\n * mj-dropdown — Dropdown select component using CDK Overlay.\n *\n *\n * Every dropdown needs an ACCESSIBLE NAME, or it announces as \"combobox, collapsed\" with no hint of\n * what it selects (WCAG 2.1 4.1.2). Use {@link AriaLabelledBy} when a visible label already exists —\n * `<label for>` cannot name a `div[role=combobox]` — and {@link AriaLabel} when none does.\n *\n * Escape with the list open closes the list and goes no further, so a dialog or popover around the\n * field stays open. With the list closed, Escape goes on to the host as usual.\n *\n * @example With a visible label (preferred)\n * ```html\n * <span id=\"persona-label\">Interview persona</span>\n * <mj-dropdown\n * AriaLabelledBy=\"persona-label\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\">\n * </mj-dropdown>\n * ```\n *\n * @example With no visible label\n * ```html\n * <mj-dropdown\n * AriaLabel=\"Interview persona\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\"\n * [Filterable]=\"true\"\n * (FilterChange)=\"onFilter($event)\">\n * </mj-dropdown>\n * ```\n */\n@Component({\n selector: 'mj-dropdown',\n standalone: true,\n imports: [NgTemplateOutlet, OverlayModule],\n template: `\n <div\n class=\"mj-dropdown\"\n #trigger\n cdkOverlayOrigin\n #overlayOrigin=\"cdkOverlayOrigin\"\n [class.mj-dropdown--open]=\"IsOpen\"\n [class.mj-dropdown--disabled]=\"IsDisabled\"\n role=\"combobox\"\n [attr.id]=\"InputId || null\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\"\n [attr.aria-describedby]=\"AriaDescribedBy || null\"\n [attr.aria-expanded]=\"IsOpen\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"IsOpen ? ListboxId : null\"\n [attr.aria-disabled]=\"IsDisabled ? 'true' : null\"\n [attr.tabindex]=\"IsDisabled ? -1 : 0\"\n (click)=\"Toggle()\"\n (keydown)=\"OnKeyDown($event)\"\n (blur)=\"OnBlur()\">\n <span class=\"mj-dropdown-value\" [class.mj-dropdown-placeholder]=\"!HasValue\">\n {{ DisplayText }}\n </span>\n <i class=\"fa-solid fa-chevron-down mj-dropdown-arrow\"></i>\n </div>\n\n <!--\n The overlay's own Escape close is off: it cancels the key but lets it go on to the page.\n OnOverlayKeyDown closes the list on Escape instead and stops the key there.\n -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"IsOpen\"\n [cdkConnectedOverlayPositions]=\"Positions\"\n [cdkConnectedOverlayWidth]=\"TriggerWidth\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n cdkConnectedOverlayBackdropClass=\"mj-dropdown-backdrop\"\n (backdropClick)=\"Close()\"\n (detach)=\"Close()\"\n (overlayKeydown)=\"OnOverlayKeyDown($event)\">\n <div class=\"mj-dropdown-panel\" role=\"listbox\"\n [attr.id]=\"ListboxId\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\">\n @if (Filterable) {\n <div class=\"mj-dropdown-filter-wrap\">\n <!--\n The word \"Filter\" lives in a hidden span rather than in a concatenated string so the\n AriaLabelledBy path can NAME this box from the same visible label that names the\n dropdown: aria-labelledby takes an ID LIST, so \"Filter\" plus the label's own text is\n composed by the accessibility tree without this component ever seeing that text.\n Without it, every filterable dropdown on a form named this way announces as an\n identical \"Filter options\".\n\n A hidden node that is DIRECTLY referenced by aria-labelledby is still included in the\n name (accname §4.1), so aria-hidden keeps the word out of the reading order without\n costing the composed name.\n -->\n <span class=\"mj-dropdown-sr-only\" aria-hidden=\"true\" [attr.id]=\"FilterWordId\">Filter</span>\n <input\n #filterInput\n class=\"mj-input mj-dropdown-filter\"\n type=\"text\"\n placeholder=\"Filter...\"\n [attr.aria-labelledby]=\"FilterLabelledBy\"\n [attr.aria-label]=\"FilterLabelledBy ? null : FilterLabel\"\n [value]=\"filterText\"\n (input)=\"OnFilterInput($event)\"\n (keydown)=\"OnKeyDown($event)\" />\n </div>\n }\n @if (DefaultItem != null) {\n <div\n class=\"mj-dropdown-option mj-dropdown-option--default\"\n [class.mj-dropdown-option--selected]=\"SelectedValue == null\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === -1\"\n role=\"option\"\n [attr.aria-selected]=\"SelectedValue == null\"\n (click)=\"SelectItem(null, $event)\">\n {{ GetItemText(DefaultItem) }}\n </div>\n }\n @for (item of FilteredItems; track TrackByIndex($index)) {\n <div\n class=\"mj-dropdown-option\"\n [class.mj-dropdown-option--selected]=\"IsItemSelected(item)\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === $index\"\n role=\"option\"\n [attr.aria-selected]=\"IsItemSelected(item)\"\n (click)=\"SelectItem(item, $event)\">\n @if (itemTemplate) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ GetItemText(item) }}\n }\n </div>\n }\n @if (FilteredItems.length === 0) {\n <div class=\"mj-dropdown-no-data\">No data found</div>\n }\n </div>\n </ng-template>\n `,\n styles: [`\n /*\n * Component-scoped ON PURPOSE, unlike the rest of this control's styling, which ships as a global\n * stylesheet the host application imports. A host that skips that import gets unstyled chrome —\n * survivable — but a hidden-word span that is not hidden renders its word as literal text in the\n * middle of the field. The rule that hides it therefore has to travel with the component.\n *\n * Not display:none or visibility:hidden — both remove the element from the accessibility tree,\n * which is the one thing this element exists to be in.\n */\n .mj-dropdown-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MJDropdownComponent),\n multi: true\n }]\n})\nexport class MJDropdownComponent extends MJNamedControlBase implements ControlValueAccessor, AfterViewInit, OnDestroy {\n @Input() Data: Record<string, unknown>[] | string[] | readonly unknown[] | null = [];\n @Input() TextField = '';\n @Input() ValueField = '';\n @Input() Filterable = false;\n @Input() ValuePrimitive = false;\n /**\n * Host-driven disable. Composed with Angular Forms' `setDisabledState()` into `IsDisabled`\n * (the actual gate) — see `syncDisabled`. A setter, not a bare field, because this input is\n * routinely bound to an expression that changes over the control's lifetime\n * (`[Disabled]=\"!draft.CompanyID\"`), and the gate has to follow it every time.\n */\n @Input()\n set Disabled(value: boolean) {\n this.disabledInput = value;\n this.syncDisabled();\n }\n get Disabled(): boolean {\n return this.disabledInput;\n }\n @Input() Placeholder = 'Select...';\n @Input() DefaultItem: Record<string, unknown> | string | null = null;\n\n @Output() FilterChange = new EventEmitter<string>();\n @Output() ValueChange = new EventEmitter<unknown>();\n\n @ContentChild('mjDropdownItem') ItemTemplate: TemplateRef<{ $implicit: unknown }> | null = null;\n\n /** @deprecated Use {@link ItemTemplate}. */\n get itemTemplate(): TemplateRef<{ $implicit: unknown }> | null {\n return this.ItemTemplate;\n }\n /** @deprecated Use {@link ItemTemplate}. */\n set itemTemplate(value: TemplateRef<{ $implicit: unknown }> | null) {\n this.ItemTemplate = value;\n }\n\n @ViewChild('trigger') private triggerEl!: ElementRef<HTMLElement>;\n @ViewChild('filterInput') private filterInputEl: ElementRef<HTMLInputElement> | undefined;\n\n @HostBinding('class.mj-dropdown-host') readonly hostClass = true;\n\n private cdr = inject(ChangeDetectorRef);\n\n /** This dropdown's id suffix — the shared named-control counter, kept under its own name. */\n readonly DropdownId = this.NamedControlId;\n\n /**\n * Id of the popup listbox, so the trigger can point `aria-controls` at it while open — the half of\n * the combobox pattern that makes \"collapsed/expanded\" refer to something a screen reader can\n * find. Generated per instance from the shared named-control counter.\n */\n get ListboxId(): string { return `mj-dropdown-listbox-${this.DropdownId}`; }\n\n /** Id of the hidden \"Filter\" word, composed into the filter box's name via an id list. */\n get FilterWordId(): string { return this.SecondaryWordId('filter-word'); }\n\n /** `aria-labelledby` for the filter box when a VISIBLE label names the dropdown. */\n get FilterLabelledBy(): string { return this.SecondaryLabelledBy('filter-word'); }\n\n /** `aria-label` for the filter box in the no-visible-label case. */\n get FilterLabel(): string { return this.SecondaryLabel('Filter', 'Filter options'); }\n\n IsOpen = false;\n /**\n * The single gate on `Toggle()` / `Open()` — true when EITHER the `Disabled` input or Angular\n * Forms says so. Never assign it directly; go through `syncDisabled()` so both sources are\n * always composed and a lock closes an open panel.\n */\n IsDisabled = false;\n HighlightedIndex = -1;\n SelectedValue: unknown = null;\n TriggerWidth = 0;\n\n filterText = '';\n\n Positions: ConnectedPosition[] = [\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }\n ];\n\n private onChange: (value: unknown) => void = () => {};\n private onTouched: () => void = () => {};\n\n /** Backing field for the `Disabled` input. */\n private disabledInput = false;\n /** The forms-driven disabled state, kept SEPARATE so neither source can stomp the other. */\n private formDisabled = false;\n\n /**\n * Recompute the gate from both of its sources. Called whenever either changes.\n *\n * `IsDisabled` is derived state, and the only thing that assigned it was `setDisabledState()`.\n * The forms-driven half was in fact fine — `setUpControl` also wires `registerOnDisabledChange`,\n * so that hook fires on every `control.disable()`/`enable()`, not just at registration. What had\n * no recompute path at all was the `Disabled` @Input: a plain field, so the gate froze at\n * whatever the first compose produced and every later change to the input was dropped.\n *\n * That is how a `[Disabled]=\"!draft.CompanyID\"` picker stayed dead for the life of the\n * component after the company was finally chosen.\n */\n private syncDisabled(): void {\n const disabled = this.disabledInput || this.formDisabled;\n if (disabled === this.IsDisabled) return;\n this.IsDisabled = disabled;\n // Becoming disabled while the panel is open would otherwise leave an interactive list\n // hanging off a control the user can no longer operate.\n if (disabled) this.resetPanelState();\n this.cdr.markForCheck();\n }\n\n get FilteredItems(): unknown[] {\n const data = (this.Data ?? []) as unknown[];\n if (!this.Filterable || !this.filterText) return data;\n const search = this.filterText.toLowerCase();\n return data.filter(item => this.GetItemText(item).toLowerCase().includes(search));\n }\n\n get HasValue(): boolean { return this.SelectedValue != null; }\n\n get DisplayText(): string {\n if (this.SelectedValue == null) {\n if (this.DefaultItem != null) return this.GetItemText(this.DefaultItem);\n return this.Placeholder;\n }\n if (this.ValuePrimitive && this.ValueField) {\n const found = ((this.Data ?? []) as unknown[]).find(item => this.GetItemValue(item) === this.SelectedValue);\n return found ? this.GetItemText(found) : String(this.SelectedValue);\n }\n return this.GetItemText(this.SelectedValue as Record<string, unknown> | string);\n }\n\n Toggle(): void {\n if (this.IsDisabled) return;\n this.IsOpen ? this.Close() : this.Open();\n }\n\n Open(): void {\n if (this.IsDisabled || this.IsOpen) return;\n this.TriggerWidth = this.triggerEl?.nativeElement.offsetWidth ?? 200;\n this.IsOpen = true;\n this.HighlightedIndex = this.getSelectedIndex();\n this.cdr.detectChanges();\n if (this.Filterable) setTimeout(() => this.filterInputEl?.nativeElement.focus(), 0);\n }\n\n Close(): void {\n if (!this.IsOpen) return;\n this.resetPanelState();\n this.cdr.detectChanges();\n }\n\n /**\n * Panel state only — no change detection. Split out of `Close()` because `syncDisabled()` can\n * run from an @Input setter, i.e. DURING the parent's change-detection pass, where a nested\n * `detectChanges()` re-enters CD and trips NG0100 on the parent's own bindings.\n */\n private resetPanelState(): void {\n this.IsOpen = false;\n this.filterText = '';\n this.HighlightedIndex = -1;\n }\n\n SelectItem(item: unknown | null, event?: Event): void {\n event?.stopPropagation();\n if (item == null) {\n this.SelectedValue = null;\n this.onChange(null);\n this.ValueChange.emit(null);\n } else if (this.ValuePrimitive && this.ValueField) {\n const value = this.GetItemValue(item);\n this.SelectedValue = value;\n this.onChange(value);\n this.ValueChange.emit(value);\n } else {\n this.SelectedValue = item;\n this.onChange(item);\n this.ValueChange.emit(item);\n }\n this.Close();\n }\n\n IsItemSelected(item: unknown): boolean {\n if (this.SelectedValue == null) return false;\n if (this.ValuePrimitive && this.ValueField) return this.GetItemValue(item) === this.SelectedValue;\n if (this.ValueField && typeof item === 'object' && typeof this.SelectedValue === 'object')\n return this.GetItemValue(item) === this.GetItemValue(this.SelectedValue);\n return item === this.SelectedValue;\n }\n\n OnFilterInput(event: Event): void {\n this.filterText = (event.target as HTMLInputElement).value;\n this.HighlightedIndex = 0;\n this.FilterChange.emit(this.filterText);\n }\n\n /**\n * Keys pressed in the field or in the filter box. Escape with the list open closes the list and\n * stops the key there (see `closeListOnEscape`). With the list closed, Escape is cancelled as\n * before and goes on to the host, so a dialog or popover around the field still closes on it.\n */\n OnKeyDown(event: KeyboardEvent): void {\n const items = this.FilteredItems;\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.IsOpen) this.Open();\n else this.HighlightedIndex = Math.min(this.HighlightedIndex + 1, items.length - 1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.IsOpen) this.HighlightedIndex = Math.max(this.HighlightedIndex - 1, 0);\n break;\n case 'Enter':\n event.preventDefault();\n if (this.IsOpen && this.HighlightedIndex >= 0 && this.HighlightedIndex < items.length)\n this.SelectItem(items[this.HighlightedIndex]);\n else if (!this.IsOpen) this.Open();\n break;\n case 'Escape':\n event.preventDefault();\n if (this.IsOpen) this.closeListOnEscape(event);\n break;\n case 'Tab':\n // The panel lives in the overlay, outside a parent dialog. Hand focus back to this\n // field and do not prevent the key, so the browser moves on from the field.\n if (this.IsOpen) {\n this.triggerEl?.nativeElement.focus();\n this.Close();\n }\n break;\n case 'Home': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = 0; } break;\n case 'End': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = items.length - 1; } break;\n }\n }\n\n /**\n * Keys the open list's overlay receives. The overlay listens on the page body, so this sees a\n * key that did not go through the field or the filter box, for example after a click inside the\n * panel moved focus to the page. Escape closes the list here too, by the same rule as\n * {@link OnKeyDown}; other keys are left alone.\n */\n OnOverlayKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.IsOpen) this.closeListOnEscape(event);\n }\n\n /**\n * Escape with the list open closes the list and nothing else (#5340). The key is cancelled and\n * stopped here, so it never reaches the page, where a host that closes on Escape (a dialog, a\n * popover) would close as well. Focus goes back to the field, since the filter box that may have\n * held it goes away with the list.\n */\n private closeListOnEscape(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.triggerEl?.nativeElement.focus();\n this.Close();\n }\n\n OnBlur(): void { this.onTouched(); }\n\n ngAfterViewInit(): void { WarnIfUnnamed(this.triggerEl?.nativeElement, 'mj-dropdown'); }\n\n GetItemText(item: unknown): string {\n if (item == null) return '';\n if (typeof item === 'string') return item;\n if (this.TextField && typeof item === 'object') return String((item as Record<string, unknown>)[this.TextField] ?? '');\n return String(item);\n }\n\n GetItemValue(item: unknown): unknown {\n if (typeof item === 'string') return item;\n if (this.ValueField && typeof item === 'object' && item != null) return (item as Record<string, unknown>)[this.ValueField];\n return item;\n }\n\n TrackByIndex(index: number): number { return index; }\n\n writeValue(value: unknown): void { this.SelectedValue = value; }\n registerOnChange(fn: (value: unknown) => void): void { this.onChange = fn; }\n registerOnTouched(fn: () => void): void { this.onTouched = fn; }\n setDisabledState(isDisabled: boolean): void { this.formDisabled = isDisabled; this.syncDisabled(); }\n ngOnDestroy(): void { this.Close(); }\n\n private getSelectedIndex(): number {\n if (this.SelectedValue == null) return -1;\n return this.FilteredItems.findIndex(item => this.IsItemSelected(item));\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/filter-panel/filter-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAiB,MAAM,eAAe,CAAC;;AAOvE,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;AAE5D,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,IAAI,EAAE,eAAe,CAAC;IACtB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IACtE,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACzF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,2DAA2D;AAC3D,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,
|
|
1
|
+
{"version":3,"file":"filter-panel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/filter-panel/filter-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,E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G,EAAE,MAAM,GAAG,OAAO;IAIrC,wCAAwC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI9B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAKlD,wCAAwC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAIlD,0EAA0E;IACnE,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO;IAQnF,4CAA4C;IACrC,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO;IAInF,iFAAiF;IAC1E,WAAW,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAgB/E,2CAA2C;IACpC,WAAW,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;yCA5DpE,sBAAsB;2CAAtB,sBAAsB;CA+DlC"}
|
|
@@ -28,7 +28,7 @@ function MJFilterPanelComponent_For_3_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
28
28
|
} if (rf & 2) {
|
|
29
29
|
const field_r2 = i0.ɵɵnextContext().$implicit;
|
|
30
30
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
31
|
-
i0.ɵɵproperty("Data", field_r2.options ?? i0.ɵɵpureFunction0(
|
|
31
|
+
i0.ɵɵproperty("Data", field_r2.options ?? i0.ɵɵpureFunction0(6, _c1))("ValuePrimitive", true)("Filterable", !!field_r2.filterable)("Placeholder", field_r2.placeholder ?? "")("AriaLabel", field_r2.label)("ngModel", ctx_r2.getValue(field_r2.key));
|
|
32
32
|
} }
|
|
33
33
|
function MJFilterPanelComponent_For_3_Case_3_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
34
34
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
@@ -52,7 +52,7 @@ function MJFilterPanelComponent_For_3_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
52
52
|
} }
|
|
53
53
|
function MJFilterPanelComponent_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
54
54
|
i0.ɵɵelementStart(0, "mj-filter-field", 2);
|
|
55
|
-
i0.ɵɵconditionalCreate(1, MJFilterPanelComponent_For_3_Case_1_Template, 1, 2, "input", 4)(2, MJFilterPanelComponent_For_3_Case_2_Template, 1,
|
|
55
|
+
i0.ɵɵconditionalCreate(1, MJFilterPanelComponent_For_3_Case_1_Template, 1, 2, "input", 4)(2, MJFilterPanelComponent_For_3_Case_2_Template, 1, 7, "mj-dropdown", 5)(3, MJFilterPanelComponent_For_3_Case_3_Template, 3, 1, "div", 6);
|
|
56
56
|
i0.ɵɵelementEnd();
|
|
57
57
|
} if (rf & 2) {
|
|
58
58
|
let tmp_12_0;
|
|
@@ -155,7 +155,7 @@ export class MJFilterPanelComponent {
|
|
|
155
155
|
return this.OnChipClick(field, optValue);
|
|
156
156
|
}
|
|
157
157
|
static ɵfac = function MJFilterPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJFilterPanelComponent)(); };
|
|
158
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJFilterPanelComponent, selectors: [["mj-filter-panel"]], inputs: { Fields: "Fields", Values: "Values", ShowReset: "ShowReset", ResetLabel: "ResetLabel" }, outputs: { ValuesChange: "ValuesChange", Reset: "Reset" }, ngContentSelectors: _c0, decls: 6, vars: 1, consts: [[1, "mj-filter-panel"], [1, "mj-filter-panel-body"], [3, "Label", "Icon"], [1, "mj-filter-panel-footer"], ["type", "text", 1, "mj-filter-panel-text-input", 3, "value", "placeholder"], ["TextField", "text", "ValueField", "value", 3, "Data", "ValuePrimitive", "Filterable", "Placeholder", "ngModel"], [1, "mj-filter-panel-chip-group"], ["type", "text", 1, "mj-filter-panel-text-input", 3, "input", "value", "placeholder"], ["TextField", "text", "ValueField", "value", 3, "ngModelChange", "Data", "ValuePrimitive", "Filterable", "Placeholder", "ngModel"], [3, "Label", "Icon", "Active"], [3, "Clicked", "Label", "Icon", "Active"], ["type", "button", 1, "mj-filter-panel-reset", 3, "click"], [1, "fa-solid", "fa-rotate-left"]], template: function MJFilterPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
158
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJFilterPanelComponent, selectors: [["mj-filter-panel"]], inputs: { Fields: "Fields", Values: "Values", ShowReset: "ShowReset", ResetLabel: "ResetLabel" }, outputs: { ValuesChange: "ValuesChange", Reset: "Reset" }, ngContentSelectors: _c0, decls: 6, vars: 1, consts: [[1, "mj-filter-panel"], [1, "mj-filter-panel-body"], [3, "Label", "Icon"], [1, "mj-filter-panel-footer"], ["type", "text", 1, "mj-filter-panel-text-input", 3, "value", "placeholder"], ["TextField", "text", "ValueField", "value", 3, "Data", "ValuePrimitive", "Filterable", "Placeholder", "AriaLabel", "ngModel"], [1, "mj-filter-panel-chip-group"], ["type", "text", 1, "mj-filter-panel-text-input", 3, "input", "value", "placeholder"], ["TextField", "text", "ValueField", "value", 3, "ngModelChange", "Data", "ValuePrimitive", "Filterable", "Placeholder", "AriaLabel", "ngModel"], [3, "Label", "Icon", "Active"], [3, "Clicked", "Label", "Icon", "Active"], ["type", "button", 1, "mj-filter-panel-reset", 3, "click"], [1, "fa-solid", "fa-rotate-left"]], template: function MJFilterPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
159
159
|
i0.ɵɵprojectionDef();
|
|
160
160
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
161
161
|
i0.ɵɵrepeaterCreate(2, MJFilterPanelComponent_For_3_Template, 4, 3, "mj-filter-field", 2, _forTrack0);
|
|
@@ -194,6 +194,7 @@ export class MJFilterPanelComponent {
|
|
|
194
194
|
[ValuePrimitive]="true"
|
|
195
195
|
[Filterable]="!!field.filterable"
|
|
196
196
|
[Placeholder]="field.placeholder ?? ''"
|
|
197
|
+
[AriaLabel]="field.label"
|
|
197
198
|
[ngModel]="getValue(field.key)"
|
|
198
199
|
(ngModelChange)="setValue(field.key, $event)">
|
|
199
200
|
</mj-dropdown>
|
|
@@ -240,5 +241,5 @@ export class MJFilterPanelComponent {
|
|
|
240
241
|
}], Reset: [{
|
|
241
242
|
type: Output
|
|
242
243
|
}] }); })();
|
|
243
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJFilterPanelComponent, { className: "MJFilterPanelComponent", filePath: "lib/filter-panel/filter-panel.component.ts", lineNumber:
|
|
244
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJFilterPanelComponent, { className: "MJFilterPanelComponent", filePath: "lib/filter-panel/filter-panel.component.ts", lineNumber: 206 }); })();
|
|
244
245
|
//# sourceMappingURL=filter-panel.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-panel.component.js","sourceRoot":"","sources":["../../../src/lib/filter-panel/filter-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;;;;;;;;;IAwEhE,gCAK6D;IAA3D,6OAAS,kDAA8C,KAAC;IAL1D,iBAK6D;;;;IAD3D,AADA,2DAAmC,2CACI;;;;IAIzC,sCAQgD;IAA9C,mQAAiB,qCAA2B,KAAC;IAC/C,iBAAc;;;;IAFZ,AADA,AAD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E,CAAC,CAAC,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,2CAA2C;IACpC,WAAW,CAAC,KAAwB,EAAE,QAA2B;QACtE,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;gHA9DU,sBAAsB;6DAAtB,sBAAsB;;YApI7B,AADF,8BAA6B,aACO;YAChC,qGAqCC;YAGD,kBAAyB;YAC3B,iBAAM;YAEN,wFAAiB;YAOnB,iBAAM;;YAlDF,eAqCC;YArCD,yBAqCC;YAMH,eAMC;YAND,wCAMC;4BArDK,YAAY,EAAE,WAAW,kCAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB;;iFAuI5F,sBAAsB;cA1IlC,SAAS;2BACE,iBAAiB,cACf,IAAI,WACP,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,YAC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDT;;kBAiFA,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kFAPI,sBAAsB","sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MJDropdownComponent } from '../dropdown/dropdown.component';\nimport { MJFilterChipComponent } from '../filter-chip/filter-chip.component';\nimport { MJFilterFieldComponent } from '../filter-field/filter-field.component';\n\n/** Field types supported natively by <mj-filter-panel>. */\nexport type FilterFieldType = 'text' | 'dropdown' | 'chips';\n\n/** Per-field config understood by <mj-filter-panel>. */\nexport interface FilterFieldConfig {\n /** State key in the Values record. */\n key: string;\n /** Field type — drives which widget is rendered. */\n type: FilterFieldType;\n /** Display label. */\n label: string;\n /** Optional Font Awesome icon class (e.g. 'fa-solid fa-folder'). */\n icon?: string;\n /** Placeholder for text inputs / dropdowns. */\n placeholder?: string;\n /** Dropdown options (when type === 'dropdown'). Each option needs text + value. */\n options?: { text: string; value: string | number | boolean | null }[];\n /** Whether the dropdown should show an internal search box. */\n filterable?: boolean;\n /** Chip-group options (when type === 'chips'). */\n chipOptions?: { text: string; value: string | number | boolean | null; icon?: string }[];\n /**\n * For `type === 'chips'` only. When `true`, the chip group is multi-select:\n * the field's value is an **array** of selected option values and clicking a\n * chip toggles it in/out. When absent/false (default), the group is\n * single-select (value is the chosen option value, click replaces).\n */\n multi?: boolean;\n}\n\n/** Option value type shared by dropdown + chip options. */\ntype FilterOptionValue = string | number | boolean | null;\n\n/**\n * mj-filter-panel — Single centralized filter panel for all dashboards.\n *\n * Config-driven: pass an array of `FilterFieldConfig` plus a `Values` record;\n * the panel renders each field using the appropriate widget (text input,\n * `<mj-dropdown>`, or chip group), keeps everything visually consistent, and\n * emits state changes via `(ValuesChange)`.\n *\n * For widgets not covered by the config schema (tree-dropdown, date pickers,\n * etc.), project `<mj-filter-field>` elements as content — they render below\n * the config-driven fields with identical chrome.\n *\n * Example:\n * ```html\n * <mj-filter-panel\n * [Fields]=\"filterFields\"\n * [(Values)]=\"filterValues\"\n * (Reset)=\"onReset()\">\n *\n * <!-- escape hatch for custom widgets -->\n * <mj-filter-field Label=\"Category\" Icon=\"fa-solid fa-folder\">\n * <mj-tree-dropdown ...></mj-tree-dropdown>\n * </mj-filter-field>\n * </mj-filter-panel>\n * ```\n */\n@Component({\n selector: 'mj-filter-panel',\n standalone: true,\n imports: [CommonModule, FormsModule, MJDropdownComponent, MJFilterChipComponent, MJFilterFieldComponent],\n template: `\n <div class=\"mj-filter-panel\">\n <div class=\"mj-filter-panel-body\">\n @for (field of Fields; track field.key) {\n <mj-filter-field [Label]=\"field.label\" [Icon]=\"field.icon ?? null\">\n @switch (field.type) {\n @case ('text') {\n <input\n type=\"text\"\n class=\"mj-filter-panel-text-input\"\n [value]=\"getValue(field.key) ?? ''\"\n [placeholder]=\"field.placeholder ?? ''\"\n (input)=\"setValue(field.key, $any($event.target).value)\" />\n }\n @case ('dropdown') {\n <mj-dropdown\n [Data]=\"field.options ?? []\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [Filterable]=\"!!field.filterable\"\n [Placeholder]=\"field.placeholder ?? ''\"\n [ngModel]=\"getValue(field.key)\"\n (ngModelChange)=\"setValue(field.key, $event)\">\n </mj-dropdown>\n }\n @case ('chips') {\n <div class=\"mj-filter-panel-chip-group\">\n @for (opt of field.chipOptions ?? []; track opt.value) {\n <mj-filter-chip\n [Label]=\"opt.text\"\n [Icon]=\"opt.icon ?? null\"\n [Active]=\"isChipActive(field, opt.value)\"\n (Clicked)=\"onChipClick(field, opt.value)\">\n </mj-filter-chip>\n }\n </div>\n }\n }\n </mj-filter-field>\n }\n\n <!-- Escape hatch for custom field widgets (e.g. mj-tree-dropdown, date pickers) -->\n <ng-content></ng-content>\n </div>\n\n @if (ShowReset) {\n <div class=\"mj-filter-panel-footer\">\n <button type=\"button\" class=\"mj-filter-panel-reset\" (click)=\"Reset.emit()\">\n <i class=\"fa-solid fa-rotate-left\"></i> {{ ResetLabel }}\n </button>\n </div>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n }\n\n .mj-filter-panel {\n display: flex;\n flex-direction: column;\n gap: 14px;\n }\n\n .mj-filter-panel-body {\n display: flex;\n flex-direction: column;\n gap: 14px;\n }\n\n .mj-filter-panel-text-input {\n width: 100%;\n padding: 7px 12px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n font: inherit;\n font-size: 13px;\n color: var(--mj-text-primary);\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n }\n\n .mj-filter-panel-text-input:focus {\n outline: none;\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n }\n\n .mj-filter-panel-text-input::placeholder {\n color: var(--mj-text-muted);\n }\n\n .mj-filter-panel-chip-group {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n }\n\n .mj-filter-panel-footer {\n display: flex;\n justify-content: flex-end;\n padding-top: 10px;\n border-top: 1px solid var(--mj-border-subtle);\n }\n\n .mj-filter-panel-reset {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n background: transparent;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n color: var(--mj-text-secondary);\n font: inherit;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n }\n\n .mj-filter-panel-reset:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-strong);\n color: var(--mj-text-primary);\n }\n\n .mj-filter-panel-reset i {\n font-size: 11px;\n }\n `]\n})\nexport class MJFilterPanelComponent {\n @Input() Fields: FilterFieldConfig[] = [];\n @Input() Values: Record<string, unknown> = {};\n @Input() ShowReset: boolean = true;\n @Input() ResetLabel: string = 'Reset filters';\n\n @Output() ValuesChange = new EventEmitter<Record<string, unknown>>();\n @Output() Reset = new EventEmitter<void>();\n\n public GetValue(key: string): unknown {\n return this.Values?.[key];\n }\n\n /** @deprecated Use {@link GetValue}. */\n public getValue(key: string): unknown {\n return this.GetValue(key);\n }\n\n public SetValue(key: string, value: unknown): void {\n this.Values = { ...this.Values, [key]: value };\n this.ValuesChange.emit(this.Values);\n }\n\n /** @deprecated Use {@link SetValue}. */\n public setValue(key: string, value: unknown): void {\n return this.SetValue(key, value);\n }\n\n /** Whether a chip option is currently active (handles single + multi). */\n public IsChipActive(field: FilterFieldConfig, optValue: FilterOptionValue): boolean {\n if (field.multi) {\n const current = this.GetValue(field.key);\n return Array.isArray(current) && current.includes(optValue);\n }\n return this.GetValue(field.key) === optValue;\n }\n\n /** @deprecated Use {@link IsChipActive}. */\n public isChipActive(field: FilterFieldConfig, optValue: FilterOptionValue): boolean {\n return this.IsChipActive(field, optValue);\n }\n\n /** Chip click: replace (single-select) or toggle in/out of the array (multi). */\n public OnChipClick(field: FilterFieldConfig, optValue: FilterOptionValue): void {\n if (!field.multi) {\n this.SetValue(field.key, optValue);\n return;\n }\n const current = this.GetValue(field.key);\n const next: FilterOptionValue[] = Array.isArray(current) ? [...current] : [];\n const idx = next.indexOf(optValue);\n if (idx >= 0) {\n next.splice(idx, 1);\n } else {\n next.push(optValue);\n }\n this.SetValue(field.key, next);\n }\n\n /** @deprecated Use {@link OnChipClick}. */\n public onChipClick(field: FilterFieldConfig, optValue: FilterOptionValue): void {\n return this.OnChipClick(field, optValue);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"filter-panel.component.js","sourceRoot":"","sources":["../../../src/lib/filter-panel/filter-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;;;;;;;;;IAwEhE,gCAK6D;IAA3D,6OAAS,kDAA8C,KAAC;IAL1D,iBAK6D;;;;IAD3D,AADA,2DAAmC,2CACI;;;;IAIzC,sCASgD;IAA9C,mQAAiB,qCAA2B,KAAC;IAC/C,iBAAc;;;;IAFZ,AADA,AADA,AADA,AADA,AAHA,qEAA4B,wBAGL,qCACU,2CACM,6BACd,0CACM;;;;IAO7B,0CAI4C;IAA1C,oRAAW,0C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C,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,2CAA2C;IACpC,WAAW,CAAC,KAAwB,EAAE,QAA2B;QACtE,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;gHA9DU,sBAAsB;6DAAtB,sBAAsB;;YArI7B,AADF,8BAA6B,aACO;YAChC,qGAsCC;YAGD,kBAAyB;YAC3B,iBAAM;YAEN,wFAAiB;YAOnB,iBAAM;;YAnDF,eAsCC;YAtCD,yBAsCC;YAMH,eAMC;YAND,wCAMC;4BAtDK,YAAY,EAAE,WAAW,kCAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB;;iFAwI5F,sBAAsB;cA3IlC,SAAS;2BACE,iBAAiB,cACf,IAAI,WACP,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,YAC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDT;;kBAiFA,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kFAPI,sBAAsB","sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MJDropdownComponent } from '../dropdown/dropdown.component';\nimport { MJFilterChipComponent } from '../filter-chip/filter-chip.component';\nimport { MJFilterFieldComponent } from '../filter-field/filter-field.component';\n\n/** Field types supported natively by <mj-filter-panel>. */\nexport type FilterFieldType = 'text' | 'dropdown' | 'chips';\n\n/** Per-field config understood by <mj-filter-panel>. */\nexport interface FilterFieldConfig {\n /** State key in the Values record. */\n key: string;\n /** Field type — drives which widget is rendered. */\n type: FilterFieldType;\n /** Display label. */\n label: string;\n /** Optional Font Awesome icon class (e.g. 'fa-solid fa-folder'). */\n icon?: string;\n /** Placeholder for text inputs / dropdowns. */\n placeholder?: string;\n /** Dropdown options (when type === 'dropdown'). Each option needs text + value. */\n options?: { text: string; value: string | number | boolean | null }[];\n /** Whether the dropdown should show an internal search box. */\n filterable?: boolean;\n /** Chip-group options (when type === 'chips'). */\n chipOptions?: { text: string; value: string | number | boolean | null; icon?: string }[];\n /**\n * For `type === 'chips'` only. When `true`, the chip group is multi-select:\n * the field's value is an **array** of selected option values and clicking a\n * chip toggles it in/out. When absent/false (default), the group is\n * single-select (value is the chosen option value, click replaces).\n */\n multi?: boolean;\n}\n\n/** Option value type shared by dropdown + chip options. */\ntype FilterOptionValue = string | number | boolean | null;\n\n/**\n * mj-filter-panel — Single centralized filter panel for all dashboards.\n *\n * Config-driven: pass an array of `FilterFieldConfig` plus a `Values` record;\n * the panel renders each field using the appropriate widget (text input,\n * `<mj-dropdown>`, or chip group), keeps everything visually consistent, and\n * emits state changes via `(ValuesChange)`.\n *\n * For widgets not covered by the config schema (tree-dropdown, date pickers,\n * etc.), project `<mj-filter-field>` elements as content — they render below\n * the config-driven fields with identical chrome.\n *\n * Example:\n * ```html\n * <mj-filter-panel\n * [Fields]=\"filterFields\"\n * [(Values)]=\"filterValues\"\n * (Reset)=\"onReset()\">\n *\n * <!-- escape hatch for custom widgets -->\n * <mj-filter-field Label=\"Category\" Icon=\"fa-solid fa-folder\">\n * <mj-tree-dropdown ...></mj-tree-dropdown>\n * </mj-filter-field>\n * </mj-filter-panel>\n * ```\n */\n@Component({\n selector: 'mj-filter-panel',\n standalone: true,\n imports: [CommonModule, FormsModule, MJDropdownComponent, MJFilterChipComponent, MJFilterFieldComponent],\n template: `\n <div class=\"mj-filter-panel\">\n <div class=\"mj-filter-panel-body\">\n @for (field of Fields; track field.key) {\n <mj-filter-field [Label]=\"field.label\" [Icon]=\"field.icon ?? null\">\n @switch (field.type) {\n @case ('text') {\n <input\n type=\"text\"\n class=\"mj-filter-panel-text-input\"\n [value]=\"getValue(field.key) ?? ''\"\n [placeholder]=\"field.placeholder ?? ''\"\n (input)=\"setValue(field.key, $any($event.target).value)\" />\n }\n @case ('dropdown') {\n <mj-dropdown\n [Data]=\"field.options ?? []\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [Filterable]=\"!!field.filterable\"\n [Placeholder]=\"field.placeholder ?? ''\"\n [AriaLabel]=\"field.label\"\n [ngModel]=\"getValue(field.key)\"\n (ngModelChange)=\"setValue(field.key, $event)\">\n </mj-dropdown>\n }\n @case ('chips') {\n <div class=\"mj-filter-panel-chip-group\">\n @for (opt of field.chipOptions ?? []; track opt.value) {\n <mj-filter-chip\n [Label]=\"opt.text\"\n [Icon]=\"opt.icon ?? null\"\n [Active]=\"isChipActive(field, opt.value)\"\n (Clicked)=\"onChipClick(field, opt.value)\">\n </mj-filter-chip>\n }\n </div>\n }\n }\n </mj-filter-field>\n }\n\n <!-- Escape hatch for custom field widgets (e.g. mj-tree-dropdown, date pickers) -->\n <ng-content></ng-content>\n </div>\n\n @if (ShowReset) {\n <div class=\"mj-filter-panel-footer\">\n <button type=\"button\" class=\"mj-filter-panel-reset\" (click)=\"Reset.emit()\">\n <i class=\"fa-solid fa-rotate-left\"></i> {{ ResetLabel }}\n </button>\n </div>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n }\n\n .mj-filter-panel {\n display: flex;\n flex-direction: column;\n gap: 14px;\n }\n\n .mj-filter-panel-body {\n display: flex;\n flex-direction: column;\n gap: 14px;\n }\n\n .mj-filter-panel-text-input {\n width: 100%;\n padding: 7px 12px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n font: inherit;\n font-size: 13px;\n color: var(--mj-text-primary);\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n }\n\n .mj-filter-panel-text-input:focus {\n outline: none;\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n }\n\n .mj-filter-panel-text-input::placeholder {\n color: var(--mj-text-muted);\n }\n\n .mj-filter-panel-chip-group {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n }\n\n .mj-filter-panel-footer {\n display: flex;\n justify-content: flex-end;\n padding-top: 10px;\n border-top: 1px solid var(--mj-border-subtle);\n }\n\n .mj-filter-panel-reset {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n background: transparent;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n color: var(--mj-text-secondary);\n font: inherit;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n }\n\n .mj-filter-panel-reset:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-strong);\n color: var(--mj-text-primary);\n }\n\n .mj-filter-panel-reset i {\n font-size: 11px;\n }\n `]\n})\nexport class MJFilterPanelComponent {\n @Input() Fields: FilterFieldConfig[] = [];\n @Input() Values: Record<string, unknown> = {};\n @Input() ShowReset: boolean = true;\n @Input() ResetLabel: string = 'Reset filters';\n\n @Output() ValuesChange = new EventEmitter<Record<string, unknown>>();\n @Output() Reset = new EventEmitter<void>();\n\n public GetValue(key: string): unknown {\n return this.Values?.[key];\n }\n\n /** @deprecated Use {@link GetValue}. */\n public getValue(key: string): unknown {\n return this.GetValue(key);\n }\n\n public SetValue(key: string, value: unknown): void {\n this.Values = { ...this.Values, [key]: value };\n this.ValuesChange.emit(this.Values);\n }\n\n /** @deprecated Use {@link SetValue}. */\n public setValue(key: string, value: unknown): void {\n return this.SetValue(key, value);\n }\n\n /** Whether a chip option is currently active (handles single + multi). */\n public IsChipActive(field: FilterFieldConfig, optValue: FilterOptionValue): boolean {\n if (field.multi) {\n const current = this.GetValue(field.key);\n return Array.isArray(current) && current.includes(optValue);\n }\n return this.GetValue(field.key) === optValue;\n }\n\n /** @deprecated Use {@link IsChipActive}. */\n public isChipActive(field: FilterFieldConfig, optValue: FilterOptionValue): boolean {\n return this.IsChipActive(field, optValue);\n }\n\n /** Chip click: replace (single-select) or toggle in/out of the array (multi). */\n public OnChipClick(field: FilterFieldConfig, optValue: FilterOptionValue): void {\n if (!field.multi) {\n this.SetValue(field.key, optValue);\n return;\n }\n const current = this.GetValue(field.key);\n const next: FilterOptionValue[] = Array.isArray(current) ? [...current] : [];\n const idx = next.indexOf(optValue);\n if (idx >= 0) {\n next.splice(idx, 1);\n } else {\n next.push(optValue);\n }\n this.SetValue(field.key, next);\n }\n\n /** @deprecated Use {@link OnChipClick}. */\n public onChipClick(field: FilterFieldConfig, optValue: FilterOptionValue): void {\n return this.OnChipClick(field, optValue);\n }\n}\n"]}
|
package/dist/lib/input/chip.scss
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MJ Form Input Styles
|
|
3
3
|
*
|
|
4
|
-
* Provides consistent styling for native form elements
|
|
5
|
-
* - .mj-input — text inputs
|
|
6
|
-
* - .mj-textarea — textareas
|
|
7
|
-
* - .mj-checkbox — styled checkbox
|
|
4
|
+
* Provides consistent styling for native form elements.
|
|
5
|
+
* - .mj-input — text inputs
|
|
6
|
+
* - .mj-textarea — textareas
|
|
7
|
+
* - .mj-checkbox — styled checkbox
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
.mj-input,
|
|
@@ -3,7 +3,7 @@ import { ControlValueAccessor } from '@angular/forms';
|
|
|
3
3
|
import { MJNamedControlBase } from '../a11y/named-control.base';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
|
-
* mj-numeric-input — Numeric input with min/max/step.
|
|
6
|
+
* mj-numeric-input — Numeric input with min/max/step.
|
|
7
7
|
*
|
|
8
8
|
* A spinbutton with no accessible name announces as "spin button, blank" (WCAG 2.1 4.1.2). Use
|
|
9
9
|
* {@link MJNamedControlBase.AriaLabelledBy} when a visible label exists,
|
|
@@ -5,7 +5,7 @@ import { WarnIfUnnamed } from '../a11y/unnamed-control-guard';
|
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
const _c0 = ["numericInput"];
|
|
7
7
|
/**
|
|
8
|
-
* mj-numeric-input — Numeric input with min/max/step.
|
|
8
|
+
* mj-numeric-input — Numeric input with min/max/step.
|
|
9
9
|
*
|
|
10
10
|
* A spinbutton with no accessible name announces as "spin button, blank" (WCAG 2.1 4.1.2). Use
|
|
11
11
|
* {@link MJNamedControlBase.AriaLabelledBy} when a visible label exists,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric-input.component.js","sourceRoot":"","sources":["../../../src/lib/numeric-input/numeric-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EAET,WAAW,EACX,KAAK,EACL,SAAS,EACT,UAAU,EACV,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;;;AAE9D;;;;;;;;;;;;GAYG;AAiBH,MAAM,OAAO,uBAAwB,SAAQ,kBAAkB;IACpD,GAAG,GAAkB,IAAI,CAAC;IAC1B,GAAG,GAAkB,IAAI,CAAC;IAC1B,IAAI,GAAW,CAAC,CAAC;IACjB,MAAM,GAAW,EAAE,CAAC;IACpB,QAAQ,GAAkB,IAAI,CAAC;IACxC;;;;;OAKG;IACH,IACI,QAAQ,CAAC,KAAc,IAAI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACjF,IAAI,QAAQ,KAAc,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7C,WAAW,GAAG,EAAE,CAAC;IAC2B,SAAS,GAAG,IAAI,CAAC;IACnC,cAAc,CAA2C;IAE5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,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAC7G,CAAC;yQA3EU,uBAAuB,yBAAvB,uBAAuB;6DAAvB,uBAAuB;;;;;;YAAvB,sDAAuB;0LAFvB,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAV9G,sCAQgD;YAApB,AAA1B,4GAAS,mBAAe,IAAC,oFAAS,YAAQ,IAAC;YAR7C,oBAQgD;;YAD9C,AADiC,4CAAuB,2BAClC;;;;iFAKf,uBAAuB;cAhBnC,SAAS;eAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;;;;;GAUT;gBACD,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,wBAAwB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;aACjH;;kBAEE,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBACL,WAAW;mBAAC,6BAA6B;;kBACzC,SAAS;mBAAC,cAAc;;kFAjBd,uBAAuB","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Input,\n ViewChild,\n forwardRef,\n inject\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { MJNamedControlBase } from '../a11y/named-control.base';\nimport { WarnIfUnnamed } from '../a11y/unnamed-control-guard';\n\n/**\n * mj-numeric-input — Numeric input with min/max/step
|
|
1
|
+
{"version":3,"file":"numeric-input.component.js","sourceRoot":"","sources":["../../../src/lib/numeric-input/numeric-input.component.ts"],"names":[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iFAKf,uBAAuB;cAhBnC,SAAS;eAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;;;;;GAUT;gBACD,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,wBAAwB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;aACjH;;kBAEE,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAOL,KAAK;;kBAGL,KAAK;;kBACL,WAAW;mBAAC,6BAA6B;;kBACzC,SAAS;mBAAC,cAAc;;kFAjBd,uBAAuB","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n Input,\n ViewChild,\n forwardRef,\n inject\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { MJNamedControlBase } from '../a11y/named-control.base';\nimport { WarnIfUnnamed } from '../a11y/unnamed-control-guard';\n\n/**\n * mj-numeric-input — Numeric input with min/max/step.\n *\n * A spinbutton with no accessible name announces as \"spin button, blank\" (WCAG 2.1 4.1.2). Use\n * {@link MJNamedControlBase.AriaLabelledBy} when a visible label exists,\n * {@link MJNamedControlBase.AriaLabel} when none does. The control here is a real `<input>`, so\n * {@link MJNamedControlBase.InputId} IS a valid `<label for>` target.\n *\n * @example\n * ```html\n * <mj-numeric-input AriaLabel=\"Quantity\" [(ngModel)]=\"quantity\" [Min]=\"0\" [Max]=\"100\" />\n * ```\n */\n@Component({\n selector: 'mj-numeric-input',\n standalone: true,\n template: `\n <input #numericInput type=\"number\" class=\"mj-input mj-numeric-input\"\n [attr.min]=\"Min\" [attr.max]=\"Max\" [attr.step]=\"Step\"\n [attr.id]=\"InputId || null\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\"\n [attr.aria-describedby]=\"AriaDescribedBy || null\"\n [attr.placeholder]=\"Placeholder\" [disabled]=\"IsDisabled\"\n [value]=\"DisplayValue\"\n (input)=\"OnInput($event)\" (blur)=\"OnBlur()\" />\n `,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MJNumericInputComponent), multi: true }]\n})\nexport class MJNumericInputComponent extends MJNamedControlBase implements ControlValueAccessor, AfterViewInit {\n @Input() Min: number | null = null;\n @Input() Max: number | null = null;\n @Input() Step: number = 1;\n @Input() Format: string = '';\n @Input() Decimals: number | null = null;\n /**\n * Host-driven disable. Composed with Angular Forms' `setDisabledState()` into `IsDisabled`\n * (the actual gate) — see `syncDisabled`. A setter, not a bare field, because this input is\n * routinely bound to an expression that changes over the control's lifetime, and the gate has\n * to follow it every time.\n */\n @Input()\n set Disabled(value: boolean) { this.disabledInput = value; this.syncDisabled(); }\n get Disabled(): boolean { return this.disabledInput; }\n @Input() Placeholder = '';\n @HostBinding('class.mj-numeric-input-host') readonly hostClass = true;\n @ViewChild('numericInput') private numericInputEl: ElementRef<HTMLInputElement> | undefined;\n\n /** The rendered `[disabled]` state — true when EITHER source says so. Assign via `syncDisabled()`. */\n IsDisabled = false;\n private disabledInput = false;\n private formDisabled = false;\n private cdr = inject(ChangeDetectorRef);\n\n /**\n * Recompute the gate from both of its sources. Called whenever either one changes.\n *\n * `IsDisabled` is derived state, and the only thing that assigned it was `setDisabledState()`.\n * The forms-driven half was in fact fine — `setUpControl` also wires `registerOnDisabledChange`,\n * so that hook fires on every `control.disable()`/`enable()`, not just at registration. What had\n * no recompute path at all was the `Disabled` @Input: a plain field, so the gate froze at\n * whatever the first compose produced and every later change to the input was dropped.\n */\n private syncDisabled(): void {\n const disabled = this.disabledInput || this.formDisabled;\n if (disabled === this.IsDisabled) return;\n this.IsDisabled = disabled;\n this.cdr.markForCheck();\n }\n\n DisplayValue: string | number = '';\n private internalValue: number | null = null;\n private onChange: (value: number | null) => void = () => {};\n private onTouched: () => void = () => {};\n\n ngAfterViewInit(): void { WarnIfUnnamed(this.numericInputEl?.nativeElement, 'mj-numeric-input'); }\n\n OnInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n if (raw === '' || raw === '-') { this.internalValue = null; this.onChange(null); return; }\n let num = parseFloat(raw);\n if (isNaN(num)) return;\n num = this.clamp(num);\n this.internalValue = num;\n this.onChange(num);\n }\n\n OnBlur(): void { this.onTouched(); this.formatDisplay(); }\n\n writeValue(value: number | null): void { this.internalValue = value; this.formatDisplay(); }\n registerOnChange(fn: (value: number | null) => void): void { this.onChange = fn; }\n registerOnTouched(fn: () => void): void { this.onTouched = fn; }\n setDisabledState(isDisabled: boolean): void { this.formDisabled = isDisabled; this.syncDisabled(); }\n\n private clamp(value: number): number {\n if (this.Min != null && value < this.Min) return this.Min;\n if (this.Max != null && value > this.Max) return this.Max;\n if (this.Decimals != null) { const f = Math.pow(10, this.Decimals); return Math.round(value * f) / f; }\n return value;\n }\n\n private formatDisplay(): void {\n if (this.internalValue == null) { this.DisplayValue = ''; return; }\n this.DisplayValue = this.Decimals != null ? this.internalValue.toFixed(this.Decimals) : this.internalValue;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export type MjProgressBarType = 'value' | 'infinite';
|
|
3
3
|
/**
|
|
4
|
-
* mj-progress-bar — Progress indicator.
|
|
4
|
+
* mj-progress-bar — Progress indicator.
|
|
5
5
|
*/
|
|
6
6
|
export declare class MJProgressBarComponent {
|
|
7
7
|
Value: number;
|
|
@@ -16,7 +16,7 @@ function MJProgressBarComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
16
16
|
i0.ɵɵtextInterpolate1(" ", ctx_r0.ClampedValue, "% ");
|
|
17
17
|
} }
|
|
18
18
|
/**
|
|
19
|
-
* mj-progress-bar — Progress indicator.
|
|
19
|
+
* mj-progress-bar — Progress indicator.
|
|
20
20
|
*/
|
|
21
21
|
export class MJProgressBarComponent {
|
|
22
22
|
Value = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.component.js","sourceRoot":"","sources":["../../../src/lib/progress-bar/progress-bar.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;;IAYxD,iCAA+F;IAC7F,4BAAiD;IACnD,oBAAM;;;IAEN,sCAC+F;IAC7F,YACF;IAAA,oBAAW;;;;IADT,cACF;IADE,qDACF;;AAfN;;GAEG;AAiBH,MAAM,OAAO,sBAAsB;IACxB,KAAK,GAAW,CAAC,CAAC;IAClB,IAAI,GAAsB,OAAO,CAAC;IACS,SAAS,GAAG,IAAI,CAAC;IACrE,IAAI,YAAY,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gHAJlE,sBAAsB;6DAAtB,sBAAsB;YAAtB,qDAAsB;;YAR7B,AAJF,wFAA2B,uEAIlB;;YAJT,iDASC;;;iFAGQ,sBAAsB;cAhBlC,SAAS;eAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;;;;;;GAWT;aACF;;kBAEE,KAAK;;kBACL,KAAK;;kBACL,WAAW;mBAAC,4BAA4B;;kFAH9B,sBAAsB","sourcesContent":["import { Component, Input, HostBinding } from '@angular/core';\n\nexport type MjProgressBarType = 'value' | 'infinite';\n\n/**\n * mj-progress-bar — Progress indicator
|
|
1
|
+
{"version":3,"file":"progress-bar.component.js","sourceRoot":"","sources":["../../../src/lib/progress-bar/progress-bar.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;;IAYxD,iCAA+F;IAC7F,4BAAiD;IACnD,oBAAM;;;IAEN,sCAC+F;IAC7F,YACF;IAAA,oBAAW;;;;IADT,cACF;IADE,qDACF;;AAfN;;GAEG;AAiBH,MAAM,OAAO,sBAAsB;IACxB,KAAK,GAAW,CAAC,CAAC;IAClB,IAAI,GAAsB,OAAO,CAAC;IACS,SAAS,GAAG,IAAI,CAAC;IACrE,IAAI,YAAY,KAAa,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gHAJlE,sBAAsB;6DAAtB,sBAAsB;YAAtB,qDAAsB;;YAR7B,AAJF,wFAA2B,uEAIlB;;YAJT,iDASC;;;iFAGQ,sBAAsB;cAhBlC,SAAS;eAAC;gBACT,QAAQ,EAAE,iBAAiB;gBAC3B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;;;;;;GAWT;aACF;;kBAEE,KAAK;;kBACL,KAAK;;kBACL,WAAW;mBAAC,4BAA4B;;kFAH9B,sBAAsB","sourcesContent":["import { Component, Input, HostBinding } from '@angular/core';\n\nexport type MjProgressBarType = 'value' | 'infinite';\n\n/**\n * mj-progress-bar — Progress indicator.\n */\n@Component({\n selector: 'mj-progress-bar',\n standalone: true,\n template: `\n @if (Type === 'infinite') {\n <div class=\"mj-progress-bar mj-progress-bar--infinite\" role=\"progressbar\" aria-label=\"Loading\">\n <div class=\"mj-progress-bar-indeterminate\"></div>\n </div>\n } @else {\n <progress class=\"mj-progress-bar\" [attr.value]=\"ClampedValue\" max=\"100\"\n role=\"progressbar\" [attr.aria-valuenow]=\"ClampedValue\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n {{ ClampedValue }}%\n </progress>\n }\n `\n})\nexport class MJProgressBarComponent {\n @Input() Value: number = 0;\n @Input() Type: MjProgressBarType = 'value';\n @HostBinding('class.mj-progress-bar-host') readonly hostClass = true;\n get ClampedValue(): number { return Math.max(0, Math.min(100, this.Value)); }\n}\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** One selectable section in an {@link MJSectionPickerComponent}. */
|
|
4
|
+
export interface SectionPickerItem {
|
|
5
|
+
/** Stable identity, emitted on selection. */
|
|
6
|
+
Key: string;
|
|
7
|
+
/** Visible label on the button and in the sheet. */
|
|
8
|
+
Title: string;
|
|
9
|
+
/** Font Awesome class string, e.g. `fa-solid fa-table-columns`. */
|
|
10
|
+
Icon?: string;
|
|
11
|
+
/** Row count shown as a trailing pill when positive. */
|
|
12
|
+
Count?: number | null;
|
|
13
|
+
/** Validation errors in this section; shown as a red pill when positive. */
|
|
14
|
+
ErrorCount?: number;
|
|
15
|
+
/** Warnings in this section; shown as an amber pill when positive and there are no errors. */
|
|
16
|
+
WarningCount?: number;
|
|
17
|
+
/** Unsaved edits in this section; shown as a dot when positive. */
|
|
18
|
+
DirtyCount?: number;
|
|
19
|
+
}
|
|
20
|
+
/** A headed group of sections listed after the first-class items (a form's "More" folder, say). */
|
|
21
|
+
export interface SectionPickerGroup {
|
|
22
|
+
Title: string;
|
|
23
|
+
Items: SectionPickerItem[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The phone replacement for a section rail, tab strip or icon rail: one full-width button that
|
|
27
|
+
* names the current section and opens a searchable "Sections" bottom sheet listing every
|
|
28
|
+
* section, first-class items first, then each {@link SectionPickerGroup} under its heading.
|
|
29
|
+
*
|
|
30
|
+
* Pure chrome with no breakpoint logic: the caller decides when a picker is the right
|
|
31
|
+
* presentation (`@if (IsPhone) { <mj-section-picker …> } @else { <the rail> }`). Selection is
|
|
32
|
+
* emitted, never applied; the caller sets `ActiveKey` back.
|
|
33
|
+
*
|
|
34
|
+
* ```html
|
|
35
|
+
* <mj-section-picker [Items]="sections" [Groups]="[{ Title: 'More', Items: more }]"
|
|
36
|
+
* [ActiveKey]="active" (ActiveKeyChange)="activate($event)">
|
|
37
|
+
* </mj-section-picker>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class MJSectionPickerComponent {
|
|
41
|
+
private static nextInstance;
|
|
42
|
+
private readonly cdr;
|
|
43
|
+
private searchInput?;
|
|
44
|
+
/** Id of the search box's hidden description, which says what Enter does. */
|
|
45
|
+
readonly SearchHintId: string;
|
|
46
|
+
/** First-class sections, in display order. */
|
|
47
|
+
Items: SectionPickerItem[];
|
|
48
|
+
/** Headed groups listed after {@link Items}. */
|
|
49
|
+
Groups: SectionPickerGroup[];
|
|
50
|
+
/** Key of the current section. Falls back to the first item when it matches nothing. */
|
|
51
|
+
ActiveKey: string;
|
|
52
|
+
/** Sheet header. */
|
|
53
|
+
SheetTitle: string;
|
|
54
|
+
/** Whether the sheet shows a search box. */
|
|
55
|
+
Searchable: boolean;
|
|
56
|
+
SearchPlaceholder: string;
|
|
57
|
+
/** Emitted with the chosen section's key; the sheet closes and the search clears. */
|
|
58
|
+
ActiveKeyChange: EventEmitter<string>;
|
|
59
|
+
/** Whether the sheet is open. */
|
|
60
|
+
SheetOpen: boolean;
|
|
61
|
+
/** The current search text; a way to find a row, cleared on every selection. */
|
|
62
|
+
Query: string;
|
|
63
|
+
/** The section the button names. */
|
|
64
|
+
get ActiveItem(): SectionPickerItem | null;
|
|
65
|
+
get FilteredItems(): SectionPickerItem[];
|
|
66
|
+
/** Groups with their matching items; a group whose items all drop out is left out. */
|
|
67
|
+
get FilteredGroups(): SectionPickerGroup[];
|
|
68
|
+
get HasMatches(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The row Enter opens: the first match in display order, once a search is typed. Null with an
|
|
71
|
+
* empty search (the list is not narrowed, so the first row is not a choice) or no matches.
|
|
72
|
+
*/
|
|
73
|
+
get FirstMatch(): SectionPickerItem | null;
|
|
74
|
+
IsFirstMatch(item: SectionPickerItem): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Enter in the search box opens the first match. Its default is always blocked: the sheet renders
|
|
77
|
+
* in place, so inside a host `<form>` Enter would click the form's first submit button (implicit
|
|
78
|
+
* submission), even a hidden one such as Run or Regenerate.
|
|
79
|
+
*/
|
|
80
|
+
OnSearchKeydown(event: KeyboardEvent): void;
|
|
81
|
+
OpenSheet(): void;
|
|
82
|
+
OnSheetVisibleChange(visible: boolean): void;
|
|
83
|
+
OnSearch(value: string): void;
|
|
84
|
+
OnSearchInput(event: Event): void;
|
|
85
|
+
Select(key: string): void;
|
|
86
|
+
/**
|
|
87
|
+
* Empties the search, in the box as well as in Query. The box's [value] binding only writes when
|
|
88
|
+
* Query differs from what it last rendered, and Enter can land before the typed query was ever
|
|
89
|
+
* rendered (a fast typist, a paste, a hardware keyboard): Query goes '' to '' and the old text
|
|
90
|
+
* would stay in the box for the next open.
|
|
91
|
+
*/
|
|
92
|
+
private clearSearch;
|
|
93
|
+
IsActive(item: SectionPickerItem): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The button's accessible name. An aria-label replaces the button's content for screen readers,
|
|
96
|
+
* so the indicator spans inside it are never announced: the name has to carry their status itself,
|
|
97
|
+
* in the order they appear (unsaved, then error or warning).
|
|
98
|
+
*/
|
|
99
|
+
get TriggerLabel(): string;
|
|
100
|
+
ErrorLabel(item: SectionPickerItem): string;
|
|
101
|
+
WarningLabel(item: SectionPickerItem): string;
|
|
102
|
+
DirtyLabel(item: SectionPickerItem): string;
|
|
103
|
+
private allItems;
|
|
104
|
+
private matches;
|
|
105
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MJSectionPickerComponent, never>;
|
|
106
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MJSectionPickerComponent, "mj-section-picker", never, { "Items": { "alias": "Items"; "required": false; }; "Groups": { "alias": "Groups"; "required": false; }; "ActiveKey": { "alias": "ActiveKey"; "required": false; }; "SheetTitle": { "alias": "SheetTitle"; "required": false; }; "Searchable": { "alias": "Searchable"; "required": false; }; "SearchPlaceholder": { "alias": "SearchPlaceholder"; "required": false; }; }, { "ActiveKeyChange": "ActiveKeyChange"; }, never, never, true, never>;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=section-picker.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-picker.component.d.ts","sourceRoot":"","sources":["../../../src/lib/section-picker/section-picker.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAqE,YAAY,EAAoC,MAAM,eAAe,CAAC;;AAGlJ,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8FAA8F;IAC9F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,mGAAmG;AACnG,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAQa,wBAAwB;IACnC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IACvB,OAAO,CAAC,WAAW,CAAC,CAA+B;IAE7E,6EAA6E;IAC7E,SAAgB,YAAY,SAAuE;IAEnG,8CAA8C;IACrC,KAAK,EAAE,iBAAiB,EAAE,CAAM;IACzC,gDAAgD;IACvC,MAAM,EAAE,kBAAkB,EAAE,CAAM;IAC3C,wFAAwF;IAC/E,SAAS,SAAM;IACxB,oBAAoB;IACX,UAAU,SAAc;IACjC,4CAA4C;IACnC,UAAU,UAAQ;IAClB,iBAAiB,SAAwB;IAEl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