@mintplayer/ng-bootstrap 22.27.0 → 22.29.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.
Files changed (134) hide show
  1. package/_bootstrap.scss +4 -101
  2. package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +62 -30
  3. package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
  4. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +71 -64
  5. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
  6. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +50 -46
  7. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
  8. package/fesm2022/mintplayer-ng-bootstrap-card.mjs +65 -94
  9. package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
  10. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +122 -97
  11. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
  12. package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +80 -133
  13. package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
  14. package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +31 -19
  15. package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
  16. package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +41 -46
  17. package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
  18. package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +76 -37
  19. package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
  20. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +37 -82
  21. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
  22. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +1 -1
  23. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
  24. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +150 -813
  25. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
  26. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +172 -118
  27. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
  28. package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +180 -142
  29. package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
  30. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +66 -116
  31. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
  32. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +41 -46
  33. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
  34. package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +80 -204
  35. package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
  36. package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +2 -2
  37. package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
  38. package/fesm2022/mintplayer-ng-bootstrap-form.mjs +2 -2
  39. package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
  40. package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +32 -17
  41. package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
  42. package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +220 -20
  43. package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -1
  44. package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs +98 -129
  45. package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs.map +1 -1
  46. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +144 -265
  47. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
  48. package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +133 -217
  49. package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
  50. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +46 -25
  51. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
  52. package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +166 -93
  53. package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
  54. package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +148 -231
  55. package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
  56. package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +133 -94
  57. package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
  58. package/fesm2022/mintplayer-ng-bootstrap-range.mjs +2 -2
  59. package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
  60. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +76 -7
  61. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
  62. package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs +766 -812
  63. package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs.map +1 -1
  64. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +206 -180
  65. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
  66. package/fesm2022/mintplayer-ng-bootstrap-select.mjs +202 -141
  67. package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
  68. package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +113 -59
  69. package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
  70. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +133 -76
  71. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
  72. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +60 -87
  73. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
  74. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +86 -83
  75. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
  76. package/fesm2022/mintplayer-ng-bootstrap-table.mjs +1 -2
  77. package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
  78. package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +38 -34
  79. package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
  80. package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +177 -147
  81. package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
  82. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +200 -94
  83. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
  84. package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +186 -233
  85. package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
  86. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +58 -136
  87. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
  88. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +22 -16
  89. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
  90. package/package.json +11 -9
  91. package/types/mintplayer-ng-bootstrap-a11y.d.ts +40 -21
  92. package/types/mintplayer-ng-bootstrap-accordion.d.ts +36 -33
  93. package/types/mintplayer-ng-bootstrap-calendar.d.ts +39 -16
  94. package/types/mintplayer-ng-bootstrap-card.d.ts +25 -33
  95. package/types/mintplayer-ng-bootstrap-carousel.d.ts +70 -55
  96. package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +65 -45
  97. package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +12 -3
  98. package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +34 -19
  99. package/types/mintplayer-ng-bootstrap-checkbox.d.ts +34 -8
  100. package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +32 -59
  101. package/types/mintplayer-ng-bootstrap-datatable.d.ts +217 -416
  102. package/types/mintplayer-ng-bootstrap-datepicker.d.ts +77 -29
  103. package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +83 -51
  104. package/types/mintplayer-ng-bootstrap-dock.d.ts +57 -38
  105. package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +25 -30
  106. package/types/mintplayer-ng-bootstrap-file-manager.d.ts +61 -81
  107. package/types/mintplayer-ng-bootstrap-input-group.d.ts +17 -12
  108. package/types/mintplayer-ng-bootstrap-machine.d.ts +112 -4
  109. package/types/mintplayer-ng-bootstrap-multi-range.d.ts +53 -27
  110. package/types/mintplayer-ng-bootstrap-navbar.d.ts +88 -164
  111. package/types/mintplayer-ng-bootstrap-otp-input.d.ts +63 -30
  112. package/types/mintplayer-ng-bootstrap-pagination.d.ts +23 -7
  113. package/types/mintplayer-ng-bootstrap-phone-input.d.ts +77 -47
  114. package/types/mintplayer-ng-bootstrap-query-builder.d.ts +95 -98
  115. package/types/mintplayer-ng-bootstrap-radio.d.ts +68 -35
  116. package/types/mintplayer-ng-bootstrap-rating.d.ts +27 -2
  117. package/types/mintplayer-ng-bootstrap-ribbon.d.ts +546 -220
  118. package/types/mintplayer-ng-bootstrap-scheduler.d.ts +82 -197
  119. package/types/mintplayer-ng-bootstrap-select.d.ts +113 -53
  120. package/types/mintplayer-ng-bootstrap-shell.d.ts +59 -33
  121. package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +63 -27
  122. package/types/mintplayer-ng-bootstrap-splitter.d.ts +45 -56
  123. package/types/mintplayer-ng-bootstrap-tab-control.d.ts +47 -26
  124. package/types/mintplayer-ng-bootstrap-table.d.ts +1 -2
  125. package/types/mintplayer-ng-bootstrap-theming.d.ts +19 -18
  126. package/types/mintplayer-ng-bootstrap-timeline.d.ts +287 -117
  127. package/types/mintplayer-ng-bootstrap-timepicker.d.ts +100 -27
  128. package/types/mintplayer-ng-bootstrap-tree-select.d.ts +188 -94
  129. package/types/mintplayer-ng-bootstrap-treeview.d.ts +74 -59
  130. package/types/mintplayer-ng-bootstrap-typeahead.d.ts +3 -0
  131. package/src/styles/utilities/cursor.scss +0 -12
  132. package/src/styles/utilities/overflow.scss +0 -12
  133. package/src/styles/utilities/white-space.scss +0 -12
  134. package/src/styles/utilities/width.scss +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-phone-input.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/phone-input/src/component/phone-input.component.ts","../../../../libs/mintplayer-ng-bootstrap/phone-input/src/component/phone-input.component.html","../../../../libs/mintplayer-ng-bootstrap/phone-input/mintplayer-ng-bootstrap-phone-input.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n DestroyRef,\n ElementRef,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BsControlValidityDirective, BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport type {\n CountryChangeEventDetail,\n MpPhoneInput,\n PhoneChangeEventDetail,\n} from '@mintplayer/web-components/phone-input';\n\n// Side-effect import: registers <mp-phone-input> (and, transitively, the\n// <mp-input-group> and <mp-select> it composes).\nimport '@mintplayer/web-components/phone-input';\n\n/**\n * `<bs-phone-input>` — a phone-number form control: country picker with flags,\n * a dial code that cannot be edited away, and as-you-type formatting.\n *\n * The control value is **E.164** (`'+32470123456'`), or `null` while empty, so a\n * form posts one canonical string. `(phoneChange)` carries the decomposed parts\n * for consumers that need them — note `valid` is `undefined` until the selected\n * country's validation rules have loaded, which is deliberate rather than\n * optimistic.\n *\n * ```html\n * <bs-form>\n * <bs-phone-input [(ngModel)]=\"phone\" default-country=\"be\"\n * [errorMessages]=\"{ required: 'Enter a phone number.' }\" />\n * </bs-form>\n * ```\n */\n@Component({\n selector: 'bs-phone-input',\n templateUrl: './phone-input.component.html',\n imports: [BsForwardAriaDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputComponent), multi: true },\n ],\n hostDirectives: [{\n directive: BsControlValidityDirective,\n inputs: ['errorMessages'],\n }],\n})\nexport class BsPhoneInputComponent implements ControlValueAccessor {\n private readonly destroyRef = inject(DestroyRef);\n private onChange: (value: string | null) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n /** Set by `setDisabledState` before the view exists, applied by the effect. */\n private disabledByForm = false;\n\n private readonly phoneInput = viewChild.required<ElementRef<MpPhoneInput>>('phoneInput');\n\n /** ISO 3166-1 alpha-2, lowercase. Two-way via `(countryChange)`. */\n readonly country = input<string | null>(null);\n /** Country to start on when the value is empty. */\n readonly defaultCountry = input<string | null>(null);\n /** BCP-47 tag for country names and their ordering. Omitted = browser locale. */\n readonly locale = input<string | null>(null);\n readonly preferredCountries = input<readonly string[] | null>(null);\n readonly allowedCountries = input<readonly string[] | null>(null);\n readonly placeholder = input<string | null>(null);\n readonly autocomplete = input<string>('tel-national');\n /** Accessible name of the number field. */\n readonly inputLabel = input<string | null>(null);\n /** Accessible name of the country picker. */\n readonly countryLabel = input<string | null>(null);\n\n readonly countryChange = output<string>();\n /** The full detail: E.164 value plus country, dial code, digits and validity. */\n readonly phoneChange = output<PhoneChangeEventDetail>();\n\n protected readonly preferredAttr = computed(() => this.preferredCountries()?.join(',') ?? null);\n protected readonly allowedAttr = computed(() => this.allowedCountries()?.join(',') ?? null);\n\n constructor() {\n effect(() => {\n const el = this.phoneInput().nativeElement;\n el.disabled = this.disabledByForm;\n });\n }\n\n writeValue(value: string | null): void {\n const el = this.phoneInput().nativeElement;\n // The WC decomposes E.164 into country + national digits itself, so the\n // accessor never has to parse. Forms call writeValue from the update pass,\n // after this component's view (and so the required query) exists.\n el.value = value ?? null;\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledByForm = isDisabled;\n const el = this.phoneInput().nativeElement;\n el.disabled = isDisabled;\n }\n\n protected onValueChange(ev: Event): void {\n const detail = (ev as CustomEvent<PhoneChangeEventDetail>).detail;\n if (this.destroyRef.destroyed) return;\n this.onChange(detail.value);\n this.phoneChange.emit(detail);\n }\n\n protected onCountryChange(ev: Event): void {\n const detail = (ev as CustomEvent<CountryChangeEventDetail>).detail;\n if (this.destroyRef.destroyed) return;\n // A country change is a user interaction with the control, and the number is\n // usually still empty at that point — without this the field can never be\n // touched, so a `required` error would never surface.\n this.onTouched();\n this.countryChange.emit(detail.country);\n }\n}\n","<mp-phone-input\n bsForwardAria\n #phoneInput\n [attr.country]=\"country()\"\n [attr.default-country]=\"defaultCountry()\"\n [attr.locale]=\"locale()\"\n [attr.preferred-countries]=\"preferredAttr()\"\n [attr.allowed-countries]=\"allowedAttr()\"\n [attr.placeholder]=\"placeholder()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.input-label]=\"inputLabel()\"\n [attr.country-label]=\"countryLabel()\"\n (value-change)=\"onValueChange($event)\"\n (country-change)=\"onCountryChange($event)\">\n</mp-phone-input>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;;;;;AAgBG;MAeU,qBAAqB,CAAA;AA+BhC,IAAA,WAAA,GAAA;AA9BiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAmC,MAAM,SAAS;AAC1D,QAAA,IAAA,CAAA,SAAS,GAAe,MAAM,SAAS;;QAEvC,IAAA,CAAA,cAAc,GAAG,KAAK;AAEb,QAAA,IAAA,CAAA,UAAU,GAAG,SAAS,CAAC,QAAQ,CAA2B,YAAY;uFAAC;;QAG/E,IAAA,CAAA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A,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEhEzF;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-phone-input.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/phone-input/src/value-accessor/phone-input-value-accessor.ts","../../../../libs/mintplayer-ng-bootstrap/phone-input/src/phone-input.angular.ts","../../../../libs/mintplayer-ng-bootstrap/phone-input/src/generated/phone-input.component.generated.ts","../../../../libs/mintplayer-ng-bootstrap/phone-input/src/generated/phone-input.view.generated.html","../../../../libs/mintplayer-ng-bootstrap/phone-input/src/generated/index.ts","../../../../libs/mintplayer-ng-bootstrap/phone-input/mintplayer-ng-bootstrap-phone-input.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, Injector, OnInit, forwardRef, inject, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BsPhoneInputComponent } from '../generated';\n\n/**\n * The `ControlValueAccessor` of `bs-phone-input` (a host directive of the\n * generated component, see `phone-input.angular.ts`). A bound form control\n * drives the E.164 value through `viewValue`; every change the user makes\n * (typing, paste, a country pick, rules that load and re-derive the E.164)\n * reaches the form through the component's `value` model, which a form write\n * never touches.\n */\n@Directive({\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsPhoneInputValueAccessor), multi: true }],\n host: {\n '(focusout)': 'onTouched()',\n },\n})\nexport class BsPhoneInputValueAccessor implements ControlValueAccessor, OnInit {\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n /** A form control drives the value: its `viewValue` wins over the `value` input. */\n readonly bound = signal(false);\n readonly viewValue = signal<string | null>(null);\n readonly disabled = signal(false);\n\n private onChange: (value: string | null) => void = () => undefined;\n onTouched: () => void = () => undefined;\n\n ngOnInit(): void {\n // The component is created after its host directives, so it is looked up here.\n const sub = this.injector.get(BsPhoneInputComponent).value.subscribe((value) => {\n if (!this.bound() || value === this.viewValue()) return;\n this.viewValue.set(value);\n this.onChange(value);\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.bound.set(true);\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n writeValue(value: string | null | undefined): void {\n this.viewValue.set(value || null);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n}\n\n/**\n * `focus()` on the `bs-phone-input` host moves into the number field, not the\n * country picker (D13), so a directive that focuses the element it sits on\n * reaches the field.\n */\n@Directive({})\nexport class BsPhoneInputFocusDirective {\n constructor() {\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n const tel = () => host.querySelector<HTMLInputElement>('input[type=tel]');\n Object.defineProperty(host, 'focus', {\n // Before the first render there is no input yet; try again once it exists.\n value: (options?: FocusOptions) => {\n const input = tel();\n if (input) input.focus(options);\n else queueMicrotask(() => tel()?.focus(options));\n },\n configurable: true,\n writable: true,\n });\n }\n}\n","import { computed, inject } from '@angular/core';\nimport { BsControlValidityDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport type { PhoneInputInputs } from '@mintplayer/ui-core/phone-input';\nimport { BsPhoneInputFocusDirective, BsPhoneInputValueAccessor } from './value-accessor/phone-input-value-accessor';\n\n/*\n * The Angular extension of the generated `bs-phone-input` (PRD #437 D10 escape\n * hatch): Angular forms, and host focus. A bound form control drives the value\n * and the disabled state, and its validity reaches the number field's ARIA and\n * message.\n */\n\nexport const hostDirectives = [\n BsPhoneInputValueAccessor,\n BsPhoneInputFocusDirective,\n { directive: BsControlValidityDirective, inputs: ['errorMessages'] },\n];\n\nexport function extendInputs(inputs: () => PhoneInputInputs): () => PhoneInputInputs {\n const accessor = inject(BsPhoneInputValueAccessor, { self: true });\n const validity = inject(BsControlValidityDirective, { self: true });\n return computed<PhoneInputInputs>(() => {\n const value = inputs();\n return {\n ...value,\n value: accessor.bound() ? accessor.viewValue() : value.value,\n disabled: value.disabled || accessor.disabled(),\n invalid: value.invalid || validity.invalid(),\n required: value.required || validity.required(),\n errorText: value.errorText ?? validity.errorText(),\n };\n });\n}\n","// GENERATED from the phone-input manifest (phone-input) by @mintplayer/nx-component-compiler. Do not edit.\nimport { ChangeDetectionStrategy, Component, ElementRef, booleanAttribute, inject, input, model, output } from '@angular/core';\nimport { MpPropsDirective, MpTrustedHtmlPipe, useCore, useScopedStyles } from '@mintplayer/ng-bootstrap/machine';\nimport { type PhoneChangeEventDetail, phoneInputCore, type PhoneInputInputs, type PhoneInputMethods, phoneInputScopedStyles } from '@mintplayer/ui-core/phone-input';\nimport { hostDirectives as ext_hostDirectives, extendInputs as ext_extendInputs } from '../phone-input.angular';\n\n/**\n * A phone-number field (#437): country picker with flags, dial code, and a number input that formats as\n * the user types. `value` is two-way E.164 (`+32470123456`); `country` is two-way too.\n *\n * With JavaScript off it is a plain country select and tel input; the typed text submits under `name`.\n * An `aria-label` on the component names the number input; `countryLabel` names the picker.\n */\n@Component({\n selector: 'bs-phone-input',\n templateUrl: './phone-input.view.generated.html',\n imports: [MpPropsDirective, MpTrustedHtmlPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: ext_hostDirectives,\n})\nexport class BsPhoneInputComponent {\n /** The host element. */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly value = model<PhoneInputInputs['value']>(null);\n readonly country = model<PhoneInputInputs['country']>(null);\n readonly defaultCountry = input<PhoneInputInputs['defaultCountry']>();\n readonly locale = input<PhoneInputInputs['locale']>();\n readonly preferredCountries = input<PhoneInputInputs['preferredCountries']>(null);\n readonly allowedCountries = input<PhoneInputInputs['allowedCountries']>(null);\n readonly disabled = input<PhoneInputInputs['disabled'], unknown>(false, { transform: booleanAttribute });\n readonly required = input<PhoneInputInputs['required'], unknown>(false, { transform: booleanAttribute });\n readonly invalid = input<PhoneInputInputs['invalid'], unknown>(false, { transform: booleanAttribute });\n readonly errorText = input<PhoneInputInputs['errorText']>();\n readonly placeholder = input<PhoneInputInputs['placeholder']>();\n readonly autocomplete = input<PhoneInputInputs['autocomplete']>('tel-national');\n readonly name = input<PhoneInputInputs['name']>();\n readonly inputLabel = input<PhoneInputInputs['inputLabel']>();\n readonly countryLabel = input<PhoneInputInputs['countryLabel']>();\n /** The E.164 value changed (null while empty). */\n readonly valuechange = output<string | null>();\n /** The user picked a country, or typed a `+XX` that switched it. */\n readonly countrychange = output<string>();\n /** Every edit, pick and rules load: the value with its parts and validity. */\n readonly phonechange = output<PhoneChangeEventDetail>();\n\n readonly #core = useCore(phoneInputCore, { inputs: ext_extendInputs(() => ({ value: this.value(), country: this.country(), defaultCountry: this.defaultCountry(), locale: this.locale(), preferredCountries: this.preferredCountries(), allowedCountries: this.allowedCountries(), disabled: this.disabled(), required: this.required(), invalid: this.invalid(), errorText: this.errorText(), placeholder: this.placeholder(), autocomplete: this.autocomplete(), name: this.name(), inputLabel: this.inputLabel(), countryLabel: this.countryLabel() })), idPrefix: 'bs-phone-input', outputs: { valueChange: this.valuechange, countryChange: this.countrychange, phoneChange: this.phonechange }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'phone-input' }), models: { value: this.value, country: this.country } });\n /** The template's props. */\n protected readonly props = this.#core.props;\n\n constructor() {\n useScopedStyles('phone-input', phoneInputScopedStyles);\n }\n\n /** Moves focus into the number field, not the country picker. */\n focusInput(...args: Parameters<PhoneInputMethods['focusInput']>): ReturnType<PhoneInputMethods['focusInput']> {\n return this.#core.call('focusInput', args) as ReturnType<PhoneInputMethods['focusInput']>;\n }\n\n /** Settles once the flags and the rules in flight have been applied. */\n whenReady(...args: Parameters<PhoneInputMethods['whenReady']>): ReturnType<PhoneInputMethods['whenReady']> {\n return this.#core.call('whenReady', args) as ReturnType<PhoneInputMethods['whenReady']>;\n }\n}\n","<!-- GENERATED from libs/mintplayer-ui-core/phone-input/src/templates/phone-input.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"phone-input\" [mpProps]=\"p_view.group\">\n <select data-mps=\"phone-input\" [mpProps]=\"p_view.select\">\n @if (p_view.rich) {\n <button data-mps=\"phone-input\" type=\"button\">\n <selectedcontent></selectedcontent>\n </button>\n }\n @for (o of p_view.options; track o.key) {\n <option data-mps=\"phone-input\" [mpProps]=\"o.bag\">\n @if (p_view.rich) {\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.flagBox\" [innerHTML]=\"o.flag | mpTrustedHtml\"></span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.richLabel\">\n {{ o.name }}\n </span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.listOnly\">\n {{ o.dial }}\n </span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.closedOnly\">\n {{ o.iso }}\n </span>\n } @else {\n {{ o.label }}\n }\n </option>\n }\n </select>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.addon\">\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.flag\" [innerHTML]=\"p_view.flagHtml | mpTrustedHtml\"></span>\n <span data-mps=\"phone-input\" [mpProps]=\"p_view.dial\">\n {{ p_view.dialText }}\n </span>\n </span>\n <input data-mps=\"phone-input\" [mpProps]=\"p_view.input\">\n</div>\n@if (p_view.hidden) {\n <input data-mps=\"phone-input\" [mpProps]=\"p_view.hidden\">\n}\n@if (p_view.showFeedback) {\n <div data-mps=\"phone-input\" [mpProps]=\"p_view.feedback.attrs\">\n {{ p_view.feedback.text }}\n </div>\n}\n","// GENERATED from the phone-input manifest by @mintplayer/nx-component-compiler. Do not edit.\nexport { BsPhoneInputComponent } from './phone-input.component.generated';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ext_extendInputs","i1.BsPhoneInputValueAccessor","i1.BsPhoneInputFocusDirective","ext_hostDirectives"],"mappings":";;;;;;;;AAIA;;;;;;;AAOG;MAOU,yBAAyB,CAAA;AANtC,IAAA,WAAA,GAAA;AAOmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;QAGvC,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,KAAK;kFAAC;QACrB,IAAA,CAAA,SAAS,GAAG,MAAM,CAAgB,IAAI;sFAAC;QACvC,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,KAAK;qFAAC;AAEzB,QAAA,IAAA,CAAA,QAAQ,GAAmC,MAAM,SAAS;AAClE,QAAA,IAAA,CAAA,SAAS,GAAe,MAAM,SAAS;AA4BxC,IAAA;IA1BC,QAAQ,GAAA;;AAEN,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,KAAI;YAC7E,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,I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,EAAA,EAAA,EAAA,SAAA,EAAAC,0BAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,CAAA,0BAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,eAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECpBlC,6tDA4CA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,ED5BY,gBAAgB,sEAAE,iBAAiB,EAAA,IAAA,EAAA,eAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIlC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EAEjB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,EAAA,eAAA,EAC7B,uBAAuB,CAAC,MAAM,EAAA,cAAA,EAC/BC,cAAkB,EAAA,QAAA,EAAA,6tDAAA,EAAA;;;AElBpC;;ACAA;;AAEG;;;;"}
@@ -1,267 +1,184 @@
1
- import { MpQueryBuilderElement, emptyGroup, validateOperatorOverrides } from '@mintplayer/web-components/query-builder';
2
- export * from '@mintplayer/web-components/query-builder';
3
1
  import * as i0 from '@angular/core';
4
- import { input, Directive, model, output, viewChild, inject, ViewContainerRef, signal, effect, forwardRef, ContentChildren, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
2
+ import { inject, Injector, DestroyRef, signal, forwardRef, Directive, computed, TemplateRef, ElementRef, model, input, booleanAttribute, numberAttribute, output, contentChild, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { NgTemplateOutlet } from '@angular/common';
4
+ import { useCore, useScopedStyles, MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';
5
+ import { queryBuilderCore, queryBuilderScopedStyles } from '@mintplayer/ui-core/query-builder';
6
+ export { DEFAULT_MESSAGES, DEFAULT_OPERATOR_CATALOG, MaxDepthExceededError, addChild, addEmptyConditionTo, addEmptyGroupTo, addEmptySubqueryTo, changeConditionField, changeConditionOperator, cloneTree, collectDescendantIds, defaultValueFor, emptyCondition, emptyGroup, emptySubquery, findNodeById, mapTree, moveNode, newId, operatorsForType, removeNode, renderExpression, setGroupLogic, updateCondition, validateOperatorOverrides, valueShapeFor, visitTree } from '@mintplayer/ui-core/query-builder';
5
7
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
- import { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';
7
8
 
8
9
  /**
9
- * `*bsQueryBuilderEditor="<fieldName>"` projects an Angular template as the
10
- * value editor for the named field of the parent `bs-query-builder`.
11
- *
12
- * The template's context exposes the `EditorContext` (`let ctx`):
13
- *
14
- * <bs-datepicker *bsQueryBuilderEditor="'orderDate'; let ctx"
15
- * [value]="ctx.value"
16
- * (valueChange)="ctx.onChange($event)">
17
- * </bs-datepicker>
18
- *
19
- * The wrapper collects these via @ContentChildren and assembles them into
20
- * an `EditorRegistry` it forwards to the WC. Each factory invocation creates
21
- * a fresh embedded view, exposes `view.rootNodes[0]` as the EditorHandle.element,
22
- * and returns `dispose: () => view.destroy()` so M4's disposal contract holds.
10
+ * The `ControlValueAccessor` of `bs-query-builder` (a host directive of the
11
+ * generated component, see `query-builder.angular.ts`). A bound form control
12
+ * drives the tree through `viewValue`; every edit the user makes reaches the
13
+ * form through the component's `query` model, which a form write never touches.
23
14
  */
24
- class BsQueryBuilderEditorDirective {
25
- constructor(templateRef) {
26
- this.templateRef = templateRef;
27
- this.fieldName = input.required({ ...(ngDevMode ? { debugName: "fieldName" } : /* istanbul ignore next */ {}), alias: 'bsQueryBuilderEditor' });
15
+ class BsQueryBuilderValueAccessor {
16
+ constructor() {
17
+ this.injector = inject(Injector);
18
+ this.destroyRef = inject(DestroyRef);
19
+ /** A form control drives the tree: its `viewValue` wins over the `query` input. */
20
+ this.bound = signal(false, /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "bound" }] : /* istanbul ignore next */ []));
22
+ this.viewValue = signal(null, /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "viewValue" }] : /* istanbul ignore next */ []));
24
+ this.disabled = signal(false, /* @ts-ignore */
25
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
26
+ this.onChange = () => undefined;
27
+ this.onTouched = () => undefined;
28
+ }
29
+ ngOnInit() {
30
+ // The component is created after its host directives, so it is looked up here.
31
+ const sub = this.injector.get(BsQueryBuilderComponent).query.subscribe((value) => {
32
+ if (!this.bound() || value === this.viewValue())
33
+ return;
34
+ this.viewValue.set(value);
35
+ this.onChange(value);
36
+ });
37
+ this.destroyRef.onDestroy(() => sub.unsubscribe());
38
+ }
39
+ writeValue(value) {
40
+ this.viewValue.set(value ?? null);
41
+ }
42
+ registerOnChange(fn) {
43
+ this.bound.set(true);
44
+ this.onChange = fn;
45
+ }
46
+ registerOnTouched(fn) {
47
+ this.onTouched = fn;
28
48
  }
29
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderEditorDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
30
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsQueryBuilderEditorDirective, isStandalone: true, selector: "[bsQueryBuilderEditor]", inputs: { fieldName: { classPropertyName: "fieldName", publicName: "bsQueryBuilderEditor", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
49
+ setDisabledState(isDisabled) {
50
+ this.disabled.set(isDisabled);
51
+ }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
53
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsQueryBuilderValueAccessor, isStandalone: true, host: { listeners: { "focusout": "onTouched()" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsQueryBuilderValueAccessor), multi: true }], ngImport: i0 }); }
31
54
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderEditorDirective, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderValueAccessor, decorators: [{
33
56
  type: Directive,
34
57
  args: [{
35
- selector: '[bsQueryBuilderEditor]',
36
- standalone: true,
58
+ providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsQueryBuilderValueAccessor), multi: true }],
59
+ host: {
60
+ '(focusout)': 'onTouched()',
61
+ },
37
62
  }]
38
- }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { fieldName: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsQueryBuilderEditor", required: true }] }] } });
63
+ }] });
64
+
65
+ /*
66
+ * The Angular extension of the generated `bs-query-builder` (PRD #437 D10
67
+ * escape hatch): Angular forms. A bound form control drives the tree and the
68
+ * disabled state.
69
+ */
70
+ const hostDirectives = [BsQueryBuilderValueAccessor];
71
+ function extendInputs(inputs) {
72
+ const accessor = inject(BsQueryBuilderValueAccessor, { self: true });
73
+ return computed(() => {
74
+ const value = inputs();
75
+ return {
76
+ ...value,
77
+ query: accessor.bound() ? accessor.viewValue() : value.query,
78
+ disabled: value.disabled || accessor.disabled(),
79
+ };
80
+ });
81
+ }
39
82
 
40
- void MpQueryBuilderElement;
83
+ // GENERATED from the query-builder manifest (query-builder) by @mintplayer/nx-component-compiler. Do not edit.
84
+ /** The `editor` slot of `<bs-query-builder>`: `<ng-template bsQueryBuilderEditor>` or `*bsQueryBuilderEditor`. */
85
+ class BsQueryBuilderEditorDirective {
86
+ constructor() {
87
+ this.templateRef = inject(TemplateRef);
88
+ }
89
+ static ngTemplateContextGuard(_dir, ctx) {
90
+ return true;
91
+ }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderEditorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
93
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsQueryBuilderEditorDirective, isStandalone: true, selector: "[bsQueryBuilderEditor]", ngImport: i0 }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderEditorDirective, decorators: [{
96
+ type: Directive,
97
+ args: [{ selector: '[bsQueryBuilderEditor]' }]
98
+ }] });
99
+ /** Types the `QueryBuilderItem` partial's context in this template. */
100
+ class QueryBuilderItemPartial {
101
+ static ngTemplateContextGuard(_dir, ctx) {
102
+ return true;
103
+ }
104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: QueryBuilderItemPartial, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
105
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: QueryBuilderItemPartial, isStandalone: true, selector: "ng-template[mpPartialQueryBuilderItem]", ngImport: i0 }); }
106
+ }
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: QueryBuilderItemPartial, decorators: [{
108
+ type: Directive,
109
+ args: [{ selector: 'ng-template[mpPartialQueryBuilderItem]' }]
110
+ }] });
111
+ /**
112
+ * A visual editor for a filter expression: AND/OR groups, conditions and sub-queries over a relation (#437).
113
+ *
114
+ * `query` is two-way. The tree renders as flat rows, so the server render shows the whole query.
115
+ * A field with `editor: 'custom'` renders its value through the `editor` slot, which receives an
116
+ * `EditorContext` (call `ctx.onChange(next)`). Rows reorder by dragging the handle, or with
117
+ * Alt+Up/Down on a row. An `aria-label` names it.
118
+ */
41
119
  class BsQueryBuilderComponent {
120
+ #core;
42
121
  constructor() {
43
- // [(query)] two-way binding for ngModel/formControl-equivalent use.
44
- this.query = model(emptyGroup('and'), /* @ts-ignore */
122
+ /** The host element. */
123
+ this.elementRef = inject(ElementRef);
124
+ this.query = model(null, /* @ts-ignore */
45
125
  ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
46
126
  this.schema = input([], /* @ts-ignore */
47
127
  ...(ngDevMode ? [{ debugName: "schema" }] : /* istanbul ignore next */ []));
48
- /**
49
- * Two-way bindable since M18: when `[multiEntityPickerEnabled]` is on and
50
- * the user picks a different entity in the toolbar, the model emits the
51
- * new value. Existing `[rootEntity]="'orders'"` static bindings keep
52
- * working (read-only model usage).
53
- */
54
128
  this.rootEntity = model('', /* @ts-ignore */
55
129
  ...(ngDevMode ? [{ debugName: "rootEntity" }] : /* istanbul ignore next */ []));
56
- /**
57
- * Opt-in: render an entity-picker dropdown in the top toolbar (and any
58
- * other Phase-2 toolbar widgets — field projection, sort builder — once
59
- * those land). Default `false` preserves today's compact rendering with
60
- * no toolbar.
61
- */
62
- this.multiEntityPickerEnabled = input(false, /* @ts-ignore */
63
- ...(ngDevMode ? [{ debugName: "multiEntityPickerEnabled" }] : /* istanbul ignore next */ []));
64
- /**
65
- * Two-way bindable list of currently-selected field names for projection.
66
- * Presentation-only — does NOT affect the query tree. Consumers typically
67
- * map this to which datatable columns to render. Empty array = nothing
68
- * selected; the consumer decides how to interpret that (commonly "show
69
- * all"). When `rootEntity` changes, stale field names just disappear
70
- * from the checkbox list (no auto-reset).
71
- */
130
+ this.multiEntityPickerEnabled = input(false, { ...(ngDevMode ? { debugName: "multiEntityPickerEnabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
72
131
  this.selectedFields = model([], /* @ts-ignore */
73
132
  ...(ngDevMode ? [{ debugName: "selectedFields" }] : /* istanbul ignore next */ []));
74
- /**
75
- * Two-way bindable list of sort descriptors. Same shape as the
76
- * `QueryRequest.sort[]` wire-format field — `{ field, direction }`.
77
- * Multi-priority allowed: array order is the priority order.
78
- */
79
133
  this.sortBy = model([], /* @ts-ignore */
80
134
  ...(ngDevMode ? [{ debugName: "sortBy" }] : /* istanbul ignore next */ []));
81
- this.messages = input(undefined, /* @ts-ignore */
82
- ...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
83
- this.showPreview = input(false, /* @ts-ignore */
84
- ...(ngDevMode ? [{ debugName: "showPreview" }] : /* istanbul ignore next */ []));
85
- this.showSavedQueries = input(false, /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "showSavedQueries" }] : /* istanbul ignore next */ []));
87
- this.maxDepth = input(32, /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "maxDepth" }] : /* istanbul ignore next */ []));
135
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
136
+ this.messages = input(/* @ts-ignore */
137
+ ...(ngDevMode ? [undefined, { debugName: "messages" }] : /* istanbul ignore next */ []));
138
+ this.maxDepth = input(32, { ...(ngDevMode ? { debugName: "maxDepth" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
139
+ this.showPreview = input(false, { ...(ngDevMode ? { debugName: "showPreview" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
140
+ this.showSavedQueries = input(false, { ...(ngDevMode ? { debugName: "showSavedQueries" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
89
141
  this.savedQueries = input([], /* @ts-ignore */
90
142
  ...(ngDevMode ? [{ debugName: "savedQueries" }] : /* istanbul ignore next */ []));
91
- this.operatorOverrides = input(undefined, /* @ts-ignore */
92
- ...(ngDevMode ? [{ debugName: "operatorOverrides" }] : /* istanbul ignore next */ []));
93
- this.disabled = input(false, /* @ts-ignore */
94
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
95
- this.editorRegistry = input(undefined, /* @ts-ignore */
96
- ...(ngDevMode ? [{ debugName: "editorRegistry" }] : /* istanbul ignore next */ []));
97
- this.saveQuery = output();
98
- this.loadQuery = output();
99
- this.deleteQuery = output();
100
- this.wcRef = viewChild.required('wc', /* @ts-ignore */
101
- ...(ngDevMode ? [{ debugName: "wcRef" }] : /* istanbul ignore next */ []));
102
- this.vcr = inject(ViewContainerRef);
103
- this.formDisabled = signal(false, /* @ts-ignore */
104
- ...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
105
- /** Combined effective disabled state used by the template. */
106
- this.effectiveDisabled = signal(false, /* @ts-ignore */
107
- ...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
108
- /** Re-entrancy guard for writeValue ↔ model() round-tripping (FR-18). */
109
- this.writingFromForm = false;
110
- this.onChangeFn = () => undefined;
111
- this.onTouchedFn = () => undefined;
112
- /** Editor registry built from @ContentChildren + the [editorRegistry] input. */
113
- this.directiveRegistry = signal({}, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "directiveRegistry" }] : /* istanbul ignore next */ []));
115
- // Compute effective disabled (input OR formDisabled from setDisabledState).
116
- effect(() => {
117
- this.effectiveDisabled.set(this.disabled() || this.formDisabled());
118
- });
119
- // Push every reactive input down to the WC. Lit reflects via property assignment.
120
- effect(() => {
121
- const wc = this.wcRef().nativeElement;
122
- wc.query = this.query();
123
- wc.schema = this.schema();
124
- wc.rootEntity = this.rootEntity();
125
- wc.multiEntityPickerEnabled = this.multiEntityPickerEnabled();
126
- wc.selectedFields = this.selectedFields();
127
- wc.sortBy = this.sortBy();
128
- wc.messages = this.messages();
129
- wc.showPreview = this.showPreview();
130
- wc.showSavedQueries = this.showSavedQueries();
131
- wc.maxDepth = this.maxDepth();
132
- wc.savedQueries = this.savedQueries();
133
- wc.disabled = this.effectiveDisabled();
134
- // Merge directive-projected editors with the programmatic registry input.
135
- // Programmatic entries take precedence (consumer's explicit override).
136
- const directive = this.directiveRegistry();
137
- const programmatic = this.editorRegistry() ?? {};
138
- wc.editorRegistry = { ...directive, ...programmatic };
139
- // Trigger a render after batched property assignments.
140
- wc.requestUpdate?.();
141
- });
142
- // Validate [operatorOverrides] on every change. We log warnings; the
143
- // sanitized result isn't currently consumed by the WC (the WC's operator
144
- // <select> already filters by OperatorCatalog[field.type] — see M6).
145
- // This validation surfaces consumer mistakes early via console.warn.
146
- effect(() => {
147
- const overrides = this.operatorOverrides();
148
- if (!overrides)
149
- return;
150
- const result = validateOperatorOverrides(this.schema(), overrides);
151
- for (const w of result.warnings) {
152
- console.warn(w);
153
- }
154
- });
155
- // Propagate model() changes to the form onChange, guarded by writingFromForm.
156
- effect(() => {
157
- const tree = this.query();
158
- if (this.writingFromForm)
159
- return;
160
- this.onChangeFn(tree);
161
- });
162
- }
163
- ngAfterContentInit() {
164
- this.rebuildDirectiveRegistry();
165
- this.editorDirectives.changes.subscribe(() => this.rebuildDirectiveRegistry());
166
- }
167
- rebuildDirectiveRegistry() {
168
- const next = {};
169
- for (const dir of this.editorDirectives.toArray()) {
170
- const fieldName = dir.fieldName();
171
- const factory = (ctx) => {
172
- const view = this.vcr.createEmbeddedView(dir.templateRef, { $implicit: ctx, ctx });
173
- view.detectChanges();
174
- const root = view.rootNodes.find((n) => n instanceof HTMLElement)
175
- ?? document.createElement('span');
176
- return {
177
- element: root,
178
- dispose: () => view.destroy(),
179
- };
180
- };
181
- next[fieldName] = factory;
182
- }
183
- this.directiveRegistry.set(next);
184
- }
185
- onQueryChange(event) {
186
- const detail = event.detail;
187
- if (!detail)
188
- return;
189
- // Coming FROM the WC; do NOT re-enter onChangeFn → writeValue loop.
190
- this.writingFromForm = true;
191
- this.query.set(detail.tree);
192
- queueMicrotask(() => { this.writingFromForm = false; });
193
- this.onChangeFn(detail.tree);
194
- this.onTouchedFn();
195
- }
196
- onRootEntityChange(event) {
197
- const detail = event.detail;
198
- if (!detail)
199
- return;
200
- this.rootEntity.set(detail.rootEntity);
201
- }
202
- onSelectedFieldsChange(event) {
203
- const detail = event.detail;
204
- if (!detail)
205
- return;
206
- this.selectedFields.set(detail.selectedFields);
207
- }
208
- onSortByChange(event) {
209
- const detail = event.detail;
210
- if (!detail)
211
- return;
212
- this.sortBy.set(detail.sortBy);
213
- }
214
- onSaveQuery(event) {
215
- this.saveQuery.emit(event.detail);
216
- }
217
- onLoadQuery(event) {
218
- this.loadQuery.emit(event.detail);
219
- }
220
- onDeleteQuery(event) {
221
- this.deleteQuery.emit(event.detail);
222
- }
223
- /* ---- ControlValueAccessor ---- */
224
- writeValue(value) {
225
- if (value == null) {
226
- this.writingFromForm = true;
227
- this.query.set(emptyGroup('and'));
228
- queueMicrotask(() => { this.writingFromForm = false; });
229
- return;
230
- }
231
- this.writingFromForm = true;
232
- this.query.set(value);
233
- queueMicrotask(() => { this.writingFromForm = false; });
234
- }
235
- registerOnChange(fn) {
236
- this.onChangeFn = fn;
237
- }
238
- registerOnTouched(fn) {
239
- this.onTouchedFn = fn;
240
- }
241
- setDisabledState(isDisabled) {
242
- this.formDisabled.set(isDisabled);
143
+ /** The user edited the query. */
144
+ this.querychange = output();
145
+ /** The user picked another entity in the toolbar. */
146
+ this.rootentitychange = output();
147
+ /** The projected columns changed. */
148
+ this.selectedfieldschange = output();
149
+ /** The sort changed. */
150
+ this.sortbychange = output();
151
+ /** Save the current query under a name. */
152
+ this.savequery = output();
153
+ /** Load the named saved query. */
154
+ this.loadquery = output();
155
+ /** Delete the named saved query. */
156
+ this.deletequery = output();
157
+ this.editorSlot = contentChild(BsQueryBuilderEditorDirective, /* @ts-ignore */
158
+ ...(ngDevMode ? [{ debugName: "editorSlot" }] : /* istanbul ignore next */ []));
159
+ /** The template's named slots. */
160
+ this.slots = computed(() => ({ editor: this.editorSlot()?.templateRef }), /* @ts-ignore */
161
+ ...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
162
+ this.#core = useCore(queryBuilderCore, { inputs: extendInputs(() => ({ query: this.query(), schema: this.schema(), rootEntity: this.rootEntity(), multiEntityPickerEnabled: this.multiEntityPickerEnabled(), selectedFields: this.selectedFields(), sortBy: this.sortBy(), disabled: this.disabled(), messages: this.messages(), maxDepth: this.maxDepth(), showPreview: this.showPreview(), showSavedQueries: this.showSavedQueries(), savedQueries: this.savedQueries() })), idPrefix: 'bs-query-builder', outputs: { queryChange: this.querychange, rootEntityChange: this.rootentitychange, selectedFieldsChange: this.selectedfieldschange, sortByChange: this.sortbychange, saveQuery: this.savequery, loadQuery: this.loadquery, deleteQuery: this.deletequery }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'query-builder' }), models: { query: this.query, rootEntity: this.rootEntity, selectedFields: this.selectedFields, sortBy: this.sortBy } });
163
+ /** The template's props. */
164
+ this.props = this.#core.props;
165
+ useScopedStyles('query-builder', queryBuilderScopedStyles);
243
166
  }
244
167
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
245
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: BsQueryBuilderComponent, isStandalone: true, selector: "bs-query-builder", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, rootEntity: { classPropertyName: "rootEntity", publicName: "rootEntity", isSignal: true, isRequired: false, transformFunction: null }, multiEntityPickerEnabled: { classPropertyName: "multiEntityPickerEnabled", publicName: "multiEntityPickerEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectedFields: { classPropertyName: "selectedFields", publicName: "selectedFields", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: true, isRequired: false, transformFunction: null }, showSavedQueries: { classPropertyName: "showSavedQueries", publicName: "showSavedQueries", isSignal: true, isRequired: false, transformFunction: null }, maxDepth: { classPropertyName: "maxDepth", publicName: "maxDepth", isSignal: true, isRequired: false, transformFunction: null }, savedQueries: { classPropertyName: "savedQueries", publicName: "savedQueries", isSignal: true, isRequired: false, transformFunction: null }, operatorOverrides: { classPropertyName: "operatorOverrides", publicName: "operatorOverrides", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, editorRegistry: { classPropertyName: "editorRegistry", publicName: "editorRegistry", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { query: "queryChange", rootEntity: "rootEntityChange", selectedFields: "selectedFieldsChange", sortBy: "sortByChange", saveQuery: "saveQuery", loadQuery: "loadQuery", deleteQuery: "deleteQuery" }, providers: [
246
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsQueryBuilderComponent), multi: true },
247
- ], queries: [{ propertyName: "editorDirectives", predicate: BsQueryBuilderEditorDirective }], viewQueries: [{ propertyName: "wcRef", first: true, predicate: ["wc"], descendants: true, isSignal: true }], ngImport: i0, template: "<mp-query-builder bsForwardAria\n #wc\n [attr.disabled]=\"effectiveDisabled() ? '' : null\"\n (query-change)=\"onQueryChange($event)\"\n (root-entity-change)=\"onRootEntityChange($event)\"\n (selected-fields-change)=\"onSelectedFieldsChange($event)\"\n (sort-by-change)=\"onSortByChange($event)\"\n (save-query)=\"onSaveQuery($event)\"\n (load-query)=\"onLoadQuery($event)\"\n (delete-query)=\"onDeleteQuery($event)\"\n></mp-query-builder>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
168
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsQueryBuilderComponent, isStandalone: true, selector: "bs-query-builder", inputs: { query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: false, transformFunction: null }, rootEntity: { classPropertyName: "rootEntity", publicName: "rootEntity", isSignal: true, isRequired: false, transformFunction: null }, multiEntityPickerEnabled: { classPropertyName: "multiEntityPickerEnabled", publicName: "multiEntityPickerEnabled", isSignal: true, isRequired: false, transformFunction: null }, selectedFields: { classPropertyName: "selectedFields", publicName: "selectedFields", isSignal: true, isRequired: false, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, maxDepth: { classPropertyName: "maxDepth", publicName: "maxDepth", isSignal: true, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: true, isRequired: false, transformFunction: null }, showSavedQueries: { classPropertyName: "showSavedQueries", publicName: "showSavedQueries", isSignal: true, isRequired: false, transformFunction: null }, savedQueries: { classPropertyName: "savedQueries", publicName: "savedQueries", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { query: "queryChange", rootEntity: "rootEntityChange", selectedFields: "selectedFieldsChange", sortBy: "sortByChange", querychange: "querychange", rootentitychange: "rootentitychange", selectedfieldschange: "selectedfieldschange", sortbychange: "sortbychange", savequery: "savequery", loadquery: "loadquery", deletequery: "deletequery" }, queries: [{ propertyName: "editorSlot", first: true, predicate: BsQueryBuilderEditorDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: BsQueryBuilderValueAccessor }], ngImport: i0, template: "<!-- GENERATED from libs/mintplayer-ui-core/query-builder/src/templates/query-builder.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n@if (p_view.toolbar) {\n <div data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarBox\">\n <label data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarLabel\">\n {{ p_view.text.entity }}\n : \n <select data-mps=\"query-builder\" [mpProps]=\"p_view.entity\">\n @for (o of p_view.entities; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n </label>\n @if (p_view.projection) {\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.projectionBox\">\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarLabel\">\n {{ p_view.text.columns }}\n :\n </span>\n @for (p of p_view.projections; track p.key) {\n <label data-mps=\"query-builder\" [mpProps]=\"p.box\">\n <input data-mps=\"query-builder\" [mpProps]=\"p.input\">\n {{ p.label }}\n </label>\n }\n </span>\n }\n @if (p_view.projection) {\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.sortBox\">\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarLabel\">\n {{ p_view.text.sortBy }}\n :\n </span>\n @for (s of p_view.sorts; track s.key) {\n <span data-mps=\"query-builder\" [mpProps]=\"s.box\">\n <select data-mps=\"query-builder\" [mpProps]=\"s.field\">\n @for (o of s.fields; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n <select data-mps=\"query-builder\" [mpProps]=\"s.direction\">\n @for (o of s.directions; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n <button data-mps=\"query-builder\" [mpProps]=\"s.remove\">\n \u00D7\n </button>\n </span>\n }\n <button data-mps=\"query-builder\" [mpProps]=\"p_view.sortAdd\">\n + \n {{ p_view.text.addSort }}\n </button>\n </span>\n }\n </div>\n}\n@if (p_view.saved) {\n <div data-mps=\"query-builder\" [mpProps]=\"p_view.savedBox\">\n <div data-mps=\"query-builder\" [mpProps]=\"p_view.savedList\">\n @if (p_view.savedQueries.length === 0) {\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.savedEmpty\">\n {{ p_view.text.noSavedQueries }}\n </span>\n }\n @for (q of p_view.savedQueries; track q.key) {\n <span data-mps=\"query-builder\" [mpProps]=\"q.box\">\n <button data-mps=\"query-builder\" [mpProps]=\"q.load\">\n {{ q.loadText }}\n </button>\n <button data-mps=\"query-builder\" [mpProps]=\"q.remove\">\n {{ p_view.text.deleteQuery }}\n </button>\n </span>\n }\n </div>\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.savedNew\">\n <input data-mps=\"query-builder\" [mpProps]=\"p_view.savedName\">\n <button data-mps=\"query-builder\" [mpProps]=\"p_view.savedSave\">\n \uD83D\uDCBE \n {{ p_view.text.saveCurrentAs }}\n </button>\n </span>\n </div>\n}\n@if (p_view.preview) {\n <pre data-mps=\"query-builder\" [mpProps]=\"p_view.previewBox\">\n {{ p_view.previewText }}\n </pre>\n}\n<ul data-mps=\"query-builder\" [mpProps]=\"p_view.list\">\n <ng-container [ngTemplateOutlet]=\"partial_QueryBuilderItem\" [ngTemplateOutletContext]=\"{ node: p_view.tree, view: p_view }\" />\n</ul>\n<ng-template #partial_QueryBuilderItem mpPartialQueryBuilderItem let-pp_node=\"node\" let-pp_view=\"view\">\n <li data-mps=\"query-builder\" [mpProps]=\"pp_node.item\">\n @if (pp_node.kind === 'group') {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.group.header\">\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.group.logic\">\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.and\">\n {{ pp_view.text.logicAnd }}\n </button>\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.or\">\n {{ pp_view.text.logicOr }}\n </button>\n </span>\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.group.actions\">\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.addCondition\">\n + \n {{ pp_view.text.addCondition }}\n </button>\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.addGroup\">\n + \n {{ pp_view.text.addGroup }}\n </button>\n @if (pp_node.group.canAddSubquery) {\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.addSubquery\">\n + \n {{ pp_view.text.addSubquery }}\n </button>\n }\n @if (pp_node.group.removable) {\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.remove\">\n \u00D7\n </button>\n }\n </span>\n </div>\n } @else if (pp_node.kind === 'condition') {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.box\">\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.handle\">\n \u22EE\n </button>\n <select data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.field\">\n @for (o of pp_node.condition.fields; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n <select data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.operator\">\n @for (o of pp_node.condition.operators; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n @if (pp_node.condition.hasEditor) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.wrap\">\n @if (pp_node.condition.editor.custom) {\n @if (slots().editor; as slot_editor) {\n <ng-container [ngTemplateOutlet]=\"slot_editor\" [ngTemplateOutletContext]=\"{ $implicit: { ctx: pp_node.condition.editor.ctx }, ctx: pp_node.condition.editor.ctx }\" />\n }\n } @else if (pp_node.condition.editor.isSelect) {\n <select data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.select\">\n @for (o of pp_node.condition.editor.options; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n } @else if (pp_node.condition.editor.isChips) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.chipBox\">\n @for (c of pp_node.condition.editor.chips; track c.key) {\n <span data-mps=\"query-builder\" [mpProps]=\"c.bag\">\n {{ c.label }}\n <button data-mps=\"query-builder\" [mpProps]=\"c.remove\">\n \u00D7\n </button>\n </span>\n }\n <input data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.chipAdd\">\n </span>\n } @else {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.inputBox\">\n @for (inp of pp_node.condition.editor.inputs; track inp.key) {\n @if (inp.sep) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.sep\">\n \u2026 \n </span>\n }\n <input data-mps=\"query-builder\" [mpProps]=\"inp.bag\">\n }\n </span>\n }\n </span>\n }\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.remove\">\n \u00D7\n </button>\n </div>\n } @else if (pp_node.kind === 'subquery') {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.subquery.header\">\n <span data-mps=\"query-builder\" [mpProps]=\"pp_view.subqueryField\">\n {{ pp_node.subquery.fieldLabel }}\n </span>\n <span data-mps=\"query-builder\" [mpProps]=\"pp_view.subqueryOperator\">\n {{ pp_node.subquery.operatorLabel }}\n </span>\n @if (pp_node.subquery.target) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_view.subqueryTarget\">\n (\n {{ pp_node.subquery.target }}\n )\n </span>\n }\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.subquery.remove\">\n \u00D7\n </button>\n </div>\n } @else {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.note\">\n {{ pp_node.text }}\n </div>\n }\n @if (pp_node.children.length) {\n <ul data-mps=\"query-builder\" [mpProps]=\"pp_node.list\">\n @for (child of pp_node.children; track child.key) {\n <ng-container [ngTemplateOutlet]=\"partial_QueryBuilderItem\" [ngTemplateOutletContext]=\"{ node: child, view: pp_view }\" />\n }\n </ul>\n }\n </li>\n</ng-template>\n", dependencies: [{ kind: "directive", type: MpPropsDirective, selector: "[mpProps]", inputs: ["mpProps"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: QueryBuilderItemPartial, selector: "ng-template[mpPartialQueryBuilderItem]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
248
169
  }
249
170
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsQueryBuilderComponent, decorators: [{
250
171
  type: Component,
251
- args: [{ selector: 'bs-query-builder', standalone: true, imports: [BsForwardAriaDirective], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
252
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BsQueryBuilderComponent), multi: true },
253
- ], template: "<mp-query-builder bsForwardAria\n #wc\n [attr.disabled]=\"effectiveDisabled() ? '' : null\"\n (query-change)=\"onQueryChange($event)\"\n (root-entity-change)=\"onRootEntityChange($event)\"\n (selected-fields-change)=\"onSelectedFieldsChange($event)\"\n (sort-by-change)=\"onSortByChange($event)\"\n (save-query)=\"onSaveQuery($event)\"\n (load-query)=\"onLoadQuery($event)\"\n (delete-query)=\"onDeleteQuery($event)\"\n></mp-query-builder>\n", styles: [":host{display:block}\n"] }]
254
- }], ctorParameters: () => [], propDecorators: { query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }, { type: i0.Output, args: ["queryChange"] }], schema: [{ type: i0.Input, args: [{ isSignal: true, alias: "schema", required: false }] }], rootEntity: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootEntity", required: false }] }, { type: i0.Output, args: ["rootEntityChange"] }], multiEntityPickerEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiEntityPickerEnabled", required: false }] }], selectedFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedFields", required: false }] }, { type: i0.Output, args: ["selectedFieldsChange"] }], sortBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortBy", required: false }] }, { type: i0.Output, args: ["sortByChange"] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], showPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPreview", required: false }] }], showSavedQueries: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSavedQueries", required: false }] }], maxDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDepth", required: false }] }], savedQueries: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedQueries", required: false }] }], operatorOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "operatorOverrides", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], editorRegistry: [{ type: i0.Input, args: [{ isSignal: true, alias: "editorRegistry", required: false }] }], saveQuery: [{ type: i0.Output, args: ["saveQuery"] }], loadQuery: [{ type: i0.Output, args: ["loadQuery"] }], deleteQuery: [{ type: i0.Output, args: ["deleteQuery"] }], wcRef: [{ type: i0.ViewChild, args: ['wc', { isSignal: true }] }], editorDirectives: [{
255
- type: ContentChildren,
256
- args: [BsQueryBuilderEditorDirective]
257
- }] } });
172
+ args: [{ selector: 'bs-query-builder', imports: [MpPropsDirective, NgTemplateOutlet, QueryBuilderItemPartial], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: hostDirectives, template: "<!-- GENERATED from libs/mintplayer-ui-core/query-builder/src/templates/query-builder.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n@if (p_view.toolbar) {\n <div data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarBox\">\n <label data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarLabel\">\n {{ p_view.text.entity }}\n : \n <select data-mps=\"query-builder\" [mpProps]=\"p_view.entity\">\n @for (o of p_view.entities; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n </label>\n @if (p_view.projection) {\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.projectionBox\">\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarLabel\">\n {{ p_view.text.columns }}\n :\n </span>\n @for (p of p_view.projections; track p.key) {\n <label data-mps=\"query-builder\" [mpProps]=\"p.box\">\n <input data-mps=\"query-builder\" [mpProps]=\"p.input\">\n {{ p.label }}\n </label>\n }\n </span>\n }\n @if (p_view.projection) {\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.sortBox\">\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.toolbarLabel\">\n {{ p_view.text.sortBy }}\n :\n </span>\n @for (s of p_view.sorts; track s.key) {\n <span data-mps=\"query-builder\" [mpProps]=\"s.box\">\n <select data-mps=\"query-builder\" [mpProps]=\"s.field\">\n @for (o of s.fields; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n <select data-mps=\"query-builder\" [mpProps]=\"s.direction\">\n @for (o of s.directions; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n <button data-mps=\"query-builder\" [mpProps]=\"s.remove\">\n \u00D7\n </button>\n </span>\n }\n <button data-mps=\"query-builder\" [mpProps]=\"p_view.sortAdd\">\n + \n {{ p_view.text.addSort }}\n </button>\n </span>\n }\n </div>\n}\n@if (p_view.saved) {\n <div data-mps=\"query-builder\" [mpProps]=\"p_view.savedBox\">\n <div data-mps=\"query-builder\" [mpProps]=\"p_view.savedList\">\n @if (p_view.savedQueries.length === 0) {\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.savedEmpty\">\n {{ p_view.text.noSavedQueries }}\n </span>\n }\n @for (q of p_view.savedQueries; track q.key) {\n <span data-mps=\"query-builder\" [mpProps]=\"q.box\">\n <button data-mps=\"query-builder\" [mpProps]=\"q.load\">\n {{ q.loadText }}\n </button>\n <button data-mps=\"query-builder\" [mpProps]=\"q.remove\">\n {{ p_view.text.deleteQuery }}\n </button>\n </span>\n }\n </div>\n <span data-mps=\"query-builder\" [mpProps]=\"p_view.savedNew\">\n <input data-mps=\"query-builder\" [mpProps]=\"p_view.savedName\">\n <button data-mps=\"query-builder\" [mpProps]=\"p_view.savedSave\">\n \uD83D\uDCBE \n {{ p_view.text.saveCurrentAs }}\n </button>\n </span>\n </div>\n}\n@if (p_view.preview) {\n <pre data-mps=\"query-builder\" [mpProps]=\"p_view.previewBox\">\n {{ p_view.previewText }}\n </pre>\n}\n<ul data-mps=\"query-builder\" [mpProps]=\"p_view.list\">\n <ng-container [ngTemplateOutlet]=\"partial_QueryBuilderItem\" [ngTemplateOutletContext]=\"{ node: p_view.tree, view: p_view }\" />\n</ul>\n<ng-template #partial_QueryBuilderItem mpPartialQueryBuilderItem let-pp_node=\"node\" let-pp_view=\"view\">\n <li data-mps=\"query-builder\" [mpProps]=\"pp_node.item\">\n @if (pp_node.kind === 'group') {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.group.header\">\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.group.logic\">\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.and\">\n {{ pp_view.text.logicAnd }}\n </button>\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.or\">\n {{ pp_view.text.logicOr }}\n </button>\n </span>\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.group.actions\">\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.addCondition\">\n + \n {{ pp_view.text.addCondition }}\n </button>\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.addGroup\">\n + \n {{ pp_view.text.addGroup }}\n </button>\n @if (pp_node.group.canAddSubquery) {\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.addSubquery\">\n + \n {{ pp_view.text.addSubquery }}\n </button>\n }\n @if (pp_node.group.removable) {\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.group.remove\">\n \u00D7\n </button>\n }\n </span>\n </div>\n } @else if (pp_node.kind === 'condition') {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.box\">\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.handle\">\n \u22EE\n </button>\n <select data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.field\">\n @for (o of pp_node.condition.fields; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n <select data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.operator\">\n @for (o of pp_node.condition.operators; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n @if (pp_node.condition.hasEditor) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.wrap\">\n @if (pp_node.condition.editor.custom) {\n @if (slots().editor; as slot_editor) {\n <ng-container [ngTemplateOutlet]=\"slot_editor\" [ngTemplateOutletContext]=\"{ $implicit: { ctx: pp_node.condition.editor.ctx }, ctx: pp_node.condition.editor.ctx }\" />\n }\n } @else if (pp_node.condition.editor.isSelect) {\n <select data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.select\">\n @for (o of pp_node.condition.editor.options; track o.key) {\n <option data-mps=\"query-builder\" [mpProps]=\"o.bag\">\n {{ o.label }}\n </option>\n }\n </select>\n } @else if (pp_node.condition.editor.isChips) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.chipBox\">\n @for (c of pp_node.condition.editor.chips; track c.key) {\n <span data-mps=\"query-builder\" [mpProps]=\"c.bag\">\n {{ c.label }}\n <button data-mps=\"query-builder\" [mpProps]=\"c.remove\">\n \u00D7\n </button>\n </span>\n }\n <input data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.chipAdd\">\n </span>\n } @else {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.inputBox\">\n @for (inp of pp_node.condition.editor.inputs; track inp.key) {\n @if (inp.sep) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.editor.sep\">\n \u2026 \n </span>\n }\n <input data-mps=\"query-builder\" [mpProps]=\"inp.bag\">\n }\n </span>\n }\n </span>\n }\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.condition.remove\">\n \u00D7\n </button>\n </div>\n } @else if (pp_node.kind === 'subquery') {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.subquery.header\">\n <span data-mps=\"query-builder\" [mpProps]=\"pp_view.subqueryField\">\n {{ pp_node.subquery.fieldLabel }}\n </span>\n <span data-mps=\"query-builder\" [mpProps]=\"pp_view.subqueryOperator\">\n {{ pp_node.subquery.operatorLabel }}\n </span>\n @if (pp_node.subquery.target) {\n <span data-mps=\"query-builder\" [mpProps]=\"pp_view.subqueryTarget\">\n (\n {{ pp_node.subquery.target }}\n )\n </span>\n }\n <button data-mps=\"query-builder\" [mpProps]=\"pp_node.subquery.remove\">\n \u00D7\n </button>\n </div>\n } @else {\n <div data-mps=\"query-builder\" [mpProps]=\"pp_node.note\">\n {{ pp_node.text }}\n </div>\n }\n @if (pp_node.children.length) {\n <ul data-mps=\"query-builder\" [mpProps]=\"pp_node.list\">\n @for (child of pp_node.children; track child.key) {\n <ng-container [ngTemplateOutlet]=\"partial_QueryBuilderItem\" [ngTemplateOutletContext]=\"{ node: child, view: pp_view }\" />\n }\n </ul>\n }\n </li>\n</ng-template>\n" }]
173
+ }], ctorParameters: () => [], propDecorators: { query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }, { type: i0.Output, args: ["queryChange"] }], schema: [{ type: i0.Input, args: [{ isSignal: true, alias: "schema", required: false }] }], rootEntity: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootEntity", required: false }] }, { type: i0.Output, args: ["rootEntityChange"] }], multiEntityPickerEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiEntityPickerEnabled", required: false }] }], selectedFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedFields", required: false }] }, { type: i0.Output, args: ["selectedFieldsChange"] }], sortBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortBy", required: false }] }, { type: i0.Output, args: ["sortByChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], maxDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDepth", required: false }] }], showPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPreview", required: false }] }], showSavedQueries: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSavedQueries", required: false }] }], savedQueries: [{ type: i0.Input, args: [{ isSignal: true, alias: "savedQueries", required: false }] }], querychange: [{ type: i0.Output, args: ["querychange"] }], rootentitychange: [{ type: i0.Output, args: ["rootentitychange"] }], selectedfieldschange: [{ type: i0.Output, args: ["selectedfieldschange"] }], sortbychange: [{ type: i0.Output, args: ["sortbychange"] }], savequery: [{ type: i0.Output, args: ["savequery"] }], loadquery: [{ type: i0.Output, args: ["loadquery"] }], deletequery: [{ type: i0.Output, args: ["deletequery"] }], editorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsQueryBuilderEditorDirective), { isSignal: true }] }] } });
174
+
175
+ // GENERATED from the query-builder manifest by @mintplayer/nx-component-compiler. Do not edit.
258
176
 
259
- // Re-export everything framework-agnostic from the WC entry. The Angular
260
- // wrapper component + editor directive remain Angular-specific.
177
+ // The query builder is generated from @mintplayer/ui-core/query-builder (PRD #437 D10).
261
178
 
262
179
  /**
263
180
  * Generated bundle index. Do not edit.
264
181
  */
265
182
 
266
- export { BsQueryBuilderComponent, BsQueryBuilderEditorDirective };
183
+ export { BsQueryBuilderComponent, BsQueryBuilderEditorDirective, BsQueryBuilderValueAccessor };
267
184
  //# sourceMappingURL=mintplayer-ng-bootstrap-query-builder.mjs.map